google_cloud_spanner_admin_database_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 database_admin {
18    use crate::Result;
19
20    /// A builder for [DatabaseAdmin][crate::client::DatabaseAdmin].
21    ///
22    /// ```
23    /// # async fn sample() -> gax::client_builder::Result<()> {
24    /// # use google_cloud_spanner_admin_database_v1::*;
25    /// # use builder::database_admin::ClientBuilder;
26    /// # use client::DatabaseAdmin;
27    /// let builder : ClientBuilder = DatabaseAdmin::builder();
28    /// let client = builder
29    ///     .with_endpoint("https://spanner.googleapis.com")
30    ///     .build().await?;
31    /// # 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::DatabaseAdmin;
38        pub struct Factory;
39        impl gax::client_builder::internal::ClientFactory for Factory {
40            type Client = DatabaseAdmin;
41            type Credentials = gaxi::options::Credentials;
42            async fn build(
43                self,
44                config: gaxi::options::ClientConfig,
45            ) -> gax::client_builder::Result<Self::Client> {
46                Self::Client::new(config).await
47            }
48        }
49    }
50
51    /// Common implementation for [crate::client::DatabaseAdmin] request builders.
52    #[derive(Clone, Debug)]
53    pub(crate) struct RequestBuilder<R: std::default::Default> {
54        stub: std::sync::Arc<dyn super::super::stub::dynamic::DatabaseAdmin>,
55        request: R,
56        options: gax::options::RequestOptions,
57    }
58
59    impl<R> RequestBuilder<R>
60    where
61        R: std::default::Default,
62    {
63        pub(crate) fn new(
64            stub: std::sync::Arc<dyn super::super::stub::dynamic::DatabaseAdmin>,
65        ) -> Self {
66            Self {
67                stub,
68                request: R::default(),
69                options: gax::options::RequestOptions::default(),
70            }
71        }
72    }
73
74    /// The request builder for [DatabaseAdmin::list_databases][crate::client::DatabaseAdmin::list_databases] calls.
75    ///
76    /// # Example
77    /// ```
78    /// # use google_cloud_spanner_admin_database_v1::builder::database_admin::ListDatabases;
79    /// # async fn sample() -> gax::Result<()> {
80    /// use gax::paginator::ItemPaginator;
81    ///
82    /// let builder = prepare_request_builder();
83    /// let mut items = builder.by_item();
84    /// while let Some(result) = items.next().await {
85    ///   let item = result?;
86    /// }
87    /// # Ok(()) }
88    ///
89    /// fn prepare_request_builder() -> ListDatabases {
90    ///   # panic!();
91    ///   // ... details omitted ...
92    /// }
93    /// ```
94    #[derive(Clone, Debug)]
95    pub struct ListDatabases(RequestBuilder<crate::model::ListDatabasesRequest>);
96
97    impl ListDatabases {
98        pub(crate) fn new(
99            stub: std::sync::Arc<dyn super::super::stub::dynamic::DatabaseAdmin>,
100        ) -> Self {
101            Self(RequestBuilder::new(stub))
102        }
103
104        /// Sets the full request, replacing any prior values.
105        pub fn with_request<V: Into<crate::model::ListDatabasesRequest>>(mut self, v: V) -> Self {
106            self.0.request = v.into();
107            self
108        }
109
110        /// Sets all the options, replacing any prior values.
111        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
112            self.0.options = v.into();
113            self
114        }
115
116        /// Sends the request.
117        pub async fn send(self) -> Result<crate::model::ListDatabasesResponse> {
118            (*self.0.stub)
119                .list_databases(self.0.request, self.0.options)
120                .await
121                .map(gax::response::Response::into_body)
122        }
123
124        /// Streams each page in the collection.
125        pub fn by_page(
126            self,
127        ) -> impl gax::paginator::Paginator<crate::model::ListDatabasesResponse, gax::error::Error>
128        {
129            use std::clone::Clone;
130            let token = self.0.request.page_token.clone();
131            let execute = move |token: String| {
132                let mut builder = self.clone();
133                builder.0.request = builder.0.request.set_page_token(token);
134                builder.send()
135            };
136            gax::paginator::internal::new_paginator(token, execute)
137        }
138
139        /// Streams each item in the collection.
140        pub fn by_item(
141            self,
142        ) -> impl gax::paginator::ItemPaginator<crate::model::ListDatabasesResponse, gax::error::Error>
143        {
144            use gax::paginator::Paginator;
145            self.by_page().items()
146        }
147
148        /// Sets the value of [parent][crate::model::ListDatabasesRequest::parent].
149        ///
150        /// This is a **required** field for requests.
151        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
152            self.0.request.parent = v.into();
153            self
154        }
155
156        /// Sets the value of [page_size][crate::model::ListDatabasesRequest::page_size].
157        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
158            self.0.request.page_size = v.into();
159            self
160        }
161
162        /// Sets the value of [page_token][crate::model::ListDatabasesRequest::page_token].
163        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
164            self.0.request.page_token = v.into();
165            self
166        }
167    }
168
169    #[doc(hidden)]
170    impl gax::options::internal::RequestBuilder for ListDatabases {
171        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
172            &mut self.0.options
173        }
174    }
175
176    /// The request builder for [DatabaseAdmin::create_database][crate::client::DatabaseAdmin::create_database] calls.
177    ///
178    /// # Example
179    /// ```
180    /// # use google_cloud_spanner_admin_database_v1::builder::database_admin::CreateDatabase;
181    /// # async fn sample() -> gax::Result<()> {
182    /// use lro::Poller;
183    ///
184    /// let builder = prepare_request_builder();
185    /// let response = builder.poller().until_done().await?;
186    /// # Ok(()) }
187    ///
188    /// fn prepare_request_builder() -> CreateDatabase {
189    ///   # panic!();
190    ///   // ... details omitted ...
191    /// }
192    /// ```
193    #[derive(Clone, Debug)]
194    pub struct CreateDatabase(RequestBuilder<crate::model::CreateDatabaseRequest>);
195
196    impl CreateDatabase {
197        pub(crate) fn new(
198            stub: std::sync::Arc<dyn super::super::stub::dynamic::DatabaseAdmin>,
199        ) -> Self {
200            Self(RequestBuilder::new(stub))
201        }
202
203        /// Sets the full request, replacing any prior values.
204        pub fn with_request<V: Into<crate::model::CreateDatabaseRequest>>(mut self, v: V) -> Self {
205            self.0.request = v.into();
206            self
207        }
208
209        /// Sets all the options, replacing any prior values.
210        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
211            self.0.options = v.into();
212            self
213        }
214
215        /// Sends the request.
216        ///
217        /// # Long running operations
218        ///
219        /// This starts, but does not poll, a longrunning operation. More information
220        /// on [create_database][crate::client::DatabaseAdmin::create_database].
221        pub async fn send(self) -> Result<longrunning::model::Operation> {
222            (*self.0.stub)
223                .create_database(self.0.request, self.0.options)
224                .await
225                .map(gax::response::Response::into_body)
226        }
227
228        /// Creates a [Poller][lro::Poller] to work with `create_database`.
229        pub fn poller(
230            self,
231        ) -> impl lro::Poller<crate::model::Database, crate::model::CreateDatabaseMetadata>
232        {
233            type Operation = lro::internal::Operation<
234                crate::model::Database,
235                crate::model::CreateDatabaseMetadata,
236            >;
237            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
238            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
239
240            let stub = self.0.stub.clone();
241            let mut options = self.0.options.clone();
242            options.set_retry_policy(gax::retry_policy::NeverRetry);
243            let query = move |name| {
244                let stub = stub.clone();
245                let options = options.clone();
246                async {
247                    let op = GetOperation::new(stub)
248                        .set_name(name)
249                        .with_options(options)
250                        .send()
251                        .await?;
252                    Ok(Operation::new(op))
253                }
254            };
255
256            let start = move || async {
257                let op = self.send().await?;
258                Ok(Operation::new(op))
259            };
260
261            lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
262        }
263
264        /// Sets the value of [parent][crate::model::CreateDatabaseRequest::parent].
265        ///
266        /// This is a **required** field for requests.
267        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
268            self.0.request.parent = v.into();
269            self
270        }
271
272        /// Sets the value of [create_statement][crate::model::CreateDatabaseRequest::create_statement].
273        ///
274        /// This is a **required** field for requests.
275        pub fn set_create_statement<T: Into<std::string::String>>(mut self, v: T) -> Self {
276            self.0.request.create_statement = v.into();
277            self
278        }
279
280        /// Sets the value of [extra_statements][crate::model::CreateDatabaseRequest::extra_statements].
281        pub fn set_extra_statements<T, V>(mut self, v: T) -> Self
282        where
283            T: std::iter::IntoIterator<Item = V>,
284            V: std::convert::Into<std::string::String>,
285        {
286            use std::iter::Iterator;
287            self.0.request.extra_statements = v.into_iter().map(|i| i.into()).collect();
288            self
289        }
290
291        /// Sets the value of [encryption_config][crate::model::CreateDatabaseRequest::encryption_config].
292        pub fn set_encryption_config<T>(mut self, v: T) -> Self
293        where
294            T: std::convert::Into<crate::model::EncryptionConfig>,
295        {
296            self.0.request.encryption_config = std::option::Option::Some(v.into());
297            self
298        }
299
300        /// Sets or clears the value of [encryption_config][crate::model::CreateDatabaseRequest::encryption_config].
301        pub fn set_or_clear_encryption_config<T>(mut self, v: std::option::Option<T>) -> Self
302        where
303            T: std::convert::Into<crate::model::EncryptionConfig>,
304        {
305            self.0.request.encryption_config = v.map(|x| x.into());
306            self
307        }
308
309        /// Sets the value of [database_dialect][crate::model::CreateDatabaseRequest::database_dialect].
310        pub fn set_database_dialect<T: Into<crate::model::DatabaseDialect>>(
311            mut self,
312            v: T,
313        ) -> Self {
314            self.0.request.database_dialect = v.into();
315            self
316        }
317
318        /// Sets the value of [proto_descriptors][crate::model::CreateDatabaseRequest::proto_descriptors].
319        pub fn set_proto_descriptors<T: Into<::bytes::Bytes>>(mut self, v: T) -> Self {
320            self.0.request.proto_descriptors = v.into();
321            self
322        }
323    }
324
325    #[doc(hidden)]
326    impl gax::options::internal::RequestBuilder for CreateDatabase {
327        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
328            &mut self.0.options
329        }
330    }
331
332    /// The request builder for [DatabaseAdmin::get_database][crate::client::DatabaseAdmin::get_database] calls.
333    ///
334    /// # Example
335    /// ```
336    /// # use google_cloud_spanner_admin_database_v1::builder::database_admin::GetDatabase;
337    /// # async fn sample() -> gax::Result<()> {
338    ///
339    /// let builder = prepare_request_builder();
340    /// let response = builder.send().await?;
341    /// # Ok(()) }
342    ///
343    /// fn prepare_request_builder() -> GetDatabase {
344    ///   # panic!();
345    ///   // ... details omitted ...
346    /// }
347    /// ```
348    #[derive(Clone, Debug)]
349    pub struct GetDatabase(RequestBuilder<crate::model::GetDatabaseRequest>);
350
351    impl GetDatabase {
352        pub(crate) fn new(
353            stub: std::sync::Arc<dyn super::super::stub::dynamic::DatabaseAdmin>,
354        ) -> Self {
355            Self(RequestBuilder::new(stub))
356        }
357
358        /// Sets the full request, replacing any prior values.
359        pub fn with_request<V: Into<crate::model::GetDatabaseRequest>>(mut self, v: V) -> Self {
360            self.0.request = v.into();
361            self
362        }
363
364        /// Sets all the options, replacing any prior values.
365        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
366            self.0.options = v.into();
367            self
368        }
369
370        /// Sends the request.
371        pub async fn send(self) -> Result<crate::model::Database> {
372            (*self.0.stub)
373                .get_database(self.0.request, self.0.options)
374                .await
375                .map(gax::response::Response::into_body)
376        }
377
378        /// Sets the value of [name][crate::model::GetDatabaseRequest::name].
379        ///
380        /// This is a **required** field for requests.
381        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
382            self.0.request.name = v.into();
383            self
384        }
385    }
386
387    #[doc(hidden)]
388    impl gax::options::internal::RequestBuilder for GetDatabase {
389        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
390            &mut self.0.options
391        }
392    }
393
394    /// The request builder for [DatabaseAdmin::update_database][crate::client::DatabaseAdmin::update_database] calls.
395    ///
396    /// # Example
397    /// ```
398    /// # use google_cloud_spanner_admin_database_v1::builder::database_admin::UpdateDatabase;
399    /// # async fn sample() -> gax::Result<()> {
400    /// use lro::Poller;
401    ///
402    /// let builder = prepare_request_builder();
403    /// let response = builder.poller().until_done().await?;
404    /// # Ok(()) }
405    ///
406    /// fn prepare_request_builder() -> UpdateDatabase {
407    ///   # panic!();
408    ///   // ... details omitted ...
409    /// }
410    /// ```
411    #[derive(Clone, Debug)]
412    pub struct UpdateDatabase(RequestBuilder<crate::model::UpdateDatabaseRequest>);
413
414    impl UpdateDatabase {
415        pub(crate) fn new(
416            stub: std::sync::Arc<dyn super::super::stub::dynamic::DatabaseAdmin>,
417        ) -> Self {
418            Self(RequestBuilder::new(stub))
419        }
420
421        /// Sets the full request, replacing any prior values.
422        pub fn with_request<V: Into<crate::model::UpdateDatabaseRequest>>(mut self, v: V) -> Self {
423            self.0.request = v.into();
424            self
425        }
426
427        /// Sets all the options, replacing any prior values.
428        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
429            self.0.options = v.into();
430            self
431        }
432
433        /// Sends the request.
434        ///
435        /// # Long running operations
436        ///
437        /// This starts, but does not poll, a longrunning operation. More information
438        /// on [update_database][crate::client::DatabaseAdmin::update_database].
439        pub async fn send(self) -> Result<longrunning::model::Operation> {
440            (*self.0.stub)
441                .update_database(self.0.request, self.0.options)
442                .await
443                .map(gax::response::Response::into_body)
444        }
445
446        /// Creates a [Poller][lro::Poller] to work with `update_database`.
447        pub fn poller(
448            self,
449        ) -> impl lro::Poller<crate::model::Database, crate::model::UpdateDatabaseMetadata>
450        {
451            type Operation = lro::internal::Operation<
452                crate::model::Database,
453                crate::model::UpdateDatabaseMetadata,
454            >;
455            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
456            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
457
458            let stub = self.0.stub.clone();
459            let mut options = self.0.options.clone();
460            options.set_retry_policy(gax::retry_policy::NeverRetry);
461            let query = move |name| {
462                let stub = stub.clone();
463                let options = options.clone();
464                async {
465                    let op = GetOperation::new(stub)
466                        .set_name(name)
467                        .with_options(options)
468                        .send()
469                        .await?;
470                    Ok(Operation::new(op))
471                }
472            };
473
474            let start = move || async {
475                let op = self.send().await?;
476                Ok(Operation::new(op))
477            };
478
479            lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
480        }
481
482        /// Sets the value of [database][crate::model::UpdateDatabaseRequest::database].
483        ///
484        /// This is a **required** field for requests.
485        pub fn set_database<T>(mut self, v: T) -> Self
486        where
487            T: std::convert::Into<crate::model::Database>,
488        {
489            self.0.request.database = std::option::Option::Some(v.into());
490            self
491        }
492
493        /// Sets or clears the value of [database][crate::model::UpdateDatabaseRequest::database].
494        ///
495        /// This is a **required** field for requests.
496        pub fn set_or_clear_database<T>(mut self, v: std::option::Option<T>) -> Self
497        where
498            T: std::convert::Into<crate::model::Database>,
499        {
500            self.0.request.database = v.map(|x| x.into());
501            self
502        }
503
504        /// Sets the value of [update_mask][crate::model::UpdateDatabaseRequest::update_mask].
505        ///
506        /// This is a **required** field for requests.
507        pub fn set_update_mask<T>(mut self, v: T) -> Self
508        where
509            T: std::convert::Into<wkt::FieldMask>,
510        {
511            self.0.request.update_mask = std::option::Option::Some(v.into());
512            self
513        }
514
515        /// Sets or clears the value of [update_mask][crate::model::UpdateDatabaseRequest::update_mask].
516        ///
517        /// This is a **required** field for requests.
518        pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
519        where
520            T: std::convert::Into<wkt::FieldMask>,
521        {
522            self.0.request.update_mask = v.map(|x| x.into());
523            self
524        }
525    }
526
527    #[doc(hidden)]
528    impl gax::options::internal::RequestBuilder for UpdateDatabase {
529        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
530            &mut self.0.options
531        }
532    }
533
534    /// The request builder for [DatabaseAdmin::update_database_ddl][crate::client::DatabaseAdmin::update_database_ddl] calls.
535    ///
536    /// # Example
537    /// ```
538    /// # use google_cloud_spanner_admin_database_v1::builder::database_admin::UpdateDatabaseDdl;
539    /// # async fn sample() -> gax::Result<()> {
540    /// use lro::Poller;
541    ///
542    /// let builder = prepare_request_builder();
543    /// let response = builder.poller().until_done().await?;
544    /// # Ok(()) }
545    ///
546    /// fn prepare_request_builder() -> UpdateDatabaseDdl {
547    ///   # panic!();
548    ///   // ... details omitted ...
549    /// }
550    /// ```
551    #[derive(Clone, Debug)]
552    pub struct UpdateDatabaseDdl(RequestBuilder<crate::model::UpdateDatabaseDdlRequest>);
553
554    impl UpdateDatabaseDdl {
555        pub(crate) fn new(
556            stub: std::sync::Arc<dyn super::super::stub::dynamic::DatabaseAdmin>,
557        ) -> Self {
558            Self(RequestBuilder::new(stub))
559        }
560
561        /// Sets the full request, replacing any prior values.
562        pub fn with_request<V: Into<crate::model::UpdateDatabaseDdlRequest>>(
563            mut self,
564            v: V,
565        ) -> Self {
566            self.0.request = v.into();
567            self
568        }
569
570        /// Sets all the options, replacing any prior values.
571        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
572            self.0.options = v.into();
573            self
574        }
575
576        /// Sends the request.
577        ///
578        /// # Long running operations
579        ///
580        /// This starts, but does not poll, a longrunning operation. More information
581        /// on [update_database_ddl][crate::client::DatabaseAdmin::update_database_ddl].
582        pub async fn send(self) -> Result<longrunning::model::Operation> {
583            (*self.0.stub)
584                .update_database_ddl(self.0.request, self.0.options)
585                .await
586                .map(gax::response::Response::into_body)
587        }
588
589        /// Creates a [Poller][lro::Poller] to work with `update_database_ddl`.
590        pub fn poller(self) -> impl lro::Poller<(), crate::model::UpdateDatabaseDdlMetadata> {
591            type Operation =
592                lro::internal::Operation<wkt::Empty, crate::model::UpdateDatabaseDdlMetadata>;
593            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
594            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
595
596            let stub = self.0.stub.clone();
597            let mut options = self.0.options.clone();
598            options.set_retry_policy(gax::retry_policy::NeverRetry);
599            let query = move |name| {
600                let stub = stub.clone();
601                let options = options.clone();
602                async {
603                    let op = GetOperation::new(stub)
604                        .set_name(name)
605                        .with_options(options)
606                        .send()
607                        .await?;
608                    Ok(Operation::new(op))
609                }
610            };
611
612            let start = move || async {
613                let op = self.send().await?;
614                Ok(Operation::new(op))
615            };
616
617            lro::internal::new_unit_response_poller(
618                polling_error_policy,
619                polling_backoff_policy,
620                start,
621                query,
622            )
623        }
624
625        /// Sets the value of [database][crate::model::UpdateDatabaseDdlRequest::database].
626        ///
627        /// This is a **required** field for requests.
628        pub fn set_database<T: Into<std::string::String>>(mut self, v: T) -> Self {
629            self.0.request.database = v.into();
630            self
631        }
632
633        /// Sets the value of [statements][crate::model::UpdateDatabaseDdlRequest::statements].
634        ///
635        /// This is a **required** field for requests.
636        pub fn set_statements<T, V>(mut self, v: T) -> Self
637        where
638            T: std::iter::IntoIterator<Item = V>,
639            V: std::convert::Into<std::string::String>,
640        {
641            use std::iter::Iterator;
642            self.0.request.statements = v.into_iter().map(|i| i.into()).collect();
643            self
644        }
645
646        /// Sets the value of [operation_id][crate::model::UpdateDatabaseDdlRequest::operation_id].
647        pub fn set_operation_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
648            self.0.request.operation_id = v.into();
649            self
650        }
651
652        /// Sets the value of [proto_descriptors][crate::model::UpdateDatabaseDdlRequest::proto_descriptors].
653        pub fn set_proto_descriptors<T: Into<::bytes::Bytes>>(mut self, v: T) -> Self {
654            self.0.request.proto_descriptors = v.into();
655            self
656        }
657
658        /// Sets the value of [throughput_mode][crate::model::UpdateDatabaseDdlRequest::throughput_mode].
659        pub fn set_throughput_mode<T: Into<bool>>(mut self, v: T) -> Self {
660            self.0.request.throughput_mode = v.into();
661            self
662        }
663    }
664
665    #[doc(hidden)]
666    impl gax::options::internal::RequestBuilder for UpdateDatabaseDdl {
667        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
668            &mut self.0.options
669        }
670    }
671
672    /// The request builder for [DatabaseAdmin::drop_database][crate::client::DatabaseAdmin::drop_database] calls.
673    ///
674    /// # Example
675    /// ```
676    /// # use google_cloud_spanner_admin_database_v1::builder::database_admin::DropDatabase;
677    /// # async fn sample() -> gax::Result<()> {
678    ///
679    /// let builder = prepare_request_builder();
680    /// let response = builder.send().await?;
681    /// # Ok(()) }
682    ///
683    /// fn prepare_request_builder() -> DropDatabase {
684    ///   # panic!();
685    ///   // ... details omitted ...
686    /// }
687    /// ```
688    #[derive(Clone, Debug)]
689    pub struct DropDatabase(RequestBuilder<crate::model::DropDatabaseRequest>);
690
691    impl DropDatabase {
692        pub(crate) fn new(
693            stub: std::sync::Arc<dyn super::super::stub::dynamic::DatabaseAdmin>,
694        ) -> Self {
695            Self(RequestBuilder::new(stub))
696        }
697
698        /// Sets the full request, replacing any prior values.
699        pub fn with_request<V: Into<crate::model::DropDatabaseRequest>>(mut self, v: V) -> Self {
700            self.0.request = v.into();
701            self
702        }
703
704        /// Sets all the options, replacing any prior values.
705        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
706            self.0.options = v.into();
707            self
708        }
709
710        /// Sends the request.
711        pub async fn send(self) -> Result<()> {
712            (*self.0.stub)
713                .drop_database(self.0.request, self.0.options)
714                .await
715                .map(gax::response::Response::into_body)
716        }
717
718        /// Sets the value of [database][crate::model::DropDatabaseRequest::database].
719        ///
720        /// This is a **required** field for requests.
721        pub fn set_database<T: Into<std::string::String>>(mut self, v: T) -> Self {
722            self.0.request.database = v.into();
723            self
724        }
725    }
726
727    #[doc(hidden)]
728    impl gax::options::internal::RequestBuilder for DropDatabase {
729        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
730            &mut self.0.options
731        }
732    }
733
734    /// The request builder for [DatabaseAdmin::get_database_ddl][crate::client::DatabaseAdmin::get_database_ddl] calls.
735    ///
736    /// # Example
737    /// ```
738    /// # use google_cloud_spanner_admin_database_v1::builder::database_admin::GetDatabaseDdl;
739    /// # async fn sample() -> gax::Result<()> {
740    ///
741    /// let builder = prepare_request_builder();
742    /// let response = builder.send().await?;
743    /// # Ok(()) }
744    ///
745    /// fn prepare_request_builder() -> GetDatabaseDdl {
746    ///   # panic!();
747    ///   // ... details omitted ...
748    /// }
749    /// ```
750    #[derive(Clone, Debug)]
751    pub struct GetDatabaseDdl(RequestBuilder<crate::model::GetDatabaseDdlRequest>);
752
753    impl GetDatabaseDdl {
754        pub(crate) fn new(
755            stub: std::sync::Arc<dyn super::super::stub::dynamic::DatabaseAdmin>,
756        ) -> Self {
757            Self(RequestBuilder::new(stub))
758        }
759
760        /// Sets the full request, replacing any prior values.
761        pub fn with_request<V: Into<crate::model::GetDatabaseDdlRequest>>(mut self, v: V) -> Self {
762            self.0.request = v.into();
763            self
764        }
765
766        /// Sets all the options, replacing any prior values.
767        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
768            self.0.options = v.into();
769            self
770        }
771
772        /// Sends the request.
773        pub async fn send(self) -> Result<crate::model::GetDatabaseDdlResponse> {
774            (*self.0.stub)
775                .get_database_ddl(self.0.request, self.0.options)
776                .await
777                .map(gax::response::Response::into_body)
778        }
779
780        /// Sets the value of [database][crate::model::GetDatabaseDdlRequest::database].
781        ///
782        /// This is a **required** field for requests.
783        pub fn set_database<T: Into<std::string::String>>(mut self, v: T) -> Self {
784            self.0.request.database = v.into();
785            self
786        }
787    }
788
789    #[doc(hidden)]
790    impl gax::options::internal::RequestBuilder for GetDatabaseDdl {
791        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
792            &mut self.0.options
793        }
794    }
795
796    /// The request builder for [DatabaseAdmin::set_iam_policy][crate::client::DatabaseAdmin::set_iam_policy] calls.
797    ///
798    /// # Example
799    /// ```
800    /// # use google_cloud_spanner_admin_database_v1::builder::database_admin::SetIamPolicy;
801    /// # async fn sample() -> gax::Result<()> {
802    ///
803    /// let builder = prepare_request_builder();
804    /// let response = builder.send().await?;
805    /// # Ok(()) }
806    ///
807    /// fn prepare_request_builder() -> SetIamPolicy {
808    ///   # panic!();
809    ///   // ... details omitted ...
810    /// }
811    /// ```
812    #[derive(Clone, Debug)]
813    pub struct SetIamPolicy(RequestBuilder<iam_v1::model::SetIamPolicyRequest>);
814
815    impl SetIamPolicy {
816        pub(crate) fn new(
817            stub: std::sync::Arc<dyn super::super::stub::dynamic::DatabaseAdmin>,
818        ) -> Self {
819            Self(RequestBuilder::new(stub))
820        }
821
822        /// Sets the full request, replacing any prior values.
823        pub fn with_request<V: Into<iam_v1::model::SetIamPolicyRequest>>(mut self, v: V) -> Self {
824            self.0.request = v.into();
825            self
826        }
827
828        /// Sets all the options, replacing any prior values.
829        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
830            self.0.options = v.into();
831            self
832        }
833
834        /// Sends the request.
835        pub async fn send(self) -> Result<iam_v1::model::Policy> {
836            (*self.0.stub)
837                .set_iam_policy(self.0.request, self.0.options)
838                .await
839                .map(gax::response::Response::into_body)
840        }
841
842        /// Sets the value of [resource][iam_v1::model::SetIamPolicyRequest::resource].
843        ///
844        /// This is a **required** field for requests.
845        pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
846            self.0.request.resource = v.into();
847            self
848        }
849
850        /// Sets the value of [policy][iam_v1::model::SetIamPolicyRequest::policy].
851        ///
852        /// This is a **required** field for requests.
853        pub fn set_policy<T>(mut self, v: T) -> Self
854        where
855            T: std::convert::Into<iam_v1::model::Policy>,
856        {
857            self.0.request.policy = std::option::Option::Some(v.into());
858            self
859        }
860
861        /// Sets or clears the value of [policy][iam_v1::model::SetIamPolicyRequest::policy].
862        ///
863        /// This is a **required** field for requests.
864        pub fn set_or_clear_policy<T>(mut self, v: std::option::Option<T>) -> Self
865        where
866            T: std::convert::Into<iam_v1::model::Policy>,
867        {
868            self.0.request.policy = v.map(|x| x.into());
869            self
870        }
871
872        /// Sets the value of [update_mask][iam_v1::model::SetIamPolicyRequest::update_mask].
873        pub fn set_update_mask<T>(mut self, v: T) -> Self
874        where
875            T: std::convert::Into<wkt::FieldMask>,
876        {
877            self.0.request.update_mask = std::option::Option::Some(v.into());
878            self
879        }
880
881        /// Sets or clears the value of [update_mask][iam_v1::model::SetIamPolicyRequest::update_mask].
882        pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
883        where
884            T: std::convert::Into<wkt::FieldMask>,
885        {
886            self.0.request.update_mask = v.map(|x| x.into());
887            self
888        }
889    }
890
891    #[doc(hidden)]
892    impl gax::options::internal::RequestBuilder for SetIamPolicy {
893        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
894            &mut self.0.options
895        }
896    }
897
898    /// The request builder for [DatabaseAdmin::get_iam_policy][crate::client::DatabaseAdmin::get_iam_policy] calls.
899    ///
900    /// # Example
901    /// ```
902    /// # use google_cloud_spanner_admin_database_v1::builder::database_admin::GetIamPolicy;
903    /// # async fn sample() -> gax::Result<()> {
904    ///
905    /// let builder = prepare_request_builder();
906    /// let response = builder.send().await?;
907    /// # Ok(()) }
908    ///
909    /// fn prepare_request_builder() -> GetIamPolicy {
910    ///   # panic!();
911    ///   // ... details omitted ...
912    /// }
913    /// ```
914    #[derive(Clone, Debug)]
915    pub struct GetIamPolicy(RequestBuilder<iam_v1::model::GetIamPolicyRequest>);
916
917    impl GetIamPolicy {
918        pub(crate) fn new(
919            stub: std::sync::Arc<dyn super::super::stub::dynamic::DatabaseAdmin>,
920        ) -> Self {
921            Self(RequestBuilder::new(stub))
922        }
923
924        /// Sets the full request, replacing any prior values.
925        pub fn with_request<V: Into<iam_v1::model::GetIamPolicyRequest>>(mut self, v: V) -> Self {
926            self.0.request = v.into();
927            self
928        }
929
930        /// Sets all the options, replacing any prior values.
931        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
932            self.0.options = v.into();
933            self
934        }
935
936        /// Sends the request.
937        pub async fn send(self) -> Result<iam_v1::model::Policy> {
938            (*self.0.stub)
939                .get_iam_policy(self.0.request, self.0.options)
940                .await
941                .map(gax::response::Response::into_body)
942        }
943
944        /// Sets the value of [resource][iam_v1::model::GetIamPolicyRequest::resource].
945        ///
946        /// This is a **required** field for requests.
947        pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
948            self.0.request.resource = v.into();
949            self
950        }
951
952        /// Sets the value of [options][iam_v1::model::GetIamPolicyRequest::options].
953        pub fn set_options<T>(mut self, v: T) -> Self
954        where
955            T: std::convert::Into<iam_v1::model::GetPolicyOptions>,
956        {
957            self.0.request.options = std::option::Option::Some(v.into());
958            self
959        }
960
961        /// Sets or clears the value of [options][iam_v1::model::GetIamPolicyRequest::options].
962        pub fn set_or_clear_options<T>(mut self, v: std::option::Option<T>) -> Self
963        where
964            T: std::convert::Into<iam_v1::model::GetPolicyOptions>,
965        {
966            self.0.request.options = v.map(|x| x.into());
967            self
968        }
969    }
970
971    #[doc(hidden)]
972    impl gax::options::internal::RequestBuilder for GetIamPolicy {
973        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
974            &mut self.0.options
975        }
976    }
977
978    /// The request builder for [DatabaseAdmin::test_iam_permissions][crate::client::DatabaseAdmin::test_iam_permissions] calls.
979    ///
980    /// # Example
981    /// ```
982    /// # use google_cloud_spanner_admin_database_v1::builder::database_admin::TestIamPermissions;
983    /// # async fn sample() -> gax::Result<()> {
984    ///
985    /// let builder = prepare_request_builder();
986    /// let response = builder.send().await?;
987    /// # Ok(()) }
988    ///
989    /// fn prepare_request_builder() -> TestIamPermissions {
990    ///   # panic!();
991    ///   // ... details omitted ...
992    /// }
993    /// ```
994    #[derive(Clone, Debug)]
995    pub struct TestIamPermissions(RequestBuilder<iam_v1::model::TestIamPermissionsRequest>);
996
997    impl TestIamPermissions {
998        pub(crate) fn new(
999            stub: std::sync::Arc<dyn super::super::stub::dynamic::DatabaseAdmin>,
1000        ) -> Self {
1001            Self(RequestBuilder::new(stub))
1002        }
1003
1004        /// Sets the full request, replacing any prior values.
1005        pub fn with_request<V: Into<iam_v1::model::TestIamPermissionsRequest>>(
1006            mut self,
1007            v: V,
1008        ) -> Self {
1009            self.0.request = v.into();
1010            self
1011        }
1012
1013        /// Sets all the options, replacing any prior values.
1014        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1015            self.0.options = v.into();
1016            self
1017        }
1018
1019        /// Sends the request.
1020        pub async fn send(self) -> Result<iam_v1::model::TestIamPermissionsResponse> {
1021            (*self.0.stub)
1022                .test_iam_permissions(self.0.request, self.0.options)
1023                .await
1024                .map(gax::response::Response::into_body)
1025        }
1026
1027        /// Sets the value of [resource][iam_v1::model::TestIamPermissionsRequest::resource].
1028        ///
1029        /// This is a **required** field for requests.
1030        pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
1031            self.0.request.resource = v.into();
1032            self
1033        }
1034
1035        /// Sets the value of [permissions][iam_v1::model::TestIamPermissionsRequest::permissions].
1036        ///
1037        /// This is a **required** field for requests.
1038        pub fn set_permissions<T, V>(mut self, v: T) -> Self
1039        where
1040            T: std::iter::IntoIterator<Item = V>,
1041            V: std::convert::Into<std::string::String>,
1042        {
1043            use std::iter::Iterator;
1044            self.0.request.permissions = v.into_iter().map(|i| i.into()).collect();
1045            self
1046        }
1047    }
1048
1049    #[doc(hidden)]
1050    impl gax::options::internal::RequestBuilder for TestIamPermissions {
1051        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1052            &mut self.0.options
1053        }
1054    }
1055
1056    /// The request builder for [DatabaseAdmin::create_backup][crate::client::DatabaseAdmin::create_backup] calls.
1057    ///
1058    /// # Example
1059    /// ```
1060    /// # use google_cloud_spanner_admin_database_v1::builder::database_admin::CreateBackup;
1061    /// # async fn sample() -> gax::Result<()> {
1062    /// use lro::Poller;
1063    ///
1064    /// let builder = prepare_request_builder();
1065    /// let response = builder.poller().until_done().await?;
1066    /// # Ok(()) }
1067    ///
1068    /// fn prepare_request_builder() -> CreateBackup {
1069    ///   # panic!();
1070    ///   // ... details omitted ...
1071    /// }
1072    /// ```
1073    #[derive(Clone, Debug)]
1074    pub struct CreateBackup(RequestBuilder<crate::model::CreateBackupRequest>);
1075
1076    impl CreateBackup {
1077        pub(crate) fn new(
1078            stub: std::sync::Arc<dyn super::super::stub::dynamic::DatabaseAdmin>,
1079        ) -> Self {
1080            Self(RequestBuilder::new(stub))
1081        }
1082
1083        /// Sets the full request, replacing any prior values.
1084        pub fn with_request<V: Into<crate::model::CreateBackupRequest>>(mut self, v: V) -> Self {
1085            self.0.request = v.into();
1086            self
1087        }
1088
1089        /// Sets all the options, replacing any prior values.
1090        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1091            self.0.options = v.into();
1092            self
1093        }
1094
1095        /// Sends the request.
1096        ///
1097        /// # Long running operations
1098        ///
1099        /// This starts, but does not poll, a longrunning operation. More information
1100        /// on [create_backup][crate::client::DatabaseAdmin::create_backup].
1101        pub async fn send(self) -> Result<longrunning::model::Operation> {
1102            (*self.0.stub)
1103                .create_backup(self.0.request, self.0.options)
1104                .await
1105                .map(gax::response::Response::into_body)
1106        }
1107
1108        /// Creates a [Poller][lro::Poller] to work with `create_backup`.
1109        pub fn poller(
1110            self,
1111        ) -> impl lro::Poller<crate::model::Backup, crate::model::CreateBackupMetadata> {
1112            type Operation =
1113                lro::internal::Operation<crate::model::Backup, crate::model::CreateBackupMetadata>;
1114            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
1115            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
1116
1117            let stub = self.0.stub.clone();
1118            let mut options = self.0.options.clone();
1119            options.set_retry_policy(gax::retry_policy::NeverRetry);
1120            let query = move |name| {
1121                let stub = stub.clone();
1122                let options = options.clone();
1123                async {
1124                    let op = GetOperation::new(stub)
1125                        .set_name(name)
1126                        .with_options(options)
1127                        .send()
1128                        .await?;
1129                    Ok(Operation::new(op))
1130                }
1131            };
1132
1133            let start = move || async {
1134                let op = self.send().await?;
1135                Ok(Operation::new(op))
1136            };
1137
1138            lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
1139        }
1140
1141        /// Sets the value of [parent][crate::model::CreateBackupRequest::parent].
1142        ///
1143        /// This is a **required** field for requests.
1144        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
1145            self.0.request.parent = v.into();
1146            self
1147        }
1148
1149        /// Sets the value of [backup_id][crate::model::CreateBackupRequest::backup_id].
1150        ///
1151        /// This is a **required** field for requests.
1152        pub fn set_backup_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
1153            self.0.request.backup_id = v.into();
1154            self
1155        }
1156
1157        /// Sets the value of [backup][crate::model::CreateBackupRequest::backup].
1158        ///
1159        /// This is a **required** field for requests.
1160        pub fn set_backup<T>(mut self, v: T) -> Self
1161        where
1162            T: std::convert::Into<crate::model::Backup>,
1163        {
1164            self.0.request.backup = std::option::Option::Some(v.into());
1165            self
1166        }
1167
1168        /// Sets or clears the value of [backup][crate::model::CreateBackupRequest::backup].
1169        ///
1170        /// This is a **required** field for requests.
1171        pub fn set_or_clear_backup<T>(mut self, v: std::option::Option<T>) -> Self
1172        where
1173            T: std::convert::Into<crate::model::Backup>,
1174        {
1175            self.0.request.backup = v.map(|x| x.into());
1176            self
1177        }
1178
1179        /// Sets the value of [encryption_config][crate::model::CreateBackupRequest::encryption_config].
1180        pub fn set_encryption_config<T>(mut self, v: T) -> Self
1181        where
1182            T: std::convert::Into<crate::model::CreateBackupEncryptionConfig>,
1183        {
1184            self.0.request.encryption_config = std::option::Option::Some(v.into());
1185            self
1186        }
1187
1188        /// Sets or clears the value of [encryption_config][crate::model::CreateBackupRequest::encryption_config].
1189        pub fn set_or_clear_encryption_config<T>(mut self, v: std::option::Option<T>) -> Self
1190        where
1191            T: std::convert::Into<crate::model::CreateBackupEncryptionConfig>,
1192        {
1193            self.0.request.encryption_config = v.map(|x| x.into());
1194            self
1195        }
1196    }
1197
1198    #[doc(hidden)]
1199    impl gax::options::internal::RequestBuilder for CreateBackup {
1200        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1201            &mut self.0.options
1202        }
1203    }
1204
1205    /// The request builder for [DatabaseAdmin::copy_backup][crate::client::DatabaseAdmin::copy_backup] calls.
1206    ///
1207    /// # Example
1208    /// ```
1209    /// # use google_cloud_spanner_admin_database_v1::builder::database_admin::CopyBackup;
1210    /// # async fn sample() -> gax::Result<()> {
1211    /// use lro::Poller;
1212    ///
1213    /// let builder = prepare_request_builder();
1214    /// let response = builder.poller().until_done().await?;
1215    /// # Ok(()) }
1216    ///
1217    /// fn prepare_request_builder() -> CopyBackup {
1218    ///   # panic!();
1219    ///   // ... details omitted ...
1220    /// }
1221    /// ```
1222    #[derive(Clone, Debug)]
1223    pub struct CopyBackup(RequestBuilder<crate::model::CopyBackupRequest>);
1224
1225    impl CopyBackup {
1226        pub(crate) fn new(
1227            stub: std::sync::Arc<dyn super::super::stub::dynamic::DatabaseAdmin>,
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::CopyBackupRequest>>(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        ///
1246        /// # Long running operations
1247        ///
1248        /// This starts, but does not poll, a longrunning operation. More information
1249        /// on [copy_backup][crate::client::DatabaseAdmin::copy_backup].
1250        pub async fn send(self) -> Result<longrunning::model::Operation> {
1251            (*self.0.stub)
1252                .copy_backup(self.0.request, self.0.options)
1253                .await
1254                .map(gax::response::Response::into_body)
1255        }
1256
1257        /// Creates a [Poller][lro::Poller] to work with `copy_backup`.
1258        pub fn poller(
1259            self,
1260        ) -> impl lro::Poller<crate::model::Backup, crate::model::CopyBackupMetadata> {
1261            type Operation =
1262                lro::internal::Operation<crate::model::Backup, crate::model::CopyBackupMetadata>;
1263            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
1264            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
1265
1266            let stub = self.0.stub.clone();
1267            let mut options = self.0.options.clone();
1268            options.set_retry_policy(gax::retry_policy::NeverRetry);
1269            let query = move |name| {
1270                let stub = stub.clone();
1271                let options = options.clone();
1272                async {
1273                    let op = GetOperation::new(stub)
1274                        .set_name(name)
1275                        .with_options(options)
1276                        .send()
1277                        .await?;
1278                    Ok(Operation::new(op))
1279                }
1280            };
1281
1282            let start = move || async {
1283                let op = self.send().await?;
1284                Ok(Operation::new(op))
1285            };
1286
1287            lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
1288        }
1289
1290        /// Sets the value of [parent][crate::model::CopyBackupRequest::parent].
1291        ///
1292        /// This is a **required** field for requests.
1293        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
1294            self.0.request.parent = v.into();
1295            self
1296        }
1297
1298        /// Sets the value of [backup_id][crate::model::CopyBackupRequest::backup_id].
1299        ///
1300        /// This is a **required** field for requests.
1301        pub fn set_backup_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
1302            self.0.request.backup_id = v.into();
1303            self
1304        }
1305
1306        /// Sets the value of [source_backup][crate::model::CopyBackupRequest::source_backup].
1307        ///
1308        /// This is a **required** field for requests.
1309        pub fn set_source_backup<T: Into<std::string::String>>(mut self, v: T) -> Self {
1310            self.0.request.source_backup = v.into();
1311            self
1312        }
1313
1314        /// Sets the value of [expire_time][crate::model::CopyBackupRequest::expire_time].
1315        ///
1316        /// This is a **required** field for requests.
1317        pub fn set_expire_time<T>(mut self, v: T) -> Self
1318        where
1319            T: std::convert::Into<wkt::Timestamp>,
1320        {
1321            self.0.request.expire_time = std::option::Option::Some(v.into());
1322            self
1323        }
1324
1325        /// Sets or clears the value of [expire_time][crate::model::CopyBackupRequest::expire_time].
1326        ///
1327        /// This is a **required** field for requests.
1328        pub fn set_or_clear_expire_time<T>(mut self, v: std::option::Option<T>) -> Self
1329        where
1330            T: std::convert::Into<wkt::Timestamp>,
1331        {
1332            self.0.request.expire_time = v.map(|x| x.into());
1333            self
1334        }
1335
1336        /// Sets the value of [encryption_config][crate::model::CopyBackupRequest::encryption_config].
1337        pub fn set_encryption_config<T>(mut self, v: T) -> Self
1338        where
1339            T: std::convert::Into<crate::model::CopyBackupEncryptionConfig>,
1340        {
1341            self.0.request.encryption_config = std::option::Option::Some(v.into());
1342            self
1343        }
1344
1345        /// Sets or clears the value of [encryption_config][crate::model::CopyBackupRequest::encryption_config].
1346        pub fn set_or_clear_encryption_config<T>(mut self, v: std::option::Option<T>) -> Self
1347        where
1348            T: std::convert::Into<crate::model::CopyBackupEncryptionConfig>,
1349        {
1350            self.0.request.encryption_config = v.map(|x| x.into());
1351            self
1352        }
1353    }
1354
1355    #[doc(hidden)]
1356    impl gax::options::internal::RequestBuilder for CopyBackup {
1357        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1358            &mut self.0.options
1359        }
1360    }
1361
1362    /// The request builder for [DatabaseAdmin::get_backup][crate::client::DatabaseAdmin::get_backup] calls.
1363    ///
1364    /// # Example
1365    /// ```
1366    /// # use google_cloud_spanner_admin_database_v1::builder::database_admin::GetBackup;
1367    /// # async fn sample() -> gax::Result<()> {
1368    ///
1369    /// let builder = prepare_request_builder();
1370    /// let response = builder.send().await?;
1371    /// # Ok(()) }
1372    ///
1373    /// fn prepare_request_builder() -> GetBackup {
1374    ///   # panic!();
1375    ///   // ... details omitted ...
1376    /// }
1377    /// ```
1378    #[derive(Clone, Debug)]
1379    pub struct GetBackup(RequestBuilder<crate::model::GetBackupRequest>);
1380
1381    impl GetBackup {
1382        pub(crate) fn new(
1383            stub: std::sync::Arc<dyn super::super::stub::dynamic::DatabaseAdmin>,
1384        ) -> Self {
1385            Self(RequestBuilder::new(stub))
1386        }
1387
1388        /// Sets the full request, replacing any prior values.
1389        pub fn with_request<V: Into<crate::model::GetBackupRequest>>(mut self, v: V) -> Self {
1390            self.0.request = v.into();
1391            self
1392        }
1393
1394        /// Sets all the options, replacing any prior values.
1395        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1396            self.0.options = v.into();
1397            self
1398        }
1399
1400        /// Sends the request.
1401        pub async fn send(self) -> Result<crate::model::Backup> {
1402            (*self.0.stub)
1403                .get_backup(self.0.request, self.0.options)
1404                .await
1405                .map(gax::response::Response::into_body)
1406        }
1407
1408        /// Sets the value of [name][crate::model::GetBackupRequest::name].
1409        ///
1410        /// This is a **required** field for requests.
1411        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1412            self.0.request.name = v.into();
1413            self
1414        }
1415    }
1416
1417    #[doc(hidden)]
1418    impl gax::options::internal::RequestBuilder for GetBackup {
1419        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1420            &mut self.0.options
1421        }
1422    }
1423
1424    /// The request builder for [DatabaseAdmin::update_backup][crate::client::DatabaseAdmin::update_backup] calls.
1425    ///
1426    /// # Example
1427    /// ```
1428    /// # use google_cloud_spanner_admin_database_v1::builder::database_admin::UpdateBackup;
1429    /// # async fn sample() -> gax::Result<()> {
1430    ///
1431    /// let builder = prepare_request_builder();
1432    /// let response = builder.send().await?;
1433    /// # Ok(()) }
1434    ///
1435    /// fn prepare_request_builder() -> UpdateBackup {
1436    ///   # panic!();
1437    ///   // ... details omitted ...
1438    /// }
1439    /// ```
1440    #[derive(Clone, Debug)]
1441    pub struct UpdateBackup(RequestBuilder<crate::model::UpdateBackupRequest>);
1442
1443    impl UpdateBackup {
1444        pub(crate) fn new(
1445            stub: std::sync::Arc<dyn super::super::stub::dynamic::DatabaseAdmin>,
1446        ) -> Self {
1447            Self(RequestBuilder::new(stub))
1448        }
1449
1450        /// Sets the full request, replacing any prior values.
1451        pub fn with_request<V: Into<crate::model::UpdateBackupRequest>>(mut self, v: V) -> Self {
1452            self.0.request = v.into();
1453            self
1454        }
1455
1456        /// Sets all the options, replacing any prior values.
1457        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1458            self.0.options = v.into();
1459            self
1460        }
1461
1462        /// Sends the request.
1463        pub async fn send(self) -> Result<crate::model::Backup> {
1464            (*self.0.stub)
1465                .update_backup(self.0.request, self.0.options)
1466                .await
1467                .map(gax::response::Response::into_body)
1468        }
1469
1470        /// Sets the value of [backup][crate::model::UpdateBackupRequest::backup].
1471        ///
1472        /// This is a **required** field for requests.
1473        pub fn set_backup<T>(mut self, v: T) -> Self
1474        where
1475            T: std::convert::Into<crate::model::Backup>,
1476        {
1477            self.0.request.backup = std::option::Option::Some(v.into());
1478            self
1479        }
1480
1481        /// Sets or clears the value of [backup][crate::model::UpdateBackupRequest::backup].
1482        ///
1483        /// This is a **required** field for requests.
1484        pub fn set_or_clear_backup<T>(mut self, v: std::option::Option<T>) -> Self
1485        where
1486            T: std::convert::Into<crate::model::Backup>,
1487        {
1488            self.0.request.backup = v.map(|x| x.into());
1489            self
1490        }
1491
1492        /// Sets the value of [update_mask][crate::model::UpdateBackupRequest::update_mask].
1493        ///
1494        /// This is a **required** field for requests.
1495        pub fn set_update_mask<T>(mut self, v: T) -> Self
1496        where
1497            T: std::convert::Into<wkt::FieldMask>,
1498        {
1499            self.0.request.update_mask = std::option::Option::Some(v.into());
1500            self
1501        }
1502
1503        /// Sets or clears the value of [update_mask][crate::model::UpdateBackupRequest::update_mask].
1504        ///
1505        /// This is a **required** field for requests.
1506        pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
1507        where
1508            T: std::convert::Into<wkt::FieldMask>,
1509        {
1510            self.0.request.update_mask = v.map(|x| x.into());
1511            self
1512        }
1513    }
1514
1515    #[doc(hidden)]
1516    impl gax::options::internal::RequestBuilder for UpdateBackup {
1517        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1518            &mut self.0.options
1519        }
1520    }
1521
1522    /// The request builder for [DatabaseAdmin::delete_backup][crate::client::DatabaseAdmin::delete_backup] calls.
1523    ///
1524    /// # Example
1525    /// ```
1526    /// # use google_cloud_spanner_admin_database_v1::builder::database_admin::DeleteBackup;
1527    /// # async fn sample() -> gax::Result<()> {
1528    ///
1529    /// let builder = prepare_request_builder();
1530    /// let response = builder.send().await?;
1531    /// # Ok(()) }
1532    ///
1533    /// fn prepare_request_builder() -> DeleteBackup {
1534    ///   # panic!();
1535    ///   // ... details omitted ...
1536    /// }
1537    /// ```
1538    #[derive(Clone, Debug)]
1539    pub struct DeleteBackup(RequestBuilder<crate::model::DeleteBackupRequest>);
1540
1541    impl DeleteBackup {
1542        pub(crate) fn new(
1543            stub: std::sync::Arc<dyn super::super::stub::dynamic::DatabaseAdmin>,
1544        ) -> Self {
1545            Self(RequestBuilder::new(stub))
1546        }
1547
1548        /// Sets the full request, replacing any prior values.
1549        pub fn with_request<V: Into<crate::model::DeleteBackupRequest>>(mut self, v: V) -> Self {
1550            self.0.request = v.into();
1551            self
1552        }
1553
1554        /// Sets all the options, replacing any prior values.
1555        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1556            self.0.options = v.into();
1557            self
1558        }
1559
1560        /// Sends the request.
1561        pub async fn send(self) -> Result<()> {
1562            (*self.0.stub)
1563                .delete_backup(self.0.request, self.0.options)
1564                .await
1565                .map(gax::response::Response::into_body)
1566        }
1567
1568        /// Sets the value of [name][crate::model::DeleteBackupRequest::name].
1569        ///
1570        /// This is a **required** field for requests.
1571        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1572            self.0.request.name = v.into();
1573            self
1574        }
1575    }
1576
1577    #[doc(hidden)]
1578    impl gax::options::internal::RequestBuilder for DeleteBackup {
1579        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1580            &mut self.0.options
1581        }
1582    }
1583
1584    /// The request builder for [DatabaseAdmin::list_backups][crate::client::DatabaseAdmin::list_backups] calls.
1585    ///
1586    /// # Example
1587    /// ```
1588    /// # use google_cloud_spanner_admin_database_v1::builder::database_admin::ListBackups;
1589    /// # async fn sample() -> gax::Result<()> {
1590    /// use gax::paginator::ItemPaginator;
1591    ///
1592    /// let builder = prepare_request_builder();
1593    /// let mut items = builder.by_item();
1594    /// while let Some(result) = items.next().await {
1595    ///   let item = result?;
1596    /// }
1597    /// # Ok(()) }
1598    ///
1599    /// fn prepare_request_builder() -> ListBackups {
1600    ///   # panic!();
1601    ///   // ... details omitted ...
1602    /// }
1603    /// ```
1604    #[derive(Clone, Debug)]
1605    pub struct ListBackups(RequestBuilder<crate::model::ListBackupsRequest>);
1606
1607    impl ListBackups {
1608        pub(crate) fn new(
1609            stub: std::sync::Arc<dyn super::super::stub::dynamic::DatabaseAdmin>,
1610        ) -> Self {
1611            Self(RequestBuilder::new(stub))
1612        }
1613
1614        /// Sets the full request, replacing any prior values.
1615        pub fn with_request<V: Into<crate::model::ListBackupsRequest>>(mut self, v: V) -> Self {
1616            self.0.request = v.into();
1617            self
1618        }
1619
1620        /// Sets all the options, replacing any prior values.
1621        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1622            self.0.options = v.into();
1623            self
1624        }
1625
1626        /// Sends the request.
1627        pub async fn send(self) -> Result<crate::model::ListBackupsResponse> {
1628            (*self.0.stub)
1629                .list_backups(self.0.request, self.0.options)
1630                .await
1631                .map(gax::response::Response::into_body)
1632        }
1633
1634        /// Streams each page in the collection.
1635        pub fn by_page(
1636            self,
1637        ) -> impl gax::paginator::Paginator<crate::model::ListBackupsResponse, gax::error::Error>
1638        {
1639            use std::clone::Clone;
1640            let token = self.0.request.page_token.clone();
1641            let execute = move |token: String| {
1642                let mut builder = self.clone();
1643                builder.0.request = builder.0.request.set_page_token(token);
1644                builder.send()
1645            };
1646            gax::paginator::internal::new_paginator(token, execute)
1647        }
1648
1649        /// Streams each item in the collection.
1650        pub fn by_item(
1651            self,
1652        ) -> impl gax::paginator::ItemPaginator<crate::model::ListBackupsResponse, gax::error::Error>
1653        {
1654            use gax::paginator::Paginator;
1655            self.by_page().items()
1656        }
1657
1658        /// Sets the value of [parent][crate::model::ListBackupsRequest::parent].
1659        ///
1660        /// This is a **required** field for requests.
1661        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
1662            self.0.request.parent = v.into();
1663            self
1664        }
1665
1666        /// Sets the value of [filter][crate::model::ListBackupsRequest::filter].
1667        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
1668            self.0.request.filter = v.into();
1669            self
1670        }
1671
1672        /// Sets the value of [page_size][crate::model::ListBackupsRequest::page_size].
1673        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
1674            self.0.request.page_size = v.into();
1675            self
1676        }
1677
1678        /// Sets the value of [page_token][crate::model::ListBackupsRequest::page_token].
1679        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
1680            self.0.request.page_token = v.into();
1681            self
1682        }
1683    }
1684
1685    #[doc(hidden)]
1686    impl gax::options::internal::RequestBuilder for ListBackups {
1687        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1688            &mut self.0.options
1689        }
1690    }
1691
1692    /// The request builder for [DatabaseAdmin::restore_database][crate::client::DatabaseAdmin::restore_database] calls.
1693    ///
1694    /// # Example
1695    /// ```
1696    /// # use google_cloud_spanner_admin_database_v1::builder::database_admin::RestoreDatabase;
1697    /// # async fn sample() -> gax::Result<()> {
1698    /// use lro::Poller;
1699    ///
1700    /// let builder = prepare_request_builder();
1701    /// let response = builder.poller().until_done().await?;
1702    /// # Ok(()) }
1703    ///
1704    /// fn prepare_request_builder() -> RestoreDatabase {
1705    ///   # panic!();
1706    ///   // ... details omitted ...
1707    /// }
1708    /// ```
1709    #[derive(Clone, Debug)]
1710    pub struct RestoreDatabase(RequestBuilder<crate::model::RestoreDatabaseRequest>);
1711
1712    impl RestoreDatabase {
1713        pub(crate) fn new(
1714            stub: std::sync::Arc<dyn super::super::stub::dynamic::DatabaseAdmin>,
1715        ) -> Self {
1716            Self(RequestBuilder::new(stub))
1717        }
1718
1719        /// Sets the full request, replacing any prior values.
1720        pub fn with_request<V: Into<crate::model::RestoreDatabaseRequest>>(mut self, v: V) -> Self {
1721            self.0.request = v.into();
1722            self
1723        }
1724
1725        /// Sets all the options, replacing any prior values.
1726        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1727            self.0.options = v.into();
1728            self
1729        }
1730
1731        /// Sends the request.
1732        ///
1733        /// # Long running operations
1734        ///
1735        /// This starts, but does not poll, a longrunning operation. More information
1736        /// on [restore_database][crate::client::DatabaseAdmin::restore_database].
1737        pub async fn send(self) -> Result<longrunning::model::Operation> {
1738            (*self.0.stub)
1739                .restore_database(self.0.request, self.0.options)
1740                .await
1741                .map(gax::response::Response::into_body)
1742        }
1743
1744        /// Creates a [Poller][lro::Poller] to work with `restore_database`.
1745        pub fn poller(
1746            self,
1747        ) -> impl lro::Poller<crate::model::Database, crate::model::RestoreDatabaseMetadata>
1748        {
1749            type Operation = lro::internal::Operation<
1750                crate::model::Database,
1751                crate::model::RestoreDatabaseMetadata,
1752            >;
1753            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
1754            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
1755
1756            let stub = self.0.stub.clone();
1757            let mut options = self.0.options.clone();
1758            options.set_retry_policy(gax::retry_policy::NeverRetry);
1759            let query = move |name| {
1760                let stub = stub.clone();
1761                let options = options.clone();
1762                async {
1763                    let op = GetOperation::new(stub)
1764                        .set_name(name)
1765                        .with_options(options)
1766                        .send()
1767                        .await?;
1768                    Ok(Operation::new(op))
1769                }
1770            };
1771
1772            let start = move || async {
1773                let op = self.send().await?;
1774                Ok(Operation::new(op))
1775            };
1776
1777            lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
1778        }
1779
1780        /// Sets the value of [parent][crate::model::RestoreDatabaseRequest::parent].
1781        ///
1782        /// This is a **required** field for requests.
1783        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
1784            self.0.request.parent = v.into();
1785            self
1786        }
1787
1788        /// Sets the value of [database_id][crate::model::RestoreDatabaseRequest::database_id].
1789        ///
1790        /// This is a **required** field for requests.
1791        pub fn set_database_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
1792            self.0.request.database_id = v.into();
1793            self
1794        }
1795
1796        /// Sets the value of [encryption_config][crate::model::RestoreDatabaseRequest::encryption_config].
1797        pub fn set_encryption_config<T>(mut self, v: T) -> Self
1798        where
1799            T: std::convert::Into<crate::model::RestoreDatabaseEncryptionConfig>,
1800        {
1801            self.0.request.encryption_config = std::option::Option::Some(v.into());
1802            self
1803        }
1804
1805        /// Sets or clears the value of [encryption_config][crate::model::RestoreDatabaseRequest::encryption_config].
1806        pub fn set_or_clear_encryption_config<T>(mut self, v: std::option::Option<T>) -> Self
1807        where
1808            T: std::convert::Into<crate::model::RestoreDatabaseEncryptionConfig>,
1809        {
1810            self.0.request.encryption_config = v.map(|x| x.into());
1811            self
1812        }
1813
1814        /// Sets the value of [source][crate::model::RestoreDatabaseRequest::source].
1815        ///
1816        /// Note that all the setters affecting `source` are
1817        /// mutually exclusive.
1818        pub fn set_source<T: Into<Option<crate::model::restore_database_request::Source>>>(
1819            mut self,
1820            v: T,
1821        ) -> Self {
1822            self.0.request.source = v.into();
1823            self
1824        }
1825
1826        /// Sets the value of [source][crate::model::RestoreDatabaseRequest::source]
1827        /// to hold a `Backup`.
1828        ///
1829        /// Note that all the setters affecting `source` are
1830        /// mutually exclusive.
1831        pub fn set_backup<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1832            self.0.request = self.0.request.set_backup(v);
1833            self
1834        }
1835    }
1836
1837    #[doc(hidden)]
1838    impl gax::options::internal::RequestBuilder for RestoreDatabase {
1839        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1840            &mut self.0.options
1841        }
1842    }
1843
1844    /// The request builder for [DatabaseAdmin::list_database_operations][crate::client::DatabaseAdmin::list_database_operations] calls.
1845    ///
1846    /// # Example
1847    /// ```
1848    /// # use google_cloud_spanner_admin_database_v1::builder::database_admin::ListDatabaseOperations;
1849    /// # async fn sample() -> gax::Result<()> {
1850    /// use gax::paginator::ItemPaginator;
1851    ///
1852    /// let builder = prepare_request_builder();
1853    /// let mut items = builder.by_item();
1854    /// while let Some(result) = items.next().await {
1855    ///   let item = result?;
1856    /// }
1857    /// # Ok(()) }
1858    ///
1859    /// fn prepare_request_builder() -> ListDatabaseOperations {
1860    ///   # panic!();
1861    ///   // ... details omitted ...
1862    /// }
1863    /// ```
1864    #[derive(Clone, Debug)]
1865    pub struct ListDatabaseOperations(RequestBuilder<crate::model::ListDatabaseOperationsRequest>);
1866
1867    impl ListDatabaseOperations {
1868        pub(crate) fn new(
1869            stub: std::sync::Arc<dyn super::super::stub::dynamic::DatabaseAdmin>,
1870        ) -> Self {
1871            Self(RequestBuilder::new(stub))
1872        }
1873
1874        /// Sets the full request, replacing any prior values.
1875        pub fn with_request<V: Into<crate::model::ListDatabaseOperationsRequest>>(
1876            mut self,
1877            v: V,
1878        ) -> Self {
1879            self.0.request = v.into();
1880            self
1881        }
1882
1883        /// Sets all the options, replacing any prior values.
1884        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1885            self.0.options = v.into();
1886            self
1887        }
1888
1889        /// Sends the request.
1890        pub async fn send(self) -> Result<crate::model::ListDatabaseOperationsResponse> {
1891            (*self.0.stub)
1892                .list_database_operations(self.0.request, self.0.options)
1893                .await
1894                .map(gax::response::Response::into_body)
1895        }
1896
1897        /// Streams each page in the collection.
1898        pub fn by_page(
1899            self,
1900        ) -> impl gax::paginator::Paginator<
1901            crate::model::ListDatabaseOperationsResponse,
1902            gax::error::Error,
1903        > {
1904            use std::clone::Clone;
1905            let token = self.0.request.page_token.clone();
1906            let execute = move |token: String| {
1907                let mut builder = self.clone();
1908                builder.0.request = builder.0.request.set_page_token(token);
1909                builder.send()
1910            };
1911            gax::paginator::internal::new_paginator(token, execute)
1912        }
1913
1914        /// Streams each item in the collection.
1915        pub fn by_item(
1916            self,
1917        ) -> impl gax::paginator::ItemPaginator<
1918            crate::model::ListDatabaseOperationsResponse,
1919            gax::error::Error,
1920        > {
1921            use gax::paginator::Paginator;
1922            self.by_page().items()
1923        }
1924
1925        /// Sets the value of [parent][crate::model::ListDatabaseOperationsRequest::parent].
1926        ///
1927        /// This is a **required** field for requests.
1928        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
1929            self.0.request.parent = v.into();
1930            self
1931        }
1932
1933        /// Sets the value of [filter][crate::model::ListDatabaseOperationsRequest::filter].
1934        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
1935            self.0.request.filter = v.into();
1936            self
1937        }
1938
1939        /// Sets the value of [page_size][crate::model::ListDatabaseOperationsRequest::page_size].
1940        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
1941            self.0.request.page_size = v.into();
1942            self
1943        }
1944
1945        /// Sets the value of [page_token][crate::model::ListDatabaseOperationsRequest::page_token].
1946        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
1947            self.0.request.page_token = v.into();
1948            self
1949        }
1950    }
1951
1952    #[doc(hidden)]
1953    impl gax::options::internal::RequestBuilder for ListDatabaseOperations {
1954        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1955            &mut self.0.options
1956        }
1957    }
1958
1959    /// The request builder for [DatabaseAdmin::list_backup_operations][crate::client::DatabaseAdmin::list_backup_operations] calls.
1960    ///
1961    /// # Example
1962    /// ```
1963    /// # use google_cloud_spanner_admin_database_v1::builder::database_admin::ListBackupOperations;
1964    /// # async fn sample() -> gax::Result<()> {
1965    /// use gax::paginator::ItemPaginator;
1966    ///
1967    /// let builder = prepare_request_builder();
1968    /// let mut items = builder.by_item();
1969    /// while let Some(result) = items.next().await {
1970    ///   let item = result?;
1971    /// }
1972    /// # Ok(()) }
1973    ///
1974    /// fn prepare_request_builder() -> ListBackupOperations {
1975    ///   # panic!();
1976    ///   // ... details omitted ...
1977    /// }
1978    /// ```
1979    #[derive(Clone, Debug)]
1980    pub struct ListBackupOperations(RequestBuilder<crate::model::ListBackupOperationsRequest>);
1981
1982    impl ListBackupOperations {
1983        pub(crate) fn new(
1984            stub: std::sync::Arc<dyn super::super::stub::dynamic::DatabaseAdmin>,
1985        ) -> Self {
1986            Self(RequestBuilder::new(stub))
1987        }
1988
1989        /// Sets the full request, replacing any prior values.
1990        pub fn with_request<V: Into<crate::model::ListBackupOperationsRequest>>(
1991            mut self,
1992            v: V,
1993        ) -> Self {
1994            self.0.request = v.into();
1995            self
1996        }
1997
1998        /// Sets all the options, replacing any prior values.
1999        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2000            self.0.options = v.into();
2001            self
2002        }
2003
2004        /// Sends the request.
2005        pub async fn send(self) -> Result<crate::model::ListBackupOperationsResponse> {
2006            (*self.0.stub)
2007                .list_backup_operations(self.0.request, self.0.options)
2008                .await
2009                .map(gax::response::Response::into_body)
2010        }
2011
2012        /// Streams each page in the collection.
2013        pub fn by_page(
2014            self,
2015        ) -> impl gax::paginator::Paginator<crate::model::ListBackupOperationsResponse, gax::error::Error>
2016        {
2017            use std::clone::Clone;
2018            let token = self.0.request.page_token.clone();
2019            let execute = move |token: String| {
2020                let mut builder = self.clone();
2021                builder.0.request = builder.0.request.set_page_token(token);
2022                builder.send()
2023            };
2024            gax::paginator::internal::new_paginator(token, execute)
2025        }
2026
2027        /// Streams each item in the collection.
2028        pub fn by_item(
2029            self,
2030        ) -> impl gax::paginator::ItemPaginator<
2031            crate::model::ListBackupOperationsResponse,
2032            gax::error::Error,
2033        > {
2034            use gax::paginator::Paginator;
2035            self.by_page().items()
2036        }
2037
2038        /// Sets the value of [parent][crate::model::ListBackupOperationsRequest::parent].
2039        ///
2040        /// This is a **required** field for requests.
2041        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
2042            self.0.request.parent = v.into();
2043            self
2044        }
2045
2046        /// Sets the value of [filter][crate::model::ListBackupOperationsRequest::filter].
2047        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
2048            self.0.request.filter = v.into();
2049            self
2050        }
2051
2052        /// Sets the value of [page_size][crate::model::ListBackupOperationsRequest::page_size].
2053        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
2054            self.0.request.page_size = v.into();
2055            self
2056        }
2057
2058        /// Sets the value of [page_token][crate::model::ListBackupOperationsRequest::page_token].
2059        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
2060            self.0.request.page_token = v.into();
2061            self
2062        }
2063    }
2064
2065    #[doc(hidden)]
2066    impl gax::options::internal::RequestBuilder for ListBackupOperations {
2067        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2068            &mut self.0.options
2069        }
2070    }
2071
2072    /// The request builder for [DatabaseAdmin::list_database_roles][crate::client::DatabaseAdmin::list_database_roles] calls.
2073    ///
2074    /// # Example
2075    /// ```
2076    /// # use google_cloud_spanner_admin_database_v1::builder::database_admin::ListDatabaseRoles;
2077    /// # async fn sample() -> gax::Result<()> {
2078    /// use gax::paginator::ItemPaginator;
2079    ///
2080    /// let builder = prepare_request_builder();
2081    /// let mut items = builder.by_item();
2082    /// while let Some(result) = items.next().await {
2083    ///   let item = result?;
2084    /// }
2085    /// # Ok(()) }
2086    ///
2087    /// fn prepare_request_builder() -> ListDatabaseRoles {
2088    ///   # panic!();
2089    ///   // ... details omitted ...
2090    /// }
2091    /// ```
2092    #[derive(Clone, Debug)]
2093    pub struct ListDatabaseRoles(RequestBuilder<crate::model::ListDatabaseRolesRequest>);
2094
2095    impl ListDatabaseRoles {
2096        pub(crate) fn new(
2097            stub: std::sync::Arc<dyn super::super::stub::dynamic::DatabaseAdmin>,
2098        ) -> Self {
2099            Self(RequestBuilder::new(stub))
2100        }
2101
2102        /// Sets the full request, replacing any prior values.
2103        pub fn with_request<V: Into<crate::model::ListDatabaseRolesRequest>>(
2104            mut self,
2105            v: V,
2106        ) -> Self {
2107            self.0.request = v.into();
2108            self
2109        }
2110
2111        /// Sets all the options, replacing any prior values.
2112        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2113            self.0.options = v.into();
2114            self
2115        }
2116
2117        /// Sends the request.
2118        pub async fn send(self) -> Result<crate::model::ListDatabaseRolesResponse> {
2119            (*self.0.stub)
2120                .list_database_roles(self.0.request, self.0.options)
2121                .await
2122                .map(gax::response::Response::into_body)
2123        }
2124
2125        /// Streams each page in the collection.
2126        pub fn by_page(
2127            self,
2128        ) -> impl gax::paginator::Paginator<crate::model::ListDatabaseRolesResponse, gax::error::Error>
2129        {
2130            use std::clone::Clone;
2131            let token = self.0.request.page_token.clone();
2132            let execute = move |token: String| {
2133                let mut builder = self.clone();
2134                builder.0.request = builder.0.request.set_page_token(token);
2135                builder.send()
2136            };
2137            gax::paginator::internal::new_paginator(token, execute)
2138        }
2139
2140        /// Streams each item in the collection.
2141        pub fn by_item(
2142            self,
2143        ) -> impl gax::paginator::ItemPaginator<crate::model::ListDatabaseRolesResponse, gax::error::Error>
2144        {
2145            use gax::paginator::Paginator;
2146            self.by_page().items()
2147        }
2148
2149        /// Sets the value of [parent][crate::model::ListDatabaseRolesRequest::parent].
2150        ///
2151        /// This is a **required** field for requests.
2152        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
2153            self.0.request.parent = v.into();
2154            self
2155        }
2156
2157        /// Sets the value of [page_size][crate::model::ListDatabaseRolesRequest::page_size].
2158        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
2159            self.0.request.page_size = v.into();
2160            self
2161        }
2162
2163        /// Sets the value of [page_token][crate::model::ListDatabaseRolesRequest::page_token].
2164        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
2165            self.0.request.page_token = v.into();
2166            self
2167        }
2168    }
2169
2170    #[doc(hidden)]
2171    impl gax::options::internal::RequestBuilder for ListDatabaseRoles {
2172        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2173            &mut self.0.options
2174        }
2175    }
2176
2177    /// The request builder for [DatabaseAdmin::add_split_points][crate::client::DatabaseAdmin::add_split_points] calls.
2178    ///
2179    /// # Example
2180    /// ```
2181    /// # use google_cloud_spanner_admin_database_v1::builder::database_admin::AddSplitPoints;
2182    /// # async fn sample() -> gax::Result<()> {
2183    ///
2184    /// let builder = prepare_request_builder();
2185    /// let response = builder.send().await?;
2186    /// # Ok(()) }
2187    ///
2188    /// fn prepare_request_builder() -> AddSplitPoints {
2189    ///   # panic!();
2190    ///   // ... details omitted ...
2191    /// }
2192    /// ```
2193    #[derive(Clone, Debug)]
2194    pub struct AddSplitPoints(RequestBuilder<crate::model::AddSplitPointsRequest>);
2195
2196    impl AddSplitPoints {
2197        pub(crate) fn new(
2198            stub: std::sync::Arc<dyn super::super::stub::dynamic::DatabaseAdmin>,
2199        ) -> Self {
2200            Self(RequestBuilder::new(stub))
2201        }
2202
2203        /// Sets the full request, replacing any prior values.
2204        pub fn with_request<V: Into<crate::model::AddSplitPointsRequest>>(mut self, v: V) -> Self {
2205            self.0.request = v.into();
2206            self
2207        }
2208
2209        /// Sets all the options, replacing any prior values.
2210        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2211            self.0.options = v.into();
2212            self
2213        }
2214
2215        /// Sends the request.
2216        pub async fn send(self) -> Result<crate::model::AddSplitPointsResponse> {
2217            (*self.0.stub)
2218                .add_split_points(self.0.request, self.0.options)
2219                .await
2220                .map(gax::response::Response::into_body)
2221        }
2222
2223        /// Sets the value of [database][crate::model::AddSplitPointsRequest::database].
2224        ///
2225        /// This is a **required** field for requests.
2226        pub fn set_database<T: Into<std::string::String>>(mut self, v: T) -> Self {
2227            self.0.request.database = v.into();
2228            self
2229        }
2230
2231        /// Sets the value of [split_points][crate::model::AddSplitPointsRequest::split_points].
2232        ///
2233        /// This is a **required** field for requests.
2234        pub fn set_split_points<T, V>(mut self, v: T) -> Self
2235        where
2236            T: std::iter::IntoIterator<Item = V>,
2237            V: std::convert::Into<crate::model::SplitPoints>,
2238        {
2239            use std::iter::Iterator;
2240            self.0.request.split_points = v.into_iter().map(|i| i.into()).collect();
2241            self
2242        }
2243
2244        /// Sets the value of [initiator][crate::model::AddSplitPointsRequest::initiator].
2245        pub fn set_initiator<T: Into<std::string::String>>(mut self, v: T) -> Self {
2246            self.0.request.initiator = v.into();
2247            self
2248        }
2249    }
2250
2251    #[doc(hidden)]
2252    impl gax::options::internal::RequestBuilder for AddSplitPoints {
2253        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2254            &mut self.0.options
2255        }
2256    }
2257
2258    /// The request builder for [DatabaseAdmin::create_backup_schedule][crate::client::DatabaseAdmin::create_backup_schedule] calls.
2259    ///
2260    /// # Example
2261    /// ```
2262    /// # use google_cloud_spanner_admin_database_v1::builder::database_admin::CreateBackupSchedule;
2263    /// # async fn sample() -> gax::Result<()> {
2264    ///
2265    /// let builder = prepare_request_builder();
2266    /// let response = builder.send().await?;
2267    /// # Ok(()) }
2268    ///
2269    /// fn prepare_request_builder() -> CreateBackupSchedule {
2270    ///   # panic!();
2271    ///   // ... details omitted ...
2272    /// }
2273    /// ```
2274    #[derive(Clone, Debug)]
2275    pub struct CreateBackupSchedule(RequestBuilder<crate::model::CreateBackupScheduleRequest>);
2276
2277    impl CreateBackupSchedule {
2278        pub(crate) fn new(
2279            stub: std::sync::Arc<dyn super::super::stub::dynamic::DatabaseAdmin>,
2280        ) -> Self {
2281            Self(RequestBuilder::new(stub))
2282        }
2283
2284        /// Sets the full request, replacing any prior values.
2285        pub fn with_request<V: Into<crate::model::CreateBackupScheduleRequest>>(
2286            mut self,
2287            v: V,
2288        ) -> Self {
2289            self.0.request = v.into();
2290            self
2291        }
2292
2293        /// Sets all the options, replacing any prior values.
2294        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2295            self.0.options = v.into();
2296            self
2297        }
2298
2299        /// Sends the request.
2300        pub async fn send(self) -> Result<crate::model::BackupSchedule> {
2301            (*self.0.stub)
2302                .create_backup_schedule(self.0.request, self.0.options)
2303                .await
2304                .map(gax::response::Response::into_body)
2305        }
2306
2307        /// Sets the value of [parent][crate::model::CreateBackupScheduleRequest::parent].
2308        ///
2309        /// This is a **required** field for requests.
2310        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
2311            self.0.request.parent = v.into();
2312            self
2313        }
2314
2315        /// Sets the value of [backup_schedule_id][crate::model::CreateBackupScheduleRequest::backup_schedule_id].
2316        ///
2317        /// This is a **required** field for requests.
2318        pub fn set_backup_schedule_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
2319            self.0.request.backup_schedule_id = v.into();
2320            self
2321        }
2322
2323        /// Sets the value of [backup_schedule][crate::model::CreateBackupScheduleRequest::backup_schedule].
2324        ///
2325        /// This is a **required** field for requests.
2326        pub fn set_backup_schedule<T>(mut self, v: T) -> Self
2327        where
2328            T: std::convert::Into<crate::model::BackupSchedule>,
2329        {
2330            self.0.request.backup_schedule = std::option::Option::Some(v.into());
2331            self
2332        }
2333
2334        /// Sets or clears the value of [backup_schedule][crate::model::CreateBackupScheduleRequest::backup_schedule].
2335        ///
2336        /// This is a **required** field for requests.
2337        pub fn set_or_clear_backup_schedule<T>(mut self, v: std::option::Option<T>) -> Self
2338        where
2339            T: std::convert::Into<crate::model::BackupSchedule>,
2340        {
2341            self.0.request.backup_schedule = v.map(|x| x.into());
2342            self
2343        }
2344    }
2345
2346    #[doc(hidden)]
2347    impl gax::options::internal::RequestBuilder for CreateBackupSchedule {
2348        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2349            &mut self.0.options
2350        }
2351    }
2352
2353    /// The request builder for [DatabaseAdmin::get_backup_schedule][crate::client::DatabaseAdmin::get_backup_schedule] calls.
2354    ///
2355    /// # Example
2356    /// ```
2357    /// # use google_cloud_spanner_admin_database_v1::builder::database_admin::GetBackupSchedule;
2358    /// # async fn sample() -> gax::Result<()> {
2359    ///
2360    /// let builder = prepare_request_builder();
2361    /// let response = builder.send().await?;
2362    /// # Ok(()) }
2363    ///
2364    /// fn prepare_request_builder() -> GetBackupSchedule {
2365    ///   # panic!();
2366    ///   // ... details omitted ...
2367    /// }
2368    /// ```
2369    #[derive(Clone, Debug)]
2370    pub struct GetBackupSchedule(RequestBuilder<crate::model::GetBackupScheduleRequest>);
2371
2372    impl GetBackupSchedule {
2373        pub(crate) fn new(
2374            stub: std::sync::Arc<dyn super::super::stub::dynamic::DatabaseAdmin>,
2375        ) -> Self {
2376            Self(RequestBuilder::new(stub))
2377        }
2378
2379        /// Sets the full request, replacing any prior values.
2380        pub fn with_request<V: Into<crate::model::GetBackupScheduleRequest>>(
2381            mut self,
2382            v: V,
2383        ) -> Self {
2384            self.0.request = v.into();
2385            self
2386        }
2387
2388        /// Sets all the options, replacing any prior values.
2389        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2390            self.0.options = v.into();
2391            self
2392        }
2393
2394        /// Sends the request.
2395        pub async fn send(self) -> Result<crate::model::BackupSchedule> {
2396            (*self.0.stub)
2397                .get_backup_schedule(self.0.request, self.0.options)
2398                .await
2399                .map(gax::response::Response::into_body)
2400        }
2401
2402        /// Sets the value of [name][crate::model::GetBackupScheduleRequest::name].
2403        ///
2404        /// This is a **required** field for requests.
2405        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2406            self.0.request.name = v.into();
2407            self
2408        }
2409    }
2410
2411    #[doc(hidden)]
2412    impl gax::options::internal::RequestBuilder for GetBackupSchedule {
2413        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2414            &mut self.0.options
2415        }
2416    }
2417
2418    /// The request builder for [DatabaseAdmin::update_backup_schedule][crate::client::DatabaseAdmin::update_backup_schedule] calls.
2419    ///
2420    /// # Example
2421    /// ```
2422    /// # use google_cloud_spanner_admin_database_v1::builder::database_admin::UpdateBackupSchedule;
2423    /// # async fn sample() -> gax::Result<()> {
2424    ///
2425    /// let builder = prepare_request_builder();
2426    /// let response = builder.send().await?;
2427    /// # Ok(()) }
2428    ///
2429    /// fn prepare_request_builder() -> UpdateBackupSchedule {
2430    ///   # panic!();
2431    ///   // ... details omitted ...
2432    /// }
2433    /// ```
2434    #[derive(Clone, Debug)]
2435    pub struct UpdateBackupSchedule(RequestBuilder<crate::model::UpdateBackupScheduleRequest>);
2436
2437    impl UpdateBackupSchedule {
2438        pub(crate) fn new(
2439            stub: std::sync::Arc<dyn super::super::stub::dynamic::DatabaseAdmin>,
2440        ) -> Self {
2441            Self(RequestBuilder::new(stub))
2442        }
2443
2444        /// Sets the full request, replacing any prior values.
2445        pub fn with_request<V: Into<crate::model::UpdateBackupScheduleRequest>>(
2446            mut self,
2447            v: V,
2448        ) -> Self {
2449            self.0.request = v.into();
2450            self
2451        }
2452
2453        /// Sets all the options, replacing any prior values.
2454        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2455            self.0.options = v.into();
2456            self
2457        }
2458
2459        /// Sends the request.
2460        pub async fn send(self) -> Result<crate::model::BackupSchedule> {
2461            (*self.0.stub)
2462                .update_backup_schedule(self.0.request, self.0.options)
2463                .await
2464                .map(gax::response::Response::into_body)
2465        }
2466
2467        /// Sets the value of [backup_schedule][crate::model::UpdateBackupScheduleRequest::backup_schedule].
2468        ///
2469        /// This is a **required** field for requests.
2470        pub fn set_backup_schedule<T>(mut self, v: T) -> Self
2471        where
2472            T: std::convert::Into<crate::model::BackupSchedule>,
2473        {
2474            self.0.request.backup_schedule = std::option::Option::Some(v.into());
2475            self
2476        }
2477
2478        /// Sets or clears the value of [backup_schedule][crate::model::UpdateBackupScheduleRequest::backup_schedule].
2479        ///
2480        /// This is a **required** field for requests.
2481        pub fn set_or_clear_backup_schedule<T>(mut self, v: std::option::Option<T>) -> Self
2482        where
2483            T: std::convert::Into<crate::model::BackupSchedule>,
2484        {
2485            self.0.request.backup_schedule = v.map(|x| x.into());
2486            self
2487        }
2488
2489        /// Sets the value of [update_mask][crate::model::UpdateBackupScheduleRequest::update_mask].
2490        ///
2491        /// This is a **required** field for requests.
2492        pub fn set_update_mask<T>(mut self, v: T) -> Self
2493        where
2494            T: std::convert::Into<wkt::FieldMask>,
2495        {
2496            self.0.request.update_mask = std::option::Option::Some(v.into());
2497            self
2498        }
2499
2500        /// Sets or clears the value of [update_mask][crate::model::UpdateBackupScheduleRequest::update_mask].
2501        ///
2502        /// This is a **required** field for requests.
2503        pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
2504        where
2505            T: std::convert::Into<wkt::FieldMask>,
2506        {
2507            self.0.request.update_mask = v.map(|x| x.into());
2508            self
2509        }
2510    }
2511
2512    #[doc(hidden)]
2513    impl gax::options::internal::RequestBuilder for UpdateBackupSchedule {
2514        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2515            &mut self.0.options
2516        }
2517    }
2518
2519    /// The request builder for [DatabaseAdmin::delete_backup_schedule][crate::client::DatabaseAdmin::delete_backup_schedule] calls.
2520    ///
2521    /// # Example
2522    /// ```
2523    /// # use google_cloud_spanner_admin_database_v1::builder::database_admin::DeleteBackupSchedule;
2524    /// # async fn sample() -> gax::Result<()> {
2525    ///
2526    /// let builder = prepare_request_builder();
2527    /// let response = builder.send().await?;
2528    /// # Ok(()) }
2529    ///
2530    /// fn prepare_request_builder() -> DeleteBackupSchedule {
2531    ///   # panic!();
2532    ///   // ... details omitted ...
2533    /// }
2534    /// ```
2535    #[derive(Clone, Debug)]
2536    pub struct DeleteBackupSchedule(RequestBuilder<crate::model::DeleteBackupScheduleRequest>);
2537
2538    impl DeleteBackupSchedule {
2539        pub(crate) fn new(
2540            stub: std::sync::Arc<dyn super::super::stub::dynamic::DatabaseAdmin>,
2541        ) -> Self {
2542            Self(RequestBuilder::new(stub))
2543        }
2544
2545        /// Sets the full request, replacing any prior values.
2546        pub fn with_request<V: Into<crate::model::DeleteBackupScheduleRequest>>(
2547            mut self,
2548            v: V,
2549        ) -> Self {
2550            self.0.request = v.into();
2551            self
2552        }
2553
2554        /// Sets all the options, replacing any prior values.
2555        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2556            self.0.options = v.into();
2557            self
2558        }
2559
2560        /// Sends the request.
2561        pub async fn send(self) -> Result<()> {
2562            (*self.0.stub)
2563                .delete_backup_schedule(self.0.request, self.0.options)
2564                .await
2565                .map(gax::response::Response::into_body)
2566        }
2567
2568        /// Sets the value of [name][crate::model::DeleteBackupScheduleRequest::name].
2569        ///
2570        /// This is a **required** field for requests.
2571        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2572            self.0.request.name = v.into();
2573            self
2574        }
2575    }
2576
2577    #[doc(hidden)]
2578    impl gax::options::internal::RequestBuilder for DeleteBackupSchedule {
2579        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2580            &mut self.0.options
2581        }
2582    }
2583
2584    /// The request builder for [DatabaseAdmin::list_backup_schedules][crate::client::DatabaseAdmin::list_backup_schedules] calls.
2585    ///
2586    /// # Example
2587    /// ```
2588    /// # use google_cloud_spanner_admin_database_v1::builder::database_admin::ListBackupSchedules;
2589    /// # async fn sample() -> gax::Result<()> {
2590    /// use gax::paginator::ItemPaginator;
2591    ///
2592    /// let builder = prepare_request_builder();
2593    /// let mut items = builder.by_item();
2594    /// while let Some(result) = items.next().await {
2595    ///   let item = result?;
2596    /// }
2597    /// # Ok(()) }
2598    ///
2599    /// fn prepare_request_builder() -> ListBackupSchedules {
2600    ///   # panic!();
2601    ///   // ... details omitted ...
2602    /// }
2603    /// ```
2604    #[derive(Clone, Debug)]
2605    pub struct ListBackupSchedules(RequestBuilder<crate::model::ListBackupSchedulesRequest>);
2606
2607    impl ListBackupSchedules {
2608        pub(crate) fn new(
2609            stub: std::sync::Arc<dyn super::super::stub::dynamic::DatabaseAdmin>,
2610        ) -> Self {
2611            Self(RequestBuilder::new(stub))
2612        }
2613
2614        /// Sets the full request, replacing any prior values.
2615        pub fn with_request<V: Into<crate::model::ListBackupSchedulesRequest>>(
2616            mut self,
2617            v: V,
2618        ) -> Self {
2619            self.0.request = v.into();
2620            self
2621        }
2622
2623        /// Sets all the options, replacing any prior values.
2624        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2625            self.0.options = v.into();
2626            self
2627        }
2628
2629        /// Sends the request.
2630        pub async fn send(self) -> Result<crate::model::ListBackupSchedulesResponse> {
2631            (*self.0.stub)
2632                .list_backup_schedules(self.0.request, self.0.options)
2633                .await
2634                .map(gax::response::Response::into_body)
2635        }
2636
2637        /// Streams each page in the collection.
2638        pub fn by_page(
2639            self,
2640        ) -> impl gax::paginator::Paginator<crate::model::ListBackupSchedulesResponse, gax::error::Error>
2641        {
2642            use std::clone::Clone;
2643            let token = self.0.request.page_token.clone();
2644            let execute = move |token: String| {
2645                let mut builder = self.clone();
2646                builder.0.request = builder.0.request.set_page_token(token);
2647                builder.send()
2648            };
2649            gax::paginator::internal::new_paginator(token, execute)
2650        }
2651
2652        /// Streams each item in the collection.
2653        pub fn by_item(
2654            self,
2655        ) -> impl gax::paginator::ItemPaginator<
2656            crate::model::ListBackupSchedulesResponse,
2657            gax::error::Error,
2658        > {
2659            use gax::paginator::Paginator;
2660            self.by_page().items()
2661        }
2662
2663        /// Sets the value of [parent][crate::model::ListBackupSchedulesRequest::parent].
2664        ///
2665        /// This is a **required** field for requests.
2666        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
2667            self.0.request.parent = v.into();
2668            self
2669        }
2670
2671        /// Sets the value of [page_size][crate::model::ListBackupSchedulesRequest::page_size].
2672        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
2673            self.0.request.page_size = v.into();
2674            self
2675        }
2676
2677        /// Sets the value of [page_token][crate::model::ListBackupSchedulesRequest::page_token].
2678        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
2679            self.0.request.page_token = v.into();
2680            self
2681        }
2682    }
2683
2684    #[doc(hidden)]
2685    impl gax::options::internal::RequestBuilder for ListBackupSchedules {
2686        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2687            &mut self.0.options
2688        }
2689    }
2690
2691    /// The request builder for [DatabaseAdmin::list_operations][crate::client::DatabaseAdmin::list_operations] calls.
2692    ///
2693    /// # Example
2694    /// ```
2695    /// # use google_cloud_spanner_admin_database_v1::builder::database_admin::ListOperations;
2696    /// # async fn sample() -> gax::Result<()> {
2697    /// use gax::paginator::ItemPaginator;
2698    ///
2699    /// let builder = prepare_request_builder();
2700    /// let mut items = builder.by_item();
2701    /// while let Some(result) = items.next().await {
2702    ///   let item = result?;
2703    /// }
2704    /// # Ok(()) }
2705    ///
2706    /// fn prepare_request_builder() -> ListOperations {
2707    ///   # panic!();
2708    ///   // ... details omitted ...
2709    /// }
2710    /// ```
2711    #[derive(Clone, Debug)]
2712    pub struct ListOperations(RequestBuilder<longrunning::model::ListOperationsRequest>);
2713
2714    impl ListOperations {
2715        pub(crate) fn new(
2716            stub: std::sync::Arc<dyn super::super::stub::dynamic::DatabaseAdmin>,
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<longrunning::model::ListOperationsRequest>>(
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<longrunning::model::ListOperationsResponse> {
2738            (*self.0.stub)
2739                .list_operations(self.0.request, self.0.options)
2740                .await
2741                .map(gax::response::Response::into_body)
2742        }
2743
2744        /// Streams each page in the collection.
2745        pub fn by_page(
2746            self,
2747        ) -> impl gax::paginator::Paginator<longrunning::model::ListOperationsResponse, gax::error::Error>
2748        {
2749            use std::clone::Clone;
2750            let token = self.0.request.page_token.clone();
2751            let execute = move |token: String| {
2752                let mut builder = self.clone();
2753                builder.0.request = builder.0.request.set_page_token(token);
2754                builder.send()
2755            };
2756            gax::paginator::internal::new_paginator(token, execute)
2757        }
2758
2759        /// Streams each item in the collection.
2760        pub fn by_item(
2761            self,
2762        ) -> impl gax::paginator::ItemPaginator<
2763            longrunning::model::ListOperationsResponse,
2764            gax::error::Error,
2765        > {
2766            use gax::paginator::Paginator;
2767            self.by_page().items()
2768        }
2769
2770        /// Sets the value of [name][longrunning::model::ListOperationsRequest::name].
2771        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2772            self.0.request.name = v.into();
2773            self
2774        }
2775
2776        /// Sets the value of [filter][longrunning::model::ListOperationsRequest::filter].
2777        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
2778            self.0.request.filter = v.into();
2779            self
2780        }
2781
2782        /// Sets the value of [page_size][longrunning::model::ListOperationsRequest::page_size].
2783        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
2784            self.0.request.page_size = v.into();
2785            self
2786        }
2787
2788        /// Sets the value of [page_token][longrunning::model::ListOperationsRequest::page_token].
2789        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
2790            self.0.request.page_token = v.into();
2791            self
2792        }
2793
2794        /// Sets the value of [return_partial_success][longrunning::model::ListOperationsRequest::return_partial_success].
2795        pub fn set_return_partial_success<T: Into<bool>>(mut self, v: T) -> Self {
2796            self.0.request.return_partial_success = v.into();
2797            self
2798        }
2799    }
2800
2801    #[doc(hidden)]
2802    impl gax::options::internal::RequestBuilder for ListOperations {
2803        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2804            &mut self.0.options
2805        }
2806    }
2807
2808    /// The request builder for [DatabaseAdmin::get_operation][crate::client::DatabaseAdmin::get_operation] calls.
2809    ///
2810    /// # Example
2811    /// ```
2812    /// # use google_cloud_spanner_admin_database_v1::builder::database_admin::GetOperation;
2813    /// # async fn sample() -> gax::Result<()> {
2814    ///
2815    /// let builder = prepare_request_builder();
2816    /// let response = builder.send().await?;
2817    /// # Ok(()) }
2818    ///
2819    /// fn prepare_request_builder() -> GetOperation {
2820    ///   # panic!();
2821    ///   // ... details omitted ...
2822    /// }
2823    /// ```
2824    #[derive(Clone, Debug)]
2825    pub struct GetOperation(RequestBuilder<longrunning::model::GetOperationRequest>);
2826
2827    impl GetOperation {
2828        pub(crate) fn new(
2829            stub: std::sync::Arc<dyn super::super::stub::dynamic::DatabaseAdmin>,
2830        ) -> Self {
2831            Self(RequestBuilder::new(stub))
2832        }
2833
2834        /// Sets the full request, replacing any prior values.
2835        pub fn with_request<V: Into<longrunning::model::GetOperationRequest>>(
2836            mut self,
2837            v: V,
2838        ) -> Self {
2839            self.0.request = v.into();
2840            self
2841        }
2842
2843        /// Sets all the options, replacing any prior values.
2844        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2845            self.0.options = v.into();
2846            self
2847        }
2848
2849        /// Sends the request.
2850        pub async fn send(self) -> Result<longrunning::model::Operation> {
2851            (*self.0.stub)
2852                .get_operation(self.0.request, self.0.options)
2853                .await
2854                .map(gax::response::Response::into_body)
2855        }
2856
2857        /// Sets the value of [name][longrunning::model::GetOperationRequest::name].
2858        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2859            self.0.request.name = v.into();
2860            self
2861        }
2862    }
2863
2864    #[doc(hidden)]
2865    impl gax::options::internal::RequestBuilder for GetOperation {
2866        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2867            &mut self.0.options
2868        }
2869    }
2870
2871    /// The request builder for [DatabaseAdmin::delete_operation][crate::client::DatabaseAdmin::delete_operation] calls.
2872    ///
2873    /// # Example
2874    /// ```
2875    /// # use google_cloud_spanner_admin_database_v1::builder::database_admin::DeleteOperation;
2876    /// # async fn sample() -> gax::Result<()> {
2877    ///
2878    /// let builder = prepare_request_builder();
2879    /// let response = builder.send().await?;
2880    /// # Ok(()) }
2881    ///
2882    /// fn prepare_request_builder() -> DeleteOperation {
2883    ///   # panic!();
2884    ///   // ... details omitted ...
2885    /// }
2886    /// ```
2887    #[derive(Clone, Debug)]
2888    pub struct DeleteOperation(RequestBuilder<longrunning::model::DeleteOperationRequest>);
2889
2890    impl DeleteOperation {
2891        pub(crate) fn new(
2892            stub: std::sync::Arc<dyn super::super::stub::dynamic::DatabaseAdmin>,
2893        ) -> Self {
2894            Self(RequestBuilder::new(stub))
2895        }
2896
2897        /// Sets the full request, replacing any prior values.
2898        pub fn with_request<V: Into<longrunning::model::DeleteOperationRequest>>(
2899            mut self,
2900            v: V,
2901        ) -> Self {
2902            self.0.request = v.into();
2903            self
2904        }
2905
2906        /// Sets all the options, replacing any prior values.
2907        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2908            self.0.options = v.into();
2909            self
2910        }
2911
2912        /// Sends the request.
2913        pub async fn send(self) -> Result<()> {
2914            (*self.0.stub)
2915                .delete_operation(self.0.request, self.0.options)
2916                .await
2917                .map(gax::response::Response::into_body)
2918        }
2919
2920        /// Sets the value of [name][longrunning::model::DeleteOperationRequest::name].
2921        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2922            self.0.request.name = v.into();
2923            self
2924        }
2925    }
2926
2927    #[doc(hidden)]
2928    impl gax::options::internal::RequestBuilder for DeleteOperation {
2929        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2930            &mut self.0.options
2931        }
2932    }
2933
2934    /// The request builder for [DatabaseAdmin::cancel_operation][crate::client::DatabaseAdmin::cancel_operation] calls.
2935    ///
2936    /// # Example
2937    /// ```
2938    /// # use google_cloud_spanner_admin_database_v1::builder::database_admin::CancelOperation;
2939    /// # async fn sample() -> gax::Result<()> {
2940    ///
2941    /// let builder = prepare_request_builder();
2942    /// let response = builder.send().await?;
2943    /// # Ok(()) }
2944    ///
2945    /// fn prepare_request_builder() -> CancelOperation {
2946    ///   # panic!();
2947    ///   // ... details omitted ...
2948    /// }
2949    /// ```
2950    #[derive(Clone, Debug)]
2951    pub struct CancelOperation(RequestBuilder<longrunning::model::CancelOperationRequest>);
2952
2953    impl CancelOperation {
2954        pub(crate) fn new(
2955            stub: std::sync::Arc<dyn super::super::stub::dynamic::DatabaseAdmin>,
2956        ) -> Self {
2957            Self(RequestBuilder::new(stub))
2958        }
2959
2960        /// Sets the full request, replacing any prior values.
2961        pub fn with_request<V: Into<longrunning::model::CancelOperationRequest>>(
2962            mut self,
2963            v: V,
2964        ) -> Self {
2965            self.0.request = v.into();
2966            self
2967        }
2968
2969        /// Sets all the options, replacing any prior values.
2970        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2971            self.0.options = v.into();
2972            self
2973        }
2974
2975        /// Sends the request.
2976        pub async fn send(self) -> Result<()> {
2977            (*self.0.stub)
2978                .cancel_operation(self.0.request, self.0.options)
2979                .await
2980                .map(gax::response::Response::into_body)
2981        }
2982
2983        /// Sets the value of [name][longrunning::model::CancelOperationRequest::name].
2984        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2985            self.0.request.name = v.into();
2986            self
2987        }
2988    }
2989
2990    #[doc(hidden)]
2991    impl gax::options::internal::RequestBuilder for CancelOperation {
2992        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2993            &mut self.0.options
2994        }
2995    }
2996}