Skip to content

Commit 4b2b4f8

Browse files
committed
[codegen] Update to the latest API spec
1 parent 0015d8f commit 4b2b4f8

File tree

71 files changed

+2246
-3493
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

71 files changed

+2246
-3493
lines changed

java-client/src/main/java/co/elastic/clients/elasticsearch/_types/ClusterStatistics.java

Lines changed: 130 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,11 @@
3535
import co.elastic.clients.util.WithJsonObjectBuilderBase;
3636
import jakarta.json.stream.JsonGenerator;
3737
import java.lang.Integer;
38+
import java.lang.String;
39+
import java.util.Map;
3840
import java.util.Objects;
3941
import java.util.function.Function;
42+
import javax.annotation.Nullable;
4043

4144
// typedef: _types.ClusterStatistics
4245

@@ -53,13 +56,25 @@ public class ClusterStatistics implements JsonpSerializable {
5356

5457
private final int total;
5558

59+
private final int running;
60+
61+
private final int partial;
62+
63+
private final int failed;
64+
65+
private final Map<String, ClusterDetails> details;
66+
5667
// ---------------------------------------------------------------------------------------------
5768

5869
private ClusterStatistics(Builder builder) {
5970

6071
this.skipped = ApiTypeHelper.requireNonNull(builder.skipped, this, "skipped");
6172
this.successful = ApiTypeHelper.requireNonNull(builder.successful, this, "successful");
6273
this.total = ApiTypeHelper.requireNonNull(builder.total, this, "total");
74+
this.running = ApiTypeHelper.requireNonNull(builder.running, this, "running");
75+
this.partial = ApiTypeHelper.requireNonNull(builder.partial, this, "partial");
76+
this.failed = ApiTypeHelper.requireNonNull(builder.failed, this, "failed");
77+
this.details = ApiTypeHelper.unmodifiable(builder.details);
6378

6479
}
6580

@@ -88,6 +103,34 @@ public final int total() {
88103
return this.total;
89104
}
90105

106+
/**
107+
* Required - API name: {@code running}
108+
*/
109+
public final int running() {
110+
return this.running;
111+
}
112+
113+
/**
114+
* Required - API name: {@code partial}
115+
*/
116+
public final int partial() {
117+
return this.partial;
118+
}
119+
120+
/**
121+
* Required - API name: {@code failed}
122+
*/
123+
public final int failed() {
124+
return this.failed;
125+
}
126+
127+
/**
128+
* API name: {@code details}
129+
*/
130+
public final Map<String, ClusterDetails> details() {
131+
return this.details;
132+
}
133+
91134
/**
92135
* Serialize this object to JSON.
93136
*/
@@ -108,6 +151,27 @@ protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) {
108151
generator.writeKey("total");
109152
generator.write(this.total);
110153

154+
generator.writeKey("running");
155+
generator.write(this.running);
156+
157+
generator.writeKey("partial");
158+
generator.write(this.partial);
159+
160+
generator.writeKey("failed");
161+
generator.write(this.failed);
162+
163+
if (ApiTypeHelper.isDefined(this.details)) {
164+
generator.writeKey("details");
165+
generator.writeStartObject();
166+
for (Map.Entry<String, ClusterDetails> item0 : this.details.entrySet()) {
167+
generator.writeKey(item0.getKey());
168+
item0.getValue().serialize(generator, mapper);
169+
170+
}
171+
generator.writeEnd();
172+
173+
}
174+
111175
}
112176

113177
@Override
@@ -128,6 +192,15 @@ public static class Builder extends WithJsonObjectBuilderBase<Builder> implement
128192

129193
private Integer total;
130194

195+
private Integer running;
196+
197+
private Integer partial;
198+
199+
private Integer failed;
200+
201+
@Nullable
202+
private Map<String, ClusterDetails> details;
203+
131204
/**
132205
* Required - API name: {@code skipped}
133206
*/
@@ -152,6 +225,59 @@ public final Builder total(int value) {
152225
return this;
153226
}
154227

