Skip to content

Commit c8fdfca

Browse files
committed
[codegen] Update to latest API spec
1 parent 25e61a5 commit c8fdfca

File tree

177 files changed

+20103
-2149
lines changed

Some content is hidden

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

177 files changed

+20103
-2149
lines changed

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

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,8 @@
6464
import co.elastic.clients.elasticsearch.core.GetScriptResponse;
6565
import co.elastic.clients.elasticsearch.core.GetSourceRequest;
6666
import co.elastic.clients.elasticsearch.core.GetSourceResponse;
67+
import co.elastic.clients.elasticsearch.core.HealthReportRequest;
68+
import co.elastic.clients.elasticsearch.core.HealthReportResponse;
6769
import co.elastic.clients.elasticsearch.core.IndexRequest;
6870
import co.elastic.clients.elasticsearch.core.IndexResponse;
6971
import co.elastic.clients.elasticsearch.core.InfoRequest;
@@ -128,6 +130,7 @@
128130
import co.elastic.clients.elasticsearch.monitoring.ElasticsearchMonitoringAsyncClient;
129131
import co.elastic.clients.elasticsearch.nodes.ElasticsearchNodesAsyncClient;
130132
import co.elastic.clients.elasticsearch.rollup.ElasticsearchRollupAsyncClient;
133+
import co.elastic.clients.elasticsearch.search_application.ElasticsearchSearchApplicationAsyncClient;
131134
import co.elastic.clients.elasticsearch.searchable_snapshots.ElasticsearchSearchableSnapshotsAsyncClient;
132135
import co.elastic.clients.elasticsearch.security.ElasticsearchSecurityAsyncClient;
133136
import co.elastic.clients.elasticsearch.shutdown.ElasticsearchShutdownAsyncClient;
@@ -257,6 +260,10 @@ public ElasticsearchRollupAsyncClient rollup() {
257260
return new ElasticsearchRollupAsyncClient(this.transport, this.transportOptions);
258261
}
259262

263+
public ElasticsearchSearchApplicationAsyncClient searchApplication() {
264+
return new ElasticsearchSearchApplicationAsyncClient(this.transport, this.transportOptions);
265+
}
266+
260267
public ElasticsearchSearchableSnapshotsAsyncClient searchableSnapshots() {
261268
return new ElasticsearchSearchableSnapshotsAsyncClient(this.transport, this.transportOptions);
262269
}
@@ -1033,6 +1040,52 @@ public final <TDocument> CompletableFuture<GetSourceResponse<TDocument>> getSour
10331040
return getSource(fn.apply(new GetSourceRequest.Builder()).build(), tDocumentType);
10341041
}
10351042

1043+
// ----- Endpoint: health_report
1044+
1045+
/**
1046+
* Returns the health of the cluster.
1047+
*
1048+
* @see <a href=
1049+
* "https://www.elastic.co/guide/en/elasticsearch/reference/current/health-api.html">Documentation
1050+
* on elastic.co</a>
1051+
*/
1052+
1053+
public CompletableFuture<HealthReportResponse> healthReport(HealthReportRequest request) {
1054+
@SuppressWarnings("unchecked")
1055+
JsonEndpoint<HealthReportRequest, HealthReportResponse, ErrorResponse> endpoint = (JsonEndpoint<HealthReportRequest, HealthReportResponse, ErrorResponse>) HealthReportRequest._ENDPOINT;
1056+
1057+
return this.transport.performRequestAsync(request, endpoint, this.transportOptions);
1058+
}
1059+
1060+
/**
1061+
* Returns the health of the cluster.
1062+
*
1063+
* @param fn
1064+
* a function that initializes a builder to create the
1065+
* {@link HealthReportRequest}
1066+
* @see <a href=
1067+
* "https://www.elastic.co/guide/en/elasticsearch/reference/current/health-api.html">Documentation
1068+
* on elastic.co</a>
1069+
*/
1070+
1071+
public final CompletableFuture<HealthReportResponse> healthReport(
1072+
Function<HealthReportRequest.Builder, ObjectBuilder<HealthReportRequest>> fn) {
1073+
return healthReport(fn.apply(new HealthReportRequest.Builder()).build());
1074+
}
1075+
1076+
/**
1077+
* Returns the health of the cluster.
1078+
*
1079+
* @see <a href=
1080+
* "https://www.elastic.co/guide/en/elasticsearch/reference/current/health-api.html">Documentation
1081+
* on elastic.co</a>
1082+
*/
1083+
1084+
public CompletableFuture<HealthReportResponse> healthReport() {
1085+
return this.transport.performRequestAsync(new HealthReportRequest.Builder().build(),
1086+
HealthReportRequest._ENDPOINT, this.transportOptions);
1087+
}
1088+
10361089
// ----- Endpoint: index
10371090

