Skip to content

Commit 98651db

Browse files
authored
Partial fixes from spec 2552 (#817)
* Partial fixes from spec 2552 * checkstyle
1 parent ce63613 commit 98651db

File tree

12 files changed

+603
-36
lines changed

12 files changed

+603
-36
lines changed

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1668,7 +1668,7 @@ public String toString() {
16681668
return JsonpUtils.toString(this);
16691669
}
16701670

1671-
public static class Builder extends WithJsonObjectBuilderBase<Builder> {
1671+
public static class Builder extends WithJsonObjectBuilderBase<Builder> implements ObjectBuilder<Aggregation> {
16721672
private Kind _kind;
16731673
private Object _value;
16741674
private String _customKind;
@@ -2557,7 +2557,7 @@ public ContainerBuilder _custom(String name, Object data) {
25572557
return new ContainerBuilder();
25582558
}
25592559

2560-
protected Aggregation build() {
2560+
public Aggregation build() {
25612561
_checkSingleUse();
25622562
return new Aggregation(this);
25632563
}

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,8 @@ public enum FieldType implements JsonEnum {
7373

7474
Object("object"),
7575

76+
Version("version"),
77+
7678
Murmur3("murmur3"),
7779

7880
TokenCount("token_count"),

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

Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919

2020
package co.elastic.clients.elasticsearch._types.mapping;
2121

22+
import co.elastic.clients.elasticsearch._types.Script;
2223
import co.elastic.clients.json.JsonpDeserializable;
2324
import co.elastic.clients.json.JsonpDeserializer;
2425
import co.elastic.clients.json.JsonpMapper;
@@ -70,6 +71,12 @@ public class KeywordProperty extends DocValuesPropertyBase implements PropertyVa
7071
@Nullable
7172
private final IndexOptions indexOptions;
7273

74+
@Nullable
75+
private final Script script;
76+
77+
@Nullable
78+
private final OnScriptError onScriptError;
79+
7380
@Nullable
7481
private final String normalizer;
7582

@@ -94,6 +101,8 @@ private KeywordProperty(Builder builder) {
94101
this.eagerGlobalOrdinals = builder.eagerGlobalOrdinals;
95102
this.index = builder.index;
96103
this.indexOptions = builder.indexOptions;
104+
this.script = builder.script;
105+
this.onScriptError = builder.onScriptError;
97106
this.normalizer = builder.normalizer;
98107
this.norms = builder.norms;
99108
this.nullValue = builder.nullValue;
@@ -146,6 +155,22 @@ public final IndexOptions indexOptions() {
146155
return this.indexOptions;
147156
}
148157

158+
/**
159+
* API name: {@code script}
160+
*/
161+
@Nullable
162+
public final Script script() {
163+
return this.script;
164+
}
165+
166+
/**
167+
* API name: {@code on_script_error}
168+
*/
169+
@Nullable
170+
public final OnScriptError onScriptError() {
171+
return this.onScriptError;
172+
}
173+
149174
/**
150175
* API name: {@code normalizer}
151176
*/
@@ -212,6 +237,15 @@ protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) {
212237
generator.writeKey("index_options");
213238
this.indexOptions.serialize(generator, mapper);
214239
}
240+
if (this.script != null) {
241+
generator.writeKey("script");
242+
this.script.serialize(generator, mapper);
243+
244+
}
245+
if (this.onScriptError != null) {
246+
generator.writeKey("on_script_error");
247+
this.onScriptError.serialize(generator, mapper);
248+
}
215249
if (this.normalizer != null) {
216250
generator.writeKey("normalizer");
217251
generator.write(this.normalizer);
@@ -261,6 +295,12 @@ public static class Builder extends DocValuesPropertyBase.AbstractBuilder<Builde
261295
@Nullable
262296
private IndexOptions indexOptions;
263297

298+
@Nullable
299+
private Script script;
300+
301+
@Nullable
302+
private OnScriptError onScriptError;
303+
264304
@Nullable
265305
private String normalizer;
266306

@@ -308,6 +348,29 @@ public final Builder indexOptions(@Nullable IndexOptions value) {
308348
return this;
309349
}
310350

351+
/**
352+
* API name: {@code script}
353+
*/
354+
public final Builder script(@Nullable Script value) {
355+
this.script = value;
356+
return this;
357+
}
358+
359+
/**
360+
* API name: {@code script}
361+
*/
362+
public final Builder script(Function<Script.Builder, ObjectBuilder<Script>> fn) {
363+
return this.script(fn.apply(new Script.Builder()).build());
364+
}
365+
366+
/**
367+
* API name: {@code on_script_error}
368+
*/
369+
public final Builder onScriptError(@Nullable OnScriptError value) {
370+
this.onScriptError = value;
371+
return this;
372+
}
373+
311374
/**
312375
* API name: {@code normalizer}
313376
*/
@@ -383,6 +446,8 @@ protected static void setupKeywordPropertyDeserializer(ObjectDeserializer<Keywor
383446
op.add(Builder::eagerGlobalOrdinals, JsonpDeserializer.booleanDeserializer(), "eager_global_ordinals");
384447
op.add(Builder::index, JsonpDeserializer.booleanDeserializer(), "index");
385448
op.add(Builder::indexOptions, IndexOptions._DESERIALIZER, "index_options");
449+
op.add(Builder::script, Script._DESERIALIZER, "script");
450+
op.add(Builder::onScriptError, OnScriptError._DESERIALIZER, "on_script_error");
386451
op.add(Builder::normalizer, JsonpDeserializer.stringDeserializer(), "normalizer");
387452
op.add(Builder::norms, JsonpDeserializer.booleanDeserializer(), "norms");
388453
op.add(Builder::nullValue, JsonpDeserializer.stringDeserializer(), "null_value");

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -220,7 +220,7 @@ public String toString() {
220220
return JsonpUtils.toString(this);
221221
}
222222

223-
public static class Builder extends QueryBase.AbstractBuilder<Builder> {
223+
public static class Builder extends QueryBase.AbstractBuilder<Builder> implements ObjectBuilder<PinnedQuery> {
224224
private Kind _kind;
225225
private Object _value;
226226

@@ -263,7 +263,7 @@ public ContainerBuilder docs(List<PinnedDoc> v) {
263263
return new ContainerBuilder();
264264
}
265265

266-
protected PinnedQuery build() {
266+
public PinnedQuery build() {
267267
_checkSingleUse();
268268
return new PinnedQuery(this);
269269
}

java-client/src/main/java/co/elastic/clients/elasticsearch/core/search/FieldSuggester.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -295,7 +295,7 @@ public String toString() {
295295
return JsonpUtils.toString(this);
296296
}
297297

298-
public static class Builder extends WithJsonObjectBuilderBase<Builder> {
298+
public static class Builder extends WithJsonObjectBuilderBase<Builder> implements ObjectBuilder<FieldSuggester> {
299299
private Kind _kind;
300300
private Object _value;
301301
private String _customKind;
@@ -391,7 +391,7 @@ public ContainerBuilder _custom(String name, Object data) {
391391
return new ContainerBuilder();
392392
}
393393

394-
protected FieldSuggester build() {
394+
public FieldSuggester build() {
395395
_checkSingleUse();
396396
return new FieldSuggester(this);
397397
}

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

Lines changed: 29 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -726,7 +726,7 @@
726726
'_types.mapping.AllField': '_types/mapping/meta-fields.ts#L29-L40',
727727
'_types.mapping.BinaryProperty': '_types/mapping/core.ts#L49-L51',
728728
'_types.mapping.BooleanProperty': '_types/mapping/core.ts#L53-L59',
729-
'_types.mapping.ByteNumberProperty': '_types/mapping/core.ts#L164-L167',
729+
'_types.mapping.ByteNumberProperty': '_types/mapping/core.ts#L166-L169',
730730
'_types.mapping.CompletionProperty': '_types/mapping/specialized.ts#L27-L35',
731731
'_types.mapping.ConstantKeywordProperty': '_types/mapping/specialized.ts#L44-L47',
732732
'_types.mapping.CorePropertyBase': '_types/mapping/core.ts#L39-L43',
@@ -737,70 +737,70 @@
737737
'_types.mapping.DenseVectorIndexOptions': '_types/mapping/DenseVectorIndexOptions.ts#L22-L26',
738738
'_types.mapping.DenseVectorProperty': '_types/mapping/complex.ts#L52-L58',
739739
'_types.mapping.DocValuesPropertyBase': '_types/mapping/core.ts#L45-L47',
740-
'_types.mapping.DoubleNumberProperty': '_types/mapping/core.ts#L144-L147',
740+
'_types.mapping.DoubleNumberProperty': '_types/mapping/core.ts#L146-L149',
741741
'_types.mapping.DoubleRangeProperty': '_types/mapping/range.ts#L34-L36',
742742
'_types.mapping.DynamicMapping': '_types/mapping/dynamic-template.ts#L37-L46',
743-
'_types.mapping.DynamicProperty': '_types/mapping/core.ts#L286-L317',
743+
'_types.mapping.DynamicProperty': '_types/mapping/core.ts#L288-L319',
744744
'_types.mapping.DynamicTemplate': '_types/mapping/dynamic-template.ts#L22-L30',
745745
'_types.mapping.FieldAliasProperty': '_types/mapping/specialized.ts#L49-L52',
746746
'_types.mapping.FieldMapping': '_types/mapping/meta-fields.ts#L24-L27',
747747
'_types.mapping.FieldNamesField': '_types/mapping/meta-fields.ts#L42-L44',
748-
'_types.mapping.FieldType': '_types/mapping/Property.ts#L160-L204',
748+
'_types.mapping.FieldType': '_types/mapping/Property.ts#L160-L205',
749749
'_types.mapping.FlattenedProperty': '_types/mapping/complex.ts#L26-L37',
750-
'_types.mapping.FloatNumberProperty': '_types/mapping/core.ts#L134-L137',
750+
'_types.mapping.FloatNumberProperty': '_types/mapping/core.ts#L136-L139',
751751
'_types.mapping.FloatRangeProperty': '_types/mapping/range.ts#L38-L40',
752752
'_types.mapping.GeoOrientation': '_types/mapping/geo.ts#L34-L39',
753753
'_types.mapping.GeoPointProperty': '_types/mapping/geo.ts#L24-L32',
754754
'_types.mapping.GeoShapeProperty': '_types/mapping/geo.ts#L41-L54',
755755
'_types.mapping.GeoStrategy': '_types/mapping/geo.ts#L56-L59',
756-
'_types.mapping.HalfFloatNumberProperty': '_types/mapping/core.ts#L139-L142',
756+
'_types.mapping.HalfFloatNumberProperty': '_types/mapping/core.ts#L141-L144',
757757
'_types.mapping.HistogramProperty': '_types/mapping/specialized.ts#L54-L57',
758758
'_types.mapping.IndexField': '_types/mapping/meta-fields.ts#L46-L48',
759-
'_types.mapping.IndexOptions': '_types/mapping/core.ts#L243-L248',
760-
'_types.mapping.IntegerNumberProperty': '_types/mapping/core.ts#L149-L152',
759+
'_types.mapping.IndexOptions': '_types/mapping/core.ts#L245-L250',
760+
'_types.mapping.IntegerNumberProperty': '_types/mapping/core.ts#L151-L154',
761761
'_types.mapping.IntegerRangeProperty': '_types/mapping/range.ts#L42-L44',
762762
'_types.mapping.IpProperty': '_types/mapping/specialized.ts#L59-L73',
763763
'_types.mapping.IpRangeProperty': '_types/mapping/range.ts#L46-L48',
764764
'_types.mapping.JoinProperty': '_types/mapping/core.ts#L83-L87',
765-
'_types.mapping.KeywordProperty': '_types/mapping/core.ts#L89-L105',
766-
'_types.mapping.LongNumberProperty': '_types/mapping/core.ts#L154-L157',
765+
'_types.mapping.KeywordProperty': '_types/mapping/core.ts#L89-L107',
766+
'_types.mapping.LongNumberProperty': '_types/mapping/core.ts#L156-L159',
767767
'_types.mapping.LongRangeProperty': '_types/mapping/range.ts#L50-L52',
768-
'_types.mapping.MatchOnlyTextProperty': '_types/mapping/core.ts#L216-L241',
768+
'_types.mapping.MatchOnlyTextProperty': '_types/mapping/core.ts#L218-L243',
769769
'_types.mapping.MatchType': '_types/mapping/dynamic-template.ts#L32-L35',
770770
'_types.mapping.Murmur3HashProperty': '_types/mapping/specialized.ts#L75-L77',
771771
'_types.mapping.NestedProperty': '_types/mapping/complex.ts#L39-L44',
772-
'_types.mapping.NumberPropertyBase': '_types/mapping/core.ts#L107-L127',
772+
'_types.mapping.NumberPropertyBase': '_types/mapping/core.ts#L109-L129',
773773
'_types.mapping.ObjectProperty': '_types/mapping/complex.ts#L46-L50',
774-
'_types.mapping.OnScriptError': '_types/mapping/core.ts#L129-L132',
775-
'_types.mapping.PercolatorProperty': '_types/mapping/core.ts#L180-L182',
774+
'_types.mapping.OnScriptError': '_types/mapping/core.ts#L131-L134',
775+
'_types.mapping.PercolatorProperty': '_types/mapping/core.ts#L182-L184',
776776
'_types.mapping.PointProperty': '_types/mapping/geo.ts#L66-L71',
777777
'_types.mapping.Property': '_types/mapping/Property.ts#L94-L158',
778778
'_types.mapping.PropertyBase': '_types/mapping/Property.ts#L82-L92',
779779
'_types.mapping.RangePropertyBase': '_types/mapping/range.ts#L23-L27',
780-
'_types.mapping.RankFeatureProperty': '_types/mapping/core.ts#L184-L187',
781-
'_types.mapping.RankFeaturesProperty': '_types/mapping/core.ts#L189-L192',
780+
'_types.mapping.RankFeatureProperty': '_types/mapping/core.ts#L186-L189',
781+
'_types.mapping.RankFeaturesProperty': '_types/mapping/core.ts#L191-L194',
782782
'_types.mapping.RoutingField': '_types/mapping/meta-fields.ts#L50-L52',
783783
'_types.mapping.RuntimeField': '_types/mapping/RuntimeFields.ts#L26-L48',
784784
'_types.mapping.RuntimeFieldFetchFields': '_types/mapping/RuntimeFields.ts#L50-L54',
785785
'_types.mapping.RuntimeFieldType': '_types/mapping/RuntimeFields.ts#L56-L66',
786-
'_types.mapping.ScaledFloatNumberProperty': '_types/mapping/core.ts#L174-L178',
787-
'_types.mapping.SearchAsYouTypeProperty': '_types/mapping/core.ts#L198-L208',
786+
'_types.mapping.ScaledFloatNumberProperty': '_types/mapping/core.ts#L176-L180',
787+
'_types.mapping.SearchAsYouTypeProperty': '_types/mapping/core.ts#L200-L210',
788788
'_types.mapping.ShapeProperty': '_types/mapping/geo.ts#L73-L85',
789-
'_types.mapping.ShortNumberProperty': '_types/mapping/core.ts#L159-L162',
789+
'_types.mapping.ShortNumberProperty': '_types/mapping/core.ts#L161-L164',
790790
'_types.mapping.SizeField': '_types/mapping/meta-fields.ts#L54-L56',
791791
'_types.mapping.SourceField': '_types/mapping/meta-fields.ts#L58-L65',
792792
'_types.mapping.SourceFieldMode': '_types/mapping/meta-fields.ts#L67-L75',
793-
'_types.mapping.SparseVectorProperty': '_types/mapping/core.ts#L194-L196',
793+
'_types.mapping.SparseVectorProperty': '_types/mapping/core.ts#L196-L198',
794794
'_types.mapping.SuggestContext': '_types/mapping/specialized.ts#L37-L42',
795795
'_types.mapping.TermVectorOption': '_types/mapping/TermVectorOption.ts#L20-L28',
796-
'_types.mapping.TextIndexPrefixes': '_types/mapping/core.ts#L250-L253',
797-
'_types.mapping.TextProperty': '_types/mapping/core.ts#L255-L271',
796+
'_types.mapping.TextIndexPrefixes': '_types/mapping/core.ts#L252-L255',
797+
'_types.mapping.TextProperty': '_types/mapping/core.ts#L257-L273',
798798
'_types.mapping.TimeSeriesMetricType': '_types/mapping/TimeSeriesMetricType.ts#L20-L26',
799799
'_types.mapping.TokenCountProperty': '_types/mapping/specialized.ts#L79-L86',
800800
'_types.mapping.TypeMapping': '_types/mapping/TypeMapping.ts#L34-L57',
801-
'_types.mapping.UnsignedLongNumberProperty': '_types/mapping/core.ts#L169-L172',
802-
'_types.mapping.VersionProperty': '_types/mapping/core.ts#L273-L275',
803-
'_types.mapping.WildcardProperty': '_types/mapping/core.ts#L277-L284',
801+
'_types.mapping.UnsignedLongNumberProperty': '_types/mapping/core.ts#L171-L174',
802+
'_types.mapping.VersionProperty': '_types/mapping/core.ts#L275-L277',
803+
'_types.mapping.WildcardProperty': '_types/mapping/core.ts#L279-L286',
804804
'_types.query_dsl.BoolQuery': '_types/query_dsl/compound.ts#L28-L52',
805805
'_types.query_dsl.BoostingQuery': '_types/query_dsl/compound.ts#L54-L67',
806806
'_types.query_dsl.ChildScoreMode': '_types/query_dsl/joining.ts#L25-L39',
@@ -1959,6 +1959,8 @@
19591959
'ml.update_job.Response': 'ml/update_job/MlUpdateJobResponse.ts#L29-L53',
19601960
'ml.update_model_snapshot.Request': 'ml/update_model_snapshot/MlUpdateModelSnapshotRequest.ts#L23-L54',
19611961
'ml.update_model_snapshot.Response': 'ml/update_model_snapshot/MlUpdateModelSnapshotResponse.ts#L22-L27',
1962+
'ml.update_trained_model_deployment.Request': 'ml/update_trained_model_deployment/MlUpdateTrainedModelDeploymentRequest.ts#L24-L50',
1963+
'ml.update_trained_model_deployment.Response': 'ml/update_trained_model_deployment/MlUpdateTrainedModelDeploymentResponse.ts#L22-L26',
19621964
'ml.upgrade_job_snapshot.Request': 'ml/upgrade_job_snapshot/MlUpgradeJobSnapshotRequest.ts#L24-L63',
19631965
'ml.upgrade_job_snapshot.Response': 'ml/upgrade_job_snapshot/MlUpgradeJobSnapshotResponse.ts#L22-L31',
19641966
'ml.validate.Request': 'ml/validate/MlValidateJobRequest.ts#L27-L44',
@@ -2710,10 +2712,10 @@
27102712
if (hash.length > 1) {
27112713
hash = hash.substring(1);
27122714
}
2713-
window.location = "https://github.com/elastic/elasticsearch-specification/tree/562b09c2a65bfac827b3833622759b871904f68c/specification/" + (paths[hash] || "");
2715+
window.location = "https://github.com/elastic/elasticsearch-specification/tree/f18cf1cf51367156f7d15a28174712696b4b6da2/specification/" + (paths[hash] || "");
27142716
</script>
27152717
</head>
27162718
<body>
2717-
Please see the <a href="https://github.com/elastic/elasticsearch-specification/tree/562b09c2a65bfac827b3833622759b871904f68c/specification/">Elasticsearch API specification</a>.
2719+
Please see the <a href="https://github.com/elastic/elasticsearch-specification/tree/f18cf1cf51367156f7d15a28174712696b4b6da2/specification/">Elasticsearch API specification</a>.
27182720
</body>
27192721
</html>

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

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2603,6 +2603,40 @@ public final CompletableFuture<UpdateModelSnapshotResponse> updateModelSnapshot(
26032603
return updateModelSnapshot(fn.apply(new UpdateModelSnapshotRequest.Builder()).build());
26042604
}
26052605

2606+
// ----- Endpoint: ml.update_trained_model_deployment
2607+
2608+
/**
2609+
* Updates certain properties of trained model deployment.
2610+
*
2611+
* @see <a href=
2612+
* "https://www.elastic.co/guide/en/elasticsearch/reference/current/update-trained-model-deployment.html">Documentation
2613+
* on elastic.co</a>
2614+
*/
2615+
2616+
public CompletableFuture<UpdateTrainedModelDeploymentResponse> updateTrainedModelDeployment(
2617+
UpdateTrainedModelDeploymentRequest request) {
2618+
@SuppressWarnings("unchecked")
2619+
JsonEndpoint<UpdateTrainedModelDeploymentRequest, UpdateTrainedModelDeploymentResponse, ErrorResponse> endpoint = (JsonEndpoint<UpdateTrainedModelDeploymentRequest, UpdateTrainedModelDeploymentResponse, ErrorResponse>) UpdateTrainedModelDeploymentRequest._ENDPOINT;
2620+
2621+
return this.transport.performRequestAsync(request, endpoint, this.transportOptions);
2622+
}
2623+
2624+
/**
2625+
* Updates certain properties of trained model deployment.
2626+
*
2627+
* @param fn
2628+
* a function that initializes a builder to create the
2629+
* {@link UpdateTrainedModelDeploymentRequest}
2630+
* @see <a href=
2631+
* "https://www.elastic.co/guide/en/elasticsearch/reference/current/update-trained-model-deployment.html">Documentation
2632+
* on elastic.co</a>
2633+
*/
2634+
2635+
public final CompletableFuture<UpdateTrainedModelDeploymentResponse> updateTrainedModelDeployment(
2636+
Function<UpdateTrainedModelDeploymentRequest.Builder, ObjectBuilder<UpdateTrainedModelDeploymentRequest>> fn) {
2637+
return updateTrainedModelDeployment(fn.apply(new UpdateTrainedModelDeploymentRequest.Builder()).build());
2638+
}
2639+
26062640
// ----- Endpoint: ml.upgrade_job_snapshot
26072641

26082642
/**

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

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2687,6 +2687,41 @@ public final UpdateModelSnapshotResponse updateModelSnapshot(
26872687
return updateModelSnapshot(fn.apply(new UpdateModelSnapshotRequest.Builder()).build());
26882688
}
26892689

2690+
// ----- Endpoint: ml.update_trained_model_deployment
2691+
2692+
/**
2693+
* Updates certain properties of trained model deployment.
2694+
*
2695+
* @see <a href=
2696+
* "https://www.elastic.co/guide/en/elasticsearch/reference/current/update-trained-model-deployment.html">Documentation
2697+
* on elastic.co</a>
2698+
*/
2699+
2700+
public UpdateTrainedModelDeploymentResponse updateTrainedModelDeployment(
2701+
UpdateTrainedModelDeploymentRequest request) throws IOException, ElasticsearchException {
2702+
@SuppressWarnings("unchecked")
2703+
JsonEndpoint<UpdateTrainedModelDeploymentRequest, UpdateTrainedModelDeploymentResponse, ErrorResponse> endpoint = (JsonEndpoint<UpdateTrainedModelDeploymentRequest, UpdateTrainedModelDeploymentResponse, ErrorResponse>) UpdateTrainedModelDeploymentRequest._ENDPOINT;
2704+
2705+
return this.transport.performRequest(request, endpoint, this.transportOptions);
2706+
}
2707+
2708+
/**
2709+
* Updates certain properties of trained model deployment.
2710+
*
2711+
* @param fn
2712+
* a function that initializes a builder to create the
2713+
* {@link UpdateTrainedModelDeploymentRequest}
2714+
* @see <a href=
2715+
* "https://www.elastic.co/guide/en/elasticsearch/reference/current/update-trained-model-deployment.html">Documentation
2716+
* on elastic.co</a>
2717+
*/
2718+
2719+
public final UpdateTrainedModelDeploymentResponse updateTrainedModelDeployment(
2720+
Function<UpdateTrainedModelDeploymentRequest.Builder, ObjectBuilder<UpdateTrainedModelDeploymentRequest>> fn)
2721+
throws IOException, ElasticsearchException {
2722+
return updateTrainedModelDeployment(fn.apply(new UpdateTrainedModelDeploymentRequest.Builder()).build());
2723+
}
2724+
26902725
// ----- Endpoint: ml.upgrade_job_snapshot
26912726

26922727
/**

0 commit comments

Comments
 (0)