Skip to content

Commit ebc3326

Browse files
committed
[codegen] update to latest spec
1 parent ef0bacd commit ebc3326

File tree

263 files changed

+18341
-4722
lines changed

Some content is hidden

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

263 files changed

+18341
-4722
lines changed

java-client/src/main/java/co/elastic/clients/elasticsearch/ElasticsearchAsyncClient.java

Lines changed: 126 additions & 518 deletions
Large diffs are not rendered by default.

java-client/src/main/java/co/elastic/clients/elasticsearch/ElasticsearchClient.java

Lines changed: 126 additions & 518 deletions
Large diffs are not rendered by default.

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

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,12 @@ public class IndexingStats implements JsonpSerializable {
9797
@Nullable
9898
private final Double writeLoad;
9999

100+
@Nullable
101+
private final Double recentWriteLoad;
102+
103+
@Nullable
104+
private final Double peakWriteLoad;
105+
100106
// ---------------------------------------------------------------------------------------------
101107

102108
private IndexingStats(Builder builder) {
@@ -118,6 +124,8 @@ private IndexingStats(Builder builder) {
118124
this.indexFailed = ApiTypeHelper.requireNonNull(builder.indexFailed, this, "indexFailed", 0);
119125
this.types = ApiTypeHelper.unmodifiable(builder.types);
120126
this.writeLoad = builder.writeLoad;
127+
this.recentWriteLoad = builder.recentWriteLoad;
128+
this.peakWriteLoad = builder.peakWriteLoad;
121129

122130
}
123131

@@ -234,6 +242,22 @@ public final Double writeLoad() {
234242
return this.writeLoad;
235243
}
236244

245+
/**
246+
* API name: {@code recent_write_load}
247+
*/
248+
@Nullable
249+
public final Double recentWriteLoad() {
250+
return this.recentWriteLoad;
251+
}
252+
253+
/**
254+
* API name: {@code peak_write_load}
255+
*/
256+
@Nullable
257+
public final Double peakWriteLoad() {
258+
return this.peakWriteLoad;
259+
}
260+
237261
/**
238262
* Serialize this object to JSON.
239263
*/
@@ -306,6 +330,16 @@ protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) {
306330
generator.write(this.writeLoad);
307331

308332
}
333+
if (this.recentWriteLoad != null) {
334+
generator.writeKey("recent_write_load");
335+
generator.write(this.recentWriteLoad);
336+
337+
}
338+
if (this.peakWriteLoad != null) {
339+
generator.writeKey("peak_write_load");
340+
generator.write(this.peakWriteLoad);
341+
342+
}
309343

310344
}
311345

@@ -356,6 +390,12 @@ public static class Builder extends WithJsonObjectBuilderBase<Builder> implement
356390
@Nullable
357391
private Double writeLoad;
358392

393+
@Nullable
394+
private Double recentWriteLoad;
395+
396+
@Nullable
397+
private Double peakWriteLoad;
398+
359399
/**
360400
* Required - API name: {@code index_current}
361401
*/
@@ -518,6 +558,22 @@ public final Builder writeLoad(@Nullable Double value) {
518558
return this;
519559
}
520560

