summaryrefslogtreecommitdiff
path: root/third_party/googleapis/google/firestore/admin/v1beta1/index.proto
blob: 0ca95985b5f4366d0440e39da83cd4e714efbcc2 (plain)
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
// Copyright 2019 Google LLC.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
//     http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//

syntax = "proto3";

package google.firestore.admin.v1beta1;

import "google/api/annotations.proto";

option csharp_namespace = "Google.Cloud.Firestore.Admin.V1Beta1";
option go_package = "google.golang.org/genproto/googleapis/firestore/admin/v1beta1;admin";
option java_multiple_files = true;
option java_outer_classname = "IndexProto";
option java_package = "com.google.firestore.admin.v1beta1";
option objc_class_prefix = "GCFS";

// A field of an index.
message IndexField {
  // The mode determines how a field is indexed.
  enum Mode {
    // The mode is unspecified.
    MODE_UNSPECIFIED = 0;

    // The field's values are indexed so as to support sequencing in
    // ascending order and also query by <, >, <=, >=, and =.
    ASCENDING = 2;

    // The field's values are indexed so as to support sequencing in
    // descending order and also query by <, >, <=, >=, and =.
    DESCENDING = 3;

    // The field's array values are indexed so as to support membership using
    // ARRAY_CONTAINS queries.
    ARRAY_CONTAINS = 4;
  }

  // The path of the field. Must match the field path specification described
  // by [google.firestore.v1beta1.Document.fields][fields].
  // Special field path `__name__` may be used by itself or at the end of a
  // path. `__type__` may be used only at the end of path.
  string field_path = 1;

  // The field's mode.
  Mode mode = 2;
}

// An index definition.
message Index {
  // The state of an index. During index creation, an index will be in the
  // `CREATING` state. If the index is created successfully, it will transition
  // to the `READY` state. If the index is not able to be created, it will
  // transition to the `ERROR` state.
  enum State {
    // The state is unspecified.
    STATE_UNSPECIFIED = 0;

    // The index is being created.
    // There is an active long-running operation for the index.
    // The index is updated when writing a document.
    // Some index data may exist.
    CREATING = 3;

    // The index is ready to be used.
    // The index is updated when writing a document.
    // The index is fully populated from all stored documents it applies to.
    READY = 2;

    // The index was being created, but something went wrong.
    // 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 a document.
    // Some index data may exist.
    ERROR = 5;
  }

  // The resource name of the index.
  // Output only.
  string name = 1;

  // The collection ID to which this index applies. Required.
  string collection_id = 2;

  // The fields to index.
  repeated IndexField fields = 3;

  // The state of the index.
  // Output only.
  State state = 6;
}