index.proto 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116
  1. // Copyright 2021 Google LLC
  2. //
  3. // Licensed under the Apache License, Version 2.0 (the "License");
  4. // you may not use this file except in compliance with the License.
  5. // You may obtain a copy of the License at
  6. //
  7. // http://www.apache.org/licenses/LICENSE-2.0
  8. //
  9. // Unless required by applicable law or agreed to in writing, software
  10. // distributed under the License is distributed on an "AS IS" BASIS,
  11. // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  12. // See the License for the specific language governing permissions and
  13. // limitations under the License.
  14. syntax = "proto3";
  15. package google.datastore.admin.v1;
  16. import "google/api/field_behavior.proto";
  17. import "google/api/annotations.proto";
  18. option csharp_namespace = "Google.Cloud.Datastore.Admin.V1";
  19. option go_package = "google.golang.org/genproto/googleapis/datastore/admin/v1;admin";
  20. option java_multiple_files = true;
  21. option java_outer_classname = "IndexProto";
  22. option java_package = "com.google.datastore.admin.v1";
  23. option php_namespace = "Google\\Cloud\\Datastore\\Admin\\V1";
  24. option ruby_package = "Google::Cloud::Datastore::Admin::V1";
  25. // Datastore composite index definition.
  26. message Index {
  27. // A property of an index.
  28. message IndexedProperty {
  29. // Required. The property name to index.
  30. string name = 1 [(google.api.field_behavior) = REQUIRED];
  31. // Required. The indexed property's direction. Must not be DIRECTION_UNSPECIFIED.
  32. Direction direction = 2 [(google.api.field_behavior) = REQUIRED];
  33. }
  34. // For an ordered index, specifies whether each of the entity's ancestors
  35. // will be included.
  36. enum AncestorMode {
  37. // The ancestor mode is unspecified.
  38. ANCESTOR_MODE_UNSPECIFIED = 0;
  39. // Do not include the entity's ancestors in the index.
  40. NONE = 1;
  41. // Include all the entity's ancestors in the index.
  42. ALL_ANCESTORS = 2;
  43. }
  44. // The direction determines how a property is indexed.
  45. enum Direction {
  46. // The direction is unspecified.
  47. DIRECTION_UNSPECIFIED = 0;
  48. // The property's values are indexed so as to support sequencing in
  49. // ascending order and also query by <, >, <=, >=, and =.
  50. ASCENDING = 1;
  51. // The property's values are indexed so as to support sequencing in
  52. // descending order and also query by <, >, <=, >=, and =.
  53. DESCENDING = 2;
  54. }
  55. // The possible set of states of an index.
  56. enum State {
  57. // The state is unspecified.
  58. STATE_UNSPECIFIED = 0;
  59. // The index is being created, and cannot be used by queries.
  60. // There is an active long-running operation for the index.
  61. // The index is updated when writing an entity.
  62. // Some index data may exist.
  63. CREATING = 1;
  64. // The index is ready to be used.
  65. // The index is updated when writing an entity.
  66. // The index is fully populated from all stored entities it applies to.
  67. READY = 2;
  68. // The index is being deleted, and cannot be used by queries.
  69. // There is an active long-running operation for the index.
  70. // The index is not updated when writing an entity.
  71. // Some index data may exist.
  72. DELETING = 3;
  73. // The index was being created or deleted, but something went wrong.
  74. // The index cannot by used by queries.
  75. // There is no active long-running operation for the index,
  76. // and the most recently finished long-running operation failed.
  77. // The index is not updated when writing an entity.
  78. // Some index data may exist.
  79. ERROR = 4;
  80. }
  81. // Output only. Project ID.
  82. string project_id = 1 [(google.api.field_behavior) = OUTPUT_ONLY];
  83. // Output only. The resource ID of the index.
  84. string index_id = 3 [(google.api.field_behavior) = OUTPUT_ONLY];
  85. // Required. The entity kind to which this index applies.
  86. string kind = 4 [(google.api.field_behavior) = REQUIRED];
  87. // Required. The index's ancestor mode. Must not be ANCESTOR_MODE_UNSPECIFIED.
  88. AncestorMode ancestor = 5 [(google.api.field_behavior) = REQUIRED];
  89. // Required. An ordered sequence of property names and their index attributes.
  90. repeated IndexedProperty properties = 6 [(google.api.field_behavior) = REQUIRED];
  91. // Output only. The state of the index.
  92. State state = 7 [(google.api.field_behavior) = OUTPUT_ONLY];
  93. }