Skip to content

Commit

Permalink
feat: add ApiScope and COLLECTION_RECURSIVE query_scope for Firestore…
Browse files Browse the repository at this point in the history
… index

PiperOrigin-RevId: 532955594

Source-Link: googleapis/googleapis@b4bb0e2

Source-Link: https://github.com/googleapis/googleapis-gen/commit/57104e2a08b77d7c5f39eb5b972ce981d7822445
Copy-Tag: eyJwIjoiYXBpcy9Hb29nbGUuQ2xvdWQuRmlyZXN0b3JlLkFkbWluLlYxLy5Pd2xCb3QueWFtbCIsImgiOiI1NzEwNGUyYTA4Yjc3ZDdjNWYzOWViNWI5NzJjZTk4MWQ3ODIyNDQ1In0=
  • Loading branch information
gcf-owl-bot[bot] authored and Rishabh-V committed May 18, 2023
1 parent 8f6305d commit 4c82bff
Showing 1 changed file with 94 additions and 30 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -26,34 +26,37 @@ static IndexReflection() {
string.Concat(
"CiVnb29nbGUvZmlyZXN0b3JlL2FkbWluL3YxL2luZGV4LnByb3RvEhlnb29n",
"bGUuZmlyZXN0b3JlLmFkbWluLnYxGhlnb29nbGUvYXBpL3Jlc291cmNlLnBy",
"b3RvIqMGCgVJbmRleBIMCgRuYW1lGAEgASgJEkAKC3F1ZXJ5X3Njb3BlGAIg",
"b3RvIqwHCgVJbmRleBIMCgRuYW1lGAEgASgJEkAKC3F1ZXJ5X3Njb3BlGAIg",
"ASgOMisuZ29vZ2xlLmZpcmVzdG9yZS5hZG1pbi52MS5JbmRleC5RdWVyeVNj",
"b3BlEjsKBmZpZWxkcxgDIAMoCzIrLmdvb2dsZS5maXJlc3RvcmUuYWRtaW4u",
"djEuSW5kZXguSW5kZXhGaWVsZBI1CgVzdGF0ZRgEIAEoDjImLmdvb2dsZS5m",
"aXJlc3RvcmUuYWRtaW4udjEuSW5kZXguU3RhdGUavQIKCkluZGV4RmllbGQS",
"EgoKZmllbGRfcGF0aBgBIAEoCRJCCgVvcmRlchgCIAEoDjIxLmdvb2dsZS5m",
"aXJlc3RvcmUuYWRtaW4udj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",
"bmRleBJVcHJvamVjdHMve3Byb2plY3R9L2RhdGFiYXNlcy97ZGF0YWJhc2V9",
"L2NvbGxlY3Rpb25Hcm91cHMve2NvbGxlY3Rpb259L2luZGV4ZXMve2luZGV4",
"fULZAQodY29tLmdvb2dsZS5maXJlc3RvcmUuYWRtaW4udjFCCkluZGV4UHJv",
"dG9QAVo5Y2xvdWQuZ29vZ2xlLmNvbS9nby9maXJlc3RvcmUvYXBpdjEvYWRt",
"aW4vYWRtaW5wYjthZG1pbnBiogIER0NGU6oCH0dvb2dsZS5DbG91ZC5GaXJl",
"c3RvcmUuQWRtaW4uVjHKAh9Hb29nbGVcQ2xvdWRcRmlyZXN0b3JlXEFkbWlu",
"XFYx6gIjR29vZ2xlOjpDbG91ZDo6RmlyZXN0b3JlOjpBZG1pbjo6VjFiBnBy",
"b3RvMw=="));
descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData,
new pbr::FileDescriptor[] { global::Google.Api.ResourceReflection.Descriptor, },
new pbr::GeneratedClrTypeInfo(null, null, new pbr::GeneratedClrTypeInfo[] {
new pbr::GeneratedClrTypeInfo(typeof(global::Google.Cloud.Firestore.Admin.V1.Index), global::Google.Cloud.Firestore.Admin.V1.Index.Parser, new[]{ "Name", "QueryScope", "Fields", "State" }, null, new[]{ typeof(global::Google.Cloud.Firestore.Admin.V1.Index.Types.QueryScope), typeof(global::Google.Cloud.Firestore.Admin.V1.Index.Types.State) }, null, new pbr::GeneratedClrTypeInfo[] { new pbr::GeneratedClrTypeInfo(typeof(global::Google.Cloud.Firestore.Admin.V1.Index.Types.IndexField), global::Google.Cloud.Firestore.Admin.V1.Index.Types.IndexField.Parser, new[]{ "FieldPath", "Order", "ArrayConfig" }, new[]{ "ValueMode" }, new[]{ typeof(global::Google.Cloud.Firestore.Admin.V1.Index.Types.IndexField.Types.Order), typeof(global::Google.Cloud.Firestore.Admin.V1.Index.Types.IndexField.Types.ArrayConfig) }, null, null)})
new pbr::GeneratedClrTypeInfo(typeof(global::Google.Cloud.Firestore.Admin.V1.Index), global::Google.Cloud.Firestore.Admin.V1.Index.Parser, new[]{ "Name", "QueryScope", "ApiScope", "Fields", "State" }, null, new[]{ typeof(global::Google.Cloud.Firestore.Admin.V1.Index.Types.QueryScope), typeof(global::Google.Cloud.Firestore.Admin.V1.Index.Types.ApiScope), typeof(global::Google.Cloud.Firestore.Admin.V1.Index.Types.State) }, null, new pbr::GeneratedClrTypeInfo[] { new pbr::GeneratedClrTypeInfo(typeof(global::Google.Cloud.Firestore.Admin.V1.Index.Types.IndexField), global::Google.Cloud.Firestore.Admin.V1.Index.Types.IndexField.Parser, new[]{ "FieldPath", "Order", "ArrayConfig" }, new[]{ "ValueMode" }, new[]{ typeof(global::Google.Cloud.Firestore.Admin.V1.Index.Types.IndexField.Types.Order), typeof(global::Google.Cloud.Firestore.Admin.V1.Index.Types.IndexField.Types.ArrayConfig) }, null, null)})
}));
}
#endregion
Expand Down Expand Up @@ -100,6 +103,7 @@ public Index() {
public Index(Index other) : this() {
name_ = other.name_;
queryScope_ = other.queryScope_;
apiScope_ = other.apiScope_;
fields_ = other.fields_.Clone();
state_ = other.state_;
_unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields);
Expand Down Expand Up @@ -150,6 +154,21 @@ public string Name {
}
}

