Skip to content

Commit a724806

Browse files
committed
[codegen] update to latest spec
1 parent 8662f0b commit a724806

File tree

82 files changed

+8621
-1579
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

82 files changed

+8621
-1579
lines changed

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

Lines changed: 0 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -68,8 +68,6 @@ public class BulkIndexByScrollFailure implements JsonpSerializable {
6868

6969
private final int status;
7070

71-
private final String type;
72-
7371
// ---------------------------------------------------------------------------------------------
7472

7573
private BulkIndexByScrollFailure(Builder builder) {
@@ -78,7 +76,6 @@ private BulkIndexByScrollFailure(Builder builder) {
7876
this.id = ApiTypeHelper.requireNonNull(builder.id, this, "id");
7977
this.index = ApiTypeHelper.requireNonNull(builder.index, this, "index");
8078
this.status = ApiTypeHelper.requireNonNull(builder.status, this, "status");
81-
this.type = ApiTypeHelper.requireNonNull(builder.type, this, "type");
8279

8380
}
8481

@@ -114,13 +111,6 @@ public final int status() {
114111
return this.status;
115112
}
116113

117-
/**
118-
* Required - API name: {@code type}
119-
*/
120-
public final String type() {
121-
return this.type;
122-
}
123-
124114
/**
125115
* Serialize this object to JSON.
126116
*/
@@ -144,9 +134,6 @@ protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) {
144134
generator.writeKey("status");
145135
generator.write(this.status);
146136

147-
generator.writeKey("type");
148-
generator.write(this.type);
149-
150137
}
151138

152139
@Override
@@ -171,8 +158,6 @@ public static class Builder extends WithJsonObjectBuilderBase<Builder>
171158

172159
private Integer status;
173160

174-
private String type;
175-
176161
/**
177162
* Required - API name: {@code cause}
178163
*/
@@ -212,14 +197,6 @@ public final Builder status(int value) {
212197
return this;
213198
}
214199

215-
/**
216-
* Required - API name: {@code type}
217-
*/
218-
public final Builder type(String value) {
219-
this.type = value;
220-
return this;
221-
}
222-
223200
@Override
224201
protected Builder self() {
225202
return this;
@@ -253,7 +230,6 @@ protected static void setupBulkIndexByScrollFailureDeserializer(
253230
op.add(Builder::id, JsonpDeserializer.stringDeserializer(), "id");
254231
op.add(Builder::index, JsonpDeserializer.stringDeserializer(), "index");
255232
op.add(Builder::status, JsonpDeserializer.integerDeserializer(), "status");
256-
op.add(Builder::type, JsonpDeserializer.stringDeserializer(), "type");
257233

258234
}
259235

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

Lines changed: 6 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -87,8 +87,6 @@ public static AggregationRange of(Function<Builder, ObjectBuilder<AggregationRan
8787
* Start of the range (inclusive).
8888
* <p>
8989
* API name: {@code from}
90-
* <p>
91-
* Defaults to {@code 0} if parsed from a JSON {@code null} value.
9290
*/
9391
@Nullable
9492
public final Double from() {
@@ -109,8 +107,6 @@ public final String key() {
109107
* End of the range (exclusive).
110108
* <p>
111109
* API name: {@code to}
112-
* <p>
113-
* Defaults to {@code 0} if parsed from a JSON {@code null} value.
114110
*/
115111
@Nullable
116112
public final Double to() {
@@ -130,7 +126,8 @@ protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) {
130126

131127
if (this.from != null) {
132128
generator.writeKey("from");
133-
JsonpUtils.serializeDoubleOrNull(generator, this.from, 0);
129+
generator.write(this.from);
130+
134131
}
135132
if (this.key != null) {
136133
generator.writeKey("key");
@@ -139,7 +136,8 @@ protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) {
139136
}
140137
if (this.to != null) {
141138
generator.writeKey("to");
142-
JsonpUtils.serializeDoubleOrNull(generator, this.to, 0);
139+
generator.write(this.to);
140+
143141
}
144142

145143
}
@@ -169,8 +167,6 @@ public static class Builder extends WithJsonObjectBuilderBase<Builder> implement
169167
* Start of the range (inclusive).
170168
* <p>
171169
* API name: {@code from}
172-
* <p>
173-
* Defaults to {@code 0} if parsed from a JSON {@code null} value.
174170
*/
175171
public final Builder from(@Nullable Double value) {
176172
this.from = value;
@@ -191,8 +187,6 @@ public final Builder key(@Nullable String value) {
191187
* End of the range (exclusive).
192188
* <p>
193189
* API name: {@code to}
194-
* <p>
195-
* Defaults to {@code 0} if parsed from a JSON {@code null} value.
196190
*/
197191
public final Builder to(@Nullable Double value) {
198192
this.to = value;
@@ -227,9 +221,9 @@ public AggregationRange build() {
227221

228222
protected static void setupAggregationRangeDeserializer(ObjectDeserializer<AggregationRange.Builder> op) {
229223

230-
op.add(Builder::from, JsonpDeserializer.doubleOrNullDeserializer(0), "from");
224+
op.add(Builder::from, JsonpDeserializer.doubleDeserializer(), "from");
231225
op.add(Builder::key, JsonpDeserializer.stringDeserializer(), "key");
232-
op.add(Builder::to, JsonpDeserializer.doubleOrNullDeserializer(0), "to");
226+
op.add(Builder::to, JsonpDeserializer.doubleDeserializer(), "to");
233227

234228
}
235229

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

Lines changed: 15 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,8 @@
6363
public class ArrayPercentilesItem implements JsonpSerializable {
6464
private final String key;
6565

66-
private final double value;
66+
@Nullable
67+
private final Double value;
6768

6869
@Nullable
6970
private final String valueAsString;
@@ -73,7 +74,7 @@ public class ArrayPercentilesItem implements JsonpSerializable {
7374
private ArrayPercentilesItem(Builder builder) {
7475

7576
this.key = ApiTypeHelper.requireNonNull(builder.key, this, "key");
76-
this.value = ApiTypeHelper.requireNonNull(builder.value, this, "value");
77+
this.value = builder.value;
7778
this.valueAsString = builder.valueAsString;
7879

7980
}
@@ -90,11 +91,10 @@ public final String key() {
9091
}
9192

9293
/**
93-
* Required - API name: {@code value}
94-
* <p>
95-
* Defaults to {@code 0} if parsed from a JSON {@code null} value.
94+
* API name: {@code value}
9695
*/
97-
public final double value() {
96+
@Nullable
97+
public final Double value() {
9898
return this.value;
9999
}
100100

@@ -120,8 +120,11 @@ protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) {
120120
generator.writeKey("key");
121121
generator.write(this.key);
122122

123-
generator.writeKey("value");
124-
JsonpUtils.serializeDoubleOrNull(generator, this.value, 0);
123+
if (this.value != null) {
124+
generator.writeKey("value");
125+
generator.write(this.value);
126+
127+
}
125128
if (this.valueAsString != null) {
126129
generator.writeKey("value_as_string");
127130
generator.write(this.valueAsString);
@@ -146,6 +149,7 @@ public static class Builder extends WithJsonObjectBuilderBase<Builder>
146149
ObjectBuilder<ArrayPercentilesItem> {
147150
private String key;
148151

152+
@Nullable
149153
private Double value;
150154

151155
@Nullable
@@ -160,11 +164,9 @@ public final Builder key(String value) {
160164
}
161165

162166
/**
163-
* Required - API name: {@code value}
164-
* <p>
165-
* Defaults to {@code 0} if parsed from a JSON {@code null} value.
167+
* API name: {@code value}
166168
*/
167-
public final Builder value(double value) {
169+
public final Builder value(@Nullable Double value) {
168170
this.value = value;
169171
return this;
170172
}
@@ -206,7 +208,7 @@ public ArrayPercentilesItem build() {
206208
protected static void setupArrayPercentilesItemDeserializer(ObjectDeserializer<ArrayPercentilesItem.Builder> op) {
207209

208210
op.add(Builder::key, JsonpDeserializer.stringDeserializer(), "key");
209-
op.add(Builder::value, JsonpDeserializer.doubleOrNullDeserializer(0), "value");
211+
op.add(Builder::value, JsonpDeserializer.doubleDeserializer(), "value");
210212
op.add(Builder::valueAsString, JsonpDeserializer.stringDeserializer(), "value_as_string");
211213

212214
}

0 commit comments

Comments
 (0)