From 9931b9db0820aeda79300914c7e0ddb5edb647c4 Mon Sep 17 00:00:00 2001 From: Owl Bot Date: Tue, 1 Aug 2023 01:01:10 +0000 Subject: [PATCH] feat: publish proto definitions for SUM/AVG in Firestore PiperOrigin-RevId: 552607134 Source-Link: https://github.com/googleapis/googleapis/commit/88a9a5f9944682d1901923cc1376935c2c694595 Source-Link: https://github.com/googleapis/googleapis-gen/commit/047d73ae2fd4e526b474a617e168339d691b2510 Copy-Tag: eyJwIjoiYXBpcy9Hb29nbGUuQ2xvdWQuRmlyZXN0b3JlLlYxLy5Pd2xCb3QueWFtbCIsImgiOiIwNDdkNzNhZTJmZDRlNTI2YjQ3NGE2MTdlMTY4MzM5ZDY5MWIyNTEwIn0= --- .../Google.Cloud.Firestore.V1/Common.g.cs | 8 +- .../Google.Cloud.Firestore.V1/Firestore.g.cs | 35 +- .../Google.Cloud.Firestore.V1/Query.g.cs | 585 +++++++++++++++++- .../Google.Cloud.Firestore.V1/Write.g.cs | 12 +- 4 files changed, 611 insertions(+), 29 deletions(-) diff --git a/apis/Google.Cloud.Firestore.V1/Google.Cloud.Firestore.V1/Common.g.cs b/apis/Google.Cloud.Firestore.V1/Google.Cloud.Firestore.V1/Common.g.cs index ae39a8af7c5c..0f3d0f833b60 100644 --- a/apis/Google.Cloud.Firestore.V1/Google.Cloud.Firestore.V1/Common.g.cs +++ b/apis/Google.Cloud.Firestore.V1/Google.Cloud.Firestore.V1/Common.g.cs @@ -841,6 +841,9 @@ public enum ModeOneofCase { public static partial class Types { /// /// Options for a transaction that can be used to read and write documents. + /// + /// Firestore does not allow 3rd party auth requests to create read-write. + /// transactions. /// public sealed partial class ReadWrite : pb::IMessage #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE @@ -1090,7 +1093,10 @@ public sealed partial class ReadOnly : pb::IMessage public const int ReadTimeFieldNumber = 2; /// /// Reads documents at the given time. - /// This may not be older than 60 seconds. + /// + /// This must be a microsecond precision timestamp within the past one + /// hour, or if Point-in-Time Recovery is enabled, can additionally be a + /// whole minute timestamp within the past 7 days. /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute] [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] diff --git a/apis/Google.Cloud.Firestore.V1/Google.Cloud.Firestore.V1/Firestore.g.cs b/apis/Google.Cloud.Firestore.V1/Google.Cloud.Firestore.V1/Firestore.g.cs index a35c21355e34..dffec91821d5 100644 --- a/apis/Google.Cloud.Firestore.V1/Google.Cloud.Firestore.V1/Firestore.g.cs +++ b/apis/Google.Cloud.Firestore.V1/Google.Cloud.Firestore.V1/Firestore.g.cs @@ -403,7 +403,10 @@ public sealed partial class GetDocumentRequest : pb::IMessage /// Reads the version of the document at the given time. - /// This may not be older than 270 seconds. + /// + /// This must be a microsecond precision timestamp within the past one hour, + /// or if Point-in-Time Recovery is enabled, can additionally be a whole + /// minute timestamp within the past 7 days. /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute] [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] @@ -881,7 +884,9 @@ public sealed partial class ListDocumentsRequest : pb::IMessage /// Perform the read at the provided time. /// - /// This may not be older than 270 seconds. + /// This must be a microsecond precision timestamp within the past one hour, + /// or if Point-in-Time Recovery is enabled, can additionally be a whole + /// minute timestamp within the past 7 days. /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute] [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] @@ -2672,7 +2677,10 @@ public sealed partial class BatchGetDocumentsRequest : pb::IMessage /// Reads documents as they were at the given time. - /// This may not be older than 270 seconds. + /// + /// This must be a microsecond precision timestamp within the past one hour, + /// or if Point-in-Time Recovery is enabled, can additionally be a whole + /// minute timestamp within the past 7 days. /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute] [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] @@ -4717,7 +4725,10 @@ public sealed partial class RunQueryRequest : pb::IMessage public const int ReadTimeFieldNumber = 7; /// /// Reads documents as they were at the given time. - /// This may not be older than 270 seconds. + /// + /// This must be a microsecond precision timestamp within the past one hour, + /// or if Point-in-Time Recovery is enabled, can additionally be a whole + /// minute timestamp within the past 7 days. /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute] [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] @@ -5634,9 +5645,9 @@ public sealed partial class RunAggregationQueryRequest : pb::IMessage /// Executes the query at the given timestamp. /// - /// Requires: - /// - /// * Cannot be more than 270 seconds in the past. + /// This must be a microsecond precision timestamp within the past one hour, + /// or if Point-in-Time Recovery is enabled, can additionally be a whole + /// minute timestamp within the past 7 days. /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute] [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] @@ -6447,7 +6458,10 @@ public sealed partial class PartitionQueryRequest : pb::IMessage /// Reads documents as they were at the given time. - /// This may not be older than 270 seconds. + /// + /// This must be a microsecond precision timestamp within the past one hour, + /// or if Point-in-Time Recovery is enabled, can additionally be a whole + /// minute timestamp within the past 7 days. /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute] [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] @@ -10133,7 +10147,10 @@ public sealed partial class ListCollectionIdsRequest : pb::IMessage /// Reads documents as they were at the given time. - /// This may not be older than 270 seconds. + /// + /// This must be a microsecond precision timestamp within the past one hour, + /// or if Point-in-Time Recovery is enabled, can additionally be a whole + /// minute timestamp within the past 7 days. /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute] [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] diff --git a/apis/Google.Cloud.Firestore.V1/Google.Cloud.Firestore.V1/Query.g.cs b/apis/Google.Cloud.Firestore.V1/Google.Cloud.Firestore.V1/Query.g.cs index 8c55bbb449ce..60b514d416aa 100644 --- a/apis/Google.Cloud.Firestore.V1/Google.Cloud.Firestore.V1/Query.g.cs +++ b/apis/Google.Cloud.Firestore.V1/Google.Cloud.Firestore.V1/Query.g.cs @@ -71,22 +71,29 @@ public static partial class QueryReflection { "G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dsZS5jb20v", + "Z28vZmlyZXN0b3JlL2FwaXYxL2ZpcmVzdG9yZXBiO2ZpcmVzdG9yZXBiogIE", + "R0NGU6oCGUdvb2dsZS5DbG91ZC5GaXJlc3RvcmUuVjHKAhlHb29nbGVcQ2xv", + "dWRcRmlyZXN0b3JlXFYx6gIcR29vZ2xlOjpDbG91ZDo6RmlyZXN0b3JlOjpW", + "MWIGcHJvdG8z")); descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData, new pbr::FileDescriptor[] { global::Google.Api.FieldBehaviorReflection.Descriptor, global::Google.Cloud.Firestore.V1.DocumentReflection.Descriptor, global::Google.Protobuf.WellKnownTypes.WrappersReflection.Descriptor, }, new pbr::GeneratedClrTypeInfo(null, null, new pbr::GeneratedClrTypeInfo[] { @@ -98,7 +105,9 @@ public static partial class QueryReflection { new pbr::GeneratedClrTypeInfo(typeof(global::Google.Cloud.Firestore.V1.StructuredQuery.Types.Order), global::Google.Cloud.Firestore.V1.StructuredQuery.Types.Order.Parser, new[]{ "Field", "Direction" }, null, null, null, null), new pbr::GeneratedClrTypeInfo(typeof(global::Google.Cloud.Firestore.V1.StructuredQuery.Types.FieldReference), global::Google.Cloud.Firestore.V1.StructuredQuery.Types.FieldReference.Parser, new[]{ "FieldPath" }, null, null, null, null), new pbr::GeneratedClrTypeInfo(typeof(global::Google.Cloud.Firestore.V1.StructuredQuery.Types.Projection), global::Google.Cloud.Firestore.V1.StructuredQuery.Types.Projection.Parser, new[]{ "Fields" }, null, null, null, null)}), - new pbr::GeneratedClrTypeInfo(typeof(global::Google.Cloud.Firestore.V1.StructuredAggregationQuery), global::Google.Cloud.Firestore.V1.StructuredAggregationQuery.Parser, new[]{ "StructuredQuery", "Aggregations" }, new[]{ "QueryType" }, null, null, new pbr::GeneratedClrTypeInfo[] { new pbr::GeneratedClrTypeInfo(typeof(global::Google.Cloud.Firestore.V1.StructuredAggregationQuery.Types.Aggregation), global::Google.Cloud.Firestore.V1.StructuredAggregationQuery.Types.Aggregation.Parser, new[]{ "Count", "Alias" }, new[]{ "Operator" }, null, null, new pbr::GeneratedClrTypeInfo[] { new pbr::GeneratedClrTypeInfo(typeof(global::Google.Cloud.Firestore.V1.StructuredAggregationQuery.Types.Aggregation.Types.Count), global::Google.Cloud.Firestore.V1.StructuredAggregationQuery.Types.Aggregation.Types.Count.Parser, new[]{ "UpTo" }, null, null, null, null)})}), + new pbr::GeneratedClrTypeInfo(typeof(global::Google.Cloud.Firestore.V1.StructuredAggregationQuery), global::Google.Cloud.Firestore.V1.StructuredAggregationQuery.Parser, new[]{ "StructuredQuery", "Aggregations" }, new[]{ "QueryType" }, null, null, new pbr::GeneratedClrTypeInfo[] { new pbr::GeneratedClrTypeInfo(typeof(global::Google.Cloud.Firestore.V1.StructuredAggregationQuery.Types.Aggregation), global::Google.Cloud.Firestore.V1.StructuredAggregationQuery.Types.Aggregation.Parser, new[]{ "Count", "Sum", "Avg", "Alias" }, new[]{ "Operator" }, null, null, new pbr::GeneratedClrTypeInfo[] { new pbr::GeneratedClrTypeInfo(typeof(global::Google.Cloud.Firestore.V1.StructuredAggregationQuery.Types.Aggregation.Types.Count), global::Google.Cloud.Firestore.V1.StructuredAggregationQuery.Types.Aggregation.Types.Count.Parser, new[]{ "UpTo" }, null, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::Google.Cloud.Firestore.V1.StructuredAggregationQuery.Types.Aggregation.Types.Sum), global::Google.Cloud.Firestore.V1.StructuredAggregationQuery.Types.Aggregation.Types.Sum.Parser, new[]{ "Field" }, null, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::Google.Cloud.Firestore.V1.StructuredAggregationQuery.Types.Aggregation.Types.Avg), global::Google.Cloud.Firestore.V1.StructuredAggregationQuery.Types.Aggregation.Types.Avg.Parser, new[]{ "Field" }, null, null, null, null)})}), new pbr::GeneratedClrTypeInfo(typeof(global::Google.Cloud.Firestore.V1.Cursor), global::Google.Cloud.Firestore.V1.Cursor.Parser, new[]{ "Values", "Before" }, null, null, null, null) })); } @@ -3209,6 +3218,12 @@ public sealed partial class Aggregation : pb::IMessage case OperatorOneofCase.Count: Count = other.Count.Clone(); break; + case OperatorOneofCase.Sum: + Sum = other.Sum.Clone(); + break; + case OperatorOneofCase.Avg: + Avg = other.Avg.Clone(); + break; } _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); @@ -3235,6 +3250,36 @@ public sealed partial class Aggregation : pb::IMessage } } + /// Field number for the "sum" field. + public const int SumFieldNumber = 2; + /// + /// Sum aggregator. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public global::Google.Cloud.Firestore.V1.StructuredAggregationQuery.Types.Aggregation.Types.Sum Sum { + get { return operatorCase_ == OperatorOneofCase.Sum ? (global::Google.Cloud.Firestore.V1.StructuredAggregationQuery.Types.Aggregation.Types.Sum) operator_ : null; } + set { + operator_ = value; + operatorCase_ = value == null ? OperatorOneofCase.None : OperatorOneofCase.Sum; + } + } + + /// Field number for the "avg" field. + public const int AvgFieldNumber = 3; + /// + /// Average aggregator. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public global::Google.Cloud.Firestore.V1.StructuredAggregationQuery.Types.Aggregation.Types.Avg Avg { + get { return operatorCase_ == OperatorOneofCase.Avg ? (global::Google.Cloud.Firestore.V1.StructuredAggregationQuery.Types.Aggregation.Types.Avg) operator_ : null; } + set { + operator_ = value; + operatorCase_ = value == null ? OperatorOneofCase.None : OperatorOneofCase.Avg; + } + } + /// Field number for the "alias" field. public const int AliasFieldNumber = 7; private string alias_ = ""; @@ -3289,6 +3334,8 @@ public sealed partial class Aggregation : pb::IMessage public enum OperatorOneofCase { None = 0, Count = 1, + Sum = 2, + Avg = 3, } private OperatorOneofCase operatorCase_ = OperatorOneofCase.None; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] @@ -3320,6 +3367,8 @@ public enum OperatorOneofCase { return true; } if (!object.Equals(Count, other.Count)) return false; + if (!object.Equals(Sum, other.Sum)) return false; + if (!object.Equals(Avg, other.Avg)) return false; if (Alias != other.Alias) return false; if (OperatorCase != other.OperatorCase) return false; return Equals(_unknownFields, other._unknownFields); @@ -3330,6 +3379,8 @@ public enum OperatorOneofCase { public override int GetHashCode() { int hash = 1; if (operatorCase_ == OperatorOneofCase.Count) hash ^= Count.GetHashCode(); + if (operatorCase_ == OperatorOneofCase.Sum) hash ^= Sum.GetHashCode(); + if (operatorCase_ == OperatorOneofCase.Avg) hash ^= Avg.GetHashCode(); if (Alias.Length != 0) hash ^= Alias.GetHashCode(); hash ^= (int) operatorCase_; if (_unknownFields != null) { @@ -3354,6 +3405,14 @@ public enum OperatorOneofCase { output.WriteRawTag(10); output.WriteMessage(Count); } + if (operatorCase_ == OperatorOneofCase.Sum) { + output.WriteRawTag(18); + output.WriteMessage(Sum); + } + if (operatorCase_ == OperatorOneofCase.Avg) { + output.WriteRawTag(26); + output.WriteMessage(Avg); + } if (Alias.Length != 0) { output.WriteRawTag(58); output.WriteString(Alias); @@ -3372,6 +3431,14 @@ public enum OperatorOneofCase { output.WriteRawTag(10); output.WriteMessage(Count); } + if (operatorCase_ == OperatorOneofCase.Sum) { + output.WriteRawTag(18); + output.WriteMessage(Sum); + } + if (operatorCase_ == OperatorOneofCase.Avg) { + output.WriteRawTag(26); + output.WriteMessage(Avg); + } if (Alias.Length != 0) { output.WriteRawTag(58); output.WriteString(Alias); @@ -3389,6 +3456,12 @@ public enum OperatorOneofCase { if (operatorCase_ == OperatorOneofCase.Count) { size += 1 + pb::CodedOutputStream.ComputeMessageSize(Count); } + if (operatorCase_ == OperatorOneofCase.Sum) { + size += 1 + pb::CodedOutputStream.ComputeMessageSize(Sum); + } + if (operatorCase_ == OperatorOneofCase.Avg) { + size += 1 + pb::CodedOutputStream.ComputeMessageSize(Avg); + } if (Alias.Length != 0) { size += 1 + pb::CodedOutputStream.ComputeStringSize(Alias); } @@ -3414,6 +3487,18 @@ public enum OperatorOneofCase { } Count.MergeFrom(other.Count); break; + case OperatorOneofCase.Sum: + if (Sum == null) { + Sum = new global::Google.Cloud.Firestore.V1.StructuredAggregationQuery.Types.Aggregation.Types.Sum(); + } + Sum.MergeFrom(other.Sum); + break; + case OperatorOneofCase.Avg: + if (Avg == null) { + Avg = new global::Google.Cloud.Firestore.V1.StructuredAggregationQuery.Types.Aggregation.Types.Avg(); + } + Avg.MergeFrom(other.Avg); + break; } _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); @@ -3440,6 +3525,24 @@ public enum OperatorOneofCase { Count = subBuilder; break; } + case 18: { + global::Google.Cloud.Firestore.V1.StructuredAggregationQuery.Types.Aggregation.Types.Sum subBuilder = new global::Google.Cloud.Firestore.V1.StructuredAggregationQuery.Types.Aggregation.Types.Sum(); + if (operatorCase_ == OperatorOneofCase.Sum) { + subBuilder.MergeFrom(Sum); + } + input.ReadMessage(subBuilder); + Sum = subBuilder; + break; + } + case 26: { + global::Google.Cloud.Firestore.V1.StructuredAggregationQuery.Types.Aggregation.Types.Avg subBuilder = new global::Google.Cloud.Firestore.V1.StructuredAggregationQuery.Types.Aggregation.Types.Avg(); + if (operatorCase_ == OperatorOneofCase.Avg) { + subBuilder.MergeFrom(Avg); + } + input.ReadMessage(subBuilder); + Avg = subBuilder; + break; + } case 58: { Alias = input.ReadString(); break; @@ -3468,6 +3571,24 @@ public enum OperatorOneofCase { Count = subBuilder; break; } + case 18: { + global::Google.Cloud.Firestore.V1.StructuredAggregationQuery.Types.Aggregation.Types.Sum subBuilder = new global::Google.Cloud.Firestore.V1.StructuredAggregationQuery.Types.Aggregation.Types.Sum(); + if (operatorCase_ == OperatorOneofCase.Sum) { + subBuilder.MergeFrom(Sum); + } + input.ReadMessage(subBuilder); + Sum = subBuilder; + break; + } + case 26: { + global::Google.Cloud.Firestore.V1.StructuredAggregationQuery.Types.Aggregation.Types.Avg subBuilder = new global::Google.Cloud.Firestore.V1.StructuredAggregationQuery.Types.Aggregation.Types.Avg(); + if (operatorCase_ == OperatorOneofCase.Avg) { + subBuilder.MergeFrom(Avg); + } + input.ReadMessage(subBuilder); + Avg = subBuilder; + break; + } case 58: { Alias = input.ReadString(); break; @@ -3704,6 +3825,444 @@ public sealed partial class Count : pb::IMessage } + /// + /// Sum of the values of the requested field. + /// + /// * Only numeric values will be aggregated. All non-numeric values + /// including `NULL` are skipped. + /// + /// * If the aggregated values contain `NaN`, returns `NaN`. Infinity math + /// follows IEEE-754 standards. + /// + /// * If the aggregated value set is empty, returns 0. + /// + /// * Returns a 64-bit integer if all aggregated numbers are integers and the + /// sum result does not overflow. Otherwise, the result is returned as a + /// double. Note that even if all the aggregated values are integers, the + /// result is returned as a double if it cannot fit within a 64-bit signed + /// integer. When this occurs, the returned value will lose precision. + /// + /// * When underflow occurs, floating-point aggregation is non-deterministic. + /// This means that running the same query repeatedly without any changes to + /// the underlying values could produce slightly different results each + /// time. In those cases, values should be stored as integers over + /// floating-point numbers. + /// + public sealed partial class Sum : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new Sum()); + private pb::UnknownFieldSet _unknownFields; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pbr::MessageDescriptor Descriptor { + get { return global::Google.Cloud.Firestore.V1.StructuredAggregationQuery.Types.Aggregation.Descriptor.NestedTypes[1]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public Sum() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public Sum(Sum other) : this() { + field_ = other.field_ != null ? other.field_.Clone() : null; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public Sum Clone() { + return new Sum(this); + } + + /// Field number for the "field" field. + public const int FieldFieldNumber = 1; + private global::Google.Cloud.Firestore.V1.StructuredQuery.Types.FieldReference field_; + /// + /// The field to aggregate on. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public global::Google.Cloud.Firestore.V1.StructuredQuery.Types.FieldReference Field { + get { return field_; } + set { + field_ = value; + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override bool Equals(object other) { + return Equals(other as Sum); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool Equals(Sum other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (!object.Equals(Field, other.Field)) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override int GetHashCode() { + int hash = 1; + if (field_ != null) hash ^= Field.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else + if (field_ != null) { + output.WriteRawTag(10); + output.WriteMessage(Field); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (field_ != null) { + output.WriteRawTag(10); + output.WriteMessage(Field); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int CalculateSize() { + int size = 0; + if (field_ != null) { + size += 1 + pb::CodedOutputStream.ComputeMessageSize(Field); + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(Sum other) { + if (other == null) { + return; + } + if (other.field_ != null) { + if (field_ == null) { + Field = new global::Google.Cloud.Firestore.V1.StructuredQuery.Types.FieldReference(); + } + Field.MergeFrom(other.Field); + } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 10: { + if (field_ == null) { + Field = new global::Google.Cloud.Firestore.V1.StructuredQuery.Types.FieldReference(); + } + input.ReadMessage(Field); + break; + } + } + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 10: { + if (field_ == null) { + Field = new global::Google.Cloud.Firestore.V1.StructuredQuery.Types.FieldReference(); + } + input.ReadMessage(Field); + break; + } + } + } + } + #endif + + } + + /// + /// Average of the values of the requested field. + /// + /// * Only numeric values will be aggregated. All non-numeric values + /// including `NULL` are skipped. + /// + /// * If the aggregated values contain `NaN`, returns `NaN`. Infinity math + /// follows IEEE-754 standards. + /// + /// * If the aggregated value set is empty, returns `NULL`. + /// + /// * Always returns the result as a double. + /// + public sealed partial class Avg : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new Avg()); + private pb::UnknownFieldSet _unknownFields; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pbr::MessageDescriptor Descriptor { + get { return global::Google.Cloud.Firestore.V1.StructuredAggregationQuery.Types.Aggregation.Descriptor.NestedTypes[2]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public Avg() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public Avg(Avg other) : this() { + field_ = other.field_ != null ? other.field_.Clone() : null; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public Avg Clone() { + return new Avg(this); + } + + /// Field number for the "field" field. + public const int FieldFieldNumber = 1; + private global::Google.Cloud.Firestore.V1.StructuredQuery.Types.FieldReference field_; + /// + /// The field to aggregate on. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public global::Google.Cloud.Firestore.V1.StructuredQuery.Types.FieldReference Field { + get { return field_; } + set { + field_ = value; + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override bool Equals(object other) { + return Equals(other as Avg); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool Equals(Avg other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (!object.Equals(Field, other.Field)) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override int GetHashCode() { + int hash = 1; + if (field_ != null) hash ^= Field.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else + if (field_ != null) { + output.WriteRawTag(10); + output.WriteMessage(Field); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (field_ != null) { + output.WriteRawTag(10); + output.WriteMessage(Field); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int CalculateSize() { + int size = 0; + if (field_ != null) { + size += 1 + pb::CodedOutputStream.ComputeMessageSize(Field); + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(Avg other) { + if (other == null) { + return; + } + if (other.field_ != null) { + if (field_ == null) { + Field = new global::Google.Cloud.Firestore.V1.StructuredQuery.Types.FieldReference(); + } + Field.MergeFrom(other.Field); + } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 10: { + if (field_ == null) { + Field = new global::Google.Cloud.Firestore.V1.StructuredQuery.Types.FieldReference(); + } + input.ReadMessage(Field); + break; + } + } + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 10: { + if (field_ == null) { + Field = new global::Google.Cloud.Firestore.V1.StructuredQuery.Types.FieldReference(); + } + input.ReadMessage(Field); + break; + } + } + } + } + #endif + + } + } #endregion diff --git a/apis/Google.Cloud.Firestore.V1/Google.Cloud.Firestore.V1/Write.g.cs b/apis/Google.Cloud.Firestore.V1/Google.Cloud.Firestore.V1/Write.g.cs index 12fc96a5f070..dc8215f45639 100644 --- a/apis/Google.Cloud.Firestore.V1/Google.Cloud.Firestore.V1/Write.g.cs +++ b/apis/Google.Cloud.Firestore.V1/Google.Cloud.Firestore.V1/Write.g.cs @@ -2611,7 +2611,9 @@ public sealed partial class ExistenceFilter : pb::IMessage /// client must manually determine which documents no longer match the target. /// /// The client can use the `unchanged_names` bloom filter to assist with - /// this determination. + /// this determination by testing ALL the document names against the filter; + /// if the document name is NOT in the filter, it means the document no + /// longer matches the target. /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute] [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] @@ -2626,12 +2628,10 @@ public sealed partial class ExistenceFilter : pb::IMessage public const int UnchangedNamesFieldNumber = 3; private global::Google.Cloud.Firestore.V1.BloomFilter unchangedNames_; /// - /// A bloom filter that contains the UTF-8 byte encodings of the resource names - /// of the documents that match + /// A bloom filter that, despite its name, contains the UTF-8 byte encodings of + /// the resource names of ALL the documents that match /// [target_id][google.firestore.v1.ExistenceFilter.target_id], in the form - /// `projects/{project_id}/databases/{database_id}/documents/{document_path}` - /// that have NOT changed since the query results indicated by the resume token - /// or timestamp given in `Target.resume_type`. + /// `projects/{project_id}/databases/{database_id}/documents/{document_path}`. /// /// This bloom filter may be omitted at the server's discretion, such as if it /// is deemed that the client will not make use of it or if it is too