10381091
/**

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

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,8 @@
6565
import co.elastic.clients.elasticsearch.core.GetScriptResponse;
6666
import co.elastic.clients.elasticsearch.core.GetSourceRequest;
6767
import co.elastic.clients.elasticsearch.core.GetSourceResponse;
68+
import co.elastic.clients.elasticsearch.core.HealthReportRequest;
69+
import co.elastic.clients.elasticsearch.core.HealthReportResponse;
6870
import co.elastic.clients.elasticsearch.core.IndexRequest;
6971
import co.elastic.clients.elasticsearch.core.IndexResponse;
7072
import co.elastic.clients.elasticsearch.core.InfoRequest;
@@ -129,6 +131,7 @@
129131
import co.elastic.clients.elasticsearch.monitoring.ElasticsearchMonitoringClient;
130132
import co.elastic.clients.elasticsearch.nodes.ElasticsearchNodesClient;
131133
import co.elastic.clients.elasticsearch.rollup.ElasticsearchRollupClient;
134+
import co.elastic.clients.elasticsearch.search_application.ElasticsearchSearchApplicationClient;
132135
import co.elastic.clients.elasticsearch.searchable_snapshots.ElasticsearchSearchableSnapshotsClient;
133136
import co.elastic.clients.elasticsearch.security.ElasticsearchSecurityClient;
134137
import co.elastic.clients.elasticsearch.shutdown.ElasticsearchShutdownClient;
@@ -258,6 +261,10 @@ public ElasticsearchRollupClient rollup() {
258261
return new ElasticsearchRollupClient(this.transport, this.transportOptions);
259262
}
260263

264+
public ElasticsearchSearchApplicationClient searchApplication() {
265+
return new ElasticsearchSearchApplicationClient(this.transport, this.transportOptions);
266+
}
267+
261268
public ElasticsearchSearchableSnapshotsClient searchableSnapshots() {
262269
return new ElasticsearchSearchableSnapshotsClient(this.transport, this.transportOptions);
263270
}
@@ -1050,6 +1057,53 @@ public final <TDocument> GetSourceResponse<TDocument> getSource(
10501057
return getSource(fn.apply(new GetSourceRequest.Builder()).build(), tDocumentType);
10511058
}
10521059

1060+
// ----- Endpoint: health_report
1061+
1062+
/**
1063+
* Returns the health of the cluster.
1064+
*
1065+
* @see <a href=
1066+
* "https://www.elastic.co/guide/en/elasticsearch/reference/current/health-api.html">Documentation
1067+
* on elastic.co</a>
1068+
*/
1069+
1070+
public HealthReportResponse healthReport(HealthReportRequest request) throws IOException, ElasticsearchException {
1071+
@SuppressWarnings("unchecked")
1072+
JsonEndpoint<HealthReportRequest, HealthReportResponse, ErrorResponse> endpoint = (JsonEndpoint<HealthReportRequest, HealthReportResponse, ErrorResponse>) HealthReportRequest._ENDPOINT;
1073+
1074+
return this.transport.performRequest(request, endpoint, this.transportOptions);
1075+
}
1076+
1077+
/**
1078+
* Returns the health of the cluster.
1079+
*
1080+
* @param fn
1081+
* a function that initializes a builder to create the
1082+
* {@link HealthReportRequest}
1083+
* @see <a href=
1084+
* "https://www.elastic.co/guide/en/elasticsearch/reference/current/health-api.html">Documentation
1085+
* on elastic.co</a>
1086+
*/
1087+
1088+
public final HealthReportResponse healthReport(
1089+
Function<HealthReportRequest.Builder, ObjectBuilder<HealthReportRequest>> fn)
1090+
throws IOException, ElasticsearchException {
1091+
return healthReport(fn.apply(new HealthReportRequest.Builder()).build());
1092+
}
1093+
1094+
/**
1095+
* Returns the health of the cluster.
1096+
*
1097+
* @see <a href=
1098+
* "https://www.elastic.co/guide/en/elasticsearch/reference/current/health-api.html">Documentation
1099+
* on elastic.co</a>
1100+
*/
1101+
1102+
public HealthReportResponse healthReport() throws IOException, ElasticsearchException {
1103+
return this.transport.performRequest(new HealthReportRequest.Builder().build(), HealthReportRequest._ENDPOINT,
1104+
this.transportOptions);
1105+
}
1106+
10531107
// ----- Endpoint: index
10541108

