Skip to content

Commit a376e5e

Browse files
committed
[codegen] update to latest spec
1 parent f1201bd commit a376e5e

File tree

12 files changed

+581
-57
lines changed

12 files changed

+581
-57
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/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.

java-client/src/main/java/co/elastic/clients/elasticsearch/doc-files/api-spec.html

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
'_global.create.Response': '_global/create/CreateResponse.ts#L22-L25',
2828
'_global.delete.Request': '_global/delete/DeleteRequest.ts#L34-L146',
2929
'_global.delete.Response': '_global/delete/DeleteResponse.ts#L22-L35',
30-
'_global.delete_by_query.Request': '_global/delete_by_query/DeleteByQueryRequest.ts#L37-L319',
30+
'_global.delete_by_query.Request': '_global/delete_by_query/DeleteByQueryRequest.ts#L37-L320',
3131
'_global.delete_by_query.Response': '_global/delete_by_query/DeleteByQueryResponse.ts#L26-L88',
3232
'_global.delete_by_query_rethrottle.Request': '_global/delete_by_query_rethrottle/DeleteByQueryRethrottleRequest.ts#L24-L55',
3333
'_global.delete_by_query_rethrottle.Response': '_global/delete_by_query_rethrottle/DeleteByQueryRethrottleResponse.ts#L22-L25',
@@ -259,7 +259,7 @@
259259
'_global.update_by_query_rethrottle.UpdateByQueryRethrottleNode': '_global/update_by_query_rethrottle/UpdateByQueryRethrottleNode.ts#L25-L27',
260260
'_spec_utils.BaseNode': '_spec_utils/BaseNode.ts#L25-L32',
261261
'_types.AcknowledgedResponseBase': '_types/Base.ts#L69-L72',
262-
'_types.BulkIndexByScrollFailure': '_types/Errors.ts#L60-L65',
262+
'_types.BulkIndexByScrollFailure': '_types/Errors.ts#L64-L69',
263263
'_types.BulkStats': '_types/Stats.ts#L71-L81',
264264
'_types.Bytes': '_types/common.ts#L166-L178',
265265
'_types.ClusterDetails': '_types/Stats.ts#L45-L52',
@@ -354,7 +354,7 @@
354354
'_types.SearchTransform': '_types/Transform.ts#L47-L50',
355355
'_types.SearchType': '_types/common.ts#L274-L279',
356356
'_types.SegmentsStats': '_types/Stats.ts#L298-L393',
357-
'_types.ShardFailure': '_types/Errors.ts#L52-L58',
357+
'_types.ShardFailure': '_types/Errors.ts#L52-L62',
358358
'_types.ShardStatistics': '_types/Stats.ts#L54-L69',
359359
'_types.ShardsOperationResponseBase': '_types/Base.ts#L145-L148',
360360
'_types.SlicedScroll': '_types/SlicedScroll.ts#L23-L27',
@@ -368,7 +368,7 @@
368368
'_types.StoreStats': '_types/Stats.ts#L395-L422',
369369
'_types.StoredScript': '_types/Scripting.ts#L51-L63',
370370
'_types.SuggestMode': '_types/common.ts#L281-L294',
371-
'_types.TaskFailure': '_types/Errors.ts#L67-L72',
371+
'_types.TaskFailure': '_types/Errors.ts#L71-L76',
372372
'_types.TextEmbedding': '_types/Knn.ts#L94-L97',
373373
'_types.TextSimilarityReranker': '_types/Retriever.ts#L140-L151',
374374
'_types.ThreadType': '_types/common.ts#L296-L302',
@@ -3081,6 +3081,8 @@
30813081
'transform.reset_transform.Response': 'transform/reset_transform/ResetTransformResponse.ts#L22-L25',
30823082
'transform.schedule_now_transform.Request': 'transform/schedule_now_transform/ScheduleNowTransformRequest.ts#L23-L57',
30833083
'transform.schedule_now_transform.Response': 'transform/schedule_now_transform/ScheduleNowTransformResponse.ts#L21-L24',
3084+
'transform.set_upgrade_mode.Request': 'transform/set_upgrade_mode/TransformSetUpgradeModeRequest.ts#L23-L64',
3085+
'transform.set_upgrade_mode.Response': 'transform/set_upgrade_mode/TransformSetUpgradeModeResponse.ts#L22-L25',
30843086
'transform.start_transform.Request': 'transform/start_transform/StartTransformRequest.ts#L24-L72',
30853087
'transform.start_transform.Response': 'transform/start_transform/StartTransformResponse.ts#L22-L25',
30863088
'transform.stop_transform.Request': 'transform/stop_transform/StopTransformRequest.ts#L24-L84',
@@ -3293,10 +3295,10 @@
32933295
if (hash.length > 1) {
32943296
hash = hash.substring(1);
32953297
}
3296-
window.location = "https://github.com/elastic/elasticsearch-specification/tree/941744bd0826657988ca8f9a336795092b3dbb9b/specification/" + (paths[hash] || "");
3298+
window.location = "https://github.com/elastic/elasticsearch-specification/tree/76e127f2e613a682666f12e5ed764121fcdcfd64/specification/" + (paths[hash] || "");
32973299
</script>
32983300
</head>
32993301
<body>
3300-
Please see the <a href="https://github.com/elastic/elasticsearch-specification/tree/941744bd0826657988ca8f9a336795092b3dbb9b/specification/">Elasticsearch API specification</a>.
3302+
Please see the <a href="https://github.com/elastic/elasticsearch-specification/tree/76e127f2e613a682666f12e5ed764121fcdcfd64/specification/">Elasticsearch API specification</a>.
33013303
</body>
33023304
</html>

