1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 972 973 974 975 976 977 978 979 980 981 982 983 984 985 986 987 988 989 990 991 992 993 994 995 996 997 998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 1022 1023 1024 1025 1026 1027 1028 1029 1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 1040 1041 1042 1043 1044 1045 1046 1047 1048 1049 1050 1051 1052 1053 1054 1055 1056 1057 1058 1059 1060 1061 1062 1063 1064 1065 1066 1067 1068 1069 1070 1071 1072 1073 1074 1075 1076 1077 1078 1079 1080 1081 1082 1083 1084 1085 1086 1087 1088 1089 1090 1091 1092 1093 1094 1095 1096 1097 1098 1099 1100 1101 1102 1103 1104 1105 1106 1107 1108 1109 1110 1111 1112 1113 1114 1115 1116 1117 1118 1119 1120 1121 1122 1123 1124 1125 1126 1127 1128 1129 1130 1131 1132 1133 1134 1135 1136 1137 1138 1139
// This file is @generated by prost-build.
/// Datastore composite index definition.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Index {
/// Output only. Project ID.
#[prost(string, tag = "1")]
pub project_id: ::prost::alloc::string::String,
/// Output only. The resource ID of the index.
#[prost(string, tag = "3")]
pub index_id: ::prost::alloc::string::String,
/// Required. The entity kind to which this index applies.
#[prost(string, tag = "4")]
pub kind: ::prost::alloc::string::String,
/// Required. The index's ancestor mode. Must not be
/// ANCESTOR_MODE_UNSPECIFIED.
#[prost(enumeration = "index::AncestorMode", tag = "5")]
pub ancestor: i32,
/// Required. An ordered sequence of property names and their index attributes.
///
/// Requires:
///
/// * A maximum of 100 properties.
#[prost(message, repeated, tag = "6")]
pub properties: ::prost::alloc::vec::Vec<index::IndexedProperty>,
/// Output only. The state of the index.
#[prost(enumeration = "index::State", tag = "7")]
pub state: i32,
}
/// Nested message and enum types in `Index`.
pub mod index {
/// A property of an index.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct IndexedProperty {
/// Required. The property name to index.
#[prost(string, tag = "1")]
pub name: ::prost::alloc::string::String,
/// Required. The indexed property's direction. Must not be
/// DIRECTION_UNSPECIFIED.
#[prost(enumeration = "Direction", tag = "2")]
pub direction: i32,
}
/// For an ordered index, specifies whether each of the entity's ancestors
/// will be included.
#[derive(
Clone,
Copy,
Debug,
PartialEq,
Eq,
Hash,
PartialOrd,
Ord,
::prost::Enumeration
)]
#[repr(i32)]
pub enum AncestorMode {
/// The ancestor mode is unspecified.
Unspecified = 0,
/// Do not include the entity's ancestors in the index.
None = 1,
/// Include all the entity's ancestors in the index.
AllAncestors = 2,
}
impl AncestorMode {
/// String value of the enum field names used in the ProtoBuf definition.
///
/// The values are not transformed in any way and thus are considered stable
/// (if the ProtoBuf definition does not change) and safe for programmatic use.
pub fn as_str_name(&self) -> &'static str {
match self {
AncestorMode::Unspecified => "ANCESTOR_MODE_UNSPECIFIED",
AncestorMode::None => "NONE",
AncestorMode::AllAncestors => "ALL_ANCESTORS",
}
}
/// Creates an enum from field names used in the ProtoBuf definition.
pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
match value {
"ANCESTOR_MODE_UNSPECIFIED" => Some(Self::Unspecified),
"NONE" => Some(Self::None),
"ALL_ANCESTORS" => Some(Self::AllAncestors),
_ => None,
}
}
}
/// The direction determines how a property is indexed.
#[derive(
Clone,
Copy,
Debug,
PartialEq,
Eq,
Hash,
PartialOrd,
Ord,
::prost::Enumeration
)]
#[repr(i32)]
pub enum Direction {
/// The direction is unspecified.
Unspecified = 0,
/// The property's values are indexed so as to support sequencing in
/// ascending order and also query by <, >, <=, >=, and =.
Ascending = 1,
/// The property's values are indexed so as to support sequencing in
/// descending order and also query by <, >, <=, >=, and =.
Descending = 2,
}
impl Direction {
/// String value of the enum field names used in the ProtoBuf definition.
///
/// The values are not transformed in any way and thus are considered stable
/// (if the ProtoBuf definition does not change) and safe for programmatic use.
pub fn as_str_name(&self) -> &'static str {
match self {
Direction::Unspecified => "DIRECTION_UNSPECIFIED",
Direction::Ascending => "ASCENDING",
Direction::Descending => "DESCENDING",
}
}
/// Creates an enum from field names used in the ProtoBuf definition.
pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
match value {
"DIRECTION_UNSPECIFIED" => Some(Self::Unspecified),
"ASCENDING" => Some(Self::Ascending),
"DESCENDING" => Some(Self::Descending),
_ => None,
}
}
}
/// The possible set of states of an index.
#[derive(
Clone,
Copy,
Debug,
PartialEq,
Eq,
Hash,
PartialOrd,
Ord,
::prost::Enumeration
)]
#[repr(i32)]
pub enum State {
/// The state is unspecified.
Unspecified = 0,
/// The index is being created, and cannot be used by queries.
/// There is an active long-running operation for the index.
/// The index is updated when writing an entity.
/// Some index data may exist.
Creating = 1,
/// The index is ready to be used.
/// The index is updated when writing an entity.
/// The index is fully populated from all stored entities it applies to.
Ready = 2,
/// The index is being deleted, and cannot be used by queries.
/// There is an active long-running operation for the index.
/// The index is not updated when writing an entity.
/// Some index data may exist.
Deleting = 3,
/// The index was being created or deleted, but something went wrong.
/// The index cannot by used by queries.
/// There is no active long-running operation for the index,
/// and the most recently finished long-running operation failed.
/// The index is not updated when writing an entity.
/// Some index data may exist.
Error = 4,
}
impl State {
/// String value of the enum field names used in the ProtoBuf definition.
///
/// The values are not transformed in any way and thus are considered stable
/// (if the ProtoBuf definition does not change) and safe for programmatic use.
pub fn as_str_name(&self) -> &'static str {
match self {
State::Unspecified => "STATE_UNSPECIFIED",
State::Creating => "CREATING",
State::Ready => "READY",
State::Deleting => "DELETING",
State::Error => "ERROR",
}
}
/// Creates an enum from field names used in the ProtoBuf definition.
pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
match value {
"STATE_UNSPECIFIED" => Some(Self::Unspecified),
"CREATING" => Some(Self::Creating),
"READY" => Some(Self::Ready),
"DELETING" => Some(Self::Deleting),
"ERROR" => Some(Self::Error),
_ => None,
}
}
}
}
/// An event signifying a change in state of a [migration from Cloud Datastore to
/// Cloud Firestore in Datastore
/// mode](<https://cloud.google.com/datastore/docs/upgrade-to-firestore>).
#[derive(Clone, Copy, PartialEq, ::prost::Message)]
pub struct MigrationStateEvent {
/// The new state of the migration.
#[prost(enumeration = "MigrationState", tag = "1")]
pub state: i32,
}
/// An event signifying the start of a new step in a [migration from Cloud
/// Datastore to Cloud Firestore in Datastore
/// mode](<https://cloud.google.com/datastore/docs/upgrade-to-firestore>).
#[derive(Clone, Copy, PartialEq, ::prost::Message)]
pub struct MigrationProgressEvent {
/// The step that is starting.
///
/// An event with step set to `START` indicates that the migration
/// has been reverted back to the initial pre-migration state.
#[prost(enumeration = "MigrationStep", tag = "1")]
pub step: i32,
/// Details about this step.
#[prost(oneof = "migration_progress_event::StepDetails", tags = "2, 3")]
pub step_details: ::core::option::Option<migration_progress_event::StepDetails>,
}
/// Nested message and enum types in `MigrationProgressEvent`.
pub mod migration_progress_event {
/// Details for the `PREPARE` step.
#[derive(Clone, Copy, PartialEq, ::prost::Message)]
pub struct PrepareStepDetails {
/// The concurrency mode this database will use when it reaches the
/// `REDIRECT_WRITES` step.
#[prost(enumeration = "ConcurrencyMode", tag = "1")]
pub concurrency_mode: i32,
}
/// Details for the `REDIRECT_WRITES` step.
#[derive(Clone, Copy, PartialEq, ::prost::Message)]
pub struct RedirectWritesStepDetails {
/// Ths concurrency mode for this database.
#[prost(enumeration = "ConcurrencyMode", tag = "1")]
pub concurrency_mode: i32,
}
/// Concurrency modes for transactions in Cloud Firestore.
#[derive(
Clone,
Copy,
Debug,
PartialEq,
Eq,
Hash,
PartialOrd,
Ord,
::prost::Enumeration
)]
#[repr(i32)]
pub enum ConcurrencyMode {
/// Unspecified.
Unspecified = 0,
/// Pessimistic concurrency.
Pessimistic = 1,
/// Optimistic concurrency.
Optimistic = 2,
/// Optimistic concurrency with entity groups.
OptimisticWithEntityGroups = 3,
}
impl ConcurrencyMode {
/// String value of the enum field names used in the ProtoBuf definition.
///
/// The values are not transformed in any way and thus are considered stable
/// (if the ProtoBuf definition does not change) and safe for programmatic use.
pub fn as_str_name(&self) -> &'static str {
match self {
ConcurrencyMode::Unspecified => "CONCURRENCY_MODE_UNSPECIFIED",
ConcurrencyMode::Pessimistic => "PESSIMISTIC",
ConcurrencyMode::Optimistic => "OPTIMISTIC",
ConcurrencyMode::OptimisticWithEntityGroups => {
"OPTIMISTIC_WITH_ENTITY_GROUPS"
}
}
}
/// Creates an enum from field names used in the ProtoBuf definition.
pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
match value {
"CONCURRENCY_MODE_UNSPECIFIED" => Some(Self::Unspecified),
"PESSIMISTIC" => Some(Self::Pessimistic),
"OPTIMISTIC" => Some(Self::Optimistic),
"OPTIMISTIC_WITH_ENTITY_GROUPS" => Some(Self::OptimisticWithEntityGroups),
_ => None,
}
}
}
/// Details about this step.
#[derive(Clone, Copy, PartialEq, ::prost::Oneof)]
pub enum StepDetails {
/// Details for the `PREPARE` step.
#[prost(message, tag = "2")]
PrepareStepDetails(PrepareStepDetails),
/// Details for the `REDIRECT_WRITES` step.
#[prost(message, tag = "3")]
RedirectWritesStepDetails(RedirectWritesStepDetails),
}
}
/// States for a migration.
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum MigrationState {
/// Unspecified.
Unspecified = 0,
/// The migration is running.
Running = 1,
/// The migration is paused.
Paused = 2,
/// The migration is complete.
Complete = 3,
}
impl MigrationState {
/// String value of the enum field names used in the ProtoBuf definition.
///
/// The values are not transformed in any way and thus are considered stable
/// (if the ProtoBuf definition does not change) and safe for programmatic use.
pub fn as_str_name(&self) -> &'static str {
match self {
MigrationState::Unspecified => "MIGRATION_STATE_UNSPECIFIED",
MigrationState::Running => "RUNNING",
MigrationState::Paused => "PAUSED",
MigrationState::Complete => "COMPLETE",
}
}
/// Creates an enum from field names used in the ProtoBuf definition.
pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
match value {
"MIGRATION_STATE_UNSPECIFIED" => Some(Self::Unspecified),
"RUNNING" => Some(Self::Running),
"PAUSED" => Some(Self::Paused),
"COMPLETE" => Some(Self::Complete),
_ => None,
}
}
}
/// Steps in a migration.
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum MigrationStep {
/// Unspecified.
Unspecified = 0,
/// Pre-migration: the database is prepared for migration.
Prepare = 6,
/// Start of migration.
Start = 1,
/// Writes are applied synchronously to at least one replica.
ApplyWritesSynchronously = 7,
/// Data is copied to Cloud Firestore and then verified to match the data in
/// Cloud Datastore.
CopyAndVerify = 2,
/// Eventually-consistent reads are redirected to Cloud Firestore.
RedirectEventuallyConsistentReads = 3,
/// Strongly-consistent reads are redirected to Cloud Firestore.
RedirectStronglyConsistentReads = 4,
/// Writes are redirected to Cloud Firestore.
RedirectWrites = 5,
}
impl MigrationStep {
/// String value of the enum field names used in the ProtoBuf definition.
///
/// The values are not transformed in any way and thus are considered stable
/// (if the ProtoBuf definition does not change) and safe for programmatic use.
pub fn as_str_name(&self) -> &'static str {
match self {
MigrationStep::Unspecified => "MIGRATION_STEP_UNSPECIFIED",
MigrationStep::Prepare => "PREPARE",
MigrationStep::Start => "START",
MigrationStep::ApplyWritesSynchronously => "APPLY_WRITES_SYNCHRONOUSLY",
MigrationStep::CopyAndVerify => "COPY_AND_VERIFY",
MigrationStep::RedirectEventuallyConsistentReads => {
"REDIRECT_EVENTUALLY_CONSISTENT_READS"
}
MigrationStep::RedirectStronglyConsistentReads => {
"REDIRECT_STRONGLY_CONSISTENT_READS"
}
MigrationStep::RedirectWrites => "REDIRECT_WRITES",
}
}
/// Creates an enum from field names used in the ProtoBuf definition.
pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
match value {
"MIGRATION_STEP_UNSPECIFIED" => Some(Self::Unspecified),
"PREPARE" => Some(Self::Prepare),
"START" => Some(Self::Start),
"APPLY_WRITES_SYNCHRONOUSLY" => Some(Self::ApplyWritesSynchronously),
"COPY_AND_VERIFY" => Some(Self::CopyAndVerify),
"REDIRECT_EVENTUALLY_CONSISTENT_READS" => {
Some(Self::RedirectEventuallyConsistentReads)
}
"REDIRECT_STRONGLY_CONSISTENT_READS" => {
Some(Self::RedirectStronglyConsistentReads)
}
"REDIRECT_WRITES" => Some(Self::RedirectWrites),
_ => None,
}
}
}
/// Metadata common to all Datastore Admin operations.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct CommonMetadata {
/// The time that work began on the operation.
#[prost(message, optional, tag = "1")]
pub start_time: ::core::option::Option<::prost_types::Timestamp>,
/// The time the operation ended, either successfully or otherwise.
#[prost(message, optional, tag = "2")]
pub end_time: ::core::option::Option<::prost_types::Timestamp>,
/// The type of the operation. Can be used as a filter in
/// ListOperationsRequest.
#[prost(enumeration = "OperationType", tag = "3")]
pub operation_type: i32,
/// The client-assigned labels which were provided when the operation was
/// created. May also include additional labels.
#[prost(btree_map = "string, string", tag = "4")]
pub labels: ::prost::alloc::collections::BTreeMap<
::prost::alloc::string::String,
::prost::alloc::string::String,
>,
/// The current state of the Operation.
#[prost(enumeration = "common_metadata::State", tag = "5")]
pub state: i32,
}
/// Nested message and enum types in `CommonMetadata`.
pub mod common_metadata {
/// The various possible states for an ongoing Operation.
#[derive(
Clone,
Copy,
Debug,
PartialEq,
Eq,
Hash,
PartialOrd,
Ord,
::prost::Enumeration
)]
#[repr(i32)]
pub enum State {
/// Unspecified.
Unspecified = 0,
/// Request is being prepared for processing.
Initializing = 1,
/// Request is actively being processed.
Processing = 2,
/// Request is in the process of being cancelled after user called
/// google.longrunning.Operations.CancelOperation on the operation.
Cancelling = 3,
/// Request has been processed and is in its finalization stage.
Finalizing = 4,
/// Request has completed successfully.
Successful = 5,
/// Request has finished being processed, but encountered an error.
Failed = 6,
/// Request has finished being cancelled after user called
/// google.longrunning.Operations.CancelOperation.
Cancelled = 7,
}
impl State {
/// String value of the enum field names used in the ProtoBuf definition.
///
/// The values are not transformed in any way and thus are considered stable
/// (if the ProtoBuf definition does not change) and safe for programmatic use.
pub fn as_str_name(&self) -> &'static str {
match self {
State::Unspecified => "STATE_UNSPECIFIED",
State::Initializing => "INITIALIZING",
State::Processing => "PROCESSING",
State::Cancelling => "CANCELLING",
State::Finalizing => "FINALIZING",
State::Successful => "SUCCESSFUL",
State::Failed => "FAILED",
State::Cancelled => "CANCELLED",
}
}
/// Creates an enum from field names used in the ProtoBuf definition.
pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
match value {
"STATE_UNSPECIFIED" => Some(Self::Unspecified),
"INITIALIZING" => Some(Self::Initializing),
"PROCESSING" => Some(Self::Processing),
"CANCELLING" => Some(Self::Cancelling),
"FINALIZING" => Some(Self::Finalizing),
"SUCCESSFUL" => Some(Self::Successful),
"FAILED" => Some(Self::Failed),
"CANCELLED" => Some(Self::Cancelled),
_ => None,
}
}
}
}
/// Measures the progress of a particular metric.
#[derive(Clone, Copy, PartialEq, ::prost::Message)]
pub struct Progress {
/// The amount of work that has been completed. Note that this may be greater
/// than work_estimated.
#[prost(int64, tag = "1")]
pub work_completed: i64,
/// An estimate of how much work needs to be performed. May be zero if the
/// work estimate is unavailable.
#[prost(int64, tag = "2")]
pub work_estimated: i64,
}
/// The request for
/// [google.datastore.admin.v1.DatastoreAdmin.ExportEntities][google.datastore.admin.v1.DatastoreAdmin.ExportEntities].
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ExportEntitiesRequest {
/// Required. Project ID against which to make the request.
#[prost(string, tag = "1")]
pub project_id: ::prost::alloc::string::String,
/// Client-assigned labels.
#[prost(btree_map = "string, string", tag = "2")]
pub labels: ::prost::alloc::collections::BTreeMap<
::prost::alloc::string::String,
::prost::alloc::string::String,
>,
/// Description of what data from the project is included in the export.
#[prost(message, optional, tag = "3")]
pub entity_filter: ::core::option::Option<EntityFilter>,
/// Required. Location for the export metadata and data files.
///
/// The full resource URL of the external storage location. Currently, only
/// Google Cloud Storage is supported. So output_url_prefix should be of the
/// form: `gs://BUCKET_NAME\[/NAMESPACE_PATH\]`, where `BUCKET_NAME` is the
/// name of the Cloud Storage bucket and `NAMESPACE_PATH` is an optional Cloud
/// Storage namespace path (this is not a Cloud Datastore namespace). For more
/// information about Cloud Storage namespace paths, see
/// [Object name
/// considerations](<https://cloud.google.com/storage/docs/naming#object-considerations>).
///
/// The resulting files will be nested deeper than the specified URL prefix.
/// The final output URL will be provided in the
/// [google.datastore.admin.v1.ExportEntitiesResponse.output_url][google.datastore.admin.v1.ExportEntitiesResponse.output_url]
/// field. That value should be used for subsequent ImportEntities operations.
///
/// By nesting the data files deeper, the same Cloud Storage bucket can be used
/// in multiple ExportEntities operations without conflict.
#[prost(string, tag = "4")]
pub output_url_prefix: ::prost::alloc::string::String,
}
/// The request for
/// [google.datastore.admin.v1.DatastoreAdmin.ImportEntities][google.datastore.admin.v1.DatastoreAdmin.ImportEntities].
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ImportEntitiesRequest {
/// Required. Project ID against which to make the request.
#[prost(string, tag = "1")]
pub project_id: ::prost::alloc::string::String,
/// Client-assigned labels.
#[prost(btree_map = "string, string", tag = "2")]
pub labels: ::prost::alloc::collections::BTreeMap<
::prost::alloc::string::String,
::prost::alloc::string::String,
>,
/// Required. The full resource URL of the external storage location.
/// Currently, only Google Cloud Storage is supported. So input_url should be
/// of the form:
/// `gs://BUCKET_NAME\[/NAMESPACE_PATH\]/OVERALL_EXPORT_METADATA_FILE`, where
/// `BUCKET_NAME` is the name of the Cloud Storage bucket, `NAMESPACE_PATH` is
/// an optional Cloud Storage namespace path (this is not a Cloud Datastore
/// namespace), and `OVERALL_EXPORT_METADATA_FILE` is the metadata file written
/// by the ExportEntities operation. For more information about Cloud Storage
/// namespace paths, see
/// [Object name
/// considerations](<https://cloud.google.com/storage/docs/naming#object-considerations>).
///
/// For more information, see
/// [google.datastore.admin.v1.ExportEntitiesResponse.output_url][google.datastore.admin.v1.ExportEntitiesResponse.output_url].
#[prost(string, tag = "3")]
pub input_url: ::prost::alloc::string::String,
/// Optionally specify which kinds/namespaces are to be imported. If provided,
/// the list must be a subset of the EntityFilter used in creating the export,
/// otherwise a FAILED_PRECONDITION error will be returned. If no filter is
/// specified then all entities from the export are imported.
#[prost(message, optional, tag = "4")]
pub entity_filter: ::core::option::Option<EntityFilter>,
}
/// The response for
/// [google.datastore.admin.v1.DatastoreAdmin.ExportEntities][google.datastore.admin.v1.DatastoreAdmin.ExportEntities].
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ExportEntitiesResponse {
/// Location of the output metadata file. This can be used to begin an import
/// into Cloud Datastore (this project or another project). See
/// [google.datastore.admin.v1.ImportEntitiesRequest.input_url][google.datastore.admin.v1.ImportEntitiesRequest.input_url].
/// Only present if the operation completed successfully.
#[prost(string, tag = "1")]
pub output_url: ::prost::alloc::string::String,
}
/// Metadata for ExportEntities operations.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ExportEntitiesMetadata {
/// Metadata common to all Datastore Admin operations.
#[prost(message, optional, tag = "1")]
pub common: ::core::option::Option<CommonMetadata>,
/// An estimate of the number of entities processed.
#[prost(message, optional, tag = "2")]
pub progress_entities: ::core::option::Option<Progress>,
/// An estimate of the number of bytes processed.
#[prost(message, optional, tag = "3")]
pub progress_bytes: ::core::option::Option<Progress>,
/// Description of which entities are being exported.
#[prost(message, optional, tag = "4")]
pub entity_filter: ::core::option::Option<EntityFilter>,
/// Location for the export metadata and data files. This will be the same
/// value as the
/// [google.datastore.admin.v1.ExportEntitiesRequest.output_url_prefix][google.datastore.admin.v1.ExportEntitiesRequest.output_url_prefix]
/// field. The final output location is provided in
/// [google.datastore.admin.v1.ExportEntitiesResponse.output_url][google.datastore.admin.v1.ExportEntitiesResponse.output_url].
#[prost(string, tag = "5")]
pub output_url_prefix: ::prost::alloc::string::String,
}
/// Metadata for ImportEntities operations.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ImportEntitiesMetadata {
/// Metadata common to all Datastore Admin operations.
#[prost(message, optional, tag = "1")]
pub common: ::core::option::Option<CommonMetadata>,
/// An estimate of the number of entities processed.
#[prost(message, optional, tag = "2")]
pub progress_entities: ::core::option::Option<Progress>,
/// An estimate of the number of bytes processed.
#[prost(message, optional, tag = "3")]
pub progress_bytes: ::core::option::Option<Progress>,
/// Description of which entities are being imported.
#[prost(message, optional, tag = "4")]
pub entity_filter: ::core::option::Option<EntityFilter>,
/// The location of the import metadata file. This will be the same value as
/// the
/// [google.datastore.admin.v1.ExportEntitiesResponse.output_url][google.datastore.admin.v1.ExportEntitiesResponse.output_url]
/// field.
#[prost(string, tag = "5")]
pub input_url: ::prost::alloc::string::String,
}
/// Identifies a subset of entities in a project. This is specified as
/// combinations of kinds and namespaces (either or both of which may be all, as
/// described in the following examples).
/// Example usage:
///
/// Entire project:
/// kinds=\[\], namespace_ids=\[\]
///
/// Kinds Foo and Bar in all namespaces:
/// kinds=\['Foo', 'Bar'\], namespace_ids=\[\]
///
/// Kinds Foo and Bar only in the default namespace:
/// kinds=\['Foo', 'Bar'\], namespace_ids=\[''\]
///
/// Kinds Foo and Bar in both the default and Baz namespaces:
/// kinds=\['Foo', 'Bar'\], namespace_ids=\['', 'Baz'\]
///
/// The entire Baz namespace:
/// kinds=\[\], namespace_ids=\['Baz'\]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct EntityFilter {
/// If empty, then this represents all kinds.
#[prost(string, repeated, tag = "1")]
pub kinds: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
/// An empty list represents all namespaces. This is the preferred
/// usage for projects that don't use namespaces.
///
/// An empty string element represents the default namespace. This should be
/// used if the project has data in non-default namespaces, but doesn't want to
/// include them.
/// Each namespace in this list must be unique.
#[prost(string, repeated, tag = "2")]
pub namespace_ids: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
}
/// The request for
/// [google.datastore.admin.v1.DatastoreAdmin.CreateIndex][google.datastore.admin.v1.DatastoreAdmin.CreateIndex].
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct CreateIndexRequest {
/// Project ID against which to make the request.
#[prost(string, tag = "1")]
pub project_id: ::prost::alloc::string::String,
/// The index to create. The name and state fields are output only and will be
/// ignored. Single property indexes cannot be created or deleted.
#[prost(message, optional, tag = "3")]
pub index: ::core::option::Option<Index>,
}
/// The request for
/// [google.datastore.admin.v1.DatastoreAdmin.DeleteIndex][google.datastore.admin.v1.DatastoreAdmin.DeleteIndex].
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct DeleteIndexRequest {
/// Project ID against which to make the request.
#[prost(string, tag = "1")]
pub project_id: ::prost::alloc::string::String,
/// The resource ID of the index to delete.
#[prost(string, tag = "3")]
pub index_id: ::prost::alloc::string::String,
}
/// The request for
/// [google.datastore.admin.v1.DatastoreAdmin.GetIndex][google.datastore.admin.v1.DatastoreAdmin.GetIndex].
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct GetIndexRequest {
/// Project ID against which to make the request.
#[prost(string, tag = "1")]
pub project_id: ::prost::alloc::string::String,
/// The resource ID of the index to get.
#[prost(string, tag = "3")]
pub index_id: ::prost::alloc::string::String,
}
/// The request for
/// [google.datastore.admin.v1.DatastoreAdmin.ListIndexes][google.datastore.admin.v1.DatastoreAdmin.ListIndexes].
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ListIndexesRequest {
/// Project ID against which to make the request.
#[prost(string, tag = "1")]
pub project_id: ::prost::alloc::string::String,
#[prost(string, tag = "3")]
pub filter: ::prost::alloc::string::String,
/// The maximum number of items to return. If zero, then all results will be
/// returned.
#[prost(int32, tag = "4")]
pub page_size: i32,
/// The next_page_token value returned from a previous List request, if any.
#[prost(string, tag = "5")]
pub page_token: ::prost::alloc::string::String,
}
/// The response for
/// [google.datastore.admin.v1.DatastoreAdmin.ListIndexes][google.datastore.admin.v1.DatastoreAdmin.ListIndexes].
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ListIndexesResponse {
/// The indexes.
#[prost(message, repeated, tag = "1")]
pub indexes: ::prost::alloc::vec::Vec<Index>,
/// The standard List next-page token.
#[prost(string, tag = "2")]
pub next_page_token: ::prost::alloc::string::String,
}
/// Metadata for Index operations.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct IndexOperationMetadata {
/// Metadata common to all Datastore Admin operations.
#[prost(message, optional, tag = "1")]
pub common: ::core::option::Option<CommonMetadata>,
/// An estimate of the number of entities processed.
#[prost(message, optional, tag = "2")]
pub progress_entities: ::core::option::Option<Progress>,
/// The index resource ID that this operation is acting on.
#[prost(string, tag = "3")]
pub index_id: ::prost::alloc::string::String,
}
/// Metadata for Datastore to Firestore migration operations.
///
/// The DatastoreFirestoreMigration operation is not started by the end-user via
/// an explicit "creation" method. This is an intentional deviation from the LRO
/// design pattern.
///
/// This singleton resource can be accessed at:
/// "projects/{project_id}/operations/datastore-firestore-migration"
#[derive(Clone, Copy, PartialEq, ::prost::Message)]
pub struct DatastoreFirestoreMigrationMetadata {
/// The current state of migration from Cloud Datastore to Cloud Firestore in
/// Datastore mode.
#[prost(enumeration = "MigrationState", tag = "1")]
pub migration_state: i32,
/// The current step of migration from Cloud Datastore to Cloud Firestore in
/// Datastore mode.
#[prost(enumeration = "MigrationStep", tag = "2")]
pub migration_step: i32,
}
/// Operation types.
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum OperationType {
/// Unspecified.
Unspecified = 0,
/// ExportEntities.
ExportEntities = 1,
/// ImportEntities.
ImportEntities = 2,
/// CreateIndex.
CreateIndex = 3,
/// DeleteIndex.
DeleteIndex = 4,
}
impl OperationType {
/// String value of the enum field names used in the ProtoBuf definition.
///
/// The values are not transformed in any way and thus are considered stable
/// (if the ProtoBuf definition does not change) and safe for programmatic use.
pub fn as_str_name(&self) -> &'static str {
match self {
OperationType::Unspecified => "OPERATION_TYPE_UNSPECIFIED",
OperationType::ExportEntities => "EXPORT_ENTITIES",
OperationType::ImportEntities => "IMPORT_ENTITIES",
OperationType::CreateIndex => "CREATE_INDEX",
OperationType::DeleteIndex => "DELETE_INDEX",
}
}
/// Creates an enum from field names used in the ProtoBuf definition.
pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
match value {
"OPERATION_TYPE_UNSPECIFIED" => Some(Self::Unspecified),
"EXPORT_ENTITIES" => Some(Self::ExportEntities),
"IMPORT_ENTITIES" => Some(Self::ImportEntities),
"CREATE_INDEX" => Some(Self::CreateIndex),
"DELETE_INDEX" => Some(Self::DeleteIndex),
_ => None,
}
}
}
/// Generated client implementations.
pub mod datastore_admin_client {
#![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)]
use tonic::codegen::*;
use tonic::codegen::http::Uri;
/// Google Cloud Datastore Admin API
///
/// The Datastore Admin API provides several admin services for Cloud Datastore.
///
/// Concepts: Project, namespace, kind, and entity as defined in the Google Cloud
/// Datastore API.
///
/// Operation: An Operation represents work being performed in the background.
///
/// EntityFilter: Allows specifying a subset of entities in a project. This is
/// specified as a combination of kinds and namespaces (either or both of which
/// may be all).
///
/// Export/Import Service:
///
/// - The Export/Import service provides the ability to copy all or a subset of
/// entities to/from Google Cloud Storage.
/// - Exported data may be imported into Cloud Datastore for any Google Cloud
/// Platform project. It is not restricted to the export source project. It is
/// possible to export from one project and then import into another.
/// - Exported data can also be loaded into Google BigQuery for analysis.
/// - Exports and imports are performed asynchronously. An Operation resource is
/// created for each export/import. The state (including any errors encountered)
/// of the export/import may be queried via the Operation resource.
///
/// Index Service:
///
/// - The index service manages Cloud Datastore composite indexes.
/// - Index creation and deletion are performed asynchronously.
/// An Operation resource is created for each such asynchronous operation.
/// The state of the operation (including any errors encountered)
/// may be queried via the Operation resource.
///
/// Operation Service:
///
/// - The Operations collection provides a record of actions performed for the
/// specified project (including any operations in progress). Operations are not
/// created directly but through calls on other collections or resources.
/// - An operation that is not yet done may be cancelled. The request to cancel
/// is asynchronous and the operation may continue to run for some time after the
/// request to cancel is made.
/// - An operation that is done may be deleted so that it is no longer listed as
/// part of the Operation collection.
/// - ListOperations returns all pending operations, but not completed
/// operations.
/// - Operations are created by service DatastoreAdmin, but are accessed via
/// service google.longrunning.Operations.
#[derive(Debug, Clone)]
pub struct DatastoreAdminClient<T> {
inner: tonic::client::Grpc<T>,
}
impl<T> DatastoreAdminClient<T>
where
T: tonic::client::GrpcService<tonic::body::BoxBody>,
T::Error: Into<StdError>,
T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
<T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send,
{
pub fn new(inner: T) -> Self {
let inner = tonic::client::Grpc::new(inner);
Self { inner }
}
pub fn with_origin(inner: T, origin: Uri) -> Self {
let inner = tonic::client::Grpc::with_origin(inner, origin);
Self { inner }
}
pub fn with_interceptor<F>(
inner: T,
interceptor: F,
) -> DatastoreAdminClient<InterceptedService<T, F>>
where
F: tonic::service::Interceptor,
T::ResponseBody: Default,
T: tonic::codegen::Service<
http::Request<tonic::body::BoxBody>,
Response = http::Response<
<T as tonic::client::GrpcService<tonic::body::BoxBody>>::ResponseBody,
>,
>,
<T as tonic::codegen::Service<
http::Request<tonic::body::BoxBody>,
>>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
{
DatastoreAdminClient::new(InterceptedService::new(inner, interceptor))
}
/// Compress requests with the given encoding.
///
/// This requires the server to support it otherwise it might respond with an
/// error.
#[must_use]
pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
self.inner = self.inner.send_compressed(encoding);
self
}
/// Enable decompressing responses.
#[must_use]
pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
self.inner = self.inner.accept_compressed(encoding);
self
}
/// Limits the maximum size of a decoded message.
///
/// Default: `4MB`
#[must_use]
pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
self.inner = self.inner.max_decoding_message_size(limit);
self
}
/// Limits the maximum size of an encoded message.
///
/// Default: `usize::MAX`
#[must_use]
pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
self.inner = self.inner.max_encoding_message_size(limit);
self
}
/// Exports a copy of all or a subset of entities from Google Cloud Datastore
/// to another storage system, such as Google Cloud Storage. Recent updates to
/// entities may not be reflected in the export. The export occurs in the
/// background and its progress can be monitored and managed via the
/// Operation resource that is created. The output of an export may only be
/// used once the associated operation is done. If an export operation is
/// cancelled before completion it may leave partial data behind in Google
/// Cloud Storage.
pub async fn export_entities(
&mut self,
request: impl tonic::IntoRequest<super::ExportEntitiesRequest>,
) -> std::result::Result<
tonic::Response<super::super::super::super::longrunning::Operation>,
tonic::Status,
> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::new(
tonic::Code::Unknown,
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/google.datastore.admin.v1.DatastoreAdmin/ExportEntities",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new(
"google.datastore.admin.v1.DatastoreAdmin",
"ExportEntities",
),
);
self.inner.unary(req, path, codec).await
}
/// Imports entities into Google Cloud Datastore. Existing entities with the
/// same key are overwritten. The import occurs in the background and its
/// progress can be monitored and managed via the Operation resource that is
/// created. If an ImportEntities operation is cancelled, it is possible
/// that a subset of the data has already been imported to Cloud Datastore.
pub async fn import_entities(
&mut self,
request: impl tonic::IntoRequest<super::ImportEntitiesRequest>,
) -> std::result::Result<
tonic::Response<super::super::super::super::longrunning::Operation>,
tonic::Status,
> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::new(
tonic::Code::Unknown,
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/google.datastore.admin.v1.DatastoreAdmin/ImportEntities",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new(
"google.datastore.admin.v1.DatastoreAdmin",
"ImportEntities",
),
);
self.inner.unary(req, path, codec).await
}
/// Creates the specified index.
/// A newly created index's initial state is `CREATING`. On completion of the
/// returned [google.longrunning.Operation][google.longrunning.Operation], the
/// state will be `READY`. If the index already exists, the call will return an
/// `ALREADY_EXISTS` status.
///
/// During index creation, the process could result in an error, in which
/// case the index will move to the `ERROR` state. The process can be recovered
/// by fixing the data that caused the error, removing the index with
/// [delete][google.datastore.admin.v1.DatastoreAdmin.DeleteIndex], then
/// re-creating the index with [create]
/// [google.datastore.admin.v1.DatastoreAdmin.CreateIndex].
///
/// Indexes with a single property cannot be created.
pub async fn create_index(
&mut self,
request: impl tonic::IntoRequest<super::CreateIndexRequest>,
) -> std::result::Result<
tonic::Response<super::super::super::super::longrunning::Operation>,
tonic::Status,
> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::new(
tonic::Code::Unknown,
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/google.datastore.admin.v1.DatastoreAdmin/CreateIndex",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new(
"google.datastore.admin.v1.DatastoreAdmin",
"CreateIndex",
),
);
self.inner.unary(req, path, codec).await
}
/// Deletes an existing index.
/// An index can only be deleted if it is in a `READY` or `ERROR` state. On
/// successful execution of the request, the index will be in a `DELETING`
/// [state][google.datastore.admin.v1.Index.State]. And on completion of the
/// returned [google.longrunning.Operation][google.longrunning.Operation], the
/// index will be removed.
///
/// During index deletion, the process could result in an error, in which
/// case the index will move to the `ERROR` state. The process can be recovered
/// by fixing the data that caused the error, followed by calling
/// [delete][google.datastore.admin.v1.DatastoreAdmin.DeleteIndex] again.
pub async fn delete_index(
&mut self,
request: impl tonic::IntoRequest<super::DeleteIndexRequest>,
) -> std::result::Result<
tonic::Response<super::super::super::super::longrunning::Operation>,
tonic::Status,
> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::new(
tonic::Code::Unknown,
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/google.datastore.admin.v1.DatastoreAdmin/DeleteIndex",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new(
"google.datastore.admin.v1.DatastoreAdmin",
"DeleteIndex",
),
);
self.inner.unary(req, path, codec).await
}
/// Gets an index.
pub async fn get_index(
&mut self,
request: impl tonic::IntoRequest<super::GetIndexRequest>,
) -> std::result::Result<tonic::Response<super::Index>, tonic::Status> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::new(
tonic::Code::Unknown,
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/google.datastore.admin.v1.DatastoreAdmin/GetIndex",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new(
"google.datastore.admin.v1.DatastoreAdmin",
"GetIndex",
),
);
self.inner.unary(req, path, codec).await
}
/// Lists the indexes that match the specified filters. Datastore uses an
/// eventually consistent query to fetch the list of indexes and may
/// occasionally return stale results.
pub async fn list_indexes(
&mut self,
request: impl tonic::IntoRequest<super::ListIndexesRequest>,
) -> std::result::Result<
tonic::Response<super::ListIndexesResponse>,
tonic::Status,
> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::new(
tonic::Code::Unknown,
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/google.datastore.admin.v1.DatastoreAdmin/ListIndexes",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new(
"google.datastore.admin.v1.DatastoreAdmin",
"ListIndexes",
),
);
self.inner.unary(req, path, codec).await
}
}
}