10551109
/**
Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
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+
//----------------------------------------------------
21+
// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST.
22+
//----------------------------------------------------
23+
24+
package co.elastic.clients.elasticsearch._types;
25+
26+
import co.elastic.clients.json.JsonEnum;
27+
import co.elastic.clients.json.JsonpDeserializable;
28+
import co.elastic.clients.json.JsonpDeserializer;
29+
30+
/**
31+
*
32+
* @see <a href="../doc-files/api-spec.html#_types.ClusterInfoTarget">API
33+
* specification</a>
34+
*/
35+
@JsonpDeserializable
36+
public enum ClusterInfoTarget implements JsonEnum {
37+
All("_all"),
38+
39+
Http("http"),
40+
41+
Ingest("ingest"),
42+
43+
ThreadPool("thread_pool"),
44+
45+
Script("script"),
46+
47+
;
48+
49+
private final String jsonValue;
50+
51+
ClusterInfoTarget(String jsonValue) {
52+
this.jsonValue = jsonValue;
53+
}
54+
55+
public String jsonValue() {
56+
return this.jsonValue;
57+
}
58+
59+
public static final JsonEnum.Deserializer<ClusterInfoTarget> _DESERIALIZER = new JsonEnum.Deserializer<>(
60+
ClusterInfoTarget.values());
61+
}

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

