Skip to content

Commit a98c9d6

Browse files
committed
[codegen] Update to latest 8.9 API spec
1 parent 3d2cb30 commit a98c9d6

File tree

2 files changed

+25
-17
lines changed

2 files changed

+25
-17
lines changed

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

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@
4343
'_global.field_caps.Response': '_global/field_caps/FieldCapabilitiesResponse.ts#L24-L35',
4444
'_global.get.GetResult': '_global/get/types.ts#L25-L35',
4545
'_global.get.Request': '_global/get/GetRequest.ts#L31-L86',
46-
'_global.get.Response': '_global/get/GetResponse.ts#L22-L24',
46+
'_global.get.Response': '_global/get/GetResponse.ts#L23-L34',
4747
'_global.get_script.Request': '_global/get_script/GetScriptRequest.ts#L24-L37',
4848
'_global.get_script.Response': '_global/get_script/GetScriptResponse.ts#L23-L29',
4949
'_global.get_script_context.Context': '_global/get_script_context/types.ts#L22-L25',
@@ -1873,7 +1873,7 @@
18731873
'ml.put_trained_model.Input': 'ml/put_trained_model/types.ts#L56-L58',
18741874
'ml.put_trained_model.OneHotEncodingPreprocessor': 'ml/put_trained_model/types.ts#L44-L47',
18751875
'ml.put_trained_model.Preprocessor': 'ml/put_trained_model/types.ts#L31-L36',
1876-
'ml.put_trained_model.Request': 'ml/put_trained_model/MlPutTrainedModelRequest.ts#L28-L95',
1876+
'ml.put_trained_model.Request': 'ml/put_trained_model/MlPutTrainedModelRequest.ts#L28-L96',
18771877
'ml.put_trained_model.Response': 'ml/put_trained_model/MlPutTrainedModelResponse.ts#L22-L24',
18781878
'ml.put_trained_model.TargetMeanEncodingPreprocessor': 'ml/put_trained_model/types.ts#L49-L54',
18791879
'ml.put_trained_model.TrainedModel': 'ml/put_trained_model/types.ts#L60-L72',
@@ -2612,10 +2612,10 @@
26122612
if (hash.length > 1) {
26132613
hash = hash.substring(1);
26142614
}
2615-
window.location = "https://github.com/elastic/elasticsearch-specification/tree/902222a6495852a7443d24b8a0bf1223b96414e6/specification/" + (paths[hash] || "");
2615+
window.location = "https://github.com/elastic/elasticsearch-specification/tree/26d0e2015b6bb2b1e0c549a4f1abeca6da16e89c/specification/" + (paths[hash] || "");
26162616
</script>
26172617
</head>
26182618
<body>
2619-
Please see the <a href="https://github.com/elastic/elasticsearch-specification/tree/902222a6495852a7443d24b8a0bf1223b96414e6/specification/">Elasticsearch API specification</a>.
2619+
Please see the <a href="https://github.com/elastic/elasticsearch-specification/tree/26d0e2015b6bb2b1e0c549a4f1abeca6da16e89c/specification/">Elasticsearch API specification</a>.
26202620
</body>
26212621
</html>

java-client/src/main/java/co/elastic/clients/elasticsearch/ml/PutTrainedModelRequest.java

Lines changed: 21 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,7 @@ public class PutTrainedModelRequest extends RequestBase implements JsonpSerializ
7272
@Nullable
7373
private final String description;
7474

75+
@Nullable
7576
private final InferenceConfigCreate inferenceConfig;
7677

7778
@Nullable
@@ -98,7 +99,7 @@ private PutTrainedModelRequest(Builder builder) {
9899
this.deferDefinitionDecompression = builder.deferDefinitionDecompression;
99100
this.definition = builder.definition;
100101
this.description = builder.description;
101-
this.inferenceConfig = ApiTypeHelper.requireNonNull(builder.inferenceConfig, this, "inferenceConfig");
102+
this.inferenceConfig = builder.inferenceConfig;
102103
this.input = builder.input;
103104
this.metadata = builder.metadata;
104105
this.modelId = ApiTypeHelper.requireNonNull(builder.modelId, this, "modelId");
@@ -158,12 +159,14 @@ public final String description() {
158159
}
159160

160161
/**
161-
* Required - The default configuration for inference. This can be either a
162-
* regression or classification configuration. It must match the underlying
163-
* definition.trained_model's target_type.
162+
* The default configuration for inference. This can be either a regression or
163+
* classification configuration. It must match the underlying
164+
* definition.trained_model's target_type. For pre-packaged models such as ELSER
165+
* the config is not required.
164166
* <p>
165167
* API name: {@code inference_config}
166168
*/
169+
@Nullable
167170
public final InferenceConfigCreate inferenceConfig() {
168171
return this.inferenceConfig;
169172
}
@@ -254,9 +257,11 @@ protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) {
254257
generator.write(this.description);
255258

256259
}
257-
generator.writeKey("inference_config");
258-
this.inferenceConfig.serialize(generator, mapper);
260+
if (this.inferenceConfig != null) {
261+
generator.writeKey("inference_config");
262+
this.inferenceConfig.serialize(generator, mapper);
259263

264+
}
260265
if (this.input != null) {
261266
generator.writeKey("input");
262267
this.input.serialize(generator, mapper);
@@ -310,6 +315,7 @@ public static class Builder extends RequestBase.AbstractBuilder<Builder>
310315
@Nullable
311316
private String description;
312317

318+
@Nullable
313319
private InferenceConfigCreate inferenceConfig;
314320

315321
@Nullable
@@ -385,21 +391,23 @@ public final Builder description(@Nullable String value) {
385391
}
386392

387393
/**
388-
* Required - The default configuration for inference. This can be either a
389-
* regression or classification configuration. It must match the underlying
390-
* definition.trained_model's target_type.
394+
* The default configuration for inference. This can be either a regression or
395+
* classification configuration. It must match the underlying
396+
* definition.trained_model's target_type. For pre-packaged models such as ELSER
397+
* the config is not required.
391398
* <p>
392399
* API name: {@code inference_config}
393400
*/
394-
public final Builder inferenceConfig(InferenceConfigCreate value) {
401+
public final Builder inferenceConfig(@Nullable InferenceConfigCreate value) {
395402
this.inferenceConfig = value;
396403
return this;
397404
}
398405

399406
/**
400-
* Required - The default configuration for inference. This can be either a
401-
* regression or classification configuration. It must match the underlying
402-
* definition.trained_model's target_type.
407+
* The default configuration for inference. This can be either a regression or
408+
* classification configuration. It must match the underlying
409+
* definition.trained_model's target_type. For pre-packaged models such as ELSER
410+
* the config is not required.
403411
* <p>
404412
* API name: {@code inference_config}
405413
*/

0 commit comments

Comments
 (0)