From d2f6886d7ac7eb045f4834cdd6e94dd4c8a33a5f Mon Sep 17 00:00:00 2001 From: Sylvain Wallez Date: Tue, 24 May 2022 18:38:57 +0200 Subject: [PATCH] [codegen] Update to latest API spec (#294) --- .../clients/elasticsearch/_types/Slices.java | 180 +++ .../elasticsearch/_types/SlicesBuilders.java | 40 + .../_types/SlicesCalculation.java | 57 + .../_types/mapping/DynamicProperty.java | 780 +++++++++++ .../_types/mapping/Property.java | 32 + .../_types/mapping/PropertyBase.java | 29 - .../_types/mapping/PropertyBuilders.java | 18 + .../core/DeleteByQueryRequest.java | 21 +- .../elasticsearch/core/MsearchRequest.java | 30 + .../elasticsearch/core/ReindexRequest.java | 21 +- .../core/UpdateByQueryRequest.java | 21 +- .../core/msearch/MultisearchBody.java | 1143 ++++++++++++++++- .../core/msearch/MultisearchHeader.java | 88 ++ .../core/reindex/RemoteSource.java | 120 +- .../elasticsearch/core/search/Highlight.java | 629 +-------- .../core/search/HighlightBase.java | 766 +++++++++++ .../core/search/HighlightField.java | 622 +-------- .../core/search/SuggestFuzziness.java | 103 +- .../elasticsearch/core/termvectors/Term.java | 11 +- .../elasticsearch/doc-files/api-spec.html | 158 +-- .../clients/elasticsearch/ilm/IlmPolicy.java | 48 +- .../indices/IndexCheckOnStartup.java | 4 +- .../indices/analyze/ExplainAnalyzeToken.java | 47 + .../security/TransientMetadataConfig.java | 145 +++ .../create_api_key/IndexPrivileges.java | 207 --- .../create_api_key/RoleDescriptor.java | 229 +++- .../get_service_accounts/RoleDescriptor.java | 3 +- 27 files changed, 3861 insertions(+), 1691 deletions(-) create mode 100644 java-client/src/main/java/co/elastic/clients/elasticsearch/_types/Slices.java create mode 100644 java-client/src/main/java/co/elastic/clients/elasticsearch/_types/SlicesBuilders.java create mode 100644 java-client/src/main/java/co/elastic/clients/elasticsearch/_types/SlicesCalculation.java create mode 100644 java-client/src/main/java/co/elastic/clients/elasticsearch/_types/mapping/DynamicProperty.java create mode 100644 java-client/src/main/java/co/elastic/clients/elasticsearch/core/search/HighlightBase.java create mode 100644 java-client/src/main/java/co/elastic/clients/elasticsearch/security/TransientMetadataConfig.java delete mode 100644 java-client/src/main/java/co/elastic/clients/elasticsearch/security/create_api_key/IndexPrivileges.java diff --git a/java-client/src/main/java/co/elastic/clients/elasticsearch/_types/Slices.java b/java-client/src/main/java/co/elastic/clients/elasticsearch/_types/Slices.java new file mode 100644 index 000000000..5c157e0aa --- /dev/null +++ b/java-client/src/main/java/co/elastic/clients/elasticsearch/_types/Slices.java @@ -0,0 +1,180 @@ +/* + * 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. + */ + +//---------------------------------------------------- +// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. +//---------------------------------------------------- + +package co.elastic.clients.elasticsearch._types; + +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.ObjectDeserializer; +import co.elastic.clients.json.UnionDeserializer; +import co.elastic.clients.util.ApiTypeHelper; +import co.elastic.clients.util.ObjectBuilder; +import co.elastic.clients.util.ObjectBuilderBase; +import co.elastic.clients.util.TaggedUnion; +import co.elastic.clients.util.TaggedUnionUtils; +import jakarta.json.stream.JsonGenerator; +import java.lang.Integer; +import java.lang.Object; +import java.util.Objects; +import java.util.function.Function; +import javax.annotation.Nullable; + +// typedef: _types.Slices + +/** + * Slices configuration used to parallelize a process. + * + * @see API specification + */ +@JsonpDeserializable +public class Slices implements TaggedUnion, JsonpSerializable { + + public enum Kind { + Computed, Value + + } + + private final Kind _kind; + private final Object _value; + + @Override + public final Kind _kind() { + return _kind; + } + + @Override + public final Object _get() { + return _value; + } + + private Slices(Kind kind, Object value) { + this._kind = kind; + this._value = value; + } + + public String _toJsonString() { + switch (_kind) { + case Computed : + return this.computed().jsonValue(); + case Value : + return String.valueOf(this.value()); + + default : + throw new IllegalStateException("Unknown kind " + _kind); + } + } + + private Slices(Builder builder) { + + this._kind = ApiTypeHelper.requireNonNull(builder._kind, builder, ""); + this._value = ApiTypeHelper.requireNonNull(builder._value, builder, ""); + + } + + public static Slices of(Function> fn) { + return fn.apply(new Builder()).build(); + } + + /** + * Is this variant instance of kind {@code computed}? + */ + public boolean isComputed() { + return _kind == Kind.Computed; + } + + /** + * Get the {@code computed} variant value. + * + * @throws IllegalStateException + * if the current variant is not of the {@code computed} kind. + */ + public SlicesCalculation computed() { + return TaggedUnionUtils.get(this, Kind.Computed); + } + + /** + * Is this variant instance of kind {@code value}? + */ + public boolean isValue() { + return _kind == Kind.Value; + } + + /** + * Get the {@code value} variant value. + * + * @throws IllegalStateException + * if the current variant is not of the {@code value} kind. + */ + public Integer value() { + return TaggedUnionUtils.get(this, Kind.Value); + } + + @Override + public void serialize(JsonGenerator generator, JsonpMapper mapper) { + if (_value instanceof JsonpSerializable) { + ((JsonpSerializable) _value).serialize(generator, mapper); + } else { + switch (_kind) { + case Value : + generator.write(((Integer) this._value)); + + break; + } + } + + } + + public static class Builder extends ObjectBuilderBase implements ObjectBuilder { + private Kind _kind; + private Object _value; + + public ObjectBuilder computed(SlicesCalculation v) { + this._kind = Kind.Computed; + this._value = v; + return this; + } + + public ObjectBuilder value(Integer v) { + this._kind = Kind.Value; + this._value = v; + return this; + } + + public Slices build() { + _checkSingleUse(); + return new Slices(this); + } + + } + + private static JsonpDeserializer buildSlicesDeserializer() { + return new UnionDeserializer.Builder(Slices::new, false) + .addMember(Kind.Computed, SlicesCalculation._DESERIALIZER) + .addMember(Kind.Value, JsonpDeserializer.integerDeserializer()).build(); + } + + public static final JsonpDeserializer _DESERIALIZER = JsonpDeserializer + .lazy(Slices::buildSlicesDeserializer); +} diff --git a/java-client/src/main/java/co/elastic/clients/elasticsearch/_types/SlicesBuilders.java b/java-client/src/main/java/co/elastic/clients/elasticsearch/_types/SlicesBuilders.java new file mode 100644 index 000000000..acfc50b48 --- /dev/null +++ b/java-client/src/main/java/co/elastic/clients/elasticsearch/_types/SlicesBuilders.java @@ -0,0 +1,40 @@ +/* + * 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. + */ + +//---------------------------------------------------- +// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. +//---------------------------------------------------- + +package co.elastic.clients.elasticsearch._types; + +import co.elastic.clients.util.ObjectBuilder; +import java.util.function.Function; + +/** + * Builders for {@link Slices} variants. + *

+ * Variants computed, value are not available here as + * they don't have a dedicated class. Use {@link Slices}'s builder for these. + * + */ +public class SlicesBuilders { + private SlicesBuilders() { + } + +} diff --git a/java-client/src/main/java/co/elastic/clients/elasticsearch/_types/SlicesCalculation.java b/java-client/src/main/java/co/elastic/clients/elasticsearch/_types/SlicesCalculation.java new file mode 100644 index 000000000..70b42b0a8 --- /dev/null +++ b/java-client/src/main/java/co/elastic/clients/elasticsearch/_types/SlicesCalculation.java @@ -0,0 +1,57 @@ +/* + * 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. + */ + +//---------------------------------------------------- +// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. +//---------------------------------------------------- + +package co.elastic.clients.elasticsearch._types; + +import co.elastic.clients.json.JsonEnum; +import co.elastic.clients.json.JsonpDeserializable; +import co.elastic.clients.json.JsonpDeserializer; + +/** + * + * @see API + * specification + */ +@JsonpDeserializable +public enum SlicesCalculation implements JsonEnum { + /** + * Let Elasticsearch choose a reasonable number for most data streams and + * indices. + */ + Auto("auto"), + + ; + + private final String jsonValue; + + SlicesCalculation(String jsonValue) { + this.jsonValue = jsonValue; + } + + public String jsonValue() { + return this.jsonValue; + } + + public static final JsonEnum.Deserializer _DESERIALIZER = new JsonEnum.Deserializer<>( + SlicesCalculation.values()); +} diff --git a/java-client/src/main/java/co/elastic/clients/elasticsearch/_types/mapping/DynamicProperty.java b/java-client/src/main/java/co/elastic/clients/elasticsearch/_types/mapping/DynamicProperty.java new file mode 100644 index 000000000..3e1693028 --- /dev/null +++ b/java-client/src/main/java/co/elastic/clients/elasticsearch/_types/mapping/DynamicProperty.java @@ -0,0 +1,780 @@ +/* + * 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. + */ + +//---------------------------------------------------- +// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. +//---------------------------------------------------- + +package co.elastic.clients.elasticsearch._types.mapping; + +import co.elastic.clients.elasticsearch._types.FieldValue; +import co.elastic.clients.elasticsearch._types.Script; +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.lang.Boolean; +import java.lang.Double; +import java.lang.Integer; +import java.lang.String; +import java.util.Objects; +import java.util.function.Function; +import javax.annotation.Nullable; + +// typedef: _types.mapping.DynamicProperty + +/** + * + * @see API + * specification + */ +@JsonpDeserializable +public class DynamicProperty extends DocValuesPropertyBase implements PropertyVariant { + @Nullable + private final Boolean enabled; + + @Nullable + private final FieldValue nullValue; + + @Nullable + private final Double boost; + + @Nullable + private final Boolean coerce; + + @Nullable + private final Script script; + + @Nullable + private final OnScriptError onScriptError; + + @Nullable + private final Boolean ignoreMalformed; + + @Nullable + private final String analyzer; + + @Nullable + private final Boolean eagerGlobalOrdinals; + + @Nullable + private final Boolean index; + + @Nullable + private final IndexOptions indexOptions; + + @Nullable + private final Boolean indexPhrases; + + @Nullable + private final TextIndexPrefixes indexPrefixes; + + @Nullable + private final Boolean norms; + + @Nullable + private final Integer positionIncrementGap; + + @Nullable + private final String searchAnalyzer; + + @Nullable + private final String searchQuoteAnalyzer; + + @Nullable + private final TermVectorOption termVector; + + @Nullable + private final String format; + + @Nullable + private final Integer precisionStep; + + @Nullable + private final String locale; + + // --------------------------------------------------------------------------------------------- + + private DynamicProperty(Builder builder) { + super(builder); + + this.enabled = builder.enabled; + this.nullValue = builder.nullValue; + this.boost = builder.boost; + this.coerce = builder.coerce; + this.script = builder.script; + this.onScriptError = builder.onScriptError; + this.ignoreMalformed = builder.ignoreMalformed; + this.analyzer = builder.analyzer; + this.eagerGlobalOrdinals = builder.eagerGlobalOrdinals; + this.index = builder.index; + this.indexOptions = builder.indexOptions; + this.indexPhrases = builder.indexPhrases; + this.indexPrefixes = builder.indexPrefixes; + this.norms = builder.norms; + this.positionIncrementGap = builder.positionIncrementGap; + this.searchAnalyzer = builder.searchAnalyzer; + this.searchQuoteAnalyzer = builder.searchQuoteAnalyzer; + this.termVector = builder.termVector; + this.format = builder.format; + this.precisionStep = builder.precisionStep; + this.locale = builder.locale; + + } + + public static DynamicProperty of(Function> fn) { + return fn.apply(new Builder()).build(); + } + + /** + * Property variant kind. + */ + @Override + public Property.Kind _propertyKind() { + return Property.Kind.DynamicProperty; + } + + /** + * API name: {@code enabled} + */ + @Nullable + public final Boolean enabled() { + return this.enabled; + } + + /** + * API name: {@code null_value} + */ + @Nullable + public final FieldValue nullValue() { + return this.nullValue; + } + + /** + * API name: {@code boost} + */ + @Nullable + public final Double boost() { + return this.boost; + } + + /** + * API name: {@code coerce} + */ + @Nullable + public final Boolean coerce() { + return this.coerce; + } + + /** + * API name: {@code script} + */ + @Nullable + public final Script script() { + return this.script; + } + + /** + * API name: {@code on_script_error} + */ + @Nullable + public final OnScriptError onScriptError() { + return this.onScriptError; + } + + /** + * API name: {@code ignore_malformed} + */ + @Nullable + public final Boolean ignoreMalformed() { + return this.ignoreMalformed; + } + + /** + * API name: {@code analyzer} + */ + @Nullable + public final String analyzer() { + return this.analyzer; + } + + /** + * API name: {@code eager_global_ordinals} + */ + @Nullable + public final Boolean eagerGlobalOrdinals() { + return this.eagerGlobalOrdinals; + } + + /** + * API name: {@code index} + */ + @Nullable + public final Boolean index() { + return this.index; + } + + /** + * API name: {@code index_options} + */ + @Nullable + public final IndexOptions indexOptions() { + return this.indexOptions; + } + + /** + * API name: {@code index_phrases} + */ + @Nullable + public final Boolean indexPhrases() { + return this.indexPhrases; + } + + /** + * API name: {@code index_prefixes} + */ + @Nullable + public final TextIndexPrefixes indexPrefixes() { + return this.indexPrefixes; + } + + /** + * API name: {@code norms} + */ + @Nullable + public final Boolean norms() { + return this.norms; + } + + /** + * API name: {@code position_increment_gap} + */ + @Nullable + public final Integer positionIncrementGap() { + return this.positionIncrementGap; + } + + /** + * API name: {@code search_analyzer} + */ + @Nullable + public final String searchAnalyzer() { + return this.searchAnalyzer; + } + + /** + * API name: {@code search_quote_analyzer} + */ + @Nullable + public final String searchQuoteAnalyzer() { + return this.searchQuoteAnalyzer; + } + + /** + * API name: {@code term_vector} + */ + @Nullable + public final TermVectorOption termVector() { + return this.termVector; + } + + /** + * API name: {@code format} + */ + @Nullable + public final String format() { + return this.format; + } + + /** + * API name: {@code precision_step} + */ + @Nullable + public final Integer precisionStep() { + return this.precisionStep; + } + + /** + * API name: {@code locale} + */ + @Nullable + public final String locale() { + return this.locale; + } + + protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { + + generator.write("type", "{dynamic_property}"); + super.serializeInternal(generator, mapper); + if (this.enabled != null) { + generator.writeKey("enabled"); + generator.write(this.enabled); + + } + if (this.nullValue != null) { + generator.writeKey("null_value"); + this.nullValue.serialize(generator, mapper); + + } + if (this.boost != null) { + generator.writeKey("boost"); + generator.write(this.boost); + + } + if (this.coerce != null) { + generator.writeKey("coerce"); + generator.write(this.coerce); + + } + if (this.script != null) { + generator.writeKey("script"); + this.script.serialize(generator, mapper); + + } + if (this.onScriptError != null) { + generator.writeKey("on_script_error"); + this.onScriptError.serialize(generator, mapper); + } + if (this.ignoreMalformed != null) { + generator.writeKey("ignore_malformed"); + generator.write(this.ignoreMalformed); + + } + if (this.analyzer != null) { + generator.writeKey("analyzer"); + generator.write(this.analyzer); + + } + if (this.eagerGlobalOrdinals != null) { + generator.writeKey("eager_global_ordinals"); + generator.write(this.eagerGlobalOrdinals); + + } + if (this.index != null) { + generator.writeKey("index"); + generator.write(this.index); + + } + if (this.indexOptions != null) { + generator.writeKey("index_options"); + this.indexOptions.serialize(generator, mapper); + } + if (this.indexPhrases != null) { + generator.writeKey("index_phrases"); + generator.write(this.indexPhrases); + + } + if (this.indexPrefixes != null) { + generator.writeKey("index_prefixes"); + this.indexPrefixes.serialize(generator, mapper); + + } + if (this.norms != null) { + generator.writeKey("norms"); + generator.write(this.norms); + + } + if (this.positionIncrementGap != null) { + generator.writeKey("position_increment_gap"); + generator.write(this.positionIncrementGap); + + } + if (this.searchAnalyzer != null) { + generator.writeKey("search_analyzer"); + generator.write(this.searchAnalyzer); + + } + if (this.searchQuoteAnalyzer != null) { + generator.writeKey("search_quote_analyzer"); + generator.write(this.searchQuoteAnalyzer); + + } + if (this.termVector != null) { + generator.writeKey("term_vector"); + this.termVector.serialize(generator, mapper); + } + if (this.format != null) { + generator.writeKey("format"); + generator.write(this.format); + + } + if (this.precisionStep != null) { + generator.writeKey("precision_step"); + generator.write(this.precisionStep); + + } + if (this.locale != null) { + generator.writeKey("locale"); + generator.write(this.locale); + + } + + } + + // --------------------------------------------------------------------------------------------- + + /** + * Builder for {@link DynamicProperty}. + */ + + public static class Builder extends DocValuesPropertyBase.AbstractBuilder + implements + ObjectBuilder { + @Nullable + private Boolean enabled; + + @Nullable + private FieldValue nullValue; + + @Nullable + private Double boost; + + @Nullable + private Boolean coerce; + + @Nullable + private Script script; + + @Nullable + private OnScriptError onScriptError; + + @Nullable + private Boolean ignoreMalformed; + + @Nullable + private String analyzer; + + @Nullable + private Boolean eagerGlobalOrdinals; + + @Nullable + private Boolean index; + + @Nullable + private IndexOptions indexOptions; + + @Nullable + private Boolean indexPhrases; + + @Nullable + private TextIndexPrefixes indexPrefixes; + + @Nullable + private Boolean norms; + + @Nullable + private Integer positionIncrementGap; + + @Nullable + private String searchAnalyzer; + + @Nullable + private String searchQuoteAnalyzer; + + @Nullable + private TermVectorOption termVector; + + @Nullable + private String format; + + @Nullable + private Integer precisionStep; + + @Nullable + private String locale; + + /** + * API name: {@code enabled} + */ + public final Builder enabled(@Nullable Boolean value) { + this.enabled = value; + return this; + } + + /** + * API name: {@code null_value} + */ + public final Builder nullValue(@Nullable FieldValue value) { + this.nullValue = value; + return this; + } + + /** + * API name: {@code null_value} + */ + public final Builder nullValue(Function> fn) { + return this.nullValue(fn.apply(new FieldValue.Builder()).build()); + } + + /** + * API name: {@code null_value} + */ + public final Builder nullValue(String value) { + this.nullValue = FieldValue.of(value); + return this; + } + + /** + * API name: {@code null_value} + */ + public final Builder nullValue(long value) { + this.nullValue = FieldValue.of(value); + return this; + } + + /** + * API name: {@code null_value} + */ + public final Builder nullValue(double value) { + this.nullValue = FieldValue.of(value); + return this; + } + + /** + * API name: {@code null_value} + */ + public final Builder nullValue(boolean value) { + this.nullValue = FieldValue.of(value); + return this; + } + + /** + * API name: {@code boost} + */ + public final Builder boost(@Nullable Double value) { + this.boost = value; + return this; + } + + /** + * API name: {@code coerce} + */ + public final Builder coerce(@Nullable Boolean value) { + this.coerce = value; + return this; + } + + /** + * API name: {@code script} + */ + public final Builder script(@Nullable Script value) { + this.script = value; + return this; + } + + /** + * API name: {@code script} + */ + public final Builder script(Function> fn) { + return this.script(fn.apply(new Script.Builder()).build()); + } + + /** + * API name: {@code on_script_error} + */ + public final Builder onScriptError(@Nullable OnScriptError value) { + this.onScriptError = value; + return this; + } + + /** + * API name: {@code ignore_malformed} + */ + public final Builder ignoreMalformed(@Nullable Boolean value) { + this.ignoreMalformed = value; + return this; + } + + /** + * API name: {@code analyzer} + */ + public final Builder analyzer(@Nullable String value) { + this.analyzer = value; + return this; + } + + /** + * API name: {@code eager_global_ordinals} + */ + public final Builder eagerGlobalOrdinals(@Nullable Boolean value) { + this.eagerGlobalOrdinals = value; + return this; + } + + /** + * API name: {@code index} + */ + public final Builder index(@Nullable Boolean value) { + this.index = value; + return this; + } + + /** + * API name: {@code index_options} + */ + public final Builder indexOptions(@Nullable IndexOptions value) { + this.indexOptions = value; + return this; + } + + /** + * API name: {@code index_phrases} + */ + public final Builder indexPhrases(@Nullable Boolean value) { + this.indexPhrases = value; + return this; + } + + /** + * API name: {@code index_prefixes} + */ + public final Builder indexPrefixes(@Nullable TextIndexPrefixes value) { + this.indexPrefixes = value; + return this; + } + + /** + * API name: {@code index_prefixes} + */ + public final Builder indexPrefixes(Function> fn) { + return this.indexPrefixes(fn.apply(new TextIndexPrefixes.Builder()).build()); + } + + /** + * API name: {@code norms} + */ + public final Builder norms(@Nullable Boolean value) { + this.norms = value; + return this; + } + + /** + * API name: {@code position_increment_gap} + */ + public final Builder positionIncrementGap(@Nullable Integer value) { + this.positionIncrementGap = value; + return this; + } + + /** + * API name: {@code search_analyzer} + */ + public final Builder searchAnalyzer(@Nullable String value) { + this.searchAnalyzer = value; + return this; + } + + /** + * API name: {@code search_quote_analyzer} + */ + public final Builder searchQuoteAnalyzer(@Nullable String value) { + this.searchQuoteAnalyzer = value; + return this; + } + + /** + * API name: {@code term_vector} + */ + public final Builder termVector(@Nullable TermVectorOption value) { + this.termVector = value; + return this; + } + + /** + * API name: {@code format} + */ + public final Builder format(@Nullable String value) { + this.format = value; + return this; + } + + /** + * API name: {@code precision_step} + */ + public final Builder precisionStep(@Nullable Integer value) { + this.precisionStep = value; + return this; + } + + /** + * API name: {@code locale} + */ + public final Builder locale(@Nullable String value) { + this.locale = value; + return this; + } + + @Override + protected Builder self() { + return this; + } + + /** + * Builds a {@link DynamicProperty}. + * + * @throws NullPointerException + * if some of the required fields are null. + */ + public DynamicProperty build() { + _checkSingleUse(); + + return new DynamicProperty(this); + } + } + + // --------------------------------------------------------------------------------------------- + + /** + * Json deserializer for {@link DynamicProperty} + */ + public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer.lazy(Builder::new, + DynamicProperty::setupDynamicPropertyDeserializer); + + protected static void setupDynamicPropertyDeserializer(ObjectDeserializer op) { + DocValuesPropertyBase.setupDocValuesPropertyBaseDeserializer(op); + op.add(Builder::enabled, JsonpDeserializer.booleanDeserializer(), "enabled"); + op.add(Builder::nullValue, FieldValue._DESERIALIZER, "null_value"); + op.add(Builder::boost, JsonpDeserializer.doubleDeserializer(), "boost"); + op.add(Builder::coerce, JsonpDeserializer.booleanDeserializer(), "coerce"); + op.add(Builder::script, Script._DESERIALIZER, "script"); + op.add(Builder::onScriptError, OnScriptError._DESERIALIZER, "on_script_error"); + op.add(Builder::ignoreMalformed, JsonpDeserializer.booleanDeserializer(), "ignore_malformed"); + op.add(Builder::analyzer, JsonpDeserializer.stringDeserializer(), "analyzer"); + op.add(Builder::eagerGlobalOrdinals, JsonpDeserializer.booleanDeserializer(), "eager_global_ordinals"); + op.add(Builder::index, JsonpDeserializer.booleanDeserializer(), "index"); + op.add(Builder::indexOptions, IndexOptions._DESERIALIZER, "index_options"); + op.add(Builder::indexPhrases, JsonpDeserializer.booleanDeserializer(), "index_phrases"); + op.add(Builder::indexPrefixes, TextIndexPrefixes._DESERIALIZER, "index_prefixes"); + op.add(Builder::norms, JsonpDeserializer.booleanDeserializer(), "norms"); + op.add(Builder::positionIncrementGap, JsonpDeserializer.integerDeserializer(), "position_increment_gap"); + op.add(Builder::searchAnalyzer, JsonpDeserializer.stringDeserializer(), "search_analyzer"); + op.add(Builder::searchQuoteAnalyzer, JsonpDeserializer.stringDeserializer(), "search_quote_analyzer"); + op.add(Builder::termVector, TermVectorOption._DESERIALIZER, "term_vector"); + op.add(Builder::format, JsonpDeserializer.stringDeserializer(), "format"); + op.add(Builder::precisionStep, JsonpDeserializer.integerDeserializer(), "precision_step"); + op.add(Builder::locale, JsonpDeserializer.stringDeserializer(), "locale"); + + op.ignore("type"); + } + +} diff --git a/java-client/src/main/java/co/elastic/clients/elasticsearch/_types/mapping/Property.java b/java-client/src/main/java/co/elastic/clients/elasticsearch/_types/mapping/Property.java index 25e347501..4184d3e8b 100644 --- a/java-client/src/main/java/co/elastic/clients/elasticsearch/_types/mapping/Property.java +++ b/java-client/src/main/java/co/elastic/clients/elasticsearch/_types/mapping/Property.java @@ -85,6 +85,8 @@ public enum Kind implements JsonEnum { DoubleRange("double_range"), + DynamicProperty("{dynamic_property}"), + Alias("alias"), Flattened("flattened"), @@ -402,6 +404,24 @@ public DoubleRangeProperty doubleRange() { return TaggedUnionUtils.get(this, Kind.DoubleRange); } + /** + * Is this variant instance of kind {@code {dynamic_property}}? + */ + public boolean isDynamicProperty() { + return _kind == Kind.DynamicProperty; + } + + /** + * Get the {@code {dynamic_property}} variant value. + * + * @throws IllegalStateException + * if the current variant is not of the {@code {dynamic_property}} + * kind. + */ + public DynamicProperty dynamicProperty() { + return TaggedUnionUtils.get(this, Kind.DynamicProperty); + } + /** * Is this variant instance of kind {@code alias}? */ @@ -1109,6 +1129,17 @@ public ObjectBuilder doubleRange( return this.doubleRange(fn.apply(new DoubleRangeProperty.Builder()).build()); } + public ObjectBuilder dynamicProperty(DynamicProperty v) { + this._kind = Kind.DynamicProperty; + this._value = v; + return this; + } + + public ObjectBuilder dynamicProperty( + Function> fn) { + return this.dynamicProperty(fn.apply(new DynamicProperty.Builder()).build()); + } + public ObjectBuilder alias(FieldAliasProperty v) { this._kind = Kind.Alias; this._value = v; @@ -1483,6 +1514,7 @@ protected static void setupPropertyDeserializer(ObjectDeserializer op) op.add(Builder::denseVector, DenseVectorProperty._DESERIALIZER, "dense_vector"); op.add(Builder::double_, DoubleNumberProperty._DESERIALIZER, "double"); op.add(Builder::doubleRange, DoubleRangeProperty._DESERIALIZER, "double_range"); + op.add(Builder::dynamicProperty, DynamicProperty._DESERIALIZER, "{dynamic_property}"); op.add(Builder::alias, FieldAliasProperty._DESERIALIZER, "alias"); op.add(Builder::flattened, FlattenedProperty._DESERIALIZER, "flattened"); op.add(Builder::float_, FloatNumberProperty._DESERIALIZER, "float"); diff --git a/java-client/src/main/java/co/elastic/clients/elasticsearch/_types/mapping/PropertyBase.java b/java-client/src/main/java/co/elastic/clients/elasticsearch/_types/mapping/PropertyBase.java index 66e875059..bf8df2870 100644 --- a/java-client/src/main/java/co/elastic/clients/elasticsearch/_types/mapping/PropertyBase.java +++ b/java-client/src/main/java/co/elastic/clients/elasticsearch/_types/mapping/PropertyBase.java @@ -55,9 +55,6 @@ public abstract class PropertyBase implements JsonpSerializable { private final Map meta; - @Nullable - private final String name; - private final Map properties; @Nullable @@ -74,7 +71,6 @@ protected PropertyBase(AbstractBuilder builder) { this.localMetadata = ApiTypeHelper.unmodifiable(builder.localMetadata); this.meta = ApiTypeHelper.unmodifiable(builder.meta); - this.name = builder.name; this.properties = ApiTypeHelper.unmodifiable(builder.properties); this.ignoreAbove = builder.ignoreAbove; this.dynamic = builder.dynamic; @@ -96,14 +92,6 @@ public final Map meta() { return this.meta; } - /** - * API name: {@code name} - */ - @Nullable - public final String name() { - return this.name; - } - /** * API name: {@code properties} */ @@ -166,11 +154,6 @@ protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { } generator.writeEnd(); - } - if (this.name != null) { - generator.writeKey("name"); - generator.write(this.name); - } if (ApiTypeHelper.isDefined(this.properties)) { generator.writeKey("properties"); @@ -220,9 +203,6 @@ protected abstract static class AbstractBuilder meta; - @Nullable - private String name; - @Nullable private Map properties; @@ -275,14 +255,6 @@ public final BuilderT meta(String key, String value) { return self(); } - /** - * API name: {@code name} - */ - public final BuilderT name(@Nullable String value) { - this.name = value; - return self(); - } - /** * API name: {@code properties} *

@@ -369,7 +341,6 @@ protected static > void setupProperty "local_metadata"); op.add(AbstractBuilder::meta, JsonpDeserializer.stringMapDeserializer(JsonpDeserializer.stringDeserializer()), "meta"); - op.add(AbstractBuilder::name, JsonpDeserializer.stringDeserializer(), "name"); op.add(AbstractBuilder::properties, JsonpDeserializer.stringMapDeserializer(Property._DESERIALIZER), "properties"); op.add(AbstractBuilder::ignoreAbove, JsonpDeserializer.integerDeserializer(), "ignore_above"); diff --git a/java-client/src/main/java/co/elastic/clients/elasticsearch/_types/mapping/PropertyBuilders.java b/java-client/src/main/java/co/elastic/clients/elasticsearch/_types/mapping/PropertyBuilders.java index 24a1b85c2..6c8ad3a6f 100644 --- a/java-client/src/main/java/co/elastic/clients/elasticsearch/_types/mapping/PropertyBuilders.java +++ b/java-client/src/main/java/co/elastic/clients/elasticsearch/_types/mapping/PropertyBuilders.java @@ -249,6 +249,24 @@ public static Property doubleRange(Function> fn) { + Property.Builder builder = new Property.Builder(); + builder.dynamicProperty(fn.apply(new DynamicProperty.Builder()).build()); + return builder.build(); + } + /** * Creates a builder for the {@link FieldAliasProperty alias} {@code Property} * variant. diff --git a/java-client/src/main/java/co/elastic/clients/elasticsearch/core/DeleteByQueryRequest.java b/java-client/src/main/java/co/elastic/clients/elasticsearch/core/DeleteByQueryRequest.java index fa350f782..aaf90b387 100644 --- a/java-client/src/main/java/co/elastic/clients/elasticsearch/core/DeleteByQueryRequest.java +++ b/java-client/src/main/java/co/elastic/clients/elasticsearch/core/DeleteByQueryRequest.java @@ -29,6 +29,7 @@ import co.elastic.clients.elasticsearch._types.RequestBase; import co.elastic.clients.elasticsearch._types.SearchType; import co.elastic.clients.elasticsearch._types.SlicedScroll; +import co.elastic.clients.elasticsearch._types.Slices; import co.elastic.clients.elasticsearch._types.Time; import co.elastic.clients.elasticsearch._types.WaitForActiveShards; import co.elastic.clients.elasticsearch._types.query_dsl.Operator; @@ -140,7 +141,7 @@ public class DeleteByQueryRequest extends RequestBase implements JsonpSerializab private final SlicedScroll slice; @Nullable - private final Long slices; + private final Slices slices; private final List sort; @@ -469,7 +470,7 @@ public final SlicedScroll slice() { * API name: {@code slices} */ @Nullable - public final Long slices() { + public final Slices slices() { return this.slices; } @@ -670,7 +671,7 @@ public static class Builder extends WithJsonObjectBuilderBase private SlicedScroll slice; @Nullable - private Long slices; + private Slices slices; @Nullable private List sort; @@ -1021,11 +1022,21 @@ public final Builder slice(Function * API name: {@code slices} */ - public final Builder slices(@Nullable Long value) { + public final Builder slices(@Nullable Slices value) { this.slices = value; return this; } + /** + * The number of slices this task should be divided into. Defaults to 1, meaning + * the task isn't sliced into subtasks. Can be set to auto. + *

+ * API name: {@code slices} + */ + public final Builder slices(Function> fn) { + return this.slices(fn.apply(new Slices.Builder()).build()); + } + /** * A comma-separated list of <field>:<direction> pairs *

@@ -1263,7 +1274,7 @@ protected static void setupDeleteByQueryRequestDeserializer(ObjectDeserializer { Map params = new HashMap<>(); if (request.slices != null) { - params.put("slices", String.valueOf(request.slices)); + params.put("slices", request.slices._toJsonString()); } if (request.df != null) { params.put("df", request.df); diff --git a/java-client/src/main/java/co/elastic/clients/elasticsearch/core/MsearchRequest.java b/java-client/src/main/java/co/elastic/clients/elasticsearch/core/MsearchRequest.java index 1b1e2e3c6..1c0a1c5a7 100644 --- a/java-client/src/main/java/co/elastic/clients/elasticsearch/core/MsearchRequest.java +++ b/java-client/src/main/java/co/elastic/clients/elasticsearch/core/MsearchRequest.java @@ -88,6 +88,9 @@ public class MsearchRequest extends RequestBase implements NdJsonpSerializable, @Nullable private final Long preFilterShardSize; + @Nullable + private final String routing; + @Nullable private final SearchType searchType; @@ -108,6 +111,7 @@ private MsearchRequest(Builder builder) { this.maxConcurrentSearches = builder.maxConcurrentSearches; this.maxConcurrentShardRequests = builder.maxConcurrentShardRequests; this.preFilterShardSize = builder.preFilterShardSize; + this.routing = builder.routing; this.searchType = builder.searchType; this.type = ApiTypeHelper.unmodifiable(builder.type); this.searches = ApiTypeHelper.unmodifiableRequired(builder.searches, this, "searches"); @@ -223,6 +227,16 @@ public final Long preFilterShardSize() { return this.preFilterShardSize; } + /** + * Custom routing value used to route search operations to a specific shard. + *

+ * API name: {@code routing} + */ + @Nullable + public final String routing() { + return this.routing; + } + /** * Indicates whether global term and document frequencies should be used when * scoring returned documents. @@ -297,6 +311,9 @@ public static class Builder extends ObjectBuilderBase implements ObjectBuilder + * API name: {@code routing} + */ + public final Builder routing(@Nullable String value) { + this.routing = value; + return this; + } + /** * Indicates whether global term and document frequencies should be used when * scoring returned documents. @@ -569,6 +596,9 @@ public MsearchRequest build() { request -> { Map params = new HashMap<>(); params.put("typed_keys", "true"); + if (request.routing != null) { + params.put("routing", request.routing); + } if (request.preFilterShardSize != null) { params.put("pre_filter_shard_size", String.valueOf(request.preFilterShardSize)); } diff --git a/java-client/src/main/java/co/elastic/clients/elasticsearch/core/ReindexRequest.java b/java-client/src/main/java/co/elastic/clients/elasticsearch/core/ReindexRequest.java index 4954c079e..c2a9c8fe9 100644 --- a/java-client/src/main/java/co/elastic/clients/elasticsearch/core/ReindexRequest.java +++ b/java-client/src/main/java/co/elastic/clients/elasticsearch/core/ReindexRequest.java @@ -27,6 +27,7 @@ import co.elastic.clients.elasticsearch._types.ErrorResponse; import co.elastic.clients.elasticsearch._types.RequestBase; import co.elastic.clients.elasticsearch._types.Script; +import co.elastic.clients.elasticsearch._types.Slices; import co.elastic.clients.elasticsearch._types.Time; import co.elastic.clients.elasticsearch._types.WaitForActiveShards; import co.elastic.clients.elasticsearch.core.reindex.Destination; @@ -90,7 +91,7 @@ public class ReindexRequest extends RequestBase implements JsonpSerializable { private final Long size; @Nullable - private final Long slices; + private final Slices slices; private final Source source; @@ -213,7 +214,7 @@ public final Long size() { * API name: {@code slices} */ @Nullable - public final Long slices() { + public final Slices slices() { return this.slices; } @@ -331,7 +332,7 @@ public static class Builder extends WithJsonObjectBuilderBase implement private Long size; @Nullable - private Long slices; + private Slices slices; private Source source; @@ -452,11 +453,21 @@ public final Builder size(@Nullable Long value) { *

* API name: {@code slices} */ - public final Builder slices(@Nullable Long value) { + public final Builder slices(@Nullable Slices value) { this.slices = value; return this; } + /** + * The number of slices this task should be divided into. Defaults to 1, meaning + * the task isn't sliced into subtasks. Can be set to auto. + *

+ * API name: {@code slices} + */ + public final Builder slices(Function> fn) { + return this.slices(fn.apply(new Slices.Builder()).build()); + } + /** * Required - API name: {@code source} */ @@ -592,7 +603,7 @@ protected static void setupReindexRequestDeserializer(ObjectDeserializer { Map params = new HashMap<>(); if (request.slices != null) { - params.put("slices", String.valueOf(request.slices)); + params.put("slices", request.slices._toJsonString()); } if (request.requestsPerSecond != null) { params.put("requests_per_second", String.valueOf(request.requestsPerSecond)); diff --git a/java-client/src/main/java/co/elastic/clients/elasticsearch/core/UpdateByQueryRequest.java b/java-client/src/main/java/co/elastic/clients/elasticsearch/core/UpdateByQueryRequest.java index fb9e0163e..03c810257 100644 --- a/java-client/src/main/java/co/elastic/clients/elasticsearch/core/UpdateByQueryRequest.java +++ b/java-client/src/main/java/co/elastic/clients/elasticsearch/core/UpdateByQueryRequest.java @@ -30,6 +30,7 @@ import co.elastic.clients.elasticsearch._types.Script; import co.elastic.clients.elasticsearch._types.SearchType; import co.elastic.clients.elasticsearch._types.SlicedScroll; +import co.elastic.clients.elasticsearch._types.Slices; import co.elastic.clients.elasticsearch._types.Time; import co.elastic.clients.elasticsearch._types.WaitForActiveShards; import co.elastic.clients.elasticsearch._types.query_dsl.Operator; @@ -145,7 +146,7 @@ public class UpdateByQueryRequest extends RequestBase implements JsonpSerializab private final SlicedScroll slice; @Nullable - private final Long slices; + private final Slices slices; private final List sort; @@ -485,7 +486,7 @@ public final SlicedScroll slice() { * API name: {@code slices} */ @Nullable - public final Long slices() { + public final Slices slices() { return this.slices; } @@ -710,7 +711,7 @@ public static class Builder extends WithJsonObjectBuilderBase private SlicedScroll slice; @Nullable - private Long slices; + private Slices slices; @Nullable private List sort; @@ -1077,11 +1078,21 @@ public final Builder slice(Function * API name: {@code slices} */ - public final Builder slices(@Nullable Long value) { + public final Builder slices(@Nullable Slices value) { this.slices = value; return this; } + /** + * The number of slices this task should be divided into. Defaults to 1, meaning + * the task isn't sliced into subtasks. Can be set to auto. + *

+ * API name: {@code slices} + */ + public final Builder slices(Function> fn) { + return this.slices(fn.apply(new Slices.Builder()).build()); + } + /** * A comma-separated list of <field>:<direction> pairs *

@@ -1333,7 +1344,7 @@ protected static void setupUpdateByQueryRequestDeserializer(ObjectDeserializer { Map params = new HashMap<>(); if (request.slices != null) { - params.put("slices", String.valueOf(request.slices)); + params.put("slices", request.slices._toJsonString()); } if (request.df != null) { params.put("df", request.df); diff --git a/java-client/src/main/java/co/elastic/clients/elasticsearch/core/msearch/MultisearchBody.java b/java-client/src/main/java/co/elastic/clients/elasticsearch/core/msearch/MultisearchBody.java index f541bd04e..57d70a952 100644 --- a/java-client/src/main/java/co/elastic/clients/elasticsearch/core/msearch/MultisearchBody.java +++ b/java-client/src/main/java/co/elastic/clients/elasticsearch/core/msearch/MultisearchBody.java @@ -23,9 +23,17 @@ package co.elastic.clients.elasticsearch.core.msearch; +import co.elastic.clients.elasticsearch._types.ScriptField; +import co.elastic.clients.elasticsearch._types.SortOptions; import co.elastic.clients.elasticsearch._types.aggregations.Aggregation; +import co.elastic.clients.elasticsearch._types.mapping.RuntimeField; +import co.elastic.clients.elasticsearch._types.query_dsl.FieldAndFormat; import co.elastic.clients.elasticsearch._types.query_dsl.Query; +import co.elastic.clients.elasticsearch.core.search.FieldCollapse; +import co.elastic.clients.elasticsearch.core.search.Highlight; import co.elastic.clients.elasticsearch.core.search.PointInTimeReference; +import co.elastic.clients.elasticsearch.core.search.Rescore; +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.JsonpDeserializable; @@ -39,8 +47,12 @@ import co.elastic.clients.util.ObjectBuilder; import co.elastic.clients.util.WithJsonObjectBuilderBase; import jakarta.json.stream.JsonGenerator; +import java.lang.Boolean; +import java.lang.Double; import java.lang.Integer; +import java.lang.Long; import java.lang.String; +import java.util.List; import java.util.Map; import java.util.Objects; import java.util.function.Function; @@ -58,21 +70,77 @@ public class MultisearchBody implements JsonpSerializable { private final Map aggregations; + @Nullable + private final FieldCollapse collapse; + @Nullable private final Query query; + @Nullable + private final Boolean explain; + + private final List storedFields; + + private final List docvalueFields; + @Nullable private final Integer from; + @Nullable + private final Highlight highlight; + + private final List> indicesBoost; + + @Nullable + private final Double minScore; + + @Nullable + private final Query postFilter; + + @Nullable + private final Boolean profile; + + private final List rescore; + + private final Map scriptFields; + + private final List searchAfter; + @Nullable private final Integer size; + private final List sort; + @Nullable - private final PointInTimeReference pit; + private final SourceConfig source; + + private final List fields; + + @Nullable + private final Long terminateAfter; + + private final List stats; + + @Nullable + private final String timeout; + + @Nullable + private final Boolean trackScores; @Nullable private final TrackHits trackTotalHits; + @Nullable + private final Boolean version; + + private final Map runtimeMappings; + + @Nullable + private final Boolean seqNoPrimaryTerm; + + @Nullable + private final PointInTimeReference pit; + @Nullable private final Suggester suggest; @@ -81,11 +149,33 @@ public class MultisearchBody implements JsonpSerializable { private MultisearchBody(Builder builder) { this.aggregations = ApiTypeHelper.unmodifiable(builder.aggregations); + this.collapse = builder.collapse; this.query = builder.query; + this.explain = builder.explain; + this.storedFields = ApiTypeHelper.unmodifiable(builder.storedFields); + this.docvalueFields = ApiTypeHelper.unmodifiable(builder.docvalueFields); this.from = builder.from; + this.highlight = builder.highlight; + this.indicesBoost = ApiTypeHelper.unmodifiable(builder.indicesBoost); + this.minScore = builder.minScore; + this.postFilter = builder.postFilter; + this.profile = builder.profile; + this.rescore = ApiTypeHelper.unmodifiable(builder.rescore); + this.scriptFields = ApiTypeHelper.unmodifiable(builder.scriptFields); + this.searchAfter = ApiTypeHelper.unmodifiable(builder.searchAfter); this.size = builder.size; - this.pit = builder.pit; + this.sort = ApiTypeHelper.unmodifiable(builder.sort); + this.source = builder.source; + this.fields = ApiTypeHelper.unmodifiable(builder.fields); + this.terminateAfter = builder.terminateAfter; + this.stats = ApiTypeHelper.unmodifiable(builder.stats); + this.timeout = builder.timeout; + this.trackScores = builder.trackScores; this.trackTotalHits = builder.trackTotalHits; + this.version = builder.version; + this.runtimeMappings = ApiTypeHelper.unmodifiable(builder.runtimeMappings); + this.seqNoPrimaryTerm = builder.seqNoPrimaryTerm; + this.pit = builder.pit; this.suggest = builder.suggest; } @@ -102,6 +192,16 @@ public final Map aggregations() { } /** + * API name: {@code collapse} + */ + @Nullable + public final FieldCollapse collapse() { + return this.collapse; + } + + /** + * Defines the search definition using the Query DSL. + *

* API name: {@code query} */ @Nullable @@ -110,6 +210,43 @@ public final Query query() { } /** + * If true, returns detailed information about score computation as part of a + * hit. + *

+ * API name: {@code explain} + */ + @Nullable + public final Boolean explain() { + return this.explain; + } + + /** + * 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, + * the _source parameter defaults to false. You can pass _source: true to return + * both source fields and stored fields in the search response. + *

+ * API name: {@code stored_fields} + */ + public final List storedFields() { + return this.storedFields; + } + + /** + * Array of wildcard (*) patterns. The request returns doc values for field + * names matching these patterns in the hits.fields property of the response. + *

+ * API name: {@code docvalue_fields} + */ + public final List docvalueFields() { + return this.docvalueFields; + } + + /** + * Starting document offset. By default, you cannot page through more than + * 10,000 hits using the from and size parameters. To page through more hits, + * use the search_after parameter. + *

* API name: {@code from} */ @Nullable @@ -118,6 +255,77 @@ public final Integer from() { } /** + * API name: {@code highlight} + */ + @Nullable + public final Highlight highlight() { + return this.highlight; + } + + /** + * Boosts the _score of documents from specified indices. + *

+ * API name: {@code indices_boost} + */ + public final List> indicesBoost() { + return this.indicesBoost; + } + + /** + * Minimum _score for matching documents. Documents with a lower _score are not + * included in the search results. + *

+ * API name: {@code min_score} + */ + @Nullable + public final Double minScore() { + return this.minScore; + } + + /** + * API name: {@code post_filter} + */ + @Nullable + public final Query postFilter() { + return this.postFilter; + } + + /** + * API name: {@code profile} + */ + @Nullable + public final Boolean profile() { + return this.profile; + } + + /** + * API name: {@code rescore} + */ + public final List rescore() { + return this.rescore; + } + + /** + * Retrieve a script evaluation (based on different fields) for each hit. + *

+ * API name: {@code script_fields} + */ + public final Map scriptFields() { + return this.scriptFields; + } + + /** + * API name: {@code search_after} + */ + public final List searchAfter() { + return this.searchAfter; + } + + /** + * The number of hits to return. By default, you cannot page through more than + * 10,000 hits using the from and size parameters. To page through more hits, + * use the search_after parameter. + *

* API name: {@code size} */ @Nullable @@ -126,14 +334,86 @@ public final Integer size() { } /** - * API name: {@code pit} + * API name: {@code sort} + */ + public final List sort() { + return this.sort; + } + + /** + * Indicates which source fields are returned for matching documents. These + * fields are returned in the hits._source property of the search response. + *

+ * API name: {@code _source} */ @Nullable - public final PointInTimeReference pit() { - return this.pit; + public final SourceConfig source() { + return this.source; + } + + /** + * Array of wildcard (*) patterns. The request returns values for field names + * matching these patterns in the hits.fields property of the response. + *

+ * API name: {@code fields} + */ + public final List fields() { + return this.fields; + } + + /** + * Maximum number of documents to collect for each shard. If a query reaches + * this limit, Elasticsearch terminates the query early. Elasticsearch collects + * documents before sorting. Defaults to 0, which does not terminate query + * execution early. + *

+ * API name: {@code terminate_after} + */ + @Nullable + public final Long terminateAfter() { + return this.terminateAfter; + } + + /** + * Stats groups to associate with the search. Each group maintains a statistics + * aggregation for its associated searches. You can retrieve these stats using + * the indices stats API. + *

+ * API name: {@code stats} + */ + public final List stats() { + return this.stats; } /** + * Specifies the period of time to wait for a response from each shard. If no + * response is received before the timeout expires, the request fails and + * returns an error. Defaults to no timeout. + *

+ * API name: {@code timeout} + */ + @Nullable + public final String timeout() { + return this.timeout; + } + + /** + * If true, calculate and return document scores, even if the scores are not + * used for sorting. + *

+ * API name: {@code track_scores} + */ + @Nullable + public final Boolean trackScores() { + return this.trackScores; + } + + /** + * Number of hits matching the query to count accurately. If true, the exact + * number of hits is returned at the cost of some performance. If false, the + * response does not include the total number of hits matching the query. + * Defaults to 10,000 hits. + *

* API name: {@code track_total_hits} */ @Nullable @@ -141,6 +421,48 @@ public final TrackHits trackTotalHits() { return this.trackTotalHits; } + /** + * If true, returns document version as part of a hit. + *

+ * API name: {@code version} + */ + @Nullable + public final Boolean version() { + return this.version; + } + + /** + * Defines one or more runtime fields in the search request. These fields take + * precedence over mapped fields with the same name. + *

+ * API name: {@code runtime_mappings} + */ + public final Map runtimeMappings() { + return this.runtimeMappings; + } + + /** + * If true, returns sequence number and primary term of the last modification of + * each hit. See Optimistic concurrency control. + *

+ * API name: {@code seq_no_primary_term} + */ + @Nullable + public final Boolean seqNoPrimaryTerm() { + return this.seqNoPrimaryTerm; + } + + /** + * Limits the search to a point in time (PIT). If you provide a PIT, you cannot + * specify an <index> in the request path. + *

+ * API name: {@code pit} + */ + @Nullable + public final PointInTimeReference pit() { + return this.pit; + } + /** * API name: {@code suggest} */ @@ -170,31 +492,201 @@ protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { } generator.writeEnd(); + } + if (this.collapse != null) { + generator.writeKey("collapse"); + this.collapse.serialize(generator, mapper); + } if (this.query != null) { generator.writeKey("query"); this.query.serialize(generator, mapper); + } + if (this.explain != null) { + generator.writeKey("explain"); + generator.write(this.explain); + + } + if (ApiTypeHelper.isDefined(this.storedFields)) { + generator.writeKey("stored_fields"); + generator.writeStartArray(); + for (String item0 : this.storedFields) { + generator.write(item0); + + } + generator.writeEnd(); + + } + if (ApiTypeHelper.isDefined(this.docvalueFields)) { + generator.writeKey("docvalue_fields"); + generator.writeStartArray(); + for (FieldAndFormat item0 : this.docvalueFields) { + item0.serialize(generator, mapper); + + } + generator.writeEnd(); + } if (this.from != null) { generator.writeKey("from"); generator.write(this.from); + } + if (this.highlight != null) { + generator.writeKey("highlight"); + this.highlight.serialize(generator, mapper); + + } + if (ApiTypeHelper.isDefined(this.indicesBoost)) { + generator.writeKey("indices_boost"); + generator.writeStartArray(); + for (Map item0 : this.indicesBoost) { + generator.writeStartObject(); + if (item0 != null) { + for (Map.Entry item1 : item0.entrySet()) { + generator.writeKey(item1.getKey()); + generator.write(item1.getValue()); + + } + } + generator.writeEnd(); + + } + generator.writeEnd(); + + } + if (this.minScore != null) { + generator.writeKey("min_score"); + generator.write(this.minScore); + + } + if (this.postFilter != null) { + generator.writeKey("post_filter"); + this.postFilter.serialize(generator, mapper); + + } + if (this.profile != null) { + generator.writeKey("profile"); + generator.write(this.profile); + + } + if (ApiTypeHelper.isDefined(this.rescore)) { + generator.writeKey("rescore"); + generator.writeStartArray(); + for (Rescore item0 : this.rescore) { + item0.serialize(generator, mapper); + + } + generator.writeEnd(); + + } + if (ApiTypeHelper.isDefined(this.scriptFields)) { + generator.writeKey("script_fields"); + generator.writeStartObject(); + for (Map.Entry item0 : this.scriptFields.entrySet()) { + generator.writeKey(item0.getKey()); + item0.getValue().serialize(generator, mapper); + + } + generator.writeEnd(); + + } + if (ApiTypeHelper.isDefined(this.searchAfter)) { + generator.writeKey("search_after"); + generator.writeStartArray(); + for (String item0 : this.searchAfter) { + generator.write(item0); + + } + generator.writeEnd(); + } if (this.size != null) { generator.writeKey("size"); generator.write(this.size); } - if (this.pit != null) { - generator.writeKey("pit"); - this.pit.serialize(generator, mapper); + if (ApiTypeHelper.isDefined(this.sort)) { + generator.writeKey("sort"); + generator.writeStartArray(); + for (SortOptions item0 : this.sort) { + item0.serialize(generator, mapper); + + } + generator.writeEnd(); + + } + if (this.source != null) { + generator.writeKey("_source"); + this.source.serialize(generator, mapper); + + } + if (ApiTypeHelper.isDefined(this.fields)) { + generator.writeKey("fields"); + generator.writeStartArray(); + for (FieldAndFormat item0 : this.fields) { + item0.serialize(generator, mapper); + + } + generator.writeEnd(); + + } + if (this.terminateAfter != null) { + generator.writeKey("terminate_after"); + generator.write(this.terminateAfter); + + } + if (ApiTypeHelper.isDefined(this.stats)) { + generator.writeKey("stats"); + generator.writeStartArray(); + for (String item0 : this.stats) { + generator.write(item0); + + } + generator.writeEnd(); + + } + if (this.timeout != null) { + generator.writeKey("timeout"); + generator.write(this.timeout); + + } + if (this.trackScores != null) { + generator.writeKey("track_scores"); + generator.write(this.trackScores); } if (this.trackTotalHits != null) { generator.writeKey("track_total_hits"); this.trackTotalHits.serialize(generator, mapper); + } + if (this.version != null) { + generator.writeKey("version"); + generator.write(this.version); + + } + if (ApiTypeHelper.isDefined(this.runtimeMappings)) { + generator.writeKey("runtime_mappings"); + generator.writeStartObject(); + for (Map.Entry item0 : this.runtimeMappings.entrySet()) { + generator.writeKey(item0.getKey()); + item0.getValue().serialize(generator, mapper); + + } + generator.writeEnd(); + + } + if (this.seqNoPrimaryTerm != null) { + generator.writeKey("seq_no_primary_term"); + generator.write(this.seqNoPrimaryTerm); + + } + if (this.pit != null) { + generator.writeKey("pit"); + this.pit.serialize(generator, mapper); + } if (this.suggest != null) { generator.writeKey("suggest"); @@ -219,38 +711,104 @@ public static class Builder extends WithJsonObjectBuilderBase implement @Nullable private Map aggregations; + @Nullable + private FieldCollapse collapse; + @Nullable private Query query; + @Nullable + private Boolean explain; + + @Nullable + private List storedFields; + + @Nullable + private List docvalueFields; + @Nullable private Integer from; @Nullable - private Integer size; + private Highlight highlight; @Nullable - private PointInTimeReference pit; + private List> indicesBoost; @Nullable - private TrackHits trackTotalHits; + private Double minScore; @Nullable - private Suggester suggest; + private Query postFilter; - /** - * API name: {@code aggregations} - *

- * Adds all entries of map to aggregations. - */ - public final Builder aggregations(Map map) { - this.aggregations = _mapPutAll(this.aggregations, map); - return this; - } + @Nullable + private Boolean profile; - /** - * API name: {@code aggregations} - *

- * Adds an entry to aggregations. + @Nullable + private List rescore; + + @Nullable + private Map scriptFields; + + @Nullable + private List searchAfter; + + @Nullable + private Integer size; + + @Nullable + private List sort; + + @Nullable + private SourceConfig source; + + @Nullable + private List fields; + + @Nullable + private Long terminateAfter; + + @Nullable + private List stats; + + @Nullable + private String timeout; + + @Nullable + private Boolean trackScores; + + @Nullable + private TrackHits trackTotalHits; + + @Nullable + private Boolean version; + + @Nullable + private Map runtimeMappings; + + @Nullable + private Boolean seqNoPrimaryTerm; + + @Nullable + private PointInTimeReference pit; + + @Nullable + private Suggester suggest; + + /** + * API name: {@code aggregations} + *

+ * Adds all entries of map to aggregations. + */ + public final Builder aggregations(Map map) { + this.aggregations = _mapPutAll(this.aggregations, map); + return this; + } + + /** + * API name: {@code aggregations} + *

+ * Adds an entry to aggregations. */ public final Builder aggregations(String key, Aggregation value) { this.aggregations = _mapPut(this.aggregations, key, value); @@ -267,6 +825,23 @@ public final Builder aggregations(String key, Function> fn) { + return this.collapse(fn.apply(new FieldCollapse.Builder()).build()); + } + + /** + * Defines the search definition using the Query DSL. + *

* API name: {@code query} */ public final Builder query(@Nullable Query value) { @@ -275,6 +850,8 @@ public final Builder query(@Nullable Query value) { } /** + * Defines the search definition using the Query DSL. + *

* API name: {@code query} */ public final Builder query(Function> fn) { @@ -282,6 +859,89 @@ public final Builder query(Function> fn) { } /** + * If true, returns detailed information about score computation as part of a + * hit. + *

+ * API name: {@code explain} + */ + public final Builder explain(@Nullable Boolean value) { + this.explain = 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, + * the _source parameter defaults to false. You can pass _source: true to return + * both source fields and stored fields in the search response. + *

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

+ * Adds all elements of list to storedFields. + */ + public final Builder storedFields(List list) { + this.storedFields = _listAddAll(this.storedFields, list); + 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, + * the _source parameter defaults to false. You can pass _source: true to return + * both source fields and stored fields in the search response. + *

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

+ * Adds one or more values to storedFields. + */ + public final Builder storedFields(String value, String... values) { + this.storedFields = _listAdd(this.storedFields, value, values); + return this; + } + + /** + * Array of wildcard (*) patterns. The request returns doc values for field + * names matching these patterns in the hits.fields property of the response. + *

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

+ * Adds all elements of list to docvalueFields. + */ + public final Builder docvalueFields(List list) { + this.docvalueFields = _listAddAll(this.docvalueFields, list); + return this; + } + + /** + * Array of wildcard (*) patterns. The request returns doc values for field + * names matching these patterns in the hits.fields property of the response. + *

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

+ * Adds one or more values to docvalueFields. + */ + public final Builder docvalueFields(FieldAndFormat value, FieldAndFormat... values) { + this.docvalueFields = _listAdd(this.docvalueFields, value, values); + return this; + } + + /** + * Array of wildcard (*) patterns. The request returns doc values for field + * names matching these patterns in the hits.fields property of the response. + *

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

+ * Adds a value to docvalueFields using a builder lambda. + */ + public final Builder docvalueFields(Function> fn) { + return docvalueFields(fn.apply(new FieldAndFormat.Builder()).build()); + } + + /** + * Starting document offset. By default, you cannot page through more than + * 10,000 hits using the from and size parameters. To page through more hits, + * use the search_after parameter. + *

* API name: {@code from} */ public final Builder from(@Nullable Integer value) { @@ -290,6 +950,167 @@ public final Builder from(@Nullable Integer value) { } /** + * API name: {@code highlight} + */ + public final Builder highlight(@Nullable Highlight value) { + this.highlight = value; + return this; + } + + /** + * API name: {@code highlight} + */ + public final Builder highlight(Function> fn) { + return this.highlight(fn.apply(new Highlight.Builder()).build()); + } + + /** + * Boosts the _score of documents from specified indices. + *

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

+ * Adds all elements of list to indicesBoost. + */ + public final Builder indicesBoost(List> list) { + this.indicesBoost = _listAddAll(this.indicesBoost, list); + return this; + } + + /** + * Boosts the _score of documents from specified indices. + *

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

+ * Adds one or more values to indicesBoost. + */ + public final Builder indicesBoost(Map value, Map... values) { + this.indicesBoost = _listAdd(this.indicesBoost, value, values); + return this; + } + + /** + * Minimum _score for matching documents. Documents with a lower _score are not + * included in the search results. + *

+ * API name: {@code min_score} + */ + public final Builder minScore(@Nullable Double value) { + this.minScore = value; + return this; + } + + /** + * API name: {@code post_filter} + */ + public final Builder postFilter(@Nullable Query value) { + this.postFilter = value; + return this; + } + + /** + * API name: {@code post_filter} + */ + public final Builder postFilter(Function> fn) { + return this.postFilter(fn.apply(new Query.Builder()).build()); + } + + /** + * API name: {@code profile} + */ + public final Builder profile(@Nullable Boolean value) { + this.profile = value; + return this; + } + + /** + * API name: {@code rescore} + *

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

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

+ * Adds a value to rescore using a builder lambda. + */ + public final Builder rescore(Function> fn) { + return rescore(fn.apply(new Rescore.Builder()).build()); + } + + /** + * Retrieve a script evaluation (based on different fields) for each hit. + *

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

+ * Adds all entries of map to scriptFields. + */ + public final Builder scriptFields(Map map) { + this.scriptFields = _mapPutAll(this.scriptFields, map); + return this; + } + + /** + * Retrieve a script evaluation (based on different fields) for each hit. + *

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

+ * Adds an entry to scriptFields. + */ + public final Builder scriptFields(String key, ScriptField value) { + this.scriptFields = _mapPut(this.scriptFields, key, value); + return this; + } + + /** + * Retrieve a script evaluation (based on different fields) for each hit. + *

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

+ * Adds an entry to scriptFields using a builder lambda. + */ + public final Builder scriptFields(String key, Function> fn) { + return scriptFields(key, fn.apply(new ScriptField.Builder()).build()); + } + + /** + * API name: {@code search_after} + *

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

+ * Adds one or more values to searchAfter. + */ + public final Builder searchAfter(String value, String... values) { + this.searchAfter = _listAdd(this.searchAfter, value, values); + return this; + } + + /** + * The number of hits to return. By default, you cannot page through more than + * 10,000 hits using the from and size parameters. To page through more hits, + * use the search_after parameter. + *

* API name: {@code size} */ public final Builder size(@Nullable Integer value) { @@ -298,21 +1119,163 @@ public final Builder size(@Nullable Integer value) { } /** - * API name: {@code pit} + * API name: {@code sort} + *

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

+ * Adds one or more values to sort. */ - public final Builder pit(Function> fn) { - return this.pit(fn.apply(new PointInTimeReference.Builder()).build()); + public final Builder sort(SortOptions value, SortOptions... values) { + this.sort = _listAdd(this.sort, value, values); + return this; + } + + /** + * API name: {@code sort} + *

+ * Adds a value to sort using a builder lambda. + */ + public final Builder sort(Function> fn) { + return sort(fn.apply(new SortOptions.Builder()).build()); } /** + * Indicates which source fields are returned for matching documents. These + * fields are returned in the hits._source property of the search response. + *

+ * API name: {@code _source} + */ + public final Builder source(@Nullable SourceConfig value) { + this.source = value; + return this; + } + + /** + * Indicates which source fields are returned for matching documents. These + * fields are returned in the hits._source property of the search response. + *

+ * API name: {@code _source} + */ + public final Builder source(Function> fn) { + return this.source(fn.apply(new SourceConfig.Builder()).build()); + } + + /** + * Array of wildcard (*) patterns. The request returns values for field names + * matching these patterns in the hits.fields property of the response. + *

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

+ * Adds all elements of list to fields. + */ + public final Builder fields(List list) { + this.fields = _listAddAll(this.fields, list); + return this; + } + + /** + * Array of wildcard (*) patterns. The request returns values for field names + * matching these patterns in the hits.fields property of the response. + *

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

+ * Adds one or more values to fields. + */ + public final Builder fields(FieldAndFormat value, FieldAndFormat... values) { + this.fields = _listAdd(this.fields, value, values); + return this; + } + + /** + * Array of wildcard (*) patterns. The request returns values for field names + * matching these patterns in the hits.fields property of the response. + *

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

+ * Adds a value to fields using a builder lambda. + */ + public final Builder fields(Function> fn) { + return fields(fn.apply(new FieldAndFormat.Builder()).build()); + } + + /** + * Maximum number of documents to collect for each shard. If a query reaches + * this limit, Elasticsearch terminates the query early. Elasticsearch collects + * documents before sorting. Defaults to 0, which does not terminate query + * execution early. + *

+ * API name: {@code terminate_after} + */ + public final Builder terminateAfter(@Nullable Long value) { + this.terminateAfter = value; + return this; + } + + /** + * Stats groups to associate with the search. Each group maintains a statistics + * aggregation for its associated searches. You can retrieve these stats using + * the indices stats API. + *

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

+ * Adds all elements of list to stats. + */ + public final Builder stats(List list) { + this.stats = _listAddAll(this.stats, list); + return this; + } + + /** + * Stats groups to associate with the search. Each group maintains a statistics + * aggregation for its associated searches. You can retrieve these stats using + * the indices stats API. + *

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

+ * Adds one or more values to stats. + */ + public final Builder stats(String value, String... values) { + this.stats = _listAdd(this.stats, value, values); + return this; + } + + /** + * Specifies the period of time to wait for a response from each shard. If no + * response is received before the timeout expires, the request fails and + * returns an error. Defaults to no timeout. + *

+ * API name: {@code timeout} + */ + public final Builder timeout(@Nullable String value) { + this.timeout = value; + return this; + } + + /** + * If true, calculate and return document scores, even if the scores are not + * used for sorting. + *

+ * API name: {@code track_scores} + */ + public final Builder trackScores(@Nullable Boolean value) { + this.trackScores = value; + return this; + } + + /** + * Number of hits matching the query to count accurately. If true, the exact + * number of hits is returned at the cost of some performance. If false, the + * response does not include the total number of hits matching the query. + * Defaults to 10,000 hits. + *

* API name: {@code track_total_hits} */ public final Builder trackTotalHits(@Nullable TrackHits value) { @@ -321,12 +1284,98 @@ public final Builder trackTotalHits(@Nullable TrackHits value) { } /** + * Number of hits matching the query to count accurately. If true, the exact + * number of hits is returned at the cost of some performance. If false, the + * response does not include the total number of hits matching the query. + * Defaults to 10,000 hits. + *

* API name: {@code track_total_hits} */ public final Builder trackTotalHits(Function> fn) { return this.trackTotalHits(fn.apply(new TrackHits.Builder()).build()); } + /** + * If true, returns document version as part of a hit. + *

+ * API name: {@code version} + */ + public final Builder version(@Nullable Boolean value) { + this.version = value; + return this; + } + + /** + * Defines one or more runtime fields in the search request. These fields take + * precedence over mapped fields with the same name. + *

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

+ * Adds all entries of map to runtimeMappings. + */ + public final Builder runtimeMappings(Map map) { + this.runtimeMappings = _mapPutAll(this.runtimeMappings, map); + return this; + } + + /** + * Defines one or more runtime fields in the search request. These fields take + * precedence over mapped fields with the same name. + *

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

+ * Adds an entry to runtimeMappings. + */ + public final Builder runtimeMappings(String key, RuntimeField value) { + this.runtimeMappings = _mapPut(this.runtimeMappings, key, value); + return this; + } + + /** + * Defines one or more runtime fields in the search request. These fields take + * precedence over mapped fields with the same name. + *

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

+ * Adds an entry to runtimeMappings using a builder lambda. + */ + public final Builder runtimeMappings(String key, + Function> fn) { + return runtimeMappings(key, fn.apply(new RuntimeField.Builder()).build()); + } + + /** + * If true, returns sequence number and primary term of the last modification of + * each hit. See Optimistic concurrency control. + *

+ * API name: {@code seq_no_primary_term} + */ + public final Builder seqNoPrimaryTerm(@Nullable Boolean value) { + this.seqNoPrimaryTerm = value; + return this; + } + + /** + * Limits the search to a point in time (PIT). If you provide a PIT, you cannot + * specify an <index> in the request path. + *

+ * API name: {@code pit} + */ + public final Builder pit(@Nullable PointInTimeReference value) { + this.pit = value; + return this; + } + + /** + * Limits the search to a point in time (PIT). If you provide a PIT, you cannot + * specify an <index> in the request path. + *

+ * API name: {@code pit} + */ + public final Builder pit(Function> fn) { + return this.pit(fn.apply(new PointInTimeReference.Builder()).build()); + } + /** * API name: {@code suggest} */ @@ -372,11 +1421,41 @@ protected static void setupMultisearchBodyDeserializer(ObjectDeserializer implement @Nullable private SearchType searchType; + @Nullable + private Boolean ccsMinimizeRoundtrips; + + @Nullable + private Boolean allowPartialSearchResults; + + @Nullable + private Boolean ignoreThrottled; + /** * API name: {@code allow_no_indices} */ @@ -344,6 +404,30 @@ public final Builder searchType(@Nullable SearchType value) { return this; } + /** + * API name: {@code ccs_minimize_roundtrips} + */ + public final Builder ccsMinimizeRoundtrips(@Nullable Boolean value) { + this.ccsMinimizeRoundtrips = value; + return this; + } + + /** + * API name: {@code allow_partial_search_results} + */ + public final Builder allowPartialSearchResults(@Nullable Boolean value) { + this.allowPartialSearchResults = value; + return this; + } + + /** + * API name: {@code ignore_throttled} + */ + public final Builder ignoreThrottled(@Nullable Boolean value) { + this.ignoreThrottled = value; + return this; + } + @Override protected Builder self() { return this; @@ -381,6 +465,10 @@ protected static void setupMultisearchHeaderDeserializer(ObjectDeserializer headers; + private final String host; + @Nullable private final String username; + @Nullable private final String password; + @Nullable private final Time socketTimeout; // --------------------------------------------------------------------------------------------- private RemoteSource(Builder builder) { - this.connectTimeout = ApiTypeHelper.requireNonNull(builder.connectTimeout, this, "connectTimeout"); + this.connectTimeout = builder.connectTimeout; + this.headers = ApiTypeHelper.unmodifiable(builder.headers); this.host = ApiTypeHelper.requireNonNull(builder.host, this, "host"); - this.username = ApiTypeHelper.requireNonNull(builder.username, this, "username"); - this.password = ApiTypeHelper.requireNonNull(builder.password, this, "password"); - this.socketTimeout = ApiTypeHelper.requireNonNull(builder.socketTimeout, this, "socketTimeout"); + this.username = builder.username; + this.password = builder.password; + this.socketTimeout = builder.socketTimeout; } @@ -76,12 +84,20 @@ public static RemoteSource of(Function> fn) } /** - * Required - API name: {@code connect_timeout} + * API name: {@code connect_timeout} */ + @Nullable public final Time connectTimeout() { return this.connectTimeout; } + /** + * API name: {@code headers} + */ + public final Map headers() { + return this.headers; + } + /** * Required - API name: {@code host} */ @@ -90,22 +106,25 @@ public final String host() { } /** - * Required - API name: {@code username} + * API name: {@code username} */ + @Nullable public final String username() { return this.username; } /** - * Required - API name: {@code password} + * API name: {@code password} */ + @Nullable public final String password() { return this.password; } /** - * Required - API name: {@code socket_timeout} + * API name: {@code socket_timeout} */ + @Nullable public final Time socketTimeout() { return this.socketTimeout; } @@ -121,20 +140,40 @@ public void serialize(JsonGenerator generator, JsonpMapper mapper) { protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { - generator.writeKey("connect_timeout"); - this.connectTimeout.serialize(generator, mapper); + if (this.connectTimeout != null) { + generator.writeKey("connect_timeout"); + this.connectTimeout.serialize(generator, mapper); + + } + if (ApiTypeHelper.isDefined(this.headers)) { + generator.writeKey("headers"); + generator.writeStartObject(); + for (Map.Entry item0 : this.headers.entrySet()) { + generator.writeKey(item0.getKey()); + generator.write(item0.getValue()); + + } + generator.writeEnd(); + } generator.writeKey("host"); generator.write(this.host); - generator.writeKey("username"); - generator.write(this.username); + if (this.username != null) { + generator.writeKey("username"); + generator.write(this.username); - generator.writeKey("password"); - generator.write(this.password); + } + if (this.password != null) { + generator.writeKey("password"); + generator.write(this.password); + + } + if (this.socketTimeout != null) { + generator.writeKey("socket_timeout"); + this.socketTimeout.serialize(generator, mapper); - generator.writeKey("socket_timeout"); - this.socketTimeout.serialize(generator, mapper); + } } @@ -150,31 +189,58 @@ public String toString() { */ public static class Builder extends WithJsonObjectBuilderBase implements ObjectBuilder { + @Nullable private Time connectTimeout; + @Nullable + private Map headers; + private String host; + @Nullable private String username; + @Nullable private String password; + @Nullable private Time socketTimeout; /** - * Required - API name: {@code connect_timeout} + * API name: {@code connect_timeout} */ - public final Builder connectTimeout(Time value) { + public final Builder connectTimeout(@Nullable Time value) { this.connectTimeout = value; return this; } /** - * Required - API name: {@code connect_timeout} + * API name: {@code connect_timeout} */ public final Builder connectTimeout(Function> fn) { return this.connectTimeout(fn.apply(new Time.Builder()).build()); } + /** + * API name: {@code headers} + *

+ * Adds all entries of map to headers. + */ + public final Builder headers(Map map) { + this.headers = _mapPutAll(this.headers, map); + return this; + } + + /** + * API name: {@code headers} + *

+ * Adds an entry to headers. + */ + public final Builder headers(String key, String value) { + this.headers = _mapPut(this.headers, key, value); + return this; + } + /** * Required - API name: {@code host} */ @@ -184,31 +250,31 @@ public final Builder host(String value) { } /** - * Required - API name: {@code username} + * API name: {@code username} */ - public final Builder username(String value) { + public final Builder username(@Nullable String value) { this.username = value; return this; } /** - * Required - API name: {@code password} + * API name: {@code password} */ - public final Builder password(String value) { + public final Builder password(@Nullable String value) { this.password = value; return this; } /** - * Required - API name: {@code socket_timeout} + * API name: {@code socket_timeout} */ - public final Builder socketTimeout(Time value) { + public final Builder socketTimeout(@Nullable Time value) { this.socketTimeout = value; return this; } /** - * Required - API name: {@code socket_timeout} + * API name: {@code socket_timeout} */ public final Builder socketTimeout(Function> fn) { return this.socketTimeout(fn.apply(new Time.Builder()).build()); @@ -243,6 +309,8 @@ public RemoteSource build() { protected static void setupRemoteSourceDeserializer(ObjectDeserializer op) { op.add(Builder::connectTimeout, Time._DESERIALIZER, "connect_timeout"); + op.add(Builder::headers, JsonpDeserializer.stringMapDeserializer(JsonpDeserializer.stringDeserializer()), + "headers"); op.add(Builder::host, JsonpDeserializer.stringDeserializer(), "host"); op.add(Builder::username, JsonpDeserializer.stringDeserializer(), "username"); op.add(Builder::password, JsonpDeserializer.stringDeserializer(), "password"); diff --git a/java-client/src/main/java/co/elastic/clients/elasticsearch/core/search/Highlight.java b/java-client/src/main/java/co/elastic/clients/elasticsearch/core/search/Highlight.java index 892e01f2b..ea4b2c6d0 100644 --- a/java-client/src/main/java/co/elastic/clients/elasticsearch/core/search/Highlight.java +++ b/java-client/src/main/java/co/elastic/clients/elasticsearch/core/search/Highlight.java @@ -23,22 +23,15 @@ package co.elastic.clients.elasticsearch.core.search; -import co.elastic.clients.elasticsearch._types.query_dsl.Query; 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.lang.Integer; import java.lang.String; -import java.util.List; import java.util.Map; import java.util.Objects; import java.util.function.Function; @@ -53,88 +46,19 @@ * specification */ @JsonpDeserializable -public class Highlight implements JsonpSerializable { - private final Map fields; - - @Nullable - private final HighlighterType type; - - @Nullable - private final String boundaryChars; - - @Nullable - private final Integer boundaryMaxScan; - - @Nullable - private final BoundaryScanner boundaryScanner; - - @Nullable - private final String boundaryScannerLocale; - +public class Highlight extends HighlightBase { @Nullable private final HighlighterEncoder encoder; - @Nullable - private final HighlighterFragmenter fragmenter; - - @Nullable - private final Integer fragmentOffset; - - @Nullable - private final Integer fragmentSize; - - @Nullable - private final Integer maxFragmentLength; - - @Nullable - private final Integer noMatchSize; - - @Nullable - private final Integer numberOfFragments; - - @Nullable - private final HighlighterOrder order; - - private final List postTags; - - private final List preTags; - - @Nullable - private final Boolean requireFieldMatch; - - @Nullable - private final HighlighterTagsSchema tagsSchema; - - @Nullable - private final Query highlightQuery; - - @Nullable - private final String maxAnalyzedOffset; + private final Map fields; // --------------------------------------------------------------------------------------------- private Highlight(Builder builder) { + super(builder); - this.fields = ApiTypeHelper.unmodifiableRequired(builder.fields, this, "fields"); - this.type = builder.type; - this.boundaryChars = builder.boundaryChars; - this.boundaryMaxScan = builder.boundaryMaxScan; - this.boundaryScanner = builder.boundaryScanner; - this.boundaryScannerLocale = builder.boundaryScannerLocale; this.encoder = builder.encoder; - this.fragmenter = builder.fragmenter; - this.fragmentOffset = builder.fragmentOffset; - this.fragmentSize = builder.fragmentSize; - this.maxFragmentLength = builder.maxFragmentLength; - this.noMatchSize = builder.noMatchSize; - this.numberOfFragments = builder.numberOfFragments; - this.order = builder.order; - this.postTags = ApiTypeHelper.unmodifiable(builder.postTags); - this.preTags = ApiTypeHelper.unmodifiable(builder.preTags); - this.requireFieldMatch = builder.requireFieldMatch; - this.tagsSchema = builder.tagsSchema; - this.highlightQuery = builder.highlightQuery; - this.maxAnalyzedOffset = builder.maxAnalyzedOffset; + this.fields = ApiTypeHelper.unmodifiableRequired(builder.fields, this, "fields"); } @@ -142,53 +66,6 @@ public static Highlight of(Function> fn) { return fn.apply(new Builder()).build(); } - /** - * Required - API name: {@code fields} - */ - public final Map fields() { - return this.fields; - } - - /** - * API name: {@code type} - */ - @Nullable - public final HighlighterType type() { - return this.type; - } - - /** - * API name: {@code boundary_chars} - */ - @Nullable - public final String boundaryChars() { - return this.boundaryChars; - } - - /** - * API name: {@code boundary_max_scan} - */ - @Nullable - public final Integer boundaryMaxScan() { - return this.boundaryMaxScan; - } - - /** - * API name: {@code boundary_scanner} - */ - @Nullable - public final BoundaryScanner boundaryScanner() { - return this.boundaryScanner; - } - - /** - * API name: {@code boundary_scanner_locale} - */ - @Nullable - public final String boundaryScannerLocale() { - return this.boundaryScannerLocale; - } - /** * API name: {@code encoder} */ @@ -198,118 +75,19 @@ public final HighlighterEncoder encoder() { } /** - * API name: {@code fragmenter} - */ - @Nullable - public final HighlighterFragmenter fragmenter() { - return this.fragmenter; - } - - /** - * API name: {@code fragment_offset} - */ - @Nullable - public final Integer fragmentOffset() { - return this.fragmentOffset; - } - - /** - * API name: {@code fragment_size} - */ - @Nullable - public final Integer fragmentSize() { - return this.fragmentSize; - } - - /** - * API name: {@code max_fragment_length} - */ - @Nullable - public final Integer maxFragmentLength() { - return this.maxFragmentLength; - } - - /** - * API name: {@code no_match_size} - */ - @Nullable - public final Integer noMatchSize() { - return this.noMatchSize; - } - - /** - * API name: {@code number_of_fragments} - */ - @Nullable - public final Integer numberOfFragments() { - return this.numberOfFragments; - } - - /** - * API name: {@code order} - */ - @Nullable - public final HighlighterOrder order() { - return this.order; - } - - /** - * API name: {@code post_tags} - */ - public final List postTags() { - return this.postTags; - } - - /** - * API name: {@code pre_tags} - */ - public final List preTags() { - return this.preTags; - } - - /** - * API name: {@code require_field_match} - */ - @Nullable - public final Boolean requireFieldMatch() { - return this.requireFieldMatch; - } - - /** - * API name: {@code tags_schema} - */ - @Nullable - public final HighlighterTagsSchema tagsSchema() { - return this.tagsSchema; - } - - /** - * API name: {@code highlight_query} - */ - @Nullable - public final Query highlightQuery() { - return this.highlightQuery; - } - - /** - * API name: {@code max_analyzed_offset} - */ - @Nullable - public final String maxAnalyzedOffset() { - return this.maxAnalyzedOffset; - } - - /** - * Serialize this object to JSON. + * Required - API name: {@code fields} */ - public void serialize(JsonGenerator generator, JsonpMapper mapper) { - generator.writeStartObject(); - serializeInternal(generator, mapper); - generator.writeEnd(); + public final Map fields() { + return this.fields; } protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { + super.serializeInternal(generator, mapper); + if (this.encoder != null) { + generator.writeKey("encoder"); + this.encoder.serialize(generator, mapper); + } if (ApiTypeHelper.isDefined(this.fields)) { generator.writeKey("fields"); generator.writeStartObject(); @@ -321,179 +99,28 @@ protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { generator.writeEnd(); } - if (this.type != null) { - generator.writeKey("type"); - this.type.serialize(generator, mapper); - - } - if (this.boundaryChars != null) { - generator.writeKey("boundary_chars"); - generator.write(this.boundaryChars); - - } - if (this.boundaryMaxScan != null) { - generator.writeKey("boundary_max_scan"); - generator.write(this.boundaryMaxScan); - - } - if (this.boundaryScanner != null) { - generator.writeKey("boundary_scanner"); - this.boundaryScanner.serialize(generator, mapper); - } - if (this.boundaryScannerLocale != null) { - generator.writeKey("boundary_scanner_locale"); - generator.write(this.boundaryScannerLocale); - - } - if (this.encoder != null) { - generator.writeKey("encoder"); - this.encoder.serialize(generator, mapper); - } - if (this.fragmenter != null) { - generator.writeKey("fragmenter"); - this.fragmenter.serialize(generator, mapper); - } - if (this.fragmentOffset != null) { - generator.writeKey("fragment_offset"); - generator.write(this.fragmentOffset); - - } - if (this.fragmentSize != null) { - generator.writeKey("fragment_size"); - generator.write(this.fragmentSize); - - } - if (this.maxFragmentLength != null) { - generator.writeKey("max_fragment_length"); - generator.write(this.maxFragmentLength); - - } - if (this.noMatchSize != null) { - generator.writeKey("no_match_size"); - generator.write(this.noMatchSize); - - } - if (this.numberOfFragments != null) { - generator.writeKey("number_of_fragments"); - generator.write(this.numberOfFragments); - - } - if (this.order != null) { - generator.writeKey("order"); - this.order.serialize(generator, mapper); - } - if (ApiTypeHelper.isDefined(this.postTags)) { - generator.writeKey("post_tags"); - generator.writeStartArray(); - for (String item0 : this.postTags) { - generator.write(item0); - - } - generator.writeEnd(); - - } - if (ApiTypeHelper.isDefined(this.preTags)) { - generator.writeKey("pre_tags"); - generator.writeStartArray(); - for (String item0 : this.preTags) { - generator.write(item0); - - } - generator.writeEnd(); - - } - if (this.requireFieldMatch != null) { - generator.writeKey("require_field_match"); - generator.write(this.requireFieldMatch); - - } - if (this.tagsSchema != null) { - generator.writeKey("tags_schema"); - this.tagsSchema.serialize(generator, mapper); - } - if (this.highlightQuery != null) { - generator.writeKey("highlight_query"); - this.highlightQuery.serialize(generator, mapper); - - } - if (this.maxAnalyzedOffset != null) { - generator.writeKey("max_analyzed_offset"); - generator.write(this.maxAnalyzedOffset); - - } } - @Override - public String toString() { - return JsonpUtils.toString(this); - } - // --------------------------------------------------------------------------------------------- /** * Builder for {@link Highlight}. */ - public static class Builder extends WithJsonObjectBuilderBase implements ObjectBuilder { - private Map fields; - - @Nullable - private HighlighterType type; - - @Nullable - private String boundaryChars; - - @Nullable - private Integer boundaryMaxScan; - - @Nullable - private BoundaryScanner boundaryScanner; - - @Nullable - private String boundaryScannerLocale; - + public static class Builder extends HighlightBase.AbstractBuilder implements ObjectBuilder { @Nullable private HighlighterEncoder encoder; - @Nullable - private HighlighterFragmenter fragmenter; - - @Nullable - private Integer fragmentOffset; - - @Nullable - private Integer fragmentSize; - - @Nullable - private Integer maxFragmentLength; - - @Nullable - private Integer noMatchSize; - - @Nullable - private Integer numberOfFragments; - - @Nullable - private HighlighterOrder order; - - @Nullable - private List postTags; - - @Nullable - private List preTags; - - @Nullable - private Boolean requireFieldMatch; - - @Nullable - private HighlighterTagsSchema tagsSchema; - - @Nullable - private Query highlightQuery; + private Map fields; - @Nullable - private String maxAnalyzedOffset; + /** + * API name: {@code encoder} + */ + public final Builder encoder(@Nullable HighlighterEncoder value) { + this.encoder = value; + return this; + } /** * Required - API name: {@code fields} @@ -524,196 +151,6 @@ public final Builder fields(String key, Function> fn) { - return this.type(fn.apply(new HighlighterType.Builder()).build()); - } - - /** - * API name: {@code boundary_chars} - */ - public final Builder boundaryChars(@Nullable String value) { - this.boundaryChars = value; - return this; - } - - /** - * API name: {@code boundary_max_scan} - */ - public final Builder boundaryMaxScan(@Nullable Integer value) { - this.boundaryMaxScan = value; - return this; - } - - /** - * API name: {@code boundary_scanner} - */ - public final Builder boundaryScanner(@Nullable BoundaryScanner value) { - this.boundaryScanner = value; - return this; - } - - /** - * API name: {@code boundary_scanner_locale} - */ - public final Builder boundaryScannerLocale(@Nullable String value) { - this.boundaryScannerLocale = value; - return this; - } - - /** - * API name: {@code encoder} - */ - public final Builder encoder(@Nullable HighlighterEncoder value) { - this.encoder = value; - return this; - } - - /** - * API name: {@code fragmenter} - */ - public final Builder fragmenter(@Nullable HighlighterFragmenter value) { - this.fragmenter = value; - return this; - } - - /** - * API name: {@code fragment_offset} - */ - public final Builder fragmentOffset(@Nullable Integer value) { - this.fragmentOffset = value; - return this; - } - - /** - * API name: {@code fragment_size} - */ - public final Builder fragmentSize(@Nullable Integer value) { - this.fragmentSize = value; - return this; - } - - /** - * API name: {@code max_fragment_length} - */ - public final Builder maxFragmentLength(@Nullable Integer value) { - this.maxFragmentLength = value; - return this; - } - - /** - * API name: {@code no_match_size} - */ - public final Builder noMatchSize(@Nullable Integer value) { - this.noMatchSize = value; - return this; - } - - /** - * API name: {@code number_of_fragments} - */ - public final Builder numberOfFragments(@Nullable Integer value) { - this.numberOfFragments = value; - return this; - } - - /** - * API name: {@code order} - */ - public final Builder order(@Nullable HighlighterOrder value) { - this.order = value; - return this; - } - - /** - * API name: {@code post_tags} - *

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

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

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

- * Adds one or more values to preTags. - */ - public final Builder preTags(String value, String... values) { - this.preTags = _listAdd(this.preTags, value, values); - return this; - } - - /** - * API name: {@code require_field_match} - */ - public final Builder requireFieldMatch(@Nullable Boolean value) { - this.requireFieldMatch = value; - return this; - } - - /** - * API name: {@code tags_schema} - */ - public final Builder tagsSchema(@Nullable HighlighterTagsSchema value) { - this.tagsSchema = value; - return this; - } - - /** - * API name: {@code highlight_query} - */ - public final Builder highlightQuery(@Nullable Query value) { - this.highlightQuery = value; - return this; - } - - /** - * API name: {@code highlight_query} - */ - public final Builder highlightQuery(Function> fn) { - return this.highlightQuery(fn.apply(new Query.Builder()).build()); - } - - /** - * API name: {@code max_analyzed_offset} - */ - public final Builder maxAnalyzedOffset(@Nullable String value) { - this.maxAnalyzedOffset = value; - return this; - } - @Override protected Builder self() { return this; @@ -741,29 +178,9 @@ public Highlight build() { Highlight::setupHighlightDeserializer); protected static void setupHighlightDeserializer(ObjectDeserializer op) { - - op.add(Builder::fields, JsonpDeserializer.stringMapDeserializer(HighlightField._DESERIALIZER), "fields"); - op.add(Builder::type, HighlighterType._DESERIALIZER, "type"); - op.add(Builder::boundaryChars, JsonpDeserializer.stringDeserializer(), "boundary_chars"); - op.add(Builder::boundaryMaxScan, JsonpDeserializer.integerDeserializer(), "boundary_max_scan"); - op.add(Builder::boundaryScanner, BoundaryScanner._DESERIALIZER, "boundary_scanner"); - op.add(Builder::boundaryScannerLocale, JsonpDeserializer.stringDeserializer(), "boundary_scanner_locale"); + HighlightBase.setupHighlightBaseDeserializer(op); op.add(Builder::encoder, HighlighterEncoder._DESERIALIZER, "encoder"); - op.add(Builder::fragmenter, HighlighterFragmenter._DESERIALIZER, "fragmenter"); - op.add(Builder::fragmentOffset, JsonpDeserializer.integerDeserializer(), "fragment_offset"); - op.add(Builder::fragmentSize, JsonpDeserializer.integerDeserializer(), "fragment_size"); - op.add(Builder::maxFragmentLength, JsonpDeserializer.integerDeserializer(), "max_fragment_length"); - op.add(Builder::noMatchSize, JsonpDeserializer.integerDeserializer(), "no_match_size"); - op.add(Builder::numberOfFragments, JsonpDeserializer.integerDeserializer(), "number_of_fragments"); - op.add(Builder::order, HighlighterOrder._DESERIALIZER, "order"); - op.add(Builder::postTags, JsonpDeserializer.arrayDeserializer(JsonpDeserializer.stringDeserializer()), - "post_tags"); - op.add(Builder::preTags, JsonpDeserializer.arrayDeserializer(JsonpDeserializer.stringDeserializer()), - "pre_tags"); - op.add(Builder::requireFieldMatch, JsonpDeserializer.booleanDeserializer(), "require_field_match"); - op.add(Builder::tagsSchema, HighlighterTagsSchema._DESERIALIZER, "tags_schema"); - op.add(Builder::highlightQuery, Query._DESERIALIZER, "highlight_query"); - op.add(Builder::maxAnalyzedOffset, JsonpDeserializer.stringDeserializer(), "max_analyzed_offset"); + op.add(Builder::fields, JsonpDeserializer.stringMapDeserializer(HighlightField._DESERIALIZER), "fields"); } diff --git a/java-client/src/main/java/co/elastic/clients/elasticsearch/core/search/HighlightBase.java b/java-client/src/main/java/co/elastic/clients/elasticsearch/core/search/HighlightBase.java new file mode 100644 index 000000000..bda955d3f --- /dev/null +++ b/java-client/src/main/java/co/elastic/clients/elasticsearch/core/search/HighlightBase.java @@ -0,0 +1,766 @@ +/* + * 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. + */ + +//---------------------------------------------------- +// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. +//---------------------------------------------------- + +package co.elastic.clients.elasticsearch.core.search; + +import co.elastic.clients.elasticsearch._types.query_dsl.Query; +import co.elastic.clients.json.JsonData; +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.lang.Integer; +import java.lang.String; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.function.Function; +import javax.annotation.Nullable; + +// typedef: _global.search._types.HighlightBase + +/** + * + * @see API + * specification + */ + +public abstract class HighlightBase implements JsonpSerializable { + @Nullable + private final HighlighterType type; + + @Nullable + private final String boundaryChars; + + @Nullable + private final Integer boundaryMaxScan; + + @Nullable + private final BoundaryScanner boundaryScanner; + + @Nullable + private final String boundaryScannerLocale; + + @Nullable + private final Boolean forceSource; + + @Nullable + private final HighlighterFragmenter fragmenter; + + @Nullable + private final Integer fragmentSize; + + @Nullable + private final Boolean highlightFilter; + + @Nullable + private final Query highlightQuery; + + @Nullable + private final Integer maxFragmentLength; + + @Nullable + private final Integer maxAnalyzedOffset; + + @Nullable + private final Integer noMatchSize; + + @Nullable + private final Integer numberOfFragments; + + private final Map options; + + @Nullable + private final HighlighterOrder order; + + @Nullable + private final Integer phraseLimit; + + private final List postTags; + + private final List preTags; + + @Nullable + private final Boolean requireFieldMatch; + + @Nullable + private final HighlighterTagsSchema tagsSchema; + + // --------------------------------------------------------------------------------------------- + + protected HighlightBase(AbstractBuilder builder) { + + this.type = builder.type; + this.boundaryChars = builder.boundaryChars; + this.boundaryMaxScan = builder.boundaryMaxScan; + this.boundaryScanner = builder.boundaryScanner; + this.boundaryScannerLocale = builder.boundaryScannerLocale; + this.forceSource = builder.forceSource; + this.fragmenter = builder.fragmenter; + this.fragmentSize = builder.fragmentSize; + this.highlightFilter = builder.highlightFilter; + this.highlightQuery = builder.highlightQuery; + this.maxFragmentLength = builder.maxFragmentLength; + this.maxAnalyzedOffset = builder.maxAnalyzedOffset; + this.noMatchSize = builder.noMatchSize; + this.numberOfFragments = builder.numberOfFragments; + this.options = ApiTypeHelper.unmodifiable(builder.options); + this.order = builder.order; + this.phraseLimit = builder.phraseLimit; + this.postTags = ApiTypeHelper.unmodifiable(builder.postTags); + this.preTags = ApiTypeHelper.unmodifiable(builder.preTags); + this.requireFieldMatch = builder.requireFieldMatch; + this.tagsSchema = builder.tagsSchema; + + } + + /** + * API name: {@code type} + */ + @Nullable + public final HighlighterType type() { + return this.type; + } + + /** + * API name: {@code boundary_chars} + */ + @Nullable + public final String boundaryChars() { + return this.boundaryChars; + } + + /** + * API name: {@code boundary_max_scan} + */ + @Nullable + public final Integer boundaryMaxScan() { + return this.boundaryMaxScan; + } + + /** + * API name: {@code boundary_scanner} + */ + @Nullable + public final BoundaryScanner boundaryScanner() { + return this.boundaryScanner; + } + + /** + * API name: {@code boundary_scanner_locale} + */ + @Nullable + public final String boundaryScannerLocale() { + return this.boundaryScannerLocale; + } + + /** + * API name: {@code force_source} + */ + @Nullable + public final Boolean forceSource() { + return this.forceSource; + } + + /** + * API name: {@code fragmenter} + */ + @Nullable + public final HighlighterFragmenter fragmenter() { + return this.fragmenter; + } + + /** + * API name: {@code fragment_size} + */ + @Nullable + public final Integer fragmentSize() { + return this.fragmentSize; + } + + /** + * API name: {@code highlight_filter} + */ + @Nullable + public final Boolean highlightFilter() { + return this.highlightFilter; + } + + /** + * API name: {@code highlight_query} + */ + @Nullable + public final Query highlightQuery() { + return this.highlightQuery; + } + + /** + * API name: {@code max_fragment_length} + */ + @Nullable + public final Integer maxFragmentLength() { + return this.maxFragmentLength; + } + + /** + * API name: {@code max_analyzed_offset} + */ + @Nullable + public final Integer maxAnalyzedOffset() { + return this.maxAnalyzedOffset; + } + + /** + * API name: {@code no_match_size} + */ + @Nullable + public final Integer noMatchSize() { + return this.noMatchSize; + } + + /** + * API name: {@code number_of_fragments} + */ + @Nullable + public final Integer numberOfFragments() { + return this.numberOfFragments; + } + + /** + * API name: {@code options} + */ + public final Map options() { + return this.options; + } + + /** + * API name: {@code order} + */ + @Nullable + public final HighlighterOrder order() { + return this.order; + } + + /** + * API name: {@code phrase_limit} + */ + @Nullable + public final Integer phraseLimit() { + return this.phraseLimit; + } + + /** + * API name: {@code post_tags} + */ + public final List postTags() { + return this.postTags; + } + + /** + * API name: {@code pre_tags} + */ + public final List preTags() { + return this.preTags; + } + + /** + * API name: {@code require_field_match} + */ + @Nullable + public final Boolean requireFieldMatch() { + return this.requireFieldMatch; + } + + /** + * API name: {@code tags_schema} + */ + @Nullable + public final HighlighterTagsSchema tagsSchema() { + return this.tagsSchema; + } + + /** + * 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 (this.type != null) { + generator.writeKey("type"); + this.type.serialize(generator, mapper); + + } + if (this.boundaryChars != null) { + generator.writeKey("boundary_chars"); + generator.write(this.boundaryChars); + + } + if (this.boundaryMaxScan != null) { + generator.writeKey("boundary_max_scan"); + generator.write(this.boundaryMaxScan); + + } + if (this.boundaryScanner != null) { + generator.writeKey("boundary_scanner"); + this.boundaryScanner.serialize(generator, mapper); + } + if (this.boundaryScannerLocale != null) { + generator.writeKey("boundary_scanner_locale"); + generator.write(this.boundaryScannerLocale); + + } + if (this.forceSource != null) { + generator.writeKey("force_source"); + generator.write(this.forceSource); + + } + if (this.fragmenter != null) { + generator.writeKey("fragmenter"); + this.fragmenter.serialize(generator, mapper); + } + if (this.fragmentSize != null) { + generator.writeKey("fragment_size"); + generator.write(this.fragmentSize); + + } + if (this.highlightFilter != null) { + generator.writeKey("highlight_filter"); + generator.write(this.highlightFilter); + + } + if (this.highlightQuery != null) { + generator.writeKey("highlight_query"); + this.highlightQuery.serialize(generator, mapper); + + } + if (this.maxFragmentLength != null) { + generator.writeKey("max_fragment_length"); + generator.write(this.maxFragmentLength); + + } + if (this.maxAnalyzedOffset != null) { + generator.writeKey("max_analyzed_offset"); + generator.write(this.maxAnalyzedOffset); + + } + if (this.noMatchSize != null) { + generator.writeKey("no_match_size"); + generator.write(this.noMatchSize); + + } + if (this.numberOfFragments != null) { + generator.writeKey("number_of_fragments"); + generator.write(this.numberOfFragments); + + } + if (ApiTypeHelper.isDefined(this.options)) { + generator.writeKey("options"); + generator.writeStartObject(); + for (Map.Entry item0 : this.options.entrySet()) { + generator.writeKey(item0.getKey()); + item0.getValue().serialize(generator, mapper); + + } + generator.writeEnd(); + + } + if (this.order != null) { + generator.writeKey("order"); + this.order.serialize(generator, mapper); + } + if (this.phraseLimit != null) { + generator.writeKey("phrase_limit"); + generator.write(this.phraseLimit); + + } + if (ApiTypeHelper.isDefined(this.postTags)) { + generator.writeKey("post_tags"); + generator.writeStartArray(); + for (String item0 : this.postTags) { + generator.write(item0); + + } + generator.writeEnd(); + + } + if (ApiTypeHelper.isDefined(this.preTags)) { + generator.writeKey("pre_tags"); + generator.writeStartArray(); + for (String item0 : this.preTags) { + generator.write(item0); + + } + generator.writeEnd(); + + } + if (this.requireFieldMatch != null) { + generator.writeKey("require_field_match"); + generator.write(this.requireFieldMatch); + + } + if (this.tagsSchema != null) { + generator.writeKey("tags_schema"); + this.tagsSchema.serialize(generator, mapper); + } + + } + + @Override + public String toString() { + return JsonpUtils.toString(this); + } + + protected abstract static class AbstractBuilder> + extends + WithJsonObjectBuilderBase { + @Nullable + private HighlighterType type; + + @Nullable + private String boundaryChars; + + @Nullable + private Integer boundaryMaxScan; + + @Nullable + private BoundaryScanner boundaryScanner; + + @Nullable + private String boundaryScannerLocale; + + @Nullable + private Boolean forceSource; + + @Nullable + private HighlighterFragmenter fragmenter; + + @Nullable + private Integer fragmentSize; + + @Nullable + private Boolean highlightFilter; + + @Nullable + private Query highlightQuery; + + @Nullable + private Integer maxFragmentLength; + + @Nullable + private Integer maxAnalyzedOffset; + + @Nullable + private Integer noMatchSize; + + @Nullable + private Integer numberOfFragments; + + @Nullable + private Map options; + + @Nullable + private HighlighterOrder order; + + @Nullable + private Integer phraseLimit; + + @Nullable + private List postTags; + + @Nullable + private List preTags; + + @Nullable + private Boolean requireFieldMatch; + + @Nullable + private HighlighterTagsSchema tagsSchema; + + /** + * API name: {@code type} + */ + public final BuilderT type(@Nullable HighlighterType value) { + this.type = value; + return self(); + } + + /** + * API name: {@code type} + */ + public final BuilderT type(Function> fn) { + return this.type(fn.apply(new HighlighterType.Builder()).build()); + } + + /** + * API name: {@code boundary_chars} + */ + public final BuilderT boundaryChars(@Nullable String value) { + this.boundaryChars = value; + return self(); + } + + /** + * API name: {@code boundary_max_scan} + */ + public final BuilderT boundaryMaxScan(@Nullable Integer value) { + this.boundaryMaxScan = value; + return self(); + } + + /** + * API name: {@code boundary_scanner} + */ + public final BuilderT boundaryScanner(@Nullable BoundaryScanner value) { + this.boundaryScanner = value; + return self(); + } + + /** + * API name: {@code boundary_scanner_locale} + */ + public final BuilderT boundaryScannerLocale(@Nullable String value) { + this.boundaryScannerLocale = value; + return self(); + } + + /** + * API name: {@code force_source} + */ + public final BuilderT forceSource(@Nullable Boolean value) { + this.forceSource = value; + return self(); + } + + /** + * API name: {@code fragmenter} + */ + public final BuilderT fragmenter(@Nullable HighlighterFragmenter value) { + this.fragmenter = value; + return self(); + } + + /** + * API name: {@code fragment_size} + */ + public final BuilderT fragmentSize(@Nullable Integer value) { + this.fragmentSize = value; + return self(); + } + + /** + * API name: {@code highlight_filter} + */ + public final BuilderT highlightFilter(@Nullable Boolean value) { + this.highlightFilter = value; + return self(); + } + + /** + * API name: {@code highlight_query} + */ + public final BuilderT highlightQuery(@Nullable Query value) { + this.highlightQuery = value; + return self(); + } + + /** + * API name: {@code highlight_query} + */ + public final BuilderT highlightQuery(Function> fn) { + return this.highlightQuery(fn.apply(new Query.Builder()).build()); + } + + /** + * API name: {@code max_fragment_length} + */ + public final BuilderT maxFragmentLength(@Nullable Integer value) { + this.maxFragmentLength = value; + return self(); + } + + /** + * API name: {@code max_analyzed_offset} + */ + public final BuilderT maxAnalyzedOffset(@Nullable Integer value) { + this.maxAnalyzedOffset = value; + return self(); + } + + /** + * API name: {@code no_match_size} + */ + public final BuilderT noMatchSize(@Nullable Integer value) { + this.noMatchSize = value; + return self(); + } + + /** + * API name: {@code number_of_fragments} + */ + public final BuilderT numberOfFragments(@Nullable Integer value) { + this.numberOfFragments = value; + return self(); + } + + /** + * API name: {@code options} + *

+ * Adds all entries of map to options. + */ + public final BuilderT options(Map map) { + this.options = _mapPutAll(this.options, map); + return self(); + } + + /** + * API name: {@code options} + *

+ * Adds an entry to options. + */ + public final BuilderT options(String key, JsonData value) { + this.options = _mapPut(this.options, key, value); + return self(); + } + + /** + * API name: {@code order} + */ + public final BuilderT order(@Nullable HighlighterOrder value) { + this.order = value; + return self(); + } + + /** + * API name: {@code phrase_limit} + */ + public final BuilderT phraseLimit(@Nullable Integer value) { + this.phraseLimit = value; + return self(); + } + + /** + * API name: {@code post_tags} + *

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

+ * Adds one or more values to postTags. + */ + public final BuilderT postTags(String value, String... values) { + this.postTags = _listAdd(this.postTags, value, values); + return self(); + } + + /** + * API name: {@code pre_tags} + *

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

+ * Adds one or more values to preTags. + */ + public final BuilderT preTags(String value, String... values) { + this.preTags = _listAdd(this.preTags, value, values); + return self(); + } + + /** + * API name: {@code require_field_match} + */ + public final BuilderT requireFieldMatch(@Nullable Boolean value) { + this.requireFieldMatch = value; + return self(); + } + + /** + * API name: {@code tags_schema} + */ + public final BuilderT tagsSchema(@Nullable HighlighterTagsSchema value) { + this.tagsSchema = value; + return self(); + } + + protected abstract BuilderT self(); + + } + + // --------------------------------------------------------------------------------------------- + protected static > void setupHighlightBaseDeserializer( + ObjectDeserializer op) { + + op.add(AbstractBuilder::type, HighlighterType._DESERIALIZER, "type"); + op.add(AbstractBuilder::boundaryChars, JsonpDeserializer.stringDeserializer(), "boundary_chars"); + op.add(AbstractBuilder::boundaryMaxScan, JsonpDeserializer.integerDeserializer(), "boundary_max_scan"); + op.add(AbstractBuilder::boundaryScanner, BoundaryScanner._DESERIALIZER, "boundary_scanner"); + op.add(AbstractBuilder::boundaryScannerLocale, JsonpDeserializer.stringDeserializer(), + "boundary_scanner_locale"); + op.add(AbstractBuilder::forceSource, JsonpDeserializer.booleanDeserializer(), "force_source"); + op.add(AbstractBuilder::fragmenter, HighlighterFragmenter._DESERIALIZER, "fragmenter"); + op.add(AbstractBuilder::fragmentSize, JsonpDeserializer.integerDeserializer(), "fragment_size"); + op.add(AbstractBuilder::highlightFilter, JsonpDeserializer.booleanDeserializer(), "highlight_filter"); + op.add(AbstractBuilder::highlightQuery, Query._DESERIALIZER, "highlight_query"); + op.add(AbstractBuilder::maxFragmentLength, JsonpDeserializer.integerDeserializer(), "max_fragment_length"); + op.add(AbstractBuilder::maxAnalyzedOffset, JsonpDeserializer.integerDeserializer(), "max_analyzed_offset"); + op.add(AbstractBuilder::noMatchSize, JsonpDeserializer.integerDeserializer(), "no_match_size"); + op.add(AbstractBuilder::numberOfFragments, JsonpDeserializer.integerDeserializer(), "number_of_fragments"); + op.add(AbstractBuilder::options, JsonpDeserializer.stringMapDeserializer(JsonData._DESERIALIZER), "options"); + op.add(AbstractBuilder::order, HighlighterOrder._DESERIALIZER, "order"); + op.add(AbstractBuilder::phraseLimit, JsonpDeserializer.integerDeserializer(), "phrase_limit"); + op.add(AbstractBuilder::postTags, JsonpDeserializer.arrayDeserializer(JsonpDeserializer.stringDeserializer()), + "post_tags"); + op.add(AbstractBuilder::preTags, JsonpDeserializer.arrayDeserializer(JsonpDeserializer.stringDeserializer()), + "pre_tags"); + op.add(AbstractBuilder::requireFieldMatch, JsonpDeserializer.booleanDeserializer(), "require_field_match"); + op.add(AbstractBuilder::tagsSchema, HighlighterTagsSchema._DESERIALIZER, "tags_schema"); + + } + +} diff --git a/java-client/src/main/java/co/elastic/clients/elasticsearch/core/search/HighlightField.java b/java-client/src/main/java/co/elastic/clients/elasticsearch/core/search/HighlightField.java index 318c8c89c..918a1bd89 100644 --- a/java-client/src/main/java/co/elastic/clients/elasticsearch/core/search/HighlightField.java +++ b/java-client/src/main/java/co/elastic/clients/elasticsearch/core/search/HighlightField.java @@ -23,19 +23,14 @@ package co.elastic.clients.elasticsearch.core.search; -import co.elastic.clients.elasticsearch._types.query_dsl.Query; 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.lang.Integer; import java.lang.String; import java.util.List; @@ -52,92 +47,19 @@ * specification */ @JsonpDeserializable -public class HighlightField implements JsonpSerializable { - @Nullable - private final String boundaryChars; - - @Nullable - private final Integer boundaryMaxScan; - - @Nullable - private final BoundaryScanner boundaryScanner; - - @Nullable - private final String boundaryScannerLocale; - - @Nullable - private final String field; - - @Nullable - private final Boolean forceSource; - - @Nullable - private final HighlighterFragmenter fragmenter; - +public class HighlightField extends HighlightBase { @Nullable private final Integer fragmentOffset; - @Nullable - private final Integer fragmentSize; - - @Nullable - private final Query highlightQuery; - private final List matchedFields; - @Nullable - private final Integer maxFragmentLength; - - @Nullable - private final Integer noMatchSize; - - @Nullable - private final Integer numberOfFragments; - - @Nullable - private final HighlighterOrder order; - - @Nullable - private final Integer phraseLimit; - - private final List postTags; - - private final List preTags; - - @Nullable - private final Boolean requireFieldMatch; - - @Nullable - private final HighlighterTagsSchema tagsSchema; - - @Nullable - private final HighlighterType type; - // --------------------------------------------------------------------------------------------- private HighlightField(Builder builder) { + super(builder); - this.boundaryChars = builder.boundaryChars; - this.boundaryMaxScan = builder.boundaryMaxScan; - this.boundaryScanner = builder.boundaryScanner; - this.boundaryScannerLocale = builder.boundaryScannerLocale; - this.field = builder.field; - this.forceSource = builder.forceSource; - this.fragmenter = builder.fragmenter; this.fragmentOffset = builder.fragmentOffset; - this.fragmentSize = builder.fragmentSize; - this.highlightQuery = builder.highlightQuery; this.matchedFields = ApiTypeHelper.unmodifiable(builder.matchedFields); - this.maxFragmentLength = builder.maxFragmentLength; - this.noMatchSize = builder.noMatchSize; - this.numberOfFragments = builder.numberOfFragments; - this.order = builder.order; - this.phraseLimit = builder.phraseLimit; - this.postTags = ApiTypeHelper.unmodifiable(builder.postTags); - this.preTags = ApiTypeHelper.unmodifiable(builder.preTags); - this.requireFieldMatch = builder.requireFieldMatch; - this.tagsSchema = builder.tagsSchema; - this.type = builder.type; } @@ -145,62 +67,6 @@ public static HighlightField of(Function> return fn.apply(new Builder()).build(); } - /** - * API name: {@code boundary_chars} - */ - @Nullable - public final String boundaryChars() { - return this.boundaryChars; - } - - /** - * API name: {@code boundary_max_scan} - */ - @Nullable - public final Integer boundaryMaxScan() { - return this.boundaryMaxScan; - } - - /** - * API name: {@code boundary_scanner} - */ - @Nullable - public final BoundaryScanner boundaryScanner() { - return this.boundaryScanner; - } - - /** - * API name: {@code boundary_scanner_locale} - */ - @Nullable - public final String boundaryScannerLocale() { - return this.boundaryScannerLocale; - } - - /** - * API name: {@code field} - */ - @Nullable - public final String field() { - return this.field; - } - - /** - * API name: {@code force_source} - */ - @Nullable - public final Boolean forceSource() { - return this.forceSource; - } - - /** - * API name: {@code fragmenter} - */ - @Nullable - public final HighlighterFragmenter fragmenter() { - return this.fragmenter; - } - /** * API name: {@code fragment_offset} */ @@ -209,22 +75,6 @@ public final Integer fragmentOffset() { return this.fragmentOffset; } - /** - * API name: {@code fragment_size} - */ - @Nullable - public final Integer fragmentSize() { - return this.fragmentSize; - } - - /** - * API name: {@code highlight_query} - */ - @Nullable - public final Query highlightQuery() { - return this.highlightQuery; - } - /** * API name: {@code matched_fields} */ @@ -232,142 +82,13 @@ public final List matchedFields() { return this.matchedFields; } - /** - * API name: {@code max_fragment_length} - */ - @Nullable - public final Integer maxFragmentLength() { - return this.maxFragmentLength; - } - - /** - * API name: {@code no_match_size} - */ - @Nullable - public final Integer noMatchSize() { - return this.noMatchSize; - } - - /** - * API name: {@code number_of_fragments} - */ - @Nullable - public final Integer numberOfFragments() { - return this.numberOfFragments; - } - - /** - * API name: {@code order} - */ - @Nullable - public final HighlighterOrder order() { - return this.order; - } - - /** - * API name: {@code phrase_limit} - */ - @Nullable - public final Integer phraseLimit() { - return this.phraseLimit; - } - - /** - * API name: {@code post_tags} - */ - public final List postTags() { - return this.postTags; - } - - /** - * API name: {@code pre_tags} - */ - public final List preTags() { - return this.preTags; - } - - /** - * API name: {@code require_field_match} - */ - @Nullable - public final Boolean requireFieldMatch() { - return this.requireFieldMatch; - } - - /** - * API name: {@code tags_schema} - */ - @Nullable - public final HighlighterTagsSchema tagsSchema() { - return this.tagsSchema; - } - - /** - * API name: {@code type} - */ - @Nullable - public final HighlighterType type() { - return this.type; - } - - /** - * 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 (this.boundaryChars != null) { - generator.writeKey("boundary_chars"); - generator.write(this.boundaryChars); - - } - if (this.boundaryMaxScan != null) { - generator.writeKey("boundary_max_scan"); - generator.write(this.boundaryMaxScan); - - } - if (this.boundaryScanner != null) { - generator.writeKey("boundary_scanner"); - this.boundaryScanner.serialize(generator, mapper); - } - if (this.boundaryScannerLocale != null) { - generator.writeKey("boundary_scanner_locale"); - generator.write(this.boundaryScannerLocale); - - } - if (this.field != null) { - generator.writeKey("field"); - generator.write(this.field); - - } - if (this.forceSource != null) { - generator.writeKey("force_source"); - generator.write(this.forceSource); - - } - if (this.fragmenter != null) { - generator.writeKey("fragmenter"); - this.fragmenter.serialize(generator, mapper); - } + super.serializeInternal(generator, mapper); if (this.fragmentOffset != null) { generator.writeKey("fragment_offset"); generator.write(this.fragmentOffset); - } - if (this.fragmentSize != null) { - generator.writeKey("fragment_size"); - generator.write(this.fragmentSize); - - } - if (this.highlightQuery != null) { - generator.writeKey("highlight_query"); - this.highlightQuery.serialize(generator, mapper); - } if (ApiTypeHelper.isDefined(this.matchedFields)) { generator.writeKey("matched_fields"); @@ -379,70 +100,7 @@ protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { generator.writeEnd(); } - if (this.maxFragmentLength != null) { - generator.writeKey("max_fragment_length"); - generator.write(this.maxFragmentLength); - - } - if (this.noMatchSize != null) { - generator.writeKey("no_match_size"); - generator.write(this.noMatchSize); - - } - if (this.numberOfFragments != null) { - generator.writeKey("number_of_fragments"); - generator.write(this.numberOfFragments); - } - if (this.order != null) { - generator.writeKey("order"); - this.order.serialize(generator, mapper); - } - if (this.phraseLimit != null) { - generator.writeKey("phrase_limit"); - generator.write(this.phraseLimit); - - } - if (ApiTypeHelper.isDefined(this.postTags)) { - generator.writeKey("post_tags"); - generator.writeStartArray(); - for (String item0 : this.postTags) { - generator.write(item0); - - } - generator.writeEnd(); - - } - if (ApiTypeHelper.isDefined(this.preTags)) { - generator.writeKey("pre_tags"); - generator.writeStartArray(); - for (String item0 : this.preTags) { - generator.write(item0); - - } - generator.writeEnd(); - - } - if (this.requireFieldMatch != null) { - generator.writeKey("require_field_match"); - generator.write(this.requireFieldMatch); - - } - if (this.tagsSchema != null) { - generator.writeKey("tags_schema"); - this.tagsSchema.serialize(generator, mapper); - } - if (this.type != null) { - generator.writeKey("type"); - this.type.serialize(generator, mapper); - - } - - } - - @Override - public String toString() { - return JsonpUtils.toString(this); } // --------------------------------------------------------------------------------------------- @@ -451,126 +109,15 @@ public String toString() { * Builder for {@link HighlightField}. */ - public static class Builder extends WithJsonObjectBuilderBase implements ObjectBuilder { - @Nullable - private String boundaryChars; - - @Nullable - private Integer boundaryMaxScan; - - @Nullable - private BoundaryScanner boundaryScanner; - - @Nullable - private String boundaryScannerLocale; - - @Nullable - private String field; - - @Nullable - private Boolean forceSource; - - @Nullable - private HighlighterFragmenter fragmenter; - + public static class Builder extends HighlightBase.AbstractBuilder + implements + ObjectBuilder { @Nullable private Integer fragmentOffset; - @Nullable - private Integer fragmentSize; - - @Nullable - private Query highlightQuery; - @Nullable private List matchedFields; - @Nullable - private Integer maxFragmentLength; - - @Nullable - private Integer noMatchSize; - - @Nullable - private Integer numberOfFragments; - - @Nullable - private HighlighterOrder order; - - @Nullable - private Integer phraseLimit; - - @Nullable - private List postTags; - - @Nullable - private List preTags; - - @Nullable - private Boolean requireFieldMatch; - - @Nullable - private HighlighterTagsSchema tagsSchema; - - @Nullable - private HighlighterType type; - - /** - * API name: {@code boundary_chars} - */ - public final Builder boundaryChars(@Nullable String value) { - this.boundaryChars = value; - return this; - } - - /** - * API name: {@code boundary_max_scan} - */ - public final Builder boundaryMaxScan(@Nullable Integer value) { - this.boundaryMaxScan = value; - return this; - } - - /** - * API name: {@code boundary_scanner} - */ - public final Builder boundaryScanner(@Nullable BoundaryScanner value) { - this.boundaryScanner = value; - return this; - } - - /** - * API name: {@code boundary_scanner_locale} - */ - public final Builder boundaryScannerLocale(@Nullable String value) { - this.boundaryScannerLocale = value; - return this; - } - - /** - * API name: {@code field} - */ - public final Builder field(@Nullable String value) { - this.field = value; - return this; - } - - /** - * API name: {@code force_source} - */ - public final Builder forceSource(@Nullable Boolean value) { - this.forceSource = value; - return this; - } - - /** - * API name: {@code fragmenter} - */ - public final Builder fragmenter(@Nullable HighlighterFragmenter value) { - this.fragmenter = value; - return this; - } - /** * API name: {@code fragment_offset} */ @@ -579,29 +126,6 @@ public final Builder fragmentOffset(@Nullable Integer value) { return this; } - /** - * API name: {@code fragment_size} - */ - public final Builder fragmentSize(@Nullable Integer value) { - this.fragmentSize = value; - return this; - } - - /** - * API name: {@code highlight_query} - */ - public final Builder highlightQuery(@Nullable Query value) { - this.highlightQuery = value; - return this; - } - - /** - * API name: {@code highlight_query} - */ - public final Builder highlightQuery(Function> fn) { - return this.highlightQuery(fn.apply(new Query.Builder()).build()); - } - /** * API name: {@code matched_fields} *

@@ -622,117 +146,6 @@ public final Builder matchedFields(String value, String... values) { return this; } - /** - * API name: {@code max_fragment_length} - */ - public final Builder maxFragmentLength(@Nullable Integer value) { - this.maxFragmentLength = value; - return this; - } - - /** - * API name: {@code no_match_size} - */ - public final Builder noMatchSize(@Nullable Integer value) { - this.noMatchSize = value; - return this; - } - - /** - * API name: {@code number_of_fragments} - */ - public final Builder numberOfFragments(@Nullable Integer value) { - this.numberOfFragments = value; - return this; - } - - /** - * API name: {@code order} - */ - public final Builder order(@Nullable HighlighterOrder value) { - this.order = value; - return this; - } - - /** - * API name: {@code phrase_limit} - */ - public final Builder phraseLimit(@Nullable Integer value) { - this.phraseLimit = value; - return this; - } - - /** - * API name: {@code post_tags} - *

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

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

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

- * Adds one or more values to preTags. - */ - public final Builder preTags(String value, String... values) { - this.preTags = _listAdd(this.preTags, value, values); - return this; - } - - /** - * API name: {@code require_field_match} - */ - public final Builder requireFieldMatch(@Nullable Boolean value) { - this.requireFieldMatch = value; - return this; - } - - /** - * API name: {@code tags_schema} - */ - public final Builder tagsSchema(@Nullable HighlighterTagsSchema value) { - this.tagsSchema = value; - return this; - } - - /** - * API name: {@code type} - */ - public final Builder type(@Nullable HighlighterType value) { - this.type = value; - return this; - } - - /** - * API name: {@code type} - */ - public final Builder type(Function> fn) { - return this.type(fn.apply(new HighlighterType.Builder()).build()); - } - @Override protected Builder self() { return this; @@ -760,31 +173,10 @@ public HighlightField build() { HighlightField::setupHighlightFieldDeserializer); protected static void setupHighlightFieldDeserializer(ObjectDeserializer op) { - - op.add(Builder::boundaryChars, JsonpDeserializer.stringDeserializer(), "boundary_chars"); - op.add(Builder::boundaryMaxScan, JsonpDeserializer.integerDeserializer(), "boundary_max_scan"); - op.add(Builder::boundaryScanner, BoundaryScanner._DESERIALIZER, "boundary_scanner"); - op.add(Builder::boundaryScannerLocale, JsonpDeserializer.stringDeserializer(), "boundary_scanner_locale"); - op.add(Builder::field, JsonpDeserializer.stringDeserializer(), "field"); - op.add(Builder::forceSource, JsonpDeserializer.booleanDeserializer(), "force_source"); - op.add(Builder::fragmenter, HighlighterFragmenter._DESERIALIZER, "fragmenter"); + HighlightBase.setupHighlightBaseDeserializer(op); op.add(Builder::fragmentOffset, JsonpDeserializer.integerDeserializer(), "fragment_offset"); - op.add(Builder::fragmentSize, JsonpDeserializer.integerDeserializer(), "fragment_size"); - op.add(Builder::highlightQuery, Query._DESERIALIZER, "highlight_query"); op.add(Builder::matchedFields, JsonpDeserializer.arrayDeserializer(JsonpDeserializer.stringDeserializer()), "matched_fields"); - op.add(Builder::maxFragmentLength, JsonpDeserializer.integerDeserializer(), "max_fragment_length"); - op.add(Builder::noMatchSize, JsonpDeserializer.integerDeserializer(), "no_match_size"); - op.add(Builder::numberOfFragments, JsonpDeserializer.integerDeserializer(), "number_of_fragments"); - op.add(Builder::order, HighlighterOrder._DESERIALIZER, "order"); - op.add(Builder::phraseLimit, JsonpDeserializer.integerDeserializer(), "phrase_limit"); - op.add(Builder::postTags, JsonpDeserializer.arrayDeserializer(JsonpDeserializer.stringDeserializer()), - "post_tags"); - op.add(Builder::preTags, JsonpDeserializer.arrayDeserializer(JsonpDeserializer.stringDeserializer()), - "pre_tags"); - op.add(Builder::requireFieldMatch, JsonpDeserializer.booleanDeserializer(), "require_field_match"); - op.add(Builder::tagsSchema, HighlighterTagsSchema._DESERIALIZER, "tags_schema"); - op.add(Builder::type, HighlighterType._DESERIALIZER, "type"); } diff --git a/java-client/src/main/java/co/elastic/clients/elasticsearch/core/search/SuggestFuzziness.java b/java-client/src/main/java/co/elastic/clients/elasticsearch/core/search/SuggestFuzziness.java index 0e12a4975..6bab76d91 100644 --- a/java-client/src/main/java/co/elastic/clients/elasticsearch/core/search/SuggestFuzziness.java +++ b/java-client/src/main/java/co/elastic/clients/elasticsearch/core/search/SuggestFuzziness.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; @@ -51,25 +50,30 @@ */ @JsonpDeserializable public class SuggestFuzziness implements JsonpSerializable { + @Nullable private final String fuzziness; - private final int minLength; + @Nullable + private final Integer minLength; - private final int prefixLength; + @Nullable + private final Integer prefixLength; - private final boolean transpositions; + @Nullable + private final Boolean transpositions; - private final boolean unicodeAware; + @Nullable + private final Boolean unicodeAware; // --------------------------------------------------------------------------------------------- private SuggestFuzziness(Builder builder) { - this.fuzziness = ApiTypeHelper.requireNonNull(builder.fuzziness, this, "fuzziness"); - this.minLength = ApiTypeHelper.requireNonNull(builder.minLength, this, "minLength"); - this.prefixLength = ApiTypeHelper.requireNonNull(builder.prefixLength, this, "prefixLength"); - this.transpositions = ApiTypeHelper.requireNonNull(builder.transpositions, this, "transpositions"); - this.unicodeAware = ApiTypeHelper.requireNonNull(builder.unicodeAware, this, "unicodeAware"); + this.fuzziness = builder.fuzziness; + this.minLength = builder.minLength; + this.prefixLength = builder.prefixLength; + this.transpositions = builder.transpositions; + this.unicodeAware = builder.unicodeAware; } @@ -78,37 +82,42 @@ public static SuggestFuzziness of(Function implements ObjectBuilder { + @Nullable private String fuzziness; + @Nullable private Integer minLength; + @Nullable private Integer prefixLength; + @Nullable private Boolean transpositions; + @Nullable private Boolean unicodeAware; /** - * Required - API name: {@code fuzziness} + * API name: {@code fuzziness} */ - public final Builder fuzziness(String value) { + public final Builder fuzziness(@Nullable String value) { this.fuzziness = value; return this; } /** - * Required - API name: {@code min_length} + * API name: {@code min_length} */ - public final Builder minLength(int value) { + public final Builder minLength(@Nullable Integer value) { this.minLength = value; return this; } /** - * Required - API name: {@code prefix_length} + * API name: {@code prefix_length} */ - public final Builder prefixLength(int value) { + public final Builder prefixLength(@Nullable Integer value) { this.prefixLength = value; return this; } /** - * Required - API name: {@code transpositions} + * API name: {@code transpositions} */ - public final Builder transpositions(boolean value) { + public final Builder transpositions(@Nullable Boolean value) { this.transpositions = value; return this; } /** - * Required - API name: {@code unicode_aware} + * API name: {@code unicode_aware} */ - public final Builder unicodeAware(boolean value) { + public final Builder unicodeAware(@Nullable Boolean value) { this.unicodeAware = value; return this; } diff --git a/java-client/src/main/java/co/elastic/clients/elasticsearch/core/termvectors/Term.java b/java-client/src/main/java/co/elastic/clients/elasticsearch/core/termvectors/Term.java index 8473c1d0c..2741f4ed4 100644 --- a/java-client/src/main/java/co/elastic/clients/elasticsearch/core/termvectors/Term.java +++ b/java-client/src/main/java/co/elastic/clients/elasticsearch/core/termvectors/Term.java @@ -70,7 +70,7 @@ private Term(Builder builder) { this.docFreq = builder.docFreq; this.score = builder.score; this.termFreq = ApiTypeHelper.requireNonNull(builder.termFreq, this, "termFreq"); - this.tokens = ApiTypeHelper.unmodifiableRequired(builder.tokens, this, "tokens"); + this.tokens = ApiTypeHelper.unmodifiable(builder.tokens); this.ttf = builder.ttf; } @@ -103,7 +103,7 @@ public final int termFreq() { } /** - * Required - API name: {@code tokens} + * API name: {@code tokens} */ public final List tokens() { return this.tokens; @@ -179,6 +179,7 @@ public static class Builder extends WithJsonObjectBuilderBase implement private Integer termFreq; + @Nullable private List tokens; @Nullable @@ -209,7 +210,7 @@ public final Builder termFreq(int value) { } /** - * Required - API name: {@code tokens} + * API name: {@code tokens} *

* Adds all elements of list to tokens. */ @@ -219,7 +220,7 @@ public final Builder tokens(List list) { } /** - * Required - API name: {@code tokens} + * API name: {@code tokens} *

* Adds one or more values to tokens. */ @@ -229,7 +230,7 @@ public final Builder tokens(Token value, Token... values) { } /** - * Required - API name: {@code tokens} + * API name: {@code tokens} *

* Adds a value to tokens using a builder lambda. */ 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 049f57541..33ce8ffe5 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 @@ -26,7 +26,7 @@ '_global.create.Response': '_global/create/CreateResponse.ts#L22-L22', '_global.delete.Request': '_global/delete/DeleteRequest.ts#L35-L56', '_global.delete.Response': '_global/delete/DeleteResponse.ts#L22-L22', -'_global.delete_by_query.Request': '_global/delete_by_query/DeleteByQueryRequest.ts#L36-L83', +'_global.delete_by_query.Request': '_global/delete_by_query/DeleteByQueryRequest.ts#L37-L84', '_global.delete_by_query.Response': '_global/delete_by_query/DeleteByQueryResponse.ts#L25-L42', '_global.delete_by_query_rethrottle.Request': '_global/delete_by_query_rethrottle/DeleteByQueryRethrottleRequest.ts#L24-L36', '_global.delete_by_query_rethrottle.Response': '_global/delete_by_query_rethrottle/DeleteByQueryRethrottleResponse.ts#L22-L22', @@ -67,13 +67,13 @@ '_global.mget.Request': '_global/mget/MultiGetRequest.ts#L25-L92', '_global.mget.Response': '_global/mget/MultiGetResponse.ts#L22-L26', '_global.mget.ResponseItem': '_global/mget/types.ts#L59-L62', -'_global.msearch.MultiSearchItem': '_global/msearch/types.ts#L71-L74', -'_global.msearch.MultiSearchResult': '_global/msearch/types.ts#L61-L64', -'_global.msearch.MultisearchBody': '_global/msearch/types.ts#L50-L59', -'_global.msearch.MultisearchHeader': '_global/msearch/types.ts#L36-L48', -'_global.msearch.Request': '_global/msearch/MultiSearchRequest.ts#L25-L93', +'_global.msearch.MultiSearchItem': '_global/msearch/types.ts#L202-L205', +'_global.msearch.MultiSearchResult': '_global/msearch/types.ts#L192-L195', +'_global.msearch.MultisearchBody': '_global/msearch/types.ts#L69-L190', +'_global.msearch.MultisearchHeader': '_global/msearch/types.ts#L51-L66', +'_global.msearch.Request': '_global/msearch/MultiSearchRequest.ts#L31-L103', '_global.msearch.Response': '_global/msearch/MultiSearchResponse.ts#L22-L24', -'_global.msearch.ResponseItem': '_global/msearch/types.ts#L66-L69', +'_global.msearch.ResponseItem': '_global/msearch/types.ts#L197-L200', '_global.msearch_template.Request': '_global/msearch_template/MultiSearchTemplateRequest.ts#L25-L46', '_global.msearch_template.Response': '_global/msearch_template/MultiSearchTemplateResponse.ts#L22-L24', '_global.msearch_template.TemplateConfig': '_global/msearch_template/types.ts#L28-L45', @@ -104,11 +104,11 @@ '_global.rank_eval.Request': '_global/rank_eval/RankEvalRequest.ts#L24-L60', '_global.rank_eval.Response': '_global/rank_eval/RankEvalResponse.ts#L26-L34', '_global.rank_eval.UnratedDocument': '_global/rank_eval/types.ts#L148-L151', -'_global.reindex.Destination': '_global/reindex/types.ts#L38-L46', -'_global.reindex.RemoteSource': '_global/reindex/types.ts#L60-L66', +'_global.reindex.Destination': '_global/reindex/types.ts#L39-L47', +'_global.reindex.RemoteSource': '_global/reindex/types.ts#L61-L68', '_global.reindex.Request': '_global/reindex/ReindexRequest.ts#L27-L51', '_global.reindex.Response': '_global/reindex/ReindexResponse.ts#L26-L45', -'_global.reindex.Source': '_global/reindex/types.ts#L48-L58', +'_global.reindex.Source': '_global/reindex/types.ts#L49-L59', '_global.reindex_rethrottle.ReindexNode': '_global/reindex_rethrottle/types.ts#L26-L28', '_global.reindex_rethrottle.ReindexStatus': '_global/reindex_rethrottle/types.ts#L30-L42', '_global.reindex_rethrottle.ReindexTask': '_global/reindex_rethrottle/types.ts#L44-L55', @@ -121,7 +121,7 @@ '_global.scripts_painless_execute.Response': '_global/scripts_painless_execute/ExecutePainlessScriptResponse.ts#L20-L24', '_global.scroll.Request': '_global/scroll/ScrollRequest.ts#L24-L59', '_global.scroll.Response': '_global/scroll/ScrollResponse.ts#L22-L24', -'_global.search.Request': '_global/search/SearchRequest.ts#L51-L235', +'_global.search.Request': '_global/search/SearchRequest.ts#L51-L236', '_global.search.Response': '_global/search/SearchResponse.ts#L34-L36', '_global.search.ResponseBody': '_global/search/SearchResponse.ts#L38-L54', '_global.search._types.AggregationBreakdown': '_global/search/_types/profile.ts#L22-L35', @@ -129,8 +129,8 @@ '_global.search._types.AggregationProfileDebug': '_global/search/_types/profile.ts#L37-L60', '_global.search._types.AggregationProfileDelegateDebug': '_global/search/_types/profile.ts#L62-L68', '_global.search._types.AggregationProfileDelegateDebugFilter': '_global/search/_types/profile.ts#L70-L74', -'_global.search._types.BoundaryScanner': '_global/search/_types/highlighting.ts#L25-L29', -'_global.search._types.BuiltinHighlighterType': '_global/search/_types/highlighting.ts#L77-L82', +'_global.search._types.BoundaryScanner': '_global/search/_types/highlighting.ts#L26-L30', +'_global.search._types.BuiltinHighlighterType': '_global/search/_types/highlighting.ts#L82-L87', '_global.search._types.Collector': '_global/search/_types/profile.ts#L85-L90', '_global.search._types.CompletionContext': '_global/search/_types/suggester.ts#L153-L160', '_global.search._types.CompletionSuggest': '_global/search/_types/suggester.ts#L49-L54', @@ -143,13 +143,14 @@ '_global.search._types.FetchProfileDebug': '_global/search/_types/profile.ts#L156-L159', '_global.search._types.FieldCollapse': '_global/search/_types/FieldCollapse.ts#L24-L28', '_global.search._types.FieldSuggester': '_global/search/_types/suggester.ts#L103-L117', -'_global.search._types.Highlight': '_global/search/_types/highlighting.ts#L31-L54', -'_global.search._types.HighlightField': '_global/search/_types/highlighting.ts#L84-L107', -'_global.search._types.HighlighterEncoder': '_global/search/_types/highlighting.ts#L56-L59', -'_global.search._types.HighlighterFragmenter': '_global/search/_types/highlighting.ts#L61-L64', -'_global.search._types.HighlighterOrder': '_global/search/_types/highlighting.ts#L66-L68', -'_global.search._types.HighlighterTagsSchema': '_global/search/_types/highlighting.ts#L70-L72', -'_global.search._types.HighlighterType': '_global/search/_types/highlighting.ts#L74-L75', +'_global.search._types.Highlight': '_global/search/_types/highlighting.ts#L56-L59', +'_global.search._types.HighlightBase': '_global/search/_types/highlighting.ts#L32-L54', +'_global.search._types.HighlightField': '_global/search/_types/highlighting.ts#L89-L92', +'_global.search._types.HighlighterEncoder': '_global/search/_types/highlighting.ts#L61-L64', +'_global.search._types.HighlighterFragmenter': '_global/search/_types/highlighting.ts#L66-L69', +'_global.search._types.HighlighterOrder': '_global/search/_types/highlighting.ts#L71-L73', +'_global.search._types.HighlighterTagsSchema': '_global/search/_types/highlighting.ts#L75-L77', +'_global.search._types.HighlighterType': '_global/search/_types/highlighting.ts#L79-L80', '_global.search._types.Hit': '_global/search/_types/hits.ts#L41-L64', '_global.search._types.HitsMetadata': '_global/search/_types/hits.ts#L66-L72', '_global.search._types.InnerHits': '_global/search/_types/hits.ts#L107-L125', @@ -206,7 +207,7 @@ '_global.termvectors.Token': '_global/termvectors/types.ts#L42-L47', '_global.update.Request': '_global/update/UpdateRequest.ts#L39-L153', '_global.update.Response': '_global/update/UpdateResponse.ts#L23-L27', -'_global.update_by_query.Request': '_global/update_by_query/UpdateByQueryRequest.ts#L37-L86', +'_global.update_by_query.Request': '_global/update_by_query/UpdateByQueryRequest.ts#L38-L87', '_global.update_by_query.Response': '_global/update_by_query/UpdateByQueryResponse.ts#L25-L42', '_global.update_by_query_rethrottle.Request': '_global/update_by_query_rethrottle/UpdateByQueryRethrottleRequest.ts#L24-L36', '_global.update_by_query_rethrottle.Response': '_global/update_by_query_rethrottle/UpdateByQueryRethrottleResponse.ts#L23-L25', @@ -245,9 +246,9 @@ '_types.GetStats': '_types/Stats.ts#L87-L98', '_types.HealthStatus': '_types/common.ts#L195-L215', '_types.IndexingStats': '_types/Stats.ts#L100-L115', -'_types.IndicesOptions': '_types/common.ts#L289-L316', +'_types.IndicesOptions': '_types/common.ts#L291-L318', '_types.IndicesResponseBase': '_types/Base.ts#L81-L83', -'_types.InlineGet': '_types/common.ts#L278-L287', +'_types.InlineGet': '_types/common.ts#L280-L289', '_types.InlineScript': '_types/Scripting.ts#L47-L52', '_types.LatLonGeoLocation': '_types/Geo.ts#L107-L110', '_types.Level': '_types/common.ts#L225-L229', @@ -262,7 +263,7 @@ '_types.PluginStats': '_types/Stats.ts#L136-L147', '_types.QueryCacheStats': '_types/Stats.ts#L149-L158', '_types.RecoveryStats': '_types/Stats.ts#L160-L165', -'_types.Refresh': '_types/common.ts#L237-L241', +'_types.Refresh': '_types/common.ts#L236-L243', '_types.RefreshStats': '_types/Stats.ts#L167-L174', '_types.RequestBase': '_types/Base.ts#L35-L35', '_types.RequestCacheStats': '_types/Stats.ts#L176-L182', @@ -277,20 +278,22 @@ '_types.ScriptTransform': '_types/Transform.ts#L36-L39', '_types.SearchStats': '_types/Stats.ts#L184-L199', '_types.SearchTransform': '_types/Transform.ts#L41-L44', -'_types.SearchType': '_types/common.ts#L243-L248', +'_types.SearchType': '_types/common.ts#L245-L250', '_types.SegmentsStats': '_types/Stats.ts#L201-L226', '_types.ShardFailure': '_types/Errors.ts#L50-L56', '_types.ShardStatistics': '_types/Stats.ts#L32-L38', '_types.ShardsOperationResponseBase': '_types/Base.ts#L85-L87', '_types.SlicedScroll': '_types/SlicedScroll.ts#L23-L27', +'_types.Slices': '_types/common.ts#L320-L325', +'_types.SlicesCalculation': '_types/common.ts#L327-L335', '_types.SortMode': '_types/sort.ts#L101-L110', '_types.SortOptions': '_types/sort.ts#L80-L89', '_types.SortOrder': '_types/sort.ts#L112-L115', '_types.StoreStats': '_types/Stats.ts#L228-L235', '_types.StoredScript': '_types/Scripting.ts#L37-L41', '_types.StoredScriptId': '_types/Scripting.ts#L54-L56', -'_types.SuggestMode': '_types/common.ts#L250-L254', -'_types.ThreadType': '_types/common.ts#L256-L260', +'_types.SuggestMode': '_types/common.ts#L252-L256', +'_types.ThreadType': '_types/common.ts#L258-L262', '_types.Time': '_types/Time.ts#L62-L68', '_types.TimeUnit': '_types/Time.ts#L70-L85', '_types.TopLeftBottomRightGeoBounds': '_types/Geo.ts#L142-L145', @@ -298,9 +301,9 @@ '_types.TransformContainer': '_types/Transform.ts#L27-L34', '_types.TranslogStats': '_types/Stats.ts#L237-L245', '_types.VersionType': '_types/common.ts#L94-L99', -'_types.WaitForActiveShardOptions': '_types/common.ts#L263-L266', +'_types.WaitForActiveShardOptions': '_types/common.ts#L265-L268', '_types.WaitForActiveShards': '_types/common.ts#L118-L119', -'_types.WaitForEvents': '_types/common.ts#L268-L275', +'_types.WaitForEvents': '_types/common.ts#L270-L277', '_types.WarmerStats': '_types/Stats.ts#L247-L252', '_types.WktGeoBounds': '_types/Geo.ts#L131-L133', '_types.WriteResponseBase': '_types/Base.ts#L37-L47', @@ -662,12 +665,13 @@ '_types.mapping.DocValuesPropertyBase': '_types/mapping/core.ts#L66-L68', '_types.mapping.DoubleNumberProperty': '_types/mapping/core.ts#L166-L169', '_types.mapping.DoubleRangeProperty': '_types/mapping/range.ts#L42-L44', -'_types.mapping.DynamicMapping': '_types/mapping/dynamic-template.ts#L37-L42', +'_types.mapping.DynamicMapping': '_types/mapping/dynamic-template.ts#L37-L46', +'_types.mapping.DynamicProperty': '_types/mapping/core.ts#L312-L342', '_types.mapping.DynamicTemplate': '_types/mapping/dynamic-template.ts#L22-L30', '_types.mapping.FieldAliasProperty': '_types/mapping/specialized.ts#L48-L51', '_types.mapping.FieldMapping': '_types/mapping/meta-fields.ts#L24-L27', '_types.mapping.FieldNamesField': '_types/mapping/meta-fields.ts#L42-L44', -'_types.mapping.FieldType': '_types/mapping/Property.ts#L69-L112', +'_types.mapping.FieldType': '_types/mapping/Property.ts#L70-L113', '_types.mapping.FlattenedProperty': '_types/mapping/complex.ts#L25-L36', '_types.mapping.FloatNumberProperty': '_types/mapping/core.ts#L156-L159', '_types.mapping.FloatRangeProperty': '_types/mapping/range.ts#L46-L48', @@ -678,7 +682,7 @@ '_types.mapping.HalfFloatNumberProperty': '_types/mapping/core.ts#L161-L164', '_types.mapping.HistogramProperty': '_types/mapping/specialized.ts#L53-L56', '_types.mapping.IndexField': '_types/mapping/meta-fields.ts#L46-L48', -'_types.mapping.IndexOptions': '_types/mapping/core.ts#L266-L271', +'_types.mapping.IndexOptions': '_types/mapping/core.ts#L272-L277', '_types.mapping.IntegerNumberProperty': '_types/mapping/core.ts#L171-L174', '_types.mapping.IntegerRangeProperty': '_types/mapping/range.ts#L50-L52', '_types.mapping.IpProperty': '_types/mapping/specialized.ts#L58-L64', @@ -687,7 +691,7 @@ '_types.mapping.KeywordProperty': '_types/mapping/core.ts#L128-L138', '_types.mapping.LongNumberProperty': '_types/mapping/core.ts#L176-L179', '_types.mapping.LongRangeProperty': '_types/mapping/range.ts#L58-L60', -'_types.mapping.MatchOnlyTextProperty': '_types/mapping/core.ts#L239-L264', +'_types.mapping.MatchOnlyTextProperty': '_types/mapping/core.ts#L245-L270', '_types.mapping.MatchType': '_types/mapping/dynamic-template.ts#L32-L35', '_types.mapping.Murmur3HashProperty': '_types/mapping/specialized.ts#L66-L68', '_types.mapping.NestedProperty': '_types/mapping/complex.ts#L38-L43', @@ -696,8 +700,8 @@ '_types.mapping.OnScriptError': '_types/mapping/core.ts#L145-L148', '_types.mapping.PercolatorProperty': '_types/mapping/core.ts#L214-L216', '_types.mapping.PointProperty': '_types/mapping/geo.ts#L62-L67', -'_types.mapping.Property': '_types/mapping/Property.ts#L52-L67', -'_types.mapping.PropertyBase': '_types/mapping/Property.ts#L42-L50', +'_types.mapping.Property': '_types/mapping/Property.ts#L52-L68', +'_types.mapping.PropertyBase': '_types/mapping/Property.ts#L43-L50', '_types.mapping.RangePropertyBase': '_types/mapping/range.ts#L23-L27', '_types.mapping.RankFeatureProperty': '_types/mapping/core.ts#L218-L221', '_types.mapping.RankFeaturesProperty': '_types/mapping/core.ts#L223-L225', @@ -713,13 +717,13 @@ '_types.mapping.StandardNumberProperty': '_types/mapping/core.ts#L150-L154', '_types.mapping.SuggestContext': '_types/mapping/specialized.ts#L36-L41', '_types.mapping.TermVectorOption': '_types/mapping/TermVectorOption.ts#L20-L28', -'_types.mapping.TextIndexPrefixes': '_types/mapping/core.ts#L273-L276', -'_types.mapping.TextProperty': '_types/mapping/core.ts#L278-L294', +'_types.mapping.TextIndexPrefixes': '_types/mapping/core.ts#L279-L282', +'_types.mapping.TextProperty': '_types/mapping/core.ts#L284-L300', '_types.mapping.TokenCountProperty': '_types/mapping/specialized.ts#L70-L77', '_types.mapping.TypeMapping': '_types/mapping/TypeMapping.ts#L34-L53', '_types.mapping.UnsignedLongNumberProperty': '_types/mapping/core.ts#L191-L194', -'_types.mapping.VersionProperty': '_types/mapping/core.ts#L296-L298', -'_types.mapping.WildcardProperty': '_types/mapping/core.ts#L300-L304', +'_types.mapping.VersionProperty': '_types/mapping/core.ts#L302-L304', +'_types.mapping.WildcardProperty': '_types/mapping/core.ts#L306-L310', '_types.query_dsl.BoolQuery': '_types/query_dsl/compound.ts#L28-L34', '_types.query_dsl.BoostingQuery': '_types/query_dsl/compound.ts#L36-L40', '_types.query_dsl.ChildScoreMode': '_types/query_dsl/joining.ts#L25-L39', @@ -736,11 +740,11 @@ '_types.query_dsl.ExistsQuery': '_types/query_dsl/term.ts#L36-L38', '_types.query_dsl.FieldAndFormat': '_types/query_dsl/abstractions.ts#L211-L225', '_types.query_dsl.FieldLookup': '_types/query_dsl/abstractions.ts#L163-L168', -'_types.query_dsl.FieldValueFactorModifier': '_types/query_dsl/compound.ts#L145-L156', +'_types.query_dsl.FieldValueFactorModifier': '_types/query_dsl/compound.ts#L147-L158', '_types.query_dsl.FieldValueFactorScoreFunction': '_types/query_dsl/compound.ts#L70-L75', -'_types.query_dsl.FunctionBoostMode': '_types/query_dsl/compound.ts#L136-L143', -'_types.query_dsl.FunctionScoreContainer': '_types/query_dsl/compound.ts#L107-L125', -'_types.query_dsl.FunctionScoreMode': '_types/query_dsl/compound.ts#L127-L134', +'_types.query_dsl.FunctionBoostMode': '_types/query_dsl/compound.ts#L138-L145', +'_types.query_dsl.FunctionScoreContainer': '_types/query_dsl/compound.ts#L107-L127', +'_types.query_dsl.FunctionScoreMode': '_types/query_dsl/compound.ts#L129-L136', '_types.query_dsl.FunctionScoreQuery': '_types/query_dsl/compound.ts#L52-L59', '_types.query_dsl.FuzzyQuery': '_types/query_dsl/term.ts#L40-L51', '_types.query_dsl.GeoBoundingBoxQuery': '_types/query_dsl/geo.ts#L32-L41', @@ -773,7 +777,7 @@ '_types.query_dsl.MatchQuery': '_types/query_dsl/fulltext.ts#L133-L158', '_types.query_dsl.MoreLikeThisQuery': '_types/query_dsl/specialized.ts#L63-L90', '_types.query_dsl.MultiMatchQuery': '_types/query_dsl/fulltext.ts#L191-L217', -'_types.query_dsl.MultiValueMode': '_types/query_dsl/compound.ts#L158-L163', +'_types.query_dsl.MultiValueMode': '_types/query_dsl/compound.ts#L160-L165', '_types.query_dsl.NestedQuery': '_types/query_dsl/joining.ts#L63-L71', '_types.query_dsl.Operator': '_types/query_dsl/Operator.ts#L22-L27', '_types.query_dsl.ParentIdQuery': '_types/query_dsl/joining.ts#L73-L78', @@ -1140,7 +1144,7 @@ 'indices._types.AliasDefinition': 'indices/_types/AliasDefinition.ts#L22-L28', 'indices._types.DataStream': 'indices/_types/DataStream.ts#L20-L22', 'indices._types.FielddataFrequencyFilter': 'indices/_types/FielddataFrequencyFilter.ts#L22-L26', -'indices._types.IndexCheckOnStartup': 'indices/_types/IndexSettings.ts#L310-L314', +'indices._types.IndexCheckOnStartup': 'indices/_types/IndexSettings.ts#L310-L317', 'indices._types.IndexRouting': 'indices/_types/IndexRouting.ts#L22-L25', 'indices._types.IndexRoutingAllocation': 'indices/_types/IndexRouting.ts#L27-L32', 'indices._types.IndexRoutingAllocationDisk': 'indices/_types/IndexRouting.ts#L62-L64', @@ -1152,20 +1156,20 @@ 'indices._types.IndexSegmentSort': 'indices/_types/IndexSegmentSort.ts#L22-L27', 'indices._types.IndexSettingBlocks': 'indices/_types/IndexSettings.ts#L302-L308', 'indices._types.IndexSettings': 'indices/_types/IndexSettings.ts#L57-L300', -'indices._types.IndexSettingsAnalysis': 'indices/_types/IndexSettings.ts#L363-L369', -'indices._types.IndexSettingsLifecycle': 'indices/_types/IndexSettings.ts#L320-L353', -'indices._types.IndexSettingsLifecycleStep': 'indices/_types/IndexSettings.ts#L355-L361', +'indices._types.IndexSettingsAnalysis': 'indices/_types/IndexSettings.ts#L366-L372', +'indices._types.IndexSettingsLifecycle': 'indices/_types/IndexSettings.ts#L323-L356', +'indices._types.IndexSettingsLifecycleStep': 'indices/_types/IndexSettings.ts#L358-L364', 'indices._types.IndexState': 'indices/_types/IndexState.ts#L26-L33', -'indices._types.IndexVersioning': 'indices/_types/IndexSettings.ts#L316-L318', -'indices._types.IndexingPressure': 'indices/_types/IndexSettings.ts#L567-L569', -'indices._types.IndexingPressureMemory': 'indices/_types/IndexSettings.ts#L571-L578', -'indices._types.MappingLimitSettings': 'indices/_types/IndexSettings.ts#L433-L445', -'indices._types.MappingLimitSettingsDepth': 'indices/_types/IndexSettings.ts#L457-L464', -'indices._types.MappingLimitSettingsDimensionFields': 'indices/_types/IndexSettings.ts#L494-L500', -'indices._types.MappingLimitSettingsFieldNameLength': 'indices/_types/IndexSettings.ts#L485-L492', -'indices._types.MappingLimitSettingsNestedFields': 'indices/_types/IndexSettings.ts#L466-L474', -'indices._types.MappingLimitSettingsNestedObjects': 'indices/_types/IndexSettings.ts#L476-L483', -'indices._types.MappingLimitSettingsTotalFields': 'indices/_types/IndexSettings.ts#L447-L455', +'indices._types.IndexVersioning': 'indices/_types/IndexSettings.ts#L319-L321', +'indices._types.IndexingPressure': 'indices/_types/IndexSettings.ts#L570-L572', +'indices._types.IndexingPressureMemory': 'indices/_types/IndexSettings.ts#L574-L581', +'indices._types.MappingLimitSettings': 'indices/_types/IndexSettings.ts#L436-L448', +'indices._types.MappingLimitSettingsDepth': 'indices/_types/IndexSettings.ts#L460-L467', +'indices._types.MappingLimitSettingsDimensionFields': 'indices/_types/IndexSettings.ts#L497-L503', +'indices._types.MappingLimitSettingsFieldNameLength': 'indices/_types/IndexSettings.ts#L488-L495', +'indices._types.MappingLimitSettingsNestedFields': 'indices/_types/IndexSettings.ts#L469-L477', +'indices._types.MappingLimitSettingsNestedObjects': 'indices/_types/IndexSettings.ts#L479-L486', +'indices._types.MappingLimitSettingsTotalFields': 'indices/_types/IndexSettings.ts#L450-L458', 'indices._types.NumericFielddata': 'indices/_types/NumericFielddata.ts#L22-L24', 'indices._types.NumericFielddataFormat': 'indices/_types/NumericFielddataFormat.ts#L20-L23', 'indices._types.OverlappingIndexTemplate': 'indices/_types/OverlappingIndexTemplate.ts#L22-L25', @@ -1173,28 +1177,28 @@ 'indices._types.SegmentSortMissing': 'indices/_types/IndexSegmentSort.ts#L39-L44', 'indices._types.SegmentSortMode': 'indices/_types/IndexSegmentSort.ts#L34-L37', 'indices._types.SegmentSortOrder': 'indices/_types/IndexSegmentSort.ts#L29-L32', -'indices._types.SlowlogSettings': 'indices/_types/IndexSettings.ts#L502-L507', -'indices._types.SlowlogTresholdLevels': 'indices/_types/IndexSettings.ts#L520-L525', -'indices._types.SlowlogTresholds': 'indices/_types/IndexSettings.ts#L509-L518', +'indices._types.SlowlogSettings': 'indices/_types/IndexSettings.ts#L505-L510', +'indices._types.SlowlogTresholdLevels': 'indices/_types/IndexSettings.ts#L523-L528', +'indices._types.SlowlogTresholds': 'indices/_types/IndexSettings.ts#L512-L521', 'indices._types.SoftDeletes': 'indices/_types/IndexSettings.ts#L38-L51', -'indices._types.Storage': 'indices/_types/IndexSettings.ts#L527-L536', -'indices._types.StorageType': 'indices/_types/IndexSettings.ts#L538-L565', +'indices._types.Storage': 'indices/_types/IndexSettings.ts#L530-L539', +'indices._types.StorageType': 'indices/_types/IndexSettings.ts#L541-L568', 'indices._types.TemplateMapping': 'indices/_types/TemplateMapping.ts#L27-L34', -'indices._types.Translog': 'indices/_types/IndexSettings.ts#L371-L393', -'indices._types.TranslogDurability': 'indices/_types/IndexSettings.ts#L395-L410', -'indices._types.TranslogRetention': 'indices/_types/IndexSettings.ts#L412-L431', +'indices._types.Translog': 'indices/_types/IndexSettings.ts#L374-L396', +'indices._types.TranslogDurability': 'indices/_types/IndexSettings.ts#L398-L413', +'indices._types.TranslogRetention': 'indices/_types/IndexSettings.ts#L415-L434', 'indices.add_block.IndicesBlockOptions': 'indices/add_block/IndicesAddBlockRequest.ts#L43-L48', 'indices.add_block.IndicesBlockStatus': 'indices/add_block/IndicesAddBlockResponse.ts#L29-L32', 'indices.add_block.Request': 'indices/add_block/IndicesAddBlockRequest.ts#L24-L41', 'indices.add_block.Response': 'indices/add_block/IndicesAddBlockResponse.ts#L23-L28', -'indices.analyze.AnalyzeDetail': 'indices/analyze/types.ts#L22-L28', -'indices.analyze.AnalyzeToken': 'indices/analyze/types.ts#L35-L42', -'indices.analyze.AnalyzerDetail': 'indices/analyze/types.ts#L30-L33', -'indices.analyze.CharFilterDetail': 'indices/analyze/types.ts#L44-L47', -'indices.analyze.ExplainAnalyzeToken': 'indices/analyze/types.ts#L49-L59', +'indices.analyze.AnalyzeDetail': 'indices/analyze/types.ts#L24-L30', +'indices.analyze.AnalyzeToken': 'indices/analyze/types.ts#L37-L44', +'indices.analyze.AnalyzerDetail': 'indices/analyze/types.ts#L32-L35', +'indices.analyze.CharFilterDetail': 'indices/analyze/types.ts#L46-L49', +'indices.analyze.ExplainAnalyzeToken': 'indices/analyze/types.ts#L52-L64', 'indices.analyze.Request': 'indices/analyze/IndicesAnalyzeRequest.ts#L27-L47', 'indices.analyze.Response': 'indices/analyze/IndicesAnalyzeResponse.ts#L22-L27', -'indices.analyze.TokenDetail': 'indices/analyze/types.ts#L63-L66', +'indices.analyze.TokenDetail': 'indices/analyze/types.ts#L68-L71', 'indices.clear_cache.Request': 'indices/clear_cache/IndicesIndicesClearCacheRequest.ts#L23-L41', 'indices.clear_cache.Response': 'indices/clear_cache/IndicesClearCacheResponse.ts#L22-L22', 'indices.clone.Request': 'indices/clone/IndicesCloneRequest.ts#L27-L46', @@ -1912,6 +1916,7 @@ 'security._types.RealmInfo': 'security/_types/RealmInfo.ts#L22-L25', 'security._types.RoleMapping': 'security/_types/RoleMapping.ts#L25-L31', 'security._types.RoleMappingRule': 'security/_types/RoleMappingRule.ts#L23-L31', +'security._types.TransientMetadataConfig': 'security/_types/TransientMetadataConfig.ts#L20-L22', 'security._types.User': 'security/_types/User.ts#L22-L29', 'security.authenticate.ApiKey': 'security/authenticate/types.ts#L28-L31', 'security.authenticate.Request': 'security/authenticate/SecurityAuthenticateRequest.ts#L22-L28', @@ -1929,10 +1934,9 @@ 'security.clear_cached_roles.Response': 'security/clear_cached_roles/ClearCachedRolesResponse.ts#L25-L32', 'security.clear_cached_service_tokens.Request': 'security/clear_cached_service_tokens/ClearCachedServiceTokensRequest.ts#L23-L34', 'security.clear_cached_service_tokens.Response': 'security/clear_cached_service_tokens/ClearCachedServiceTokensResponse.ts#L25-L32', -'security.create_api_key.IndexPrivileges': 'security/create_api_key/types.ts#L32-L35', 'security.create_api_key.Request': 'security/create_api_key/SecurityCreateApiKeyRequest.ts#L26-L51', 'security.create_api_key.Response': 'security/create_api_key/SecurityCreateApiKeyResponse.ts#L23-L49', -'security.create_api_key.RoleDescriptor': 'security/create_api_key/types.ts#L26-L30', +'security.create_api_key.RoleDescriptor': 'security/create_api_key/types.ts#L30-L39', 'security.create_service_token.Request': 'security/create_service_token/CreateServiceTokenRequest.ts#L23-L34', 'security.create_service_token.Response': 'security/create_service_token/CreateServiceTokenResponse.ts#L22-L27', 'security.create_service_token.Token': 'security/create_service_token/types.ts#L22-L25', @@ -1968,7 +1972,7 @@ 'security.get_role_mapping.Response': 'security/get_role_mapping/SecurityGetRoleMappingResponse.ts#L23-L23', 'security.get_service_accounts.Request': 'security/get_service_accounts/GetServiceAccountsRequest.ts#L23-L33', 'security.get_service_accounts.Response': 'security/get_service_accounts/GetServiceAccountsResponse.ts#L23-L26', -'security.get_service_accounts.RoleDescriptor': 'security/get_service_accounts/types.ts#L33-L41', +'security.get_service_accounts.RoleDescriptor': 'security/get_service_accounts/types.ts#L33-L42', 'security.get_service_accounts.RoleDescriptorWrapper': 'security/get_service_accounts/types.ts#L29-L31', 'security.get_service_credentials.Request': 'security/get_service_credentials/GetServiceCredentialsRequest.ts#L23-L33', 'security.get_service_credentials.Response': 'security/get_service_credentials/GetServiceCredentialsResponse.ts#L24-L32', @@ -2316,10 +2320,10 @@ if (hash.length > 1) { hash = hash.substring(1); } - window.location = "https://github.com/elastic/elasticsearch-specification/tree/900d4a7de4b8f2e98dbfc1dc915f11b503770acc/specification/" + (paths[hash] || ""); + window.location = "https://github.com/elastic/elasticsearch-specification/tree/d57a08796e1b844c6361ae90cf50fb4956d473d6/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/ilm/IlmPolicy.java b/java-client/src/main/java/co/elastic/clients/elasticsearch/ilm/IlmPolicy.java index 1777267c4..8889022f6 100644 --- a/java-client/src/main/java/co/elastic/clients/elasticsearch/ilm/IlmPolicy.java +++ b/java-client/src/main/java/co/elastic/clients/elasticsearch/ilm/IlmPolicy.java @@ -23,6 +23,7 @@ package co.elastic.clients.elasticsearch.ilm; +import co.elastic.clients.json.JsonData; import co.elastic.clients.json.JsonpDeserializable; import co.elastic.clients.json.JsonpDeserializer; import co.elastic.clients.json.JsonpMapper; @@ -35,6 +36,7 @@ import co.elastic.clients.util.WithJsonObjectBuilderBase; import jakarta.json.stream.JsonGenerator; import java.lang.String; +import java.util.Map; import java.util.Objects; import java.util.function.Function; import javax.annotation.Nullable; @@ -50,15 +52,14 @@ public class IlmPolicy implements JsonpSerializable { private final Phases phases; - @Nullable - private final String name; + private final Map meta; // --------------------------------------------------------------------------------------------- private IlmPolicy(Builder builder) { this.phases = ApiTypeHelper.requireNonNull(builder.phases, this, "phases"); - this.name = builder.name; + this.meta = ApiTypeHelper.unmodifiable(builder.meta); } @@ -74,11 +75,10 @@ public final Phases phases() { } /** - * API name: {@code name} + * API name: {@code _meta} */ - @Nullable - public final String name() { - return this.name; + public final Map meta() { + return this.meta; } /** @@ -95,9 +95,15 @@ protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { generator.writeKey("phases"); this.phases.serialize(generator, mapper); - if (this.name != null) { - generator.writeKey("name"); - generator.write(this.name); + if (ApiTypeHelper.isDefined(this.meta)) { + generator.writeKey("_meta"); + generator.writeStartObject(); + for (Map.Entry item0 : this.meta.entrySet()) { + generator.writeKey(item0.getKey()); + item0.getValue().serialize(generator, mapper); + + } + generator.writeEnd(); } @@ -118,7 +124,7 @@ public static class Builder extends WithJsonObjectBuilderBase implement private Phases phases; @Nullable - private String name; + private Map meta; /** * Required - API name: {@code phases} @@ -136,10 +142,22 @@ public final Builder phases(Function> fn) } /** - * API name: {@code name} + * API name: {@code _meta} + *

+ * Adds all entries of map to meta. + */ + public final Builder meta(Map map) { + this.meta = _mapPutAll(this.meta, map); + return this; + } + + /** + * API name: {@code _meta} + *

+ * Adds an entry to meta. */ - public final Builder name(@Nullable String value) { - this.name = value; + public final Builder meta(String key, JsonData value) { + this.meta = _mapPut(this.meta, key, value); return this; } @@ -172,7 +190,7 @@ public IlmPolicy build() { protected static void setupIlmPolicyDeserializer(ObjectDeserializer op) { op.add(Builder::phases, Phases._DESERIALIZER, "phases"); - op.add(Builder::name, JsonpDeserializer.stringDeserializer(), "name"); + op.add(Builder::meta, JsonpDeserializer.stringMapDeserializer(JsonData._DESERIALIZER), "_meta"); } diff --git a/java-client/src/main/java/co/elastic/clients/elasticsearch/indices/IndexCheckOnStartup.java b/java-client/src/main/java/co/elastic/clients/elasticsearch/indices/IndexCheckOnStartup.java index b8a881e7b..79ee0cdb6 100644 --- a/java-client/src/main/java/co/elastic/clients/elasticsearch/indices/IndexCheckOnStartup.java +++ b/java-client/src/main/java/co/elastic/clients/elasticsearch/indices/IndexCheckOnStartup.java @@ -35,12 +35,12 @@ */ @JsonpDeserializable public enum IndexCheckOnStartup implements JsonEnum { + True("true"), + False("false"), Checksum("checksum"), - True("true"), - ; private final String jsonValue; diff --git a/java-client/src/main/java/co/elastic/clients/elasticsearch/indices/analyze/ExplainAnalyzeToken.java b/java-client/src/main/java/co/elastic/clients/elasticsearch/indices/analyze/ExplainAnalyzeToken.java index 5766f72f0..9973c200e 100644 --- a/java-client/src/main/java/co/elastic/clients/elasticsearch/indices/analyze/ExplainAnalyzeToken.java +++ b/java-client/src/main/java/co/elastic/clients/elasticsearch/indices/analyze/ExplainAnalyzeToken.java @@ -23,6 +23,7 @@ package co.elastic.clients.elasticsearch.indices.analyze; +import co.elastic.clients.json.JsonData; import co.elastic.clients.json.JsonpDeserializable; import co.elastic.clients.json.JsonpDeserializer; import co.elastic.clients.json.JsonpMapper; @@ -37,6 +38,8 @@ import java.lang.Boolean; import java.lang.Long; import java.lang.String; +import java.util.HashMap; +import java.util.Map; import java.util.Objects; import java.util.function.Function; import javax.annotation.Nullable; @@ -51,6 +54,8 @@ */ @JsonpDeserializable public class ExplainAnalyzeToken implements JsonpSerializable { + private final Map attributes; + private final String bytes; private final long endOffset; @@ -74,6 +79,8 @@ public class ExplainAnalyzeToken implements JsonpSerializable { private ExplainAnalyzeToken(Builder builder) { + this.attributes = ApiTypeHelper.unmodifiable(builder.attributes); + this.bytes = ApiTypeHelper.requireNonNull(builder.bytes, this, "bytes"); this.endOffset = ApiTypeHelper.requireNonNull(builder.endOffset, this, "endOffset"); this.keyword = builder.keyword; @@ -90,6 +97,13 @@ public static ExplainAnalyzeToken of(Function attributes() { + return this.attributes; + } + /** * Required - API name: {@code bytes} */ @@ -165,6 +179,12 @@ public void serialize(JsonGenerator generator, JsonpMapper mapper) { protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { + for (Map.Entry item0 : this.attributes.entrySet()) { + generator.writeKey(item0.getKey()); + item0.getValue().serialize(generator, mapper); + + } + generator.writeKey("bytes"); generator.write(this.bytes); @@ -210,6 +230,29 @@ public String toString() { public static class Builder extends WithJsonObjectBuilderBase implements ObjectBuilder { + @Nullable + private Map attributes = new HashMap<>(); + + /** + * Additional tokenizer-specific attributes + *

+ * Adds all entries of map to attributes. + */ + public final Builder attributes(Map map) { + this.attributes = _mapPutAll(this.attributes, map); + return this; + } + + /** + * Additional tokenizer-specific attributes + *

+ * Adds an entry to attributes. + */ + public final Builder attributes(String key, JsonData value) { + this.attributes = _mapPut(this.attributes, key, value); + return this; + } + private String bytes; private Long endOffset; @@ -339,6 +382,10 @@ protected static void setupExplainAnalyzeTokenDeserializer(ObjectDeserializer { + builder.attributes(name, JsonData._DESERIALIZER.deserialize(parser, mapper)); + }); + } } diff --git a/java-client/src/main/java/co/elastic/clients/elasticsearch/security/TransientMetadataConfig.java b/java-client/src/main/java/co/elastic/clients/elasticsearch/security/TransientMetadataConfig.java new file mode 100644 index 000000000..beb1066cf --- /dev/null +++ b/java-client/src/main/java/co/elastic/clients/elasticsearch/security/TransientMetadataConfig.java @@ -0,0 +1,145 @@ +/* + * 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. + */ + +//---------------------------------------------------- +// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. +//---------------------------------------------------- + +package co.elastic.clients.elasticsearch.security; + +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.Objects; +import java.util.function.Function; + +// typedef: security._types.TransientMetadataConfig + +/** + * + * @see API + * specification + */ +@JsonpDeserializable +public class TransientMetadataConfig implements JsonpSerializable { + private final boolean enabled; + + // --------------------------------------------------------------------------------------------- + + private TransientMetadataConfig(Builder builder) { + + this.enabled = ApiTypeHelper.requireNonNull(builder.enabled, this, "enabled"); + + } + + public static TransientMetadataConfig of(Function> fn) { + return fn.apply(new Builder()).build(); + } + + /** + * Required - API name: {@code enabled} + */ + public final boolean enabled() { + return this.enabled; + } + + /** + * 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); + + } + + @Override + public String toString() { + return JsonpUtils.toString(this); + } + + // --------------------------------------------------------------------------------------------- + + /** + * Builder for {@link TransientMetadataConfig}. + */ + + public static class Builder extends WithJsonObjectBuilderBase + implements + ObjectBuilder { + private Boolean enabled; + + /** + * Required - API name: {@code enabled} + */ + public final Builder enabled(boolean value) { + this.enabled = value; + return this; + } + + @Override + protected Builder self() { + return this; + } + + /** + * Builds a {@link TransientMetadataConfig}. + * + * @throws NullPointerException + * if some of the required fields are null. + */ + public TransientMetadataConfig build() { + _checkSingleUse(); + + return new TransientMetadataConfig(this); + } + } + + // --------------------------------------------------------------------------------------------- + + /** + * Json deserializer for {@link TransientMetadataConfig} + */ + public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer + .lazy(Builder::new, TransientMetadataConfig::setupTransientMetadataConfigDeserializer); + + protected static void setupTransientMetadataConfigDeserializer( + ObjectDeserializer op) { + + op.add(Builder::enabled, JsonpDeserializer.booleanDeserializer(), "enabled"); + + } + +} diff --git a/java-client/src/main/java/co/elastic/clients/elasticsearch/security/create_api_key/IndexPrivileges.java b/java-client/src/main/java/co/elastic/clients/elasticsearch/security/create_api_key/IndexPrivileges.java deleted file mode 100644 index 79ec51401..000000000 --- a/java-client/src/main/java/co/elastic/clients/elasticsearch/security/create_api_key/IndexPrivileges.java +++ /dev/null @@ -1,207 +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. - */ - -//---------------------------------------------------- -// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. -//---------------------------------------------------- - -package co.elastic.clients.elasticsearch.security.create_api_key; - -import co.elastic.clients.elasticsearch.security.IndexPrivilege; -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; - -// typedef: security.create_api_key.IndexPrivileges - -/** - * - * @see API - * specification - */ -@JsonpDeserializable -public class IndexPrivileges implements JsonpSerializable { - private final List names; - - private final List privileges; - - // --------------------------------------------------------------------------------------------- - - private IndexPrivileges(Builder builder) { - - this.names = ApiTypeHelper.unmodifiableRequired(builder.names, this, "names"); - this.privileges = ApiTypeHelper.unmodifiableRequired(builder.privileges, this, "privileges"); - - } - - public static IndexPrivileges of(Function> fn) { - return fn.apply(new Builder()).build(); - } - - /** - * Required - API name: {@code names} - */ - public final List names() { - return this.names; - } - - /** - * Required - API name: {@code privileges} - */ - public final List privileges() { - return this.privileges; - } - - /** - * 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.names)) { - generator.writeKey("names"); - generator.writeStartArray(); - for (String item0 : this.names) { - generator.write(item0); - - } - generator.writeEnd(); - - } - if (ApiTypeHelper.isDefined(this.privileges)) { - generator.writeKey("privileges"); - generator.writeStartArray(); - for (IndexPrivilege item0 : this.privileges) { - item0.serialize(generator, mapper); - } - generator.writeEnd(); - - } - - } - - @Override - public String toString() { - return JsonpUtils.toString(this); - } - - // --------------------------------------------------------------------------------------------- - - /** - * Builder for {@link IndexPrivileges}. - */ - - public static class Builder extends WithJsonObjectBuilderBase implements ObjectBuilder { - private List names; - - private List privileges; - - /** - * Required - API name: {@code names} - *

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

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

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

- * Adds one or more values to privileges. - */ - public final Builder privileges(IndexPrivilege value, IndexPrivilege... values) { - this.privileges = _listAdd(this.privileges, value, values); - return this; - } - - @Override - protected Builder self() { - return this; - } - - /** - * Builds a {@link IndexPrivileges}. - * - * @throws NullPointerException - * if some of the required fields are null. - */ - public IndexPrivileges build() { - _checkSingleUse(); - - return new IndexPrivileges(this); - } - } - - // --------------------------------------------------------------------------------------------- - - /** - * Json deserializer for {@link IndexPrivileges} - */ - public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer.lazy(Builder::new, - IndexPrivileges::setupIndexPrivilegesDeserializer); - - protected static void setupIndexPrivilegesDeserializer(ObjectDeserializer op) { - - op.add(Builder::names, JsonpDeserializer.arrayDeserializer(JsonpDeserializer.stringDeserializer()), "names"); - op.add(Builder::privileges, JsonpDeserializer.arrayDeserializer(IndexPrivilege._DESERIALIZER), "privileges"); - - } - -} diff --git a/java-client/src/main/java/co/elastic/clients/elasticsearch/security/create_api_key/RoleDescriptor.java b/java-client/src/main/java/co/elastic/clients/elasticsearch/security/create_api_key/RoleDescriptor.java index 806bf6b7c..555d71a5c 100644 --- a/java-client/src/main/java/co/elastic/clients/elasticsearch/security/create_api_key/RoleDescriptor.java +++ b/java-client/src/main/java/co/elastic/clients/elasticsearch/security/create_api_key/RoleDescriptor.java @@ -24,6 +24,10 @@ package co.elastic.clients.elasticsearch.security.create_api_key; import co.elastic.clients.elasticsearch.security.ApplicationPrivileges; +import co.elastic.clients.elasticsearch.security.GlobalPrivilege; +import co.elastic.clients.elasticsearch.security.IndicesPrivileges; +import co.elastic.clients.elasticsearch.security.TransientMetadataConfig; +import co.elastic.clients.json.JsonData; import co.elastic.clients.json.JsonpDeserializable; import co.elastic.clients.json.JsonpDeserializer; import co.elastic.clients.json.JsonpMapper; @@ -37,6 +41,7 @@ import jakarta.json.stream.JsonGenerator; import java.lang.String; import java.util.List; +import java.util.Map; import java.util.Objects; import java.util.function.Function; import javax.annotation.Nullable; @@ -53,17 +58,30 @@ public class RoleDescriptor implements JsonpSerializable { private final List cluster; - private final List index; + private final List indices; + + private final List global; private final List applications; + private final Map metadata; + + private final List runAs; + + @Nullable + private final TransientMetadataConfig transientMetadata; + // --------------------------------------------------------------------------------------------- private RoleDescriptor(Builder builder) { this.cluster = ApiTypeHelper.unmodifiableRequired(builder.cluster, this, "cluster"); - this.index = ApiTypeHelper.unmodifiableRequired(builder.index, this, "index"); + this.indices = ApiTypeHelper.unmodifiableRequired(builder.indices, this, "indices"); + this.global = ApiTypeHelper.unmodifiable(builder.global); this.applications = ApiTypeHelper.unmodifiable(builder.applications); + this.metadata = ApiTypeHelper.unmodifiable(builder.metadata); + this.runAs = ApiTypeHelper.unmodifiable(builder.runAs); + this.transientMetadata = builder.transientMetadata; } @@ -79,10 +97,17 @@ public final List cluster() { } /** - * Required - API name: {@code index} + * Required - API name: {@code indices} */ - public final List index() { - return this.index; + public final List indices() { + return this.indices; + } + + /** + * API name: {@code global} + */ + public final List global() { + return this.global; } /** @@ -92,6 +117,28 @@ public final List applications() { return this.applications; } + /** + * API name: {@code metadata} + */ + public final Map metadata() { + return this.metadata; + } + + /** + * API name: {@code run_as} + */ + public final List runAs() { + return this.runAs; + } + + /** + * API name: {@code transient_metadata} + */ + @Nullable + public final TransientMetadataConfig transientMetadata() { + return this.transientMetadata; + } + /** * Serialize this object to JSON. */ @@ -113,10 +160,20 @@ protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { generator.writeEnd(); } - if (ApiTypeHelper.isDefined(this.index)) { - generator.writeKey("index"); + if (ApiTypeHelper.isDefined(this.indices)) { + generator.writeKey("indices"); + generator.writeStartArray(); + for (IndicesPrivileges item0 : this.indices) { + item0.serialize(generator, mapper); + + } + generator.writeEnd(); + + } + if (ApiTypeHelper.isDefined(this.global)) { + generator.writeKey("global"); generator.writeStartArray(); - for (IndexPrivileges item0 : this.index) { + for (GlobalPrivilege item0 : this.global) { item0.serialize(generator, mapper); } @@ -133,6 +190,32 @@ protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { generator.writeEnd(); } + if (ApiTypeHelper.isDefined(this.metadata)) { + generator.writeKey("metadata"); + generator.writeStartObject(); + for (Map.Entry item0 : this.metadata.entrySet()) { + generator.writeKey(item0.getKey()); + item0.getValue().serialize(generator, mapper); + + } + generator.writeEnd(); + + } + if (ApiTypeHelper.isDefined(this.runAs)) { + generator.writeKey("run_as"); + generator.writeStartArray(); + for (String item0 : this.runAs) { + generator.write(item0); + + } + generator.writeEnd(); + + } + if (this.transientMetadata != null) { + generator.writeKey("transient_metadata"); + this.transientMetadata.serialize(generator, mapper); + + } } @@ -150,11 +233,23 @@ public String toString() { public static class Builder extends WithJsonObjectBuilderBase implements ObjectBuilder { private List cluster; - private List index; + private List indices; + + @Nullable + private List global; @Nullable private List applications; + @Nullable + private Map metadata; + + @Nullable + private List runAs; + + @Nullable + private TransientMetadataConfig transientMetadata; + /** * Required - API name: {@code cluster} *

@@ -176,32 +271,61 @@ public final Builder cluster(String value, String... values) { } /** - * Required - API name: {@code index} + * Required - API name: {@code indices} *

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

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

- * Adds a value to index using a builder lambda. + * Adds a value to indices using a builder lambda. */ - public final Builder index(Function> fn) { - return index(fn.apply(new IndexPrivileges.Builder()).build()); + public final Builder indices(Function> fn) { + return indices(fn.apply(new IndicesPrivileges.Builder()).build()); + } + + /** + * API name: {@code global} + *

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

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

+ * Adds a value to global using a builder lambda. + */ + public final Builder global(Function> fn) { + return global(fn.apply(new GlobalPrivilege.Builder()).build()); } /** @@ -234,6 +358,62 @@ public final Builder applications( return applications(fn.apply(new ApplicationPrivileges.Builder()).build()); } + /** + * API name: {@code metadata} + *

+ * Adds all entries of map to metadata. + */ + public final Builder metadata(Map map) { + this.metadata = _mapPutAll(this.metadata, map); + return this; + } + + /** + * API name: {@code metadata} + *

+ * Adds an entry to metadata. + */ + public final Builder metadata(String key, JsonData value) { + this.metadata = _mapPut(this.metadata, key, value); + return this; + } + + /** + * API name: {@code run_as} + *

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

+ * Adds one or more values to runAs. + */ + public final Builder runAs(String value, String... values) { + this.runAs = _listAdd(this.runAs, value, values); + return this; + } + + /** + * API name: {@code transient_metadata} + */ + public final Builder transientMetadata(@Nullable TransientMetadataConfig value) { + this.transientMetadata = value; + return this; + } + + /** + * API name: {@code transient_metadata} + */ + public final Builder transientMetadata( + Function> fn) { + return this.transientMetadata(fn.apply(new TransientMetadataConfig.Builder()).build()); + } + @Override protected Builder self() { return this; @@ -264,9 +444,14 @@ protected static void setupRoleDescriptorDeserializer(ObjectDeserializer