561+
/**
562+
* API name: {@code recent_write_load}
563+
*/
564+
public final Builder recentWriteLoad(@Nullable Double value) {
565+
this.recentWriteLoad = value;
566+
return this;
567+
}
568+
569+
/**
570+
* API name: {@code peak_write_load}
571+
*/
572+
public final Builder peakWriteLoad(@Nullable Double value) {
573+
this.peakWriteLoad = value;
574+
return this;
575+
}
576+
521577
@Override
522578
protected Builder self() {
523579
return this;
@@ -561,6 +617,8 @@ protected static void setupIndexingStatsDeserializer(ObjectDeserializer<Indexing
561617
op.add(Builder::indexFailed, JsonpDeserializer.longDeserializer(), "index_failed");
562618
op.add(Builder::types, JsonpDeserializer.stringMapDeserializer(IndexingStats._DESERIALIZER), "types");
563619
op.add(Builder::writeLoad, JsonpDeserializer.doubleDeserializer(), "write_load");
620+
op.add(Builder::recentWriteLoad, JsonpDeserializer.doubleDeserializer(), "recent_write_load");
621+
op.add(Builder::peakWriteLoad, JsonpDeserializer.doubleDeserializer(), "peak_write_load");
564622

565623
}
566624

Lines changed: 216 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,216 @@
1+
/*
2+
* Licensed to Elasticsearch B.V. under one or more contributor
3+
* license agreements. See the NOTICE file distributed with
4+
* this work for additional information regarding copyright
5+
* ownership. Elasticsearch B.V. licenses this file to you under
6+
* the Apache License, Version 2.0 (the "License"); you may
7+
* not use this file except in compliance with the License.
8+
* You may obtain a copy of the License at
9+
*
10+
* http://www.apache.org/licenses/LICENSE-2.0
11+
*
12+
* Unless required by applicable law or agreed to in writing,
13+
* software distributed under the License is distributed on an
14+
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15+
* KIND, either express or implied. See the License for the
16+
* specific language governing permissions and limitations
17+
* under the License.
18+
*/
19+
20+
package co.elastic.clients.elasticsearch._types;
21+
22+
import co.elastic.clients.json.JsonpDeserializable;
23+
import co.elastic.clients.json.JsonpDeserializer;
24+
import co.elastic.clients.json.JsonpMapper;
25+
import co.elastic.clients.json.JsonpSerializable;
26+
import co.elastic.clients.json.JsonpUtils;
27+
import co.elastic.clients.json.ObjectBuilderDeserializer;
28+
import co.elastic.clients.json.ObjectDeserializer;
29+
import co.elastic.clients.util.ApiTypeHelper;
30+
import co.elastic.clients.util.ObjectBuilder;
31+
import co.elastic.clients.util.WithJsonObjectBuilderBase;
32+
import jakarta.json.stream.JsonGenerator;
33+
import java.lang.Float;
34+
import java.util.Objects;
35+
import java.util.function.Function;
36+
import javax.annotation.Nullable;
37+
38+
//----------------------------------------------------------------
39+
// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST.
40+
//----------------------------------------------------------------
41+
//
42+
// This code is generated from the Elasticsearch API specification
43+
// at https://github.com/elastic/elasticsearch-specification
44+
//
45+
// Manual updates to this file will be lost when the code is
46+
// re-generated.
47+
//
48+
// If you find a property that is missing or wrongly typed, please
49+
// open an issue or a PR on the API specification repository.
50+
//
51+
//----------------------------------------------------------------
52+
53+
// typedef: _types.InnerRetriever
54+
55+
/**
56+
*
57+
* @see <a href="../doc-files/api-spec.html#_types.InnerRetriever">API
58+
* specification</a>
59+
*/
60+
@JsonpDeserializable
61+
public class InnerRetriever implements JsonpSerializable {
62+
private final Retriever retriever;
63+
64+
private final float weight;
65+
66+
private final ScoreNormalizer normalizer;
67+
68+
// ---------------------------------------------------------------------------------------------
69+
70+
private InnerRetriever(Builder builder) {
71+
72+
this.retriever = ApiTypeHelper.requireNonNull(builder.retriever, this, "retriever");
73+
this.weight = ApiTypeHelper.requireNonNull(builder.weight, this, "weight", 0);
74+
this.normalizer = ApiTypeHelper.requireNonNull(builder.normalizer, this, "normalizer");
75+
76+
}
77+
78+
public static InnerRetriever of(Function<Builder, ObjectBuilder<InnerRetriever>> fn) {
79+
return fn.apply(new Builder()).build();
80+
}
81+
82+
/**
83+
* Required - API name: {@code retriever}
84+
*/
85+
public final Retriever retriever() {
86+
return this.retriever;
87+
}
88+
89+
/**
90+
* Required - API name: {@code weight}
91+
*/
92+
public final float weight() {
93+
return this.weight;
94+
}
95+
96+
/**
97+
* Required - API name: {@code normalizer}
98+
*/
99+
public final ScoreNormalizer normalizer() {
100+
return this.normalizer;
101+
}
102+
103+
/**
104+
* Serialize this object to JSON.
105+
*/
106+
public void serialize(JsonGenerator generator, JsonpMapper mapper) {
107+
generator.writeStartObject();
108+
serializeInternal(generator, mapper);
109+
generator.writeEnd();
110+
}
111+
112+
protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) {
113+
114+
generator.writeKey("retriever");
115+
this.retriever.serialize(generator, mapper);
116+
117+
generator.writeKey("weight");
118+
generator.write(this.weight);
119+
120+
generator.writeKey("normalizer");
121+
this.normalizer.serialize(generator, mapper);
122+
123+
}
124+
125+
@Override
126+
public String toString() {
127+
return JsonpUtils.toString(this);
128+
}
129+
130+
// ---------------------------------------------------------------------------------------------
131+
132+
/**
133+
* Builder for {@link InnerRetriever}.
134+
*/
135+
136+
public static class Builder extends WithJsonObjectBuilderBase<Builder> implements ObjectBuilder<InnerRetriever> {
137+
private Retriever retriever;
138+
139+
private Float weight;
140+
141+
private ScoreNormalizer normalizer;
142+
143+
/**
144+
* Required - API name: {@code retriever}
145+
*/
146+
public final Builder retriever(Retriever value) {
147+
this.retriever = value;
148+
return this;
149+
}
150+
151+
/**
152+
* Required - API name: {@code retriever}
153+
*/
154+
public final Builder retriever(Function<Retriever.Builder, ObjectBuilder<Retriever>> fn) {
155+
return this.retriever(fn.apply(new Retriever.Builder()).build());
156+
}
157+
158+
/**
159+
* Required - API name: {@code retriever}
160+
*/
161+
public final Builder retriever(RetrieverVariant value) {
162+
this.retriever = value._toRetriever();
163+
return this;
164+
}
165+
166+
/**
167+
* Required - API name: {@code weight}
168+
*/
169+
public final Builder weight(float value) {
170+
this.weight = value;
171+
return this;
172+
}
173+
174+
/**
175+
* Required - API name: {@code normalizer}
176+
*/
177+
public final Builder normalizer(ScoreNormalizer value) {
178+
this.normalizer = value;
179+
return this;
180+
}
181+
182+
@Override
183+
protected Builder self() {
184+
return this;
185+
}
186+
187+
/**
188+
* Builds a {@link InnerRetriever}.
189+
*
190+
* @throws NullPointerException
191+
* if some of the required fields are null.
192+
*/
193+
public InnerRetriever build() {
194+
_checkSingleUse();
195+
196+
return new InnerRetriever(this);
197+
}
198+
}
199+
200+
// ---------------------------------------------------------------------------------------------
201+
202+
/**
203+
* Json deserializer for {@link InnerRetriever}
204+
*/
205+
public static final JsonpDeserializer<InnerRetriever> _DESERIALIZER = ObjectBuilderDeserializer.lazy(Builder::new,
206+
InnerRetriever::setupInnerRetrieverDeserializer);
207+
208+
protected static void setupInnerRetrieverDeserializer(ObjectDeserializer<InnerRetriever.Builder> op) {
209+
210+
op.add(Builder::retriever, Retriever._DESERIALIZER, "retriever");
211+
op.add(Builder::weight, JsonpDeserializer.floatDeserializer(), "weight");
212+
op.add(Builder::normalizer, ScoreNormalizer._DESERIALIZER, "normalizer");
213+
214+
}
215+
216+
}

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,7 @@ public final Float similarity() {
180180
}
181181

