google_cloud_sql_v1/
builder.rs

1// Copyright 2025 Google LLC
2//
3// Licensed under the Apache License, Version 2.0 (the "License");
4// you may not use this file except in compliance with the License.
5// You may obtain a copy of the License at
6//
7//     https://www.apache.org/licenses/LICENSE-2.0
8//
9// Unless required by applicable law or agreed to in writing, software
10// distributed under the License is distributed on an "AS IS" BASIS,
11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12// See the License for the specific language governing permissions and
13// limitations under the License.
14//
15// Code generated by sidekick. DO NOT EDIT.
16
17pub mod sql_backup_runs_service {
18    use crate::Result;
19
20    /// A builder for [SqlBackupRunsService][crate::client::SqlBackupRunsService].
21    ///
22    /// ```
23    /// # tokio_test::block_on(async {
24    /// # use google_cloud_sql_v1::*;
25    /// # use builder::sql_backup_runs_service::ClientBuilder;
26    /// # use client::SqlBackupRunsService;
27    /// let builder : ClientBuilder = SqlBackupRunsService::builder();
28    /// let client = builder
29    ///     .with_endpoint("https://sqladmin.googleapis.com")
30    ///     .build().await?;
31    /// # gax::client_builder::Result::<()>::Ok(()) });
32    /// ```
33    pub type ClientBuilder =
34        gax::client_builder::ClientBuilder<client::Factory, gaxi::options::Credentials>;
35
36    pub(crate) mod client {
37        use super::super::super::client::SqlBackupRunsService;
38        pub struct Factory;
39        impl gax::client_builder::internal::ClientFactory for Factory {
40            type Client = SqlBackupRunsService;
41            type Credentials = gaxi::options::Credentials;
42            async fn build(
43                self,
44                config: gaxi::options::ClientConfig,
45            ) -> gax::client_builder::Result<Self::Client> {
46                Self::Client::new(config).await
47            }
48        }
49    }
50
51    /// Common implementation for [crate::client::SqlBackupRunsService] request builders.
52    #[derive(Clone, Debug)]
53    pub(crate) struct RequestBuilder<R: std::default::Default> {
54        stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlBackupRunsService>,
55        request: R,
56        options: gax::options::RequestOptions,
57    }
58
59    impl<R> RequestBuilder<R>
60    where
61        R: std::default::Default,
62    {
63        pub(crate) fn new(
64            stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlBackupRunsService>,
65        ) -> Self {
66            Self {
67                stub,
68                request: R::default(),
69                options: gax::options::RequestOptions::default(),
70            }
71        }
72    }
73
74    /// The request builder for [SqlBackupRunsService::delete][crate::client::SqlBackupRunsService::delete] calls.
75    ///
76    /// # Example
77    /// ```no_run
78    /// # use google_cloud_sql_v1::builder;
79    /// use builder::sql_backup_runs_service::Delete;
80    /// # tokio_test::block_on(async {
81    ///
82    /// let builder = prepare_request_builder();
83    /// let response = builder.send().await?;
84    /// # gax::Result::<()>::Ok(()) });
85    ///
86    /// fn prepare_request_builder() -> Delete {
87    ///   # panic!();
88    ///   // ... details omitted ...
89    /// }
90    /// ```
91    #[derive(Clone, Debug)]
92    pub struct Delete(RequestBuilder<crate::model::SqlBackupRunsDeleteRequest>);
93
94    impl Delete {
95        pub(crate) fn new(
96            stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlBackupRunsService>,
97        ) -> Self {
98            Self(RequestBuilder::new(stub))
99        }
100
101        /// Sets the full request, replacing any prior values.
102        pub fn with_request<V: Into<crate::model::SqlBackupRunsDeleteRequest>>(
103            mut self,
104            v: V,
105        ) -> Self {
106            self.0.request = v.into();
107            self
108        }
109
110        /// Sets all the options, replacing any prior values.
111        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
112            self.0.options = v.into();
113            self
114        }
115
116        /// Sends the request.
117        pub async fn send(self) -> Result<crate::model::Operation> {
118            (*self.0.stub)
119                .delete(self.0.request, self.0.options)
120                .await
121                .map(gax::response::Response::into_body)
122        }
123
124        /// Sets the value of [id][crate::model::SqlBackupRunsDeleteRequest::id].
125        pub fn set_id<T: Into<i64>>(mut self, v: T) -> Self {
126            self.0.request.id = v.into();
127            self
128        }
129
130        /// Sets the value of [instance][crate::model::SqlBackupRunsDeleteRequest::instance].
131        pub fn set_instance<T: Into<std::string::String>>(mut self, v: T) -> Self {
132            self.0.request.instance = v.into();
133            self
134        }
135
136        /// Sets the value of [project][crate::model::SqlBackupRunsDeleteRequest::project].
137        pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
138            self.0.request.project = v.into();
139            self
140        }
141    }
142
143    #[doc(hidden)]
144    impl gax::options::internal::RequestBuilder for Delete {
145        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
146            &mut self.0.options
147        }
148    }
149
150    /// The request builder for [SqlBackupRunsService::get][crate::client::SqlBackupRunsService::get] calls.
151    ///
152    /// # Example
153    /// ```no_run
154    /// # use google_cloud_sql_v1::builder;
155    /// use builder::sql_backup_runs_service::Get;
156    /// # tokio_test::block_on(async {
157    ///
158    /// let builder = prepare_request_builder();
159    /// let response = builder.send().await?;
160    /// # gax::Result::<()>::Ok(()) });
161    ///
162    /// fn prepare_request_builder() -> Get {
163    ///   # panic!();
164    ///   // ... details omitted ...
165    /// }
166    /// ```
167    #[derive(Clone, Debug)]
168    pub struct Get(RequestBuilder<crate::model::SqlBackupRunsGetRequest>);
169
170    impl Get {
171        pub(crate) fn new(
172            stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlBackupRunsService>,
173        ) -> Self {
174            Self(RequestBuilder::new(stub))
175        }
176
177        /// Sets the full request, replacing any prior values.
178        pub fn with_request<V: Into<crate::model::SqlBackupRunsGetRequest>>(
179            mut self,
180            v: V,
181        ) -> Self {
182            self.0.request = v.into();
183            self
184        }
185
186        /// Sets all the options, replacing any prior values.
187        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
188            self.0.options = v.into();
189            self
190        }
191
192        /// Sends the request.
193        pub async fn send(self) -> Result<crate::model::BackupRun> {
194            (*self.0.stub)
195                .get(self.0.request, self.0.options)
196                .await
197                .map(gax::response::Response::into_body)
198        }
199
200        /// Sets the value of [id][crate::model::SqlBackupRunsGetRequest::id].
201        pub fn set_id<T: Into<i64>>(mut self, v: T) -> Self {
202            self.0.request.id = v.into();
203            self
204        }
205
206        /// Sets the value of [instance][crate::model::SqlBackupRunsGetRequest::instance].
207        pub fn set_instance<T: Into<std::string::String>>(mut self, v: T) -> Self {
208            self.0.request.instance = v.into();
209            self
210        }
211
212        /// Sets the value of [project][crate::model::SqlBackupRunsGetRequest::project].
213        pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
214            self.0.request.project = v.into();
215            self
216        }
217    }
218
219    #[doc(hidden)]
220    impl gax::options::internal::RequestBuilder for Get {
221        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
222            &mut self.0.options
223        }
224    }
225
226    /// The request builder for [SqlBackupRunsService::insert][crate::client::SqlBackupRunsService::insert] calls.
227    ///
228    /// # Example
229    /// ```no_run
230    /// # use google_cloud_sql_v1::builder;
231    /// use builder::sql_backup_runs_service::Insert;
232    /// # tokio_test::block_on(async {
233    ///
234    /// let builder = prepare_request_builder();
235    /// let response = builder.send().await?;
236    /// # gax::Result::<()>::Ok(()) });
237    ///
238    /// fn prepare_request_builder() -> Insert {
239    ///   # panic!();
240    ///   // ... details omitted ...
241    /// }
242    /// ```
243    #[derive(Clone, Debug)]
244    pub struct Insert(RequestBuilder<crate::model::SqlBackupRunsInsertRequest>);
245
246    impl Insert {
247        pub(crate) fn new(
248            stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlBackupRunsService>,
249        ) -> Self {
250            Self(RequestBuilder::new(stub))
251        }
252
253        /// Sets the full request, replacing any prior values.
254        pub fn with_request<V: Into<crate::model::SqlBackupRunsInsertRequest>>(
255            mut self,
256            v: V,
257        ) -> Self {
258            self.0.request = v.into();
259            self
260        }
261
262        /// Sets all the options, replacing any prior values.
263        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
264            self.0.options = v.into();
265            self
266        }
267
268        /// Sends the request.
269        pub async fn send(self) -> Result<crate::model::Operation> {
270            (*self.0.stub)
271                .insert(self.0.request, self.0.options)
272                .await
273                .map(gax::response::Response::into_body)
274        }
275
276        /// Sets the value of [instance][crate::model::SqlBackupRunsInsertRequest::instance].
277        pub fn set_instance<T: Into<std::string::String>>(mut self, v: T) -> Self {
278            self.0.request.instance = v.into();
279            self
280        }
281
282        /// Sets the value of [project][crate::model::SqlBackupRunsInsertRequest::project].
283        pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
284            self.0.request.project = v.into();
285            self
286        }
287
288        /// Sets the value of [body][crate::model::SqlBackupRunsInsertRequest::body].
289        pub fn set_body<T>(mut self, v: T) -> Self
290        where
291            T: std::convert::Into<crate::model::BackupRun>,
292        {
293            self.0.request.body = std::option::Option::Some(v.into());
294            self
295        }
296
297        /// Sets or clears the value of [body][crate::model::SqlBackupRunsInsertRequest::body].
298        pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
299        where
300            T: std::convert::Into<crate::model::BackupRun>,
301        {
302            self.0.request.body = v.map(|x| x.into());
303            self
304        }
305    }
306
307    #[doc(hidden)]
308    impl gax::options::internal::RequestBuilder for Insert {
309        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
310            &mut self.0.options
311        }
312    }
313
314    /// The request builder for [SqlBackupRunsService::list][crate::client::SqlBackupRunsService::list] calls.
315    ///
316    /// # Example
317    /// ```no_run
318    /// # use google_cloud_sql_v1::builder;
319    /// use builder::sql_backup_runs_service::List;
320    /// # tokio_test::block_on(async {
321    /// use gax::paginator::ItemPaginator;
322    ///
323    /// let builder = prepare_request_builder();
324    /// let mut items = builder.by_item();
325    /// while let Some(result) = items.next().await {
326    ///   let item = result?;
327    /// }
328    /// # gax::Result::<()>::Ok(()) });
329    ///
330    /// fn prepare_request_builder() -> List {
331    ///   # panic!();
332    ///   // ... details omitted ...
333    /// }
334    /// ```
335    #[derive(Clone, Debug)]
336    pub struct List(RequestBuilder<crate::model::SqlBackupRunsListRequest>);
337
338    impl List {
339        pub(crate) fn new(
340            stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlBackupRunsService>,
341        ) -> Self {
342            Self(RequestBuilder::new(stub))
343        }
344
345        /// Sets the full request, replacing any prior values.
346        pub fn with_request<V: Into<crate::model::SqlBackupRunsListRequest>>(
347            mut self,
348            v: V,
349        ) -> Self {
350            self.0.request = v.into();
351            self
352        }
353
354        /// Sets all the options, replacing any prior values.
355        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
356            self.0.options = v.into();
357            self
358        }
359
360        /// Sends the request.
361        pub async fn send(self) -> Result<crate::model::BackupRunsListResponse> {
362            (*self.0.stub)
363                .list(self.0.request, self.0.options)
364                .await
365                .map(gax::response::Response::into_body)
366        }
367
368        /// Streams each page in the collection.
369        pub fn by_page(
370            self,
371        ) -> impl gax::paginator::Paginator<crate::model::BackupRunsListResponse, gax::error::Error>
372        {
373            use std::clone::Clone;
374            let token = self.0.request.page_token.clone();
375            let execute = move |token: String| {
376                let mut builder = self.clone();
377                builder.0.request = builder.0.request.set_page_token(token);
378                builder.send()
379            };
380            gax::paginator::internal::new_paginator(token, execute)
381        }
382
383        /// Streams each item in the collection.
384        pub fn by_item(
385            self,
386        ) -> impl gax::paginator::ItemPaginator<crate::model::BackupRunsListResponse, gax::error::Error>
387        {
388            use 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 gax::options::internal::RequestBuilder for List {
419        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
420            &mut self.0.options
421        }
422    }
423}
424
425pub mod sql_connect_service {
426    use crate::Result;
427
428    /// A builder for [SqlConnectService][crate::client::SqlConnectService].
429    ///
430    /// ```
431    /// # tokio_test::block_on(async {
432    /// # use google_cloud_sql_v1::*;
433    /// # use builder::sql_connect_service::ClientBuilder;
434    /// # use client::SqlConnectService;
435    /// let builder : ClientBuilder = SqlConnectService::builder();
436    /// let client = builder
437    ///     .with_endpoint("https://sqladmin.googleapis.com")
438    ///     .build().await?;
439    /// # gax::client_builder::Result::<()>::Ok(()) });
440    /// ```
441    pub type ClientBuilder =
442        gax::client_builder::ClientBuilder<client::Factory, gaxi::options::Credentials>;
443
444    pub(crate) mod client {
445        use super::super::super::client::SqlConnectService;
446        pub struct Factory;
447        impl gax::client_builder::internal::ClientFactory for Factory {
448            type Client = SqlConnectService;
449            type Credentials = gaxi::options::Credentials;
450            async fn build(
451                self,
452                config: gaxi::options::ClientConfig,
453            ) -> gax::client_builder::Result<Self::Client> {
454                Self::Client::new(config).await
455            }
456        }
457    }
458
459    /// Common implementation for [crate::client::SqlConnectService] 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::SqlConnectService>,
463        request: R,
464        options: gax::options::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::SqlConnectService>,
473        ) -> Self {
474            Self {
475                stub,
476                request: R::default(),
477                options: gax::options::RequestOptions::default(),
478            }
479        }
480    }
481
482    /// The request builder for [SqlConnectService::get_connect_settings][crate::client::SqlConnectService::get_connect_settings] calls.
483    ///
484    /// # Example
485    /// ```no_run
486    /// # use google_cloud_sql_v1::builder;
487    /// use builder::sql_connect_service::GetConnectSettings;
488    /// # tokio_test::block_on(async {
489    ///
490    /// let builder = prepare_request_builder();
491    /// let response = builder.send().await?;
492    /// # gax::Result::<()>::Ok(()) });
493    ///
494    /// fn prepare_request_builder() -> GetConnectSettings {
495    ///   # panic!();
496    ///   // ... details omitted ...
497    /// }
498    /// ```
499    #[derive(Clone, Debug)]
500    pub struct GetConnectSettings(RequestBuilder<crate::model::GetConnectSettingsRequest>);
501
502    impl GetConnectSettings {
503        pub(crate) fn new(
504            stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlConnectService>,
505        ) -> Self {
506            Self(RequestBuilder::new(stub))
507        }
508
509        /// Sets the full request, replacing any prior values.
510        pub fn with_request<V: Into<crate::model::GetConnectSettingsRequest>>(
511            mut self,
512            v: V,
513        ) -> Self {
514            self.0.request = v.into();
515            self
516        }
517
518        /// Sets all the options, replacing any prior values.
519        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
520            self.0.options = v.into();
521            self
522        }
523
524        /// Sends the request.
525        pub async fn send(self) -> Result<crate::model::ConnectSettings> {
526            (*self.0.stub)
527                .get_connect_settings(self.0.request, self.0.options)
528                .await
529                .map(gax::response::Response::into_body)
530        }
531
532        /// Sets the value of [instance][crate::model::GetConnectSettingsRequest::instance].
533        pub fn set_instance<T: Into<std::string::String>>(mut self, v: T) -> Self {
534            self.0.request.instance = v.into();
535            self
536        }
537
538        /// Sets the value of [project][crate::model::GetConnectSettingsRequest::project].
539        pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
540            self.0.request.project = v.into();
541            self
542        }
543
544        /// Sets the value of [read_time][crate::model::GetConnectSettingsRequest::read_time].
545        pub fn set_read_time<T>(mut self, v: T) -> Self
546        where
547            T: std::convert::Into<wkt::Timestamp>,
548        {
549            self.0.request.read_time = std::option::Option::Some(v.into());
550            self
551        }
552
553        /// Sets or clears the value of [read_time][crate::model::GetConnectSettingsRequest::read_time].
554        pub fn set_or_clear_read_time<T>(mut self, v: std::option::Option<T>) -> Self
555        where
556            T: std::convert::Into<wkt::Timestamp>,
557        {
558            self.0.request.read_time = v.map(|x| x.into());
559            self
560        }
561    }
562
563    #[doc(hidden)]
564    impl gax::options::internal::RequestBuilder for GetConnectSettings {
565        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
566            &mut self.0.options
567        }
568    }
569
570    /// The request builder for [SqlConnectService::generate_ephemeral_cert][crate::client::SqlConnectService::generate_ephemeral_cert] calls.
571    ///
572    /// # Example
573    /// ```no_run
574    /// # use google_cloud_sql_v1::builder;
575    /// use builder::sql_connect_service::GenerateEphemeralCert;
576    /// # tokio_test::block_on(async {
577    ///
578    /// let builder = prepare_request_builder();
579    /// let response = builder.send().await?;
580    /// # gax::Result::<()>::Ok(()) });
581    ///
582    /// fn prepare_request_builder() -> GenerateEphemeralCert {
583    ///   # panic!();
584    ///   // ... details omitted ...
585    /// }
586    /// ```
587    #[derive(Clone, Debug)]
588    pub struct GenerateEphemeralCert(RequestBuilder<crate::model::GenerateEphemeralCertRequest>);
589
590    impl GenerateEphemeralCert {
591        pub(crate) fn new(
592            stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlConnectService>,
593        ) -> Self {
594            Self(RequestBuilder::new(stub))
595        }
596
597        /// Sets the full request, replacing any prior values.
598        pub fn with_request<V: Into<crate::model::GenerateEphemeralCertRequest>>(
599            mut self,
600            v: V,
601        ) -> Self {
602            self.0.request = v.into();
603            self
604        }
605
606        /// Sets all the options, replacing any prior values.
607        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
608            self.0.options = v.into();
609            self
610        }
611
612        /// Sends the request.
613        pub async fn send(self) -> Result<crate::model::GenerateEphemeralCertResponse> {
614            (*self.0.stub)
615                .generate_ephemeral_cert(self.0.request, self.0.options)
616                .await
617                .map(gax::response::Response::into_body)
618        }
619
620        /// Sets the value of [instance][crate::model::GenerateEphemeralCertRequest::instance].
621        pub fn set_instance<T: Into<std::string::String>>(mut self, v: T) -> Self {
622            self.0.request.instance = v.into();
623            self
624        }
625
626        /// Sets the value of [project][crate::model::GenerateEphemeralCertRequest::project].
627        pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
628            self.0.request.project = v.into();
629            self
630        }
631
632        /// Sets the value of [public_key][crate::model::GenerateEphemeralCertRequest::public_key].
633        pub fn set_public_key<T: Into<std::string::String>>(mut self, v: T) -> Self {
634            self.0.request.public_key = v.into();
635            self
636        }
637
638        /// Sets the value of [access_token][crate::model::GenerateEphemeralCertRequest::access_token].
639        pub fn set_access_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
640            self.0.request.access_token = v.into();
641            self
642        }
643
644        /// Sets the value of [read_time][crate::model::GenerateEphemeralCertRequest::read_time].
645        pub fn set_read_time<T>(mut self, v: T) -> Self
646        where
647            T: std::convert::Into<wkt::Timestamp>,
648        {
649            self.0.request.read_time = std::option::Option::Some(v.into());
650            self
651        }
652
653        /// Sets or clears the value of [read_time][crate::model::GenerateEphemeralCertRequest::read_time].
654        pub fn set_or_clear_read_time<T>(mut self, v: std::option::Option<T>) -> Self
655        where
656            T: std::convert::Into<wkt::Timestamp>,
657        {
658            self.0.request.read_time = v.map(|x| x.into());
659            self
660        }
661
662        /// Sets the value of [valid_duration][crate::model::GenerateEphemeralCertRequest::valid_duration].
663        pub fn set_valid_duration<T>(mut self, v: T) -> Self
664        where
665            T: std::convert::Into<wkt::Duration>,
666        {
667            self.0.request.valid_duration = std::option::Option::Some(v.into());
668            self
669        }
670
671        /// Sets or clears the value of [valid_duration][crate::model::GenerateEphemeralCertRequest::valid_duration].
672        pub fn set_or_clear_valid_duration<T>(mut self, v: std::option::Option<T>) -> Self
673        where
674            T: std::convert::Into<wkt::Duration>,
675        {
676            self.0.request.valid_duration = v.map(|x| x.into());
677            self
678        }
679    }
680
681    #[doc(hidden)]
682    impl gax::options::internal::RequestBuilder for GenerateEphemeralCert {
683        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
684            &mut self.0.options
685        }
686    }
687}
688
689pub mod sql_databases_service {
690    use crate::Result;
691
692    /// A builder for [SqlDatabasesService][crate::client::SqlDatabasesService].
693    ///
694    /// ```
695    /// # tokio_test::block_on(async {
696    /// # use google_cloud_sql_v1::*;
697    /// # use builder::sql_databases_service::ClientBuilder;
698    /// # use client::SqlDatabasesService;
699    /// let builder : ClientBuilder = SqlDatabasesService::builder();
700    /// let client = builder
701    ///     .with_endpoint("https://sqladmin.googleapis.com")
702    ///     .build().await?;
703    /// # gax::client_builder::Result::<()>::Ok(()) });
704    /// ```
705    pub type ClientBuilder =
706        gax::client_builder::ClientBuilder<client::Factory, gaxi::options::Credentials>;
707
708    pub(crate) mod client {
709        use super::super::super::client::SqlDatabasesService;
710        pub struct Factory;
711        impl gax::client_builder::internal::ClientFactory for Factory {
712            type Client = SqlDatabasesService;
713            type Credentials = gaxi::options::Credentials;
714            async fn build(
715                self,
716                config: gaxi::options::ClientConfig,
717            ) -> gax::client_builder::Result<Self::Client> {
718                Self::Client::new(config).await
719            }
720        }
721    }
722
723    /// Common implementation for [crate::client::SqlDatabasesService] request builders.
724    #[derive(Clone, Debug)]
725    pub(crate) struct RequestBuilder<R: std::default::Default> {
726        stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlDatabasesService>,
727        request: R,
728        options: gax::options::RequestOptions,
729    }
730
731    impl<R> RequestBuilder<R>
732    where
733        R: std::default::Default,
734    {
735        pub(crate) fn new(
736            stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlDatabasesService>,
737        ) -> Self {
738            Self {
739                stub,
740                request: R::default(),
741                options: gax::options::RequestOptions::default(),
742            }
743        }
744    }
745
746    /// The request builder for [SqlDatabasesService::delete][crate::client::SqlDatabasesService::delete] calls.
747    ///
748    /// # Example
749    /// ```no_run
750    /// # use google_cloud_sql_v1::builder;
751    /// use builder::sql_databases_service::Delete;
752    /// # tokio_test::block_on(async {
753    ///
754    /// let builder = prepare_request_builder();
755    /// let response = builder.send().await?;
756    /// # gax::Result::<()>::Ok(()) });
757    ///
758    /// fn prepare_request_builder() -> Delete {
759    ///   # panic!();
760    ///   // ... details omitted ...
761    /// }
762    /// ```
763    #[derive(Clone, Debug)]
764    pub struct Delete(RequestBuilder<crate::model::SqlDatabasesDeleteRequest>);
765
766    impl Delete {
767        pub(crate) fn new(
768            stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlDatabasesService>,
769        ) -> Self {
770            Self(RequestBuilder::new(stub))
771        }
772
773        /// Sets the full request, replacing any prior values.
774        pub fn with_request<V: Into<crate::model::SqlDatabasesDeleteRequest>>(
775            mut self,
776            v: V,
777        ) -> Self {
778            self.0.request = v.into();
779            self
780        }
781
782        /// Sets all the options, replacing any prior values.
783        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
784            self.0.options = v.into();
785            self
786        }
787
788        /// Sends the request.
789        pub async fn send(self) -> Result<crate::model::Operation> {
790            (*self.0.stub)
791                .delete(self.0.request, self.0.options)
792                .await
793                .map(gax::response::Response::into_body)
794        }
795
796        /// Sets the value of [database][crate::model::SqlDatabasesDeleteRequest::database].
797        pub fn set_database<T: Into<std::string::String>>(mut self, v: T) -> Self {
798            self.0.request.database = v.into();
799            self
800        }
801
802        /// Sets the value of [instance][crate::model::SqlDatabasesDeleteRequest::instance].
803        pub fn set_instance<T: Into<std::string::String>>(mut self, v: T) -> Self {
804            self.0.request.instance = v.into();
805            self
806        }
807
808        /// Sets the value of [project][crate::model::SqlDatabasesDeleteRequest::project].
809        pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
810            self.0.request.project = v.into();
811            self
812        }
813    }
814
815    #[doc(hidden)]
816    impl gax::options::internal::RequestBuilder for Delete {
817        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
818            &mut self.0.options
819        }
820    }
821
822    /// The request builder for [SqlDatabasesService::get][crate::client::SqlDatabasesService::get] calls.
823    ///
824    /// # Example
825    /// ```no_run
826    /// # use google_cloud_sql_v1::builder;
827    /// use builder::sql_databases_service::Get;
828    /// # tokio_test::block_on(async {
829    ///
830    /// let builder = prepare_request_builder();
831    /// let response = builder.send().await?;
832    /// # gax::Result::<()>::Ok(()) });
833    ///
834    /// fn prepare_request_builder() -> Get {
835    ///   # panic!();
836    ///   // ... details omitted ...
837    /// }
838    /// ```
839    #[derive(Clone, Debug)]
840    pub struct Get(RequestBuilder<crate::model::SqlDatabasesGetRequest>);
841
842    impl Get {
843        pub(crate) fn new(
844            stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlDatabasesService>,
845        ) -> Self {
846            Self(RequestBuilder::new(stub))
847        }
848
849        /// Sets the full request, replacing any prior values.
850        pub fn with_request<V: Into<crate::model::SqlDatabasesGetRequest>>(mut self, v: V) -> Self {
851            self.0.request = v.into();
852            self
853        }
854
855        /// Sets all the options, replacing any prior values.
856        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
857            self.0.options = v.into();
858            self
859        }
860
861        /// Sends the request.
862        pub async fn send(self) -> Result<crate::model::Database> {
863            (*self.0.stub)
864                .get(self.0.request, self.0.options)
865                .await
866                .map(gax::response::Response::into_body)
867        }
868
869        /// Sets the value of [database][crate::model::SqlDatabasesGetRequest::database].
870        pub fn set_database<T: Into<std::string::String>>(mut self, v: T) -> Self {
871            self.0.request.database = v.into();
872            self
873        }
874
875        /// Sets the value of [instance][crate::model::SqlDatabasesGetRequest::instance].
876        pub fn set_instance<T: Into<std::string::String>>(mut self, v: T) -> Self {
877            self.0.request.instance = v.into();
878            self
879        }
880
881        /// Sets the value of [project][crate::model::SqlDatabasesGetRequest::project].
882        pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
883            self.0.request.project = v.into();
884            self
885        }
886    }
887
888    #[doc(hidden)]
889    impl gax::options::internal::RequestBuilder for Get {
890        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
891            &mut self.0.options
892        }
893    }
894
895    /// The request builder for [SqlDatabasesService::insert][crate::client::SqlDatabasesService::insert] calls.
896    ///
897    /// # Example
898    /// ```no_run
899    /// # use google_cloud_sql_v1::builder;
900    /// use builder::sql_databases_service::Insert;
901    /// # tokio_test::block_on(async {
902    ///
903    /// let builder = prepare_request_builder();
904    /// let response = builder.send().await?;
905    /// # gax::Result::<()>::Ok(()) });
906    ///
907    /// fn prepare_request_builder() -> Insert {
908    ///   # panic!();
909    ///   // ... details omitted ...
910    /// }
911    /// ```
912    #[derive(Clone, Debug)]
913    pub struct Insert(RequestBuilder<crate::model::SqlDatabasesInsertRequest>);
914
915    impl Insert {
916        pub(crate) fn new(
917            stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlDatabasesService>,
918        ) -> Self {
919            Self(RequestBuilder::new(stub))
920        }
921
922        /// Sets the full request, replacing any prior values.
923        pub fn with_request<V: Into<crate::model::SqlDatabasesInsertRequest>>(
924            mut self,
925            v: V,
926        ) -> Self {
927            self.0.request = v.into();
928            self
929        }
930
931        /// Sets all the options, replacing any prior values.
932        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
933            self.0.options = v.into();
934            self
935        }
936
937        /// Sends the request.
938        pub async fn send(self) -> Result<crate::model::Operation> {
939            (*self.0.stub)
940                .insert(self.0.request, self.0.options)
941                .await
942                .map(gax::response::Response::into_body)
943        }
944
945        /// Sets the value of [instance][crate::model::SqlDatabasesInsertRequest::instance].
946        pub fn set_instance<T: Into<std::string::String>>(mut self, v: T) -> Self {
947            self.0.request.instance = v.into();
948            self
949        }
950
951        /// Sets the value of [project][crate::model::SqlDatabasesInsertRequest::project].
952        pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
953            self.0.request.project = v.into();
954            self
955        }
956
957        /// Sets the value of [body][crate::model::SqlDatabasesInsertRequest::body].
958        pub fn set_body<T>(mut self, v: T) -> Self
959        where
960            T: std::convert::Into<crate::model::Database>,
961        {
962            self.0.request.body = std::option::Option::Some(v.into());
963            self
964        }
965
966        /// Sets or clears the value of [body][crate::model::SqlDatabasesInsertRequest::body].
967        pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
968        where
969            T: std::convert::Into<crate::model::Database>,
970        {
971            self.0.request.body = v.map(|x| x.into());
972            self
973        }
974    }
975
976    #[doc(hidden)]
977    impl gax::options::internal::RequestBuilder for Insert {
978        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
979            &mut self.0.options
980        }
981    }
982
983    /// The request builder for [SqlDatabasesService::list][crate::client::SqlDatabasesService::list] calls.
984    ///
985    /// # Example
986    /// ```no_run
987    /// # use google_cloud_sql_v1::builder;
988    /// use builder::sql_databases_service::List;
989    /// # tokio_test::block_on(async {
990    ///
991    /// let builder = prepare_request_builder();
992    /// let response = builder.send().await?;
993    /// # gax::Result::<()>::Ok(()) });
994    ///
995    /// fn prepare_request_builder() -> List {
996    ///   # panic!();
997    ///   // ... details omitted ...
998    /// }
999    /// ```
1000    #[derive(Clone, Debug)]
1001    pub struct List(RequestBuilder<crate::model::SqlDatabasesListRequest>);
1002
1003    impl List {
1004        pub(crate) fn new(
1005            stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlDatabasesService>,
1006        ) -> Self {
1007            Self(RequestBuilder::new(stub))
1008        }
1009
1010        /// Sets the full request, replacing any prior values.
1011        pub fn with_request<V: Into<crate::model::SqlDatabasesListRequest>>(
1012            mut self,
1013            v: V,
1014        ) -> Self {
1015            self.0.request = v.into();
1016            self
1017        }
1018
1019        /// Sets all the options, replacing any prior values.
1020        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1021            self.0.options = v.into();
1022            self
1023        }
1024
1025        /// Sends the request.
1026        pub async fn send(self) -> Result<crate::model::DatabasesListResponse> {
1027            (*self.0.stub)
1028                .list(self.0.request, self.0.options)
1029                .await
1030                .map(gax::response::Response::into_body)
1031        }
1032
1033        /// Sets the value of [instance][crate::model::SqlDatabasesListRequest::instance].
1034        pub fn set_instance<T: Into<std::string::String>>(mut self, v: T) -> Self {
1035            self.0.request.instance = v.into();
1036            self
1037        }
1038
1039        /// Sets the value of [project][crate::model::SqlDatabasesListRequest::project].
1040        pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
1041            self.0.request.project = v.into();
1042            self
1043        }
1044    }
1045
1046    #[doc(hidden)]
1047    impl gax::options::internal::RequestBuilder for List {
1048        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1049            &mut self.0.options
1050        }
1051    }
1052
1053    /// The request builder for [SqlDatabasesService::patch][crate::client::SqlDatabasesService::patch] calls.
1054    ///
1055    /// # Example
1056    /// ```no_run
1057    /// # use google_cloud_sql_v1::builder;
1058    /// use builder::sql_databases_service::Patch;
1059    /// # tokio_test::block_on(async {
1060    ///
1061    /// let builder = prepare_request_builder();
1062    /// let response = builder.send().await?;
1063    /// # gax::Result::<()>::Ok(()) });
1064    ///
1065    /// fn prepare_request_builder() -> Patch {
1066    ///   # panic!();
1067    ///   // ... details omitted ...
1068    /// }
1069    /// ```
1070    #[derive(Clone, Debug)]
1071    pub struct Patch(RequestBuilder<crate::model::SqlDatabasesUpdateRequest>);
1072
1073    impl Patch {
1074        pub(crate) fn new(
1075            stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlDatabasesService>,
1076        ) -> Self {
1077            Self(RequestBuilder::new(stub))
1078        }
1079
1080        /// Sets the full request, replacing any prior values.
1081        pub fn with_request<V: Into<crate::model::SqlDatabasesUpdateRequest>>(
1082            mut self,
1083            v: V,
1084        ) -> Self {
1085            self.0.request = v.into();
1086            self
1087        }
1088
1089        /// Sets all the options, replacing any prior values.
1090        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1091            self.0.options = v.into();
1092            self
1093        }
1094
1095        /// Sends the request.
1096        pub async fn send(self) -> Result<crate::model::Operation> {
1097            (*self.0.stub)
1098                .patch(self.0.request, self.0.options)
1099                .await
1100                .map(gax::response::Response::into_body)
1101        }
1102
1103        /// Sets the value of [database][crate::model::SqlDatabasesUpdateRequest::database].
1104        pub fn set_database<T: Into<std::string::String>>(mut self, v: T) -> Self {
1105            self.0.request.database = v.into();
1106            self
1107        }
1108
1109        /// Sets the value of [instance][crate::model::SqlDatabasesUpdateRequest::instance].
1110        pub fn set_instance<T: Into<std::string::String>>(mut self, v: T) -> Self {
1111            self.0.request.instance = v.into();
1112            self
1113        }
1114
1115        /// Sets the value of [project][crate::model::SqlDatabasesUpdateRequest::project].
1116        pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
1117            self.0.request.project = v.into();
1118            self
1119        }
1120
1121        /// Sets the value of [body][crate::model::SqlDatabasesUpdateRequest::body].
1122        pub fn set_body<T>(mut self, v: T) -> Self
1123        where
1124            T: std::convert::Into<crate::model::Database>,
1125        {
1126            self.0.request.body = std::option::Option::Some(v.into());
1127            self
1128        }
1129
1130        /// Sets or clears the value of [body][crate::model::SqlDatabasesUpdateRequest::body].
1131        pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
1132        where
1133            T: std::convert::Into<crate::model::Database>,
1134        {
1135            self.0.request.body = v.map(|x| x.into());
1136            self
1137        }
1138    }
1139
1140    #[doc(hidden)]
1141    impl gax::options::internal::RequestBuilder for Patch {
1142        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1143            &mut self.0.options
1144        }
1145    }
1146
1147    /// The request builder for [SqlDatabasesService::update][crate::client::SqlDatabasesService::update] calls.
1148    ///
1149    /// # Example
1150    /// ```no_run
1151    /// # use google_cloud_sql_v1::builder;
1152    /// use builder::sql_databases_service::Update;
1153    /// # tokio_test::block_on(async {
1154    ///
1155    /// let builder = prepare_request_builder();
1156    /// let response = builder.send().await?;
1157    /// # gax::Result::<()>::Ok(()) });
1158    ///
1159    /// fn prepare_request_builder() -> Update {
1160    ///   # panic!();
1161    ///   // ... details omitted ...
1162    /// }
1163    /// ```
1164    #[derive(Clone, Debug)]
1165    pub struct Update(RequestBuilder<crate::model::SqlDatabasesUpdateRequest>);
1166
1167    impl Update {
1168        pub(crate) fn new(
1169            stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlDatabasesService>,
1170        ) -> Self {
1171            Self(RequestBuilder::new(stub))
1172        }
1173
1174        /// Sets the full request, replacing any prior values.
1175        pub fn with_request<V: Into<crate::model::SqlDatabasesUpdateRequest>>(
1176            mut self,
1177            v: V,
1178        ) -> Self {
1179            self.0.request = v.into();
1180            self
1181        }
1182
1183        /// Sets all the options, replacing any prior values.
1184        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1185            self.0.options = v.into();
1186            self
1187        }
1188
1189        /// Sends the request.
1190        pub async fn send(self) -> Result<crate::model::Operation> {
1191            (*self.0.stub)
1192                .update(self.0.request, self.0.options)
1193                .await
1194                .map(gax::response::Response::into_body)
1195        }
1196
1197        /// Sets the value of [database][crate::model::SqlDatabasesUpdateRequest::database].
1198        pub fn set_database<T: Into<std::string::String>>(mut self, v: T) -> Self {
1199            self.0.request.database = v.into();
1200            self
1201        }
1202
1203        /// Sets the value of [instance][crate::model::SqlDatabasesUpdateRequest::instance].
1204        pub fn set_instance<T: Into<std::string::String>>(mut self, v: T) -> Self {
1205            self.0.request.instance = v.into();
1206            self
1207        }
1208
1209        /// Sets the value of [project][crate::model::SqlDatabasesUpdateRequest::project].
1210        pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
1211            self.0.request.project = v.into();
1212            self
1213        }
1214
1215        /// Sets the value of [body][crate::model::SqlDatabasesUpdateRequest::body].
1216        pub fn set_body<T>(mut self, v: T) -> Self
1217        where
1218            T: std::convert::Into<crate::model::Database>,
1219        {
1220            self.0.request.body = std::option::Option::Some(v.into());
1221            self
1222        }
1223
1224        /// Sets or clears the value of [body][crate::model::SqlDatabasesUpdateRequest::body].
1225        pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
1226        where
1227            T: std::convert::Into<crate::model::Database>,
1228        {
1229            self.0.request.body = v.map(|x| x.into());
1230            self
1231        }
1232    }
1233
1234    #[doc(hidden)]
1235    impl gax::options::internal::RequestBuilder for Update {
1236        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1237            &mut self.0.options
1238        }
1239    }
1240}
1241
1242pub mod sql_flags_service {
1243    use crate::Result;
1244
1245    /// A builder for [SqlFlagsService][crate::client::SqlFlagsService].
1246    ///
1247    /// ```
1248    /// # tokio_test::block_on(async {
1249    /// # use google_cloud_sql_v1::*;
1250    /// # use builder::sql_flags_service::ClientBuilder;
1251    /// # use client::SqlFlagsService;
1252    /// let builder : ClientBuilder = SqlFlagsService::builder();
1253    /// let client = builder
1254    ///     .with_endpoint("https://sqladmin.googleapis.com")
1255    ///     .build().await?;
1256    /// # gax::client_builder::Result::<()>::Ok(()) });
1257    /// ```
1258    pub type ClientBuilder =
1259        gax::client_builder::ClientBuilder<client::Factory, gaxi::options::Credentials>;
1260
1261    pub(crate) mod client {
1262        use super::super::super::client::SqlFlagsService;
1263        pub struct Factory;
1264        impl gax::client_builder::internal::ClientFactory for Factory {
1265            type Client = SqlFlagsService;
1266            type Credentials = gaxi::options::Credentials;
1267            async fn build(
1268                self,
1269                config: gaxi::options::ClientConfig,
1270            ) -> gax::client_builder::Result<Self::Client> {
1271                Self::Client::new(config).await
1272            }
1273        }
1274    }
1275
1276    /// Common implementation for [crate::client::SqlFlagsService] request builders.
1277    #[derive(Clone, Debug)]
1278    pub(crate) struct RequestBuilder<R: std::default::Default> {
1279        stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlFlagsService>,
1280        request: R,
1281        options: gax::options::RequestOptions,
1282    }
1283
1284    impl<R> RequestBuilder<R>
1285    where
1286        R: std::default::Default,
1287    {
1288        pub(crate) fn new(
1289            stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlFlagsService>,
1290        ) -> Self {
1291            Self {
1292                stub,
1293                request: R::default(),
1294                options: gax::options::RequestOptions::default(),
1295            }
1296        }
1297    }
1298
1299    /// The request builder for [SqlFlagsService::list][crate::client::SqlFlagsService::list] calls.
1300    ///
1301    /// # Example
1302    /// ```no_run
1303    /// # use google_cloud_sql_v1::builder;
1304    /// use builder::sql_flags_service::List;
1305    /// # tokio_test::block_on(async {
1306    ///
1307    /// let builder = prepare_request_builder();
1308    /// let response = builder.send().await?;
1309    /// # gax::Result::<()>::Ok(()) });
1310    ///
1311    /// fn prepare_request_builder() -> List {
1312    ///   # panic!();
1313    ///   // ... details omitted ...
1314    /// }
1315    /// ```
1316    #[derive(Clone, Debug)]
1317    pub struct List(RequestBuilder<crate::model::SqlFlagsListRequest>);
1318
1319    impl List {
1320        pub(crate) fn new(
1321            stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlFlagsService>,
1322        ) -> Self {
1323            Self(RequestBuilder::new(stub))
1324        }
1325
1326        /// Sets the full request, replacing any prior values.
1327        pub fn with_request<V: Into<crate::model::SqlFlagsListRequest>>(mut self, v: V) -> Self {
1328            self.0.request = v.into();
1329            self
1330        }
1331
1332        /// Sets all the options, replacing any prior values.
1333        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1334            self.0.options = v.into();
1335            self
1336        }
1337
1338        /// Sends the request.
1339        pub async fn send(self) -> Result<crate::model::FlagsListResponse> {
1340            (*self.0.stub)
1341                .list(self.0.request, self.0.options)
1342                .await
1343                .map(gax::response::Response::into_body)
1344        }
1345
1346        /// Sets the value of [database_version][crate::model::SqlFlagsListRequest::database_version].
1347        pub fn set_database_version<T: Into<std::string::String>>(mut self, v: T) -> Self {
1348            self.0.request.database_version = v.into();
1349            self
1350        }
1351    }
1352
1353    #[doc(hidden)]
1354    impl gax::options::internal::RequestBuilder for List {
1355        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1356            &mut self.0.options
1357        }
1358    }
1359}
1360
1361pub mod sql_instances_service {
1362    use crate::Result;
1363
1364    /// A builder for [SqlInstancesService][crate::client::SqlInstancesService].
1365    ///
1366    /// ```
1367    /// # tokio_test::block_on(async {
1368    /// # use google_cloud_sql_v1::*;
1369    /// # use builder::sql_instances_service::ClientBuilder;
1370    /// # use client::SqlInstancesService;
1371    /// let builder : ClientBuilder = SqlInstancesService::builder();
1372    /// let client = builder
1373    ///     .with_endpoint("https://sqladmin.googleapis.com")
1374    ///     .build().await?;
1375    /// # gax::client_builder::Result::<()>::Ok(()) });
1376    /// ```
1377    pub type ClientBuilder =
1378        gax::client_builder::ClientBuilder<client::Factory, gaxi::options::Credentials>;
1379
1380    pub(crate) mod client {
1381        use super::super::super::client::SqlInstancesService;
1382        pub struct Factory;
1383        impl gax::client_builder::internal::ClientFactory for Factory {
1384            type Client = SqlInstancesService;
1385            type Credentials = gaxi::options::Credentials;
1386            async fn build(
1387                self,
1388                config: gaxi::options::ClientConfig,
1389            ) -> gax::client_builder::Result<Self::Client> {
1390                Self::Client::new(config).await
1391            }
1392        }
1393    }
1394
1395    /// Common implementation for [crate::client::SqlInstancesService] request builders.
1396    #[derive(Clone, Debug)]
1397    pub(crate) struct RequestBuilder<R: std::default::Default> {
1398        stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlInstancesService>,
1399        request: R,
1400        options: gax::options::RequestOptions,
1401    }
1402
1403    impl<R> RequestBuilder<R>
1404    where
1405        R: std::default::Default,
1406    {
1407        pub(crate) fn new(
1408            stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlInstancesService>,
1409        ) -> Self {
1410            Self {
1411                stub,
1412                request: R::default(),
1413                options: gax::options::RequestOptions::default(),
1414            }
1415        }
1416    }
1417
1418    /// The request builder for [SqlInstancesService::add_server_ca][crate::client::SqlInstancesService::add_server_ca] calls.
1419    ///
1420    /// # Example
1421    /// ```no_run
1422    /// # use google_cloud_sql_v1::builder;
1423    /// use builder::sql_instances_service::AddServerCa;
1424    /// # tokio_test::block_on(async {
1425    ///
1426    /// let builder = prepare_request_builder();
1427    /// let response = builder.send().await?;
1428    /// # gax::Result::<()>::Ok(()) });
1429    ///
1430    /// fn prepare_request_builder() -> AddServerCa {
1431    ///   # panic!();
1432    ///   // ... details omitted ...
1433    /// }
1434    /// ```
1435    #[derive(Clone, Debug)]
1436    pub struct AddServerCa(RequestBuilder<crate::model::SqlInstancesAddServerCaRequest>);
1437
1438    impl AddServerCa {
1439        pub(crate) fn new(
1440            stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlInstancesService>,
1441        ) -> Self {
1442            Self(RequestBuilder::new(stub))
1443        }
1444
1445        /// Sets the full request, replacing any prior values.
1446        pub fn with_request<V: Into<crate::model::SqlInstancesAddServerCaRequest>>(
1447            mut self,
1448            v: V,
1449        ) -> Self {
1450            self.0.request = v.into();
1451            self
1452        }
1453
1454        /// Sets all the options, replacing any prior values.
1455        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1456            self.0.options = v.into();
1457            self
1458        }
1459
1460        /// Sends the request.
1461        pub async fn send(self) -> Result<crate::model::Operation> {
1462            (*self.0.stub)
1463                .add_server_ca(self.0.request, self.0.options)
1464                .await
1465                .map(gax::response::Response::into_body)
1466        }
1467
1468        /// Sets the value of [instance][crate::model::SqlInstancesAddServerCaRequest::instance].
1469        pub fn set_instance<T: Into<std::string::String>>(mut self, v: T) -> Self {
1470            self.0.request.instance = v.into();
1471            self
1472        }
1473
1474        /// Sets the value of [project][crate::model::SqlInstancesAddServerCaRequest::project].
1475        pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
1476            self.0.request.project = v.into();
1477            self
1478        }
1479    }
1480
1481    #[doc(hidden)]
1482    impl gax::options::internal::RequestBuilder for AddServerCa {
1483        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1484            &mut self.0.options
1485        }
1486    }
1487
1488    /// The request builder for [SqlInstancesService::clone][crate::client::SqlInstancesService::clone] calls.
1489    ///
1490    /// # Example
1491    /// ```no_run
1492    /// # use google_cloud_sql_v1::builder;
1493    /// use builder::sql_instances_service::Clone;
1494    /// # tokio_test::block_on(async {
1495    ///
1496    /// let builder = prepare_request_builder();
1497    /// let response = builder.send().await?;
1498    /// # gax::Result::<()>::Ok(()) });
1499    ///
1500    /// fn prepare_request_builder() -> Clone {
1501    ///   # panic!();
1502    ///   // ... details omitted ...
1503    /// }
1504    /// ```
1505    #[derive(Clone, Debug)]
1506    pub struct Clone(RequestBuilder<crate::model::SqlInstancesCloneRequest>);
1507
1508    impl Clone {
1509        pub(crate) fn new(
1510            stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlInstancesService>,
1511        ) -> Self {
1512            Self(RequestBuilder::new(stub))
1513        }
1514
1515        /// Sets the full request, replacing any prior values.
1516        pub fn with_request<V: Into<crate::model::SqlInstancesCloneRequest>>(
1517            mut self,
1518            v: V,
1519        ) -> Self {
1520            self.0.request = v.into();
1521            self
1522        }
1523
1524        /// Sets all the options, replacing any prior values.
1525        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1526            self.0.options = v.into();
1527            self
1528        }
1529
1530        /// Sends the request.
1531        pub async fn send(self) -> Result<crate::model::Operation> {
1532            (*self.0.stub)
1533                .clone(self.0.request, self.0.options)
1534                .await
1535                .map(gax::response::Response::into_body)
1536        }
1537
1538        /// Sets the value of [instance][crate::model::SqlInstancesCloneRequest::instance].
1539        pub fn set_instance<T: Into<std::string::String>>(mut self, v: T) -> Self {
1540            self.0.request.instance = v.into();
1541            self
1542        }
1543
1544        /// Sets the value of [project][crate::model::SqlInstancesCloneRequest::project].
1545        pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
1546            self.0.request.project = v.into();
1547            self
1548        }
1549
1550        /// Sets the value of [body][crate::model::SqlInstancesCloneRequest::body].
1551        pub fn set_body<T>(mut self, v: T) -> Self
1552        where
1553            T: std::convert::Into<crate::model::InstancesCloneRequest>,
1554        {
1555            self.0.request.body = std::option::Option::Some(v.into());
1556            self
1557        }
1558
1559        /// Sets or clears the value of [body][crate::model::SqlInstancesCloneRequest::body].
1560        pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
1561        where
1562            T: std::convert::Into<crate::model::InstancesCloneRequest>,
1563        {
1564            self.0.request.body = v.map(|x| x.into());
1565            self
1566        }
1567    }
1568
1569    #[doc(hidden)]
1570    impl gax::options::internal::RequestBuilder for Clone {
1571        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1572            &mut self.0.options
1573        }
1574    }
1575
1576    /// The request builder for [SqlInstancesService::delete][crate::client::SqlInstancesService::delete] calls.
1577    ///
1578    /// # Example
1579    /// ```no_run
1580    /// # use google_cloud_sql_v1::builder;
1581    /// use builder::sql_instances_service::Delete;
1582    /// # tokio_test::block_on(async {
1583    ///
1584    /// let builder = prepare_request_builder();
1585    /// let response = builder.send().await?;
1586    /// # gax::Result::<()>::Ok(()) });
1587    ///
1588    /// fn prepare_request_builder() -> Delete {
1589    ///   # panic!();
1590    ///   // ... details omitted ...
1591    /// }
1592    /// ```
1593    #[derive(Clone, Debug)]
1594    pub struct Delete(RequestBuilder<crate::model::SqlInstancesDeleteRequest>);
1595
1596    impl Delete {
1597        pub(crate) fn new(
1598            stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlInstancesService>,
1599        ) -> Self {
1600            Self(RequestBuilder::new(stub))
1601        }
1602
1603        /// Sets the full request, replacing any prior values.
1604        pub fn with_request<V: Into<crate::model::SqlInstancesDeleteRequest>>(
1605            mut self,
1606            v: V,
1607        ) -> Self {
1608            self.0.request = v.into();
1609            self
1610        }
1611
1612        /// Sets all the options, replacing any prior values.
1613        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1614            self.0.options = v.into();
1615            self
1616        }
1617
1618        /// Sends the request.
1619        pub async fn send(self) -> Result<crate::model::Operation> {
1620            (*self.0.stub)
1621                .delete(self.0.request, self.0.options)
1622                .await
1623                .map(gax::response::Response::into_body)
1624        }
1625
1626        /// Sets the value of [instance][crate::model::SqlInstancesDeleteRequest::instance].
1627        pub fn set_instance<T: Into<std::string::String>>(mut self, v: T) -> Self {
1628            self.0.request.instance = v.into();
1629            self
1630        }
1631
1632        /// Sets the value of [project][crate::model::SqlInstancesDeleteRequest::project].
1633        pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
1634            self.0.request.project = v.into();
1635            self
1636        }
1637    }
1638
1639    #[doc(hidden)]
1640    impl gax::options::internal::RequestBuilder for Delete {
1641        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1642            &mut self.0.options
1643        }
1644    }
1645
1646    /// The request builder for [SqlInstancesService::demote_master][crate::client::SqlInstancesService::demote_master] calls.
1647    ///
1648    /// # Example
1649    /// ```no_run
1650    /// # use google_cloud_sql_v1::builder;
1651    /// use builder::sql_instances_service::DemoteMaster;
1652    /// # tokio_test::block_on(async {
1653    ///
1654    /// let builder = prepare_request_builder();
1655    /// let response = builder.send().await?;
1656    /// # gax::Result::<()>::Ok(()) });
1657    ///
1658    /// fn prepare_request_builder() -> DemoteMaster {
1659    ///   # panic!();
1660    ///   // ... details omitted ...
1661    /// }
1662    /// ```
1663    #[derive(Clone, Debug)]
1664    pub struct DemoteMaster(RequestBuilder<crate::model::SqlInstancesDemoteMasterRequest>);
1665
1666    impl DemoteMaster {
1667        pub(crate) fn new(
1668            stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlInstancesService>,
1669        ) -> Self {
1670            Self(RequestBuilder::new(stub))
1671        }
1672
1673        /// Sets the full request, replacing any prior values.
1674        pub fn with_request<V: Into<crate::model::SqlInstancesDemoteMasterRequest>>(
1675            mut self,
1676            v: V,
1677        ) -> Self {
1678            self.0.request = v.into();
1679            self
1680        }
1681
1682        /// Sets all the options, replacing any prior values.
1683        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1684            self.0.options = v.into();
1685            self
1686        }
1687
1688        /// Sends the request.
1689        pub async fn send(self) -> Result<crate::model::Operation> {
1690            (*self.0.stub)
1691                .demote_master(self.0.request, self.0.options)
1692                .await
1693                .map(gax::response::Response::into_body)
1694        }
1695
1696        /// Sets the value of [instance][crate::model::SqlInstancesDemoteMasterRequest::instance].
1697        pub fn set_instance<T: Into<std::string::String>>(mut self, v: T) -> Self {
1698            self.0.request.instance = v.into();
1699            self
1700        }
1701
1702        /// Sets the value of [project][crate::model::SqlInstancesDemoteMasterRequest::project].
1703        pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
1704            self.0.request.project = v.into();
1705            self
1706        }
1707
1708        /// Sets the value of [body][crate::model::SqlInstancesDemoteMasterRequest::body].
1709        pub fn set_body<T>(mut self, v: T) -> Self
1710        where
1711            T: std::convert::Into<crate::model::InstancesDemoteMasterRequest>,
1712        {
1713            self.0.request.body = std::option::Option::Some(v.into());
1714            self
1715        }
1716
1717        /// Sets or clears the value of [body][crate::model::SqlInstancesDemoteMasterRequest::body].
1718        pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
1719        where
1720            T: std::convert::Into<crate::model::InstancesDemoteMasterRequest>,
1721        {
1722            self.0.request.body = v.map(|x| x.into());
1723            self
1724        }
1725    }
1726
1727    #[doc(hidden)]
1728    impl gax::options::internal::RequestBuilder for DemoteMaster {
1729        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1730            &mut self.0.options
1731        }
1732    }
1733
1734    /// The request builder for [SqlInstancesService::demote][crate::client::SqlInstancesService::demote] calls.
1735    ///
1736    /// # Example
1737    /// ```no_run
1738    /// # use google_cloud_sql_v1::builder;
1739    /// use builder::sql_instances_service::Demote;
1740    /// # tokio_test::block_on(async {
1741    ///
1742    /// let builder = prepare_request_builder();
1743    /// let response = builder.send().await?;
1744    /// # gax::Result::<()>::Ok(()) });
1745    ///
1746    /// fn prepare_request_builder() -> Demote {
1747    ///   # panic!();
1748    ///   // ... details omitted ...
1749    /// }
1750    /// ```
1751    #[derive(Clone, Debug)]
1752    pub struct Demote(RequestBuilder<crate::model::SqlInstancesDemoteRequest>);
1753
1754    impl Demote {
1755        pub(crate) fn new(
1756            stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlInstancesService>,
1757        ) -> Self {
1758            Self(RequestBuilder::new(stub))
1759        }
1760
1761        /// Sets the full request, replacing any prior values.
1762        pub fn with_request<V: Into<crate::model::SqlInstancesDemoteRequest>>(
1763            mut self,
1764            v: V,
1765        ) -> Self {
1766            self.0.request = v.into();
1767            self
1768        }
1769
1770        /// Sets all the options, replacing any prior values.
1771        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1772            self.0.options = v.into();
1773            self
1774        }
1775
1776        /// Sends the request.
1777        pub async fn send(self) -> Result<crate::model::Operation> {
1778            (*self.0.stub)
1779                .demote(self.0.request, self.0.options)
1780                .await
1781                .map(gax::response::Response::into_body)
1782        }
1783
1784        /// Sets the value of [instance][crate::model::SqlInstancesDemoteRequest::instance].
1785        ///
1786        /// This is a **required** field for requests.
1787        pub fn set_instance<T: Into<std::string::String>>(mut self, v: T) -> Self {
1788            self.0.request.instance = v.into();
1789            self
1790        }
1791
1792        /// Sets the value of [project][crate::model::SqlInstancesDemoteRequest::project].
1793        ///
1794        /// This is a **required** field for requests.
1795        pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
1796            self.0.request.project = v.into();
1797            self
1798        }
1799
1800        /// Sets the value of [body][crate::model::SqlInstancesDemoteRequest::body].
1801        ///
1802        /// This is a **required** field for requests.
1803        pub fn set_body<T>(mut self, v: T) -> Self
1804        where
1805            T: std::convert::Into<crate::model::InstancesDemoteRequest>,
1806        {
1807            self.0.request.body = std::option::Option::Some(v.into());
1808            self
1809        }
1810
1811        /// Sets or clears the value of [body][crate::model::SqlInstancesDemoteRequest::body].
1812        ///
1813        /// This is a **required** field for requests.
1814        pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
1815        where
1816            T: std::convert::Into<crate::model::InstancesDemoteRequest>,
1817        {
1818            self.0.request.body = v.map(|x| x.into());
1819            self
1820        }
1821    }
1822
1823    #[doc(hidden)]
1824    impl gax::options::internal::RequestBuilder for Demote {
1825        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1826            &mut self.0.options
1827        }
1828    }
1829
1830    /// The request builder for [SqlInstancesService::export][crate::client::SqlInstancesService::export] calls.
1831    ///
1832    /// # Example
1833    /// ```no_run
1834    /// # use google_cloud_sql_v1::builder;
1835    /// use builder::sql_instances_service::Export;
1836    /// # tokio_test::block_on(async {
1837    ///
1838    /// let builder = prepare_request_builder();
1839    /// let response = builder.send().await?;
1840    /// # gax::Result::<()>::Ok(()) });
1841    ///
1842    /// fn prepare_request_builder() -> Export {
1843    ///   # panic!();
1844    ///   // ... details omitted ...
1845    /// }
1846    /// ```
1847    #[derive(Clone, Debug)]
1848    pub struct Export(RequestBuilder<crate::model::SqlInstancesExportRequest>);
1849
1850    impl Export {
1851        pub(crate) fn new(
1852            stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlInstancesService>,
1853        ) -> Self {
1854            Self(RequestBuilder::new(stub))
1855        }
1856
1857        /// Sets the full request, replacing any prior values.
1858        pub fn with_request<V: Into<crate::model::SqlInstancesExportRequest>>(
1859            mut self,
1860            v: V,
1861        ) -> Self {
1862            self.0.request = v.into();
1863            self
1864        }
1865
1866        /// Sets all the options, replacing any prior values.
1867        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1868            self.0.options = v.into();
1869            self
1870        }
1871
1872        /// Sends the request.
1873        pub async fn send(self) -> Result<crate::model::Operation> {
1874            (*self.0.stub)
1875                .export(self.0.request, self.0.options)
1876                .await
1877                .map(gax::response::Response::into_body)
1878        }
1879
1880        /// Sets the value of [instance][crate::model::SqlInstancesExportRequest::instance].
1881        pub fn set_instance<T: Into<std::string::String>>(mut self, v: T) -> Self {
1882            self.0.request.instance = v.into();
1883            self
1884        }
1885
1886        /// Sets the value of [project][crate::model::SqlInstancesExportRequest::project].
1887        pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
1888            self.0.request.project = v.into();
1889            self
1890        }
1891
1892        /// Sets the value of [body][crate::model::SqlInstancesExportRequest::body].
1893        pub fn set_body<T>(mut self, v: T) -> Self
1894        where
1895            T: std::convert::Into<crate::model::InstancesExportRequest>,
1896        {
1897            self.0.request.body = std::option::Option::Some(v.into());
1898            self
1899        }
1900
1901        /// Sets or clears the value of [body][crate::model::SqlInstancesExportRequest::body].
1902        pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
1903        where
1904            T: std::convert::Into<crate::model::InstancesExportRequest>,
1905        {
1906            self.0.request.body = v.map(|x| x.into());
1907            self
1908        }
1909    }
1910
1911    #[doc(hidden)]
1912    impl gax::options::internal::RequestBuilder for Export {
1913        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1914            &mut self.0.options
1915        }
1916    }
1917
1918    /// The request builder for [SqlInstancesService::failover][crate::client::SqlInstancesService::failover] calls.
1919    ///
1920    /// # Example
1921    /// ```no_run
1922    /// # use google_cloud_sql_v1::builder;
1923    /// use builder::sql_instances_service::Failover;
1924    /// # tokio_test::block_on(async {
1925    ///
1926    /// let builder = prepare_request_builder();
1927    /// let response = builder.send().await?;
1928    /// # gax::Result::<()>::Ok(()) });
1929    ///
1930    /// fn prepare_request_builder() -> Failover {
1931    ///   # panic!();
1932    ///   // ... details omitted ...
1933    /// }
1934    /// ```
1935    #[derive(Clone, Debug)]
1936    pub struct Failover(RequestBuilder<crate::model::SqlInstancesFailoverRequest>);
1937
1938    impl Failover {
1939        pub(crate) fn new(
1940            stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlInstancesService>,
1941        ) -> Self {
1942            Self(RequestBuilder::new(stub))
1943        }
1944
1945        /// Sets the full request, replacing any prior values.
1946        pub fn with_request<V: Into<crate::model::SqlInstancesFailoverRequest>>(
1947            mut self,
1948            v: V,
1949        ) -> Self {
1950            self.0.request = v.into();
1951            self
1952        }
1953
1954        /// Sets all the options, replacing any prior values.
1955        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1956            self.0.options = v.into();
1957            self
1958        }
1959
1960        /// Sends the request.
1961        pub async fn send(self) -> Result<crate::model::Operation> {
1962            (*self.0.stub)
1963                .failover(self.0.request, self.0.options)
1964                .await
1965                .map(gax::response::Response::into_body)
1966        }
1967
1968        /// Sets the value of [instance][crate::model::SqlInstancesFailoverRequest::instance].
1969        pub fn set_instance<T: Into<std::string::String>>(mut self, v: T) -> Self {
1970            self.0.request.instance = v.into();
1971            self
1972        }
1973
1974        /// Sets the value of [project][crate::model::SqlInstancesFailoverRequest::project].
1975        pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
1976            self.0.request.project = v.into();
1977            self
1978        }
1979
1980        /// Sets the value of [body][crate::model::SqlInstancesFailoverRequest::body].
1981        pub fn set_body<T>(mut self, v: T) -> Self
1982        where
1983            T: std::convert::Into<crate::model::InstancesFailoverRequest>,
1984        {
1985            self.0.request.body = std::option::Option::Some(v.into());
1986            self
1987        }
1988
1989        /// Sets or clears the value of [body][crate::model::SqlInstancesFailoverRequest::body].
1990        pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
1991        where
1992            T: std::convert::Into<crate::model::InstancesFailoverRequest>,
1993        {
1994            self.0.request.body = v.map(|x| x.into());
1995            self
1996        }
1997    }
1998
1999    #[doc(hidden)]
2000    impl gax::options::internal::RequestBuilder for Failover {
2001        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2002            &mut self.0.options
2003        }
2004    }
2005
2006    /// The request builder for [SqlInstancesService::reencrypt][crate::client::SqlInstancesService::reencrypt] calls.
2007    ///
2008    /// # Example
2009    /// ```no_run
2010    /// # use google_cloud_sql_v1::builder;
2011    /// use builder::sql_instances_service::Reencrypt;
2012    /// # tokio_test::block_on(async {
2013    ///
2014    /// let builder = prepare_request_builder();
2015    /// let response = builder.send().await?;
2016    /// # gax::Result::<()>::Ok(()) });
2017    ///
2018    /// fn prepare_request_builder() -> Reencrypt {
2019    ///   # panic!();
2020    ///   // ... details omitted ...
2021    /// }
2022    /// ```
2023    #[derive(Clone, Debug)]
2024    pub struct Reencrypt(RequestBuilder<crate::model::SqlInstancesReencryptRequest>);
2025
2026    impl Reencrypt {
2027        pub(crate) fn new(
2028            stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlInstancesService>,
2029        ) -> Self {
2030            Self(RequestBuilder::new(stub))
2031        }
2032
2033        /// Sets the full request, replacing any prior values.
2034        pub fn with_request<V: Into<crate::model::SqlInstancesReencryptRequest>>(
2035            mut self,
2036            v: V,
2037        ) -> Self {
2038            self.0.request = v.into();
2039            self
2040        }
2041
2042        /// Sets all the options, replacing any prior values.
2043        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2044            self.0.options = v.into();
2045            self
2046        }
2047
2048        /// Sends the request.
2049        pub async fn send(self) -> Result<crate::model::Operation> {
2050            (*self.0.stub)
2051                .reencrypt(self.0.request, self.0.options)
2052                .await
2053                .map(gax::response::Response::into_body)
2054        }
2055
2056        /// Sets the value of [instance][crate::model::SqlInstancesReencryptRequest::instance].
2057        pub fn set_instance<T: Into<std::string::String>>(mut self, v: T) -> Self {
2058            self.0.request.instance = v.into();
2059            self
2060        }
2061
2062        /// Sets the value of [project][crate::model::SqlInstancesReencryptRequest::project].
2063        pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
2064            self.0.request.project = v.into();
2065            self
2066        }
2067
2068        /// Sets the value of [body][crate::model::SqlInstancesReencryptRequest::body].
2069        pub fn set_body<T>(mut self, v: T) -> Self
2070        where
2071            T: std::convert::Into<crate::model::InstancesReencryptRequest>,
2072        {
2073            self.0.request.body = std::option::Option::Some(v.into());
2074            self
2075        }
2076
2077        /// Sets or clears the value of [body][crate::model::SqlInstancesReencryptRequest::body].
2078        pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
2079        where
2080            T: std::convert::Into<crate::model::InstancesReencryptRequest>,
2081        {
2082            self.0.request.body = v.map(|x| x.into());
2083            self
2084        }
2085    }
2086
2087    #[doc(hidden)]
2088    impl gax::options::internal::RequestBuilder for Reencrypt {
2089        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2090            &mut self.0.options
2091        }
2092    }
2093
2094    /// The request builder for [SqlInstancesService::get][crate::client::SqlInstancesService::get] calls.
2095    ///
2096    /// # Example
2097    /// ```no_run
2098    /// # use google_cloud_sql_v1::builder;
2099    /// use builder::sql_instances_service::Get;
2100    /// # tokio_test::block_on(async {
2101    ///
2102    /// let builder = prepare_request_builder();
2103    /// let response = builder.send().await?;
2104    /// # gax::Result::<()>::Ok(()) });
2105    ///
2106    /// fn prepare_request_builder() -> Get {
2107    ///   # panic!();
2108    ///   // ... details omitted ...
2109    /// }
2110    /// ```
2111    #[derive(Clone, Debug)]
2112    pub struct Get(RequestBuilder<crate::model::SqlInstancesGetRequest>);
2113
2114    impl Get {
2115        pub(crate) fn new(
2116            stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlInstancesService>,
2117        ) -> Self {
2118            Self(RequestBuilder::new(stub))
2119        }
2120
2121        /// Sets the full request, replacing any prior values.
2122        pub fn with_request<V: Into<crate::model::SqlInstancesGetRequest>>(mut self, v: V) -> Self {
2123            self.0.request = v.into();
2124            self
2125        }
2126
2127        /// Sets all the options, replacing any prior values.
2128        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2129            self.0.options = v.into();
2130            self
2131        }
2132
2133        /// Sends the request.
2134        pub async fn send(self) -> Result<crate::model::DatabaseInstance> {
2135            (*self.0.stub)
2136                .get(self.0.request, self.0.options)
2137                .await
2138                .map(gax::response::Response::into_body)
2139        }
2140
2141        /// Sets the value of [instance][crate::model::SqlInstancesGetRequest::instance].
2142        pub fn set_instance<T: Into<std::string::String>>(mut self, v: T) -> Self {
2143            self.0.request.instance = v.into();
2144            self
2145        }
2146
2147        /// Sets the value of [project][crate::model::SqlInstancesGetRequest::project].
2148        pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
2149            self.0.request.project = v.into();
2150            self
2151        }
2152    }
2153
2154    #[doc(hidden)]
2155    impl gax::options::internal::RequestBuilder for Get {
2156        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2157            &mut self.0.options
2158        }
2159    }
2160
2161    /// The request builder for [SqlInstancesService::import][crate::client::SqlInstancesService::import] calls.
2162    ///
2163    /// # Example
2164    /// ```no_run
2165    /// # use google_cloud_sql_v1::builder;
2166    /// use builder::sql_instances_service::Import;
2167    /// # tokio_test::block_on(async {
2168    ///
2169    /// let builder = prepare_request_builder();
2170    /// let response = builder.send().await?;
2171    /// # gax::Result::<()>::Ok(()) });
2172    ///
2173    /// fn prepare_request_builder() -> Import {
2174    ///   # panic!();
2175    ///   // ... details omitted ...
2176    /// }
2177    /// ```
2178    #[derive(Clone, Debug)]
2179    pub struct Import(RequestBuilder<crate::model::SqlInstancesImportRequest>);
2180
2181    impl Import {
2182        pub(crate) fn new(
2183            stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlInstancesService>,
2184        ) -> Self {
2185            Self(RequestBuilder::new(stub))
2186        }
2187
2188        /// Sets the full request, replacing any prior values.
2189        pub fn with_request<V: Into<crate::model::SqlInstancesImportRequest>>(
2190            mut self,
2191            v: V,
2192        ) -> Self {
2193            self.0.request = v.into();
2194            self
2195        }
2196
2197        /// Sets all the options, replacing any prior values.
2198        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2199            self.0.options = v.into();
2200            self
2201        }
2202
2203        /// Sends the request.
2204        pub async fn send(self) -> Result<crate::model::Operation> {
2205            (*self.0.stub)
2206                .import(self.0.request, self.0.options)
2207                .await
2208                .map(gax::response::Response::into_body)
2209        }
2210
2211        /// Sets the value of [instance][crate::model::SqlInstancesImportRequest::instance].
2212        pub fn set_instance<T: Into<std::string::String>>(mut self, v: T) -> Self {
2213            self.0.request.instance = v.into();
2214            self
2215        }
2216
2217        /// Sets the value of [project][crate::model::SqlInstancesImportRequest::project].
2218        pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
2219            self.0.request.project = v.into();
2220            self
2221        }
2222
2223        /// Sets the value of [body][crate::model::SqlInstancesImportRequest::body].
2224        pub fn set_body<T>(mut self, v: T) -> Self
2225        where
2226            T: std::convert::Into<crate::model::InstancesImportRequest>,
2227        {
2228            self.0.request.body = std::option::Option::Some(v.into());
2229            self
2230        }
2231
2232        /// Sets or clears the value of [body][crate::model::SqlInstancesImportRequest::body].
2233        pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
2234        where
2235            T: std::convert::Into<crate::model::InstancesImportRequest>,
2236        {
2237            self.0.request.body = v.map(|x| x.into());
2238            self
2239        }
2240    }
2241
2242    #[doc(hidden)]
2243    impl gax::options::internal::RequestBuilder for Import {
2244        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2245            &mut self.0.options
2246        }
2247    }
2248
2249    /// The request builder for [SqlInstancesService::insert][crate::client::SqlInstancesService::insert] calls.
2250    ///
2251    /// # Example
2252    /// ```no_run
2253    /// # use google_cloud_sql_v1::builder;
2254    /// use builder::sql_instances_service::Insert;
2255    /// # tokio_test::block_on(async {
2256    ///
2257    /// let builder = prepare_request_builder();
2258    /// let response = builder.send().await?;
2259    /// # gax::Result::<()>::Ok(()) });
2260    ///
2261    /// fn prepare_request_builder() -> Insert {
2262    ///   # panic!();
2263    ///   // ... details omitted ...
2264    /// }
2265    /// ```
2266    #[derive(Clone, Debug)]
2267    pub struct Insert(RequestBuilder<crate::model::SqlInstancesInsertRequest>);
2268
2269    impl Insert {
2270        pub(crate) fn new(
2271            stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlInstancesService>,
2272        ) -> Self {
2273            Self(RequestBuilder::new(stub))
2274        }
2275
2276        /// Sets the full request, replacing any prior values.
2277        pub fn with_request<V: Into<crate::model::SqlInstancesInsertRequest>>(
2278            mut self,
2279            v: V,
2280        ) -> Self {
2281            self.0.request = v.into();
2282            self
2283        }
2284
2285        /// Sets all the options, replacing any prior values.
2286        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2287            self.0.options = v.into();
2288            self
2289        }
2290
2291        /// Sends the request.
2292        pub async fn send(self) -> Result<crate::model::Operation> {
2293            (*self.0.stub)
2294                .insert(self.0.request, self.0.options)
2295                .await
2296                .map(gax::response::Response::into_body)
2297        }
2298
2299        /// Sets the value of [project][crate::model::SqlInstancesInsertRequest::project].
2300        pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
2301            self.0.request.project = v.into();
2302            self
2303        }
2304
2305        /// Sets the value of [body][crate::model::SqlInstancesInsertRequest::body].
2306        pub fn set_body<T>(mut self, v: T) -> Self
2307        where
2308            T: std::convert::Into<crate::model::DatabaseInstance>,
2309        {
2310            self.0.request.body = std::option::Option::Some(v.into());
2311            self
2312        }
2313
2314        /// Sets or clears the value of [body][crate::model::SqlInstancesInsertRequest::body].
2315        pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
2316        where
2317            T: std::convert::Into<crate::model::DatabaseInstance>,
2318        {
2319            self.0.request.body = v.map(|x| x.into());
2320            self
2321        }
2322    }
2323
2324    #[doc(hidden)]
2325    impl gax::options::internal::RequestBuilder for Insert {
2326        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2327            &mut self.0.options
2328        }
2329    }
2330
2331    /// The request builder for [SqlInstancesService::list][crate::client::SqlInstancesService::list] calls.
2332    ///
2333    /// # Example
2334    /// ```no_run
2335    /// # use google_cloud_sql_v1::builder;
2336    /// use builder::sql_instances_service::List;
2337    /// # tokio_test::block_on(async {
2338    /// use gax::paginator::ItemPaginator;
2339    ///
2340    /// let builder = prepare_request_builder();
2341    /// let mut items = builder.by_item();
2342    /// while let Some(result) = items.next().await {
2343    ///   let item = result?;
2344    /// }
2345    /// # gax::Result::<()>::Ok(()) });
2346    ///
2347    /// fn prepare_request_builder() -> List {
2348    ///   # panic!();
2349    ///   // ... details omitted ...
2350    /// }
2351    /// ```
2352    #[derive(Clone, Debug)]
2353    pub struct List(RequestBuilder<crate::model::SqlInstancesListRequest>);
2354
2355    impl List {
2356        pub(crate) fn new(
2357            stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlInstancesService>,
2358        ) -> Self {
2359            Self(RequestBuilder::new(stub))
2360        }
2361
2362        /// Sets the full request, replacing any prior values.
2363        pub fn with_request<V: Into<crate::model::SqlInstancesListRequest>>(
2364            mut self,
2365            v: V,
2366        ) -> Self {
2367            self.0.request = v.into();
2368            self
2369        }
2370
2371        /// Sets all the options, replacing any prior values.
2372        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2373            self.0.options = v.into();
2374            self
2375        }
2376
2377        /// Sends the request.
2378        pub async fn send(self) -> Result<crate::model::InstancesListResponse> {
2379            (*self.0.stub)
2380                .list(self.0.request, self.0.options)
2381                .await
2382                .map(gax::response::Response::into_body)
2383        }
2384
2385        /// Streams each page in the collection.
2386        pub fn by_page(
2387            self,
2388        ) -> impl gax::paginator::Paginator<crate::model::InstancesListResponse, gax::error::Error>
2389        {
2390            use std::clone::Clone;
2391            let token = self.0.request.page_token.clone();
2392            let execute = move |token: String| {
2393                let mut builder = self.clone();
2394                builder.0.request = builder.0.request.set_page_token(token);
2395                builder.send()
2396            };
2397            gax::paginator::internal::new_paginator(token, execute)
2398        }
2399
2400        /// Streams each item in the collection.
2401        pub fn by_item(
2402            self,
2403        ) -> impl gax::paginator::ItemPaginator<crate::model::InstancesListResponse, gax::error::Error>
2404        {
2405            use gax::paginator::Paginator;
2406            self.by_page().items()
2407        }
2408
2409        /// Sets the value of [filter][crate::model::SqlInstancesListRequest::filter].
2410        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
2411            self.0.request.filter = v.into();
2412            self
2413        }
2414
2415        /// Sets the value of [max_results][crate::model::SqlInstancesListRequest::max_results].
2416        pub fn set_max_results<T: Into<u32>>(mut self, v: T) -> Self {
2417            self.0.request.max_results = v.into();
2418            self
2419        }
2420
2421        /// Sets the value of [page_token][crate::model::SqlInstancesListRequest::page_token].
2422        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
2423            self.0.request.page_token = v.into();
2424            self
2425        }
2426
2427        /// Sets the value of [project][crate::model::SqlInstancesListRequest::project].
2428        pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
2429            self.0.request.project = v.into();
2430            self
2431        }
2432    }
2433
2434    #[doc(hidden)]
2435    impl gax::options::internal::RequestBuilder for List {
2436        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2437            &mut self.0.options
2438        }
2439    }
2440
2441    /// The request builder for [SqlInstancesService::list_server_cas][crate::client::SqlInstancesService::list_server_cas] calls.
2442    ///
2443    /// # Example
2444    /// ```no_run
2445    /// # use google_cloud_sql_v1::builder;
2446    /// use builder::sql_instances_service::ListServerCas;
2447    /// # tokio_test::block_on(async {
2448    ///
2449    /// let builder = prepare_request_builder();
2450    /// let response = builder.send().await?;
2451    /// # gax::Result::<()>::Ok(()) });
2452    ///
2453    /// fn prepare_request_builder() -> ListServerCas {
2454    ///   # panic!();
2455    ///   // ... details omitted ...
2456    /// }
2457    /// ```
2458    #[derive(Clone, Debug)]
2459    pub struct ListServerCas(RequestBuilder<crate::model::SqlInstancesListServerCasRequest>);
2460
2461    impl ListServerCas {
2462        pub(crate) fn new(
2463            stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlInstancesService>,
2464        ) -> Self {
2465            Self(RequestBuilder::new(stub))
2466        }
2467
2468        /// Sets the full request, replacing any prior values.
2469        pub fn with_request<V: Into<crate::model::SqlInstancesListServerCasRequest>>(
2470            mut self,
2471            v: V,
2472        ) -> Self {
2473            self.0.request = v.into();
2474            self
2475        }
2476
2477        /// Sets all the options, replacing any prior values.
2478        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2479            self.0.options = v.into();
2480            self
2481        }
2482
2483        /// Sends the request.
2484        pub async fn send(self) -> Result<crate::model::InstancesListServerCasResponse> {
2485            (*self.0.stub)
2486                .list_server_cas(self.0.request, self.0.options)
2487                .await
2488                .map(gax::response::Response::into_body)
2489        }
2490
2491        /// Sets the value of [instance][crate::model::SqlInstancesListServerCasRequest::instance].
2492        pub fn set_instance<T: Into<std::string::String>>(mut self, v: T) -> Self {
2493            self.0.request.instance = v.into();
2494            self
2495        }
2496
2497        /// Sets the value of [project][crate::model::SqlInstancesListServerCasRequest::project].
2498        pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
2499            self.0.request.project = v.into();
2500            self
2501        }
2502    }
2503
2504    #[doc(hidden)]
2505    impl gax::options::internal::RequestBuilder for ListServerCas {
2506        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2507            &mut self.0.options
2508        }
2509    }
2510
2511    /// The request builder for [SqlInstancesService::patch][crate::client::SqlInstancesService::patch] calls.
2512    ///
2513    /// # Example
2514    /// ```no_run
2515    /// # use google_cloud_sql_v1::builder;
2516    /// use builder::sql_instances_service::Patch;
2517    /// # tokio_test::block_on(async {
2518    ///
2519    /// let builder = prepare_request_builder();
2520    /// let response = builder.send().await?;
2521    /// # gax::Result::<()>::Ok(()) });
2522    ///
2523    /// fn prepare_request_builder() -> Patch {
2524    ///   # panic!();
2525    ///   // ... details omitted ...
2526    /// }
2527    /// ```
2528    #[derive(Clone, Debug)]
2529    pub struct Patch(RequestBuilder<crate::model::SqlInstancesPatchRequest>);
2530
2531    impl Patch {
2532        pub(crate) fn new(
2533            stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlInstancesService>,
2534        ) -> Self {
2535            Self(RequestBuilder::new(stub))
2536        }
2537
2538        /// Sets the full request, replacing any prior values.
2539        pub fn with_request<V: Into<crate::model::SqlInstancesPatchRequest>>(
2540            mut self,
2541            v: V,
2542        ) -> Self {
2543            self.0.request = v.into();
2544            self
2545        }
2546
2547        /// Sets all the options, replacing any prior values.
2548        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2549            self.0.options = v.into();
2550            self
2551        }
2552
2553        /// Sends the request.
2554        pub async fn send(self) -> Result<crate::model::Operation> {
2555            (*self.0.stub)
2556                .patch(self.0.request, self.0.options)
2557                .await
2558                .map(gax::response::Response::into_body)
2559        }
2560
2561        /// Sets the value of [instance][crate::model::SqlInstancesPatchRequest::instance].
2562        pub fn set_instance<T: Into<std::string::String>>(mut self, v: T) -> Self {
2563            self.0.request.instance = v.into();
2564            self
2565        }
2566
2567        /// Sets the value of [project][crate::model::SqlInstancesPatchRequest::project].
2568        pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
2569            self.0.request.project = v.into();
2570            self
2571        }
2572
2573        /// Sets the value of [body][crate::model::SqlInstancesPatchRequest::body].
2574        pub fn set_body<T>(mut self, v: T) -> Self
2575        where
2576            T: std::convert::Into<crate::model::DatabaseInstance>,
2577        {
2578            self.0.request.body = std::option::Option::Some(v.into());
2579            self
2580        }
2581
2582        /// Sets or clears the value of [body][crate::model::SqlInstancesPatchRequest::body].
2583        pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
2584        where
2585            T: std::convert::Into<crate::model::DatabaseInstance>,
2586        {
2587            self.0.request.body = v.map(|x| x.into());
2588            self
2589        }
2590    }
2591
2592    #[doc(hidden)]
2593    impl gax::options::internal::RequestBuilder for Patch {
2594        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2595            &mut self.0.options
2596        }
2597    }
2598
2599    /// The request builder for [SqlInstancesService::promote_replica][crate::client::SqlInstancesService::promote_replica] calls.
2600    ///
2601    /// # Example
2602    /// ```no_run
2603    /// # use google_cloud_sql_v1::builder;
2604    /// use builder::sql_instances_service::PromoteReplica;
2605    /// # tokio_test::block_on(async {
2606    ///
2607    /// let builder = prepare_request_builder();
2608    /// let response = builder.send().await?;
2609    /// # gax::Result::<()>::Ok(()) });
2610    ///
2611    /// fn prepare_request_builder() -> PromoteReplica {
2612    ///   # panic!();
2613    ///   // ... details omitted ...
2614    /// }
2615    /// ```
2616    #[derive(Clone, Debug)]
2617    pub struct PromoteReplica(RequestBuilder<crate::model::SqlInstancesPromoteReplicaRequest>);
2618
2619    impl PromoteReplica {
2620        pub(crate) fn new(
2621            stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlInstancesService>,
2622        ) -> Self {
2623            Self(RequestBuilder::new(stub))
2624        }
2625
2626        /// Sets the full request, replacing any prior values.
2627        pub fn with_request<V: Into<crate::model::SqlInstancesPromoteReplicaRequest>>(
2628            mut self,
2629            v: V,
2630        ) -> Self {
2631            self.0.request = v.into();
2632            self
2633        }
2634
2635        /// Sets all the options, replacing any prior values.
2636        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2637            self.0.options = v.into();
2638            self
2639        }
2640
2641        /// Sends the request.
2642        pub async fn send(self) -> Result<crate::model::Operation> {
2643            (*self.0.stub)
2644                .promote_replica(self.0.request, self.0.options)
2645                .await
2646                .map(gax::response::Response::into_body)
2647        }
2648
2649        /// Sets the value of [instance][crate::model::SqlInstancesPromoteReplicaRequest::instance].
2650        pub fn set_instance<T: Into<std::string::String>>(mut self, v: T) -> Self {
2651            self.0.request.instance = v.into();
2652            self
2653        }
2654
2655        /// Sets the value of [project][crate::model::SqlInstancesPromoteReplicaRequest::project].
2656        pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
2657            self.0.request.project = v.into();
2658            self
2659        }
2660
2661        /// Sets the value of [failover][crate::model::SqlInstancesPromoteReplicaRequest::failover].
2662        pub fn set_failover<T: Into<bool>>(mut self, v: T) -> Self {
2663            self.0.request.failover = v.into();
2664            self
2665        }
2666    }
2667
2668    #[doc(hidden)]
2669    impl gax::options::internal::RequestBuilder for PromoteReplica {
2670        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2671            &mut self.0.options
2672        }
2673    }
2674
2675    /// The request builder for [SqlInstancesService::switchover][crate::client::SqlInstancesService::switchover] calls.
2676    ///
2677    /// # Example
2678    /// ```no_run
2679    /// # use google_cloud_sql_v1::builder;
2680    /// use builder::sql_instances_service::Switchover;
2681    /// # tokio_test::block_on(async {
2682    ///
2683    /// let builder = prepare_request_builder();
2684    /// let response = builder.send().await?;
2685    /// # gax::Result::<()>::Ok(()) });
2686    ///
2687    /// fn prepare_request_builder() -> Switchover {
2688    ///   # panic!();
2689    ///   // ... details omitted ...
2690    /// }
2691    /// ```
2692    #[derive(Clone, Debug)]
2693    pub struct Switchover(RequestBuilder<crate::model::SqlInstancesSwitchoverRequest>);
2694
2695    impl Switchover {
2696        pub(crate) fn new(
2697            stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlInstancesService>,
2698        ) -> Self {
2699            Self(RequestBuilder::new(stub))
2700        }
2701
2702        /// Sets the full request, replacing any prior values.
2703        pub fn with_request<V: Into<crate::model::SqlInstancesSwitchoverRequest>>(
2704            mut self,
2705            v: V,
2706        ) -> Self {
2707            self.0.request = v.into();
2708            self
2709        }
2710
2711        /// Sets all the options, replacing any prior values.
2712        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2713            self.0.options = v.into();
2714            self
2715        }
2716
2717        /// Sends the request.
2718        pub async fn send(self) -> Result<crate::model::Operation> {
2719            (*self.0.stub)
2720                .switchover(self.0.request, self.0.options)
2721                .await
2722                .map(gax::response::Response::into_body)
2723        }
2724
2725        /// Sets the value of [instance][crate::model::SqlInstancesSwitchoverRequest::instance].
2726        pub fn set_instance<T: Into<std::string::String>>(mut self, v: T) -> Self {
2727            self.0.request.instance = v.into();
2728            self
2729        }
2730
2731        /// Sets the value of [project][crate::model::SqlInstancesSwitchoverRequest::project].
2732        pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
2733            self.0.request.project = v.into();
2734            self
2735        }
2736
2737        /// Sets the value of [db_timeout][crate::model::SqlInstancesSwitchoverRequest::db_timeout].
2738        pub fn set_db_timeout<T>(mut self, v: T) -> Self
2739        where
2740            T: std::convert::Into<wkt::Duration>,
2741        {
2742            self.0.request.db_timeout = std::option::Option::Some(v.into());
2743            self
2744        }
2745
2746        /// Sets or clears the value of [db_timeout][crate::model::SqlInstancesSwitchoverRequest::db_timeout].
2747        pub fn set_or_clear_db_timeout<T>(mut self, v: std::option::Option<T>) -> Self
2748        where
2749            T: std::convert::Into<wkt::Duration>,
2750        {
2751            self.0.request.db_timeout = v.map(|x| x.into());
2752            self
2753        }
2754    }
2755
2756    #[doc(hidden)]
2757    impl gax::options::internal::RequestBuilder for Switchover {
2758        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2759            &mut self.0.options
2760        }
2761    }
2762
2763    /// The request builder for [SqlInstancesService::reset_ssl_config][crate::client::SqlInstancesService::reset_ssl_config] calls.
2764    ///
2765    /// # Example
2766    /// ```no_run
2767    /// # use google_cloud_sql_v1::builder;
2768    /// use builder::sql_instances_service::ResetSslConfig;
2769    /// # tokio_test::block_on(async {
2770    ///
2771    /// let builder = prepare_request_builder();
2772    /// let response = builder.send().await?;
2773    /// # gax::Result::<()>::Ok(()) });
2774    ///
2775    /// fn prepare_request_builder() -> ResetSslConfig {
2776    ///   # panic!();
2777    ///   // ... details omitted ...
2778    /// }
2779    /// ```
2780    #[derive(Clone, Debug)]
2781    pub struct ResetSslConfig(RequestBuilder<crate::model::SqlInstancesResetSslConfigRequest>);
2782
2783    impl ResetSslConfig {
2784        pub(crate) fn new(
2785            stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlInstancesService>,
2786        ) -> Self {
2787            Self(RequestBuilder::new(stub))
2788        }
2789
2790        /// Sets the full request, replacing any prior values.
2791        pub fn with_request<V: Into<crate::model::SqlInstancesResetSslConfigRequest>>(
2792            mut self,
2793            v: V,
2794        ) -> Self {
2795            self.0.request = v.into();
2796            self
2797        }
2798
2799        /// Sets all the options, replacing any prior values.
2800        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2801            self.0.options = v.into();
2802            self
2803        }
2804
2805        /// Sends the request.
2806        pub async fn send(self) -> Result<crate::model::Operation> {
2807            (*self.0.stub)
2808                .reset_ssl_config(self.0.request, self.0.options)
2809                .await
2810                .map(gax::response::Response::into_body)
2811        }
2812
2813        /// Sets the value of [instance][crate::model::SqlInstancesResetSslConfigRequest::instance].
2814        pub fn set_instance<T: Into<std::string::String>>(mut self, v: T) -> Self {
2815            self.0.request.instance = v.into();
2816            self
2817        }
2818
2819        /// Sets the value of [project][crate::model::SqlInstancesResetSslConfigRequest::project].
2820        pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
2821            self.0.request.project = v.into();
2822            self
2823        }
2824    }
2825
2826    #[doc(hidden)]
2827    impl gax::options::internal::RequestBuilder for ResetSslConfig {
2828        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2829            &mut self.0.options
2830        }
2831    }
2832
2833    /// The request builder for [SqlInstancesService::restart][crate::client::SqlInstancesService::restart] calls.
2834    ///
2835    /// # Example
2836    /// ```no_run
2837    /// # use google_cloud_sql_v1::builder;
2838    /// use builder::sql_instances_service::Restart;
2839    /// # tokio_test::block_on(async {
2840    ///
2841    /// let builder = prepare_request_builder();
2842    /// let response = builder.send().await?;
2843    /// # gax::Result::<()>::Ok(()) });
2844    ///
2845    /// fn prepare_request_builder() -> Restart {
2846    ///   # panic!();
2847    ///   // ... details omitted ...
2848    /// }
2849    /// ```
2850    #[derive(Clone, Debug)]
2851    pub struct Restart(RequestBuilder<crate::model::SqlInstancesRestartRequest>);
2852
2853    impl Restart {
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::SqlInstancesRestartRequest>>(
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<gax::options::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                .restart(self.0.request, self.0.options)
2879                .await
2880                .map(gax::response::Response::into_body)
2881        }
2882
2883        /// Sets the value of [instance][crate::model::SqlInstancesRestartRequest::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::SqlInstancesRestartRequest::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
2896    #[doc(hidden)]
2897    impl gax::options::internal::RequestBuilder for Restart {
2898        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2899            &mut self.0.options
2900        }
2901    }
2902
2903    /// The request builder for [SqlInstancesService::restore_backup][crate::client::SqlInstancesService::restore_backup] calls.
2904    ///
2905    /// # Example
2906    /// ```no_run
2907    /// # use google_cloud_sql_v1::builder;
2908    /// use builder::sql_instances_service::RestoreBackup;
2909    /// # tokio_test::block_on(async {
2910    ///
2911    /// let builder = prepare_request_builder();
2912    /// let response = builder.send().await?;
2913    /// # gax::Result::<()>::Ok(()) });
2914    ///
2915    /// fn prepare_request_builder() -> RestoreBackup {
2916    ///   # panic!();
2917    ///   // ... details omitted ...
2918    /// }
2919    /// ```
2920    #[derive(Clone, Debug)]
2921    pub struct RestoreBackup(RequestBuilder<crate::model::SqlInstancesRestoreBackupRequest>);
2922
2923    impl RestoreBackup {
2924        pub(crate) fn new(
2925            stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlInstancesService>,
2926        ) -> Self {
2927            Self(RequestBuilder::new(stub))
2928        }
2929
2930        /// Sets the full request, replacing any prior values.
2931        pub fn with_request<V: Into<crate::model::SqlInstancesRestoreBackupRequest>>(
2932            mut self,
2933            v: V,
2934        ) -> Self {
2935            self.0.request = v.into();
2936            self
2937        }
2938
2939        /// Sets all the options, replacing any prior values.
2940        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2941            self.0.options = v.into();
2942            self
2943        }
2944
2945        /// Sends the request.
2946        pub async fn send(self) -> Result<crate::model::Operation> {
2947            (*self.0.stub)
2948                .restore_backup(self.0.request, self.0.options)
2949                .await
2950                .map(gax::response::Response::into_body)
2951        }
2952
2953        /// Sets the value of [instance][crate::model::SqlInstancesRestoreBackupRequest::instance].
2954        pub fn set_instance<T: Into<std::string::String>>(mut self, v: T) -> Self {
2955            self.0.request.instance = v.into();
2956            self
2957        }
2958
2959        /// Sets the value of [project][crate::model::SqlInstancesRestoreBackupRequest::project].
2960        pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
2961            self.0.request.project = v.into();
2962            self
2963        }
2964
2965        /// Sets the value of [body][crate::model::SqlInstancesRestoreBackupRequest::body].
2966        pub fn set_body<T>(mut self, v: T) -> Self
2967        where
2968            T: std::convert::Into<crate::model::InstancesRestoreBackupRequest>,
2969        {
2970            self.0.request.body = std::option::Option::Some(v.into());
2971            self
2972        }
2973
2974        /// Sets or clears the value of [body][crate::model::SqlInstancesRestoreBackupRequest::body].
2975        pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
2976        where
2977            T: std::convert::Into<crate::model::InstancesRestoreBackupRequest>,
2978        {
2979            self.0.request.body = v.map(|x| x.into());
2980            self
2981        }
2982    }
2983
2984    #[doc(hidden)]
2985    impl gax::options::internal::RequestBuilder for RestoreBackup {
2986        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2987            &mut self.0.options
2988        }
2989    }
2990
2991    /// The request builder for [SqlInstancesService::rotate_server_ca][crate::client::SqlInstancesService::rotate_server_ca] calls.
2992    ///
2993    /// # Example
2994    /// ```no_run
2995    /// # use google_cloud_sql_v1::builder;
2996    /// use builder::sql_instances_service::RotateServerCa;
2997    /// # tokio_test::block_on(async {
2998    ///
2999    /// let builder = prepare_request_builder();
3000    /// let response = builder.send().await?;
3001    /// # gax::Result::<()>::Ok(()) });
3002    ///
3003    /// fn prepare_request_builder() -> RotateServerCa {
3004    ///   # panic!();
3005    ///   // ... details omitted ...
3006    /// }
3007    /// ```
3008    #[derive(Clone, Debug)]
3009    pub struct RotateServerCa(RequestBuilder<crate::model::SqlInstancesRotateServerCaRequest>);
3010
3011    impl RotateServerCa {
3012        pub(crate) fn new(
3013            stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlInstancesService>,
3014        ) -> Self {
3015            Self(RequestBuilder::new(stub))
3016        }
3017
3018        /// Sets the full request, replacing any prior values.
3019        pub fn with_request<V: Into<crate::model::SqlInstancesRotateServerCaRequest>>(
3020            mut self,
3021            v: V,
3022        ) -> Self {
3023            self.0.request = v.into();
3024            self
3025        }
3026
3027        /// Sets all the options, replacing any prior values.
3028        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
3029            self.0.options = v.into();
3030            self
3031        }
3032
3033        /// Sends the request.
3034        pub async fn send(self) -> Result<crate::model::Operation> {
3035            (*self.0.stub)
3036                .rotate_server_ca(self.0.request, self.0.options)
3037                .await
3038                .map(gax::response::Response::into_body)
3039        }
3040
3041        /// Sets the value of [instance][crate::model::SqlInstancesRotateServerCaRequest::instance].
3042        pub fn set_instance<T: Into<std::string::String>>(mut self, v: T) -> Self {
3043            self.0.request.instance = v.into();
3044            self
3045        }
3046
3047        /// Sets the value of [project][crate::model::SqlInstancesRotateServerCaRequest::project].
3048        pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
3049            self.0.request.project = v.into();
3050            self
3051        }
3052
3053        /// Sets the value of [body][crate::model::SqlInstancesRotateServerCaRequest::body].
3054        pub fn set_body<T>(mut self, v: T) -> Self
3055        where
3056            T: std::convert::Into<crate::model::InstancesRotateServerCaRequest>,
3057        {
3058            self.0.request.body = std::option::Option::Some(v.into());
3059            self
3060        }
3061
3062        /// Sets or clears the value of [body][crate::model::SqlInstancesRotateServerCaRequest::body].
3063        pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
3064        where
3065            T: std::convert::Into<crate::model::InstancesRotateServerCaRequest>,
3066        {
3067            self.0.request.body = v.map(|x| x.into());
3068            self
3069        }
3070    }
3071
3072    #[doc(hidden)]
3073    impl gax::options::internal::RequestBuilder for RotateServerCa {
3074        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
3075            &mut self.0.options
3076        }
3077    }
3078
3079    /// The request builder for [SqlInstancesService::start_replica][crate::client::SqlInstancesService::start_replica] calls.
3080    ///
3081    /// # Example
3082    /// ```no_run
3083    /// # use google_cloud_sql_v1::builder;
3084    /// use builder::sql_instances_service::StartReplica;
3085    /// # tokio_test::block_on(async {
3086    ///
3087    /// let builder = prepare_request_builder();
3088    /// let response = builder.send().await?;
3089    /// # gax::Result::<()>::Ok(()) });
3090    ///
3091    /// fn prepare_request_builder() -> StartReplica {
3092    ///   # panic!();
3093    ///   // ... details omitted ...
3094    /// }
3095    /// ```
3096    #[derive(Clone, Debug)]
3097    pub struct StartReplica(RequestBuilder<crate::model::SqlInstancesStartReplicaRequest>);
3098
3099    impl StartReplica {
3100        pub(crate) fn new(
3101            stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlInstancesService>,
3102        ) -> Self {
3103            Self(RequestBuilder::new(stub))
3104        }
3105
3106        /// Sets the full request, replacing any prior values.
3107        pub fn with_request<V: Into<crate::model::SqlInstancesStartReplicaRequest>>(
3108            mut self,
3109            v: V,
3110        ) -> Self {
3111            self.0.request = v.into();
3112            self
3113        }
3114
3115        /// Sets all the options, replacing any prior values.
3116        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
3117            self.0.options = v.into();
3118            self
3119        }
3120
3121        /// Sends the request.
3122        pub async fn send(self) -> Result<crate::model::Operation> {
3123            (*self.0.stub)
3124                .start_replica(self.0.request, self.0.options)
3125                .await
3126                .map(gax::response::Response::into_body)
3127        }
3128
3129        /// Sets the value of [instance][crate::model::SqlInstancesStartReplicaRequest::instance].
3130        pub fn set_instance<T: Into<std::string::String>>(mut self, v: T) -> Self {
3131            self.0.request.instance = v.into();
3132            self
3133        }
3134
3135        /// Sets the value of [project][crate::model::SqlInstancesStartReplicaRequest::project].
3136        pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
3137            self.0.request.project = v.into();
3138            self
3139        }
3140    }
3141
3142    #[doc(hidden)]
3143    impl gax::options::internal::RequestBuilder for StartReplica {
3144        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
3145            &mut self.0.options
3146        }
3147    }
3148
3149    /// The request builder for [SqlInstancesService::stop_replica][crate::client::SqlInstancesService::stop_replica] calls.
3150    ///
3151    /// # Example
3152    /// ```no_run
3153    /// # use google_cloud_sql_v1::builder;
3154    /// use builder::sql_instances_service::StopReplica;
3155    /// # tokio_test::block_on(async {
3156    ///
3157    /// let builder = prepare_request_builder();
3158    /// let response = builder.send().await?;
3159    /// # gax::Result::<()>::Ok(()) });
3160    ///
3161    /// fn prepare_request_builder() -> StopReplica {
3162    ///   # panic!();
3163    ///   // ... details omitted ...
3164    /// }
3165    /// ```
3166    #[derive(Clone, Debug)]
3167    pub struct StopReplica(RequestBuilder<crate::model::SqlInstancesStopReplicaRequest>);
3168
3169    impl StopReplica {
3170        pub(crate) fn new(
3171            stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlInstancesService>,
3172        ) -> Self {
3173            Self(RequestBuilder::new(stub))
3174        }
3175
3176        /// Sets the full request, replacing any prior values.
3177        pub fn with_request<V: Into<crate::model::SqlInstancesStopReplicaRequest>>(
3178            mut self,
3179            v: V,
3180        ) -> Self {
3181            self.0.request = v.into();
3182            self
3183        }
3184
3185        /// Sets all the options, replacing any prior values.
3186        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
3187            self.0.options = v.into();
3188            self
3189        }
3190
3191        /// Sends the request.
3192        pub async fn send(self) -> Result<crate::model::Operation> {
3193            (*self.0.stub)
3194                .stop_replica(self.0.request, self.0.options)
3195                .await
3196                .map(gax::response::Response::into_body)
3197        }
3198
3199        /// Sets the value of [instance][crate::model::SqlInstancesStopReplicaRequest::instance].
3200        pub fn set_instance<T: Into<std::string::String>>(mut self, v: T) -> Self {
3201            self.0.request.instance = v.into();
3202            self
3203        }
3204
3205        /// Sets the value of [project][crate::model::SqlInstancesStopReplicaRequest::project].
3206        pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
3207            self.0.request.project = v.into();
3208            self
3209        }
3210    }
3211
3212    #[doc(hidden)]
3213    impl gax::options::internal::RequestBuilder for StopReplica {
3214        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
3215            &mut self.0.options
3216        }
3217    }
3218
3219    /// The request builder for [SqlInstancesService::truncate_log][crate::client::SqlInstancesService::truncate_log] calls.
3220    ///
3221    /// # Example
3222    /// ```no_run
3223    /// # use google_cloud_sql_v1::builder;
3224    /// use builder::sql_instances_service::TruncateLog;
3225    /// # tokio_test::block_on(async {
3226    ///
3227    /// let builder = prepare_request_builder();
3228    /// let response = builder.send().await?;
3229    /// # gax::Result::<()>::Ok(()) });
3230    ///
3231    /// fn prepare_request_builder() -> TruncateLog {
3232    ///   # panic!();
3233    ///   // ... details omitted ...
3234    /// }
3235    /// ```
3236    #[derive(Clone, Debug)]
3237    pub struct TruncateLog(RequestBuilder<crate::model::SqlInstancesTruncateLogRequest>);
3238
3239    impl TruncateLog {
3240        pub(crate) fn new(
3241            stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlInstancesService>,
3242        ) -> Self {
3243            Self(RequestBuilder::new(stub))
3244        }
3245
3246        /// Sets the full request, replacing any prior values.
3247        pub fn with_request<V: Into<crate::model::SqlInstancesTruncateLogRequest>>(
3248            mut self,
3249            v: V,
3250        ) -> Self {
3251            self.0.request = v.into();
3252            self
3253        }
3254
3255        /// Sets all the options, replacing any prior values.
3256        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
3257            self.0.options = v.into();
3258            self
3259        }
3260
3261        /// Sends the request.
3262        pub async fn send(self) -> Result<crate::model::Operation> {
3263            (*self.0.stub)
3264                .truncate_log(self.0.request, self.0.options)
3265                .await
3266                .map(gax::response::Response::into_body)
3267        }
3268
3269        /// Sets the value of [instance][crate::model::SqlInstancesTruncateLogRequest::instance].
3270        pub fn set_instance<T: Into<std::string::String>>(mut self, v: T) -> Self {
3271            self.0.request.instance = v.into();
3272            self
3273        }
3274
3275        /// Sets the value of [project][crate::model::SqlInstancesTruncateLogRequest::project].
3276        pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
3277            self.0.request.project = v.into();
3278            self
3279        }
3280
3281        /// Sets the value of [body][crate::model::SqlInstancesTruncateLogRequest::body].
3282        pub fn set_body<T>(mut self, v: T) -> Self
3283        where
3284            T: std::convert::Into<crate::model::InstancesTruncateLogRequest>,
3285        {
3286            self.0.request.body = std::option::Option::Some(v.into());
3287            self
3288        }
3289
3290        /// Sets or clears the value of [body][crate::model::SqlInstancesTruncateLogRequest::body].
3291        pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
3292        where
3293            T: std::convert::Into<crate::model::InstancesTruncateLogRequest>,
3294        {
3295            self.0.request.body = v.map(|x| x.into());
3296            self
3297        }
3298    }
3299
3300    #[doc(hidden)]
3301    impl gax::options::internal::RequestBuilder for TruncateLog {
3302        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
3303            &mut self.0.options
3304        }
3305    }
3306
3307    /// The request builder for [SqlInstancesService::update][crate::client::SqlInstancesService::update] calls.
3308    ///
3309    /// # Example
3310    /// ```no_run
3311    /// # use google_cloud_sql_v1::builder;
3312    /// use builder::sql_instances_service::Update;
3313    /// # tokio_test::block_on(async {
3314    ///
3315    /// let builder = prepare_request_builder();
3316    /// let response = builder.send().await?;
3317    /// # gax::Result::<()>::Ok(()) });
3318    ///
3319    /// fn prepare_request_builder() -> Update {
3320    ///   # panic!();
3321    ///   // ... details omitted ...
3322    /// }
3323    /// ```
3324    #[derive(Clone, Debug)]
3325    pub struct Update(RequestBuilder<crate::model::SqlInstancesUpdateRequest>);
3326
3327    impl Update {
3328        pub(crate) fn new(
3329            stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlInstancesService>,
3330        ) -> Self {
3331            Self(RequestBuilder::new(stub))
3332        }
3333
3334        /// Sets the full request, replacing any prior values.
3335        pub fn with_request<V: Into<crate::model::SqlInstancesUpdateRequest>>(
3336            mut self,
3337            v: V,
3338        ) -> Self {
3339            self.0.request = v.into();
3340            self
3341        }
3342
3343        /// Sets all the options, replacing any prior values.
3344        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
3345            self.0.options = v.into();
3346            self
3347        }
3348
3349        /// Sends the request.
3350        pub async fn send(self) -> Result<crate::model::Operation> {
3351            (*self.0.stub)
3352                .update(self.0.request, self.0.options)
3353                .await
3354                .map(gax::response::Response::into_body)
3355        }
3356
3357        /// Sets the value of [instance][crate::model::SqlInstancesUpdateRequest::instance].
3358        pub fn set_instance<T: Into<std::string::String>>(mut self, v: T) -> Self {
3359            self.0.request.instance = v.into();
3360            self
3361        }
3362
3363        /// Sets the value of [project][crate::model::SqlInstancesUpdateRequest::project].
3364        pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
3365            self.0.request.project = v.into();
3366            self
3367        }
3368
3369        /// Sets the value of [body][crate::model::SqlInstancesUpdateRequest::body].
3370        pub fn set_body<T>(mut self, v: T) -> Self
3371        where
3372            T: std::convert::Into<crate::model::DatabaseInstance>,
3373        {
3374            self.0.request.body = std::option::Option::Some(v.into());
3375            self
3376        }
3377
3378        /// Sets or clears the value of [body][crate::model::SqlInstancesUpdateRequest::body].
3379        pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
3380        where
3381            T: std::convert::Into<crate::model::DatabaseInstance>,
3382        {
3383            self.0.request.body = v.map(|x| x.into());
3384            self
3385        }
3386    }
3387
3388    #[doc(hidden)]
3389    impl gax::options::internal::RequestBuilder for Update {
3390        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
3391            &mut self.0.options
3392        }
3393    }
3394
3395    /// The request builder for [SqlInstancesService::create_ephemeral][crate::client::SqlInstancesService::create_ephemeral] calls.
3396    ///
3397    /// # Example
3398    /// ```no_run
3399    /// # use google_cloud_sql_v1::builder;
3400    /// use builder::sql_instances_service::CreateEphemeral;
3401    /// # tokio_test::block_on(async {
3402    ///
3403    /// let builder = prepare_request_builder();
3404    /// let response = builder.send().await?;
3405    /// # gax::Result::<()>::Ok(()) });
3406    ///
3407    /// fn prepare_request_builder() -> CreateEphemeral {
3408    ///   # panic!();
3409    ///   // ... details omitted ...
3410    /// }
3411    /// ```
3412    #[derive(Clone, Debug)]
3413    pub struct CreateEphemeral(
3414        RequestBuilder<crate::model::SqlInstancesCreateEphemeralCertRequest>,
3415    );
3416
3417    impl CreateEphemeral {
3418        pub(crate) fn new(
3419            stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlInstancesService>,
3420        ) -> Self {
3421            Self(RequestBuilder::new(stub))
3422        }
3423
3424        /// Sets the full request, replacing any prior values.
3425        pub fn with_request<V: Into<crate::model::SqlInstancesCreateEphemeralCertRequest>>(
3426            mut self,
3427            v: V,
3428        ) -> Self {
3429            self.0.request = v.into();
3430            self
3431        }
3432
3433        /// Sets all the options, replacing any prior values.
3434        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
3435            self.0.options = v.into();
3436            self
3437        }
3438
3439        /// Sends the request.
3440        pub async fn send(self) -> Result<crate::model::SslCert> {
3441            (*self.0.stub)
3442                .create_ephemeral(self.0.request, self.0.options)
3443                .await
3444                .map(gax::response::Response::into_body)
3445        }
3446
3447        /// Sets the value of [instance][crate::model::SqlInstancesCreateEphemeralCertRequest::instance].
3448        pub fn set_instance<T: Into<std::string::String>>(mut self, v: T) -> Self {
3449            self.0.request.instance = v.into();
3450            self
3451        }
3452
3453        /// Sets the value of [project][crate::model::SqlInstancesCreateEphemeralCertRequest::project].
3454        pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
3455            self.0.request.project = v.into();
3456            self
3457        }
3458
3459        /// Sets the value of [body][crate::model::SqlInstancesCreateEphemeralCertRequest::body].
3460        pub fn set_body<T>(mut self, v: T) -> Self
3461        where
3462            T: std::convert::Into<crate::model::SslCertsCreateEphemeralRequest>,
3463        {
3464            self.0.request.body = std::option::Option::Some(v.into());
3465            self
3466        }
3467
3468        /// Sets or clears the value of [body][crate::model::SqlInstancesCreateEphemeralCertRequest::body].
3469        pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
3470        where
3471            T: std::convert::Into<crate::model::SslCertsCreateEphemeralRequest>,
3472        {
3473            self.0.request.body = v.map(|x| x.into());
3474            self
3475        }
3476    }
3477
3478    #[doc(hidden)]
3479    impl gax::options::internal::RequestBuilder for CreateEphemeral {
3480        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
3481            &mut self.0.options
3482        }
3483    }
3484
3485    /// The request builder for [SqlInstancesService::reschedule_maintenance][crate::client::SqlInstancesService::reschedule_maintenance] calls.
3486    ///
3487    /// # Example
3488    /// ```no_run
3489    /// # use google_cloud_sql_v1::builder;
3490    /// use builder::sql_instances_service::RescheduleMaintenance;
3491    /// # tokio_test::block_on(async {
3492    ///
3493    /// let builder = prepare_request_builder();
3494    /// let response = builder.send().await?;
3495    /// # gax::Result::<()>::Ok(()) });
3496    ///
3497    /// fn prepare_request_builder() -> RescheduleMaintenance {
3498    ///   # panic!();
3499    ///   // ... details omitted ...
3500    /// }
3501    /// ```
3502    #[derive(Clone, Debug)]
3503    pub struct RescheduleMaintenance(
3504        RequestBuilder<crate::model::SqlInstancesRescheduleMaintenanceRequest>,
3505    );
3506
3507    impl RescheduleMaintenance {
3508        pub(crate) fn new(
3509            stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlInstancesService>,
3510        ) -> Self {
3511            Self(RequestBuilder::new(stub))
3512        }
3513
3514        /// Sets the full request, replacing any prior values.
3515        pub fn with_request<V: Into<crate::model::SqlInstancesRescheduleMaintenanceRequest>>(
3516            mut self,
3517            v: V,
3518        ) -> Self {
3519            self.0.request = v.into();
3520            self
3521        }
3522
3523        /// Sets all the options, replacing any prior values.
3524        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
3525            self.0.options = v.into();
3526            self
3527        }
3528
3529        /// Sends the request.
3530        pub async fn send(self) -> Result<crate::model::Operation> {
3531            (*self.0.stub)
3532                .reschedule_maintenance(self.0.request, self.0.options)
3533                .await
3534                .map(gax::response::Response::into_body)
3535        }
3536
3537        /// Sets the value of [instance][crate::model::SqlInstancesRescheduleMaintenanceRequest::instance].
3538        pub fn set_instance<T: Into<std::string::String>>(mut self, v: T) -> Self {
3539            self.0.request.instance = v.into();
3540            self
3541        }
3542
3543        /// Sets the value of [project][crate::model::SqlInstancesRescheduleMaintenanceRequest::project].
3544        pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
3545            self.0.request.project = v.into();
3546            self
3547        }
3548
3549        /// Sets the value of [body][crate::model::SqlInstancesRescheduleMaintenanceRequest::body].
3550        pub fn set_body<T>(mut self, v: T) -> Self
3551        where
3552            T: std::convert::Into<crate::model::SqlInstancesRescheduleMaintenanceRequestBody>,
3553        {
3554            self.0.request.body = std::option::Option::Some(v.into());
3555            self
3556        }
3557
3558        /// Sets or clears the value of [body][crate::model::SqlInstancesRescheduleMaintenanceRequest::body].
3559        pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
3560        where
3561            T: std::convert::Into<crate::model::SqlInstancesRescheduleMaintenanceRequestBody>,
3562        {
3563            self.0.request.body = v.map(|x| x.into());
3564            self
3565        }
3566    }
3567
3568    #[doc(hidden)]
3569    impl gax::options::internal::RequestBuilder for RescheduleMaintenance {
3570        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
3571            &mut self.0.options
3572        }
3573    }
3574
3575    /// The request builder for [SqlInstancesService::verify_external_sync_settings][crate::client::SqlInstancesService::verify_external_sync_settings] calls.
3576    ///
3577    /// # Example
3578    /// ```no_run
3579    /// # use google_cloud_sql_v1::builder;
3580    /// use builder::sql_instances_service::VerifyExternalSyncSettings;
3581    /// # tokio_test::block_on(async {
3582    ///
3583    /// let builder = prepare_request_builder();
3584    /// let response = builder.send().await?;
3585    /// # gax::Result::<()>::Ok(()) });
3586    ///
3587    /// fn prepare_request_builder() -> VerifyExternalSyncSettings {
3588    ///   # panic!();
3589    ///   // ... details omitted ...
3590    /// }
3591    /// ```
3592    #[derive(Clone, Debug)]
3593    pub struct VerifyExternalSyncSettings(
3594        RequestBuilder<crate::model::SqlInstancesVerifyExternalSyncSettingsRequest>,
3595    );
3596
3597    impl VerifyExternalSyncSettings {
3598        pub(crate) fn new(
3599            stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlInstancesService>,
3600        ) -> Self {
3601            Self(RequestBuilder::new(stub))
3602        }
3603
3604        /// Sets the full request, replacing any prior values.
3605        pub fn with_request<
3606            V: Into<crate::model::SqlInstancesVerifyExternalSyncSettingsRequest>,
3607        >(
3608            mut self,
3609            v: V,
3610        ) -> Self {
3611            self.0.request = v.into();
3612            self
3613        }
3614
3615        /// Sets all the options, replacing any prior values.
3616        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
3617            self.0.options = v.into();
3618            self
3619        }
3620
3621        /// Sends the request.
3622        pub async fn send(
3623            self,
3624        ) -> Result<crate::model::SqlInstancesVerifyExternalSyncSettingsResponse> {
3625            (*self.0.stub)
3626                .verify_external_sync_settings(self.0.request, self.0.options)
3627                .await
3628                .map(gax::response::Response::into_body)
3629        }
3630
3631        /// Sets the value of [instance][crate::model::SqlInstancesVerifyExternalSyncSettingsRequest::instance].
3632        pub fn set_instance<T: Into<std::string::String>>(mut self, v: T) -> Self {
3633            self.0.request.instance = v.into();
3634            self
3635        }
3636
3637        /// Sets the value of [project][crate::model::SqlInstancesVerifyExternalSyncSettingsRequest::project].
3638        pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
3639            self.0.request.project = v.into();
3640            self
3641        }
3642
3643        /// Sets the value of [verify_connection_only][crate::model::SqlInstancesVerifyExternalSyncSettingsRequest::verify_connection_only].
3644        pub fn set_verify_connection_only<T: Into<bool>>(mut self, v: T) -> Self {
3645            self.0.request.verify_connection_only = v.into();
3646            self
3647        }
3648
3649        /// Sets the value of [sync_mode][crate::model::SqlInstancesVerifyExternalSyncSettingsRequest::sync_mode].
3650        pub fn set_sync_mode<
3651            T: Into<
3652                crate::model::sql_instances_verify_external_sync_settings_request::ExternalSyncMode,
3653            >,
3654        >(
3655            mut self,
3656            v: T,
3657        ) -> Self {
3658            self.0.request.sync_mode = v.into();
3659            self
3660        }
3661
3662        /// Sets the value of [verify_replication_only][crate::model::SqlInstancesVerifyExternalSyncSettingsRequest::verify_replication_only].
3663        pub fn set_verify_replication_only<T: Into<bool>>(mut self, v: T) -> Self {
3664            self.0.request.verify_replication_only = v.into();
3665            self
3666        }
3667
3668        /// Sets the value of [migration_type][crate::model::SqlInstancesVerifyExternalSyncSettingsRequest::migration_type].
3669        pub fn set_migration_type<
3670            T: Into<crate::model::sql_instances_verify_external_sync_settings_request::MigrationType>,
3671        >(
3672            mut self,
3673            v: T,
3674        ) -> Self {
3675            self.0.request.migration_type = v.into();
3676            self
3677        }
3678
3679        /// Sets the value of [sync_parallel_level][crate::model::SqlInstancesVerifyExternalSyncSettingsRequest::sync_parallel_level].
3680        pub fn set_sync_parallel_level<T: Into<crate::model::ExternalSyncParallelLevel>>(
3681            mut self,
3682            v: T,
3683        ) -> Self {
3684            self.0.request.sync_parallel_level = v.into();
3685            self
3686        }
3687
3688        /// Sets the value of [sync_config][crate::model::SqlInstancesVerifyExternalSyncSettingsRequest::sync_config].
3689        ///
3690        /// Note that all the setters affecting `sync_config` are
3691        /// mutually exclusive.
3692        pub fn set_sync_config<
3693            T: Into<
3694                Option<
3695                    crate::model::sql_instances_verify_external_sync_settings_request::SyncConfig,
3696                >,
3697            >,
3698        >(
3699            mut self,
3700            v: T,
3701        ) -> Self {
3702            self.0.request.sync_config = v.into();
3703            self
3704        }
3705
3706        /// Sets the value of [sync_config][crate::model::SqlInstancesVerifyExternalSyncSettingsRequest::sync_config]
3707        /// to hold a `MysqlSyncConfig`.
3708        ///
3709        /// Note that all the setters affecting `sync_config` are
3710        /// mutually exclusive.
3711        pub fn set_mysql_sync_config<
3712            T: std::convert::Into<std::boxed::Box<crate::model::MySqlSyncConfig>>,
3713        >(
3714            mut self,
3715            v: T,
3716        ) -> Self {
3717            self.0.request = self.0.request.set_mysql_sync_config(v);
3718            self
3719        }
3720    }
3721
3722    #[doc(hidden)]
3723    impl gax::options::internal::RequestBuilder for VerifyExternalSyncSettings {
3724        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
3725            &mut self.0.options
3726        }
3727    }
3728
3729    /// The request builder for [SqlInstancesService::start_external_sync][crate::client::SqlInstancesService::start_external_sync] calls.
3730    ///
3731    /// # Example
3732    /// ```no_run
3733    /// # use google_cloud_sql_v1::builder;
3734    /// use builder::sql_instances_service::StartExternalSync;
3735    /// # tokio_test::block_on(async {
3736    ///
3737    /// let builder = prepare_request_builder();
3738    /// let response = builder.send().await?;
3739    /// # gax::Result::<()>::Ok(()) });
3740    ///
3741    /// fn prepare_request_builder() -> StartExternalSync {
3742    ///   # panic!();
3743    ///   // ... details omitted ...
3744    /// }
3745    /// ```
3746    #[derive(Clone, Debug)]
3747    pub struct StartExternalSync(
3748        RequestBuilder<crate::model::SqlInstancesStartExternalSyncRequest>,
3749    );
3750
3751    impl StartExternalSync {
3752        pub(crate) fn new(
3753            stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlInstancesService>,
3754        ) -> Self {
3755            Self(RequestBuilder::new(stub))
3756        }
3757
3758        /// Sets the full request, replacing any prior values.
3759        pub fn with_request<V: Into<crate::model::SqlInstancesStartExternalSyncRequest>>(
3760            mut self,
3761            v: V,
3762        ) -> Self {
3763            self.0.request = v.into();
3764            self
3765        }
3766
3767        /// Sets all the options, replacing any prior values.
3768        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
3769            self.0.options = v.into();
3770            self
3771        }
3772
3773        /// Sends the request.
3774        pub async fn send(self) -> Result<crate::model::Operation> {
3775            (*self.0.stub)
3776                .start_external_sync(self.0.request, self.0.options)
3777                .await
3778                .map(gax::response::Response::into_body)
3779        }
3780
3781        /// Sets the value of [instance][crate::model::SqlInstancesStartExternalSyncRequest::instance].
3782        pub fn set_instance<T: Into<std::string::String>>(mut self, v: T) -> Self {
3783            self.0.request.instance = v.into();
3784            self
3785        }
3786
3787        /// Sets the value of [project][crate::model::SqlInstancesStartExternalSyncRequest::project].
3788        pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
3789            self.0.request.project = v.into();
3790            self
3791        }
3792
3793        /// Sets the value of [sync_mode][crate::model::SqlInstancesStartExternalSyncRequest::sync_mode].
3794        pub fn set_sync_mode<
3795            T: Into<
3796                crate::model::sql_instances_verify_external_sync_settings_request::ExternalSyncMode,
3797            >,
3798        >(
3799            mut self,
3800            v: T,
3801        ) -> Self {
3802            self.0.request.sync_mode = v.into();
3803            self
3804        }
3805
3806        /// Sets the value of [skip_verification][crate::model::SqlInstancesStartExternalSyncRequest::skip_verification].
3807        pub fn set_skip_verification<T: Into<bool>>(mut self, v: T) -> Self {
3808            self.0.request.skip_verification = v.into();
3809            self
3810        }
3811
3812        /// Sets the value of [sync_parallel_level][crate::model::SqlInstancesStartExternalSyncRequest::sync_parallel_level].
3813        pub fn set_sync_parallel_level<T: Into<crate::model::ExternalSyncParallelLevel>>(
3814            mut self,
3815            v: T,
3816        ) -> Self {
3817            self.0.request.sync_parallel_level = v.into();
3818            self
3819        }
3820
3821        /// Sets the value of [migration_type][crate::model::SqlInstancesStartExternalSyncRequest::migration_type].
3822        pub fn set_migration_type<
3823            T: Into<crate::model::sql_instances_verify_external_sync_settings_request::MigrationType>,
3824        >(
3825            mut self,
3826            v: T,
3827        ) -> Self {
3828            self.0.request.migration_type = v.into();
3829            self
3830        }
3831
3832        /// Sets the value of [sync_config][crate::model::SqlInstancesStartExternalSyncRequest::sync_config].
3833        ///
3834        /// Note that all the setters affecting `sync_config` are
3835        /// mutually exclusive.
3836        pub fn set_sync_config<
3837            T: Into<Option<crate::model::sql_instances_start_external_sync_request::SyncConfig>>,
3838        >(
3839            mut self,
3840            v: T,
3841        ) -> Self {
3842            self.0.request.sync_config = v.into();
3843            self
3844        }
3845
3846        /// Sets the value of [sync_config][crate::model::SqlInstancesStartExternalSyncRequest::sync_config]
3847        /// to hold a `MysqlSyncConfig`.
3848        ///
3849        /// Note that all the setters affecting `sync_config` are
3850        /// mutually exclusive.
3851        pub fn set_mysql_sync_config<
3852            T: std::convert::Into<std::boxed::Box<crate::model::MySqlSyncConfig>>,
3853        >(
3854            mut self,
3855            v: T,
3856        ) -> Self {
3857            self.0.request = self.0.request.set_mysql_sync_config(v);
3858            self
3859        }
3860    }
3861
3862    #[doc(hidden)]
3863    impl gax::options::internal::RequestBuilder for StartExternalSync {
3864        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
3865            &mut self.0.options
3866        }
3867    }
3868
3869    /// The request builder for [SqlInstancesService::perform_disk_shrink][crate::client::SqlInstancesService::perform_disk_shrink] calls.
3870    ///
3871    /// # Example
3872    /// ```no_run
3873    /// # use google_cloud_sql_v1::builder;
3874    /// use builder::sql_instances_service::PerformDiskShrink;
3875    /// # tokio_test::block_on(async {
3876    ///
3877    /// let builder = prepare_request_builder();
3878    /// let response = builder.send().await?;
3879    /// # gax::Result::<()>::Ok(()) });
3880    ///
3881    /// fn prepare_request_builder() -> PerformDiskShrink {
3882    ///   # panic!();
3883    ///   // ... details omitted ...
3884    /// }
3885    /// ```
3886    #[derive(Clone, Debug)]
3887    pub struct PerformDiskShrink(
3888        RequestBuilder<crate::model::SqlInstancesPerformDiskShrinkRequest>,
3889    );
3890
3891    impl PerformDiskShrink {
3892        pub(crate) fn new(
3893            stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlInstancesService>,
3894        ) -> Self {
3895            Self(RequestBuilder::new(stub))
3896        }
3897
3898        /// Sets the full request, replacing any prior values.
3899        pub fn with_request<V: Into<crate::model::SqlInstancesPerformDiskShrinkRequest>>(
3900            mut self,
3901            v: V,
3902        ) -> Self {
3903            self.0.request = v.into();
3904            self
3905        }
3906
3907        /// Sets all the options, replacing any prior values.
3908        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
3909            self.0.options = v.into();
3910            self
3911        }
3912
3913        /// Sends the request.
3914        pub async fn send(self) -> Result<crate::model::Operation> {
3915            (*self.0.stub)
3916                .perform_disk_shrink(self.0.request, self.0.options)
3917                .await
3918                .map(gax::response::Response::into_body)
3919        }
3920
3921        /// Sets the value of [instance][crate::model::SqlInstancesPerformDiskShrinkRequest::instance].
3922        pub fn set_instance<T: Into<std::string::String>>(mut self, v: T) -> Self {
3923            self.0.request.instance = v.into();
3924            self
3925        }
3926
3927        /// Sets the value of [project][crate::model::SqlInstancesPerformDiskShrinkRequest::project].
3928        pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
3929            self.0.request.project = v.into();
3930            self
3931        }
3932
3933        /// Sets the value of [body][crate::model::SqlInstancesPerformDiskShrinkRequest::body].
3934        pub fn set_body<T>(mut self, v: T) -> Self
3935        where
3936            T: std::convert::Into<crate::model::PerformDiskShrinkContext>,
3937        {
3938            self.0.request.body = std::option::Option::Some(v.into());
3939            self
3940        }
3941
3942        /// Sets or clears the value of [body][crate::model::SqlInstancesPerformDiskShrinkRequest::body].
3943        pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
3944        where
3945            T: std::convert::Into<crate::model::PerformDiskShrinkContext>,
3946        {
3947            self.0.request.body = v.map(|x| x.into());
3948            self
3949        }
3950    }
3951
3952    #[doc(hidden)]
3953    impl gax::options::internal::RequestBuilder for PerformDiskShrink {
3954        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
3955            &mut self.0.options
3956        }
3957    }
3958
3959    /// The request builder for [SqlInstancesService::get_disk_shrink_config][crate::client::SqlInstancesService::get_disk_shrink_config] calls.
3960    ///
3961    /// # Example
3962    /// ```no_run
3963    /// # use google_cloud_sql_v1::builder;
3964    /// use builder::sql_instances_service::GetDiskShrinkConfig;
3965    /// # tokio_test::block_on(async {
3966    ///
3967    /// let builder = prepare_request_builder();
3968    /// let response = builder.send().await?;
3969    /// # gax::Result::<()>::Ok(()) });
3970    ///
3971    /// fn prepare_request_builder() -> GetDiskShrinkConfig {
3972    ///   # panic!();
3973    ///   // ... details omitted ...
3974    /// }
3975    /// ```
3976    #[derive(Clone, Debug)]
3977    pub struct GetDiskShrinkConfig(
3978        RequestBuilder<crate::model::SqlInstancesGetDiskShrinkConfigRequest>,
3979    );
3980
3981    impl GetDiskShrinkConfig {
3982        pub(crate) fn new(
3983            stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlInstancesService>,
3984        ) -> Self {
3985            Self(RequestBuilder::new(stub))
3986        }
3987
3988        /// Sets the full request, replacing any prior values.
3989        pub fn with_request<V: Into<crate::model::SqlInstancesGetDiskShrinkConfigRequest>>(
3990            mut self,
3991            v: V,
3992        ) -> Self {
3993            self.0.request = v.into();
3994            self
3995        }
3996
3997        /// Sets all the options, replacing any prior values.
3998        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
3999            self.0.options = v.into();
4000            self
4001        }
4002
4003        /// Sends the request.
4004        pub async fn send(self) -> Result<crate::model::SqlInstancesGetDiskShrinkConfigResponse> {
4005            (*self.0.stub)
4006                .get_disk_shrink_config(self.0.request, self.0.options)
4007                .await
4008                .map(gax::response::Response::into_body)
4009        }
4010
4011        /// Sets the value of [instance][crate::model::SqlInstancesGetDiskShrinkConfigRequest::instance].
4012        pub fn set_instance<T: Into<std::string::String>>(mut self, v: T) -> Self {
4013            self.0.request.instance = v.into();
4014            self
4015        }
4016
4017        /// Sets the value of [project][crate::model::SqlInstancesGetDiskShrinkConfigRequest::project].
4018        pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
4019            self.0.request.project = v.into();
4020            self
4021        }
4022    }
4023
4024    #[doc(hidden)]
4025    impl gax::options::internal::RequestBuilder for GetDiskShrinkConfig {
4026        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
4027            &mut self.0.options
4028        }
4029    }
4030
4031    /// The request builder for [SqlInstancesService::reset_replica_size][crate::client::SqlInstancesService::reset_replica_size] calls.
4032    ///
4033    /// # Example
4034    /// ```no_run
4035    /// # use google_cloud_sql_v1::builder;
4036    /// use builder::sql_instances_service::ResetReplicaSize;
4037    /// # tokio_test::block_on(async {
4038    ///
4039    /// let builder = prepare_request_builder();
4040    /// let response = builder.send().await?;
4041    /// # gax::Result::<()>::Ok(()) });
4042    ///
4043    /// fn prepare_request_builder() -> ResetReplicaSize {
4044    ///   # panic!();
4045    ///   // ... details omitted ...
4046    /// }
4047    /// ```
4048    #[derive(Clone, Debug)]
4049    pub struct ResetReplicaSize(RequestBuilder<crate::model::SqlInstancesResetReplicaSizeRequest>);
4050
4051    impl ResetReplicaSize {
4052        pub(crate) fn new(
4053            stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlInstancesService>,
4054        ) -> Self {
4055            Self(RequestBuilder::new(stub))
4056        }
4057
4058        /// Sets the full request, replacing any prior values.
4059        pub fn with_request<V: Into<crate::model::SqlInstancesResetReplicaSizeRequest>>(
4060            mut self,
4061            v: V,
4062        ) -> Self {
4063            self.0.request = v.into();
4064            self
4065        }
4066
4067        /// Sets all the options, replacing any prior values.
4068        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
4069            self.0.options = v.into();
4070            self
4071        }
4072
4073        /// Sends the request.
4074        pub async fn send(self) -> Result<crate::model::Operation> {
4075            (*self.0.stub)
4076                .reset_replica_size(self.0.request, self.0.options)
4077                .await
4078                .map(gax::response::Response::into_body)
4079        }
4080
4081        /// Sets the value of [instance][crate::model::SqlInstancesResetReplicaSizeRequest::instance].
4082        pub fn set_instance<T: Into<std::string::String>>(mut self, v: T) -> Self {
4083            self.0.request.instance = v.into();
4084            self
4085        }
4086
4087        /// Sets the value of [project][crate::model::SqlInstancesResetReplicaSizeRequest::project].
4088        pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
4089            self.0.request.project = v.into();
4090            self
4091        }
4092    }
4093
4094    #[doc(hidden)]
4095    impl gax::options::internal::RequestBuilder for ResetReplicaSize {
4096        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
4097            &mut self.0.options
4098        }
4099    }
4100
4101    /// The request builder for [SqlInstancesService::get_latest_recovery_time][crate::client::SqlInstancesService::get_latest_recovery_time] calls.
4102    ///
4103    /// # Example
4104    /// ```no_run
4105    /// # use google_cloud_sql_v1::builder;
4106    /// use builder::sql_instances_service::GetLatestRecoveryTime;
4107    /// # tokio_test::block_on(async {
4108    ///
4109    /// let builder = prepare_request_builder();
4110    /// let response = builder.send().await?;
4111    /// # gax::Result::<()>::Ok(()) });
4112    ///
4113    /// fn prepare_request_builder() -> GetLatestRecoveryTime {
4114    ///   # panic!();
4115    ///   // ... details omitted ...
4116    /// }
4117    /// ```
4118    #[derive(Clone, Debug)]
4119    pub struct GetLatestRecoveryTime(
4120        RequestBuilder<crate::model::SqlInstancesGetLatestRecoveryTimeRequest>,
4121    );
4122
4123    impl GetLatestRecoveryTime {
4124        pub(crate) fn new(
4125            stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlInstancesService>,
4126        ) -> Self {
4127            Self(RequestBuilder::new(stub))
4128        }
4129
4130        /// Sets the full request, replacing any prior values.
4131        pub fn with_request<V: Into<crate::model::SqlInstancesGetLatestRecoveryTimeRequest>>(
4132            mut self,
4133            v: V,
4134        ) -> Self {
4135            self.0.request = v.into();
4136            self
4137        }
4138
4139        /// Sets all the options, replacing any prior values.
4140        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
4141            self.0.options = v.into();
4142            self
4143        }
4144
4145        /// Sends the request.
4146        pub async fn send(self) -> Result<crate::model::SqlInstancesGetLatestRecoveryTimeResponse> {
4147            (*self.0.stub)
4148                .get_latest_recovery_time(self.0.request, self.0.options)
4149                .await
4150                .map(gax::response::Response::into_body)
4151        }
4152
4153        /// Sets the value of [instance][crate::model::SqlInstancesGetLatestRecoveryTimeRequest::instance].
4154        pub fn set_instance<T: Into<std::string::String>>(mut self, v: T) -> Self {
4155            self.0.request.instance = v.into();
4156            self
4157        }
4158
4159        /// Sets the value of [project][crate::model::SqlInstancesGetLatestRecoveryTimeRequest::project].
4160        pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
4161            self.0.request.project = v.into();
4162            self
4163        }
4164    }
4165
4166    #[doc(hidden)]
4167    impl gax::options::internal::RequestBuilder for GetLatestRecoveryTime {
4168        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
4169            &mut self.0.options
4170        }
4171    }
4172
4173    /// The request builder for [SqlInstancesService::acquire_ssrs_lease][crate::client::SqlInstancesService::acquire_ssrs_lease] calls.
4174    ///
4175    /// # Example
4176    /// ```no_run
4177    /// # use google_cloud_sql_v1::builder;
4178    /// use builder::sql_instances_service::AcquireSsrsLease;
4179    /// # tokio_test::block_on(async {
4180    ///
4181    /// let builder = prepare_request_builder();
4182    /// let response = builder.send().await?;
4183    /// # gax::Result::<()>::Ok(()) });
4184    ///
4185    /// fn prepare_request_builder() -> AcquireSsrsLease {
4186    ///   # panic!();
4187    ///   // ... details omitted ...
4188    /// }
4189    /// ```
4190    #[derive(Clone, Debug)]
4191    pub struct AcquireSsrsLease(RequestBuilder<crate::model::SqlInstancesAcquireSsrsLeaseRequest>);
4192
4193    impl AcquireSsrsLease {
4194        pub(crate) fn new(
4195            stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlInstancesService>,
4196        ) -> Self {
4197            Self(RequestBuilder::new(stub))
4198        }
4199
4200        /// Sets the full request, replacing any prior values.
4201        pub fn with_request<V: Into<crate::model::SqlInstancesAcquireSsrsLeaseRequest>>(
4202            mut self,
4203            v: V,
4204        ) -> Self {
4205            self.0.request = v.into();
4206            self
4207        }
4208
4209        /// Sets all the options, replacing any prior values.
4210        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
4211            self.0.options = v.into();
4212            self
4213        }
4214
4215        /// Sends the request.
4216        pub async fn send(self) -> Result<crate::model::SqlInstancesAcquireSsrsLeaseResponse> {
4217            (*self.0.stub)
4218                .acquire_ssrs_lease(self.0.request, self.0.options)
4219                .await
4220                .map(gax::response::Response::into_body)
4221        }
4222
4223        /// Sets the value of [instance][crate::model::SqlInstancesAcquireSsrsLeaseRequest::instance].
4224        ///
4225        /// This is a **required** field for requests.
4226        pub fn set_instance<T: Into<std::string::String>>(mut self, v: T) -> Self {
4227            self.0.request.instance = v.into();
4228            self
4229        }
4230
4231        /// Sets the value of [project][crate::model::SqlInstancesAcquireSsrsLeaseRequest::project].
4232        ///
4233        /// This is a **required** field for requests.
4234        pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
4235            self.0.request.project = v.into();
4236            self
4237        }
4238
4239        /// Sets the value of [body][crate::model::SqlInstancesAcquireSsrsLeaseRequest::body].
4240        ///
4241        /// This is a **required** field for requests.
4242        pub fn set_body<T>(mut self, v: T) -> Self
4243        where
4244            T: std::convert::Into<crate::model::InstancesAcquireSsrsLeaseRequest>,
4245        {
4246            self.0.request.body = std::option::Option::Some(v.into());
4247            self
4248        }
4249
4250        /// Sets or clears the value of [body][crate::model::SqlInstancesAcquireSsrsLeaseRequest::body].
4251        ///
4252        /// This is a **required** field for requests.
4253        pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
4254        where
4255            T: std::convert::Into<crate::model::InstancesAcquireSsrsLeaseRequest>,
4256        {
4257            self.0.request.body = v.map(|x| x.into());
4258            self
4259        }
4260    }
4261
4262    #[doc(hidden)]
4263    impl gax::options::internal::RequestBuilder for AcquireSsrsLease {
4264        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
4265            &mut self.0.options
4266        }
4267    }
4268
4269    /// The request builder for [SqlInstancesService::release_ssrs_lease][crate::client::SqlInstancesService::release_ssrs_lease] calls.
4270    ///
4271    /// # Example
4272    /// ```no_run
4273    /// # use google_cloud_sql_v1::builder;
4274    /// use builder::sql_instances_service::ReleaseSsrsLease;
4275    /// # tokio_test::block_on(async {
4276    ///
4277    /// let builder = prepare_request_builder();
4278    /// let response = builder.send().await?;
4279    /// # gax::Result::<()>::Ok(()) });
4280    ///
4281    /// fn prepare_request_builder() -> ReleaseSsrsLease {
4282    ///   # panic!();
4283    ///   // ... details omitted ...
4284    /// }
4285    /// ```
4286    #[derive(Clone, Debug)]
4287    pub struct ReleaseSsrsLease(RequestBuilder<crate::model::SqlInstancesReleaseSsrsLeaseRequest>);
4288
4289    impl ReleaseSsrsLease {
4290        pub(crate) fn new(
4291            stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlInstancesService>,
4292        ) -> Self {
4293            Self(RequestBuilder::new(stub))
4294        }
4295
4296        /// Sets the full request, replacing any prior values.
4297        pub fn with_request<V: Into<crate::model::SqlInstancesReleaseSsrsLeaseRequest>>(
4298            mut self,
4299            v: V,
4300        ) -> Self {
4301            self.0.request = v.into();
4302            self
4303        }
4304
4305        /// Sets all the options, replacing any prior values.
4306        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
4307            self.0.options = v.into();
4308            self
4309        }
4310
4311        /// Sends the request.
4312        pub async fn send(self) -> Result<crate::model::SqlInstancesReleaseSsrsLeaseResponse> {
4313            (*self.0.stub)
4314                .release_ssrs_lease(self.0.request, self.0.options)
4315                .await
4316                .map(gax::response::Response::into_body)
4317        }
4318
4319        /// Sets the value of [instance][crate::model::SqlInstancesReleaseSsrsLeaseRequest::instance].
4320        ///
4321        /// This is a **required** field for requests.
4322        pub fn set_instance<T: Into<std::string::String>>(mut self, v: T) -> Self {
4323            self.0.request.instance = v.into();
4324            self
4325        }
4326
4327        /// Sets the value of [project][crate::model::SqlInstancesReleaseSsrsLeaseRequest::project].
4328        ///
4329        /// This is a **required** field for requests.
4330        pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
4331            self.0.request.project = v.into();
4332            self
4333        }
4334    }
4335
4336    #[doc(hidden)]
4337    impl gax::options::internal::RequestBuilder for ReleaseSsrsLease {
4338        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
4339            &mut self.0.options
4340        }
4341    }
4342}
4343
4344pub mod sql_operations_service {
4345    use crate::Result;
4346
4347    /// A builder for [SqlOperationsService][crate::client::SqlOperationsService].
4348    ///
4349    /// ```
4350    /// # tokio_test::block_on(async {
4351    /// # use google_cloud_sql_v1::*;
4352    /// # use builder::sql_operations_service::ClientBuilder;
4353    /// # use client::SqlOperationsService;
4354    /// let builder : ClientBuilder = SqlOperationsService::builder();
4355    /// let client = builder
4356    ///     .with_endpoint("https://sqladmin.googleapis.com")
4357    ///     .build().await?;
4358    /// # gax::client_builder::Result::<()>::Ok(()) });
4359    /// ```
4360    pub type ClientBuilder =
4361        gax::client_builder::ClientBuilder<client::Factory, gaxi::options::Credentials>;
4362
4363    pub(crate) mod client {
4364        use super::super::super::client::SqlOperationsService;
4365        pub struct Factory;
4366        impl gax::client_builder::internal::ClientFactory for Factory {
4367            type Client = SqlOperationsService;
4368            type Credentials = gaxi::options::Credentials;
4369            async fn build(
4370                self,
4371                config: gaxi::options::ClientConfig,
4372            ) -> gax::client_builder::Result<Self::Client> {
4373                Self::Client::new(config).await
4374            }
4375        }
4376    }
4377
4378    /// Common implementation for [crate::client::SqlOperationsService] request builders.
4379    #[derive(Clone, Debug)]
4380    pub(crate) struct RequestBuilder<R: std::default::Default> {
4381        stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlOperationsService>,
4382        request: R,
4383        options: gax::options::RequestOptions,
4384    }
4385
4386    impl<R> RequestBuilder<R>
4387    where
4388        R: std::default::Default,
4389    {
4390        pub(crate) fn new(
4391            stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlOperationsService>,
4392        ) -> Self {
4393            Self {
4394                stub,
4395                request: R::default(),
4396                options: gax::options::RequestOptions::default(),
4397            }
4398        }
4399    }
4400
4401    /// The request builder for [SqlOperationsService::get][crate::client::SqlOperationsService::get] calls.
4402    ///
4403    /// # Example
4404    /// ```no_run
4405    /// # use google_cloud_sql_v1::builder;
4406    /// use builder::sql_operations_service::Get;
4407    /// # tokio_test::block_on(async {
4408    ///
4409    /// let builder = prepare_request_builder();
4410    /// let response = builder.send().await?;
4411    /// # gax::Result::<()>::Ok(()) });
4412    ///
4413    /// fn prepare_request_builder() -> Get {
4414    ///   # panic!();
4415    ///   // ... details omitted ...
4416    /// }
4417    /// ```
4418    #[derive(Clone, Debug)]
4419    pub struct Get(RequestBuilder<crate::model::SqlOperationsGetRequest>);
4420
4421    impl Get {
4422        pub(crate) fn new(
4423            stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlOperationsService>,
4424        ) -> Self {
4425            Self(RequestBuilder::new(stub))
4426        }
4427
4428        /// Sets the full request, replacing any prior values.
4429        pub fn with_request<V: Into<crate::model::SqlOperationsGetRequest>>(
4430            mut self,
4431            v: V,
4432        ) -> Self {
4433            self.0.request = v.into();
4434            self
4435        }
4436
4437        /// Sets all the options, replacing any prior values.
4438        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
4439            self.0.options = v.into();
4440            self
4441        }
4442
4443        /// Sends the request.
4444        pub async fn send(self) -> Result<crate::model::Operation> {
4445            (*self.0.stub)
4446                .get(self.0.request, self.0.options)
4447                .await
4448                .map(gax::response::Response::into_body)
4449        }
4450
4451        /// Sets the value of [operation][crate::model::SqlOperationsGetRequest::operation].
4452        pub fn set_operation<T: Into<std::string::String>>(mut self, v: T) -> Self {
4453            self.0.request.operation = v.into();
4454            self
4455        }
4456
4457        /// Sets the value of [project][crate::model::SqlOperationsGetRequest::project].
4458        pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
4459            self.0.request.project = v.into();
4460            self
4461        }
4462    }
4463
4464    #[doc(hidden)]
4465    impl gax::options::internal::RequestBuilder for Get {
4466        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
4467            &mut self.0.options
4468        }
4469    }
4470
4471    /// The request builder for [SqlOperationsService::list][crate::client::SqlOperationsService::list] calls.
4472    ///
4473    /// # Example
4474    /// ```no_run
4475    /// # use google_cloud_sql_v1::builder;
4476    /// use builder::sql_operations_service::List;
4477    /// # tokio_test::block_on(async {
4478    /// use gax::paginator::ItemPaginator;
4479    ///
4480    /// let builder = prepare_request_builder();
4481    /// let mut items = builder.by_item();
4482    /// while let Some(result) = items.next().await {
4483    ///   let item = result?;
4484    /// }
4485    /// # gax::Result::<()>::Ok(()) });
4486    ///
4487    /// fn prepare_request_builder() -> List {
4488    ///   # panic!();
4489    ///   // ... details omitted ...
4490    /// }
4491    /// ```
4492    #[derive(Clone, Debug)]
4493    pub struct List(RequestBuilder<crate::model::SqlOperationsListRequest>);
4494
4495    impl List {
4496        pub(crate) fn new(
4497            stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlOperationsService>,
4498        ) -> Self {
4499            Self(RequestBuilder::new(stub))
4500        }
4501
4502        /// Sets the full request, replacing any prior values.
4503        pub fn with_request<V: Into<crate::model::SqlOperationsListRequest>>(
4504            mut self,
4505            v: V,
4506        ) -> Self {
4507            self.0.request = v.into();
4508            self
4509        }
4510
4511        /// Sets all the options, replacing any prior values.
4512        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
4513            self.0.options = v.into();
4514            self
4515        }
4516
4517        /// Sends the request.
4518        pub async fn send(self) -> Result<crate::model::OperationsListResponse> {
4519            (*self.0.stub)
4520                .list(self.0.request, self.0.options)
4521                .await
4522                .map(gax::response::Response::into_body)
4523        }
4524
4525        /// Streams each page in the collection.
4526        pub fn by_page(
4527            self,
4528        ) -> impl gax::paginator::Paginator<crate::model::OperationsListResponse, gax::error::Error>
4529        {
4530            use std::clone::Clone;
4531            let token = self.0.request.page_token.clone();
4532            let execute = move |token: String| {
4533                let mut builder = self.clone();
4534                builder.0.request = builder.0.request.set_page_token(token);
4535                builder.send()
4536            };
4537            gax::paginator::internal::new_paginator(token, execute)
4538        }
4539
4540        /// Streams each item in the collection.
4541        pub fn by_item(
4542            self,
4543        ) -> impl gax::paginator::ItemPaginator<crate::model::OperationsListResponse, gax::error::Error>
4544        {
4545            use gax::paginator::Paginator;
4546            self.by_page().items()
4547        }
4548
4549        /// Sets the value of [instance][crate::model::SqlOperationsListRequest::instance].
4550        pub fn set_instance<T: Into<std::string::String>>(mut self, v: T) -> Self {
4551            self.0.request.instance = v.into();
4552            self
4553        }
4554
4555        /// Sets the value of [max_results][crate::model::SqlOperationsListRequest::max_results].
4556        pub fn set_max_results<T: Into<u32>>(mut self, v: T) -> Self {
4557            self.0.request.max_results = v.into();
4558            self
4559        }
4560
4561        /// Sets the value of [page_token][crate::model::SqlOperationsListRequest::page_token].
4562        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
4563            self.0.request.page_token = v.into();
4564            self
4565        }
4566
4567        /// Sets the value of [project][crate::model::SqlOperationsListRequest::project].
4568        pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
4569            self.0.request.project = v.into();
4570            self
4571        }
4572    }
4573
4574    #[doc(hidden)]
4575    impl gax::options::internal::RequestBuilder for List {
4576        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
4577            &mut self.0.options
4578        }
4579    }
4580
4581    /// The request builder for [SqlOperationsService::cancel][crate::client::SqlOperationsService::cancel] calls.
4582    ///
4583    /// # Example
4584    /// ```no_run
4585    /// # use google_cloud_sql_v1::builder;
4586    /// use builder::sql_operations_service::Cancel;
4587    /// # tokio_test::block_on(async {
4588    ///
4589    /// let builder = prepare_request_builder();
4590    /// let response = builder.send().await?;
4591    /// # gax::Result::<()>::Ok(()) });
4592    ///
4593    /// fn prepare_request_builder() -> Cancel {
4594    ///   # panic!();
4595    ///   // ... details omitted ...
4596    /// }
4597    /// ```
4598    #[derive(Clone, Debug)]
4599    pub struct Cancel(RequestBuilder<crate::model::SqlOperationsCancelRequest>);
4600
4601    impl Cancel {
4602        pub(crate) fn new(
4603            stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlOperationsService>,
4604        ) -> Self {
4605            Self(RequestBuilder::new(stub))
4606        }
4607
4608        /// Sets the full request, replacing any prior values.
4609        pub fn with_request<V: Into<crate::model::SqlOperationsCancelRequest>>(
4610            mut self,
4611            v: V,
4612        ) -> Self {
4613            self.0.request = v.into();
4614            self
4615        }
4616
4617        /// Sets all the options, replacing any prior values.
4618        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
4619            self.0.options = v.into();
4620            self
4621        }
4622
4623        /// Sends the request.
4624        pub async fn send(self) -> Result<()> {
4625            (*self.0.stub)
4626                .cancel(self.0.request, self.0.options)
4627                .await
4628                .map(gax::response::Response::into_body)
4629        }
4630
4631        /// Sets the value of [operation][crate::model::SqlOperationsCancelRequest::operation].
4632        pub fn set_operation<T: Into<std::string::String>>(mut self, v: T) -> Self {
4633            self.0.request.operation = v.into();
4634            self
4635        }
4636
4637        /// Sets the value of [project][crate::model::SqlOperationsCancelRequest::project].
4638        pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
4639            self.0.request.project = v.into();
4640            self
4641        }
4642    }
4643
4644    #[doc(hidden)]
4645    impl gax::options::internal::RequestBuilder for Cancel {
4646        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
4647            &mut self.0.options
4648        }
4649    }
4650}
4651
4652pub mod sql_ssl_certs_service {
4653    use crate::Result;
4654
4655    /// A builder for [SqlSslCertsService][crate::client::SqlSslCertsService].
4656    ///
4657    /// ```
4658    /// # tokio_test::block_on(async {
4659    /// # use google_cloud_sql_v1::*;
4660    /// # use builder::sql_ssl_certs_service::ClientBuilder;
4661    /// # use client::SqlSslCertsService;
4662    /// let builder : ClientBuilder = SqlSslCertsService::builder();
4663    /// let client = builder
4664    ///     .with_endpoint("https://sqladmin.googleapis.com")
4665    ///     .build().await?;
4666    /// # gax::client_builder::Result::<()>::Ok(()) });
4667    /// ```
4668    pub type ClientBuilder =
4669        gax::client_builder::ClientBuilder<client::Factory, gaxi::options::Credentials>;
4670
4671    pub(crate) mod client {
4672        use super::super::super::client::SqlSslCertsService;
4673        pub struct Factory;
4674        impl gax::client_builder::internal::ClientFactory for Factory {
4675            type Client = SqlSslCertsService;
4676            type Credentials = gaxi::options::Credentials;
4677            async fn build(
4678                self,
4679                config: gaxi::options::ClientConfig,
4680            ) -> gax::client_builder::Result<Self::Client> {
4681                Self::Client::new(config).await
4682            }
4683        }
4684    }
4685
4686    /// Common implementation for [crate::client::SqlSslCertsService] request builders.
4687    #[derive(Clone, Debug)]
4688    pub(crate) struct RequestBuilder<R: std::default::Default> {
4689        stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlSslCertsService>,
4690        request: R,
4691        options: gax::options::RequestOptions,
4692    }
4693
4694    impl<R> RequestBuilder<R>
4695    where
4696        R: std::default::Default,
4697    {
4698        pub(crate) fn new(
4699            stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlSslCertsService>,
4700        ) -> Self {
4701            Self {
4702                stub,
4703                request: R::default(),
4704                options: gax::options::RequestOptions::default(),
4705            }
4706        }
4707    }
4708
4709    /// The request builder for [SqlSslCertsService::delete][crate::client::SqlSslCertsService::delete] calls.
4710    ///
4711    /// # Example
4712    /// ```no_run
4713    /// # use google_cloud_sql_v1::builder;
4714    /// use builder::sql_ssl_certs_service::Delete;
4715    /// # tokio_test::block_on(async {
4716    ///
4717    /// let builder = prepare_request_builder();
4718    /// let response = builder.send().await?;
4719    /// # gax::Result::<()>::Ok(()) });
4720    ///
4721    /// fn prepare_request_builder() -> Delete {
4722    ///   # panic!();
4723    ///   // ... details omitted ...
4724    /// }
4725    /// ```
4726    #[derive(Clone, Debug)]
4727    pub struct Delete(RequestBuilder<crate::model::SqlSslCertsDeleteRequest>);
4728
4729    impl Delete {
4730        pub(crate) fn new(
4731            stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlSslCertsService>,
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::SqlSslCertsDeleteRequest>>(
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<gax::options::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                .delete(self.0.request, self.0.options)
4755                .await
4756                .map(gax::response::Response::into_body)
4757        }
4758
4759        /// Sets the value of [instance][crate::model::SqlSslCertsDeleteRequest::instance].
4760        pub fn set_instance<T: Into<std::string::String>>(mut self, v: T) -> Self {
4761            self.0.request.instance = v.into();
4762            self
4763        }
4764
4765        /// Sets the value of [project][crate::model::SqlSslCertsDeleteRequest::project].
4766        pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
4767            self.0.request.project = v.into();
4768            self
4769        }
4770
4771        /// Sets the value of [sha1_fingerprint][crate::model::SqlSslCertsDeleteRequest::sha1_fingerprint].
4772        pub fn set_sha1_fingerprint<T: Into<std::string::String>>(mut self, v: T) -> Self {
4773            self.0.request.sha1_fingerprint = v.into();
4774            self
4775        }
4776    }
4777
4778    #[doc(hidden)]
4779    impl gax::options::internal::RequestBuilder for Delete {
4780        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
4781            &mut self.0.options
4782        }
4783    }
4784
4785    /// The request builder for [SqlSslCertsService::get][crate::client::SqlSslCertsService::get] calls.
4786    ///
4787    /// # Example
4788    /// ```no_run
4789    /// # use google_cloud_sql_v1::builder;
4790    /// use builder::sql_ssl_certs_service::Get;
4791    /// # tokio_test::block_on(async {
4792    ///
4793    /// let builder = prepare_request_builder();
4794    /// let response = builder.send().await?;
4795    /// # gax::Result::<()>::Ok(()) });
4796    ///
4797    /// fn prepare_request_builder() -> Get {
4798    ///   # panic!();
4799    ///   // ... details omitted ...
4800    /// }
4801    /// ```
4802    #[derive(Clone, Debug)]
4803    pub struct Get(RequestBuilder<crate::model::SqlSslCertsGetRequest>);
4804
4805    impl Get {
4806        pub(crate) fn new(
4807            stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlSslCertsService>,
4808        ) -> Self {
4809            Self(RequestBuilder::new(stub))
4810        }
4811
4812        /// Sets the full request, replacing any prior values.
4813        pub fn with_request<V: Into<crate::model::SqlSslCertsGetRequest>>(mut self, v: V) -> Self {
4814            self.0.request = v.into();
4815            self
4816        }
4817
4818        /// Sets all the options, replacing any prior values.
4819        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
4820            self.0.options = v.into();
4821            self
4822        }
4823
4824        /// Sends the request.
4825        pub async fn send(self) -> Result<crate::model::SslCert> {
4826            (*self.0.stub)
4827                .get(self.0.request, self.0.options)
4828                .await
4829                .map(gax::response::Response::into_body)
4830        }
4831
4832        /// Sets the value of [instance][crate::model::SqlSslCertsGetRequest::instance].
4833        pub fn set_instance<T: Into<std::string::String>>(mut self, v: T) -> Self {
4834            self.0.request.instance = v.into();
4835            self
4836        }
4837
4838        /// Sets the value of [project][crate::model::SqlSslCertsGetRequest::project].
4839        pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
4840            self.0.request.project = v.into();
4841            self
4842        }
4843
4844        /// Sets the value of [sha1_fingerprint][crate::model::SqlSslCertsGetRequest::sha1_fingerprint].
4845        pub fn set_sha1_fingerprint<T: Into<std::string::String>>(mut self, v: T) -> Self {
4846            self.0.request.sha1_fingerprint = v.into();
4847            self
4848        }
4849    }
4850
4851    #[doc(hidden)]
4852    impl gax::options::internal::RequestBuilder for Get {
4853        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
4854            &mut self.0.options
4855        }
4856    }
4857
4858    /// The request builder for [SqlSslCertsService::insert][crate::client::SqlSslCertsService::insert] calls.
4859    ///
4860    /// # Example
4861    /// ```no_run
4862    /// # use google_cloud_sql_v1::builder;
4863    /// use builder::sql_ssl_certs_service::Insert;
4864    /// # tokio_test::block_on(async {
4865    ///
4866    /// let builder = prepare_request_builder();
4867    /// let response = builder.send().await?;
4868    /// # gax::Result::<()>::Ok(()) });
4869    ///
4870    /// fn prepare_request_builder() -> Insert {
4871    ///   # panic!();
4872    ///   // ... details omitted ...
4873    /// }
4874    /// ```
4875    #[derive(Clone, Debug)]
4876    pub struct Insert(RequestBuilder<crate::model::SqlSslCertsInsertRequest>);
4877
4878    impl Insert {
4879        pub(crate) fn new(
4880            stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlSslCertsService>,
4881        ) -> Self {
4882            Self(RequestBuilder::new(stub))
4883        }
4884
4885        /// Sets the full request, replacing any prior values.
4886        pub fn with_request<V: Into<crate::model::SqlSslCertsInsertRequest>>(
4887            mut self,
4888            v: V,
4889        ) -> Self {
4890            self.0.request = v.into();
4891            self
4892        }
4893
4894        /// Sets all the options, replacing any prior values.
4895        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
4896            self.0.options = v.into();
4897            self
4898        }
4899
4900        /// Sends the request.
4901        pub async fn send(self) -> Result<crate::model::SslCertsInsertResponse> {
4902            (*self.0.stub)
4903                .insert(self.0.request, self.0.options)
4904                .await
4905                .map(gax::response::Response::into_body)
4906        }
4907
4908        /// Sets the value of [instance][crate::model::SqlSslCertsInsertRequest::instance].
4909        pub fn set_instance<T: Into<std::string::String>>(mut self, v: T) -> Self {
4910            self.0.request.instance = v.into();
4911            self
4912        }
4913
4914        /// Sets the value of [project][crate::model::SqlSslCertsInsertRequest::project].
4915        pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
4916            self.0.request.project = v.into();
4917            self
4918        }
4919
4920        /// Sets the value of [body][crate::model::SqlSslCertsInsertRequest::body].
4921        pub fn set_body<T>(mut self, v: T) -> Self
4922        where
4923            T: std::convert::Into<crate::model::SslCertsInsertRequest>,
4924        {
4925            self.0.request.body = std::option::Option::Some(v.into());
4926            self
4927        }
4928
4929        /// Sets or clears the value of [body][crate::model::SqlSslCertsInsertRequest::body].
4930        pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
4931        where
4932            T: std::convert::Into<crate::model::SslCertsInsertRequest>,
4933        {
4934            self.0.request.body = v.map(|x| x.into());
4935            self
4936        }
4937    }
4938
4939    #[doc(hidden)]
4940    impl gax::options::internal::RequestBuilder for Insert {
4941        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
4942            &mut self.0.options
4943        }
4944    }
4945
4946    /// The request builder for [SqlSslCertsService::list][crate::client::SqlSslCertsService::list] calls.
4947    ///
4948    /// # Example
4949    /// ```no_run
4950    /// # use google_cloud_sql_v1::builder;
4951    /// use builder::sql_ssl_certs_service::List;
4952    /// # tokio_test::block_on(async {
4953    ///
4954    /// let builder = prepare_request_builder();
4955    /// let response = builder.send().await?;
4956    /// # gax::Result::<()>::Ok(()) });
4957    ///
4958    /// fn prepare_request_builder() -> List {
4959    ///   # panic!();
4960    ///   // ... details omitted ...
4961    /// }
4962    /// ```
4963    #[derive(Clone, Debug)]
4964    pub struct List(RequestBuilder<crate::model::SqlSslCertsListRequest>);
4965
4966    impl List {
4967        pub(crate) fn new(
4968            stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlSslCertsService>,
4969        ) -> Self {
4970            Self(RequestBuilder::new(stub))
4971        }
4972
4973        /// Sets the full request, replacing any prior values.
4974        pub fn with_request<V: Into<crate::model::SqlSslCertsListRequest>>(mut self, v: V) -> Self {
4975            self.0.request = v.into();
4976            self
4977        }
4978
4979        /// Sets all the options, replacing any prior values.
4980        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
4981            self.0.options = v.into();
4982            self
4983        }
4984
4985        /// Sends the request.
4986        pub async fn send(self) -> Result<crate::model::SslCertsListResponse> {
4987            (*self.0.stub)
4988                .list(self.0.request, self.0.options)
4989                .await
4990                .map(gax::response::Response::into_body)
4991        }
4992
4993        /// Sets the value of [instance][crate::model::SqlSslCertsListRequest::instance].
4994        pub fn set_instance<T: Into<std::string::String>>(mut self, v: T) -> Self {
4995            self.0.request.instance = v.into();
4996            self
4997        }
4998
4999        /// Sets the value of [project][crate::model::SqlSslCertsListRequest::project].
5000        pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
5001            self.0.request.project = v.into();
5002            self
5003        }
5004    }
5005
5006    #[doc(hidden)]
5007    impl gax::options::internal::RequestBuilder for List {
5008        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
5009            &mut self.0.options
5010        }
5011    }
5012}
5013
5014pub mod sql_tiers_service {
5015    use crate::Result;
5016
5017    /// A builder for [SqlTiersService][crate::client::SqlTiersService].
5018    ///
5019    /// ```
5020    /// # tokio_test::block_on(async {
5021    /// # use google_cloud_sql_v1::*;
5022    /// # use builder::sql_tiers_service::ClientBuilder;
5023    /// # use client::SqlTiersService;
5024    /// let builder : ClientBuilder = SqlTiersService::builder();
5025    /// let client = builder
5026    ///     .with_endpoint("https://sqladmin.googleapis.com")
5027    ///     .build().await?;
5028    /// # gax::client_builder::Result::<()>::Ok(()) });
5029    /// ```
5030    pub type ClientBuilder =
5031        gax::client_builder::ClientBuilder<client::Factory, gaxi::options::Credentials>;
5032
5033    pub(crate) mod client {
5034        use super::super::super::client::SqlTiersService;
5035        pub struct Factory;
5036        impl gax::client_builder::internal::ClientFactory for Factory {
5037            type Client = SqlTiersService;
5038            type Credentials = gaxi::options::Credentials;
5039            async fn build(
5040                self,
5041                config: gaxi::options::ClientConfig,
5042            ) -> gax::client_builder::Result<Self::Client> {
5043                Self::Client::new(config).await
5044            }
5045        }
5046    }
5047
5048    /// Common implementation for [crate::client::SqlTiersService] request builders.
5049    #[derive(Clone, Debug)]
5050    pub(crate) struct RequestBuilder<R: std::default::Default> {
5051        stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlTiersService>,
5052        request: R,
5053        options: gax::options::RequestOptions,
5054    }
5055
5056    impl<R> RequestBuilder<R>
5057    where
5058        R: std::default::Default,
5059    {
5060        pub(crate) fn new(
5061            stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlTiersService>,
5062        ) -> Self {
5063            Self {
5064                stub,
5065                request: R::default(),
5066                options: gax::options::RequestOptions::default(),
5067            }
5068        }
5069    }
5070
5071    /// The request builder for [SqlTiersService::list][crate::client::SqlTiersService::list] calls.
5072    ///
5073    /// # Example
5074    /// ```no_run
5075    /// # use google_cloud_sql_v1::builder;
5076    /// use builder::sql_tiers_service::List;
5077    /// # tokio_test::block_on(async {
5078    ///
5079    /// let builder = prepare_request_builder();
5080    /// let response = builder.send().await?;
5081    /// # gax::Result::<()>::Ok(()) });
5082    ///
5083    /// fn prepare_request_builder() -> List {
5084    ///   # panic!();
5085    ///   // ... details omitted ...
5086    /// }
5087    /// ```
5088    #[derive(Clone, Debug)]
5089    pub struct List(RequestBuilder<crate::model::SqlTiersListRequest>);
5090
5091    impl List {
5092        pub(crate) fn new(
5093            stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlTiersService>,
5094        ) -> Self {
5095            Self(RequestBuilder::new(stub))
5096        }
5097
5098        /// Sets the full request, replacing any prior values.
5099        pub fn with_request<V: Into<crate::model::SqlTiersListRequest>>(mut self, v: V) -> Self {
5100            self.0.request = v.into();
5101            self
5102        }
5103
5104        /// Sets all the options, replacing any prior values.
5105        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
5106            self.0.options = v.into();
5107            self
5108        }
5109
5110        /// Sends the request.
5111        pub async fn send(self) -> Result<crate::model::TiersListResponse> {
5112            (*self.0.stub)
5113                .list(self.0.request, self.0.options)
5114                .await
5115                .map(gax::response::Response::into_body)
5116        }
5117
5118        /// Sets the value of [project][crate::model::SqlTiersListRequest::project].
5119        pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
5120            self.0.request.project = v.into();
5121            self
5122        }
5123    }
5124
5125    #[doc(hidden)]
5126    impl gax::options::internal::RequestBuilder for List {
5127        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
5128            &mut self.0.options
5129        }
5130    }
5131}
5132
5133pub mod sql_users_service {
5134    use crate::Result;
5135
5136    /// A builder for [SqlUsersService][crate::client::SqlUsersService].
5137    ///
5138    /// ```
5139    /// # tokio_test::block_on(async {
5140    /// # use google_cloud_sql_v1::*;
5141    /// # use builder::sql_users_service::ClientBuilder;
5142    /// # use client::SqlUsersService;
5143    /// let builder : ClientBuilder = SqlUsersService::builder();
5144    /// let client = builder
5145    ///     .with_endpoint("https://sqladmin.googleapis.com")
5146    ///     .build().await?;
5147    /// # gax::client_builder::Result::<()>::Ok(()) });
5148    /// ```
5149    pub type ClientBuilder =
5150        gax::client_builder::ClientBuilder<client::Factory, gaxi::options::Credentials>;
5151
5152    pub(crate) mod client {
5153        use super::super::super::client::SqlUsersService;
5154        pub struct Factory;
5155        impl gax::client_builder::internal::ClientFactory for Factory {
5156            type Client = SqlUsersService;
5157            type Credentials = gaxi::options::Credentials;
5158            async fn build(
5159                self,
5160                config: gaxi::options::ClientConfig,
5161            ) -> gax::client_builder::Result<Self::Client> {
5162                Self::Client::new(config).await
5163            }
5164        }
5165    }
5166
5167    /// Common implementation for [crate::client::SqlUsersService] request builders.
5168    #[derive(Clone, Debug)]
5169    pub(crate) struct RequestBuilder<R: std::default::Default> {
5170        stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlUsersService>,
5171        request: R,
5172        options: gax::options::RequestOptions,
5173    }
5174
5175    impl<R> RequestBuilder<R>
5176    where
5177        R: std::default::Default,
5178    {
5179        pub(crate) fn new(
5180            stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlUsersService>,
5181        ) -> Self {
5182            Self {
5183                stub,
5184                request: R::default(),
5185                options: gax::options::RequestOptions::default(),
5186            }
5187        }
5188    }
5189
5190    /// The request builder for [SqlUsersService::delete][crate::client::SqlUsersService::delete] calls.
5191    ///
5192    /// # Example
5193    /// ```no_run
5194    /// # use google_cloud_sql_v1::builder;
5195    /// use builder::sql_users_service::Delete;
5196    /// # tokio_test::block_on(async {
5197    ///
5198    /// let builder = prepare_request_builder();
5199    /// let response = builder.send().await?;
5200    /// # gax::Result::<()>::Ok(()) });
5201    ///
5202    /// fn prepare_request_builder() -> Delete {
5203    ///   # panic!();
5204    ///   // ... details omitted ...
5205    /// }
5206    /// ```
5207    #[derive(Clone, Debug)]
5208    pub struct Delete(RequestBuilder<crate::model::SqlUsersDeleteRequest>);
5209
5210    impl Delete {
5211        pub(crate) fn new(
5212            stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlUsersService>,
5213        ) -> Self {
5214            Self(RequestBuilder::new(stub))
5215        }
5216
5217        /// Sets the full request, replacing any prior values.
5218        pub fn with_request<V: Into<crate::model::SqlUsersDeleteRequest>>(mut self, v: V) -> Self {
5219            self.0.request = v.into();
5220            self
5221        }
5222
5223        /// Sets all the options, replacing any prior values.
5224        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
5225            self.0.options = v.into();
5226            self
5227        }
5228
5229        /// Sends the request.
5230        pub async fn send(self) -> Result<crate::model::Operation> {
5231            (*self.0.stub)
5232                .delete(self.0.request, self.0.options)
5233                .await
5234                .map(gax::response::Response::into_body)
5235        }
5236
5237        /// Sets the value of [host][crate::model::SqlUsersDeleteRequest::host].
5238        pub fn set_host<T: Into<std::string::String>>(mut self, v: T) -> Self {
5239            self.0.request.host = v.into();
5240            self
5241        }
5242
5243        /// Sets the value of [instance][crate::model::SqlUsersDeleteRequest::instance].
5244        pub fn set_instance<T: Into<std::string::String>>(mut self, v: T) -> Self {
5245            self.0.request.instance = v.into();
5246            self
5247        }
5248
5249        /// Sets the value of [name][crate::model::SqlUsersDeleteRequest::name].
5250        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
5251            self.0.request.name = v.into();
5252            self
5253        }
5254
5255        /// Sets the value of [project][crate::model::SqlUsersDeleteRequest::project].
5256        pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
5257            self.0.request.project = v.into();
5258            self
5259        }
5260    }
5261
5262    #[doc(hidden)]
5263    impl gax::options::internal::RequestBuilder for Delete {
5264        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
5265            &mut self.0.options
5266        }
5267    }
5268
5269    /// The request builder for [SqlUsersService::get][crate::client::SqlUsersService::get] calls.
5270    ///
5271    /// # Example
5272    /// ```no_run
5273    /// # use google_cloud_sql_v1::builder;
5274    /// use builder::sql_users_service::Get;
5275    /// # tokio_test::block_on(async {
5276    ///
5277    /// let builder = prepare_request_builder();
5278    /// let response = builder.send().await?;
5279    /// # gax::Result::<()>::Ok(()) });
5280    ///
5281    /// fn prepare_request_builder() -> Get {
5282    ///   # panic!();
5283    ///   // ... details omitted ...
5284    /// }
5285    /// ```
5286    #[derive(Clone, Debug)]
5287    pub struct Get(RequestBuilder<crate::model::SqlUsersGetRequest>);
5288
5289    impl Get {
5290        pub(crate) fn new(
5291            stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlUsersService>,
5292        ) -> Self {
5293            Self(RequestBuilder::new(stub))
5294        }
5295
5296        /// Sets the full request, replacing any prior values.
5297        pub fn with_request<V: Into<crate::model::SqlUsersGetRequest>>(mut self, v: V) -> Self {
5298            self.0.request = v.into();
5299            self
5300        }
5301
5302        /// Sets all the options, replacing any prior values.
5303        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
5304            self.0.options = v.into();
5305            self
5306        }
5307
5308        /// Sends the request.
5309        pub async fn send(self) -> Result<crate::model::User> {
5310            (*self.0.stub)
5311                .get(self.0.request, self.0.options)
5312                .await
5313                .map(gax::response::Response::into_body)
5314        }
5315
5316        /// Sets the value of [instance][crate::model::SqlUsersGetRequest::instance].
5317        pub fn set_instance<T: Into<std::string::String>>(mut self, v: T) -> Self {
5318            self.0.request.instance = v.into();
5319            self
5320        }
5321
5322        /// Sets the value of [name][crate::model::SqlUsersGetRequest::name].
5323        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
5324            self.0.request.name = v.into();
5325            self
5326        }
5327
5328        /// Sets the value of [project][crate::model::SqlUsersGetRequest::project].
5329        pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
5330            self.0.request.project = v.into();
5331            self
5332        }
5333
5334        /// Sets the value of [host][crate::model::SqlUsersGetRequest::host].
5335        pub fn set_host<T: Into<std::string::String>>(mut self, v: T) -> Self {
5336            self.0.request.host = v.into();
5337            self
5338        }
5339    }
5340
5341    #[doc(hidden)]
5342    impl gax::options::internal::RequestBuilder for Get {
5343        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
5344            &mut self.0.options
5345        }
5346    }
5347
5348    /// The request builder for [SqlUsersService::insert][crate::client::SqlUsersService::insert] calls.
5349    ///
5350    /// # Example
5351    /// ```no_run
5352    /// # use google_cloud_sql_v1::builder;
5353    /// use builder::sql_users_service::Insert;
5354    /// # tokio_test::block_on(async {
5355    ///
5356    /// let builder = prepare_request_builder();
5357    /// let response = builder.send().await?;
5358    /// # gax::Result::<()>::Ok(()) });
5359    ///
5360    /// fn prepare_request_builder() -> Insert {
5361    ///   # panic!();
5362    ///   // ... details omitted ...
5363    /// }
5364    /// ```
5365    #[derive(Clone, Debug)]
5366    pub struct Insert(RequestBuilder<crate::model::SqlUsersInsertRequest>);
5367
5368    impl Insert {
5369        pub(crate) fn new(
5370            stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlUsersService>,
5371        ) -> Self {
5372            Self(RequestBuilder::new(stub))
5373        }
5374
5375        /// Sets the full request, replacing any prior values.
5376        pub fn with_request<V: Into<crate::model::SqlUsersInsertRequest>>(mut self, v: V) -> Self {
5377            self.0.request = v.into();
5378            self
5379        }
5380
5381        /// Sets all the options, replacing any prior values.
5382        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
5383            self.0.options = v.into();
5384            self
5385        }
5386
5387        /// Sends the request.
5388        pub async fn send(self) -> Result<crate::model::Operation> {
5389            (*self.0.stub)
5390                .insert(self.0.request, self.0.options)
5391                .await
5392                .map(gax::response::Response::into_body)
5393        }
5394
5395        /// Sets the value of [instance][crate::model::SqlUsersInsertRequest::instance].
5396        pub fn set_instance<T: Into<std::string::String>>(mut self, v: T) -> Self {
5397            self.0.request.instance = v.into();
5398            self
5399        }
5400
5401        /// Sets the value of [project][crate::model::SqlUsersInsertRequest::project].
5402        pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
5403            self.0.request.project = v.into();
5404            self
5405        }
5406
5407        /// Sets the value of [body][crate::model::SqlUsersInsertRequest::body].
5408        pub fn set_body<T>(mut self, v: T) -> Self
5409        where
5410            T: std::convert::Into<crate::model::User>,
5411        {
5412            self.0.request.body = std::option::Option::Some(v.into());
5413            self
5414        }
5415
5416        /// Sets or clears the value of [body][crate::model::SqlUsersInsertRequest::body].
5417        pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
5418        where
5419            T: std::convert::Into<crate::model::User>,
5420        {
5421            self.0.request.body = v.map(|x| x.into());
5422            self
5423        }
5424    }
5425
5426    #[doc(hidden)]
5427    impl gax::options::internal::RequestBuilder for Insert {
5428        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
5429            &mut self.0.options
5430        }
5431    }
5432
5433    /// The request builder for [SqlUsersService::list][crate::client::SqlUsersService::list] calls.
5434    ///
5435    /// # Example
5436    /// ```no_run
5437    /// # use google_cloud_sql_v1::builder;
5438    /// use builder::sql_users_service::List;
5439    /// # tokio_test::block_on(async {
5440    ///
5441    /// let builder = prepare_request_builder();
5442    /// let response = builder.send().await?;
5443    /// # gax::Result::<()>::Ok(()) });
5444    ///
5445    /// fn prepare_request_builder() -> List {
5446    ///   # panic!();
5447    ///   // ... details omitted ...
5448    /// }
5449    /// ```
5450    #[derive(Clone, Debug)]
5451    pub struct List(RequestBuilder<crate::model::SqlUsersListRequest>);
5452
5453    impl List {
5454        pub(crate) fn new(
5455            stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlUsersService>,
5456        ) -> Self {
5457            Self(RequestBuilder::new(stub))
5458        }
5459
5460        /// Sets the full request, replacing any prior values.
5461        pub fn with_request<V: Into<crate::model::SqlUsersListRequest>>(mut self, v: V) -> Self {
5462            self.0.request = v.into();
5463            self
5464        }
5465
5466        /// Sets all the options, replacing any prior values.
5467        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
5468            self.0.options = v.into();
5469            self
5470        }
5471
5472        /// Sends the request.
5473        pub async fn send(self) -> Result<crate::model::UsersListResponse> {
5474            (*self.0.stub)
5475                .list(self.0.request, self.0.options)
5476                .await
5477                .map(gax::response::Response::into_body)
5478        }
5479
5480        /// Sets the value of [instance][crate::model::SqlUsersListRequest::instance].
5481        pub fn set_instance<T: Into<std::string::String>>(mut self, v: T) -> Self {
5482            self.0.request.instance = v.into();
5483            self
5484        }
5485
5486        /// Sets the value of [project][crate::model::SqlUsersListRequest::project].
5487        pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
5488            self.0.request.project = v.into();
5489            self
5490        }
5491    }
5492
5493    #[doc(hidden)]
5494    impl gax::options::internal::RequestBuilder for List {
5495        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
5496            &mut self.0.options
5497        }
5498    }
5499
5500    /// The request builder for [SqlUsersService::update][crate::client::SqlUsersService::update] calls.
5501    ///
5502    /// # Example
5503    /// ```no_run
5504    /// # use google_cloud_sql_v1::builder;
5505    /// use builder::sql_users_service::Update;
5506    /// # tokio_test::block_on(async {
5507    ///
5508    /// let builder = prepare_request_builder();
5509    /// let response = builder.send().await?;
5510    /// # gax::Result::<()>::Ok(()) });
5511    ///
5512    /// fn prepare_request_builder() -> Update {
5513    ///   # panic!();
5514    ///   // ... details omitted ...
5515    /// }
5516    /// ```
5517    #[derive(Clone, Debug)]
5518    pub struct Update(RequestBuilder<crate::model::SqlUsersUpdateRequest>);
5519
5520    impl Update {
5521        pub(crate) fn new(
5522            stub: std::sync::Arc<dyn super::super::stub::dynamic::SqlUsersService>,
5523        ) -> Self {
5524            Self(RequestBuilder::new(stub))
5525        }
5526
5527        /// Sets the full request, replacing any prior values.
5528        pub fn with_request<V: Into<crate::model::SqlUsersUpdateRequest>>(mut self, v: V) -> Self {
5529            self.0.request = v.into();
5530            self
5531        }
5532
5533        /// Sets all the options, replacing any prior values.
5534        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
5535            self.0.options = v.into();
5536            self
5537        }
5538
5539        /// Sends the request.
5540        pub async fn send(self) -> Result<crate::model::Operation> {
5541            (*self.0.stub)
5542                .update(self.0.request, self.0.options)
5543                .await
5544                .map(gax::response::Response::into_body)
5545        }
5546
5547        /// Sets the value of [host][crate::model::SqlUsersUpdateRequest::host].
5548        pub fn set_host<T: Into<std::string::String>>(mut self, v: T) -> Self {
5549            self.0.request.host = v.into();
5550            self
5551        }
5552
5553        /// Sets the value of [instance][crate::model::SqlUsersUpdateRequest::instance].
5554        pub fn set_instance<T: Into<std::string::String>>(mut self, v: T) -> Self {
5555            self.0.request.instance = v.into();
5556            self
5557        }
5558
5559        /// Sets the value of [name][crate::model::SqlUsersUpdateRequest::name].
5560        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
5561            self.0.request.name = v.into();
5562            self
5563        }
5564
5565        /// Sets the value of [project][crate::model::SqlUsersUpdateRequest::project].
5566        pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
5567            self.0.request.project = v.into();
5568            self
5569        }
5570
5571        /// Sets the value of [body][crate::model::SqlUsersUpdateRequest::body].
5572        pub fn set_body<T>(mut self, v: T) -> Self
5573        where
5574            T: std::convert::Into<crate::model::User>,
5575        {
5576            self.0.request.body = std::option::Option::Some(v.into());
5577            self
5578        }
5579
5580        /// Sets or clears the value of [body][crate::model::SqlUsersUpdateRequest::body].
5581        pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
5582        where
5583            T: std::convert::Into<crate::model::User>,
5584        {
5585            self.0.request.body = v.map(|x| x.into());
5586            self
5587        }
5588    }
5589
5590    #[doc(hidden)]
5591    impl gax::options::internal::RequestBuilder for Update {
5592        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
5593            &mut self.0.options
5594        }
5595    }
5596}