> 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..2e95ccb5e5 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
@@ -117,6 +117,7 @@ public enum Kind implements JsonEnum {
TdigestPercentileRanks("tdigest_percentile_ranks"),
TdigestPercentiles("tdigest_percentiles"),
TopHits("top_hits"),
+ Ulterms("ulterms"),
Umrareterms("umrareterms"),
Umsigterms("umsigterms"),
Umterms("umterms"),
@@ -1043,6 +1044,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}?
*/
@@ -1743,6 +1760,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;
@@ -1875,6 +1904,7 @@ public Aggregate build() {
deserializers.put("tdigest_percentile_ranks", TDigestPercentileRanksAggregate._DESERIALIZER);
deserializers.put("tdigest_percentiles", TDigestPercentilesAggregate._DESERIALIZER);
deserializers.put("top_hits", TopHitsAggregate._DESERIALIZER);
+ deserializers.put("ulterms", UnsignedLongTermsAggregate._DESERIALIZER);
deserializers.put("umrareterms", UnmappedRareTermsAggregate._DESERIALIZER);
deserializers.put("umsigterms", UnmappedSignificantTermsAggregate._DESERIALIZER);
deserializers.put("umterms", UnmappedTermsAggregate._DESERIALIZER);
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/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/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 implements AggregateVariant, PlainJsonSerializable, ToCopyableBuilder {
+
+ @Nonnull
+ private final Map meta;
+
+ @Nullable
+ private final Double value;
+
+ @Nullable
+ private final String valueAsString;
// ---------------------------------------------------------------------------------------------
private AvgAggregate(Builder builder) {
- super(builder);
+ this.meta = ApiTypeHelper.unmodifiable(builder.meta);
+ this.value = builder.value;
+ this.valueAsString = builder.valueAsString;
}
public static AvgAggregate of(Function> fn) {
@@ -74,6 +91,65 @@ public Aggregate.Kind _aggregateKind() {
return Aggregate.Kind.Avg;
}
+ /**
+ * API name: {@code meta}
+ */
+ @Nonnull
+ public final Map meta() {
+ return this.meta;
+ }
+
+ /**
+ * The metric value. A missing value generally means that there was no data to aggregate, unless specified otherwise.
+ *
+ * API name: {@code value}
+ *
+ */
+ @Nullable
+ public final Double value() {
+ return this.value;
+ }
+
+ /**
+ * API name: {@code value_as_string}
+ */
+ @Nullable
+ 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) {
+ 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.value != null) {
+ generator.writeKey("value");
+ generator.write(this.value);
+ }
+
+ if (this.valueAsString != null) {
+ generator.writeKey("value_as_string");
+ generator.write(this.valueAsString);
+ }
+ }
+
// ---------------------------------------------------------------------------------------------
@Override
@@ -90,18 +166,26 @@ public static Builder builder() {
/**
* Builder for {@link AvgAggregate}.
*/
- public static class Builder extends SingleMetricAggregateBase.AbstractBuilder
- implements
- CopyableBuilder {
+ public static class Builder extends ObjectBuilderBase implements CopyableBuilder {
+ @Nullable
+ private Map meta;
+ @Nullable
+ private Double value;
+ @Nullable
+ private String valueAsString;
public Builder() {}
private Builder(AvgAggregate o) {
- super(o);
+ this.meta = _mapCopy(o.meta);
+ this.value = o.value;
+ this.valueAsString = o.valueAsString;
}
private Builder(Builder o) {
- super(o);
+ this.meta = _mapCopy(o.meta);
+ this.value = o.value;
+ this.valueAsString = o.valueAsString;
}
@Override
@@ -110,9 +194,50 @@ public Builder copy() {
return new Builder(this);
}
- @Override
+ /**
+ * 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;
+ }
+
+ /**
+ * API name: {@code meta}
+ *
+ *
+ * Adds an entry to meta.
+ *
+ */
@Nonnull
- protected Builder self() {
+ public final Builder meta(String key, JsonData value) {
+ this.meta = _mapPut(this.meta, key, value);
+ return this;
+ }
+
+ /**
+ * The metric value. A missing value generally means that there was no data to aggregate, unless specified otherwise.
+ *
+ * API name: {@code value}
+ *
+ */
+ @Nonnull
+ public final Builder value(@Nullable Double value) {
+ this.value = value;
+ return this;
+ }
+
+ /**
+ * API name: {@code value_as_string}
+ */
+ @Nonnull
+ public final Builder valueAsString(@Nullable String value) {
+ this.valueAsString = value;
return this;
}
@@ -141,22 +266,27 @@ public AvgAggregate build() {
);
protected static void setupAvgAggregateDeserializer(ObjectDeserializer op) {
- setupSingleMetricAggregateBaseDeserializer(op);
+ op.add(Builder::meta, JsonpDeserializer.stringMapDeserializer(JsonData._DESERIALIZER), "meta");
+ 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.meta);
+ result = 31 * result + Objects.hashCode(this.value);
+ result = 31 * result + Objects.hashCode(this.valueAsString);
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;
- return true;
+ AvgAggregate other = (AvgAggregate) o;
+ return Objects.equals(this.meta, other.meta)
+ && Objects.equals(this.value, other.value)
+ && Objects.equals(this.valueAsString, other.valueAsString);
}
}
diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/aggregations/BoxplotAggregation.java b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/aggregations/BoxplotAggregation.java
index 66713b7f6e..f5ae456acd 100644
--- a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/aggregations/BoxplotAggregation.java
+++ b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/aggregations/BoxplotAggregation.java
@@ -55,10 +55,7 @@
@JsonpDeserializable
@Generated("org.opensearch.client.codegen.CodeGenerator")
-public class BoxplotAggregation extends MetricAggregationBase
- implements
- AggregationVariant,
- ToCopyableBuilder {
+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/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.
*