Skip to content

Commit f9da81a

Browse files
[codegen] update to latest spec (#1176)
Co-authored-by: Laura Trotta <laura.trotta@elastic.co>
1 parent 312b38b commit f9da81a

File tree

7 files changed

+659
-11
lines changed

7 files changed

+659
-11
lines changed

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

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1487,7 +1487,7 @@
14871487
'esql.list_queries.Response': 'esql/list_queries/ListQueriesResponse.ts#L32-L36',
14881488
'esql.put_view.Request': 'esql/put_view/PutViewRequest.ts#L23-L49',
14891489
'esql.put_view.Response': 'esql/put_view/PutViewResponse.ts#L22-L25',
1490-
'esql.query.Request': 'esql/query/QueryRequest.ts#L28-L128',
1490+
'esql.query.Request': 'esql/query/QueryRequest.ts#L28-L140',
14911491
'esql.query.Response': 'esql/query/QueryResponse.ts#L22-L25',
14921492
'features._types.Feature': 'features/_types/Feature.ts#L20-L23',
14931493
'features.get_features.Request': 'features/get_features/GetFeaturesRequest.ts#L24-L56',
@@ -2074,7 +2074,7 @@
20742074
'inference.completion.Response': 'inference/completion/CompletionResponse.ts#L22-L25',
20752075
'inference.delete.Request': 'inference/delete/DeleteRequest.ts#L24-L69',
20762076
'inference.delete.Response': 'inference/delete/DeleteResponse.ts#L22-L25',
2077-
'inference.get.Request': 'inference/get/GetRequest.ts#L24-L59',
2077+
'inference.get.Request': 'inference/get/GetRequest.ts#L24-L64',
20782078
'inference.get.Response': 'inference/get/GetResponse.ts#L22-L26',
20792079
'inference.inference.Request': 'inference/inference/InferenceRequest.ts#L26-L106',
20802080
'inference.inference.Response': 'inference/inference/InferenceResponse.ts#L22-L25',
@@ -3423,8 +3423,8 @@
34233423
'watcher.update_settings.Request': 'watcher/update_settings/WatcherUpdateSettingsRequest.ts#L25-L66',
34243424
'watcher.update_settings.Response': 'watcher/update_settings/WatcherUpdateSettingsResponse.ts#L20-L24',
34253425
'xpack.info.BuildInformation': 'xpack/info/types.ts#L24-L27',
3426-
'xpack.info.Feature': 'xpack/info/types.ts#L84-L89',
3427-
'xpack.info.Features': 'xpack/info/types.ts#L42-L82',
3426+
'xpack.info.Feature': 'xpack/info/types.ts#L88-L93',
3427+
'xpack.info.Features': 'xpack/info/types.ts#L42-L86',
34283428
'xpack.info.MinimalLicenseInformation': 'xpack/info/types.ts#L34-L40',
34293429
'xpack.info.NativeCodeInformation': 'xpack/info/types.ts#L29-L32',
34303430
'xpack.info.Request': 'xpack/info/XPackInfoRequest.ts#L23-L63',
@@ -3449,6 +3449,8 @@
34493449
'xpack.usage.EqlFeaturesSequences': 'xpack/usage/types.ts#L127-L134',
34503450
'xpack.usage.FeatureToggle': 'xpack/usage/types.ts#L37-L39',
34513451
'xpack.usage.Flattened': 'xpack/usage/types.ts#L399-L401',
3452+
'xpack.usage.GpuNodeStats': 'xpack/usage/types.ts#L510-L522',
3453+
'xpack.usage.GpuVectorIndexing': 'xpack/usage/types.ts#L524-L534',
34523454
'xpack.usage.HealthStatistics': 'xpack/usage/types.ts#L150-L152',
34533455
'xpack.usage.Ilm': 'xpack/usage/types.ts#L172-L175',
34543456
'xpack.usage.IlmPolicyStatistics': 'xpack/usage/types.ts#L167-L170',
@@ -3476,7 +3478,7 @@
34763478
'xpack.usage.Realm': 'xpack/usage/types.ts#L456-L465',
34773479
'xpack.usage.RealmCache': 'xpack/usage/types.ts#L276-L278',
34783480
'xpack.usage.Request': 'xpack/usage/XPackUsageRequest.ts#L24-L52',
3479-
'xpack.usage.Response': 'xpack/usage/XPackUsageResponse.ts#L42-L77',
3481+
'xpack.usage.Response': 'xpack/usage/XPackUsageResponse.ts#L43-L82',
34803482
'xpack.usage.RoleMapping': 'xpack/usage/types.ts#L280-L283',
34813483
'xpack.usage.RuntimeFieldTypes': 'xpack/usage/types.ts#L285-L287',
34823484
'xpack.usage.RuntimeFieldsType': 'xpack/usage/types.ts#L289-L304',
@@ -3502,10 +3504,10 @@
35023504
if (hash.length > 1) {
35033505
hash = hash.substring(1);
35043506
}
3505-
window.location = "https://github.com/elastic/elasticsearch-specification/tree/0d7660dad7514c66b2d9beebacca4fb54575d857/specification/" + (paths[hash] || "");
3507+
window.location = "https://github.com/elastic/elasticsearch-specification/tree/e19c0a81f07307768d2b3db53a8d885a25479d34/specification/" + (paths[hash] || "");
35063508
</script>
35073509
</head>
35083510
<body>
3509-
Please see the <a href="https://github.com/elastic/elasticsearch-specification/tree/0d7660dad7514c66b2d9beebacca4fb54575d857/specification/">Elasticsearch API specification</a>.
3511+
Please see the <a href="https://github.com/elastic/elasticsearch-specification/tree/e19c0a81f07307768d2b3db53a8d885a25479d34/specification/">Elasticsearch API specification</a>.
35103512
</body>
35113513
</html>

java-client/src/main/java/co/elastic/clients/elasticsearch/esql/QueryRequest.java

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,9 @@ public class QueryRequest extends RequestBase implements JsonpSerializable {
106106
@Nullable
107107
private final Boolean profile;
108108

109+
@Nullable
110+
private final String projectRouting;
111+
109112
private final String query;
110113

111114
private final Map<String, Map<String, TableValues>> tables;
@@ -125,6 +128,7 @@ private QueryRequest(Builder builder) {
125128
this.locale = builder.locale;
126129
this.params = ApiTypeHelper.unmodifiable(builder.params);
127130
this.profile = builder.profile;
131+
this.projectRouting = builder.projectRouting;
128132
this.query = ApiTypeHelper.requireNonNull(builder.query, this, "query");
129133
this.tables = ApiTypeHelper.unmodifiable(builder.tables);
130134

@@ -272,6 +276,19 @@ public final Boolean profile() {
272276
return this.profile;
273277
}
274278

279+
/**
280+
* Specifies a subset of projects to target using project metadata tags in a
281+
* subset of Lucene query syntax. Allowed Lucene queries: the _alias tag and a
282+
* single value (possibly wildcarded). Examples: _alias:my-project
283+
* _alias:_origin _alias:<em>pr</em> Supported in serverless only.
284+
* <p>
285+
* API name: {@code project_routing}
286+
*/
287+
@Nullable
288+
public final String projectRouting() {
289+
return this.projectRouting;
290+
}
291+
275292
/**
276293
* Required - The ES|QL query API accepts an ES|QL query string in the query
277294
* parameter, runs it, and returns the results.
@@ -342,6 +359,11 @@ protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) {
342359
generator.writeKey("profile");
343360
generator.write(this.profile);
344361

362+
}
363+
if (this.projectRouting != null) {
364+
generator.writeKey("project_routing");
365+
generator.write(this.projectRouting);
366+
345367
}
346368
generator.writeKey("query");
347369
generator.write(this.query);
@@ -408,6 +430,9 @@ public static class Builder extends RequestBase.AbstractBuilder<Builder> impleme
408430
@Nullable
409431
private Boolean profile;
410432

433+
@Nullable
434+
private String projectRouting;
435+
411436
private String query;
412437

413438
@Nullable
@@ -427,6 +452,7 @@ private Builder(QueryRequest instance) {
427452
this.locale = instance.locale;
428453
this.params = instance.params;
429454
this.profile = instance.profile;
455+
this.projectRouting = instance.projectRouting;
430456
this.query = instance.query;
431457
this.tables = instance.tables;
432458

@@ -688,6 +714,19 @@ public final Builder profile(@Nullable Boolean value) {
688714
return this;
689715
}
690716

717+
/**
718+
* Specifies a subset of projects to target using project metadata tags in a
719+
* subset of Lucene query syntax. Allowed Lucene queries: the _alias tag and a
720+
* single value (possibly wildcarded). Examples: _alias:my-project
721+
* _alias:_origin _alias:<em>pr</em> Supported in serverless only.
722+
* <p>
723+
* API name: {@code project_routing}
724+
*/
725+
public final Builder projectRouting(@Nullable String value) {
726+
this.projectRouting = value;
727+
return this;
728+
}
729+
691730
/**
692731
* Required - The ES|QL query API accepts an ES|QL query string in the query
693732
* parameter, runs it, and returns the results.
@@ -767,6 +806,7 @@ protected static void setupQueryRequestDeserializer(ObjectDeserializer<QueryRequ
767806
op.add(Builder::locale, JsonpDeserializer.stringDeserializer(), "locale");
768807
op.add(Builder::params, JsonpDeserializer.arrayDeserializer(FieldValue._DESERIALIZER), "params");
769808
op.add(Builder::profile, JsonpDeserializer.booleanDeserializer(), "profile");
809+
op.add(Builder::projectRouting, JsonpDeserializer.stringDeserializer(), "project_routing");
770810
op.add(Builder::query, JsonpDeserializer.stringDeserializer(), "query");
771811
op.add(Builder::tables, JsonpDeserializer
772812
.stringMapDeserializer(JsonpDeserializer.stringMapDeserializer(TableValues._DESERIALIZER)), "tables");

java-client/src/main/java/co/elastic/clients/elasticsearch/inference/GetInferenceRequest.java

Lines changed: 21 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,10 @@ public static GetInferenceRequest of(Function<Builder, ObjectBuilder<GetInferenc
8686
}
8787

8888
/**
89-
* The inference Id
89+
* The inference Id of the endpoint to return. Using <code>_all</code> or
90+
* <code>*</code> will return all endpoints with the specified
91+
* <code>task_type</code> if one is specified, or all endpoints for all task
92+
* types if no <code>task_type</code> is specified
9093
* <p>
9194
* API name: {@code inference_id}
9295
*/
@@ -96,7 +99,7 @@ public final String inferenceId() {
9699
}
97100

98101
/**
99-
* The task type
102+
* The task type of the endpoint to return
100103
* <p>
101104
* API name: {@code task_type}
102105
*/
@@ -128,7 +131,10 @@ private Builder(GetInferenceRequest instance) {
128131

129132
}
130133
/**
131-
* The inference Id
134+
* The inference Id of the endpoint to return. Using <code>_all</code> or
135+
* <code>*</code> will return all endpoints with the specified
136+
* <code>task_type</code> if one is specified, or all endpoints for all task
137+
* types if no <code>task_type</code> is specified
132138
* <p>
133139
* API name: {@code inference_id}
134140
*/
@@ -138,7 +144,7 @@ public final Builder inferenceId(@Nullable String value) {
138144
}
139145

140146
/**
141-
* The task type
147+
* The task type of the endpoint to return
142148
* <p>
143149
* API name: {@code task_type}
144150
*/
@@ -218,6 +224,14 @@ public Builder rebuild() {
218224
SimpleEndpoint.pathEncode(request.inferenceId, buf);
219225
return buf.toString();
220226
}
227+
if (propsSet == (_taskType)) {
228+
StringBuilder buf = new StringBuilder();
229+
buf.append("/_inference");
230+
buf.append("/");
231+
SimpleEndpoint.pathEncode(request.taskType.jsonValue(), buf);
232+
buf.append("/_all");
233+
return buf.toString();
234+
}
221235
throw SimpleEndpoint.noPathTemplateFound("path");
222236

223237
},
@@ -244,6 +258,9 @@ public Builder rebuild() {
244258
params.put("taskType", request.taskType.jsonValue());
245259
params.put("inferenceId", request.inferenceId);
246260
}
261+
if (propsSet == (_taskType)) {
262+
params.put("taskType", request.taskType.jsonValue());
263+
}
247264
return params;
248265
},
249266

java-client/src/main/java/co/elastic/clients/elasticsearch/xpack/XpackUsageResponse.java

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
2727
import co.elastic.clients.elasticsearch.xpack.usage.DataTiers;
2828
import co.elastic.clients.elasticsearch.xpack.usage.Eql;
2929
import co.elastic.clients.elasticsearch.xpack.usage.Flattened;
30+
import co.elastic.clients.elasticsearch.xpack.usage.GpuVectorIndexing;
3031
import co.elastic.clients.elasticsearch.xpack.usage.HealthStatistics;
3132
import co.elastic.clients.elasticsearch.xpack.usage.Ilm;
3233
import co.elastic.clients.elasticsearch.xpack.usage.MachineLearning;
@@ -108,6 +109,9 @@ public class XpackUsageResponse implements JsonpSerializable {
108109

109110
private final Base graph;
110111

112+
@Nullable
113+
private final GpuVectorIndexing gpuVectorIndexing;
114+
111115
@Nullable
112116
private final HealthStatistics healthApi;
113117

@@ -158,6 +162,7 @@ private XpackUsageResponse(Builder builder) {
158162
this.eql = ApiTypeHelper.requireNonNull(builder.eql, this, "eql");
159163
this.flattened = builder.flattened;
160164
this.graph = ApiTypeHelper.requireNonNull(builder.graph, this, "graph");
165+
this.gpuVectorIndexing = builder.gpuVectorIndexing;
161166
this.healthApi = builder.healthApi;
162167
this.ilm = ApiTypeHelper.requireNonNull(builder.ilm, this, "ilm");
163168
this.logstash = ApiTypeHelper.requireNonNull(builder.logstash, this, "logstash");
@@ -277,6 +282,14 @@ public final Base graph() {
277282
return this.graph;
278283
}
279284

285+
/**
286+
* API name: {@code gpu_vector_indexing}
287+
*/
288+
@Nullable
289+
public final GpuVectorIndexing gpuVectorIndexing() {
290+
return this.gpuVectorIndexing;
291+
}
292+
280293
/**
281294
* API name: {@code health_api}
282295
*/
@@ -445,6 +458,11 @@ protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) {
445458
generator.writeKey("graph");
446459
this.graph.serialize(generator, mapper);
447460

461+
if (this.gpuVectorIndexing != null) {
462+
generator.writeKey("gpu_vector_indexing");
463+
this.gpuVectorIndexing.serialize(generator, mapper);
464+
465+
}
448466
if (this.healthApi != null) {
449467
generator.writeKey("health_api");
450468
this.healthApi.serialize(generator, mapper);
@@ -543,6 +561,9 @@ public static class Builder extends WithJsonObjectBuilderBase<Builder>
543561

544562
private Base graph;
545563

564+
@Nullable
565+
private GpuVectorIndexing gpuVectorIndexing;
566+
546567
@Nullable
547568
private HealthStatistics healthApi;
548569

@@ -771,6 +792,22 @@ public final Builder graph(Function<Base.Builder, ObjectBuilder<Base>> fn) {
771792
return this.graph(fn.apply(new Base.Builder()).build());
772793
}
773794

795+
/**
796+
* API name: {@code gpu_vector_indexing}
797+
*/
798+
public final Builder gpuVectorIndexing(@Nullable GpuVectorIndexing value) {
799+
this.gpuVectorIndexing = value;
800+
return this;
801+
}
802+
803+
/**
804+
* API name: {@code gpu_vector_indexing}
805+
*/
806+
public final Builder gpuVectorIndexing(
807+
Function<GpuVectorIndexing.Builder, ObjectBuilder<GpuVectorIndexing>> fn) {
808+
return this.gpuVectorIndexing(fn.apply(new GpuVectorIndexing.Builder()).build());
809+
}
810+
774811
/**
775812
* API name: {@code health_api}
776813
*/
@@ -1038,6 +1075,7 @@ protected static void setupXpackUsageResponseDeserializer(ObjectDeserializer<Xpa
10381075
op.add(Builder::eql, Eql._DESERIALIZER, "eql");
10391076
op.add(Builder::flattened, Flattened._DESERIALIZER, "flattened");
10401077
op.add(Builder::graph, Base._DESERIALIZER, "graph");
1078+
op.add(Builder::gpuVectorIndexing, GpuVectorIndexing._DESERIALIZER, "gpu_vector_indexing");
10411079
op.add(Builder::healthApi, HealthStatistics._DESERIALIZER, "health_api");
10421080
op.add(Builder::ilm, Ilm._DESERIALIZER, "ilm");
10431081
op.add(Builder::logstash, Base._DESERIALIZER, "logstash");

0 commit comments

Comments
 (0)