java-client/src/main/java/co/elastic/clients/elasticsearch/indices/ElasticsearchIndicesAsyncClient.java

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3702,8 +3702,10 @@ public final CompletableFuture<ResolveIndexResponse> resolveIndex(
37023702
// ----- Endpoint: indices.rollover
37033703

37043704
/**
3705-
* Roll over to a new index. TIP: It is recommended to use the index lifecycle
3706-
* rollover action to automate rollovers.
3705+
* Roll over to a new index. TIP: We recommend using the index lifecycle
3706+
* rollover action to automate rollovers. However, Serverless does not support
3707+
* Index Lifecycle Management (ILM), so don't use this approach in the
3708+
* Serverless context.
37073709
* <p>
37083710
* The rollover API creates a new index for a data stream or index alias. The
37093711
* API behavior depends on the rollover target.
@@ -3767,8 +3769,10 @@ public CompletableFuture<RolloverResponse> rollover(RolloverRequest request) {
37673769
}
37683770

37693771
/**
3770-
* Roll over to a new index. TIP: It is recommended to use the index lifecycle
3771-
* rollover action to automate rollovers.
3772+
* Roll over to a new index. TIP: We recommend using the index lifecycle
3773+
* rollover action to automate rollovers. However, Serverless does not support
3774+
* Index Lifecycle Management (ILM), so don't use this approach in the
3775+
* Serverless context.
37723776
* <p>
37733777
* The rollover API creates a new index for a data stream or index alias. The
37743778
* API behavior depends on the rollover target.

java-client/src/main/java/co/elastic/clients/elasticsearch/indices/ElasticsearchIndicesClient.java

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3754,8 +3754,10 @@ public final ResolveIndexResponse resolveIndex(
37543754
// ----- Endpoint: indices.rollover
37553755

37563756
/**
3757-
* Roll over to a new index. TIP: It is recommended to use the index lifecycle
3758-
* rollover action to automate rollovers.
3757+
* Roll over to a new index. TIP: We recommend using the index lifecycle
3758+
* rollover action to automate rollovers. However, Serverless does not support
3759+
* Index Lifecycle Management (ILM), so don't use this approach in the
3760+
* Serverless context.
37593761
* <p>
37603762
* The rollover API creates a new index for a data stream or index alias. The
37613763
* API behavior depends on the rollover target.
@@ -3819,8 +3821,10 @@ public RolloverResponse rollover(RolloverRequest request) throws IOException, El
38193821
}
38203822

38213823
/**
3822-
* Roll over to a new index. TIP: It is recommended to use the index lifecycle
3823-
* rollover action to automate rollovers.
3824+
* Roll over to a new index. TIP: We recommend using the index lifecycle
3825+
* rollover action to automate rollovers. However, Serverless does not support
3826+
* Index Lifecycle Management (ILM), so don't use this approach in the
3827+
* Serverless context.
38243828
* <p>
38253829
* The rollover API creates a new index for a data stream or index alias. The
38263830
* API behavior depends on the rollover target.

java-client/src/main/java/co/elastic/clients/elasticsearch/indices/RolloverRequest.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,8 +63,10 @@
6363
// typedef: indices.rollover.Request
6464

6565
/**
66-
* Roll over to a new index. TIP: It is recommended to use the index lifecycle
67-
* rollover action to automate rollovers.
66+
* Roll over to a new index. TIP: We recommend using the index lifecycle
67+
* rollover action to automate rollovers. However, Serverless does not support
68+
* Index Lifecycle Management (ILM), so don't use this approach in the
69+
* Serverless context.
6870
* <p>
6971
* The rollover API creates a new index for a data stream or index alias. The
7072
* API behavior depends on the rollover target.

0 commit comments

Comments
 (0)