From b84a7cd2155484692fc8447c0d27a1cdaa9c8fa1 Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Thu, 18 May 2023 02:12:15 +0000 Subject: [PATCH] feat: add ApiScope and COLLECTION_RECURSIVE query_scope for Firestore index (#1300) - [ ] Regenerate this pull request now. PiperOrigin-RevId: 532955594 Source-Link: https://togithub.com/googleapis/googleapis/commit/b4bb0e2e2473016fedf9f8179db8cedad0b3ca5d Source-Link: https://togithub.com/googleapis/googleapis-gen/commit/57104e2a08b77d7c5f39eb5b972ce981d7822445 Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiNTcxMDRlMmEwOGI3N2Q3YzVmMzllYjViOTcyY2U5ODFkNzgyMjQ0NSJ9 --- .../com/google/firestore/admin/v1/Index.java | 616 +++++++++++++----- .../firestore/admin/v1/IndexOrBuilder.java | 85 ++- .../google/firestore/admin/v1/IndexProto.java | 57 +- .../google/firestore/admin/v1/index.proto | 32 +- 4 files changed, 573 insertions(+), 217 deletions(-) diff --git a/proto-google-cloud-firestore-admin-v1/src/main/java/com/google/firestore/admin/v1/Index.java b/proto-google-cloud-firestore-admin-v1/src/main/java/com/google/firestore/admin/v1/Index.java index 11fc1332b..afc60d5b0 100644 --- a/proto-google-cloud-firestore-admin-v1/src/main/java/com/google/firestore/admin/v1/Index.java +++ b/proto-google-cloud-firestore-admin-v1/src/main/java/com/google/firestore/admin/v1/Index.java @@ -41,6 +41,7 @@ private Index(com.google.protobuf.GeneratedMessageV3.Builder builder) { private Index() { name_ = ""; queryScope_ = 0; + apiScope_ = 0; fields_ = java.util.Collections.emptyList(); state_ = 0; } @@ -116,6 +117,17 @@ public enum QueryScope implements com.google.protobuf.ProtocolMessageEnum { * COLLECTION_GROUP = 2; */ COLLECTION_GROUP(2), + /** + * + * + *
+     * Include all the collections's ancestor in the index. Only available for
+     * Datastore Mode databases.
+     * 
+ * + * COLLECTION_RECURSIVE = 3; + */ + COLLECTION_RECURSIVE(3), UNRECOGNIZED(-1), ; @@ -153,6 +165,17 @@ public enum QueryScope implements com.google.protobuf.ProtocolMessageEnum { * COLLECTION_GROUP = 2; */ public static final int COLLECTION_GROUP_VALUE = 2; + /** + * + * + *
+     * Include all the collections's ancestor in the index. Only available for
+     * Datastore Mode databases.
+     * 
+ * + * COLLECTION_RECURSIVE = 3; + */ + public static final int COLLECTION_RECURSIVE_VALUE = 3; public final int getNumber() { if (this == UNRECOGNIZED) { @@ -184,6 +207,8 @@ public static QueryScope forNumber(int value) { return COLLECTION; case 2: return COLLECTION_GROUP; + case 3: + return COLLECTION_RECURSIVE; default: return null; } @@ -237,6 +262,144 @@ private QueryScope(int value) { // @@protoc_insertion_point(enum_scope:google.firestore.admin.v1.Index.QueryScope) } + /** + * + * + *
+   * API Scope defines the APIs (Firestore Native, or Firestore in
+   * Datastore Mode) that are supported for queries.
+   * 
+ * + * Protobuf enum {@code google.firestore.admin.v1.Index.ApiScope} + */ + public enum ApiScope implements com.google.protobuf.ProtocolMessageEnum { + /** + * + * + *
+     * The index can only be used by the Firestore Native query API.
+     * This is the default.
+     * 
+ * + * ANY_API = 0; + */ + ANY_API(0), + /** + * + * + *
+     * The index can only be used by the Firestore in Datastore Mode query API.
+     * 
+ * + * DATASTORE_MODE_API = 1; + */ + DATASTORE_MODE_API(1), + UNRECOGNIZED(-1), + ; + + /** + * + * + *
+     * The index can only be used by the Firestore Native query API.
+     * This is the default.
+     * 
+ * + * ANY_API = 0; + */ + public static final int ANY_API_VALUE = 0; + /** + * + * + *
+     * The index can only be used by the Firestore in Datastore Mode query API.
+     * 
+ * + * DATASTORE_MODE_API = 1; + */ + public static final int DATASTORE_MODE_API_VALUE = 1; + + public final int getNumber() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalArgumentException( + "Can't get the number of an unknown enum value."); + } + return value; + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static ApiScope valueOf(int value) { + return forNumber(value); + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + */ + public static ApiScope forNumber(int value) { + switch (value) { + case 0: + return ANY_API; + case 1: + return DATASTORE_MODE_API; + default: + return null; + } + } + + public static com.google.protobuf.Internal.EnumLiteMap internalGetValueMap() { + return internalValueMap; + } + + private static final com.google.protobuf.Internal.EnumLiteMap internalValueMap = + new com.google.protobuf.Internal.EnumLiteMap() { + public ApiScope findValueByNumber(int number) { + return ApiScope.forNumber(number); + } + }; + + public final com.google.protobuf.Descriptors.EnumValueDescriptor getValueDescriptor() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalStateException( + "Can't get the descriptor of an unrecognized enum value."); + } + return getDescriptor().getValues().get(ordinal()); + } + + public final com.google.protobuf.Descriptors.EnumDescriptor getDescriptorForType() { + return getDescriptor(); + } + + public static final com.google.protobuf.Descriptors.EnumDescriptor getDescriptor() { + return com.google.firestore.admin.v1.Index.getDescriptor().getEnumTypes().get(1); + } + + private static final ApiScope[] VALUES = values(); + + public static ApiScope valueOf(com.google.protobuf.Descriptors.EnumValueDescriptor desc) { + if (desc.getType() != getDescriptor()) { + throw new java.lang.IllegalArgumentException("EnumValueDescriptor is not for this type."); + } + if (desc.getIndex() == -1) { + return UNRECOGNIZED; + } + return VALUES[desc.getIndex()]; + } + + private final int value; + + private ApiScope(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.firestore.admin.v1.Index.ApiScope) + } + /** * * @@ -419,7 +582,7 @@ public final com.google.protobuf.Descriptors.EnumDescriptor getDescriptorForType } public static final com.google.protobuf.Descriptors.EnumDescriptor getDescriptor() { - return com.google.firestore.admin.v1.Index.getDescriptor().getEnumTypes().get(1); + return com.google.firestore.admin.v1.Index.getDescriptor().getEnumTypes().get(2); } private static final State[] VALUES = values(); @@ -2072,6 +2235,41 @@ public com.google.firestore.admin.v1.Index.QueryScope getQueryScope() { return result == null ? com.google.firestore.admin.v1.Index.QueryScope.UNRECOGNIZED : result; } + public static final int API_SCOPE_FIELD_NUMBER = 5; + private int apiScope_ = 0; + /** + * + * + *
+   * The API scope supported by this index.
+   * 
+ * + * .google.firestore.admin.v1.Index.ApiScope api_scope = 5; + * + * @return The enum numeric value on the wire for apiScope. + */ + @java.lang.Override + public int getApiScopeValue() { + return apiScope_; + } + /** + * + * + *
+   * The API scope supported by this index.
+   * 
+ * + * .google.firestore.admin.v1.Index.ApiScope api_scope = 5; + * + * @return The apiScope. + */ + @java.lang.Override + public com.google.firestore.admin.v1.Index.ApiScope getApiScope() { + com.google.firestore.admin.v1.Index.ApiScope result = + com.google.firestore.admin.v1.Index.ApiScope.forNumber(apiScope_); + return result == null ? com.google.firestore.admin.v1.Index.ApiScope.UNRECOGNIZED : result; + } + public static final int FIELDS_FIELD_NUMBER = 3; @SuppressWarnings("serial") @@ -2081,12 +2279,12 @@ public com.google.firestore.admin.v1.Index.QueryScope getQueryScope() { * *
    * The fields supported by this index.
-   * For composite indexes, this is always 2 or more fields.
-   * The last field entry is always for the field path `__name__`. If, on
-   * creation, `__name__` was not specified as the last field, it will be added
-   * automatically with the same direction as that of the last field defined. If
-   * the final field in a composite index is not directional, the `__name__`
-   * will be ordered ASCENDING (unless explicitly specified).
+   * For composite indexes, this requires a minimum of 2 and a maximum of 100
+   * fields. The last field entry is always for the field path `__name__`. If,
+   * on creation, `__name__` was not specified as the last field, it will be
+   * added automatically with the same direction as that of the last field
+   * defined. If the final field in a composite index is not directional, the
+   * `__name__` will be ordered ASCENDING (unless explicitly specified).
    * For single field indexes, this will always be exactly one entry with a
    * field path equal to the field path of the associated field.
    * 
@@ -2102,12 +2300,12 @@ public java.util.List getFieldsL * *
    * The fields supported by this index.
-   * For composite indexes, this is always 2 or more fields.
-   * The last field entry is always for the field path `__name__`. If, on
-   * creation, `__name__` was not specified as the last field, it will be added
-   * automatically with the same direction as that of the last field defined. If
-   * the final field in a composite index is not directional, the `__name__`
-   * will be ordered ASCENDING (unless explicitly specified).
+   * For composite indexes, this requires a minimum of 2 and a maximum of 100
+   * fields. The last field entry is always for the field path `__name__`. If,
+   * on creation, `__name__` was not specified as the last field, it will be
+   * added automatically with the same direction as that of the last field
+   * defined. If the final field in a composite index is not directional, the
+   * `__name__` will be ordered ASCENDING (unless explicitly specified).
    * For single field indexes, this will always be exactly one entry with a
    * field path equal to the field path of the associated field.
    * 
@@ -2124,12 +2322,12 @@ public java.util.List getFieldsL * *
    * The fields supported by this index.
-   * For composite indexes, this is always 2 or more fields.
-   * The last field entry is always for the field path `__name__`. If, on
-   * creation, `__name__` was not specified as the last field, it will be added
-   * automatically with the same direction as that of the last field defined. If
-   * the final field in a composite index is not directional, the `__name__`
-   * will be ordered ASCENDING (unless explicitly specified).
+   * For composite indexes, this requires a minimum of 2 and a maximum of 100
+   * fields. The last field entry is always for the field path `__name__`. If,
+   * on creation, `__name__` was not specified as the last field, it will be
+   * added automatically with the same direction as that of the last field
+   * defined. If the final field in a composite index is not directional, the
+   * `__name__` will be ordered ASCENDING (unless explicitly specified).
    * For single field indexes, this will always be exactly one entry with a
    * field path equal to the field path of the associated field.
    * 
@@ -2145,12 +2343,12 @@ public int getFieldsCount() { * *
    * The fields supported by this index.
-   * For composite indexes, this is always 2 or more fields.
-   * The last field entry is always for the field path `__name__`. If, on
-   * creation, `__name__` was not specified as the last field, it will be added
-   * automatically with the same direction as that of the last field defined. If
-   * the final field in a composite index is not directional, the `__name__`
-   * will be ordered ASCENDING (unless explicitly specified).
+   * For composite indexes, this requires a minimum of 2 and a maximum of 100
+   * fields. The last field entry is always for the field path `__name__`. If,
+   * on creation, `__name__` was not specified as the last field, it will be
+   * added automatically with the same direction as that of the last field
+   * defined. If the final field in a composite index is not directional, the
+   * `__name__` will be ordered ASCENDING (unless explicitly specified).
    * For single field indexes, this will always be exactly one entry with a
    * field path equal to the field path of the associated field.
    * 
@@ -2166,12 +2364,12 @@ public com.google.firestore.admin.v1.Index.IndexField getFields(int index) { * *
    * The fields supported by this index.
-   * For composite indexes, this is always 2 or more fields.
-   * The last field entry is always for the field path `__name__`. If, on
-   * creation, `__name__` was not specified as the last field, it will be added
-   * automatically with the same direction as that of the last field defined. If
-   * the final field in a composite index is not directional, the `__name__`
-   * will be ordered ASCENDING (unless explicitly specified).
+   * For composite indexes, this requires a minimum of 2 and a maximum of 100
+   * fields. The last field entry is always for the field path `__name__`. If,
+   * on creation, `__name__` was not specified as the last field, it will be
+   * added automatically with the same direction as that of the last field
+   * defined. If the final field in a composite index is not directional, the
+   * `__name__` will be ordered ASCENDING (unless explicitly specified).
    * For single field indexes, this will always be exactly one entry with a
    * field path equal to the field path of the associated field.
    * 
@@ -2245,6 +2443,9 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io if (state_ != com.google.firestore.admin.v1.Index.State.STATE_UNSPECIFIED.getNumber()) { output.writeEnum(4, state_); } + if (apiScope_ != com.google.firestore.admin.v1.Index.ApiScope.ANY_API.getNumber()) { + output.writeEnum(5, apiScope_); + } getUnknownFields().writeTo(output); } @@ -2267,6 +2468,9 @@ public int getSerializedSize() { if (state_ != com.google.firestore.admin.v1.Index.State.STATE_UNSPECIFIED.getNumber()) { size += com.google.protobuf.CodedOutputStream.computeEnumSize(4, state_); } + if (apiScope_ != com.google.firestore.admin.v1.Index.ApiScope.ANY_API.getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(5, apiScope_); + } size += getUnknownFields().getSerializedSize(); memoizedSize = size; return size; @@ -2284,6 +2488,7 @@ public boolean equals(final java.lang.Object obj) { if (!getName().equals(other.getName())) return false; if (queryScope_ != other.queryScope_) return false; + if (apiScope_ != other.apiScope_) return false; if (!getFieldsList().equals(other.getFieldsList())) return false; if (state_ != other.state_) return false; if (!getUnknownFields().equals(other.getUnknownFields())) return false; @@ -2301,6 +2506,8 @@ public int hashCode() { hash = (53 * hash) + getName().hashCode(); hash = (37 * hash) + QUERY_SCOPE_FIELD_NUMBER; hash = (53 * hash) + queryScope_; + hash = (37 * hash) + API_SCOPE_FIELD_NUMBER; + hash = (53 * hash) + apiScope_; if (getFieldsCount() > 0) { hash = (37 * hash) + FIELDS_FIELD_NUMBER; hash = (53 * hash) + getFieldsList().hashCode(); @@ -2448,13 +2655,14 @@ public Builder clear() { bitField0_ = 0; name_ = ""; queryScope_ = 0; + apiScope_ = 0; if (fieldsBuilder_ == null) { fields_ = java.util.Collections.emptyList(); } else { fields_ = null; fieldsBuilder_.clear(); } - bitField0_ = (bitField0_ & ~0x00000004); + bitField0_ = (bitField0_ & ~0x00000008); state_ = 0; return this; } @@ -2492,9 +2700,9 @@ public com.google.firestore.admin.v1.Index buildPartial() { private void buildPartialRepeatedFields(com.google.firestore.admin.v1.Index result) { if (fieldsBuilder_ == null) { - if (((bitField0_ & 0x00000004) != 0)) { + if (((bitField0_ & 0x00000008) != 0)) { fields_ = java.util.Collections.unmodifiableList(fields_); - bitField0_ = (bitField0_ & ~0x00000004); + bitField0_ = (bitField0_ & ~0x00000008); } result.fields_ = fields_; } else { @@ -2510,7 +2718,10 @@ private void buildPartial0(com.google.firestore.admin.v1.Index result) { if (((from_bitField0_ & 0x00000002) != 0)) { result.queryScope_ = queryScope_; } - if (((from_bitField0_ & 0x00000008) != 0)) { + if (((from_bitField0_ & 0x00000004) != 0)) { + result.apiScope_ = apiScope_; + } + if (((from_bitField0_ & 0x00000010) != 0)) { result.state_ = state_; } } @@ -2568,11 +2779,14 @@ public Builder mergeFrom(com.google.firestore.admin.v1.Index other) { if (other.queryScope_ != 0) { setQueryScopeValue(other.getQueryScopeValue()); } + if (other.apiScope_ != 0) { + setApiScopeValue(other.getApiScopeValue()); + } if (fieldsBuilder_ == null) { if (!other.fields_.isEmpty()) { if (fields_.isEmpty()) { fields_ = other.fields_; - bitField0_ = (bitField0_ & ~0x00000004); + bitField0_ = (bitField0_ & ~0x00000008); } else { ensureFieldsIsMutable(); fields_.addAll(other.fields_); @@ -2585,7 +2799,7 @@ public Builder mergeFrom(com.google.firestore.admin.v1.Index other) { fieldsBuilder_.dispose(); fieldsBuilder_ = null; fields_ = other.fields_; - bitField0_ = (bitField0_ & ~0x00000004); + bitField0_ = (bitField0_ & ~0x00000008); fieldsBuilder_ = com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? getFieldsFieldBuilder() @@ -2652,9 +2866,15 @@ public Builder mergeFrom( case 32: { state_ = input.readEnum(); - bitField0_ |= 0x00000008; + bitField0_ |= 0x00000010; break; } // case 32 + case 40: + { + apiScope_ = input.readEnum(); + bitField0_ |= 0x00000004; + break; + } // case 40 default: { if (!super.parseUnknownField(input, extensionRegistry, tag)) { @@ -2910,13 +3130,103 @@ public Builder clearQueryScope() { return this; } + private int apiScope_ = 0; + /** + * + * + *
+     * The API scope supported by this index.
+     * 
+ * + * .google.firestore.admin.v1.Index.ApiScope api_scope = 5; + * + * @return The enum numeric value on the wire for apiScope. + */ + @java.lang.Override + public int getApiScopeValue() { + return apiScope_; + } + /** + * + * + *
+     * The API scope supported by this index.
+     * 
+ * + * .google.firestore.admin.v1.Index.ApiScope api_scope = 5; + * + * @param value The enum numeric value on the wire for apiScope to set. + * @return This builder for chaining. + */ + public Builder setApiScopeValue(int value) { + apiScope_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+     * The API scope supported by this index.
+     * 
+ * + * .google.firestore.admin.v1.Index.ApiScope api_scope = 5; + * + * @return The apiScope. + */ + @java.lang.Override + public com.google.firestore.admin.v1.Index.ApiScope getApiScope() { + com.google.firestore.admin.v1.Index.ApiScope result = + com.google.firestore.admin.v1.Index.ApiScope.forNumber(apiScope_); + return result == null ? com.google.firestore.admin.v1.Index.ApiScope.UNRECOGNIZED : result; + } + /** + * + * + *
+     * The API scope supported by this index.
+     * 
+ * + * .google.firestore.admin.v1.Index.ApiScope api_scope = 5; + * + * @param value The apiScope to set. + * @return This builder for chaining. + */ + public Builder setApiScope(com.google.firestore.admin.v1.Index.ApiScope value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000004; + apiScope_ = value.getNumber(); + onChanged(); + return this; + } + /** + * + * + *
+     * The API scope supported by this index.
+     * 
+ * + * .google.firestore.admin.v1.Index.ApiScope api_scope = 5; + * + * @return This builder for chaining. + */ + public Builder clearApiScope() { + bitField0_ = (bitField0_ & ~0x00000004); + apiScope_ = 0; + onChanged(); + return this; + } + private java.util.List fields_ = java.util.Collections.emptyList(); private void ensureFieldsIsMutable() { - if (!((bitField0_ & 0x00000004) != 0)) { + if (!((bitField0_ & 0x00000008) != 0)) { fields_ = new java.util.ArrayList(fields_); - bitField0_ |= 0x00000004; + bitField0_ |= 0x00000008; } } @@ -2931,12 +3241,12 @@ private void ensureFieldsIsMutable() { * *
      * The fields supported by this index.
-     * For composite indexes, this is always 2 or more fields.
-     * The last field entry is always for the field path `__name__`. If, on
-     * creation, `__name__` was not specified as the last field, it will be added
-     * automatically with the same direction as that of the last field defined. If
-     * the final field in a composite index is not directional, the `__name__`
-     * will be ordered ASCENDING (unless explicitly specified).
+     * For composite indexes, this requires a minimum of 2 and a maximum of 100
+     * fields. The last field entry is always for the field path `__name__`. If,
+     * on creation, `__name__` was not specified as the last field, it will be
+     * added automatically with the same direction as that of the last field
+     * defined. If the final field in a composite index is not directional, the
+     * `__name__` will be ordered ASCENDING (unless explicitly specified).
      * For single field indexes, this will always be exactly one entry with a
      * field path equal to the field path of the associated field.
      * 
@@ -2955,12 +3265,12 @@ public java.util.List getFieldsL * *
      * The fields supported by this index.
-     * For composite indexes, this is always 2 or more fields.
-     * The last field entry is always for the field path `__name__`. If, on
-     * creation, `__name__` was not specified as the last field, it will be added
-     * automatically with the same direction as that of the last field defined. If
-     * the final field in a composite index is not directional, the `__name__`
-     * will be ordered ASCENDING (unless explicitly specified).
+     * For composite indexes, this requires a minimum of 2 and a maximum of 100
+     * fields. The last field entry is always for the field path `__name__`. If,
+     * on creation, `__name__` was not specified as the last field, it will be
+     * added automatically with the same direction as that of the last field
+     * defined. If the final field in a composite index is not directional, the
+     * `__name__` will be ordered ASCENDING (unless explicitly specified).
      * For single field indexes, this will always be exactly one entry with a
      * field path equal to the field path of the associated field.
      * 
@@ -2979,12 +3289,12 @@ public int getFieldsCount() { * *
      * The fields supported by this index.
-     * For composite indexes, this is always 2 or more fields.
-     * The last field entry is always for the field path `__name__`. If, on
-     * creation, `__name__` was not specified as the last field, it will be added
-     * automatically with the same direction as that of the last field defined. If
-     * the final field in a composite index is not directional, the `__name__`
-     * will be ordered ASCENDING (unless explicitly specified).
+     * For composite indexes, this requires a minimum of 2 and a maximum of 100
+     * fields. The last field entry is always for the field path `__name__`. If,
+     * on creation, `__name__` was not specified as the last field, it will be
+     * added automatically with the same direction as that of the last field
+     * defined. If the final field in a composite index is not directional, the
+     * `__name__` will be ordered ASCENDING (unless explicitly specified).
      * For single field indexes, this will always be exactly one entry with a
      * field path equal to the field path of the associated field.
      * 
@@ -3003,12 +3313,12 @@ public com.google.firestore.admin.v1.Index.IndexField getFields(int index) { * *
      * The fields supported by this index.
-     * For composite indexes, this is always 2 or more fields.
-     * The last field entry is always for the field path `__name__`. If, on
-     * creation, `__name__` was not specified as the last field, it will be added
-     * automatically with the same direction as that of the last field defined. If
-     * the final field in a composite index is not directional, the `__name__`
-     * will be ordered ASCENDING (unless explicitly specified).
+     * For composite indexes, this requires a minimum of 2 and a maximum of 100
+     * fields. The last field entry is always for the field path `__name__`. If,
+     * on creation, `__name__` was not specified as the last field, it will be
+     * added automatically with the same direction as that of the last field
+     * defined. If the final field in a composite index is not directional, the
+     * `__name__` will be ordered ASCENDING (unless explicitly specified).
      * For single field indexes, this will always be exactly one entry with a
      * field path equal to the field path of the associated field.
      * 
@@ -3033,12 +3343,12 @@ public Builder setFields(int index, com.google.firestore.admin.v1.Index.IndexFie * *
      * The fields supported by this index.
-     * For composite indexes, this is always 2 or more fields.
-     * The last field entry is always for the field path `__name__`. If, on
-     * creation, `__name__` was not specified as the last field, it will be added
-     * automatically with the same direction as that of the last field defined. If
-     * the final field in a composite index is not directional, the `__name__`
-     * will be ordered ASCENDING (unless explicitly specified).
+     * For composite indexes, this requires a minimum of 2 and a maximum of 100
+     * fields. The last field entry is always for the field path `__name__`. If,
+     * on creation, `__name__` was not specified as the last field, it will be
+     * added automatically with the same direction as that of the last field
+     * defined. If the final field in a composite index is not directional, the
+     * `__name__` will be ordered ASCENDING (unless explicitly specified).
      * For single field indexes, this will always be exactly one entry with a
      * field path equal to the field path of the associated field.
      * 
@@ -3061,12 +3371,12 @@ public Builder setFields( * *
      * The fields supported by this index.
-     * For composite indexes, this is always 2 or more fields.
-     * The last field entry is always for the field path `__name__`. If, on
-     * creation, `__name__` was not specified as the last field, it will be added
-     * automatically with the same direction as that of the last field defined. If
-     * the final field in a composite index is not directional, the `__name__`
-     * will be ordered ASCENDING (unless explicitly specified).
+     * For composite indexes, this requires a minimum of 2 and a maximum of 100
+     * fields. The last field entry is always for the field path `__name__`. If,
+     * on creation, `__name__` was not specified as the last field, it will be
+     * added automatically with the same direction as that of the last field
+     * defined. If the final field in a composite index is not directional, the
+     * `__name__` will be ordered ASCENDING (unless explicitly specified).
      * For single field indexes, this will always be exactly one entry with a
      * field path equal to the field path of the associated field.
      * 
@@ -3091,12 +3401,12 @@ public Builder addFields(com.google.firestore.admin.v1.Index.IndexField value) { * *
      * The fields supported by this index.
-     * For composite indexes, this is always 2 or more fields.
-     * The last field entry is always for the field path `__name__`. If, on
-     * creation, `__name__` was not specified as the last field, it will be added
-     * automatically with the same direction as that of the last field defined. If
-     * the final field in a composite index is not directional, the `__name__`
-     * will be ordered ASCENDING (unless explicitly specified).
+     * For composite indexes, this requires a minimum of 2 and a maximum of 100
+     * fields. The last field entry is always for the field path `__name__`. If,
+     * on creation, `__name__` was not specified as the last field, it will be
+     * added automatically with the same direction as that of the last field
+     * defined. If the final field in a composite index is not directional, the
+     * `__name__` will be ordered ASCENDING (unless explicitly specified).
      * For single field indexes, this will always be exactly one entry with a
      * field path equal to the field path of the associated field.
      * 
@@ -3121,12 +3431,12 @@ public Builder addFields(int index, com.google.firestore.admin.v1.Index.IndexFie * *
      * The fields supported by this index.
-     * For composite indexes, this is always 2 or more fields.
-     * The last field entry is always for the field path `__name__`. If, on
-     * creation, `__name__` was not specified as the last field, it will be added
-     * automatically with the same direction as that of the last field defined. If
-     * the final field in a composite index is not directional, the `__name__`
-     * will be ordered ASCENDING (unless explicitly specified).
+     * For composite indexes, this requires a minimum of 2 and a maximum of 100
+     * fields. The last field entry is always for the field path `__name__`. If,
+     * on creation, `__name__` was not specified as the last field, it will be
+     * added automatically with the same direction as that of the last field
+     * defined. If the final field in a composite index is not directional, the
+     * `__name__` will be ordered ASCENDING (unless explicitly specified).
      * For single field indexes, this will always be exactly one entry with a
      * field path equal to the field path of the associated field.
      * 
@@ -3149,12 +3459,12 @@ public Builder addFields( * *
      * The fields supported by this index.
-     * For composite indexes, this is always 2 or more fields.
-     * The last field entry is always for the field path `__name__`. If, on
-     * creation, `__name__` was not specified as the last field, it will be added
-     * automatically with the same direction as that of the last field defined. If
-     * the final field in a composite index is not directional, the `__name__`
-     * will be ordered ASCENDING (unless explicitly specified).
+     * For composite indexes, this requires a minimum of 2 and a maximum of 100
+     * fields. The last field entry is always for the field path `__name__`. If,
+     * on creation, `__name__` was not specified as the last field, it will be
+     * added automatically with the same direction as that of the last field
+     * defined. If the final field in a composite index is not directional, the
+     * `__name__` will be ordered ASCENDING (unless explicitly specified).
      * For single field indexes, this will always be exactly one entry with a
      * field path equal to the field path of the associated field.
      * 
@@ -3177,12 +3487,12 @@ public Builder addFields( * *
      * The fields supported by this index.
-     * For composite indexes, this is always 2 or more fields.
-     * The last field entry is always for the field path `__name__`. If, on
-     * creation, `__name__` was not specified as the last field, it will be added
-     * automatically with the same direction as that of the last field defined. If
-     * the final field in a composite index is not directional, the `__name__`
-     * will be ordered ASCENDING (unless explicitly specified).
+     * For composite indexes, this requires a minimum of 2 and a maximum of 100
+     * fields. The last field entry is always for the field path `__name__`. If,
+     * on creation, `__name__` was not specified as the last field, it will be
+     * added automatically with the same direction as that of the last field
+     * defined. If the final field in a composite index is not directional, the
+     * `__name__` will be ordered ASCENDING (unless explicitly specified).
      * For single field indexes, this will always be exactly one entry with a
      * field path equal to the field path of the associated field.
      * 
@@ -3205,12 +3515,12 @@ public Builder addAllFields( * *
      * The fields supported by this index.
-     * For composite indexes, this is always 2 or more fields.
-     * The last field entry is always for the field path `__name__`. If, on
-     * creation, `__name__` was not specified as the last field, it will be added
-     * automatically with the same direction as that of the last field defined. If
-     * the final field in a composite index is not directional, the `__name__`
-     * will be ordered ASCENDING (unless explicitly specified).
+     * For composite indexes, this requires a minimum of 2 and a maximum of 100
+     * fields. The last field entry is always for the field path `__name__`. If,
+     * on creation, `__name__` was not specified as the last field, it will be
+     * added automatically with the same direction as that of the last field
+     * defined. If the final field in a composite index is not directional, the
+     * `__name__` will be ordered ASCENDING (unless explicitly specified).
      * For single field indexes, this will always be exactly one entry with a
      * field path equal to the field path of the associated field.
      * 
@@ -3220,7 +3530,7 @@ public Builder addAllFields( public Builder clearFields() { if (fieldsBuilder_ == null) { fields_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000004); + bitField0_ = (bitField0_ & ~0x00000008); onChanged(); } else { fieldsBuilder_.clear(); @@ -3232,12 +3542,12 @@ public Builder clearFields() { * *
      * The fields supported by this index.
-     * For composite indexes, this is always 2 or more fields.
-     * The last field entry is always for the field path `__name__`. If, on
-     * creation, `__name__` was not specified as the last field, it will be added
-     * automatically with the same direction as that of the last field defined. If
-     * the final field in a composite index is not directional, the `__name__`
-     * will be ordered ASCENDING (unless explicitly specified).
+     * For composite indexes, this requires a minimum of 2 and a maximum of 100
+     * fields. The last field entry is always for the field path `__name__`. If,
+     * on creation, `__name__` was not specified as the last field, it will be
+     * added automatically with the same direction as that of the last field
+     * defined. If the final field in a composite index is not directional, the
+     * `__name__` will be ordered ASCENDING (unless explicitly specified).
      * For single field indexes, this will always be exactly one entry with a
      * field path equal to the field path of the associated field.
      * 
@@ -3259,12 +3569,12 @@ public Builder removeFields(int index) { * *
      * The fields supported by this index.
-     * For composite indexes, this is always 2 or more fields.
-     * The last field entry is always for the field path `__name__`. If, on
-     * creation, `__name__` was not specified as the last field, it will be added
-     * automatically with the same direction as that of the last field defined. If
-     * the final field in a composite index is not directional, the `__name__`
-     * will be ordered ASCENDING (unless explicitly specified).
+     * For composite indexes, this requires a minimum of 2 and a maximum of 100
+     * fields. The last field entry is always for the field path `__name__`. If,
+     * on creation, `__name__` was not specified as the last field, it will be
+     * added automatically with the same direction as that of the last field
+     * defined. If the final field in a composite index is not directional, the
+     * `__name__` will be ordered ASCENDING (unless explicitly specified).
      * For single field indexes, this will always be exactly one entry with a
      * field path equal to the field path of the associated field.
      * 
@@ -3279,12 +3589,12 @@ public com.google.firestore.admin.v1.Index.IndexField.Builder getFieldsBuilder(i * *
      * The fields supported by this index.
-     * For composite indexes, this is always 2 or more fields.
-     * The last field entry is always for the field path `__name__`. If, on
-     * creation, `__name__` was not specified as the last field, it will be added
-     * automatically with the same direction as that of the last field defined. If
-     * the final field in a composite index is not directional, the `__name__`
-     * will be ordered ASCENDING (unless explicitly specified).
+     * For composite indexes, this requires a minimum of 2 and a maximum of 100
+     * fields. The last field entry is always for the field path `__name__`. If,
+     * on creation, `__name__` was not specified as the last field, it will be
+     * added automatically with the same direction as that of the last field
+     * defined. If the final field in a composite index is not directional, the
+     * `__name__` will be ordered ASCENDING (unless explicitly specified).
      * For single field indexes, this will always be exactly one entry with a
      * field path equal to the field path of the associated field.
      * 
@@ -3303,12 +3613,12 @@ public com.google.firestore.admin.v1.Index.IndexFieldOrBuilder getFieldsOrBuilde * *
      * The fields supported by this index.
-     * For composite indexes, this is always 2 or more fields.
-     * The last field entry is always for the field path `__name__`. If, on
-     * creation, `__name__` was not specified as the last field, it will be added
-     * automatically with the same direction as that of the last field defined. If
-     * the final field in a composite index is not directional, the `__name__`
-     * will be ordered ASCENDING (unless explicitly specified).
+     * For composite indexes, this requires a minimum of 2 and a maximum of 100
+     * fields. The last field entry is always for the field path `__name__`. If,
+     * on creation, `__name__` was not specified as the last field, it will be
+     * added automatically with the same direction as that of the last field
+     * defined. If the final field in a composite index is not directional, the
+     * `__name__` will be ordered ASCENDING (unless explicitly specified).
      * For single field indexes, this will always be exactly one entry with a
      * field path equal to the field path of the associated field.
      * 
@@ -3328,12 +3638,12 @@ public com.google.firestore.admin.v1.Index.IndexFieldOrBuilder getFieldsOrBuilde * *
      * The fields supported by this index.
-     * For composite indexes, this is always 2 or more fields.
-     * The last field entry is always for the field path `__name__`. If, on
-     * creation, `__name__` was not specified as the last field, it will be added
-     * automatically with the same direction as that of the last field defined. If
-     * the final field in a composite index is not directional, the `__name__`
-     * will be ordered ASCENDING (unless explicitly specified).
+     * For composite indexes, this requires a minimum of 2 and a maximum of 100
+     * fields. The last field entry is always for the field path `__name__`. If,
+     * on creation, `__name__` was not specified as the last field, it will be
+     * added automatically with the same direction as that of the last field
+     * defined. If the final field in a composite index is not directional, the
+     * `__name__` will be ordered ASCENDING (unless explicitly specified).
      * For single field indexes, this will always be exactly one entry with a
      * field path equal to the field path of the associated field.
      * 
@@ -3349,12 +3659,12 @@ public com.google.firestore.admin.v1.Index.IndexField.Builder addFieldsBuilder() * *
      * The fields supported by this index.
-     * For composite indexes, this is always 2 or more fields.
-     * The last field entry is always for the field path `__name__`. If, on
-     * creation, `__name__` was not specified as the last field, it will be added
-     * automatically with the same direction as that of the last field defined. If
-     * the final field in a composite index is not directional, the `__name__`
-     * will be ordered ASCENDING (unless explicitly specified).
+     * For composite indexes, this requires a minimum of 2 and a maximum of 100
+     * fields. The last field entry is always for the field path `__name__`. If,
+     * on creation, `__name__` was not specified as the last field, it will be
+     * added automatically with the same direction as that of the last field
+     * defined. If the final field in a composite index is not directional, the
+     * `__name__` will be ordered ASCENDING (unless explicitly specified).
      * For single field indexes, this will always be exactly one entry with a
      * field path equal to the field path of the associated field.
      * 
@@ -3370,12 +3680,12 @@ public com.google.firestore.admin.v1.Index.IndexField.Builder addFieldsBuilder(i * *
      * The fields supported by this index.
-     * For composite indexes, this is always 2 or more fields.
-     * The last field entry is always for the field path `__name__`. If, on
-     * creation, `__name__` was not specified as the last field, it will be added
-     * automatically with the same direction as that of the last field defined. If
-     * the final field in a composite index is not directional, the `__name__`
-     * will be ordered ASCENDING (unless explicitly specified).
+     * For composite indexes, this requires a minimum of 2 and a maximum of 100
+     * fields. The last field entry is always for the field path `__name__`. If,
+     * on creation, `__name__` was not specified as the last field, it will be
+     * added automatically with the same direction as that of the last field
+     * defined. If the final field in a composite index is not directional, the
+     * `__name__` will be ordered ASCENDING (unless explicitly specified).
      * For single field indexes, this will always be exactly one entry with a
      * field path equal to the field path of the associated field.
      * 
@@ -3398,7 +3708,7 @@ public com.google.firestore.admin.v1.Index.IndexField.Builder addFieldsBuilder(i com.google.firestore.admin.v1.Index.IndexField, com.google.firestore.admin.v1.Index.IndexField.Builder, com.google.firestore.admin.v1.Index.IndexFieldOrBuilder>( - fields_, ((bitField0_ & 0x00000004) != 0), getParentForChildren(), isClean()); + fields_, ((bitField0_ & 0x00000008) != 0), getParentForChildren(), isClean()); fields_ = null; } return fieldsBuilder_; @@ -3434,7 +3744,7 @@ public int getStateValue() { */ public Builder setStateValue(int value) { state_ = value; - bitField0_ |= 0x00000008; + bitField0_ |= 0x00000010; onChanged(); return this; } @@ -3471,7 +3781,7 @@ public Builder setState(com.google.firestore.admin.v1.Index.State value) { if (value == null) { throw new NullPointerException(); } - bitField0_ |= 0x00000008; + bitField0_ |= 0x00000010; state_ = value.getNumber(); onChanged(); return this; @@ -3488,7 +3798,7 @@ public Builder setState(com.google.firestore.admin.v1.Index.State value) { * @return This builder for chaining. */ public Builder clearState() { - bitField0_ = (bitField0_ & ~0x00000008); + bitField0_ = (bitField0_ & ~0x00000010); state_ = 0; onChanged(); return this; diff --git a/proto-google-cloud-firestore-admin-v1/src/main/java/com/google/firestore/admin/v1/IndexOrBuilder.java b/proto-google-cloud-firestore-admin-v1/src/main/java/com/google/firestore/admin/v1/IndexOrBuilder.java index 498fa9136..6112dab31 100644 --- a/proto-google-cloud-firestore-admin-v1/src/main/java/com/google/firestore/admin/v1/IndexOrBuilder.java +++ b/proto-google-cloud-firestore-admin-v1/src/main/java/com/google/firestore/admin/v1/IndexOrBuilder.java @@ -89,17 +89,42 @@ public interface IndexOrBuilder */ com.google.firestore.admin.v1.Index.QueryScope getQueryScope(); + /** + * + * + *
+   * The API scope supported by this index.
+   * 
+ * + * .google.firestore.admin.v1.Index.ApiScope api_scope = 5; + * + * @return The enum numeric value on the wire for apiScope. + */ + int getApiScopeValue(); + /** + * + * + *
+   * The API scope supported by this index.
+   * 
+ * + * .google.firestore.admin.v1.Index.ApiScope api_scope = 5; + * + * @return The apiScope. + */ + com.google.firestore.admin.v1.Index.ApiScope getApiScope(); + /** * * *
    * The fields supported by this index.
-   * For composite indexes, this is always 2 or more fields.
-   * The last field entry is always for the field path `__name__`. If, on
-   * creation, `__name__` was not specified as the last field, it will be added
-   * automatically with the same direction as that of the last field defined. If
-   * the final field in a composite index is not directional, the `__name__`
-   * will be ordered ASCENDING (unless explicitly specified).
+   * For composite indexes, this requires a minimum of 2 and a maximum of 100
+   * fields. The last field entry is always for the field path `__name__`. If,
+   * on creation, `__name__` was not specified as the last field, it will be
+   * added automatically with the same direction as that of the last field
+   * defined. If the final field in a composite index is not directional, the
+   * `__name__` will be ordered ASCENDING (unless explicitly specified).
    * For single field indexes, this will always be exactly one entry with a
    * field path equal to the field path of the associated field.
    * 
@@ -112,12 +137,12 @@ public interface IndexOrBuilder * *
    * The fields supported by this index.
-   * For composite indexes, this is always 2 or more fields.
-   * The last field entry is always for the field path `__name__`. If, on
-   * creation, `__name__` was not specified as the last field, it will be added
-   * automatically with the same direction as that of the last field defined. If
-   * the final field in a composite index is not directional, the `__name__`
-   * will be ordered ASCENDING (unless explicitly specified).
+   * For composite indexes, this requires a minimum of 2 and a maximum of 100
+   * fields. The last field entry is always for the field path `__name__`. If,
+   * on creation, `__name__` was not specified as the last field, it will be
+   * added automatically with the same direction as that of the last field
+   * defined. If the final field in a composite index is not directional, the
+   * `__name__` will be ordered ASCENDING (unless explicitly specified).
    * For single field indexes, this will always be exactly one entry with a
    * field path equal to the field path of the associated field.
    * 
@@ -130,12 +155,12 @@ public interface IndexOrBuilder * *
    * The fields supported by this index.
-   * For composite indexes, this is always 2 or more fields.
-   * The last field entry is always for the field path `__name__`. If, on
-   * creation, `__name__` was not specified as the last field, it will be added
-   * automatically with the same direction as that of the last field defined. If
-   * the final field in a composite index is not directional, the `__name__`
-   * will be ordered ASCENDING (unless explicitly specified).
+   * For composite indexes, this requires a minimum of 2 and a maximum of 100
+   * fields. The last field entry is always for the field path `__name__`. If,
+   * on creation, `__name__` was not specified as the last field, it will be
+   * added automatically with the same direction as that of the last field
+   * defined. If the final field in a composite index is not directional, the
+   * `__name__` will be ordered ASCENDING (unless explicitly specified).
    * For single field indexes, this will always be exactly one entry with a
    * field path equal to the field path of the associated field.
    * 
@@ -148,12 +173,12 @@ public interface IndexOrBuilder * *
    * The fields supported by this index.
-   * For composite indexes, this is always 2 or more fields.
-   * The last field entry is always for the field path `__name__`. If, on
-   * creation, `__name__` was not specified as the last field, it will be added
-   * automatically with the same direction as that of the last field defined. If
-   * the final field in a composite index is not directional, the `__name__`
-   * will be ordered ASCENDING (unless explicitly specified).
+   * For composite indexes, this requires a minimum of 2 and a maximum of 100
+   * fields. The last field entry is always for the field path `__name__`. If,
+   * on creation, `__name__` was not specified as the last field, it will be
+   * added automatically with the same direction as that of the last field
+   * defined. If the final field in a composite index is not directional, the
+   * `__name__` will be ordered ASCENDING (unless explicitly specified).
    * For single field indexes, this will always be exactly one entry with a
    * field path equal to the field path of the associated field.
    * 
@@ -167,12 +192,12 @@ public interface IndexOrBuilder * *
    * The fields supported by this index.
-   * For composite indexes, this is always 2 or more fields.
-   * The last field entry is always for the field path `__name__`. If, on
-   * creation, `__name__` was not specified as the last field, it will be added
-   * automatically with the same direction as that of the last field defined. If
-   * the final field in a composite index is not directional, the `__name__`
-   * will be ordered ASCENDING (unless explicitly specified).
+   * For composite indexes, this requires a minimum of 2 and a maximum of 100
+   * fields. The last field entry is always for the field path `__name__`. If,
+   * on creation, `__name__` was not specified as the last field, it will be
+   * added automatically with the same direction as that of the last field
+   * defined. If the final field in a composite index is not directional, the
+   * `__name__` will be ordered ASCENDING (unless explicitly specified).
    * For single field indexes, this will always be exactly one entry with a
    * field path equal to the field path of the associated field.
    * 
diff --git a/proto-google-cloud-firestore-admin-v1/src/main/java/com/google/firestore/admin/v1/IndexProto.java b/proto-google-cloud-firestore-admin-v1/src/main/java/com/google/firestore/admin/v1/IndexProto.java index 9ea30f336..52e5560f9 100644 --- a/proto-google-cloud-firestore-admin-v1/src/main/java/com/google/firestore/admin/v1/IndexProto.java +++ b/proto-google-cloud-firestore-admin-v1/src/main/java/com/google/firestore/admin/v1/IndexProto.java @@ -46,33 +46,36 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { java.lang.String[] descriptorData = { "\n%google/firestore/admin/v1/index.proto\022" + "\031google.firestore.admin.v1\032\031google/api/r" - + "esource.proto\"\243\006\n\005Index\022\014\n\004name\030\001 \001(\t\022@\n" + + "esource.proto\"\254\007\n\005Index\022\014\n\004name\030\001 \001(\t\022@\n" + "\013query_scope\030\002 \001(\0162+.google.firestore.ad" - + "min.v1.Index.QueryScope\022;\n\006fields\030\003 \003(\0132" - + "+.google.firestore.admin.v1.Index.IndexF" - + "ield\0225\n\005state\030\004 \001(\0162&.google.firestore.a" - + "dmin.v1.Index.State\032\275\002\n\nIndexField\022\022\n\nfi" - + "eld_path\030\001 \001(\t\022B\n\005order\030\002 \001(\01621.google.f" - + "irestore.admin.v1.Index.IndexField.Order" - + "H\000\022O\n\014array_config\030\003 \001(\01627.google.firest" - + "ore.admin.v1.Index.IndexField.ArrayConfi" - + "gH\000\"=\n\005Order\022\025\n\021ORDER_UNSPECIFIED\020\000\022\r\n\tA" - + "SCENDING\020\001\022\016\n\nDESCENDING\020\002\"9\n\013ArrayConfi" - + "g\022\034\n\030ARRAY_CONFIG_UNSPECIFIED\020\000\022\014\n\010CONTA" - + "INS\020\001B\014\n\nvalue_mode\"O\n\nQueryScope\022\033\n\027QUE" - + "RY_SCOPE_UNSPECIFIED\020\000\022\016\n\nCOLLECTION\020\001\022\024" - + "\n\020COLLECTION_GROUP\020\002\"I\n\005State\022\025\n\021STATE_U" - + "NSPECIFIED\020\000\022\014\n\010CREATING\020\001\022\t\n\005READY\020\002\022\020\n" - + "\014NEEDS_REPAIR\020\003:z\352Aw\n\036firestore.googleap" - + "is.com/Index\022Uprojects/{project}/databas" - + "es/{database}/collectionGroups/{collecti" - + "on}/indexes/{index}B\331\001\n\035com.google.fires" - + "tore.admin.v1B\nIndexProtoP\001Z9cloud.googl" - + "e.com/go/firestore/apiv1/admin/adminpb;a" - + "dminpb\242\002\004GCFS\252\002\037Google.Cloud.Firestore.A" - + "dmin.V1\312\002\037Google\\Cloud\\Firestore\\Admin\\V" - + "1\352\002#Google::Cloud::Firestore::Admin::V1b" - + "\006proto3" + + "min.v1.Index.QueryScope\022<\n\tapi_scope\030\005 \001" + + "(\0162).google.firestore.admin.v1.Index.Api" + + "Scope\022;\n\006fields\030\003 \003(\0132+.google.firestore" + + ".admin.v1.Index.IndexField\0225\n\005state\030\004 \001(" + + "\0162&.google.firestore.admin.v1.Index.Stat" + + "e\032\275\002\n\nIndexField\022\022\n\nfield_path\030\001 \001(\t\022B\n\005" + + "order\030\002 \001(\01621.google.firestore.admin.v1." + + "Index.IndexField.OrderH\000\022O\n\014array_config" + + "\030\003 \001(\01627.google.firestore.admin.v1.Index" + + ".IndexField.ArrayConfigH\000\"=\n\005Order\022\025\n\021OR" + + "DER_UNSPECIFIED\020\000\022\r\n\tASCENDING\020\001\022\016\n\nDESC" + + "ENDING\020\002\"9\n\013ArrayConfig\022\034\n\030ARRAY_CONFIG_" + + "UNSPECIFIED\020\000\022\014\n\010CONTAINS\020\001B\014\n\nvalue_mod" + + "e\"i\n\nQueryScope\022\033\n\027QUERY_SCOPE_UNSPECIFI" + + "ED\020\000\022\016\n\nCOLLECTION\020\001\022\024\n\020COLLECTION_GROUP" + + "\020\002\022\030\n\024COLLECTION_RECURSIVE\020\003\"/\n\010ApiScope" + + "\022\013\n\007ANY_API\020\000\022\026\n\022DATASTORE_MODE_API\020\001\"I\n" + + "\005State\022\025\n\021STATE_UNSPECIFIED\020\000\022\014\n\010CREATIN" + + "G\020\001\022\t\n\005READY\020\002\022\020\n\014NEEDS_REPAIR\020\003:z\352Aw\n\036f" + + "irestore.googleapis.com/Index\022Uprojects/" + + "{project}/databases/{database}/collectio" + + "nGroups/{collection}/indexes/{index}B\331\001\n" + + "\035com.google.firestore.admin.v1B\nIndexPro" + + "toP\001Z9cloud.google.com/go/firestore/apiv" + + "1/admin/adminpb;adminpb\242\002\004GCFS\252\002\037Google." + + "Cloud.Firestore.Admin.V1\312\002\037Google\\Cloud\\" + + "Firestore\\Admin\\V1\352\002#Google::Cloud::Fire" + + "store::Admin::V1b\006proto3" }; descriptor = com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom( @@ -86,7 +89,7 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_google_firestore_admin_v1_Index_descriptor, new java.lang.String[] { - "Name", "QueryScope", "Fields", "State", + "Name", "QueryScope", "ApiScope", "Fields", "State", }); internal_static_google_firestore_admin_v1_Index_IndexField_descriptor = internal_static_google_firestore_admin_v1_Index_descriptor.getNestedTypes().get(0); diff --git a/proto-google-cloud-firestore-admin-v1/src/main/proto/google/firestore/admin/v1/index.proto b/proto-google-cloud-firestore-admin-v1/src/main/proto/google/firestore/admin/v1/index.proto index 54b5e7e87..2567da650 100644 --- a/proto-google-cloud-firestore-admin-v1/src/main/proto/google/firestore/admin/v1/index.proto +++ b/proto-google-cloud-firestore-admin-v1/src/main/proto/google/firestore/admin/v1/index.proto @@ -1,4 +1,4 @@ -// Copyright 2022 Google LLC +// Copyright 2023 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -50,6 +50,21 @@ message Index { // against all collections that has the collection id specified by the // index. COLLECTION_GROUP = 2; + + // Include all the collections's ancestor in the index. Only available for + // Datastore Mode databases. + COLLECTION_RECURSIVE = 3; + } + + // API Scope defines the APIs (Firestore Native, or Firestore in + // Datastore Mode) that are supported for queries. + enum ApiScope { + // The index can only be used by the Firestore Native query API. + // This is the default. + ANY_API = 0; + + // The index can only be used by the Firestore in Datastore Mode query API. + DATASTORE_MODE_API = 1; } // A field in an index. @@ -138,14 +153,17 @@ message Index { // time, and that have the same collection id as this index. QueryScope query_scope = 2; + // The API scope supported by this index. + ApiScope api_scope = 5; + // The fields supported by this index. // - // For composite indexes, this is always 2 or more fields. - // The last field entry is always for the field path `__name__`. If, on - // creation, `__name__` was not specified as the last field, it will be added - // automatically with the same direction as that of the last field defined. If - // the final field in a composite index is not directional, the `__name__` - // will be ordered ASCENDING (unless explicitly specified). + // For composite indexes, this requires a minimum of 2 and a maximum of 100 + // fields. The last field entry is always for the field path `__name__`. If, + // on creation, `__name__` was not specified as the last field, it will be + // added automatically with the same direction as that of the last field + // defined. If the final field in a composite index is not directional, the + // `__name__` will be ordered ASCENDING (unless explicitly specified). // // For single field indexes, this will always be exactly one entry with a // field path equal to the field path of the associated field.