field.proto 4.2 KB

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