Skip to content

Commit 043e7ef

Browse files
authored
FIxes from spec 2597 (#824)
1 parent 4acf3c3 commit 043e7ef

File tree

9 files changed

+83
-62
lines changed

9 files changed

+83
-62
lines changed

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

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ public enum Kind implements JsonEnum {
8282

8383
Avg("avg"),
8484

85-
BoxPlot("box_plot"),
85+
Boxplot("boxplot"),
8686

8787
BucketMetricValue("bucket_metric_value"),
8888

@@ -328,20 +328,20 @@ public AvgAggregate avg() {
328328
}
329329

330330
/**
331-
* Is this variant instance of kind {@code box_plot}?
331+
* Is this variant instance of kind {@code boxplot}?
332332
*/
333-
public boolean isBoxPlot() {
334-
return _kind == Kind.BoxPlot;
333+
public boolean isBoxplot() {
334+
return _kind == Kind.Boxplot;
335335
}
336336

337337
/**
338-
* Get the {@code box_plot} variant value.
338+
* Get the {@code boxplot} variant value.
339339
*
340340
* @throws IllegalStateException
341-
* if the current variant is not of the {@code box_plot} kind.
341+
* if the current variant is not of the {@code boxplot} kind.
342342
*/
343-
public BoxPlotAggregate boxPlot() {
344-
return TaggedUnionUtils.get(this, Kind.BoxPlot);
343+
public BoxPlotAggregate boxplot() {
344+
return TaggedUnionUtils.get(this, Kind.Boxplot);
345345
}
346346

347347
/**
@@ -1540,15 +1540,15 @@ public ObjectBuilder<Aggregate> avg(Function<AvgAggregate.Builder, ObjectBuilder
15401540
return this.avg(fn.apply(new AvgAggregate.Builder()).build());
15411541
}
15421542

1543-
public ObjectBuilder<Aggregate> boxPlot(BoxPlotAggregate v) {
1544-
this._kind = Kind.BoxPlot;
1543+
public ObjectBuilder<Aggregate> boxplot(BoxPlotAggregate v) {
1544+
this._kind = Kind.Boxplot;
15451545
this._value = v;
15461546
return this;
15471547
}
15481548

1549-
public ObjectBuilder<Aggregate> boxPlot(
1549+
public ObjectBuilder<Aggregate> boxplot(
15501550
Function<BoxPlotAggregate.Builder, ObjectBuilder<BoxPlotAggregate>> fn) {
1551-
return this.boxPlot(fn.apply(new BoxPlotAggregate.Builder()).build());
1551+
return this.boxplot(fn.apply(new BoxPlotAggregate.Builder()).build());
15521552
}
15531553

15541554
public ObjectBuilder<Aggregate> bucketMetricValue(BucketMetricValueAggregate v) {
@@ -2285,7 +2285,7 @@ public Aggregate build() {
22852285
deserializers.put("adjacency_matrix", AdjacencyMatrixAggregate._DESERIALIZER);
22862286
deserializers.put("auto_date_histogram", AutoDateHistogramAggregate._DESERIALIZER);
22872287
deserializers.put("avg", AvgAggregate._DESERIALIZER);
2288-
deserializers.put("box_plot", BoxPlotAggregate._DESERIALIZER);
2288+
deserializers.put("boxplot", BoxPlotAggregate._DESERIALIZER);
22892289
deserializers.put("bucket_metric_value", BucketMetricValueAggregate._DESERIALIZER);
22902290
deserializers.put("cardinality", CardinalityAggregate._DESERIALIZER);
22912291
deserializers.put("children", ChildrenAggregate._DESERIALIZER);

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

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -100,20 +100,20 @@ public static Aggregate avg(Function<AvgAggregate.Builder, ObjectBuilder<AvgAggr
100100
}
101101

102102
/**
103-
* Creates a builder for the {@link BoxPlotAggregate box_plot} {@code Aggregate}
103+
* Creates a builder for the {@link BoxPlotAggregate boxplot} {@code Aggregate}
104104
* variant.
105105
*/
106-
public static BoxPlotAggregate.Builder boxPlot() {
106+
public static BoxPlotAggregate.Builder boxplot() {
107107
return new BoxPlotAggregate.Builder();
108108
}
109109

110110
/**
111-
* Creates a Aggregate of the {@link BoxPlotAggregate box_plot}
112-
* {@code Aggregate} variant.
111+
* Creates a Aggregate of the {@link BoxPlotAggregate boxplot} {@code Aggregate}
112+
* variant.
113113
*/
114-
public static Aggregate boxPlot(Function<BoxPlotAggregate.Builder, ObjectBuilder<BoxPlotAggregate>> fn) {
114+
public static Aggregate boxplot(Function<BoxPlotAggregate.Builder, ObjectBuilder<BoxPlotAggregate>> fn) {
115115
Aggregate.Builder builder = new Aggregate.Builder();
116-
builder.boxPlot(fn.apply(new BoxPlotAggregate.Builder()).build());
116+
builder.boxplot(fn.apply(new BoxPlotAggregate.Builder()).build());
117117
return builder.build();
118118
}
119119

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ public static BoxPlotAggregate of(Function<Builder, ObjectBuilder<BoxPlotAggrega
124124
*/
125125
@Override
126126
public Aggregate.Kind _aggregateKind() {
127-
return Aggregate.Kind.BoxPlot;
127+
return Aggregate.Kind.Boxplot;
128128
}
129129

130130
/**

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

Lines changed: 14 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -57,31 +57,31 @@
5757

5858
public abstract class TermsBucketBase extends MultiBucketBase {
5959
@Nullable
60-
private final Long docCountError;
60+
private final Long docCountErrorUpperBound;
6161

6262
// ---------------------------------------------------------------------------------------------
6363

6464
protected TermsBucketBase(AbstractBuilder<?> builder) {
6565
super(builder);
6666

67-
this.docCountError = builder.docCountError;
67+
this.docCountErrorUpperBound = builder.docCountErrorUpperBound;
6868

6969
}
7070

7171
/**
72-
* API name: {@code doc_count_error}
72+
* API name: {@code doc_count_error_upper_bound}
7373
*/
7474
@Nullable
75-
public final Long docCountError() {
76-
return this.docCountError;
75+
public final Long docCountErrorUpperBound() {
76+
return this.docCountErrorUpperBound;
7777
}
7878

7979
protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) {
8080

8181
super.serializeInternal(generator, mapper);
82-
if (this.docCountError != null) {
83-
generator.writeKey("doc_count_error");
84-
generator.write(this.docCountError);
82+
if (this.docCountErrorUpperBound != null) {
83+
generator.writeKey("doc_count_error_upper_bound");
84+
generator.write(this.docCountErrorUpperBound);
8585

8686
}
8787

@@ -91,13 +91,13 @@ public abstract static class AbstractBuilder<BuilderT extends AbstractBuilder<Bu
9191
extends
9292
MultiBucketBase.AbstractBuilder<BuilderT> {
9393
@Nullable
94-
private Long docCountError;
94+
private Long docCountErrorUpperBound;
9595

9696
/**
97-
* API name: {@code doc_count_error}
97+
* API name: {@code doc_count_error_upper_bound}
9898
*/
99-
public final BuilderT docCountError(@Nullable Long value) {
100-
this.docCountError = value;
99+
public final BuilderT docCountErrorUpperBound(@Nullable Long value) {
100+
this.docCountErrorUpperBound = value;
101101
return self();
102102
}
103103

@@ -107,7 +107,8 @@ public final BuilderT docCountError(@Nullable Long value) {
107107
protected static <BuilderT extends AbstractBuilder<BuilderT>> void setupTermsBucketBaseDeserializer(
108108
ObjectDeserializer<BuilderT> op) {
109109
MultiBucketBase.setupMultiBucketBaseDeserializer(op);
110-
op.add(AbstractBuilder::docCountError, JsonpDeserializer.longDeserializer(), "doc_count_error");
110+
op.add(AbstractBuilder::docCountErrorUpperBound, JsonpDeserializer.longDeserializer(),
111+
"doc_count_error_upper_bound");
111112

112113
}
113114

java-client/src/main/java/co/elastic/clients/elasticsearch/core/mtermvectors/MultiTermVectorsOperation.java

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,7 @@
6666
*/
6767
@JsonpDeserializable
6868
public class MultiTermVectorsOperation implements JsonpSerializable {
69+
@Nullable
6970
private final String id;
7071

7172
@Nullable
@@ -107,7 +108,7 @@ public class MultiTermVectorsOperation implements JsonpSerializable {
107108

108109
private MultiTermVectorsOperation(Builder builder) {
109110

110-
this.id = ApiTypeHelper.requireNonNull(builder.id, this, "id");
111+
this.id = builder.id;
111112
this.index = builder.index;
112113
this.doc = builder.doc;
113114
this.fields = ApiTypeHelper.unmodifiable(builder.fields);
@@ -128,10 +129,11 @@ public static MultiTermVectorsOperation of(Function<Builder, ObjectBuilder<Multi
128129
}
129130

130131
/**
131-
* Required - The ID of the document.
132+
* The ID of the document.
132133
* <p>
133134
* API name: {@code _id}
134135
*/
136+
@Nullable
135137
public final String id() {
136138
return this.id;
137139
}
@@ -271,9 +273,11 @@ public void serialize(JsonGenerator generator, JsonpMapper mapper) {
271273

272274
protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) {
273275

274-
generator.writeKey("_id");
275-
generator.write(this.id);
276+
if (this.id != null) {
277+
generator.writeKey("_id");
278+
generator.write(this.id);
276279

280+
}
277281
if (this.index != null) {
278282
generator.writeKey("_index");
279283
generator.write(this.index);
@@ -355,6 +359,7 @@ public String toString() {
355359
public static class Builder extends WithJsonObjectBuilderBase<Builder>
356360
implements
357361
ObjectBuilder<MultiTermVectorsOperation> {
362+
@Nullable
358363
private String id;
359364

360365
@Nullable
@@ -394,11 +399,11 @@ public static class Builder extends WithJsonObjectBuilderBase<Builder>
394399
private VersionType versionType;
395400

396401
/**
397-
* Required - The ID of the document.
402+
* The ID of the document.
398403
* <p>
399404
* API name: {@code _id}
400405
*/
401-
public final Builder id(String value) {
406+
public final Builder id(@Nullable String value) {
402407
this.id = value;
403408
return this;
404409
}

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2720,10 +2720,10 @@
27202720
if (hash.length > 1) {
27212721
hash = hash.substring(1);
27222722
}
2723-
window.location = "https://github.com/elastic/elasticsearch-specification/tree/b1f91f1a0ae5d09da92cf0859b0ff92410cdb6e3/specification/" + (paths[hash] || "");
2723+
window.location = "https://github.com/elastic/elasticsearch-specification/tree/6fdb2c26900d426863c4f01c165f932bb7633d20/specification/" + (paths[hash] || "");
27242724
</script>
27252725
</head>
27262726
<body>
2727-
Please see the <a href="https://github.com/elastic/elasticsearch-specification/tree/b1f91f1a0ae5d09da92cf0859b0ff92410cdb6e3/specification/">Elasticsearch API specification</a>.
2727+
Please see the <a href="https://github.com/elastic/elasticsearch-specification/tree/6fdb2c26900d426863c4f01c165f932bb7633d20/specification/">Elasticsearch API specification</a>.
27282728
</body>
27292729
</html>

java-client/src/main/java/co/elastic/clients/elasticsearch/nodes/info/NodeInfoScript.java

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -61,15 +61,15 @@
6161
public class NodeInfoScript implements JsonpSerializable {
6262
private final String allowedTypes;
6363

64+
@Nullable
6465
private final String disableMaxCompilationsRate;
6566

6667
// ---------------------------------------------------------------------------------------------
6768

6869
private NodeInfoScript(Builder builder) {
6970

7071
this.allowedTypes = ApiTypeHelper.requireNonNull(builder.allowedTypes, this, "allowedTypes");
71-
this.disableMaxCompilationsRate = ApiTypeHelper.requireNonNull(builder.disableMaxCompilationsRate, this,
72-
"disableMaxCompilationsRate");
72+
this.disableMaxCompilationsRate = builder.disableMaxCompilationsRate;
7373

7474
}
7575

@@ -85,8 +85,9 @@ public final String allowedTypes() {
8585
}
8686

8787
/**
88-
* Required - API name: {@code disable_max_compilations_rate}
88+
* API name: {@code disable_max_compilations_rate}
8989
*/
90+
@Nullable
9091
public final String disableMaxCompilationsRate() {
9192
return this.disableMaxCompilationsRate;
9293
}
@@ -105,8 +106,11 @@ protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) {
105106
generator.writeKey("allowed_types");
106107
generator.write(this.allowedTypes);
107108

108-
generator.writeKey("disable_max_compilations_rate");
109-
generator.write(this.disableMaxCompilationsRate);
109+
if (this.disableMaxCompilationsRate != null) {
110+
generator.writeKey("disable_max_compilations_rate");
111+
generator.write(this.disableMaxCompilationsRate);
112+
113+
}
110114

111115
}
112116

@@ -124,6 +128,7 @@ public String toString() {
124128
public static class Builder extends WithJsonObjectBuilderBase<Builder> implements ObjectBuilder<NodeInfoScript> {
125129
private String allowedTypes;
126130

131+
@Nullable
127132
private String disableMaxCompilationsRate;
128133

129134
/**
@@ -135,9 +140,9 @@ public final Builder allowedTypes(String value) {
135140
}
136141

137142
/**
138-
* Required - API name: {@code disable_max_compilations_rate}
143+
* API name: {@code disable_max_compilations_rate}
139144
*/
140-
public final Builder disableMaxCompilationsRate(String value) {
145+
public final Builder disableMaxCompilationsRate(@Nullable String value) {
141146
this.disableMaxCompilationsRate = value;
142147
return this;
143148
}

java-client/src/main/java/co/elastic/clients/elasticsearch/nodes/info/NodeInfoSettings.java

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,7 @@ public class NodeInfoSettings implements JsonpSerializable {
7474
@Nullable
7575
private final NodeInfoAction action;
7676

77+
@Nullable
7778
private final NodeInfoClient client;
7879

7980
private final NodeInfoSettingsHttp http;
@@ -108,7 +109,7 @@ private NodeInfoSettings(Builder builder) {
108109
this.repositories = builder.repositories;
109110
this.discovery = builder.discovery;
110111
this.action = builder.action;
111-
this.client = ApiTypeHelper.requireNonNull(builder.client, this, "client");
112+
this.client = builder.client;
112113
this.http = ApiTypeHelper.requireNonNull(builder.http, this, "http");
113114
this.bootstrap = builder.bootstrap;
114115
this.transport = ApiTypeHelper.requireNonNull(builder.transport, this, "transport");
@@ -171,8 +172,9 @@ public final NodeInfoAction action() {
171172
}
172173

173174
/**
174-
* Required - API name: {@code client}
175+
* API name: {@code client}
175176
*/
177+
@Nullable
176178
public final NodeInfoClient client() {
177179
return this.client;
178180
}
@@ -276,9 +278,11 @@ protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) {
276278
this.action.serialize(generator, mapper);
277279

278280
}
279-
generator.writeKey("client");
280-
this.client.serialize(generator, mapper);
281+
if (this.client != null) {
282+
generator.writeKey("client");
283+
this.client.serialize(generator, mapper);
281284

285+
}
282286
generator.writeKey("http");
283287
this.http.serialize(generator, mapper);
284288

@@ -346,6 +350,7 @@ public static class Builder extends WithJsonObjectBuilderBase<Builder> implement
346350
@Nullable
347351
private NodeInfoAction action;
348352

353+
@Nullable
349354
private NodeInfoClient client;
350355

351356
private NodeInfoSettingsHttp http;
@@ -463,15 +468,15 @@ public final Builder action(Function<NodeInfoAction.Builder, ObjectBuilder<NodeI
463468
}
464469

465470
/**
466-
* Required - API name: {@code client}
471+
* API name: {@code client}
467472
*/
468-
public final Builder client(NodeInfoClient value) {
473+
public final Builder client(@Nullable NodeInfoClient value) {
469474
this.client = value;
470475
return this;
471476
}
472477

473478
/**
474-
* Required - API name: {@code client}
479+
* API name: {@code client}
475480
*/
476481
public final Builder client(Function<NodeInfoClient.Builder, ObjectBuilder<NodeInfoClient>> fn) {
477482
return this.client(fn.apply(new NodeInfoClient.Builder()).build());

0 commit comments

Comments
 (0)