From a41604b83d2d0b94c27d6e11b7b6419f0327bd81 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Fri, 3 Apr 2026 17:40:49 +0000 Subject: [PATCH] Re-generate client code using latest OpenSearch API specification (2026-04-03) Signed-off-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> --- .../AdjacencyMatrixAggregate.java | 9 - ... => AdjacencyMatrixAggregationFields.java} | 76 +- .../_types/aggregations/Aggregate.java | 344 +- .../aggregations/AggregateBuilders.java | 7 + .../_types/aggregations/AggregateVariant.java | 51 - .../_types/aggregations/Aggregation.java | 3566 ++++++++++------- .../_types/aggregations/AggregationBase.java | 43 +- .../aggregations/AggregationBuilders.java | 503 --- .../aggregations/AggregationVariant.java | 51 - .../AutoDateHistogramAggregate.java | 9 - ...> AutoDateHistogramAggregationFields.java} | 76 +- .../aggregations/AverageAggregation.java | 9 - .../AverageBucketAggregation.java | 9 - .../_types/aggregations/AvgAggregate.java | 13 +- .../_types/aggregations/BoxPlotAggregate.java | 43 +- .../aggregations/BoxplotAggregation.java | 13 +- .../aggregations/BucketAggregationBase.java | 262 -- .../BucketMetricValueAggregate.java | 9 - .../aggregations/BucketPathAggregation.java | 30 +- .../aggregations/BucketScriptAggregation.java | 9 - .../BucketSelectorAggregation.java | 9 - .../aggregations/BucketSortAggregation.java | 44 +- .../aggregations/CardinalityAggregate.java | 41 +- .../aggregations/CardinalityAggregation.java | 9 - .../aggregations/ChildrenAggregate.java | 9 - ...on.java => ChildrenAggregationFields.java} | 72 +- .../aggregations/CompositeAggregate.java | 9 - ...n.java => CompositeAggregationFields.java} | 74 +- .../CumulativeCardinalityAggregate.java | 44 +- .../CumulativeCardinalityAggregation.java | 9 - .../CumulativeSumAggregation.java | 9 - .../aggregations/DateHistogramAggregate.java | 9 - ...va => DateHistogramAggregationFields.java} | 74 +- .../aggregations/DateRangeAggregate.java | 13 +- ...n.java => DateRangeAggregationFields.java} | 74 +- .../aggregations/DerivativeAggregate.java | 9 - .../aggregations/DerivativeAggregation.java | 9 - ... DiversifiedSamplerAggregationFields.java} | 76 +- .../aggregations/DoubleTermsAggregate.java | 16 +- .../aggregations/DoubleTermsBucket.java | 217 - .../aggregations/ExtendedStatsAggregate.java | 9 - .../ExtendedStatsAggregation.java | 9 - .../ExtendedStatsBucketAggregate.java | 9 - .../ExtendedStatsBucketAggregation.java | 9 - .../_types/aggregations/FilterAggregate.java | 13 +- .../aggregations/FilterAggregationFields.java | 2758 +++++++++++++ .../_types/aggregations/FiltersAggregate.java | 9 - ...ion.java => FiltersAggregationFields.java} | 72 +- .../aggregations/GeoBoundsAggregate.java | 43 +- .../aggregations/GeoBoundsAggregation.java | 9 - .../aggregations/GeoCentroidAggregate.java | 43 +- .../aggregations/GeoCentroidAggregation.java | 9 - .../aggregations/GeoDistanceAggregate.java | 9 - ...java => GeoDistanceAggregationFields.java} | 74 +- .../aggregations/GeoHashGridAggregate.java | 9 - ...java => GeoHashGridAggregationFields.java} | 74 +- .../aggregations/GeoTileGridAggregate.java | 9 - ...java => GeoTileGridAggregationFields.java} | 74 +- .../_types/aggregations/GlobalAggregate.java | 13 +- ...cket.java => GlobalAggregationFields.java} | 98 +- .../HdrPercentileRanksAggregate.java | 9 - .../aggregations/HdrPercentilesAggregate.java | 9 - .../aggregations/HistogramAggregate.java | 9 - ...n.java => HistogramAggregationFields.java} | 74 +- .../_types/aggregations/IpRangeAggregate.java | 9 - ...ion.java => IpRangeAggregationFields.java} | 72 +- .../aggregations/LongRareTermsAggregate.java | 9 - .../aggregations/LongTermsAggregate.java | 16 +- .../_types/aggregations/LongTermsBucket.java | 227 -- .../aggregations/LongTermsBucketKey.java | 221 - .../aggregations/MatrixAggregation.java | 30 +- .../aggregations/MatrixStatsAggregate.java | 43 +- .../aggregations/MatrixStatsAggregation.java | 9 - .../_types/aggregations/MaxAggregate.java | 13 +- .../_types/aggregations/MaxAggregation.java | 13 +- .../aggregations/MaxBucketAggregation.java | 9 - .../MedianAbsoluteDeviationAggregate.java | 9 - .../MedianAbsoluteDeviationAggregation.java | 9 - .../aggregations/MetricAggregationBase.java | 91 - .../_types/aggregations/MinAggregate.java | 13 +- .../_types/aggregations/MinAggregation.java | 13 +- .../aggregations/MinBucketAggregation.java | 9 - .../_types/aggregations/MissingAggregate.java | 13 +- ...ion.java => MissingAggregationFields.java} | 72 +- .../MovingAverageAggregation.java | 9 - .../MovingFunctionAggregation.java | 9 - .../MovingPercentilesAggregation.java | 9 - .../MultiBucketAggregateBase.java | 30 +- .../_types/aggregations/MultiBucketBase.java | 8 +- .../aggregations/MultiTermsAggregate.java | 9 - ....java => MultiTermsAggregationFields.java} | 74 +- .../_types/aggregations/NestedAggregate.java | 13 +- ...tion.java => NestedAggregationFields.java} | 72 +- .../aggregations/NormalizeAggregation.java | 9 - .../_types/aggregations/ParentAggregate.java | 13 +- ...tion.java => ParentAggregationFields.java} | 72 +- .../PercentileRanksAggregation.java | 9 - .../PercentilesAggregateBase.java | 30 +- .../aggregations/PercentilesAggregation.java | 9 - .../PercentilesBucketAggregate.java | 9 - .../PercentilesBucketAggregation.java | 9 - .../_types/aggregations/RangeAggregate.java | 13 +- ...ation.java => RangeAggregationFields.java} | 72 +- ...n.java => RareTermsAggregationFields.java} | 74 +- .../_types/aggregations/RateAggregate.java | 40 +- .../_types/aggregations/RateAggregation.java | 13 +- .../aggregations/ReverseNestedAggregate.java | 9 - ...va => ReverseNestedAggregationFields.java} | 74 +- .../_types/aggregations/SamplerAggregate.java | 13 +- ...ion.java => SamplerAggregationFields.java} | 72 +- .../aggregations/ScriptedMetricAggregate.java | 44 +- .../ScriptedMetricAggregation.java | 9 - .../SerialDifferencingAggregation.java | 9 - .../SignificantLongTermsAggregate.java | 9 - .../SignificantStringTermsAggregate.java | 9 - ...=> SignificantTermsAggregationFields.java} | 76 +- ... => SignificantTextAggregationFields.java} | 76 +- .../aggregations/SimpleValueAggregate.java | 9 - .../SingleBucketAggregateBase.java | 38 +- .../SingleMetricAggregateBase.java | 30 +- .../_types/aggregations/StatsAggregate.java | 13 +- .../aggregations/StatsAggregateBase.java | 30 +- .../_types/aggregations/StatsAggregation.java | 13 +- .../aggregations/StatsBucketAggregate.java | 9 - .../aggregations/StatsBucketAggregation.java | 9 - .../StringRareTermsAggregate.java | 9 - .../aggregations/StringTermsAggregate.java | 16 +- .../_types/aggregations/SumAggregate.java | 13 +- .../_types/aggregations/SumAggregation.java | 13 +- .../aggregations/SumBucketAggregation.java | 9 - .../TDigestPercentileRanksAggregate.java | 9 - .../TDigestPercentilesAggregate.java | 9 - .../_types/aggregations/TTestAggregate.java | 40 +- .../_types/aggregations/TTestAggregation.java | 43 +- ...ation.java => TermsAggregationFields.java} | 290 +- .../_types/aggregations/TermsBucketBase.java | 138 - .../_types/aggregations/TermsPartition.java | 24 +- .../_types/aggregations/TopHitsAggregate.java | 43 +- .../aggregations/TopHitsAggregation.java | 13 +- .../UnmappedRareTermsAggregate.java | 9 - .../UnmappedSignificantTermsAggregate.java | 9 - .../aggregations/UnmappedTermsAggregate.java | 16 +- ...n.java => UnsignedLongTermsAggregate.java} | 53 +- .../aggregations/ValueCountAggregate.java | 9 - .../aggregations/ValueCountAggregation.java | 9 - .../_types/aggregations/ValueType.java | 4 - .../VariableWidthHistogramAggregate.java | 9 - .../VariableWidthHistogramAggregation.java | 9 - .../WeightedAverageAggregation.java | 44 +- .../aggregations/WeightedAvgAggregate.java | 9 - .../opensearch/_types/query_dsl/Query.java | 12 +- .../opensearch/core/search/SearchResult.java | 9 +- .../GetExperimentsResponse.java | 9 +- .../GetJudgmentsResponse.java | 9 +- .../GetQuerySetsResponse.java | 9 +- .../GetScheduledExperimentsResponse.java | 9 +- .../GetSearchConfigurationsResponse.java | 9 +- java-codegen/opensearch-openapi.yaml | 2138 +++++----- 158 files changed, 7471 insertions(+), 7049 deletions(-) rename java-client/src/generated/java/org/opensearch/client/opensearch/_types/aggregations/{AdjacencyMatrixAggregation.java => AdjacencyMatrixAggregationFields.java} (77%) delete mode 100644 java-client/src/generated/java/org/opensearch/client/opensearch/_types/aggregations/AggregateVariant.java delete mode 100644 java-client/src/generated/java/org/opensearch/client/opensearch/_types/aggregations/AggregationBuilders.java delete mode 100644 java-client/src/generated/java/org/opensearch/client/opensearch/_types/aggregations/AggregationVariant.java rename java-client/src/generated/java/org/opensearch/client/opensearch/_types/aggregations/{AutoDateHistogramAggregation.java => AutoDateHistogramAggregationFields.java} (88%) delete mode 100644 java-client/src/generated/java/org/opensearch/client/opensearch/_types/aggregations/BucketAggregationBase.java rename java-client/src/generated/java/org/opensearch/client/opensearch/_types/aggregations/{ParentAggregation.java => ChildrenAggregationFields.java} (71%) rename java-client/src/generated/java/org/opensearch/client/opensearch/_types/aggregations/{CompositeAggregation.java => CompositeAggregationFields.java} (84%) rename java-client/src/generated/java/org/opensearch/client/opensearch/_types/aggregations/{DateHistogramAggregation.java => DateHistogramAggregationFields.java} (92%) rename java-client/src/generated/java/org/opensearch/client/opensearch/_types/aggregations/{DateRangeAggregation.java => DateRangeAggregationFields.java} (86%) rename java-client/src/generated/java/org/opensearch/client/opensearch/_types/aggregations/{DiversifiedSamplerAggregation.java => DiversifiedSamplerAggregationFields.java} (83%) delete mode 100644 java-client/src/generated/java/org/opensearch/client/opensearch/_types/aggregations/DoubleTermsBucket.java create mode 100644 java-client/src/generated/java/org/opensearch/client/opensearch/_types/aggregations/FilterAggregationFields.java rename java-client/src/generated/java/org/opensearch/client/opensearch/_types/aggregations/{FiltersAggregation.java => FiltersAggregationFields.java} (83%) rename java-client/src/generated/java/org/opensearch/client/opensearch/_types/aggregations/{GeoDistanceAggregation.java => GeoDistanceAggregationFields.java} (85%) rename java-client/src/generated/java/org/opensearch/client/opensearch/_types/aggregations/{GeoHashGridAggregation.java => GeoHashGridAggregationFields.java} (84%) rename java-client/src/generated/java/org/opensearch/client/opensearch/_types/aggregations/{GeoTileGridAggregation.java => GeoTileGridAggregationFields.java} (83%) rename java-client/src/generated/java/org/opensearch/client/opensearch/_types/aggregations/{StringTermsBucket.java => GlobalAggregationFields.java} (52%) rename java-client/src/generated/java/org/opensearch/client/opensearch/_types/aggregations/{HistogramAggregation.java => HistogramAggregationFields.java} (90%) rename java-client/src/generated/java/org/opensearch/client/opensearch/_types/aggregations/{IpRangeAggregation.java => IpRangeAggregationFields.java} (79%) delete mode 100644 java-client/src/generated/java/org/opensearch/client/opensearch/_types/aggregations/LongTermsBucket.java delete mode 100644 java-client/src/generated/java/org/opensearch/client/opensearch/_types/aggregations/LongTermsBucketKey.java rename java-client/src/generated/java/org/opensearch/client/opensearch/_types/aggregations/{MissingAggregation.java => MissingAggregationFields.java} (76%) rename java-client/src/generated/java/org/opensearch/client/opensearch/_types/aggregations/{MultiTermsAggregation.java => MultiTermsAggregationFields.java} (89%) rename java-client/src/generated/java/org/opensearch/client/opensearch/_types/aggregations/{NestedAggregation.java => NestedAggregationFields.java} (71%) rename java-client/src/generated/java/org/opensearch/client/opensearch/_types/aggregations/{ChildrenAggregation.java => ParentAggregationFields.java} (71%) rename java-client/src/generated/java/org/opensearch/client/opensearch/_types/aggregations/{RangeAggregation.java => RangeAggregationFields.java} (87%) rename java-client/src/generated/java/org/opensearch/client/opensearch/_types/aggregations/{RareTermsAggregation.java => RareTermsAggregationFields.java} (86%) rename java-client/src/generated/java/org/opensearch/client/opensearch/_types/aggregations/{ReverseNestedAggregation.java => ReverseNestedAggregationFields.java} (70%) rename java-client/src/generated/java/org/opensearch/client/opensearch/_types/aggregations/{SamplerAggregation.java => SamplerAggregationFields.java} (73%) rename java-client/src/generated/java/org/opensearch/client/opensearch/_types/aggregations/{SignificantTermsAggregation.java => SignificantTermsAggregationFields.java} (92%) rename java-client/src/generated/java/org/opensearch/client/opensearch/_types/aggregations/{SignificantTextAggregation.java => SignificantTextAggregationFields.java} (93%) rename java-client/src/generated/java/org/opensearch/client/opensearch/_types/aggregations/{TermsAggregation.java => TermsAggregationFields.java} (71%) delete mode 100644 java-client/src/generated/java/org/opensearch/client/opensearch/_types/aggregations/TermsBucketBase.java rename java-client/src/generated/java/org/opensearch/client/opensearch/_types/aggregations/{GlobalAggregation.java => UnsignedLongTermsAggregate.java} (63%) diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/aggregations/AdjacencyMatrixAggregate.java b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/aggregations/AdjacencyMatrixAggregate.java index 98cefdf5a0..b79c80a2e9 100644 --- a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/aggregations/AdjacencyMatrixAggregate.java +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/aggregations/AdjacencyMatrixAggregate.java @@ -53,7 +53,6 @@ @Generated("org.opensearch.client.codegen.CodeGenerator") public class AdjacencyMatrixAggregate extends MultiBucketAggregateBase implements - AggregateVariant, ToCopyableBuilder { // --------------------------------------------------------------------------------------------- @@ -66,14 +65,6 @@ public static AdjacencyMatrixAggregate of(Function { + PlainJsonSerializable, + ToCopyableBuilder { @Nonnull private final Map filters; // --------------------------------------------------------------------------------------------- - private AdjacencyMatrixAggregation(Builder builder) { - super(builder); + private AdjacencyMatrixAggregationFields(Builder builder) { this.filters = ApiTypeHelper.unmodifiable(builder.filters); } - public static AdjacencyMatrixAggregation of( - Function> fn + public static AdjacencyMatrixAggregationFields of( + Function> fn ) { return fn.apply(new Builder()).build(); } - /** - * {@link Aggregation} variant kind. - */ - @Override - public Aggregation.Kind _aggregationKind() { - return Aggregation.Kind.AdjacencyMatrix; - } - /** * Filters used to create buckets. At least one filter is required. *

@@ -98,8 +91,17 @@ public final Map filters() { return this.filters; } + /** + * Serialize this object to JSON. + */ + @Override + public void serialize(JsonGenerator generator, JsonpMapper mapper) { + generator.writeStartObject(); + serializeInternal(generator, mapper); + generator.writeEnd(); + } + protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { - super.serializeInternal(generator, mapper); if (ApiTypeHelper.isDefined(this.filters)) { generator.writeKey("filters"); generator.writeStartObject(); @@ -125,23 +127,19 @@ public static Builder builder() { } /** - * Builder for {@link AdjacencyMatrixAggregation}. + * Builder for {@link AdjacencyMatrixAggregationFields}. */ - public static class Builder extends BucketAggregationBase.AbstractBuilder - implements - CopyableBuilder { + public static class Builder extends ObjectBuilderBase implements CopyableBuilder { @Nullable private Map filters; public Builder() {} - private Builder(AdjacencyMatrixAggregation o) { - super(o); + private Builder(AdjacencyMatrixAggregationFields o) { this.filters = _mapCopy(o.filters); } private Builder(Builder o) { - super(o); this.filters = _mapCopy(o.filters); } @@ -151,12 +149,6 @@ public Builder copy() { return new Builder(this); } - @Override - @Nonnull - protected Builder self() { - return this; - } - /** * Filters used to create buckets. At least one filter is required. *

@@ -205,49 +197,47 @@ public final Builder filters(String key, Function _DESERIALIZER = ObjectBuilderDeserializer.lazy( + public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer.lazy( Builder::new, - AdjacencyMatrixAggregation::setupAdjacencyMatrixAggregationDeserializer + AdjacencyMatrixAggregationFields::setupAdjacencyMatrixAggregationFieldsDeserializer ); - protected static void setupAdjacencyMatrixAggregationDeserializer(ObjectDeserializer op) { - setupBucketAggregationBaseDeserializer(op); + protected static void setupAdjacencyMatrixAggregationFieldsDeserializer( + ObjectDeserializer op + ) { op.add(Builder::filters, JsonpDeserializer.stringMapDeserializer(Query._DESERIALIZER), "filters"); } @Override public int hashCode() { - int result = super.hashCode(); + int result = 17; result = 31 * result + Objects.hashCode(this.filters); return result; } @Override public boolean equals(Object o) { - if (!super.equals(o)) { - return false; - } if (this == o) return true; if (o == null || this.getClass() != o.getClass()) return false; - AdjacencyMatrixAggregation other = (AdjacencyMatrixAggregation) o; + AdjacencyMatrixAggregationFields other = (AdjacencyMatrixAggregationFields) o; return Objects.equals(this.filters, other.filters); } } diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/aggregations/Aggregate.java b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/aggregations/Aggregate.java index e3b7869072..ae01f0435a 100644 --- a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/aggregations/Aggregate.java +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/aggregations/Aggregate.java @@ -37,107 +37,96 @@ package org.opensearch.client.opensearch._types.aggregations; import jakarta.json.stream.JsonGenerator; -import java.util.HashMap; -import java.util.Map; import java.util.Objects; import java.util.function.Function; import javax.annotation.Generated; import javax.annotation.Nonnull; -import org.opensearch.client.json.ExternallyTaggedUnion; -import org.opensearch.client.json.JsonEnum; +import org.opensearch.client.json.JsonpDeserializable; import org.opensearch.client.json.JsonpDeserializer; import org.opensearch.client.json.JsonpMapper; +import org.opensearch.client.json.JsonpSerializable; import org.opensearch.client.json.PlainJsonSerializable; +import org.opensearch.client.json.UnionDeserializer; import org.opensearch.client.util.ApiTypeHelper; import org.opensearch.client.util.ObjectBuilder; -import org.opensearch.client.util.ObjectBuilderBase; import org.opensearch.client.util.TaggedUnion; import org.opensearch.client.util.TaggedUnionUtils; // typedef: _types.aggregations.Aggregate +@JsonpDeserializable @Generated("org.opensearch.client.codegen.CodeGenerator") -public class Aggregate implements TaggedUnion, PlainJsonSerializable { +public class Aggregate extends AggregateBase implements TaggedUnion, PlainJsonSerializable { /** * {@link Aggregate} variant kinds. */ - public enum Kind implements JsonEnum { - AdjacencyMatrix("adjacency_matrix"), - AutoDateHistogram("auto_date_histogram"), - Avg("avg"), - BoxPlot("box_plot"), - BucketMetricValue("bucket_metric_value"), - Cardinality("cardinality"), - Children("children"), - Composite("composite"), - DateHistogram("date_histogram"), - DateRange("date_range"), - Derivative("derivative"), - Dterms("dterms"), - ExtendedStats("extended_stats"), - ExtendedStatsBucket("extended_stats_bucket"), - Filter("filter"), - Filters("filters"), - GeoBounds("geo_bounds"), - GeoCentroid("geo_centroid"), - GeoDistance("geo_distance"), - GeohashGrid("geohash_grid"), - GeotileGrid("geotile_grid"), - Global("global"), - HdrPercentileRanks("hdr_percentile_ranks"), - HdrPercentiles("hdr_percentiles"), - Histogram("histogram"), - IpRange("ip_range"), - Lrareterms("lrareterms"), - Lterms("lterms"), - MatrixStats("matrix_stats"), - Max("max"), - MedianAbsoluteDeviation("median_absolute_deviation"), - Min("min"), - Missing("missing"), - MultiTerms("multi_terms"), - Nested("nested"), - Parent("parent"), - PercentilesBucket("percentiles_bucket"), - Range("range"), - Rate("rate"), - ReverseNested("reverse_nested"), - Sampler("sampler"), - ScriptedMetric("scripted_metric"), - Siglterms("siglterms"), - Sigsterms("sigsterms"), - SimpleLongValue("simple_long_value"), - SimpleValue("simple_value"), - Srareterms("srareterms"), - Stats("stats"), - StatsBucket("stats_bucket"), - Sterms("sterms"), - Sum("sum"), - TTest("t_test"), - TdigestPercentileRanks("tdigest_percentile_ranks"), - TdigestPercentiles("tdigest_percentiles"), - TopHits("top_hits"), - Umrareterms("umrareterms"), - Umsigterms("umsigterms"), - Umterms("umterms"), - ValueCount("value_count"), - VariableWidthHistogram("variable_width_histogram"), - WeightedAvg("weighted_avg"); - - private final String jsonValue; - - Kind(String jsonValue) { - this.jsonValue = jsonValue; - } - - @Override - public String jsonValue() { - return jsonValue; - } + public enum Kind { + AdjacencyMatrix, + AutoDateHistogram, + Avg, + BoxPlot, + BucketMetricValue, + Cardinality, + Children, + Composite, + DateHistogram, + DateRange, + Derivative, + Dterms, + ExtendedStats, + ExtendedStatsBucket, + Filter, + Filters, + GeoBounds, + GeoCentroid, + GeoDistance, + GeohashGrid, + GeotileGrid, + Global, + HdrPercentileRanks, + HdrPercentiles, + Histogram, + IpRange, + Lrareterms, + Lterms, + MatrixStats, + Max, + MedianAbsoluteDeviation, + Min, + Missing, + MultiTerms, + Nested, + Parent, + PercentilesBucket, + Range, + Rate, + ReverseNested, + Sampler, + ScriptedMetric, + Siglterms, + Sigsterms, + SimpleLongValue, + SimpleValue, + Srareterms, + Stats, + StatsBucket, + Sterms, + Sum, + TTest, + TdigestPercentileRanks, + TdigestPercentiles, + TopHits, + Ulterms, + Umrareterms, + Umsigterms, + Umterms, + ValueCount, + VariableWidthHistogram, + WeightedAvg } private final Kind _kind; - private final AggregateVariant _value; + private final Object _value; @Override public final Kind _kind() { @@ -145,16 +134,12 @@ public final Kind _kind() { } @Override - public final AggregateVariant _get() { + public final Object _get() { return _value; } - public Aggregate(AggregateVariant value) { - this._kind = ApiTypeHelper.requireNonNull(value._aggregateKind(), this, ""); - this._value = ApiTypeHelper.requireNonNull(value, this, ""); - } - private Aggregate(Builder builder) { + super(builder); this._kind = ApiTypeHelper.requireNonNull(builder._kind, builder, ""); this._value = ApiTypeHelper.requireNonNull(builder._value, builder, ""); } @@ -1043,6 +1028,22 @@ public TopHitsAggregate topHits() { return TaggedUnionUtils.get(this, Kind.TopHits); } + /** + * Is this variant instance of kind {@code ulterms}? + */ + public boolean isUlterms() { + return _kind == Kind.Ulterms; + } + + /** + * Get the {@code ulterms} variant value. + * + * @throws IllegalStateException if the current variant is not the {@code ulterms} kind. + */ + public UnsignedLongTermsAggregate ulterms() { + return TaggedUnionUtils.get(this, Kind.Ulterms); + } + /** * Is this variant instance of kind {@code umrareterms}? */ @@ -1141,7 +1142,10 @@ public WeightedAvgAggregate weightedAvg() { @Override public void serialize(JsonGenerator generator, JsonpMapper mapper) { - mapper.serialize(_value, generator); + super.serializeInternal(generator, mapper); + if (_value instanceof JsonpSerializable) { + ((JsonpSerializable) _value).serialize(generator, mapper); + } } @Nonnull @@ -1154,17 +1158,24 @@ public static Builder builder() { return new Builder(); } - public static class Builder extends ObjectBuilderBase implements ObjectBuilder { + public static class Builder extends AggregateBase.AbstractBuilder implements ObjectBuilder { private Kind _kind; - private AggregateVariant _value; + private Object _value; public Builder() {} private Builder(Aggregate o) { + super(o); this._kind = o._kind; this._value = o._value; } + @Override + @Nonnull + protected Builder self() { + return this; + } + public ObjectBuilder adjacencyMatrix(AdjacencyMatrixAggregate v) { this._kind = Kind.AdjacencyMatrix; this._value = v; @@ -1743,6 +1754,18 @@ public ObjectBuilder topHits(Function ulterms(UnsignedLongTermsAggregate v) { + this._kind = Kind.Ulterms; + this._value = v; + return this; + } + + public ObjectBuilder ulterms( + Function> fn + ) { + return this.ulterms(fn.apply(new UnsignedLongTermsAggregate.Builder()).build()); + } + public ObjectBuilder umrareterms(UnmappedRareTermsAggregate v) { this._kind = Kind.Umrareterms; this._value = v; @@ -1816,78 +1839,80 @@ public Aggregate build() { } } - public static final ExternallyTaggedUnion.TypedKeysDeserializer _TYPED_KEYS_DESERIALIZER; - - static { - Map> deserializers = new HashMap<>(); - deserializers.put("adjacency_matrix", AdjacencyMatrixAggregate._DESERIALIZER); - deserializers.put("auto_date_histogram", AutoDateHistogramAggregate._DESERIALIZER); - deserializers.put("avg", AvgAggregate._DESERIALIZER); - deserializers.put("box_plot", BoxPlotAggregate._DESERIALIZER); - deserializers.put("bucket_metric_value", BucketMetricValueAggregate._DESERIALIZER); - deserializers.put("cardinality", CardinalityAggregate._DESERIALIZER); - deserializers.put("children", ChildrenAggregate._DESERIALIZER); - deserializers.put("composite", CompositeAggregate._DESERIALIZER); - deserializers.put("date_histogram", DateHistogramAggregate._DESERIALIZER); - deserializers.put("date_range", DateRangeAggregate._DESERIALIZER); - deserializers.put("derivative", DerivativeAggregate._DESERIALIZER); - deserializers.put("dterms", DoubleTermsAggregate._DESERIALIZER); - deserializers.put("extended_stats", ExtendedStatsAggregate._DESERIALIZER); - deserializers.put("extended_stats_bucket", ExtendedStatsBucketAggregate._DESERIALIZER); - deserializers.put("filter", FilterAggregate._DESERIALIZER); - deserializers.put("filters", FiltersAggregate._DESERIALIZER); - deserializers.put("geo_bounds", GeoBoundsAggregate._DESERIALIZER); - deserializers.put("geo_centroid", GeoCentroidAggregate._DESERIALIZER); - deserializers.put("geo_distance", GeoDistanceAggregate._DESERIALIZER); - deserializers.put("geohash_grid", GeoHashGridAggregate._DESERIALIZER); - deserializers.put("geotile_grid", GeoTileGridAggregate._DESERIALIZER); - deserializers.put("global", GlobalAggregate._DESERIALIZER); - deserializers.put("hdr_percentile_ranks", HdrPercentileRanksAggregate._DESERIALIZER); - deserializers.put("hdr_percentiles", HdrPercentilesAggregate._DESERIALIZER); - deserializers.put("histogram", HistogramAggregate._DESERIALIZER); - deserializers.put("ip_range", IpRangeAggregate._DESERIALIZER); - deserializers.put("lrareterms", LongRareTermsAggregate._DESERIALIZER); - deserializers.put("lterms", LongTermsAggregate._DESERIALIZER); - deserializers.put("matrix_stats", MatrixStatsAggregate._DESERIALIZER); - deserializers.put("max", MaxAggregate._DESERIALIZER); - deserializers.put("median_absolute_deviation", MedianAbsoluteDeviationAggregate._DESERIALIZER); - deserializers.put("min", MinAggregate._DESERIALIZER); - deserializers.put("missing", MissingAggregate._DESERIALIZER); - deserializers.put("multi_terms", MultiTermsAggregate._DESERIALIZER); - deserializers.put("nested", NestedAggregate._DESERIALIZER); - deserializers.put("parent", ParentAggregate._DESERIALIZER); - deserializers.put("percentiles_bucket", PercentilesBucketAggregate._DESERIALIZER); - deserializers.put("range", RangeAggregate._DESERIALIZER); - deserializers.put("rate", RateAggregate._DESERIALIZER); - deserializers.put("reverse_nested", ReverseNestedAggregate._DESERIALIZER); - deserializers.put("sampler", SamplerAggregate._DESERIALIZER); - deserializers.put("scripted_metric", ScriptedMetricAggregate._DESERIALIZER); - deserializers.put("siglterms", SignificantLongTermsAggregate._DESERIALIZER); - deserializers.put("sigsterms", SignificantStringTermsAggregate._DESERIALIZER); - deserializers.put("simple_long_value", CumulativeCardinalityAggregate._DESERIALIZER); - deserializers.put("simple_value", SimpleValueAggregate._DESERIALIZER); - deserializers.put("srareterms", StringRareTermsAggregate._DESERIALIZER); - deserializers.put("stats", StatsAggregate._DESERIALIZER); - deserializers.put("stats_bucket", StatsBucketAggregate._DESERIALIZER); - deserializers.put("sterms", StringTermsAggregate._DESERIALIZER); - deserializers.put("sum", SumAggregate._DESERIALIZER); - deserializers.put("t_test", TTestAggregate._DESERIALIZER); - deserializers.put("tdigest_percentile_ranks", TDigestPercentileRanksAggregate._DESERIALIZER); - deserializers.put("tdigest_percentiles", TDigestPercentilesAggregate._DESERIALIZER); - deserializers.put("top_hits", TopHitsAggregate._DESERIALIZER); - deserializers.put("umrareterms", UnmappedRareTermsAggregate._DESERIALIZER); - deserializers.put("umsigterms", UnmappedSignificantTermsAggregate._DESERIALIZER); - deserializers.put("umterms", UnmappedTermsAggregate._DESERIALIZER); - deserializers.put("value_count", ValueCountAggregate._DESERIALIZER); - deserializers.put("variable_width_histogram", VariableWidthHistogramAggregate._DESERIALIZER); - deserializers.put("weighted_avg", WeightedAvgAggregate._DESERIALIZER); - - _TYPED_KEYS_DESERIALIZER = new ExternallyTaggedUnion.Deserializer<>(deserializers, Aggregate::new).typedKeys(); - } + private static JsonpDeserializer buildAggregateDeserializer() { + return new UnionDeserializer.Builder(Aggregate::new, false).addMember( + Kind.AdjacencyMatrix, + AdjacencyMatrixAggregate._DESERIALIZER + ) + .addMember(Kind.AutoDateHistogram, AutoDateHistogramAggregate._DESERIALIZER) + .addMember(Kind.Avg, AvgAggregate._DESERIALIZER) + .addMember(Kind.BoxPlot, BoxPlotAggregate._DESERIALIZER) + .addMember(Kind.BucketMetricValue, BucketMetricValueAggregate._DESERIALIZER) + .addMember(Kind.Cardinality, CardinalityAggregate._DESERIALIZER) + .addMember(Kind.Children, ChildrenAggregate._DESERIALIZER) + .addMember(Kind.Composite, CompositeAggregate._DESERIALIZER) + .addMember(Kind.DateHistogram, DateHistogramAggregate._DESERIALIZER) + .addMember(Kind.DateRange, DateRangeAggregate._DESERIALIZER) + .addMember(Kind.Derivative, DerivativeAggregate._DESERIALIZER) + .addMember(Kind.Dterms, DoubleTermsAggregate._DESERIALIZER) + .addMember(Kind.ExtendedStats, ExtendedStatsAggregate._DESERIALIZER) + .addMember(Kind.ExtendedStatsBucket, ExtendedStatsBucketAggregate._DESERIALIZER) + .addMember(Kind.Filter, FilterAggregate._DESERIALIZER) + .addMember(Kind.Filters, FiltersAggregate._DESERIALIZER) + .addMember(Kind.GeoBounds, GeoBoundsAggregate._DESERIALIZER) + .addMember(Kind.GeoCentroid, GeoCentroidAggregate._DESERIALIZER) + .addMember(Kind.GeoDistance, GeoDistanceAggregate._DESERIALIZER) + .addMember(Kind.GeohashGrid, GeoHashGridAggregate._DESERIALIZER) + .addMember(Kind.GeotileGrid, GeoTileGridAggregate._DESERIALIZER) + .addMember(Kind.Global, GlobalAggregate._DESERIALIZER) + .addMember(Kind.HdrPercentileRanks, HdrPercentileRanksAggregate._DESERIALIZER) + .addMember(Kind.HdrPercentiles, HdrPercentilesAggregate._DESERIALIZER) + .addMember(Kind.Histogram, HistogramAggregate._DESERIALIZER) + .addMember(Kind.IpRange, IpRangeAggregate._DESERIALIZER) + .addMember(Kind.Lrareterms, LongRareTermsAggregate._DESERIALIZER) + .addMember(Kind.Lterms, LongTermsAggregate._DESERIALIZER) + .addMember(Kind.MatrixStats, MatrixStatsAggregate._DESERIALIZER) + .addMember(Kind.Max, MaxAggregate._DESERIALIZER) + .addMember(Kind.MedianAbsoluteDeviation, MedianAbsoluteDeviationAggregate._DESERIALIZER) + .addMember(Kind.Min, MinAggregate._DESERIALIZER) + .addMember(Kind.Missing, MissingAggregate._DESERIALIZER) + .addMember(Kind.MultiTerms, MultiTermsAggregate._DESERIALIZER) + .addMember(Kind.Nested, NestedAggregate._DESERIALIZER) + .addMember(Kind.Parent, ParentAggregate._DESERIALIZER) + .addMember(Kind.PercentilesBucket, PercentilesBucketAggregate._DESERIALIZER) + .addMember(Kind.Range, RangeAggregate._DESERIALIZER) + .addMember(Kind.Rate, RateAggregate._DESERIALIZER) + .addMember(Kind.ReverseNested, ReverseNestedAggregate._DESERIALIZER) + .addMember(Kind.Sampler, SamplerAggregate._DESERIALIZER) + .addMember(Kind.ScriptedMetric, ScriptedMetricAggregate._DESERIALIZER) + .addMember(Kind.Siglterms, SignificantLongTermsAggregate._DESERIALIZER) + .addMember(Kind.Sigsterms, SignificantStringTermsAggregate._DESERIALIZER) + .addMember(Kind.SimpleLongValue, CumulativeCardinalityAggregate._DESERIALIZER) + .addMember(Kind.SimpleValue, SimpleValueAggregate._DESERIALIZER) + .addMember(Kind.Srareterms, StringRareTermsAggregate._DESERIALIZER) + .addMember(Kind.Stats, StatsAggregate._DESERIALIZER) + .addMember(Kind.StatsBucket, StatsBucketAggregate._DESERIALIZER) + .addMember(Kind.Sterms, StringTermsAggregate._DESERIALIZER) + .addMember(Kind.Sum, SumAggregate._DESERIALIZER) + .addMember(Kind.TTest, TTestAggregate._DESERIALIZER) + .addMember(Kind.TdigestPercentileRanks, TDigestPercentileRanksAggregate._DESERIALIZER) + .addMember(Kind.TdigestPercentiles, TDigestPercentilesAggregate._DESERIALIZER) + .addMember(Kind.TopHits, TopHitsAggregate._DESERIALIZER) + .addMember(Kind.Ulterms, UnsignedLongTermsAggregate._DESERIALIZER) + .addMember(Kind.Umrareterms, UnmappedRareTermsAggregate._DESERIALIZER) + .addMember(Kind.Umsigterms, UnmappedSignificantTermsAggregate._DESERIALIZER) + .addMember(Kind.Umterms, UnmappedTermsAggregate._DESERIALIZER) + .addMember(Kind.ValueCount, ValueCountAggregate._DESERIALIZER) + .addMember(Kind.VariableWidthHistogram, VariableWidthHistogramAggregate._DESERIALIZER) + .addMember(Kind.WeightedAvg, WeightedAvgAggregate._DESERIALIZER) + .build(); + } + + public static final JsonpDeserializer _DESERIALIZER = JsonpDeserializer.lazy(Aggregate::buildAggregateDeserializer); @Override public int hashCode() { - int result = 17; + int result = super.hashCode(); result = 31 * result + Objects.hashCode(this._kind); result = 31 * result + Objects.hashCode(this._value); return result; @@ -1895,6 +1920,9 @@ public int hashCode() { @Override public boolean equals(Object o) { + if (!super.equals(o)) { + return false; + } if (this == o) return true; if (o == null || this.getClass() != o.getClass()) return false; Aggregate other = (Aggregate) o; diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/aggregations/AggregateBuilders.java b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/aggregations/AggregateBuilders.java index af22bd23e0..4602fa743f 100644 --- a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/aggregations/AggregateBuilders.java +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/aggregations/AggregateBuilders.java @@ -430,6 +430,13 @@ public static TopHitsAggregate.Builder topHits() { return new TopHitsAggregate.Builder(); } + /** + * Creates a builder for the {@link UnsignedLongTermsAggregate ulterms} {@code Aggregate} variant. + */ + public static UnsignedLongTermsAggregate.Builder ulterms() { + return new UnsignedLongTermsAggregate.Builder(); + } + /** * Creates a builder for the {@link UnmappedRareTermsAggregate umrareterms} {@code Aggregate} variant. */ diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/aggregations/AggregateVariant.java b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/aggregations/AggregateVariant.java deleted file mode 100644 index 4d210856b2..0000000000 --- a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/aggregations/AggregateVariant.java +++ /dev/null @@ -1,51 +0,0 @@ -/* - * SPDX-License-Identifier: Apache-2.0 - * - * The OpenSearch Contributors require contributions made to - * this file be licensed under the Apache-2.0 license or a - * compatible open source license. - */ - -/* - * 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. - */ - -/* - * Modifications Copyright OpenSearch Contributors. See - * GitHub history for details. - */ - -//---------------------------------------------------- -// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. -//---------------------------------------------------- - -package org.opensearch.client.opensearch._types.aggregations; - -import javax.annotation.Generated; - -/** - * Base interface for {@link Aggregate} variants. - */ -@Generated("org.opensearch.client.codegen.CodeGenerator") -public interface AggregateVariant { - Aggregate.Kind _aggregateKind(); - - default Aggregate toAggregate() { - return new Aggregate(this); - } -} diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/aggregations/Aggregation.java b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/aggregations/Aggregation.java index 57994ec30d..6ff2482626 100644 --- a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/aggregations/Aggregation.java +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/aggregations/Aggregation.java @@ -37,1985 +37,2666 @@ package org.opensearch.client.opensearch._types.aggregations; import jakarta.json.stream.JsonGenerator; -import java.util.Map; import java.util.Objects; import java.util.function.Function; import javax.annotation.Generated; import javax.annotation.Nonnull; import javax.annotation.Nullable; import org.opensearch.client.json.JsonData; -import org.opensearch.client.json.JsonEnum; import org.opensearch.client.json.JsonpDeserializable; import org.opensearch.client.json.JsonpDeserializer; import org.opensearch.client.json.JsonpMapper; -import org.opensearch.client.json.JsonpSerializable; import org.opensearch.client.json.ObjectBuilderDeserializer; import org.opensearch.client.json.ObjectDeserializer; -import org.opensearch.client.json.PlainJsonSerializable; -import org.opensearch.client.opensearch._types.query_dsl.Query; -import org.opensearch.client.util.ApiTypeHelper; +import org.opensearch.client.util.CopyableBuilder; import org.opensearch.client.util.ObjectBuilder; -import org.opensearch.client.util.ObjectBuilderBase; -import org.opensearch.client.util.TaggedUnion; -import org.opensearch.client.util.TaggedUnionUtils; +import org.opensearch.client.util.ToCopyableBuilder; // typedef: _types.aggregations.AggregationContainer @JsonpDeserializable @Generated("org.opensearch.client.codegen.CodeGenerator") -public class Aggregation implements TaggedUnion, PlainJsonSerializable { - /** - * {@link Aggregation} variant kinds. - */ - public enum Kind implements JsonEnum { - AdjacencyMatrix("adjacency_matrix"), - AutoDateHistogram("auto_date_histogram"), - Avg("avg"), - AvgBucket("avg_bucket"), - Boxplot("boxplot"), - BucketScript("bucket_script"), - BucketSelector("bucket_selector"), - BucketSort("bucket_sort"), - Cardinality("cardinality"), - Children("children"), - Composite("composite"), - CumulativeCardinality("cumulative_cardinality"), - CumulativeSum("cumulative_sum"), - DateHistogram("date_histogram"), - DateRange("date_range"), - Derivative("derivative"), - DiversifiedSampler("diversified_sampler"), - ExtendedStats("extended_stats"), - ExtendedStatsBucket("extended_stats_bucket"), - Filter("filter"), - Filters("filters"), - GeoBounds("geo_bounds"), - GeoCentroid("geo_centroid"), - GeoDistance("geo_distance"), - GeohashGrid("geohash_grid"), - GeotileGrid("geotile_grid"), - Global("global"), - Histogram("histogram"), - IpRange("ip_range"), - MatrixStats("matrix_stats"), - Max("max"), - MaxBucket("max_bucket"), - MedianAbsoluteDeviation("median_absolute_deviation"), - Min("min"), - MinBucket("min_bucket"), - Missing("missing"), - MovingAvg("moving_avg"), - MovingFn("moving_fn"), - MovingPercentiles("moving_percentiles"), - MultiTerms("multi_terms"), - Nested("nested"), - Normalize("normalize"), - Parent("parent"), - PercentileRanks("percentile_ranks"), - Percentiles("percentiles"), - PercentilesBucket("percentiles_bucket"), - Range("range"), - RareTerms("rare_terms"), - Rate("rate"), - ReverseNested("reverse_nested"), - Sampler("sampler"), - ScriptedMetric("scripted_metric"), - SerialDiff("serial_diff"), - SignificantTerms("significant_terms"), - SignificantText("significant_text"), - Stats("stats"), - StatsBucket("stats_bucket"), - Sum("sum"), - SumBucket("sum_bucket"), - TTest("t_test"), - Terms("terms"), - TopHits("top_hits"), - ValueCount("value_count"), - VariableWidthHistogram("variable_width_histogram"), - WeightedAvg("weighted_avg"); - - private final String jsonValue; - - Kind(String jsonValue) { - this.jsonValue = jsonValue; - } - - @Override - public String jsonValue() { - return jsonValue; - } - } - - private final Kind _kind; - private final AggregationVariant _value; +public class Aggregation extends AggregationBase implements ToCopyableBuilder { - @Override - public final Kind _kind() { - return _kind; - } + @Nullable + private final AdjacencyMatrixAggregationFields adjacencyMatrix; - @Override - public final AggregationVariant _get() { - return _value; - } + @Nullable + private final JsonData aggregations; - @Nonnull - private final Map meta; + @Nullable + private final JsonData aggs; - public Aggregation(AggregationVariant value) { - this._kind = ApiTypeHelper.requireNonNull(value._aggregationKind(), this, ""); - this._value = ApiTypeHelper.requireNonNull(value, this, ""); - this.meta = null; - } + @Nullable + private final AutoDateHistogramAggregationFields autoDateHistogram; - private Aggregation(Builder builder) { - this.meta = ApiTypeHelper.unmodifiable(builder.meta); - this._kind = ApiTypeHelper.requireNonNull(builder._kind, builder, ""); - this._value = ApiTypeHelper.requireNonNull(builder._value, builder, ""); - } + @Nullable + private final AverageAggregation avg; - public static Aggregation of(Function> fn) { - return fn.apply(new Builder()).build(); - } + @Nullable + private final AverageBucketAggregation avgBucket; - /** - * API name: {@code meta} - */ - @Nonnull - public final Map meta() { - return this.meta; - } + @Nullable + private final BoxplotAggregation boxplot; - /** - * Is this variant instance of kind {@code adjacency_matrix}? - */ - public boolean isAdjacencyMatrix() { - return _kind == Kind.AdjacencyMatrix; - } + @Nullable + private final BucketScriptAggregation bucketScript; - /** - * Get the {@code adjacency_matrix} variant value. - * - * @throws IllegalStateException if the current variant is not the {@code adjacency_matrix} kind. - */ - public AdjacencyMatrixAggregation adjacencyMatrix() { - return TaggedUnionUtils.get(this, Kind.AdjacencyMatrix); - } + @Nullable + private final BucketSelectorAggregation bucketSelector; - /** - * Is this variant instance of kind {@code auto_date_histogram}? - */ - public boolean isAutoDateHistogram() { - return _kind == Kind.AutoDateHistogram; - } + @Nullable + private final BucketSortAggregation bucketSort; - /** - * Get the {@code auto_date_histogram} variant value. - * - * @throws IllegalStateException if the current variant is not the {@code auto_date_histogram} kind. - */ - public AutoDateHistogramAggregation autoDateHistogram() { - return TaggedUnionUtils.get(this, Kind.AutoDateHistogram); - } + @Nullable + private final CardinalityAggregation cardinality; - /** - * Is this variant instance of kind {@code avg}? - */ - public boolean isAvg() { - return _kind == Kind.Avg; - } + @Nullable + private final ChildrenAggregationFields children; - /** - * Get the {@code avg} variant value. - * - * @throws IllegalStateException if the current variant is not the {@code avg} kind. - */ - public AverageAggregation avg() { - return TaggedUnionUtils.get(this, Kind.Avg); - } + @Nullable + private final CompositeAggregationFields composite; - /** - * Is this variant instance of kind {@code avg_bucket}? - */ - public boolean isAvgBucket() { - return _kind == Kind.AvgBucket; - } + @Nullable + private final CumulativeCardinalityAggregation cumulativeCardinality; - /** - * Get the {@code avg_bucket} variant value. - * - * @throws IllegalStateException if the current variant is not the {@code avg_bucket} kind. - */ - public AverageBucketAggregation avgBucket() { - return TaggedUnionUtils.get(this, Kind.AvgBucket); - } + @Nullable + private final CumulativeSumAggregation cumulativeSum; - /** - * Is this variant instance of kind {@code boxplot}? - */ - public boolean isBoxplot() { - return _kind == Kind.Boxplot; - } + @Nullable + private final DateHistogramAggregationFields dateHistogram; - /** - * Get the {@code boxplot} variant value. - * - * @throws IllegalStateException if the current variant is not the {@code boxplot} kind. - */ - public BoxplotAggregation boxplot() { - return TaggedUnionUtils.get(this, Kind.Boxplot); - } + @Nullable + private final DateRangeAggregationFields dateRange; - /** - * Is this variant instance of kind {@code bucket_script}? - */ - public boolean isBucketScript() { - return _kind == Kind.BucketScript; - } + @Nullable + private final DerivativeAggregation derivative; - /** - * Get the {@code bucket_script} variant value. - * - * @throws IllegalStateException if the current variant is not the {@code bucket_script} kind. - */ - public BucketScriptAggregation bucketScript() { - return TaggedUnionUtils.get(this, Kind.BucketScript); - } + @Nullable + private final DiversifiedSamplerAggregationFields diversifiedSampler; - /** - * Is this variant instance of kind {@code bucket_selector}? - */ - public boolean isBucketSelector() { - return _kind == Kind.BucketSelector; - } + @Nullable + private final ExtendedStatsAggregation extendedStats; - /** - * Get the {@code bucket_selector} variant value. - * - * @throws IllegalStateException if the current variant is not the {@code bucket_selector} kind. - */ - public BucketSelectorAggregation bucketSelector() { - return TaggedUnionUtils.get(this, Kind.BucketSelector); - } + @Nullable + private final ExtendedStatsBucketAggregation extendedStatsBucket; - /** - * Is this variant instance of kind {@code bucket_sort}? - */ - public boolean isBucketSort() { - return _kind == Kind.BucketSort; - } + @Nullable + private final FilterAggregationFields filter; - /** - * Get the {@code bucket_sort} variant value. - * - * @throws IllegalStateException if the current variant is not the {@code bucket_sort} kind. - */ - public BucketSortAggregation bucketSort() { - return TaggedUnionUtils.get(this, Kind.BucketSort); - } + @Nullable + private final FiltersAggregationFields filters; - /** - * Is this variant instance of kind {@code cardinality}? - */ - public boolean isCardinality() { - return _kind == Kind.Cardinality; - } + @Nullable + private final GeoBoundsAggregation geoBounds; - /** - * Get the {@code cardinality} variant value. - * - * @throws IllegalStateException if the current variant is not the {@code cardinality} kind. - */ - public CardinalityAggregation cardinality() { - return TaggedUnionUtils.get(this, Kind.Cardinality); - } + @Nullable + private final GeoCentroidAggregation geoCentroid; - /** - * Is this variant instance of kind {@code children}? - */ - public boolean isChildren() { - return _kind == Kind.Children; - } + @Nullable + private final GeoDistanceAggregationFields geoDistance; - /** - * Get the {@code children} variant value. - * - * @throws IllegalStateException if the current variant is not the {@code children} kind. - */ - public ChildrenAggregation children() { - return TaggedUnionUtils.get(this, Kind.Children); - } + @Nullable + private final GeoHashGridAggregationFields geohashGrid; - /** - * Is this variant instance of kind {@code composite}? - */ - public boolean isComposite() { - return _kind == Kind.Composite; - } + @Nullable + private final GeoTileGridAggregationFields geotileGrid; - /** - * Get the {@code composite} variant value. - * - * @throws IllegalStateException if the current variant is not the {@code composite} kind. - */ - public CompositeAggregation composite() { - return TaggedUnionUtils.get(this, Kind.Composite); - } + @Nullable + private final GlobalAggregationFields global; - /** - * Is this variant instance of kind {@code cumulative_cardinality}? - */ - public boolean isCumulativeCardinality() { - return _kind == Kind.CumulativeCardinality; - } + @Nullable + private final HistogramAggregationFields histogram; - /** - * Get the {@code cumulative_cardinality} variant value. - * - * @throws IllegalStateException if the current variant is not the {@code cumulative_cardinality} kind. - */ - public CumulativeCardinalityAggregation cumulativeCardinality() { - return TaggedUnionUtils.get(this, Kind.CumulativeCardinality); - } + @Nullable + private final IpRangeAggregationFields ipRange; - /** - * Is this variant instance of kind {@code cumulative_sum}? - */ - public boolean isCumulativeSum() { - return _kind == Kind.CumulativeSum; - } + @Nullable + private final MatrixStatsAggregation matrixStats; - /** - * Get the {@code cumulative_sum} variant value. - * - * @throws IllegalStateException if the current variant is not the {@code cumulative_sum} kind. - */ - public CumulativeSumAggregation cumulativeSum() { - return TaggedUnionUtils.get(this, Kind.CumulativeSum); - } + @Nullable + private final MaxAggregation max; - /** - * Is this variant instance of kind {@code date_histogram}? - */ - public boolean isDateHistogram() { - return _kind == Kind.DateHistogram; - } + @Nullable + private final MaxBucketAggregation maxBucket; - /** - * Get the {@code date_histogram} variant value. - * - * @throws IllegalStateException if the current variant is not the {@code date_histogram} kind. - */ - public DateHistogramAggregation dateHistogram() { - return TaggedUnionUtils.get(this, Kind.DateHistogram); - } + @Nullable + private final MedianAbsoluteDeviationAggregation medianAbsoluteDeviation; - /** - * Is this variant instance of kind {@code date_range}? - */ - public boolean isDateRange() { - return _kind == Kind.DateRange; - } + @Nullable + private final MinAggregation min; - /** - * Get the {@code date_range} variant value. - * - * @throws IllegalStateException if the current variant is not the {@code date_range} kind. - */ - public DateRangeAggregation dateRange() { - return TaggedUnionUtils.get(this, Kind.DateRange); - } + @Nullable + private final MinBucketAggregation minBucket; - /** - * Is this variant instance of kind {@code derivative}? - */ - public boolean isDerivative() { - return _kind == Kind.Derivative; - } + @Nullable + private final MissingAggregationFields missing; - /** - * Get the {@code derivative} variant value. - * - * @throws IllegalStateException if the current variant is not the {@code derivative} kind. - */ - public DerivativeAggregation derivative() { - return TaggedUnionUtils.get(this, Kind.Derivative); - } + @Nullable + private final MovingAverageAggregation movingAvg; - /** - * Is this variant instance of kind {@code diversified_sampler}? - */ - public boolean isDiversifiedSampler() { - return _kind == Kind.DiversifiedSampler; - } + @Nullable + private final MovingFunctionAggregation movingFn; - /** - * Get the {@code diversified_sampler} variant value. - * - * @throws IllegalStateException if the current variant is not the {@code diversified_sampler} kind. - */ - public DiversifiedSamplerAggregation diversifiedSampler() { - return TaggedUnionUtils.get(this, Kind.DiversifiedSampler); - } + @Nullable + private final MovingPercentilesAggregation movingPercentiles; - /** - * Is this variant instance of kind {@code extended_stats}? - */ - public boolean isExtendedStats() { - return _kind == Kind.ExtendedStats; - } + @Nullable + private final MultiTermsAggregationFields multiTerms; - /** - * Get the {@code extended_stats} variant value. - * - * @throws IllegalStateException if the current variant is not the {@code extended_stats} kind. - */ - public ExtendedStatsAggregation extendedStats() { - return TaggedUnionUtils.get(this, Kind.ExtendedStats); - } + @Nullable + private final NestedAggregationFields nested; - /** - * Is this variant instance of kind {@code extended_stats_bucket}? - */ - public boolean isExtendedStatsBucket() { - return _kind == Kind.ExtendedStatsBucket; - } + @Nullable + private final NormalizeAggregation normalize; - /** - * Get the {@code extended_stats_bucket} variant value. - * - * @throws IllegalStateException if the current variant is not the {@code extended_stats_bucket} kind. - */ - public ExtendedStatsBucketAggregation extendedStatsBucket() { - return TaggedUnionUtils.get(this, Kind.ExtendedStatsBucket); - } + @Nullable + private final ParentAggregationFields parent; - /** - * Is this variant instance of kind {@code filter}? - */ - public boolean isFilter() { - return _kind == Kind.Filter; - } + @Nullable + private final PercentileRanksAggregation percentileRanks; - /** - * Get the {@code filter} variant value. - * - * @throws IllegalStateException if the current variant is not the {@code filter} kind. - */ - public Query filter() { - return TaggedUnionUtils.get(this, Kind.Filter); - } + @Nullable + private final PercentilesAggregation percentiles; - /** - * Is this variant instance of kind {@code filters}? - */ - public boolean isFilters() { - return _kind == Kind.Filters; - } + @Nullable + private final PercentilesBucketAggregation percentilesBucket; - /** - * Get the {@code filters} variant value. - * - * @throws IllegalStateException if the current variant is not the {@code filters} kind. - */ - public FiltersAggregation filters() { - return TaggedUnionUtils.get(this, Kind.Filters); - } + @Nullable + private final RangeAggregationFields range; - /** - * Is this variant instance of kind {@code geo_bounds}? - */ - public boolean isGeoBounds() { - return _kind == Kind.GeoBounds; - } + @Nullable + private final RareTermsAggregationFields rareTerms; - /** - * Get the {@code geo_bounds} variant value. - * - * @throws IllegalStateException if the current variant is not the {@code geo_bounds} kind. - */ - public GeoBoundsAggregation geoBounds() { - return TaggedUnionUtils.get(this, Kind.GeoBounds); - } + @Nullable + private final RateAggregation rate; - /** - * Is this variant instance of kind {@code geo_centroid}? - */ - public boolean isGeoCentroid() { - return _kind == Kind.GeoCentroid; - } + @Nullable + private final ReverseNestedAggregationFields reverseNested; - /** - * Get the {@code geo_centroid} variant value. - * - * @throws IllegalStateException if the current variant is not the {@code geo_centroid} kind. - */ - public GeoCentroidAggregation geoCentroid() { - return TaggedUnionUtils.get(this, Kind.GeoCentroid); - } + @Nullable + private final SamplerAggregationFields sampler; - /** - * Is this variant instance of kind {@code geo_distance}? - */ - public boolean isGeoDistance() { - return _kind == Kind.GeoDistance; - } + @Nullable + private final ScriptedMetricAggregation scriptedMetric; - /** - * Get the {@code geo_distance} variant value. - * - * @throws IllegalStateException if the current variant is not the {@code geo_distance} kind. - */ - public GeoDistanceAggregation geoDistance() { - return TaggedUnionUtils.get(this, Kind.GeoDistance); - } + @Nullable + private final SerialDifferencingAggregation serialDiff; - /** - * Is this variant instance of kind {@code geohash_grid}? - */ - public boolean isGeohashGrid() { - return _kind == Kind.GeohashGrid; - } + @Nullable + private final SignificantTermsAggregationFields significantTerms; - /** - * Get the {@code geohash_grid} variant value. - * - * @throws IllegalStateException if the current variant is not the {@code geohash_grid} kind. - */ - public GeoHashGridAggregation geohashGrid() { - return TaggedUnionUtils.get(this, Kind.GeohashGrid); - } + @Nullable + private final SignificantTextAggregationFields significantText; - /** - * Is this variant instance of kind {@code geotile_grid}? - */ - public boolean isGeotileGrid() { - return _kind == Kind.GeotileGrid; - } + @Nullable + private final StatsAggregation stats; - /** - * Get the {@code geotile_grid} variant value. - * - * @throws IllegalStateException if the current variant is not the {@code geotile_grid} kind. - */ - public GeoTileGridAggregation geotileGrid() { - return TaggedUnionUtils.get(this, Kind.GeotileGrid); - } + @Nullable + private final StatsBucketAggregation statsBucket; - /** - * Is this variant instance of kind {@code global}? - */ - public boolean isGlobal() { - return _kind == Kind.Global; - } + @Nullable + private final SumAggregation sum; - /** - * Get the {@code global} variant value. - * - * @throws IllegalStateException if the current variant is not the {@code global} kind. - */ - public GlobalAggregation global() { - return TaggedUnionUtils.get(this, Kind.Global); - } + @Nullable + private final SumBucketAggregation sumBucket; - /** - * Is this variant instance of kind {@code histogram}? - */ - public boolean isHistogram() { - return _kind == Kind.Histogram; - } + @Nullable + private final TTestAggregation tTest; - /** - * Get the {@code histogram} variant value. - * - * @throws IllegalStateException if the current variant is not the {@code histogram} kind. - */ - public HistogramAggregation histogram() { - return TaggedUnionUtils.get(this, Kind.Histogram); - } + @Nullable + private final TermsAggregationFields terms; - /** - * Is this variant instance of kind {@code ip_range}? - */ - public boolean isIpRange() { - return _kind == Kind.IpRange; - } + @Nullable + private final TopHitsAggregation topHits; - /** - * Get the {@code ip_range} variant value. - * - * @throws IllegalStateException if the current variant is not the {@code ip_range} kind. - */ - public IpRangeAggregation ipRange() { - return TaggedUnionUtils.get(this, Kind.IpRange); - } + @Nullable + private final ValueCountAggregation valueCount; - /** - * Is this variant instance of kind {@code matrix_stats}? - */ - public boolean isMatrixStats() { - return _kind == Kind.MatrixStats; - } + @Nullable + private final VariableWidthHistogramAggregation variableWidthHistogram; - /** - * Get the {@code matrix_stats} variant value. - * - * @throws IllegalStateException if the current variant is not the {@code matrix_stats} kind. - */ - public MatrixStatsAggregation matrixStats() { - return TaggedUnionUtils.get(this, Kind.MatrixStats); - } + @Nullable + private final WeightedAverageAggregation weightedAvg; - /** - * Is this variant instance of kind {@code max}? - */ - public boolean isMax() { - return _kind == Kind.Max; - } + // --------------------------------------------------------------------------------------------- - /** - * Get the {@code max} variant value. - * - * @throws IllegalStateException if the current variant is not the {@code max} kind. - */ - public MaxAggregation max() { - return TaggedUnionUtils.get(this, Kind.Max); + private Aggregation(Builder builder) { + super(builder); + this.adjacencyMatrix = builder.adjacencyMatrix; + this.aggregations = builder.aggregations; + this.aggs = builder.aggs; + this.autoDateHistogram = builder.autoDateHistogram; + this.avg = builder.avg; + this.avgBucket = builder.avgBucket; + this.boxplot = builder.boxplot; + this.bucketScript = builder.bucketScript; + this.bucketSelector = builder.bucketSelector; + this.bucketSort = builder.bucketSort; + this.cardinality = builder.cardinality; + this.children = builder.children; + this.composite = builder.composite; + this.cumulativeCardinality = builder.cumulativeCardinality; + this.cumulativeSum = builder.cumulativeSum; + this.dateHistogram = builder.dateHistogram; + this.dateRange = builder.dateRange; + this.derivative = builder.derivative; + this.diversifiedSampler = builder.diversifiedSampler; + this.extendedStats = builder.extendedStats; + this.extendedStatsBucket = builder.extendedStatsBucket; + this.filter = builder.filter; + this.filters = builder.filters; + this.geoBounds = builder.geoBounds; + this.geoCentroid = builder.geoCentroid; + this.geoDistance = builder.geoDistance; + this.geohashGrid = builder.geohashGrid; + this.geotileGrid = builder.geotileGrid; + this.global = builder.global; + this.histogram = builder.histogram; + this.ipRange = builder.ipRange; + this.matrixStats = builder.matrixStats; + this.max = builder.max; + this.maxBucket = builder.maxBucket; + this.medianAbsoluteDeviation = builder.medianAbsoluteDeviation; + this.min = builder.min; + this.minBucket = builder.minBucket; + this.missing = builder.missing; + this.movingAvg = builder.movingAvg; + this.movingFn = builder.movingFn; + this.movingPercentiles = builder.movingPercentiles; + this.multiTerms = builder.multiTerms; + this.nested = builder.nested; + this.normalize = builder.normalize; + this.parent = builder.parent; + this.percentileRanks = builder.percentileRanks; + this.percentiles = builder.percentiles; + this.percentilesBucket = builder.percentilesBucket; + this.range = builder.range; + this.rareTerms = builder.rareTerms; + this.rate = builder.rate; + this.reverseNested = builder.reverseNested; + this.sampler = builder.sampler; + this.scriptedMetric = builder.scriptedMetric; + this.serialDiff = builder.serialDiff; + this.significantTerms = builder.significantTerms; + this.significantText = builder.significantText; + this.stats = builder.stats; + this.statsBucket = builder.statsBucket; + this.sum = builder.sum; + this.sumBucket = builder.sumBucket; + this.tTest = builder.tTest; + this.terms = builder.terms; + this.topHits = builder.topHits; + this.valueCount = builder.valueCount; + this.variableWidthHistogram = builder.variableWidthHistogram; + this.weightedAvg = builder.weightedAvg; } - /** - * Is this variant instance of kind {@code max_bucket}? - */ - public boolean isMaxBucket() { - return _kind == Kind.MaxBucket; + public static Aggregation of(Function> fn) { + return fn.apply(new Builder()).build(); } /** - * Get the {@code max_bucket} variant value. - * - * @throws IllegalStateException if the current variant is not the {@code max_bucket} kind. + * API name: {@code adjacency_matrix} */ - public MaxBucketAggregation maxBucket() { - return TaggedUnionUtils.get(this, Kind.MaxBucket); + @Nullable + public final AdjacencyMatrixAggregationFields adjacencyMatrix() { + return this.adjacencyMatrix; } /** - * Is this variant instance of kind {@code median_absolute_deviation}? + * API name: {@code aggregations} */ - public boolean isMedianAbsoluteDeviation() { - return _kind == Kind.MedianAbsoluteDeviation; + @Nullable + public final JsonData aggregations() { + return this.aggregations; } /** - * Get the {@code median_absolute_deviation} variant value. - * - * @throws IllegalStateException if the current variant is not the {@code median_absolute_deviation} kind. + * API name: {@code aggs} */ - public MedianAbsoluteDeviationAggregation medianAbsoluteDeviation() { - return TaggedUnionUtils.get(this, Kind.MedianAbsoluteDeviation); + @Nullable + public final JsonData aggs() { + return this.aggs; } /** - * Is this variant instance of kind {@code min}? + * API name: {@code auto_date_histogram} */ - public boolean isMin() { - return _kind == Kind.Min; + @Nullable + public final AutoDateHistogramAggregationFields autoDateHistogram() { + return this.autoDateHistogram; } /** - * Get the {@code min} variant value. - * - * @throws IllegalStateException if the current variant is not the {@code min} kind. + * API name: {@code avg} */ - public MinAggregation min() { - return TaggedUnionUtils.get(this, Kind.Min); + @Nullable + public final AverageAggregation avg() { + return this.avg; } /** - * Is this variant instance of kind {@code min_bucket}? + * API name: {@code avg_bucket} */ - public boolean isMinBucket() { - return _kind == Kind.MinBucket; + @Nullable + public final AverageBucketAggregation avgBucket() { + return this.avgBucket; } /** - * Get the {@code min_bucket} variant value. - * - * @throws IllegalStateException if the current variant is not the {@code min_bucket} kind. + * API name: {@code boxplot} */ - public MinBucketAggregation minBucket() { - return TaggedUnionUtils.get(this, Kind.MinBucket); + @Nullable + public final BoxplotAggregation boxplot() { + return this.boxplot; } /** - * Is this variant instance of kind {@code missing}? + * API name: {@code bucket_script} */ - public boolean isMissing() { - return _kind == Kind.Missing; + @Nullable + public final BucketScriptAggregation bucketScript() { + return this.bucketScript; } /** - * Get the {@code missing} variant value. - * - * @throws IllegalStateException if the current variant is not the {@code missing} kind. + * API name: {@code bucket_selector} */ - public MissingAggregation missing() { - return TaggedUnionUtils.get(this, Kind.Missing); + @Nullable + public final BucketSelectorAggregation bucketSelector() { + return this.bucketSelector; } /** - * Is this variant instance of kind {@code moving_avg}? + * API name: {@code bucket_sort} */ - public boolean isMovingAvg() { - return _kind == Kind.MovingAvg; + @Nullable + public final BucketSortAggregation bucketSort() { + return this.bucketSort; } /** - * Get the {@code moving_avg} variant value. - * - * @throws IllegalStateException if the current variant is not the {@code moving_avg} kind. + * API name: {@code cardinality} */ - public MovingAverageAggregation movingAvg() { - return TaggedUnionUtils.get(this, Kind.MovingAvg); + @Nullable + public final CardinalityAggregation cardinality() { + return this.cardinality; } /** - * Is this variant instance of kind {@code moving_fn}? + * API name: {@code children} */ - public boolean isMovingFn() { - return _kind == Kind.MovingFn; + @Nullable + public final ChildrenAggregationFields children() { + return this.children; } /** - * Get the {@code moving_fn} variant value. - * - * @throws IllegalStateException if the current variant is not the {@code moving_fn} kind. + * API name: {@code composite} */ - public MovingFunctionAggregation movingFn() { - return TaggedUnionUtils.get(this, Kind.MovingFn); + @Nullable + public final CompositeAggregationFields composite() { + return this.composite; } /** - * Is this variant instance of kind {@code moving_percentiles}? + * API name: {@code cumulative_cardinality} */ - public boolean isMovingPercentiles() { - return _kind == Kind.MovingPercentiles; + @Nullable + public final CumulativeCardinalityAggregation cumulativeCardinality() { + return this.cumulativeCardinality; } /** - * Get the {@code moving_percentiles} variant value. - * - * @throws IllegalStateException if the current variant is not the {@code moving_percentiles} kind. + * API name: {@code cumulative_sum} */ - public MovingPercentilesAggregation movingPercentiles() { - return TaggedUnionUtils.get(this, Kind.MovingPercentiles); + @Nullable + public final CumulativeSumAggregation cumulativeSum() { + return this.cumulativeSum; } /** - * Is this variant instance of kind {@code multi_terms}? + * API name: {@code date_histogram} */ - public boolean isMultiTerms() { - return _kind == Kind.MultiTerms; + @Nullable + public final DateHistogramAggregationFields dateHistogram() { + return this.dateHistogram; } /** - * Get the {@code multi_terms} variant value. - * - * @throws IllegalStateException if the current variant is not the {@code multi_terms} kind. + * API name: {@code date_range} */ - public MultiTermsAggregation multiTerms() { - return TaggedUnionUtils.get(this, Kind.MultiTerms); + @Nullable + public final DateRangeAggregationFields dateRange() { + return this.dateRange; } /** - * Is this variant instance of kind {@code nested}? + * API name: {@code derivative} */ - public boolean isNested() { - return _kind == Kind.Nested; + @Nullable + public final DerivativeAggregation derivative() { + return this.derivative; } /** - * Get the {@code nested} variant value. - * - * @throws IllegalStateException if the current variant is not the {@code nested} kind. + * API name: {@code diversified_sampler} */ - public NestedAggregation nested() { - return TaggedUnionUtils.get(this, Kind.Nested); + @Nullable + public final DiversifiedSamplerAggregationFields diversifiedSampler() { + return this.diversifiedSampler; } /** - * Is this variant instance of kind {@code normalize}? + * API name: {@code extended_stats} */ - public boolean isNormalize() { - return _kind == Kind.Normalize; + @Nullable + public final ExtendedStatsAggregation extendedStats() { + return this.extendedStats; } /** - * Get the {@code normalize} variant value. - * - * @throws IllegalStateException if the current variant is not the {@code normalize} kind. + * API name: {@code extended_stats_bucket} */ - public NormalizeAggregation normalize() { - return TaggedUnionUtils.get(this, Kind.Normalize); + @Nullable + public final ExtendedStatsBucketAggregation extendedStatsBucket() { + return this.extendedStatsBucket; } /** - * Is this variant instance of kind {@code parent}? + * API name: {@code filter} */ - public boolean isParent() { - return _kind == Kind.Parent; + @Nullable + public final FilterAggregationFields filter() { + return this.filter; } /** - * Get the {@code parent} variant value. - * - * @throws IllegalStateException if the current variant is not the {@code parent} kind. + * API name: {@code filters} */ - public ParentAggregation parent() { - return TaggedUnionUtils.get(this, Kind.Parent); + @Nullable + public final FiltersAggregationFields filters() { + return this.filters; } /** - * Is this variant instance of kind {@code percentile_ranks}? + * API name: {@code geo_bounds} */ - public boolean isPercentileRanks() { - return _kind == Kind.PercentileRanks; + @Nullable + public final GeoBoundsAggregation geoBounds() { + return this.geoBounds; } /** - * Get the {@code percentile_ranks} variant value. - * - * @throws IllegalStateException if the current variant is not the {@code percentile_ranks} kind. + * API name: {@code geo_centroid} */ - public PercentileRanksAggregation percentileRanks() { - return TaggedUnionUtils.get(this, Kind.PercentileRanks); + @Nullable + public final GeoCentroidAggregation geoCentroid() { + return this.geoCentroid; } /** - * Is this variant instance of kind {@code percentiles}? + * API name: {@code geo_distance} */ - public boolean isPercentiles() { - return _kind == Kind.Percentiles; + @Nullable + public final GeoDistanceAggregationFields geoDistance() { + return this.geoDistance; } /** - * Get the {@code percentiles} variant value. - * - * @throws IllegalStateException if the current variant is not the {@code percentiles} kind. + * API name: {@code geohash_grid} */ - public PercentilesAggregation percentiles() { - return TaggedUnionUtils.get(this, Kind.Percentiles); + @Nullable + public final GeoHashGridAggregationFields geohashGrid() { + return this.geohashGrid; } /** - * Is this variant instance of kind {@code percentiles_bucket}? + * API name: {@code geotile_grid} */ - public boolean isPercentilesBucket() { - return _kind == Kind.PercentilesBucket; + @Nullable + public final GeoTileGridAggregationFields geotileGrid() { + return this.geotileGrid; } /** - * Get the {@code percentiles_bucket} variant value. - * - * @throws IllegalStateException if the current variant is not the {@code percentiles_bucket} kind. + * API name: {@code global} */ - public PercentilesBucketAggregation percentilesBucket() { - return TaggedUnionUtils.get(this, Kind.PercentilesBucket); + @Nullable + public final GlobalAggregationFields global() { + return this.global; } /** - * Is this variant instance of kind {@code range}? + * API name: {@code histogram} */ - public boolean isRange() { - return _kind == Kind.Range; + @Nullable + public final HistogramAggregationFields histogram() { + return this.histogram; } /** - * Get the {@code range} variant value. - * - * @throws IllegalStateException if the current variant is not the {@code range} kind. + * API name: {@code ip_range} */ - public RangeAggregation range() { - return TaggedUnionUtils.get(this, Kind.Range); + @Nullable + public final IpRangeAggregationFields ipRange() { + return this.ipRange; } /** - * Is this variant instance of kind {@code rare_terms}? + * API name: {@code matrix_stats} */ - public boolean isRareTerms() { - return _kind == Kind.RareTerms; + @Nullable + public final MatrixStatsAggregation matrixStats() { + return this.matrixStats; } /** - * Get the {@code rare_terms} variant value. - * - * @throws IllegalStateException if the current variant is not the {@code rare_terms} kind. + * API name: {@code max} */ - public RareTermsAggregation rareTerms() { - return TaggedUnionUtils.get(this, Kind.RareTerms); + @Nullable + public final MaxAggregation max() { + return this.max; } /** - * Is this variant instance of kind {@code rate}? + * API name: {@code max_bucket} */ - public boolean isRate() { - return _kind == Kind.Rate; + @Nullable + public final MaxBucketAggregation maxBucket() { + return this.maxBucket; } /** - * Get the {@code rate} variant value. - * - * @throws IllegalStateException if the current variant is not the {@code rate} kind. + * API name: {@code median_absolute_deviation} */ - public RateAggregation rate() { - return TaggedUnionUtils.get(this, Kind.Rate); + @Nullable + public final MedianAbsoluteDeviationAggregation medianAbsoluteDeviation() { + return this.medianAbsoluteDeviation; } /** - * Is this variant instance of kind {@code reverse_nested}? + * API name: {@code min} */ - public boolean isReverseNested() { - return _kind == Kind.ReverseNested; + @Nullable + public final MinAggregation min() { + return this.min; } /** - * Get the {@code reverse_nested} variant value. - * - * @throws IllegalStateException if the current variant is not the {@code reverse_nested} kind. + * API name: {@code min_bucket} */ - public ReverseNestedAggregation reverseNested() { - return TaggedUnionUtils.get(this, Kind.ReverseNested); + @Nullable + public final MinBucketAggregation minBucket() { + return this.minBucket; } /** - * Is this variant instance of kind {@code sampler}? + * API name: {@code missing} */ - public boolean isSampler() { - return _kind == Kind.Sampler; + @Nullable + public final MissingAggregationFields missing() { + return this.missing; } /** - * Get the {@code sampler} variant value. - * - * @throws IllegalStateException if the current variant is not the {@code sampler} kind. + * API name: {@code moving_avg} */ - public SamplerAggregation sampler() { - return TaggedUnionUtils.get(this, Kind.Sampler); + @Nullable + public final MovingAverageAggregation movingAvg() { + return this.movingAvg; } /** - * Is this variant instance of kind {@code scripted_metric}? + * API name: {@code moving_fn} */ - public boolean isScriptedMetric() { - return _kind == Kind.ScriptedMetric; + @Nullable + public final MovingFunctionAggregation movingFn() { + return this.movingFn; } /** - * Get the {@code scripted_metric} variant value. - * - * @throws IllegalStateException if the current variant is not the {@code scripted_metric} kind. + * API name: {@code moving_percentiles} */ - public ScriptedMetricAggregation scriptedMetric() { - return TaggedUnionUtils.get(this, Kind.ScriptedMetric); + @Nullable + public final MovingPercentilesAggregation movingPercentiles() { + return this.movingPercentiles; } /** - * Is this variant instance of kind {@code serial_diff}? + * API name: {@code multi_terms} */ - public boolean isSerialDiff() { - return _kind == Kind.SerialDiff; + @Nullable + public final MultiTermsAggregationFields multiTerms() { + return this.multiTerms; } /** - * Get the {@code serial_diff} variant value. - * - * @throws IllegalStateException if the current variant is not the {@code serial_diff} kind. + * API name: {@code nested} */ - public SerialDifferencingAggregation serialDiff() { - return TaggedUnionUtils.get(this, Kind.SerialDiff); + @Nullable + public final NestedAggregationFields nested() { + return this.nested; } /** - * Is this variant instance of kind {@code significant_terms}? + * API name: {@code normalize} */ - public boolean isSignificantTerms() { - return _kind == Kind.SignificantTerms; + @Nullable + public final NormalizeAggregation normalize() { + return this.normalize; } /** - * Get the {@code significant_terms} variant value. - * - * @throws IllegalStateException if the current variant is not the {@code significant_terms} kind. + * API name: {@code parent} */ - public SignificantTermsAggregation significantTerms() { - return TaggedUnionUtils.get(this, Kind.SignificantTerms); + @Nullable + public final ParentAggregationFields parent() { + return this.parent; } /** - * Is this variant instance of kind {@code significant_text}? + * API name: {@code percentile_ranks} */ - public boolean isSignificantText() { - return _kind == Kind.SignificantText; + @Nullable + public final PercentileRanksAggregation percentileRanks() { + return this.percentileRanks; } /** - * Get the {@code significant_text} variant value. - * - * @throws IllegalStateException if the current variant is not the {@code significant_text} kind. + * API name: {@code percentiles} */ - public SignificantTextAggregation significantText() { - return TaggedUnionUtils.get(this, Kind.SignificantText); + @Nullable + public final PercentilesAggregation percentiles() { + return this.percentiles; } /** - * Is this variant instance of kind {@code stats}? + * API name: {@code percentiles_bucket} */ - public boolean isStats() { - return _kind == Kind.Stats; + @Nullable + public final PercentilesBucketAggregation percentilesBucket() { + return this.percentilesBucket; } /** - * Get the {@code stats} variant value. - * - * @throws IllegalStateException if the current variant is not the {@code stats} kind. + * API name: {@code range} */ - public StatsAggregation stats() { - return TaggedUnionUtils.get(this, Kind.Stats); + @Nullable + public final RangeAggregationFields range() { + return this.range; } /** - * Is this variant instance of kind {@code stats_bucket}? + * API name: {@code rare_terms} */ - public boolean isStatsBucket() { - return _kind == Kind.StatsBucket; + @Nullable + public final RareTermsAggregationFields rareTerms() { + return this.rareTerms; } /** - * Get the {@code stats_bucket} variant value. - * - * @throws IllegalStateException if the current variant is not the {@code stats_bucket} kind. + * API name: {@code rate} */ - public StatsBucketAggregation statsBucket() { - return TaggedUnionUtils.get(this, Kind.StatsBucket); + @Nullable + public final RateAggregation rate() { + return this.rate; } /** - * Is this variant instance of kind {@code sum}? + * API name: {@code reverse_nested} */ - public boolean isSum() { - return _kind == Kind.Sum; + @Nullable + public final ReverseNestedAggregationFields reverseNested() { + return this.reverseNested; } /** - * Get the {@code sum} variant value. - * - * @throws IllegalStateException if the current variant is not the {@code sum} kind. + * API name: {@code sampler} */ - public SumAggregation sum() { - return TaggedUnionUtils.get(this, Kind.Sum); + @Nullable + public final SamplerAggregationFields sampler() { + return this.sampler; } /** - * Is this variant instance of kind {@code sum_bucket}? + * API name: {@code scripted_metric} */ - public boolean isSumBucket() { - return _kind == Kind.SumBucket; + @Nullable + public final ScriptedMetricAggregation scriptedMetric() { + return this.scriptedMetric; } /** - * Get the {@code sum_bucket} variant value. - * - * @throws IllegalStateException if the current variant is not the {@code sum_bucket} kind. + * API name: {@code serial_diff} */ - public SumBucketAggregation sumBucket() { - return TaggedUnionUtils.get(this, Kind.SumBucket); + @Nullable + public final SerialDifferencingAggregation serialDiff() { + return this.serialDiff; } /** - * Is this variant instance of kind {@code t_test}? + * API name: {@code significant_terms} */ - public boolean isTTest() { - return _kind == Kind.TTest; + @Nullable + public final SignificantTermsAggregationFields significantTerms() { + return this.significantTerms; } /** - * Get the {@code t_test} variant value. - * - * @throws IllegalStateException if the current variant is not the {@code t_test} kind. + * API name: {@code significant_text} */ - public TTestAggregation tTest() { - return TaggedUnionUtils.get(this, Kind.TTest); + @Nullable + public final SignificantTextAggregationFields significantText() { + return this.significantText; } /** - * Is this variant instance of kind {@code terms}? + * API name: {@code stats} */ - public boolean isTerms() { - return _kind == Kind.Terms; + @Nullable + public final StatsAggregation stats() { + return this.stats; } /** - * Get the {@code terms} variant value. - * - * @throws IllegalStateException if the current variant is not the {@code terms} kind. + * API name: {@code stats_bucket} */ - public TermsAggregation terms() { - return TaggedUnionUtils.get(this, Kind.Terms); + @Nullable + public final StatsBucketAggregation statsBucket() { + return this.statsBucket; } /** - * Is this variant instance of kind {@code top_hits}? + * API name: {@code sum} */ - public boolean isTopHits() { - return _kind == Kind.TopHits; + @Nullable + public final SumAggregation sum() { + return this.sum; } /** - * Get the {@code top_hits} variant value. - * - * @throws IllegalStateException if the current variant is not the {@code top_hits} kind. + * API name: {@code sum_bucket} */ - public TopHitsAggregation topHits() { - return TaggedUnionUtils.get(this, Kind.TopHits); + @Nullable + public final SumBucketAggregation sumBucket() { + return this.sumBucket; } /** - * Is this variant instance of kind {@code value_count}? + * API name: {@code t_test} */ - public boolean isValueCount() { - return _kind == Kind.ValueCount; + @Nullable + public final TTestAggregation tTest() { + return this.tTest; } /** - * Get the {@code value_count} variant value. - * - * @throws IllegalStateException if the current variant is not the {@code value_count} kind. + * API name: {@code terms} */ - public ValueCountAggregation valueCount() { - return TaggedUnionUtils.get(this, Kind.ValueCount); + @Nullable + public final TermsAggregationFields terms() { + return this.terms; } /** - * Is this variant instance of kind {@code variable_width_histogram}? + * API name: {@code top_hits} */ - public boolean isVariableWidthHistogram() { - return _kind == Kind.VariableWidthHistogram; + @Nullable + public final TopHitsAggregation topHits() { + return this.topHits; } /** - * Get the {@code variable_width_histogram} variant value. - * - * @throws IllegalStateException if the current variant is not the {@code variable_width_histogram} kind. + * API name: {@code value_count} */ - public VariableWidthHistogramAggregation variableWidthHistogram() { - return TaggedUnionUtils.get(this, Kind.VariableWidthHistogram); + @Nullable + public final ValueCountAggregation valueCount() { + return this.valueCount; } /** - * Is this variant instance of kind {@code weighted_avg}? + * API name: {@code variable_width_histogram} */ - public boolean isWeightedAvg() { - return _kind == Kind.WeightedAvg; + @Nullable + public final VariableWidthHistogramAggregation variableWidthHistogram() { + return this.variableWidthHistogram; } /** - * Get the {@code weighted_avg} variant value. - * - * @throws IllegalStateException if the current variant is not the {@code weighted_avg} kind. + * API name: {@code weighted_avg} */ - public WeightedAverageAggregation weightedAvg() { - return TaggedUnionUtils.get(this, Kind.WeightedAvg); + @Nullable + public final WeightedAverageAggregation weightedAvg() { + return this.weightedAvg; } - @Override - public void serialize(JsonGenerator generator, JsonpMapper mapper) { - generator.writeStartObject(); - 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(); + protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { + super.serializeInternal(generator, mapper); + if (this.adjacencyMatrix != null) { + generator.writeKey("adjacency_matrix"); + this.adjacencyMatrix.serialize(generator, mapper); } - generator.writeKey(_kind.jsonValue()); - if (_value instanceof JsonpSerializable) { - ((JsonpSerializable) _value).serialize(generator, mapper); - } - generator.writeEnd(); - } - - @Nonnull - public Builder toBuilder() { - return new Builder(this); - } - - @Nonnull - public static Builder builder() { - return new Builder(); - } - public static class Builder extends ObjectBuilderBase { - private Kind _kind; - private AggregationVariant _value; - @Nullable - private Map meta; - - public Builder() {} - - private Builder(Aggregation o) { - this.meta = _mapCopy(o.meta); - this._kind = o._kind; - this._value = o._value; + if (this.aggregations != null) { + generator.writeKey("aggregations"); + this.aggregations.serialize(generator, mapper); } - /** - * API name: {@code meta} - * - *

- * Adds all elements of map to meta. - *

- */ - @Nonnull - public final Builder meta(Map map) { - this.meta = _mapPutAll(this.meta, map); - return this; + if (this.aggs != null) { + generator.writeKey("aggs"); + this.aggs.serialize(generator, mapper); } - /** - * API name: {@code meta} - * - *

- * Adds an entry to meta. - *

- */ - @Nonnull - public final Builder meta(String key, JsonData value) { - this.meta = _mapPut(this.meta, key, value); - return this; + if (this.autoDateHistogram != null) { + generator.writeKey("auto_date_histogram"); + this.autoDateHistogram.serialize(generator, mapper); } - public ContainerBuilder adjacencyMatrix(AdjacencyMatrixAggregation v) { - this._kind = Kind.AdjacencyMatrix; - this._value = v; - return new ContainerBuilder(); + if (this.avg != null) { + generator.writeKey("avg"); + this.avg.serialize(generator, mapper); } - public ContainerBuilder adjacencyMatrix( - Function> fn - ) { - return this.adjacencyMatrix(fn.apply(new AdjacencyMatrixAggregation.Builder()).build()); + if (this.avgBucket != null) { + generator.writeKey("avg_bucket"); + this.avgBucket.serialize(generator, mapper); } - public ContainerBuilder autoDateHistogram(AutoDateHistogramAggregation v) { - this._kind = Kind.AutoDateHistogram; - this._value = v; - return new ContainerBuilder(); + if (this.boxplot != null) { + generator.writeKey("boxplot"); + this.boxplot.serialize(generator, mapper); } - public ContainerBuilder autoDateHistogram( - Function> fn - ) { - return this.autoDateHistogram(fn.apply(new AutoDateHistogramAggregation.Builder()).build()); + if (this.bucketScript != null) { + generator.writeKey("bucket_script"); + this.bucketScript.serialize(generator, mapper); } - public ContainerBuilder avg(AverageAggregation v) { - this._kind = Kind.Avg; - this._value = v; - return new ContainerBuilder(); + if (this.bucketSelector != null) { + generator.writeKey("bucket_selector"); + this.bucketSelector.serialize(generator, mapper); } - public ContainerBuilder avg(Function> fn) { - return this.avg(fn.apply(new AverageAggregation.Builder()).build()); + if (this.bucketSort != null) { + generator.writeKey("bucket_sort"); + this.bucketSort.serialize(generator, mapper); } - public ContainerBuilder avgBucket(AverageBucketAggregation v) { - this._kind = Kind.AvgBucket; - this._value = v; - return new ContainerBuilder(); + if (this.cardinality != null) { + generator.writeKey("cardinality"); + this.cardinality.serialize(generator, mapper); } - public ContainerBuilder avgBucket(Function> fn) { - return this.avgBucket(fn.apply(new AverageBucketAggregation.Builder()).build()); + if (this.children != null) { + generator.writeKey("children"); + this.children.serialize(generator, mapper); } - public ContainerBuilder boxplot(BoxplotAggregation v) { - this._kind = Kind.Boxplot; - this._value = v; - return new ContainerBuilder(); + if (this.composite != null) { + generator.writeKey("composite"); + this.composite.serialize(generator, mapper); } - public ContainerBuilder boxplot(Function> fn) { - return this.boxplot(fn.apply(new BoxplotAggregation.Builder()).build()); + if (this.cumulativeCardinality != null) { + generator.writeKey("cumulative_cardinality"); + this.cumulativeCardinality.serialize(generator, mapper); } - public ContainerBuilder bucketScript(BucketScriptAggregation v) { - this._kind = Kind.BucketScript; - this._value = v; - return new ContainerBuilder(); + if (this.cumulativeSum != null) { + generator.writeKey("cumulative_sum"); + this.cumulativeSum.serialize(generator, mapper); } - public ContainerBuilder bucketScript(Function> fn) { - return this.bucketScript(fn.apply(new BucketScriptAggregation.Builder()).build()); + if (this.dateHistogram != null) { + generator.writeKey("date_histogram"); + this.dateHistogram.serialize(generator, mapper); } - public ContainerBuilder bucketSelector(BucketSelectorAggregation v) { - this._kind = Kind.BucketSelector; - this._value = v; - return new ContainerBuilder(); + if (this.dateRange != null) { + generator.writeKey("date_range"); + this.dateRange.serialize(generator, mapper); } - public ContainerBuilder bucketSelector(Function> fn) { - return this.bucketSelector(fn.apply(new BucketSelectorAggregation.Builder()).build()); + if (this.derivative != null) { + generator.writeKey("derivative"); + this.derivative.serialize(generator, mapper); } - public ContainerBuilder bucketSort(BucketSortAggregation v) { - this._kind = Kind.BucketSort; - this._value = v; - return new ContainerBuilder(); + if (this.diversifiedSampler != null) { + generator.writeKey("diversified_sampler"); + this.diversifiedSampler.serialize(generator, mapper); } - public ContainerBuilder bucketSort(Function> fn) { - return this.bucketSort(fn.apply(new BucketSortAggregation.Builder()).build()); + if (this.extendedStats != null) { + generator.writeKey("extended_stats"); + this.extendedStats.serialize(generator, mapper); } - public ContainerBuilder cardinality(CardinalityAggregation v) { - this._kind = Kind.Cardinality; - this._value = v; - return new ContainerBuilder(); + if (this.extendedStatsBucket != null) { + generator.writeKey("extended_stats_bucket"); + this.extendedStatsBucket.serialize(generator, mapper); } - public ContainerBuilder cardinality(Function> fn) { - return this.cardinality(fn.apply(new CardinalityAggregation.Builder()).build()); + if (this.filter != null) { + generator.writeKey("filter"); + this.filter.serialize(generator, mapper); } - public ContainerBuilder children(ChildrenAggregation v) { - this._kind = Kind.Children; - this._value = v; - return new ContainerBuilder(); + if (this.filters != null) { + generator.writeKey("filters"); + this.filters.serialize(generator, mapper); } - public ContainerBuilder children(Function> fn) { - return this.children(fn.apply(new ChildrenAggregation.Builder()).build()); + if (this.geoBounds != null) { + generator.writeKey("geo_bounds"); + this.geoBounds.serialize(generator, mapper); } - public ContainerBuilder composite(CompositeAggregation v) { - this._kind = Kind.Composite; - this._value = v; - return new ContainerBuilder(); + if (this.geoCentroid != null) { + generator.writeKey("geo_centroid"); + this.geoCentroid.serialize(generator, mapper); } - public ContainerBuilder composite(Function> fn) { - return this.composite(fn.apply(new CompositeAggregation.Builder()).build()); + if (this.geoDistance != null) { + generator.writeKey("geo_distance"); + this.geoDistance.serialize(generator, mapper); } - public ContainerBuilder cumulativeCardinality(CumulativeCardinalityAggregation v) { - this._kind = Kind.CumulativeCardinality; - this._value = v; - return new ContainerBuilder(); + if (this.geohashGrid != null) { + generator.writeKey("geohash_grid"); + this.geohashGrid.serialize(generator, mapper); } - public ContainerBuilder cumulativeCardinality( - Function> fn - ) { - return this.cumulativeCardinality(fn.apply(new CumulativeCardinalityAggregation.Builder()).build()); + if (this.geotileGrid != null) { + generator.writeKey("geotile_grid"); + this.geotileGrid.serialize(generator, mapper); } - public ContainerBuilder cumulativeSum(CumulativeSumAggregation v) { - this._kind = Kind.CumulativeSum; - this._value = v; - return new ContainerBuilder(); + if (this.global != null) { + generator.writeKey("global"); + this.global.serialize(generator, mapper); } - public ContainerBuilder cumulativeSum(Function> fn) { - return this.cumulativeSum(fn.apply(new CumulativeSumAggregation.Builder()).build()); + if (this.histogram != null) { + generator.writeKey("histogram"); + this.histogram.serialize(generator, mapper); } - public ContainerBuilder dateHistogram(DateHistogramAggregation v) { - this._kind = Kind.DateHistogram; - this._value = v; - return new ContainerBuilder(); + if (this.ipRange != null) { + generator.writeKey("ip_range"); + this.ipRange.serialize(generator, mapper); } - public ContainerBuilder dateHistogram(Function> fn) { - return this.dateHistogram(fn.apply(new DateHistogramAggregation.Builder()).build()); + if (this.matrixStats != null) { + generator.writeKey("matrix_stats"); + this.matrixStats.serialize(generator, mapper); } - public ContainerBuilder dateRange(DateRangeAggregation v) { - this._kind = Kind.DateRange; - this._value = v; - return new ContainerBuilder(); + if (this.max != null) { + generator.writeKey("max"); + this.max.serialize(generator, mapper); } - public ContainerBuilder dateRange(Function> fn) { - return this.dateRange(fn.apply(new DateRangeAggregation.Builder()).build()); + if (this.maxBucket != null) { + generator.writeKey("max_bucket"); + this.maxBucket.serialize(generator, mapper); } - public ContainerBuilder derivative(DerivativeAggregation v) { - this._kind = Kind.Derivative; - this._value = v; - return new ContainerBuilder(); + if (this.medianAbsoluteDeviation != null) { + generator.writeKey("median_absolute_deviation"); + this.medianAbsoluteDeviation.serialize(generator, mapper); } - public ContainerBuilder derivative(Function> fn) { - return this.derivative(fn.apply(new DerivativeAggregation.Builder()).build()); + if (this.min != null) { + generator.writeKey("min"); + this.min.serialize(generator, mapper); } - public ContainerBuilder diversifiedSampler(DiversifiedSamplerAggregation v) { - this._kind = Kind.DiversifiedSampler; - this._value = v; - return new ContainerBuilder(); + if (this.minBucket != null) { + generator.writeKey("min_bucket"); + this.minBucket.serialize(generator, mapper); } - public ContainerBuilder diversifiedSampler( - Function> fn - ) { - return this.diversifiedSampler(fn.apply(new DiversifiedSamplerAggregation.Builder()).build()); + if (this.missing != null) { + generator.writeKey("missing"); + this.missing.serialize(generator, mapper); } - public ContainerBuilder extendedStats(ExtendedStatsAggregation v) { - this._kind = Kind.ExtendedStats; - this._value = v; - return new ContainerBuilder(); + if (this.movingAvg != null) { + generator.writeKey("moving_avg"); + this.movingAvg.serialize(generator, mapper); } - public ContainerBuilder extendedStats(Function> fn) { - return this.extendedStats(fn.apply(new ExtendedStatsAggregation.Builder()).build()); + if (this.movingFn != null) { + generator.writeKey("moving_fn"); + this.movingFn.serialize(generator, mapper); } - public ContainerBuilder extendedStatsBucket(ExtendedStatsBucketAggregation v) { - this._kind = Kind.ExtendedStatsBucket; - this._value = v; - return new ContainerBuilder(); + if (this.movingPercentiles != null) { + generator.writeKey("moving_percentiles"); + this.movingPercentiles.serialize(generator, mapper); } - public ContainerBuilder extendedStatsBucket( - Function> fn - ) { - return this.extendedStatsBucket(fn.apply(new ExtendedStatsBucketAggregation.Builder()).build()); + if (this.multiTerms != null) { + generator.writeKey("multi_terms"); + this.multiTerms.serialize(generator, mapper); } - public ContainerBuilder filter(Query v) { - this._kind = Kind.Filter; - this._value = v; - return new ContainerBuilder(); + if (this.nested != null) { + generator.writeKey("nested"); + this.nested.serialize(generator, mapper); } - public ContainerBuilder filter(Function> fn) { - return this.filter(fn.apply(new Query.Builder()).build()); + if (this.normalize != null) { + generator.writeKey("normalize"); + this.normalize.serialize(generator, mapper); } - public ContainerBuilder filters(FiltersAggregation v) { - this._kind = Kind.Filters; - this._value = v; - return new ContainerBuilder(); + if (this.parent != null) { + generator.writeKey("parent"); + this.parent.serialize(generator, mapper); } - public ContainerBuilder filters(Function> fn) { - return this.filters(fn.apply(new FiltersAggregation.Builder()).build()); + if (this.percentileRanks != null) { + generator.writeKey("percentile_ranks"); + this.percentileRanks.serialize(generator, mapper); } - public ContainerBuilder geoBounds(GeoBoundsAggregation v) { - this._kind = Kind.GeoBounds; - this._value = v; - return new ContainerBuilder(); + if (this.percentiles != null) { + generator.writeKey("percentiles"); + this.percentiles.serialize(generator, mapper); } - public ContainerBuilder geoBounds(Function> fn) { - return this.geoBounds(fn.apply(new GeoBoundsAggregation.Builder()).build()); + if (this.percentilesBucket != null) { + generator.writeKey("percentiles_bucket"); + this.percentilesBucket.serialize(generator, mapper); } - public ContainerBuilder geoCentroid(GeoCentroidAggregation v) { - this._kind = Kind.GeoCentroid; - this._value = v; - return new ContainerBuilder(); + if (this.range != null) { + generator.writeKey("range"); + this.range.serialize(generator, mapper); } - public ContainerBuilder geoCentroid(Function> fn) { - return this.geoCentroid(fn.apply(new GeoCentroidAggregation.Builder()).build()); + if (this.rareTerms != null) { + generator.writeKey("rare_terms"); + this.rareTerms.serialize(generator, mapper); } - public ContainerBuilder geoDistance(GeoDistanceAggregation v) { - this._kind = Kind.GeoDistance; - this._value = v; - return new ContainerBuilder(); + if (this.rate != null) { + generator.writeKey("rate"); + this.rate.serialize(generator, mapper); } - public ContainerBuilder geoDistance(Function> fn) { - return this.geoDistance(fn.apply(new GeoDistanceAggregation.Builder()).build()); + if (this.reverseNested != null) { + generator.writeKey("reverse_nested"); + this.reverseNested.serialize(generator, mapper); } - public ContainerBuilder geohashGrid(GeoHashGridAggregation v) { - this._kind = Kind.GeohashGrid; - this._value = v; - return new ContainerBuilder(); + if (this.sampler != null) { + generator.writeKey("sampler"); + this.sampler.serialize(generator, mapper); } - public ContainerBuilder geohashGrid(Function> fn) { - return this.geohashGrid(fn.apply(new GeoHashGridAggregation.Builder()).build()); + if (this.scriptedMetric != null) { + generator.writeKey("scripted_metric"); + this.scriptedMetric.serialize(generator, mapper); } - public ContainerBuilder geotileGrid(GeoTileGridAggregation v) { - this._kind = Kind.GeotileGrid; - this._value = v; - return new ContainerBuilder(); + if (this.serialDiff != null) { + generator.writeKey("serial_diff"); + this.serialDiff.serialize(generator, mapper); } - public ContainerBuilder geotileGrid(Function> fn) { - return this.geotileGrid(fn.apply(new GeoTileGridAggregation.Builder()).build()); + if (this.significantTerms != null) { + generator.writeKey("significant_terms"); + this.significantTerms.serialize(generator, mapper); } - public ContainerBuilder global(GlobalAggregation v) { - this._kind = Kind.Global; - this._value = v; - return new ContainerBuilder(); + if (this.significantText != null) { + generator.writeKey("significant_text"); + this.significantText.serialize(generator, mapper); } - public ContainerBuilder global(Function> fn) { - return this.global(fn.apply(new GlobalAggregation.Builder()).build()); + if (this.stats != null) { + generator.writeKey("stats"); + this.stats.serialize(generator, mapper); } - public ContainerBuilder histogram(HistogramAggregation v) { - this._kind = Kind.Histogram; - this._value = v; - return new ContainerBuilder(); + if (this.statsBucket != null) { + generator.writeKey("stats_bucket"); + this.statsBucket.serialize(generator, mapper); } - public ContainerBuilder histogram(Function> fn) { - return this.histogram(fn.apply(new HistogramAggregation.Builder()).build()); + if (this.sum != null) { + generator.writeKey("sum"); + this.sum.serialize(generator, mapper); } - public ContainerBuilder ipRange(IpRangeAggregation v) { - this._kind = Kind.IpRange; - this._value = v; - return new ContainerBuilder(); + if (this.sumBucket != null) { + generator.writeKey("sum_bucket"); + this.sumBucket.serialize(generator, mapper); } - public ContainerBuilder ipRange(Function> fn) { - return this.ipRange(fn.apply(new IpRangeAggregation.Builder()).build()); + if (this.tTest != null) { + generator.writeKey("t_test"); + this.tTest.serialize(generator, mapper); } - public ContainerBuilder matrixStats(MatrixStatsAggregation v) { - this._kind = Kind.MatrixStats; - this._value = v; - return new ContainerBuilder(); + if (this.terms != null) { + generator.writeKey("terms"); + this.terms.serialize(generator, mapper); } - public ContainerBuilder matrixStats(Function> fn) { - return this.matrixStats(fn.apply(new MatrixStatsAggregation.Builder()).build()); + if (this.topHits != null) { + generator.writeKey("top_hits"); + this.topHits.serialize(generator, mapper); } - public ContainerBuilder max(MaxAggregation v) { - this._kind = Kind.Max; - this._value = v; - return new ContainerBuilder(); + if (this.valueCount != null) { + generator.writeKey("value_count"); + this.valueCount.serialize(generator, mapper); } - public ContainerBuilder max(Function> fn) { - return this.max(fn.apply(new MaxAggregation.Builder()).build()); + if (this.variableWidthHistogram != null) { + generator.writeKey("variable_width_histogram"); + this.variableWidthHistogram.serialize(generator, mapper); } - public ContainerBuilder maxBucket(MaxBucketAggregation v) { - this._kind = Kind.MaxBucket; - this._value = v; - return new ContainerBuilder(); + if (this.weightedAvg != null) { + generator.writeKey("weighted_avg"); + this.weightedAvg.serialize(generator, mapper); } + } - public ContainerBuilder maxBucket(Function> fn) { - return this.maxBucket(fn.apply(new MaxBucketAggregation.Builder()).build()); - } + // --------------------------------------------------------------------------------------------- - public ContainerBuilder medianAbsoluteDeviation(MedianAbsoluteDeviationAggregation v) { - this._kind = Kind.MedianAbsoluteDeviation; - this._value = v; - return new ContainerBuilder(); - } + @Override + @Nonnull + public Builder toBuilder() { + return new Builder(this); + } - public ContainerBuilder medianAbsoluteDeviation( - Function> fn - ) { - return this.medianAbsoluteDeviation(fn.apply(new MedianAbsoluteDeviationAggregation.Builder()).build()); + @Nonnull + public static Builder builder() { + return new Builder(); + } + + /** + * Builder for {@link Aggregation}. + */ + public static class Builder extends AggregationBase.AbstractBuilder implements CopyableBuilder { + @Nullable + private AdjacencyMatrixAggregationFields adjacencyMatrix; + @Nullable + private JsonData aggregations; + @Nullable + private JsonData aggs; + @Nullable + private AutoDateHistogramAggregationFields autoDateHistogram; + @Nullable + private AverageAggregation avg; + @Nullable + private AverageBucketAggregation avgBucket; + @Nullable + private BoxplotAggregation boxplot; + @Nullable + private BucketScriptAggregation bucketScript; + @Nullable + private BucketSelectorAggregation bucketSelector; + @Nullable + private BucketSortAggregation bucketSort; + @Nullable + private CardinalityAggregation cardinality; + @Nullable + private ChildrenAggregationFields children; + @Nullable + private CompositeAggregationFields composite; + @Nullable + private CumulativeCardinalityAggregation cumulativeCardinality; + @Nullable + private CumulativeSumAggregation cumulativeSum; + @Nullable + private DateHistogramAggregationFields dateHistogram; + @Nullable + private DateRangeAggregationFields dateRange; + @Nullable + private DerivativeAggregation derivative; + @Nullable + private DiversifiedSamplerAggregationFields diversifiedSampler; + @Nullable + private ExtendedStatsAggregation extendedStats; + @Nullable + private ExtendedStatsBucketAggregation extendedStatsBucket; + @Nullable + private FilterAggregationFields filter; + @Nullable + private FiltersAggregationFields filters; + @Nullable + private GeoBoundsAggregation geoBounds; + @Nullable + private GeoCentroidAggregation geoCentroid; + @Nullable + private GeoDistanceAggregationFields geoDistance; + @Nullable + private GeoHashGridAggregationFields geohashGrid; + @Nullable + private GeoTileGridAggregationFields geotileGrid; + @Nullable + private GlobalAggregationFields global; + @Nullable + private HistogramAggregationFields histogram; + @Nullable + private IpRangeAggregationFields ipRange; + @Nullable + private MatrixStatsAggregation matrixStats; + @Nullable + private MaxAggregation max; + @Nullable + private MaxBucketAggregation maxBucket; + @Nullable + private MedianAbsoluteDeviationAggregation medianAbsoluteDeviation; + @Nullable + private MinAggregation min; + @Nullable + private MinBucketAggregation minBucket; + @Nullable + private MissingAggregationFields missing; + @Nullable + private MovingAverageAggregation movingAvg; + @Nullable + private MovingFunctionAggregation movingFn; + @Nullable + private MovingPercentilesAggregation movingPercentiles; + @Nullable + private MultiTermsAggregationFields multiTerms; + @Nullable + private NestedAggregationFields nested; + @Nullable + private NormalizeAggregation normalize; + @Nullable + private ParentAggregationFields parent; + @Nullable + private PercentileRanksAggregation percentileRanks; + @Nullable + private PercentilesAggregation percentiles; + @Nullable + private PercentilesBucketAggregation percentilesBucket; + @Nullable + private RangeAggregationFields range; + @Nullable + private RareTermsAggregationFields rareTerms; + @Nullable + private RateAggregation rate; + @Nullable + private ReverseNestedAggregationFields reverseNested; + @Nullable + private SamplerAggregationFields sampler; + @Nullable + private ScriptedMetricAggregation scriptedMetric; + @Nullable + private SerialDifferencingAggregation serialDiff; + @Nullable + private SignificantTermsAggregationFields significantTerms; + @Nullable + private SignificantTextAggregationFields significantText; + @Nullable + private StatsAggregation stats; + @Nullable + private StatsBucketAggregation statsBucket; + @Nullable + private SumAggregation sum; + @Nullable + private SumBucketAggregation sumBucket; + @Nullable + private TTestAggregation tTest; + @Nullable + private TermsAggregationFields terms; + @Nullable + private TopHitsAggregation topHits; + @Nullable + private ValueCountAggregation valueCount; + @Nullable + private VariableWidthHistogramAggregation variableWidthHistogram; + @Nullable + private WeightedAverageAggregation weightedAvg; + + public Builder() {} + + private Builder(Aggregation o) { + super(o); + this.adjacencyMatrix = o.adjacencyMatrix; + this.aggregations = o.aggregations; + this.aggs = o.aggs; + this.autoDateHistogram = o.autoDateHistogram; + this.avg = o.avg; + this.avgBucket = o.avgBucket; + this.boxplot = o.boxplot; + this.bucketScript = o.bucketScript; + this.bucketSelector = o.bucketSelector; + this.bucketSort = o.bucketSort; + this.cardinality = o.cardinality; + this.children = o.children; + this.composite = o.composite; + this.cumulativeCardinality = o.cumulativeCardinality; + this.cumulativeSum = o.cumulativeSum; + this.dateHistogram = o.dateHistogram; + this.dateRange = o.dateRange; + this.derivative = o.derivative; + this.diversifiedSampler = o.diversifiedSampler; + this.extendedStats = o.extendedStats; + this.extendedStatsBucket = o.extendedStatsBucket; + this.filter = o.filter; + this.filters = o.filters; + this.geoBounds = o.geoBounds; + this.geoCentroid = o.geoCentroid; + this.geoDistance = o.geoDistance; + this.geohashGrid = o.geohashGrid; + this.geotileGrid = o.geotileGrid; + this.global = o.global; + this.histogram = o.histogram; + this.ipRange = o.ipRange; + this.matrixStats = o.matrixStats; + this.max = o.max; + this.maxBucket = o.maxBucket; + this.medianAbsoluteDeviation = o.medianAbsoluteDeviation; + this.min = o.min; + this.minBucket = o.minBucket; + this.missing = o.missing; + this.movingAvg = o.movingAvg; + this.movingFn = o.movingFn; + this.movingPercentiles = o.movingPercentiles; + this.multiTerms = o.multiTerms; + this.nested = o.nested; + this.normalize = o.normalize; + this.parent = o.parent; + this.percentileRanks = o.percentileRanks; + this.percentiles = o.percentiles; + this.percentilesBucket = o.percentilesBucket; + this.range = o.range; + this.rareTerms = o.rareTerms; + this.rate = o.rate; + this.reverseNested = o.reverseNested; + this.sampler = o.sampler; + this.scriptedMetric = o.scriptedMetric; + this.serialDiff = o.serialDiff; + this.significantTerms = o.significantTerms; + this.significantText = o.significantText; + this.stats = o.stats; + this.statsBucket = o.statsBucket; + this.sum = o.sum; + this.sumBucket = o.sumBucket; + this.tTest = o.tTest; + this.terms = o.terms; + this.topHits = o.topHits; + this.valueCount = o.valueCount; + this.variableWidthHistogram = o.variableWidthHistogram; + this.weightedAvg = o.weightedAvg; + } + + private Builder(Builder o) { + super(o); + this.adjacencyMatrix = o.adjacencyMatrix; + this.aggregations = o.aggregations; + this.aggs = o.aggs; + this.autoDateHistogram = o.autoDateHistogram; + this.avg = o.avg; + this.avgBucket = o.avgBucket; + this.boxplot = o.boxplot; + this.bucketScript = o.bucketScript; + this.bucketSelector = o.bucketSelector; + this.bucketSort = o.bucketSort; + this.cardinality = o.cardinality; + this.children = o.children; + this.composite = o.composite; + this.cumulativeCardinality = o.cumulativeCardinality; + this.cumulativeSum = o.cumulativeSum; + this.dateHistogram = o.dateHistogram; + this.dateRange = o.dateRange; + this.derivative = o.derivative; + this.diversifiedSampler = o.diversifiedSampler; + this.extendedStats = o.extendedStats; + this.extendedStatsBucket = o.extendedStatsBucket; + this.filter = o.filter; + this.filters = o.filters; + this.geoBounds = o.geoBounds; + this.geoCentroid = o.geoCentroid; + this.geoDistance = o.geoDistance; + this.geohashGrid = o.geohashGrid; + this.geotileGrid = o.geotileGrid; + this.global = o.global; + this.histogram = o.histogram; + this.ipRange = o.ipRange; + this.matrixStats = o.matrixStats; + this.max = o.max; + this.maxBucket = o.maxBucket; + this.medianAbsoluteDeviation = o.medianAbsoluteDeviation; + this.min = o.min; + this.minBucket = o.minBucket; + this.missing = o.missing; + this.movingAvg = o.movingAvg; + this.movingFn = o.movingFn; + this.movingPercentiles = o.movingPercentiles; + this.multiTerms = o.multiTerms; + this.nested = o.nested; + this.normalize = o.normalize; + this.parent = o.parent; + this.percentileRanks = o.percentileRanks; + this.percentiles = o.percentiles; + this.percentilesBucket = o.percentilesBucket; + this.range = o.range; + this.rareTerms = o.rareTerms; + this.rate = o.rate; + this.reverseNested = o.reverseNested; + this.sampler = o.sampler; + this.scriptedMetric = o.scriptedMetric; + this.serialDiff = o.serialDiff; + this.significantTerms = o.significantTerms; + this.significantText = o.significantText; + this.stats = o.stats; + this.statsBucket = o.statsBucket; + this.sum = o.sum; + this.sumBucket = o.sumBucket; + this.tTest = o.tTest; + this.terms = o.terms; + this.topHits = o.topHits; + this.valueCount = o.valueCount; + this.variableWidthHistogram = o.variableWidthHistogram; + this.weightedAvg = o.weightedAvg; + } + + @Override + @Nonnull + public Builder copy() { + return new Builder(this); + } + + @Override + @Nonnull + protected Builder self() { + return this; + } + + /** + * API name: {@code adjacency_matrix} + */ + @Nonnull + public final Builder adjacencyMatrix(@Nullable AdjacencyMatrixAggregationFields value) { + this.adjacencyMatrix = value; + return this; + } + + /** + * API name: {@code adjacency_matrix} + */ + @Nonnull + public final Builder adjacencyMatrix( + Function> fn + ) { + return adjacencyMatrix(fn.apply(new AdjacencyMatrixAggregationFields.Builder()).build()); + } + + /** + * API name: {@code aggregations} + */ + @Nonnull + public final Builder aggregations(@Nullable JsonData value) { + this.aggregations = value; + return this; + } + + /** + * API name: {@code aggs} + */ + @Nonnull + public final Builder aggs(@Nullable JsonData value) { + this.aggs = value; + return this; + } + + /** + * API name: {@code auto_date_histogram} + */ + @Nonnull + public final Builder autoDateHistogram(@Nullable AutoDateHistogramAggregationFields value) { + this.autoDateHistogram = value; + return this; + } + + /** + * API name: {@code auto_date_histogram} + */ + @Nonnull + public final Builder autoDateHistogram( + Function> fn + ) { + return autoDateHistogram(fn.apply(new AutoDateHistogramAggregationFields.Builder()).build()); + } + + /** + * API name: {@code avg} + */ + @Nonnull + public final Builder avg(@Nullable AverageAggregation value) { + this.avg = value; + return this; + } + + /** + * API name: {@code avg} + */ + @Nonnull + public final Builder avg(Function> fn) { + return avg(fn.apply(new AverageAggregation.Builder()).build()); + } + + /** + * API name: {@code avg_bucket} + */ + @Nonnull + public final Builder avgBucket(@Nullable AverageBucketAggregation value) { + this.avgBucket = value; + return this; + } + + /** + * API name: {@code avg_bucket} + */ + @Nonnull + public final Builder avgBucket(Function> fn) { + return avgBucket(fn.apply(new AverageBucketAggregation.Builder()).build()); + } + + /** + * API name: {@code boxplot} + */ + @Nonnull + public final Builder boxplot(@Nullable BoxplotAggregation value) { + this.boxplot = value; + return this; + } + + /** + * API name: {@code boxplot} + */ + @Nonnull + public final Builder boxplot(Function> fn) { + return boxplot(fn.apply(new BoxplotAggregation.Builder()).build()); + } + + /** + * API name: {@code bucket_script} + */ + @Nonnull + public final Builder bucketScript(@Nullable BucketScriptAggregation value) { + this.bucketScript = value; + return this; + } + + /** + * API name: {@code bucket_script} + */ + @Nonnull + public final Builder bucketScript(Function> fn) { + return bucketScript(fn.apply(new BucketScriptAggregation.Builder()).build()); + } + + /** + * API name: {@code bucket_selector} + */ + @Nonnull + public final Builder bucketSelector(@Nullable BucketSelectorAggregation value) { + this.bucketSelector = value; + return this; + } + + /** + * API name: {@code bucket_selector} + */ + @Nonnull + public final Builder bucketSelector(Function> fn) { + return bucketSelector(fn.apply(new BucketSelectorAggregation.Builder()).build()); + } + + /** + * API name: {@code bucket_sort} + */ + @Nonnull + public final Builder bucketSort(@Nullable BucketSortAggregation value) { + this.bucketSort = value; + return this; + } + + /** + * API name: {@code bucket_sort} + */ + @Nonnull + public final Builder bucketSort(Function> fn) { + return bucketSort(fn.apply(new BucketSortAggregation.Builder()).build()); + } + + /** + * API name: {@code cardinality} + */ + @Nonnull + public final Builder cardinality(@Nullable CardinalityAggregation value) { + this.cardinality = value; + return this; + } + + /** + * API name: {@code cardinality} + */ + @Nonnull + public final Builder cardinality(Function> fn) { + return cardinality(fn.apply(new CardinalityAggregation.Builder()).build()); + } + + /** + * API name: {@code children} + */ + @Nonnull + public final Builder children(@Nullable ChildrenAggregationFields value) { + this.children = value; + return this; + } + + /** + * API name: {@code children} + */ + @Nonnull + public final Builder children(Function> fn) { + return children(fn.apply(new ChildrenAggregationFields.Builder()).build()); + } + + /** + * API name: {@code composite} + */ + @Nonnull + public final Builder composite(@Nullable CompositeAggregationFields value) { + this.composite = value; + return this; + } + + /** + * API name: {@code composite} + */ + @Nonnull + public final Builder composite(Function> fn) { + return composite(fn.apply(new CompositeAggregationFields.Builder()).build()); + } + + /** + * API name: {@code cumulative_cardinality} + */ + @Nonnull + public final Builder cumulativeCardinality(@Nullable CumulativeCardinalityAggregation value) { + this.cumulativeCardinality = value; + return this; + } + + /** + * API name: {@code cumulative_cardinality} + */ + @Nonnull + public final Builder cumulativeCardinality( + Function> fn + ) { + return cumulativeCardinality(fn.apply(new CumulativeCardinalityAggregation.Builder()).build()); + } + + /** + * API name: {@code cumulative_sum} + */ + @Nonnull + public final Builder cumulativeSum(@Nullable CumulativeSumAggregation value) { + this.cumulativeSum = value; + return this; + } + + /** + * API name: {@code cumulative_sum} + */ + @Nonnull + public final Builder cumulativeSum(Function> fn) { + return cumulativeSum(fn.apply(new CumulativeSumAggregation.Builder()).build()); + } + + /** + * API name: {@code date_histogram} + */ + @Nonnull + public final Builder dateHistogram(@Nullable DateHistogramAggregationFields value) { + this.dateHistogram = value; + return this; + } + + /** + * API name: {@code date_histogram} + */ + @Nonnull + public final Builder dateHistogram( + Function> fn + ) { + return dateHistogram(fn.apply(new DateHistogramAggregationFields.Builder()).build()); + } + + /** + * API name: {@code date_range} + */ + @Nonnull + public final Builder dateRange(@Nullable DateRangeAggregationFields value) { + this.dateRange = value; + return this; + } + + /** + * API name: {@code date_range} + */ + @Nonnull + public final Builder dateRange(Function> fn) { + return dateRange(fn.apply(new DateRangeAggregationFields.Builder()).build()); + } + + /** + * API name: {@code derivative} + */ + @Nonnull + public final Builder derivative(@Nullable DerivativeAggregation value) { + this.derivative = value; + return this; + } + + /** + * API name: {@code derivative} + */ + @Nonnull + public final Builder derivative(Function> fn) { + return derivative(fn.apply(new DerivativeAggregation.Builder()).build()); + } + + /** + * API name: {@code diversified_sampler} + */ + @Nonnull + public final Builder diversifiedSampler(@Nullable DiversifiedSamplerAggregationFields value) { + this.diversifiedSampler = value; + return this; + } + + /** + * API name: {@code diversified_sampler} + */ + @Nonnull + public final Builder diversifiedSampler( + Function> fn + ) { + return diversifiedSampler(fn.apply(new DiversifiedSamplerAggregationFields.Builder()).build()); + } + + /** + * API name: {@code extended_stats} + */ + @Nonnull + public final Builder extendedStats(@Nullable ExtendedStatsAggregation value) { + this.extendedStats = value; + return this; + } + + /** + * API name: {@code extended_stats} + */ + @Nonnull + public final Builder extendedStats(Function> fn) { + return extendedStats(fn.apply(new ExtendedStatsAggregation.Builder()).build()); + } + + /** + * API name: {@code extended_stats_bucket} + */ + @Nonnull + public final Builder extendedStatsBucket(@Nullable ExtendedStatsBucketAggregation value) { + this.extendedStatsBucket = value; + return this; + } + + /** + * API name: {@code extended_stats_bucket} + */ + @Nonnull + public final Builder extendedStatsBucket( + Function> fn + ) { + return extendedStatsBucket(fn.apply(new ExtendedStatsBucketAggregation.Builder()).build()); + } + + /** + * API name: {@code filter} + */ + @Nonnull + public final Builder filter(@Nullable FilterAggregationFields value) { + this.filter = value; + return this; + } + + /** + * API name: {@code filter} + */ + @Nonnull + public final Builder filter(Function> fn) { + return filter(fn.apply(new FilterAggregationFields.Builder()).build()); + } + + /** + * API name: {@code filters} + */ + @Nonnull + public final Builder filters(@Nullable FiltersAggregationFields value) { + this.filters = value; + return this; + } + + /** + * API name: {@code filters} + */ + @Nonnull + public final Builder filters(Function> fn) { + return filters(fn.apply(new FiltersAggregationFields.Builder()).build()); + } + + /** + * API name: {@code geo_bounds} + */ + @Nonnull + public final Builder geoBounds(@Nullable GeoBoundsAggregation value) { + this.geoBounds = value; + return this; + } + + /** + * API name: {@code geo_bounds} + */ + @Nonnull + public final Builder geoBounds(Function> fn) { + return geoBounds(fn.apply(new GeoBoundsAggregation.Builder()).build()); + } + + /** + * API name: {@code geo_centroid} + */ + @Nonnull + public final Builder geoCentroid(@Nullable GeoCentroidAggregation value) { + this.geoCentroid = value; + return this; + } + + /** + * API name: {@code geo_centroid} + */ + @Nonnull + public final Builder geoCentroid(Function> fn) { + return geoCentroid(fn.apply(new GeoCentroidAggregation.Builder()).build()); + } + + /** + * API name: {@code geo_distance} + */ + @Nonnull + public final Builder geoDistance(@Nullable GeoDistanceAggregationFields value) { + this.geoDistance = value; + return this; + } + + /** + * API name: {@code geo_distance} + */ + @Nonnull + public final Builder geoDistance(Function> fn) { + return geoDistance(fn.apply(new GeoDistanceAggregationFields.Builder()).build()); + } + + /** + * API name: {@code geohash_grid} + */ + @Nonnull + public final Builder geohashGrid(@Nullable GeoHashGridAggregationFields value) { + this.geohashGrid = value; + return this; + } + + /** + * API name: {@code geohash_grid} + */ + @Nonnull + public final Builder geohashGrid(Function> fn) { + return geohashGrid(fn.apply(new GeoHashGridAggregationFields.Builder()).build()); + } + + /** + * API name: {@code geotile_grid} + */ + @Nonnull + public final Builder geotileGrid(@Nullable GeoTileGridAggregationFields value) { + this.geotileGrid = value; + return this; + } + + /** + * API name: {@code geotile_grid} + */ + @Nonnull + public final Builder geotileGrid(Function> fn) { + return geotileGrid(fn.apply(new GeoTileGridAggregationFields.Builder()).build()); + } + + /** + * API name: {@code global} + */ + @Nonnull + public final Builder global(@Nullable GlobalAggregationFields value) { + this.global = value; + return this; + } + + /** + * API name: {@code global} + */ + @Nonnull + public final Builder global(Function> fn) { + return global(fn.apply(new GlobalAggregationFields.Builder()).build()); + } + + /** + * API name: {@code histogram} + */ + @Nonnull + public final Builder histogram(@Nullable HistogramAggregationFields value) { + this.histogram = value; + return this; + } + + /** + * API name: {@code histogram} + */ + @Nonnull + public final Builder histogram(Function> fn) { + return histogram(fn.apply(new HistogramAggregationFields.Builder()).build()); + } + + /** + * API name: {@code ip_range} + */ + @Nonnull + public final Builder ipRange(@Nullable IpRangeAggregationFields value) { + this.ipRange = value; + return this; + } + + /** + * API name: {@code ip_range} + */ + @Nonnull + public final Builder ipRange(Function> fn) { + return ipRange(fn.apply(new IpRangeAggregationFields.Builder()).build()); + } + + /** + * API name: {@code matrix_stats} + */ + @Nonnull + public final Builder matrixStats(@Nullable MatrixStatsAggregation value) { + this.matrixStats = value; + return this; + } + + /** + * API name: {@code matrix_stats} + */ + @Nonnull + public final Builder matrixStats(Function> fn) { + return matrixStats(fn.apply(new MatrixStatsAggregation.Builder()).build()); + } + + /** + * API name: {@code max} + */ + @Nonnull + public final Builder max(@Nullable MaxAggregation value) { + this.max = value; + return this; + } + + /** + * API name: {@code max} + */ + @Nonnull + public final Builder max(Function> fn) { + return max(fn.apply(new MaxAggregation.Builder()).build()); + } + + /** + * API name: {@code max_bucket} + */ + @Nonnull + public final Builder maxBucket(@Nullable MaxBucketAggregation value) { + this.maxBucket = value; + return this; + } + + /** + * API name: {@code max_bucket} + */ + @Nonnull + public final Builder maxBucket(Function> fn) { + return maxBucket(fn.apply(new MaxBucketAggregation.Builder()).build()); + } + + /** + * API name: {@code median_absolute_deviation} + */ + @Nonnull + public final Builder medianAbsoluteDeviation(@Nullable MedianAbsoluteDeviationAggregation value) { + this.medianAbsoluteDeviation = value; + return this; + } + + /** + * API name: {@code median_absolute_deviation} + */ + @Nonnull + public final Builder medianAbsoluteDeviation( + Function> fn + ) { + return medianAbsoluteDeviation(fn.apply(new MedianAbsoluteDeviationAggregation.Builder()).build()); } - public ContainerBuilder min(MinAggregation v) { - this._kind = Kind.Min; - this._value = v; - return new ContainerBuilder(); + /** + * API name: {@code min} + */ + @Nonnull + public final Builder min(@Nullable MinAggregation value) { + this.min = value; + return this; } - public ContainerBuilder min(Function> fn) { - return this.min(fn.apply(new MinAggregation.Builder()).build()); + /** + * API name: {@code min} + */ + @Nonnull + public final Builder min(Function> fn) { + return min(fn.apply(new MinAggregation.Builder()).build()); } - public ContainerBuilder minBucket(MinBucketAggregation v) { - this._kind = Kind.MinBucket; - this._value = v; - return new ContainerBuilder(); + /** + * API name: {@code min_bucket} + */ + @Nonnull + public final Builder minBucket(@Nullable MinBucketAggregation value) { + this.minBucket = value; + return this; } - public ContainerBuilder minBucket(Function> fn) { - return this.minBucket(fn.apply(new MinBucketAggregation.Builder()).build()); + /** + * API name: {@code min_bucket} + */ + @Nonnull + public final Builder minBucket(Function> fn) { + return minBucket(fn.apply(new MinBucketAggregation.Builder()).build()); } - public ContainerBuilder missing(MissingAggregation v) { - this._kind = Kind.Missing; - this._value = v; - return new ContainerBuilder(); + /** + * API name: {@code missing} + */ + @Nonnull + public final Builder missing(@Nullable MissingAggregationFields value) { + this.missing = value; + return this; } - public ContainerBuilder missing(Function> fn) { - return this.missing(fn.apply(new MissingAggregation.Builder()).build()); + /** + * API name: {@code missing} + */ + @Nonnull + public final Builder missing(Function> fn) { + return missing(fn.apply(new MissingAggregationFields.Builder()).build()); } - public ContainerBuilder movingAvg(MovingAverageAggregation v) { - this._kind = Kind.MovingAvg; - this._value = v; - return new ContainerBuilder(); + /** + * API name: {@code moving_avg} + */ + @Nonnull + public final Builder movingAvg(@Nullable MovingAverageAggregation value) { + this.movingAvg = value; + return this; } - public ContainerBuilder movingAvg(Function> fn) { - return this.movingAvg(fn.apply(new MovingAverageAggregation.Builder()).build()); + /** + * API name: {@code moving_avg} + */ + @Nonnull + public final Builder movingAvg(Function> fn) { + return movingAvg(fn.apply(new MovingAverageAggregation.Builder()).build()); } - public ContainerBuilder movingFn(MovingFunctionAggregation v) { - this._kind = Kind.MovingFn; - this._value = v; - return new ContainerBuilder(); + /** + * API name: {@code moving_fn} + */ + @Nonnull + public final Builder movingFn(@Nullable MovingFunctionAggregation value) { + this.movingFn = value; + return this; } - public ContainerBuilder movingFn(Function> fn) { - return this.movingFn(fn.apply(new MovingFunctionAggregation.Builder()).build()); + /** + * API name: {@code moving_fn} + */ + @Nonnull + public final Builder movingFn(Function> fn) { + return movingFn(fn.apply(new MovingFunctionAggregation.Builder()).build()); } - public ContainerBuilder movingPercentiles(MovingPercentilesAggregation v) { - this._kind = Kind.MovingPercentiles; - this._value = v; - return new ContainerBuilder(); + /** + * API name: {@code moving_percentiles} + */ + @Nonnull + public final Builder movingPercentiles(@Nullable MovingPercentilesAggregation value) { + this.movingPercentiles = value; + return this; } - public ContainerBuilder movingPercentiles( + /** + * API name: {@code moving_percentiles} + */ + @Nonnull + public final Builder movingPercentiles( Function> fn ) { - return this.movingPercentiles(fn.apply(new MovingPercentilesAggregation.Builder()).build()); + return movingPercentiles(fn.apply(new MovingPercentilesAggregation.Builder()).build()); } - public ContainerBuilder multiTerms(MultiTermsAggregation v) { - this._kind = Kind.MultiTerms; - this._value = v; - return new ContainerBuilder(); + /** + * API name: {@code multi_terms} + */ + @Nonnull + public final Builder multiTerms(@Nullable MultiTermsAggregationFields value) { + this.multiTerms = value; + return this; } - public ContainerBuilder multiTerms(Function> fn) { - return this.multiTerms(fn.apply(new MultiTermsAggregation.Builder()).build()); + /** + * API name: {@code multi_terms} + */ + @Nonnull + public final Builder multiTerms(Function> fn) { + return multiTerms(fn.apply(new MultiTermsAggregationFields.Builder()).build()); } - public ContainerBuilder nested(NestedAggregation v) { - this._kind = Kind.Nested; - this._value = v; - return new ContainerBuilder(); + /** + * API name: {@code nested} + */ + @Nonnull + public final Builder nested(@Nullable NestedAggregationFields value) { + this.nested = value; + return this; } - public ContainerBuilder nested(Function> fn) { - return this.nested(fn.apply(new NestedAggregation.Builder()).build()); + /** + * API name: {@code nested} + */ + @Nonnull + public final Builder nested(Function> fn) { + return nested(fn.apply(new NestedAggregationFields.Builder()).build()); } - public ContainerBuilder normalize(NormalizeAggregation v) { - this._kind = Kind.Normalize; - this._value = v; - return new ContainerBuilder(); + /** + * API name: {@code normalize} + */ + @Nonnull + public final Builder normalize(@Nullable NormalizeAggregation value) { + this.normalize = value; + return this; } - public ContainerBuilder normalize(Function> fn) { - return this.normalize(fn.apply(new NormalizeAggregation.Builder()).build()); + /** + * API name: {@code normalize} + */ + @Nonnull + public final Builder normalize(Function> fn) { + return normalize(fn.apply(new NormalizeAggregation.Builder()).build()); } - public ContainerBuilder parent(ParentAggregation v) { - this._kind = Kind.Parent; - this._value = v; - return new ContainerBuilder(); + /** + * API name: {@code parent} + */ + @Nonnull + public final Builder parent(@Nullable ParentAggregationFields value) { + this.parent = value; + return this; } - public ContainerBuilder parent(Function> fn) { - return this.parent(fn.apply(new ParentAggregation.Builder()).build()); + /** + * API name: {@code parent} + */ + @Nonnull + public final Builder parent(Function> fn) { + return parent(fn.apply(new ParentAggregationFields.Builder()).build()); } - public ContainerBuilder percentileRanks(PercentileRanksAggregation v) { - this._kind = Kind.PercentileRanks; - this._value = v; - return new ContainerBuilder(); + /** + * API name: {@code percentile_ranks} + */ + @Nonnull + public final Builder percentileRanks(@Nullable PercentileRanksAggregation value) { + this.percentileRanks = value; + return this; } - public ContainerBuilder percentileRanks( - Function> fn - ) { - return this.percentileRanks(fn.apply(new PercentileRanksAggregation.Builder()).build()); + /** + * API name: {@code percentile_ranks} + */ + @Nonnull + public final Builder percentileRanks(Function> fn) { + return percentileRanks(fn.apply(new PercentileRanksAggregation.Builder()).build()); } - public ContainerBuilder percentiles(PercentilesAggregation v) { - this._kind = Kind.Percentiles; - this._value = v; - return new ContainerBuilder(); + /** + * API name: {@code percentiles} + */ + @Nonnull + public final Builder percentiles(@Nullable PercentilesAggregation value) { + this.percentiles = value; + return this; } - public ContainerBuilder percentiles(Function> fn) { - return this.percentiles(fn.apply(new PercentilesAggregation.Builder()).build()); + /** + * API name: {@code percentiles} + */ + @Nonnull + public final Builder percentiles(Function> fn) { + return percentiles(fn.apply(new PercentilesAggregation.Builder()).build()); } - public ContainerBuilder percentilesBucket(PercentilesBucketAggregation v) { - this._kind = Kind.PercentilesBucket; - this._value = v; - return new ContainerBuilder(); + /** + * API name: {@code percentiles_bucket} + */ + @Nonnull + public final Builder percentilesBucket(@Nullable PercentilesBucketAggregation value) { + this.percentilesBucket = value; + return this; } - public ContainerBuilder percentilesBucket( + /** + * API name: {@code percentiles_bucket} + */ + @Nonnull + public final Builder percentilesBucket( Function> fn ) { - return this.percentilesBucket(fn.apply(new PercentilesBucketAggregation.Builder()).build()); + return percentilesBucket(fn.apply(new PercentilesBucketAggregation.Builder()).build()); } - public ContainerBuilder range(RangeAggregation v) { - this._kind = Kind.Range; - this._value = v; - return new ContainerBuilder(); + /** + * API name: {@code range} + */ + @Nonnull + public final Builder range(@Nullable RangeAggregationFields value) { + this.range = value; + return this; } - public ContainerBuilder range(Function> fn) { - return this.range(fn.apply(new RangeAggregation.Builder()).build()); + /** + * API name: {@code range} + */ + @Nonnull + public final Builder range(Function> fn) { + return range(fn.apply(new RangeAggregationFields.Builder()).build()); } - public ContainerBuilder rareTerms(RareTermsAggregation v) { - this._kind = Kind.RareTerms; - this._value = v; - return new ContainerBuilder(); + /** + * API name: {@code rare_terms} + */ + @Nonnull + public final Builder rareTerms(@Nullable RareTermsAggregationFields value) { + this.rareTerms = value; + return this; } - public ContainerBuilder rareTerms(Function> fn) { - return this.rareTerms(fn.apply(new RareTermsAggregation.Builder()).build()); + /** + * API name: {@code rare_terms} + */ + @Nonnull + public final Builder rareTerms(Function> fn) { + return rareTerms(fn.apply(new RareTermsAggregationFields.Builder()).build()); } - public ContainerBuilder rate(RateAggregation v) { - this._kind = Kind.Rate; - this._value = v; - return new ContainerBuilder(); + /** + * API name: {@code rate} + */ + @Nonnull + public final Builder rate(@Nullable RateAggregation value) { + this.rate = value; + return this; } - public ContainerBuilder rate(Function> fn) { - return this.rate(fn.apply(new RateAggregation.Builder()).build()); + /** + * API name: {@code rate} + */ + @Nonnull + public final Builder rate(Function> fn) { + return rate(fn.apply(new RateAggregation.Builder()).build()); } - public ContainerBuilder reverseNested(ReverseNestedAggregation v) { - this._kind = Kind.ReverseNested; - this._value = v; - return new ContainerBuilder(); + /** + * API name: {@code reverse_nested} + */ + @Nonnull + public final Builder reverseNested(@Nullable ReverseNestedAggregationFields value) { + this.reverseNested = value; + return this; } - public ContainerBuilder reverseNested(Function> fn) { - return this.reverseNested(fn.apply(new ReverseNestedAggregation.Builder()).build()); + /** + * API name: {@code reverse_nested} + */ + @Nonnull + public final Builder reverseNested( + Function> fn + ) { + return reverseNested(fn.apply(new ReverseNestedAggregationFields.Builder()).build()); } - public ContainerBuilder sampler(SamplerAggregation v) { - this._kind = Kind.Sampler; - this._value = v; - return new ContainerBuilder(); + /** + * API name: {@code sampler} + */ + @Nonnull + public final Builder sampler(@Nullable SamplerAggregationFields value) { + this.sampler = value; + return this; } - public ContainerBuilder sampler(Function> fn) { - return this.sampler(fn.apply(new SamplerAggregation.Builder()).build()); + /** + * API name: {@code sampler} + */ + @Nonnull + public final Builder sampler(Function> fn) { + return sampler(fn.apply(new SamplerAggregationFields.Builder()).build()); } - public ContainerBuilder scriptedMetric(ScriptedMetricAggregation v) { - this._kind = Kind.ScriptedMetric; - this._value = v; - return new ContainerBuilder(); + /** + * API name: {@code scripted_metric} + */ + @Nonnull + public final Builder scriptedMetric(@Nullable ScriptedMetricAggregation value) { + this.scriptedMetric = value; + return this; } - public ContainerBuilder scriptedMetric(Function> fn) { - return this.scriptedMetric(fn.apply(new ScriptedMetricAggregation.Builder()).build()); + /** + * API name: {@code scripted_metric} + */ + @Nonnull + public final Builder scriptedMetric(Function> fn) { + return scriptedMetric(fn.apply(new ScriptedMetricAggregation.Builder()).build()); } - public ContainerBuilder serialDiff(SerialDifferencingAggregation v) { - this._kind = Kind.SerialDiff; - this._value = v; - return new ContainerBuilder(); + /** + * API name: {@code serial_diff} + */ + @Nonnull + public final Builder serialDiff(@Nullable SerialDifferencingAggregation value) { + this.serialDiff = value; + return this; } - public ContainerBuilder serialDiff( - Function> fn - ) { - return this.serialDiff(fn.apply(new SerialDifferencingAggregation.Builder()).build()); + /** + * API name: {@code serial_diff} + */ + @Nonnull + public final Builder serialDiff(Function> fn) { + return serialDiff(fn.apply(new SerialDifferencingAggregation.Builder()).build()); } - public ContainerBuilder significantTerms(SignificantTermsAggregation v) { - this._kind = Kind.SignificantTerms; - this._value = v; - return new ContainerBuilder(); + /** + * API name: {@code significant_terms} + */ + @Nonnull + public final Builder significantTerms(@Nullable SignificantTermsAggregationFields value) { + this.significantTerms = value; + return this; } - public ContainerBuilder significantTerms( - Function> fn + /** + * API name: {@code significant_terms} + */ + @Nonnull + public final Builder significantTerms( + Function> fn ) { - return this.significantTerms(fn.apply(new SignificantTermsAggregation.Builder()).build()); + return significantTerms(fn.apply(new SignificantTermsAggregationFields.Builder()).build()); } - public ContainerBuilder significantText(SignificantTextAggregation v) { - this._kind = Kind.SignificantText; - this._value = v; - return new ContainerBuilder(); + /** + * API name: {@code significant_text} + */ + @Nonnull + public final Builder significantText(@Nullable SignificantTextAggregationFields value) { + this.significantText = value; + return this; } - public ContainerBuilder significantText( - Function> fn + /** + * API name: {@code significant_text} + */ + @Nonnull + public final Builder significantText( + Function> fn ) { - return this.significantText(fn.apply(new SignificantTextAggregation.Builder()).build()); + return significantText(fn.apply(new SignificantTextAggregationFields.Builder()).build()); } - public ContainerBuilder stats(StatsAggregation v) { - this._kind = Kind.Stats; - this._value = v; - return new ContainerBuilder(); + /** + * API name: {@code stats} + */ + @Nonnull + public final Builder stats(@Nullable StatsAggregation value) { + this.stats = value; + return this; } - public ContainerBuilder stats(Function> fn) { - return this.stats(fn.apply(new StatsAggregation.Builder()).build()); + /** + * API name: {@code stats} + */ + @Nonnull + public final Builder stats(Function> fn) { + return stats(fn.apply(new StatsAggregation.Builder()).build()); } - public ContainerBuilder statsBucket(StatsBucketAggregation v) { - this._kind = Kind.StatsBucket; - this._value = v; - return new ContainerBuilder(); + /** + * API name: {@code stats_bucket} + */ + @Nonnull + public final Builder statsBucket(@Nullable StatsBucketAggregation value) { + this.statsBucket = value; + return this; } - public ContainerBuilder statsBucket(Function> fn) { - return this.statsBucket(fn.apply(new StatsBucketAggregation.Builder()).build()); + /** + * API name: {@code stats_bucket} + */ + @Nonnull + public final Builder statsBucket(Function> fn) { + return statsBucket(fn.apply(new StatsBucketAggregation.Builder()).build()); } - public ContainerBuilder sum(SumAggregation v) { - this._kind = Kind.Sum; - this._value = v; - return new ContainerBuilder(); + /** + * API name: {@code sum} + */ + @Nonnull + public final Builder sum(@Nullable SumAggregation value) { + this.sum = value; + return this; } - public ContainerBuilder sum(Function> fn) { - return this.sum(fn.apply(new SumAggregation.Builder()).build()); + /** + * API name: {@code sum} + */ + @Nonnull + public final Builder sum(Function> fn) { + return sum(fn.apply(new SumAggregation.Builder()).build()); } - public ContainerBuilder sumBucket(SumBucketAggregation v) { - this._kind = Kind.SumBucket; - this._value = v; - return new ContainerBuilder(); + /** + * API name: {@code sum_bucket} + */ + @Nonnull + public final Builder sumBucket(@Nullable SumBucketAggregation value) { + this.sumBucket = value; + return this; } - public ContainerBuilder sumBucket(Function> fn) { - return this.sumBucket(fn.apply(new SumBucketAggregation.Builder()).build()); + /** + * API name: {@code sum_bucket} + */ + @Nonnull + public final Builder sumBucket(Function> fn) { + return sumBucket(fn.apply(new SumBucketAggregation.Builder()).build()); } - public ContainerBuilder tTest(TTestAggregation v) { - this._kind = Kind.TTest; - this._value = v; - return new ContainerBuilder(); + /** + * API name: {@code t_test} + */ + @Nonnull + public final Builder tTest(@Nullable TTestAggregation value) { + this.tTest = value; + return this; } - public ContainerBuilder tTest(Function> fn) { - return this.tTest(fn.apply(new TTestAggregation.Builder()).build()); + /** + * API name: {@code t_test} + */ + @Nonnull + public final Builder tTest(Function> fn) { + return tTest(fn.apply(new TTestAggregation.Builder()).build()); } - public ContainerBuilder terms(TermsAggregation v) { - this._kind = Kind.Terms; - this._value = v; - return new ContainerBuilder(); + /** + * API name: {@code terms} + */ + @Nonnull + public final Builder terms(@Nullable TermsAggregationFields value) { + this.terms = value; + return this; } - public ContainerBuilder terms(Function> fn) { - return this.terms(fn.apply(new TermsAggregation.Builder()).build()); + /** + * API name: {@code terms} + */ + @Nonnull + public final Builder terms(Function> fn) { + return terms(fn.apply(new TermsAggregationFields.Builder()).build()); } - public ContainerBuilder topHits(TopHitsAggregation v) { - this._kind = Kind.TopHits; - this._value = v; - return new ContainerBuilder(); + /** + * API name: {@code top_hits} + */ + @Nonnull + public final Builder topHits(@Nullable TopHitsAggregation value) { + this.topHits = value; + return this; } - public ContainerBuilder topHits(Function> fn) { - return this.topHits(fn.apply(new TopHitsAggregation.Builder()).build()); + /** + * API name: {@code top_hits} + */ + @Nonnull + public final Builder topHits(Function> fn) { + return topHits(fn.apply(new TopHitsAggregation.Builder()).build()); } - public ContainerBuilder valueCount(ValueCountAggregation v) { - this._kind = Kind.ValueCount; - this._value = v; - return new ContainerBuilder(); + /** + * API name: {@code value_count} + */ + @Nonnull + public final Builder valueCount(@Nullable ValueCountAggregation value) { + this.valueCount = value; + return this; } - public ContainerBuilder valueCount(Function> fn) { - return this.valueCount(fn.apply(new ValueCountAggregation.Builder()).build()); + /** + * API name: {@code value_count} + */ + @Nonnull + public final Builder valueCount(Function> fn) { + return valueCount(fn.apply(new ValueCountAggregation.Builder()).build()); } - public ContainerBuilder variableWidthHistogram(VariableWidthHistogramAggregation v) { - this._kind = Kind.VariableWidthHistogram; - this._value = v; - return new ContainerBuilder(); + /** + * API name: {@code variable_width_histogram} + */ + @Nonnull + public final Builder variableWidthHistogram(@Nullable VariableWidthHistogramAggregation value) { + this.variableWidthHistogram = value; + return this; } - public ContainerBuilder variableWidthHistogram( + /** + * API name: {@code variable_width_histogram} + */ + @Nonnull + public final Builder variableWidthHistogram( Function> fn ) { - return this.variableWidthHistogram(fn.apply(new VariableWidthHistogramAggregation.Builder()).build()); + return variableWidthHistogram(fn.apply(new VariableWidthHistogramAggregation.Builder()).build()); } - public ContainerBuilder weightedAvg(WeightedAverageAggregation v) { - this._kind = Kind.WeightedAvg; - this._value = v; - return new ContainerBuilder(); + /** + * API name: {@code weighted_avg} + */ + @Nonnull + public final Builder weightedAvg(@Nullable WeightedAverageAggregation value) { + this.weightedAvg = value; + return this; } - public ContainerBuilder weightedAvg(Function> fn) { - return this.weightedAvg(fn.apply(new WeightedAverageAggregation.Builder()).build()); + /** + * API name: {@code weighted_avg} + */ + @Nonnull + public final Builder weightedAvg(Function> fn) { + return weightedAvg(fn.apply(new WeightedAverageAggregation.Builder()).build()); } - protected Aggregation build() { + /** + * Builds a {@link Aggregation}. + * + * @throws NullPointerException if some of the required fields are null. + */ + @Override + @Nonnull + public Aggregation build() { _checkSingleUse(); + return new Aggregation(this); } + } + + // --------------------------------------------------------------------------------------------- + + /** + * Json deserializer for {@link Aggregation} + */ + public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer.lazy( + Builder::new, + Aggregation::setupAggregationDeserializer + ); - public class ContainerBuilder implements ObjectBuilder { - private ContainerBuilder() {} - - /** - * API name: {@code meta} - * - *

- * Adds all elements of map to meta. - *

- */ - @Nonnull - public final ContainerBuilder meta(Map map) { - Builder.this.meta = _mapPutAll(Builder.this.meta, map); - return this; - } - - /** - * API name: {@code meta} - * - *

- * Adds an entry to meta. - *

- */ - @Nonnull - public final ContainerBuilder meta(String key, JsonData value) { - Builder.this.meta = _mapPut(Builder.this.meta, key, value); - return this; - } - - @Override - public Aggregation build() { - return Builder.this.build(); - } - } - } - - protected static void setupAggregationDeserializer(ObjectDeserializer op) { - op.add(Builder::meta, JsonpDeserializer.stringMapDeserializer(JsonData._DESERIALIZER), "meta"); - op.add(Builder::adjacencyMatrix, AdjacencyMatrixAggregation._DESERIALIZER, "adjacency_matrix"); - op.add(Builder::autoDateHistogram, AutoDateHistogramAggregation._DESERIALIZER, "auto_date_histogram"); + protected static void setupAggregationDeserializer(ObjectDeserializer op) { + setupAggregationBaseDeserializer(op); + op.add(Builder::adjacencyMatrix, AdjacencyMatrixAggregationFields._DESERIALIZER, "adjacency_matrix"); + op.add(Builder::aggregations, JsonData._DESERIALIZER, "aggregations"); + op.add(Builder::aggs, JsonData._DESERIALIZER, "aggs"); + op.add(Builder::autoDateHistogram, AutoDateHistogramAggregationFields._DESERIALIZER, "auto_date_histogram"); op.add(Builder::avg, AverageAggregation._DESERIALIZER, "avg"); op.add(Builder::avgBucket, AverageBucketAggregation._DESERIALIZER, "avg_bucket"); op.add(Builder::boxplot, BoxplotAggregation._DESERIALIZER, "boxplot"); @@ -2023,86 +2704,211 @@ protected static void setupAggregationDeserializer(ObjectDeserializer o op.add(Builder::bucketSelector, BucketSelectorAggregation._DESERIALIZER, "bucket_selector"); op.add(Builder::bucketSort, BucketSortAggregation._DESERIALIZER, "bucket_sort"); op.add(Builder::cardinality, CardinalityAggregation._DESERIALIZER, "cardinality"); - op.add(Builder::children, ChildrenAggregation._DESERIALIZER, "children"); - op.add(Builder::composite, CompositeAggregation._DESERIALIZER, "composite"); + op.add(Builder::children, ChildrenAggregationFields._DESERIALIZER, "children"); + op.add(Builder::composite, CompositeAggregationFields._DESERIALIZER, "composite"); op.add(Builder::cumulativeCardinality, CumulativeCardinalityAggregation._DESERIALIZER, "cumulative_cardinality"); op.add(Builder::cumulativeSum, CumulativeSumAggregation._DESERIALIZER, "cumulative_sum"); - op.add(Builder::dateHistogram, DateHistogramAggregation._DESERIALIZER, "date_histogram"); - op.add(Builder::dateRange, DateRangeAggregation._DESERIALIZER, "date_range"); + op.add(Builder::dateHistogram, DateHistogramAggregationFields._DESERIALIZER, "date_histogram"); + op.add(Builder::dateRange, DateRangeAggregationFields._DESERIALIZER, "date_range"); op.add(Builder::derivative, DerivativeAggregation._DESERIALIZER, "derivative"); - op.add(Builder::diversifiedSampler, DiversifiedSamplerAggregation._DESERIALIZER, "diversified_sampler"); + op.add(Builder::diversifiedSampler, DiversifiedSamplerAggregationFields._DESERIALIZER, "diversified_sampler"); op.add(Builder::extendedStats, ExtendedStatsAggregation._DESERIALIZER, "extended_stats"); op.add(Builder::extendedStatsBucket, ExtendedStatsBucketAggregation._DESERIALIZER, "extended_stats_bucket"); - op.add(Builder::filter, Query._DESERIALIZER, "filter"); - op.add(Builder::filters, FiltersAggregation._DESERIALIZER, "filters"); + op.add(Builder::filter, FilterAggregationFields._DESERIALIZER, "filter"); + op.add(Builder::filters, FiltersAggregationFields._DESERIALIZER, "filters"); op.add(Builder::geoBounds, GeoBoundsAggregation._DESERIALIZER, "geo_bounds"); op.add(Builder::geoCentroid, GeoCentroidAggregation._DESERIALIZER, "geo_centroid"); - op.add(Builder::geoDistance, GeoDistanceAggregation._DESERIALIZER, "geo_distance"); - op.add(Builder::geohashGrid, GeoHashGridAggregation._DESERIALIZER, "geohash_grid"); - op.add(Builder::geotileGrid, GeoTileGridAggregation._DESERIALIZER, "geotile_grid"); - op.add(Builder::global, GlobalAggregation._DESERIALIZER, "global"); - op.add(Builder::histogram, HistogramAggregation._DESERIALIZER, "histogram"); - op.add(Builder::ipRange, IpRangeAggregation._DESERIALIZER, "ip_range"); + op.add(Builder::geoDistance, GeoDistanceAggregationFields._DESERIALIZER, "geo_distance"); + op.add(Builder::geohashGrid, GeoHashGridAggregationFields._DESERIALIZER, "geohash_grid"); + op.add(Builder::geotileGrid, GeoTileGridAggregationFields._DESERIALIZER, "geotile_grid"); + op.add(Builder::global, GlobalAggregationFields._DESERIALIZER, "global"); + op.add(Builder::histogram, HistogramAggregationFields._DESERIALIZER, "histogram"); + op.add(Builder::ipRange, IpRangeAggregationFields._DESERIALIZER, "ip_range"); op.add(Builder::matrixStats, MatrixStatsAggregation._DESERIALIZER, "matrix_stats"); op.add(Builder::max, MaxAggregation._DESERIALIZER, "max"); op.add(Builder::maxBucket, MaxBucketAggregation._DESERIALIZER, "max_bucket"); op.add(Builder::medianAbsoluteDeviation, MedianAbsoluteDeviationAggregation._DESERIALIZER, "median_absolute_deviation"); op.add(Builder::min, MinAggregation._DESERIALIZER, "min"); op.add(Builder::minBucket, MinBucketAggregation._DESERIALIZER, "min_bucket"); - op.add(Builder::missing, MissingAggregation._DESERIALIZER, "missing"); + op.add(Builder::missing, MissingAggregationFields._DESERIALIZER, "missing"); op.add(Builder::movingAvg, MovingAverageAggregation._DESERIALIZER, "moving_avg"); op.add(Builder::movingFn, MovingFunctionAggregation._DESERIALIZER, "moving_fn"); op.add(Builder::movingPercentiles, MovingPercentilesAggregation._DESERIALIZER, "moving_percentiles"); - op.add(Builder::multiTerms, MultiTermsAggregation._DESERIALIZER, "multi_terms"); - op.add(Builder::nested, NestedAggregation._DESERIALIZER, "nested"); + op.add(Builder::multiTerms, MultiTermsAggregationFields._DESERIALIZER, "multi_terms"); + op.add(Builder::nested, NestedAggregationFields._DESERIALIZER, "nested"); op.add(Builder::normalize, NormalizeAggregation._DESERIALIZER, "normalize"); - op.add(Builder::parent, ParentAggregation._DESERIALIZER, "parent"); + op.add(Builder::parent, ParentAggregationFields._DESERIALIZER, "parent"); op.add(Builder::percentileRanks, PercentileRanksAggregation._DESERIALIZER, "percentile_ranks"); op.add(Builder::percentiles, PercentilesAggregation._DESERIALIZER, "percentiles"); op.add(Builder::percentilesBucket, PercentilesBucketAggregation._DESERIALIZER, "percentiles_bucket"); - op.add(Builder::range, RangeAggregation._DESERIALIZER, "range"); - op.add(Builder::rareTerms, RareTermsAggregation._DESERIALIZER, "rare_terms"); + op.add(Builder::range, RangeAggregationFields._DESERIALIZER, "range"); + op.add(Builder::rareTerms, RareTermsAggregationFields._DESERIALIZER, "rare_terms"); op.add(Builder::rate, RateAggregation._DESERIALIZER, "rate"); - op.add(Builder::reverseNested, ReverseNestedAggregation._DESERIALIZER, "reverse_nested"); - op.add(Builder::sampler, SamplerAggregation._DESERIALIZER, "sampler"); + op.add(Builder::reverseNested, ReverseNestedAggregationFields._DESERIALIZER, "reverse_nested"); + op.add(Builder::sampler, SamplerAggregationFields._DESERIALIZER, "sampler"); op.add(Builder::scriptedMetric, ScriptedMetricAggregation._DESERIALIZER, "scripted_metric"); op.add(Builder::serialDiff, SerialDifferencingAggregation._DESERIALIZER, "serial_diff"); - op.add(Builder::significantTerms, SignificantTermsAggregation._DESERIALIZER, "significant_terms"); - op.add(Builder::significantText, SignificantTextAggregation._DESERIALIZER, "significant_text"); + op.add(Builder::significantTerms, SignificantTermsAggregationFields._DESERIALIZER, "significant_terms"); + op.add(Builder::significantText, SignificantTextAggregationFields._DESERIALIZER, "significant_text"); op.add(Builder::stats, StatsAggregation._DESERIALIZER, "stats"); op.add(Builder::statsBucket, StatsBucketAggregation._DESERIALIZER, "stats_bucket"); op.add(Builder::sum, SumAggregation._DESERIALIZER, "sum"); op.add(Builder::sumBucket, SumBucketAggregation._DESERIALIZER, "sum_bucket"); op.add(Builder::tTest, TTestAggregation._DESERIALIZER, "t_test"); - op.add(Builder::terms, TermsAggregation._DESERIALIZER, "terms"); + op.add(Builder::terms, TermsAggregationFields._DESERIALIZER, "terms"); op.add(Builder::topHits, TopHitsAggregation._DESERIALIZER, "top_hits"); op.add(Builder::valueCount, ValueCountAggregation._DESERIALIZER, "value_count"); op.add(Builder::variableWidthHistogram, VariableWidthHistogramAggregation._DESERIALIZER, "variable_width_histogram"); op.add(Builder::weightedAvg, WeightedAverageAggregation._DESERIALIZER, "weighted_avg"); } - public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer.lazy( - Builder::new, - Aggregation::setupAggregationDeserializer, - Builder::build - ); - @Override public int hashCode() { - int result = 17; - result = 31 * result + Objects.hashCode(this._kind); - result = 31 * result + Objects.hashCode(this._value); - result = 31 * result + Objects.hashCode(this.meta); + int result = super.hashCode(); + result = 31 * result + Objects.hashCode(this.adjacencyMatrix); + result = 31 * result + Objects.hashCode(this.aggregations); + result = 31 * result + Objects.hashCode(this.aggs); + result = 31 * result + Objects.hashCode(this.autoDateHistogram); + result = 31 * result + Objects.hashCode(this.avg); + result = 31 * result + Objects.hashCode(this.avgBucket); + result = 31 * result + Objects.hashCode(this.boxplot); + result = 31 * result + Objects.hashCode(this.bucketScript); + result = 31 * result + Objects.hashCode(this.bucketSelector); + result = 31 * result + Objects.hashCode(this.bucketSort); + result = 31 * result + Objects.hashCode(this.cardinality); + result = 31 * result + Objects.hashCode(this.children); + result = 31 * result + Objects.hashCode(this.composite); + result = 31 * result + Objects.hashCode(this.cumulativeCardinality); + result = 31 * result + Objects.hashCode(this.cumulativeSum); + result = 31 * result + Objects.hashCode(this.dateHistogram); + result = 31 * result + Objects.hashCode(this.dateRange); + result = 31 * result + Objects.hashCode(this.derivative); + result = 31 * result + Objects.hashCode(this.diversifiedSampler); + result = 31 * result + Objects.hashCode(this.extendedStats); + result = 31 * result + Objects.hashCode(this.extendedStatsBucket); + result = 31 * result + Objects.hashCode(this.filter); + result = 31 * result + Objects.hashCode(this.filters); + result = 31 * result + Objects.hashCode(this.geoBounds); + result = 31 * result + Objects.hashCode(this.geoCentroid); + result = 31 * result + Objects.hashCode(this.geoDistance); + result = 31 * result + Objects.hashCode(this.geohashGrid); + result = 31 * result + Objects.hashCode(this.geotileGrid); + result = 31 * result + Objects.hashCode(this.global); + result = 31 * result + Objects.hashCode(this.histogram); + result = 31 * result + Objects.hashCode(this.ipRange); + result = 31 * result + Objects.hashCode(this.matrixStats); + result = 31 * result + Objects.hashCode(this.max); + result = 31 * result + Objects.hashCode(this.maxBucket); + result = 31 * result + Objects.hashCode(this.medianAbsoluteDeviation); + result = 31 * result + Objects.hashCode(this.min); + result = 31 * result + Objects.hashCode(this.minBucket); + result = 31 * result + Objects.hashCode(this.missing); + result = 31 * result + Objects.hashCode(this.movingAvg); + result = 31 * result + Objects.hashCode(this.movingFn); + result = 31 * result + Objects.hashCode(this.movingPercentiles); + result = 31 * result + Objects.hashCode(this.multiTerms); + result = 31 * result + Objects.hashCode(this.nested); + result = 31 * result + Objects.hashCode(this.normalize); + result = 31 * result + Objects.hashCode(this.parent); + result = 31 * result + Objects.hashCode(this.percentileRanks); + result = 31 * result + Objects.hashCode(this.percentiles); + result = 31 * result + Objects.hashCode(this.percentilesBucket); + result = 31 * result + Objects.hashCode(this.range); + result = 31 * result + Objects.hashCode(this.rareTerms); + result = 31 * result + Objects.hashCode(this.rate); + result = 31 * result + Objects.hashCode(this.reverseNested); + result = 31 * result + Objects.hashCode(this.sampler); + result = 31 * result + Objects.hashCode(this.scriptedMetric); + result = 31 * result + Objects.hashCode(this.serialDiff); + result = 31 * result + Objects.hashCode(this.significantTerms); + result = 31 * result + Objects.hashCode(this.significantText); + result = 31 * result + Objects.hashCode(this.stats); + result = 31 * result + Objects.hashCode(this.statsBucket); + result = 31 * result + Objects.hashCode(this.sum); + result = 31 * result + Objects.hashCode(this.sumBucket); + result = 31 * result + Objects.hashCode(this.tTest); + result = 31 * result + Objects.hashCode(this.terms); + result = 31 * result + Objects.hashCode(this.topHits); + result = 31 * result + Objects.hashCode(this.valueCount); + result = 31 * result + Objects.hashCode(this.variableWidthHistogram); + result = 31 * result + Objects.hashCode(this.weightedAvg); return result; } @Override public boolean equals(Object o) { + if (!super.equals(o)) { + return false; + } if (this == o) return true; if (o == null || this.getClass() != o.getClass()) return false; Aggregation other = (Aggregation) o; - return Objects.equals(this._kind, other._kind) - && Objects.equals(this._value, other._value) - && Objects.equals(this.meta, other.meta); + return Objects.equals(this.adjacencyMatrix, other.adjacencyMatrix) + && Objects.equals(this.aggregations, other.aggregations) + && Objects.equals(this.aggs, other.aggs) + && Objects.equals(this.autoDateHistogram, other.autoDateHistogram) + && Objects.equals(this.avg, other.avg) + && Objects.equals(this.avgBucket, other.avgBucket) + && Objects.equals(this.boxplot, other.boxplot) + && Objects.equals(this.bucketScript, other.bucketScript) + && Objects.equals(this.bucketSelector, other.bucketSelector) + && Objects.equals(this.bucketSort, other.bucketSort) + && Objects.equals(this.cardinality, other.cardinality) + && Objects.equals(this.children, other.children) + && Objects.equals(this.composite, other.composite) + && Objects.equals(this.cumulativeCardinality, other.cumulativeCardinality) + && Objects.equals(this.cumulativeSum, other.cumulativeSum) + && Objects.equals(this.dateHistogram, other.dateHistogram) + && Objects.equals(this.dateRange, other.dateRange) + && Objects.equals(this.derivative, other.derivative) + && Objects.equals(this.diversifiedSampler, other.diversifiedSampler) + && Objects.equals(this.extendedStats, other.extendedStats) + && Objects.equals(this.extendedStatsBucket, other.extendedStatsBucket) + && Objects.equals(this.filter, other.filter) + && Objects.equals(this.filters, other.filters) + && Objects.equals(this.geoBounds, other.geoBounds) + && Objects.equals(this.geoCentroid, other.geoCentroid) + && Objects.equals(this.geoDistance, other.geoDistance) + && Objects.equals(this.geohashGrid, other.geohashGrid) + && Objects.equals(this.geotileGrid, other.geotileGrid) + && Objects.equals(this.global, other.global) + && Objects.equals(this.histogram, other.histogram) + && Objects.equals(this.ipRange, other.ipRange) + && Objects.equals(this.matrixStats, other.matrixStats) + && Objects.equals(this.max, other.max) + && Objects.equals(this.maxBucket, other.maxBucket) + && Objects.equals(this.medianAbsoluteDeviation, other.medianAbsoluteDeviation) + && Objects.equals(this.min, other.min) + && Objects.equals(this.minBucket, other.minBucket) + && Objects.equals(this.missing, other.missing) + && Objects.equals(this.movingAvg, other.movingAvg) + && Objects.equals(this.movingFn, other.movingFn) + && Objects.equals(this.movingPercentiles, other.movingPercentiles) + && Objects.equals(this.multiTerms, other.multiTerms) + && Objects.equals(this.nested, other.nested) + && Objects.equals(this.normalize, other.normalize) + && Objects.equals(this.parent, other.parent) + && Objects.equals(this.percentileRanks, other.percentileRanks) + && Objects.equals(this.percentiles, other.percentiles) + && Objects.equals(this.percentilesBucket, other.percentilesBucket) + && Objects.equals(this.range, other.range) + && Objects.equals(this.rareTerms, other.rareTerms) + && Objects.equals(this.rate, other.rate) + && Objects.equals(this.reverseNested, other.reverseNested) + && Objects.equals(this.sampler, other.sampler) + && Objects.equals(this.scriptedMetric, other.scriptedMetric) + && Objects.equals(this.serialDiff, other.serialDiff) + && Objects.equals(this.significantTerms, other.significantTerms) + && Objects.equals(this.significantText, other.significantText) + && Objects.equals(this.stats, other.stats) + && Objects.equals(this.statsBucket, other.statsBucket) + && Objects.equals(this.sum, other.sum) + && Objects.equals(this.sumBucket, other.sumBucket) + && Objects.equals(this.tTest, other.tTest) + && Objects.equals(this.terms, other.terms) + && Objects.equals(this.topHits, other.topHits) + && Objects.equals(this.valueCount, other.valueCount) + && Objects.equals(this.variableWidthHistogram, other.variableWidthHistogram) + && Objects.equals(this.weightedAvg, other.weightedAvg); } } diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/aggregations/AggregationBase.java b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/aggregations/AggregationBase.java index 78bc58934e..2ca96a6f66 100644 --- a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/aggregations/AggregationBase.java +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/aggregations/AggregationBase.java @@ -58,32 +58,23 @@ public abstract class AggregationBase implements PlainJsonSerializable { @Nonnull private final Map meta; - @Nullable - private final String name; - // --------------------------------------------------------------------------------------------- protected AggregationBase(AbstractBuilder builder) { this.meta = ApiTypeHelper.unmodifiable(builder.meta); - this.name = builder.name; } /** + * Custom metadata to associate with the aggregation (optional) + *

* API name: {@code meta} + *

*/ @Nonnull public final Map meta() { return this.meta; } - /** - * API name: {@code name} - */ - @Nullable - public final String name() { - return this.name; - } - /** * Serialize this object to JSON. */ @@ -104,11 +95,6 @@ protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { } generator.writeEnd(); } - - if (this.name != null) { - generator.writeKey("name"); - generator.write(this.name); - } } // --------------------------------------------------------------------------------------------- @@ -116,26 +102,25 @@ protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { public abstract static class AbstractBuilder> extends ObjectBuilderBase { @Nullable private Map meta; - @Nullable - private String name; protected AbstractBuilder() {} protected AbstractBuilder(AggregationBase o) { this.meta = _mapCopy(o.meta); - this.name = o.name; } protected AbstractBuilder(AbstractBuilder o) { this.meta = _mapCopy(o.meta); - this.name = o.name; } @Nonnull protected abstract BuilderT self(); /** + * Custom metadata to associate with the aggregation (optional) + *

* API name: {@code meta} + *

* *

* Adds all elements of map to meta. @@ -148,7 +133,10 @@ public final BuilderT meta(Map map) { } /** + * Custom metadata to associate with the aggregation (optional) + *

* API name: {@code meta} + *

* *

* Adds an entry to meta. @@ -159,29 +147,18 @@ public final BuilderT meta(String key, JsonData value) { this.meta = _mapPut(this.meta, key, value); return self(); } - - /** - * API name: {@code name} - */ - @Nonnull - public final BuilderT name(@Nullable String value) { - this.name = value; - return self(); - } } // --------------------------------------------------------------------------------------------- protected static > void setupAggregationBaseDeserializer(ObjectDeserializer op) { op.add(AbstractBuilder::meta, JsonpDeserializer.stringMapDeserializer(JsonData._DESERIALIZER), "meta"); - op.add(AbstractBuilder::name, JsonpDeserializer.stringDeserializer(), "name"); } @Override public int hashCode() { int result = 17; result = 31 * result + Objects.hashCode(this.meta); - result = 31 * result + Objects.hashCode(this.name); return result; } @@ -190,6 +167,6 @@ public boolean equals(Object o) { if (this == o) return true; if (o == null || this.getClass() != o.getClass()) return false; AggregationBase other = (AggregationBase) o; - return Objects.equals(this.meta, other.meta) && Objects.equals(this.name, other.name); + return Objects.equals(this.meta, other.meta); } } diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/aggregations/AggregationBuilders.java b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/aggregations/AggregationBuilders.java deleted file mode 100644 index 275822dfcc..0000000000 --- a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/aggregations/AggregationBuilders.java +++ /dev/null @@ -1,503 +0,0 @@ -/* - * SPDX-License-Identifier: Apache-2.0 - * - * The OpenSearch Contributors require contributions made to - * this file be licensed under the Apache-2.0 license or a - * compatible open source license. - */ - -/* - * 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. - */ - -/* - * Modifications Copyright OpenSearch Contributors. See - * GitHub history for details. - */ - -//---------------------------------------------------- -// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. -//---------------------------------------------------- - -package org.opensearch.client.opensearch._types.aggregations; - -import javax.annotation.Generated; -import org.opensearch.client.opensearch._types.query_dsl.Query; - -/** - * Builders for {@link Aggregation} variants. - */ -@Generated("org.opensearch.client.codegen.CodeGenerator") -public class AggregationBuilders { - private AggregationBuilders() {} - - /** - * Creates a builder for the {@link AdjacencyMatrixAggregation adjacency_matrix} {@code Aggregation} variant. - */ - public static AdjacencyMatrixAggregation.Builder adjacencyMatrix() { - return new AdjacencyMatrixAggregation.Builder(); - } - - /** - * Creates a builder for the {@link AutoDateHistogramAggregation auto_date_histogram} {@code Aggregation} variant. - */ - public static AutoDateHistogramAggregation.Builder autoDateHistogram() { - return new AutoDateHistogramAggregation.Builder(); - } - - /** - * Creates a builder for the {@link AverageAggregation avg} {@code Aggregation} variant. - */ - public static AverageAggregation.Builder avg() { - return new AverageAggregation.Builder(); - } - - /** - * Creates a builder for the {@link AverageBucketAggregation avg_bucket} {@code Aggregation} variant. - */ - public static AverageBucketAggregation.Builder avgBucket() { - return new AverageBucketAggregation.Builder(); - } - - /** - * Creates a builder for the {@link BoxplotAggregation boxplot} {@code Aggregation} variant. - */ - public static BoxplotAggregation.Builder boxplot() { - return new BoxplotAggregation.Builder(); - } - - /** - * Creates a builder for the {@link BucketScriptAggregation bucket_script} {@code Aggregation} variant. - */ - public static BucketScriptAggregation.Builder bucketScript() { - return new BucketScriptAggregation.Builder(); - } - - /** - * Creates a builder for the {@link BucketSelectorAggregation bucket_selector} {@code Aggregation} variant. - */ - public static BucketSelectorAggregation.Builder bucketSelector() { - return new BucketSelectorAggregation.Builder(); - } - - /** - * Creates a builder for the {@link BucketSortAggregation bucket_sort} {@code Aggregation} variant. - */ - public static BucketSortAggregation.Builder bucketSort() { - return new BucketSortAggregation.Builder(); - } - - /** - * Creates a builder for the {@link CardinalityAggregation cardinality} {@code Aggregation} variant. - */ - public static CardinalityAggregation.Builder cardinality() { - return new CardinalityAggregation.Builder(); - } - - /** - * Creates a builder for the {@link ChildrenAggregation children} {@code Aggregation} variant. - */ - public static ChildrenAggregation.Builder children() { - return new ChildrenAggregation.Builder(); - } - - /** - * Creates a builder for the {@link CompositeAggregation composite} {@code Aggregation} variant. - */ - public static CompositeAggregation.Builder composite() { - return new CompositeAggregation.Builder(); - } - - /** - * Creates a builder for the {@link CumulativeCardinalityAggregation cumulative_cardinality} {@code Aggregation} variant. - */ - public static CumulativeCardinalityAggregation.Builder cumulativeCardinality() { - return new CumulativeCardinalityAggregation.Builder(); - } - - /** - * Creates a builder for the {@link CumulativeSumAggregation cumulative_sum} {@code Aggregation} variant. - */ - public static CumulativeSumAggregation.Builder cumulativeSum() { - return new CumulativeSumAggregation.Builder(); - } - - /** - * Creates a builder for the {@link DateHistogramAggregation date_histogram} {@code Aggregation} variant. - */ - public static DateHistogramAggregation.Builder dateHistogram() { - return new DateHistogramAggregation.Builder(); - } - - /** - * Creates a builder for the {@link DateRangeAggregation date_range} {@code Aggregation} variant. - */ - public static DateRangeAggregation.Builder dateRange() { - return new DateRangeAggregation.Builder(); - } - - /** - * Creates a builder for the {@link DerivativeAggregation derivative} {@code Aggregation} variant. - */ - public static DerivativeAggregation.Builder derivative() { - return new DerivativeAggregation.Builder(); - } - - /** - * Creates a builder for the {@link DiversifiedSamplerAggregation diversified_sampler} {@code Aggregation} variant. - */ - public static DiversifiedSamplerAggregation.Builder diversifiedSampler() { - return new DiversifiedSamplerAggregation.Builder(); - } - - /** - * Creates a builder for the {@link ExtendedStatsAggregation extended_stats} {@code Aggregation} variant. - */ - public static ExtendedStatsAggregation.Builder extendedStats() { - return new ExtendedStatsAggregation.Builder(); - } - - /** - * Creates a builder for the {@link ExtendedStatsBucketAggregation extended_stats_bucket} {@code Aggregation} variant. - */ - public static ExtendedStatsBucketAggregation.Builder extendedStatsBucket() { - return new ExtendedStatsBucketAggregation.Builder(); - } - - /** - * Creates a builder for the {@link Query filter} {@code Aggregation} variant. - */ - public static Query.Builder filter() { - return new Query.Builder(); - } - - /** - * Creates a builder for the {@link FiltersAggregation filters} {@code Aggregation} variant. - */ - public static FiltersAggregation.Builder filters() { - return new FiltersAggregation.Builder(); - } - - /** - * Creates a builder for the {@link GeoBoundsAggregation geo_bounds} {@code Aggregation} variant. - */ - public static GeoBoundsAggregation.Builder geoBounds() { - return new GeoBoundsAggregation.Builder(); - } - - /** - * Creates a builder for the {@link GeoCentroidAggregation geo_centroid} {@code Aggregation} variant. - */ - public static GeoCentroidAggregation.Builder geoCentroid() { - return new GeoCentroidAggregation.Builder(); - } - - /** - * Creates a builder for the {@link GeoDistanceAggregation geo_distance} {@code Aggregation} variant. - */ - public static GeoDistanceAggregation.Builder geoDistance() { - return new GeoDistanceAggregation.Builder(); - } - - /** - * Creates a builder for the {@link GeoHashGridAggregation geohash_grid} {@code Aggregation} variant. - */ - public static GeoHashGridAggregation.Builder geohashGrid() { - return new GeoHashGridAggregation.Builder(); - } - - /** - * Creates a builder for the {@link GeoTileGridAggregation geotile_grid} {@code Aggregation} variant. - */ - public static GeoTileGridAggregation.Builder geotileGrid() { - return new GeoTileGridAggregation.Builder(); - } - - /** - * Creates a builder for the {@link GlobalAggregation global} {@code Aggregation} variant. - */ - public static GlobalAggregation.Builder global() { - return new GlobalAggregation.Builder(); - } - - /** - * Creates a builder for the {@link HistogramAggregation histogram} {@code Aggregation} variant. - */ - public static HistogramAggregation.Builder histogram() { - return new HistogramAggregation.Builder(); - } - - /** - * Creates a builder for the {@link IpRangeAggregation ip_range} {@code Aggregation} variant. - */ - public static IpRangeAggregation.Builder ipRange() { - return new IpRangeAggregation.Builder(); - } - - /** - * Creates a builder for the {@link MatrixStatsAggregation matrix_stats} {@code Aggregation} variant. - */ - public static MatrixStatsAggregation.Builder matrixStats() { - return new MatrixStatsAggregation.Builder(); - } - - /** - * Creates a builder for the {@link MaxAggregation max} {@code Aggregation} variant. - */ - public static MaxAggregation.Builder max() { - return new MaxAggregation.Builder(); - } - - /** - * Creates a builder for the {@link MaxBucketAggregation max_bucket} {@code Aggregation} variant. - */ - public static MaxBucketAggregation.Builder maxBucket() { - return new MaxBucketAggregation.Builder(); - } - - /** - * Creates a builder for the {@link MedianAbsoluteDeviationAggregation median_absolute_deviation} {@code Aggregation} variant. - */ - public static MedianAbsoluteDeviationAggregation.Builder medianAbsoluteDeviation() { - return new MedianAbsoluteDeviationAggregation.Builder(); - } - - /** - * Creates a builder for the {@link MinAggregation min} {@code Aggregation} variant. - */ - public static MinAggregation.Builder min() { - return new MinAggregation.Builder(); - } - - /** - * Creates a builder for the {@link MinBucketAggregation min_bucket} {@code Aggregation} variant. - */ - public static MinBucketAggregation.Builder minBucket() { - return new MinBucketAggregation.Builder(); - } - - /** - * Creates a builder for the {@link MissingAggregation missing} {@code Aggregation} variant. - */ - public static MissingAggregation.Builder missing() { - return new MissingAggregation.Builder(); - } - - /** - * Creates a builder for the {@link MovingAverageAggregation moving_avg} {@code Aggregation} variant. - */ - public static MovingAverageAggregation.Builder movingAvg() { - return new MovingAverageAggregation.Builder(); - } - - /** - * Creates a builder for the {@link MovingFunctionAggregation moving_fn} {@code Aggregation} variant. - */ - public static MovingFunctionAggregation.Builder movingFn() { - return new MovingFunctionAggregation.Builder(); - } - - /** - * Creates a builder for the {@link MovingPercentilesAggregation moving_percentiles} {@code Aggregation} variant. - */ - public static MovingPercentilesAggregation.Builder movingPercentiles() { - return new MovingPercentilesAggregation.Builder(); - } - - /** - * Creates a builder for the {@link MultiTermsAggregation multi_terms} {@code Aggregation} variant. - */ - public static MultiTermsAggregation.Builder multiTerms() { - return new MultiTermsAggregation.Builder(); - } - - /** - * Creates a builder for the {@link NestedAggregation nested} {@code Aggregation} variant. - */ - public static NestedAggregation.Builder nested() { - return new NestedAggregation.Builder(); - } - - /** - * Creates a builder for the {@link NormalizeAggregation normalize} {@code Aggregation} variant. - */ - public static NormalizeAggregation.Builder normalize() { - return new NormalizeAggregation.Builder(); - } - - /** - * Creates a builder for the {@link ParentAggregation parent} {@code Aggregation} variant. - */ - public static ParentAggregation.Builder parent() { - return new ParentAggregation.Builder(); - } - - /** - * Creates a builder for the {@link PercentileRanksAggregation percentile_ranks} {@code Aggregation} variant. - */ - public static PercentileRanksAggregation.Builder percentileRanks() { - return new PercentileRanksAggregation.Builder(); - } - - /** - * Creates a builder for the {@link PercentilesAggregation percentiles} {@code Aggregation} variant. - */ - public static PercentilesAggregation.Builder percentiles() { - return new PercentilesAggregation.Builder(); - } - - /** - * Creates a builder for the {@link PercentilesBucketAggregation percentiles_bucket} {@code Aggregation} variant. - */ - public static PercentilesBucketAggregation.Builder percentilesBucket() { - return new PercentilesBucketAggregation.Builder(); - } - - /** - * Creates a builder for the {@link RangeAggregation range} {@code Aggregation} variant. - */ - public static RangeAggregation.Builder range() { - return new RangeAggregation.Builder(); - } - - /** - * Creates a builder for the {@link RareTermsAggregation rare_terms} {@code Aggregation} variant. - */ - public static RareTermsAggregation.Builder rareTerms() { - return new RareTermsAggregation.Builder(); - } - - /** - * Creates a builder for the {@link RateAggregation rate} {@code Aggregation} variant. - */ - public static RateAggregation.Builder rate() { - return new RateAggregation.Builder(); - } - - /** - * Creates a builder for the {@link ReverseNestedAggregation reverse_nested} {@code Aggregation} variant. - */ - public static ReverseNestedAggregation.Builder reverseNested() { - return new ReverseNestedAggregation.Builder(); - } - - /** - * Creates a builder for the {@link SamplerAggregation sampler} {@code Aggregation} variant. - */ - public static SamplerAggregation.Builder sampler() { - return new SamplerAggregation.Builder(); - } - - /** - * Creates a builder for the {@link ScriptedMetricAggregation scripted_metric} {@code Aggregation} variant. - */ - public static ScriptedMetricAggregation.Builder scriptedMetric() { - return new ScriptedMetricAggregation.Builder(); - } - - /** - * Creates a builder for the {@link SerialDifferencingAggregation serial_diff} {@code Aggregation} variant. - */ - public static SerialDifferencingAggregation.Builder serialDiff() { - return new SerialDifferencingAggregation.Builder(); - } - - /** - * Creates a builder for the {@link SignificantTermsAggregation significant_terms} {@code Aggregation} variant. - */ - public static SignificantTermsAggregation.Builder significantTerms() { - return new SignificantTermsAggregation.Builder(); - } - - /** - * Creates a builder for the {@link SignificantTextAggregation significant_text} {@code Aggregation} variant. - */ - public static SignificantTextAggregation.Builder significantText() { - return new SignificantTextAggregation.Builder(); - } - - /** - * Creates a builder for the {@link StatsAggregation stats} {@code Aggregation} variant. - */ - public static StatsAggregation.Builder stats() { - return new StatsAggregation.Builder(); - } - - /** - * Creates a builder for the {@link StatsBucketAggregation stats_bucket} {@code Aggregation} variant. - */ - public static StatsBucketAggregation.Builder statsBucket() { - return new StatsBucketAggregation.Builder(); - } - - /** - * Creates a builder for the {@link SumAggregation sum} {@code Aggregation} variant. - */ - public static SumAggregation.Builder sum() { - return new SumAggregation.Builder(); - } - - /** - * Creates a builder for the {@link SumBucketAggregation sum_bucket} {@code Aggregation} variant. - */ - public static SumBucketAggregation.Builder sumBucket() { - return new SumBucketAggregation.Builder(); - } - - /** - * Creates a builder for the {@link TTestAggregation t_test} {@code Aggregation} variant. - */ - public static TTestAggregation.Builder tTest() { - return new TTestAggregation.Builder(); - } - - /** - * Creates a builder for the {@link TermsAggregation terms} {@code Aggregation} variant. - */ - public static TermsAggregation.Builder terms() { - return new TermsAggregation.Builder(); - } - - /** - * Creates a builder for the {@link TopHitsAggregation top_hits} {@code Aggregation} variant. - */ - public static TopHitsAggregation.Builder topHits() { - return new TopHitsAggregation.Builder(); - } - - /** - * Creates a builder for the {@link ValueCountAggregation value_count} {@code Aggregation} variant. - */ - public static ValueCountAggregation.Builder valueCount() { - return new ValueCountAggregation.Builder(); - } - - /** - * Creates a builder for the {@link VariableWidthHistogramAggregation variable_width_histogram} {@code Aggregation} variant. - */ - public static VariableWidthHistogramAggregation.Builder variableWidthHistogram() { - return new VariableWidthHistogramAggregation.Builder(); - } - - /** - * Creates a builder for the {@link WeightedAverageAggregation weighted_avg} {@code Aggregation} variant. - */ - public static WeightedAverageAggregation.Builder weightedAvg() { - return new WeightedAverageAggregation.Builder(); - } -} diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/aggregations/AggregationVariant.java b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/aggregations/AggregationVariant.java deleted file mode 100644 index 7d867a279d..0000000000 --- a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/aggregations/AggregationVariant.java +++ /dev/null @@ -1,51 +0,0 @@ -/* - * SPDX-License-Identifier: Apache-2.0 - * - * The OpenSearch Contributors require contributions made to - * this file be licensed under the Apache-2.0 license or a - * compatible open source license. - */ - -/* - * 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. - */ - -/* - * Modifications Copyright OpenSearch Contributors. See - * GitHub history for details. - */ - -//---------------------------------------------------- -// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. -//---------------------------------------------------- - -package org.opensearch.client.opensearch._types.aggregations; - -import javax.annotation.Generated; - -/** - * Base interface for {@link Aggregation} variants. - */ -@Generated("org.opensearch.client.codegen.CodeGenerator") -public interface AggregationVariant { - Aggregation.Kind _aggregationKind(); - - default Aggregation toAggregation() { - return new Aggregation(this); - } -} diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/aggregations/AutoDateHistogramAggregate.java b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/aggregations/AutoDateHistogramAggregate.java index 3700564d17..f4a69716c1 100644 --- a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/aggregations/AutoDateHistogramAggregate.java +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/aggregations/AutoDateHistogramAggregate.java @@ -57,7 +57,6 @@ @Generated("org.opensearch.client.codegen.CodeGenerator") public class AutoDateHistogramAggregate extends MultiBucketAggregateBase implements - AggregateVariant, ToCopyableBuilder { @Nonnull @@ -76,14 +75,6 @@ public static AutoDateHistogramAggregate of( return fn.apply(new Builder()).build(); } - /** - * {@link Aggregate} variant kind. - */ - @Override - public Aggregate.Kind _aggregateKind() { - return Aggregate.Kind.AutoDateHistogram; - } - /** * Required - API name: {@code interval} */ diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/aggregations/AutoDateHistogramAggregation.java b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/aggregations/AutoDateHistogramAggregationFields.java similarity index 88% rename from java-client/src/generated/java/org/opensearch/client/opensearch/_types/aggregations/AutoDateHistogramAggregation.java rename to java-client/src/generated/java/org/opensearch/client/opensearch/_types/aggregations/AutoDateHistogramAggregationFields.java index b9a3c49f36..6a03a215d8 100644 --- a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/aggregations/AutoDateHistogramAggregation.java +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/aggregations/AutoDateHistogramAggregationFields.java @@ -49,20 +49,22 @@ import org.opensearch.client.json.JsonpMapper; import org.opensearch.client.json.ObjectBuilderDeserializer; import org.opensearch.client.json.ObjectDeserializer; +import org.opensearch.client.json.PlainJsonSerializable; import org.opensearch.client.opensearch._types.Script; import org.opensearch.client.util.ApiTypeHelper; import org.opensearch.client.util.CopyableBuilder; import org.opensearch.client.util.ObjectBuilder; +import org.opensearch.client.util.ObjectBuilderBase; import org.opensearch.client.util.ToCopyableBuilder; -// typedef: _types.aggregations.AutoDateHistogramAggregation +// typedef: _types.aggregations.AutoDateHistogramAggregationFields @JsonpDeserializable @Generated("org.opensearch.client.codegen.CodeGenerator") -public class AutoDateHistogramAggregation extends BucketAggregationBase +public class AutoDateHistogramAggregationFields implements - AggregationVariant, - ToCopyableBuilder { + PlainJsonSerializable, + ToCopyableBuilder { @Nullable private final Integer buckets; @@ -93,8 +95,7 @@ public class AutoDateHistogramAggregation extends BucketAggregationBase // --------------------------------------------------------------------------------------------- - private AutoDateHistogramAggregation(Builder builder) { - super(builder); + private AutoDateHistogramAggregationFields(Builder builder) { this.buckets = builder.buckets; this.field = builder.field; this.format = builder.format; @@ -106,20 +107,12 @@ private AutoDateHistogramAggregation(Builder builder) { this.timeZone = builder.timeZone; } - public static AutoDateHistogramAggregation of( - Function> fn + public static AutoDateHistogramAggregationFields of( + Function> fn ) { return fn.apply(new Builder()).build(); } - /** - * {@link Aggregation} variant kind. - */ - @Override - public Aggregation.Kind _aggregationKind() { - return Aggregation.Kind.AutoDateHistogram; - } - /** * The target number of buckets. *

@@ -202,8 +195,17 @@ public final String timeZone() { return this.timeZone; } + /** + * Serialize this object to JSON. + */ + @Override + public void serialize(JsonGenerator generator, JsonpMapper mapper) { + generator.writeStartObject(); + serializeInternal(generator, mapper); + generator.writeEnd(); + } + protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { - super.serializeInternal(generator, mapper); if (this.buckets != null) { generator.writeKey("buckets"); generator.write(this.buckets); @@ -269,11 +271,9 @@ public static Builder builder() { } /** - * Builder for {@link AutoDateHistogramAggregation}. + * Builder for {@link AutoDateHistogramAggregationFields}. */ - public static class Builder extends BucketAggregationBase.AbstractBuilder - implements - CopyableBuilder { + public static class Builder extends ObjectBuilderBase implements CopyableBuilder { @Nullable private Integer buckets; @Nullable @@ -295,8 +295,7 @@ public static class Builder extends BucketAggregationBase.AbstractBuilder @@ -450,31 +442,32 @@ public final Builder timeZone(@Nullable String value) { } /** - * Builds a {@link AutoDateHistogramAggregation}. + * Builds a {@link AutoDateHistogramAggregationFields}. * * @throws NullPointerException if some of the required fields are null. */ @Override @Nonnull - public AutoDateHistogramAggregation build() { + public AutoDateHistogramAggregationFields build() { _checkSingleUse(); - return new AutoDateHistogramAggregation(this); + return new AutoDateHistogramAggregationFields(this); } } // --------------------------------------------------------------------------------------------- /** - * Json deserializer for {@link AutoDateHistogramAggregation} + * Json deserializer for {@link AutoDateHistogramAggregationFields} */ - public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer.lazy( + public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer.lazy( Builder::new, - AutoDateHistogramAggregation::setupAutoDateHistogramAggregationDeserializer + AutoDateHistogramAggregationFields::setupAutoDateHistogramAggregationFieldsDeserializer ); - protected static void setupAutoDateHistogramAggregationDeserializer(ObjectDeserializer op) { - setupBucketAggregationBaseDeserializer(op); + protected static void setupAutoDateHistogramAggregationFieldsDeserializer( + ObjectDeserializer op + ) { op.add(Builder::buckets, JsonpDeserializer.integerDeserializer(), "buckets"); op.add(Builder::field, JsonpDeserializer.stringDeserializer(), "field"); op.add(Builder::format, JsonpDeserializer.stringDeserializer(), "format"); @@ -488,7 +481,7 @@ protected static void setupAutoDateHistogramAggregationDeserializer(ObjectDeseri @Override public int hashCode() { - int result = super.hashCode(); + int result = 17; result = 31 * result + Objects.hashCode(this.buckets); result = 31 * result + Objects.hashCode(this.field); result = 31 * result + Objects.hashCode(this.format); @@ -503,12 +496,9 @@ public int hashCode() { @Override public boolean equals(Object o) { - if (!super.equals(o)) { - return false; - } if (this == o) return true; if (o == null || this.getClass() != o.getClass()) return false; - AutoDateHistogramAggregation other = (AutoDateHistogramAggregation) o; + AutoDateHistogramAggregationFields other = (AutoDateHistogramAggregationFields) o; return Objects.equals(this.buckets, other.buckets) && Objects.equals(this.field, other.field) && Objects.equals(this.format, other.format) diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/aggregations/AverageAggregation.java b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/aggregations/AverageAggregation.java index 00751b62c4..61a5d9509a 100644 --- a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/aggregations/AverageAggregation.java +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/aggregations/AverageAggregation.java @@ -53,7 +53,6 @@ @Generated("org.opensearch.client.codegen.CodeGenerator") public class AverageAggregation extends FormatMetricAggregationBase implements - AggregationVariant, ToCopyableBuilder { // --------------------------------------------------------------------------------------------- @@ -66,14 +65,6 @@ public static AverageAggregation of(Function { // --------------------------------------------------------------------------------------------- @@ -66,14 +65,6 @@ public static AverageBucketAggregation of(Function { +public class AvgAggregate extends SingleMetricAggregateBase implements ToCopyableBuilder { // --------------------------------------------------------------------------------------------- @@ -66,14 +63,6 @@ public static AvgAggregate of(Function { +public class BoxPlotAggregate implements PlainJsonSerializable, ToCopyableBuilder { private final double lower; @@ -99,7 +98,6 @@ public class BoxPlotAggregate extends AggregateBase // --------------------------------------------------------------------------------------------- private BoxPlotAggregate(Builder builder) { - super(builder); this.lower = ApiTypeHelper.requireNonNull(builder.lower, this, "lower"); this.lowerAsString = builder.lowerAsString; this.max = ApiTypeHelper.requireNonNull(builder.max, this, "max"); @@ -120,14 +118,6 @@ public static BoxPlotAggregate of(Function implements CopyableBuilder { + public static class Builder extends ObjectBuilderBase implements CopyableBuilder { private Double lower; @Nullable private String lowerAsString; @@ -334,7 +333,6 @@ public static class Builder extends AggregateBase.AbstractBuilder imple public Builder() {} private Builder(BoxPlotAggregate o) { - super(o); this.lower = o.lower; this.lowerAsString = o.lowerAsString; this.max = o.max; @@ -352,7 +350,6 @@ private Builder(BoxPlotAggregate o) { } private Builder(Builder o) { - super(o); this.lower = o.lower; this.lowerAsString = o.lowerAsString; this.max = o.max; @@ -375,12 +372,6 @@ public Builder copy() { return new Builder(this); } - @Override - @Nonnull - protected Builder self() { - return this; - } - /** * Required - API name: {@code lower} */ @@ -532,7 +523,6 @@ public BoxPlotAggregate build() { ); protected static void setupBoxPlotAggregateDeserializer(ObjectDeserializer op) { - setupAggregateBaseDeserializer(op); op.add(Builder::lower, JsonpDeserializer.doubleDeserializer(), "lower"); op.add(Builder::lowerAsString, JsonpDeserializer.stringDeserializer(), "lower_as_string"); op.add(Builder::max, JsonpDeserializer.doubleDeserializer(), "max"); @@ -551,7 +541,7 @@ protected static void setupBoxPlotAggregateDeserializer(ObjectDeserializer { +public class BoxplotAggregation extends MetricAggregationBase implements ToCopyableBuilder { @Nullable private final Double compression; @@ -74,14 +71,6 @@ public static BoxplotAggregation of(Function20 * compression, enabling control of * memory usage and approximation error. diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/aggregations/BucketAggregationBase.java b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/aggregations/BucketAggregationBase.java deleted file mode 100644 index c803a45540..0000000000 --- a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/aggregations/BucketAggregationBase.java +++ /dev/null @@ -1,262 +0,0 @@ -/* - * SPDX-License-Identifier: Apache-2.0 - * - * The OpenSearch Contributors require contributions made to - * this file be licensed under the Apache-2.0 license or a - * compatible open source license. - */ - -/* - * 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. - */ - -/* - * Modifications Copyright OpenSearch Contributors. See - * GitHub history for details. - */ - -//---------------------------------------------------- -// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. -//---------------------------------------------------- - -package org.opensearch.client.opensearch._types.aggregations; - -import jakarta.json.stream.JsonGenerator; -import java.util.Map; -import java.util.Objects; -import java.util.function.Function; -import javax.annotation.Generated; -import javax.annotation.Nonnull; -import javax.annotation.Nullable; -import org.opensearch.client.json.JsonpDeserializer; -import org.opensearch.client.json.JsonpMapper; -import org.opensearch.client.json.ObjectDeserializer; -import org.opensearch.client.util.ApiTypeHelper; -import org.opensearch.client.util.ObjectBuilder; - -// typedef: _types.aggregations.BucketAggregationBase - -@Generated("org.opensearch.client.codegen.CodeGenerator") -public abstract class BucketAggregationBase extends AggregationBase { - - @Nonnull - private final Map aggregations; - - @Nonnull - private final Map aggs; - - // --------------------------------------------------------------------------------------------- - - protected BucketAggregationBase(AbstractBuilder builder) { - super(builder); - this.aggregations = ApiTypeHelper.unmodifiable(builder.aggregations); - this.aggs = ApiTypeHelper.unmodifiable(builder.aggs); - } - - /** - * Sub-aggregations for this bucket aggregation - *

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

- */ - @Nonnull - public final Map aggregations() { - return this.aggregations; - } - - /** - * Sub-aggregations for this bucket aggregation - *

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

- */ - @Nonnull - public final Map aggs() { - return this.aggs; - } - - protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { - super.serializeInternal(generator, mapper); - if (ApiTypeHelper.isDefined(this.aggregations)) { - generator.writeKey("aggregations"); - generator.writeStartObject(); - for (Map.Entry item0 : this.aggregations.entrySet()) { - generator.writeKey(item0.getKey()); - item0.getValue().serialize(generator, mapper); - } - generator.writeEnd(); - } - - if (ApiTypeHelper.isDefined(this.aggs)) { - generator.writeKey("aggs"); - generator.writeStartObject(); - for (Map.Entry item0 : this.aggs.entrySet()) { - generator.writeKey(item0.getKey()); - item0.getValue().serialize(generator, mapper); - } - generator.writeEnd(); - } - } - - // --------------------------------------------------------------------------------------------- - - public abstract static class AbstractBuilder> extends AggregationBase.AbstractBuilder< - BuilderT> { - @Nullable - private Map aggregations; - @Nullable - private Map aggs; - - protected AbstractBuilder() {} - - protected AbstractBuilder(BucketAggregationBase o) { - super(o); - this.aggregations = _mapCopy(o.aggregations); - this.aggs = _mapCopy(o.aggs); - } - - protected AbstractBuilder(AbstractBuilder o) { - super(o); - this.aggregations = _mapCopy(o.aggregations); - this.aggs = _mapCopy(o.aggs); - } - - /** - * Sub-aggregations for this bucket aggregation - *

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

- * - *

- * Adds all elements of map to aggregations. - *

- */ - @Nonnull - public final BuilderT aggregations(Map map) { - this.aggregations = _mapPutAll(this.aggregations, map); - return self(); - } - - /** - * Sub-aggregations for this bucket aggregation - *

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

- * - *

- * Adds an entry to aggregations. - *

- */ - @Nonnull - public final BuilderT aggregations(String key, Aggregation value) { - this.aggregations = _mapPut(this.aggregations, key, value); - return self(); - } - - /** - * Sub-aggregations for this bucket aggregation - *

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

- * - *

- * Adds a value to aggregations using a builder lambda. - *

- */ - @Nonnull - public final BuilderT aggregations(String key, Function> fn) { - return aggregations(key, fn.apply(new Aggregation.Builder()).build()); - } - - /** - * Sub-aggregations for this bucket aggregation - *

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

- * - *

- * Adds all elements of map to aggs. - *

- */ - @Nonnull - public final BuilderT aggs(Map map) { - this.aggs = _mapPutAll(this.aggs, map); - return self(); - } - - /** - * Sub-aggregations for this bucket aggregation - *

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

- * - *

- * Adds an entry to aggs. - *

- */ - @Nonnull - public final BuilderT aggs(String key, Aggregation value) { - this.aggs = _mapPut(this.aggs, key, value); - return self(); - } - - /** - * Sub-aggregations for this bucket aggregation - *

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

- * - *

- * Adds a value to aggs using a builder lambda. - *

- */ - @Nonnull - public final BuilderT aggs(String key, Function> fn) { - return aggs(key, fn.apply(new Aggregation.Builder()).build()); - } - } - - // --------------------------------------------------------------------------------------------- - - protected static > void setupBucketAggregationBaseDeserializer( - ObjectDeserializer op - ) { - setupAggregationBaseDeserializer(op); - op.add(AbstractBuilder::aggregations, JsonpDeserializer.stringMapDeserializer(Aggregation._DESERIALIZER), "aggregations"); - op.add(AbstractBuilder::aggs, JsonpDeserializer.stringMapDeserializer(Aggregation._DESERIALIZER), "aggs"); - } - - @Override - public int hashCode() { - int result = super.hashCode(); - result = 31 * result + Objects.hashCode(this.aggregations); - result = 31 * result + Objects.hashCode(this.aggs); - return result; - } - - @Override - public boolean equals(Object o) { - if (!super.equals(o)) { - return false; - } - if (this == o) return true; - if (o == null || this.getClass() != o.getClass()) return false; - BucketAggregationBase other = (BucketAggregationBase) o; - return Objects.equals(this.aggregations, other.aggregations) && Objects.equals(this.aggs, other.aggs); - } -} diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/aggregations/BucketMetricValueAggregate.java b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/aggregations/BucketMetricValueAggregate.java index 4d87fad59b..24688779ca 100644 --- a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/aggregations/BucketMetricValueAggregate.java +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/aggregations/BucketMetricValueAggregate.java @@ -57,7 +57,6 @@ @Generated("org.opensearch.client.codegen.CodeGenerator") public class BucketMetricValueAggregate extends SingleMetricAggregateBase implements - AggregateVariant, ToCopyableBuilder { @Nonnull @@ -76,14 +75,6 @@ public static BucketMetricValueAggregate of( return fn.apply(new Builder()).build(); } - /** - * {@link Aggregate} variant kind. - */ - @Override - public Aggregate.Kind _aggregateKind() { - return Aggregate.Kind.BucketMetricValue; - } - /** * Required - API name: {@code keys} */ diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/aggregations/BucketPathAggregation.java b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/aggregations/BucketPathAggregation.java index ba7148f628..ad473d882f 100644 --- a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/aggregations/BucketPathAggregation.java +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/aggregations/BucketPathAggregation.java @@ -44,12 +44,14 @@ import javax.annotation.Nullable; import org.opensearch.client.json.JsonpMapper; import org.opensearch.client.json.ObjectDeserializer; +import org.opensearch.client.json.PlainJsonSerializable; import org.opensearch.client.util.ObjectBuilder; +import org.opensearch.client.util.ObjectBuilderBase; // typedef: _types.aggregations.BucketPathAggregation @Generated("org.opensearch.client.codegen.CodeGenerator") -public abstract class BucketPathAggregation extends AggregationBase { +public abstract class BucketPathAggregation implements PlainJsonSerializable { @Nullable private final BucketsPath bucketsPath; @@ -57,7 +59,6 @@ public abstract class BucketPathAggregation extends AggregationBase { // --------------------------------------------------------------------------------------------- protected BucketPathAggregation(AbstractBuilder builder) { - super(builder); this.bucketsPath = builder.bucketsPath; } @@ -69,8 +70,17 @@ public final BucketsPath bucketsPath() { return this.bucketsPath; } + /** + * Serialize this object to JSON. + */ + @Override + public void serialize(JsonGenerator generator, JsonpMapper mapper) { + generator.writeStartObject(); + serializeInternal(generator, mapper); + generator.writeEnd(); + } + protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { - super.serializeInternal(generator, mapper); if (this.bucketsPath != null) { generator.writeKey("buckets_path"); this.bucketsPath.serialize(generator, mapper); @@ -79,23 +89,23 @@ protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { // --------------------------------------------------------------------------------------------- - public abstract static class AbstractBuilder> extends AggregationBase.AbstractBuilder< - BuilderT> { + public abstract static class AbstractBuilder> extends ObjectBuilderBase { @Nullable private BucketsPath bucketsPath; protected AbstractBuilder() {} protected AbstractBuilder(BucketPathAggregation o) { - super(o); this.bucketsPath = o.bucketsPath; } protected AbstractBuilder(AbstractBuilder o) { - super(o); this.bucketsPath = o.bucketsPath; } + @Nonnull + protected abstract BuilderT self(); + /** * API name: {@code buckets_path} */ @@ -119,22 +129,18 @@ public final BuilderT bucketsPath(Function> void setupBucketPathAggregationDeserializer( ObjectDeserializer op ) { - setupAggregationBaseDeserializer(op); op.add(AbstractBuilder::bucketsPath, BucketsPath._DESERIALIZER, "buckets_path"); } @Override public int hashCode() { - int result = super.hashCode(); + int result = 17; result = 31 * result + Objects.hashCode(this.bucketsPath); return result; } @Override public boolean equals(Object o) { - if (!super.equals(o)) { - return false; - } if (this == o) return true; if (o == null || this.getClass() != o.getClass()) return false; BucketPathAggregation other = (BucketPathAggregation) o; diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/aggregations/BucketScriptAggregation.java b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/aggregations/BucketScriptAggregation.java index 31e34a9b38..613967d5c0 100644 --- a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/aggregations/BucketScriptAggregation.java +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/aggregations/BucketScriptAggregation.java @@ -58,7 +58,6 @@ @Generated("org.opensearch.client.codegen.CodeGenerator") public class BucketScriptAggregation extends PipelineAggregationBase implements - AggregationVariant, ToCopyableBuilder { @Nullable @@ -75,14 +74,6 @@ public static BucketScriptAggregation of(Function { @Nullable @@ -75,14 +74,6 @@ public static BucketSelectorAggregation of(Function { @Nullable @@ -78,7 +80,6 @@ public class BucketSortAggregation extends AggregationBase // --------------------------------------------------------------------------------------------- private BucketSortAggregation(Builder builder) { - super(builder); this.from = builder.from; this.gapPolicy = builder.gapPolicy; this.size = builder.size; @@ -89,14 +90,6 @@ public static BucketSortAggregation of(Functionfrom will be truncated. *

@@ -135,8 +128,17 @@ public final List sort() { return this.sort; } + /** + * Serialize this object to JSON. + */ + @Override + public void serialize(JsonGenerator generator, JsonpMapper mapper) { + generator.writeStartObject(); + serializeInternal(generator, mapper); + generator.writeEnd(); + } + protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { - super.serializeInternal(generator, mapper); if (this.from != null) { generator.writeKey("from"); generator.write(this.from); @@ -178,9 +180,7 @@ public static Builder builder() { /** * Builder for {@link BucketSortAggregation}. */ - public static class Builder extends AggregationBase.AbstractBuilder - implements - CopyableBuilder { + public static class Builder extends ObjectBuilderBase implements CopyableBuilder { @Nullable private Integer from; @Nullable @@ -193,7 +193,6 @@ public static class Builder extends AggregationBase.AbstractBuilder public Builder() {} private Builder(BucketSortAggregation o) { - super(o); this.from = o.from; this.gapPolicy = o.gapPolicy; this.size = o.size; @@ -201,7 +200,6 @@ private Builder(BucketSortAggregation o) { } private Builder(Builder o) { - super(o); this.from = o.from; this.gapPolicy = o.gapPolicy; this.size = o.size; @@ -214,12 +212,6 @@ public Builder copy() { return new Builder(this); } - @Override - @Nonnull - protected Builder self() { - return this; - } - /** * Buckets in positions prior to from will be truncated. *

@@ -316,7 +308,6 @@ public BucketSortAggregation build() { ); protected static void setupBucketSortAggregationDeserializer(ObjectDeserializer op) { - setupAggregationBaseDeserializer(op); op.add(Builder::from, JsonpDeserializer.integerDeserializer(), "from"); op.add(Builder::gapPolicy, GapPolicy._DESERIALIZER, "gap_policy"); op.add(Builder::size, JsonpDeserializer.integerDeserializer(), "size"); @@ -325,7 +316,7 @@ protected static void setupBucketSortAggregationDeserializer(ObjectDeserializer< @Override public int hashCode() { - int result = super.hashCode(); + int result = 17; result = 31 * result + Objects.hashCode(this.from); result = 31 * result + Objects.hashCode(this.gapPolicy); result = 31 * result + Objects.hashCode(this.size); @@ -335,9 +326,6 @@ public int hashCode() { @Override public boolean equals(Object o) { - if (!super.equals(o)) { - return false; - } if (this == o) return true; if (o == null || this.getClass() != o.getClass()) return false; BucketSortAggregation other = (BucketSortAggregation) o; diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/aggregations/CardinalityAggregate.java b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/aggregations/CardinalityAggregate.java index 7a394c3eb6..3dc4e4fb1e 100644 --- a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/aggregations/CardinalityAggregate.java +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/aggregations/CardinalityAggregate.java @@ -45,26 +45,24 @@ import org.opensearch.client.json.JsonpMapper; import org.opensearch.client.json.ObjectBuilderDeserializer; import org.opensearch.client.json.ObjectDeserializer; +import org.opensearch.client.json.PlainJsonSerializable; import org.opensearch.client.util.ApiTypeHelper; import org.opensearch.client.util.CopyableBuilder; import org.opensearch.client.util.ObjectBuilder; +import org.opensearch.client.util.ObjectBuilderBase; import org.opensearch.client.util.ToCopyableBuilder; // typedef: _types.aggregations.CardinalityAggregate @JsonpDeserializable @Generated("org.opensearch.client.codegen.CodeGenerator") -public class CardinalityAggregate extends AggregateBase - implements - AggregateVariant, - ToCopyableBuilder { +public class CardinalityAggregate implements PlainJsonSerializable, ToCopyableBuilder { private final long value; // --------------------------------------------------------------------------------------------- private CardinalityAggregate(Builder builder) { - super(builder); this.value = ApiTypeHelper.requireNonNull(builder.value, this, "value"); } @@ -73,22 +71,23 @@ public static CardinalityAggregate of(Function implements CopyableBuilder { + public static class Builder extends ObjectBuilderBase implements CopyableBuilder { private Long value; public Builder() {} private Builder(CardinalityAggregate o) { - super(o); this.value = o.value; } private Builder(Builder o) { - super(o); this.value = o.value; } @@ -130,12 +127,6 @@ public Builder copy() { return new Builder(this); } - @Override - @Nonnull - protected Builder self() { - return this; - } - /** * Required - API name: {@code value} */ @@ -170,22 +161,18 @@ public CardinalityAggregate build() { ); protected static void setupCardinalityAggregateDeserializer(ObjectDeserializer op) { - setupAggregateBaseDeserializer(op); op.add(Builder::value, JsonpDeserializer.longDeserializer(), "value"); } @Override public int hashCode() { - int result = super.hashCode(); + int result = 17; result = 31 * result + Long.hashCode(this.value); return result; } @Override public boolean equals(Object o) { - if (!super.equals(o)) { - return false; - } if (this == o) return true; if (o == null || this.getClass() != o.getClass()) return false; CardinalityAggregate other = (CardinalityAggregate) o; diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/aggregations/CardinalityAggregation.java b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/aggregations/CardinalityAggregation.java index 46adb8cbee..17d19cd1d8 100644 --- a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/aggregations/CardinalityAggregation.java +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/aggregations/CardinalityAggregation.java @@ -57,7 +57,6 @@ @Generated("org.opensearch.client.codegen.CodeGenerator") public class CardinalityAggregation extends MetricAggregationBase implements - AggregationVariant, ToCopyableBuilder { @Nullable @@ -78,14 +77,6 @@ public static CardinalityAggregation of(Function { // --------------------------------------------------------------------------------------------- @@ -66,14 +65,6 @@ public static ChildrenAggregate of(Function { + PlainJsonSerializable, + ToCopyableBuilder { @Nullable private final String type; // --------------------------------------------------------------------------------------------- - private ParentAggregation(Builder builder) { - super(builder); + private ChildrenAggregationFields(Builder builder) { this.type = builder.type; } - public static ParentAggregation of(Function> fn) { + public static ChildrenAggregationFields of(Function> fn) { return fn.apply(new Builder()).build(); } - /** - * {@link Aggregation} variant kind. - */ - @Override - public Aggregation.Kind _aggregationKind() { - return Aggregation.Kind.Parent; - } - /** * API name: {@code type} */ @@ -90,8 +83,17 @@ public final String type() { return this.type; } + /** + * Serialize this object to JSON. + */ + @Override + public void serialize(JsonGenerator generator, JsonpMapper mapper) { + generator.writeStartObject(); + serializeInternal(generator, mapper); + generator.writeEnd(); + } + protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { - super.serializeInternal(generator, mapper); if (this.type != null) { generator.writeKey("type"); generator.write(this.type); @@ -112,23 +114,19 @@ public static Builder builder() { } /** - * Builder for {@link ParentAggregation}. + * Builder for {@link ChildrenAggregationFields}. */ - public static class Builder extends BucketAggregationBase.AbstractBuilder - implements - CopyableBuilder { + public static class Builder extends ObjectBuilderBase implements CopyableBuilder { @Nullable private String type; public Builder() {} - private Builder(ParentAggregation o) { - super(o); + private Builder(ChildrenAggregationFields o) { this.type = o.type; } private Builder(Builder o) { - super(o); this.type = o.type; } @@ -138,12 +136,6 @@ public Builder copy() { return new Builder(this); } - @Override - @Nonnull - protected Builder self() { - return this; - } - /** * API name: {@code type} */ @@ -154,49 +146,45 @@ public final Builder type(@Nullable String value) { } /** - * Builds a {@link ParentAggregation}. + * Builds a {@link ChildrenAggregationFields}. * * @throws NullPointerException if some of the required fields are null. */ @Override @Nonnull - public ParentAggregation build() { + public ChildrenAggregationFields build() { _checkSingleUse(); - return new ParentAggregation(this); + return new ChildrenAggregationFields(this); } } // --------------------------------------------------------------------------------------------- /** - * Json deserializer for {@link ParentAggregation} + * Json deserializer for {@link ChildrenAggregationFields} */ - public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer.lazy( + public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer.lazy( Builder::new, - ParentAggregation::setupParentAggregationDeserializer + ChildrenAggregationFields::setupChildrenAggregationFieldsDeserializer ); - protected static void setupParentAggregationDeserializer(ObjectDeserializer op) { - setupBucketAggregationBaseDeserializer(op); + protected static void setupChildrenAggregationFieldsDeserializer(ObjectDeserializer op) { op.add(Builder::type, JsonpDeserializer.stringDeserializer(), "type"); } @Override public int hashCode() { - int result = super.hashCode(); + int result = 17; result = 31 * result + Objects.hashCode(this.type); return result; } @Override public boolean equals(Object o) { - if (!super.equals(o)) { - return false; - } if (this == o) return true; if (o == null || this.getClass() != o.getClass()) return false; - ParentAggregation other = (ParentAggregation) o; + ChildrenAggregationFields other = (ChildrenAggregationFields) o; return Objects.equals(this.type, other.type); } } diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/aggregations/CompositeAggregate.java b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/aggregations/CompositeAggregate.java index 3161bfbfc7..1ba7428ece 100644 --- a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/aggregations/CompositeAggregate.java +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/aggregations/CompositeAggregate.java @@ -60,7 +60,6 @@ @Generated("org.opensearch.client.codegen.CodeGenerator") public class CompositeAggregate extends MultiBucketAggregateBase implements - AggregateVariant, ToCopyableBuilder { @Nonnull @@ -77,14 +76,6 @@ public static CompositeAggregate of(Function { + PlainJsonSerializable, + ToCopyableBuilder { @Nonnull private final Map after; @@ -75,25 +77,18 @@ public class CompositeAggregation extends BucketAggregationBase // --------------------------------------------------------------------------------------------- - private CompositeAggregation(Builder builder) { - super(builder); + private CompositeAggregationFields(Builder builder) { this.after = ApiTypeHelper.unmodifiable(builder.after); this.size = builder.size; this.sources = ApiTypeHelper.unmodifiable(builder.sources); } - public static CompositeAggregation of(Function> fn) { + public static CompositeAggregationFields of( + Function> fn + ) { return fn.apply(new Builder()).build(); } - /** - * {@link Aggregation} variant kind. - */ - @Override - public Aggregation.Kind _aggregationKind() { - return Aggregation.Kind.Composite; - } - /** * API name: {@code after} */ @@ -124,8 +119,17 @@ public final List> sources() { return this.sources; } + /** + * Serialize this object to JSON. + */ + @Override + public void serialize(JsonGenerator generator, JsonpMapper mapper) { + generator.writeStartObject(); + serializeInternal(generator, mapper); + generator.writeEnd(); + } + protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { - super.serializeInternal(generator, mapper); if (ApiTypeHelper.isDefined(this.after)) { generator.writeKey("after"); generator.writeStartObject(); @@ -172,11 +176,9 @@ public static Builder builder() { } /** - * Builder for {@link CompositeAggregation}. + * Builder for {@link CompositeAggregationFields}. */ - public static class Builder extends BucketAggregationBase.AbstractBuilder - implements - CopyableBuilder { + public static class Builder extends ObjectBuilderBase implements CopyableBuilder { @Nullable private Map after; @Nullable @@ -186,15 +188,13 @@ public static class Builder extends BucketAggregationBase.AbstractBuilder value, Map< } /** - * Builds a {@link CompositeAggregation}. + * Builds a {@link CompositeAggregationFields}. * * @throws NullPointerException if some of the required fields are null. */ @Override @Nonnull - public CompositeAggregation build() { + public CompositeAggregationFields build() { _checkSingleUse(); - return new CompositeAggregation(this); + return new CompositeAggregationFields(this); } } // --------------------------------------------------------------------------------------------- /** - * Json deserializer for {@link CompositeAggregation} + * Json deserializer for {@link CompositeAggregationFields} */ - public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer.lazy( + public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer.lazy( Builder::new, - CompositeAggregation::setupCompositeAggregationDeserializer + CompositeAggregationFields::setupCompositeAggregationFieldsDeserializer ); - protected static void setupCompositeAggregationDeserializer(ObjectDeserializer op) { - setupBucketAggregationBaseDeserializer(op); + protected static void setupCompositeAggregationFieldsDeserializer(ObjectDeserializer op) { op.add(Builder::after, JsonpDeserializer.stringMapDeserializer(FieldValue._DESERIALIZER), "after"); op.add(Builder::size, JsonpDeserializer.integerDeserializer(), "size"); op.add( @@ -331,7 +324,7 @@ protected static void setupCompositeAggregationDeserializer(ObjectDeserializer { private final long value; @@ -69,7 +71,6 @@ public class CumulativeCardinalityAggregate extends AggregateBase // --------------------------------------------------------------------------------------------- private CumulativeCardinalityAggregate(Builder builder) { - super(builder); this.value = ApiTypeHelper.requireNonNull(builder.value, this, "value"); this.valueAsString = builder.valueAsString; } @@ -80,14 +81,6 @@ public static CumulativeCardinalityAggregate of( return fn.apply(new Builder()).build(); } - /** - * {@link Aggregate} variant kind. - */ - @Override - public Aggregate.Kind _aggregateKind() { - return Aggregate.Kind.SimpleLongValue; - } - /** * Required - API name: {@code value} */ @@ -103,8 +96,17 @@ public final String valueAsString() { return this.valueAsString; } + /** + * Serialize this object to JSON. + */ + @Override + public void serialize(JsonGenerator generator, JsonpMapper mapper) { + generator.writeStartObject(); + serializeInternal(generator, mapper); + generator.writeEnd(); + } + protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { - super.serializeInternal(generator, mapper); generator.writeKey("value"); generator.write(this.value); @@ -130,9 +132,7 @@ public static Builder builder() { /** * Builder for {@link CumulativeCardinalityAggregate}. */ - public static class Builder extends AggregateBase.AbstractBuilder - implements - CopyableBuilder { + public static class Builder extends ObjectBuilderBase implements CopyableBuilder { private Long value; @Nullable private String valueAsString; @@ -140,13 +140,11 @@ public static class Builder extends AggregateBase.AbstractBuilder public Builder() {} private Builder(CumulativeCardinalityAggregate o) { - super(o); this.value = o.value; this.valueAsString = o.valueAsString; } private Builder(Builder o) { - super(o); this.value = o.value; this.valueAsString = o.valueAsString; } @@ -157,12 +155,6 @@ public Builder copy() { return new Builder(this); } - @Override - @Nonnull - protected Builder self() { - return this; - } - /** * Required - API name: {@code value} */ @@ -206,14 +198,13 @@ public CumulativeCardinalityAggregate build() { ); protected static void setupCumulativeCardinalityAggregateDeserializer(ObjectDeserializer op) { - setupAggregateBaseDeserializer(op); op.add(Builder::value, JsonpDeserializer.longDeserializer(), "value"); op.add(Builder::valueAsString, JsonpDeserializer.stringDeserializer(), "value_as_string"); } @Override public int hashCode() { - int result = super.hashCode(); + int result = 17; result = 31 * result + Long.hashCode(this.value); result = 31 * result + Objects.hashCode(this.valueAsString); return result; @@ -221,9 +212,6 @@ public int hashCode() { @Override public boolean equals(Object o) { - if (!super.equals(o)) { - return false; - } if (this == o) return true; if (o == null || this.getClass() != o.getClass()) return false; CumulativeCardinalityAggregate other = (CumulativeCardinalityAggregate) o; diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/aggregations/CumulativeCardinalityAggregation.java b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/aggregations/CumulativeCardinalityAggregation.java index d26153aa32..04d848faab 100644 --- a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/aggregations/CumulativeCardinalityAggregation.java +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/aggregations/CumulativeCardinalityAggregation.java @@ -53,7 +53,6 @@ @Generated("org.opensearch.client.codegen.CodeGenerator") public class CumulativeCardinalityAggregation extends PipelineAggregationBase implements - AggregationVariant, ToCopyableBuilder { // --------------------------------------------------------------------------------------------- @@ -68,14 +67,6 @@ public static CumulativeCardinalityAggregation of( return fn.apply(new Builder()).build(); } - /** - * {@link Aggregation} variant kind. - */ - @Override - public Aggregation.Kind _aggregationKind() { - return Aggregation.Kind.CumulativeCardinality; - } - // --------------------------------------------------------------------------------------------- @Override diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/aggregations/CumulativeSumAggregation.java b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/aggregations/CumulativeSumAggregation.java index 194125a50d..bbac1368f2 100644 --- a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/aggregations/CumulativeSumAggregation.java +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/aggregations/CumulativeSumAggregation.java @@ -53,7 +53,6 @@ @Generated("org.opensearch.client.codegen.CodeGenerator") public class CumulativeSumAggregation extends PipelineAggregationBase implements - AggregationVariant, ToCopyableBuilder { // --------------------------------------------------------------------------------------------- @@ -66,14 +65,6 @@ public static CumulativeSumAggregation of(Function implements - AggregateVariant, ToCopyableBuilder { // --------------------------------------------------------------------------------------------- @@ -66,14 +65,6 @@ public static DateHistogramAggregate of(Function { + PlainJsonSerializable, + ToCopyableBuilder { @Nullable private final CalendarInterval calendarInterval; @@ -112,8 +114,7 @@ public class DateHistogramAggregation extends BucketAggregationBase // --------------------------------------------------------------------------------------------- - private DateHistogramAggregation(Builder builder) { - super(builder); + private DateHistogramAggregationFields(Builder builder) { this.calendarInterval = builder.calendarInterval; this.extendedBounds = builder.extendedBounds; this.field = builder.field; @@ -131,18 +132,12 @@ private DateHistogramAggregation(Builder builder) { this.timeZone = builder.timeZone; } - public static DateHistogramAggregation of(Function> fn) { + public static DateHistogramAggregationFields of( + Function> fn + ) { return fn.apply(new Builder()).build(); } - /** - * {@link Aggregation} variant kind. - */ - @Override - public Aggregation.Kind _aggregationKind() { - return Aggregation.Kind.DateHistogram; - } - /** * API name: {@code calendar_interval} */ @@ -274,8 +269,17 @@ public final String timeZone() { return this.timeZone; } + /** + * Serialize this object to JSON. + */ + @Override + public void serialize(JsonGenerator generator, JsonpMapper mapper) { + generator.writeStartObject(); + serializeInternal(generator, mapper); + generator.writeEnd(); + } + protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { - super.serializeInternal(generator, mapper); if (this.calendarInterval != null) { generator.writeKey("calendar_interval"); this.calendarInterval.serialize(generator, mapper); @@ -371,11 +375,9 @@ public static Builder builder() { } /** - * Builder for {@link DateHistogramAggregation}. + * Builder for {@link DateHistogramAggregationFields}. */ - public static class Builder extends BucketAggregationBase.AbstractBuilder - implements - CopyableBuilder { + public static class Builder extends ObjectBuilderBase implements CopyableBuilder { @Nullable private CalendarInterval calendarInterval; @Nullable @@ -409,8 +411,7 @@ public static class Builder extends BucketAggregationBase.AbstractBuilder _DESERIALIZER = ObjectBuilderDeserializer.lazy( + public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer.lazy( Builder::new, - DateHistogramAggregation::setupDateHistogramAggregationDeserializer + DateHistogramAggregationFields::setupDateHistogramAggregationFieldsDeserializer ); - protected static void setupDateHistogramAggregationDeserializer(ObjectDeserializer op) { - setupBucketAggregationBaseDeserializer(op); + protected static void setupDateHistogramAggregationFieldsDeserializer(ObjectDeserializer op) { op.add(Builder::calendarInterval, CalendarInterval._DESERIALIZER, "calendar_interval"); op.add(Builder::extendedBounds, ExtendedBounds.createExtendedBoundsDeserializer(FieldDateMath._DESERIALIZER), "extended_bounds"); op.add(Builder::field, JsonpDeserializer.stringDeserializer(), "field"); @@ -725,7 +718,7 @@ protected static void setupDateHistogramAggregationDeserializer(ObjectDeserializ @Override public int hashCode() { - int result = super.hashCode(); + int result = 17; result = 31 * result + Objects.hashCode(this.calendarInterval); result = 31 * result + Objects.hashCode(this.extendedBounds); result = 31 * result + Objects.hashCode(this.field); @@ -746,12 +739,9 @@ public int hashCode() { @Override public boolean equals(Object o) { - if (!super.equals(o)) { - return false; - } if (this == o) return true; if (o == null || this.getClass() != o.getClass()) return false; - DateHistogramAggregation other = (DateHistogramAggregation) o; + DateHistogramAggregationFields other = (DateHistogramAggregationFields) o; return Objects.equals(this.calendarInterval, other.calendarInterval) && Objects.equals(this.extendedBounds, other.extendedBounds) && Objects.equals(this.field, other.field) diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/aggregations/DateRangeAggregate.java b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/aggregations/DateRangeAggregate.java index df5ff7ecfc..86e9cd1993 100644 --- a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/aggregations/DateRangeAggregate.java +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/aggregations/DateRangeAggregate.java @@ -51,10 +51,7 @@ @JsonpDeserializable @Generated("org.opensearch.client.codegen.CodeGenerator") -public class DateRangeAggregate extends RangeAggregateBase - implements - AggregateVariant, - ToCopyableBuilder { +public class DateRangeAggregate extends RangeAggregateBase implements ToCopyableBuilder { // --------------------------------------------------------------------------------------------- @@ -66,14 +63,6 @@ public static DateRangeAggregate of(Function { + PlainJsonSerializable, + ToCopyableBuilder { @Nullable private final String field; @@ -83,8 +85,7 @@ public class DateRangeAggregation extends BucketAggregationBase // --------------------------------------------------------------------------------------------- - private DateRangeAggregation(Builder builder) { - super(builder); + private DateRangeAggregationFields(Builder builder) { this.field = builder.field; this.format = builder.format; this.keyed = builder.keyed; @@ -93,18 +94,12 @@ private DateRangeAggregation(Builder builder) { this.timeZone = builder.timeZone; } - public static DateRangeAggregation of(Function> fn) { + public static DateRangeAggregationFields of( + Function> fn + ) { return fn.apply(new Builder()).build(); } - /** - * {@link Aggregation} variant kind. - */ - @Override - public Aggregation.Kind _aggregationKind() { - return Aggregation.Kind.DateRange; - } - /** * API name: {@code field} */ @@ -162,8 +157,17 @@ public final String timeZone() { return this.timeZone; } + /** + * Serialize this object to JSON. + */ + @Override + public void serialize(JsonGenerator generator, JsonpMapper mapper) { + generator.writeStartObject(); + serializeInternal(generator, mapper); + generator.writeEnd(); + } + protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { - super.serializeInternal(generator, mapper); if (this.field != null) { generator.writeKey("field"); generator.write(this.field); @@ -213,11 +217,9 @@ public static Builder builder() { } /** - * Builder for {@link DateRangeAggregation}. + * Builder for {@link DateRangeAggregationFields}. */ - public static class Builder extends BucketAggregationBase.AbstractBuilder - implements - CopyableBuilder { + public static class Builder extends ObjectBuilderBase implements CopyableBuilder { @Nullable private String field; @Nullable @@ -233,8 +235,7 @@ public static class Builder extends BucketAggregationBase.AbstractBuilder _DESERIALIZER = ObjectBuilderDeserializer.lazy( + public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer.lazy( Builder::new, - DateRangeAggregation::setupDateRangeAggregationDeserializer + DateRangeAggregationFields::setupDateRangeAggregationFieldsDeserializer ); - protected static void setupDateRangeAggregationDeserializer(ObjectDeserializer op) { - setupBucketAggregationBaseDeserializer(op); + protected static void setupDateRangeAggregationFieldsDeserializer(ObjectDeserializer op) { op.add(Builder::field, JsonpDeserializer.stringDeserializer(), "field"); op.add(Builder::format, JsonpDeserializer.stringDeserializer(), "format"); op.add(Builder::keyed, JsonpDeserializer.booleanDeserializer(), "keyed"); @@ -407,7 +400,7 @@ protected static void setupDateRangeAggregationDeserializer(ObjectDeserializer { @Nullable @@ -78,14 +77,6 @@ public static DerivativeAggregate of(Function { // --------------------------------------------------------------------------------------------- @@ -66,14 +65,6 @@ public static DerivativeAggregation of(Function { + PlainJsonSerializable, + ToCopyableBuilder { @Nullable private final SamplerAggregationExecutionHint executionHint; @@ -78,8 +80,7 @@ public class DiversifiedSamplerAggregation extends BucketAggregationBase // --------------------------------------------------------------------------------------------- - private DiversifiedSamplerAggregation(Builder builder) { - super(builder); + private DiversifiedSamplerAggregationFields(Builder builder) { this.executionHint = builder.executionHint; this.field = builder.field; this.maxDocsPerValue = builder.maxDocsPerValue; @@ -87,20 +88,12 @@ private DiversifiedSamplerAggregation(Builder builder) { this.shardSize = builder.shardSize; } - public static DiversifiedSamplerAggregation of( - Function> fn + public static DiversifiedSamplerAggregationFields of( + Function> fn ) { return fn.apply(new Builder()).build(); } - /** - * {@link Aggregation} variant kind. - */ - @Override - public Aggregation.Kind _aggregationKind() { - return Aggregation.Kind.DiversifiedSampler; - } - /** * API name: {@code execution_hint} */ @@ -147,8 +140,17 @@ public final Integer shardSize() { return this.shardSize; } + /** + * Serialize this object to JSON. + */ + @Override + public void serialize(JsonGenerator generator, JsonpMapper mapper) { + generator.writeStartObject(); + serializeInternal(generator, mapper); + generator.writeEnd(); + } + protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { - super.serializeInternal(generator, mapper); if (this.executionHint != null) { generator.writeKey("execution_hint"); this.executionHint.serialize(generator, mapper); @@ -189,11 +191,9 @@ public static Builder builder() { } /** - * Builder for {@link DiversifiedSamplerAggregation}. + * Builder for {@link DiversifiedSamplerAggregationFields}. */ - public static class Builder extends BucketAggregationBase.AbstractBuilder - implements - CopyableBuilder { + public static class Builder extends ObjectBuilderBase implements CopyableBuilder { @Nullable private SamplerAggregationExecutionHint executionHint; @Nullable @@ -207,8 +207,7 @@ public static class Builder extends BucketAggregationBase.AbstractBuilder _DESERIALIZER = ObjectBuilderDeserializer.lazy( + public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer.lazy( Builder::new, - DiversifiedSamplerAggregation::setupDiversifiedSamplerAggregationDeserializer + DiversifiedSamplerAggregationFields::setupDiversifiedSamplerAggregationFieldsDeserializer ); - protected static void setupDiversifiedSamplerAggregationDeserializer(ObjectDeserializer op) { - setupBucketAggregationBaseDeserializer(op); + protected static void setupDiversifiedSamplerAggregationFieldsDeserializer( + ObjectDeserializer op + ) { op.add(Builder::executionHint, SamplerAggregationExecutionHint._DESERIALIZER, "execution_hint"); op.add(Builder::field, JsonpDeserializer.stringDeserializer(), "field"); op.add(Builder::maxDocsPerValue, JsonpDeserializer.integerDeserializer(), "max_docs_per_value"); @@ -331,7 +324,7 @@ protected static void setupDiversifiedSamplerAggregationDeserializer(ObjectDeser @Override public int hashCode() { - int result = super.hashCode(); + int result = 17; result = 31 * result + Objects.hashCode(this.executionHint); result = 31 * result + Objects.hashCode(this.field); result = 31 * result + Objects.hashCode(this.maxDocsPerValue); @@ -342,12 +335,9 @@ public int hashCode() { @Override public boolean equals(Object o) { - if (!super.equals(o)) { - return false; - } if (this == o) return true; if (o == null || this.getClass() != o.getClass()) return false; - DiversifiedSamplerAggregation other = (DiversifiedSamplerAggregation) o; + DiversifiedSamplerAggregationFields other = (DiversifiedSamplerAggregationFields) o; return Objects.equals(this.executionHint, other.executionHint) && Objects.equals(this.field, other.field) && Objects.equals(this.maxDocsPerValue, other.maxDocsPerValue) diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/aggregations/DoubleTermsAggregate.java b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/aggregations/DoubleTermsAggregate.java index 0462daa062..ef57a56a9e 100644 --- a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/aggregations/DoubleTermsAggregate.java +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/aggregations/DoubleTermsAggregate.java @@ -39,6 +39,7 @@ import java.util.function.Function; import javax.annotation.Generated; import javax.annotation.Nonnull; +import org.opensearch.client.json.JsonData; import org.opensearch.client.json.JsonpDeserializable; import org.opensearch.client.json.JsonpDeserializer; import org.opensearch.client.json.ObjectBuilderDeserializer; @@ -54,9 +55,8 @@ */ @JsonpDeserializable @Generated("org.opensearch.client.codegen.CodeGenerator") -public class DoubleTermsAggregate extends TermsAggregateBase +public class DoubleTermsAggregate extends TermsAggregateBase implements - AggregateVariant, ToCopyableBuilder { // --------------------------------------------------------------------------------------------- @@ -69,14 +69,6 @@ public static DoubleTermsAggregate of(Function + public static class Builder extends TermsAggregateBase.AbstractBuilder implements CopyableBuilder { @@ -144,7 +136,7 @@ public DoubleTermsAggregate build() { ); protected static void setupDoubleTermsAggregateDeserializer(ObjectDeserializer op) { - setupTermsAggregateBaseDeserializer(op, DoubleTermsBucket._DESERIALIZER); + setupTermsAggregateBaseDeserializer(op, JsonData._DESERIALIZER); } @Override diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/aggregations/DoubleTermsBucket.java b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/aggregations/DoubleTermsBucket.java deleted file mode 100644 index a789337578..0000000000 --- a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/aggregations/DoubleTermsBucket.java +++ /dev/null @@ -1,217 +0,0 @@ -/* - * SPDX-License-Identifier: Apache-2.0 - * - * The OpenSearch Contributors require contributions made to - * this file be licensed under the Apache-2.0 license or a - * compatible open source license. - */ - -/* - * 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. - */ - -/* - * Modifications Copyright OpenSearch Contributors. See - * GitHub history for details. - */ - -//---------------------------------------------------- -// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. -//---------------------------------------------------- - -package org.opensearch.client.opensearch._types.aggregations; - -import jakarta.json.stream.JsonGenerator; -import java.util.Objects; -import java.util.function.Function; -import javax.annotation.Generated; -import javax.annotation.Nonnull; -import javax.annotation.Nullable; -import org.opensearch.client.json.JsonpDeserializable; -import org.opensearch.client.json.JsonpDeserializer; -import org.opensearch.client.json.JsonpMapper; -import org.opensearch.client.json.ObjectBuilderDeserializer; -import org.opensearch.client.json.ObjectDeserializer; -import org.opensearch.client.util.ApiTypeHelper; -import org.opensearch.client.util.CopyableBuilder; -import org.opensearch.client.util.ObjectBuilder; -import org.opensearch.client.util.ToCopyableBuilder; - -// typedef: _types.aggregations.DoubleTermsBucket - -@JsonpDeserializable -@Generated("org.opensearch.client.codegen.CodeGenerator") -public class DoubleTermsBucket extends TermsBucketBase implements ToCopyableBuilder { - - private final double key; - - @Nullable - private final String keyAsString; - - // --------------------------------------------------------------------------------------------- - - private DoubleTermsBucket(Builder builder) { - super(builder); - this.key = ApiTypeHelper.requireNonNull(builder.key, this, "key"); - this.keyAsString = builder.keyAsString; - } - - public static DoubleTermsBucket of(Function> fn) { - return fn.apply(new Builder()).build(); - } - - /** - * Required - API name: {@code key} - */ - public final double key() { - return this.key; - } - - /** - * API name: {@code key_as_string} - */ - @Nullable - public final String keyAsString() { - return this.keyAsString; - } - - protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { - super.serializeInternal(generator, mapper); - generator.writeKey("key"); - generator.write(this.key); - - if (this.keyAsString != null) { - generator.writeKey("key_as_string"); - generator.write(this.keyAsString); - } - } - - // --------------------------------------------------------------------------------------------- - - @Override - @Nonnull - public Builder toBuilder() { - return new Builder(this); - } - - @Nonnull - public static Builder builder() { - return new Builder(); - } - - /** - * Builder for {@link DoubleTermsBucket}. - */ - public static class Builder extends TermsBucketBase.AbstractBuilder implements CopyableBuilder { - private Double key; - @Nullable - private String keyAsString; - - public Builder() {} - - private Builder(DoubleTermsBucket o) { - super(o); - this.key = o.key; - this.keyAsString = o.keyAsString; - } - - private Builder(Builder o) { - super(o); - this.key = o.key; - this.keyAsString = o.keyAsString; - } - - @Override - @Nonnull - public Builder copy() { - return new Builder(this); - } - - @Override - @Nonnull - protected Builder self() { - return this; - } - - /** - * Required - API name: {@code key} - */ - @Nonnull - public final Builder key(double value) { - this.key = value; - return this; - } - - /** - * API name: {@code key_as_string} - */ - @Nonnull - public final Builder keyAsString(@Nullable String value) { - this.keyAsString = value; - return this; - } - - /** - * Builds a {@link DoubleTermsBucket}. - * - * @throws NullPointerException if some of the required fields are null. - */ - @Override - @Nonnull - public DoubleTermsBucket build() { - _checkSingleUse(); - - return new DoubleTermsBucket(this); - } - } - - // --------------------------------------------------------------------------------------------- - - /** - * Json deserializer for {@link DoubleTermsBucket} - */ - public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer.lazy( - Builder::new, - DoubleTermsBucket::setupDoubleTermsBucketDeserializer - ); - - protected static void setupDoubleTermsBucketDeserializer(ObjectDeserializer op) { - setupTermsBucketBaseDeserializer(op); - op.add(Builder::key, JsonpDeserializer.doubleDeserializer(), "key"); - op.add(Builder::keyAsString, JsonpDeserializer.stringDeserializer(), "key_as_string"); - } - - @Override - public int hashCode() { - int result = super.hashCode(); - result = 31 * result + Double.hashCode(this.key); - result = 31 * result + Objects.hashCode(this.keyAsString); - return result; - } - - @Override - public boolean equals(Object o) { - if (!super.equals(o)) { - return false; - } - if (this == o) return true; - if (o == null || this.getClass() != o.getClass()) return false; - DoubleTermsBucket other = (DoubleTermsBucket) o; - return this.key == other.key && Objects.equals(this.keyAsString, other.keyAsString); - } -} diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/aggregations/ExtendedStatsAggregate.java b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/aggregations/ExtendedStatsAggregate.java index 82c21a21a2..c26e592752 100644 --- a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/aggregations/ExtendedStatsAggregate.java +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/aggregations/ExtendedStatsAggregate.java @@ -53,7 +53,6 @@ @Generated("org.opensearch.client.codegen.CodeGenerator") public class ExtendedStatsAggregate extends ExtendedStatsAggregateBase implements - AggregateVariant, ToCopyableBuilder { // --------------------------------------------------------------------------------------------- @@ -66,14 +65,6 @@ public static ExtendedStatsAggregate of(Function { @Nullable @@ -74,14 +73,6 @@ public static ExtendedStatsAggregation of(Function diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/aggregations/ExtendedStatsBucketAggregate.java b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/aggregations/ExtendedStatsBucketAggregate.java index 64b8c23e15..cbb82ccf28 100644 --- a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/aggregations/ExtendedStatsBucketAggregate.java +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/aggregations/ExtendedStatsBucketAggregate.java @@ -53,7 +53,6 @@ @Generated("org.opensearch.client.codegen.CodeGenerator") public class ExtendedStatsBucketAggregate extends ExtendedStatsAggregateBase implements - AggregateVariant, ToCopyableBuilder { // --------------------------------------------------------------------------------------------- @@ -68,14 +67,6 @@ public static ExtendedStatsBucketAggregate of( return fn.apply(new Builder()).build(); } - /** - * {@link Aggregate} variant kind. - */ - @Override - public Aggregate.Kind _aggregateKind() { - return Aggregate.Kind.ExtendedStatsBucket; - } - // --------------------------------------------------------------------------------------------- @Override diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/aggregations/ExtendedStatsBucketAggregation.java b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/aggregations/ExtendedStatsBucketAggregation.java index 2b4684b31f..1130c82d2d 100644 --- a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/aggregations/ExtendedStatsBucketAggregation.java +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/aggregations/ExtendedStatsBucketAggregation.java @@ -57,7 +57,6 @@ @Generated("org.opensearch.client.codegen.CodeGenerator") public class ExtendedStatsBucketAggregation extends PipelineAggregationBase implements - AggregationVariant, ToCopyableBuilder { @Nullable @@ -76,14 +75,6 @@ public static ExtendedStatsBucketAggregation of( return fn.apply(new Builder()).build(); } - /** - * {@link Aggregation} variant kind. - */ - @Override - public Aggregation.Kind _aggregationKind() { - return Aggregation.Kind.ExtendedStatsBucket; - } - /** * The number of standard deviations above/below the mean to display. *

diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/aggregations/FilterAggregate.java b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/aggregations/FilterAggregate.java index 0bea95daad..fd06b32805 100644 --- a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/aggregations/FilterAggregate.java +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/aggregations/FilterAggregate.java @@ -51,10 +51,7 @@ @JsonpDeserializable @Generated("org.opensearch.client.codegen.CodeGenerator") -public class FilterAggregate extends SingleBucketAggregateBase - implements - AggregateVariant, - ToCopyableBuilder { +public class FilterAggregate extends SingleBucketAggregateBase implements ToCopyableBuilder { // --------------------------------------------------------------------------------------------- @@ -66,14 +63,6 @@ public static FilterAggregate of(Function { + + @Nullable + private final AgenticQuery agentic; + + @Nullable + private final BoolQuery bool; + + @Nullable + private final BoostingQuery boosting; + + @Nullable + private final CombinedFieldsQuery combinedFields; + + @Nullable + private final CommonTermsQuery common; + + @Nullable + private final ConstantScoreQuery constantScore; + + @Nullable + private final DisMaxQuery disMax; + + @Nullable + private final DistanceFeatureQuery distanceFeature; + + @Nullable + private final ExistsQuery exists; + + @Nullable + private final SpanFieldMaskingQuery fieldMaskingSpan; + + @Nullable + private final FunctionScoreQuery functionScore; + + @Nullable + private final FuzzyQuery fuzzy; + + @Nullable + private final GeoBoundingBoxQuery geoBoundingBox; + + @Nullable + private final GeoDistanceQuery geoDistance; + + @Nullable + private final GeoPolygonQuery geoPolygon; + + @Nullable + private final GeoShapeQuery geoShape; + + @Nullable + private final HasChildQuery hasChild; + + @Nullable + private final HasParentQuery hasParent; + + @Nullable + private final HybridQuery hybrid; + + @Nullable + private final IdsQuery ids; + + @Nullable + private final IntervalsQuery intervals; + + @Nullable + private final KnnQuery knn; + + @Nullable + private final MatchQuery match; + + @Nullable + private final MatchAllQuery matchAll; + + @Nullable + private final MatchBoolPrefixQuery matchBoolPrefix; + + @Nullable + private final MatchNoneQuery matchNone; + + @Nullable + private final MatchPhraseQuery matchPhrase; + + @Nullable + private final MatchPhrasePrefixQuery matchPhrasePrefix; + + @Nullable + private final MoreLikeThisQuery moreLikeThis; + + @Nullable + private final MultiMatchQuery multiMatch; + + @Nullable + private final NestedQuery nested; + + @Nullable + private final NeuralQuery neural; + + @Nullable + private final ParentIdQuery parentId; + + @Nullable + private final PercolateQuery percolate; + + @Nullable + private final PrefixQuery prefix; + + @Nullable + private final QueryStringQuery queryString; + + @Nullable + private final RangeQuery range; + + @Nullable + private final RankFeatureQuery rankFeature; + + @Nullable + private final RegexpQuery regexp; + + @Nullable + private final ScriptQuery script; + + @Nullable + private final ScriptScoreQuery scriptScore; + + @Nullable + private final SimpleQueryStringQuery simpleQueryString; + + @Nullable + private final SpanContainingQuery spanContaining; + + @Nullable + private final SpanFirstQuery spanFirst; + + @Nullable + private final SpanMultiTermQuery spanMulti; + + @Nullable + private final SpanNearQuery spanNear; + + @Nullable + private final SpanNotQuery spanNot; + + @Nullable + private final SpanOrQuery spanOr; + + @Nullable + private final SpanTermQuery spanTerm; + + @Nullable + private final SpanWithinQuery spanWithin; + + @Nonnull + private final Map template; + + @Nullable + private final TermQuery term; + + @Nullable + private final TermsQuery terms; + + @Nullable + private final TermsSetQuery termsSet; + + @Nullable + private final TypeQuery type; + + @Nullable + private final WildcardQuery wildcard; + + @Nullable + private final WrapperQuery wrapper; + + @Nullable + private final XyShapeQuery xyShape; + + // --------------------------------------------------------------------------------------------- + + private FilterAggregationFields(Builder builder) { + this.agentic = builder.agentic; + this.bool = builder.bool; + this.boosting = builder.boosting; + this.combinedFields = builder.combinedFields; + this.common = builder.common; + this.constantScore = builder.constantScore; + this.disMax = builder.disMax; + this.distanceFeature = builder.distanceFeature; + this.exists = builder.exists; + this.fieldMaskingSpan = builder.fieldMaskingSpan; + this.functionScore = builder.functionScore; + this.fuzzy = builder.fuzzy; + this.geoBoundingBox = builder.geoBoundingBox; + this.geoDistance = builder.geoDistance; + this.geoPolygon = builder.geoPolygon; + this.geoShape = builder.geoShape; + this.hasChild = builder.hasChild; + this.hasParent = builder.hasParent; + this.hybrid = builder.hybrid; + this.ids = builder.ids; + this.intervals = builder.intervals; + this.knn = builder.knn; + this.match = builder.match; + this.matchAll = builder.matchAll; + this.matchBoolPrefix = builder.matchBoolPrefix; + this.matchNone = builder.matchNone; + this.matchPhrase = builder.matchPhrase; + this.matchPhrasePrefix = builder.matchPhrasePrefix; + this.moreLikeThis = builder.moreLikeThis; + this.multiMatch = builder.multiMatch; + this.nested = builder.nested; + this.neural = builder.neural; + this.parentId = builder.parentId; + this.percolate = builder.percolate; + this.prefix = builder.prefix; + this.queryString = builder.queryString; + this.range = builder.range; + this.rankFeature = builder.rankFeature; + this.regexp = builder.regexp; + this.script = builder.script; + this.scriptScore = builder.scriptScore; + this.simpleQueryString = builder.simpleQueryString; + this.spanContaining = builder.spanContaining; + this.spanFirst = builder.spanFirst; + this.spanMulti = builder.spanMulti; + this.spanNear = builder.spanNear; + this.spanNot = builder.spanNot; + this.spanOr = builder.spanOr; + this.spanTerm = builder.spanTerm; + this.spanWithin = builder.spanWithin; + this.template = ApiTypeHelper.unmodifiable(builder.template); + this.term = builder.term; + this.terms = builder.terms; + this.termsSet = builder.termsSet; + this.type = builder.type; + this.wildcard = builder.wildcard; + this.wrapper = builder.wrapper; + this.xyShape = builder.xyShape; + } + + public static FilterAggregationFields of(Function> fn) { + return fn.apply(new Builder()).build(); + } + + /** + * API name: {@code agentic} + */ + @Nullable + public final AgenticQuery agentic() { + return this.agentic; + } + + /** + * API name: {@code bool} + */ + @Nullable + public final BoolQuery bool() { + return this.bool; + } + + /** + * API name: {@code boosting} + */ + @Nullable + public final BoostingQuery boosting() { + return this.boosting; + } + + /** + * API name: {@code combined_fields} + */ + @Nullable + public final CombinedFieldsQuery combinedFields() { + return this.combinedFields; + } + + /** + * API name: {@code common} + */ + @Nullable + public final CommonTermsQuery common() { + return this.common; + } + + /** + * API name: {@code constant_score} + */ + @Nullable + public final ConstantScoreQuery constantScore() { + return this.constantScore; + } + + /** + * API name: {@code dis_max} + */ + @Nullable + public final DisMaxQuery disMax() { + return this.disMax; + } + + /** + * API name: {@code distance_feature} + */ + @Nullable + public final DistanceFeatureQuery distanceFeature() { + return this.distanceFeature; + } + + /** + * API name: {@code exists} + */ + @Nullable + public final ExistsQuery exists() { + return this.exists; + } + + /** + * API name: {@code field_masking_span} + */ + @Nullable + public final SpanFieldMaskingQuery fieldMaskingSpan() { + return this.fieldMaskingSpan; + } + + /** + * API name: {@code function_score} + */ + @Nullable + public final FunctionScoreQuery functionScore() { + return this.functionScore; + } + + /** + * Returns documents that contain terms similar to the search term, as measured by a Levenshtein edit distance. + *

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

+ */ + @Nullable + public final FuzzyQuery fuzzy() { + return this.fuzzy; + } + + /** + * API name: {@code geo_bounding_box} + */ + @Nullable + public final GeoBoundingBoxQuery geoBoundingBox() { + return this.geoBoundingBox; + } + + /** + * API name: {@code geo_distance} + */ + @Nullable + public final GeoDistanceQuery geoDistance() { + return this.geoDistance; + } + + /** + * API name: {@code geo_polygon} + */ + @Nullable + public final GeoPolygonQuery geoPolygon() { + return this.geoPolygon; + } + + /** + * API name: {@code geo_shape} + */ + @Nullable + public final GeoShapeQuery geoShape() { + return this.geoShape; + } + + /** + * API name: {@code has_child} + */ + @Nullable + public final HasChildQuery hasChild() { + return this.hasChild; + } + + /** + * API name: {@code has_parent} + */ + @Nullable + public final HasParentQuery hasParent() { + return this.hasParent; + } + + /** + * API name: {@code hybrid} + */ + @Nullable + public final HybridQuery hybrid() { + return this.hybrid; + } + + /** + * API name: {@code ids} + */ + @Nullable + public final IdsQuery ids() { + return this.ids; + } + + /** + * Returns documents based on the order and proximity of matching terms. + *

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

+ */ + @Nullable + public final IntervalsQuery intervals() { + return this.intervals; + } + + /** + * API name: {@code knn} + */ + @Nullable + public final KnnQuery knn() { + return this.knn; + } + + /** + * Returns documents that match a provided text, number, date or Boolean value. The provided text is analyzed before matching. + *

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

+ */ + @Nullable + public final MatchQuery match() { + return this.match; + } + + /** + * API name: {@code match_all} + */ + @Nullable + public final MatchAllQuery matchAll() { + return this.matchAll; + } + + /** + * Analyzes its input and constructs a bool query from the terms. Each term except the last is used in a term + * query. The last term is used in a prefix query. + *

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

+ */ + @Nullable + public final MatchBoolPrefixQuery matchBoolPrefix() { + return this.matchBoolPrefix; + } + + /** + * API name: {@code match_none} + */ + @Nullable + public final MatchNoneQuery matchNone() { + return this.matchNone; + } + + /** + * Analyzes the text and creates a phrase query out of the analyzed text. + *

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

+ */ + @Nullable + public final MatchPhraseQuery matchPhrase() { + return this.matchPhrase; + } + + /** + * Returns documents that contain the words of a provided text, in the same order as provided. The last term of the provided text is + * treated as a prefix, matching any words that begin with that term. + *

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

+ */ + @Nullable + public final MatchPhrasePrefixQuery matchPhrasePrefix() { + return this.matchPhrasePrefix; + } + + /** + * API name: {@code more_like_this} + */ + @Nullable + public final MoreLikeThisQuery moreLikeThis() { + return this.moreLikeThis; + } + + /** + * API name: {@code multi_match} + */ + @Nullable + public final MultiMatchQuery multiMatch() { + return this.multiMatch; + } + + /** + * API name: {@code nested} + */ + @Nullable + public final NestedQuery nested() { + return this.nested; + } + + /** + * API name: {@code neural} + */ + @Nullable + public final NeuralQuery neural() { + return this.neural; + } + + /** + * API name: {@code parent_id} + */ + @Nullable + public final ParentIdQuery parentId() { + return this.parentId; + } + + /** + * API name: {@code percolate} + */ + @Nullable + public final PercolateQuery percolate() { + return this.percolate; + } + + /** + * Returns documents that contain a specific prefix in a provided field. + *

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

+ */ + @Nullable + public final PrefixQuery prefix() { + return this.prefix; + } + + /** + * API name: {@code query_string} + */ + @Nullable + public final QueryStringQuery queryString() { + return this.queryString; + } + + /** + * Returns documents that contain terms within a provided range. + *

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

+ */ + @Nullable + public final RangeQuery range() { + return this.range; + } + + /** + * API name: {@code rank_feature} + */ + @Nullable + public final RankFeatureQuery rankFeature() { + return this.rankFeature; + } + + /** + * Returns documents that contain terms matching a regular expression. + *

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

+ */ + @Nullable + public final RegexpQuery regexp() { + return this.regexp; + } + + /** + * API name: {@code script} + */ + @Nullable + public final ScriptQuery script() { + return this.script; + } + + /** + * API name: {@code script_score} + */ + @Nullable + public final ScriptScoreQuery scriptScore() { + return this.scriptScore; + } + + /** + * API name: {@code simple_query_string} + */ + @Nullable + public final SimpleQueryStringQuery simpleQueryString() { + return this.simpleQueryString; + } + + /** + * API name: {@code span_containing} + */ + @Nullable + public final SpanContainingQuery spanContaining() { + return this.spanContaining; + } + + /** + * API name: {@code span_first} + */ + @Nullable + public final SpanFirstQuery spanFirst() { + return this.spanFirst; + } + + /** + * API name: {@code span_multi} + */ + @Nullable + public final SpanMultiTermQuery spanMulti() { + return this.spanMulti; + } + + /** + * API name: {@code span_near} + */ + @Nullable + public final SpanNearQuery spanNear() { + return this.spanNear; + } + + /** + * API name: {@code span_not} + */ + @Nullable + public final SpanNotQuery spanNot() { + return this.spanNot; + } + + /** + * API name: {@code span_or} + */ + @Nullable + public final SpanOrQuery spanOr() { + return this.spanOr; + } + + /** + * Matches spans containing a term. + *

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

+ */ + @Nullable + public final SpanTermQuery spanTerm() { + return this.spanTerm; + } + + /** + * API name: {@code span_within} + */ + @Nullable + public final SpanWithinQuery spanWithin() { + return this.spanWithin; + } + + /** + * Return documents using a template query contains placeholders that are resolved by search request processors during query execution. + *

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

+ */ + @Nonnull + public final Map template() { + return this.template; + } + + /** + * Returns documents that contain an exact term in a provided field. To return a document, the query term must exactly match the queried + * field's value, including white space and capitalization. + *

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

+ */ + @Nullable + public final TermQuery term() { + return this.term; + } + + /** + * Returns documents that contain one or more exact terms in a provided field. + *

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

+ */ + @Nullable + public final TermsQuery terms() { + return this.terms; + } + + /** + * Returns documents that contain a minimum number of exact terms in a provided field. To return a document, a required number of terms + * must exactly match the field values, including white space and capitalization. + *

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

+ */ + @Nullable + public final TermsSetQuery termsSet() { + return this.termsSet; + } + + /** + * API name: {@code type} + */ + @Nullable + public final TypeQuery type() { + return this.type; + } + + /** + * Returns documents that contain terms matching a wildcard pattern. + *

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

+ */ + @Nullable + public final WildcardQuery wildcard() { + return this.wildcard; + } + + /** + * API name: {@code wrapper} + */ + @Nullable + public final WrapperQuery wrapper() { + return this.wrapper; + } + + /** + * API name: {@code xy_shape} + */ + @Nullable + public final XyShapeQuery xyShape() { + return this.xyShape; + } + + /** + * Serialize this object to JSON. + */ + @Override + public void serialize(JsonGenerator generator, JsonpMapper mapper) { + generator.writeStartObject(); + serializeInternal(generator, mapper); + generator.writeEnd(); + } + + protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { + if (this.agentic != null) { + generator.writeKey("agentic"); + this.agentic.serialize(generator, mapper); + } + + if (this.bool != null) { + generator.writeKey("bool"); + this.bool.serialize(generator, mapper); + } + + if (this.boosting != null) { + generator.writeKey("boosting"); + this.boosting.serialize(generator, mapper); + } + + if (this.combinedFields != null) { + generator.writeKey("combined_fields"); + this.combinedFields.serialize(generator, mapper); + } + + if (this.common != null) { + generator.writeKey("common"); + this.common.serialize(generator, mapper); + } + + if (this.constantScore != null) { + generator.writeKey("constant_score"); + this.constantScore.serialize(generator, mapper); + } + + if (this.disMax != null) { + generator.writeKey("dis_max"); + this.disMax.serialize(generator, mapper); + } + + if (this.distanceFeature != null) { + generator.writeKey("distance_feature"); + this.distanceFeature.serialize(generator, mapper); + } + + if (this.exists != null) { + generator.writeKey("exists"); + this.exists.serialize(generator, mapper); + } + + if (this.fieldMaskingSpan != null) { + generator.writeKey("field_masking_span"); + this.fieldMaskingSpan.serialize(generator, mapper); + } + + if (this.functionScore != null) { + generator.writeKey("function_score"); + this.functionScore.serialize(generator, mapper); + } + + if (this.fuzzy != null) { + generator.writeKey("fuzzy"); + this.fuzzy.serialize(generator, mapper); + } + + if (this.geoBoundingBox != null) { + generator.writeKey("geo_bounding_box"); + this.geoBoundingBox.serialize(generator, mapper); + } + + if (this.geoDistance != null) { + generator.writeKey("geo_distance"); + this.geoDistance.serialize(generator, mapper); + } + + if (this.geoPolygon != null) { + generator.writeKey("geo_polygon"); + this.geoPolygon.serialize(generator, mapper); + } + + if (this.geoShape != null) { + generator.writeKey("geo_shape"); + this.geoShape.serialize(generator, mapper); + } + + if (this.hasChild != null) { + generator.writeKey("has_child"); + this.hasChild.serialize(generator, mapper); + } + + if (this.hasParent != null) { + generator.writeKey("has_parent"); + this.hasParent.serialize(generator, mapper); + } + + if (this.hybrid != null) { + generator.writeKey("hybrid"); + this.hybrid.serialize(generator, mapper); + } + + if (this.ids != null) { + generator.writeKey("ids"); + this.ids.serialize(generator, mapper); + } + + if (this.intervals != null) { + generator.writeKey("intervals"); + this.intervals.serialize(generator, mapper); + } + + if (this.knn != null) { + generator.writeKey("knn"); + this.knn.serialize(generator, mapper); + } + + if (this.match != null) { + generator.writeKey("match"); + this.match.serialize(generator, mapper); + } + + if (this.matchAll != null) { + generator.writeKey("match_all"); + this.matchAll.serialize(generator, mapper); + } + + if (this.matchBoolPrefix != null) { + generator.writeKey("match_bool_prefix"); + this.matchBoolPrefix.serialize(generator, mapper); + } + + if (this.matchNone != null) { + generator.writeKey("match_none"); + this.matchNone.serialize(generator, mapper); + } + + if (this.matchPhrase != null) { + generator.writeKey("match_phrase"); + this.matchPhrase.serialize(generator, mapper); + } + + if (this.matchPhrasePrefix != null) { + generator.writeKey("match_phrase_prefix"); + this.matchPhrasePrefix.serialize(generator, mapper); + } + + if (this.moreLikeThis != null) { + generator.writeKey("more_like_this"); + this.moreLikeThis.serialize(generator, mapper); + } + + if (this.multiMatch != null) { + generator.writeKey("multi_match"); + this.multiMatch.serialize(generator, mapper); + } + + if (this.nested != null) { + generator.writeKey("nested"); + this.nested.serialize(generator, mapper); + } + + if (this.neural != null) { + generator.writeKey("neural"); + this.neural.serialize(generator, mapper); + } + + if (this.parentId != null) { + generator.writeKey("parent_id"); + this.parentId.serialize(generator, mapper); + } + + if (this.percolate != null) { + generator.writeKey("percolate"); + this.percolate.serialize(generator, mapper); + } + + if (this.prefix != null) { + generator.writeKey("prefix"); + this.prefix.serialize(generator, mapper); + } + + if (this.queryString != null) { + generator.writeKey("query_string"); + this.queryString.serialize(generator, mapper); + } + + if (this.range != null) { + generator.writeKey("range"); + this.range.serialize(generator, mapper); + } + + if (this.rankFeature != null) { + generator.writeKey("rank_feature"); + this.rankFeature.serialize(generator, mapper); + } + + if (this.regexp != null) { + generator.writeKey("regexp"); + this.regexp.serialize(generator, mapper); + } + + if (this.script != null) { + generator.writeKey("script"); + this.script.serialize(generator, mapper); + } + + if (this.scriptScore != null) { + generator.writeKey("script_score"); + this.scriptScore.serialize(generator, mapper); + } + + if (this.simpleQueryString != null) { + generator.writeKey("simple_query_string"); + this.simpleQueryString.serialize(generator, mapper); + } + + if (this.spanContaining != null) { + generator.writeKey("span_containing"); + this.spanContaining.serialize(generator, mapper); + } + + if (this.spanFirst != null) { + generator.writeKey("span_first"); + this.spanFirst.serialize(generator, mapper); + } + + if (this.spanMulti != null) { + generator.writeKey("span_multi"); + this.spanMulti.serialize(generator, mapper); + } + + if (this.spanNear != null) { + generator.writeKey("span_near"); + this.spanNear.serialize(generator, mapper); + } + + if (this.spanNot != null) { + generator.writeKey("span_not"); + this.spanNot.serialize(generator, mapper); + } + + if (this.spanOr != null) { + generator.writeKey("span_or"); + this.spanOr.serialize(generator, mapper); + } + + if (this.spanTerm != null) { + generator.writeKey("span_term"); + this.spanTerm.serialize(generator, mapper); + } + + if (this.spanWithin != null) { + generator.writeKey("span_within"); + this.spanWithin.serialize(generator, mapper); + } + + if (ApiTypeHelper.isDefined(this.template)) { + generator.writeKey("template"); + generator.writeStartObject(); + for (Map.Entry item0 : this.template.entrySet()) { + generator.writeKey(item0.getKey()); + item0.getValue().serialize(generator, mapper); + } + generator.writeEnd(); + } + + if (this.term != null) { + generator.writeKey("term"); + this.term.serialize(generator, mapper); + } + + if (this.terms != null) { + generator.writeKey("terms"); + this.terms.serialize(generator, mapper); + } + + if (this.termsSet != null) { + generator.writeKey("terms_set"); + this.termsSet.serialize(generator, mapper); + } + + if (this.type != null) { + generator.writeKey("type"); + this.type.serialize(generator, mapper); + } + + if (this.wildcard != null) { + generator.writeKey("wildcard"); + this.wildcard.serialize(generator, mapper); + } + + if (this.wrapper != null) { + generator.writeKey("wrapper"); + this.wrapper.serialize(generator, mapper); + } + + if (this.xyShape != null) { + generator.writeKey("xy_shape"); + this.xyShape.serialize(generator, mapper); + } + } + + // --------------------------------------------------------------------------------------------- + + @Override + @Nonnull + public Builder toBuilder() { + return new Builder(this); + } + + @Nonnull + public static Builder builder() { + return new Builder(); + } + + /** + * Builder for {@link FilterAggregationFields}. + */ + public static class Builder extends ObjectBuilderBase implements CopyableBuilder { + @Nullable + private AgenticQuery agentic; + @Nullable + private BoolQuery bool; + @Nullable + private BoostingQuery boosting; + @Nullable + private CombinedFieldsQuery combinedFields; + @Nullable + private CommonTermsQuery common; + @Nullable + private ConstantScoreQuery constantScore; + @Nullable + private DisMaxQuery disMax; + @Nullable + private DistanceFeatureQuery distanceFeature; + @Nullable + private ExistsQuery exists; + @Nullable + private SpanFieldMaskingQuery fieldMaskingSpan; + @Nullable + private FunctionScoreQuery functionScore; + @Nullable + private FuzzyQuery fuzzy; + @Nullable + private GeoBoundingBoxQuery geoBoundingBox; + @Nullable + private GeoDistanceQuery geoDistance; + @Nullable + private GeoPolygonQuery geoPolygon; + @Nullable + private GeoShapeQuery geoShape; + @Nullable + private HasChildQuery hasChild; + @Nullable + private HasParentQuery hasParent; + @Nullable + private HybridQuery hybrid; + @Nullable + private IdsQuery ids; + @Nullable + private IntervalsQuery intervals; + @Nullable + private KnnQuery knn; + @Nullable + private MatchQuery match; + @Nullable + private MatchAllQuery matchAll; + @Nullable + private MatchBoolPrefixQuery matchBoolPrefix; + @Nullable + private MatchNoneQuery matchNone; + @Nullable + private MatchPhraseQuery matchPhrase; + @Nullable + private MatchPhrasePrefixQuery matchPhrasePrefix; + @Nullable + private MoreLikeThisQuery moreLikeThis; + @Nullable + private MultiMatchQuery multiMatch; + @Nullable + private NestedQuery nested; + @Nullable + private NeuralQuery neural; + @Nullable + private ParentIdQuery parentId; + @Nullable + private PercolateQuery percolate; + @Nullable + private PrefixQuery prefix; + @Nullable + private QueryStringQuery queryString; + @Nullable + private RangeQuery range; + @Nullable + private RankFeatureQuery rankFeature; + @Nullable + private RegexpQuery regexp; + @Nullable + private ScriptQuery script; + @Nullable + private ScriptScoreQuery scriptScore; + @Nullable + private SimpleQueryStringQuery simpleQueryString; + @Nullable + private SpanContainingQuery spanContaining; + @Nullable + private SpanFirstQuery spanFirst; + @Nullable + private SpanMultiTermQuery spanMulti; + @Nullable + private SpanNearQuery spanNear; + @Nullable + private SpanNotQuery spanNot; + @Nullable + private SpanOrQuery spanOr; + @Nullable + private SpanTermQuery spanTerm; + @Nullable + private SpanWithinQuery spanWithin; + @Nullable + private Map template; + @Nullable + private TermQuery term; + @Nullable + private TermsQuery terms; + @Nullable + private TermsSetQuery termsSet; + @Nullable + private TypeQuery type; + @Nullable + private WildcardQuery wildcard; + @Nullable + private WrapperQuery wrapper; + @Nullable + private XyShapeQuery xyShape; + + public Builder() {} + + private Builder(FilterAggregationFields o) { + this.agentic = o.agentic; + this.bool = o.bool; + this.boosting = o.boosting; + this.combinedFields = o.combinedFields; + this.common = o.common; + this.constantScore = o.constantScore; + this.disMax = o.disMax; + this.distanceFeature = o.distanceFeature; + this.exists = o.exists; + this.fieldMaskingSpan = o.fieldMaskingSpan; + this.functionScore = o.functionScore; + this.fuzzy = o.fuzzy; + this.geoBoundingBox = o.geoBoundingBox; + this.geoDistance = o.geoDistance; + this.geoPolygon = o.geoPolygon; + this.geoShape = o.geoShape; + this.hasChild = o.hasChild; + this.hasParent = o.hasParent; + this.hybrid = o.hybrid; + this.ids = o.ids; + this.intervals = o.intervals; + this.knn = o.knn; + this.match = o.match; + this.matchAll = o.matchAll; + this.matchBoolPrefix = o.matchBoolPrefix; + this.matchNone = o.matchNone; + this.matchPhrase = o.matchPhrase; + this.matchPhrasePrefix = o.matchPhrasePrefix; + this.moreLikeThis = o.moreLikeThis; + this.multiMatch = o.multiMatch; + this.nested = o.nested; + this.neural = o.neural; + this.parentId = o.parentId; + this.percolate = o.percolate; + this.prefix = o.prefix; + this.queryString = o.queryString; + this.range = o.range; + this.rankFeature = o.rankFeature; + this.regexp = o.regexp; + this.script = o.script; + this.scriptScore = o.scriptScore; + this.simpleQueryString = o.simpleQueryString; + this.spanContaining = o.spanContaining; + this.spanFirst = o.spanFirst; + this.spanMulti = o.spanMulti; + this.spanNear = o.spanNear; + this.spanNot = o.spanNot; + this.spanOr = o.spanOr; + this.spanTerm = o.spanTerm; + this.spanWithin = o.spanWithin; + this.template = _mapCopy(o.template); + this.term = o.term; + this.terms = o.terms; + this.termsSet = o.termsSet; + this.type = o.type; + this.wildcard = o.wildcard; + this.wrapper = o.wrapper; + this.xyShape = o.xyShape; + } + + private Builder(Builder o) { + this.agentic = o.agentic; + this.bool = o.bool; + this.boosting = o.boosting; + this.combinedFields = o.combinedFields; + this.common = o.common; + this.constantScore = o.constantScore; + this.disMax = o.disMax; + this.distanceFeature = o.distanceFeature; + this.exists = o.exists; + this.fieldMaskingSpan = o.fieldMaskingSpan; + this.functionScore = o.functionScore; + this.fuzzy = o.fuzzy; + this.geoBoundingBox = o.geoBoundingBox; + this.geoDistance = o.geoDistance; + this.geoPolygon = o.geoPolygon; + this.geoShape = o.geoShape; + this.hasChild = o.hasChild; + this.hasParent = o.hasParent; + this.hybrid = o.hybrid; + this.ids = o.ids; + this.intervals = o.intervals; + this.knn = o.knn; + this.match = o.match; + this.matchAll = o.matchAll; + this.matchBoolPrefix = o.matchBoolPrefix; + this.matchNone = o.matchNone; + this.matchPhrase = o.matchPhrase; + this.matchPhrasePrefix = o.matchPhrasePrefix; + this.moreLikeThis = o.moreLikeThis; + this.multiMatch = o.multiMatch; + this.nested = o.nested; + this.neural = o.neural; + this.parentId = o.parentId; + this.percolate = o.percolate; + this.prefix = o.prefix; + this.queryString = o.queryString; + this.range = o.range; + this.rankFeature = o.rankFeature; + this.regexp = o.regexp; + this.script = o.script; + this.scriptScore = o.scriptScore; + this.simpleQueryString = o.simpleQueryString; + this.spanContaining = o.spanContaining; + this.spanFirst = o.spanFirst; + this.spanMulti = o.spanMulti; + this.spanNear = o.spanNear; + this.spanNot = o.spanNot; + this.spanOr = o.spanOr; + this.spanTerm = o.spanTerm; + this.spanWithin = o.spanWithin; + this.template = _mapCopy(o.template); + this.term = o.term; + this.terms = o.terms; + this.termsSet = o.termsSet; + this.type = o.type; + this.wildcard = o.wildcard; + this.wrapper = o.wrapper; + this.xyShape = o.xyShape; + } + + @Override + @Nonnull + public Builder copy() { + return new Builder(this); + } + + /** + * API name: {@code agentic} + */ + @Nonnull + public final Builder agentic(@Nullable AgenticQuery value) { + this.agentic = value; + return this; + } + + /** + * API name: {@code agentic} + */ + @Nonnull + public final Builder agentic(Function> fn) { + return agentic(fn.apply(new AgenticQuery.Builder()).build()); + } + + /** + * API name: {@code bool} + */ + @Nonnull + public final Builder bool(@Nullable BoolQuery value) { + this.bool = value; + return this; + } + + /** + * API name: {@code bool} + */ + @Nonnull + public final Builder bool(Function> fn) { + return bool(fn.apply(new BoolQuery.Builder()).build()); + } + + /** + * API name: {@code boosting} + */ + @Nonnull + public final Builder boosting(@Nullable BoostingQuery value) { + this.boosting = value; + return this; + } + + /** + * API name: {@code boosting} + */ + @Nonnull + public final Builder boosting(Function> fn) { + return boosting(fn.apply(new BoostingQuery.Builder()).build()); + } + + /** + * API name: {@code combined_fields} + */ + @Nonnull + public final Builder combinedFields(@Nullable CombinedFieldsQuery value) { + this.combinedFields = value; + return this; + } + + /** + * API name: {@code combined_fields} + */ + @Nonnull + public final Builder combinedFields(Function> fn) { + return combinedFields(fn.apply(new CombinedFieldsQuery.Builder()).build()); + } + + /** + * API name: {@code common} + */ + @Nonnull + public final Builder common(@Nullable CommonTermsQuery value) { + this.common = value; + return this; + } + + /** + * API name: {@code common} + */ + @Nonnull + public final Builder common(Function> fn) { + return common(fn.apply(new CommonTermsQuery.Builder()).build()); + } + + /** + * API name: {@code constant_score} + */ + @Nonnull + public final Builder constantScore(@Nullable ConstantScoreQuery value) { + this.constantScore = value; + return this; + } + + /** + * API name: {@code constant_score} + */ + @Nonnull + public final Builder constantScore(Function> fn) { + return constantScore(fn.apply(new ConstantScoreQuery.Builder()).build()); + } + + /** + * API name: {@code dis_max} + */ + @Nonnull + public final Builder disMax(@Nullable DisMaxQuery value) { + this.disMax = value; + return this; + } + + /** + * API name: {@code dis_max} + */ + @Nonnull + public final Builder disMax(Function> fn) { + return disMax(fn.apply(new DisMaxQuery.Builder()).build()); + } + + /** + * API name: {@code distance_feature} + */ + @Nonnull + public final Builder distanceFeature(@Nullable DistanceFeatureQuery value) { + this.distanceFeature = value; + return this; + } + + /** + * API name: {@code distance_feature} + */ + @Nonnull + public final Builder distanceFeature(Function> fn) { + return distanceFeature(fn.apply(new DistanceFeatureQuery.Builder()).build()); + } + + /** + * API name: {@code exists} + */ + @Nonnull + public final Builder exists(@Nullable ExistsQuery value) { + this.exists = value; + return this; + } + + /** + * API name: {@code exists} + */ + @Nonnull + public final Builder exists(Function> fn) { + return exists(fn.apply(new ExistsQuery.Builder()).build()); + } + + /** + * API name: {@code field_masking_span} + */ + @Nonnull + public final Builder fieldMaskingSpan(@Nullable SpanFieldMaskingQuery value) { + this.fieldMaskingSpan = value; + return this; + } + + /** + * API name: {@code field_masking_span} + */ + @Nonnull + public final Builder fieldMaskingSpan(Function> fn) { + return fieldMaskingSpan(fn.apply(new SpanFieldMaskingQuery.Builder()).build()); + } + + /** + * API name: {@code function_score} + */ + @Nonnull + public final Builder functionScore(@Nullable FunctionScoreQuery value) { + this.functionScore = value; + return this; + } + + /** + * API name: {@code function_score} + */ + @Nonnull + public final Builder functionScore(Function> fn) { + return functionScore(fn.apply(new FunctionScoreQuery.Builder()).build()); + } + + /** + * Returns documents that contain terms similar to the search term, as measured by a Levenshtein edit distance. + *

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

+ */ + @Nonnull + public final Builder fuzzy(@Nullable FuzzyQuery value) { + this.fuzzy = value; + return this; + } + + /** + * Returns documents that contain terms similar to the search term, as measured by a Levenshtein edit distance. + *

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

+ */ + @Nonnull + public final Builder fuzzy(Function> fn) { + return fuzzy(fn.apply(new FuzzyQuery.Builder()).build()); + } + + /** + * API name: {@code geo_bounding_box} + */ + @Nonnull + public final Builder geoBoundingBox(@Nullable GeoBoundingBoxQuery value) { + this.geoBoundingBox = value; + return this; + } + + /** + * API name: {@code geo_bounding_box} + */ + @Nonnull + public final Builder geoBoundingBox(Function> fn) { + return geoBoundingBox(fn.apply(new GeoBoundingBoxQuery.Builder()).build()); + } + + /** + * API name: {@code geo_distance} + */ + @Nonnull + public final Builder geoDistance(@Nullable GeoDistanceQuery value) { + this.geoDistance = value; + return this; + } + + /** + * API name: {@code geo_distance} + */ + @Nonnull + public final Builder geoDistance(Function> fn) { + return geoDistance(fn.apply(new GeoDistanceQuery.Builder()).build()); + } + + /** + * API name: {@code geo_polygon} + */ + @Nonnull + public final Builder geoPolygon(@Nullable GeoPolygonQuery value) { + this.geoPolygon = value; + return this; + } + + /** + * API name: {@code geo_polygon} + */ + @Nonnull + public final Builder geoPolygon(Function> fn) { + return geoPolygon(fn.apply(new GeoPolygonQuery.Builder()).build()); + } + + /** + * API name: {@code geo_shape} + */ + @Nonnull + public final Builder geoShape(@Nullable GeoShapeQuery value) { + this.geoShape = value; + return this; + } + + /** + * API name: {@code geo_shape} + */ + @Nonnull + public final Builder geoShape(Function> fn) { + return geoShape(fn.apply(new GeoShapeQuery.Builder()).build()); + } + + /** + * API name: {@code has_child} + */ + @Nonnull + public final Builder hasChild(@Nullable HasChildQuery value) { + this.hasChild = value; + return this; + } + + /** + * API name: {@code has_child} + */ + @Nonnull + public final Builder hasChild(Function> fn) { + return hasChild(fn.apply(new HasChildQuery.Builder()).build()); + } + + /** + * API name: {@code has_parent} + */ + @Nonnull + public final Builder hasParent(@Nullable HasParentQuery value) { + this.hasParent = value; + return this; + } + + /** + * API name: {@code has_parent} + */ + @Nonnull + public final Builder hasParent(Function> fn) { + return hasParent(fn.apply(new HasParentQuery.Builder()).build()); + } + + /** + * API name: {@code hybrid} + */ + @Nonnull + public final Builder hybrid(@Nullable HybridQuery value) { + this.hybrid = value; + return this; + } + + /** + * API name: {@code hybrid} + */ + @Nonnull + public final Builder hybrid(Function> fn) { + return hybrid(fn.apply(new HybridQuery.Builder()).build()); + } + + /** + * API name: {@code ids} + */ + @Nonnull + public final Builder ids(@Nullable IdsQuery value) { + this.ids = value; + return this; + } + + /** + * API name: {@code ids} + */ + @Nonnull + public final Builder ids(Function> fn) { + return ids(fn.apply(new IdsQuery.Builder()).build()); + } + + /** + * Returns documents based on the order and proximity of matching terms. + *

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

+ */ + @Nonnull + public final Builder intervals(@Nullable IntervalsQuery value) { + this.intervals = value; + return this; + } + + /** + * Returns documents based on the order and proximity of matching terms. + *

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

+ */ + @Nonnull + public final Builder intervals(Function> fn) { + return intervals(fn.apply(new IntervalsQuery.Builder()).build()); + } + + /** + * API name: {@code knn} + */ + @Nonnull + public final Builder knn(@Nullable KnnQuery value) { + this.knn = value; + return this; + } + + /** + * API name: {@code knn} + */ + @Nonnull + public final Builder knn(Function> fn) { + return knn(fn.apply(new KnnQuery.Builder()).build()); + } + + /** + * Returns documents that match a provided text, number, date or Boolean value. The provided text is analyzed before matching. + *

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

+ */ + @Nonnull + public final Builder match(@Nullable MatchQuery value) { + this.match = value; + return this; + } + + /** + * Returns documents that match a provided text, number, date or Boolean value. The provided text is analyzed before matching. + *

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

+ */ + @Nonnull + public final Builder match(Function> fn) { + return match(fn.apply(new MatchQuery.Builder()).build()); + } + + /** + * API name: {@code match_all} + */ + @Nonnull + public final Builder matchAll(@Nullable MatchAllQuery value) { + this.matchAll = value; + return this; + } + + /** + * API name: {@code match_all} + */ + @Nonnull + public final Builder matchAll(Function> fn) { + return matchAll(fn.apply(new MatchAllQuery.Builder()).build()); + } + + /** + * Analyzes its input and constructs a bool query from the terms. Each term except the last is used in a + * term query. The last term is used in a prefix query. + *

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

+ */ + @Nonnull + public final Builder matchBoolPrefix(@Nullable MatchBoolPrefixQuery value) { + this.matchBoolPrefix = value; + return this; + } + + /** + * Analyzes its input and constructs a bool query from the terms. Each term except the last is used in a + * term query. The last term is used in a prefix query. + *

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

+ */ + @Nonnull + public final Builder matchBoolPrefix(Function> fn) { + return matchBoolPrefix(fn.apply(new MatchBoolPrefixQuery.Builder()).build()); + } + + /** + * API name: {@code match_none} + */ + @Nonnull + public final Builder matchNone(@Nullable MatchNoneQuery value) { + this.matchNone = value; + return this; + } + + /** + * API name: {@code match_none} + */ + @Nonnull + public final Builder matchNone(Function> fn) { + return matchNone(fn.apply(new MatchNoneQuery.Builder()).build()); + } + + /** + * Analyzes the text and creates a phrase query out of the analyzed text. + *

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

+ */ + @Nonnull + public final Builder matchPhrase(@Nullable MatchPhraseQuery value) { + this.matchPhrase = value; + return this; + } + + /** + * Analyzes the text and creates a phrase query out of the analyzed text. + *

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

+ */ + @Nonnull + public final Builder matchPhrase(Function> fn) { + return matchPhrase(fn.apply(new MatchPhraseQuery.Builder()).build()); + } + + /** + * Returns documents that contain the words of a provided text, in the same order as provided. The last term of the provided text is + * treated as a prefix, matching any words that begin with that term. + *

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

+ */ + @Nonnull + public final Builder matchPhrasePrefix(@Nullable MatchPhrasePrefixQuery value) { + this.matchPhrasePrefix = value; + return this; + } + + /** + * Returns documents that contain the words of a provided text, in the same order as provided. The last term of the provided text is + * treated as a prefix, matching any words that begin with that term. + *

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

+ */ + @Nonnull + public final Builder matchPhrasePrefix(Function> fn) { + return matchPhrasePrefix(fn.apply(new MatchPhrasePrefixQuery.Builder()).build()); + } + + /** + * API name: {@code more_like_this} + */ + @Nonnull + public final Builder moreLikeThis(@Nullable MoreLikeThisQuery value) { + this.moreLikeThis = value; + return this; + } + + /** + * API name: {@code more_like_this} + */ + @Nonnull + public final Builder moreLikeThis(Function> fn) { + return moreLikeThis(fn.apply(new MoreLikeThisQuery.Builder()).build()); + } + + /** + * API name: {@code multi_match} + */ + @Nonnull + public final Builder multiMatch(@Nullable MultiMatchQuery value) { + this.multiMatch = value; + return this; + } + + /** + * API name: {@code multi_match} + */ + @Nonnull + public final Builder multiMatch(Function> fn) { + return multiMatch(fn.apply(new MultiMatchQuery.Builder()).build()); + } + + /** + * API name: {@code nested} + */ + @Nonnull + public final Builder nested(@Nullable NestedQuery value) { + this.nested = value; + return this; + } + + /** + * API name: {@code nested} + */ + @Nonnull + public final Builder nested(Function> fn) { + return nested(fn.apply(new NestedQuery.Builder()).build()); + } + + /** + * API name: {@code neural} + */ + @Nonnull + public final Builder neural(@Nullable NeuralQuery value) { + this.neural = value; + return this; + } + + /** + * API name: {@code neural} + */ + @Nonnull + public final Builder neural(Function> fn) { + return neural(fn.apply(new NeuralQuery.Builder()).build()); + } + + /** + * API name: {@code parent_id} + */ + @Nonnull + public final Builder parentId(@Nullable ParentIdQuery value) { + this.parentId = value; + return this; + } + + /** + * API name: {@code parent_id} + */ + @Nonnull + public final Builder parentId(Function> fn) { + return parentId(fn.apply(new ParentIdQuery.Builder()).build()); + } + + /** + * API name: {@code percolate} + */ + @Nonnull + public final Builder percolate(@Nullable PercolateQuery value) { + this.percolate = value; + return this; + } + + /** + * API name: {@code percolate} + */ + @Nonnull + public final Builder percolate(Function> fn) { + return percolate(fn.apply(new PercolateQuery.Builder()).build()); + } + + /** + * Returns documents that contain a specific prefix in a provided field. + *

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

+ */ + @Nonnull + public final Builder prefix(@Nullable PrefixQuery value) { + this.prefix = value; + return this; + } + + /** + * Returns documents that contain a specific prefix in a provided field. + *

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

+ */ + @Nonnull + public final Builder prefix(Function> fn) { + return prefix(fn.apply(new PrefixQuery.Builder()).build()); + } + + /** + * API name: {@code query_string} + */ + @Nonnull + public final Builder queryString(@Nullable QueryStringQuery value) { + this.queryString = value; + return this; + } + + /** + * API name: {@code query_string} + */ + @Nonnull + public final Builder queryString(Function> fn) { + return queryString(fn.apply(new QueryStringQuery.Builder()).build()); + } + + /** + * Returns documents that contain terms within a provided range. + *

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

+ */ + @Nonnull + public final Builder range(@Nullable RangeQuery value) { + this.range = value; + return this; + } + + /** + * Returns documents that contain terms within a provided range. + *

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

+ */ + @Nonnull + public final Builder range(Function> fn) { + return range(fn.apply(new RangeQuery.Builder()).build()); + } + + /** + * API name: {@code rank_feature} + */ + @Nonnull + public final Builder rankFeature(@Nullable RankFeatureQuery value) { + this.rankFeature = value; + return this; + } + + /** + * API name: {@code rank_feature} + */ + @Nonnull + public final Builder rankFeature(Function> fn) { + return rankFeature(fn.apply(new RankFeatureQuery.Builder()).build()); + } + + /** + * Returns documents that contain terms matching a regular expression. + *

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

+ */ + @Nonnull + public final Builder regexp(@Nullable RegexpQuery value) { + this.regexp = value; + return this; + } + + /** + * Returns documents that contain terms matching a regular expression. + *

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

+ */ + @Nonnull + public final Builder regexp(Function> fn) { + return regexp(fn.apply(new RegexpQuery.Builder()).build()); + } + + /** + * API name: {@code script} + */ + @Nonnull + public final Builder script(@Nullable ScriptQuery value) { + this.script = value; + return this; + } + + /** + * API name: {@code script} + */ + @Nonnull + public final Builder script(Function> fn) { + return script(fn.apply(new ScriptQuery.Builder()).build()); + } + + /** + * API name: {@code script_score} + */ + @Nonnull + public final Builder scriptScore(@Nullable ScriptScoreQuery value) { + this.scriptScore = value; + return this; + } + + /** + * API name: {@code script_score} + */ + @Nonnull + public final Builder scriptScore(Function> fn) { + return scriptScore(fn.apply(new ScriptScoreQuery.Builder()).build()); + } + + /** + * API name: {@code simple_query_string} + */ + @Nonnull + public final Builder simpleQueryString(@Nullable SimpleQueryStringQuery value) { + this.simpleQueryString = value; + return this; + } + + /** + * API name: {@code simple_query_string} + */ + @Nonnull + public final Builder simpleQueryString(Function> fn) { + return simpleQueryString(fn.apply(new SimpleQueryStringQuery.Builder()).build()); + } + + /** + * API name: {@code span_containing} + */ + @Nonnull + public final Builder spanContaining(@Nullable SpanContainingQuery value) { + this.spanContaining = value; + return this; + } + + /** + * API name: {@code span_containing} + */ + @Nonnull + public final Builder spanContaining(Function> fn) { + return spanContaining(fn.apply(new SpanContainingQuery.Builder()).build()); + } + + /** + * API name: {@code span_first} + */ + @Nonnull + public final Builder spanFirst(@Nullable SpanFirstQuery value) { + this.spanFirst = value; + return this; + } + + /** + * API name: {@code span_first} + */ + @Nonnull + public final Builder spanFirst(Function> fn) { + return spanFirst(fn.apply(new SpanFirstQuery.Builder()).build()); + } + + /** + * API name: {@code span_multi} + */ + @Nonnull + public final Builder spanMulti(@Nullable SpanMultiTermQuery value) { + this.spanMulti = value; + return this; + } + + /** + * API name: {@code span_multi} + */ + @Nonnull + public final Builder spanMulti(Function> fn) { + return spanMulti(fn.apply(new SpanMultiTermQuery.Builder()).build()); + } + + /** + * API name: {@code span_near} + */ + @Nonnull + public final Builder spanNear(@Nullable SpanNearQuery value) { + this.spanNear = value; + return this; + } + + /** + * API name: {@code span_near} + */ + @Nonnull + public final Builder spanNear(Function> fn) { + return spanNear(fn.apply(new SpanNearQuery.Builder()).build()); + } + + /** + * API name: {@code span_not} + */ + @Nonnull + public final Builder spanNot(@Nullable SpanNotQuery value) { + this.spanNot = value; + return this; + } + + /** + * API name: {@code span_not} + */ + @Nonnull + public final Builder spanNot(Function> fn) { + return spanNot(fn.apply(new SpanNotQuery.Builder()).build()); + } + + /** + * API name: {@code span_or} + */ + @Nonnull + public final Builder spanOr(@Nullable SpanOrQuery value) { + this.spanOr = value; + return this; + } + + /** + * API name: {@code span_or} + */ + @Nonnull + public final Builder spanOr(Function> fn) { + return spanOr(fn.apply(new SpanOrQuery.Builder()).build()); + } + + /** + * Matches spans containing a term. + *

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

+ */ + @Nonnull + public final Builder spanTerm(@Nullable SpanTermQuery value) { + this.spanTerm = value; + return this; + } + + /** + * Matches spans containing a term. + *

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

+ */ + @Nonnull + public final Builder spanTerm(Function> fn) { + return spanTerm(fn.apply(new SpanTermQuery.Builder()).build()); + } + + /** + * API name: {@code span_within} + */ + @Nonnull + public final Builder spanWithin(@Nullable SpanWithinQuery value) { + this.spanWithin = value; + return this; + } + + /** + * API name: {@code span_within} + */ + @Nonnull + public final Builder spanWithin(Function> fn) { + return spanWithin(fn.apply(new SpanWithinQuery.Builder()).build()); + } + + /** + * Return documents using a template query contains placeholders that are resolved by search request processors during query + * execution. + *

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

+ * + *

+ * Adds all elements of map to template. + *

+ */ + @Nonnull + public final Builder template(Map map) { + this.template = _mapPutAll(this.template, map); + return this; + } + + /** + * Return documents using a template query contains placeholders that are resolved by search request processors during query + * execution. + *

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

+ * + *

+ * Adds an entry to template. + *

+ */ + @Nonnull + public final Builder template(String key, JsonData value) { + this.template = _mapPut(this.template, key, value); + return this; + } + + /** + * Returns documents that contain an exact term in a provided field. To return a document, the query term must exactly match the + * queried field's value, including white space and capitalization. + *

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

+ */ + @Nonnull + public final Builder term(@Nullable TermQuery value) { + this.term = value; + return this; + } + + /** + * Returns documents that contain an exact term in a provided field. To return a document, the query term must exactly match the + * queried field's value, including white space and capitalization. + *

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

+ */ + @Nonnull + public final Builder term(Function> fn) { + return term(fn.apply(new TermQuery.Builder()).build()); + } + + /** + * Returns documents that contain one or more exact terms in a provided field. + *

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

+ */ + @Nonnull + public final Builder terms(@Nullable TermsQuery value) { + this.terms = value; + return this; + } + + /** + * Returns documents that contain one or more exact terms in a provided field. + *

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

+ */ + @Nonnull + public final Builder terms(Function> fn) { + return terms(fn.apply(new TermsQuery.Builder()).build()); + } + + /** + * Returns documents that contain a minimum number of exact terms in a provided field. To return a document, a required number of + * terms must exactly match the field values, including white space and capitalization. + *

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

+ */ + @Nonnull + public final Builder termsSet(@Nullable TermsSetQuery value) { + this.termsSet = value; + return this; + } + + /** + * Returns documents that contain a minimum number of exact terms in a provided field. To return a document, a required number of + * terms must exactly match the field values, including white space and capitalization. + *

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

+ */ + @Nonnull + public final Builder termsSet(Function> fn) { + return termsSet(fn.apply(new TermsSetQuery.Builder()).build()); + } + + /** + * API name: {@code type} + */ + @Nonnull + public final Builder type(@Nullable TypeQuery value) { + this.type = value; + return this; + } + + /** + * API name: {@code type} + */ + @Nonnull + public final Builder type(Function> fn) { + return type(fn.apply(new TypeQuery.Builder()).build()); + } + + /** + * Returns documents that contain terms matching a wildcard pattern. + *

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

+ */ + @Nonnull + public final Builder wildcard(@Nullable WildcardQuery value) { + this.wildcard = value; + return this; + } + + /** + * Returns documents that contain terms matching a wildcard pattern. + *

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

+ */ + @Nonnull + public final Builder wildcard(Function> fn) { + return wildcard(fn.apply(new WildcardQuery.Builder()).build()); + } + + /** + * API name: {@code wrapper} + */ + @Nonnull + public final Builder wrapper(@Nullable WrapperQuery value) { + this.wrapper = value; + return this; + } + + /** + * API name: {@code wrapper} + */ + @Nonnull + public final Builder wrapper(Function> fn) { + return wrapper(fn.apply(new WrapperQuery.Builder()).build()); + } + + /** + * API name: {@code xy_shape} + */ + @Nonnull + public final Builder xyShape(@Nullable XyShapeQuery value) { + this.xyShape = value; + return this; + } + + /** + * API name: {@code xy_shape} + */ + @Nonnull + public final Builder xyShape(Function> fn) { + return xyShape(fn.apply(new XyShapeQuery.Builder()).build()); + } + + /** + * Builds a {@link FilterAggregationFields}. + * + * @throws NullPointerException if some of the required fields are null. + */ + @Override + @Nonnull + public FilterAggregationFields build() { + _checkSingleUse(); + + return new FilterAggregationFields(this); + } + } + + // --------------------------------------------------------------------------------------------- + + /** + * Json deserializer for {@link FilterAggregationFields} + */ + public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer.lazy( + Builder::new, + FilterAggregationFields::setupFilterAggregationFieldsDeserializer + ); + + protected static void setupFilterAggregationFieldsDeserializer(ObjectDeserializer op) { + op.add(Builder::agentic, AgenticQuery._DESERIALIZER, "agentic"); + op.add(Builder::bool, BoolQuery._DESERIALIZER, "bool"); + op.add(Builder::boosting, BoostingQuery._DESERIALIZER, "boosting"); + op.add(Builder::combinedFields, CombinedFieldsQuery._DESERIALIZER, "combined_fields"); + op.add(Builder::common, CommonTermsQuery._DESERIALIZER, "common"); + op.add(Builder::constantScore, ConstantScoreQuery._DESERIALIZER, "constant_score"); + op.add(Builder::disMax, DisMaxQuery._DESERIALIZER, "dis_max"); + op.add(Builder::distanceFeature, DistanceFeatureQuery._DESERIALIZER, "distance_feature"); + op.add(Builder::exists, ExistsQuery._DESERIALIZER, "exists"); + op.add(Builder::fieldMaskingSpan, SpanFieldMaskingQuery._DESERIALIZER, "field_masking_span"); + op.add(Builder::functionScore, FunctionScoreQuery._DESERIALIZER, "function_score"); + op.add(Builder::fuzzy, FuzzyQuery._DESERIALIZER, "fuzzy"); + op.add(Builder::geoBoundingBox, GeoBoundingBoxQuery._DESERIALIZER, "geo_bounding_box"); + op.add(Builder::geoDistance, GeoDistanceQuery._DESERIALIZER, "geo_distance"); + op.add(Builder::geoPolygon, GeoPolygonQuery._DESERIALIZER, "geo_polygon"); + op.add(Builder::geoShape, GeoShapeQuery._DESERIALIZER, "geo_shape"); + op.add(Builder::hasChild, HasChildQuery._DESERIALIZER, "has_child"); + op.add(Builder::hasParent, HasParentQuery._DESERIALIZER, "has_parent"); + op.add(Builder::hybrid, HybridQuery._DESERIALIZER, "hybrid"); + op.add(Builder::ids, IdsQuery._DESERIALIZER, "ids"); + op.add(Builder::intervals, IntervalsQuery._DESERIALIZER, "intervals"); + op.add(Builder::knn, KnnQuery._DESERIALIZER, "knn"); + op.add(Builder::match, MatchQuery._DESERIALIZER, "match"); + op.add(Builder::matchAll, MatchAllQuery._DESERIALIZER, "match_all"); + op.add(Builder::matchBoolPrefix, MatchBoolPrefixQuery._DESERIALIZER, "match_bool_prefix"); + op.add(Builder::matchNone, MatchNoneQuery._DESERIALIZER, "match_none"); + op.add(Builder::matchPhrase, MatchPhraseQuery._DESERIALIZER, "match_phrase"); + op.add(Builder::matchPhrasePrefix, MatchPhrasePrefixQuery._DESERIALIZER, "match_phrase_prefix"); + op.add(Builder::moreLikeThis, MoreLikeThisQuery._DESERIALIZER, "more_like_this"); + op.add(Builder::multiMatch, MultiMatchQuery._DESERIALIZER, "multi_match"); + op.add(Builder::nested, NestedQuery._DESERIALIZER, "nested"); + op.add(Builder::neural, NeuralQuery._DESERIALIZER, "neural"); + op.add(Builder::parentId, ParentIdQuery._DESERIALIZER, "parent_id"); + op.add(Builder::percolate, PercolateQuery._DESERIALIZER, "percolate"); + op.add(Builder::prefix, PrefixQuery._DESERIALIZER, "prefix"); + op.add(Builder::queryString, QueryStringQuery._DESERIALIZER, "query_string"); + op.add(Builder::range, RangeQuery._DESERIALIZER, "range"); + op.add(Builder::rankFeature, RankFeatureQuery._DESERIALIZER, "rank_feature"); + op.add(Builder::regexp, RegexpQuery._DESERIALIZER, "regexp"); + op.add(Builder::script, ScriptQuery._DESERIALIZER, "script"); + op.add(Builder::scriptScore, ScriptScoreQuery._DESERIALIZER, "script_score"); + op.add(Builder::simpleQueryString, SimpleQueryStringQuery._DESERIALIZER, "simple_query_string"); + op.add(Builder::spanContaining, SpanContainingQuery._DESERIALIZER, "span_containing"); + op.add(Builder::spanFirst, SpanFirstQuery._DESERIALIZER, "span_first"); + op.add(Builder::spanMulti, SpanMultiTermQuery._DESERIALIZER, "span_multi"); + op.add(Builder::spanNear, SpanNearQuery._DESERIALIZER, "span_near"); + op.add(Builder::spanNot, SpanNotQuery._DESERIALIZER, "span_not"); + op.add(Builder::spanOr, SpanOrQuery._DESERIALIZER, "span_or"); + op.add(Builder::spanTerm, SpanTermQuery._DESERIALIZER, "span_term"); + op.add(Builder::spanWithin, SpanWithinQuery._DESERIALIZER, "span_within"); + op.add(Builder::template, JsonpDeserializer.stringMapDeserializer(JsonData._DESERIALIZER), "template"); + op.add(Builder::term, TermQuery._DESERIALIZER, "term"); + op.add(Builder::terms, TermsQuery._DESERIALIZER, "terms"); + op.add(Builder::termsSet, TermsSetQuery._DESERIALIZER, "terms_set"); + op.add(Builder::type, TypeQuery._DESERIALIZER, "type"); + op.add(Builder::wildcard, WildcardQuery._DESERIALIZER, "wildcard"); + op.add(Builder::wrapper, WrapperQuery._DESERIALIZER, "wrapper"); + op.add(Builder::xyShape, XyShapeQuery._DESERIALIZER, "xy_shape"); + } + + @Override + public int hashCode() { + int result = 17; + result = 31 * result + Objects.hashCode(this.agentic); + result = 31 * result + Objects.hashCode(this.bool); + result = 31 * result + Objects.hashCode(this.boosting); + result = 31 * result + Objects.hashCode(this.combinedFields); + result = 31 * result + Objects.hashCode(this.common); + result = 31 * result + Objects.hashCode(this.constantScore); + result = 31 * result + Objects.hashCode(this.disMax); + result = 31 * result + Objects.hashCode(this.distanceFeature); + result = 31 * result + Objects.hashCode(this.exists); + result = 31 * result + Objects.hashCode(this.fieldMaskingSpan); + result = 31 * result + Objects.hashCode(this.functionScore); + result = 31 * result + Objects.hashCode(this.fuzzy); + result = 31 * result + Objects.hashCode(this.geoBoundingBox); + result = 31 * result + Objects.hashCode(this.geoDistance); + result = 31 * result + Objects.hashCode(this.geoPolygon); + result = 31 * result + Objects.hashCode(this.geoShape); + result = 31 * result + Objects.hashCode(this.hasChild); + result = 31 * result + Objects.hashCode(this.hasParent); + result = 31 * result + Objects.hashCode(this.hybrid); + result = 31 * result + Objects.hashCode(this.ids); + result = 31 * result + Objects.hashCode(this.intervals); + result = 31 * result + Objects.hashCode(this.knn); + result = 31 * result + Objects.hashCode(this.match); + result = 31 * result + Objects.hashCode(this.matchAll); + result = 31 * result + Objects.hashCode(this.matchBoolPrefix); + result = 31 * result + Objects.hashCode(this.matchNone); + result = 31 * result + Objects.hashCode(this.matchPhrase); + result = 31 * result + Objects.hashCode(this.matchPhrasePrefix); + result = 31 * result + Objects.hashCode(this.moreLikeThis); + result = 31 * result + Objects.hashCode(this.multiMatch); + result = 31 * result + Objects.hashCode(this.nested); + result = 31 * result + Objects.hashCode(this.neural); + result = 31 * result + Objects.hashCode(this.parentId); + result = 31 * result + Objects.hashCode(this.percolate); + result = 31 * result + Objects.hashCode(this.prefix); + result = 31 * result + Objects.hashCode(this.queryString); + result = 31 * result + Objects.hashCode(this.range); + result = 31 * result + Objects.hashCode(this.rankFeature); + result = 31 * result + Objects.hashCode(this.regexp); + result = 31 * result + Objects.hashCode(this.script); + result = 31 * result + Objects.hashCode(this.scriptScore); + result = 31 * result + Objects.hashCode(this.simpleQueryString); + result = 31 * result + Objects.hashCode(this.spanContaining); + result = 31 * result + Objects.hashCode(this.spanFirst); + result = 31 * result + Objects.hashCode(this.spanMulti); + result = 31 * result + Objects.hashCode(this.spanNear); + result = 31 * result + Objects.hashCode(this.spanNot); + result = 31 * result + Objects.hashCode(this.spanOr); + result = 31 * result + Objects.hashCode(this.spanTerm); + result = 31 * result + Objects.hashCode(this.spanWithin); + result = 31 * result + Objects.hashCode(this.template); + result = 31 * result + Objects.hashCode(this.term); + result = 31 * result + Objects.hashCode(this.terms); + result = 31 * result + Objects.hashCode(this.termsSet); + result = 31 * result + Objects.hashCode(this.type); + result = 31 * result + Objects.hashCode(this.wildcard); + result = 31 * result + Objects.hashCode(this.wrapper); + result = 31 * result + Objects.hashCode(this.xyShape); + return result; + } + + @Override + public boolean equals(Object o) { + if (this == o) return true; + if (o == null || this.getClass() != o.getClass()) return false; + FilterAggregationFields other = (FilterAggregationFields) o; + return Objects.equals(this.agentic, other.agentic) + && Objects.equals(this.bool, other.bool) + && Objects.equals(this.boosting, other.boosting) + && Objects.equals(this.combinedFields, other.combinedFields) + && Objects.equals(this.common, other.common) + && Objects.equals(this.constantScore, other.constantScore) + && Objects.equals(this.disMax, other.disMax) + && Objects.equals(this.distanceFeature, other.distanceFeature) + && Objects.equals(this.exists, other.exists) + && Objects.equals(this.fieldMaskingSpan, other.fieldMaskingSpan) + && Objects.equals(this.functionScore, other.functionScore) + && Objects.equals(this.fuzzy, other.fuzzy) + && Objects.equals(this.geoBoundingBox, other.geoBoundingBox) + && Objects.equals(this.geoDistance, other.geoDistance) + && Objects.equals(this.geoPolygon, other.geoPolygon) + && Objects.equals(this.geoShape, other.geoShape) + && Objects.equals(this.hasChild, other.hasChild) + && Objects.equals(this.hasParent, other.hasParent) + && Objects.equals(this.hybrid, other.hybrid) + && Objects.equals(this.ids, other.ids) + && Objects.equals(this.intervals, other.intervals) + && Objects.equals(this.knn, other.knn) + && Objects.equals(this.match, other.match) + && Objects.equals(this.matchAll, other.matchAll) + && Objects.equals(this.matchBoolPrefix, other.matchBoolPrefix) + && Objects.equals(this.matchNone, other.matchNone) + && Objects.equals(this.matchPhrase, other.matchPhrase) + && Objects.equals(this.matchPhrasePrefix, other.matchPhrasePrefix) + && Objects.equals(this.moreLikeThis, other.moreLikeThis) + && Objects.equals(this.multiMatch, other.multiMatch) + && Objects.equals(this.nested, other.nested) + && Objects.equals(this.neural, other.neural) + && Objects.equals(this.parentId, other.parentId) + && Objects.equals(this.percolate, other.percolate) + && Objects.equals(this.prefix, other.prefix) + && Objects.equals(this.queryString, other.queryString) + && Objects.equals(this.range, other.range) + && Objects.equals(this.rankFeature, other.rankFeature) + && Objects.equals(this.regexp, other.regexp) + && Objects.equals(this.script, other.script) + && Objects.equals(this.scriptScore, other.scriptScore) + && Objects.equals(this.simpleQueryString, other.simpleQueryString) + && Objects.equals(this.spanContaining, other.spanContaining) + && Objects.equals(this.spanFirst, other.spanFirst) + && Objects.equals(this.spanMulti, other.spanMulti) + && Objects.equals(this.spanNear, other.spanNear) + && Objects.equals(this.spanNot, other.spanNot) + && Objects.equals(this.spanOr, other.spanOr) + && Objects.equals(this.spanTerm, other.spanTerm) + && Objects.equals(this.spanWithin, other.spanWithin) + && Objects.equals(this.template, other.template) + && Objects.equals(this.term, other.term) + && Objects.equals(this.terms, other.terms) + && Objects.equals(this.termsSet, other.termsSet) + && Objects.equals(this.type, other.type) + && Objects.equals(this.wildcard, other.wildcard) + && Objects.equals(this.wrapper, other.wrapper) + && Objects.equals(this.xyShape, other.xyShape); + } +} diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/aggregations/FiltersAggregate.java b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/aggregations/FiltersAggregate.java index c4298744a4..5467d25f5c 100644 --- a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/aggregations/FiltersAggregate.java +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/aggregations/FiltersAggregate.java @@ -53,7 +53,6 @@ @Generated("org.opensearch.client.codegen.CodeGenerator") public class FiltersAggregate extends MultiBucketAggregateBase implements - AggregateVariant, ToCopyableBuilder { // --------------------------------------------------------------------------------------------- @@ -66,14 +65,6 @@ public static FiltersAggregate of(Function { + PlainJsonSerializable, + ToCopyableBuilder { @Nullable private final Buckets filters; @@ -75,26 +77,17 @@ public class FiltersAggregation extends BucketAggregationBase // --------------------------------------------------------------------------------------------- - private FiltersAggregation(Builder builder) { - super(builder); + private FiltersAggregationFields(Builder builder) { this.filters = builder.filters; this.keyed = builder.keyed; this.otherBucket = builder.otherBucket; this.otherBucketKey = builder.otherBucketKey; } - public static FiltersAggregation of(Function> fn) { + public static FiltersAggregationFields of(Function> fn) { return fn.apply(new Builder()).build(); } - /** - * {@link Aggregation} variant kind. - */ - @Override - public Aggregation.Kind _aggregationKind() { - return Aggregation.Kind.Filters; - } - /** * API name: {@code filters} */ @@ -137,8 +130,17 @@ public final String otherBucketKey() { return this.otherBucketKey; } + /** + * Serialize this object to JSON. + */ + @Override + public void serialize(JsonGenerator generator, JsonpMapper mapper) { + generator.writeStartObject(); + serializeInternal(generator, mapper); + generator.writeEnd(); + } + protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { - super.serializeInternal(generator, mapper); if (this.filters != null) { generator.writeKey("filters"); this.filters.serialize(generator, mapper); @@ -174,11 +176,9 @@ public static Builder builder() { } /** - * Builder for {@link FiltersAggregation}. + * Builder for {@link FiltersAggregationFields}. */ - public static class Builder extends BucketAggregationBase.AbstractBuilder - implements - CopyableBuilder { + public static class Builder extends ObjectBuilderBase implements CopyableBuilder { @Nullable private Buckets filters; @Nullable @@ -190,8 +190,7 @@ public static class Builder extends BucketAggregationBase.AbstractBuilder _DESERIALIZER = ObjectBuilderDeserializer.lazy( + public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer.lazy( Builder::new, - FiltersAggregation::setupFiltersAggregationDeserializer + FiltersAggregationFields::setupFiltersAggregationFieldsDeserializer ); - protected static void setupFiltersAggregationDeserializer(ObjectDeserializer op) { - setupBucketAggregationBaseDeserializer(op); + protected static void setupFiltersAggregationFieldsDeserializer(ObjectDeserializer op) { op.add(Builder::filters, Buckets.createBucketsDeserializer(Query._DESERIALIZER), "filters"); op.add(Builder::keyed, JsonpDeserializer.booleanDeserializer(), "keyed"); op.add(Builder::otherBucket, JsonpDeserializer.booleanDeserializer(), "other_bucket"); @@ -307,7 +298,7 @@ protected static void setupFiltersAggregationDeserializer(ObjectDeserializer { +public class GeoBoundsAggregate implements PlainJsonSerializable, ToCopyableBuilder { @Nullable private final GeoBounds bounds; @@ -67,7 +66,6 @@ public class GeoBoundsAggregate extends AggregateBase // --------------------------------------------------------------------------------------------- private GeoBoundsAggregate(Builder builder) { - super(builder); this.bounds = builder.bounds; } @@ -75,14 +73,6 @@ public static GeoBoundsAggregate of(Function implements CopyableBuilder { + public static class Builder extends ObjectBuilderBase implements CopyableBuilder { @Nullable private GeoBounds bounds; public Builder() {} private Builder(GeoBoundsAggregate o) { - super(o); this.bounds = o.bounds; } private Builder(Builder o) { - super(o); this.bounds = o.bounds; } @@ -137,12 +134,6 @@ public Builder copy() { return new Builder(this); } - @Override - @Nonnull - protected Builder self() { - return this; - } - /** * API name: {@code bounds} */ @@ -185,22 +176,18 @@ public GeoBoundsAggregate build() { ); protected static void setupGeoBoundsAggregateDeserializer(ObjectDeserializer op) { - setupAggregateBaseDeserializer(op); op.add(Builder::bounds, GeoBounds._DESERIALIZER, "bounds"); } @Override public int hashCode() { - int result = super.hashCode(); + int result = 17; result = 31 * result + Objects.hashCode(this.bounds); return result; } @Override public boolean equals(Object o) { - if (!super.equals(o)) { - return false; - } if (this == o) return true; if (o == null || this.getClass() != o.getClass()) return false; GeoBoundsAggregate other = (GeoBoundsAggregate) o; diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/aggregations/GeoBoundsAggregation.java b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/aggregations/GeoBoundsAggregation.java index 92ec61194a..2880010c52 100644 --- a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/aggregations/GeoBoundsAggregation.java +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/aggregations/GeoBoundsAggregation.java @@ -57,7 +57,6 @@ @Generated("org.opensearch.client.codegen.CodeGenerator") public class GeoBoundsAggregation extends MetricAggregationBase implements - AggregationVariant, ToCopyableBuilder { @Nullable @@ -74,14 +73,6 @@ public static GeoBoundsAggregation of(Function diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/aggregations/GeoCentroidAggregate.java b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/aggregations/GeoCentroidAggregate.java index b37a16921e..7d6a8adc20 100644 --- a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/aggregations/GeoCentroidAggregate.java +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/aggregations/GeoCentroidAggregate.java @@ -47,20 +47,19 @@ import org.opensearch.client.json.JsonpMapper; import org.opensearch.client.json.ObjectBuilderDeserializer; import org.opensearch.client.json.ObjectDeserializer; +import org.opensearch.client.json.PlainJsonSerializable; import org.opensearch.client.opensearch._types.GeoLocation; import org.opensearch.client.util.ApiTypeHelper; import org.opensearch.client.util.CopyableBuilder; import org.opensearch.client.util.ObjectBuilder; +import org.opensearch.client.util.ObjectBuilderBase; import org.opensearch.client.util.ToCopyableBuilder; // typedef: _types.aggregations.GeoCentroidAggregate @JsonpDeserializable @Generated("org.opensearch.client.codegen.CodeGenerator") -public class GeoCentroidAggregate extends AggregateBase - implements - AggregateVariant, - ToCopyableBuilder { +public class GeoCentroidAggregate implements PlainJsonSerializable, ToCopyableBuilder { private final long count; @@ -70,7 +69,6 @@ public class GeoCentroidAggregate extends AggregateBase // --------------------------------------------------------------------------------------------- private GeoCentroidAggregate(Builder builder) { - super(builder); this.count = ApiTypeHelper.requireNonNull(builder.count, this, "count"); this.location = builder.location; } @@ -79,14 +77,6 @@ public static GeoCentroidAggregate of(Function implements CopyableBuilder { + public static class Builder extends ObjectBuilderBase implements CopyableBuilder { private Long count; @Nullable private GeoLocation location; @@ -137,13 +136,11 @@ public static class Builder extends AggregateBase.AbstractBuilder imple public Builder() {} private Builder(GeoCentroidAggregate o) { - super(o); this.count = o.count; this.location = o.location; } private Builder(Builder o) { - super(o); this.count = o.count; this.location = o.location; } @@ -154,12 +151,6 @@ public Builder copy() { return new Builder(this); } - @Override - @Nonnull - protected Builder self() { - return this; - } - /** * Required - API name: {@code count} */ @@ -211,14 +202,13 @@ public GeoCentroidAggregate build() { ); protected static void setupGeoCentroidAggregateDeserializer(ObjectDeserializer op) { - setupAggregateBaseDeserializer(op); op.add(Builder::count, JsonpDeserializer.longDeserializer(), "count"); op.add(Builder::location, GeoLocation._DESERIALIZER, "location"); } @Override public int hashCode() { - int result = super.hashCode(); + int result = 17; result = 31 * result + Long.hashCode(this.count); result = 31 * result + Objects.hashCode(this.location); return result; @@ -226,9 +216,6 @@ public int hashCode() { @Override public boolean equals(Object o) { - if (!super.equals(o)) { - return false; - } if (this == o) return true; if (o == null || this.getClass() != o.getClass()) return false; GeoCentroidAggregate other = (GeoCentroidAggregate) o; diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/aggregations/GeoCentroidAggregation.java b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/aggregations/GeoCentroidAggregation.java index 0e5dcea1e9..fcf5365ad6 100644 --- a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/aggregations/GeoCentroidAggregation.java +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/aggregations/GeoCentroidAggregation.java @@ -58,7 +58,6 @@ @Generated("org.opensearch.client.codegen.CodeGenerator") public class GeoCentroidAggregation extends MetricAggregationBase implements - AggregationVariant, ToCopyableBuilder { @Nullable @@ -79,14 +78,6 @@ public static GeoCentroidAggregation of(Function { // --------------------------------------------------------------------------------------------- @@ -66,14 +65,6 @@ public static GeoDistanceAggregate of(Function { + PlainJsonSerializable, + ToCopyableBuilder { @Nullable private final GeoDistanceType distanceType; @@ -82,8 +84,7 @@ public class GeoDistanceAggregation extends BucketAggregationBase // --------------------------------------------------------------------------------------------- - private GeoDistanceAggregation(Builder builder) { - super(builder); + private GeoDistanceAggregationFields(Builder builder) { this.distanceType = builder.distanceType; this.field = builder.field; this.origin = builder.origin; @@ -91,18 +92,12 @@ private GeoDistanceAggregation(Builder builder) { this.unit = builder.unit; } - public static GeoDistanceAggregation of(Function> fn) { + public static GeoDistanceAggregationFields of( + Function> fn + ) { return fn.apply(new Builder()).build(); } - /** - * {@link Aggregation} variant kind. - */ - @Override - public Aggregation.Kind _aggregationKind() { - return Aggregation.Kind.GeoDistance; - } - /** * API name: {@code distance_type} */ @@ -146,8 +141,17 @@ public final DistanceUnit unit() { return this.unit; } + /** + * Serialize this object to JSON. + */ + @Override + public void serialize(JsonGenerator generator, JsonpMapper mapper) { + generator.writeStartObject(); + serializeInternal(generator, mapper); + generator.writeEnd(); + } + protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { - super.serializeInternal(generator, mapper); if (this.distanceType != null) { generator.writeKey("distance_type"); this.distanceType.serialize(generator, mapper); @@ -192,11 +196,9 @@ public static Builder builder() { } /** - * Builder for {@link GeoDistanceAggregation}. + * Builder for {@link GeoDistanceAggregationFields}. */ - public static class Builder extends BucketAggregationBase.AbstractBuilder - implements - CopyableBuilder { + public static class Builder extends ObjectBuilderBase implements CopyableBuilder { @Nullable private GeoDistanceType distanceType; @Nullable @@ -210,8 +212,7 @@ public static class Builder extends BucketAggregationBase.AbstractBuilder _DESERIALIZER = ObjectBuilderDeserializer.lazy( + public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer.lazy( Builder::new, - GeoDistanceAggregation::setupGeoDistanceAggregationDeserializer + GeoDistanceAggregationFields::setupGeoDistanceAggregationFieldsDeserializer ); - protected static void setupGeoDistanceAggregationDeserializer(ObjectDeserializer op) { - setupBucketAggregationBaseDeserializer(op); + protected static void setupGeoDistanceAggregationFieldsDeserializer(ObjectDeserializer op) { op.add(Builder::distanceType, GeoDistanceType._DESERIALIZER, "distance_type"); op.add(Builder::field, JsonpDeserializer.stringDeserializer(), "field"); op.add(Builder::origin, GeoLocation._DESERIALIZER, "origin"); @@ -366,7 +359,7 @@ protected static void setupGeoDistanceAggregationDeserializer(ObjectDeserializer @Override public int hashCode() { - int result = super.hashCode(); + int result = 17; result = 31 * result + Objects.hashCode(this.distanceType); result = 31 * result + Objects.hashCode(this.field); result = 31 * result + Objects.hashCode(this.origin); @@ -377,12 +370,9 @@ public int hashCode() { @Override public boolean equals(Object o) { - if (!super.equals(o)) { - return false; - } if (this == o) return true; if (o == null || this.getClass() != o.getClass()) return false; - GeoDistanceAggregation other = (GeoDistanceAggregation) o; + GeoDistanceAggregationFields other = (GeoDistanceAggregationFields) o; return Objects.equals(this.distanceType, other.distanceType) && Objects.equals(this.field, other.field) && Objects.equals(this.origin, other.origin) diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/aggregations/GeoHashGridAggregate.java b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/aggregations/GeoHashGridAggregate.java index 6ffe9c02c4..d3e13f9d74 100644 --- a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/aggregations/GeoHashGridAggregate.java +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/aggregations/GeoHashGridAggregate.java @@ -53,7 +53,6 @@ @Generated("org.opensearch.client.codegen.CodeGenerator") public class GeoHashGridAggregate extends MultiBucketAggregateBase implements - AggregateVariant, ToCopyableBuilder { // --------------------------------------------------------------------------------------------- @@ -66,14 +65,6 @@ public static GeoHashGridAggregate of(Function { + PlainJsonSerializable, + ToCopyableBuilder { @Nullable private final GeoBounds bounds; @@ -79,8 +81,7 @@ public class GeoHashGridAggregation extends BucketAggregationBase // --------------------------------------------------------------------------------------------- - private GeoHashGridAggregation(Builder builder) { - super(builder); + private GeoHashGridAggregationFields(Builder builder) { this.bounds = builder.bounds; this.field = builder.field; this.precision = builder.precision; @@ -88,18 +89,12 @@ private GeoHashGridAggregation(Builder builder) { this.size = builder.size; } - public static GeoHashGridAggregation of(Function> fn) { + public static GeoHashGridAggregationFields of( + Function> fn + ) { return fn.apply(new Builder()).build(); } - /** - * {@link Aggregation} variant kind. - */ - @Override - public Aggregation.Kind _aggregationKind() { - return Aggregation.Kind.GeohashGrid; - } - /** * API name: {@code bounds} */ @@ -147,8 +142,17 @@ public final Integer size() { return this.size; } + /** + * Serialize this object to JSON. + */ + @Override + public void serialize(JsonGenerator generator, JsonpMapper mapper) { + generator.writeStartObject(); + serializeInternal(generator, mapper); + generator.writeEnd(); + } + protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { - super.serializeInternal(generator, mapper); if (this.bounds != null) { generator.writeKey("bounds"); this.bounds.serialize(generator, mapper); @@ -189,11 +193,9 @@ public static Builder builder() { } /** - * Builder for {@link GeoHashGridAggregation}. + * Builder for {@link GeoHashGridAggregationFields}. */ - public static class Builder extends BucketAggregationBase.AbstractBuilder - implements - CopyableBuilder { + public static class Builder extends ObjectBuilderBase implements CopyableBuilder { @Nullable private GeoBounds bounds; @Nullable @@ -207,8 +209,7 @@ public static class Builder extends BucketAggregationBase.AbstractBuilder _DESERIALIZER = ObjectBuilderDeserializer.lazy( + public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer.lazy( Builder::new, - GeoHashGridAggregation::setupGeoHashGridAggregationDeserializer + GeoHashGridAggregationFields::setupGeoHashGridAggregationFieldsDeserializer ); - protected static void setupGeoHashGridAggregationDeserializer(ObjectDeserializer op) { - setupBucketAggregationBaseDeserializer(op); + protected static void setupGeoHashGridAggregationFieldsDeserializer(ObjectDeserializer op) { op.add(Builder::bounds, GeoBounds._DESERIALIZER, "bounds"); op.add(Builder::field, JsonpDeserializer.stringDeserializer(), "field"); op.add(Builder::precision, GeoHashPrecision._DESERIALIZER, "precision"); @@ -340,7 +333,7 @@ protected static void setupGeoHashGridAggregationDeserializer(ObjectDeserializer @Override public int hashCode() { - int result = super.hashCode(); + int result = 17; result = 31 * result + Objects.hashCode(this.bounds); result = 31 * result + Objects.hashCode(this.field); result = 31 * result + Objects.hashCode(this.precision); @@ -351,12 +344,9 @@ public int hashCode() { @Override public boolean equals(Object o) { - if (!super.equals(o)) { - return false; - } if (this == o) return true; if (o == null || this.getClass() != o.getClass()) return false; - GeoHashGridAggregation other = (GeoHashGridAggregation) o; + GeoHashGridAggregationFields other = (GeoHashGridAggregationFields) o; return Objects.equals(this.bounds, other.bounds) && Objects.equals(this.field, other.field) && Objects.equals(this.precision, other.precision) diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/aggregations/GeoTileGridAggregate.java b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/aggregations/GeoTileGridAggregate.java index 026edb251f..b66e623512 100644 --- a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/aggregations/GeoTileGridAggregate.java +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/aggregations/GeoTileGridAggregate.java @@ -53,7 +53,6 @@ @Generated("org.opensearch.client.codegen.CodeGenerator") public class GeoTileGridAggregate extends MultiBucketAggregateBase implements - AggregateVariant, ToCopyableBuilder { // --------------------------------------------------------------------------------------------- @@ -66,14 +65,6 @@ public static GeoTileGridAggregate of(Function { + PlainJsonSerializable, + ToCopyableBuilder { @Nullable private final GeoBounds bounds; @@ -78,8 +80,7 @@ public class GeoTileGridAggregation extends BucketAggregationBase // --------------------------------------------------------------------------------------------- - private GeoTileGridAggregation(Builder builder) { - super(builder); + private GeoTileGridAggregationFields(Builder builder) { this.bounds = builder.bounds; this.field = builder.field; this.precision = builder.precision; @@ -87,18 +88,12 @@ private GeoTileGridAggregation(Builder builder) { this.size = builder.size; } - public static GeoTileGridAggregation of(Function> fn) { + public static GeoTileGridAggregationFields of( + Function> fn + ) { return fn.apply(new Builder()).build(); } - /** - * {@link Aggregation} variant kind. - */ - @Override - public Aggregation.Kind _aggregationKind() { - return Aggregation.Kind.GeotileGrid; - } - /** * API name: {@code bounds} */ @@ -146,8 +141,17 @@ public final Integer size() { return this.size; } + /** + * Serialize this object to JSON. + */ + @Override + public void serialize(JsonGenerator generator, JsonpMapper mapper) { + generator.writeStartObject(); + serializeInternal(generator, mapper); + generator.writeEnd(); + } + protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { - super.serializeInternal(generator, mapper); if (this.bounds != null) { generator.writeKey("bounds"); this.bounds.serialize(generator, mapper); @@ -188,11 +192,9 @@ public static Builder builder() { } /** - * Builder for {@link GeoTileGridAggregation}. + * Builder for {@link GeoTileGridAggregationFields}. */ - public static class Builder extends BucketAggregationBase.AbstractBuilder - implements - CopyableBuilder { + public static class Builder extends ObjectBuilderBase implements CopyableBuilder { @Nullable private GeoBounds bounds; @Nullable @@ -206,8 +208,7 @@ public static class Builder extends BucketAggregationBase.AbstractBuilder _DESERIALIZER = ObjectBuilderDeserializer.lazy( + public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer.lazy( Builder::new, - GeoTileGridAggregation::setupGeoTileGridAggregationDeserializer + GeoTileGridAggregationFields::setupGeoTileGridAggregationFieldsDeserializer ); - protected static void setupGeoTileGridAggregationDeserializer(ObjectDeserializer op) { - setupBucketAggregationBaseDeserializer(op); + protected static void setupGeoTileGridAggregationFieldsDeserializer(ObjectDeserializer op) { op.add(Builder::bounds, GeoBounds._DESERIALIZER, "bounds"); op.add(Builder::field, JsonpDeserializer.stringDeserializer(), "field"); op.add(Builder::precision, JsonpDeserializer.numberDeserializer(), "precision"); @@ -331,7 +324,7 @@ protected static void setupGeoTileGridAggregationDeserializer(ObjectDeserializer @Override public int hashCode() { - int result = super.hashCode(); + int result = 17; result = 31 * result + Objects.hashCode(this.bounds); result = 31 * result + Objects.hashCode(this.field); result = 31 * result + Objects.hashCode(this.precision); @@ -342,12 +335,9 @@ public int hashCode() { @Override public boolean equals(Object o) { - if (!super.equals(o)) { - return false; - } if (this == o) return true; if (o == null || this.getClass() != o.getClass()) return false; - GeoTileGridAggregation other = (GeoTileGridAggregation) o; + GeoTileGridAggregationFields other = (GeoTileGridAggregationFields) o; return Objects.equals(this.bounds, other.bounds) && Objects.equals(this.field, other.field) && Objects.equals(this.precision, other.precision) diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/aggregations/GlobalAggregate.java b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/aggregations/GlobalAggregate.java index 49bfb13e71..9164244f19 100644 --- a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/aggregations/GlobalAggregate.java +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/aggregations/GlobalAggregate.java @@ -51,10 +51,7 @@ @JsonpDeserializable @Generated("org.opensearch.client.codegen.CodeGenerator") -public class GlobalAggregate extends SingleBucketAggregateBase - implements - AggregateVariant, - ToCopyableBuilder { +public class GlobalAggregate extends SingleBucketAggregateBase implements ToCopyableBuilder { // --------------------------------------------------------------------------------------------- @@ -66,14 +63,6 @@ public static GlobalAggregate of(Function { - - @Nonnull - private final String key; +public class GlobalAggregationFields + implements + PlainJsonSerializable, + ToCopyableBuilder { // --------------------------------------------------------------------------------------------- - private StringTermsBucket(Builder builder) { - super(builder); - this.key = ApiTypeHelper.requireNonNull(builder.key, this, "key"); - } + private GlobalAggregationFields(Builder builder) {} - public static StringTermsBucket of(Function> fn) { + public static GlobalAggregationFields of(Function> fn) { return fn.apply(new Builder()).build(); } /** - * Required - API name: {@code key} + * Serialize this object to JSON. */ - @Nonnull - public final String key() { - return this.key; - } - - protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { - super.serializeInternal(generator, mapper); - generator.writeKey("key"); - generator.write(this.key); + @Override + public void serialize(JsonGenerator generator, JsonpMapper mapper) { + generator.writeStartObject(); + generator.writeEnd(); } // --------------------------------------------------------------------------------------------- @@ -98,22 +87,15 @@ public static Builder builder() { } /** - * Builder for {@link StringTermsBucket}. + * Builder for {@link GlobalAggregationFields}. */ - public static class Builder extends TermsBucketBase.AbstractBuilder implements CopyableBuilder { - private String key; + public static class Builder extends ObjectBuilderBase implements CopyableBuilder { public Builder() {} - private Builder(StringTermsBucket o) { - super(o); - this.key = o.key; - } + private Builder(GlobalAggregationFields o) {} - private Builder(Builder o) { - super(o); - this.key = o.key; - } + private Builder(Builder o) {} @Override @Nonnull @@ -121,65 +103,41 @@ public Builder copy() { return new Builder(this); } - @Override - @Nonnull - protected Builder self() { - return this; - } - /** - * Required - API name: {@code key} - */ - @Nonnull - public final Builder key(String value) { - this.key = value; - return this; - } - - /** - * Builds a {@link StringTermsBucket}. + * Builds a {@link GlobalAggregationFields}. * * @throws NullPointerException if some of the required fields are null. */ @Override @Nonnull - public StringTermsBucket build() { + public GlobalAggregationFields build() { _checkSingleUse(); - return new StringTermsBucket(this); + return new GlobalAggregationFields(this); } } // --------------------------------------------------------------------------------------------- /** - * Json deserializer for {@link StringTermsBucket} + * Singleton instance for {@link GlobalAggregationFields}. */ - public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer.lazy( - Builder::new, - StringTermsBucket::setupStringTermsBucketDeserializer - ); + public static final GlobalAggregationFields _INSTANCE = builder().build(); - protected static void setupStringTermsBucketDeserializer(ObjectDeserializer op) { - setupTermsBucketBaseDeserializer(op); - op.add(Builder::key, JsonpDeserializer.stringDeserializer(), "key"); - } + public static final JsonpDeserializer _DESERIALIZER = JsonpDeserializer.emptyObject( + GlobalAggregationFields._INSTANCE + ); @Override public int hashCode() { - int result = super.hashCode(); - result = 31 * result + this.key.hashCode(); + int result = 17; return result; } @Override public boolean equals(Object o) { - if (!super.equals(o)) { - return false; - } if (this == o) return true; if (o == null || this.getClass() != o.getClass()) return false; - StringTermsBucket other = (StringTermsBucket) o; - return this.key.equals(other.key); + return true; } } diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/aggregations/HdrPercentileRanksAggregate.java b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/aggregations/HdrPercentileRanksAggregate.java index 995527830a..094ec5c377 100644 --- a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/aggregations/HdrPercentileRanksAggregate.java +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/aggregations/HdrPercentileRanksAggregate.java @@ -53,7 +53,6 @@ @Generated("org.opensearch.client.codegen.CodeGenerator") public class HdrPercentileRanksAggregate extends PercentilesAggregateBase implements - AggregateVariant, ToCopyableBuilder { // --------------------------------------------------------------------------------------------- @@ -68,14 +67,6 @@ public static HdrPercentileRanksAggregate of( return fn.apply(new Builder()).build(); } - /** - * {@link Aggregate} variant kind. - */ - @Override - public Aggregate.Kind _aggregateKind() { - return Aggregate.Kind.HdrPercentileRanks; - } - // --------------------------------------------------------------------------------------------- @Override diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/aggregations/HdrPercentilesAggregate.java b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/aggregations/HdrPercentilesAggregate.java index 7e7fdd1691..9ce7b89906 100644 --- a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/aggregations/HdrPercentilesAggregate.java +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/aggregations/HdrPercentilesAggregate.java @@ -53,7 +53,6 @@ @Generated("org.opensearch.client.codegen.CodeGenerator") public class HdrPercentilesAggregate extends PercentilesAggregateBase implements - AggregateVariant, ToCopyableBuilder { // --------------------------------------------------------------------------------------------- @@ -66,14 +65,6 @@ public static HdrPercentilesAggregate of(Function implements - AggregateVariant, ToCopyableBuilder { // --------------------------------------------------------------------------------------------- @@ -66,14 +65,6 @@ public static HistogramAggregate of(Function { + PlainJsonSerializable, + ToCopyableBuilder { @Nullable private final ExtendedBounds extendedBounds; @@ -96,8 +98,7 @@ public class HistogramAggregation extends BucketAggregationBase // --------------------------------------------------------------------------------------------- - private HistogramAggregation(Builder builder) { - super(builder); + private HistogramAggregationFields(Builder builder) { this.extendedBounds = builder.extendedBounds; this.field = builder.field; this.format = builder.format; @@ -111,18 +112,12 @@ private HistogramAggregation(Builder builder) { this.script = builder.script; } - public static HistogramAggregation of(Function> fn) { + public static HistogramAggregationFields of( + Function> fn + ) { return fn.apply(new Builder()).build(); } - /** - * {@link Aggregation} variant kind. - */ - @Override - public Aggregation.Kind _aggregationKind() { - return Aggregation.Kind.Histogram; - } - /** * API name: {@code extended_bounds} */ @@ -228,8 +223,17 @@ public final Script script() { return this.script; } + /** + * Serialize this object to JSON. + */ + @Override + public void serialize(JsonGenerator generator, JsonpMapper mapper) { + generator.writeStartObject(); + serializeInternal(generator, mapper); + generator.writeEnd(); + } + protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { - super.serializeInternal(generator, mapper); if (this.extendedBounds != null) { generator.writeKey("extended_bounds"); this.extendedBounds.serialize(generator, mapper); @@ -300,11 +304,9 @@ public static Builder builder() { } /** - * Builder for {@link HistogramAggregation}. + * Builder for {@link HistogramAggregationFields}. */ - public static class Builder extends BucketAggregationBase.AbstractBuilder - implements - CopyableBuilder { + public static class Builder extends ObjectBuilderBase implements CopyableBuilder { @Nullable private ExtendedBounds extendedBounds; @Nullable @@ -330,8 +332,7 @@ public static class Builder extends BucketAggregationBase.AbstractBuilder> fn) } /** - * Builds a {@link HistogramAggregation}. + * Builds a {@link HistogramAggregationFields}. * * @throws NullPointerException if some of the required fields are null. */ @Override @Nonnull - public HistogramAggregation build() { + public HistogramAggregationFields build() { _checkSingleUse(); - return new HistogramAggregation(this); + return new HistogramAggregationFields(this); } } // --------------------------------------------------------------------------------------------- /** - * Json deserializer for {@link HistogramAggregation} + * Json deserializer for {@link HistogramAggregationFields} */ - public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer.lazy( + public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer.lazy( Builder::new, - HistogramAggregation::setupHistogramAggregationDeserializer + HistogramAggregationFields::setupHistogramAggregationFieldsDeserializer ); - protected static void setupHistogramAggregationDeserializer(ObjectDeserializer op) { - setupBucketAggregationBaseDeserializer(op); + protected static void setupHistogramAggregationFieldsDeserializer(ObjectDeserializer op) { op.add( Builder::extendedBounds, ExtendedBounds.createExtendedBoundsDeserializer(JsonpDeserializer.doubleDeserializer()), @@ -565,7 +558,7 @@ protected static void setupHistogramAggregationDeserializer(ObjectDeserializer implements - AggregateVariant, ToCopyableBuilder { // --------------------------------------------------------------------------------------------- @@ -66,14 +65,6 @@ public static IpRangeAggregate of(Function { + PlainJsonSerializable, + ToCopyableBuilder { @Nullable private final String field; @@ -70,24 +72,15 @@ public class IpRangeAggregation extends BucketAggregationBase // --------------------------------------------------------------------------------------------- - private IpRangeAggregation(Builder builder) { - super(builder); + private IpRangeAggregationFields(Builder builder) { this.field = builder.field; this.ranges = ApiTypeHelper.unmodifiable(builder.ranges); } - public static IpRangeAggregation of(Function> fn) { + public static IpRangeAggregationFields of(Function> fn) { return fn.apply(new Builder()).build(); } - /** - * {@link Aggregation} variant kind. - */ - @Override - public Aggregation.Kind _aggregationKind() { - return Aggregation.Kind.IpRange; - } - /** * API name: {@code field} */ @@ -107,8 +100,17 @@ public final List ranges() { return this.ranges; } + /** + * Serialize this object to JSON. + */ + @Override + public void serialize(JsonGenerator generator, JsonpMapper mapper) { + generator.writeStartObject(); + serializeInternal(generator, mapper); + generator.writeEnd(); + } + protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { - super.serializeInternal(generator, mapper); if (this.field != null) { generator.writeKey("field"); generator.write(this.field); @@ -138,11 +140,9 @@ public static Builder builder() { } /** - * Builder for {@link IpRangeAggregation}. + * Builder for {@link IpRangeAggregationFields}. */ - public static class Builder extends BucketAggregationBase.AbstractBuilder - implements - CopyableBuilder { + public static class Builder extends ObjectBuilderBase implements CopyableBuilder { @Nullable private String field; @Nullable @@ -150,14 +150,12 @@ public static class Builder extends BucketAggregationBase.AbstractBuilder _DESERIALIZER = ObjectBuilderDeserializer.lazy( + public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer.lazy( Builder::new, - IpRangeAggregation::setupIpRangeAggregationDeserializer + IpRangeAggregationFields::setupIpRangeAggregationFieldsDeserializer ); - protected static void setupIpRangeAggregationDeserializer(ObjectDeserializer op) { - setupBucketAggregationBaseDeserializer(op); + protected static void setupIpRangeAggregationFieldsDeserializer(ObjectDeserializer op) { op.add(Builder::field, JsonpDeserializer.stringDeserializer(), "field"); op.add(Builder::ranges, JsonpDeserializer.arrayDeserializer(IpRangeAggregationRange._DESERIALIZER), "ranges"); } @Override public int hashCode() { - int result = super.hashCode(); + int result = 17; result = 31 * result + Objects.hashCode(this.field); result = 31 * result + Objects.hashCode(this.ranges); return result; @@ -270,12 +261,9 @@ public int hashCode() { @Override public boolean equals(Object o) { - if (!super.equals(o)) { - return false; - } if (this == o) return true; if (o == null || this.getClass() != o.getClass()) return false; - IpRangeAggregation other = (IpRangeAggregation) o; + IpRangeAggregationFields other = (IpRangeAggregationFields) o; return Objects.equals(this.field, other.field) && Objects.equals(this.ranges, other.ranges); } } diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/aggregations/LongRareTermsAggregate.java b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/aggregations/LongRareTermsAggregate.java index 15b021aa22..2e2cafa64e 100644 --- a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/aggregations/LongRareTermsAggregate.java +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/aggregations/LongRareTermsAggregate.java @@ -56,7 +56,6 @@ @Generated("org.opensearch.client.codegen.CodeGenerator") public class LongRareTermsAggregate extends MultiBucketAggregateBase implements - AggregateVariant, ToCopyableBuilder { // --------------------------------------------------------------------------------------------- @@ -69,14 +68,6 @@ public static LongRareTermsAggregate of(Function +public class LongTermsAggregate extends TermsAggregateBase implements - AggregateVariant, ToCopyableBuilder { // --------------------------------------------------------------------------------------------- @@ -69,14 +69,6 @@ public static LongTermsAggregate of(Function + public static class Builder extends TermsAggregateBase.AbstractBuilder implements CopyableBuilder { @@ -144,7 +136,7 @@ public LongTermsAggregate build() { ); protected static void setupLongTermsAggregateDeserializer(ObjectDeserializer op) { - setupTermsAggregateBaseDeserializer(op, LongTermsBucket._DESERIALIZER); + setupTermsAggregateBaseDeserializer(op, JsonData._DESERIALIZER); } @Override diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/aggregations/LongTermsBucket.java b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/aggregations/LongTermsBucket.java deleted file mode 100644 index b83db9853b..0000000000 --- a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/aggregations/LongTermsBucket.java +++ /dev/null @@ -1,227 +0,0 @@ -/* - * SPDX-License-Identifier: Apache-2.0 - * - * The OpenSearch Contributors require contributions made to - * this file be licensed under the Apache-2.0 license or a - * compatible open source license. - */ - -/* - * 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. - */ - -/* - * Modifications Copyright OpenSearch Contributors. See - * GitHub history for details. - */ - -//---------------------------------------------------- -// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. -//---------------------------------------------------- - -package org.opensearch.client.opensearch._types.aggregations; - -import jakarta.json.stream.JsonGenerator; -import java.util.Objects; -import java.util.function.Function; -import javax.annotation.Generated; -import javax.annotation.Nonnull; -import javax.annotation.Nullable; -import org.opensearch.client.json.JsonpDeserializable; -import org.opensearch.client.json.JsonpDeserializer; -import org.opensearch.client.json.JsonpMapper; -import org.opensearch.client.json.ObjectBuilderDeserializer; -import org.opensearch.client.json.ObjectDeserializer; -import org.opensearch.client.util.ApiTypeHelper; -import org.opensearch.client.util.CopyableBuilder; -import org.opensearch.client.util.ObjectBuilder; -import org.opensearch.client.util.ToCopyableBuilder; - -// typedef: _types.aggregations.LongTermsBucket - -@JsonpDeserializable -@Generated("org.opensearch.client.codegen.CodeGenerator") -public class LongTermsBucket extends TermsBucketBase implements ToCopyableBuilder { - - @Nonnull - private final LongTermsBucketKey key; - - @Nullable - private final String keyAsString; - - // --------------------------------------------------------------------------------------------- - - private LongTermsBucket(Builder builder) { - super(builder); - this.key = ApiTypeHelper.requireNonNull(builder.key, this, "key"); - this.keyAsString = builder.keyAsString; - } - - public static LongTermsBucket of(Function> fn) { - return fn.apply(new Builder()).build(); - } - - /** - * Required - API name: {@code key} - */ - @Nonnull - public final LongTermsBucketKey key() { - return this.key; - } - - /** - * API name: {@code key_as_string} - */ - @Nullable - public final String keyAsString() { - return this.keyAsString; - } - - protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { - super.serializeInternal(generator, mapper); - generator.writeKey("key"); - this.key.serialize(generator, mapper); - - if (this.keyAsString != null) { - generator.writeKey("key_as_string"); - generator.write(this.keyAsString); - } - } - - // --------------------------------------------------------------------------------------------- - - @Override - @Nonnull - public Builder toBuilder() { - return new Builder(this); - } - - @Nonnull - public static Builder builder() { - return new Builder(); - } - - /** - * Builder for {@link LongTermsBucket}. - */ - public static class Builder extends TermsBucketBase.AbstractBuilder implements CopyableBuilder { - private LongTermsBucketKey key; - @Nullable - private String keyAsString; - - public Builder() {} - - private Builder(LongTermsBucket o) { - super(o); - this.key = o.key; - this.keyAsString = o.keyAsString; - } - - private Builder(Builder o) { - super(o); - this.key = o.key; - this.keyAsString = o.keyAsString; - } - - @Override - @Nonnull - public Builder copy() { - return new Builder(this); - } - - @Override - @Nonnull - protected Builder self() { - return this; - } - - /** - * Required - API name: {@code key} - */ - @Nonnull - public final Builder key(LongTermsBucketKey value) { - this.key = value; - return this; - } - - /** - * Required - API name: {@code key} - */ - @Nonnull - public final Builder key(Function> fn) { - return key(fn.apply(new LongTermsBucketKey.Builder()).build()); - } - - /** - * API name: {@code key_as_string} - */ - @Nonnull - public final Builder keyAsString(@Nullable String value) { - this.keyAsString = value; - return this; - } - - /** - * Builds a {@link LongTermsBucket}. - * - * @throws NullPointerException if some of the required fields are null. - */ - @Override - @Nonnull - public LongTermsBucket build() { - _checkSingleUse(); - - return new LongTermsBucket(this); - } - } - - // --------------------------------------------------------------------------------------------- - - /** - * Json deserializer for {@link LongTermsBucket} - */ - public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer.lazy( - Builder::new, - LongTermsBucket::setupLongTermsBucketDeserializer - ); - - protected static void setupLongTermsBucketDeserializer(ObjectDeserializer op) { - setupTermsBucketBaseDeserializer(op); - op.add(Builder::key, LongTermsBucketKey._DESERIALIZER, "key"); - op.add(Builder::keyAsString, JsonpDeserializer.stringDeserializer(), "key_as_string"); - } - - @Override - public int hashCode() { - int result = super.hashCode(); - result = 31 * result + this.key.hashCode(); - result = 31 * result + Objects.hashCode(this.keyAsString); - return result; - } - - @Override - public boolean equals(Object o) { - if (!super.equals(o)) { - return false; - } - if (this == o) return true; - if (o == null || this.getClass() != o.getClass()) return false; - LongTermsBucket other = (LongTermsBucket) o; - return this.key.equals(other.key) && Objects.equals(this.keyAsString, other.keyAsString); - } -} diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/aggregations/LongTermsBucketKey.java b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/aggregations/LongTermsBucketKey.java deleted file mode 100644 index 250d73ab04..0000000000 --- a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/aggregations/LongTermsBucketKey.java +++ /dev/null @@ -1,221 +0,0 @@ -/* - * SPDX-License-Identifier: Apache-2.0 - * - * The OpenSearch Contributors require contributions made to - * this file be licensed under the Apache-2.0 license or a - * compatible open source license. - */ - -/* - * 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. - */ - -/* - * Modifications Copyright OpenSearch Contributors. See - * GitHub history for details. - */ - -//---------------------------------------------------- -// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. -//---------------------------------------------------- - -package org.opensearch.client.opensearch._types.aggregations; - -import jakarta.json.stream.JsonGenerator; -import java.util.Objects; -import java.util.function.Function; -import javax.annotation.Generated; -import javax.annotation.Nonnull; -import org.opensearch.client.json.JsonpDeserializable; -import org.opensearch.client.json.JsonpDeserializer; -import org.opensearch.client.json.JsonpMapper; -import org.opensearch.client.json.JsonpSerializable; -import org.opensearch.client.json.PlainJsonSerializable; -import org.opensearch.client.json.UnionDeserializer; -import org.opensearch.client.util.ApiTypeHelper; -import org.opensearch.client.util.ObjectBuilder; -import org.opensearch.client.util.ObjectBuilderBase; -import org.opensearch.client.util.TaggedUnion; -import org.opensearch.client.util.TaggedUnionUtils; - -// typedef: _types.aggregations.LongTermsBucketKey - -@JsonpDeserializable -@Generated("org.opensearch.client.codegen.CodeGenerator") -public class LongTermsBucketKey implements TaggedUnion, PlainJsonSerializable { - /** - * {@link LongTermsBucketKey} variant kinds. - */ - public enum Kind { - Signed, - Unsigned - } - - private final Kind _kind; - private final Object _value; - - @Override - public final Kind _kind() { - return _kind; - } - - @Override - public final Object _get() { - return _value; - } - - private LongTermsBucketKey(Kind kind, Object value) { - this._kind = kind; - this._value = value; - } - - private LongTermsBucketKey(Builder builder) { - this._kind = ApiTypeHelper.requireNonNull(builder._kind, builder, ""); - this._value = ApiTypeHelper.requireNonNull(builder._value, builder, ""); - } - - public static LongTermsBucketKey of(Function> fn) { - return fn.apply(new Builder()).build(); - } - - public String _toJsonString() { - switch (_kind) { - case Signed: - return String.valueOf(this.signed()); - case Unsigned: - return this.unsigned(); - default: - throw new IllegalStateException("Unknown kind " + _kind); - } - } - - /** - * Is this variant instance of kind {@code signed}? - */ - public boolean isSigned() { - return _kind == Kind.Signed; - } - - /** - * Get the {@code signed} variant value. - * - * @throws IllegalStateException if the current variant is not the {@code signed} kind. - */ - public Long signed() { - return TaggedUnionUtils.get(this, Kind.Signed); - } - - /** - * Is this variant instance of kind {@code unsigned}? - */ - public boolean isUnsigned() { - return _kind == Kind.Unsigned; - } - - /** - * Get the {@code unsigned} variant value. - * - * @throws IllegalStateException if the current variant is not the {@code unsigned} kind. - */ - public String unsigned() { - return TaggedUnionUtils.get(this, Kind.Unsigned); - } - - @Override - public void serialize(JsonGenerator generator, JsonpMapper mapper) { - if (_value instanceof JsonpSerializable) { - ((JsonpSerializable) _value).serialize(generator, mapper); - } else { - switch (_kind) { - case Signed: - generator.write(((Long) this._value)); - break; - case Unsigned: - generator.write(((String) this._value)); - break; - } - } - } - - @Nonnull - public Builder toBuilder() { - return new Builder(this); - } - - @Nonnull - public static Builder builder() { - return new Builder(); - } - - public static class Builder extends ObjectBuilderBase implements ObjectBuilder { - private Kind _kind; - private Object _value; - - public Builder() {} - - private Builder(LongTermsBucketKey o) { - this._kind = o._kind; - this._value = o._value; - } - - public ObjectBuilder signed(Long v) { - this._kind = Kind.Signed; - this._value = v; - return this; - } - - public ObjectBuilder unsigned(String v) { - this._kind = Kind.Unsigned; - this._value = v; - return this; - } - - @Override - public LongTermsBucketKey build() { - _checkSingleUse(); - return new LongTermsBucketKey(this); - } - } - - private static JsonpDeserializer buildLongTermsBucketKeyDeserializer() { - return new UnionDeserializer.Builder(LongTermsBucketKey::new, false).addMember( - Kind.Signed, - JsonpDeserializer.longDeserializer() - ).addMember(Kind.Unsigned, JsonpDeserializer.stringDeserializer()).build(); - } - - public static final JsonpDeserializer _DESERIALIZER = JsonpDeserializer.lazy( - LongTermsBucketKey::buildLongTermsBucketKeyDeserializer - ); - - @Override - public int hashCode() { - int result = 17; - result = 31 * result + Objects.hashCode(this._kind); - result = 31 * result + Objects.hashCode(this._value); - return result; - } - - @Override - public boolean equals(Object o) { - if (this == o) return true; - if (o == null || this.getClass() != o.getClass()) return false; - LongTermsBucketKey other = (LongTermsBucketKey) o; - return Objects.equals(this._kind, other._kind) && Objects.equals(this._value, other._value); - } -} diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/aggregations/MatrixAggregation.java b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/aggregations/MatrixAggregation.java index 687a42f7be..9c0b5d4d47 100644 --- a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/aggregations/MatrixAggregation.java +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/aggregations/MatrixAggregation.java @@ -46,12 +46,14 @@ import org.opensearch.client.json.JsonpDeserializer; import org.opensearch.client.json.JsonpMapper; import org.opensearch.client.json.ObjectDeserializer; +import org.opensearch.client.json.PlainJsonSerializable; import org.opensearch.client.util.ApiTypeHelper; +import org.opensearch.client.util.ObjectBuilderBase; // typedef: _types.aggregations.MatrixAggregation @Generated("org.opensearch.client.codegen.CodeGenerator") -public abstract class MatrixAggregation extends AggregationBase { +public abstract class MatrixAggregation implements PlainJsonSerializable { @Nonnull private final List fields; @@ -62,7 +64,6 @@ public abstract class MatrixAggregation extends AggregationBase { // --------------------------------------------------------------------------------------------- protected MatrixAggregation(AbstractBuilder builder) { - super(builder); this.fields = ApiTypeHelper.unmodifiable(builder.fields); this.missing = ApiTypeHelper.unmodifiable(builder.missing); } @@ -86,8 +87,17 @@ public final Map missing() { return this.missing; } + /** + * Serialize this object to JSON. + */ + @Override + public void serialize(JsonGenerator generator, JsonpMapper mapper) { + generator.writeStartObject(); + serializeInternal(generator, mapper); + generator.writeEnd(); + } + protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { - super.serializeInternal(generator, mapper); if (ApiTypeHelper.isDefined(this.fields)) { generator.writeKey("fields"); generator.writeStartArray(); @@ -110,8 +120,7 @@ protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { // --------------------------------------------------------------------------------------------- - public abstract static class AbstractBuilder> extends AggregationBase.AbstractBuilder< - BuilderT> { + public abstract static class AbstractBuilder> extends ObjectBuilderBase { @Nullable private List fields; @Nullable @@ -120,17 +129,18 @@ public abstract static class AbstractBuilder o) { - super(o); this.fields = _listCopy(o.fields); this.missing = _mapCopy(o.missing); } + @Nonnull + protected abstract BuilderT self(); + /** * API name: {@code fields} * @@ -193,14 +203,13 @@ public final BuilderT missing(String key, Double value) { // --------------------------------------------------------------------------------------------- protected static > void setupMatrixAggregationDeserializer(ObjectDeserializer op) { - setupAggregationBaseDeserializer(op); op.add(AbstractBuilder::fields, JsonpDeserializer.arrayDeserializer(JsonpDeserializer.stringDeserializer()), "fields"); op.add(AbstractBuilder::missing, JsonpDeserializer.stringMapDeserializer(JsonpDeserializer.doubleDeserializer()), "missing"); } @Override public int hashCode() { - int result = super.hashCode(); + int result = 17; result = 31 * result + Objects.hashCode(this.fields); result = 31 * result + Objects.hashCode(this.missing); return result; @@ -208,9 +217,6 @@ public int hashCode() { @Override public boolean equals(Object o) { - if (!super.equals(o)) { - return false; - } if (this == o) return true; if (o == null || this.getClass() != o.getClass()) return false; MatrixAggregation other = (MatrixAggregation) o; diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/aggregations/MatrixStatsAggregate.java b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/aggregations/MatrixStatsAggregate.java index 604e8f3f72..d951340a8c 100644 --- a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/aggregations/MatrixStatsAggregate.java +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/aggregations/MatrixStatsAggregate.java @@ -48,19 +48,18 @@ import org.opensearch.client.json.JsonpMapper; import org.opensearch.client.json.ObjectBuilderDeserializer; import org.opensearch.client.json.ObjectDeserializer; +import org.opensearch.client.json.PlainJsonSerializable; import org.opensearch.client.util.ApiTypeHelper; import org.opensearch.client.util.CopyableBuilder; import org.opensearch.client.util.ObjectBuilder; +import org.opensearch.client.util.ObjectBuilderBase; import org.opensearch.client.util.ToCopyableBuilder; // typedef: _types.aggregations.MatrixStatsAggregate @JsonpDeserializable @Generated("org.opensearch.client.codegen.CodeGenerator") -public class MatrixStatsAggregate extends AggregateBase - implements - AggregateVariant, - ToCopyableBuilder { +public class MatrixStatsAggregate implements PlainJsonSerializable, ToCopyableBuilder { private final long docCount; @@ -70,7 +69,6 @@ public class MatrixStatsAggregate extends AggregateBase // --------------------------------------------------------------------------------------------- private MatrixStatsAggregate(Builder builder) { - super(builder); this.docCount = ApiTypeHelper.requireNonNull(builder.docCount, this, "docCount"); this.fields = ApiTypeHelper.unmodifiable(builder.fields); } @@ -79,14 +77,6 @@ public static MatrixStatsAggregate of(Function fields() { return this.fields; } + /** + * Serialize this object to JSON. + */ + @Override + public void serialize(JsonGenerator generator, JsonpMapper mapper) { + generator.writeStartObject(); + serializeInternal(generator, mapper); + generator.writeEnd(); + } + protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { - super.serializeInternal(generator, mapper); generator.writeKey("doc_count"); generator.write(this.docCount); @@ -133,7 +132,7 @@ public static Builder builder() { /** * Builder for {@link MatrixStatsAggregate}. */ - public static class Builder extends AggregateBase.AbstractBuilder implements CopyableBuilder { + public static class Builder extends ObjectBuilderBase implements CopyableBuilder { private Long docCount; @Nullable private List fields; @@ -141,13 +140,11 @@ public static class Builder extends AggregateBase.AbstractBuilder imple public Builder() {} private Builder(MatrixStatsAggregate o) { - super(o); this.docCount = o.docCount; this.fields = _listCopy(o.fields); } private Builder(Builder o) { - super(o); this.docCount = o.docCount; this.fields = _listCopy(o.fields); } @@ -158,12 +155,6 @@ public Builder copy() { return new Builder(this); } - @Override - @Nonnull - protected Builder self() { - return this; - } - /** * Required - API name: {@code doc_count} */ @@ -236,14 +227,13 @@ public MatrixStatsAggregate build() { ); protected static void setupMatrixStatsAggregateDeserializer(ObjectDeserializer op) { - setupAggregateBaseDeserializer(op); op.add(Builder::docCount, JsonpDeserializer.longDeserializer(), "doc_count"); op.add(Builder::fields, JsonpDeserializer.arrayDeserializer(MatrixStatsFields._DESERIALIZER), "fields"); } @Override public int hashCode() { - int result = super.hashCode(); + int result = 17; result = 31 * result + Long.hashCode(this.docCount); result = 31 * result + Objects.hashCode(this.fields); return result; @@ -251,9 +241,6 @@ public int hashCode() { @Override public boolean equals(Object o) { - if (!super.equals(o)) { - return false; - } if (this == o) return true; if (o == null || this.getClass() != o.getClass()) return false; MatrixStatsAggregate other = (MatrixStatsAggregate) o; diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/aggregations/MatrixStatsAggregation.java b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/aggregations/MatrixStatsAggregation.java index 59ac693c68..3c4e970e37 100644 --- a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/aggregations/MatrixStatsAggregation.java +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/aggregations/MatrixStatsAggregation.java @@ -58,7 +58,6 @@ @Generated("org.opensearch.client.codegen.CodeGenerator") public class MatrixStatsAggregation extends MatrixAggregation implements - AggregationVariant, ToCopyableBuilder { @Nullable @@ -75,14 +74,6 @@ public static MatrixStatsAggregation of(Function { +public class MaxAggregate extends SingleMetricAggregateBase implements ToCopyableBuilder { // --------------------------------------------------------------------------------------------- @@ -66,14 +63,6 @@ public static MaxAggregate of(Function { +public class MaxAggregation extends FormatMetricAggregationBase implements ToCopyableBuilder { @Nullable private final ValueType valueType; @@ -74,14 +71,6 @@ public static MaxAggregation of(Function { // --------------------------------------------------------------------------------------------- @@ -66,14 +65,6 @@ public static MaxBucketAggregation of(Function { // --------------------------------------------------------------------------------------------- @@ -68,14 +67,6 @@ public static MedianAbsoluteDeviationAggregate of( return fn.apply(new Builder()).build(); } - /** - * {@link Aggregate} variant kind. - */ - @Override - public Aggregate.Kind _aggregateKind() { - return Aggregate.Kind.MedianAbsoluteDeviation; - } - // --------------------------------------------------------------------------------------------- @Override diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/aggregations/MedianAbsoluteDeviationAggregation.java b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/aggregations/MedianAbsoluteDeviationAggregation.java index a4072d80d3..23e3ddfc47 100644 --- a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/aggregations/MedianAbsoluteDeviationAggregation.java +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/aggregations/MedianAbsoluteDeviationAggregation.java @@ -57,7 +57,6 @@ @Generated("org.opensearch.client.codegen.CodeGenerator") public class MedianAbsoluteDeviationAggregation extends FormatMetricAggregationBase implements - AggregationVariant, ToCopyableBuilder { @Nullable @@ -76,14 +75,6 @@ public static MedianAbsoluteDeviationAggregation of( return fn.apply(new Builder()).build(); } - /** - * {@link Aggregation} variant kind. - */ - @Override - public Aggregation.Kind _aggregationKind() { - return Aggregation.Kind.MedianAbsoluteDeviation; - } - /** * Limits the maximum number of nodes used by the underlying TDigest algorithm to 20 * compression, enabling control of * memory usage and approximation error. diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/aggregations/MetricAggregationBase.java b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/aggregations/MetricAggregationBase.java index 8cc050a3cf..cb57bd780f 100644 --- a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/aggregations/MetricAggregationBase.java +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/aggregations/MetricAggregationBase.java @@ -37,20 +37,17 @@ package org.opensearch.client.opensearch._types.aggregations; import jakarta.json.stream.JsonGenerator; -import java.util.Map; import java.util.Objects; import java.util.function.Function; import javax.annotation.Generated; import javax.annotation.Nonnull; import javax.annotation.Nullable; -import org.opensearch.client.json.JsonData; import org.opensearch.client.json.JsonpDeserializer; import org.opensearch.client.json.JsonpMapper; import org.opensearch.client.json.ObjectDeserializer; import org.opensearch.client.json.PlainJsonSerializable; import org.opensearch.client.opensearch._types.FieldValue; import org.opensearch.client.opensearch._types.Script; -import org.opensearch.client.util.ApiTypeHelper; import org.opensearch.client.util.ObjectBuilder; import org.opensearch.client.util.ObjectBuilderBase; @@ -62,15 +59,9 @@ public abstract class MetricAggregationBase implements PlainJsonSerializable { @Nullable private final String field; - @Nonnull - private final Map meta; - @Nullable private final FieldValue missing; - @Nullable - private final String name; - @Nullable private final Script script; @@ -78,9 +69,7 @@ public abstract class MetricAggregationBase implements PlainJsonSerializable { protected MetricAggregationBase(AbstractBuilder builder) { this.field = builder.field; - this.meta = ApiTypeHelper.unmodifiable(builder.meta); this.missing = builder.missing; - this.name = builder.name; this.script = builder.script; } @@ -92,14 +81,6 @@ public final String field() { return this.field; } - /** - * API name: {@code meta} - */ - @Nonnull - public final Map meta() { - return this.meta; - } - /** * API name: {@code missing} */ @@ -108,14 +89,6 @@ public final FieldValue missing() { return this.missing; } - /** - * API name: {@code name} - */ - @Nullable - public final String name() { - return this.name; - } - /** * API name: {@code script} */ @@ -140,26 +113,11 @@ protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { generator.write(this.field); } - 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(); - } - if (this.missing != null) { generator.writeKey("missing"); this.missing.serialize(generator, mapper); } - if (this.name != null) { - generator.writeKey("name"); - generator.write(this.name); - } - if (this.script != null) { generator.writeKey("script"); this.script.serialize(generator, mapper); @@ -172,29 +130,21 @@ public abstract static class AbstractBuilder meta; - @Nullable private FieldValue missing; @Nullable - private String name; - @Nullable private Script script; protected AbstractBuilder() {} protected AbstractBuilder(MetricAggregationBase o) { this.field = o.field; - this.meta = _mapCopy(o.meta); this.missing = o.missing; - this.name = o.name; this.script = o.script; } protected AbstractBuilder(AbstractBuilder o) { this.field = o.field; - this.meta = _mapCopy(o.meta); this.missing = o.missing; - this.name = o.name; this.script = o.script; } @@ -210,32 +160,6 @@ public final BuilderT field(@Nullable String value) { return self(); } - /** - * API name: {@code meta} - * - *

- * Adds all elements of map to meta. - *

- */ - @Nonnull - public final BuilderT meta(Map map) { - this.meta = _mapPutAll(this.meta, map); - return self(); - } - - /** - * API name: {@code meta} - * - *

- * Adds an entry to meta. - *

- */ - @Nonnull - public final BuilderT meta(String key, JsonData value) { - this.meta = _mapPut(this.meta, key, value); - return self(); - } - /** * API name: {@code missing} */ @@ -253,15 +177,6 @@ public final BuilderT missing(Function> void setupMetricAg ObjectDeserializer op ) { op.add(AbstractBuilder::field, JsonpDeserializer.stringDeserializer(), "field"); - op.add(AbstractBuilder::meta, JsonpDeserializer.stringMapDeserializer(JsonData._DESERIALIZER), "meta"); op.add(AbstractBuilder::missing, FieldValue._DESERIALIZER, "missing"); - op.add(AbstractBuilder::name, JsonpDeserializer.stringDeserializer(), "name"); op.add(AbstractBuilder::script, Script._DESERIALIZER, "script"); } @@ -296,9 +209,7 @@ protected static > void setupMetricAg public int hashCode() { int result = 17; result = 31 * result + Objects.hashCode(this.field); - result = 31 * result + Objects.hashCode(this.meta); result = 31 * result + Objects.hashCode(this.missing); - result = 31 * result + Objects.hashCode(this.name); result = 31 * result + Objects.hashCode(this.script); return result; } @@ -309,9 +220,7 @@ public boolean equals(Object o) { if (o == null || this.getClass() != o.getClass()) return false; MetricAggregationBase other = (MetricAggregationBase) o; return Objects.equals(this.field, other.field) - && Objects.equals(this.meta, other.meta) && Objects.equals(this.missing, other.missing) - && Objects.equals(this.name, other.name) && Objects.equals(this.script, other.script); } } diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/aggregations/MinAggregate.java b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/aggregations/MinAggregate.java index 8117eb9fd6..c6580d1a2d 100644 --- a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/aggregations/MinAggregate.java +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/aggregations/MinAggregate.java @@ -51,10 +51,7 @@ @JsonpDeserializable @Generated("org.opensearch.client.codegen.CodeGenerator") -public class MinAggregate extends SingleMetricAggregateBase - implements - AggregateVariant, - ToCopyableBuilder { +public class MinAggregate extends SingleMetricAggregateBase implements ToCopyableBuilder { // --------------------------------------------------------------------------------------------- @@ -66,14 +63,6 @@ public static MinAggregate of(Function { +public class MinAggregation extends FormatMetricAggregationBase implements ToCopyableBuilder { @Nullable private final ValueType valueType; @@ -74,14 +71,6 @@ public static MinAggregation of(Function { // --------------------------------------------------------------------------------------------- @@ -66,14 +65,6 @@ public static MinBucketAggregation of(Function { +public class MissingAggregate extends SingleBucketAggregateBase implements ToCopyableBuilder { // --------------------------------------------------------------------------------------------- @@ -66,14 +63,6 @@ public static MissingAggregate of(Function { + PlainJsonSerializable, + ToCopyableBuilder { @Nullable private final String field; @@ -69,24 +71,15 @@ public class MissingAggregation extends BucketAggregationBase // --------------------------------------------------------------------------------------------- - private MissingAggregation(Builder builder) { - super(builder); + private MissingAggregationFields(Builder builder) { this.field = builder.field; this.missing = builder.missing; } - public static MissingAggregation of(Function> fn) { + public static MissingAggregationFields of(Function> fn) { return fn.apply(new Builder()).build(); } - /** - * {@link Aggregation} variant kind. - */ - @Override - public Aggregation.Kind _aggregationKind() { - return Aggregation.Kind.Missing; - } - /** * API name: {@code field} */ @@ -103,8 +96,17 @@ public final FieldValue missing() { return this.missing; } + /** + * Serialize this object to JSON. + */ + @Override + public void serialize(JsonGenerator generator, JsonpMapper mapper) { + generator.writeStartObject(); + serializeInternal(generator, mapper); + generator.writeEnd(); + } + protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { - super.serializeInternal(generator, mapper); if (this.field != null) { generator.writeKey("field"); generator.write(this.field); @@ -130,11 +132,9 @@ public static Builder builder() { } /** - * Builder for {@link MissingAggregation}. + * Builder for {@link MissingAggregationFields}. */ - public static class Builder extends BucketAggregationBase.AbstractBuilder - implements - CopyableBuilder { + public static class Builder extends ObjectBuilderBase implements CopyableBuilder { @Nullable private String field; @Nullable @@ -142,14 +142,12 @@ public static class Builder extends BucketAggregationBase.AbstractBuilder _DESERIALIZER = ObjectBuilderDeserializer.lazy( + public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer.lazy( Builder::new, - MissingAggregation::setupMissingAggregationDeserializer + MissingAggregationFields::setupMissingAggregationFieldsDeserializer ); - protected static void setupMissingAggregationDeserializer(ObjectDeserializer op) { - setupBucketAggregationBaseDeserializer(op); + protected static void setupMissingAggregationFieldsDeserializer(ObjectDeserializer op) { op.add(Builder::field, JsonpDeserializer.stringDeserializer(), "field"); op.add(Builder::missing, FieldValue._DESERIALIZER, "missing"); } @Override public int hashCode() { - int result = super.hashCode(); + int result = 17; result = 31 * result + Objects.hashCode(this.field); result = 31 * result + Objects.hashCode(this.missing); return result; @@ -232,12 +223,9 @@ public int hashCode() { @Override public boolean equals(Object o) { - if (!super.equals(o)) { - return false; - } if (this == o) return true; if (o == null || this.getClass() != o.getClass()) return false; - MissingAggregation other = (MissingAggregation) o; + MissingAggregationFields other = (MissingAggregationFields) o; return Objects.equals(this.field, other.field) && Objects.equals(this.missing, other.missing); } } diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/aggregations/MovingAverageAggregation.java b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/aggregations/MovingAverageAggregation.java index 514a973f88..b60b6f931f 100644 --- a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/aggregations/MovingAverageAggregation.java +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/aggregations/MovingAverageAggregation.java @@ -61,7 +61,6 @@ public class MovingAverageAggregation implements TaggedUnion, - AggregationVariant, PlainJsonSerializable { /** * {@link MovingAverageAggregation} variant kinds. @@ -85,14 +84,6 @@ public String jsonValue() { } } - /** - * {@link Aggregation} variant kind. - */ - @Override - public Aggregation.Kind _aggregationKind() { - return Aggregation.Kind.MovingAvg; - } - private final Kind _kind; private final MovingAverageAggregationVariant _value; diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/aggregations/MovingFunctionAggregation.java b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/aggregations/MovingFunctionAggregation.java index 94de3d738f..346accd644 100644 --- a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/aggregations/MovingFunctionAggregation.java +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/aggregations/MovingFunctionAggregation.java @@ -57,7 +57,6 @@ @Generated("org.opensearch.client.codegen.CodeGenerator") public class MovingFunctionAggregation extends PipelineAggregationBase implements - AggregationVariant, ToCopyableBuilder { @Nullable @@ -82,14 +81,6 @@ public static MovingFunctionAggregation of(Function diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/aggregations/MovingPercentilesAggregation.java b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/aggregations/MovingPercentilesAggregation.java index 2601c8fefd..ea40a98777 100644 --- a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/aggregations/MovingPercentilesAggregation.java +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/aggregations/MovingPercentilesAggregation.java @@ -57,7 +57,6 @@ @Generated("org.opensearch.client.codegen.CodeGenerator") public class MovingPercentilesAggregation extends PipelineAggregationBase implements - AggregationVariant, ToCopyableBuilder { @Nullable @@ -84,14 +83,6 @@ public static MovingPercentilesAggregation of( return fn.apply(new Builder()).build(); } - /** - * {@link Aggregation} variant kind. - */ - @Override - public Aggregation.Kind _aggregationKind() { - return Aggregation.Kind.MovingPercentiles; - } - /** * API name: {@code keyed} */ diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/aggregations/MultiBucketAggregateBase.java b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/aggregations/MultiBucketAggregateBase.java index 107dc55fd7..7aa79903da 100644 --- a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/aggregations/MultiBucketAggregateBase.java +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/aggregations/MultiBucketAggregateBase.java @@ -43,13 +43,15 @@ import org.opensearch.client.json.JsonpDeserializer; import org.opensearch.client.json.JsonpMapper; import org.opensearch.client.json.ObjectDeserializer; +import org.opensearch.client.json.PlainJsonSerializable; import org.opensearch.client.util.ApiTypeHelper; import org.opensearch.client.util.ObjectBuilder; +import org.opensearch.client.util.ObjectBuilderBase; // typedef: _types.aggregations.MultiBucketAggregateBase @Generated("org.opensearch.client.codegen.CodeGenerator") -public abstract class MultiBucketAggregateBase extends AggregateBase { +public abstract class MultiBucketAggregateBase implements PlainJsonSerializable { @Nonnull private final Buckets buckets; @@ -57,7 +59,6 @@ public abstract class MultiBucketAggregateBase extends AggregateBase { // --------------------------------------------------------------------------------------------- protected MultiBucketAggregateBase(AbstractBuilder builder) { - super(builder); this.buckets = ApiTypeHelper.requireNonNull(builder.buckets, this, "buckets"); } @@ -69,30 +70,39 @@ public final Buckets buckets() { return this.buckets; } + /** + * Serialize this object to JSON. + */ + @Override + public void serialize(JsonGenerator generator, JsonpMapper mapper) { + generator.writeStartObject(); + serializeInternal(generator, mapper); + generator.writeEnd(); + } + protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { - super.serializeInternal(generator, mapper); generator.writeKey("buckets"); this.buckets.serialize(generator, mapper); } // --------------------------------------------------------------------------------------------- - public abstract static class AbstractBuilder> extends - AggregateBase.AbstractBuilder { + public abstract static class AbstractBuilder> extends ObjectBuilderBase { private Buckets buckets; protected AbstractBuilder() {} protected AbstractBuilder(MultiBucketAggregateBase o) { - super(o); this.buckets = o.buckets; } protected AbstractBuilder(AbstractBuilder o) { - super(o); this.buckets = o.buckets; } + @Nonnull + protected abstract BuilderT self(); + /** * Required - API name: {@code buckets} */ @@ -117,22 +127,18 @@ protected static > ObjectDeserializer op, JsonpDeserializer tBucketDeserializer ) { - setupAggregateBaseDeserializer(op); op.add(AbstractBuilder::buckets, Buckets.createBucketsDeserializer(tBucketDeserializer), "buckets"); } @Override public int hashCode() { - int result = super.hashCode(); + int result = 17; result = 31 * result + this.buckets.hashCode(); return result; } @Override public boolean equals(Object o) { - if (!super.equals(o)) { - return false; - } if (this == o) return true; if (o == null || this.getClass() != o.getClass()) return false; MultiBucketAggregateBase other = (MultiBucketAggregateBase) o; diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/aggregations/MultiBucketBase.java b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/aggregations/MultiBucketBase.java index b03c37934f..2873d12a79 100644 --- a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/aggregations/MultiBucketBase.java +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/aggregations/MultiBucketBase.java @@ -44,7 +44,6 @@ import javax.annotation.Generated; import javax.annotation.Nonnull; import javax.annotation.Nullable; -import org.opensearch.client.json.ExternallyTaggedUnion; import org.opensearch.client.json.JsonpDeserializer; import org.opensearch.client.json.JsonpMapper; import org.opensearch.client.json.ObjectDeserializer; @@ -96,7 +95,10 @@ public void serialize(JsonGenerator generator, JsonpMapper mapper) { } protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { - ExternallyTaggedUnion.serializeTypedKeysInner(this.aggregations, generator, mapper); + for (Map.Entry item0 : this.aggregations.entrySet()) { + generator.writeKey(item0.getKey()); + item0.getValue().serialize(generator, mapper); + } generator.writeKey("doc_count"); generator.write(this.docCount); } @@ -179,7 +181,7 @@ protected static > void setupMultiBuc if (builder.aggregations == null) { builder.aggregations = new HashMap<>(); } - Aggregate._TYPED_KEYS_DESERIALIZER.deserializeEntry(name, parser, mapper, builder.aggregations); + builder.aggregations.put(name, Aggregate._DESERIALIZER.deserialize(parser, mapper)); }); } diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/aggregations/MultiTermsAggregate.java b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/aggregations/MultiTermsAggregate.java index f0be401d7c..0332601fa5 100644 --- a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/aggregations/MultiTermsAggregate.java +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/aggregations/MultiTermsAggregate.java @@ -53,7 +53,6 @@ @Generated("org.opensearch.client.codegen.CodeGenerator") public class MultiTermsAggregate extends TermsAggregateBase implements - AggregateVariant, ToCopyableBuilder { // --------------------------------------------------------------------------------------------- @@ -66,14 +65,6 @@ public static MultiTermsAggregate of(Function { + PlainJsonSerializable, + ToCopyableBuilder { @Nullable private final TermsAggregationCollectMode collectMode; @@ -88,8 +90,7 @@ public class MultiTermsAggregation extends BucketAggregationBase // --------------------------------------------------------------------------------------------- - private MultiTermsAggregation(Builder builder) { - super(builder); + private MultiTermsAggregationFields(Builder builder) { this.collectMode = builder.collectMode; this.minDocCount = builder.minDocCount; this.order = builder.order; @@ -100,18 +101,12 @@ private MultiTermsAggregation(Builder builder) { this.terms = ApiTypeHelper.unmodifiableRequired(builder.terms, this, "terms"); } - public static MultiTermsAggregation of(Function> fn) { + public static MultiTermsAggregationFields of( + Function> fn + ) { return fn.apply(new Builder()).build(); } - /** - * {@link Aggregation} variant kind. - */ - @Override - public Aggregation.Kind _aggregationKind() { - return Aggregation.Kind.MultiTerms; - } - /** * API name: {@code collect_mode} */ @@ -195,8 +190,17 @@ public final List terms() { return this.terms; } + /** + * Serialize this object to JSON. + */ + @Override + public void serialize(JsonGenerator generator, JsonpMapper mapper) { + generator.writeStartObject(); + serializeInternal(generator, mapper); + generator.writeEnd(); + } + protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { - super.serializeInternal(generator, mapper); if (this.collectMode != null) { generator.writeKey("collect_mode"); this.collectMode.serialize(generator, mapper); @@ -254,11 +258,9 @@ public static Builder builder() { } /** - * Builder for {@link MultiTermsAggregation}. + * Builder for {@link MultiTermsAggregationFields}. */ - public static class Builder extends BucketAggregationBase.AbstractBuilder - implements - CopyableBuilder { + public static class Builder extends ObjectBuilderBase implements CopyableBuilder { @Nullable private TermsAggregationCollectMode collectMode; @Nullable @@ -277,8 +279,7 @@ public static class Builder extends BucketAggregationBase.AbstractBuilder _DESERIALIZER = ObjectBuilderDeserializer.lazy( + public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer.lazy( Builder::new, - MultiTermsAggregation::setupMultiTermsAggregationDeserializer + MultiTermsAggregationFields::setupMultiTermsAggregationFieldsDeserializer ); - protected static void setupMultiTermsAggregationDeserializer(ObjectDeserializer op) { - setupBucketAggregationBaseDeserializer(op); + protected static void setupMultiTermsAggregationFieldsDeserializer(ObjectDeserializer op) { op.add(Builder::collectMode, TermsAggregationCollectMode._DESERIALIZER, "collect_mode"); op.add(Builder::minDocCount, JsonpDeserializer.integerDeserializer(), "min_doc_count"); op.add(Builder::order, HistogramOrder._DESERIALIZER, "order"); @@ -485,7 +478,7 @@ protected static void setupMultiTermsAggregationDeserializer(ObjectDeserializer< @Override public int hashCode() { - int result = super.hashCode(); + int result = 17; result = 31 * result + Objects.hashCode(this.collectMode); result = 31 * result + Objects.hashCode(this.minDocCount); result = 31 * result + Objects.hashCode(this.order); @@ -499,12 +492,9 @@ public int hashCode() { @Override public boolean equals(Object o) { - if (!super.equals(o)) { - return false; - } if (this == o) return true; if (o == null || this.getClass() != o.getClass()) return false; - MultiTermsAggregation other = (MultiTermsAggregation) o; + MultiTermsAggregationFields other = (MultiTermsAggregationFields) o; return Objects.equals(this.collectMode, other.collectMode) && Objects.equals(this.minDocCount, other.minDocCount) && Objects.equals(this.order, other.order) diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/aggregations/NestedAggregate.java b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/aggregations/NestedAggregate.java index be203283ad..b5453f36f0 100644 --- a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/aggregations/NestedAggregate.java +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/aggregations/NestedAggregate.java @@ -51,10 +51,7 @@ @JsonpDeserializable @Generated("org.opensearch.client.codegen.CodeGenerator") -public class NestedAggregate extends SingleBucketAggregateBase - implements - AggregateVariant, - ToCopyableBuilder { +public class NestedAggregate extends SingleBucketAggregateBase implements ToCopyableBuilder { // --------------------------------------------------------------------------------------------- @@ -66,14 +63,6 @@ public static NestedAggregate of(Function { + PlainJsonSerializable, + ToCopyableBuilder { @Nullable private final String path; // --------------------------------------------------------------------------------------------- - private NestedAggregation(Builder builder) { - super(builder); + private NestedAggregationFields(Builder builder) { this.path = builder.path; } - public static NestedAggregation of(Function> fn) { + public static NestedAggregationFields of(Function> fn) { return fn.apply(new Builder()).build(); } - /** - * {@link Aggregation} variant kind. - */ - @Override - public Aggregation.Kind _aggregationKind() { - return Aggregation.Kind.Nested; - } - /** * API name: {@code path} */ @@ -90,8 +83,17 @@ public final String path() { return this.path; } + /** + * Serialize this object to JSON. + */ + @Override + public void serialize(JsonGenerator generator, JsonpMapper mapper) { + generator.writeStartObject(); + serializeInternal(generator, mapper); + generator.writeEnd(); + } + protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { - super.serializeInternal(generator, mapper); if (this.path != null) { generator.writeKey("path"); generator.write(this.path); @@ -112,23 +114,19 @@ public static Builder builder() { } /** - * Builder for {@link NestedAggregation}. + * Builder for {@link NestedAggregationFields}. */ - public static class Builder extends BucketAggregationBase.AbstractBuilder - implements - CopyableBuilder { + public static class Builder extends ObjectBuilderBase implements CopyableBuilder { @Nullable private String path; public Builder() {} - private Builder(NestedAggregation o) { - super(o); + private Builder(NestedAggregationFields o) { this.path = o.path; } private Builder(Builder o) { - super(o); this.path = o.path; } @@ -138,12 +136,6 @@ public Builder copy() { return new Builder(this); } - @Override - @Nonnull - protected Builder self() { - return this; - } - /** * API name: {@code path} */ @@ -154,49 +146,45 @@ public final Builder path(@Nullable String value) { } /** - * Builds a {@link NestedAggregation}. + * Builds a {@link NestedAggregationFields}. * * @throws NullPointerException if some of the required fields are null. */ @Override @Nonnull - public NestedAggregation build() { + public NestedAggregationFields build() { _checkSingleUse(); - return new NestedAggregation(this); + return new NestedAggregationFields(this); } } // --------------------------------------------------------------------------------------------- /** - * Json deserializer for {@link NestedAggregation} + * Json deserializer for {@link NestedAggregationFields} */ - public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer.lazy( + public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer.lazy( Builder::new, - NestedAggregation::setupNestedAggregationDeserializer + NestedAggregationFields::setupNestedAggregationFieldsDeserializer ); - protected static void setupNestedAggregationDeserializer(ObjectDeserializer op) { - setupBucketAggregationBaseDeserializer(op); + protected static void setupNestedAggregationFieldsDeserializer(ObjectDeserializer op) { op.add(Builder::path, JsonpDeserializer.stringDeserializer(), "path"); } @Override public int hashCode() { - int result = super.hashCode(); + int result = 17; result = 31 * result + Objects.hashCode(this.path); return result; } @Override public boolean equals(Object o) { - if (!super.equals(o)) { - return false; - } if (this == o) return true; if (o == null || this.getClass() != o.getClass()) return false; - NestedAggregation other = (NestedAggregation) o; + NestedAggregationFields other = (NestedAggregationFields) o; return Objects.equals(this.path, other.path); } } diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/aggregations/NormalizeAggregation.java b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/aggregations/NormalizeAggregation.java index 09c682f963..6efe19755e 100644 --- a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/aggregations/NormalizeAggregation.java +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/aggregations/NormalizeAggregation.java @@ -57,7 +57,6 @@ @Generated("org.opensearch.client.codegen.CodeGenerator") public class NormalizeAggregation extends PipelineAggregationBase implements - AggregationVariant, ToCopyableBuilder { @Nullable @@ -74,14 +73,6 @@ public static NormalizeAggregation of(Function { +public class ParentAggregate extends SingleBucketAggregateBase implements ToCopyableBuilder { // --------------------------------------------------------------------------------------------- @@ -66,14 +63,6 @@ public static ParentAggregate of(Function { + PlainJsonSerializable, + ToCopyableBuilder { @Nullable private final String type; // --------------------------------------------------------------------------------------------- - private ChildrenAggregation(Builder builder) { - super(builder); + private ParentAggregationFields(Builder builder) { this.type = builder.type; } - public static ChildrenAggregation of(Function> fn) { + public static ParentAggregationFields of(Function> fn) { return fn.apply(new Builder()).build(); } - /** - * {@link Aggregation} variant kind. - */ - @Override - public Aggregation.Kind _aggregationKind() { - return Aggregation.Kind.Children; - } - /** * API name: {@code type} */ @@ -90,8 +83,17 @@ public final String type() { return this.type; } + /** + * Serialize this object to JSON. + */ + @Override + public void serialize(JsonGenerator generator, JsonpMapper mapper) { + generator.writeStartObject(); + serializeInternal(generator, mapper); + generator.writeEnd(); + } + protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { - super.serializeInternal(generator, mapper); if (this.type != null) { generator.writeKey("type"); generator.write(this.type); @@ -112,23 +114,19 @@ public static Builder builder() { } /** - * Builder for {@link ChildrenAggregation}. + * Builder for {@link ParentAggregationFields}. */ - public static class Builder extends BucketAggregationBase.AbstractBuilder - implements - CopyableBuilder { + public static class Builder extends ObjectBuilderBase implements CopyableBuilder { @Nullable private String type; public Builder() {} - private Builder(ChildrenAggregation o) { - super(o); + private Builder(ParentAggregationFields o) { this.type = o.type; } private Builder(Builder o) { - super(o); this.type = o.type; } @@ -138,12 +136,6 @@ public Builder copy() { return new Builder(this); } - @Override - @Nonnull - protected Builder self() { - return this; - } - /** * API name: {@code type} */ @@ -154,49 +146,45 @@ public final Builder type(@Nullable String value) { } /** - * Builds a {@link ChildrenAggregation}. + * Builds a {@link ParentAggregationFields}. * * @throws NullPointerException if some of the required fields are null. */ @Override @Nonnull - public ChildrenAggregation build() { + public ParentAggregationFields build() { _checkSingleUse(); - return new ChildrenAggregation(this); + return new ParentAggregationFields(this); } } // --------------------------------------------------------------------------------------------- /** - * Json deserializer for {@link ChildrenAggregation} + * Json deserializer for {@link ParentAggregationFields} */ - public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer.lazy( + public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer.lazy( Builder::new, - ChildrenAggregation::setupChildrenAggregationDeserializer + ParentAggregationFields::setupParentAggregationFieldsDeserializer ); - protected static void setupChildrenAggregationDeserializer(ObjectDeserializer op) { - setupBucketAggregationBaseDeserializer(op); + protected static void setupParentAggregationFieldsDeserializer(ObjectDeserializer op) { op.add(Builder::type, JsonpDeserializer.stringDeserializer(), "type"); } @Override public int hashCode() { - int result = super.hashCode(); + int result = 17; result = 31 * result + Objects.hashCode(this.type); return result; } @Override public boolean equals(Object o) { - if (!super.equals(o)) { - return false; - } if (this == o) return true; if (o == null || this.getClass() != o.getClass()) return false; - ChildrenAggregation other = (ChildrenAggregation) o; + ParentAggregationFields other = (ParentAggregationFields) o; return Objects.equals(this.type, other.type); } } diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/aggregations/PercentileRanksAggregation.java b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/aggregations/PercentileRanksAggregation.java index a232ff5c75..9dbceef1fa 100644 --- a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/aggregations/PercentileRanksAggregation.java +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/aggregations/PercentileRanksAggregation.java @@ -59,7 +59,6 @@ @Generated("org.opensearch.client.codegen.CodeGenerator") public class PercentileRanksAggregation extends FormatMetricAggregationBase implements - AggregationVariant, ToCopyableBuilder { @Nullable @@ -90,14 +89,6 @@ public static PercentileRanksAggregation of( return fn.apply(new Builder()).build(); } - /** - * {@link Aggregation} variant kind. - */ - @Override - public Aggregation.Kind _aggregationKind() { - return Aggregation.Kind.PercentileRanks; - } - /** * API name: {@code hdr} */ diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/aggregations/PercentilesAggregateBase.java b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/aggregations/PercentilesAggregateBase.java index f911308d51..2a4c117b0e 100644 --- a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/aggregations/PercentilesAggregateBase.java +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/aggregations/PercentilesAggregateBase.java @@ -42,13 +42,15 @@ import javax.annotation.Nonnull; import org.opensearch.client.json.JsonpMapper; import org.opensearch.client.json.ObjectDeserializer; +import org.opensearch.client.json.PlainJsonSerializable; import org.opensearch.client.util.ApiTypeHelper; import org.opensearch.client.util.ObjectBuilder; +import org.opensearch.client.util.ObjectBuilderBase; // typedef: _types.aggregations.PercentilesAggregateBase @Generated("org.opensearch.client.codegen.CodeGenerator") -public abstract class PercentilesAggregateBase extends AggregateBase { +public abstract class PercentilesAggregateBase implements PlainJsonSerializable { @Nonnull private final Percentiles values; @@ -56,7 +58,6 @@ public abstract class PercentilesAggregateBase extends AggregateBase { // --------------------------------------------------------------------------------------------- protected PercentilesAggregateBase(AbstractBuilder builder) { - super(builder); this.values = ApiTypeHelper.requireNonNull(builder.values, this, "values"); } @@ -68,30 +69,39 @@ public final Percentiles values() { return this.values; } + /** + * Serialize this object to JSON. + */ + @Override + public void serialize(JsonGenerator generator, JsonpMapper mapper) { + generator.writeStartObject(); + serializeInternal(generator, mapper); + generator.writeEnd(); + } + protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { - super.serializeInternal(generator, mapper); generator.writeKey("values"); this.values.serialize(generator, mapper); } // --------------------------------------------------------------------------------------------- - public abstract static class AbstractBuilder> extends AggregateBase.AbstractBuilder< - BuilderT> { + public abstract static class AbstractBuilder> extends ObjectBuilderBase { private Percentiles values; protected AbstractBuilder() {} protected AbstractBuilder(PercentilesAggregateBase o) { - super(o); this.values = o.values; } protected AbstractBuilder(AbstractBuilder o) { - super(o); this.values = o.values; } + @Nonnull + protected abstract BuilderT self(); + /** * Required - API name: {@code values} */ @@ -115,22 +125,18 @@ public final BuilderT values(Function> void setupPercentilesAggregateBaseDeserializer( ObjectDeserializer op ) { - setupAggregateBaseDeserializer(op); op.add(AbstractBuilder::values, Percentiles._DESERIALIZER, "values"); } @Override public int hashCode() { - int result = super.hashCode(); + int result = 17; result = 31 * result + this.values.hashCode(); return result; } @Override public boolean equals(Object o) { - if (!super.equals(o)) { - return false; - } if (this == o) return true; if (o == null || this.getClass() != o.getClass()) return false; PercentilesAggregateBase other = (PercentilesAggregateBase) o; diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/aggregations/PercentilesAggregation.java b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/aggregations/PercentilesAggregation.java index 9ae33bbc3a..122b6605fc 100644 --- a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/aggregations/PercentilesAggregation.java +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/aggregations/PercentilesAggregation.java @@ -59,7 +59,6 @@ @Generated("org.opensearch.client.codegen.CodeGenerator") public class PercentilesAggregation extends FormatMetricAggregationBase implements - AggregationVariant, ToCopyableBuilder { @Nullable @@ -88,14 +87,6 @@ public static PercentilesAggregation of(Function { // --------------------------------------------------------------------------------------------- @@ -68,14 +67,6 @@ public static PercentilesBucketAggregate of( return fn.apply(new Builder()).build(); } - /** - * {@link Aggregate} variant kind. - */ - @Override - public Aggregate.Kind _aggregateKind() { - return Aggregate.Kind.PercentilesBucket; - } - // --------------------------------------------------------------------------------------------- @Override diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/aggregations/PercentilesBucketAggregation.java b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/aggregations/PercentilesBucketAggregation.java index 40342e194c..fb225775c9 100644 --- a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/aggregations/PercentilesBucketAggregation.java +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/aggregations/PercentilesBucketAggregation.java @@ -59,7 +59,6 @@ @Generated("org.opensearch.client.codegen.CodeGenerator") public class PercentilesBucketAggregation extends PipelineAggregationBase implements - AggregationVariant, ToCopyableBuilder { @Nonnull @@ -78,14 +77,6 @@ public static PercentilesBucketAggregation of( return fn.apply(new Builder()).build(); } - /** - * {@link Aggregation} variant kind. - */ - @Override - public Aggregation.Kind _aggregationKind() { - return Aggregation.Kind.PercentilesBucket; - } - /** * The list of percentiles to calculate. *

diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/aggregations/RangeAggregate.java b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/aggregations/RangeAggregate.java index 806699f3e0..b34c3d948a 100644 --- a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/aggregations/RangeAggregate.java +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/aggregations/RangeAggregate.java @@ -51,10 +51,7 @@ @JsonpDeserializable @Generated("org.opensearch.client.codegen.CodeGenerator") -public class RangeAggregate extends RangeAggregateBase - implements - AggregateVariant, - ToCopyableBuilder { +public class RangeAggregate extends RangeAggregateBase implements ToCopyableBuilder { // --------------------------------------------------------------------------------------------- @@ -66,14 +63,6 @@ public static RangeAggregate of(Function { + PlainJsonSerializable, + ToCopyableBuilder { @Nullable private final String field; @@ -83,8 +85,7 @@ public class RangeAggregation extends BucketAggregationBase // --------------------------------------------------------------------------------------------- - private RangeAggregation(Builder builder) { - super(builder); + private RangeAggregationFields(Builder builder) { this.field = builder.field; this.format = builder.format; this.keyed = builder.keyed; @@ -93,18 +94,10 @@ private RangeAggregation(Builder builder) { this.script = builder.script; } - public static RangeAggregation of(Function> fn) { + public static RangeAggregationFields of(Function> fn) { return fn.apply(new Builder()).build(); } - /** - * {@link Aggregation} variant kind. - */ - @Override - public Aggregation.Kind _aggregationKind() { - return Aggregation.Kind.Range; - } - /** * API name: {@code field} */ @@ -162,8 +155,17 @@ public final Script script() { return this.script; } + /** + * Serialize this object to JSON. + */ + @Override + public void serialize(JsonGenerator generator, JsonpMapper mapper) { + generator.writeStartObject(); + serializeInternal(generator, mapper); + generator.writeEnd(); + } + protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { - super.serializeInternal(generator, mapper); if (this.field != null) { generator.writeKey("field"); generator.write(this.field); @@ -213,11 +215,9 @@ public static Builder builder() { } /** - * Builder for {@link RangeAggregation}. + * Builder for {@link RangeAggregationFields}. */ - public static class Builder extends BucketAggregationBase.AbstractBuilder - implements - CopyableBuilder { + public static class Builder extends ObjectBuilderBase implements CopyableBuilder { @Nullable private String field; @Nullable @@ -233,8 +233,7 @@ public static class Builder extends BucketAggregationBase.AbstractBuilder> fn) } /** - * Builds a {@link RangeAggregation}. + * Builds a {@link RangeAggregationFields}. * * @throws NullPointerException if some of the required fields are null. */ @Override @Nonnull - public RangeAggregation build() { + public RangeAggregationFields build() { _checkSingleUse(); - return new RangeAggregation(this); + return new RangeAggregationFields(this); } } // --------------------------------------------------------------------------------------------- /** - * Json deserializer for {@link RangeAggregation} + * Json deserializer for {@link RangeAggregationFields} */ - public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer.lazy( + public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer.lazy( Builder::new, - RangeAggregation::setupRangeAggregationDeserializer + RangeAggregationFields::setupRangeAggregationFieldsDeserializer ); - protected static void setupRangeAggregationDeserializer(ObjectDeserializer op) { - setupBucketAggregationBaseDeserializer(op); + protected static void setupRangeAggregationFieldsDeserializer(ObjectDeserializer op) { op.add(Builder::field, JsonpDeserializer.stringDeserializer(), "field"); op.add(Builder::format, JsonpDeserializer.stringDeserializer(), "format"); op.add(Builder::keyed, JsonpDeserializer.booleanDeserializer(), "keyed"); @@ -407,7 +398,7 @@ protected static void setupRangeAggregationDeserializer(ObjectDeserializer { + PlainJsonSerializable, + ToCopyableBuilder { @Nullable private final TermsExclude exclude; @@ -84,8 +86,7 @@ public class RareTermsAggregation extends BucketAggregationBase // --------------------------------------------------------------------------------------------- - private RareTermsAggregation(Builder builder) { - super(builder); + private RareTermsAggregationFields(Builder builder) { this.exclude = builder.exclude; this.field = builder.field; this.include = builder.include; @@ -95,18 +96,12 @@ private RareTermsAggregation(Builder builder) { this.valueType = builder.valueType; } - public static RareTermsAggregation of(Function> fn) { + public static RareTermsAggregationFields of( + Function> fn + ) { return fn.apply(new Builder()).build(); } - /** - * {@link Aggregation} variant kind. - */ - @Override - public Aggregation.Kind _aggregationKind() { - return Aggregation.Kind.RareTerms; - } - /** * API name: {@code exclude} */ @@ -169,8 +164,17 @@ public final String valueType() { return this.valueType; } + /** + * Serialize this object to JSON. + */ + @Override + public void serialize(JsonGenerator generator, JsonpMapper mapper) { + generator.writeStartObject(); + serializeInternal(generator, mapper); + generator.writeEnd(); + } + protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { - super.serializeInternal(generator, mapper); if (this.exclude != null) { generator.writeKey("exclude"); this.exclude.serialize(generator, mapper); @@ -221,11 +225,9 @@ public static Builder builder() { } /** - * Builder for {@link RareTermsAggregation}. + * Builder for {@link RareTermsAggregationFields}. */ - public static class Builder extends BucketAggregationBase.AbstractBuilder - implements - CopyableBuilder { + public static class Builder extends ObjectBuilderBase implements CopyableBuilder { @Nullable private TermsExclude exclude; @Nullable @@ -243,8 +245,7 @@ public static class Builder extends BucketAggregationBase.AbstractBuilder _DESERIALIZER = ObjectBuilderDeserializer.lazy( + public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer.lazy( Builder::new, - RareTermsAggregation::setupRareTermsAggregationDeserializer + RareTermsAggregationFields::setupRareTermsAggregationFieldsDeserializer ); - protected static void setupRareTermsAggregationDeserializer(ObjectDeserializer op) { - setupBucketAggregationBaseDeserializer(op); + protected static void setupRareTermsAggregationFieldsDeserializer(ObjectDeserializer op) { op.add(Builder::exclude, TermsExclude._DESERIALIZER, "exclude"); op.add(Builder::field, JsonpDeserializer.stringDeserializer(), "field"); op.add(Builder::include, TermsInclude._DESERIALIZER, "include"); @@ -407,7 +400,7 @@ protected static void setupRareTermsAggregationDeserializer(ObjectDeserializer { +public class RateAggregate implements PlainJsonSerializable, ToCopyableBuilder { private final double value; @@ -66,7 +68,6 @@ public class RateAggregate extends AggregateBase implements AggregateVariant, To // --------------------------------------------------------------------------------------------- private RateAggregate(Builder builder) { - super(builder); this.value = ApiTypeHelper.requireNonNull(builder.value, this, "value"); this.valueAsString = builder.valueAsString; } @@ -75,14 +76,6 @@ public static RateAggregate of(Function implements CopyableBuilder { + public static class Builder extends ObjectBuilderBase implements CopyableBuilder { private Double value; @Nullable private String valueAsString; @@ -133,13 +135,11 @@ public static class Builder extends AggregateBase.AbstractBuilder imple public Builder() {} private Builder(RateAggregate o) { - super(o); this.value = o.value; this.valueAsString = o.valueAsString; } private Builder(Builder o) { - super(o); this.value = o.value; this.valueAsString = o.valueAsString; } @@ -150,12 +150,6 @@ public Builder copy() { return new Builder(this); } - @Override - @Nonnull - protected Builder self() { - return this; - } - /** * Required - API name: {@code value} */ @@ -199,14 +193,13 @@ public RateAggregate build() { ); protected static void setupRateAggregateDeserializer(ObjectDeserializer op) { - setupAggregateBaseDeserializer(op); op.add(Builder::value, JsonpDeserializer.doubleDeserializer(), "value"); op.add(Builder::valueAsString, JsonpDeserializer.stringDeserializer(), "value_as_string"); } @Override public int hashCode() { - int result = super.hashCode(); + int result = 17; result = 31 * result + Double.hashCode(this.value); result = 31 * result + Objects.hashCode(this.valueAsString); return result; @@ -214,9 +207,6 @@ public int hashCode() { @Override public boolean equals(Object o) { - if (!super.equals(o)) { - return false; - } if (this == o) return true; if (o == null || this.getClass() != o.getClass()) return false; RateAggregate other = (RateAggregate) o; diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/aggregations/RateAggregation.java b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/aggregations/RateAggregation.java index 1735411696..75e4ab5ef9 100644 --- a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/aggregations/RateAggregation.java +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/aggregations/RateAggregation.java @@ -55,10 +55,7 @@ @JsonpDeserializable @Generated("org.opensearch.client.codegen.CodeGenerator") -public class RateAggregation extends FormatMetricAggregationBase - implements - AggregationVariant, - ToCopyableBuilder { +public class RateAggregation extends FormatMetricAggregationBase implements ToCopyableBuilder { @Nullable private final RateMode mode; @@ -78,14 +75,6 @@ public static RateAggregation of(Function { // --------------------------------------------------------------------------------------------- @@ -66,14 +65,6 @@ public static ReverseNestedAggregate of(Function { + PlainJsonSerializable, + ToCopyableBuilder { @Nullable private final String path; // --------------------------------------------------------------------------------------------- - private ReverseNestedAggregation(Builder builder) { - super(builder); + private ReverseNestedAggregationFields(Builder builder) { this.path = builder.path; } - public static ReverseNestedAggregation of(Function> fn) { + public static ReverseNestedAggregationFields of( + Function> fn + ) { return fn.apply(new Builder()).build(); } - /** - * {@link Aggregation} variant kind. - */ - @Override - public Aggregation.Kind _aggregationKind() { - return Aggregation.Kind.ReverseNested; - } - /** * API name: {@code path} */ @@ -90,8 +85,17 @@ public final String path() { return this.path; } + /** + * Serialize this object to JSON. + */ + @Override + public void serialize(JsonGenerator generator, JsonpMapper mapper) { + generator.writeStartObject(); + serializeInternal(generator, mapper); + generator.writeEnd(); + } + protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { - super.serializeInternal(generator, mapper); if (this.path != null) { generator.writeKey("path"); generator.write(this.path); @@ -112,23 +116,19 @@ public static Builder builder() { } /** - * Builder for {@link ReverseNestedAggregation}. + * Builder for {@link ReverseNestedAggregationFields}. */ - public static class Builder extends BucketAggregationBase.AbstractBuilder - implements - CopyableBuilder { + public static class Builder extends ObjectBuilderBase implements CopyableBuilder { @Nullable private String path; public Builder() {} - private Builder(ReverseNestedAggregation o) { - super(o); + private Builder(ReverseNestedAggregationFields o) { this.path = o.path; } private Builder(Builder o) { - super(o); this.path = o.path; } @@ -138,12 +138,6 @@ public Builder copy() { return new Builder(this); } - @Override - @Nonnull - protected Builder self() { - return this; - } - /** * API name: {@code path} */ @@ -154,49 +148,45 @@ public final Builder path(@Nullable String value) { } /** - * Builds a {@link ReverseNestedAggregation}. + * Builds a {@link ReverseNestedAggregationFields}. * * @throws NullPointerException if some of the required fields are null. */ @Override @Nonnull - public ReverseNestedAggregation build() { + public ReverseNestedAggregationFields build() { _checkSingleUse(); - return new ReverseNestedAggregation(this); + return new ReverseNestedAggregationFields(this); } } // --------------------------------------------------------------------------------------------- /** - * Json deserializer for {@link ReverseNestedAggregation} + * Json deserializer for {@link ReverseNestedAggregationFields} */ - public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer.lazy( + public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer.lazy( Builder::new, - ReverseNestedAggregation::setupReverseNestedAggregationDeserializer + ReverseNestedAggregationFields::setupReverseNestedAggregationFieldsDeserializer ); - protected static void setupReverseNestedAggregationDeserializer(ObjectDeserializer op) { - setupBucketAggregationBaseDeserializer(op); + protected static void setupReverseNestedAggregationFieldsDeserializer(ObjectDeserializer op) { op.add(Builder::path, JsonpDeserializer.stringDeserializer(), "path"); } @Override public int hashCode() { - int result = super.hashCode(); + int result = 17; result = 31 * result + Objects.hashCode(this.path); return result; } @Override public boolean equals(Object o) { - if (!super.equals(o)) { - return false; - } if (this == o) return true; if (o == null || this.getClass() != o.getClass()) return false; - ReverseNestedAggregation other = (ReverseNestedAggregation) o; + ReverseNestedAggregationFields other = (ReverseNestedAggregationFields) o; return Objects.equals(this.path, other.path); } } diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/aggregations/SamplerAggregate.java b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/aggregations/SamplerAggregate.java index 92c786b9ab..5eb0419826 100644 --- a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/aggregations/SamplerAggregate.java +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/aggregations/SamplerAggregate.java @@ -51,10 +51,7 @@ @JsonpDeserializable @Generated("org.opensearch.client.codegen.CodeGenerator") -public class SamplerAggregate extends SingleBucketAggregateBase - implements - AggregateVariant, - ToCopyableBuilder { +public class SamplerAggregate extends SingleBucketAggregateBase implements ToCopyableBuilder { // --------------------------------------------------------------------------------------------- @@ -66,14 +63,6 @@ public static SamplerAggregate of(Function { + PlainJsonSerializable, + ToCopyableBuilder { @Nullable private final Integer shardSize; // --------------------------------------------------------------------------------------------- - private SamplerAggregation(Builder builder) { - super(builder); + private SamplerAggregationFields(Builder builder) { this.shardSize = builder.shardSize; } - public static SamplerAggregation of(Function> fn) { + public static SamplerAggregationFields of(Function> fn) { return fn.apply(new Builder()).build(); } - /** - * {@link Aggregation} variant kind. - */ - @Override - public Aggregation.Kind _aggregationKind() { - return Aggregation.Kind.Sampler; - } - /** * Limits how many top-scoring documents are collected in the sample processed on each shard. *

@@ -93,8 +86,17 @@ public final Integer shardSize() { return this.shardSize; } + /** + * Serialize this object to JSON. + */ + @Override + public void serialize(JsonGenerator generator, JsonpMapper mapper) { + generator.writeStartObject(); + serializeInternal(generator, mapper); + generator.writeEnd(); + } + protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { - super.serializeInternal(generator, mapper); if (this.shardSize != null) { generator.writeKey("shard_size"); generator.write(this.shardSize); @@ -115,23 +117,19 @@ public static Builder builder() { } /** - * Builder for {@link SamplerAggregation}. + * Builder for {@link SamplerAggregationFields}. */ - public static class Builder extends BucketAggregationBase.AbstractBuilder - implements - CopyableBuilder { + public static class Builder extends ObjectBuilderBase implements CopyableBuilder { @Nullable private Integer shardSize; public Builder() {} - private Builder(SamplerAggregation o) { - super(o); + private Builder(SamplerAggregationFields o) { this.shardSize = o.shardSize; } private Builder(Builder o) { - super(o); this.shardSize = o.shardSize; } @@ -141,12 +139,6 @@ public Builder copy() { return new Builder(this); } - @Override - @Nonnull - protected Builder self() { - return this; - } - /** * Limits how many top-scoring documents are collected in the sample processed on each shard. *

@@ -160,49 +152,45 @@ public final Builder shardSize(@Nullable Integer value) { } /** - * Builds a {@link SamplerAggregation}. + * Builds a {@link SamplerAggregationFields}. * * @throws NullPointerException if some of the required fields are null. */ @Override @Nonnull - public SamplerAggregation build() { + public SamplerAggregationFields build() { _checkSingleUse(); - return new SamplerAggregation(this); + return new SamplerAggregationFields(this); } } // --------------------------------------------------------------------------------------------- /** - * Json deserializer for {@link SamplerAggregation} + * Json deserializer for {@link SamplerAggregationFields} */ - public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer.lazy( + public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer.lazy( Builder::new, - SamplerAggregation::setupSamplerAggregationDeserializer + SamplerAggregationFields::setupSamplerAggregationFieldsDeserializer ); - protected static void setupSamplerAggregationDeserializer(ObjectDeserializer op) { - setupBucketAggregationBaseDeserializer(op); + protected static void setupSamplerAggregationFieldsDeserializer(ObjectDeserializer op) { op.add(Builder::shardSize, JsonpDeserializer.integerDeserializer(), "shard_size"); } @Override public int hashCode() { - int result = super.hashCode(); + int result = 17; result = 31 * result + Objects.hashCode(this.shardSize); return result; } @Override public boolean equals(Object o) { - if (!super.equals(o)) { - return false; - } if (this == o) return true; if (o == null || this.getClass() != o.getClass()) return false; - SamplerAggregation other = (SamplerAggregation) o; + SamplerAggregationFields other = (SamplerAggregationFields) o; return Objects.equals(this.shardSize, other.shardSize); } } diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/aggregations/ScriptedMetricAggregate.java b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/aggregations/ScriptedMetricAggregate.java index 6b8aa31876..a8ed380b1f 100644 --- a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/aggregations/ScriptedMetricAggregate.java +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/aggregations/ScriptedMetricAggregate.java @@ -46,18 +46,20 @@ import org.opensearch.client.json.JsonpMapper; import org.opensearch.client.json.ObjectBuilderDeserializer; import org.opensearch.client.json.ObjectDeserializer; +import org.opensearch.client.json.PlainJsonSerializable; import org.opensearch.client.util.ApiTypeHelper; import org.opensearch.client.util.CopyableBuilder; import org.opensearch.client.util.ObjectBuilder; +import org.opensearch.client.util.ObjectBuilderBase; import org.opensearch.client.util.ToCopyableBuilder; // typedef: _types.aggregations.ScriptedMetricAggregate @JsonpDeserializable @Generated("org.opensearch.client.codegen.CodeGenerator") -public class ScriptedMetricAggregate extends AggregateBase +public class ScriptedMetricAggregate implements - AggregateVariant, + PlainJsonSerializable, ToCopyableBuilder { @Nonnull @@ -66,7 +68,6 @@ public class ScriptedMetricAggregate extends AggregateBase // --------------------------------------------------------------------------------------------- private ScriptedMetricAggregate(Builder builder) { - super(builder); this.value = ApiTypeHelper.requireNonNull(builder.value, this, "value"); } @@ -74,14 +75,6 @@ public static ScriptedMetricAggregate of(Function - implements - CopyableBuilder { + public static class Builder extends ObjectBuilderBase implements CopyableBuilder { private JsonData value; public Builder() {} private Builder(ScriptedMetricAggregate o) { - super(o); this.value = o.value; } private Builder(Builder o) { - super(o); this.value = o.value; } @@ -135,12 +133,6 @@ public Builder copy() { return new Builder(this); } - @Override - @Nonnull - protected Builder self() { - return this; - } - /** * Required - API name: {@code value} */ @@ -175,22 +167,18 @@ public ScriptedMetricAggregate build() { ); protected static void setupScriptedMetricAggregateDeserializer(ObjectDeserializer op) { - setupAggregateBaseDeserializer(op); op.add(Builder::value, JsonData._DESERIALIZER, "value"); } @Override public int hashCode() { - int result = super.hashCode(); + int result = 17; result = 31 * result + this.value.hashCode(); return result; } @Override public boolean equals(Object o) { - if (!super.equals(o)) { - return false; - } if (this == o) return true; if (o == null || this.getClass() != o.getClass()) return false; ScriptedMetricAggregate other = (ScriptedMetricAggregate) o; diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/aggregations/ScriptedMetricAggregation.java b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/aggregations/ScriptedMetricAggregation.java index d34b433fce..bd53cac51a 100644 --- a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/aggregations/ScriptedMetricAggregation.java +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/aggregations/ScriptedMetricAggregation.java @@ -61,7 +61,6 @@ @Generated("org.opensearch.client.codegen.CodeGenerator") public class ScriptedMetricAggregation extends MetricAggregationBase implements - AggregationVariant, ToCopyableBuilder { @Nullable @@ -94,14 +93,6 @@ public static ScriptedMetricAggregation of(Function { @Nullable @@ -76,14 +75,6 @@ public static SerialDifferencingAggregation of( return fn.apply(new Builder()).build(); } - /** - * {@link Aggregation} variant kind. - */ - @Override - public Aggregation.Kind _aggregationKind() { - return Aggregation.Kind.SerialDiff; - } - /** * The historical bucket to subtract from the current value. Must be a positive, non-zero integer. *

diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/aggregations/SignificantLongTermsAggregate.java b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/aggregations/SignificantLongTermsAggregate.java index 801e9bb774..8d4c264081 100644 --- a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/aggregations/SignificantLongTermsAggregate.java +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/aggregations/SignificantLongTermsAggregate.java @@ -53,7 +53,6 @@ @Generated("org.opensearch.client.codegen.CodeGenerator") public class SignificantLongTermsAggregate extends SignificantTermsAggregateBase implements - AggregateVariant, ToCopyableBuilder { // --------------------------------------------------------------------------------------------- @@ -68,14 +67,6 @@ public static SignificantLongTermsAggregate of( return fn.apply(new Builder()).build(); } - /** - * {@link Aggregate} variant kind. - */ - @Override - public Aggregate.Kind _aggregateKind() { - return Aggregate.Kind.Siglterms; - } - // --------------------------------------------------------------------------------------------- @Override diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/aggregations/SignificantStringTermsAggregate.java b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/aggregations/SignificantStringTermsAggregate.java index 3f9ccebf02..4bdb5b6f67 100644 --- a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/aggregations/SignificantStringTermsAggregate.java +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/aggregations/SignificantStringTermsAggregate.java @@ -53,7 +53,6 @@ @Generated("org.opensearch.client.codegen.CodeGenerator") public class SignificantStringTermsAggregate extends SignificantTermsAggregateBase implements - AggregateVariant, ToCopyableBuilder { // --------------------------------------------------------------------------------------------- @@ -68,14 +67,6 @@ public static SignificantStringTermsAggregate of( return fn.apply(new Builder()).build(); } - /** - * {@link Aggregate} variant kind. - */ - @Override - public Aggregate.Kind _aggregateKind() { - return Aggregate.Kind.Sigsterms; - } - // --------------------------------------------------------------------------------------------- @Override diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/aggregations/SignificantTermsAggregation.java b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/aggregations/SignificantTermsAggregationFields.java similarity index 92% rename from java-client/src/generated/java/org/opensearch/client/opensearch/_types/aggregations/SignificantTermsAggregation.java rename to java-client/src/generated/java/org/opensearch/client/opensearch/_types/aggregations/SignificantTermsAggregationFields.java index d3441f10ac..6bb67ae6e1 100644 --- a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/aggregations/SignificantTermsAggregation.java +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/aggregations/SignificantTermsAggregationFields.java @@ -47,20 +47,22 @@ import org.opensearch.client.json.JsonpMapper; import org.opensearch.client.json.ObjectBuilderDeserializer; import org.opensearch.client.json.ObjectDeserializer; +import org.opensearch.client.json.PlainJsonSerializable; import org.opensearch.client.opensearch._types.EmptyObject; import org.opensearch.client.opensearch._types.query_dsl.Query; import org.opensearch.client.util.CopyableBuilder; import org.opensearch.client.util.ObjectBuilder; +import org.opensearch.client.util.ObjectBuilderBase; import org.opensearch.client.util.ToCopyableBuilder; -// typedef: _types.aggregations.SignificantTermsAggregation +// typedef: _types.aggregations.SignificantTermsAggregationFields @JsonpDeserializable @Generated("org.opensearch.client.codegen.CodeGenerator") -public class SignificantTermsAggregation extends BucketAggregationBase +public class SignificantTermsAggregationFields implements - AggregationVariant, - ToCopyableBuilder { + PlainJsonSerializable, + ToCopyableBuilder { @Nullable private final Query backgroundFilter; @@ -109,8 +111,7 @@ public class SignificantTermsAggregation extends BucketAggregationBase // --------------------------------------------------------------------------------------------- - private SignificantTermsAggregation(Builder builder) { - super(builder); + private SignificantTermsAggregationFields(Builder builder) { this.backgroundFilter = builder.backgroundFilter; this.chiSquare = builder.chiSquare; this.exclude = builder.exclude; @@ -128,20 +129,12 @@ private SignificantTermsAggregation(Builder builder) { this.size = builder.size; } - public static SignificantTermsAggregation of( - Function> fn + public static SignificantTermsAggregationFields of( + Function> fn ) { return fn.apply(new Builder()).build(); } - /** - * {@link Aggregation} variant kind. - */ - @Override - public Aggregation.Kind _aggregationKind() { - return Aggregation.Kind.SignificantTerms; - } - /** * API name: {@code background_filter} */ @@ -277,8 +270,17 @@ public final Integer size() { return this.size; } + /** + * Serialize this object to JSON. + */ + @Override + public void serialize(JsonGenerator generator, JsonpMapper mapper) { + generator.writeStartObject(); + serializeInternal(generator, mapper); + generator.writeEnd(); + } + protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { - super.serializeInternal(generator, mapper); if (this.backgroundFilter != null) { generator.writeKey("background_filter"); this.backgroundFilter.serialize(generator, mapper); @@ -369,11 +371,9 @@ public static Builder builder() { } /** - * Builder for {@link SignificantTermsAggregation}. + * Builder for {@link SignificantTermsAggregationFields}. */ - public static class Builder extends BucketAggregationBase.AbstractBuilder - implements - CopyableBuilder { + public static class Builder extends ObjectBuilderBase implements CopyableBuilder { @Nullable private Query backgroundFilter; @Nullable @@ -407,8 +407,7 @@ public static class Builder extends BucketAggregationBase.AbstractBuilder _DESERIALIZER = ObjectBuilderDeserializer.lazy( + public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer.lazy( Builder::new, - SignificantTermsAggregation::setupSignificantTermsAggregationDeserializer + SignificantTermsAggregationFields::setupSignificantTermsAggregationFieldsDeserializer ); - protected static void setupSignificantTermsAggregationDeserializer(ObjectDeserializer op) { - setupBucketAggregationBaseDeserializer(op); + protected static void setupSignificantTermsAggregationFieldsDeserializer( + ObjectDeserializer op + ) { op.add(Builder::backgroundFilter, Query._DESERIALIZER, "background_filter"); op.add(Builder::chiSquare, ChiSquareHeuristic._DESERIALIZER, "chi_square"); op.add(Builder::exclude, TermsExclude._DESERIALIZER, "exclude"); @@ -724,7 +717,7 @@ protected static void setupSignificantTermsAggregationDeserializer(ObjectDeseria @Override public int hashCode() { - int result = super.hashCode(); + int result = 17; result = 31 * result + Objects.hashCode(this.backgroundFilter); result = 31 * result + Objects.hashCode(this.chiSquare); result = 31 * result + Objects.hashCode(this.exclude); @@ -745,12 +738,9 @@ public int hashCode() { @Override public boolean equals(Object o) { - if (!super.equals(o)) { - return false; - } if (this == o) return true; if (o == null || this.getClass() != o.getClass()) return false; - SignificantTermsAggregation other = (SignificantTermsAggregation) o; + SignificantTermsAggregationFields other = (SignificantTermsAggregationFields) o; return Objects.equals(this.backgroundFilter, other.backgroundFilter) && Objects.equals(this.chiSquare, other.chiSquare) && Objects.equals(this.exclude, other.exclude) diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/aggregations/SignificantTextAggregation.java b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/aggregations/SignificantTextAggregationFields.java similarity index 93% rename from java-client/src/generated/java/org/opensearch/client/opensearch/_types/aggregations/SignificantTextAggregation.java rename to java-client/src/generated/java/org/opensearch/client/opensearch/_types/aggregations/SignificantTextAggregationFields.java index 53e22f9abc..0d314d487f 100644 --- a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/aggregations/SignificantTextAggregation.java +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/aggregations/SignificantTextAggregationFields.java @@ -48,21 +48,23 @@ import org.opensearch.client.json.JsonpMapper; import org.opensearch.client.json.ObjectBuilderDeserializer; import org.opensearch.client.json.ObjectDeserializer; +import org.opensearch.client.json.PlainJsonSerializable; import org.opensearch.client.opensearch._types.EmptyObject; import org.opensearch.client.opensearch._types.query_dsl.Query; import org.opensearch.client.util.ApiTypeHelper; import org.opensearch.client.util.CopyableBuilder; import org.opensearch.client.util.ObjectBuilder; +import org.opensearch.client.util.ObjectBuilderBase; import org.opensearch.client.util.ToCopyableBuilder; -// typedef: _types.aggregations.SignificantTextAggregation +// typedef: _types.aggregations.SignificantTextAggregationFields @JsonpDeserializable @Generated("org.opensearch.client.codegen.CodeGenerator") -public class SignificantTextAggregation extends BucketAggregationBase +public class SignificantTextAggregationFields implements - AggregationVariant, - ToCopyableBuilder { + PlainJsonSerializable, + ToCopyableBuilder { @Nullable private final Query backgroundFilter; @@ -117,8 +119,7 @@ public class SignificantTextAggregation extends BucketAggregationBase // --------------------------------------------------------------------------------------------- - private SignificantTextAggregation(Builder builder) { - super(builder); + private SignificantTextAggregationFields(Builder builder) { this.backgroundFilter = builder.backgroundFilter; this.chiSquare = builder.chiSquare; this.exclude = builder.exclude; @@ -138,20 +139,12 @@ private SignificantTextAggregation(Builder builder) { this.sourceFields = ApiTypeHelper.unmodifiable(builder.sourceFields); } - public static SignificantTextAggregation of( - Function> fn + public static SignificantTextAggregationFields of( + Function> fn ) { return fn.apply(new Builder()).build(); } - /** - * {@link Aggregation} variant kind. - */ - @Override - public Aggregation.Kind _aggregationKind() { - return Aggregation.Kind.SignificantText; - } - /** * API name: {@code background_filter} */ @@ -306,8 +299,17 @@ public final List sourceFields() { return this.sourceFields; } + /** + * Serialize this object to JSON. + */ + @Override + public void serialize(JsonGenerator generator, JsonpMapper mapper) { + generator.writeStartObject(); + serializeInternal(generator, mapper); + generator.writeEnd(); + } + protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { - super.serializeInternal(generator, mapper); if (this.backgroundFilter != null) { generator.writeKey("background_filter"); this.backgroundFilter.serialize(generator, mapper); @@ -412,11 +414,9 @@ public static Builder builder() { } /** - * Builder for {@link SignificantTextAggregation}. + * Builder for {@link SignificantTextAggregationFields}. */ - public static class Builder extends BucketAggregationBase.AbstractBuilder - implements - CopyableBuilder { + public static class Builder extends ObjectBuilderBase implements CopyableBuilder { @Nullable private Query backgroundFilter; @Nullable @@ -454,8 +454,7 @@ public static class Builder extends BucketAggregationBase.AbstractBuilder _DESERIALIZER = ObjectBuilderDeserializer.lazy( + public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer.lazy( Builder::new, - SignificantTextAggregation::setupSignificantTextAggregationDeserializer + SignificantTextAggregationFields::setupSignificantTextAggregationFieldsDeserializer ); - protected static void setupSignificantTextAggregationDeserializer(ObjectDeserializer op) { - setupBucketAggregationBaseDeserializer(op); + protected static void setupSignificantTextAggregationFieldsDeserializer( + ObjectDeserializer op + ) { op.add(Builder::backgroundFilter, Query._DESERIALIZER, "background_filter"); op.add(Builder::chiSquare, ChiSquareHeuristic._DESERIALIZER, "chi_square"); op.add(Builder::exclude, TermsExclude._DESERIALIZER, "exclude"); @@ -815,7 +808,7 @@ protected static void setupSignificantTextAggregationDeserializer(ObjectDeserial @Override public int hashCode() { - int result = super.hashCode(); + int result = 17; result = 31 * result + Objects.hashCode(this.backgroundFilter); result = 31 * result + Objects.hashCode(this.chiSquare); result = 31 * result + Objects.hashCode(this.exclude); @@ -838,12 +831,9 @@ public int hashCode() { @Override public boolean equals(Object o) { - if (!super.equals(o)) { - return false; - } if (this == o) return true; if (o == null || this.getClass() != o.getClass()) return false; - SignificantTextAggregation other = (SignificantTextAggregation) o; + SignificantTextAggregationFields other = (SignificantTextAggregationFields) o; return Objects.equals(this.backgroundFilter, other.backgroundFilter) && Objects.equals(this.chiSquare, other.chiSquare) && Objects.equals(this.exclude, other.exclude) diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/aggregations/SimpleValueAggregate.java b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/aggregations/SimpleValueAggregate.java index f786621b03..1489d4adc2 100644 --- a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/aggregations/SimpleValueAggregate.java +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/aggregations/SimpleValueAggregate.java @@ -53,7 +53,6 @@ @Generated("org.opensearch.client.codegen.CodeGenerator") public class SimpleValueAggregate extends SingleMetricAggregateBase implements - AggregateVariant, ToCopyableBuilder { // --------------------------------------------------------------------------------------------- @@ -66,14 +65,6 @@ public static SimpleValueAggregate of(Function aggregations; @@ -64,7 +65,6 @@ public abstract class SingleBucketAggregateBase extends AggregateBase { // --------------------------------------------------------------------------------------------- protected SingleBucketAggregateBase(AbstractBuilder builder) { - super(builder); this.aggregations = ApiTypeHelper.unmodifiable(builder.aggregations); this.docCount = ApiTypeHelper.requireNonNull(builder.docCount, this, "docCount"); } @@ -81,17 +81,28 @@ public final long docCount() { return this.docCount; } + /** + * Serialize this object to JSON. + */ + @Override + public void serialize(JsonGenerator generator, JsonpMapper mapper) { + generator.writeStartObject(); + serializeInternal(generator, mapper); + generator.writeEnd(); + } + protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { - super.serializeInternal(generator, mapper); - ExternallyTaggedUnion.serializeTypedKeysInner(this.aggregations, generator, mapper); + for (Map.Entry item0 : this.aggregations.entrySet()) { + generator.writeKey(item0.getKey()); + item0.getValue().serialize(generator, mapper); + } generator.writeKey("doc_count"); generator.write(this.docCount); } // --------------------------------------------------------------------------------------------- - public abstract static class AbstractBuilder> extends AggregateBase.AbstractBuilder< - BuilderT> { + public abstract static class AbstractBuilder> extends ObjectBuilderBase { private Long docCount; @Nullable protected Map aggregations; @@ -99,17 +110,18 @@ public abstract static class AbstractBuilder o) { - super(o); this.aggregations = _mapCopy(o.aggregations); this.docCount = o.docCount; } + @Nonnull + protected abstract BuilderT self(); + /** * *

@@ -160,19 +172,18 @@ public final BuilderT docCount(long value) { protected static > void setupSingleBucketAggregateBaseDeserializer( ObjectDeserializer op ) { - setupAggregateBaseDeserializer(op); op.add(AbstractBuilder::docCount, JsonpDeserializer.longDeserializer(), "doc_count"); op.setUnknownFieldHandler((builder, name, parser, mapper) -> { if (builder.aggregations == null) { builder.aggregations = new HashMap<>(); } - Aggregate._TYPED_KEYS_DESERIALIZER.deserializeEntry(name, parser, mapper, builder.aggregations); + builder.aggregations.put(name, Aggregate._DESERIALIZER.deserialize(parser, mapper)); }); } @Override public int hashCode() { - int result = super.hashCode(); + int result = 17; result = 31 * result + Objects.hashCode(this.aggregations); result = 31 * result + Long.hashCode(this.docCount); return result; @@ -180,9 +191,6 @@ public int hashCode() { @Override public boolean equals(Object o) { - if (!super.equals(o)) { - return false; - } if (this == o) return true; if (o == null || this.getClass() != o.getClass()) return false; SingleBucketAggregateBase other = (SingleBucketAggregateBase) o; diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/aggregations/SingleMetricAggregateBase.java b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/aggregations/SingleMetricAggregateBase.java index cb4db435c8..f43f8feab0 100644 --- a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/aggregations/SingleMetricAggregateBase.java +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/aggregations/SingleMetricAggregateBase.java @@ -44,11 +44,13 @@ import org.opensearch.client.json.JsonpDeserializer; import org.opensearch.client.json.JsonpMapper; import org.opensearch.client.json.ObjectDeserializer; +import org.opensearch.client.json.PlainJsonSerializable; +import org.opensearch.client.util.ObjectBuilderBase; // typedef: _types.aggregations.SingleMetricAggregateBase @Generated("org.opensearch.client.codegen.CodeGenerator") -public abstract class SingleMetricAggregateBase extends AggregateBase { +public abstract class SingleMetricAggregateBase implements PlainJsonSerializable { @Nullable private final Double value; @@ -59,7 +61,6 @@ public abstract class SingleMetricAggregateBase extends AggregateBase { // --------------------------------------------------------------------------------------------- protected SingleMetricAggregateBase(AbstractBuilder builder) { - super(builder); this.value = builder.value; this.valueAsString = builder.valueAsString; } @@ -83,8 +84,17 @@ public final String valueAsString() { return this.valueAsString; } + /** + * Serialize this object to JSON. + */ + @Override + public void serialize(JsonGenerator generator, JsonpMapper mapper) { + generator.writeStartObject(); + serializeInternal(generator, mapper); + generator.writeEnd(); + } + protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { - super.serializeInternal(generator, mapper); if (this.value != null) { generator.writeKey("value"); generator.write(this.value); @@ -98,8 +108,7 @@ protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { // --------------------------------------------------------------------------------------------- - public abstract static class AbstractBuilder> extends AggregateBase.AbstractBuilder< - BuilderT> { + public abstract static class AbstractBuilder> extends ObjectBuilderBase { @Nullable private Double value; @Nullable @@ -108,17 +117,18 @@ public abstract static class AbstractBuilder o) { - super(o); this.value = o.value; this.valueAsString = o.valueAsString; } + @Nonnull + protected abstract BuilderT self(); + /** * The metric value. A missing value generally means that there was no data to aggregate, unless specified otherwise. *

@@ -146,14 +156,13 @@ public final BuilderT valueAsString(@Nullable String value) { protected static > void setupSingleMetricAggregateBaseDeserializer( ObjectDeserializer op ) { - setupAggregateBaseDeserializer(op); op.add(AbstractBuilder::value, JsonpDeserializer.doubleDeserializer(), "value"); op.add(AbstractBuilder::valueAsString, JsonpDeserializer.stringDeserializer(), "value_as_string"); } @Override public int hashCode() { - int result = super.hashCode(); + int result = 17; result = 31 * result + Objects.hashCode(this.value); result = 31 * result + Objects.hashCode(this.valueAsString); return result; @@ -161,9 +170,6 @@ public int hashCode() { @Override public boolean equals(Object o) { - if (!super.equals(o)) { - return false; - } if (this == o) return true; if (o == null || this.getClass() != o.getClass()) return false; SingleMetricAggregateBase other = (SingleMetricAggregateBase) o; diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/aggregations/StatsAggregate.java b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/aggregations/StatsAggregate.java index 42faf72ede..1431049047 100644 --- a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/aggregations/StatsAggregate.java +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/aggregations/StatsAggregate.java @@ -51,10 +51,7 @@ @JsonpDeserializable @Generated("org.opensearch.client.codegen.CodeGenerator") -public class StatsAggregate extends StatsAggregateBase - implements - AggregateVariant, - ToCopyableBuilder { +public class StatsAggregate extends StatsAggregateBase implements ToCopyableBuilder { // --------------------------------------------------------------------------------------------- @@ -66,14 +63,6 @@ public static StatsAggregate of(Function builder) { - super(builder); this.avg = builder.avg; this.avgAsString = builder.avgAsString; this.count = ApiTypeHelper.requireNonNull(builder.count, this, "count"); @@ -161,8 +162,17 @@ public final String sumAsString() { return this.sumAsString; } + /** + * Serialize this object to JSON. + */ + @Override + public void serialize(JsonGenerator generator, JsonpMapper mapper) { + generator.writeStartObject(); + serializeInternal(generator, mapper); + generator.writeEnd(); + } + protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { - super.serializeInternal(generator, mapper); if (this.avg != null) { generator.writeKey("avg"); generator.write(this.avg); @@ -207,8 +217,7 @@ protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { // --------------------------------------------------------------------------------------------- - public abstract static class AbstractBuilder> extends AggregateBase.AbstractBuilder< - BuilderT> { + public abstract static class AbstractBuilder> extends ObjectBuilderBase { @Nullable private Double avg; @Nullable @@ -229,7 +238,6 @@ public abstract static class AbstractBuilder o) { - super(o); this.avg = o.avg; this.avgAsString = o.avgAsString; this.count = o.count; @@ -254,6 +261,9 @@ protected AbstractBuilder(AbstractBuilder o) { this.sumAsString = o.sumAsString; } + @Nonnull + protected abstract BuilderT self(); + /** * API name: {@code avg} */ @@ -341,7 +351,6 @@ public final BuilderT sumAsString(@Nullable String value) { protected static > void setupStatsAggregateBaseDeserializer( ObjectDeserializer op ) { - setupAggregateBaseDeserializer(op); op.add(AbstractBuilder::avg, JsonpDeserializer.doubleDeserializer(), "avg"); op.add(AbstractBuilder::avgAsString, JsonpDeserializer.stringDeserializer(), "avg_as_string"); op.add(AbstractBuilder::count, JsonpDeserializer.longDeserializer(), "count"); @@ -355,7 +364,7 @@ protected static > void setupStatsAgg @Override public int hashCode() { - int result = super.hashCode(); + int result = 17; result = 31 * result + Objects.hashCode(this.avg); result = 31 * result + Objects.hashCode(this.avgAsString); result = 31 * result + Long.hashCode(this.count); @@ -370,9 +379,6 @@ public int hashCode() { @Override public boolean equals(Object o) { - if (!super.equals(o)) { - return false; - } if (this == o) return true; if (o == null || this.getClass() != o.getClass()) return false; StatsAggregateBase other = (StatsAggregateBase) o; diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/aggregations/StatsAggregation.java b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/aggregations/StatsAggregation.java index 1f0351ce62..58cdd6f13a 100644 --- a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/aggregations/StatsAggregation.java +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/aggregations/StatsAggregation.java @@ -51,10 +51,7 @@ @JsonpDeserializable @Generated("org.opensearch.client.codegen.CodeGenerator") -public class StatsAggregation extends FormatMetricAggregationBase - implements - AggregationVariant, - ToCopyableBuilder { +public class StatsAggregation extends FormatMetricAggregationBase implements ToCopyableBuilder { // --------------------------------------------------------------------------------------------- @@ -66,14 +63,6 @@ public static StatsAggregation of(Function { // --------------------------------------------------------------------------------------------- @@ -66,14 +65,6 @@ public static StatsBucketAggregate of(Function { // --------------------------------------------------------------------------------------------- @@ -66,14 +65,6 @@ public static StatsBucketAggregation of(Function implements - AggregateVariant, ToCopyableBuilder { // --------------------------------------------------------------------------------------------- @@ -69,14 +68,6 @@ public static StringRareTermsAggregate of(Function +public class StringTermsAggregate extends TermsAggregateBase implements - AggregateVariant, ToCopyableBuilder { // --------------------------------------------------------------------------------------------- @@ -69,14 +69,6 @@ public static StringTermsAggregate of(Function + public static class Builder extends TermsAggregateBase.AbstractBuilder implements CopyableBuilder { @@ -144,7 +136,7 @@ public StringTermsAggregate build() { ); protected static void setupStringTermsAggregateDeserializer(ObjectDeserializer op) { - setupTermsAggregateBaseDeserializer(op, StringTermsBucket._DESERIALIZER); + setupTermsAggregateBaseDeserializer(op, JsonData._DESERIALIZER); } @Override diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/aggregations/SumAggregate.java b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/aggregations/SumAggregate.java index 2a759fd4e9..702c6d80e4 100644 --- a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/aggregations/SumAggregate.java +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/aggregations/SumAggregate.java @@ -51,10 +51,7 @@ @JsonpDeserializable @Generated("org.opensearch.client.codegen.CodeGenerator") -public class SumAggregate extends SingleMetricAggregateBase - implements - AggregateVariant, - ToCopyableBuilder { +public class SumAggregate extends SingleMetricAggregateBase implements ToCopyableBuilder { // --------------------------------------------------------------------------------------------- @@ -66,14 +63,6 @@ public static SumAggregate of(Function { +public class SumAggregation extends FormatMetricAggregationBase implements ToCopyableBuilder { // --------------------------------------------------------------------------------------------- @@ -66,14 +63,6 @@ public static SumAggregation of(Function { // --------------------------------------------------------------------------------------------- @@ -66,14 +65,6 @@ public static SumBucketAggregation of(Function { // --------------------------------------------------------------------------------------------- @@ -68,14 +67,6 @@ public static TDigestPercentileRanksAggregate of( return fn.apply(new Builder()).build(); } - /** - * {@link Aggregate} variant kind. - */ - @Override - public Aggregate.Kind _aggregateKind() { - return Aggregate.Kind.TdigestPercentileRanks; - } - // --------------------------------------------------------------------------------------------- @Override diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/aggregations/TDigestPercentilesAggregate.java b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/aggregations/TDigestPercentilesAggregate.java index 8e58fceacb..300aeb9230 100644 --- a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/aggregations/TDigestPercentilesAggregate.java +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/aggregations/TDigestPercentilesAggregate.java @@ -53,7 +53,6 @@ @Generated("org.opensearch.client.codegen.CodeGenerator") public class TDigestPercentilesAggregate extends PercentilesAggregateBase implements - AggregateVariant, ToCopyableBuilder { // --------------------------------------------------------------------------------------------- @@ -68,14 +67,6 @@ public static TDigestPercentilesAggregate of( return fn.apply(new Builder()).build(); } - /** - * {@link Aggregate} variant kind. - */ - @Override - public Aggregate.Kind _aggregateKind() { - return Aggregate.Kind.TdigestPercentiles; - } - // --------------------------------------------------------------------------------------------- @Override diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/aggregations/TTestAggregate.java b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/aggregations/TTestAggregate.java index 6e43c10749..a54e416691 100644 --- a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/aggregations/TTestAggregate.java +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/aggregations/TTestAggregate.java @@ -47,15 +47,17 @@ import org.opensearch.client.json.JsonpMapper; import org.opensearch.client.json.ObjectBuilderDeserializer; import org.opensearch.client.json.ObjectDeserializer; +import org.opensearch.client.json.PlainJsonSerializable; import org.opensearch.client.util.CopyableBuilder; import org.opensearch.client.util.ObjectBuilder; +import org.opensearch.client.util.ObjectBuilderBase; import org.opensearch.client.util.ToCopyableBuilder; // typedef: _types.aggregations.TTestAggregate @JsonpDeserializable @Generated("org.opensearch.client.codegen.CodeGenerator") -public class TTestAggregate extends AggregateBase implements AggregateVariant, ToCopyableBuilder { +public class TTestAggregate implements PlainJsonSerializable, ToCopyableBuilder { @Nullable private final Double value; @@ -66,7 +68,6 @@ public class TTestAggregate extends AggregateBase implements AggregateVariant, T // --------------------------------------------------------------------------------------------- private TTestAggregate(Builder builder) { - super(builder); this.value = builder.value; this.valueAsString = builder.valueAsString; } @@ -75,14 +76,6 @@ public static TTestAggregate of(Function implements CopyableBuilder { + public static class Builder extends ObjectBuilderBase implements CopyableBuilder { @Nullable private Double value; @Nullable @@ -137,13 +139,11 @@ public static class Builder extends AggregateBase.AbstractBuilder imple public Builder() {} private Builder(TTestAggregate o) { - super(o); this.value = o.value; this.valueAsString = o.valueAsString; } private Builder(Builder o) { - super(o); this.value = o.value; this.valueAsString = o.valueAsString; } @@ -154,12 +154,6 @@ public Builder copy() { return new Builder(this); } - @Override - @Nonnull - protected Builder self() { - return this; - } - /** * API name: {@code value} */ @@ -203,14 +197,13 @@ public TTestAggregate build() { ); protected static void setupTTestAggregateDeserializer(ObjectDeserializer op) { - setupAggregateBaseDeserializer(op); op.add(Builder::value, JsonpDeserializer.doubleDeserializer(), "value"); op.add(Builder::valueAsString, JsonpDeserializer.stringDeserializer(), "value_as_string"); } @Override public int hashCode() { - int result = super.hashCode(); + int result = 17; result = 31 * result + Objects.hashCode(this.value); result = 31 * result + Objects.hashCode(this.valueAsString); return result; @@ -218,9 +211,6 @@ public int hashCode() { @Override public boolean equals(Object o) { - if (!super.equals(o)) { - return false; - } if (this == o) return true; if (o == null || this.getClass() != o.getClass()) return false; TTestAggregate other = (TTestAggregate) o; diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/aggregations/TTestAggregation.java b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/aggregations/TTestAggregation.java index 6ce5dbd368..c9706fa51f 100644 --- a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/aggregations/TTestAggregation.java +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/aggregations/TTestAggregation.java @@ -47,18 +47,17 @@ import org.opensearch.client.json.JsonpMapper; import org.opensearch.client.json.ObjectBuilderDeserializer; import org.opensearch.client.json.ObjectDeserializer; +import org.opensearch.client.json.PlainJsonSerializable; import org.opensearch.client.util.CopyableBuilder; import org.opensearch.client.util.ObjectBuilder; +import org.opensearch.client.util.ObjectBuilderBase; import org.opensearch.client.util.ToCopyableBuilder; // typedef: _types.aggregations.TTestAggregation @JsonpDeserializable @Generated("org.opensearch.client.codegen.CodeGenerator") -public class TTestAggregation extends AggregationBase - implements - AggregationVariant, - ToCopyableBuilder { +public class TTestAggregation implements PlainJsonSerializable, ToCopyableBuilder { @Nullable private final TestPopulation a; @@ -72,7 +71,6 @@ public class TTestAggregation extends AggregationBase // --------------------------------------------------------------------------------------------- private TTestAggregation(Builder builder) { - super(builder); this.a = builder.a; this.b = builder.b; this.type = builder.type; @@ -82,14 +80,6 @@ public static TTestAggregation of(Function implements CopyableBuilder { + public static class Builder extends ObjectBuilderBase implements CopyableBuilder { @Nullable private TestPopulation a; @Nullable @@ -159,14 +158,12 @@ public static class Builder extends AggregationBase.AbstractBuilder imp public Builder() {} private Builder(TTestAggregation o) { - super(o); this.a = o.a; this.b = o.b; this.type = o.type; } private Builder(Builder o) { - super(o); this.a = o.a; this.b = o.b; this.type = o.type; @@ -178,12 +175,6 @@ public Builder copy() { return new Builder(this); } - @Override - @Nonnull - protected Builder self() { - return this; - } - /** * API name: {@code a} */ @@ -252,7 +243,6 @@ public TTestAggregation build() { ); protected static void setupTTestAggregationDeserializer(ObjectDeserializer op) { - setupAggregationBaseDeserializer(op); op.add(Builder::a, TestPopulation._DESERIALIZER, "a"); op.add(Builder::b, TestPopulation._DESERIALIZER, "b"); op.add(Builder::type, TTestType._DESERIALIZER, "type"); @@ -260,7 +250,7 @@ protected static void setupTTestAggregationDeserializer(ObjectDeserializer { - - @Nonnull - private final Map aggregations; - - @Nonnull - private final Map aggs; + ToCopyableBuilder { @Nullable private final TermsAggregationCollectMode collectMode; @@ -94,18 +86,12 @@ public class TermsAggregation @Nullable private final TermsInclude include; - @Nonnull - private final Map meta; - @Nullable private final Long minDocCount; @Nullable private final FieldValue missing; - @Nullable - private final String name; - @Nonnull private final List> order; @@ -129,19 +115,15 @@ public class TermsAggregation // --------------------------------------------------------------------------------------------- - private TermsAggregation(Builder builder) { - this.aggregations = ApiTypeHelper.unmodifiable(builder.aggregations); - this.aggs = ApiTypeHelper.unmodifiable(builder.aggs); + private TermsAggregationFields(Builder builder) { this.collectMode = builder.collectMode; this.exclude = builder.exclude; this.executionHint = builder.executionHint; this.field = builder.field; this.format = builder.format; this.include = builder.include; - this.meta = ApiTypeHelper.unmodifiable(builder.meta); this.minDocCount = builder.minDocCount; this.missing = builder.missing; - this.name = builder.name; this.order = ApiTypeHelper.unmodifiable(builder.order); this.script = builder.script; this.shardMinDocCount = builder.shardMinDocCount; @@ -151,40 +133,10 @@ private TermsAggregation(Builder builder) { this.valueType = builder.valueType; } - public static TermsAggregation of(Function> fn) { + public static TermsAggregationFields of(Function> fn) { return fn.apply(new Builder()).build(); } - /** - * {@link Aggregation} variant kind. - */ - @Override - public Aggregation.Kind _aggregationKind() { - return Aggregation.Kind.Terms; - } - - /** - * Sub-aggregations for this bucket aggregation - *

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

- */ - @Nonnull - public final Map aggregations() { - return this.aggregations; - } - - /** - * Sub-aggregations for this bucket aggregation - *

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

- */ - @Nonnull - public final Map aggs() { - return this.aggs; - } - /** * API name: {@code collect_mode} */ @@ -233,14 +185,6 @@ public final TermsInclude include() { return this.include; } - /** - * API name: {@code meta} - */ - @Nonnull - public final Map meta() { - return this.meta; - } - /** * Only return values that are found in more than min_doc_count hits. *

@@ -260,14 +204,6 @@ public final FieldValue missing() { return this.missing; } - /** - * API name: {@code name} - */ - @Nullable - public final String name() { - return this.name; - } - /** * API name: {@code order} */ @@ -352,26 +288,6 @@ public void serialize(JsonGenerator generator, JsonpMapper mapper) { } protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { - if (ApiTypeHelper.isDefined(this.aggregations)) { - generator.writeKey("aggregations"); - generator.writeStartObject(); - for (Map.Entry item0 : this.aggregations.entrySet()) { - generator.writeKey(item0.getKey()); - item0.getValue().serialize(generator, mapper); - } - generator.writeEnd(); - } - - if (ApiTypeHelper.isDefined(this.aggs)) { - generator.writeKey("aggs"); - generator.writeStartObject(); - for (Map.Entry item0 : this.aggs.entrySet()) { - generator.writeKey(item0.getKey()); - item0.getValue().serialize(generator, mapper); - } - generator.writeEnd(); - } - if (this.collectMode != null) { generator.writeKey("collect_mode"); this.collectMode.serialize(generator, mapper); @@ -402,16 +318,6 @@ protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { this.include.serialize(generator, mapper); } - 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(); - } - if (this.minDocCount != null) { generator.writeKey("min_doc_count"); generator.write(this.minDocCount); @@ -422,11 +328,6 @@ protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { this.missing.serialize(generator, mapper); } - if (this.name != null) { - generator.writeKey("name"); - generator.write(this.name); - } - if (ApiTypeHelper.isDefined(this.order)) { generator.writeKey("order"); generator.writeStartArray(); @@ -488,13 +389,9 @@ public static Builder builder() { } /** - * Builder for {@link TermsAggregation}. + * Builder for {@link TermsAggregationFields}. */ - public static class Builder extends ObjectBuilderBase implements CopyableBuilder { - @Nullable - private Map aggregations; - @Nullable - private Map aggs; + public static class Builder extends ObjectBuilderBase implements CopyableBuilder { @Nullable private TermsAggregationCollectMode collectMode; @Nullable @@ -508,14 +405,10 @@ public static class Builder extends ObjectBuilderBase implements CopyableBuilder @Nullable private TermsInclude include; @Nullable - private Map meta; - @Nullable private Long minDocCount; @Nullable private FieldValue missing; @Nullable - private String name; - @Nullable private List> order; @Nullable private Script script; @@ -532,19 +425,15 @@ public static class Builder extends ObjectBuilderBase implements CopyableBuilder public Builder() {} - private Builder(TermsAggregation o) { - this.aggregations = _mapCopy(o.aggregations); - this.aggs = _mapCopy(o.aggs); + private Builder(TermsAggregationFields o) { this.collectMode = o.collectMode; this.exclude = o.exclude; this.executionHint = o.executionHint; this.field = o.field; this.format = o.format; this.include = o.include; - this.meta = _mapCopy(o.meta); this.minDocCount = o.minDocCount; this.missing = o.missing; - this.name = o.name; this.order = _listCopy(o.order); this.script = o.script; this.shardMinDocCount = o.shardMinDocCount; @@ -555,18 +444,14 @@ private Builder(TermsAggregation o) { } private Builder(Builder o) { - this.aggregations = _mapCopy(o.aggregations); - this.aggs = _mapCopy(o.aggs); this.collectMode = o.collectMode; this.exclude = o.exclude; this.executionHint = o.executionHint; this.field = o.field; this.format = o.format; this.include = o.include; - this.meta = _mapCopy(o.meta); this.minDocCount = o.minDocCount; this.missing = o.missing; - this.name = o.name; this.order = _listCopy(o.order); this.script = o.script; this.shardMinDocCount = o.shardMinDocCount; @@ -582,100 +467,6 @@ public Builder copy() { return new Builder(this); } - /** - * Sub-aggregations for this bucket aggregation - *

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

- * - *

- * Adds all elements of map to aggregations. - *

- */ - @Nonnull - public final Builder aggregations(Map map) { - this.aggregations = _mapPutAll(this.aggregations, map); - return this; - } - - /** - * Sub-aggregations for this bucket aggregation - *

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

- * - *

- * Adds an entry to aggregations. - *

- */ - @Nonnull - public final Builder aggregations(String key, Aggregation value) { - this.aggregations = _mapPut(this.aggregations, key, value); - return this; - } - - /** - * Sub-aggregations for this bucket aggregation - *

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

- * - *

- * Adds a value to aggregations using a builder lambda. - *

- */ - @Nonnull - public final Builder aggregations(String key, Function> fn) { - return aggregations(key, fn.apply(new Aggregation.Builder()).build()); - } - - /** - * Sub-aggregations for this bucket aggregation - *

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

- * - *

- * Adds all elements of map to aggs. - *

- */ - @Nonnull - public final Builder aggs(Map map) { - this.aggs = _mapPutAll(this.aggs, map); - return this; - } - - /** - * Sub-aggregations for this bucket aggregation - *

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

- * - *

- * Adds an entry to aggs. - *

- */ - @Nonnull - public final Builder aggs(String key, Aggregation value) { - this.aggs = _mapPut(this.aggs, key, value); - return this; - } - - /** - * Sub-aggregations for this bucket aggregation - *

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

- * - *

- * Adds a value to aggs using a builder lambda. - *

- */ - @Nonnull - public final Builder aggs(String key, Function> fn) { - return aggs(key, fn.apply(new Aggregation.Builder()).build()); - } - /** * API name: {@code collect_mode} */ @@ -746,32 +537,6 @@ public final Builder include(Function - * Adds all elements of map to meta. - *

- */ - @Nonnull - public final Builder meta(Map map) { - this.meta = _mapPutAll(this.meta, map); - return this; - } - - /** - * API name: {@code meta} - * - *

- * Adds an entry to meta. - *

- */ - @Nonnull - public final Builder meta(String key, JsonData value) { - this.meta = _mapPut(this.meta, key, value); - return this; - } - /** * Only return values that are found in more than min_doc_count hits. *

@@ -801,15 +566,6 @@ public final Builder missing(Function _DESERIALIZER = ObjectBuilderDeserializer.lazy( + public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer.lazy( Builder::new, - TermsAggregation::setupTermsAggregationDeserializer + TermsAggregationFields::setupTermsAggregationFieldsDeserializer ); - protected static void setupTermsAggregationDeserializer(ObjectDeserializer op) { - op.add(Builder::aggregations, JsonpDeserializer.stringMapDeserializer(Aggregation._DESERIALIZER), "aggregations"); - op.add(Builder::aggs, JsonpDeserializer.stringMapDeserializer(Aggregation._DESERIALIZER), "aggs"); + protected static void setupTermsAggregationFieldsDeserializer(ObjectDeserializer op) { op.add(Builder::collectMode, TermsAggregationCollectMode._DESERIALIZER, "collect_mode"); op.add(Builder::exclude, TermsExclude._DESERIALIZER, "exclude"); op.add(Builder::executionHint, TermsAggregationExecutionHint._DESERIALIZER, "execution_hint"); op.add(Builder::field, JsonpDeserializer.stringDeserializer(), "field"); op.add(Builder::format, JsonpDeserializer.stringDeserializer(), "format"); op.add(Builder::include, TermsInclude._DESERIALIZER, "include"); - op.add(Builder::meta, JsonpDeserializer.stringMapDeserializer(JsonData._DESERIALIZER), "meta"); op.add(Builder::minDocCount, JsonpDeserializer.longDeserializer(), "min_doc_count"); op.add(Builder::missing, FieldValue._DESERIALIZER, "missing"); - op.add(Builder::name, JsonpDeserializer.stringDeserializer(), "name"); op.add( Builder::order, JsonpDeserializer.arrayDeserializer(JsonpDeserializer.stringMapDeserializer(SortOrder._DESERIALIZER)), @@ -968,18 +720,14 @@ protected static void setupTermsAggregationDeserializer(ObjectDeserializer builder) { - super(builder); - this.docCountError = builder.docCountError; - } - - /** - * Upper bound of the document count error. Only present when show_term_doc_count_error is true. - *

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

- */ - @Nullable - public final Long docCountError() { - return this.docCountError; - } - - protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { - super.serializeInternal(generator, mapper); - if (this.docCountError != null) { - generator.writeKey("doc_count_error"); - generator.write(this.docCountError); - } - } - - // --------------------------------------------------------------------------------------------- - - public abstract static class AbstractBuilder> extends MultiBucketBase.AbstractBuilder< - BuilderT> { - @Nullable - private Long docCountError; - - protected AbstractBuilder() {} - - protected AbstractBuilder(TermsBucketBase o) { - super(o); - this.docCountError = o.docCountError; - } - - protected AbstractBuilder(AbstractBuilder o) { - super(o); - this.docCountError = o.docCountError; - } - - /** - * Upper bound of the document count error. Only present when show_term_doc_count_error is true. - *

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

- */ - @Nonnull - public final BuilderT docCountError(@Nullable Long value) { - this.docCountError = value; - return self(); - } - } - - // --------------------------------------------------------------------------------------------- - - protected static > void setupTermsBucketBaseDeserializer(ObjectDeserializer op) { - setupMultiBucketBaseDeserializer(op); - op.add(AbstractBuilder::docCountError, JsonpDeserializer.longDeserializer(), "doc_count_error"); - } - - @Override - public int hashCode() { - int result = super.hashCode(); - result = 31 * result + Objects.hashCode(this.docCountError); - return result; - } - - @Override - public boolean equals(Object o) { - if (!super.equals(o)) { - return false; - } - if (this == o) return true; - if (o == null || this.getClass() != o.getClass()) return false; - TermsBucketBase other = (TermsBucketBase) o; - return Objects.equals(this.docCountError, other.docCountError); - } -} diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/aggregations/TermsPartition.java b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/aggregations/TermsPartition.java index d38a724446..b0bd1a54ac 100644 --- a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/aggregations/TermsPartition.java +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/aggregations/TermsPartition.java @@ -58,9 +58,9 @@ @Generated("org.opensearch.client.codegen.CodeGenerator") public class TermsPartition implements PlainJsonSerializable, ToCopyableBuilder { - private final long numPartitions; + private final int numPartitions; - private final long partition; + private final int partition; // --------------------------------------------------------------------------------------------- @@ -79,7 +79,7 @@ public static TermsPartition of(Function */ - public final long numPartitions() { + public final int numPartitions() { return this.numPartitions; } @@ -89,7 +89,7 @@ public final long numPartitions() { * API name: {@code partition} *

*/ - public final long partition() { + public final int partition() { return this.partition; } @@ -128,8 +128,8 @@ public static Builder builder() { * Builder for {@link TermsPartition}. */ public static class Builder extends ObjectBuilderBase implements CopyableBuilder { - private Long numPartitions; - private Long partition; + private Integer numPartitions; + private Integer partition; public Builder() {} @@ -156,7 +156,7 @@ public Builder copy() { *

*/ @Nonnull - public final Builder numPartitions(long value) { + public final Builder numPartitions(int value) { this.numPartitions = value; return this; } @@ -168,7 +168,7 @@ public final Builder numPartitions(long value) { *

*/ @Nonnull - public final Builder partition(long value) { + public final Builder partition(int value) { this.partition = value; return this; } @@ -198,15 +198,15 @@ public TermsPartition build() { ); protected static void setupTermsPartitionDeserializer(ObjectDeserializer op) { - op.add(Builder::numPartitions, JsonpDeserializer.longDeserializer(), "num_partitions"); - op.add(Builder::partition, JsonpDeserializer.longDeserializer(), "partition"); + op.add(Builder::numPartitions, JsonpDeserializer.integerDeserializer(), "num_partitions"); + op.add(Builder::partition, JsonpDeserializer.integerDeserializer(), "partition"); } @Override public int hashCode() { int result = 17; - result = 31 * result + Long.hashCode(this.numPartitions); - result = 31 * result + Long.hashCode(this.partition); + result = 31 * result + Integer.hashCode(this.numPartitions); + result = 31 * result + Integer.hashCode(this.partition); return result; } diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/aggregations/TopHitsAggregate.java b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/aggregations/TopHitsAggregate.java index c8402a76ad..8fb760efb4 100644 --- a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/aggregations/TopHitsAggregate.java +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/aggregations/TopHitsAggregate.java @@ -46,20 +46,19 @@ import org.opensearch.client.json.JsonpMapper; import org.opensearch.client.json.ObjectBuilderDeserializer; import org.opensearch.client.json.ObjectDeserializer; +import org.opensearch.client.json.PlainJsonSerializable; import org.opensearch.client.opensearch.core.search.HitsMetadata; import org.opensearch.client.util.ApiTypeHelper; import org.opensearch.client.util.CopyableBuilder; import org.opensearch.client.util.ObjectBuilder; +import org.opensearch.client.util.ObjectBuilderBase; import org.opensearch.client.util.ToCopyableBuilder; // typedef: _types.aggregations.TopHitsAggregate @JsonpDeserializable @Generated("org.opensearch.client.codegen.CodeGenerator") -public class TopHitsAggregate extends AggregateBase - implements - AggregateVariant, - ToCopyableBuilder { +public class TopHitsAggregate implements PlainJsonSerializable, ToCopyableBuilder { @Nonnull private final HitsMetadata hits; @@ -67,7 +66,6 @@ public class TopHitsAggregate extends AggregateBase // --------------------------------------------------------------------------------------------- private TopHitsAggregate(Builder builder) { - super(builder); this.hits = ApiTypeHelper.requireNonNull(builder.hits, this, "hits"); } @@ -75,14 +73,6 @@ public static TopHitsAggregate of(Function hits() { return this.hits; } + /** + * Serialize this object to JSON. + */ + @Override + public void serialize(JsonGenerator generator, JsonpMapper mapper) { + generator.writeStartObject(); + serializeInternal(generator, mapper); + generator.writeEnd(); + } + protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { - super.serializeInternal(generator, mapper); generator.writeKey("hits"); this.hits.serialize(generator, mapper); } @@ -113,18 +112,16 @@ public static Builder builder() { /** * Builder for {@link TopHitsAggregate}. */ - public static class Builder extends AggregateBase.AbstractBuilder implements CopyableBuilder { + public static class Builder extends ObjectBuilderBase implements CopyableBuilder { private HitsMetadata hits; public Builder() {} private Builder(TopHitsAggregate o) { - super(o); this.hits = o.hits; } private Builder(Builder o) { - super(o); this.hits = o.hits; } @@ -134,12 +131,6 @@ public Builder copy() { return new Builder(this); } - @Override - @Nonnull - protected Builder self() { - return this; - } - /** * Required - API name: {@code hits} */ @@ -182,22 +173,18 @@ public TopHitsAggregate build() { ); protected static void setupTopHitsAggregateDeserializer(ObjectDeserializer op) { - setupAggregateBaseDeserializer(op); op.add(Builder::hits, HitsMetadata.createHitsMetadataDeserializer(JsonData._DESERIALIZER), "hits"); } @Override public int hashCode() { - int result = super.hashCode(); + int result = 17; result = 31 * result + this.hits.hashCode(); return result; } @Override public boolean equals(Object o) { - if (!super.equals(o)) { - return false; - } if (this == o) return true; if (o == null || this.getClass() != o.getClass()) return false; TopHitsAggregate other = (TopHitsAggregate) o; diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/aggregations/TopHitsAggregation.java b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/aggregations/TopHitsAggregation.java index cb7e57282a..1b31723df1 100644 --- a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/aggregations/TopHitsAggregation.java +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/aggregations/TopHitsAggregation.java @@ -62,10 +62,7 @@ @JsonpDeserializable @Generated("org.opensearch.client.codegen.CodeGenerator") -public class TopHitsAggregation extends MetricAggregationBase - implements - AggregationVariant, - ToCopyableBuilder { +public class TopHitsAggregation extends MetricAggregationBase implements ToCopyableBuilder { @Nonnull private final List docvalueFields; @@ -125,14 +122,6 @@ public static TopHitsAggregation of(Function implements - AggregateVariant, ToCopyableBuilder { // --------------------------------------------------------------------------------------------- @@ -71,14 +70,6 @@ public static UnmappedRareTermsAggregate of( return fn.apply(new Builder()).build(); } - /** - * {@link Aggregate} variant kind. - */ - @Override - public Aggregate.Kind _aggregateKind() { - return Aggregate.Kind.Umrareterms; - } - // --------------------------------------------------------------------------------------------- @Override diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/aggregations/UnmappedSignificantTermsAggregate.java b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/aggregations/UnmappedSignificantTermsAggregate.java index ebe7f58002..6199e2f786 100644 --- a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/aggregations/UnmappedSignificantTermsAggregate.java +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/aggregations/UnmappedSignificantTermsAggregate.java @@ -53,7 +53,6 @@ @Generated("org.opensearch.client.codegen.CodeGenerator") public class UnmappedSignificantTermsAggregate extends SignificantTermsAggregateBase implements - AggregateVariant, ToCopyableBuilder { // --------------------------------------------------------------------------------------------- @@ -68,14 +67,6 @@ public static UnmappedSignificantTermsAggregate of( return fn.apply(new Builder()).build(); } - /** - * {@link Aggregate} variant kind. - */ - @Override - public Aggregate.Kind _aggregateKind() { - return Aggregate.Kind.Umsigterms; - } - // --------------------------------------------------------------------------------------------- @Override diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/aggregations/UnmappedTermsAggregate.java b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/aggregations/UnmappedTermsAggregate.java index baa2fc91e0..72a3631643 100644 --- a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/aggregations/UnmappedTermsAggregate.java +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/aggregations/UnmappedTermsAggregate.java @@ -39,6 +39,7 @@ import java.util.function.Function; import javax.annotation.Generated; import javax.annotation.Nonnull; +import org.opensearch.client.json.JsonData; import org.opensearch.client.json.JsonpDeserializable; import org.opensearch.client.json.JsonpDeserializer; import org.opensearch.client.json.ObjectBuilderDeserializer; @@ -54,9 +55,8 @@ */ @JsonpDeserializable @Generated("org.opensearch.client.codegen.CodeGenerator") -public class UnmappedTermsAggregate extends TermsAggregateBase +public class UnmappedTermsAggregate extends TermsAggregateBase implements - AggregateVariant, ToCopyableBuilder { // --------------------------------------------------------------------------------------------- @@ -69,14 +69,6 @@ public static UnmappedTermsAggregate of(Function + public static class Builder extends TermsAggregateBase.AbstractBuilder implements CopyableBuilder { @@ -144,7 +136,7 @@ public UnmappedTermsAggregate build() { ); protected static void setupUnmappedTermsAggregateDeserializer(ObjectDeserializer op) { - setupTermsAggregateBaseDeserializer(op, JsonpDeserializer.voidDeserializer()); + setupTermsAggregateBaseDeserializer(op, JsonData._DESERIALIZER); } @Override diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/aggregations/GlobalAggregation.java b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/aggregations/UnsignedLongTermsAggregate.java similarity index 63% rename from java-client/src/generated/java/org/opensearch/client/opensearch/_types/aggregations/GlobalAggregation.java rename to java-client/src/generated/java/org/opensearch/client/opensearch/_types/aggregations/UnsignedLongTermsAggregate.java index b2e42621fc..01e9055252 100644 --- a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/aggregations/GlobalAggregation.java +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/aggregations/UnsignedLongTermsAggregate.java @@ -39,6 +39,7 @@ import java.util.function.Function; import javax.annotation.Generated; import javax.annotation.Nonnull; +import org.opensearch.client.json.JsonData; import org.opensearch.client.json.JsonpDeserializable; import org.opensearch.client.json.JsonpDeserializer; import org.opensearch.client.json.ObjectBuilderDeserializer; @@ -47,33 +48,33 @@ import org.opensearch.client.util.ObjectBuilder; import org.opensearch.client.util.ToCopyableBuilder; -// typedef: _types.aggregations.GlobalAggregation +// typedef: _types.aggregations.UnsignedLongTermsAggregate +/** + * Result of a terms aggregation when the field is an unsigned_long (64-bit unsigned integer). OpenSearch stores + * unsigned_long values as Long or BigInteger internally. In JSON responses, bucket keys are represented as numbers, which may + * lose precision for values larger than 2^53--1 due to IEEE 754 double precision limitations. In protocol buffer representations, keys are + * manually defined as uint64 to preserve the full 64-bit unsigned range. Use key_as_string in buckets for exact string + * representation of large unsigned long values. + */ @JsonpDeserializable @Generated("org.opensearch.client.codegen.CodeGenerator") -public class GlobalAggregation extends BucketAggregationBase +public class UnsignedLongTermsAggregate extends TermsAggregateBase implements - AggregationVariant, - ToCopyableBuilder { + ToCopyableBuilder { // --------------------------------------------------------------------------------------------- - private GlobalAggregation(Builder builder) { + private UnsignedLongTermsAggregate(Builder builder) { super(builder); } - public static GlobalAggregation of(Function> fn) { + public static UnsignedLongTermsAggregate of( + Function> fn + ) { return fn.apply(new Builder()).build(); } - /** - * {@link Aggregation} variant kind. - */ - @Override - public Aggregation.Kind _aggregationKind() { - return Aggregation.Kind.Global; - } - // --------------------------------------------------------------------------------------------- @Override @@ -88,15 +89,15 @@ public static Builder builder() { } /** - * Builder for {@link GlobalAggregation}. + * Builder for {@link UnsignedLongTermsAggregate}. */ - public static class Builder extends BucketAggregationBase.AbstractBuilder + public static class Builder extends TermsAggregateBase.AbstractBuilder implements - CopyableBuilder { + CopyableBuilder { public Builder() {} - private Builder(GlobalAggregation o) { + private Builder(UnsignedLongTermsAggregate o) { super(o); } @@ -117,31 +118,31 @@ protected Builder self() { } /** - * Builds a {@link GlobalAggregation}. + * Builds a {@link UnsignedLongTermsAggregate}. * * @throws NullPointerException if some of the required fields are null. */ @Override @Nonnull - public GlobalAggregation build() { + public UnsignedLongTermsAggregate build() { _checkSingleUse(); - return new GlobalAggregation(this); + return new UnsignedLongTermsAggregate(this); } } // --------------------------------------------------------------------------------------------- /** - * Json deserializer for {@link GlobalAggregation} + * Json deserializer for {@link UnsignedLongTermsAggregate} */ - public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer.lazy( + public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer.lazy( Builder::new, - GlobalAggregation::setupGlobalAggregationDeserializer + UnsignedLongTermsAggregate::setupUnsignedLongTermsAggregateDeserializer ); - protected static void setupGlobalAggregationDeserializer(ObjectDeserializer op) { - setupBucketAggregationBaseDeserializer(op); + protected static void setupUnsignedLongTermsAggregateDeserializer(ObjectDeserializer op) { + setupTermsAggregateBaseDeserializer(op, JsonData._DESERIALIZER); } @Override diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/aggregations/ValueCountAggregate.java b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/aggregations/ValueCountAggregate.java index 044dc743ef..b10f87bf5c 100644 --- a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/aggregations/ValueCountAggregate.java +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/aggregations/ValueCountAggregate.java @@ -53,7 +53,6 @@ @Generated("org.opensearch.client.codegen.CodeGenerator") public class ValueCountAggregate extends SingleMetricAggregateBase implements - AggregateVariant, ToCopyableBuilder { // --------------------------------------------------------------------------------------------- @@ -66,14 +65,6 @@ public static ValueCountAggregate of(Function { // --------------------------------------------------------------------------------------------- @@ -66,14 +65,6 @@ public static ValueCountAggregation of(Function implements - AggregateVariant, ToCopyableBuilder { // --------------------------------------------------------------------------------------------- @@ -68,14 +67,6 @@ public static VariableWidthHistogramAggregate of( return fn.apply(new Builder()).build(); } - /** - * {@link Aggregate} variant kind. - */ - @Override - public Aggregate.Kind _aggregateKind() { - return Aggregate.Kind.VariableWidthHistogram; - } - // --------------------------------------------------------------------------------------------- @Override diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/aggregations/VariableWidthHistogramAggregation.java b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/aggregations/VariableWidthHistogramAggregation.java index 8e8406ea5f..7d1133f2a1 100644 --- a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/aggregations/VariableWidthHistogramAggregation.java +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/aggregations/VariableWidthHistogramAggregation.java @@ -59,7 +59,6 @@ @Generated("org.opensearch.client.codegen.CodeGenerator") public class VariableWidthHistogramAggregation implements - AggregationVariant, PlainJsonSerializable, ToCopyableBuilder { @@ -90,14 +89,6 @@ public static VariableWidthHistogramAggregation of( return fn.apply(new Builder()).build(); } - /** - * {@link Aggregation} variant kind. - */ - @Override - public Aggregation.Kind _aggregationKind() { - return Aggregation.Kind.VariableWidthHistogram; - } - /** * The target number of buckets. *

diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/aggregations/WeightedAverageAggregation.java b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/aggregations/WeightedAverageAggregation.java index d5a65518d2..457561c05e 100644 --- a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/aggregations/WeightedAverageAggregation.java +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/aggregations/WeightedAverageAggregation.java @@ -47,17 +47,19 @@ import org.opensearch.client.json.JsonpMapper; import org.opensearch.client.json.ObjectBuilderDeserializer; import org.opensearch.client.json.ObjectDeserializer; +import org.opensearch.client.json.PlainJsonSerializable; import org.opensearch.client.util.CopyableBuilder; import org.opensearch.client.util.ObjectBuilder; +import org.opensearch.client.util.ObjectBuilderBase; import org.opensearch.client.util.ToCopyableBuilder; // typedef: _types.aggregations.WeightedAverageAggregation @JsonpDeserializable @Generated("org.opensearch.client.codegen.CodeGenerator") -public class WeightedAverageAggregation extends AggregationBase +public class WeightedAverageAggregation implements - AggregationVariant, + PlainJsonSerializable, ToCopyableBuilder { @Nullable @@ -75,7 +77,6 @@ public class WeightedAverageAggregation extends AggregationBase // --------------------------------------------------------------------------------------------- private WeightedAverageAggregation(Builder builder) { - super(builder); this.format = builder.format; this.value = builder.value; this.valueType = builder.valueType; @@ -88,14 +89,6 @@ public static WeightedAverageAggregation of( return fn.apply(new Builder()).build(); } - /** - * {@link Aggregation} variant kind. - */ - @Override - public Aggregation.Kind _aggregationKind() { - return Aggregation.Kind.WeightedAvg; - } - /** * A numeric response formatter. *

@@ -131,8 +124,17 @@ public final WeightedAverageValue weight() { return this.weight; } + /** + * Serialize this object to JSON. + */ + @Override + public void serialize(JsonGenerator generator, JsonpMapper mapper) { + generator.writeStartObject(); + serializeInternal(generator, mapper); + generator.writeEnd(); + } + protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { - super.serializeInternal(generator, mapper); if (this.format != null) { generator.writeKey("format"); generator.write(this.format); @@ -170,9 +172,7 @@ public static Builder builder() { /** * Builder for {@link WeightedAverageAggregation}. */ - public static class Builder extends AggregationBase.AbstractBuilder - implements - CopyableBuilder { + public static class Builder extends ObjectBuilderBase implements CopyableBuilder { @Nullable private String format; @Nullable @@ -185,7 +185,6 @@ public static class Builder extends AggregationBase.AbstractBuilder public Builder() {} private Builder(WeightedAverageAggregation o) { - super(o); this.format = o.format; this.value = o.value; this.valueType = o.valueType; @@ -193,7 +192,6 @@ private Builder(WeightedAverageAggregation o) { } private Builder(Builder o) { - super(o); this.format = o.format; this.value = o.value; this.valueType = o.valueType; @@ -206,12 +204,6 @@ public Builder copy() { return new Builder(this); } - @Override - @Nonnull - protected Builder self() { - return this; - } - /** * A numeric response formatter. *

@@ -292,7 +284,6 @@ public WeightedAverageAggregation build() { ); protected static void setupWeightedAverageAggregationDeserializer(ObjectDeserializer op) { - setupAggregationBaseDeserializer(op); op.add(Builder::format, JsonpDeserializer.stringDeserializer(), "format"); op.add(Builder::value, WeightedAverageValue._DESERIALIZER, "value"); op.add(Builder::valueType, ValueType._DESERIALIZER, "value_type"); @@ -301,7 +292,7 @@ protected static void setupWeightedAverageAggregationDeserializer(ObjectDeserial @Override public int hashCode() { - int result = super.hashCode(); + int result = 17; result = 31 * result + Objects.hashCode(this.format); result = 31 * result + Objects.hashCode(this.value); result = 31 * result + Objects.hashCode(this.valueType); @@ -311,9 +302,6 @@ public int hashCode() { @Override public boolean equals(Object o) { - if (!super.equals(o)) { - return false; - } if (this == o) return true; if (o == null || this.getClass() != o.getClass()) return false; WeightedAverageAggregation other = (WeightedAverageAggregation) o; diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/aggregations/WeightedAvgAggregate.java b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/aggregations/WeightedAvgAggregate.java index ce84164328..8c23cfe426 100644 --- a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/aggregations/WeightedAvgAggregate.java +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/aggregations/WeightedAvgAggregate.java @@ -53,7 +53,6 @@ @Generated("org.opensearch.client.codegen.CodeGenerator") public class WeightedAvgAggregate extends SingleMetricAggregateBase implements - AggregateVariant, ToCopyableBuilder { // --------------------------------------------------------------------------------------------- @@ -66,14 +65,6 @@ public static WeightedAvgAggregate of(Function, AggregationVariant, PlainJsonSerializable { +public class Query implements TaggedUnion, PlainJsonSerializable { /** * {@link Query} variant kinds. */ @@ -139,14 +137,6 @@ public String jsonValue() { } } - /** - * {@link Aggregation} variant kind. - */ - @Override - public Aggregation.Kind _aggregationKind() { - return Aggregation.Kind.Filter; - } - private final Kind _kind; private final Object _value; diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/core/search/SearchResult.java b/java-client/src/generated/java/org/opensearch/client/opensearch/core/search/SearchResult.java index 8617843201..2b32508171 100644 --- a/java-client/src/generated/java/org/opensearch/client/opensearch/core/search/SearchResult.java +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/core/search/SearchResult.java @@ -245,7 +245,12 @@ public void serialize(JsonGenerator generator, JsonpMapper mapper) { protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { if (ApiTypeHelper.isDefined(this.aggregations)) { generator.writeKey("aggregations"); - ExternallyTaggedUnion.serializeTypedKeys(this.aggregations, generator, mapper); + generator.writeStartObject(); + for (Map.Entry item0 : this.aggregations.entrySet()) { + generator.writeKey(item0.getKey()); + item0.getValue().serialize(generator, mapper); + } + generator.writeEnd(); } if (this.clusters != null) { @@ -626,7 +631,7 @@ protected static op, JsonpDeserializer tDocumentDeserializer ) { - op.add(AbstractBuilder::aggregations, Aggregate._TYPED_KEYS_DESERIALIZER, "aggregations"); + op.add(AbstractBuilder::aggregations, JsonpDeserializer.stringMapDeserializer(Aggregate._DESERIALIZER), "aggregations"); op.add(AbstractBuilder::clusters, ClusterStatistics._DESERIALIZER, "_clusters"); op.add(AbstractBuilder::hits, HitsMetadata.createHitsMetadataDeserializer(tDocumentDeserializer), "hits"); op.add(AbstractBuilder::numReducePhases, JsonpDeserializer.integerDeserializer(), "num_reduce_phases"); diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/search_relevance/GetExperimentsResponse.java b/java-client/src/generated/java/org/opensearch/client/opensearch/search_relevance/GetExperimentsResponse.java index 7d7edfdab9..1783521902 100644 --- a/java-client/src/generated/java/org/opensearch/client/opensearch/search_relevance/GetExperimentsResponse.java +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/search_relevance/GetExperimentsResponse.java @@ -264,7 +264,12 @@ public void serialize(JsonGenerator generator, JsonpMapper mapper) { protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { if (ApiTypeHelper.isDefined(this.aggregations)) { generator.writeKey("aggregations"); - ExternallyTaggedUnion.serializeTypedKeys(this.aggregations, generator, mapper); + generator.writeStartObject(); + for (Map.Entry item0 : this.aggregations.entrySet()) { + generator.writeKey(item0.getKey()); + item0.getValue().serialize(generator, mapper); + } + generator.writeEnd(); } if (this.clusters != null) { @@ -697,7 +702,7 @@ protected static void setupGetExperimentsResponseDeserializer( ObjectDeserializer> op, JsonpDeserializer tDocumentDeserializer ) { - op.add(Builder::aggregations, Aggregate._TYPED_KEYS_DESERIALIZER, "aggregations"); + op.add(Builder::aggregations, JsonpDeserializer.stringMapDeserializer(Aggregate._DESERIALIZER), "aggregations"); op.add(Builder::clusters, ClusterStatistics._DESERIALIZER, "_clusters"); op.add(Builder::hits, HitsMetadata.createHitsMetadataDeserializer(tDocumentDeserializer), "hits"); op.add(Builder::numReducePhases, JsonpDeserializer.integerDeserializer(), "num_reduce_phases"); diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/search_relevance/GetJudgmentsResponse.java b/java-client/src/generated/java/org/opensearch/client/opensearch/search_relevance/GetJudgmentsResponse.java index 54eec79956..1fff55f1c2 100644 --- a/java-client/src/generated/java/org/opensearch/client/opensearch/search_relevance/GetJudgmentsResponse.java +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/search_relevance/GetJudgmentsResponse.java @@ -264,7 +264,12 @@ public void serialize(JsonGenerator generator, JsonpMapper mapper) { protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { if (ApiTypeHelper.isDefined(this.aggregations)) { generator.writeKey("aggregations"); - ExternallyTaggedUnion.serializeTypedKeys(this.aggregations, generator, mapper); + generator.writeStartObject(); + for (Map.Entry item0 : this.aggregations.entrySet()) { + generator.writeKey(item0.getKey()); + item0.getValue().serialize(generator, mapper); + } + generator.writeEnd(); } if (this.clusters != null) { @@ -697,7 +702,7 @@ protected static void setupGetJudgmentsResponseDeserializer( ObjectDeserializer> op, JsonpDeserializer tDocumentDeserializer ) { - op.add(Builder::aggregations, Aggregate._TYPED_KEYS_DESERIALIZER, "aggregations"); + op.add(Builder::aggregations, JsonpDeserializer.stringMapDeserializer(Aggregate._DESERIALIZER), "aggregations"); op.add(Builder::clusters, ClusterStatistics._DESERIALIZER, "_clusters"); op.add(Builder::hits, HitsMetadata.createHitsMetadataDeserializer(tDocumentDeserializer), "hits"); op.add(Builder::numReducePhases, JsonpDeserializer.integerDeserializer(), "num_reduce_phases"); diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/search_relevance/GetQuerySetsResponse.java b/java-client/src/generated/java/org/opensearch/client/opensearch/search_relevance/GetQuerySetsResponse.java index 4e2f0b6ea8..96cf86a755 100644 --- a/java-client/src/generated/java/org/opensearch/client/opensearch/search_relevance/GetQuerySetsResponse.java +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/search_relevance/GetQuerySetsResponse.java @@ -264,7 +264,12 @@ public void serialize(JsonGenerator generator, JsonpMapper mapper) { protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { if (ApiTypeHelper.isDefined(this.aggregations)) { generator.writeKey("aggregations"); - ExternallyTaggedUnion.serializeTypedKeys(this.aggregations, generator, mapper); + generator.writeStartObject(); + for (Map.Entry item0 : this.aggregations.entrySet()) { + generator.writeKey(item0.getKey()); + item0.getValue().serialize(generator, mapper); + } + generator.writeEnd(); } if (this.clusters != null) { @@ -697,7 +702,7 @@ protected static void setupGetQuerySetsResponseDeserializer( ObjectDeserializer> op, JsonpDeserializer tDocumentDeserializer ) { - op.add(Builder::aggregations, Aggregate._TYPED_KEYS_DESERIALIZER, "aggregations"); + op.add(Builder::aggregations, JsonpDeserializer.stringMapDeserializer(Aggregate._DESERIALIZER), "aggregations"); op.add(Builder::clusters, ClusterStatistics._DESERIALIZER, "_clusters"); op.add(Builder::hits, HitsMetadata.createHitsMetadataDeserializer(tDocumentDeserializer), "hits"); op.add(Builder::numReducePhases, JsonpDeserializer.integerDeserializer(), "num_reduce_phases"); diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/search_relevance/GetScheduledExperimentsResponse.java b/java-client/src/generated/java/org/opensearch/client/opensearch/search_relevance/GetScheduledExperimentsResponse.java index 47e125a282..47429d58c8 100644 --- a/java-client/src/generated/java/org/opensearch/client/opensearch/search_relevance/GetScheduledExperimentsResponse.java +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/search_relevance/GetScheduledExperimentsResponse.java @@ -264,7 +264,12 @@ public void serialize(JsonGenerator generator, JsonpMapper mapper) { protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { if (ApiTypeHelper.isDefined(this.aggregations)) { generator.writeKey("aggregations"); - ExternallyTaggedUnion.serializeTypedKeys(this.aggregations, generator, mapper); + generator.writeStartObject(); + for (Map.Entry item0 : this.aggregations.entrySet()) { + generator.writeKey(item0.getKey()); + item0.getValue().serialize(generator, mapper); + } + generator.writeEnd(); } if (this.clusters != null) { @@ -700,7 +705,7 @@ protected static void setupGetScheduledExperimentsResponseDeserializ ObjectDeserializer> op, JsonpDeserializer tDocumentDeserializer ) { - op.add(Builder::aggregations, Aggregate._TYPED_KEYS_DESERIALIZER, "aggregations"); + op.add(Builder::aggregations, JsonpDeserializer.stringMapDeserializer(Aggregate._DESERIALIZER), "aggregations"); op.add(Builder::clusters, ClusterStatistics._DESERIALIZER, "_clusters"); op.add(Builder::hits, HitsMetadata.createHitsMetadataDeserializer(tDocumentDeserializer), "hits"); op.add(Builder::numReducePhases, JsonpDeserializer.integerDeserializer(), "num_reduce_phases"); diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/search_relevance/GetSearchConfigurationsResponse.java b/java-client/src/generated/java/org/opensearch/client/opensearch/search_relevance/GetSearchConfigurationsResponse.java index d355d1efa1..6a12df953d 100644 --- a/java-client/src/generated/java/org/opensearch/client/opensearch/search_relevance/GetSearchConfigurationsResponse.java +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/search_relevance/GetSearchConfigurationsResponse.java @@ -264,7 +264,12 @@ public void serialize(JsonGenerator generator, JsonpMapper mapper) { protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { if (ApiTypeHelper.isDefined(this.aggregations)) { generator.writeKey("aggregations"); - ExternallyTaggedUnion.serializeTypedKeys(this.aggregations, generator, mapper); + generator.writeStartObject(); + for (Map.Entry item0 : this.aggregations.entrySet()) { + generator.writeKey(item0.getKey()); + item0.getValue().serialize(generator, mapper); + } + generator.writeEnd(); } if (this.clusters != null) { @@ -700,7 +705,7 @@ protected static void setupGetSearchConfigurationsResponseDeserializ ObjectDeserializer> op, JsonpDeserializer tDocumentDeserializer ) { - op.add(Builder::aggregations, Aggregate._TYPED_KEYS_DESERIALIZER, "aggregations"); + op.add(Builder::aggregations, JsonpDeserializer.stringMapDeserializer(Aggregate._DESERIALIZER), "aggregations"); op.add(Builder::clusters, ClusterStatistics._DESERIALIZER, "_clusters"); op.add(Builder::hits, HitsMetadata.createHitsMetadataDeserializer(tDocumentDeserializer), "hits"); op.add(Builder::numReducePhases, JsonpDeserializer.integerDeserializer(), "num_reduce_phases"); diff --git a/java-codegen/opensearch-openapi.yaml b/java-codegen/opensearch-openapi.yaml index 1e7c2f76f2..1a9660ced7 100644 --- a/java-codegen/opensearch-openapi.yaml +++ b/java-codegen/opensearch-openapi.yaml @@ -41473,13 +41473,20 @@ components: - $ref: '#/components/schemas/_common.aggregations___BucketAggregationBase' - type: object properties: - filters: - description: |- - Filters used to create buckets. - At least one filter is required. - type: object - additionalProperties: - $ref: '#/components/schemas/_common.query_dsl___QueryContainer' + adjacency_matrix: + $ref: '#/components/schemas/_common.aggregations___AdjacencyMatrixAggregationFields' + required: + - adjacency_matrix + _common.aggregations___AdjacencyMatrixAggregationFields: + type: object + properties: + filters: + description: |- + Filters used to create buckets. + At least one filter is required. + type: object + additionalProperties: + $ref: '#/components/schemas/_common.query_dsl___QueryContainer' _common.aggregations___AdjacencyMatrixBucket: allOf: - $ref: '#/components/schemas/_common.aggregations___MultiBucketBase' @@ -41491,129 +41498,133 @@ components: - key _common.aggregations___Aggregate: x-supports-typed-keys: true - anyOf: - - title: adjacency_matrix - $ref: '#/components/schemas/_common.aggregations___AdjacencyMatrixAggregate' - - title: auto_date_histogram - $ref: '#/components/schemas/_common.aggregations___AutoDateHistogramAggregate' - - title: avg - $ref: '#/components/schemas/_common.aggregations___AvgAggregate' - - title: box_plot - $ref: '#/components/schemas/_common.aggregations___BoxPlotAggregate' - - title: bucket_metric_value - $ref: '#/components/schemas/_common.aggregations___BucketMetricValueAggregate' - - title: cardinality - $ref: '#/components/schemas/_common.aggregations___CardinalityAggregate' - - title: children - $ref: '#/components/schemas/_common.aggregations___ChildrenAggregate' - - title: composite - $ref: '#/components/schemas/_common.aggregations___CompositeAggregate' - - title: date_histogram - $ref: '#/components/schemas/_common.aggregations___DateHistogramAggregate' - - title: date_range - $ref: '#/components/schemas/_common.aggregations___DateRangeAggregate' - - title: derivative - $ref: '#/components/schemas/_common.aggregations___DerivativeAggregate' - - title: dterms - $ref: '#/components/schemas/_common.aggregations___DoubleTermsAggregate' - - title: extended_stats - $ref: '#/components/schemas/_common.aggregations___ExtendedStatsAggregate' - - title: extended_stats_bucket - $ref: '#/components/schemas/_common.aggregations___ExtendedStatsBucketAggregate' - - title: filter - $ref: '#/components/schemas/_common.aggregations___FilterAggregate' - - title: filters - $ref: '#/components/schemas/_common.aggregations___FiltersAggregate' - - title: geo_bounds - $ref: '#/components/schemas/_common.aggregations___GeoBoundsAggregate' - - title: geo_centroid - $ref: '#/components/schemas/_common.aggregations___GeoCentroidAggregate' - - title: geo_distance - $ref: '#/components/schemas/_common.aggregations___GeoDistanceAggregate' - - title: geohash_grid - $ref: '#/components/schemas/_common.aggregations___GeoHashGridAggregate' - - title: geotile_grid - $ref: '#/components/schemas/_common.aggregations___GeoTileGridAggregate' - - title: global - $ref: '#/components/schemas/_common.aggregations___GlobalAggregate' - - title: hdr_percentiles - $ref: '#/components/schemas/_common.aggregations___HdrPercentilesAggregate' - - title: hdr_percentile_ranks - $ref: '#/components/schemas/_common.aggregations___HdrPercentileRanksAggregate' - - title: histogram - $ref: '#/components/schemas/_common.aggregations___HistogramAggregate' - - title: ip_range - $ref: '#/components/schemas/_common.aggregations___IpRangeAggregate' - - title: lrareterms - $ref: '#/components/schemas/_common.aggregations___LongRareTermsAggregate' - - title: lterms - $ref: '#/components/schemas/_common.aggregations___LongTermsAggregate' - - title: matrix_stats - $ref: '#/components/schemas/_common.aggregations___MatrixStatsAggregate' - - title: max - $ref: '#/components/schemas/_common.aggregations___MaxAggregate' - - title: median_absolute_deviation - $ref: '#/components/schemas/_common.aggregations___MedianAbsoluteDeviationAggregate' - - title: min - $ref: '#/components/schemas/_common.aggregations___MinAggregate' - - title: missing - $ref: '#/components/schemas/_common.aggregations___MissingAggregate' - - title: multi_terms - $ref: '#/components/schemas/_common.aggregations___MultiTermsAggregate' - - title: nested - $ref: '#/components/schemas/_common.aggregations___NestedAggregate' - - title: parent - $ref: '#/components/schemas/_common.aggregations___ParentAggregate' - - title: percentiles_bucket - $ref: '#/components/schemas/_common.aggregations___PercentilesBucketAggregate' - - title: range - $ref: '#/components/schemas/_common.aggregations___RangeAggregate' - - title: rate - $ref: '#/components/schemas/_common.aggregations___RateAggregate' - - title: reverse_nested - $ref: '#/components/schemas/_common.aggregations___ReverseNestedAggregate' - - title: sampler - $ref: '#/components/schemas/_common.aggregations___SamplerAggregate' - - title: scripted_metric - $ref: '#/components/schemas/_common.aggregations___ScriptedMetricAggregate' - - title: siglterms - $ref: '#/components/schemas/_common.aggregations___SignificantLongTermsAggregate' - - title: sigsterms - $ref: '#/components/schemas/_common.aggregations___SignificantStringTermsAggregate' - - title: simple_long_value - $ref: '#/components/schemas/_common.aggregations___CumulativeCardinalityAggregate' - - title: simple_value - $ref: '#/components/schemas/_common.aggregations___SimpleValueAggregate' - - title: stats - $ref: '#/components/schemas/_common.aggregations___StatsAggregate' - - title: stats_bucket - $ref: '#/components/schemas/_common.aggregations___StatsBucketAggregate' - - title: srareterms - $ref: '#/components/schemas/_common.aggregations___StringRareTermsAggregate' - - title: sterms - $ref: '#/components/schemas/_common.aggregations___StringTermsAggregate' - - title: sum - $ref: '#/components/schemas/_common.aggregations___SumAggregate' - - title: tdigest_percentiles - $ref: '#/components/schemas/_common.aggregations___TDigestPercentilesAggregate' - - title: tdigest_percentile_ranks - $ref: '#/components/schemas/_common.aggregations___TDigestPercentileRanksAggregate' - - title: t_test - $ref: '#/components/schemas/_common.aggregations___TTestAggregate' - - title: top_hits - $ref: '#/components/schemas/_common.aggregations___TopHitsAggregate' - - title: umrareterms - $ref: '#/components/schemas/_common.aggregations___UnmappedRareTermsAggregate' - - title: umsigterms - $ref: '#/components/schemas/_common.aggregations___UnmappedSignificantTermsAggregate' - - title: umterms - $ref: '#/components/schemas/_common.aggregations___UnmappedTermsAggregate' - - title: value_count - $ref: '#/components/schemas/_common.aggregations___ValueCountAggregate' - - title: variable_width_histogram - $ref: '#/components/schemas/_common.aggregations___VariableWidthHistogramAggregate' - - title: weighted_avg - $ref: '#/components/schemas/_common.aggregations___WeightedAvgAggregate' + allOf: + - $ref: '#/components/schemas/_common.aggregations___AggregateBase' + - anyOf: + - title: adjacency_matrix + $ref: '#/components/schemas/_common.aggregations___AdjacencyMatrixAggregate' + - title: auto_date_histogram + $ref: '#/components/schemas/_common.aggregations___AutoDateHistogramAggregate' + - title: avg + $ref: '#/components/schemas/_common.aggregations___AvgAggregate' + - title: box_plot + $ref: '#/components/schemas/_common.aggregations___BoxPlotAggregate' + - title: bucket_metric_value + $ref: '#/components/schemas/_common.aggregations___BucketMetricValueAggregate' + - title: cardinality + $ref: '#/components/schemas/_common.aggregations___CardinalityAggregate' + - title: children + $ref: '#/components/schemas/_common.aggregations___ChildrenAggregate' + - title: composite + $ref: '#/components/schemas/_common.aggregations___CompositeAggregate' + - title: date_histogram + $ref: '#/components/schemas/_common.aggregations___DateHistogramAggregate' + - title: date_range + $ref: '#/components/schemas/_common.aggregations___DateRangeAggregate' + - title: derivative + $ref: '#/components/schemas/_common.aggregations___DerivativeAggregate' + - title: dterms + $ref: '#/components/schemas/_common.aggregations___DoubleTermsAggregate' + - title: extended_stats + $ref: '#/components/schemas/_common.aggregations___ExtendedStatsAggregate' + - title: extended_stats_bucket + $ref: '#/components/schemas/_common.aggregations___ExtendedStatsBucketAggregate' + - title: filter + $ref: '#/components/schemas/_common.aggregations___FilterAggregate' + - title: filters + $ref: '#/components/schemas/_common.aggregations___FiltersAggregate' + - title: geo_bounds + $ref: '#/components/schemas/_common.aggregations___GeoBoundsAggregate' + - title: geo_centroid + $ref: '#/components/schemas/_common.aggregations___GeoCentroidAggregate' + - title: geo_distance + $ref: '#/components/schemas/_common.aggregations___GeoDistanceAggregate' + - title: geohash_grid + $ref: '#/components/schemas/_common.aggregations___GeoHashGridAggregate' + - title: geotile_grid + $ref: '#/components/schemas/_common.aggregations___GeoTileGridAggregate' + - title: global + $ref: '#/components/schemas/_common.aggregations___GlobalAggregate' + - title: hdr_percentiles + $ref: '#/components/schemas/_common.aggregations___HdrPercentilesAggregate' + - title: hdr_percentile_ranks + $ref: '#/components/schemas/_common.aggregations___HdrPercentileRanksAggregate' + - title: histogram + $ref: '#/components/schemas/_common.aggregations___HistogramAggregate' + - title: ip_range + $ref: '#/components/schemas/_common.aggregations___IpRangeAggregate' + - title: lrareterms + $ref: '#/components/schemas/_common.aggregations___LongRareTermsAggregate' + - title: lterms + $ref: '#/components/schemas/_common.aggregations___LongTermsAggregate' + - title: matrix_stats + $ref: '#/components/schemas/_common.aggregations___MatrixStatsAggregate' + - title: max + $ref: '#/components/schemas/_common.aggregations___MaxAggregate' + - title: median_absolute_deviation + $ref: '#/components/schemas/_common.aggregations___MedianAbsoluteDeviationAggregate' + - title: min + $ref: '#/components/schemas/_common.aggregations___MinAggregate' + - title: missing + $ref: '#/components/schemas/_common.aggregations___MissingAggregate' + - title: multi_terms + $ref: '#/components/schemas/_common.aggregations___MultiTermsAggregate' + - title: nested + $ref: '#/components/schemas/_common.aggregations___NestedAggregate' + - title: parent + $ref: '#/components/schemas/_common.aggregations___ParentAggregate' + - title: percentiles_bucket + $ref: '#/components/schemas/_common.aggregations___PercentilesBucketAggregate' + - title: range + $ref: '#/components/schemas/_common.aggregations___RangeAggregate' + - title: rate + $ref: '#/components/schemas/_common.aggregations___RateAggregate' + - title: reverse_nested + $ref: '#/components/schemas/_common.aggregations___ReverseNestedAggregate' + - title: sampler + $ref: '#/components/schemas/_common.aggregations___SamplerAggregate' + - title: scripted_metric + $ref: '#/components/schemas/_common.aggregations___ScriptedMetricAggregate' + - title: siglterms + $ref: '#/components/schemas/_common.aggregations___SignificantLongTermsAggregate' + - title: sigsterms + $ref: '#/components/schemas/_common.aggregations___SignificantStringTermsAggregate' + - title: simple_long_value + $ref: '#/components/schemas/_common.aggregations___CumulativeCardinalityAggregate' + - title: simple_value + $ref: '#/components/schemas/_common.aggregations___SimpleValueAggregate' + - title: stats + $ref: '#/components/schemas/_common.aggregations___StatsAggregate' + - title: stats_bucket + $ref: '#/components/schemas/_common.aggregations___StatsBucketAggregate' + - title: srareterms + $ref: '#/components/schemas/_common.aggregations___StringRareTermsAggregate' + - title: sterms + $ref: '#/components/schemas/_common.aggregations___StringTermsAggregate' + - title: sum + $ref: '#/components/schemas/_common.aggregations___SumAggregate' + - title: tdigest_percentiles + $ref: '#/components/schemas/_common.aggregations___TDigestPercentilesAggregate' + - title: tdigest_percentile_ranks + $ref: '#/components/schemas/_common.aggregations___TDigestPercentileRanksAggregate' + - title: t_test + $ref: '#/components/schemas/_common.aggregations___TTestAggregate' + - title: top_hits + $ref: '#/components/schemas/_common.aggregations___TopHitsAggregate' + - title: ulterms + $ref: '#/components/schemas/_common.aggregations___UnsignedLongTermsAggregate' + - title: umrareterms + $ref: '#/components/schemas/_common.aggregations___UnmappedRareTermsAggregate' + - title: umsigterms + $ref: '#/components/schemas/_common.aggregations___UnmappedSignificantTermsAggregate' + - title: umterms + $ref: '#/components/schemas/_common.aggregations___UnmappedTermsAggregate' + - title: value_count + $ref: '#/components/schemas/_common.aggregations___ValueCountAggregate' + - title: variable_width_histogram + $ref: '#/components/schemas/_common.aggregations___VariableWidthHistogramAggregate' + - title: weighted_avg + $ref: '#/components/schemas/_common.aggregations___WeightedAvgAggregate' _common.aggregations___AggregateBase: type: object properties: @@ -41637,29 +41648,15 @@ components: type: object properties: meta: + description: Custom metadata to associate with the aggregation (optional) $ref: '#/components/schemas/_common___Metadata' - name: - type: string _common.aggregations___AggregationContainer: allOf: - - type: object - properties: - meta: - $ref: '#/components/schemas/_common___Metadata' + - $ref: '#/components/schemas/_common.aggregations___Aggregation' - type: object oneOf: - - properties: - adjacency_matrix: - $ref: '#/components/schemas/_common.aggregations___AdjacencyMatrixAggregation' - required: - - adjacency_matrix - unevaluatedProperties: true - - properties: - auto_date_histogram: - $ref: '#/components/schemas/_common.aggregations___AutoDateHistogramAggregation' - required: - - auto_date_histogram - unevaluatedProperties: true + - $ref: '#/components/schemas/_common.aggregations___AdjacencyMatrixAggregation' + - $ref: '#/components/schemas/_common.aggregations___AutoDateHistogramAggregation' - properties: avg: $ref: '#/components/schemas/_common.aggregations___AverageAggregation' @@ -41702,18 +41699,8 @@ components: required: - cardinality unevaluatedProperties: true - - properties: - children: - $ref: '#/components/schemas/_common.aggregations___ChildrenAggregation' - required: - - children - unevaluatedProperties: true - - properties: - composite: - $ref: '#/components/schemas/_common.aggregations___CompositeAggregation' - required: - - composite - unevaluatedProperties: true + - $ref: '#/components/schemas/_common.aggregations___ChildrenAggregation' + - $ref: '#/components/schemas/_common.aggregations___CompositeAggregation' - properties: cumulative_cardinality: $ref: '#/components/schemas/_common.aggregations___CumulativeCardinalityAggregation' @@ -41726,30 +41713,15 @@ components: required: - cumulative_sum unevaluatedProperties: true - - properties: - date_histogram: - $ref: '#/components/schemas/_common.aggregations___DateHistogramAggregation' - required: - - date_histogram - unevaluatedProperties: true - - properties: - date_range: - $ref: '#/components/schemas/_common.aggregations___DateRangeAggregation' - required: - - date_range - unevaluatedProperties: true + - $ref: '#/components/schemas/_common.aggregations___DateHistogramAggregation' + - $ref: '#/components/schemas/_common.aggregations___DateRangeAggregation' - properties: derivative: $ref: '#/components/schemas/_common.aggregations___DerivativeAggregation' required: - derivative unevaluatedProperties: true - - properties: - diversified_sampler: - $ref: '#/components/schemas/_common.aggregations___DiversifiedSamplerAggregation' - required: - - diversified_sampler - unevaluatedProperties: true + - $ref: '#/components/schemas/_common.aggregations___DiversifiedSamplerAggregation' - properties: extended_stats: $ref: '#/components/schemas/_common.aggregations___ExtendedStatsAggregation' @@ -41762,19 +41734,8 @@ components: required: - extended_stats_bucket unevaluatedProperties: true - - properties: - filter: - $ref: '#/components/schemas/_common.query_dsl___QueryContainer' - required: - - filter - unevaluatedProperties: true - x-protobuf-excluded: true - - properties: - filters: - $ref: '#/components/schemas/_common.aggregations___FiltersAggregation' - required: - - filters - unevaluatedProperties: true + - $ref: '#/components/schemas/_common.aggregations___FilterAggregation' + - $ref: '#/components/schemas/_common.aggregations___FiltersAggregation' - properties: geo_bounds: $ref: '#/components/schemas/_common.aggregations___GeoBoundsAggregation' @@ -41787,42 +41748,12 @@ components: required: - geo_centroid unevaluatedProperties: true - - properties: - geo_distance: - $ref: '#/components/schemas/_common.aggregations___GeoDistanceAggregation' - required: - - geo_distance - unevaluatedProperties: true - - properties: - geohash_grid: - $ref: '#/components/schemas/_common.aggregations___GeoHashGridAggregation' - required: - - geohash_grid - unevaluatedProperties: true - - properties: - geotile_grid: - $ref: '#/components/schemas/_common.aggregations___GeoTileGridAggregation' - required: - - geotile_grid - unevaluatedProperties: true - - properties: - global: - $ref: '#/components/schemas/_common.aggregations___GlobalAggregation' - required: - - global - unevaluatedProperties: true - - properties: - histogram: - $ref: '#/components/schemas/_common.aggregations___HistogramAggregation' - required: - - histogram - unevaluatedProperties: true - - properties: - ip_range: - $ref: '#/components/schemas/_common.aggregations___IpRangeAggregation' - required: - - ip_range - unevaluatedProperties: true + - $ref: '#/components/schemas/_common.aggregations___GeoDistanceAggregation' + - $ref: '#/components/schemas/_common.aggregations___GeoHashGridAggregation' + - $ref: '#/components/schemas/_common.aggregations___GeoTileGridAggregation' + - $ref: '#/components/schemas/_common.aggregations___GlobalAggregation' + - $ref: '#/components/schemas/_common.aggregations___HistogramAggregation' + - $ref: '#/components/schemas/_common.aggregations___IpRangeAggregation' - properties: matrix_stats: $ref: '#/components/schemas/_common.aggregations___MatrixStatsAggregation' @@ -41859,12 +41790,7 @@ components: required: - min_bucket unevaluatedProperties: true - - properties: - missing: - $ref: '#/components/schemas/_common.aggregations___MissingAggregation' - required: - - missing - unevaluatedProperties: true + - $ref: '#/components/schemas/_common.aggregations___MissingAggregation' - properties: moving_avg: $ref: '#/components/schemas/_common.aggregations___MovingAverageAggregation' @@ -41883,30 +41809,15 @@ components: required: - moving_fn unevaluatedProperties: true - - properties: - multi_terms: - $ref: '#/components/schemas/_common.aggregations___MultiTermsAggregation' - required: - - multi_terms - unevaluatedProperties: true - - properties: - nested: - $ref: '#/components/schemas/_common.aggregations___NestedAggregation' - required: - - nested - unevaluatedProperties: true + - $ref: '#/components/schemas/_common.aggregations___MultiTermsAggregation' + - $ref: '#/components/schemas/_common.aggregations___NestedAggregation' - properties: normalize: $ref: '#/components/schemas/_common.aggregations___NormalizeAggregation' required: - normalize unevaluatedProperties: true - - properties: - parent: - $ref: '#/components/schemas/_common.aggregations___ParentAggregation' - required: - - parent - unevaluatedProperties: true + - $ref: '#/components/schemas/_common.aggregations___ParentAggregation' - properties: percentile_ranks: $ref: '#/components/schemas/_common.aggregations___PercentileRanksAggregation' @@ -41925,36 +41836,16 @@ components: required: - percentiles_bucket unevaluatedProperties: true - - properties: - range: - $ref: '#/components/schemas/_common.aggregations___RangeAggregation' - required: - - range - unevaluatedProperties: true - - properties: - rare_terms: - $ref: '#/components/schemas/_common.aggregations___RareTermsAggregation' - required: - - rare_terms - unevaluatedProperties: true + - $ref: '#/components/schemas/_common.aggregations___RangeAggregation' + - $ref: '#/components/schemas/_common.aggregations___RareTermsAggregation' - properties: rate: $ref: '#/components/schemas/_common.aggregations___RateAggregation' required: - rate unevaluatedProperties: true - - properties: - reverse_nested: - $ref: '#/components/schemas/_common.aggregations___ReverseNestedAggregation' - required: - - reverse_nested - unevaluatedProperties: true - - properties: - sampler: - $ref: '#/components/schemas/_common.aggregations___SamplerAggregation' - required: - - sampler - unevaluatedProperties: true + - $ref: '#/components/schemas/_common.aggregations___ReverseNestedAggregation' + - $ref: '#/components/schemas/_common.aggregations___SamplerAggregation' - properties: scripted_metric: $ref: '#/components/schemas/_common.aggregations___ScriptedMetricAggregation' @@ -41967,18 +41858,8 @@ components: required: - serial_diff unevaluatedProperties: true - - properties: - significant_terms: - $ref: '#/components/schemas/_common.aggregations___SignificantTermsAggregation' - required: - - significant_terms - unevaluatedProperties: true - - properties: - significant_text: - $ref: '#/components/schemas/_common.aggregations___SignificantTextAggregation' - required: - - significant_text - unevaluatedProperties: true + - $ref: '#/components/schemas/_common.aggregations___SignificantTermsAggregation' + - $ref: '#/components/schemas/_common.aggregations___SignificantTextAggregation' - properties: stats: $ref: '#/components/schemas/_common.aggregations___StatsAggregation' @@ -42003,12 +41884,7 @@ components: required: - sum_bucket unevaluatedProperties: true - - properties: - terms: - $ref: '#/components/schemas/_common.aggregations___TermsAggregation' - required: - - terms - unevaluatedProperties: true + - $ref: '#/components/schemas/_common.aggregations___TermsAggregation' - properties: top_hits: $ref: '#/components/schemas/_common.aggregations___TopHitsAggregation' @@ -42088,31 +41964,38 @@ components: - $ref: '#/components/schemas/_common.aggregations___BucketAggregationBase' - type: object properties: - buckets: - description: The target number of buckets. - type: integer - format: int32 - field: - $ref: '#/components/schemas/_common___Field' - format: - description: |- - The date format used to format `key_as_string` in the response. - If no `format` is specified, the first date format specified in the field mapping is used. - type: string - minimum_interval: - $ref: '#/components/schemas/_common.aggregations___MinimumInterval' - missing: - $ref: '#/components/schemas/_common___DateTime' - offset: - description: Time zone specified as a ISO 8601 UTC offset. - type: string - params: - type: object - additionalProperties: true - script: - $ref: '#/components/schemas/_common___Script' - time_zone: - $ref: '#/components/schemas/_common___TimeZone' + auto_date_histogram: + $ref: '#/components/schemas/_common.aggregations___AutoDateHistogramAggregationFields' + required: + - auto_date_histogram + _common.aggregations___AutoDateHistogramAggregationFields: + type: object + properties: + buckets: + description: The target number of buckets. + type: integer + format: int32 + field: + $ref: '#/components/schemas/_common___Field' + format: + description: |- + The date format used to format `key_as_string` in the response. + If no `format` is specified, the first date format specified in the field mapping is used. + type: string + minimum_interval: + $ref: '#/components/schemas/_common.aggregations___MinimumInterval' + missing: + $ref: '#/components/schemas/_common___DateTime' + offset: + description: Time zone specified as a ISO 8601 UTC offset. + type: string + params: + type: object + additionalProperties: true + script: + $ref: '#/components/schemas/_common___Script' + time_zone: + $ref: '#/components/schemas/_common___TimeZone' _common.aggregations___AverageAggregation: allOf: - $ref: '#/components/schemas/_common.aggregations___FormatMetricAggregationBase' @@ -42126,53 +42009,51 @@ components: - $ref: '#/components/schemas/_common.aggregations___SingleMetricAggregateBase' - type: object _common.aggregations___BoxPlotAggregate: - allOf: - - $ref: '#/components/schemas/_common.aggregations___AggregateBase' - - type: object - properties: - min: - type: number - format: double - max: - type: number - format: double - q1: - type: number - format: double - q2: - type: number - format: double - q3: - type: number - format: double - lower: - type: number - format: double - upper: - type: number - format: double - min_as_string: - type: string - max_as_string: - type: string - q1_as_string: - type: string - q2_as_string: - type: string - q3_as_string: - type: string - lower_as_string: - type: string - upper_as_string: - type: string - required: - - lower - - max - - min - - q1 - - q2 - - q3 - - upper + type: object + properties: + min: + type: number + format: double + max: + type: number + format: double + q1: + type: number + format: double + q2: + type: number + format: double + q3: + type: number + format: double + lower: + type: number + format: double + upper: + type: number + format: double + min_as_string: + type: string + max_as_string: + type: string + q1_as_string: + type: string + q2_as_string: + type: string + q3_as_string: + type: string + lower_as_string: + type: string + upper_as_string: + type: string + required: + - lower + - max + - min + - q1 + - q2 + - q3 + - upper _common.aggregations___BoxplotAggregation: allOf: - $ref: '#/components/schemas/_common.aggregations___MetricAggregationBase' @@ -42183,20 +42064,39 @@ components: type: number format: double _common.aggregations___BucketAggregationBase: - allOf: - - $ref: '#/components/schemas/_common.aggregations___Aggregation' - - type: object - properties: - aggregations: - description: Sub-aggregations for this bucket aggregation - type: object - additionalProperties: - $ref: '#/components/schemas/_common.aggregations___AggregationContainer' - aggs: - description: Sub-aggregations for this bucket aggregation - type: object - additionalProperties: - $ref: '#/components/schemas/_common.aggregations___AggregationContainer' + type: object + properties: + aggregations: + description: Sub-aggregations for this bucket aggregation + type: object + propertyNames: + title: aggregation_name + description: Sub-aggregation name + type: string + additionalProperties: + title: aggregation_container + $ref: '#/components/schemas/_common.aggregations___AggregationContainer' + aggs: + description: Sub-aggregations for this bucket aggregation (alias for 'aggregations') + type: object + x-protobuf-excluded: true + propertyNames: + title: aggregation_name + description: Sub-aggregation name + type: string + additionalProperties: + title: aggregation_container + $ref: '#/components/schemas/_common.aggregations___AggregationContainer' + not: + type: object + properties: + aggregations: + type: object + aggs: + type: object + required: + - aggregations + - aggs _common.aggregations___BucketMetricValueAggregate: allOf: - $ref: '#/components/schemas/_common.aggregations___SingleMetricAggregateBase' @@ -42209,12 +42109,10 @@ components: required: - keys _common.aggregations___BucketPathAggregation: - allOf: - - $ref: '#/components/schemas/_common.aggregations___Aggregation' - - type: object - properties: - buckets_path: - $ref: '#/components/schemas/_common.aggregations___BucketsPath' + type: object + properties: + buckets_path: + $ref: '#/components/schemas/_common.aggregations___BucketsPath' _common.aggregations___Buckets: description: |- Aggregation buckets. By default they are returned as an array, but if the aggregation has keys configured for @@ -42243,24 +42141,22 @@ components: script: $ref: '#/components/schemas/_common___Script' _common.aggregations___BucketSortAggregation: - allOf: - - $ref: '#/components/schemas/_common.aggregations___Aggregation' - - type: object - properties: - from: - description: Buckets in positions prior to `from` will be truncated. - type: integer - format: int32 - gap_policy: - $ref: '#/components/schemas/_common.aggregations___GapPolicy' - size: - description: |- - The number of buckets to return. - Defaults to all buckets of the parent aggregation. - type: integer - format: int32 - sort: - $ref: '#/components/schemas/_common___Sort' + type: object + properties: + from: + description: Buckets in positions prior to `from` will be truncated. + type: integer + format: int32 + gap_policy: + $ref: '#/components/schemas/_common.aggregations___GapPolicy' + size: + description: |- + The number of buckets to return. + Defaults to all buckets of the parent aggregation. + type: integer + format: int32 + sort: + $ref: '#/components/schemas/_common___Sort' _common.aggregations___BucketsPath: description: |- Buckets path can be expressed in different ways, and an aggregation may accept some or all of these @@ -42332,15 +42228,13 @@ components: - year - 1Y _common.aggregations___CardinalityAggregate: - allOf: - - $ref: '#/components/schemas/_common.aggregations___AggregateBase' - - type: object - properties: - value: - type: integer - format: int64 - required: - - value + type: object + properties: + value: + type: integer + format: int64 + required: + - value _common.aggregations___CardinalityAggregation: allOf: - $ref: '#/components/schemas/_common.aggregations___MetricAggregationBase' @@ -42369,8 +42263,15 @@ components: - $ref: '#/components/schemas/_common.aggregations___BucketAggregationBase' - type: object properties: - type: - $ref: '#/components/schemas/_common___RelationName' + children: + $ref: '#/components/schemas/_common.aggregations___ChildrenAggregationFields' + required: + - children + _common.aggregations___ChildrenAggregationFields: + type: object + properties: + type: + $ref: '#/components/schemas/_common___RelationName' _common.aggregations___ChiSquareHeuristic: type: object properties: @@ -42399,21 +42300,28 @@ components: - $ref: '#/components/schemas/_common.aggregations___BucketAggregationBase' - type: object properties: - after: - $ref: '#/components/schemas/_common.aggregations___CompositeAggregateKey' - size: - description: The number of composite buckets that should be returned. - type: integer - format: int32 - sources: - description: |- - The value sources used to build composite buckets. - Keys are returned in the order of the `sources` definition. - type: array - items: - type: object - additionalProperties: - $ref: '#/components/schemas/_common.aggregations___CompositeAggregationSource' + composite: + $ref: '#/components/schemas/_common.aggregations___CompositeAggregationFields' + required: + - composite + _common.aggregations___CompositeAggregationFields: + type: object + properties: + after: + $ref: '#/components/schemas/_common.aggregations___CompositeAggregateKey' + size: + description: The number of composite buckets that should be returned. + type: integer + format: int32 + sources: + description: |- + The value sources used to build composite buckets. + Keys are returned in the order of the `sources` definition. + type: array + items: + type: object + additionalProperties: + $ref: '#/components/schemas/_common.aggregations___CompositeAggregationSource' _common.aggregations___CompositeAggregationSource: type: object properties: @@ -42489,17 +42397,15 @@ components: order: $ref: '#/components/schemas/_common___SortOrder' _common.aggregations___CumulativeCardinalityAggregate: - allOf: - - $ref: '#/components/schemas/_common.aggregations___AggregateBase' - - type: object - properties: - value: - type: integer - format: int64 - value_as_string: - type: string - required: - - value + type: object + properties: + value: + type: integer + format: int64 + value_as_string: + type: string + required: + - value _common.aggregations___CumulativeCardinalityAggregation: allOf: - $ref: '#/components/schemas/_common.aggregations___PipelineAggregationBase' @@ -42517,45 +42423,52 @@ components: - $ref: '#/components/schemas/_common.aggregations___BucketAggregationBase' - type: object properties: - calendar_interval: - $ref: '#/components/schemas/_common.aggregations___CalendarInterval' - extended_bounds: - $ref: '#/components/schemas/_common.aggregations___ExtendedBoundsFieldDateMath' - hard_bounds: - $ref: '#/components/schemas/_common.aggregations___ExtendedBoundsFieldDateMath' - field: - $ref: '#/components/schemas/_common___Field' - fixed_interval: - $ref: '#/components/schemas/_common___Duration' - format: - description: |- - The date format used to format `key_as_string` in the response. - If no `format` is specified, the first date format specified in the field mapping is used. - type: string - interval: - $ref: '#/components/schemas/_common___Duration' - min_doc_count: - description: |- - Only returns buckets that have `min_doc_count` number of documents. - By default, all buckets between the first bucket that matches documents and the last one are returned. - type: integer - format: int32 - missing: - $ref: '#/components/schemas/_common___DateTime' - offset: - $ref: '#/components/schemas/_common___Duration' - order: - $ref: '#/components/schemas/_common.aggregations___HistogramOrder' - params: - type: object - additionalProperties: true - script: - $ref: '#/components/schemas/_common___Script' - time_zone: - $ref: '#/components/schemas/_common___TimeZone' - keyed: - description: Set to `true` to associate a unique string key with each bucket and return the ranges as a hash rather than an array. - type: boolean + date_histogram: + $ref: '#/components/schemas/_common.aggregations___DateHistogramAggregationFields' + required: + - date_histogram + _common.aggregations___DateHistogramAggregationFields: + type: object + properties: + calendar_interval: + $ref: '#/components/schemas/_common.aggregations___CalendarInterval' + extended_bounds: + $ref: '#/components/schemas/_common.aggregations___ExtendedBoundsFieldDateMath' + hard_bounds: + $ref: '#/components/schemas/_common.aggregations___ExtendedBoundsFieldDateMath' + field: + $ref: '#/components/schemas/_common___Field' + fixed_interval: + $ref: '#/components/schemas/_common___Duration' + format: + description: |- + The date format used to format `key_as_string` in the response. + If no `format` is specified, the first date format specified in the field mapping is used. + type: string + interval: + $ref: '#/components/schemas/_common___Duration' + min_doc_count: + description: |- + Only returns buckets that have `min_doc_count` number of documents. + By default, all buckets between the first bucket that matches documents and the last one are returned. + type: integer + format: int32 + missing: + $ref: '#/components/schemas/_common___DateTime' + offset: + $ref: '#/components/schemas/_common___Duration' + order: + $ref: '#/components/schemas/_common.aggregations___HistogramOrder' + params: + type: object + additionalProperties: true + script: + $ref: '#/components/schemas/_common___Script' + time_zone: + $ref: '#/components/schemas/_common___TimeZone' + keyed: + description: Set to `true` to associate a unique string key with each bucket and return the ranges as a hash rather than an array. + type: boolean _common.aggregations___DateHistogramBucket: allOf: - $ref: '#/components/schemas/_common.aggregations___MultiBucketBase' @@ -42576,23 +42489,30 @@ components: - $ref: '#/components/schemas/_common.aggregations___BucketAggregationBase' - type: object properties: - field: - $ref: '#/components/schemas/_common___Field' - format: - description: The date format used to format `from` and `to` in the response. - type: string - missing: - $ref: '#/components/schemas/_common___FieldValue' - ranges: - description: Array of date ranges. - type: array - items: - $ref: '#/components/schemas/_common.aggregations___DateRangeExpression' - time_zone: - $ref: '#/components/schemas/_common___TimeZone' - keyed: - description: Set to `true` to associate a unique string key with each bucket and returns the ranges as a hash rather than an array. - type: boolean + date_range: + $ref: '#/components/schemas/_common.aggregations___DateRangeAggregationFields' + required: + - date_range + _common.aggregations___DateRangeAggregationFields: + type: object + properties: + field: + $ref: '#/components/schemas/_common___Field' + format: + description: The date format used to format `from` and `to` in the response. + type: string + missing: + $ref: '#/components/schemas/_common___FieldValue' + ranges: + description: Array of date ranges. + type: array + items: + $ref: '#/components/schemas/_common.aggregations___DateRangeExpression' + time_zone: + $ref: '#/components/schemas/_common___TimeZone' + keyed: + description: Set to `true` to associate a unique string key with each bucket and returns the ranges as a hash rather than an array. + type: boolean _common.aggregations___DateRangeExpression: type: object properties: @@ -42622,20 +42542,27 @@ components: - $ref: '#/components/schemas/_common.aggregations___BucketAggregationBase' - type: object properties: - execution_hint: - $ref: '#/components/schemas/_common.aggregations___SamplerAggregationExecutionHint' - max_docs_per_value: - description: Limits how many documents are permitted per choice of de-duplicating value. - type: integer - format: int32 - script: - $ref: '#/components/schemas/_common___Script' - shard_size: - description: Limits how many top-scoring documents are collected in the sample processed on each shard. - type: integer - format: int32 - field: - $ref: '#/components/schemas/_common___Field' + diversified_sampler: + $ref: '#/components/schemas/_common.aggregations___DiversifiedSamplerAggregationFields' + required: + - diversified_sampler + _common.aggregations___DiversifiedSamplerAggregationFields: + type: object + properties: + execution_hint: + $ref: '#/components/schemas/_common.aggregations___SamplerAggregationExecutionHint' + max_docs_per_value: + description: Limits how many documents are permitted per choice of de-duplicating value. + type: integer + format: int32 + script: + $ref: '#/components/schemas/_common___Script' + shard_size: + description: Limits how many top-scoring documents are collected in the sample processed on each shard. + type: integer + format: int32 + field: + $ref: '#/components/schemas/_common___Field' _common.aggregations___DoubleTermsAggregate: description: Result of a `terms` aggregation when the field is some kind of decimal number like a float, double, or distance. allOf: @@ -42806,6 +42733,19 @@ components: allOf: - $ref: '#/components/schemas/_common.aggregations___SingleBucketAggregateBase' - type: object + _common.aggregations___FilterAggregation: + allOf: + - $ref: '#/components/schemas/_common.aggregations___BucketAggregationBase' + - type: object + properties: + filter: + $ref: '#/components/schemas/_common.aggregations___FilterAggregationFields' + required: + - filter + x-protobuf-excluded: true + _common.aggregations___FilterAggregationFields: + allOf: + - $ref: '#/components/schemas/_common.query_dsl___QueryContainer' _common.aggregations___FiltersAggregate: allOf: - $ref: '#/components/schemas/_common.aggregations___MultiBucketAggregateBaseFiltersBucket' @@ -42816,18 +42756,25 @@ components: - type: object properties: filters: - $ref: '#/components/schemas/_common.aggregations___BucketsQueryContainer' - other_bucket: - description: Set to `true` to add a bucket to the response which will contain all documents that do not match any of the given filters. - type: boolean - other_bucket_key: - description: The key with which the other bucket is returned. - type: string - keyed: - description: |- - By default, the named filters aggregation returns the buckets as an object. - Set to `false` to return the buckets as an array of objects. - type: boolean + $ref: '#/components/schemas/_common.aggregations___FiltersAggregationFields' + required: + - filters + _common.aggregations___FiltersAggregationFields: + type: object + properties: + filters: + $ref: '#/components/schemas/_common.aggregations___BucketsQueryContainer' + other_bucket: + description: Set to `true` to add a bucket to the response which will contain all documents that do not match any of the given filters. + type: boolean + other_bucket_key: + description: The key with which the other bucket is returned. + type: string + keyed: + description: |- + By default, the named filters aggregation returns the buckets as an object. + Set to `false` to return the buckets as an array of objects. + type: boolean _common.aggregations___FiltersBucket: allOf: - $ref: '#/components/schemas/_common.aggregations___MultiBucketBase' @@ -42853,12 +42800,10 @@ components: - keep_values - skip _common.aggregations___GeoBoundsAggregate: - allOf: - - $ref: '#/components/schemas/_common.aggregations___AggregateBase' - - type: object - properties: - bounds: - $ref: '#/components/schemas/_common___GeoBounds' + type: object + properties: + bounds: + $ref: '#/components/schemas/_common___GeoBounds' _common.aggregations___GeoBoundsAggregation: allOf: - $ref: '#/components/schemas/_common.aggregations___MetricAggregationBase' @@ -42868,17 +42813,15 @@ components: description: Specifies whether the bounding box should be allowed to overlap the international date line. type: boolean _common.aggregations___GeoCentroidAggregate: - allOf: - - $ref: '#/components/schemas/_common.aggregations___AggregateBase' - - type: object - properties: - count: - type: integer - format: int64 - location: - $ref: '#/components/schemas/_common___GeoLocation' - required: - - count + type: object + properties: + count: + type: integer + format: int64 + location: + $ref: '#/components/schemas/_common___GeoLocation' + required: + - count _common.aggregations___GeoCentroidAggregation: allOf: - $ref: '#/components/schemas/_common.aggregations___MetricAggregationBase' @@ -42898,19 +42841,26 @@ components: - $ref: '#/components/schemas/_common.aggregations___BucketAggregationBase' - type: object properties: - distance_type: - $ref: '#/components/schemas/_common___GeoDistanceType' - field: - $ref: '#/components/schemas/_common___Field' - origin: - $ref: '#/components/schemas/_common___GeoLocation' - ranges: - description: An array of ranges used to bucket documents. - type: array - items: - $ref: '#/components/schemas/_common.aggregations___AggregationRange' - unit: - $ref: '#/components/schemas/_common___DistanceUnit' + geo_distance: + $ref: '#/components/schemas/_common.aggregations___GeoDistanceAggregationFields' + required: + - geo_distance + _common.aggregations___GeoDistanceAggregationFields: + type: object + properties: + distance_type: + $ref: '#/components/schemas/_common___GeoDistanceType' + field: + $ref: '#/components/schemas/_common___Field' + origin: + $ref: '#/components/schemas/_common___GeoLocation' + ranges: + description: An array of ranges used to bucket documents. + type: array + items: + $ref: '#/components/schemas/_common.aggregations___AggregationRange' + unit: + $ref: '#/components/schemas/_common___DistanceUnit' _common.aggregations___GeoHashGridAggregate: allOf: - $ref: '#/components/schemas/_common.aggregations___MultiBucketAggregateBaseGeoHashGridBucket' @@ -42920,22 +42870,29 @@ components: - $ref: '#/components/schemas/_common.aggregations___BucketAggregationBase' - type: object properties: - bounds: - $ref: '#/components/schemas/_common___GeoBounds' - field: - $ref: '#/components/schemas/_common___Field' - precision: - $ref: '#/components/schemas/_common___GeoHashPrecision' - shard_size: - description: |- - Allows for more accurate counting of the top cells returned in the final result the aggregation. - Defaults to returning `max(10,(size x number-of-shards))` buckets from each shard. - type: integer - format: int32 - size: - description: The maximum number of geohash buckets to return. - type: integer - format: int32 + geohash_grid: + $ref: '#/components/schemas/_common.aggregations___GeoHashGridAggregationFields' + required: + - geohash_grid + _common.aggregations___GeoHashGridAggregationFields: + type: object + properties: + bounds: + $ref: '#/components/schemas/_common___GeoBounds' + field: + $ref: '#/components/schemas/_common___Field' + precision: + $ref: '#/components/schemas/_common___GeoHashPrecision' + shard_size: + description: |- + Allows for more accurate counting of the top cells returned in the final result the aggregation. + Defaults to returning `max(10,(size x number-of-shards))` buckets from each shard. + type: integer + format: int32 + size: + description: The maximum number of geohash buckets to return. + type: integer + format: int32 _common.aggregations___GeoHashGridBucket: allOf: - $ref: '#/components/schemas/_common.aggregations___MultiBucketBase' @@ -42954,22 +42911,29 @@ components: - $ref: '#/components/schemas/_common.aggregations___BucketAggregationBase' - type: object properties: - field: - $ref: '#/components/schemas/_common___Field' - precision: - $ref: '#/components/schemas/_common___GeoTilePrecision' - shard_size: - description: |- - Allows for more accurate counting of the top cells returned in the final result the aggregation. - Defaults to returning `max(10,(size x number-of-shards))` buckets from each shard. - type: integer - format: int32 - size: - description: The maximum number of buckets to return. - type: integer - format: int32 - bounds: - $ref: '#/components/schemas/_common___GeoBounds' + geotile_grid: + $ref: '#/components/schemas/_common.aggregations___GeoTileGridAggregationFields' + required: + - geotile_grid + _common.aggregations___GeoTileGridAggregationFields: + type: object + properties: + field: + $ref: '#/components/schemas/_common___Field' + precision: + $ref: '#/components/schemas/_common___GeoTilePrecision' + shard_size: + description: |- + Allows for more accurate counting of the top cells returned in the final result the aggregation. + Defaults to returning `max(10,(size x number-of-shards))` buckets from each shard. + type: integer + format: int32 + size: + description: The maximum number of buckets to return. + type: integer + format: int32 + bounds: + $ref: '#/components/schemas/_common___GeoBounds' _common.aggregations___GeoTileGridBucket: allOf: - $ref: '#/components/schemas/_common.aggregations___MultiBucketBase' @@ -42987,6 +42951,13 @@ components: allOf: - $ref: '#/components/schemas/_common.aggregations___BucketAggregationBase' - type: object + properties: + global: + $ref: '#/components/schemas/_common.aggregations___GlobalAggregationFields' + required: + - global + _common.aggregations___GlobalAggregationFields: + type: object _common.aggregations___GoogleNormalizedDistanceHeuristic: type: object properties: @@ -43017,45 +42988,52 @@ components: - $ref: '#/components/schemas/_common.aggregations___BucketAggregationBase' - type: object properties: - extended_bounds: - $ref: '#/components/schemas/_common.aggregations___ExtendedBoundsDouble' - hard_bounds: - $ref: '#/components/schemas/_common.aggregations___ExtendedBoundsDouble' - field: - $ref: '#/components/schemas/_common___Field' - interval: - description: |- - The interval for the buckets. - Must be a positive decimal. - type: number - format: double - min_doc_count: - description: |- - Only returns buckets that have `min_doc_count` number of documents. - By default, the response will fill gaps in the histogram with empty buckets. - type: integer - format: int32 - missing: - description: |- - The value to apply to documents that do not have a value. - By default, documents without a value are ignored. - type: number - format: double - offset: - description: |- - By default, the bucket keys start with 0 and then continue in even spaced steps of `interval`. - The bucket boundaries can be shifted by using the `offset` option. - type: number - format: double - order: - $ref: '#/components/schemas/_common.aggregations___HistogramOrder' - script: - $ref: '#/components/schemas/_common___Script' - format: - type: string - keyed: - description: If `true`, returns buckets as a hash instead of an array, keyed by the bucket keys. - type: boolean + histogram: + $ref: '#/components/schemas/_common.aggregations___HistogramAggregationFields' + required: + - histogram + _common.aggregations___HistogramAggregationFields: + type: object + properties: + extended_bounds: + $ref: '#/components/schemas/_common.aggregations___ExtendedBoundsDouble' + hard_bounds: + $ref: '#/components/schemas/_common.aggregations___ExtendedBoundsDouble' + field: + $ref: '#/components/schemas/_common___Field' + interval: + description: |- + The interval for the buckets. + Must be a positive decimal. + type: number + format: double + min_doc_count: + description: |- + Only returns buckets that have `min_doc_count` number of documents. + By default, the response will fill gaps in the histogram with empty buckets. + type: integer + format: int32 + missing: + description: |- + The value to apply to documents that do not have a value. + By default, documents without a value are ignored. + type: number + format: double + offset: + description: |- + By default, the bucket keys start with 0 and then continue in even spaced steps of `interval`. + The bucket boundaries can be shifted by using the `offset` option. + type: number + format: double + order: + $ref: '#/components/schemas/_common.aggregations___HistogramOrder' + script: + $ref: '#/components/schemas/_common___Script' + format: + type: string + keyed: + description: If `true`, returns buckets as a hash instead of an array, keyed by the bucket keys. + type: boolean _common.aggregations___HistogramBucket: allOf: - $ref: '#/components/schemas/_common.aggregations___MultiBucketBase' @@ -43148,13 +43126,20 @@ components: - $ref: '#/components/schemas/_common.aggregations___BucketAggregationBase' - type: object properties: - field: - $ref: '#/components/schemas/_common___Field' - ranges: - description: Array of IP ranges. - type: array - items: - $ref: '#/components/schemas/_common.aggregations___IpRangeAggregationRange' + ip_range: + $ref: '#/components/schemas/_common.aggregations___IpRangeAggregationFields' + required: + - ip_range + _common.aggregations___IpRangeAggregationFields: + type: object + properties: + field: + $ref: '#/components/schemas/_common___Field' + ranges: + description: Array of IP ranges. + type: array + items: + $ref: '#/components/schemas/_common.aggregations___IpRangeAggregationRange' _common.aggregations___IpRangeAggregationRange: type: object properties: @@ -43245,34 +43230,30 @@ components: - title: unsigned type: string _common.aggregations___MatrixAggregation: - allOf: - - $ref: '#/components/schemas/_common.aggregations___Aggregation' - - type: object - properties: - fields: - $ref: '#/components/schemas/_common___Fields' - missing: - description: |- - The value to apply to documents that do not have a value. - By default, documents without a value are ignored. - type: object - additionalProperties: - type: number - format: double + type: object + properties: + fields: + $ref: '#/components/schemas/_common___Fields' + missing: + description: |- + The value to apply to documents that do not have a value. + By default, documents without a value are ignored. + type: object + additionalProperties: + type: number + format: double _common.aggregations___MatrixStatsAggregate: - allOf: - - $ref: '#/components/schemas/_common.aggregations___AggregateBase' - - type: object - properties: - doc_count: - type: integer - format: int64 - fields: - type: array - items: - $ref: '#/components/schemas/_common.aggregations___MatrixStatsFields' - required: - - doc_count + type: object + properties: + doc_count: + type: integer + format: int64 + fields: + type: array + items: + $ref: '#/components/schemas/_common.aggregations___MatrixStatsFields' + required: + - doc_count _common.aggregations___MatrixStatsAggregation: allOf: - $ref: '#/components/schemas/_common.aggregations___MatrixAggregation' @@ -43349,7 +43330,6 @@ components: format: double _common.aggregations___MetricAggregationBase: allOf: - - $ref: '#/components/schemas/_common.aggregations___Aggregation' - type: object properties: missing: @@ -43396,10 +43376,17 @@ components: - $ref: '#/components/schemas/_common.aggregations___BucketAggregationBase' - type: object properties: - field: - $ref: '#/components/schemas/_common___Field' missing: - $ref: '#/components/schemas/_common___FieldValue' + $ref: '#/components/schemas/_common.aggregations___MissingAggregationFields' + required: + - missing + _common.aggregations___MissingAggregationFields: + type: object + properties: + field: + $ref: '#/components/schemas/_common___Field' + missing: + $ref: '#/components/schemas/_common___FieldValue' _common.aggregations___MissingOrder: type: string enum: @@ -43465,22 +43452,20 @@ components: keyed: type: boolean _common.aggregations___MultiBucketAggregateBase: - allOf: - - $ref: '#/components/schemas/_common.aggregations___AggregateBase' - - type: object - properties: - buckets: - allOf: - - $ref: '#/components/schemas/_common.aggregations___Buckets' - - oneOf: - - type: object - additionalProperties: - $ref: '#/components/schemas/_common.aggregations___TBucket' - - type: array - items: - $ref: '#/components/schemas/_common.aggregations___TBucket' - required: - - buckets + type: object + properties: + buckets: + allOf: + - $ref: '#/components/schemas/_common.aggregations___Buckets' + - oneOf: + - type: object + additionalProperties: + $ref: '#/components/schemas/_common.aggregations___TBucket' + - type: array + items: + $ref: '#/components/schemas/_common.aggregations___TBucket' + required: + - buckets _common.aggregations___MultiBucketAggregateBaseAdjacencyMatrixBucket: allOf: - $ref: '#/components/schemas/_common.aggregations___MultiBucketAggregateBase' @@ -43704,6 +43689,8 @@ components: doc_count: type: integer format: int64 + additionalProperties: + $ref: '#/components/schemas/_common.aggregations___Aggregate' required: - doc_count _common.aggregations___MultiTermLookup: @@ -43724,38 +43711,45 @@ components: - $ref: '#/components/schemas/_common.aggregations___BucketAggregationBase' - type: object properties: - collect_mode: - $ref: '#/components/schemas/_common.aggregations___TermsAggregationCollectMode' - order: - $ref: '#/components/schemas/_common.aggregations___HistogramOrder' - min_doc_count: - description: The minimum number of documents in a bucket for it to be returned. - type: integer - format: int32 - shard_min_doc_count: - description: The minimum number of documents in a bucket on each shard for it to be returned. - type: integer - format: int32 - shard_size: - description: |- - The number of candidate terms produced by each shard. - By default, `shard_size` will be automatically estimated based on the number of shards and the `size` parameter. - type: integer - format: int32 - show_term_doc_count_error: - description: Calculates the doc count error on per term basis. - type: boolean - size: - description: The number of term buckets should be returned out of the overall terms list. - type: integer - format: int32 - terms: - description: The field from which to generate sets of terms. - type: array - items: - $ref: '#/components/schemas/_common.aggregations___MultiTermLookup' + multi_terms: + $ref: '#/components/schemas/_common.aggregations___MultiTermsAggregationFields' required: - - terms + - multi_terms + _common.aggregations___MultiTermsAggregationFields: + type: object + properties: + collect_mode: + $ref: '#/components/schemas/_common.aggregations___TermsAggregationCollectMode' + order: + $ref: '#/components/schemas/_common.aggregations___HistogramOrder' + min_doc_count: + description: The minimum number of documents in a bucket for it to be returned. + type: integer + format: int32 + shard_min_doc_count: + description: The minimum number of documents in a bucket on each shard for it to be returned. + type: integer + format: int32 + shard_size: + description: |- + The number of candidate terms produced by each shard. + By default, `shard_size` will be automatically estimated based on the number of shards and the `size` parameter. + type: integer + format: int32 + show_term_doc_count_error: + description: Calculates the doc count error on per term basis. + type: boolean + size: + description: The number of term buckets should be returned out of the overall terms list. + type: integer + format: int32 + terms: + description: The field from which to generate sets of terms. + type: array + items: + $ref: '#/components/schemas/_common.aggregations___MultiTermLookup' + required: + - terms _common.aggregations___MultiTermsBucket: allOf: - $ref: '#/components/schemas/_common.aggregations___MultiBucketBase' @@ -43791,8 +43785,15 @@ components: - $ref: '#/components/schemas/_common.aggregations___BucketAggregationBase' - type: object properties: - path: - $ref: '#/components/schemas/_common___Field' + nested: + $ref: '#/components/schemas/_common.aggregations___NestedAggregationFields' + required: + - nested + _common.aggregations___NestedAggregationFields: + type: object + properties: + path: + $ref: '#/components/schemas/_common___Field' _common.aggregations___NormalizeAggregation: allOf: - $ref: '#/components/schemas/_common.aggregations___PipelineAggregationBase' @@ -43818,8 +43819,15 @@ components: - $ref: '#/components/schemas/_common.aggregations___BucketAggregationBase' - type: object properties: - type: - $ref: '#/components/schemas/_common___RelationName' + parent: + $ref: '#/components/schemas/_common.aggregations___ParentAggregationFields' + required: + - parent + _common.aggregations___ParentAggregationFields: + type: object + properties: + type: + $ref: '#/components/schemas/_common___RelationName' _common.aggregations___PercentageScoreHeuristic: type: object _common.aggregations___PercentileRanksAggregation: @@ -43851,14 +43859,12 @@ components: items: $ref: '#/components/schemas/_common.aggregations___ArrayPercentilesItem' _common.aggregations___PercentilesAggregateBase: - allOf: - - $ref: '#/components/schemas/_common.aggregations___AggregateBase' - - type: object - properties: - values: - $ref: '#/components/schemas/_common.aggregations___Percentiles' - required: - - values + type: object + properties: + values: + $ref: '#/components/schemas/_common.aggregations___Percentiles' + required: + - values _common.aggregations___PercentilesAggregation: allOf: - $ref: '#/components/schemas/_common.aggregations___FormatMetricAggregationBase' @@ -43919,26 +43925,33 @@ components: - $ref: '#/components/schemas/_common.aggregations___BucketAggregationBase' - type: object properties: - field: - $ref: '#/components/schemas/_common___Field' - missing: - description: |- - The value to apply to documents that do not have a value. - By default, documents without a value are ignored. - type: integer - format: int32 - ranges: - description: An array of ranges used to bucket documents. - type: array - items: - $ref: '#/components/schemas/_common.aggregations___AggregationRange' - script: - $ref: '#/components/schemas/_common___Script' - keyed: - description: Set to `true` to associate a unique string key with each bucket and return the ranges as a hash rather than an array. - type: boolean - format: - type: string + range: + $ref: '#/components/schemas/_common.aggregations___RangeAggregationFields' + required: + - range + _common.aggregations___RangeAggregationFields: + type: object + properties: + field: + $ref: '#/components/schemas/_common___Field' + missing: + description: |- + The value to apply to documents that do not have a value. + By default, documents without a value are ignored. + type: integer + format: int32 + ranges: + description: An array of ranges used to bucket documents. + type: array + items: + $ref: '#/components/schemas/_common.aggregations___AggregationRange' + script: + $ref: '#/components/schemas/_common___Script' + keyed: + description: Set to `true` to associate a unique string key with each bucket and return the ranges as a hash rather than an array. + type: boolean + format: + type: string _common.aggregations___RangeBucket: allOf: - $ref: '#/components/schemas/_common.aggregations___MultiBucketBase' @@ -43962,38 +43975,43 @@ components: - $ref: '#/components/schemas/_common.aggregations___BucketAggregationBase' - type: object properties: - exclude: - $ref: '#/components/schemas/_common.aggregations___TermsExclude' - field: - $ref: '#/components/schemas/_common___Field' - include: - $ref: '#/components/schemas/_common.aggregations___TermsInclude' - max_doc_count: - description: The maximum number of documents a term should appear in. - type: integer - format: int64 - missing: - $ref: '#/components/schemas/_common___FieldValue' - precision: - description: |- - The precision of the internal CuckooFilters. - Smaller precision leads to better approximation, but higher memory usage. - type: number - format: double - value_type: - type: string - _common.aggregations___RateAggregate: - allOf: - - $ref: '#/components/schemas/_common.aggregations___AggregateBase' - - type: object - properties: - value: - type: number - format: double - value_as_string: - type: string + rare_terms: + $ref: '#/components/schemas/_common.aggregations___RareTermsAggregationFields' required: - - value + - rare_terms + _common.aggregations___RareTermsAggregationFields: + type: object + properties: + exclude: + $ref: '#/components/schemas/_common.aggregations___TermsExclude' + field: + $ref: '#/components/schemas/_common___Field' + include: + $ref: '#/components/schemas/_common.aggregations___TermsInclude' + max_doc_count: + description: The maximum number of documents a term should appear in. + type: integer + format: int64 + missing: + $ref: '#/components/schemas/_common___FieldValue' + precision: + description: |- + The precision of the internal CuckooFilters. + Smaller precision leads to better approximation, but higher memory usage. + type: number + format: double + value_type: + type: string + _common.aggregations___RateAggregate: + type: object + properties: + value: + type: number + format: double + value_as_string: + type: string + required: + - value _common.aggregations___RateAggregation: allOf: - $ref: '#/components/schemas/_common.aggregations___FormatMetricAggregationBase' @@ -44017,8 +44035,15 @@ components: - $ref: '#/components/schemas/_common.aggregations___BucketAggregationBase' - type: object properties: - path: - $ref: '#/components/schemas/_common___Field' + reverse_nested: + $ref: '#/components/schemas/_common.aggregations___ReverseNestedAggregationFields' + required: + - reverse_nested + _common.aggregations___ReverseNestedAggregationFields: + type: object + properties: + path: + $ref: '#/components/schemas/_common___Field' _common.aggregations___SamplerAggregate: allOf: - $ref: '#/components/schemas/_common.aggregations___SingleBucketAggregateBase' @@ -44028,16 +44053,23 @@ components: - $ref: '#/components/schemas/_common.aggregations___BucketAggregationBase' - type: object properties: - shard_size: - description: Limits how many top-scoring documents are collected in the sample processed on each shard. - type: integer - format: int32 + sampler: + $ref: '#/components/schemas/_common.aggregations___SamplerAggregationFields' + required: + - sampler _common.aggregations___SamplerAggregationExecutionHint: type: string enum: - bytes_hash - global_ordinals - map + _common.aggregations___SamplerAggregationFields: + type: object + properties: + shard_size: + description: Limits how many top-scoring documents are collected in the sample processed on each shard. + type: integer + format: int32 _common.aggregations___ScriptedHeuristic: type: object properties: @@ -44046,13 +44078,11 @@ components: required: - script _common.aggregations___ScriptedMetricAggregate: - allOf: - - $ref: '#/components/schemas/_common.aggregations___AggregateBase' - - type: object - properties: - value: {} - required: - - value + type: object + properties: + value: {} + required: + - value _common.aggregations___ScriptedMetricAggregation: allOf: - $ref: '#/components/schemas/_common.aggregations___MetricAggregationBase' @@ -44173,48 +44203,55 @@ components: - $ref: '#/components/schemas/_common.aggregations___BucketAggregationBase' - type: object properties: - background_filter: - $ref: '#/components/schemas/_common.query_dsl___QueryContainer' - chi_square: - $ref: '#/components/schemas/_common.aggregations___ChiSquareHeuristic' - exclude: - $ref: '#/components/schemas/_common.aggregations___TermsExclude' - execution_hint: - $ref: '#/components/schemas/_common.aggregations___TermsAggregationExecutionHint' - field: - $ref: '#/components/schemas/_common___Field' - gnd: - $ref: '#/components/schemas/_common.aggregations___GoogleNormalizedDistanceHeuristic' - include: - $ref: '#/components/schemas/_common.aggregations___TermsInclude' - jlh: - $ref: '#/components/schemas/_common___EmptyObject' - min_doc_count: - description: Only return terms that are found in more than `min_doc_count` hits. - type: integer - format: int64 - mutual_information: - $ref: '#/components/schemas/_common.aggregations___MutualInformationHeuristic' - percentage: - $ref: '#/components/schemas/_common.aggregations___PercentageScoreHeuristic' - script_heuristic: - $ref: '#/components/schemas/_common.aggregations___ScriptedHeuristic' - shard_min_doc_count: - description: |- - Regulates the certainty a shard has if the term should actually be added to the candidate list or not with respect to the `min_doc_count`. - Terms will only be considered if their local shard frequency within the set is higher than the `shard_min_doc_count`. - type: integer - format: int64 - shard_size: - description: |- - Can be used to control the volumes of candidate terms produced by each shard. - By default, `shard_size` will be automatically estimated based on the number of shards and the `size` parameter. - type: integer - format: int32 - size: - description: The number of buckets returned out of the overall terms list. - type: integer - format: int32 + significant_terms: + $ref: '#/components/schemas/_common.aggregations___SignificantTermsAggregationFields' + required: + - significant_terms + _common.aggregations___SignificantTermsAggregationFields: + type: object + properties: + background_filter: + $ref: '#/components/schemas/_common.query_dsl___QueryContainer' + chi_square: + $ref: '#/components/schemas/_common.aggregations___ChiSquareHeuristic' + exclude: + $ref: '#/components/schemas/_common.aggregations___TermsExclude' + execution_hint: + $ref: '#/components/schemas/_common.aggregations___TermsAggregationExecutionHint' + field: + $ref: '#/components/schemas/_common___Field' + gnd: + $ref: '#/components/schemas/_common.aggregations___GoogleNormalizedDistanceHeuristic' + include: + $ref: '#/components/schemas/_common.aggregations___TermsInclude' + jlh: + $ref: '#/components/schemas/_common___EmptyObject' + min_doc_count: + description: Only return terms that are found in more than `min_doc_count` hits. + type: integer + format: int64 + mutual_information: + $ref: '#/components/schemas/_common.aggregations___MutualInformationHeuristic' + percentage: + $ref: '#/components/schemas/_common.aggregations___PercentageScoreHeuristic' + script_heuristic: + $ref: '#/components/schemas/_common.aggregations___ScriptedHeuristic' + shard_min_doc_count: + description: |- + Regulates the certainty a shard has if the term should actually be added to the candidate list or not with respect to the `min_doc_count`. + Terms will only be considered if their local shard frequency within the set is higher than the `shard_min_doc_count`. + type: integer + format: int64 + shard_size: + description: |- + Can be used to control the volumes of candidate terms produced by each shard. + By default, `shard_size` will be automatically estimated based on the number of shards and the `size` parameter. + type: integer + format: int32 + size: + description: The number of buckets returned out of the overall terms list. + type: integer + format: int32 _common.aggregations___SignificantTermsBucketBase: allOf: - $ref: '#/components/schemas/_common.aggregations___MultiBucketBase' @@ -44234,53 +44271,60 @@ components: - $ref: '#/components/schemas/_common.aggregations___BucketAggregationBase' - type: object properties: - background_filter: - $ref: '#/components/schemas/_common.query_dsl___QueryContainer' - chi_square: - $ref: '#/components/schemas/_common.aggregations___ChiSquareHeuristic' - exclude: - $ref: '#/components/schemas/_common.aggregations___TermsExclude' - execution_hint: - $ref: '#/components/schemas/_common.aggregations___TermsAggregationExecutionHint' - field: - $ref: '#/components/schemas/_common___Field' - filter_duplicate_text: - description: Whether to out duplicate text to deal with noisy data. - type: boolean - gnd: - $ref: '#/components/schemas/_common.aggregations___GoogleNormalizedDistanceHeuristic' - include: - $ref: '#/components/schemas/_common.aggregations___TermsInclude' - jlh: - $ref: '#/components/schemas/_common___EmptyObject' - min_doc_count: - description: Only return values that are found in more than `min_doc_count` hits. - type: integer - format: int64 - mutual_information: - $ref: '#/components/schemas/_common.aggregations___MutualInformationHeuristic' - percentage: - $ref: '#/components/schemas/_common.aggregations___PercentageScoreHeuristic' - script_heuristic: - $ref: '#/components/schemas/_common.aggregations___ScriptedHeuristic' - shard_min_doc_count: - description: |- - Regulates the certainty a shard has if the values should actually be added to the candidate list or not with respect to the `min_doc_count`. - Values will only be considered if their local shard frequency within the set is higher than the `shard_min_doc_count`. - type: integer - format: int64 - shard_size: - description: |- - The number of candidate terms produced by each shard. - By default, `shard_size` will be automatically estimated based on the number of shards and the `size` parameter. - type: integer - format: int32 - size: - description: The number of buckets returned out of the overall terms list. - type: integer - format: int32 - source_fields: - $ref: '#/components/schemas/_common___Fields' + significant_text: + $ref: '#/components/schemas/_common.aggregations___SignificantTextAggregationFields' + required: + - significant_text + _common.aggregations___SignificantTextAggregationFields: + type: object + properties: + background_filter: + $ref: '#/components/schemas/_common.query_dsl___QueryContainer' + chi_square: + $ref: '#/components/schemas/_common.aggregations___ChiSquareHeuristic' + exclude: + $ref: '#/components/schemas/_common.aggregations___TermsExclude' + execution_hint: + $ref: '#/components/schemas/_common.aggregations___TermsAggregationExecutionHint' + field: + $ref: '#/components/schemas/_common___Field' + filter_duplicate_text: + description: Whether to out duplicate text to deal with noisy data. + type: boolean + gnd: + $ref: '#/components/schemas/_common.aggregations___GoogleNormalizedDistanceHeuristic' + include: + $ref: '#/components/schemas/_common.aggregations___TermsInclude' + jlh: + $ref: '#/components/schemas/_common___EmptyObject' + min_doc_count: + description: Only return values that are found in more than `min_doc_count` hits. + type: integer + format: int64 + mutual_information: + $ref: '#/components/schemas/_common.aggregations___MutualInformationHeuristic' + percentage: + $ref: '#/components/schemas/_common.aggregations___PercentageScoreHeuristic' + script_heuristic: + $ref: '#/components/schemas/_common.aggregations___ScriptedHeuristic' + shard_min_doc_count: + description: |- + Regulates the certainty a shard has if the values should actually be added to the candidate list or not with respect to the `min_doc_count`. + Values will only be considered if their local shard frequency within the set is higher than the `shard_min_doc_count`. + type: integer + format: int64 + shard_size: + description: |- + The number of candidate terms produced by each shard. + By default, `shard_size` will be automatically estimated based on the number of shards and the `size` parameter. + type: integer + format: int32 + size: + description: The number of buckets returned out of the overall terms list. + type: integer + format: int32 + source_fields: + $ref: '#/components/schemas/_common___Fields' _common.aggregations___SimpleMovingAverageAggregation: allOf: - $ref: '#/components/schemas/_common.aggregations___MovingAverageAggregationBase' @@ -44300,35 +44344,31 @@ components: - $ref: '#/components/schemas/_common.aggregations___SingleMetricAggregateBase' - type: object _common.aggregations___SingleBucketAggregateBase: - allOf: - - $ref: '#/components/schemas/_common.aggregations___AggregateBase' - - type: object - properties: - doc_count: - type: integer - format: int64 - required: - - doc_count - additionalProperties: - title: aggregations - $ref: '#/components/schemas/_common.aggregations___Aggregate' + type: object + properties: + doc_count: + type: integer + format: int64 + required: + - doc_count + additionalProperties: + title: aggregations + $ref: '#/components/schemas/_common.aggregations___Aggregate' _common.aggregations___SingleMetricAggregateBase: - allOf: - - $ref: '#/components/schemas/_common.aggregations___AggregateBase' - - type: object - properties: - value: - description: |- - The metric value. A missing value generally means that there was no data to aggregate, - unless specified otherwise. - oneOf: - - type: number - format: double - - type: 'null' - value_as_string: - type: string - required: - - value + type: object + properties: + value: + description: |- + The metric value. A missing value generally means that there was no data to aggregate, + unless specified otherwise. + oneOf: + - type: number + format: double + - type: 'null' + value_as_string: + type: string + required: + - value _common.aggregations___StandardDeviationBounds: type: object properties: @@ -44397,45 +44437,43 @@ components: - type: object properties: {} _common.aggregations___StatsAggregateBase: - allOf: - - $ref: '#/components/schemas/_common.aggregations___AggregateBase' - - type: object - properties: - count: - type: integer - format: int64 - min: - oneOf: - - type: number - format: double - - type: 'null' - max: - oneOf: - - type: number - format: double - - type: 'null' - avg: - oneOf: - - type: number - format: double - - type: 'null' - sum: - type: number + type: object + properties: + count: + type: integer + format: int64 + min: + oneOf: + - type: number format: double - min_as_string: - type: string - max_as_string: - type: string - avg_as_string: - type: string - sum_as_string: - type: string - required: - - avg - - count - - max - - min - - sum + - type: 'null' + max: + oneOf: + - type: number + format: double + - type: 'null' + avg: + oneOf: + - type: number + format: double + - type: 'null' + sum: + type: number + format: double + min_as_string: + type: string + max_as_string: + type: string + avg_as_string: + type: string + sum_as_string: + type: string + required: + - avg + - count + - max + - min + - sum _common.aggregations___StatsAggregation: allOf: - $ref: '#/components/schemas/_common.aggregations___FormatMetricAggregationBase' @@ -44524,30 +44562,22 @@ components: - type: object properties: buckets: - allOf: - - $ref: '#/components/schemas/_common.aggregations___Buckets' - - oneOf: - - type: object - additionalProperties: - $ref: '#/components/schemas/_common.aggregations___DoubleTermsBucket' - - type: array - items: - $ref: '#/components/schemas/_common.aggregations___DoubleTermsBucket' + type: array + items: + $ref: '#/components/schemas/_common.aggregations___DoubleTermsBucket' + required: + - buckets _common.aggregations___TermsAggregateBaseLongTermsBucket: allOf: - $ref: '#/components/schemas/_common.aggregations___TermsAggregateBase' - type: object properties: buckets: - allOf: - - $ref: '#/components/schemas/_common.aggregations___Buckets' - - oneOf: - - type: object - additionalProperties: - $ref: '#/components/schemas/_common.aggregations___LongTermsBucket' - - type: array - items: - $ref: '#/components/schemas/_common.aggregations___LongTermsBucket' + type: array + items: + $ref: '#/components/schemas/_common.aggregations___LongTermsBucket' + required: + - buckets _common.aggregations___TermsAggregateBaseMultiTermsBucket: allOf: - $ref: '#/components/schemas/_common.aggregations___TermsAggregateBase' @@ -44569,33 +44599,56 @@ components: - type: object properties: buckets: - allOf: - - $ref: '#/components/schemas/_common.aggregations___Buckets' - - oneOf: - - type: object - additionalProperties: - $ref: '#/components/schemas/_common.aggregations___StringTermsBucket' - - type: array - items: - $ref: '#/components/schemas/_common.aggregations___StringTermsBucket' + type: array + items: + $ref: '#/components/schemas/_common.aggregations___StringTermsBucket' + required: + - buckets + _common.aggregations___TermsAggregateBaseUnsignedLongTermsBucket: + allOf: + - $ref: '#/components/schemas/_common.aggregations___TermsAggregateBase' + - type: object + properties: + buckets: + type: array + items: + $ref: '#/components/schemas/_common.aggregations___UnsignedLongTermsBucket' + required: + - buckets _common.aggregations___TermsAggregateBaseVoid: allOf: - $ref: '#/components/schemas/_common.aggregations___TermsAggregateBase' - type: object properties: buckets: - allOf: - - $ref: '#/components/schemas/_common.aggregations___Buckets' - - oneOf: - - type: object - additionalProperties: - $ref: '#/components/schemas/_common___Void' - - type: array - items: - $ref: '#/components/schemas/_common___Void' + type: array + items: + $ref: '#/components/schemas/_common___Void' + required: + - buckets _common.aggregations___TermsAggregation: allOf: - $ref: '#/components/schemas/_common.aggregations___BucketAggregationBase' + - type: object + properties: + terms: + $ref: '#/components/schemas/_common.aggregations___TermsAggregationFields' + required: + - terms + _common.aggregations___TermsAggregationCollectMode: + type: string + enum: + - breadth_first + - depth_first + _common.aggregations___TermsAggregationExecutionHint: + type: string + enum: + - global_ordinals + - global_ordinals_hash + - global_ordinals_low_cardinality + - map + _common.aggregations___TermsAggregationFields: + allOf: - type: object properties: collect_mode: @@ -44645,24 +44698,12 @@ components: properties: script: $ref: '#/components/schemas/_common___Script' - _common.aggregations___TermsAggregationCollectMode: - type: string - enum: - - breadth_first - - depth_first - _common.aggregations___TermsAggregationExecutionHint: - type: string - enum: - - global_ordinals - - global_ordinals_hash - - global_ordinals_low_cardinality - - map _common.aggregations___TermsBucketBase: allOf: - $ref: '#/components/schemas/_common.aggregations___MultiBucketBase' - type: object properties: - doc_count_error: + doc_count_error_upper_bound: type: integer format: int64 description: Upper bound of the document count error. Only present when `show_term_doc_count_error` is true. @@ -44690,11 +44731,11 @@ components: num_partitions: description: The number of partitions. type: integer - format: int64 + format: int32 partition: description: The partition number for this request. type: integer - format: int64 + format: int32 required: - num_partitions - partition @@ -44710,14 +44751,12 @@ components: required: - field _common.aggregations___TopHitsAggregate: - allOf: - - $ref: '#/components/schemas/_common.aggregations___AggregateBase' - - type: object - properties: - hits: - $ref: '#/components/schemas/_core.search___HitsMetadataJsonValue' - required: - - hits + type: object + properties: + hits: + $ref: '#/components/schemas/_core.search___HitsMetadataJsonValue' + required: + - hits _common.aggregations___TopHitsAggregation: allOf: - $ref: '#/components/schemas/_common.aggregations___MetricAggregationBase' @@ -44759,30 +44798,26 @@ components: description: If `true`, returns sequence number and primary term of the last modification of each hit. type: boolean _common.aggregations___TTestAggregate: - allOf: - - $ref: '#/components/schemas/_common.aggregations___AggregateBase' - - type: object - properties: - value: - oneOf: - - type: number - format: double - - type: 'null' - value_as_string: - type: string - required: - - value + type: object + properties: + value: + oneOf: + - type: number + format: double + - type: 'null' + value_as_string: + type: string + required: + - value _common.aggregations___TTestAggregation: - allOf: - - $ref: '#/components/schemas/_common.aggregations___Aggregation' - - type: object - properties: - a: - $ref: '#/components/schemas/_common.aggregations___TestPopulation' - b: - $ref: '#/components/schemas/_common.aggregations___TestPopulation' - type: - $ref: '#/components/schemas/_common.aggregations___TTestType' + type: object + properties: + a: + $ref: '#/components/schemas/_common.aggregations___TestPopulation' + b: + $ref: '#/components/schemas/_common.aggregations___TestPopulation' + type: + $ref: '#/components/schemas/_common.aggregations___TTestType' _common.aggregations___TTestType: type: string enum: @@ -44803,6 +44838,41 @@ components: allOf: - $ref: '#/components/schemas/_common.aggregations___TermsAggregateBaseVoid' - type: object + _common.aggregations___UnsignedLongTermsAggregate: + description: |- + Result of a `terms` aggregation when the field is an `unsigned_long` (64-bit unsigned integer). + OpenSearch stores `unsigned_long` values as Long or BigInteger internally. In JSON responses, + bucket keys are represented as numbers, which may lose precision for values larger than 2^53--1 + due to IEEE 754 double precision limitations. In protocol buffer representations, keys are + manually defined as uint64 to preserve the full 64-bit unsigned range. Use `key_as_string` in + buckets for exact string representation of large unsigned long values. + allOf: + - $ref: '#/components/schemas/_common.aggregations___TermsAggregateBaseUnsignedLongTermsBucket' + - type: object + _common.aggregations___UnsignedLongTermsBucket: + description: |- + Terms bucket for `unsigned_long` field type. The server returns 64-bit unsigned integer values + as Long or BigInteger types. Due to JSON specification limitations (IEEE 754 double precision + provides only 53 bits of integer precision), the key is represented as `type: number` in the + OpenAPI spec. For protocol buffer definitions, this is manually overridden to `uint64` to + preserve the full 64-bit unsigned integer range in binary encoding. + allOf: + - $ref: '#/components/schemas/_common.aggregations___TermsBucketBase' + - type: object + properties: + key: + type: number + description: | + The unsigned 64-bit integer bucket key. While JSON represents this as a number, + values larger than 2^53--1 may lose precision in JSON serialization. The gRPC + protocol buffer definition uses uint64 to preserve full precision. Use `key_as_string` + for exact string representation of large values. + x-protobuf-data-type: uint64 + key_as_string: + type: string + description: String representation of the key. Only present when a custom `format` parameter is specified in the aggregation request. + required: + - key _common.aggregations___ValueCountAggregate: allOf: - $ref: '#/components/schemas/_common.aggregations___SingleMetricAggregateBase' @@ -44822,13 +44892,11 @@ components: - date - double - float - - geo_point - integer - ip - long - number - numeric - - range - short - string - unsigned_long @@ -44882,19 +44950,17 @@ components: - max - min _common.aggregations___WeightedAverageAggregation: - allOf: - - $ref: '#/components/schemas/_common.aggregations___Aggregation' - - type: object - properties: - format: - description: A numeric response formatter. - type: string - value: - $ref: '#/components/schemas/_common.aggregations___WeightedAverageValue' - value_type: - $ref: '#/components/schemas/_common.aggregations___ValueType' - weight: - $ref: '#/components/schemas/_common.aggregations___WeightedAverageValue' + type: object + properties: + format: + description: A numeric response formatter. + type: string + value: + $ref: '#/components/schemas/_common.aggregations___WeightedAverageValue' + value_type: + $ref: '#/components/schemas/_common.aggregations___ValueType' + weight: + $ref: '#/components/schemas/_common.aggregations___WeightedAverageValue' _common.aggregations___WeightedAverageValue: type: object properties: