Skip to content

Commit 31b7496

Browse files
committed
[codegen] update to latest spec
1 parent a89e9e3 commit 31b7496

File tree

10 files changed

+655
-244
lines changed

10 files changed

+655
-244
lines changed

Diff for: java-client/src/main/java/co/elastic/clients/elasticsearch/cluster/ClusterStatsRequest.java

+13-13
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@
7070

7171
public class ClusterStatsRequest extends RequestBase {
7272
@Nullable
73-
private final Boolean flatSettings;
73+
private final Boolean includeRemotes;
7474

7575
private final List<String> nodeId;
7676

@@ -81,7 +81,7 @@ public class ClusterStatsRequest extends RequestBase {
8181

8282
private ClusterStatsRequest(Builder builder) {
8383

84-
this.flatSettings = builder.flatSettings;
84+
this.includeRemotes = builder.includeRemotes;
8585
this.nodeId = ApiTypeHelper.unmodifiable(builder.nodeId);
8686
this.timeout = builder.timeout;
8787

@@ -92,13 +92,13 @@ public static ClusterStatsRequest of(Function<Builder, ObjectBuilder<ClusterStat
9292
}
9393

9494
/**
95-
* If <code>true</code>, returns settings in flat format.
95+
* Include remote cluster data into the response
9696
* <p>
97-
* API name: {@code flat_settings}
97+
* API name: {@code include_remotes}
9898
*/
9999
@Nullable
100-
public final Boolean flatSettings() {
101-
return this.flatSettings;
100+
public final Boolean includeRemotes() {
101+
return this.includeRemotes;
102102
}
103103

104104
/**
@@ -134,7 +134,7 @@ public static class Builder extends RequestBase.AbstractBuilder<Builder>
134134
implements
135135
ObjectBuilder<ClusterStatsRequest> {
136136
@Nullable
137-
private Boolean flatSettings;
137+
private Boolean includeRemotes;
138138

139139
@Nullable
140140
private List<String> nodeId;
@@ -143,12 +143,12 @@ public static class Builder extends RequestBase.AbstractBuilder<Builder>
143143
private Time timeout;
144144

145145
/**
146-
* If <code>true</code>, returns settings in flat format.
146+
* Include remote cluster data into the response
147147
* <p>
148-
* API name: {@code flat_settings}
148+
* API name: {@code include_remotes}
149149
*/
150-
public final Builder flatSettings(@Nullable Boolean value) {
151-
this.flatSettings = value;
150+
public final Builder includeRemotes(@Nullable Boolean value) {
151+
this.includeRemotes = value;
152152
return this;
153153
}
154154

@@ -285,8 +285,8 @@ public ClusterStatsRequest build() {
285285
// Request parameters
286286
request -> {
287287
Map<String, String> params = new HashMap<>();
288-
if (request.flatSettings != null) {
289-
params.put("flat_settings", String.valueOf(request.flatSettings));
288+
if (request.includeRemotes != null) {
289+
params.put("include_remotes", String.valueOf(request.includeRemotes));
290290
}
291291
if (request.timeout != null) {
292292
params.put("timeout", request.timeout._toJsonString());

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

+203-201
Large diffs are not rendered by default.

Diff for: java-client/src/main/java/co/elastic/clients/elasticsearch/ingest/Processor.java

+31
Original file line numberDiff line numberDiff line change
@@ -142,6 +142,8 @@ public enum Kind implements JsonEnum {
142142

143143
Split("split"),
144144

145+
Terminate("terminate"),
146+
145147
Trim("trim"),
146148

147149
Uppercase("uppercase"),
@@ -782,6 +784,23 @@ public SplitProcessor split() {
782784
return TaggedUnionUtils.get(this, Kind.Split);
783785
}
784786

787+
/**
788+
* Is this variant instance of kind {@code terminate}?
789+
*/
790+
public boolean isTerminate() {
791+
return _kind == Kind.Terminate;
792+
}
793+
794+
/**
795+
* Get the {@code terminate} variant value.
796+
*
797+
* @throws IllegalStateException
798+
* if the current variant is not of the {@code terminate} kind.
799+
*/
800+
public TerminateProcessor terminate() {
801+
return TaggedUnionUtils.get(this, Kind.Terminate);
802+
}
803+
785804
/**
786805
* Is this variant instance of kind {@code trim}?
787806
*/
@@ -1278,6 +1297,17 @@ public ObjectBuilder<Processor> split(Function<SplitProcessor.Builder, ObjectBui
12781297
return this.split(fn.apply(new SplitProcessor.Builder()).build());
12791298
}
12801299

1300+
public ObjectBuilder<Processor> terminate(TerminateProcessor v) {
1301+
this._kind = Kind.Terminate;
1302+
this._value = v;
1303+
return this;
1304+
}
1305+
1306+
public ObjectBuilder<Processor> terminate(
1307+
Function<TerminateProcessor.Builder, ObjectBuilder<TerminateProcessor>> fn) {
1308+
return this.terminate(fn.apply(new TerminateProcessor.Builder()).build());
1309+
}
1310+
12811311
public ObjectBuilder<Processor> trim(TrimProcessor v) {
12821312
this._kind = Kind.Trim;
12831313
this._value = v;
@@ -1391,6 +1421,7 @@ protected static void setupProcessorDeserializer(ObjectDeserializer<Builder> op)
13911421
op.add(Builder::setSecurityUser, SetSecurityUserProcessor._DESERIALIZER, "set_security_user");
13921422
op.add(Builder::sort, SortProcessor._DESERIALIZER, "sort");
13931423
op.add(Builder::split, SplitProcessor._DESERIALIZER, "split");
1424+
op.add(Builder::terminate, TerminateProcessor._DESERIALIZER, "terminate");
13941425
op.add(Builder::trim, TrimProcessor._DESERIALIZER, "trim");
13951426
op.add(Builder::uppercase, UppercaseProcessor._DESERIALIZER, "uppercase");
13961427
op.add(Builder::urldecode, UrlDecodeProcessor._DESERIALIZER, "urldecode");

Diff for: java-client/src/main/java/co/elastic/clients/elasticsearch/ingest/ProcessorBuilders.java

+18
Original file line numberDiff line numberDiff line change
@@ -657,6 +657,24 @@ public static Processor split(Function<SplitProcessor.Builder, ObjectBuilder<Spl
657657
return builder.build();
658658
}
659659

660+
/**
661+
* Creates a builder for the {@link TerminateProcessor terminate}
662+
* {@code Processor} variant.
663+
*/
664+
public static TerminateProcessor.Builder terminate() {
665+
return new TerminateProcessor.Builder();
666+
}
667+
668+
/**
669+
* Creates a Processor of the {@link TerminateProcessor terminate}
670+
* {@code Processor} variant.
671+
*/
672+
public static Processor terminate(Function<TerminateProcessor.Builder, ObjectBuilder<TerminateProcessor>> fn) {
673+
Processor.Builder builder = new Processor.Builder();
674+
builder.terminate(fn.apply(new TerminateProcessor.Builder()).build());
675+
return builder.build();
676+
}
677+
660678
/**
661679
* Creates a builder for the {@link TrimProcessor trim} {@code Processor}
662680
* variant.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,115 @@
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+
package co.elastic.clients.elasticsearch.ingest;
21+
22+
import co.elastic.clients.json.JsonpDeserializable;
23+
import co.elastic.clients.json.JsonpDeserializer;
24+
import co.elastic.clients.json.ObjectBuilderDeserializer;
25+
import co.elastic.clients.json.ObjectDeserializer;
26+
import co.elastic.clients.util.ObjectBuilder;
27+
import jakarta.json.stream.JsonGenerator;
28+
import java.util.Objects;
29+
import java.util.function.Function;
30+
31+
//----------------------------------------------------------------
32+
// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST.
33+
//----------------------------------------------------------------
34+
//
35+
// This code is generated from the Elasticsearch API specification
36+
// at https://github.com/elastic/elasticsearch-specification
37+
//
38+
// Manual updates to this file will be lost when the code is
39+
// re-generated.
40+
//
41+
// If you find a property that is missing or wrongly typed, please
42+
// open an issue or a PR on the API specification repository.
43+
//
44+
//----------------------------------------------------------------
45+
46+
// typedef: ingest._types.TerminateProcessor
47+
48+
/**
49+
*
50+
* @see <a href=
51+
* "../doc-files/api-spec.html#ingest._types.TerminateProcessor">API
52+
* specification</a>
53+
*/
54+
@JsonpDeserializable
55+
public class TerminateProcessor extends ProcessorBase implements ProcessorVariant {
56+
// ---------------------------------------------------------------------------------------------
57+
58+
private TerminateProcessor(Builder builder) {
59+
super(builder);
60+
61+
}
62+
63+
public static TerminateProcessor of(Function<Builder, ObjectBuilder<TerminateProcessor>> fn) {
64+
return fn.apply(new Builder()).build();
65+
}
66+
67+
/**
68+
* Processor variant kind.
69+
*/
70+
@Override
71+
public Processor.Kind _processorKind() {
72+
return Processor.Kind.Terminate;
73+
}
74+
75+
// ---------------------------------------------------------------------------------------------
76+
77+
/**
78+
* Builder for {@link TerminateProcessor}.
79+
*/
80+
81+
public static class Builder extends ProcessorBase.AbstractBuilder<Builder>
82+
implements
83+
ObjectBuilder<TerminateProcessor> {
84+
@Override
85+
protected Builder self() {
86+
return this;
87+
}
88+
89+
/**
90+
* Builds a {@link TerminateProcessor}.
91+
*
92+
* @throws NullPointerException
93+
* if some of the required fields are null.
94+
*/
95+
public TerminateProcessor build() {
96+
_checkSingleUse();
97+
98+
return new TerminateProcessor(this);
99+
}
100+
}
101+
102+
// ---------------------------------------------------------------------------------------------
103+
104+
/**
105+
* Json deserializer for {@link TerminateProcessor}
106+
*/
107+
public static final JsonpDeserializer<TerminateProcessor> _DESERIALIZER = ObjectBuilderDeserializer
108+
.lazy(Builder::new, TerminateProcessor::setupTerminateProcessorDeserializer);
109+
110+
protected static void setupTerminateProcessorDeserializer(ObjectDeserializer<TerminateProcessor.Builder> op) {
111+
ProcessorBase.setupProcessorBaseDeserializer(op);
112+
113+
}
114+
115+
}

Diff for: java-client/src/main/java/co/elastic/clients/elasticsearch/nodes/info/NodeInfoXpack.java

+36
Original file line numberDiff line numberDiff line change
@@ -68,13 +68,17 @@ public class NodeInfoXpack implements JsonpSerializable {
6868

6969
private final Map<String, JsonData> notification;
7070

71+
@Nullable
72+
private final NodeInfoXpackMl ml;
73+
7174
// ---------------------------------------------------------------------------------------------
7275

7376
private NodeInfoXpack(Builder builder) {
7477

7578
this.license = builder.license;
7679
this.security = ApiTypeHelper.requireNonNull(builder.security, this, "security");
7780
this.notification = ApiTypeHelper.unmodifiable(builder.notification);
81+
this.ml = builder.ml;
7882

7983
}
8084

@@ -104,6 +108,14 @@ public final Map<String, JsonData> notification() {
104108
return this.notification;
105109
}
106110

111+
/**
112+
* API name: {@code ml}
113+
*/
114+
@Nullable
115+
public final NodeInfoXpackMl ml() {
116+
return this.ml;
117+
}
118+
107119
/**
108120
* Serialize this object to JSON.
109121
*/
@@ -134,6 +146,11 @@ protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) {
134146
generator.writeEnd();
135147

136148
}
149+
if (this.ml != null) {
150+
generator.writeKey("ml");
151+
this.ml.serialize(generator, mapper);
152+
153+
}
137154

138155
}
139156

@@ -157,6 +174,9 @@ public static class Builder extends WithJsonObjectBuilderBase<Builder> implement
157174
@Nullable
158175
private Map<String, JsonData> notification;
159176

177+
@Nullable
178+
private NodeInfoXpackMl ml;
179+
160180
/**
161181
* API name: {@code license}
162182
*/
@@ -208,6 +228,21 @@ public final Builder notification(String key, JsonData value) {
208228
return this;
209229
}
210230

231+
/**
232+
* API name: {@code ml}
233+
*/
234+
public final Builder ml(@Nullable NodeInfoXpackMl value) {
235+
this.ml = value;
236+
return this;
237+
}
238+
239+
/**
240+
* API name: {@code ml}
241+
*/
242+
public final Builder ml(Function<NodeInfoXpackMl.Builder, ObjectBuilder<NodeInfoXpackMl>> fn) {
243+
return this.ml(fn.apply(new NodeInfoXpackMl.Builder()).build());
244+
}
245+
211246
@Override
212247
protected Builder self() {
213248
return this;
@@ -239,6 +274,7 @@ protected static void setupNodeInfoXpackDeserializer(ObjectDeserializer<NodeInfo
239274
op.add(Builder::license, NodeInfoXpackLicense._DESERIALIZER, "license");
240275
op.add(Builder::security, NodeInfoXpackSecurity._DESERIALIZER, "security");
241276
op.add(Builder::notification, JsonpDeserializer.stringMapDeserializer(JsonData._DESERIALIZER), "notification");
277+
op.add(Builder::ml, NodeInfoXpackMl._DESERIALIZER, "ml");
242278

243279
}
244280

0 commit comments

Comments
 (0)