Skip to content

Commit 954320a

Browse files
feat: publish proto definitions for SUM/AVG in Datastore (#1157)
* feat: publish proto definitions for SUM/AVG in Datastore PiperOrigin-RevId: 552847139 Source-Link: googleapis/googleapis@6148e5b Source-Link: https://github.com/googleapis/googleapis-gen/commit/96be51b995047bfdef4825178539e238583101a9 Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiOTZiZTUxYjk5NTA0N2JmZGVmNDgyNTE3ODUzOWUyMzg1ODMxMDFhOSJ9 * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md --------- Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com>
1 parent c8cc09a commit 954320a

File tree

8 files changed

+3147
-761
lines changed

8 files changed

+3147
-761
lines changed

proto-google-cloud-datastore-v1/src/main/java/com/google/datastore/v1/AggregationQuery.java

+2,829-625
Large diffs are not rendered by default.

proto-google-cloud-datastore-v1/src/main/java/com/google/datastore/v1/PropertyFilter.java

+10-8
Original file line numberDiff line numberDiff line change
@@ -156,8 +156,9 @@ public enum Operator implements com.google.protobuf.ProtocolMessageEnum {
156156
*
157157
* Requires:
158158
*
159-
* * That `value` is a non-empty `ArrayValue` with at most 10 values.
160-
* * No other `IN` or `NOT_IN` is in the same query.
159+
* * That `value` is a non-empty `ArrayValue`, subject to disjunction
160+
* limits.
161+
* * No `NOT_IN` is in the same query.
161162
* </pre>
162163
*
163164
* <code>IN = 6;</code>
@@ -187,7 +188,7 @@ public enum Operator implements com.google.protobuf.ProtocolMessageEnum {
187188
* Requires:
188189
*
189190
* * That `value` is an entity key.
190-
* * No other `HAS_ANCESTOR` is in the same query.
191+
* * All evaluated disjunctions must have the same `HAS_ANCESTOR` filter.
191192
* </pre>
192193
*
193194
* <code>HAS_ANCESTOR = 11;</code>
@@ -202,7 +203,7 @@ public enum Operator implements com.google.protobuf.ProtocolMessageEnum {
202203
* Requires:
203204
*
204205
* * That `value` is a non-empty `ArrayValue` with at most 10 values.
205-
* * No other `IN`, `NOT_IN`, `NOT_EQUAL` is in the same query.
206+
* * No other `OR`, `IN`, `NOT_IN`, `NOT_EQUAL` is in the same query.
206207
* * That `field` comes first in the `order_by`.
207208
* </pre>
208209
*
@@ -296,8 +297,9 @@ public enum Operator implements com.google.protobuf.ProtocolMessageEnum {
296297
*
297298
* Requires:
298299
*
299-
* * That `value` is a non-empty `ArrayValue` with at most 10 values.
300-
* * No other `IN` or `NOT_IN` is in the same query.
300+
* * That `value` is a non-empty `ArrayValue`, subject to disjunction
301+
* limits.
302+
* * No `NOT_IN` is in the same query.
301303
* </pre>
302304
*
303305
* <code>IN = 6;</code>
@@ -327,7 +329,7 @@ public enum Operator implements com.google.protobuf.ProtocolMessageEnum {
327329
* Requires:
328330
*
329331
* * That `value` is an entity key.
330-
* * No other `HAS_ANCESTOR` is in the same query.
332+
* * All evaluated disjunctions must have the same `HAS_ANCESTOR` filter.
331333
* </pre>
332334
*
333335
* <code>HAS_ANCESTOR = 11;</code>
@@ -342,7 +344,7 @@ public enum Operator implements com.google.protobuf.ProtocolMessageEnum {
342344
* Requires:
343345
*
344346
* * That `value` is a non-empty `ArrayValue` with at most 10 values.
345-
* * No other `IN`, `NOT_IN`, `NOT_EQUAL` is in the same query.
347+
* * No other `OR`, `IN`, `NOT_IN`, `NOT_EQUAL` is in the same query.
346348
* * That `field` comes first in the `order_by`.
347349
* </pre>
348350
*

proto-google-cloud-datastore-v1/src/main/java/com/google/datastore/v1/QueryProto.java

+95-60
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,14 @@ public static void registerAllExtensions(com.google.protobuf.ExtensionRegistry r
4747
internal_static_google_datastore_v1_AggregationQuery_Aggregation_Count_descriptor;
4848
static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
4949
internal_static_google_datastore_v1_AggregationQuery_Aggregation_Count_fieldAccessorTable;
50+
static final com.google.protobuf.Descriptors.Descriptor
51+
internal_static_google_datastore_v1_AggregationQuery_Aggregation_Sum_descriptor;
52+
static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
53+
internal_static_google_datastore_v1_AggregationQuery_Aggregation_Sum_fieldAccessorTable;
54+
static final com.google.protobuf.Descriptors.Descriptor
55+
internal_static_google_datastore_v1_AggregationQuery_Aggregation_Avg_descriptor;
56+
static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
57+
internal_static_google_datastore_v1_AggregationQuery_Aggregation_Avg_fieldAccessorTable;
5058
static final com.google.protobuf.Descriptors.Descriptor
5159
internal_static_google_datastore_v1_KindExpression_descriptor;
5260
static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
@@ -120,70 +128,77 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() {
120128
+ "inct_on\030\006 \003(\0132&.google.datastore.v1.Prop"
121129
+ "ertyReference\022\024\n\014start_cursor\030\007 \001(\014\022\022\n\ne"
122130
+ "nd_cursor\030\010 \001(\014\022\016\n\006offset\030\n \001(\005\022*\n\005limit"
123-
+ "\030\014 \001(\0132\033.google.protobuf.Int32Value\"\331\002\n\020"
131+
+ "\030\014 \001(\0132\033.google.protobuf.Int32Value\"\347\004\n\020"
124132
+ "AggregationQuery\0222\n\014nested_query\030\001 \001(\0132\032"
125133
+ ".google.datastore.v1.QueryH\000\022M\n\014aggregat"
126134
+ "ions\030\003 \003(\01321.google.datastore.v1.Aggrega"
127-
+ "tionQuery.AggregationB\004\342A\001\001\032\263\001\n\013Aggregat"
135+
+ "tionQuery.AggregationB\004\342A\001\001\032\301\003\n\013Aggregat"
128136
+ "ion\022H\n\005count\030\001 \001(\01327.google.datastore.v1"
129-
+ ".AggregationQuery.Aggregation.CountH\000\022\023\n"
130-
+ "\005alias\030\007 \001(\tB\004\342A\001\001\0329\n\005Count\0220\n\005up_to\030\001 \001"
131-
+ "(\0132\033.google.protobuf.Int64ValueB\004\342A\001\001B\n\n"
132-
+ "\010operatorB\014\n\nquery_type\"\036\n\016KindExpressio"
133-
+ "n\022\014\n\004name\030\001 \001(\t\"!\n\021PropertyReference\022\014\n\004"
134-
+ "name\030\002 \001(\t\"F\n\nProjection\0228\n\010property\030\001 \001"
137+
+ ".AggregationQuery.Aggregation.CountH\000\022D\n"
138+
+ "\003sum\030\002 \001(\01325.google.datastore.v1.Aggrega"
139+
+ "tionQuery.Aggregation.SumH\000\022D\n\003avg\030\003 \001(\013"
140+
+ "25.google.datastore.v1.AggregationQuery."
141+
+ "Aggregation.AvgH\000\022\023\n\005alias\030\007 \001(\tB\004\342A\001\001\0329"
142+
+ "\n\005Count\0220\n\005up_to\030\001 \001(\0132\033.google.protobuf"
143+
+ ".Int64ValueB\004\342A\001\001\032?\n\003Sum\0228\n\010property\030\001 \001"
135144
+ "(\0132&.google.datastore.v1.PropertyReferen"
136-
+ "ce\"\321\001\n\rPropertyOrder\0228\n\010property\030\001 \001(\0132&"
137-
+ ".google.datastore.v1.PropertyReference\022?"
138-
+ "\n\tdirection\030\002 \001(\0162,.google.datastore.v1."
139-
+ "PropertyOrder.Direction\"E\n\tDirection\022\031\n\025"
140-
+ "DIRECTION_UNSPECIFIED\020\000\022\r\n\tASCENDING\020\001\022\016"
141-
+ "\n\nDESCENDING\020\002\"\231\001\n\006Filter\022@\n\020composite_f"
142-
+ "ilter\030\001 \001(\0132$.google.datastore.v1.Compos"
143-
+ "iteFilterH\000\022>\n\017property_filter\030\002 \001(\0132#.g"
144-
+ "oogle.datastore.v1.PropertyFilterH\000B\r\n\013f"
145-
+ "ilter_type\"\261\001\n\017CompositeFilter\0229\n\002op\030\001 \001"
146-
+ "(\0162-.google.datastore.v1.CompositeFilter"
147-
+ ".Operator\022,\n\007filters\030\002 \003(\0132\033.google.data"
148-
+ "store.v1.Filter\"5\n\010Operator\022\030\n\024OPERATOR_"
149-
+ "UNSPECIFIED\020\000\022\007\n\003AND\020\001\022\006\n\002OR\020\002\"\352\002\n\016Prope"
150-
+ "rtyFilter\0228\n\010property\030\001 \001(\0132&.google.dat"
151-
+ "astore.v1.PropertyReference\0228\n\002op\030\002 \001(\0162"
152-
+ ",.google.datastore.v1.PropertyFilter.Ope"
153-
+ "rator\022)\n\005value\030\003 \001(\0132\032.google.datastore."
154-
+ "v1.Value\"\270\001\n\010Operator\022\030\n\024OPERATOR_UNSPEC"
155-
+ "IFIED\020\000\022\r\n\tLESS_THAN\020\001\022\026\n\022LESS_THAN_OR_E"
156-
+ "QUAL\020\002\022\020\n\014GREATER_THAN\020\003\022\031\n\025GREATER_THAN"
157-
+ "_OR_EQUAL\020\004\022\t\n\005EQUAL\020\005\022\006\n\002IN\020\006\022\r\n\tNOT_EQ"
158-
+ "UAL\020\t\022\020\n\014HAS_ANCESTOR\020\013\022\n\n\006NOT_IN\020\r\"\245\002\n\010"
159-
+ "GqlQuery\022\024\n\014query_string\030\001 \001(\t\022\026\n\016allow_"
160-
+ "literals\030\002 \001(\010\022H\n\016named_bindings\030\005 \003(\01320"
161-
+ ".google.datastore.v1.GqlQuery.NamedBindi"
162-
+ "ngsEntry\022C\n\023positional_bindings\030\004 \003(\0132&."
163-
+ "google.datastore.v1.GqlQueryParameter\032\\\n"
164-
+ "\022NamedBindingsEntry\022\013\n\003key\030\001 \001(\t\0225\n\005valu"
165-
+ "e\030\002 \001(\0132&.google.datastore.v1.GqlQueryPa"
166-
+ "rameter:\0028\001\"d\n\021GqlQueryParameter\022+\n\005valu"
167-
+ "e\030\002 \001(\0132\032.google.datastore.v1.ValueH\000\022\020\n"
168-
+ "\006cursor\030\003 \001(\014H\000B\020\n\016parameter_type\"\215\004\n\020Qu"
169-
+ "eryResultBatch\022\027\n\017skipped_results\030\006 \001(\005\022"
170-
+ "\026\n\016skipped_cursor\030\003 \001(\014\022H\n\022entity_result"
171-
+ "_type\030\001 \001(\0162,.google.datastore.v1.Entity"
172-
+ "Result.ResultType\0229\n\016entity_results\030\002 \003("
173-
+ "\0132!.google.datastore.v1.EntityResult\022\022\n\n"
174-
+ "end_cursor\030\004 \001(\014\022K\n\014more_results\030\005 \001(\01625"
175-
+ ".google.datastore.v1.QueryResultBatch.Mo"
176-
+ "reResultsType\022\030\n\020snapshot_version\030\007 \001(\003\022"
177-
+ "-\n\tread_time\030\010 \001(\0132\032.google.protobuf.Tim"
178-
+ "estamp\"\230\001\n\017MoreResultsType\022!\n\035MORE_RESUL"
179-
+ "TS_TYPE_UNSPECIFIED\020\000\022\020\n\014NOT_FINISHED\020\001\022"
180-
+ "\034\n\030MORE_RESULTS_AFTER_LIMIT\020\002\022\035\n\031MORE_RE"
181-
+ "SULTS_AFTER_CURSOR\020\004\022\023\n\017NO_MORE_RESULTS\020"
182-
+ "\003B\274\001\n\027com.google.datastore.v1B\nQueryProt"
183-
+ "oP\001Z<google.golang.org/genproto/googleap"
184-
+ "is/datastore/v1;datastore\252\002\031Google.Cloud"
185-
+ ".Datastore.V1\312\002\031Google\\Cloud\\Datastore\\V"
186-
+ "1\352\002\034Google::Cloud::Datastore::V1b\006proto3"
145+
+ "ce\032?\n\003Avg\0228\n\010property\030\001 \001(\0132&.google.dat"
146+
+ "astore.v1.PropertyReferenceB\n\n\010operatorB"
147+
+ "\014\n\nquery_type\"\036\n\016KindExpression\022\014\n\004name\030"
148+
+ "\001 \001(\t\"!\n\021PropertyReference\022\014\n\004name\030\002 \001(\t"
149+
+ "\"F\n\nProjection\0228\n\010property\030\001 \001(\0132&.googl"
150+
+ "e.datastore.v1.PropertyReference\"\321\001\n\rPro"
151+
+ "pertyOrder\0228\n\010property\030\001 \001(\0132&.google.da"
152+
+ "tastore.v1.PropertyReference\022?\n\tdirectio"
153+
+ "n\030\002 \001(\0162,.google.datastore.v1.PropertyOr"
154+
+ "der.Direction\"E\n\tDirection\022\031\n\025DIRECTION_"
155+
+ "UNSPECIFIED\020\000\022\r\n\tASCENDING\020\001\022\016\n\nDESCENDI"
156+
+ "NG\020\002\"\231\001\n\006Filter\022@\n\020composite_filter\030\001 \001("
157+
+ "\0132$.google.datastore.v1.CompositeFilterH"
158+
+ "\000\022>\n\017property_filter\030\002 \001(\0132#.google.data"
159+
+ "store.v1.PropertyFilterH\000B\r\n\013filter_type"
160+
+ "\"\261\001\n\017CompositeFilter\0229\n\002op\030\001 \001(\0162-.googl"
161+
+ "e.datastore.v1.CompositeFilter.Operator\022"
162+
+ ",\n\007filters\030\002 \003(\0132\033.google.datastore.v1.F"
163+
+ "ilter\"5\n\010Operator\022\030\n\024OPERATOR_UNSPECIFIE"
164+
+ "D\020\000\022\007\n\003AND\020\001\022\006\n\002OR\020\002\"\352\002\n\016PropertyFilter\022"
165+
+ "8\n\010property\030\001 \001(\0132&.google.datastore.v1."
166+
+ "PropertyReference\0228\n\002op\030\002 \001(\0162,.google.d"
167+
+ "atastore.v1.PropertyFilter.Operator\022)\n\005v"
168+
+ "alue\030\003 \001(\0132\032.google.datastore.v1.Value\"\270"
169+
+ "\001\n\010Operator\022\030\n\024OPERATOR_UNSPECIFIED\020\000\022\r\n"
170+
+ "\tLESS_THAN\020\001\022\026\n\022LESS_THAN_OR_EQUAL\020\002\022\020\n\014"
171+
+ "GREATER_THAN\020\003\022\031\n\025GREATER_THAN_OR_EQUAL\020"
172+
+ "\004\022\t\n\005EQUAL\020\005\022\006\n\002IN\020\006\022\r\n\tNOT_EQUAL\020\t\022\020\n\014H"
173+
+ "AS_ANCESTOR\020\013\022\n\n\006NOT_IN\020\r\"\245\002\n\010GqlQuery\022\024"
174+
+ "\n\014query_string\030\001 \001(\t\022\026\n\016allow_literals\030\002"
175+
+ " \001(\010\022H\n\016named_bindings\030\005 \003(\01320.google.da"
176+
+ "tastore.v1.GqlQuery.NamedBindingsEntry\022C"
177+
+ "\n\023positional_bindings\030\004 \003(\0132&.google.dat"
178+
+ "astore.v1.GqlQueryParameter\032\\\n\022NamedBind"
179+
+ "ingsEntry\022\013\n\003key\030\001 \001(\t\0225\n\005value\030\002 \001(\0132&."
180+
+ "google.datastore.v1.GqlQueryParameter:\0028"
181+
+ "\001\"d\n\021GqlQueryParameter\022+\n\005value\030\002 \001(\0132\032."
182+
+ "google.datastore.v1.ValueH\000\022\020\n\006cursor\030\003 "
183+
+ "\001(\014H\000B\020\n\016parameter_type\"\215\004\n\020QueryResultB"
184+
+ "atch\022\027\n\017skipped_results\030\006 \001(\005\022\026\n\016skipped"
185+
+ "_cursor\030\003 \001(\014\022H\n\022entity_result_type\030\001 \001("
186+
+ "\0162,.google.datastore.v1.EntityResult.Res"
187+
+ "ultType\0229\n\016entity_results\030\002 \003(\0132!.google"
188+
+ ".datastore.v1.EntityResult\022\022\n\nend_cursor"
189+
+ "\030\004 \001(\014\022K\n\014more_results\030\005 \001(\01625.google.da"
190+
+ "tastore.v1.QueryResultBatch.MoreResultsT"
191+
+ "ype\022\030\n\020snapshot_version\030\007 \001(\003\022-\n\tread_ti"
192+
+ "me\030\010 \001(\0132\032.google.protobuf.Timestamp\"\230\001\n"
193+
+ "\017MoreResultsType\022!\n\035MORE_RESULTS_TYPE_UN"
194+
+ "SPECIFIED\020\000\022\020\n\014NOT_FINISHED\020\001\022\034\n\030MORE_RE"
195+
+ "SULTS_AFTER_LIMIT\020\002\022\035\n\031MORE_RESULTS_AFTE"
196+
+ "R_CURSOR\020\004\022\023\n\017NO_MORE_RESULTS\020\003B\274\001\n\027com."
197+
+ "google.datastore.v1B\nQueryProtoP\001Z<googl"
198+
+ "e.golang.org/genproto/googleapis/datasto"
199+
+ "re/v1;datastore\252\002\031Google.Cloud.Datastore"
200+
+ ".V1\312\002\031Google\\Cloud\\Datastore\\V1\352\002\034Google"
201+
+ "::Cloud::Datastore::V1b\006proto3"
187202
};
188203
descriptor =
189204
com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom(
@@ -231,7 +246,7 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() {
231246
new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable(
232247
internal_static_google_datastore_v1_AggregationQuery_Aggregation_descriptor,
233248
new java.lang.String[] {
234-
"Count", "Alias", "Operator",
249+
"Count", "Sum", "Avg", "Alias", "Operator",
235250
});
236251
internal_static_google_datastore_v1_AggregationQuery_Aggregation_Count_descriptor =
237252
internal_static_google_datastore_v1_AggregationQuery_Aggregation_descriptor
@@ -243,6 +258,26 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() {
243258
new java.lang.String[] {
244259
"UpTo",
245260
});
261+
internal_static_google_datastore_v1_AggregationQuery_Aggregation_Sum_descriptor =
262+
internal_static_google_datastore_v1_AggregationQuery_Aggregation_descriptor
263+
.getNestedTypes()
264+
.get(1);
265+
internal_static_google_datastore_v1_AggregationQuery_Aggregation_Sum_fieldAccessorTable =
266+
new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable(
267+
internal_static_google_datastore_v1_AggregationQuery_Aggregation_Sum_descriptor,
268+
new java.lang.String[] {
269+
"Property",
270+
});
271+
internal_static_google_datastore_v1_AggregationQuery_Aggregation_Avg_descriptor =
272+
internal_static_google_datastore_v1_AggregationQuery_Aggregation_descriptor
273+
.getNestedTypes()
274+
.get(2);
275+
internal_static_google_datastore_v1_AggregationQuery_Aggregation_Avg_fieldAccessorTable =
276+
new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable(
277+
internal_static_google_datastore_v1_AggregationQuery_Aggregation_Avg_descriptor,
278+
new java.lang.String[] {
279+
"Property",
280+
});
246281
internal_static_google_datastore_v1_KindExpression_descriptor =
247282
getDescriptor().getMessageTypes().get(3);
248283
internal_static_google_datastore_v1_KindExpression_fieldAccessorTable =

0 commit comments

Comments
 (0)