1#![allow(rustdoc::redundant_explicit_links)]
18#![allow(rustdoc::broken_intra_doc_links)]
19#![no_implicit_prelude]
20extern crate async_trait;
21extern crate bytes;
22extern crate gax;
23extern crate gaxi;
24extern crate lazy_static;
25extern crate longrunning;
26extern crate lro;
27extern crate reqwest;
28extern crate serde;
29extern crate serde_json;
30extern crate serde_with;
31extern crate std;
32extern crate tracing;
33extern crate wkt;
34
35mod debug;
36mod deserialize;
37mod serialize;
38
39#[derive(Clone, Default, PartialEq)]
41#[non_exhaustive]
42pub struct CommonMetadata {
43 pub start_time: std::option::Option<wkt::Timestamp>,
45
46 pub end_time: std::option::Option<wkt::Timestamp>,
48
49 pub operation_type: crate::model::OperationType,
52
53 pub labels: std::collections::HashMap<std::string::String, std::string::String>,
56
57 pub state: crate::model::common_metadata::State,
59
60 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
61}
62
63impl CommonMetadata {
64 pub fn new() -> Self {
65 std::default::Default::default()
66 }
67
68 pub fn set_start_time<T>(mut self, v: T) -> Self
70 where
71 T: std::convert::Into<wkt::Timestamp>,
72 {
73 self.start_time = std::option::Option::Some(v.into());
74 self
75 }
76
77 pub fn set_or_clear_start_time<T>(mut self, v: std::option::Option<T>) -> Self
79 where
80 T: std::convert::Into<wkt::Timestamp>,
81 {
82 self.start_time = v.map(|x| x.into());
83 self
84 }
85
86 pub fn set_end_time<T>(mut self, v: T) -> Self
88 where
89 T: std::convert::Into<wkt::Timestamp>,
90 {
91 self.end_time = std::option::Option::Some(v.into());
92 self
93 }
94
95 pub fn set_or_clear_end_time<T>(mut self, v: std::option::Option<T>) -> Self
97 where
98 T: std::convert::Into<wkt::Timestamp>,
99 {
100 self.end_time = v.map(|x| x.into());
101 self
102 }
103
104 pub fn set_operation_type<T: std::convert::Into<crate::model::OperationType>>(
106 mut self,
107 v: T,
108 ) -> Self {
109 self.operation_type = v.into();
110 self
111 }
112
113 pub fn set_labels<T, K, V>(mut self, v: T) -> Self
115 where
116 T: std::iter::IntoIterator<Item = (K, V)>,
117 K: std::convert::Into<std::string::String>,
118 V: std::convert::Into<std::string::String>,
119 {
120 use std::iter::Iterator;
121 self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
122 self
123 }
124
125 pub fn set_state<T: std::convert::Into<crate::model::common_metadata::State>>(
127 mut self,
128 v: T,
129 ) -> Self {
130 self.state = v.into();
131 self
132 }
133}
134
135impl wkt::message::Message for CommonMetadata {
136 fn typename() -> &'static str {
137 "type.googleapis.com/google.datastore.admin.v1.CommonMetadata"
138 }
139}
140
141pub mod common_metadata {
143 #[allow(unused_imports)]
144 use super::*;
145
146 #[derive(Clone, Debug, PartialEq)]
162 #[non_exhaustive]
163 pub enum State {
164 Unspecified,
166 Initializing,
168 Processing,
170 Cancelling,
173 Finalizing,
175 Successful,
177 Failed,
179 Cancelled,
182 UnknownValue(state::UnknownValue),
187 }
188
189 #[doc(hidden)]
190 pub mod state {
191 #[allow(unused_imports)]
192 use super::*;
193 #[derive(Clone, Debug, PartialEq)]
194 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
195 }
196
197 impl State {
198 pub fn value(&self) -> std::option::Option<i32> {
203 match self {
204 Self::Unspecified => std::option::Option::Some(0),
205 Self::Initializing => std::option::Option::Some(1),
206 Self::Processing => std::option::Option::Some(2),
207 Self::Cancelling => std::option::Option::Some(3),
208 Self::Finalizing => std::option::Option::Some(4),
209 Self::Successful => std::option::Option::Some(5),
210 Self::Failed => std::option::Option::Some(6),
211 Self::Cancelled => std::option::Option::Some(7),
212 Self::UnknownValue(u) => u.0.value(),
213 }
214 }
215
216 pub fn name(&self) -> std::option::Option<&str> {
221 match self {
222 Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
223 Self::Initializing => std::option::Option::Some("INITIALIZING"),
224 Self::Processing => std::option::Option::Some("PROCESSING"),
225 Self::Cancelling => std::option::Option::Some("CANCELLING"),
226 Self::Finalizing => std::option::Option::Some("FINALIZING"),
227 Self::Successful => std::option::Option::Some("SUCCESSFUL"),
228 Self::Failed => std::option::Option::Some("FAILED"),
229 Self::Cancelled => std::option::Option::Some("CANCELLED"),
230 Self::UnknownValue(u) => u.0.name(),
231 }
232 }
233 }
234
235 impl std::default::Default for State {
236 fn default() -> Self {
237 use std::convert::From;
238 Self::from(0)
239 }
240 }
241
242 impl std::fmt::Display for State {
243 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
244 wkt::internal::display_enum(f, self.name(), self.value())
245 }
246 }
247
248 impl std::convert::From<i32> for State {
249 fn from(value: i32) -> Self {
250 match value {
251 0 => Self::Unspecified,
252 1 => Self::Initializing,
253 2 => Self::Processing,
254 3 => Self::Cancelling,
255 4 => Self::Finalizing,
256 5 => Self::Successful,
257 6 => Self::Failed,
258 7 => Self::Cancelled,
259 _ => Self::UnknownValue(state::UnknownValue(
260 wkt::internal::UnknownEnumValue::Integer(value),
261 )),
262 }
263 }
264 }
265
266 impl std::convert::From<&str> for State {
267 fn from(value: &str) -> Self {
268 use std::string::ToString;
269 match value {
270 "STATE_UNSPECIFIED" => Self::Unspecified,
271 "INITIALIZING" => Self::Initializing,
272 "PROCESSING" => Self::Processing,
273 "CANCELLING" => Self::Cancelling,
274 "FINALIZING" => Self::Finalizing,
275 "SUCCESSFUL" => Self::Successful,
276 "FAILED" => Self::Failed,
277 "CANCELLED" => Self::Cancelled,
278 _ => Self::UnknownValue(state::UnknownValue(
279 wkt::internal::UnknownEnumValue::String(value.to_string()),
280 )),
281 }
282 }
283 }
284
285 impl serde::ser::Serialize for State {
286 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
287 where
288 S: serde::Serializer,
289 {
290 match self {
291 Self::Unspecified => serializer.serialize_i32(0),
292 Self::Initializing => serializer.serialize_i32(1),
293 Self::Processing => serializer.serialize_i32(2),
294 Self::Cancelling => serializer.serialize_i32(3),
295 Self::Finalizing => serializer.serialize_i32(4),
296 Self::Successful => serializer.serialize_i32(5),
297 Self::Failed => serializer.serialize_i32(6),
298 Self::Cancelled => serializer.serialize_i32(7),
299 Self::UnknownValue(u) => u.0.serialize(serializer),
300 }
301 }
302 }
303
304 impl<'de> serde::de::Deserialize<'de> for State {
305 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
306 where
307 D: serde::Deserializer<'de>,
308 {
309 deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
310 ".google.datastore.admin.v1.CommonMetadata.State",
311 ))
312 }
313 }
314}
315
316#[derive(Clone, Default, PartialEq)]
318#[non_exhaustive]
319pub struct Progress {
320 pub work_completed: i64,
323
324 pub work_estimated: i64,
327
328 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
329}
330
331impl Progress {
332 pub fn new() -> Self {
333 std::default::Default::default()
334 }
335
336 pub fn set_work_completed<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
338 self.work_completed = v.into();
339 self
340 }
341
342 pub fn set_work_estimated<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
344 self.work_estimated = v.into();
345 self
346 }
347}
348
349impl wkt::message::Message for Progress {
350 fn typename() -> &'static str {
351 "type.googleapis.com/google.datastore.admin.v1.Progress"
352 }
353}
354
355#[derive(Clone, Default, PartialEq)]
360#[non_exhaustive]
361pub struct ExportEntitiesRequest {
362 pub project_id: std::string::String,
364
365 pub labels: std::collections::HashMap<std::string::String, std::string::String>,
367
368 pub entity_filter: std::option::Option<crate::model::EntityFilter>,
370
371 pub output_url_prefix: std::string::String,
392
393 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
394}
395
396impl ExportEntitiesRequest {
397 pub fn new() -> Self {
398 std::default::Default::default()
399 }
400
401 pub fn set_project_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
403 self.project_id = v.into();
404 self
405 }
406
407 pub fn set_labels<T, K, V>(mut self, v: T) -> Self
409 where
410 T: std::iter::IntoIterator<Item = (K, V)>,
411 K: std::convert::Into<std::string::String>,
412 V: std::convert::Into<std::string::String>,
413 {
414 use std::iter::Iterator;
415 self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
416 self
417 }
418
419 pub fn set_entity_filter<T>(mut self, v: T) -> Self
421 where
422 T: std::convert::Into<crate::model::EntityFilter>,
423 {
424 self.entity_filter = std::option::Option::Some(v.into());
425 self
426 }
427
428 pub fn set_or_clear_entity_filter<T>(mut self, v: std::option::Option<T>) -> Self
430 where
431 T: std::convert::Into<crate::model::EntityFilter>,
432 {
433 self.entity_filter = v.map(|x| x.into());
434 self
435 }
436
437 pub fn set_output_url_prefix<T: std::convert::Into<std::string::String>>(
439 mut self,
440 v: T,
441 ) -> Self {
442 self.output_url_prefix = v.into();
443 self
444 }
445}
446
447impl wkt::message::Message for ExportEntitiesRequest {
448 fn typename() -> &'static str {
449 "type.googleapis.com/google.datastore.admin.v1.ExportEntitiesRequest"
450 }
451}
452
453#[derive(Clone, Default, PartialEq)]
458#[non_exhaustive]
459pub struct ImportEntitiesRequest {
460 pub project_id: std::string::String,
462
463 pub labels: std::collections::HashMap<std::string::String, std::string::String>,
465
466 pub input_url: std::string::String,
483
484 pub entity_filter: std::option::Option<crate::model::EntityFilter>,
489
490 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
491}
492
493impl ImportEntitiesRequest {
494 pub fn new() -> Self {
495 std::default::Default::default()
496 }
497
498 pub fn set_project_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
500 self.project_id = v.into();
501 self
502 }
503
504 pub fn set_labels<T, K, V>(mut self, v: T) -> Self
506 where
507 T: std::iter::IntoIterator<Item = (K, V)>,
508 K: std::convert::Into<std::string::String>,
509 V: std::convert::Into<std::string::String>,
510 {
511 use std::iter::Iterator;
512 self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
513 self
514 }
515
516 pub fn set_input_url<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
518 self.input_url = v.into();
519 self
520 }
521
522 pub fn set_entity_filter<T>(mut self, v: T) -> Self
524 where
525 T: std::convert::Into<crate::model::EntityFilter>,
526 {
527 self.entity_filter = std::option::Option::Some(v.into());
528 self
529 }
530
531 pub fn set_or_clear_entity_filter<T>(mut self, v: std::option::Option<T>) -> Self
533 where
534 T: std::convert::Into<crate::model::EntityFilter>,
535 {
536 self.entity_filter = v.map(|x| x.into());
537 self
538 }
539}
540
541impl wkt::message::Message for ImportEntitiesRequest {
542 fn typename() -> &'static str {
543 "type.googleapis.com/google.datastore.admin.v1.ImportEntitiesRequest"
544 }
545}
546
547#[derive(Clone, Default, PartialEq)]
552#[non_exhaustive]
553pub struct ExportEntitiesResponse {
554 pub output_url: std::string::String,
561
562 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
563}
564
565impl ExportEntitiesResponse {
566 pub fn new() -> Self {
567 std::default::Default::default()
568 }
569
570 pub fn set_output_url<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
572 self.output_url = v.into();
573 self
574 }
575}
576
577impl wkt::message::Message for ExportEntitiesResponse {
578 fn typename() -> &'static str {
579 "type.googleapis.com/google.datastore.admin.v1.ExportEntitiesResponse"
580 }
581}
582
583#[derive(Clone, Default, PartialEq)]
585#[non_exhaustive]
586pub struct ExportEntitiesMetadata {
587 pub common: std::option::Option<crate::model::CommonMetadata>,
589
590 pub progress_entities: std::option::Option<crate::model::Progress>,
592
593 pub progress_bytes: std::option::Option<crate::model::Progress>,
595
596 pub entity_filter: std::option::Option<crate::model::EntityFilter>,
598
599 pub output_url_prefix: std::string::String,
608
609 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
610}
611
612impl ExportEntitiesMetadata {
613 pub fn new() -> Self {
614 std::default::Default::default()
615 }
616
617 pub fn set_common<T>(mut self, v: T) -> Self
619 where
620 T: std::convert::Into<crate::model::CommonMetadata>,
621 {
622 self.common = std::option::Option::Some(v.into());
623 self
624 }
625
626 pub fn set_or_clear_common<T>(mut self, v: std::option::Option<T>) -> Self
628 where
629 T: std::convert::Into<crate::model::CommonMetadata>,
630 {
631 self.common = v.map(|x| x.into());
632 self
633 }
634
635 pub fn set_progress_entities<T>(mut self, v: T) -> Self
637 where
638 T: std::convert::Into<crate::model::Progress>,
639 {
640 self.progress_entities = std::option::Option::Some(v.into());
641 self
642 }
643
644 pub fn set_or_clear_progress_entities<T>(mut self, v: std::option::Option<T>) -> Self
646 where
647 T: std::convert::Into<crate::model::Progress>,
648 {
649 self.progress_entities = v.map(|x| x.into());
650 self
651 }
652
653 pub fn set_progress_bytes<T>(mut self, v: T) -> Self
655 where
656 T: std::convert::Into<crate::model::Progress>,
657 {
658 self.progress_bytes = std::option::Option::Some(v.into());
659 self
660 }
661
662 pub fn set_or_clear_progress_bytes<T>(mut self, v: std::option::Option<T>) -> Self
664 where
665 T: std::convert::Into<crate::model::Progress>,
666 {
667 self.progress_bytes = v.map(|x| x.into());
668 self
669 }
670
671 pub fn set_entity_filter<T>(mut self, v: T) -> Self
673 where
674 T: std::convert::Into<crate::model::EntityFilter>,
675 {
676 self.entity_filter = std::option::Option::Some(v.into());
677 self
678 }
679
680 pub fn set_or_clear_entity_filter<T>(mut self, v: std::option::Option<T>) -> Self
682 where
683 T: std::convert::Into<crate::model::EntityFilter>,
684 {
685 self.entity_filter = v.map(|x| x.into());
686 self
687 }
688
689 pub fn set_output_url_prefix<T: std::convert::Into<std::string::String>>(
691 mut self,
692 v: T,
693 ) -> Self {
694 self.output_url_prefix = v.into();
695 self
696 }
697}
698
699impl wkt::message::Message for ExportEntitiesMetadata {
700 fn typename() -> &'static str {
701 "type.googleapis.com/google.datastore.admin.v1.ExportEntitiesMetadata"
702 }
703}
704
705#[derive(Clone, Default, PartialEq)]
707#[non_exhaustive]
708pub struct ImportEntitiesMetadata {
709 pub common: std::option::Option<crate::model::CommonMetadata>,
711
712 pub progress_entities: std::option::Option<crate::model::Progress>,
714
715 pub progress_bytes: std::option::Option<crate::model::Progress>,
717
718 pub entity_filter: std::option::Option<crate::model::EntityFilter>,
720
721 pub input_url: std::string::String,
728
729 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
730}
731
732impl ImportEntitiesMetadata {
733 pub fn new() -> Self {
734 std::default::Default::default()
735 }
736
737 pub fn set_common<T>(mut self, v: T) -> Self
739 where
740 T: std::convert::Into<crate::model::CommonMetadata>,
741 {
742 self.common = std::option::Option::Some(v.into());
743 self
744 }
745
746 pub fn set_or_clear_common<T>(mut self, v: std::option::Option<T>) -> Self
748 where
749 T: std::convert::Into<crate::model::CommonMetadata>,
750 {
751 self.common = v.map(|x| x.into());
752 self
753 }
754
755 pub fn set_progress_entities<T>(mut self, v: T) -> Self
757 where
758 T: std::convert::Into<crate::model::Progress>,
759 {
760 self.progress_entities = std::option::Option::Some(v.into());
761 self
762 }
763
764 pub fn set_or_clear_progress_entities<T>(mut self, v: std::option::Option<T>) -> Self
766 where
767 T: std::convert::Into<crate::model::Progress>,
768 {
769 self.progress_entities = v.map(|x| x.into());
770 self
771 }
772
773 pub fn set_progress_bytes<T>(mut self, v: T) -> Self
775 where
776 T: std::convert::Into<crate::model::Progress>,
777 {
778 self.progress_bytes = std::option::Option::Some(v.into());
779 self
780 }
781
782 pub fn set_or_clear_progress_bytes<T>(mut self, v: std::option::Option<T>) -> Self
784 where
785 T: std::convert::Into<crate::model::Progress>,
786 {
787 self.progress_bytes = v.map(|x| x.into());
788 self
789 }
790
791 pub fn set_entity_filter<T>(mut self, v: T) -> Self
793 where
794 T: std::convert::Into<crate::model::EntityFilter>,
795 {
796 self.entity_filter = std::option::Option::Some(v.into());
797 self
798 }
799
800 pub fn set_or_clear_entity_filter<T>(mut self, v: std::option::Option<T>) -> Self
802 where
803 T: std::convert::Into<crate::model::EntityFilter>,
804 {
805 self.entity_filter = v.map(|x| x.into());
806 self
807 }
808
809 pub fn set_input_url<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
811 self.input_url = v.into();
812 self
813 }
814}
815
816impl wkt::message::Message for ImportEntitiesMetadata {
817 fn typename() -> &'static str {
818 "type.googleapis.com/google.datastore.admin.v1.ImportEntitiesMetadata"
819 }
820}
821
822#[derive(Clone, Default, PartialEq)]
842#[non_exhaustive]
843pub struct EntityFilter {
844 pub kinds: std::vec::Vec<std::string::String>,
846
847 pub namespace_ids: std::vec::Vec<std::string::String>,
855
856 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
857}
858
859impl EntityFilter {
860 pub fn new() -> Self {
861 std::default::Default::default()
862 }
863
864 pub fn set_kinds<T, V>(mut self, v: T) -> Self
866 where
867 T: std::iter::IntoIterator<Item = V>,
868 V: std::convert::Into<std::string::String>,
869 {
870 use std::iter::Iterator;
871 self.kinds = v.into_iter().map(|i| i.into()).collect();
872 self
873 }
874
875 pub fn set_namespace_ids<T, V>(mut self, v: T) -> Self
877 where
878 T: std::iter::IntoIterator<Item = V>,
879 V: std::convert::Into<std::string::String>,
880 {
881 use std::iter::Iterator;
882 self.namespace_ids = v.into_iter().map(|i| i.into()).collect();
883 self
884 }
885}
886
887impl wkt::message::Message for EntityFilter {
888 fn typename() -> &'static str {
889 "type.googleapis.com/google.datastore.admin.v1.EntityFilter"
890 }
891}
892
893#[derive(Clone, Default, PartialEq)]
898#[non_exhaustive]
899pub struct CreateIndexRequest {
900 pub project_id: std::string::String,
902
903 pub index: std::option::Option<crate::model::Index>,
906
907 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
908}
909
910impl CreateIndexRequest {
911 pub fn new() -> Self {
912 std::default::Default::default()
913 }
914
915 pub fn set_project_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
917 self.project_id = v.into();
918 self
919 }
920
921 pub fn set_index<T>(mut self, v: T) -> Self
923 where
924 T: std::convert::Into<crate::model::Index>,
925 {
926 self.index = std::option::Option::Some(v.into());
927 self
928 }
929
930 pub fn set_or_clear_index<T>(mut self, v: std::option::Option<T>) -> Self
932 where
933 T: std::convert::Into<crate::model::Index>,
934 {
935 self.index = v.map(|x| x.into());
936 self
937 }
938}
939
940impl wkt::message::Message for CreateIndexRequest {
941 fn typename() -> &'static str {
942 "type.googleapis.com/google.datastore.admin.v1.CreateIndexRequest"
943 }
944}
945
946#[derive(Clone, Default, PartialEq)]
951#[non_exhaustive]
952pub struct DeleteIndexRequest {
953 pub project_id: std::string::String,
955
956 pub index_id: std::string::String,
958
959 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
960}
961
962impl DeleteIndexRequest {
963 pub fn new() -> Self {
964 std::default::Default::default()
965 }
966
967 pub fn set_project_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
969 self.project_id = v.into();
970 self
971 }
972
973 pub fn set_index_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
975 self.index_id = v.into();
976 self
977 }
978}
979
980impl wkt::message::Message for DeleteIndexRequest {
981 fn typename() -> &'static str {
982 "type.googleapis.com/google.datastore.admin.v1.DeleteIndexRequest"
983 }
984}
985
986#[derive(Clone, Default, PartialEq)]
991#[non_exhaustive]
992pub struct GetIndexRequest {
993 pub project_id: std::string::String,
995
996 pub index_id: std::string::String,
998
999 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1000}
1001
1002impl GetIndexRequest {
1003 pub fn new() -> Self {
1004 std::default::Default::default()
1005 }
1006
1007 pub fn set_project_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1009 self.project_id = v.into();
1010 self
1011 }
1012
1013 pub fn set_index_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1015 self.index_id = v.into();
1016 self
1017 }
1018}
1019
1020impl wkt::message::Message for GetIndexRequest {
1021 fn typename() -> &'static str {
1022 "type.googleapis.com/google.datastore.admin.v1.GetIndexRequest"
1023 }
1024}
1025
1026#[derive(Clone, Default, PartialEq)]
1031#[non_exhaustive]
1032pub struct ListIndexesRequest {
1033 pub project_id: std::string::String,
1035
1036 pub filter: std::string::String,
1037
1038 pub page_size: i32,
1041
1042 pub page_token: std::string::String,
1044
1045 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1046}
1047
1048impl ListIndexesRequest {
1049 pub fn new() -> Self {
1050 std::default::Default::default()
1051 }
1052
1053 pub fn set_project_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1055 self.project_id = v.into();
1056 self
1057 }
1058
1059 pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1061 self.filter = v.into();
1062 self
1063 }
1064
1065 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
1067 self.page_size = v.into();
1068 self
1069 }
1070
1071 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1073 self.page_token = v.into();
1074 self
1075 }
1076}
1077
1078impl wkt::message::Message for ListIndexesRequest {
1079 fn typename() -> &'static str {
1080 "type.googleapis.com/google.datastore.admin.v1.ListIndexesRequest"
1081 }
1082}
1083
1084#[derive(Clone, Default, PartialEq)]
1089#[non_exhaustive]
1090pub struct ListIndexesResponse {
1091 pub indexes: std::vec::Vec<crate::model::Index>,
1093
1094 pub next_page_token: std::string::String,
1096
1097 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1098}
1099
1100impl ListIndexesResponse {
1101 pub fn new() -> Self {
1102 std::default::Default::default()
1103 }
1104
1105 pub fn set_indexes<T, V>(mut self, v: T) -> Self
1107 where
1108 T: std::iter::IntoIterator<Item = V>,
1109 V: std::convert::Into<crate::model::Index>,
1110 {
1111 use std::iter::Iterator;
1112 self.indexes = v.into_iter().map(|i| i.into()).collect();
1113 self
1114 }
1115
1116 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1118 self.next_page_token = v.into();
1119 self
1120 }
1121}
1122
1123impl wkt::message::Message for ListIndexesResponse {
1124 fn typename() -> &'static str {
1125 "type.googleapis.com/google.datastore.admin.v1.ListIndexesResponse"
1126 }
1127}
1128
1129#[doc(hidden)]
1130impl gax::paginator::internal::PageableResponse for ListIndexesResponse {
1131 type PageItem = crate::model::Index;
1132
1133 fn items(self) -> std::vec::Vec<Self::PageItem> {
1134 self.indexes
1135 }
1136
1137 fn next_page_token(&self) -> std::string::String {
1138 use std::clone::Clone;
1139 self.next_page_token.clone()
1140 }
1141}
1142
1143#[derive(Clone, Default, PartialEq)]
1145#[non_exhaustive]
1146pub struct IndexOperationMetadata {
1147 pub common: std::option::Option<crate::model::CommonMetadata>,
1149
1150 pub progress_entities: std::option::Option<crate::model::Progress>,
1152
1153 pub index_id: std::string::String,
1155
1156 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1157}
1158
1159impl IndexOperationMetadata {
1160 pub fn new() -> Self {
1161 std::default::Default::default()
1162 }
1163
1164 pub fn set_common<T>(mut self, v: T) -> Self
1166 where
1167 T: std::convert::Into<crate::model::CommonMetadata>,
1168 {
1169 self.common = std::option::Option::Some(v.into());
1170 self
1171 }
1172
1173 pub fn set_or_clear_common<T>(mut self, v: std::option::Option<T>) -> Self
1175 where
1176 T: std::convert::Into<crate::model::CommonMetadata>,
1177 {
1178 self.common = v.map(|x| x.into());
1179 self
1180 }
1181
1182 pub fn set_progress_entities<T>(mut self, v: T) -> Self
1184 where
1185 T: std::convert::Into<crate::model::Progress>,
1186 {
1187 self.progress_entities = std::option::Option::Some(v.into());
1188 self
1189 }
1190
1191 pub fn set_or_clear_progress_entities<T>(mut self, v: std::option::Option<T>) -> Self
1193 where
1194 T: std::convert::Into<crate::model::Progress>,
1195 {
1196 self.progress_entities = v.map(|x| x.into());
1197 self
1198 }
1199
1200 pub fn set_index_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1202 self.index_id = v.into();
1203 self
1204 }
1205}
1206
1207impl wkt::message::Message for IndexOperationMetadata {
1208 fn typename() -> &'static str {
1209 "type.googleapis.com/google.datastore.admin.v1.IndexOperationMetadata"
1210 }
1211}
1212
1213#[derive(Clone, Default, PartialEq)]
1222#[non_exhaustive]
1223pub struct DatastoreFirestoreMigrationMetadata {
1224 pub migration_state: crate::model::MigrationState,
1227
1228 pub migration_step: crate::model::MigrationStep,
1231
1232 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1233}
1234
1235impl DatastoreFirestoreMigrationMetadata {
1236 pub fn new() -> Self {
1237 std::default::Default::default()
1238 }
1239
1240 pub fn set_migration_state<T: std::convert::Into<crate::model::MigrationState>>(
1242 mut self,
1243 v: T,
1244 ) -> Self {
1245 self.migration_state = v.into();
1246 self
1247 }
1248
1249 pub fn set_migration_step<T: std::convert::Into<crate::model::MigrationStep>>(
1251 mut self,
1252 v: T,
1253 ) -> Self {
1254 self.migration_step = v.into();
1255 self
1256 }
1257}
1258
1259impl wkt::message::Message for DatastoreFirestoreMigrationMetadata {
1260 fn typename() -> &'static str {
1261 "type.googleapis.com/google.datastore.admin.v1.DatastoreFirestoreMigrationMetadata"
1262 }
1263}
1264
1265#[derive(Clone, Default, PartialEq)]
1267#[non_exhaustive]
1268pub struct Index {
1269 pub project_id: std::string::String,
1271
1272 pub index_id: std::string::String,
1274
1275 pub kind: std::string::String,
1277
1278 pub ancestor: crate::model::index::AncestorMode,
1281
1282 pub properties: std::vec::Vec<crate::model::index::IndexedProperty>,
1288
1289 pub state: crate::model::index::State,
1291
1292 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1293}
1294
1295impl Index {
1296 pub fn new() -> Self {
1297 std::default::Default::default()
1298 }
1299
1300 pub fn set_project_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1302 self.project_id = v.into();
1303 self
1304 }
1305
1306 pub fn set_index_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1308 self.index_id = v.into();
1309 self
1310 }
1311
1312 pub fn set_kind<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1314 self.kind = v.into();
1315 self
1316 }
1317
1318 pub fn set_ancestor<T: std::convert::Into<crate::model::index::AncestorMode>>(
1320 mut self,
1321 v: T,
1322 ) -> Self {
1323 self.ancestor = v.into();
1324 self
1325 }
1326
1327 pub fn set_properties<T, V>(mut self, v: T) -> Self
1329 where
1330 T: std::iter::IntoIterator<Item = V>,
1331 V: std::convert::Into<crate::model::index::IndexedProperty>,
1332 {
1333 use std::iter::Iterator;
1334 self.properties = v.into_iter().map(|i| i.into()).collect();
1335 self
1336 }
1337
1338 pub fn set_state<T: std::convert::Into<crate::model::index::State>>(mut self, v: T) -> Self {
1340 self.state = v.into();
1341 self
1342 }
1343}
1344
1345impl wkt::message::Message for Index {
1346 fn typename() -> &'static str {
1347 "type.googleapis.com/google.datastore.admin.v1.Index"
1348 }
1349}
1350
1351pub mod index {
1353 #[allow(unused_imports)]
1354 use super::*;
1355
1356 #[derive(Clone, Default, PartialEq)]
1358 #[non_exhaustive]
1359 pub struct IndexedProperty {
1360 pub name: std::string::String,
1362
1363 pub direction: crate::model::index::Direction,
1366
1367 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1368 }
1369
1370 impl IndexedProperty {
1371 pub fn new() -> Self {
1372 std::default::Default::default()
1373 }
1374
1375 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1377 self.name = v.into();
1378 self
1379 }
1380
1381 pub fn set_direction<T: std::convert::Into<crate::model::index::Direction>>(
1383 mut self,
1384 v: T,
1385 ) -> Self {
1386 self.direction = v.into();
1387 self
1388 }
1389 }
1390
1391 impl wkt::message::Message for IndexedProperty {
1392 fn typename() -> &'static str {
1393 "type.googleapis.com/google.datastore.admin.v1.Index.IndexedProperty"
1394 }
1395 }
1396
1397 #[derive(Clone, Debug, PartialEq)]
1414 #[non_exhaustive]
1415 pub enum AncestorMode {
1416 Unspecified,
1418 None,
1420 AllAncestors,
1422 UnknownValue(ancestor_mode::UnknownValue),
1427 }
1428
1429 #[doc(hidden)]
1430 pub mod ancestor_mode {
1431 #[allow(unused_imports)]
1432 use super::*;
1433 #[derive(Clone, Debug, PartialEq)]
1434 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
1435 }
1436
1437 impl AncestorMode {
1438 pub fn value(&self) -> std::option::Option<i32> {
1443 match self {
1444 Self::Unspecified => std::option::Option::Some(0),
1445 Self::None => std::option::Option::Some(1),
1446 Self::AllAncestors => std::option::Option::Some(2),
1447 Self::UnknownValue(u) => u.0.value(),
1448 }
1449 }
1450
1451 pub fn name(&self) -> std::option::Option<&str> {
1456 match self {
1457 Self::Unspecified => std::option::Option::Some("ANCESTOR_MODE_UNSPECIFIED"),
1458 Self::None => std::option::Option::Some("NONE"),
1459 Self::AllAncestors => std::option::Option::Some("ALL_ANCESTORS"),
1460 Self::UnknownValue(u) => u.0.name(),
1461 }
1462 }
1463 }
1464
1465 impl std::default::Default for AncestorMode {
1466 fn default() -> Self {
1467 use std::convert::From;
1468 Self::from(0)
1469 }
1470 }
1471
1472 impl std::fmt::Display for AncestorMode {
1473 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
1474 wkt::internal::display_enum(f, self.name(), self.value())
1475 }
1476 }
1477
1478 impl std::convert::From<i32> for AncestorMode {
1479 fn from(value: i32) -> Self {
1480 match value {
1481 0 => Self::Unspecified,
1482 1 => Self::None,
1483 2 => Self::AllAncestors,
1484 _ => Self::UnknownValue(ancestor_mode::UnknownValue(
1485 wkt::internal::UnknownEnumValue::Integer(value),
1486 )),
1487 }
1488 }
1489 }
1490
1491 impl std::convert::From<&str> for AncestorMode {
1492 fn from(value: &str) -> Self {
1493 use std::string::ToString;
1494 match value {
1495 "ANCESTOR_MODE_UNSPECIFIED" => Self::Unspecified,
1496 "NONE" => Self::None,
1497 "ALL_ANCESTORS" => Self::AllAncestors,
1498 _ => Self::UnknownValue(ancestor_mode::UnknownValue(
1499 wkt::internal::UnknownEnumValue::String(value.to_string()),
1500 )),
1501 }
1502 }
1503 }
1504
1505 impl serde::ser::Serialize for AncestorMode {
1506 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
1507 where
1508 S: serde::Serializer,
1509 {
1510 match self {
1511 Self::Unspecified => serializer.serialize_i32(0),
1512 Self::None => serializer.serialize_i32(1),
1513 Self::AllAncestors => serializer.serialize_i32(2),
1514 Self::UnknownValue(u) => u.0.serialize(serializer),
1515 }
1516 }
1517 }
1518
1519 impl<'de> serde::de::Deserialize<'de> for AncestorMode {
1520 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
1521 where
1522 D: serde::Deserializer<'de>,
1523 {
1524 deserializer.deserialize_any(wkt::internal::EnumVisitor::<AncestorMode>::new(
1525 ".google.datastore.admin.v1.Index.AncestorMode",
1526 ))
1527 }
1528 }
1529
1530 #[derive(Clone, Debug, PartialEq)]
1546 #[non_exhaustive]
1547 pub enum Direction {
1548 Unspecified,
1550 Ascending,
1553 Descending,
1556 UnknownValue(direction::UnknownValue),
1561 }
1562
1563 #[doc(hidden)]
1564 pub mod direction {
1565 #[allow(unused_imports)]
1566 use super::*;
1567 #[derive(Clone, Debug, PartialEq)]
1568 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
1569 }
1570
1571 impl Direction {
1572 pub fn value(&self) -> std::option::Option<i32> {
1577 match self {
1578 Self::Unspecified => std::option::Option::Some(0),
1579 Self::Ascending => std::option::Option::Some(1),
1580 Self::Descending => std::option::Option::Some(2),
1581 Self::UnknownValue(u) => u.0.value(),
1582 }
1583 }
1584
1585 pub fn name(&self) -> std::option::Option<&str> {
1590 match self {
1591 Self::Unspecified => std::option::Option::Some("DIRECTION_UNSPECIFIED"),
1592 Self::Ascending => std::option::Option::Some("ASCENDING"),
1593 Self::Descending => std::option::Option::Some("DESCENDING"),
1594 Self::UnknownValue(u) => u.0.name(),
1595 }
1596 }
1597 }
1598
1599 impl std::default::Default for Direction {
1600 fn default() -> Self {
1601 use std::convert::From;
1602 Self::from(0)
1603 }
1604 }
1605
1606 impl std::fmt::Display for Direction {
1607 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
1608 wkt::internal::display_enum(f, self.name(), self.value())
1609 }
1610 }
1611
1612 impl std::convert::From<i32> for Direction {
1613 fn from(value: i32) -> Self {
1614 match value {
1615 0 => Self::Unspecified,
1616 1 => Self::Ascending,
1617 2 => Self::Descending,
1618 _ => Self::UnknownValue(direction::UnknownValue(
1619 wkt::internal::UnknownEnumValue::Integer(value),
1620 )),
1621 }
1622 }
1623 }
1624
1625 impl std::convert::From<&str> for Direction {
1626 fn from(value: &str) -> Self {
1627 use std::string::ToString;
1628 match value {
1629 "DIRECTION_UNSPECIFIED" => Self::Unspecified,
1630 "ASCENDING" => Self::Ascending,
1631 "DESCENDING" => Self::Descending,
1632 _ => Self::UnknownValue(direction::UnknownValue(
1633 wkt::internal::UnknownEnumValue::String(value.to_string()),
1634 )),
1635 }
1636 }
1637 }
1638
1639 impl serde::ser::Serialize for Direction {
1640 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
1641 where
1642 S: serde::Serializer,
1643 {
1644 match self {
1645 Self::Unspecified => serializer.serialize_i32(0),
1646 Self::Ascending => serializer.serialize_i32(1),
1647 Self::Descending => serializer.serialize_i32(2),
1648 Self::UnknownValue(u) => u.0.serialize(serializer),
1649 }
1650 }
1651 }
1652
1653 impl<'de> serde::de::Deserialize<'de> for Direction {
1654 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
1655 where
1656 D: serde::Deserializer<'de>,
1657 {
1658 deserializer.deserialize_any(wkt::internal::EnumVisitor::<Direction>::new(
1659 ".google.datastore.admin.v1.Index.Direction",
1660 ))
1661 }
1662 }
1663
1664 #[derive(Clone, Debug, PartialEq)]
1680 #[non_exhaustive]
1681 pub enum State {
1682 Unspecified,
1684 Creating,
1689 Ready,
1693 Deleting,
1698 Error,
1705 UnknownValue(state::UnknownValue),
1710 }
1711
1712 #[doc(hidden)]
1713 pub mod state {
1714 #[allow(unused_imports)]
1715 use super::*;
1716 #[derive(Clone, Debug, PartialEq)]
1717 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
1718 }
1719
1720 impl State {
1721 pub fn value(&self) -> std::option::Option<i32> {
1726 match self {
1727 Self::Unspecified => std::option::Option::Some(0),
1728 Self::Creating => std::option::Option::Some(1),
1729 Self::Ready => std::option::Option::Some(2),
1730 Self::Deleting => std::option::Option::Some(3),
1731 Self::Error => std::option::Option::Some(4),
1732 Self::UnknownValue(u) => u.0.value(),
1733 }
1734 }
1735
1736 pub fn name(&self) -> std::option::Option<&str> {
1741 match self {
1742 Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
1743 Self::Creating => std::option::Option::Some("CREATING"),
1744 Self::Ready => std::option::Option::Some("READY"),
1745 Self::Deleting => std::option::Option::Some("DELETING"),
1746 Self::Error => std::option::Option::Some("ERROR"),
1747 Self::UnknownValue(u) => u.0.name(),
1748 }
1749 }
1750 }
1751
1752 impl std::default::Default for State {
1753 fn default() -> Self {
1754 use std::convert::From;
1755 Self::from(0)
1756 }
1757 }
1758
1759 impl std::fmt::Display for State {
1760 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
1761 wkt::internal::display_enum(f, self.name(), self.value())
1762 }
1763 }
1764
1765 impl std::convert::From<i32> for State {
1766 fn from(value: i32) -> Self {
1767 match value {
1768 0 => Self::Unspecified,
1769 1 => Self::Creating,
1770 2 => Self::Ready,
1771 3 => Self::Deleting,
1772 4 => Self::Error,
1773 _ => Self::UnknownValue(state::UnknownValue(
1774 wkt::internal::UnknownEnumValue::Integer(value),
1775 )),
1776 }
1777 }
1778 }
1779
1780 impl std::convert::From<&str> for State {
1781 fn from(value: &str) -> Self {
1782 use std::string::ToString;
1783 match value {
1784 "STATE_UNSPECIFIED" => Self::Unspecified,
1785 "CREATING" => Self::Creating,
1786 "READY" => Self::Ready,
1787 "DELETING" => Self::Deleting,
1788 "ERROR" => Self::Error,
1789 _ => Self::UnknownValue(state::UnknownValue(
1790 wkt::internal::UnknownEnumValue::String(value.to_string()),
1791 )),
1792 }
1793 }
1794 }
1795
1796 impl serde::ser::Serialize for State {
1797 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
1798 where
1799 S: serde::Serializer,
1800 {
1801 match self {
1802 Self::Unspecified => serializer.serialize_i32(0),
1803 Self::Creating => serializer.serialize_i32(1),
1804 Self::Ready => serializer.serialize_i32(2),
1805 Self::Deleting => serializer.serialize_i32(3),
1806 Self::Error => serializer.serialize_i32(4),
1807 Self::UnknownValue(u) => u.0.serialize(serializer),
1808 }
1809 }
1810 }
1811
1812 impl<'de> serde::de::Deserialize<'de> for State {
1813 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
1814 where
1815 D: serde::Deserializer<'de>,
1816 {
1817 deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
1818 ".google.datastore.admin.v1.Index.State",
1819 ))
1820 }
1821 }
1822}
1823
1824#[derive(Clone, Default, PartialEq)]
1828#[non_exhaustive]
1829pub struct MigrationStateEvent {
1830 pub state: crate::model::MigrationState,
1832
1833 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1834}
1835
1836impl MigrationStateEvent {
1837 pub fn new() -> Self {
1838 std::default::Default::default()
1839 }
1840
1841 pub fn set_state<T: std::convert::Into<crate::model::MigrationState>>(mut self, v: T) -> Self {
1843 self.state = v.into();
1844 self
1845 }
1846}
1847
1848impl wkt::message::Message for MigrationStateEvent {
1849 fn typename() -> &'static str {
1850 "type.googleapis.com/google.datastore.admin.v1.MigrationStateEvent"
1851 }
1852}
1853
1854#[derive(Clone, Default, PartialEq)]
1858#[non_exhaustive]
1859pub struct MigrationProgressEvent {
1860 pub step: crate::model::MigrationStep,
1865
1866 pub step_details: std::option::Option<crate::model::migration_progress_event::StepDetails>,
1868
1869 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1870}
1871
1872impl MigrationProgressEvent {
1873 pub fn new() -> Self {
1874 std::default::Default::default()
1875 }
1876
1877 pub fn set_step<T: std::convert::Into<crate::model::MigrationStep>>(mut self, v: T) -> Self {
1879 self.step = v.into();
1880 self
1881 }
1882
1883 pub fn set_step_details<
1888 T: std::convert::Into<
1889 std::option::Option<crate::model::migration_progress_event::StepDetails>,
1890 >,
1891 >(
1892 mut self,
1893 v: T,
1894 ) -> Self {
1895 self.step_details = v.into();
1896 self
1897 }
1898
1899 pub fn prepare_step_details(
1903 &self,
1904 ) -> std::option::Option<
1905 &std::boxed::Box<crate::model::migration_progress_event::PrepareStepDetails>,
1906 > {
1907 #[allow(unreachable_patterns)]
1908 self.step_details.as_ref().and_then(|v| match v {
1909 crate::model::migration_progress_event::StepDetails::PrepareStepDetails(v) => {
1910 std::option::Option::Some(v)
1911 }
1912 _ => std::option::Option::None,
1913 })
1914 }
1915
1916 pub fn set_prepare_step_details<
1922 T: std::convert::Into<
1923 std::boxed::Box<crate::model::migration_progress_event::PrepareStepDetails>,
1924 >,
1925 >(
1926 mut self,
1927 v: T,
1928 ) -> Self {
1929 self.step_details = std::option::Option::Some(
1930 crate::model::migration_progress_event::StepDetails::PrepareStepDetails(v.into()),
1931 );
1932 self
1933 }
1934
1935 pub fn redirect_writes_step_details(
1939 &self,
1940 ) -> std::option::Option<
1941 &std::boxed::Box<crate::model::migration_progress_event::RedirectWritesStepDetails>,
1942 > {
1943 #[allow(unreachable_patterns)]
1944 self.step_details.as_ref().and_then(|v| match v {
1945 crate::model::migration_progress_event::StepDetails::RedirectWritesStepDetails(v) => {
1946 std::option::Option::Some(v)
1947 }
1948 _ => std::option::Option::None,
1949 })
1950 }
1951
1952 pub fn set_redirect_writes_step_details<
1958 T: std::convert::Into<
1959 std::boxed::Box<crate::model::migration_progress_event::RedirectWritesStepDetails>,
1960 >,
1961 >(
1962 mut self,
1963 v: T,
1964 ) -> Self {
1965 self.step_details = std::option::Option::Some(
1966 crate::model::migration_progress_event::StepDetails::RedirectWritesStepDetails(
1967 v.into(),
1968 ),
1969 );
1970 self
1971 }
1972}
1973
1974impl wkt::message::Message for MigrationProgressEvent {
1975 fn typename() -> &'static str {
1976 "type.googleapis.com/google.datastore.admin.v1.MigrationProgressEvent"
1977 }
1978}
1979
1980pub mod migration_progress_event {
1982 #[allow(unused_imports)]
1983 use super::*;
1984
1985 #[derive(Clone, Default, PartialEq)]
1987 #[non_exhaustive]
1988 pub struct PrepareStepDetails {
1989 pub concurrency_mode: crate::model::migration_progress_event::ConcurrencyMode,
1992
1993 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1994 }
1995
1996 impl PrepareStepDetails {
1997 pub fn new() -> Self {
1998 std::default::Default::default()
1999 }
2000
2001 pub fn set_concurrency_mode<
2003 T: std::convert::Into<crate::model::migration_progress_event::ConcurrencyMode>,
2004 >(
2005 mut self,
2006 v: T,
2007 ) -> Self {
2008 self.concurrency_mode = v.into();
2009 self
2010 }
2011 }
2012
2013 impl wkt::message::Message for PrepareStepDetails {
2014 fn typename() -> &'static str {
2015 "type.googleapis.com/google.datastore.admin.v1.MigrationProgressEvent.PrepareStepDetails"
2016 }
2017 }
2018
2019 #[derive(Clone, Default, PartialEq)]
2021 #[non_exhaustive]
2022 pub struct RedirectWritesStepDetails {
2023 pub concurrency_mode: crate::model::migration_progress_event::ConcurrencyMode,
2025
2026 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2027 }
2028
2029 impl RedirectWritesStepDetails {
2030 pub fn new() -> Self {
2031 std::default::Default::default()
2032 }
2033
2034 pub fn set_concurrency_mode<
2036 T: std::convert::Into<crate::model::migration_progress_event::ConcurrencyMode>,
2037 >(
2038 mut self,
2039 v: T,
2040 ) -> Self {
2041 self.concurrency_mode = v.into();
2042 self
2043 }
2044 }
2045
2046 impl wkt::message::Message for RedirectWritesStepDetails {
2047 fn typename() -> &'static str {
2048 "type.googleapis.com/google.datastore.admin.v1.MigrationProgressEvent.RedirectWritesStepDetails"
2049 }
2050 }
2051
2052 #[derive(Clone, Debug, PartialEq)]
2068 #[non_exhaustive]
2069 pub enum ConcurrencyMode {
2070 Unspecified,
2072 Pessimistic,
2074 Optimistic,
2076 OptimisticWithEntityGroups,
2078 UnknownValue(concurrency_mode::UnknownValue),
2083 }
2084
2085 #[doc(hidden)]
2086 pub mod concurrency_mode {
2087 #[allow(unused_imports)]
2088 use super::*;
2089 #[derive(Clone, Debug, PartialEq)]
2090 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
2091 }
2092
2093 impl ConcurrencyMode {
2094 pub fn value(&self) -> std::option::Option<i32> {
2099 match self {
2100 Self::Unspecified => std::option::Option::Some(0),
2101 Self::Pessimistic => std::option::Option::Some(1),
2102 Self::Optimistic => std::option::Option::Some(2),
2103 Self::OptimisticWithEntityGroups => std::option::Option::Some(3),
2104 Self::UnknownValue(u) => u.0.value(),
2105 }
2106 }
2107
2108 pub fn name(&self) -> std::option::Option<&str> {
2113 match self {
2114 Self::Unspecified => std::option::Option::Some("CONCURRENCY_MODE_UNSPECIFIED"),
2115 Self::Pessimistic => std::option::Option::Some("PESSIMISTIC"),
2116 Self::Optimistic => std::option::Option::Some("OPTIMISTIC"),
2117 Self::OptimisticWithEntityGroups => {
2118 std::option::Option::Some("OPTIMISTIC_WITH_ENTITY_GROUPS")
2119 }
2120 Self::UnknownValue(u) => u.0.name(),
2121 }
2122 }
2123 }
2124
2125 impl std::default::Default for ConcurrencyMode {
2126 fn default() -> Self {
2127 use std::convert::From;
2128 Self::from(0)
2129 }
2130 }
2131
2132 impl std::fmt::Display for ConcurrencyMode {
2133 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
2134 wkt::internal::display_enum(f, self.name(), self.value())
2135 }
2136 }
2137
2138 impl std::convert::From<i32> for ConcurrencyMode {
2139 fn from(value: i32) -> Self {
2140 match value {
2141 0 => Self::Unspecified,
2142 1 => Self::Pessimistic,
2143 2 => Self::Optimistic,
2144 3 => Self::OptimisticWithEntityGroups,
2145 _ => Self::UnknownValue(concurrency_mode::UnknownValue(
2146 wkt::internal::UnknownEnumValue::Integer(value),
2147 )),
2148 }
2149 }
2150 }
2151
2152 impl std::convert::From<&str> for ConcurrencyMode {
2153 fn from(value: &str) -> Self {
2154 use std::string::ToString;
2155 match value {
2156 "CONCURRENCY_MODE_UNSPECIFIED" => Self::Unspecified,
2157 "PESSIMISTIC" => Self::Pessimistic,
2158 "OPTIMISTIC" => Self::Optimistic,
2159 "OPTIMISTIC_WITH_ENTITY_GROUPS" => Self::OptimisticWithEntityGroups,
2160 _ => Self::UnknownValue(concurrency_mode::UnknownValue(
2161 wkt::internal::UnknownEnumValue::String(value.to_string()),
2162 )),
2163 }
2164 }
2165 }
2166
2167 impl serde::ser::Serialize for ConcurrencyMode {
2168 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
2169 where
2170 S: serde::Serializer,
2171 {
2172 match self {
2173 Self::Unspecified => serializer.serialize_i32(0),
2174 Self::Pessimistic => serializer.serialize_i32(1),
2175 Self::Optimistic => serializer.serialize_i32(2),
2176 Self::OptimisticWithEntityGroups => serializer.serialize_i32(3),
2177 Self::UnknownValue(u) => u.0.serialize(serializer),
2178 }
2179 }
2180 }
2181
2182 impl<'de> serde::de::Deserialize<'de> for ConcurrencyMode {
2183 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
2184 where
2185 D: serde::Deserializer<'de>,
2186 {
2187 deserializer.deserialize_any(wkt::internal::EnumVisitor::<ConcurrencyMode>::new(
2188 ".google.datastore.admin.v1.MigrationProgressEvent.ConcurrencyMode",
2189 ))
2190 }
2191 }
2192
2193 #[derive(Clone, Debug, PartialEq)]
2195 #[non_exhaustive]
2196 pub enum StepDetails {
2197 PrepareStepDetails(
2199 std::boxed::Box<crate::model::migration_progress_event::PrepareStepDetails>,
2200 ),
2201 RedirectWritesStepDetails(
2203 std::boxed::Box<crate::model::migration_progress_event::RedirectWritesStepDetails>,
2204 ),
2205 }
2206}
2207
2208#[derive(Clone, Debug, PartialEq)]
2224#[non_exhaustive]
2225pub enum OperationType {
2226 Unspecified,
2228 ExportEntities,
2230 ImportEntities,
2232 CreateIndex,
2234 DeleteIndex,
2236 UnknownValue(operation_type::UnknownValue),
2241}
2242
2243#[doc(hidden)]
2244pub mod operation_type {
2245 #[allow(unused_imports)]
2246 use super::*;
2247 #[derive(Clone, Debug, PartialEq)]
2248 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
2249}
2250
2251impl OperationType {
2252 pub fn value(&self) -> std::option::Option<i32> {
2257 match self {
2258 Self::Unspecified => std::option::Option::Some(0),
2259 Self::ExportEntities => std::option::Option::Some(1),
2260 Self::ImportEntities => std::option::Option::Some(2),
2261 Self::CreateIndex => std::option::Option::Some(3),
2262 Self::DeleteIndex => std::option::Option::Some(4),
2263 Self::UnknownValue(u) => u.0.value(),
2264 }
2265 }
2266
2267 pub fn name(&self) -> std::option::Option<&str> {
2272 match self {
2273 Self::Unspecified => std::option::Option::Some("OPERATION_TYPE_UNSPECIFIED"),
2274 Self::ExportEntities => std::option::Option::Some("EXPORT_ENTITIES"),
2275 Self::ImportEntities => std::option::Option::Some("IMPORT_ENTITIES"),
2276 Self::CreateIndex => std::option::Option::Some("CREATE_INDEX"),
2277 Self::DeleteIndex => std::option::Option::Some("DELETE_INDEX"),
2278 Self::UnknownValue(u) => u.0.name(),
2279 }
2280 }
2281}
2282
2283impl std::default::Default for OperationType {
2284 fn default() -> Self {
2285 use std::convert::From;
2286 Self::from(0)
2287 }
2288}
2289
2290impl std::fmt::Display for OperationType {
2291 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
2292 wkt::internal::display_enum(f, self.name(), self.value())
2293 }
2294}
2295
2296impl std::convert::From<i32> for OperationType {
2297 fn from(value: i32) -> Self {
2298 match value {
2299 0 => Self::Unspecified,
2300 1 => Self::ExportEntities,
2301 2 => Self::ImportEntities,
2302 3 => Self::CreateIndex,
2303 4 => Self::DeleteIndex,
2304 _ => Self::UnknownValue(operation_type::UnknownValue(
2305 wkt::internal::UnknownEnumValue::Integer(value),
2306 )),
2307 }
2308 }
2309}
2310
2311impl std::convert::From<&str> for OperationType {
2312 fn from(value: &str) -> Self {
2313 use std::string::ToString;
2314 match value {
2315 "OPERATION_TYPE_UNSPECIFIED" => Self::Unspecified,
2316 "EXPORT_ENTITIES" => Self::ExportEntities,
2317 "IMPORT_ENTITIES" => Self::ImportEntities,
2318 "CREATE_INDEX" => Self::CreateIndex,
2319 "DELETE_INDEX" => Self::DeleteIndex,
2320 _ => Self::UnknownValue(operation_type::UnknownValue(
2321 wkt::internal::UnknownEnumValue::String(value.to_string()),
2322 )),
2323 }
2324 }
2325}
2326
2327impl serde::ser::Serialize for OperationType {
2328 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
2329 where
2330 S: serde::Serializer,
2331 {
2332 match self {
2333 Self::Unspecified => serializer.serialize_i32(0),
2334 Self::ExportEntities => serializer.serialize_i32(1),
2335 Self::ImportEntities => serializer.serialize_i32(2),
2336 Self::CreateIndex => serializer.serialize_i32(3),
2337 Self::DeleteIndex => serializer.serialize_i32(4),
2338 Self::UnknownValue(u) => u.0.serialize(serializer),
2339 }
2340 }
2341}
2342
2343impl<'de> serde::de::Deserialize<'de> for OperationType {
2344 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
2345 where
2346 D: serde::Deserializer<'de>,
2347 {
2348 deserializer.deserialize_any(wkt::internal::EnumVisitor::<OperationType>::new(
2349 ".google.datastore.admin.v1.OperationType",
2350 ))
2351 }
2352}
2353
2354#[derive(Clone, Debug, PartialEq)]
2370#[non_exhaustive]
2371pub enum MigrationState {
2372 Unspecified,
2374 Running,
2376 Paused,
2378 Complete,
2380 UnknownValue(migration_state::UnknownValue),
2385}
2386
2387#[doc(hidden)]
2388pub mod migration_state {
2389 #[allow(unused_imports)]
2390 use super::*;
2391 #[derive(Clone, Debug, PartialEq)]
2392 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
2393}
2394
2395impl MigrationState {
2396 pub fn value(&self) -> std::option::Option<i32> {
2401 match self {
2402 Self::Unspecified => std::option::Option::Some(0),
2403 Self::Running => std::option::Option::Some(1),
2404 Self::Paused => std::option::Option::Some(2),
2405 Self::Complete => std::option::Option::Some(3),
2406 Self::UnknownValue(u) => u.0.value(),
2407 }
2408 }
2409
2410 pub fn name(&self) -> std::option::Option<&str> {
2415 match self {
2416 Self::Unspecified => std::option::Option::Some("MIGRATION_STATE_UNSPECIFIED"),
2417 Self::Running => std::option::Option::Some("RUNNING"),
2418 Self::Paused => std::option::Option::Some("PAUSED"),
2419 Self::Complete => std::option::Option::Some("COMPLETE"),
2420 Self::UnknownValue(u) => u.0.name(),
2421 }
2422 }
2423}
2424
2425impl std::default::Default for MigrationState {
2426 fn default() -> Self {
2427 use std::convert::From;
2428 Self::from(0)
2429 }
2430}
2431
2432impl std::fmt::Display for MigrationState {
2433 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
2434 wkt::internal::display_enum(f, self.name(), self.value())
2435 }
2436}
2437
2438impl std::convert::From<i32> for MigrationState {
2439 fn from(value: i32) -> Self {
2440 match value {
2441 0 => Self::Unspecified,
2442 1 => Self::Running,
2443 2 => Self::Paused,
2444 3 => Self::Complete,
2445 _ => Self::UnknownValue(migration_state::UnknownValue(
2446 wkt::internal::UnknownEnumValue::Integer(value),
2447 )),
2448 }
2449 }
2450}
2451
2452impl std::convert::From<&str> for MigrationState {
2453 fn from(value: &str) -> Self {
2454 use std::string::ToString;
2455 match value {
2456 "MIGRATION_STATE_UNSPECIFIED" => Self::Unspecified,
2457 "RUNNING" => Self::Running,
2458 "PAUSED" => Self::Paused,
2459 "COMPLETE" => Self::Complete,
2460 _ => Self::UnknownValue(migration_state::UnknownValue(
2461 wkt::internal::UnknownEnumValue::String(value.to_string()),
2462 )),
2463 }
2464 }
2465}
2466
2467impl serde::ser::Serialize for MigrationState {
2468 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
2469 where
2470 S: serde::Serializer,
2471 {
2472 match self {
2473 Self::Unspecified => serializer.serialize_i32(0),
2474 Self::Running => serializer.serialize_i32(1),
2475 Self::Paused => serializer.serialize_i32(2),
2476 Self::Complete => serializer.serialize_i32(3),
2477 Self::UnknownValue(u) => u.0.serialize(serializer),
2478 }
2479 }
2480}
2481
2482impl<'de> serde::de::Deserialize<'de> for MigrationState {
2483 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
2484 where
2485 D: serde::Deserializer<'de>,
2486 {
2487 deserializer.deserialize_any(wkt::internal::EnumVisitor::<MigrationState>::new(
2488 ".google.datastore.admin.v1.MigrationState",
2489 ))
2490 }
2491}
2492
2493#[derive(Clone, Debug, PartialEq)]
2509#[non_exhaustive]
2510pub enum MigrationStep {
2511 Unspecified,
2513 Prepare,
2515 Start,
2517 ApplyWritesSynchronously,
2519 CopyAndVerify,
2522 RedirectEventuallyConsistentReads,
2524 RedirectStronglyConsistentReads,
2526 RedirectWrites,
2528 UnknownValue(migration_step::UnknownValue),
2533}
2534
2535#[doc(hidden)]
2536pub mod migration_step {
2537 #[allow(unused_imports)]
2538 use super::*;
2539 #[derive(Clone, Debug, PartialEq)]
2540 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
2541}
2542
2543impl MigrationStep {
2544 pub fn value(&self) -> std::option::Option<i32> {
2549 match self {
2550 Self::Unspecified => std::option::Option::Some(0),
2551 Self::Prepare => std::option::Option::Some(6),
2552 Self::Start => std::option::Option::Some(1),
2553 Self::ApplyWritesSynchronously => std::option::Option::Some(7),
2554 Self::CopyAndVerify => std::option::Option::Some(2),
2555 Self::RedirectEventuallyConsistentReads => std::option::Option::Some(3),
2556 Self::RedirectStronglyConsistentReads => std::option::Option::Some(4),
2557 Self::RedirectWrites => std::option::Option::Some(5),
2558 Self::UnknownValue(u) => u.0.value(),
2559 }
2560 }
2561
2562 pub fn name(&self) -> std::option::Option<&str> {
2567 match self {
2568 Self::Unspecified => std::option::Option::Some("MIGRATION_STEP_UNSPECIFIED"),
2569 Self::Prepare => std::option::Option::Some("PREPARE"),
2570 Self::Start => std::option::Option::Some("START"),
2571 Self::ApplyWritesSynchronously => {
2572 std::option::Option::Some("APPLY_WRITES_SYNCHRONOUSLY")
2573 }
2574 Self::CopyAndVerify => std::option::Option::Some("COPY_AND_VERIFY"),
2575 Self::RedirectEventuallyConsistentReads => {
2576 std::option::Option::Some("REDIRECT_EVENTUALLY_CONSISTENT_READS")
2577 }
2578 Self::RedirectStronglyConsistentReads => {
2579 std::option::Option::Some("REDIRECT_STRONGLY_CONSISTENT_READS")
2580 }
2581 Self::RedirectWrites => std::option::Option::Some("REDIRECT_WRITES"),
2582 Self::UnknownValue(u) => u.0.name(),
2583 }
2584 }
2585}
2586
2587impl std::default::Default for MigrationStep {
2588 fn default() -> Self {
2589 use std::convert::From;
2590 Self::from(0)
2591 }
2592}
2593
2594impl std::fmt::Display for MigrationStep {
2595 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
2596 wkt::internal::display_enum(f, self.name(), self.value())
2597 }
2598}
2599
2600impl std::convert::From<i32> for MigrationStep {
2601 fn from(value: i32) -> Self {
2602 match value {
2603 0 => Self::Unspecified,
2604 1 => Self::Start,
2605 2 => Self::CopyAndVerify,
2606 3 => Self::RedirectEventuallyConsistentReads,
2607 4 => Self::RedirectStronglyConsistentReads,
2608 5 => Self::RedirectWrites,
2609 6 => Self::Prepare,
2610 7 => Self::ApplyWritesSynchronously,
2611 _ => Self::UnknownValue(migration_step::UnknownValue(
2612 wkt::internal::UnknownEnumValue::Integer(value),
2613 )),
2614 }
2615 }
2616}
2617
2618impl std::convert::From<&str> for MigrationStep {
2619 fn from(value: &str) -> Self {
2620 use std::string::ToString;
2621 match value {
2622 "MIGRATION_STEP_UNSPECIFIED" => Self::Unspecified,
2623 "PREPARE" => Self::Prepare,
2624 "START" => Self::Start,
2625 "APPLY_WRITES_SYNCHRONOUSLY" => Self::ApplyWritesSynchronously,
2626 "COPY_AND_VERIFY" => Self::CopyAndVerify,
2627 "REDIRECT_EVENTUALLY_CONSISTENT_READS" => Self::RedirectEventuallyConsistentReads,
2628 "REDIRECT_STRONGLY_CONSISTENT_READS" => Self::RedirectStronglyConsistentReads,
2629 "REDIRECT_WRITES" => Self::RedirectWrites,
2630 _ => Self::UnknownValue(migration_step::UnknownValue(
2631 wkt::internal::UnknownEnumValue::String(value.to_string()),
2632 )),
2633 }
2634 }
2635}
2636
2637impl serde::ser::Serialize for MigrationStep {
2638 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
2639 where
2640 S: serde::Serializer,
2641 {
2642 match self {
2643 Self::Unspecified => serializer.serialize_i32(0),
2644 Self::Prepare => serializer.serialize_i32(6),
2645 Self::Start => serializer.serialize_i32(1),
2646 Self::ApplyWritesSynchronously => serializer.serialize_i32(7),
2647 Self::CopyAndVerify => serializer.serialize_i32(2),
2648 Self::RedirectEventuallyConsistentReads => serializer.serialize_i32(3),
2649 Self::RedirectStronglyConsistentReads => serializer.serialize_i32(4),
2650 Self::RedirectWrites => serializer.serialize_i32(5),
2651 Self::UnknownValue(u) => u.0.serialize(serializer),
2652 }
2653 }
2654}
2655
2656impl<'de> serde::de::Deserialize<'de> for MigrationStep {
2657 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
2658 where
2659 D: serde::Deserializer<'de>,
2660 {
2661 deserializer.deserialize_any(wkt::internal::EnumVisitor::<MigrationStep>::new(
2662 ".google.datastore.admin.v1.MigrationStep",
2663 ))
2664 }
2665}