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 lazy_static;
24extern crate longrunning;
25extern crate lro;
26extern crate reqwest;
27extern crate serde;
28extern crate serde_json;
29extern crate serde_with;
30extern crate std;
31extern crate tracing;
32extern crate wkt;
33
34#[serde_with::serde_as]
36#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
37#[serde(default, rename_all = "camelCase")]
38#[non_exhaustive]
39pub struct CommonMetadata {
40 #[serde(skip_serializing_if = "std::option::Option::is_none")]
42 pub start_time: std::option::Option<wkt::Timestamp>,
43
44 #[serde(skip_serializing_if = "std::option::Option::is_none")]
46 pub end_time: std::option::Option<wkt::Timestamp>,
47
48 pub operation_type: crate::model::OperationType,
51
52 #[serde(skip_serializing_if = "std::collections::HashMap::is_empty")]
55 pub labels: std::collections::HashMap<std::string::String, std::string::String>,
56
57 pub state: crate::model::common_metadata::State,
59}
60
61impl CommonMetadata {
62 pub fn new() -> Self {
63 std::default::Default::default()
64 }
65
66 pub fn set_start_time<T: std::convert::Into<std::option::Option<wkt::Timestamp>>>(
68 mut self,
69 v: T,
70 ) -> Self {
71 self.start_time = v.into();
72 self
73 }
74
75 pub fn set_end_time<T: std::convert::Into<std::option::Option<wkt::Timestamp>>>(
77 mut self,
78 v: T,
79 ) -> Self {
80 self.end_time = v.into();
81 self
82 }
83
84 pub fn set_operation_type<T: std::convert::Into<crate::model::OperationType>>(
86 mut self,
87 v: T,
88 ) -> Self {
89 self.operation_type = v.into();
90 self
91 }
92
93 pub fn set_state<T: std::convert::Into<crate::model::common_metadata::State>>(
95 mut self,
96 v: T,
97 ) -> Self {
98 self.state = v.into();
99 self
100 }
101
102 pub fn set_labels<T, K, V>(mut self, v: T) -> Self
104 where
105 T: std::iter::IntoIterator<Item = (K, V)>,
106 K: std::convert::Into<std::string::String>,
107 V: std::convert::Into<std::string::String>,
108 {
109 use std::iter::Iterator;
110 self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
111 self
112 }
113}
114
115impl wkt::message::Message for CommonMetadata {
116 fn typename() -> &'static str {
117 "type.googleapis.com/google.datastore.admin.v1.CommonMetadata"
118 }
119}
120
121pub mod common_metadata {
123 #[allow(unused_imports)]
124 use super::*;
125
126 #[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
128 pub struct State(std::borrow::Cow<'static, str>);
129
130 impl State {
131 pub const fn new(v: &'static str) -> Self {
133 Self(std::borrow::Cow::Borrowed(v))
134 }
135
136 pub fn value(&self) -> &str {
138 &self.0
139 }
140 }
141
142 pub mod state {
144 use super::State;
145
146 pub const STATE_UNSPECIFIED: State = State::new("STATE_UNSPECIFIED");
148
149 pub const INITIALIZING: State = State::new("INITIALIZING");
151
152 pub const PROCESSING: State = State::new("PROCESSING");
154
155 pub const CANCELLING: State = State::new("CANCELLING");
158
159 pub const FINALIZING: State = State::new("FINALIZING");
161
162 pub const SUCCESSFUL: State = State::new("SUCCESSFUL");
164
165 pub const FAILED: State = State::new("FAILED");
167
168 pub const CANCELLED: State = State::new("CANCELLED");
171 }
172
173 impl std::convert::From<std::string::String> for State {
174 fn from(value: std::string::String) -> Self {
175 Self(std::borrow::Cow::Owned(value))
176 }
177 }
178}
179
180#[serde_with::serde_as]
182#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
183#[serde(default, rename_all = "camelCase")]
184#[non_exhaustive]
185pub struct Progress {
186 #[serde_as(as = "serde_with::DisplayFromStr")]
189 pub work_completed: i64,
190
191 #[serde_as(as = "serde_with::DisplayFromStr")]
194 pub work_estimated: i64,
195}
196
197impl Progress {
198 pub fn new() -> Self {
199 std::default::Default::default()
200 }
201
202 pub fn set_work_completed<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
204 self.work_completed = v.into();
205 self
206 }
207
208 pub fn set_work_estimated<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
210 self.work_estimated = v.into();
211 self
212 }
213}
214
215impl wkt::message::Message for Progress {
216 fn typename() -> &'static str {
217 "type.googleapis.com/google.datastore.admin.v1.Progress"
218 }
219}
220
221#[serde_with::serde_as]
226#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
227#[serde(default, rename_all = "camelCase")]
228#[non_exhaustive]
229pub struct ExportEntitiesRequest {
230 #[serde(skip_serializing_if = "std::string::String::is_empty")]
232 pub project_id: std::string::String,
233
234 #[serde(skip_serializing_if = "std::collections::HashMap::is_empty")]
236 pub labels: std::collections::HashMap<std::string::String, std::string::String>,
237
238 #[serde(skip_serializing_if = "std::option::Option::is_none")]
240 pub entity_filter: std::option::Option<crate::model::EntityFilter>,
241
242 #[serde(skip_serializing_if = "std::string::String::is_empty")]
263 pub output_url_prefix: std::string::String,
264}
265
266impl ExportEntitiesRequest {
267 pub fn new() -> Self {
268 std::default::Default::default()
269 }
270
271 pub fn set_project_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
273 self.project_id = v.into();
274 self
275 }
276
277 pub fn set_entity_filter<
279 T: std::convert::Into<std::option::Option<crate::model::EntityFilter>>,
280 >(
281 mut self,
282 v: T,
283 ) -> Self {
284 self.entity_filter = v.into();
285 self
286 }
287
288 pub fn set_output_url_prefix<T: std::convert::Into<std::string::String>>(
290 mut self,
291 v: T,
292 ) -> Self {
293 self.output_url_prefix = v.into();
294 self
295 }
296
297 pub fn set_labels<T, K, V>(mut self, v: T) -> Self
299 where
300 T: std::iter::IntoIterator<Item = (K, V)>,
301 K: std::convert::Into<std::string::String>,
302 V: std::convert::Into<std::string::String>,
303 {
304 use std::iter::Iterator;
305 self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
306 self
307 }
308}
309
310impl wkt::message::Message for ExportEntitiesRequest {
311 fn typename() -> &'static str {
312 "type.googleapis.com/google.datastore.admin.v1.ExportEntitiesRequest"
313 }
314}
315
316#[serde_with::serde_as]
321#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
322#[serde(default, rename_all = "camelCase")]
323#[non_exhaustive]
324pub struct ImportEntitiesRequest {
325 #[serde(skip_serializing_if = "std::string::String::is_empty")]
327 pub project_id: std::string::String,
328
329 #[serde(skip_serializing_if = "std::collections::HashMap::is_empty")]
331 pub labels: std::collections::HashMap<std::string::String, std::string::String>,
332
333 #[serde(skip_serializing_if = "std::string::String::is_empty")]
350 pub input_url: std::string::String,
351
352 #[serde(skip_serializing_if = "std::option::Option::is_none")]
357 pub entity_filter: std::option::Option<crate::model::EntityFilter>,
358}
359
360impl ImportEntitiesRequest {
361 pub fn new() -> Self {
362 std::default::Default::default()
363 }
364
365 pub fn set_project_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
367 self.project_id = v.into();
368 self
369 }
370
371 pub fn set_input_url<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
373 self.input_url = v.into();
374 self
375 }
376
377 pub fn set_entity_filter<
379 T: std::convert::Into<std::option::Option<crate::model::EntityFilter>>,
380 >(
381 mut self,
382 v: T,
383 ) -> Self {
384 self.entity_filter = v.into();
385 self
386 }
387
388 pub fn set_labels<T, K, V>(mut self, v: T) -> Self
390 where
391 T: std::iter::IntoIterator<Item = (K, V)>,
392 K: std::convert::Into<std::string::String>,
393 V: std::convert::Into<std::string::String>,
394 {
395 use std::iter::Iterator;
396 self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
397 self
398 }
399}
400
401impl wkt::message::Message for ImportEntitiesRequest {
402 fn typename() -> &'static str {
403 "type.googleapis.com/google.datastore.admin.v1.ImportEntitiesRequest"
404 }
405}
406
407#[serde_with::serde_as]
412#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
413#[serde(default, rename_all = "camelCase")]
414#[non_exhaustive]
415pub struct ExportEntitiesResponse {
416 #[serde(skip_serializing_if = "std::string::String::is_empty")]
423 pub output_url: std::string::String,
424}
425
426impl ExportEntitiesResponse {
427 pub fn new() -> Self {
428 std::default::Default::default()
429 }
430
431 pub fn set_output_url<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
433 self.output_url = v.into();
434 self
435 }
436}
437
438impl wkt::message::Message for ExportEntitiesResponse {
439 fn typename() -> &'static str {
440 "type.googleapis.com/google.datastore.admin.v1.ExportEntitiesResponse"
441 }
442}
443
444#[serde_with::serde_as]
446#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
447#[serde(default, rename_all = "camelCase")]
448#[non_exhaustive]
449pub struct ExportEntitiesMetadata {
450 #[serde(skip_serializing_if = "std::option::Option::is_none")]
452 pub common: std::option::Option<crate::model::CommonMetadata>,
453
454 #[serde(skip_serializing_if = "std::option::Option::is_none")]
456 pub progress_entities: std::option::Option<crate::model::Progress>,
457
458 #[serde(skip_serializing_if = "std::option::Option::is_none")]
460 pub progress_bytes: std::option::Option<crate::model::Progress>,
461
462 #[serde(skip_serializing_if = "std::option::Option::is_none")]
464 pub entity_filter: std::option::Option<crate::model::EntityFilter>,
465
466 #[serde(skip_serializing_if = "std::string::String::is_empty")]
475 pub output_url_prefix: std::string::String,
476}
477
478impl ExportEntitiesMetadata {
479 pub fn new() -> Self {
480 std::default::Default::default()
481 }
482
483 pub fn set_common<T: std::convert::Into<std::option::Option<crate::model::CommonMetadata>>>(
485 mut self,
486 v: T,
487 ) -> Self {
488 self.common = v.into();
489 self
490 }
491
492 pub fn set_progress_entities<
494 T: std::convert::Into<std::option::Option<crate::model::Progress>>,
495 >(
496 mut self,
497 v: T,
498 ) -> Self {
499 self.progress_entities = v.into();
500 self
501 }
502
503 pub fn set_progress_bytes<
505 T: std::convert::Into<std::option::Option<crate::model::Progress>>,
506 >(
507 mut self,
508 v: T,
509 ) -> Self {
510 self.progress_bytes = v.into();
511 self
512 }
513
514 pub fn set_entity_filter<
516 T: std::convert::Into<std::option::Option<crate::model::EntityFilter>>,
517 >(
518 mut self,
519 v: T,
520 ) -> Self {
521 self.entity_filter = v.into();
522 self
523 }
524
525 pub fn set_output_url_prefix<T: std::convert::Into<std::string::String>>(
527 mut self,
528 v: T,
529 ) -> Self {
530 self.output_url_prefix = v.into();
531 self
532 }
533}
534
535impl wkt::message::Message for ExportEntitiesMetadata {
536 fn typename() -> &'static str {
537 "type.googleapis.com/google.datastore.admin.v1.ExportEntitiesMetadata"
538 }
539}
540
541#[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 ImportEntitiesMetadata {
547 #[serde(skip_serializing_if = "std::option::Option::is_none")]
549 pub common: std::option::Option<crate::model::CommonMetadata>,
550
551 #[serde(skip_serializing_if = "std::option::Option::is_none")]
553 pub progress_entities: std::option::Option<crate::model::Progress>,
554
555 #[serde(skip_serializing_if = "std::option::Option::is_none")]
557 pub progress_bytes: std::option::Option<crate::model::Progress>,
558
559 #[serde(skip_serializing_if = "std::option::Option::is_none")]
561 pub entity_filter: std::option::Option<crate::model::EntityFilter>,
562
563 #[serde(skip_serializing_if = "std::string::String::is_empty")]
570 pub input_url: std::string::String,
571}
572
573impl ImportEntitiesMetadata {
574 pub fn new() -> Self {
575 std::default::Default::default()
576 }
577
578 pub fn set_common<T: std::convert::Into<std::option::Option<crate::model::CommonMetadata>>>(
580 mut self,
581 v: T,
582 ) -> Self {
583 self.common = v.into();
584 self
585 }
586
587 pub fn set_progress_entities<
589 T: std::convert::Into<std::option::Option<crate::model::Progress>>,
590 >(
591 mut self,
592 v: T,
593 ) -> Self {
594 self.progress_entities = v.into();
595 self
596 }
597
598 pub fn set_progress_bytes<
600 T: std::convert::Into<std::option::Option<crate::model::Progress>>,
601 >(
602 mut self,
603 v: T,
604 ) -> Self {
605 self.progress_bytes = v.into();
606 self
607 }
608
609 pub fn set_entity_filter<
611 T: std::convert::Into<std::option::Option<crate::model::EntityFilter>>,
612 >(
613 mut self,
614 v: T,
615 ) -> Self {
616 self.entity_filter = v.into();
617 self
618 }
619
620 pub fn set_input_url<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
622 self.input_url = v.into();
623 self
624 }
625}
626
627impl wkt::message::Message for ImportEntitiesMetadata {
628 fn typename() -> &'static str {
629 "type.googleapis.com/google.datastore.admin.v1.ImportEntitiesMetadata"
630 }
631}
632
633#[serde_with::serde_as]
653#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
654#[serde(default, rename_all = "camelCase")]
655#[non_exhaustive]
656pub struct EntityFilter {
657 #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
659 pub kinds: std::vec::Vec<std::string::String>,
660
661 #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
669 pub namespace_ids: std::vec::Vec<std::string::String>,
670}
671
672impl EntityFilter {
673 pub fn new() -> Self {
674 std::default::Default::default()
675 }
676
677 pub fn set_kinds<T, V>(mut self, v: T) -> Self
679 where
680 T: std::iter::IntoIterator<Item = V>,
681 V: std::convert::Into<std::string::String>,
682 {
683 use std::iter::Iterator;
684 self.kinds = v.into_iter().map(|i| i.into()).collect();
685 self
686 }
687
688 pub fn set_namespace_ids<T, V>(mut self, v: T) -> Self
690 where
691 T: std::iter::IntoIterator<Item = V>,
692 V: std::convert::Into<std::string::String>,
693 {
694 use std::iter::Iterator;
695 self.namespace_ids = v.into_iter().map(|i| i.into()).collect();
696 self
697 }
698}
699
700impl wkt::message::Message for EntityFilter {
701 fn typename() -> &'static str {
702 "type.googleapis.com/google.datastore.admin.v1.EntityFilter"
703 }
704}
705
706#[serde_with::serde_as]
711#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
712#[serde(default, rename_all = "camelCase")]
713#[non_exhaustive]
714pub struct CreateIndexRequest {
715 #[serde(skip_serializing_if = "std::string::String::is_empty")]
717 pub project_id: std::string::String,
718
719 #[serde(skip_serializing_if = "std::option::Option::is_none")]
722 pub index: std::option::Option<crate::model::Index>,
723}
724
725impl CreateIndexRequest {
726 pub fn new() -> Self {
727 std::default::Default::default()
728 }
729
730 pub fn set_project_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
732 self.project_id = v.into();
733 self
734 }
735
736 pub fn set_index<T: std::convert::Into<std::option::Option<crate::model::Index>>>(
738 mut self,
739 v: T,
740 ) -> Self {
741 self.index = v.into();
742 self
743 }
744}
745
746impl wkt::message::Message for CreateIndexRequest {
747 fn typename() -> &'static str {
748 "type.googleapis.com/google.datastore.admin.v1.CreateIndexRequest"
749 }
750}
751
752#[serde_with::serde_as]
757#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
758#[serde(default, rename_all = "camelCase")]
759#[non_exhaustive]
760pub struct DeleteIndexRequest {
761 #[serde(skip_serializing_if = "std::string::String::is_empty")]
763 pub project_id: std::string::String,
764
765 #[serde(skip_serializing_if = "std::string::String::is_empty")]
767 pub index_id: std::string::String,
768}
769
770impl DeleteIndexRequest {
771 pub fn new() -> Self {
772 std::default::Default::default()
773 }
774
775 pub fn set_project_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
777 self.project_id = v.into();
778 self
779 }
780
781 pub fn set_index_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
783 self.index_id = v.into();
784 self
785 }
786}
787
788impl wkt::message::Message for DeleteIndexRequest {
789 fn typename() -> &'static str {
790 "type.googleapis.com/google.datastore.admin.v1.DeleteIndexRequest"
791 }
792}
793
794#[serde_with::serde_as]
799#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
800#[serde(default, rename_all = "camelCase")]
801#[non_exhaustive]
802pub struct GetIndexRequest {
803 #[serde(skip_serializing_if = "std::string::String::is_empty")]
805 pub project_id: std::string::String,
806
807 #[serde(skip_serializing_if = "std::string::String::is_empty")]
809 pub index_id: std::string::String,
810}
811
812impl GetIndexRequest {
813 pub fn new() -> Self {
814 std::default::Default::default()
815 }
816
817 pub fn set_project_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
819 self.project_id = v.into();
820 self
821 }
822
823 pub fn set_index_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
825 self.index_id = v.into();
826 self
827 }
828}
829
830impl wkt::message::Message for GetIndexRequest {
831 fn typename() -> &'static str {
832 "type.googleapis.com/google.datastore.admin.v1.GetIndexRequest"
833 }
834}
835
836#[serde_with::serde_as]
841#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
842#[serde(default, rename_all = "camelCase")]
843#[non_exhaustive]
844pub struct ListIndexesRequest {
845 #[serde(skip_serializing_if = "std::string::String::is_empty")]
847 pub project_id: std::string::String,
848
849 #[serde(skip_serializing_if = "std::string::String::is_empty")]
850 pub filter: std::string::String,
851
852 pub page_size: i32,
855
856 #[serde(skip_serializing_if = "std::string::String::is_empty")]
858 pub page_token: std::string::String,
859}
860
861impl ListIndexesRequest {
862 pub fn new() -> Self {
863 std::default::Default::default()
864 }
865
866 pub fn set_project_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
868 self.project_id = v.into();
869 self
870 }
871
872 pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
874 self.filter = v.into();
875 self
876 }
877
878 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
880 self.page_size = v.into();
881 self
882 }
883
884 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
886 self.page_token = v.into();
887 self
888 }
889}
890
891impl wkt::message::Message for ListIndexesRequest {
892 fn typename() -> &'static str {
893 "type.googleapis.com/google.datastore.admin.v1.ListIndexesRequest"
894 }
895}
896
897#[serde_with::serde_as]
902#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
903#[serde(default, rename_all = "camelCase")]
904#[non_exhaustive]
905pub struct ListIndexesResponse {
906 #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
908 pub indexes: std::vec::Vec<crate::model::Index>,
909
910 #[serde(skip_serializing_if = "std::string::String::is_empty")]
912 pub next_page_token: std::string::String,
913}
914
915impl ListIndexesResponse {
916 pub fn new() -> Self {
917 std::default::Default::default()
918 }
919
920 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
922 self.next_page_token = v.into();
923 self
924 }
925
926 pub fn set_indexes<T, V>(mut self, v: T) -> Self
928 where
929 T: std::iter::IntoIterator<Item = V>,
930 V: std::convert::Into<crate::model::Index>,
931 {
932 use std::iter::Iterator;
933 self.indexes = v.into_iter().map(|i| i.into()).collect();
934 self
935 }
936}
937
938impl wkt::message::Message for ListIndexesResponse {
939 fn typename() -> &'static str {
940 "type.googleapis.com/google.datastore.admin.v1.ListIndexesResponse"
941 }
942}
943
944#[cfg(feature = "unstable-stream")]
945impl gax::paginator::PageableResponse for ListIndexesResponse {
946 type PageItem = crate::model::Index;
947
948 fn items(self) -> std::vec::Vec<Self::PageItem> {
949 self.indexes
950 }
951
952 fn next_page_token(&self) -> std::string::String {
953 gax::paginator::extract_token(&self.next_page_token)
954 }
955}
956
957#[serde_with::serde_as]
959#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
960#[serde(default, rename_all = "camelCase")]
961#[non_exhaustive]
962pub struct IndexOperationMetadata {
963 #[serde(skip_serializing_if = "std::option::Option::is_none")]
965 pub common: std::option::Option<crate::model::CommonMetadata>,
966
967 #[serde(skip_serializing_if = "std::option::Option::is_none")]
969 pub progress_entities: std::option::Option<crate::model::Progress>,
970
971 #[serde(skip_serializing_if = "std::string::String::is_empty")]
973 pub index_id: std::string::String,
974}
975
976impl IndexOperationMetadata {
977 pub fn new() -> Self {
978 std::default::Default::default()
979 }
980
981 pub fn set_common<T: std::convert::Into<std::option::Option<crate::model::CommonMetadata>>>(
983 mut self,
984 v: T,
985 ) -> Self {
986 self.common = v.into();
987 self
988 }
989
990 pub fn set_progress_entities<
992 T: std::convert::Into<std::option::Option<crate::model::Progress>>,
993 >(
994 mut self,
995 v: T,
996 ) -> Self {
997 self.progress_entities = v.into();
998 self
999 }
1000
1001 pub fn set_index_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1003 self.index_id = v.into();
1004 self
1005 }
1006}
1007
1008impl wkt::message::Message for IndexOperationMetadata {
1009 fn typename() -> &'static str {
1010 "type.googleapis.com/google.datastore.admin.v1.IndexOperationMetadata"
1011 }
1012}
1013
1014#[serde_with::serde_as]
1023#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
1024#[serde(default, rename_all = "camelCase")]
1025#[non_exhaustive]
1026pub struct DatastoreFirestoreMigrationMetadata {
1027 pub migration_state: crate::model::MigrationState,
1030
1031 pub migration_step: crate::model::MigrationStep,
1034}
1035
1036impl DatastoreFirestoreMigrationMetadata {
1037 pub fn new() -> Self {
1038 std::default::Default::default()
1039 }
1040
1041 pub fn set_migration_state<T: std::convert::Into<crate::model::MigrationState>>(
1043 mut self,
1044 v: T,
1045 ) -> Self {
1046 self.migration_state = v.into();
1047 self
1048 }
1049
1050 pub fn set_migration_step<T: std::convert::Into<crate::model::MigrationStep>>(
1052 mut self,
1053 v: T,
1054 ) -> Self {
1055 self.migration_step = v.into();
1056 self
1057 }
1058}
1059
1060impl wkt::message::Message for DatastoreFirestoreMigrationMetadata {
1061 fn typename() -> &'static str {
1062 "type.googleapis.com/google.datastore.admin.v1.DatastoreFirestoreMigrationMetadata"
1063 }
1064}
1065
1066#[serde_with::serde_as]
1068#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
1069#[serde(default, rename_all = "camelCase")]
1070#[non_exhaustive]
1071pub struct Index {
1072 #[serde(skip_serializing_if = "std::string::String::is_empty")]
1074 pub project_id: std::string::String,
1075
1076 #[serde(skip_serializing_if = "std::string::String::is_empty")]
1078 pub index_id: std::string::String,
1079
1080 #[serde(skip_serializing_if = "std::string::String::is_empty")]
1082 pub kind: std::string::String,
1083
1084 pub ancestor: crate::model::index::AncestorMode,
1087
1088 #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
1094 pub properties: std::vec::Vec<crate::model::index::IndexedProperty>,
1095
1096 pub state: crate::model::index::State,
1098}
1099
1100impl Index {
1101 pub fn new() -> Self {
1102 std::default::Default::default()
1103 }
1104
1105 pub fn set_project_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1107 self.project_id = v.into();
1108 self
1109 }
1110
1111 pub fn set_index_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1113 self.index_id = v.into();
1114 self
1115 }
1116
1117 pub fn set_kind<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1119 self.kind = v.into();
1120 self
1121 }
1122
1123 pub fn set_ancestor<T: std::convert::Into<crate::model::index::AncestorMode>>(
1125 mut self,
1126 v: T,
1127 ) -> Self {
1128 self.ancestor = v.into();
1129 self
1130 }
1131
1132 pub fn set_state<T: std::convert::Into<crate::model::index::State>>(mut self, v: T) -> Self {
1134 self.state = v.into();
1135 self
1136 }
1137
1138 pub fn set_properties<T, V>(mut self, v: T) -> Self
1140 where
1141 T: std::iter::IntoIterator<Item = V>,
1142 V: std::convert::Into<crate::model::index::IndexedProperty>,
1143 {
1144 use std::iter::Iterator;
1145 self.properties = v.into_iter().map(|i| i.into()).collect();
1146 self
1147 }
1148}
1149
1150impl wkt::message::Message for Index {
1151 fn typename() -> &'static str {
1152 "type.googleapis.com/google.datastore.admin.v1.Index"
1153 }
1154}
1155
1156pub mod index {
1158 #[allow(unused_imports)]
1159 use super::*;
1160
1161 #[serde_with::serde_as]
1163 #[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
1164 #[serde(default, rename_all = "camelCase")]
1165 #[non_exhaustive]
1166 pub struct IndexedProperty {
1167 #[serde(skip_serializing_if = "std::string::String::is_empty")]
1169 pub name: std::string::String,
1170
1171 pub direction: crate::model::index::Direction,
1174 }
1175
1176 impl IndexedProperty {
1177 pub fn new() -> Self {
1178 std::default::Default::default()
1179 }
1180
1181 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1183 self.name = v.into();
1184 self
1185 }
1186
1187 pub fn set_direction<T: std::convert::Into<crate::model::index::Direction>>(
1189 mut self,
1190 v: T,
1191 ) -> Self {
1192 self.direction = v.into();
1193 self
1194 }
1195 }
1196
1197 impl wkt::message::Message for IndexedProperty {
1198 fn typename() -> &'static str {
1199 "type.googleapis.com/google.datastore.admin.v1.Index.IndexedProperty"
1200 }
1201 }
1202
1203 #[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
1206 pub struct AncestorMode(std::borrow::Cow<'static, str>);
1207
1208 impl AncestorMode {
1209 pub const fn new(v: &'static str) -> Self {
1211 Self(std::borrow::Cow::Borrowed(v))
1212 }
1213
1214 pub fn value(&self) -> &str {
1216 &self.0
1217 }
1218 }
1219
1220 pub mod ancestor_mode {
1222 use super::AncestorMode;
1223
1224 pub const ANCESTOR_MODE_UNSPECIFIED: AncestorMode =
1226 AncestorMode::new("ANCESTOR_MODE_UNSPECIFIED");
1227
1228 pub const NONE: AncestorMode = AncestorMode::new("NONE");
1230
1231 pub const ALL_ANCESTORS: AncestorMode = AncestorMode::new("ALL_ANCESTORS");
1233 }
1234
1235 impl std::convert::From<std::string::String> for AncestorMode {
1236 fn from(value: std::string::String) -> Self {
1237 Self(std::borrow::Cow::Owned(value))
1238 }
1239 }
1240
1241 #[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
1243 pub struct Direction(std::borrow::Cow<'static, str>);
1244
1245 impl Direction {
1246 pub const fn new(v: &'static str) -> Self {
1248 Self(std::borrow::Cow::Borrowed(v))
1249 }
1250
1251 pub fn value(&self) -> &str {
1253 &self.0
1254 }
1255 }
1256
1257 pub mod direction {
1259 use super::Direction;
1260
1261 pub const DIRECTION_UNSPECIFIED: Direction = Direction::new("DIRECTION_UNSPECIFIED");
1263
1264 pub const ASCENDING: Direction = Direction::new("ASCENDING");
1267
1268 pub const DESCENDING: Direction = Direction::new("DESCENDING");
1271 }
1272
1273 impl std::convert::From<std::string::String> for Direction {
1274 fn from(value: std::string::String) -> Self {
1275 Self(std::borrow::Cow::Owned(value))
1276 }
1277 }
1278
1279 #[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
1281 pub struct State(std::borrow::Cow<'static, str>);
1282
1283 impl State {
1284 pub const fn new(v: &'static str) -> Self {
1286 Self(std::borrow::Cow::Borrowed(v))
1287 }
1288
1289 pub fn value(&self) -> &str {
1291 &self.0
1292 }
1293 }
1294
1295 pub mod state {
1297 use super::State;
1298
1299 pub const STATE_UNSPECIFIED: State = State::new("STATE_UNSPECIFIED");
1301
1302 pub const CREATING: State = State::new("CREATING");
1307
1308 pub const READY: State = State::new("READY");
1312
1313 pub const DELETING: State = State::new("DELETING");
1318
1319 pub const ERROR: State = State::new("ERROR");
1326 }
1327
1328 impl std::convert::From<std::string::String> for State {
1329 fn from(value: std::string::String) -> Self {
1330 Self(std::borrow::Cow::Owned(value))
1331 }
1332 }
1333}
1334
1335#[serde_with::serde_as]
1339#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
1340#[serde(default, rename_all = "camelCase")]
1341#[non_exhaustive]
1342pub struct MigrationStateEvent {
1343 pub state: crate::model::MigrationState,
1345}
1346
1347impl MigrationStateEvent {
1348 pub fn new() -> Self {
1349 std::default::Default::default()
1350 }
1351
1352 pub fn set_state<T: std::convert::Into<crate::model::MigrationState>>(mut self, v: T) -> Self {
1354 self.state = v.into();
1355 self
1356 }
1357}
1358
1359impl wkt::message::Message for MigrationStateEvent {
1360 fn typename() -> &'static str {
1361 "type.googleapis.com/google.datastore.admin.v1.MigrationStateEvent"
1362 }
1363}
1364
1365#[serde_with::serde_as]
1369#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
1370#[serde(default, rename_all = "camelCase")]
1371#[non_exhaustive]
1372pub struct MigrationProgressEvent {
1373 pub step: crate::model::MigrationStep,
1378
1379 #[serde(flatten, skip_serializing_if = "std::option::Option::is_none")]
1381 pub step_details: std::option::Option<crate::model::migration_progress_event::StepDetails>,
1382}
1383
1384impl MigrationProgressEvent {
1385 pub fn new() -> Self {
1386 std::default::Default::default()
1387 }
1388
1389 pub fn set_step<T: std::convert::Into<crate::model::MigrationStep>>(mut self, v: T) -> Self {
1391 self.step = v.into();
1392 self
1393 }
1394
1395 pub fn set_step_details<
1397 T: std::convert::Into<
1398 std::option::Option<crate::model::migration_progress_event::StepDetails>,
1399 >,
1400 >(
1401 mut self,
1402 v: T,
1403 ) -> Self {
1404 self.step_details = v.into();
1405 self
1406 }
1407
1408 pub fn get_prepare_step_details(
1412 &self,
1413 ) -> std::option::Option<
1414 &std::boxed::Box<crate::model::migration_progress_event::PrepareStepDetails>,
1415 > {
1416 #[allow(unreachable_patterns)]
1417 self.step_details.as_ref().and_then(|v| match v {
1418 crate::model::migration_progress_event::StepDetails::PrepareStepDetails(v) => {
1419 std::option::Option::Some(v)
1420 }
1421 _ => std::option::Option::None,
1422 })
1423 }
1424
1425 pub fn get_redirect_writes_step_details(
1429 &self,
1430 ) -> std::option::Option<
1431 &std::boxed::Box<crate::model::migration_progress_event::RedirectWritesStepDetails>,
1432 > {
1433 #[allow(unreachable_patterns)]
1434 self.step_details.as_ref().and_then(|v| match v {
1435 crate::model::migration_progress_event::StepDetails::RedirectWritesStepDetails(v) => {
1436 std::option::Option::Some(v)
1437 }
1438 _ => std::option::Option::None,
1439 })
1440 }
1441
1442 pub fn set_prepare_step_details<
1448 T: std::convert::Into<
1449 std::boxed::Box<crate::model::migration_progress_event::PrepareStepDetails>,
1450 >,
1451 >(
1452 mut self,
1453 v: T,
1454 ) -> Self {
1455 self.step_details = std::option::Option::Some(
1456 crate::model::migration_progress_event::StepDetails::PrepareStepDetails(v.into()),
1457 );
1458 self
1459 }
1460
1461 pub fn set_redirect_writes_step_details<
1467 T: std::convert::Into<
1468 std::boxed::Box<crate::model::migration_progress_event::RedirectWritesStepDetails>,
1469 >,
1470 >(
1471 mut self,
1472 v: T,
1473 ) -> Self {
1474 self.step_details = std::option::Option::Some(
1475 crate::model::migration_progress_event::StepDetails::RedirectWritesStepDetails(
1476 v.into(),
1477 ),
1478 );
1479 self
1480 }
1481}
1482
1483impl wkt::message::Message for MigrationProgressEvent {
1484 fn typename() -> &'static str {
1485 "type.googleapis.com/google.datastore.admin.v1.MigrationProgressEvent"
1486 }
1487}
1488
1489pub mod migration_progress_event {
1491 #[allow(unused_imports)]
1492 use super::*;
1493
1494 #[serde_with::serde_as]
1496 #[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
1497 #[serde(default, rename_all = "camelCase")]
1498 #[non_exhaustive]
1499 pub struct PrepareStepDetails {
1500 pub concurrency_mode: crate::model::migration_progress_event::ConcurrencyMode,
1503 }
1504
1505 impl PrepareStepDetails {
1506 pub fn new() -> Self {
1507 std::default::Default::default()
1508 }
1509
1510 pub fn set_concurrency_mode<
1512 T: std::convert::Into<crate::model::migration_progress_event::ConcurrencyMode>,
1513 >(
1514 mut self,
1515 v: T,
1516 ) -> Self {
1517 self.concurrency_mode = v.into();
1518 self
1519 }
1520 }
1521
1522 impl wkt::message::Message for PrepareStepDetails {
1523 fn typename() -> &'static str {
1524 "type.googleapis.com/google.datastore.admin.v1.MigrationProgressEvent.PrepareStepDetails"
1525 }
1526 }
1527
1528 #[serde_with::serde_as]
1530 #[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
1531 #[serde(default, rename_all = "camelCase")]
1532 #[non_exhaustive]
1533 pub struct RedirectWritesStepDetails {
1534 pub concurrency_mode: crate::model::migration_progress_event::ConcurrencyMode,
1536 }
1537
1538 impl RedirectWritesStepDetails {
1539 pub fn new() -> Self {
1540 std::default::Default::default()
1541 }
1542
1543 pub fn set_concurrency_mode<
1545 T: std::convert::Into<crate::model::migration_progress_event::ConcurrencyMode>,
1546 >(
1547 mut self,
1548 v: T,
1549 ) -> Self {
1550 self.concurrency_mode = v.into();
1551 self
1552 }
1553 }
1554
1555 impl wkt::message::Message for RedirectWritesStepDetails {
1556 fn typename() -> &'static str {
1557 "type.googleapis.com/google.datastore.admin.v1.MigrationProgressEvent.RedirectWritesStepDetails"
1558 }
1559 }
1560
1561 #[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
1563 pub struct ConcurrencyMode(std::borrow::Cow<'static, str>);
1564
1565 impl ConcurrencyMode {
1566 pub const fn new(v: &'static str) -> Self {
1568 Self(std::borrow::Cow::Borrowed(v))
1569 }
1570
1571 pub fn value(&self) -> &str {
1573 &self.0
1574 }
1575 }
1576
1577 pub mod concurrency_mode {
1579 use super::ConcurrencyMode;
1580
1581 pub const CONCURRENCY_MODE_UNSPECIFIED: ConcurrencyMode =
1583 ConcurrencyMode::new("CONCURRENCY_MODE_UNSPECIFIED");
1584
1585 pub const PESSIMISTIC: ConcurrencyMode = ConcurrencyMode::new("PESSIMISTIC");
1587
1588 pub const OPTIMISTIC: ConcurrencyMode = ConcurrencyMode::new("OPTIMISTIC");
1590
1591 pub const OPTIMISTIC_WITH_ENTITY_GROUPS: ConcurrencyMode =
1593 ConcurrencyMode::new("OPTIMISTIC_WITH_ENTITY_GROUPS");
1594 }
1595
1596 impl std::convert::From<std::string::String> for ConcurrencyMode {
1597 fn from(value: std::string::String) -> Self {
1598 Self(std::borrow::Cow::Owned(value))
1599 }
1600 }
1601
1602 #[derive(Clone, Debug, PartialEq, serde::Deserialize, serde::Serialize)]
1604 #[serde(rename_all = "camelCase")]
1605 #[non_exhaustive]
1606 pub enum StepDetails {
1607 PrepareStepDetails(
1609 std::boxed::Box<crate::model::migration_progress_event::PrepareStepDetails>,
1610 ),
1611 RedirectWritesStepDetails(
1613 std::boxed::Box<crate::model::migration_progress_event::RedirectWritesStepDetails>,
1614 ),
1615 }
1616}
1617
1618#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
1620pub struct OperationType(std::borrow::Cow<'static, str>);
1621
1622impl OperationType {
1623 pub const fn new(v: &'static str) -> Self {
1625 Self(std::borrow::Cow::Borrowed(v))
1626 }
1627
1628 pub fn value(&self) -> &str {
1630 &self.0
1631 }
1632}
1633
1634pub mod operation_type {
1636 use super::OperationType;
1637
1638 pub const OPERATION_TYPE_UNSPECIFIED: OperationType =
1640 OperationType::new("OPERATION_TYPE_UNSPECIFIED");
1641
1642 pub const EXPORT_ENTITIES: OperationType = OperationType::new("EXPORT_ENTITIES");
1644
1645 pub const IMPORT_ENTITIES: OperationType = OperationType::new("IMPORT_ENTITIES");
1647
1648 pub const CREATE_INDEX: OperationType = OperationType::new("CREATE_INDEX");
1650
1651 pub const DELETE_INDEX: OperationType = OperationType::new("DELETE_INDEX");
1653}
1654
1655impl std::convert::From<std::string::String> for OperationType {
1656 fn from(value: std::string::String) -> Self {
1657 Self(std::borrow::Cow::Owned(value))
1658 }
1659}
1660
1661#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
1663pub struct MigrationState(std::borrow::Cow<'static, str>);
1664
1665impl MigrationState {
1666 pub const fn new(v: &'static str) -> Self {
1668 Self(std::borrow::Cow::Borrowed(v))
1669 }
1670
1671 pub fn value(&self) -> &str {
1673 &self.0
1674 }
1675}
1676
1677pub mod migration_state {
1679 use super::MigrationState;
1680
1681 pub const MIGRATION_STATE_UNSPECIFIED: MigrationState =
1683 MigrationState::new("MIGRATION_STATE_UNSPECIFIED");
1684
1685 pub const RUNNING: MigrationState = MigrationState::new("RUNNING");
1687
1688 pub const PAUSED: MigrationState = MigrationState::new("PAUSED");
1690
1691 pub const COMPLETE: MigrationState = MigrationState::new("COMPLETE");
1693}
1694
1695impl std::convert::From<std::string::String> for MigrationState {
1696 fn from(value: std::string::String) -> Self {
1697 Self(std::borrow::Cow::Owned(value))
1698 }
1699}
1700
1701#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
1703pub struct MigrationStep(std::borrow::Cow<'static, str>);
1704
1705impl MigrationStep {
1706 pub const fn new(v: &'static str) -> Self {
1708 Self(std::borrow::Cow::Borrowed(v))
1709 }
1710
1711 pub fn value(&self) -> &str {
1713 &self.0
1714 }
1715}
1716
1717pub mod migration_step {
1719 use super::MigrationStep;
1720
1721 pub const MIGRATION_STEP_UNSPECIFIED: MigrationStep =
1723 MigrationStep::new("MIGRATION_STEP_UNSPECIFIED");
1724
1725 pub const PREPARE: MigrationStep = MigrationStep::new("PREPARE");
1727
1728 pub const START: MigrationStep = MigrationStep::new("START");
1730
1731 pub const APPLY_WRITES_SYNCHRONOUSLY: MigrationStep =
1733 MigrationStep::new("APPLY_WRITES_SYNCHRONOUSLY");
1734
1735 pub const COPY_AND_VERIFY: MigrationStep = MigrationStep::new("COPY_AND_VERIFY");
1738
1739 pub const REDIRECT_EVENTUALLY_CONSISTENT_READS: MigrationStep =
1741 MigrationStep::new("REDIRECT_EVENTUALLY_CONSISTENT_READS");
1742
1743 pub const REDIRECT_STRONGLY_CONSISTENT_READS: MigrationStep =
1745 MigrationStep::new("REDIRECT_STRONGLY_CONSISTENT_READS");
1746
1747 pub const REDIRECT_WRITES: MigrationStep = MigrationStep::new("REDIRECT_WRITES");
1749}
1750
1751impl std::convert::From<std::string::String> for MigrationStep {
1752 fn from(value: std::string::String) -> Self {
1753 Self(std::borrow::Cow::Owned(value))
1754 }
1755}