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