field.proto 3.9 KB

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