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_state<T: std::convert::Into<crate::model::common_metadata::State>>(
99 mut self,
100 v: T,
101 ) -> Self {
102 self.state = v.into();
103 self
104 }
105
106 pub fn set_labels<T, K, V>(mut self, v: T) -> Self
108 where
109 T: std::iter::IntoIterator<Item = (K, V)>,
110 K: std::convert::Into<std::string::String>,
111 V: std::convert::Into<std::string::String>,
112 {
113 use std::iter::Iterator;
114 self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
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, serde::Deserialize, serde::Serialize)]
132 pub struct State(i32);
133
134 impl State {
135 pub const STATE_UNSPECIFIED: State = State::new(0);
137
138 pub const INITIALIZING: State = State::new(1);
140
141 pub const PROCESSING: State = State::new(2);
143
144 pub const CANCELLING: State = State::new(3);
147
148 pub const FINALIZING: State = State::new(4);
150
151 pub const SUCCESSFUL: State = State::new(5);
153
154 pub const FAILED: State = State::new(6);
156
157 pub const CANCELLED: State = State::new(7);
160
161 pub(crate) const fn new(value: i32) -> Self {
163 Self(value)
164 }
165
166 pub fn value(&self) -> i32 {
168 self.0
169 }
170
171 pub fn as_str_name(&self) -> std::borrow::Cow<'static, str> {
173 match self.0 {
174 0 => std::borrow::Cow::Borrowed("STATE_UNSPECIFIED"),
175 1 => std::borrow::Cow::Borrowed("INITIALIZING"),
176 2 => std::borrow::Cow::Borrowed("PROCESSING"),
177 3 => std::borrow::Cow::Borrowed("CANCELLING"),
178 4 => std::borrow::Cow::Borrowed("FINALIZING"),
179 5 => std::borrow::Cow::Borrowed("SUCCESSFUL"),
180 6 => std::borrow::Cow::Borrowed("FAILED"),
181 7 => std::borrow::Cow::Borrowed("CANCELLED"),
182 _ => std::borrow::Cow::Owned(std::format!("UNKNOWN-VALUE:{}", self.0)),
183 }
184 }
185
186 pub fn from_str_name(name: &str) -> std::option::Option<Self> {
188 match name {
189 "STATE_UNSPECIFIED" => std::option::Option::Some(Self::STATE_UNSPECIFIED),
190 "INITIALIZING" => std::option::Option::Some(Self::INITIALIZING),
191 "PROCESSING" => std::option::Option::Some(Self::PROCESSING),
192 "CANCELLING" => std::option::Option::Some(Self::CANCELLING),
193 "FINALIZING" => std::option::Option::Some(Self::FINALIZING),
194 "SUCCESSFUL" => std::option::Option::Some(Self::SUCCESSFUL),
195 "FAILED" => std::option::Option::Some(Self::FAILED),
196 "CANCELLED" => std::option::Option::Some(Self::CANCELLED),
197 _ => std::option::Option::None,
198 }
199 }
200 }
201
202 impl std::convert::From<i32> for State {
203 fn from(value: i32) -> Self {
204 Self::new(value)
205 }
206 }
207
208 impl std::default::Default for State {
209 fn default() -> Self {
210 Self::new(0)
211 }
212 }
213}
214
215#[serde_with::serde_as]
217#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
218#[serde(default, rename_all = "camelCase")]
219#[non_exhaustive]
220pub struct Progress {
221 #[serde_as(as = "serde_with::DisplayFromStr")]
224 pub work_completed: i64,
225
226 #[serde_as(as = "serde_with::DisplayFromStr")]
229 pub work_estimated: i64,
230
231 #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
232 _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
233}
234
235impl Progress {
236 pub fn new() -> Self {
237 std::default::Default::default()
238 }
239
240 pub fn set_work_completed<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
242 self.work_completed = v.into();
243 self
244 }
245
246 pub fn set_work_estimated<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
248 self.work_estimated = v.into();
249 self
250 }
251}
252
253impl wkt::message::Message for Progress {
254 fn typename() -> &'static str {
255 "type.googleapis.com/google.datastore.admin.v1.Progress"
256 }
257}
258
259#[serde_with::serde_as]
264#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
265#[serde(default, rename_all = "camelCase")]
266#[non_exhaustive]
267pub struct ExportEntitiesRequest {
268 #[serde(skip_serializing_if = "std::string::String::is_empty")]
270 pub project_id: std::string::String,
271
272 #[serde(skip_serializing_if = "std::collections::HashMap::is_empty")]
274 pub labels: std::collections::HashMap<std::string::String, std::string::String>,
275
276 #[serde(skip_serializing_if = "std::option::Option::is_none")]
278 pub entity_filter: std::option::Option<crate::model::EntityFilter>,
279
280 #[serde(skip_serializing_if = "std::string::String::is_empty")]
301 pub output_url_prefix: std::string::String,
302
303 #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
304 _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
305}
306
307impl ExportEntitiesRequest {
308 pub fn new() -> Self {
309 std::default::Default::default()
310 }
311
312 pub fn set_project_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
314 self.project_id = v.into();
315 self
316 }
317
318 pub fn set_entity_filter<
320 T: std::convert::Into<std::option::Option<crate::model::EntityFilter>>,
321 >(
322 mut self,
323 v: T,
324 ) -> Self {
325 self.entity_filter = v.into();
326 self
327 }
328
329 pub fn set_output_url_prefix<T: std::convert::Into<std::string::String>>(
331 mut self,
332 v: T,
333 ) -> Self {
334 self.output_url_prefix = v.into();
335 self
336 }
337
338 pub fn set_labels<T, K, V>(mut self, v: T) -> Self
340 where
341 T: std::iter::IntoIterator<Item = (K, V)>,
342 K: std::convert::Into<std::string::String>,
343 V: std::convert::Into<std::string::String>,
344 {
345 use std::iter::Iterator;
346 self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
347 self
348 }
349}
350
351impl wkt::message::Message for ExportEntitiesRequest {
352 fn typename() -> &'static str {
353 "type.googleapis.com/google.datastore.admin.v1.ExportEntitiesRequest"
354 }
355}
356
357#[serde_with::serde_as]
362#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
363#[serde(default, rename_all = "camelCase")]
364#[non_exhaustive]
365pub struct ImportEntitiesRequest {
366 #[serde(skip_serializing_if = "std::string::String::is_empty")]
368 pub project_id: std::string::String,
369
370 #[serde(skip_serializing_if = "std::collections::HashMap::is_empty")]
372 pub labels: std::collections::HashMap<std::string::String, std::string::String>,
373
374 #[serde(skip_serializing_if = "std::string::String::is_empty")]
391 pub input_url: std::string::String,
392
393 #[serde(skip_serializing_if = "std::option::Option::is_none")]
398 pub entity_filter: std::option::Option<crate::model::EntityFilter>,
399
400 #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
401 _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
402}
403
404impl ImportEntitiesRequest {
405 pub fn new() -> Self {
406 std::default::Default::default()
407 }
408
409 pub fn set_project_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
411 self.project_id = v.into();
412 self
413 }
414
415 pub fn set_input_url<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
417 self.input_url = v.into();
418 self
419 }
420
421 pub fn set_entity_filter<
423 T: std::convert::Into<std::option::Option<crate::model::EntityFilter>>,
424 >(
425 mut self,
426 v: T,
427 ) -> Self {
428 self.entity_filter = v.into();
429 self
430 }
431
432 pub fn set_labels<T, K, V>(mut self, v: T) -> Self
434 where
435 T: std::iter::IntoIterator<Item = (K, V)>,
436 K: std::convert::Into<std::string::String>,
437 V: std::convert::Into<std::string::String>,
438 {
439 use std::iter::Iterator;
440 self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
441 self
442 }
443}
444
445impl wkt::message::Message for ImportEntitiesRequest {
446 fn typename() -> &'static str {
447 "type.googleapis.com/google.datastore.admin.v1.ImportEntitiesRequest"
448 }
449}
450
451#[serde_with::serde_as]
456#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
457#[serde(default, rename_all = "camelCase")]
458#[non_exhaustive]
459pub struct ExportEntitiesResponse {
460 #[serde(skip_serializing_if = "std::string::String::is_empty")]
467 pub output_url: std::string::String,
468
469 #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
470 _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
471}
472
473impl ExportEntitiesResponse {
474 pub fn new() -> Self {
475 std::default::Default::default()
476 }
477
478 pub fn set_output_url<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
480 self.output_url = v.into();
481 self
482 }
483}
484
485impl wkt::message::Message for ExportEntitiesResponse {
486 fn typename() -> &'static str {
487 "type.googleapis.com/google.datastore.admin.v1.ExportEntitiesResponse"
488 }
489}
490
491#[serde_with::serde_as]
493#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
494#[serde(default, rename_all = "camelCase")]
495#[non_exhaustive]
496pub struct ExportEntitiesMetadata {
497 #[serde(skip_serializing_if = "std::option::Option::is_none")]
499 pub common: std::option::Option<crate::model::CommonMetadata>,
500
501 #[serde(skip_serializing_if = "std::option::Option::is_none")]
503 pub progress_entities: std::option::Option<crate::model::Progress>,
504
505 #[serde(skip_serializing_if = "std::option::Option::is_none")]
507 pub progress_bytes: std::option::Option<crate::model::Progress>,
508
509 #[serde(skip_serializing_if = "std::option::Option::is_none")]
511 pub entity_filter: std::option::Option<crate::model::EntityFilter>,
512
513 #[serde(skip_serializing_if = "std::string::String::is_empty")]
522 pub output_url_prefix: std::string::String,
523
524 #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
525 _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
526}
527
528impl ExportEntitiesMetadata {
529 pub fn new() -> Self {
530 std::default::Default::default()
531 }
532
533 pub fn set_common<T: std::convert::Into<std::option::Option<crate::model::CommonMetadata>>>(
535 mut self,
536 v: T,
537 ) -> Self {
538 self.common = v.into();
539 self
540 }
541
542 pub fn set_progress_entities<
544 T: std::convert::Into<std::option::Option<crate::model::Progress>>,
545 >(
546 mut self,
547 v: T,
548 ) -> Self {
549 self.progress_entities = v.into();
550 self
551 }
552
553 pub fn set_progress_bytes<
555 T: std::convert::Into<std::option::Option<crate::model::Progress>>,
556 >(
557 mut self,
558 v: T,
559 ) -> Self {
560 self.progress_bytes = v.into();
561 self
562 }
563
564 pub fn set_entity_filter<
566 T: std::convert::Into<std::option::Option<crate::model::EntityFilter>>,
567 >(
568 mut self,
569 v: T,
570 ) -> Self {
571 self.entity_filter = v.into();
572 self
573 }
574
575 pub fn set_output_url_prefix<T: std::convert::Into<std::string::String>>(
577 mut self,
578 v: T,
579 ) -> Self {
580 self.output_url_prefix = v.into();
581 self
582 }
583}
584
585impl wkt::message::Message for ExportEntitiesMetadata {
586 fn typename() -> &'static str {
587 "type.googleapis.com/google.datastore.admin.v1.ExportEntitiesMetadata"
588 }
589}
590
591#[serde_with::serde_as]
593#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
594#[serde(default, rename_all = "camelCase")]
595#[non_exhaustive]
596pub struct ImportEntitiesMetadata {
597 #[serde(skip_serializing_if = "std::option::Option::is_none")]
599 pub common: std::option::Option<crate::model::CommonMetadata>,
600
601 #[serde(skip_serializing_if = "std::option::Option::is_none")]
603 pub progress_entities: std::option::Option<crate::model::Progress>,
604
605 #[serde(skip_serializing_if = "std::option::Option::is_none")]
607 pub progress_bytes: std::option::Option<crate::model::Progress>,
608
609 #[serde(skip_serializing_if = "std::option::Option::is_none")]
611 pub entity_filter: std::option::Option<crate::model::EntityFilter>,
612
613 #[serde(skip_serializing_if = "std::string::String::is_empty")]
620 pub input_url: std::string::String,
621
622 #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
623 _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
624}
625
626impl ImportEntitiesMetadata {
627 pub fn new() -> Self {
628 std::default::Default::default()
629 }
630
631 pub fn set_common<T: std::convert::Into<std::option::Option<crate::model::CommonMetadata>>>(
633 mut self,
634 v: T,
635 ) -> Self {
636 self.common = v.into();
637 self
638 }
639
640 pub fn set_progress_entities<
642 T: std::convert::Into<std::option::Option<crate::model::Progress>>,
643 >(
644 mut self,
645 v: T,
646 ) -> Self {
647 self.progress_entities = v.into();
648 self
649 }
650
651 pub fn set_progress_bytes<
653 T: std::convert::Into<std::option::Option<crate::model::Progress>>,
654 >(
655 mut self,
656 v: T,
657 ) -> Self {
658 self.progress_bytes = v.into();
659 self
660 }
661
662 pub fn set_entity_filter<
664 T: std::convert::Into<std::option::Option<crate::model::EntityFilter>>,
665 >(
666 mut self,
667 v: T,
668 ) -> Self {
669 self.entity_filter = v.into();
670 self
671 }
672
673 pub fn set_input_url<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
675 self.input_url = v.into();
676 self
677 }
678}
679
680impl wkt::message::Message for ImportEntitiesMetadata {
681 fn typename() -> &'static str {
682 "type.googleapis.com/google.datastore.admin.v1.ImportEntitiesMetadata"
683 }
684}
685
686#[serde_with::serde_as]
706#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
707#[serde(default, rename_all = "camelCase")]
708#[non_exhaustive]
709pub struct EntityFilter {
710 #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
712 pub kinds: std::vec::Vec<std::string::String>,
713
714 #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
722 pub namespace_ids: std::vec::Vec<std::string::String>,
723
724 #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
725 _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
726}
727
728impl EntityFilter {
729 pub fn new() -> Self {
730 std::default::Default::default()
731 }
732
733 pub fn set_kinds<T, V>(mut self, v: T) -> Self
735 where
736 T: std::iter::IntoIterator<Item = V>,
737 V: std::convert::Into<std::string::String>,
738 {
739 use std::iter::Iterator;
740 self.kinds = v.into_iter().map(|i| i.into()).collect();
741 self
742 }
743
744 pub fn set_namespace_ids<T, V>(mut self, v: T) -> Self
746 where
747 T: std::iter::IntoIterator<Item = V>,
748 V: std::convert::Into<std::string::String>,
749 {
750 use std::iter::Iterator;
751 self.namespace_ids = v.into_iter().map(|i| i.into()).collect();
752 self
753 }
754}
755
756impl wkt::message::Message for EntityFilter {
757 fn typename() -> &'static str {
758 "type.googleapis.com/google.datastore.admin.v1.EntityFilter"
759 }
760}
761
762#[serde_with::serde_as]
767#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
768#[serde(default, rename_all = "camelCase")]
769#[non_exhaustive]
770pub struct CreateIndexRequest {
771 #[serde(skip_serializing_if = "std::string::String::is_empty")]
773 pub project_id: std::string::String,
774
775 #[serde(skip_serializing_if = "std::option::Option::is_none")]
778 pub index: std::option::Option<crate::model::Index>,
779
780 #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
781 _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
782}
783
784impl CreateIndexRequest {
785 pub fn new() -> Self {
786 std::default::Default::default()
787 }
788
789 pub fn set_project_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
791 self.project_id = v.into();
792 self
793 }
794
795 pub fn set_index<T: std::convert::Into<std::option::Option<crate::model::Index>>>(
797 mut self,
798 v: T,
799 ) -> Self {
800 self.index = v.into();
801 self
802 }
803}
804
805impl wkt::message::Message for CreateIndexRequest {
806 fn typename() -> &'static str {
807 "type.googleapis.com/google.datastore.admin.v1.CreateIndexRequest"
808 }
809}
810
811#[serde_with::serde_as]
816#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
817#[serde(default, rename_all = "camelCase")]
818#[non_exhaustive]
819pub struct DeleteIndexRequest {
820 #[serde(skip_serializing_if = "std::string::String::is_empty")]
822 pub project_id: std::string::String,
823
824 #[serde(skip_serializing_if = "std::string::String::is_empty")]
826 pub index_id: std::string::String,
827
828 #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
829 _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
830}
831
832impl DeleteIndexRequest {
833 pub fn new() -> Self {
834 std::default::Default::default()
835 }
836
837 pub fn set_project_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
839 self.project_id = v.into();
840 self
841 }
842
843 pub fn set_index_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
845 self.index_id = v.into();
846 self
847 }
848}
849
850impl wkt::message::Message for DeleteIndexRequest {
851 fn typename() -> &'static str {
852 "type.googleapis.com/google.datastore.admin.v1.DeleteIndexRequest"
853 }
854}
855
856#[serde_with::serde_as]
861#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
862#[serde(default, rename_all = "camelCase")]
863#[non_exhaustive]
864pub struct GetIndexRequest {
865 #[serde(skip_serializing_if = "std::string::String::is_empty")]
867 pub project_id: std::string::String,
868
869 #[serde(skip_serializing_if = "std::string::String::is_empty")]
871 pub index_id: std::string::String,
872
873 #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
874 _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
875}
876
877impl GetIndexRequest {
878 pub fn new() -> Self {
879 std::default::Default::default()
880 }
881
882 pub fn set_project_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
884 self.project_id = v.into();
885 self
886 }
887
888 pub fn set_index_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
890 self.index_id = v.into();
891 self
892 }
893}
894
895impl wkt::message::Message for GetIndexRequest {
896 fn typename() -> &'static str {
897 "type.googleapis.com/google.datastore.admin.v1.GetIndexRequest"
898 }
899}
900
901#[serde_with::serde_as]
906#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
907#[serde(default, rename_all = "camelCase")]
908#[non_exhaustive]
909pub struct ListIndexesRequest {
910 #[serde(skip_serializing_if = "std::string::String::is_empty")]
912 pub project_id: std::string::String,
913
914 #[serde(skip_serializing_if = "std::string::String::is_empty")]
915 pub filter: std::string::String,
916
917 pub page_size: i32,
920
921 #[serde(skip_serializing_if = "std::string::String::is_empty")]
923 pub page_token: std::string::String,
924
925 #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
926 _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
927}
928
929impl ListIndexesRequest {
930 pub fn new() -> Self {
931 std::default::Default::default()
932 }
933
934 pub fn set_project_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
936 self.project_id = v.into();
937 self
938 }
939
940 pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
942 self.filter = v.into();
943 self
944 }
945
946 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
948 self.page_size = v.into();
949 self
950 }
951
952 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
954 self.page_token = v.into();
955 self
956 }
957}
958
959impl wkt::message::Message for ListIndexesRequest {
960 fn typename() -> &'static str {
961 "type.googleapis.com/google.datastore.admin.v1.ListIndexesRequest"
962 }
963}
964
965#[serde_with::serde_as]
970#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
971#[serde(default, rename_all = "camelCase")]
972#[non_exhaustive]
973pub struct ListIndexesResponse {
974 #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
976 pub indexes: std::vec::Vec<crate::model::Index>,
977
978 #[serde(skip_serializing_if = "std::string::String::is_empty")]
980 pub next_page_token: std::string::String,
981
982 #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
983 _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
984}
985
986impl ListIndexesResponse {
987 pub fn new() -> Self {
988 std::default::Default::default()
989 }
990
991 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
993 self.next_page_token = v.into();
994 self
995 }
996
997 pub fn set_indexes<T, V>(mut self, v: T) -> Self
999 where
1000 T: std::iter::IntoIterator<Item = V>,
1001 V: std::convert::Into<crate::model::Index>,
1002 {
1003 use std::iter::Iterator;
1004 self.indexes = v.into_iter().map(|i| i.into()).collect();
1005 self
1006 }
1007}
1008
1009impl wkt::message::Message for ListIndexesResponse {
1010 fn typename() -> &'static str {
1011 "type.googleapis.com/google.datastore.admin.v1.ListIndexesResponse"
1012 }
1013}
1014
1015#[doc(hidden)]
1016impl gax::paginator::internal::PageableResponse for ListIndexesResponse {
1017 type PageItem = crate::model::Index;
1018
1019 fn items(self) -> std::vec::Vec<Self::PageItem> {
1020 self.indexes
1021 }
1022
1023 fn next_page_token(&self) -> std::string::String {
1024 use std::clone::Clone;
1025 self.next_page_token.clone()
1026 }
1027}
1028
1029#[serde_with::serde_as]
1031#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
1032#[serde(default, rename_all = "camelCase")]
1033#[non_exhaustive]
1034pub struct IndexOperationMetadata {
1035 #[serde(skip_serializing_if = "std::option::Option::is_none")]
1037 pub common: std::option::Option<crate::model::CommonMetadata>,
1038
1039 #[serde(skip_serializing_if = "std::option::Option::is_none")]
1041 pub progress_entities: std::option::Option<crate::model::Progress>,
1042
1043 #[serde(skip_serializing_if = "std::string::String::is_empty")]
1045 pub index_id: std::string::String,
1046
1047 #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
1048 _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1049}
1050
1051impl IndexOperationMetadata {
1052 pub fn new() -> Self {
1053 std::default::Default::default()
1054 }
1055
1056 pub fn set_common<T: std::convert::Into<std::option::Option<crate::model::CommonMetadata>>>(
1058 mut self,
1059 v: T,
1060 ) -> Self {
1061 self.common = v.into();
1062 self
1063 }
1064
1065 pub fn set_progress_entities<
1067 T: std::convert::Into<std::option::Option<crate::model::Progress>>,
1068 >(
1069 mut self,
1070 v: T,
1071 ) -> Self {
1072 self.progress_entities = v.into();
1073 self
1074 }
1075
1076 pub fn set_index_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1078 self.index_id = v.into();
1079 self
1080 }
1081}
1082
1083impl wkt::message::Message for IndexOperationMetadata {
1084 fn typename() -> &'static str {
1085 "type.googleapis.com/google.datastore.admin.v1.IndexOperationMetadata"
1086 }
1087}
1088
1089#[serde_with::serde_as]
1098#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
1099#[serde(default, rename_all = "camelCase")]
1100#[non_exhaustive]
1101pub struct DatastoreFirestoreMigrationMetadata {
1102 pub migration_state: crate::model::MigrationState,
1105
1106 pub migration_step: crate::model::MigrationStep,
1109
1110 #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
1111 _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1112}
1113
1114impl DatastoreFirestoreMigrationMetadata {
1115 pub fn new() -> Self {
1116 std::default::Default::default()
1117 }
1118
1119 pub fn set_migration_state<T: std::convert::Into<crate::model::MigrationState>>(
1121 mut self,
1122 v: T,
1123 ) -> Self {
1124 self.migration_state = v.into();
1125 self
1126 }
1127
1128 pub fn set_migration_step<T: std::convert::Into<crate::model::MigrationStep>>(
1130 mut self,
1131 v: T,
1132 ) -> Self {
1133 self.migration_step = v.into();
1134 self
1135 }
1136}
1137
1138impl wkt::message::Message for DatastoreFirestoreMigrationMetadata {
1139 fn typename() -> &'static str {
1140 "type.googleapis.com/google.datastore.admin.v1.DatastoreFirestoreMigrationMetadata"
1141 }
1142}
1143
1144#[serde_with::serde_as]
1146#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
1147#[serde(default, rename_all = "camelCase")]
1148#[non_exhaustive]
1149pub struct Index {
1150 #[serde(skip_serializing_if = "std::string::String::is_empty")]
1152 pub project_id: std::string::String,
1153
1154 #[serde(skip_serializing_if = "std::string::String::is_empty")]
1156 pub index_id: std::string::String,
1157
1158 #[serde(skip_serializing_if = "std::string::String::is_empty")]
1160 pub kind: std::string::String,
1161
1162 pub ancestor: crate::model::index::AncestorMode,
1165
1166 #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
1172 pub properties: std::vec::Vec<crate::model::index::IndexedProperty>,
1173
1174 pub state: crate::model::index::State,
1176
1177 #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
1178 _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1179}
1180
1181impl Index {
1182 pub fn new() -> Self {
1183 std::default::Default::default()
1184 }
1185
1186 pub fn set_project_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1188 self.project_id = v.into();
1189 self
1190 }
1191
1192 pub fn set_index_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1194 self.index_id = v.into();
1195 self
1196 }
1197
1198 pub fn set_kind<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1200 self.kind = v.into();
1201 self
1202 }
1203
1204 pub fn set_ancestor<T: std::convert::Into<crate::model::index::AncestorMode>>(
1206 mut self,
1207 v: T,
1208 ) -> Self {
1209 self.ancestor = v.into();
1210 self
1211 }
1212
1213 pub fn set_state<T: std::convert::Into<crate::model::index::State>>(mut self, v: T) -> Self {
1215 self.state = v.into();
1216 self
1217 }
1218
1219 pub fn set_properties<T, V>(mut self, v: T) -> Self
1221 where
1222 T: std::iter::IntoIterator<Item = V>,
1223 V: std::convert::Into<crate::model::index::IndexedProperty>,
1224 {
1225 use std::iter::Iterator;
1226 self.properties = v.into_iter().map(|i| i.into()).collect();
1227 self
1228 }
1229}
1230
1231impl wkt::message::Message for Index {
1232 fn typename() -> &'static str {
1233 "type.googleapis.com/google.datastore.admin.v1.Index"
1234 }
1235}
1236
1237pub mod index {
1239 #[allow(unused_imports)]
1240 use super::*;
1241
1242 #[serde_with::serde_as]
1244 #[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
1245 #[serde(default, rename_all = "camelCase")]
1246 #[non_exhaustive]
1247 pub struct IndexedProperty {
1248 #[serde(skip_serializing_if = "std::string::String::is_empty")]
1250 pub name: std::string::String,
1251
1252 pub direction: crate::model::index::Direction,
1255
1256 #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
1257 _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1258 }
1259
1260 impl IndexedProperty {
1261 pub fn new() -> Self {
1262 std::default::Default::default()
1263 }
1264
1265 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1267 self.name = v.into();
1268 self
1269 }
1270
1271 pub fn set_direction<T: std::convert::Into<crate::model::index::Direction>>(
1273 mut self,
1274 v: T,
1275 ) -> Self {
1276 self.direction = v.into();
1277 self
1278 }
1279 }
1280
1281 impl wkt::message::Message for IndexedProperty {
1282 fn typename() -> &'static str {
1283 "type.googleapis.com/google.datastore.admin.v1.Index.IndexedProperty"
1284 }
1285 }
1286
1287 #[derive(Clone, Debug, PartialEq, serde::Deserialize, serde::Serialize)]
1290 pub struct AncestorMode(i32);
1291
1292 impl AncestorMode {
1293 pub const ANCESTOR_MODE_UNSPECIFIED: AncestorMode = AncestorMode::new(0);
1295
1296 pub const NONE: AncestorMode = AncestorMode::new(1);
1298
1299 pub const ALL_ANCESTORS: AncestorMode = AncestorMode::new(2);
1301
1302 pub(crate) const fn new(value: i32) -> Self {
1304 Self(value)
1305 }
1306
1307 pub fn value(&self) -> i32 {
1309 self.0
1310 }
1311
1312 pub fn as_str_name(&self) -> std::borrow::Cow<'static, str> {
1314 match self.0 {
1315 0 => std::borrow::Cow::Borrowed("ANCESTOR_MODE_UNSPECIFIED"),
1316 1 => std::borrow::Cow::Borrowed("NONE"),
1317 2 => std::borrow::Cow::Borrowed("ALL_ANCESTORS"),
1318 _ => std::borrow::Cow::Owned(std::format!("UNKNOWN-VALUE:{}", self.0)),
1319 }
1320 }
1321
1322 pub fn from_str_name(name: &str) -> std::option::Option<Self> {
1324 match name {
1325 "ANCESTOR_MODE_UNSPECIFIED" => {
1326 std::option::Option::Some(Self::ANCESTOR_MODE_UNSPECIFIED)
1327 }
1328 "NONE" => std::option::Option::Some(Self::NONE),
1329 "ALL_ANCESTORS" => std::option::Option::Some(Self::ALL_ANCESTORS),
1330 _ => std::option::Option::None,
1331 }
1332 }
1333 }
1334
1335 impl std::convert::From<i32> for AncestorMode {
1336 fn from(value: i32) -> Self {
1337 Self::new(value)
1338 }
1339 }
1340
1341 impl std::default::Default for AncestorMode {
1342 fn default() -> Self {
1343 Self::new(0)
1344 }
1345 }
1346
1347 #[derive(Clone, Debug, PartialEq, serde::Deserialize, serde::Serialize)]
1349 pub struct Direction(i32);
1350
1351 impl Direction {
1352 pub const DIRECTION_UNSPECIFIED: Direction = Direction::new(0);
1354
1355 pub const ASCENDING: Direction = Direction::new(1);
1358
1359 pub const DESCENDING: Direction = Direction::new(2);
1362
1363 pub(crate) const fn new(value: i32) -> Self {
1365 Self(value)
1366 }
1367
1368 pub fn value(&self) -> i32 {
1370 self.0
1371 }
1372
1373 pub fn as_str_name(&self) -> std::borrow::Cow<'static, str> {
1375 match self.0 {
1376 0 => std::borrow::Cow::Borrowed("DIRECTION_UNSPECIFIED"),
1377 1 => std::borrow::Cow::Borrowed("ASCENDING"),
1378 2 => std::borrow::Cow::Borrowed("DESCENDING"),
1379 _ => std::borrow::Cow::Owned(std::format!("UNKNOWN-VALUE:{}", self.0)),
1380 }
1381 }
1382
1383 pub fn from_str_name(name: &str) -> std::option::Option<Self> {
1385 match name {
1386 "DIRECTION_UNSPECIFIED" => std::option::Option::Some(Self::DIRECTION_UNSPECIFIED),
1387 "ASCENDING" => std::option::Option::Some(Self::ASCENDING),
1388 "DESCENDING" => std::option::Option::Some(Self::DESCENDING),
1389 _ => std::option::Option::None,
1390 }
1391 }
1392 }
1393
1394 impl std::convert::From<i32> for Direction {
1395 fn from(value: i32) -> Self {
1396 Self::new(value)
1397 }
1398 }
1399
1400 impl std::default::Default for Direction {
1401 fn default() -> Self {
1402 Self::new(0)
1403 }
1404 }
1405
1406 #[derive(Clone, Debug, PartialEq, serde::Deserialize, serde::Serialize)]
1408 pub struct State(i32);
1409
1410 impl State {
1411 pub const STATE_UNSPECIFIED: State = State::new(0);
1413
1414 pub const CREATING: State = State::new(1);
1419
1420 pub const READY: State = State::new(2);
1424
1425 pub const DELETING: State = State::new(3);
1430
1431 pub const ERROR: State = State::new(4);
1438
1439 pub(crate) const fn new(value: i32) -> Self {
1441 Self(value)
1442 }
1443
1444 pub fn value(&self) -> i32 {
1446 self.0
1447 }
1448
1449 pub fn as_str_name(&self) -> std::borrow::Cow<'static, str> {
1451 match self.0 {
1452 0 => std::borrow::Cow::Borrowed("STATE_UNSPECIFIED"),
1453 1 => std::borrow::Cow::Borrowed("CREATING"),
1454 2 => std::borrow::Cow::Borrowed("READY"),
1455 3 => std::borrow::Cow::Borrowed("DELETING"),
1456 4 => std::borrow::Cow::Borrowed("ERROR"),
1457 _ => std::borrow::Cow::Owned(std::format!("UNKNOWN-VALUE:{}", self.0)),
1458 }
1459 }
1460
1461 pub fn from_str_name(name: &str) -> std::option::Option<Self> {
1463 match name {
1464 "STATE_UNSPECIFIED" => std::option::Option::Some(Self::STATE_UNSPECIFIED),
1465 "CREATING" => std::option::Option::Some(Self::CREATING),
1466 "READY" => std::option::Option::Some(Self::READY),
1467 "DELETING" => std::option::Option::Some(Self::DELETING),
1468 "ERROR" => std::option::Option::Some(Self::ERROR),
1469 _ => std::option::Option::None,
1470 }
1471 }
1472 }
1473
1474 impl std::convert::From<i32> for State {
1475 fn from(value: i32) -> Self {
1476 Self::new(value)
1477 }
1478 }
1479
1480 impl std::default::Default for State {
1481 fn default() -> Self {
1482 Self::new(0)
1483 }
1484 }
1485}
1486
1487#[serde_with::serde_as]
1491#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
1492#[serde(default, rename_all = "camelCase")]
1493#[non_exhaustive]
1494pub struct MigrationStateEvent {
1495 pub state: crate::model::MigrationState,
1497
1498 #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
1499 _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1500}
1501
1502impl MigrationStateEvent {
1503 pub fn new() -> Self {
1504 std::default::Default::default()
1505 }
1506
1507 pub fn set_state<T: std::convert::Into<crate::model::MigrationState>>(mut self, v: T) -> Self {
1509 self.state = v.into();
1510 self
1511 }
1512}
1513
1514impl wkt::message::Message for MigrationStateEvent {
1515 fn typename() -> &'static str {
1516 "type.googleapis.com/google.datastore.admin.v1.MigrationStateEvent"
1517 }
1518}
1519
1520#[serde_with::serde_as]
1524#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
1525#[serde(default, rename_all = "camelCase")]
1526#[non_exhaustive]
1527pub struct MigrationProgressEvent {
1528 pub step: crate::model::MigrationStep,
1533
1534 #[serde(flatten, skip_serializing_if = "std::option::Option::is_none")]
1536 pub step_details: std::option::Option<crate::model::migration_progress_event::StepDetails>,
1537
1538 #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
1539 _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1540}
1541
1542impl MigrationProgressEvent {
1543 pub fn new() -> Self {
1544 std::default::Default::default()
1545 }
1546
1547 pub fn set_step<T: std::convert::Into<crate::model::MigrationStep>>(mut self, v: T) -> Self {
1549 self.step = v.into();
1550 self
1551 }
1552
1553 pub fn set_step_details<
1558 T: std::convert::Into<
1559 std::option::Option<crate::model::migration_progress_event::StepDetails>,
1560 >,
1561 >(
1562 mut self,
1563 v: T,
1564 ) -> Self {
1565 self.step_details = v.into();
1566 self
1567 }
1568
1569 pub fn prepare_step_details(
1573 &self,
1574 ) -> std::option::Option<
1575 &std::boxed::Box<crate::model::migration_progress_event::PrepareStepDetails>,
1576 > {
1577 #[allow(unreachable_patterns)]
1578 self.step_details.as_ref().and_then(|v| match v {
1579 crate::model::migration_progress_event::StepDetails::PrepareStepDetails(v) => {
1580 std::option::Option::Some(v)
1581 }
1582 _ => std::option::Option::None,
1583 })
1584 }
1585
1586 pub fn redirect_writes_step_details(
1590 &self,
1591 ) -> std::option::Option<
1592 &std::boxed::Box<crate::model::migration_progress_event::RedirectWritesStepDetails>,
1593 > {
1594 #[allow(unreachable_patterns)]
1595 self.step_details.as_ref().and_then(|v| match v {
1596 crate::model::migration_progress_event::StepDetails::RedirectWritesStepDetails(v) => {
1597 std::option::Option::Some(v)
1598 }
1599 _ => std::option::Option::None,
1600 })
1601 }
1602
1603 pub fn set_prepare_step_details<
1609 T: std::convert::Into<
1610 std::boxed::Box<crate::model::migration_progress_event::PrepareStepDetails>,
1611 >,
1612 >(
1613 mut self,
1614 v: T,
1615 ) -> Self {
1616 self.step_details = std::option::Option::Some(
1617 crate::model::migration_progress_event::StepDetails::PrepareStepDetails(v.into()),
1618 );
1619 self
1620 }
1621
1622 pub fn set_redirect_writes_step_details<
1628 T: std::convert::Into<
1629 std::boxed::Box<crate::model::migration_progress_event::RedirectWritesStepDetails>,
1630 >,
1631 >(
1632 mut self,
1633 v: T,
1634 ) -> Self {
1635 self.step_details = std::option::Option::Some(
1636 crate::model::migration_progress_event::StepDetails::RedirectWritesStepDetails(
1637 v.into(),
1638 ),
1639 );
1640 self
1641 }
1642}
1643
1644impl wkt::message::Message for MigrationProgressEvent {
1645 fn typename() -> &'static str {
1646 "type.googleapis.com/google.datastore.admin.v1.MigrationProgressEvent"
1647 }
1648}
1649
1650pub mod migration_progress_event {
1652 #[allow(unused_imports)]
1653 use super::*;
1654
1655 #[serde_with::serde_as]
1657 #[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
1658 #[serde(default, rename_all = "camelCase")]
1659 #[non_exhaustive]
1660 pub struct PrepareStepDetails {
1661 pub concurrency_mode: crate::model::migration_progress_event::ConcurrencyMode,
1664
1665 #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
1666 _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1667 }
1668
1669 impl PrepareStepDetails {
1670 pub fn new() -> Self {
1671 std::default::Default::default()
1672 }
1673
1674 pub fn set_concurrency_mode<
1676 T: std::convert::Into<crate::model::migration_progress_event::ConcurrencyMode>,
1677 >(
1678 mut self,
1679 v: T,
1680 ) -> Self {
1681 self.concurrency_mode = v.into();
1682 self
1683 }
1684 }
1685
1686 impl wkt::message::Message for PrepareStepDetails {
1687 fn typename() -> &'static str {
1688 "type.googleapis.com/google.datastore.admin.v1.MigrationProgressEvent.PrepareStepDetails"
1689 }
1690 }
1691
1692 #[serde_with::serde_as]
1694 #[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
1695 #[serde(default, rename_all = "camelCase")]
1696 #[non_exhaustive]
1697 pub struct RedirectWritesStepDetails {
1698 pub concurrency_mode: crate::model::migration_progress_event::ConcurrencyMode,
1700
1701 #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
1702 _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1703 }
1704
1705 impl RedirectWritesStepDetails {
1706 pub fn new() -> Self {
1707 std::default::Default::default()
1708 }
1709
1710 pub fn set_concurrency_mode<
1712 T: std::convert::Into<crate::model::migration_progress_event::ConcurrencyMode>,
1713 >(
1714 mut self,
1715 v: T,
1716 ) -> Self {
1717 self.concurrency_mode = v.into();
1718 self
1719 }
1720 }
1721
1722 impl wkt::message::Message for RedirectWritesStepDetails {
1723 fn typename() -> &'static str {
1724 "type.googleapis.com/google.datastore.admin.v1.MigrationProgressEvent.RedirectWritesStepDetails"
1725 }
1726 }
1727
1728 #[derive(Clone, Debug, PartialEq, serde::Deserialize, serde::Serialize)]
1730 pub struct ConcurrencyMode(i32);
1731
1732 impl ConcurrencyMode {
1733 pub const CONCURRENCY_MODE_UNSPECIFIED: ConcurrencyMode = ConcurrencyMode::new(0);
1735
1736 pub const PESSIMISTIC: ConcurrencyMode = ConcurrencyMode::new(1);
1738
1739 pub const OPTIMISTIC: ConcurrencyMode = ConcurrencyMode::new(2);
1741
1742 pub const OPTIMISTIC_WITH_ENTITY_GROUPS: ConcurrencyMode = ConcurrencyMode::new(3);
1744
1745 pub(crate) const fn new(value: i32) -> Self {
1747 Self(value)
1748 }
1749
1750 pub fn value(&self) -> i32 {
1752 self.0
1753 }
1754
1755 pub fn as_str_name(&self) -> std::borrow::Cow<'static, str> {
1757 match self.0 {
1758 0 => std::borrow::Cow::Borrowed("CONCURRENCY_MODE_UNSPECIFIED"),
1759 1 => std::borrow::Cow::Borrowed("PESSIMISTIC"),
1760 2 => std::borrow::Cow::Borrowed("OPTIMISTIC"),
1761 3 => std::borrow::Cow::Borrowed("OPTIMISTIC_WITH_ENTITY_GROUPS"),
1762 _ => std::borrow::Cow::Owned(std::format!("UNKNOWN-VALUE:{}", self.0)),
1763 }
1764 }
1765
1766 pub fn from_str_name(name: &str) -> std::option::Option<Self> {
1768 match name {
1769 "CONCURRENCY_MODE_UNSPECIFIED" => {
1770 std::option::Option::Some(Self::CONCURRENCY_MODE_UNSPECIFIED)
1771 }
1772 "PESSIMISTIC" => std::option::Option::Some(Self::PESSIMISTIC),
1773 "OPTIMISTIC" => std::option::Option::Some(Self::OPTIMISTIC),
1774 "OPTIMISTIC_WITH_ENTITY_GROUPS" => {
1775 std::option::Option::Some(Self::OPTIMISTIC_WITH_ENTITY_GROUPS)
1776 }
1777 _ => std::option::Option::None,
1778 }
1779 }
1780 }
1781
1782 impl std::convert::From<i32> for ConcurrencyMode {
1783 fn from(value: i32) -> Self {
1784 Self::new(value)
1785 }
1786 }
1787
1788 impl std::default::Default for ConcurrencyMode {
1789 fn default() -> Self {
1790 Self::new(0)
1791 }
1792 }
1793
1794 #[derive(Clone, Debug, PartialEq, serde::Deserialize, serde::Serialize)]
1796 #[serde(rename_all = "camelCase")]
1797 #[non_exhaustive]
1798 pub enum StepDetails {
1799 PrepareStepDetails(
1801 std::boxed::Box<crate::model::migration_progress_event::PrepareStepDetails>,
1802 ),
1803 RedirectWritesStepDetails(
1805 std::boxed::Box<crate::model::migration_progress_event::RedirectWritesStepDetails>,
1806 ),
1807 }
1808}
1809
1810#[derive(Clone, Debug, PartialEq, serde::Deserialize, serde::Serialize)]
1812pub struct OperationType(i32);
1813
1814impl OperationType {
1815 pub const OPERATION_TYPE_UNSPECIFIED: OperationType = OperationType::new(0);
1817
1818 pub const EXPORT_ENTITIES: OperationType = OperationType::new(1);
1820
1821 pub const IMPORT_ENTITIES: OperationType = OperationType::new(2);
1823
1824 pub const CREATE_INDEX: OperationType = OperationType::new(3);
1826
1827 pub const DELETE_INDEX: OperationType = OperationType::new(4);
1829
1830 pub(crate) const fn new(value: i32) -> Self {
1832 Self(value)
1833 }
1834
1835 pub fn value(&self) -> i32 {
1837 self.0
1838 }
1839
1840 pub fn as_str_name(&self) -> std::borrow::Cow<'static, str> {
1842 match self.0 {
1843 0 => std::borrow::Cow::Borrowed("OPERATION_TYPE_UNSPECIFIED"),
1844 1 => std::borrow::Cow::Borrowed("EXPORT_ENTITIES"),
1845 2 => std::borrow::Cow::Borrowed("IMPORT_ENTITIES"),
1846 3 => std::borrow::Cow::Borrowed("CREATE_INDEX"),
1847 4 => std::borrow::Cow::Borrowed("DELETE_INDEX"),
1848 _ => std::borrow::Cow::Owned(std::format!("UNKNOWN-VALUE:{}", self.0)),
1849 }
1850 }
1851
1852 pub fn from_str_name(name: &str) -> std::option::Option<Self> {
1854 match name {
1855 "OPERATION_TYPE_UNSPECIFIED" => {
1856 std::option::Option::Some(Self::OPERATION_TYPE_UNSPECIFIED)
1857 }
1858 "EXPORT_ENTITIES" => std::option::Option::Some(Self::EXPORT_ENTITIES),
1859 "IMPORT_ENTITIES" => std::option::Option::Some(Self::IMPORT_ENTITIES),
1860 "CREATE_INDEX" => std::option::Option::Some(Self::CREATE_INDEX),
1861 "DELETE_INDEX" => std::option::Option::Some(Self::DELETE_INDEX),
1862 _ => std::option::Option::None,
1863 }
1864 }
1865}
1866
1867impl std::convert::From<i32> for OperationType {
1868 fn from(value: i32) -> Self {
1869 Self::new(value)
1870 }
1871}
1872
1873impl std::default::Default for OperationType {
1874 fn default() -> Self {
1875 Self::new(0)
1876 }
1877}
1878
1879#[derive(Clone, Debug, PartialEq, serde::Deserialize, serde::Serialize)]
1881pub struct MigrationState(i32);
1882
1883impl MigrationState {
1884 pub const MIGRATION_STATE_UNSPECIFIED: MigrationState = MigrationState::new(0);
1886
1887 pub const RUNNING: MigrationState = MigrationState::new(1);
1889
1890 pub const PAUSED: MigrationState = MigrationState::new(2);
1892
1893 pub const COMPLETE: MigrationState = MigrationState::new(3);
1895
1896 pub(crate) const fn new(value: i32) -> Self {
1898 Self(value)
1899 }
1900
1901 pub fn value(&self) -> i32 {
1903 self.0
1904 }
1905
1906 pub fn as_str_name(&self) -> std::borrow::Cow<'static, str> {
1908 match self.0 {
1909 0 => std::borrow::Cow::Borrowed("MIGRATION_STATE_UNSPECIFIED"),
1910 1 => std::borrow::Cow::Borrowed("RUNNING"),
1911 2 => std::borrow::Cow::Borrowed("PAUSED"),
1912 3 => std::borrow::Cow::Borrowed("COMPLETE"),
1913 _ => std::borrow::Cow::Owned(std::format!("UNKNOWN-VALUE:{}", self.0)),
1914 }
1915 }
1916
1917 pub fn from_str_name(name: &str) -> std::option::Option<Self> {
1919 match name {
1920 "MIGRATION_STATE_UNSPECIFIED" => {
1921 std::option::Option::Some(Self::MIGRATION_STATE_UNSPECIFIED)
1922 }
1923 "RUNNING" => std::option::Option::Some(Self::RUNNING),
1924 "PAUSED" => std::option::Option::Some(Self::PAUSED),
1925 "COMPLETE" => std::option::Option::Some(Self::COMPLETE),
1926 _ => std::option::Option::None,
1927 }
1928 }
1929}
1930
1931impl std::convert::From<i32> for MigrationState {
1932 fn from(value: i32) -> Self {
1933 Self::new(value)
1934 }
1935}
1936
1937impl std::default::Default for MigrationState {
1938 fn default() -> Self {
1939 Self::new(0)
1940 }
1941}
1942
1943#[derive(Clone, Debug, PartialEq, serde::Deserialize, serde::Serialize)]
1945pub struct MigrationStep(i32);
1946
1947impl MigrationStep {
1948 pub const MIGRATION_STEP_UNSPECIFIED: MigrationStep = MigrationStep::new(0);
1950
1951 pub const PREPARE: MigrationStep = MigrationStep::new(6);
1953
1954 pub const START: MigrationStep = MigrationStep::new(1);
1956
1957 pub const APPLY_WRITES_SYNCHRONOUSLY: MigrationStep = MigrationStep::new(7);
1959
1960 pub const COPY_AND_VERIFY: MigrationStep = MigrationStep::new(2);
1963
1964 pub const REDIRECT_EVENTUALLY_CONSISTENT_READS: MigrationStep = MigrationStep::new(3);
1966
1967 pub const REDIRECT_STRONGLY_CONSISTENT_READS: MigrationStep = MigrationStep::new(4);
1969
1970 pub const REDIRECT_WRITES: MigrationStep = MigrationStep::new(5);
1972
1973 pub(crate) const fn new(value: i32) -> Self {
1975 Self(value)
1976 }
1977
1978 pub fn value(&self) -> i32 {
1980 self.0
1981 }
1982
1983 pub fn as_str_name(&self) -> std::borrow::Cow<'static, str> {
1985 match self.0 {
1986 0 => std::borrow::Cow::Borrowed("MIGRATION_STEP_UNSPECIFIED"),
1987 1 => std::borrow::Cow::Borrowed("START"),
1988 2 => std::borrow::Cow::Borrowed("COPY_AND_VERIFY"),
1989 3 => std::borrow::Cow::Borrowed("REDIRECT_EVENTUALLY_CONSISTENT_READS"),
1990 4 => std::borrow::Cow::Borrowed("REDIRECT_STRONGLY_CONSISTENT_READS"),
1991 5 => std::borrow::Cow::Borrowed("REDIRECT_WRITES"),
1992 6 => std::borrow::Cow::Borrowed("PREPARE"),
1993 7 => std::borrow::Cow::Borrowed("APPLY_WRITES_SYNCHRONOUSLY"),
1994 _ => std::borrow::Cow::Owned(std::format!("UNKNOWN-VALUE:{}", self.0)),
1995 }
1996 }
1997
1998 pub fn from_str_name(name: &str) -> std::option::Option<Self> {
2000 match name {
2001 "MIGRATION_STEP_UNSPECIFIED" => {
2002 std::option::Option::Some(Self::MIGRATION_STEP_UNSPECIFIED)
2003 }
2004 "PREPARE" => std::option::Option::Some(Self::PREPARE),
2005 "START" => std::option::Option::Some(Self::START),
2006 "APPLY_WRITES_SYNCHRONOUSLY" => {
2007 std::option::Option::Some(Self::APPLY_WRITES_SYNCHRONOUSLY)
2008 }
2009 "COPY_AND_VERIFY" => std::option::Option::Some(Self::COPY_AND_VERIFY),
2010 "REDIRECT_EVENTUALLY_CONSISTENT_READS" => {
2011 std::option::Option::Some(Self::REDIRECT_EVENTUALLY_CONSISTENT_READS)
2012 }
2013 "REDIRECT_STRONGLY_CONSISTENT_READS" => {
2014 std::option::Option::Some(Self::REDIRECT_STRONGLY_CONSISTENT_READS)
2015 }
2016 "REDIRECT_WRITES" => std::option::Option::Some(Self::REDIRECT_WRITES),
2017 _ => std::option::Option::None,
2018 }
2019 }
2020}
2021
2022impl std::convert::From<i32> for MigrationStep {
2023 fn from(value: i32) -> Self {
2024 Self::new(value)
2025 }
2026}
2027
2028impl std::default::Default for MigrationStep {
2029 fn default() -> Self {
2030 Self::new(0)
2031 }
2032}