1pub mod firestore_admin {
18 use crate::Result;
19
20 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 #[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 #[derive(Clone, Debug)]
92 pub struct CreateIndex(RequestBuilder<crate::model::CreateIndexRequest>);
93
94 impl CreateIndex {
95 pub(crate) fn new(
96 stub: std::sync::Arc<dyn super::super::stub::dynamic::FirestoreAdmin>,
97 ) -> Self {
98 Self(RequestBuilder::new(stub))
99 }
100
101 pub fn with_request<V: Into<crate::model::CreateIndexRequest>>(mut self, v: V) -> Self {
103 self.0.request = v.into();
104 self
105 }
106
107 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
109 self.0.options = v.into();
110 self
111 }
112
113 pub async fn send(self) -> Result<longrunning::model::Operation> {
120 (*self.0.stub)
121 .create_index(self.0.request, self.0.options)
122 .await
123 .map(gax::response::Response::into_body)
124 }
125
126 pub fn poller(
128 self,
129 ) -> impl lro::Poller<crate::model::Index, crate::model::IndexOperationMetadata> {
130 type Operation =
131 lro::internal::Operation<crate::model::Index, crate::model::IndexOperationMetadata>;
132 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
133 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
134
135 let stub = self.0.stub.clone();
136 let mut options = self.0.options.clone();
137 options.set_retry_policy(gax::retry_policy::NeverRetry);
138 let query = move |name| {
139 let stub = stub.clone();
140 let options = options.clone();
141 async {
142 let op = GetOperation::new(stub)
143 .set_name(name)
144 .with_options(options)
145 .send()
146 .await?;
147 Ok(Operation::new(op))
148 }
149 };
150
151 let start = move || async {
152 let op = self.send().await?;
153 Ok(Operation::new(op))
154 };
155
156 lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
157 }
158
159 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
163 self.0.request.parent = v.into();
164 self
165 }
166
167 pub fn set_index<T>(mut self, v: T) -> Self
171 where
172 T: std::convert::Into<crate::model::Index>,
173 {
174 self.0.request.index = std::option::Option::Some(v.into());
175 self
176 }
177
178 pub fn set_or_clear_index<T>(mut self, v: std::option::Option<T>) -> Self
182 where
183 T: std::convert::Into<crate::model::Index>,
184 {
185 self.0.request.index = v.map(|x| x.into());
186 self
187 }
188 }
189
190 #[doc(hidden)]
191 impl gax::options::internal::RequestBuilder for CreateIndex {
192 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
193 &mut self.0.options
194 }
195 }
196
197 #[derive(Clone, Debug)]
218 pub struct ListIndexes(RequestBuilder<crate::model::ListIndexesRequest>);
219
220 impl ListIndexes {
221 pub(crate) fn new(
222 stub: std::sync::Arc<dyn super::super::stub::dynamic::FirestoreAdmin>,
223 ) -> Self {
224 Self(RequestBuilder::new(stub))
225 }
226
227 pub fn with_request<V: Into<crate::model::ListIndexesRequest>>(mut self, v: V) -> Self {
229 self.0.request = v.into();
230 self
231 }
232
233 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
235 self.0.options = v.into();
236 self
237 }
238
239 pub async fn send(self) -> Result<crate::model::ListIndexesResponse> {
241 (*self.0.stub)
242 .list_indexes(self.0.request, self.0.options)
243 .await
244 .map(gax::response::Response::into_body)
245 }
246
247 pub fn by_page(
249 self,
250 ) -> impl gax::paginator::Paginator<crate::model::ListIndexesResponse, gax::error::Error>
251 {
252 use std::clone::Clone;
253 let token = self.0.request.page_token.clone();
254 let execute = move |token: String| {
255 let mut builder = self.clone();
256 builder.0.request = builder.0.request.set_page_token(token);
257 builder.send()
258 };
259 gax::paginator::internal::new_paginator(token, execute)
260 }
261
262 pub fn by_item(
264 self,
265 ) -> impl gax::paginator::ItemPaginator<crate::model::ListIndexesResponse, gax::error::Error>
266 {
267 use gax::paginator::Paginator;
268 self.by_page().items()
269 }
270
271 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
275 self.0.request.parent = v.into();
276 self
277 }
278
279 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
281 self.0.request.filter = v.into();
282 self
283 }
284
285 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
287 self.0.request.page_size = v.into();
288 self
289 }
290
291 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
293 self.0.request.page_token = v.into();
294 self
295 }
296 }
297
298 #[doc(hidden)]
299 impl gax::options::internal::RequestBuilder for ListIndexes {
300 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
301 &mut self.0.options
302 }
303 }
304
305 #[derive(Clone, Debug)]
322 pub struct GetIndex(RequestBuilder<crate::model::GetIndexRequest>);
323
324 impl GetIndex {
325 pub(crate) fn new(
326 stub: std::sync::Arc<dyn super::super::stub::dynamic::FirestoreAdmin>,
327 ) -> Self {
328 Self(RequestBuilder::new(stub))
329 }
330
331 pub fn with_request<V: Into<crate::model::GetIndexRequest>>(mut self, v: V) -> Self {
333 self.0.request = v.into();
334 self
335 }
336
337 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
339 self.0.options = v.into();
340 self
341 }
342
343 pub async fn send(self) -> Result<crate::model::Index> {
345 (*self.0.stub)
346 .get_index(self.0.request, self.0.options)
347 .await
348 .map(gax::response::Response::into_body)
349 }
350
351 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
355 self.0.request.name = v.into();
356 self
357 }
358 }
359
360 #[doc(hidden)]
361 impl gax::options::internal::RequestBuilder for GetIndex {
362 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
363 &mut self.0.options
364 }
365 }
366
367 #[derive(Clone, Debug)]
384 pub struct DeleteIndex(RequestBuilder<crate::model::DeleteIndexRequest>);
385
386 impl DeleteIndex {
387 pub(crate) fn new(
388 stub: std::sync::Arc<dyn super::super::stub::dynamic::FirestoreAdmin>,
389 ) -> Self {
390 Self(RequestBuilder::new(stub))
391 }
392
393 pub fn with_request<V: Into<crate::model::DeleteIndexRequest>>(mut self, v: V) -> Self {
395 self.0.request = v.into();
396 self
397 }
398
399 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
401 self.0.options = v.into();
402 self
403 }
404
405 pub async fn send(self) -> Result<()> {
407 (*self.0.stub)
408 .delete_index(self.0.request, self.0.options)
409 .await
410 .map(gax::response::Response::into_body)
411 }
412
413 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
417 self.0.request.name = v.into();
418 self
419 }
420 }
421
422 #[doc(hidden)]
423 impl gax::options::internal::RequestBuilder for DeleteIndex {
424 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
425 &mut self.0.options
426 }
427 }
428
429 #[derive(Clone, Debug)]
446 pub struct GetField(RequestBuilder<crate::model::GetFieldRequest>);
447
448 impl GetField {
449 pub(crate) fn new(
450 stub: std::sync::Arc<dyn super::super::stub::dynamic::FirestoreAdmin>,
451 ) -> Self {
452 Self(RequestBuilder::new(stub))
453 }
454
455 pub fn with_request<V: Into<crate::model::GetFieldRequest>>(mut self, v: V) -> Self {
457 self.0.request = v.into();
458 self
459 }
460
461 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
463 self.0.options = v.into();
464 self
465 }
466
467 pub async fn send(self) -> Result<crate::model::Field> {
469 (*self.0.stub)
470 .get_field(self.0.request, self.0.options)
471 .await
472 .map(gax::response::Response::into_body)
473 }
474
475 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
479 self.0.request.name = v.into();
480 self
481 }
482 }
483
484 #[doc(hidden)]
485 impl gax::options::internal::RequestBuilder for GetField {
486 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
487 &mut self.0.options
488 }
489 }
490
491 #[derive(Clone, Debug)]
509 pub struct UpdateField(RequestBuilder<crate::model::UpdateFieldRequest>);
510
511 impl UpdateField {
512 pub(crate) fn new(
513 stub: std::sync::Arc<dyn super::super::stub::dynamic::FirestoreAdmin>,
514 ) -> Self {
515 Self(RequestBuilder::new(stub))
516 }
517
518 pub fn with_request<V: Into<crate::model::UpdateFieldRequest>>(mut self, v: V) -> Self {
520 self.0.request = v.into();
521 self
522 }
523
524 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
526 self.0.options = v.into();
527 self
528 }
529
530 pub async fn send(self) -> Result<longrunning::model::Operation> {
537 (*self.0.stub)
538 .update_field(self.0.request, self.0.options)
539 .await
540 .map(gax::response::Response::into_body)
541 }
542
543 pub fn poller(
545 self,
546 ) -> impl lro::Poller<crate::model::Field, crate::model::FieldOperationMetadata> {
547 type Operation =
548 lro::internal::Operation<crate::model::Field, crate::model::FieldOperationMetadata>;
549 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
550 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
551
552 let stub = self.0.stub.clone();
553 let mut options = self.0.options.clone();
554 options.set_retry_policy(gax::retry_policy::NeverRetry);
555 let query = move |name| {
556 let stub = stub.clone();
557 let options = options.clone();
558 async {
559 let op = GetOperation::new(stub)
560 .set_name(name)
561 .with_options(options)
562 .send()
563 .await?;
564 Ok(Operation::new(op))
565 }
566 };
567
568 let start = move || async {
569 let op = self.send().await?;
570 Ok(Operation::new(op))
571 };
572
573 lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
574 }
575
576 pub fn set_field<T>(mut self, v: T) -> Self
580 where
581 T: std::convert::Into<crate::model::Field>,
582 {
583 self.0.request.field = std::option::Option::Some(v.into());
584 self
585 }
586
587 pub fn set_or_clear_field<T>(mut self, v: std::option::Option<T>) -> Self
591 where
592 T: std::convert::Into<crate::model::Field>,
593 {
594 self.0.request.field = v.map(|x| x.into());
595 self
596 }
597
598 pub fn set_update_mask<T>(mut self, v: T) -> Self
600 where
601 T: std::convert::Into<wkt::FieldMask>,
602 {
603 self.0.request.update_mask = std::option::Option::Some(v.into());
604 self
605 }
606
607 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
609 where
610 T: std::convert::Into<wkt::FieldMask>,
611 {
612 self.0.request.update_mask = v.map(|x| x.into());
613 self
614 }
615 }
616
617 #[doc(hidden)]
618 impl gax::options::internal::RequestBuilder for UpdateField {
619 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
620 &mut self.0.options
621 }
622 }
623
624 #[derive(Clone, Debug)]
645 pub struct ListFields(RequestBuilder<crate::model::ListFieldsRequest>);
646
647 impl ListFields {
648 pub(crate) fn new(
649 stub: std::sync::Arc<dyn super::super::stub::dynamic::FirestoreAdmin>,
650 ) -> Self {
651 Self(RequestBuilder::new(stub))
652 }
653
654 pub fn with_request<V: Into<crate::model::ListFieldsRequest>>(mut self, v: V) -> Self {
656 self.0.request = v.into();
657 self
658 }
659
660 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
662 self.0.options = v.into();
663 self
664 }
665
666 pub async fn send(self) -> Result<crate::model::ListFieldsResponse> {
668 (*self.0.stub)
669 .list_fields(self.0.request, self.0.options)
670 .await
671 .map(gax::response::Response::into_body)
672 }
673
674 pub fn by_page(
676 self,
677 ) -> impl gax::paginator::Paginator<crate::model::ListFieldsResponse, gax::error::Error>
678 {
679 use std::clone::Clone;
680 let token = self.0.request.page_token.clone();
681 let execute = move |token: String| {
682 let mut builder = self.clone();
683 builder.0.request = builder.0.request.set_page_token(token);
684 builder.send()
685 };
686 gax::paginator::internal::new_paginator(token, execute)
687 }
688
689 pub fn by_item(
691 self,
692 ) -> impl gax::paginator::ItemPaginator<crate::model::ListFieldsResponse, gax::error::Error>
693 {
694 use gax::paginator::Paginator;
695 self.by_page().items()
696 }
697
698 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
702 self.0.request.parent = v.into();
703 self
704 }
705
706 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
708 self.0.request.filter = v.into();
709 self
710 }
711
712 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
714 self.0.request.page_size = v.into();
715 self
716 }
717
718 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
720 self.0.request.page_token = v.into();
721 self
722 }
723 }
724
725 #[doc(hidden)]
726 impl gax::options::internal::RequestBuilder for ListFields {
727 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
728 &mut self.0.options
729 }
730 }
731
732 #[derive(Clone, Debug)]
750 pub struct ExportDocuments(RequestBuilder<crate::model::ExportDocumentsRequest>);
751
752 impl ExportDocuments {
753 pub(crate) fn new(
754 stub: std::sync::Arc<dyn super::super::stub::dynamic::FirestoreAdmin>,
755 ) -> Self {
756 Self(RequestBuilder::new(stub))
757 }
758
759 pub fn with_request<V: Into<crate::model::ExportDocumentsRequest>>(mut self, v: V) -> Self {
761 self.0.request = v.into();
762 self
763 }
764
765 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
767 self.0.options = v.into();
768 self
769 }
770
771 pub async fn send(self) -> Result<longrunning::model::Operation> {
778 (*self.0.stub)
779 .export_documents(self.0.request, self.0.options)
780 .await
781 .map(gax::response::Response::into_body)
782 }
783
784 pub fn poller(
786 self,
787 ) -> impl lro::Poller<crate::model::ExportDocumentsResponse, crate::model::ExportDocumentsMetadata>
788 {
789 type Operation = lro::internal::Operation<
790 crate::model::ExportDocumentsResponse,
791 crate::model::ExportDocumentsMetadata,
792 >;
793 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
794 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
795
796 let stub = self.0.stub.clone();
797 let mut options = self.0.options.clone();
798 options.set_retry_policy(gax::retry_policy::NeverRetry);
799 let query = move |name| {
800 let stub = stub.clone();
801 let options = options.clone();
802 async {
803 let op = GetOperation::new(stub)
804 .set_name(name)
805 .with_options(options)
806 .send()
807 .await?;
808 Ok(Operation::new(op))
809 }
810 };
811
812 let start = move || async {
813 let op = self.send().await?;
814 Ok(Operation::new(op))
815 };
816
817 lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
818 }
819
820 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
824 self.0.request.name = v.into();
825 self
826 }
827
828 pub fn set_collection_ids<T, V>(mut self, v: T) -> Self
830 where
831 T: std::iter::IntoIterator<Item = V>,
832 V: std::convert::Into<std::string::String>,
833 {
834 use std::iter::Iterator;
835 self.0.request.collection_ids = v.into_iter().map(|i| i.into()).collect();
836 self
837 }
838
839 pub fn set_output_uri_prefix<T: Into<std::string::String>>(mut self, v: T) -> Self {
841 self.0.request.output_uri_prefix = v.into();
842 self
843 }
844
845 pub fn set_namespace_ids<T, V>(mut self, v: T) -> Self
847 where
848 T: std::iter::IntoIterator<Item = V>,
849 V: std::convert::Into<std::string::String>,
850 {
851 use std::iter::Iterator;
852 self.0.request.namespace_ids = v.into_iter().map(|i| i.into()).collect();
853 self
854 }
855
856 pub fn set_snapshot_time<T>(mut self, v: T) -> Self
858 where
859 T: std::convert::Into<wkt::Timestamp>,
860 {
861 self.0.request.snapshot_time = std::option::Option::Some(v.into());
862 self
863 }
864
865 pub fn set_or_clear_snapshot_time<T>(mut self, v: std::option::Option<T>) -> Self
867 where
868 T: std::convert::Into<wkt::Timestamp>,
869 {
870 self.0.request.snapshot_time = v.map(|x| x.into());
871 self
872 }
873 }
874
875 #[doc(hidden)]
876 impl gax::options::internal::RequestBuilder for ExportDocuments {
877 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
878 &mut self.0.options
879 }
880 }
881
882 #[derive(Clone, Debug)]
900 pub struct ImportDocuments(RequestBuilder<crate::model::ImportDocumentsRequest>);
901
902 impl ImportDocuments {
903 pub(crate) fn new(
904 stub: std::sync::Arc<dyn super::super::stub::dynamic::FirestoreAdmin>,
905 ) -> Self {
906 Self(RequestBuilder::new(stub))
907 }
908
909 pub fn with_request<V: Into<crate::model::ImportDocumentsRequest>>(mut self, v: V) -> Self {
911 self.0.request = v.into();
912 self
913 }
914
915 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
917 self.0.options = v.into();
918 self
919 }
920
921 pub async fn send(self) -> Result<longrunning::model::Operation> {
928 (*self.0.stub)
929 .import_documents(self.0.request, self.0.options)
930 .await
931 .map(gax::response::Response::into_body)
932 }
933
934 pub fn poller(self) -> impl lro::Poller<(), crate::model::ImportDocumentsMetadata> {
936 type Operation =
937 lro::internal::Operation<wkt::Empty, crate::model::ImportDocumentsMetadata>;
938 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
939 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
940
941 let stub = self.0.stub.clone();
942 let mut options = self.0.options.clone();
943 options.set_retry_policy(gax::retry_policy::NeverRetry);
944 let query = move |name| {
945 let stub = stub.clone();
946 let options = options.clone();
947 async {
948 let op = GetOperation::new(stub)
949 .set_name(name)
950 .with_options(options)
951 .send()
952 .await?;
953 Ok(Operation::new(op))
954 }
955 };
956
957 let start = move || async {
958 let op = self.send().await?;
959 Ok(Operation::new(op))
960 };
961
962 lro::internal::new_unit_response_poller(
963 polling_error_policy,
964 polling_backoff_policy,
965 start,
966 query,
967 )
968 }
969
970 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
974 self.0.request.name = v.into();
975 self
976 }
977
978 pub fn set_collection_ids<T, V>(mut self, v: T) -> Self
980 where
981 T: std::iter::IntoIterator<Item = V>,
982 V: std::convert::Into<std::string::String>,
983 {
984 use std::iter::Iterator;
985 self.0.request.collection_ids = v.into_iter().map(|i| i.into()).collect();
986 self
987 }
988
989 pub fn set_input_uri_prefix<T: Into<std::string::String>>(mut self, v: T) -> Self {
991 self.0.request.input_uri_prefix = v.into();
992 self
993 }
994
995 pub fn set_namespace_ids<T, V>(mut self, v: T) -> Self
997 where
998 T: std::iter::IntoIterator<Item = V>,
999 V: std::convert::Into<std::string::String>,
1000 {
1001 use std::iter::Iterator;
1002 self.0.request.namespace_ids = v.into_iter().map(|i| i.into()).collect();
1003 self
1004 }
1005 }
1006
1007 #[doc(hidden)]
1008 impl gax::options::internal::RequestBuilder for ImportDocuments {
1009 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1010 &mut self.0.options
1011 }
1012 }
1013
1014 #[derive(Clone, Debug)]
1032 pub struct BulkDeleteDocuments(RequestBuilder<crate::model::BulkDeleteDocumentsRequest>);
1033
1034 impl BulkDeleteDocuments {
1035 pub(crate) fn new(
1036 stub: std::sync::Arc<dyn super::super::stub::dynamic::FirestoreAdmin>,
1037 ) -> Self {
1038 Self(RequestBuilder::new(stub))
1039 }
1040
1041 pub fn with_request<V: Into<crate::model::BulkDeleteDocumentsRequest>>(
1043 mut self,
1044 v: V,
1045 ) -> Self {
1046 self.0.request = v.into();
1047 self
1048 }
1049
1050 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1052 self.0.options = v.into();
1053 self
1054 }
1055
1056 pub async fn send(self) -> Result<longrunning::model::Operation> {
1063 (*self.0.stub)
1064 .bulk_delete_documents(self.0.request, self.0.options)
1065 .await
1066 .map(gax::response::Response::into_body)
1067 }
1068
1069 pub fn poller(
1071 self,
1072 ) -> impl lro::Poller<
1073 crate::model::BulkDeleteDocumentsResponse,
1074 crate::model::BulkDeleteDocumentsMetadata,
1075 > {
1076 type Operation = lro::internal::Operation<
1077 crate::model::BulkDeleteDocumentsResponse,
1078 crate::model::BulkDeleteDocumentsMetadata,
1079 >;
1080 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
1081 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
1082
1083 let stub = self.0.stub.clone();
1084 let mut options = self.0.options.clone();
1085 options.set_retry_policy(gax::retry_policy::NeverRetry);
1086 let query = move |name| {
1087 let stub = stub.clone();
1088 let options = options.clone();
1089 async {
1090 let op = GetOperation::new(stub)
1091 .set_name(name)
1092 .with_options(options)
1093 .send()
1094 .await?;
1095 Ok(Operation::new(op))
1096 }
1097 };
1098
1099 let start = move || async {
1100 let op = self.send().await?;
1101 Ok(Operation::new(op))
1102 };
1103
1104 lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
1105 }
1106
1107 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1111 self.0.request.name = v.into();
1112 self
1113 }
1114
1115 pub fn set_collection_ids<T, V>(mut self, v: T) -> Self
1117 where
1118 T: std::iter::IntoIterator<Item = V>,
1119 V: std::convert::Into<std::string::String>,
1120 {
1121 use std::iter::Iterator;
1122 self.0.request.collection_ids = v.into_iter().map(|i| i.into()).collect();
1123 self
1124 }
1125
1126 pub fn set_namespace_ids<T, V>(mut self, v: T) -> Self
1128 where
1129 T: std::iter::IntoIterator<Item = V>,
1130 V: std::convert::Into<std::string::String>,
1131 {
1132 use std::iter::Iterator;
1133 self.0.request.namespace_ids = v.into_iter().map(|i| i.into()).collect();
1134 self
1135 }
1136 }
1137
1138 #[doc(hidden)]
1139 impl gax::options::internal::RequestBuilder for BulkDeleteDocuments {
1140 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1141 &mut self.0.options
1142 }
1143 }
1144
1145 #[derive(Clone, Debug)]
1163 pub struct CreateDatabase(RequestBuilder<crate::model::CreateDatabaseRequest>);
1164
1165 impl CreateDatabase {
1166 pub(crate) fn new(
1167 stub: std::sync::Arc<dyn super::super::stub::dynamic::FirestoreAdmin>,
1168 ) -> Self {
1169 Self(RequestBuilder::new(stub))
1170 }
1171
1172 pub fn with_request<V: Into<crate::model::CreateDatabaseRequest>>(mut self, v: V) -> Self {
1174 self.0.request = v.into();
1175 self
1176 }
1177
1178 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1180 self.0.options = v.into();
1181 self
1182 }
1183
1184 pub async fn send(self) -> Result<longrunning::model::Operation> {
1191 (*self.0.stub)
1192 .create_database(self.0.request, self.0.options)
1193 .await
1194 .map(gax::response::Response::into_body)
1195 }
1196
1197 pub fn poller(
1199 self,
1200 ) -> impl lro::Poller<crate::model::Database, crate::model::CreateDatabaseMetadata>
1201 {
1202 type Operation = lro::internal::Operation<
1203 crate::model::Database,
1204 crate::model::CreateDatabaseMetadata,
1205 >;
1206 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
1207 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
1208
1209 let stub = self.0.stub.clone();
1210 let mut options = self.0.options.clone();
1211 options.set_retry_policy(gax::retry_policy::NeverRetry);
1212 let query = move |name| {
1213 let stub = stub.clone();
1214 let options = options.clone();
1215 async {
1216 let op = GetOperation::new(stub)
1217 .set_name(name)
1218 .with_options(options)
1219 .send()
1220 .await?;
1221 Ok(Operation::new(op))
1222 }
1223 };
1224
1225 let start = move || async {
1226 let op = self.send().await?;
1227 Ok(Operation::new(op))
1228 };
1229
1230 lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
1231 }
1232
1233 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
1237 self.0.request.parent = v.into();
1238 self
1239 }
1240
1241 pub fn set_database<T>(mut self, v: T) -> Self
1245 where
1246 T: std::convert::Into<crate::model::Database>,
1247 {
1248 self.0.request.database = std::option::Option::Some(v.into());
1249 self
1250 }
1251
1252 pub fn set_or_clear_database<T>(mut self, v: std::option::Option<T>) -> Self
1256 where
1257 T: std::convert::Into<crate::model::Database>,
1258 {
1259 self.0.request.database = v.map(|x| x.into());
1260 self
1261 }
1262
1263 pub fn set_database_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
1267 self.0.request.database_id = v.into();
1268 self
1269 }
1270 }
1271
1272 #[doc(hidden)]
1273 impl gax::options::internal::RequestBuilder for CreateDatabase {
1274 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1275 &mut self.0.options
1276 }
1277 }
1278
1279 #[derive(Clone, Debug)]
1296 pub struct GetDatabase(RequestBuilder<crate::model::GetDatabaseRequest>);
1297
1298 impl GetDatabase {
1299 pub(crate) fn new(
1300 stub: std::sync::Arc<dyn super::super::stub::dynamic::FirestoreAdmin>,
1301 ) -> Self {
1302 Self(RequestBuilder::new(stub))
1303 }
1304
1305 pub fn with_request<V: Into<crate::model::GetDatabaseRequest>>(mut self, v: V) -> Self {
1307 self.0.request = v.into();
1308 self
1309 }
1310
1311 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1313 self.0.options = v.into();
1314 self
1315 }
1316
1317 pub async fn send(self) -> Result<crate::model::Database> {
1319 (*self.0.stub)
1320 .get_database(self.0.request, self.0.options)
1321 .await
1322 .map(gax::response::Response::into_body)
1323 }
1324
1325 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1329 self.0.request.name = v.into();
1330 self
1331 }
1332 }
1333
1334 #[doc(hidden)]
1335 impl gax::options::internal::RequestBuilder for GetDatabase {
1336 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1337 &mut self.0.options
1338 }
1339 }
1340
1341 #[derive(Clone, Debug)]
1358 pub struct ListDatabases(RequestBuilder<crate::model::ListDatabasesRequest>);
1359
1360 impl ListDatabases {
1361 pub(crate) fn new(
1362 stub: std::sync::Arc<dyn super::super::stub::dynamic::FirestoreAdmin>,
1363 ) -> Self {
1364 Self(RequestBuilder::new(stub))
1365 }
1366
1367 pub fn with_request<V: Into<crate::model::ListDatabasesRequest>>(mut self, v: V) -> Self {
1369 self.0.request = v.into();
1370 self
1371 }
1372
1373 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1375 self.0.options = v.into();
1376 self
1377 }
1378
1379 pub async fn send(self) -> Result<crate::model::ListDatabasesResponse> {
1381 (*self.0.stub)
1382 .list_databases(self.0.request, self.0.options)
1383 .await
1384 .map(gax::response::Response::into_body)
1385 }
1386
1387 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
1391 self.0.request.parent = v.into();
1392 self
1393 }
1394
1395 pub fn set_show_deleted<T: Into<bool>>(mut self, v: T) -> Self {
1397 self.0.request.show_deleted = v.into();
1398 self
1399 }
1400 }
1401
1402 #[doc(hidden)]
1403 impl gax::options::internal::RequestBuilder for ListDatabases {
1404 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1405 &mut self.0.options
1406 }
1407 }
1408
1409 #[derive(Clone, Debug)]
1427 pub struct UpdateDatabase(RequestBuilder<crate::model::UpdateDatabaseRequest>);
1428
1429 impl UpdateDatabase {
1430 pub(crate) fn new(
1431 stub: std::sync::Arc<dyn super::super::stub::dynamic::FirestoreAdmin>,
1432 ) -> Self {
1433 Self(RequestBuilder::new(stub))
1434 }
1435
1436 pub fn with_request<V: Into<crate::model::UpdateDatabaseRequest>>(mut self, v: V) -> Self {
1438 self.0.request = v.into();
1439 self
1440 }
1441
1442 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1444 self.0.options = v.into();
1445 self
1446 }
1447
1448 pub async fn send(self) -> Result<longrunning::model::Operation> {
1455 (*self.0.stub)
1456 .update_database(self.0.request, self.0.options)
1457 .await
1458 .map(gax::response::Response::into_body)
1459 }
1460
1461 pub fn poller(
1463 self,
1464 ) -> impl lro::Poller<crate::model::Database, crate::model::UpdateDatabaseMetadata>
1465 {
1466 type Operation = lro::internal::Operation<
1467 crate::model::Database,
1468 crate::model::UpdateDatabaseMetadata,
1469 >;
1470 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
1471 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
1472
1473 let stub = self.0.stub.clone();
1474 let mut options = self.0.options.clone();
1475 options.set_retry_policy(gax::retry_policy::NeverRetry);
1476 let query = move |name| {
1477 let stub = stub.clone();
1478 let options = options.clone();
1479 async {
1480 let op = GetOperation::new(stub)
1481 .set_name(name)
1482 .with_options(options)
1483 .send()
1484 .await?;
1485 Ok(Operation::new(op))
1486 }
1487 };
1488
1489 let start = move || async {
1490 let op = self.send().await?;
1491 Ok(Operation::new(op))
1492 };
1493
1494 lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
1495 }
1496
1497 pub fn set_database<T>(mut self, v: T) -> Self
1501 where
1502 T: std::convert::Into<crate::model::Database>,
1503 {
1504 self.0.request.database = std::option::Option::Some(v.into());
1505 self
1506 }
1507
1508 pub fn set_or_clear_database<T>(mut self, v: std::option::Option<T>) -> Self
1512 where
1513 T: std::convert::Into<crate::model::Database>,
1514 {
1515 self.0.request.database = v.map(|x| x.into());
1516 self
1517 }
1518
1519 pub fn set_update_mask<T>(mut self, v: T) -> Self
1521 where
1522 T: std::convert::Into<wkt::FieldMask>,
1523 {
1524 self.0.request.update_mask = std::option::Option::Some(v.into());
1525 self
1526 }
1527
1528 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
1530 where
1531 T: std::convert::Into<wkt::FieldMask>,
1532 {
1533 self.0.request.update_mask = v.map(|x| x.into());
1534 self
1535 }
1536 }
1537
1538 #[doc(hidden)]
1539 impl gax::options::internal::RequestBuilder for UpdateDatabase {
1540 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1541 &mut self.0.options
1542 }
1543 }
1544
1545 #[derive(Clone, Debug)]
1563 pub struct DeleteDatabase(RequestBuilder<crate::model::DeleteDatabaseRequest>);
1564
1565 impl DeleteDatabase {
1566 pub(crate) fn new(
1567 stub: std::sync::Arc<dyn super::super::stub::dynamic::FirestoreAdmin>,
1568 ) -> Self {
1569 Self(RequestBuilder::new(stub))
1570 }
1571
1572 pub fn with_request<V: Into<crate::model::DeleteDatabaseRequest>>(mut self, v: V) -> Self {
1574 self.0.request = v.into();
1575 self
1576 }
1577
1578 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1580 self.0.options = v.into();
1581 self
1582 }
1583
1584 pub async fn send(self) -> Result<longrunning::model::Operation> {
1591 (*self.0.stub)
1592 .delete_database(self.0.request, self.0.options)
1593 .await
1594 .map(gax::response::Response::into_body)
1595 }
1596
1597 pub fn poller(
1599 self,
1600 ) -> impl lro::Poller<crate::model::Database, crate::model::DeleteDatabaseMetadata>
1601 {
1602 type Operation = lro::internal::Operation<
1603 crate::model::Database,
1604 crate::model::DeleteDatabaseMetadata,
1605 >;
1606 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
1607 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
1608
1609 let stub = self.0.stub.clone();
1610 let mut options = self.0.options.clone();
1611 options.set_retry_policy(gax::retry_policy::NeverRetry);
1612 let query = move |name| {
1613 let stub = stub.clone();
1614 let options = options.clone();
1615 async {
1616 let op = GetOperation::new(stub)
1617 .set_name(name)
1618 .with_options(options)
1619 .send()
1620 .await?;
1621 Ok(Operation::new(op))
1622 }
1623 };
1624
1625 let start = move || async {
1626 let op = self.send().await?;
1627 Ok(Operation::new(op))
1628 };
1629
1630 lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
1631 }
1632
1633 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1637 self.0.request.name = v.into();
1638 self
1639 }
1640
1641 pub fn set_etag<T: Into<std::string::String>>(mut self, v: T) -> Self {
1643 self.0.request.etag = v.into();
1644 self
1645 }
1646 }
1647
1648 #[doc(hidden)]
1649 impl gax::options::internal::RequestBuilder for DeleteDatabase {
1650 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1651 &mut self.0.options
1652 }
1653 }
1654
1655 #[derive(Clone, Debug)]
1672 pub struct CreateUserCreds(RequestBuilder<crate::model::CreateUserCredsRequest>);
1673
1674 impl CreateUserCreds {
1675 pub(crate) fn new(
1676 stub: std::sync::Arc<dyn super::super::stub::dynamic::FirestoreAdmin>,
1677 ) -> Self {
1678 Self(RequestBuilder::new(stub))
1679 }
1680
1681 pub fn with_request<V: Into<crate::model::CreateUserCredsRequest>>(mut self, v: V) -> Self {
1683 self.0.request = v.into();
1684 self
1685 }
1686
1687 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1689 self.0.options = v.into();
1690 self
1691 }
1692
1693 pub async fn send(self) -> Result<crate::model::UserCreds> {
1695 (*self.0.stub)
1696 .create_user_creds(self.0.request, self.0.options)
1697 .await
1698 .map(gax::response::Response::into_body)
1699 }
1700
1701 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
1705 self.0.request.parent = v.into();
1706 self
1707 }
1708
1709 pub fn set_user_creds<T>(mut self, v: T) -> Self
1713 where
1714 T: std::convert::Into<crate::model::UserCreds>,
1715 {
1716 self.0.request.user_creds = std::option::Option::Some(v.into());
1717 self
1718 }
1719
1720 pub fn set_or_clear_user_creds<T>(mut self, v: std::option::Option<T>) -> Self
1724 where
1725 T: std::convert::Into<crate::model::UserCreds>,
1726 {
1727 self.0.request.user_creds = v.map(|x| x.into());
1728 self
1729 }
1730
1731 pub fn set_user_creds_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
1735 self.0.request.user_creds_id = v.into();
1736 self
1737 }
1738 }
1739
1740 #[doc(hidden)]
1741 impl gax::options::internal::RequestBuilder for CreateUserCreds {
1742 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1743 &mut self.0.options
1744 }
1745 }
1746
1747 #[derive(Clone, Debug)]
1764 pub struct GetUserCreds(RequestBuilder<crate::model::GetUserCredsRequest>);
1765
1766 impl GetUserCreds {
1767 pub(crate) fn new(
1768 stub: std::sync::Arc<dyn super::super::stub::dynamic::FirestoreAdmin>,
1769 ) -> Self {
1770 Self(RequestBuilder::new(stub))
1771 }
1772
1773 pub fn with_request<V: Into<crate::model::GetUserCredsRequest>>(mut self, v: V) -> Self {
1775 self.0.request = v.into();
1776 self
1777 }
1778
1779 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1781 self.0.options = v.into();
1782 self
1783 }
1784
1785 pub async fn send(self) -> Result<crate::model::UserCreds> {
1787 (*self.0.stub)
1788 .get_user_creds(self.0.request, self.0.options)
1789 .await
1790 .map(gax::response::Response::into_body)
1791 }
1792
1793 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1797 self.0.request.name = v.into();
1798 self
1799 }
1800 }
1801
1802 #[doc(hidden)]
1803 impl gax::options::internal::RequestBuilder for GetUserCreds {
1804 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1805 &mut self.0.options
1806 }
1807 }
1808
1809 #[derive(Clone, Debug)]
1826 pub struct ListUserCreds(RequestBuilder<crate::model::ListUserCredsRequest>);
1827
1828 impl ListUserCreds {
1829 pub(crate) fn new(
1830 stub: std::sync::Arc<dyn super::super::stub::dynamic::FirestoreAdmin>,
1831 ) -> Self {
1832 Self(RequestBuilder::new(stub))
1833 }
1834
1835 pub fn with_request<V: Into<crate::model::ListUserCredsRequest>>(mut self, v: V) -> Self {
1837 self.0.request = v.into();
1838 self
1839 }
1840
1841 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1843 self.0.options = v.into();
1844 self
1845 }
1846
1847 pub async fn send(self) -> Result<crate::model::ListUserCredsResponse> {
1849 (*self.0.stub)
1850 .list_user_creds(self.0.request, self.0.options)
1851 .await
1852 .map(gax::response::Response::into_body)
1853 }
1854
1855 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
1859 self.0.request.parent = v.into();
1860 self
1861 }
1862 }
1863
1864 #[doc(hidden)]
1865 impl gax::options::internal::RequestBuilder for ListUserCreds {
1866 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1867 &mut self.0.options
1868 }
1869 }
1870
1871 #[derive(Clone, Debug)]
1888 pub struct EnableUserCreds(RequestBuilder<crate::model::EnableUserCredsRequest>);
1889
1890 impl EnableUserCreds {
1891 pub(crate) fn new(
1892 stub: std::sync::Arc<dyn super::super::stub::dynamic::FirestoreAdmin>,
1893 ) -> Self {
1894 Self(RequestBuilder::new(stub))
1895 }
1896
1897 pub fn with_request<V: Into<crate::model::EnableUserCredsRequest>>(mut self, v: V) -> Self {
1899 self.0.request = v.into();
1900 self
1901 }
1902
1903 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1905 self.0.options = v.into();
1906 self
1907 }
1908
1909 pub async fn send(self) -> Result<crate::model::UserCreds> {
1911 (*self.0.stub)
1912 .enable_user_creds(self.0.request, self.0.options)
1913 .await
1914 .map(gax::response::Response::into_body)
1915 }
1916
1917 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1921 self.0.request.name = v.into();
1922 self
1923 }
1924 }
1925
1926 #[doc(hidden)]
1927 impl gax::options::internal::RequestBuilder for EnableUserCreds {
1928 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1929 &mut self.0.options
1930 }
1931 }
1932
1933 #[derive(Clone, Debug)]
1950 pub struct DisableUserCreds(RequestBuilder<crate::model::DisableUserCredsRequest>);
1951
1952 impl DisableUserCreds {
1953 pub(crate) fn new(
1954 stub: std::sync::Arc<dyn super::super::stub::dynamic::FirestoreAdmin>,
1955 ) -> Self {
1956 Self(RequestBuilder::new(stub))
1957 }
1958
1959 pub fn with_request<V: Into<crate::model::DisableUserCredsRequest>>(
1961 mut self,
1962 v: V,
1963 ) -> Self {
1964 self.0.request = v.into();
1965 self
1966 }
1967
1968 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1970 self.0.options = v.into();
1971 self
1972 }
1973
1974 pub async fn send(self) -> Result<crate::model::UserCreds> {
1976 (*self.0.stub)
1977 .disable_user_creds(self.0.request, self.0.options)
1978 .await
1979 .map(gax::response::Response::into_body)
1980 }
1981
1982 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1986 self.0.request.name = v.into();
1987 self
1988 }
1989 }
1990
1991 #[doc(hidden)]
1992 impl gax::options::internal::RequestBuilder for DisableUserCreds {
1993 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1994 &mut self.0.options
1995 }
1996 }
1997
1998 #[derive(Clone, Debug)]
2015 pub struct ResetUserPassword(RequestBuilder<crate::model::ResetUserPasswordRequest>);
2016
2017 impl ResetUserPassword {
2018 pub(crate) fn new(
2019 stub: std::sync::Arc<dyn super::super::stub::dynamic::FirestoreAdmin>,
2020 ) -> Self {
2021 Self(RequestBuilder::new(stub))
2022 }
2023
2024 pub fn with_request<V: Into<crate::model::ResetUserPasswordRequest>>(
2026 mut self,
2027 v: V,
2028 ) -> Self {
2029 self.0.request = v.into();
2030 self
2031 }
2032
2033 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2035 self.0.options = v.into();
2036 self
2037 }
2038
2039 pub async fn send(self) -> Result<crate::model::UserCreds> {
2041 (*self.0.stub)
2042 .reset_user_password(self.0.request, self.0.options)
2043 .await
2044 .map(gax::response::Response::into_body)
2045 }
2046
2047 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2051 self.0.request.name = v.into();
2052 self
2053 }
2054 }
2055
2056 #[doc(hidden)]
2057 impl gax::options::internal::RequestBuilder for ResetUserPassword {
2058 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2059 &mut self.0.options
2060 }
2061 }
2062
2063 #[derive(Clone, Debug)]
2080 pub struct DeleteUserCreds(RequestBuilder<crate::model::DeleteUserCredsRequest>);
2081
2082 impl DeleteUserCreds {
2083 pub(crate) fn new(
2084 stub: std::sync::Arc<dyn super::super::stub::dynamic::FirestoreAdmin>,
2085 ) -> Self {
2086 Self(RequestBuilder::new(stub))
2087 }
2088
2089 pub fn with_request<V: Into<crate::model::DeleteUserCredsRequest>>(mut self, v: V) -> Self {
2091 self.0.request = v.into();
2092 self
2093 }
2094
2095 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2097 self.0.options = v.into();
2098 self
2099 }
2100
2101 pub async fn send(self) -> Result<()> {
2103 (*self.0.stub)
2104 .delete_user_creds(self.0.request, self.0.options)
2105 .await
2106 .map(gax::response::Response::into_body)
2107 }
2108
2109 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2113 self.0.request.name = v.into();
2114 self
2115 }
2116 }
2117
2118 #[doc(hidden)]
2119 impl gax::options::internal::RequestBuilder for DeleteUserCreds {
2120 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2121 &mut self.0.options
2122 }
2123 }
2124
2125 #[derive(Clone, Debug)]
2142 pub struct GetBackup(RequestBuilder<crate::model::GetBackupRequest>);
2143
2144 impl GetBackup {
2145 pub(crate) fn new(
2146 stub: std::sync::Arc<dyn super::super::stub::dynamic::FirestoreAdmin>,
2147 ) -> Self {
2148 Self(RequestBuilder::new(stub))
2149 }
2150
2151 pub fn with_request<V: Into<crate::model::GetBackupRequest>>(mut self, v: V) -> Self {
2153 self.0.request = v.into();
2154 self
2155 }
2156
2157 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2159 self.0.options = v.into();
2160 self
2161 }
2162
2163 pub async fn send(self) -> Result<crate::model::Backup> {
2165 (*self.0.stub)
2166 .get_backup(self.0.request, self.0.options)
2167 .await
2168 .map(gax::response::Response::into_body)
2169 }
2170
2171 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2175 self.0.request.name = v.into();
2176 self
2177 }
2178 }
2179
2180 #[doc(hidden)]
2181 impl gax::options::internal::RequestBuilder for GetBackup {
2182 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2183 &mut self.0.options
2184 }
2185 }
2186
2187 #[derive(Clone, Debug)]
2204 pub struct ListBackups(RequestBuilder<crate::model::ListBackupsRequest>);
2205
2206 impl ListBackups {
2207 pub(crate) fn new(
2208 stub: std::sync::Arc<dyn super::super::stub::dynamic::FirestoreAdmin>,
2209 ) -> Self {
2210 Self(RequestBuilder::new(stub))
2211 }
2212
2213 pub fn with_request<V: Into<crate::model::ListBackupsRequest>>(mut self, v: V) -> Self {
2215 self.0.request = v.into();
2216 self
2217 }
2218
2219 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2221 self.0.options = v.into();
2222 self
2223 }
2224
2225 pub async fn send(self) -> Result<crate::model::ListBackupsResponse> {
2227 (*self.0.stub)
2228 .list_backups(self.0.request, self.0.options)
2229 .await
2230 .map(gax::response::Response::into_body)
2231 }
2232
2233 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
2237 self.0.request.parent = v.into();
2238 self
2239 }
2240
2241 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
2243 self.0.request.filter = v.into();
2244 self
2245 }
2246 }
2247
2248 #[doc(hidden)]
2249 impl gax::options::internal::RequestBuilder for ListBackups {
2250 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2251 &mut self.0.options
2252 }
2253 }
2254
2255 #[derive(Clone, Debug)]
2272 pub struct DeleteBackup(RequestBuilder<crate::model::DeleteBackupRequest>);
2273
2274 impl DeleteBackup {
2275 pub(crate) fn new(
2276 stub: std::sync::Arc<dyn super::super::stub::dynamic::FirestoreAdmin>,
2277 ) -> Self {
2278 Self(RequestBuilder::new(stub))
2279 }
2280
2281 pub fn with_request<V: Into<crate::model::DeleteBackupRequest>>(mut self, v: V) -> Self {
2283 self.0.request = v.into();
2284 self
2285 }
2286
2287 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2289 self.0.options = v.into();
2290 self
2291 }
2292
2293 pub async fn send(self) -> Result<()> {
2295 (*self.0.stub)
2296 .delete_backup(self.0.request, self.0.options)
2297 .await
2298 .map(gax::response::Response::into_body)
2299 }
2300
2301 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2305 self.0.request.name = v.into();
2306 self
2307 }
2308 }
2309
2310 #[doc(hidden)]
2311 impl gax::options::internal::RequestBuilder for DeleteBackup {
2312 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2313 &mut self.0.options
2314 }
2315 }
2316
2317 #[derive(Clone, Debug)]
2335 pub struct RestoreDatabase(RequestBuilder<crate::model::RestoreDatabaseRequest>);
2336
2337 impl RestoreDatabase {
2338 pub(crate) fn new(
2339 stub: std::sync::Arc<dyn super::super::stub::dynamic::FirestoreAdmin>,
2340 ) -> Self {
2341 Self(RequestBuilder::new(stub))
2342 }
2343
2344 pub fn with_request<V: Into<crate::model::RestoreDatabaseRequest>>(mut self, v: V) -> Self {
2346 self.0.request = v.into();
2347 self
2348 }
2349
2350 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2352 self.0.options = v.into();
2353 self
2354 }
2355
2356 pub async fn send(self) -> Result<longrunning::model::Operation> {
2363 (*self.0.stub)
2364 .restore_database(self.0.request, self.0.options)
2365 .await
2366 .map(gax::response::Response::into_body)
2367 }
2368
2369 pub fn poller(
2371 self,
2372 ) -> impl lro::Poller<crate::model::Database, crate::model::RestoreDatabaseMetadata>
2373 {
2374 type Operation = lro::internal::Operation<
2375 crate::model::Database,
2376 crate::model::RestoreDatabaseMetadata,
2377 >;
2378 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
2379 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
2380
2381 let stub = self.0.stub.clone();
2382 let mut options = self.0.options.clone();
2383 options.set_retry_policy(gax::retry_policy::NeverRetry);
2384 let query = move |name| {
2385 let stub = stub.clone();
2386 let options = options.clone();
2387 async {
2388 let op = GetOperation::new(stub)
2389 .set_name(name)
2390 .with_options(options)
2391 .send()
2392 .await?;
2393 Ok(Operation::new(op))
2394 }
2395 };
2396
2397 let start = move || async {
2398 let op = self.send().await?;
2399 Ok(Operation::new(op))
2400 };
2401
2402 lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
2403 }
2404
2405 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
2409 self.0.request.parent = v.into();
2410 self
2411 }
2412
2413 pub fn set_database_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
2417 self.0.request.database_id = v.into();
2418 self
2419 }
2420
2421 pub fn set_backup<T: Into<std::string::String>>(mut self, v: T) -> Self {
2425 self.0.request.backup = v.into();
2426 self
2427 }
2428
2429 pub fn set_encryption_config<T>(mut self, v: T) -> Self
2431 where
2432 T: std::convert::Into<crate::model::database::EncryptionConfig>,
2433 {
2434 self.0.request.encryption_config = std::option::Option::Some(v.into());
2435 self
2436 }
2437
2438 pub fn set_or_clear_encryption_config<T>(mut self, v: std::option::Option<T>) -> Self
2440 where
2441 T: std::convert::Into<crate::model::database::EncryptionConfig>,
2442 {
2443 self.0.request.encryption_config = v.map(|x| x.into());
2444 self
2445 }
2446
2447 pub fn set_tags<T, K, V>(mut self, v: T) -> Self
2449 where
2450 T: std::iter::IntoIterator<Item = (K, V)>,
2451 K: std::convert::Into<std::string::String>,
2452 V: std::convert::Into<std::string::String>,
2453 {
2454 self.0.request.tags = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
2455 self
2456 }
2457 }
2458
2459 #[doc(hidden)]
2460 impl gax::options::internal::RequestBuilder for RestoreDatabase {
2461 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2462 &mut self.0.options
2463 }
2464 }
2465
2466 #[derive(Clone, Debug)]
2483 pub struct CreateBackupSchedule(RequestBuilder<crate::model::CreateBackupScheduleRequest>);
2484
2485 impl CreateBackupSchedule {
2486 pub(crate) fn new(
2487 stub: std::sync::Arc<dyn super::super::stub::dynamic::FirestoreAdmin>,
2488 ) -> Self {
2489 Self(RequestBuilder::new(stub))
2490 }
2491
2492 pub fn with_request<V: Into<crate::model::CreateBackupScheduleRequest>>(
2494 mut self,
2495 v: V,
2496 ) -> Self {
2497 self.0.request = v.into();
2498 self
2499 }
2500
2501 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2503 self.0.options = v.into();
2504 self
2505 }
2506
2507 pub async fn send(self) -> Result<crate::model::BackupSchedule> {
2509 (*self.0.stub)
2510 .create_backup_schedule(self.0.request, self.0.options)
2511 .await
2512 .map(gax::response::Response::into_body)
2513 }
2514
2515 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
2519 self.0.request.parent = v.into();
2520 self
2521 }
2522
2523 pub fn set_backup_schedule<T>(mut self, v: T) -> Self
2527 where
2528 T: std::convert::Into<crate::model::BackupSchedule>,
2529 {
2530 self.0.request.backup_schedule = std::option::Option::Some(v.into());
2531 self
2532 }
2533
2534 pub fn set_or_clear_backup_schedule<T>(mut self, v: std::option::Option<T>) -> Self
2538 where
2539 T: std::convert::Into<crate::model::BackupSchedule>,
2540 {
2541 self.0.request.backup_schedule = v.map(|x| x.into());
2542 self
2543 }
2544 }
2545
2546 #[doc(hidden)]
2547 impl gax::options::internal::RequestBuilder for CreateBackupSchedule {
2548 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2549 &mut self.0.options
2550 }
2551 }
2552
2553 #[derive(Clone, Debug)]
2570 pub struct GetBackupSchedule(RequestBuilder<crate::model::GetBackupScheduleRequest>);
2571
2572 impl GetBackupSchedule {
2573 pub(crate) fn new(
2574 stub: std::sync::Arc<dyn super::super::stub::dynamic::FirestoreAdmin>,
2575 ) -> Self {
2576 Self(RequestBuilder::new(stub))
2577 }
2578
2579 pub fn with_request<V: Into<crate::model::GetBackupScheduleRequest>>(
2581 mut self,
2582 v: V,
2583 ) -> Self {
2584 self.0.request = v.into();
2585 self
2586 }
2587
2588 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2590 self.0.options = v.into();
2591 self
2592 }
2593
2594 pub async fn send(self) -> Result<crate::model::BackupSchedule> {
2596 (*self.0.stub)
2597 .get_backup_schedule(self.0.request, self.0.options)
2598 .await
2599 .map(gax::response::Response::into_body)
2600 }
2601
2602 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2606 self.0.request.name = v.into();
2607 self
2608 }
2609 }
2610
2611 #[doc(hidden)]
2612 impl gax::options::internal::RequestBuilder for GetBackupSchedule {
2613 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2614 &mut self.0.options
2615 }
2616 }
2617
2618 #[derive(Clone, Debug)]
2635 pub struct ListBackupSchedules(RequestBuilder<crate::model::ListBackupSchedulesRequest>);
2636
2637 impl ListBackupSchedules {
2638 pub(crate) fn new(
2639 stub: std::sync::Arc<dyn super::super::stub::dynamic::FirestoreAdmin>,
2640 ) -> Self {
2641 Self(RequestBuilder::new(stub))
2642 }
2643
2644 pub fn with_request<V: Into<crate::model::ListBackupSchedulesRequest>>(
2646 mut self,
2647 v: V,
2648 ) -> Self {
2649 self.0.request = v.into();
2650 self
2651 }
2652
2653 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2655 self.0.options = v.into();
2656 self
2657 }
2658
2659 pub async fn send(self) -> Result<crate::model::ListBackupSchedulesResponse> {
2661 (*self.0.stub)
2662 .list_backup_schedules(self.0.request, self.0.options)
2663 .await
2664 .map(gax::response::Response::into_body)
2665 }
2666
2667 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
2671 self.0.request.parent = v.into();
2672 self
2673 }
2674 }
2675
2676 #[doc(hidden)]
2677 impl gax::options::internal::RequestBuilder for ListBackupSchedules {
2678 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2679 &mut self.0.options
2680 }
2681 }
2682
2683 #[derive(Clone, Debug)]
2700 pub struct UpdateBackupSchedule(RequestBuilder<crate::model::UpdateBackupScheduleRequest>);
2701
2702 impl UpdateBackupSchedule {
2703 pub(crate) fn new(
2704 stub: std::sync::Arc<dyn super::super::stub::dynamic::FirestoreAdmin>,
2705 ) -> Self {
2706 Self(RequestBuilder::new(stub))
2707 }
2708
2709 pub fn with_request<V: Into<crate::model::UpdateBackupScheduleRequest>>(
2711 mut self,
2712 v: V,
2713 ) -> Self {
2714 self.0.request = v.into();
2715 self
2716 }
2717
2718 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2720 self.0.options = v.into();
2721 self
2722 }
2723
2724 pub async fn send(self) -> Result<crate::model::BackupSchedule> {
2726 (*self.0.stub)
2727 .update_backup_schedule(self.0.request, self.0.options)
2728 .await
2729 .map(gax::response::Response::into_body)
2730 }
2731
2732 pub fn set_backup_schedule<T>(mut self, v: T) -> Self
2736 where
2737 T: std::convert::Into<crate::model::BackupSchedule>,
2738 {
2739 self.0.request.backup_schedule = std::option::Option::Some(v.into());
2740 self
2741 }
2742
2743 pub fn set_or_clear_backup_schedule<T>(mut self, v: std::option::Option<T>) -> Self
2747 where
2748 T: std::convert::Into<crate::model::BackupSchedule>,
2749 {
2750 self.0.request.backup_schedule = v.map(|x| x.into());
2751 self
2752 }
2753
2754 pub fn set_update_mask<T>(mut self, v: T) -> Self
2756 where
2757 T: std::convert::Into<wkt::FieldMask>,
2758 {
2759 self.0.request.update_mask = std::option::Option::Some(v.into());
2760 self
2761 }
2762
2763 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
2765 where
2766 T: std::convert::Into<wkt::FieldMask>,
2767 {
2768 self.0.request.update_mask = v.map(|x| x.into());
2769 self
2770 }
2771 }
2772
2773 #[doc(hidden)]
2774 impl gax::options::internal::RequestBuilder for UpdateBackupSchedule {
2775 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2776 &mut self.0.options
2777 }
2778 }
2779
2780 #[derive(Clone, Debug)]
2797 pub struct DeleteBackupSchedule(RequestBuilder<crate::model::DeleteBackupScheduleRequest>);
2798
2799 impl DeleteBackupSchedule {
2800 pub(crate) fn new(
2801 stub: std::sync::Arc<dyn super::super::stub::dynamic::FirestoreAdmin>,
2802 ) -> Self {
2803 Self(RequestBuilder::new(stub))
2804 }
2805
2806 pub fn with_request<V: Into<crate::model::DeleteBackupScheduleRequest>>(
2808 mut self,
2809 v: V,
2810 ) -> Self {
2811 self.0.request = v.into();
2812 self
2813 }
2814
2815 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2817 self.0.options = v.into();
2818 self
2819 }
2820
2821 pub async fn send(self) -> Result<()> {
2823 (*self.0.stub)
2824 .delete_backup_schedule(self.0.request, self.0.options)
2825 .await
2826 .map(gax::response::Response::into_body)
2827 }
2828
2829 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2833 self.0.request.name = v.into();
2834 self
2835 }
2836 }
2837
2838 #[doc(hidden)]
2839 impl gax::options::internal::RequestBuilder for DeleteBackupSchedule {
2840 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2841 &mut self.0.options
2842 }
2843 }
2844
2845 #[derive(Clone, Debug)]
2863 pub struct CloneDatabase(RequestBuilder<crate::model::CloneDatabaseRequest>);
2864
2865 impl CloneDatabase {
2866 pub(crate) fn new(
2867 stub: std::sync::Arc<dyn super::super::stub::dynamic::FirestoreAdmin>,
2868 ) -> Self {
2869 Self(RequestBuilder::new(stub))
2870 }
2871
2872 pub fn with_request<V: Into<crate::model::CloneDatabaseRequest>>(mut self, v: V) -> Self {
2874 self.0.request = v.into();
2875 self
2876 }
2877
2878 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2880 self.0.options = v.into();
2881 self
2882 }
2883
2884 pub async fn send(self) -> Result<longrunning::model::Operation> {
2891 (*self.0.stub)
2892 .clone_database(self.0.request, self.0.options)
2893 .await
2894 .map(gax::response::Response::into_body)
2895 }
2896
2897 pub fn poller(
2899 self,
2900 ) -> impl lro::Poller<crate::model::Database, crate::model::CloneDatabaseMetadata> {
2901 type Operation = lro::internal::Operation<
2902 crate::model::Database,
2903 crate::model::CloneDatabaseMetadata,
2904 >;
2905 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
2906 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
2907
2908 let stub = self.0.stub.clone();
2909 let mut options = self.0.options.clone();
2910 options.set_retry_policy(gax::retry_policy::NeverRetry);
2911 let query = move |name| {
2912 let stub = stub.clone();
2913 let options = options.clone();
2914 async {
2915 let op = GetOperation::new(stub)
2916 .set_name(name)
2917 .with_options(options)
2918 .send()
2919 .await?;
2920 Ok(Operation::new(op))
2921 }
2922 };
2923
2924 let start = move || async {
2925 let op = self.send().await?;
2926 Ok(Operation::new(op))
2927 };
2928
2929 lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
2930 }
2931
2932 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
2936 self.0.request.parent = v.into();
2937 self
2938 }
2939
2940 pub fn set_database_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
2944 self.0.request.database_id = v.into();
2945 self
2946 }
2947
2948 pub fn set_pitr_snapshot<T>(mut self, v: T) -> Self
2952 where
2953 T: std::convert::Into<crate::model::PitrSnapshot>,
2954 {
2955 self.0.request.pitr_snapshot = std::option::Option::Some(v.into());
2956 self
2957 }
2958
2959 pub fn set_or_clear_pitr_snapshot<T>(mut self, v: std::option::Option<T>) -> Self
2963 where
2964 T: std::convert::Into<crate::model::PitrSnapshot>,
2965 {
2966 self.0.request.pitr_snapshot = v.map(|x| x.into());
2967 self
2968 }
2969
2970 pub fn set_encryption_config<T>(mut self, v: T) -> Self
2972 where
2973 T: std::convert::Into<crate::model::database::EncryptionConfig>,
2974 {
2975 self.0.request.encryption_config = std::option::Option::Some(v.into());
2976 self
2977 }
2978
2979 pub fn set_or_clear_encryption_config<T>(mut self, v: std::option::Option<T>) -> Self
2981 where
2982 T: std::convert::Into<crate::model::database::EncryptionConfig>,
2983 {
2984 self.0.request.encryption_config = v.map(|x| x.into());
2985 self
2986 }
2987
2988 pub fn set_tags<T, K, V>(mut self, v: T) -> Self
2990 where
2991 T: std::iter::IntoIterator<Item = (K, V)>,
2992 K: std::convert::Into<std::string::String>,
2993 V: std::convert::Into<std::string::String>,
2994 {
2995 self.0.request.tags = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
2996 self
2997 }
2998 }
2999
3000 #[doc(hidden)]
3001 impl gax::options::internal::RequestBuilder for CloneDatabase {
3002 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
3003 &mut self.0.options
3004 }
3005 }
3006
3007 #[derive(Clone, Debug)]
3028 pub struct ListOperations(RequestBuilder<longrunning::model::ListOperationsRequest>);
3029
3030 impl ListOperations {
3031 pub(crate) fn new(
3032 stub: std::sync::Arc<dyn super::super::stub::dynamic::FirestoreAdmin>,
3033 ) -> Self {
3034 Self(RequestBuilder::new(stub))
3035 }
3036
3037 pub fn with_request<V: Into<longrunning::model::ListOperationsRequest>>(
3039 mut self,
3040 v: V,
3041 ) -> Self {
3042 self.0.request = v.into();
3043 self
3044 }
3045
3046 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
3048 self.0.options = v.into();
3049 self
3050 }
3051
3052 pub async fn send(self) -> Result<longrunning::model::ListOperationsResponse> {
3054 (*self.0.stub)
3055 .list_operations(self.0.request, self.0.options)
3056 .await
3057 .map(gax::response::Response::into_body)
3058 }
3059
3060 pub fn by_page(
3062 self,
3063 ) -> impl gax::paginator::Paginator<longrunning::model::ListOperationsResponse, gax::error::Error>
3064 {
3065 use std::clone::Clone;
3066 let token = self.0.request.page_token.clone();
3067 let execute = move |token: String| {
3068 let mut builder = self.clone();
3069 builder.0.request = builder.0.request.set_page_token(token);
3070 builder.send()
3071 };
3072 gax::paginator::internal::new_paginator(token, execute)
3073 }
3074
3075 pub fn by_item(
3077 self,
3078 ) -> impl gax::paginator::ItemPaginator<
3079 longrunning::model::ListOperationsResponse,
3080 gax::error::Error,
3081 > {
3082 use gax::paginator::Paginator;
3083 self.by_page().items()
3084 }
3085
3086 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
3088 self.0.request.name = v.into();
3089 self
3090 }
3091
3092 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
3094 self.0.request.filter = v.into();
3095 self
3096 }
3097
3098 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
3100 self.0.request.page_size = v.into();
3101 self
3102 }
3103
3104 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
3106 self.0.request.page_token = v.into();
3107 self
3108 }
3109
3110 pub fn set_return_partial_success<T: Into<bool>>(mut self, v: T) -> Self {
3112 self.0.request.return_partial_success = v.into();
3113 self
3114 }
3115 }
3116
3117 #[doc(hidden)]
3118 impl gax::options::internal::RequestBuilder for ListOperations {
3119 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
3120 &mut self.0.options
3121 }
3122 }
3123
3124 #[derive(Clone, Debug)]
3141 pub struct GetOperation(RequestBuilder<longrunning::model::GetOperationRequest>);
3142
3143 impl GetOperation {
3144 pub(crate) fn new(
3145 stub: std::sync::Arc<dyn super::super::stub::dynamic::FirestoreAdmin>,
3146 ) -> Self {
3147 Self(RequestBuilder::new(stub))
3148 }
3149
3150 pub fn with_request<V: Into<longrunning::model::GetOperationRequest>>(
3152 mut self,
3153 v: V,
3154 ) -> Self {
3155 self.0.request = v.into();
3156 self
3157 }
3158
3159 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
3161 self.0.options = v.into();
3162 self
3163 }
3164
3165 pub async fn send(self) -> Result<longrunning::model::Operation> {
3167 (*self.0.stub)
3168 .get_operation(self.0.request, self.0.options)
3169 .await
3170 .map(gax::response::Response::into_body)
3171 }
3172
3173 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
3175 self.0.request.name = v.into();
3176 self
3177 }
3178 }
3179
3180 #[doc(hidden)]
3181 impl gax::options::internal::RequestBuilder for GetOperation {
3182 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
3183 &mut self.0.options
3184 }
3185 }
3186
3187 #[derive(Clone, Debug)]
3204 pub struct DeleteOperation(RequestBuilder<longrunning::model::DeleteOperationRequest>);
3205
3206 impl DeleteOperation {
3207 pub(crate) fn new(
3208 stub: std::sync::Arc<dyn super::super::stub::dynamic::FirestoreAdmin>,
3209 ) -> Self {
3210 Self(RequestBuilder::new(stub))
3211 }
3212
3213 pub fn with_request<V: Into<longrunning::model::DeleteOperationRequest>>(
3215 mut self,
3216 v: V,
3217 ) -> Self {
3218 self.0.request = v.into();
3219 self
3220 }
3221
3222 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
3224 self.0.options = v.into();
3225 self
3226 }
3227
3228 pub async fn send(self) -> Result<()> {
3230 (*self.0.stub)
3231 .delete_operation(self.0.request, self.0.options)
3232 .await
3233 .map(gax::response::Response::into_body)
3234 }
3235
3236 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
3238 self.0.request.name = v.into();
3239 self
3240 }
3241 }
3242
3243 #[doc(hidden)]
3244 impl gax::options::internal::RequestBuilder for DeleteOperation {
3245 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
3246 &mut self.0.options
3247 }
3248 }
3249
3250 #[derive(Clone, Debug)]
3267 pub struct CancelOperation(RequestBuilder<longrunning::model::CancelOperationRequest>);
3268
3269 impl CancelOperation {
3270 pub(crate) fn new(
3271 stub: std::sync::Arc<dyn super::super::stub::dynamic::FirestoreAdmin>,
3272 ) -> Self {
3273 Self(RequestBuilder::new(stub))
3274 }
3275
3276 pub fn with_request<V: Into<longrunning::model::CancelOperationRequest>>(
3278 mut self,
3279 v: V,
3280 ) -> Self {
3281 self.0.request = v.into();
3282 self
3283 }
3284
3285 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
3287 self.0.options = v.into();
3288 self
3289 }
3290
3291 pub async fn send(self) -> Result<()> {
3293 (*self.0.stub)
3294 .cancel_operation(self.0.request, self.0.options)
3295 .await
3296 .map(gax::response::Response::into_body)
3297 }
3298
3299 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
3301 self.0.request.name = v.into();
3302 self
3303 }
3304 }
3305
3306 #[doc(hidden)]
3307 impl gax::options::internal::RequestBuilder for CancelOperation {
3308 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
3309 &mut self.0.options
3310 }
3311 }
3312}