Skip to content

Commit 30b3efe

Browse files
committed
[codegen] update to latest spec
1 parent e90330f commit 30b3efe

File tree

10 files changed

+715
-52
lines changed

10 files changed

+715
-52
lines changed

java-client/src/main/java/co/elastic/clients/elasticsearch/async_search/SubmitRequest.java

+42
Original file line numberDiff line numberDiff line change
@@ -164,6 +164,9 @@ public class SubmitRequest extends RequestBase implements JsonpSerializable {
164164

165165
private final List<Map<String, Double>> indicesBoost;
166166

167+
@Nullable
168+
private final Time keepAlive;
169+
167170
@Nullable
168171
private final Boolean keepOnCompletion;
169172

@@ -278,6 +281,7 @@ private SubmitRequest(Builder builder) {
278281
this.ignoreUnavailable = builder.ignoreUnavailable;
279282
this.index = ApiTypeHelper.unmodifiable(builder.index);
280283
this.indicesBoost = ApiTypeHelper.unmodifiable(builder.indicesBoost);
284+
this.keepAlive = builder.keepAlive;
281285
this.keepOnCompletion = builder.keepOnCompletion;
282286
this.knn = ApiTypeHelper.unmodifiable(builder.knn);
283287
this.lenient = builder.lenient;
@@ -542,6 +546,17 @@ public final List<Map<String, Double>> indicesBoost() {
542546
return this.indicesBoost;
543547
}
544548

549+
/**
550+
* Specifies how long the async search needs to be available. Ongoing async
551+
* searches and any saved search results are deleted after this period.
552+
* <p>
553+
* API name: {@code keep_alive}
554+
*/
555+
@Nullable
556+
public final Time keepAlive() {
557+
return this.keepAlive;
558+
}
559+
545560
/**
546561
* If <code>true</code>, results are stored for later retrieval when the search
547562
* completes within the <code>wait_for_completion_timeout</code>.
@@ -1196,6 +1211,9 @@ public static class Builder extends RequestBase.AbstractBuilder<Builder> impleme
11961211
@Nullable
11971212
private List<Map<String, Double>> indicesBoost;
11981213

1214+
@Nullable
1215+
private Time keepAlive;
1216+
11991217
@Nullable
12001218
private Boolean keepOnCompletion;
12011219

@@ -1681,6 +1699,27 @@ public final Builder indicesBoost(Map<String, Double> value, Map<String, Double>
16811699
return this;
16821700
}
16831701

1702+
/**
1703+
* Specifies how long the async search needs to be available. Ongoing async
1704+
* searches and any saved search results are deleted after this period.
1705+
* <p>
1706+
* API name: {@code keep_alive}
1707+
*/
1708+
public final Builder keepAlive(@Nullable Time value) {
1709+
this.keepAlive = value;
1710+
return this;
1711+
}
1712+
1713+
/**
1714+
* Specifies how long the async search needs to be available. Ongoing async
1715+
* searches and any saved search results are deleted after this period.
1716+
* <p>
1717+
* API name: {@code keep_alive}
1718+
*/
1719+
public final Builder keepAlive(Function<Time.Builder, ObjectBuilder<Time>> fn) {
1720+
return this.keepAlive(fn.apply(new Time.Builder()).build());
1721+
}
1722+
16841723
/**
16851724
* If <code>true</code>, results are stored for later retrieval when the search
16861725
* completes within the <code>wait_for_completion_timeout</code>.
@@ -2499,6 +2538,9 @@ protected static void setupSubmitRequestDeserializer(ObjectDeserializer<SubmitRe
24992538
if (request.defaultOperator != null) {
25002539
params.put("default_operator", request.defaultOperator.jsonValue());
25012540
}
2541+
if (request.keepAlive != null) {
2542+
params.put("keep_alive", request.keepAlive._toJsonString());
2543+
}
25022544
if (request.requestCache != null) {
25032545
params.put("request_cache", String.valueOf(request.requestCache));
25042546
}

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

+28
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,9 @@ public class BulkResponseItem implements JsonpSerializable {
7777

7878
private final int status;
7979

80+
@Nullable
81+
private final FailureStoreStatus failureStore;
82+
8083
@Nullable
8184
private final ErrorCause error;
8285

@@ -110,6 +113,7 @@ private BulkResponseItem(Builder builder) {
110113
this.id = builder.id;
111114
this.index = ApiTypeHelper.requireNonNull(builder.index, this, "index");
112115
this.status = ApiTypeHelper.requireNonNull(builder.status, this, "status");
116+
this.failureStore = builder.failureStore;
113117
this.error = builder.error;
114118
this.primaryTerm = builder.primaryTerm;
115119
this.result = builder.result;
@@ -162,6 +166,14 @@ public final int status() {
162166
return this.status;
163167
}
164168

169+
/**
170+
* API name: {@code failure_store}
171+
*/
172+
@Nullable
173+
public final FailureStoreStatus failureStore() {
174+
return this.failureStore;
175+
}
176+
165177
/**
166178
* Additional information about the failed operation. The property is returned
167179
* only for failed operations.
@@ -268,6 +280,10 @@ protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) {
268280
generator.writeKey("status");
269281
generator.write(this.status);
270282

283+
if (this.failureStore != null) {
284+
generator.writeKey("failure_store");
285+
this.failureStore.serialize(generator, mapper);
286+
}
271287
if (this.error != null) {
272288
generator.writeKey("error");
273289
this.error.serialize(generator, mapper);
@@ -342,6 +358,9 @@ public final Builder operationType(OperationType value) {
342358

343359
private Integer status;
344360

361+
@Nullable
362+
private FailureStoreStatus failureStore;
363+
345364
@Nullable
346365
private ErrorCause error;
347366

@@ -398,6 +417,14 @@ public final Builder status(int value) {
398417
return this;
399418
}
400419

420+
/**
421+
* API name: {@code failure_store}
422+
*/
423+
public final Builder failureStore(@Nullable FailureStoreStatus value) {
424+
this.failureStore = value;
425+
return this;
426+
}
427+
401428
/**
402429
* Additional information about the failed operation. The property is returned
403430
* only for failed operations.
@@ -539,6 +566,7 @@ protected static void setupBulkResponseItemDeserializer(ObjectDeserializer<BulkR
539566
op.add(Builder::id, JsonpDeserializer.stringDeserializer(), "_id");
540567
op.add(Builder::index, JsonpDeserializer.stringDeserializer(), "_index");
541568
op.add(Builder::status, JsonpDeserializer.integerDeserializer(), "status");
569+
op.add(Builder::failureStore, FailureStoreStatus._DESERIALIZER, "failure_store");
542570
op.add(Builder::error, ErrorCause._DESERIALIZER, "error");
543571
op.add(Builder::primaryTerm, JsonpDeserializer.longDeserializer(), "_primary_term");
544572
op.add(Builder::result, JsonpDeserializer.stringDeserializer(), "result");
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
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.core.bulk;
21+
22+
import co.elastic.clients.json.JsonEnum;
23+
import co.elastic.clients.json.JsonpDeserializable;
24+
import co.elastic.clients.json.JsonpDeserializer;
25+
26+
//----------------------------------------------------------------
27+
// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST.
28+
//----------------------------------------------------------------
29+
//
30+
// This code is generated from the Elasticsearch API specification
31+
// at https://github.com/elastic/elasticsearch-specification
32+
//
33+
// Manual updates to this file will be lost when the code is
34+
// re-generated.
35+
//
36+
// If you find a property that is missing or wrongly typed, please
37+
// open an issue or a PR on the API specification repository.
38+
//
39+
//----------------------------------------------------------------
40+
41+
/**
42+
*
43+
* @see <a href=
44+
* "../../doc-files/api-spec.html#_global.bulk.FailureStoreStatus">API
45+
* specification</a>
46+
*/
47+
@JsonpDeserializable
48+
public enum FailureStoreStatus implements JsonEnum {
49+
NotApplicableOrUnknown("not_applicable_or_unknown"),
50+
51+
Used("used"),
52+
53+
NotEnabled("not_enabled"),
54+
55+
Failed("failed"),
56+
57+
;
58+
59+
private final String jsonValue;
60+
61+
FailureStoreStatus(String jsonValue) {
62+
this.jsonValue = jsonValue;
63+
}
64+
65+
public String jsonValue() {
66+
return this.jsonValue;
67+
}
68+
69+
public static final JsonEnum.Deserializer<FailureStoreStatus> _DESERIALIZER = new JsonEnum.Deserializer<>(
70+
FailureStoreStatus.values());
71+
}

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

+22-20
Original file line numberDiff line numberDiff line change
@@ -4,18 +4,19 @@
44
<title>Elasticsearch API specification</title>
55
<script>
66
var paths = {
7-
'_global.bulk.CreateOperation': '_global/bulk/types.ts#L132-L132',
8-
'_global.bulk.DeleteOperation': '_global/bulk/types.ts#L136-L136',
9-
'_global.bulk.IndexOperation': '_global/bulk/types.ts#L134-L134',
10-
'_global.bulk.OperationBase': '_global/bulk/types.ts#L92-L109',
11-
'_global.bulk.OperationContainer': '_global/bulk/types.ts#L150-L172',
12-
'_global.bulk.OperationType': '_global/bulk/types.ts#L85-L90',
7+
'_global.bulk.CreateOperation': '_global/bulk/types.ts#L140-L140',
8+
'_global.bulk.DeleteOperation': '_global/bulk/types.ts#L144-L144',
9+
'_global.bulk.FailureStoreStatus': '_global/bulk/types.ts#L86-L91',
10+
'_global.bulk.IndexOperation': '_global/bulk/types.ts#L142-L142',
11+
'_global.bulk.OperationBase': '_global/bulk/types.ts#L100-L117',
12+
'_global.bulk.OperationContainer': '_global/bulk/types.ts#L158-L180',
13+
'_global.bulk.OperationType': '_global/bulk/types.ts#L93-L98',
1314
'_global.bulk.Request': '_global/bulk/BulkRequest.ts#L32-L232',
1415
'_global.bulk.Response': '_global/bulk/BulkResponse.ts#L24-L45',
15-
'_global.bulk.ResponseItem': '_global/bulk/types.ts#L37-L83',
16-
'_global.bulk.UpdateAction': '_global/bulk/types.ts#L174-L209',
17-
'_global.bulk.UpdateOperation': '_global/bulk/types.ts#L138-L148',
18-
'_global.bulk.WriteOperation': '_global/bulk/types.ts#L111-L130',
16+
'_global.bulk.ResponseItem': '_global/bulk/types.ts#L37-L84',
17+
'_global.bulk.UpdateAction': '_global/bulk/types.ts#L182-L217',
18+
'_global.bulk.UpdateOperation': '_global/bulk/types.ts#L146-L156',
19+
'_global.bulk.WriteOperation': '_global/bulk/types.ts#L119-L138',
1920
'_global.clear_scroll.Request': '_global/clear_scroll/ClearScrollRequest.ts#L23-L50',
2021
'_global.clear_scroll.Response': '_global/clear_scroll/ClearScrollResponse.ts#L22-L43',
2122
'_global.close_point_in_time.Request': '_global/close_point_in_time/ClosePointInTimeRequest.ts#L23-L42',
@@ -995,7 +996,7 @@
995996
'async_search.status.Request': 'async_search/status/AsyncSearchStatusRequest.ts#L24-L48',
996997
'async_search.status.Response': 'async_search/status/AsyncSearchStatusResponse.ts#L39-L41',
997998
'async_search.status.StatusResponseBase': 'async_search/status/AsyncSearchStatusResponse.ts#L24-L38',
998-
'async_search.submit.Request': 'async_search/submit/AsyncSearchSubmitRequest.ts#L55-L280',
999+
'async_search.submit.Request': 'async_search/submit/AsyncSearchSubmitRequest.ts#L55-L286',
9991000
'async_search.submit.Response': 'async_search/submit/AsyncSearchSubmitResponse.ts#L22-L24',
10001001
'autoscaling._types.AutoscalingPolicy': 'autoscaling/_types/AutoscalingPolicy.ts#L23-L30',
10011002
'autoscaling.delete_autoscaling_policy.Request': 'autoscaling/delete_autoscaling_policy/DeleteAutoscalingPolicyRequest.ts#L24-L48',
@@ -1354,7 +1355,7 @@
13541355
'eql.search.ResultPosition': 'eql/search/types.ts#L20-L32',
13551356
'esql._types.TableValuesContainer': 'esql/_types/TableValuesContainer.ts#L22-L28',
13561357
'esql.query.EsqlFormat': 'esql/query/QueryParameters.ts#L20-L29',
1357-
'esql.query.Request': 'esql/query/QueryRequest.ts#L27-L92',
1358+
'esql.query.Request': 'esql/query/QueryRequest.ts#L27-L99',
13581359
'esql.query.Response': 'esql/query/QueryResponse.ts#L22-L25',
13591360
'features._types.Feature': 'features/_types/Feature.ts#L20-L23',
13601361
'features.get_features.Request': 'features/get_features/GetFeaturesRequest.ts#L22-L37',
@@ -1388,10 +1389,10 @@
13881389
'ilm._types.WaitForSnapshotAction': 'ilm/_types/Phase.ts#L145-L147',
13891390
'ilm.delete_lifecycle.Request': 'ilm/delete_lifecycle/DeleteLifecycleRequest.ts#L24-L51',
13901391
'ilm.delete_lifecycle.Response': 'ilm/delete_lifecycle/DeleteLifecycleResponse.ts#L22-L24',
1391-
'ilm.explain_lifecycle.LifecycleExplain': 'ilm/explain_lifecycle/types.ts#L59-L62',
1392-
'ilm.explain_lifecycle.LifecycleExplainManaged': 'ilm/explain_lifecycle/types.ts#L26-L52',
1393-
'ilm.explain_lifecycle.LifecycleExplainPhaseExecution': 'ilm/explain_lifecycle/types.ts#L64-L68',
1394-
'ilm.explain_lifecycle.LifecycleExplainUnmanaged': 'ilm/explain_lifecycle/types.ts#L54-L57',
1392+
'ilm.explain_lifecycle.LifecycleExplain': 'ilm/explain_lifecycle/types.ts#L64-L67',
1393+
'ilm.explain_lifecycle.LifecycleExplainManaged': 'ilm/explain_lifecycle/types.ts#L27-L57',
1394+
'ilm.explain_lifecycle.LifecycleExplainPhaseExecution': 'ilm/explain_lifecycle/types.ts#L69-L74',
1395+
'ilm.explain_lifecycle.LifecycleExplainUnmanaged': 'ilm/explain_lifecycle/types.ts#L59-L62',
13951396
'ilm.explain_lifecycle.Request': 'ilm/explain_lifecycle/ExplainLifecycleRequest.ts#L24-L62',
13961397
'ilm.explain_lifecycle.Response': 'ilm/explain_lifecycle/ExplainLifecycleResponse.ts#L24-L28',
13971398
'ilm.get_lifecycle.Lifecycle': 'ilm/get_lifecycle/types.ts#L24-L28',
@@ -1694,8 +1695,9 @@
16941695
'indices.validate_query.Response': 'indices/validate_query/IndicesValidateQueryResponse.ts#L23-L30',
16951696
'inference._types.CompletionResult': 'inference/_types/Results.ts#L60-L65',
16961697
'inference._types.DeleteInferenceEndpointResult': 'inference/_types/Results.ts#L91-L96',
1697-
'inference._types.InferenceEndpoint': 'inference/_types/Services.ts#L23-L39',
1698-
'inference._types.InferenceEndpointInfo': 'inference/_types/Services.ts#L41-L53',
1698+
'inference._types.InferenceChunkingSettings': 'inference/_types/Services.ts#L60-L90',
1699+
'inference._types.InferenceEndpoint': 'inference/_types/Services.ts#L24-L44',
1700+
'inference._types.InferenceEndpointInfo': 'inference/_types/Services.ts#L46-L58',
16991701
'inference._types.InferenceResult': 'inference/_types/Results.ts#L79-L89',
17001702
'inference._types.RankedDocument': 'inference/_types/Results.ts#L67-L77',
17011703
'inference._types.SparseEmbeddingResult': 'inference/_types/Results.ts#L36-L38',
@@ -3040,10 +3042,10 @@
30403042
if (hash.length > 1) {
30413043
hash = hash.substring(1);
30423044
}
3043-
window.location = "https://github.com/elastic/elasticsearch-specification/tree/84ad6dc6dc148b339efb98e35ec166a97774ea92/specification/" + (paths[hash] || "");
3045+
window.location = "https://github.com/elastic/elasticsearch-specification/tree/7325c4238d52ed0719422074adfada371cb0b031/specification/" + (paths[hash] || "");
30443046
</script>
30453047
</head>
30463048
<body>
3047-
Please see the <a href="https://github.com/elastic/elasticsearch-specification/tree/84ad6dc6dc148b339efb98e35ec166a97774ea92/specification/">Elasticsearch API specification</a>.
3049+
Please see the <a href="https://github.com/elastic/elasticsearch-specification/tree/7325c4238d52ed0719422074adfada371cb0b031/specification/">Elasticsearch API specification</a>.
30483050
</body>
30493051
</html>

0 commit comments

Comments
 (0)