diff --git a/java-client/src/main/java/co/elastic/clients/elasticsearch/_types/ErrorCause.java b/java-client/src/main/java/co/elastic/clients/elasticsearch/_types/ErrorCause.java index 18f10b4c7..1dbe92c22 100644 --- a/java-client/src/main/java/co/elastic/clients/elasticsearch/_types/ErrorCause.java +++ b/java-client/src/main/java/co/elastic/clients/elasticsearch/_types/ErrorCause.java @@ -60,6 +60,7 @@ public class ErrorCause implements JsonpSerializable { @Nullable private final String type; + @Nullable private final String reason; @Nullable @@ -79,7 +80,7 @@ private ErrorCause(Builder builder) { this.metadata = ApiTypeHelper.unmodifiable(builder.metadata); this.type = builder.type; - this.reason = ApiTypeHelper.requireNonNull(builder.reason, this, "reason"); + this.reason = builder.reason; this.stackTrace = builder.stackTrace; this.causedBy = builder.causedBy; this.rootCause = ApiTypeHelper.unmodifiable(builder.rootCause); @@ -109,10 +110,11 @@ public final String type() { } /** - * Required - A human-readable explanation of the error, in english + * A human-readable explanation of the error, in english *

* API name: {@code reason} */ + @Nullable public final String reason() { return this.reason; } @@ -172,9 +174,11 @@ protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { generator.write(this.type); } - generator.writeKey("reason"); - generator.write(this.reason); + if (this.reason != null) { + generator.writeKey("reason"); + generator.write(this.reason); + } if (this.stackTrace != null) { generator.writeKey("stack_trace"); generator.write(this.stackTrace); @@ -246,6 +250,7 @@ public final Builder metadata(String key, JsonData value) { @Nullable private String type; + @Nullable private String reason; @Nullable @@ -271,11 +276,11 @@ public final Builder type(@Nullable String value) { } /** - * Required - A human-readable explanation of the error, in english + * A human-readable explanation of the error, in english *

* API name: {@code reason} */ - public final Builder reason(String value) { + public final Builder reason(@Nullable String value) { this.reason = value; return this; } diff --git a/java-client/src/main/java/co/elastic/clients/elasticsearch/_types/aggregations/GeoBoundsAggregate.java b/java-client/src/main/java/co/elastic/clients/elasticsearch/_types/aggregations/GeoBoundsAggregate.java index 13b853d76..b19f7c5bc 100644 --- a/java-client/src/main/java/co/elastic/clients/elasticsearch/_types/aggregations/GeoBoundsAggregate.java +++ b/java-client/src/main/java/co/elastic/clients/elasticsearch/_types/aggregations/GeoBoundsAggregate.java @@ -29,7 +29,6 @@ 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.util.Objects; @@ -46,6 +45,7 @@ */ @JsonpDeserializable public class GeoBoundsAggregate extends AggregateBase implements AggregateVariant { + @Nullable private final GeoBounds bounds; // --------------------------------------------------------------------------------------------- @@ -53,7 +53,7 @@ public class GeoBoundsAggregate extends AggregateBase implements AggregateVarian private GeoBoundsAggregate(Builder builder) { super(builder); - this.bounds = ApiTypeHelper.requireNonNull(builder.bounds, this, "bounds"); + this.bounds = builder.bounds; } @@ -70,8 +70,9 @@ public Aggregate.Kind _aggregateKind() { } /** - * Required - API name: {@code bounds} + * API name: {@code bounds} */ + @Nullable public final GeoBounds bounds() { return this.bounds; } @@ -79,8 +80,11 @@ public final GeoBounds bounds() { protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { super.serializeInternal(generator, mapper); - generator.writeKey("bounds"); - this.bounds.serialize(generator, mapper); + if (this.bounds != null) { + generator.writeKey("bounds"); + this.bounds.serialize(generator, mapper); + + } } @@ -93,18 +97,19 @@ protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { public static class Builder extends AggregateBase.AbstractBuilder implements ObjectBuilder { + @Nullable private GeoBounds bounds; /** - * Required - API name: {@code bounds} + * API name: {@code bounds} */ - public final Builder bounds(GeoBounds value) { + public final Builder bounds(@Nullable GeoBounds value) { this.bounds = value; return this; } /** - * Required - API name: {@code bounds} + * API name: {@code bounds} */ public final Builder bounds(Function> fn) { return this.bounds(fn.apply(new GeoBounds.Builder()).build()); diff --git a/java-client/src/main/java/co/elastic/clients/elasticsearch/_types/analysis/IcuCollationTokenFilter.java b/java-client/src/main/java/co/elastic/clients/elasticsearch/_types/analysis/IcuCollationTokenFilter.java index 187d5a54e..a11cf5f5a 100644 --- a/java-client/src/main/java/co/elastic/clients/elasticsearch/_types/analysis/IcuCollationTokenFilter.java +++ b/java-client/src/main/java/co/elastic/clients/elasticsearch/_types/analysis/IcuCollationTokenFilter.java @@ -28,7 +28,6 @@ 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.Boolean; @@ -47,27 +46,40 @@ */ @JsonpDeserializable public class IcuCollationTokenFilter extends TokenFilterBase implements TokenFilterDefinitionVariant { + @Nullable private final IcuCollationAlternate alternate; + @Nullable private final IcuCollationCaseFirst casefirst; - private final boolean caselevel; + @Nullable + private final Boolean caselevel; + @Nullable private final String country; + @Nullable private final IcuCollationDecomposition decomposition; - private final boolean hiraganaquaternarymode; + @Nullable + private final Boolean hiraganaquaternarymode; + @Nullable private final String language; - private final boolean numeric; + @Nullable + private final Boolean numeric; + @Nullable + private final String rules; + + @Nullable private final IcuCollationStrength strength; @Nullable private final String variabletop; + @Nullable private final String variant; // --------------------------------------------------------------------------------------------- @@ -75,18 +87,18 @@ public class IcuCollationTokenFilter extends TokenFilterBase implements TokenFil private IcuCollationTokenFilter(Builder builder) { super(builder); - this.alternate = ApiTypeHelper.requireNonNull(builder.alternate, this, "alternate"); - this.casefirst = ApiTypeHelper.requireNonNull(builder.casefirst, this, "casefirst"); - this.caselevel = ApiTypeHelper.requireNonNull(builder.caselevel, this, "caselevel"); - this.country = ApiTypeHelper.requireNonNull(builder.country, this, "country"); - this.decomposition = ApiTypeHelper.requireNonNull(builder.decomposition, this, "decomposition"); - this.hiraganaquaternarymode = ApiTypeHelper.requireNonNull(builder.hiraganaquaternarymode, this, - "hiraganaquaternarymode"); - this.language = ApiTypeHelper.requireNonNull(builder.language, this, "language"); - this.numeric = ApiTypeHelper.requireNonNull(builder.numeric, this, "numeric"); - this.strength = ApiTypeHelper.requireNonNull(builder.strength, this, "strength"); + this.alternate = builder.alternate; + this.casefirst = builder.casefirst; + this.caselevel = builder.caselevel; + this.country = builder.country; + this.decomposition = builder.decomposition; + this.hiraganaquaternarymode = builder.hiraganaquaternarymode; + this.language = builder.language; + this.numeric = builder.numeric; + this.rules = builder.rules; + this.strength = builder.strength; this.variabletop = builder.variabletop; - this.variant = ApiTypeHelper.requireNonNull(builder.variant, this, "variant"); + this.variant = builder.variant; } @@ -103,64 +115,81 @@ public TokenFilterDefinition.Kind _tokenFilterDefinitionKind() { } /** - * Required - API name: {@code alternate} + * API name: {@code alternate} */ + @Nullable public final IcuCollationAlternate alternate() { return this.alternate; } /** - * Required - API name: {@code caseFirst} + * API name: {@code caseFirst} */ + @Nullable public final IcuCollationCaseFirst casefirst() { return this.casefirst; } /** - * Required - API name: {@code caseLevel} + * API name: {@code caseLevel} */ - public final boolean caselevel() { + @Nullable + public final Boolean caselevel() { return this.caselevel; } /** - * Required - API name: {@code country} + * API name: {@code country} */ + @Nullable public final String country() { return this.country; } /** - * Required - API name: {@code decomposition} + * API name: {@code decomposition} */ + @Nullable public final IcuCollationDecomposition decomposition() { return this.decomposition; } /** - * Required - API name: {@code hiraganaQuaternaryMode} + * API name: {@code hiraganaQuaternaryMode} */ - public final boolean hiraganaquaternarymode() { + @Nullable + public final Boolean hiraganaquaternarymode() { return this.hiraganaquaternarymode; } /** - * Required - API name: {@code language} + * API name: {@code language} */ + @Nullable public final String language() { return this.language; } /** - * Required - API name: {@code numeric} + * API name: {@code numeric} */ - public final boolean numeric() { + @Nullable + public final Boolean numeric() { return this.numeric; } /** - * Required - API name: {@code strength} + * API name: {@code rules} + */ + @Nullable + public final String rules() { + return this.rules; + } + + /** + * API name: {@code strength} */ + @Nullable public final IcuCollationStrength strength() { return this.strength; } @@ -174,8 +203,9 @@ public final String variabletop() { } /** - * Required - API name: {@code variant} + * API name: {@code variant} */ + @Nullable public final String variant() { return this.variant; } @@ -184,36 +214,62 @@ protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { generator.write("type", "icu_collation"); super.serializeInternal(generator, mapper); - generator.writeKey("alternate"); - this.alternate.serialize(generator, mapper); - generator.writeKey("caseFirst"); - this.casefirst.serialize(generator, mapper); - generator.writeKey("caseLevel"); - generator.write(this.caselevel); + if (this.alternate != null) { + generator.writeKey("alternate"); + this.alternate.serialize(generator, mapper); + } + if (this.casefirst != null) { + generator.writeKey("caseFirst"); + this.casefirst.serialize(generator, mapper); + } + if (this.caselevel != null) { + generator.writeKey("caseLevel"); + generator.write(this.caselevel); - generator.writeKey("country"); - generator.write(this.country); + } + if (this.country != null) { + generator.writeKey("country"); + generator.write(this.country); - generator.writeKey("decomposition"); - this.decomposition.serialize(generator, mapper); - generator.writeKey("hiraganaQuaternaryMode"); - generator.write(this.hiraganaquaternarymode); + } + if (this.decomposition != null) { + generator.writeKey("decomposition"); + this.decomposition.serialize(generator, mapper); + } + if (this.hiraganaquaternarymode != null) { + generator.writeKey("hiraganaQuaternaryMode"); + generator.write(this.hiraganaquaternarymode); - generator.writeKey("language"); - generator.write(this.language); + } + if (this.language != null) { + generator.writeKey("language"); + generator.write(this.language); - generator.writeKey("numeric"); - generator.write(this.numeric); + } + if (this.numeric != null) { + generator.writeKey("numeric"); + generator.write(this.numeric); + + } + if (this.rules != null) { + generator.writeKey("rules"); + generator.write(this.rules); - generator.writeKey("strength"); - this.strength.serialize(generator, mapper); + } + if (this.strength != null) { + generator.writeKey("strength"); + this.strength.serialize(generator, mapper); + } if (this.variabletop != null) { generator.writeKey("variableTop"); generator.write(this.variabletop); } - generator.writeKey("variant"); - generator.write(this.variant); + if (this.variant != null) { + generator.writeKey("variant"); + generator.write(this.variant); + + } } @@ -226,97 +282,118 @@ protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { public static class Builder extends TokenFilterBase.AbstractBuilder implements ObjectBuilder { + @Nullable private IcuCollationAlternate alternate; + @Nullable private IcuCollationCaseFirst casefirst; + @Nullable private Boolean caselevel; + @Nullable private String country; + @Nullable private IcuCollationDecomposition decomposition; + @Nullable private Boolean hiraganaquaternarymode; + @Nullable private String language; + @Nullable private Boolean numeric; + @Nullable + private String rules; + + @Nullable private IcuCollationStrength strength; @Nullable private String variabletop; + @Nullable private String variant; /** - * Required - API name: {@code alternate} + * API name: {@code alternate} */ - public final Builder alternate(IcuCollationAlternate value) { + public final Builder alternate(@Nullable IcuCollationAlternate value) { this.alternate = value; return this; } /** - * Required - API name: {@code caseFirst} + * API name: {@code caseFirst} */ - public final Builder casefirst(IcuCollationCaseFirst value) { + public final Builder casefirst(@Nullable IcuCollationCaseFirst value) { this.casefirst = value; return this; } /** - * Required - API name: {@code caseLevel} + * API name: {@code caseLevel} */ - public final Builder caselevel(boolean value) { + public final Builder caselevel(@Nullable Boolean value) { this.caselevel = value; return this; } /** - * Required - API name: {@code country} + * API name: {@code country} */ - public final Builder country(String value) { + public final Builder country(@Nullable String value) { this.country = value; return this; } /** - * Required - API name: {@code decomposition} + * API name: {@code decomposition} */ - public final Builder decomposition(IcuCollationDecomposition value) { + public final Builder decomposition(@Nullable IcuCollationDecomposition value) { this.decomposition = value; return this; } /** - * Required - API name: {@code hiraganaQuaternaryMode} + * API name: {@code hiraganaQuaternaryMode} */ - public final Builder hiraganaquaternarymode(boolean value) { + public final Builder hiraganaquaternarymode(@Nullable Boolean value) { this.hiraganaquaternarymode = value; return this; } /** - * Required - API name: {@code language} + * API name: {@code language} */ - public final Builder language(String value) { + public final Builder language(@Nullable String value) { this.language = value; return this; } /** - * Required - API name: {@code numeric} + * API name: {@code numeric} */ - public final Builder numeric(boolean value) { + public final Builder numeric(@Nullable Boolean value) { this.numeric = value; return this; } /** - * Required - API name: {@code strength} + * API name: {@code rules} + */ + public final Builder rules(@Nullable String value) { + this.rules = value; + return this; + } + + /** + * API name: {@code strength} */ - public final Builder strength(IcuCollationStrength value) { + public final Builder strength(@Nullable IcuCollationStrength value) { this.strength = value; return this; } @@ -330,9 +407,9 @@ public final Builder variabletop(@Nullable String value) { } /** - * Required - API name: {@code variant} + * API name: {@code variant} */ - public final Builder variant(String value) { + public final Builder variant(@Nullable String value) { this.variant = value; return this; } @@ -374,6 +451,7 @@ protected static void setupIcuCollationTokenFilterDeserializer( op.add(Builder::hiraganaquaternarymode, JsonpDeserializer.booleanDeserializer(), "hiraganaQuaternaryMode"); op.add(Builder::language, JsonpDeserializer.stringDeserializer(), "language"); op.add(Builder::numeric, JsonpDeserializer.booleanDeserializer(), "numeric"); + op.add(Builder::rules, JsonpDeserializer.stringDeserializer(), "rules"); op.add(Builder::strength, IcuCollationStrength._DESERIALIZER, "strength"); op.add(Builder::variabletop, JsonpDeserializer.stringDeserializer(), "variableTop"); op.add(Builder::variant, JsonpDeserializer.stringDeserializer(), "variant"); diff --git a/java-client/src/main/java/co/elastic/clients/elasticsearch/async_search/SubmitRequest.java b/java-client/src/main/java/co/elastic/clients/elasticsearch/async_search/SubmitRequest.java index c5d7ec817..a41291ffa 100644 --- a/java-client/src/main/java/co/elastic/clients/elasticsearch/async_search/SubmitRequest.java +++ b/java-client/src/main/java/co/elastic/clients/elasticsearch/async_search/SubmitRequest.java @@ -43,6 +43,7 @@ import co.elastic.clients.elasticsearch.core.search.SourceConfig; import co.elastic.clients.elasticsearch.core.search.Suggester; import co.elastic.clients.elasticsearch.core.search.TrackHits; +import co.elastic.clients.json.JsonData; import co.elastic.clients.json.JsonpDeserializable; import co.elastic.clients.json.JsonpDeserializer; import co.elastic.clients.json.JsonpMapper; @@ -117,6 +118,8 @@ public class SubmitRequest extends RequestBase implements JsonpSerializable { @Nullable private final Boolean explain; + private final Map ext; + private final List fields; @Nullable @@ -248,6 +251,7 @@ private SubmitRequest(Builder builder) { this.docvalueFields = ApiTypeHelper.unmodifiable(builder.docvalueFields); this.expandWildcards = ApiTypeHelper.unmodifiable(builder.expandWildcards); this.explain = builder.explain; + this.ext = ApiTypeHelper.unmodifiable(builder.ext); this.fields = ApiTypeHelper.unmodifiable(builder.fields); this.from = builder.from; this.highlight = builder.highlight; @@ -438,6 +442,15 @@ public final Boolean explain() { return this.explain; } + /** + * Configuration of search extensions defined by Elasticsearch plugins. + *

+ * API name: {@code ext} + */ + public final Map ext() { + return this.ext; + } + /** * Array of wildcard (*) patterns. The request returns values for field names * matching these patterns in the hits.fields property of the response. @@ -895,6 +908,17 @@ protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { generator.writeKey("explain"); generator.write(this.explain); + } + if (ApiTypeHelper.isDefined(this.ext)) { + generator.writeKey("ext"); + generator.writeStartObject(); + for (Map.Entry item0 : this.ext.entrySet()) { + generator.writeKey(item0.getKey()); + item0.getValue().serialize(generator, mapper); + + } + generator.writeEnd(); + } if (ApiTypeHelper.isDefined(this.fields)) { generator.writeKey("fields"); @@ -1128,6 +1152,9 @@ public static class Builder extends WithJsonObjectBuilderBase implement @Nullable private Boolean explain; + @Nullable + private Map ext; + @Nullable private List fields; @@ -1476,6 +1503,30 @@ public final Builder explain(@Nullable Boolean value) { return this; } + /** + * Configuration of search extensions defined by Elasticsearch plugins. + *

+ * API name: {@code ext} + *

+ * Adds all entries of map to ext. + */ + public final Builder ext(Map map) { + this.ext = _mapPutAll(this.ext, map); + return this; + } + + /** + * Configuration of search extensions defined by Elasticsearch plugins. + *

+ * API name: {@code ext} + *

+ * Adds an entry to ext. + */ + public final Builder ext(String key, JsonData value) { + this.ext = _mapPut(this.ext, key, value); + return this; + } + /** * Array of wildcard (*) patterns. The request returns values for field names * matching these patterns in the hits.fields property of the response. @@ -2213,6 +2264,7 @@ protected static void setupSubmitRequestDeserializer(ObjectDeserializer settings() { return this.settings; @@ -197,6 +197,7 @@ public static class Builder extends WithJsonObjectBuilderBase @Nullable private Long version; + @Nullable private Map settings; @Nullable @@ -234,7 +235,7 @@ public final Builder version(@Nullable Long value) { } /** - * Required - API name: {@code settings} + * API name: {@code settings} *

* Adds all entries of map to settings. */ @@ -244,7 +245,7 @@ public final Builder settings(Map map) { } /** - * Required - API name: {@code settings} + * API name: {@code settings} *

* Adds an entry to settings. */ @@ -254,7 +255,7 @@ public final Builder settings(String key, IndexSettings value) { } /** - * Required - API name: {@code settings} + * API name: {@code settings} *

* Adds an entry to settings using a builder lambda. */ diff --git a/java-client/src/main/java/co/elastic/clients/elasticsearch/core/SearchRequest.java b/java-client/src/main/java/co/elastic/clients/elasticsearch/core/SearchRequest.java index 3baeb921b..a5595f455 100644 --- a/java-client/src/main/java/co/elastic/clients/elasticsearch/core/SearchRequest.java +++ b/java-client/src/main/java/co/elastic/clients/elasticsearch/core/SearchRequest.java @@ -43,6 +43,7 @@ import co.elastic.clients.elasticsearch.core.search.SourceConfig; import co.elastic.clients.elasticsearch.core.search.Suggester; import co.elastic.clients.elasticsearch.core.search.TrackHits; +import co.elastic.clients.json.JsonData; import co.elastic.clients.json.JsonpDeserializable; import co.elastic.clients.json.JsonpDeserializer; import co.elastic.clients.json.JsonpMapper; @@ -117,6 +118,8 @@ public class SearchRequest extends RequestBase implements JsonpSerializable { @Nullable private final Boolean explain; + private final Map ext; + private final List fields; @Nullable @@ -241,6 +244,7 @@ private SearchRequest(Builder builder) { this.docvalueFields = ApiTypeHelper.unmodifiable(builder.docvalueFields); this.expandWildcards = ApiTypeHelper.unmodifiable(builder.expandWildcards); this.explain = builder.explain; + this.ext = ApiTypeHelper.unmodifiable(builder.ext); this.fields = ApiTypeHelper.unmodifiable(builder.fields); this.from = builder.from; this.highlight = builder.highlight; @@ -433,6 +437,15 @@ public final Boolean explain() { return this.explain; } + /** + * Configuration of search extensions defined by Elasticsearch plugins. + *

+ * API name: {@code ext} + */ + public final Map ext() { + return this.ext; + } + /** * Array of wildcard (*) patterns. The request returns values for field names * matching these patterns in the hits.fields property of the response. @@ -881,6 +894,17 @@ protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { generator.writeKey("explain"); generator.write(this.explain); + } + if (ApiTypeHelper.isDefined(this.ext)) { + generator.writeKey("ext"); + generator.writeStartObject(); + for (Map.Entry item0 : this.ext.entrySet()) { + generator.writeKey(item0.getKey()); + item0.getValue().serialize(generator, mapper); + + } + generator.writeEnd(); + } if (ApiTypeHelper.isDefined(this.fields)) { generator.writeKey("fields"); @@ -1114,6 +1138,9 @@ public static class Builder extends WithJsonObjectBuilderBase implement @Nullable private Boolean explain; + @Nullable + private Map ext; + @Nullable private List fields; @@ -1460,6 +1487,30 @@ public final Builder explain(@Nullable Boolean value) { return this; } + /** + * Configuration of search extensions defined by Elasticsearch plugins. + *

+ * API name: {@code ext} + *

+ * Adds all entries of map to ext. + */ + public final Builder ext(Map map) { + this.ext = _mapPutAll(this.ext, map); + return this; + } + + /** + * Configuration of search extensions defined by Elasticsearch plugins. + *

+ * API name: {@code ext} + *

+ * Adds an entry to ext. + */ + public final Builder ext(String key, JsonData value) { + this.ext = _mapPut(this.ext, key, value); + return this; + } + /** * Array of wildcard (*) patterns. The request returns values for field names * matching these patterns in the hits.fields property of the response. @@ -2188,6 +2239,7 @@ protected static void setupSearchRequestDeserializer(ObjectDeserializer ext; + private final List storedFields; private final List docvalueFields; @@ -152,6 +155,7 @@ private MultisearchBody(Builder builder) { this.collapse = builder.collapse; this.query = builder.query; this.explain = builder.explain; + this.ext = ApiTypeHelper.unmodifiable(builder.ext); this.storedFields = ApiTypeHelper.unmodifiable(builder.storedFields); this.docvalueFields = ApiTypeHelper.unmodifiable(builder.docvalueFields); this.from = builder.from; @@ -220,6 +224,15 @@ public final Boolean explain() { return this.explain; } + /** + * Configuration of search extensions defined by Elasticsearch plugins. + *

+ * API name: {@code ext} + */ + public final Map ext() { + return this.ext; + } + /** * List of stored fields to return as part of a hit. If no fields are specified, * no stored fields are included in the response. If this field is specified, @@ -507,6 +520,17 @@ protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { generator.writeKey("explain"); generator.write(this.explain); + } + if (ApiTypeHelper.isDefined(this.ext)) { + generator.writeKey("ext"); + generator.writeStartObject(); + for (Map.Entry item0 : this.ext.entrySet()) { + generator.writeKey(item0.getKey()); + item0.getValue().serialize(generator, mapper); + + } + generator.writeEnd(); + } if (ApiTypeHelper.isDefined(this.storedFields)) { generator.writeKey("stored_fields"); @@ -720,6 +744,9 @@ public static class Builder extends WithJsonObjectBuilderBase implement @Nullable private Boolean explain; + @Nullable + private Map ext; + @Nullable private List storedFields; @@ -869,6 +896,30 @@ public final Builder explain(@Nullable Boolean value) { return this; } + /** + * Configuration of search extensions defined by Elasticsearch plugins. + *

+ * API name: {@code ext} + *

+ * Adds all entries of map to ext. + */ + public final Builder ext(Map map) { + this.ext = _mapPutAll(this.ext, map); + return this; + } + + /** + * Configuration of search extensions defined by Elasticsearch plugins. + *

+ * API name: {@code ext} + *

+ * Adds an entry to ext. + */ + public final Builder ext(String key, JsonData value) { + this.ext = _mapPut(this.ext, key, value); + return this; + } + /** * List of stored fields to return as part of a hit. If no fields are specified, * no stored fields are included in the response. If this field is specified, @@ -1424,6 +1475,7 @@ protected static void setupMultisearchBodyDeserializer(ObjectDeserializer 1) { hash = hash.substring(1); } - window.location = "https://github.com/elastic/elasticsearch-specification/tree/984c21945c71f1a658355803d43a7add2dac7265/specification/" + (paths[hash] || ""); + window.location = "https://github.com/elastic/elasticsearch-specification/tree/85133bd6101deda7a4ec9b29714e979c11a547c0/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/IndexVersioning.java b/java-client/src/main/java/co/elastic/clients/elasticsearch/indices/IndexVersioning.java index fed1e8013..f8553b6ba 100644 --- a/java-client/src/main/java/co/elastic/clients/elasticsearch/indices/IndexVersioning.java +++ b/java-client/src/main/java/co/elastic/clients/elasticsearch/indices/IndexVersioning.java @@ -30,7 +30,6 @@ 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; @@ -48,13 +47,14 @@ */ @JsonpDeserializable public class IndexVersioning implements JsonpSerializable { + @Nullable private final String created; // --------------------------------------------------------------------------------------------- private IndexVersioning(Builder builder) { - this.created = ApiTypeHelper.requireNonNull(builder.created, this, "created"); + this.created = builder.created; } @@ -63,8 +63,9 @@ public static IndexVersioning of(Function implements ObjectBuilder { + @Nullable private String created; /** - * Required - API name: {@code created} + * API name: {@code created} */ - public final Builder created(String value) { + public final Builder created(@Nullable String value) { this.created = value; return this; } diff --git a/java-client/src/main/java/co/elastic/clients/elasticsearch/security/GetTokenResponse.java b/java-client/src/main/java/co/elastic/clients/elasticsearch/security/GetTokenResponse.java index 2cae77849..a7a268eff 100644 --- a/java-client/src/main/java/co/elastic/clients/elasticsearch/security/GetTokenResponse.java +++ b/java-client/src/main/java/co/elastic/clients/elasticsearch/security/GetTokenResponse.java @@ -59,6 +59,7 @@ public class GetTokenResponse implements JsonpSerializable { private final String type; + @Nullable private final String refreshToken; @Nullable @@ -74,7 +75,7 @@ private GetTokenResponse(Builder builder) { this.expiresIn = ApiTypeHelper.requireNonNull(builder.expiresIn, this, "expiresIn"); this.scope = builder.scope; this.type = ApiTypeHelper.requireNonNull(builder.type, this, "type"); - this.refreshToken = ApiTypeHelper.requireNonNull(builder.refreshToken, this, "refreshToken"); + this.refreshToken = builder.refreshToken; this.kerberosAuthenticationResponseToken = builder.kerberosAuthenticationResponseToken; this.authentication = ApiTypeHelper.requireNonNull(builder.authentication, this, "authentication"); @@ -114,8 +115,9 @@ public final String type() { } /** - * Required - API name: {@code refresh_token} + * API name: {@code refresh_token} */ + @Nullable public final String refreshToken() { return this.refreshToken; } @@ -160,9 +162,11 @@ protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { generator.writeKey("type"); generator.write(this.type); - generator.writeKey("refresh_token"); - generator.write(this.refreshToken); + if (this.refreshToken != null) { + generator.writeKey("refresh_token"); + generator.write(this.refreshToken); + } if (this.kerberosAuthenticationResponseToken != null) { generator.writeKey("kerberos_authentication_response_token"); generator.write(this.kerberosAuthenticationResponseToken); @@ -194,6 +198,7 @@ public static class Builder extends WithJsonObjectBuilderBase implement private String type; + @Nullable private String refreshToken; @Nullable @@ -234,9 +239,9 @@ public final Builder type(String value) { } /** - * Required - API name: {@code refresh_token} + * API name: {@code refresh_token} */ - public final Builder refreshToken(String value) { + public final Builder refreshToken(@Nullable String value) { this.refreshToken = value; return this; }