From 9ea803928bd20013fa56ec2a8ef87cf8f818c43e Mon Sep 17 00:00:00 2001 From: Laura Date: Fri, 8 Mar 2024 10:41:43 +0100 Subject: [PATCH] fixes from api-spec pr 2444 --- .../elasticsearch/_types/QueryCacheStats.java | 11 +- .../elasticsearch/_types/SegmentsStats.java | 113 ++++--- .../elasticsearch/_types/StoreStats.java | 33 +- .../CompositeAggregationBase.java | 293 ++++++++++++++++++ .../CompositeAggregationSource.java | 58 ++-- .../CompositeDateHistogramAggregation.java | 284 +++++++++++++++++ .../CompositeGeoTileGridAggregation.java | 185 +++++++++++ .../CompositeHistogramAggregation.java | 141 +++++++++ .../CompositeTermsAggregation.java | 108 +++++++ .../_types/analysis/PatternTokenizer.java | 57 ++-- .../elasticsearch/doc-files/api-spec.html | 107 ++++--- .../snapshot/RepositorySettings.java | 274 ---------------- 12 files changed, 1210 insertions(+), 454 deletions(-) create mode 100644 java-client/src/main/java/co/elastic/clients/elasticsearch/_types/aggregations/CompositeAggregationBase.java create mode 100644 java-client/src/main/java/co/elastic/clients/elasticsearch/_types/aggregations/CompositeDateHistogramAggregation.java create mode 100644 java-client/src/main/java/co/elastic/clients/elasticsearch/_types/aggregations/CompositeGeoTileGridAggregation.java create mode 100644 java-client/src/main/java/co/elastic/clients/elasticsearch/_types/aggregations/CompositeHistogramAggregation.java create mode 100644 java-client/src/main/java/co/elastic/clients/elasticsearch/_types/aggregations/CompositeTermsAggregation.java delete mode 100644 java-client/src/main/java/co/elastic/clients/elasticsearch/snapshot/RepositorySettings.java diff --git a/java-client/src/main/java/co/elastic/clients/elasticsearch/_types/QueryCacheStats.java b/java-client/src/main/java/co/elastic/clients/elasticsearch/_types/QueryCacheStats.java index 67d315b6e..d1f9ede87 100644 --- a/java-client/src/main/java/co/elastic/clients/elasticsearch/_types/QueryCacheStats.java +++ b/java-client/src/main/java/co/elastic/clients/elasticsearch/_types/QueryCacheStats.java @@ -31,6 +31,7 @@ import co.elastic.clients.util.WithJsonObjectBuilderBase; import jakarta.json.stream.JsonGenerator; import java.lang.Integer; +import java.lang.Long; import java.lang.String; import java.util.Objects; import java.util.function.Function; @@ -71,7 +72,7 @@ public class QueryCacheStats implements JsonpSerializable { @Nullable private final String memorySize; - private final int memorySizeInBytes; + private final long memorySizeInBytes; private final int missCount; @@ -135,7 +136,7 @@ public final String memorySize() { /** * Required - API name: {@code memory_size_in_bytes} */ - public final int memorySizeInBytes() { + public final long memorySizeInBytes() { return this.memorySizeInBytes; } @@ -215,7 +216,7 @@ public static class Builder extends WithJsonObjectBuilderBase implement @Nullable private String memorySize; - private Integer memorySizeInBytes; + private Long memorySizeInBytes; private Integer missCount; @@ -264,7 +265,7 @@ public final Builder memorySize(@Nullable String value) { /** * Required - API name: {@code memory_size_in_bytes} */ - public final Builder memorySizeInBytes(int value) { + public final Builder memorySizeInBytes(long value) { this.memorySizeInBytes = value; return this; } @@ -318,7 +319,7 @@ protected static void setupQueryCacheStatsDeserializer(ObjectDeserializer fileSizes; @Nullable private final String fixedBitSet; - private final int fixedBitSetMemoryInBytes; + private final long fixedBitSetMemoryInBytes; @Nullable private final String indexWriterMemory; @Nullable - private final Integer indexWriterMaxMemoryInBytes; + private final Long indexWriterMaxMemoryInBytes; - private final int indexWriterMemoryInBytes; + private final long indexWriterMemoryInBytes; private final long maxUnsafeAutoIdTimestamp; @Nullable private final String memory; - private final int memoryInBytes; + private final long memoryInBytes; @Nullable private final String normsMemory; - private final int normsMemoryInBytes; + private final long normsMemoryInBytes; @Nullable private final String pointsMemory; - private final int pointsMemoryInBytes; + private final long pointsMemoryInBytes; @Nullable private final String storedMemory; - private final int storedFieldsMemoryInBytes; + private final long storedFieldsMemoryInBytes; - private final int termsMemoryInBytes; + private final long termsMemoryInBytes; @Nullable private final String termsMemory; @@ -115,12 +115,12 @@ public class SegmentsStats implements JsonpSerializable { @Nullable private final String termVectoryMemory; - private final int termVectorsMemoryInBytes; + private final long termVectorsMemoryInBytes; @Nullable private final String versionMapMemory; - private final int versionMapMemoryInBytes; + private final long versionMapMemoryInBytes; // --------------------------------------------------------------------------------------------- @@ -183,7 +183,7 @@ public final String docValuesMemory() { /** * Required - API name: {@code doc_values_memory_in_bytes} */ - public final int docValuesMemoryInBytes() { + public final long docValuesMemoryInBytes() { return this.docValuesMemoryInBytes; } @@ -205,7 +205,7 @@ public final String fixedBitSet() { /** * Required - API name: {@code fixed_bit_set_memory_in_bytes} */ - public final int fixedBitSetMemoryInBytes() { + public final long fixedBitSetMemoryInBytes() { return this.fixedBitSetMemoryInBytes; } @@ -221,14 +221,14 @@ public final String indexWriterMemory() { * API name: {@code index_writer_max_memory_in_bytes} */ @Nullable - public final Integer indexWriterMaxMemoryInBytes() { + public final Long indexWriterMaxMemoryInBytes() { return this.indexWriterMaxMemoryInBytes; } /** * Required - API name: {@code index_writer_memory_in_bytes} */ - public final int indexWriterMemoryInBytes() { + public final long indexWriterMemoryInBytes() { return this.indexWriterMemoryInBytes; } @@ -250,7 +250,7 @@ public final String memory() { /** * Required - API name: {@code memory_in_bytes} */ - public final int memoryInBytes() { + public final long memoryInBytes() { return this.memoryInBytes; } @@ -265,7 +265,7 @@ public final String normsMemory() { /** * Required - API name: {@code norms_memory_in_bytes} */ - public final int normsMemoryInBytes() { + public final long normsMemoryInBytes() { return this.normsMemoryInBytes; } @@ -280,7 +280,7 @@ public final String pointsMemory() { /** * Required - API name: {@code points_memory_in_bytes} */ - public final int pointsMemoryInBytes() { + public final long pointsMemoryInBytes() { return this.pointsMemoryInBytes; } @@ -295,14 +295,14 @@ public final String storedMemory() { /** * Required - API name: {@code stored_fields_memory_in_bytes} */ - public final int storedFieldsMemoryInBytes() { + public final long storedFieldsMemoryInBytes() { return this.storedFieldsMemoryInBytes; } /** * Required - API name: {@code terms_memory_in_bytes} */ - public final int termsMemoryInBytes() { + public final long termsMemoryInBytes() { return this.termsMemoryInBytes; } @@ -325,7 +325,7 @@ public final String termVectoryMemory() { /** * Required - API name: {@code term_vectors_memory_in_bytes} */ - public final int termVectorsMemoryInBytes() { + public final long termVectorsMemoryInBytes() { return this.termVectorsMemoryInBytes; } @@ -340,7 +340,7 @@ public final String versionMapMemory() { /** * Required - API name: {@code version_map_memory_in_bytes} */ - public final int versionMapMemoryInBytes() { + public final long versionMapMemoryInBytes() { return this.versionMapMemoryInBytes; } @@ -476,46 +476,46 @@ public static class Builder extends WithJsonObjectBuilderBase implement @Nullable private String docValuesMemory; - private Integer docValuesMemoryInBytes; + private Long docValuesMemoryInBytes; private Map fileSizes; @Nullable private String fixedBitSet; - private Integer fixedBitSetMemoryInBytes; + private Long fixedBitSetMemoryInBytes; @Nullable private String indexWriterMemory; @Nullable - private Integer indexWriterMaxMemoryInBytes; + private Long indexWriterMaxMemoryInBytes; - private Integer indexWriterMemoryInBytes; + private Long indexWriterMemoryInBytes; private Long maxUnsafeAutoIdTimestamp; @Nullable private String memory; - private Integer memoryInBytes; + private Long memoryInBytes; @Nullable private String normsMemory; - private Integer normsMemoryInBytes; + private Long normsMemoryInBytes; @Nullable private String pointsMemory; - private Integer pointsMemoryInBytes; + private Long pointsMemoryInBytes; @Nullable private String storedMemory; - private Integer storedFieldsMemoryInBytes; + private Long storedFieldsMemoryInBytes; - private Integer termsMemoryInBytes; + private Long termsMemoryInBytes; @Nullable private String termsMemory; @@ -523,12 +523,12 @@ public static class Builder extends WithJsonObjectBuilderBase implement @Nullable private String termVectoryMemory; - private Integer termVectorsMemoryInBytes; + private Long termVectorsMemoryInBytes; @Nullable private String versionMapMemory; - private Integer versionMapMemoryInBytes; + private Long versionMapMemoryInBytes; /** * Required - API name: {@code count} @@ -549,7 +549,7 @@ public final Builder docValuesMemory(@Nullable String value) { /** * Required - API name: {@code doc_values_memory_in_bytes} */ - public final Builder docValuesMemoryInBytes(int value) { + public final Builder docValuesMemoryInBytes(long value) { this.docValuesMemoryInBytes = value; return this; } @@ -595,7 +595,7 @@ public final Builder fixedBitSet(@Nullable String value) { /** * Required - API name: {@code fixed_bit_set_memory_in_bytes} */ - public final Builder fixedBitSetMemoryInBytes(int value) { + public final Builder fixedBitSetMemoryInBytes(long value) { this.fixedBitSetMemoryInBytes = value; return this; } @@ -611,7 +611,7 @@ public final Builder indexWriterMemory(@Nullable String value) { /** * API name: {@code index_writer_max_memory_in_bytes} */ - public final Builder indexWriterMaxMemoryInBytes(@Nullable Integer value) { + public final Builder indexWriterMaxMemoryInBytes(@Nullable Long value) { this.indexWriterMaxMemoryInBytes = value; return this; } @@ -619,7 +619,7 @@ public final Builder indexWriterMaxMemoryInBytes(@Nullable Integer value) { /** * Required - API name: {@code index_writer_memory_in_bytes} */ - public final Builder indexWriterMemoryInBytes(int value) { + public final Builder indexWriterMemoryInBytes(long value) { this.indexWriterMemoryInBytes = value; return this; } @@ -643,7 +643,7 @@ public final Builder memory(@Nullable String value) { /** * Required - API name: {@code memory_in_bytes} */ - public final Builder memoryInBytes(int value) { + public final Builder memoryInBytes(long value) { this.memoryInBytes = value; return this; } @@ -659,7 +659,7 @@ public final Builder normsMemory(@Nullable String value) { /** * Required - API name: {@code norms_memory_in_bytes} */ - public final Builder normsMemoryInBytes(int value) { + public final Builder normsMemoryInBytes(long value) { this.normsMemoryInBytes = value; return this; } @@ -675,7 +675,7 @@ public final Builder pointsMemory(@Nullable String value) { /** * Required - API name: {@code points_memory_in_bytes} */ - public final Builder pointsMemoryInBytes(int value) { + public final Builder pointsMemoryInBytes(long value) { this.pointsMemoryInBytes = value; return this; } @@ -691,7 +691,7 @@ public final Builder storedMemory(@Nullable String value) { /** * Required - API name: {@code stored_fields_memory_in_bytes} */ - public final Builder storedFieldsMemoryInBytes(int value) { + public final Builder storedFieldsMemoryInBytes(long value) { this.storedFieldsMemoryInBytes = value; return this; } @@ -699,7 +699,7 @@ public final Builder storedFieldsMemoryInBytes(int value) { /** * Required - API name: {@code terms_memory_in_bytes} */ - public final Builder termsMemoryInBytes(int value) { + public final Builder termsMemoryInBytes(long value) { this.termsMemoryInBytes = value; return this; } @@ -723,7 +723,7 @@ public final Builder termVectoryMemory(@Nullable String value) { /** * Required - API name: {@code term_vectors_memory_in_bytes} */ - public final Builder termVectorsMemoryInBytes(int value) { + public final Builder termVectorsMemoryInBytes(long value) { this.termVectorsMemoryInBytes = value; return this; } @@ -739,7 +739,7 @@ public final Builder versionMapMemory(@Nullable String value) { /** * Required - API name: {@code version_map_memory_in_bytes} */ - public final Builder versionMapMemoryInBytes(int value) { + public final Builder versionMapMemoryInBytes(long value) { this.versionMapMemoryInBytes = value; return this; } @@ -774,35 +774,32 @@ protected static void setupSegmentsStatsDeserializer(ObjectDeserializer implement @Nullable private String size; - private Integer sizeInBytes; + private Long sizeInBytes; @Nullable private String reserved; - private Integer reservedInBytes; + private Long reservedInBytes; @Nullable private String totalDataSetSize; @Nullable - private Integer totalDataSetSizeInBytes; + private Long totalDataSetSizeInBytes; /** * API name: {@code size} @@ -218,7 +218,7 @@ public final Builder size(@Nullable String value) { /** * Required - API name: {@code size_in_bytes} */ - public final Builder sizeInBytes(int value) { + public final Builder sizeInBytes(long value) { this.sizeInBytes = value; return this; } @@ -234,7 +234,7 @@ public final Builder reserved(@Nullable String value) { /** * Required - API name: {@code reserved_in_bytes} */ - public final Builder reservedInBytes(int value) { + public final Builder reservedInBytes(long value) { this.reservedInBytes = value; return this; } @@ -250,7 +250,7 @@ public final Builder totalDataSetSize(@Nullable String value) { /** * API name: {@code total_data_set_size_in_bytes} */ - public final Builder totalDataSetSizeInBytes(@Nullable Integer value) { + public final Builder totalDataSetSizeInBytes(@Nullable Long value) { this.totalDataSetSizeInBytes = value; return this; } @@ -284,12 +284,11 @@ public StoreStats build() { protected static void setupStoreStatsDeserializer(ObjectDeserializer op) { op.add(Builder::size, JsonpDeserializer.stringDeserializer(), "size"); - op.add(Builder::sizeInBytes, JsonpDeserializer.integerDeserializer(), "size_in_bytes"); + op.add(Builder::sizeInBytes, JsonpDeserializer.longDeserializer(), "size_in_bytes"); op.add(Builder::reserved, JsonpDeserializer.stringDeserializer(), "reserved"); - op.add(Builder::reservedInBytes, JsonpDeserializer.integerDeserializer(), "reserved_in_bytes"); + op.add(Builder::reservedInBytes, JsonpDeserializer.longDeserializer(), "reserved_in_bytes"); op.add(Builder::totalDataSetSize, JsonpDeserializer.stringDeserializer(), "total_data_set_size"); - op.add(Builder::totalDataSetSizeInBytes, JsonpDeserializer.integerDeserializer(), - "total_data_set_size_in_bytes"); + op.add(Builder::totalDataSetSizeInBytes, JsonpDeserializer.longDeserializer(), "total_data_set_size_in_bytes"); } diff --git a/java-client/src/main/java/co/elastic/clients/elasticsearch/_types/aggregations/CompositeAggregationBase.java b/java-client/src/main/java/co/elastic/clients/elasticsearch/_types/aggregations/CompositeAggregationBase.java new file mode 100644 index 000000000..5600a528f --- /dev/null +++ b/java-client/src/main/java/co/elastic/clients/elasticsearch/_types/aggregations/CompositeAggregationBase.java @@ -0,0 +1,293 @@ +/* + * Licensed to Elasticsearch B.V. under one or more contributor + * license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright + * ownership. Elasticsearch B.V. licenses this file to you under + * the Apache License, Version 2.0 (the "License"); you may + * not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +package co.elastic.clients.elasticsearch._types.aggregations; + +import co.elastic.clients.elasticsearch._types.Script; +import co.elastic.clients.elasticsearch._types.SortOrder; +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.ObjectBuilder; +import co.elastic.clients.util.WithJsonObjectBuilderBase; +import jakarta.json.stream.JsonGenerator; +import java.lang.Boolean; +import java.lang.String; +import java.util.Objects; +import java.util.function.Function; +import javax.annotation.Nullable; + +//---------------------------------------------------------------- +// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. +//---------------------------------------------------------------- +// +// This code is generated from the Elasticsearch API specification +// at https://github.com/elastic/elasticsearch-specification +// +// Manual updates to this file will be lost when the code is +// re-generated. +// +// If you find a property that is missing or wrongly typed, please +// open an issue or a PR on the API specification repository. +// +//---------------------------------------------------------------- + +// typedef: _types.aggregations.CompositeAggregationBase + +/** + * + * @see API + * specification + */ + +public abstract class CompositeAggregationBase implements JsonpSerializable { + @Nullable + private final String field; + + @Nullable + private final Boolean missingBucket; + + @Nullable + private final MissingOrder missingOrder; + + @Nullable + private final Script script; + + @Nullable + private final ValueType valueType; + + @Nullable + private final SortOrder order; + + // --------------------------------------------------------------------------------------------- + + protected CompositeAggregationBase(AbstractBuilder builder) { + + this.field = builder.field; + this.missingBucket = builder.missingBucket; + this.missingOrder = builder.missingOrder; + this.script = builder.script; + this.valueType = builder.valueType; + this.order = builder.order; + + } + + /** + * Either field or script must be present + *

+ * API name: {@code field} + */ + @Nullable + public final String field() { + return this.field; + } + + /** + * API name: {@code missing_bucket} + */ + @Nullable + public final Boolean missingBucket() { + return this.missingBucket; + } + + /** + * API name: {@code missing_order} + */ + @Nullable + public final MissingOrder missingOrder() { + return this.missingOrder; + } + + /** + * Either field or script must be present + *

+ * API name: {@code script} + */ + @Nullable + public final Script script() { + return this.script; + } + + /** + * API name: {@code value_type} + */ + @Nullable + public final ValueType valueType() { + return this.valueType; + } + + /** + * API name: {@code order} + */ + @Nullable + public final SortOrder order() { + return this.order; + } + + /** + * 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.field != null) { + generator.writeKey("field"); + generator.write(this.field); + + } + if (this.missingBucket != null) { + generator.writeKey("missing_bucket"); + generator.write(this.missingBucket); + + } + if (this.missingOrder != null) { + generator.writeKey("missing_order"); + this.missingOrder.serialize(generator, mapper); + } + if (this.script != null) { + generator.writeKey("script"); + this.script.serialize(generator, mapper); + + } + if (this.valueType != null) { + generator.writeKey("value_type"); + this.valueType.serialize(generator, mapper); + } + if (this.order != null) { + generator.writeKey("order"); + this.order.serialize(generator, mapper); + } + + } + + @Override + public String toString() { + return JsonpUtils.toString(this); + } + + public abstract static class AbstractBuilder> + extends + WithJsonObjectBuilderBase { + @Nullable + private String field; + + @Nullable + private Boolean missingBucket; + + @Nullable + private MissingOrder missingOrder; + + @Nullable + private Script script; + + @Nullable + private ValueType valueType; + + @Nullable + private SortOrder order; + + /** + * Either field or script must be present + *

+ * API name: {@code field} + */ + public final BuilderT field(@Nullable String value) { + this.field = value; + return self(); + } + + /** + * API name: {@code missing_bucket} + */ + public final BuilderT missingBucket(@Nullable Boolean value) { + this.missingBucket = value; + return self(); + } + + /** + * API name: {@code missing_order} + */ + public final BuilderT missingOrder(@Nullable MissingOrder value) { + this.missingOrder = value; + return self(); + } + + /** + * Either field or script must be present + *

+ * API name: {@code script} + */ + public final BuilderT script(@Nullable Script value) { + this.script = value; + return self(); + } + + /** + * Either field or script must be present + *

+ * API name: {@code script} + */ + public final BuilderT script(Function> fn) { + return this.script(fn.apply(new Script.Builder()).build()); + } + + /** + * API name: {@code value_type} + */ + public final BuilderT valueType(@Nullable ValueType value) { + this.valueType = value; + return self(); + } + + /** + * API name: {@code order} + */ + public final BuilderT order(@Nullable SortOrder value) { + this.order = value; + return self(); + } + + protected abstract BuilderT self(); + + } + + // --------------------------------------------------------------------------------------------- + protected static > void setupCompositeAggregationBaseDeserializer( + ObjectDeserializer op) { + + op.add(AbstractBuilder::field, JsonpDeserializer.stringDeserializer(), "field"); + op.add(AbstractBuilder::missingBucket, JsonpDeserializer.booleanDeserializer(), "missing_bucket"); + op.add(AbstractBuilder::missingOrder, MissingOrder._DESERIALIZER, "missing_order"); + op.add(AbstractBuilder::script, Script._DESERIALIZER, "script"); + op.add(AbstractBuilder::valueType, ValueType._DESERIALIZER, "value_type"); + op.add(AbstractBuilder::order, SortOrder._DESERIALIZER, "order"); + + } + +} diff --git a/java-client/src/main/java/co/elastic/clients/elasticsearch/_types/aggregations/CompositeAggregationSource.java b/java-client/src/main/java/co/elastic/clients/elasticsearch/_types/aggregations/CompositeAggregationSource.java index 0056a08e8..72e48c2f1 100644 --- a/java-client/src/main/java/co/elastic/clients/elasticsearch/_types/aggregations/CompositeAggregationSource.java +++ b/java-client/src/main/java/co/elastic/clients/elasticsearch/_types/aggregations/CompositeAggregationSource.java @@ -59,16 +59,16 @@ @JsonpDeserializable public class CompositeAggregationSource implements JsonpSerializable { @Nullable - private final TermsAggregation terms; + private final CompositeTermsAggregation terms; @Nullable - private final HistogramAggregation histogram; + private final CompositeHistogramAggregation histogram; @Nullable - private final DateHistogramAggregation dateHistogram; + private final CompositeDateHistogramAggregation dateHistogram; @Nullable - private final GeoTileGridAggregation geotileGrid; + private final CompositeGeoTileGridAggregation geotileGrid; // --------------------------------------------------------------------------------------------- @@ -89,7 +89,7 @@ public static CompositeAggregationSource of(Function implements ObjectBuilder { @Nullable - private TermsAggregation terms; + private CompositeTermsAggregation terms; @Nullable - private HistogramAggregation histogram; + private CompositeHistogramAggregation histogram; @Nullable - private DateHistogramAggregation dateHistogram; + private CompositeDateHistogramAggregation dateHistogram; @Nullable - private GeoTileGridAggregation geotileGrid; + private CompositeGeoTileGridAggregation geotileGrid; /** * API name: {@code terms} */ - public final Builder terms(@Nullable TermsAggregation value) { + public final Builder terms(@Nullable CompositeTermsAggregation value) { this.terms = value; return this; } @@ -188,14 +188,15 @@ public final Builder terms(@Nullable TermsAggregation value) { /** * API name: {@code terms} */ - public final Builder terms(Function> fn) { - return this.terms(fn.apply(new TermsAggregation.Builder()).build()); + public final Builder terms( + Function> fn) { + return this.terms(fn.apply(new CompositeTermsAggregation.Builder()).build()); } /** * API name: {@code histogram} */ - public final Builder histogram(@Nullable HistogramAggregation value) { + public final Builder histogram(@Nullable CompositeHistogramAggregation value) { this.histogram = value; return this; } @@ -203,14 +204,15 @@ public final Builder histogram(@Nullable HistogramAggregation value) { /** * API name: {@code histogram} */ - public final Builder histogram(Function> fn) { - return this.histogram(fn.apply(new HistogramAggregation.Builder()).build()); + public final Builder histogram( + Function> fn) { + return this.histogram(fn.apply(new CompositeHistogramAggregation.Builder()).build()); } /** * API name: {@code date_histogram} */ - public final Builder dateHistogram(@Nullable DateHistogramAggregation value) { + public final Builder dateHistogram(@Nullable CompositeDateHistogramAggregation value) { this.dateHistogram = value; return this; } @@ -219,14 +221,14 @@ public final Builder dateHistogram(@Nullable DateHistogramAggregation value) { * API name: {@code date_histogram} */ public final Builder dateHistogram( - Function> fn) { - return this.dateHistogram(fn.apply(new DateHistogramAggregation.Builder()).build()); + Function> fn) { + return this.dateHistogram(fn.apply(new CompositeDateHistogramAggregation.Builder()).build()); } /** * API name: {@code geotile_grid} */ - public final Builder geotileGrid(@Nullable GeoTileGridAggregation value) { + public final Builder geotileGrid(@Nullable CompositeGeoTileGridAggregation value) { this.geotileGrid = value; return this; } @@ -235,8 +237,8 @@ public final Builder geotileGrid(@Nullable GeoTileGridAggregation value) { * API name: {@code geotile_grid} */ public final Builder geotileGrid( - Function> fn) { - return this.geotileGrid(fn.apply(new GeoTileGridAggregation.Builder()).build()); + Function> fn) { + return this.geotileGrid(fn.apply(new CompositeGeoTileGridAggregation.Builder()).build()); } @Override @@ -268,10 +270,10 @@ public CompositeAggregationSource build() { protected static void setupCompositeAggregationSourceDeserializer( ObjectDeserializer op) { - op.add(Builder::terms, TermsAggregation._DESERIALIZER, "terms"); - op.add(Builder::histogram, HistogramAggregation._DESERIALIZER, "histogram"); - op.add(Builder::dateHistogram, DateHistogramAggregation._DESERIALIZER, "date_histogram"); - op.add(Builder::geotileGrid, GeoTileGridAggregation._DESERIALIZER, "geotile_grid"); + op.add(Builder::terms, CompositeTermsAggregation._DESERIALIZER, "terms"); + op.add(Builder::histogram, CompositeHistogramAggregation._DESERIALIZER, "histogram"); + op.add(Builder::dateHistogram, CompositeDateHistogramAggregation._DESERIALIZER, "date_histogram"); + op.add(Builder::geotileGrid, CompositeGeoTileGridAggregation._DESERIALIZER, "geotile_grid"); } diff --git a/java-client/src/main/java/co/elastic/clients/elasticsearch/_types/aggregations/CompositeDateHistogramAggregation.java b/java-client/src/main/java/co/elastic/clients/elasticsearch/_types/aggregations/CompositeDateHistogramAggregation.java new file mode 100644 index 000000000..adcd2aa35 --- /dev/null +++ b/java-client/src/main/java/co/elastic/clients/elasticsearch/_types/aggregations/CompositeDateHistogramAggregation.java @@ -0,0 +1,284 @@ +/* + * Licensed to Elasticsearch B.V. under one or more contributor + * license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright + * ownership. Elasticsearch B.V. licenses this file to you under + * the Apache License, Version 2.0 (the "License"); you may + * not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +package co.elastic.clients.elasticsearch._types.aggregations; + +import co.elastic.clients.elasticsearch._types.Time; +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.String; +import java.util.Objects; +import java.util.function.Function; +import javax.annotation.Nullable; + +//---------------------------------------------------------------- +// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. +//---------------------------------------------------------------- +// +// This code is generated from the Elasticsearch API specification +// at https://github.com/elastic/elasticsearch-specification +// +// Manual updates to this file will be lost when the code is +// re-generated. +// +// If you find a property that is missing or wrongly typed, please +// open an issue or a PR on the API specification repository. +// +//---------------------------------------------------------------- + +// typedef: _types.aggregations.CompositeDateHistogramAggregation + +/** + * + * @see API + * specification + */ +@JsonpDeserializable +public class CompositeDateHistogramAggregation extends CompositeAggregationBase { + @Nullable + private final String format; + + @Nullable + private final String calendarInterval; + + @Nullable + private final String fixedInterval; + + @Nullable + private final Time offset; + + @Nullable + private final String timeZone; + + // --------------------------------------------------------------------------------------------- + + private CompositeDateHistogramAggregation(Builder builder) { + super(builder); + + this.format = builder.format; + this.calendarInterval = builder.calendarInterval; + this.fixedInterval = builder.fixedInterval; + this.offset = builder.offset; + this.timeZone = builder.timeZone; + + } + + public static CompositeDateHistogramAggregation of( + Function> fn) { + return fn.apply(new Builder()).build(); + } + + /** + * API name: {@code format} + */ + @Nullable + public final String format() { + return this.format; + } + + /** + * Either calendar_interval or fixed_interval must be + * present + *

+ * API name: {@code calendar_interval} + */ + @Nullable + public final String calendarInterval() { + return this.calendarInterval; + } + + /** + * Either calendar_interval or fixed_interval must be + * present + *

+ * API name: {@code fixed_interval} + */ + @Nullable + public final String fixedInterval() { + return this.fixedInterval; + } + + /** + * API name: {@code offset} + */ + @Nullable + public final Time offset() { + return this.offset; + } + + /** + * API name: {@code time_zone} + */ + @Nullable + public final String timeZone() { + return this.timeZone; + } + + protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { + + super.serializeInternal(generator, mapper); + if (this.format != null) { + generator.writeKey("format"); + generator.write(this.format); + + } + if (this.calendarInterval != null) { + generator.writeKey("calendar_interval"); + generator.write(this.calendarInterval); + + } + if (this.fixedInterval != null) { + generator.writeKey("fixed_interval"); + generator.write(this.fixedInterval); + + } + if (this.offset != null) { + generator.writeKey("offset"); + this.offset.serialize(generator, mapper); + + } + if (this.timeZone != null) { + generator.writeKey("time_zone"); + generator.write(this.timeZone); + + } + + } + + // --------------------------------------------------------------------------------------------- + + /** + * Builder for {@link CompositeDateHistogramAggregation}. + */ + + public static class Builder extends CompositeAggregationBase.AbstractBuilder + implements + ObjectBuilder { + @Nullable + private String format; + + @Nullable + private String calendarInterval; + + @Nullable + private String fixedInterval; + + @Nullable + private Time offset; + + @Nullable + private String timeZone; + + /** + * API name: {@code format} + */ + public final Builder format(@Nullable String value) { + this.format = value; + return this; + } + + /** + * Either calendar_interval or fixed_interval must be + * present + *

+ * API name: {@code calendar_interval} + */ + public final Builder calendarInterval(@Nullable String value) { + this.calendarInterval = value; + return this; + } + + /** + * Either calendar_interval or fixed_interval must be + * present + *

+ * API name: {@code fixed_interval} + */ + public final Builder fixedInterval(@Nullable String value) { + this.fixedInterval = value; + return this; + } + + /** + * API name: {@code offset} + */ + public final Builder offset(@Nullable Time value) { + this.offset = value; + return this; + } + + /** + * API name: {@code offset} + */ + public final Builder offset(Function> fn) { + return this.offset(fn.apply(new Time.Builder()).build()); + } + + /** + * API name: {@code time_zone} + */ + public final Builder timeZone(@Nullable String value) { + this.timeZone = value; + return this; + } + + @Override + protected Builder self() { + return this; + } + + /** + * Builds a {@link CompositeDateHistogramAggregation}. + * + * @throws NullPointerException + * if some of the required fields are null. + */ + public CompositeDateHistogramAggregation build() { + _checkSingleUse(); + + return new CompositeDateHistogramAggregation(this); + } + } + + // --------------------------------------------------------------------------------------------- + + /** + * Json deserializer for {@link CompositeDateHistogramAggregation} + */ + public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer + .lazy(Builder::new, CompositeDateHistogramAggregation::setupCompositeDateHistogramAggregationDeserializer); + + protected static void setupCompositeDateHistogramAggregationDeserializer( + ObjectDeserializer op) { + CompositeAggregationBase.setupCompositeAggregationBaseDeserializer(op); + op.add(Builder::format, JsonpDeserializer.stringDeserializer(), "format"); + op.add(Builder::calendarInterval, JsonpDeserializer.stringDeserializer(), "calendar_interval"); + op.add(Builder::fixedInterval, JsonpDeserializer.stringDeserializer(), "fixed_interval"); + op.add(Builder::offset, Time._DESERIALIZER, "offset"); + op.add(Builder::timeZone, JsonpDeserializer.stringDeserializer(), "time_zone"); + + } + +} diff --git a/java-client/src/main/java/co/elastic/clients/elasticsearch/_types/aggregations/CompositeGeoTileGridAggregation.java b/java-client/src/main/java/co/elastic/clients/elasticsearch/_types/aggregations/CompositeGeoTileGridAggregation.java new file mode 100644 index 000000000..42f507e59 --- /dev/null +++ b/java-client/src/main/java/co/elastic/clients/elasticsearch/_types/aggregations/CompositeGeoTileGridAggregation.java @@ -0,0 +1,185 @@ +/* + * Licensed to Elasticsearch B.V. under one or more contributor + * license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright + * ownership. Elasticsearch B.V. licenses this file to you under + * the Apache License, Version 2.0 (the "License"); you may + * not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +package co.elastic.clients.elasticsearch._types.aggregations; + +import co.elastic.clients.elasticsearch._types.GeoBounds; +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.Integer; +import java.util.Objects; +import java.util.function.Function; +import javax.annotation.Nullable; + +//---------------------------------------------------------------- +// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. +//---------------------------------------------------------------- +// +// This code is generated from the Elasticsearch API specification +// at https://github.com/elastic/elasticsearch-specification +// +// Manual updates to this file will be lost when the code is +// re-generated. +// +// If you find a property that is missing or wrongly typed, please +// open an issue or a PR on the API specification repository. +// +//---------------------------------------------------------------- + +// typedef: _types.aggregations.CompositeGeoTileGridAggregation + +/** + * + * @see API + * specification + */ +@JsonpDeserializable +public class CompositeGeoTileGridAggregation extends CompositeAggregationBase { + @Nullable + private final Integer precision; + + @Nullable + private final GeoBounds bounds; + + // --------------------------------------------------------------------------------------------- + + private CompositeGeoTileGridAggregation(Builder builder) { + super(builder); + + this.precision = builder.precision; + this.bounds = builder.bounds; + + } + + public static CompositeGeoTileGridAggregation of( + Function> fn) { + return fn.apply(new Builder()).build(); + } + + /** + * API name: {@code precision} + */ + @Nullable + public final Integer precision() { + return this.precision; + } + + /** + * API name: {@code bounds} + */ + @Nullable + public final GeoBounds bounds() { + return this.bounds; + } + + protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { + + super.serializeInternal(generator, mapper); + if (this.precision != null) { + generator.writeKey("precision"); + generator.write(this.precision); + + } + if (this.bounds != null) { + generator.writeKey("bounds"); + this.bounds.serialize(generator, mapper); + + } + + } + + // --------------------------------------------------------------------------------------------- + + /** + * Builder for {@link CompositeGeoTileGridAggregation}. + */ + + public static class Builder extends CompositeAggregationBase.AbstractBuilder + implements + ObjectBuilder { + @Nullable + private Integer precision; + + @Nullable + private GeoBounds bounds; + + /** + * API name: {@code precision} + */ + public final Builder precision(@Nullable Integer value) { + this.precision = value; + return this; + } + + /** + * API name: {@code bounds} + */ + public final Builder bounds(@Nullable GeoBounds value) { + this.bounds = value; + return this; + } + + /** + * API name: {@code bounds} + */ + public final Builder bounds(Function> fn) { + return this.bounds(fn.apply(new GeoBounds.Builder()).build()); + } + + @Override + protected Builder self() { + return this; + } + + /** + * Builds a {@link CompositeGeoTileGridAggregation}. + * + * @throws NullPointerException + * if some of the required fields are null. + */ + public CompositeGeoTileGridAggregation build() { + _checkSingleUse(); + + return new CompositeGeoTileGridAggregation(this); + } + } + + // --------------------------------------------------------------------------------------------- + + /** + * Json deserializer for {@link CompositeGeoTileGridAggregation} + */ + public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer + .lazy(Builder::new, CompositeGeoTileGridAggregation::setupCompositeGeoTileGridAggregationDeserializer); + + protected static void setupCompositeGeoTileGridAggregationDeserializer( + ObjectDeserializer op) { + CompositeAggregationBase.setupCompositeAggregationBaseDeserializer(op); + op.add(Builder::precision, JsonpDeserializer.integerDeserializer(), "precision"); + op.add(Builder::bounds, GeoBounds._DESERIALIZER, "bounds"); + + } + +} diff --git a/java-client/src/main/java/co/elastic/clients/elasticsearch/_types/aggregations/CompositeHistogramAggregation.java b/java-client/src/main/java/co/elastic/clients/elasticsearch/_types/aggregations/CompositeHistogramAggregation.java new file mode 100644 index 000000000..676a502c8 --- /dev/null +++ b/java-client/src/main/java/co/elastic/clients/elasticsearch/_types/aggregations/CompositeHistogramAggregation.java @@ -0,0 +1,141 @@ +/* + * Licensed to Elasticsearch B.V. under one or more contributor + * license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright + * ownership. Elasticsearch B.V. licenses this file to you under + * the Apache License, Version 2.0 (the "License"); you may + * not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +package co.elastic.clients.elasticsearch._types.aggregations; + +import co.elastic.clients.json.JsonpDeserializable; +import co.elastic.clients.json.JsonpDeserializer; +import co.elastic.clients.json.JsonpMapper; +import co.elastic.clients.json.ObjectBuilderDeserializer; +import co.elastic.clients.json.ObjectDeserializer; +import co.elastic.clients.util.ApiTypeHelper; +import co.elastic.clients.util.ObjectBuilder; +import jakarta.json.stream.JsonGenerator; +import java.lang.Double; +import java.util.Objects; +import java.util.function.Function; + +//---------------------------------------------------------------- +// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. +//---------------------------------------------------------------- +// +// This code is generated from the Elasticsearch API specification +// at https://github.com/elastic/elasticsearch-specification +// +// Manual updates to this file will be lost when the code is +// re-generated. +// +// If you find a property that is missing or wrongly typed, please +// open an issue or a PR on the API specification repository. +// +//---------------------------------------------------------------- + +// typedef: _types.aggregations.CompositeHistogramAggregation + +/** + * + * @see API + * specification + */ +@JsonpDeserializable +public class CompositeHistogramAggregation extends CompositeAggregationBase { + private final double interval; + + // --------------------------------------------------------------------------------------------- + + private CompositeHistogramAggregation(Builder builder) { + super(builder); + + this.interval = ApiTypeHelper.requireNonNull(builder.interval, this, "interval"); + + } + + public static CompositeHistogramAggregation of(Function> fn) { + return fn.apply(new Builder()).build(); + } + + /** + * Required - API name: {@code interval} + */ + public final double interval() { + return this.interval; + } + + protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { + + super.serializeInternal(generator, mapper); + generator.writeKey("interval"); + generator.write(this.interval); + + } + + // --------------------------------------------------------------------------------------------- + + /** + * Builder for {@link CompositeHistogramAggregation}. + */ + + public static class Builder extends CompositeAggregationBase.AbstractBuilder + implements + ObjectBuilder { + private Double interval; + + /** + * Required - API name: {@code interval} + */ + public final Builder interval(double value) { + this.interval = value; + return this; + } + + @Override + protected Builder self() { + return this; + } + + /** + * Builds a {@link CompositeHistogramAggregation}. + * + * @throws NullPointerException + * if some of the required fields are null. + */ + public CompositeHistogramAggregation build() { + _checkSingleUse(); + + return new CompositeHistogramAggregation(this); + } + } + + // --------------------------------------------------------------------------------------------- + + /** + * Json deserializer for {@link CompositeHistogramAggregation} + */ + public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer + .lazy(Builder::new, CompositeHistogramAggregation::setupCompositeHistogramAggregationDeserializer); + + protected static void setupCompositeHistogramAggregationDeserializer( + ObjectDeserializer op) { + CompositeAggregationBase.setupCompositeAggregationBaseDeserializer(op); + op.add(Builder::interval, JsonpDeserializer.doubleDeserializer(), "interval"); + + } + +} diff --git a/java-client/src/main/java/co/elastic/clients/elasticsearch/_types/aggregations/CompositeTermsAggregation.java b/java-client/src/main/java/co/elastic/clients/elasticsearch/_types/aggregations/CompositeTermsAggregation.java new file mode 100644 index 000000000..d198f7636 --- /dev/null +++ b/java-client/src/main/java/co/elastic/clients/elasticsearch/_types/aggregations/CompositeTermsAggregation.java @@ -0,0 +1,108 @@ +/* + * Licensed to Elasticsearch B.V. under one or more contributor + * license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright + * ownership. Elasticsearch B.V. licenses this file to you under + * the Apache License, Version 2.0 (the "License"); you may + * not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +package co.elastic.clients.elasticsearch._types.aggregations; + +import co.elastic.clients.json.JsonpDeserializable; +import co.elastic.clients.json.JsonpDeserializer; +import co.elastic.clients.json.ObjectBuilderDeserializer; +import co.elastic.clients.json.ObjectDeserializer; +import co.elastic.clients.util.ObjectBuilder; +import jakarta.json.stream.JsonGenerator; +import java.util.Objects; +import java.util.function.Function; + +//---------------------------------------------------------------- +// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. +//---------------------------------------------------------------- +// +// This code is generated from the Elasticsearch API specification +// at https://github.com/elastic/elasticsearch-specification +// +// Manual updates to this file will be lost when the code is +// re-generated. +// +// If you find a property that is missing or wrongly typed, please +// open an issue or a PR on the API specification repository. +// +//---------------------------------------------------------------- + +// typedef: _types.aggregations.CompositeTermsAggregation + +/** + * + * @see API + * specification + */ +@JsonpDeserializable +public class CompositeTermsAggregation extends CompositeAggregationBase { + // --------------------------------------------------------------------------------------------- + + private CompositeTermsAggregation(Builder builder) { + super(builder); + + } + + public static CompositeTermsAggregation of(Function> fn) { + return fn.apply(new Builder()).build(); + } + + // --------------------------------------------------------------------------------------------- + + /** + * Builder for {@link CompositeTermsAggregation}. + */ + + public static class Builder extends CompositeAggregationBase.AbstractBuilder + implements + ObjectBuilder { + @Override + protected Builder self() { + return this; + } + + /** + * Builds a {@link CompositeTermsAggregation}. + * + * @throws NullPointerException + * if some of the required fields are null. + */ + public CompositeTermsAggregation build() { + _checkSingleUse(); + + return new CompositeTermsAggregation(this); + } + } + + // --------------------------------------------------------------------------------------------- + + /** + * Json deserializer for {@link CompositeTermsAggregation} + */ + public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer + .lazy(Builder::new, CompositeTermsAggregation::setupCompositeTermsAggregationDeserializer); + + protected static void setupCompositeTermsAggregationDeserializer( + ObjectDeserializer op) { + CompositeAggregationBase.setupCompositeAggregationBaseDeserializer(op); + + } + +} diff --git a/java-client/src/main/java/co/elastic/clients/elasticsearch/_types/analysis/PatternTokenizer.java b/java-client/src/main/java/co/elastic/clients/elasticsearch/_types/analysis/PatternTokenizer.java index 4db881e15..8199d1a5b 100644 --- a/java-client/src/main/java/co/elastic/clients/elasticsearch/_types/analysis/PatternTokenizer.java +++ b/java-client/src/main/java/co/elastic/clients/elasticsearch/_types/analysis/PatternTokenizer.java @@ -24,7 +24,6 @@ import co.elastic.clients.json.JsonpMapper; import co.elastic.clients.json.ObjectBuilderDeserializer; import co.elastic.clients.json.ObjectDeserializer; -import co.elastic.clients.util.ApiTypeHelper; import co.elastic.clients.util.ObjectBuilder; import jakarta.json.stream.JsonGenerator; import java.lang.Integer; @@ -58,10 +57,13 @@ */ @JsonpDeserializable public class PatternTokenizer extends TokenizerBase implements TokenizerDefinitionVariant { + @Nullable private final String flags; - private final int group; + @Nullable + private final Integer group; + @Nullable private final String pattern; // --------------------------------------------------------------------------------------------- @@ -69,9 +71,9 @@ public class PatternTokenizer extends TokenizerBase implements TokenizerDefiniti private PatternTokenizer(Builder builder) { super(builder); - this.flags = ApiTypeHelper.requireNonNull(builder.flags, this, "flags"); - this.group = ApiTypeHelper.requireNonNull(builder.group, this, "group"); - this.pattern = ApiTypeHelper.requireNonNull(builder.pattern, this, "pattern"); + this.flags = builder.flags; + this.group = builder.group; + this.pattern = builder.pattern; } @@ -88,22 +90,25 @@ public TokenizerDefinition.Kind _tokenizerDefinitionKind() { } /** - * Required - API name: {@code flags} + * API name: {@code flags} */ + @Nullable public final String flags() { return this.flags; } /** - * Required - API name: {@code group} + * API name: {@code group} */ - public final int group() { + @Nullable + public final Integer group() { return this.group; } /** - * Required - API name: {@code pattern} + * API name: {@code pattern} */ + @Nullable public final String pattern() { return this.pattern; } @@ -112,14 +117,21 @@ protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { generator.write("type", "pattern"); super.serializeInternal(generator, mapper); - generator.writeKey("flags"); - generator.write(this.flags); + if (this.flags != null) { + generator.writeKey("flags"); + generator.write(this.flags); - generator.writeKey("group"); - generator.write(this.group); + } + if (this.group != null) { + generator.writeKey("group"); + generator.write(this.group); + + } + if (this.pattern != null) { + generator.writeKey("pattern"); + generator.write(this.pattern); - generator.writeKey("pattern"); - generator.write(this.pattern); + } } @@ -132,32 +144,35 @@ protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { public static class Builder extends TokenizerBase.AbstractBuilder implements ObjectBuilder { + @Nullable private String flags; + @Nullable private Integer group; + @Nullable private String pattern; /** - * Required - API name: {@code flags} + * API name: {@code flags} */ - public final Builder flags(String value) { + public final Builder flags(@Nullable String value) { this.flags = value; return this; } /** - * Required - API name: {@code group} + * API name: {@code group} */ - public final Builder group(int value) { + public final Builder group(@Nullable Integer value) { this.group = value; return this; } /** - * Required - API name: {@code pattern} + * API name: {@code pattern} */ - public final Builder pattern(String value) { + public final Builder pattern(@Nullable String value) { this.pattern = value; return this; } 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 6dbe23d8b..46faae454 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 @@ -294,8 +294,8 @@ '_types.StoredScriptId': '_types/Scripting.ts#L54-L56', '_types.SuggestMode': '_types/common.ts#L259-L263', '_types.ThreadType': '_types/common.ts#L265-L269', -'_types.Time': '_types/Time.ts#L62-L68', -'_types.TimeUnit': '_types/Time.ts#L70-L85', +'_types.Time': '_types/Time.ts#L33-L39', +'_types.TimeUnit': '_types/Time.ts#L41-L56', '_types.TopLeftBottomRightGeoBounds': '_types/Geo.ts#L142-L145', '_types.TopRightBottomLeftGeoBounds': '_types/Geo.ts#L147-L150', '_types.TransformContainer': '_types/Transform.ts#L27-L34', @@ -308,64 +308,69 @@ '_types.WktGeoBounds': '_types/Geo.ts#L131-L133', '_types.WriteResponseBase': '_types/Base.ts#L37-L47', '_types.aggregations.AdjacencyMatrixAggregate': '_types/aggregations/Aggregate.ts#L556-L558', -'_types.aggregations.AdjacencyMatrixAggregation': '_types/aggregations/bucket.ts#L48-L50', +'_types.aggregations.AdjacencyMatrixAggregation': '_types/aggregations/bucket.ts#L55-L57', '_types.aggregations.AdjacencyMatrixBucket': '_types/aggregations/Aggregate.ts#L560-L562', '_types.aggregations.Aggregate': '_types/aggregations/Aggregate.ts#L31-L113', '_types.aggregations.AggregateBase': '_types/aggregations/Aggregate.ts#L124-L126', '_types.aggregations.Aggregation': '_types/aggregations/Aggregation.ts#L23-L26', '_types.aggregations.AggregationContainer': '_types/aggregations/AggregationContainer.ts#L99-L186', -'_types.aggregations.AggregationRange': '_types/aggregations/bucket.ts#L268-L272', +'_types.aggregations.AggregationRange': '_types/aggregations/bucket.ts#L307-L311', '_types.aggregations.ArrayPercentilesItem': '_types/aggregations/Aggregate.ts#L150-L154', '_types.aggregations.AutoDateHistogramAggregate': '_types/aggregations/Aggregate.ts#L346-L350', -'_types.aggregations.AutoDateHistogramAggregation': '_types/aggregations/bucket.ts#L52-L62', +'_types.aggregations.AutoDateHistogramAggregation': '_types/aggregations/bucket.ts#L59-L69', '_types.aggregations.AverageAggregation': '_types/aggregations/metric.ts#L48-L48', '_types.aggregations.AverageBucketAggregation': '_types/aggregations/pipeline.ts#L58-L58', '_types.aggregations.AvgAggregate': '_types/aggregations/Aggregate.ts#L199-L200', '_types.aggregations.BoxPlotAggregate': '_types/aggregations/Aggregate.ts#L671-L687', '_types.aggregations.BoxplotAggregation': '_types/aggregations/metric.ts#L50-L52', -'_types.aggregations.BucketAggregationBase': '_types/aggregations/bucket.ts#L41-L46', +'_types.aggregations.BucketAggregationBase': '_types/aggregations/bucket.ts#L48-L53', '_types.aggregations.BucketMetricValueAggregate': '_types/aggregations/Aggregate.ts#L223-L226', '_types.aggregations.BucketScriptAggregation': '_types/aggregations/pipeline.ts#L60-L62', '_types.aggregations.BucketSelectorAggregation': '_types/aggregations/pipeline.ts#L64-L66', '_types.aggregations.BucketSortAggregation': '_types/aggregations/pipeline.ts#L68-L73', '_types.aggregations.Buckets': '_types/aggregations/Aggregate.ts#L306-L315', '_types.aggregations.BucketsPath': '_types/aggregations/pipeline.ts#L33-L39', -'_types.aggregations.CalendarInterval': '_types/aggregations/bucket.ts#L111-L128', +'_types.aggregations.CalendarInterval': '_types/aggregations/bucket.ts#L150-L167', '_types.aggregations.CardinalityAggregate': '_types/aggregations/Aggregate.ts#L128-L131', '_types.aggregations.CardinalityAggregation': '_types/aggregations/metric.ts#L54-L57', -'_types.aggregations.ChiSquareHeuristic': '_types/aggregations/bucket.ts#L292-L295', +'_types.aggregations.ChiSquareHeuristic': '_types/aggregations/bucket.ts#L331-L334', '_types.aggregations.ChildrenAggregate': '_types/aggregations/Aggregate.ts#L741-L742', -'_types.aggregations.ChildrenAggregation': '_types/aggregations/bucket.ts#L73-L75', +'_types.aggregations.ChildrenAggregation': '_types/aggregations/bucket.ts#L80-L82', '_types.aggregations.ClassificationInferenceOptions': '_types/aggregations/pipeline.ts#L107-L121', '_types.aggregations.CompositeAggregate': '_types/aggregations/Aggregate.ts#L601-L606', -'_types.aggregations.CompositeAggregation': '_types/aggregations/bucket.ts#L79-L84', -'_types.aggregations.CompositeAggregationSource': '_types/aggregations/bucket.ts#L86-L91', +'_types.aggregations.CompositeAggregation': '_types/aggregations/bucket.ts#L86-L91', +'_types.aggregations.CompositeAggregationBase': '_types/aggregations/bucket.ts#L100-L109', +'_types.aggregations.CompositeAggregationSource': '_types/aggregations/bucket.ts#L93-L98', '_types.aggregations.CompositeBucket': '_types/aggregations/Aggregate.ts#L608-L610', +'_types.aggregations.CompositeDateHistogramAggregation': '_types/aggregations/bucket.ts#L117-L125', +'_types.aggregations.CompositeGeoTileGridAggregation': '_types/aggregations/bucket.ts#L127-L130', +'_types.aggregations.CompositeHistogramAggregation': '_types/aggregations/bucket.ts#L113-L115', +'_types.aggregations.CompositeTermsAggregation': '_types/aggregations/bucket.ts#L111-L111', '_types.aggregations.CumulativeCardinalityAggregate': '_types/aggregations/Aggregate.ts#L712-L720', '_types.aggregations.CumulativeCardinalityAggregation': '_types/aggregations/pipeline.ts#L75-L75', '_types.aggregations.CumulativeSumAggregation': '_types/aggregations/pipeline.ts#L77-L77', '_types.aggregations.DateHistogramAggregate': '_types/aggregations/Aggregate.ts#L338-L339', -'_types.aggregations.DateHistogramAggregation': '_types/aggregations/bucket.ts#L93-L109', +'_types.aggregations.DateHistogramAggregation': '_types/aggregations/bucket.ts#L132-L148', '_types.aggregations.DateHistogramBucket': '_types/aggregations/Aggregate.ts#L341-L344', '_types.aggregations.DateRangeAggregate': '_types/aggregations/Aggregate.ts#L526-L531', -'_types.aggregations.DateRangeAggregation': '_types/aggregations/bucket.ts#L130-L137', -'_types.aggregations.DateRangeExpression': '_types/aggregations/bucket.ts#L148-L152', +'_types.aggregations.DateRangeAggregation': '_types/aggregations/bucket.ts#L169-L176', +'_types.aggregations.DateRangeExpression': '_types/aggregations/bucket.ts#L187-L191', '_types.aggregations.DerivativeAggregate': '_types/aggregations/Aggregate.ts#L217-L221', '_types.aggregations.DerivativeAggregation': '_types/aggregations/pipeline.ts#L79-L79', -'_types.aggregations.DiversifiedSamplerAggregation': '_types/aggregations/bucket.ts#L154-L160', +'_types.aggregations.DiversifiedSamplerAggregation': '_types/aggregations/bucket.ts#L193-L199', '_types.aggregations.DoubleTermsAggregate': '_types/aggregations/Aggregate.ts#L401-L406', '_types.aggregations.DoubleTermsBucket': '_types/aggregations/Aggregate.ts#L408-L411', '_types.aggregations.EwmaModelSettings': '_types/aggregations/pipeline.ts#L166-L168', '_types.aggregations.EwmaMovingAverageAggregation': '_types/aggregations/pipeline.ts#L151-L154', -'_types.aggregations.ExtendedBounds': '_types/aggregations/bucket.ts#L201-L204', +'_types.aggregations.ExtendedBounds': '_types/aggregations/bucket.ts#L240-L243', '_types.aggregations.ExtendedStatsAggregate': '_types/aggregations/Aggregate.ts#L268-L286', '_types.aggregations.ExtendedStatsAggregation': '_types/aggregations/metric.ts#L59-L61', '_types.aggregations.ExtendedStatsBucketAggregate': '_types/aggregations/Aggregate.ts#L288-L289', '_types.aggregations.ExtendedStatsBucketAggregation': '_types/aggregations/pipeline.ts#L81-L83', -'_types.aggregations.FieldDateMath': '_types/aggregations/bucket.ts#L139-L146', +'_types.aggregations.FieldDateMath': '_types/aggregations/bucket.ts#L178-L185', '_types.aggregations.FilterAggregate': '_types/aggregations/Aggregate.ts#L485-L486', '_types.aggregations.FiltersAggregate': '_types/aggregations/Aggregate.ts#L551-L552', -'_types.aggregations.FiltersAggregation': '_types/aggregations/bucket.ts#L168-L173', +'_types.aggregations.FiltersAggregation': '_types/aggregations/bucket.ts#L207-L212', '_types.aggregations.FiltersBucket': '_types/aggregations/Aggregate.ts#L554-L554', '_types.aggregations.FormatMetricAggregationBase': '_types/aggregations/metric.ts#L40-L42', '_types.aggregations.FormattableMetricAggregation': '_types/aggregations/metric.ts#L44-L46', @@ -375,25 +380,25 @@ '_types.aggregations.GeoCentroidAggregate': '_types/aggregations/Aggregate.ts#L298-L302', '_types.aggregations.GeoCentroidAggregation': '_types/aggregations/metric.ts#L67-L70', '_types.aggregations.GeoDistanceAggregate': '_types/aggregations/Aggregate.ts#L533-L537', -'_types.aggregations.GeoDistanceAggregation': '_types/aggregations/bucket.ts#L175-L181', +'_types.aggregations.GeoDistanceAggregation': '_types/aggregations/bucket.ts#L214-L220', '_types.aggregations.GeoHashGridAggregate': '_types/aggregations/Aggregate.ts#L496-L498', -'_types.aggregations.GeoHashGridAggregation': '_types/aggregations/bucket.ts#L183-L189', +'_types.aggregations.GeoHashGridAggregation': '_types/aggregations/bucket.ts#L222-L228', '_types.aggregations.GeoHashGridBucket': '_types/aggregations/Aggregate.ts#L500-L502', '_types.aggregations.GeoLineAggregate': '_types/aggregations/Aggregate.ts#L749-L756', '_types.aggregations.GeoLineAggregation': '_types/aggregations/metric.ts#L72-L78', '_types.aggregations.GeoLinePoint': '_types/aggregations/metric.ts#L84-L86', '_types.aggregations.GeoLineSort': '_types/aggregations/metric.ts#L80-L82', '_types.aggregations.GeoTileGridAggregate': '_types/aggregations/Aggregate.ts#L504-L506', -'_types.aggregations.GeoTileGridAggregation': '_types/aggregations/bucket.ts#L191-L197', +'_types.aggregations.GeoTileGridAggregation': '_types/aggregations/bucket.ts#L230-L236', '_types.aggregations.GeoTileGridBucket': '_types/aggregations/Aggregate.ts#L508-L510', '_types.aggregations.GlobalAggregate': '_types/aggregations/Aggregate.ts#L482-L483', -'_types.aggregations.GlobalAggregation': '_types/aggregations/bucket.ts#L199-L199', -'_types.aggregations.GoogleNormalizedDistanceHeuristic': '_types/aggregations/bucket.ts#L297-L299', +'_types.aggregations.GlobalAggregation': '_types/aggregations/bucket.ts#L238-L238', +'_types.aggregations.GoogleNormalizedDistanceHeuristic': '_types/aggregations/bucket.ts#L336-L338', '_types.aggregations.HdrMethod': '_types/aggregations/metric.ts#L110-L112', '_types.aggregations.HdrPercentileRanksAggregate': '_types/aggregations/Aggregate.ts#L159-L160', '_types.aggregations.HdrPercentilesAggregate': '_types/aggregations/Aggregate.ts#L156-L157', '_types.aggregations.HistogramAggregate': '_types/aggregations/Aggregate.ts#L330-L331', -'_types.aggregations.HistogramAggregation': '_types/aggregations/bucket.ts#L206-L218', +'_types.aggregations.HistogramAggregation': '_types/aggregations/bucket.ts#L245-L257', '_types.aggregations.HistogramBucket': '_types/aggregations/Aggregate.ts#L333-L336', '_types.aggregations.HoltLinearModelSettings': '_types/aggregations/pipeline.ts#L170-L173', '_types.aggregations.HoltMovingAverageAggregation': '_types/aggregations/pipeline.ts#L156-L159', @@ -407,8 +412,8 @@ '_types.aggregations.InferenceFeatureImportance': '_types/aggregations/Aggregate.ts#L643-L647', '_types.aggregations.InferenceTopClassEntry': '_types/aggregations/Aggregate.ts#L637-L641', '_types.aggregations.IpRangeAggregate': '_types/aggregations/Aggregate.ts#L539-L541', -'_types.aggregations.IpRangeAggregation': '_types/aggregations/bucket.ts#L220-L223', -'_types.aggregations.IpRangeAggregationRange': '_types/aggregations/bucket.ts#L225-L229', +'_types.aggregations.IpRangeAggregation': '_types/aggregations/bucket.ts#L259-L262', +'_types.aggregations.IpRangeAggregationRange': '_types/aggregations/bucket.ts#L264-L268', '_types.aggregations.IpRangeBucket': '_types/aggregations/Aggregate.ts#L543-L547', '_types.aggregations.LinearMovingAverageAggregation': '_types/aggregations/pipeline.ts#L141-L144', '_types.aggregations.LongRareTermsAggregate': '_types/aggregations/Aggregate.ts#L421-L426', @@ -428,9 +433,9 @@ '_types.aggregations.MinAggregate': '_types/aggregations/Aggregate.ts#L187-L188', '_types.aggregations.MinAggregation': '_types/aggregations/metric.ts#L94-L94', '_types.aggregations.MinBucketAggregation': '_types/aggregations/pipeline.ts#L125-L125', -'_types.aggregations.MinimumInterval': '_types/aggregations/bucket.ts#L64-L71', +'_types.aggregations.MinimumInterval': '_types/aggregations/bucket.ts#L71-L78', '_types.aggregations.MissingAggregate': '_types/aggregations/Aggregate.ts#L473-L474', -'_types.aggregations.MissingAggregation': '_types/aggregations/bucket.ts#L231-L234', +'_types.aggregations.MissingAggregation': '_types/aggregations/bucket.ts#L270-L273', '_types.aggregations.MissingOrder': '_types/aggregations/AggregationContainer.ts#L189-L193', '_types.aggregations.MovingAverageAggregation': '_types/aggregations/pipeline.ts#L127-L133', '_types.aggregations.MovingAverageAggregationBase': '_types/aggregations/pipeline.ts#L135-L139', @@ -438,18 +443,18 @@ '_types.aggregations.MovingPercentilesAggregation': '_types/aggregations/pipeline.ts#L195-L199', '_types.aggregations.MultiBucketAggregateBase': '_types/aggregations/Aggregate.ts#L317-L319', '_types.aggregations.MultiBucketBase': '_types/aggregations/Aggregate.ts#L321-L328', -'_types.aggregations.MultiTermLookup': '_types/aggregations/bucket.ts#L247-L250', +'_types.aggregations.MultiTermLookup': '_types/aggregations/bucket.ts#L286-L289', '_types.aggregations.MultiTermsAggregate': '_types/aggregations/Aggregate.ts#L451-L453', -'_types.aggregations.MultiTermsAggregation': '_types/aggregations/bucket.ts#L236-L245', +'_types.aggregations.MultiTermsAggregation': '_types/aggregations/bucket.ts#L275-L284', '_types.aggregations.MultiTermsBucket': '_types/aggregations/Aggregate.ts#L455-L459', -'_types.aggregations.MutualInformationHeuristic': '_types/aggregations/bucket.ts#L301-L304', +'_types.aggregations.MutualInformationHeuristic': '_types/aggregations/bucket.ts#L340-L343', '_types.aggregations.NestedAggregate': '_types/aggregations/Aggregate.ts#L476-L477', -'_types.aggregations.NestedAggregation': '_types/aggregations/bucket.ts#L252-L254', +'_types.aggregations.NestedAggregation': '_types/aggregations/bucket.ts#L291-L293', '_types.aggregations.NormalizeAggregation': '_types/aggregations/pipeline.ts#L201-L203', '_types.aggregations.NormalizeMethod': '_types/aggregations/pipeline.ts#L205-L213', '_types.aggregations.ParentAggregate': '_types/aggregations/Aggregate.ts#L744-L745', -'_types.aggregations.ParentAggregation': '_types/aggregations/bucket.ts#L256-L258', -'_types.aggregations.PercentageScoreHeuristic': '_types/aggregations/bucket.ts#L306-L306', +'_types.aggregations.ParentAggregation': '_types/aggregations/bucket.ts#L295-L297', +'_types.aggregations.PercentageScoreHeuristic': '_types/aggregations/bucket.ts#L345-L345', '_types.aggregations.PercentileRanksAggregation': '_types/aggregations/metric.ts#L96-L101', '_types.aggregations.Percentiles': '_types/aggregations/Aggregate.ts#L140-L141', '_types.aggregations.PercentilesAggregateBase': '_types/aggregations/Aggregate.ts#L136-L138', @@ -458,19 +463,19 @@ '_types.aggregations.PercentilesBucketAggregation': '_types/aggregations/pipeline.ts#L215-L217', '_types.aggregations.PipelineAggregationBase': '_types/aggregations/pipeline.ts#L27-L31', '_types.aggregations.RangeAggregate': '_types/aggregations/Aggregate.ts#L514-L515', -'_types.aggregations.RangeAggregation': '_types/aggregations/bucket.ts#L260-L266', +'_types.aggregations.RangeAggregation': '_types/aggregations/bucket.ts#L299-L305', '_types.aggregations.RangeBucket': '_types/aggregations/Aggregate.ts#L517-L524', -'_types.aggregations.RareTermsAggregation': '_types/aggregations/bucket.ts#L274-L282', +'_types.aggregations.RareTermsAggregation': '_types/aggregations/bucket.ts#L313-L321', '_types.aggregations.RateAggregate': '_types/aggregations/Aggregate.ts#L706-L710', '_types.aggregations.RateAggregation': '_types/aggregations/metric.ts#L118-L121', '_types.aggregations.RateMode': '_types/aggregations/metric.ts#L123-L126', '_types.aggregations.RegressionInferenceOptions': '_types/aggregations/pipeline.ts#L97-L105', '_types.aggregations.ReverseNestedAggregate': '_types/aggregations/Aggregate.ts#L479-L480', -'_types.aggregations.ReverseNestedAggregation': '_types/aggregations/bucket.ts#L284-L286', +'_types.aggregations.ReverseNestedAggregation': '_types/aggregations/bucket.ts#L323-L325', '_types.aggregations.SamplerAggregate': '_types/aggregations/Aggregate.ts#L488-L489', -'_types.aggregations.SamplerAggregation': '_types/aggregations/bucket.ts#L288-L290', -'_types.aggregations.SamplerAggregationExecutionHint': '_types/aggregations/bucket.ts#L162-L166', -'_types.aggregations.ScriptedHeuristic': '_types/aggregations/bucket.ts#L308-L310', +'_types.aggregations.SamplerAggregation': '_types/aggregations/bucket.ts#L327-L329', +'_types.aggregations.SamplerAggregationExecutionHint': '_types/aggregations/bucket.ts#L201-L205', +'_types.aggregations.ScriptedHeuristic': '_types/aggregations/bucket.ts#L347-L349', '_types.aggregations.ScriptedMetricAggregate': '_types/aggregations/Aggregate.ts#L614-L617', '_types.aggregations.ScriptedMetricAggregation': '_types/aggregations/metric.ts#L128-L134', '_types.aggregations.SerialDifferencingAggregation': '_types/aggregations/pipeline.ts#L219-L221', @@ -479,9 +484,9 @@ '_types.aggregations.SignificantStringTermsAggregate': '_types/aggregations/Aggregate.ts#L585-L587', '_types.aggregations.SignificantStringTermsBucket': '_types/aggregations/Aggregate.ts#L589-L591', '_types.aggregations.SignificantTermsAggregateBase': '_types/aggregations/Aggregate.ts#L564-L569', -'_types.aggregations.SignificantTermsAggregation': '_types/aggregations/bucket.ts#L312-L327', +'_types.aggregations.SignificantTermsAggregation': '_types/aggregations/bucket.ts#L351-L366', '_types.aggregations.SignificantTermsBucketBase': '_types/aggregations/Aggregate.ts#L575-L578', -'_types.aggregations.SignificantTextAggregation': '_types/aggregations/bucket.ts#L329-L346', +'_types.aggregations.SignificantTextAggregation': '_types/aggregations/bucket.ts#L368-L385', '_types.aggregations.SimpleMovingAverageAggregation': '_types/aggregations/pipeline.ts#L146-L149', '_types.aggregations.SimpleValueAggregate': '_types/aggregations/Aggregate.ts#L214-L215', '_types.aggregations.SingleBucketAggregateBase': '_types/aggregations/Aggregate.ts#L463-L471', @@ -508,13 +513,13 @@ '_types.aggregations.TTestAggregation': '_types/aggregations/metric.ts#L144-L148', '_types.aggregations.TTestType': '_types/aggregations/metric.ts#L156-L160', '_types.aggregations.TermsAggregateBase': '_types/aggregations/Aggregate.ts#L367-L372', -'_types.aggregations.TermsAggregation': '_types/aggregations/bucket.ts#L348-L364', -'_types.aggregations.TermsAggregationCollectMode': '_types/aggregations/bucket.ts#L374-L377', -'_types.aggregations.TermsAggregationExecutionHint': '_types/aggregations/bucket.ts#L379-L384', +'_types.aggregations.TermsAggregation': '_types/aggregations/bucket.ts#L387-L403', +'_types.aggregations.TermsAggregationCollectMode': '_types/aggregations/bucket.ts#L413-L416', +'_types.aggregations.TermsAggregationExecutionHint': '_types/aggregations/bucket.ts#L418-L423', '_types.aggregations.TermsBucketBase': '_types/aggregations/Aggregate.ts#L381-L383', -'_types.aggregations.TermsExclude': '_types/aggregations/bucket.ts#L389-L390', -'_types.aggregations.TermsInclude': '_types/aggregations/bucket.ts#L386-L387', -'_types.aggregations.TermsPartition': '_types/aggregations/bucket.ts#L392-L395', +'_types.aggregations.TermsExclude': '_types/aggregations/bucket.ts#L428-L429', +'_types.aggregations.TermsInclude': '_types/aggregations/bucket.ts#L425-L426', +'_types.aggregations.TermsPartition': '_types/aggregations/bucket.ts#L431-L434', '_types.aggregations.TestPopulation': '_types/aggregations/metric.ts#L150-L154', '_types.aggregations.TopHitsAggregate': '_types/aggregations/Aggregate.ts#L619-L622', '_types.aggregations.TopHitsAggregation': '_types/aggregations/metric.ts#L162-L175', @@ -530,7 +535,7 @@ '_types.aggregations.ValueCountAggregation': '_types/aggregations/metric.ts#L187-L187', '_types.aggregations.ValueType': '_types/aggregations/metric.ts#L189-L200', '_types.aggregations.VariableWidthHistogramAggregate': '_types/aggregations/Aggregate.ts#L352-L354', -'_types.aggregations.VariableWidthHistogramAggregation': '_types/aggregations/bucket.ts#L397-L402', +'_types.aggregations.VariableWidthHistogramAggregation': '_types/aggregations/bucket.ts#L436-L441', '_types.aggregations.VariableWidthHistogramBucket': '_types/aggregations/Aggregate.ts#L356-L363', '_types.aggregations.WeightedAverageAggregation': '_types/aggregations/metric.ts#L202-L207', '_types.aggregations.WeightedAverageValue': '_types/aggregations/metric.ts#L209-L213', @@ -2331,10 +2336,10 @@ if (hash.length > 1) { hash = hash.substring(1); } - window.location = "https://github.com/elastic/elasticsearch-specification/tree/694f9331579bfd26e3ed9ab97100700e78c3eae7/specification/" + (paths[hash] || ""); + window.location = "https://github.com/elastic/elasticsearch-specification/tree/acebfa33c97dab36187904b2ddbf072977b32675/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/snapshot/RepositorySettings.java b/java-client/src/main/java/co/elastic/clients/elasticsearch/snapshot/RepositorySettings.java deleted file mode 100644 index 7bf11843a..000000000 --- a/java-client/src/main/java/co/elastic/clients/elasticsearch/snapshot/RepositorySettings.java +++ /dev/null @@ -1,274 +0,0 @@ -/* - * Licensed to Elasticsearch B.V. under one or more contributor - * license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright - * ownership. Elasticsearch B.V. licenses this file to you under - * the Apache License, Version 2.0 (the "License"); you may - * not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package co.elastic.clients.elasticsearch.snapshot; - -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.String; -import java.util.Objects; -import java.util.function.Function; -import javax.annotation.Nullable; - -//---------------------------------------------------------------- -// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. -//---------------------------------------------------------------- -// -// This code is generated from the Elasticsearch API specification -// at https://github.com/elastic/elasticsearch-specification -// -// Manual updates to this file will be lost when the code is -// re-generated. -// -// If you find a property that is missing or wrongly typed, please -// open an issue or a PR on the API specification repository. -// -//---------------------------------------------------------------- - -// typedef: snapshot._types.RepositorySettings - -/** - * - * @see API - * specification - */ -@JsonpDeserializable -public class RepositorySettings implements JsonpSerializable { - @Nullable - private final String chunkSize; - - @Nullable - private final Boolean compress; - - @Nullable - private final String concurrentStreams; - - private final String location; - - @Nullable - private final Boolean readOnly; - - // --------------------------------------------------------------------------------------------- - - private RepositorySettings(Builder builder) { - - this.chunkSize = builder.chunkSize; - this.compress = builder.compress; - this.concurrentStreams = builder.concurrentStreams; - this.location = ApiTypeHelper.requireNonNull(builder.location, this, "location"); - this.readOnly = builder.readOnly; - - } - - public static RepositorySettings of(Function> fn) { - return fn.apply(new Builder()).build(); - } - - /** - * API name: {@code chunk_size} - */ - @Nullable - public final String chunkSize() { - return this.chunkSize; - } - - /** - * API name: {@code compress} - */ - @Nullable - public final Boolean compress() { - return this.compress; - } - - /** - * API name: {@code concurrent_streams} - */ - @Nullable - public final String concurrentStreams() { - return this.concurrentStreams; - } - - /** - * Required - API name: {@code location} - */ - public final String location() { - return this.location; - } - - /** - * API name: {@code read_only} - */ - @Nullable - public final Boolean readOnly() { - return this.readOnly; - } - - /** - * 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.chunkSize != null) { - generator.writeKey("chunk_size"); - generator.write(this.chunkSize); - - } - if (this.compress != null) { - generator.writeKey("compress"); - generator.write(this.compress); - - } - if (this.concurrentStreams != null) { - generator.writeKey("concurrent_streams"); - generator.write(this.concurrentStreams); - - } - generator.writeKey("location"); - generator.write(this.location); - - if (this.readOnly != null) { - generator.writeKey("read_only"); - generator.write(this.readOnly); - - } - - } - - @Override - public String toString() { - return JsonpUtils.toString(this); - } - - // --------------------------------------------------------------------------------------------- - - /** - * Builder for {@link RepositorySettings}. - */ - - public static class Builder extends WithJsonObjectBuilderBase - implements - ObjectBuilder { - @Nullable - private String chunkSize; - - @Nullable - private Boolean compress; - - @Nullable - private String concurrentStreams; - - private String location; - - @Nullable - private Boolean readOnly; - - /** - * API name: {@code chunk_size} - */ - public final Builder chunkSize(@Nullable String value) { - this.chunkSize = value; - return this; - } - - /** - * API name: {@code compress} - */ - public final Builder compress(@Nullable Boolean value) { - this.compress = value; - return this; - } - - /** - * API name: {@code concurrent_streams} - */ - public final Builder concurrentStreams(@Nullable String value) { - this.concurrentStreams = value; - return this; - } - - /** - * Required - API name: {@code location} - */ - public final Builder location(String value) { - this.location = value; - return this; - } - - /** - * API name: {@code read_only} - */ - public final Builder readOnly(@Nullable Boolean value) { - this.readOnly = value; - return this; - } - - @Override - protected Builder self() { - return this; - } - - /** - * Builds a {@link RepositorySettings}. - * - * @throws NullPointerException - * if some of the required fields are null. - */ - public RepositorySettings build() { - _checkSingleUse(); - - return new RepositorySettings(this); - } - } - - // --------------------------------------------------------------------------------------------- - - /** - * Json deserializer for {@link RepositorySettings} - */ - public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer - .lazy(Builder::new, RepositorySettings::setupRepositorySettingsDeserializer); - - protected static void setupRepositorySettingsDeserializer(ObjectDeserializer op) { - - op.add(Builder::chunkSize, JsonpDeserializer.stringDeserializer(), "chunk_size"); - op.add(Builder::compress, JsonpDeserializer.booleanDeserializer(), "compress"); - op.add(Builder::concurrentStreams, JsonpDeserializer.stringDeserializer(), "concurrent_streams"); - op.add(Builder::location, JsonpDeserializer.stringDeserializer(), "location"); - op.add(Builder::readOnly, JsonpDeserializer.booleanDeserializer(), "read_only", "readonly"); - - } - -}