Skip to main content

google_cloud_sql_v1/
builder.rs

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