• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1// Copyright 2019 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//
15
16syntax = "proto3";
17
18package google.firestore.admin.v1beta2;
19
20import "google/firestore/admin/v1beta2/index.proto";
21import "google/api/annotations.proto";
22
23option csharp_namespace = "Google.Cloud.Firestore.Admin.V1Beta2";
24option go_package = "cloud.google.com/go/firestore/admin/apiv1beta2/adminpb;adminpb";
25option java_multiple_files = true;
26option java_outer_classname = "FieldProto";
27option java_package = "com.google.firestore.admin.v1beta2";
28option objc_class_prefix = "GCFS";
29
30// Represents a single field in the database.
31//
32// Fields are grouped by their "Collection Group", which represent all
33// collections in the database with the same id.
34message Field {
35  // The index configuration for this field.
36  message IndexConfig {
37    // The indexes supported for this field.
38    repeated Index indexes = 1;
39
40    // Output only. When true, the `Field`'s index configuration is set from the
41    // configuration specified by the `ancestor_field`.
42    // When false, the `Field`'s index configuration is defined explicitly.
43    bool uses_ancestor_config = 2;
44
45    // Output only. Specifies the resource name of the `Field` from which this field's
46    // index configuration is set (when `uses_ancestor_config` is true),
47    // or from which it *would* be set if this field had no index configuration
48    // (when `uses_ancestor_config` is false).
49    string ancestor_field = 3;
50
51    // Output only
52    // When true, the `Field`'s index configuration is in the process of being
53    // reverted. Once complete, the index config will transition to the same
54    // state as the field specified by `ancestor_field`, at which point
55    // `uses_ancestor_config` will be `true` and `reverting` will be `false`.
56    bool reverting = 4;
57  }
58
59  // A field name of the form
60  // `projects/{project_id}/databases/{database_id}/collectionGroups/{collection_id}/fields/{field_path}`
61  //
62  // A field path may be a simple field name, e.g. `address` or a path to fields
63  // within map_value , e.g. `address.city`,
64  // or a special field path. The only valid special field is `*`, which
65  // represents any field.
66  //
67  // Field paths may be quoted using ` (backtick). The only character that needs
68  // to be escaped within a quoted field path is the backtick character itself,
69  // escaped using a backslash. Special characters in field paths that
70  // must be quoted include: `*`, `.`,
71  // ``` (backtick), `[`, `]`, as well as any ascii symbolic characters.
72  //
73  // Examples:
74  // (Note: Comments here are written in markdown syntax, so there is an
75  //  additional layer of backticks to represent a code block)
76  // `\`address.city\`` represents a field named `address.city`, not the map key
77  // `city` in the field `address`.
78  // `\`*\`` represents a field named `*`, not any field.
79  //
80  // A special `Field` contains the default indexing settings for all fields.
81  // This field's resource name is:
82  // `projects/{project_id}/databases/{database_id}/collectionGroups/__default__/fields/*`
83  // Indexes defined on this `Field` will be applied to all fields which do not
84  // have their own `Field` index configuration.
85  string name = 1;
86
87  // The index configuration for this field. If unset, field indexing will
88  // revert to the configuration defined by the `ancestor_field`. To
89  // explicitly remove all indexes for this field, specify an index config
90  // with an empty list of indexes.
91  IndexConfig index_config = 2;
92}
93