Skip to content

Commit fd91a43

Browse files
1 parent 6e9d25b commit fd91a43

File tree

10 files changed

+494
-14
lines changed

10 files changed

+494
-14
lines changed

clients/google-api-services-datastore/v1/2.0.0/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ Add the following lines to your `pom.xml` file:
2222
<dependency>
2323
<groupId>com.google.apis</groupId>
2424
<artifactId>google-api-services-datastore</artifactId>
25-
<version>v1-rev20241008-2.0.0</version>
25+
<version>v1-rev20241018-2.0.0</version>
2626
</dependency>
2727
</dependencies>
2828
</project>
@@ -35,7 +35,7 @@ repositories {
3535
mavenCentral()
3636
}
3737
dependencies {
38-
implementation 'com.google.apis:google-api-services-datastore:v1-rev20241008-2.0.0'
38+
implementation 'com.google.apis:google-api-services-datastore:v1-rev20241018-2.0.0'
3939
}
4040
```
4141

Lines changed: 212 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,212 @@
1+
/*
2+
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
3+
* in compliance with the License. You may obtain a copy of the License at
4+
*
5+
* http://www.apache.org/licenses/LICENSE-2.0
6+
*
7+
* Unless required by applicable law or agreed to in writing, software distributed under the License
8+
* is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
9+
* or implied. See the License for the specific language governing permissions and limitations under
10+
* the License.
11+
*/
12+
/*
13+
* This code was generated by https://github.com/googleapis/google-api-java-client-services/
14+
* Modify at your own risk.
15+
*/
16+
17+
package com.google.api.services.datastore.v1.model;
18+
19+
/**
20+
* Nearest Neighbors search config. The ordering provided by FindNearest supersedes the order_by
21+
* stage. If multiple documents have the same vector distance, the returned document order is not
22+
* guaranteed to be stable between queries.
23+
*
24+
* <p> This is the Java data model class that specifies how to parse/serialize into the JSON that is
25+
* transmitted over HTTP when working with the Cloud Datastore API. For a detailed explanation see:
26+
* <a href="https://developers.google.com/api-client-library/java/google-http-java-client/json">https://developers.google.com/api-client-library/java/google-http-java-client/json</a>
27+
* </p>
28+
*
29+
* @author Google, Inc.
30+
*/
31+
@SuppressWarnings("javadoc")
32+
public final class FindNearest extends com.google.api.client.json.GenericJson {
33+
34+
/**
35+
* Required. The Distance Measure to use, required.
36+
* The value may be {@code null}.
37+
*/
38+
@com.google.api.client.util.Key
39+
private java.lang.String distanceMeasure;
40+
41+
/**
42+
* Optional. Optional name of the field to output the result of the vector distance calculation.
43+
* Must conform to entity property limitations.
44+
* The value may be {@code null}.
45+
*/
46+
@com.google.api.client.util.Key
47+
private java.lang.String distanceResultProperty;
48+
49+
/**
50+
* Optional. Option to specify a threshold for which no less similar documents will be returned.
51+
* The behavior of the specified `distance_measure` will affect the meaning of the distance
52+
* threshold. Since DOT_PRODUCT distances increase when the vectors are more similar, the
53+
* comparison is inverted. * For EUCLIDEAN, COSINE: WHERE distance <= distance_threshold * For
54+
* DOT_PRODUCT: WHERE distance >= distance_threshold
55+
* The value may be {@code null}.
56+
*/
57+
@com.google.api.client.util.Key
58+
private java.lang.Double distanceThreshold;
59+
60+
/**
61+
* Required. The number of nearest neighbors to return. Must be a positive integer of no more than
62+
* 100.
63+
* The value may be {@code null}.
64+
*/
65+
@com.google.api.client.util.Key
66+
private java.lang.Integer limit;
67+
68+
/**
69+
* Required. The query vector that we are searching on. Must be a vector of no more than 2048
70+
* dimensions.
71+
* The value may be {@code null}.
72+
*/
73+
@com.google.api.client.util.Key
74+
private Value queryVector;
75+
76+
/**
77+
* Required. An indexed vector property to search upon. Only documents which contain vectors whose
78+
* dimensionality match the query_vector can be returned.
79+
* The value may be {@code null}.
80+
*/
81+
@com.google.api.client.util.Key
82+
private PropertyReference vectorProperty;
83+
84+
/**
85+
* Required. The Distance Measure to use, required.
86+
* @return value or {@code null} for none
87+
*/
88+
public java.lang.String getDistanceMeasure() {
89+
return distanceMeasure;
90+
}
91+
92+
/**
93+
* Required. The Distance Measure to use, required.
94+
* @param distanceMeasure distanceMeasure or {@code null} for none
95+
*/
96+
public FindNearest setDistanceMeasure(java.lang.String distanceMeasure) {
97+
this.distanceMeasure = distanceMeasure;
98+
return this;
99+
}
100+
101+
/**
102+
* Optional. Optional name of the field to output the result of the vector distance calculation.
103+
* Must conform to entity property limitations.
104+
* @return value or {@code null} for none
105+
*/
106+
public java.lang.String getDistanceResultProperty() {
107+
return distanceResultProperty;
108+
}
109+
110+
/**
111+
* Optional. Optional name of the field to output the result of the vector distance calculation.
112+
* Must conform to entity property limitations.
113+
* @param distanceResultProperty distanceResultProperty or {@code null} for none
114+
*/
115+
public FindNearest setDistanceResultProperty(java.lang.String distanceResultProperty) {
116+
this.distanceResultProperty = distanceResultProperty;
117+
return this;
118+
}
119+
120+
/**
121+
* Optional. Option to specify a threshold for which no less similar documents will be returned.
122+
* The behavior of the specified `distance_measure` will affect the meaning of the distance
123+
* threshold. Since DOT_PRODUCT distances increase when the vectors are more similar, the
124+
* comparison is inverted. * For EUCLIDEAN, COSINE: WHERE distance <= distance_threshold * For
125+
* DOT_PRODUCT: WHERE distance >= distance_threshold
126+
* @return value or {@code null} for none
127+
*/
128+
public java.lang.Double getDistanceThreshold() {
129+
return distanceThreshold;
130+
}
131+
132+
/**
133+
* Optional. Option to specify a threshold for which no less similar documents will be returned.
134+
* The behavior of the specified `distance_measure` will affect the meaning of the distance
135+
* threshold. Since DOT_PRODUCT distances increase when the vectors are more similar, the
136+
* comparison is inverted. * For EUCLIDEAN, COSINE: WHERE distance <= distance_threshold * For
137+
* DOT_PRODUCT: WHERE distance >= distance_threshold
138+
* @param distanceThreshold distanceThreshold or {@code null} for none
139+
*/
140+
public FindNearest setDistanceThreshold(java.lang.Double distanceThreshold) {
141+
this.distanceThreshold = distanceThreshold;
142+
return this;
143+
}
144+
145+
/**
146+
* Required. The number of nearest neighbors to return. Must be a positive integer of no more than
147+
* 100.
148+
* @return value or {@code null} for none
149+
*/
150+
public java.lang.Integer getLimit() {
151+
return limit;
152+
}
153+
154+
/**
155+
* Required. The number of nearest neighbors to return. Must be a positive integer of no more than
156+
* 100.
157+
* @param limit limit or {@code null} for none
158+
*/
159+
public FindNearest setLimit(java.lang.Integer limit) {
160+
this.limit = limit;
161+
return this;
162+
}
163+
164+
/**
165+
* Required. The query vector that we are searching on. Must be a vector of no more than 2048
166+
* dimensions.
167+
* @return value or {@code null} for none
168+
*/
169+
public Value getQueryVector() {
170+
return queryVector;
171+
}
172+
173+
/**
174+
* Required. The query vector that we are searching on. Must be a vector of no more than 2048
175+
* dimensions.
176+
* @param queryVector queryVector or {@code null} for none
177+
*/
178+
public FindNearest setQueryVector(Value queryVector) {
179+
this.queryVector = queryVector;
180+
return this;
181+
}
182+
183+
/**
184+
* Required. An indexed vector property to search upon. Only documents which contain vectors whose
185+
* dimensionality match the query_vector can be returned.
186+
* @return value or {@code null} for none
187+
*/
188+
public PropertyReference getVectorProperty() {
189+
return vectorProperty;
190+
}
191+
192+
/**
193+
* Required. An indexed vector property to search upon. Only documents which contain vectors whose
194+
* dimensionality match the query_vector can be returned.
195+
* @param vectorProperty vectorProperty or {@code null} for none
196+
*/
197+
public FindNearest setVectorProperty(PropertyReference vectorProperty) {
198+
this.vectorProperty = vectorProperty;
199+
return this;
200+
}
201+
202+
@Override
203+
public FindNearest set(String fieldName, Object value) {
204+
return (FindNearest) super.set(fieldName, value);
205+
}
206+
207+
@Override
208+
public FindNearest clone() {
209+
return (FindNearest) super.clone();
210+
}
211+
212+
}

clients/google-api-services-datastore/v1/2.0.0/com/google/api/services/datastore/v1/model/Query.java

Lines changed: 29 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,8 @@
1717
package com.google.api.services.datastore.v1.model;
1818

1919
/**
20-
* A query for entities.
20+
* A query for entities. The query stages are executed in the following order: 1. kind 2. filter 3.
21+
* projection 4. order + start_cursor + end_cursor 5. offset 6. limit 7. find_nearest
2122
*
2223
* <p> This is the Java data model class that specifies how to parse/serialize into the JSON that is
2324
* transmitted over HTTP when working with the Cloud Datastore API. For a detailed explanation see:
@@ -61,6 +62,14 @@ public final class Query extends com.google.api.client.json.GenericJson {
6162
@com.google.api.client.util.Key
6263
private Filter filter;
6364

65+
/**
66+
* Optional. A potential Nearest Neighbors Search. Applies after all other filters and ordering.
67+
* Finds the closest vector embeddings to the given query vector.
68+
* The value may be {@code null}.
69+
*/
70+
@com.google.api.client.util.Key
71+
private FindNearest findNearest;
72+
6473
/**
6574
* The kinds to query (if empty, returns entities of all kinds). Currently at most 1 kind may be
6675
* specified.
@@ -219,6 +228,25 @@ public Query setFilter(Filter filter) {
219228
return this;
220229
}
221230

231+
/**
232+
* Optional. A potential Nearest Neighbors Search. Applies after all other filters and ordering.
233+
* Finds the closest vector embeddings to the given query vector.
234+
* @return value or {@code null} for none
235+
*/
236+
public FindNearest getFindNearest() {
237+
return findNearest;
238+
}
239+
240+
/**
241+
* Optional. A potential Nearest Neighbors Search. Applies after all other filters and ordering.
242+
* Finds the closest vector embeddings to the given query vector.
243+
* @param findNearest findNearest or {@code null} for none
244+
*/
245+
public Query setFindNearest(FindNearest findNearest) {
246+
this.findNearest = findNearest;
247+
return this;
248+
}
249+
222250
/**
223251
* The kinds to query (if empty, returns entities of all kinds). Currently at most 1 kind may be
224252
* specified.

clients/google-api-services-datastore/v1/2.0.0/pom.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@
88

99
<groupId>com.google.apis</groupId>
1010
<artifactId>google-api-services-datastore</artifactId>
11-
<version>v1-rev20241008-2.0.0</version>
12-
<name>Cloud Datastore API v1-rev20241008-2.0.0</name>
11+
<version>v1-rev20241018-2.0.0</version>
12+
<name>Cloud Datastore API v1-rev20241018-2.0.0</name>
1313
<packaging>jar</packaging>
1414

1515
<inceptionYear>2011</inceptionYear>

clients/google-api-services-datastore/v1/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ Add the following lines to your `pom.xml` file:
2222
<dependency>
2323
<groupId>com.google.apis</groupId>
2424
<artifactId>google-api-services-datastore</artifactId>
25-
<version>v1-rev20241008-2.0.0</version>
25+
<version>v1-rev20241018-2.0.0</version>
2626
</dependency>
2727
</dependencies>
2828
</project>
@@ -35,7 +35,7 @@ repositories {
3535
mavenCentral()
3636
}
3737
dependencies {
38-
implementation 'com.google.apis:google-api-services-datastore:v1-rev20241008-2.0.0'
38+
implementation 'com.google.apis:google-api-services-datastore:v1-rev20241018-2.0.0'
3939
}
4040
```
4141

clients/google-api-services-datastore/v1beta3/2.0.0/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ Add the following lines to your `pom.xml` file:
2222
<dependency>
2323
<groupId>com.google.apis</groupId>
2424
<artifactId>google-api-services-datastore</artifactId>
25-
<version>v1beta3-rev20241008-2.0.0</version>
25+
<version>v1beta3-rev20241018-2.0.0</version>
2626
</dependency>
2727
</dependencies>
2828
</project>
@@ -35,7 +35,7 @@ repositories {
3535
mavenCentral()
3636
}
3737
dependencies {
38-
implementation 'com.google.apis:google-api-services-datastore:v1beta3-rev20241008-2.0.0'
38+
implementation 'com.google.apis:google-api-services-datastore:v1beta3-rev20241018-2.0.0'
3939
}
4040
```
4141

0 commit comments

Comments
 (0)