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
35#[serde_with::serde_as]
37#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
38#[serde(default, rename_all = "camelCase")]
39#[non_exhaustive]
40pub struct CommonMetadata {
41 #[serde(skip_serializing_if = "std::option::Option::is_none")]
43 pub start_time: std::option::Option<wkt::Timestamp>,
44
45 #[serde(skip_serializing_if = "std::option::Option::is_none")]
47 pub end_time: std::option::Option<wkt::Timestamp>,
48
49 pub operation_type: crate::model::OperationType,
52
53 #[serde(skip_serializing_if = "std::collections::HashMap::is_empty")]
56 pub labels: std::collections::HashMap<std::string::String, std::string::String>,
57
58 pub state: crate::model::common_metadata::State,
60
61 #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
62 _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
63}
64
65impl CommonMetadata {
66 pub fn new() -> Self {
67 std::default::Default::default()
68 }
69
70 pub fn set_start_time<T: std::convert::Into<std::option::Option<wkt::Timestamp>>>(
72 mut self,
73 v: T,
74 ) -> Self {
75 self.start_time = v.into();
76 self
77 }
78
79 pub fn set_end_time<T: std::convert::Into<std::option::Option<wkt::Timestamp>>>(
81 mut self,
82 v: T,
83 ) -> Self {
84 self.end_time = v.into();
85 self
86 }
87
88 pub fn set_operation_type<T: std::convert::Into<crate::model::OperationType>>(
90 mut self,
91 v: T,
92 ) -> Self {
93 self.operation_type = v.into();
94 self
95 }
96
97 pub fn set_labels<T, K, V>(mut self, v: T) -> Self
99 where
100 T: std::iter::IntoIterator<Item = (K, V)>,
101 K: std::convert::Into<std::string::String>,
102 V: std::convert::Into<std::string::String>,
103 {
104 use std::iter::Iterator;
105 self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
106 self
107 }
108
109 pub fn set_state<T: std::convert::Into<crate::model::common_metadata::State>>(
111 mut self,
112 v: T,
113 ) -> Self {
114 self.state = v.into();
115 self
116 }
117}
118
119impl wkt::message::Message for CommonMetadata {
120 fn typename() -> &'static str {
121 "type.googleapis.com/google.datastore.admin.v1.CommonMetadata"
122 }
123}
124
125pub mod common_metadata {
127 #[allow(unused_imports)]
128 use super::*;
129
130 #[derive(Clone, Debug, PartialEq)]
146 #[non_exhaustive]
147 pub enum State {
148 Unspecified,
150 Initializing,
152 Processing,
154 Cancelling,
157 Finalizing,
159 Successful,
161 Failed,
163 Cancelled,
166 UnknownValue(state::UnknownValue),
171 }
172
173 #[doc(hidden)]
174 pub mod state {
175 #[allow(unused_imports)]
176 use super::*;
177 #[derive(Clone, Debug, PartialEq)]
178 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
179 }
180
181 impl State {
182 pub fn value(&self) -> std::option::Option<i32> {
187 match self {
188 Self::Unspecified => std::option::Option::Some(0),
189 Self::Initializing => std::option::Option::Some(1),
190 Self::Processing => std::option::Option::Some(2),
191 Self::Cancelling => std::option::Option::Some(3),
192 Self::Finalizing => std::option::Option::Some(4),
193 Self::Successful => std::option::Option::Some(5),
194 Self::Failed => std::option::Option::Some(6),
195 Self::Cancelled => std::option::Option::Some(7),
196 Self::UnknownValue(u) => u.0.value(),
197 }
198 }
199
200 pub fn name(&self) -> std::option::Option<&str> {
205 match self {
206 Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
207 Self::Initializing => std::option::Option::Some("INITIALIZING"),
208 Self::Processing => std::option::Option::Some("PROCESSING"),
209 Self::Cancelling => std::option::Option::Some("CANCELLING"),
210 Self::Finalizing => std::option::Option::Some("FINALIZING"),
211 Self::Successful => std::option::Option::Some("SUCCESSFUL"),
212 Self::Failed => std::option::Option::Some("FAILED"),
213 Self::Cancelled => std::option::Option::Some("CANCELLED"),
214 Self::UnknownValue(u) => u.0.name(),
215 }
216 }
217 }
218
219 impl std::default::Default for State {
220 fn default() -> Self {
221 use std::convert::From;
222 Self::from(0)
223 }
224 }
225
226 impl std::fmt::Display for State {
227 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
228 wkt::internal::display_enum(f, self.name(), self.value())
229 }
230 }
231
232 impl std::convert::From<i32> for State {
233 fn from(value: i32) -> Self {
234 match value {
235 0 => Self::Unspecified,
236 1 => Self::Initializing,
237 2 => Self::Processing,
238 3 => Self::Cancelling,
239 4 => Self::Finalizing,
240 5 => Self::Successful,
241 6 => Self::Failed,
242 7 => Self::Cancelled,
243 _ => Self::UnknownValue(state::UnknownValue(
244 wkt::internal::UnknownEnumValue::Integer(value),
245 )),
246 }
247 }
248 }
249
250 impl std::convert::From<&str> for State {
251 fn from(value: &str) -> Self {
252 use std::string::ToString;
253 match value {
254 "STATE_UNSPECIFIED" => Self::Unspecified,
255 "INITIALIZING" => Self::Initializing,
256 "PROCESSING" => Self::Processing,
257 "CANCELLING" => Self::Cancelling,
258 "FINALIZING" => Self::Finalizing,
259 "SUCCESSFUL" => Self::Successful,
260 "FAILED" => Self::Failed,
261 "CANCELLED" => Self::Cancelled,
262 _ => Self::UnknownValue(state::UnknownValue(
263 wkt::internal::UnknownEnumValue::String(value.to_string()),
264 )),
265 }
266 }
267 }
268
269 impl serde::ser::Serialize for State {
270 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
271 where
272 S: serde::Serializer,
273 {
274 match self {
275 Self::Unspecified => serializer.serialize_i32(0),
276 Self::Initializing => serializer.serialize_i32(1),
277 Self::Processing => serializer.serialize_i32(2),
278 Self::Cancelling => serializer.serialize_i32(3),
279 Self::Finalizing => serializer.serialize_i32(4),
280 Self::Successful => serializer.serialize_i32(5),
281 Self::Failed => serializer.serialize_i32(6),
282 Self::Cancelled => serializer.serialize_i32(7),
283 Self::UnknownValue(u) => u.0.serialize(serializer),
284 }
285 }
286 }
287
288 impl<'de> serde::de::Deserialize<'de> for State {
289 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
290 where
291 D: serde::Deserializer<'de>,
292 {
293 deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
294 ".google.datastore.admin.v1.CommonMetadata.State",
295 ))
296 }
297 }
298}
299
300#[serde_with::serde_as]
302#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
303#[serde(default, rename_all = "camelCase")]
304#[non_exhaustive]
305pub struct Progress {
306 #[serde(skip_serializing_if = "wkt::internal::is_default")]
309 #[serde_as(as = "serde_with::DisplayFromStr")]
310 pub work_completed: i64,
311
312 #[serde(skip_serializing_if = "wkt::internal::is_default")]
315 #[serde_as(as = "serde_with::DisplayFromStr")]
316 pub work_estimated: i64,
317
318 #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
319 _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
320}
321
322impl Progress {
323 pub fn new() -> Self {
324 std::default::Default::default()
325 }
326
327 pub fn set_work_completed<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
329 self.work_completed = v.into();
330 self
331 }
332
333 pub fn set_work_estimated<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
335 self.work_estimated = v.into();
336 self
337 }
338}
339
340impl wkt::message::Message for Progress {
341 fn typename() -> &'static str {
342 "type.googleapis.com/google.datastore.admin.v1.Progress"
343 }
344}
345
346#[serde_with::serde_as]
351#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
352#[serde(default, rename_all = "camelCase")]
353#[non_exhaustive]
354pub struct ExportEntitiesRequest {
355 #[serde(skip_serializing_if = "std::string::String::is_empty")]
357 pub project_id: std::string::String,
358
359 #[serde(skip_serializing_if = "std::collections::HashMap::is_empty")]
361 pub labels: std::collections::HashMap<std::string::String, std::string::String>,
362
363 #[serde(skip_serializing_if = "std::option::Option::is_none")]
365 pub entity_filter: std::option::Option<crate::model::EntityFilter>,
366
367 #[serde(skip_serializing_if = "std::string::String::is_empty")]
388 pub output_url_prefix: std::string::String,
389
390 #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
391 _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
392}
393
394impl ExportEntitiesRequest {
395 pub fn new() -> Self {
396 std::default::Default::default()
397 }
398
399 pub fn set_project_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
401 self.project_id = v.into();
402 self
403 }
404
405 pub fn set_labels<T, K, V>(mut self, v: T) -> Self
407 where
408 T: std::iter::IntoIterator<Item = (K, V)>,
409 K: std::convert::Into<std::string::String>,
410 V: std::convert::Into<std::string::String>,
411 {
412 use std::iter::Iterator;
413 self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
414 self
415 }
416
417 pub fn set_entity_filter<
419 T: std::convert::Into<std::option::Option<crate::model::EntityFilter>>,
420 >(
421 mut self,
422 v: T,
423 ) -> Self {
424 self.entity_filter = v.into();
425 self
426 }
427
428 pub fn set_output_url_prefix<T: std::convert::Into<std::string::String>>(
430 mut self,
431 v: T,
432 ) -> Self {
433 self.output_url_prefix = v.into();
434 self
435 }
436}
437
438impl wkt::message::Message for ExportEntitiesRequest {
439 fn typename() -> &'static str {
440 "type.googleapis.com/google.datastore.admin.v1.ExportEntitiesRequest"
441 }
442}
443
444#[serde_with::serde_as]
449#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
450#[serde(default, rename_all = "camelCase")]
451#[non_exhaustive]
452pub struct ImportEntitiesRequest {
453 #[serde(skip_serializing_if = "std::string::String::is_empty")]
455 pub project_id: std::string::String,
456
457 #[serde(skip_serializing_if = "std::collections::HashMap::is_empty")]
459 pub labels: std::collections::HashMap<std::string::String, std::string::String>,
460
461 #[serde(skip_serializing_if = "std::string::String::is_empty")]
478 pub input_url: std::string::String,
479
480 #[serde(skip_serializing_if = "std::option::Option::is_none")]
485 pub entity_filter: std::option::Option<crate::model::EntityFilter>,
486
487 #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
488 _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
489}
490
491impl ImportEntitiesRequest {
492 pub fn new() -> Self {
493 std::default::Default::default()
494 }
495
496 pub fn set_project_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
498 self.project_id = v.into();
499 self
500 }
501
502 pub fn set_labels<T, K, V>(mut self, v: T) -> Self
504 where
505 T: std::iter::IntoIterator<Item = (K, V)>,
506 K: std::convert::Into<std::string::String>,
507 V: std::convert::Into<std::string::String>,
508 {
509 use std::iter::Iterator;
510 self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
511 self
512 }
513
514 pub fn set_input_url<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
516 self.input_url = v.into();
517 self
518 }
519
520 pub fn set_entity_filter<
522 T: std::convert::Into<std::option::Option<crate::model::EntityFilter>>,
523 >(
524 mut self,
525 v: T,
526 ) -> Self {
527 self.entity_filter = v.into();
528 self
529 }
530}
531
532impl wkt::message::Message for ImportEntitiesRequest {
533 fn typename() -> &'static str {
534 "type.googleapis.com/google.datastore.admin.v1.ImportEntitiesRequest"
535 }
536}
537
538#[serde_with::serde_as]
543#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
544#[serde(default, rename_all = "camelCase")]
545#[non_exhaustive]
546pub struct ExportEntitiesResponse {
547 #[serde(skip_serializing_if = "std::string::String::is_empty")]
554 pub output_url: std::string::String,
555
556 #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
557 _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
558}
559
560impl ExportEntitiesResponse {
561 pub fn new() -> Self {
562 std::default::Default::default()
563 }
564
565 pub fn set_output_url<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
567 self.output_url = v.into();
568 self
569 }
570}
571
572impl wkt::message::Message for ExportEntitiesResponse {
573 fn typename() -> &'static str {
574 "type.googleapis.com/google.datastore.admin.v1.ExportEntitiesResponse"
575 }
576}
577
578#[serde_with::serde_as]
580#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
581#[serde(default, rename_all = "camelCase")]
582#[non_exhaustive]
583pub struct ExportEntitiesMetadata {
584 #[serde(skip_serializing_if = "std::option::Option::is_none")]
586 pub common: std::option::Option<crate::model::CommonMetadata>,
587
588 #[serde(skip_serializing_if = "std::option::Option::is_none")]
590 pub progress_entities: std::option::Option<crate::model::Progress>,
591
592 #[serde(skip_serializing_if = "std::option::Option::is_none")]
594 pub progress_bytes: std::option::Option<crate::model::Progress>,
595
596 #[serde(skip_serializing_if = "std::option::Option::is_none")]
598 pub entity_filter: std::option::Option<crate::model::EntityFilter>,
599
600 #[serde(skip_serializing_if = "std::string::String::is_empty")]
609 pub output_url_prefix: std::string::String,
610
611 #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
612 _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
613}
614
615impl ExportEntitiesMetadata {
616 pub fn new() -> Self {
617 std::default::Default::default()
618 }
619
620 pub fn set_common<T: std::convert::Into<std::option::Option<crate::model::CommonMetadata>>>(
622 mut self,
623 v: T,
624 ) -> Self {
625 self.common = v.into();
626 self
627 }
628
629 pub fn set_progress_entities<
631 T: std::convert::Into<std::option::Option<crate::model::Progress>>,
632 >(
633 mut self,
634 v: T,
635 ) -> Self {
636 self.progress_entities = v.into();
637 self
638 }
639
640 pub fn set_progress_bytes<
642 T: std::convert::Into<std::option::Option<crate::model::Progress>>,
643 >(
644 mut self,
645 v: T,
646 ) -> Self {
647 self.progress_bytes = v.into();
648 self
649 }
650
651 pub fn set_entity_filter<
653 T: std::convert::Into<std::option::Option<crate::model::EntityFilter>>,
654 >(
655 mut self,
656 v: T,
657 ) -> Self {
658 self.entity_filter = v.into();
659 self
660 }
661
662 pub fn set_output_url_prefix<T: std::convert::Into<std::string::String>>(
664 mut self,
665 v: T,
666 ) -> Self {
667 self.output_url_prefix = v.into();
668 self
669 }
670}
671
672impl wkt::message::Message for ExportEntitiesMetadata {
673 fn typename() -> &'static str {
674 "type.googleapis.com/google.datastore.admin.v1.ExportEntitiesMetadata"
675 }
676}
677
678#[serde_with::serde_as]
680#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
681#[serde(default, rename_all = "camelCase")]
682#[non_exhaustive]
683pub struct ImportEntitiesMetadata {
684 #[serde(skip_serializing_if = "std::option::Option::is_none")]
686 pub common: std::option::Option<crate::model::CommonMetadata>,
687
688 #[serde(skip_serializing_if = "std::option::Option::is_none")]
690 pub progress_entities: std::option::Option<crate::model::Progress>,
691
692 #[serde(skip_serializing_if = "std::option::Option::is_none")]
694 pub progress_bytes: std::option::Option<crate::model::Progress>,
695
696 #[serde(skip_serializing_if = "std::option::Option::is_none")]
698 pub entity_filter: std::option::Option<crate::model::EntityFilter>,
699
700 #[serde(skip_serializing_if = "std::string::String::is_empty")]
707 pub input_url: std::string::String,
708
709 #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
710 _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
711}
712
713impl ImportEntitiesMetadata {
714 pub fn new() -> Self {
715 std::default::Default::default()
716 }
717
718 pub fn set_common<T: std::convert::Into<std::option::Option<crate::model::CommonMetadata>>>(
720 mut self,
721 v: T,
722 ) -> Self {
723 self.common = v.into();
724 self
725 }
726
727 pub fn set_progress_entities<
729 T: std::convert::Into<std::option::Option<crate::model::Progress>>,
730 >(
731 mut self,
732 v: T,
733 ) -> Self {
734 self.progress_entities = v.into();
735 self
736 }
737
738 pub fn set_progress_bytes<
740 T: std::convert::Into<std::option::Option<crate::model::Progress>>,
741 >(
742 mut self,
743 v: T,
744 ) -> Self {
745 self.progress_bytes = v.into();
746 self
747 }
748
749 pub fn set_entity_filter<
751 T: std::convert::Into<std::option::Option<crate::model::EntityFilter>>,
752 >(
753 mut self,
754 v: T,
755 ) -> Self {
756 self.entity_filter = v.into();
757 self
758 }
759
760 pub fn set_input_url<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
762 self.input_url = v.into();
763 self
764 }
765}
766
767impl wkt::message::Message for ImportEntitiesMetadata {
768 fn typename() -> &'static str {
769 "type.googleapis.com/google.datastore.admin.v1.ImportEntitiesMetadata"
770 }
771}
772
773#[serde_with::serde_as]
793#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
794#[serde(default, rename_all = "camelCase")]
795#[non_exhaustive]
796pub struct EntityFilter {
797 #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
799 pub kinds: std::vec::Vec<std::string::String>,
800
801 #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
809 pub namespace_ids: std::vec::Vec<std::string::String>,
810
811 #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
812 _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
813}
814
815impl EntityFilter {
816 pub fn new() -> Self {
817 std::default::Default::default()
818 }
819
820 pub fn set_kinds<T, V>(mut self, v: T) -> Self
822 where
823 T: std::iter::IntoIterator<Item = V>,
824 V: std::convert::Into<std::string::String>,
825 {
826 use std::iter::Iterator;
827 self.kinds = v.into_iter().map(|i| i.into()).collect();
828 self
829 }
830
831 pub fn set_namespace_ids<T, V>(mut self, v: T) -> Self
833 where
834 T: std::iter::IntoIterator<Item = V>,
835 V: std::convert::Into<std::string::String>,
836 {
837 use std::iter::Iterator;
838 self.namespace_ids = v.into_iter().map(|i| i.into()).collect();
839 self
840 }
841}
842
843impl wkt::message::Message for EntityFilter {
844 fn typename() -> &'static str {
845 "type.googleapis.com/google.datastore.admin.v1.EntityFilter"
846 }
847}
848
849#[serde_with::serde_as]
854#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
855#[serde(default, rename_all = "camelCase")]
856#[non_exhaustive]
857pub struct CreateIndexRequest {
858 #[serde(skip_serializing_if = "std::string::String::is_empty")]
860 pub project_id: std::string::String,
861
862 #[serde(skip_serializing_if = "std::option::Option::is_none")]
865 pub index: std::option::Option<crate::model::Index>,
866
867 #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
868 _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
869}
870
871impl CreateIndexRequest {
872 pub fn new() -> Self {
873 std::default::Default::default()
874 }
875
876 pub fn set_project_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
878 self.project_id = v.into();
879 self
880 }
881
882 pub fn set_index<T: std::convert::Into<std::option::Option<crate::model::Index>>>(
884 mut self,
885 v: T,
886 ) -> Self {
887 self.index = v.into();
888 self
889 }
890}
891
892impl wkt::message::Message for CreateIndexRequest {
893 fn typename() -> &'static str {
894 "type.googleapis.com/google.datastore.admin.v1.CreateIndexRequest"
895 }
896}
897
898#[serde_with::serde_as]
903#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
904#[serde(default, rename_all = "camelCase")]
905#[non_exhaustive]
906pub struct DeleteIndexRequest {
907 #[serde(skip_serializing_if = "std::string::String::is_empty")]
909 pub project_id: std::string::String,
910
911 #[serde(skip_serializing_if = "std::string::String::is_empty")]
913 pub index_id: std::string::String,
914
915 #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
916 _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
917}
918
919impl DeleteIndexRequest {
920 pub fn new() -> Self {
921 std::default::Default::default()
922 }
923
924 pub fn set_project_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
926 self.project_id = v.into();
927 self
928 }
929
930 pub fn set_index_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
932 self.index_id = v.into();
933 self
934 }
935}
936
937impl wkt::message::Message for DeleteIndexRequest {
938 fn typename() -> &'static str {
939 "type.googleapis.com/google.datastore.admin.v1.DeleteIndexRequest"
940 }
941}
942
943#[serde_with::serde_as]
948#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
949#[serde(default, rename_all = "camelCase")]
950#[non_exhaustive]
951pub struct GetIndexRequest {
952 #[serde(skip_serializing_if = "std::string::String::is_empty")]
954 pub project_id: std::string::String,
955
956 #[serde(skip_serializing_if = "std::string::String::is_empty")]
958 pub index_id: std::string::String,
959
960 #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
961 _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
962}
963
964impl GetIndexRequest {
965 pub fn new() -> Self {
966 std::default::Default::default()
967 }
968
969 pub fn set_project_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
971 self.project_id = v.into();
972 self
973 }
974
975 pub fn set_index_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
977 self.index_id = v.into();
978 self
979 }
980}
981
982impl wkt::message::Message for GetIndexRequest {
983 fn typename() -> &'static str {
984 "type.googleapis.com/google.datastore.admin.v1.GetIndexRequest"
985 }
986}
987
988#[serde_with::serde_as]
993#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
994#[serde(default, rename_all = "camelCase")]
995#[non_exhaustive]
996pub struct ListIndexesRequest {
997 #[serde(skip_serializing_if = "std::string::String::is_empty")]
999 pub project_id: std::string::String,
1000
1001 #[serde(skip_serializing_if = "std::string::String::is_empty")]
1002 pub filter: std::string::String,
1003
1004 #[serde(skip_serializing_if = "wkt::internal::is_default")]
1007 pub page_size: i32,
1008
1009 #[serde(skip_serializing_if = "std::string::String::is_empty")]
1011 pub page_token: std::string::String,
1012
1013 #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
1014 _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1015}
1016
1017impl ListIndexesRequest {
1018 pub fn new() -> Self {
1019 std::default::Default::default()
1020 }
1021
1022 pub fn set_project_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1024 self.project_id = v.into();
1025 self
1026 }
1027
1028 pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1030 self.filter = v.into();
1031 self
1032 }
1033
1034 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
1036 self.page_size = v.into();
1037 self
1038 }
1039
1040 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1042 self.page_token = v.into();
1043 self
1044 }
1045}
1046
1047impl wkt::message::Message for ListIndexesRequest {
1048 fn typename() -> &'static str {
1049 "type.googleapis.com/google.datastore.admin.v1.ListIndexesRequest"
1050 }
1051}
1052
1053#[serde_with::serde_as]
1058#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
1059#[serde(default, rename_all = "camelCase")]
1060#[non_exhaustive]
1061pub struct ListIndexesResponse {
1062 #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
1064 pub indexes: std::vec::Vec<crate::model::Index>,
1065
1066 #[serde(skip_serializing_if = "std::string::String::is_empty")]
1068 pub next_page_token: std::string::String,
1069
1070 #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
1071 _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1072}
1073
1074impl ListIndexesResponse {
1075 pub fn new() -> Self {
1076 std::default::Default::default()
1077 }
1078
1079 pub fn set_indexes<T, V>(mut self, v: T) -> Self
1081 where
1082 T: std::iter::IntoIterator<Item = V>,
1083 V: std::convert::Into<crate::model::Index>,
1084 {
1085 use std::iter::Iterator;
1086 self.indexes = v.into_iter().map(|i| i.into()).collect();
1087 self
1088 }
1089
1090 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1092 self.next_page_token = v.into();
1093 self
1094 }
1095}
1096
1097impl wkt::message::Message for ListIndexesResponse {
1098 fn typename() -> &'static str {
1099 "type.googleapis.com/google.datastore.admin.v1.ListIndexesResponse"
1100 }
1101}
1102
1103#[doc(hidden)]
1104impl gax::paginator::internal::PageableResponse for ListIndexesResponse {
1105 type PageItem = crate::model::Index;
1106
1107 fn items(self) -> std::vec::Vec<Self::PageItem> {
1108 self.indexes
1109 }
1110
1111 fn next_page_token(&self) -> std::string::String {
1112 use std::clone::Clone;
1113 self.next_page_token.clone()
1114 }
1115}
1116
1117#[serde_with::serde_as]
1119#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
1120#[serde(default, rename_all = "camelCase")]
1121#[non_exhaustive]
1122pub struct IndexOperationMetadata {
1123 #[serde(skip_serializing_if = "std::option::Option::is_none")]
1125 pub common: std::option::Option<crate::model::CommonMetadata>,
1126
1127 #[serde(skip_serializing_if = "std::option::Option::is_none")]
1129 pub progress_entities: std::option::Option<crate::model::Progress>,
1130
1131 #[serde(skip_serializing_if = "std::string::String::is_empty")]
1133 pub index_id: std::string::String,
1134
1135 #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
1136 _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1137}
1138
1139impl IndexOperationMetadata {
1140 pub fn new() -> Self {
1141 std::default::Default::default()
1142 }
1143
1144 pub fn set_common<T: std::convert::Into<std::option::Option<crate::model::CommonMetadata>>>(
1146 mut self,
1147 v: T,
1148 ) -> Self {
1149 self.common = v.into();
1150 self
1151 }
1152
1153 pub fn set_progress_entities<
1155 T: std::convert::Into<std::option::Option<crate::model::Progress>>,
1156 >(
1157 mut self,
1158 v: T,
1159 ) -> Self {
1160 self.progress_entities = v.into();
1161 self
1162 }
1163
1164 pub fn set_index_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1166 self.index_id = v.into();
1167 self
1168 }
1169}
1170
1171impl wkt::message::Message for IndexOperationMetadata {
1172 fn typename() -> &'static str {
1173 "type.googleapis.com/google.datastore.admin.v1.IndexOperationMetadata"
1174 }
1175}
1176
1177#[serde_with::serde_as]
1186#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
1187#[serde(default, rename_all = "camelCase")]
1188#[non_exhaustive]
1189pub struct DatastoreFirestoreMigrationMetadata {
1190 pub migration_state: crate::model::MigrationState,
1193
1194 pub migration_step: crate::model::MigrationStep,
1197
1198 #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
1199 _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1200}
1201
1202impl DatastoreFirestoreMigrationMetadata {
1203 pub fn new() -> Self {
1204 std::default::Default::default()
1205 }
1206
1207 pub fn set_migration_state<T: std::convert::Into<crate::model::MigrationState>>(
1209 mut self,
1210 v: T,
1211 ) -> Self {
1212 self.migration_state = v.into();
1213 self
1214 }
1215
1216 pub fn set_migration_step<T: std::convert::Into<crate::model::MigrationStep>>(
1218 mut self,
1219 v: T,
1220 ) -> Self {
1221 self.migration_step = v.into();
1222 self
1223 }
1224}
1225
1226impl wkt::message::Message for DatastoreFirestoreMigrationMetadata {
1227 fn typename() -> &'static str {
1228 "type.googleapis.com/google.datastore.admin.v1.DatastoreFirestoreMigrationMetadata"
1229 }
1230}
1231
1232#[serde_with::serde_as]
1234#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
1235#[serde(default, rename_all = "camelCase")]
1236#[non_exhaustive]
1237pub struct Index {
1238 #[serde(skip_serializing_if = "std::string::String::is_empty")]
1240 pub project_id: std::string::String,
1241
1242 #[serde(skip_serializing_if = "std::string::String::is_empty")]
1244 pub index_id: std::string::String,
1245
1246 #[serde(skip_serializing_if = "std::string::String::is_empty")]
1248 pub kind: std::string::String,
1249
1250 pub ancestor: crate::model::index::AncestorMode,
1253
1254 #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
1260 pub properties: std::vec::Vec<crate::model::index::IndexedProperty>,
1261
1262 pub state: crate::model::index::State,
1264
1265 #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
1266 _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1267}
1268
1269impl Index {
1270 pub fn new() -> Self {
1271 std::default::Default::default()
1272 }
1273
1274 pub fn set_project_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1276 self.project_id = v.into();
1277 self
1278 }
1279
1280 pub fn set_index_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1282 self.index_id = v.into();
1283 self
1284 }
1285
1286 pub fn set_kind<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1288 self.kind = v.into();
1289 self
1290 }
1291
1292 pub fn set_ancestor<T: std::convert::Into<crate::model::index::AncestorMode>>(
1294 mut self,
1295 v: T,
1296 ) -> Self {
1297 self.ancestor = v.into();
1298 self
1299 }
1300
1301 pub fn set_properties<T, V>(mut self, v: T) -> Self
1303 where
1304 T: std::iter::IntoIterator<Item = V>,
1305 V: std::convert::Into<crate::model::index::IndexedProperty>,
1306 {
1307 use std::iter::Iterator;
1308 self.properties = v.into_iter().map(|i| i.into()).collect();
1309 self
1310 }
1311
1312 pub fn set_state<T: std::convert::Into<crate::model::index::State>>(mut self, v: T) -> Self {
1314 self.state = v.into();
1315 self
1316 }
1317}
1318
1319impl wkt::message::Message for Index {
1320 fn typename() -> &'static str {
1321 "type.googleapis.com/google.datastore.admin.v1.Index"
1322 }
1323}
1324
1325pub mod index {
1327 #[allow(unused_imports)]
1328 use super::*;
1329
1330 #[serde_with::serde_as]
1332 #[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
1333 #[serde(default, rename_all = "camelCase")]
1334 #[non_exhaustive]
1335 pub struct IndexedProperty {
1336 #[serde(skip_serializing_if = "std::string::String::is_empty")]
1338 pub name: std::string::String,
1339
1340 pub direction: crate::model::index::Direction,
1343
1344 #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
1345 _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1346 }
1347
1348 impl IndexedProperty {
1349 pub fn new() -> Self {
1350 std::default::Default::default()
1351 }
1352
1353 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1355 self.name = v.into();
1356 self
1357 }
1358
1359 pub fn set_direction<T: std::convert::Into<crate::model::index::Direction>>(
1361 mut self,
1362 v: T,
1363 ) -> Self {
1364 self.direction = v.into();
1365 self
1366 }
1367 }
1368
1369 impl wkt::message::Message for IndexedProperty {
1370 fn typename() -> &'static str {
1371 "type.googleapis.com/google.datastore.admin.v1.Index.IndexedProperty"
1372 }
1373 }
1374
1375 #[derive(Clone, Debug, PartialEq)]
1392 #[non_exhaustive]
1393 pub enum AncestorMode {
1394 Unspecified,
1396 None,
1398 AllAncestors,
1400 UnknownValue(ancestor_mode::UnknownValue),
1405 }
1406
1407 #[doc(hidden)]
1408 pub mod ancestor_mode {
1409 #[allow(unused_imports)]
1410 use super::*;
1411 #[derive(Clone, Debug, PartialEq)]
1412 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
1413 }
1414
1415 impl AncestorMode {
1416 pub fn value(&self) -> std::option::Option<i32> {
1421 match self {
1422 Self::Unspecified => std::option::Option::Some(0),
1423 Self::None => std::option::Option::Some(1),
1424 Self::AllAncestors => std::option::Option::Some(2),
1425 Self::UnknownValue(u) => u.0.value(),
1426 }
1427 }
1428
1429 pub fn name(&self) -> std::option::Option<&str> {
1434 match self {
1435 Self::Unspecified => std::option::Option::Some("ANCESTOR_MODE_UNSPECIFIED"),
1436 Self::None => std::option::Option::Some("NONE"),
1437 Self::AllAncestors => std::option::Option::Some("ALL_ANCESTORS"),
1438 Self::UnknownValue(u) => u.0.name(),
1439 }
1440 }
1441 }
1442
1443 impl std::default::Default for AncestorMode {
1444 fn default() -> Self {
1445 use std::convert::From;
1446 Self::from(0)
1447 }
1448 }
1449
1450 impl std::fmt::Display for AncestorMode {
1451 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
1452 wkt::internal::display_enum(f, self.name(), self.value())
1453 }
1454 }
1455
1456 impl std::convert::From<i32> for AncestorMode {
1457 fn from(value: i32) -> Self {
1458 match value {
1459 0 => Self::Unspecified,
1460 1 => Self::None,
1461 2 => Self::AllAncestors,
1462 _ => Self::UnknownValue(ancestor_mode::UnknownValue(
1463 wkt::internal::UnknownEnumValue::Integer(value),
1464 )),
1465 }
1466 }
1467 }
1468
1469 impl std::convert::From<&str> for AncestorMode {
1470 fn from(value: &str) -> Self {
1471 use std::string::ToString;
1472 match value {
1473 "ANCESTOR_MODE_UNSPECIFIED" => Self::Unspecified,
1474 "NONE" => Self::None,
1475 "ALL_ANCESTORS" => Self::AllAncestors,
1476 _ => Self::UnknownValue(ancestor_mode::UnknownValue(
1477 wkt::internal::UnknownEnumValue::String(value.to_string()),
1478 )),
1479 }
1480 }
1481 }
1482
1483 impl serde::ser::Serialize for AncestorMode {
1484 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
1485 where
1486 S: serde::Serializer,
1487 {
1488 match self {
1489 Self::Unspecified => serializer.serialize_i32(0),
1490 Self::None => serializer.serialize_i32(1),
1491 Self::AllAncestors => serializer.serialize_i32(2),
1492 Self::UnknownValue(u) => u.0.serialize(serializer),
1493 }
1494 }
1495 }
1496
1497 impl<'de> serde::de::Deserialize<'de> for AncestorMode {
1498 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
1499 where
1500 D: serde::Deserializer<'de>,
1501 {
1502 deserializer.deserialize_any(wkt::internal::EnumVisitor::<AncestorMode>::new(
1503 ".google.datastore.admin.v1.Index.AncestorMode",
1504 ))
1505 }
1506 }
1507
1508 #[derive(Clone, Debug, PartialEq)]
1524 #[non_exhaustive]
1525 pub enum Direction {
1526 Unspecified,
1528 Ascending,
1531 Descending,
1534 UnknownValue(direction::UnknownValue),
1539 }
1540
1541 #[doc(hidden)]
1542 pub mod direction {
1543 #[allow(unused_imports)]
1544 use super::*;
1545 #[derive(Clone, Debug, PartialEq)]
1546 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
1547 }
1548
1549 impl Direction {
1550 pub fn value(&self) -> std::option::Option<i32> {
1555 match self {
1556 Self::Unspecified => std::option::Option::Some(0),
1557 Self::Ascending => std::option::Option::Some(1),
1558 Self::Descending => std::option::Option::Some(2),
1559 Self::UnknownValue(u) => u.0.value(),
1560 }
1561 }
1562
1563 pub fn name(&self) -> std::option::Option<&str> {
1568 match self {
1569 Self::Unspecified => std::option::Option::Some("DIRECTION_UNSPECIFIED"),
1570 Self::Ascending => std::option::Option::Some("ASCENDING"),
1571 Self::Descending => std::option::Option::Some("DESCENDING"),
1572 Self::UnknownValue(u) => u.0.name(),
1573 }
1574 }
1575 }
1576
1577 impl std::default::Default for Direction {
1578 fn default() -> Self {
1579 use std::convert::From;
1580 Self::from(0)
1581 }
1582 }
1583
1584 impl std::fmt::Display for Direction {
1585 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
1586 wkt::internal::display_enum(f, self.name(), self.value())
1587 }
1588 }
1589
1590 impl std::convert::From<i32> for Direction {
1591 fn from(value: i32) -> Self {
1592 match value {
1593 0 => Self::Unspecified,
1594 1 => Self::Ascending,
1595 2 => Self::Descending,
1596 _ => Self::UnknownValue(direction::UnknownValue(
1597 wkt::internal::UnknownEnumValue::Integer(value),
1598 )),
1599 }
1600 }
1601 }
1602
1603 impl std::convert::From<&str> for Direction {
1604 fn from(value: &str) -> Self {
1605 use std::string::ToString;
1606 match value {
1607 "DIRECTION_UNSPECIFIED" => Self::Unspecified,
1608 "ASCENDING" => Self::Ascending,
1609 "DESCENDING" => Self::Descending,
1610 _ => Self::UnknownValue(direction::UnknownValue(
1611 wkt::internal::UnknownEnumValue::String(value.to_string()),
1612 )),
1613 }
1614 }
1615 }
1616
1617 impl serde::ser::Serialize for Direction {
1618 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
1619 where
1620 S: serde::Serializer,
1621 {
1622 match self {
1623 Self::Unspecified => serializer.serialize_i32(0),
1624 Self::Ascending => serializer.serialize_i32(1),
1625 Self::Descending => serializer.serialize_i32(2),
1626 Self::UnknownValue(u) => u.0.serialize(serializer),
1627 }
1628 }
1629 }
1630
1631 impl<'de> serde::de::Deserialize<'de> for Direction {
1632 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
1633 where
1634 D: serde::Deserializer<'de>,
1635 {
1636 deserializer.deserialize_any(wkt::internal::EnumVisitor::<Direction>::new(
1637 ".google.datastore.admin.v1.Index.Direction",
1638 ))
1639 }
1640 }
1641
1642 #[derive(Clone, Debug, PartialEq)]
1658 #[non_exhaustive]
1659 pub enum State {
1660 Unspecified,
1662 Creating,
1667 Ready,
1671 Deleting,
1676 Error,
1683 UnknownValue(state::UnknownValue),
1688 }
1689
1690 #[doc(hidden)]
1691 pub mod state {
1692 #[allow(unused_imports)]
1693 use super::*;
1694 #[derive(Clone, Debug, PartialEq)]
1695 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
1696 }
1697
1698 impl State {
1699 pub fn value(&self) -> std::option::Option<i32> {
1704 match self {
1705 Self::Unspecified => std::option::Option::Some(0),
1706 Self::Creating => std::option::Option::Some(1),
1707 Self::Ready => std::option::Option::Some(2),
1708 Self::Deleting => std::option::Option::Some(3),
1709 Self::Error => std::option::Option::Some(4),
1710 Self::UnknownValue(u) => u.0.value(),
1711 }
1712 }
1713
1714 pub fn name(&self) -> std::option::Option<&str> {
1719 match self {
1720 Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
1721 Self::Creating => std::option::Option::Some("CREATING"),
1722 Self::Ready => std::option::Option::Some("READY"),
1723 Self::Deleting => std::option::Option::Some("DELETING"),
1724 Self::Error => std::option::Option::Some("ERROR"),
1725 Self::UnknownValue(u) => u.0.name(),
1726 }
1727 }
1728 }
1729
1730 impl std::default::Default for State {
1731 fn default() -> Self {
1732 use std::convert::From;
1733 Self::from(0)
1734 }
1735 }
1736
1737 impl std::fmt::Display for State {
1738 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
1739 wkt::internal::display_enum(f, self.name(), self.value())
1740 }
1741 }
1742
1743 impl std::convert::From<i32> for State {
1744 fn from(value: i32) -> Self {
1745 match value {
1746 0 => Self::Unspecified,
1747 1 => Self::Creating,
1748 2 => Self::Ready,
1749 3 => Self::Deleting,
1750 4 => Self::Error,
1751 _ => Self::UnknownValue(state::UnknownValue(
1752 wkt::internal::UnknownEnumValue::Integer(value),
1753 )),
1754 }
1755 }
1756 }
1757
1758 impl std::convert::From<&str> for State {
1759 fn from(value: &str) -> Self {
1760 use std::string::ToString;
1761 match value {
1762 "STATE_UNSPECIFIED" => Self::Unspecified,
1763 "CREATING" => Self::Creating,
1764 "READY" => Self::Ready,
1765 "DELETING" => Self::Deleting,
1766 "ERROR" => Self::Error,
1767 _ => Self::UnknownValue(state::UnknownValue(
1768 wkt::internal::UnknownEnumValue::String(value.to_string()),
1769 )),
1770 }
1771 }
1772 }
1773
1774 impl serde::ser::Serialize for State {
1775 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
1776 where
1777 S: serde::Serializer,
1778 {
1779 match self {
1780 Self::Unspecified => serializer.serialize_i32(0),
1781 Self::Creating => serializer.serialize_i32(1),
1782 Self::Ready => serializer.serialize_i32(2),
1783 Self::Deleting => serializer.serialize_i32(3),
1784 Self::Error => serializer.serialize_i32(4),
1785 Self::UnknownValue(u) => u.0.serialize(serializer),
1786 }
1787 }
1788 }
1789
1790 impl<'de> serde::de::Deserialize<'de> for State {
1791 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
1792 where
1793 D: serde::Deserializer<'de>,
1794 {
1795 deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
1796 ".google.datastore.admin.v1.Index.State",
1797 ))
1798 }
1799 }
1800}
1801
1802#[serde_with::serde_as]
1806#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
1807#[serde(default, rename_all = "camelCase")]
1808#[non_exhaustive]
1809pub struct MigrationStateEvent {
1810 pub state: crate::model::MigrationState,
1812
1813 #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
1814 _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1815}
1816
1817impl MigrationStateEvent {
1818 pub fn new() -> Self {
1819 std::default::Default::default()
1820 }
1821
1822 pub fn set_state<T: std::convert::Into<crate::model::MigrationState>>(mut self, v: T) -> Self {
1824 self.state = v.into();
1825 self
1826 }
1827}
1828
1829impl wkt::message::Message for MigrationStateEvent {
1830 fn typename() -> &'static str {
1831 "type.googleapis.com/google.datastore.admin.v1.MigrationStateEvent"
1832 }
1833}
1834
1835#[serde_with::serde_as]
1839#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
1840#[serde(default, rename_all = "camelCase")]
1841#[non_exhaustive]
1842pub struct MigrationProgressEvent {
1843 pub step: crate::model::MigrationStep,
1848
1849 #[serde(flatten, skip_serializing_if = "std::option::Option::is_none")]
1851 pub step_details: std::option::Option<crate::model::migration_progress_event::StepDetails>,
1852
1853 #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
1854 _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1855}
1856
1857impl MigrationProgressEvent {
1858 pub fn new() -> Self {
1859 std::default::Default::default()
1860 }
1861
1862 pub fn set_step<T: std::convert::Into<crate::model::MigrationStep>>(mut self, v: T) -> Self {
1864 self.step = v.into();
1865 self
1866 }
1867
1868 pub fn set_step_details<
1873 T: std::convert::Into<
1874 std::option::Option<crate::model::migration_progress_event::StepDetails>,
1875 >,
1876 >(
1877 mut self,
1878 v: T,
1879 ) -> Self {
1880 self.step_details = v.into();
1881 self
1882 }
1883
1884 pub fn prepare_step_details(
1888 &self,
1889 ) -> std::option::Option<
1890 &std::boxed::Box<crate::model::migration_progress_event::PrepareStepDetails>,
1891 > {
1892 #[allow(unreachable_patterns)]
1893 self.step_details.as_ref().and_then(|v| match v {
1894 crate::model::migration_progress_event::StepDetails::PrepareStepDetails(v) => {
1895 std::option::Option::Some(v)
1896 }
1897 _ => std::option::Option::None,
1898 })
1899 }
1900
1901 pub fn set_prepare_step_details<
1907 T: std::convert::Into<
1908 std::boxed::Box<crate::model::migration_progress_event::PrepareStepDetails>,
1909 >,
1910 >(
1911 mut self,
1912 v: T,
1913 ) -> Self {
1914 self.step_details = std::option::Option::Some(
1915 crate::model::migration_progress_event::StepDetails::PrepareStepDetails(v.into()),
1916 );
1917 self
1918 }
1919
1920 pub fn redirect_writes_step_details(
1924 &self,
1925 ) -> std::option::Option<
1926 &std::boxed::Box<crate::model::migration_progress_event::RedirectWritesStepDetails>,
1927 > {
1928 #[allow(unreachable_patterns)]
1929 self.step_details.as_ref().and_then(|v| match v {
1930 crate::model::migration_progress_event::StepDetails::RedirectWritesStepDetails(v) => {
1931 std::option::Option::Some(v)
1932 }
1933 _ => std::option::Option::None,
1934 })
1935 }
1936
1937 pub fn set_redirect_writes_step_details<
1943 T: std::convert::Into<
1944 std::boxed::Box<crate::model::migration_progress_event::RedirectWritesStepDetails>,
1945 >,
1946 >(
1947 mut self,
1948 v: T,
1949 ) -> Self {
1950 self.step_details = std::option::Option::Some(
1951 crate::model::migration_progress_event::StepDetails::RedirectWritesStepDetails(
1952 v.into(),
1953 ),
1954 );
1955 self
1956 }
1957}
1958
1959impl wkt::message::Message for MigrationProgressEvent {
1960 fn typename() -> &'static str {
1961 "type.googleapis.com/google.datastore.admin.v1.MigrationProgressEvent"
1962 }
1963}
1964
1965pub mod migration_progress_event {
1967 #[allow(unused_imports)]
1968 use super::*;
1969
1970 #[serde_with::serde_as]
1972 #[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
1973 #[serde(default, rename_all = "camelCase")]
1974 #[non_exhaustive]
1975 pub struct PrepareStepDetails {
1976 pub concurrency_mode: crate::model::migration_progress_event::ConcurrencyMode,
1979
1980 #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
1981 _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1982 }
1983
1984 impl PrepareStepDetails {
1985 pub fn new() -> Self {
1986 std::default::Default::default()
1987 }
1988
1989 pub fn set_concurrency_mode<
1991 T: std::convert::Into<crate::model::migration_progress_event::ConcurrencyMode>,
1992 >(
1993 mut self,
1994 v: T,
1995 ) -> Self {
1996 self.concurrency_mode = v.into();
1997 self
1998 }
1999 }
2000
2001 impl wkt::message::Message for PrepareStepDetails {
2002 fn typename() -> &'static str {
2003 "type.googleapis.com/google.datastore.admin.v1.MigrationProgressEvent.PrepareStepDetails"
2004 }
2005 }
2006
2007 #[serde_with::serde_as]
2009 #[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
2010 #[serde(default, rename_all = "camelCase")]
2011 #[non_exhaustive]
2012 pub struct RedirectWritesStepDetails {
2013 pub concurrency_mode: crate::model::migration_progress_event::ConcurrencyMode,
2015
2016 #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
2017 _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2018 }
2019
2020 impl RedirectWritesStepDetails {
2021 pub fn new() -> Self {
2022 std::default::Default::default()
2023 }
2024
2025 pub fn set_concurrency_mode<
2027 T: std::convert::Into<crate::model::migration_progress_event::ConcurrencyMode>,
2028 >(
2029 mut self,
2030 v: T,
2031 ) -> Self {
2032 self.concurrency_mode = v.into();
2033 self
2034 }
2035 }
2036
2037 impl wkt::message::Message for RedirectWritesStepDetails {
2038 fn typename() -> &'static str {
2039 "type.googleapis.com/google.datastore.admin.v1.MigrationProgressEvent.RedirectWritesStepDetails"
2040 }
2041 }
2042
2043 #[derive(Clone, Debug, PartialEq)]
2059 #[non_exhaustive]
2060 pub enum ConcurrencyMode {
2061 Unspecified,
2063 Pessimistic,
2065 Optimistic,
2067 OptimisticWithEntityGroups,
2069 UnknownValue(concurrency_mode::UnknownValue),
2074 }
2075
2076 #[doc(hidden)]
2077 pub mod concurrency_mode {
2078 #[allow(unused_imports)]
2079 use super::*;
2080 #[derive(Clone, Debug, PartialEq)]
2081 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
2082 }
2083
2084 impl ConcurrencyMode {
2085 pub fn value(&self) -> std::option::Option<i32> {
2090 match self {
2091 Self::Unspecified => std::option::Option::Some(0),
2092 Self::Pessimistic => std::option::Option::Some(1),
2093 Self::Optimistic => std::option::Option::Some(2),
2094 Self::OptimisticWithEntityGroups => std::option::Option::Some(3),
2095 Self::UnknownValue(u) => u.0.value(),
2096 }
2097 }
2098
2099 pub fn name(&self) -> std::option::Option<&str> {
2104 match self {
2105 Self::Unspecified => std::option::Option::Some("CONCURRENCY_MODE_UNSPECIFIED"),
2106 Self::Pessimistic => std::option::Option::Some("PESSIMISTIC"),
2107 Self::Optimistic => std::option::Option::Some("OPTIMISTIC"),
2108 Self::OptimisticWithEntityGroups => {
2109 std::option::Option::Some("OPTIMISTIC_WITH_ENTITY_GROUPS")
2110 }
2111 Self::UnknownValue(u) => u.0.name(),
2112 }
2113 }
2114 }
2115
2116 impl std::default::Default for ConcurrencyMode {
2117 fn default() -> Self {
2118 use std::convert::From;
2119 Self::from(0)
2120 }
2121 }
2122
2123 impl std::fmt::Display for ConcurrencyMode {
2124 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
2125 wkt::internal::display_enum(f, self.name(), self.value())
2126 }
2127 }
2128
2129 impl std::convert::From<i32> for ConcurrencyMode {
2130 fn from(value: i32) -> Self {
2131 match value {
2132 0 => Self::Unspecified,
2133 1 => Self::Pessimistic,
2134 2 => Self::Optimistic,
2135 3 => Self::OptimisticWithEntityGroups,
2136 _ => Self::UnknownValue(concurrency_mode::UnknownValue(
2137 wkt::internal::UnknownEnumValue::Integer(value),
2138 )),
2139 }
2140 }
2141 }
2142
2143 impl std::convert::From<&str> for ConcurrencyMode {
2144 fn from(value: &str) -> Self {
2145 use std::string::ToString;
2146 match value {
2147 "CONCURRENCY_MODE_UNSPECIFIED" => Self::Unspecified,
2148 "PESSIMISTIC" => Self::Pessimistic,
2149 "OPTIMISTIC" => Self::Optimistic,
2150 "OPTIMISTIC_WITH_ENTITY_GROUPS" => Self::OptimisticWithEntityGroups,
2151 _ => Self::UnknownValue(concurrency_mode::UnknownValue(
2152 wkt::internal::UnknownEnumValue::String(value.to_string()),
2153 )),
2154 }
2155 }
2156 }
2157
2158 impl serde::ser::Serialize for ConcurrencyMode {
2159 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
2160 where
2161 S: serde::Serializer,
2162 {
2163 match self {
2164 Self::Unspecified => serializer.serialize_i32(0),
2165 Self::Pessimistic => serializer.serialize_i32(1),
2166 Self::Optimistic => serializer.serialize_i32(2),
2167 Self::OptimisticWithEntityGroups => serializer.serialize_i32(3),
2168 Self::UnknownValue(u) => u.0.serialize(serializer),
2169 }
2170 }
2171 }
2172
2173 impl<'de> serde::de::Deserialize<'de> for ConcurrencyMode {
2174 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
2175 where
2176 D: serde::Deserializer<'de>,
2177 {
2178 deserializer.deserialize_any(wkt::internal::EnumVisitor::<ConcurrencyMode>::new(
2179 ".google.datastore.admin.v1.MigrationProgressEvent.ConcurrencyMode",
2180 ))
2181 }
2182 }
2183
2184 #[serde_with::serde_as]
2186 #[derive(Clone, Debug, PartialEq, serde::Deserialize, serde::Serialize)]
2187 #[serde(rename_all = "camelCase")]
2188 #[non_exhaustive]
2189 pub enum StepDetails {
2190 PrepareStepDetails(
2192 std::boxed::Box<crate::model::migration_progress_event::PrepareStepDetails>,
2193 ),
2194 RedirectWritesStepDetails(
2196 std::boxed::Box<crate::model::migration_progress_event::RedirectWritesStepDetails>,
2197 ),
2198 }
2199}
2200
2201#[derive(Clone, Debug, PartialEq)]
2217#[non_exhaustive]
2218pub enum OperationType {
2219 Unspecified,
2221 ExportEntities,
2223 ImportEntities,
2225 CreateIndex,
2227 DeleteIndex,
2229 UnknownValue(operation_type::UnknownValue),
2234}
2235
2236#[doc(hidden)]
2237pub mod operation_type {
2238 #[allow(unused_imports)]
2239 use super::*;
2240 #[derive(Clone, Debug, PartialEq)]
2241 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
2242}
2243
2244impl OperationType {
2245 pub fn value(&self) -> std::option::Option<i32> {
2250 match self {
2251 Self::Unspecified => std::option::Option::Some(0),
2252 Self::ExportEntities => std::option::Option::Some(1),
2253 Self::ImportEntities => std::option::Option::Some(2),
2254 Self::CreateIndex => std::option::Option::Some(3),
2255 Self::DeleteIndex => std::option::Option::Some(4),
2256 Self::UnknownValue(u) => u.0.value(),
2257 }
2258 }
2259
2260 pub fn name(&self) -> std::option::Option<&str> {
2265 match self {
2266 Self::Unspecified => std::option::Option::Some("OPERATION_TYPE_UNSPECIFIED"),
2267 Self::ExportEntities => std::option::Option::Some("EXPORT_ENTITIES"),
2268 Self::ImportEntities => std::option::Option::Some("IMPORT_ENTITIES"),
2269 Self::CreateIndex => std::option::Option::Some("CREATE_INDEX"),
2270 Self::DeleteIndex => std::option::Option::Some("DELETE_INDEX"),
2271 Self::UnknownValue(u) => u.0.name(),
2272 }
2273 }
2274}
2275
2276impl std::default::Default for OperationType {
2277 fn default() -> Self {
2278 use std::convert::From;
2279 Self::from(0)
2280 }
2281}
2282
2283impl std::fmt::Display for OperationType {
2284 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
2285 wkt::internal::display_enum(f, self.name(), self.value())
2286 }
2287}
2288
2289impl std::convert::From<i32> for OperationType {
2290 fn from(value: i32) -> Self {
2291 match value {
2292 0 => Self::Unspecified,
2293 1 => Self::ExportEntities,
2294 2 => Self::ImportEntities,
2295 3 => Self::CreateIndex,
2296 4 => Self::DeleteIndex,
2297 _ => Self::UnknownValue(operation_type::UnknownValue(
2298 wkt::internal::UnknownEnumValue::Integer(value),
2299 )),
2300 }
2301 }
2302}
2303
2304impl std::convert::From<&str> for OperationType {
2305 fn from(value: &str) -> Self {
2306 use std::string::ToString;
2307 match value {
2308 "OPERATION_TYPE_UNSPECIFIED" => Self::Unspecified,
2309 "EXPORT_ENTITIES" => Self::ExportEntities,
2310 "IMPORT_ENTITIES" => Self::ImportEntities,
2311 "CREATE_INDEX" => Self::CreateIndex,
2312 "DELETE_INDEX" => Self::DeleteIndex,
2313 _ => Self::UnknownValue(operation_type::UnknownValue(
2314 wkt::internal::UnknownEnumValue::String(value.to_string()),
2315 )),
2316 }
2317 }
2318}
2319
2320impl serde::ser::Serialize for OperationType {
2321 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
2322 where
2323 S: serde::Serializer,
2324 {
2325 match self {
2326 Self::Unspecified => serializer.serialize_i32(0),
2327 Self::ExportEntities => serializer.serialize_i32(1),
2328 Self::ImportEntities => serializer.serialize_i32(2),
2329 Self::CreateIndex => serializer.serialize_i32(3),
2330 Self::DeleteIndex => serializer.serialize_i32(4),
2331 Self::UnknownValue(u) => u.0.serialize(serializer),
2332 }
2333 }
2334}
2335
2336impl<'de> serde::de::Deserialize<'de> for OperationType {
2337 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
2338 where
2339 D: serde::Deserializer<'de>,
2340 {
2341 deserializer.deserialize_any(wkt::internal::EnumVisitor::<OperationType>::new(
2342 ".google.datastore.admin.v1.OperationType",
2343 ))
2344 }
2345}
2346
2347#[derive(Clone, Debug, PartialEq)]
2363#[non_exhaustive]
2364pub enum MigrationState {
2365 Unspecified,
2367 Running,
2369 Paused,
2371 Complete,
2373 UnknownValue(migration_state::UnknownValue),
2378}
2379
2380#[doc(hidden)]
2381pub mod migration_state {
2382 #[allow(unused_imports)]
2383 use super::*;
2384 #[derive(Clone, Debug, PartialEq)]
2385 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
2386}
2387
2388impl MigrationState {
2389 pub fn value(&self) -> std::option::Option<i32> {
2394 match self {
2395 Self::Unspecified => std::option::Option::Some(0),
2396 Self::Running => std::option::Option::Some(1),
2397 Self::Paused => std::option::Option::Some(2),
2398 Self::Complete => std::option::Option::Some(3),
2399 Self::UnknownValue(u) => u.0.value(),
2400 }
2401 }
2402
2403 pub fn name(&self) -> std::option::Option<&str> {
2408 match self {
2409 Self::Unspecified => std::option::Option::Some("MIGRATION_STATE_UNSPECIFIED"),
2410 Self::Running => std::option::Option::Some("RUNNING"),
2411 Self::Paused => std::option::Option::Some("PAUSED"),
2412 Self::Complete => std::option::Option::Some("COMPLETE"),
2413 Self::UnknownValue(u) => u.0.name(),
2414 }
2415 }
2416}
2417
2418impl std::default::Default for MigrationState {
2419 fn default() -> Self {
2420 use std::convert::From;
2421 Self::from(0)
2422 }
2423}
2424
2425impl std::fmt::Display for MigrationState {
2426 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
2427 wkt::internal::display_enum(f, self.name(), self.value())
2428 }
2429}
2430
2431impl std::convert::From<i32> for MigrationState {
2432 fn from(value: i32) -> Self {
2433 match value {
2434 0 => Self::Unspecified,
2435 1 => Self::Running,
2436 2 => Self::Paused,
2437 3 => Self::Complete,
2438 _ => Self::UnknownValue(migration_state::UnknownValue(
2439 wkt::internal::UnknownEnumValue::Integer(value),
2440 )),
2441 }
2442 }
2443}
2444
2445impl std::convert::From<&str> for MigrationState {
2446 fn from(value: &str) -> Self {
2447 use std::string::ToString;
2448 match value {
2449 "MIGRATION_STATE_UNSPECIFIED" => Self::Unspecified,
2450 "RUNNING" => Self::Running,
2451 "PAUSED" => Self::Paused,
2452 "COMPLETE" => Self::Complete,
2453 _ => Self::UnknownValue(migration_state::UnknownValue(
2454 wkt::internal::UnknownEnumValue::String(value.to_string()),
2455 )),
2456 }
2457 }
2458}
2459
2460impl serde::ser::Serialize for MigrationState {
2461 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
2462 where
2463 S: serde::Serializer,
2464 {
2465 match self {
2466 Self::Unspecified => serializer.serialize_i32(0),
2467 Self::Running => serializer.serialize_i32(1),
2468 Self::Paused => serializer.serialize_i32(2),
2469 Self::Complete => serializer.serialize_i32(3),
2470 Self::UnknownValue(u) => u.0.serialize(serializer),
2471 }
2472 }
2473}
2474
2475impl<'de> serde::de::Deserialize<'de> for MigrationState {
2476 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
2477 where
2478 D: serde::Deserializer<'de>,
2479 {
2480 deserializer.deserialize_any(wkt::internal::EnumVisitor::<MigrationState>::new(
2481 ".google.datastore.admin.v1.MigrationState",
2482 ))
2483 }
2484}
2485
2486#[derive(Clone, Debug, PartialEq)]
2502#[non_exhaustive]
2503pub enum MigrationStep {
2504 Unspecified,
2506 Prepare,
2508 Start,
2510 ApplyWritesSynchronously,
2512 CopyAndVerify,
2515 RedirectEventuallyConsistentReads,
2517 RedirectStronglyConsistentReads,
2519 RedirectWrites,
2521 UnknownValue(migration_step::UnknownValue),
2526}
2527
2528#[doc(hidden)]
2529pub mod migration_step {
2530 #[allow(unused_imports)]
2531 use super::*;
2532 #[derive(Clone, Debug, PartialEq)]
2533 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
2534}
2535
2536impl MigrationStep {
2537 pub fn value(&self) -> std::option::Option<i32> {
2542 match self {
2543 Self::Unspecified => std::option::Option::Some(0),
2544 Self::Prepare => std::option::Option::Some(6),
2545 Self::Start => std::option::Option::Some(1),
2546 Self::ApplyWritesSynchronously => std::option::Option::Some(7),
2547 Self::CopyAndVerify => std::option::Option::Some(2),
2548 Self::RedirectEventuallyConsistentReads => std::option::Option::Some(3),
2549 Self::RedirectStronglyConsistentReads => std::option::Option::Some(4),
2550 Self::RedirectWrites => std::option::Option::Some(5),
2551 Self::UnknownValue(u) => u.0.value(),
2552 }
2553 }
2554
2555 pub fn name(&self) -> std::option::Option<&str> {
2560 match self {
2561 Self::Unspecified => std::option::Option::Some("MIGRATION_STEP_UNSPECIFIED"),
2562 Self::Prepare => std::option::Option::Some("PREPARE"),
2563 Self::Start => std::option::Option::Some("START"),
2564 Self::ApplyWritesSynchronously => {
2565 std::option::Option::Some("APPLY_WRITES_SYNCHRONOUSLY")
2566 }
2567 Self::CopyAndVerify => std::option::Option::Some("COPY_AND_VERIFY"),
2568 Self::RedirectEventuallyConsistentReads => {
2569 std::option::Option::Some("REDIRECT_EVENTUALLY_CONSISTENT_READS")
2570 }
2571 Self::RedirectStronglyConsistentReads => {
2572 std::option::Option::Some("REDIRECT_STRONGLY_CONSISTENT_READS")
2573 }
2574 Self::RedirectWrites => std::option::Option::Some("REDIRECT_WRITES"),
2575 Self::UnknownValue(u) => u.0.name(),
2576 }
2577 }
2578}
2579
2580impl std::default::Default for MigrationStep {
2581 fn default() -> Self {
2582 use std::convert::From;
2583 Self::from(0)
2584 }
2585}
2586
2587impl std::fmt::Display for MigrationStep {
2588 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
2589 wkt::internal::display_enum(f, self.name(), self.value())
2590 }
2591}
2592
2593impl std::convert::From<i32> for MigrationStep {
2594 fn from(value: i32) -> Self {
2595 match value {
2596 0 => Self::Unspecified,
2597 1 => Self::Start,
2598 2 => Self::CopyAndVerify,
2599 3 => Self::RedirectEventuallyConsistentReads,
2600 4 => Self::RedirectStronglyConsistentReads,
2601 5 => Self::RedirectWrites,
2602 6 => Self::Prepare,
2603 7 => Self::ApplyWritesSynchronously,
2604 _ => Self::UnknownValue(migration_step::UnknownValue(
2605 wkt::internal::UnknownEnumValue::Integer(value),
2606 )),
2607 }
2608 }
2609}
2610
2611impl std::convert::From<&str> for MigrationStep {
2612 fn from(value: &str) -> Self {
2613 use std::string::ToString;
2614 match value {
2615 "MIGRATION_STEP_UNSPECIFIED" => Self::Unspecified,
2616 "PREPARE" => Self::Prepare,
2617 "START" => Self::Start,
2618 "APPLY_WRITES_SYNCHRONOUSLY" => Self::ApplyWritesSynchronously,
2619 "COPY_AND_VERIFY" => Self::CopyAndVerify,
2620 "REDIRECT_EVENTUALLY_CONSISTENT_READS" => Self::RedirectEventuallyConsistentReads,
2621 "REDIRECT_STRONGLY_CONSISTENT_READS" => Self::RedirectStronglyConsistentReads,
2622 "REDIRECT_WRITES" => Self::RedirectWrites,
2623 _ => Self::UnknownValue(migration_step::UnknownValue(
2624 wkt::internal::UnknownEnumValue::String(value.to_string()),
2625 )),
2626 }
2627 }
2628}
2629
2630impl serde::ser::Serialize for MigrationStep {
2631 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
2632 where
2633 S: serde::Serializer,
2634 {
2635 match self {
2636 Self::Unspecified => serializer.serialize_i32(0),
2637 Self::Prepare => serializer.serialize_i32(6),
2638 Self::Start => serializer.serialize_i32(1),
2639 Self::ApplyWritesSynchronously => serializer.serialize_i32(7),
2640 Self::CopyAndVerify => serializer.serialize_i32(2),
2641 Self::RedirectEventuallyConsistentReads => serializer.serialize_i32(3),
2642 Self::RedirectStronglyConsistentReads => serializer.serialize_i32(4),
2643 Self::RedirectWrites => serializer.serialize_i32(5),
2644 Self::UnknownValue(u) => u.0.serialize(serializer),
2645 }
2646 }
2647}
2648
2649impl<'de> serde::de::Deserialize<'de> for MigrationStep {
2650 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
2651 where
2652 D: serde::Deserializer<'de>,
2653 {
2654 deserializer.deserialize_any(wkt::internal::EnumVisitor::<MigrationStep>::new(
2655 ".google.datastore.admin.v1.MigrationStep",
2656 ))
2657 }
2658}