Skip to content

Commit

Permalink
Merge branch '9.0' into backport/9.0/pr-952
Browse files Browse the repository at this point in the history
  • Loading branch information
l-trotta authored Mar 7, 2025
2 parents ec276ec + 0fb52a3 commit f2708f9
Show file tree
Hide file tree
Showing 53 changed files with 3,111 additions and 1,159 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -68,8 +68,6 @@ public class BulkIndexByScrollFailure implements JsonpSerializable {

private final int status;

private final String type;

// ---------------------------------------------------------------------------------------------

private BulkIndexByScrollFailure(Builder builder) {
Expand All @@ -78,7 +76,6 @@ private BulkIndexByScrollFailure(Builder builder) {
this.id = ApiTypeHelper.requireNonNull(builder.id, this, "id");
this.index = ApiTypeHelper.requireNonNull(builder.index, this, "index");
this.status = ApiTypeHelper.requireNonNull(builder.status, this, "status");
this.type = ApiTypeHelper.requireNonNull(builder.type, this, "type");

}

Expand Down Expand Up @@ -114,13 +111,6 @@ public final int status() {
return this.status;
}

/**
* Required - API name: {@code type}
*/
public final String type() {
return this.type;
}

/**
* Serialize this object to JSON.
*/
Expand All @@ -144,9 +134,6 @@ protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) {
generator.writeKey("status");
generator.write(this.status);

generator.writeKey("type");
generator.write(this.type);

}

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

private Integer status;

private String type;

/**
* Required - API name: {@code cause}
*/
Expand Down Expand Up @@ -212,14 +197,6 @@ public final Builder status(int value) {
return this;
}

/**
* Required - API name: {@code type}
*/
public final Builder type(String value) {
this.type = value;
return this;
}

@Override
protected Builder self() {
return this;
Expand Down Expand Up @@ -253,7 +230,6 @@ protected static void setupBulkIndexByScrollFailureDeserializer(
op.add(Builder::id, JsonpDeserializer.stringDeserializer(), "id");
op.add(Builder::index, JsonpDeserializer.stringDeserializer(), "index");
op.add(Builder::status, JsonpDeserializer.integerDeserializer(), "status");
op.add(Builder::type, JsonpDeserializer.stringDeserializer(), "type");

}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -87,8 +87,6 @@ public static AggregationRange of(Function<Builder, ObjectBuilder<AggregationRan
* Start of the range (inclusive).
* <p>
* API name: {@code from}
* <p>
* Defaults to {@code 0} if parsed from a JSON {@code null} value.
*/
@Nullable
public final Double from() {
Expand All @@ -109,8 +107,6 @@ public final String key() {
* End of the range (exclusive).
* <p>
* API name: {@code to}
* <p>
* Defaults to {@code 0} if parsed from a JSON {@code null} value.
*/
@Nullable
public final Double to() {
Expand All @@ -130,7 +126,8 @@ protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) {

if (this.from != null) {
generator.writeKey("from");
JsonpUtils.serializeDoubleOrNull(generator, this.from, 0);
generator.write(this.from);

}
if (this.key != null) {
generator.writeKey("key");
Expand All @@ -139,7 +136,8 @@ protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) {
}
if (this.to != null) {
generator.writeKey("to");
JsonpUtils.serializeDoubleOrNull(generator, this.to, 0);
generator.write(this.to);

}

}
Expand Down Expand Up @@ -169,8 +167,6 @@ public static class Builder extends WithJsonObjectBuilderBase<Builder> implement
* Start of the range (inclusive).
* <p>
* API name: {@code from}
* <p>
* Defaults to {@code 0} if parsed from a JSON {@code null} value.
*/
public final Builder from(@Nullable Double value) {
this.from = value;
Expand All @@ -191,8 +187,6 @@ public final Builder key(@Nullable String value) {
* End of the range (exclusive).
* <p>
* API name: {@code to}
* <p>
* Defaults to {@code 0} if parsed from a JSON {@code null} value.
*/
public final Builder to(@Nullable Double value) {
this.to = value;
Expand Down Expand Up @@ -227,9 +221,9 @@ public AggregationRange build() {

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

op.add(Builder::from, JsonpDeserializer.doubleOrNullDeserializer(0), "from");
op.add(Builder::from, JsonpDeserializer.doubleDeserializer(), "from");
op.add(Builder::key, JsonpDeserializer.stringDeserializer(), "key");
op.add(Builder::to, JsonpDeserializer.doubleOrNullDeserializer(0), "to");
op.add(Builder::to, JsonpDeserializer.doubleDeserializer(), "to");

}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,8 @@
public class ArrayPercentilesItem implements JsonpSerializable {
private final String key;

private final double value;
@Nullable
private final Double value;

@Nullable
private final String valueAsString;
Expand All @@ -73,7 +74,7 @@ public class ArrayPercentilesItem implements JsonpSerializable {
private ArrayPercentilesItem(Builder builder) {

this.key = ApiTypeHelper.requireNonNull(builder.key, this, "key");
this.value = ApiTypeHelper.requireNonNull(builder.value, this, "value");
this.value = builder.value;
this.valueAsString = builder.valueAsString;

}
Expand All @@ -90,11 +91,10 @@ public final String key() {
}

/**
* Required - API name: {@code value}
* <p>
* Defaults to {@code 0} if parsed from a JSON {@code null} value.
* API name: {@code value}
*/
public final double value() {
@Nullable
public final Double value() {
return this.value;
}

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

generator.writeKey("value");
JsonpUtils.serializeDoubleOrNull(generator, this.value, 0);
if (this.value != null) {
generator.writeKey("value");
generator.write(this.value);

}
if (this.valueAsString != null) {
generator.writeKey("value_as_string");
generator.write(this.valueAsString);
Expand All @@ -146,6 +149,7 @@ public static class Builder extends WithJsonObjectBuilderBase<Builder>
ObjectBuilder<ArrayPercentilesItem> {
private String key;

@Nullable
private Double value;

@Nullable
Expand All @@ -160,11 +164,9 @@ public final Builder key(String value) {
}

/**
* Required - API name: {@code value}
* <p>
* Defaults to {@code 0} if parsed from a JSON {@code null} value.
* API name: {@code value}
*/
public final Builder value(double value) {
public final Builder value(@Nullable Double value) {
this.value = value;
return this;
}
Expand Down Expand Up @@ -206,7 +208,7 @@ public ArrayPercentilesItem build() {
protected static void setupArrayPercentilesItemDeserializer(ObjectDeserializer<ArrayPercentilesItem.Builder> op) {

op.add(Builder::key, JsonpDeserializer.stringDeserializer(), "key");
op.add(Builder::value, JsonpDeserializer.doubleOrNullDeserializer(0), "value");
op.add(Builder::value, JsonpDeserializer.doubleDeserializer(), "value");
op.add(Builder::valueAsString, JsonpDeserializer.stringDeserializer(), "value_as_string");

}
Expand Down
Loading

0 comments on commit f2708f9

Please sign in to comment.