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