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        /// Sets the value of [location][crate::model::SqlOperationsGetRequest::location].
5911        pub fn set_location<T: Into<std::string::String>>(mut self, v: T) -> Self {
5912            self.0.request.location = v.into();
5913            self
5914        }
5915    }
5916
5917    #[doc(hidden)]
5918    impl crate::RequestBuilder for Get {
5919        fn request_options(&mut self) -> &mut crate::RequestOptions {
5920            &mut self.0.options
5921        }
5922    }
5923
5924    /// The request builder for [SqlOperationsService::list][crate::client::SqlOperationsService::list] calls.
5925    ///
5926    /// # Example
5927    /// ```
5928    /// # use google_cloud_sql_v1::builder::sql_operations_service::List;
5929    /// # async fn sample() -> google_cloud_sql_v1::Result<()> {
5930    /// use google_cloud_gax::paginator::ItemPaginator;
5931    ///
5932    /// let builder = prepare_request_builder();
5933    /// let mut items = builder.by_item();
5934    /// while let Some(result) = items.next().await {
5935    ///   let item = result?;
5936    /// }
5937    /// # Ok(()) }
5938    ///
5939    /// fn prepare_request_builder() -> List {
5940    ///   # panic!();
5941    ///   // ... details omitted ...
5942    /// }
5943    /// ```
5944    #[derive(Clone, Debug)]
5945    pub struct List(RequestBuilder<crate::model::SqlOperationsListRequest>);
5946
5947    impl List {
5948        pub(crate) fn new(
5949            stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlOperationsService>,
5950        ) -> Self {
5951            Self(RequestBuilder::new(stub))
5952        }
5953
5954        /// Sets the full request, replacing any prior values.
5955        pub fn with_request<V: Into<crate::model::SqlOperationsListRequest>>(
5956            mut self,
5957            v: V,
5958        ) -> Self {
5959            self.0.request = v.into();
5960            self
5961        }
5962
5963        /// Sets all the options, replacing any prior values.
5964        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
5965            self.0.options = v.into();
5966            self
5967        }
5968
5969        /// Sends the request.
5970        pub async fn send(self) -> Result<crate::model::OperationsListResponse> {
5971            (*self.0.stub)
5972                .list(self.0.request, self.0.options)
5973                .await
5974                .map(crate::Response::into_body)
5975        }
5976
5977        /// Streams each page in the collection.
5978        pub fn by_page(
5979            self,
5980        ) -> impl google_cloud_gax::paginator::Paginator<
5981            crate::model::OperationsListResponse,
5982            crate::Error,
5983        > {
5984            use std::clone::Clone;
5985            let token = self.0.request.page_token.clone();
5986            let execute = move |token: String| {
5987                let mut builder = self.clone();
5988                builder.0.request = builder.0.request.set_page_token(token);
5989                builder.send()
5990            };
5991            google_cloud_gax::paginator::internal::new_paginator(token, execute)
5992        }
5993
5994        /// Streams each item in the collection.
5995        pub fn by_item(
5996            self,
5997        ) -> impl google_cloud_gax::paginator::ItemPaginator<
5998            crate::model::OperationsListResponse,
5999            crate::Error,
6000        > {
6001            use google_cloud_gax::paginator::Paginator;
6002            self.by_page().items()
6003        }
6004
6005        /// Sets the value of [instance][crate::model::SqlOperationsListRequest::instance].
6006        pub fn set_instance<T: Into<std::string::String>>(mut self, v: T) -> Self {
6007            self.0.request.instance = v.into();
6008            self
6009        }
6010
6011        /// Sets the value of [max_results][crate::model::SqlOperationsListRequest::max_results].
6012        pub fn set_max_results<T: Into<u32>>(mut self, v: T) -> Self {
6013            self.0.request.max_results = v.into();
6014            self
6015        }
6016
6017        /// Sets the value of [page_token][crate::model::SqlOperationsListRequest::page_token].
6018        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
6019            self.0.request.page_token = v.into();
6020            self
6021        }
6022
6023        /// Sets the value of [project][crate::model::SqlOperationsListRequest::project].
6024        pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
6025            self.0.request.project = v.into();
6026            self
6027        }
6028
6029        /// Sets the value of [location][crate::model::SqlOperationsListRequest::location].
6030        pub fn set_location<T: Into<std::string::String>>(mut self, v: T) -> Self {
6031            self.0.request.location = v.into();
6032            self
6033        }
6034    }
6035
6036    #[doc(hidden)]
6037    impl crate::RequestBuilder for List {
6038        fn request_options(&mut self) -> &mut crate::RequestOptions {
6039            &mut self.0.options
6040        }
6041    }
6042
6043    /// The request builder for [SqlOperationsService::cancel][crate::client::SqlOperationsService::cancel] calls.
6044    ///
6045    /// # Example
6046    /// ```
6047    /// # use google_cloud_sql_v1::builder::sql_operations_service::Cancel;
6048    /// # async fn sample() -> google_cloud_sql_v1::Result<()> {
6049    ///
6050    /// let builder = prepare_request_builder();
6051    /// let response = builder.send().await?;
6052    /// # Ok(()) }
6053    ///
6054    /// fn prepare_request_builder() -> Cancel {
6055    ///   # panic!();
6056    ///   // ... details omitted ...
6057    /// }
6058    /// ```
6059    #[derive(Clone, Debug)]
6060    pub struct Cancel(RequestBuilder<crate::model::SqlOperationsCancelRequest>);
6061
6062    impl Cancel {
6063        pub(crate) fn new(
6064            stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlOperationsService>,
6065        ) -> Self {
6066            Self(RequestBuilder::new(stub))
6067        }
6068
6069        /// Sets the full request, replacing any prior values.
6070        pub fn with_request<V: Into<crate::model::SqlOperationsCancelRequest>>(
6071            mut self,
6072            v: V,
6073        ) -> Self {
6074            self.0.request = v.into();
6075            self
6076        }
6077
6078        /// Sets all the options, replacing any prior values.
6079        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
6080            self.0.options = v.into();
6081            self
6082        }
6083
6084        /// Sends the request.
6085        pub async fn send(self) -> Result<()> {
6086            (*self.0.stub)
6087                .cancel(self.0.request, self.0.options)
6088                .await
6089                .map(crate::Response::into_body)
6090        }
6091
6092        /// Sets the value of [operation][crate::model::SqlOperationsCancelRequest::operation].
6093        pub fn set_operation<T: Into<std::string::String>>(mut self, v: T) -> Self {
6094            self.0.request.operation = v.into();
6095            self
6096        }
6097
6098        /// Sets the value of [project][crate::model::SqlOperationsCancelRequest::project].
6099        pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
6100            self.0.request.project = v.into();
6101            self
6102        }
6103
6104        /// Sets the value of [location][crate::model::SqlOperationsCancelRequest::location].
6105        pub fn set_location<T: Into<std::string::String>>(mut self, v: T) -> Self {
6106            self.0.request.location = v.into();
6107            self
6108        }
6109    }
6110
6111    #[doc(hidden)]
6112    impl crate::RequestBuilder for Cancel {
6113        fn request_options(&mut self) -> &mut crate::RequestOptions {
6114            &mut self.0.options
6115        }
6116    }
6117}
6118
6119/// Request and client builders for [SqlSslCertsService][crate::client::SqlSslCertsService].
6120pub mod sql_ssl_certs_service {
6121    use crate::Result;
6122
6123    /// A builder for [SqlSslCertsService][crate::client::SqlSslCertsService].
6124    ///
6125    /// ```
6126    /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
6127    /// # use google_cloud_sql_v1::*;
6128    /// # use builder::sql_ssl_certs_service::ClientBuilder;
6129    /// # use client::SqlSslCertsService;
6130    /// let builder : ClientBuilder = SqlSslCertsService::builder();
6131    /// let client = builder
6132    ///     .with_endpoint("https://sqladmin.googleapis.com")
6133    ///     .build().await?;
6134    /// # Ok(()) }
6135    /// ```
6136    pub type ClientBuilder = crate::ClientBuilder<client::Factory, gaxi::options::Credentials>;
6137
6138    pub(crate) mod client {
6139        use super::super::super::client::SqlSslCertsService;
6140        pub struct Factory;
6141        impl crate::ClientFactory for Factory {
6142            type Client = SqlSslCertsService;
6143            type Credentials = gaxi::options::Credentials;
6144            async fn build(
6145                self,
6146                config: gaxi::options::ClientConfig,
6147            ) -> crate::ClientBuilderResult<Self::Client> {
6148                Self::Client::new(config).await
6149            }
6150        }
6151    }
6152
6153    /// Common implementation for [crate::client::SqlSslCertsService] request builders.
6154    #[derive(Clone, Debug)]
6155    pub(crate) struct RequestBuilder<R: std::default::Default> {
6156        stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlSslCertsService>,
6157        request: R,
6158        options: crate::RequestOptions,
6159    }
6160
6161    impl<R> RequestBuilder<R>
6162    where
6163        R: std::default::Default,
6164    {
6165        pub(crate) fn new(
6166            stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlSslCertsService>,
6167        ) -> Self {
6168            Self {
6169                stub,
6170                request: R::default(),
6171                options: crate::RequestOptions::default(),
6172            }
6173        }
6174    }
6175
6176    /// The request builder for [SqlSslCertsService::delete][crate::client::SqlSslCertsService::delete] calls.
6177    ///
6178    /// # Example
6179    /// ```
6180    /// # use google_cloud_sql_v1::builder::sql_ssl_certs_service::Delete;
6181    /// # async fn sample() -> google_cloud_sql_v1::Result<()> {
6182    ///
6183    /// let builder = prepare_request_builder();
6184    /// let response = builder.send().await?;
6185    /// # Ok(()) }
6186    ///
6187    /// fn prepare_request_builder() -> Delete {
6188    ///   # panic!();
6189    ///   // ... details omitted ...
6190    /// }
6191    /// ```
6192    #[derive(Clone, Debug)]
6193    pub struct Delete(RequestBuilder<crate::model::SqlSslCertsDeleteRequest>);
6194
6195    impl Delete {
6196        pub(crate) fn new(
6197            stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlSslCertsService>,
6198        ) -> Self {
6199            Self(RequestBuilder::new(stub))
6200        }
6201
6202        /// Sets the full request, replacing any prior values.
6203        pub fn with_request<V: Into<crate::model::SqlSslCertsDeleteRequest>>(
6204            mut self,
6205            v: V,
6206        ) -> Self {
6207            self.0.request = v.into();
6208            self
6209        }
6210
6211        /// Sets all the options, replacing any prior values.
6212        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
6213            self.0.options = v.into();
6214            self
6215        }
6216
6217        /// Sends the request.
6218        pub async fn send(self) -> Result<crate::model::Operation> {
6219            (*self.0.stub)
6220                .delete(self.0.request, self.0.options)
6221                .await
6222                .map(crate::Response::into_body)
6223        }
6224
6225        /// Sets the value of [instance][crate::model::SqlSslCertsDeleteRequest::instance].
6226        pub fn set_instance<T: Into<std::string::String>>(mut self, v: T) -> Self {
6227            self.0.request.instance = v.into();
6228            self
6229        }
6230
6231        /// Sets the value of [project][crate::model::SqlSslCertsDeleteRequest::project].
6232        pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
6233            self.0.request.project = v.into();
6234            self
6235        }
6236
6237        /// Sets the value of [sha1_fingerprint][crate::model::SqlSslCertsDeleteRequest::sha1_fingerprint].
6238        pub fn set_sha1_fingerprint<T: Into<std::string::String>>(mut self, v: T) -> Self {
6239            self.0.request.sha1_fingerprint = v.into();
6240            self
6241        }
6242    }
6243
6244    #[doc(hidden)]
6245    impl crate::RequestBuilder for Delete {
6246        fn request_options(&mut self) -> &mut crate::RequestOptions {
6247            &mut self.0.options
6248        }
6249    }
6250
6251    /// The request builder for [SqlSslCertsService::get][crate::client::SqlSslCertsService::get] calls.
6252    ///
6253    /// # Example
6254    /// ```
6255    /// # use google_cloud_sql_v1::builder::sql_ssl_certs_service::Get;
6256    /// # async fn sample() -> google_cloud_sql_v1::Result<()> {
6257    ///
6258    /// let builder = prepare_request_builder();
6259    /// let response = builder.send().await?;
6260    /// # Ok(()) }
6261    ///
6262    /// fn prepare_request_builder() -> Get {
6263    ///   # panic!();
6264    ///   // ... details omitted ...
6265    /// }
6266    /// ```
6267    #[derive(Clone, Debug)]
6268    pub struct Get(RequestBuilder<crate::model::SqlSslCertsGetRequest>);
6269
6270    impl Get {
6271        pub(crate) fn new(
6272            stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlSslCertsService>,
6273        ) -> Self {
6274            Self(RequestBuilder::new(stub))
6275        }
6276
6277        /// Sets the full request, replacing any prior values.
6278        pub fn with_request<V: Into<crate::model::SqlSslCertsGetRequest>>(mut self, v: V) -> Self {
6279            self.0.request = v.into();
6280            self
6281        }
6282
6283        /// Sets all the options, replacing any prior values.
6284        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
6285            self.0.options = v.into();
6286            self
6287        }
6288
6289        /// Sends the request.
6290        pub async fn send(self) -> Result<crate::model::SslCert> {
6291            (*self.0.stub)
6292                .get(self.0.request, self.0.options)
6293                .await
6294                .map(crate::Response::into_body)
6295        }
6296
6297        /// Sets the value of [instance][crate::model::SqlSslCertsGetRequest::instance].
6298        pub fn set_instance<T: Into<std::string::String>>(mut self, v: T) -> Self {
6299            self.0.request.instance = v.into();
6300            self
6301        }
6302
6303        /// Sets the value of [project][crate::model::SqlSslCertsGetRequest::project].
6304        pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
6305            self.0.request.project = v.into();
6306            self
6307        }
6308
6309        /// Sets the value of [sha1_fingerprint][crate::model::SqlSslCertsGetRequest::sha1_fingerprint].
6310        pub fn set_sha1_fingerprint<T: Into<std::string::String>>(mut self, v: T) -> Self {
6311            self.0.request.sha1_fingerprint = v.into();
6312            self
6313        }
6314    }
6315
6316    #[doc(hidden)]
6317    impl crate::RequestBuilder for Get {
6318        fn request_options(&mut self) -> &mut crate::RequestOptions {
6319            &mut self.0.options
6320        }
6321    }
6322
6323    /// The request builder for [SqlSslCertsService::insert][crate::client::SqlSslCertsService::insert] calls.
6324    ///
6325    /// # Example
6326    /// ```
6327    /// # use google_cloud_sql_v1::builder::sql_ssl_certs_service::Insert;
6328    /// # async fn sample() -> google_cloud_sql_v1::Result<()> {
6329    ///
6330    /// let builder = prepare_request_builder();
6331    /// let response = builder.send().await?;
6332    /// # Ok(()) }
6333    ///
6334    /// fn prepare_request_builder() -> Insert {
6335    ///   # panic!();
6336    ///   // ... details omitted ...
6337    /// }
6338    /// ```
6339    #[derive(Clone, Debug)]
6340    pub struct Insert(RequestBuilder<crate::model::SqlSslCertsInsertRequest>);
6341
6342    impl Insert {
6343        pub(crate) fn new(
6344            stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlSslCertsService>,
6345        ) -> Self {
6346            Self(RequestBuilder::new(stub))
6347        }
6348
6349        /// Sets the full request, replacing any prior values.
6350        pub fn with_request<V: Into<crate::model::SqlSslCertsInsertRequest>>(
6351            mut self,
6352            v: V,
6353        ) -> Self {
6354            self.0.request = v.into();
6355            self
6356        }
6357
6358        /// Sets all the options, replacing any prior values.
6359        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
6360            self.0.options = v.into();
6361            self
6362        }
6363
6364        /// Sends the request.
6365        pub async fn send(self) -> Result<crate::model::SslCertsInsertResponse> {
6366            (*self.0.stub)
6367                .insert(self.0.request, self.0.options)
6368                .await
6369                .map(crate::Response::into_body)
6370        }
6371
6372        /// Sets the value of [instance][crate::model::SqlSslCertsInsertRequest::instance].
6373        pub fn set_instance<T: Into<std::string::String>>(mut self, v: T) -> Self {
6374            self.0.request.instance = v.into();
6375            self
6376        }
6377
6378        /// Sets the value of [project][crate::model::SqlSslCertsInsertRequest::project].
6379        pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
6380            self.0.request.project = v.into();
6381            self
6382        }
6383
6384        /// Sets the value of [body][crate::model::SqlSslCertsInsertRequest::body].
6385        pub fn set_body<T>(mut self, v: T) -> Self
6386        where
6387            T: std::convert::Into<crate::model::SslCertsInsertRequest>,
6388        {
6389            self.0.request.body = std::option::Option::Some(v.into());
6390            self
6391        }
6392
6393        /// Sets or clears the value of [body][crate::model::SqlSslCertsInsertRequest::body].
6394        pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
6395        where
6396            T: std::convert::Into<crate::model::SslCertsInsertRequest>,
6397        {
6398            self.0.request.body = v.map(|x| x.into());
6399            self
6400        }
6401    }
6402
6403    #[doc(hidden)]
6404    impl crate::RequestBuilder for Insert {
6405        fn request_options(&mut self) -> &mut crate::RequestOptions {
6406            &mut self.0.options
6407        }
6408    }
6409
6410    /// The request builder for [SqlSslCertsService::list][crate::client::SqlSslCertsService::list] calls.
6411    ///
6412    /// # Example
6413    /// ```
6414    /// # use google_cloud_sql_v1::builder::sql_ssl_certs_service::List;
6415    /// # async fn sample() -> google_cloud_sql_v1::Result<()> {
6416    ///
6417    /// let builder = prepare_request_builder();
6418    /// let response = builder.send().await?;
6419    /// # Ok(()) }
6420    ///
6421    /// fn prepare_request_builder() -> List {
6422    ///   # panic!();
6423    ///   // ... details omitted ...
6424    /// }
6425    /// ```
6426    #[derive(Clone, Debug)]
6427    pub struct List(RequestBuilder<crate::model::SqlSslCertsListRequest>);
6428
6429    impl List {
6430        pub(crate) fn new(
6431            stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlSslCertsService>,
6432        ) -> Self {
6433            Self(RequestBuilder::new(stub))
6434        }
6435
6436        /// Sets the full request, replacing any prior values.
6437        pub fn with_request<V: Into<crate::model::SqlSslCertsListRequest>>(mut self, v: V) -> Self {
6438            self.0.request = v.into();
6439            self
6440        }
6441
6442        /// Sets all the options, replacing any prior values.
6443        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
6444            self.0.options = v.into();
6445            self
6446        }
6447
6448        /// Sends the request.
6449        pub async fn send(self) -> Result<crate::model::SslCertsListResponse> {
6450            (*self.0.stub)
6451                .list(self.0.request, self.0.options)
6452                .await
6453                .map(crate::Response::into_body)
6454        }
6455
6456        /// Sets the value of [instance][crate::model::SqlSslCertsListRequest::instance].
6457        pub fn set_instance<T: Into<std::string::String>>(mut self, v: T) -> Self {
6458            self.0.request.instance = v.into();
6459            self
6460        }
6461
6462        /// Sets the value of [project][crate::model::SqlSslCertsListRequest::project].
6463        pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
6464            self.0.request.project = v.into();
6465            self
6466        }
6467    }
6468
6469    #[doc(hidden)]
6470    impl crate::RequestBuilder for List {
6471        fn request_options(&mut self) -> &mut crate::RequestOptions {
6472            &mut self.0.options
6473        }
6474    }
6475}
6476
6477/// Request and client builders for [SqlTiersService][crate::client::SqlTiersService].
6478pub mod sql_tiers_service {
6479    use crate::Result;
6480
6481    /// A builder for [SqlTiersService][crate::client::SqlTiersService].
6482    ///
6483    /// ```
6484    /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
6485    /// # use google_cloud_sql_v1::*;
6486    /// # use builder::sql_tiers_service::ClientBuilder;
6487    /// # use client::SqlTiersService;
6488    /// let builder : ClientBuilder = SqlTiersService::builder();
6489    /// let client = builder
6490    ///     .with_endpoint("https://sqladmin.googleapis.com")
6491    ///     .build().await?;
6492    /// # Ok(()) }
6493    /// ```
6494    pub type ClientBuilder = crate::ClientBuilder<client::Factory, gaxi::options::Credentials>;
6495
6496    pub(crate) mod client {
6497        use super::super::super::client::SqlTiersService;
6498        pub struct Factory;
6499        impl crate::ClientFactory for Factory {
6500            type Client = SqlTiersService;
6501            type Credentials = gaxi::options::Credentials;
6502            async fn build(
6503                self,
6504                config: gaxi::options::ClientConfig,
6505            ) -> crate::ClientBuilderResult<Self::Client> {
6506                Self::Client::new(config).await
6507            }
6508        }
6509    }
6510
6511    /// Common implementation for [crate::client::SqlTiersService] request builders.
6512    #[derive(Clone, Debug)]
6513    pub(crate) struct RequestBuilder<R: std::default::Default> {
6514        stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlTiersService>,
6515        request: R,
6516        options: crate::RequestOptions,
6517    }
6518
6519    impl<R> RequestBuilder<R>
6520    where
6521        R: std::default::Default,
6522    {
6523        pub(crate) fn new(
6524            stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlTiersService>,
6525        ) -> Self {
6526            Self {
6527                stub,
6528                request: R::default(),
6529                options: crate::RequestOptions::default(),
6530            }
6531        }
6532    }
6533
6534    /// The request builder for [SqlTiersService::list][crate::client::SqlTiersService::list] calls.
6535    ///
6536    /// # Example
6537    /// ```
6538    /// # use google_cloud_sql_v1::builder::sql_tiers_service::List;
6539    /// # async fn sample() -> google_cloud_sql_v1::Result<()> {
6540    ///
6541    /// let builder = prepare_request_builder();
6542    /// let response = builder.send().await?;
6543    /// # Ok(()) }
6544    ///
6545    /// fn prepare_request_builder() -> List {
6546    ///   # panic!();
6547    ///   // ... details omitted ...
6548    /// }
6549    /// ```
6550    #[derive(Clone, Debug)]
6551    pub struct List(RequestBuilder<crate::model::SqlTiersListRequest>);
6552
6553    impl List {
6554        pub(crate) fn new(
6555            stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlTiersService>,
6556        ) -> Self {
6557            Self(RequestBuilder::new(stub))
6558        }
6559
6560        /// Sets the full request, replacing any prior values.
6561        pub fn with_request<V: Into<crate::model::SqlTiersListRequest>>(mut self, v: V) -> Self {
6562            self.0.request = v.into();
6563            self
6564        }
6565
6566        /// Sets all the options, replacing any prior values.
6567        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
6568            self.0.options = v.into();
6569            self
6570        }
6571
6572        /// Sends the request.
6573        pub async fn send(self) -> Result<crate::model::TiersListResponse> {
6574            (*self.0.stub)
6575                .list(self.0.request, self.0.options)
6576                .await
6577                .map(crate::Response::into_body)
6578        }
6579
6580        /// Sets the value of [project][crate::model::SqlTiersListRequest::project].
6581        pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
6582            self.0.request.project = v.into();
6583            self
6584        }
6585    }
6586
6587    #[doc(hidden)]
6588    impl crate::RequestBuilder for List {
6589        fn request_options(&mut self) -> &mut crate::RequestOptions {
6590            &mut self.0.options
6591        }
6592    }
6593}
6594
6595/// Request and client builders for [SqlUsersService][crate::client::SqlUsersService].
6596pub mod sql_users_service {
6597    use crate::Result;
6598
6599    /// A builder for [SqlUsersService][crate::client::SqlUsersService].
6600    ///
6601    /// ```
6602    /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
6603    /// # use google_cloud_sql_v1::*;
6604    /// # use builder::sql_users_service::ClientBuilder;
6605    /// # use client::SqlUsersService;
6606    /// let builder : ClientBuilder = SqlUsersService::builder();
6607    /// let client = builder
6608    ///     .with_endpoint("https://sqladmin.googleapis.com")
6609    ///     .build().await?;
6610    /// # Ok(()) }
6611    /// ```
6612    pub type ClientBuilder = crate::ClientBuilder<client::Factory, gaxi::options::Credentials>;
6613
6614    pub(crate) mod client {
6615        use super::super::super::client::SqlUsersService;
6616        pub struct Factory;
6617        impl crate::ClientFactory for Factory {
6618            type Client = SqlUsersService;
6619            type Credentials = gaxi::options::Credentials;
6620            async fn build(
6621                self,
6622                config: gaxi::options::ClientConfig,
6623            ) -> crate::ClientBuilderResult<Self::Client> {
6624                Self::Client::new(config).await
6625            }
6626        }
6627    }
6628
6629    /// Common implementation for [crate::client::SqlUsersService] request builders.
6630    #[derive(Clone, Debug)]
6631    pub(crate) struct RequestBuilder<R: std::default::Default> {
6632        stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlUsersService>,
6633        request: R,
6634        options: crate::RequestOptions,
6635    }
6636
6637    impl<R> RequestBuilder<R>
6638    where
6639        R: std::default::Default,
6640    {
6641        pub(crate) fn new(
6642            stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlUsersService>,
6643        ) -> Self {
6644            Self {
6645                stub,
6646                request: R::default(),
6647                options: crate::RequestOptions::default(),
6648            }
6649        }
6650    }
6651
6652    /// The request builder for [SqlUsersService::delete][crate::client::SqlUsersService::delete] calls.
6653    ///
6654    /// # Example
6655    /// ```
6656    /// # use google_cloud_sql_v1::builder::sql_users_service::Delete;
6657    /// # async fn sample() -> google_cloud_sql_v1::Result<()> {
6658    ///
6659    /// let builder = prepare_request_builder();
6660    /// let response = builder.send().await?;
6661    /// # Ok(()) }
6662    ///
6663    /// fn prepare_request_builder() -> Delete {
6664    ///   # panic!();
6665    ///   // ... details omitted ...
6666    /// }
6667    /// ```
6668    #[derive(Clone, Debug)]
6669    pub struct Delete(RequestBuilder<crate::model::SqlUsersDeleteRequest>);
6670
6671    impl Delete {
6672        pub(crate) fn new(
6673            stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlUsersService>,
6674        ) -> Self {
6675            Self(RequestBuilder::new(stub))
6676        }
6677
6678        /// Sets the full request, replacing any prior values.
6679        pub fn with_request<V: Into<crate::model::SqlUsersDeleteRequest>>(mut self, v: V) -> Self {
6680            self.0.request = v.into();
6681            self
6682        }
6683
6684        /// Sets all the options, replacing any prior values.
6685        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
6686            self.0.options = v.into();
6687            self
6688        }
6689
6690        /// Sends the request.
6691        pub async fn send(self) -> Result<crate::model::Operation> {
6692            (*self.0.stub)
6693                .delete(self.0.request, self.0.options)
6694                .await
6695                .map(crate::Response::into_body)
6696        }
6697
6698        /// Sets the value of [host][crate::model::SqlUsersDeleteRequest::host].
6699        pub fn set_host<T: Into<std::string::String>>(mut self, v: T) -> Self {
6700            self.0.request.host = v.into();
6701            self
6702        }
6703
6704        /// Sets the value of [instance][crate::model::SqlUsersDeleteRequest::instance].
6705        pub fn set_instance<T: Into<std::string::String>>(mut self, v: T) -> Self {
6706            self.0.request.instance = v.into();
6707            self
6708        }
6709
6710        /// Sets the value of [name][crate::model::SqlUsersDeleteRequest::name].
6711        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
6712            self.0.request.name = v.into();
6713            self
6714        }
6715
6716        /// Sets the value of [project][crate::model::SqlUsersDeleteRequest::project].
6717        pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
6718            self.0.request.project = v.into();
6719            self
6720        }
6721    }
6722
6723    #[doc(hidden)]
6724    impl crate::RequestBuilder for Delete {
6725        fn request_options(&mut self) -> &mut crate::RequestOptions {
6726            &mut self.0.options
6727        }
6728    }
6729
6730    /// The request builder for [SqlUsersService::get][crate::client::SqlUsersService::get] calls.
6731    ///
6732    /// # Example
6733    /// ```
6734    /// # use google_cloud_sql_v1::builder::sql_users_service::Get;
6735    /// # async fn sample() -> google_cloud_sql_v1::Result<()> {
6736    ///
6737    /// let builder = prepare_request_builder();
6738    /// let response = builder.send().await?;
6739    /// # Ok(()) }
6740    ///
6741    /// fn prepare_request_builder() -> Get {
6742    ///   # panic!();
6743    ///   // ... details omitted ...
6744    /// }
6745    /// ```
6746    #[derive(Clone, Debug)]
6747    pub struct Get(RequestBuilder<crate::model::SqlUsersGetRequest>);
6748
6749    impl Get {
6750        pub(crate) fn new(
6751            stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlUsersService>,
6752        ) -> Self {
6753            Self(RequestBuilder::new(stub))
6754        }
6755
6756        /// Sets the full request, replacing any prior values.
6757        pub fn with_request<V: Into<crate::model::SqlUsersGetRequest>>(mut self, v: V) -> Self {
6758            self.0.request = v.into();
6759            self
6760        }
6761
6762        /// Sets all the options, replacing any prior values.
6763        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
6764            self.0.options = v.into();
6765            self
6766        }
6767
6768        /// Sends the request.
6769        pub async fn send(self) -> Result<crate::model::User> {
6770            (*self.0.stub)
6771                .get(self.0.request, self.0.options)
6772                .await
6773                .map(crate::Response::into_body)
6774        }
6775
6776        /// Sets the value of [instance][crate::model::SqlUsersGetRequest::instance].
6777        pub fn set_instance<T: Into<std::string::String>>(mut self, v: T) -> Self {
6778            self.0.request.instance = v.into();
6779            self
6780        }
6781
6782        /// Sets the value of [name][crate::model::SqlUsersGetRequest::name].
6783        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
6784            self.0.request.name = v.into();
6785            self
6786        }
6787
6788        /// Sets the value of [project][crate::model::SqlUsersGetRequest::project].
6789        pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
6790            self.0.request.project = v.into();
6791            self
6792        }
6793
6794        /// Sets the value of [host][crate::model::SqlUsersGetRequest::host].
6795        pub fn set_host<T: Into<std::string::String>>(mut self, v: T) -> Self {
6796            self.0.request.host = v.into();
6797            self
6798        }
6799    }
6800
6801    #[doc(hidden)]
6802    impl crate::RequestBuilder for Get {
6803        fn request_options(&mut self) -> &mut crate::RequestOptions {
6804            &mut self.0.options
6805        }
6806    }
6807
6808    /// The request builder for [SqlUsersService::insert][crate::client::SqlUsersService::insert] calls.
6809    ///
6810    /// # Example
6811    /// ```
6812    /// # use google_cloud_sql_v1::builder::sql_users_service::Insert;
6813    /// # async fn sample() -> google_cloud_sql_v1::Result<()> {
6814    ///
6815    /// let builder = prepare_request_builder();
6816    /// let response = builder.send().await?;
6817    /// # Ok(()) }
6818    ///
6819    /// fn prepare_request_builder() -> Insert {
6820    ///   # panic!();
6821    ///   // ... details omitted ...
6822    /// }
6823    /// ```
6824    #[derive(Clone, Debug)]
6825    pub struct Insert(RequestBuilder<crate::model::SqlUsersInsertRequest>);
6826
6827    impl Insert {
6828        pub(crate) fn new(
6829            stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlUsersService>,
6830        ) -> Self {
6831            Self(RequestBuilder::new(stub))
6832        }
6833
6834        /// Sets the full request, replacing any prior values.
6835        pub fn with_request<V: Into<crate::model::SqlUsersInsertRequest>>(mut self, v: V) -> Self {
6836            self.0.request = v.into();
6837            self
6838        }
6839
6840        /// Sets all the options, replacing any prior values.
6841        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
6842            self.0.options = v.into();
6843            self
6844        }
6845
6846        /// Sends the request.
6847        pub async fn send(self) -> Result<crate::model::Operation> {
6848            (*self.0.stub)
6849                .insert(self.0.request, self.0.options)
6850                .await
6851                .map(crate::Response::into_body)
6852        }
6853
6854        /// Sets the value of [instance][crate::model::SqlUsersInsertRequest::instance].
6855        pub fn set_instance<T: Into<std::string::String>>(mut self, v: T) -> Self {
6856            self.0.request.instance = v.into();
6857            self
6858        }
6859
6860        /// Sets the value of [project][crate::model::SqlUsersInsertRequest::project].
6861        pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
6862            self.0.request.project = v.into();
6863            self
6864        }
6865
6866        /// Sets the value of [body][crate::model::SqlUsersInsertRequest::body].
6867        pub fn set_body<T>(mut self, v: T) -> Self
6868        where
6869            T: std::convert::Into<crate::model::User>,
6870        {
6871            self.0.request.body = std::option::Option::Some(v.into());
6872            self
6873        }
6874
6875        /// Sets or clears the value of [body][crate::model::SqlUsersInsertRequest::body].
6876        pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
6877        where
6878            T: std::convert::Into<crate::model::User>,
6879        {
6880            self.0.request.body = v.map(|x| x.into());
6881            self
6882        }
6883    }
6884
6885    #[doc(hidden)]
6886    impl crate::RequestBuilder for Insert {
6887        fn request_options(&mut self) -> &mut crate::RequestOptions {
6888            &mut self.0.options
6889        }
6890    }
6891
6892    /// The request builder for [SqlUsersService::list][crate::client::SqlUsersService::list] calls.
6893    ///
6894    /// # Example
6895    /// ```
6896    /// # use google_cloud_sql_v1::builder::sql_users_service::List;
6897    /// # async fn sample() -> google_cloud_sql_v1::Result<()> {
6898    ///
6899    /// let builder = prepare_request_builder();
6900    /// let response = builder.send().await?;
6901    /// # Ok(()) }
6902    ///
6903    /// fn prepare_request_builder() -> List {
6904    ///   # panic!();
6905    ///   // ... details omitted ...
6906    /// }
6907    /// ```
6908    #[derive(Clone, Debug)]
6909    pub struct List(RequestBuilder<crate::model::SqlUsersListRequest>);
6910
6911    impl List {
6912        pub(crate) fn new(
6913            stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlUsersService>,
6914        ) -> Self {
6915            Self(RequestBuilder::new(stub))
6916        }
6917
6918        /// Sets the full request, replacing any prior values.
6919        pub fn with_request<V: Into<crate::model::SqlUsersListRequest>>(mut self, v: V) -> Self {
6920            self.0.request = v.into();
6921            self
6922        }
6923
6924        /// Sets all the options, replacing any prior values.
6925        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
6926            self.0.options = v.into();
6927            self
6928        }
6929
6930        /// Sends the request.
6931        pub async fn send(self) -> Result<crate::model::UsersListResponse> {
6932            (*self.0.stub)
6933                .list(self.0.request, self.0.options)
6934                .await
6935                .map(crate::Response::into_body)
6936        }
6937
6938        /// Sets the value of [instance][crate::model::SqlUsersListRequest::instance].
6939        pub fn set_instance<T: Into<std::string::String>>(mut self, v: T) -> Self {
6940            self.0.request.instance = v.into();
6941            self
6942        }
6943
6944        /// Sets the value of [project][crate::model::SqlUsersListRequest::project].
6945        pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
6946            self.0.request.project = v.into();
6947            self
6948        }
6949    }
6950
6951    #[doc(hidden)]
6952    impl crate::RequestBuilder for List {
6953        fn request_options(&mut self) -> &mut crate::RequestOptions {
6954            &mut self.0.options
6955        }
6956    }
6957
6958    /// The request builder for [SqlUsersService::update][crate::client::SqlUsersService::update] calls.
6959    ///
6960    /// # Example
6961    /// ```
6962    /// # use google_cloud_sql_v1::builder::sql_users_service::Update;
6963    /// # async fn sample() -> google_cloud_sql_v1::Result<()> {
6964    ///
6965    /// let builder = prepare_request_builder();
6966    /// let response = builder.send().await?;
6967    /// # Ok(()) }
6968    ///
6969    /// fn prepare_request_builder() -> Update {
6970    ///   # panic!();
6971    ///   // ... details omitted ...
6972    /// }
6973    /// ```
6974    #[derive(Clone, Debug)]
6975    pub struct Update(RequestBuilder<crate::model::SqlUsersUpdateRequest>);
6976
6977    impl Update {
6978        pub(crate) fn new(
6979            stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlUsersService>,
6980        ) -> Self {
6981            Self(RequestBuilder::new(stub))
6982        }
6983
6984        /// Sets the full request, replacing any prior values.
6985        pub fn with_request<V: Into<crate::model::SqlUsersUpdateRequest>>(mut self, v: V) -> Self {
6986            self.0.request = v.into();
6987            self
6988        }
6989
6990        /// Sets all the options, replacing any prior values.
6991        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
6992            self.0.options = v.into();
6993            self
6994        }
6995
6996        /// Sends the request.
6997        pub async fn send(self) -> Result<crate::model::Operation> {
6998            (*self.0.stub)
6999                .update(self.0.request, self.0.options)
7000                .await
7001                .map(crate::Response::into_body)
7002        }
7003
7004        /// Sets the value of [host][crate::model::SqlUsersUpdateRequest::host].
7005        pub fn set_host<T: Into<std::string::String>>(mut self, v: T) -> Self {
7006            self.0.request.host = v.into();
7007            self
7008        }
7009
7010        /// Sets the value of [instance][crate::model::SqlUsersUpdateRequest::instance].
7011        pub fn set_instance<T: Into<std::string::String>>(mut self, v: T) -> Self {
7012            self.0.request.instance = v.into();
7013            self
7014        }
7015
7016        /// Sets the value of [name][crate::model::SqlUsersUpdateRequest::name].
7017        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
7018            self.0.request.name = v.into();
7019            self
7020        }
7021
7022        /// Sets the value of [project][crate::model::SqlUsersUpdateRequest::project].
7023        pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
7024            self.0.request.project = v.into();
7025            self
7026        }
7027
7028        /// Sets the value of [database_roles][crate::model::SqlUsersUpdateRequest::database_roles].
7029        pub fn set_database_roles<T, V>(mut self, v: T) -> Self
7030        where
7031            T: std::iter::IntoIterator<Item = V>,
7032            V: std::convert::Into<std::string::String>,
7033        {
7034            use std::iter::Iterator;
7035            self.0.request.database_roles = v.into_iter().map(|i| i.into()).collect();
7036            self
7037        }
7038
7039        /// Sets the value of [revoke_existing_roles][crate::model::SqlUsersUpdateRequest::revoke_existing_roles].
7040        pub fn set_revoke_existing_roles<T>(mut self, v: T) -> Self
7041        where
7042            T: std::convert::Into<bool>,
7043        {
7044            self.0.request.revoke_existing_roles = std::option::Option::Some(v.into());
7045            self
7046        }
7047
7048        /// Sets or clears the value of [revoke_existing_roles][crate::model::SqlUsersUpdateRequest::revoke_existing_roles].
7049        pub fn set_or_clear_revoke_existing_roles<T>(mut self, v: std::option::Option<T>) -> Self
7050        where
7051            T: std::convert::Into<bool>,
7052        {
7053            self.0.request.revoke_existing_roles = v.map(|x| x.into());
7054            self
7055        }
7056
7057        /// Sets the value of [server_roles][crate::model::SqlUsersUpdateRequest::server_roles].
7058        pub fn set_server_roles<T, V>(mut self, v: T) -> Self
7059        where
7060            T: std::iter::IntoIterator<Item = V>,
7061            V: std::convert::Into<std::string::String>,
7062        {
7063            use std::iter::Iterator;
7064            self.0.request.server_roles = v.into_iter().map(|i| i.into()).collect();
7065            self
7066        }
7067
7068        /// Sets the value of [revoke_existing_server_roles][crate::model::SqlUsersUpdateRequest::revoke_existing_server_roles].
7069        pub fn set_revoke_existing_server_roles<T>(mut self, v: T) -> Self
7070        where
7071            T: std::convert::Into<bool>,
7072        {
7073            self.0.request.revoke_existing_server_roles = std::option::Option::Some(v.into());
7074            self
7075        }
7076
7077        /// Sets or clears the value of [revoke_existing_server_roles][crate::model::SqlUsersUpdateRequest::revoke_existing_server_roles].
7078        pub fn set_or_clear_revoke_existing_server_roles<T>(
7079            mut self,
7080            v: std::option::Option<T>,
7081        ) -> Self
7082        where
7083            T: std::convert::Into<bool>,
7084        {
7085            self.0.request.revoke_existing_server_roles = v.map(|x| x.into());
7086            self
7087        }
7088
7089        /// Sets the value of [body][crate::model::SqlUsersUpdateRequest::body].
7090        pub fn set_body<T>(mut self, v: T) -> Self
7091        where
7092            T: std::convert::Into<crate::model::User>,
7093        {
7094            self.0.request.body = std::option::Option::Some(v.into());
7095            self
7096        }
7097
7098        /// Sets or clears the value of [body][crate::model::SqlUsersUpdateRequest::body].
7099        pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
7100        where
7101            T: std::convert::Into<crate::model::User>,
7102        {
7103            self.0.request.body = v.map(|x| x.into());
7104            self
7105        }
7106    }
7107
7108    #[doc(hidden)]
7109    impl crate::RequestBuilder for Update {
7110        fn request_options(&mut self) -> &mut crate::RequestOptions {
7111            &mut self.0.options
7112        }
7113    }
7114}