Skip to main content

google_cloud_sql_v1/
builder.rs

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