Skip to content

Commit 37f93f2

Browse files
committed
[codegen] update to latest spec
1 parent c6c628b commit 37f93f2

15 files changed

+652
-102
lines changed

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

Lines changed: 10 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -4195,12 +4195,11 @@ public final CompletableFuture<RankEvalResponse> rankEval(
41954195
* <li>When requested with <code>wait_for_completion=true</code> (default), the
41964196
* request fails if the node shuts down.</li>
41974197
* <li>When requested with <code>wait_for_completion=false</code>, a task id is
4198-
* returned, which can be used via the task management API to monitor, debug, or
4199-
* cancel the task. The task may disappear or fail if the node shuts down. When
4200-
* retrying a failed reindex operation, it might be necessary to set
4201-
* <code>conflicts=proceed</code> or to first delete the partial destination
4202-
* index. Additionally, dry runs, checking disk space, and fetching index
4203-
* recovery information can help address the root cause.</li>
4198+
* returned, for use with the task management APIs. The task may disappear or
4199+
* fail if the node shuts down. When retrying a failed reindex operation, it
4200+
* might be necessary to set <code>conflicts=proceed</code> or to first delete
4201+
* the partial destination index. Additionally, dry runs, checking disk space,
4202+
* and fetching index recovery information can help address the root cause.</li>
42044203
* </ul>
42054204
* <p>
42064205
* Refer to the linked documentation for examples of how to reindex documents.
@@ -4288,12 +4287,11 @@ public CompletableFuture<ReindexResponse> reindex(ReindexRequest request) {
42884287
* <li>When requested with <code>wait_for_completion=true</code> (default), the
42894288
* request fails if the node shuts down.</li>
42904289
* <li>When requested with <code>wait_for_completion=false</code>, a task id is
4291-
* returned, which can be used via the task management API to monitor, debug, or
4292-
* cancel the task. The task may disappear or fail if the node shuts down. When
4293-
* retrying a failed reindex operation, it might be necessary to set
4294-
* <code>conflicts=proceed</code> or to first delete the partial destination
4295-
* index. Additionally, dry runs, checking disk space, and fetching index
4296-
* recovery information can help address the root cause.</li>
4290+
* returned, for use with the task management APIs. The task may disappear or
4291+
* fail if the node shuts down. When retrying a failed reindex operation, it
4292+
* might be necessary to set <code>conflicts=proceed</code> or to first delete
4293+
* the partial destination index. Additionally, dry runs, checking disk space,
4294+
* and fetching index recovery information can help address the root cause.</li>
42974295
* </ul>
42984296
* <p>
42994297
* Refer to the linked documentation for examples of how to reindex documents.

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

Lines changed: 10 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -4224,12 +4224,11 @@ public final RankEvalResponse rankEval(Function<RankEvalRequest.Builder, ObjectB
42244224
* <li>When requested with <code>wait_for_completion=true</code> (default), the
42254225
* request fails if the node shuts down.</li>
42264226
* <li>When requested with <code>wait_for_completion=false</code>, a task id is
4227-
* returned, which can be used via the task management API to monitor, debug, or
4228-
* cancel the task. The task may disappear or fail if the node shuts down. When
4229-
* retrying a failed reindex operation, it might be necessary to set
4230-
* <code>conflicts=proceed</code> or to first delete the partial destination
4231-
* index. Additionally, dry runs, checking disk space, and fetching index
4232-
* recovery information can help address the root cause.</li>
4227+
* returned, for use with the task management APIs. The task may disappear or
4228+
* fail if the node shuts down. When retrying a failed reindex operation, it
4229+
* might be necessary to set <code>conflicts=proceed</code> or to first delete
4230+
* the partial destination index. Additionally, dry runs, checking disk space,
4231+
* and fetching index recovery information can help address the root cause.</li>
42334232
* </ul>
42344233
* <p>
42354234
* Refer to the linked documentation for examples of how to reindex documents.
@@ -4317,12 +4316,11 @@ public ReindexResponse reindex(ReindexRequest request) throws IOException, Elast
43174316
* <li>When requested with <code>wait_for_completion=true</code> (default), the
43184317
* request fails if the node shuts down.</li>
43194318
* <li>When requested with <code>wait_for_completion=false</code>, a task id is
4320-
* returned, which can be used via the task management API to monitor, debug, or
4321-
* cancel the task. The task may disappear or fail if the node shuts down. When
4322-
* retrying a failed reindex operation, it might be necessary to set
4323-
* <code>conflicts=proceed</code> or to first delete the partial destination
4324-
* index. Additionally, dry runs, checking disk space, and fetching index
4325-
* recovery information can help address the root cause.</li>
4319+
* returned, for use with the task management APIs. The task may disappear or
4320+
* fail if the node shuts down. When retrying a failed reindex operation, it
4321+
* might be necessary to set <code>conflicts=proceed</code> or to first delete
4322+
* the partial destination index. Additionally, dry runs, checking disk space,
4323+
* and fetching index recovery information can help address the root cause.</li>
43264324
* </ul>
43274325
* <p>
43284326
* Refer to the linked documentation for examples of how to reindex documents.

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

Lines changed: 46 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@
3030
import co.elastic.clients.util.ObjectBuilder;
3131
import co.elastic.clients.util.WithJsonObjectBuilderBase;
3232
import jakarta.json.stream.JsonGenerator;
33+
import java.lang.Boolean;
3334
import java.lang.Integer;
3435
import java.lang.String;
3536
import java.util.Objects;
@@ -68,20 +69,25 @@ public class ShardFailure implements JsonpSerializable {
6869

6970
private final ErrorCause reason;
7071

71-
private final int shard;
72+
@Nullable
73+
private final Integer shard;
7274

7375
@Nullable
7476
private final String status;
7577

78+
@Nullable
79+
private final Boolean primary;
80+
7681
// ---------------------------------------------------------------------------------------------
7782

7883
private ShardFailure(Builder builder) {
7984

8085
this.index = builder.index;
8186
this.node = builder.node;
8287
this.reason = ApiTypeHelper.requireNonNull(builder.reason, this, "reason");
83-
this.shard = ApiTypeHelper.requireNonNull(builder.shard, this, "shard", 0);
88+
this.shard = builder.shard;
8489
this.status = builder.status;
90+
this.primary = builder.primary;
8591

8692
}
8793

@@ -113,9 +119,10 @@ public final ErrorCause reason() {
113119
}
114120

115121
/**
116-
* Required - API name: {@code shard}
122+
* API name: {@code shard}
117123
*/
118-
public final int shard() {
124+
@Nullable
125+
public final Integer shard() {
119126
return this.shard;
120127
}
121128

@@ -127,6 +134,14 @@ public final String status() {
127134
return this.status;
128135
}
129136

137+
/**
138+
* API name: {@code primary}
139+
*/
140+
@Nullable
141+
public final Boolean primary() {
142+
return this.primary;
143+
}
144+
130145
/**
131146
* Serialize this object to JSON.
132147
*/
@@ -151,14 +166,21 @@ protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) {
151166
generator.writeKey("reason");
152167
this.reason.serialize(generator, mapper);
153168

154-
generator.writeKey("shard");
155-
generator.write(this.shard);
169+
if (this.shard != null) {
170+
generator.writeKey("shard");
171+
generator.write(this.shard);
156172

173+
}
157174
if (this.status != null) {
158175
generator.writeKey("status");
159176
generator.write(this.status);
160177

161178
}
179+
if (this.primary != null) {
180+
generator.writeKey("primary");
181+
generator.write(this.primary);
182+
183+
}
162184

163185
}
164186

@@ -182,11 +204,15 @@ public static class Builder extends WithJsonObjectBuilderBase<Builder> implement
182204

183205
private ErrorCause reason;
184206

207+
@Nullable
185208
private Integer shard;
186209

187210
@Nullable
188211
private String status;
189212

213+
@Nullable
214+
private Boolean primary;
215+
190216
/**
191217
* API name: {@code index}
192218
*/
@@ -219,9 +245,9 @@ public final Builder reason(Function<ErrorCause.Builder, ObjectBuilder<ErrorCaus
219245
}
220246

221247
/**
222-
* Required - API name: {@code shard}
248+
* API name: {@code shard}
223249
*/
224-
public final Builder shard(int value) {
250+
public final Builder shard(@Nullable Integer value) {
225251
this.shard = value;
226252
return this;
227253
}
@@ -234,6 +260,14 @@ public final Builder status(@Nullable String value) {
234260
return this;
235261
}
236262

263+
/**
264+
* API name: {@code primary}
265+
*/
266+
public final Builder primary(@Nullable Boolean value) {
267+
this.primary = value;
268+
return this;
269+
}
270+
237271
@Override
238272
protected Builder self() {
239273
return this;
@@ -262,11 +296,12 @@ public ShardFailure build() {
262296

263297
protected static void setupShardFailureDeserializer(ObjectDeserializer<ShardFailure.Builder> op) {
264298

265-
op.add(Builder::index, JsonpDeserializer.stringDeserializer(), "index");
266-
op.add(Builder::node, JsonpDeserializer.stringDeserializer(), "node");
299+
op.add(Builder::index, JsonpDeserializer.stringDeserializer(), "index", "_index");
300+
op.add(Builder::node, JsonpDeserializer.stringDeserializer(), "node", "_node");
267301
op.add(Builder::reason, ErrorCause._DESERIALIZER, "reason");
268-
op.add(Builder::shard, JsonpDeserializer.integerDeserializer(), "shard");
302+
op.add(Builder::shard, JsonpDeserializer.integerDeserializer(), "shard", "_shard");
269303
op.add(Builder::status, JsonpDeserializer.stringDeserializer(), "status");
304+
op.add(Builder::primary, JsonpDeserializer.booleanDeserializer(), "primary");
270305

271306
}
272307

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

Lines changed: 27 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,7 @@
6464
public class ChunkingSettings implements JsonpSerializable {
6565
private final String strategy;
6666

67+
@Nullable
6768
private final String separatorGroup;
6869

6970
private final List<String> separators;
@@ -81,8 +82,8 @@ public class ChunkingSettings implements JsonpSerializable {
8182
private ChunkingSettings(Builder builder) {
8283

8384
this.strategy = ApiTypeHelper.requireNonNull(builder.strategy, this, "strategy");
84-
this.separatorGroup = ApiTypeHelper.requireNonNull(builder.separatorGroup, this, "separatorGroup");
85-
this.separators = ApiTypeHelper.unmodifiableRequired(builder.separators, this, "separators");
85+
this.separatorGroup = builder.separatorGroup;
86+
this.separators = ApiTypeHelper.unmodifiable(builder.separators);
8687
this.maxChunkSize = ApiTypeHelper.requireNonNull(builder.maxChunkSize, this, "maxChunkSize", 0);
8788
this.overlap = builder.overlap;
8889
this.sentenceOverlap = builder.sentenceOverlap;
@@ -114,8 +115,8 @@ public final String strategy() {
114115
}
115116

116117
/**
117-
* Required - This parameter is only applicable when using the
118-
* <code>recursive</code> chunking strategy.
118+
* Only applicable to the <code>recursive</code> strategy and required when
119+
* using it.
119120
* <p>
120121
* Sets a predefined list of separators in the saved chunking settings based on
121122
* the selected text type. Values can be <code>markdown</code> or
@@ -126,13 +127,16 @@ public final String strategy() {
126127
* <p>
127128
* API name: {@code separator_group}
128129
*/
130+
@Nullable
129131
public final String separatorGroup() {
130132
return this.separatorGroup;
131133
}
132134

133135
/**
134-
* Required - A list of strings used as possible split points when chunking text
135-
* with the <code>recursive</code> strategy.
136+
* Only applicable to the <code>recursive</code> strategy and required when
137+
* using it.
138+
* <p>
139+
* A list of strings used as possible split points when chunking text.
136140
* <p>
137141
* Each string can be a plain string or a regular expression (regex) pattern.
138142
* The system tries each separator in order to split the text, starting from the
@@ -198,9 +202,11 @@ protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) {
198202
generator.writeKey("strategy");
199203
generator.write(this.strategy);
200204

201-
generator.writeKey("separator_group");
202-
generator.write(this.separatorGroup);
205+
if (this.separatorGroup != null) {
206+
generator.writeKey("separator_group");
207+
generator.write(this.separatorGroup);
203208

209+
}
204210
if (ApiTypeHelper.isDefined(this.separators)) {
205211
generator.writeKey("separators");
206212
generator.writeStartArray();
@@ -241,8 +247,10 @@ public String toString() {
241247
public static class Builder extends WithJsonObjectBuilderBase<Builder> implements ObjectBuilder<ChunkingSettings> {
242248
private String strategy;
243249

250+
@Nullable
244251
private String separatorGroup;
245252

253+
@Nullable
246254
private List<String> separators;
247255

248256
private Integer maxChunkSize;
@@ -275,8 +283,8 @@ public final Builder strategy(String value) {
275283
}
276284

277285
/**
278-
* Required - This parameter is only applicable when using the
279-
* <code>recursive</code> chunking strategy.
286+
* Only applicable to the <code>recursive</code> strategy and required when
287+
* using it.
280288
* <p>
281289
* Sets a predefined list of separators in the saved chunking settings based on
282290
* the selected text type. Values can be <code>markdown</code> or
@@ -287,14 +295,16 @@ public final Builder strategy(String value) {
287295
* <p>
288296
* API name: {@code separator_group}
289297
*/
290-
public final Builder separatorGroup(String value) {
298+
public final Builder separatorGroup(@Nullable String value) {
291299
this.separatorGroup = value;
292300
return this;
293301
}
294302

295303
/**
296-
* Required - A list of strings used as possible split points when chunking text
297-
* with the <code>recursive</code> strategy.
304+
* Only applicable to the <code>recursive</code> strategy and required when
305+
* using it.
306+
* <p>
307+
* A list of strings used as possible split points when chunking text.
298308
* <p>
299309
* Each string can be a plain string or a regular expression (regex) pattern.
300310
* The system tries each separator in order to split the text, starting from the
@@ -314,8 +324,10 @@ public final Builder separators(List<String> list) {
314324
}
315325

316326
/**
317-
* Required - A list of strings used as possible split points when chunking text
318-
* with the <code>recursive</code> strategy.
327+
* Only applicable to the <code>recursive</code> strategy and required when
328+
* using it.
329+
* <p>
330+
* A list of strings used as possible split points when chunking text.
319331
* <p>
320332
* Each string can be a plain string or a regular expression (regex) pattern.
321333
* The system tries each separator in order to split the text, starting from the

java-client/src/main/java/co/elastic/clients/elasticsearch/core/ReindexRequest.java

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -137,12 +137,11 @@
137137
* <li>When requested with <code>wait_for_completion=true</code> (default), the
138138
* request fails if the node shuts down.</li>
139139
* <li>When requested with <code>wait_for_completion=false</code>, a task id is
140-
* returned, which can be used via the task management API to monitor, debug, or
141-
* cancel the task. The task may disappear or fail if the node shuts down. When
142-
* retrying a failed reindex operation, it might be necessary to set
143-
* <code>conflicts=proceed</code> or to first delete the partial destination
144-
* index. Additionally, dry runs, checking disk space, and fetching index
145-
* recovery information can help address the root cause.</li>
140+
* returned, for use with the task management APIs. The task may disappear or
141+
* fail if the node shuts down. When retrying a failed reindex operation, it
142+
* might be necessary to set <code>conflicts=proceed</code> or to first delete
143+
* the partial destination index. Additionally, dry runs, checking disk space,
144+
* and fetching index recovery information can help address the root cause.</li>
146145
* </ul>
147146
* <p>
148147
* Refer to the linked documentation for examples of how to reindex documents.

0 commit comments

Comments
 (0)