Skip to content

Commit 767ee11

Browse files
committed
[codegen] update to latest api spec
1 parent 07bfeda commit 767ee11

12 files changed

+264
-255
lines changed

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

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1509,22 +1509,22 @@
15091509
'indices.validate_query.Request': 'indices/validate_query/IndicesValidateQueryRequest.ts#L25-L111',
15101510
'indices.validate_query.Response': 'indices/validate_query/IndicesValidateQueryResponse.ts#L23-L30',
15111511
'inference._types.CompletionResult': 'inference/_types/Results.ts#L59-L64',
1512+
'inference._types.InferenceEndpoint': 'inference/_types/Services.ts#L23-L39',
1513+
'inference._types.InferenceEndpointInfo': 'inference/_types/Services.ts#L41-L53',
15121514
'inference._types.InferenceResult': 'inference/_types/Results.ts#L77-L87',
1513-
'inference._types.ModelConfig': 'inference/_types/Services.ts#L23-L39',
1514-
'inference._types.ModelConfigContainer': 'inference/_types/Services.ts#L41-L53',
15151515
'inference._types.RankedDocument': 'inference/_types/Results.ts#L66-L76',
15161516
'inference._types.SparseEmbeddingResult': 'inference/_types/Results.ts#L35-L37',
15171517
'inference._types.TaskType': 'inference/_types/TaskType.ts#L20-L28',
15181518
'inference._types.TextEmbeddingByteResult': 'inference/_types/Results.ts#L45-L50',
15191519
'inference._types.TextEmbeddingResult': 'inference/_types/Results.ts#L52-L57',
1520-
'inference.delete_model.Request': 'inference/delete_model/DeleteModelRequest.ts#L24-L41',
1521-
'inference.delete_model.Response': 'inference/delete_model/DeleteModelResponse.ts#L22-L24',
1522-
'inference.get_model.Request': 'inference/get_model/GetModelRequest.ts#L24-L41',
1523-
'inference.get_model.Response': 'inference/get_model/GetModelResponse.ts#L22-L26',
1520+
'inference.delete.Request': 'inference/delete/DeleteRequest.ts#L24-L41',
1521+
'inference.delete.Response': 'inference/delete/DeleteResponse.ts#L22-L24',
1522+
'inference.get.Request': 'inference/get/GetRequest.ts#L24-L41',
1523+
'inference.get.Response': 'inference/get/GetResponse.ts#L22-L26',
15241524
'inference.inference.Request': 'inference/inference/InferenceRequest.ts#L26-L66',
15251525
'inference.inference.Response': 'inference/inference/InferenceResponse.ts#L22-L24',
1526-
'inference.put_model.Request': 'inference/put_model/PutModelRequest.ts#L25-L44',
1527-
'inference.put_model.Response': 'inference/put_model/PutModelResponse.ts#L22-L24',
1526+
'inference.put.Request': 'inference/put/PutRequest.ts#L25-L44',
1527+
'inference.put.Response': 'inference/put/PutResponse.ts#L22-L24',
15281528
'ingest._types.AppendProcessor': 'ingest/_types/Processors.ts#L279-L294',
15291529
'ingest._types.AttachmentProcessor': 'ingest/_types/Processors.ts#L296-L337',
15301530
'ingest._types.BytesProcessor': 'ingest/_types/Processors.ts#L392-L408',
@@ -2714,10 +2714,10 @@
27142714
if (hash.length > 1) {
27152715
hash = hash.substring(1);
27162716
}
2717-
window.location = "https://github.com/elastic/elasticsearch-specification/tree/0bdc82a1d8e22d0479d280a2e0e9ba1ffeb86d05/specification/" + (paths[hash] || "");
2717+
window.location = "https://github.com/elastic/elasticsearch-specification/tree/8d0b9be127b5ca759345e10ea9d571a7ea352b6f/specification/" + (paths[hash] || "");
27182718
</script>
27192719
</head>
27202720
<body>
2721-
Please see the <a href="https://github.com/elastic/elasticsearch-specification/tree/0bdc82a1d8e22d0479d280a2e0e9ba1ffeb86d05/specification/">Elasticsearch API specification</a>.
2721+
Please see the <a href="https://github.com/elastic/elasticsearch-specification/tree/8d0b9be127b5ca759345e10ea9d571a7ea352b6f/specification/">Elasticsearch API specification</a>.
27222722
</body>
27232723
</html>

