Skip to main content

google_cloud_sql_v1/
builder.rs

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