Skip to main content

google_cloud_sql_v1/
builder.rs

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