diff --git a/java-client/src/main/java/co/elastic/clients/elasticsearch/_types/KnnQuery.java b/java-client/src/main/java/co/elastic/clients/elasticsearch/_types/KnnQuery.java index 4c1818f1c..66ebb9d8c 100644 --- a/java-client/src/main/java/co/elastic/clients/elasticsearch/_types/KnnQuery.java +++ b/java-client/src/main/java/co/elastic/clients/elasticsearch/_types/KnnQuery.java @@ -72,6 +72,9 @@ public class KnnQuery extends QueryBase implements QueryVariant { @Nullable private final Integer numCandidates; + @Nullable + private final Integer k; + private final List filter; @Nullable @@ -86,6 +89,7 @@ private KnnQuery(Builder builder) { this.queryVector = ApiTypeHelper.unmodifiable(builder.queryVector); this.queryVectorBuilder = builder.queryVectorBuilder; this.numCandidates = builder.numCandidates; + this.k = builder.k; this.filter = ApiTypeHelper.unmodifiable(builder.filter); this.similarity = builder.similarity; @@ -142,6 +146,16 @@ public final Integer numCandidates() { return this.numCandidates; } + /** + * The final number of nearest neighbors to return as top hits + *

+ * API name: {@code k} + */ + @Nullable + public final Integer k() { + return this.k; + } + /** * Filters for the kNN search query *

@@ -186,6 +200,11 @@ protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { generator.writeKey("num_candidates"); generator.write(this.numCandidates); + } + if (this.k != null) { + generator.writeKey("k"); + generator.write(this.k); + } if (ApiTypeHelper.isDefined(this.filter)) { generator.writeKey("filter"); @@ -223,6 +242,9 @@ public static class Builder extends QueryBase.AbstractBuilder implement @Nullable private Integer numCandidates; + @Nullable + private Integer k; + @Nullable private List filter; @@ -295,6 +317,16 @@ public final Builder numCandidates(@Nullable Integer value) { return this; } + /** + * The final number of nearest neighbors to return as top hits + *

+ * API name: {@code k} + */ + public final Builder k(@Nullable Integer value) { + this.k = value; + return this; + } + /** * Filters for the kNN search query *

@@ -373,6 +405,7 @@ protected static void setupKnnQueryDeserializer(ObjectDeserializer implements RangeQueryVariant { + // Single key dictionary + private final String field; + @Nullable private final String format; @@ -66,6 +70,7 @@ public class DateRangeQuery extends RangeQueryBase implements RangeQuery private DateRangeQuery(Builder builder) { super(builder); + this.field = ApiTypeHelper.requireNonNull(builder.field, this, "field"); this.format = builder.format; this.timeZone = builder.timeZone; @@ -84,6 +89,13 @@ public RangeQuery.Kind _rangeQueryKind() { return RangeQuery.Kind.Date; } + /** + * Required - the required field + */ + public final String field() { + return this.field; + } + /** * Date format used to convert date values in the query. *

@@ -106,6 +118,7 @@ public final String timeZone() { } protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { + generator.writeStartObject(this.field); super.serializeInternal(generator, mapper); if (this.format != null) { @@ -119,6 +132,8 @@ protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { } + generator.writeEnd(); + } // --------------------------------------------------------------------------------------------- @@ -130,6 +145,16 @@ protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { public static class Builder extends RangeQueryBase.AbstractBuilder implements ObjectBuilder { + private String field; + + /** + * Required - the required field + */ + public final Builder field(String value) { + this.field = value; + return this; + } + @Nullable private String format; @@ -189,6 +214,8 @@ protected static void setupDateRangeQueryDeserializer(ObjectDeserializer implements RangeQueryVariant { + // Single key dictionary + private final String field; + // --------------------------------------------------------------------------------------------- private NumberRangeQuery(Builder builder) { super(builder); + this.field = ApiTypeHelper.requireNonNull(builder.field, this, "field"); } @@ -73,6 +81,22 @@ public RangeQuery.Kind _rangeQueryKind() { return RangeQuery.Kind.Number; } + /** + * Required - the required field + */ + public final String field() { + return this.field; + } + + protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { + generator.writeStartObject(this.field); + + super.serializeInternal(generator, mapper); + + generator.writeEnd(); + + } + // --------------------------------------------------------------------------------------------- /** @@ -82,6 +106,16 @@ public RangeQuery.Kind _rangeQueryKind() { public static class Builder extends RangeQueryBase.AbstractBuilder implements ObjectBuilder { + private String field; + + /** + * Required - the required field + */ + public final Builder field(String value) { + this.field = value; + return this; + } + @Override protected Builder self() { return this; @@ -112,6 +146,8 @@ public NumberRangeQuery build() { protected static void setupNumberRangeQueryDeserializer(ObjectDeserializer op) { RangeQueryBase.setupRangeQueryBaseDeserializer(op, JsonpDeserializer.doubleDeserializer()); + op.setKey(Builder::field, JsonpDeserializer.stringDeserializer()); + } } diff --git a/java-client/src/main/java/co/elastic/clients/elasticsearch/_types/query_dsl/RangeQueryBase.java b/java-client/src/main/java/co/elastic/clients/elasticsearch/_types/query_dsl/RangeQueryBase.java index 738b22398..e0625e335 100644 --- a/java-client/src/main/java/co/elastic/clients/elasticsearch/_types/query_dsl/RangeQueryBase.java +++ b/java-client/src/main/java/co/elastic/clients/elasticsearch/_types/query_dsl/RangeQueryBase.java @@ -26,11 +26,9 @@ import co.elastic.clients.json.JsonpUtils; import co.elastic.clients.json.ObjectBuilderDeserializer; import co.elastic.clients.json.ObjectDeserializer; -import co.elastic.clients.util.ApiTypeHelper; import co.elastic.clients.util.ObjectBuilder; import co.elastic.clients.util.WithJsonObjectBuilderBase; import jakarta.json.stream.JsonGenerator; -import java.lang.String; import java.util.Objects; import javax.annotation.Nullable; @@ -59,9 +57,6 @@ */ public abstract class RangeQueryBase extends QueryBase { - // Single key dictionary - private final String field; - @Nullable private final RangeRelation relation; @@ -90,7 +85,6 @@ public abstract class RangeQueryBase extends QueryBase { protected RangeQueryBase(AbstractBuilder builder) { super(builder); - this.field = ApiTypeHelper.requireNonNull(builder.field, this, "field"); this.relation = builder.relation; this.gt = builder.gt; @@ -103,13 +97,6 @@ protected RangeQueryBase(AbstractBuilder builder) { } - /** - * Required - the required field - */ - public final String field() { - return this.field; - } - /** * Indicates how the range query matches values for range fields. *

@@ -177,7 +164,6 @@ public final T to() { } protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { - generator.writeStartObject(this.field); super.serializeInternal(generator, mapper); if (this.relation != null) { @@ -215,23 +201,11 @@ protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { } - generator.writeEnd(); - } public abstract static class AbstractBuilder> extends QueryBase.AbstractBuilder { - private String field; - - /** - * Required - the required field - */ - public final BuilderT field(String value) { - this.field = value; - return self(); - } - @Nullable private RangeRelation relation; @@ -345,8 +319,6 @@ protected static > void setupRa op.add(AbstractBuilder::from, tDeserializer, "from"); op.add(AbstractBuilder::to, tDeserializer, "to"); - op.setKey(AbstractBuilder::field, JsonpDeserializer.stringDeserializer()); - } } diff --git a/java-client/src/main/java/co/elastic/clients/elasticsearch/_types/query_dsl/TermRangeQuery.java b/java-client/src/main/java/co/elastic/clients/elasticsearch/_types/query_dsl/TermRangeQuery.java index 35a2ed26b..136f4817f 100644 --- a/java-client/src/main/java/co/elastic/clients/elasticsearch/_types/query_dsl/TermRangeQuery.java +++ b/java-client/src/main/java/co/elastic/clients/elasticsearch/_types/query_dsl/TermRangeQuery.java @@ -21,13 +21,16 @@ import co.elastic.clients.json.JsonpDeserializable; import co.elastic.clients.json.JsonpDeserializer; +import co.elastic.clients.json.JsonpMapper; import co.elastic.clients.json.ObjectBuilderDeserializer; import co.elastic.clients.json.ObjectDeserializer; +import co.elastic.clients.util.ApiTypeHelper; import co.elastic.clients.util.ObjectBuilder; import jakarta.json.stream.JsonGenerator; import java.lang.String; import java.util.Objects; import java.util.function.Function; +import javax.annotation.Nullable; //---------------------------------------------------------------- // THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. @@ -54,10 +57,14 @@ */ @JsonpDeserializable public class TermRangeQuery extends RangeQueryBase implements RangeQueryVariant { + // Single key dictionary + private final String field; + // --------------------------------------------------------------------------------------------- private TermRangeQuery(Builder builder) { super(builder); + this.field = ApiTypeHelper.requireNonNull(builder.field, this, "field"); } @@ -73,6 +80,22 @@ public RangeQuery.Kind _rangeQueryKind() { return RangeQuery.Kind.Term; } + /** + * Required - the required field + */ + public final String field() { + return this.field; + } + + protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { + generator.writeStartObject(this.field); + + super.serializeInternal(generator, mapper); + + generator.writeEnd(); + + } + // --------------------------------------------------------------------------------------------- /** @@ -82,6 +105,16 @@ public RangeQuery.Kind _rangeQueryKind() { public static class Builder extends RangeQueryBase.AbstractBuilder implements ObjectBuilder { + private String field; + + /** + * Required - the required field + */ + public final Builder field(String value) { + this.field = value; + return this; + } + @Override protected Builder self() { return this; @@ -112,6 +145,8 @@ public TermRangeQuery build() { protected static void setupTermRangeQueryDeserializer(ObjectDeserializer op) { RangeQueryBase.setupRangeQueryBaseDeserializer(op, JsonpDeserializer.stringDeserializer()); + op.setKey(Builder::field, JsonpDeserializer.stringDeserializer()); + } } diff --git a/java-client/src/main/java/co/elastic/clients/elasticsearch/_types/query_dsl/UntypedRangeQuery.java b/java-client/src/main/java/co/elastic/clients/elasticsearch/_types/query_dsl/UntypedRangeQuery.java index 69d216052..abdfb9ba8 100644 --- a/java-client/src/main/java/co/elastic/clients/elasticsearch/_types/query_dsl/UntypedRangeQuery.java +++ b/java-client/src/main/java/co/elastic/clients/elasticsearch/_types/query_dsl/UntypedRangeQuery.java @@ -25,6 +25,7 @@ import co.elastic.clients.json.JsonpMapper; import co.elastic.clients.json.ObjectBuilderDeserializer; import co.elastic.clients.json.ObjectDeserializer; +import co.elastic.clients.util.ApiTypeHelper; import co.elastic.clients.util.ObjectBuilder; import jakarta.json.stream.JsonGenerator; import java.lang.String; @@ -57,6 +58,9 @@ */ @JsonpDeserializable public class UntypedRangeQuery extends RangeQueryBase implements RangeQueryVariant { + // Single key dictionary + private final String field; + @Nullable private final String format; @@ -67,6 +71,7 @@ public class UntypedRangeQuery extends RangeQueryBase implements Range private UntypedRangeQuery(Builder builder) { super(builder); + this.field = ApiTypeHelper.requireNonNull(builder.field, this, "field"); this.format = builder.format; this.timeZone = builder.timeZone; @@ -85,6 +90,13 @@ public RangeQuery.Kind _rangeQueryKind() { return RangeQuery.Kind.Untyped; } + /** + * Required - the required field + */ + public final String field() { + return this.field; + } + /** * Date format used to convert date values in the query. *

@@ -107,6 +119,7 @@ public final String timeZone() { } protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { + generator.writeStartObject(this.field); super.serializeInternal(generator, mapper); if (this.format != null) { @@ -120,6 +133,8 @@ protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { } + generator.writeEnd(); + } // --------------------------------------------------------------------------------------------- @@ -131,6 +146,16 @@ protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { public static class Builder extends RangeQueryBase.AbstractBuilder implements ObjectBuilder { + private String field; + + /** + * Required - the required field + */ + public final Builder field(String value) { + this.field = value; + return this; + } + @Nullable private String format; @@ -190,6 +215,8 @@ protected static void setupUntypedRangeQueryDeserializer(ObjectDeserializer + * API name: {@code q} + */ + @Nullable + public final String q() { + return this.q; + } + /** * Specifies the documents to update using the Query DSL. *

@@ -684,6 +698,9 @@ public static class Builder extends RequestBase.AbstractBuilder @Nullable private String preference; + @Nullable + private String q; + @Nullable private Query query; @@ -940,6 +957,16 @@ public final Builder preference(@Nullable String value) { return this; } + /** + * Query in the Lucene query string syntax. + *

+ * API name: {@code q} + */ + public final Builder q(@Nullable String value) { + this.q = value; + return this; + } + /** * Specifies the documents to update using the Query DSL. *

@@ -1423,6 +1450,9 @@ protected static void setupUpdateByQueryRequestDeserializer(ObjectDeserializer implements JsonpSerializable { private final Map fields; + private final List ignored; + private final boolean found; private final String id; @@ -98,6 +101,7 @@ protected GetResult(AbstractBuilder builder) { this.index = ApiTypeHelper.requireNonNull(builder.index, this, "index"); this.fields = ApiTypeHelper.unmodifiable(builder.fields); + this.ignored = ApiTypeHelper.unmodifiable(builder.ignored); this.found = ApiTypeHelper.requireNonNull(builder.found, this, "found"); this.id = ApiTypeHelper.requireNonNull(builder.id, this, "id"); this.primaryTerm = builder.primaryTerm; @@ -128,6 +132,13 @@ public final Map fields() { return this.fields; } + /** + * API name: {@code _ignored} + */ + public final List ignored() { + return this.ignored; + } + /** * Required - API name: {@code found} */ @@ -206,6 +217,16 @@ protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { } generator.writeEnd(); + } + if (ApiTypeHelper.isDefined(this.ignored)) { + generator.writeKey("_ignored"); + generator.writeStartArray(); + for (String item0 : this.ignored) { + generator.write(item0); + + } + generator.writeEnd(); + } generator.writeKey("found"); generator.write(this.found); @@ -281,6 +302,9 @@ public abstract static class AbstractBuilder fields; + @Nullable + private List ignored; + private Boolean found; private String id; @@ -331,6 +355,26 @@ public final BuilderT fields(String key, JsonData value) { return self(); } + /** + * API name: {@code _ignored} + *

+ * Adds all elements of list to ignored. + */ + public final BuilderT ignored(List list) { + this.ignored = _listAddAll(this.ignored, list); + return self(); + } + + /** + * API name: {@code _ignored} + *

+ * Adds one or more values to ignored. + */ + public final BuilderT ignored(String value, String... values) { + this.ignored = _listAdd(this.ignored, value, values); + return self(); + } + /** * Required - API name: {@code found} */ @@ -424,6 +468,8 @@ protected static API + * specification + */ +@JsonpDeserializable +public class DataStreamLifecycleDetails implements JsonpSerializable { + private final int stagnatingBackingIndicesCount; + + private final int totalBackingIndicesInError; + + private final List stagnatingBackingIndices; + + // --------------------------------------------------------------------------------------------- + + private DataStreamLifecycleDetails(Builder builder) { + + this.stagnatingBackingIndicesCount = ApiTypeHelper.requireNonNull(builder.stagnatingBackingIndicesCount, this, + "stagnatingBackingIndicesCount"); + this.totalBackingIndicesInError = ApiTypeHelper.requireNonNull(builder.totalBackingIndicesInError, this, + "totalBackingIndicesInError"); + this.stagnatingBackingIndices = ApiTypeHelper.unmodifiable(builder.stagnatingBackingIndices); + + } + + public static DataStreamLifecycleDetails of(Function> fn) { + return fn.apply(new Builder()).build(); + } + + /** + * Required - API name: {@code stagnating_backing_indices_count} + */ + public final int stagnatingBackingIndicesCount() { + return this.stagnatingBackingIndicesCount; + } + + /** + * Required - API name: {@code total_backing_indices_in_error} + */ + public final int totalBackingIndicesInError() { + return this.totalBackingIndicesInError; + } + + /** + * API name: {@code stagnating_backing_indices} + */ + public final List stagnatingBackingIndices() { + return this.stagnatingBackingIndices; + } + + /** + * Serialize this object to JSON. + */ + public void serialize(JsonGenerator generator, JsonpMapper mapper) { + generator.writeStartObject(); + serializeInternal(generator, mapper); + generator.writeEnd(); + } + + protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { + + generator.writeKey("stagnating_backing_indices_count"); + generator.write(this.stagnatingBackingIndicesCount); + + generator.writeKey("total_backing_indices_in_error"); + generator.write(this.totalBackingIndicesInError); + + if (ApiTypeHelper.isDefined(this.stagnatingBackingIndices)) { + generator.writeKey("stagnating_backing_indices"); + generator.writeStartArray(); + for (StagnatingBackingIndices item0 : this.stagnatingBackingIndices) { + item0.serialize(generator, mapper); + + } + generator.writeEnd(); + + } + + } + + @Override + public String toString() { + return JsonpUtils.toString(this); + } + + // --------------------------------------------------------------------------------------------- + + /** + * Builder for {@link DataStreamLifecycleDetails}. + */ + + public static class Builder extends WithJsonObjectBuilderBase + implements + ObjectBuilder { + private Integer stagnatingBackingIndicesCount; + + private Integer totalBackingIndicesInError; + + @Nullable + private List stagnatingBackingIndices; + + /** + * Required - API name: {@code stagnating_backing_indices_count} + */ + public final Builder stagnatingBackingIndicesCount(int value) { + this.stagnatingBackingIndicesCount = value; + return this; + } + + /** + * Required - API name: {@code total_backing_indices_in_error} + */ + public final Builder totalBackingIndicesInError(int value) { + this.totalBackingIndicesInError = value; + return this; + } + + /** + * API name: {@code stagnating_backing_indices} + *

+ * Adds all elements of list to + * stagnatingBackingIndices. + */ + public final Builder stagnatingBackingIndices(List list) { + this.stagnatingBackingIndices = _listAddAll(this.stagnatingBackingIndices, list); + return this; + } + + /** + * API name: {@code stagnating_backing_indices} + *

+ * Adds one or more values to stagnatingBackingIndices. + */ + public final Builder stagnatingBackingIndices(StagnatingBackingIndices value, + StagnatingBackingIndices... values) { + this.stagnatingBackingIndices = _listAdd(this.stagnatingBackingIndices, value, values); + return this; + } + + /** + * API name: {@code stagnating_backing_indices} + *

+ * Adds a value to stagnatingBackingIndices using a builder lambda. + */ + public final Builder stagnatingBackingIndices( + Function> fn) { + return stagnatingBackingIndices(fn.apply(new StagnatingBackingIndices.Builder()).build()); + } + + @Override + protected Builder self() { + return this; + } + + /** + * Builds a {@link DataStreamLifecycleDetails}. + * + * @throws NullPointerException + * if some of the required fields are null. + */ + public DataStreamLifecycleDetails build() { + _checkSingleUse(); + + return new DataStreamLifecycleDetails(this); + } + } + + // --------------------------------------------------------------------------------------------- + + /** + * Json deserializer for {@link DataStreamLifecycleDetails} + */ + public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer + .lazy(Builder::new, DataStreamLifecycleDetails::setupDataStreamLifecycleDetailsDeserializer); + + protected static void setupDataStreamLifecycleDetailsDeserializer( + ObjectDeserializer op) { + + op.add(Builder::stagnatingBackingIndicesCount, JsonpDeserializer.integerDeserializer(), + "stagnating_backing_indices_count"); + op.add(Builder::totalBackingIndicesInError, JsonpDeserializer.integerDeserializer(), + "total_backing_indices_in_error"); + op.add(Builder::stagnatingBackingIndices, + JsonpDeserializer.arrayDeserializer(StagnatingBackingIndices._DESERIALIZER), + "stagnating_backing_indices"); + + } + +} diff --git a/java-client/src/main/java/co/elastic/clients/elasticsearch/core/health_report/DataStreamLifecycleIndicator.java b/java-client/src/main/java/co/elastic/clients/elasticsearch/core/health_report/DataStreamLifecycleIndicator.java new file mode 100644 index 000000000..01dc5b53b --- /dev/null +++ b/java-client/src/main/java/co/elastic/clients/elasticsearch/core/health_report/DataStreamLifecycleIndicator.java @@ -0,0 +1,155 @@ +/* + * Licensed to Elasticsearch B.V. under one or more contributor + * license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright + * ownership. Elasticsearch B.V. licenses this file to you under + * the Apache License, Version 2.0 (the "License"); you may + * not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +package co.elastic.clients.elasticsearch.core.health_report; + +import co.elastic.clients.json.JsonpDeserializable; +import co.elastic.clients.json.JsonpDeserializer; +import co.elastic.clients.json.JsonpMapper; +import co.elastic.clients.json.ObjectBuilderDeserializer; +import co.elastic.clients.json.ObjectDeserializer; +import co.elastic.clients.util.ObjectBuilder; +import jakarta.json.stream.JsonGenerator; +import java.util.Objects; +import java.util.function.Function; +import javax.annotation.Nullable; + +//---------------------------------------------------------------- +// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. +//---------------------------------------------------------------- +// +// This code is generated from the Elasticsearch API specification +// at https://github.com/elastic/elasticsearch-specification +// +// Manual updates to this file will be lost when the code is +// re-generated. +// +// If you find a property that is missing or wrongly typed, please +// open an issue or a PR on the API specification repository. +// +//---------------------------------------------------------------- + +// typedef: _global.health_report.DataStreamLifecycleIndicator + +/** + * DATA_STREAM_LIFECYCLE + * + * @see API + * specification + */ +@JsonpDeserializable +public class DataStreamLifecycleIndicator extends BaseIndicator { + @Nullable + private final DataStreamLifecycleDetails details; + + // --------------------------------------------------------------------------------------------- + + private DataStreamLifecycleIndicator(Builder builder) { + super(builder); + + this.details = builder.details; + + } + + public static DataStreamLifecycleIndicator of(Function> fn) { + return fn.apply(new Builder()).build(); + } + + /** + * API name: {@code details} + */ + @Nullable + public final DataStreamLifecycleDetails details() { + return this.details; + } + + protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { + + super.serializeInternal(generator, mapper); + if (this.details != null) { + generator.writeKey("details"); + this.details.serialize(generator, mapper); + + } + + } + + // --------------------------------------------------------------------------------------------- + + /** + * Builder for {@link DataStreamLifecycleIndicator}. + */ + + public static class Builder extends BaseIndicator.AbstractBuilder + implements + ObjectBuilder { + @Nullable + private DataStreamLifecycleDetails details; + + /** + * API name: {@code details} + */ + public final Builder details(@Nullable DataStreamLifecycleDetails value) { + this.details = value; + return this; + } + + /** + * API name: {@code details} + */ + public final Builder details( + Function> fn) { + return this.details(fn.apply(new DataStreamLifecycleDetails.Builder()).build()); + } + + @Override + protected Builder self() { + return this; + } + + /** + * Builds a {@link DataStreamLifecycleIndicator}. + * + * @throws NullPointerException + * if some of the required fields are null. + */ + public DataStreamLifecycleIndicator build() { + _checkSingleUse(); + + return new DataStreamLifecycleIndicator(this); + } + } + + // --------------------------------------------------------------------------------------------- + + /** + * Json deserializer for {@link DataStreamLifecycleIndicator} + */ + public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer + .lazy(Builder::new, DataStreamLifecycleIndicator::setupDataStreamLifecycleIndicatorDeserializer); + + protected static void setupDataStreamLifecycleIndicatorDeserializer( + ObjectDeserializer op) { + BaseIndicator.setupBaseIndicatorDeserializer(op); + op.add(Builder::details, DataStreamLifecycleDetails._DESERIALIZER, "details"); + + } + +} diff --git a/java-client/src/main/java/co/elastic/clients/elasticsearch/core/health_report/Indicators.java b/java-client/src/main/java/co/elastic/clients/elasticsearch/core/health_report/Indicators.java index 58f269bfa..f313d5945 100644 --- a/java-client/src/main/java/co/elastic/clients/elasticsearch/core/health_report/Indicators.java +++ b/java-client/src/main/java/co/elastic/clients/elasticsearch/core/health_report/Indicators.java @@ -70,6 +70,9 @@ public class Indicators implements JsonpSerializable { @Nullable private final RepositoryIntegrityIndicator repositoryIntegrity; + @Nullable + private final DataStreamLifecycleIndicator dataStreamLifecycle; + @Nullable private final IlmIndicator ilm; @@ -87,6 +90,7 @@ private Indicators(Builder builder) { this.shardsAvailability = builder.shardsAvailability; this.disk = builder.disk; this.repositoryIntegrity = builder.repositoryIntegrity; + this.dataStreamLifecycle = builder.dataStreamLifecycle; this.ilm = builder.ilm; this.slm = builder.slm; this.shardsCapacity = builder.shardsCapacity; @@ -129,6 +133,14 @@ public final RepositoryIntegrityIndicator repositoryIntegrity() { return this.repositoryIntegrity; } + /** + * API name: {@code data_stream_lifecycle} + */ + @Nullable + public final DataStreamLifecycleIndicator dataStreamLifecycle() { + return this.dataStreamLifecycle; + } + /** * API name: {@code ilm} */ @@ -183,6 +195,11 @@ protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { generator.writeKey("repository_integrity"); this.repositoryIntegrity.serialize(generator, mapper); + } + if (this.dataStreamLifecycle != null) { + generator.writeKey("data_stream_lifecycle"); + this.dataStreamLifecycle.serialize(generator, mapper); + } if (this.ilm != null) { generator.writeKey("ilm"); @@ -226,6 +243,9 @@ public static class Builder extends WithJsonObjectBuilderBase implement @Nullable private RepositoryIntegrityIndicator repositoryIntegrity; + @Nullable + private DataStreamLifecycleIndicator dataStreamLifecycle; + @Nullable private IlmIndicator ilm; @@ -298,6 +318,22 @@ public final Builder repositoryIntegrity( return this.repositoryIntegrity(fn.apply(new RepositoryIntegrityIndicator.Builder()).build()); } + /** + * API name: {@code data_stream_lifecycle} + */ + public final Builder dataStreamLifecycle(@Nullable DataStreamLifecycleIndicator value) { + this.dataStreamLifecycle = value; + return this; + } + + /** + * API name: {@code data_stream_lifecycle} + */ + public final Builder dataStreamLifecycle( + Function> fn) { + return this.dataStreamLifecycle(fn.apply(new DataStreamLifecycleIndicator.Builder()).build()); + } + /** * API name: {@code ilm} */ @@ -376,6 +412,7 @@ protected static void setupIndicatorsDeserializer(ObjectDeserializerAPI + * specification + */ +@JsonpDeserializable +public class StagnatingBackingIndices implements JsonpSerializable { + private final String indexName; + + private final long firstOccurrenceTimestamp; + + private final int retryCount; + + // --------------------------------------------------------------------------------------------- + + private StagnatingBackingIndices(Builder builder) { + + this.indexName = ApiTypeHelper.requireNonNull(builder.indexName, this, "indexName"); + this.firstOccurrenceTimestamp = ApiTypeHelper.requireNonNull(builder.firstOccurrenceTimestamp, this, + "firstOccurrenceTimestamp"); + this.retryCount = ApiTypeHelper.requireNonNull(builder.retryCount, this, "retryCount"); + + } + + public static StagnatingBackingIndices of(Function> fn) { + return fn.apply(new Builder()).build(); + } + + /** + * Required - API name: {@code index_name} + */ + public final String indexName() { + return this.indexName; + } + + /** + * Required - API name: {@code first_occurrence_timestamp} + */ + public final long firstOccurrenceTimestamp() { + return this.firstOccurrenceTimestamp; + } + + /** + * Required - API name: {@code retry_count} + */ + public final int retryCount() { + return this.retryCount; + } + + /** + * Serialize this object to JSON. + */ + public void serialize(JsonGenerator generator, JsonpMapper mapper) { + generator.writeStartObject(); + serializeInternal(generator, mapper); + generator.writeEnd(); + } + + protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { + + generator.writeKey("index_name"); + generator.write(this.indexName); + + generator.writeKey("first_occurrence_timestamp"); + generator.write(this.firstOccurrenceTimestamp); + + generator.writeKey("retry_count"); + generator.write(this.retryCount); + + } + + @Override + public String toString() { + return JsonpUtils.toString(this); + } + + // --------------------------------------------------------------------------------------------- + + /** + * Builder for {@link StagnatingBackingIndices}. + */ + + public static class Builder extends WithJsonObjectBuilderBase + implements + ObjectBuilder { + private String indexName; + + private Long firstOccurrenceTimestamp; + + private Integer retryCount; + + /** + * Required - API name: {@code index_name} + */ + public final Builder indexName(String value) { + this.indexName = value; + return this; + } + + /** + * Required - API name: {@code first_occurrence_timestamp} + */ + public final Builder firstOccurrenceTimestamp(long value) { + this.firstOccurrenceTimestamp = value; + return this; + } + + /** + * Required - API name: {@code retry_count} + */ + public final Builder retryCount(int value) { + this.retryCount = value; + return this; + } + + @Override + protected Builder self() { + return this; + } + + /** + * Builds a {@link StagnatingBackingIndices}. + * + * @throws NullPointerException + * if some of the required fields are null. + */ + public StagnatingBackingIndices build() { + _checkSingleUse(); + + return new StagnatingBackingIndices(this); + } + } + + // --------------------------------------------------------------------------------------------- + + /** + * Json deserializer for {@link StagnatingBackingIndices} + */ + public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer + .lazy(Builder::new, StagnatingBackingIndices::setupStagnatingBackingIndicesDeserializer); + + protected static void setupStagnatingBackingIndicesDeserializer( + ObjectDeserializer op) { + + op.add(Builder::indexName, JsonpDeserializer.stringDeserializer(), "index_name"); + op.add(Builder::firstOccurrenceTimestamp, JsonpDeserializer.longDeserializer(), "first_occurrence_timestamp"); + op.add(Builder::retryCount, JsonpDeserializer.integerDeserializer(), "retry_count"); + + } + +} diff --git a/java-client/src/main/java/co/elastic/clients/elasticsearch/doc-files/api-spec.html b/java-client/src/main/java/co/elastic/clients/elasticsearch/doc-files/api-spec.html index a6e2e1d33..723fa4341 100644 --- a/java-client/src/main/java/co/elastic/clients/elasticsearch/doc-files/api-spec.html +++ b/java-client/src/main/java/co/elastic/clients/elasticsearch/doc-files/api-spec.html @@ -41,7 +41,7 @@ '_global.field_caps.FieldCapability': '_global/field_caps/types.ts#L23-L81', '_global.field_caps.Request': '_global/field_caps/FieldCapabilitiesRequest.ts#L25-L106', '_global.field_caps.Response': '_global/field_caps/FieldCapabilitiesResponse.ts#L24-L35', -'_global.get.GetResult': '_global/get/types.ts#L25-L35', +'_global.get.GetResult': '_global/get/types.ts#L25-L36', '_global.get.Request': '_global/get/GetRequest.ts#L31-L100', '_global.get.Response': '_global/get/GetResponse.ts#L23-L34', '_global.get_script.Request': '_global/get_script/GetScriptRequest.ts#L24-L42', @@ -56,34 +56,37 @@ '_global.get_script_languages.Response': '_global/get_script_languages/GetScriptLanguagesResponse.ts#L22-L27', '_global.get_source.Request': '_global/get_source/SourceRequest.ts#L31-L88', '_global.get_source.Response': '_global/get_source/SourceResponse.ts#L20-L23', -'_global.health_report.BaseIndicator': '_global/health_report/types.ts#L42-L47', -'_global.health_report.Diagnosis': '_global/health_report/types.ts#L49-L55', -'_global.health_report.DiagnosisAffectedResources': '_global/health_report/types.ts#L57-L63', -'_global.health_report.DiskIndicator': '_global/health_report/types.ts#L122-L126', -'_global.health_report.DiskIndicatorDetails': '_global/health_report/types.ts#L127-L133', -'_global.health_report.IlmIndicator': '_global/health_report/types.ts#L146-L150', -'_global.health_report.IlmIndicatorDetails': '_global/health_report/types.ts#L151-L155', -'_global.health_report.Impact': '_global/health_report/types.ts#L65-L70', -'_global.health_report.ImpactArea': '_global/health_report/types.ts#L72-L77', +'_global.health_report.BaseIndicator': '_global/health_report/types.ts#L43-L48', +'_global.health_report.DataStreamLifecycleDetails': '_global/health_report/types.ts#L152-L156', +'_global.health_report.DataStreamLifecycleIndicator': '_global/health_report/types.ts#L147-L151', +'_global.health_report.Diagnosis': '_global/health_report/types.ts#L50-L56', +'_global.health_report.DiagnosisAffectedResources': '_global/health_report/types.ts#L58-L64', +'_global.health_report.DiskIndicator': '_global/health_report/types.ts#L123-L127', +'_global.health_report.DiskIndicatorDetails': '_global/health_report/types.ts#L128-L134', +'_global.health_report.IlmIndicator': '_global/health_report/types.ts#L163-L167', +'_global.health_report.IlmIndicatorDetails': '_global/health_report/types.ts#L168-L172', +'_global.health_report.Impact': '_global/health_report/types.ts#L66-L71', +'_global.health_report.ImpactArea': '_global/health_report/types.ts#L73-L78', '_global.health_report.IndicatorHealthStatus': '_global/health_report/types.ts#L25-L30', -'_global.health_report.IndicatorNode': '_global/health_report/types.ts#L90-L93', -'_global.health_report.Indicators': '_global/health_report/types.ts#L32-L40', -'_global.health_report.MasterIsStableIndicator': '_global/health_report/types.ts#L79-L83', -'_global.health_report.MasterIsStableIndicatorClusterFormationNode': '_global/health_report/types.ts#L98-L102', -'_global.health_report.MasterIsStableIndicatorDetails': '_global/health_report/types.ts#L84-L89', -'_global.health_report.MasterIsStableIndicatorExceptionFetchingHistory': '_global/health_report/types.ts#L94-L97', -'_global.health_report.RepositoryIntegrityIndicator': '_global/health_report/types.ts#L135-L139', -'_global.health_report.RepositoryIntegrityIndicatorDetails': '_global/health_report/types.ts#L140-L144', +'_global.health_report.IndicatorNode': '_global/health_report/types.ts#L91-L94', +'_global.health_report.Indicators': '_global/health_report/types.ts#L32-L41', +'_global.health_report.MasterIsStableIndicator': '_global/health_report/types.ts#L80-L84', +'_global.health_report.MasterIsStableIndicatorClusterFormationNode': '_global/health_report/types.ts#L99-L103', +'_global.health_report.MasterIsStableIndicatorDetails': '_global/health_report/types.ts#L85-L90', +'_global.health_report.MasterIsStableIndicatorExceptionFetchingHistory': '_global/health_report/types.ts#L95-L98', +'_global.health_report.RepositoryIntegrityIndicator': '_global/health_report/types.ts#L136-L140', +'_global.health_report.RepositoryIntegrityIndicatorDetails': '_global/health_report/types.ts#L141-L145', '_global.health_report.Request': '_global/health_report/Request.ts#L24-L52', '_global.health_report.Response': '_global/health_report/Response.ts#L22-L28', -'_global.health_report.ShardsAvailabilityIndicator': '_global/health_report/types.ts#L104-L108', -'_global.health_report.ShardsAvailabilityIndicatorDetails': '_global/health_report/types.ts#L109-L120', -'_global.health_report.ShardsCapacityIndicator': '_global/health_report/types.ts#L173-L177', -'_global.health_report.ShardsCapacityIndicatorDetails': '_global/health_report/types.ts#L179-L182', -'_global.health_report.ShardsCapacityIndicatorTierDetail': '_global/health_report/types.ts#L184-L187', -'_global.health_report.SlmIndicator': '_global/health_report/types.ts#L157-L161', -'_global.health_report.SlmIndicatorDetails': '_global/health_report/types.ts#L162-L166', -'_global.health_report.SlmIndicatorUnhealthyPolicies': '_global/health_report/types.ts#L168-L171', +'_global.health_report.ShardsAvailabilityIndicator': '_global/health_report/types.ts#L105-L109', +'_global.health_report.ShardsAvailabilityIndicatorDetails': '_global/health_report/types.ts#L110-L121', +'_global.health_report.ShardsCapacityIndicator': '_global/health_report/types.ts#L190-L194', +'_global.health_report.ShardsCapacityIndicatorDetails': '_global/health_report/types.ts#L196-L199', +'_global.health_report.ShardsCapacityIndicatorTierDetail': '_global/health_report/types.ts#L201-L204', +'_global.health_report.SlmIndicator': '_global/health_report/types.ts#L174-L178', +'_global.health_report.SlmIndicatorDetails': '_global/health_report/types.ts#L179-L183', +'_global.health_report.SlmIndicatorUnhealthyPolicies': '_global/health_report/types.ts#L185-L188', +'_global.health_report.StagnatingBackingIndices': '_global/health_report/types.ts#L157-L161', '_global.index.Request': '_global/index/IndexRequest.ts#L35-L118', '_global.index.Response': '_global/index/IndexResponse.ts#L22-L24', '_global.info.Request': '_global/info/RootNodeInfoRequest.ts#L22-L29', @@ -240,7 +243,7 @@ '_global.update.Request': '_global/update/UpdateRequest.ts#L38-L153', '_global.update.Response': '_global/update/UpdateResponse.ts#L27-L29', '_global.update.UpdateWriteResponseBase': '_global/update/UpdateResponse.ts#L23-L25', -'_global.update_by_query.Request': '_global/update_by_query/UpdateByQueryRequest.ts#L37-L222', +'_global.update_by_query.Request': '_global/update_by_query/UpdateByQueryRequest.ts#L37-L226', '_global.update_by_query.Response': '_global/update_by_query/UpdateByQueryResponse.ts#L26-L45', '_global.update_by_query_rethrottle.Request': '_global/update_by_query_rethrottle/UpdateByQueryRethrottleRequest.ts#L24-L43', '_global.update_by_query_rethrottle.Response': '_global/update_by_query_rethrottle/UpdateByQueryRethrottleResponse.ts#L23-L25', @@ -290,7 +293,7 @@ '_types.IndicesOptions': '_types/common.ts#L335-L362', '_types.IndicesResponseBase': '_types/Base.ts#L87-L89', '_types.InlineGet': '_types/common.ts#L320-L333', -'_types.KnnQuery': '_types/Knn.ts#L54-L67', +'_types.KnnQuery': '_types/Knn.ts#L54-L69', '_types.KnnRetriever': '_types/Retriever.ts#L58-L71', '_types.KnnSearch': '_types/Knn.ts#L30-L52', '_types.LatLonGeoLocation': '_types/Geo.ts#L120-L129', @@ -306,7 +309,7 @@ '_types.OpType': '_types/common.ts#L255-L264', '_types.PluginStats': '_types/Stats.ts#L180-L190', '_types.QueryCacheStats': '_types/Stats.ts#L192-L226', -'_types.QueryVectorBuilder': '_types/Knn.ts#L69-L72', +'_types.QueryVectorBuilder': '_types/Knn.ts#L71-L74', '_types.RRFRetriever': '_types/Retriever.ts#L73-L80', '_types.RankBase': '_types/Rank.ts#L30-L30', '_types.RankContainer': '_types/Rank.ts#L22-L28', @@ -346,7 +349,7 @@ '_types.StoredScript': '_types/Scripting.ts#L47-L57', '_types.SuggestMode': '_types/common.ts#L282-L295', '_types.TaskFailure': '_types/Errors.ts#L68-L73', -'_types.TextEmbedding': '_types/Knn.ts#L74-L77', +'_types.TextEmbedding': '_types/Knn.ts#L76-L79', '_types.ThreadType': '_types/common.ts#L297-L303', '_types.TimeUnit': '_types/Time.ts#L69-L77', '_types.TopLeftBottomRightGeoBounds': '_types/Geo.ts#L161-L164', @@ -1348,16 +1351,17 @@ 'indices._types.Alias': 'indices/_types/Alias.ts#L23-L53', 'indices._types.AliasDefinition': 'indices/_types/AliasDefinition.ts#L22-L54', 'indices._types.CacheQueries': 'indices/_types/IndexSettings.ts#L407-L409', -'indices._types.DataStream': 'indices/_types/DataStream.ts#L39-L112', -'indices._types.DataStreamIndex': 'indices/_types/DataStream.ts#L121-L142', +'indices._types.DataStream': 'indices/_types/DataStream.ts#L45-L127', +'indices._types.DataStreamIndex': 'indices/_types/DataStream.ts#L136-L157', 'indices._types.DataStreamLifecycle': 'indices/_types/DataStreamLifecycle.ts#L25-L31', 'indices._types.DataStreamLifecycleDownsampling': 'indices/_types/DataStreamLifecycleDownsampling.ts#L22-L27', 'indices._types.DataStreamLifecycleRolloverConditions': 'indices/_types/DataStreamLifecycle.ts#L57-L69', 'indices._types.DataStreamLifecycleWithRollover': 'indices/_types/DataStreamLifecycle.ts#L33-L55', -'indices._types.DataStreamTimestampField': 'indices/_types/DataStream.ts#L114-L119', -'indices._types.DataStreamVisibility': 'indices/_types/DataStream.ts#L144-L146', +'indices._types.DataStreamTimestampField': 'indices/_types/DataStream.ts#L129-L134', +'indices._types.DataStreamVisibility': 'indices/_types/DataStream.ts#L159-L161', 'indices._types.DownsampleConfig': 'indices/_types/Downsample.ts#L22-L27', 'indices._types.DownsamplingRound': 'indices/_types/DownsamplingRound.ts#L23-L32', +'indices._types.FailureStore': 'indices/_types/DataStream.ts#L39-L43', 'indices._types.FielddataFrequencyFilter': 'indices/_types/FielddataFrequencyFilter.ts#L22-L26', 'indices._types.IndexCheckOnStartup': 'indices/_types/IndexSettings.ts#L262-L269', 'indices._types.IndexRouting': 'indices/_types/IndexRouting.ts#L22-L25', @@ -1823,7 +1827,7 @@ 'ml._types.Include': 'ml/_types/Include.ts#L20-L47', 'ml._types.InferenceConfigCreateContainer': 'ml/_types/inference.ts#L23-L80', 'ml._types.InferenceConfigUpdateContainer': 'ml/_types/inference.ts#L296-L318', -'ml._types.InferenceResponseResult': 'ml/_types/inference.ts#L459-L506', +'ml._types.InferenceResponseResult': 'ml/_types/inference.ts#L465-L512', 'ml._types.Influence': 'ml/_types/Anomaly.ts#L140-L143', 'ml._types.Influencer': 'ml/_types/Influencer.ts#L31-L83', 'ml._types.Job': 'ml/_types/Job.ts#L61-L180', @@ -2144,9 +2148,8 @@ 'nodes.get_repositories_metering_info.Request': 'nodes/get_repositories_metering_info/GetRepositoriesMeteringInfoRequest.ts#L23-L41', 'nodes.get_repositories_metering_info.Response': 'nodes/get_repositories_metering_info/GetRepositoriesMeteringInfoResponse.ts#L36-L38', 'nodes.get_repositories_metering_info.ResponseBase': 'nodes/get_repositories_metering_info/GetRepositoriesMeteringInfoResponse.ts#L25-L34', -'nodes.hot_threads.HotThread': 'nodes/hot_threads/types.ts#L23-L28', 'nodes.hot_threads.Request': 'nodes/hot_threads/NodesHotThreadsRequest.ts#L25-L83', -'nodes.hot_threads.Response': 'nodes/hot_threads/NodesHotThreadsResponse.ts#L22-L24', +'nodes.hot_threads.Response': 'nodes/hot_threads/NodesHotThreadsResponse.ts#L20-L22', 'nodes.info.DeprecationIndexing': 'nodes/info/types.ts#L144-L146', 'nodes.info.NodeInfo': 'nodes/info/types.ts#L31-L67', 'nodes.info.NodeInfoAction': 'nodes/info/types.ts#L184-L186', @@ -2844,10 +2847,10 @@ if (hash.length > 1) { hash = hash.substring(1); } - window.location = "https://github.com/elastic/elasticsearch-specification/tree/cdaa74447c90015bbce6ba7d072a94ddc0ea6a70/specification/" + (paths[hash] || ""); + window.location = "https://github.com/elastic/elasticsearch-specification/tree/d7c8eb52cfc6467517ab13eaf245d04c5a032019/specification/" + (paths[hash] || ""); - Please see the Elasticsearch API specification. + Please see the Elasticsearch API specification. diff --git a/java-client/src/main/java/co/elastic/clients/elasticsearch/indices/DataStream.java b/java-client/src/main/java/co/elastic/clients/elasticsearch/indices/DataStream.java index 785594465..caedfe618 100644 --- a/java-client/src/main/java/co/elastic/clients/elasticsearch/indices/DataStream.java +++ b/java-client/src/main/java/co/elastic/clients/elasticsearch/indices/DataStream.java @@ -70,6 +70,9 @@ public class DataStream implements JsonpSerializable { @Nullable private final Boolean allowCustomRouting; + @Nullable + private final FailureStore failureStore; + private final int generation; private final boolean hidden; @@ -91,6 +94,8 @@ public class DataStream implements JsonpSerializable { @Nullable private final Boolean replicated; + private final boolean rolloverOnWrite; + private final HealthStatus status; @Nullable @@ -106,6 +111,7 @@ private DataStream(Builder builder) { this.meta = ApiTypeHelper.unmodifiable(builder.meta); this.allowCustomRouting = builder.allowCustomRouting; + this.failureStore = builder.failureStore; this.generation = ApiTypeHelper.requireNonNull(builder.generation, this, "generation"); this.hidden = ApiTypeHelper.requireNonNull(builder.hidden, this, "hidden"); this.ilmPolicy = builder.ilmPolicy; @@ -116,6 +122,7 @@ private DataStream(Builder builder) { this.lifecycle = builder.lifecycle; this.name = ApiTypeHelper.requireNonNull(builder.name, this, "name"); this.replicated = builder.replicated; + this.rolloverOnWrite = ApiTypeHelper.requireNonNull(builder.rolloverOnWrite, this, "rolloverOnWrite"); this.status = ApiTypeHelper.requireNonNull(builder.status, this, "status"); this.system = builder.system; this.template = ApiTypeHelper.requireNonNull(builder.template, this, "template"); @@ -148,6 +155,16 @@ public final Boolean allowCustomRouting() { return this.allowCustomRouting; } + /** + * Information about failure store backing indices + *

+ * API name: {@code failure_store} + */ + @Nullable + public final FailureStore failureStore() { + return this.failureStore; + } + /** * Required - Current generation for the data stream. This number acts as a * cumulative count of the stream’s rollovers, starting at 1. @@ -245,6 +262,17 @@ public final Boolean replicated() { return this.replicated; } + /** + * Required - If true, the next write to this data stream will + * trigger a rollover first and the document will be indexed in the new backing + * index. If the rollover fails the indexing request will fail too. + *

+ * API name: {@code rollover_on_write} + */ + public final boolean rolloverOnWrite() { + return this.rolloverOnWrite; + } + /** * Required - Health status of the data stream. This health status is based on * the state of the primary and replica shards of the stream’s backing indices. @@ -313,6 +341,11 @@ protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { generator.writeKey("allow_custom_routing"); generator.write(this.allowCustomRouting); + } + if (this.failureStore != null) { + generator.writeKey("failure_store"); + this.failureStore.serialize(generator, mapper); + } generator.writeKey("generation"); generator.write(this.generation); @@ -353,6 +386,9 @@ protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { generator.write(this.replicated); } + generator.writeKey("rollover_on_write"); + generator.write(this.rolloverOnWrite); + generator.writeKey("status"); this.status.serialize(generator, mapper); if (this.system != null) { @@ -386,6 +422,9 @@ public static class Builder extends WithJsonObjectBuilderBase implement @Nullable private Boolean allowCustomRouting; + @Nullable + private FailureStore failureStore; + private Integer generation; private Boolean hidden; @@ -407,6 +446,8 @@ public static class Builder extends WithJsonObjectBuilderBase implement @Nullable private Boolean replicated; + private Boolean rolloverOnWrite; + private HealthStatus status; @Nullable @@ -454,6 +495,25 @@ public final Builder allowCustomRouting(@Nullable Boolean value) { return this; } + /** + * Information about failure store backing indices + *

+ * API name: {@code failure_store} + */ + public final Builder failureStore(@Nullable FailureStore value) { + this.failureStore = value; + return this; + } + + /** + * Information about failure store backing indices + *

+ * API name: {@code failure_store} + */ + public final Builder failureStore(Function> fn) { + return this.failureStore(fn.apply(new FailureStore.Builder()).build()); + } + /** * Required - Current generation for the data stream. This number acts as a * cumulative count of the stream’s rollovers, starting at 1. @@ -596,6 +656,18 @@ public final Builder replicated(@Nullable Boolean value) { return this; } + /** + * Required - If true, the next write to this data stream will + * trigger a rollover first and the document will be indexed in the new backing + * index. If the rollover fails the indexing request will fail too. + *

+ * API name: {@code rollover_on_write} + */ + public final Builder rolloverOnWrite(boolean value) { + this.rolloverOnWrite = value; + return this; + } + /** * Required - Health status of the data stream. This health status is based on * the state of the primary and replica shards of the stream’s backing indices. @@ -682,6 +754,7 @@ protected static void setupDataStreamDeserializer(ObjectDeserializer * API name: {@code managed_by} */ + @Nullable public final ManagedBy managedBy() { return this.managedBy; } /** - * Required - Indicates if ILM should take precedence over DSL in case both are - * configured to manage this index. + * Indicates if ILM should take precedence over DSL in case both are configured + * to manage this index. *

* API name: {@code prefer_ilm} */ - public final boolean preferIlm() { + @Nullable + public final Boolean preferIlm() { return this.preferIlm; } @@ -157,10 +160,15 @@ protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { generator.write(this.ilmPolicy); } - generator.writeKey("managed_by"); - this.managedBy.serialize(generator, mapper); - generator.writeKey("prefer_ilm"); - generator.write(this.preferIlm); + if (this.managedBy != null) { + generator.writeKey("managed_by"); + this.managedBy.serialize(generator, mapper); + } + if (this.preferIlm != null) { + generator.writeKey("prefer_ilm"); + generator.write(this.preferIlm); + + } } @@ -183,8 +191,10 @@ public static class Builder extends WithJsonObjectBuilderBase implement @Nullable private String ilmPolicy; + @Nullable private ManagedBy managedBy; + @Nullable private Boolean preferIlm; /** @@ -218,23 +228,22 @@ public final Builder ilmPolicy(@Nullable String value) { } /** - * Required - Name of the lifecycle system that's currently managing this - * backing index. + * Name of the lifecycle system that's currently managing this backing index. *

* API name: {@code managed_by} */ - public final Builder managedBy(ManagedBy value) { + public final Builder managedBy(@Nullable ManagedBy value) { this.managedBy = value; return this; } /** - * Required - Indicates if ILM should take precedence over DSL in case both are - * configured to manage this index. + * Indicates if ILM should take precedence over DSL in case both are configured + * to manage this index. *

* API name: {@code prefer_ilm} */ - public final Builder preferIlm(boolean value) { + public final Builder preferIlm(@Nullable Boolean value) { this.preferIlm = value; return this; } diff --git a/java-client/src/main/java/co/elastic/clients/elasticsearch/indices/FailureStore.java b/java-client/src/main/java/co/elastic/clients/elasticsearch/indices/FailureStore.java new file mode 100644 index 000000000..c43ae6b1c --- /dev/null +++ b/java-client/src/main/java/co/elastic/clients/elasticsearch/indices/FailureStore.java @@ -0,0 +1,230 @@ +/* + * Licensed to Elasticsearch B.V. under one or more contributor + * license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright + * ownership. Elasticsearch B.V. licenses this file to you under + * the Apache License, Version 2.0 (the "License"); you may + * not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +package co.elastic.clients.elasticsearch.indices; + +import co.elastic.clients.json.JsonpDeserializable; +import co.elastic.clients.json.JsonpDeserializer; +import co.elastic.clients.json.JsonpMapper; +import co.elastic.clients.json.JsonpSerializable; +import co.elastic.clients.json.JsonpUtils; +import co.elastic.clients.json.ObjectBuilderDeserializer; +import co.elastic.clients.json.ObjectDeserializer; +import co.elastic.clients.util.ApiTypeHelper; +import co.elastic.clients.util.ObjectBuilder; +import co.elastic.clients.util.WithJsonObjectBuilderBase; +import jakarta.json.stream.JsonGenerator; +import java.lang.Boolean; +import java.util.List; +import java.util.Objects; +import java.util.function.Function; +import javax.annotation.Nullable; + +//---------------------------------------------------------------- +// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. +//---------------------------------------------------------------- +// +// This code is generated from the Elasticsearch API specification +// at https://github.com/elastic/elasticsearch-specification +// +// Manual updates to this file will be lost when the code is +// re-generated. +// +// If you find a property that is missing or wrongly typed, please +// open an issue or a PR on the API specification repository. +// +//---------------------------------------------------------------- + +// typedef: indices._types.FailureStore + +/** + * + * @see API + * specification + */ +@JsonpDeserializable +public class FailureStore implements JsonpSerializable { + private final boolean enabled; + + private final List indices; + + private final boolean rolloverOnWrite; + + // --------------------------------------------------------------------------------------------- + + private FailureStore(Builder builder) { + + this.enabled = ApiTypeHelper.requireNonNull(builder.enabled, this, "enabled"); + this.indices = ApiTypeHelper.unmodifiableRequired(builder.indices, this, "indices"); + this.rolloverOnWrite = ApiTypeHelper.requireNonNull(builder.rolloverOnWrite, this, "rolloverOnWrite"); + + } + + public static FailureStore of(Function> fn) { + return fn.apply(new Builder()).build(); + } + + /** + * Required - API name: {@code enabled} + */ + public final boolean enabled() { + return this.enabled; + } + + /** + * Required - API name: {@code indices} + */ + public final List indices() { + return this.indices; + } + + /** + * Required - API name: {@code rollover_on_write} + */ + public final boolean rolloverOnWrite() { + return this.rolloverOnWrite; + } + + /** + * Serialize this object to JSON. + */ + public void serialize(JsonGenerator generator, JsonpMapper mapper) { + generator.writeStartObject(); + serializeInternal(generator, mapper); + generator.writeEnd(); + } + + protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { + + generator.writeKey("enabled"); + generator.write(this.enabled); + + if (ApiTypeHelper.isDefined(this.indices)) { + generator.writeKey("indices"); + generator.writeStartArray(); + for (DataStreamIndex item0 : this.indices) { + item0.serialize(generator, mapper); + + } + generator.writeEnd(); + + } + generator.writeKey("rollover_on_write"); + generator.write(this.rolloverOnWrite); + + } + + @Override + public String toString() { + return JsonpUtils.toString(this); + } + + // --------------------------------------------------------------------------------------------- + + /** + * Builder for {@link FailureStore}. + */ + + public static class Builder extends WithJsonObjectBuilderBase implements ObjectBuilder { + private Boolean enabled; + + private List indices; + + private Boolean rolloverOnWrite; + + /** + * Required - API name: {@code enabled} + */ + public final Builder enabled(boolean value) { + this.enabled = value; + return this; + } + + /** + * Required - API name: {@code indices} + *

+ * Adds all elements of list to indices. + */ + public final Builder indices(List list) { + this.indices = _listAddAll(this.indices, list); + return this; + } + + /** + * Required - API name: {@code indices} + *

+ * Adds one or more values to indices. + */ + public final Builder indices(DataStreamIndex value, DataStreamIndex... values) { + this.indices = _listAdd(this.indices, value, values); + return this; + } + + /** + * Required - API name: {@code indices} + *

+ * Adds a value to indices using a builder lambda. + */ + public final Builder indices(Function> fn) { + return indices(fn.apply(new DataStreamIndex.Builder()).build()); + } + + /** + * Required - API name: {@code rollover_on_write} + */ + public final Builder rolloverOnWrite(boolean value) { + this.rolloverOnWrite = value; + return this; + } + + @Override + protected Builder self() { + return this; + } + + /** + * Builds a {@link FailureStore}. + * + * @throws NullPointerException + * if some of the required fields are null. + */ + public FailureStore build() { + _checkSingleUse(); + + return new FailureStore(this); + } + } + + // --------------------------------------------------------------------------------------------- + + /** + * Json deserializer for {@link FailureStore} + */ + public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer.lazy(Builder::new, + FailureStore::setupFailureStoreDeserializer); + + protected static void setupFailureStoreDeserializer(ObjectDeserializer op) { + + op.add(Builder::enabled, JsonpDeserializer.booleanDeserializer(), "enabled"); + op.add(Builder::indices, JsonpDeserializer.arrayDeserializer(DataStreamIndex._DESERIALIZER), "indices"); + op.add(Builder::rolloverOnWrite, JsonpDeserializer.booleanDeserializer(), "rollover_on_write"); + + } + +} diff --git a/java-client/src/main/java/co/elastic/clients/elasticsearch/ml/InferenceResponseResult.java b/java-client/src/main/java/co/elastic/clients/elasticsearch/ml/InferenceResponseResult.java index 63b857ce1..42e6eebe7 100644 --- a/java-client/src/main/java/co/elastic/clients/elasticsearch/ml/InferenceResponseResult.java +++ b/java-client/src/main/java/co/elastic/clients/elasticsearch/ml/InferenceResponseResult.java @@ -19,7 +19,7 @@ package co.elastic.clients.elasticsearch.ml; -import co.elastic.clients.elasticsearch._types.FieldValue; +import co.elastic.clients.json.JsonData; import co.elastic.clients.json.JsonpDeserializable; import co.elastic.clients.json.JsonpDeserializer; import co.elastic.clients.json.JsonpMapper; @@ -69,7 +69,7 @@ public class InferenceResponseResult implements JsonpSerializable { @Nullable private final Boolean isTruncated; - private final List predictedValue; + private final List predictedValue; @Nullable private final String predictedValueSequence; @@ -139,7 +139,7 @@ public final Boolean isTruncated() { *

* API name: {@code predicted_value} */ - public final List predictedValue() { + public final List predictedValue() { return this.predictedValue; } @@ -233,7 +233,7 @@ protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { if (ApiTypeHelper.isDefined(this.predictedValue)) { generator.writeKey("predicted_value"); generator.writeStartArray(); - for (FieldValue item0 : this.predictedValue) { + for (JsonData item0 : this.predictedValue) { item0.serialize(generator, mapper); } @@ -304,7 +304,7 @@ public static class Builder extends WithJsonObjectBuilderBase private Boolean isTruncated; @Nullable - private List predictedValue; + private List predictedValue; @Nullable private String predictedValueSequence; @@ -386,7 +386,7 @@ public final Builder isTruncated(@Nullable Boolean value) { *

* Adds all elements of list to predictedValue. */ - public final Builder predictedValue(List list) { + public final Builder predictedValue(List list) { this.predictedValue = _listAddAll(this.predictedValue, list); return this; } @@ -404,28 +404,11 @@ public final Builder predictedValue(List list) { *

* Adds one or more values to predictedValue. */ - public final Builder predictedValue(FieldValue value, FieldValue... values) { + public final Builder predictedValue(JsonData value, JsonData... values) { this.predictedValue = _listAdd(this.predictedValue, value, values); return this; } - /** - * If the model is trained for a text classification or zero shot classification - * task, the response is the predicted class. For named entity recognition (NER) - * tasks, it contains the annotated text output. For fill mask tasks, it - * contains the top prediction for replacing the mask token. For text embedding - * tasks, it contains the raw numerical text embedding values. For regression - * models, its a numerical value For classification models, it may be an - * integer, double, boolean or string depending on prediction type - *

- * API name: {@code predicted_value} - *

- * Adds a value to predictedValue using a builder lambda. - */ - public final Builder predictedValue(Function> fn) { - return predictedValue(fn.apply(new FieldValue.Builder()).build()); - } - /** * For fill mask tasks, the response contains the input text sequence with the * mask token replaced by the predicted value. Additionally @@ -576,8 +559,7 @@ protected static void setupInferenceResponseResultDeserializer( op.add(Builder::entities, JsonpDeserializer.arrayDeserializer(TrainedModelEntities._DESERIALIZER), "entities"); op.add(Builder::isTruncated, JsonpDeserializer.booleanDeserializer(), "is_truncated"); - op.add(Builder::predictedValue, JsonpDeserializer.arrayDeserializer(FieldValue._DESERIALIZER), - "predicted_value"); + op.add(Builder::predictedValue, JsonpDeserializer.arrayDeserializer(JsonData._DESERIALIZER), "predicted_value"); op.add(Builder::predictedValueSequence, JsonpDeserializer.stringDeserializer(), "predicted_value_sequence"); op.add(Builder::predictionProbability, JsonpDeserializer.doubleDeserializer(), "prediction_probability"); op.add(Builder::predictionScore, JsonpDeserializer.doubleDeserializer(), "prediction_score"); diff --git a/java-client/src/main/java/co/elastic/clients/elasticsearch/nodes/HotThreadsResponse.java b/java-client/src/main/java/co/elastic/clients/elasticsearch/nodes/HotThreadsResponse.java index 3285685c5..1443e9651 100644 --- a/java-client/src/main/java/co/elastic/clients/elasticsearch/nodes/HotThreadsResponse.java +++ b/java-client/src/main/java/co/elastic/clients/elasticsearch/nodes/HotThreadsResponse.java @@ -19,22 +19,13 @@ package co.elastic.clients.elasticsearch.nodes; -import co.elastic.clients.elasticsearch.nodes.hot_threads.HotThread; import co.elastic.clients.json.JsonpDeserializable; import co.elastic.clients.json.JsonpDeserializer; -import co.elastic.clients.json.JsonpMapper; -import co.elastic.clients.json.JsonpSerializable; -import co.elastic.clients.json.JsonpUtils; import co.elastic.clients.json.ObjectBuilderDeserializer; import co.elastic.clients.json.ObjectDeserializer; -import co.elastic.clients.util.ApiTypeHelper; import co.elastic.clients.util.ObjectBuilder; -import co.elastic.clients.util.WithJsonObjectBuilderBase; import jakarta.json.stream.JsonGenerator; -import java.util.List; import java.util.Objects; -import java.util.function.Function; -import javax.annotation.Nullable; //---------------------------------------------------------------- // THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. @@ -58,128 +49,17 @@ * @see API * specification */ -@JsonpDeserializable -public class HotThreadsResponse implements JsonpSerializable { - private final List hotThreads; - // --------------------------------------------------------------------------------------------- - - private HotThreadsResponse(Builder builder) { - - this.hotThreads = ApiTypeHelper.unmodifiableRequired(builder.hotThreads, this, "hotThreads"); - - } - - public static HotThreadsResponse of(Function> fn) { - return fn.apply(new Builder()).build(); +public class HotThreadsResponse { + public HotThreadsResponse() { } /** - * Required - API name: {@code hot_threads} + * Singleton instance for {@link HotThreadsResponse}. */ - public final List hotThreads() { - return this.hotThreads; - } - - /** - * Serialize this object to JSON. - */ - public void serialize(JsonGenerator generator, JsonpMapper mapper) { - generator.writeStartObject(); - serializeInternal(generator, mapper); - generator.writeEnd(); - } - - protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { - - if (ApiTypeHelper.isDefined(this.hotThreads)) { - generator.writeKey("hot_threads"); - generator.writeStartArray(); - for (HotThread item0 : this.hotThreads) { - item0.serialize(generator, mapper); - - } - generator.writeEnd(); - - } - - } - - @Override - public String toString() { - return JsonpUtils.toString(this); - } - - // --------------------------------------------------------------------------------------------- + public static final HotThreadsResponse _INSTANCE = new HotThreadsResponse(); - /** - * Builder for {@link HotThreadsResponse}. - */ - - public static class Builder extends WithJsonObjectBuilderBase - implements - ObjectBuilder { - private List hotThreads; - - /** - * Required - API name: {@code hot_threads} - *

- * Adds all elements of list to hotThreads. - */ - public final Builder hotThreads(List list) { - this.hotThreads = _listAddAll(this.hotThreads, list); - return this; - } - - /** - * Required - API name: {@code hot_threads} - *

- * Adds one or more values to hotThreads. - */ - public final Builder hotThreads(HotThread value, HotThread... values) { - this.hotThreads = _listAdd(this.hotThreads, value, values); - return this; - } - - /** - * Required - API name: {@code hot_threads} - *

- * Adds a value to hotThreads using a builder lambda. - */ - public final Builder hotThreads(Function> fn) { - return hotThreads(fn.apply(new HotThread.Builder()).build()); - } - - @Override - protected Builder self() { - return this; - } - - /** - * Builds a {@link HotThreadsResponse}. - * - * @throws NullPointerException - * if some of the required fields are null. - */ - public HotThreadsResponse build() { - _checkSingleUse(); - - return new HotThreadsResponse(this); - } - } - - // --------------------------------------------------------------------------------------------- - - /** - * Json deserializer for {@link HotThreadsResponse} - */ - public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer - .lazy(Builder::new, HotThreadsResponse::setupHotThreadsResponseDeserializer); - - protected static void setupHotThreadsResponseDeserializer(ObjectDeserializer op) { - - op.add(Builder::hotThreads, JsonpDeserializer.arrayDeserializer(HotThread._DESERIALIZER), "hot_threads"); - - } + public static final JsonpDeserializer _DESERIALIZER = JsonpDeserializer + .emptyObject(HotThreadsResponse._INSTANCE); } diff --git a/java-client/src/main/java/co/elastic/clients/elasticsearch/nodes/hot_threads/HotThread.java b/java-client/src/main/java/co/elastic/clients/elasticsearch/nodes/hot_threads/HotThread.java deleted file mode 100644 index 72d45d424..000000000 --- a/java-client/src/main/java/co/elastic/clients/elasticsearch/nodes/hot_threads/HotThread.java +++ /dev/null @@ -1,266 +0,0 @@ -/* - * Licensed to Elasticsearch B.V. under one or more contributor - * license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright - * ownership. Elasticsearch B.V. licenses this file to you under - * the Apache License, Version 2.0 (the "License"); you may - * not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package co.elastic.clients.elasticsearch.nodes.hot_threads; - -import co.elastic.clients.json.JsonpDeserializable; -import co.elastic.clients.json.JsonpDeserializer; -import co.elastic.clients.json.JsonpMapper; -import co.elastic.clients.json.JsonpSerializable; -import co.elastic.clients.json.JsonpUtils; -import co.elastic.clients.json.ObjectBuilderDeserializer; -import co.elastic.clients.json.ObjectDeserializer; -import co.elastic.clients.util.ApiTypeHelper; -import co.elastic.clients.util.ObjectBuilder; -import co.elastic.clients.util.WithJsonObjectBuilderBase; -import jakarta.json.stream.JsonGenerator; -import java.lang.String; -import java.util.List; -import java.util.Objects; -import java.util.function.Function; -import javax.annotation.Nullable; - -//---------------------------------------------------------------- -// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. -//---------------------------------------------------------------- -// -// This code is generated from the Elasticsearch API specification -// at https://github.com/elastic/elasticsearch-specification -// -// Manual updates to this file will be lost when the code is -// re-generated. -// -// If you find a property that is missing or wrongly typed, please -// open an issue or a PR on the API specification repository. -// -//---------------------------------------------------------------- - -// typedef: nodes.hot_threads.HotThread - -/** - * - * @see API - * specification - */ -@JsonpDeserializable -public class HotThread implements JsonpSerializable { - private final List hosts; - - private final String nodeId; - - private final String nodeName; - - private final List threads; - - // --------------------------------------------------------------------------------------------- - - private HotThread(Builder builder) { - - this.hosts = ApiTypeHelper.unmodifiableRequired(builder.hosts, this, "hosts"); - this.nodeId = ApiTypeHelper.requireNonNull(builder.nodeId, this, "nodeId"); - this.nodeName = ApiTypeHelper.requireNonNull(builder.nodeName, this, "nodeName"); - this.threads = ApiTypeHelper.unmodifiableRequired(builder.threads, this, "threads"); - - } - - public static HotThread of(Function> fn) { - return fn.apply(new Builder()).build(); - } - - /** - * Required - API name: {@code hosts} - */ - public final List hosts() { - return this.hosts; - } - - /** - * Required - API name: {@code node_id} - */ - public final String nodeId() { - return this.nodeId; - } - - /** - * Required - API name: {@code node_name} - */ - public final String nodeName() { - return this.nodeName; - } - - /** - * Required - API name: {@code threads} - */ - public final List threads() { - return this.threads; - } - - /** - * Serialize this object to JSON. - */ - public void serialize(JsonGenerator generator, JsonpMapper mapper) { - generator.writeStartObject(); - serializeInternal(generator, mapper); - generator.writeEnd(); - } - - protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { - - if (ApiTypeHelper.isDefined(this.hosts)) { - generator.writeKey("hosts"); - generator.writeStartArray(); - for (String item0 : this.hosts) { - generator.write(item0); - - } - generator.writeEnd(); - - } - generator.writeKey("node_id"); - generator.write(this.nodeId); - - generator.writeKey("node_name"); - generator.write(this.nodeName); - - if (ApiTypeHelper.isDefined(this.threads)) { - generator.writeKey("threads"); - generator.writeStartArray(); - for (String item0 : this.threads) { - generator.write(item0); - - } - generator.writeEnd(); - - } - - } - - @Override - public String toString() { - return JsonpUtils.toString(this); - } - - // --------------------------------------------------------------------------------------------- - - /** - * Builder for {@link HotThread}. - */ - - public static class Builder extends WithJsonObjectBuilderBase implements ObjectBuilder { - private List hosts; - - private String nodeId; - - private String nodeName; - - private List threads; - - /** - * Required - API name: {@code hosts} - *

- * Adds all elements of list to hosts. - */ - public final Builder hosts(List list) { - this.hosts = _listAddAll(this.hosts, list); - return this; - } - - /** - * Required - API name: {@code hosts} - *

- * Adds one or more values to hosts. - */ - public final Builder hosts(String value, String... values) { - this.hosts = _listAdd(this.hosts, value, values); - return this; - } - - /** - * Required - API name: {@code node_id} - */ - public final Builder nodeId(String value) { - this.nodeId = value; - return this; - } - - /** - * Required - API name: {@code node_name} - */ - public final Builder nodeName(String value) { - this.nodeName = value; - return this; - } - - /** - * Required - API name: {@code threads} - *

- * Adds all elements of list to threads. - */ - public final Builder threads(List list) { - this.threads = _listAddAll(this.threads, list); - return this; - } - - /** - * Required - API name: {@code threads} - *

- * Adds one or more values to threads. - */ - public final Builder threads(String value, String... values) { - this.threads = _listAdd(this.threads, value, values); - return this; - } - - @Override - protected Builder self() { - return this; - } - - /** - * Builds a {@link HotThread}. - * - * @throws NullPointerException - * if some of the required fields are null. - */ - public HotThread build() { - _checkSingleUse(); - - return new HotThread(this); - } - } - - // --------------------------------------------------------------------------------------------- - - /** - * Json deserializer for {@link HotThread} - */ - public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer.lazy(Builder::new, - HotThread::setupHotThreadDeserializer); - - protected static void setupHotThreadDeserializer(ObjectDeserializer op) { - - op.add(Builder::hosts, JsonpDeserializer.arrayDeserializer(JsonpDeserializer.stringDeserializer()), "hosts"); - op.add(Builder::nodeId, JsonpDeserializer.stringDeserializer(), "node_id"); - op.add(Builder::nodeName, JsonpDeserializer.stringDeserializer(), "node_name"); - op.add(Builder::threads, JsonpDeserializer.arrayDeserializer(JsonpDeserializer.stringDeserializer()), - "threads"); - - } - -} diff --git a/java-client/src/test/java/co/elastic/clients/elasticsearch/model/UnionTests.java b/java-client/src/test/java/co/elastic/clients/elasticsearch/model/UnionTests.java index 8ea89306f..386f9f9ee 100644 --- a/java-client/src/test/java/co/elastic/clients/elasticsearch/model/UnionTests.java +++ b/java-client/src/test/java/co/elastic/clients/elasticsearch/model/UnionTests.java @@ -161,7 +161,7 @@ public void testUntaggedUnion() { .relation(RangeRelation.Contains)))); String expectedDateRangeQuery = "{\"range\":{\"day\":{\"boost\":1.0,\"relation\":\"contains\"," + - "\"gte\":\"20-06-24\",\"lte\":\"20-07-24\"},\"format\":\"some-format\"}}"; + "\"gte\":\"20-06-24\",\"lte\":\"20-07-24\",\"format\":\"some-format\"}}}"; assertEquals(expectedDateRangeQuery, toJson(dateRangeQuery));