java-client/src/main/java/co/elastic/clients/elasticsearch/inference/DeleteModelRequest.java renamed to java-client/src/main/java/co/elastic/clients/elasticsearch/inference/DeleteInferenceRequest.java

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -53,31 +53,31 @@
5353
//
5454
//----------------------------------------------------------------
5555

56-
// typedef: inference.delete_model.Request
56+
// typedef: inference.delete.Request
5757

5858
/**
59-
* Delete an inference service model
59+
* Delete an inference endpoint
6060
*
61-
* @see <a href="../doc-files/api-spec.html#inference.delete_model.Request">API
61+
* @see <a href="../doc-files/api-spec.html#inference.delete.Request">API
6262
* specification</a>
6363
*/
6464

65-
public class DeleteModelRequest extends RequestBase {
65+
public class DeleteInferenceRequest extends RequestBase {
6666
private final String inferenceId;
6767

6868
@Nullable
6969
private final TaskType taskType;
7070

7171
// ---------------------------------------------------------------------------------------------
7272

73-
private DeleteModelRequest(Builder builder) {
73+
private DeleteInferenceRequest(Builder builder) {
7474

7575
this.inferenceId = ApiTypeHelper.requireNonNull(builder.inferenceId, this, "inferenceId");
7676
this.taskType = builder.taskType;
7777

7878
}
7979

80-
public static DeleteModelRequest of(Function<Builder, ObjectBuilder<DeleteModelRequest>> fn) {
80+
public static DeleteInferenceRequest of(Function<Builder, ObjectBuilder<DeleteInferenceRequest>> fn) {
8181
return fn.apply(new Builder()).build();
8282
}
8383

@@ -103,12 +103,12 @@ public final TaskType taskType() {
103103
// ---------------------------------------------------------------------------------------------
104104

105105
/**
106-
* Builder for {@link DeleteModelRequest}.
106+
* Builder for {@link DeleteInferenceRequest}.
107107
*/
108108

109109
public static class Builder extends RequestBase.AbstractBuilder<Builder>
110110
implements
111-
ObjectBuilder<DeleteModelRequest> {
111+
ObjectBuilder<DeleteInferenceRequest> {
112112
private String inferenceId;
113113

114114
@Nullable
@@ -140,25 +140,25 @@ protected Builder self() {
140140
}
141141

142142
/**
143-
* Builds a {@link DeleteModelRequest}.
143+
* Builds a {@link DeleteInferenceRequest}.
144144
*
145145
* @throws NullPointerException
146146
* if some of the required fields are null.
147147
*/
148-
public DeleteModelRequest build() {
148+
public DeleteInferenceRequest build() {
149149
_checkSingleUse();
150150

151-
return new DeleteModelRequest(this);
151+
return new DeleteInferenceRequest(this);
152152
}
153153
}
154154

155155
// ---------------------------------------------------------------------------------------------
156156

157157
/**
158-
* Endpoint "{@code inference.delete_model}".
158+
* Endpoint "{@code inference.delete}".
159159
*/
160-
public static final Endpoint<DeleteModelRequest, DeleteModelResponse, ErrorResponse> _ENDPOINT = new SimpleEndpoint<>(
161-
"es/inference.delete_model",
160+
public static final Endpoint<DeleteInferenceRequest, DeleteInferenceResponse, ErrorResponse> _ENDPOINT = new SimpleEndpoint<>(
161+
"es/inference.delete",
162162

163163
// Request method
164164
request -> {
@@ -223,5 +223,5 @@ public DeleteModelRequest build() {
223223
request -> {
224224
return Collections.emptyMap();
225225

226-
}, SimpleEndpoint.emptyMap(), false, DeleteModelResponse._DESERIALIZER);
226+
}, SimpleEndpoint.emptyMap(), false, DeleteInferenceResponse._DESERIALIZER);
227227
}

java-client/src/main/java/co/elastic/clients/elasticsearch/inference/DeleteModelResponse.java renamed to java-client/src/main/java/co/elastic/clients/elasticsearch/inference/DeleteInferenceResponse.java

Lines changed: 15 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -44,62 +44,63 @@
4444
//
4545
//----------------------------------------------------------------
4646

47-
// typedef: inference.delete_model.Response
47+
// typedef: inference.delete.Response
4848

4949
/**
5050
*
51-
* @see <a href="../doc-files/api-spec.html#inference.delete_model.Response">API
51+
* @see <a href="../doc-files/api-spec.html#inference.delete.Response">API
5252
* specification</a>
5353
*/
5454
@JsonpDeserializable
55-
public class DeleteModelResponse extends AcknowledgedResponseBase {
55+
public class DeleteInferenceResponse extends AcknowledgedResponseBase {
5656
// ---------------------------------------------------------------------------------------------
5757

58-
private DeleteModelResponse(Builder builder) {
58+
private DeleteInferenceResponse(Builder builder) {
5959
super(builder);
6060

6161
}
6262

63-
public static DeleteModelResponse of(Function<Builder, ObjectBuilder<DeleteModelResponse>> fn) {
63+
public static DeleteInferenceResponse of(Function<Builder, ObjectBuilder<DeleteInferenceResponse>> fn) {
6464
return fn.apply(new Builder()).build();
6565
}
6666

6767
// ---------------------------------------------------------------------------------------------
6868

6969
/**
70-
* Builder for {@link DeleteModelResponse}.
70+
* Builder for {@link DeleteInferenceResponse}.
7171
*/
7272

7373
public static class Builder extends AcknowledgedResponseBase.AbstractBuilder<Builder>
7474
implements
75-
ObjectBuilder<DeleteModelResponse> {
75+
ObjectBuilder<DeleteInferenceResponse> {
7676
@Override
7777
protected Builder self() {
7878
return this;
7979
}
8080

8181
/**
82-
* Builds a {@link DeleteModelResponse}.
82+
* Builds a {@link DeleteInferenceResponse}.
8383
*
8484
* @throws NullPointerException
8585
* if some of the required fields are null.
8686
*/
87-
public DeleteModelResponse build() {
87+
public DeleteInferenceResponse build() {
8888
_checkSingleUse();
8989

90-
return new DeleteModelResponse(this);
90+
return new DeleteInferenceResponse(this);
9191
}
9292
}
9393

9494
// ---------------------------------------------------------------------------------------------
9595

9696
/**
97-
* Json deserializer for {@link DeleteModelResponse}
97+
* Json deserializer for {@link DeleteInferenceResponse}
9898
*/
99-
public static final JsonpDeserializer<DeleteModelResponse> _DESERIALIZER = ObjectBuilderDeserializer
100-
.lazy(Builder::new, DeleteModelResponse::setupDeleteModelResponseDeserializer);
99+
public static final JsonpDeserializer<DeleteInferenceResponse> _DESERIALIZER = ObjectBuilderDeserializer
100+
.lazy(Builder::new, DeleteInferenceResponse::setupDeleteInferenceResponseDeserializer);
101101

102-
protected static void setupDeleteModelResponseDeserializer(ObjectDeserializer<DeleteModelResponse.Builder> op) {
102+
protected static void setupDeleteInferenceResponseDeserializer(
103+
ObjectDeserializer<DeleteInferenceResponse.Builder> op) {
103104
AcknowledgedResponseBase.setupAcknowledgedResponseBaseDeserializer(op);
104105

105106
}

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

Lines changed: 32 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -67,89 +67,89 @@ public ElasticsearchInferenceAsyncClient withTransportOptions(@Nullable Transpor
6767
return new ElasticsearchInferenceAsyncClient(this.transport, transportOptions);
6868
}
6969

70-
// ----- Endpoint: inference.delete_model
70+
// ----- Endpoint: inference.delete
7171

7272
/**
73-
* Delete model in the Inference API
73+
* Delete an inference endpoint
7474
*
7575
* @see <a href=
7676
* "https://www.elastic.co/guide/en/elasticsearch/reference/master/delete-inference-api.html">Documentation
7777
* on elastic.co</a>
7878
*/
7979

80-
public CompletableFuture<DeleteModelResponse> deleteModel(DeleteModelRequest request) {
80+
public CompletableFuture<DeleteInferenceResponse> delete(DeleteInferenceRequest request) {
8181
@SuppressWarnings("unchecked")
82-
JsonEndpoint<DeleteModelRequest, DeleteModelResponse, ErrorResponse> endpoint = (JsonEndpoint<DeleteModelRequest, DeleteModelResponse, ErrorResponse>) DeleteModelRequest._ENDPOINT;
82+
JsonEndpoint<DeleteInferenceRequest, DeleteInferenceResponse, ErrorResponse> endpoint = (JsonEndpoint<DeleteInferenceRequest, DeleteInferenceResponse, ErrorResponse>) DeleteInferenceRequest._ENDPOINT;
8383

8484
return this.transport.performRequestAsync(request, endpoint, this.transportOptions);
8585
}
8686

8787
/**
88-
* Delete model in the Inference API
88+
* Delete an inference endpoint
8989
*
9090
* @param fn
9191
* a function that initializes a builder to create the
92-
* {@link DeleteModelRequest}
92+
* {@link DeleteInferenceRequest}
9393
* @see <a href=
9494
* "https://www.elastic.co/guide/en/elasticsearch/reference/master/delete-inference-api.html">Documentation
9595
* on elastic.co</a>
9696
*/
9797

98-
public final CompletableFuture<DeleteModelResponse> deleteModel(
99-
Function<DeleteModelRequest.Builder, ObjectBuilder<DeleteModelRequest>> fn) {
100-
return deleteModel(fn.apply(new DeleteModelRequest.Builder()).build());
98+
public final CompletableFuture<DeleteInferenceResponse> delete(
99+
Function<DeleteInferenceRequest.Builder, ObjectBuilder<DeleteInferenceRequest>> fn) {
100+
return delete(fn.apply(new DeleteInferenceRequest.Builder()).build());
101101
}
102102

103-
// ----- Endpoint: inference.get_model
103+
// ----- Endpoint: inference.get
104104

105105
/**
106-
* Get a model in the Inference API
106+
* Get an inference endpoint
107107
*
108108
* @see <a href=
109109
* "https://www.elastic.co/guide/en/elasticsearch/reference/master/get-inference-api.html">Documentation
110110
* on elastic.co</a>
111111
*/
112112

113-
public CompletableFuture<GetModelResponse> getModel(GetModelRequest request) {
113+
public CompletableFuture<GetInferenceResponse> get(GetInferenceRequest request) {
114114
@SuppressWarnings("unchecked")
115-
JsonEndpoint<GetModelRequest, GetModelResponse, ErrorResponse> endpoint = (JsonEndpoint<GetModelRequest, GetModelResponse, ErrorResponse>) GetModelRequest._ENDPOINT;
115+
JsonEndpoint<GetInferenceRequest, GetInferenceResponse, ErrorResponse> endpoint = (JsonEndpoint<GetInferenceRequest, GetInferenceResponse, ErrorResponse>) GetInferenceRequest._ENDPOINT;
116116

117117
return this.transport.performRequestAsync(request, endpoint, this.transportOptions);
118118
}
119119

120120
/**
121-
* Get a model in the Inference API
121+
* Get an inference endpoint
122122
*
123123
* @param fn
124124
* a function that initializes a builder to create the
125-
* {@link GetModelRequest}
125+
* {@link GetInferenceRequest}
126126
* @see <a href=
127127
* "https://www.elastic.co/guide/en/elasticsearch/reference/master/get-inference-api.html">Documentation
128128
* on elastic.co</a>
129129
*/
130130

131-
public final CompletableFuture<GetModelResponse> getModel(
132-
Function<GetModelRequest.Builder, ObjectBuilder<GetModelRequest>> fn) {
133-
return getModel(fn.apply(new GetModelRequest.Builder()).build());
131+
public final CompletableFuture<GetInferenceResponse> get(
132+
Function<GetInferenceRequest.Builder, ObjectBuilder<GetInferenceRequest>> fn) {
133+
return get(fn.apply(new GetInferenceRequest.Builder()).build());
134134
}
135135

136136
/**
137-
* Get a model in the Inference API
137+
* Get an inference endpoint
138138
*
139139
* @see <a href=
140140
* "https://www.elastic.co/guide/en/elasticsearch/reference/master/get-inference-api.html">Documentation
141141
* on elastic.co</a>
142142
*/
143143

144-
public CompletableFuture<GetModelResponse> getModel() {
145-
return this.transport.performRequestAsync(new GetModelRequest.Builder().build(), GetModelRequest._ENDPOINT,
146-
this.transportOptions);
144+
public CompletableFuture<GetInferenceResponse> get() {
145+
return this.transport.performRequestAsync(new GetInferenceRequest.Builder().build(),
146+
GetInferenceRequest._ENDPOINT, this.transportOptions);
147147
}
148148

149149
// ----- Endpoint: inference.inference
150150

151151
/**
152-
* Perform inference on a model
152+
* Perform inference
153153
*
154154
* @see <a href=
155155
* "https://www.elastic.co/guide/en/elasticsearch/reference/master/post-inference-api.html">Documentation
@@ -164,7 +164,7 @@ public CompletableFuture<InferenceResponse> inference(InferenceRequest request)
164164
}
165165

166166
/**
167-
* Perform inference on a model
167+
* Perform inference
168168
*
169169
* @param fn
170170
* a function that initializes a builder to create the
@@ -179,37 +179,36 @@ public final CompletableFuture<InferenceResponse> inference(
179179
return inference(fn.apply(new InferenceRequest.Builder()).build());
180180
}
181181

182-
// ----- Endpoint: inference.put_model
182+
// ----- Endpoint: inference.put
183183

184184
/**
185-
* Configure a model for use in the Inference API
185+
* Configure an inference endpoint for use in the Inference API
186186
*
187187
* @see <a href=
188188
* "https://www.elastic.co/guide/en/elasticsearch/reference/master/put-inference-api.html">Documentation
189189
* on elastic.co</a>
190190
*/
191191

192-
public CompletableFuture<PutModelResponse> putModel(PutModelRequest request) {
192+
public CompletableFuture<PutResponse> put(PutRequest request) {
193193
@SuppressWarnings("unchecked")
194-
JsonEndpoint<PutModelRequest, PutModelResponse, ErrorResponse> endpoint = (JsonEndpoint<PutModelRequest, PutModelResponse, ErrorResponse>) PutModelRequest._ENDPOINT;
194+
JsonEndpoint<PutRequest, PutResponse, ErrorResponse> endpoint = (JsonEndpoint<PutRequest, PutResponse, ErrorResponse>) PutRequest._ENDPOINT;
195195

196196
return this.transport.performRequestAsync(request, endpoint, this.transportOptions);
197197
}
198198

199199
/**
200-
* Configure a model for use in the Inference API
200+
* Configure an inference endpoint for use in the Inference API
201201
*
202202
* @param fn
203203
* a function that initializes a builder to create the
204-
* {@link PutModelRequest}
204+
* {@link PutRequest}
205205
* @see <a href=
206206
* "https://www.elastic.co/guide/en/elasticsearch/reference/master/put-inference-api.html">Documentation
207207
* on elastic.co</a>
208208
*/
209209

210-
public final CompletableFuture<PutModelResponse> putModel(
211-
Function<PutModelRequest.Builder, ObjectBuilder<PutModelRequest>> fn) {
212-
return putModel(fn.apply(new PutModelRequest.Builder()).build());
210+
public final CompletableFuture<PutResponse> put(Function<PutRequest.Builder, ObjectBuilder<PutRequest>> fn) {
211+
return put(fn.apply(new PutRequest.Builder()).build());
213212
}
214213

215214
}

0 commit comments

Comments
 (0)