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)]
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 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 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 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 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 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 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 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 #[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 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 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 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 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 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 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 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 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 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 #[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 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 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 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 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 #[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 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 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 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 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 #[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 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 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 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 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 #[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 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 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 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 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 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 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 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 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 #[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 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 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 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 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 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 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 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 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 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 #[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 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 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 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 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 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 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 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 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 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 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 #[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 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 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 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 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 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 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 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 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 #[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 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 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 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 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 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 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 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 #[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 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 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 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 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 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 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 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 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 #[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 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 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 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 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 #[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 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 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 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 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 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 #[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 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 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 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 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 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 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 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 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 #[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 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 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 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 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 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 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 #[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 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 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 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 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 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 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 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 #[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 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 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 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 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 #[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 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 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 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 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 #[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 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 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 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 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 #[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 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 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 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 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 #[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 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 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 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 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 #[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 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 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 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 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 #[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 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 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 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 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 #[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 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 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 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 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 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 #[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 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 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 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 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 #[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 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 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 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 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 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 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 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 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 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 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 #[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 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 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 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 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 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 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 #[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 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 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 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 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 #[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 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 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 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 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 #[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 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 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 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 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 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 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 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 #[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 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 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 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 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 #[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 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 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 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 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 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 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 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 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 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 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 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 #[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 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 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 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 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 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 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 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 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 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 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 #[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 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 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 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 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 #[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 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 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 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 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 #[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 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 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 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 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}