182182
/**
183-
* Apply oversampling and rescoring to quantized vectors *
183+
* Apply oversampling and rescoring to quantized vectors
184184
* <p>
185185
* API name: {@code rescore_vector}
186186
*/
@@ -421,7 +421,7 @@ public final Builder similarity(@Nullable Float value) {
421421
}
422422

423423
/**
424-
* Apply oversampling and rescoring to quantized vectors *
424+
* Apply oversampling and rescoring to quantized vectors
425425
* <p>
426426
* API name: {@code rescore_vector}
427427
*/
@@ -431,7 +431,7 @@ public final Builder rescoreVector(@Nullable RescoreVector value) {
431431
}
432432

433433
/**
434-
* Apply oversampling and rescoring to quantized vectors *
434+
* Apply oversampling and rescoring to quantized vectors
435435
* <p>
436436
* API name: {@code rescore_vector}
437437
*/

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,7 @@ public final Float similarity() {
162162
}
163163

164164
/**
165-
* Apply oversampling and rescoring to quantized vectors *
165+
* Apply oversampling and rescoring to quantized vectors
166166
* <p>
167167
* API name: {@code rescore_vector}
168168
*/
@@ -335,7 +335,7 @@ public final Builder similarity(@Nullable Float value) {
335335
}
336336

337337
/**
338-
* Apply oversampling and rescoring to quantized vectors *
338+
* Apply oversampling and rescoring to quantized vectors
339339
* <p>
340340
* API name: {@code rescore_vector}
341341
*/
@@ -345,7 +345,7 @@ public final Builder rescoreVector(@Nullable RescoreVector value) {
345345
}
346346

347347
/**
348-
* Apply oversampling and rescoring to quantized vectors *
348+
* Apply oversampling and rescoring to quantized vectors
349349
* <p>
350350
* API name: {@code rescore_vector}
351351
*/

0 commit comments

Comments
 (0)