google_cloud_spanner_admin_database_v1/
builders.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    use std::sync::Arc;
20
21    /// Common implementation for [crate::client::DatabaseAdmin] request builders.
22    #[derive(Clone, Debug)]
23    pub struct RequestBuilder<R: std::default::Default> {
24        stub: Arc<dyn crate::stubs::dynamic::DatabaseAdmin>,
25        request: R,
26        options: gax::options::RequestOptions,
27    }
28
29    impl<R> RequestBuilder<R>
30    where
31        R: std::default::Default,
32    {
33        pub(crate) fn new(stub: Arc<dyn crate::stubs::dynamic::DatabaseAdmin>) -> Self {
34            Self {
35                stub,
36                request: R::default(),
37                options: gax::options::RequestOptions::default(),
38            }
39        }
40    }
41
42    /// The request builder for a DatabaseAdmin::list_databases call.
43    #[derive(Clone, Debug)]
44    pub struct ListDatabases(RequestBuilder<crate::model::ListDatabasesRequest>);
45
46    impl ListDatabases {
47        pub(crate) fn new(stub: Arc<dyn crate::stubs::dynamic::DatabaseAdmin>) -> Self {
48            Self(RequestBuilder::new(stub))
49        }
50
51        /// Sets the full request, replacing any prior values.
52        pub fn with_request<V: Into<crate::model::ListDatabasesRequest>>(mut self, v: V) -> Self {
53            self.0.request = v.into();
54            self
55        }
56
57        /// Sets all the options, replacing any prior values.
58        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
59            self.0.options = v.into();
60            self
61        }
62
63        /// Sends the request.
64        pub async fn send(self) -> Result<crate::model::ListDatabasesResponse> {
65            (*self.0.stub)
66                .list_databases(self.0.request, self.0.options)
67                .await
68        }
69
70        /// Streams the responses back.
71        #[cfg(feature = "unstable-stream")]
72        pub async fn stream(
73            self,
74        ) -> gax::paginator::Paginator<crate::model::ListDatabasesResponse, gax::error::Error>
75        {
76            let token = gax::paginator::extract_token(&self.0.request.page_token);
77            let execute = move |token: String| {
78                let mut builder = self.clone();
79                builder.0.request = builder.0.request.set_page_token(token);
80                builder.send()
81            };
82            gax::paginator::Paginator::new(token, execute)
83        }
84
85        /// Sets the value of [parent][crate::model::ListDatabasesRequest::parent].
86        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
87            self.0.request.parent = v.into();
88            self
89        }
90
91        /// Sets the value of [page_size][crate::model::ListDatabasesRequest::page_size].
92        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
93            self.0.request.page_size = v.into();
94            self
95        }
96
97        /// Sets the value of [page_token][crate::model::ListDatabasesRequest::page_token].
98        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
99            self.0.request.page_token = v.into();
100            self
101        }
102    }
103
104    impl gax::options::RequestBuilder for ListDatabases {
105        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
106            &mut self.0.options
107        }
108    }
109
110    /// The request builder for a DatabaseAdmin::create_database call.
111    #[derive(Clone, Debug)]
112    pub struct CreateDatabase(RequestBuilder<crate::model::CreateDatabaseRequest>);
113
114    impl CreateDatabase {
115        pub(crate) fn new(stub: Arc<dyn crate::stubs::dynamic::DatabaseAdmin>) -> Self {
116            Self(RequestBuilder::new(stub))
117        }
118
119        /// Sets the full request, replacing any prior values.
120        pub fn with_request<V: Into<crate::model::CreateDatabaseRequest>>(mut self, v: V) -> Self {
121            self.0.request = v.into();
122            self
123        }
124
125        /// Sets all the options, replacing any prior values.
126        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
127            self.0.options = v.into();
128            self
129        }
130
131        /// Sends the request.
132        ///
133        /// # Long running operations
134        ///
135        /// This starts, but does not poll, a longrunning operation. More information
136        /// on [create_database][crate::client::DatabaseAdmin::create_database].
137        pub async fn send(self) -> Result<longrunning::model::Operation> {
138            (*self.0.stub)
139                .create_database(self.0.request, self.0.options)
140                .await
141        }
142
143        /// Creates a [Poller][lro::Poller] to work with `create_database`.
144        pub fn poller(
145            self,
146        ) -> impl lro::Poller<crate::model::Database, crate::model::CreateDatabaseMetadata>
147        {
148            type Operation =
149                lro::Operation<crate::model::Database, crate::model::CreateDatabaseMetadata>;
150            let polling_policy = self.0.stub.get_polling_policy(&self.0.options);
151            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
152
153            let stub = self.0.stub.clone();
154            let mut options = self.0.options.clone();
155            options.set_retry_policy(gax::retry_policy::NeverRetry);
156            let query = move |name| {
157                let stub = stub.clone();
158                let options = options.clone();
159                async {
160                    let op = GetOperation::new(stub)
161                        .set_name(name)
162                        .with_options(options)
163                        .send()
164                        .await?;
165                    Ok(Operation::new(op))
166                }
167            };
168
169            let start = move || async {
170                let op = self.send().await?;
171                Ok(Operation::new(op))
172            };
173
174            lro::new_poller(polling_policy, polling_backoff_policy, start, query)
175        }
176
177        /// Sets the value of [parent][crate::model::CreateDatabaseRequest::parent].
178        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
179            self.0.request.parent = v.into();
180            self
181        }
182
183        /// Sets the value of [create_statement][crate::model::CreateDatabaseRequest::create_statement].
184        pub fn set_create_statement<T: Into<std::string::String>>(mut self, v: T) -> Self {
185            self.0.request.create_statement = v.into();
186            self
187        }
188
189        /// Sets the value of [encryption_config][crate::model::CreateDatabaseRequest::encryption_config].
190        pub fn set_encryption_config<
191            T: Into<std::option::Option<crate::model::EncryptionConfig>>,
192        >(
193            mut self,
194            v: T,
195        ) -> Self {
196            self.0.request.encryption_config = v.into();
197            self
198        }
199
200        /// Sets the value of [database_dialect][crate::model::CreateDatabaseRequest::database_dialect].
201        pub fn set_database_dialect<T: Into<crate::model::DatabaseDialect>>(
202            mut self,
203            v: T,
204        ) -> Self {
205            self.0.request.database_dialect = v.into();
206            self
207        }
208
209        /// Sets the value of [proto_descriptors][crate::model::CreateDatabaseRequest::proto_descriptors].
210        pub fn set_proto_descriptors<T: Into<bytes::Bytes>>(mut self, v: T) -> Self {
211            self.0.request.proto_descriptors = v.into();
212            self
213        }
214
215        /// Sets the value of [extra_statements][crate::model::CreateDatabaseRequest::extra_statements].
216        pub fn set_extra_statements<T, V>(mut self, v: T) -> Self
217        where
218            T: std::iter::IntoIterator<Item = V>,
219            V: std::convert::Into<std::string::String>,
220        {
221            use std::iter::Iterator;
222            self.0.request.extra_statements = v.into_iter().map(|i| i.into()).collect();
223            self
224        }
225    }
226
227    impl gax::options::RequestBuilder for CreateDatabase {
228        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
229            &mut self.0.options
230        }
231    }
232
233    /// The request builder for a DatabaseAdmin::get_database call.
234    #[derive(Clone, Debug)]
235    pub struct GetDatabase(RequestBuilder<crate::model::GetDatabaseRequest>);
236
237    impl GetDatabase {
238        pub(crate) fn new(stub: Arc<dyn crate::stubs::dynamic::DatabaseAdmin>) -> Self {
239            Self(RequestBuilder::new(stub))
240        }
241
242        /// Sets the full request, replacing any prior values.
243        pub fn with_request<V: Into<crate::model::GetDatabaseRequest>>(mut self, v: V) -> Self {
244            self.0.request = v.into();
245            self
246        }
247
248        /// Sets all the options, replacing any prior values.
249        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
250            self.0.options = v.into();
251            self
252        }
253
254        /// Sends the request.
255        pub async fn send(self) -> Result<crate::model::Database> {
256            (*self.0.stub)
257                .get_database(self.0.request, self.0.options)
258                .await
259        }
260
261        /// Sets the value of [name][crate::model::GetDatabaseRequest::name].
262        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
263            self.0.request.name = v.into();
264            self
265        }
266    }
267
268    impl gax::options::RequestBuilder for GetDatabase {
269        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
270            &mut self.0.options
271        }
272    }
273
274    /// The request builder for a DatabaseAdmin::update_database call.
275    #[derive(Clone, Debug)]
276    pub struct UpdateDatabase(RequestBuilder<crate::model::UpdateDatabaseRequest>);
277
278    impl UpdateDatabase {
279        pub(crate) fn new(stub: Arc<dyn crate::stubs::dynamic::DatabaseAdmin>) -> Self {
280            Self(RequestBuilder::new(stub))
281        }
282
283        /// Sets the full request, replacing any prior values.
284        pub fn with_request<V: Into<crate::model::UpdateDatabaseRequest>>(mut self, v: V) -> Self {
285            self.0.request = v.into();
286            self
287        }
288
289        /// Sets all the options, replacing any prior values.
290        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
291            self.0.options = v.into();
292            self
293        }
294
295        /// Sends the request.
296        ///
297        /// # Long running operations
298        ///
299        /// This starts, but does not poll, a longrunning operation. More information
300        /// on [update_database][crate::client::DatabaseAdmin::update_database].
301        pub async fn send(self) -> Result<longrunning::model::Operation> {
302            (*self.0.stub)
303                .update_database(self.0.request, self.0.options)
304                .await
305        }
306
307        /// Creates a [Poller][lro::Poller] to work with `update_database`.
308        pub fn poller(
309            self,
310        ) -> impl lro::Poller<crate::model::Database, crate::model::UpdateDatabaseMetadata>
311        {
312            type Operation =
313                lro::Operation<crate::model::Database, crate::model::UpdateDatabaseMetadata>;
314            let polling_policy = self.0.stub.get_polling_policy(&self.0.options);
315            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
316
317            let stub = self.0.stub.clone();
318            let mut options = self.0.options.clone();
319            options.set_retry_policy(gax::retry_policy::NeverRetry);
320            let query = move |name| {
321                let stub = stub.clone();
322                let options = options.clone();
323                async {
324                    let op = GetOperation::new(stub)
325                        .set_name(name)
326                        .with_options(options)
327                        .send()
328                        .await?;
329                    Ok(Operation::new(op))
330                }
331            };
332
333            let start = move || async {
334                let op = self.send().await?;
335                Ok(Operation::new(op))
336            };
337
338            lro::new_poller(polling_policy, polling_backoff_policy, start, query)
339        }
340
341        /// Sets the value of [database][crate::model::UpdateDatabaseRequest::database].
342        pub fn set_database<T: Into<std::option::Option<crate::model::Database>>>(
343            mut self,
344            v: T,
345        ) -> Self {
346            self.0.request.database = v.into();
347            self
348        }
349
350        /// Sets the value of [update_mask][crate::model::UpdateDatabaseRequest::update_mask].
351        pub fn set_update_mask<T: Into<std::option::Option<wkt::FieldMask>>>(
352            mut self,
353            v: T,
354        ) -> Self {
355            self.0.request.update_mask = v.into();
356            self
357        }
358    }
359
360    impl gax::options::RequestBuilder for UpdateDatabase {
361        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
362            &mut self.0.options
363        }
364    }
365
366    /// The request builder for a DatabaseAdmin::update_database_ddl call.
367    #[derive(Clone, Debug)]
368    pub struct UpdateDatabaseDdl(RequestBuilder<crate::model::UpdateDatabaseDdlRequest>);
369
370    impl UpdateDatabaseDdl {
371        pub(crate) fn new(stub: Arc<dyn crate::stubs::dynamic::DatabaseAdmin>) -> Self {
372            Self(RequestBuilder::new(stub))
373        }
374
375        /// Sets the full request, replacing any prior values.
376        pub fn with_request<V: Into<crate::model::UpdateDatabaseDdlRequest>>(
377            mut self,
378            v: V,
379        ) -> Self {
380            self.0.request = v.into();
381            self
382        }
383
384        /// Sets all the options, replacing any prior values.
385        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
386            self.0.options = v.into();
387            self
388        }
389
390        /// Sends the request.
391        ///
392        /// # Long running operations
393        ///
394        /// This starts, but does not poll, a longrunning operation. More information
395        /// on [update_database_ddl][crate::client::DatabaseAdmin::update_database_ddl].
396        pub async fn send(self) -> Result<longrunning::model::Operation> {
397            (*self.0.stub)
398                .update_database_ddl(self.0.request, self.0.options)
399                .await
400        }
401
402        /// Creates a [Poller][lro::Poller] to work with `update_database_ddl`.
403        pub fn poller(
404            self,
405        ) -> impl lro::Poller<wkt::Empty, crate::model::UpdateDatabaseDdlMetadata> {
406            type Operation = lro::Operation<wkt::Empty, crate::model::UpdateDatabaseDdlMetadata>;
407            let polling_policy = self.0.stub.get_polling_policy(&self.0.options);
408            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
409
410            let stub = self.0.stub.clone();
411            let mut options = self.0.options.clone();
412            options.set_retry_policy(gax::retry_policy::NeverRetry);
413            let query = move |name| {
414                let stub = stub.clone();
415                let options = options.clone();
416                async {
417                    let op = GetOperation::new(stub)
418                        .set_name(name)
419                        .with_options(options)
420                        .send()
421                        .await?;
422                    Ok(Operation::new(op))
423                }
424            };
425
426            let start = move || async {
427                let op = self.send().await?;
428                Ok(Operation::new(op))
429            };
430
431            lro::new_poller(polling_policy, polling_backoff_policy, start, query)
432        }
433
434        /// Sets the value of [database][crate::model::UpdateDatabaseDdlRequest::database].
435        pub fn set_database<T: Into<std::string::String>>(mut self, v: T) -> Self {
436            self.0.request.database = v.into();
437            self
438        }
439
440        /// Sets the value of [operation_id][crate::model::UpdateDatabaseDdlRequest::operation_id].
441        pub fn set_operation_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
442            self.0.request.operation_id = v.into();
443            self
444        }
445
446        /// Sets the value of [proto_descriptors][crate::model::UpdateDatabaseDdlRequest::proto_descriptors].
447        pub fn set_proto_descriptors<T: Into<bytes::Bytes>>(mut self, v: T) -> Self {
448            self.0.request.proto_descriptors = v.into();
449            self
450        }
451
452        /// Sets the value of [statements][crate::model::UpdateDatabaseDdlRequest::statements].
453        pub fn set_statements<T, V>(mut self, v: T) -> Self
454        where
455            T: std::iter::IntoIterator<Item = V>,
456            V: std::convert::Into<std::string::String>,
457        {
458            use std::iter::Iterator;
459            self.0.request.statements = v.into_iter().map(|i| i.into()).collect();
460            self
461        }
462    }
463
464    impl gax::options::RequestBuilder for UpdateDatabaseDdl {
465        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
466            &mut self.0.options
467        }
468    }
469
470    /// The request builder for a DatabaseAdmin::drop_database call.
471    #[derive(Clone, Debug)]
472    pub struct DropDatabase(RequestBuilder<crate::model::DropDatabaseRequest>);
473
474    impl DropDatabase {
475        pub(crate) fn new(stub: Arc<dyn crate::stubs::dynamic::DatabaseAdmin>) -> Self {
476            Self(RequestBuilder::new(stub))
477        }
478
479        /// Sets the full request, replacing any prior values.
480        pub fn with_request<V: Into<crate::model::DropDatabaseRequest>>(mut self, v: V) -> Self {
481            self.0.request = v.into();
482            self
483        }
484
485        /// Sets all the options, replacing any prior values.
486        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
487            self.0.options = v.into();
488            self
489        }
490
491        /// Sends the request.
492        pub async fn send(self) -> Result<wkt::Empty> {
493            (*self.0.stub)
494                .drop_database(self.0.request, self.0.options)
495                .await
496        }
497
498        /// Sets the value of [database][crate::model::DropDatabaseRequest::database].
499        pub fn set_database<T: Into<std::string::String>>(mut self, v: T) -> Self {
500            self.0.request.database = v.into();
501            self
502        }
503    }
504
505    impl gax::options::RequestBuilder for DropDatabase {
506        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
507            &mut self.0.options
508        }
509    }
510
511    /// The request builder for a DatabaseAdmin::get_database_ddl call.
512    #[derive(Clone, Debug)]
513    pub struct GetDatabaseDdl(RequestBuilder<crate::model::GetDatabaseDdlRequest>);
514
515    impl GetDatabaseDdl {
516        pub(crate) fn new(stub: Arc<dyn crate::stubs::dynamic::DatabaseAdmin>) -> Self {
517            Self(RequestBuilder::new(stub))
518        }
519
520        /// Sets the full request, replacing any prior values.
521        pub fn with_request<V: Into<crate::model::GetDatabaseDdlRequest>>(mut self, v: V) -> Self {
522            self.0.request = v.into();
523            self
524        }
525
526        /// Sets all the options, replacing any prior values.
527        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
528            self.0.options = v.into();
529            self
530        }
531
532        /// Sends the request.
533        pub async fn send(self) -> Result<crate::model::GetDatabaseDdlResponse> {
534            (*self.0.stub)
535                .get_database_ddl(self.0.request, self.0.options)
536                .await
537        }
538
539        /// Sets the value of [database][crate::model::GetDatabaseDdlRequest::database].
540        pub fn set_database<T: Into<std::string::String>>(mut self, v: T) -> Self {
541            self.0.request.database = v.into();
542            self
543        }
544    }
545
546    impl gax::options::RequestBuilder for GetDatabaseDdl {
547        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
548            &mut self.0.options
549        }
550    }
551
552    /// The request builder for a DatabaseAdmin::set_iam_policy call.
553    #[derive(Clone, Debug)]
554    pub struct SetIamPolicy(RequestBuilder<iam_v1::model::SetIamPolicyRequest>);
555
556    impl SetIamPolicy {
557        pub(crate) fn new(stub: Arc<dyn crate::stubs::dynamic::DatabaseAdmin>) -> Self {
558            Self(RequestBuilder::new(stub))
559        }
560
561        /// Sets the full request, replacing any prior values.
562        pub fn with_request<V: Into<iam_v1::model::SetIamPolicyRequest>>(mut self, v: V) -> Self {
563            self.0.request = v.into();
564            self
565        }
566
567        /// Sets all the options, replacing any prior values.
568        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
569            self.0.options = v.into();
570            self
571        }
572
573        /// Sends the request.
574        pub async fn send(self) -> Result<iam_v1::model::Policy> {
575            (*self.0.stub)
576                .set_iam_policy(self.0.request, self.0.options)
577                .await
578        }
579
580        /// Sets the value of [resource][iam_v1::model::SetIamPolicyRequest::resource].
581        pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
582            self.0.request.resource = v.into();
583            self
584        }
585
586        /// Sets the value of [policy][iam_v1::model::SetIamPolicyRequest::policy].
587        pub fn set_policy<T: Into<std::option::Option<iam_v1::model::Policy>>>(
588            mut self,
589            v: T,
590        ) -> Self {
591            self.0.request.policy = v.into();
592            self
593        }
594
595        /// Sets the value of [update_mask][iam_v1::model::SetIamPolicyRequest::update_mask].
596        pub fn set_update_mask<T: Into<std::option::Option<wkt::FieldMask>>>(
597            mut self,
598            v: T,
599        ) -> Self {
600            self.0.request.update_mask = v.into();
601            self
602        }
603    }
604
605    impl gax::options::RequestBuilder for SetIamPolicy {
606        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
607            &mut self.0.options
608        }
609    }
610
611    /// The request builder for a DatabaseAdmin::get_iam_policy call.
612    #[derive(Clone, Debug)]
613    pub struct GetIamPolicy(RequestBuilder<iam_v1::model::GetIamPolicyRequest>);
614
615    impl GetIamPolicy {
616        pub(crate) fn new(stub: Arc<dyn crate::stubs::dynamic::DatabaseAdmin>) -> Self {
617            Self(RequestBuilder::new(stub))
618        }
619
620        /// Sets the full request, replacing any prior values.
621        pub fn with_request<V: Into<iam_v1::model::GetIamPolicyRequest>>(mut self, v: V) -> Self {
622            self.0.request = v.into();
623            self
624        }
625
626        /// Sets all the options, replacing any prior values.
627        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
628            self.0.options = v.into();
629            self
630        }
631
632        /// Sends the request.
633        pub async fn send(self) -> Result<iam_v1::model::Policy> {
634            (*self.0.stub)
635                .get_iam_policy(self.0.request, self.0.options)
636                .await
637        }
638
639        /// Sets the value of [resource][iam_v1::model::GetIamPolicyRequest::resource].
640        pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
641            self.0.request.resource = v.into();
642            self
643        }
644
645        /// Sets the value of [options][iam_v1::model::GetIamPolicyRequest::options].
646        pub fn set_options<T: Into<std::option::Option<iam_v1::model::GetPolicyOptions>>>(
647            mut self,
648            v: T,
649        ) -> Self {
650            self.0.request.options = v.into();
651            self
652        }
653    }
654
655    impl gax::options::RequestBuilder for GetIamPolicy {
656        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
657            &mut self.0.options
658        }
659    }
660
661    /// The request builder for a DatabaseAdmin::test_iam_permissions call.
662    #[derive(Clone, Debug)]
663    pub struct TestIamPermissions(RequestBuilder<iam_v1::model::TestIamPermissionsRequest>);
664
665    impl TestIamPermissions {
666        pub(crate) fn new(stub: Arc<dyn crate::stubs::dynamic::DatabaseAdmin>) -> Self {
667            Self(RequestBuilder::new(stub))
668        }
669
670        /// Sets the full request, replacing any prior values.
671        pub fn with_request<V: Into<iam_v1::model::TestIamPermissionsRequest>>(
672            mut self,
673            v: V,
674        ) -> Self {
675            self.0.request = v.into();
676            self
677        }
678
679        /// Sets all the options, replacing any prior values.
680        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
681            self.0.options = v.into();
682            self
683        }
684
685        /// Sends the request.
686        pub async fn send(self) -> Result<iam_v1::model::TestIamPermissionsResponse> {
687            (*self.0.stub)
688                .test_iam_permissions(self.0.request, self.0.options)
689                .await
690        }
691
692        /// Sets the value of [resource][iam_v1::model::TestIamPermissionsRequest::resource].
693        pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
694            self.0.request.resource = v.into();
695            self
696        }
697
698        /// Sets the value of [permissions][iam_v1::model::TestIamPermissionsRequest::permissions].
699        pub fn set_permissions<T, V>(mut self, v: T) -> Self
700        where
701            T: std::iter::IntoIterator<Item = V>,
702            V: std::convert::Into<std::string::String>,
703        {
704            use std::iter::Iterator;
705            self.0.request.permissions = v.into_iter().map(|i| i.into()).collect();
706            self
707        }
708    }
709
710    impl gax::options::RequestBuilder for TestIamPermissions {
711        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
712            &mut self.0.options
713        }
714    }
715
716    /// The request builder for a DatabaseAdmin::create_backup call.
717    #[derive(Clone, Debug)]
718    pub struct CreateBackup(RequestBuilder<crate::model::CreateBackupRequest>);
719
720    impl CreateBackup {
721        pub(crate) fn new(stub: Arc<dyn crate::stubs::dynamic::DatabaseAdmin>) -> Self {
722            Self(RequestBuilder::new(stub))
723        }
724
725        /// Sets the full request, replacing any prior values.
726        pub fn with_request<V: Into<crate::model::CreateBackupRequest>>(mut self, v: V) -> Self {
727            self.0.request = v.into();
728            self
729        }
730
731        /// Sets all the options, replacing any prior values.
732        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
733            self.0.options = v.into();
734            self
735        }
736
737        /// Sends the request.
738        ///
739        /// # Long running operations
740        ///
741        /// This starts, but does not poll, a longrunning operation. More information
742        /// on [create_backup][crate::client::DatabaseAdmin::create_backup].
743        pub async fn send(self) -> Result<longrunning::model::Operation> {
744            (*self.0.stub)
745                .create_backup(self.0.request, self.0.options)
746                .await
747        }
748
749        /// Creates a [Poller][lro::Poller] to work with `create_backup`.
750        pub fn poller(
751            self,
752        ) -> impl lro::Poller<crate::model::Backup, crate::model::CreateBackupMetadata> {
753            type Operation =
754                lro::Operation<crate::model::Backup, crate::model::CreateBackupMetadata>;
755            let polling_policy = self.0.stub.get_polling_policy(&self.0.options);
756            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
757
758            let stub = self.0.stub.clone();
759            let mut options = self.0.options.clone();
760            options.set_retry_policy(gax::retry_policy::NeverRetry);
761            let query = move |name| {
762                let stub = stub.clone();
763                let options = options.clone();
764                async {
765                    let op = GetOperation::new(stub)
766                        .set_name(name)
767                        .with_options(options)
768                        .send()
769                        .await?;
770                    Ok(Operation::new(op))
771                }
772            };
773
774            let start = move || async {
775                let op = self.send().await?;
776                Ok(Operation::new(op))
777            };
778
779            lro::new_poller(polling_policy, polling_backoff_policy, start, query)
780        }
781
782        /// Sets the value of [parent][crate::model::CreateBackupRequest::parent].
783        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
784            self.0.request.parent = v.into();
785            self
786        }
787
788        /// Sets the value of [backup_id][crate::model::CreateBackupRequest::backup_id].
789        pub fn set_backup_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
790            self.0.request.backup_id = v.into();
791            self
792        }
793
794        /// Sets the value of [backup][crate::model::CreateBackupRequest::backup].
795        pub fn set_backup<T: Into<std::option::Option<crate::model::Backup>>>(
796            mut self,
797            v: T,
798        ) -> Self {
799            self.0.request.backup = v.into();
800            self
801        }
802
803        /// Sets the value of [encryption_config][crate::model::CreateBackupRequest::encryption_config].
804        pub fn set_encryption_config<
805            T: Into<std::option::Option<crate::model::CreateBackupEncryptionConfig>>,
806        >(
807            mut self,
808            v: T,
809        ) -> Self {
810            self.0.request.encryption_config = v.into();
811            self
812        }
813    }
814
815    impl gax::options::RequestBuilder for CreateBackup {
816        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
817            &mut self.0.options
818        }
819    }
820
821    /// The request builder for a DatabaseAdmin::copy_backup call.
822    #[derive(Clone, Debug)]
823    pub struct CopyBackup(RequestBuilder<crate::model::CopyBackupRequest>);
824
825    impl CopyBackup {
826        pub(crate) fn new(stub: Arc<dyn crate::stubs::dynamic::DatabaseAdmin>) -> Self {
827            Self(RequestBuilder::new(stub))
828        }
829
830        /// Sets the full request, replacing any prior values.
831        pub fn with_request<V: Into<crate::model::CopyBackupRequest>>(mut self, v: V) -> Self {
832            self.0.request = v.into();
833            self
834        }
835
836        /// Sets all the options, replacing any prior values.
837        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
838            self.0.options = v.into();
839            self
840        }
841
842        /// Sends the request.
843        ///
844        /// # Long running operations
845        ///
846        /// This starts, but does not poll, a longrunning operation. More information
847        /// on [copy_backup][crate::client::DatabaseAdmin::copy_backup].
848        pub async fn send(self) -> Result<longrunning::model::Operation> {
849            (*self.0.stub)
850                .copy_backup(self.0.request, self.0.options)
851                .await
852        }
853
854        /// Creates a [Poller][lro::Poller] to work with `copy_backup`.
855        pub fn poller(
856            self,
857        ) -> impl lro::Poller<crate::model::Backup, crate::model::CopyBackupMetadata> {
858            type Operation = lro::Operation<crate::model::Backup, crate::model::CopyBackupMetadata>;
859            let polling_policy = self.0.stub.get_polling_policy(&self.0.options);
860            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
861
862            let stub = self.0.stub.clone();
863            let mut options = self.0.options.clone();
864            options.set_retry_policy(gax::retry_policy::NeverRetry);
865            let query = move |name| {
866                let stub = stub.clone();
867                let options = options.clone();
868                async {
869                    let op = GetOperation::new(stub)
870                        .set_name(name)
871                        .with_options(options)
872                        .send()
873                        .await?;
874                    Ok(Operation::new(op))
875                }
876            };
877
878            let start = move || async {
879                let op = self.send().await?;
880                Ok(Operation::new(op))
881            };
882
883            lro::new_poller(polling_policy, polling_backoff_policy, start, query)
884        }
885
886        /// Sets the value of [parent][crate::model::CopyBackupRequest::parent].
887        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
888            self.0.request.parent = v.into();
889            self
890        }
891
892        /// Sets the value of [backup_id][crate::model::CopyBackupRequest::backup_id].
893        pub fn set_backup_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
894            self.0.request.backup_id = v.into();
895            self
896        }
897
898        /// Sets the value of [source_backup][crate::model::CopyBackupRequest::source_backup].
899        pub fn set_source_backup<T: Into<std::string::String>>(mut self, v: T) -> Self {
900            self.0.request.source_backup = v.into();
901            self
902        }
903
904        /// Sets the value of [expire_time][crate::model::CopyBackupRequest::expire_time].
905        pub fn set_expire_time<T: Into<std::option::Option<wkt::Timestamp>>>(
906            mut self,
907            v: T,
908        ) -> Self {
909            self.0.request.expire_time = v.into();
910            self
911        }
912
913        /// Sets the value of [encryption_config][crate::model::CopyBackupRequest::encryption_config].
914        pub fn set_encryption_config<
915            T: Into<std::option::Option<crate::model::CopyBackupEncryptionConfig>>,
916        >(
917            mut self,
918            v: T,
919        ) -> Self {
920            self.0.request.encryption_config = v.into();
921            self
922        }
923    }
924
925    impl gax::options::RequestBuilder for CopyBackup {
926        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
927            &mut self.0.options
928        }
929    }
930
931    /// The request builder for a DatabaseAdmin::get_backup call.
932    #[derive(Clone, Debug)]
933    pub struct GetBackup(RequestBuilder<crate::model::GetBackupRequest>);
934
935    impl GetBackup {
936        pub(crate) fn new(stub: Arc<dyn crate::stubs::dynamic::DatabaseAdmin>) -> Self {
937            Self(RequestBuilder::new(stub))
938        }
939
940        /// Sets the full request, replacing any prior values.
941        pub fn with_request<V: Into<crate::model::GetBackupRequest>>(mut self, v: V) -> Self {
942            self.0.request = v.into();
943            self
944        }
945
946        /// Sets all the options, replacing any prior values.
947        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
948            self.0.options = v.into();
949            self
950        }
951
952        /// Sends the request.
953        pub async fn send(self) -> Result<crate::model::Backup> {
954            (*self.0.stub)
955                .get_backup(self.0.request, self.0.options)
956                .await
957        }
958
959        /// Sets the value of [name][crate::model::GetBackupRequest::name].
960        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
961            self.0.request.name = v.into();
962            self
963        }
964    }
965
966    impl gax::options::RequestBuilder for GetBackup {
967        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
968            &mut self.0.options
969        }
970    }
971
972    /// The request builder for a DatabaseAdmin::update_backup call.
973    #[derive(Clone, Debug)]
974    pub struct UpdateBackup(RequestBuilder<crate::model::UpdateBackupRequest>);
975
976    impl UpdateBackup {
977        pub(crate) fn new(stub: Arc<dyn crate::stubs::dynamic::DatabaseAdmin>) -> Self {
978            Self(RequestBuilder::new(stub))
979        }
980
981        /// Sets the full request, replacing any prior values.
982        pub fn with_request<V: Into<crate::model::UpdateBackupRequest>>(mut self, v: V) -> Self {
983            self.0.request = v.into();
984            self
985        }
986
987        /// Sets all the options, replacing any prior values.
988        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
989            self.0.options = v.into();
990            self
991        }
992
993        /// Sends the request.
994        pub async fn send(self) -> Result<crate::model::Backup> {
995            (*self.0.stub)
996                .update_backup(self.0.request, self.0.options)
997                .await
998        }
999
1000        /// Sets the value of [backup][crate::model::UpdateBackupRequest::backup].
1001        pub fn set_backup<T: Into<std::option::Option<crate::model::Backup>>>(
1002            mut self,
1003            v: T,
1004        ) -> Self {
1005            self.0.request.backup = v.into();
1006            self
1007        }
1008
1009        /// Sets the value of [update_mask][crate::model::UpdateBackupRequest::update_mask].
1010        pub fn set_update_mask<T: Into<std::option::Option<wkt::FieldMask>>>(
1011            mut self,
1012            v: T,
1013        ) -> Self {
1014            self.0.request.update_mask = v.into();
1015            self
1016        }
1017    }
1018
1019    impl gax::options::RequestBuilder for UpdateBackup {
1020        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1021            &mut self.0.options
1022        }
1023    }
1024
1025    /// The request builder for a DatabaseAdmin::delete_backup call.
1026    #[derive(Clone, Debug)]
1027    pub struct DeleteBackup(RequestBuilder<crate::model::DeleteBackupRequest>);
1028
1029    impl DeleteBackup {
1030        pub(crate) fn new(stub: Arc<dyn crate::stubs::dynamic::DatabaseAdmin>) -> Self {
1031            Self(RequestBuilder::new(stub))
1032        }
1033
1034        /// Sets the full request, replacing any prior values.
1035        pub fn with_request<V: Into<crate::model::DeleteBackupRequest>>(mut self, v: V) -> Self {
1036            self.0.request = v.into();
1037            self
1038        }
1039
1040        /// Sets all the options, replacing any prior values.
1041        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1042            self.0.options = v.into();
1043            self
1044        }
1045
1046        /// Sends the request.
1047        pub async fn send(self) -> Result<wkt::Empty> {
1048            (*self.0.stub)
1049                .delete_backup(self.0.request, self.0.options)
1050                .await
1051        }
1052
1053        /// Sets the value of [name][crate::model::DeleteBackupRequest::name].
1054        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1055            self.0.request.name = v.into();
1056            self
1057        }
1058    }
1059
1060    impl gax::options::RequestBuilder for DeleteBackup {
1061        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1062            &mut self.0.options
1063        }
1064    }
1065
1066    /// The request builder for a DatabaseAdmin::list_backups call.
1067    #[derive(Clone, Debug)]
1068    pub struct ListBackups(RequestBuilder<crate::model::ListBackupsRequest>);
1069
1070    impl ListBackups {
1071        pub(crate) fn new(stub: Arc<dyn crate::stubs::dynamic::DatabaseAdmin>) -> Self {
1072            Self(RequestBuilder::new(stub))
1073        }
1074
1075        /// Sets the full request, replacing any prior values.
1076        pub fn with_request<V: Into<crate::model::ListBackupsRequest>>(mut self, v: V) -> Self {
1077            self.0.request = v.into();
1078            self
1079        }
1080
1081        /// Sets all the options, replacing any prior values.
1082        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1083            self.0.options = v.into();
1084            self
1085        }
1086
1087        /// Sends the request.
1088        pub async fn send(self) -> Result<crate::model::ListBackupsResponse> {
1089            (*self.0.stub)
1090                .list_backups(self.0.request, self.0.options)
1091                .await
1092        }
1093
1094        /// Streams the responses back.
1095        #[cfg(feature = "unstable-stream")]
1096        pub async fn stream(
1097            self,
1098        ) -> gax::paginator::Paginator<crate::model::ListBackupsResponse, gax::error::Error>
1099        {
1100            let token = gax::paginator::extract_token(&self.0.request.page_token);
1101            let execute = move |token: String| {
1102                let mut builder = self.clone();
1103                builder.0.request = builder.0.request.set_page_token(token);
1104                builder.send()
1105            };
1106            gax::paginator::Paginator::new(token, execute)
1107        }
1108
1109        /// Sets the value of [parent][crate::model::ListBackupsRequest::parent].
1110        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
1111            self.0.request.parent = v.into();
1112            self
1113        }
1114
1115        /// Sets the value of [filter][crate::model::ListBackupsRequest::filter].
1116        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
1117            self.0.request.filter = v.into();
1118            self
1119        }
1120
1121        /// Sets the value of [page_size][crate::model::ListBackupsRequest::page_size].
1122        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
1123            self.0.request.page_size = v.into();
1124            self
1125        }
1126
1127        /// Sets the value of [page_token][crate::model::ListBackupsRequest::page_token].
1128        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
1129            self.0.request.page_token = v.into();
1130            self
1131        }
1132    }
1133
1134    impl gax::options::RequestBuilder for ListBackups {
1135        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1136            &mut self.0.options
1137        }
1138    }
1139
1140    /// The request builder for a DatabaseAdmin::restore_database call.
1141    #[derive(Clone, Debug)]
1142    pub struct RestoreDatabase(RequestBuilder<crate::model::RestoreDatabaseRequest>);
1143
1144    impl RestoreDatabase {
1145        pub(crate) fn new(stub: Arc<dyn crate::stubs::dynamic::DatabaseAdmin>) -> Self {
1146            Self(RequestBuilder::new(stub))
1147        }
1148
1149        /// Sets the full request, replacing any prior values.
1150        pub fn with_request<V: Into<crate::model::RestoreDatabaseRequest>>(mut self, v: V) -> Self {
1151            self.0.request = v.into();
1152            self
1153        }
1154
1155        /// Sets all the options, replacing any prior values.
1156        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1157            self.0.options = v.into();
1158            self
1159        }
1160
1161        /// Sends the request.
1162        ///
1163        /// # Long running operations
1164        ///
1165        /// This starts, but does not poll, a longrunning operation. More information
1166        /// on [restore_database][crate::client::DatabaseAdmin::restore_database].
1167        pub async fn send(self) -> Result<longrunning::model::Operation> {
1168            (*self.0.stub)
1169                .restore_database(self.0.request, self.0.options)
1170                .await
1171        }
1172
1173        /// Creates a [Poller][lro::Poller] to work with `restore_database`.
1174        pub fn poller(
1175            self,
1176        ) -> impl lro::Poller<crate::model::Database, crate::model::RestoreDatabaseMetadata>
1177        {
1178            type Operation =
1179                lro::Operation<crate::model::Database, crate::model::RestoreDatabaseMetadata>;
1180            let polling_policy = self.0.stub.get_polling_policy(&self.0.options);
1181            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
1182
1183            let stub = self.0.stub.clone();
1184            let mut options = self.0.options.clone();
1185            options.set_retry_policy(gax::retry_policy::NeverRetry);
1186            let query = move |name| {
1187                let stub = stub.clone();
1188                let options = options.clone();
1189                async {
1190                    let op = GetOperation::new(stub)
1191                        .set_name(name)
1192                        .with_options(options)
1193                        .send()
1194                        .await?;
1195                    Ok(Operation::new(op))
1196                }
1197            };
1198
1199            let start = move || async {
1200                let op = self.send().await?;
1201                Ok(Operation::new(op))
1202            };
1203
1204            lro::new_poller(polling_policy, polling_backoff_policy, start, query)
1205        }
1206
1207        /// Sets the value of [parent][crate::model::RestoreDatabaseRequest::parent].
1208        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
1209            self.0.request.parent = v.into();
1210            self
1211        }
1212
1213        /// Sets the value of [database_id][crate::model::RestoreDatabaseRequest::database_id].
1214        pub fn set_database_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
1215            self.0.request.database_id = v.into();
1216            self
1217        }
1218
1219        /// Sets the value of [encryption_config][crate::model::RestoreDatabaseRequest::encryption_config].
1220        pub fn set_encryption_config<
1221            T: Into<std::option::Option<crate::model::RestoreDatabaseEncryptionConfig>>,
1222        >(
1223            mut self,
1224            v: T,
1225        ) -> Self {
1226            self.0.request.encryption_config = v.into();
1227            self
1228        }
1229
1230        /// Sets the value of `source`.
1231        pub fn set_source<T: Into<Option<crate::model::restore_database_request::Source>>>(
1232            mut self,
1233            v: T,
1234        ) -> Self {
1235            self.0.request.source = v.into();
1236            self
1237        }
1238    }
1239
1240    impl gax::options::RequestBuilder for RestoreDatabase {
1241        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1242            &mut self.0.options
1243        }
1244    }
1245
1246    /// The request builder for a DatabaseAdmin::list_database_operations call.
1247    #[derive(Clone, Debug)]
1248    pub struct ListDatabaseOperations(RequestBuilder<crate::model::ListDatabaseOperationsRequest>);
1249
1250    impl ListDatabaseOperations {
1251        pub(crate) fn new(stub: Arc<dyn crate::stubs::dynamic::DatabaseAdmin>) -> Self {
1252            Self(RequestBuilder::new(stub))
1253        }
1254
1255        /// Sets the full request, replacing any prior values.
1256        pub fn with_request<V: Into<crate::model::ListDatabaseOperationsRequest>>(
1257            mut self,
1258            v: V,
1259        ) -> Self {
1260            self.0.request = v.into();
1261            self
1262        }
1263
1264        /// Sets all the options, replacing any prior values.
1265        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1266            self.0.options = v.into();
1267            self
1268        }
1269
1270        /// Sends the request.
1271        pub async fn send(self) -> Result<crate::model::ListDatabaseOperationsResponse> {
1272            (*self.0.stub)
1273                .list_database_operations(self.0.request, self.0.options)
1274                .await
1275        }
1276
1277        /// Streams the responses back.
1278        #[cfg(feature = "unstable-stream")]
1279        pub async fn stream(
1280            self,
1281        ) -> gax::paginator::Paginator<
1282            crate::model::ListDatabaseOperationsResponse,
1283            gax::error::Error,
1284        > {
1285            let token = gax::paginator::extract_token(&self.0.request.page_token);
1286            let execute = move |token: String| {
1287                let mut builder = self.clone();
1288                builder.0.request = builder.0.request.set_page_token(token);
1289                builder.send()
1290            };
1291            gax::paginator::Paginator::new(token, execute)
1292        }
1293
1294        /// Sets the value of [parent][crate::model::ListDatabaseOperationsRequest::parent].
1295        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
1296            self.0.request.parent = v.into();
1297            self
1298        }
1299
1300        /// Sets the value of [filter][crate::model::ListDatabaseOperationsRequest::filter].
1301        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
1302            self.0.request.filter = v.into();
1303            self
1304        }
1305
1306        /// Sets the value of [page_size][crate::model::ListDatabaseOperationsRequest::page_size].
1307        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
1308            self.0.request.page_size = v.into();
1309            self
1310        }
1311
1312        /// Sets the value of [page_token][crate::model::ListDatabaseOperationsRequest::page_token].
1313        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
1314            self.0.request.page_token = v.into();
1315            self
1316        }
1317    }
1318
1319    impl gax::options::RequestBuilder for ListDatabaseOperations {
1320        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1321            &mut self.0.options
1322        }
1323    }
1324
1325    /// The request builder for a DatabaseAdmin::list_backup_operations call.
1326    #[derive(Clone, Debug)]
1327    pub struct ListBackupOperations(RequestBuilder<crate::model::ListBackupOperationsRequest>);
1328
1329    impl ListBackupOperations {
1330        pub(crate) fn new(stub: Arc<dyn crate::stubs::dynamic::DatabaseAdmin>) -> Self {
1331            Self(RequestBuilder::new(stub))
1332        }
1333
1334        /// Sets the full request, replacing any prior values.
1335        pub fn with_request<V: Into<crate::model::ListBackupOperationsRequest>>(
1336            mut self,
1337            v: V,
1338        ) -> Self {
1339            self.0.request = v.into();
1340            self
1341        }
1342
1343        /// Sets all the options, replacing any prior values.
1344        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1345            self.0.options = v.into();
1346            self
1347        }
1348
1349        /// Sends the request.
1350        pub async fn send(self) -> Result<crate::model::ListBackupOperationsResponse> {
1351            (*self.0.stub)
1352                .list_backup_operations(self.0.request, self.0.options)
1353                .await
1354        }
1355
1356        /// Streams the responses back.
1357        #[cfg(feature = "unstable-stream")]
1358        pub async fn stream(
1359            self,
1360        ) -> gax::paginator::Paginator<crate::model::ListBackupOperationsResponse, gax::error::Error>
1361        {
1362            let token = gax::paginator::extract_token(&self.0.request.page_token);
1363            let execute = move |token: String| {
1364                let mut builder = self.clone();
1365                builder.0.request = builder.0.request.set_page_token(token);
1366                builder.send()
1367            };
1368            gax::paginator::Paginator::new(token, execute)
1369        }
1370
1371        /// Sets the value of [parent][crate::model::ListBackupOperationsRequest::parent].
1372        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
1373            self.0.request.parent = v.into();
1374            self
1375        }
1376
1377        /// Sets the value of [filter][crate::model::ListBackupOperationsRequest::filter].
1378        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
1379            self.0.request.filter = v.into();
1380            self
1381        }
1382
1383        /// Sets the value of [page_size][crate::model::ListBackupOperationsRequest::page_size].
1384        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
1385            self.0.request.page_size = v.into();
1386            self
1387        }
1388
1389        /// Sets the value of [page_token][crate::model::ListBackupOperationsRequest::page_token].
1390        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
1391            self.0.request.page_token = v.into();
1392            self
1393        }
1394    }
1395
1396    impl gax::options::RequestBuilder for ListBackupOperations {
1397        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1398            &mut self.0.options
1399        }
1400    }
1401
1402    /// The request builder for a DatabaseAdmin::list_database_roles call.
1403    #[derive(Clone, Debug)]
1404    pub struct ListDatabaseRoles(RequestBuilder<crate::model::ListDatabaseRolesRequest>);
1405
1406    impl ListDatabaseRoles {
1407        pub(crate) fn new(stub: Arc<dyn crate::stubs::dynamic::DatabaseAdmin>) -> Self {
1408            Self(RequestBuilder::new(stub))
1409        }
1410
1411        /// Sets the full request, replacing any prior values.
1412        pub fn with_request<V: Into<crate::model::ListDatabaseRolesRequest>>(
1413            mut self,
1414            v: V,
1415        ) -> Self {
1416            self.0.request = v.into();
1417            self
1418        }
1419
1420        /// Sets all the options, replacing any prior values.
1421        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1422            self.0.options = v.into();
1423            self
1424        }
1425
1426        /// Sends the request.
1427        pub async fn send(self) -> Result<crate::model::ListDatabaseRolesResponse> {
1428            (*self.0.stub)
1429                .list_database_roles(self.0.request, self.0.options)
1430                .await
1431        }
1432
1433        /// Streams the responses back.
1434        #[cfg(feature = "unstable-stream")]
1435        pub async fn stream(
1436            self,
1437        ) -> gax::paginator::Paginator<crate::model::ListDatabaseRolesResponse, gax::error::Error>
1438        {
1439            let token = gax::paginator::extract_token(&self.0.request.page_token);
1440            let execute = move |token: String| {
1441                let mut builder = self.clone();
1442                builder.0.request = builder.0.request.set_page_token(token);
1443                builder.send()
1444            };
1445            gax::paginator::Paginator::new(token, execute)
1446        }
1447
1448        /// Sets the value of [parent][crate::model::ListDatabaseRolesRequest::parent].
1449        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
1450            self.0.request.parent = v.into();
1451            self
1452        }
1453
1454        /// Sets the value of [page_size][crate::model::ListDatabaseRolesRequest::page_size].
1455        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
1456            self.0.request.page_size = v.into();
1457            self
1458        }
1459
1460        /// Sets the value of [page_token][crate::model::ListDatabaseRolesRequest::page_token].
1461        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
1462            self.0.request.page_token = v.into();
1463            self
1464        }
1465    }
1466
1467    impl gax::options::RequestBuilder for ListDatabaseRoles {
1468        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1469            &mut self.0.options
1470        }
1471    }
1472
1473    /// The request builder for a DatabaseAdmin::add_split_points call.
1474    #[derive(Clone, Debug)]
1475    pub struct AddSplitPoints(RequestBuilder<crate::model::AddSplitPointsRequest>);
1476
1477    impl AddSplitPoints {
1478        pub(crate) fn new(stub: Arc<dyn crate::stubs::dynamic::DatabaseAdmin>) -> Self {
1479            Self(RequestBuilder::new(stub))
1480        }
1481
1482        /// Sets the full request, replacing any prior values.
1483        pub fn with_request<V: Into<crate::model::AddSplitPointsRequest>>(mut self, v: V) -> Self {
1484            self.0.request = v.into();
1485            self
1486        }
1487
1488        /// Sets all the options, replacing any prior values.
1489        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1490            self.0.options = v.into();
1491            self
1492        }
1493
1494        /// Sends the request.
1495        pub async fn send(self) -> Result<crate::model::AddSplitPointsResponse> {
1496            (*self.0.stub)
1497                .add_split_points(self.0.request, self.0.options)
1498                .await
1499        }
1500
1501        /// Sets the value of [database][crate::model::AddSplitPointsRequest::database].
1502        pub fn set_database<T: Into<std::string::String>>(mut self, v: T) -> Self {
1503            self.0.request.database = v.into();
1504            self
1505        }
1506
1507        /// Sets the value of [initiator][crate::model::AddSplitPointsRequest::initiator].
1508        pub fn set_initiator<T: Into<std::string::String>>(mut self, v: T) -> Self {
1509            self.0.request.initiator = v.into();
1510            self
1511        }
1512
1513        /// Sets the value of [split_points][crate::model::AddSplitPointsRequest::split_points].
1514        pub fn set_split_points<T, V>(mut self, v: T) -> Self
1515        where
1516            T: std::iter::IntoIterator<Item = V>,
1517            V: std::convert::Into<crate::model::SplitPoints>,
1518        {
1519            use std::iter::Iterator;
1520            self.0.request.split_points = v.into_iter().map(|i| i.into()).collect();
1521            self
1522        }
1523    }
1524
1525    impl gax::options::RequestBuilder for AddSplitPoints {
1526        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1527            &mut self.0.options
1528        }
1529    }
1530
1531    /// The request builder for a DatabaseAdmin::create_backup_schedule call.
1532    #[derive(Clone, Debug)]
1533    pub struct CreateBackupSchedule(RequestBuilder<crate::model::CreateBackupScheduleRequest>);
1534
1535    impl CreateBackupSchedule {
1536        pub(crate) fn new(stub: Arc<dyn crate::stubs::dynamic::DatabaseAdmin>) -> Self {
1537            Self(RequestBuilder::new(stub))
1538        }
1539
1540        /// Sets the full request, replacing any prior values.
1541        pub fn with_request<V: Into<crate::model::CreateBackupScheduleRequest>>(
1542            mut self,
1543            v: V,
1544        ) -> Self {
1545            self.0.request = v.into();
1546            self
1547        }
1548
1549        /// Sets all the options, replacing any prior values.
1550        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1551            self.0.options = v.into();
1552            self
1553        }
1554
1555        /// Sends the request.
1556        pub async fn send(self) -> Result<crate::model::BackupSchedule> {
1557            (*self.0.stub)
1558                .create_backup_schedule(self.0.request, self.0.options)
1559                .await
1560        }
1561
1562        /// Sets the value of [parent][crate::model::CreateBackupScheduleRequest::parent].
1563        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
1564            self.0.request.parent = v.into();
1565            self
1566        }
1567
1568        /// Sets the value of [backup_schedule_id][crate::model::CreateBackupScheduleRequest::backup_schedule_id].
1569        pub fn set_backup_schedule_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
1570            self.0.request.backup_schedule_id = v.into();
1571            self
1572        }
1573
1574        /// Sets the value of [backup_schedule][crate::model::CreateBackupScheduleRequest::backup_schedule].
1575        pub fn set_backup_schedule<T: Into<std::option::Option<crate::model::BackupSchedule>>>(
1576            mut self,
1577            v: T,
1578        ) -> Self {
1579            self.0.request.backup_schedule = v.into();
1580            self
1581        }
1582    }
1583
1584    impl gax::options::RequestBuilder for CreateBackupSchedule {
1585        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1586            &mut self.0.options
1587        }
1588    }
1589
1590    /// The request builder for a DatabaseAdmin::get_backup_schedule call.
1591    #[derive(Clone, Debug)]
1592    pub struct GetBackupSchedule(RequestBuilder<crate::model::GetBackupScheduleRequest>);
1593
1594    impl GetBackupSchedule {
1595        pub(crate) fn new(stub: Arc<dyn crate::stubs::dynamic::DatabaseAdmin>) -> Self {
1596            Self(RequestBuilder::new(stub))
1597        }
1598
1599        /// Sets the full request, replacing any prior values.
1600        pub fn with_request<V: Into<crate::model::GetBackupScheduleRequest>>(
1601            mut self,
1602            v: V,
1603        ) -> Self {
1604            self.0.request = v.into();
1605            self
1606        }
1607
1608        /// Sets all the options, replacing any prior values.
1609        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1610            self.0.options = v.into();
1611            self
1612        }
1613
1614        /// Sends the request.
1615        pub async fn send(self) -> Result<crate::model::BackupSchedule> {
1616            (*self.0.stub)
1617                .get_backup_schedule(self.0.request, self.0.options)
1618                .await
1619        }
1620
1621        /// Sets the value of [name][crate::model::GetBackupScheduleRequest::name].
1622        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1623            self.0.request.name = v.into();
1624            self
1625        }
1626    }
1627
1628    impl gax::options::RequestBuilder for GetBackupSchedule {
1629        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1630            &mut self.0.options
1631        }
1632    }
1633
1634    /// The request builder for a DatabaseAdmin::update_backup_schedule call.
1635    #[derive(Clone, Debug)]
1636    pub struct UpdateBackupSchedule(RequestBuilder<crate::model::UpdateBackupScheduleRequest>);
1637
1638    impl UpdateBackupSchedule {
1639        pub(crate) fn new(stub: Arc<dyn crate::stubs::dynamic::DatabaseAdmin>) -> Self {
1640            Self(RequestBuilder::new(stub))
1641        }
1642
1643        /// Sets the full request, replacing any prior values.
1644        pub fn with_request<V: Into<crate::model::UpdateBackupScheduleRequest>>(
1645            mut self,
1646            v: V,
1647        ) -> Self {
1648            self.0.request = v.into();
1649            self
1650        }
1651
1652        /// Sets all the options, replacing any prior values.
1653        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1654            self.0.options = v.into();
1655            self
1656        }
1657
1658        /// Sends the request.
1659        pub async fn send(self) -> Result<crate::model::BackupSchedule> {
1660            (*self.0.stub)
1661                .update_backup_schedule(self.0.request, self.0.options)
1662                .await
1663        }
1664
1665        /// Sets the value of [backup_schedule][crate::model::UpdateBackupScheduleRequest::backup_schedule].
1666        pub fn set_backup_schedule<T: Into<std::option::Option<crate::model::BackupSchedule>>>(
1667            mut self,
1668            v: T,
1669        ) -> Self {
1670            self.0.request.backup_schedule = v.into();
1671            self
1672        }
1673
1674        /// Sets the value of [update_mask][crate::model::UpdateBackupScheduleRequest::update_mask].
1675        pub fn set_update_mask<T: Into<std::option::Option<wkt::FieldMask>>>(
1676            mut self,
1677            v: T,
1678        ) -> Self {
1679            self.0.request.update_mask = v.into();
1680            self
1681        }
1682    }
1683
1684    impl gax::options::RequestBuilder for UpdateBackupSchedule {
1685        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1686            &mut self.0.options
1687        }
1688    }
1689
1690    /// The request builder for a DatabaseAdmin::delete_backup_schedule call.
1691    #[derive(Clone, Debug)]
1692    pub struct DeleteBackupSchedule(RequestBuilder<crate::model::DeleteBackupScheduleRequest>);
1693
1694    impl DeleteBackupSchedule {
1695        pub(crate) fn new(stub: Arc<dyn crate::stubs::dynamic::DatabaseAdmin>) -> Self {
1696            Self(RequestBuilder::new(stub))
1697        }
1698
1699        /// Sets the full request, replacing any prior values.
1700        pub fn with_request<V: Into<crate::model::DeleteBackupScheduleRequest>>(
1701            mut self,
1702            v: V,
1703        ) -> Self {
1704            self.0.request = v.into();
1705            self
1706        }
1707
1708        /// Sets all the options, replacing any prior values.
1709        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1710            self.0.options = v.into();
1711            self
1712        }
1713
1714        /// Sends the request.
1715        pub async fn send(self) -> Result<wkt::Empty> {
1716            (*self.0.stub)
1717                .delete_backup_schedule(self.0.request, self.0.options)
1718                .await
1719        }
1720
1721        /// Sets the value of [name][crate::model::DeleteBackupScheduleRequest::name].
1722        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1723            self.0.request.name = v.into();
1724            self
1725        }
1726    }
1727
1728    impl gax::options::RequestBuilder for DeleteBackupSchedule {
1729        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1730            &mut self.0.options
1731        }
1732    }
1733
1734    /// The request builder for a DatabaseAdmin::list_backup_schedules call.
1735    #[derive(Clone, Debug)]
1736    pub struct ListBackupSchedules(RequestBuilder<crate::model::ListBackupSchedulesRequest>);
1737
1738    impl ListBackupSchedules {
1739        pub(crate) fn new(stub: Arc<dyn crate::stubs::dynamic::DatabaseAdmin>) -> Self {
1740            Self(RequestBuilder::new(stub))
1741        }
1742
1743        /// Sets the full request, replacing any prior values.
1744        pub fn with_request<V: Into<crate::model::ListBackupSchedulesRequest>>(
1745            mut self,
1746            v: V,
1747        ) -> Self {
1748            self.0.request = v.into();
1749            self
1750        }
1751
1752        /// Sets all the options, replacing any prior values.
1753        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1754            self.0.options = v.into();
1755            self
1756        }
1757
1758        /// Sends the request.
1759        pub async fn send(self) -> Result<crate::model::ListBackupSchedulesResponse> {
1760            (*self.0.stub)
1761                .list_backup_schedules(self.0.request, self.0.options)
1762                .await
1763        }
1764
1765        /// Streams the responses back.
1766        #[cfg(feature = "unstable-stream")]
1767        pub async fn stream(
1768            self,
1769        ) -> gax::paginator::Paginator<crate::model::ListBackupSchedulesResponse, gax::error::Error>
1770        {
1771            let token = gax::paginator::extract_token(&self.0.request.page_token);
1772            let execute = move |token: String| {
1773                let mut builder = self.clone();
1774                builder.0.request = builder.0.request.set_page_token(token);
1775                builder.send()
1776            };
1777            gax::paginator::Paginator::new(token, execute)
1778        }
1779
1780        /// Sets the value of [parent][crate::model::ListBackupSchedulesRequest::parent].
1781        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
1782            self.0.request.parent = v.into();
1783            self
1784        }
1785
1786        /// Sets the value of [page_size][crate::model::ListBackupSchedulesRequest::page_size].
1787        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
1788            self.0.request.page_size = v.into();
1789            self
1790        }
1791
1792        /// Sets the value of [page_token][crate::model::ListBackupSchedulesRequest::page_token].
1793        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
1794            self.0.request.page_token = v.into();
1795            self
1796        }
1797    }
1798
1799    impl gax::options::RequestBuilder for ListBackupSchedules {
1800        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1801            &mut self.0.options
1802        }
1803    }
1804
1805    /// The request builder for a DatabaseAdmin::list_operations call.
1806    #[derive(Clone, Debug)]
1807    pub struct ListOperations(RequestBuilder<longrunning::model::ListOperationsRequest>);
1808
1809    impl ListOperations {
1810        pub(crate) fn new(stub: Arc<dyn crate::stubs::dynamic::DatabaseAdmin>) -> Self {
1811            Self(RequestBuilder::new(stub))
1812        }
1813
1814        /// Sets the full request, replacing any prior values.
1815        pub fn with_request<V: Into<longrunning::model::ListOperationsRequest>>(
1816            mut self,
1817            v: V,
1818        ) -> Self {
1819            self.0.request = v.into();
1820            self
1821        }
1822
1823        /// Sets all the options, replacing any prior values.
1824        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1825            self.0.options = v.into();
1826            self
1827        }
1828
1829        /// Sends the request.
1830        pub async fn send(self) -> Result<longrunning::model::ListOperationsResponse> {
1831            (*self.0.stub)
1832                .list_operations(self.0.request, self.0.options)
1833                .await
1834        }
1835
1836        /// Streams the responses back.
1837        #[cfg(feature = "unstable-stream")]
1838        pub async fn stream(
1839            self,
1840        ) -> gax::paginator::Paginator<longrunning::model::ListOperationsResponse, gax::error::Error>
1841        {
1842            let token = gax::paginator::extract_token(&self.0.request.page_token);
1843            let execute = move |token: String| {
1844                let mut builder = self.clone();
1845                builder.0.request = builder.0.request.set_page_token(token);
1846                builder.send()
1847            };
1848            gax::paginator::Paginator::new(token, execute)
1849        }
1850
1851        /// Sets the value of [name][longrunning::model::ListOperationsRequest::name].
1852        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1853            self.0.request.name = v.into();
1854            self
1855        }
1856
1857        /// Sets the value of [filter][longrunning::model::ListOperationsRequest::filter].
1858        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
1859            self.0.request.filter = v.into();
1860            self
1861        }
1862
1863        /// Sets the value of [page_size][longrunning::model::ListOperationsRequest::page_size].
1864        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
1865            self.0.request.page_size = v.into();
1866            self
1867        }
1868
1869        /// Sets the value of [page_token][longrunning::model::ListOperationsRequest::page_token].
1870        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
1871            self.0.request.page_token = v.into();
1872            self
1873        }
1874    }
1875
1876    impl gax::options::RequestBuilder for ListOperations {
1877        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1878            &mut self.0.options
1879        }
1880    }
1881
1882    /// The request builder for a DatabaseAdmin::get_operation call.
1883    #[derive(Clone, Debug)]
1884    pub struct GetOperation(RequestBuilder<longrunning::model::GetOperationRequest>);
1885
1886    impl GetOperation {
1887        pub(crate) fn new(stub: Arc<dyn crate::stubs::dynamic::DatabaseAdmin>) -> Self {
1888            Self(RequestBuilder::new(stub))
1889        }
1890
1891        /// Sets the full request, replacing any prior values.
1892        pub fn with_request<V: Into<longrunning::model::GetOperationRequest>>(
1893            mut self,
1894            v: V,
1895        ) -> Self {
1896            self.0.request = v.into();
1897            self
1898        }
1899
1900        /// Sets all the options, replacing any prior values.
1901        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1902            self.0.options = v.into();
1903            self
1904        }
1905
1906        /// Sends the request.
1907        pub async fn send(self) -> Result<longrunning::model::Operation> {
1908            (*self.0.stub)
1909                .get_operation(self.0.request, self.0.options)
1910                .await
1911        }
1912
1913        /// Sets the value of [name][longrunning::model::GetOperationRequest::name].
1914        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1915            self.0.request.name = v.into();
1916            self
1917        }
1918    }
1919
1920    impl gax::options::RequestBuilder for GetOperation {
1921        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1922            &mut self.0.options
1923        }
1924    }
1925
1926    /// The request builder for a DatabaseAdmin::delete_operation call.
1927    #[derive(Clone, Debug)]
1928    pub struct DeleteOperation(RequestBuilder<longrunning::model::DeleteOperationRequest>);
1929
1930    impl DeleteOperation {
1931        pub(crate) fn new(stub: Arc<dyn crate::stubs::dynamic::DatabaseAdmin>) -> Self {
1932            Self(RequestBuilder::new(stub))
1933        }
1934
1935        /// Sets the full request, replacing any prior values.
1936        pub fn with_request<V: Into<longrunning::model::DeleteOperationRequest>>(
1937            mut self,
1938            v: V,
1939        ) -> Self {
1940            self.0.request = v.into();
1941            self
1942        }
1943
1944        /// Sets all the options, replacing any prior values.
1945        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1946            self.0.options = v.into();
1947            self
1948        }
1949
1950        /// Sends the request.
1951        pub async fn send(self) -> Result<wkt::Empty> {
1952            (*self.0.stub)
1953                .delete_operation(self.0.request, self.0.options)
1954                .await
1955        }
1956
1957        /// Sets the value of [name][longrunning::model::DeleteOperationRequest::name].
1958        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1959            self.0.request.name = v.into();
1960            self
1961        }
1962    }
1963
1964    impl gax::options::RequestBuilder for DeleteOperation {
1965        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1966            &mut self.0.options
1967        }
1968    }
1969
1970    /// The request builder for a DatabaseAdmin::cancel_operation call.
1971    #[derive(Clone, Debug)]
1972    pub struct CancelOperation(RequestBuilder<longrunning::model::CancelOperationRequest>);
1973
1974    impl CancelOperation {
1975        pub(crate) fn new(stub: Arc<dyn crate::stubs::dynamic::DatabaseAdmin>) -> Self {
1976            Self(RequestBuilder::new(stub))
1977        }
1978
1979        /// Sets the full request, replacing any prior values.
1980        pub fn with_request<V: Into<longrunning::model::CancelOperationRequest>>(
1981            mut self,
1982            v: V,
1983        ) -> Self {
1984            self.0.request = v.into();
1985            self
1986        }
1987
1988        /// Sets all the options, replacing any prior values.
1989        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1990            self.0.options = v.into();
1991            self
1992        }
1993
1994        /// Sends the request.
1995        pub async fn send(self) -> Result<wkt::Empty> {
1996            (*self.0.stub)
1997                .cancel_operation(self.0.request, self.0.options)
1998                .await
1999        }
2000
2001        /// Sets the value of [name][longrunning::model::CancelOperationRequest::name].
2002        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2003            self.0.request.name = v.into();
2004            self
2005        }
2006    }
2007
2008    impl gax::options::RequestBuilder for CancelOperation {
2009        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2010            &mut self.0.options
2011        }
2012    }
2013}