228+
/**
229+
* Required - API name: {@code running}
230+
*/
231+
public final Builder running(int value) {
232+
this.running = value;
233+
return this;
234+
}
235+
236+
/**
237+
* Required - API name: {@code partial}
238+
*/
239+
public final Builder partial(int value) {
240+
this.partial = value;
241+
return this;
242+
}
243+
244+
/**
245+
* Required - API name: {@code failed}
246+
*/
247+
public final Builder failed(int value) {
248+
this.failed = value;
249+
return this;
250+
}
251+
252+
/**
253+
* API name: {@code details}
254+
* <p>
255+
* Adds all entries of <code>map</code> to <code>details</code>.
256+
*/
257+
public final Builder details(Map<String, ClusterDetails> map) {
258+
this.details = _mapPutAll(this.details, map);
259+
return this;
260+
}
261+
262+
/**
263+
* API name: {@code details}
264+
* <p>
265+
* Adds an entry to <code>details</code>.
266+
*/
267+
public final Builder details(String key, ClusterDetails value) {
268+
this.details = _mapPut(this.details, key, value);
269+
return this;
270+
}
271+
272+
/**
273+
* API name: {@code details}
274+
* <p>
275+
* Adds an entry to <code>details</code> using a builder lambda.
276+
*/
277+
public final Builder details(String key, Function<ClusterDetails.Builder, ObjectBuilder<ClusterDetails>> fn) {
278+
return details(key, fn.apply(new ClusterDetails.Builder()).build());
279+
}
280+
155281
@Override
156282
protected Builder self() {
157283
return this;
@@ -183,6 +309,10 @@ protected static void setupClusterStatisticsDeserializer(ObjectDeserializer<Clus
183309
op.add(Builder::skipped, JsonpDeserializer.integerDeserializer(), "skipped");
184310
op.add(Builder::successful, JsonpDeserializer.integerDeserializer(), "successful");
185311
op.add(Builder::total, JsonpDeserializer.integerDeserializer(), "total");
312+
op.add(Builder::running, JsonpDeserializer.integerDeserializer(), "running");
313+
op.add(Builder::partial, JsonpDeserializer.integerDeserializer(), "partial");
314+
op.add(Builder::failed, JsonpDeserializer.integerDeserializer(), "failed");
315+
op.add(Builder::details, JsonpDeserializer.stringMapDeserializer(ClusterDetails._DESERIALIZER), "details");
186316

187317
}
188318

java-client/src/main/java/co/elastic/clients/elasticsearch/_types/KnnQuery.java

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,9 @@ public class KnnQuery implements JsonpSerializable {
6868

6969
private final List<Query> filter;
7070

71+
@Nullable
72+
private final Float similarity;
73+
7174
// ---------------------------------------------------------------------------------------------
7275

7376
private KnnQuery(Builder builder) {
@@ -79,6 +82,7 @@ private KnnQuery(Builder builder) {
7982
this.numCandidates = ApiTypeHelper.requireNonNull(builder.numCandidates, this, "numCandidates");
8083
this.boost = builder.boost;
8184
this.filter = ApiTypeHelper.unmodifiable(builder.filter);
85+
this.similarity = builder.similarity;
8286

8387
}
8488

@@ -152,6 +156,16 @@ public final List<Query> filter() {
152156
return this.filter;
153157
}
154158

159+
/**
160+
* The minimum similarity for a vector to be considered a match
161+
* <p>
162+
* API name: {@code similarity}
163+
*/
164+
@Nullable
165+
public final Float similarity() {
166+
return this.similarity;
167+
}
168+
155169
/**
156170
* Serialize this object to JSON.
157171
*/
@@ -202,6 +216,11 @@ protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) {
202216
generator.writeEnd();
203217

204218
}
219+
if (this.similarity != null) {
220+
generator.writeKey("similarity");
221+
generator.write(this.similarity);
222+
223+
}
205224

206225
}
207226

@@ -235,6 +254,9 @@ public static class Builder extends WithJsonObjectBuilderBase<Builder> implement
235254
@Nullable
236255
private List<Query> filter;
237256

257+
@Nullable
258+
private Float similarity;
259+
238260
/**
239261
* Required - The name of the vector field to search against
240262
* <p>
@@ -356,6 +378,16 @@ public final Builder filter(Function<Query.Builder, ObjectBuilder<Query>> fn) {
356378
return filter(fn.apply(new Query.Builder()).build());
357379
}
358380

381+
/**
382+
* The minimum similarity for a vector to be considered a match
383+
* <p>
384+
* API name: {@code similarity}
385+
*/
386+
public final Builder similarity(@Nullable Float value) {
387+
this.similarity = value;
388+
return this;
389+
}
390+
359391
@Override
360392
protected Builder self() {
361393
return this;
@@ -392,6 +424,7 @@ protected static void setupKnnQueryDeserializer(ObjectDeserializer<KnnQuery.Buil
392424
op.add(Builder::numCandidates, JsonpDeserializer.longDeserializer(), "num_candidates");
393425
op.add(Builder::boost, JsonpDeserializer.floatDeserializer(), "boost");
394426
op.add(Builder::filter, JsonpDeserializer.arrayDeserializer(Query._DESERIALIZER), "filter");
427+
op.add(Builder::similarity, JsonpDeserializer.floatDeserializer(), "similarity");
395428

396429
}
397430

0 commit comments

Comments
 (0)