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