Lines changed: 58 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,6 @@
3535
import co.elastic.clients.util.ObjectBuilder;
3636
import co.elastic.clients.util.WithJsonObjectBuilderBase;
3737
import jakarta.json.stream.JsonGenerator;
38-
import java.lang.Double;
3938
import java.lang.Float;
4039
import java.lang.Long;
4140
import java.lang.String;
@@ -55,7 +54,10 @@
5554
public class KnnQuery implements JsonpSerializable {
5655
private final String field;
5756

58-
private final List<Double> queryVector;
57+
private final List<Float> queryVector;
58+
59+
@Nullable
60+
private final QueryVectorBuilder queryVectorBuilder;
5961

6062
private final long k;
6163

@@ -71,7 +73,8 @@ public class KnnQuery implements JsonpSerializable {
7173
private KnnQuery(Builder builder) {
7274

7375
this.field = ApiTypeHelper.requireNonNull(builder.field, this, "field");
74-
this.queryVector = ApiTypeHelper.unmodifiableRequired(builder.queryVector, this, "queryVector");
76+
this.queryVector = ApiTypeHelper.unmodifiable(builder.queryVector);
77+
this.queryVectorBuilder = builder.queryVectorBuilder;
7578
this.k = ApiTypeHelper.requireNonNull(builder.k, this, "k");
7679
this.numCandidates = ApiTypeHelper.requireNonNull(builder.numCandidates, this, "numCandidates");
7780
this.boost = builder.boost;
@@ -93,14 +96,25 @@ public final String field() {
9396
}
9497

9598
/**
96-
* Required - The query vector
99+
* The query vector
97100
* <p>
98101
* API name: {@code query_vector}
99102
*/
100-
public final List<Double> queryVector() {
103+
public final List<Float> queryVector() {
101104
return this.queryVector;
102105
}
103106

107+
/**
108+
* The query vector builder. You must provide a query_vector_builder or
109+
* query_vector, but not both.
110+
* <p>
111+
* API name: {@code query_vector_builder}
112+
*/
113+
@Nullable
114+
public final QueryVectorBuilder queryVectorBuilder() {
115+
return this.queryVectorBuilder;
116+
}
117+
104118
/**
105119
* Required - The final number of nearest neighbors to return as top hits
106120
* <p>
@@ -155,12 +169,17 @@ protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) {
155169
if (ApiTypeHelper.isDefined(this.queryVector)) {
156170
generator.writeKey("query_vector");
157171
generator.writeStartArray();
158-
for (Double item0 : this.queryVector) {
172+
for (Float item0 : this.queryVector) {
159173
generator.write(item0);
160174

161175
}
162176
generator.writeEnd();
163177

178+
}
179+
if (this.queryVectorBuilder != null) {
180+
generator.writeKey("query_vector_builder");
181+
this.queryVectorBuilder.serialize(generator, mapper);
182+
164183
}
165184
generator.writeKey("k");
166185
generator.write(this.k);
@@ -200,7 +219,11 @@ public String toString() {
200219
public static class Builder extends WithJsonObjectBuilderBase<Builder> implements ObjectBuilder<KnnQuery> {
201220
private String field;
202221

203-
private List<Double> queryVector;
222+
@Nullable
223+
private List<Float> queryVector;
224+
225+
@Nullable
226+
private QueryVectorBuilder queryVectorBuilder;
204227

205228
private Long k;
206229

@@ -223,29 +246,51 @@ public final Builder field(String value) {
223246
}
224247

225248
/**
226-
* Required - The query vector
249+
* The query vector
227250
* <p>
228251
* API name: {@code query_vector}
229252
* <p>
230253
* Adds all elements of <code>list</code> to <code>queryVector</code>.
231254
*/
232-
public final Builder queryVector(List<Double> list) {
255+
public final Builder queryVector(List<Float> list) {
233256
this.queryVector = _listAddAll(this.queryVector, list);
234257
return this;
235258
}
236259

237260
/**
238-
* Required - The query vector
261+
* The query vector
239262
* <p>
240263
* API name: {@code query_vector}
241264
* <p>
242265
* Adds one or more values to <code>queryVector</code>.
243266
*/
244-
public final Builder queryVector(Double value, Double... values) {
267+
public final Builder queryVector(Float value, Float... values) {
245268
this.queryVector = _listAdd(this.queryVector, value, values);
246269
return this;
247270
}
248271

272+
/**
273+
* The query vector builder. You must provide a query_vector_builder or
274+
* query_vector, but not both.
275+
* <p>
276+
* API name: {@code query_vector_builder}
277+
*/
278+
public final Builder queryVectorBuilder(@Nullable QueryVectorBuilder value) {
279+
this.queryVectorBuilder = value;
280+
return this;
281+
}
282+
283+
/**
284+
* The query vector builder. You must provide a query_vector_builder or
285+
* query_vector, but not both.
286+
* <p>
287+
* API name: {@code query_vector_builder}
288+
*/
289+
public final Builder queryVectorBuilder(
290+
Function<QueryVectorBuilder.Builder, ObjectBuilder<QueryVectorBuilder>> fn) {
291+
return this.queryVectorBuilder(fn.apply(new QueryVectorBuilder.Builder()).build());
292+
}
293+
249294
/**
250295
* Required - The final number of nearest neighbors to return as top hits
251296
* <p>
@@ -340,8 +385,9 @@ public KnnQuery build() {
340385
protected static void setupKnnQueryDeserializer(ObjectDeserializer<KnnQuery.Builder> op) {
341386

342387
op.add(Builder::field, JsonpDeserializer.stringDeserializer(), "field");
343-
op.add(Builder::queryVector, JsonpDeserializer.arrayDeserializer(JsonpDeserializer.doubleDeserializer()),
388+
op.add(Builder::queryVector, JsonpDeserializer.arrayDeserializer(JsonpDeserializer.floatDeserializer()),
344389
"query_vector");
390+
op.add(Builder::queryVectorBuilder, QueryVectorBuilder._DESERIALIZER, "query_vector_builder");
345391
op.add(Builder::k, JsonpDeserializer.longDeserializer(), "k");
346392
op.add(Builder::numCandidates, JsonpDeserializer.longDeserializer(), "num_candidates");
347393
op.add(Builder::boost, JsonpDeserializer.floatDeserializer(), "boost");

0 commit comments

Comments
 (0)