/// <summary>Field number for the "api_scope" field.</summary>
public const int ApiScopeFieldNumber = 5;
private global::Google.Cloud.Firestore.Admin.V1.Index.Types.ApiScope apiScope_ = global::Google.Cloud.Firestore.Admin.V1.Index.Types.ApiScope.AnyApi;
/// <summary>
/// The API scope supported by this index.
/// </summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
public global::Google.Cloud.Firestore.Admin.V1.Index.Types.ApiScope ApiScope {
get { return apiScope_; }
set {
apiScope_ = value;
}
}

/// <summary>Field number for the "fields" field.</summary>
public const int FieldsFieldNumber = 3;
private static readonly pb::FieldCodec<global::Google.Cloud.Firestore.Admin.V1.Index.Types.IndexField> _repeated_fields_codec
Expand All @@ -158,12 +177,12 @@ public string Name {
/// <summary>
/// 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.
Expand Down Expand Up @@ -206,6 +225,7 @@ public bool Equals(Index other) {
}
if (Name != other.Name) return false;
if (QueryScope != other.QueryScope) return false;
if (ApiScope != other.ApiScope) return false;
if(!fields_.Equals(other.fields_)) return false;
if (State != other.State) return false;
return Equals(_unknownFields, other._unknownFields);
Expand All @@ -217,6 +237,7 @@ public override int GetHashCode() {
int hash = 1;
if (Name.Length != 0) hash ^= Name.GetHashCode();
if (QueryScope != global::Google.Cloud.Firestore.Admin.V1.Index.Types.QueryScope.Unspecified) hash ^= QueryScope.GetHashCode();
if (ApiScope != global::Google.Cloud.Firestore.Admin.V1.Index.Types.ApiScope.AnyApi) hash ^= ApiScope.GetHashCode();
hash ^= fields_.GetHashCode();
if (State != global::Google.Cloud.Firestore.Admin.V1.Index.Types.State.Unspecified) hash ^= State.GetHashCode();
if (_unknownFields != null) {
Expand Down Expand Up @@ -250,6 +271,10 @@ public void WriteTo(pb::CodedOutputStream output) {
output.WriteRawTag(32);
output.WriteEnum((int) State);
}
if (ApiScope != global::Google.Cloud.Firestore.Admin.V1.Index.Types.ApiScope.AnyApi) {
output.WriteRawTag(40);
output.WriteEnum((int) ApiScope);
}
if (_unknownFields != null) {
_unknownFields.WriteTo(output);
}
Expand All @@ -273,6 +298,10 @@ public void WriteTo(pb::CodedOutputStream output) {
output.WriteRawTag(32);
output.WriteEnum((int) State);
}
if (ApiScope != global::Google.Cloud.Firestore.Admin.V1.Index.Types.ApiScope.AnyApi) {
output.WriteRawTag(40);
output.WriteEnum((int) ApiScope);
}
if (_unknownFields != null) {
_unknownFields.WriteTo(ref output);
}
Expand All @@ -289,6 +318,9 @@ public int CalculateSize() {
if (QueryScope != global::Google.Cloud.Firestore.Admin.V1.Index.Types.QueryScope.Unspecified) {
size += 1 + pb::CodedOutputStream.ComputeEnumSize((int) QueryScope);
}
if (ApiScope != global::Google.Cloud.Firestore.Admin.V1.Index.Types.ApiScope.AnyApi) {
size += 1 + pb::CodedOutputStream.ComputeEnumSize((int) ApiScope);
}
size += fields_.CalculateSize(_repeated_fields_codec);
if (State != global::Google.Cloud.Firestore.Admin.V1.Index.Types.State.Unspecified) {
size += 1 + pb::CodedOutputStream.ComputeEnumSize((int) State);
Expand All @@ -311,6 +343,9 @@ public void MergeFrom(Index other) {
if (other.QueryScope != global::Google.Cloud.Firestore.Admin.V1.Index.Types.QueryScope.Unspecified) {
QueryScope = other.QueryScope;
}
if (other.ApiScope != global::Google.Cloud.Firestore.Admin.V1.Index.Types.ApiScope.AnyApi) {
ApiScope = other.ApiScope;
}
fields_.Add(other.fields_);
if (other.State != global::Google.Cloud.Firestore.Admin.V1.Index.Types.State.Unspecified) {
State = other.State;
Expand Down Expand Up @@ -346,6 +381,10 @@ public void MergeFrom(pb::CodedInputStream input) {
State = (global::Google.Cloud.Firestore.Admin.V1.Index.Types.State) input.ReadEnum();
break;
}
case 40: {
ApiScope = (global::Google.Cloud.Firestore.Admin.V1.Index.Types.ApiScope) input.ReadEnum();
break;
}
}
}
#endif
Expand Down Expand Up @@ -377,6 +416,10 @@ public void MergeFrom(pb::CodedInputStream input) {
State = (global::Google.Cloud.Firestore.Admin.V1.Index.Types.State) input.ReadEnum();
break;
}
case 40: {
ApiScope = (global::Google.Cloud.Firestore.Admin.V1.Index.Types.ApiScope) input.ReadEnum();
break;
}
}
}
}
Expand Down Expand Up @@ -408,6 +451,27 @@ public enum QueryScope {
/// index.
/// </summary>
[pbr::OriginalName("COLLECTION_GROUP")] CollectionGroup = 2,
/// <summary>
/// Include all the collections's ancestor in the index. Only available for
/// Datastore Mode databases.
/// </summary>
[pbr::OriginalName("COLLECTION_RECURSIVE")] CollectionRecursive = 3,
}

/// <summary>
/// API Scope defines the APIs (Firestore Native, or Firestore in
/// Datastore Mode) that are supported for queries.
/// </summary>
public enum ApiScope {
/// <summary>
/// The index can only be used by the Firestore Native query API.
/// This is the default.
/// </summary>
[pbr::OriginalName("ANY_API")] AnyApi = 0,
/// <summary>
/// The index can only be used by the Firestore in Datastore Mode query API.
/// </summary>
[pbr::OriginalName("DATASTORE_MODE_API")] DatastoreModeApi = 1,
}

/// <summary>
Expand Down

0 comments on commit 4c82bff

Please sign in to comment.