diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/NodeRole.java b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/NodeRole.java index c69a9f6ef4..2dae864ad0 100644 --- a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/NodeRole.java +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/NodeRole.java @@ -108,6 +108,12 @@ public enum NodeRole implements JsonEnum { */ RemoteClusterClient("remote_cluster_client"), + /** + * The node can host search replicas (search-only shards). This role must not be combined with any other role on a node. Introduced in + * 3.0; not to be confused with the pre-3.0 search role that was renamed to warm. + */ + Search("search"), + /** * The node can perform transform operations. */ @@ -116,7 +122,12 @@ public enum NodeRole implements JsonEnum { /** * The node can only vote in cluster decisions. */ - VotingOnly("voting_only"); + VotingOnly("voting_only"), + + /** + * The node can hold warm indexes for searchable snapshots. Before 3.0 this role was named search. + */ + Warm("warm"); private final String jsonValue; diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/TimeUnit.java b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/TimeUnit.java index 501d5475c1..04ad51bd75 100644 --- a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/TimeUnit.java +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/TimeUnit.java @@ -44,7 +44,7 @@ /** * Specifies the time units, for example, 5d or 7h. For more information, see - * Supported units. + * Supported units. */ @JsonpDeserializable @Generated("org.opensearch.client.codegen.CodeGenerator") diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/aggregations/AdjacencyMatrixAggregate.java b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/aggregations/AdjacencyMatrixAggregate.java index 98cefdf5a0..60a4e2ddcc 100644 --- a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/aggregations/AdjacencyMatrixAggregate.java +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/aggregations/AdjacencyMatrixAggregate.java @@ -36,30 +36,47 @@ 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.JsonpDeserializable; import org.opensearch.client.json.JsonpDeserializer; +import org.opensearch.client.json.JsonpMapper; import org.opensearch.client.json.ObjectBuilderDeserializer; import org.opensearch.client.json.ObjectDeserializer; +import org.opensearch.client.json.PlainJsonSerializable; +import org.opensearch.client.util.ApiTypeHelper; import org.opensearch.client.util.CopyableBuilder; import org.opensearch.client.util.ObjectBuilder; +import org.opensearch.client.util.ObjectBuilderBase; import org.opensearch.client.util.ToCopyableBuilder; // typedef: _types.aggregations.AdjacencyMatrixAggregate @JsonpDeserializable @Generated("org.opensearch.client.codegen.CodeGenerator") -public class AdjacencyMatrixAggregate extends MultiBucketAggregateBase +public class AdjacencyMatrixAggregate implements AggregateVariant, + PlainJsonSerializable, ToCopyableBuilder { + @Nonnull + private final Buckets buckets; + + @Nonnull + private final Map meta; + // --------------------------------------------------------------------------------------------- private AdjacencyMatrixAggregate(Builder builder) { - super(builder); + this.buckets = ApiTypeHelper.requireNonNull(builder.buckets, this, "buckets"); + this.meta = ApiTypeHelper.unmodifiable(builder.meta); } public static AdjacencyMatrixAggregate of(Function> fn) { @@ -74,6 +91,47 @@ public Aggregate.Kind _aggregateKind() { return Aggregate.Kind.AdjacencyMatrix; } + /** + * Required - API name: {@code buckets} + */ + @Nonnull + public final Buckets buckets() { + return this.buckets; + } + + /** + * API name: {@code meta} + */ + @Nonnull + public final Map meta() { + return this.meta; + } + + /** + * 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) { + generator.writeKey("buckets"); + this.buckets.serialize(generator, mapper); + + if (ApiTypeHelper.isDefined(this.meta)) { + generator.writeKey("meta"); + generator.writeStartObject(); + for (Map.Entry item0 : this.meta.entrySet()) { + generator.writeKey(item0.getKey()); + item0.getValue().serialize(generator, mapper); + } + generator.writeEnd(); + } + } + // --------------------------------------------------------------------------------------------- @Override @@ -90,18 +148,21 @@ public static Builder builder() { /** * Builder for {@link AdjacencyMatrixAggregate}. */ - public static class Builder extends MultiBucketAggregateBase.AbstractBuilder - implements - CopyableBuilder { + public static class Builder extends ObjectBuilderBase implements CopyableBuilder { + private Buckets buckets; + @Nullable + private Map meta; public Builder() {} private Builder(AdjacencyMatrixAggregate o) { - super(o); + this.buckets = o.buckets; + this.meta = _mapCopy(o.meta); } private Builder(Builder o) { - super(o); + this.buckets = o.buckets; + this.meta = _mapCopy(o.meta); } @Override @@ -110,9 +171,46 @@ public Builder copy() { return new Builder(this); } - @Override + /** + * Required - API name: {@code buckets} + */ @Nonnull - protected Builder self() { + public final Builder buckets(Buckets value) { + this.buckets = value; + return this; + } + + /** + * Required - API name: {@code buckets} + */ + @Nonnull + public final Builder buckets(Function, ObjectBuilder>> fn) { + return buckets(fn.apply(new Buckets.Builder()).build()); + } + + /** + * 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 + public final Builder meta(String key, JsonData value) { + this.meta = _mapPut(this.meta, key, value); return this; } @@ -141,22 +239,23 @@ public AdjacencyMatrixAggregate build() { ); protected static void setupAdjacencyMatrixAggregateDeserializer(ObjectDeserializer op) { - setupMultiBucketAggregateBaseDeserializer(op, AdjacencyMatrixBucket._DESERIALIZER); + op.add(Builder::buckets, Buckets.createBucketsDeserializer(AdjacencyMatrixBucket._DESERIALIZER), "buckets"); + op.add(Builder::meta, JsonpDeserializer.stringMapDeserializer(JsonData._DESERIALIZER), "meta"); } @Override public int hashCode() { - int result = super.hashCode(); + int result = 17; + result = 31 * result + this.buckets.hashCode(); + result = 31 * result + Objects.hashCode(this.meta); 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; + AdjacencyMatrixAggregate other = (AdjacencyMatrixAggregate) o; + return this.buckets.equals(other.buckets) && Objects.equals(this.meta, other.meta); } } diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/aggregations/AdjacencyMatrixAggregation.java b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/aggregations/AdjacencyMatrixAggregationFields.java similarity index 77% rename from java-client/src/generated/java/org/opensearch/client/opensearch/_types/aggregations/AdjacencyMatrixAggregation.java rename to java-client/src/generated/java/org/opensearch/client/opensearch/_types/aggregations/AdjacencyMatrixAggregationFields.java index 37b5a21fc4..e8bb861ca2 100644 --- a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/aggregations/AdjacencyMatrixAggregation.java +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/aggregations/AdjacencyMatrixAggregationFields.java @@ -48,45 +48,38 @@ 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.query_dsl.Query; import org.opensearch.client.util.ApiTypeHelper; import org.opensearch.client.util.CopyableBuilder; import org.opensearch.client.util.ObjectBuilder; +import org.opensearch.client.util.ObjectBuilderBase; import org.opensearch.client.util.ToCopyableBuilder; -// typedef: _types.aggregations.AdjacencyMatrixAggregation +// typedef: _types.aggregations.AdjacencyMatrixAggregationFields @JsonpDeserializable @Generated("org.opensearch.client.codegen.CodeGenerator") -public class AdjacencyMatrixAggregation extends BucketAggregationBase +public class AdjacencyMatrixAggregationFields implements - AggregationVariant, - ToCopyableBuilder { + PlainJsonSerializable, + ToCopyableBuilder { @Nonnull private final Map filters; // --------------------------------------------------------------------------------------------- - private AdjacencyMatrixAggregation(Builder builder) { - super(builder); + private AdjacencyMatrixAggregationFields(Builder builder) { this.filters = ApiTypeHelper.unmodifiable(builder.filters); } - public static AdjacencyMatrixAggregation of( - Function> fn + public static AdjacencyMatrixAggregationFields of( + Function> fn ) { return fn.apply(new Builder()).build(); } - /** - * {@link Aggregation} variant kind. - */ - @Override - public Aggregation.Kind _aggregationKind() { - return Aggregation.Kind.AdjacencyMatrix; - } - /** * Filters used to create buckets. At least one filter is required. *

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

@@ -205,49 +197,47 @@ public final Builder filters(String key, Function _DESERIALIZER = ObjectBuilderDeserializer.lazy( + public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer.lazy( Builder::new, - AdjacencyMatrixAggregation::setupAdjacencyMatrixAggregationDeserializer + AdjacencyMatrixAggregationFields::setupAdjacencyMatrixAggregationFieldsDeserializer ); - protected static void setupAdjacencyMatrixAggregationDeserializer(ObjectDeserializer op) { - setupBucketAggregationBaseDeserializer(op); + protected static void setupAdjacencyMatrixAggregationFieldsDeserializer( + ObjectDeserializer op + ) { op.add(Builder::filters, JsonpDeserializer.stringMapDeserializer(Query._DESERIALIZER), "filters"); } @Override public int hashCode() { - int result = super.hashCode(); + int result = 17; result = 31 * result + Objects.hashCode(this.filters); return result; } @Override public boolean equals(Object o) { - if (!super.equals(o)) { - return false; - } if (this == o) return true; if (o == null || this.getClass() != o.getClass()) return false; - AdjacencyMatrixAggregation other = (AdjacencyMatrixAggregation) o; + AdjacencyMatrixAggregationFields other = (AdjacencyMatrixAggregationFields) o; return Objects.equals(this.filters, other.filters); } } diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/aggregations/Aggregate.java b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/aggregations/Aggregate.java index e3b7869072..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. *

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

@@ -316,7 +308,6 @@ public BucketSortAggregation build() { ); protected static void setupBucketSortAggregationDeserializer(ObjectDeserializer op) { - setupAggregationBaseDeserializer(op); op.add(Builder::from, JsonpDeserializer.integerDeserializer(), "from"); op.add(Builder::gapPolicy, GapPolicy._DESERIALIZER, "gap_policy"); op.add(Builder::size, JsonpDeserializer.integerDeserializer(), "size"); @@ -325,7 +316,7 @@ protected static void setupBucketSortAggregationDeserializer(ObjectDeserializer< @Override public int hashCode() { - int result = super.hashCode(); + int result = 17; result = 31 * result + Objects.hashCode(this.from); result = 31 * result + Objects.hashCode(this.gapPolicy); result = 31 * result + Objects.hashCode(this.size); @@ -335,9 +326,6 @@ public int hashCode() { @Override public boolean equals(Object o) { - if (!super.equals(o)) { - return false; - } if (this == o) return true; if (o == null || this.getClass() != o.getClass()) return false; BucketSortAggregation other = (BucketSortAggregation) o; diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/aggregations/CardinalityAggregation.java b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/aggregations/CardinalityAggregation.java index 46adb8cbee..17d19cd1d8 100644 --- a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/aggregations/CardinalityAggregation.java +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/aggregations/CardinalityAggregation.java @@ -57,7 +57,6 @@ @Generated("org.opensearch.client.codegen.CodeGenerator") public class CardinalityAggregation extends MetricAggregationBase implements - AggregationVariant, ToCopyableBuilder { @Nullable @@ -78,14 +77,6 @@ public static CardinalityAggregation of(Function { + PlainJsonSerializable, + ToCopyableBuilder { @Nullable private final String type; // --------------------------------------------------------------------------------------------- - private ParentAggregation(Builder builder) { - super(builder); + private ChildrenAggregationFields(Builder builder) { this.type = builder.type; } - public static ParentAggregation of(Function> fn) { + public static ChildrenAggregationFields of(Function> fn) { return fn.apply(new Builder()).build(); } - /** - * {@link Aggregation} variant kind. - */ - @Override - public Aggregation.Kind _aggregationKind() { - return Aggregation.Kind.Parent; - } - /** * API name: {@code type} */ @@ -90,8 +83,17 @@ public final String type() { return this.type; } + /** + * Serialize this object to JSON. + */ + @Override + public void serialize(JsonGenerator generator, JsonpMapper mapper) { + generator.writeStartObject(); + serializeInternal(generator, mapper); + generator.writeEnd(); + } + protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { - super.serializeInternal(generator, mapper); if (this.type != null) { generator.writeKey("type"); generator.write(this.type); @@ -112,23 +114,19 @@ public static Builder builder() { } /** - * Builder for {@link ParentAggregation}. + * Builder for {@link ChildrenAggregationFields}. */ - public static class Builder extends BucketAggregationBase.AbstractBuilder - implements - CopyableBuilder { + public static class Builder extends ObjectBuilderBase implements CopyableBuilder { @Nullable private String type; public Builder() {} - private Builder(ParentAggregation o) { - super(o); + private Builder(ChildrenAggregationFields o) { this.type = o.type; } private Builder(Builder o) { - super(o); this.type = o.type; } @@ -138,12 +136,6 @@ public Builder copy() { return new Builder(this); } - @Override - @Nonnull - protected Builder self() { - return this; - } - /** * API name: {@code type} */ @@ -154,49 +146,45 @@ public final Builder type(@Nullable String value) { } /** - * Builds a {@link ParentAggregation}. + * Builds a {@link ChildrenAggregationFields}. * * @throws NullPointerException if some of the required fields are null. */ @Override @Nonnull - public ParentAggregation build() { + public ChildrenAggregationFields build() { _checkSingleUse(); - return new ParentAggregation(this); + return new ChildrenAggregationFields(this); } } // --------------------------------------------------------------------------------------------- /** - * Json deserializer for {@link ParentAggregation} + * Json deserializer for {@link ChildrenAggregationFields} */ - public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer.lazy( + public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer.lazy( Builder::new, - ParentAggregation::setupParentAggregationDeserializer + ChildrenAggregationFields::setupChildrenAggregationFieldsDeserializer ); - protected static void setupParentAggregationDeserializer(ObjectDeserializer op) { - setupBucketAggregationBaseDeserializer(op); + protected static void setupChildrenAggregationFieldsDeserializer(ObjectDeserializer op) { op.add(Builder::type, JsonpDeserializer.stringDeserializer(), "type"); } @Override public int hashCode() { - int result = super.hashCode(); + int result = 17; result = 31 * result + Objects.hashCode(this.type); return result; } @Override public boolean equals(Object o) { - if (!super.equals(o)) { - return false; - } if (this == o) return true; if (o == null || this.getClass() != o.getClass()) return false; - ParentAggregation other = (ParentAggregation) o; + ChildrenAggregationFields other = (ChildrenAggregationFields) o; return Objects.equals(this.type, other.type); } } diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/aggregations/CompositeAggregation.java b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/aggregations/CompositeAggregationFields.java similarity index 84% rename from java-client/src/generated/java/org/opensearch/client/opensearch/_types/aggregations/CompositeAggregation.java rename to java-client/src/generated/java/org/opensearch/client/opensearch/_types/aggregations/CompositeAggregationFields.java index 1f1e298db6..4d6386f33f 100644 --- a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/aggregations/CompositeAggregation.java +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/aggregations/CompositeAggregationFields.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.FieldValue; 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.CompositeAggregation +// typedef: _types.aggregations.CompositeAggregationFields @JsonpDeserializable @Generated("org.opensearch.client.codegen.CodeGenerator") -public class CompositeAggregation extends BucketAggregationBase +public class CompositeAggregationFields implements - AggregationVariant, - ToCopyableBuilder { + PlainJsonSerializable, + ToCopyableBuilder { @Nonnull private final Map after; @@ -75,25 +77,18 @@ public class CompositeAggregation extends BucketAggregationBase // --------------------------------------------------------------------------------------------- - private CompositeAggregation(Builder builder) { - super(builder); + private CompositeAggregationFields(Builder builder) { this.after = ApiTypeHelper.unmodifiable(builder.after); this.size = builder.size; this.sources = ApiTypeHelper.unmodifiable(builder.sources); } - public static CompositeAggregation of(Function> fn) { + public static CompositeAggregationFields of( + Function> fn + ) { return fn.apply(new Builder()).build(); } - /** - * {@link Aggregation} variant kind. - */ - @Override - public Aggregation.Kind _aggregationKind() { - return Aggregation.Kind.Composite; - } - /** * API name: {@code after} */ @@ -124,8 +119,17 @@ public final List> sources() { return this.sources; } + /** + * Serialize this object to JSON. + */ + @Override + public void serialize(JsonGenerator generator, JsonpMapper mapper) { + generator.writeStartObject(); + serializeInternal(generator, mapper); + generator.writeEnd(); + } + protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { - super.serializeInternal(generator, mapper); if (ApiTypeHelper.isDefined(this.after)) { generator.writeKey("after"); generator.writeStartObject(); @@ -172,11 +176,9 @@ public static Builder builder() { } /** - * Builder for {@link CompositeAggregation}. + * Builder for {@link CompositeAggregationFields}. */ - public static class Builder extends BucketAggregationBase.AbstractBuilder - implements - CopyableBuilder { + public static class Builder extends ObjectBuilderBase implements CopyableBuilder { @Nullable private Map after; @Nullable @@ -186,15 +188,13 @@ public static class Builder extends BucketAggregationBase.AbstractBuilder value, Map< } /** - * Builds a {@link CompositeAggregation}. + * Builds a {@link CompositeAggregationFields}. * * @throws NullPointerException if some of the required fields are null. */ @Override @Nonnull - public CompositeAggregation build() { + public CompositeAggregationFields build() { _checkSingleUse(); - return new CompositeAggregation(this); + return new CompositeAggregationFields(this); } } // --------------------------------------------------------------------------------------------- /** - * Json deserializer for {@link CompositeAggregation} + * Json deserializer for {@link CompositeAggregationFields} */ - public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer.lazy( + public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer.lazy( Builder::new, - CompositeAggregation::setupCompositeAggregationDeserializer + CompositeAggregationFields::setupCompositeAggregationFieldsDeserializer ); - protected static void setupCompositeAggregationDeserializer(ObjectDeserializer op) { - setupBucketAggregationBaseDeserializer(op); + protected static void setupCompositeAggregationFieldsDeserializer(ObjectDeserializer op) { op.add(Builder::after, JsonpDeserializer.stringMapDeserializer(FieldValue._DESERIALIZER), "after"); op.add(Builder::size, JsonpDeserializer.integerDeserializer(), "size"); op.add( @@ -331,7 +324,7 @@ protected static void setupCompositeAggregationDeserializer(ObjectDeserializer { // --------------------------------------------------------------------------------------------- @@ -68,14 +67,6 @@ public static CumulativeCardinalityAggregation of( return fn.apply(new Builder()).build(); } - /** - * {@link Aggregation} variant kind. - */ - @Override - public Aggregation.Kind _aggregationKind() { - return Aggregation.Kind.CumulativeCardinality; - } - // --------------------------------------------------------------------------------------------- @Override diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/aggregations/CumulativeSumAggregation.java b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/aggregations/CumulativeSumAggregation.java index 194125a50d..bbac1368f2 100644 --- a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/aggregations/CumulativeSumAggregation.java +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/aggregations/CumulativeSumAggregation.java @@ -53,7 +53,6 @@ @Generated("org.opensearch.client.codegen.CodeGenerator") public class CumulativeSumAggregation extends PipelineAggregationBase implements - AggregationVariant, ToCopyableBuilder { // --------------------------------------------------------------------------------------------- @@ -66,14 +65,6 @@ public static CumulativeSumAggregation of(Function +public class DateHistogramAggregate implements AggregateVariant, + PlainJsonSerializable, ToCopyableBuilder { + @Nonnull + private final Buckets buckets; + + @Nonnull + private final Map meta; + // --------------------------------------------------------------------------------------------- private DateHistogramAggregate(Builder builder) { - super(builder); + this.buckets = ApiTypeHelper.requireNonNull(builder.buckets, this, "buckets"); + this.meta = ApiTypeHelper.unmodifiable(builder.meta); } public static DateHistogramAggregate of(Function> fn) { @@ -74,6 +91,47 @@ public Aggregate.Kind _aggregateKind() { return Aggregate.Kind.DateHistogram; } + /** + * Required - API name: {@code buckets} + */ + @Nonnull + public final Buckets buckets() { + return this.buckets; + } + + /** + * API name: {@code meta} + */ + @Nonnull + public final Map meta() { + return this.meta; + } + + /** + * 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) { + generator.writeKey("buckets"); + this.buckets.serialize(generator, mapper); + + if (ApiTypeHelper.isDefined(this.meta)) { + generator.writeKey("meta"); + generator.writeStartObject(); + for (Map.Entry item0 : this.meta.entrySet()) { + generator.writeKey(item0.getKey()); + item0.getValue().serialize(generator, mapper); + } + generator.writeEnd(); + } + } + // --------------------------------------------------------------------------------------------- @Override @@ -90,18 +148,21 @@ public static Builder builder() { /** * Builder for {@link DateHistogramAggregate}. */ - public static class Builder extends MultiBucketAggregateBase.AbstractBuilder - implements - CopyableBuilder { + public static class Builder extends ObjectBuilderBase implements CopyableBuilder { + private Buckets buckets; + @Nullable + private Map meta; public Builder() {} private Builder(DateHistogramAggregate o) { - super(o); + this.buckets = o.buckets; + this.meta = _mapCopy(o.meta); } private Builder(Builder o) { - super(o); + this.buckets = o.buckets; + this.meta = _mapCopy(o.meta); } @Override @@ -110,9 +171,46 @@ public Builder copy() { return new Builder(this); } - @Override + /** + * Required - API name: {@code buckets} + */ @Nonnull - protected Builder self() { + public final Builder buckets(Buckets value) { + this.buckets = value; + return this; + } + + /** + * Required - API name: {@code buckets} + */ + @Nonnull + public final Builder buckets(Function, ObjectBuilder>> fn) { + return buckets(fn.apply(new Buckets.Builder()).build()); + } + + /** + * 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 + public final Builder meta(String key, JsonData value) { + this.meta = _mapPut(this.meta, key, value); return this; } @@ -141,22 +239,23 @@ public DateHistogramAggregate build() { ); protected static void setupDateHistogramAggregateDeserializer(ObjectDeserializer op) { - setupMultiBucketAggregateBaseDeserializer(op, DateHistogramBucket._DESERIALIZER); + op.add(Builder::buckets, Buckets.createBucketsDeserializer(DateHistogramBucket._DESERIALIZER), "buckets"); + op.add(Builder::meta, JsonpDeserializer.stringMapDeserializer(JsonData._DESERIALIZER), "meta"); } @Override public int hashCode() { - int result = super.hashCode(); + int result = 17; + result = 31 * result + this.buckets.hashCode(); + result = 31 * result + Objects.hashCode(this.meta); 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; + DateHistogramAggregate other = (DateHistogramAggregate) o; + return this.buckets.equals(other.buckets) && Objects.equals(this.meta, other.meta); } } diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/aggregations/DateHistogramAggregation.java b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/aggregations/DateHistogramAggregationFields.java similarity index 92% rename from java-client/src/generated/java/org/opensearch/client/opensearch/_types/aggregations/DateHistogramAggregation.java rename to java-client/src/generated/java/org/opensearch/client/opensearch/_types/aggregations/DateHistogramAggregationFields.java index fce8aaa036..2b2ba4363d 100644 --- a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/aggregations/DateHistogramAggregation.java +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/aggregations/DateHistogramAggregationFields.java @@ -49,21 +49,23 @@ import org.opensearch.client.json.JsonpMapper; import org.opensearch.client.json.ObjectBuilderDeserializer; import org.opensearch.client.json.ObjectDeserializer; +import org.opensearch.client.json.PlainJsonSerializable; import org.opensearch.client.opensearch._types.Script; import org.opensearch.client.opensearch._types.Time; 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.DateHistogramAggregation +// typedef: _types.aggregations.DateHistogramAggregationFields @JsonpDeserializable @Generated("org.opensearch.client.codegen.CodeGenerator") -public class DateHistogramAggregation extends BucketAggregationBase +public class DateHistogramAggregationFields implements - AggregationVariant, - ToCopyableBuilder { + PlainJsonSerializable, + ToCopyableBuilder { @Nullable private final CalendarInterval calendarInterval; @@ -112,8 +114,7 @@ public class DateHistogramAggregation extends BucketAggregationBase // --------------------------------------------------------------------------------------------- - private DateHistogramAggregation(Builder builder) { - super(builder); + private DateHistogramAggregationFields(Builder builder) { this.calendarInterval = builder.calendarInterval; this.extendedBounds = builder.extendedBounds; this.field = builder.field; @@ -131,18 +132,12 @@ private DateHistogramAggregation(Builder builder) { this.timeZone = builder.timeZone; } - public static DateHistogramAggregation of(Function> fn) { + public static DateHistogramAggregationFields of( + Function> fn + ) { return fn.apply(new Builder()).build(); } - /** - * {@link Aggregation} variant kind. - */ - @Override - public Aggregation.Kind _aggregationKind() { - return Aggregation.Kind.DateHistogram; - } - /** * API name: {@code calendar_interval} */ @@ -274,8 +269,17 @@ public final String timeZone() { return this.timeZone; } + /** + * Serialize this object to JSON. + */ + @Override + public void serialize(JsonGenerator generator, JsonpMapper mapper) { + generator.writeStartObject(); + serializeInternal(generator, mapper); + generator.writeEnd(); + } + protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { - super.serializeInternal(generator, mapper); if (this.calendarInterval != null) { generator.writeKey("calendar_interval"); this.calendarInterval.serialize(generator, mapper); @@ -371,11 +375,9 @@ public static Builder builder() { } /** - * Builder for {@link DateHistogramAggregation}. + * Builder for {@link DateHistogramAggregationFields}. */ - public static class Builder extends BucketAggregationBase.AbstractBuilder - implements - CopyableBuilder { + public static class Builder extends ObjectBuilderBase implements CopyableBuilder { @Nullable private CalendarInterval calendarInterval; @Nullable @@ -409,8 +411,7 @@ public static class Builder extends BucketAggregationBase.AbstractBuilder _DESERIALIZER = ObjectBuilderDeserializer.lazy( + public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer.lazy( Builder::new, - DateHistogramAggregation::setupDateHistogramAggregationDeserializer + DateHistogramAggregationFields::setupDateHistogramAggregationFieldsDeserializer ); - protected static void setupDateHistogramAggregationDeserializer(ObjectDeserializer op) { - setupBucketAggregationBaseDeserializer(op); + protected static void setupDateHistogramAggregationFieldsDeserializer(ObjectDeserializer op) { op.add(Builder::calendarInterval, CalendarInterval._DESERIALIZER, "calendar_interval"); op.add(Builder::extendedBounds, ExtendedBounds.createExtendedBoundsDeserializer(FieldDateMath._DESERIALIZER), "extended_bounds"); op.add(Builder::field, JsonpDeserializer.stringDeserializer(), "field"); @@ -725,7 +718,7 @@ protected static void setupDateHistogramAggregationDeserializer(ObjectDeserializ @Override public int hashCode() { - int result = super.hashCode(); + int result = 17; result = 31 * result + Objects.hashCode(this.calendarInterval); result = 31 * result + Objects.hashCode(this.extendedBounds); result = 31 * result + Objects.hashCode(this.field); @@ -746,12 +739,9 @@ public int hashCode() { @Override public boolean equals(Object o) { - if (!super.equals(o)) { - return false; - } if (this == o) return true; if (o == null || this.getClass() != o.getClass()) return false; - DateHistogramAggregation other = (DateHistogramAggregation) o; + DateHistogramAggregationFields other = (DateHistogramAggregationFields) o; return Objects.equals(this.calendarInterval, other.calendarInterval) && Objects.equals(this.extendedBounds, other.extendedBounds) && Objects.equals(this.field, other.field) diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/aggregations/DateRangeAggregate.java b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/aggregations/DateRangeAggregate.java index df5ff7ecfc..1c145d6c3e 100644 --- a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/aggregations/DateRangeAggregate.java +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/aggregations/DateRangeAggregate.java @@ -36,30 +36,47 @@ 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.JsonpDeserializable; import org.opensearch.client.json.JsonpDeserializer; +import org.opensearch.client.json.JsonpMapper; import org.opensearch.client.json.ObjectBuilderDeserializer; import org.opensearch.client.json.ObjectDeserializer; +import org.opensearch.client.json.PlainJsonSerializable; +import org.opensearch.client.util.ApiTypeHelper; import org.opensearch.client.util.CopyableBuilder; import org.opensearch.client.util.ObjectBuilder; +import org.opensearch.client.util.ObjectBuilderBase; import org.opensearch.client.util.ToCopyableBuilder; // typedef: _types.aggregations.DateRangeAggregate @JsonpDeserializable @Generated("org.opensearch.client.codegen.CodeGenerator") -public class DateRangeAggregate extends RangeAggregateBase +public class DateRangeAggregate implements AggregateVariant, + PlainJsonSerializable, ToCopyableBuilder { + @Nonnull + private final Buckets buckets; + + @Nonnull + private final Map meta; + // --------------------------------------------------------------------------------------------- private DateRangeAggregate(Builder builder) { - super(builder); + this.buckets = ApiTypeHelper.requireNonNull(builder.buckets, this, "buckets"); + this.meta = ApiTypeHelper.unmodifiable(builder.meta); } public static DateRangeAggregate of(Function> fn) { @@ -74,6 +91,47 @@ public Aggregate.Kind _aggregateKind() { return Aggregate.Kind.DateRange; } + /** + * Required - API name: {@code buckets} + */ + @Nonnull + public final Buckets buckets() { + return this.buckets; + } + + /** + * API name: {@code meta} + */ + @Nonnull + public final Map meta() { + return this.meta; + } + + /** + * 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) { + generator.writeKey("buckets"); + this.buckets.serialize(generator, mapper); + + if (ApiTypeHelper.isDefined(this.meta)) { + generator.writeKey("meta"); + generator.writeStartObject(); + for (Map.Entry item0 : this.meta.entrySet()) { + generator.writeKey(item0.getKey()); + item0.getValue().serialize(generator, mapper); + } + generator.writeEnd(); + } + } + // --------------------------------------------------------------------------------------------- @Override @@ -90,18 +148,21 @@ public static Builder builder() { /** * Builder for {@link DateRangeAggregate}. */ - public static class Builder extends RangeAggregateBase.AbstractBuilder - implements - CopyableBuilder { + public static class Builder extends ObjectBuilderBase implements CopyableBuilder { + private Buckets buckets; + @Nullable + private Map meta; public Builder() {} private Builder(DateRangeAggregate o) { - super(o); + this.buckets = o.buckets; + this.meta = _mapCopy(o.meta); } private Builder(Builder o) { - super(o); + this.buckets = o.buckets; + this.meta = _mapCopy(o.meta); } @Override @@ -110,9 +171,46 @@ public Builder copy() { return new Builder(this); } - @Override + /** + * Required - API name: {@code buckets} + */ @Nonnull - protected Builder self() { + public final Builder buckets(Buckets value) { + this.buckets = value; + return this; + } + + /** + * Required - API name: {@code buckets} + */ + @Nonnull + public final Builder buckets(Function, ObjectBuilder>> fn) { + return buckets(fn.apply(new Buckets.Builder()).build()); + } + + /** + * 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 + public final Builder meta(String key, JsonData value) { + this.meta = _mapPut(this.meta, key, value); return this; } @@ -141,22 +239,23 @@ public DateRangeAggregate build() { ); protected static void setupDateRangeAggregateDeserializer(ObjectDeserializer op) { - setupRangeAggregateBaseDeserializer(op); + op.add(Builder::buckets, Buckets.createBucketsDeserializer(RangeBucket._DESERIALIZER), "buckets"); + op.add(Builder::meta, JsonpDeserializer.stringMapDeserializer(JsonData._DESERIALIZER), "meta"); } @Override public int hashCode() { - int result = super.hashCode(); + int result = 17; + result = 31 * result + this.buckets.hashCode(); + result = 31 * result + Objects.hashCode(this.meta); 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; + DateRangeAggregate other = (DateRangeAggregate) o; + return this.buckets.equals(other.buckets) && Objects.equals(this.meta, other.meta); } } diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/aggregations/DateRangeAggregation.java b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/aggregations/DateRangeAggregationFields.java similarity index 86% rename from java-client/src/generated/java/org/opensearch/client/opensearch/_types/aggregations/DateRangeAggregation.java rename to java-client/src/generated/java/org/opensearch/client/opensearch/_types/aggregations/DateRangeAggregationFields.java index 7e5930a7a5..54fe7bbf52 100644 --- a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/aggregations/DateRangeAggregation.java +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/aggregations/DateRangeAggregationFields.java @@ -48,20 +48,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.FieldValue; 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.DateRangeAggregation +// typedef: _types.aggregations.DateRangeAggregationFields @JsonpDeserializable @Generated("org.opensearch.client.codegen.CodeGenerator") -public class DateRangeAggregation extends BucketAggregationBase +public class DateRangeAggregationFields implements - AggregationVariant, - ToCopyableBuilder { + PlainJsonSerializable, + ToCopyableBuilder { @Nullable private final String field; @@ -83,8 +85,7 @@ public class DateRangeAggregation extends BucketAggregationBase // --------------------------------------------------------------------------------------------- - private DateRangeAggregation(Builder builder) { - super(builder); + private DateRangeAggregationFields(Builder builder) { this.field = builder.field; this.format = builder.format; this.keyed = builder.keyed; @@ -93,18 +94,12 @@ private DateRangeAggregation(Builder builder) { this.timeZone = builder.timeZone; } - public static DateRangeAggregation of(Function> fn) { + public static DateRangeAggregationFields of( + Function> fn + ) { return fn.apply(new Builder()).build(); } - /** - * {@link Aggregation} variant kind. - */ - @Override - public Aggregation.Kind _aggregationKind() { - return Aggregation.Kind.DateRange; - } - /** * API name: {@code field} */ @@ -162,8 +157,17 @@ public final String timeZone() { return this.timeZone; } + /** + * Serialize this object to JSON. + */ + @Override + public void serialize(JsonGenerator generator, JsonpMapper mapper) { + generator.writeStartObject(); + serializeInternal(generator, mapper); + generator.writeEnd(); + } + protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { - super.serializeInternal(generator, mapper); if (this.field != null) { generator.writeKey("field"); generator.write(this.field); @@ -213,11 +217,9 @@ public static Builder builder() { } /** - * Builder for {@link DateRangeAggregation}. + * Builder for {@link DateRangeAggregationFields}. */ - public static class Builder extends BucketAggregationBase.AbstractBuilder - implements - CopyableBuilder { + public static class Builder extends ObjectBuilderBase implements CopyableBuilder { @Nullable private String field; @Nullable @@ -233,8 +235,7 @@ public static class Builder extends BucketAggregationBase.AbstractBuilder _DESERIALIZER = ObjectBuilderDeserializer.lazy( + public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer.lazy( Builder::new, - DateRangeAggregation::setupDateRangeAggregationDeserializer + DateRangeAggregationFields::setupDateRangeAggregationFieldsDeserializer ); - protected static void setupDateRangeAggregationDeserializer(ObjectDeserializer op) { - setupBucketAggregationBaseDeserializer(op); + protected static void setupDateRangeAggregationFieldsDeserializer(ObjectDeserializer op) { op.add(Builder::field, JsonpDeserializer.stringDeserializer(), "field"); op.add(Builder::format, JsonpDeserializer.stringDeserializer(), "format"); op.add(Builder::keyed, JsonpDeserializer.booleanDeserializer(), "keyed"); @@ -407,7 +400,7 @@ protected static void setupDateRangeAggregationDeserializer(ObjectDeserializer { // --------------------------------------------------------------------------------------------- @@ -66,14 +65,6 @@ public static DerivativeAggregation of(Function { + PlainJsonSerializable, + ToCopyableBuilder { @Nullable private final SamplerAggregationExecutionHint executionHint; @@ -78,8 +80,7 @@ public class DiversifiedSamplerAggregation extends BucketAggregationBase // --------------------------------------------------------------------------------------------- - private DiversifiedSamplerAggregation(Builder builder) { - super(builder); + private DiversifiedSamplerAggregationFields(Builder builder) { this.executionHint = builder.executionHint; this.field = builder.field; this.maxDocsPerValue = builder.maxDocsPerValue; @@ -87,20 +88,12 @@ private DiversifiedSamplerAggregation(Builder builder) { this.shardSize = builder.shardSize; } - public static DiversifiedSamplerAggregation of( - Function> fn + public static DiversifiedSamplerAggregationFields of( + Function> fn ) { return fn.apply(new Builder()).build(); } - /** - * {@link Aggregation} variant kind. - */ - @Override - public Aggregation.Kind _aggregationKind() { - return Aggregation.Kind.DiversifiedSampler; - } - /** * API name: {@code execution_hint} */ @@ -147,8 +140,17 @@ public final Integer shardSize() { return this.shardSize; } + /** + * Serialize this object to JSON. + */ + @Override + public void serialize(JsonGenerator generator, JsonpMapper mapper) { + generator.writeStartObject(); + serializeInternal(generator, mapper); + generator.writeEnd(); + } + protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { - super.serializeInternal(generator, mapper); if (this.executionHint != null) { generator.writeKey("execution_hint"); this.executionHint.serialize(generator, mapper); @@ -189,11 +191,9 @@ public static Builder builder() { } /** - * Builder for {@link DiversifiedSamplerAggregation}. + * Builder for {@link DiversifiedSamplerAggregationFields}. */ - public static class Builder extends BucketAggregationBase.AbstractBuilder - implements - CopyableBuilder { + public static class Builder extends ObjectBuilderBase implements CopyableBuilder { @Nullable private SamplerAggregationExecutionHint executionHint; @Nullable @@ -207,8 +207,7 @@ public static class Builder extends BucketAggregationBase.AbstractBuilder _DESERIALIZER = ObjectBuilderDeserializer.lazy( + public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer.lazy( Builder::new, - DiversifiedSamplerAggregation::setupDiversifiedSamplerAggregationDeserializer + DiversifiedSamplerAggregationFields::setupDiversifiedSamplerAggregationFieldsDeserializer ); - protected static void setupDiversifiedSamplerAggregationDeserializer(ObjectDeserializer op) { - setupBucketAggregationBaseDeserializer(op); + protected static void setupDiversifiedSamplerAggregationFieldsDeserializer( + ObjectDeserializer op + ) { op.add(Builder::executionHint, SamplerAggregationExecutionHint._DESERIALIZER, "execution_hint"); op.add(Builder::field, JsonpDeserializer.stringDeserializer(), "field"); op.add(Builder::maxDocsPerValue, JsonpDeserializer.integerDeserializer(), "max_docs_per_value"); @@ -331,7 +324,7 @@ protected static void setupDiversifiedSamplerAggregationDeserializer(ObjectDeser @Override public int hashCode() { - int result = super.hashCode(); + int result = 17; result = 31 * result + Objects.hashCode(this.executionHint); result = 31 * result + Objects.hashCode(this.field); result = 31 * result + Objects.hashCode(this.maxDocsPerValue); @@ -342,12 +335,9 @@ public int hashCode() { @Override public boolean equals(Object o) { - if (!super.equals(o)) { - return false; - } if (this == o) return true; if (o == null || this.getClass() != o.getClass()) return false; - DiversifiedSamplerAggregation other = (DiversifiedSamplerAggregation) o; + DiversifiedSamplerAggregationFields other = (DiversifiedSamplerAggregationFields) o; return Objects.equals(this.executionHint, other.executionHint) && Objects.equals(this.field, other.field) && Objects.equals(this.maxDocsPerValue, other.maxDocsPerValue) diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/aggregations/DoubleTermsAggregate.java b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/aggregations/DoubleTermsAggregate.java index 0462daa062..cb630962bb 100644 --- a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/aggregations/DoubleTermsAggregate.java +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/aggregations/DoubleTermsAggregate.java @@ -39,6 +39,7 @@ import java.util.function.Function; import javax.annotation.Generated; import javax.annotation.Nonnull; +import org.opensearch.client.json.JsonData; import org.opensearch.client.json.JsonpDeserializable; import org.opensearch.client.json.JsonpDeserializer; import org.opensearch.client.json.ObjectBuilderDeserializer; @@ -54,7 +55,7 @@ */ @JsonpDeserializable @Generated("org.opensearch.client.codegen.CodeGenerator") -public class DoubleTermsAggregate extends TermsAggregateBase +public class DoubleTermsAggregate extends TermsAggregateBase implements AggregateVariant, ToCopyableBuilder { @@ -93,7 +94,7 @@ public static Builder builder() { /** * Builder for {@link DoubleTermsAggregate}. */ - public static class Builder extends TermsAggregateBase.AbstractBuilder + public static class Builder extends TermsAggregateBase.AbstractBuilder implements CopyableBuilder { @@ -144,7 +145,7 @@ public DoubleTermsAggregate build() { ); protected static void setupDoubleTermsAggregateDeserializer(ObjectDeserializer op) { - setupTermsAggregateBaseDeserializer(op, DoubleTermsBucket._DESERIALIZER); + setupTermsAggregateBaseDeserializer(op, JsonData._DESERIALIZER); } @Override diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/aggregations/DoubleTermsBucket.java b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/aggregations/DoubleTermsBucket.java deleted file mode 100644 index a789337578..0000000000 --- a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/aggregations/DoubleTermsBucket.java +++ /dev/null @@ -1,217 +0,0 @@ -/* - * SPDX-License-Identifier: Apache-2.0 - * - * The OpenSearch Contributors require contributions made to - * this file be licensed under the Apache-2.0 license or a - * compatible open source license. - */ - -/* - * Licensed to Elasticsearch B.V. under one or more contributor - * license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright - * ownership. Elasticsearch B.V. licenses this file to you under - * the Apache License, Version 2.0 (the "License"); you may - * not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -/* - * Modifications Copyright OpenSearch Contributors. See - * GitHub history for details. - */ - -//---------------------------------------------------- -// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. -//---------------------------------------------------- - -package org.opensearch.client.opensearch._types.aggregations; - -import jakarta.json.stream.JsonGenerator; -import java.util.Objects; -import java.util.function.Function; -import javax.annotation.Generated; -import javax.annotation.Nonnull; -import javax.annotation.Nullable; -import org.opensearch.client.json.JsonpDeserializable; -import org.opensearch.client.json.JsonpDeserializer; -import org.opensearch.client.json.JsonpMapper; -import org.opensearch.client.json.ObjectBuilderDeserializer; -import org.opensearch.client.json.ObjectDeserializer; -import org.opensearch.client.util.ApiTypeHelper; -import org.opensearch.client.util.CopyableBuilder; -import org.opensearch.client.util.ObjectBuilder; -import org.opensearch.client.util.ToCopyableBuilder; - -// typedef: _types.aggregations.DoubleTermsBucket - -@JsonpDeserializable -@Generated("org.opensearch.client.codegen.CodeGenerator") -public class DoubleTermsBucket extends TermsBucketBase implements ToCopyableBuilder { - - private final double key; - - @Nullable - private final String keyAsString; - - // --------------------------------------------------------------------------------------------- - - private DoubleTermsBucket(Builder builder) { - super(builder); - this.key = ApiTypeHelper.requireNonNull(builder.key, this, "key"); - this.keyAsString = builder.keyAsString; - } - - public static DoubleTermsBucket of(Function> fn) { - return fn.apply(new Builder()).build(); - } - - /** - * Required - API name: {@code key} - */ - public final double key() { - return this.key; - } - - /** - * API name: {@code key_as_string} - */ - @Nullable - public final String keyAsString() { - return this.keyAsString; - } - - protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { - super.serializeInternal(generator, mapper); - generator.writeKey("key"); - generator.write(this.key); - - if (this.keyAsString != null) { - generator.writeKey("key_as_string"); - generator.write(this.keyAsString); - } - } - - // --------------------------------------------------------------------------------------------- - - @Override - @Nonnull - public Builder toBuilder() { - return new Builder(this); - } - - @Nonnull - public static Builder builder() { - return new Builder(); - } - - /** - * Builder for {@link DoubleTermsBucket}. - */ - public static class Builder extends TermsBucketBase.AbstractBuilder implements CopyableBuilder { - private Double key; - @Nullable - private String keyAsString; - - public Builder() {} - - private Builder(DoubleTermsBucket o) { - super(o); - this.key = o.key; - this.keyAsString = o.keyAsString; - } - - private Builder(Builder o) { - super(o); - this.key = o.key; - this.keyAsString = o.keyAsString; - } - - @Override - @Nonnull - public Builder copy() { - return new Builder(this); - } - - @Override - @Nonnull - protected Builder self() { - return this; - } - - /** - * Required - API name: {@code key} - */ - @Nonnull - public final Builder key(double value) { - this.key = value; - return this; - } - - /** - * API name: {@code key_as_string} - */ - @Nonnull - public final Builder keyAsString(@Nullable String value) { - this.keyAsString = value; - return this; - } - - /** - * Builds a {@link DoubleTermsBucket}. - * - * @throws NullPointerException if some of the required fields are null. - */ - @Override - @Nonnull - public DoubleTermsBucket build() { - _checkSingleUse(); - - return new DoubleTermsBucket(this); - } - } - - // --------------------------------------------------------------------------------------------- - - /** - * Json deserializer for {@link DoubleTermsBucket} - */ - public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer.lazy( - Builder::new, - DoubleTermsBucket::setupDoubleTermsBucketDeserializer - ); - - protected static void setupDoubleTermsBucketDeserializer(ObjectDeserializer op) { - setupTermsBucketBaseDeserializer(op); - op.add(Builder::key, JsonpDeserializer.doubleDeserializer(), "key"); - op.add(Builder::keyAsString, JsonpDeserializer.stringDeserializer(), "key_as_string"); - } - - @Override - public int hashCode() { - int result = super.hashCode(); - result = 31 * result + Double.hashCode(this.key); - result = 31 * result + Objects.hashCode(this.keyAsString); - return result; - } - - @Override - public boolean equals(Object o) { - if (!super.equals(o)) { - return false; - } - if (this == o) return true; - if (o == null || this.getClass() != o.getClass()) return false; - DoubleTermsBucket other = (DoubleTermsBucket) o; - return this.key == other.key && Objects.equals(this.keyAsString, other.keyAsString); - } -} diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/aggregations/ExtendedStatsAggregation.java b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/aggregations/ExtendedStatsAggregation.java index 4621a6f05d..24e142da7a 100644 --- a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/aggregations/ExtendedStatsAggregation.java +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/aggregations/ExtendedStatsAggregation.java @@ -57,7 +57,6 @@ @Generated("org.opensearch.client.codegen.CodeGenerator") public class ExtendedStatsAggregation extends FormatMetricAggregationBase implements - AggregationVariant, ToCopyableBuilder { @Nullable @@ -74,14 +73,6 @@ public static ExtendedStatsAggregation of(Function diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/aggregations/ExtendedStatsBucketAggregate.java b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/aggregations/ExtendedStatsBucketAggregate.java index 64b8c23e15..d57be40676 100644 --- a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/aggregations/ExtendedStatsBucketAggregate.java +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/aggregations/ExtendedStatsBucketAggregate.java @@ -36,30 +36,133 @@ 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.JsonpDeserializable; import org.opensearch.client.json.JsonpDeserializer; +import org.opensearch.client.json.JsonpMapper; import org.opensearch.client.json.ObjectBuilderDeserializer; import org.opensearch.client.json.ObjectDeserializer; +import org.opensearch.client.json.PlainJsonSerializable; +import org.opensearch.client.util.ApiTypeHelper; import org.opensearch.client.util.CopyableBuilder; import org.opensearch.client.util.ObjectBuilder; +import org.opensearch.client.util.ObjectBuilderBase; import org.opensearch.client.util.ToCopyableBuilder; // typedef: _types.aggregations.ExtendedStatsBucketAggregate @JsonpDeserializable @Generated("org.opensearch.client.codegen.CodeGenerator") -public class ExtendedStatsBucketAggregate extends ExtendedStatsAggregateBase +public class ExtendedStatsBucketAggregate implements AggregateVariant, + PlainJsonSerializable, ToCopyableBuilder { + @Nullable + private final Double avg; + + @Nullable + private final String avgAsString; + + private final long count; + + @Nullable + private final Double max; + + @Nullable + private final String maxAsString; + + @Nonnull + private final Map meta; + + @Nullable + private final Double min; + + @Nullable + private final String minAsString; + + @Nullable + private final Double stdDeviation; + + @Nullable + private final String stdDeviationAsString; + + @Nullable + private final StandardDeviationBounds stdDeviationBounds; + + @Nullable + private final StandardDeviationBoundsAsString stdDeviationBoundsAsString; + + @Nullable + private final Double stdDeviationPopulation; + + @Nullable + private final Double stdDeviationSampling; + + private final double sum; + + @Nullable + private final String sumAsString; + + @Nullable + private final Double sumOfSquares; + + @Nullable + private final String sumOfSquaresAsString; + + @Nullable + private final Double variance; + + @Nullable + private final String varianceAsString; + + @Nullable + private final Double variancePopulation; + + @Nullable + private final String variancePopulationAsString; + + @Nullable + private final Double varianceSampling; + + @Nullable + private final String varianceSamplingAsString; + // --------------------------------------------------------------------------------------------- private ExtendedStatsBucketAggregate(Builder builder) { - super(builder); + this.avg = builder.avg; + this.avgAsString = builder.avgAsString; + this.count = ApiTypeHelper.requireNonNull(builder.count, this, "count"); + this.max = builder.max; + this.maxAsString = builder.maxAsString; + this.meta = ApiTypeHelper.unmodifiable(builder.meta); + this.min = builder.min; + this.minAsString = builder.minAsString; + this.stdDeviation = builder.stdDeviation; + this.stdDeviationAsString = builder.stdDeviationAsString; + this.stdDeviationBounds = builder.stdDeviationBounds; + this.stdDeviationBoundsAsString = builder.stdDeviationBoundsAsString; + this.stdDeviationPopulation = builder.stdDeviationPopulation; + this.stdDeviationSampling = builder.stdDeviationSampling; + this.sum = ApiTypeHelper.requireNonNull(builder.sum, this, "sum"); + this.sumAsString = builder.sumAsString; + this.sumOfSquares = builder.sumOfSquares; + this.sumOfSquaresAsString = builder.sumOfSquaresAsString; + this.variance = builder.variance; + this.varianceAsString = builder.varianceAsString; + this.variancePopulation = builder.variancePopulation; + this.variancePopulationAsString = builder.variancePopulationAsString; + this.varianceSampling = builder.varianceSampling; + this.varianceSamplingAsString = builder.varianceSamplingAsString; } public static ExtendedStatsBucketAggregate of( @@ -76,6 +179,329 @@ public Aggregate.Kind _aggregateKind() { return Aggregate.Kind.ExtendedStatsBucket; } + /** + * API name: {@code avg} + */ + @Nullable + public final Double avg() { + return this.avg; + } + + /** + * API name: {@code avg_as_string} + */ + @Nullable + public final String avgAsString() { + return this.avgAsString; + } + + /** + * Required - API name: {@code count} + */ + public final long count() { + return this.count; + } + + /** + * API name: {@code max} + */ + @Nullable + public final Double max() { + return this.max; + } + + /** + * API name: {@code max_as_string} + */ + @Nullable + public final String maxAsString() { + return this.maxAsString; + } + + /** + * API name: {@code meta} + */ + @Nonnull + public final Map meta() { + return this.meta; + } + + /** + * API name: {@code min} + */ + @Nullable + public final Double min() { + return this.min; + } + + /** + * API name: {@code min_as_string} + */ + @Nullable + public final String minAsString() { + return this.minAsString; + } + + /** + * API name: {@code std_deviation} + */ + @Nullable + public final Double stdDeviation() { + return this.stdDeviation; + } + + /** + * API name: {@code std_deviation_as_string} + */ + @Nullable + public final String stdDeviationAsString() { + return this.stdDeviationAsString; + } + + /** + * API name: {@code std_deviation_bounds} + */ + @Nullable + public final StandardDeviationBounds stdDeviationBounds() { + return this.stdDeviationBounds; + } + + /** + * API name: {@code std_deviation_bounds_as_string} + */ + @Nullable + public final StandardDeviationBoundsAsString stdDeviationBoundsAsString() { + return this.stdDeviationBoundsAsString; + } + + /** + * API name: {@code std_deviation_population} + */ + @Nullable + public final Double stdDeviationPopulation() { + return this.stdDeviationPopulation; + } + + /** + * API name: {@code std_deviation_sampling} + */ + @Nullable + public final Double stdDeviationSampling() { + return this.stdDeviationSampling; + } + + /** + * Required - API name: {@code sum} + */ + public final double sum() { + return this.sum; + } + + /** + * API name: {@code sum_as_string} + */ + @Nullable + public final String sumAsString() { + return this.sumAsString; + } + + /** + * API name: {@code sum_of_squares} + */ + @Nullable + public final Double sumOfSquares() { + return this.sumOfSquares; + } + + /** + * API name: {@code sum_of_squares_as_string} + */ + @Nullable + public final String sumOfSquaresAsString() { + return this.sumOfSquaresAsString; + } + + /** + * API name: {@code variance} + */ + @Nullable + public final Double variance() { + return this.variance; + } + + /** + * API name: {@code variance_as_string} + */ + @Nullable + public final String varianceAsString() { + return this.varianceAsString; + } + + /** + * API name: {@code variance_population} + */ + @Nullable + public final Double variancePopulation() { + return this.variancePopulation; + } + + /** + * API name: {@code variance_population_as_string} + */ + @Nullable + public final String variancePopulationAsString() { + return this.variancePopulationAsString; + } + + /** + * API name: {@code variance_sampling} + */ + @Nullable + public final Double varianceSampling() { + return this.varianceSampling; + } + + /** + * API name: {@code variance_sampling_as_string} + */ + @Nullable + public final String varianceSamplingAsString() { + return this.varianceSamplingAsString; + } + + /** + * Serialize this object to JSON. + */ + @Override + public void serialize(JsonGenerator generator, JsonpMapper mapper) { + generator.writeStartObject(); + serializeInternal(generator, mapper); + generator.writeEnd(); + } + + protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { + if (this.avg != null) { + generator.writeKey("avg"); + generator.write(this.avg); + } + + if (this.avgAsString != null) { + generator.writeKey("avg_as_string"); + generator.write(this.avgAsString); + } + + generator.writeKey("count"); + generator.write(this.count); + + if (this.max != null) { + generator.writeKey("max"); + generator.write(this.max); + } + + if (this.maxAsString != null) { + generator.writeKey("max_as_string"); + generator.write(this.maxAsString); + } + + 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.min != null) { + generator.writeKey("min"); + generator.write(this.min); + } + + if (this.minAsString != null) { + generator.writeKey("min_as_string"); + generator.write(this.minAsString); + } + + if (this.stdDeviation != null) { + generator.writeKey("std_deviation"); + generator.write(this.stdDeviation); + } + + if (this.stdDeviationAsString != null) { + generator.writeKey("std_deviation_as_string"); + generator.write(this.stdDeviationAsString); + } + + if (this.stdDeviationBounds != null) { + generator.writeKey("std_deviation_bounds"); + this.stdDeviationBounds.serialize(generator, mapper); + } + + if (this.stdDeviationBoundsAsString != null) { + generator.writeKey("std_deviation_bounds_as_string"); + this.stdDeviationBoundsAsString.serialize(generator, mapper); + } + + if (this.stdDeviationPopulation != null) { + generator.writeKey("std_deviation_population"); + generator.write(this.stdDeviationPopulation); + } + + if (this.stdDeviationSampling != null) { + generator.writeKey("std_deviation_sampling"); + generator.write(this.stdDeviationSampling); + } + + generator.writeKey("sum"); + generator.write(this.sum); + + if (this.sumAsString != null) { + generator.writeKey("sum_as_string"); + generator.write(this.sumAsString); + } + + if (this.sumOfSquares != null) { + generator.writeKey("sum_of_squares"); + generator.write(this.sumOfSquares); + } + + if (this.sumOfSquaresAsString != null) { + generator.writeKey("sum_of_squares_as_string"); + generator.write(this.sumOfSquaresAsString); + } + + if (this.variance != null) { + generator.writeKey("variance"); + generator.write(this.variance); + } + + if (this.varianceAsString != null) { + generator.writeKey("variance_as_string"); + generator.write(this.varianceAsString); + } + + if (this.variancePopulation != null) { + generator.writeKey("variance_population"); + generator.write(this.variancePopulation); + } + + if (this.variancePopulationAsString != null) { + generator.writeKey("variance_population_as_string"); + generator.write(this.variancePopulationAsString); + } + + if (this.varianceSampling != null) { + generator.writeKey("variance_sampling"); + generator.write(this.varianceSampling); + } + + if (this.varianceSamplingAsString != null) { + generator.writeKey("variance_sampling_as_string"); + generator.write(this.varianceSamplingAsString); + } + } + // --------------------------------------------------------------------------------------------- @Override @@ -92,18 +518,108 @@ public static Builder builder() { /** * Builder for {@link ExtendedStatsBucketAggregate}. */ - public static class Builder extends ExtendedStatsAggregateBase.AbstractBuilder - implements - CopyableBuilder { + public static class Builder extends ObjectBuilderBase implements CopyableBuilder { + @Nullable + private Double avg; + @Nullable + private String avgAsString; + private Long count; + @Nullable + private Double max; + @Nullable + private String maxAsString; + @Nullable + private Map meta; + @Nullable + private Double min; + @Nullable + private String minAsString; + @Nullable + private Double stdDeviation; + @Nullable + private String stdDeviationAsString; + @Nullable + private StandardDeviationBounds stdDeviationBounds; + @Nullable + private StandardDeviationBoundsAsString stdDeviationBoundsAsString; + @Nullable + private Double stdDeviationPopulation; + @Nullable + private Double stdDeviationSampling; + private Double sum; + @Nullable + private String sumAsString; + @Nullable + private Double sumOfSquares; + @Nullable + private String sumOfSquaresAsString; + @Nullable + private Double variance; + @Nullable + private String varianceAsString; + @Nullable + private Double variancePopulation; + @Nullable + private String variancePopulationAsString; + @Nullable + private Double varianceSampling; + @Nullable + private String varianceSamplingAsString; public Builder() {} private Builder(ExtendedStatsBucketAggregate o) { - super(o); + this.avg = o.avg; + this.avgAsString = o.avgAsString; + this.count = o.count; + this.max = o.max; + this.maxAsString = o.maxAsString; + this.meta = _mapCopy(o.meta); + this.min = o.min; + this.minAsString = o.minAsString; + this.stdDeviation = o.stdDeviation; + this.stdDeviationAsString = o.stdDeviationAsString; + this.stdDeviationBounds = o.stdDeviationBounds; + this.stdDeviationBoundsAsString = o.stdDeviationBoundsAsString; + this.stdDeviationPopulation = o.stdDeviationPopulation; + this.stdDeviationSampling = o.stdDeviationSampling; + this.sum = o.sum; + this.sumAsString = o.sumAsString; + this.sumOfSquares = o.sumOfSquares; + this.sumOfSquaresAsString = o.sumOfSquaresAsString; + this.variance = o.variance; + this.varianceAsString = o.varianceAsString; + this.variancePopulation = o.variancePopulation; + this.variancePopulationAsString = o.variancePopulationAsString; + this.varianceSampling = o.varianceSampling; + this.varianceSamplingAsString = o.varianceSamplingAsString; } private Builder(Builder o) { - super(o); + this.avg = o.avg; + this.avgAsString = o.avgAsString; + this.count = o.count; + this.max = o.max; + this.maxAsString = o.maxAsString; + this.meta = _mapCopy(o.meta); + this.min = o.min; + this.minAsString = o.minAsString; + this.stdDeviation = o.stdDeviation; + this.stdDeviationAsString = o.stdDeviationAsString; + this.stdDeviationBounds = o.stdDeviationBounds; + this.stdDeviationBoundsAsString = o.stdDeviationBoundsAsString; + this.stdDeviationPopulation = o.stdDeviationPopulation; + this.stdDeviationSampling = o.stdDeviationSampling; + this.sum = o.sum; + this.sumAsString = o.sumAsString; + this.sumOfSquares = o.sumOfSquares; + this.sumOfSquaresAsString = o.sumOfSquaresAsString; + this.variance = o.variance; + this.varianceAsString = o.varianceAsString; + this.variancePopulation = o.variancePopulation; + this.variancePopulationAsString = o.variancePopulationAsString; + this.varianceSampling = o.varianceSampling; + this.varianceSamplingAsString = o.varianceSamplingAsString; } @Override @@ -112,9 +628,254 @@ public Builder copy() { return new Builder(this); } - @Override + /** + * API name: {@code avg} + */ + @Nonnull + public final Builder avg(@Nullable Double value) { + this.avg = value; + return this; + } + + /** + * API name: {@code avg_as_string} + */ + @Nonnull + public final Builder avgAsString(@Nullable String value) { + this.avgAsString = value; + return this; + } + + /** + * Required - API name: {@code count} + */ + @Nonnull + public final Builder count(long value) { + this.count = value; + return this; + } + + /** + * API name: {@code max} + */ + @Nonnull + public final Builder max(@Nullable Double value) { + this.max = value; + return this; + } + + /** + * API name: {@code max_as_string} + */ + @Nonnull + public final Builder maxAsString(@Nullable String value) { + this.maxAsString = value; + return this; + } + + /** + * 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 + public final Builder meta(String key, JsonData value) { + this.meta = _mapPut(this.meta, key, value); + return this; + } + + /** + * API name: {@code min} + */ + @Nonnull + public final Builder min(@Nullable Double value) { + this.min = value; + return this; + } + + /** + * API name: {@code min_as_string} + */ + @Nonnull + public final Builder minAsString(@Nullable String value) { + this.minAsString = value; + return this; + } + + /** + * API name: {@code std_deviation} + */ @Nonnull - protected Builder self() { + public final Builder stdDeviation(@Nullable Double value) { + this.stdDeviation = value; + return this; + } + + /** + * API name: {@code std_deviation_as_string} + */ + @Nonnull + public final Builder stdDeviationAsString(@Nullable String value) { + this.stdDeviationAsString = value; + return this; + } + + /** + * API name: {@code std_deviation_bounds} + */ + @Nonnull + public final Builder stdDeviationBounds(@Nullable StandardDeviationBounds value) { + this.stdDeviationBounds = value; + return this; + } + + /** + * API name: {@code std_deviation_bounds} + */ + @Nonnull + public final Builder stdDeviationBounds(Function> fn) { + return stdDeviationBounds(fn.apply(new StandardDeviationBounds.Builder()).build()); + } + + /** + * API name: {@code std_deviation_bounds_as_string} + */ + @Nonnull + public final Builder stdDeviationBoundsAsString(@Nullable StandardDeviationBoundsAsString value) { + this.stdDeviationBoundsAsString = value; + return this; + } + + /** + * API name: {@code std_deviation_bounds_as_string} + */ + @Nonnull + public final Builder stdDeviationBoundsAsString( + Function> fn + ) { + return stdDeviationBoundsAsString(fn.apply(new StandardDeviationBoundsAsString.Builder()).build()); + } + + /** + * API name: {@code std_deviation_population} + */ + @Nonnull + public final Builder stdDeviationPopulation(@Nullable Double value) { + this.stdDeviationPopulation = value; + return this; + } + + /** + * API name: {@code std_deviation_sampling} + */ + @Nonnull + public final Builder stdDeviationSampling(@Nullable Double value) { + this.stdDeviationSampling = value; + return this; + } + + /** + * Required - API name: {@code sum} + */ + @Nonnull + public final Builder sum(double value) { + this.sum = value; + return this; + } + + /** + * API name: {@code sum_as_string} + */ + @Nonnull + public final Builder sumAsString(@Nullable String value) { + this.sumAsString = value; + return this; + } + + /** + * API name: {@code sum_of_squares} + */ + @Nonnull + public final Builder sumOfSquares(@Nullable Double value) { + this.sumOfSquares = value; + return this; + } + + /** + * API name: {@code sum_of_squares_as_string} + */ + @Nonnull + public final Builder sumOfSquaresAsString(@Nullable String value) { + this.sumOfSquaresAsString = value; + return this; + } + + /** + * API name: {@code variance} + */ + @Nonnull + public final Builder variance(@Nullable Double value) { + this.variance = value; + return this; + } + + /** + * API name: {@code variance_as_string} + */ + @Nonnull + public final Builder varianceAsString(@Nullable String value) { + this.varianceAsString = value; + return this; + } + + /** + * API name: {@code variance_population} + */ + @Nonnull + public final Builder variancePopulation(@Nullable Double value) { + this.variancePopulation = value; + return this; + } + + /** + * API name: {@code variance_population_as_string} + */ + @Nonnull + public final Builder variancePopulationAsString(@Nullable String value) { + this.variancePopulationAsString = value; + return this; + } + + /** + * API name: {@code variance_sampling} + */ + @Nonnull + public final Builder varianceSampling(@Nullable Double value) { + this.varianceSampling = value; + return this; + } + + /** + * API name: {@code variance_sampling_as_string} + */ + @Nonnull + public final Builder varianceSamplingAsString(@Nullable String value) { + this.varianceSamplingAsString = value; return this; } @@ -143,22 +904,90 @@ public ExtendedStatsBucketAggregate build() { ); protected static void setupExtendedStatsBucketAggregateDeserializer(ObjectDeserializer op) { - setupExtendedStatsAggregateBaseDeserializer(op); + op.add(Builder::avg, JsonpDeserializer.doubleDeserializer(), "avg"); + op.add(Builder::avgAsString, JsonpDeserializer.stringDeserializer(), "avg_as_string"); + op.add(Builder::count, JsonpDeserializer.longDeserializer(), "count"); + op.add(Builder::max, JsonpDeserializer.doubleDeserializer(), "max"); + op.add(Builder::maxAsString, JsonpDeserializer.stringDeserializer(), "max_as_string"); + op.add(Builder::meta, JsonpDeserializer.stringMapDeserializer(JsonData._DESERIALIZER), "meta"); + op.add(Builder::min, JsonpDeserializer.doubleDeserializer(), "min"); + op.add(Builder::minAsString, JsonpDeserializer.stringDeserializer(), "min_as_string"); + op.add(Builder::stdDeviation, JsonpDeserializer.doubleDeserializer(), "std_deviation"); + op.add(Builder::stdDeviationAsString, JsonpDeserializer.stringDeserializer(), "std_deviation_as_string"); + op.add(Builder::stdDeviationBounds, StandardDeviationBounds._DESERIALIZER, "std_deviation_bounds"); + op.add(Builder::stdDeviationBoundsAsString, StandardDeviationBoundsAsString._DESERIALIZER, "std_deviation_bounds_as_string"); + op.add(Builder::stdDeviationPopulation, JsonpDeserializer.doubleDeserializer(), "std_deviation_population"); + op.add(Builder::stdDeviationSampling, JsonpDeserializer.doubleDeserializer(), "std_deviation_sampling"); + op.add(Builder::sum, JsonpDeserializer.doubleDeserializer(), "sum"); + op.add(Builder::sumAsString, JsonpDeserializer.stringDeserializer(), "sum_as_string"); + op.add(Builder::sumOfSquares, JsonpDeserializer.doubleDeserializer(), "sum_of_squares"); + op.add(Builder::sumOfSquaresAsString, JsonpDeserializer.stringDeserializer(), "sum_of_squares_as_string"); + op.add(Builder::variance, JsonpDeserializer.doubleDeserializer(), "variance"); + op.add(Builder::varianceAsString, JsonpDeserializer.stringDeserializer(), "variance_as_string"); + op.add(Builder::variancePopulation, JsonpDeserializer.doubleDeserializer(), "variance_population"); + op.add(Builder::variancePopulationAsString, JsonpDeserializer.stringDeserializer(), "variance_population_as_string"); + op.add(Builder::varianceSampling, JsonpDeserializer.doubleDeserializer(), "variance_sampling"); + op.add(Builder::varianceSamplingAsString, JsonpDeserializer.stringDeserializer(), "variance_sampling_as_string"); } @Override public int hashCode() { - int result = super.hashCode(); + int result = 17; + result = 31 * result + Objects.hashCode(this.avg); + result = 31 * result + Objects.hashCode(this.avgAsString); + result = 31 * result + Long.hashCode(this.count); + result = 31 * result + Objects.hashCode(this.max); + result = 31 * result + Objects.hashCode(this.maxAsString); + result = 31 * result + Objects.hashCode(this.meta); + result = 31 * result + Objects.hashCode(this.min); + result = 31 * result + Objects.hashCode(this.minAsString); + result = 31 * result + Objects.hashCode(this.stdDeviation); + result = 31 * result + Objects.hashCode(this.stdDeviationAsString); + result = 31 * result + Objects.hashCode(this.stdDeviationBounds); + result = 31 * result + Objects.hashCode(this.stdDeviationBoundsAsString); + result = 31 * result + Objects.hashCode(this.stdDeviationPopulation); + result = 31 * result + Objects.hashCode(this.stdDeviationSampling); + result = 31 * result + Double.hashCode(this.sum); + result = 31 * result + Objects.hashCode(this.sumAsString); + result = 31 * result + Objects.hashCode(this.sumOfSquares); + result = 31 * result + Objects.hashCode(this.sumOfSquaresAsString); + result = 31 * result + Objects.hashCode(this.variance); + result = 31 * result + Objects.hashCode(this.varianceAsString); + result = 31 * result + Objects.hashCode(this.variancePopulation); + result = 31 * result + Objects.hashCode(this.variancePopulationAsString); + result = 31 * result + Objects.hashCode(this.varianceSampling); + result = 31 * result + Objects.hashCode(this.varianceSamplingAsString); 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; + ExtendedStatsBucketAggregate other = (ExtendedStatsBucketAggregate) o; + return Objects.equals(this.avg, other.avg) + && Objects.equals(this.avgAsString, other.avgAsString) + && this.count == other.count + && Objects.equals(this.max, other.max) + && Objects.equals(this.maxAsString, other.maxAsString) + && Objects.equals(this.meta, other.meta) + && Objects.equals(this.min, other.min) + && Objects.equals(this.minAsString, other.minAsString) + && Objects.equals(this.stdDeviation, other.stdDeviation) + && Objects.equals(this.stdDeviationAsString, other.stdDeviationAsString) + && Objects.equals(this.stdDeviationBounds, other.stdDeviationBounds) + && Objects.equals(this.stdDeviationBoundsAsString, other.stdDeviationBoundsAsString) + && Objects.equals(this.stdDeviationPopulation, other.stdDeviationPopulation) + && Objects.equals(this.stdDeviationSampling, other.stdDeviationSampling) + && this.sum == other.sum + && Objects.equals(this.sumAsString, other.sumAsString) + && Objects.equals(this.sumOfSquares, other.sumOfSquares) + && Objects.equals(this.sumOfSquaresAsString, other.sumOfSquaresAsString) + && Objects.equals(this.variance, other.variance) + && Objects.equals(this.varianceAsString, other.varianceAsString) + && Objects.equals(this.variancePopulation, other.variancePopulation) + && Objects.equals(this.variancePopulationAsString, other.variancePopulationAsString) + && Objects.equals(this.varianceSampling, other.varianceSampling) + && Objects.equals(this.varianceSamplingAsString, other.varianceSamplingAsString); } } diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/aggregations/ExtendedStatsBucketAggregation.java b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/aggregations/ExtendedStatsBucketAggregation.java index 2b4684b31f..1130c82d2d 100644 --- a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/aggregations/ExtendedStatsBucketAggregation.java +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/aggregations/ExtendedStatsBucketAggregation.java @@ -57,7 +57,6 @@ @Generated("org.opensearch.client.codegen.CodeGenerator") public class ExtendedStatsBucketAggregation extends PipelineAggregationBase implements - AggregationVariant, ToCopyableBuilder { @Nullable @@ -76,14 +75,6 @@ public static ExtendedStatsBucketAggregation of( return fn.apply(new Builder()).build(); } - /** - * {@link Aggregation} variant kind. - */ - @Override - public Aggregation.Kind _aggregationKind() { - return Aggregation.Kind.ExtendedStatsBucket; - } - /** * The number of standard deviations above/below the mean to display. *

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

+ * + *

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

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

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

+ * + *

+ * Adds an entry to template. + *

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

+ */ + @Nonnull + public final Builder wildcard(Function> fn) { + return wildcard(fn.apply(new WildcardQuery.Builder()).build()); + } + + /** + * API name: {@code wrapper} + */ + @Nonnull + public final Builder wrapper(@Nullable WrapperQuery value) { + this.wrapper = value; + return this; + } + + /** + * API name: {@code wrapper} + */ + @Nonnull + public final Builder wrapper(Function> fn) { + return wrapper(fn.apply(new WrapperQuery.Builder()).build()); + } + + /** + * API name: {@code xy_shape} + */ + @Nonnull + public final Builder xyShape(@Nullable XyShapeQuery value) { + this.xyShape = value; + return this; + } + + /** + * API name: {@code xy_shape} + */ + @Nonnull + public final Builder xyShape(Function> fn) { + return xyShape(fn.apply(new XyShapeQuery.Builder()).build()); + } + + /** + * Builds a {@link FilterAggregationFields}. + * + * @throws NullPointerException if some of the required fields are null. + */ + @Override + @Nonnull + public FilterAggregationFields build() { + _checkSingleUse(); + + return new FilterAggregationFields(this); + } + } + + // --------------------------------------------------------------------------------------------- + + /** + * Json deserializer for {@link FilterAggregationFields} + */ + public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer.lazy( + Builder::new, + FilterAggregationFields::setupFilterAggregationFieldsDeserializer + ); + + protected static void setupFilterAggregationFieldsDeserializer(ObjectDeserializer op) { + op.add(Builder::agentic, AgenticQuery._DESERIALIZER, "agentic"); + op.add(Builder::bool, BoolQuery._DESERIALIZER, "bool"); + op.add(Builder::boosting, BoostingQuery._DESERIALIZER, "boosting"); + op.add(Builder::combinedFields, CombinedFieldsQuery._DESERIALIZER, "combined_fields"); + op.add(Builder::common, CommonTermsQuery._DESERIALIZER, "common"); + op.add(Builder::constantScore, ConstantScoreQuery._DESERIALIZER, "constant_score"); + op.add(Builder::disMax, DisMaxQuery._DESERIALIZER, "dis_max"); + op.add(Builder::distanceFeature, DistanceFeatureQuery._DESERIALIZER, "distance_feature"); + op.add(Builder::exists, ExistsQuery._DESERIALIZER, "exists"); + op.add(Builder::fieldMaskingSpan, SpanFieldMaskingQuery._DESERIALIZER, "field_masking_span"); + op.add(Builder::functionScore, FunctionScoreQuery._DESERIALIZER, "function_score"); + op.add(Builder::fuzzy, FuzzyQuery._DESERIALIZER, "fuzzy"); + op.add(Builder::geoBoundingBox, GeoBoundingBoxQuery._DESERIALIZER, "geo_bounding_box"); + op.add(Builder::geoDistance, GeoDistanceQuery._DESERIALIZER, "geo_distance"); + op.add(Builder::geoPolygon, GeoPolygonQuery._DESERIALIZER, "geo_polygon"); + op.add(Builder::geoShape, GeoShapeQuery._DESERIALIZER, "geo_shape"); + op.add(Builder::hasChild, HasChildQuery._DESERIALIZER, "has_child"); + op.add(Builder::hasParent, HasParentQuery._DESERIALIZER, "has_parent"); + op.add(Builder::hybrid, HybridQuery._DESERIALIZER, "hybrid"); + op.add(Builder::ids, IdsQuery._DESERIALIZER, "ids"); + op.add(Builder::intervals, IntervalsQuery._DESERIALIZER, "intervals"); + op.add(Builder::knn, KnnQuery._DESERIALIZER, "knn"); + op.add(Builder::match, MatchQuery._DESERIALIZER, "match"); + op.add(Builder::matchAll, MatchAllQuery._DESERIALIZER, "match_all"); + op.add(Builder::matchBoolPrefix, MatchBoolPrefixQuery._DESERIALIZER, "match_bool_prefix"); + op.add(Builder::matchNone, MatchNoneQuery._DESERIALIZER, "match_none"); + op.add(Builder::matchPhrase, MatchPhraseQuery._DESERIALIZER, "match_phrase"); + op.add(Builder::matchPhrasePrefix, MatchPhrasePrefixQuery._DESERIALIZER, "match_phrase_prefix"); + op.add(Builder::moreLikeThis, MoreLikeThisQuery._DESERIALIZER, "more_like_this"); + op.add(Builder::multiMatch, MultiMatchQuery._DESERIALIZER, "multi_match"); + op.add(Builder::nested, NestedQuery._DESERIALIZER, "nested"); + op.add(Builder::neural, NeuralQuery._DESERIALIZER, "neural"); + op.add(Builder::neuralSparse, NeuralSparseQuery._DESERIALIZER, "neural_sparse"); + op.add(Builder::parentId, ParentIdQuery._DESERIALIZER, "parent_id"); + op.add(Builder::percolate, PercolateQuery._DESERIALIZER, "percolate"); + op.add(Builder::prefix, PrefixQuery._DESERIALIZER, "prefix"); + op.add(Builder::queryString, QueryStringQuery._DESERIALIZER, "query_string"); + op.add(Builder::range, RangeQuery._DESERIALIZER, "range"); + op.add(Builder::rankFeature, RankFeatureQuery._DESERIALIZER, "rank_feature"); + op.add(Builder::regexp, RegexpQuery._DESERIALIZER, "regexp"); + op.add(Builder::script, ScriptQuery._DESERIALIZER, "script"); + op.add(Builder::scriptScore, ScriptScoreQuery._DESERIALIZER, "script_score"); + op.add(Builder::simpleQueryString, SimpleQueryStringQuery._DESERIALIZER, "simple_query_string"); + op.add(Builder::sltr, StoredLtrQuery._DESERIALIZER, "sltr"); + op.add(Builder::spanContaining, SpanContainingQuery._DESERIALIZER, "span_containing"); + op.add(Builder::spanFirst, SpanFirstQuery._DESERIALIZER, "span_first"); + op.add(Builder::spanMulti, SpanMultiTermQuery._DESERIALIZER, "span_multi"); + op.add(Builder::spanNear, SpanNearQuery._DESERIALIZER, "span_near"); + op.add(Builder::spanNot, SpanNotQuery._DESERIALIZER, "span_not"); + op.add(Builder::spanOr, SpanOrQuery._DESERIALIZER, "span_or"); + op.add(Builder::spanTerm, SpanTermQuery._DESERIALIZER, "span_term"); + op.add(Builder::spanWithin, SpanWithinQuery._DESERIALIZER, "span_within"); + op.add(Builder::template, JsonpDeserializer.stringMapDeserializer(JsonData._DESERIALIZER), "template"); + op.add(Builder::term, TermQuery._DESERIALIZER, "term"); + op.add(Builder::terms, TermsQuery._DESERIALIZER, "terms"); + op.add(Builder::termsSet, TermsSetQuery._DESERIALIZER, "terms_set"); + op.add(Builder::type, TypeQuery._DESERIALIZER, "type"); + op.add(Builder::wildcard, WildcardQuery._DESERIALIZER, "wildcard"); + op.add(Builder::wrapper, WrapperQuery._DESERIALIZER, "wrapper"); + op.add(Builder::xyShape, XyShapeQuery._DESERIALIZER, "xy_shape"); + } + + @Override + public int hashCode() { + int result = 17; + result = 31 * result + Objects.hashCode(this.agentic); + result = 31 * result + Objects.hashCode(this.bool); + result = 31 * result + Objects.hashCode(this.boosting); + result = 31 * result + Objects.hashCode(this.combinedFields); + result = 31 * result + Objects.hashCode(this.common); + result = 31 * result + Objects.hashCode(this.constantScore); + result = 31 * result + Objects.hashCode(this.disMax); + result = 31 * result + Objects.hashCode(this.distanceFeature); + result = 31 * result + Objects.hashCode(this.exists); + result = 31 * result + Objects.hashCode(this.fieldMaskingSpan); + result = 31 * result + Objects.hashCode(this.functionScore); + result = 31 * result + Objects.hashCode(this.fuzzy); + result = 31 * result + Objects.hashCode(this.geoBoundingBox); + result = 31 * result + Objects.hashCode(this.geoDistance); + result = 31 * result + Objects.hashCode(this.geoPolygon); + result = 31 * result + Objects.hashCode(this.geoShape); + result = 31 * result + Objects.hashCode(this.hasChild); + result = 31 * result + Objects.hashCode(this.hasParent); + result = 31 * result + Objects.hashCode(this.hybrid); + result = 31 * result + Objects.hashCode(this.ids); + result = 31 * result + Objects.hashCode(this.intervals); + result = 31 * result + Objects.hashCode(this.knn); + result = 31 * result + Objects.hashCode(this.match); + result = 31 * result + Objects.hashCode(this.matchAll); + result = 31 * result + Objects.hashCode(this.matchBoolPrefix); + result = 31 * result + Objects.hashCode(this.matchNone); + result = 31 * result + Objects.hashCode(this.matchPhrase); + result = 31 * result + Objects.hashCode(this.matchPhrasePrefix); + result = 31 * result + Objects.hashCode(this.moreLikeThis); + result = 31 * result + Objects.hashCode(this.multiMatch); + result = 31 * result + Objects.hashCode(this.nested); + result = 31 * result + Objects.hashCode(this.neural); + result = 31 * result + Objects.hashCode(this.neuralSparse); + result = 31 * result + Objects.hashCode(this.parentId); + result = 31 * result + Objects.hashCode(this.percolate); + result = 31 * result + Objects.hashCode(this.prefix); + result = 31 * result + Objects.hashCode(this.queryString); + result = 31 * result + Objects.hashCode(this.range); + result = 31 * result + Objects.hashCode(this.rankFeature); + result = 31 * result + Objects.hashCode(this.regexp); + result = 31 * result + Objects.hashCode(this.script); + result = 31 * result + Objects.hashCode(this.scriptScore); + result = 31 * result + Objects.hashCode(this.simpleQueryString); + result = 31 * result + Objects.hashCode(this.sltr); + result = 31 * result + Objects.hashCode(this.spanContaining); + result = 31 * result + Objects.hashCode(this.spanFirst); + result = 31 * result + Objects.hashCode(this.spanMulti); + result = 31 * result + Objects.hashCode(this.spanNear); + result = 31 * result + Objects.hashCode(this.spanNot); + result = 31 * result + Objects.hashCode(this.spanOr); + result = 31 * result + Objects.hashCode(this.spanTerm); + result = 31 * result + Objects.hashCode(this.spanWithin); + result = 31 * result + Objects.hashCode(this.template); + result = 31 * result + Objects.hashCode(this.term); + result = 31 * result + Objects.hashCode(this.terms); + result = 31 * result + Objects.hashCode(this.termsSet); + result = 31 * result + Objects.hashCode(this.type); + result = 31 * result + Objects.hashCode(this.wildcard); + result = 31 * result + Objects.hashCode(this.wrapper); + result = 31 * result + Objects.hashCode(this.xyShape); + return result; + } + + @Override + public boolean equals(Object o) { + if (this == o) return true; + if (o == null || this.getClass() != o.getClass()) return false; + FilterAggregationFields other = (FilterAggregationFields) o; + return Objects.equals(this.agentic, other.agentic) + && Objects.equals(this.bool, other.bool) + && Objects.equals(this.boosting, other.boosting) + && Objects.equals(this.combinedFields, other.combinedFields) + && Objects.equals(this.common, other.common) + && Objects.equals(this.constantScore, other.constantScore) + && Objects.equals(this.disMax, other.disMax) + && Objects.equals(this.distanceFeature, other.distanceFeature) + && Objects.equals(this.exists, other.exists) + && Objects.equals(this.fieldMaskingSpan, other.fieldMaskingSpan) + && Objects.equals(this.functionScore, other.functionScore) + && Objects.equals(this.fuzzy, other.fuzzy) + && Objects.equals(this.geoBoundingBox, other.geoBoundingBox) + && Objects.equals(this.geoDistance, other.geoDistance) + && Objects.equals(this.geoPolygon, other.geoPolygon) + && Objects.equals(this.geoShape, other.geoShape) + && Objects.equals(this.hasChild, other.hasChild) + && Objects.equals(this.hasParent, other.hasParent) + && Objects.equals(this.hybrid, other.hybrid) + && Objects.equals(this.ids, other.ids) + && Objects.equals(this.intervals, other.intervals) + && Objects.equals(this.knn, other.knn) + && Objects.equals(this.match, other.match) + && Objects.equals(this.matchAll, other.matchAll) + && Objects.equals(this.matchBoolPrefix, other.matchBoolPrefix) + && Objects.equals(this.matchNone, other.matchNone) + && Objects.equals(this.matchPhrase, other.matchPhrase) + && Objects.equals(this.matchPhrasePrefix, other.matchPhrasePrefix) + && Objects.equals(this.moreLikeThis, other.moreLikeThis) + && Objects.equals(this.multiMatch, other.multiMatch) + && Objects.equals(this.nested, other.nested) + && Objects.equals(this.neural, other.neural) + && Objects.equals(this.neuralSparse, other.neuralSparse) + && Objects.equals(this.parentId, other.parentId) + && Objects.equals(this.percolate, other.percolate) + && Objects.equals(this.prefix, other.prefix) + && Objects.equals(this.queryString, other.queryString) + && Objects.equals(this.range, other.range) + && Objects.equals(this.rankFeature, other.rankFeature) + && Objects.equals(this.regexp, other.regexp) + && Objects.equals(this.script, other.script) + && Objects.equals(this.scriptScore, other.scriptScore) + && Objects.equals(this.simpleQueryString, other.simpleQueryString) + && Objects.equals(this.sltr, other.sltr) + && Objects.equals(this.spanContaining, other.spanContaining) + && Objects.equals(this.spanFirst, other.spanFirst) + && Objects.equals(this.spanMulti, other.spanMulti) + && Objects.equals(this.spanNear, other.spanNear) + && Objects.equals(this.spanNot, other.spanNot) + && Objects.equals(this.spanOr, other.spanOr) + && Objects.equals(this.spanTerm, other.spanTerm) + && Objects.equals(this.spanWithin, other.spanWithin) + && Objects.equals(this.template, other.template) + && Objects.equals(this.term, other.term) + && Objects.equals(this.terms, other.terms) + && Objects.equals(this.termsSet, other.termsSet) + && Objects.equals(this.type, other.type) + && Objects.equals(this.wildcard, other.wildcard) + && Objects.equals(this.wrapper, other.wrapper) + && Objects.equals(this.xyShape, other.xyShape); + } +} diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/aggregations/FiltersAggregate.java b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/aggregations/FiltersAggregate.java index c4298744a4..90a5a32676 100644 --- a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/aggregations/FiltersAggregate.java +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/aggregations/FiltersAggregate.java @@ -36,30 +36,47 @@ 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.JsonpDeserializable; import org.opensearch.client.json.JsonpDeserializer; +import org.opensearch.client.json.JsonpMapper; import org.opensearch.client.json.ObjectBuilderDeserializer; import org.opensearch.client.json.ObjectDeserializer; +import org.opensearch.client.json.PlainJsonSerializable; +import org.opensearch.client.util.ApiTypeHelper; import org.opensearch.client.util.CopyableBuilder; import org.opensearch.client.util.ObjectBuilder; +import org.opensearch.client.util.ObjectBuilderBase; import org.opensearch.client.util.ToCopyableBuilder; // typedef: _types.aggregations.FiltersAggregate @JsonpDeserializable @Generated("org.opensearch.client.codegen.CodeGenerator") -public class FiltersAggregate extends MultiBucketAggregateBase +public class FiltersAggregate implements AggregateVariant, + PlainJsonSerializable, ToCopyableBuilder { + @Nonnull + private final Buckets buckets; + + @Nonnull + private final Map meta; + // --------------------------------------------------------------------------------------------- private FiltersAggregate(Builder builder) { - super(builder); + this.buckets = ApiTypeHelper.requireNonNull(builder.buckets, this, "buckets"); + this.meta = ApiTypeHelper.unmodifiable(builder.meta); } public static FiltersAggregate of(Function> fn) { @@ -74,6 +91,47 @@ public Aggregate.Kind _aggregateKind() { return Aggregate.Kind.Filters; } + /** + * Required - API name: {@code buckets} + */ + @Nonnull + public final Buckets buckets() { + return this.buckets; + } + + /** + * API name: {@code meta} + */ + @Nonnull + public final Map meta() { + return this.meta; + } + + /** + * 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) { + generator.writeKey("buckets"); + this.buckets.serialize(generator, mapper); + + if (ApiTypeHelper.isDefined(this.meta)) { + generator.writeKey("meta"); + generator.writeStartObject(); + for (Map.Entry item0 : this.meta.entrySet()) { + generator.writeKey(item0.getKey()); + item0.getValue().serialize(generator, mapper); + } + generator.writeEnd(); + } + } + // --------------------------------------------------------------------------------------------- @Override @@ -90,18 +148,21 @@ public static Builder builder() { /** * Builder for {@link FiltersAggregate}. */ - public static class Builder extends MultiBucketAggregateBase.AbstractBuilder - implements - CopyableBuilder { + public static class Builder extends ObjectBuilderBase implements CopyableBuilder { + private Buckets buckets; + @Nullable + private Map meta; public Builder() {} private Builder(FiltersAggregate o) { - super(o); + this.buckets = o.buckets; + this.meta = _mapCopy(o.meta); } private Builder(Builder o) { - super(o); + this.buckets = o.buckets; + this.meta = _mapCopy(o.meta); } @Override @@ -110,9 +171,46 @@ public Builder copy() { return new Builder(this); } - @Override + /** + * Required - API name: {@code buckets} + */ @Nonnull - protected Builder self() { + public final Builder buckets(Buckets value) { + this.buckets = value; + return this; + } + + /** + * Required - API name: {@code buckets} + */ + @Nonnull + public final Builder buckets(Function, ObjectBuilder>> fn) { + return buckets(fn.apply(new Buckets.Builder()).build()); + } + + /** + * 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 + public final Builder meta(String key, JsonData value) { + this.meta = _mapPut(this.meta, key, value); return this; } @@ -141,22 +239,23 @@ public FiltersAggregate build() { ); protected static void setupFiltersAggregateDeserializer(ObjectDeserializer op) { - setupMultiBucketAggregateBaseDeserializer(op, FiltersBucket._DESERIALIZER); + op.add(Builder::buckets, Buckets.createBucketsDeserializer(FiltersBucket._DESERIALIZER), "buckets"); + op.add(Builder::meta, JsonpDeserializer.stringMapDeserializer(JsonData._DESERIALIZER), "meta"); } @Override public int hashCode() { - int result = super.hashCode(); + int result = 17; + result = 31 * result + this.buckets.hashCode(); + result = 31 * result + Objects.hashCode(this.meta); 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; + FiltersAggregate other = (FiltersAggregate) o; + return this.buckets.equals(other.buckets) && Objects.equals(this.meta, other.meta); } } diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/aggregations/FiltersAggregation.java b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/aggregations/FiltersAggregationFields.java similarity index 83% rename from java-client/src/generated/java/org/opensearch/client/opensearch/_types/aggregations/FiltersAggregation.java rename to java-client/src/generated/java/org/opensearch/client/opensearch/_types/aggregations/FiltersAggregationFields.java index 3e5ad90844..5d9c758413 100644 --- a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/aggregations/FiltersAggregation.java +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/aggregations/FiltersAggregationFields.java @@ -47,19 +47,21 @@ 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.query_dsl.Query; import org.opensearch.client.util.CopyableBuilder; import org.opensearch.client.util.ObjectBuilder; +import org.opensearch.client.util.ObjectBuilderBase; import org.opensearch.client.util.ToCopyableBuilder; -// typedef: _types.aggregations.FiltersAggregation +// typedef: _types.aggregations.FiltersAggregationFields @JsonpDeserializable @Generated("org.opensearch.client.codegen.CodeGenerator") -public class FiltersAggregation extends BucketAggregationBase +public class FiltersAggregationFields implements - AggregationVariant, - ToCopyableBuilder { + PlainJsonSerializable, + ToCopyableBuilder { @Nullable private final Buckets filters; @@ -75,26 +77,17 @@ public class FiltersAggregation extends BucketAggregationBase // --------------------------------------------------------------------------------------------- - private FiltersAggregation(Builder builder) { - super(builder); + private FiltersAggregationFields(Builder builder) { this.filters = builder.filters; this.keyed = builder.keyed; this.otherBucket = builder.otherBucket; this.otherBucketKey = builder.otherBucketKey; } - public static FiltersAggregation of(Function> fn) { + public static FiltersAggregationFields of(Function> fn) { return fn.apply(new Builder()).build(); } - /** - * {@link Aggregation} variant kind. - */ - @Override - public Aggregation.Kind _aggregationKind() { - return Aggregation.Kind.Filters; - } - /** * API name: {@code filters} */ @@ -137,8 +130,17 @@ public final String otherBucketKey() { return this.otherBucketKey; } + /** + * Serialize this object to JSON. + */ + @Override + public void serialize(JsonGenerator generator, JsonpMapper mapper) { + generator.writeStartObject(); + serializeInternal(generator, mapper); + generator.writeEnd(); + } + protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { - super.serializeInternal(generator, mapper); if (this.filters != null) { generator.writeKey("filters"); this.filters.serialize(generator, mapper); @@ -174,11 +176,9 @@ public static Builder builder() { } /** - * Builder for {@link FiltersAggregation}. + * Builder for {@link FiltersAggregationFields}. */ - public static class Builder extends BucketAggregationBase.AbstractBuilder - implements - CopyableBuilder { + public static class Builder extends ObjectBuilderBase implements CopyableBuilder { @Nullable private Buckets filters; @Nullable @@ -190,8 +190,7 @@ public static class Builder extends BucketAggregationBase.AbstractBuilder _DESERIALIZER = ObjectBuilderDeserializer.lazy( + public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer.lazy( Builder::new, - FiltersAggregation::setupFiltersAggregationDeserializer + FiltersAggregationFields::setupFiltersAggregationFieldsDeserializer ); - protected static void setupFiltersAggregationDeserializer(ObjectDeserializer op) { - setupBucketAggregationBaseDeserializer(op); + protected static void setupFiltersAggregationFieldsDeserializer(ObjectDeserializer op) { op.add(Builder::filters, Buckets.createBucketsDeserializer(Query._DESERIALIZER), "filters"); op.add(Builder::keyed, JsonpDeserializer.booleanDeserializer(), "keyed"); op.add(Builder::otherBucket, JsonpDeserializer.booleanDeserializer(), "other_bucket"); @@ -307,7 +298,7 @@ protected static void setupFiltersAggregationDeserializer(ObjectDeserializer { @Nullable @@ -74,14 +73,6 @@ public static GeoBoundsAggregation of(Function diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/aggregations/GeoCentroidAggregation.java b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/aggregations/GeoCentroidAggregation.java index 0e5dcea1e9..fcf5365ad6 100644 --- a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/aggregations/GeoCentroidAggregation.java +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/aggregations/GeoCentroidAggregation.java @@ -58,7 +58,6 @@ @Generated("org.opensearch.client.codegen.CodeGenerator") public class GeoCentroidAggregation extends MetricAggregationBase implements - AggregationVariant, ToCopyableBuilder { @Nullable @@ -79,14 +78,6 @@ public static GeoCentroidAggregation of(Function { + @Nonnull + private final Buckets buckets; + + @Nonnull + private final Map meta; + // --------------------------------------------------------------------------------------------- private GeoDistanceAggregate(Builder builder) { - super(builder); + this.buckets = ApiTypeHelper.requireNonNull(builder.buckets, this, "buckets"); + this.meta = ApiTypeHelper.unmodifiable(builder.meta); } public static GeoDistanceAggregate of(Function> fn) { @@ -74,6 +91,47 @@ public Aggregate.Kind _aggregateKind() { return Aggregate.Kind.GeoDistance; } + /** + * Required - API name: {@code buckets} + */ + @Nonnull + public final Buckets buckets() { + return this.buckets; + } + + /** + * API name: {@code meta} + */ + @Nonnull + public final Map meta() { + return this.meta; + } + + /** + * 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) { + generator.writeKey("buckets"); + this.buckets.serialize(generator, mapper); + + if (ApiTypeHelper.isDefined(this.meta)) { + generator.writeKey("meta"); + generator.writeStartObject(); + for (Map.Entry item0 : this.meta.entrySet()) { + generator.writeKey(item0.getKey()); + item0.getValue().serialize(generator, mapper); + } + generator.writeEnd(); + } + } + // --------------------------------------------------------------------------------------------- @Override @@ -90,18 +148,21 @@ public static Builder builder() { /** * Builder for {@link GeoDistanceAggregate}. */ - public static class Builder extends RangeAggregateBase.AbstractBuilder - implements - CopyableBuilder { + public static class Builder extends ObjectBuilderBase implements CopyableBuilder { + private Buckets buckets; + @Nullable + private Map meta; public Builder() {} private Builder(GeoDistanceAggregate o) { - super(o); + this.buckets = o.buckets; + this.meta = _mapCopy(o.meta); } private Builder(Builder o) { - super(o); + this.buckets = o.buckets; + this.meta = _mapCopy(o.meta); } @Override @@ -110,9 +171,46 @@ public Builder copy() { return new Builder(this); } - @Override + /** + * Required - API name: {@code buckets} + */ @Nonnull - protected Builder self() { + public final Builder buckets(Buckets value) { + this.buckets = value; + return this; + } + + /** + * Required - API name: {@code buckets} + */ + @Nonnull + public final Builder buckets(Function, ObjectBuilder>> fn) { + return buckets(fn.apply(new Buckets.Builder()).build()); + } + + /** + * 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 + public final Builder meta(String key, JsonData value) { + this.meta = _mapPut(this.meta, key, value); return this; } @@ -141,22 +239,23 @@ public GeoDistanceAggregate build() { ); protected static void setupGeoDistanceAggregateDeserializer(ObjectDeserializer op) { - setupRangeAggregateBaseDeserializer(op); + op.add(Builder::buckets, Buckets.createBucketsDeserializer(RangeBucket._DESERIALIZER), "buckets"); + op.add(Builder::meta, JsonpDeserializer.stringMapDeserializer(JsonData._DESERIALIZER), "meta"); } @Override public int hashCode() { - int result = super.hashCode(); + int result = 17; + result = 31 * result + this.buckets.hashCode(); + result = 31 * result + Objects.hashCode(this.meta); 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; + GeoDistanceAggregate other = (GeoDistanceAggregate) o; + return this.buckets.equals(other.buckets) && Objects.equals(this.meta, other.meta); } } diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/aggregations/GeoDistanceAggregation.java b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/aggregations/GeoDistanceAggregationFields.java similarity index 85% rename from java-client/src/generated/java/org/opensearch/client/opensearch/_types/aggregations/GeoDistanceAggregation.java rename to java-client/src/generated/java/org/opensearch/client/opensearch/_types/aggregations/GeoDistanceAggregationFields.java index 3ce6aca478..0c01062f18 100644 --- a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/aggregations/GeoDistanceAggregation.java +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/aggregations/GeoDistanceAggregationFields.java @@ -48,22 +48,24 @@ import org.opensearch.client.json.JsonpMapper; import org.opensearch.client.json.ObjectBuilderDeserializer; import org.opensearch.client.json.ObjectDeserializer; +import org.opensearch.client.json.PlainJsonSerializable; import org.opensearch.client.opensearch._types.DistanceUnit; import org.opensearch.client.opensearch._types.GeoDistanceType; import org.opensearch.client.opensearch._types.GeoLocation; import org.opensearch.client.util.ApiTypeHelper; import org.opensearch.client.util.CopyableBuilder; import org.opensearch.client.util.ObjectBuilder; +import org.opensearch.client.util.ObjectBuilderBase; import org.opensearch.client.util.ToCopyableBuilder; -// typedef: _types.aggregations.GeoDistanceAggregation +// typedef: _types.aggregations.GeoDistanceAggregationFields @JsonpDeserializable @Generated("org.opensearch.client.codegen.CodeGenerator") -public class GeoDistanceAggregation extends BucketAggregationBase +public class GeoDistanceAggregationFields implements - AggregationVariant, - ToCopyableBuilder { + PlainJsonSerializable, + ToCopyableBuilder { @Nullable private final GeoDistanceType distanceType; @@ -82,8 +84,7 @@ public class GeoDistanceAggregation extends BucketAggregationBase // --------------------------------------------------------------------------------------------- - private GeoDistanceAggregation(Builder builder) { - super(builder); + private GeoDistanceAggregationFields(Builder builder) { this.distanceType = builder.distanceType; this.field = builder.field; this.origin = builder.origin; @@ -91,18 +92,12 @@ private GeoDistanceAggregation(Builder builder) { this.unit = builder.unit; } - public static GeoDistanceAggregation of(Function> fn) { + public static GeoDistanceAggregationFields of( + Function> fn + ) { return fn.apply(new Builder()).build(); } - /** - * {@link Aggregation} variant kind. - */ - @Override - public Aggregation.Kind _aggregationKind() { - return Aggregation.Kind.GeoDistance; - } - /** * API name: {@code distance_type} */ @@ -146,8 +141,17 @@ public final DistanceUnit unit() { return this.unit; } + /** + * Serialize this object to JSON. + */ + @Override + public void serialize(JsonGenerator generator, JsonpMapper mapper) { + generator.writeStartObject(); + serializeInternal(generator, mapper); + generator.writeEnd(); + } + protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { - super.serializeInternal(generator, mapper); if (this.distanceType != null) { generator.writeKey("distance_type"); this.distanceType.serialize(generator, mapper); @@ -192,11 +196,9 @@ public static Builder builder() { } /** - * Builder for {@link GeoDistanceAggregation}. + * Builder for {@link GeoDistanceAggregationFields}. */ - public static class Builder extends BucketAggregationBase.AbstractBuilder - implements - CopyableBuilder { + public static class Builder extends ObjectBuilderBase implements CopyableBuilder { @Nullable private GeoDistanceType distanceType; @Nullable @@ -210,8 +212,7 @@ public static class Builder extends BucketAggregationBase.AbstractBuilder _DESERIALIZER = ObjectBuilderDeserializer.lazy( + public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer.lazy( Builder::new, - GeoDistanceAggregation::setupGeoDistanceAggregationDeserializer + GeoDistanceAggregationFields::setupGeoDistanceAggregationFieldsDeserializer ); - protected static void setupGeoDistanceAggregationDeserializer(ObjectDeserializer op) { - setupBucketAggregationBaseDeserializer(op); + protected static void setupGeoDistanceAggregationFieldsDeserializer(ObjectDeserializer op) { op.add(Builder::distanceType, GeoDistanceType._DESERIALIZER, "distance_type"); op.add(Builder::field, JsonpDeserializer.stringDeserializer(), "field"); op.add(Builder::origin, GeoLocation._DESERIALIZER, "origin"); @@ -366,7 +359,7 @@ protected static void setupGeoDistanceAggregationDeserializer(ObjectDeserializer @Override public int hashCode() { - int result = super.hashCode(); + int result = 17; result = 31 * result + Objects.hashCode(this.distanceType); result = 31 * result + Objects.hashCode(this.field); result = 31 * result + Objects.hashCode(this.origin); @@ -377,12 +370,9 @@ public int hashCode() { @Override public boolean equals(Object o) { - if (!super.equals(o)) { - return false; - } if (this == o) return true; if (o == null || this.getClass() != o.getClass()) return false; - GeoDistanceAggregation other = (GeoDistanceAggregation) o; + GeoDistanceAggregationFields other = (GeoDistanceAggregationFields) o; return Objects.equals(this.distanceType, other.distanceType) && Objects.equals(this.field, other.field) && Objects.equals(this.origin, other.origin) diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/aggregations/GeoHashGridAggregate.java b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/aggregations/GeoHashGridAggregate.java index 6ffe9c02c4..b5ef22641e 100644 --- a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/aggregations/GeoHashGridAggregate.java +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/aggregations/GeoHashGridAggregate.java @@ -36,30 +36,47 @@ 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.JsonpDeserializable; import org.opensearch.client.json.JsonpDeserializer; +import org.opensearch.client.json.JsonpMapper; import org.opensearch.client.json.ObjectBuilderDeserializer; import org.opensearch.client.json.ObjectDeserializer; +import org.opensearch.client.json.PlainJsonSerializable; +import org.opensearch.client.util.ApiTypeHelper; import org.opensearch.client.util.CopyableBuilder; import org.opensearch.client.util.ObjectBuilder; +import org.opensearch.client.util.ObjectBuilderBase; import org.opensearch.client.util.ToCopyableBuilder; // typedef: _types.aggregations.GeoHashGridAggregate @JsonpDeserializable @Generated("org.opensearch.client.codegen.CodeGenerator") -public class GeoHashGridAggregate extends MultiBucketAggregateBase +public class GeoHashGridAggregate implements AggregateVariant, + PlainJsonSerializable, ToCopyableBuilder { + @Nonnull + private final Buckets buckets; + + @Nonnull + private final Map meta; + // --------------------------------------------------------------------------------------------- private GeoHashGridAggregate(Builder builder) { - super(builder); + this.buckets = ApiTypeHelper.requireNonNull(builder.buckets, this, "buckets"); + this.meta = ApiTypeHelper.unmodifiable(builder.meta); } public static GeoHashGridAggregate of(Function> fn) { @@ -74,6 +91,47 @@ public Aggregate.Kind _aggregateKind() { return Aggregate.Kind.GeohashGrid; } + /** + * Required - API name: {@code buckets} + */ + @Nonnull + public final Buckets buckets() { + return this.buckets; + } + + /** + * API name: {@code meta} + */ + @Nonnull + public final Map meta() { + return this.meta; + } + + /** + * 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) { + generator.writeKey("buckets"); + this.buckets.serialize(generator, mapper); + + if (ApiTypeHelper.isDefined(this.meta)) { + generator.writeKey("meta"); + generator.writeStartObject(); + for (Map.Entry item0 : this.meta.entrySet()) { + generator.writeKey(item0.getKey()); + item0.getValue().serialize(generator, mapper); + } + generator.writeEnd(); + } + } + // --------------------------------------------------------------------------------------------- @Override @@ -90,18 +148,21 @@ public static Builder builder() { /** * Builder for {@link GeoHashGridAggregate}. */ - public static class Builder extends MultiBucketAggregateBase.AbstractBuilder - implements - CopyableBuilder { + public static class Builder extends ObjectBuilderBase implements CopyableBuilder { + private Buckets buckets; + @Nullable + private Map meta; public Builder() {} private Builder(GeoHashGridAggregate o) { - super(o); + this.buckets = o.buckets; + this.meta = _mapCopy(o.meta); } private Builder(Builder o) { - super(o); + this.buckets = o.buckets; + this.meta = _mapCopy(o.meta); } @Override @@ -110,9 +171,46 @@ public Builder copy() { return new Builder(this); } - @Override + /** + * Required - API name: {@code buckets} + */ @Nonnull - protected Builder self() { + public final Builder buckets(Buckets value) { + this.buckets = value; + return this; + } + + /** + * Required - API name: {@code buckets} + */ + @Nonnull + public final Builder buckets(Function, ObjectBuilder>> fn) { + return buckets(fn.apply(new Buckets.Builder()).build()); + } + + /** + * 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 + public final Builder meta(String key, JsonData value) { + this.meta = _mapPut(this.meta, key, value); return this; } @@ -141,22 +239,23 @@ public GeoHashGridAggregate build() { ); protected static void setupGeoHashGridAggregateDeserializer(ObjectDeserializer op) { - setupMultiBucketAggregateBaseDeserializer(op, GeoHashGridBucket._DESERIALIZER); + op.add(Builder::buckets, Buckets.createBucketsDeserializer(GeoHashGridBucket._DESERIALIZER), "buckets"); + op.add(Builder::meta, JsonpDeserializer.stringMapDeserializer(JsonData._DESERIALIZER), "meta"); } @Override public int hashCode() { - int result = super.hashCode(); + int result = 17; + result = 31 * result + this.buckets.hashCode(); + result = 31 * result + Objects.hashCode(this.meta); 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; + GeoHashGridAggregate other = (GeoHashGridAggregate) o; + return this.buckets.equals(other.buckets) && Objects.equals(this.meta, other.meta); } } diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/aggregations/GeoHashGridAggregation.java b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/aggregations/GeoHashGridAggregationFields.java similarity index 84% rename from java-client/src/generated/java/org/opensearch/client/opensearch/_types/aggregations/GeoHashGridAggregation.java rename to java-client/src/generated/java/org/opensearch/client/opensearch/_types/aggregations/GeoHashGridAggregationFields.java index 140a3f62c2..4c4fd86c41 100644 --- a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/aggregations/GeoHashGridAggregation.java +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/aggregations/GeoHashGridAggregationFields.java @@ -47,20 +47,22 @@ import org.opensearch.client.json.JsonpMapper; import org.opensearch.client.json.ObjectBuilderDeserializer; import org.opensearch.client.json.ObjectDeserializer; +import org.opensearch.client.json.PlainJsonSerializable; import org.opensearch.client.opensearch._types.GeoBounds; import org.opensearch.client.opensearch._types.GeoHashPrecision; 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.GeoHashGridAggregation +// typedef: _types.aggregations.GeoHashGridAggregationFields @JsonpDeserializable @Generated("org.opensearch.client.codegen.CodeGenerator") -public class GeoHashGridAggregation extends BucketAggregationBase +public class GeoHashGridAggregationFields implements - AggregationVariant, - ToCopyableBuilder { + PlainJsonSerializable, + ToCopyableBuilder { @Nullable private final GeoBounds bounds; @@ -79,8 +81,7 @@ public class GeoHashGridAggregation extends BucketAggregationBase // --------------------------------------------------------------------------------------------- - private GeoHashGridAggregation(Builder builder) { - super(builder); + private GeoHashGridAggregationFields(Builder builder) { this.bounds = builder.bounds; this.field = builder.field; this.precision = builder.precision; @@ -88,18 +89,12 @@ private GeoHashGridAggregation(Builder builder) { this.size = builder.size; } - public static GeoHashGridAggregation of(Function> fn) { + public static GeoHashGridAggregationFields of( + Function> fn + ) { return fn.apply(new Builder()).build(); } - /** - * {@link Aggregation} variant kind. - */ - @Override - public Aggregation.Kind _aggregationKind() { - return Aggregation.Kind.GeohashGrid; - } - /** * API name: {@code bounds} */ @@ -147,8 +142,17 @@ public final Integer size() { return this.size; } + /** + * Serialize this object to JSON. + */ + @Override + public void serialize(JsonGenerator generator, JsonpMapper mapper) { + generator.writeStartObject(); + serializeInternal(generator, mapper); + generator.writeEnd(); + } + protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { - super.serializeInternal(generator, mapper); if (this.bounds != null) { generator.writeKey("bounds"); this.bounds.serialize(generator, mapper); @@ -189,11 +193,9 @@ public static Builder builder() { } /** - * Builder for {@link GeoHashGridAggregation}. + * Builder for {@link GeoHashGridAggregationFields}. */ - public static class Builder extends BucketAggregationBase.AbstractBuilder - implements - CopyableBuilder { + public static class Builder extends ObjectBuilderBase implements CopyableBuilder { @Nullable private GeoBounds bounds; @Nullable @@ -207,8 +209,7 @@ public static class Builder extends BucketAggregationBase.AbstractBuilder _DESERIALIZER = ObjectBuilderDeserializer.lazy( + public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer.lazy( Builder::new, - GeoHashGridAggregation::setupGeoHashGridAggregationDeserializer + GeoHashGridAggregationFields::setupGeoHashGridAggregationFieldsDeserializer ); - protected static void setupGeoHashGridAggregationDeserializer(ObjectDeserializer op) { - setupBucketAggregationBaseDeserializer(op); + protected static void setupGeoHashGridAggregationFieldsDeserializer(ObjectDeserializer op) { op.add(Builder::bounds, GeoBounds._DESERIALIZER, "bounds"); op.add(Builder::field, JsonpDeserializer.stringDeserializer(), "field"); op.add(Builder::precision, GeoHashPrecision._DESERIALIZER, "precision"); @@ -340,7 +333,7 @@ protected static void setupGeoHashGridAggregationDeserializer(ObjectDeserializer @Override public int hashCode() { - int result = super.hashCode(); + int result = 17; result = 31 * result + Objects.hashCode(this.bounds); result = 31 * result + Objects.hashCode(this.field); result = 31 * result + Objects.hashCode(this.precision); @@ -351,12 +344,9 @@ public int hashCode() { @Override public boolean equals(Object o) { - if (!super.equals(o)) { - return false; - } if (this == o) return true; if (o == null || this.getClass() != o.getClass()) return false; - GeoHashGridAggregation other = (GeoHashGridAggregation) o; + GeoHashGridAggregationFields other = (GeoHashGridAggregationFields) o; return Objects.equals(this.bounds, other.bounds) && Objects.equals(this.field, other.field) && Objects.equals(this.precision, other.precision) diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/aggregations/GeoTileGridAggregate.java b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/aggregations/GeoTileGridAggregate.java index 026edb251f..dd3af57c27 100644 --- a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/aggregations/GeoTileGridAggregate.java +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/aggregations/GeoTileGridAggregate.java @@ -36,30 +36,47 @@ 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.JsonpDeserializable; import org.opensearch.client.json.JsonpDeserializer; +import org.opensearch.client.json.JsonpMapper; import org.opensearch.client.json.ObjectBuilderDeserializer; import org.opensearch.client.json.ObjectDeserializer; +import org.opensearch.client.json.PlainJsonSerializable; +import org.opensearch.client.util.ApiTypeHelper; import org.opensearch.client.util.CopyableBuilder; import org.opensearch.client.util.ObjectBuilder; +import org.opensearch.client.util.ObjectBuilderBase; import org.opensearch.client.util.ToCopyableBuilder; // typedef: _types.aggregations.GeoTileGridAggregate @JsonpDeserializable @Generated("org.opensearch.client.codegen.CodeGenerator") -public class GeoTileGridAggregate extends MultiBucketAggregateBase +public class GeoTileGridAggregate implements AggregateVariant, + PlainJsonSerializable, ToCopyableBuilder { + @Nonnull + private final Buckets buckets; + + @Nonnull + private final Map meta; + // --------------------------------------------------------------------------------------------- private GeoTileGridAggregate(Builder builder) { - super(builder); + this.buckets = ApiTypeHelper.requireNonNull(builder.buckets, this, "buckets"); + this.meta = ApiTypeHelper.unmodifiable(builder.meta); } public static GeoTileGridAggregate of(Function> fn) { @@ -74,6 +91,47 @@ public Aggregate.Kind _aggregateKind() { return Aggregate.Kind.GeotileGrid; } + /** + * Required - API name: {@code buckets} + */ + @Nonnull + public final Buckets buckets() { + return this.buckets; + } + + /** + * API name: {@code meta} + */ + @Nonnull + public final Map meta() { + return this.meta; + } + + /** + * 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) { + generator.writeKey("buckets"); + this.buckets.serialize(generator, mapper); + + if (ApiTypeHelper.isDefined(this.meta)) { + generator.writeKey("meta"); + generator.writeStartObject(); + for (Map.Entry item0 : this.meta.entrySet()) { + generator.writeKey(item0.getKey()); + item0.getValue().serialize(generator, mapper); + } + generator.writeEnd(); + } + } + // --------------------------------------------------------------------------------------------- @Override @@ -90,18 +148,21 @@ public static Builder builder() { /** * Builder for {@link GeoTileGridAggregate}. */ - public static class Builder extends MultiBucketAggregateBase.AbstractBuilder - implements - CopyableBuilder { + public static class Builder extends ObjectBuilderBase implements CopyableBuilder { + private Buckets buckets; + @Nullable + private Map meta; public Builder() {} private Builder(GeoTileGridAggregate o) { - super(o); + this.buckets = o.buckets; + this.meta = _mapCopy(o.meta); } private Builder(Builder o) { - super(o); + this.buckets = o.buckets; + this.meta = _mapCopy(o.meta); } @Override @@ -110,9 +171,46 @@ public Builder copy() { return new Builder(this); } - @Override + /** + * Required - API name: {@code buckets} + */ @Nonnull - protected Builder self() { + public final Builder buckets(Buckets value) { + this.buckets = value; + return this; + } + + /** + * Required - API name: {@code buckets} + */ + @Nonnull + public final Builder buckets(Function, ObjectBuilder>> fn) { + return buckets(fn.apply(new Buckets.Builder()).build()); + } + + /** + * 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 + public final Builder meta(String key, JsonData value) { + this.meta = _mapPut(this.meta, key, value); return this; } @@ -141,22 +239,23 @@ public GeoTileGridAggregate build() { ); protected static void setupGeoTileGridAggregateDeserializer(ObjectDeserializer op) { - setupMultiBucketAggregateBaseDeserializer(op, GeoTileGridBucket._DESERIALIZER); + op.add(Builder::buckets, Buckets.createBucketsDeserializer(GeoTileGridBucket._DESERIALIZER), "buckets"); + op.add(Builder::meta, JsonpDeserializer.stringMapDeserializer(JsonData._DESERIALIZER), "meta"); } @Override public int hashCode() { - int result = super.hashCode(); + int result = 17; + result = 31 * result + this.buckets.hashCode(); + result = 31 * result + Objects.hashCode(this.meta); 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; + GeoTileGridAggregate other = (GeoTileGridAggregate) o; + return this.buckets.equals(other.buckets) && Objects.equals(this.meta, other.meta); } } diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/aggregations/GeoTileGridAggregation.java b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/aggregations/GeoTileGridAggregationFields.java similarity index 83% rename from java-client/src/generated/java/org/opensearch/client/opensearch/_types/aggregations/GeoTileGridAggregation.java rename to java-client/src/generated/java/org/opensearch/client/opensearch/_types/aggregations/GeoTileGridAggregationFields.java index 38f9b06173..d128be9750 100644 --- a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/aggregations/GeoTileGridAggregation.java +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/aggregations/GeoTileGridAggregationFields.java @@ -47,19 +47,21 @@ 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.GeoBounds; 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.GeoTileGridAggregation +// typedef: _types.aggregations.GeoTileGridAggregationFields @JsonpDeserializable @Generated("org.opensearch.client.codegen.CodeGenerator") -public class GeoTileGridAggregation extends BucketAggregationBase +public class GeoTileGridAggregationFields implements - AggregationVariant, - ToCopyableBuilder { + PlainJsonSerializable, + ToCopyableBuilder { @Nullable private final GeoBounds bounds; @@ -78,8 +80,7 @@ public class GeoTileGridAggregation extends BucketAggregationBase // --------------------------------------------------------------------------------------------- - private GeoTileGridAggregation(Builder builder) { - super(builder); + private GeoTileGridAggregationFields(Builder builder) { this.bounds = builder.bounds; this.field = builder.field; this.precision = builder.precision; @@ -87,18 +88,12 @@ private GeoTileGridAggregation(Builder builder) { this.size = builder.size; } - public static GeoTileGridAggregation of(Function> fn) { + public static GeoTileGridAggregationFields of( + Function> fn + ) { return fn.apply(new Builder()).build(); } - /** - * {@link Aggregation} variant kind. - */ - @Override - public Aggregation.Kind _aggregationKind() { - return Aggregation.Kind.GeotileGrid; - } - /** * API name: {@code bounds} */ @@ -146,8 +141,17 @@ public final Integer size() { return this.size; } + /** + * Serialize this object to JSON. + */ + @Override + public void serialize(JsonGenerator generator, JsonpMapper mapper) { + generator.writeStartObject(); + serializeInternal(generator, mapper); + generator.writeEnd(); + } + protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { - super.serializeInternal(generator, mapper); if (this.bounds != null) { generator.writeKey("bounds"); this.bounds.serialize(generator, mapper); @@ -188,11 +192,9 @@ public static Builder builder() { } /** - * Builder for {@link GeoTileGridAggregation}. + * Builder for {@link GeoTileGridAggregationFields}. */ - public static class Builder extends BucketAggregationBase.AbstractBuilder - implements - CopyableBuilder { + public static class Builder extends ObjectBuilderBase implements CopyableBuilder { @Nullable private GeoBounds bounds; @Nullable @@ -206,8 +208,7 @@ public static class Builder extends BucketAggregationBase.AbstractBuilder _DESERIALIZER = ObjectBuilderDeserializer.lazy( + public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer.lazy( Builder::new, - GeoTileGridAggregation::setupGeoTileGridAggregationDeserializer + GeoTileGridAggregationFields::setupGeoTileGridAggregationFieldsDeserializer ); - protected static void setupGeoTileGridAggregationDeserializer(ObjectDeserializer op) { - setupBucketAggregationBaseDeserializer(op); + protected static void setupGeoTileGridAggregationFieldsDeserializer(ObjectDeserializer op) { op.add(Builder::bounds, GeoBounds._DESERIALIZER, "bounds"); op.add(Builder::field, JsonpDeserializer.stringDeserializer(), "field"); op.add(Builder::precision, JsonpDeserializer.numberDeserializer(), "precision"); @@ -331,7 +324,7 @@ protected static void setupGeoTileGridAggregationDeserializer(ObjectDeserializer @Override public int hashCode() { - int result = super.hashCode(); + int result = 17; result = 31 * result + Objects.hashCode(this.bounds); result = 31 * result + Objects.hashCode(this.field); result = 31 * result + Objects.hashCode(this.precision); @@ -342,12 +335,9 @@ public int hashCode() { @Override public boolean equals(Object o) { - if (!super.equals(o)) { - return false; - } if (this == o) return true; if (o == null || this.getClass() != o.getClass()) return false; - GeoTileGridAggregation other = (GeoTileGridAggregation) o; + GeoTileGridAggregationFields other = (GeoTileGridAggregationFields) o; return Objects.equals(this.bounds, other.bounds) && Objects.equals(this.field, other.field) && Objects.equals(this.precision, other.precision) diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/aggregations/StringTermsBucket.java b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/aggregations/GlobalAggregationFields.java similarity index 52% rename from java-client/src/generated/java/org/opensearch/client/opensearch/_types/aggregations/StringTermsBucket.java rename to java-client/src/generated/java/org/opensearch/client/opensearch/_types/aggregations/GlobalAggregationFields.java index 09fedd6935..e200738ca4 100644 --- a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/aggregations/StringTermsBucket.java +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/aggregations/GlobalAggregationFields.java @@ -40,48 +40,37 @@ import java.util.function.Function; import javax.annotation.Generated; import javax.annotation.Nonnull; -import org.opensearch.client.json.JsonpDeserializable; import org.opensearch.client.json.JsonpDeserializer; import org.opensearch.client.json.JsonpMapper; -import org.opensearch.client.json.ObjectBuilderDeserializer; -import org.opensearch.client.json.ObjectDeserializer; -import org.opensearch.client.util.ApiTypeHelper; +import org.opensearch.client.json.PlainJsonSerializable; import org.opensearch.client.util.CopyableBuilder; import org.opensearch.client.util.ObjectBuilder; +import org.opensearch.client.util.ObjectBuilderBase; import org.opensearch.client.util.ToCopyableBuilder; -// typedef: _types.aggregations.StringTermsBucket +// typedef: _types.aggregations.GlobalAggregationFields -@JsonpDeserializable @Generated("org.opensearch.client.codegen.CodeGenerator") -public class StringTermsBucket extends TermsBucketBase implements ToCopyableBuilder { - - @Nonnull - private final String key; +public class GlobalAggregationFields + implements + PlainJsonSerializable, + ToCopyableBuilder { // --------------------------------------------------------------------------------------------- - private StringTermsBucket(Builder builder) { - super(builder); - this.key = ApiTypeHelper.requireNonNull(builder.key, this, "key"); - } + private GlobalAggregationFields(Builder builder) {} - public static StringTermsBucket of(Function> fn) { + public static GlobalAggregationFields of(Function> fn) { return fn.apply(new Builder()).build(); } /** - * Required - API name: {@code key} + * Serialize this object to JSON. */ - @Nonnull - public final String key() { - return this.key; - } - - protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { - super.serializeInternal(generator, mapper); - generator.writeKey("key"); - generator.write(this.key); + @Override + public void serialize(JsonGenerator generator, JsonpMapper mapper) { + generator.writeStartObject(); + generator.writeEnd(); } // --------------------------------------------------------------------------------------------- @@ -98,22 +87,15 @@ public static Builder builder() { } /** - * Builder for {@link StringTermsBucket}. + * Builder for {@link GlobalAggregationFields}. */ - public static class Builder extends TermsBucketBase.AbstractBuilder implements CopyableBuilder { - private String key; + public static class Builder extends ObjectBuilderBase implements CopyableBuilder { public Builder() {} - private Builder(StringTermsBucket o) { - super(o); - this.key = o.key; - } + private Builder(GlobalAggregationFields o) {} - private Builder(Builder o) { - super(o); - this.key = o.key; - } + private Builder(Builder o) {} @Override @Nonnull @@ -121,65 +103,41 @@ public Builder copy() { return new Builder(this); } - @Override - @Nonnull - protected Builder self() { - return this; - } - /** - * Required - API name: {@code key} - */ - @Nonnull - public final Builder key(String value) { - this.key = value; - return this; - } - - /** - * Builds a {@link StringTermsBucket}. + * Builds a {@link GlobalAggregationFields}. * * @throws NullPointerException if some of the required fields are null. */ @Override @Nonnull - public StringTermsBucket build() { + public GlobalAggregationFields build() { _checkSingleUse(); - return new StringTermsBucket(this); + return new GlobalAggregationFields(this); } } // --------------------------------------------------------------------------------------------- /** - * Json deserializer for {@link StringTermsBucket} + * Singleton instance for {@link GlobalAggregationFields}. */ - public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer.lazy( - Builder::new, - StringTermsBucket::setupStringTermsBucketDeserializer - ); + public static final GlobalAggregationFields _INSTANCE = builder().build(); - protected static void setupStringTermsBucketDeserializer(ObjectDeserializer op) { - setupTermsBucketBaseDeserializer(op); - op.add(Builder::key, JsonpDeserializer.stringDeserializer(), "key"); - } + public static final JsonpDeserializer _DESERIALIZER = JsonpDeserializer.emptyObject( + GlobalAggregationFields._INSTANCE + ); @Override public int hashCode() { - int result = super.hashCode(); - result = 31 * result + this.key.hashCode(); + int result = 17; return result; } @Override public boolean equals(Object o) { - if (!super.equals(o)) { - return false; - } if (this == o) return true; if (o == null || this.getClass() != o.getClass()) return false; - StringTermsBucket other = (StringTermsBucket) o; - return this.key.equals(other.key); + return true; } } diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/aggregations/HdrPercentileRanksAggregate.java b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/aggregations/HdrPercentileRanksAggregate.java index 995527830a..d741b03dcf 100644 --- a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/aggregations/HdrPercentileRanksAggregate.java +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/aggregations/HdrPercentileRanksAggregate.java @@ -36,30 +36,47 @@ 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.JsonpDeserializable; import org.opensearch.client.json.JsonpDeserializer; +import org.opensearch.client.json.JsonpMapper; import org.opensearch.client.json.ObjectBuilderDeserializer; import org.opensearch.client.json.ObjectDeserializer; +import org.opensearch.client.json.PlainJsonSerializable; +import org.opensearch.client.util.ApiTypeHelper; import org.opensearch.client.util.CopyableBuilder; import org.opensearch.client.util.ObjectBuilder; +import org.opensearch.client.util.ObjectBuilderBase; import org.opensearch.client.util.ToCopyableBuilder; // typedef: _types.aggregations.HdrPercentileRanksAggregate @JsonpDeserializable @Generated("org.opensearch.client.codegen.CodeGenerator") -public class HdrPercentileRanksAggregate extends PercentilesAggregateBase +public class HdrPercentileRanksAggregate implements AggregateVariant, + PlainJsonSerializable, ToCopyableBuilder { + @Nonnull + private final Map meta; + + @Nonnull + private final Percentiles values; + // --------------------------------------------------------------------------------------------- private HdrPercentileRanksAggregate(Builder builder) { - super(builder); + this.meta = ApiTypeHelper.unmodifiable(builder.meta); + this.values = ApiTypeHelper.requireNonNull(builder.values, this, "values"); } public static HdrPercentileRanksAggregate of( @@ -76,6 +93,47 @@ public Aggregate.Kind _aggregateKind() { return Aggregate.Kind.HdrPercentileRanks; } + /** + * API name: {@code meta} + */ + @Nonnull + public final Map meta() { + return this.meta; + } + + /** + * Required - API name: {@code values} + */ + @Nonnull + public final Percentiles values() { + return this.values; + } + + /** + * Serialize this object to JSON. + */ + @Override + public void serialize(JsonGenerator generator, JsonpMapper mapper) { + generator.writeStartObject(); + serializeInternal(generator, mapper); + generator.writeEnd(); + } + + protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { + 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(); + } + + generator.writeKey("values"); + this.values.serialize(generator, mapper); + } + // --------------------------------------------------------------------------------------------- @Override @@ -92,18 +150,21 @@ public static Builder builder() { /** * Builder for {@link HdrPercentileRanksAggregate}. */ - public static class Builder extends PercentilesAggregateBase.AbstractBuilder - implements - CopyableBuilder { + public static class Builder extends ObjectBuilderBase implements CopyableBuilder { + @Nullable + private Map meta; + private Percentiles values; public Builder() {} private Builder(HdrPercentileRanksAggregate o) { - super(o); + this.meta = _mapCopy(o.meta); + this.values = o.values; } private Builder(Builder o) { - super(o); + this.meta = _mapCopy(o.meta); + this.values = o.values; } @Override @@ -112,12 +173,49 @@ 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; } + /** + * Required - API name: {@code values} + */ + @Nonnull + public final Builder values(Percentiles value) { + this.values = value; + return this; + } + + /** + * Required - API name: {@code values} + */ + @Nonnull + public final Builder values(Function> fn) { + return values(fn.apply(new Percentiles.Builder()).build()); + } + /** * Builds a {@link HdrPercentileRanksAggregate}. * @@ -143,22 +241,23 @@ public HdrPercentileRanksAggregate build() { ); protected static void setupHdrPercentileRanksAggregateDeserializer(ObjectDeserializer op) { - setupPercentilesAggregateBaseDeserializer(op); + op.add(Builder::meta, JsonpDeserializer.stringMapDeserializer(JsonData._DESERIALIZER), "meta"); + op.add(Builder::values, Percentiles._DESERIALIZER, "values"); } @Override public int hashCode() { - int result = super.hashCode(); + int result = 17; + result = 31 * result + Objects.hashCode(this.meta); + result = 31 * result + this.values.hashCode(); return result; } @Override public boolean equals(Object o) { - if (!super.equals(o)) { - return false; - } if (this == o) return true; if (o == null || this.getClass() != o.getClass()) return false; - return true; + HdrPercentileRanksAggregate other = (HdrPercentileRanksAggregate) o; + return Objects.equals(this.meta, other.meta) && this.values.equals(other.values); } } diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/aggregations/HdrPercentilesAggregate.java b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/aggregations/HdrPercentilesAggregate.java index 7e7fdd1691..632e1ed13f 100644 --- a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/aggregations/HdrPercentilesAggregate.java +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/aggregations/HdrPercentilesAggregate.java @@ -36,30 +36,47 @@ 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.JsonpDeserializable; import org.opensearch.client.json.JsonpDeserializer; +import org.opensearch.client.json.JsonpMapper; import org.opensearch.client.json.ObjectBuilderDeserializer; import org.opensearch.client.json.ObjectDeserializer; +import org.opensearch.client.json.PlainJsonSerializable; +import org.opensearch.client.util.ApiTypeHelper; import org.opensearch.client.util.CopyableBuilder; import org.opensearch.client.util.ObjectBuilder; +import org.opensearch.client.util.ObjectBuilderBase; import org.opensearch.client.util.ToCopyableBuilder; // typedef: _types.aggregations.HdrPercentilesAggregate @JsonpDeserializable @Generated("org.opensearch.client.codegen.CodeGenerator") -public class HdrPercentilesAggregate extends PercentilesAggregateBase +public class HdrPercentilesAggregate implements AggregateVariant, + PlainJsonSerializable, ToCopyableBuilder { + @Nonnull + private final Map meta; + + @Nonnull + private final Percentiles values; + // --------------------------------------------------------------------------------------------- private HdrPercentilesAggregate(Builder builder) { - super(builder); + this.meta = ApiTypeHelper.unmodifiable(builder.meta); + this.values = ApiTypeHelper.requireNonNull(builder.values, this, "values"); } public static HdrPercentilesAggregate of(Function> fn) { @@ -74,6 +91,47 @@ public Aggregate.Kind _aggregateKind() { return Aggregate.Kind.HdrPercentiles; } + /** + * API name: {@code meta} + */ + @Nonnull + public final Map meta() { + return this.meta; + } + + /** + * Required - API name: {@code values} + */ + @Nonnull + public final Percentiles values() { + return this.values; + } + + /** + * Serialize this object to JSON. + */ + @Override + public void serialize(JsonGenerator generator, JsonpMapper mapper) { + generator.writeStartObject(); + serializeInternal(generator, mapper); + generator.writeEnd(); + } + + protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { + 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(); + } + + generator.writeKey("values"); + this.values.serialize(generator, mapper); + } + // --------------------------------------------------------------------------------------------- @Override @@ -90,18 +148,21 @@ public static Builder builder() { /** * Builder for {@link HdrPercentilesAggregate}. */ - public static class Builder extends PercentilesAggregateBase.AbstractBuilder - implements - CopyableBuilder { + public static class Builder extends ObjectBuilderBase implements CopyableBuilder { + @Nullable + private Map meta; + private Percentiles values; public Builder() {} private Builder(HdrPercentilesAggregate o) { - super(o); + this.meta = _mapCopy(o.meta); + this.values = o.values; } private Builder(Builder o) { - super(o); + this.meta = _mapCopy(o.meta); + this.values = o.values; } @Override @@ -110,12 +171,49 @@ 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; } + /** + * Required - API name: {@code values} + */ + @Nonnull + public final Builder values(Percentiles value) { + this.values = value; + return this; + } + + /** + * Required - API name: {@code values} + */ + @Nonnull + public final Builder values(Function> fn) { + return values(fn.apply(new Percentiles.Builder()).build()); + } + /** * Builds a {@link HdrPercentilesAggregate}. * @@ -141,22 +239,23 @@ public HdrPercentilesAggregate build() { ); protected static void setupHdrPercentilesAggregateDeserializer(ObjectDeserializer op) { - setupPercentilesAggregateBaseDeserializer(op); + op.add(Builder::meta, JsonpDeserializer.stringMapDeserializer(JsonData._DESERIALIZER), "meta"); + op.add(Builder::values, Percentiles._DESERIALIZER, "values"); } @Override public int hashCode() { - int result = super.hashCode(); + int result = 17; + result = 31 * result + Objects.hashCode(this.meta); + result = 31 * result + this.values.hashCode(); return result; } @Override public boolean equals(Object o) { - if (!super.equals(o)) { - return false; - } if (this == o) return true; if (o == null || this.getClass() != o.getClass()) return false; - return true; + HdrPercentilesAggregate other = (HdrPercentilesAggregate) o; + return Objects.equals(this.meta, other.meta) && this.values.equals(other.values); } } diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/aggregations/HistogramAggregate.java b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/aggregations/HistogramAggregate.java index bd0a6c08ee..8477dd8753 100644 --- a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/aggregations/HistogramAggregate.java +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/aggregations/HistogramAggregate.java @@ -36,30 +36,47 @@ 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.JsonpDeserializable; import org.opensearch.client.json.JsonpDeserializer; +import org.opensearch.client.json.JsonpMapper; import org.opensearch.client.json.ObjectBuilderDeserializer; import org.opensearch.client.json.ObjectDeserializer; +import org.opensearch.client.json.PlainJsonSerializable; +import org.opensearch.client.util.ApiTypeHelper; import org.opensearch.client.util.CopyableBuilder; import org.opensearch.client.util.ObjectBuilder; +import org.opensearch.client.util.ObjectBuilderBase; import org.opensearch.client.util.ToCopyableBuilder; // typedef: _types.aggregations.HistogramAggregate @JsonpDeserializable @Generated("org.opensearch.client.codegen.CodeGenerator") -public class HistogramAggregate extends MultiBucketAggregateBase +public class HistogramAggregate implements AggregateVariant, + PlainJsonSerializable, ToCopyableBuilder { + @Nonnull + private final Buckets buckets; + + @Nonnull + private final Map meta; + // --------------------------------------------------------------------------------------------- private HistogramAggregate(Builder builder) { - super(builder); + this.buckets = ApiTypeHelper.requireNonNull(builder.buckets, this, "buckets"); + this.meta = ApiTypeHelper.unmodifiable(builder.meta); } public static HistogramAggregate of(Function> fn) { @@ -74,6 +91,47 @@ public Aggregate.Kind _aggregateKind() { return Aggregate.Kind.Histogram; } + /** + * Required - API name: {@code buckets} + */ + @Nonnull + public final Buckets buckets() { + return this.buckets; + } + + /** + * API name: {@code meta} + */ + @Nonnull + public final Map meta() { + return this.meta; + } + + /** + * 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) { + generator.writeKey("buckets"); + this.buckets.serialize(generator, mapper); + + if (ApiTypeHelper.isDefined(this.meta)) { + generator.writeKey("meta"); + generator.writeStartObject(); + for (Map.Entry item0 : this.meta.entrySet()) { + generator.writeKey(item0.getKey()); + item0.getValue().serialize(generator, mapper); + } + generator.writeEnd(); + } + } + // --------------------------------------------------------------------------------------------- @Override @@ -90,18 +148,21 @@ public static Builder builder() { /** * Builder for {@link HistogramAggregate}. */ - public static class Builder extends MultiBucketAggregateBase.AbstractBuilder - implements - CopyableBuilder { + public static class Builder extends ObjectBuilderBase implements CopyableBuilder { + private Buckets buckets; + @Nullable + private Map meta; public Builder() {} private Builder(HistogramAggregate o) { - super(o); + this.buckets = o.buckets; + this.meta = _mapCopy(o.meta); } private Builder(Builder o) { - super(o); + this.buckets = o.buckets; + this.meta = _mapCopy(o.meta); } @Override @@ -110,9 +171,46 @@ public Builder copy() { return new Builder(this); } - @Override + /** + * Required - API name: {@code buckets} + */ @Nonnull - protected Builder self() { + public final Builder buckets(Buckets value) { + this.buckets = value; + return this; + } + + /** + * Required - API name: {@code buckets} + */ + @Nonnull + public final Builder buckets(Function, ObjectBuilder>> fn) { + return buckets(fn.apply(new Buckets.Builder()).build()); + } + + /** + * 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 + public final Builder meta(String key, JsonData value) { + this.meta = _mapPut(this.meta, key, value); return this; } @@ -141,22 +239,23 @@ public HistogramAggregate build() { ); protected static void setupHistogramAggregateDeserializer(ObjectDeserializer op) { - setupMultiBucketAggregateBaseDeserializer(op, HistogramBucket._DESERIALIZER); + op.add(Builder::buckets, Buckets.createBucketsDeserializer(HistogramBucket._DESERIALIZER), "buckets"); + op.add(Builder::meta, JsonpDeserializer.stringMapDeserializer(JsonData._DESERIALIZER), "meta"); } @Override public int hashCode() { - int result = super.hashCode(); + int result = 17; + result = 31 * result + this.buckets.hashCode(); + result = 31 * result + Objects.hashCode(this.meta); 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; + HistogramAggregate other = (HistogramAggregate) o; + return this.buckets.equals(other.buckets) && Objects.equals(this.meta, other.meta); } } diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/aggregations/HistogramAggregation.java b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/aggregations/HistogramAggregationFields.java similarity index 90% rename from java-client/src/generated/java/org/opensearch/client/opensearch/_types/aggregations/HistogramAggregation.java rename to java-client/src/generated/java/org/opensearch/client/opensearch/_types/aggregations/HistogramAggregationFields.java index 5b323d0757..5a1b58adcb 100644 --- a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/aggregations/HistogramAggregation.java +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/aggregations/HistogramAggregationFields.java @@ -47,19 +47,21 @@ 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.CopyableBuilder; import org.opensearch.client.util.ObjectBuilder; +import org.opensearch.client.util.ObjectBuilderBase; import org.opensearch.client.util.ToCopyableBuilder; -// typedef: _types.aggregations.HistogramAggregation +// typedef: _types.aggregations.HistogramAggregationFields @JsonpDeserializable @Generated("org.opensearch.client.codegen.CodeGenerator") -public class HistogramAggregation extends BucketAggregationBase +public class HistogramAggregationFields implements - AggregationVariant, - ToCopyableBuilder { + PlainJsonSerializable, + ToCopyableBuilder { @Nullable private final ExtendedBounds extendedBounds; @@ -96,8 +98,7 @@ public class HistogramAggregation extends BucketAggregationBase // --------------------------------------------------------------------------------------------- - private HistogramAggregation(Builder builder) { - super(builder); + private HistogramAggregationFields(Builder builder) { this.extendedBounds = builder.extendedBounds; this.field = builder.field; this.format = builder.format; @@ -111,18 +112,12 @@ private HistogramAggregation(Builder builder) { this.script = builder.script; } - public static HistogramAggregation of(Function> fn) { + public static HistogramAggregationFields of( + Function> fn + ) { return fn.apply(new Builder()).build(); } - /** - * {@link Aggregation} variant kind. - */ - @Override - public Aggregation.Kind _aggregationKind() { - return Aggregation.Kind.Histogram; - } - /** * API name: {@code extended_bounds} */ @@ -228,8 +223,17 @@ public final Script script() { return this.script; } + /** + * Serialize this object to JSON. + */ + @Override + public void serialize(JsonGenerator generator, JsonpMapper mapper) { + generator.writeStartObject(); + serializeInternal(generator, mapper); + generator.writeEnd(); + } + protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { - super.serializeInternal(generator, mapper); if (this.extendedBounds != null) { generator.writeKey("extended_bounds"); this.extendedBounds.serialize(generator, mapper); @@ -300,11 +304,9 @@ public static Builder builder() { } /** - * Builder for {@link HistogramAggregation}. + * Builder for {@link HistogramAggregationFields}. */ - public static class Builder extends BucketAggregationBase.AbstractBuilder - implements - CopyableBuilder { + public static class Builder extends ObjectBuilderBase implements CopyableBuilder { @Nullable private ExtendedBounds extendedBounds; @Nullable @@ -330,8 +332,7 @@ public static class Builder extends BucketAggregationBase.AbstractBuilder> fn) } /** - * Builds a {@link HistogramAggregation}. + * Builds a {@link HistogramAggregationFields}. * * @throws NullPointerException if some of the required fields are null. */ @Override @Nonnull - public HistogramAggregation build() { + public HistogramAggregationFields build() { _checkSingleUse(); - return new HistogramAggregation(this); + return new HistogramAggregationFields(this); } } // --------------------------------------------------------------------------------------------- /** - * Json deserializer for {@link HistogramAggregation} + * Json deserializer for {@link HistogramAggregationFields} */ - public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer.lazy( + public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer.lazy( Builder::new, - HistogramAggregation::setupHistogramAggregationDeserializer + HistogramAggregationFields::setupHistogramAggregationFieldsDeserializer ); - protected static void setupHistogramAggregationDeserializer(ObjectDeserializer op) { - setupBucketAggregationBaseDeserializer(op); + protected static void setupHistogramAggregationFieldsDeserializer(ObjectDeserializer op) { op.add( Builder::extendedBounds, ExtendedBounds.createExtendedBoundsDeserializer(JsonpDeserializer.doubleDeserializer()), @@ -565,7 +558,7 @@ protected static void setupHistogramAggregationDeserializer(ObjectDeserializer +public class IpRangeAggregate implements AggregateVariant, + PlainJsonSerializable, ToCopyableBuilder { + @Nonnull + private final Buckets buckets; + + @Nonnull + private final Map meta; + // --------------------------------------------------------------------------------------------- private IpRangeAggregate(Builder builder) { - super(builder); + this.buckets = ApiTypeHelper.requireNonNull(builder.buckets, this, "buckets"); + this.meta = ApiTypeHelper.unmodifiable(builder.meta); } public static IpRangeAggregate of(Function> fn) { @@ -74,6 +91,47 @@ public Aggregate.Kind _aggregateKind() { return Aggregate.Kind.IpRange; } + /** + * Required - API name: {@code buckets} + */ + @Nonnull + public final Buckets buckets() { + return this.buckets; + } + + /** + * API name: {@code meta} + */ + @Nonnull + public final Map meta() { + return this.meta; + } + + /** + * 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) { + generator.writeKey("buckets"); + this.buckets.serialize(generator, mapper); + + if (ApiTypeHelper.isDefined(this.meta)) { + generator.writeKey("meta"); + generator.writeStartObject(); + for (Map.Entry item0 : this.meta.entrySet()) { + generator.writeKey(item0.getKey()); + item0.getValue().serialize(generator, mapper); + } + generator.writeEnd(); + } + } + // --------------------------------------------------------------------------------------------- @Override @@ -90,18 +148,21 @@ public static Builder builder() { /** * Builder for {@link IpRangeAggregate}. */ - public static class Builder extends MultiBucketAggregateBase.AbstractBuilder - implements - CopyableBuilder { + public static class Builder extends ObjectBuilderBase implements CopyableBuilder { + private Buckets buckets; + @Nullable + private Map meta; public Builder() {} private Builder(IpRangeAggregate o) { - super(o); + this.buckets = o.buckets; + this.meta = _mapCopy(o.meta); } private Builder(Builder o) { - super(o); + this.buckets = o.buckets; + this.meta = _mapCopy(o.meta); } @Override @@ -110,9 +171,46 @@ public Builder copy() { return new Builder(this); } - @Override + /** + * Required - API name: {@code buckets} + */ @Nonnull - protected Builder self() { + public final Builder buckets(Buckets value) { + this.buckets = value; + return this; + } + + /** + * Required - API name: {@code buckets} + */ + @Nonnull + public final Builder buckets(Function, ObjectBuilder>> fn) { + return buckets(fn.apply(new Buckets.Builder()).build()); + } + + /** + * 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 + public final Builder meta(String key, JsonData value) { + this.meta = _mapPut(this.meta, key, value); return this; } @@ -141,22 +239,23 @@ public IpRangeAggregate build() { ); protected static void setupIpRangeAggregateDeserializer(ObjectDeserializer op) { - setupMultiBucketAggregateBaseDeserializer(op, IpRangeBucket._DESERIALIZER); + op.add(Builder::buckets, Buckets.createBucketsDeserializer(IpRangeBucket._DESERIALIZER), "buckets"); + op.add(Builder::meta, JsonpDeserializer.stringMapDeserializer(JsonData._DESERIALIZER), "meta"); } @Override public int hashCode() { - int result = super.hashCode(); + int result = 17; + result = 31 * result + this.buckets.hashCode(); + result = 31 * result + Objects.hashCode(this.meta); 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; + IpRangeAggregate other = (IpRangeAggregate) o; + return this.buckets.equals(other.buckets) && Objects.equals(this.meta, other.meta); } } diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/aggregations/IpRangeAggregation.java b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/aggregations/IpRangeAggregationFields.java similarity index 79% rename from java-client/src/generated/java/org/opensearch/client/opensearch/_types/aggregations/IpRangeAggregation.java rename to java-client/src/generated/java/org/opensearch/client/opensearch/_types/aggregations/IpRangeAggregationFields.java index 1f092ac4ff..a6291c317f 100644 --- a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/aggregations/IpRangeAggregation.java +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/aggregations/IpRangeAggregationFields.java @@ -48,19 +48,21 @@ import org.opensearch.client.json.JsonpMapper; import org.opensearch.client.json.ObjectBuilderDeserializer; import org.opensearch.client.json.ObjectDeserializer; +import org.opensearch.client.json.PlainJsonSerializable; import org.opensearch.client.util.ApiTypeHelper; import org.opensearch.client.util.CopyableBuilder; import org.opensearch.client.util.ObjectBuilder; +import org.opensearch.client.util.ObjectBuilderBase; import org.opensearch.client.util.ToCopyableBuilder; -// typedef: _types.aggregations.IpRangeAggregation +// typedef: _types.aggregations.IpRangeAggregationFields @JsonpDeserializable @Generated("org.opensearch.client.codegen.CodeGenerator") -public class IpRangeAggregation extends BucketAggregationBase +public class IpRangeAggregationFields implements - AggregationVariant, - ToCopyableBuilder { + PlainJsonSerializable, + ToCopyableBuilder { @Nullable private final String field; @@ -70,24 +72,15 @@ public class IpRangeAggregation extends BucketAggregationBase // --------------------------------------------------------------------------------------------- - private IpRangeAggregation(Builder builder) { - super(builder); + private IpRangeAggregationFields(Builder builder) { this.field = builder.field; this.ranges = ApiTypeHelper.unmodifiable(builder.ranges); } - public static IpRangeAggregation of(Function> fn) { + public static IpRangeAggregationFields of(Function> fn) { return fn.apply(new Builder()).build(); } - /** - * {@link Aggregation} variant kind. - */ - @Override - public Aggregation.Kind _aggregationKind() { - return Aggregation.Kind.IpRange; - } - /** * API name: {@code field} */ @@ -107,8 +100,17 @@ public final List ranges() { return this.ranges; } + /** + * Serialize this object to JSON. + */ + @Override + public void serialize(JsonGenerator generator, JsonpMapper mapper) { + generator.writeStartObject(); + serializeInternal(generator, mapper); + generator.writeEnd(); + } + protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { - super.serializeInternal(generator, mapper); if (this.field != null) { generator.writeKey("field"); generator.write(this.field); @@ -138,11 +140,9 @@ public static Builder builder() { } /** - * Builder for {@link IpRangeAggregation}. + * Builder for {@link IpRangeAggregationFields}. */ - public static class Builder extends BucketAggregationBase.AbstractBuilder - implements - CopyableBuilder { + public static class Builder extends ObjectBuilderBase implements CopyableBuilder { @Nullable private String field; @Nullable @@ -150,14 +150,12 @@ public static class Builder extends BucketAggregationBase.AbstractBuilder _DESERIALIZER = ObjectBuilderDeserializer.lazy( + public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer.lazy( Builder::new, - IpRangeAggregation::setupIpRangeAggregationDeserializer + IpRangeAggregationFields::setupIpRangeAggregationFieldsDeserializer ); - protected static void setupIpRangeAggregationDeserializer(ObjectDeserializer op) { - setupBucketAggregationBaseDeserializer(op); + protected static void setupIpRangeAggregationFieldsDeserializer(ObjectDeserializer op) { op.add(Builder::field, JsonpDeserializer.stringDeserializer(), "field"); op.add(Builder::ranges, JsonpDeserializer.arrayDeserializer(IpRangeAggregationRange._DESERIALIZER), "ranges"); } @Override public int hashCode() { - int result = super.hashCode(); + int result = 17; result = 31 * result + Objects.hashCode(this.field); result = 31 * result + Objects.hashCode(this.ranges); return result; @@ -270,12 +261,9 @@ public int hashCode() { @Override public boolean equals(Object o) { - if (!super.equals(o)) { - return false; - } if (this == o) return true; if (o == null || this.getClass() != o.getClass()) return false; - IpRangeAggregation other = (IpRangeAggregation) o; + IpRangeAggregationFields other = (IpRangeAggregationFields) o; return Objects.equals(this.field, other.field) && Objects.equals(this.ranges, other.ranges); } } diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/aggregations/LongTermsAggregate.java b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/aggregations/LongTermsAggregate.java index 84f1bdba3f..219af15276 100644 --- a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/aggregations/LongTermsAggregate.java +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/aggregations/LongTermsAggregate.java @@ -39,6 +39,7 @@ import java.util.function.Function; import javax.annotation.Generated; import javax.annotation.Nonnull; +import org.opensearch.client.json.JsonData; import org.opensearch.client.json.JsonpDeserializable; import org.opensearch.client.json.JsonpDeserializer; import org.opensearch.client.json.ObjectBuilderDeserializer; @@ -54,7 +55,7 @@ */ @JsonpDeserializable @Generated("org.opensearch.client.codegen.CodeGenerator") -public class LongTermsAggregate extends TermsAggregateBase +public class LongTermsAggregate extends TermsAggregateBase implements AggregateVariant, ToCopyableBuilder { @@ -93,7 +94,7 @@ public static Builder builder() { /** * Builder for {@link LongTermsAggregate}. */ - public static class Builder extends TermsAggregateBase.AbstractBuilder + public static class Builder extends TermsAggregateBase.AbstractBuilder implements CopyableBuilder { @@ -144,7 +145,7 @@ public LongTermsAggregate build() { ); protected static void setupLongTermsAggregateDeserializer(ObjectDeserializer op) { - setupTermsAggregateBaseDeserializer(op, LongTermsBucket._DESERIALIZER); + setupTermsAggregateBaseDeserializer(op, JsonData._DESERIALIZER); } @Override diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/aggregations/LongTermsBucketKey.java b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/aggregations/LongTermsBucketKey.java deleted file mode 100644 index 250d73ab04..0000000000 --- a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/aggregations/LongTermsBucketKey.java +++ /dev/null @@ -1,221 +0,0 @@ -/* - * SPDX-License-Identifier: Apache-2.0 - * - * The OpenSearch Contributors require contributions made to - * this file be licensed under the Apache-2.0 license or a - * compatible open source license. - */ - -/* - * Licensed to Elasticsearch B.V. under one or more contributor - * license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright - * ownership. Elasticsearch B.V. licenses this file to you under - * the Apache License, Version 2.0 (the "License"); you may - * not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -/* - * Modifications Copyright OpenSearch Contributors. See - * GitHub history for details. - */ - -//---------------------------------------------------- -// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. -//---------------------------------------------------- - -package org.opensearch.client.opensearch._types.aggregations; - -import jakarta.json.stream.JsonGenerator; -import java.util.Objects; -import java.util.function.Function; -import javax.annotation.Generated; -import javax.annotation.Nonnull; -import org.opensearch.client.json.JsonpDeserializable; -import org.opensearch.client.json.JsonpDeserializer; -import org.opensearch.client.json.JsonpMapper; -import org.opensearch.client.json.JsonpSerializable; -import org.opensearch.client.json.PlainJsonSerializable; -import org.opensearch.client.json.UnionDeserializer; -import org.opensearch.client.util.ApiTypeHelper; -import org.opensearch.client.util.ObjectBuilder; -import org.opensearch.client.util.ObjectBuilderBase; -import org.opensearch.client.util.TaggedUnion; -import org.opensearch.client.util.TaggedUnionUtils; - -// typedef: _types.aggregations.LongTermsBucketKey - -@JsonpDeserializable -@Generated("org.opensearch.client.codegen.CodeGenerator") -public class LongTermsBucketKey implements TaggedUnion, PlainJsonSerializable { - /** - * {@link LongTermsBucketKey} variant kinds. - */ - public enum Kind { - Signed, - Unsigned - } - - private final Kind _kind; - private final Object _value; - - @Override - public final Kind _kind() { - return _kind; - } - - @Override - public final Object _get() { - return _value; - } - - private LongTermsBucketKey(Kind kind, Object value) { - this._kind = kind; - this._value = value; - } - - private LongTermsBucketKey(Builder builder) { - this._kind = ApiTypeHelper.requireNonNull(builder._kind, builder, ""); - this._value = ApiTypeHelper.requireNonNull(builder._value, builder, ""); - } - - public static LongTermsBucketKey of(Function> fn) { - return fn.apply(new Builder()).build(); - } - - public String _toJsonString() { - switch (_kind) { - case Signed: - return String.valueOf(this.signed()); - case Unsigned: - return this.unsigned(); - default: - throw new IllegalStateException("Unknown kind " + _kind); - } - } - - /** - * Is this variant instance of kind {@code signed}? - */ - public boolean isSigned() { - return _kind == Kind.Signed; - } - - /** - * Get the {@code signed} variant value. - * - * @throws IllegalStateException if the current variant is not the {@code signed} kind. - */ - public Long signed() { - return TaggedUnionUtils.get(this, Kind.Signed); - } - - /** - * Is this variant instance of kind {@code unsigned}? - */ - public boolean isUnsigned() { - return _kind == Kind.Unsigned; - } - - /** - * Get the {@code unsigned} variant value. - * - * @throws IllegalStateException if the current variant is not the {@code unsigned} kind. - */ - public String unsigned() { - return TaggedUnionUtils.get(this, Kind.Unsigned); - } - - @Override - public void serialize(JsonGenerator generator, JsonpMapper mapper) { - if (_value instanceof JsonpSerializable) { - ((JsonpSerializable) _value).serialize(generator, mapper); - } else { - switch (_kind) { - case Signed: - generator.write(((Long) this._value)); - break; - case Unsigned: - generator.write(((String) this._value)); - break; - } - } - } - - @Nonnull - public Builder toBuilder() { - return new Builder(this); - } - - @Nonnull - public static Builder builder() { - return new Builder(); - } - - public static class Builder extends ObjectBuilderBase implements ObjectBuilder { - private Kind _kind; - private Object _value; - - public Builder() {} - - private Builder(LongTermsBucketKey o) { - this._kind = o._kind; - this._value = o._value; - } - - public ObjectBuilder signed(Long v) { - this._kind = Kind.Signed; - this._value = v; - return this; - } - - public ObjectBuilder unsigned(String v) { - this._kind = Kind.Unsigned; - this._value = v; - return this; - } - - @Override - public LongTermsBucketKey build() { - _checkSingleUse(); - return new LongTermsBucketKey(this); - } - } - - private static JsonpDeserializer buildLongTermsBucketKeyDeserializer() { - return new UnionDeserializer.Builder(LongTermsBucketKey::new, false).addMember( - Kind.Signed, - JsonpDeserializer.longDeserializer() - ).addMember(Kind.Unsigned, JsonpDeserializer.stringDeserializer()).build(); - } - - public static final JsonpDeserializer _DESERIALIZER = JsonpDeserializer.lazy( - LongTermsBucketKey::buildLongTermsBucketKeyDeserializer - ); - - @Override - public int hashCode() { - int result = 17; - result = 31 * result + Objects.hashCode(this._kind); - result = 31 * result + Objects.hashCode(this._value); - return result; - } - - @Override - public boolean equals(Object o) { - if (this == o) return true; - if (o == null || this.getClass() != o.getClass()) return false; - LongTermsBucketKey other = (LongTermsBucketKey) o; - return Objects.equals(this._kind, other._kind) && Objects.equals(this._value, other._value); - } -} diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/aggregations/MatrixAggregation.java b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/aggregations/MatrixAggregation.java index 687a42f7be..9c0b5d4d47 100644 --- a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/aggregations/MatrixAggregation.java +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/aggregations/MatrixAggregation.java @@ -46,12 +46,14 @@ import org.opensearch.client.json.JsonpDeserializer; import org.opensearch.client.json.JsonpMapper; import org.opensearch.client.json.ObjectDeserializer; +import org.opensearch.client.json.PlainJsonSerializable; import org.opensearch.client.util.ApiTypeHelper; +import org.opensearch.client.util.ObjectBuilderBase; // typedef: _types.aggregations.MatrixAggregation @Generated("org.opensearch.client.codegen.CodeGenerator") -public abstract class MatrixAggregation extends AggregationBase { +public abstract class MatrixAggregation implements PlainJsonSerializable { @Nonnull private final List fields; @@ -62,7 +64,6 @@ public abstract class MatrixAggregation extends AggregationBase { // --------------------------------------------------------------------------------------------- protected MatrixAggregation(AbstractBuilder builder) { - super(builder); this.fields = ApiTypeHelper.unmodifiable(builder.fields); this.missing = ApiTypeHelper.unmodifiable(builder.missing); } @@ -86,8 +87,17 @@ public final Map missing() { return this.missing; } + /** + * Serialize this object to JSON. + */ + @Override + public void serialize(JsonGenerator generator, JsonpMapper mapper) { + generator.writeStartObject(); + serializeInternal(generator, mapper); + generator.writeEnd(); + } + protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { - super.serializeInternal(generator, mapper); if (ApiTypeHelper.isDefined(this.fields)) { generator.writeKey("fields"); generator.writeStartArray(); @@ -110,8 +120,7 @@ protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { // --------------------------------------------------------------------------------------------- - public abstract static class AbstractBuilder> extends AggregationBase.AbstractBuilder< - BuilderT> { + public abstract static class AbstractBuilder> extends ObjectBuilderBase { @Nullable private List fields; @Nullable @@ -120,17 +129,18 @@ public abstract static class AbstractBuilder o) { - super(o); this.fields = _listCopy(o.fields); this.missing = _mapCopy(o.missing); } + @Nonnull + protected abstract BuilderT self(); + /** * API name: {@code fields} * @@ -193,14 +203,13 @@ public final BuilderT missing(String key, Double value) { // --------------------------------------------------------------------------------------------- protected static > void setupMatrixAggregationDeserializer(ObjectDeserializer op) { - setupAggregationBaseDeserializer(op); op.add(AbstractBuilder::fields, JsonpDeserializer.arrayDeserializer(JsonpDeserializer.stringDeserializer()), "fields"); op.add(AbstractBuilder::missing, JsonpDeserializer.stringMapDeserializer(JsonpDeserializer.doubleDeserializer()), "missing"); } @Override public int hashCode() { - int result = super.hashCode(); + int result = 17; result = 31 * result + Objects.hashCode(this.fields); result = 31 * result + Objects.hashCode(this.missing); return result; @@ -208,9 +217,6 @@ public int hashCode() { @Override public boolean equals(Object o) { - if (!super.equals(o)) { - return false; - } if (this == o) return true; if (o == null || this.getClass() != o.getClass()) return false; MatrixAggregation other = (MatrixAggregation) o; diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/aggregations/MatrixStatsAggregation.java b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/aggregations/MatrixStatsAggregation.java index 59ac693c68..3c4e970e37 100644 --- a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/aggregations/MatrixStatsAggregation.java +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/aggregations/MatrixStatsAggregation.java @@ -58,7 +58,6 @@ @Generated("org.opensearch.client.codegen.CodeGenerator") public class MatrixStatsAggregation extends MatrixAggregation implements - AggregationVariant, ToCopyableBuilder { @Nullable @@ -75,14 +74,6 @@ public static MatrixStatsAggregation of(Function { +public class MaxAggregate implements AggregateVariant, PlainJsonSerializable, ToCopyableBuilder { + + @Nonnull + private final Map meta; + + @Nullable + private final Double value; + + @Nullable + private final String valueAsString; // --------------------------------------------------------------------------------------------- private MaxAggregate(Builder builder) { - super(builder); + this.meta = ApiTypeHelper.unmodifiable(builder.meta); + this.value = builder.value; + this.valueAsString = builder.valueAsString; } public static MaxAggregate of(Function> fn) { @@ -74,6 +91,65 @@ public Aggregate.Kind _aggregateKind() { return Aggregate.Kind.Max; } + /** + * 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 MaxAggregate}. */ - 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(MaxAggregate 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 MaxAggregate build() { ); protected static void setupMaxAggregateDeserializer(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; + MaxAggregate other = (MaxAggregate) 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/MaxAggregation.java b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/aggregations/MaxAggregation.java index 8fce3ddf3d..697f68d4ba 100644 --- a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/aggregations/MaxAggregation.java +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/aggregations/MaxAggregation.java @@ -55,10 +55,7 @@ @JsonpDeserializable @Generated("org.opensearch.client.codegen.CodeGenerator") -public class MaxAggregation extends FormatMetricAggregationBase - implements - AggregationVariant, - ToCopyableBuilder { +public class MaxAggregation extends FormatMetricAggregationBase implements ToCopyableBuilder { @Nullable private final ValueType valueType; @@ -74,14 +71,6 @@ public static MaxAggregation of(Function { // --------------------------------------------------------------------------------------------- @@ -66,14 +65,6 @@ public static MaxBucketAggregation of(Function { + @Nonnull + private final Map meta; + + @Nullable + private final Double value; + + @Nullable + private final String valueAsString; + // --------------------------------------------------------------------------------------------- private MedianAbsoluteDeviationAggregate(Builder builder) { - super(builder); + this.meta = ApiTypeHelper.unmodifiable(builder.meta); + this.value = builder.value; + this.valueAsString = builder.valueAsString; } public static MedianAbsoluteDeviationAggregate of( @@ -76,6 +97,65 @@ public Aggregate.Kind _aggregateKind() { return Aggregate.Kind.MedianAbsoluteDeviation; } + /** + * 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 @@ -92,18 +172,26 @@ public static Builder builder() { /** * Builder for {@link MedianAbsoluteDeviationAggregate}. */ - 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(MedianAbsoluteDeviationAggregate 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 @@ -112,9 +200,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; } @@ -145,22 +274,27 @@ public MedianAbsoluteDeviationAggregate build() { protected static void setupMedianAbsoluteDeviationAggregateDeserializer( 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; + MedianAbsoluteDeviationAggregate other = (MedianAbsoluteDeviationAggregate) 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/MedianAbsoluteDeviationAggregation.java b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/aggregations/MedianAbsoluteDeviationAggregation.java index a4072d80d3..23e3ddfc47 100644 --- a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/aggregations/MedianAbsoluteDeviationAggregation.java +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/aggregations/MedianAbsoluteDeviationAggregation.java @@ -57,7 +57,6 @@ @Generated("org.opensearch.client.codegen.CodeGenerator") public class MedianAbsoluteDeviationAggregation extends FormatMetricAggregationBase implements - AggregationVariant, ToCopyableBuilder { @Nullable @@ -76,14 +75,6 @@ public static MedianAbsoluteDeviationAggregation of( return fn.apply(new Builder()).build(); } - /** - * {@link Aggregation} variant kind. - */ - @Override - public Aggregation.Kind _aggregationKind() { - return Aggregation.Kind.MedianAbsoluteDeviation; - } - /** * Limits the maximum number of nodes used by the underlying TDigest algorithm to 20 * compression, enabling control of * memory usage and approximation error. diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/aggregations/MetricAggregationBase.java b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/aggregations/MetricAggregationBase.java index 8cc050a3cf..cb57bd780f 100644 --- a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/aggregations/MetricAggregationBase.java +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/aggregations/MetricAggregationBase.java @@ -37,20 +37,17 @@ package org.opensearch.client.opensearch._types.aggregations; import jakarta.json.stream.JsonGenerator; -import java.util.Map; import java.util.Objects; import java.util.function.Function; import javax.annotation.Generated; import javax.annotation.Nonnull; import javax.annotation.Nullable; -import org.opensearch.client.json.JsonData; import org.opensearch.client.json.JsonpDeserializer; import org.opensearch.client.json.JsonpMapper; import org.opensearch.client.json.ObjectDeserializer; import org.opensearch.client.json.PlainJsonSerializable; import org.opensearch.client.opensearch._types.FieldValue; import org.opensearch.client.opensearch._types.Script; -import org.opensearch.client.util.ApiTypeHelper; import org.opensearch.client.util.ObjectBuilder; import org.opensearch.client.util.ObjectBuilderBase; @@ -62,15 +59,9 @@ public abstract class MetricAggregationBase implements PlainJsonSerializable { @Nullable private final String field; - @Nonnull - private final Map meta; - @Nullable private final FieldValue missing; - @Nullable - private final String name; - @Nullable private final Script script; @@ -78,9 +69,7 @@ public abstract class MetricAggregationBase implements PlainJsonSerializable { protected MetricAggregationBase(AbstractBuilder builder) { this.field = builder.field; - this.meta = ApiTypeHelper.unmodifiable(builder.meta); this.missing = builder.missing; - this.name = builder.name; this.script = builder.script; } @@ -92,14 +81,6 @@ public final String field() { return this.field; } - /** - * API name: {@code meta} - */ - @Nonnull - public final Map meta() { - return this.meta; - } - /** * API name: {@code missing} */ @@ -108,14 +89,6 @@ public final FieldValue missing() { return this.missing; } - /** - * API name: {@code name} - */ - @Nullable - public final String name() { - return this.name; - } - /** * API name: {@code script} */ @@ -140,26 +113,11 @@ protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { generator.write(this.field); } - if (ApiTypeHelper.isDefined(this.meta)) { - generator.writeKey("meta"); - generator.writeStartObject(); - for (Map.Entry item0 : this.meta.entrySet()) { - generator.writeKey(item0.getKey()); - item0.getValue().serialize(generator, mapper); - } - generator.writeEnd(); - } - if (this.missing != null) { generator.writeKey("missing"); this.missing.serialize(generator, mapper); } - if (this.name != null) { - generator.writeKey("name"); - generator.write(this.name); - } - if (this.script != null) { generator.writeKey("script"); this.script.serialize(generator, mapper); @@ -172,29 +130,21 @@ public abstract static class AbstractBuilder meta; - @Nullable private FieldValue missing; @Nullable - private String name; - @Nullable private Script script; protected AbstractBuilder() {} protected AbstractBuilder(MetricAggregationBase o) { this.field = o.field; - this.meta = _mapCopy(o.meta); this.missing = o.missing; - this.name = o.name; this.script = o.script; } protected AbstractBuilder(AbstractBuilder o) { this.field = o.field; - this.meta = _mapCopy(o.meta); this.missing = o.missing; - this.name = o.name; this.script = o.script; } @@ -210,32 +160,6 @@ public final BuilderT field(@Nullable String value) { return self(); } - /** - * API name: {@code meta} - * - *

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

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

- * Adds an entry to meta. - *

- */ - @Nonnull - public final BuilderT meta(String key, JsonData value) { - this.meta = _mapPut(this.meta, key, value); - return self(); - } - /** * API name: {@code missing} */ @@ -253,15 +177,6 @@ public final BuilderT missing(Function> void setupMetricAg ObjectDeserializer op ) { op.add(AbstractBuilder::field, JsonpDeserializer.stringDeserializer(), "field"); - op.add(AbstractBuilder::meta, JsonpDeserializer.stringMapDeserializer(JsonData._DESERIALIZER), "meta"); op.add(AbstractBuilder::missing, FieldValue._DESERIALIZER, "missing"); - op.add(AbstractBuilder::name, JsonpDeserializer.stringDeserializer(), "name"); op.add(AbstractBuilder::script, Script._DESERIALIZER, "script"); } @@ -296,9 +209,7 @@ protected static > void setupMetricAg public int hashCode() { int result = 17; result = 31 * result + Objects.hashCode(this.field); - result = 31 * result + Objects.hashCode(this.meta); result = 31 * result + Objects.hashCode(this.missing); - result = 31 * result + Objects.hashCode(this.name); result = 31 * result + Objects.hashCode(this.script); return result; } @@ -309,9 +220,7 @@ public boolean equals(Object o) { if (o == null || this.getClass() != o.getClass()) return false; MetricAggregationBase other = (MetricAggregationBase) o; return Objects.equals(this.field, other.field) - && Objects.equals(this.meta, other.meta) && Objects.equals(this.missing, other.missing) - && Objects.equals(this.name, other.name) && Objects.equals(this.script, other.script); } } diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/aggregations/MinAggregate.java b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/aggregations/MinAggregate.java index 8117eb9fd6..72fcc9b1c2 100644 --- a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/aggregations/MinAggregate.java +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/aggregations/MinAggregate.java @@ -36,30 +36,47 @@ 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.JsonpDeserializable; import org.opensearch.client.json.JsonpDeserializer; +import org.opensearch.client.json.JsonpMapper; import org.opensearch.client.json.ObjectBuilderDeserializer; import org.opensearch.client.json.ObjectDeserializer; +import org.opensearch.client.json.PlainJsonSerializable; +import org.opensearch.client.util.ApiTypeHelper; import org.opensearch.client.util.CopyableBuilder; import org.opensearch.client.util.ObjectBuilder; +import org.opensearch.client.util.ObjectBuilderBase; import org.opensearch.client.util.ToCopyableBuilder; // typedef: _types.aggregations.MinAggregate @JsonpDeserializable @Generated("org.opensearch.client.codegen.CodeGenerator") -public class MinAggregate extends SingleMetricAggregateBase - implements - AggregateVariant, - ToCopyableBuilder { +public class MinAggregate implements AggregateVariant, PlainJsonSerializable, ToCopyableBuilder { + + @Nonnull + private final Map meta; + + @Nullable + private final Double value; + + @Nullable + private final String valueAsString; // --------------------------------------------------------------------------------------------- private MinAggregate(Builder builder) { - super(builder); + this.meta = ApiTypeHelper.unmodifiable(builder.meta); + this.value = builder.value; + this.valueAsString = builder.valueAsString; } public static MinAggregate of(Function> fn) { @@ -74,6 +91,65 @@ public Aggregate.Kind _aggregateKind() { return Aggregate.Kind.Min; } + /** + * 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 MinAggregate}. */ - 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(MinAggregate 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 MinAggregate build() { ); protected static void setupMinAggregateDeserializer(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; + MinAggregate other = (MinAggregate) 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/MinAggregation.java b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/aggregations/MinAggregation.java index 5d318d22ef..8d4bd003a4 100644 --- a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/aggregations/MinAggregation.java +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/aggregations/MinAggregation.java @@ -55,10 +55,7 @@ @JsonpDeserializable @Generated("org.opensearch.client.codegen.CodeGenerator") -public class MinAggregation extends FormatMetricAggregationBase - implements - AggregationVariant, - ToCopyableBuilder { +public class MinAggregation extends FormatMetricAggregationBase implements ToCopyableBuilder { @Nullable private final ValueType valueType; @@ -74,14 +71,6 @@ public static MinAggregation of(Function { // --------------------------------------------------------------------------------------------- @@ -66,14 +65,6 @@ public static MinBucketAggregation of(Function { + PlainJsonSerializable, + ToCopyableBuilder { @Nullable private final String field; @@ -69,24 +71,15 @@ public class MissingAggregation extends BucketAggregationBase // --------------------------------------------------------------------------------------------- - private MissingAggregation(Builder builder) { - super(builder); + private MissingAggregationFields(Builder builder) { this.field = builder.field; this.missing = builder.missing; } - public static MissingAggregation of(Function> fn) { + public static MissingAggregationFields of(Function> fn) { return fn.apply(new Builder()).build(); } - /** - * {@link Aggregation} variant kind. - */ - @Override - public Aggregation.Kind _aggregationKind() { - return Aggregation.Kind.Missing; - } - /** * API name: {@code field} */ @@ -103,8 +96,17 @@ public final FieldValue missing() { return this.missing; } + /** + * Serialize this object to JSON. + */ + @Override + public void serialize(JsonGenerator generator, JsonpMapper mapper) { + generator.writeStartObject(); + serializeInternal(generator, mapper); + generator.writeEnd(); + } + protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { - super.serializeInternal(generator, mapper); if (this.field != null) { generator.writeKey("field"); generator.write(this.field); @@ -130,11 +132,9 @@ public static Builder builder() { } /** - * Builder for {@link MissingAggregation}. + * Builder for {@link MissingAggregationFields}. */ - public static class Builder extends BucketAggregationBase.AbstractBuilder - implements - CopyableBuilder { + public static class Builder extends ObjectBuilderBase implements CopyableBuilder { @Nullable private String field; @Nullable @@ -142,14 +142,12 @@ public static class Builder extends BucketAggregationBase.AbstractBuilder _DESERIALIZER = ObjectBuilderDeserializer.lazy( + public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer.lazy( Builder::new, - MissingAggregation::setupMissingAggregationDeserializer + MissingAggregationFields::setupMissingAggregationFieldsDeserializer ); - protected static void setupMissingAggregationDeserializer(ObjectDeserializer op) { - setupBucketAggregationBaseDeserializer(op); + protected static void setupMissingAggregationFieldsDeserializer(ObjectDeserializer op) { op.add(Builder::field, JsonpDeserializer.stringDeserializer(), "field"); op.add(Builder::missing, FieldValue._DESERIALIZER, "missing"); } @Override public int hashCode() { - int result = super.hashCode(); + int result = 17; result = 31 * result + Objects.hashCode(this.field); result = 31 * result + Objects.hashCode(this.missing); return result; @@ -232,12 +223,9 @@ public int hashCode() { @Override public boolean equals(Object o) { - if (!super.equals(o)) { - return false; - } if (this == o) return true; if (o == null || this.getClass() != o.getClass()) return false; - MissingAggregation other = (MissingAggregation) o; + MissingAggregationFields other = (MissingAggregationFields) o; return Objects.equals(this.field, other.field) && Objects.equals(this.missing, other.missing); } } diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/aggregations/MovingAverageAggregation.java b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/aggregations/MovingAverageAggregation.java index 514a973f88..b60b6f931f 100644 --- a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/aggregations/MovingAverageAggregation.java +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/aggregations/MovingAverageAggregation.java @@ -61,7 +61,6 @@ public class MovingAverageAggregation implements TaggedUnion, - AggregationVariant, PlainJsonSerializable { /** * {@link MovingAverageAggregation} variant kinds. @@ -85,14 +84,6 @@ public String jsonValue() { } } - /** - * {@link Aggregation} variant kind. - */ - @Override - public Aggregation.Kind _aggregationKind() { - return Aggregation.Kind.MovingAvg; - } - private final Kind _kind; private final MovingAverageAggregationVariant _value; diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/aggregations/MovingFunctionAggregation.java b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/aggregations/MovingFunctionAggregation.java index 94de3d738f..346accd644 100644 --- a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/aggregations/MovingFunctionAggregation.java +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/aggregations/MovingFunctionAggregation.java @@ -57,7 +57,6 @@ @Generated("org.opensearch.client.codegen.CodeGenerator") public class MovingFunctionAggregation extends PipelineAggregationBase implements - AggregationVariant, ToCopyableBuilder { @Nullable @@ -82,14 +81,6 @@ public static MovingFunctionAggregation of(Function diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/aggregations/MovingPercentilesAggregation.java b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/aggregations/MovingPercentilesAggregation.java index 2601c8fefd..ea40a98777 100644 --- a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/aggregations/MovingPercentilesAggregation.java +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/aggregations/MovingPercentilesAggregation.java @@ -57,7 +57,6 @@ @Generated("org.opensearch.client.codegen.CodeGenerator") public class MovingPercentilesAggregation extends PipelineAggregationBase implements - AggregationVariant, ToCopyableBuilder { @Nullable @@ -84,14 +83,6 @@ public static MovingPercentilesAggregation of( return fn.apply(new Builder()).build(); } - /** - * {@link Aggregation} variant kind. - */ - @Override - public Aggregation.Kind _aggregationKind() { - return Aggregation.Kind.MovingPercentiles; - } - /** * API name: {@code keyed} */ diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/aggregations/MultiTermsAggregate.java b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/aggregations/MultiTermsAggregate.java index f0be401d7c..78854383be 100644 --- a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/aggregations/MultiTermsAggregate.java +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/aggregations/MultiTermsAggregate.java @@ -36,30 +36,55 @@ 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.JsonpDeserializable; import org.opensearch.client.json.JsonpDeserializer; +import org.opensearch.client.json.JsonpMapper; import org.opensearch.client.json.ObjectBuilderDeserializer; import org.opensearch.client.json.ObjectDeserializer; +import org.opensearch.client.json.PlainJsonSerializable; +import org.opensearch.client.util.ApiTypeHelper; import org.opensearch.client.util.CopyableBuilder; import org.opensearch.client.util.ObjectBuilder; +import org.opensearch.client.util.ObjectBuilderBase; import org.opensearch.client.util.ToCopyableBuilder; // typedef: _types.aggregations.MultiTermsAggregate @JsonpDeserializable @Generated("org.opensearch.client.codegen.CodeGenerator") -public class MultiTermsAggregate extends TermsAggregateBase +public class MultiTermsAggregate implements AggregateVariant, + PlainJsonSerializable, ToCopyableBuilder { + @Nonnull + private final Buckets buckets; + + @Nullable + private final Long docCountErrorUpperBound; + + @Nonnull + private final Map meta; + + @Nullable + private final Long sumOtherDocCount; + // --------------------------------------------------------------------------------------------- private MultiTermsAggregate(Builder builder) { - super(builder); + this.buckets = ApiTypeHelper.requireNonNull(builder.buckets, this, "buckets"); + this.docCountErrorUpperBound = builder.docCountErrorUpperBound; + this.meta = ApiTypeHelper.unmodifiable(builder.meta); + this.sumOtherDocCount = builder.sumOtherDocCount; } public static MultiTermsAggregate of(Function> fn) { @@ -74,6 +99,73 @@ public Aggregate.Kind _aggregateKind() { return Aggregate.Kind.MultiTerms; } + /** + * Required - API name: {@code buckets} + */ + @Nonnull + public final Buckets buckets() { + return this.buckets; + } + + /** + * API name: {@code doc_count_error_upper_bound} + */ + @Nullable + public final Long docCountErrorUpperBound() { + return this.docCountErrorUpperBound; + } + + /** + * API name: {@code meta} + */ + @Nonnull + public final Map meta() { + return this.meta; + } + + /** + * API name: {@code sum_other_doc_count} + */ + @Nullable + public final Long sumOtherDocCount() { + return this.sumOtherDocCount; + } + + /** + * 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) { + generator.writeKey("buckets"); + this.buckets.serialize(generator, mapper); + + if (this.docCountErrorUpperBound != null) { + generator.writeKey("doc_count_error_upper_bound"); + generator.write(this.docCountErrorUpperBound); + } + + 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.sumOtherDocCount != null) { + generator.writeKey("sum_other_doc_count"); + generator.write(this.sumOtherDocCount); + } + } + // --------------------------------------------------------------------------------------------- @Override @@ -90,18 +182,29 @@ public static Builder builder() { /** * Builder for {@link MultiTermsAggregate}. */ - public static class Builder extends TermsAggregateBase.AbstractBuilder - implements - CopyableBuilder { + public static class Builder extends ObjectBuilderBase implements CopyableBuilder { + private Buckets buckets; + @Nullable + private Long docCountErrorUpperBound; + @Nullable + private Map meta; + @Nullable + private Long sumOtherDocCount; public Builder() {} private Builder(MultiTermsAggregate o) { - super(o); + this.buckets = o.buckets; + this.docCountErrorUpperBound = o.docCountErrorUpperBound; + this.meta = _mapCopy(o.meta); + this.sumOtherDocCount = o.sumOtherDocCount; } private Builder(Builder o) { - super(o); + this.buckets = o.buckets; + this.docCountErrorUpperBound = o.docCountErrorUpperBound; + this.meta = _mapCopy(o.meta); + this.sumOtherDocCount = o.sumOtherDocCount; } @Override @@ -110,9 +213,64 @@ public Builder copy() { return new Builder(this); } - @Override + /** + * Required - API name: {@code buckets} + */ + @Nonnull + public final Builder buckets(Buckets value) { + this.buckets = value; + return this; + } + + /** + * Required - API name: {@code buckets} + */ + @Nonnull + public final Builder buckets(Function, ObjectBuilder>> fn) { + return buckets(fn.apply(new Buckets.Builder()).build()); + } + + /** + * API name: {@code doc_count_error_upper_bound} + */ + @Nonnull + public final Builder docCountErrorUpperBound(@Nullable Long value) { + this.docCountErrorUpperBound = value; + return this; + } + + /** + * 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; + } + + /** + * API name: {@code sum_other_doc_count} + */ + @Nonnull + public final Builder sumOtherDocCount(@Nullable Long value) { + this.sumOtherDocCount = value; return this; } @@ -141,22 +299,30 @@ public MultiTermsAggregate build() { ); protected static void setupMultiTermsAggregateDeserializer(ObjectDeserializer op) { - setupTermsAggregateBaseDeserializer(op, MultiTermsBucket._DESERIALIZER); + op.add(Builder::buckets, Buckets.createBucketsDeserializer(MultiTermsBucket._DESERIALIZER), "buckets"); + op.add(Builder::docCountErrorUpperBound, JsonpDeserializer.longDeserializer(), "doc_count_error_upper_bound"); + op.add(Builder::meta, JsonpDeserializer.stringMapDeserializer(JsonData._DESERIALIZER), "meta"); + op.add(Builder::sumOtherDocCount, JsonpDeserializer.longDeserializer(), "sum_other_doc_count"); } @Override public int hashCode() { - int result = super.hashCode(); + int result = 17; + result = 31 * result + this.buckets.hashCode(); + result = 31 * result + Objects.hashCode(this.docCountErrorUpperBound); + result = 31 * result + Objects.hashCode(this.meta); + result = 31 * result + Objects.hashCode(this.sumOtherDocCount); 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; + MultiTermsAggregate other = (MultiTermsAggregate) o; + return this.buckets.equals(other.buckets) + && Objects.equals(this.docCountErrorUpperBound, other.docCountErrorUpperBound) + && Objects.equals(this.meta, other.meta) + && Objects.equals(this.sumOtherDocCount, other.sumOtherDocCount); } } diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/aggregations/MultiTermsAggregation.java b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/aggregations/MultiTermsAggregationFields.java similarity index 89% rename from java-client/src/generated/java/org/opensearch/client/opensearch/_types/aggregations/MultiTermsAggregation.java rename to java-client/src/generated/java/org/opensearch/client/opensearch/_types/aggregations/MultiTermsAggregationFields.java index 0bce6e7867..ad2d77cb68 100644 --- a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/aggregations/MultiTermsAggregation.java +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/aggregations/MultiTermsAggregationFields.java @@ -48,19 +48,21 @@ import org.opensearch.client.json.JsonpMapper; import org.opensearch.client.json.ObjectBuilderDeserializer; import org.opensearch.client.json.ObjectDeserializer; +import org.opensearch.client.json.PlainJsonSerializable; import org.opensearch.client.util.ApiTypeHelper; import org.opensearch.client.util.CopyableBuilder; import org.opensearch.client.util.ObjectBuilder; +import org.opensearch.client.util.ObjectBuilderBase; import org.opensearch.client.util.ToCopyableBuilder; -// typedef: _types.aggregations.MultiTermsAggregation +// typedef: _types.aggregations.MultiTermsAggregationFields @JsonpDeserializable @Generated("org.opensearch.client.codegen.CodeGenerator") -public class MultiTermsAggregation extends BucketAggregationBase +public class MultiTermsAggregationFields implements - AggregationVariant, - ToCopyableBuilder { + PlainJsonSerializable, + ToCopyableBuilder { @Nullable private final TermsAggregationCollectMode collectMode; @@ -88,8 +90,7 @@ public class MultiTermsAggregation extends BucketAggregationBase // --------------------------------------------------------------------------------------------- - private MultiTermsAggregation(Builder builder) { - super(builder); + private MultiTermsAggregationFields(Builder builder) { this.collectMode = builder.collectMode; this.minDocCount = builder.minDocCount; this.order = builder.order; @@ -100,18 +101,12 @@ private MultiTermsAggregation(Builder builder) { this.terms = ApiTypeHelper.unmodifiableRequired(builder.terms, this, "terms"); } - public static MultiTermsAggregation of(Function> fn) { + public static MultiTermsAggregationFields of( + Function> fn + ) { return fn.apply(new Builder()).build(); } - /** - * {@link Aggregation} variant kind. - */ - @Override - public Aggregation.Kind _aggregationKind() { - return Aggregation.Kind.MultiTerms; - } - /** * API name: {@code collect_mode} */ @@ -195,8 +190,17 @@ public final List terms() { return this.terms; } + /** + * Serialize this object to JSON. + */ + @Override + public void serialize(JsonGenerator generator, JsonpMapper mapper) { + generator.writeStartObject(); + serializeInternal(generator, mapper); + generator.writeEnd(); + } + protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { - super.serializeInternal(generator, mapper); if (this.collectMode != null) { generator.writeKey("collect_mode"); this.collectMode.serialize(generator, mapper); @@ -254,11 +258,9 @@ public static Builder builder() { } /** - * Builder for {@link MultiTermsAggregation}. + * Builder for {@link MultiTermsAggregationFields}. */ - public static class Builder extends BucketAggregationBase.AbstractBuilder - implements - CopyableBuilder { + public static class Builder extends ObjectBuilderBase implements CopyableBuilder { @Nullable private TermsAggregationCollectMode collectMode; @Nullable @@ -277,8 +279,7 @@ public static class Builder extends BucketAggregationBase.AbstractBuilder _DESERIALIZER = ObjectBuilderDeserializer.lazy( + public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer.lazy( Builder::new, - MultiTermsAggregation::setupMultiTermsAggregationDeserializer + MultiTermsAggregationFields::setupMultiTermsAggregationFieldsDeserializer ); - protected static void setupMultiTermsAggregationDeserializer(ObjectDeserializer op) { - setupBucketAggregationBaseDeserializer(op); + protected static void setupMultiTermsAggregationFieldsDeserializer(ObjectDeserializer op) { op.add(Builder::collectMode, TermsAggregationCollectMode._DESERIALIZER, "collect_mode"); op.add(Builder::minDocCount, JsonpDeserializer.integerDeserializer(), "min_doc_count"); op.add(Builder::order, HistogramOrder._DESERIALIZER, "order"); @@ -485,7 +478,7 @@ protected static void setupMultiTermsAggregationDeserializer(ObjectDeserializer< @Override public int hashCode() { - int result = super.hashCode(); + int result = 17; result = 31 * result + Objects.hashCode(this.collectMode); result = 31 * result + Objects.hashCode(this.minDocCount); result = 31 * result + Objects.hashCode(this.order); @@ -499,12 +492,9 @@ public int hashCode() { @Override public boolean equals(Object o) { - if (!super.equals(o)) { - return false; - } if (this == o) return true; if (o == null || this.getClass() != o.getClass()) return false; - MultiTermsAggregation other = (MultiTermsAggregation) o; + MultiTermsAggregationFields other = (MultiTermsAggregationFields) o; return Objects.equals(this.collectMode, other.collectMode) && Objects.equals(this.minDocCount, other.minDocCount) && Objects.equals(this.order, other.order) diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/aggregations/NestedAggregation.java b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/aggregations/NestedAggregationFields.java similarity index 71% rename from java-client/src/generated/java/org/opensearch/client/opensearch/_types/aggregations/NestedAggregation.java rename to java-client/src/generated/java/org/opensearch/client/opensearch/_types/aggregations/NestedAggregationFields.java index fb8e1b2ed0..1604c62f99 100644 --- a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/aggregations/NestedAggregation.java +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/aggregations/NestedAggregationFields.java @@ -47,41 +47,34 @@ import org.opensearch.client.json.JsonpMapper; import org.opensearch.client.json.ObjectBuilderDeserializer; import org.opensearch.client.json.ObjectDeserializer; +import org.opensearch.client.json.PlainJsonSerializable; import org.opensearch.client.util.CopyableBuilder; import org.opensearch.client.util.ObjectBuilder; +import org.opensearch.client.util.ObjectBuilderBase; import org.opensearch.client.util.ToCopyableBuilder; -// typedef: _types.aggregations.NestedAggregation +// typedef: _types.aggregations.NestedAggregationFields @JsonpDeserializable @Generated("org.opensearch.client.codegen.CodeGenerator") -public class NestedAggregation extends BucketAggregationBase +public class NestedAggregationFields implements - AggregationVariant, - ToCopyableBuilder { + PlainJsonSerializable, + ToCopyableBuilder { @Nullable private final String path; // --------------------------------------------------------------------------------------------- - private NestedAggregation(Builder builder) { - super(builder); + private NestedAggregationFields(Builder builder) { this.path = builder.path; } - public static NestedAggregation of(Function> fn) { + public static NestedAggregationFields of(Function> fn) { return fn.apply(new Builder()).build(); } - /** - * {@link Aggregation} variant kind. - */ - @Override - public Aggregation.Kind _aggregationKind() { - return Aggregation.Kind.Nested; - } - /** * API name: {@code path} */ @@ -90,8 +83,17 @@ public final String path() { return this.path; } + /** + * Serialize this object to JSON. + */ + @Override + public void serialize(JsonGenerator generator, JsonpMapper mapper) { + generator.writeStartObject(); + serializeInternal(generator, mapper); + generator.writeEnd(); + } + protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { - super.serializeInternal(generator, mapper); if (this.path != null) { generator.writeKey("path"); generator.write(this.path); @@ -112,23 +114,19 @@ public static Builder builder() { } /** - * Builder for {@link NestedAggregation}. + * Builder for {@link NestedAggregationFields}. */ - public static class Builder extends BucketAggregationBase.AbstractBuilder - implements - CopyableBuilder { + public static class Builder extends ObjectBuilderBase implements CopyableBuilder { @Nullable private String path; public Builder() {} - private Builder(NestedAggregation o) { - super(o); + private Builder(NestedAggregationFields o) { this.path = o.path; } private Builder(Builder o) { - super(o); this.path = o.path; } @@ -138,12 +136,6 @@ public Builder copy() { return new Builder(this); } - @Override - @Nonnull - protected Builder self() { - return this; - } - /** * API name: {@code path} */ @@ -154,49 +146,45 @@ public final Builder path(@Nullable String value) { } /** - * Builds a {@link NestedAggregation}. + * Builds a {@link NestedAggregationFields}. * * @throws NullPointerException if some of the required fields are null. */ @Override @Nonnull - public NestedAggregation build() { + public NestedAggregationFields build() { _checkSingleUse(); - return new NestedAggregation(this); + return new NestedAggregationFields(this); } } // --------------------------------------------------------------------------------------------- /** - * Json deserializer for {@link NestedAggregation} + * Json deserializer for {@link NestedAggregationFields} */ - public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer.lazy( + public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer.lazy( Builder::new, - NestedAggregation::setupNestedAggregationDeserializer + NestedAggregationFields::setupNestedAggregationFieldsDeserializer ); - protected static void setupNestedAggregationDeserializer(ObjectDeserializer op) { - setupBucketAggregationBaseDeserializer(op); + protected static void setupNestedAggregationFieldsDeserializer(ObjectDeserializer op) { op.add(Builder::path, JsonpDeserializer.stringDeserializer(), "path"); } @Override public int hashCode() { - int result = super.hashCode(); + int result = 17; result = 31 * result + Objects.hashCode(this.path); return result; } @Override public boolean equals(Object o) { - if (!super.equals(o)) { - return false; - } if (this == o) return true; if (o == null || this.getClass() != o.getClass()) return false; - NestedAggregation other = (NestedAggregation) o; + NestedAggregationFields other = (NestedAggregationFields) o; return Objects.equals(this.path, other.path); } } diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/aggregations/NormalizeAggregation.java b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/aggregations/NormalizeAggregation.java index 09c682f963..6efe19755e 100644 --- a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/aggregations/NormalizeAggregation.java +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/aggregations/NormalizeAggregation.java @@ -57,7 +57,6 @@ @Generated("org.opensearch.client.codegen.CodeGenerator") public class NormalizeAggregation extends PipelineAggregationBase implements - AggregationVariant, ToCopyableBuilder { @Nullable @@ -74,14 +73,6 @@ public static NormalizeAggregation of(Function { + PlainJsonSerializable, + ToCopyableBuilder { @Nullable private final String type; // --------------------------------------------------------------------------------------------- - private ChildrenAggregation(Builder builder) { - super(builder); + private ParentAggregationFields(Builder builder) { this.type = builder.type; } - public static ChildrenAggregation of(Function> fn) { + public static ParentAggregationFields of(Function> fn) { return fn.apply(new Builder()).build(); } - /** - * {@link Aggregation} variant kind. - */ - @Override - public Aggregation.Kind _aggregationKind() { - return Aggregation.Kind.Children; - } - /** * API name: {@code type} */ @@ -90,8 +83,17 @@ public final String type() { return this.type; } + /** + * Serialize this object to JSON. + */ + @Override + public void serialize(JsonGenerator generator, JsonpMapper mapper) { + generator.writeStartObject(); + serializeInternal(generator, mapper); + generator.writeEnd(); + } + protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { - super.serializeInternal(generator, mapper); if (this.type != null) { generator.writeKey("type"); generator.write(this.type); @@ -112,23 +114,19 @@ public static Builder builder() { } /** - * Builder for {@link ChildrenAggregation}. + * Builder for {@link ParentAggregationFields}. */ - public static class Builder extends BucketAggregationBase.AbstractBuilder - implements - CopyableBuilder { + public static class Builder extends ObjectBuilderBase implements CopyableBuilder { @Nullable private String type; public Builder() {} - private Builder(ChildrenAggregation o) { - super(o); + private Builder(ParentAggregationFields o) { this.type = o.type; } private Builder(Builder o) { - super(o); this.type = o.type; } @@ -138,12 +136,6 @@ public Builder copy() { return new Builder(this); } - @Override - @Nonnull - protected Builder self() { - return this; - } - /** * API name: {@code type} */ @@ -154,49 +146,45 @@ public final Builder type(@Nullable String value) { } /** - * Builds a {@link ChildrenAggregation}. + * Builds a {@link ParentAggregationFields}. * * @throws NullPointerException if some of the required fields are null. */ @Override @Nonnull - public ChildrenAggregation build() { + public ParentAggregationFields build() { _checkSingleUse(); - return new ChildrenAggregation(this); + return new ParentAggregationFields(this); } } // --------------------------------------------------------------------------------------------- /** - * Json deserializer for {@link ChildrenAggregation} + * Json deserializer for {@link ParentAggregationFields} */ - public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer.lazy( + public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer.lazy( Builder::new, - ChildrenAggregation::setupChildrenAggregationDeserializer + ParentAggregationFields::setupParentAggregationFieldsDeserializer ); - protected static void setupChildrenAggregationDeserializer(ObjectDeserializer op) { - setupBucketAggregationBaseDeserializer(op); + protected static void setupParentAggregationFieldsDeserializer(ObjectDeserializer op) { op.add(Builder::type, JsonpDeserializer.stringDeserializer(), "type"); } @Override public int hashCode() { - int result = super.hashCode(); + int result = 17; result = 31 * result + Objects.hashCode(this.type); return result; } @Override public boolean equals(Object o) { - if (!super.equals(o)) { - return false; - } if (this == o) return true; if (o == null || this.getClass() != o.getClass()) return false; - ChildrenAggregation other = (ChildrenAggregation) o; + ParentAggregationFields other = (ParentAggregationFields) o; return Objects.equals(this.type, other.type); } } diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/aggregations/PercentileRanksAggregation.java b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/aggregations/PercentileRanksAggregation.java index a232ff5c75..9dbceef1fa 100644 --- a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/aggregations/PercentileRanksAggregation.java +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/aggregations/PercentileRanksAggregation.java @@ -59,7 +59,6 @@ @Generated("org.opensearch.client.codegen.CodeGenerator") public class PercentileRanksAggregation extends FormatMetricAggregationBase implements - AggregationVariant, ToCopyableBuilder { @Nullable @@ -90,14 +89,6 @@ public static PercentileRanksAggregation of( return fn.apply(new Builder()).build(); } - /** - * {@link Aggregation} variant kind. - */ - @Override - public Aggregation.Kind _aggregationKind() { - return Aggregation.Kind.PercentileRanks; - } - /** * API name: {@code hdr} */ diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/aggregations/PercentilesAggregateBase.java b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/aggregations/PercentilesAggregateBase.java deleted file mode 100644 index f911308d51..0000000000 --- a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/aggregations/PercentilesAggregateBase.java +++ /dev/null @@ -1,139 +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.function.Function; -import javax.annotation.Generated; -import javax.annotation.Nonnull; -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.PercentilesAggregateBase - -@Generated("org.opensearch.client.codegen.CodeGenerator") -public abstract class PercentilesAggregateBase extends AggregateBase { - - @Nonnull - private final Percentiles values; - - // --------------------------------------------------------------------------------------------- - - protected PercentilesAggregateBase(AbstractBuilder builder) { - super(builder); - this.values = ApiTypeHelper.requireNonNull(builder.values, this, "values"); - } - - /** - * Required - API name: {@code values} - */ - @Nonnull - public final Percentiles values() { - return this.values; - } - - protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { - super.serializeInternal(generator, mapper); - generator.writeKey("values"); - this.values.serialize(generator, mapper); - } - - // --------------------------------------------------------------------------------------------- - - public abstract static class AbstractBuilder> extends AggregateBase.AbstractBuilder< - BuilderT> { - private Percentiles values; - - protected AbstractBuilder() {} - - protected AbstractBuilder(PercentilesAggregateBase o) { - super(o); - this.values = o.values; - } - - protected AbstractBuilder(AbstractBuilder o) { - super(o); - this.values = o.values; - } - - /** - * Required - API name: {@code values} - */ - @Nonnull - public final BuilderT values(Percentiles value) { - this.values = value; - return self(); - } - - /** - * Required - API name: {@code values} - */ - @Nonnull - public final BuilderT values(Function> fn) { - return values(fn.apply(new Percentiles.Builder()).build()); - } - } - - // --------------------------------------------------------------------------------------------- - - protected static > void setupPercentilesAggregateBaseDeserializer( - ObjectDeserializer op - ) { - setupAggregateBaseDeserializer(op); - op.add(AbstractBuilder::values, Percentiles._DESERIALIZER, "values"); - } - - @Override - public int hashCode() { - int result = super.hashCode(); - result = 31 * result + this.values.hashCode(); - return result; - } - - @Override - public boolean equals(Object o) { - if (!super.equals(o)) { - return false; - } - if (this == o) return true; - if (o == null || this.getClass() != o.getClass()) return false; - PercentilesAggregateBase other = (PercentilesAggregateBase) o; - return this.values.equals(other.values); - } -} diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/aggregations/PercentilesAggregation.java b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/aggregations/PercentilesAggregation.java index 9ae33bbc3a..122b6605fc 100644 --- a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/aggregations/PercentilesAggregation.java +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/aggregations/PercentilesAggregation.java @@ -59,7 +59,6 @@ @Generated("org.opensearch.client.codegen.CodeGenerator") public class PercentilesAggregation extends FormatMetricAggregationBase implements - AggregationVariant, ToCopyableBuilder { @Nullable @@ -88,14 +87,6 @@ public static PercentilesAggregation of(Function { + @Nonnull + private final Map meta; + + @Nonnull + private final Percentiles values; + // --------------------------------------------------------------------------------------------- private PercentilesBucketAggregate(Builder builder) { - super(builder); + this.meta = ApiTypeHelper.unmodifiable(builder.meta); + this.values = ApiTypeHelper.requireNonNull(builder.values, this, "values"); } public static PercentilesBucketAggregate of( @@ -76,6 +93,47 @@ public Aggregate.Kind _aggregateKind() { return Aggregate.Kind.PercentilesBucket; } + /** + * API name: {@code meta} + */ + @Nonnull + public final Map meta() { + return this.meta; + } + + /** + * Required - API name: {@code values} + */ + @Nonnull + public final Percentiles values() { + return this.values; + } + + /** + * Serialize this object to JSON. + */ + @Override + public void serialize(JsonGenerator generator, JsonpMapper mapper) { + generator.writeStartObject(); + serializeInternal(generator, mapper); + generator.writeEnd(); + } + + protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { + 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(); + } + + generator.writeKey("values"); + this.values.serialize(generator, mapper); + } + // --------------------------------------------------------------------------------------------- @Override @@ -92,18 +150,21 @@ public static Builder builder() { /** * Builder for {@link PercentilesBucketAggregate}. */ - public static class Builder extends PercentilesAggregateBase.AbstractBuilder - implements - CopyableBuilder { + public static class Builder extends ObjectBuilderBase implements CopyableBuilder { + @Nullable + private Map meta; + private Percentiles values; public Builder() {} private Builder(PercentilesBucketAggregate o) { - super(o); + this.meta = _mapCopy(o.meta); + this.values = o.values; } private Builder(Builder o) { - super(o); + this.meta = _mapCopy(o.meta); + this.values = o.values; } @Override @@ -112,12 +173,49 @@ 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; } + /** + * Required - API name: {@code values} + */ + @Nonnull + public final Builder values(Percentiles value) { + this.values = value; + return this; + } + + /** + * Required - API name: {@code values} + */ + @Nonnull + public final Builder values(Function> fn) { + return values(fn.apply(new Percentiles.Builder()).build()); + } + /** * Builds a {@link PercentilesBucketAggregate}. * @@ -143,22 +241,23 @@ public PercentilesBucketAggregate build() { ); protected static void setupPercentilesBucketAggregateDeserializer(ObjectDeserializer op) { - setupPercentilesAggregateBaseDeserializer(op); + op.add(Builder::meta, JsonpDeserializer.stringMapDeserializer(JsonData._DESERIALIZER), "meta"); + op.add(Builder::values, Percentiles._DESERIALIZER, "values"); } @Override public int hashCode() { - int result = super.hashCode(); + int result = 17; + result = 31 * result + Objects.hashCode(this.meta); + result = 31 * result + this.values.hashCode(); return result; } @Override public boolean equals(Object o) { - if (!super.equals(o)) { - return false; - } if (this == o) return true; if (o == null || this.getClass() != o.getClass()) return false; - return true; + PercentilesBucketAggregate other = (PercentilesBucketAggregate) o; + return Objects.equals(this.meta, other.meta) && this.values.equals(other.values); } } diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/aggregations/PercentilesBucketAggregation.java b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/aggregations/PercentilesBucketAggregation.java index 40342e194c..fb225775c9 100644 --- a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/aggregations/PercentilesBucketAggregation.java +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/aggregations/PercentilesBucketAggregation.java @@ -59,7 +59,6 @@ @Generated("org.opensearch.client.codegen.CodeGenerator") public class PercentilesBucketAggregation extends PipelineAggregationBase implements - AggregationVariant, ToCopyableBuilder { @Nonnull @@ -78,14 +77,6 @@ public static PercentilesBucketAggregation of( return fn.apply(new Builder()).build(); } - /** - * {@link Aggregation} variant kind. - */ - @Override - public Aggregation.Kind _aggregationKind() { - return Aggregation.Kind.PercentilesBucket; - } - /** * The list of percentiles to calculate. *

diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/aggregations/RangeAggregate.java b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/aggregations/RangeAggregate.java index 806699f3e0..175a1345df 100644 --- a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/aggregations/RangeAggregate.java +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/aggregations/RangeAggregate.java @@ -36,30 +36,43 @@ 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.JsonpDeserializable; import org.opensearch.client.json.JsonpDeserializer; +import org.opensearch.client.json.JsonpMapper; import org.opensearch.client.json.ObjectBuilderDeserializer; import org.opensearch.client.json.ObjectDeserializer; +import org.opensearch.client.json.PlainJsonSerializable; +import org.opensearch.client.util.ApiTypeHelper; import org.opensearch.client.util.CopyableBuilder; import org.opensearch.client.util.ObjectBuilder; +import org.opensearch.client.util.ObjectBuilderBase; import org.opensearch.client.util.ToCopyableBuilder; // typedef: _types.aggregations.RangeAggregate @JsonpDeserializable @Generated("org.opensearch.client.codegen.CodeGenerator") -public class RangeAggregate extends RangeAggregateBase - implements - AggregateVariant, - ToCopyableBuilder { +public class RangeAggregate implements AggregateVariant, PlainJsonSerializable, ToCopyableBuilder { + + @Nonnull + private final Buckets buckets; + + @Nonnull + private final Map meta; // --------------------------------------------------------------------------------------------- private RangeAggregate(Builder builder) { - super(builder); + this.buckets = ApiTypeHelper.requireNonNull(builder.buckets, this, "buckets"); + this.meta = ApiTypeHelper.unmodifiable(builder.meta); } public static RangeAggregate of(Function> fn) { @@ -74,6 +87,47 @@ public Aggregate.Kind _aggregateKind() { return Aggregate.Kind.Range; } + /** + * Required - API name: {@code buckets} + */ + @Nonnull + public final Buckets buckets() { + return this.buckets; + } + + /** + * API name: {@code meta} + */ + @Nonnull + public final Map meta() { + return this.meta; + } + + /** + * 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) { + generator.writeKey("buckets"); + this.buckets.serialize(generator, mapper); + + if (ApiTypeHelper.isDefined(this.meta)) { + generator.writeKey("meta"); + generator.writeStartObject(); + for (Map.Entry item0 : this.meta.entrySet()) { + generator.writeKey(item0.getKey()); + item0.getValue().serialize(generator, mapper); + } + generator.writeEnd(); + } + } + // --------------------------------------------------------------------------------------------- @Override @@ -90,16 +144,21 @@ public static Builder builder() { /** * Builder for {@link RangeAggregate}. */ - public static class Builder extends RangeAggregateBase.AbstractBuilder implements CopyableBuilder { + public static class Builder extends ObjectBuilderBase implements CopyableBuilder { + private Buckets buckets; + @Nullable + private Map meta; public Builder() {} private Builder(RangeAggregate o) { - super(o); + this.buckets = o.buckets; + this.meta = _mapCopy(o.meta); } private Builder(Builder o) { - super(o); + this.buckets = o.buckets; + this.meta = _mapCopy(o.meta); } @Override @@ -108,9 +167,46 @@ public Builder copy() { return new Builder(this); } - @Override + /** + * Required - API name: {@code buckets} + */ @Nonnull - protected Builder self() { + public final Builder buckets(Buckets value) { + this.buckets = value; + return this; + } + + /** + * Required - API name: {@code buckets} + */ + @Nonnull + public final Builder buckets(Function, ObjectBuilder>> fn) { + return buckets(fn.apply(new Buckets.Builder()).build()); + } + + /** + * 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 + public final Builder meta(String key, JsonData value) { + this.meta = _mapPut(this.meta, key, value); return this; } @@ -139,22 +235,23 @@ public RangeAggregate build() { ); protected static void setupRangeAggregateDeserializer(ObjectDeserializer op) { - setupRangeAggregateBaseDeserializer(op); + op.add(Builder::buckets, Buckets.createBucketsDeserializer(RangeBucket._DESERIALIZER), "buckets"); + op.add(Builder::meta, JsonpDeserializer.stringMapDeserializer(JsonData._DESERIALIZER), "meta"); } @Override public int hashCode() { - int result = super.hashCode(); + int result = 17; + result = 31 * result + this.buckets.hashCode(); + result = 31 * result + Objects.hashCode(this.meta); 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; + RangeAggregate other = (RangeAggregate) o; + return this.buckets.equals(other.buckets) && Objects.equals(this.meta, other.meta); } } diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/aggregations/RangeAggregation.java b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/aggregations/RangeAggregationFields.java similarity index 87% rename from java-client/src/generated/java/org/opensearch/client/opensearch/_types/aggregations/RangeAggregation.java rename to java-client/src/generated/java/org/opensearch/client/opensearch/_types/aggregations/RangeAggregationFields.java index f211e80fb4..ad981c7887 100644 --- a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/aggregations/RangeAggregation.java +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/aggregations/RangeAggregationFields.java @@ -48,20 +48,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.RangeAggregation +// typedef: _types.aggregations.RangeAggregationFields @JsonpDeserializable @Generated("org.opensearch.client.codegen.CodeGenerator") -public class RangeAggregation extends BucketAggregationBase +public class RangeAggregationFields implements - AggregationVariant, - ToCopyableBuilder { + PlainJsonSerializable, + ToCopyableBuilder { @Nullable private final String field; @@ -83,8 +85,7 @@ public class RangeAggregation extends BucketAggregationBase // --------------------------------------------------------------------------------------------- - private RangeAggregation(Builder builder) { - super(builder); + private RangeAggregationFields(Builder builder) { this.field = builder.field; this.format = builder.format; this.keyed = builder.keyed; @@ -93,18 +94,10 @@ private RangeAggregation(Builder builder) { this.script = builder.script; } - public static RangeAggregation of(Function> fn) { + public static RangeAggregationFields of(Function> fn) { return fn.apply(new Builder()).build(); } - /** - * {@link Aggregation} variant kind. - */ - @Override - public Aggregation.Kind _aggregationKind() { - return Aggregation.Kind.Range; - } - /** * API name: {@code field} */ @@ -162,8 +155,17 @@ public final Script script() { return this.script; } + /** + * Serialize this object to JSON. + */ + @Override + public void serialize(JsonGenerator generator, JsonpMapper mapper) { + generator.writeStartObject(); + serializeInternal(generator, mapper); + generator.writeEnd(); + } + protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { - super.serializeInternal(generator, mapper); if (this.field != null) { generator.writeKey("field"); generator.write(this.field); @@ -213,11 +215,9 @@ public static Builder builder() { } /** - * Builder for {@link RangeAggregation}. + * Builder for {@link RangeAggregationFields}. */ - public static class Builder extends BucketAggregationBase.AbstractBuilder - implements - CopyableBuilder { + public static class Builder extends ObjectBuilderBase implements CopyableBuilder { @Nullable private String field; @Nullable @@ -233,8 +233,7 @@ public static class Builder extends BucketAggregationBase.AbstractBuilder> fn) } /** - * Builds a {@link RangeAggregation}. + * Builds a {@link RangeAggregationFields}. * * @throws NullPointerException if some of the required fields are null. */ @Override @Nonnull - public RangeAggregation build() { + public RangeAggregationFields build() { _checkSingleUse(); - return new RangeAggregation(this); + return new RangeAggregationFields(this); } } // --------------------------------------------------------------------------------------------- /** - * Json deserializer for {@link RangeAggregation} + * Json deserializer for {@link RangeAggregationFields} */ - public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer.lazy( + public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer.lazy( Builder::new, - RangeAggregation::setupRangeAggregationDeserializer + RangeAggregationFields::setupRangeAggregationFieldsDeserializer ); - protected static void setupRangeAggregationDeserializer(ObjectDeserializer op) { - setupBucketAggregationBaseDeserializer(op); + protected static void setupRangeAggregationFieldsDeserializer(ObjectDeserializer op) { op.add(Builder::field, JsonpDeserializer.stringDeserializer(), "field"); op.add(Builder::format, JsonpDeserializer.stringDeserializer(), "format"); op.add(Builder::keyed, JsonpDeserializer.booleanDeserializer(), "keyed"); @@ -407,7 +398,7 @@ protected static void setupRangeAggregationDeserializer(ObjectDeserializer { + PlainJsonSerializable, + ToCopyableBuilder { @Nullable private final TermsExclude exclude; @@ -84,8 +86,7 @@ public class RareTermsAggregation extends BucketAggregationBase // --------------------------------------------------------------------------------------------- - private RareTermsAggregation(Builder builder) { - super(builder); + private RareTermsAggregationFields(Builder builder) { this.exclude = builder.exclude; this.field = builder.field; this.include = builder.include; @@ -95,18 +96,12 @@ private RareTermsAggregation(Builder builder) { this.valueType = builder.valueType; } - public static RareTermsAggregation of(Function> fn) { + public static RareTermsAggregationFields of( + Function> fn + ) { return fn.apply(new Builder()).build(); } - /** - * {@link Aggregation} variant kind. - */ - @Override - public Aggregation.Kind _aggregationKind() { - return Aggregation.Kind.RareTerms; - } - /** * API name: {@code exclude} */ @@ -169,8 +164,17 @@ public final String valueType() { return this.valueType; } + /** + * Serialize this object to JSON. + */ + @Override + public void serialize(JsonGenerator generator, JsonpMapper mapper) { + generator.writeStartObject(); + serializeInternal(generator, mapper); + generator.writeEnd(); + } + protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { - super.serializeInternal(generator, mapper); if (this.exclude != null) { generator.writeKey("exclude"); this.exclude.serialize(generator, mapper); @@ -221,11 +225,9 @@ public static Builder builder() { } /** - * Builder for {@link RareTermsAggregation}. + * Builder for {@link RareTermsAggregationFields}. */ - public static class Builder extends BucketAggregationBase.AbstractBuilder - implements - CopyableBuilder { + public static class Builder extends ObjectBuilderBase implements CopyableBuilder { @Nullable private TermsExclude exclude; @Nullable @@ -243,8 +245,7 @@ public static class Builder extends BucketAggregationBase.AbstractBuilder _DESERIALIZER = ObjectBuilderDeserializer.lazy( + public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer.lazy( Builder::new, - RareTermsAggregation::setupRareTermsAggregationDeserializer + RareTermsAggregationFields::setupRareTermsAggregationFieldsDeserializer ); - protected static void setupRareTermsAggregationDeserializer(ObjectDeserializer op) { - setupBucketAggregationBaseDeserializer(op); + protected static void setupRareTermsAggregationFieldsDeserializer(ObjectDeserializer op) { op.add(Builder::exclude, TermsExclude._DESERIALIZER, "exclude"); op.add(Builder::field, JsonpDeserializer.stringDeserializer(), "field"); op.add(Builder::include, TermsInclude._DESERIALIZER, "include"); @@ -407,7 +400,7 @@ protected static void setupRareTermsAggregationDeserializer(ObjectDeserializer { +public class RateAggregation extends FormatMetricAggregationBase implements ToCopyableBuilder { @Nullable private final RateMode mode; @@ -78,14 +75,6 @@ public static RateAggregation of(Function { + PlainJsonSerializable, + ToCopyableBuilder { @Nullable private final String path; // --------------------------------------------------------------------------------------------- - private ReverseNestedAggregation(Builder builder) { - super(builder); + private ReverseNestedAggregationFields(Builder builder) { this.path = builder.path; } - public static ReverseNestedAggregation of(Function> fn) { + public static ReverseNestedAggregationFields of( + Function> fn + ) { return fn.apply(new Builder()).build(); } - /** - * {@link Aggregation} variant kind. - */ - @Override - public Aggregation.Kind _aggregationKind() { - return Aggregation.Kind.ReverseNested; - } - /** * API name: {@code path} */ @@ -90,8 +85,17 @@ public final String path() { return this.path; } + /** + * Serialize this object to JSON. + */ + @Override + public void serialize(JsonGenerator generator, JsonpMapper mapper) { + generator.writeStartObject(); + serializeInternal(generator, mapper); + generator.writeEnd(); + } + protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { - super.serializeInternal(generator, mapper); if (this.path != null) { generator.writeKey("path"); generator.write(this.path); @@ -112,23 +116,19 @@ public static Builder builder() { } /** - * Builder for {@link ReverseNestedAggregation}. + * Builder for {@link ReverseNestedAggregationFields}. */ - public static class Builder extends BucketAggregationBase.AbstractBuilder - implements - CopyableBuilder { + public static class Builder extends ObjectBuilderBase implements CopyableBuilder { @Nullable private String path; public Builder() {} - private Builder(ReverseNestedAggregation o) { - super(o); + private Builder(ReverseNestedAggregationFields o) { this.path = o.path; } private Builder(Builder o) { - super(o); this.path = o.path; } @@ -138,12 +138,6 @@ public Builder copy() { return new Builder(this); } - @Override - @Nonnull - protected Builder self() { - return this; - } - /** * API name: {@code path} */ @@ -154,49 +148,45 @@ public final Builder path(@Nullable String value) { } /** - * Builds a {@link ReverseNestedAggregation}. + * Builds a {@link ReverseNestedAggregationFields}. * * @throws NullPointerException if some of the required fields are null. */ @Override @Nonnull - public ReverseNestedAggregation build() { + public ReverseNestedAggregationFields build() { _checkSingleUse(); - return new ReverseNestedAggregation(this); + return new ReverseNestedAggregationFields(this); } } // --------------------------------------------------------------------------------------------- /** - * Json deserializer for {@link ReverseNestedAggregation} + * Json deserializer for {@link ReverseNestedAggregationFields} */ - public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer.lazy( + public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer.lazy( Builder::new, - ReverseNestedAggregation::setupReverseNestedAggregationDeserializer + ReverseNestedAggregationFields::setupReverseNestedAggregationFieldsDeserializer ); - protected static void setupReverseNestedAggregationDeserializer(ObjectDeserializer op) { - setupBucketAggregationBaseDeserializer(op); + protected static void setupReverseNestedAggregationFieldsDeserializer(ObjectDeserializer op) { op.add(Builder::path, JsonpDeserializer.stringDeserializer(), "path"); } @Override public int hashCode() { - int result = super.hashCode(); + int result = 17; result = 31 * result + Objects.hashCode(this.path); return result; } @Override public boolean equals(Object o) { - if (!super.equals(o)) { - return false; - } if (this == o) return true; if (o == null || this.getClass() != o.getClass()) return false; - ReverseNestedAggregation other = (ReverseNestedAggregation) o; + ReverseNestedAggregationFields other = (ReverseNestedAggregationFields) o; return Objects.equals(this.path, other.path); } } diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/aggregations/SamplerAggregation.java b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/aggregations/SamplerAggregationFields.java similarity index 73% rename from java-client/src/generated/java/org/opensearch/client/opensearch/_types/aggregations/SamplerAggregation.java rename to java-client/src/generated/java/org/opensearch/client/opensearch/_types/aggregations/SamplerAggregationFields.java index 2bb3e5a944..6d2f2aff8d 100644 --- a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/aggregations/SamplerAggregation.java +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/aggregations/SamplerAggregationFields.java @@ -47,41 +47,34 @@ import org.opensearch.client.json.JsonpMapper; import org.opensearch.client.json.ObjectBuilderDeserializer; import org.opensearch.client.json.ObjectDeserializer; +import org.opensearch.client.json.PlainJsonSerializable; import org.opensearch.client.util.CopyableBuilder; import org.opensearch.client.util.ObjectBuilder; +import org.opensearch.client.util.ObjectBuilderBase; import org.opensearch.client.util.ToCopyableBuilder; -// typedef: _types.aggregations.SamplerAggregation +// typedef: _types.aggregations.SamplerAggregationFields @JsonpDeserializable @Generated("org.opensearch.client.codegen.CodeGenerator") -public class SamplerAggregation extends BucketAggregationBase +public class SamplerAggregationFields implements - AggregationVariant, - ToCopyableBuilder { + PlainJsonSerializable, + ToCopyableBuilder { @Nullable private final Integer shardSize; // --------------------------------------------------------------------------------------------- - private SamplerAggregation(Builder builder) { - super(builder); + private SamplerAggregationFields(Builder builder) { this.shardSize = builder.shardSize; } - public static SamplerAggregation of(Function> fn) { + public static SamplerAggregationFields of(Function> fn) { return fn.apply(new Builder()).build(); } - /** - * {@link Aggregation} variant kind. - */ - @Override - public Aggregation.Kind _aggregationKind() { - return Aggregation.Kind.Sampler; - } - /** * Limits how many top-scoring documents are collected in the sample processed on each shard. *

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

@@ -160,49 +152,45 @@ public final Builder shardSize(@Nullable Integer value) { } /** - * Builds a {@link SamplerAggregation}. + * Builds a {@link SamplerAggregationFields}. * * @throws NullPointerException if some of the required fields are null. */ @Override @Nonnull - public SamplerAggregation build() { + public SamplerAggregationFields build() { _checkSingleUse(); - return new SamplerAggregation(this); + return new SamplerAggregationFields(this); } } // --------------------------------------------------------------------------------------------- /** - * Json deserializer for {@link SamplerAggregation} + * Json deserializer for {@link SamplerAggregationFields} */ - public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer.lazy( + public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer.lazy( Builder::new, - SamplerAggregation::setupSamplerAggregationDeserializer + SamplerAggregationFields::setupSamplerAggregationFieldsDeserializer ); - protected static void setupSamplerAggregationDeserializer(ObjectDeserializer op) { - setupBucketAggregationBaseDeserializer(op); + protected static void setupSamplerAggregationFieldsDeserializer(ObjectDeserializer op) { op.add(Builder::shardSize, JsonpDeserializer.integerDeserializer(), "shard_size"); } @Override public int hashCode() { - int result = super.hashCode(); + int result = 17; result = 31 * result + Objects.hashCode(this.shardSize); return result; } @Override public boolean equals(Object o) { - if (!super.equals(o)) { - return false; - } if (this == o) return true; if (o == null || this.getClass() != o.getClass()) return false; - SamplerAggregation other = (SamplerAggregation) o; + SamplerAggregationFields other = (SamplerAggregationFields) o; return Objects.equals(this.shardSize, other.shardSize); } } diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/aggregations/ScriptedMetricAggregation.java b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/aggregations/ScriptedMetricAggregation.java index d34b433fce..bd53cac51a 100644 --- a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/aggregations/ScriptedMetricAggregation.java +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/aggregations/ScriptedMetricAggregation.java @@ -61,7 +61,6 @@ @Generated("org.opensearch.client.codegen.CodeGenerator") public class ScriptedMetricAggregation extends MetricAggregationBase implements - AggregationVariant, ToCopyableBuilder { @Nullable @@ -94,14 +93,6 @@ public static ScriptedMetricAggregation of(Function { @Nullable @@ -76,14 +75,6 @@ public static SerialDifferencingAggregation of( return fn.apply(new Builder()).build(); } - /** - * {@link Aggregation} variant kind. - */ - @Override - public Aggregation.Kind _aggregationKind() { - return Aggregation.Kind.SerialDiff; - } - /** * The historical bucket to subtract from the current value. Must be a positive, non-zero integer. *

diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/aggregations/SignificantLongTermsAggregate.java b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/aggregations/SignificantLongTermsAggregate.java index 801e9bb774..0f5eb9d7c9 100644 --- a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/aggregations/SignificantLongTermsAggregate.java +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/aggregations/SignificantLongTermsAggregate.java @@ -36,30 +36,55 @@ 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.JsonpDeserializable; import org.opensearch.client.json.JsonpDeserializer; +import org.opensearch.client.json.JsonpMapper; import org.opensearch.client.json.ObjectBuilderDeserializer; import org.opensearch.client.json.ObjectDeserializer; +import org.opensearch.client.json.PlainJsonSerializable; +import org.opensearch.client.util.ApiTypeHelper; import org.opensearch.client.util.CopyableBuilder; import org.opensearch.client.util.ObjectBuilder; +import org.opensearch.client.util.ObjectBuilderBase; import org.opensearch.client.util.ToCopyableBuilder; // typedef: _types.aggregations.SignificantLongTermsAggregate @JsonpDeserializable @Generated("org.opensearch.client.codegen.CodeGenerator") -public class SignificantLongTermsAggregate extends SignificantTermsAggregateBase +public class SignificantLongTermsAggregate implements AggregateVariant, + PlainJsonSerializable, ToCopyableBuilder { + @Nullable + private final Long bgCount; + + @Nonnull + private final Buckets buckets; + + @Nullable + private final Long docCount; + + @Nonnull + private final Map meta; + // --------------------------------------------------------------------------------------------- private SignificantLongTermsAggregate(Builder builder) { - super(builder); + this.bgCount = builder.bgCount; + this.buckets = ApiTypeHelper.requireNonNull(builder.buckets, this, "buckets"); + this.docCount = builder.docCount; + this.meta = ApiTypeHelper.unmodifiable(builder.meta); } public static SignificantLongTermsAggregate of( @@ -76,6 +101,73 @@ public Aggregate.Kind _aggregateKind() { return Aggregate.Kind.Siglterms; } + /** + * API name: {@code bg_count} + */ + @Nullable + public final Long bgCount() { + return this.bgCount; + } + + /** + * Required - API name: {@code buckets} + */ + @Nonnull + public final Buckets buckets() { + return this.buckets; + } + + /** + * API name: {@code doc_count} + */ + @Nullable + public final Long docCount() { + return this.docCount; + } + + /** + * API name: {@code meta} + */ + @Nonnull + public final Map meta() { + return this.meta; + } + + /** + * Serialize this object to JSON. + */ + @Override + public void serialize(JsonGenerator generator, JsonpMapper mapper) { + generator.writeStartObject(); + serializeInternal(generator, mapper); + generator.writeEnd(); + } + + protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { + if (this.bgCount != null) { + generator.writeKey("bg_count"); + generator.write(this.bgCount); + } + + generator.writeKey("buckets"); + this.buckets.serialize(generator, mapper); + + if (this.docCount != null) { + generator.writeKey("doc_count"); + generator.write(this.docCount); + } + + 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(); + } + } + // --------------------------------------------------------------------------------------------- @Override @@ -92,18 +184,29 @@ public static Builder builder() { /** * Builder for {@link SignificantLongTermsAggregate}. */ - public static class Builder extends SignificantTermsAggregateBase.AbstractBuilder - implements - CopyableBuilder { + public static class Builder extends ObjectBuilderBase implements CopyableBuilder { + @Nullable + private Long bgCount; + private Buckets buckets; + @Nullable + private Long docCount; + @Nullable + private Map meta; public Builder() {} private Builder(SignificantLongTermsAggregate o) { - super(o); + this.bgCount = o.bgCount; + this.buckets = o.buckets; + this.docCount = o.docCount; + this.meta = _mapCopy(o.meta); } private Builder(Builder o) { - super(o); + this.bgCount = o.bgCount; + this.buckets = o.buckets; + this.docCount = o.docCount; + this.meta = _mapCopy(o.meta); } @Override @@ -112,9 +215,66 @@ public Builder copy() { return new Builder(this); } - @Override + /** + * API name: {@code bg_count} + */ + @Nonnull + public final Builder bgCount(@Nullable Long value) { + this.bgCount = value; + return this; + } + + /** + * Required - API name: {@code buckets} + */ + @Nonnull + public final Builder buckets(Buckets value) { + this.buckets = value; + return this; + } + + /** + * Required - API name: {@code buckets} + */ + @Nonnull + public final Builder buckets( + Function, ObjectBuilder>> fn + ) { + return buckets(fn.apply(new Buckets.Builder()).build()); + } + + /** + * API name: {@code doc_count} + */ + @Nonnull + public final Builder docCount(@Nullable Long value) { + this.docCount = value; + return this; + } + + /** + * API name: {@code meta} + * + *

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

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

+ * Adds an entry to meta. + *

+ */ + @Nonnull + public final Builder meta(String key, JsonData value) { + this.meta = _mapPut(this.meta, key, value); return this; } @@ -143,22 +303,30 @@ public SignificantLongTermsAggregate build() { ); protected static void setupSignificantLongTermsAggregateDeserializer(ObjectDeserializer op) { - setupSignificantTermsAggregateBaseDeserializer(op, SignificantLongTermsBucket._DESERIALIZER); + op.add(Builder::bgCount, JsonpDeserializer.longDeserializer(), "bg_count"); + op.add(Builder::buckets, Buckets.createBucketsDeserializer(SignificantLongTermsBucket._DESERIALIZER), "buckets"); + op.add(Builder::docCount, JsonpDeserializer.longDeserializer(), "doc_count"); + op.add(Builder::meta, JsonpDeserializer.stringMapDeserializer(JsonData._DESERIALIZER), "meta"); } @Override public int hashCode() { - int result = super.hashCode(); + int result = 17; + result = 31 * result + Objects.hashCode(this.bgCount); + result = 31 * result + this.buckets.hashCode(); + result = 31 * result + Objects.hashCode(this.docCount); + result = 31 * result + Objects.hashCode(this.meta); 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; + SignificantLongTermsAggregate other = (SignificantLongTermsAggregate) o; + return Objects.equals(this.bgCount, other.bgCount) + && this.buckets.equals(other.buckets) + && Objects.equals(this.docCount, other.docCount) + && Objects.equals(this.meta, other.meta); } } diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/aggregations/SignificantStringTermsAggregate.java b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/aggregations/SignificantStringTermsAggregate.java index 3f9ccebf02..63f2313376 100644 --- a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/aggregations/SignificantStringTermsAggregate.java +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/aggregations/SignificantStringTermsAggregate.java @@ -36,30 +36,55 @@ 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.JsonpDeserializable; import org.opensearch.client.json.JsonpDeserializer; +import org.opensearch.client.json.JsonpMapper; import org.opensearch.client.json.ObjectBuilderDeserializer; import org.opensearch.client.json.ObjectDeserializer; +import org.opensearch.client.json.PlainJsonSerializable; +import org.opensearch.client.util.ApiTypeHelper; import org.opensearch.client.util.CopyableBuilder; import org.opensearch.client.util.ObjectBuilder; +import org.opensearch.client.util.ObjectBuilderBase; import org.opensearch.client.util.ToCopyableBuilder; // typedef: _types.aggregations.SignificantStringTermsAggregate @JsonpDeserializable @Generated("org.opensearch.client.codegen.CodeGenerator") -public class SignificantStringTermsAggregate extends SignificantTermsAggregateBase +public class SignificantStringTermsAggregate implements AggregateVariant, + PlainJsonSerializable, ToCopyableBuilder { + @Nullable + private final Long bgCount; + + @Nonnull + private final Buckets buckets; + + @Nullable + private final Long docCount; + + @Nonnull + private final Map meta; + // --------------------------------------------------------------------------------------------- private SignificantStringTermsAggregate(Builder builder) { - super(builder); + this.bgCount = builder.bgCount; + this.buckets = ApiTypeHelper.requireNonNull(builder.buckets, this, "buckets"); + this.docCount = builder.docCount; + this.meta = ApiTypeHelper.unmodifiable(builder.meta); } public static SignificantStringTermsAggregate of( @@ -76,6 +101,73 @@ public Aggregate.Kind _aggregateKind() { return Aggregate.Kind.Sigsterms; } + /** + * API name: {@code bg_count} + */ + @Nullable + public final Long bgCount() { + return this.bgCount; + } + + /** + * Required - API name: {@code buckets} + */ + @Nonnull + public final Buckets buckets() { + return this.buckets; + } + + /** + * API name: {@code doc_count} + */ + @Nullable + public final Long docCount() { + return this.docCount; + } + + /** + * API name: {@code meta} + */ + @Nonnull + public final Map meta() { + return this.meta; + } + + /** + * Serialize this object to JSON. + */ + @Override + public void serialize(JsonGenerator generator, JsonpMapper mapper) { + generator.writeStartObject(); + serializeInternal(generator, mapper); + generator.writeEnd(); + } + + protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { + if (this.bgCount != null) { + generator.writeKey("bg_count"); + generator.write(this.bgCount); + } + + generator.writeKey("buckets"); + this.buckets.serialize(generator, mapper); + + if (this.docCount != null) { + generator.writeKey("doc_count"); + generator.write(this.docCount); + } + + 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(); + } + } + // --------------------------------------------------------------------------------------------- @Override @@ -92,18 +184,29 @@ public static Builder builder() { /** * Builder for {@link SignificantStringTermsAggregate}. */ - public static class Builder extends SignificantTermsAggregateBase.AbstractBuilder - implements - CopyableBuilder { + public static class Builder extends ObjectBuilderBase implements CopyableBuilder { + @Nullable + private Long bgCount; + private Buckets buckets; + @Nullable + private Long docCount; + @Nullable + private Map meta; public Builder() {} private Builder(SignificantStringTermsAggregate o) { - super(o); + this.bgCount = o.bgCount; + this.buckets = o.buckets; + this.docCount = o.docCount; + this.meta = _mapCopy(o.meta); } private Builder(Builder o) { - super(o); + this.bgCount = o.bgCount; + this.buckets = o.buckets; + this.docCount = o.docCount; + this.meta = _mapCopy(o.meta); } @Override @@ -112,9 +215,66 @@ public Builder copy() { return new Builder(this); } - @Override + /** + * API name: {@code bg_count} + */ + @Nonnull + public final Builder bgCount(@Nullable Long value) { + this.bgCount = value; + return this; + } + + /** + * Required - API name: {@code buckets} + */ + @Nonnull + public final Builder buckets(Buckets value) { + this.buckets = value; + return this; + } + + /** + * Required - API name: {@code buckets} + */ + @Nonnull + public final Builder buckets( + Function, ObjectBuilder>> fn + ) { + return buckets(fn.apply(new Buckets.Builder()).build()); + } + + /** + * API name: {@code doc_count} + */ + @Nonnull + public final Builder docCount(@Nullable Long value) { + this.docCount = value; + return this; + } + + /** + * API name: {@code meta} + * + *

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

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

+ * Adds an entry to meta. + *

+ */ + @Nonnull + public final Builder meta(String key, JsonData value) { + this.meta = _mapPut(this.meta, key, value); return this; } @@ -143,22 +303,30 @@ public SignificantStringTermsAggregate build() { ); protected static void setupSignificantStringTermsAggregateDeserializer(ObjectDeserializer op) { - setupSignificantTermsAggregateBaseDeserializer(op, SignificantStringTermsBucket._DESERIALIZER); + op.add(Builder::bgCount, JsonpDeserializer.longDeserializer(), "bg_count"); + op.add(Builder::buckets, Buckets.createBucketsDeserializer(SignificantStringTermsBucket._DESERIALIZER), "buckets"); + op.add(Builder::docCount, JsonpDeserializer.longDeserializer(), "doc_count"); + op.add(Builder::meta, JsonpDeserializer.stringMapDeserializer(JsonData._DESERIALIZER), "meta"); } @Override public int hashCode() { - int result = super.hashCode(); + int result = 17; + result = 31 * result + Objects.hashCode(this.bgCount); + result = 31 * result + this.buckets.hashCode(); + result = 31 * result + Objects.hashCode(this.docCount); + result = 31 * result + Objects.hashCode(this.meta); 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; + SignificantStringTermsAggregate other = (SignificantStringTermsAggregate) o; + return Objects.equals(this.bgCount, other.bgCount) + && this.buckets.equals(other.buckets) + && Objects.equals(this.docCount, other.docCount) + && Objects.equals(this.meta, other.meta); } } diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/aggregations/SignificantTermsAggregateBase.java b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/aggregations/SignificantTermsAggregateBase.java deleted file mode 100644 index 1fbe8232be..0000000000 --- a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/aggregations/SignificantTermsAggregateBase.java +++ /dev/null @@ -1,167 +0,0 @@ -/* - * SPDX-License-Identifier: Apache-2.0 - * - * The OpenSearch Contributors require contributions made to - * this file be licensed under the Apache-2.0 license or a - * compatible open source license. - */ - -/* - * Licensed to Elasticsearch B.V. under one or more contributor - * license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright - * ownership. Elasticsearch B.V. licenses this file to you under - * the Apache License, Version 2.0 (the "License"); you may - * not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -/* - * Modifications Copyright OpenSearch Contributors. See - * GitHub history for details. - */ - -//---------------------------------------------------- -// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. -//---------------------------------------------------- - -package org.opensearch.client.opensearch._types.aggregations; - -import jakarta.json.stream.JsonGenerator; -import java.util.Objects; -import 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; - -// typedef: _types.aggregations.SignificantTermsAggregateBase - -@Generated("org.opensearch.client.codegen.CodeGenerator") -public abstract class SignificantTermsAggregateBase extends MultiBucketAggregateBase { - - @Nullable - private final Long bgCount; - - @Nullable - private final Long docCount; - - // --------------------------------------------------------------------------------------------- - - protected SignificantTermsAggregateBase(AbstractBuilder builder) { - super(builder); - this.bgCount = builder.bgCount; - this.docCount = builder.docCount; - } - - /** - * API name: {@code bg_count} - */ - @Nullable - public final Long bgCount() { - return this.bgCount; - } - - /** - * API name: {@code doc_count} - */ - @Nullable - public final Long docCount() { - return this.docCount; - } - - protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { - super.serializeInternal(generator, mapper); - if (this.bgCount != null) { - generator.writeKey("bg_count"); - generator.write(this.bgCount); - } - - if (this.docCount != null) { - generator.writeKey("doc_count"); - generator.write(this.docCount); - } - } - - // --------------------------------------------------------------------------------------------- - - public abstract static class AbstractBuilder> extends - MultiBucketAggregateBase.AbstractBuilder { - @Nullable - private Long bgCount; - @Nullable - private Long docCount; - - protected AbstractBuilder() {} - - protected AbstractBuilder(SignificantTermsAggregateBase o) { - super(o); - this.bgCount = o.bgCount; - this.docCount = o.docCount; - } - - protected AbstractBuilder(AbstractBuilder o) { - super(o); - this.bgCount = o.bgCount; - this.docCount = o.docCount; - } - - /** - * API name: {@code bg_count} - */ - @Nonnull - public final BuilderT bgCount(@Nullable Long value) { - this.bgCount = value; - return self(); - } - - /** - * API name: {@code doc_count} - */ - @Nonnull - public final BuilderT docCount(@Nullable Long value) { - this.docCount = value; - return self(); - } - } - - // --------------------------------------------------------------------------------------------- - - protected static > void setupSignificantTermsAggregateBaseDeserializer( - ObjectDeserializer op, - JsonpDeserializer tBucketDeserializer - ) { - setupMultiBucketAggregateBaseDeserializer(op, tBucketDeserializer); - op.add(AbstractBuilder::bgCount, JsonpDeserializer.longDeserializer(), "bg_count"); - op.add(AbstractBuilder::docCount, JsonpDeserializer.longDeserializer(), "doc_count"); - } - - @Override - public int hashCode() { - int result = super.hashCode(); - result = 31 * result + Objects.hashCode(this.bgCount); - result = 31 * result + Objects.hashCode(this.docCount); - 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; - SignificantTermsAggregateBase other = (SignificantTermsAggregateBase) o; - return Objects.equals(this.bgCount, other.bgCount) && Objects.equals(this.docCount, other.docCount); - } -} diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/aggregations/SignificantTermsAggregation.java b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/aggregations/SignificantTermsAggregationFields.java similarity index 92% rename from java-client/src/generated/java/org/opensearch/client/opensearch/_types/aggregations/SignificantTermsAggregation.java rename to java-client/src/generated/java/org/opensearch/client/opensearch/_types/aggregations/SignificantTermsAggregationFields.java index d3441f10ac..6bb67ae6e1 100644 --- a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/aggregations/SignificantTermsAggregation.java +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/aggregations/SignificantTermsAggregationFields.java @@ -47,20 +47,22 @@ import org.opensearch.client.json.JsonpMapper; import org.opensearch.client.json.ObjectBuilderDeserializer; import org.opensearch.client.json.ObjectDeserializer; +import org.opensearch.client.json.PlainJsonSerializable; import org.opensearch.client.opensearch._types.EmptyObject; import org.opensearch.client.opensearch._types.query_dsl.Query; import org.opensearch.client.util.CopyableBuilder; import org.opensearch.client.util.ObjectBuilder; +import org.opensearch.client.util.ObjectBuilderBase; import org.opensearch.client.util.ToCopyableBuilder; -// typedef: _types.aggregations.SignificantTermsAggregation +// typedef: _types.aggregations.SignificantTermsAggregationFields @JsonpDeserializable @Generated("org.opensearch.client.codegen.CodeGenerator") -public class SignificantTermsAggregation extends BucketAggregationBase +public class SignificantTermsAggregationFields implements - AggregationVariant, - ToCopyableBuilder { + PlainJsonSerializable, + ToCopyableBuilder { @Nullable private final Query backgroundFilter; @@ -109,8 +111,7 @@ public class SignificantTermsAggregation extends BucketAggregationBase // --------------------------------------------------------------------------------------------- - private SignificantTermsAggregation(Builder builder) { - super(builder); + private SignificantTermsAggregationFields(Builder builder) { this.backgroundFilter = builder.backgroundFilter; this.chiSquare = builder.chiSquare; this.exclude = builder.exclude; @@ -128,20 +129,12 @@ private SignificantTermsAggregation(Builder builder) { this.size = builder.size; } - public static SignificantTermsAggregation of( - Function> fn + public static SignificantTermsAggregationFields of( + Function> fn ) { return fn.apply(new Builder()).build(); } - /** - * {@link Aggregation} variant kind. - */ - @Override - public Aggregation.Kind _aggregationKind() { - return Aggregation.Kind.SignificantTerms; - } - /** * API name: {@code background_filter} */ @@ -277,8 +270,17 @@ public final Integer size() { return this.size; } + /** + * Serialize this object to JSON. + */ + @Override + public void serialize(JsonGenerator generator, JsonpMapper mapper) { + generator.writeStartObject(); + serializeInternal(generator, mapper); + generator.writeEnd(); + } + protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { - super.serializeInternal(generator, mapper); if (this.backgroundFilter != null) { generator.writeKey("background_filter"); this.backgroundFilter.serialize(generator, mapper); @@ -369,11 +371,9 @@ public static Builder builder() { } /** - * Builder for {@link SignificantTermsAggregation}. + * Builder for {@link SignificantTermsAggregationFields}. */ - public static class Builder extends BucketAggregationBase.AbstractBuilder - implements - CopyableBuilder { + public static class Builder extends ObjectBuilderBase implements CopyableBuilder { @Nullable private Query backgroundFilter; @Nullable @@ -407,8 +407,7 @@ public static class Builder extends BucketAggregationBase.AbstractBuilder _DESERIALIZER = ObjectBuilderDeserializer.lazy( + public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer.lazy( Builder::new, - SignificantTermsAggregation::setupSignificantTermsAggregationDeserializer + SignificantTermsAggregationFields::setupSignificantTermsAggregationFieldsDeserializer ); - protected static void setupSignificantTermsAggregationDeserializer(ObjectDeserializer op) { - setupBucketAggregationBaseDeserializer(op); + protected static void setupSignificantTermsAggregationFieldsDeserializer( + ObjectDeserializer op + ) { op.add(Builder::backgroundFilter, Query._DESERIALIZER, "background_filter"); op.add(Builder::chiSquare, ChiSquareHeuristic._DESERIALIZER, "chi_square"); op.add(Builder::exclude, TermsExclude._DESERIALIZER, "exclude"); @@ -724,7 +717,7 @@ protected static void setupSignificantTermsAggregationDeserializer(ObjectDeseria @Override public int hashCode() { - int result = super.hashCode(); + int result = 17; result = 31 * result + Objects.hashCode(this.backgroundFilter); result = 31 * result + Objects.hashCode(this.chiSquare); result = 31 * result + Objects.hashCode(this.exclude); @@ -745,12 +738,9 @@ public int hashCode() { @Override public boolean equals(Object o) { - if (!super.equals(o)) { - return false; - } if (this == o) return true; if (o == null || this.getClass() != o.getClass()) return false; - SignificantTermsAggregation other = (SignificantTermsAggregation) o; + SignificantTermsAggregationFields other = (SignificantTermsAggregationFields) o; return Objects.equals(this.backgroundFilter, other.backgroundFilter) && Objects.equals(this.chiSquare, other.chiSquare) && Objects.equals(this.exclude, other.exclude) diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/aggregations/SignificantTextAggregation.java b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/aggregations/SignificantTextAggregationFields.java similarity index 93% rename from java-client/src/generated/java/org/opensearch/client/opensearch/_types/aggregations/SignificantTextAggregation.java rename to java-client/src/generated/java/org/opensearch/client/opensearch/_types/aggregations/SignificantTextAggregationFields.java index 53e22f9abc..0d314d487f 100644 --- a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/aggregations/SignificantTextAggregation.java +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/aggregations/SignificantTextAggregationFields.java @@ -48,21 +48,23 @@ import org.opensearch.client.json.JsonpMapper; import org.opensearch.client.json.ObjectBuilderDeserializer; import org.opensearch.client.json.ObjectDeserializer; +import org.opensearch.client.json.PlainJsonSerializable; import org.opensearch.client.opensearch._types.EmptyObject; import org.opensearch.client.opensearch._types.query_dsl.Query; import org.opensearch.client.util.ApiTypeHelper; import org.opensearch.client.util.CopyableBuilder; import org.opensearch.client.util.ObjectBuilder; +import org.opensearch.client.util.ObjectBuilderBase; import org.opensearch.client.util.ToCopyableBuilder; -// typedef: _types.aggregations.SignificantTextAggregation +// typedef: _types.aggregations.SignificantTextAggregationFields @JsonpDeserializable @Generated("org.opensearch.client.codegen.CodeGenerator") -public class SignificantTextAggregation extends BucketAggregationBase +public class SignificantTextAggregationFields implements - AggregationVariant, - ToCopyableBuilder { + PlainJsonSerializable, + ToCopyableBuilder { @Nullable private final Query backgroundFilter; @@ -117,8 +119,7 @@ public class SignificantTextAggregation extends BucketAggregationBase // --------------------------------------------------------------------------------------------- - private SignificantTextAggregation(Builder builder) { - super(builder); + private SignificantTextAggregationFields(Builder builder) { this.backgroundFilter = builder.backgroundFilter; this.chiSquare = builder.chiSquare; this.exclude = builder.exclude; @@ -138,20 +139,12 @@ private SignificantTextAggregation(Builder builder) { this.sourceFields = ApiTypeHelper.unmodifiable(builder.sourceFields); } - public static SignificantTextAggregation of( - Function> fn + public static SignificantTextAggregationFields of( + Function> fn ) { return fn.apply(new Builder()).build(); } - /** - * {@link Aggregation} variant kind. - */ - @Override - public Aggregation.Kind _aggregationKind() { - return Aggregation.Kind.SignificantText; - } - /** * API name: {@code background_filter} */ @@ -306,8 +299,17 @@ public final List sourceFields() { return this.sourceFields; } + /** + * Serialize this object to JSON. + */ + @Override + public void serialize(JsonGenerator generator, JsonpMapper mapper) { + generator.writeStartObject(); + serializeInternal(generator, mapper); + generator.writeEnd(); + } + protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { - super.serializeInternal(generator, mapper); if (this.backgroundFilter != null) { generator.writeKey("background_filter"); this.backgroundFilter.serialize(generator, mapper); @@ -412,11 +414,9 @@ public static Builder builder() { } /** - * Builder for {@link SignificantTextAggregation}. + * Builder for {@link SignificantTextAggregationFields}. */ - public static class Builder extends BucketAggregationBase.AbstractBuilder - implements - CopyableBuilder { + public static class Builder extends ObjectBuilderBase implements CopyableBuilder { @Nullable private Query backgroundFilter; @Nullable @@ -454,8 +454,7 @@ public static class Builder extends BucketAggregationBase.AbstractBuilder _DESERIALIZER = ObjectBuilderDeserializer.lazy( + public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer.lazy( Builder::new, - SignificantTextAggregation::setupSignificantTextAggregationDeserializer + SignificantTextAggregationFields::setupSignificantTextAggregationFieldsDeserializer ); - protected static void setupSignificantTextAggregationDeserializer(ObjectDeserializer op) { - setupBucketAggregationBaseDeserializer(op); + protected static void setupSignificantTextAggregationFieldsDeserializer( + ObjectDeserializer op + ) { op.add(Builder::backgroundFilter, Query._DESERIALIZER, "background_filter"); op.add(Builder::chiSquare, ChiSquareHeuristic._DESERIALIZER, "chi_square"); op.add(Builder::exclude, TermsExclude._DESERIALIZER, "exclude"); @@ -815,7 +808,7 @@ protected static void setupSignificantTextAggregationDeserializer(ObjectDeserial @Override public int hashCode() { - int result = super.hashCode(); + int result = 17; result = 31 * result + Objects.hashCode(this.backgroundFilter); result = 31 * result + Objects.hashCode(this.chiSquare); result = 31 * result + Objects.hashCode(this.exclude); @@ -838,12 +831,9 @@ public int hashCode() { @Override public boolean equals(Object o) { - if (!super.equals(o)) { - return false; - } if (this == o) return true; if (o == null || this.getClass() != o.getClass()) return false; - SignificantTextAggregation other = (SignificantTextAggregation) o; + SignificantTextAggregationFields other = (SignificantTextAggregationFields) o; return Objects.equals(this.backgroundFilter, other.backgroundFilter) && Objects.equals(this.chiSquare, other.chiSquare) && Objects.equals(this.exclude, other.exclude) diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/aggregations/SimpleValueAggregate.java b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/aggregations/SimpleValueAggregate.java index f786621b03..bf128e1e45 100644 --- a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/aggregations/SimpleValueAggregate.java +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/aggregations/SimpleValueAggregate.java @@ -36,30 +36,51 @@ 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.JsonpDeserializable; import org.opensearch.client.json.JsonpDeserializer; +import org.opensearch.client.json.JsonpMapper; import org.opensearch.client.json.ObjectBuilderDeserializer; import org.opensearch.client.json.ObjectDeserializer; +import org.opensearch.client.json.PlainJsonSerializable; +import org.opensearch.client.util.ApiTypeHelper; import org.opensearch.client.util.CopyableBuilder; import org.opensearch.client.util.ObjectBuilder; +import org.opensearch.client.util.ObjectBuilderBase; import org.opensearch.client.util.ToCopyableBuilder; // typedef: _types.aggregations.SimpleValueAggregate @JsonpDeserializable @Generated("org.opensearch.client.codegen.CodeGenerator") -public class SimpleValueAggregate extends SingleMetricAggregateBase +public class SimpleValueAggregate implements AggregateVariant, + PlainJsonSerializable, ToCopyableBuilder { + @Nonnull + private final Map meta; + + @Nullable + private final Double value; + + @Nullable + private final String valueAsString; + // --------------------------------------------------------------------------------------------- private SimpleValueAggregate(Builder builder) { - super(builder); + this.meta = ApiTypeHelper.unmodifiable(builder.meta); + this.value = builder.value; + this.valueAsString = builder.valueAsString; } public static SimpleValueAggregate of(Function> fn) { @@ -74,6 +95,65 @@ public Aggregate.Kind _aggregateKind() { return Aggregate.Kind.SimpleValue; } + /** + * 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 +170,26 @@ public static Builder builder() { /** * Builder for {@link SimpleValueAggregate}. */ - 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(SimpleValueAggregate 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 +198,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 +270,27 @@ public SimpleValueAggregate build() { ); protected static void setupSimpleValueAggregateDeserializer(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; + SimpleValueAggregate other = (SimpleValueAggregate) 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/SingleBucketAggregateBase.java b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/aggregations/SingleBucketAggregateBase.java index 826a639a65..9ab20d9867 100644 --- a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/aggregations/SingleBucketAggregateBase.java +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/aggregations/SingleBucketAggregateBase.java @@ -69,6 +69,9 @@ protected SingleBucketAggregateBase(AbstractBuilder builder) { this.docCount = ApiTypeHelper.requireNonNull(builder.docCount, this, "docCount"); } + /** + * Nested aggregations. + */ @Nonnull public final Map aggregations() { return this.aggregations; @@ -111,6 +114,7 @@ protected AbstractBuilder(AbstractBuilder o) { } /** + * Nested aggregations. * *

* Adds all elements of map to aggregations. @@ -123,6 +127,7 @@ public final BuilderT aggregations(Map map) { } /** + * Nested aggregations. * *

* Adds an entry to aggregations. @@ -135,6 +140,7 @@ public final BuilderT aggregations(String key, Aggregate value) { } /** + * Nested aggregations. * *

* Adds a value to aggregations using a builder lambda. diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/aggregations/StatsAggregation.java b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/aggregations/StatsAggregation.java index 1f0351ce62..58cdd6f13a 100644 --- a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/aggregations/StatsAggregation.java +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/aggregations/StatsAggregation.java @@ -51,10 +51,7 @@ @JsonpDeserializable @Generated("org.opensearch.client.codegen.CodeGenerator") -public class StatsAggregation extends FormatMetricAggregationBase - implements - AggregationVariant, - ToCopyableBuilder { +public class StatsAggregation extends FormatMetricAggregationBase implements ToCopyableBuilder { // --------------------------------------------------------------------------------------------- @@ -66,14 +63,6 @@ public static StatsAggregation of(Function { + @Nullable + private final Double avg; + + @Nullable + private final String avgAsString; + + private final long count; + + @Nullable + private final Double max; + + @Nullable + private final String maxAsString; + + @Nonnull + private final Map meta; + + @Nullable + private final Double min; + + @Nullable + private final String minAsString; + + private final double sum; + + @Nullable + private final String sumAsString; + // --------------------------------------------------------------------------------------------- private StatsBucketAggregate(Builder builder) { - super(builder); + this.avg = builder.avg; + this.avgAsString = builder.avgAsString; + this.count = ApiTypeHelper.requireNonNull(builder.count, this, "count"); + this.max = builder.max; + this.maxAsString = builder.maxAsString; + this.meta = ApiTypeHelper.unmodifiable(builder.meta); + this.min = builder.min; + this.minAsString = builder.minAsString; + this.sum = ApiTypeHelper.requireNonNull(builder.sum, this, "sum"); + this.sumAsString = builder.sumAsString; } public static StatsBucketAggregate of(Function> fn) { @@ -74,6 +121,147 @@ public Aggregate.Kind _aggregateKind() { return Aggregate.Kind.StatsBucket; } + /** + * API name: {@code avg} + */ + @Nullable + public final Double avg() { + return this.avg; + } + + /** + * API name: {@code avg_as_string} + */ + @Nullable + public final String avgAsString() { + return this.avgAsString; + } + + /** + * Required - API name: {@code count} + */ + public final long count() { + return this.count; + } + + /** + * API name: {@code max} + */ + @Nullable + public final Double max() { + return this.max; + } + + /** + * API name: {@code max_as_string} + */ + @Nullable + public final String maxAsString() { + return this.maxAsString; + } + + /** + * API name: {@code meta} + */ + @Nonnull + public final Map meta() { + return this.meta; + } + + /** + * API name: {@code min} + */ + @Nullable + public final Double min() { + return this.min; + } + + /** + * API name: {@code min_as_string} + */ + @Nullable + public final String minAsString() { + return this.minAsString; + } + + /** + * Required - API name: {@code sum} + */ + public final double sum() { + return this.sum; + } + + /** + * API name: {@code sum_as_string} + */ + @Nullable + public final String sumAsString() { + return this.sumAsString; + } + + /** + * Serialize this object to JSON. + */ + @Override + public void serialize(JsonGenerator generator, JsonpMapper mapper) { + generator.writeStartObject(); + serializeInternal(generator, mapper); + generator.writeEnd(); + } + + protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { + if (this.avg != null) { + generator.writeKey("avg"); + generator.write(this.avg); + } + + if (this.avgAsString != null) { + generator.writeKey("avg_as_string"); + generator.write(this.avgAsString); + } + + generator.writeKey("count"); + generator.write(this.count); + + if (this.max != null) { + generator.writeKey("max"); + generator.write(this.max); + } + + if (this.maxAsString != null) { + generator.writeKey("max_as_string"); + generator.write(this.maxAsString); + } + + 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.min != null) { + generator.writeKey("min"); + generator.write(this.min); + } + + if (this.minAsString != null) { + generator.writeKey("min_as_string"); + generator.write(this.minAsString); + } + + generator.writeKey("sum"); + generator.write(this.sum); + + if (this.sumAsString != null) { + generator.writeKey("sum_as_string"); + generator.write(this.sumAsString); + } + } + // --------------------------------------------------------------------------------------------- @Override @@ -90,18 +278,52 @@ public static Builder builder() { /** * Builder for {@link StatsBucketAggregate}. */ - public static class Builder extends StatsAggregateBase.AbstractBuilder - implements - CopyableBuilder { + public static class Builder extends ObjectBuilderBase implements CopyableBuilder { + @Nullable + private Double avg; + @Nullable + private String avgAsString; + private Long count; + @Nullable + private Double max; + @Nullable + private String maxAsString; + @Nullable + private Map meta; + @Nullable + private Double min; + @Nullable + private String minAsString; + private Double sum; + @Nullable + private String sumAsString; public Builder() {} private Builder(StatsBucketAggregate o) { - super(o); + this.avg = o.avg; + this.avgAsString = o.avgAsString; + this.count = o.count; + this.max = o.max; + this.maxAsString = o.maxAsString; + this.meta = _mapCopy(o.meta); + this.min = o.min; + this.minAsString = o.minAsString; + this.sum = o.sum; + this.sumAsString = o.sumAsString; } private Builder(Builder o) { - super(o); + this.avg = o.avg; + this.avgAsString = o.avgAsString; + this.count = o.count; + this.max = o.max; + this.maxAsString = o.maxAsString; + this.meta = _mapCopy(o.meta); + this.min = o.min; + this.minAsString = o.minAsString; + this.sum = o.sum; + this.sumAsString = o.sumAsString; } @Override @@ -110,9 +332,110 @@ public Builder copy() { return new Builder(this); } - @Override + /** + * API name: {@code avg} + */ + @Nonnull + public final Builder avg(@Nullable Double value) { + this.avg = value; + return this; + } + + /** + * API name: {@code avg_as_string} + */ + @Nonnull + public final Builder avgAsString(@Nullable String value) { + this.avgAsString = value; + return this; + } + + /** + * Required - API name: {@code count} + */ + @Nonnull + public final Builder count(long value) { + this.count = value; + return this; + } + + /** + * API name: {@code max} + */ + @Nonnull + public final Builder max(@Nullable Double value) { + this.max = value; + return this; + } + + /** + * API name: {@code max_as_string} + */ @Nonnull - protected Builder self() { + public final Builder maxAsString(@Nullable String value) { + this.maxAsString = value; + return this; + } + + /** + * 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 + public final Builder meta(String key, JsonData value) { + this.meta = _mapPut(this.meta, key, value); + return this; + } + + /** + * API name: {@code min} + */ + @Nonnull + public final Builder min(@Nullable Double value) { + this.min = value; + return this; + } + + /** + * API name: {@code min_as_string} + */ + @Nonnull + public final Builder minAsString(@Nullable String value) { + this.minAsString = value; + return this; + } + + /** + * Required - API name: {@code sum} + */ + @Nonnull + public final Builder sum(double value) { + this.sum = value; + return this; + } + + /** + * API name: {@code sum_as_string} + */ + @Nonnull + public final Builder sumAsString(@Nullable String value) { + this.sumAsString = value; return this; } @@ -141,22 +464,48 @@ public StatsBucketAggregate build() { ); protected static void setupStatsBucketAggregateDeserializer(ObjectDeserializer op) { - setupStatsAggregateBaseDeserializer(op); + op.add(Builder::avg, JsonpDeserializer.doubleDeserializer(), "avg"); + op.add(Builder::avgAsString, JsonpDeserializer.stringDeserializer(), "avg_as_string"); + op.add(Builder::count, JsonpDeserializer.longDeserializer(), "count"); + op.add(Builder::max, JsonpDeserializer.doubleDeserializer(), "max"); + op.add(Builder::maxAsString, JsonpDeserializer.stringDeserializer(), "max_as_string"); + op.add(Builder::meta, JsonpDeserializer.stringMapDeserializer(JsonData._DESERIALIZER), "meta"); + op.add(Builder::min, JsonpDeserializer.doubleDeserializer(), "min"); + op.add(Builder::minAsString, JsonpDeserializer.stringDeserializer(), "min_as_string"); + op.add(Builder::sum, JsonpDeserializer.doubleDeserializer(), "sum"); + op.add(Builder::sumAsString, JsonpDeserializer.stringDeserializer(), "sum_as_string"); } @Override public int hashCode() { - int result = super.hashCode(); + int result = 17; + result = 31 * result + Objects.hashCode(this.avg); + result = 31 * result + Objects.hashCode(this.avgAsString); + result = 31 * result + Long.hashCode(this.count); + result = 31 * result + Objects.hashCode(this.max); + result = 31 * result + Objects.hashCode(this.maxAsString); + result = 31 * result + Objects.hashCode(this.meta); + result = 31 * result + Objects.hashCode(this.min); + result = 31 * result + Objects.hashCode(this.minAsString); + result = 31 * result + Double.hashCode(this.sum); + result = 31 * result + Objects.hashCode(this.sumAsString); 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; + StatsBucketAggregate other = (StatsBucketAggregate) o; + return Objects.equals(this.avg, other.avg) + && Objects.equals(this.avgAsString, other.avgAsString) + && this.count == other.count + && Objects.equals(this.max, other.max) + && Objects.equals(this.maxAsString, other.maxAsString) + && Objects.equals(this.meta, other.meta) + && Objects.equals(this.min, other.min) + && Objects.equals(this.minAsString, other.minAsString) + && this.sum == other.sum + && Objects.equals(this.sumAsString, other.sumAsString); } } diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/aggregations/StatsBucketAggregation.java b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/aggregations/StatsBucketAggregation.java index ec1fd16b05..ae24a23d5e 100644 --- a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/aggregations/StatsBucketAggregation.java +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/aggregations/StatsBucketAggregation.java @@ -53,7 +53,6 @@ @Generated("org.opensearch.client.codegen.CodeGenerator") public class StatsBucketAggregation extends PipelineAggregationBase implements - AggregationVariant, ToCopyableBuilder { // --------------------------------------------------------------------------------------------- @@ -66,14 +65,6 @@ public static StatsBucketAggregation of(Function +public class StringTermsAggregate extends TermsAggregateBase implements AggregateVariant, ToCopyableBuilder { @@ -93,7 +94,7 @@ public static Builder builder() { /** * Builder for {@link StringTermsAggregate}. */ - public static class Builder extends TermsAggregateBase.AbstractBuilder + public static class Builder extends TermsAggregateBase.AbstractBuilder implements CopyableBuilder { @@ -144,7 +145,7 @@ public StringTermsAggregate build() { ); protected static void setupStringTermsAggregateDeserializer(ObjectDeserializer op) { - setupTermsAggregateBaseDeserializer(op, StringTermsBucket._DESERIALIZER); + setupTermsAggregateBaseDeserializer(op, JsonData._DESERIALIZER); } @Override diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/aggregations/SumAggregate.java b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/aggregations/SumAggregate.java index 2a759fd4e9..aff30c02ad 100644 --- a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/aggregations/SumAggregate.java +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/aggregations/SumAggregate.java @@ -36,30 +36,47 @@ 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.JsonpDeserializable; import org.opensearch.client.json.JsonpDeserializer; +import org.opensearch.client.json.JsonpMapper; import org.opensearch.client.json.ObjectBuilderDeserializer; import org.opensearch.client.json.ObjectDeserializer; +import org.opensearch.client.json.PlainJsonSerializable; +import org.opensearch.client.util.ApiTypeHelper; import org.opensearch.client.util.CopyableBuilder; import org.opensearch.client.util.ObjectBuilder; +import org.opensearch.client.util.ObjectBuilderBase; import org.opensearch.client.util.ToCopyableBuilder; // typedef: _types.aggregations.SumAggregate @JsonpDeserializable @Generated("org.opensearch.client.codegen.CodeGenerator") -public class SumAggregate extends SingleMetricAggregateBase - implements - AggregateVariant, - ToCopyableBuilder { +public class SumAggregate implements AggregateVariant, PlainJsonSerializable, ToCopyableBuilder { + + @Nonnull + private final Map meta; + + @Nullable + private final Double value; + + @Nullable + private final String valueAsString; // --------------------------------------------------------------------------------------------- private SumAggregate(Builder builder) { - super(builder); + this.meta = ApiTypeHelper.unmodifiable(builder.meta); + this.value = builder.value; + this.valueAsString = builder.valueAsString; } public static SumAggregate of(Function> fn) { @@ -74,6 +91,65 @@ public Aggregate.Kind _aggregateKind() { return Aggregate.Kind.Sum; } + /** + * 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 SumAggregate}. */ - 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(SumAggregate 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 SumAggregate build() { ); protected static void setupSumAggregateDeserializer(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; + SumAggregate other = (SumAggregate) 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/SumAggregation.java b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/aggregations/SumAggregation.java index 8949ee1f1a..beda85044c 100644 --- a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/aggregations/SumAggregation.java +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/aggregations/SumAggregation.java @@ -51,10 +51,7 @@ @JsonpDeserializable @Generated("org.opensearch.client.codegen.CodeGenerator") -public class SumAggregation extends FormatMetricAggregationBase - implements - AggregationVariant, - ToCopyableBuilder { +public class SumAggregation extends FormatMetricAggregationBase implements ToCopyableBuilder { // --------------------------------------------------------------------------------------------- @@ -66,14 +63,6 @@ public static SumAggregation of(Function { // --------------------------------------------------------------------------------------------- @@ -66,14 +65,6 @@ public static SumBucketAggregation of(Function { + @Nonnull + private final Map meta; + + @Nonnull + private final Percentiles values; + // --------------------------------------------------------------------------------------------- private TDigestPercentileRanksAggregate(Builder builder) { - super(builder); + this.meta = ApiTypeHelper.unmodifiable(builder.meta); + this.values = ApiTypeHelper.requireNonNull(builder.values, this, "values"); } public static TDigestPercentileRanksAggregate of( @@ -76,6 +93,47 @@ public Aggregate.Kind _aggregateKind() { return Aggregate.Kind.TdigestPercentileRanks; } + /** + * API name: {@code meta} + */ + @Nonnull + public final Map meta() { + return this.meta; + } + + /** + * Required - API name: {@code values} + */ + @Nonnull + public final Percentiles values() { + return this.values; + } + + /** + * Serialize this object to JSON. + */ + @Override + public void serialize(JsonGenerator generator, JsonpMapper mapper) { + generator.writeStartObject(); + serializeInternal(generator, mapper); + generator.writeEnd(); + } + + protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { + 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(); + } + + generator.writeKey("values"); + this.values.serialize(generator, mapper); + } + // --------------------------------------------------------------------------------------------- @Override @@ -92,18 +150,21 @@ public static Builder builder() { /** * Builder for {@link TDigestPercentileRanksAggregate}. */ - public static class Builder extends PercentilesAggregateBase.AbstractBuilder - implements - CopyableBuilder { + public static class Builder extends ObjectBuilderBase implements CopyableBuilder { + @Nullable + private Map meta; + private Percentiles values; public Builder() {} private Builder(TDigestPercentileRanksAggregate o) { - super(o); + this.meta = _mapCopy(o.meta); + this.values = o.values; } private Builder(Builder o) { - super(o); + this.meta = _mapCopy(o.meta); + this.values = o.values; } @Override @@ -112,12 +173,49 @@ 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; } + /** + * Required - API name: {@code values} + */ + @Nonnull + public final Builder values(Percentiles value) { + this.values = value; + return this; + } + + /** + * Required - API name: {@code values} + */ + @Nonnull + public final Builder values(Function> fn) { + return values(fn.apply(new Percentiles.Builder()).build()); + } + /** * Builds a {@link TDigestPercentileRanksAggregate}. * @@ -143,22 +241,23 @@ public TDigestPercentileRanksAggregate build() { ); protected static void setupTDigestPercentileRanksAggregateDeserializer(ObjectDeserializer op) { - setupPercentilesAggregateBaseDeserializer(op); + op.add(Builder::meta, JsonpDeserializer.stringMapDeserializer(JsonData._DESERIALIZER), "meta"); + op.add(Builder::values, Percentiles._DESERIALIZER, "values"); } @Override public int hashCode() { - int result = super.hashCode(); + int result = 17; + result = 31 * result + Objects.hashCode(this.meta); + result = 31 * result + this.values.hashCode(); return result; } @Override public boolean equals(Object o) { - if (!super.equals(o)) { - return false; - } if (this == o) return true; if (o == null || this.getClass() != o.getClass()) return false; - return true; + TDigestPercentileRanksAggregate other = (TDigestPercentileRanksAggregate) o; + return Objects.equals(this.meta, other.meta) && this.values.equals(other.values); } } diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/aggregations/TDigestPercentilesAggregate.java b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/aggregations/TDigestPercentilesAggregate.java index 8e58fceacb..101ae47281 100644 --- a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/aggregations/TDigestPercentilesAggregate.java +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/aggregations/TDigestPercentilesAggregate.java @@ -36,30 +36,47 @@ 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.JsonpDeserializable; import org.opensearch.client.json.JsonpDeserializer; +import org.opensearch.client.json.JsonpMapper; import org.opensearch.client.json.ObjectBuilderDeserializer; import org.opensearch.client.json.ObjectDeserializer; +import org.opensearch.client.json.PlainJsonSerializable; +import org.opensearch.client.util.ApiTypeHelper; import org.opensearch.client.util.CopyableBuilder; import org.opensearch.client.util.ObjectBuilder; +import org.opensearch.client.util.ObjectBuilderBase; import org.opensearch.client.util.ToCopyableBuilder; // typedef: _types.aggregations.TDigestPercentilesAggregate @JsonpDeserializable @Generated("org.opensearch.client.codegen.CodeGenerator") -public class TDigestPercentilesAggregate extends PercentilesAggregateBase +public class TDigestPercentilesAggregate implements AggregateVariant, + PlainJsonSerializable, ToCopyableBuilder { + @Nonnull + private final Map meta; + + @Nonnull + private final Percentiles values; + // --------------------------------------------------------------------------------------------- private TDigestPercentilesAggregate(Builder builder) { - super(builder); + this.meta = ApiTypeHelper.unmodifiable(builder.meta); + this.values = ApiTypeHelper.requireNonNull(builder.values, this, "values"); } public static TDigestPercentilesAggregate of( @@ -76,6 +93,47 @@ public Aggregate.Kind _aggregateKind() { return Aggregate.Kind.TdigestPercentiles; } + /** + * API name: {@code meta} + */ + @Nonnull + public final Map meta() { + return this.meta; + } + + /** + * Required - API name: {@code values} + */ + @Nonnull + public final Percentiles values() { + return this.values; + } + + /** + * Serialize this object to JSON. + */ + @Override + public void serialize(JsonGenerator generator, JsonpMapper mapper) { + generator.writeStartObject(); + serializeInternal(generator, mapper); + generator.writeEnd(); + } + + protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { + 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(); + } + + generator.writeKey("values"); + this.values.serialize(generator, mapper); + } + // --------------------------------------------------------------------------------------------- @Override @@ -92,18 +150,21 @@ public static Builder builder() { /** * Builder for {@link TDigestPercentilesAggregate}. */ - public static class Builder extends PercentilesAggregateBase.AbstractBuilder - implements - CopyableBuilder { + public static class Builder extends ObjectBuilderBase implements CopyableBuilder { + @Nullable + private Map meta; + private Percentiles values; public Builder() {} private Builder(TDigestPercentilesAggregate o) { - super(o); + this.meta = _mapCopy(o.meta); + this.values = o.values; } private Builder(Builder o) { - super(o); + this.meta = _mapCopy(o.meta); + this.values = o.values; } @Override @@ -112,12 +173,49 @@ 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; } + /** + * Required - API name: {@code values} + */ + @Nonnull + public final Builder values(Percentiles value) { + this.values = value; + return this; + } + + /** + * Required - API name: {@code values} + */ + @Nonnull + public final Builder values(Function> fn) { + return values(fn.apply(new Percentiles.Builder()).build()); + } + /** * Builds a {@link TDigestPercentilesAggregate}. * @@ -143,22 +241,23 @@ public TDigestPercentilesAggregate build() { ); protected static void setupTDigestPercentilesAggregateDeserializer(ObjectDeserializer op) { - setupPercentilesAggregateBaseDeserializer(op); + op.add(Builder::meta, JsonpDeserializer.stringMapDeserializer(JsonData._DESERIALIZER), "meta"); + op.add(Builder::values, Percentiles._DESERIALIZER, "values"); } @Override public int hashCode() { - int result = super.hashCode(); + int result = 17; + result = 31 * result + Objects.hashCode(this.meta); + result = 31 * result + this.values.hashCode(); return result; } @Override public boolean equals(Object o) { - if (!super.equals(o)) { - return false; - } if (this == o) return true; if (o == null || this.getClass() != o.getClass()) return false; - return true; + TDigestPercentilesAggregate other = (TDigestPercentilesAggregate) o; + return Objects.equals(this.meta, other.meta) && this.values.equals(other.values); } } diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/aggregations/TTestAggregation.java b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/aggregations/TTestAggregation.java index 6ce5dbd368..c9706fa51f 100644 --- a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/aggregations/TTestAggregation.java +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/aggregations/TTestAggregation.java @@ -47,18 +47,17 @@ import org.opensearch.client.json.JsonpMapper; import org.opensearch.client.json.ObjectBuilderDeserializer; import org.opensearch.client.json.ObjectDeserializer; +import org.opensearch.client.json.PlainJsonSerializable; import org.opensearch.client.util.CopyableBuilder; import org.opensearch.client.util.ObjectBuilder; +import org.opensearch.client.util.ObjectBuilderBase; import org.opensearch.client.util.ToCopyableBuilder; // typedef: _types.aggregations.TTestAggregation @JsonpDeserializable @Generated("org.opensearch.client.codegen.CodeGenerator") -public class TTestAggregation extends AggregationBase - implements - AggregationVariant, - ToCopyableBuilder { +public class TTestAggregation implements PlainJsonSerializable, ToCopyableBuilder { @Nullable private final TestPopulation a; @@ -72,7 +71,6 @@ public class TTestAggregation extends AggregationBase // --------------------------------------------------------------------------------------------- private TTestAggregation(Builder builder) { - super(builder); this.a = builder.a; this.b = builder.b; this.type = builder.type; @@ -82,14 +80,6 @@ public static TTestAggregation of(Function implements CopyableBuilder { + public static class Builder extends ObjectBuilderBase implements CopyableBuilder { @Nullable private TestPopulation a; @Nullable @@ -159,14 +158,12 @@ public static class Builder extends AggregationBase.AbstractBuilder imp public Builder() {} private Builder(TTestAggregation o) { - super(o); this.a = o.a; this.b = o.b; this.type = o.type; } private Builder(Builder o) { - super(o); this.a = o.a; this.b = o.b; this.type = o.type; @@ -178,12 +175,6 @@ public Builder copy() { return new Builder(this); } - @Override - @Nonnull - protected Builder self() { - return this; - } - /** * API name: {@code a} */ @@ -252,7 +243,6 @@ public TTestAggregation build() { ); protected static void setupTTestAggregationDeserializer(ObjectDeserializer op) { - setupAggregationBaseDeserializer(op); op.add(Builder::a, TestPopulation._DESERIALIZER, "a"); op.add(Builder::b, TestPopulation._DESERIALIZER, "b"); op.add(Builder::type, TTestType._DESERIALIZER, "type"); @@ -260,7 +250,7 @@ protected static void setupTTestAggregationDeserializer(ObjectDeserializer { - - @Nonnull - private final Map aggregations; - - @Nonnull - private final Map aggs; + ToCopyableBuilder { @Nullable private final TermsAggregationCollectMode collectMode; @@ -94,18 +86,12 @@ public class TermsAggregation @Nullable private final TermsInclude include; - @Nonnull - private final Map meta; - @Nullable private final Long minDocCount; @Nullable private final FieldValue missing; - @Nullable - private final String name; - @Nonnull private final List> order; @@ -129,19 +115,15 @@ public class TermsAggregation // --------------------------------------------------------------------------------------------- - private TermsAggregation(Builder builder) { - this.aggregations = ApiTypeHelper.unmodifiable(builder.aggregations); - this.aggs = ApiTypeHelper.unmodifiable(builder.aggs); + private TermsAggregationFields(Builder builder) { this.collectMode = builder.collectMode; this.exclude = builder.exclude; this.executionHint = builder.executionHint; this.field = builder.field; this.format = builder.format; this.include = builder.include; - this.meta = ApiTypeHelper.unmodifiable(builder.meta); this.minDocCount = builder.minDocCount; this.missing = builder.missing; - this.name = builder.name; this.order = ApiTypeHelper.unmodifiable(builder.order); this.script = builder.script; this.shardMinDocCount = builder.shardMinDocCount; @@ -151,40 +133,10 @@ private TermsAggregation(Builder builder) { this.valueType = builder.valueType; } - public static TermsAggregation of(Function> fn) { + public static TermsAggregationFields of(Function> fn) { return fn.apply(new Builder()).build(); } - /** - * {@link Aggregation} variant kind. - */ - @Override - public Aggregation.Kind _aggregationKind() { - return Aggregation.Kind.Terms; - } - - /** - * Sub-aggregations for this bucket aggregation - *

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

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

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

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

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

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

- * - *

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

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

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

- * - *

- * Adds an entry to aggregations. - *

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

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

- * - *

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

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

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

- * - *

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

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

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

- * - *

- * Adds an entry to aggs. - *

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

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

- * - *

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

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

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

- * Adds an entry to meta. - *

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

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

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

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

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

- */ - @Nonnull - public final BuilderT docCountError(@Nullable Long value) { - this.docCountError = value; - return self(); - } - } - - // --------------------------------------------------------------------------------------------- - - protected static > void setupTermsBucketBaseDeserializer(ObjectDeserializer op) { - setupMultiBucketBaseDeserializer(op); - op.add(AbstractBuilder::docCountError, JsonpDeserializer.longDeserializer(), "doc_count_error"); - } - - @Override - public int hashCode() { - int result = super.hashCode(); - result = 31 * result + Objects.hashCode(this.docCountError); - return result; - } - - @Override - public boolean equals(Object o) { - if (!super.equals(o)) { - return false; - } - if (this == o) return true; - if (o == null || this.getClass() != o.getClass()) return false; - TermsBucketBase other = (TermsBucketBase) o; - return Objects.equals(this.docCountError, other.docCountError); - } -} diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/aggregations/TopHitsAggregation.java b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/aggregations/TopHitsAggregation.java index cb7e57282a..1b31723df1 100644 --- a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/aggregations/TopHitsAggregation.java +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/aggregations/TopHitsAggregation.java @@ -62,10 +62,7 @@ @JsonpDeserializable @Generated("org.opensearch.client.codegen.CodeGenerator") -public class TopHitsAggregation extends MetricAggregationBase - implements - AggregationVariant, - ToCopyableBuilder { +public class TopHitsAggregation extends MetricAggregationBase implements ToCopyableBuilder { @Nonnull private final List docvalueFields; @@ -125,14 +122,6 @@ public static TopHitsAggregation of(Function +public class UnmappedSignificantTermsAggregate implements AggregateVariant, + PlainJsonSerializable, ToCopyableBuilder { + @Nullable + private final Long bgCount; + + @Nonnull + private final Buckets buckets; + + @Nullable + private final Long docCount; + + @Nonnull + private final Map meta; + // --------------------------------------------------------------------------------------------- private UnmappedSignificantTermsAggregate(Builder builder) { - super(builder); + this.bgCount = builder.bgCount; + this.buckets = ApiTypeHelper.requireNonNull(builder.buckets, this, "buckets"); + this.docCount = builder.docCount; + this.meta = ApiTypeHelper.unmodifiable(builder.meta); } public static UnmappedSignificantTermsAggregate of( @@ -76,6 +101,73 @@ public Aggregate.Kind _aggregateKind() { return Aggregate.Kind.Umsigterms; } + /** + * API name: {@code bg_count} + */ + @Nullable + public final Long bgCount() { + return this.bgCount; + } + + /** + * Required - API name: {@code buckets} + */ + @Nonnull + public final Buckets buckets() { + return this.buckets; + } + + /** + * API name: {@code doc_count} + */ + @Nullable + public final Long docCount() { + return this.docCount; + } + + /** + * API name: {@code meta} + */ + @Nonnull + public final Map meta() { + return this.meta; + } + + /** + * Serialize this object to JSON. + */ + @Override + public void serialize(JsonGenerator generator, JsonpMapper mapper) { + generator.writeStartObject(); + serializeInternal(generator, mapper); + generator.writeEnd(); + } + + protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { + if (this.bgCount != null) { + generator.writeKey("bg_count"); + generator.write(this.bgCount); + } + + generator.writeKey("buckets"); + this.buckets.serialize(generator, mapper); + + if (this.docCount != null) { + generator.writeKey("doc_count"); + generator.write(this.docCount); + } + + 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(); + } + } + // --------------------------------------------------------------------------------------------- @Override @@ -92,18 +184,29 @@ public static Builder builder() { /** * Builder for {@link UnmappedSignificantTermsAggregate}. */ - public static class Builder extends SignificantTermsAggregateBase.AbstractBuilder - implements - CopyableBuilder { + public static class Builder extends ObjectBuilderBase implements CopyableBuilder { + @Nullable + private Long bgCount; + private Buckets buckets; + @Nullable + private Long docCount; + @Nullable + private Map meta; public Builder() {} private Builder(UnmappedSignificantTermsAggregate o) { - super(o); + this.bgCount = o.bgCount; + this.buckets = o.buckets; + this.docCount = o.docCount; + this.meta = _mapCopy(o.meta); } private Builder(Builder o) { - super(o); + this.bgCount = o.bgCount; + this.buckets = o.buckets; + this.docCount = o.docCount; + this.meta = _mapCopy(o.meta); } @Override @@ -112,9 +215,64 @@ public Builder copy() { return new Builder(this); } - @Override + /** + * API name: {@code bg_count} + */ + @Nonnull + public final Builder bgCount(@Nullable Long value) { + this.bgCount = value; + return this; + } + + /** + * Required - API name: {@code buckets} + */ + @Nonnull + public final Builder buckets(Buckets value) { + this.buckets = value; + return this; + } + + /** + * Required - API name: {@code buckets} + */ + @Nonnull + public final Builder buckets(Function, ObjectBuilder>> fn) { + return buckets(fn.apply(new Buckets.Builder()).build()); + } + + /** + * API name: {@code doc_count} + */ + @Nonnull + public final Builder docCount(@Nullable Long value) { + this.docCount = value; + return this; + } + + /** + * API name: {@code meta} + * + *

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

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

+ * Adds an entry to meta. + *

+ */ + @Nonnull + public final Builder meta(String key, JsonData value) { + this.meta = _mapPut(this.meta, key, value); return this; } @@ -145,22 +303,30 @@ public UnmappedSignificantTermsAggregate build() { protected static void setupUnmappedSignificantTermsAggregateDeserializer( ObjectDeserializer op ) { - setupSignificantTermsAggregateBaseDeserializer(op, JsonpDeserializer.voidDeserializer()); + op.add(Builder::bgCount, JsonpDeserializer.longDeserializer(), "bg_count"); + op.add(Builder::buckets, Buckets.createBucketsDeserializer(JsonpDeserializer.voidDeserializer()), "buckets"); + op.add(Builder::docCount, JsonpDeserializer.longDeserializer(), "doc_count"); + op.add(Builder::meta, JsonpDeserializer.stringMapDeserializer(JsonData._DESERIALIZER), "meta"); } @Override public int hashCode() { - int result = super.hashCode(); + int result = 17; + result = 31 * result + Objects.hashCode(this.bgCount); + result = 31 * result + this.buckets.hashCode(); + result = 31 * result + Objects.hashCode(this.docCount); + result = 31 * result + Objects.hashCode(this.meta); 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; + UnmappedSignificantTermsAggregate other = (UnmappedSignificantTermsAggregate) o; + return Objects.equals(this.bgCount, other.bgCount) + && this.buckets.equals(other.buckets) + && Objects.equals(this.docCount, other.docCount) + && Objects.equals(this.meta, other.meta); } } diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/aggregations/UnmappedTermsAggregate.java b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/aggregations/UnmappedTermsAggregate.java index baa2fc91e0..72d86d1ba2 100644 --- a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/aggregations/UnmappedTermsAggregate.java +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/aggregations/UnmappedTermsAggregate.java @@ -39,6 +39,7 @@ import java.util.function.Function; import javax.annotation.Generated; import javax.annotation.Nonnull; +import org.opensearch.client.json.JsonData; import org.opensearch.client.json.JsonpDeserializable; import org.opensearch.client.json.JsonpDeserializer; import org.opensearch.client.json.ObjectBuilderDeserializer; @@ -54,7 +55,7 @@ */ @JsonpDeserializable @Generated("org.opensearch.client.codegen.CodeGenerator") -public class UnmappedTermsAggregate extends TermsAggregateBase +public class UnmappedTermsAggregate extends TermsAggregateBase implements AggregateVariant, ToCopyableBuilder { @@ -93,7 +94,7 @@ public static Builder builder() { /** * Builder for {@link UnmappedTermsAggregate}. */ - public static class Builder extends TermsAggregateBase.AbstractBuilder + public static class Builder extends TermsAggregateBase.AbstractBuilder implements CopyableBuilder { @@ -144,7 +145,7 @@ public UnmappedTermsAggregate build() { ); protected static void setupUnmappedTermsAggregateDeserializer(ObjectDeserializer op) { - setupTermsAggregateBaseDeserializer(op, JsonpDeserializer.voidDeserializer()); + setupTermsAggregateBaseDeserializer(op, JsonData._DESERIALIZER); } @Override diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/aggregations/GlobalAggregation.java b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/aggregations/UnsignedLongTermsAggregate.java similarity index 62% rename from java-client/src/generated/java/org/opensearch/client/opensearch/_types/aggregations/GlobalAggregation.java rename to java-client/src/generated/java/org/opensearch/client/opensearch/_types/aggregations/UnsignedLongTermsAggregate.java index b2e42621fc..05ed300405 100644 --- a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/aggregations/GlobalAggregation.java +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/aggregations/UnsignedLongTermsAggregate.java @@ -39,6 +39,7 @@ import java.util.function.Function; import javax.annotation.Generated; import javax.annotation.Nonnull; +import org.opensearch.client.json.JsonData; import org.opensearch.client.json.JsonpDeserializable; import org.opensearch.client.json.JsonpDeserializer; import org.opensearch.client.json.ObjectBuilderDeserializer; @@ -47,31 +48,40 @@ import org.opensearch.client.util.ObjectBuilder; import org.opensearch.client.util.ToCopyableBuilder; -// typedef: _types.aggregations.GlobalAggregation +// typedef: _types.aggregations.UnsignedLongTermsAggregate +/** + * Result of a terms aggregation when the field is an unsigned_long (64-bit unsigned integer). OpenSearch stores + * unsigned_long values as Long or BigInteger internally. In JSON responses, bucket keys are represented as numbers, which may + * lose precision for values larger than 2^53--1 due to IEEE 754 double precision limitations. In protocol buffer representations, keys are + * manually defined as uint64 to preserve the full 64-bit unsigned range. Use key_as_string in buckets for exact string + * representation of large unsigned long values. + */ @JsonpDeserializable @Generated("org.opensearch.client.codegen.CodeGenerator") -public class GlobalAggregation extends BucketAggregationBase +public class UnsignedLongTermsAggregate extends TermsAggregateBase implements - AggregationVariant, - ToCopyableBuilder { + AggregateVariant, + ToCopyableBuilder { // --------------------------------------------------------------------------------------------- - private GlobalAggregation(Builder builder) { + private UnsignedLongTermsAggregate(Builder builder) { super(builder); } - public static GlobalAggregation of(Function> fn) { + public static UnsignedLongTermsAggregate of( + Function> fn + ) { return fn.apply(new Builder()).build(); } /** - * {@link Aggregation} variant kind. + * {@link Aggregate} variant kind. */ @Override - public Aggregation.Kind _aggregationKind() { - return Aggregation.Kind.Global; + public Aggregate.Kind _aggregateKind() { + return Aggregate.Kind.Ulterms; } // --------------------------------------------------------------------------------------------- @@ -88,15 +98,15 @@ public static Builder builder() { } /** - * Builder for {@link GlobalAggregation}. + * Builder for {@link UnsignedLongTermsAggregate}. */ - public static class Builder extends BucketAggregationBase.AbstractBuilder + public static class Builder extends TermsAggregateBase.AbstractBuilder implements - CopyableBuilder { + CopyableBuilder { public Builder() {} - private Builder(GlobalAggregation o) { + private Builder(UnsignedLongTermsAggregate o) { super(o); } @@ -117,31 +127,31 @@ protected Builder self() { } /** - * Builds a {@link GlobalAggregation}. + * Builds a {@link UnsignedLongTermsAggregate}. * * @throws NullPointerException if some of the required fields are null. */ @Override @Nonnull - public GlobalAggregation build() { + public UnsignedLongTermsAggregate build() { _checkSingleUse(); - return new GlobalAggregation(this); + return new UnsignedLongTermsAggregate(this); } } // --------------------------------------------------------------------------------------------- /** - * Json deserializer for {@link GlobalAggregation} + * Json deserializer for {@link UnsignedLongTermsAggregate} */ - public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer.lazy( + public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer.lazy( Builder::new, - GlobalAggregation::setupGlobalAggregationDeserializer + UnsignedLongTermsAggregate::setupUnsignedLongTermsAggregateDeserializer ); - protected static void setupGlobalAggregationDeserializer(ObjectDeserializer op) { - setupBucketAggregationBaseDeserializer(op); + protected static void setupUnsignedLongTermsAggregateDeserializer(ObjectDeserializer op) { + setupTermsAggregateBaseDeserializer(op, JsonData._DESERIALIZER); } @Override diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/aggregations/ValueCountAggregate.java b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/aggregations/ValueCountAggregate.java index 044dc743ef..705b458a0b 100644 --- a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/aggregations/ValueCountAggregate.java +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/aggregations/ValueCountAggregate.java @@ -36,30 +36,51 @@ 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.JsonpDeserializable; import org.opensearch.client.json.JsonpDeserializer; +import org.opensearch.client.json.JsonpMapper; import org.opensearch.client.json.ObjectBuilderDeserializer; import org.opensearch.client.json.ObjectDeserializer; +import org.opensearch.client.json.PlainJsonSerializable; +import org.opensearch.client.util.ApiTypeHelper; import org.opensearch.client.util.CopyableBuilder; import org.opensearch.client.util.ObjectBuilder; +import org.opensearch.client.util.ObjectBuilderBase; import org.opensearch.client.util.ToCopyableBuilder; // typedef: _types.aggregations.ValueCountAggregate @JsonpDeserializable @Generated("org.opensearch.client.codegen.CodeGenerator") -public class ValueCountAggregate extends SingleMetricAggregateBase +public class ValueCountAggregate implements AggregateVariant, + PlainJsonSerializable, ToCopyableBuilder { + @Nonnull + private final Map meta; + + @Nullable + private final Double value; + + @Nullable + private final String valueAsString; + // --------------------------------------------------------------------------------------------- private ValueCountAggregate(Builder builder) { - super(builder); + this.meta = ApiTypeHelper.unmodifiable(builder.meta); + this.value = builder.value; + this.valueAsString = builder.valueAsString; } public static ValueCountAggregate of(Function> fn) { @@ -74,6 +95,65 @@ public Aggregate.Kind _aggregateKind() { return Aggregate.Kind.ValueCount; } + /** + * 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 +170,26 @@ public static Builder builder() { /** * Builder for {@link ValueCountAggregate}. */ - 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(ValueCountAggregate 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 +198,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 +270,27 @@ public ValueCountAggregate build() { ); protected static void setupValueCountAggregateDeserializer(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; + ValueCountAggregate other = (ValueCountAggregate) 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/ValueCountAggregation.java b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/aggregations/ValueCountAggregation.java index 28435722e5..d40bfa246e 100644 --- a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/aggregations/ValueCountAggregation.java +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/aggregations/ValueCountAggregation.java @@ -53,7 +53,6 @@ @Generated("org.opensearch.client.codegen.CodeGenerator") public class ValueCountAggregation extends FormattableMetricAggregation implements - AggregationVariant, ToCopyableBuilder { // --------------------------------------------------------------------------------------------- @@ -66,14 +65,6 @@ public static ValueCountAggregation of(Function +public class VariableWidthHistogramAggregate implements AggregateVariant, + PlainJsonSerializable, ToCopyableBuilder { + @Nonnull + private final Buckets buckets; + + @Nonnull + private final Map meta; + // --------------------------------------------------------------------------------------------- private VariableWidthHistogramAggregate(Builder builder) { - super(builder); + this.buckets = ApiTypeHelper.requireNonNull(builder.buckets, this, "buckets"); + this.meta = ApiTypeHelper.unmodifiable(builder.meta); } public static VariableWidthHistogramAggregate of( @@ -76,6 +93,47 @@ public Aggregate.Kind _aggregateKind() { return Aggregate.Kind.VariableWidthHistogram; } + /** + * Required - API name: {@code buckets} + */ + @Nonnull + public final Buckets buckets() { + return this.buckets; + } + + /** + * API name: {@code meta} + */ + @Nonnull + public final Map meta() { + return this.meta; + } + + /** + * 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) { + generator.writeKey("buckets"); + this.buckets.serialize(generator, mapper); + + if (ApiTypeHelper.isDefined(this.meta)) { + generator.writeKey("meta"); + generator.writeStartObject(); + for (Map.Entry item0 : this.meta.entrySet()) { + generator.writeKey(item0.getKey()); + item0.getValue().serialize(generator, mapper); + } + generator.writeEnd(); + } + } + // --------------------------------------------------------------------------------------------- @Override @@ -92,18 +150,21 @@ public static Builder builder() { /** * Builder for {@link VariableWidthHistogramAggregate}. */ - public static class Builder extends MultiBucketAggregateBase.AbstractBuilder - implements - CopyableBuilder { + public static class Builder extends ObjectBuilderBase implements CopyableBuilder { + private Buckets buckets; + @Nullable + private Map meta; public Builder() {} private Builder(VariableWidthHistogramAggregate o) { - super(o); + this.buckets = o.buckets; + this.meta = _mapCopy(o.meta); } private Builder(Builder o) { - super(o); + this.buckets = o.buckets; + this.meta = _mapCopy(o.meta); } @Override @@ -112,9 +173,48 @@ public Builder copy() { return new Builder(this); } - @Override + /** + * Required - API name: {@code buckets} + */ @Nonnull - protected Builder self() { + public final Builder buckets(Buckets value) { + this.buckets = value; + return this; + } + + /** + * Required - API name: {@code buckets} + */ + @Nonnull + public final Builder buckets( + Function, ObjectBuilder>> fn + ) { + return buckets(fn.apply(new Buckets.Builder()).build()); + } + + /** + * 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 + public final Builder meta(String key, JsonData value) { + this.meta = _mapPut(this.meta, key, value); return this; } @@ -143,22 +243,23 @@ public VariableWidthHistogramAggregate build() { ); protected static void setupVariableWidthHistogramAggregateDeserializer(ObjectDeserializer op) { - setupMultiBucketAggregateBaseDeserializer(op, VariableWidthHistogramBucket._DESERIALIZER); + op.add(Builder::buckets, Buckets.createBucketsDeserializer(VariableWidthHistogramBucket._DESERIALIZER), "buckets"); + op.add(Builder::meta, JsonpDeserializer.stringMapDeserializer(JsonData._DESERIALIZER), "meta"); } @Override public int hashCode() { - int result = super.hashCode(); + int result = 17; + result = 31 * result + this.buckets.hashCode(); + result = 31 * result + Objects.hashCode(this.meta); 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; + VariableWidthHistogramAggregate other = (VariableWidthHistogramAggregate) o; + return this.buckets.equals(other.buckets) && Objects.equals(this.meta, other.meta); } } diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/aggregations/VariableWidthHistogramAggregation.java b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/aggregations/VariableWidthHistogramAggregation.java index 8e8406ea5f..7d1133f2a1 100644 --- a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/aggregations/VariableWidthHistogramAggregation.java +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/aggregations/VariableWidthHistogramAggregation.java @@ -59,7 +59,6 @@ @Generated("org.opensearch.client.codegen.CodeGenerator") public class VariableWidthHistogramAggregation implements - AggregationVariant, PlainJsonSerializable, ToCopyableBuilder { @@ -90,14 +89,6 @@ public static VariableWidthHistogramAggregation of( return fn.apply(new Builder()).build(); } - /** - * {@link Aggregation} variant kind. - */ - @Override - public Aggregation.Kind _aggregationKind() { - return Aggregation.Kind.VariableWidthHistogram; - } - /** * The target number of buckets. *

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

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

@@ -292,7 +284,6 @@ public WeightedAverageAggregation build() { ); protected static void setupWeightedAverageAggregationDeserializer(ObjectDeserializer op) { - setupAggregationBaseDeserializer(op); op.add(Builder::format, JsonpDeserializer.stringDeserializer(), "format"); op.add(Builder::value, WeightedAverageValue._DESERIALIZER, "value"); op.add(Builder::valueType, ValueType._DESERIALIZER, "value_type"); @@ -301,7 +292,7 @@ protected static void setupWeightedAverageAggregationDeserializer(ObjectDeserial @Override public int hashCode() { - int result = super.hashCode(); + int result = 17; result = 31 * result + Objects.hashCode(this.format); result = 31 * result + Objects.hashCode(this.value); result = 31 * result + Objects.hashCode(this.valueType); @@ -311,9 +302,6 @@ public int hashCode() { @Override public boolean equals(Object o) { - if (!super.equals(o)) { - return false; - } if (this == o) return true; if (o == null || this.getClass() != o.getClass()) return false; WeightedAverageAggregation other = (WeightedAverageAggregation) o; diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/aggregations/WeightedAvgAggregate.java b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/aggregations/WeightedAvgAggregate.java index ce84164328..1ab57b1265 100644 --- a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/aggregations/WeightedAvgAggregate.java +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/aggregations/WeightedAvgAggregate.java @@ -36,30 +36,51 @@ 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.JsonpDeserializable; import org.opensearch.client.json.JsonpDeserializer; +import org.opensearch.client.json.JsonpMapper; import org.opensearch.client.json.ObjectBuilderDeserializer; import org.opensearch.client.json.ObjectDeserializer; +import org.opensearch.client.json.PlainJsonSerializable; +import org.opensearch.client.util.ApiTypeHelper; import org.opensearch.client.util.CopyableBuilder; import org.opensearch.client.util.ObjectBuilder; +import org.opensearch.client.util.ObjectBuilderBase; import org.opensearch.client.util.ToCopyableBuilder; // typedef: _types.aggregations.WeightedAvgAggregate @JsonpDeserializable @Generated("org.opensearch.client.codegen.CodeGenerator") -public class WeightedAvgAggregate extends SingleMetricAggregateBase +public class WeightedAvgAggregate implements AggregateVariant, + PlainJsonSerializable, ToCopyableBuilder { + @Nonnull + private final Map meta; + + @Nullable + private final Double value; + + @Nullable + private final String valueAsString; + // --------------------------------------------------------------------------------------------- private WeightedAvgAggregate(Builder builder) { - super(builder); + this.meta = ApiTypeHelper.unmodifiable(builder.meta); + this.value = builder.value; + this.valueAsString = builder.valueAsString; } public static WeightedAvgAggregate of(Function> fn) { @@ -74,6 +95,65 @@ public Aggregate.Kind _aggregateKind() { return Aggregate.Kind.WeightedAvg; } + /** + * 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 +170,26 @@ public static Builder builder() { /** * Builder for {@link WeightedAvgAggregate}. */ - 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(WeightedAvgAggregate 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 +198,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 +270,27 @@ public WeightedAvgAggregate build() { ); protected static void setupWeightedAvgAggregateDeserializer(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; + WeightedAvgAggregate other = (WeightedAvgAggregate) 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/query_dsl/NeuralSparseQuery.java b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/query_dsl/NeuralSparseQuery.java new file mode 100644 index 0000000000..68c088fe03 --- /dev/null +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/query_dsl/NeuralSparseQuery.java @@ -0,0 +1,415 @@ +/* + * 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.query_dsl; + +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.JsonpDeserializable; +import org.opensearch.client.json.JsonpDeserializer; +import org.opensearch.client.json.JsonpMapper; +import org.opensearch.client.json.ObjectBuilderDeserializer; +import org.opensearch.client.json.ObjectDeserializer; +import org.opensearch.client.util.ApiTypeHelper; +import org.opensearch.client.util.CopyableBuilder; +import org.opensearch.client.util.ObjectBuilder; +import org.opensearch.client.util.ToCopyableBuilder; + +// typedef: _types.query_dsl.NeuralSparseQuery + +@JsonpDeserializable +@Generated("org.opensearch.client.codegen.CodeGenerator") +public class NeuralSparseQuery extends QueryBase implements QueryVariant, ToCopyableBuilder { + + @Nullable + private final String analyzer; + + @Nonnull + private final String field; + + @Nullable + private final Float maxTokenScore; + + @Nullable + private final String modelId; + + @Nullable + private final String queryText; + + @Nonnull + private final Map queryTokens; + + // --------------------------------------------------------------------------------------------- + + private NeuralSparseQuery(Builder builder) { + super(builder); + this.analyzer = builder.analyzer; + this.field = ApiTypeHelper.requireNonNull(builder.field, this, "field"); + this.maxTokenScore = builder.maxTokenScore; + this.modelId = builder.modelId; + this.queryText = builder.queryText; + this.queryTokens = ApiTypeHelper.unmodifiable(builder.queryTokens); + } + + public static NeuralSparseQuery of(Function> fn) { + return fn.apply(new Builder()).build(); + } + + /** + * {@link Query} variant kind. + */ + @Override + public Query.Kind _queryKind() { + return Query.Kind.NeuralSparse; + } + + /** + * The analyzer to use for tokenization instead of an ML model. + *

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

+ */ + @Nullable + public final String analyzer() { + return this.analyzer; + } + + /** + * Required - The target field + */ + @Nonnull + public final String field() { + return this.field; + } + + /** + * The maximum score threshold for sparse tokens. Deprecated since OpenSearch 2.12. + *

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

+ */ + @Nullable + public final Float maxTokenScore() { + return this.maxTokenScore; + } + + /** + * The ID of the sparse encoding model or tokenizer model at the ML node. + *

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

+ */ + @Nullable + public final String modelId() { + return this.modelId; + } + + /** + * The query text to be encoded into sparse tokens by the model. + *

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

+ */ + @Nullable + public final String queryText() { + return this.queryText; + } + + /** + * Pre-computed sparse tokens and their weights. Use instead of query_text+model_id when tokens are already available. + *

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

+ */ + @Nonnull + public final Map queryTokens() { + return this.queryTokens; + } + + protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { + generator.writeStartObject(this.field); + super.serializeInternal(generator, mapper); + if (this.analyzer != null) { + generator.writeKey("analyzer"); + generator.write(this.analyzer); + } + + if (this.maxTokenScore != null) { + generator.writeKey("max_token_score"); + generator.write(this.maxTokenScore); + } + + if (this.modelId != null) { + generator.writeKey("model_id"); + generator.write(this.modelId); + } + + if (this.queryText != null) { + generator.writeKey("query_text"); + generator.write(this.queryText); + } + + if (ApiTypeHelper.isDefined(this.queryTokens)) { + generator.writeKey("query_tokens"); + generator.writeStartObject(); + for (Map.Entry item0 : this.queryTokens.entrySet()) { + generator.writeKey(item0.getKey()); + generator.write(item0.getValue()); + } + generator.writeEnd(); + } + generator.writeEnd(); + } + + // --------------------------------------------------------------------------------------------- + + @Override + @Nonnull + public Builder toBuilder() { + return new Builder(this); + } + + @Nonnull + public static Builder builder() { + return new Builder(); + } + + /** + * Builder for {@link NeuralSparseQuery}. + */ + public static class Builder extends QueryBase.AbstractBuilder implements CopyableBuilder { + @Nullable + private String analyzer; + private String field; + @Nullable + private Float maxTokenScore; + @Nullable + private String modelId; + @Nullable + private String queryText; + @Nullable + private Map queryTokens; + + public Builder() {} + + private Builder(NeuralSparseQuery o) { + super(o); + this.analyzer = o.analyzer; + this.field = o.field; + this.maxTokenScore = o.maxTokenScore; + this.modelId = o.modelId; + this.queryText = o.queryText; + this.queryTokens = _mapCopy(o.queryTokens); + } + + private Builder(Builder o) { + super(o); + this.analyzer = o.analyzer; + this.field = o.field; + this.maxTokenScore = o.maxTokenScore; + this.modelId = o.modelId; + this.queryText = o.queryText; + this.queryTokens = _mapCopy(o.queryTokens); + } + + @Override + @Nonnull + public Builder copy() { + return new Builder(this); + } + + @Override + @Nonnull + protected Builder self() { + return this; + } + + /** + * The analyzer to use for tokenization instead of an ML model. + *

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

+ */ + @Nonnull + public final Builder analyzer(@Nullable String value) { + this.analyzer = value; + return this; + } + + /** + * Required - The target field + */ + @Nonnull + public final Builder field(String value) { + this.field = value; + return this; + } + + /** + * The maximum score threshold for sparse tokens. Deprecated since OpenSearch 2.12. + *

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

+ */ + @Nonnull + public final Builder maxTokenScore(@Nullable Float value) { + this.maxTokenScore = value; + return this; + } + + /** + * The ID of the sparse encoding model or tokenizer model at the ML node. + *

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

+ */ + @Nonnull + public final Builder modelId(@Nullable String value) { + this.modelId = value; + return this; + } + + /** + * The query text to be encoded into sparse tokens by the model. + *

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

+ */ + @Nonnull + public final Builder queryText(@Nullable String value) { + this.queryText = value; + return this; + } + + /** + * Pre-computed sparse tokens and their weights. Use instead of query_text+model_id when tokens are already available. + *

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

+ * + *

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

+ */ + @Nonnull + public final Builder queryTokens(Map map) { + this.queryTokens = _mapPutAll(this.queryTokens, map); + return this; + } + + /** + * Pre-computed sparse tokens and their weights. Use instead of query_text+model_id when tokens are already available. + *

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

+ * + *

+ * Adds an entry to queryTokens. + *

+ */ + @Nonnull + public final Builder queryTokens(String key, Float value) { + this.queryTokens = _mapPut(this.queryTokens, key, value); + return this; + } + + /** + * Builds a {@link NeuralSparseQuery}. + * + * @throws NullPointerException if some of the required fields are null. + */ + @Override + @Nonnull + public NeuralSparseQuery build() { + _checkSingleUse(); + + return new NeuralSparseQuery(this); + } + } + + // --------------------------------------------------------------------------------------------- + + /** + * Json deserializer for {@link NeuralSparseQuery} + */ + public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer.lazy( + Builder::new, + NeuralSparseQuery::setupNeuralSparseQueryDeserializer + ); + + protected static void setupNeuralSparseQueryDeserializer(ObjectDeserializer op) { + setupQueryBaseDeserializer(op); + op.add(Builder::analyzer, JsonpDeserializer.stringDeserializer(), "analyzer"); + op.add(Builder::maxTokenScore, JsonpDeserializer.floatDeserializer(), "max_token_score"); + op.add(Builder::modelId, JsonpDeserializer.stringDeserializer(), "model_id"); + op.add(Builder::queryText, JsonpDeserializer.stringDeserializer(), "query_text"); + op.add(Builder::queryTokens, JsonpDeserializer.stringMapDeserializer(JsonpDeserializer.floatDeserializer()), "query_tokens"); + op.setKey(Builder::field, JsonpDeserializer.stringDeserializer()); + } + + @Override + public int hashCode() { + int result = super.hashCode(); + result = 31 * result + Objects.hashCode(this.analyzer); + result = 31 * result + this.field.hashCode(); + result = 31 * result + Objects.hashCode(this.maxTokenScore); + result = 31 * result + Objects.hashCode(this.modelId); + result = 31 * result + Objects.hashCode(this.queryText); + result = 31 * result + Objects.hashCode(this.queryTokens); + 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; + NeuralSparseQuery other = (NeuralSparseQuery) o; + return Objects.equals(this.analyzer, other.analyzer) + && this.field.equals(other.field) + && Objects.equals(this.maxTokenScore, other.maxTokenScore) + && Objects.equals(this.modelId, other.modelId) + && Objects.equals(this.queryText, other.queryText) + && Objects.equals(this.queryTokens, other.queryTokens); + } +} diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/query_dsl/Query.java b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/query_dsl/Query.java index c3255666c1..c61a1fca84 100644 --- a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/query_dsl/Query.java +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/query_dsl/Query.java @@ -51,8 +51,6 @@ import org.opensearch.client.json.ObjectBuilderDeserializer; import org.opensearch.client.json.ObjectDeserializer; import org.opensearch.client.json.PlainJsonSerializable; -import org.opensearch.client.opensearch._types.aggregations.Aggregation; -import org.opensearch.client.opensearch._types.aggregations.AggregationVariant; import org.opensearch.client.util.ApiTypeHelper; import org.opensearch.client.util.ObjectBuilder; import org.opensearch.client.util.ObjectBuilderBase; @@ -63,7 +61,7 @@ @JsonpDeserializable @Generated("org.opensearch.client.codegen.CodeGenerator") -public class Query implements TaggedUnion, AggregationVariant, PlainJsonSerializable { +public class Query implements TaggedUnion, PlainJsonSerializable { /** * {@link Query} variant kinds. */ @@ -100,6 +98,7 @@ public enum Kind implements JsonEnum { MultiMatch("multi_match"), Nested("nested"), Neural("neural"), + NeuralSparse("neural_sparse"), ParentId("parent_id"), Percolate("percolate"), Prefix("prefix"), @@ -110,6 +109,7 @@ public enum Kind implements JsonEnum { Script("script"), ScriptScore("script_score"), SimpleQueryString("simple_query_string"), + Sltr("sltr"), SpanContaining("span_containing"), SpanFirst("span_first"), SpanMulti("span_multi"), @@ -139,14 +139,6 @@ public String jsonValue() { } } - /** - * {@link Aggregation} variant kind. - */ - @Override - public Aggregation.Kind _aggregationKind() { - return Aggregation.Kind.Filter; - } - private final Kind _kind; private final Object _value; @@ -686,6 +678,22 @@ public NeuralQuery neural() { return TaggedUnionUtils.get(this, Kind.Neural); } + /** + * Is this variant instance of kind {@code neural_sparse}? + */ + public boolean isNeuralSparse() { + return _kind == Kind.NeuralSparse; + } + + /** + * Get the {@code neural_sparse} variant value. + * + * @throws IllegalStateException if the current variant is not the {@code neural_sparse} kind. + */ + public NeuralSparseQuery neuralSparse() { + return TaggedUnionUtils.get(this, Kind.NeuralSparse); + } + /** * Is this variant instance of kind {@code parent_id}? */ @@ -846,6 +854,22 @@ public SimpleQueryStringQuery simpleQueryString() { return TaggedUnionUtils.get(this, Kind.SimpleQueryString); } + /** + * Is this variant instance of kind {@code sltr}? + */ + public boolean isSltr() { + return _kind == Kind.Sltr; + } + + /** + * Get the {@code sltr} variant value. + * + * @throws IllegalStateException if the current variant is not the {@code sltr} kind. + */ + public StoredLtrQuery sltr() { + return TaggedUnionUtils.get(this, Kind.Sltr); + } + /** * Is this variant instance of kind {@code span_containing}? */ @@ -1464,6 +1488,16 @@ public ObjectBuilder neural(Function neuralSparse(NeuralSparseQuery v) { + this._kind = Kind.NeuralSparse; + this._value = v; + return this; + } + + public ObjectBuilder neuralSparse(Function> fn) { + return this.neuralSparse(fn.apply(new NeuralSparseQuery.Builder()).build()); + } + public ObjectBuilder parentId(ParentIdQuery v) { this._kind = Kind.ParentId; this._value = v; @@ -1564,6 +1598,16 @@ public ObjectBuilder simpleQueryString(Function sltr(StoredLtrQuery v) { + this._kind = Kind.Sltr; + this._value = v; + return this; + } + + public ObjectBuilder sltr(Function> fn) { + return this.sltr(fn.apply(new StoredLtrQuery.Builder()).build()); + } + public ObjectBuilder spanContaining(SpanContainingQuery v) { this._kind = Kind.SpanContaining; this._value = v; @@ -1760,6 +1804,7 @@ protected static void setupQueryDeserializer(ObjectDeserializer op) { op.add(Builder::multiMatch, MultiMatchQuery._DESERIALIZER, "multi_match"); op.add(Builder::nested, NestedQuery._DESERIALIZER, "nested"); op.add(Builder::neural, NeuralQuery._DESERIALIZER, "neural"); + op.add(Builder::neuralSparse, NeuralSparseQuery._DESERIALIZER, "neural_sparse"); op.add(Builder::parentId, ParentIdQuery._DESERIALIZER, "parent_id"); op.add(Builder::percolate, PercolateQuery._DESERIALIZER, "percolate"); op.add(Builder::prefix, PrefixQuery._DESERIALIZER, "prefix"); @@ -1770,6 +1815,7 @@ protected static void setupQueryDeserializer(ObjectDeserializer op) { op.add(Builder::script, ScriptQuery._DESERIALIZER, "script"); op.add(Builder::scriptScore, ScriptScoreQuery._DESERIALIZER, "script_score"); op.add(Builder::simpleQueryString, SimpleQueryStringQuery._DESERIALIZER, "simple_query_string"); + op.add(Builder::sltr, StoredLtrQuery._DESERIALIZER, "sltr"); op.add(Builder::spanContaining, SpanContainingQuery._DESERIALIZER, "span_containing"); op.add(Builder::spanFirst, SpanFirstQuery._DESERIALIZER, "span_first"); op.add(Builder::spanMulti, SpanMultiTermQuery._DESERIALIZER, "span_multi"); diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/query_dsl/QueryBuilders.java b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/query_dsl/QueryBuilders.java index 1fb6cde855..e6be1f5c31 100644 --- a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/query_dsl/QueryBuilders.java +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/query_dsl/QueryBuilders.java @@ -274,6 +274,13 @@ public static NeuralQuery.Builder neural() { return new NeuralQuery.Builder(); } + /** + * Creates a builder for the {@link NeuralSparseQuery neural_sparse} {@code Query} variant. + */ + public static NeuralSparseQuery.Builder neuralSparse() { + return new NeuralSparseQuery.Builder(); + } + /** * Creates a builder for the {@link ParentIdQuery parent_id} {@code Query} variant. */ @@ -344,6 +351,13 @@ public static SimpleQueryStringQuery.Builder simpleQueryString() { return new SimpleQueryStringQuery.Builder(); } + /** + * Creates a builder for the {@link StoredLtrQuery sltr} {@code Query} variant. + */ + public static StoredLtrQuery.Builder sltr() { + return new StoredLtrQuery.Builder(); + } + /** * Creates a builder for the {@link SpanContainingQuery span_containing} {@code Query} variant. */ diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/query_dsl/StoredLtrQuery.java b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/query_dsl/StoredLtrQuery.java new file mode 100644 index 0000000000..56491f7b52 --- /dev/null +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/query_dsl/StoredLtrQuery.java @@ -0,0 +1,470 @@ +/* + * 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.query_dsl; + +import jakarta.json.stream.JsonGenerator; +import java.util.List; +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.JsonpDeserializable; +import org.opensearch.client.json.JsonpDeserializer; +import org.opensearch.client.json.JsonpMapper; +import org.opensearch.client.json.ObjectBuilderDeserializer; +import org.opensearch.client.json.ObjectDeserializer; +import org.opensearch.client.json.PlainJsonSerializable; +import org.opensearch.client.util.ApiTypeHelper; +import org.opensearch.client.util.CopyableBuilder; +import org.opensearch.client.util.ObjectBuilder; +import org.opensearch.client.util.ObjectBuilderBase; +import org.opensearch.client.util.ToCopyableBuilder; + +// typedef: _types.query_dsl.StoredLtrQuery + +@JsonpDeserializable +@Generated("org.opensearch.client.codegen.CodeGenerator") +public class StoredLtrQuery implements QueryVariant, PlainJsonSerializable, ToCopyableBuilder { + + @Nonnull + private final List activeFeatures; + + @Nullable + private final Float boost; + + @Nullable + private final Boolean cache; + + @Nullable + private final String featureset; + + @Nullable + private final String model; + + @Nullable + private final String name; + + @Nonnull + private final Map params; + + @Nullable + private final String store; + + // --------------------------------------------------------------------------------------------- + + private StoredLtrQuery(Builder builder) { + this.activeFeatures = ApiTypeHelper.unmodifiable(builder.activeFeatures); + this.boost = builder.boost; + this.cache = builder.cache; + this.featureset = builder.featureset; + this.model = builder.model; + this.name = builder.name; + this.params = ApiTypeHelper.unmodifiableRequired(builder.params, this, "params"); + this.store = builder.store; + } + + public static StoredLtrQuery of(Function> fn) { + return fn.apply(new Builder()).build(); + } + + /** + * {@link Query} variant kind. + */ + @Override + public Query.Kind _queryKind() { + return Query.Kind.Sltr; + } + + /** + * API name: {@code active_features} + */ + @Nonnull + public final List activeFeatures() { + return this.activeFeatures; + } + + /** + * API name: {@code boost} + */ + @Nullable + public final Float boost() { + return this.boost; + } + + /** + * API name: {@code cache} + */ + @Nullable + public final Boolean cache() { + return this.cache; + } + + /** + * API name: {@code featureset} + */ + @Nullable + public final String featureset() { + return this.featureset; + } + + /** + * API name: {@code model} + */ + @Nullable + public final String model() { + return this.model; + } + + /** + * API name: {@code _name} + */ + @Nullable + public final String name() { + return this.name; + } + + /** + * Required - API name: {@code params} + */ + @Nonnull + public final Map params() { + return this.params; + } + + /** + * API name: {@code store} + */ + @Nullable + public final String store() { + return this.store; + } + + /** + * 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.activeFeatures)) { + generator.writeKey("active_features"); + generator.writeStartArray(); + for (String item0 : this.activeFeatures) { + generator.write(item0); + } + generator.writeEnd(); + } + + if (this.boost != null) { + generator.writeKey("boost"); + generator.write(this.boost); + } + + if (this.cache != null) { + generator.writeKey("cache"); + generator.write(this.cache); + } + + if (this.featureset != null) { + generator.writeKey("featureset"); + generator.write(this.featureset); + } + + if (this.model != null) { + generator.writeKey("model"); + generator.write(this.model); + } + + if (this.name != null) { + generator.writeKey("_name"); + generator.write(this.name); + } + + generator.writeKey("params"); + generator.writeStartObject(); + for (Map.Entry item0 : this.params.entrySet()) { + generator.writeKey(item0.getKey()); + item0.getValue().serialize(generator, mapper); + } + generator.writeEnd(); + + if (this.store != null) { + generator.writeKey("store"); + generator.write(this.store); + } + } + + // --------------------------------------------------------------------------------------------- + + @Override + @Nonnull + public Builder toBuilder() { + return new Builder(this); + } + + @Nonnull + public static Builder builder() { + return new Builder(); + } + + /** + * Builder for {@link StoredLtrQuery}. + */ + public static class Builder extends ObjectBuilderBase implements CopyableBuilder { + @Nullable + private List activeFeatures; + @Nullable + private Float boost; + @Nullable + private Boolean cache; + @Nullable + private String featureset; + @Nullable + private String model; + @Nullable + private String name; + private Map params; + @Nullable + private String store; + + public Builder() {} + + private Builder(StoredLtrQuery o) { + this.activeFeatures = _listCopy(o.activeFeatures); + this.boost = o.boost; + this.cache = o.cache; + this.featureset = o.featureset; + this.model = o.model; + this.name = o.name; + this.params = _mapCopy(o.params); + this.store = o.store; + } + + private Builder(Builder o) { + this.activeFeatures = _listCopy(o.activeFeatures); + this.boost = o.boost; + this.cache = o.cache; + this.featureset = o.featureset; + this.model = o.model; + this.name = o.name; + this.params = _mapCopy(o.params); + this.store = o.store; + } + + @Override + @Nonnull + public Builder copy() { + return new Builder(this); + } + + /** + * API name: {@code active_features} + * + *

+ * Adds all elements of list to activeFeatures. + *

+ */ + @Nonnull + public final Builder activeFeatures(List list) { + this.activeFeatures = _listAddAll(this.activeFeatures, list); + return this; + } + + /** + * API name: {@code active_features} + * + *

+ * Adds one or more values to activeFeatures. + *

+ */ + @Nonnull + public final Builder activeFeatures(String value, String... values) { + this.activeFeatures = _listAdd(this.activeFeatures, value, values); + return this; + } + + /** + * API name: {@code boost} + */ + @Nonnull + public final Builder boost(@Nullable Float value) { + this.boost = value; + return this; + } + + /** + * API name: {@code cache} + */ + @Nonnull + public final Builder cache(@Nullable Boolean value) { + this.cache = value; + return this; + } + + /** + * API name: {@code featureset} + */ + @Nonnull + public final Builder featureset(@Nullable String value) { + this.featureset = value; + return this; + } + + /** + * API name: {@code model} + */ + @Nonnull + public final Builder model(@Nullable String value) { + this.model = value; + return this; + } + + /** + * API name: {@code _name} + */ + @Nonnull + public final Builder name(@Nullable String value) { + this.name = value; + return this; + } + + /** + * Required - API name: {@code params} + * + *

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

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

+ * Adds an entry to params. + *

+ */ + @Nonnull + public final Builder params(String key, JsonData value) { + this.params = _mapPut(this.params, key, value); + return this; + } + + /** + * API name: {@code store} + */ + @Nonnull + public final Builder store(@Nullable String value) { + this.store = value; + return this; + } + + /** + * Builds a {@link StoredLtrQuery}. + * + * @throws NullPointerException if some of the required fields are null. + */ + @Override + @Nonnull + public StoredLtrQuery build() { + _checkSingleUse(); + + return new StoredLtrQuery(this); + } + } + + // --------------------------------------------------------------------------------------------- + + /** + * Json deserializer for {@link StoredLtrQuery} + */ + public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer.lazy( + Builder::new, + StoredLtrQuery::setupStoredLtrQueryDeserializer + ); + + protected static void setupStoredLtrQueryDeserializer(ObjectDeserializer op) { + op.add(Builder::activeFeatures, JsonpDeserializer.arrayDeserializer(JsonpDeserializer.stringDeserializer()), "active_features"); + op.add(Builder::boost, JsonpDeserializer.floatDeserializer(), "boost"); + op.add(Builder::cache, JsonpDeserializer.booleanDeserializer(), "cache"); + op.add(Builder::featureset, JsonpDeserializer.stringDeserializer(), "featureset"); + op.add(Builder::model, JsonpDeserializer.stringDeserializer(), "model"); + op.add(Builder::name, JsonpDeserializer.stringDeserializer(), "_name"); + op.add(Builder::params, JsonpDeserializer.stringMapDeserializer(JsonData._DESERIALIZER), "params"); + op.add(Builder::store, JsonpDeserializer.stringDeserializer(), "store"); + } + + @Override + public int hashCode() { + int result = 17; + result = 31 * result + Objects.hashCode(this.activeFeatures); + result = 31 * result + Objects.hashCode(this.boost); + result = 31 * result + Objects.hashCode(this.cache); + result = 31 * result + Objects.hashCode(this.featureset); + result = 31 * result + Objects.hashCode(this.model); + result = 31 * result + Objects.hashCode(this.name); + result = 31 * result + this.params.hashCode(); + result = 31 * result + Objects.hashCode(this.store); + return result; + } + + @Override + public boolean equals(Object o) { + if (this == o) return true; + if (o == null || this.getClass() != o.getClass()) return false; + StoredLtrQuery other = (StoredLtrQuery) o; + return Objects.equals(this.activeFeatures, other.activeFeatures) + && Objects.equals(this.boost, other.boost) + && Objects.equals(this.cache, other.cache) + && Objects.equals(this.featureset, other.featureset) + && Objects.equals(this.model, other.model) + && Objects.equals(this.name, other.name) + && this.params.equals(other.params) + && Objects.equals(this.store, other.store); + } +} diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/query_dsl/TermsLookup.java b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/query_dsl/TermsLookup.java index 155cb3f9f4..2b2f88616c 100644 --- a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/query_dsl/TermsLookup.java +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/query_dsl/TermsLookup.java @@ -48,7 +48,6 @@ import org.opensearch.client.json.ObjectBuilderDeserializer; import org.opensearch.client.json.ObjectDeserializer; import org.opensearch.client.json.PlainJsonSerializable; -import org.opensearch.client.util.ApiTypeHelper; import org.opensearch.client.util.CopyableBuilder; import org.opensearch.client.util.ObjectBuilder; import org.opensearch.client.util.ObjectBuilderBase; @@ -60,29 +59,17 @@ @Generated("org.opensearch.client.codegen.CodeGenerator") public class TermsLookup implements PlainJsonSerializable, ToCopyableBuilder { - @Nonnull - private final String id; - - @Nonnull - private final String index; - - @Nonnull - private final String path; - @Nullable - private final String routing; + private final String id; @Nullable - private final Boolean store; + private final Query query; // --------------------------------------------------------------------------------------------- private TermsLookup(Builder builder) { - this.id = ApiTypeHelper.requireNonNull(builder.id, this, "id"); - this.index = ApiTypeHelper.requireNonNull(builder.index, this, "index"); - this.path = ApiTypeHelper.requireNonNull(builder.path, this, "path"); - this.routing = builder.routing; - this.store = builder.store; + this.id = builder.id; + this.query = builder.query; } public static TermsLookup of(Function> fn) { @@ -90,43 +77,19 @@ public static TermsLookup of(Function { - private String id; - private String index; - private String path; @Nullable - private String routing; + private String id; @Nullable - private Boolean store; + private Query query; public Builder() {} private Builder(TermsLookup o) { this.id = o.id; - this.index = o.index; - this.path = o.path; - this.routing = o.routing; - this.store = o.store; + this.query = o.query; } private Builder(Builder o) { this.id = o.id; - this.index = o.index; - this.path = o.path; - this.routing = o.routing; - this.store = o.store; + this.query = o.query; } @Override @@ -210,48 +155,29 @@ public Builder copy() { } /** - * Required - API name: {@code id} + * API name: {@code id} */ @Nonnull - public final Builder id(String value) { + public final Builder id(@Nullable String value) { this.id = value; return this; } /** - * Required - API name: {@code index} + * API name: {@code query} */ @Nonnull - public final Builder index(String value) { - this.index = value; + public final Builder query(@Nullable Query value) { + this.query = value; return this; } /** - * Required - API name: {@code path} + * API name: {@code query} */ @Nonnull - public final Builder path(String value) { - this.path = value; - return this; - } - - /** - * API name: {@code routing} - */ - @Nonnull - public final Builder routing(@Nullable String value) { - this.routing = value; - return this; - } - - /** - * API name: {@code store} - */ - @Nonnull - public final Builder store(@Nullable Boolean value) { - this.store = value; - return this; + public final Builder query(Function> fn) { + return query(fn.apply(new Query.Builder()).build()); } /** @@ -280,20 +206,14 @@ public TermsLookup build() { protected static void setupTermsLookupDeserializer(ObjectDeserializer op) { op.add(Builder::id, JsonpDeserializer.stringDeserializer(), "id"); - op.add(Builder::index, JsonpDeserializer.stringDeserializer(), "index"); - op.add(Builder::path, JsonpDeserializer.stringDeserializer(), "path"); - op.add(Builder::routing, JsonpDeserializer.stringDeserializer(), "routing"); - op.add(Builder::store, JsonpDeserializer.booleanDeserializer(), "store"); + op.add(Builder::query, Query._DESERIALIZER, "query"); } @Override public int hashCode() { int result = 17; - result = 31 * result + this.id.hashCode(); - result = 31 * result + this.index.hashCode(); - result = 31 * result + this.path.hashCode(); - result = 31 * result + Objects.hashCode(this.routing); - result = 31 * result + Objects.hashCode(this.store); + result = 31 * result + Objects.hashCode(this.id); + result = 31 * result + Objects.hashCode(this.query); return result; } @@ -302,10 +222,6 @@ public boolean equals(Object o) { if (this == o) return true; if (o == null || this.getClass() != o.getClass()) return false; TermsLookup other = (TermsLookup) o; - return this.id.equals(other.id) - && this.index.equals(other.index) - && this.path.equals(other.path) - && Objects.equals(this.routing, other.routing) - && Objects.equals(this.store, other.store); + return Objects.equals(this.id, other.id) && Objects.equals(this.query, other.query); } } diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/cat/NodesRequest.java b/java-client/src/generated/java/org/opensearch/client/opensearch/cat/NodesRequest.java index 30ee374b70..8f4dcf44f5 100644 --- a/java-client/src/generated/java/org/opensearch/client/opensearch/cat/NodesRequest.java +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/cat/NodesRequest.java @@ -139,7 +139,7 @@ public final Time masterTimeout() { /** * Specifies the time units, for example, 5d or 7h. For more information, see - * Supported units. + * Supported units. *

* API name: {@code time} *

@@ -283,7 +283,7 @@ public final Builder masterTimeout(Function> f /** * Specifies the time units, for example, 5d or 7h. For more information, see - * Supported units. + * Supported units. *

* API name: {@code time} *

diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/cat/PendingTasksRequest.java b/java-client/src/generated/java/org/opensearch/client/opensearch/cat/PendingTasksRequest.java index f99e9f0681..c1bcc54db0 100644 --- a/java-client/src/generated/java/org/opensearch/client/opensearch/cat/PendingTasksRequest.java +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/cat/PendingTasksRequest.java @@ -110,7 +110,7 @@ public final Time masterTimeout() { /** * Specifies the time units, for example, 5d or 7h. For more information, see - * Supported units. + * Supported units. *

* API name: {@code time} *

@@ -222,7 +222,7 @@ public final Builder masterTimeout(Function> f /** * Specifies the time units, for example, 5d or 7h. For more information, see - * Supported units. + * Supported units. *

* API name: {@code time} *

diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/cat/RecoveryRequest.java b/java-client/src/generated/java/org/opensearch/client/opensearch/cat/RecoveryRequest.java index 6dc4b8347d..03149cce40 100644 --- a/java-client/src/generated/java/org/opensearch/client/opensearch/cat/RecoveryRequest.java +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/cat/RecoveryRequest.java @@ -139,7 +139,7 @@ public final List index() { /** * Specifies the time units, for example, 5d or 7h. For more information, see - * Supported units. + * Supported units. *

* API name: {@code time} *

@@ -281,7 +281,7 @@ public final Builder index(String value, String... values) { /** * Specifies the time units, for example, 5d or 7h. For more information, see - * Supported units. + * Supported units. *

* API name: {@code time} *

diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/cat/SegmentReplicationRequest.java b/java-client/src/generated/java/org/opensearch/client/opensearch/cat/SegmentReplicationRequest.java index 973a189097..1d6f1fb744 100644 --- a/java-client/src/generated/java/org/opensearch/client/opensearch/cat/SegmentReplicationRequest.java +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/cat/SegmentReplicationRequest.java @@ -240,7 +240,7 @@ public final List shards() { /** * Specifies the time units, for example, 5d or 7h. For more information, see - * Supported units. + * Supported units. *

* API name: {@code time} *

@@ -536,7 +536,7 @@ public final Builder shards(String value, String... values) { /** * Specifies the time units, for example, 5d or 7h. For more information, see - * Supported units. + * Supported units. *

* API name: {@code time} *

diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/cat/ShardsRequest.java b/java-client/src/generated/java/org/opensearch/client/opensearch/cat/ShardsRequest.java index 27cc6565de..b305ebdde0 100644 --- a/java-client/src/generated/java/org/opensearch/client/opensearch/cat/ShardsRequest.java +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/cat/ShardsRequest.java @@ -142,7 +142,7 @@ public final Time masterTimeout() { /** * Specifies the time units, for example, 5d or 7h. For more information, see - * Supported units. + * Supported units. *

* API name: {@code time} *

@@ -308,7 +308,7 @@ public final Builder masterTimeout(Function> f /** * Specifies the time units, for example, 5d or 7h. For more information, see - * Supported units. + * Supported units. *

* API name: {@code time} *

diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/cat/SnapshotsRequest.java b/java-client/src/generated/java/org/opensearch/client/opensearch/cat/SnapshotsRequest.java index 35ec192567..a591ec3fba 100644 --- a/java-client/src/generated/java/org/opensearch/client/opensearch/cat/SnapshotsRequest.java +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/cat/SnapshotsRequest.java @@ -141,7 +141,7 @@ public final List repository() { /** * Specifies the time units, for example, 5d or 7h. For more information, see - * Supported units. + * Supported units. *

* API name: {@code time} *

@@ -307,7 +307,7 @@ public final Builder repository(String value, String... values) { /** * Specifies the time units, for example, 5d or 7h. For more information, see - * Supported units. + * Supported units. *

* API name: {@code time} *

diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/cat/TasksRequest.java b/java-client/src/generated/java/org/opensearch/client/opensearch/cat/TasksRequest.java index 9caf91c953..bff680323b 100644 --- a/java-client/src/generated/java/org/opensearch/client/opensearch/cat/TasksRequest.java +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/cat/TasksRequest.java @@ -139,7 +139,7 @@ public final String parentTaskId() { /** * Specifies the time units, for example, 5d or 7h. For more information, see - * Supported units. + * Supported units. *

* API name: {@code time} *

@@ -303,7 +303,7 @@ public final Builder parentTaskId(@Nullable String value) { /** * Specifies the time units, for example, 5d or 7h. For more information, see - * Supported units. + * Supported units. *

* API name: {@code time} *

diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/cluster/ClusterStatsRequest.java b/java-client/src/generated/java/org/opensearch/client/opensearch/cluster/ClusterStatsRequest.java index a2e1b942a6..73e13ac36f 100644 --- a/java-client/src/generated/java/org/opensearch/client/opensearch/cluster/ClusterStatsRequest.java +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/cluster/ClusterStatsRequest.java @@ -110,7 +110,7 @@ public final Boolean flatSettings() { /** * A comma-separated list of - * index metric groups, + * index metric groups, * for example, docs,store. *

* API name: {@code index_metric} @@ -134,7 +134,7 @@ public final List metric() { /** * A comma-separated list of node IDs used to filter results. Supports - * node filters. + * node filters. *

* API name: {@code node_id} *

@@ -233,7 +233,7 @@ public final Builder flatSettings(@Nullable Boolean value) { /** * A comma-separated list of - * index metric + * index metric * groups, for example, docs,store. *

* API name: {@code index_metric} @@ -251,7 +251,7 @@ public final Builder indexMetric(List list) { /** * A comma-separated list of - * index metric + * index metric * groups, for example, docs,store. *

* API name: {@code index_metric} @@ -301,7 +301,7 @@ public final Builder metric(Metric value, Metric... values) { /** * A comma-separated list of node IDs used to filter results. Supports - * node filters. + * node filters. *

* API name: {@code node_id} *

@@ -318,7 +318,7 @@ public final Builder nodeId(List list) { /** * A comma-separated list of node IDs used to filter results. Supports - * node filters. + * node filters. *

* API name: {@code node_id} *

diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/cluster/DeleteComponentTemplateRequest.java b/java-client/src/generated/java/org/opensearch/client/opensearch/cluster/DeleteComponentTemplateRequest.java index dbe8fd1fa3..3180a98102 100644 --- a/java-client/src/generated/java/org/opensearch/client/opensearch/cluster/DeleteComponentTemplateRequest.java +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/cluster/DeleteComponentTemplateRequest.java @@ -94,7 +94,7 @@ public static DeleteComponentTemplateRequest of( /** * The amount of time to wait for a response from the cluster manager node. For more information about supported time units, see - * Common parameters. + * Common parameters. *

* API name: {@code cluster_manager_timeout} *

@@ -201,7 +201,7 @@ protected Builder self() { /** * The amount of time to wait for a response from the cluster manager node. For more information about supported time units, see - * Common parameters. + * Common parameters. *

* API name: {@code cluster_manager_timeout} *

@@ -214,7 +214,7 @@ public final Builder clusterManagerTimeout(@Nullable Time value) { /** * The amount of time to wait for a response from the cluster manager node. For more information about supported time units, see - * Common parameters. + * Common parameters. *

* API name: {@code cluster_manager_timeout} *

diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/cluster/ExistsComponentTemplateRequest.java b/java-client/src/generated/java/org/opensearch/client/opensearch/cluster/ExistsComponentTemplateRequest.java index 4e2ec6feea..7d680074af 100644 --- a/java-client/src/generated/java/org/opensearch/client/opensearch/cluster/ExistsComponentTemplateRequest.java +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/cluster/ExistsComponentTemplateRequest.java @@ -96,7 +96,7 @@ public static ExistsComponentTemplateRequest of( /** * The amount of time to wait for a response from the cluster manager node. For more information about supported time units, see - * Common parameters. + * Common parameters. *

* API name: {@code cluster_manager_timeout} *

@@ -202,7 +202,7 @@ protected Builder self() { /** * The amount of time to wait for a response from the cluster manager node. For more information about supported time units, see - * Common parameters. + * Common parameters. *

* API name: {@code cluster_manager_timeout} *

@@ -215,7 +215,7 @@ public final Builder clusterManagerTimeout(@Nullable Time value) { /** * The amount of time to wait for a response from the cluster manager node. For more information about supported time units, see - * Common parameters. + * Common parameters. *

* API name: {@code cluster_manager_timeout} *

diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/cluster/GetClusterSettingsRequest.java b/java-client/src/generated/java/org/opensearch/client/opensearch/cluster/GetClusterSettingsRequest.java index 9c999c538f..1a36d6367c 100644 --- a/java-client/src/generated/java/org/opensearch/client/opensearch/cluster/GetClusterSettingsRequest.java +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/cluster/GetClusterSettingsRequest.java @@ -95,7 +95,7 @@ public static GetClusterSettingsRequest of(FunctionCommon parameters. + * Common parameters. *

* API name: {@code cluster_manager_timeout} *

@@ -220,7 +220,7 @@ protected Builder self() { /** * The amount of time to wait for a response from the cluster manager node. For more information about supported time units, see - * Common parameters. + * Common parameters. *

* API name: {@code cluster_manager_timeout} *

@@ -233,7 +233,7 @@ public final Builder clusterManagerTimeout(@Nullable Time value) { /** * The amount of time to wait for a response from the cluster manager node. For more information about supported time units, see - * Common parameters. + * Common parameters. *

* API name: {@code cluster_manager_timeout} *

diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/cluster/GetComponentTemplateRequest.java b/java-client/src/generated/java/org/opensearch/client/opensearch/cluster/GetComponentTemplateRequest.java index 2983aa5c87..61e6cc5059 100644 --- a/java-client/src/generated/java/org/opensearch/client/opensearch/cluster/GetComponentTemplateRequest.java +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/cluster/GetComponentTemplateRequest.java @@ -97,7 +97,7 @@ public static GetComponentTemplateRequest of( /** * The amount of time to wait for a response from the cluster manager node. For more information about supported time units, see - * Common parameters. + * Common parameters. *

* API name: {@code cluster_manager_timeout} *

@@ -221,7 +221,7 @@ protected Builder self() { /** * The amount of time to wait for a response from the cluster manager node. For more information about supported time units, see - * Common parameters. + * Common parameters. *

* API name: {@code cluster_manager_timeout} *

@@ -234,7 +234,7 @@ public final Builder clusterManagerTimeout(@Nullable Time value) { /** * The amount of time to wait for a response from the cluster manager node. For more information about supported time units, see - * Common parameters. + * Common parameters. *

* API name: {@code cluster_manager_timeout} *

diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/cluster/HealthRequest.java b/java-client/src/generated/java/org/opensearch/client/opensearch/cluster/HealthRequest.java index 6a24b01dab..f9140ebc25 100644 --- a/java-client/src/generated/java/org/opensearch/client/opensearch/cluster/HealthRequest.java +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/cluster/HealthRequest.java @@ -149,7 +149,7 @@ public final String awarenessAttribute() { /** * The amount of time to wait for a response from the cluster manager node. For more information about supported time units, see - * Common parameters. + * Common parameters. *

* API name: {@code cluster_manager_timeout} *

@@ -220,7 +220,7 @@ public final Time masterTimeout() { /** * The amount of time to wait for a response from the cluster manager node. For more information about supported time units, see - * Common parameters. + * Common parameters. *

* API name: {@code timeout} *

@@ -409,7 +409,7 @@ public final Builder awarenessAttribute(@Nullable String value) { /** * The amount of time to wait for a response from the cluster manager node. For more information about supported time units, see - * Common parameters. + * Common parameters. *

* API name: {@code cluster_manager_timeout} *

@@ -422,7 +422,7 @@ public final Builder clusterManagerTimeout(@Nullable Time value) { /** * The amount of time to wait for a response from the cluster manager node. For more information about supported time units, see - * Common parameters. + * Common parameters. *

* API name: {@code cluster_manager_timeout} *

@@ -553,7 +553,7 @@ public final Builder masterTimeout(Function> f /** * The amount of time to wait for a response from the cluster manager node. For more information about supported time units, see - * Common parameters. + * Common parameters. *

* API name: {@code timeout} *

@@ -566,7 +566,7 @@ public final Builder timeout(@Nullable Time value) { /** * The amount of time to wait for a response from the cluster manager node. For more information about supported time units, see - * Common parameters. + * Common parameters. *

* API name: {@code timeout} *

diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/cluster/PendingTasksRequest.java b/java-client/src/generated/java/org/opensearch/client/opensearch/cluster/PendingTasksRequest.java index 53cc75507f..564d820457 100644 --- a/java-client/src/generated/java/org/opensearch/client/opensearch/cluster/PendingTasksRequest.java +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/cluster/PendingTasksRequest.java @@ -85,7 +85,7 @@ public static PendingTasksRequest of(FunctionCommon parameters. + * Common parameters. *

* API name: {@code cluster_manager_timeout} *

@@ -175,7 +175,7 @@ protected Builder self() { /** * The amount of time to wait for a response from the cluster manager node. For more information about supported time units, see - * Common parameters. + * Common parameters. *

* API name: {@code cluster_manager_timeout} *

@@ -188,7 +188,7 @@ public final Builder clusterManagerTimeout(@Nullable Time value) { /** * The amount of time to wait for a response from the cluster manager node. For more information about supported time units, see - * Common parameters. + * Common parameters. *

* API name: {@code cluster_manager_timeout} *

diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/cluster/PutClusterSettingsRequest.java b/java-client/src/generated/java/org/opensearch/client/opensearch/cluster/PutClusterSettingsRequest.java index 3a6468409e..ed2c9e3d0b 100644 --- a/java-client/src/generated/java/org/opensearch/client/opensearch/cluster/PutClusterSettingsRequest.java +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/cluster/PutClusterSettingsRequest.java @@ -110,7 +110,7 @@ public static PutClusterSettingsRequest of(FunctionCommon parameters. + * Common parameters. *

* API name: {@code cluster_manager_timeout} *

@@ -276,7 +276,7 @@ protected Builder self() { /** * The amount of time to wait for a response from the cluster manager node. For more information about supported time units, see - * Common parameters. + * Common parameters. *

* API name: {@code cluster_manager_timeout} *

@@ -289,7 +289,7 @@ public final Builder clusterManagerTimeout(@Nullable Time value) { /** * The amount of time to wait for a response from the cluster manager node. For more information about supported time units, see - * Common parameters. + * Common parameters. *

* API name: {@code cluster_manager_timeout} *

diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/cluster/PutComponentTemplateRequest.java b/java-client/src/generated/java/org/opensearch/client/opensearch/cluster/PutComponentTemplateRequest.java index f4050daabd..21b360bc93 100644 --- a/java-client/src/generated/java/org/opensearch/client/opensearch/cluster/PutComponentTemplateRequest.java +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/cluster/PutComponentTemplateRequest.java @@ -138,7 +138,7 @@ public final Boolean allowAutoCreate() { /** * The amount of time to wait for a response from the cluster manager node. For more information about supported time units, see - * Common parameters. + * Common parameters. *

* API name: {@code cluster_manager_timeout} *

@@ -188,7 +188,7 @@ public final Map meta() { * for its data streams. If you want to overwrite one of these templates, set the replacement template version to a higher * value than the current version. If you want to disable all built-in component and index templates, set * stack.templates.enabled to false using the - * Cluster Update Settings API. + * Cluster Update Settings API. *

* API name: {@code name} *

@@ -354,7 +354,7 @@ public final Builder allowAutoCreate(@Nullable Boolean value) { /** * The amount of time to wait for a response from the cluster manager node. For more information about supported time units, see - * Common parameters. + * Common parameters. *

* API name: {@code cluster_manager_timeout} *

@@ -367,7 +367,7 @@ public final Builder clusterManagerTimeout(@Nullable Time value) { /** * The amount of time to wait for a response from the cluster manager node. For more information about supported time units, see - * Common parameters. + * Common parameters. *

* API name: {@code cluster_manager_timeout} *

@@ -451,7 +451,7 @@ public final Builder meta(String key, JsonData value) { * indexes for its data streams. If you want to overwrite one of these templates, set the replacement template version * to a higher value than the current version. If you want to disable all built-in component and index templates, set * stack.templates.enabled to false using the - * Cluster Update Settings API. + * Cluster Update Settings API. *

* API name: {@code name} *

diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/cluster/RerouteRequest.java b/java-client/src/generated/java/org/opensearch/client/opensearch/cluster/RerouteRequest.java index 1a69723da8..7cd9c96aa1 100644 --- a/java-client/src/generated/java/org/opensearch/client/opensearch/cluster/RerouteRequest.java +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/cluster/RerouteRequest.java @@ -121,7 +121,7 @@ public static RerouteRequest of(FunctionCommon parameters. + * Common parameters. *

* API name: {@code cluster_manager_timeout} *

@@ -308,7 +308,7 @@ protected Builder self() { /** * The amount of time to wait for a response from the cluster manager node. For more information about supported time units, see - * Common parameters. + * Common parameters. *

* API name: {@code cluster_manager_timeout} *

@@ -321,7 +321,7 @@ public final Builder clusterManagerTimeout(@Nullable Time value) { /** * The amount of time to wait for a response from the cluster manager node. For more information about supported time units, see - * Common parameters. + * Common parameters. *

* API name: {@code cluster_manager_timeout} *

diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/cluster/StateRequest.java b/java-client/src/generated/java/org/opensearch/client/opensearch/cluster/StateRequest.java index 91653a0ed8..9f0b19148f 100644 --- a/java-client/src/generated/java/org/opensearch/client/opensearch/cluster/StateRequest.java +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/cluster/StateRequest.java @@ -134,7 +134,7 @@ public final Boolean allowNoIndices() { /** * The amount of time to wait for a response from the cluster manager node. For more information about supported time units, see - * Common parameters. + * Common parameters. *

* API name: {@code cluster_manager_timeout} *

@@ -218,7 +218,7 @@ public final Time masterTimeout() { /** * Limits the information returned to only the - * specified metric groups. + * specified metric groups. *

* API name: {@code metric} *

@@ -349,7 +349,7 @@ public final Builder allowNoIndices(@Nullable Boolean value) { /** * The amount of time to wait for a response from the cluster manager node. For more information about supported time units, see - * Common parameters. + * Common parameters. *

* API name: {@code cluster_manager_timeout} *

@@ -362,7 +362,7 @@ public final Builder clusterManagerTimeout(@Nullable Time value) { /** * The amount of time to wait for a response from the cluster manager node. For more information about supported time units, see - * Common parameters. + * Common parameters. *

* API name: {@code cluster_manager_timeout} *

@@ -507,7 +507,7 @@ public final Builder masterTimeout(Function> f /** * Limits the information returned to only the - * specified metric groups. + * specified metric groups. *

* API name: {@code metric} *

@@ -524,7 +524,7 @@ public final Builder metric(List list) { /** * Limits the information returned to only the - * specified metric groups. + * specified metric groups. *

* API name: {@code metric} *

diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/core/CreatePitRequest.java b/java-client/src/generated/java/org/opensearch/client/opensearch/core/CreatePitRequest.java index 1f3c142bba..bc2ffb1396 100644 --- a/java-client/src/generated/java/org/opensearch/client/opensearch/core/CreatePitRequest.java +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/core/CreatePitRequest.java @@ -64,16 +64,25 @@ @Generated("org.opensearch.client.codegen.CodeGenerator") public final class CreatePitRequest extends RequestBase implements ToCopyableBuilder { + @Nullable + private final Boolean allowNoIndices; + @Nullable private final Boolean allowPartialPitCreation; @Nonnull private final List expandWildcards; + @Nullable + private final Boolean ignoreThrottled; + + @Nullable + private final Boolean ignoreUnavailable; + @Nonnull private final List index; - @Nullable + @Nonnull private final Time keepAlive; @Nullable @@ -86,10 +95,13 @@ public final class CreatePitRequest extends RequestBase implements ToCopyableBui private CreatePitRequest(Builder builder) { super(builder); + this.allowNoIndices = builder.allowNoIndices; this.allowPartialPitCreation = builder.allowPartialPitCreation; this.expandWildcards = ApiTypeHelper.unmodifiable(builder.expandWildcards); + this.ignoreThrottled = builder.ignoreThrottled; + this.ignoreUnavailable = builder.ignoreUnavailable; this.index = ApiTypeHelper.unmodifiableRequired(builder.index, this, "index"); - this.keepAlive = builder.keepAlive; + this.keepAlive = ApiTypeHelper.requireNonNull(builder.keepAlive, this, "keepAlive"); this.preference = builder.preference; this.routing = ApiTypeHelper.unmodifiable(builder.routing); } @@ -98,6 +110,18 @@ public static CreatePitRequest of(Functionfalse, the request returns an error if any wildcard expression, index alias, or _all value targets only + * missing or closed indexes. This behavior applies even if the request targets other open indexes. + *

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

+ */ + @Nullable + public final Boolean allowNoIndices() { + return this.allowNoIndices; + } + /** * Allow if point in time can be created with partial failures. *

@@ -120,6 +144,28 @@ public final List expandWildcards() { return this.expandWildcards; } + /** + * If true, concrete, expanded or aliased indexes will be ignored when frozen. + *

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

+ */ + @Nullable + public final Boolean ignoreThrottled() { + return this.ignoreThrottled; + } + + /** + * If false, the request returns an error if it targets a missing or closed index. + *

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

+ */ + @Nullable + public final Boolean ignoreUnavailable() { + return this.ignoreUnavailable; + } + /** * Required - A comma-separated list of indexes; use _all or empty string to perform the operation on all indexes. *

@@ -132,12 +178,12 @@ public final List index() { } /** - * Specify the keep alive for point in time. + * Required - Specify the keep alive for point in time. *

* API name: {@code keep_alive} *

*/ - @Nullable + @Nonnull public final Time keepAlive() { return this.keepAlive; } @@ -181,12 +227,17 @@ public static Builder builder() { * Builder for {@link CreatePitRequest}. */ public static class Builder extends RequestBase.AbstractBuilder implements CopyableBuilder { + @Nullable + private Boolean allowNoIndices; @Nullable private Boolean allowPartialPitCreation; @Nullable private List expandWildcards; - private List index; @Nullable + private Boolean ignoreThrottled; + @Nullable + private Boolean ignoreUnavailable; + private List index; private Time keepAlive; @Nullable private String preference; @@ -197,8 +248,11 @@ public Builder() {} private Builder(CreatePitRequest o) { super(o); + this.allowNoIndices = o.allowNoIndices; this.allowPartialPitCreation = o.allowPartialPitCreation; this.expandWildcards = _listCopy(o.expandWildcards); + this.ignoreThrottled = o.ignoreThrottled; + this.ignoreUnavailable = o.ignoreUnavailable; this.index = _listCopy(o.index); this.keepAlive = o.keepAlive; this.preference = o.preference; @@ -207,8 +261,11 @@ private Builder(CreatePitRequest o) { private Builder(Builder o) { super(o); + this.allowNoIndices = o.allowNoIndices; this.allowPartialPitCreation = o.allowPartialPitCreation; this.expandWildcards = _listCopy(o.expandWildcards); + this.ignoreThrottled = o.ignoreThrottled; + this.ignoreUnavailable = o.ignoreUnavailable; this.index = _listCopy(o.index); this.keepAlive = o.keepAlive; this.preference = o.preference; @@ -227,6 +284,19 @@ protected Builder self() { return this; } + /** + * If false, the request returns an error if any wildcard expression, index alias, or _all value targets + * only missing or closed indexes. This behavior applies even if the request targets other open indexes. + *

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

+ */ + @Nonnull + public final Builder allowNoIndices(@Nullable Boolean value) { + this.allowNoIndices = value; + return this; + } + /** * Allow if point in time can be created with partial failures. *

@@ -271,6 +341,30 @@ public final Builder expandWildcards(ExpandWildcard value, ExpandWildcard... val return this; } + /** + * If true, concrete, expanded or aliased indexes will be ignored when frozen. + *

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

+ */ + @Nonnull + public final Builder ignoreThrottled(@Nullable Boolean value) { + this.ignoreThrottled = value; + return this; + } + + /** + * If false, the request returns an error if it targets a missing or closed index. + *

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

+ */ + @Nonnull + public final Builder ignoreUnavailable(@Nullable Boolean value) { + this.ignoreUnavailable = value; + return this; + } + /** * Required - A comma-separated list of indexes; use _all or empty string to perform the operation on all indexes. *

@@ -304,19 +398,19 @@ public final Builder index(String value, String... values) { } /** - * Specify the keep alive for point in time. + * Required - Specify the keep alive for point in time. *

* API name: {@code keep_alive} *

*/ @Nonnull - public final Builder keepAlive(@Nullable Time value) { + public final Builder keepAlive(Time value) { this.keepAlive = value; return this; } /** - * Specify the keep alive for point in time. + * Required - Specify the keep alive for point in time. *

* API name: {@code keep_alive} *

@@ -389,15 +483,22 @@ public CreatePitRequest build() { @Override protected void applyQueryParameters(@Nonnull Map params) { super.applyQueryParameters(params); + if (this.allowNoIndices != null) { + params.put("allow_no_indices", String.valueOf(this.allowNoIndices)); + } if (this.allowPartialPitCreation != null) { params.put("allow_partial_pit_creation", String.valueOf(this.allowPartialPitCreation)); } if (ApiTypeHelper.isDefined(this.expandWildcards)) { params.put("expand_wildcards", this.expandWildcards.stream().map(v -> v.jsonValue()).collect(Collectors.joining(","))); } - if (this.keepAlive != null) { - params.put("keep_alive", this.keepAlive._toJsonString()); + if (this.ignoreThrottled != null) { + params.put("ignore_throttled", String.valueOf(this.ignoreThrottled)); + } + if (this.ignoreUnavailable != null) { + params.put("ignore_unavailable", String.valueOf(this.ignoreUnavailable)); } + params.put("keep_alive", this.keepAlive._toJsonString()); if (this.preference != null) { params.put("preference", this.preference); } @@ -434,10 +535,13 @@ protected void applyQueryParameters(@Nonnull Map params) { @Override public int hashCode() { int result = 17; + result = 31 * result + Objects.hashCode(this.allowNoIndices); result = 31 * result + Objects.hashCode(this.allowPartialPitCreation); result = 31 * result + Objects.hashCode(this.expandWildcards); + result = 31 * result + Objects.hashCode(this.ignoreThrottled); + result = 31 * result + Objects.hashCode(this.ignoreUnavailable); result = 31 * result + this.index.hashCode(); - result = 31 * result + Objects.hashCode(this.keepAlive); + result = 31 * result + this.keepAlive.hashCode(); result = 31 * result + Objects.hashCode(this.preference); result = 31 * result + Objects.hashCode(this.routing); return result; @@ -448,10 +552,13 @@ public boolean equals(Object o) { if (this == o) return true; if (o == null || this.getClass() != o.getClass()) return false; CreatePitRequest other = (CreatePitRequest) o; - return Objects.equals(this.allowPartialPitCreation, other.allowPartialPitCreation) + return Objects.equals(this.allowNoIndices, other.allowNoIndices) + && Objects.equals(this.allowPartialPitCreation, other.allowPartialPitCreation) && Objects.equals(this.expandWildcards, other.expandWildcards) + && Objects.equals(this.ignoreThrottled, other.ignoreThrottled) + && Objects.equals(this.ignoreUnavailable, other.ignoreUnavailable) && this.index.equals(other.index) - && Objects.equals(this.keepAlive, other.keepAlive) + && this.keepAlive.equals(other.keepAlive) && Objects.equals(this.preference, other.preference) && Objects.equals(this.routing, other.routing); } diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/core/CreatePitResponse.java b/java-client/src/generated/java/org/opensearch/client/opensearch/core/CreatePitResponse.java index 5bde25993e..26cb59239f 100644 --- a/java-client/src/generated/java/org/opensearch/client/opensearch/core/CreatePitResponse.java +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/core/CreatePitResponse.java @@ -37,11 +37,9 @@ package org.opensearch.client.opensearch.core; import jakarta.json.stream.JsonGenerator; -import java.util.Objects; import java.util.function.Function; import javax.annotation.Generated; import javax.annotation.Nonnull; -import javax.annotation.Nullable; import org.opensearch.client.json.JsonpDeserializable; import org.opensearch.client.json.JsonpDeserializer; import org.opensearch.client.json.JsonpMapper; @@ -49,6 +47,7 @@ import org.opensearch.client.json.ObjectDeserializer; import org.opensearch.client.json.PlainJsonSerializable; import org.opensearch.client.opensearch._types.ShardStatistics; +import org.opensearch.client.util.ApiTypeHelper; import org.opensearch.client.util.CopyableBuilder; import org.opensearch.client.util.ObjectBuilder; import org.opensearch.client.util.ObjectBuilderBase; @@ -60,21 +59,20 @@ @Generated("org.opensearch.client.codegen.CodeGenerator") public class CreatePitResponse implements PlainJsonSerializable, ToCopyableBuilder { - @Nullable - private final Long creationTime; + private final long creationTime; - @Nullable + @Nonnull private final String pitId; - @Nullable + @Nonnull private final ShardStatistics shards; // --------------------------------------------------------------------------------------------- private CreatePitResponse(Builder builder) { - this.creationTime = builder.creationTime; - this.pitId = builder.pitId; - this.shards = builder.shards; + this.creationTime = ApiTypeHelper.requireNonNull(builder.creationTime, this, "creationTime"); + this.pitId = ApiTypeHelper.requireNonNull(builder.pitId, this, "pitId"); + this.shards = ApiTypeHelper.requireNonNull(builder.shards, this, "shards"); } public static CreatePitResponse of(Function> fn) { @@ -82,25 +80,24 @@ public static CreatePitResponse of(Function { - @Nullable private Long creationTime; - @Nullable private String pitId; - @Nullable private ShardStatistics shards; public Builder() {} @@ -177,34 +165,34 @@ public Builder copy() { } /** - * API name: {@code creation_time} + * Required - API name: {@code creation_time} */ @Nonnull - public final Builder creationTime(@Nullable Long value) { + public final Builder creationTime(long value) { this.creationTime = value; return this; } /** - * API name: {@code pit_id} + * Required - API name: {@code pit_id} */ @Nonnull - public final Builder pitId(@Nullable String value) { + public final Builder pitId(String value) { this.pitId = value; return this; } /** - * API name: {@code _shards} + * Required - API name: {@code _shards} */ @Nonnull - public final Builder shards(@Nullable ShardStatistics value) { + public final Builder shards(ShardStatistics value) { this.shards = value; return this; } /** - * API name: {@code _shards} + * Required - API name: {@code _shards} */ @Nonnull public final Builder shards(Function> fn) { @@ -244,9 +232,9 @@ protected static void setupCreatePitResponseDeserializer(ObjectDeserializer { - @Nullable + @Nonnull private final String pitId; - @Nullable - private final Boolean successful; + private final boolean successful; // --------------------------------------------------------------------------------------------- private DeletedPit(Builder builder) { - this.pitId = builder.pitId; - this.successful = builder.successful; + this.pitId = ApiTypeHelper.requireNonNull(builder.pitId, this, "pitId"); + this.successful = ApiTypeHelper.requireNonNull(builder.successful, this, "successful"); } public static DeletedPit of(Function> fn) { @@ -77,18 +75,17 @@ public static DeletedPit of(Function { - @Nullable private String pitId; - @Nullable private Boolean successful; public Builder() {} @@ -155,19 +146,19 @@ public Builder copy() { } /** - * API name: {@code pit_id} + * Required - API name: {@code pit_id} */ @Nonnull - public final Builder pitId(@Nullable String value) { + public final Builder pitId(String value) { this.pitId = value; return this; } /** - * API name: {@code successful} + * Required - API name: {@code successful} */ @Nonnull - public final Builder successful(@Nullable Boolean value) { + public final Builder successful(boolean value) { this.successful = value; return this; } @@ -204,8 +195,8 @@ protected static void setupDeletedPitDeserializer(ObjectDeserializer { +public abstract class SearchResultJsonValue extends SearchResult { // --------------------------------------------------------------------------------------------- - protected RangeAggregateBase(AbstractBuilder builder) { + protected SearchResultJsonValue(AbstractBuilder builder) { super(builder); } // --------------------------------------------------------------------------------------------- - public abstract static class AbstractBuilder> extends - MultiBucketAggregateBase.AbstractBuilder { + public abstract static class AbstractBuilder> extends + SearchResult.AbstractBuilder { protected AbstractBuilder() {} - protected AbstractBuilder(RangeAggregateBase o) { + protected AbstractBuilder(SearchResultJsonValue o) { super(o); } - protected AbstractBuilder(AbstractBuilder o) { + protected AbstractBuilder(AbstractBuilder o) { super(o); } @@ -69,10 +70,11 @@ protected AbstractBuilder(AbstractBuilder o) { // --------------------------------------------------------------------------------------------- - protected static > void setupRangeAggregateBaseDeserializer( - ObjectDeserializer op + protected static > void setupSearchResultJsonValueDeserializer( + ObjectDeserializer op, + JsonpDeserializer tDocumentDeserializer ) { - setupMultiBucketAggregateBaseDeserializer(op, RangeBucket._DESERIALIZER); + setupSearchResultDeserializer(op, tDocumentDeserializer); } @Override diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/indices/IngestionSource.java b/java-client/src/generated/java/org/opensearch/client/opensearch/indices/IngestionSource.java index be6ecf2388..c6484b4fc0 100644 --- a/java-client/src/generated/java/org/opensearch/client/opensearch/indices/IngestionSource.java +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/indices/IngestionSource.java @@ -75,6 +75,12 @@ public class IngestionSource implements PlainJsonSerializable, ToCopyableBuilder @Nullable private final Integer internalQueueSize; + @Nonnull + private final Map mapperSettings; + + @Nullable + private final IngestionSourceMapperType mapperType; + @Nullable private final Integer numProcessorThreads; @@ -108,6 +114,8 @@ private IngestionSource(Builder builder) { this.allActive = builder.allActive; this.errorStrategy = builder.errorStrategy; this.internalQueueSize = builder.internalQueueSize; + this.mapperSettings = ApiTypeHelper.unmodifiable(builder.mapperSettings); + this.mapperType = builder.mapperType; this.numProcessorThreads = builder.numProcessorThreads; this.param = ApiTypeHelper.unmodifiable(builder.param); this.pointer = builder.pointer; @@ -156,6 +164,28 @@ public final Integer internalQueueSize() { return this.internalQueueSize; } + /** + * Configuration settings for the selected mapper type. + *

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

+ */ + @Nonnull + public final Map mapperSettings() { + return this.mapperSettings; + } + + /** + * The type of message mapper used to extract document fields from ingestion messages. + *

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

+ */ + @Nullable + public final IngestionSourceMapperType mapperType() { + return this.mapperType; + } + /** * Defines the number of processor or writer threads. *

@@ -272,6 +302,21 @@ protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { generator.write(this.internalQueueSize); } + if (ApiTypeHelper.isDefined(this.mapperSettings)) { + generator.writeKey("mapper_settings"); + generator.writeStartObject(); + for (Map.Entry item0 : this.mapperSettings.entrySet()) { + generator.writeKey(item0.getKey()); + item0.getValue().serialize(generator, mapper); + } + generator.writeEnd(); + } + + if (this.mapperType != null) { + generator.writeKey("mapper_type"); + this.mapperType.serialize(generator, mapper); + } + if (this.numProcessorThreads != null) { generator.writeKey("num_processor_threads"); generator.write(this.numProcessorThreads); @@ -347,6 +392,10 @@ public static class Builder extends ObjectBuilderBase implements CopyableBuilder @Nullable private Integer internalQueueSize; @Nullable + private Map mapperSettings; + @Nullable + private IngestionSourceMapperType mapperType; + @Nullable private Integer numProcessorThreads; @Nullable private Map param; @@ -371,6 +420,8 @@ private Builder(IngestionSource o) { this.allActive = o.allActive; this.errorStrategy = o.errorStrategy; this.internalQueueSize = o.internalQueueSize; + this.mapperSettings = _mapCopy(o.mapperSettings); + this.mapperType = o.mapperType; this.numProcessorThreads = o.numProcessorThreads; this.param = _mapCopy(o.param); this.pointer = o.pointer; @@ -386,6 +437,8 @@ private Builder(Builder o) { this.allActive = o.allActive; this.errorStrategy = o.errorStrategy; this.internalQueueSize = o.internalQueueSize; + this.mapperSettings = _mapCopy(o.mapperSettings); + this.mapperType = o.mapperType; this.numProcessorThreads = o.numProcessorThreads; this.param = _mapCopy(o.param); this.pointer = o.pointer; @@ -439,6 +492,50 @@ public final Builder internalQueueSize(@Nullable Integer value) { return this; } + /** + * Configuration settings for the selected mapper type. + *

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

+ * + *

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

+ */ + @Nonnull + public final Builder mapperSettings(Map map) { + this.mapperSettings = _mapPutAll(this.mapperSettings, map); + return this; + } + + /** + * Configuration settings for the selected mapper type. + *

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

+ * + *

+ * Adds an entry to mapperSettings. + *

+ */ + @Nonnull + public final Builder mapperSettings(String key, JsonData value) { + this.mapperSettings = _mapPut(this.mapperSettings, key, value); + return this; + } + + /** + * The type of message mapper used to extract document fields from ingestion messages. + *

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

+ */ + @Nonnull + public final Builder mapperType(@Nullable IngestionSourceMapperType value) { + this.mapperType = value; + return this; + } + /** * Defines the number of processor or writer threads. *

@@ -602,6 +699,8 @@ protected static void setupIngestionSourceDeserializer(ObjectDeserializer _DESERIALIZER = new JsonEnum.Deserializer<>( + IngestionSourceMapperType.values() + ); } diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/ingest/ChunkingAlgorithm.java b/java-client/src/generated/java/org/opensearch/client/opensearch/ingest/ChunkingAlgorithm.java new file mode 100644 index 0000000000..73d5e8430e --- /dev/null +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/ingest/ChunkingAlgorithm.java @@ -0,0 +1,237 @@ +/* + * 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.ingest; + +import jakarta.json.stream.JsonGenerator; +import java.util.Objects; +import java.util.function.Function; +import javax.annotation.Generated; +import javax.annotation.Nonnull; +import javax.annotation.Nullable; +import org.opensearch.client.json.JsonpDeserializable; +import org.opensearch.client.json.JsonpDeserializer; +import org.opensearch.client.json.JsonpMapper; +import org.opensearch.client.json.ObjectBuilderDeserializer; +import org.opensearch.client.json.ObjectDeserializer; +import org.opensearch.client.json.PlainJsonSerializable; +import org.opensearch.client.util.CopyableBuilder; +import org.opensearch.client.util.ObjectBuilder; +import org.opensearch.client.util.ObjectBuilderBase; +import org.opensearch.client.util.ToCopyableBuilder; + +// typedef: ingest.ChunkingAlgorithm + +@JsonpDeserializable +@Generated("org.opensearch.client.codegen.CodeGenerator") +public class ChunkingAlgorithm implements PlainJsonSerializable, ToCopyableBuilder { + + @Nullable + private final DelimiterChunkingAlgorithm delimiter; + + @Nullable + private final FixedTokenLengthChunkingAlgorithm fixedTokenLength; + + // --------------------------------------------------------------------------------------------- + + private ChunkingAlgorithm(Builder builder) { + this.delimiter = builder.delimiter; + this.fixedTokenLength = builder.fixedTokenLength; + } + + public static ChunkingAlgorithm of(Function> fn) { + return fn.apply(new Builder()).build(); + } + + /** + * API name: {@code delimiter} + */ + @Nullable + public final DelimiterChunkingAlgorithm delimiter() { + return this.delimiter; + } + + /** + * API name: {@code fixed_token_length} + */ + @Nullable + public final FixedTokenLengthChunkingAlgorithm fixedTokenLength() { + return this.fixedTokenLength; + } + + /** + * Serialize this object to JSON. + */ + @Override + public void serialize(JsonGenerator generator, JsonpMapper mapper) { + generator.writeStartObject(); + serializeInternal(generator, mapper); + generator.writeEnd(); + } + + protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { + if (this.delimiter != null) { + generator.writeKey("delimiter"); + this.delimiter.serialize(generator, mapper); + } + + if (this.fixedTokenLength != null) { + generator.writeKey("fixed_token_length"); + this.fixedTokenLength.serialize(generator, mapper); + } + } + + // --------------------------------------------------------------------------------------------- + + @Override + @Nonnull + public Builder toBuilder() { + return new Builder(this); + } + + @Nonnull + public static Builder builder() { + return new Builder(); + } + + /** + * Builder for {@link ChunkingAlgorithm}. + */ + public static class Builder extends ObjectBuilderBase implements CopyableBuilder { + @Nullable + private DelimiterChunkingAlgorithm delimiter; + @Nullable + private FixedTokenLengthChunkingAlgorithm fixedTokenLength; + + public Builder() {} + + private Builder(ChunkingAlgorithm o) { + this.delimiter = o.delimiter; + this.fixedTokenLength = o.fixedTokenLength; + } + + private Builder(Builder o) { + this.delimiter = o.delimiter; + this.fixedTokenLength = o.fixedTokenLength; + } + + @Override + @Nonnull + public Builder copy() { + return new Builder(this); + } + + /** + * API name: {@code delimiter} + */ + @Nonnull + public final Builder delimiter(@Nullable DelimiterChunkingAlgorithm value) { + this.delimiter = value; + return this; + } + + /** + * API name: {@code delimiter} + */ + @Nonnull + public final Builder delimiter(Function> fn) { + return delimiter(fn.apply(new DelimiterChunkingAlgorithm.Builder()).build()); + } + + /** + * API name: {@code fixed_token_length} + */ + @Nonnull + public final Builder fixedTokenLength(@Nullable FixedTokenLengthChunkingAlgorithm value) { + this.fixedTokenLength = value; + return this; + } + + /** + * API name: {@code fixed_token_length} + */ + @Nonnull + public final Builder fixedTokenLength( + Function> fn + ) { + return fixedTokenLength(fn.apply(new FixedTokenLengthChunkingAlgorithm.Builder()).build()); + } + + /** + * Builds a {@link ChunkingAlgorithm}. + * + * @throws NullPointerException if some of the required fields are null. + */ + @Override + @Nonnull + public ChunkingAlgorithm build() { + _checkSingleUse(); + + return new ChunkingAlgorithm(this); + } + } + + // --------------------------------------------------------------------------------------------- + + /** + * Json deserializer for {@link ChunkingAlgorithm} + */ + public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer.lazy( + Builder::new, + ChunkingAlgorithm::setupChunkingAlgorithmDeserializer + ); + + protected static void setupChunkingAlgorithmDeserializer(ObjectDeserializer op) { + op.add(Builder::delimiter, DelimiterChunkingAlgorithm._DESERIALIZER, "delimiter"); + op.add(Builder::fixedTokenLength, FixedTokenLengthChunkingAlgorithm._DESERIALIZER, "fixed_token_length"); + } + + @Override + public int hashCode() { + int result = 17; + result = 31 * result + Objects.hashCode(this.delimiter); + result = 31 * result + Objects.hashCode(this.fixedTokenLength); + return result; + } + + @Override + public boolean equals(Object o) { + if (this == o) return true; + if (o == null || this.getClass() != o.getClass()) return false; + ChunkingAlgorithm other = (ChunkingAlgorithm) o; + return Objects.equals(this.delimiter, other.delimiter) && Objects.equals(this.fixedTokenLength, other.fixedTokenLength); + } +} diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/aggregations/LongTermsBucket.java b/java-client/src/generated/java/org/opensearch/client/opensearch/ingest/DelimiterChunkingAlgorithm.java similarity index 50% rename from java-client/src/generated/java/org/opensearch/client/opensearch/_types/aggregations/LongTermsBucket.java rename to java-client/src/generated/java/org/opensearch/client/opensearch/ingest/DelimiterChunkingAlgorithm.java index b83db9853b..50037240b4 100644 --- a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/aggregations/LongTermsBucket.java +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/ingest/DelimiterChunkingAlgorithm.java @@ -34,7 +34,7 @@ // THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. //---------------------------------------------------- -package org.opensearch.client.opensearch._types.aggregations; +package org.opensearch.client.opensearch.ingest; import jakarta.json.stream.JsonGenerator; import java.util.Objects; @@ -47,59 +47,78 @@ import org.opensearch.client.json.JsonpMapper; import org.opensearch.client.json.ObjectBuilderDeserializer; import org.opensearch.client.json.ObjectDeserializer; -import org.opensearch.client.util.ApiTypeHelper; +import org.opensearch.client.json.PlainJsonSerializable; import org.opensearch.client.util.CopyableBuilder; import org.opensearch.client.util.ObjectBuilder; +import org.opensearch.client.util.ObjectBuilderBase; import org.opensearch.client.util.ToCopyableBuilder; -// typedef: _types.aggregations.LongTermsBucket +// typedef: ingest.DelimiterChunkingAlgorithm @JsonpDeserializable @Generated("org.opensearch.client.codegen.CodeGenerator") -public class LongTermsBucket extends TermsBucketBase implements ToCopyableBuilder { +public class DelimiterChunkingAlgorithm + implements + PlainJsonSerializable, + ToCopyableBuilder { - @Nonnull - private final LongTermsBucketKey key; + @Nullable + private final String delimiter; @Nullable - private final String keyAsString; + private final Integer maxChunkLimit; // --------------------------------------------------------------------------------------------- - private LongTermsBucket(Builder builder) { - super(builder); - this.key = ApiTypeHelper.requireNonNull(builder.key, this, "key"); - this.keyAsString = builder.keyAsString; + private DelimiterChunkingAlgorithm(Builder builder) { + this.delimiter = builder.delimiter; + this.maxChunkLimit = builder.maxChunkLimit; } - public static LongTermsBucket of(Function> fn) { + public static DelimiterChunkingAlgorithm of( + Function> fn + ) { return fn.apply(new Builder()).build(); } /** - * Required - API name: {@code key} + * The string delimiter to split on. + *

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

*/ - @Nonnull - public final LongTermsBucketKey key() { - return this.key; + @Nullable + public final String delimiter() { + return this.delimiter; } /** - * API name: {@code key_as_string} + * API name: {@code max_chunk_limit} */ @Nullable - public final String keyAsString() { - return this.keyAsString; + public final Integer maxChunkLimit() { + return this.maxChunkLimit; + } + + /** + * Serialize this object to JSON. + */ + @Override + public void serialize(JsonGenerator generator, JsonpMapper mapper) { + generator.writeStartObject(); + serializeInternal(generator, mapper); + generator.writeEnd(); } protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { - super.serializeInternal(generator, mapper); - generator.writeKey("key"); - this.key.serialize(generator, mapper); + if (this.delimiter != null) { + generator.writeKey("delimiter"); + generator.write(this.delimiter); + } - if (this.keyAsString != null) { - generator.writeKey("key_as_string"); - generator.write(this.keyAsString); + if (this.maxChunkLimit != null) { + generator.writeKey("max_chunk_limit"); + generator.write(this.maxChunkLimit); } } @@ -117,25 +136,24 @@ public static Builder builder() { } /** - * Builder for {@link LongTermsBucket}. + * Builder for {@link DelimiterChunkingAlgorithm}. */ - public static class Builder extends TermsBucketBase.AbstractBuilder implements CopyableBuilder { - private LongTermsBucketKey key; + public static class Builder extends ObjectBuilderBase implements CopyableBuilder { + @Nullable + private String delimiter; @Nullable - private String keyAsString; + private Integer maxChunkLimit; public Builder() {} - private Builder(LongTermsBucket o) { - super(o); - this.key = o.key; - this.keyAsString = o.keyAsString; + private Builder(DelimiterChunkingAlgorithm o) { + this.delimiter = o.delimiter; + this.maxChunkLimit = o.maxChunkLimit; } private Builder(Builder o) { - super(o); - this.key = o.key; - this.keyAsString = o.keyAsString; + this.delimiter = o.delimiter; + this.maxChunkLimit = o.maxChunkLimit; } @Override @@ -144,84 +162,69 @@ public Builder copy() { return new Builder(this); } - @Override - @Nonnull - protected Builder self() { - return this; - } - /** - * Required - API name: {@code key} + * The string delimiter to split on. + *

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

*/ @Nonnull - public final Builder key(LongTermsBucketKey value) { - this.key = value; + public final Builder delimiter(@Nullable String value) { + this.delimiter = value; return this; } /** - * Required - API name: {@code key} + * API name: {@code max_chunk_limit} */ @Nonnull - public final Builder key(Function> fn) { - return key(fn.apply(new LongTermsBucketKey.Builder()).build()); - } - - /** - * API name: {@code key_as_string} - */ - @Nonnull - public final Builder keyAsString(@Nullable String value) { - this.keyAsString = value; + public final Builder maxChunkLimit(@Nullable Integer value) { + this.maxChunkLimit = value; return this; } /** - * Builds a {@link LongTermsBucket}. + * Builds a {@link DelimiterChunkingAlgorithm}. * * @throws NullPointerException if some of the required fields are null. */ @Override @Nonnull - public LongTermsBucket build() { + public DelimiterChunkingAlgorithm build() { _checkSingleUse(); - return new LongTermsBucket(this); + return new DelimiterChunkingAlgorithm(this); } } // --------------------------------------------------------------------------------------------- /** - * Json deserializer for {@link LongTermsBucket} + * Json deserializer for {@link DelimiterChunkingAlgorithm} */ - public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer.lazy( + public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer.lazy( Builder::new, - LongTermsBucket::setupLongTermsBucketDeserializer + DelimiterChunkingAlgorithm::setupDelimiterChunkingAlgorithmDeserializer ); - protected static void setupLongTermsBucketDeserializer(ObjectDeserializer op) { - setupTermsBucketBaseDeserializer(op); - op.add(Builder::key, LongTermsBucketKey._DESERIALIZER, "key"); - op.add(Builder::keyAsString, JsonpDeserializer.stringDeserializer(), "key_as_string"); + protected static void setupDelimiterChunkingAlgorithmDeserializer(ObjectDeserializer op) { + op.add(Builder::delimiter, JsonpDeserializer.stringDeserializer(), "delimiter"); + op.add(Builder::maxChunkLimit, JsonpDeserializer.integerDeserializer(), "max_chunk_limit"); } @Override public int hashCode() { - int result = super.hashCode(); - result = 31 * result + this.key.hashCode(); - result = 31 * result + Objects.hashCode(this.keyAsString); + int result = 17; + result = 31 * result + Objects.hashCode(this.delimiter); + result = 31 * result + Objects.hashCode(this.maxChunkLimit); return result; } @Override public boolean equals(Object o) { - if (!super.equals(o)) { - return false; - } if (this == o) return true; if (o == null || this.getClass() != o.getClass()) return false; - LongTermsBucket other = (LongTermsBucket) o; - return this.key.equals(other.key) && Objects.equals(this.keyAsString, other.keyAsString); + DelimiterChunkingAlgorithm other = (DelimiterChunkingAlgorithm) o; + return Objects.equals(this.delimiter, other.delimiter) && Objects.equals(this.maxChunkLimit, other.maxChunkLimit); } } diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/ingest/FixedTokenLengthChunkingAlgorithm.java b/java-client/src/generated/java/org/opensearch/client/opensearch/ingest/FixedTokenLengthChunkingAlgorithm.java new file mode 100644 index 0000000000..a65ede7d55 --- /dev/null +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/ingest/FixedTokenLengthChunkingAlgorithm.java @@ -0,0 +1,311 @@ +/* + * 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.ingest; + +import jakarta.json.stream.JsonGenerator; +import java.util.Objects; +import java.util.function.Function; +import javax.annotation.Generated; +import javax.annotation.Nonnull; +import javax.annotation.Nullable; +import org.opensearch.client.json.JsonpDeserializable; +import org.opensearch.client.json.JsonpDeserializer; +import org.opensearch.client.json.JsonpMapper; +import org.opensearch.client.json.ObjectBuilderDeserializer; +import org.opensearch.client.json.ObjectDeserializer; +import org.opensearch.client.json.PlainJsonSerializable; +import org.opensearch.client.util.CopyableBuilder; +import org.opensearch.client.util.ObjectBuilder; +import org.opensearch.client.util.ObjectBuilderBase; +import org.opensearch.client.util.ToCopyableBuilder; + +// typedef: ingest.FixedTokenLengthChunkingAlgorithm + +@JsonpDeserializable +@Generated("org.opensearch.client.codegen.CodeGenerator") +public class FixedTokenLengthChunkingAlgorithm + implements + PlainJsonSerializable, + ToCopyableBuilder { + + @Nullable + private final Integer maxChunkLimit; + + @Nullable + private final Double overlapRate; + + @Nullable + private final Integer tokenLimit; + + @Nullable + private final String tokenizer; + + // --------------------------------------------------------------------------------------------- + + private FixedTokenLengthChunkingAlgorithm(Builder builder) { + this.maxChunkLimit = builder.maxChunkLimit; + this.overlapRate = builder.overlapRate; + this.tokenLimit = builder.tokenLimit; + this.tokenizer = builder.tokenizer; + } + + public static FixedTokenLengthChunkingAlgorithm of( + Function> fn + ) { + return fn.apply(new Builder()).build(); + } + + /** + * API name: {@code max_chunk_limit} + */ + @Nullable + public final Integer maxChunkLimit() { + return this.maxChunkLimit; + } + + /** + * Fraction of tokens to overlap between consecutive chunks. Value between 0 and 0.5. + *

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

+ */ + @Nullable + public final Double overlapRate() { + return this.overlapRate; + } + + /** + * Maximum number of tokens per chunk. + *

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

+ */ + @Nullable + public final Integer tokenLimit() { + return this.tokenLimit; + } + + /** + * The tokenizer to use, for example "standard". + *

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

+ */ + @Nullable + public final String tokenizer() { + return this.tokenizer; + } + + /** + * Serialize this object to JSON. + */ + @Override + public void serialize(JsonGenerator generator, JsonpMapper mapper) { + generator.writeStartObject(); + serializeInternal(generator, mapper); + generator.writeEnd(); + } + + protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { + if (this.maxChunkLimit != null) { + generator.writeKey("max_chunk_limit"); + generator.write(this.maxChunkLimit); + } + + if (this.overlapRate != null) { + generator.writeKey("overlap_rate"); + generator.write(this.overlapRate); + } + + if (this.tokenLimit != null) { + generator.writeKey("token_limit"); + generator.write(this.tokenLimit); + } + + if (this.tokenizer != null) { + generator.writeKey("tokenizer"); + generator.write(this.tokenizer); + } + } + + // --------------------------------------------------------------------------------------------- + + @Override + @Nonnull + public Builder toBuilder() { + return new Builder(this); + } + + @Nonnull + public static Builder builder() { + return new Builder(); + } + + /** + * Builder for {@link FixedTokenLengthChunkingAlgorithm}. + */ + public static class Builder extends ObjectBuilderBase implements CopyableBuilder { + @Nullable + private Integer maxChunkLimit; + @Nullable + private Double overlapRate; + @Nullable + private Integer tokenLimit; + @Nullable + private String tokenizer; + + public Builder() {} + + private Builder(FixedTokenLengthChunkingAlgorithm o) { + this.maxChunkLimit = o.maxChunkLimit; + this.overlapRate = o.overlapRate; + this.tokenLimit = o.tokenLimit; + this.tokenizer = o.tokenizer; + } + + private Builder(Builder o) { + this.maxChunkLimit = o.maxChunkLimit; + this.overlapRate = o.overlapRate; + this.tokenLimit = o.tokenLimit; + this.tokenizer = o.tokenizer; + } + + @Override + @Nonnull + public Builder copy() { + return new Builder(this); + } + + /** + * API name: {@code max_chunk_limit} + */ + @Nonnull + public final Builder maxChunkLimit(@Nullable Integer value) { + this.maxChunkLimit = value; + return this; + } + + /** + * Fraction of tokens to overlap between consecutive chunks. Value between 0 and 0.5. + *

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

+ */ + @Nonnull + public final Builder overlapRate(@Nullable Double value) { + this.overlapRate = value; + return this; + } + + /** + * Maximum number of tokens per chunk. + *

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

+ */ + @Nonnull + public final Builder tokenLimit(@Nullable Integer value) { + this.tokenLimit = value; + return this; + } + + /** + * The tokenizer to use, for example "standard". + *

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

+ */ + @Nonnull + public final Builder tokenizer(@Nullable String value) { + this.tokenizer = value; + return this; + } + + /** + * Builds a {@link FixedTokenLengthChunkingAlgorithm}. + * + * @throws NullPointerException if some of the required fields are null. + */ + @Override + @Nonnull + public FixedTokenLengthChunkingAlgorithm build() { + _checkSingleUse(); + + return new FixedTokenLengthChunkingAlgorithm(this); + } + } + + // --------------------------------------------------------------------------------------------- + + /** + * Json deserializer for {@link FixedTokenLengthChunkingAlgorithm} + */ + public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer.lazy( + Builder::new, + FixedTokenLengthChunkingAlgorithm::setupFixedTokenLengthChunkingAlgorithmDeserializer + ); + + protected static void setupFixedTokenLengthChunkingAlgorithmDeserializer( + ObjectDeserializer op + ) { + op.add(Builder::maxChunkLimit, JsonpDeserializer.integerDeserializer(), "max_chunk_limit"); + op.add(Builder::overlapRate, JsonpDeserializer.doubleDeserializer(), "overlap_rate"); + op.add(Builder::tokenLimit, JsonpDeserializer.integerDeserializer(), "token_limit"); + op.add(Builder::tokenizer, JsonpDeserializer.stringDeserializer(), "tokenizer"); + } + + @Override + public int hashCode() { + int result = 17; + result = 31 * result + Objects.hashCode(this.maxChunkLimit); + result = 31 * result + Objects.hashCode(this.overlapRate); + result = 31 * result + Objects.hashCode(this.tokenLimit); + result = 31 * result + Objects.hashCode(this.tokenizer); + return result; + } + + @Override + public boolean equals(Object o) { + if (this == o) return true; + if (o == null || this.getClass() != o.getClass()) return false; + FixedTokenLengthChunkingAlgorithm other = (FixedTokenLengthChunkingAlgorithm) o; + return Objects.equals(this.maxChunkLimit, other.maxChunkLimit) + && Objects.equals(this.overlapRate, other.overlapRate) + && Objects.equals(this.tokenLimit, other.tokenLimit) + && Objects.equals(this.tokenizer, other.tokenizer); + } +} diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/ingest/Processor.java b/java-client/src/generated/java/org/opensearch/client/opensearch/ingest/Processor.java index f016292223..767681ba8c 100644 --- a/java-client/src/generated/java/org/opensearch/client/opensearch/ingest/Processor.java +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/ingest/Processor.java @@ -92,8 +92,11 @@ public enum Kind implements JsonEnum { Set("set"), SetSecurityUser("set_security_user"), Sort("sort"), + SparseEncoding("sparse_encoding"), Split("split"), + TextChunking("text_chunking"), TextEmbedding("text_embedding"), + TextImageEmbedding("text_image_embedding"), Trim("trim"), Uppercase("uppercase"), Urldecode("urldecode"), @@ -570,6 +573,22 @@ public SortProcessor sort() { return TaggedUnionUtils.get(this, Kind.Sort); } + /** + * Is this variant instance of kind {@code sparse_encoding}? + */ + public boolean isSparseEncoding() { + return _kind == Kind.SparseEncoding; + } + + /** + * Get the {@code sparse_encoding} variant value. + * + * @throws IllegalStateException if the current variant is not the {@code sparse_encoding} kind. + */ + public SparseEncodingProcessor sparseEncoding() { + return TaggedUnionUtils.get(this, Kind.SparseEncoding); + } + /** * Is this variant instance of kind {@code split}? */ @@ -586,6 +605,22 @@ public SplitProcessor split() { return TaggedUnionUtils.get(this, Kind.Split); } + /** + * Is this variant instance of kind {@code text_chunking}? + */ + public boolean isTextChunking() { + return _kind == Kind.TextChunking; + } + + /** + * Get the {@code text_chunking} variant value. + * + * @throws IllegalStateException if the current variant is not the {@code text_chunking} kind. + */ + public TextChunkingProcessor textChunking() { + return TaggedUnionUtils.get(this, Kind.TextChunking); + } + /** * Is this variant instance of kind {@code text_embedding}? */ @@ -602,6 +637,22 @@ public TextEmbeddingProcessor textEmbedding() { return TaggedUnionUtils.get(this, Kind.TextEmbedding); } + /** + * Is this variant instance of kind {@code text_image_embedding}? + */ + public boolean isTextImageEmbedding() { + return _kind == Kind.TextImageEmbedding; + } + + /** + * Get the {@code text_image_embedding} variant value. + * + * @throws IllegalStateException if the current variant is not the {@code text_image_embedding} kind. + */ + public TextImageEmbeddingProcessor textImageEmbedding() { + return TaggedUnionUtils.get(this, Kind.TextImageEmbedding); + } + /** * Is this variant instance of kind {@code trim}? */ @@ -969,6 +1020,18 @@ public ObjectBuilder sort(Function sparseEncoding(SparseEncodingProcessor v) { + this._kind = Kind.SparseEncoding; + this._value = v; + return this; + } + + public ObjectBuilder sparseEncoding( + Function> fn + ) { + return this.sparseEncoding(fn.apply(new SparseEncodingProcessor.Builder()).build()); + } + public ObjectBuilder split(SplitProcessor v) { this._kind = Kind.Split; this._value = v; @@ -979,6 +1042,16 @@ public ObjectBuilder split(Function textChunking(TextChunkingProcessor v) { + this._kind = Kind.TextChunking; + this._value = v; + return this; + } + + public ObjectBuilder textChunking(Function> fn) { + return this.textChunking(fn.apply(new TextChunkingProcessor.Builder()).build()); + } + public ObjectBuilder textEmbedding(TextEmbeddingProcessor v) { this._kind = Kind.TextEmbedding; this._value = v; @@ -989,6 +1062,18 @@ public ObjectBuilder textEmbedding(Function textImageEmbedding(TextImageEmbeddingProcessor v) { + this._kind = Kind.TextImageEmbedding; + this._value = v; + return this; + } + + public ObjectBuilder textImageEmbedding( + Function> fn + ) { + return this.textImageEmbedding(fn.apply(new TextImageEmbeddingProcessor.Builder()).build()); + } + public ObjectBuilder trim(TrimProcessor v) { this._kind = Kind.Trim; this._value = v; @@ -1064,8 +1149,11 @@ protected static void setupProcessorDeserializer(ObjectDeserializer op) op.add(Builder::set, SetProcessor._DESERIALIZER, "set"); op.add(Builder::setSecurityUser, SetSecurityUserProcessor._DESERIALIZER, "set_security_user"); op.add(Builder::sort, SortProcessor._DESERIALIZER, "sort"); + op.add(Builder::sparseEncoding, SparseEncodingProcessor._DESERIALIZER, "sparse_encoding"); op.add(Builder::split, SplitProcessor._DESERIALIZER, "split"); + op.add(Builder::textChunking, TextChunkingProcessor._DESERIALIZER, "text_chunking"); op.add(Builder::textEmbedding, TextEmbeddingProcessor._DESERIALIZER, "text_embedding"); + op.add(Builder::textImageEmbedding, TextImageEmbeddingProcessor._DESERIALIZER, "text_image_embedding"); op.add(Builder::trim, TrimProcessor._DESERIALIZER, "trim"); op.add(Builder::uppercase, UppercaseProcessor._DESERIALIZER, "uppercase"); op.add(Builder::urldecode, UrlDecodeProcessor._DESERIALIZER, "urldecode"); diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/ingest/ProcessorBuilders.java b/java-client/src/generated/java/org/opensearch/client/opensearch/ingest/ProcessorBuilders.java index a84a50c409..1e6a9606fc 100644 --- a/java-client/src/generated/java/org/opensearch/client/opensearch/ingest/ProcessorBuilders.java +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/ingest/ProcessorBuilders.java @@ -235,6 +235,13 @@ public static SortProcessor.Builder sort() { return new SortProcessor.Builder(); } + /** + * Creates a builder for the {@link SparseEncodingProcessor sparse_encoding} {@code Processor} variant. + */ + public static SparseEncodingProcessor.Builder sparseEncoding() { + return new SparseEncodingProcessor.Builder(); + } + /** * Creates a builder for the {@link SplitProcessor split} {@code Processor} variant. */ @@ -242,6 +249,13 @@ public static SplitProcessor.Builder split() { return new SplitProcessor.Builder(); } + /** + * Creates a builder for the {@link TextChunkingProcessor text_chunking} {@code Processor} variant. + */ + public static TextChunkingProcessor.Builder textChunking() { + return new TextChunkingProcessor.Builder(); + } + /** * Creates a builder for the {@link TextEmbeddingProcessor text_embedding} {@code Processor} variant. */ @@ -249,6 +263,13 @@ public static TextEmbeddingProcessor.Builder textEmbedding() { return new TextEmbeddingProcessor.Builder(); } + /** + * Creates a builder for the {@link TextImageEmbeddingProcessor text_image_embedding} {@code Processor} variant. + */ + public static TextImageEmbeddingProcessor.Builder textImageEmbedding() { + return new TextImageEmbeddingProcessor.Builder(); + } + /** * Creates a builder for the {@link TrimProcessor trim} {@code Processor} variant. */ diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/ingest/SparseEncodingProcessor.java b/java-client/src/generated/java/org/opensearch/client/opensearch/ingest/SparseEncodingProcessor.java new file mode 100644 index 0000000000..1c6d83b9fa --- /dev/null +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/ingest/SparseEncodingProcessor.java @@ -0,0 +1,295 @@ +/* + * 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.ingest; + +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.JsonpDeserializable; +import org.opensearch.client.json.JsonpDeserializer; +import org.opensearch.client.json.JsonpMapper; +import org.opensearch.client.json.ObjectBuilderDeserializer; +import org.opensearch.client.json.ObjectDeserializer; +import org.opensearch.client.util.ApiTypeHelper; +import org.opensearch.client.util.CopyableBuilder; +import org.opensearch.client.util.ObjectBuilder; +import org.opensearch.client.util.ToCopyableBuilder; + +// typedef: ingest.SparseEncodingProcessor + +@JsonpDeserializable +@Generated("org.opensearch.client.codegen.CodeGenerator") +public class SparseEncodingProcessor extends ProcessorBase + implements + ProcessorVariant, + ToCopyableBuilder { + + @Nullable + private final Integer batchSize; + + @Nonnull + private final Map fieldMap; + + @Nonnull + private final String modelId; + + // --------------------------------------------------------------------------------------------- + + private SparseEncodingProcessor(Builder builder) { + super(builder); + this.batchSize = builder.batchSize; + this.fieldMap = ApiTypeHelper.unmodifiableRequired(builder.fieldMap, this, "fieldMap"); + this.modelId = ApiTypeHelper.requireNonNull(builder.modelId, this, "modelId"); + } + + public static SparseEncodingProcessor of(Function> fn) { + return fn.apply(new Builder()).build(); + } + + /** + * {@link Processor} variant kind. + */ + @Override + public Processor.Kind _processorKind() { + return Processor.Kind.SparseEncoding; + } + + /** + * API name: {@code batch_size} + */ + @Nullable + public final Integer batchSize() { + return this.batchSize; + } + + /** + * Required - Contains key-value pairs that specify the mapping of a text field to a sparse vector field. + *

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

+ */ + @Nonnull + public final Map fieldMap() { + return this.fieldMap; + } + + /** + * Required - API name: {@code model_id} + */ + @Nonnull + public final String modelId() { + return this.modelId; + } + + protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { + super.serializeInternal(generator, mapper); + if (this.batchSize != null) { + generator.writeKey("batch_size"); + generator.write(this.batchSize); + } + + generator.writeKey("field_map"); + generator.writeStartObject(); + for (Map.Entry item0 : this.fieldMap.entrySet()) { + generator.writeKey(item0.getKey()); + generator.write(item0.getValue()); + } + generator.writeEnd(); + + generator.writeKey("model_id"); + generator.write(this.modelId); + } + + // --------------------------------------------------------------------------------------------- + + @Override + @Nonnull + public Builder toBuilder() { + return new Builder(this); + } + + @Nonnull + public static Builder builder() { + return new Builder(); + } + + /** + * Builder for {@link SparseEncodingProcessor}. + */ + public static class Builder extends ProcessorBase.AbstractBuilder + implements + CopyableBuilder { + @Nullable + private Integer batchSize; + private Map fieldMap; + private String modelId; + + public Builder() {} + + private Builder(SparseEncodingProcessor o) { + super(o); + this.batchSize = o.batchSize; + this.fieldMap = _mapCopy(o.fieldMap); + this.modelId = o.modelId; + } + + private Builder(Builder o) { + super(o); + this.batchSize = o.batchSize; + this.fieldMap = _mapCopy(o.fieldMap); + this.modelId = o.modelId; + } + + @Override + @Nonnull + public Builder copy() { + return new Builder(this); + } + + @Override + @Nonnull + protected Builder self() { + return this; + } + + /** + * API name: {@code batch_size} + */ + @Nonnull + public final Builder batchSize(@Nullable Integer value) { + this.batchSize = value; + return this; + } + + /** + * Required - Contains key-value pairs that specify the mapping of a text field to a sparse vector field. + *

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

+ * + *

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

+ */ + @Nonnull + public final Builder fieldMap(Map map) { + this.fieldMap = _mapPutAll(this.fieldMap, map); + return this; + } + + /** + * Required - Contains key-value pairs that specify the mapping of a text field to a sparse vector field. + *

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

+ * + *

+ * Adds an entry to fieldMap. + *

+ */ + @Nonnull + public final Builder fieldMap(String key, String value) { + this.fieldMap = _mapPut(this.fieldMap, key, value); + return this; + } + + /** + * Required - API name: {@code model_id} + */ + @Nonnull + public final Builder modelId(String value) { + this.modelId = value; + return this; + } + + /** + * Builds a {@link SparseEncodingProcessor}. + * + * @throws NullPointerException if some of the required fields are null. + */ + @Override + @Nonnull + public SparseEncodingProcessor build() { + _checkSingleUse(); + + return new SparseEncodingProcessor(this); + } + } + + // --------------------------------------------------------------------------------------------- + + /** + * Json deserializer for {@link SparseEncodingProcessor} + */ + public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer.lazy( + Builder::new, + SparseEncodingProcessor::setupSparseEncodingProcessorDeserializer + ); + + protected static void setupSparseEncodingProcessorDeserializer(ObjectDeserializer op) { + setupProcessorBaseDeserializer(op); + op.add(Builder::batchSize, JsonpDeserializer.integerDeserializer(), "batch_size"); + op.add(Builder::fieldMap, JsonpDeserializer.stringMapDeserializer(JsonpDeserializer.stringDeserializer()), "field_map"); + op.add(Builder::modelId, JsonpDeserializer.stringDeserializer(), "model_id"); + } + + @Override + public int hashCode() { + int result = super.hashCode(); + result = 31 * result + Objects.hashCode(this.batchSize); + result = 31 * result + this.fieldMap.hashCode(); + result = 31 * result + this.modelId.hashCode(); + return result; + } + + @Override + public boolean equals(Object o) { + if (!super.equals(o)) { + return false; + } + if (this == o) return true; + if (o == null || this.getClass() != o.getClass()) return false; + SparseEncodingProcessor other = (SparseEncodingProcessor) o; + return Objects.equals(this.batchSize, other.batchSize) + && this.fieldMap.equals(other.fieldMap) + && this.modelId.equals(other.modelId); + } +} diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/ingest/TextChunkingProcessor.java b/java-client/src/generated/java/org/opensearch/client/opensearch/ingest/TextChunkingProcessor.java new file mode 100644 index 0000000000..e334239378 --- /dev/null +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/ingest/TextChunkingProcessor.java @@ -0,0 +1,307 @@ +/* + * 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.ingest; + +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.JsonpDeserializable; +import org.opensearch.client.json.JsonpDeserializer; +import org.opensearch.client.json.JsonpMapper; +import org.opensearch.client.json.ObjectBuilderDeserializer; +import org.opensearch.client.json.ObjectDeserializer; +import org.opensearch.client.util.ApiTypeHelper; +import org.opensearch.client.util.CopyableBuilder; +import org.opensearch.client.util.ObjectBuilder; +import org.opensearch.client.util.ToCopyableBuilder; + +// typedef: ingest.TextChunkingProcessor + +@JsonpDeserializable +@Generated("org.opensearch.client.codegen.CodeGenerator") +public class TextChunkingProcessor extends ProcessorBase + implements + ProcessorVariant, + ToCopyableBuilder { + + @Nonnull + private final ChunkingAlgorithm algorithm; + + @Nonnull + private final Map fieldMap; + + @Nullable + private final Integer maxChunkLimit; + + // --------------------------------------------------------------------------------------------- + + private TextChunkingProcessor(Builder builder) { + super(builder); + this.algorithm = ApiTypeHelper.requireNonNull(builder.algorithm, this, "algorithm"); + this.fieldMap = ApiTypeHelper.unmodifiableRequired(builder.fieldMap, this, "fieldMap"); + this.maxChunkLimit = builder.maxChunkLimit; + } + + public static TextChunkingProcessor of(Function> fn) { + return fn.apply(new Builder()).build(); + } + + /** + * {@link Processor} variant kind. + */ + @Override + public Processor.Kind _processorKind() { + return Processor.Kind.TextChunking; + } + + /** + * Required - API name: {@code algorithm} + */ + @Nonnull + public final ChunkingAlgorithm algorithm() { + return this.algorithm; + } + + /** + * Required - Contains key-value pairs that specify the mapping of a source text field to a target chunked field. + *

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

+ */ + @Nonnull + public final Map fieldMap() { + return this.fieldMap; + } + + /** + * Maximum number of chunks a document field can be split into. Defaults to 100. + *

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

+ */ + @Nullable + public final Integer maxChunkLimit() { + return this.maxChunkLimit; + } + + protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { + super.serializeInternal(generator, mapper); + generator.writeKey("algorithm"); + this.algorithm.serialize(generator, mapper); + + generator.writeKey("field_map"); + generator.writeStartObject(); + for (Map.Entry item0 : this.fieldMap.entrySet()) { + generator.writeKey(item0.getKey()); + generator.write(item0.getValue()); + } + generator.writeEnd(); + + if (this.maxChunkLimit != null) { + generator.writeKey("max_chunk_limit"); + generator.write(this.maxChunkLimit); + } + } + + // --------------------------------------------------------------------------------------------- + + @Override + @Nonnull + public Builder toBuilder() { + return new Builder(this); + } + + @Nonnull + public static Builder builder() { + return new Builder(); + } + + /** + * Builder for {@link TextChunkingProcessor}. + */ + public static class Builder extends ProcessorBase.AbstractBuilder implements CopyableBuilder { + private ChunkingAlgorithm algorithm; + private Map fieldMap; + @Nullable + private Integer maxChunkLimit; + + public Builder() {} + + private Builder(TextChunkingProcessor o) { + super(o); + this.algorithm = o.algorithm; + this.fieldMap = _mapCopy(o.fieldMap); + this.maxChunkLimit = o.maxChunkLimit; + } + + private Builder(Builder o) { + super(o); + this.algorithm = o.algorithm; + this.fieldMap = _mapCopy(o.fieldMap); + this.maxChunkLimit = o.maxChunkLimit; + } + + @Override + @Nonnull + public Builder copy() { + return new Builder(this); + } + + @Override + @Nonnull + protected Builder self() { + return this; + } + + /** + * Required - API name: {@code algorithm} + */ + @Nonnull + public final Builder algorithm(ChunkingAlgorithm value) { + this.algorithm = value; + return this; + } + + /** + * Required - API name: {@code algorithm} + */ + @Nonnull + public final Builder algorithm(Function> fn) { + return algorithm(fn.apply(new ChunkingAlgorithm.Builder()).build()); + } + + /** + * Required - Contains key-value pairs that specify the mapping of a source text field to a target chunked field. + *

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

+ * + *

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

+ */ + @Nonnull + public final Builder fieldMap(Map map) { + this.fieldMap = _mapPutAll(this.fieldMap, map); + return this; + } + + /** + * Required - Contains key-value pairs that specify the mapping of a source text field to a target chunked field. + *

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

+ * + *

+ * Adds an entry to fieldMap. + *

+ */ + @Nonnull + public final Builder fieldMap(String key, String value) { + this.fieldMap = _mapPut(this.fieldMap, key, value); + return this; + } + + /** + * Maximum number of chunks a document field can be split into. Defaults to 100. + *

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

+ */ + @Nonnull + public final Builder maxChunkLimit(@Nullable Integer value) { + this.maxChunkLimit = value; + return this; + } + + /** + * Builds a {@link TextChunkingProcessor}. + * + * @throws NullPointerException if some of the required fields are null. + */ + @Override + @Nonnull + public TextChunkingProcessor build() { + _checkSingleUse(); + + return new TextChunkingProcessor(this); + } + } + + // --------------------------------------------------------------------------------------------- + + /** + * Json deserializer for {@link TextChunkingProcessor} + */ + public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer.lazy( + Builder::new, + TextChunkingProcessor::setupTextChunkingProcessorDeserializer + ); + + protected static void setupTextChunkingProcessorDeserializer(ObjectDeserializer op) { + setupProcessorBaseDeserializer(op); + op.add(Builder::algorithm, ChunkingAlgorithm._DESERIALIZER, "algorithm"); + op.add(Builder::fieldMap, JsonpDeserializer.stringMapDeserializer(JsonpDeserializer.stringDeserializer()), "field_map"); + op.add(Builder::maxChunkLimit, JsonpDeserializer.integerDeserializer(), "max_chunk_limit"); + } + + @Override + public int hashCode() { + int result = super.hashCode(); + result = 31 * result + this.algorithm.hashCode(); + result = 31 * result + this.fieldMap.hashCode(); + result = 31 * result + Objects.hashCode(this.maxChunkLimit); + 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; + TextChunkingProcessor other = (TextChunkingProcessor) o; + return this.algorithm.equals(other.algorithm) + && this.fieldMap.equals(other.fieldMap) + && Objects.equals(this.maxChunkLimit, other.maxChunkLimit); + } +} diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/ingest/TextImageEmbeddingProcessor.java b/java-client/src/generated/java/org/opensearch/client/opensearch/ingest/TextImageEmbeddingProcessor.java new file mode 100644 index 0000000000..9a76c2d75e --- /dev/null +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/ingest/TextImageEmbeddingProcessor.java @@ -0,0 +1,261 @@ +/* + * 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.ingest; + +import jakarta.json.stream.JsonGenerator; +import java.util.Map; +import java.util.function.Function; +import javax.annotation.Generated; +import javax.annotation.Nonnull; +import org.opensearch.client.json.JsonpDeserializable; +import org.opensearch.client.json.JsonpDeserializer; +import org.opensearch.client.json.JsonpMapper; +import org.opensearch.client.json.ObjectBuilderDeserializer; +import org.opensearch.client.json.ObjectDeserializer; +import org.opensearch.client.util.ApiTypeHelper; +import org.opensearch.client.util.CopyableBuilder; +import org.opensearch.client.util.ObjectBuilder; +import org.opensearch.client.util.ToCopyableBuilder; + +// typedef: ingest.TextImageEmbeddingProcessor + +@JsonpDeserializable +@Generated("org.opensearch.client.codegen.CodeGenerator") +public class TextImageEmbeddingProcessor extends ProcessorBase + implements + ProcessorVariant, + ToCopyableBuilder { + + @Nonnull + private final Map fieldMap; + + @Nonnull + private final String modelId; + + // --------------------------------------------------------------------------------------------- + + private TextImageEmbeddingProcessor(Builder builder) { + super(builder); + this.fieldMap = ApiTypeHelper.unmodifiableRequired(builder.fieldMap, this, "fieldMap"); + this.modelId = ApiTypeHelper.requireNonNull(builder.modelId, this, "modelId"); + } + + public static TextImageEmbeddingProcessor of( + Function> fn + ) { + return fn.apply(new Builder()).build(); + } + + /** + * {@link Processor} variant kind. + */ + @Override + public Processor.Kind _processorKind() { + return Processor.Kind.TextImageEmbedding; + } + + /** + * Required - Contains key-value pairs that specify the mapping of text/image fields to a vector field. + *

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

+ */ + @Nonnull + public final Map fieldMap() { + return this.fieldMap; + } + + /** + * Required - API name: {@code model_id} + */ + @Nonnull + public final String modelId() { + return this.modelId; + } + + protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { + super.serializeInternal(generator, mapper); + generator.writeKey("field_map"); + generator.writeStartObject(); + for (Map.Entry item0 : this.fieldMap.entrySet()) { + generator.writeKey(item0.getKey()); + generator.write(item0.getValue()); + } + generator.writeEnd(); + + generator.writeKey("model_id"); + generator.write(this.modelId); + } + + // --------------------------------------------------------------------------------------------- + + @Override + @Nonnull + public Builder toBuilder() { + return new Builder(this); + } + + @Nonnull + public static Builder builder() { + return new Builder(); + } + + /** + * Builder for {@link TextImageEmbeddingProcessor}. + */ + public static class Builder extends ProcessorBase.AbstractBuilder + implements + CopyableBuilder { + private Map fieldMap; + private String modelId; + + public Builder() {} + + private Builder(TextImageEmbeddingProcessor o) { + super(o); + this.fieldMap = _mapCopy(o.fieldMap); + this.modelId = o.modelId; + } + + private Builder(Builder o) { + super(o); + this.fieldMap = _mapCopy(o.fieldMap); + this.modelId = o.modelId; + } + + @Override + @Nonnull + public Builder copy() { + return new Builder(this); + } + + @Override + @Nonnull + protected Builder self() { + return this; + } + + /** + * Required - Contains key-value pairs that specify the mapping of text/image fields to a vector field. + *

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

+ * + *

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

+ */ + @Nonnull + public final Builder fieldMap(Map map) { + this.fieldMap = _mapPutAll(this.fieldMap, map); + return this; + } + + /** + * Required - Contains key-value pairs that specify the mapping of text/image fields to a vector field. + *

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

+ * + *

+ * Adds an entry to fieldMap. + *

+ */ + @Nonnull + public final Builder fieldMap(String key, String value) { + this.fieldMap = _mapPut(this.fieldMap, key, value); + return this; + } + + /** + * Required - API name: {@code model_id} + */ + @Nonnull + public final Builder modelId(String value) { + this.modelId = value; + return this; + } + + /** + * Builds a {@link TextImageEmbeddingProcessor}. + * + * @throws NullPointerException if some of the required fields are null. + */ + @Override + @Nonnull + public TextImageEmbeddingProcessor build() { + _checkSingleUse(); + + return new TextImageEmbeddingProcessor(this); + } + } + + // --------------------------------------------------------------------------------------------- + + /** + * Json deserializer for {@link TextImageEmbeddingProcessor} + */ + public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer.lazy( + Builder::new, + TextImageEmbeddingProcessor::setupTextImageEmbeddingProcessorDeserializer + ); + + protected static void setupTextImageEmbeddingProcessorDeserializer(ObjectDeserializer op) { + setupProcessorBaseDeserializer(op); + op.add(Builder::fieldMap, JsonpDeserializer.stringMapDeserializer(JsonpDeserializer.stringDeserializer()), "field_map"); + op.add(Builder::modelId, JsonpDeserializer.stringDeserializer(), "model_id"); + } + + @Override + public int hashCode() { + int result = super.hashCode(); + result = 31 * result + this.fieldMap.hashCode(); + result = 31 * result + this.modelId.hashCode(); + return result; + } + + @Override + public boolean equals(Object o) { + if (!super.equals(o)) { + return false; + } + if (this == o) return true; + if (o == null || this.getClass() != o.getClass()) return false; + TextImageEmbeddingProcessor other = (TextImageEmbeddingProcessor) o; + return this.fieldMap.equals(other.fieldMap) && this.modelId.equals(other.modelId); + } +} diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/ingestion/PauseResponse.java b/java-client/src/generated/java/org/opensearch/client/opensearch/ingestion/PauseResponse.java index ac8d0654e4..fc6f0d71ae 100644 --- a/java-client/src/generated/java/org/opensearch/client/opensearch/ingestion/PauseResponse.java +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/ingestion/PauseResponse.java @@ -38,6 +38,7 @@ import jakarta.json.stream.JsonGenerator; import java.util.List; +import java.util.Map; import java.util.Objects; import java.util.function.Function; import javax.annotation.Generated; @@ -67,7 +68,7 @@ public class PauseResponse implements PlainJsonSerializable, ToCopyableBuilder

failures; + private final Map> failures; private final boolean shardsAcknowledged; @@ -103,10 +104,13 @@ public final String error() { } /** + * Shard-level failures grouped by index name. + *

* API name: {@code failures} + *

*/ @Nonnull - public final List failures() { + public final Map> failures() { return this.failures; } @@ -141,9 +145,16 @@ protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { if (ApiTypeHelper.isDefined(this.failures)) { generator.writeKey("failures"); - generator.writeStartArray(); - for (IngestionStateShardFailure item0 : this.failures) { - item0.serialize(generator, mapper); + generator.writeStartObject(); + for (Map.Entry> item0 : this.failures.entrySet()) { + generator.writeKey(item0.getKey()); + generator.writeStartArray(); + if (item0.getValue() != null) { + for (IngestionStateShardFailure item1 : item0.getValue()) { + item1.serialize(generator, mapper); + } + } + generator.writeEnd(); } generator.writeEnd(); } @@ -173,7 +184,7 @@ public static class Builder extends ObjectBuilderBase implements CopyableBuilder @Nullable private String error; @Nullable - private List failures; + private Map> failures; private Boolean shardsAcknowledged; public Builder() {} @@ -181,14 +192,14 @@ public Builder() {} private Builder(PauseResponse o) { this.acknowledged = o.acknowledged; this.error = o.error; - this.failures = _listCopy(o.failures); + this.failures = _mapCopy(o.failures); this.shardsAcknowledged = o.shardsAcknowledged; } private Builder(Builder o) { this.acknowledged = o.acknowledged; this.error = o.error; - this.failures = _listCopy(o.failures); + this.failures = _mapCopy(o.failures); this.shardsAcknowledged = o.shardsAcknowledged; } @@ -220,41 +231,35 @@ public final Builder error(@Nullable String value) { } /** - * API name: {@code failures} - * + * Shard-level failures grouped by index name. *

- * Adds all elements of list to failures. - *

- */ - @Nonnull - public final Builder failures(List list) { - this.failures = _listAddAll(this.failures, list); - return this; - } - - /** * API name: {@code failures} + *

* *

- * Adds one or more values to failures. + * Adds all elements of map to failures. *

*/ @Nonnull - public final Builder failures(IngestionStateShardFailure value, IngestionStateShardFailure... values) { - this.failures = _listAdd(this.failures, value, values); + public final Builder failures(Map> map) { + this.failures = _mapPutAll(this.failures, map); return this; } /** + * Shard-level failures grouped by index name. + *

* API name: {@code failures} + *

* *

- * Adds a value to failures using a builder lambda. + * Adds an entry to failures. *

*/ @Nonnull - public final Builder failures(Function> fn) { - return failures(fn.apply(new IngestionStateShardFailure.Builder()).build()); + public final Builder failures(String key, List value) { + this.failures = _mapPut(this.failures, key, value); + return this; } /** @@ -296,7 +301,11 @@ public PauseResponse build() { protected static void setupPauseResponseDeserializer(ObjectDeserializer op) { op.add(Builder::acknowledged, JsonpDeserializer.booleanDeserializer(), "acknowledged"); op.add(Builder::error, JsonpDeserializer.stringDeserializer(), "error"); - op.add(Builder::failures, JsonpDeserializer.arrayDeserializer(IngestionStateShardFailure._DESERIALIZER), "failures"); + op.add( + Builder::failures, + JsonpDeserializer.stringMapDeserializer(JsonpDeserializer.arrayDeserializer(IngestionStateShardFailure._DESERIALIZER)), + "failures" + ); op.add(Builder::shardsAcknowledged, JsonpDeserializer.booleanDeserializer(), "shards_acknowledged"); } diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/ingestion/ResumeResponse.java b/java-client/src/generated/java/org/opensearch/client/opensearch/ingestion/ResumeResponse.java index fe0ac6c090..8f93c66b21 100644 --- a/java-client/src/generated/java/org/opensearch/client/opensearch/ingestion/ResumeResponse.java +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/ingestion/ResumeResponse.java @@ -38,6 +38,7 @@ import jakarta.json.stream.JsonGenerator; import java.util.List; +import java.util.Map; import java.util.Objects; import java.util.function.Function; import javax.annotation.Generated; @@ -67,7 +68,7 @@ public class ResumeResponse implements PlainJsonSerializable, ToCopyableBuilder< private final String error; @Nonnull - private final List failures; + private final Map> failures; private final boolean shardsAcknowledged; @@ -103,10 +104,13 @@ public final String error() { } /** + * Shard-level failures grouped by index name. + *

* API name: {@code failures} + *

*/ @Nonnull - public final List failures() { + public final Map> failures() { return this.failures; } @@ -141,9 +145,16 @@ protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { if (ApiTypeHelper.isDefined(this.failures)) { generator.writeKey("failures"); - generator.writeStartArray(); - for (IngestionStateShardFailure item0 : this.failures) { - item0.serialize(generator, mapper); + generator.writeStartObject(); + for (Map.Entry> item0 : this.failures.entrySet()) { + generator.writeKey(item0.getKey()); + generator.writeStartArray(); + if (item0.getValue() != null) { + for (IngestionStateShardFailure item1 : item0.getValue()) { + item1.serialize(generator, mapper); + } + } + generator.writeEnd(); } generator.writeEnd(); } @@ -173,7 +184,7 @@ public static class Builder extends ObjectBuilderBase implements CopyableBuilder @Nullable private String error; @Nullable - private List failures; + private Map> failures; private Boolean shardsAcknowledged; public Builder() {} @@ -181,14 +192,14 @@ public Builder() {} private Builder(ResumeResponse o) { this.acknowledged = o.acknowledged; this.error = o.error; - this.failures = _listCopy(o.failures); + this.failures = _mapCopy(o.failures); this.shardsAcknowledged = o.shardsAcknowledged; } private Builder(Builder o) { this.acknowledged = o.acknowledged; this.error = o.error; - this.failures = _listCopy(o.failures); + this.failures = _mapCopy(o.failures); this.shardsAcknowledged = o.shardsAcknowledged; } @@ -220,41 +231,35 @@ public final Builder error(@Nullable String value) { } /** - * API name: {@code failures} - * + * Shard-level failures grouped by index name. *

- * Adds all elements of list to failures. - *

- */ - @Nonnull - public final Builder failures(List list) { - this.failures = _listAddAll(this.failures, list); - return this; - } - - /** * API name: {@code failures} + *

* *

- * Adds one or more values to failures. + * Adds all elements of map to failures. *

*/ @Nonnull - public final Builder failures(IngestionStateShardFailure value, IngestionStateShardFailure... values) { - this.failures = _listAdd(this.failures, value, values); + public final Builder failures(Map> map) { + this.failures = _mapPutAll(this.failures, map); return this; } /** + * Shard-level failures grouped by index name. + *

* API name: {@code failures} + *

* *

- * Adds a value to failures using a builder lambda. + * Adds an entry to failures. *

*/ @Nonnull - public final Builder failures(Function> fn) { - return failures(fn.apply(new IngestionStateShardFailure.Builder()).build()); + public final Builder failures(String key, List value) { + this.failures = _mapPut(this.failures, key, value); + return this; } /** @@ -296,7 +301,11 @@ public ResumeResponse build() { protected static void setupResumeResponseDeserializer(ObjectDeserializer op) { op.add(Builder::acknowledged, JsonpDeserializer.booleanDeserializer(), "acknowledged"); op.add(Builder::error, JsonpDeserializer.stringDeserializer(), "error"); - op.add(Builder::failures, JsonpDeserializer.arrayDeserializer(IngestionStateShardFailure._DESERIALIZER), "failures"); + op.add( + Builder::failures, + JsonpDeserializer.stringMapDeserializer(JsonpDeserializer.arrayDeserializer(IngestionStateShardFailure._DESERIALIZER)), + "failures" + ); op.add(Builder::shardsAcknowledged, JsonpDeserializer.booleanDeserializer(), "shards_acknowledged"); } diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/ism/AddPolicyRequest.java b/java-client/src/generated/java/org/opensearch/client/opensearch/ism/AddPolicyRequest.java index dce175d92b..f2a3210a4d 100644 --- a/java-client/src/generated/java/org/opensearch/client/opensearch/ism/AddPolicyRequest.java +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/ism/AddPolicyRequest.java @@ -38,6 +38,7 @@ import jakarta.json.stream.JsonGenerator; import java.util.HashMap; +import java.util.List; import java.util.Map; import java.util.Objects; import java.util.function.Function; @@ -71,8 +72,8 @@ public final class AddPolicyRequest extends RequestBase PlainJsonSerializable, ToCopyableBuilder { - @Nullable - private final String index; + @Nonnull + private final List index; @Nonnull private final String policyId; @@ -81,7 +82,7 @@ public final class AddPolicyRequest extends RequestBase private AddPolicyRequest(Builder builder) { super(builder); - this.index = builder.index; + this.index = ApiTypeHelper.unmodifiable(builder.index); this.policyId = ApiTypeHelper.requireNonNull(builder.policyId, this, "policyId"); } @@ -90,10 +91,14 @@ public static AddPolicyRequest of(Function*). To + * target all data streams and indexes, omit this parameter or use * or _all. + *

* API name: {@code index} + *

*/ - @Nullable - public final String index() { + @Nonnull + public final List index() { return this.index; } @@ -141,20 +146,20 @@ public static Builder builder() { */ public static class Builder extends RequestBase.AbstractBuilder implements CopyableBuilder { @Nullable - private String index; + private List index; private String policyId; public Builder() {} private Builder(AddPolicyRequest o) { super(o); - this.index = o.index; + this.index = _listCopy(o.index); this.policyId = o.policyId; } private Builder(Builder o) { super(o); - this.index = o.index; + this.index = _listCopy(o.index); this.policyId = o.policyId; } @@ -171,11 +176,36 @@ protected Builder self() { } /** + * A comma-separated list of data streams, indexes, and aliases used to limit the request. Supports wildcards (*). To + * target all data streams and indexes, omit this parameter or use * or _all. + *

* API name: {@code index} + *

+ * + *

+ * Adds all elements of list to index. + *

+ */ + @Nonnull + public final Builder index(List list) { + this.index = _listAddAll(this.index, list); + return this; + } + + /** + * A comma-separated list of data streams, indexes, and aliases used to limit the request. Supports wildcards (*). To + * target all data streams and indexes, omit this parameter or use * or _all. + *

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

+ * + *

+ * Adds one or more values to index. + *

*/ @Nonnull - public final Builder index(@Nullable String value) { - this.index = value; + public final Builder index(String value, String... values) { + this.index = _listAdd(this.index, value, values); return this; } @@ -233,7 +263,7 @@ protected static void setupAddPolicyRequestDeserializer(ObjectDeserializer include; - @Nullable - private final String index; + @Nonnull + private final List index; @Nonnull private final String policyId; @@ -89,7 +89,7 @@ public final class ChangePolicyRequest extends RequestBase private ChangePolicyRequest(Builder builder) { super(builder); this.include = ApiTypeHelper.unmodifiable(builder.include); - this.index = builder.index; + this.index = ApiTypeHelper.unmodifiable(builder.index); this.policyId = ApiTypeHelper.requireNonNull(builder.policyId, this, "policyId"); this.state = builder.state; } @@ -110,10 +110,14 @@ public final List include() { } /** + * A comma-separated list of data streams, indexes, and aliases used to limit the request. Supports wildcards (*). To + * target all data streams and indexes, omit this parameter or use * or _all. + *

* API name: {@code index} + *

*/ - @Nullable - public final String index() { + @Nonnull + public final List index() { return this.index; } @@ -188,7 +192,7 @@ public static class Builder extends RequestBase.AbstractBuilder impleme @Nullable private List include; @Nullable - private String index; + private List index; private String policyId; @Nullable private String state; @@ -198,7 +202,7 @@ public Builder() {} private Builder(ChangePolicyRequest o) { super(o); this.include = _listCopy(o.include); - this.index = o.index; + this.index = _listCopy(o.index); this.policyId = o.policyId; this.state = o.state; } @@ -206,7 +210,7 @@ private Builder(ChangePolicyRequest o) { private Builder(Builder o) { super(o); this.include = _listCopy(o.include); - this.index = o.index; + this.index = _listCopy(o.index); this.policyId = o.policyId; this.state = o.state; } @@ -271,11 +275,36 @@ public final Builder include(Function*). To + * target all data streams and indexes, omit this parameter or use * or _all. + *

* API name: {@code index} + *

+ * + *

+ * Adds all elements of list to index. + *

+ */ + @Nonnull + public final Builder index(List list) { + this.index = _listAddAll(this.index, list); + return this; + } + + /** + * A comma-separated list of data streams, indexes, and aliases used to limit the request. Supports wildcards (*). To + * target all data streams and indexes, omit this parameter or use * or _all. + *

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

+ * + *

+ * Adds one or more values to index. + *

*/ @Nonnull - public final Builder index(@Nullable String value) { - this.index = value; + public final Builder index(String value, String... values) { + this.index = _listAdd(this.index, value, values); return this; } @@ -347,7 +376,7 @@ protected static void setupChangePolicyRequestDeserializer(ObjectDeserializer index; // --------------------------------------------------------------------------------------------- private ExplainPolicyRequest(Builder builder) { super(builder); this.body = ApiTypeHelper.requireNonNull(builder.body, this, "body"); - this.index = builder.index; + this.index = ApiTypeHelper.unmodifiable(builder.index); } public static ExplainPolicyRequest of(Function> fn) { @@ -97,10 +98,14 @@ public final JsonData body() { } /** + * A comma-separated list of data streams, indexes, and aliases used to limit the request. Supports wildcards (*). To + * target all data streams and indexes, omit this parameter or use * or _all. + *

* API name: {@code index} + *

*/ - @Nullable - public final String index() { + @Nonnull + public final List index() { return this.index; } @@ -131,20 +136,20 @@ public static Builder builder() { public static class Builder extends RequestBase.AbstractBuilder implements CopyableBuilder { private JsonData body; @Nullable - private String index; + private List index; public Builder() {} private Builder(ExplainPolicyRequest o) { super(o); this.body = o.body; - this.index = o.index; + this.index = _listCopy(o.index); } private Builder(Builder o) { super(o); this.body = o.body; - this.index = o.index; + this.index = _listCopy(o.index); } @Override @@ -169,11 +174,36 @@ public final Builder body(JsonData value) { } /** + * A comma-separated list of data streams, indexes, and aliases used to limit the request. Supports wildcards (*). To + * target all data streams and indexes, omit this parameter or use * or _all. + *

* API name: {@code index} + *

+ * + *

+ * Adds all elements of list to index. + *

+ */ + @Nonnull + public final Builder index(List list) { + this.index = _listAddAll(this.index, list); + return this; + } + + /** + * A comma-separated list of data streams, indexes, and aliases used to limit the request. Supports wildcards (*). To + * target all data streams and indexes, omit this parameter or use * or _all. + *

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

+ * + *

+ * Adds one or more values to index. + *

*/ @Nonnull - public final Builder index(@Nullable String value) { - this.index = value; + public final Builder index(String value, String... values) { + this.index = _listAdd(this.index, value, values); return this; } @@ -217,7 +247,7 @@ protected static JsonpDeserializer createExplainPolicyRequ int propsSet = 0; - if (request.index() != null) propsSet |= _index; + if (ApiTypeHelper.isDefined(request.index())) propsSet |= _index; if (propsSet == 0) { return "/_plugins/_ism/explain"; @@ -225,7 +255,7 @@ protected static JsonpDeserializer createExplainPolicyRequ if (propsSet == (_index)) { StringBuilder buf = new StringBuilder(); buf.append("/_plugins/_ism/explain/"); - SimpleEndpoint.pathEncode(request.index, buf); + SimpleEndpoint.pathEncode(String.join(",", request.index), buf); return buf.toString(); } diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/ism/RefreshSearchAnalyzersRequest.java b/java-client/src/generated/java/org/opensearch/client/opensearch/ism/RefreshSearchAnalyzersRequest.java index 63521ef128..7dcbb62c37 100644 --- a/java-client/src/generated/java/org/opensearch/client/opensearch/ism/RefreshSearchAnalyzersRequest.java +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/ism/RefreshSearchAnalyzersRequest.java @@ -37,6 +37,7 @@ package org.opensearch.client.opensearch.ism; import java.util.HashMap; +import java.util.List; import java.util.Map; import java.util.function.Function; import javax.annotation.Generated; @@ -61,13 +62,13 @@ public final class RefreshSearchAnalyzersRequest extends RequestBase ToCopyableBuilder { @Nonnull - private final String index; + private final List index; // --------------------------------------------------------------------------------------------- private RefreshSearchAnalyzersRequest(Builder builder) { super(builder); - this.index = ApiTypeHelper.requireNonNull(builder.index, this, "index"); + this.index = ApiTypeHelper.unmodifiableRequired(builder.index, this, "index"); } public static RefreshSearchAnalyzersRequest of( @@ -77,10 +78,14 @@ public static RefreshSearchAnalyzersRequest of( } /** - * Required - API name: {@code index} + * Required - A comma-separated list of data streams, indexes, and aliases used to limit the request. Supports wildcards + * (*). To target all data streams and indexes, omit this parameter or use * or _all. + *

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

*/ @Nonnull - public final String index() { + public final List index() { return this.index; } @@ -103,18 +108,18 @@ public static Builder builder() { public static class Builder extends RequestBase.AbstractBuilder implements CopyableBuilder { - private String index; + private List index; public Builder() {} private Builder(RefreshSearchAnalyzersRequest o) { super(o); - this.index = o.index; + this.index = _listCopy(o.index); } private Builder(Builder o) { super(o); - this.index = o.index; + this.index = _listCopy(o.index); } @Override @@ -130,11 +135,36 @@ protected Builder self() { } /** - * Required - API name: {@code index} + * Required - A comma-separated list of data streams, indexes, and aliases used to limit the request. Supports wildcards + * (*). To target all data streams and indexes, omit this parameter or use * or _all. + *

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

+ * + *

+ * Adds all elements of list to index. + *

+ */ + @Nonnull + public final Builder index(List list) { + this.index = _listAddAll(this.index, list); + return this; + } + + /** + * Required - A comma-separated list of data streams, indexes, and aliases used to limit the request. Supports wildcards + * (*). To target all data streams and indexes, omit this parameter or use * or _all. + *

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

+ * + *

+ * Adds one or more values to index. + *

*/ @Nonnull - public final Builder index(String value) { - this.index = value; + public final Builder index(String value, String... values) { + this.index = _listAdd(this.index, value, values); return this; } @@ -165,7 +195,7 @@ public RefreshSearchAnalyzersRequest build() { request -> { StringBuilder buf = new StringBuilder(); buf.append("/_plugins/_refresh_search_analyzers/"); - SimpleEndpoint.pathEncode(request.index, buf); + SimpleEndpoint.pathEncode(String.join(",", request.index), buf); return buf.toString(); }, // Request parameters diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/ism/RemovePolicyRequest.java b/java-client/src/generated/java/org/opensearch/client/opensearch/ism/RemovePolicyRequest.java index 0c1b377304..0fbbd417a3 100644 --- a/java-client/src/generated/java/org/opensearch/client/opensearch/ism/RemovePolicyRequest.java +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/ism/RemovePolicyRequest.java @@ -37,6 +37,7 @@ package org.opensearch.client.opensearch.ism; import java.util.HashMap; +import java.util.List; import java.util.Map; import java.util.Objects; import java.util.function.Function; @@ -47,6 +48,7 @@ import org.opensearch.client.opensearch._types.RequestBase; import org.opensearch.client.transport.Endpoint; import org.opensearch.client.transport.endpoints.SimpleEndpoint; +import org.opensearch.client.util.ApiTypeHelper; import org.opensearch.client.util.CopyableBuilder; import org.opensearch.client.util.ObjectBuilder; import org.opensearch.client.util.ToCopyableBuilder; @@ -59,14 +61,14 @@ @Generated("org.opensearch.client.codegen.CodeGenerator") public final class RemovePolicyRequest extends RequestBase implements ToCopyableBuilder { - @Nullable - private final String index; + @Nonnull + private final List index; // --------------------------------------------------------------------------------------------- private RemovePolicyRequest(Builder builder) { super(builder); - this.index = builder.index; + this.index = ApiTypeHelper.unmodifiable(builder.index); } public static RemovePolicyRequest of(Function> fn) { @@ -74,10 +76,14 @@ public static RemovePolicyRequest of(Function*). To + * target all data streams and indexes, omit this parameter or use * or _all. + *

* API name: {@code index} + *

*/ - @Nullable - public final String index() { + @Nonnull + public final List index() { return this.index; } @@ -99,18 +105,18 @@ public static Builder builder() { */ public static class Builder extends RequestBase.AbstractBuilder implements CopyableBuilder { @Nullable - private String index; + private List index; public Builder() {} private Builder(RemovePolicyRequest o) { super(o); - this.index = o.index; + this.index = _listCopy(o.index); } private Builder(Builder o) { super(o); - this.index = o.index; + this.index = _listCopy(o.index); } @Override @@ -126,11 +132,36 @@ protected Builder self() { } /** + * A comma-separated list of data streams, indexes, and aliases used to limit the request. Supports wildcards (*). To + * target all data streams and indexes, omit this parameter or use * or _all. + *

* API name: {@code index} + *

+ * + *

+ * Adds all elements of list to index. + *

+ */ + @Nonnull + public final Builder index(List list) { + this.index = _listAddAll(this.index, list); + return this; + } + + /** + * A comma-separated list of data streams, indexes, and aliases used to limit the request. Supports wildcards (*). To + * target all data streams and indexes, omit this parameter or use * or _all. + *

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

+ * + *

+ * Adds one or more values to index. + *

*/ @Nonnull - public final Builder index(@Nullable String value) { - this.index = value; + public final Builder index(String value, String... values) { + this.index = _listAdd(this.index, value, values); return this; } @@ -162,7 +193,7 @@ public RemovePolicyRequest build() { int propsSet = 0; - if (request.index() != null) propsSet |= _index; + if (ApiTypeHelper.isDefined(request.index())) propsSet |= _index; if (propsSet == 0) { return "/_plugins/_ism/remove"; @@ -170,7 +201,7 @@ public RemovePolicyRequest build() { if (propsSet == (_index)) { StringBuilder buf = new StringBuilder(); buf.append("/_plugins/_ism/remove/"); - SimpleEndpoint.pathEncode(request.index, buf); + SimpleEndpoint.pathEncode(String.join(",", request.index), buf); return buf.toString(); } diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/ism/RetryIndexRequest.java b/java-client/src/generated/java/org/opensearch/client/opensearch/ism/RetryIndexRequest.java index 4f8c2e6e8c..b4aac1fdff 100644 --- a/java-client/src/generated/java/org/opensearch/client/opensearch/ism/RetryIndexRequest.java +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/ism/RetryIndexRequest.java @@ -38,6 +38,7 @@ import jakarta.json.stream.JsonGenerator; import java.util.HashMap; +import java.util.List; import java.util.Map; import java.util.Objects; import java.util.function.Function; @@ -71,8 +72,8 @@ public final class RetryIndexRequest extends RequestBase PlainJsonSerializable, ToCopyableBuilder { - @Nullable - private final String index; + @Nonnull + private final List index; @Nonnull private final String state; @@ -81,7 +82,7 @@ public final class RetryIndexRequest extends RequestBase private RetryIndexRequest(Builder builder) { super(builder); - this.index = builder.index; + this.index = ApiTypeHelper.unmodifiable(builder.index); this.state = ApiTypeHelper.requireNonNull(builder.state, this, "state"); } @@ -90,10 +91,14 @@ public static RetryIndexRequest of(Function*). To + * target all data streams and indexes, omit this parameter or use * or _all. + *

* API name: {@code index} + *

*/ - @Nullable - public final String index() { + @Nonnull + public final List index() { return this.index; } @@ -141,20 +146,20 @@ public static Builder builder() { */ public static class Builder extends RequestBase.AbstractBuilder implements CopyableBuilder { @Nullable - private String index; + private List index; private String state; public Builder() {} private Builder(RetryIndexRequest o) { super(o); - this.index = o.index; + this.index = _listCopy(o.index); this.state = o.state; } private Builder(Builder o) { super(o); - this.index = o.index; + this.index = _listCopy(o.index); this.state = o.state; } @@ -171,11 +176,36 @@ protected Builder self() { } /** + * A comma-separated list of data streams, indexes, and aliases used to limit the request. Supports wildcards (*). To + * target all data streams and indexes, omit this parameter or use * or _all. + *

* API name: {@code index} + *

+ * + *

+ * Adds all elements of list to index. + *

+ */ + @Nonnull + public final Builder index(List list) { + this.index = _listAddAll(this.index, list); + return this; + } + + /** + * A comma-separated list of data streams, indexes, and aliases used to limit the request. Supports wildcards (*). To + * target all data streams and indexes, omit this parameter or use * or _all. + *

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

+ * + *

+ * Adds one or more values to index. + *

*/ @Nonnull - public final Builder index(@Nullable String value) { - this.index = value; + public final Builder index(String value, String... values) { + this.index = _listAdd(this.index, value, values); return this; } @@ -233,7 +263,7 @@ protected static void setupRetryIndexRequestDeserializer(ObjectDeserializer getModel(Function searchModels(SearchModelsRequest request) throws IOException, OpenSearchException { - return this.transport.performRequestAsync(request, SearchModelsRequest._ENDPOINT, this.transportOptions); + public CompletableFuture> searchModels( + SearchModelsRequest request, + Class tDocumentClass + ) throws IOException, OpenSearchException { + @SuppressWarnings("unchecked") + JsonEndpoint, ErrorResponse> endpoint = (JsonEndpoint< + SearchModelsRequest, + SearchModelsResponse, + ErrorResponse>) SearchModelsRequest._ENDPOINT; + endpoint = new EndpointWithResponseMapperAttr<>( + endpoint, + "org.opensearch.client:Deserializer:knn.search_models.TDocument", + getDeserializer(tDocumentClass) + ); + + return this.transport.performRequestAsync(request, endpoint, this.transportOptions); } /** @@ -118,17 +135,11 @@ public CompletableFuture searchModels(SearchModelsRequest * * @param fn a function that initializes a builder to create the {@link SearchModelsRequest} */ - public final CompletableFuture searchModels( - Function> fn + public final CompletableFuture> searchModels( + Function> fn, + Class tDocumentClass ) throws IOException, OpenSearchException { - return searchModels(fn.apply(new SearchModelsRequest.Builder()).build()); - } - - /** - * Use an OpenSearch query to search for models in the index. - */ - public final CompletableFuture searchModels() throws IOException, OpenSearchException { - return searchModels(new SearchModelsRequest.Builder().build()); + return searchModels(fn.apply(new SearchModelsRequest.Builder()).build(), tDocumentClass); } // ----- Endpoint: knn.stats diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/knn/OpenSearchKnnClient.java b/java-client/src/generated/java/org/opensearch/client/opensearch/knn/OpenSearchKnnClient.java index 3b8df874b0..9c19e5065b 100644 --- a/java-client/src/generated/java/org/opensearch/client/opensearch/knn/OpenSearchKnnClient.java +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/knn/OpenSearchKnnClient.java @@ -41,9 +41,12 @@ import javax.annotation.Generated; import javax.annotation.Nullable; import org.opensearch.client.ApiClient; +import org.opensearch.client.opensearch._types.ErrorResponse; import org.opensearch.client.opensearch._types.OpenSearchException; +import org.opensearch.client.transport.JsonEndpoint; import org.opensearch.client.transport.OpenSearchTransport; import org.opensearch.client.transport.TransportOptions; +import org.opensearch.client.transport.endpoints.EndpointWithResponseMapperAttr; import org.opensearch.client.util.ObjectBuilder; /** @@ -107,8 +110,20 @@ public final GetModelResponse getModel(Function SearchModelsResponse searchModels(SearchModelsRequest request, Class tDocumentClass) + throws IOException, OpenSearchException { + @SuppressWarnings("unchecked") + JsonEndpoint, ErrorResponse> endpoint = (JsonEndpoint< + SearchModelsRequest, + SearchModelsResponse, + ErrorResponse>) SearchModelsRequest._ENDPOINT; + endpoint = new EndpointWithResponseMapperAttr<>( + endpoint, + "org.opensearch.client:Deserializer:knn.search_models.TDocument", + getDeserializer(tDocumentClass) + ); + + return this.transport.performRequest(request, endpoint, this.transportOptions); } /** @@ -116,16 +131,11 @@ public SearchModelsResponse searchModels(SearchModelsRequest request) throws IOE * * @param fn a function that initializes a builder to create the {@link SearchModelsRequest} */ - public final SearchModelsResponse searchModels(Function> fn) - throws IOException, OpenSearchException { - return searchModels(fn.apply(new SearchModelsRequest.Builder()).build()); - } - - /** - * Use an OpenSearch query to search for models in the index. - */ - public final SearchModelsResponse searchModels() throws IOException, OpenSearchException { - return searchModels(new SearchModelsRequest.Builder().build()); + public final SearchModelsResponse searchModels( + Function> fn, + Class tDocumentClass + ) throws IOException, OpenSearchException { + return searchModels(fn.apply(new SearchModelsRequest.Builder()).build(), tDocumentClass); } // ----- Endpoint: knn.stats diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/knn/SearchModelsRequest.java b/java-client/src/generated/java/org/opensearch/client/opensearch/knn/SearchModelsRequest.java index 770c50c880..aac24f3943 100644 --- a/java-client/src/generated/java/org/opensearch/client/opensearch/knn/SearchModelsRequest.java +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/knn/SearchModelsRequest.java @@ -45,6 +45,7 @@ import javax.annotation.Generated; import javax.annotation.Nonnull; import javax.annotation.Nullable; +import org.opensearch.client.json.JsonpDeserializer; import org.opensearch.client.opensearch._types.ErrorResponse; import org.opensearch.client.opensearch._types.ExpandWildcard; import org.opensearch.client.opensearch._types.RequestBase; @@ -1750,7 +1751,7 @@ protected void applyQueryParameters(@Nonnull Map params) { /** * Endpoint "{@code knn.search_models}". */ - public static final Endpoint _ENDPOINT = new SimpleEndpoint<>( + public static final SimpleEndpoint _ENDPOINT = new SimpleEndpoint<>( // Request method request -> "POST", // Request path @@ -1766,6 +1767,15 @@ protected void applyQueryParameters(@Nonnull Map params) { SearchModelsResponse._DESERIALIZER ); + /** + * Create an "{@code knn.search_models}" endpoint. + */ + public static Endpoint, ErrorResponse> createKnnSearchModelsEndpoint( + JsonpDeserializer tDocumentDeserializer + ) { + return _ENDPOINT.withResponseDeserializer(SearchModelsResponse.createSearchModelsResponseDeserializer(tDocumentDeserializer)); + } + @Override public int hashCode() { int result = 17; diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/knn/SearchModelsResponse.java b/java-client/src/generated/java/org/opensearch/client/opensearch/knn/SearchModelsResponse.java index ee1f5fb53b..b7cd9e7411 100644 --- a/java-client/src/generated/java/org/opensearch/client/opensearch/knn/SearchModelsResponse.java +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/knn/SearchModelsResponse.java @@ -39,12 +39,12 @@ import java.util.function.Function; import javax.annotation.Generated; import javax.annotation.Nonnull; -import org.opensearch.client.json.JsonData; import org.opensearch.client.json.JsonpDeserializable; import org.opensearch.client.json.JsonpDeserializer; +import org.opensearch.client.json.NamedDeserializer; import org.opensearch.client.json.ObjectBuilderDeserializer; import org.opensearch.client.json.ObjectDeserializer; -import org.opensearch.client.opensearch.core.search.SearchResult; +import org.opensearch.client.opensearch.core.search.SearchResultJsonValue; import org.opensearch.client.util.CopyableBuilder; import org.opensearch.client.util.ObjectBuilder; import org.opensearch.client.util.ToCopyableBuilder; @@ -53,59 +53,61 @@ @JsonpDeserializable @Generated("org.opensearch.client.codegen.CodeGenerator") -public class SearchModelsResponse extends SearchResult +public class SearchModelsResponse extends SearchResultJsonValue implements - ToCopyableBuilder { + ToCopyableBuilder, SearchModelsResponse> { // --------------------------------------------------------------------------------------------- - private SearchModelsResponse(Builder builder) { + private SearchModelsResponse(Builder builder) { super(builder); } - public static SearchModelsResponse of(Function> fn) { - return fn.apply(new Builder()).build(); + public static SearchModelsResponse of( + Function, ObjectBuilder>> fn + ) { + return fn.apply(new Builder<>()).build(); } // --------------------------------------------------------------------------------------------- @Override @Nonnull - public Builder toBuilder() { - return new Builder(this); + public Builder toBuilder() { + return new Builder<>(this); } @Nonnull - public static Builder builder() { - return new Builder(); + public static Builder builder() { + return new Builder<>(); } /** * Builder for {@link SearchModelsResponse}. */ - public static class Builder extends SearchResult.AbstractBuilder + public static class Builder extends SearchResultJsonValue.AbstractBuilder> implements - CopyableBuilder { + CopyableBuilder, SearchModelsResponse> { public Builder() {} - private Builder(SearchModelsResponse o) { + private Builder(SearchModelsResponse o) { super(o); } - private Builder(Builder o) { + private Builder(Builder o) { super(o); } @Override @Nonnull - public Builder copy() { - return new Builder(this); + public Builder copy() { + return new Builder<>(this); } @Override @Nonnull - protected Builder self() { + protected Builder self() { return this; } @@ -116,25 +118,39 @@ protected Builder self() { */ @Override @Nonnull - public SearchModelsResponse build() { + public SearchModelsResponse build() { _checkSingleUse(); - return new SearchModelsResponse(this); + return new SearchModelsResponse<>(this); } } // --------------------------------------------------------------------------------------------- /** - * Json deserializer for {@link SearchModelsResponse} + * Create a JSON deserializer for SearchModelsResponse. */ - public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer.lazy( - Builder::new, - SearchModelsResponse::setupSearchModelsResponseDeserializer + public static JsonpDeserializer> createSearchModelsResponseDeserializer( + JsonpDeserializer tDocumentDeserializer + ) { + return ObjectBuilderDeserializer.createForObject( + Builder::new, + op -> SearchModelsResponse.setupSearchModelsResponseDeserializer(op, tDocumentDeserializer) + ); + } + + /** + * Json deserializer for {@link SearchModelsResponse} based on named deserializers provided by the calling {@code JsonMapper}. + */ + public static final JsonpDeserializer> _DESERIALIZER = createSearchModelsResponseDeserializer( + new NamedDeserializer<>("org.opensearch.client:Deserializer:knn.search_models.TDocument") ); - protected static void setupSearchModelsResponseDeserializer(ObjectDeserializer op) { - setupSearchResultDeserializer(op, JsonData._DESERIALIZER); + protected static void setupSearchModelsResponseDeserializer( + ObjectDeserializer> op, + JsonpDeserializer tDocumentDeserializer + ) { + setupSearchResultJsonValueDeserializer(op, tDocumentDeserializer); } @Override diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/ltr/CacheStatsResponse.java b/java-client/src/generated/java/org/opensearch/client/opensearch/ltr/CacheStatsResponse.java index af8f45dd0a..cebabb01f8 100644 --- a/java-client/src/generated/java/org/opensearch/client/opensearch/ltr/CacheStatsResponse.java +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/ltr/CacheStatsResponse.java @@ -49,19 +49,17 @@ import org.opensearch.client.json.JsonpMapper; import org.opensearch.client.json.ObjectBuilderDeserializer; import org.opensearch.client.json.ObjectDeserializer; -import org.opensearch.client.json.PlainJsonSerializable; -import org.opensearch.client.opensearch._types.NodeStatistics; +import org.opensearch.client.opensearch.nodes.NodesResponseBase; 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: ltr.cache_stats.Response @JsonpDeserializable @Generated("org.opensearch.client.codegen.CodeGenerator") -public class CacheStatsResponse implements PlainJsonSerializable, ToCopyableBuilder { +public class CacheStatsResponse extends NodesResponseBase implements ToCopyableBuilder { @Nullable private final CacheAllStats all; @@ -69,8 +67,8 @@ public class CacheStatsResponse implements PlainJsonSerializable, ToCopyableBuil @Nullable private final String clusterName; - @Nullable - private final NodeStatistics nodes; + @Nonnull + private final Map nodes; @Nonnull private final Map stores; @@ -78,9 +76,10 @@ public class CacheStatsResponse implements PlainJsonSerializable, ToCopyableBuil // --------------------------------------------------------------------------------------------- private CacheStatsResponse(Builder builder) { + super(builder); this.all = builder.all; this.clusterName = builder.clusterName; - this.nodes = builder.nodes; + this.nodes = ApiTypeHelper.unmodifiable(builder.nodes); this.stores = ApiTypeHelper.unmodifiable(builder.stores); } @@ -105,10 +104,13 @@ public final String clusterName() { } /** - * API name: {@code _nodes} + * Cache statistics per node. + *

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

*/ - @Nullable - public final NodeStatistics nodes() { + @Nonnull + public final Map nodes() { return this.nodes; } @@ -123,17 +125,8 @@ public final Map stores() { return this.stores; } - /** - * 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.all != null) { generator.writeKey("all"); this.all.serialize(generator, mapper); @@ -144,9 +137,14 @@ protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { generator.write(this.clusterName); } - if (this.nodes != null) { - generator.writeKey("_nodes"); - this.nodes.serialize(generator, mapper); + if (ApiTypeHelper.isDefined(this.nodes)) { + generator.writeKey("nodes"); + generator.writeStartObject(); + for (Map.Entry item0 : this.nodes.entrySet()) { + generator.writeKey(item0.getKey()); + item0.getValue().serialize(generator, mapper); + } + generator.writeEnd(); } if (ApiTypeHelper.isDefined(this.stores)) { @@ -176,29 +174,31 @@ public static Builder builder() { /** * Builder for {@link CacheStatsResponse}. */ - public static class Builder extends ObjectBuilderBase implements CopyableBuilder { + public static class Builder extends NodesResponseBase.AbstractBuilder implements CopyableBuilder { @Nullable private CacheAllStats all; @Nullable private String clusterName; @Nullable - private NodeStatistics nodes; + private Map nodes; @Nullable private Map stores; public Builder() {} private Builder(CacheStatsResponse o) { + super(o); this.all = o.all; this.clusterName = o.clusterName; - this.nodes = o.nodes; + this.nodes = _mapCopy(o.nodes); this.stores = _mapCopy(o.stores); } private Builder(Builder o) { + super(o); this.all = o.all; this.clusterName = o.clusterName; - this.nodes = o.nodes; + this.nodes = _mapCopy(o.nodes); this.stores = _mapCopy(o.stores); } @@ -208,6 +208,12 @@ public Builder copy() { return new Builder(this); } + @Override + @Nonnull + protected Builder self() { + return this; + } + /** * API name: {@code all} */ @@ -235,20 +241,50 @@ public final Builder clusterName(@Nullable String value) { } /** - * API name: {@code _nodes} + * Cache statistics per node. + *

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

+ * + *

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

*/ @Nonnull - public final Builder nodes(@Nullable NodeStatistics value) { - this.nodes = value; + public final Builder nodes(Map map) { + this.nodes = _mapPutAll(this.nodes, map); return this; } /** - * API name: {@code _nodes} + * Cache statistics per node. + *

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

+ * + *

+ * Adds an entry to nodes. + *

*/ @Nonnull - public final Builder nodes(Function> fn) { - return nodes(fn.apply(new NodeStatistics.Builder()).build()); + public final Builder nodes(String key, NodeDetails value) { + this.nodes = _mapPut(this.nodes, key, value); + return this; + } + + /** + * Cache statistics per node. + *

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

+ * + *

+ * Adds a value to nodes using a builder lambda. + *

+ */ + @Nonnull + public final Builder nodes(String key, Function> fn) { + return nodes(key, fn.apply(new NodeDetails.Builder()).build()); } /** @@ -308,15 +344,16 @@ public CacheStatsResponse build() { ); protected static void setupCacheStatsResponseDeserializer(ObjectDeserializer op) { + setupNodesResponseBaseDeserializer(op); op.add(Builder::all, CacheAllStats._DESERIALIZER, "all"); op.add(Builder::clusterName, JsonpDeserializer.stringDeserializer(), "cluster_name"); - op.add(Builder::nodes, NodeStatistics._DESERIALIZER, "_nodes"); + op.add(Builder::nodes, JsonpDeserializer.stringMapDeserializer(NodeDetails._DESERIALIZER), "nodes"); op.add(Builder::stores, JsonpDeserializer.stringMapDeserializer(JsonData._DESERIALIZER), "stores"); } @Override public int hashCode() { - int result = 17; + int result = super.hashCode(); result = 31 * result + Objects.hashCode(this.all); result = 31 * result + Objects.hashCode(this.clusterName); result = 31 * result + Objects.hashCode(this.nodes); @@ -326,6 +363,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; CacheStatsResponse other = (CacheStatsResponse) o; diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/ltr/OpenSearchLtrAsyncClient.java b/java-client/src/generated/java/org/opensearch/client/opensearch/ltr/OpenSearchLtrAsyncClient.java index f31e2665c8..d8055de051 100644 --- a/java-client/src/generated/java/org/opensearch/client/opensearch/ltr/OpenSearchLtrAsyncClient.java +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/ltr/OpenSearchLtrAsyncClient.java @@ -42,9 +42,12 @@ import javax.annotation.Generated; import javax.annotation.Nullable; import org.opensearch.client.ApiClient; +import org.opensearch.client.opensearch._types.ErrorResponse; import org.opensearch.client.opensearch._types.OpenSearchException; +import org.opensearch.client.transport.JsonEndpoint; import org.opensearch.client.transport.OpenSearchTransport; import org.opensearch.client.transport.TransportOptions; +import org.opensearch.client.transport.endpoints.EndpointWithResponseMapperAttr; import org.opensearch.client.util.ObjectBuilder; /** @@ -506,8 +509,22 @@ public final CompletableFuture listStores() throws IOExcepti /** * Search for features in a feature store. */ - public CompletableFuture searchFeatures(SearchFeaturesRequest request) throws IOException, OpenSearchException { - return this.transport.performRequestAsync(request, SearchFeaturesRequest._ENDPOINT, this.transportOptions); + public CompletableFuture> searchFeatures( + SearchFeaturesRequest request, + Class tDocumentClass + ) throws IOException, OpenSearchException { + @SuppressWarnings("unchecked") + JsonEndpoint, ErrorResponse> endpoint = (JsonEndpoint< + SearchFeaturesRequest, + SearchFeaturesResponse, + ErrorResponse>) SearchFeaturesRequest._ENDPOINT; + endpoint = new EndpointWithResponseMapperAttr<>( + endpoint, + "org.opensearch.client:Deserializer:ltr.search_features.TDocument", + getDeserializer(tDocumentClass) + ); + + return this.transport.performRequestAsync(request, endpoint, this.transportOptions); } /** @@ -515,17 +532,11 @@ public CompletableFuture searchFeatures(SearchFeaturesRe * * @param fn a function that initializes a builder to create the {@link SearchFeaturesRequest} */ - public final CompletableFuture searchFeatures( - Function> fn + public final CompletableFuture> searchFeatures( + Function> fn, + Class tDocumentClass ) throws IOException, OpenSearchException { - return searchFeatures(fn.apply(new SearchFeaturesRequest.Builder()).build()); - } - - /** - * Search for features in a feature store. - */ - public final CompletableFuture searchFeatures() throws IOException, OpenSearchException { - return searchFeatures(new SearchFeaturesRequest.Builder().build()); + return searchFeatures(fn.apply(new SearchFeaturesRequest.Builder()).build(), tDocumentClass); } // ----- Endpoint: ltr.search_featuresets @@ -533,9 +544,22 @@ public final CompletableFuture searchFeatures() throws I /** * Search for feature sets in a feature store. */ - public CompletableFuture searchFeaturesets(SearchFeaturesetsRequest request) throws IOException, - OpenSearchException { - return this.transport.performRequestAsync(request, SearchFeaturesetsRequest._ENDPOINT, this.transportOptions); + public CompletableFuture> searchFeaturesets( + SearchFeaturesetsRequest request, + Class tDocumentClass + ) throws IOException, OpenSearchException { + @SuppressWarnings("unchecked") + JsonEndpoint, ErrorResponse> endpoint = (JsonEndpoint< + SearchFeaturesetsRequest, + SearchFeaturesetsResponse, + ErrorResponse>) SearchFeaturesetsRequest._ENDPOINT; + endpoint = new EndpointWithResponseMapperAttr<>( + endpoint, + "org.opensearch.client:Deserializer:ltr.search_featuresets.TDocument", + getDeserializer(tDocumentClass) + ); + + return this.transport.performRequestAsync(request, endpoint, this.transportOptions); } /** @@ -543,17 +567,11 @@ public CompletableFuture searchFeaturesets(SearchFeat * * @param fn a function that initializes a builder to create the {@link SearchFeaturesetsRequest} */ - public final CompletableFuture searchFeaturesets( - Function> fn + public final CompletableFuture> searchFeaturesets( + Function> fn, + Class tDocumentClass ) throws IOException, OpenSearchException { - return searchFeaturesets(fn.apply(new SearchFeaturesetsRequest.Builder()).build()); - } - - /** - * Search for feature sets in a feature store. - */ - public final CompletableFuture searchFeaturesets() throws IOException, OpenSearchException { - return searchFeaturesets(new SearchFeaturesetsRequest.Builder().build()); + return searchFeaturesets(fn.apply(new SearchFeaturesetsRequest.Builder()).build(), tDocumentClass); } // ----- Endpoint: ltr.search_models @@ -561,8 +579,22 @@ public final CompletableFuture searchFeaturesets() th /** * Search for models in a feature store. */ - public CompletableFuture searchModels(SearchModelsRequest request) throws IOException, OpenSearchException { - return this.transport.performRequestAsync(request, SearchModelsRequest._ENDPOINT, this.transportOptions); + public CompletableFuture> searchModels( + SearchModelsRequest request, + Class tDocumentClass + ) throws IOException, OpenSearchException { + @SuppressWarnings("unchecked") + JsonEndpoint, ErrorResponse> endpoint = (JsonEndpoint< + SearchModelsRequest, + SearchModelsResponse, + ErrorResponse>) SearchModelsRequest._ENDPOINT; + endpoint = new EndpointWithResponseMapperAttr<>( + endpoint, + "org.opensearch.client:Deserializer:ltr.search_models.TDocument", + getDeserializer(tDocumentClass) + ); + + return this.transport.performRequestAsync(request, endpoint, this.transportOptions); } /** @@ -570,17 +602,11 @@ public CompletableFuture searchModels(SearchModelsRequest * * @param fn a function that initializes a builder to create the {@link SearchModelsRequest} */ - public final CompletableFuture searchModels( - Function> fn + public final CompletableFuture> searchModels( + Function> fn, + Class tDocumentClass ) throws IOException, OpenSearchException { - return searchModels(fn.apply(new SearchModelsRequest.Builder()).build()); - } - - /** - * Search for models in a feature store. - */ - public final CompletableFuture searchModels() throws IOException, OpenSearchException { - return searchModels(new SearchModelsRequest.Builder().build()); + return searchModels(fn.apply(new SearchModelsRequest.Builder()).build(), tDocumentClass); } // ----- Endpoint: ltr.stats diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/ltr/OpenSearchLtrClient.java b/java-client/src/generated/java/org/opensearch/client/opensearch/ltr/OpenSearchLtrClient.java index c7718e42ba..11dbd7db46 100644 --- a/java-client/src/generated/java/org/opensearch/client/opensearch/ltr/OpenSearchLtrClient.java +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/ltr/OpenSearchLtrClient.java @@ -41,9 +41,12 @@ import javax.annotation.Generated; import javax.annotation.Nullable; import org.opensearch.client.ApiClient; +import org.opensearch.client.opensearch._types.ErrorResponse; import org.opensearch.client.opensearch._types.OpenSearchException; +import org.opensearch.client.transport.JsonEndpoint; import org.opensearch.client.transport.OpenSearchTransport; import org.opensearch.client.transport.TransportOptions; +import org.opensearch.client.transport.endpoints.EndpointWithResponseMapperAttr; import org.opensearch.client.util.ObjectBuilder; /** @@ -492,8 +495,20 @@ public final ListStoresResponse listStores() throws IOException, OpenSearchExcep /** * Search for features in a feature store. */ - public SearchFeaturesResponse searchFeatures(SearchFeaturesRequest request) throws IOException, OpenSearchException { - return this.transport.performRequest(request, SearchFeaturesRequest._ENDPOINT, this.transportOptions); + public SearchFeaturesResponse searchFeatures(SearchFeaturesRequest request, Class tDocumentClass) + throws IOException, OpenSearchException { + @SuppressWarnings("unchecked") + JsonEndpoint, ErrorResponse> endpoint = (JsonEndpoint< + SearchFeaturesRequest, + SearchFeaturesResponse, + ErrorResponse>) SearchFeaturesRequest._ENDPOINT; + endpoint = new EndpointWithResponseMapperAttr<>( + endpoint, + "org.opensearch.client:Deserializer:ltr.search_features.TDocument", + getDeserializer(tDocumentClass) + ); + + return this.transport.performRequest(request, endpoint, this.transportOptions); } /** @@ -501,16 +516,11 @@ public SearchFeaturesResponse searchFeatures(SearchFeaturesRequest request) thro * * @param fn a function that initializes a builder to create the {@link SearchFeaturesRequest} */ - public final SearchFeaturesResponse searchFeatures(Function> fn) - throws IOException, OpenSearchException { - return searchFeatures(fn.apply(new SearchFeaturesRequest.Builder()).build()); - } - - /** - * Search for features in a feature store. - */ - public final SearchFeaturesResponse searchFeatures() throws IOException, OpenSearchException { - return searchFeatures(new SearchFeaturesRequest.Builder().build()); + public final SearchFeaturesResponse searchFeatures( + Function> fn, + Class tDocumentClass + ) throws IOException, OpenSearchException { + return searchFeatures(fn.apply(new SearchFeaturesRequest.Builder()).build(), tDocumentClass); } // ----- Endpoint: ltr.search_featuresets @@ -518,8 +528,22 @@ public final SearchFeaturesResponse searchFeatures() throws IOException, OpenSea /** * Search for feature sets in a feature store. */ - public SearchFeaturesetsResponse searchFeaturesets(SearchFeaturesetsRequest request) throws IOException, OpenSearchException { - return this.transport.performRequest(request, SearchFeaturesetsRequest._ENDPOINT, this.transportOptions); + public SearchFeaturesetsResponse searchFeaturesets( + SearchFeaturesetsRequest request, + Class tDocumentClass + ) throws IOException, OpenSearchException { + @SuppressWarnings("unchecked") + JsonEndpoint, ErrorResponse> endpoint = (JsonEndpoint< + SearchFeaturesetsRequest, + SearchFeaturesetsResponse, + ErrorResponse>) SearchFeaturesetsRequest._ENDPOINT; + endpoint = new EndpointWithResponseMapperAttr<>( + endpoint, + "org.opensearch.client:Deserializer:ltr.search_featuresets.TDocument", + getDeserializer(tDocumentClass) + ); + + return this.transport.performRequest(request, endpoint, this.transportOptions); } /** @@ -527,17 +551,11 @@ public SearchFeaturesetsResponse searchFeaturesets(SearchFeaturesetsRequest requ * * @param fn a function that initializes a builder to create the {@link SearchFeaturesetsRequest} */ - public final SearchFeaturesetsResponse searchFeaturesets( - Function> fn + public final SearchFeaturesetsResponse searchFeaturesets( + Function> fn, + Class tDocumentClass ) throws IOException, OpenSearchException { - return searchFeaturesets(fn.apply(new SearchFeaturesetsRequest.Builder()).build()); - } - - /** - * Search for feature sets in a feature store. - */ - public final SearchFeaturesetsResponse searchFeaturesets() throws IOException, OpenSearchException { - return searchFeaturesets(new SearchFeaturesetsRequest.Builder().build()); + return searchFeaturesets(fn.apply(new SearchFeaturesetsRequest.Builder()).build(), tDocumentClass); } // ----- Endpoint: ltr.search_models @@ -545,8 +563,20 @@ public final SearchFeaturesetsResponse searchFeaturesets() throws IOException, O /** * Search for models in a feature store. */ - public SearchModelsResponse searchModels(SearchModelsRequest request) throws IOException, OpenSearchException { - return this.transport.performRequest(request, SearchModelsRequest._ENDPOINT, this.transportOptions); + public SearchModelsResponse searchModels(SearchModelsRequest request, Class tDocumentClass) + throws IOException, OpenSearchException { + @SuppressWarnings("unchecked") + JsonEndpoint, ErrorResponse> endpoint = (JsonEndpoint< + SearchModelsRequest, + SearchModelsResponse, + ErrorResponse>) SearchModelsRequest._ENDPOINT; + endpoint = new EndpointWithResponseMapperAttr<>( + endpoint, + "org.opensearch.client:Deserializer:ltr.search_models.TDocument", + getDeserializer(tDocumentClass) + ); + + return this.transport.performRequest(request, endpoint, this.transportOptions); } /** @@ -554,16 +584,11 @@ public SearchModelsResponse searchModels(SearchModelsRequest request) throws IOE * * @param fn a function that initializes a builder to create the {@link SearchModelsRequest} */ - public final SearchModelsResponse searchModels(Function> fn) - throws IOException, OpenSearchException { - return searchModels(fn.apply(new SearchModelsRequest.Builder()).build()); - } - - /** - * Search for models in a feature store. - */ - public final SearchModelsResponse searchModels() throws IOException, OpenSearchException { - return searchModels(new SearchModelsRequest.Builder().build()); + public final SearchModelsResponse searchModels( + Function> fn, + Class tDocumentClass + ) throws IOException, OpenSearchException { + return searchModels(fn.apply(new SearchModelsRequest.Builder()).build(), tDocumentClass); } // ----- Endpoint: ltr.stats diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/ltr/SearchFeaturesRequest.java b/java-client/src/generated/java/org/opensearch/client/opensearch/ltr/SearchFeaturesRequest.java index 933994d98b..d4611a41e6 100644 --- a/java-client/src/generated/java/org/opensearch/client/opensearch/ltr/SearchFeaturesRequest.java +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/ltr/SearchFeaturesRequest.java @@ -43,6 +43,7 @@ import javax.annotation.Generated; import javax.annotation.Nonnull; import javax.annotation.Nullable; +import org.opensearch.client.json.JsonpDeserializer; import org.opensearch.client.opensearch._types.ErrorResponse; import org.opensearch.client.opensearch._types.RequestBase; import org.opensearch.client.transport.Endpoint; @@ -268,7 +269,7 @@ protected void applyQueryParameters(@Nonnull Map params) { /** * Endpoint "{@code ltr.search_features}". */ - public static final Endpoint _ENDPOINT = new SimpleEndpoint<>( + public static final SimpleEndpoint _ENDPOINT = new SimpleEndpoint<>( // Request method request -> "GET", // Request path @@ -303,6 +304,16 @@ protected void applyQueryParameters(@Nonnull Map params) { SearchFeaturesResponse._DESERIALIZER ); + /** + * Create an "{@code ltr.search_features}" endpoint. + */ + public static < + TDocument> Endpoint, ErrorResponse> createLtrSearchFeaturesEndpoint( + JsonpDeserializer tDocumentDeserializer + ) { + return _ENDPOINT.withResponseDeserializer(SearchFeaturesResponse.createSearchFeaturesResponseDeserializer(tDocumentDeserializer)); + } + @Override public int hashCode() { int result = 17; diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/ltr/SearchFeaturesResponse.java b/java-client/src/generated/java/org/opensearch/client/opensearch/ltr/SearchFeaturesResponse.java index 54f772f725..c9a4b0e784 100644 --- a/java-client/src/generated/java/org/opensearch/client/opensearch/ltr/SearchFeaturesResponse.java +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/ltr/SearchFeaturesResponse.java @@ -39,12 +39,12 @@ import java.util.function.Function; import javax.annotation.Generated; import javax.annotation.Nonnull; -import org.opensearch.client.json.JsonData; import org.opensearch.client.json.JsonpDeserializable; import org.opensearch.client.json.JsonpDeserializer; +import org.opensearch.client.json.NamedDeserializer; import org.opensearch.client.json.ObjectBuilderDeserializer; import org.opensearch.client.json.ObjectDeserializer; -import org.opensearch.client.opensearch.core.search.SearchResult; +import org.opensearch.client.opensearch.core.search.SearchResultJsonValue; import org.opensearch.client.util.CopyableBuilder; import org.opensearch.client.util.ObjectBuilder; import org.opensearch.client.util.ToCopyableBuilder; @@ -53,59 +53,61 @@ @JsonpDeserializable @Generated("org.opensearch.client.codegen.CodeGenerator") -public class SearchFeaturesResponse extends SearchResult +public class SearchFeaturesResponse extends SearchResultJsonValue implements - ToCopyableBuilder { + ToCopyableBuilder, SearchFeaturesResponse> { // --------------------------------------------------------------------------------------------- - private SearchFeaturesResponse(Builder builder) { + private SearchFeaturesResponse(Builder builder) { super(builder); } - public static SearchFeaturesResponse of(Function> fn) { - return fn.apply(new Builder()).build(); + public static SearchFeaturesResponse of( + Function, ObjectBuilder>> fn + ) { + return fn.apply(new Builder<>()).build(); } // --------------------------------------------------------------------------------------------- @Override @Nonnull - public Builder toBuilder() { - return new Builder(this); + public Builder toBuilder() { + return new Builder<>(this); } @Nonnull - public static Builder builder() { - return new Builder(); + public static Builder builder() { + return new Builder<>(); } /** * Builder for {@link SearchFeaturesResponse}. */ - public static class Builder extends SearchResult.AbstractBuilder + public static class Builder extends SearchResultJsonValue.AbstractBuilder> implements - CopyableBuilder { + CopyableBuilder, SearchFeaturesResponse> { public Builder() {} - private Builder(SearchFeaturesResponse o) { + private Builder(SearchFeaturesResponse o) { super(o); } - private Builder(Builder o) { + private Builder(Builder o) { super(o); } @Override @Nonnull - public Builder copy() { - return new Builder(this); + public Builder copy() { + return new Builder<>(this); } @Override @Nonnull - protected Builder self() { + protected Builder self() { return this; } @@ -116,25 +118,39 @@ protected Builder self() { */ @Override @Nonnull - public SearchFeaturesResponse build() { + public SearchFeaturesResponse build() { _checkSingleUse(); - return new SearchFeaturesResponse(this); + return new SearchFeaturesResponse<>(this); } } // --------------------------------------------------------------------------------------------- /** - * Json deserializer for {@link SearchFeaturesResponse} + * Create a JSON deserializer for SearchFeaturesResponse. */ - public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer.lazy( - Builder::new, - SearchFeaturesResponse::setupSearchFeaturesResponseDeserializer + public static JsonpDeserializer> createSearchFeaturesResponseDeserializer( + JsonpDeserializer tDocumentDeserializer + ) { + return ObjectBuilderDeserializer.createForObject( + Builder::new, + op -> SearchFeaturesResponse.setupSearchFeaturesResponseDeserializer(op, tDocumentDeserializer) + ); + } + + /** + * Json deserializer for {@link SearchFeaturesResponse} based on named deserializers provided by the calling {@code JsonMapper}. + */ + public static final JsonpDeserializer> _DESERIALIZER = createSearchFeaturesResponseDeserializer( + new NamedDeserializer<>("org.opensearch.client:Deserializer:ltr.search_features.TDocument") ); - protected static void setupSearchFeaturesResponseDeserializer(ObjectDeserializer op) { - setupSearchResultDeserializer(op, JsonData._DESERIALIZER); + protected static void setupSearchFeaturesResponseDeserializer( + ObjectDeserializer> op, + JsonpDeserializer tDocumentDeserializer + ) { + setupSearchResultJsonValueDeserializer(op, tDocumentDeserializer); } @Override diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/ltr/SearchFeaturesetsRequest.java b/java-client/src/generated/java/org/opensearch/client/opensearch/ltr/SearchFeaturesetsRequest.java index 9ded1ef944..4212c96530 100644 --- a/java-client/src/generated/java/org/opensearch/client/opensearch/ltr/SearchFeaturesetsRequest.java +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/ltr/SearchFeaturesetsRequest.java @@ -43,6 +43,7 @@ import javax.annotation.Generated; import javax.annotation.Nonnull; import javax.annotation.Nullable; +import org.opensearch.client.json.JsonpDeserializer; import org.opensearch.client.opensearch._types.ErrorResponse; import org.opensearch.client.opensearch._types.RequestBase; import org.opensearch.client.transport.Endpoint; @@ -268,7 +269,7 @@ protected void applyQueryParameters(@Nonnull Map params) { /** * Endpoint "{@code ltr.search_featuresets}". */ - public static final Endpoint _ENDPOINT = new SimpleEndpoint<>( + public static final SimpleEndpoint _ENDPOINT = new SimpleEndpoint<>( // Request method request -> "GET", // Request path @@ -303,6 +304,18 @@ protected void applyQueryParameters(@Nonnull Map params) { SearchFeaturesetsResponse._DESERIALIZER ); + /** + * Create an "{@code ltr.search_featuresets}" endpoint. + */ + public static < + TDocument> + Endpoint, ErrorResponse> + createLtrSearchFeaturesetsEndpoint(JsonpDeserializer tDocumentDeserializer) { + return _ENDPOINT.withResponseDeserializer( + SearchFeaturesetsResponse.createSearchFeaturesetsResponseDeserializer(tDocumentDeserializer) + ); + } + @Override public int hashCode() { int result = 17; diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/ltr/SearchFeaturesetsResponse.java b/java-client/src/generated/java/org/opensearch/client/opensearch/ltr/SearchFeaturesetsResponse.java index 8b67f3232b..7b46f48657 100644 --- a/java-client/src/generated/java/org/opensearch/client/opensearch/ltr/SearchFeaturesetsResponse.java +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/ltr/SearchFeaturesetsResponse.java @@ -39,12 +39,12 @@ import java.util.function.Function; import javax.annotation.Generated; import javax.annotation.Nonnull; -import org.opensearch.client.json.JsonData; import org.opensearch.client.json.JsonpDeserializable; import org.opensearch.client.json.JsonpDeserializer; +import org.opensearch.client.json.NamedDeserializer; import org.opensearch.client.json.ObjectBuilderDeserializer; import org.opensearch.client.json.ObjectDeserializer; -import org.opensearch.client.opensearch.core.search.SearchResult; +import org.opensearch.client.opensearch.core.search.SearchResultJsonValue; import org.opensearch.client.util.CopyableBuilder; import org.opensearch.client.util.ObjectBuilder; import org.opensearch.client.util.ToCopyableBuilder; @@ -53,59 +53,61 @@ @JsonpDeserializable @Generated("org.opensearch.client.codegen.CodeGenerator") -public class SearchFeaturesetsResponse extends SearchResult +public class SearchFeaturesetsResponse extends SearchResultJsonValue implements - ToCopyableBuilder { + ToCopyableBuilder, SearchFeaturesetsResponse> { // --------------------------------------------------------------------------------------------- - private SearchFeaturesetsResponse(Builder builder) { + private SearchFeaturesetsResponse(Builder builder) { super(builder); } - public static SearchFeaturesetsResponse of(Function> fn) { - return fn.apply(new Builder()).build(); + public static SearchFeaturesetsResponse of( + Function, ObjectBuilder>> fn + ) { + return fn.apply(new Builder<>()).build(); } // --------------------------------------------------------------------------------------------- @Override @Nonnull - public Builder toBuilder() { - return new Builder(this); + public Builder toBuilder() { + return new Builder<>(this); } @Nonnull - public static Builder builder() { - return new Builder(); + public static Builder builder() { + return new Builder<>(); } /** * Builder for {@link SearchFeaturesetsResponse}. */ - public static class Builder extends SearchResult.AbstractBuilder + public static class Builder extends SearchResultJsonValue.AbstractBuilder> implements - CopyableBuilder { + CopyableBuilder, SearchFeaturesetsResponse> { public Builder() {} - private Builder(SearchFeaturesetsResponse o) { + private Builder(SearchFeaturesetsResponse o) { super(o); } - private Builder(Builder o) { + private Builder(Builder o) { super(o); } @Override @Nonnull - public Builder copy() { - return new Builder(this); + public Builder copy() { + return new Builder<>(this); } @Override @Nonnull - protected Builder self() { + protected Builder self() { return this; } @@ -116,25 +118,39 @@ protected Builder self() { */ @Override @Nonnull - public SearchFeaturesetsResponse build() { + public SearchFeaturesetsResponse build() { _checkSingleUse(); - return new SearchFeaturesetsResponse(this); + return new SearchFeaturesetsResponse<>(this); } } // --------------------------------------------------------------------------------------------- /** - * Json deserializer for {@link SearchFeaturesetsResponse} + * Create a JSON deserializer for SearchFeaturesetsResponse. */ - public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer.lazy( - Builder::new, - SearchFeaturesetsResponse::setupSearchFeaturesetsResponseDeserializer + public static JsonpDeserializer> createSearchFeaturesetsResponseDeserializer( + JsonpDeserializer tDocumentDeserializer + ) { + return ObjectBuilderDeserializer.createForObject( + Builder::new, + op -> SearchFeaturesetsResponse.setupSearchFeaturesetsResponseDeserializer(op, tDocumentDeserializer) + ); + } + + /** + * Json deserializer for {@link SearchFeaturesetsResponse} based on named deserializers provided by the calling {@code JsonMapper}. + */ + public static final JsonpDeserializer> _DESERIALIZER = createSearchFeaturesetsResponseDeserializer( + new NamedDeserializer<>("org.opensearch.client:Deserializer:ltr.search_featuresets.TDocument") ); - protected static void setupSearchFeaturesetsResponseDeserializer(ObjectDeserializer op) { - setupSearchResultDeserializer(op, JsonData._DESERIALIZER); + protected static void setupSearchFeaturesetsResponseDeserializer( + ObjectDeserializer> op, + JsonpDeserializer tDocumentDeserializer + ) { + setupSearchResultJsonValueDeserializer(op, tDocumentDeserializer); } @Override diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/ltr/SearchModelsRequest.java b/java-client/src/generated/java/org/opensearch/client/opensearch/ltr/SearchModelsRequest.java index 9b25d61ad7..3a7b2f62f1 100644 --- a/java-client/src/generated/java/org/opensearch/client/opensearch/ltr/SearchModelsRequest.java +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/ltr/SearchModelsRequest.java @@ -43,6 +43,7 @@ import javax.annotation.Generated; import javax.annotation.Nonnull; import javax.annotation.Nullable; +import org.opensearch.client.json.JsonpDeserializer; import org.opensearch.client.opensearch._types.ErrorResponse; import org.opensearch.client.opensearch._types.RequestBase; import org.opensearch.client.transport.Endpoint; @@ -266,7 +267,7 @@ protected void applyQueryParameters(@Nonnull Map params) { /** * Endpoint "{@code ltr.search_models}". */ - public static final Endpoint _ENDPOINT = new SimpleEndpoint<>( + public static final SimpleEndpoint _ENDPOINT = new SimpleEndpoint<>( // Request method request -> "GET", // Request path @@ -301,6 +302,15 @@ protected void applyQueryParameters(@Nonnull Map params) { SearchModelsResponse._DESERIALIZER ); + /** + * Create an "{@code ltr.search_models}" endpoint. + */ + public static Endpoint, ErrorResponse> createLtrSearchModelsEndpoint( + JsonpDeserializer tDocumentDeserializer + ) { + return _ENDPOINT.withResponseDeserializer(SearchModelsResponse.createSearchModelsResponseDeserializer(tDocumentDeserializer)); + } + @Override public int hashCode() { int result = 17; diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/ltr/SearchModelsResponse.java b/java-client/src/generated/java/org/opensearch/client/opensearch/ltr/SearchModelsResponse.java index 06e65a16a3..6b5a6ce750 100644 --- a/java-client/src/generated/java/org/opensearch/client/opensearch/ltr/SearchModelsResponse.java +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/ltr/SearchModelsResponse.java @@ -39,12 +39,12 @@ import java.util.function.Function; import javax.annotation.Generated; import javax.annotation.Nonnull; -import org.opensearch.client.json.JsonData; import org.opensearch.client.json.JsonpDeserializable; import org.opensearch.client.json.JsonpDeserializer; +import org.opensearch.client.json.NamedDeserializer; import org.opensearch.client.json.ObjectBuilderDeserializer; import org.opensearch.client.json.ObjectDeserializer; -import org.opensearch.client.opensearch.core.search.SearchResult; +import org.opensearch.client.opensearch.core.search.SearchResultJsonValue; import org.opensearch.client.util.CopyableBuilder; import org.opensearch.client.util.ObjectBuilder; import org.opensearch.client.util.ToCopyableBuilder; @@ -53,59 +53,61 @@ @JsonpDeserializable @Generated("org.opensearch.client.codegen.CodeGenerator") -public class SearchModelsResponse extends SearchResult +public class SearchModelsResponse extends SearchResultJsonValue implements - ToCopyableBuilder { + ToCopyableBuilder, SearchModelsResponse> { // --------------------------------------------------------------------------------------------- - private SearchModelsResponse(Builder builder) { + private SearchModelsResponse(Builder builder) { super(builder); } - public static SearchModelsResponse of(Function> fn) { - return fn.apply(new Builder()).build(); + public static SearchModelsResponse of( + Function, ObjectBuilder>> fn + ) { + return fn.apply(new Builder<>()).build(); } // --------------------------------------------------------------------------------------------- @Override @Nonnull - public Builder toBuilder() { - return new Builder(this); + public Builder toBuilder() { + return new Builder<>(this); } @Nonnull - public static Builder builder() { - return new Builder(); + public static Builder builder() { + return new Builder<>(); } /** * Builder for {@link SearchModelsResponse}. */ - public static class Builder extends SearchResult.AbstractBuilder + public static class Builder extends SearchResultJsonValue.AbstractBuilder> implements - CopyableBuilder { + CopyableBuilder, SearchModelsResponse> { public Builder() {} - private Builder(SearchModelsResponse o) { + private Builder(SearchModelsResponse o) { super(o); } - private Builder(Builder o) { + private Builder(Builder o) { super(o); } @Override @Nonnull - public Builder copy() { - return new Builder(this); + public Builder copy() { + return new Builder<>(this); } @Override @Nonnull - protected Builder self() { + protected Builder self() { return this; } @@ -116,25 +118,39 @@ protected Builder self() { */ @Override @Nonnull - public SearchModelsResponse build() { + public SearchModelsResponse build() { _checkSingleUse(); - return new SearchModelsResponse(this); + return new SearchModelsResponse<>(this); } } // --------------------------------------------------------------------------------------------- /** - * Json deserializer for {@link SearchModelsResponse} + * Create a JSON deserializer for SearchModelsResponse. */ - public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer.lazy( - Builder::new, - SearchModelsResponse::setupSearchModelsResponseDeserializer + public static JsonpDeserializer> createSearchModelsResponseDeserializer( + JsonpDeserializer tDocumentDeserializer + ) { + return ObjectBuilderDeserializer.createForObject( + Builder::new, + op -> SearchModelsResponse.setupSearchModelsResponseDeserializer(op, tDocumentDeserializer) + ); + } + + /** + * Json deserializer for {@link SearchModelsResponse} based on named deserializers provided by the calling {@code JsonMapper}. + */ + public static final JsonpDeserializer> _DESERIALIZER = createSearchModelsResponseDeserializer( + new NamedDeserializer<>("org.opensearch.client:Deserializer:ltr.search_models.TDocument") ); - protected static void setupSearchModelsResponseDeserializer(ObjectDeserializer op) { - setupSearchResultDeserializer(op, JsonData._DESERIALIZER); + protected static void setupSearchModelsResponseDeserializer( + ObjectDeserializer> op, + JsonpDeserializer tDocumentDeserializer + ) { + setupSearchResultJsonValueDeserializer(op, tDocumentDeserializer); } @Override diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/ml/PredictModelStreamRequest.java b/java-client/src/generated/java/org/opensearch/client/opensearch/ml/PredictModelStreamRequest.java index c7408b66fc..76c2d42544 100644 --- a/java-client/src/generated/java/org/opensearch/client/opensearch/ml/PredictModelStreamRequest.java +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/ml/PredictModelStreamRequest.java @@ -15,9 +15,11 @@ import jakarta.json.stream.JsonGenerator; import java.util.HashMap; import java.util.Map; +import java.util.Objects; import java.util.function.Function; import javax.annotation.Generated; import javax.annotation.Nonnull; +import javax.annotation.Nullable; import org.opensearch.client.json.JsonpDeserializable; import org.opensearch.client.json.JsonpDeserializer; import org.opensearch.client.json.JsonpMapper; @@ -45,24 +47,54 @@ public final class PredictModelStreamRequest extends RequestBase PlainJsonSerializable, ToCopyableBuilder { + @Nullable + private final PredictionActionType actionType; + + @Nonnull + private final Map dlq; + @Nonnull private final String modelId; @Nonnull - private final Parameters parameters; + private final Map parameters; // --------------------------------------------------------------------------------------------- private PredictModelStreamRequest(Builder builder) { super(builder); + this.actionType = builder.actionType; + this.dlq = ApiTypeHelper.unmodifiable(builder.dlq); this.modelId = ApiTypeHelper.requireNonNull(builder.modelId, this, "modelId"); - this.parameters = ApiTypeHelper.requireNonNull(builder.parameters, this, "parameters"); + this.parameters = ApiTypeHelper.unmodifiable(builder.parameters); } public static PredictModelStreamRequest of(Function> fn) { return fn.apply(new Builder()).build(); } + /** + * Overrides the action type derived from the request path. + *

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

+ */ + @Nullable + public final PredictionActionType actionType() { + return this.actionType; + } + + /** + * Dead-letter queue configuration for batch predict on remote connector models. + *

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

+ */ + @Nonnull + public final Map dlq() { + return this.dlq; + } + /** * Required - API name: {@code model_id} */ @@ -72,10 +104,13 @@ public final String modelId() { } /** - * Required - API name: {@code parameters} + * The parameters to pass to the remote connector model. + *

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

*/ @Nonnull - public final Parameters parameters() { + public final Map parameters() { return this.parameters; } @@ -90,8 +125,30 @@ public void serialize(JsonGenerator generator, JsonpMapper mapper) { } protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { - generator.writeKey("parameters"); - this.parameters.serialize(generator, mapper); + if (this.actionType != null) { + generator.writeKey("action_type"); + this.actionType.serialize(generator, mapper); + } + + if (ApiTypeHelper.isDefined(this.dlq)) { + generator.writeKey("dlq"); + generator.writeStartObject(); + for (Map.Entry item0 : this.dlq.entrySet()) { + generator.writeKey(item0.getKey()); + generator.write(item0.getValue()); + } + generator.writeEnd(); + } + + if (ApiTypeHelper.isDefined(this.parameters)) { + generator.writeKey("parameters"); + generator.writeStartObject(); + for (Map.Entry item0 : this.parameters.entrySet()) { + generator.writeKey(item0.getKey()); + generator.write(item0.getValue()); + } + generator.writeEnd(); + } } // --------------------------------------------------------------------------------------------- @@ -113,21 +170,30 @@ public static Builder builder() { public static class Builder extends RequestBase.AbstractBuilder implements CopyableBuilder { + @Nullable + private PredictionActionType actionType; + @Nullable + private Map dlq; private String modelId; - private Parameters parameters; + @Nullable + private Map parameters; public Builder() {} private Builder(PredictModelStreamRequest o) { super(o); + this.actionType = o.actionType; + this.dlq = _mapCopy(o.dlq); this.modelId = o.modelId; - this.parameters = o.parameters; + this.parameters = _mapCopy(o.parameters); } private Builder(Builder o) { super(o); + this.actionType = o.actionType; + this.dlq = _mapCopy(o.dlq); this.modelId = o.modelId; - this.parameters = o.parameters; + this.parameters = _mapCopy(o.parameters); } @Override @@ -142,6 +208,50 @@ protected Builder self() { return this; } + /** + * Overrides the action type derived from the request path. + *

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

+ */ + @Nonnull + public final Builder actionType(@Nullable PredictionActionType value) { + this.actionType = value; + return this; + } + + /** + * Dead-letter queue configuration for batch predict on remote connector models. + *

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

+ * + *

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

+ */ + @Nonnull + public final Builder dlq(Map map) { + this.dlq = _mapPutAll(this.dlq, map); + return this; + } + + /** + * Dead-letter queue configuration for batch predict on remote connector models. + *

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

+ * + *

+ * Adds an entry to dlq. + *

+ */ + @Nonnull + public final Builder dlq(String key, String value) { + this.dlq = _mapPut(this.dlq, key, value); + return this; + } + /** * Required - API name: {@code model_id} */ @@ -152,20 +262,35 @@ public final Builder modelId(String value) { } /** - * Required - API name: {@code parameters} + * The parameters to pass to the remote connector model. + *

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

+ * + *

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

*/ @Nonnull - public final Builder parameters(Parameters value) { - this.parameters = value; + public final Builder parameters(Map map) { + this.parameters = _mapPutAll(this.parameters, map); return this; } /** - * Required - API name: {@code parameters} + * The parameters to pass to the remote connector model. + *

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

+ * + *

+ * Adds an entry to parameters. + *

*/ @Nonnull - public final Builder parameters(Function> fn) { - return parameters(fn.apply(new Parameters.Builder()).build()); + public final Builder parameters(String key, String value) { + this.parameters = _mapPut(this.parameters, key, value); + return this; } /** @@ -193,7 +318,9 @@ public PredictModelStreamRequest build() { ); protected static void setupPredictModelStreamRequestDeserializer(ObjectDeserializer op) { - op.add(Builder::parameters, Parameters._DESERIALIZER, "parameters"); + op.add(Builder::actionType, PredictionActionType._DESERIALIZER, "action_type"); + op.add(Builder::dlq, JsonpDeserializer.stringMapDeserializer(JsonpDeserializer.stringDeserializer()), "dlq"); + op.add(Builder::parameters, JsonpDeserializer.stringMapDeserializer(JsonpDeserializer.stringDeserializer()), "parameters"); } // --------------------------------------------------------------------------------------------- @@ -226,8 +353,10 @@ protected static void setupPredictModelStreamRequestDeserializer(ObjectDeseriali @Override public int hashCode() { int result = 17; + result = 31 * result + Objects.hashCode(this.actionType); + result = 31 * result + Objects.hashCode(this.dlq); result = 31 * result + this.modelId.hashCode(); - result = 31 * result + this.parameters.hashCode(); + result = 31 * result + Objects.hashCode(this.parameters); return result; } @@ -236,6 +365,9 @@ public boolean equals(Object o) { if (this == o) return true; if (o == null || this.getClass() != o.getClass()) return false; PredictModelStreamRequest other = (PredictModelStreamRequest) o; - return this.modelId.equals(other.modelId) && this.parameters.equals(other.parameters); + return Objects.equals(this.actionType, other.actionType) + && Objects.equals(this.dlq, other.dlq) + && this.modelId.equals(other.modelId) + && Objects.equals(this.parameters, other.parameters); } } diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/ml/PredictionActionType.java b/java-client/src/generated/java/org/opensearch/client/opensearch/ml/PredictionActionType.java new file mode 100644 index 0000000000..82796c849f --- /dev/null +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/ml/PredictionActionType.java @@ -0,0 +1,50 @@ +/* + * 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. + */ + +//---------------------------------------------------- +// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. +//---------------------------------------------------- + +package org.opensearch.client.opensearch.ml; + +import javax.annotation.Generated; +import org.opensearch.client.json.JsonEnum; +import org.opensearch.client.json.JsonpDeserializable; + +// typedef: ml.PredictionActionType + +/** + * The action type for model prediction. + */ +@JsonpDeserializable +@Generated("org.opensearch.client.codegen.CodeGenerator") +public enum PredictionActionType implements JsonEnum { + BatchPredict("batch_predict"), + + BatchPredictStatus("batch_predict_status"), + + CancelBatchPredict("cancel_batch_predict"), + + Execute("execute"), + + Predict("predict"); + + private final String jsonValue; + + PredictionActionType(String jsonValue) { + this.jsonValue = jsonValue; + } + + public String jsonValue() { + return this.jsonValue; + } + + public static final JsonEnum.Deserializer _DESERIALIZER = new JsonEnum.Deserializer<>( + PredictionActionType.values() + ); +} diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/search_relevance/ExperimentsSearchRequest.java b/java-client/src/generated/java/org/opensearch/client/opensearch/search_relevance/ExperimentsSearchRequest.java new file mode 100644 index 0000000000..5a73829dfe --- /dev/null +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/search_relevance/ExperimentsSearchRequest.java @@ -0,0 +1,408 @@ +/* + * 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.search_relevance; + +import jakarta.json.stream.JsonGenerator; +import java.util.HashMap; +import java.util.List; +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.JsonpDeserializable; +import org.opensearch.client.json.JsonpDeserializer; +import org.opensearch.client.json.JsonpMapper; +import org.opensearch.client.json.ObjectBuilderDeserializer; +import org.opensearch.client.json.ObjectDeserializer; +import org.opensearch.client.json.PlainJsonSerializable; +import org.opensearch.client.opensearch._types.ErrorResponse; +import org.opensearch.client.opensearch._types.RequestBase; +import org.opensearch.client.opensearch._types.SortOptions; +import org.opensearch.client.opensearch._types.query_dsl.Query; +import org.opensearch.client.transport.Endpoint; +import org.opensearch.client.transport.endpoints.SimpleEndpoint; +import org.opensearch.client.util.ApiTypeHelper; +import org.opensearch.client.util.CopyableBuilder; +import org.opensearch.client.util.ObjectBuilder; +import org.opensearch.client.util.ToCopyableBuilder; + +// typedef: search_relevance.experiments_search.Request + +/** + * Searches for experiments. + */ +@JsonpDeserializable +@Generated("org.opensearch.client.codegen.CodeGenerator") +public final class ExperimentsSearchRequest extends RequestBase + implements + PlainJsonSerializable, + ToCopyableBuilder { + + @Nullable + private final Integer from; + + @Nullable + private final Query query; + + @Nullable + private final Integer size; + + @Nonnull + private final List sort; + + // --------------------------------------------------------------------------------------------- + + private ExperimentsSearchRequest(Builder builder) { + super(builder); + this.from = builder.from; + this.query = builder.query; + this.size = builder.size; + this.sort = ApiTypeHelper.unmodifiable(builder.sort); + } + + public static ExperimentsSearchRequest of(Function> fn) { + return fn.apply(new Builder()).build(); + } + + /** + * The starting offset for the results. + *

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

+ */ + @Nullable + public final Integer from() { + return this.from; + } + + /** + * API name: {@code query} + */ + @Nullable + public final Query query() { + return this.query; + } + + /** + * The maximum number of results to return. + *

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

+ */ + @Nullable + public final Integer size() { + return this.size; + } + + /** + * The sort order. + *

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

+ */ + @Nonnull + public final List sort() { + return this.sort; + } + + /** + * Serialize this object to JSON. + */ + @Override + public void serialize(JsonGenerator generator, JsonpMapper mapper) { + generator.writeStartObject(); + serializeInternal(generator, mapper); + generator.writeEnd(); + } + + protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { + if (this.from != null) { + generator.writeKey("from"); + generator.write(this.from); + } + + if (this.query != null) { + generator.writeKey("query"); + this.query.serialize(generator, mapper); + } + + if (this.size != null) { + generator.writeKey("size"); + generator.write(this.size); + } + + if (ApiTypeHelper.isDefined(this.sort)) { + generator.writeKey("sort"); + generator.writeStartArray(); + for (SortOptions item0 : this.sort) { + item0.serialize(generator, mapper); + } + generator.writeEnd(); + } + } + + // --------------------------------------------------------------------------------------------- + + @Override + @Nonnull + public Builder toBuilder() { + return new Builder(this); + } + + @Nonnull + public static Builder builder() { + return new Builder(); + } + + /** + * Builder for {@link ExperimentsSearchRequest}. + */ + public static class Builder extends RequestBase.AbstractBuilder implements CopyableBuilder { + @Nullable + private Integer from; + @Nullable + private Query query; + @Nullable + private Integer size; + @Nullable + private List sort; + + public Builder() {} + + private Builder(ExperimentsSearchRequest o) { + super(o); + this.from = o.from; + this.query = o.query; + this.size = o.size; + this.sort = _listCopy(o.sort); + } + + private Builder(Builder o) { + super(o); + this.from = o.from; + this.query = o.query; + this.size = o.size; + this.sort = _listCopy(o.sort); + } + + @Override + @Nonnull + public Builder copy() { + return new Builder(this); + } + + @Override + @Nonnull + protected Builder self() { + return this; + } + + /** + * The starting offset for the results. + *

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

+ */ + @Nonnull + public final Builder from(@Nullable Integer value) { + this.from = value; + return this; + } + + /** + * API name: {@code query} + */ + @Nonnull + public final Builder query(@Nullable Query value) { + this.query = value; + return this; + } + + /** + * API name: {@code query} + */ + @Nonnull + public final Builder query(Function> fn) { + return query(fn.apply(new Query.Builder()).build()); + } + + /** + * The maximum number of results to return. + *

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

+ */ + @Nonnull + public final Builder size(@Nullable Integer value) { + this.size = value; + return this; + } + + /** + * The sort order. + *

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

+ * + *

+ * Adds all elements of list to sort. + *

+ */ + @Nonnull + public final Builder sort(List list) { + this.sort = _listAddAll(this.sort, list); + return this; + } + + /** + * The sort order. + *

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

+ * + *

+ * Adds one or more values to sort. + *

+ */ + @Nonnull + public final Builder sort(SortOptions value, SortOptions... values) { + this.sort = _listAdd(this.sort, value, values); + return this; + } + + /** + * The sort order. + *

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

+ * + *

+ * Adds a value to sort using a builder lambda. + *

+ */ + @Nonnull + public final Builder sort(Function> fn) { + return sort(fn.apply(new SortOptions.Builder()).build()); + } + + /** + * Builds a {@link ExperimentsSearchRequest}. + * + * @throws NullPointerException if some of the required fields are null. + */ + @Override + @Nonnull + public ExperimentsSearchRequest build() { + _checkSingleUse(); + + return new ExperimentsSearchRequest(this); + } + } + + // --------------------------------------------------------------------------------------------- + + /** + * Json deserializer for {@link ExperimentsSearchRequest} + */ + public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer.lazy( + Builder::new, + ExperimentsSearchRequest::setupExperimentsSearchRequestDeserializer + ); + + protected static void setupExperimentsSearchRequestDeserializer(ObjectDeserializer op) { + op.add(Builder::from, JsonpDeserializer.integerDeserializer(), "from"); + op.add(Builder::query, Query._DESERIALIZER, "query"); + op.add(Builder::size, JsonpDeserializer.integerDeserializer(), "size"); + op.add(Builder::sort, JsonpDeserializer.arrayDeserializer(SortOptions._DESERIALIZER), "sort"); + } + + // --------------------------------------------------------------------------------------------- + + /** + * Endpoint "{@code search_relevance.experiments_search}". + */ + public static final SimpleEndpoint _ENDPOINT = new SimpleEndpoint<>( + // Request method + request -> "POST", + // Request path + request -> "/_plugins/_search_relevance/experiments/_search", + // Request parameters + request -> { + Map params = new HashMap<>(); + request.applyQueryParameters(params); + return params; + }, + SimpleEndpoint.emptyMap(), + true, + ExperimentsSearchResponse._DESERIALIZER + ); + + /** + * Create an "{@code search_relevance.experiments_search}" endpoint. + */ + public static < + TDocument> + Endpoint, ErrorResponse> + createSearchRelevanceExperimentsSearchEndpoint(JsonpDeserializer tDocumentDeserializer) { + return _ENDPOINT.withResponseDeserializer( + ExperimentsSearchResponse.createExperimentsSearchResponseDeserializer(tDocumentDeserializer) + ); + } + + @Override + public int hashCode() { + int result = 17; + result = 31 * result + Objects.hashCode(this.from); + result = 31 * result + Objects.hashCode(this.query); + result = 31 * result + Objects.hashCode(this.size); + result = 31 * result + Objects.hashCode(this.sort); + return result; + } + + @Override + public boolean equals(Object o) { + if (this == o) return true; + if (o == null || this.getClass() != o.getClass()) return false; + ExperimentsSearchRequest other = (ExperimentsSearchRequest) o; + return Objects.equals(this.from, other.from) + && Objects.equals(this.query, other.query) + && Objects.equals(this.size, other.size) + && Objects.equals(this.sort, other.sort); + } +} diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/search_relevance/ExperimentsSearchResponse.java b/java-client/src/generated/java/org/opensearch/client/opensearch/search_relevance/ExperimentsSearchResponse.java new file mode 100644 index 0000000000..c881d7e20a --- /dev/null +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/search_relevance/ExperimentsSearchResponse.java @@ -0,0 +1,760 @@ +/* + * 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.search_relevance; + +import jakarta.json.stream.JsonGenerator; +import java.util.List; +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.ExternallyTaggedUnion; +import org.opensearch.client.json.JsonData; +import org.opensearch.client.json.JsonpDeserializable; +import org.opensearch.client.json.JsonpDeserializer; +import org.opensearch.client.json.JsonpMapper; +import org.opensearch.client.json.NamedDeserializer; +import org.opensearch.client.json.ObjectBuilderDeserializer; +import org.opensearch.client.json.ObjectDeserializer; +import org.opensearch.client.json.PlainJsonSerializable; +import org.opensearch.client.opensearch._types.ClusterStatistics; +import org.opensearch.client.opensearch._types.PhaseTook; +import org.opensearch.client.opensearch._types.ShardStatistics; +import org.opensearch.client.opensearch._types.aggregations.Aggregate; +import org.opensearch.client.opensearch.core.search.HitsMetadata; +import org.opensearch.client.opensearch.core.search.ProcessorExecutionDetail; +import org.opensearch.client.opensearch.core.search.Profile; +import org.opensearch.client.opensearch.core.search.Suggest; +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: search_relevance.experiments_search.Response + +@JsonpDeserializable +@Generated("org.opensearch.client.codegen.CodeGenerator") +public class ExperimentsSearchResponse + implements + PlainJsonSerializable, + ToCopyableBuilder, ExperimentsSearchResponse> { + + @Nonnull + private final Map aggregations; + + @Nullable + private final ClusterStatistics clusters; + + @Nonnull + private final HitsMetadata hits; + + @Nullable + private final Integer numReducePhases; + + @Nullable + private final PhaseTook phaseTook; + + @Nullable + private final String pitId; + + @Nonnull + private final List processorResults; + + @Nullable + private final Profile profile; + + @Nullable + private final String scrollId; + + @Nonnull + private final ShardStatistics shards; + + @Nonnull + private final Map>> suggest; + + @Nullable + private final Boolean terminatedEarly; + + private final boolean timedOut; + + private final long took; + + // --------------------------------------------------------------------------------------------- + + private ExperimentsSearchResponse(Builder builder) { + this.aggregations = ApiTypeHelper.unmodifiable(builder.aggregations); + this.clusters = builder.clusters; + this.hits = ApiTypeHelper.requireNonNull(builder.hits, this, "hits"); + this.numReducePhases = builder.numReducePhases; + this.phaseTook = builder.phaseTook; + this.pitId = builder.pitId; + this.processorResults = ApiTypeHelper.unmodifiable(builder.processorResults); + this.profile = builder.profile; + this.scrollId = builder.scrollId; + this.shards = ApiTypeHelper.requireNonNull(builder.shards, this, "shards"); + this.suggest = ApiTypeHelper.unmodifiable(builder.suggest); + this.terminatedEarly = builder.terminatedEarly; + this.timedOut = ApiTypeHelper.requireNonNull(builder.timedOut, this, "timedOut"); + this.took = ApiTypeHelper.requireNonNull(builder.took, this, "took"); + } + + public static ExperimentsSearchResponse of( + Function, ObjectBuilder>> fn + ) { + return fn.apply(new Builder<>()).build(); + } + + /** + * API name: {@code aggregations} + */ + @Nonnull + public final Map aggregations() { + return this.aggregations; + } + + /** + * API name: {@code _clusters} + */ + @Nullable + public final ClusterStatistics clusters() { + return this.clusters; + } + + /** + * Required - API name: {@code hits} + */ + @Nonnull + public final HitsMetadata hits() { + return this.hits; + } + + /** + * API name: {@code num_reduce_phases} + */ + @Nullable + public final Integer numReducePhases() { + return this.numReducePhases; + } + + /** + * API name: {@code phase_took} + */ + @Nullable + public final PhaseTook phaseTook() { + return this.phaseTook; + } + + /** + * API name: {@code pit_id} + */ + @Nullable + public final String pitId() { + return this.pitId; + } + + /** + * API name: {@code processor_results} + */ + @Nonnull + public final List processorResults() { + return this.processorResults; + } + + /** + * API name: {@code profile} + */ + @Nullable + public final Profile profile() { + return this.profile; + } + + /** + * API name: {@code _scroll_id} + */ + @Nullable + public final String scrollId() { + return this.scrollId; + } + + /** + * Required - API name: {@code _shards} + */ + @Nonnull + public final ShardStatistics shards() { + return this.shards; + } + + /** + * API name: {@code suggest} + */ + @Nonnull + public final Map>> suggest() { + return this.suggest; + } + + /** + * API name: {@code terminated_early} + */ + @Nullable + public final Boolean terminatedEarly() { + return this.terminatedEarly; + } + + /** + * Required - API name: {@code timed_out} + */ + public final boolean timedOut() { + return this.timedOut; + } + + /** + * Required - API name: {@code took} + */ + public final long took() { + return this.took; + } + + /** + * 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.aggregations)) { + generator.writeKey("aggregations"); + ExternallyTaggedUnion.serializeTypedKeys(this.aggregations, generator, mapper); + } + + if (this.clusters != null) { + generator.writeKey("_clusters"); + this.clusters.serialize(generator, mapper); + } + + generator.writeKey("hits"); + this.hits.serialize(generator, mapper); + + if (this.numReducePhases != null) { + generator.writeKey("num_reduce_phases"); + generator.write(this.numReducePhases); + } + + if (this.phaseTook != null) { + generator.writeKey("phase_took"); + this.phaseTook.serialize(generator, mapper); + } + + if (this.pitId != null) { + generator.writeKey("pit_id"); + generator.write(this.pitId); + } + + if (ApiTypeHelper.isDefined(this.processorResults)) { + generator.writeKey("processor_results"); + generator.writeStartArray(); + for (ProcessorExecutionDetail item0 : this.processorResults) { + item0.serialize(generator, mapper); + } + generator.writeEnd(); + } + + if (this.profile != null) { + generator.writeKey("profile"); + this.profile.serialize(generator, mapper); + } + + if (this.scrollId != null) { + generator.writeKey("_scroll_id"); + generator.write(this.scrollId); + } + + generator.writeKey("_shards"); + this.shards.serialize(generator, mapper); + + if (ApiTypeHelper.isDefined(this.suggest)) { + generator.writeKey("suggest"); + ExternallyTaggedUnion.serializeTypedKeysArray(this.suggest, generator, mapper); + } + + if (this.terminatedEarly != null) { + generator.writeKey("terminated_early"); + generator.write(this.terminatedEarly); + } + + generator.writeKey("timed_out"); + generator.write(this.timedOut); + + generator.writeKey("took"); + generator.write(this.took); + } + + // --------------------------------------------------------------------------------------------- + + @Override + @Nonnull + public Builder toBuilder() { + return new Builder<>(this); + } + + @Nonnull + public static Builder builder() { + return new Builder<>(); + } + + /** + * Builder for {@link ExperimentsSearchResponse}. + */ + public static class Builder extends ObjectBuilderBase + implements + CopyableBuilder, ExperimentsSearchResponse> { + @Nullable + private Map aggregations; + @Nullable + private ClusterStatistics clusters; + private HitsMetadata hits; + @Nullable + private Integer numReducePhases; + @Nullable + private PhaseTook phaseTook; + @Nullable + private String pitId; + @Nullable + private List processorResults; + @Nullable + private Profile profile; + @Nullable + private String scrollId; + private ShardStatistics shards; + @Nullable + private Map>> suggest; + @Nullable + private Boolean terminatedEarly; + private Boolean timedOut; + private Long took; + + public Builder() {} + + private Builder(ExperimentsSearchResponse o) { + this.aggregations = _mapCopy(o.aggregations); + this.clusters = o.clusters; + this.hits = o.hits; + this.numReducePhases = o.numReducePhases; + this.phaseTook = o.phaseTook; + this.pitId = o.pitId; + this.processorResults = _listCopy(o.processorResults); + this.profile = o.profile; + this.scrollId = o.scrollId; + this.shards = o.shards; + this.suggest = _mapCopy(o.suggest); + this.terminatedEarly = o.terminatedEarly; + this.timedOut = o.timedOut; + this.took = o.took; + } + + private Builder(Builder o) { + this.aggregations = _mapCopy(o.aggregations); + this.clusters = o.clusters; + this.hits = o.hits; + this.numReducePhases = o.numReducePhases; + this.phaseTook = o.phaseTook; + this.pitId = o.pitId; + this.processorResults = _listCopy(o.processorResults); + this.profile = o.profile; + this.scrollId = o.scrollId; + this.shards = o.shards; + this.suggest = _mapCopy(o.suggest); + this.terminatedEarly = o.terminatedEarly; + this.timedOut = o.timedOut; + this.took = o.took; + } + + @Override + @Nonnull + public Builder copy() { + return new Builder<>(this); + } + + /** + * API name: {@code aggregations} + * + *

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

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

+ * Adds an entry to aggregations. + *

+ */ + @Nonnull + public final Builder aggregations(String key, Aggregate value) { + this.aggregations = _mapPut(this.aggregations, key, value); + return this; + } + + /** + * API name: {@code aggregations} + * + *

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

+ */ + @Nonnull + public final Builder aggregations(String key, Function> fn) { + return aggregations(key, fn.apply(new Aggregate.Builder()).build()); + } + + /** + * API name: {@code _clusters} + */ + @Nonnull + public final Builder clusters(@Nullable ClusterStatistics value) { + this.clusters = value; + return this; + } + + /** + * API name: {@code _clusters} + */ + @Nonnull + public final Builder clusters(Function> fn) { + return clusters(fn.apply(new ClusterStatistics.Builder()).build()); + } + + /** + * Required - API name: {@code hits} + */ + @Nonnull + public final Builder hits(HitsMetadata value) { + this.hits = value; + return this; + } + + /** + * Required - API name: {@code hits} + */ + @Nonnull + public final Builder hits(Function, ObjectBuilder>> fn) { + return hits(fn.apply(new HitsMetadata.Builder()).build()); + } + + /** + * API name: {@code num_reduce_phases} + */ + @Nonnull + public final Builder numReducePhases(@Nullable Integer value) { + this.numReducePhases = value; + return this; + } + + /** + * API name: {@code phase_took} + */ + @Nonnull + public final Builder phaseTook(@Nullable PhaseTook value) { + this.phaseTook = value; + return this; + } + + /** + * API name: {@code phase_took} + */ + @Nonnull + public final Builder phaseTook(Function> fn) { + return phaseTook(fn.apply(new PhaseTook.Builder()).build()); + } + + /** + * API name: {@code pit_id} + */ + @Nonnull + public final Builder pitId(@Nullable String value) { + this.pitId = value; + return this; + } + + /** + * API name: {@code processor_results} + * + *

+ * Adds all elements of list to processorResults. + *

+ */ + @Nonnull + public final Builder processorResults(List list) { + this.processorResults = _listAddAll(this.processorResults, list); + return this; + } + + /** + * API name: {@code processor_results} + * + *

+ * Adds one or more values to processorResults. + *

+ */ + @Nonnull + public final Builder processorResults(ProcessorExecutionDetail value, ProcessorExecutionDetail... values) { + this.processorResults = _listAdd(this.processorResults, value, values); + return this; + } + + /** + * API name: {@code processor_results} + * + *

+ * Adds a value to processorResults using a builder lambda. + *

+ */ + @Nonnull + public final Builder processorResults( + Function> fn + ) { + return processorResults(fn.apply(new ProcessorExecutionDetail.Builder()).build()); + } + + /** + * API name: {@code profile} + */ + @Nonnull + public final Builder profile(@Nullable Profile value) { + this.profile = value; + return this; + } + + /** + * API name: {@code profile} + */ + @Nonnull + public final Builder profile(Function> fn) { + return profile(fn.apply(new Profile.Builder()).build()); + } + + /** + * API name: {@code _scroll_id} + */ + @Nonnull + public final Builder scrollId(@Nullable String value) { + this.scrollId = value; + return this; + } + + /** + * Required - API name: {@code _shards} + */ + @Nonnull + public final Builder shards(ShardStatistics value) { + this.shards = value; + return this; + } + + /** + * Required - API name: {@code _shards} + */ + @Nonnull + public final Builder shards(Function> fn) { + return shards(fn.apply(new ShardStatistics.Builder()).build()); + } + + /** + * API name: {@code suggest} + * + *

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

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

+ * Adds an entry to suggest. + *

+ */ + @Nonnull + public final Builder suggest(String key, List> value) { + this.suggest = _mapPut(this.suggest, key, value); + return this; + } + + /** + * API name: {@code terminated_early} + */ + @Nonnull + public final Builder terminatedEarly(@Nullable Boolean value) { + this.terminatedEarly = value; + return this; + } + + /** + * Required - API name: {@code timed_out} + */ + @Nonnull + public final Builder timedOut(boolean value) { + this.timedOut = value; + return this; + } + + /** + * Required - API name: {@code took} + */ + @Nonnull + public final Builder took(long value) { + this.took = value; + return this; + } + + /** + * Builds a {@link ExperimentsSearchResponse}. + * + * @throws NullPointerException if some of the required fields are null. + */ + @Override + @Nonnull + public ExperimentsSearchResponse build() { + _checkSingleUse(); + + return new ExperimentsSearchResponse<>(this); + } + } + + // --------------------------------------------------------------------------------------------- + + /** + * Create a JSON deserializer for ExperimentsSearchResponse. + */ + public static JsonpDeserializer> createExperimentsSearchResponseDeserializer( + JsonpDeserializer tDocumentDeserializer + ) { + return ObjectBuilderDeserializer.createForObject( + Builder::new, + op -> ExperimentsSearchResponse.setupExperimentsSearchResponseDeserializer(op, tDocumentDeserializer) + ); + } + + /** + * Json deserializer for {@link ExperimentsSearchResponse} based on named deserializers provided by the calling {@code JsonMapper}. + */ + public static final JsonpDeserializer> _DESERIALIZER = createExperimentsSearchResponseDeserializer( + new NamedDeserializer<>("org.opensearch.client:Deserializer:search_relevance.experiments_search.TDocument") + ); + + protected static void setupExperimentsSearchResponseDeserializer( + ObjectDeserializer> op, + JsonpDeserializer tDocumentDeserializer + ) { + op.add(Builder::aggregations, Aggregate._TYPED_KEYS_DESERIALIZER, "aggregations"); + op.add(Builder::clusters, ClusterStatistics._DESERIALIZER, "_clusters"); + op.add(Builder::hits, HitsMetadata.createHitsMetadataDeserializer(tDocumentDeserializer), "hits"); + op.add(Builder::numReducePhases, JsonpDeserializer.integerDeserializer(), "num_reduce_phases"); + op.add(Builder::phaseTook, PhaseTook._DESERIALIZER, "phase_took"); + op.add(Builder::pitId, JsonpDeserializer.stringDeserializer(), "pit_id"); + op.add(Builder::processorResults, JsonpDeserializer.arrayDeserializer(ProcessorExecutionDetail._DESERIALIZER), "processor_results"); + op.add(Builder::profile, Profile._DESERIALIZER, "profile"); + op.add(Builder::scrollId, JsonpDeserializer.stringDeserializer(), "_scroll_id"); + op.add(Builder::shards, ShardStatistics._DESERIALIZER, "_shards"); + op.add( + Builder::suggest, + ExternallyTaggedUnion.arrayDeserializer(Suggest.createSuggestDeserializer(JsonData._DESERIALIZER)), + "suggest" + ); + op.add(Builder::terminatedEarly, JsonpDeserializer.booleanDeserializer(), "terminated_early"); + op.add(Builder::timedOut, JsonpDeserializer.booleanDeserializer(), "timed_out"); + op.add(Builder::took, JsonpDeserializer.longDeserializer(), "took"); + } + + @Override + public int hashCode() { + int result = 17; + result = 31 * result + Objects.hashCode(this.aggregations); + result = 31 * result + Objects.hashCode(this.clusters); + result = 31 * result + this.hits.hashCode(); + result = 31 * result + Objects.hashCode(this.numReducePhases); + result = 31 * result + Objects.hashCode(this.phaseTook); + result = 31 * result + Objects.hashCode(this.pitId); + result = 31 * result + Objects.hashCode(this.processorResults); + result = 31 * result + Objects.hashCode(this.profile); + result = 31 * result + Objects.hashCode(this.scrollId); + result = 31 * result + this.shards.hashCode(); + result = 31 * result + Objects.hashCode(this.suggest); + result = 31 * result + Objects.hashCode(this.terminatedEarly); + result = 31 * result + Boolean.hashCode(this.timedOut); + result = 31 * result + Long.hashCode(this.took); + return result; + } + + @Override + public boolean equals(Object o) { + if (this == o) return true; + if (o == null || this.getClass() != o.getClass()) return false; + ExperimentsSearchResponse other = (ExperimentsSearchResponse) o; + return Objects.equals(this.aggregations, other.aggregations) + && Objects.equals(this.clusters, other.clusters) + && this.hits.equals(other.hits) + && Objects.equals(this.numReducePhases, other.numReducePhases) + && Objects.equals(this.phaseTook, other.phaseTook) + && Objects.equals(this.pitId, other.pitId) + && Objects.equals(this.processorResults, other.processorResults) + && Objects.equals(this.profile, other.profile) + && Objects.equals(this.scrollId, other.scrollId) + && this.shards.equals(other.shards) + && Objects.equals(this.suggest, other.suggest) + && Objects.equals(this.terminatedEarly, other.terminatedEarly) + && this.timedOut == other.timedOut + && this.took == other.took; + } +} diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/search_relevance/JudgmentsSearchRequest.java b/java-client/src/generated/java/org/opensearch/client/opensearch/search_relevance/JudgmentsSearchRequest.java new file mode 100644 index 0000000000..1c7f9f9b09 --- /dev/null +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/search_relevance/JudgmentsSearchRequest.java @@ -0,0 +1,406 @@ +/* + * 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.search_relevance; + +import jakarta.json.stream.JsonGenerator; +import java.util.HashMap; +import java.util.List; +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.JsonpDeserializable; +import org.opensearch.client.json.JsonpDeserializer; +import org.opensearch.client.json.JsonpMapper; +import org.opensearch.client.json.ObjectBuilderDeserializer; +import org.opensearch.client.json.ObjectDeserializer; +import org.opensearch.client.json.PlainJsonSerializable; +import org.opensearch.client.opensearch._types.ErrorResponse; +import org.opensearch.client.opensearch._types.RequestBase; +import org.opensearch.client.opensearch._types.SortOptions; +import org.opensearch.client.opensearch._types.query_dsl.Query; +import org.opensearch.client.transport.Endpoint; +import org.opensearch.client.transport.endpoints.SimpleEndpoint; +import org.opensearch.client.util.ApiTypeHelper; +import org.opensearch.client.util.CopyableBuilder; +import org.opensearch.client.util.ObjectBuilder; +import org.opensearch.client.util.ToCopyableBuilder; + +// typedef: search_relevance.judgments_search.Request + +/** + * Searches for judgments. + */ +@JsonpDeserializable +@Generated("org.opensearch.client.codegen.CodeGenerator") +public final class JudgmentsSearchRequest extends RequestBase + implements + PlainJsonSerializable, + ToCopyableBuilder { + + @Nullable + private final Integer from; + + @Nullable + private final Query query; + + @Nullable + private final Integer size; + + @Nonnull + private final List sort; + + // --------------------------------------------------------------------------------------------- + + private JudgmentsSearchRequest(Builder builder) { + super(builder); + this.from = builder.from; + this.query = builder.query; + this.size = builder.size; + this.sort = ApiTypeHelper.unmodifiable(builder.sort); + } + + public static JudgmentsSearchRequest of(Function> fn) { + return fn.apply(new Builder()).build(); + } + + /** + * The starting offset for the results. + *

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

+ */ + @Nullable + public final Integer from() { + return this.from; + } + + /** + * API name: {@code query} + */ + @Nullable + public final Query query() { + return this.query; + } + + /** + * The maximum number of results to return. + *

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

+ */ + @Nullable + public final Integer size() { + return this.size; + } + + /** + * The sort order. + *

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

+ */ + @Nonnull + public final List sort() { + return this.sort; + } + + /** + * Serialize this object to JSON. + */ + @Override + public void serialize(JsonGenerator generator, JsonpMapper mapper) { + generator.writeStartObject(); + serializeInternal(generator, mapper); + generator.writeEnd(); + } + + protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { + if (this.from != null) { + generator.writeKey("from"); + generator.write(this.from); + } + + if (this.query != null) { + generator.writeKey("query"); + this.query.serialize(generator, mapper); + } + + if (this.size != null) { + generator.writeKey("size"); + generator.write(this.size); + } + + if (ApiTypeHelper.isDefined(this.sort)) { + generator.writeKey("sort"); + generator.writeStartArray(); + for (SortOptions item0 : this.sort) { + item0.serialize(generator, mapper); + } + generator.writeEnd(); + } + } + + // --------------------------------------------------------------------------------------------- + + @Override + @Nonnull + public Builder toBuilder() { + return new Builder(this); + } + + @Nonnull + public static Builder builder() { + return new Builder(); + } + + /** + * Builder for {@link JudgmentsSearchRequest}. + */ + public static class Builder extends RequestBase.AbstractBuilder implements CopyableBuilder { + @Nullable + private Integer from; + @Nullable + private Query query; + @Nullable + private Integer size; + @Nullable + private List sort; + + public Builder() {} + + private Builder(JudgmentsSearchRequest o) { + super(o); + this.from = o.from; + this.query = o.query; + this.size = o.size; + this.sort = _listCopy(o.sort); + } + + private Builder(Builder o) { + super(o); + this.from = o.from; + this.query = o.query; + this.size = o.size; + this.sort = _listCopy(o.sort); + } + + @Override + @Nonnull + public Builder copy() { + return new Builder(this); + } + + @Override + @Nonnull + protected Builder self() { + return this; + } + + /** + * The starting offset for the results. + *

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

+ */ + @Nonnull + public final Builder from(@Nullable Integer value) { + this.from = value; + return this; + } + + /** + * API name: {@code query} + */ + @Nonnull + public final Builder query(@Nullable Query value) { + this.query = value; + return this; + } + + /** + * API name: {@code query} + */ + @Nonnull + public final Builder query(Function> fn) { + return query(fn.apply(new Query.Builder()).build()); + } + + /** + * The maximum number of results to return. + *

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

+ */ + @Nonnull + public final Builder size(@Nullable Integer value) { + this.size = value; + return this; + } + + /** + * The sort order. + *

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

+ * + *

+ * Adds all elements of list to sort. + *

+ */ + @Nonnull + public final Builder sort(List list) { + this.sort = _listAddAll(this.sort, list); + return this; + } + + /** + * The sort order. + *

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

+ * + *

+ * Adds one or more values to sort. + *

+ */ + @Nonnull + public final Builder sort(SortOptions value, SortOptions... values) { + this.sort = _listAdd(this.sort, value, values); + return this; + } + + /** + * The sort order. + *

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

+ * + *

+ * Adds a value to sort using a builder lambda. + *

+ */ + @Nonnull + public final Builder sort(Function> fn) { + return sort(fn.apply(new SortOptions.Builder()).build()); + } + + /** + * Builds a {@link JudgmentsSearchRequest}. + * + * @throws NullPointerException if some of the required fields are null. + */ + @Override + @Nonnull + public JudgmentsSearchRequest build() { + _checkSingleUse(); + + return new JudgmentsSearchRequest(this); + } + } + + // --------------------------------------------------------------------------------------------- + + /** + * Json deserializer for {@link JudgmentsSearchRequest} + */ + public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer.lazy( + Builder::new, + JudgmentsSearchRequest::setupJudgmentsSearchRequestDeserializer + ); + + protected static void setupJudgmentsSearchRequestDeserializer(ObjectDeserializer op) { + op.add(Builder::from, JsonpDeserializer.integerDeserializer(), "from"); + op.add(Builder::query, Query._DESERIALIZER, "query"); + op.add(Builder::size, JsonpDeserializer.integerDeserializer(), "size"); + op.add(Builder::sort, JsonpDeserializer.arrayDeserializer(SortOptions._DESERIALIZER), "sort"); + } + + // --------------------------------------------------------------------------------------------- + + /** + * Endpoint "{@code search_relevance.judgments_search}". + */ + public static final SimpleEndpoint _ENDPOINT = new SimpleEndpoint<>( + // Request method + request -> "POST", + // Request path + request -> "/_plugins/_search_relevance/judgments/_search", + // Request parameters + request -> { + Map params = new HashMap<>(); + request.applyQueryParameters(params); + return params; + }, + SimpleEndpoint.emptyMap(), + true, + JudgmentsSearchResponse._DESERIALIZER + ); + + /** + * Create an "{@code search_relevance.judgments_search}" endpoint. + */ + public static < + TDocument> + Endpoint, ErrorResponse> + createSearchRelevanceJudgmentsSearchEndpoint(JsonpDeserializer tDocumentDeserializer) { + return _ENDPOINT.withResponseDeserializer(JudgmentsSearchResponse.createJudgmentsSearchResponseDeserializer(tDocumentDeserializer)); + } + + @Override + public int hashCode() { + int result = 17; + result = 31 * result + Objects.hashCode(this.from); + result = 31 * result + Objects.hashCode(this.query); + result = 31 * result + Objects.hashCode(this.size); + result = 31 * result + Objects.hashCode(this.sort); + return result; + } + + @Override + public boolean equals(Object o) { + if (this == o) return true; + if (o == null || this.getClass() != o.getClass()) return false; + JudgmentsSearchRequest other = (JudgmentsSearchRequest) o; + return Objects.equals(this.from, other.from) + && Objects.equals(this.query, other.query) + && Objects.equals(this.size, other.size) + && Objects.equals(this.sort, other.sort); + } +} diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/search_relevance/JudgmentsSearchResponse.java b/java-client/src/generated/java/org/opensearch/client/opensearch/search_relevance/JudgmentsSearchResponse.java new file mode 100644 index 0000000000..4c41c2a883 --- /dev/null +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/search_relevance/JudgmentsSearchResponse.java @@ -0,0 +1,760 @@ +/* + * 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.search_relevance; + +import jakarta.json.stream.JsonGenerator; +import java.util.List; +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.ExternallyTaggedUnion; +import org.opensearch.client.json.JsonData; +import org.opensearch.client.json.JsonpDeserializable; +import org.opensearch.client.json.JsonpDeserializer; +import org.opensearch.client.json.JsonpMapper; +import org.opensearch.client.json.NamedDeserializer; +import org.opensearch.client.json.ObjectBuilderDeserializer; +import org.opensearch.client.json.ObjectDeserializer; +import org.opensearch.client.json.PlainJsonSerializable; +import org.opensearch.client.opensearch._types.ClusterStatistics; +import org.opensearch.client.opensearch._types.PhaseTook; +import org.opensearch.client.opensearch._types.ShardStatistics; +import org.opensearch.client.opensearch._types.aggregations.Aggregate; +import org.opensearch.client.opensearch.core.search.HitsMetadata; +import org.opensearch.client.opensearch.core.search.ProcessorExecutionDetail; +import org.opensearch.client.opensearch.core.search.Profile; +import org.opensearch.client.opensearch.core.search.Suggest; +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: search_relevance.judgments_search.Response + +@JsonpDeserializable +@Generated("org.opensearch.client.codegen.CodeGenerator") +public class JudgmentsSearchResponse + implements + PlainJsonSerializable, + ToCopyableBuilder, JudgmentsSearchResponse> { + + @Nonnull + private final Map aggregations; + + @Nullable + private final ClusterStatistics clusters; + + @Nonnull + private final HitsMetadata hits; + + @Nullable + private final Integer numReducePhases; + + @Nullable + private final PhaseTook phaseTook; + + @Nullable + private final String pitId; + + @Nonnull + private final List processorResults; + + @Nullable + private final Profile profile; + + @Nullable + private final String scrollId; + + @Nonnull + private final ShardStatistics shards; + + @Nonnull + private final Map>> suggest; + + @Nullable + private final Boolean terminatedEarly; + + private final boolean timedOut; + + private final long took; + + // --------------------------------------------------------------------------------------------- + + private JudgmentsSearchResponse(Builder builder) { + this.aggregations = ApiTypeHelper.unmodifiable(builder.aggregations); + this.clusters = builder.clusters; + this.hits = ApiTypeHelper.requireNonNull(builder.hits, this, "hits"); + this.numReducePhases = builder.numReducePhases; + this.phaseTook = builder.phaseTook; + this.pitId = builder.pitId; + this.processorResults = ApiTypeHelper.unmodifiable(builder.processorResults); + this.profile = builder.profile; + this.scrollId = builder.scrollId; + this.shards = ApiTypeHelper.requireNonNull(builder.shards, this, "shards"); + this.suggest = ApiTypeHelper.unmodifiable(builder.suggest); + this.terminatedEarly = builder.terminatedEarly; + this.timedOut = ApiTypeHelper.requireNonNull(builder.timedOut, this, "timedOut"); + this.took = ApiTypeHelper.requireNonNull(builder.took, this, "took"); + } + + public static JudgmentsSearchResponse of( + Function, ObjectBuilder>> fn + ) { + return fn.apply(new Builder<>()).build(); + } + + /** + * API name: {@code aggregations} + */ + @Nonnull + public final Map aggregations() { + return this.aggregations; + } + + /** + * API name: {@code _clusters} + */ + @Nullable + public final ClusterStatistics clusters() { + return this.clusters; + } + + /** + * Required - API name: {@code hits} + */ + @Nonnull + public final HitsMetadata hits() { + return this.hits; + } + + /** + * API name: {@code num_reduce_phases} + */ + @Nullable + public final Integer numReducePhases() { + return this.numReducePhases; + } + + /** + * API name: {@code phase_took} + */ + @Nullable + public final PhaseTook phaseTook() { + return this.phaseTook; + } + + /** + * API name: {@code pit_id} + */ + @Nullable + public final String pitId() { + return this.pitId; + } + + /** + * API name: {@code processor_results} + */ + @Nonnull + public final List processorResults() { + return this.processorResults; + } + + /** + * API name: {@code profile} + */ + @Nullable + public final Profile profile() { + return this.profile; + } + + /** + * API name: {@code _scroll_id} + */ + @Nullable + public final String scrollId() { + return this.scrollId; + } + + /** + * Required - API name: {@code _shards} + */ + @Nonnull + public final ShardStatistics shards() { + return this.shards; + } + + /** + * API name: {@code suggest} + */ + @Nonnull + public final Map>> suggest() { + return this.suggest; + } + + /** + * API name: {@code terminated_early} + */ + @Nullable + public final Boolean terminatedEarly() { + return this.terminatedEarly; + } + + /** + * Required - API name: {@code timed_out} + */ + public final boolean timedOut() { + return this.timedOut; + } + + /** + * Required - API name: {@code took} + */ + public final long took() { + return this.took; + } + + /** + * 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.aggregations)) { + generator.writeKey("aggregations"); + ExternallyTaggedUnion.serializeTypedKeys(this.aggregations, generator, mapper); + } + + if (this.clusters != null) { + generator.writeKey("_clusters"); + this.clusters.serialize(generator, mapper); + } + + generator.writeKey("hits"); + this.hits.serialize(generator, mapper); + + if (this.numReducePhases != null) { + generator.writeKey("num_reduce_phases"); + generator.write(this.numReducePhases); + } + + if (this.phaseTook != null) { + generator.writeKey("phase_took"); + this.phaseTook.serialize(generator, mapper); + } + + if (this.pitId != null) { + generator.writeKey("pit_id"); + generator.write(this.pitId); + } + + if (ApiTypeHelper.isDefined(this.processorResults)) { + generator.writeKey("processor_results"); + generator.writeStartArray(); + for (ProcessorExecutionDetail item0 : this.processorResults) { + item0.serialize(generator, mapper); + } + generator.writeEnd(); + } + + if (this.profile != null) { + generator.writeKey("profile"); + this.profile.serialize(generator, mapper); + } + + if (this.scrollId != null) { + generator.writeKey("_scroll_id"); + generator.write(this.scrollId); + } + + generator.writeKey("_shards"); + this.shards.serialize(generator, mapper); + + if (ApiTypeHelper.isDefined(this.suggest)) { + generator.writeKey("suggest"); + ExternallyTaggedUnion.serializeTypedKeysArray(this.suggest, generator, mapper); + } + + if (this.terminatedEarly != null) { + generator.writeKey("terminated_early"); + generator.write(this.terminatedEarly); + } + + generator.writeKey("timed_out"); + generator.write(this.timedOut); + + generator.writeKey("took"); + generator.write(this.took); + } + + // --------------------------------------------------------------------------------------------- + + @Override + @Nonnull + public Builder toBuilder() { + return new Builder<>(this); + } + + @Nonnull + public static Builder builder() { + return new Builder<>(); + } + + /** + * Builder for {@link JudgmentsSearchResponse}. + */ + public static class Builder extends ObjectBuilderBase + implements + CopyableBuilder, JudgmentsSearchResponse> { + @Nullable + private Map aggregations; + @Nullable + private ClusterStatistics clusters; + private HitsMetadata hits; + @Nullable + private Integer numReducePhases; + @Nullable + private PhaseTook phaseTook; + @Nullable + private String pitId; + @Nullable + private List processorResults; + @Nullable + private Profile profile; + @Nullable + private String scrollId; + private ShardStatistics shards; + @Nullable + private Map>> suggest; + @Nullable + private Boolean terminatedEarly; + private Boolean timedOut; + private Long took; + + public Builder() {} + + private Builder(JudgmentsSearchResponse o) { + this.aggregations = _mapCopy(o.aggregations); + this.clusters = o.clusters; + this.hits = o.hits; + this.numReducePhases = o.numReducePhases; + this.phaseTook = o.phaseTook; + this.pitId = o.pitId; + this.processorResults = _listCopy(o.processorResults); + this.profile = o.profile; + this.scrollId = o.scrollId; + this.shards = o.shards; + this.suggest = _mapCopy(o.suggest); + this.terminatedEarly = o.terminatedEarly; + this.timedOut = o.timedOut; + this.took = o.took; + } + + private Builder(Builder o) { + this.aggregations = _mapCopy(o.aggregations); + this.clusters = o.clusters; + this.hits = o.hits; + this.numReducePhases = o.numReducePhases; + this.phaseTook = o.phaseTook; + this.pitId = o.pitId; + this.processorResults = _listCopy(o.processorResults); + this.profile = o.profile; + this.scrollId = o.scrollId; + this.shards = o.shards; + this.suggest = _mapCopy(o.suggest); + this.terminatedEarly = o.terminatedEarly; + this.timedOut = o.timedOut; + this.took = o.took; + } + + @Override + @Nonnull + public Builder copy() { + return new Builder<>(this); + } + + /** + * API name: {@code aggregations} + * + *

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

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

+ * Adds an entry to aggregations. + *

+ */ + @Nonnull + public final Builder aggregations(String key, Aggregate value) { + this.aggregations = _mapPut(this.aggregations, key, value); + return this; + } + + /** + * API name: {@code aggregations} + * + *

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

+ */ + @Nonnull + public final Builder aggregations(String key, Function> fn) { + return aggregations(key, fn.apply(new Aggregate.Builder()).build()); + } + + /** + * API name: {@code _clusters} + */ + @Nonnull + public final Builder clusters(@Nullable ClusterStatistics value) { + this.clusters = value; + return this; + } + + /** + * API name: {@code _clusters} + */ + @Nonnull + public final Builder clusters(Function> fn) { + return clusters(fn.apply(new ClusterStatistics.Builder()).build()); + } + + /** + * Required - API name: {@code hits} + */ + @Nonnull + public final Builder hits(HitsMetadata value) { + this.hits = value; + return this; + } + + /** + * Required - API name: {@code hits} + */ + @Nonnull + public final Builder hits(Function, ObjectBuilder>> fn) { + return hits(fn.apply(new HitsMetadata.Builder()).build()); + } + + /** + * API name: {@code num_reduce_phases} + */ + @Nonnull + public final Builder numReducePhases(@Nullable Integer value) { + this.numReducePhases = value; + return this; + } + + /** + * API name: {@code phase_took} + */ + @Nonnull + public final Builder phaseTook(@Nullable PhaseTook value) { + this.phaseTook = value; + return this; + } + + /** + * API name: {@code phase_took} + */ + @Nonnull + public final Builder phaseTook(Function> fn) { + return phaseTook(fn.apply(new PhaseTook.Builder()).build()); + } + + /** + * API name: {@code pit_id} + */ + @Nonnull + public final Builder pitId(@Nullable String value) { + this.pitId = value; + return this; + } + + /** + * API name: {@code processor_results} + * + *

+ * Adds all elements of list to processorResults. + *

+ */ + @Nonnull + public final Builder processorResults(List list) { + this.processorResults = _listAddAll(this.processorResults, list); + return this; + } + + /** + * API name: {@code processor_results} + * + *

+ * Adds one or more values to processorResults. + *

+ */ + @Nonnull + public final Builder processorResults(ProcessorExecutionDetail value, ProcessorExecutionDetail... values) { + this.processorResults = _listAdd(this.processorResults, value, values); + return this; + } + + /** + * API name: {@code processor_results} + * + *

+ * Adds a value to processorResults using a builder lambda. + *

+ */ + @Nonnull + public final Builder processorResults( + Function> fn + ) { + return processorResults(fn.apply(new ProcessorExecutionDetail.Builder()).build()); + } + + /** + * API name: {@code profile} + */ + @Nonnull + public final Builder profile(@Nullable Profile value) { + this.profile = value; + return this; + } + + /** + * API name: {@code profile} + */ + @Nonnull + public final Builder profile(Function> fn) { + return profile(fn.apply(new Profile.Builder()).build()); + } + + /** + * API name: {@code _scroll_id} + */ + @Nonnull + public final Builder scrollId(@Nullable String value) { + this.scrollId = value; + return this; + } + + /** + * Required - API name: {@code _shards} + */ + @Nonnull + public final Builder shards(ShardStatistics value) { + this.shards = value; + return this; + } + + /** + * Required - API name: {@code _shards} + */ + @Nonnull + public final Builder shards(Function> fn) { + return shards(fn.apply(new ShardStatistics.Builder()).build()); + } + + /** + * API name: {@code suggest} + * + *

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

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

+ * Adds an entry to suggest. + *

+ */ + @Nonnull + public final Builder suggest(String key, List> value) { + this.suggest = _mapPut(this.suggest, key, value); + return this; + } + + /** + * API name: {@code terminated_early} + */ + @Nonnull + public final Builder terminatedEarly(@Nullable Boolean value) { + this.terminatedEarly = value; + return this; + } + + /** + * Required - API name: {@code timed_out} + */ + @Nonnull + public final Builder timedOut(boolean value) { + this.timedOut = value; + return this; + } + + /** + * Required - API name: {@code took} + */ + @Nonnull + public final Builder took(long value) { + this.took = value; + return this; + } + + /** + * Builds a {@link JudgmentsSearchResponse}. + * + * @throws NullPointerException if some of the required fields are null. + */ + @Override + @Nonnull + public JudgmentsSearchResponse build() { + _checkSingleUse(); + + return new JudgmentsSearchResponse<>(this); + } + } + + // --------------------------------------------------------------------------------------------- + + /** + * Create a JSON deserializer for JudgmentsSearchResponse. + */ + public static JsonpDeserializer> createJudgmentsSearchResponseDeserializer( + JsonpDeserializer tDocumentDeserializer + ) { + return ObjectBuilderDeserializer.createForObject( + Builder::new, + op -> JudgmentsSearchResponse.setupJudgmentsSearchResponseDeserializer(op, tDocumentDeserializer) + ); + } + + /** + * Json deserializer for {@link JudgmentsSearchResponse} based on named deserializers provided by the calling {@code JsonMapper}. + */ + public static final JsonpDeserializer> _DESERIALIZER = createJudgmentsSearchResponseDeserializer( + new NamedDeserializer<>("org.opensearch.client:Deserializer:search_relevance.judgments_search.TDocument") + ); + + protected static void setupJudgmentsSearchResponseDeserializer( + ObjectDeserializer> op, + JsonpDeserializer tDocumentDeserializer + ) { + op.add(Builder::aggregations, Aggregate._TYPED_KEYS_DESERIALIZER, "aggregations"); + op.add(Builder::clusters, ClusterStatistics._DESERIALIZER, "_clusters"); + op.add(Builder::hits, HitsMetadata.createHitsMetadataDeserializer(tDocumentDeserializer), "hits"); + op.add(Builder::numReducePhases, JsonpDeserializer.integerDeserializer(), "num_reduce_phases"); + op.add(Builder::phaseTook, PhaseTook._DESERIALIZER, "phase_took"); + op.add(Builder::pitId, JsonpDeserializer.stringDeserializer(), "pit_id"); + op.add(Builder::processorResults, JsonpDeserializer.arrayDeserializer(ProcessorExecutionDetail._DESERIALIZER), "processor_results"); + op.add(Builder::profile, Profile._DESERIALIZER, "profile"); + op.add(Builder::scrollId, JsonpDeserializer.stringDeserializer(), "_scroll_id"); + op.add(Builder::shards, ShardStatistics._DESERIALIZER, "_shards"); + op.add( + Builder::suggest, + ExternallyTaggedUnion.arrayDeserializer(Suggest.createSuggestDeserializer(JsonData._DESERIALIZER)), + "suggest" + ); + op.add(Builder::terminatedEarly, JsonpDeserializer.booleanDeserializer(), "terminated_early"); + op.add(Builder::timedOut, JsonpDeserializer.booleanDeserializer(), "timed_out"); + op.add(Builder::took, JsonpDeserializer.longDeserializer(), "took"); + } + + @Override + public int hashCode() { + int result = 17; + result = 31 * result + Objects.hashCode(this.aggregations); + result = 31 * result + Objects.hashCode(this.clusters); + result = 31 * result + this.hits.hashCode(); + result = 31 * result + Objects.hashCode(this.numReducePhases); + result = 31 * result + Objects.hashCode(this.phaseTook); + result = 31 * result + Objects.hashCode(this.pitId); + result = 31 * result + Objects.hashCode(this.processorResults); + result = 31 * result + Objects.hashCode(this.profile); + result = 31 * result + Objects.hashCode(this.scrollId); + result = 31 * result + this.shards.hashCode(); + result = 31 * result + Objects.hashCode(this.suggest); + result = 31 * result + Objects.hashCode(this.terminatedEarly); + result = 31 * result + Boolean.hashCode(this.timedOut); + result = 31 * result + Long.hashCode(this.took); + return result; + } + + @Override + public boolean equals(Object o) { + if (this == o) return true; + if (o == null || this.getClass() != o.getClass()) return false; + JudgmentsSearchResponse other = (JudgmentsSearchResponse) o; + return Objects.equals(this.aggregations, other.aggregations) + && Objects.equals(this.clusters, other.clusters) + && this.hits.equals(other.hits) + && Objects.equals(this.numReducePhases, other.numReducePhases) + && Objects.equals(this.phaseTook, other.phaseTook) + && Objects.equals(this.pitId, other.pitId) + && Objects.equals(this.processorResults, other.processorResults) + && Objects.equals(this.profile, other.profile) + && Objects.equals(this.scrollId, other.scrollId) + && this.shards.equals(other.shards) + && Objects.equals(this.suggest, other.suggest) + && Objects.equals(this.terminatedEarly, other.terminatedEarly) + && this.timedOut == other.timedOut + && this.took == other.took; + } +} diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/search_relevance/OpenSearchSearchRelevanceAsyncClient.java b/java-client/src/generated/java/org/opensearch/client/opensearch/search_relevance/OpenSearchSearchRelevanceAsyncClient.java index 2522e00b32..04c6401440 100644 --- a/java-client/src/generated/java/org/opensearch/client/opensearch/search_relevance/OpenSearchSearchRelevanceAsyncClient.java +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/search_relevance/OpenSearchSearchRelevanceAsyncClient.java @@ -173,6 +173,41 @@ public final CompletableFuture deleteSearchC return deleteSearchConfigurations(fn.apply(new DeleteSearchConfigurationsRequest.Builder()).build()); } + // ----- Endpoint: search_relevance.experiments_search + + /** + * Searches for experiments. + */ + public CompletableFuture> experimentsSearch( + ExperimentsSearchRequest request, + Class tDocumentClass + ) throws IOException, OpenSearchException { + @SuppressWarnings("unchecked") + JsonEndpoint, ErrorResponse> endpoint = (JsonEndpoint< + ExperimentsSearchRequest, + ExperimentsSearchResponse, + ErrorResponse>) ExperimentsSearchRequest._ENDPOINT; + endpoint = new EndpointWithResponseMapperAttr<>( + endpoint, + "org.opensearch.client:Deserializer:search_relevance.experiments_search.TDocument", + getDeserializer(tDocumentClass) + ); + + return this.transport.performRequestAsync(request, endpoint, this.transportOptions); + } + + /** + * Searches for experiments. + * + * @param fn a function that initializes a builder to create the {@link ExperimentsSearchRequest} + */ + public final CompletableFuture> experimentsSearch( + Function> fn, + Class tDocumentClass + ) throws IOException, OpenSearchException { + return experimentsSearch(fn.apply(new ExperimentsSearchRequest.Builder()).build(), tDocumentClass); + } + // ----- Endpoint: search_relevance.get_experiments /** @@ -394,6 +429,41 @@ public final CompletableFuture getStats() throws IOException, return getStats(new GetStatsRequest.Builder().build()); } + // ----- Endpoint: search_relevance.judgments_search + + /** + * Searches for judgments. + */ + public CompletableFuture> judgmentsSearch( + JudgmentsSearchRequest request, + Class tDocumentClass + ) throws IOException, OpenSearchException { + @SuppressWarnings("unchecked") + JsonEndpoint, ErrorResponse> endpoint = (JsonEndpoint< + JudgmentsSearchRequest, + JudgmentsSearchResponse, + ErrorResponse>) JudgmentsSearchRequest._ENDPOINT; + endpoint = new EndpointWithResponseMapperAttr<>( + endpoint, + "org.opensearch.client:Deserializer:search_relevance.judgments_search.TDocument", + getDeserializer(tDocumentClass) + ); + + return this.transport.performRequestAsync(request, endpoint, this.transportOptions); + } + + /** + * Searches for judgments. + * + * @param fn a function that initializes a builder to create the {@link JudgmentsSearchRequest} + */ + public final CompletableFuture> judgmentsSearch( + Function> fn, + Class tDocumentClass + ) throws IOException, OpenSearchException { + return judgmentsSearch(fn.apply(new JudgmentsSearchRequest.Builder()).build(), tDocumentClass); + } + // ----- Endpoint: search_relevance.post_query_sets /** @@ -557,4 +627,75 @@ public final CompletableFuture putSearchConfigu public final CompletableFuture putSearchConfigurations() throws IOException, OpenSearchException { return putSearchConfigurations(new PutSearchConfigurationsRequest.Builder().build()); } + + // ----- Endpoint: search_relevance.query_sets_search + + /** + * Searches for queries in the query sets. + */ + public CompletableFuture> querySetsSearch( + QuerySetsSearchRequest request, + Class tDocumentClass + ) throws IOException, OpenSearchException { + @SuppressWarnings("unchecked") + JsonEndpoint, ErrorResponse> endpoint = (JsonEndpoint< + QuerySetsSearchRequest, + QuerySetsSearchResponse, + ErrorResponse>) QuerySetsSearchRequest._ENDPOINT; + endpoint = new EndpointWithResponseMapperAttr<>( + endpoint, + "org.opensearch.client:Deserializer:search_relevance.query_sets_search.TDocument", + getDeserializer(tDocumentClass) + ); + + return this.transport.performRequestAsync(request, endpoint, this.transportOptions); + } + + /** + * Searches for queries in the query sets. + * + * @param fn a function that initializes a builder to create the {@link QuerySetsSearchRequest} + */ + public final CompletableFuture> querySetsSearch( + Function> fn, + Class tDocumentClass + ) throws IOException, OpenSearchException { + return querySetsSearch(fn.apply(new QuerySetsSearchRequest.Builder()).build(), tDocumentClass); + } + + // ----- Endpoint: search_relevance.search_configurations_search + + /** + * Searches for search configurations. + */ + public CompletableFuture> searchConfigurationsSearch( + SearchConfigurationsSearchRequest request, + Class tDocumentClass + ) throws IOException, OpenSearchException { + @SuppressWarnings("unchecked") + JsonEndpoint, ErrorResponse> endpoint = + (JsonEndpoint< + SearchConfigurationsSearchRequest, + SearchConfigurationsSearchResponse, + ErrorResponse>) SearchConfigurationsSearchRequest._ENDPOINT; + endpoint = new EndpointWithResponseMapperAttr<>( + endpoint, + "org.opensearch.client:Deserializer:search_relevance.search_configurations_search.TDocument", + getDeserializer(tDocumentClass) + ); + + return this.transport.performRequestAsync(request, endpoint, this.transportOptions); + } + + /** + * Searches for search configurations. + * + * @param fn a function that initializes a builder to create the {@link SearchConfigurationsSearchRequest} + */ + public final CompletableFuture> searchConfigurationsSearch( + Function> fn, + Class tDocumentClass + ) throws IOException, OpenSearchException { + return searchConfigurationsSearch(fn.apply(new SearchConfigurationsSearchRequest.Builder()).build(), tDocumentClass); + } } diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/search_relevance/OpenSearchSearchRelevanceClient.java b/java-client/src/generated/java/org/opensearch/client/opensearch/search_relevance/OpenSearchSearchRelevanceClient.java index b6f0fccdc5..1ad544696c 100644 --- a/java-client/src/generated/java/org/opensearch/client/opensearch/search_relevance/OpenSearchSearchRelevanceClient.java +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/search_relevance/OpenSearchSearchRelevanceClient.java @@ -167,6 +167,41 @@ public final DeleteSearchConfigurationsResponse deleteSearchConfigurations( return deleteSearchConfigurations(fn.apply(new DeleteSearchConfigurationsRequest.Builder()).build()); } + // ----- Endpoint: search_relevance.experiments_search + + /** + * Searches for experiments. + */ + public ExperimentsSearchResponse experimentsSearch( + ExperimentsSearchRequest request, + Class tDocumentClass + ) throws IOException, OpenSearchException { + @SuppressWarnings("unchecked") + JsonEndpoint, ErrorResponse> endpoint = (JsonEndpoint< + ExperimentsSearchRequest, + ExperimentsSearchResponse, + ErrorResponse>) ExperimentsSearchRequest._ENDPOINT; + endpoint = new EndpointWithResponseMapperAttr<>( + endpoint, + "org.opensearch.client:Deserializer:search_relevance.experiments_search.TDocument", + getDeserializer(tDocumentClass) + ); + + return this.transport.performRequest(request, endpoint, this.transportOptions); + } + + /** + * Searches for experiments. + * + * @param fn a function that initializes a builder to create the {@link ExperimentsSearchRequest} + */ + public final ExperimentsSearchResponse experimentsSearch( + Function> fn, + Class tDocumentClass + ) throws IOException, OpenSearchException { + return experimentsSearch(fn.apply(new ExperimentsSearchRequest.Builder()).build(), tDocumentClass); + } + // ----- Endpoint: search_relevance.get_experiments /** @@ -381,6 +416,39 @@ public final GetStatsResponse getStats() throws IOException, OpenSearchException return getStats(new GetStatsRequest.Builder().build()); } + // ----- Endpoint: search_relevance.judgments_search + + /** + * Searches for judgments. + */ + public JudgmentsSearchResponse judgmentsSearch(JudgmentsSearchRequest request, Class tDocumentClass) + throws IOException, OpenSearchException { + @SuppressWarnings("unchecked") + JsonEndpoint, ErrorResponse> endpoint = (JsonEndpoint< + JudgmentsSearchRequest, + JudgmentsSearchResponse, + ErrorResponse>) JudgmentsSearchRequest._ENDPOINT; + endpoint = new EndpointWithResponseMapperAttr<>( + endpoint, + "org.opensearch.client:Deserializer:search_relevance.judgments_search.TDocument", + getDeserializer(tDocumentClass) + ); + + return this.transport.performRequest(request, endpoint, this.transportOptions); + } + + /** + * Searches for judgments. + * + * @param fn a function that initializes a builder to create the {@link JudgmentsSearchRequest} + */ + public final JudgmentsSearchResponse judgmentsSearch( + Function> fn, + Class tDocumentClass + ) throws IOException, OpenSearchException { + return judgmentsSearch(fn.apply(new JudgmentsSearchRequest.Builder()).build(), tDocumentClass); + } + // ----- Endpoint: search_relevance.post_query_sets /** @@ -540,4 +608,73 @@ public final PutSearchConfigurationsResponse putSearchConfigurations( public final PutSearchConfigurationsResponse putSearchConfigurations() throws IOException, OpenSearchException { return putSearchConfigurations(new PutSearchConfigurationsRequest.Builder().build()); } + + // ----- Endpoint: search_relevance.query_sets_search + + /** + * Searches for queries in the query sets. + */ + public QuerySetsSearchResponse querySetsSearch(QuerySetsSearchRequest request, Class tDocumentClass) + throws IOException, OpenSearchException { + @SuppressWarnings("unchecked") + JsonEndpoint, ErrorResponse> endpoint = (JsonEndpoint< + QuerySetsSearchRequest, + QuerySetsSearchResponse, + ErrorResponse>) QuerySetsSearchRequest._ENDPOINT; + endpoint = new EndpointWithResponseMapperAttr<>( + endpoint, + "org.opensearch.client:Deserializer:search_relevance.query_sets_search.TDocument", + getDeserializer(tDocumentClass) + ); + + return this.transport.performRequest(request, endpoint, this.transportOptions); + } + + /** + * Searches for queries in the query sets. + * + * @param fn a function that initializes a builder to create the {@link QuerySetsSearchRequest} + */ + public final QuerySetsSearchResponse querySetsSearch( + Function> fn, + Class tDocumentClass + ) throws IOException, OpenSearchException { + return querySetsSearch(fn.apply(new QuerySetsSearchRequest.Builder()).build(), tDocumentClass); + } + + // ----- Endpoint: search_relevance.search_configurations_search + + /** + * Searches for search configurations. + */ + public SearchConfigurationsSearchResponse searchConfigurationsSearch( + SearchConfigurationsSearchRequest request, + Class tDocumentClass + ) throws IOException, OpenSearchException { + @SuppressWarnings("unchecked") + JsonEndpoint, ErrorResponse> endpoint = + (JsonEndpoint< + SearchConfigurationsSearchRequest, + SearchConfigurationsSearchResponse, + ErrorResponse>) SearchConfigurationsSearchRequest._ENDPOINT; + endpoint = new EndpointWithResponseMapperAttr<>( + endpoint, + "org.opensearch.client:Deserializer:search_relevance.search_configurations_search.TDocument", + getDeserializer(tDocumentClass) + ); + + return this.transport.performRequest(request, endpoint, this.transportOptions); + } + + /** + * Searches for search configurations. + * + * @param fn a function that initializes a builder to create the {@link SearchConfigurationsSearchRequest} + */ + public final SearchConfigurationsSearchResponse searchConfigurationsSearch( + Function> fn, + Class tDocumentClass + ) throws IOException, OpenSearchException { + return searchConfigurationsSearch(fn.apply(new SearchConfigurationsSearchRequest.Builder()).build(), tDocumentClass); + } } diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/search_relevance/PutSearchConfigurationsRequest.java b/java-client/src/generated/java/org/opensearch/client/opensearch/search_relevance/PutSearchConfigurationsRequest.java index b0b13118f5..72e4a59158 100644 --- a/java-client/src/generated/java/org/opensearch/client/opensearch/search_relevance/PutSearchConfigurationsRequest.java +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/search_relevance/PutSearchConfigurationsRequest.java @@ -70,6 +70,9 @@ public final class PutSearchConfigurationsRequest extends RequestBase PlainJsonSerializable, ToCopyableBuilder { + @Nullable + private final String description; + @Nullable private final String index; @@ -86,6 +89,7 @@ public final class PutSearchConfigurationsRequest extends RequestBase private PutSearchConfigurationsRequest(Builder builder) { super(builder); + this.description = builder.description; this.index = builder.index; this.name = builder.name; this.query = builder.query; @@ -98,6 +102,14 @@ public static PutSearchConfigurationsRequest of( return fn.apply(new Builder()).build(); } + /** + * API name: {@code description} + */ + @Nullable + public final String description() { + return this.description; + } + /** * API name: {@code index} */ @@ -141,6 +153,11 @@ public void serialize(JsonGenerator generator, JsonpMapper mapper) { } protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { + if (this.description != null) { + generator.writeKey("description"); + generator.write(this.description); + } + if (this.index != null) { generator.writeKey("index"); generator.write(this.index); @@ -182,6 +199,8 @@ public static class Builder extends RequestBase.AbstractBuilder implements CopyableBuilder { @Nullable + private String description; + @Nullable private String index; @Nullable private String name; @@ -194,6 +213,7 @@ public Builder() {} private Builder(PutSearchConfigurationsRequest o) { super(o); + this.description = o.description; this.index = o.index; this.name = o.name; this.query = o.query; @@ -202,6 +222,7 @@ private Builder(PutSearchConfigurationsRequest o) { private Builder(Builder o) { super(o); + this.description = o.description; this.index = o.index; this.name = o.name; this.query = o.query; @@ -220,6 +241,15 @@ protected Builder self() { return this; } + /** + * API name: {@code description} + */ + @Nonnull + public final Builder description(@Nullable String value) { + this.description = value; + return this; + } + /** * API name: {@code index} */ @@ -281,6 +311,7 @@ public PutSearchConfigurationsRequest build() { ); protected static void setupPutSearchConfigurationsRequestDeserializer(ObjectDeserializer op) { + op.add(Builder::description, JsonpDeserializer.stringDeserializer(), "description"); op.add(Builder::index, JsonpDeserializer.stringDeserializer(), "index"); op.add(Builder::name, JsonpDeserializer.stringDeserializer(), "name"); op.add(Builder::query, JsonpDeserializer.stringDeserializer(), "query"); @@ -312,6 +343,7 @@ protected static void setupPutSearchConfigurationsRequestDeserializer(ObjectDese @Override public int hashCode() { int result = 17; + result = 31 * result + Objects.hashCode(this.description); result = 31 * result + Objects.hashCode(this.index); result = 31 * result + Objects.hashCode(this.name); result = 31 * result + Objects.hashCode(this.query); @@ -324,7 +356,8 @@ public boolean equals(Object o) { if (this == o) return true; if (o == null || this.getClass() != o.getClass()) return false; PutSearchConfigurationsRequest other = (PutSearchConfigurationsRequest) o; - return Objects.equals(this.index, other.index) + return Objects.equals(this.description, other.description) + && Objects.equals(this.index, other.index) && Objects.equals(this.name, other.name) && Objects.equals(this.query, other.query) && Objects.equals(this.searchPipeline, other.searchPipeline); diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/search_relevance/QuerySetsSearchRequest.java b/java-client/src/generated/java/org/opensearch/client/opensearch/search_relevance/QuerySetsSearchRequest.java new file mode 100644 index 0000000000..7ad5985fae --- /dev/null +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/search_relevance/QuerySetsSearchRequest.java @@ -0,0 +1,406 @@ +/* + * 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.search_relevance; + +import jakarta.json.stream.JsonGenerator; +import java.util.HashMap; +import java.util.List; +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.JsonpDeserializable; +import org.opensearch.client.json.JsonpDeserializer; +import org.opensearch.client.json.JsonpMapper; +import org.opensearch.client.json.ObjectBuilderDeserializer; +import org.opensearch.client.json.ObjectDeserializer; +import org.opensearch.client.json.PlainJsonSerializable; +import org.opensearch.client.opensearch._types.ErrorResponse; +import org.opensearch.client.opensearch._types.RequestBase; +import org.opensearch.client.opensearch._types.SortOptions; +import org.opensearch.client.opensearch._types.query_dsl.Query; +import org.opensearch.client.transport.Endpoint; +import org.opensearch.client.transport.endpoints.SimpleEndpoint; +import org.opensearch.client.util.ApiTypeHelper; +import org.opensearch.client.util.CopyableBuilder; +import org.opensearch.client.util.ObjectBuilder; +import org.opensearch.client.util.ToCopyableBuilder; + +// typedef: search_relevance.query_sets_search.Request + +/** + * Searches for queries in the query sets. + */ +@JsonpDeserializable +@Generated("org.opensearch.client.codegen.CodeGenerator") +public final class QuerySetsSearchRequest extends RequestBase + implements + PlainJsonSerializable, + ToCopyableBuilder { + + @Nullable + private final Integer from; + + @Nullable + private final Query query; + + @Nullable + private final Integer size; + + @Nonnull + private final List sort; + + // --------------------------------------------------------------------------------------------- + + private QuerySetsSearchRequest(Builder builder) { + super(builder); + this.from = builder.from; + this.query = builder.query; + this.size = builder.size; + this.sort = ApiTypeHelper.unmodifiable(builder.sort); + } + + public static QuerySetsSearchRequest of(Function> fn) { + return fn.apply(new Builder()).build(); + } + + /** + * The starting offset for the results. + *

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

+ */ + @Nullable + public final Integer from() { + return this.from; + } + + /** + * API name: {@code query} + */ + @Nullable + public final Query query() { + return this.query; + } + + /** + * The maximum number of results to return. + *

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

+ */ + @Nullable + public final Integer size() { + return this.size; + } + + /** + * The sort order. + *

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

+ */ + @Nonnull + public final List sort() { + return this.sort; + } + + /** + * Serialize this object to JSON. + */ + @Override + public void serialize(JsonGenerator generator, JsonpMapper mapper) { + generator.writeStartObject(); + serializeInternal(generator, mapper); + generator.writeEnd(); + } + + protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { + if (this.from != null) { + generator.writeKey("from"); + generator.write(this.from); + } + + if (this.query != null) { + generator.writeKey("query"); + this.query.serialize(generator, mapper); + } + + if (this.size != null) { + generator.writeKey("size"); + generator.write(this.size); + } + + if (ApiTypeHelper.isDefined(this.sort)) { + generator.writeKey("sort"); + generator.writeStartArray(); + for (SortOptions item0 : this.sort) { + item0.serialize(generator, mapper); + } + generator.writeEnd(); + } + } + + // --------------------------------------------------------------------------------------------- + + @Override + @Nonnull + public Builder toBuilder() { + return new Builder(this); + } + + @Nonnull + public static Builder builder() { + return new Builder(); + } + + /** + * Builder for {@link QuerySetsSearchRequest}. + */ + public static class Builder extends RequestBase.AbstractBuilder implements CopyableBuilder { + @Nullable + private Integer from; + @Nullable + private Query query; + @Nullable + private Integer size; + @Nullable + private List sort; + + public Builder() {} + + private Builder(QuerySetsSearchRequest o) { + super(o); + this.from = o.from; + this.query = o.query; + this.size = o.size; + this.sort = _listCopy(o.sort); + } + + private Builder(Builder o) { + super(o); + this.from = o.from; + this.query = o.query; + this.size = o.size; + this.sort = _listCopy(o.sort); + } + + @Override + @Nonnull + public Builder copy() { + return new Builder(this); + } + + @Override + @Nonnull + protected Builder self() { + return this; + } + + /** + * The starting offset for the results. + *

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

+ */ + @Nonnull + public final Builder from(@Nullable Integer value) { + this.from = value; + return this; + } + + /** + * API name: {@code query} + */ + @Nonnull + public final Builder query(@Nullable Query value) { + this.query = value; + return this; + } + + /** + * API name: {@code query} + */ + @Nonnull + public final Builder query(Function> fn) { + return query(fn.apply(new Query.Builder()).build()); + } + + /** + * The maximum number of results to return. + *

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

+ */ + @Nonnull + public final Builder size(@Nullable Integer value) { + this.size = value; + return this; + } + + /** + * The sort order. + *

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

+ * + *

+ * Adds all elements of list to sort. + *

+ */ + @Nonnull + public final Builder sort(List list) { + this.sort = _listAddAll(this.sort, list); + return this; + } + + /** + * The sort order. + *

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

+ * + *

+ * Adds one or more values to sort. + *

+ */ + @Nonnull + public final Builder sort(SortOptions value, SortOptions... values) { + this.sort = _listAdd(this.sort, value, values); + return this; + } + + /** + * The sort order. + *

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

+ * + *

+ * Adds a value to sort using a builder lambda. + *

+ */ + @Nonnull + public final Builder sort(Function> fn) { + return sort(fn.apply(new SortOptions.Builder()).build()); + } + + /** + * Builds a {@link QuerySetsSearchRequest}. + * + * @throws NullPointerException if some of the required fields are null. + */ + @Override + @Nonnull + public QuerySetsSearchRequest build() { + _checkSingleUse(); + + return new QuerySetsSearchRequest(this); + } + } + + // --------------------------------------------------------------------------------------------- + + /** + * Json deserializer for {@link QuerySetsSearchRequest} + */ + public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer.lazy( + Builder::new, + QuerySetsSearchRequest::setupQuerySetsSearchRequestDeserializer + ); + + protected static void setupQuerySetsSearchRequestDeserializer(ObjectDeserializer op) { + op.add(Builder::from, JsonpDeserializer.integerDeserializer(), "from"); + op.add(Builder::query, Query._DESERIALIZER, "query"); + op.add(Builder::size, JsonpDeserializer.integerDeserializer(), "size"); + op.add(Builder::sort, JsonpDeserializer.arrayDeserializer(SortOptions._DESERIALIZER), "sort"); + } + + // --------------------------------------------------------------------------------------------- + + /** + * Endpoint "{@code search_relevance.query_sets_search}". + */ + public static final SimpleEndpoint _ENDPOINT = new SimpleEndpoint<>( + // Request method + request -> "POST", + // Request path + request -> "/_plugins/_search_relevance/query_sets/_search", + // Request parameters + request -> { + Map params = new HashMap<>(); + request.applyQueryParameters(params); + return params; + }, + SimpleEndpoint.emptyMap(), + true, + QuerySetsSearchResponse._DESERIALIZER + ); + + /** + * Create an "{@code search_relevance.query_sets_search}" endpoint. + */ + public static < + TDocument> + Endpoint, ErrorResponse> + createSearchRelevanceQuerySetsSearchEndpoint(JsonpDeserializer tDocumentDeserializer) { + return _ENDPOINT.withResponseDeserializer(QuerySetsSearchResponse.createQuerySetsSearchResponseDeserializer(tDocumentDeserializer)); + } + + @Override + public int hashCode() { + int result = 17; + result = 31 * result + Objects.hashCode(this.from); + result = 31 * result + Objects.hashCode(this.query); + result = 31 * result + Objects.hashCode(this.size); + result = 31 * result + Objects.hashCode(this.sort); + return result; + } + + @Override + public boolean equals(Object o) { + if (this == o) return true; + if (o == null || this.getClass() != o.getClass()) return false; + QuerySetsSearchRequest other = (QuerySetsSearchRequest) o; + return Objects.equals(this.from, other.from) + && Objects.equals(this.query, other.query) + && Objects.equals(this.size, other.size) + && Objects.equals(this.sort, other.sort); + } +} diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/search_relevance/QuerySetsSearchResponse.java b/java-client/src/generated/java/org/opensearch/client/opensearch/search_relevance/QuerySetsSearchResponse.java new file mode 100644 index 0000000000..5032a89794 --- /dev/null +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/search_relevance/QuerySetsSearchResponse.java @@ -0,0 +1,760 @@ +/* + * 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.search_relevance; + +import jakarta.json.stream.JsonGenerator; +import java.util.List; +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.ExternallyTaggedUnion; +import org.opensearch.client.json.JsonData; +import org.opensearch.client.json.JsonpDeserializable; +import org.opensearch.client.json.JsonpDeserializer; +import org.opensearch.client.json.JsonpMapper; +import org.opensearch.client.json.NamedDeserializer; +import org.opensearch.client.json.ObjectBuilderDeserializer; +import org.opensearch.client.json.ObjectDeserializer; +import org.opensearch.client.json.PlainJsonSerializable; +import org.opensearch.client.opensearch._types.ClusterStatistics; +import org.opensearch.client.opensearch._types.PhaseTook; +import org.opensearch.client.opensearch._types.ShardStatistics; +import org.opensearch.client.opensearch._types.aggregations.Aggregate; +import org.opensearch.client.opensearch.core.search.HitsMetadata; +import org.opensearch.client.opensearch.core.search.ProcessorExecutionDetail; +import org.opensearch.client.opensearch.core.search.Profile; +import org.opensearch.client.opensearch.core.search.Suggest; +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: search_relevance.query_sets_search.Response + +@JsonpDeserializable +@Generated("org.opensearch.client.codegen.CodeGenerator") +public class QuerySetsSearchResponse + implements + PlainJsonSerializable, + ToCopyableBuilder, QuerySetsSearchResponse> { + + @Nonnull + private final Map aggregations; + + @Nullable + private final ClusterStatistics clusters; + + @Nonnull + private final HitsMetadata hits; + + @Nullable + private final Integer numReducePhases; + + @Nullable + private final PhaseTook phaseTook; + + @Nullable + private final String pitId; + + @Nonnull + private final List processorResults; + + @Nullable + private final Profile profile; + + @Nullable + private final String scrollId; + + @Nonnull + private final ShardStatistics shards; + + @Nonnull + private final Map>> suggest; + + @Nullable + private final Boolean terminatedEarly; + + private final boolean timedOut; + + private final long took; + + // --------------------------------------------------------------------------------------------- + + private QuerySetsSearchResponse(Builder builder) { + this.aggregations = ApiTypeHelper.unmodifiable(builder.aggregations); + this.clusters = builder.clusters; + this.hits = ApiTypeHelper.requireNonNull(builder.hits, this, "hits"); + this.numReducePhases = builder.numReducePhases; + this.phaseTook = builder.phaseTook; + this.pitId = builder.pitId; + this.processorResults = ApiTypeHelper.unmodifiable(builder.processorResults); + this.profile = builder.profile; + this.scrollId = builder.scrollId; + this.shards = ApiTypeHelper.requireNonNull(builder.shards, this, "shards"); + this.suggest = ApiTypeHelper.unmodifiable(builder.suggest); + this.terminatedEarly = builder.terminatedEarly; + this.timedOut = ApiTypeHelper.requireNonNull(builder.timedOut, this, "timedOut"); + this.took = ApiTypeHelper.requireNonNull(builder.took, this, "took"); + } + + public static QuerySetsSearchResponse of( + Function, ObjectBuilder>> fn + ) { + return fn.apply(new Builder<>()).build(); + } + + /** + * API name: {@code aggregations} + */ + @Nonnull + public final Map aggregations() { + return this.aggregations; + } + + /** + * API name: {@code _clusters} + */ + @Nullable + public final ClusterStatistics clusters() { + return this.clusters; + } + + /** + * Required - API name: {@code hits} + */ + @Nonnull + public final HitsMetadata hits() { + return this.hits; + } + + /** + * API name: {@code num_reduce_phases} + */ + @Nullable + public final Integer numReducePhases() { + return this.numReducePhases; + } + + /** + * API name: {@code phase_took} + */ + @Nullable + public final PhaseTook phaseTook() { + return this.phaseTook; + } + + /** + * API name: {@code pit_id} + */ + @Nullable + public final String pitId() { + return this.pitId; + } + + /** + * API name: {@code processor_results} + */ + @Nonnull + public final List processorResults() { + return this.processorResults; + } + + /** + * API name: {@code profile} + */ + @Nullable + public final Profile profile() { + return this.profile; + } + + /** + * API name: {@code _scroll_id} + */ + @Nullable + public final String scrollId() { + return this.scrollId; + } + + /** + * Required - API name: {@code _shards} + */ + @Nonnull + public final ShardStatistics shards() { + return this.shards; + } + + /** + * API name: {@code suggest} + */ + @Nonnull + public final Map>> suggest() { + return this.suggest; + } + + /** + * API name: {@code terminated_early} + */ + @Nullable + public final Boolean terminatedEarly() { + return this.terminatedEarly; + } + + /** + * Required - API name: {@code timed_out} + */ + public final boolean timedOut() { + return this.timedOut; + } + + /** + * Required - API name: {@code took} + */ + public final long took() { + return this.took; + } + + /** + * 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.aggregations)) { + generator.writeKey("aggregations"); + ExternallyTaggedUnion.serializeTypedKeys(this.aggregations, generator, mapper); + } + + if (this.clusters != null) { + generator.writeKey("_clusters"); + this.clusters.serialize(generator, mapper); + } + + generator.writeKey("hits"); + this.hits.serialize(generator, mapper); + + if (this.numReducePhases != null) { + generator.writeKey("num_reduce_phases"); + generator.write(this.numReducePhases); + } + + if (this.phaseTook != null) { + generator.writeKey("phase_took"); + this.phaseTook.serialize(generator, mapper); + } + + if (this.pitId != null) { + generator.writeKey("pit_id"); + generator.write(this.pitId); + } + + if (ApiTypeHelper.isDefined(this.processorResults)) { + generator.writeKey("processor_results"); + generator.writeStartArray(); + for (ProcessorExecutionDetail item0 : this.processorResults) { + item0.serialize(generator, mapper); + } + generator.writeEnd(); + } + + if (this.profile != null) { + generator.writeKey("profile"); + this.profile.serialize(generator, mapper); + } + + if (this.scrollId != null) { + generator.writeKey("_scroll_id"); + generator.write(this.scrollId); + } + + generator.writeKey("_shards"); + this.shards.serialize(generator, mapper); + + if (ApiTypeHelper.isDefined(this.suggest)) { + generator.writeKey("suggest"); + ExternallyTaggedUnion.serializeTypedKeysArray(this.suggest, generator, mapper); + } + + if (this.terminatedEarly != null) { + generator.writeKey("terminated_early"); + generator.write(this.terminatedEarly); + } + + generator.writeKey("timed_out"); + generator.write(this.timedOut); + + generator.writeKey("took"); + generator.write(this.took); + } + + // --------------------------------------------------------------------------------------------- + + @Override + @Nonnull + public Builder toBuilder() { + return new Builder<>(this); + } + + @Nonnull + public static Builder builder() { + return new Builder<>(); + } + + /** + * Builder for {@link QuerySetsSearchResponse}. + */ + public static class Builder extends ObjectBuilderBase + implements + CopyableBuilder, QuerySetsSearchResponse> { + @Nullable + private Map aggregations; + @Nullable + private ClusterStatistics clusters; + private HitsMetadata hits; + @Nullable + private Integer numReducePhases; + @Nullable + private PhaseTook phaseTook; + @Nullable + private String pitId; + @Nullable + private List processorResults; + @Nullable + private Profile profile; + @Nullable + private String scrollId; + private ShardStatistics shards; + @Nullable + private Map>> suggest; + @Nullable + private Boolean terminatedEarly; + private Boolean timedOut; + private Long took; + + public Builder() {} + + private Builder(QuerySetsSearchResponse o) { + this.aggregations = _mapCopy(o.aggregations); + this.clusters = o.clusters; + this.hits = o.hits; + this.numReducePhases = o.numReducePhases; + this.phaseTook = o.phaseTook; + this.pitId = o.pitId; + this.processorResults = _listCopy(o.processorResults); + this.profile = o.profile; + this.scrollId = o.scrollId; + this.shards = o.shards; + this.suggest = _mapCopy(o.suggest); + this.terminatedEarly = o.terminatedEarly; + this.timedOut = o.timedOut; + this.took = o.took; + } + + private Builder(Builder o) { + this.aggregations = _mapCopy(o.aggregations); + this.clusters = o.clusters; + this.hits = o.hits; + this.numReducePhases = o.numReducePhases; + this.phaseTook = o.phaseTook; + this.pitId = o.pitId; + this.processorResults = _listCopy(o.processorResults); + this.profile = o.profile; + this.scrollId = o.scrollId; + this.shards = o.shards; + this.suggest = _mapCopy(o.suggest); + this.terminatedEarly = o.terminatedEarly; + this.timedOut = o.timedOut; + this.took = o.took; + } + + @Override + @Nonnull + public Builder copy() { + return new Builder<>(this); + } + + /** + * API name: {@code aggregations} + * + *

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

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

+ * Adds an entry to aggregations. + *

+ */ + @Nonnull + public final Builder aggregations(String key, Aggregate value) { + this.aggregations = _mapPut(this.aggregations, key, value); + return this; + } + + /** + * API name: {@code aggregations} + * + *

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

+ */ + @Nonnull + public final Builder aggregations(String key, Function> fn) { + return aggregations(key, fn.apply(new Aggregate.Builder()).build()); + } + + /** + * API name: {@code _clusters} + */ + @Nonnull + public final Builder clusters(@Nullable ClusterStatistics value) { + this.clusters = value; + return this; + } + + /** + * API name: {@code _clusters} + */ + @Nonnull + public final Builder clusters(Function> fn) { + return clusters(fn.apply(new ClusterStatistics.Builder()).build()); + } + + /** + * Required - API name: {@code hits} + */ + @Nonnull + public final Builder hits(HitsMetadata value) { + this.hits = value; + return this; + } + + /** + * Required - API name: {@code hits} + */ + @Nonnull + public final Builder hits(Function, ObjectBuilder>> fn) { + return hits(fn.apply(new HitsMetadata.Builder()).build()); + } + + /** + * API name: {@code num_reduce_phases} + */ + @Nonnull + public final Builder numReducePhases(@Nullable Integer value) { + this.numReducePhases = value; + return this; + } + + /** + * API name: {@code phase_took} + */ + @Nonnull + public final Builder phaseTook(@Nullable PhaseTook value) { + this.phaseTook = value; + return this; + } + + /** + * API name: {@code phase_took} + */ + @Nonnull + public final Builder phaseTook(Function> fn) { + return phaseTook(fn.apply(new PhaseTook.Builder()).build()); + } + + /** + * API name: {@code pit_id} + */ + @Nonnull + public final Builder pitId(@Nullable String value) { + this.pitId = value; + return this; + } + + /** + * API name: {@code processor_results} + * + *

+ * Adds all elements of list to processorResults. + *

+ */ + @Nonnull + public final Builder processorResults(List list) { + this.processorResults = _listAddAll(this.processorResults, list); + return this; + } + + /** + * API name: {@code processor_results} + * + *

+ * Adds one or more values to processorResults. + *

+ */ + @Nonnull + public final Builder processorResults(ProcessorExecutionDetail value, ProcessorExecutionDetail... values) { + this.processorResults = _listAdd(this.processorResults, value, values); + return this; + } + + /** + * API name: {@code processor_results} + * + *

+ * Adds a value to processorResults using a builder lambda. + *

+ */ + @Nonnull + public final Builder processorResults( + Function> fn + ) { + return processorResults(fn.apply(new ProcessorExecutionDetail.Builder()).build()); + } + + /** + * API name: {@code profile} + */ + @Nonnull + public final Builder profile(@Nullable Profile value) { + this.profile = value; + return this; + } + + /** + * API name: {@code profile} + */ + @Nonnull + public final Builder profile(Function> fn) { + return profile(fn.apply(new Profile.Builder()).build()); + } + + /** + * API name: {@code _scroll_id} + */ + @Nonnull + public final Builder scrollId(@Nullable String value) { + this.scrollId = value; + return this; + } + + /** + * Required - API name: {@code _shards} + */ + @Nonnull + public final Builder shards(ShardStatistics value) { + this.shards = value; + return this; + } + + /** + * Required - API name: {@code _shards} + */ + @Nonnull + public final Builder shards(Function> fn) { + return shards(fn.apply(new ShardStatistics.Builder()).build()); + } + + /** + * API name: {@code suggest} + * + *

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

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

+ * Adds an entry to suggest. + *

+ */ + @Nonnull + public final Builder suggest(String key, List> value) { + this.suggest = _mapPut(this.suggest, key, value); + return this; + } + + /** + * API name: {@code terminated_early} + */ + @Nonnull + public final Builder terminatedEarly(@Nullable Boolean value) { + this.terminatedEarly = value; + return this; + } + + /** + * Required - API name: {@code timed_out} + */ + @Nonnull + public final Builder timedOut(boolean value) { + this.timedOut = value; + return this; + } + + /** + * Required - API name: {@code took} + */ + @Nonnull + public final Builder took(long value) { + this.took = value; + return this; + } + + /** + * Builds a {@link QuerySetsSearchResponse}. + * + * @throws NullPointerException if some of the required fields are null. + */ + @Override + @Nonnull + public QuerySetsSearchResponse build() { + _checkSingleUse(); + + return new QuerySetsSearchResponse<>(this); + } + } + + // --------------------------------------------------------------------------------------------- + + /** + * Create a JSON deserializer for QuerySetsSearchResponse. + */ + public static JsonpDeserializer> createQuerySetsSearchResponseDeserializer( + JsonpDeserializer tDocumentDeserializer + ) { + return ObjectBuilderDeserializer.createForObject( + Builder::new, + op -> QuerySetsSearchResponse.setupQuerySetsSearchResponseDeserializer(op, tDocumentDeserializer) + ); + } + + /** + * Json deserializer for {@link QuerySetsSearchResponse} based on named deserializers provided by the calling {@code JsonMapper}. + */ + public static final JsonpDeserializer> _DESERIALIZER = createQuerySetsSearchResponseDeserializer( + new NamedDeserializer<>("org.opensearch.client:Deserializer:search_relevance.query_sets_search.TDocument") + ); + + protected static void setupQuerySetsSearchResponseDeserializer( + ObjectDeserializer> op, + JsonpDeserializer tDocumentDeserializer + ) { + op.add(Builder::aggregations, Aggregate._TYPED_KEYS_DESERIALIZER, "aggregations"); + op.add(Builder::clusters, ClusterStatistics._DESERIALIZER, "_clusters"); + op.add(Builder::hits, HitsMetadata.createHitsMetadataDeserializer(tDocumentDeserializer), "hits"); + op.add(Builder::numReducePhases, JsonpDeserializer.integerDeserializer(), "num_reduce_phases"); + op.add(Builder::phaseTook, PhaseTook._DESERIALIZER, "phase_took"); + op.add(Builder::pitId, JsonpDeserializer.stringDeserializer(), "pit_id"); + op.add(Builder::processorResults, JsonpDeserializer.arrayDeserializer(ProcessorExecutionDetail._DESERIALIZER), "processor_results"); + op.add(Builder::profile, Profile._DESERIALIZER, "profile"); + op.add(Builder::scrollId, JsonpDeserializer.stringDeserializer(), "_scroll_id"); + op.add(Builder::shards, ShardStatistics._DESERIALIZER, "_shards"); + op.add( + Builder::suggest, + ExternallyTaggedUnion.arrayDeserializer(Suggest.createSuggestDeserializer(JsonData._DESERIALIZER)), + "suggest" + ); + op.add(Builder::terminatedEarly, JsonpDeserializer.booleanDeserializer(), "terminated_early"); + op.add(Builder::timedOut, JsonpDeserializer.booleanDeserializer(), "timed_out"); + op.add(Builder::took, JsonpDeserializer.longDeserializer(), "took"); + } + + @Override + public int hashCode() { + int result = 17; + result = 31 * result + Objects.hashCode(this.aggregations); + result = 31 * result + Objects.hashCode(this.clusters); + result = 31 * result + this.hits.hashCode(); + result = 31 * result + Objects.hashCode(this.numReducePhases); + result = 31 * result + Objects.hashCode(this.phaseTook); + result = 31 * result + Objects.hashCode(this.pitId); + result = 31 * result + Objects.hashCode(this.processorResults); + result = 31 * result + Objects.hashCode(this.profile); + result = 31 * result + Objects.hashCode(this.scrollId); + result = 31 * result + this.shards.hashCode(); + result = 31 * result + Objects.hashCode(this.suggest); + result = 31 * result + Objects.hashCode(this.terminatedEarly); + result = 31 * result + Boolean.hashCode(this.timedOut); + result = 31 * result + Long.hashCode(this.took); + return result; + } + + @Override + public boolean equals(Object o) { + if (this == o) return true; + if (o == null || this.getClass() != o.getClass()) return false; + QuerySetsSearchResponse other = (QuerySetsSearchResponse) o; + return Objects.equals(this.aggregations, other.aggregations) + && Objects.equals(this.clusters, other.clusters) + && this.hits.equals(other.hits) + && Objects.equals(this.numReducePhases, other.numReducePhases) + && Objects.equals(this.phaseTook, other.phaseTook) + && Objects.equals(this.pitId, other.pitId) + && Objects.equals(this.processorResults, other.processorResults) + && Objects.equals(this.profile, other.profile) + && Objects.equals(this.scrollId, other.scrollId) + && this.shards.equals(other.shards) + && Objects.equals(this.suggest, other.suggest) + && Objects.equals(this.terminatedEarly, other.terminatedEarly) + && this.timedOut == other.timedOut + && this.took == other.took; + } +} diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/search_relevance/SearchConfigurationsSearchRequest.java b/java-client/src/generated/java/org/opensearch/client/opensearch/search_relevance/SearchConfigurationsSearchRequest.java new file mode 100644 index 0000000000..9e077f3c13 --- /dev/null +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/search_relevance/SearchConfigurationsSearchRequest.java @@ -0,0 +1,414 @@ +/* + * 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.search_relevance; + +import jakarta.json.stream.JsonGenerator; +import java.util.HashMap; +import java.util.List; +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.JsonpDeserializable; +import org.opensearch.client.json.JsonpDeserializer; +import org.opensearch.client.json.JsonpMapper; +import org.opensearch.client.json.ObjectBuilderDeserializer; +import org.opensearch.client.json.ObjectDeserializer; +import org.opensearch.client.json.PlainJsonSerializable; +import org.opensearch.client.opensearch._types.ErrorResponse; +import org.opensearch.client.opensearch._types.RequestBase; +import org.opensearch.client.opensearch._types.SortOptions; +import org.opensearch.client.opensearch._types.query_dsl.Query; +import org.opensearch.client.transport.Endpoint; +import org.opensearch.client.transport.endpoints.SimpleEndpoint; +import org.opensearch.client.util.ApiTypeHelper; +import org.opensearch.client.util.CopyableBuilder; +import org.opensearch.client.util.ObjectBuilder; +import org.opensearch.client.util.ToCopyableBuilder; + +// typedef: search_relevance.search_configurations_search.Request + +/** + * Searches for search configurations. + */ +@JsonpDeserializable +@Generated("org.opensearch.client.codegen.CodeGenerator") +public final class SearchConfigurationsSearchRequest extends RequestBase + implements + PlainJsonSerializable, + ToCopyableBuilder { + + @Nullable + private final Integer from; + + @Nullable + private final Query query; + + @Nullable + private final Integer size; + + @Nonnull + private final List sort; + + // --------------------------------------------------------------------------------------------- + + private SearchConfigurationsSearchRequest(Builder builder) { + super(builder); + this.from = builder.from; + this.query = builder.query; + this.size = builder.size; + this.sort = ApiTypeHelper.unmodifiable(builder.sort); + } + + public static SearchConfigurationsSearchRequest of( + Function> fn + ) { + return fn.apply(new Builder()).build(); + } + + /** + * The starting offset for the results. + *

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

+ */ + @Nullable + public final Integer from() { + return this.from; + } + + /** + * API name: {@code query} + */ + @Nullable + public final Query query() { + return this.query; + } + + /** + * The maximum number of results to return. + *

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

+ */ + @Nullable + public final Integer size() { + return this.size; + } + + /** + * The sort order. + *

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

+ */ + @Nonnull + public final List sort() { + return this.sort; + } + + /** + * Serialize this object to JSON. + */ + @Override + public void serialize(JsonGenerator generator, JsonpMapper mapper) { + generator.writeStartObject(); + serializeInternal(generator, mapper); + generator.writeEnd(); + } + + protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { + if (this.from != null) { + generator.writeKey("from"); + generator.write(this.from); + } + + if (this.query != null) { + generator.writeKey("query"); + this.query.serialize(generator, mapper); + } + + if (this.size != null) { + generator.writeKey("size"); + generator.write(this.size); + } + + if (ApiTypeHelper.isDefined(this.sort)) { + generator.writeKey("sort"); + generator.writeStartArray(); + for (SortOptions item0 : this.sort) { + item0.serialize(generator, mapper); + } + generator.writeEnd(); + } + } + + // --------------------------------------------------------------------------------------------- + + @Override + @Nonnull + public Builder toBuilder() { + return new Builder(this); + } + + @Nonnull + public static Builder builder() { + return new Builder(); + } + + /** + * Builder for {@link SearchConfigurationsSearchRequest}. + */ + public static class Builder extends RequestBase.AbstractBuilder + implements + CopyableBuilder { + @Nullable + private Integer from; + @Nullable + private Query query; + @Nullable + private Integer size; + @Nullable + private List sort; + + public Builder() {} + + private Builder(SearchConfigurationsSearchRequest o) { + super(o); + this.from = o.from; + this.query = o.query; + this.size = o.size; + this.sort = _listCopy(o.sort); + } + + private Builder(Builder o) { + super(o); + this.from = o.from; + this.query = o.query; + this.size = o.size; + this.sort = _listCopy(o.sort); + } + + @Override + @Nonnull + public Builder copy() { + return new Builder(this); + } + + @Override + @Nonnull + protected Builder self() { + return this; + } + + /** + * The starting offset for the results. + *

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

+ */ + @Nonnull + public final Builder from(@Nullable Integer value) { + this.from = value; + return this; + } + + /** + * API name: {@code query} + */ + @Nonnull + public final Builder query(@Nullable Query value) { + this.query = value; + return this; + } + + /** + * API name: {@code query} + */ + @Nonnull + public final Builder query(Function> fn) { + return query(fn.apply(new Query.Builder()).build()); + } + + /** + * The maximum number of results to return. + *

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

+ */ + @Nonnull + public final Builder size(@Nullable Integer value) { + this.size = value; + return this; + } + + /** + * The sort order. + *

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

+ * + *

+ * Adds all elements of list to sort. + *

+ */ + @Nonnull + public final Builder sort(List list) { + this.sort = _listAddAll(this.sort, list); + return this; + } + + /** + * The sort order. + *

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

+ * + *

+ * Adds one or more values to sort. + *

+ */ + @Nonnull + public final Builder sort(SortOptions value, SortOptions... values) { + this.sort = _listAdd(this.sort, value, values); + return this; + } + + /** + * The sort order. + *

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

+ * + *

+ * Adds a value to sort using a builder lambda. + *

+ */ + @Nonnull + public final Builder sort(Function> fn) { + return sort(fn.apply(new SortOptions.Builder()).build()); + } + + /** + * Builds a {@link SearchConfigurationsSearchRequest}. + * + * @throws NullPointerException if some of the required fields are null. + */ + @Override + @Nonnull + public SearchConfigurationsSearchRequest build() { + _checkSingleUse(); + + return new SearchConfigurationsSearchRequest(this); + } + } + + // --------------------------------------------------------------------------------------------- + + /** + * Json deserializer for {@link SearchConfigurationsSearchRequest} + */ + public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer.lazy( + Builder::new, + SearchConfigurationsSearchRequest::setupSearchConfigurationsSearchRequestDeserializer + ); + + protected static void setupSearchConfigurationsSearchRequestDeserializer( + ObjectDeserializer op + ) { + op.add(Builder::from, JsonpDeserializer.integerDeserializer(), "from"); + op.add(Builder::query, Query._DESERIALIZER, "query"); + op.add(Builder::size, JsonpDeserializer.integerDeserializer(), "size"); + op.add(Builder::sort, JsonpDeserializer.arrayDeserializer(SortOptions._DESERIALIZER), "sort"); + } + + // --------------------------------------------------------------------------------------------- + + /** + * Endpoint "{@code search_relevance.search_configurations_search}". + */ + public static final SimpleEndpoint _ENDPOINT = new SimpleEndpoint<>( + // Request method + request -> "POST", + // Request path + request -> "/_plugins/_search_relevance/search_configurations/_search", + // Request parameters + request -> { + Map params = new HashMap<>(); + request.applyQueryParameters(params); + return params; + }, + SimpleEndpoint.emptyMap(), + true, + SearchConfigurationsSearchResponse._DESERIALIZER + ); + + /** + * Create an "{@code search_relevance.search_configurations_search}" endpoint. + */ + public static < + TDocument> + Endpoint, ErrorResponse> + createSearchRelevanceSearchConfigurationsSearchEndpoint(JsonpDeserializer tDocumentDeserializer) { + return _ENDPOINT.withResponseDeserializer( + SearchConfigurationsSearchResponse.createSearchConfigurationsSearchResponseDeserializer(tDocumentDeserializer) + ); + } + + @Override + public int hashCode() { + int result = 17; + result = 31 * result + Objects.hashCode(this.from); + result = 31 * result + Objects.hashCode(this.query); + result = 31 * result + Objects.hashCode(this.size); + result = 31 * result + Objects.hashCode(this.sort); + return result; + } + + @Override + public boolean equals(Object o) { + if (this == o) return true; + if (o == null || this.getClass() != o.getClass()) return false; + SearchConfigurationsSearchRequest other = (SearchConfigurationsSearchRequest) o; + return Objects.equals(this.from, other.from) + && Objects.equals(this.query, other.query) + && Objects.equals(this.size, other.size) + && Objects.equals(this.sort, other.sort); + } +} diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/search_relevance/SearchConfigurationsSearchResponse.java b/java-client/src/generated/java/org/opensearch/client/opensearch/search_relevance/SearchConfigurationsSearchResponse.java new file mode 100644 index 0000000000..687b8b0fc0 --- /dev/null +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/search_relevance/SearchConfigurationsSearchResponse.java @@ -0,0 +1,763 @@ +/* + * 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.search_relevance; + +import jakarta.json.stream.JsonGenerator; +import java.util.List; +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.ExternallyTaggedUnion; +import org.opensearch.client.json.JsonData; +import org.opensearch.client.json.JsonpDeserializable; +import org.opensearch.client.json.JsonpDeserializer; +import org.opensearch.client.json.JsonpMapper; +import org.opensearch.client.json.NamedDeserializer; +import org.opensearch.client.json.ObjectBuilderDeserializer; +import org.opensearch.client.json.ObjectDeserializer; +import org.opensearch.client.json.PlainJsonSerializable; +import org.opensearch.client.opensearch._types.ClusterStatistics; +import org.opensearch.client.opensearch._types.PhaseTook; +import org.opensearch.client.opensearch._types.ShardStatistics; +import org.opensearch.client.opensearch._types.aggregations.Aggregate; +import org.opensearch.client.opensearch.core.search.HitsMetadata; +import org.opensearch.client.opensearch.core.search.ProcessorExecutionDetail; +import org.opensearch.client.opensearch.core.search.Profile; +import org.opensearch.client.opensearch.core.search.Suggest; +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: search_relevance.search_configurations_search.Response + +@JsonpDeserializable +@Generated("org.opensearch.client.codegen.CodeGenerator") +public class SearchConfigurationsSearchResponse + implements + PlainJsonSerializable, + ToCopyableBuilder, SearchConfigurationsSearchResponse> { + + @Nonnull + private final Map aggregations; + + @Nullable + private final ClusterStatistics clusters; + + @Nonnull + private final HitsMetadata hits; + + @Nullable + private final Integer numReducePhases; + + @Nullable + private final PhaseTook phaseTook; + + @Nullable + private final String pitId; + + @Nonnull + private final List processorResults; + + @Nullable + private final Profile profile; + + @Nullable + private final String scrollId; + + @Nonnull + private final ShardStatistics shards; + + @Nonnull + private final Map>> suggest; + + @Nullable + private final Boolean terminatedEarly; + + private final boolean timedOut; + + private final long took; + + // --------------------------------------------------------------------------------------------- + + private SearchConfigurationsSearchResponse(Builder builder) { + this.aggregations = ApiTypeHelper.unmodifiable(builder.aggregations); + this.clusters = builder.clusters; + this.hits = ApiTypeHelper.requireNonNull(builder.hits, this, "hits"); + this.numReducePhases = builder.numReducePhases; + this.phaseTook = builder.phaseTook; + this.pitId = builder.pitId; + this.processorResults = ApiTypeHelper.unmodifiable(builder.processorResults); + this.profile = builder.profile; + this.scrollId = builder.scrollId; + this.shards = ApiTypeHelper.requireNonNull(builder.shards, this, "shards"); + this.suggest = ApiTypeHelper.unmodifiable(builder.suggest); + this.terminatedEarly = builder.terminatedEarly; + this.timedOut = ApiTypeHelper.requireNonNull(builder.timedOut, this, "timedOut"); + this.took = ApiTypeHelper.requireNonNull(builder.took, this, "took"); + } + + public static SearchConfigurationsSearchResponse of( + Function, ObjectBuilder>> fn + ) { + return fn.apply(new Builder<>()).build(); + } + + /** + * API name: {@code aggregations} + */ + @Nonnull + public final Map aggregations() { + return this.aggregations; + } + + /** + * API name: {@code _clusters} + */ + @Nullable + public final ClusterStatistics clusters() { + return this.clusters; + } + + /** + * Required - API name: {@code hits} + */ + @Nonnull + public final HitsMetadata hits() { + return this.hits; + } + + /** + * API name: {@code num_reduce_phases} + */ + @Nullable + public final Integer numReducePhases() { + return this.numReducePhases; + } + + /** + * API name: {@code phase_took} + */ + @Nullable + public final PhaseTook phaseTook() { + return this.phaseTook; + } + + /** + * API name: {@code pit_id} + */ + @Nullable + public final String pitId() { + return this.pitId; + } + + /** + * API name: {@code processor_results} + */ + @Nonnull + public final List processorResults() { + return this.processorResults; + } + + /** + * API name: {@code profile} + */ + @Nullable + public final Profile profile() { + return this.profile; + } + + /** + * API name: {@code _scroll_id} + */ + @Nullable + public final String scrollId() { + return this.scrollId; + } + + /** + * Required - API name: {@code _shards} + */ + @Nonnull + public final ShardStatistics shards() { + return this.shards; + } + + /** + * API name: {@code suggest} + */ + @Nonnull + public final Map>> suggest() { + return this.suggest; + } + + /** + * API name: {@code terminated_early} + */ + @Nullable + public final Boolean terminatedEarly() { + return this.terminatedEarly; + } + + /** + * Required - API name: {@code timed_out} + */ + public final boolean timedOut() { + return this.timedOut; + } + + /** + * Required - API name: {@code took} + */ + public final long took() { + return this.took; + } + + /** + * 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.aggregations)) { + generator.writeKey("aggregations"); + ExternallyTaggedUnion.serializeTypedKeys(this.aggregations, generator, mapper); + } + + if (this.clusters != null) { + generator.writeKey("_clusters"); + this.clusters.serialize(generator, mapper); + } + + generator.writeKey("hits"); + this.hits.serialize(generator, mapper); + + if (this.numReducePhases != null) { + generator.writeKey("num_reduce_phases"); + generator.write(this.numReducePhases); + } + + if (this.phaseTook != null) { + generator.writeKey("phase_took"); + this.phaseTook.serialize(generator, mapper); + } + + if (this.pitId != null) { + generator.writeKey("pit_id"); + generator.write(this.pitId); + } + + if (ApiTypeHelper.isDefined(this.processorResults)) { + generator.writeKey("processor_results"); + generator.writeStartArray(); + for (ProcessorExecutionDetail item0 : this.processorResults) { + item0.serialize(generator, mapper); + } + generator.writeEnd(); + } + + if (this.profile != null) { + generator.writeKey("profile"); + this.profile.serialize(generator, mapper); + } + + if (this.scrollId != null) { + generator.writeKey("_scroll_id"); + generator.write(this.scrollId); + } + + generator.writeKey("_shards"); + this.shards.serialize(generator, mapper); + + if (ApiTypeHelper.isDefined(this.suggest)) { + generator.writeKey("suggest"); + ExternallyTaggedUnion.serializeTypedKeysArray(this.suggest, generator, mapper); + } + + if (this.terminatedEarly != null) { + generator.writeKey("terminated_early"); + generator.write(this.terminatedEarly); + } + + generator.writeKey("timed_out"); + generator.write(this.timedOut); + + generator.writeKey("took"); + generator.write(this.took); + } + + // --------------------------------------------------------------------------------------------- + + @Override + @Nonnull + public Builder toBuilder() { + return new Builder<>(this); + } + + @Nonnull + public static Builder builder() { + return new Builder<>(); + } + + /** + * Builder for {@link SearchConfigurationsSearchResponse}. + */ + public static class Builder extends ObjectBuilderBase + implements + CopyableBuilder, SearchConfigurationsSearchResponse> { + @Nullable + private Map aggregations; + @Nullable + private ClusterStatistics clusters; + private HitsMetadata hits; + @Nullable + private Integer numReducePhases; + @Nullable + private PhaseTook phaseTook; + @Nullable + private String pitId; + @Nullable + private List processorResults; + @Nullable + private Profile profile; + @Nullable + private String scrollId; + private ShardStatistics shards; + @Nullable + private Map>> suggest; + @Nullable + private Boolean terminatedEarly; + private Boolean timedOut; + private Long took; + + public Builder() {} + + private Builder(SearchConfigurationsSearchResponse o) { + this.aggregations = _mapCopy(o.aggregations); + this.clusters = o.clusters; + this.hits = o.hits; + this.numReducePhases = o.numReducePhases; + this.phaseTook = o.phaseTook; + this.pitId = o.pitId; + this.processorResults = _listCopy(o.processorResults); + this.profile = o.profile; + this.scrollId = o.scrollId; + this.shards = o.shards; + this.suggest = _mapCopy(o.suggest); + this.terminatedEarly = o.terminatedEarly; + this.timedOut = o.timedOut; + this.took = o.took; + } + + private Builder(Builder o) { + this.aggregations = _mapCopy(o.aggregations); + this.clusters = o.clusters; + this.hits = o.hits; + this.numReducePhases = o.numReducePhases; + this.phaseTook = o.phaseTook; + this.pitId = o.pitId; + this.processorResults = _listCopy(o.processorResults); + this.profile = o.profile; + this.scrollId = o.scrollId; + this.shards = o.shards; + this.suggest = _mapCopy(o.suggest); + this.terminatedEarly = o.terminatedEarly; + this.timedOut = o.timedOut; + this.took = o.took; + } + + @Override + @Nonnull + public Builder copy() { + return new Builder<>(this); + } + + /** + * API name: {@code aggregations} + * + *

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

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

+ * Adds an entry to aggregations. + *

+ */ + @Nonnull + public final Builder aggregations(String key, Aggregate value) { + this.aggregations = _mapPut(this.aggregations, key, value); + return this; + } + + /** + * API name: {@code aggregations} + * + *

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

+ */ + @Nonnull + public final Builder aggregations(String key, Function> fn) { + return aggregations(key, fn.apply(new Aggregate.Builder()).build()); + } + + /** + * API name: {@code _clusters} + */ + @Nonnull + public final Builder clusters(@Nullable ClusterStatistics value) { + this.clusters = value; + return this; + } + + /** + * API name: {@code _clusters} + */ + @Nonnull + public final Builder clusters(Function> fn) { + return clusters(fn.apply(new ClusterStatistics.Builder()).build()); + } + + /** + * Required - API name: {@code hits} + */ + @Nonnull + public final Builder hits(HitsMetadata value) { + this.hits = value; + return this; + } + + /** + * Required - API name: {@code hits} + */ + @Nonnull + public final Builder hits(Function, ObjectBuilder>> fn) { + return hits(fn.apply(new HitsMetadata.Builder()).build()); + } + + /** + * API name: {@code num_reduce_phases} + */ + @Nonnull + public final Builder numReducePhases(@Nullable Integer value) { + this.numReducePhases = value; + return this; + } + + /** + * API name: {@code phase_took} + */ + @Nonnull + public final Builder phaseTook(@Nullable PhaseTook value) { + this.phaseTook = value; + return this; + } + + /** + * API name: {@code phase_took} + */ + @Nonnull + public final Builder phaseTook(Function> fn) { + return phaseTook(fn.apply(new PhaseTook.Builder()).build()); + } + + /** + * API name: {@code pit_id} + */ + @Nonnull + public final Builder pitId(@Nullable String value) { + this.pitId = value; + return this; + } + + /** + * API name: {@code processor_results} + * + *

+ * Adds all elements of list to processorResults. + *

+ */ + @Nonnull + public final Builder processorResults(List list) { + this.processorResults = _listAddAll(this.processorResults, list); + return this; + } + + /** + * API name: {@code processor_results} + * + *

+ * Adds one or more values to processorResults. + *

+ */ + @Nonnull + public final Builder processorResults(ProcessorExecutionDetail value, ProcessorExecutionDetail... values) { + this.processorResults = _listAdd(this.processorResults, value, values); + return this; + } + + /** + * API name: {@code processor_results} + * + *

+ * Adds a value to processorResults using a builder lambda. + *

+ */ + @Nonnull + public final Builder processorResults( + Function> fn + ) { + return processorResults(fn.apply(new ProcessorExecutionDetail.Builder()).build()); + } + + /** + * API name: {@code profile} + */ + @Nonnull + public final Builder profile(@Nullable Profile value) { + this.profile = value; + return this; + } + + /** + * API name: {@code profile} + */ + @Nonnull + public final Builder profile(Function> fn) { + return profile(fn.apply(new Profile.Builder()).build()); + } + + /** + * API name: {@code _scroll_id} + */ + @Nonnull + public final Builder scrollId(@Nullable String value) { + this.scrollId = value; + return this; + } + + /** + * Required - API name: {@code _shards} + */ + @Nonnull + public final Builder shards(ShardStatistics value) { + this.shards = value; + return this; + } + + /** + * Required - API name: {@code _shards} + */ + @Nonnull + public final Builder shards(Function> fn) { + return shards(fn.apply(new ShardStatistics.Builder()).build()); + } + + /** + * API name: {@code suggest} + * + *

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

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

+ * Adds an entry to suggest. + *

+ */ + @Nonnull + public final Builder suggest(String key, List> value) { + this.suggest = _mapPut(this.suggest, key, value); + return this; + } + + /** + * API name: {@code terminated_early} + */ + @Nonnull + public final Builder terminatedEarly(@Nullable Boolean value) { + this.terminatedEarly = value; + return this; + } + + /** + * Required - API name: {@code timed_out} + */ + @Nonnull + public final Builder timedOut(boolean value) { + this.timedOut = value; + return this; + } + + /** + * Required - API name: {@code took} + */ + @Nonnull + public final Builder took(long value) { + this.took = value; + return this; + } + + /** + * Builds a {@link SearchConfigurationsSearchResponse}. + * + * @throws NullPointerException if some of the required fields are null. + */ + @Override + @Nonnull + public SearchConfigurationsSearchResponse build() { + _checkSingleUse(); + + return new SearchConfigurationsSearchResponse<>(this); + } + } + + // --------------------------------------------------------------------------------------------- + + /** + * Create a JSON deserializer for SearchConfigurationsSearchResponse. + */ + public static < + TDocument> JsonpDeserializer> createSearchConfigurationsSearchResponseDeserializer( + JsonpDeserializer tDocumentDeserializer + ) { + return ObjectBuilderDeserializer.createForObject( + Builder::new, + op -> SearchConfigurationsSearchResponse.setupSearchConfigurationsSearchResponseDeserializer(op, tDocumentDeserializer) + ); + } + + /** + * Json deserializer for {@link SearchConfigurationsSearchResponse} based on named deserializers provided by the calling + * {@code JsonMapper}. + */ + public static final JsonpDeserializer> _DESERIALIZER = + createSearchConfigurationsSearchResponseDeserializer( + new NamedDeserializer<>("org.opensearch.client:Deserializer:search_relevance.search_configurations_search.TDocument") + ); + + protected static void setupSearchConfigurationsSearchResponseDeserializer( + ObjectDeserializer> op, + JsonpDeserializer tDocumentDeserializer + ) { + op.add(Builder::aggregations, Aggregate._TYPED_KEYS_DESERIALIZER, "aggregations"); + op.add(Builder::clusters, ClusterStatistics._DESERIALIZER, "_clusters"); + op.add(Builder::hits, HitsMetadata.createHitsMetadataDeserializer(tDocumentDeserializer), "hits"); + op.add(Builder::numReducePhases, JsonpDeserializer.integerDeserializer(), "num_reduce_phases"); + op.add(Builder::phaseTook, PhaseTook._DESERIALIZER, "phase_took"); + op.add(Builder::pitId, JsonpDeserializer.stringDeserializer(), "pit_id"); + op.add(Builder::processorResults, JsonpDeserializer.arrayDeserializer(ProcessorExecutionDetail._DESERIALIZER), "processor_results"); + op.add(Builder::profile, Profile._DESERIALIZER, "profile"); + op.add(Builder::scrollId, JsonpDeserializer.stringDeserializer(), "_scroll_id"); + op.add(Builder::shards, ShardStatistics._DESERIALIZER, "_shards"); + op.add( + Builder::suggest, + ExternallyTaggedUnion.arrayDeserializer(Suggest.createSuggestDeserializer(JsonData._DESERIALIZER)), + "suggest" + ); + op.add(Builder::terminatedEarly, JsonpDeserializer.booleanDeserializer(), "terminated_early"); + op.add(Builder::timedOut, JsonpDeserializer.booleanDeserializer(), "timed_out"); + op.add(Builder::took, JsonpDeserializer.longDeserializer(), "took"); + } + + @Override + public int hashCode() { + int result = 17; + result = 31 * result + Objects.hashCode(this.aggregations); + result = 31 * result + Objects.hashCode(this.clusters); + result = 31 * result + this.hits.hashCode(); + result = 31 * result + Objects.hashCode(this.numReducePhases); + result = 31 * result + Objects.hashCode(this.phaseTook); + result = 31 * result + Objects.hashCode(this.pitId); + result = 31 * result + Objects.hashCode(this.processorResults); + result = 31 * result + Objects.hashCode(this.profile); + result = 31 * result + Objects.hashCode(this.scrollId); + result = 31 * result + this.shards.hashCode(); + result = 31 * result + Objects.hashCode(this.suggest); + result = 31 * result + Objects.hashCode(this.terminatedEarly); + result = 31 * result + Boolean.hashCode(this.timedOut); + result = 31 * result + Long.hashCode(this.took); + return result; + } + + @Override + public boolean equals(Object o) { + if (this == o) return true; + if (o == null || this.getClass() != o.getClass()) return false; + SearchConfigurationsSearchResponse other = (SearchConfigurationsSearchResponse) o; + return Objects.equals(this.aggregations, other.aggregations) + && Objects.equals(this.clusters, other.clusters) + && this.hits.equals(other.hits) + && Objects.equals(this.numReducePhases, other.numReducePhases) + && Objects.equals(this.phaseTook, other.phaseTook) + && Objects.equals(this.pitId, other.pitId) + && Objects.equals(this.processorResults, other.processorResults) + && Objects.equals(this.profile, other.profile) + && Objects.equals(this.scrollId, other.scrollId) + && this.shards.equals(other.shards) + && Objects.equals(this.suggest, other.suggest) + && Objects.equals(this.terminatedEarly, other.terminatedEarly) + && this.timedOut == other.timedOut + && this.took == other.took; + } +} diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/snapshot/CleanupRepositoryRequest.java b/java-client/src/generated/java/org/opensearch/client/opensearch/snapshot/CleanupRepositoryRequest.java index eeaf90253b..b9e5b8a47a 100644 --- a/java-client/src/generated/java/org/opensearch/client/opensearch/snapshot/CleanupRepositoryRequest.java +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/snapshot/CleanupRepositoryRequest.java @@ -92,7 +92,7 @@ public static CleanupRepositoryRequest of(FunctionCommon parameters. + * Common parameters. *

* API name: {@code cluster_manager_timeout} *

@@ -193,7 +193,7 @@ protected Builder self() { /** * The amount of time to wait for a response from the cluster manager node. For more information about supported time units, see - * Common parameters. + * Common parameters. *

* API name: {@code cluster_manager_timeout} *

@@ -206,7 +206,7 @@ public final Builder clusterManagerTimeout(@Nullable Time value) { /** * The amount of time to wait for a response from the cluster manager node. For more information about supported time units, see - * Common parameters. + * Common parameters. *

* API name: {@code cluster_manager_timeout} *

diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/snapshot/CloneSnapshotRequest.java b/java-client/src/generated/java/org/opensearch/client/opensearch/snapshot/CloneSnapshotRequest.java index 1211573ccb..2c1641f9fd 100644 --- a/java-client/src/generated/java/org/opensearch/client/opensearch/snapshot/CloneSnapshotRequest.java +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/snapshot/CloneSnapshotRequest.java @@ -109,7 +109,7 @@ public static CloneSnapshotRequest of(FunctionCommon parameters. + * Common parameters. *

* API name: {@code cluster_manager_timeout} *

@@ -249,7 +249,7 @@ protected Builder self() { /** * The amount of time to wait for a response from the cluster manager node. For more information about supported time units, see - * Common parameters. + * Common parameters. *

* API name: {@code cluster_manager_timeout} *

@@ -262,7 +262,7 @@ public final Builder clusterManagerTimeout(@Nullable Time value) { /** * The amount of time to wait for a response from the cluster manager node. For more information about supported time units, see - * Common parameters. + * Common parameters. *

* API name: {@code cluster_manager_timeout} *

diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/snapshot/CreateRepositoryRequest.java b/java-client/src/generated/java/org/opensearch/client/opensearch/snapshot/CreateRepositoryRequest.java index 3ec3956e10..9630b268c0 100644 --- a/java-client/src/generated/java/org/opensearch/client/opensearch/snapshot/CreateRepositoryRequest.java +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/snapshot/CreateRepositoryRequest.java @@ -117,7 +117,7 @@ public static CreateRepositoryRequest of(FunctionCommon parameters. + * Common parameters. *

* API name: {@code cluster_manager_timeout} *

@@ -290,7 +290,7 @@ protected Builder self() { /** * The amount of time to wait for a response from the cluster manager node. For more information about supported time units, see - * Common parameters. + * Common parameters. *

* API name: {@code cluster_manager_timeout} *

@@ -303,7 +303,7 @@ public final Builder clusterManagerTimeout(@Nullable Time value) { /** * The amount of time to wait for a response from the cluster manager node. For more information about supported time units, see - * Common parameters. + * Common parameters. *

* API name: {@code cluster_manager_timeout} *

diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/snapshot/CreateSnapshotRequest.java b/java-client/src/generated/java/org/opensearch/client/opensearch/snapshot/CreateSnapshotRequest.java index 4a91c5dee4..4309943958 100644 --- a/java-client/src/generated/java/org/opensearch/client/opensearch/snapshot/CreateSnapshotRequest.java +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/snapshot/CreateSnapshotRequest.java @@ -131,7 +131,7 @@ public static CreateSnapshotRequest of(FunctionCommon parameters. + * Common parameters. *

* API name: {@code cluster_manager_timeout} *

@@ -395,7 +395,7 @@ protected Builder self() { /** * The amount of time to wait for a response from the cluster manager node. For more information about supported time units, see - * Common parameters. + * Common parameters. *

* API name: {@code cluster_manager_timeout} *

@@ -408,7 +408,7 @@ public final Builder clusterManagerTimeout(@Nullable Time value) { /** * The amount of time to wait for a response from the cluster manager node. For more information about supported time units, see - * Common parameters. + * Common parameters. *

* API name: {@code cluster_manager_timeout} *

diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/snapshot/DeleteRepositoryRequest.java b/java-client/src/generated/java/org/opensearch/client/opensearch/snapshot/DeleteRepositoryRequest.java index 3c3bc2b3f8..7e4f915dca 100644 --- a/java-client/src/generated/java/org/opensearch/client/opensearch/snapshot/DeleteRepositoryRequest.java +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/snapshot/DeleteRepositoryRequest.java @@ -93,7 +93,7 @@ public static DeleteRepositoryRequest of(FunctionCommon parameters. + * Common parameters. *

* API name: {@code cluster_manager_timeout} *

@@ -194,7 +194,7 @@ protected Builder self() { /** * The amount of time to wait for a response from the cluster manager node. For more information about supported time units, see - * Common parameters. + * Common parameters. *

* API name: {@code cluster_manager_timeout} *

@@ -207,7 +207,7 @@ public final Builder clusterManagerTimeout(@Nullable Time value) { /** * The amount of time to wait for a response from the cluster manager node. For more information about supported time units, see - * Common parameters. + * Common parameters. *

* API name: {@code cluster_manager_timeout} *

diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/snapshot/DeleteSnapshotRequest.java b/java-client/src/generated/java/org/opensearch/client/opensearch/snapshot/DeleteSnapshotRequest.java index ba00524d8a..8a65ab8967 100644 --- a/java-client/src/generated/java/org/opensearch/client/opensearch/snapshot/DeleteSnapshotRequest.java +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/snapshot/DeleteSnapshotRequest.java @@ -92,7 +92,7 @@ public static DeleteSnapshotRequest of(FunctionCommon parameters. + * Common parameters. *

* API name: {@code cluster_manager_timeout} *

@@ -192,7 +192,7 @@ protected Builder self() { /** * The amount of time to wait for a response from the cluster manager node. For more information about supported time units, see - * Common parameters. + * Common parameters. *

* API name: {@code cluster_manager_timeout} *

@@ -205,7 +205,7 @@ public final Builder clusterManagerTimeout(@Nullable Time value) { /** * The amount of time to wait for a response from the cluster manager node. For more information about supported time units, see - * Common parameters. + * Common parameters. *

* API name: {@code cluster_manager_timeout} *

diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/snapshot/GetRepositoryRequest.java b/java-client/src/generated/java/org/opensearch/client/opensearch/snapshot/GetRepositoryRequest.java index c064d11eed..0a1b1fd08d 100644 --- a/java-client/src/generated/java/org/opensearch/client/opensearch/snapshot/GetRepositoryRequest.java +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/snapshot/GetRepositoryRequest.java @@ -93,7 +93,7 @@ public static GetRepositoryRequest of(FunctionCommon parameters. + * Common parameters. *

* API name: {@code cluster_manager_timeout} *

@@ -195,7 +195,7 @@ protected Builder self() { /** * The amount of time to wait for a response from the cluster manager node. For more information about supported time units, see - * Common parameters. + * Common parameters. *

* API name: {@code cluster_manager_timeout} *

@@ -208,7 +208,7 @@ public final Builder clusterManagerTimeout(@Nullable Time value) { /** * The amount of time to wait for a response from the cluster manager node. For more information about supported time units, see - * Common parameters. + * Common parameters. *

* API name: {@code cluster_manager_timeout} *

diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/snapshot/GetSnapshotRequest.java b/java-client/src/generated/java/org/opensearch/client/opensearch/snapshot/GetSnapshotRequest.java index af47f9ba03..ee1be75adb 100644 --- a/java-client/src/generated/java/org/opensearch/client/opensearch/snapshot/GetSnapshotRequest.java +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/snapshot/GetSnapshotRequest.java @@ -99,7 +99,7 @@ public static GetSnapshotRequest of(FunctionCommon parameters. + * Common parameters. *

* API name: {@code cluster_manager_timeout} *

@@ -240,7 +240,7 @@ protected Builder self() { /** * The amount of time to wait for a response from the cluster manager node. For more information about supported time units, see - * Common parameters. + * Common parameters. *

* API name: {@code cluster_manager_timeout} *

@@ -253,7 +253,7 @@ public final Builder clusterManagerTimeout(@Nullable Time value) { /** * The amount of time to wait for a response from the cluster manager node. For more information about supported time units, see - * Common parameters. + * Common parameters. *

* API name: {@code cluster_manager_timeout} *

diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/snapshot/RestoreSnapshotRequest.java b/java-client/src/generated/java/org/opensearch/client/opensearch/snapshot/RestoreSnapshotRequest.java index 67d52dcf06..f39ce4d1ed 100644 --- a/java-client/src/generated/java/org/opensearch/client/opensearch/snapshot/RestoreSnapshotRequest.java +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/snapshot/RestoreSnapshotRequest.java @@ -159,7 +159,7 @@ public static RestoreSnapshotRequest of(FunctionCommon parameters. + * Common parameters. *

* API name: {@code cluster_manager_timeout} *

@@ -575,7 +575,7 @@ protected Builder self() { /** * The amount of time to wait for a response from the cluster manager node. For more information about supported time units, see - * Common parameters. + * Common parameters. *

* API name: {@code cluster_manager_timeout} *

@@ -588,7 +588,7 @@ public final Builder clusterManagerTimeout(@Nullable Time value) { /** * The amount of time to wait for a response from the cluster manager node. For more information about supported time units, see - * Common parameters. + * Common parameters. *

* API name: {@code cluster_manager_timeout} *

diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/snapshot/SnapshotStatusRequest.java b/java-client/src/generated/java/org/opensearch/client/opensearch/snapshot/SnapshotStatusRequest.java index 315f01f80f..74820fc459 100644 --- a/java-client/src/generated/java/org/opensearch/client/opensearch/snapshot/SnapshotStatusRequest.java +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/snapshot/SnapshotStatusRequest.java @@ -97,7 +97,7 @@ public static SnapshotStatusRequest of(FunctionCommon parameters. + * Common parameters. *

* API name: {@code cluster_manager_timeout} *

@@ -214,7 +214,7 @@ protected Builder self() { /** * The amount of time to wait for a response from the cluster manager node. For more information about supported time units, see - * Common parameters. + * Common parameters. *

* API name: {@code cluster_manager_timeout} *

@@ -227,7 +227,7 @@ public final Builder clusterManagerTimeout(@Nullable Time value) { /** * The amount of time to wait for a response from the cluster manager node. For more information about supported time units, see - * Common parameters. + * Common parameters. *

* API name: {@code cluster_manager_timeout} *

diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/snapshot/VerifyRepositoryRequest.java b/java-client/src/generated/java/org/opensearch/client/opensearch/snapshot/VerifyRepositoryRequest.java index 2e7a3a8087..7d26df9a5c 100644 --- a/java-client/src/generated/java/org/opensearch/client/opensearch/snapshot/VerifyRepositoryRequest.java +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/snapshot/VerifyRepositoryRequest.java @@ -92,7 +92,7 @@ public static VerifyRepositoryRequest of(FunctionCommon parameters. + * Common parameters. *

* API name: {@code cluster_manager_timeout} *

@@ -193,7 +193,7 @@ protected Builder self() { /** * The amount of time to wait for a response from the cluster manager node. For more information about supported time units, see - * Common parameters. + * Common parameters. *

* API name: {@code cluster_manager_timeout} *

@@ -206,7 +206,7 @@ public final Builder clusterManagerTimeout(@Nullable Time value) { /** * The amount of time to wait for a response from the cluster manager node. For more information about supported time units, see - * Common parameters. + * Common parameters. *

* API name: {@code cluster_manager_timeout} *

diff --git a/java-client/src/main/java/org/opensearch/client/json/JsonData.java b/java-client/src/main/java/org/opensearch/client/json/JsonData.java index ad907650bb..b3cb61dc5c 100644 --- a/java-client/src/main/java/org/opensearch/client/json/JsonData.java +++ b/java-client/src/main/java/org/opensearch/client/json/JsonData.java @@ -108,5 +108,7 @@ static JsonData from(JsonParser parser, JsonpMapper mapper) { return of(parser.getValue(), mapper); } - JsonpDeserializer _DESERIALIZER = JsonpDeserializer.of(EnumSet.allOf(JsonParser.Event.class), JsonData::from); + JsonpDeserializer _DESERIALIZER = JsonpDeserializer.of(EnumSet.allOf(JsonParser.Event.class), (parser, mapper, event) -> { + return of(parser.getValue(), mapper); + }); } diff --git a/java-client/src/test/java/org/opensearch/client/opensearch/_types/query_dsl/TermsLookupTest.java b/java-client/src/test/java/org/opensearch/client/opensearch/_types/query_dsl/TermsLookupTest.java index 80f3e0aae3..0b57a41ed0 100644 --- a/java-client/src/test/java/org/opensearch/client/opensearch/_types/query_dsl/TermsLookupTest.java +++ b/java-client/src/test/java/org/opensearch/client/opensearch/_types/query_dsl/TermsLookupTest.java @@ -14,7 +14,7 @@ public class TermsLookupTest extends ModelTestCase { @Test public void toBuilder() { - TermsLookup origin = new TermsLookup.Builder().id("id").index("index").path("path").build(); + TermsLookup origin = new TermsLookup.Builder().id("id").build(); TermsLookup copied = origin.toBuilder().build(); assertEquals(toJson(copied), toJson(origin)); diff --git a/java-client/src/test/java/org/opensearch/client/opensearch/model/ClassStructureTest.java b/java-client/src/test/java/org/opensearch/client/opensearch/model/ClassStructureTest.java index 06f25be997..d459138498 100644 --- a/java-client/src/test/java/org/opensearch/client/opensearch/model/ClassStructureTest.java +++ b/java-client/src/test/java/org/opensearch/client/opensearch/model/ClassStructureTest.java @@ -126,9 +126,8 @@ public void testDataClassInheritedFieldAssignment() { .buckets(Buckets.of(b -> b.array(Collections.singletonList(RangeBucket.of(_2 -> _2.docCount(1)))))) ); - assertAncestorCount(3, date); - assertEquals("bar", date.meta().get("foo").to(String.class)); - assertEquals("{\"meta\":{\"foo\":\"bar\"},\"buckets\":[{\"doc_count\":1}]}", toJson(date)); + assertEquals("bar", date.meta().get("foo").toString()); + assertEquals("{\"buckets\":[{\"doc_count\":1}],\"meta\":{\"foo\":\"bar\"}}", toJson(date)); } } @@ -236,14 +235,14 @@ public void testMapSetters() { ValueCountAggregation countC = ValueCountAggregation.of(v -> v.field("c")); Map aggs = new HashMap<>(); - aggs.put("aggA", countA.toAggregation()); - aggs.put("aggB", countB.toAggregation()); + aggs.put("aggA", Aggregation.builder().valueCount(countA).build()); + aggs.put("aggB", Aggregation.builder().valueCount(countB).build()); { // Appending doesn't modify the original collection SearchRequest search = SearchRequest.of( b -> b.aggregations(aggs) - .aggregations("aggC", countC.toAggregation()) + .aggregations("aggC", Aggregation.builder().valueCount(countC).build()) .aggregations("aggD", a -> a.valueCount(c -> c.field("d"))) ); @@ -275,7 +274,7 @@ public void testDataClassesSingleBuilderUse() { checkSingleBuilderUse(2, new CardinalityAggregate.Builder().value(0)); // 3 ancestors + ObjectBuilderBase - checkSingleBuilderUse(4, new DateRangeAggregate.Builder().buckets(Buckets.of(b -> b.array(Collections.emptyList())))); + checkSingleBuilderUse(1, new DateRangeAggregate.Builder().buckets(Buckets.of(b -> b.array(Collections.emptyList())))); } @Test diff --git a/java-client/src/test/java/org/opensearch/client/opensearch/model/TypedKeysTest.java b/java-client/src/test/java/org/opensearch/client/opensearch/model/TypedKeysTest.java index e3422897ac..9d5615b7bd 100644 --- a/java-client/src/test/java/org/opensearch/client/opensearch/model/TypedKeysTest.java +++ b/java-client/src/test/java/org/opensearch/client/opensearch/model/TypedKeysTest.java @@ -34,17 +34,18 @@ import com.fasterxml.jackson.databind.node.ObjectNode; import java.util.ArrayList; +import java.util.Arrays; import java.util.Collections; import org.junit.Test; +import org.opensearch.client.json.JsonData; import org.opensearch.client.json.JsonpDeserializer; import org.opensearch.client.json.JsonpMapperAttributes; import org.opensearch.client.opensearch._types.aggregations.Aggregate; import org.opensearch.client.opensearch._types.aggregations.AvgAggregate; +import org.opensearch.client.opensearch._types.aggregations.StringRareTermsBucket; import org.opensearch.client.opensearch._types.aggregations.StringTermsAggregate; -import org.opensearch.client.opensearch._types.aggregations.StringTermsBucket; import org.opensearch.client.opensearch.core.SearchResponse; import org.opensearch.client.opensearch.core.search.TotalHitsRelation; -import org.opensearch.client.util.ListBuilder; import org.opensearch.client.util.MapBuilder; public class TypedKeysTest extends ModelTestCase { @@ -82,15 +83,19 @@ public void testAdditionalProperties() { _0 -> _0.sumOtherDocCount(1L) .buckets( b -> b.array( - ListBuilder.of(StringTermsBucket.Builder::new) - .add(_1 -> _1.key("key_1").docCount(1).aggregations(MapBuilder.of("bar", avg1))) - .add(_1 -> _1.key("key_2").docCount(2).aggregations(MapBuilder.of("bar", avg2))) - .build() + Arrays.asList( + JsonData.of( + StringRareTermsBucket.builder().key("key_1").docCount(1).aggregations(MapBuilder.of("bar", avg1)).build() + ), + JsonData.of( + StringRareTermsBucket.builder().key("key_2").docCount(2).aggregations(MapBuilder.of("bar", avg2)).build() + ) + ) ) ) ).toAggregate(); - SearchResponse resp = new SearchResponse.Builder().aggregations("foo", aggregate) + SearchResponse resp = new SearchResponse.Builder().aggregations("foo", aggregate) // Required properties on a SearchResponse .took(1) .shards(_1 -> _1.successful(1).failed(0).total(1)) @@ -112,11 +117,11 @@ public void testAdditionalProperties() { StringTermsAggregate foo = resp.aggregations().get("foo").sterms(); assertEquals((Long) 1L, foo.sumOtherDocCount()); - assertEquals(1, foo.buckets().array().get(0).docCount()); - assertEquals("key_1", foo.buckets().array().get(0).key()); - assertEquals(1.0, foo.buckets().array().get(0).aggregations().get("bar").avg().value(), 0.01); - assertEquals("key_2", foo.buckets().array().get(1).key()); - assertEquals(2.0, foo.buckets().array().get(1).aggregations().get("bar").avg().value(), 0.01); + assertEquals(1, foo.buckets().array().get(0).to(StringRareTermsBucket.class).docCount()); + assertEquals("key_1", foo.buckets().array().get(0).to(StringRareTermsBucket.class).key()); + assertEquals(1.0, foo.buckets().array().get(0).to(StringRareTermsBucket.class).aggregations().get("bar").avg().value(), 0.01); + assertEquals("key_2", foo.buckets().array().get(1).to(StringRareTermsBucket.class).key()); + assertEquals(2.0, foo.buckets().array().get(1).to(StringRareTermsBucket.class).aggregations().get("bar").avg().value(), 0.01); } @Test diff --git a/java-client/src/test/java11/org/opensearch/client/opensearch/integTest/AbstractAggregationRequestIT.java b/java-client/src/test/java11/org/opensearch/client/opensearch/integTest/AbstractAggregationRequestIT.java index adbc595e81..3c8599032b 100644 --- a/java-client/src/test/java11/org/opensearch/client/opensearch/integTest/AbstractAggregationRequestIT.java +++ b/java-client/src/test/java11/org/opensearch/client/opensearch/integTest/AbstractAggregationRequestIT.java @@ -19,12 +19,12 @@ import org.opensearch.client.opensearch._types.Refresh; import org.opensearch.client.opensearch._types.aggregations.Aggregation; import org.opensearch.client.opensearch._types.aggregations.AggregationRange; -import org.opensearch.client.opensearch._types.aggregations.DateRangeAggregation; +import org.opensearch.client.opensearch._types.aggregations.DateRangeAggregationFields; import org.opensearch.client.opensearch._types.aggregations.DateRangeExpression; import org.opensearch.client.opensearch._types.aggregations.FieldDateMath; import org.opensearch.client.opensearch._types.aggregations.MultiTermLookup; -import org.opensearch.client.opensearch._types.aggregations.MultiTermsAggregation; -import org.opensearch.client.opensearch._types.aggregations.RangeAggregation; +import org.opensearch.client.opensearch._types.aggregations.MultiTermsAggregationFields; +import org.opensearch.client.opensearch._types.aggregations.RangeAggregationFields; import org.opensearch.client.opensearch._types.mapping.Property; import org.opensearch.client.opensearch.core.SearchResponse; @@ -105,21 +105,21 @@ private void checkIfOpenSearchSupportsMultiTermsAggregation() throws Exception { } private Aggregation getExpiryDateRangeAggregation() { - DateRangeAggregation expiryDateRangeAggregation = new DateRangeAggregation.Builder().field("expDate") + DateRangeAggregationFields expiryDateRangeAggregation = new DateRangeAggregationFields.Builder().field("expDate") .ranges(getDateAggregationRanges()) .build(); return new Aggregation.Builder().dateRange(expiryDateRangeAggregation).build(); } private Aggregation getCostValueRangeAggregation() { - RangeAggregation costValueRangeAggregation = new RangeAggregation.Builder().field("cost") + RangeAggregationFields costValueRangeAggregation = new RangeAggregationFields.Builder().field("cost") .ranges(getValueAggregationRanges()) .build(); return new Aggregation.Builder().range(costValueRangeAggregation).build(); } private Aggregation getMultiTermsAggregation(Integer size) { - MultiTermsAggregation.Builder multiTermsAggregationBuilder = new MultiTermsAggregation.Builder().terms( + MultiTermsAggregationFields.Builder multiTermsAggregationBuilder = new MultiTermsAggregationFields.Builder().terms( List.of( MultiTermLookup.of(multiTermLookup -> multiTermLookup.field("cost")), MultiTermLookup.of(multiTermLookup -> multiTermLookup.field("expDate")) @@ -130,7 +130,7 @@ private Aggregation getMultiTermsAggregation(Integer size) { multiTermsAggregationBuilder = multiTermsAggregationBuilder.size(size); } - MultiTermsAggregation multiTermsAggregation = multiTermsAggregationBuilder.build(); + MultiTermsAggregationFields multiTermsAggregation = multiTermsAggregationBuilder.build(); return new Aggregation.Builder().multiTerms(multiTermsAggregation).build(); } diff --git a/java-client/src/test/java11/org/opensearch/client/opensearch/integTest/AbstractRequestIT.java b/java-client/src/test/java11/org/opensearch/client/opensearch/integTest/AbstractRequestIT.java index 6efce2e340..747fcf1e63 100644 --- a/java-client/src/test/java11/org/opensearch/client/opensearch/integTest/AbstractRequestIT.java +++ b/java-client/src/test/java11/org/opensearch/client/opensearch/integTest/AbstractRequestIT.java @@ -49,6 +49,7 @@ import org.opensearch.client.opensearch._types.Time; import org.opensearch.client.opensearch._types.aggregations.Aggregate; import org.opensearch.client.opensearch._types.aggregations.HistogramAggregate; +import org.opensearch.client.opensearch._types.aggregations.MultiTermsBucket; import org.opensearch.client.opensearch._types.analysis.Analyzer; import org.opensearch.client.opensearch._types.analysis.CustomAnalyzer; import org.opensearch.client.opensearch._types.analysis.ShingleTokenFilter; @@ -477,8 +478,8 @@ public void testSubAggregation() throws IOException { SearchResponse searchResponse = javaClient().search(searchRequest, Product.class); Aggregate prices = searchResponse.aggregations().get("price")._get().toAggregate(); - assertEquals(1, prices.dterms().buckets().array().get(0).docCount()); - assertEquals(1, prices.dterms().buckets().array().get(1).docCount()); + assertEquals(1, prices.dterms().buckets().array().get(0).to(MultiTermsBucket.class).docCount()); + assertEquals(1, prices.dterms().buckets().array().get(1).to(MultiTermsBucket.class).docCount()); // We've set "size" to zero assertEquals(0, searchResponse.hits().hits().size()); diff --git a/java-client/src/test/java11/org/opensearch/client/opensearch/integTest/AbstractSearchRequestIT.java b/java-client/src/test/java11/org/opensearch/client/opensearch/integTest/AbstractSearchRequestIT.java index 6e79e56a82..42434c9711 100644 --- a/java-client/src/test/java11/org/opensearch/client/opensearch/integTest/AbstractSearchRequestIT.java +++ b/java-client/src/test/java11/org/opensearch/client/opensearch/integTest/AbstractSearchRequestIT.java @@ -22,7 +22,7 @@ import org.opensearch.client.opensearch._types.aggregations.Aggregate; import org.opensearch.client.opensearch._types.aggregations.Aggregation; import org.opensearch.client.opensearch._types.aggregations.CompositeAggregate; -import org.opensearch.client.opensearch._types.aggregations.CompositeAggregation; +import org.opensearch.client.opensearch._types.aggregations.CompositeAggregationFields; import org.opensearch.client.opensearch._types.aggregations.CompositeAggregationSource; import org.opensearch.client.opensearch._types.aggregations.CompositeBucket; import org.opensearch.client.opensearch._types.mapping.Property; @@ -88,7 +88,7 @@ public void shouldReturnSearchResultsWithCompositeAgg() throws Exception { ).build(); comAggrSrcMap.put("quantity", compositeAggregationSource1); - CompositeAggregation compAgg = new CompositeAggregation.Builder().sources(comAggrSrcMap).build(); + CompositeAggregationFields compAgg = new CompositeAggregationFields.Builder().sources(comAggrSrcMap).build(); Aggregation aggregation = new Aggregation.Builder().composite(compAgg).build(); diff --git a/java-client/src/test/java11/org/opensearch/client/opensearch/integTest/AbstractSearchTemplateRequestIT.java b/java-client/src/test/java11/org/opensearch/client/opensearch/integTest/AbstractSearchTemplateRequestIT.java index 61e72ea1cc..dd02232cf0 100644 --- a/java-client/src/test/java11/org/opensearch/client/opensearch/integTest/AbstractSearchTemplateRequestIT.java +++ b/java-client/src/test/java11/org/opensearch/client/opensearch/integTest/AbstractSearchTemplateRequestIT.java @@ -16,6 +16,7 @@ import org.opensearch.client.json.JsonData; import org.opensearch.client.opensearch._types.BuiltinScriptLanguage; import org.opensearch.client.opensearch._types.Refresh; +import org.opensearch.client.opensearch._types.aggregations.MultiTermsBucket; import org.opensearch.client.opensearch._types.mapping.Property; import org.opensearch.client.opensearch.core.PutScriptRequest; import org.opensearch.client.opensearch.core.SearchTemplateResponse; @@ -84,8 +85,8 @@ public void testTemplateSearchAggregations() throws Exception { assertEquals(1, searchResponse.aggregations().size()); var buckets = searchResponse.aggregations().get("test-aggs").sterms().buckets().array(); assertEquals(2, buckets.size()); - assertEquals(2, buckets.get(0).docCount()); - assertEquals(2, buckets.get(1).docCount()); + assertEquals(2, buckets.get(0).to(MultiTermsBucket.class).docCount()); + assertEquals(2, buckets.get(1).to(MultiTermsBucket.class).docCount()); } diff --git a/java-codegen/opensearch-openapi.yaml b/java-codegen/opensearch-openapi.yaml index b4829f72a0..15cecdac46 100644 --- a/java-codegen/opensearch-openapi.yaml +++ b/java-codegen/opensearch-openapi.yaml @@ -13,7 +13,7 @@ paths: - amazon-serverless description: Returns basic information about the cluster. externalDocs: - url: https://opensearch.org/docs/latest + url: https://docs.opensearch.org/latest/ parameters: - $ref: '#/components/parameters/_global___query.pretty' - $ref: '#/components/parameters/_global___query.human' @@ -29,7 +29,7 @@ paths: x-version-added: '1.0' description: Returns whether the cluster is running. externalDocs: - url: https://opensearch.org/docs/latest + url: https://docs.opensearch.org/latest/ parameters: - $ref: '#/components/parameters/_global___query.pretty' - $ref: '#/components/parameters/_global___query.human' @@ -46,7 +46,7 @@ paths: x-version-added: '1.0' description: Returns an alias. externalDocs: - url: https://opensearch.org/docs/latest/im-plugin/index-alias/ + url: https://docs.opensearch.org/latest/im-plugin/index-alias/ parameters: - $ref: '#/components/parameters/indices.get_alias___query.allow_no_indices' - $ref: '#/components/parameters/indices.get_alias___query.expand_wildcards' @@ -68,7 +68,7 @@ paths: x-version-added: '1.0' description: Creates or updates an alias. externalDocs: - url: https://opensearch.org/docs/latest/api-reference/index-apis/update-alias/ + url: https://docs.opensearch.org/latest/api-reference/index-apis/update-alias/ parameters: - $ref: '#/components/parameters/indices.put_alias___query.cluster_manager_timeout' - $ref: '#/components/parameters/indices.put_alias___query.master_timeout' @@ -90,7 +90,7 @@ paths: x-version-added: '1.0' description: Returns an alias. externalDocs: - url: https://opensearch.org/docs/latest/im-plugin/index-alias/ + url: https://docs.opensearch.org/latest/im-plugin/index-alias/ parameters: - $ref: '#/components/parameters/indices.get_alias___path.name' - $ref: '#/components/parameters/indices.get_alias___query.allow_no_indices' @@ -113,7 +113,7 @@ paths: x-version-added: '1.0' description: Returns information about whether a particular alias exists. externalDocs: - url: https://opensearch.org/docs/latest + url: https://docs.opensearch.org/latest/ parameters: - $ref: '#/components/parameters/indices.exists_alias___path.name' - $ref: '#/components/parameters/indices.exists_alias___query.allow_no_indices' @@ -136,7 +136,7 @@ paths: x-version-added: '1.0' description: Creates or updates an alias. externalDocs: - url: https://opensearch.org/docs/latest/api-reference/index-apis/update-alias/ + url: https://docs.opensearch.org/latest/api-reference/index-apis/update-alias/ parameters: - $ref: '#/components/parameters/indices.put_alias___path.name' - $ref: '#/components/parameters/indices.put_alias___query.cluster_manager_timeout' @@ -158,7 +158,7 @@ paths: x-version-added: '1.0' description: Creates or updates an alias. externalDocs: - url: https://opensearch.org/docs/latest/api-reference/index-apis/update-alias/ + url: https://docs.opensearch.org/latest/api-reference/index-apis/update-alias/ parameters: - $ref: '#/components/parameters/indices.put_alias___path.name' - $ref: '#/components/parameters/indices.put_alias___query.cluster_manager_timeout' @@ -181,7 +181,7 @@ paths: x-version-added: '1.0' description: Updates index aliases. externalDocs: - url: https://opensearch.org/docs/latest/api-reference/index-apis/alias/ + url: https://docs.opensearch.org/latest/api-reference/index-apis/alias/ parameters: - $ref: '#/components/parameters/indices.update_aliases___query.cluster_manager_timeout' - $ref: '#/components/parameters/indices.update_aliases___query.master_timeout' @@ -200,10 +200,13 @@ paths: post: operationId: indices.put_alias.3 x-operation-group: indices.put_alias + deprecated: true + x-deprecation-message: Use the singular `_alias` form. The plural `_aliases` is retained as a back-compat alias and is structurally equivalent. x-version-added: '1.0' + x-version-deprecated: '1.0' description: Creates or updates an alias. externalDocs: - url: https://opensearch.org/docs/latest/api-reference/index-apis/update-alias/ + url: https://docs.opensearch.org/latest/api-reference/index-apis/update-alias/ parameters: - $ref: '#/components/parameters/indices.put_alias___path.name' - $ref: '#/components/parameters/indices.put_alias___query.cluster_manager_timeout' @@ -222,10 +225,13 @@ paths: put: operationId: indices.put_alias.4 x-operation-group: indices.put_alias + deprecated: true + x-deprecation-message: Use the singular `_alias` form. The plural `_aliases` is retained as a back-compat alias and is structurally equivalent. x-version-added: '1.0' + x-version-deprecated: '1.0' description: Creates or updates an alias. externalDocs: - url: https://opensearch.org/docs/latest/api-reference/index-apis/update-alias/ + url: https://docs.opensearch.org/latest/api-reference/index-apis/update-alias/ parameters: - $ref: '#/components/parameters/indices.put_alias___path.name' - $ref: '#/components/parameters/indices.put_alias___query.cluster_manager_timeout' @@ -248,7 +254,7 @@ paths: x-version-added: '1.0' description: Performs the analysis process on a text and return the tokens breakdown of the text. externalDocs: - url: https://opensearch.org/docs/latest/api-reference/analyze-apis/perform-text-analysis/ + url: https://docs.opensearch.org/latest/api-reference/analyze-apis/perform-text-analysis/ parameters: - $ref: '#/components/parameters/indices.analyze___query.index' - $ref: '#/components/parameters/_global___query.pretty' @@ -267,7 +273,7 @@ paths: x-version-added: '1.0' description: Performs the analysis process on a text and return the tokens breakdown of the text. externalDocs: - url: https://opensearch.org/docs/latest/api-reference/analyze-apis/perform-text-analysis/ + url: https://docs.opensearch.org/latest/api-reference/analyze-apis/perform-text-analysis/ parameters: - $ref: '#/components/parameters/indices.analyze___query.index' - $ref: '#/components/parameters/_global___query.pretty' @@ -287,7 +293,7 @@ paths: x-version-added: '1.0' description: Allows to perform multiple index/update/delete operations in a single request. externalDocs: - url: https://opensearch.org/docs/latest/api-reference/document-apis/bulk/ + url: https://docs.opensearch.org/latest/api-reference/document-apis/bulk/ parameters: - $ref: '#/components/parameters/bulk___query._source' - $ref: '#/components/parameters/bulk___query._source_excludes' @@ -316,7 +322,7 @@ paths: x-version-added: '1.0' description: Allows to perform multiple index/update/delete operations in a single request. externalDocs: - url: https://opensearch.org/docs/latest/api-reference/document-apis/bulk/ + url: https://docs.opensearch.org/latest/api-reference/document-apis/bulk/ parameters: - $ref: '#/components/parameters/bulk___query._source' - $ref: '#/components/parameters/bulk___query._source_excludes' @@ -346,7 +352,7 @@ paths: x-version-added: '2.17' description: Allows to perform multiple index/update/delete operations using request response streaming. externalDocs: - url: https://opensearch.org/docs/latest/api-reference/document-apis/bulk-streaming/ + url: https://docs.opensearch.org/latest/api-reference/document-apis/bulk-streaming/ parameters: - $ref: '#/components/parameters/bulk_stream___query._source' - $ref: '#/components/parameters/bulk_stream___query._source_excludes' @@ -376,7 +382,7 @@ paths: x-version-added: '2.17' description: Allows to perform multiple index/update/delete operations using request response streaming. externalDocs: - url: https://opensearch.org/docs/latest/api-reference/document-apis/bulk-streaming/ + url: https://docs.opensearch.org/latest/api-reference/document-apis/bulk-streaming/ parameters: - $ref: '#/components/parameters/bulk_stream___query._source' - $ref: '#/components/parameters/bulk_stream___query._source_excludes' @@ -410,7 +416,7 @@ paths: - amazon-serverless description: Clears all or specific caches for one or more indexes. externalDocs: - url: https://opensearch.org/docs/latest/api-reference/index-apis/clear-index-cache/ + url: https://docs.opensearch.org/latest/api-reference/index-apis/clear-index-cache/ parameters: - $ref: '#/components/parameters/indices.clear_cache___query.allow_no_indices' - $ref: '#/components/parameters/indices.clear_cache___query.expand_wildcards' @@ -436,7 +442,7 @@ paths: x-version-added: '1.0' description: Returns help for the Cat APIs. externalDocs: - url: https://opensearch.org/docs/latest/api-reference/cat/index/ + url: https://docs.opensearch.org/latest/api-reference/cat/index/ responses: '200': $ref: '#/components/responses/cat.help___200' @@ -453,7 +459,7 @@ paths: x-version-added: '1.0' description: Shows information about aliases currently configured to indexes, including filter and routing information. externalDocs: - url: https://opensearch.org/docs/latest/api-reference/cat/cat-aliases/ + url: https://docs.opensearch.org/latest/api-reference/cat/cat-aliases/ parameters: - $ref: '#/components/parameters/cat.aliases___query.expand_wildcards' - $ref: '#/components/parameters/cat.aliases___query.format' @@ -477,7 +483,7 @@ paths: x-version-added: '1.0' description: Shows information about aliases currently configured to indexes, including filter and routing information. externalDocs: - url: https://opensearch.org/docs/latest/api-reference/cat/cat-aliases/ + url: https://docs.opensearch.org/latest/api-reference/cat/cat-aliases/ parameters: - $ref: '#/components/parameters/cat.aliases___path.name' - $ref: '#/components/parameters/cat.aliases___query.expand_wildcards' @@ -502,7 +508,7 @@ paths: x-version-added: '1.0' description: Provides a snapshot of how many shards are allocated to each data node and how much disk space they are using. externalDocs: - url: https://opensearch.org/docs/latest/api-reference/cat/cat-allocation/ + url: https://docs.opensearch.org/latest/api-reference/cat/cat-allocation/ parameters: - $ref: '#/components/parameters/cat.allocation___query.bytes' - $ref: '#/components/parameters/cat.allocation___query.cluster_manager_timeout' @@ -528,7 +534,7 @@ paths: x-version-added: '1.0' description: Provides a snapshot of how many shards are allocated to each data node and how much disk space they are using. externalDocs: - url: https://opensearch.org/docs/latest/api-reference/cat/cat-allocation/ + url: https://docs.opensearch.org/latest/api-reference/cat/cat-allocation/ parameters: - $ref: '#/components/parameters/cat.allocation___path.node_id' - $ref: '#/components/parameters/cat.allocation___query.bytes' @@ -555,7 +561,7 @@ paths: x-version-added: '2.0' description: Returns information about the cluster-manager node. externalDocs: - url: https://opensearch.org/docs/latest/api-reference/cat/cat-cluster_manager/ + url: https://docs.opensearch.org/latest/api-reference/cat/cat-cluster_manager/ parameters: - $ref: '#/components/parameters/cat.cluster_manager___query.cluster_manager_timeout' - $ref: '#/components/parameters/cat.cluster_manager___query.format' @@ -580,7 +586,7 @@ paths: x-version-added: '1.0' description: Provides quick access to the document count of the entire cluster or of an individual index. externalDocs: - url: https://opensearch.org/docs/latest/api-reference/cat/cat-count/ + url: https://docs.opensearch.org/latest/api-reference/cat/cat-count/ parameters: - $ref: '#/components/parameters/cat.count___query.format' - $ref: '#/components/parameters/cat.count___query.h' @@ -602,7 +608,7 @@ paths: x-version-added: '1.0' description: Provides quick access to the document count of the entire cluster or of an individual index. externalDocs: - url: https://opensearch.org/docs/latest/api-reference/cat/cat-count/ + url: https://docs.opensearch.org/latest/api-reference/cat/cat-count/ parameters: - $ref: '#/components/parameters/cat.count___path.index' - $ref: '#/components/parameters/cat.count___query.format' @@ -625,7 +631,7 @@ paths: x-version-added: '1.0' description: Shows how much heap memory is currently being used by field data on every data node in the cluster. externalDocs: - url: https://opensearch.org/docs/latest/api-reference/cat/cat-field-data/ + url: https://docs.opensearch.org/latest/api-reference/cat/cat-field-data/ parameters: - $ref: '#/components/parameters/cat.fielddata___query.bytes' - $ref: '#/components/parameters/cat.fielddata___query.fields' @@ -649,7 +655,7 @@ paths: x-version-added: '1.0' description: Shows how much heap memory is currently being used by field data on every data node in the cluster. externalDocs: - url: https://opensearch.org/docs/latest/api-reference/cat/cat-field-data/ + url: https://docs.opensearch.org/latest/api-reference/cat/cat-field-data/ parameters: - $ref: '#/components/parameters/cat.fielddata___path.fields' - $ref: '#/components/parameters/cat.fielddata___query.bytes' @@ -674,7 +680,7 @@ paths: x-version-added: '1.0' description: Returns a concise representation of the cluster health. externalDocs: - url: https://opensearch.org/docs/latest/api-reference/cat/cat-health/ + url: https://docs.opensearch.org/latest/api-reference/cat/cat-health/ parameters: - $ref: '#/components/parameters/cat.health___query.format' - $ref: '#/components/parameters/cat.health___query.h' @@ -698,7 +704,7 @@ paths: x-version-added: '1.0' description: Lists information related to indexes, that is, how much disk space they are using, how many shards they have, their health status, and so on. externalDocs: - url: https://opensearch.org/docs/latest/api-reference/cat/cat-indices/ + url: https://docs.opensearch.org/latest/api-reference/cat/cat-indices/ parameters: - $ref: '#/components/parameters/cat.indices___query.bytes' - $ref: '#/components/parameters/cat.indices___query.cluster_manager_timeout' @@ -729,7 +735,7 @@ paths: x-version-added: '1.0' description: Lists information related to indexes, that is, how much disk space they are using, how many shards they have, their health status, and so on. externalDocs: - url: https://opensearch.org/docs/latest/api-reference/cat/cat-indices/ + url: https://docs.opensearch.org/latest/api-reference/cat/cat-indices/ parameters: - $ref: '#/components/parameters/cat.indices___path.index' - $ref: '#/components/parameters/cat.indices___query.bytes' @@ -764,7 +770,7 @@ paths: x-version-deprecated: '2.0' description: Returns information about the cluster-manager node. externalDocs: - url: https://opensearch.org/docs/latest/api-reference/cat/cat-cluster_manager/ + url: https://docs.opensearch.org/latest/api-reference/cat/cat-cluster_manager/ parameters: - $ref: '#/components/parameters/cat.master___query.cluster_manager_timeout' - $ref: '#/components/parameters/cat.master___query.format' @@ -792,7 +798,7 @@ paths: - amazon-serverless description: Returns information about custom node attributes. externalDocs: - url: https://opensearch.org/docs/latest/api-reference/cat/cat-nodeattrs/ + url: https://docs.opensearch.org/latest/api-reference/cat/cat-nodeattrs/ parameters: - $ref: '#/components/parameters/cat.nodeattrs___query.cluster_manager_timeout' - $ref: '#/components/parameters/cat.nodeattrs___query.format' @@ -817,7 +823,7 @@ paths: x-version-added: '1.0' description: Returns basic statistics about the performance of cluster nodes. externalDocs: - url: https://opensearch.org/docs/latest/api-reference/cat/cat-nodes/ + url: https://docs.opensearch.org/latest/api-reference/cat/cat-nodes/ parameters: - $ref: '#/components/parameters/cat.nodes___query.bytes' - $ref: '#/components/parameters/cat.nodes___query.cluster_manager_timeout' @@ -845,7 +851,7 @@ paths: x-version-added: '1.0' description: Returns a concise representation of the cluster's pending tasks. externalDocs: - url: https://opensearch.org/docs/latest/api-reference/cat/cat-pending-tasks/ + url: https://docs.opensearch.org/latest/api-reference/cat/cat-pending-tasks/ parameters: - $ref: '#/components/parameters/cat.pending_tasks___query.cluster_manager_timeout' - $ref: '#/components/parameters/cat.pending_tasks___query.format' @@ -871,7 +877,7 @@ paths: x-version-added: '2.4' description: Lists one or several CAT point-in-time segments. externalDocs: - url: https://opensearch.org/docs/latest/search-plugins/point-in-time-api/ + url: https://docs.opensearch.org/latest/search-plugins/point-in-time-api/ parameters: - $ref: '#/components/parameters/cat.pit_segments___query.bytes' - $ref: '#/components/parameters/cat.pit_segments___query.format' @@ -896,7 +902,7 @@ paths: x-version-added: '2.4' description: Lists all active CAT point-in-time segments. externalDocs: - url: https://opensearch.org/docs/latest/search-plugins/point-in-time-api/ + url: https://docs.opensearch.org/latest/search-plugins/point-in-time-api/ parameters: - $ref: '#/components/parameters/cat.all_pit_segments___query.bytes' - $ref: '#/components/parameters/cat.all_pit_segments___query.format' @@ -919,7 +925,7 @@ paths: x-version-added: '1.0' description: Returns information about the names, components, and versions of the installed plugins. externalDocs: - url: https://opensearch.org/docs/latest/api-reference/cat/cat-plugins/ + url: https://docs.opensearch.org/latest/api-reference/cat/cat-plugins/ parameters: - $ref: '#/components/parameters/cat.plugins___query.cluster_manager_timeout' - $ref: '#/components/parameters/cat.plugins___query.format' @@ -944,7 +950,7 @@ paths: x-version-added: '1.0' description: Returns all completed and ongoing index and shard recoveries. externalDocs: - url: https://opensearch.org/docs/latest/api-reference/cat/cat-plugins/ + url: https://docs.opensearch.org/latest/api-reference/cat/cat-plugins/ parameters: - $ref: '#/components/parameters/cat.recovery___query.active_only' - $ref: '#/components/parameters/cat.recovery___query.bytes' @@ -971,7 +977,7 @@ paths: x-version-added: '1.0' description: Returns all completed and ongoing index and shard recoveries. externalDocs: - url: https://opensearch.org/docs/latest/api-reference/cat/cat-plugins/ + url: https://docs.opensearch.org/latest/api-reference/cat/cat-plugins/ parameters: - $ref: '#/components/parameters/cat.recovery___path.index' - $ref: '#/components/parameters/cat.recovery___query.active_only' @@ -999,7 +1005,7 @@ paths: x-version-added: '1.0' description: Returns information about all snapshot repositories for a cluster. externalDocs: - url: https://opensearch.org/docs/latest/api-reference/cat/cat-repositories/ + url: https://docs.opensearch.org/latest/api-reference/cat/cat-repositories/ parameters: - $ref: '#/components/parameters/cat.repositories___query.cluster_manager_timeout' - $ref: '#/components/parameters/cat.repositories___query.format' @@ -1026,7 +1032,7 @@ paths: Returns information about active and last-completed segment replication events on each replica shard, including related shard-level metrics. These metrics provide information about how far behind the primary shard the replicas are lagging. externalDocs: - url: https://opensearch.org/docs/latest/api-reference/cat/cat-segment-replication/ + url: https://docs.opensearch.org/latest/api-reference/cat/cat-segment-replication/ parameters: - $ref: '#/components/parameters/cat.segment_replication___query.active_only' - $ref: '#/components/parameters/cat.segment_replication___query.allow_no_indices' @@ -1062,7 +1068,7 @@ paths: Returns information about active and last-completed segment replication events on each replica shard, including related shard-level metrics. These metrics provide information about how far behind the primary shard the replicas are lagging. externalDocs: - url: https://opensearch.org/docs/latest/api-reference/cat/cat-segment-replication/ + url: https://docs.opensearch.org/latest/api-reference/cat/cat-segment-replication/ parameters: - $ref: '#/components/parameters/cat.segment_replication___path.index' - $ref: '#/components/parameters/cat.segment_replication___query.active_only' @@ -1097,7 +1103,7 @@ paths: x-version-added: '1.0' description: Provides low-level information about the segments in the shards of an index. externalDocs: - url: https://opensearch.org/docs/latest/api-reference/cat/cat-segments/ + url: https://docs.opensearch.org/latest/api-reference/cat/cat-segments/ parameters: - $ref: '#/components/parameters/cat.segments___query.bytes' - $ref: '#/components/parameters/cat.segments___query.cluster_manager_timeout' @@ -1122,7 +1128,7 @@ paths: x-version-added: '1.0' description: Provides low-level information about the segments in the shards of an index. externalDocs: - url: https://opensearch.org/docs/latest/api-reference/cat/cat-segments/ + url: https://docs.opensearch.org/latest/api-reference/cat/cat-segments/ parameters: - $ref: '#/components/parameters/cat.segments___path.index' - $ref: '#/components/parameters/cat.segments___query.bytes' @@ -1148,7 +1154,7 @@ paths: x-version-added: '1.0' description: Lists the states of all primary and replica shards and how they are distributed. externalDocs: - url: https://opensearch.org/docs/latest/api-reference/cat/cat-shards/ + url: https://docs.opensearch.org/latest/api-reference/cat/cat-shards/ parameters: - $ref: '#/components/parameters/cat.shards___query.bytes' - $ref: '#/components/parameters/cat.shards___query.cluster_manager_timeout' @@ -1175,7 +1181,7 @@ paths: x-version-added: '1.0' description: Lists the states of all primary and replica shards and how they are distributed. externalDocs: - url: https://opensearch.org/docs/latest/api-reference/cat/cat-shards/ + url: https://docs.opensearch.org/latest/api-reference/cat/cat-shards/ parameters: - $ref: '#/components/parameters/cat.shards___path.index' - $ref: '#/components/parameters/cat.shards___query.bytes' @@ -1203,7 +1209,7 @@ paths: x-version-added: '1.0' description: Lists all of the snapshots stored in a specific repository. externalDocs: - url: https://opensearch.org/docs/latest/api-reference/cat/cat-snapshots/ + url: https://docs.opensearch.org/latest/api-reference/cat/cat-snapshots/ parameters: - $ref: '#/components/parameters/cat.snapshots___query.cluster_manager_timeout' - $ref: '#/components/parameters/cat.snapshots___query.format' @@ -1230,7 +1236,7 @@ paths: x-version-added: '1.0' description: Lists all of the snapshots stored in a specific repository. externalDocs: - url: https://opensearch.org/docs/latest/api-reference/cat/cat-snapshots/ + url: https://docs.opensearch.org/latest/api-reference/cat/cat-snapshots/ parameters: - $ref: '#/components/parameters/cat.snapshots___path.repository' - $ref: '#/components/parameters/cat.snapshots___query.cluster_manager_timeout' @@ -1258,7 +1264,7 @@ paths: x-version-added: '1.0' description: Lists the progress of all tasks currently running on the cluster. externalDocs: - url: https://opensearch.org/docs/latest/api-reference/cat/cat-tasks/ + url: https://docs.opensearch.org/latest/api-reference/cat/cat-tasks/ parameters: - $ref: '#/components/parameters/cat.tasks___query.actions' - $ref: '#/components/parameters/cat.tasks___query.detailed' @@ -1285,7 +1291,7 @@ paths: x-version-added: '1.0' description: Lists the names, patterns, order numbers, and version numbers of index templates. externalDocs: - url: https://opensearch.org/docs/latest/api-reference/cat/cat-templates/ + url: https://docs.opensearch.org/latest/api-reference/cat/cat-templates/ parameters: - $ref: '#/components/parameters/cat.templates___query.cluster_manager_timeout' - $ref: '#/components/parameters/cat.templates___query.format' @@ -1310,7 +1316,7 @@ paths: x-version-added: '1.0' description: Lists the names, patterns, order numbers, and version numbers of index templates. externalDocs: - url: https://opensearch.org/docs/latest/api-reference/cat/cat-templates/ + url: https://docs.opensearch.org/latest/api-reference/cat/cat-templates/ parameters: - $ref: '#/components/parameters/cat.templates___path.name' - $ref: '#/components/parameters/cat.templates___query.cluster_manager_timeout' @@ -1338,7 +1344,7 @@ paths: Returns cluster-wide thread pool statistics per node. By default the active, queued, and rejected statistics are returned for all thread pools. externalDocs: - url: https://opensearch.org/docs/latest/api-reference/cat/cat-thread-pool/ + url: https://docs.opensearch.org/latest/api-reference/cat/cat-thread-pool/ parameters: - $ref: '#/components/parameters/cat.thread_pool___query.cluster_manager_timeout' - $ref: '#/components/parameters/cat.thread_pool___query.format' @@ -1366,7 +1372,7 @@ paths: Returns cluster-wide thread pool statistics per node. By default the active, queued, and rejected statistics are returned for all thread pools. externalDocs: - url: https://opensearch.org/docs/latest/api-reference/cat/cat-thread-pool/ + url: https://docs.opensearch.org/latest/api-reference/cat/cat-thread-pool/ parameters: - $ref: '#/components/parameters/cat.thread_pool___path.thread_pool_patterns' - $ref: '#/components/parameters/cat.thread_pool___query.cluster_manager_timeout' @@ -1393,7 +1399,7 @@ paths: x-version-added: '1.0' description: Explains how shards are allocated in the current cluster and provides an explanation for why unassigned shards can't be allocated to a node. externalDocs: - url: https://opensearch.org/docs/latest/api-reference/cluster-api/cluster-allocation/ + url: https://docs.opensearch.org/latest/api-reference/cluster-api/cluster-allocation/ parameters: - $ref: '#/components/parameters/cluster.allocation_explain___query.include_disk_info' - $ref: '#/components/parameters/cluster.allocation_explain___query.include_yes_decisions' @@ -1413,7 +1419,7 @@ paths: x-version-added: '1.0' description: Explains how shards are allocated in the current cluster and provides an explanation for why unassigned shards can't be allocated to a node. externalDocs: - url: https://opensearch.org/docs/latest/api-reference/cluster-api/cluster-allocation/ + url: https://docs.opensearch.org/latest/api-reference/cluster-api/cluster-allocation/ parameters: - $ref: '#/components/parameters/cluster.allocation_explain___query.include_disk_info' - $ref: '#/components/parameters/cluster.allocation_explain___query.include_yes_decisions' @@ -1434,7 +1440,7 @@ paths: x-version-added: '1.0' description: Recommissions a decommissioned zone. externalDocs: - url: https://opensearch.org/docs/latest/api-reference/cluster-api/cluster-decommission/#example-decommissioning-and-recommissioning-a-zone + url: https://docs.opensearch.org/latest/api-reference/cluster-api/cluster-decommission/#decommissioning-and-recommissioning-a-zone responses: '200': $ref: '#/components/responses/cluster.delete_decommission_awareness___200' @@ -1451,7 +1457,7 @@ paths: x-version-added: '1.0' description: Retrieves the decommission status for all zones. externalDocs: - url: https://opensearch.org/docs/latest/api-reference/cluster-api/cluster-decommission/#example-getting-zone-decommission-status + url: https://docs.opensearch.org/latest/api-reference/cluster-api/cluster-decommission/#getting-zone-decommission-status parameters: - $ref: '#/components/parameters/cluster.get_decommission_awareness___path.awareness_attribute_name' - $ref: '#/components/parameters/_global___query.pretty' @@ -1469,7 +1475,7 @@ paths: x-version-added: '1.0' description: Decommissions a cluster zone based on awareness. This can greatly benefit multi-zone deployments, where awareness attributes can aid in applying new upgrades to a cluster in a controlled fashion. externalDocs: - url: https://opensearch.org/docs/latest/api-reference/cluster-api/cluster-decommission/#example-decommissioning-and-recommissioning-a-zone + url: https://docs.opensearch.org/latest/api-reference/cluster-api/cluster-decommission/#decommissioning-and-recommissioning-a-zone parameters: - $ref: '#/components/parameters/cluster.put_decommission_awareness___path.awareness_attribute_name' - $ref: '#/components/parameters/cluster.put_decommission_awareness___path.awareness_attribute_value' @@ -1488,7 +1494,7 @@ paths: x-version-added: '1.0' description: Returns basic information about the health of the cluster. externalDocs: - url: https://opensearch.org/docs/latest/api-reference/cluster-api/cluster-health/ + url: https://docs.opensearch.org/latest/api-reference/cluster-api/cluster-health/ parameters: - $ref: '#/components/parameters/cluster.health___query.awareness_attribute' - $ref: '#/components/parameters/cluster.health___query.cluster_manager_timeout' @@ -1518,7 +1524,7 @@ paths: x-version-added: '1.0' description: Returns basic information about the health of the cluster. externalDocs: - url: https://opensearch.org/docs/latest/api-reference/cluster-api/cluster-health/ + url: https://docs.opensearch.org/latest/api-reference/cluster-api/cluster-health/ parameters: - $ref: '#/components/parameters/cluster.health___path.index' - $ref: '#/components/parameters/cluster.health___query.awareness_attribute' @@ -1553,7 +1559,7 @@ paths: x-version-deprecated: '1.0' description: Returns information about hot threads on each node in the cluster. externalDocs: - url: https://opensearch.org/docs/latest/api-reference/nodes-apis/nodes-hot-threads/ + url: https://docs.opensearch.org/latest/api-reference/nodes-apis/nodes-hot-threads/ parameters: - $ref: '#/components/parameters/nodes.hot_threads___path.node_id' - $ref: '#/components/parameters/nodes.hot_threads___query.ignore_idle_threads' @@ -1581,7 +1587,7 @@ paths: x-version-deprecated: '1.0' description: Returns information about hot threads on each node in the cluster. externalDocs: - url: https://opensearch.org/docs/latest/api-reference/nodes-apis/nodes-hot-threads/ + url: https://docs.opensearch.org/latest/api-reference/nodes-apis/nodes-hot-threads/ parameters: - $ref: '#/components/parameters/nodes.hot_threads___query.ignore_idle_threads' - $ref: '#/components/parameters/nodes.hot_threads___query.interval' @@ -1606,7 +1612,7 @@ paths: Returns a list of pending cluster-level tasks, such as index creation, mapping updates, or new allocations. externalDocs: - url: https://opensearch.org/docs/latest + url: https://docs.opensearch.org/latest/ parameters: - $ref: '#/components/parameters/cluster.pending_tasks___query.cluster_manager_timeout' - $ref: '#/components/parameters/cluster.pending_tasks___query.local' @@ -1626,7 +1632,7 @@ paths: x-version-added: '1.0' description: Allows to manually change the allocation of individual shards in the cluster. externalDocs: - url: https://opensearch.org/docs/latest + url: https://docs.opensearch.org/latest/ parameters: - $ref: '#/components/parameters/cluster.reroute___query.cluster_manager_timeout' - $ref: '#/components/parameters/cluster.reroute___query.dry_run' @@ -1652,7 +1658,7 @@ paths: x-version-added: '1.0' description: Fetches weighted shard routing weights. externalDocs: - url: https://opensearch.org/docs/latest/api-reference/cluster-api/cluster-awareness/#example-getting-weights-for-all-zones + url: https://docs.opensearch.org/latest/api-reference/cluster-api/cluster-awareness/#example-request-viewing-the-configuration parameters: - $ref: '#/components/parameters/cluster.get_weighted_routing___path.attribute' - $ref: '#/components/parameters/_global___query.pretty' @@ -1669,7 +1675,7 @@ paths: x-version-added: '1.0' description: Updates weighted shard routing weights. externalDocs: - url: https://opensearch.org/docs/latest/api-reference/cluster-api/cluster-awareness/#example-weighted-round-robin-search + url: https://docs.opensearch.org/latest/api-reference/cluster-api/cluster-awareness/#example-request-updating-the-configuration parameters: - $ref: '#/components/parameters/cluster.put_weighted_routing___path.attribute' - $ref: '#/components/parameters/_global___query.pretty' @@ -1689,7 +1695,7 @@ paths: x-version-added: '1.0' description: Delete weighted shard routing weights. externalDocs: - url: https://opensearch.org/docs/latest/api-reference/cluster-api/cluster-awareness/#example-deleting-weights + url: https://docs.opensearch.org/latest/api-reference/cluster-api/cluster-awareness/#example-request-deleting-the-configuration requestBody: $ref: '#/components/requestBodies/cluster.delete_weighted_routing' responses: @@ -1708,7 +1714,7 @@ paths: x-version-added: '1.0' description: Returns cluster settings. externalDocs: - url: https://opensearch.org/docs/latest/api-reference/cluster-api/cluster-settings/ + url: https://docs.opensearch.org/latest/api-reference/cluster-api/cluster-settings/ parameters: - $ref: '#/components/parameters/cluster.get_settings___query.cluster_manager_timeout' - $ref: '#/components/parameters/cluster.get_settings___query.flat_settings' @@ -1729,7 +1735,7 @@ paths: x-version-added: '1.0' description: Updates the cluster settings. externalDocs: - url: https://opensearch.org/docs/latest/api-reference/cluster-settings/ + url: https://docs.opensearch.org/latest/api-reference/cluster-settings/ parameters: - $ref: '#/components/parameters/cluster.put_settings___query.cluster_manager_timeout' - $ref: '#/components/parameters/cluster.put_settings___query.flat_settings' @@ -1752,7 +1758,7 @@ paths: x-version-added: '1.0' description: Returns comprehensive information about the state of the cluster. externalDocs: - url: https://opensearch.org/docs/latest + url: https://docs.opensearch.org/latest/ parameters: - $ref: '#/components/parameters/cluster.state___query.allow_no_indices' - $ref: '#/components/parameters/cluster.state___query.cluster_manager_timeout' @@ -1778,7 +1784,7 @@ paths: x-version-added: '1.0' description: Returns comprehensive information about the state of the cluster. externalDocs: - url: https://opensearch.org/docs/latest + url: https://docs.opensearch.org/latest/ parameters: - $ref: '#/components/parameters/cluster.state___path.metric' - $ref: '#/components/parameters/cluster.state___query.allow_no_indices' @@ -1805,7 +1811,7 @@ paths: x-version-added: '1.0' description: Returns comprehensive information about the state of the cluster. externalDocs: - url: https://opensearch.org/docs/latest + url: https://docs.opensearch.org/latest/ parameters: - $ref: '#/components/parameters/cluster.state___path.index' - $ref: '#/components/parameters/cluster.state___path.metric' @@ -1833,7 +1839,7 @@ paths: x-version-added: '1.0' description: Returns a high-level overview of cluster statistics. externalDocs: - url: https://opensearch.org/docs/latest/api-reference/cluster-api/cluster-stats/ + url: https://docs.opensearch.org/latest/api-reference/cluster-api/cluster-stats/ parameters: - $ref: '#/components/parameters/cluster.stats___query.flat_settings' - $ref: '#/components/parameters/cluster.stats___query.timeout' @@ -1852,7 +1858,7 @@ paths: x-version-added: '2.18' description: Returns a high-level overview of cluster statistics. externalDocs: - url: https://opensearch.org/docs/latest/api-reference/cluster-api/cluster-stats/ + url: https://docs.opensearch.org/latest/api-reference/cluster-api/cluster-stats/ parameters: - $ref: '#/components/parameters/cluster.stats___path.index_metric' - $ref: '#/components/parameters/cluster.stats___path.metric' @@ -1874,7 +1880,7 @@ paths: x-version-added: '2.18' description: Returns a high-level overview of cluster statistics. externalDocs: - url: https://opensearch.org/docs/latest/api-reference/cluster-api/cluster-stats/ + url: https://docs.opensearch.org/latest/api-reference/cluster-api/cluster-stats/ parameters: - $ref: '#/components/parameters/cluster.stats___path.metric' - $ref: '#/components/parameters/cluster.stats___path.node_id' @@ -1895,7 +1901,7 @@ paths: x-version-added: '1.0' description: Returns a high-level overview of cluster statistics. externalDocs: - url: https://opensearch.org/docs/latest/api-reference/cluster-api/cluster-stats/ + url: https://docs.opensearch.org/latest/api-reference/cluster-api/cluster-stats/ parameters: - $ref: '#/components/parameters/cluster.stats___path.node_id' - $ref: '#/components/parameters/cluster.stats___query.flat_settings' @@ -1915,7 +1921,7 @@ paths: x-version-added: '1.0' description: Clears any cluster voting configuration exclusions. externalDocs: - url: https://opensearch.org/docs/latest + url: https://docs.opensearch.org/latest/ parameters: - $ref: '#/components/parameters/cluster.delete_voting_config_exclusions___query.wait_for_removal' - $ref: '#/components/parameters/_global___query.pretty' @@ -1932,7 +1938,7 @@ paths: x-version-added: '1.0' description: Updates the cluster voting configuration by excluding certain node IDs or names. externalDocs: - url: https://opensearch.org/docs/latest + url: https://docs.opensearch.org/latest/ parameters: - $ref: '#/components/parameters/cluster.post_voting_config_exclusions___query.node_ids' - $ref: '#/components/parameters/cluster.post_voting_config_exclusions___query.node_names' @@ -1952,7 +1958,7 @@ paths: x-version-added: '1.0' description: Returns one or more component templates. externalDocs: - url: https://opensearch.org/docs/latest + url: https://docs.opensearch.org/latest/ parameters: - $ref: '#/components/parameters/cluster.get_component_template___query.cluster_manager_timeout' - $ref: '#/components/parameters/cluster.get_component_template___query.flat_settings' @@ -1973,7 +1979,7 @@ paths: x-version-added: '1.0' description: Deletes a component template. externalDocs: - url: https://opensearch.org/docs/latest + url: https://docs.opensearch.org/latest/ parameters: - $ref: '#/components/parameters/cluster.delete_component_template___path.name' - $ref: '#/components/parameters/cluster.delete_component_template___query.cluster_manager_timeout' @@ -1993,7 +1999,7 @@ paths: x-version-added: '1.0' description: Returns one or more component templates. externalDocs: - url: https://opensearch.org/docs/latest + url: https://docs.opensearch.org/latest/ parameters: - $ref: '#/components/parameters/cluster.get_component_template___path.name' - $ref: '#/components/parameters/cluster.get_component_template___query.cluster_manager_timeout' @@ -2014,7 +2020,7 @@ paths: x-version-added: '1.0' description: Returns information about whether a particular component template exist. externalDocs: - url: https://opensearch.org/docs/latest + url: https://docs.opensearch.org/latest/ parameters: - $ref: '#/components/parameters/cluster.exists_component_template___path.name' - $ref: '#/components/parameters/cluster.exists_component_template___query.cluster_manager_timeout' @@ -2034,7 +2040,7 @@ paths: x-version-added: '1.0' description: Creates or updates a component template. externalDocs: - url: https://opensearch.org/docs/latest/im-plugin/index-templates/#use-component-templates-to-create-an-index-template + url: https://docs.opensearch.org/latest/im-plugin/index-templates/#use-component-templates-to-create-an-index-template parameters: - $ref: '#/components/parameters/cluster.put_component_template___path.name' - $ref: '#/components/parameters/cluster.put_component_template___query.cluster_manager_timeout' @@ -2057,7 +2063,7 @@ paths: x-version-added: '1.0' description: Creates or updates a component template. externalDocs: - url: https://opensearch.org/docs/latest/im-plugin/index-templates/#use-component-templates-to-create-an-index-template + url: https://docs.opensearch.org/latest/im-plugin/index-templates/#use-component-templates-to-create-an-index-template parameters: - $ref: '#/components/parameters/cluster.put_component_template___path.name' - $ref: '#/components/parameters/cluster.put_component_template___query.cluster_manager_timeout' @@ -2081,7 +2087,7 @@ paths: x-version-added: '1.0' description: Returns number of documents matching a query. externalDocs: - url: https://opensearch.org/docs/latest/api-reference/count/ + url: https://docs.opensearch.org/latest/api-reference/count/ parameters: - $ref: '#/components/parameters/count___query.allow_no_indices' - $ref: '#/components/parameters/count___query.analyze_wildcard' @@ -2113,7 +2119,7 @@ paths: x-version-added: '1.0' description: Returns number of documents matching a query. externalDocs: - url: https://opensearch.org/docs/latest/api-reference/count/ + url: https://docs.opensearch.org/latest/api-reference/count/ parameters: - $ref: '#/components/parameters/count___query.allow_no_indices' - $ref: '#/components/parameters/count___query.analyze_wildcard' @@ -2146,7 +2152,7 @@ paths: x-version-added: '1.0' description: Returns all dangling indexes. externalDocs: - url: https://opensearch.org/docs/latest/api-reference/index-apis/dangling-index/ + url: https://docs.opensearch.org/latest/api-reference/index-apis/dangling-index/ parameters: - $ref: '#/components/parameters/_global___query.pretty' - $ref: '#/components/parameters/_global___query.human' @@ -2163,7 +2169,7 @@ paths: x-version-added: '1.0' description: Deletes the specified dangling index. externalDocs: - url: https://opensearch.org/docs/latest/api-reference/index-apis/dangling-index/ + url: https://docs.opensearch.org/latest/api-reference/index-apis/dangling-index/ parameters: - $ref: '#/components/parameters/dangling_indices.delete_dangling_index___path.index_uuid' - $ref: '#/components/parameters/dangling_indices.delete_dangling_index___query.accept_data_loss' @@ -2184,7 +2190,7 @@ paths: x-version-added: '1.0' description: Imports the specified dangling index. externalDocs: - url: https://opensearch.org/docs/latest/api-reference/index-apis/dangling-index/ + url: https://docs.opensearch.org/latest/api-reference/index-apis/dangling-index/ parameters: - $ref: '#/components/parameters/dangling_indices.import_dangling_index___path.index_uuid' - $ref: '#/components/parameters/dangling_indices.import_dangling_index___query.accept_data_loss' @@ -2206,7 +2212,7 @@ paths: x-version-added: '1.0' description: Returns data streams. externalDocs: - url: https://opensearch.org/docs/latest/im-plugin/data-streams/ + url: https://docs.opensearch.org/latest/im-plugin/data-streams/ parameters: - $ref: '#/components/parameters/_global___query.pretty' - $ref: '#/components/parameters/_global___query.human' @@ -2223,7 +2229,7 @@ paths: x-version-added: '1.0' description: Provides statistics on operations happening in a data stream. externalDocs: - url: https://opensearch.org/docs/latest/im-plugin/data-streams/ + url: https://docs.opensearch.org/latest/im-plugin/data-streams/ parameters: - $ref: '#/components/parameters/_global___query.pretty' - $ref: '#/components/parameters/_global___query.human' @@ -2240,7 +2246,7 @@ paths: x-version-added: '1.0' description: Deletes a data stream. externalDocs: - url: https://opensearch.org/docs/latest/im-plugin/data-streams/ + url: https://docs.opensearch.org/latest/im-plugin/data-streams/ parameters: - $ref: '#/components/parameters/indices.delete_data_stream___path.name' - $ref: '#/components/parameters/_global___query.pretty' @@ -2257,7 +2263,7 @@ paths: x-version-added: '1.0' description: Returns data streams. externalDocs: - url: https://opensearch.org/docs/latest/im-plugin/data-streams/ + url: https://docs.opensearch.org/latest/im-plugin/data-streams/ parameters: - $ref: '#/components/parameters/indices.get_data_stream___path.name' - $ref: '#/components/parameters/_global___query.pretty' @@ -2274,7 +2280,7 @@ paths: x-version-added: '1.0' description: Creates or updates a data stream. externalDocs: - url: https://opensearch.org/docs/latest/im-plugin/data-streams/ + url: https://docs.opensearch.org/latest/im-plugin/data-streams/ parameters: - $ref: '#/components/parameters/indices.create_data_stream___path.name' - $ref: '#/components/parameters/_global___query.pretty' @@ -2294,7 +2300,7 @@ paths: x-version-added: '1.0' description: Provides statistics on operations happening in a data stream. externalDocs: - url: https://opensearch.org/docs/latest/im-plugin/data-streams/ + url: https://docs.opensearch.org/latest/im-plugin/data-streams/ parameters: - $ref: '#/components/parameters/indices.data_streams_stats___path.name' - $ref: '#/components/parameters/_global___query.pretty' @@ -2312,7 +2318,7 @@ paths: x-version-added: '1.0' description: Changes the number of requests per second for a particular Delete By Query operation. externalDocs: - url: https://opensearch.org/docs/latest + url: https://docs.opensearch.org/latest/ parameters: - $ref: '#/components/parameters/delete_by_query_rethrottle___path.task_id' - $ref: '#/components/parameters/delete_by_query_rethrottle___query.requests_per_second' @@ -2331,7 +2337,7 @@ paths: x-version-added: '1.0' description: Returns the information about the capabilities of fields among multiple indexes. externalDocs: - url: https://opensearch.org/docs/latest/field-types/supported-field-types/alias/#using-aliases-in-field-capabilities-api-operations + url: https://docs.opensearch.org/latest/mappings/supported-field-types/alias/#using-aliases-in-field-capabilities-api-operations parameters: - $ref: '#/components/parameters/field_caps___query.allow_no_indices' - $ref: '#/components/parameters/field_caps___query.expand_wildcards' @@ -2354,7 +2360,7 @@ paths: x-version-added: '1.0' description: Returns the information about the capabilities of fields among multiple indexes. externalDocs: - url: https://opensearch.org/docs/latest/field-types/supported-field-types/alias/#using-aliases-in-field-capabilities-api-operations + url: https://docs.opensearch.org/latest/mappings/supported-field-types/alias/#using-aliases-in-field-capabilities-api-operations parameters: - $ref: '#/components/parameters/field_caps___query.allow_no_indices' - $ref: '#/components/parameters/field_caps___query.expand_wildcards' @@ -2378,7 +2384,7 @@ paths: x-version-added: '1.0' description: Performs the flush operation on one or more indexes. externalDocs: - url: https://opensearch.org/docs/latest + url: https://docs.opensearch.org/latest/ parameters: - $ref: '#/components/parameters/indices.flush___query.allow_no_indices' - $ref: '#/components/parameters/indices.flush___query.expand_wildcards' @@ -2399,7 +2405,7 @@ paths: x-version-added: '1.0' description: Performs the flush operation on one or more indexes. externalDocs: - url: https://opensearch.org/docs/latest + url: https://docs.opensearch.org/latest/ parameters: - $ref: '#/components/parameters/indices.flush___query.allow_no_indices' - $ref: '#/components/parameters/indices.flush___query.expand_wildcards' @@ -2424,7 +2430,7 @@ paths: - amazon-serverless description: Performs the force merge operation on one or more indexes. externalDocs: - url: https://opensearch.org/docs/latest + url: https://docs.opensearch.org/latest/ parameters: - $ref: '#/components/parameters/indices.forcemerge___query.allow_no_indices' - $ref: '#/components/parameters/indices.forcemerge___query.expand_wildcards' @@ -2449,7 +2455,7 @@ paths: x-version-added: '1.0' description: Returns an index template. externalDocs: - url: https://opensearch.org/docs/latest/im-plugin/index-templates/ + url: https://docs.opensearch.org/latest/im-plugin/index-templates/ parameters: - $ref: '#/components/parameters/indices.get_index_template___query.cluster_manager_timeout' - $ref: '#/components/parameters/indices.get_index_template___query.flat_settings' @@ -2470,7 +2476,7 @@ paths: x-version-added: '1.0' description: Simulate resolving the given template name or body. externalDocs: - url: https://opensearch.org/docs/latest + url: https://docs.opensearch.org/latest/ parameters: - $ref: '#/components/parameters/indices.simulate_template___query.cause' - $ref: '#/components/parameters/indices.simulate_template___query.cluster_manager_timeout' @@ -2493,7 +2499,7 @@ paths: x-version-added: '1.0' description: Simulate matching the given index name against the index templates in the system. externalDocs: - url: https://opensearch.org/docs/latest + url: https://docs.opensearch.org/latest/ parameters: - $ref: '#/components/parameters/indices.simulate_index_template___path.name' - $ref: '#/components/parameters/indices.simulate_index_template___query.cluster_manager_timeout' @@ -2515,7 +2521,7 @@ paths: x-version-added: '1.0' description: Simulate resolving the given template name or body. externalDocs: - url: https://opensearch.org/docs/latest + url: https://docs.opensearch.org/latest/ parameters: - $ref: '#/components/parameters/indices.simulate_template___path.name' - $ref: '#/components/parameters/indices.simulate_template___query.cause' @@ -2539,7 +2545,7 @@ paths: x-version-added: '1.0' description: Deletes an index template. externalDocs: - url: https://opensearch.org/docs/latest/im-plugin/index-templates/#delete-a-template + url: https://docs.opensearch.org/latest/im-plugin/index-templates/#delete-a-template parameters: - $ref: '#/components/parameters/indices.delete_index_template___path.name' - $ref: '#/components/parameters/indices.delete_index_template___query.cluster_manager_timeout' @@ -2559,7 +2565,7 @@ paths: x-version-added: '1.0' description: Returns an index template. externalDocs: - url: https://opensearch.org/docs/latest/im-plugin/index-templates/ + url: https://docs.opensearch.org/latest/im-plugin/index-templates/ parameters: - $ref: '#/components/parameters/indices.get_index_template___path.name' - $ref: '#/components/parameters/indices.get_index_template___query.cluster_manager_timeout' @@ -2580,7 +2586,7 @@ paths: x-version-added: '1.0' description: Returns information about whether a particular index template exists. externalDocs: - url: https://opensearch.org/docs/latest/im-plugin/index-templates/ + url: https://docs.opensearch.org/latest/im-plugin/index-templates/ parameters: - $ref: '#/components/parameters/indices.exists_index_template___path.name' - $ref: '#/components/parameters/indices.exists_index_template___query.cluster_manager_timeout' @@ -2601,7 +2607,7 @@ paths: x-version-added: '1.0' description: Creates or updates an index template. externalDocs: - url: https://opensearch.org/docs/latest/im-plugin/index-templates/ + url: https://docs.opensearch.org/latest/im-plugin/index-templates/ parameters: - $ref: '#/components/parameters/indices.put_index_template___path.name' - $ref: '#/components/parameters/indices.put_index_template___query.cause' @@ -2624,7 +2630,7 @@ paths: x-version-added: '1.0' description: Creates or updates an index template. externalDocs: - url: https://opensearch.org/docs/latest/im-plugin/index-templates/ + url: https://docs.opensearch.org/latest/im-plugin/index-templates/ parameters: - $ref: '#/components/parameters/indices.put_index_template___path.name' - $ref: '#/components/parameters/indices.put_index_template___query.cause' @@ -2648,7 +2654,7 @@ paths: x-version-added: '1.0' description: Returns an ingest pipeline. externalDocs: - url: https://opensearch.org/docs/latest/api-reference/ingest-apis/get-ingest/ + url: https://docs.opensearch.org/latest/api-reference/ingest-apis/get-ingest/ parameters: - $ref: '#/components/parameters/ingest.get_pipeline___query.cluster_manager_timeout' - $ref: '#/components/parameters/ingest.get_pipeline___query.master_timeout' @@ -2667,7 +2673,7 @@ paths: x-version-added: '1.0' description: Simulates an ingest pipeline with example documents. externalDocs: - url: https://opensearch.org/docs/latest/api-reference/ingest-apis/simulate-ingest/ + url: https://docs.opensearch.org/latest/api-reference/ingest-apis/simulate-ingest/ parameters: - $ref: '#/components/parameters/ingest.simulate___query.verbose' - $ref: '#/components/parameters/_global___query.pretty' @@ -2686,7 +2692,7 @@ paths: x-version-added: '1.0' description: Simulates an ingest pipeline with example documents. externalDocs: - url: https://opensearch.org/docs/latest/api-reference/ingest-apis/simulate-ingest/ + url: https://docs.opensearch.org/latest/api-reference/ingest-apis/simulate-ingest/ parameters: - $ref: '#/components/parameters/ingest.simulate___query.verbose' - $ref: '#/components/parameters/_global___query.pretty' @@ -2706,7 +2712,7 @@ paths: x-version-added: '1.0' description: Deletes an ingest pipeline. externalDocs: - url: https://opensearch.org/docs/latest/api-reference/ingest-apis/delete-ingest/ + url: https://docs.opensearch.org/latest/api-reference/ingest-apis/delete-ingest/ parameters: - $ref: '#/components/parameters/ingest.delete_pipeline___path.id' - $ref: '#/components/parameters/ingest.delete_pipeline___query.cluster_manager_timeout' @@ -2726,7 +2732,7 @@ paths: x-version-added: '1.0' description: Returns an ingest pipeline. externalDocs: - url: https://opensearch.org/docs/latest/api-reference/ingest-apis/get-ingest/ + url: https://docs.opensearch.org/latest/api-reference/ingest-apis/get-ingest/ parameters: - $ref: '#/components/parameters/ingest.get_pipeline___path.id' - $ref: '#/components/parameters/ingest.get_pipeline___query.cluster_manager_timeout' @@ -2768,7 +2774,7 @@ paths: x-version-added: '1.0' description: Simulates an ingest pipeline with example documents. externalDocs: - url: https://opensearch.org/docs/latest/api-reference/ingest-apis/simulate-ingest/ + url: https://docs.opensearch.org/latest/api-reference/ingest-apis/simulate-ingest/ parameters: - $ref: '#/components/parameters/ingest.simulate___path.id' - $ref: '#/components/parameters/ingest.simulate___query.verbose' @@ -2788,7 +2794,7 @@ paths: x-version-added: '1.0' description: Simulates an ingest pipeline with example documents. externalDocs: - url: https://opensearch.org/docs/latest/api-reference/ingest-apis/simulate-ingest/ + url: https://docs.opensearch.org/latest/api-reference/ingest-apis/simulate-ingest/ parameters: - $ref: '#/components/parameters/ingest.simulate___path.id' - $ref: '#/components/parameters/ingest.simulate___query.verbose' @@ -2809,7 +2815,7 @@ paths: x-version-added: '1.0' description: Returns a list of built-in grok patterns. externalDocs: - url: https://opensearch.org/docs/latest + url: https://docs.opensearch.org/latest/ parameters: - $ref: '#/components/parameters/ingest.processor_grok___query.s' - $ref: '#/components/parameters/_global___query.pretty' @@ -2843,7 +2849,7 @@ paths: x-version-added: '2.18' description: Returns help for the List APIs. externalDocs: - url: https://opensearch.org/docs/latest/api-reference/list/index/ + url: https://docs.opensearch.org/latest/api-reference/list/index/ responses: '200': $ref: '#/components/responses/list.help___200' @@ -2860,7 +2866,7 @@ paths: x-version-added: '2.18' description: Returns paginated information about indexes including number of primaries and replicas, document counts, disk size. externalDocs: - url: https://opensearch.org/docs/latest/api-reference/list/list-indices/ + url: https://docs.opensearch.org/latest/api-reference/list/list-indices/ parameters: - $ref: '#/components/parameters/list.indices___query.bytes' - $ref: '#/components/parameters/list.indices___query.cluster_manager_timeout' @@ -2894,7 +2900,7 @@ paths: x-version-added: '2.18' description: Returns paginated information about indexes including number of primaries and replicas, document counts, disk size. externalDocs: - url: https://opensearch.org/docs/latest/api-reference/list/list-indices/ + url: https://docs.opensearch.org/latest/api-reference/list/list-indices/ parameters: - $ref: '#/components/parameters/list.indices___path.index' - $ref: '#/components/parameters/list.indices___query.bytes' @@ -2929,7 +2935,7 @@ paths: x-version-added: '2.18' description: Returns paginated details of shard allocation on nodes. externalDocs: - url: https://opensearch.org/docs/latest/api-reference/list/list-shards/ + url: https://docs.opensearch.org/latest/api-reference/list/list-shards/ parameters: - $ref: '#/components/parameters/list.shards___query.bytes' - $ref: '#/components/parameters/list.shards___query.cluster_manager_timeout' @@ -2959,7 +2965,7 @@ paths: x-version-added: '2.18' description: Returns paginated details of shard allocation on nodes. externalDocs: - url: https://opensearch.org/docs/latest/api-reference/list/list-shards/ + url: https://docs.opensearch.org/latest/api-reference/list/list-shards/ parameters: - $ref: '#/components/parameters/list.shards___path.index' - $ref: '#/components/parameters/list.shards___query.bytes' @@ -3842,7 +3848,7 @@ paths: x-version-added: '1.0' description: Returns mappings for one or more indexes. externalDocs: - url: https://opensearch.org/docs/latest/field-types/index/#get-a-mapping + url: https://docs.opensearch.org/latest/api-reference/index-apis/get-mapping/ parameters: - $ref: '#/components/parameters/indices.get_mapping___query.allow_no_indices' - $ref: '#/components/parameters/indices.get_mapping___query.cluster_manager_timeout' @@ -3866,7 +3872,7 @@ paths: x-version-added: '1.0' description: Returns mapping for one or more fields. externalDocs: - url: https://opensearch.org/docs/latest/field-types/index/ + url: https://docs.opensearch.org/latest/field-types/index/ parameters: - $ref: '#/components/parameters/indices.get_field_mapping___path.fields' - $ref: '#/components/parameters/indices.get_field_mapping___query.allow_no_indices' @@ -3889,7 +3895,7 @@ paths: x-version-added: '1.0' description: Allows to get multiple documents in one request. externalDocs: - url: https://opensearch.org/docs/latest/api-reference/document-apis/multi-get/ + url: https://docs.opensearch.org/latest/api-reference/document-apis/multi-get/ parameters: - $ref: '#/components/parameters/mget___query._source' - $ref: '#/components/parameters/mget___query._source_excludes' @@ -3915,7 +3921,7 @@ paths: x-version-added: '1.0' description: Allows to get multiple documents in one request. externalDocs: - url: https://opensearch.org/docs/latest/api-reference/document-apis/multi-get/ + url: https://docs.opensearch.org/latest/api-reference/document-apis/multi-get/ parameters: - $ref: '#/components/parameters/mget___query._source' - $ref: '#/components/parameters/mget___query._source_excludes' @@ -3942,7 +3948,7 @@ paths: x-version-added: '1.0' description: Allows to execute several search operations in one request. externalDocs: - url: https://opensearch.org/docs/latest/api-reference/multi-search/ + url: https://docs.opensearch.org/latest/api-reference/multi-search/ parameters: - $ref: '#/components/parameters/msearch___query.allow_partial_results' - $ref: '#/components/parameters/msearch___query.ccs_minimize_roundtrips' @@ -3968,7 +3974,7 @@ paths: x-version-added: '1.0' description: Allows to execute several search operations in one request. externalDocs: - url: https://opensearch.org/docs/latest/api-reference/multi-search/ + url: https://docs.opensearch.org/latest/api-reference/multi-search/ parameters: - $ref: '#/components/parameters/msearch___query.allow_partial_results' - $ref: '#/components/parameters/msearch___query.ccs_minimize_roundtrips' @@ -3995,7 +4001,7 @@ paths: x-version-added: '1.0' description: Allows to execute several search template operations in one request. externalDocs: - url: https://opensearch.org/docs/latest/search-plugins/search-template/ + url: https://docs.opensearch.org/latest/search-plugins/search-template/ parameters: - $ref: '#/components/parameters/msearch_template___query.ccs_minimize_roundtrips' - $ref: '#/components/parameters/msearch_template___query.max_concurrent_searches' @@ -4018,7 +4024,7 @@ paths: x-version-added: '1.0' description: Allows to execute several search template operations in one request. externalDocs: - url: https://opensearch.org/docs/latest/search-plugins/search-template/ + url: https://docs.opensearch.org/latest/search-plugins/search-template/ parameters: - $ref: '#/components/parameters/msearch_template___query.ccs_minimize_roundtrips' - $ref: '#/components/parameters/msearch_template___query.max_concurrent_searches' @@ -4042,7 +4048,7 @@ paths: x-version-added: '1.0' description: Returns multiple termvectors in one request. externalDocs: - url: https://opensearch.org/docs/latest + url: https://docs.opensearch.org/latest/ parameters: - $ref: '#/components/parameters/mtermvectors___query.field_statistics' - $ref: '#/components/parameters/mtermvectors___query.fields' @@ -4072,7 +4078,7 @@ paths: x-version-added: '1.0' description: Returns multiple termvectors in one request. externalDocs: - url: https://opensearch.org/docs/latest + url: https://docs.opensearch.org/latest/ parameters: - $ref: '#/components/parameters/mtermvectors___query.field_statistics' - $ref: '#/components/parameters/mtermvectors___query.fields' @@ -4103,7 +4109,7 @@ paths: x-version-added: '1.0' description: Returns information about nodes in the cluster. externalDocs: - url: https://opensearch.org/docs/latest/api-reference/nodes-apis/nodes-info/ + url: https://docs.opensearch.org/latest/api-reference/nodes-apis/nodes-info/ parameters: - $ref: '#/components/parameters/nodes.info___query.flat_settings' - $ref: '#/components/parameters/nodes.info___query.timeout' @@ -4122,7 +4128,7 @@ paths: x-version-added: '1.0' description: Returns information about nodes in the cluster. externalDocs: - url: https://opensearch.org/docs/latest/api-reference/nodes-apis/nodes-info/ + url: https://docs.opensearch.org/latest/api-reference/nodes-apis/nodes-info/ parameters: - $ref: '#/components/parameters/nodes.info___path.node_id_or_metric' - $ref: '#/components/parameters/nodes.info___query.flat_settings' @@ -4142,7 +4148,7 @@ paths: x-version-added: '1.0' description: Returns information about nodes in the cluster. externalDocs: - url: https://opensearch.org/docs/latest/api-reference/nodes-apis/nodes-info/ + url: https://docs.opensearch.org/latest/api-reference/nodes-apis/nodes-info/ parameters: - $ref: '#/components/parameters/nodes.info___path.metric' - $ref: '#/components/parameters/nodes.info___path.node_id' @@ -4163,7 +4169,7 @@ paths: x-version-added: '1.0' description: Returns information about hot threads on each node in the cluster. externalDocs: - url: https://opensearch.org/docs/latest/api-reference/nodes-apis/nodes-hot-threads/ + url: https://docs.opensearch.org/latest/api-reference/nodes-apis/nodes-hot-threads/ parameters: - $ref: '#/components/parameters/nodes.hot_threads___path.node_id' - $ref: '#/components/parameters/nodes.hot_threads___query.ignore_idle_threads' @@ -4187,7 +4193,7 @@ paths: x-version-added: '1.0' description: Reloads secure settings. externalDocs: - url: https://opensearch.org/docs/latest/api-reference/nodes-apis/nodes-reload-secure/ + url: https://docs.opensearch.org/latest/api-reference/nodes-apis/nodes-reload-secure/ parameters: - $ref: '#/components/parameters/nodes.reload_secure_settings___path.node_id' - $ref: '#/components/parameters/nodes.reload_secure_settings___query.timeout' @@ -4208,7 +4214,7 @@ paths: x-version-added: '1.0' description: Returns statistical information about nodes in the cluster. externalDocs: - url: https://opensearch.org/docs/latest/api-reference/nodes-apis/nodes-usage/ + url: https://docs.opensearch.org/latest/api-reference/nodes-apis/nodes-usage/ parameters: - $ref: '#/components/parameters/nodes.stats___path.node_id' - $ref: '#/components/parameters/nodes.stats___query.completion_fields' @@ -4234,7 +4240,7 @@ paths: x-version-added: '1.0' description: Returns statistical information about nodes in the cluster. externalDocs: - url: https://opensearch.org/docs/latest/api-reference/nodes-apis/nodes-usage/ + url: https://docs.opensearch.org/latest/api-reference/nodes-apis/nodes-usage/ parameters: - $ref: '#/components/parameters/nodes.stats___path.metric' - $ref: '#/components/parameters/nodes.stats___path.node_id' @@ -4261,7 +4267,7 @@ paths: x-version-added: '1.0' description: Returns statistical information about nodes in the cluster. externalDocs: - url: https://opensearch.org/docs/latest/api-reference/nodes-apis/nodes-usage/ + url: https://docs.opensearch.org/latest/api-reference/nodes-apis/nodes-usage/ parameters: - $ref: '#/components/parameters/nodes.stats___path.index_metric' - $ref: '#/components/parameters/nodes.stats___path.metric' @@ -4289,7 +4295,7 @@ paths: x-version-added: '1.0' description: Returns low-level information about REST actions usage on nodes. externalDocs: - url: https://opensearch.org/docs/latest + url: https://docs.opensearch.org/latest/ parameters: - $ref: '#/components/parameters/nodes.usage___path.node_id' - $ref: '#/components/parameters/nodes.usage___query.timeout' @@ -4308,7 +4314,7 @@ paths: x-version-added: '1.0' description: Returns low-level information about REST actions usage on nodes. externalDocs: - url: https://opensearch.org/docs/latest + url: https://docs.opensearch.org/latest/ parameters: - $ref: '#/components/parameters/nodes.usage___path.metric' - $ref: '#/components/parameters/nodes.usage___path.node_id' @@ -4328,7 +4334,7 @@ paths: x-version-added: '1.0' description: Returns information about hot threads on each node in the cluster. externalDocs: - url: https://opensearch.org/docs/latest/api-reference/nodes-apis/nodes-hot-threads/ + url: https://docs.opensearch.org/latest/api-reference/nodes-apis/nodes-hot-threads/ parameters: - $ref: '#/components/parameters/nodes.hot_threads___query.ignore_idle_threads' - $ref: '#/components/parameters/nodes.hot_threads___query.interval' @@ -4351,7 +4357,7 @@ paths: x-version-added: '1.0' description: Reloads secure settings. externalDocs: - url: https://opensearch.org/docs/latest/api-reference/nodes-apis/nodes-reload-secure/ + url: https://docs.opensearch.org/latest/api-reference/nodes-apis/nodes-reload-secure/ parameters: - $ref: '#/components/parameters/nodes.reload_secure_settings___query.timeout' - $ref: '#/components/parameters/_global___query.pretty' @@ -4371,7 +4377,7 @@ paths: x-version-added: '1.0' description: Returns statistical information about nodes in the cluster. externalDocs: - url: https://opensearch.org/docs/latest/api-reference/nodes-apis/nodes-usage/ + url: https://docs.opensearch.org/latest/api-reference/nodes-apis/nodes-usage/ parameters: - $ref: '#/components/parameters/nodes.stats___query.completion_fields' - $ref: '#/components/parameters/nodes.stats___query.fielddata_fields' @@ -4396,7 +4402,7 @@ paths: x-version-added: '1.0' description: Returns statistical information about nodes in the cluster. externalDocs: - url: https://opensearch.org/docs/latest/api-reference/nodes-apis/nodes-usage/ + url: https://docs.opensearch.org/latest/api-reference/nodes-apis/nodes-usage/ parameters: - $ref: '#/components/parameters/nodes.stats___path.metric' - $ref: '#/components/parameters/nodes.stats___query.completion_fields' @@ -4422,7 +4428,7 @@ paths: x-version-added: '1.0' description: Returns statistical information about nodes in the cluster. externalDocs: - url: https://opensearch.org/docs/latest/api-reference/nodes-apis/nodes-usage/ + url: https://docs.opensearch.org/latest/api-reference/nodes-apis/nodes-usage/ parameters: - $ref: '#/components/parameters/nodes.stats___path.index_metric' - $ref: '#/components/parameters/nodes.stats___path.metric' @@ -4449,7 +4455,7 @@ paths: x-version-added: '1.0' description: Returns low-level information about REST actions usage on nodes. externalDocs: - url: https://opensearch.org/docs/latest + url: https://docs.opensearch.org/latest/ parameters: - $ref: '#/components/parameters/nodes.usage___query.timeout' - $ref: '#/components/parameters/_global___query.pretty' @@ -4467,7 +4473,7 @@ paths: x-version-added: '1.0' description: Returns low-level information about REST actions usage on nodes. externalDocs: - url: https://opensearch.org/docs/latest + url: https://docs.opensearch.org/latest/ parameters: - $ref: '#/components/parameters/nodes.usage___path.metric' - $ref: '#/components/parameters/nodes.usage___query.timeout' @@ -4504,7 +4510,7 @@ paths: x-version-added: '1.0' description: Performs an asynchronous search. externalDocs: - url: https://opensearch.org/docs/latest/search-plugins/async/index/#rest-api + url: https://docs.opensearch.org/latest/search-plugins/async/index/#rest-api parameters: - $ref: '#/components/parameters/asynchronous_search.search___query.index' - $ref: '#/components/parameters/asynchronous_search.search___query.keep_alive' @@ -4527,7 +4533,7 @@ paths: x-version-added: '1.0' description: Deletes any responses from an asynchronous search. externalDocs: - url: https://opensearch.org/docs/latest/search-plugins/async/index/#delete-searches-and-results + url: https://docs.opensearch.org/latest/search-plugins/async/index/#delete-searches-and-results parameters: - $ref: '#/components/parameters/asynchronous_search.delete___path.id' - $ref: '#/components/parameters/_global___query.pretty' @@ -4544,7 +4550,7 @@ paths: x-version-added: '1.0' description: Gets partial responses from an asynchronous search. externalDocs: - url: https://opensearch.org/docs/latest/search-plugins/async/index/#get-partial-results + url: https://docs.opensearch.org/latest/search-plugins/async/index/#get-partial-results parameters: - $ref: '#/components/parameters/asynchronous_search.get___path.id' - $ref: '#/components/parameters/_global___query.pretty' @@ -4562,7 +4568,7 @@ paths: x-version-added: '1.0' description: Monitors any asynchronous searches that are `running`, `completed`, or `persisted`. externalDocs: - url: https://opensearch.org/docs/latest/search-plugins/async/index/#monitor-stats + url: https://docs.opensearch.org/latest/search-plugins/async/index/#monitor-stats responses: '200': $ref: '#/components/responses/asynchronous_search.stats___200' @@ -4579,7 +4585,7 @@ paths: x-version-added: '2.12' description: Creates a new workflow template. externalDocs: - url: https://opensearch.org/docs/latest/automating-configurations/api/create-workflow/ + url: https://docs.opensearch.org/latest/automating-configurations/api/create-workflow/ parameters: - $ref: '#/components/parameters/flow_framework.create___query.provision' - $ref: '#/components/parameters/flow_framework.create___query.reprovision' @@ -4609,7 +4615,7 @@ paths: x-version-added: '2.12' description: Search for workflows by using a query matching a field. externalDocs: - url: https://opensearch.org/docs/latest/automating-configurations/api/provision-workflow/ + url: https://docs.opensearch.org/latest/automating-configurations/api/provision-workflow/ requestBody: $ref: '#/components/requestBodies/flow_framework.search' responses: @@ -4633,7 +4639,7 @@ paths: x-version-added: '2.12' description: Search for workflows by using a query matching a field. externalDocs: - url: https://opensearch.org/docs/latest/automating-configurations/api/provision-workflow/ + url: https://docs.opensearch.org/latest/automating-configurations/api/provision-workflow/ requestBody: $ref: '#/components/requestBodies/flow_framework.search' responses: @@ -4658,7 +4664,7 @@ paths: x-version-added: '2.12' description: Retrieves available workflow steps. externalDocs: - url: https://opensearch.org/docs/latest/automating-configurations/api/get-workflow-steps/ + url: https://docs.opensearch.org/latest/automating-configurations/api/get-workflow-steps/ parameters: - $ref: '#/components/parameters/flow_framework.get_steps___query.workflow_step' - $ref: '#/components/parameters/_global___query.pretty' @@ -4680,7 +4686,7 @@ paths: x-version-added: '2.12' description: Deletes a workflow template. externalDocs: - url: https://opensearch.org/docs/latest/automating-configurations/api/delete-workflow/ + url: https://docs.opensearch.org/latest/automating-configurations/api/delete-workflow/ parameters: - $ref: '#/components/parameters/flow_framework.delete___path.workflow_id' - $ref: '#/components/parameters/flow_framework.delete___query.clear_status' @@ -4701,7 +4707,7 @@ paths: x-operation-group: flow_framework.get x-version-added: '2.12' externalDocs: - url: https://opensearch.org/docs/latest/automating-configurations/api/get-workflow/ + url: https://docs.opensearch.org/latest/automating-configurations/api/get-workflow/ description: Retrieves a workflow template. parameters: - $ref: '#/components/parameters/flow_framework.get___path.workflow_id' @@ -4721,7 +4727,7 @@ paths: x-version-added: '2.12' description: Updates a workflow template that has not been provisioned. externalDocs: - url: https://opensearch.org/docs/latest/automating-configurations/api/create-workflow/ + url: https://docs.opensearch.org/latest/automating-configurations/api/create-workflow/ parameters: - $ref: '#/components/parameters/flow_framework.update___path.workflow_id' - $ref: '#/components/parameters/flow_framework.update___query.provision' @@ -4751,7 +4757,7 @@ paths: x-version-added: '2.12' description: Deprovision workflow's resources when you no longer need them. externalDocs: - url: https://opensearch.org/docs/latest/automating-configurations/api/deprovision-workflow/ + url: https://docs.opensearch.org/latest/automating-configurations/api/deprovision-workflow/ parameters: - $ref: '#/components/parameters/flow_framework.deprovision___path.workflow_id' - $ref: '#/components/parameters/flow_framework.deprovision___query.allow_delete' @@ -4776,7 +4782,7 @@ paths: x-version-added: '2.12' description: Provisioning a workflow. This API is also executed when the Create or Update Workflow API is called with the provision parameter set to true. externalDocs: - url: https://opensearch.org/docs/latest/automating-configurations/api/provision-workflow/ + url: https://docs.opensearch.org/latest/automating-configurations/api/provision-workflow/ parameters: - $ref: '#/components/parameters/flow_framework.provision___path.workflow_id' - $ref: '#/components/parameters/_global___query.pretty' @@ -4806,7 +4812,7 @@ paths: x-version-added: '2.12' description: Retrieves the current workflow provisioning status. externalDocs: - url: https://opensearch.org/docs/latest/automating-configurations/api/get-workflow-status/ + url: https://docs.opensearch.org/latest/automating-configurations/api/get-workflow-status/ parameters: - $ref: '#/components/parameters/flow_framework.get_status___path.workflow_id' - $ref: '#/components/parameters/flow_framework.get_status___query.all' @@ -4829,7 +4835,7 @@ paths: x-version-added: '2.12' description: Search for workflows by using a query matching a field. externalDocs: - url: https://opensearch.org/docs/latest/automating-configurations/api/search-workflow-state/ + url: https://docs.opensearch.org/latest/automating-configurations/api/search-workflow-state/ requestBody: $ref: '#/components/requestBodies/flow_framework.search_state' responses: @@ -4853,7 +4859,7 @@ paths: x-version-added: '2.12' description: Search for workflows by using a query matching a field. externalDocs: - url: https://opensearch.org/docs/latest/automating-configurations/api/search-workflow-state/ + url: https://docs.opensearch.org/latest/automating-configurations/api/search-workflow-state/ requestBody: $ref: '#/components/requestBodies/flow_framework.search_state' responses: @@ -4877,7 +4883,7 @@ paths: x-operation-group: ism.add_policy description: Adds a policy to an index. externalDocs: - url: https://opensearch.org/docs/latest/im-plugin/ism/api/#add-policy + url: https://docs.opensearch.org/latest/im-plugin/ism/api/#add-policy parameters: - $ref: '#/components/parameters/ism.add_policy___query.index' - $ref: '#/components/parameters/_global___query.pretty' @@ -4896,7 +4902,7 @@ paths: x-operation-group: ism.add_policy description: Adds a policy to an index. externalDocs: - url: https://opensearch.org/docs/latest/im-plugin/ism/api/#add-policy + url: https://docs.opensearch.org/latest/im-plugin/ism/api/#add-policy parameters: - $ref: '#/components/parameters/ism.add_policy___path.index' - $ref: '#/components/parameters/ism.add_policy___query.index' @@ -4916,7 +4922,7 @@ paths: x-operation-group: ism.change_policy description: Updates the managed index policy to a new policy. externalDocs: - url: https://opensearch.org/docs/latest/im-plugin/ism/api/#update-managed-index-policy + url: https://docs.opensearch.org/latest/im-plugin/ism/api/#update-managed-index-policy parameters: - $ref: '#/components/parameters/ism.change_policy___query.index' - $ref: '#/components/parameters/_global___query.pretty' @@ -4935,7 +4941,7 @@ paths: x-operation-group: ism.change_policy description: Updates the managed index policy to a new policy. externalDocs: - url: https://opensearch.org/docs/latest/im-plugin/ism/api/#update-managed-index-policy + url: https://docs.opensearch.org/latest/im-plugin/ism/api/#update-managed-index-policy parameters: - $ref: '#/components/parameters/ism.change_policy___path.index' - $ref: '#/components/parameters/ism.change_policy___query.index' @@ -4955,7 +4961,7 @@ paths: x-operation-group: ism.explain_policy description: Retrieves the currently applied policy on the specified indexes. externalDocs: - url: https://opensearch.org/docs/latest/im-plugin/ism/api/#explain-index + url: https://docs.opensearch.org/latest/im-plugin/ism/api/#explain-index requestBody: $ref: '#/components/requestBodies/ism.explain_policy' responses: @@ -4972,7 +4978,7 @@ paths: x-operation-group: ism.explain_policy description: Retrieves the currently applied policy on the specified indexes. externalDocs: - url: https://opensearch.org/docs/latest/im-plugin/ism/api/#explain-index + url: https://docs.opensearch.org/latest/im-plugin/ism/api/#explain-index requestBody: $ref: '#/components/requestBodies/ism.explain_policy' responses: @@ -4990,7 +4996,7 @@ paths: x-operation-group: ism.explain_policy description: Retrieves the currently applied policy on the specified indexes. externalDocs: - url: https://opensearch.org/docs/latest/im-plugin/ism/api/#explain-index + url: https://docs.opensearch.org/latest/im-plugin/ism/api/#explain-index parameters: - $ref: '#/components/parameters/ism.explain_policy___path.index' - $ref: '#/components/parameters/_global___query.pretty' @@ -5008,7 +5014,7 @@ paths: x-operation-group: ism.explain_policy description: Retrieves the currently applied policy on the specified indexes. externalDocs: - url: https://opensearch.org/docs/latest/im-plugin/ism/api/#explain-index + url: https://docs.opensearch.org/latest/im-plugin/ism/api/#explain-index parameters: - $ref: '#/components/parameters/ism.explain_policy___path.index' - $ref: '#/components/parameters/_global___query.pretty' @@ -5027,7 +5033,7 @@ paths: x-operation-group: ism.get_policies description: Retrieves the policies. externalDocs: - url: https://opensearch.org/docs/latest/im-plugin/ism/api/#get-policy + url: https://docs.opensearch.org/latest/im-plugin/ism/api/#get-policy responses: '200': $ref: '#/components/responses/ism.get_policies___200' @@ -5042,7 +5048,7 @@ paths: x-operation-group: ism.put_policies description: Creates or updates policies. externalDocs: - url: https://opensearch.org/docs/latest/im-plugin/ism/api/#create-policy + url: https://docs.opensearch.org/latest/im-plugin/ism/api/#create-policy requestBody: $ref: '#/components/requestBodies/ism.put_policies' parameters: @@ -5063,7 +5069,7 @@ paths: x-operation-group: ism.delete_policy description: Deletes a policy. externalDocs: - url: https://opensearch.org/docs/latest/im-plugin/ism/api/#delete-policy + url: https://docs.opensearch.org/latest/im-plugin/ism/api/#delete-policy parameters: - $ref: '#/components/parameters/ism.delete_policy___path.policy_id' - $ref: '#/components/parameters/_global___query.pretty' @@ -5079,7 +5085,7 @@ paths: x-operation-group: ism.get_policy description: Retrieves a specific policy. externalDocs: - url: https://opensearch.org/docs/latest/im-plugin/ism/api/#put-policy + url: https://docs.opensearch.org/latest/im-plugin/ism/api/#get-policy parameters: - $ref: '#/components/parameters/ism.get_policy___path.policy_id' - $ref: '#/components/parameters/_global___query.pretty' @@ -5095,7 +5101,7 @@ paths: x-operation-group: ism.exists_policy description: Checks for the existence of a policy. externalDocs: - url: https://opensearch.org/docs/latest/im-plugin/ism/api/#get-policy + url: https://docs.opensearch.org/latest/im-plugin/ism/api/#get-policy parameters: - $ref: '#/components/parameters/ism.exists_policy___path.policy_id' - $ref: '#/components/parameters/_global___query.pretty' @@ -5113,7 +5119,7 @@ paths: x-operation-group: ism.put_policy description: Creates or updates a policy. externalDocs: - url: https://opensearch.org/docs/latest/im-plugin/ism/api/#create-policy + url: https://docs.opensearch.org/latest/im-plugin/ism/api/#create-policy parameters: - $ref: '#/components/parameters/ism.put_policy___path.policy_id' - $ref: '#/components/parameters/ism.put_policy___query.if_primary_term' @@ -5136,7 +5142,7 @@ paths: x-operation-group: ism.remove_policy description: Removes a policy from an index. externalDocs: - url: https://opensearch.org/docs/latest/im-plugin/ism/api/#remove-policy + url: https://docs.opensearch.org/latest/im-plugin/ism/api/#remove-policy-from-index parameters: - $ref: '#/components/parameters/ism.remove_policy___query.index' - $ref: '#/components/parameters/_global___query.pretty' @@ -5153,7 +5159,7 @@ paths: x-operation-group: ism.remove_policy description: Removes a policy from an index. externalDocs: - url: https://opensearch.org/docs/latest/im-plugin/ism/api/#remove-policy + url: https://docs.opensearch.org/latest/im-plugin/ism/api/#remove-policy-from-index parameters: - $ref: '#/components/parameters/ism.remove_policy___path.index' - $ref: '#/components/parameters/ism.remove_policy___query.index' @@ -5171,7 +5177,7 @@ paths: x-operation-group: ism.retry_index description: Retries the failed action for an index. externalDocs: - url: https://opensearch.org/docs/latest/im-plugin/ism/api/#retry-failed-index + url: https://docs.opensearch.org/latest/im-plugin/ism/api/#retry-failed-index parameters: - $ref: '#/components/parameters/ism.retry_index___query.index' - $ref: '#/components/parameters/_global___query.pretty' @@ -5190,7 +5196,7 @@ paths: x-operation-group: ism.retry_index description: Retries the failed action for an index. externalDocs: - url: https://opensearch.org/docs/latest/im-plugin/ism/api/#retry-failed-index + url: https://docs.opensearch.org/latest/im-plugin/ism/api/#retry-failed-index parameters: - $ref: '#/components/parameters/ism.retry_index___path.index' - $ref: '#/components/parameters/ism.retry_index___query.index' @@ -7164,7 +7170,7 @@ paths: x-version-added: '2.0' description: List created notification channels. externalDocs: - url: https://opensearch.org/docs/latest/observing-your-data/notifications/api/#list-all-notification-channels + url: https://docs.opensearch.org/latest/observing-your-data/notifications/api/#list-all-notification-channels responses: '200': $ref: '#/components/responses/notifications.list_channels___200' @@ -7181,7 +7187,7 @@ paths: x-version-added: '2.2' description: Delete multiple channel configurations. externalDocs: - url: https://opensearch.org/docs/latest/observing-your-data/notifications/api/#delete-channel-configuration + url: https://docs.opensearch.org/latest/observing-your-data/notifications/api/#delete-channel-configuration parameters: - $ref: '#/components/parameters/notifications.delete_configs___query.config_id' - $ref: '#/components/parameters/notifications.delete_configs___query.config_id_list' @@ -7199,7 +7205,7 @@ paths: x-version-added: '2.0' description: Get multiple channel configurations with filtering. externalDocs: - url: https://opensearch.org/docs/latest/observing-your-data/notifications/api/#list-all-notification-configurations + url: https://docs.opensearch.org/latest/observing-your-data/notifications/api/#list-all-notification-configurations parameters: - $ref: '#/components/parameters/notifications.get_configs___query.chime.url' - $ref: '#/components/parameters/notifications.get_configs___query.chime.url.keyword' @@ -7257,7 +7263,7 @@ paths: x-version-added: '2.0' description: Create channel configuration. externalDocs: - url: https://opensearch.org/docs/latest/observing-your-data/notifications/api/#create-channel-configuration + url: https://docs.opensearch.org/latest/observing-your-data/notifications/api/#create-channel-configuration requestBody: $ref: '#/components/requestBodies/notifications.create_config' responses: @@ -7276,7 +7282,7 @@ paths: x-version-added: '2.0' description: Delete a channel configuration. externalDocs: - url: https://opensearch.org/docs/latest/observing-your-data/notifications/api/#delete-channel-configuration + url: https://docs.opensearch.org/latest/observing-your-data/notifications/api/#delete-channel-configuration parameters: - $ref: '#/components/parameters/notifications.delete_config___path.config_id' - $ref: '#/components/parameters/_global___query.pretty' @@ -7308,7 +7314,7 @@ paths: x-version-added: '2.0' description: Update channel configuration. externalDocs: - url: https://opensearch.org/docs/latest/observing-your-data/notifications/api/#update-channel-configuration + url: https://docs.opensearch.org/latest/observing-your-data/notifications/api/#update-channel-configuration parameters: - $ref: '#/components/parameters/notifications.update_config___path.config_id' - $ref: '#/components/parameters/_global___query.pretty' @@ -7331,7 +7337,7 @@ paths: x-version-deprecated: '2.3' description: Send a test notification. externalDocs: - url: https://opensearch.org/docs/latest/observing-your-data/notifications/api/#send-test-notification + url: https://docs.opensearch.org/latest/observing-your-data/notifications/api/#send-test-notification parameters: - $ref: '#/components/parameters/notifications.send_test___path.config_id' - $ref: '#/components/parameters/_global___query.pretty' @@ -7348,7 +7354,7 @@ paths: x-version-added: '2.0' description: Send a test notification. externalDocs: - url: https://opensearch.org/docs/latest/observing-your-data/notifications/api/#send-test-notification + url: https://docs.opensearch.org/latest/observing-your-data/notifications/api/#send-test-notification parameters: - $ref: '#/components/parameters/notifications.send_test___path.config_id' - $ref: '#/components/parameters/_global___query.pretty' @@ -7366,7 +7372,7 @@ paths: x-version-added: '2.0' description: List supported channel configurations. externalDocs: - url: https://opensearch.org/docs/latest/observing-your-data/notifications/api/#list-supported-channel-configurations + url: https://docs.opensearch.org/latest/observing-your-data/notifications/api/#list-supported-channel-configurations responses: '200': $ref: '#/components/responses/notifications.list_features___200' @@ -7501,7 +7507,7 @@ paths: x-version-added: '1.0' description: Executes a PPL query against OpenSearch indexes. externalDocs: - url: https://opensearch.org/docs/latest/search-plugins/sql/sql-ppl-api/ + url: https://docs.opensearch.org/latest/search-plugins/sql/sql-ppl-api/ parameters: - $ref: '#/components/parameters/ppl.query___query.format' - $ref: '#/components/parameters/ppl.query___query.sanitize' @@ -7522,7 +7528,7 @@ paths: x-version-added: '1.0' description: Returns the execution plan for a PPL query. externalDocs: - url: https://opensearch.org/docs/latest/search-plugins/sql/sql-ppl-api/ + url: https://docs.opensearch.org/latest/search-plugins/sql/sql-ppl-api/ parameters: - $ref: '#/components/parameters/ppl.explain___query.format' - $ref: '#/components/parameters/ppl.explain___query.sanitize' @@ -7543,7 +7549,7 @@ paths: x-version-added: '1.0' description: Retrieves performance metrics for the PPL plugin. externalDocs: - url: https://opensearch.org/docs/latest/search-plugins/sql/monitoring/ + url: https://docs.opensearch.org/latest/search-plugins/sql/monitoring/ parameters: - $ref: '#/components/parameters/ppl.get_stats___query.format' - $ref: '#/components/parameters/ppl.get_stats___query.sanitize' @@ -7561,7 +7567,7 @@ paths: x-version-added: '1.0' description: Retrieves filtered performance metrics for the PPL plugin. externalDocs: - url: https://opensearch.org/docs/latest/search-plugins/sql/monitoring/ + url: https://docs.opensearch.org/latest/search-plugins/sql/monitoring/ parameters: - $ref: '#/components/parameters/ppl.post_stats___query.format' - $ref: '#/components/parameters/ppl.post_stats___query.sanitize' @@ -7666,7 +7672,7 @@ paths: x-version-added: '1.0' description: Updates SQL plugin settings in the OpenSearch cluster configuration. externalDocs: - url: https://opensearch.org/docs/latest/search-plugins/sql/settings/ + url: https://docs.opensearch.org/latest/search-plugins/sql/settings/ parameters: - $ref: '#/components/parameters/sql.settings___query.format' - $ref: '#/components/parameters/_global___query.pretty' @@ -7685,7 +7691,7 @@ paths: x-operation-group: ism.refresh_search_analyzers description: Refreshes search analyzers in real time. externalDocs: - url: https://opensearch.org/docs/latest/im-plugin/refresh-analyzer/ + url: https://docs.opensearch.org/latest/im-plugin/refresh-analyzer/ parameters: - $ref: '#/components/parameters/ism.refresh_search_analyzers___path.index' - $ref: '#/components/parameters/_global___query.pretty' @@ -7703,7 +7709,7 @@ paths: x-version-added: '1.1' description: Deletes the specified replication rule. externalDocs: - url: https://opensearch.org/docs/latest/tuning-your-cluster/replication-plugin/api/#delete-replication-rule + url: https://docs.opensearch.org/latest/tuning-your-cluster/replication-plugin/api/#delete-replication-rule requestBody: $ref: '#/components/requestBodies/replication.delete_replication_rule' responses: @@ -7721,7 +7727,7 @@ paths: x-version-added: '1.1' description: Automatically starts the replication on indexes matching a specified pattern. externalDocs: - url: https://opensearch.org/docs/latest/tuning-your-cluster/replication-plugin/api/#create-replication-rule + url: https://docs.opensearch.org/latest/tuning-your-cluster/replication-plugin/api/#create-replication-rule requestBody: $ref: '#/components/requestBodies/replication.create_replication_rule' responses: @@ -7740,7 +7746,7 @@ paths: x-version-added: '1.1' description: Pauses the replication of the leader index. externalDocs: - url: https://opensearch.org/docs/latest/tuning-your-cluster/replication-plugin/api/#pause-replication + url: https://docs.opensearch.org/latest/tuning-your-cluster/replication-plugin/api/#pause-replication parameters: - $ref: '#/components/parameters/replication.pause___path.index' - $ref: '#/components/parameters/_global___query.pretty' @@ -7760,7 +7766,7 @@ paths: x-version-added: '1.1' description: Resumes replication of the leader index. externalDocs: - url: https://opensearch.org/docs/latest/tuning-your-cluster/replication-plugin/api/#resume-replication + url: https://docs.opensearch.org/latest/tuning-your-cluster/replication-plugin/api/#resume-replication parameters: - $ref: '#/components/parameters/replication.resume___path.index' - $ref: '#/components/parameters/_global___query.pretty' @@ -7780,7 +7786,7 @@ paths: x-version-added: '1.1' description: Initiates the replication of an index from the leader cluster to the follower cluster. externalDocs: - url: https://opensearch.org/docs/latest/tuning-your-cluster/replication-plugin/api/#start-replication + url: https://docs.opensearch.org/latest/tuning-your-cluster/replication-plugin/api/#start-replication parameters: - $ref: '#/components/parameters/replication.start___path.index' - $ref: '#/components/parameters/_global___query.pretty' @@ -7800,7 +7806,7 @@ paths: x-version-added: '1.1' description: Retrieves the the status of an index replication. externalDocs: - url: https://opensearch.org/docs/latest/tuning-your-cluster/replication-plugin/api/#get-replication-status + url: https://docs.opensearch.org/latest/tuning-your-cluster/replication-plugin/api/#get-replication-status parameters: - $ref: '#/components/parameters/replication.status___path.index' - $ref: '#/components/parameters/_global___query.pretty' @@ -7818,7 +7824,7 @@ paths: x-version-added: '1.1' description: Terminates the replication and converts the follower index to a standard index. externalDocs: - url: https://opensearch.org/docs/latest/tuning-your-cluster/replication-plugin/api/#stop-replication + url: https://docs.opensearch.org/latest/tuning-your-cluster/replication-plugin/api/#stop-replication parameters: - $ref: '#/components/parameters/replication.stop___path.index' - $ref: '#/components/parameters/_global___query.pretty' @@ -7838,7 +7844,7 @@ paths: x-version-added: '1.1' description: Updates any settings on the follower index. externalDocs: - url: https://opensearch.org/docs/latest/tuning-your-cluster/replication-plugin/api/#update-settings + url: https://docs.opensearch.org/latest/tuning-your-cluster/replication-plugin/api/#update-settings parameters: - $ref: '#/components/parameters/replication.update_settings___path.index' - $ref: '#/components/parameters/_global___query.pretty' @@ -7858,7 +7864,7 @@ paths: x-version-added: '1.1' description: Retrieves information about any auto-follow activity and any replication rules configured on the specified cluster. externalDocs: - url: https://opensearch.org/docs/latest/tuning-your-cluster/replication-plugin/api/#get-auto-follow-stats + url: https://docs.opensearch.org/latest/tuning-your-cluster/replication-plugin/api/#get-auto-follow-stats responses: '200': $ref: '#/components/responses/replication.autofollow_stats___200' @@ -7875,7 +7881,7 @@ paths: x-version-added: '1.1' description: Retrieves information about any follower (syncing) indexes on a specified cluster. externalDocs: - url: https://opensearch.org/docs/latest/tuning-your-cluster/replication-plugin/api/#get-follower-cluster-stats + url: https://docs.opensearch.org/latest/tuning-your-cluster/replication-plugin/api/#get-follower-cluster-stats responses: '200': $ref: '#/components/responses/replication.follower_stats___200' @@ -7892,7 +7898,7 @@ paths: x-version-added: '1.1' description: Retrieves information about any replicated leader indexes on a specified cluster. externalDocs: - url: https://opensearch.org/docs/latest/tuning-your-cluster/replication-plugin/api/#get-leader-cluster-stats + url: https://docs.opensearch.org/latest/tuning-your-cluster/replication-plugin/api/#get-leader-cluster-stats responses: '200': $ref: '#/components/responses/replication.leader_stats___200' @@ -7909,7 +7915,7 @@ paths: x-version-added: '1.0' description: Deletes an index rollup job configuration. externalDocs: - url: https://opensearch.org/docs/latest/im-plugin/index-rollups/rollup-api/#delete-an-index-rollup-job + url: https://docs.opensearch.org/latest/im-plugin/index-rollups/rollup-api/#delete-an-index-rollup-job responses: '200': $ref: '#/components/responses/rollups.delete___200' @@ -7926,7 +7932,7 @@ paths: x-version-added: '1.0' description: Retrieves an index rollup job configuration by ID. externalDocs: - url: https://opensearch.org/docs/latest/im-plugin/index-rollups/rollup-api/#get-an-index-rollup-job + url: https://docs.opensearch.org/latest/im-plugin/index-rollups/rollup-api/#get-an-index-rollup-job parameters: - $ref: '#/components/parameters/rollups.get___path.id' - $ref: '#/components/parameters/_global___query.pretty' @@ -7943,7 +7949,7 @@ paths: x-version-added: '1.0' description: Creates or updates an index rollup job configuration. externalDocs: - url: https://opensearch.org/docs/latest/im-plugin/index-rollups/rollup-api/#create-or-update-an-index-rollup-job + url: https://docs.opensearch.org/latest/im-plugin/index-rollups/rollup-api/#create-or-update-an-index-rollup-job responses: '201': $ref: '#/components/responses/rollups.put___201' @@ -7965,7 +7971,7 @@ paths: x-version-added: '1.0' description: Retrieves the execution status information for an index rollup job. externalDocs: - url: https://opensearch.org/docs/latest/im-plugin/index-rollups/rollup-api/#explain-an-index-rollup-job + url: https://docs.opensearch.org/latest/im-plugin/index-rollups/rollup-api/#explain-an-index-rollup-job parameters: - $ref: '#/components/parameters/rollups.explain___path.id' - $ref: '#/components/parameters/_global___query.pretty' @@ -7983,7 +7989,7 @@ paths: x-version-added: '1.0' description: Starts the execution of an index rollup job. externalDocs: - url: https://opensearch.org/docs/latest/im-plugin/index-rollups/rollup-api/#start-or-stop-an-index-rollup-job + url: https://docs.opensearch.org/latest/im-plugin/index-rollups/rollup-api/#start-or-stop-an-index-rollup-job parameters: - $ref: '#/components/parameters/rollups.start___path.id' - $ref: '#/components/parameters/_global___query.pretty' @@ -8001,7 +8007,7 @@ paths: x-version-added: '1.0' description: Stops the execution of an index rollup job. externalDocs: - url: https://opensearch.org/docs/latest/im-plugin/index-rollups/rollup-api/#start-or-stop-an-index-rollup-job + url: https://docs.opensearch.org/latest/im-plugin/index-rollups/rollup-api/#start-or-stop-an-index-rollup-job parameters: - $ref: '#/components/parameters/rollups.stop___path.id' - $ref: '#/components/parameters/_global___query.pretty' @@ -8086,6 +8092,39 @@ paths: - $ref: '#/components/parameters/_global___query.error_trace' - $ref: '#/components/parameters/_global___query.source' - $ref: '#/components/parameters/_global___query.filter_path' + /_plugins/_search_relevance/experiments/_search: + get: + operationId: search_relevance.experiments_search.0 + x-operation-group: search_relevance.experiments_search + x-version-added: '3.5' + description: Searches for experiments. + requestBody: + $ref: '#/components/requestBodies/search_relevance.experiments_search' + responses: + '200': + $ref: '#/components/responses/search_relevance.experiments_search___200' + parameters: + - $ref: '#/components/parameters/_global___query.pretty' + - $ref: '#/components/parameters/_global___query.human' + - $ref: '#/components/parameters/_global___query.error_trace' + - $ref: '#/components/parameters/_global___query.source' + - $ref: '#/components/parameters/_global___query.filter_path' + post: + operationId: search_relevance.experiments_search.1 + x-operation-group: search_relevance.experiments_search + x-version-added: '3.5' + description: Searches for experiments. + requestBody: + $ref: '#/components/requestBodies/search_relevance.experiments_search' + responses: + '200': + $ref: '#/components/responses/search_relevance.experiments_search___200' + parameters: + - $ref: '#/components/parameters/_global___query.pretty' + - $ref: '#/components/parameters/_global___query.human' + - $ref: '#/components/parameters/_global___query.error_trace' + - $ref: '#/components/parameters/_global___query.source' + - $ref: '#/components/parameters/_global___query.filter_path' /_plugins/_search_relevance/experiments/{experiment_id}: delete: operationId: search_relevance.delete_experiments.0 @@ -8211,6 +8250,39 @@ paths: - $ref: '#/components/parameters/_global___query.error_trace' - $ref: '#/components/parameters/_global___query.source' - $ref: '#/components/parameters/_global___query.filter_path' + /_plugins/_search_relevance/judgments/_search: + get: + operationId: search_relevance.judgments_search.0 + x-operation-group: search_relevance.judgments_search + x-version-added: '3.5' + description: Searches for judgments. + requestBody: + $ref: '#/components/requestBodies/search_relevance.judgments_search' + responses: + '200': + $ref: '#/components/responses/search_relevance.judgments_search___200' + parameters: + - $ref: '#/components/parameters/_global___query.pretty' + - $ref: '#/components/parameters/_global___query.human' + - $ref: '#/components/parameters/_global___query.error_trace' + - $ref: '#/components/parameters/_global___query.source' + - $ref: '#/components/parameters/_global___query.filter_path' + post: + operationId: search_relevance.judgments_search.1 + x-operation-group: search_relevance.judgments_search + x-version-added: '3.5' + description: Searches for judgments. + requestBody: + $ref: '#/components/requestBodies/search_relevance.judgments_search' + responses: + '200': + $ref: '#/components/responses/search_relevance.judgments_search___200' + parameters: + - $ref: '#/components/parameters/_global___query.pretty' + - $ref: '#/components/parameters/_global___query.human' + - $ref: '#/components/parameters/_global___query.error_trace' + - $ref: '#/components/parameters/_global___query.source' + - $ref: '#/components/parameters/_global___query.filter_path' /_plugins/_search_relevance/judgments/{judgment_id}: delete: operationId: search_relevance.delete_judgments.0 @@ -8289,6 +8361,39 @@ paths: - $ref: '#/components/parameters/_global___query.error_trace' - $ref: '#/components/parameters/_global___query.source' - $ref: '#/components/parameters/_global___query.filter_path' + /_plugins/_search_relevance/query_sets/_search: + get: + operationId: search_relevance.query_sets_search.0 + x-operation-group: search_relevance.query_sets_search + x-version-added: '3.5' + description: Searches for queries in the query sets. + requestBody: + $ref: '#/components/requestBodies/search_relevance.query_sets_search' + responses: + '200': + $ref: '#/components/responses/search_relevance.query_sets_search___200' + parameters: + - $ref: '#/components/parameters/_global___query.pretty' + - $ref: '#/components/parameters/_global___query.human' + - $ref: '#/components/parameters/_global___query.error_trace' + - $ref: '#/components/parameters/_global___query.source' + - $ref: '#/components/parameters/_global___query.filter_path' + post: + operationId: search_relevance.query_sets_search.1 + x-operation-group: search_relevance.query_sets_search + x-version-added: '3.5' + description: Searches for queries in the query sets. + requestBody: + $ref: '#/components/requestBodies/search_relevance.query_sets_search' + responses: + '200': + $ref: '#/components/responses/search_relevance.query_sets_search___200' + parameters: + - $ref: '#/components/parameters/_global___query.pretty' + - $ref: '#/components/parameters/_global___query.human' + - $ref: '#/components/parameters/_global___query.error_trace' + - $ref: '#/components/parameters/_global___query.source' + - $ref: '#/components/parameters/_global___query.filter_path' /_plugins/_search_relevance/query_sets/{query_set_id}: delete: operationId: search_relevance.delete_query_sets.0 @@ -8351,6 +8456,39 @@ paths: - $ref: '#/components/parameters/_global___query.error_trace' - $ref: '#/components/parameters/_global___query.source' - $ref: '#/components/parameters/_global___query.filter_path' + /_plugins/_search_relevance/search_configurations/_search: + get: + operationId: search_relevance.search_configurations_search.0 + x-operation-group: search_relevance.search_configurations_search + x-version-added: '3.5' + description: Searches for search configurations. + requestBody: + $ref: '#/components/requestBodies/search_relevance.search_configurations_search' + responses: + '200': + $ref: '#/components/responses/search_relevance.search_configurations_search___200' + parameters: + - $ref: '#/components/parameters/_global___query.pretty' + - $ref: '#/components/parameters/_global___query.human' + - $ref: '#/components/parameters/_global___query.error_trace' + - $ref: '#/components/parameters/_global___query.source' + - $ref: '#/components/parameters/_global___query.filter_path' + post: + operationId: search_relevance.search_configurations_search.1 + x-operation-group: search_relevance.search_configurations_search + x-version-added: '3.5' + description: Searches for search configurations. + requestBody: + $ref: '#/components/requestBodies/search_relevance.search_configurations_search' + responses: + '200': + $ref: '#/components/responses/search_relevance.search_configurations_search___200' + parameters: + - $ref: '#/components/parameters/_global___query.pretty' + - $ref: '#/components/parameters/_global___query.human' + - $ref: '#/components/parameters/_global___query.error_trace' + - $ref: '#/components/parameters/_global___query.source' + - $ref: '#/components/parameters/_global___query.filter_path' /_plugins/_search_relevance/search_configurations/{search_configuration_id}: delete: operationId: search_relevance.delete_search_configurations.0 @@ -8430,7 +8568,7 @@ paths: x-version-added: '2.4' description: Retrieve alerts related to a specific detector type or detector ID. externalDocs: - url: https://docs.opensearch.org/docs/latest/security-analytics/api-tools/alert-finding-api/#get-alerts + url: https://docs.opensearch.org/latest/security-analytics/api-tools/alert-finding-api/#get-alerts parameters: - $ref: '#/components/parameters/security_analytics.get_alerts___query.alertState' - $ref: '#/components/parameters/security_analytics.get_alerts___query.detectorType' @@ -8459,7 +8597,7 @@ paths: x-version-added: '2.4' description: Retrieve findings related to a specific detector type or detector ID. externalDocs: - url: https://docs.opensearch.org/docs/latest/security-analytics/api-tools/alert-finding-api/#get-findings + url: https://docs.opensearch.org/latest/security-analytics/api-tools/alert-finding-api/#get-findings parameters: - $ref: '#/components/parameters/security_analytics.get_findings___query.detectionType' - $ref: '#/components/parameters/security_analytics.get_findings___query.detectorType' @@ -8489,7 +8627,7 @@ paths: x-version-added: '2.7' description: List correlations for a finding. externalDocs: - url: https://docs.opensearch.org/docs/latest/security-analytics/api-tools/correlation-eng/#list-correlations-for-a-finding-belonging-to-a-log-type + url: https://docs.opensearch.org/latest/security-analytics/api-tools/correlation-eng/#list-correlations-for-a-finding-belonging-to-a-log-type parameters: - $ref: '#/components/parameters/security_analytics.search_finding_correlations___query.detector_type' - $ref: '#/components/parameters/security_analytics.search_finding_correlations___query.finding' @@ -8513,7 +8651,7 @@ paths: - amazon-serverless description: Checks whether or not an upgrade can be performed and which security resources can be updated. externalDocs: - url: https://opensearch.org/docs/latest/security/access-control/api/#configuration-upgrade-check + url: https://docs.opensearch.org/latest/security/access-control/api/#configuration-upgrade-check responses: '200': $ref: '#/components/responses/security.config_upgrade_check___200' @@ -8533,7 +8671,7 @@ paths: - amazon-serverless description: Assists the cluster operator with upgrading missing default values and stale default definitions. externalDocs: - url: https://opensearch.org/docs/latest/security/access-control/api/#configuration-upgrade + url: https://docs.opensearch.org/latest/security/access-control/api/#configuration-upgrade requestBody: $ref: '#/components/requestBodies/security.config_upgrade_perform' responses: @@ -8557,7 +8695,7 @@ paths: - amazon-serverless description: Returns account information for the current user. externalDocs: - url: https://opensearch.org/docs/latest/security/access-control/api/#get-account-details + url: https://docs.opensearch.org/latest/security/access-control/api/#get-account-details responses: '200': $ref: '#/components/responses/security.get_account_details___200' @@ -8576,7 +8714,7 @@ paths: - amazon-serverless description: Changes the password for the current user. externalDocs: - url: https://opensearch.org/docs/latest/security/access-control/api/#change-password + url: https://docs.opensearch.org/latest/security/access-control/api/#change-password requestBody: $ref: '#/components/requestBodies/security.change_password' responses: @@ -8600,7 +8738,7 @@ paths: - amazon-serverless description: Retrieves all action groups. externalDocs: - url: https://opensearch.org/docs/latest/security/access-control/api/#get-action-groups + url: https://docs.opensearch.org/latest/security/access-control/api/#get-action-groups responses: '200': $ref: '#/components/responses/security.get_action_groups___200' @@ -8619,7 +8757,7 @@ paths: - amazon-serverless description: Creates, updates, or deletes multiple action groups in a single request. externalDocs: - url: https://opensearch.org/docs/latest/security/access-control/api/#patch-action-groups + url: https://docs.opensearch.org/latest/security/access-control/api/#patch-action-groups requestBody: $ref: '#/components/requestBodies/security.patch_action_groups' responses: @@ -8641,7 +8779,7 @@ paths: - amazon-serverless description: Deletes the specified action group. externalDocs: - url: https://opensearch.org/docs/latest/security/access-control/api/#delete-action-group + url: https://docs.opensearch.org/latest/security/access-control/api/#delete-action-group parameters: - $ref: '#/components/parameters/security.delete_action_group___path.action_group' - $ref: '#/components/parameters/_global___query.pretty' @@ -8661,7 +8799,7 @@ paths: - amazon-serverless description: Retrieves one action group. externalDocs: - url: https://opensearch.org/docs/latest/security/access-control/api/#get-action-group + url: https://docs.opensearch.org/latest/security/access-control/api/#get-action-group parameters: - $ref: '#/components/parameters/security.get_action_group___path.action_group' - $ref: '#/components/parameters/_global___query.pretty' @@ -8681,7 +8819,7 @@ paths: - amazon-serverless description: Updates the individual attributes of an action group. externalDocs: - url: https://opensearch.org/docs/latest/security/access-control/api/#patch-action-group + url: https://docs.opensearch.org/latest/security/access-control/api/#patch-action-group parameters: - $ref: '#/components/parameters/security.patch_action_group___path.action_group' - $ref: '#/components/parameters/_global___query.pretty' @@ -8703,7 +8841,7 @@ paths: - amazon-serverless description: Creates or replaces the specified action group. externalDocs: - url: https://opensearch.org/docs/latest/security/access-control/api/#create-action-group + url: https://docs.opensearch.org/latest/security/access-control/api/#create-action-group parameters: - $ref: '#/components/parameters/security.create_action_group___path.action_group' - $ref: '#/components/parameters/_global___query.pretty' @@ -8728,7 +8866,7 @@ paths: - amazon-serverless description: Retrieves the current list of allowed APIs accessible to a normal user. externalDocs: - url: https://opensearch.org/docs/latest/security/access-control/api/#access-control-for-the-api + url: https://docs.opensearch.org/latest/security/access-control/api/#access-control-for-the-api responses: '200': $ref: '#/components/responses/security.get_allowlist___200' @@ -8749,7 +8887,7 @@ paths: - amazon-serverless description: Updates the current list of APIs accessible for users on the allow list. externalDocs: - url: https://opensearch.org/docs/latest/security/access-control/api/#access-control-for-the-api + url: https://docs.opensearch.org/latest/security/access-control/api/#access-control-for-the-api requestBody: $ref: '#/components/requestBodies/security.patch_allowlist' responses: @@ -8772,7 +8910,7 @@ paths: - amazon-serverless description: Creates or replaces APIs permitted for users on the allow list. Requires a super admin certificate or REST API permissions. externalDocs: - url: https://opensearch.org/docs/latest/security/access-control/api/#access-control-for-the-api + url: https://docs.opensearch.org/latest/security/access-control/api/#access-control-for-the-api requestBody: $ref: '#/components/requestBodies/security.create_allowlist' responses: @@ -8796,7 +8934,7 @@ paths: - amazon-serverless description: Retrieves the audit configuration. externalDocs: - url: https://opensearch.org/docs/latest/security/access-control/api/#audit-logs + url: https://docs.opensearch.org/latest/security/access-control/api/#audit-logs responses: '200': $ref: '#/components/responses/security.get_audit_configuration___200' @@ -8815,7 +8953,7 @@ paths: - amazon-serverless description: Updates the specified fields in the audit configuration. externalDocs: - url: https://opensearch.org/docs/latest/security/access-control/api/#audit-logs + url: https://docs.opensearch.org/latest/security/access-control/api/#audit-logs requestBody: $ref: '#/components/requestBodies/security.patch_audit_configuration' responses: @@ -8837,7 +8975,7 @@ paths: - amazon-serverless description: Updates the audit configuration. externalDocs: - url: https://opensearch.org/docs/latest/security/access-control/api/#audit-logs + url: https://docs.opensearch.org/latest/security/access-control/api/#audit-logs requestBody: $ref: '#/components/requestBodies/security.update_audit_configuration' responses: @@ -8877,7 +9015,7 @@ paths: - amazon-serverless description: Flushes the Security plugin's user, authentication, and authorization cache. externalDocs: - url: https://opensearch.org/docs/latest/security/access-control/api/#flush-cache + url: https://docs.opensearch.org/latest/security/access-control/api/#flush-cache responses: '200': $ref: '#/components/responses/security.flush_cache___200' @@ -9006,7 +9144,7 @@ paths: - amazon-serverless description: Generates a `On-Behalf-Of` token for the current user. externalDocs: - url: https://opensearch.org/docs/latest/security/access-control/authentication-tokens/#api-endpoint + url: https://docs.opensearch.org/latest/security/access-control/authentication-tokens/#api-endpoint requestBody: $ref: '#/components/requestBodies/security.generate_obo_token' responses: @@ -9030,7 +9168,7 @@ paths: - amazon-serverless description: Retrieve all internal users. externalDocs: - url: https://opensearch.org/docs/latest/security/access-control/api/#get-users + url: https://docs.opensearch.org/latest/security/access-control/api/#get-users responses: '200': $ref: '#/components/responses/security.get_users___200' @@ -9049,7 +9187,7 @@ paths: - amazon-serverless description: Creates, updates, or deletes multiple internal users in a single request. externalDocs: - url: https://opensearch.org/docs/latest/security/access-control/api/#patch-users + url: https://docs.opensearch.org/latest/security/access-control/api/#patch-users requestBody: $ref: '#/components/requestBodies/security.patch_users' responses: @@ -9071,7 +9209,7 @@ paths: - amazon-serverless description: Deletes the specified internal user. externalDocs: - url: https://opensearch.org/docs/latest/security/access-control/api/#delete-user + url: https://docs.opensearch.org/latest/security/access-control/api/#delete-user parameters: - $ref: '#/components/parameters/security.delete_user___path.username' - $ref: '#/components/parameters/_global___query.pretty' @@ -9091,7 +9229,7 @@ paths: - amazon-serverless description: Retrieve information about the specified internal user. externalDocs: - url: https://opensearch.org/docs/latest/security/access-control/api/#get-user + url: https://docs.opensearch.org/latest/security/access-control/api/#get-user parameters: - $ref: '#/components/parameters/security.get_user___path.username' - $ref: '#/components/parameters/_global___query.pretty' @@ -9111,7 +9249,7 @@ paths: - amazon-serverless description: Updates individual attributes for an internal user. externalDocs: - url: https://opensearch.org/docs/latest/security/access-control/api/#patch-user + url: https://docs.opensearch.org/latest/security/access-control/api/#patch-user parameters: - $ref: '#/components/parameters/security.patch_user___path.username' - $ref: '#/components/parameters/_global___query.pretty' @@ -9133,7 +9271,7 @@ paths: - amazon-serverless description: Creates or replaces the specified user. externalDocs: - url: https://opensearch.org/docs/latest/security/access-control/api/#create-user + url: https://docs.opensearch.org/latest/security/access-control/api/#create-user parameters: - $ref: '#/components/parameters/security.create_user___path.username' - $ref: '#/components/parameters/_global___query.pretty' @@ -9199,7 +9337,7 @@ paths: - amazon-serverless description: Retrieves all node distinguished names. Requires super admin or REST API permissions. externalDocs: - url: https://opensearch.org/docs/latest/security/access-control/api/#get-distinguished-names + url: https://docs.opensearch.org/latest/security/access-control/api/#get-distinguished-names parameters: - $ref: '#/components/parameters/security.get_distinguished_names___query.show_all' - $ref: '#/components/parameters/_global___query.pretty' @@ -9223,7 +9361,7 @@ paths: - amazon-serverless description: Bulk updates specified node distinguished names. Requires super admin or REST API permissions. externalDocs: - url: https://opensearch.org/docs/latest/security/access-control/api/#update-all-distinguished-names + url: https://docs.opensearch.org/latest/security/access-control/api/#update-all-distinguished-names requestBody: $ref: '#/components/requestBodies/security.patch_distinguished_names' responses: @@ -9249,7 +9387,7 @@ paths: - amazon-serverless description: Deletes all distinguished names in the specified cluster or node allowlist. Requires super admin or REST API permissions. externalDocs: - url: https://opensearch.org/docs/latest/security/access-control/api/#delete-distinguished-names + url: https://docs.opensearch.org/latest/security/access-control/api/#delete-distinguished-names parameters: - $ref: '#/components/parameters/security.delete_distinguished_name___path.cluster_name' - $ref: '#/components/parameters/_global___query.pretty' @@ -9273,7 +9411,7 @@ paths: - amazon-serverless description: Retrieves all node distinguished names. Requires super admin or REST API permissions. externalDocs: - url: https://opensearch.org/docs/latest/security/access-control/api/#get-distinguished-names + url: https://docs.opensearch.org/latest/security/access-control/api/#get-distinguished-names parameters: - $ref: '#/components/parameters/security.get_distinguished_name___path.cluster_name' - $ref: '#/components/parameters/security.get_distinguished_name___query.show_all' @@ -9322,7 +9460,7 @@ paths: - amazon-serverless description: Adds or updates the specified distinguished names in the cluster or node allowlist. Requires super admin or REST API permissions. externalDocs: - url: https://opensearch.org/docs/latest/security/access-control/api/#update-distinguished-names + url: https://docs.opensearch.org/latest/security/access-control/api/#update-distinguished-names parameters: - $ref: '#/components/parameters/security.update_distinguished_name___path.cluster_name' - $ref: '#/components/parameters/_global___query.pretty' @@ -9371,7 +9509,7 @@ paths: - amazon-serverless description: Retrieves all roles. externalDocs: - url: https://opensearch.org/docs/latest/security/access-control/api/#get-roles + url: https://docs.opensearch.org/latest/security/access-control/api/#get-roles responses: '200': $ref: '#/components/responses/security.get_roles___200' @@ -9390,7 +9528,7 @@ paths: - amazon-serverless description: Creates, updates, or deletes multiple roles in a single call. externalDocs: - url: https://opensearch.org/docs/latest/security/access-control/api/#patch-roles + url: https://docs.opensearch.org/latest/security/access-control/api/#patch-roles requestBody: $ref: '#/components/requestBodies/security.patch_roles' responses: @@ -9414,7 +9552,7 @@ paths: - amazon-serverless description: Deletes the specified role. externalDocs: - url: https://opensearch.org/docs/latest/security/access-control/api/#delete-role + url: https://docs.opensearch.org/latest/security/access-control/api/#delete-role parameters: - $ref: '#/components/parameters/security.delete_role___path.role' - $ref: '#/components/parameters/_global___query.pretty' @@ -9434,7 +9572,7 @@ paths: - amazon-serverless description: Retrieves one role. externalDocs: - url: https://opensearch.org/docs/latest/security/access-control/api/#get-role + url: https://docs.opensearch.org/latest/security/access-control/api/#get-role parameters: - $ref: '#/components/parameters/security.get_role___path.role' - $ref: '#/components/parameters/_global___query.pretty' @@ -9454,7 +9592,7 @@ paths: - amazon-serverless description: Updates the individual attributes of a role. externalDocs: - url: https://opensearch.org/docs/latest/security/access-control/api/#patch-role + url: https://docs.opensearch.org/latest/security/access-control/api/#patch-role parameters: - $ref: '#/components/parameters/security.patch_role___path.role' - $ref: '#/components/parameters/_global___query.pretty' @@ -9478,7 +9616,7 @@ paths: - amazon-serverless description: Creates or replaces the specified role. externalDocs: - url: https://opensearch.org/docs/latest/security/access-control/api/#create-role + url: https://docs.opensearch.org/latest/security/access-control/api/#create-role parameters: - $ref: '#/components/parameters/security.create_role___path.role' - $ref: '#/components/parameters/_global___query.pretty' @@ -9503,7 +9641,7 @@ paths: - amazon-serverless description: Retrieves all role mappings. externalDocs: - url: https://opensearch.org/docs/latest/security/access-control/api/#get-role-mappings + url: https://docs.opensearch.org/latest/security/access-control/api/#get-role-mappings responses: '200': $ref: '#/components/responses/security.get_role_mappings___200' @@ -9522,7 +9660,7 @@ paths: - amazon-serverless description: Creates or updates multiple role mappings in a single request. externalDocs: - url: https://opensearch.org/docs/latest/security/access-control/api/#patch-role-mappings + url: https://docs.opensearch.org/latest/security/access-control/api/#patch-role-mappings requestBody: $ref: '#/components/requestBodies/security.patch_role_mappings' responses: @@ -9546,7 +9684,7 @@ paths: - amazon-serverless description: Deletes the specified role mapping. externalDocs: - url: https://opensearch.org/docs/latest/security/access-control/api/#delete-role-mapping + url: https://docs.opensearch.org/latest/security/access-control/api/#delete-role-mapping parameters: - $ref: '#/components/parameters/security.delete_role_mapping___path.role' - $ref: '#/components/parameters/_global___query.pretty' @@ -9566,7 +9704,7 @@ paths: - amazon-serverless description: Retrieves the specified role mapping. externalDocs: - url: https://opensearch.org/docs/latest/security/access-control/api/#get-role-mapping + url: https://docs.opensearch.org/latest/security/access-control/api/#get-role-mapping parameters: - $ref: '#/components/parameters/security.get_role_mapping___path.role' - $ref: '#/components/parameters/_global___query.pretty' @@ -9586,7 +9724,7 @@ paths: - amazon-serverless description: Updates the individual attributes of a role mapping. externalDocs: - url: https://opensearch.org/docs/latest/security/access-control/api/#patch-role-mapping + url: https://docs.opensearch.org/latest/security/access-control/api/#patch-role-mapping parameters: - $ref: '#/components/parameters/security.patch_role_mapping___path.role' - $ref: '#/components/parameters/_global___query.pretty' @@ -9610,7 +9748,7 @@ paths: - amazon-serverless description: Creates or replaces the specified role mapping. externalDocs: - url: https://opensearch.org/docs/latest/security/access-control/api/#create-role-mapping + url: https://docs.opensearch.org/latest/security/access-control/api/#create-role-mapping parameters: - $ref: '#/components/parameters/security.create_role_mapping___path.role' - $ref: '#/components/parameters/_global___query.pretty' @@ -9635,7 +9773,7 @@ paths: - amazon-serverless description: Returns the current Security plugin configuration in a JSON format. externalDocs: - url: https://opensearch.org/docs/latest/security/access-control/api/#get-configuration + url: https://docs.opensearch.org/latest/security/access-control/api/#get-configuration responses: '200': $ref: '#/components/responses/security.get_configuration___200' @@ -9654,7 +9792,7 @@ paths: - amazon-serverless description: Updates the existing security configuration using the REST API. Requires super admin or REST API permissions. externalDocs: - url: https://opensearch.org/docs/latest/security/access-control/api/#patch-configuration + url: https://docs.opensearch.org/latest/security/access-control/api/#patch-configuration requestBody: $ref: '#/components/requestBodies/security.patch_configuration' responses: @@ -9678,7 +9816,7 @@ paths: - amazon-serverless description: Updates the settings for an existing security configuration. Requires super admin or REST API permissions. externalDocs: - url: https://opensearch.org/docs/latest/security/access-control/api/#update-configuration + url: https://docs.opensearch.org/latest/security/access-control/api/#update-configuration requestBody: $ref: '#/components/requestBodies/security.update_configuration' responses: @@ -9702,7 +9840,7 @@ paths: - amazon-serverless description: Retrieves the cluster security certificates. externalDocs: - url: https://opensearch.org/docs/latest/security/access-control/api/#get-certificates + url: https://docs.opensearch.org/latest/security/access-control/api/#get-certificates responses: '200': $ref: '#/components/responses/security.get_certificates___200' @@ -9726,7 +9864,7 @@ paths: - amazon-serverless description: Reloads the HTTP communication certificates. externalDocs: - url: https://opensearch.org/docs/latest/security/access-control/api/#reload-http-certificates + url: https://docs.opensearch.org/latest/security/access-control/api/#reload-http-certificates responses: '200': $ref: '#/components/responses/security.reload_http_certificates___200' @@ -9750,7 +9888,7 @@ paths: - amazon-serverless description: Reloads the transport communication certificates. externalDocs: - url: https://opensearch.org/docs/latest/security/access-control/api/#reload-transport-certificates + url: https://docs.opensearch.org/latest/security/access-control/api/#reload-transport-certificates responses: '200': $ref: '#/components/responses/security.reload_transport_certificates___200' @@ -9774,7 +9912,7 @@ paths: - amazon-serverless description: Retrieves the multi-tenancy configuration. Requires super admin or REST API permissions. externalDocs: - url: https://opensearch.org/docs/latest/security/multi-tenancy/dynamic-config/#configuring-multi-tenancy-with-the-rest-api + url: https://docs.opensearch.org/latest/security/multi-tenancy/dynamic-config/#configuring-multi-tenancy-with-the-rest-api responses: '200': $ref: '#/components/responses/security.get_tenancy_config___200' @@ -9795,7 +9933,7 @@ paths: - amazon-serverless description: Creates or replaces the multi-tenancy configuration. Requires super admin or REST API permissions. externalDocs: - url: https://opensearch.org/docs/latest/security/multi-tenancy/dynamic-config/#configuring-multi-tenancy-with-the-rest-api + url: https://docs.opensearch.org/latest/security/multi-tenancy/dynamic-config/#configuring-multi-tenancy-with-the-rest-api requestBody: $ref: '#/components/requestBodies/security.create_update_tenancy_config' responses: @@ -9819,7 +9957,7 @@ paths: - amazon-serverless description: Retrieves all tenants. externalDocs: - url: https://opensearch.org/docs/latest/security/access-control/api/#get-tenants + url: https://docs.opensearch.org/latest/security/access-control/api/#get-tenants responses: '200': $ref: '#/components/responses/security.get_tenants___200' @@ -9840,7 +9978,7 @@ paths: - amazon-serverless description: Adds, deletes, or modifies multiple tenants in a single request. externalDocs: - url: https://opensearch.org/docs/latest/security/access-control/api/#patch-tenants + url: https://docs.opensearch.org/latest/security/access-control/api/#patch-tenants requestBody: $ref: '#/components/requestBodies/security.patch_tenants' responses: @@ -9864,7 +10002,7 @@ paths: - amazon-serverless description: Deletes the specified tenant. externalDocs: - url: https://opensearch.org/docs/latest/security/access-control/api/#delete-action-group + url: https://docs.opensearch.org/latest/security/access-control/api/#delete-action-group parameters: - $ref: '#/components/parameters/security.delete_tenant___path.tenant' - $ref: '#/components/parameters/_global___query.pretty' @@ -9886,7 +10024,7 @@ paths: - amazon-serverless description: Retrieves the specified tenant. externalDocs: - url: https://opensearch.org/docs/latest/security/access-control/api/#get-tenant + url: https://docs.opensearch.org/latest/security/access-control/api/#get-tenant parameters: - $ref: '#/components/parameters/security.get_tenant___path.tenant' - $ref: '#/components/parameters/_global___query.pretty' @@ -9906,7 +10044,7 @@ paths: - amazon-serverless description: Adds, deletes, or modifies a single tenant. externalDocs: - url: https://opensearch.org/docs/latest/security/access-control/api/#patch-tenant + url: https://docs.opensearch.org/latest/security/access-control/api/#patch-tenant parameters: - $ref: '#/components/parameters/security.patch_tenant___path.tenant' - $ref: '#/components/parameters/_global___query.pretty' @@ -9930,7 +10068,7 @@ paths: - amazon-serverless description: Creates or replaces the specified tenant. externalDocs: - url: https://opensearch.org/docs/latest/security/access-control/api/#create-tenant + url: https://docs.opensearch.org/latest/security/access-control/api/#create-tenant parameters: - $ref: '#/components/parameters/security.create_tenant___path.tenant' - $ref: '#/components/parameters/_global___query.pretty' @@ -10163,7 +10301,7 @@ paths: - $ref: '#/components/parameters/_global___query.source' - $ref: '#/components/parameters/_global___query.filter_path' externalDocs: - url: https://opensearch.org/docs/latest/security/access-control/api/#health-check + url: https://docs.opensearch.org/latest/security/access-control/api/#health-check responses: '200': $ref: '#/components/responses/security.health___200' @@ -10183,7 +10321,7 @@ paths: - $ref: '#/components/parameters/_global___query.source' - $ref: '#/components/parameters/_global___query.filter_path' externalDocs: - url: https://opensearch.org/docs/latest/security/access-control/api/#health-check + url: https://docs.opensearch.org/latest/security/access-control/api/#health-check responses: '200': $ref: '#/components/responses/security.health___200' @@ -10439,7 +10577,7 @@ paths: x-version-added: '1.0' description: Executes SQL or PPL queries against OpenSearch indexes. externalDocs: - url: https://opensearch.org/docs/latest/search-plugins/sql/sql-ppl-api/ + url: https://docs.opensearch.org/latest/search-plugins/sql/sql-ppl-api/ parameters: - $ref: '#/components/parameters/sql.query___query.format' - $ref: '#/components/parameters/sql.query___query.sanitize' @@ -10460,7 +10598,7 @@ paths: x-version-added: '1.0' description: Returns the execution plan for a SQL or PPL query. externalDocs: - url: https://opensearch.org/docs/latest/search-plugins/sql/sql-ppl-api/ + url: https://docs.opensearch.org/latest/search-plugins/sql/sql-ppl-api/ parameters: - $ref: '#/components/parameters/sql.explain___query.format' - $ref: '#/components/parameters/sql.explain___query.sanitize' @@ -10481,7 +10619,7 @@ paths: x-version-added: '1.0' description: Closes an open cursor to free server-side resources. externalDocs: - url: https://opensearch.org/docs/latest/search-plugins/sql/sql-ppl-api/ + url: https://docs.opensearch.org/latest/search-plugins/sql/sql-ppl-api/ parameters: - $ref: '#/components/parameters/sql.close___query.format' - $ref: '#/components/parameters/sql.close___query.sanitize' @@ -10502,7 +10640,7 @@ paths: x-version-added: '1.0' description: Retrieves performance metrics for the SQL plugin. externalDocs: - url: https://opensearch.org/docs/latest/search-plugins/sql/monitoring/ + url: https://docs.opensearch.org/latest/search-plugins/sql/monitoring/ parameters: - $ref: '#/components/parameters/sql.get_stats___query.format' - $ref: '#/components/parameters/sql.get_stats___query.sanitize' @@ -10520,7 +10658,7 @@ paths: x-version-added: '1.0' description: Retrieves filtered performance metrics for the SQL plugin. externalDocs: - url: https://opensearch.org/docs/latest/search-plugins/sql/monitoring/ + url: https://docs.opensearch.org/latest/search-plugins/sql/monitoring/ parameters: - $ref: '#/components/parameters/sql.post_stats___query.format' - $ref: '#/components/parameters/sql.post_stats___query.sanitize' @@ -10541,7 +10679,7 @@ paths: x-version-added: '1.0' description: Returns the details of all transform jobs. externalDocs: - url: https://opensearch.org/docs/latest/im-plugin/index-transforms/transforms-apis/#get-a-transform-jobs-details + url: https://docs.opensearch.org/latest/im-plugin/index-transforms/transforms-apis/#get-a-transform-jobs-details parameters: - $ref: '#/components/parameters/transforms.search___query.from' - $ref: '#/components/parameters/transforms.search___query.search' @@ -10563,7 +10701,7 @@ paths: x-version-added: '1.0' description: Returns a preview of what a transformed index would look like. externalDocs: - url: https://opensearch.org/docs/latest/im-plugin/index-transforms/transforms-apis/#preview-a-transform-jobs-results + url: https://docs.opensearch.org/latest/im-plugin/index-transforms/transforms-apis/#preview-a-transform-jobs-results requestBody: $ref: '#/components/requestBodies/transforms.preview' responses: @@ -10582,7 +10720,7 @@ paths: x-version-added: '1.0' description: Delete an index transform. externalDocs: - url: https://opensearch.org/docs/latest/im-plugin/index-transforms/transforms-apis/#delete-a-transform-job + url: https://docs.opensearch.org/latest/im-plugin/index-transforms/transforms-apis/#delete-a-transform-job parameters: - $ref: '#/components/parameters/transforms.delete___path.id' - $ref: '#/components/parameters/_global___query.pretty' @@ -10599,7 +10737,7 @@ paths: x-version-added: '1.0' description: Returns the status and metadata of a transform job. externalDocs: - url: https://opensearch.org/docs/latest/im-plugin/index-transforms/transforms-apis/#get-a-transform-jobs-details + url: https://docs.opensearch.org/latest/im-plugin/index-transforms/transforms-apis/#get-a-transform-jobs-details parameters: - $ref: '#/components/parameters/transforms.get___path.id' - $ref: '#/components/parameters/_global___query.pretty' @@ -10616,7 +10754,7 @@ paths: x-version-added: '1.0' description: Create an index transform, or update a transform if `if_seq_no` and `if_primary_term` are provided. externalDocs: - url: https://opensearch.org/docs/latest/im-plugin/index-transforms/transforms-apis/#create-a-transform-job + url: https://docs.opensearch.org/latest/im-plugin/index-transforms/transforms-apis/#create-a-transform-job parameters: - $ref: '#/components/parameters/transforms.put___path.id' - $ref: '#/components/parameters/transforms.put___query.if_primary_term' @@ -10640,7 +10778,7 @@ paths: x-version-added: '1.0' description: Returns the status and metadata of a transform job. externalDocs: - url: https://opensearch.org/docs/latest/im-plugin/index-transforms/transforms-apis/#get-the-status-of-a-transform-job + url: https://docs.opensearch.org/latest/im-plugin/index-transforms/transforms-apis/#get-the-status-of-a-transform-job parameters: - $ref: '#/components/parameters/transforms.explain___path.id' - $ref: '#/components/parameters/_global___query.pretty' @@ -10658,7 +10796,7 @@ paths: x-version-added: '1.0' description: Start transform. externalDocs: - url: https://opensearch.org/docs/latest/im-plugin/index-transforms/transforms-apis/#start-a-transform-job + url: https://docs.opensearch.org/latest/im-plugin/index-transforms/transforms-apis/#start-a-transform-job parameters: - $ref: '#/components/parameters/transforms.start___path.id' - $ref: '#/components/parameters/_global___query.pretty' @@ -10676,7 +10814,7 @@ paths: x-version-added: '1.0' description: Stop transform. externalDocs: - url: https://opensearch.org/docs/latest/im-plugin/index-transforms/transforms-apis/#stop-a-transform-job + url: https://docs.opensearch.org/latest/im-plugin/index-transforms/transforms-apis/#stop-a-transform-job parameters: - $ref: '#/components/parameters/transforms.stop___path.id' - $ref: '#/components/parameters/_global___query.pretty' @@ -10750,7 +10888,7 @@ paths: x-version-added: '2.11' description: Get one or more IP2Geo data sources, defaulting to returning all if no names specified. externalDocs: - url: https://docs.opensearch.org/docs/latest/ingest-pipelines/processors/ip2geo/#sending-a-get-request + url: https://docs.opensearch.org/latest/ingest-pipelines/processors/ip2geo/#sending-a-get-request responses: '200': $ref: '#/components/responses/geospatial.get_ip2geo_datasource___200' @@ -10767,7 +10905,7 @@ paths: x-version-added: '2.11' description: Delete a specific IP2Geo data source. externalDocs: - url: https://docs.opensearch.org/docs/latest/ingest-pipelines/processors/ip2geo/#deleting-the-ip2geo-data-source + url: https://docs.opensearch.org/latest/ingest-pipelines/processors/ip2geo/#deleting-the-ip2geo-data-source parameters: - $ref: '#/components/parameters/geospatial.delete_ip2geo_datasource___path.name' - $ref: '#/components/parameters/_global___query.pretty' @@ -10786,7 +10924,7 @@ paths: x-version-added: '2.11' description: Get one or more IP2Geo data sources, defaulting to returning all if no names specified. externalDocs: - url: https://docs.opensearch.org/docs/latest/ingest-pipelines/processors/ip2geo/#sending-a-get-request + url: https://docs.opensearch.org/latest/ingest-pipelines/processors/ip2geo/#sending-a-get-request parameters: - $ref: '#/components/parameters/geospatial.get_ip2geo_datasource___path.name' - $ref: '#/components/parameters/_global___query.pretty' @@ -10807,7 +10945,7 @@ paths: - `endpoint`: `"https://geoip.maps.opensearch.org/v1/geolite2-city/manifest.json"` - `update_interval_in_days`: 3. externalDocs: - url: https://docs.opensearch.org/docs/latest/ingest-pipelines/processors/ip2geo/#data-source-options + url: https://docs.opensearch.org/latest/ingest-pipelines/processors/ip2geo/#data-source-options parameters: - $ref: '#/components/parameters/geospatial.put_ip2geo_datasource___path.name' - $ref: '#/components/parameters/_global___query.pretty' @@ -10829,7 +10967,7 @@ paths: x-version-added: '2.11' description: Update a specific IP2Geo data source. externalDocs: - url: https://docs.opensearch.org/docs/latest/ingest-pipelines/processors/ip2geo/#updating-an-ip2geo-data-source + url: https://docs.opensearch.org/latest/ingest-pipelines/processors/ip2geo/#updating-an-ip2geo-data-source parameters: - $ref: '#/components/parameters/geospatial.put_ip2geo_datasource_settings___path.name' - $ref: '#/components/parameters/_global___query.pretty' @@ -10866,7 +11004,7 @@ paths: x-version-added: '1.0' description: Allows to evaluate the quality of ranked search results over a set of typical search queries. externalDocs: - url: https://opensearch.org/docs/latest/api-reference/rank-eval/ + url: https://docs.opensearch.org/latest/api-reference/rank-eval/ parameters: - $ref: '#/components/parameters/rank_eval___query.allow_no_indices' - $ref: '#/components/parameters/rank_eval___query.expand_wildcards' @@ -10888,7 +11026,7 @@ paths: x-version-added: '1.0' description: Allows to evaluate the quality of ranked search results over a set of typical search queries. externalDocs: - url: https://opensearch.org/docs/latest/api-reference/rank-eval/ + url: https://docs.opensearch.org/latest/api-reference/rank-eval/ parameters: - $ref: '#/components/parameters/rank_eval___query.allow_no_indices' - $ref: '#/components/parameters/rank_eval___query.expand_wildcards' @@ -10911,7 +11049,7 @@ paths: x-version-added: '1.0' description: Returns information about ongoing index shard recoveries. externalDocs: - url: https://opensearch.org/docs/latest + url: https://docs.opensearch.org/latest/ parameters: - $ref: '#/components/parameters/indices.recovery___query.active_only' - $ref: '#/components/parameters/indices.recovery___query.detailed' @@ -10930,7 +11068,7 @@ paths: x-version-added: '1.0' description: Performs the refresh operation in one or more indexes. externalDocs: - url: https://opensearch.org/docs/latest/tuning-your-cluster/availability-and-recovery/remote-store/index/#refresh-level-and-request-level-durability + url: https://docs.opensearch.org/latest/api-reference/index-apis/refresh/ parameters: - $ref: '#/components/parameters/indices.refresh___query.allow_no_indices' - $ref: '#/components/parameters/indices.refresh___query.expand_wildcards' @@ -10949,7 +11087,7 @@ paths: x-version-added: '1.0' description: Performs the refresh operation in one or more indexes. externalDocs: - url: https://opensearch.org/docs/latest/tuning-your-cluster/availability-and-recovery/remote-store/index/#refresh-level-and-request-level-durability + url: https://docs.opensearch.org/latest/api-reference/index-apis/refresh/ parameters: - $ref: '#/components/parameters/indices.refresh___query.allow_no_indices' - $ref: '#/components/parameters/indices.refresh___query.expand_wildcards' @@ -10972,7 +11110,7 @@ paths: documents by a query, changing the destination index settings, or fetching the documents from a remote cluster. externalDocs: - url: https://opensearch.org/docs/latest/im-plugin/reindex-data/ + url: https://docs.opensearch.org/latest/im-plugin/reindex-data/ parameters: - $ref: '#/components/parameters/reindex___query.max_docs' - $ref: '#/components/parameters/reindex___query.refresh' @@ -11000,7 +11138,7 @@ paths: x-version-added: '1.0' description: Changes the number of requests per second for a particular reindex operation. externalDocs: - url: https://opensearch.org/docs/latest + url: https://docs.opensearch.org/latest/ parameters: - $ref: '#/components/parameters/reindex_rethrottle___path.task_id' - $ref: '#/components/parameters/reindex_rethrottle___query.requests_per_second' @@ -11019,7 +11157,7 @@ paths: x-version-added: '1.0' description: Returns the information about configured remote clusters. externalDocs: - url: https://opensearch.org/docs/latest/api-reference/remote-info/ + url: https://docs.opensearch.org/latest/api-reference/remote-info/ parameters: - $ref: '#/components/parameters/_global___query.pretty' - $ref: '#/components/parameters/_global___query.human' @@ -11036,7 +11174,7 @@ paths: x-version-added: '1.0' description: Restores from remote store. externalDocs: - url: https://opensearch.org/docs/latest/opensearch/remote/#restoring-from-a-backup + url: https://docs.opensearch.org/latest/tuning-your-cluster/availability-and-recovery/remote-store/index/#restoring-from-a-backup parameters: - $ref: '#/components/parameters/remote_store.restore___query.cluster_manager_timeout' - $ref: '#/components/parameters/remote_store.restore___query.wait_for_completion' @@ -11057,7 +11195,7 @@ paths: x-version-added: '1.0' description: Allows to use the Mustache language to pre-render a search definition. externalDocs: - url: https://opensearch.org/docs/latest/search-plugins/search-template/ + url: https://docs.opensearch.org/latest/search-plugins/search-template/ parameters: - $ref: '#/components/parameters/_global___query.pretty' - $ref: '#/components/parameters/_global___query.human' @@ -11075,7 +11213,7 @@ paths: x-version-added: '1.0' description: Allows to use the Mustache language to pre-render a search definition. externalDocs: - url: https://opensearch.org/docs/latest/search-plugins/search-template/ + url: https://docs.opensearch.org/latest/search-plugins/search-template/ parameters: - $ref: '#/components/parameters/_global___query.pretty' - $ref: '#/components/parameters/_global___query.human' @@ -11094,7 +11232,7 @@ paths: x-version-added: '1.0' description: Allows to use the Mustache language to pre-render a search definition. externalDocs: - url: https://opensearch.org/docs/latest/search-plugins/search-template/ + url: https://docs.opensearch.org/latest/search-plugins/search-template/ parameters: - $ref: '#/components/parameters/render_search_template___path.id' - $ref: '#/components/parameters/_global___query.pretty' @@ -11113,7 +11251,7 @@ paths: x-version-added: '1.0' description: Allows to use the Mustache language to pre-render a search definition. externalDocs: - url: https://opensearch.org/docs/latest/search-plugins/search-template/ + url: https://docs.opensearch.org/latest/search-plugins/search-template/ parameters: - $ref: '#/components/parameters/render_search_template___path.id' - $ref: '#/components/parameters/_global___query.pretty' @@ -11133,7 +11271,7 @@ paths: x-version-added: '1.0' description: Returns information about any matching indexes, aliases, and data streams. externalDocs: - url: https://opensearch.org/docs/latest + url: https://docs.opensearch.org/latest/ parameters: - $ref: '#/components/parameters/indices.resolve_index___path.name' - $ref: '#/components/parameters/indices.resolve_index___query.expand_wildcards' @@ -11152,7 +11290,7 @@ paths: x-version-added: '1.0' description: Returns all script contexts. externalDocs: - url: https://opensearch.org/docs/latest/api-reference/script-apis/get-script-contexts/ + url: https://docs.opensearch.org/latest/api-reference/script-apis/get-script-contexts/ parameters: - $ref: '#/components/parameters/_global___query.pretty' - $ref: '#/components/parameters/_global___query.human' @@ -11169,7 +11307,7 @@ paths: x-version-added: '1.0' description: Returns available script types, languages and contexts. externalDocs: - url: https://opensearch.org/docs/latest/api-reference/script-apis/get-script-language/ + url: https://docs.opensearch.org/latest/api-reference/script-apis/get-script-language/ parameters: - $ref: '#/components/parameters/_global___query.pretty' - $ref: '#/components/parameters/_global___query.human' @@ -11186,7 +11324,7 @@ paths: x-version-added: '1.0' description: Deletes a script. externalDocs: - url: https://opensearch.org/docs/latest/api-reference/script-apis/delete-script/ + url: https://docs.opensearch.org/latest/api-reference/script-apis/delete-script/ parameters: - $ref: '#/components/parameters/delete_script___path.id' - $ref: '#/components/parameters/delete_script___query.cluster_manager_timeout' @@ -11206,7 +11344,7 @@ paths: x-version-added: '1.0' description: Returns a script. externalDocs: - url: https://opensearch.org/docs/latest/api-reference/script-apis/get-stored-script/ + url: https://docs.opensearch.org/latest/api-reference/script-apis/get-stored-script/ parameters: - $ref: '#/components/parameters/get_script___path.id' - $ref: '#/components/parameters/get_script___query.cluster_manager_timeout' @@ -11225,7 +11363,7 @@ paths: x-version-added: '1.0' description: Creates or updates a script. externalDocs: - url: https://opensearch.org/docs/latest/api-reference/script-apis/create-stored-script/ + url: https://docs.opensearch.org/latest/api-reference/script-apis/create-stored-script/ parameters: - $ref: '#/components/parameters/put_script___path.id' - $ref: '#/components/parameters/put_script___query.cluster_manager_timeout' @@ -11248,7 +11386,7 @@ paths: x-version-added: '1.0' description: Creates or updates a script. externalDocs: - url: https://opensearch.org/docs/latest/api-reference/script-apis/create-stored-script/ + url: https://docs.opensearch.org/latest/api-reference/script-apis/create-stored-script/ parameters: - $ref: '#/components/parameters/put_script___path.id' - $ref: '#/components/parameters/put_script___query.cluster_manager_timeout' @@ -11272,7 +11410,7 @@ paths: x-version-added: '1.0' description: Creates or updates a script. externalDocs: - url: https://opensearch.org/docs/latest/api-reference/script-apis/create-stored-script/ + url: https://docs.opensearch.org/latest/api-reference/script-apis/create-stored-script/ parameters: - $ref: '#/components/parameters/put_script___path.context' - $ref: '#/components/parameters/put_script___path.id' @@ -11296,7 +11434,7 @@ paths: x-version-added: '1.0' description: Creates or updates a script. externalDocs: - url: https://opensearch.org/docs/latest/api-reference/script-apis/create-stored-script/ + url: https://docs.opensearch.org/latest/api-reference/script-apis/create-stored-script/ parameters: - $ref: '#/components/parameters/put_script___path.context' - $ref: '#/components/parameters/put_script___path.id' @@ -11321,7 +11459,7 @@ paths: x-version-added: '1.0' description: Allows an arbitrary script to be executed and a result to be returned. externalDocs: - url: https://opensearch.org/docs/latest/api-reference/script-apis/exec-script/ + url: https://docs.opensearch.org/latest/api-reference/script-apis/exec-script/ parameters: - $ref: '#/components/parameters/_global___query.pretty' - $ref: '#/components/parameters/_global___query.human' @@ -11339,7 +11477,7 @@ paths: x-version-added: '1.0' description: Allows an arbitrary script to be executed and a result to be returned. externalDocs: - url: https://opensearch.org/docs/latest/api-reference/script-apis/exec-script/ + url: https://docs.opensearch.org/latest/api-reference/script-apis/exec-script/ parameters: - $ref: '#/components/parameters/_global___query.pretty' - $ref: '#/components/parameters/_global___query.human' @@ -11358,7 +11496,7 @@ paths: x-version-added: '1.0' description: Returns results matching a query. externalDocs: - url: https://opensearch.org/docs/latest/api-reference/search/ + url: https://docs.opensearch.org/latest/api-reference/search/ parameters: - $ref: '#/components/parameters/search___query._source' - $ref: '#/components/parameters/search___query._source_excludes' @@ -11428,7 +11566,7 @@ paths: x-version-added: '1.0' description: Returns results matching a query. externalDocs: - url: https://opensearch.org/docs/latest/api-reference/search/ + url: https://docs.opensearch.org/latest/api-reference/search/ parameters: - $ref: '#/components/parameters/search___query._source' - $ref: '#/components/parameters/search___query._source_excludes' @@ -11499,7 +11637,7 @@ paths: x-version-added: '1.0' description: Returns information about the indexes and shards that a search request would be executed against. externalDocs: - url: https://opensearch.org/docs/latest + url: https://docs.opensearch.org/latest/ parameters: - $ref: '#/components/parameters/search_shards___query.allow_no_indices' - $ref: '#/components/parameters/search_shards___query.expand_wildcards' @@ -11523,7 +11661,7 @@ paths: x-version-added: '1.0' description: Returns information about the indexes and shards that a search request would be executed against. externalDocs: - url: https://opensearch.org/docs/latest + url: https://docs.opensearch.org/latest/ parameters: - $ref: '#/components/parameters/search_shards___query.allow_no_indices' - $ref: '#/components/parameters/search_shards___query.expand_wildcards' @@ -11597,7 +11735,7 @@ paths: x-version-added: '2.9' description: Creates or replaces the specified search pipeline. externalDocs: - url: https://opensearch.org/docs/latest/search-plugins/search-pipelines/creating-search-pipeline/ + url: https://docs.opensearch.org/latest/search-plugins/search-pipelines/creating-search-pipeline/ parameters: - $ref: '#/components/parameters/search_pipeline.put___path.id' - $ref: '#/components/parameters/search_pipeline.put___query.cluster_manager_timeout' @@ -11619,7 +11757,7 @@ paths: x-version-added: '2.4' description: Deletes one or more point in time searches based on the IDs passed. externalDocs: - url: https://opensearch.org/docs/latest/search-plugins/point-in-time-api/#delete-pits + url: https://docs.opensearch.org/latest/api-reference/search-apis/point-in-time-api/#delete-pits requestBody: $ref: '#/components/requestBodies/delete_pit' responses: @@ -11638,7 +11776,7 @@ paths: x-version-added: '2.4' description: Deletes all active point in time searches. externalDocs: - url: https://opensearch.org/docs/latest/search-plugins/point-in-time-api/#delete-pits + url: https://docs.opensearch.org/latest/api-reference/search-apis/point-in-time-api/#delete-pits responses: '200': $ref: '#/components/responses/delete_all_pits___200' @@ -11654,7 +11792,7 @@ paths: x-version-added: '2.4' description: Lists all active point in time searches. externalDocs: - url: https://opensearch.org/docs/latest/search-plugins/point-in-time-api/#list-all-pits + url: https://docs.opensearch.org/latest/api-reference/search-apis/point-in-time-api/#list-all-pits responses: '200': $ref: '#/components/responses/get_all_pits___200' @@ -11671,7 +11809,7 @@ paths: x-version-added: '1.0' description: Explicitly clears the search context for a scroll. externalDocs: - url: https://opensearch.org/docs/latest/api-reference/scroll/ + url: https://docs.opensearch.org/latest/api-reference/scroll/ parameters: - $ref: '#/components/parameters/_global___query.pretty' - $ref: '#/components/parameters/_global___query.human' @@ -11691,7 +11829,7 @@ paths: x-version-added: '1.0' description: Allows to retrieve a large numbers of results from a single search request. externalDocs: - url: https://opensearch.org/docs/latest/api-reference/scroll/#path-and-http-methods + url: https://docs.opensearch.org/latest/api-reference/search-apis/scroll/#endpoints parameters: - $ref: '#/components/parameters/scroll___query.rest_total_hits_as_int' - $ref: '#/components/parameters/scroll___query.scroll' @@ -11712,7 +11850,7 @@ paths: x-version-added: '1.0' description: Allows to retrieve a large numbers of results from a single search request. externalDocs: - url: https://opensearch.org/docs/latest/api-reference/scroll/#path-and-http-methods + url: https://docs.opensearch.org/latest/api-reference/search-apis/scroll/#endpoints parameters: - $ref: '#/components/parameters/scroll___query.rest_total_hits_as_int' - $ref: '#/components/parameters/scroll___query.scroll' @@ -11737,7 +11875,7 @@ paths: x-version-deprecated: '1.0' description: Explicitly clears the search context for a scroll. externalDocs: - url: https://opensearch.org/docs/latest/api-reference/scroll/ + url: https://docs.opensearch.org/latest/api-reference/scroll/ parameters: - $ref: '#/components/parameters/clear_scroll___path.scroll_id' - $ref: '#/components/parameters/_global___query.pretty' @@ -11761,7 +11899,7 @@ paths: x-version-deprecated: '1.0' description: Allows to retrieve a large numbers of results from a single search request. externalDocs: - url: https://opensearch.org/docs/latest/api-reference/scroll/#path-and-http-methods + url: https://docs.opensearch.org/latest/api-reference/search-apis/scroll/#endpoints parameters: - $ref: '#/components/parameters/scroll___path.scroll_id' - $ref: '#/components/parameters/scroll___query.rest_total_hits_as_int' @@ -11786,7 +11924,7 @@ paths: x-version-deprecated: '1.0' description: Allows to retrieve a large numbers of results from a single search request. externalDocs: - url: https://opensearch.org/docs/latest/api-reference/scroll/#path-and-http-methods + url: https://docs.opensearch.org/latest/api-reference/search-apis/scroll/#endpoints parameters: - $ref: '#/components/parameters/scroll___path.scroll_id' - $ref: '#/components/parameters/scroll___query.rest_total_hits_as_int' @@ -11809,7 +11947,7 @@ paths: x-version-added: '1.0' description: Allows to use the Mustache language to pre-render a search definition. externalDocs: - url: https://opensearch.org/docs/latest/search-plugins/search-template/ + url: https://docs.opensearch.org/latest/search-plugins/search-template/ parameters: - $ref: '#/components/parameters/search_template___query.allow_no_indices' - $ref: '#/components/parameters/search_template___query.ccs_minimize_roundtrips' @@ -11842,7 +11980,7 @@ paths: x-version-added: '1.0' description: Allows to use the Mustache language to pre-render a search definition. externalDocs: - url: https://opensearch.org/docs/latest/search-plugins/search-template/ + url: https://docs.opensearch.org/latest/search-plugins/search-template/ parameters: - $ref: '#/components/parameters/search_template___query.allow_no_indices' - $ref: '#/components/parameters/search_template___query.ccs_minimize_roundtrips' @@ -11879,7 +12017,7 @@ paths: - amazon-serverless description: Provides low-level information about segments in a Lucene index. externalDocs: - url: https://opensearch.org/docs/latest + url: https://docs.opensearch.org/latest/ parameters: - $ref: '#/components/parameters/indices.segments___query.allow_no_indices' - $ref: '#/components/parameters/indices.segments___query.expand_wildcards' @@ -11903,7 +12041,7 @@ paths: - amazon-serverless description: Returns settings for one or more indexes. externalDocs: - url: https://opensearch.org/docs/latest/api-reference/index-apis/get-settings/ + url: https://docs.opensearch.org/latest/api-reference/index-apis/get-settings/ parameters: - $ref: '#/components/parameters/indices.get_settings___query.allow_no_indices' - $ref: '#/components/parameters/indices.get_settings___query.cluster_manager_timeout' @@ -11927,7 +12065,7 @@ paths: x-version-added: '1.0' description: Updates the index settings. externalDocs: - url: https://opensearch.org/docs/latest/api-reference/index-apis/update-settings/ + url: https://docs.opensearch.org/latest/api-reference/index-apis/update-settings/ parameters: - $ref: '#/components/parameters/indices.put_settings___query.allow_no_indices' - $ref: '#/components/parameters/indices.put_settings___query.cluster_manager_timeout' @@ -11954,7 +12092,7 @@ paths: x-version-added: '1.0' description: Returns settings for one or more indexes. externalDocs: - url: https://opensearch.org/docs/latest/api-reference/index-apis/get-settings/ + url: https://docs.opensearch.org/latest/api-reference/index-apis/get-settings/ parameters: - $ref: '#/components/parameters/indices.get_settings___path.name' - $ref: '#/components/parameters/indices.get_settings___query.allow_no_indices' @@ -11980,7 +12118,7 @@ paths: x-version-added: '1.0' description: Provides store information for shard copies of indexes. externalDocs: - url: https://opensearch.org/docs/latest + url: https://docs.opensearch.org/latest/ parameters: - $ref: '#/components/parameters/indices.shard_stores___query.allow_no_indices' - $ref: '#/components/parameters/indices.shard_stores___query.expand_wildcards' @@ -12001,7 +12139,7 @@ paths: x-version-added: '1.0' description: Returns information about a snapshot repository. externalDocs: - url: https://opensearch.org/docs/latest/api-reference/snapshots/get-snapshot-repository/ + url: https://docs.opensearch.org/latest/api-reference/snapshots/get-snapshot-repository/ parameters: - $ref: '#/components/parameters/snapshot.get_repository___query.cluster_manager_timeout' - $ref: '#/components/parameters/snapshot.get_repository___query.local' @@ -12021,7 +12159,7 @@ paths: x-version-added: '1.0' description: Returns information about the status of a snapshot. externalDocs: - url: https://opensearch.org/docs/latest/api-reference/snapshots/get-snapshot-status/ + url: https://docs.opensearch.org/latest/api-reference/snapshots/get-snapshot-status/ parameters: - $ref: '#/components/parameters/snapshot.status___query.cluster_manager_timeout' - $ref: '#/components/parameters/snapshot.status___query.ignore_unavailable' @@ -12041,7 +12179,7 @@ paths: x-version-added: '1.0' description: Deletes a snapshot repository. externalDocs: - url: https://opensearch.org/docs/latest/api-reference/snapshots/delete-snapshot-repository/ + url: https://docs.opensearch.org/latest/api-reference/snapshots/delete-snapshot-repository/ parameters: - $ref: '#/components/parameters/snapshot.delete_repository___path.repository' - $ref: '#/components/parameters/snapshot.delete_repository___query.cluster_manager_timeout' @@ -12061,7 +12199,7 @@ paths: x-version-added: '1.0' description: Returns information about a snapshot repository. externalDocs: - url: https://opensearch.org/docs/latest/api-reference/snapshots/get-snapshot-repository/ + url: https://docs.opensearch.org/latest/api-reference/snapshots/get-snapshot-repository/ parameters: - $ref: '#/components/parameters/snapshot.get_repository___path.repository' - $ref: '#/components/parameters/snapshot.get_repository___query.cluster_manager_timeout' @@ -12081,7 +12219,7 @@ paths: x-version-added: '1.0' description: Creates a snapshot repository. externalDocs: - url: https://opensearch.org/docs/latest/api-reference/snapshots/create-repository/ + url: https://docs.opensearch.org/latest/api-reference/snapshots/create-repository/ parameters: - $ref: '#/components/parameters/snapshot.create_repository___path.repository' - $ref: '#/components/parameters/snapshot.create_repository___query.cluster_manager_timeout' @@ -12104,7 +12242,7 @@ paths: x-version-added: '1.0' description: Creates a snapshot repository. externalDocs: - url: https://opensearch.org/docs/latest/api-reference/snapshots/create-repository/ + url: https://docs.opensearch.org/latest/api-reference/snapshots/create-repository/ parameters: - $ref: '#/components/parameters/snapshot.create_repository___path.repository' - $ref: '#/components/parameters/snapshot.create_repository___query.cluster_manager_timeout' @@ -12128,7 +12266,7 @@ paths: x-version-added: '1.0' description: Removes any stale data from a snapshot repository. externalDocs: - url: https://opensearch.org/docs/latest + url: https://docs.opensearch.org/latest/ parameters: - $ref: '#/components/parameters/snapshot.cleanup_repository___path.repository' - $ref: '#/components/parameters/snapshot.cleanup_repository___query.cluster_manager_timeout' @@ -12149,7 +12287,7 @@ paths: x-version-added: '1.0' description: Returns information about the status of a snapshot. externalDocs: - url: https://opensearch.org/docs/latest/api-reference/snapshots/get-snapshot-status/ + url: https://docs.opensearch.org/latest/api-reference/snapshots/get-snapshot-status/ parameters: - $ref: '#/components/parameters/snapshot.status___path.repository' - $ref: '#/components/parameters/snapshot.status___query.cluster_manager_timeout' @@ -12170,7 +12308,7 @@ paths: x-version-added: '1.0' description: Verifies a repository. externalDocs: - url: https://opensearch.org/docs/latest/api-reference/snapshots/verify-snapshot-repository/ + url: https://docs.opensearch.org/latest/api-reference/snapshots/verify-snapshot-repository/ parameters: - $ref: '#/components/parameters/snapshot.verify_repository___path.repository' - $ref: '#/components/parameters/snapshot.verify_repository___query.cluster_manager_timeout' @@ -12191,7 +12329,7 @@ paths: x-version-added: '1.0' description: Deletes a snapshot. externalDocs: - url: https://opensearch.org/docs/latest/api-reference/snapshots/delete-snapshot/ + url: https://docs.opensearch.org/latest/api-reference/snapshots/delete-snapshot/ parameters: - $ref: '#/components/parameters/snapshot.delete___path.repository' - $ref: '#/components/parameters/snapshot.delete___path.snapshot' @@ -12211,7 +12349,7 @@ paths: x-version-added: '1.0' description: Returns information about a snapshot. externalDocs: - url: https://opensearch.org/docs/latest + url: https://docs.opensearch.org/latest/ parameters: - $ref: '#/components/parameters/snapshot.get___path.repository' - $ref: '#/components/parameters/snapshot.get___path.snapshot' @@ -12233,7 +12371,7 @@ paths: x-version-added: '1.0' description: Creates a snapshot within an existing repository. externalDocs: - url: https://opensearch.org/docs/latest/api-reference/snapshots/create-snapshot/ + url: https://docs.opensearch.org/latest/api-reference/snapshots/create-snapshot/ parameters: - $ref: '#/components/parameters/snapshot.create___path.repository' - $ref: '#/components/parameters/snapshot.create___path.snapshot' @@ -12256,7 +12394,7 @@ paths: x-version-added: '1.0' description: Creates a snapshot within an existing repository. externalDocs: - url: https://opensearch.org/docs/latest/api-reference/snapshots/create-snapshot/ + url: https://docs.opensearch.org/latest/api-reference/snapshots/create-snapshot/ parameters: - $ref: '#/components/parameters/snapshot.create___path.repository' - $ref: '#/components/parameters/snapshot.create___path.snapshot' @@ -12280,7 +12418,7 @@ paths: x-version-added: '1.0' description: Creates a clone of all or part of a snapshot in the same repository as the original snapshot. externalDocs: - url: https://opensearch.org/docs/latest + url: https://docs.opensearch.org/latest/ parameters: - $ref: '#/components/parameters/snapshot.clone___path.repository' - $ref: '#/components/parameters/snapshot.clone___path.snapshot' @@ -12304,7 +12442,7 @@ paths: x-version-added: '1.0' description: Restores a snapshot. externalDocs: - url: https://opensearch.org/docs/latest/api-reference/snapshots/restore-snapshot/ + url: https://docs.opensearch.org/latest/api-reference/snapshots/restore-snapshot/ parameters: - $ref: '#/components/parameters/snapshot.restore___path.repository' - $ref: '#/components/parameters/snapshot.restore___path.snapshot' @@ -12328,7 +12466,7 @@ paths: x-version-added: '1.0' description: Returns information about the status of a snapshot. externalDocs: - url: https://opensearch.org/docs/latest/api-reference/snapshots/get-snapshot-status/ + url: https://docs.opensearch.org/latest/api-reference/snapshots/get-snapshot-status/ parameters: - $ref: '#/components/parameters/snapshot.status___path.repository' - $ref: '#/components/parameters/snapshot.status___path.snapshot' @@ -12350,7 +12488,7 @@ paths: x-version-added: '1.0' description: Provides statistics on operations happening in an index. externalDocs: - url: https://opensearch.org/docs/latest + url: https://docs.opensearch.org/latest/ parameters: - $ref: '#/components/parameters/indices.stats___query.completion_fields' - $ref: '#/components/parameters/indices.stats___query.expand_wildcards' @@ -12376,7 +12514,7 @@ paths: x-version-added: '1.0' description: Provides statistics on operations happening in an index. externalDocs: - url: https://opensearch.org/docs/latest + url: https://docs.opensearch.org/latest/ parameters: - $ref: '#/components/parameters/indices.stats___path.metric' - $ref: '#/components/parameters/indices.stats___query.completion_fields' @@ -12403,7 +12541,7 @@ paths: x-version-added: '1.0' description: Returns a list of tasks. externalDocs: - url: https://opensearch.org/docs/latest/api-reference/tasks/ + url: https://docs.opensearch.org/latest/api-reference/tasks/ parameters: - $ref: '#/components/parameters/tasks.list___query.actions' - $ref: '#/components/parameters/tasks.list___query.detailed' @@ -12427,7 +12565,7 @@ paths: x-version-added: '1.0' description: Cancels a task, if it can be cancelled through an API. externalDocs: - url: https://opensearch.org/docs/latest/api-reference/tasks/#task-canceling + url: https://docs.opensearch.org/latest/api-reference/tasks/cancel-tasks/ parameters: - $ref: '#/components/parameters/tasks.cancel___query.actions' - $ref: '#/components/parameters/tasks.cancel___query.nodes' @@ -12448,7 +12586,7 @@ paths: x-version-added: '1.0' description: Returns information about a task. externalDocs: - url: https://opensearch.org/docs/latest/api-reference/tasks/ + url: https://docs.opensearch.org/latest/api-reference/tasks/ parameters: - $ref: '#/components/parameters/tasks.get___path.task_id' - $ref: '#/components/parameters/tasks.get___query.timeout' @@ -12468,7 +12606,7 @@ paths: x-version-added: '1.0' description: Cancels a task, if it can be cancelled through an API. externalDocs: - url: https://opensearch.org/docs/latest/api-reference/tasks/#task-canceling + url: https://docs.opensearch.org/latest/api-reference/tasks/cancel-tasks/ parameters: - $ref: '#/components/parameters/tasks.cancel___path.task_id' - $ref: '#/components/parameters/tasks.cancel___query.actions' @@ -12490,7 +12628,7 @@ paths: x-version-added: '1.0' description: Returns an index template. externalDocs: - url: https://opensearch.org/docs/latest + url: https://docs.opensearch.org/latest/ parameters: - $ref: '#/components/parameters/indices.get_template___query.cluster_manager_timeout' - $ref: '#/components/parameters/indices.get_template___query.flat_settings' @@ -12511,7 +12649,7 @@ paths: x-version-added: '1.0' description: Deletes an index template. externalDocs: - url: https://opensearch.org/docs/latest + url: https://docs.opensearch.org/latest/ parameters: - $ref: '#/components/parameters/indices.delete_template___path.name' - $ref: '#/components/parameters/indices.delete_template___query.cluster_manager_timeout' @@ -12531,7 +12669,7 @@ paths: x-version-added: '1.0' description: Returns an index template. externalDocs: - url: https://opensearch.org/docs/latest + url: https://docs.opensearch.org/latest/ parameters: - $ref: '#/components/parameters/indices.get_template___path.name' - $ref: '#/components/parameters/indices.get_template___query.cluster_manager_timeout' @@ -12552,7 +12690,7 @@ paths: x-version-added: '1.0' description: Returns information about whether a particular index template exists. externalDocs: - url: https://opensearch.org/docs/latest + url: https://docs.opensearch.org/latest/ parameters: - $ref: '#/components/parameters/indices.exists_template___path.name' - $ref: '#/components/parameters/indices.exists_template___query.cluster_manager_timeout' @@ -12573,7 +12711,7 @@ paths: x-version-added: '1.0' description: Creates or updates an index template. externalDocs: - url: https://opensearch.org/docs/latest/im-plugin/index-templates/ + url: https://docs.opensearch.org/latest/im-plugin/index-templates/ parameters: - $ref: '#/components/parameters/indices.put_template___path.name' - $ref: '#/components/parameters/indices.put_template___query.cluster_manager_timeout' @@ -12596,7 +12734,7 @@ paths: x-version-added: '1.0' description: Creates or updates an index template. externalDocs: - url: https://opensearch.org/docs/latest/im-plugin/index-templates/ + url: https://docs.opensearch.org/latest/im-plugin/index-templates/ parameters: - $ref: '#/components/parameters/indices.put_template___path.name' - $ref: '#/components/parameters/indices.put_template___query.cluster_manager_timeout' @@ -12620,7 +12758,7 @@ paths: x-version-added: '1.0' description: Changes the number of requests per second for a particular Update By Query operation. externalDocs: - url: https://opensearch.org/docs/latest + url: https://docs.opensearch.org/latest/ parameters: - $ref: '#/components/parameters/update_by_query_rethrottle___path.task_id' - $ref: '#/components/parameters/update_by_query_rethrottle___query.requests_per_second' @@ -12640,7 +12778,7 @@ paths: x-version-deprecated: '1.0' description: The `_upgrade` API is no longer useful and will be removed. externalDocs: - url: https://opensearch.org/docs/latest + url: https://docs.opensearch.org/latest/ parameters: - $ref: '#/components/parameters/indices.get_upgrade___query.allow_no_indices' - $ref: '#/components/parameters/indices.get_upgrade___query.expand_wildcards' @@ -12660,7 +12798,7 @@ paths: x-version-deprecated: '1.0' description: The `_upgrade` API is no longer useful and will be removed. externalDocs: - url: https://opensearch.org/docs/latest + url: https://docs.opensearch.org/latest/ parameters: - $ref: '#/components/parameters/indices.upgrade___query.allow_no_indices' - $ref: '#/components/parameters/indices.upgrade___query.expand_wildcards' @@ -12682,7 +12820,7 @@ paths: x-version-added: '1.0' description: Allows a user to validate a potentially expensive query without executing it. externalDocs: - url: https://opensearch.org/docs/latest + url: https://docs.opensearch.org/latest/ parameters: - $ref: '#/components/parameters/indices.validate_query___query.all_shards' - $ref: '#/components/parameters/indices.validate_query___query.allow_no_indices' @@ -12712,7 +12850,7 @@ paths: x-version-added: '1.0' description: Allows a user to validate a potentially expensive query without executing it. externalDocs: - url: https://opensearch.org/docs/latest + url: https://docs.opensearch.org/latest/ parameters: - $ref: '#/components/parameters/indices.validate_query___query.all_shards' - $ref: '#/components/parameters/indices.validate_query___query.allow_no_indices' @@ -12824,7 +12962,7 @@ paths: Updates an alias to point to a new index when the existing index is considered to be too large or too old. externalDocs: - url: https://opensearch.org/docs/latest/dashboards/im-dashboards/rollover/ + url: https://docs.opensearch.org/latest/dashboards/im-dashboards/rollover/ parameters: - $ref: '#/components/parameters/indices.rollover___path.alias' - $ref: '#/components/parameters/indices.rollover___query.cluster_manager_timeout' @@ -12851,7 +12989,7 @@ paths: Updates an alias to point to a new index when the existing index is considered to be too large or too old. externalDocs: - url: https://opensearch.org/docs/latest/dashboards/im-dashboards/rollover/ + url: https://docs.opensearch.org/latest/dashboards/im-dashboards/rollover/ parameters: - $ref: '#/components/parameters/indices.rollover___path.alias' - $ref: '#/components/parameters/indices.rollover___path.new_index' @@ -12877,7 +13015,7 @@ paths: x-version-added: '1.0' description: Deletes an index. externalDocs: - url: https://opensearch.org/docs/latest/api-reference/index-apis/delete-index/ + url: https://docs.opensearch.org/latest/api-reference/index-apis/delete-index/ parameters: - $ref: '#/components/parameters/indices.delete___path.index' - $ref: '#/components/parameters/indices.delete___query.allow_no_indices' @@ -12902,7 +13040,7 @@ paths: x-version-added: '1.0' description: Returns information about one or more indexes. externalDocs: - url: https://opensearch.org/docs/latest/api-reference/index-apis/get-index/ + url: https://docs.opensearch.org/latest/api-reference/index-apis/get-index/ parameters: - $ref: '#/components/parameters/indices.get___path.index' - $ref: '#/components/parameters/indices.get___query.allow_no_indices' @@ -12927,7 +13065,7 @@ paths: x-version-added: '1.0' description: Returns information about whether a particular index exists. externalDocs: - url: https://opensearch.org/docs/latest/api-reference/index-apis/exists/ + url: https://docs.opensearch.org/latest/api-reference/index-apis/exists/ parameters: - $ref: '#/components/parameters/indices.exists___path.index' - $ref: '#/components/parameters/indices.exists___query.allow_no_indices' @@ -12953,7 +13091,7 @@ paths: x-version-added: '1.0' description: Creates an index with optional settings and mappings. externalDocs: - url: https://opensearch.org/docs/latest/api-reference/index-apis/create-index/ + url: https://docs.opensearch.org/latest/api-reference/index-apis/create-index/ parameters: - $ref: '#/components/parameters/indices.create___path.index' - $ref: '#/components/parameters/indices.create___query.cluster_manager_timeout' @@ -12981,7 +13119,7 @@ paths: x-version-added: '1.0' description: Returns an alias. externalDocs: - url: https://opensearch.org/docs/latest/im-plugin/index-alias/ + url: https://docs.opensearch.org/latest/im-plugin/index-alias/ parameters: - $ref: '#/components/parameters/indices.get_alias___path.index' - $ref: '#/components/parameters/indices.get_alias___query.allow_no_indices' @@ -13004,7 +13142,7 @@ paths: x-version-added: '1.0' description: Creates or updates an alias. externalDocs: - url: https://opensearch.org/docs/latest/api-reference/index-apis/update-alias/ + url: https://docs.opensearch.org/latest/api-reference/index-apis/update-alias/ parameters: - $ref: '#/components/parameters/indices.put_alias___path.index' - $ref: '#/components/parameters/indices.put_alias___query.cluster_manager_timeout' @@ -13027,7 +13165,7 @@ paths: x-version-added: '1.0' description: Deletes an alias. externalDocs: - url: https://opensearch.org/docs/latest/im-plugin/index-alias/#delete-aliases + url: https://docs.opensearch.org/latest/api-reference/alias/delete-alias/ parameters: - $ref: '#/components/parameters/indices.delete_alias___path.index' - $ref: '#/components/parameters/indices.delete_alias___path.name' @@ -13048,7 +13186,7 @@ paths: x-version-added: '1.0' description: Returns an alias. externalDocs: - url: https://opensearch.org/docs/latest/im-plugin/index-alias/ + url: https://docs.opensearch.org/latest/im-plugin/index-alias/ parameters: - $ref: '#/components/parameters/indices.get_alias___path.index' - $ref: '#/components/parameters/indices.get_alias___path.name' @@ -13072,7 +13210,7 @@ paths: x-version-added: '1.0' description: Returns information about whether a particular alias exists. externalDocs: - url: https://opensearch.org/docs/latest + url: https://docs.opensearch.org/latest/ parameters: - $ref: '#/components/parameters/indices.exists_alias___path.index' - $ref: '#/components/parameters/indices.exists_alias___path.name' @@ -13096,7 +13234,7 @@ paths: x-version-added: '1.0' description: Creates or updates an alias. externalDocs: - url: https://opensearch.org/docs/latest/api-reference/index-apis/update-alias/ + url: https://docs.opensearch.org/latest/api-reference/index-apis/update-alias/ parameters: - $ref: '#/components/parameters/indices.put_alias___path.index' - $ref: '#/components/parameters/indices.put_alias___path.name' @@ -13119,7 +13257,7 @@ paths: x-version-added: '1.0' description: Creates or updates an alias. externalDocs: - url: https://opensearch.org/docs/latest/api-reference/index-apis/update-alias/ + url: https://docs.opensearch.org/latest/api-reference/index-apis/update-alias/ parameters: - $ref: '#/components/parameters/indices.put_alias___path.index' - $ref: '#/components/parameters/indices.put_alias___path.name' @@ -13140,10 +13278,13 @@ paths: put: operationId: indices.put_alias.8 x-operation-group: indices.put_alias + deprecated: true + x-deprecation-message: Use the singular `_alias` form. The plural `_aliases` is retained as a back-compat alias and is structurally equivalent. x-version-added: '1.0' + x-version-deprecated: '1.0' description: Creates or updates an alias. externalDocs: - url: https://opensearch.org/docs/latest/api-reference/index-apis/update-alias/ + url: https://docs.opensearch.org/latest/api-reference/index-apis/update-alias/ parameters: - $ref: '#/components/parameters/indices.put_alias___path.index' - $ref: '#/components/parameters/indices.put_alias___query.cluster_manager_timeout' @@ -13163,10 +13304,13 @@ paths: delete: operationId: indices.delete_alias.1 x-operation-group: indices.delete_alias + deprecated: true + x-deprecation-message: Use the singular `_alias` form. The plural `_aliases` is retained as a back-compat alias and is structurally equivalent. x-version-added: '1.0' + x-version-deprecated: '1.0' description: Deletes an alias. externalDocs: - url: https://opensearch.org/docs/latest/im-plugin/index-alias/#delete-aliases + url: https://docs.opensearch.org/latest/api-reference/alias/delete-alias/ parameters: - $ref: '#/components/parameters/indices.delete_alias___path.index' - $ref: '#/components/parameters/indices.delete_alias___path.name' @@ -13184,10 +13328,13 @@ paths: post: operationId: indices.put_alias.9 x-operation-group: indices.put_alias + deprecated: true + x-deprecation-message: Use the singular `_alias` form. The plural `_aliases` is retained as a back-compat alias and is structurally equivalent. x-version-added: '1.0' + x-version-deprecated: '1.0' description: Creates or updates an alias. externalDocs: - url: https://opensearch.org/docs/latest/api-reference/index-apis/update-alias/ + url: https://docs.opensearch.org/latest/api-reference/index-apis/update-alias/ parameters: - $ref: '#/components/parameters/indices.put_alias___path.index' - $ref: '#/components/parameters/indices.put_alias___path.name' @@ -13207,10 +13354,13 @@ paths: put: operationId: indices.put_alias.10 x-operation-group: indices.put_alias + deprecated: true + x-deprecation-message: Use the singular `_alias` form. The plural `_aliases` is retained as a back-compat alias and is structurally equivalent. x-version-added: '1.0' + x-version-deprecated: '1.0' description: Creates or updates an alias. externalDocs: - url: https://opensearch.org/docs/latest/api-reference/index-apis/update-alias/ + url: https://docs.opensearch.org/latest/api-reference/index-apis/update-alias/ parameters: - $ref: '#/components/parameters/indices.put_alias___path.index' - $ref: '#/components/parameters/indices.put_alias___path.name' @@ -13234,7 +13384,7 @@ paths: x-version-added: '1.0' description: Performs the analysis process on a text and return the tokens breakdown of the text. externalDocs: - url: https://opensearch.org/docs/latest/api-reference/analyze-apis/perform-text-analysis/ + url: https://docs.opensearch.org/latest/api-reference/analyze-apis/perform-text-analysis/ parameters: - $ref: '#/components/parameters/indices.analyze___path.index' - $ref: '#/components/parameters/indices.analyze___query.index' @@ -13254,7 +13404,7 @@ paths: x-version-added: '1.0' description: Performs the analysis process on a text and return the tokens breakdown of the text. externalDocs: - url: https://opensearch.org/docs/latest/api-reference/analyze-apis/perform-text-analysis/ + url: https://docs.opensearch.org/latest/api-reference/analyze-apis/perform-text-analysis/ parameters: - $ref: '#/components/parameters/indices.analyze___path.index' - $ref: '#/components/parameters/indices.analyze___query.index' @@ -13275,7 +13425,7 @@ paths: x-version-added: '1.0' description: Adds a block to an index. externalDocs: - url: https://opensearch.org/docs/latest + url: https://docs.opensearch.org/latest/ parameters: - $ref: '#/components/parameters/indices.add_block___path.block' - $ref: '#/components/parameters/indices.add_block___path.index' @@ -13300,7 +13450,7 @@ paths: x-version-added: '1.0' description: Allows to perform multiple index/update/delete operations in a single request. externalDocs: - url: https://opensearch.org/docs/latest/api-reference/document-apis/bulk/ + url: https://docs.opensearch.org/latest/api-reference/document-apis/bulk/ parameters: - $ref: '#/components/parameters/bulk___path.index' - $ref: '#/components/parameters/bulk___query._source' @@ -13330,7 +13480,7 @@ paths: x-version-added: '1.0' description: Allows to perform multiple index/update/delete operations in a single request. externalDocs: - url: https://opensearch.org/docs/latest/api-reference/document-apis/bulk/ + url: https://docs.opensearch.org/latest/api-reference/document-apis/bulk/ parameters: - $ref: '#/components/parameters/bulk___path.index' - $ref: '#/components/parameters/bulk___query._source' @@ -13361,7 +13511,7 @@ paths: x-version-added: '2.17' description: Allows to perform multiple index/update/delete operations using request response streaming. externalDocs: - url: https://opensearch.org/docs/latest/api-reference/document-apis/bulk-streaming/ + url: https://docs.opensearch.org/latest/api-reference/document-apis/bulk-streaming/ parameters: - $ref: '#/components/parameters/bulk_stream___path.index' - $ref: '#/components/parameters/bulk_stream___query._source' @@ -13392,7 +13542,7 @@ paths: x-version-added: '2.17' description: Allows to perform multiple index/update/delete operations using request response streaming. externalDocs: - url: https://opensearch.org/docs/latest/api-reference/document-apis/bulk-streaming/ + url: https://docs.opensearch.org/latest/api-reference/document-apis/bulk-streaming/ parameters: - $ref: '#/components/parameters/bulk_stream___path.index' - $ref: '#/components/parameters/bulk_stream___query._source' @@ -13424,7 +13574,7 @@ paths: x-version-added: '1.0' description: Clears all or specific caches for one or more indexes. externalDocs: - url: https://opensearch.org/docs/latest/api-reference/index-apis/clear-index-cache/ + url: https://docs.opensearch.org/latest/api-reference/index-apis/clear-index-cache/ parameters: - $ref: '#/components/parameters/indices.clear_cache___path.index' - $ref: '#/components/parameters/indices.clear_cache___query.allow_no_indices' @@ -13451,7 +13601,7 @@ paths: x-version-added: '1.0' description: Clones an index. externalDocs: - url: https://opensearch.org/docs/latest/api-reference/index-apis/clone/ + url: https://docs.opensearch.org/latest/api-reference/index-apis/clone/ parameters: - $ref: '#/components/parameters/indices.clone___path.index' - $ref: '#/components/parameters/indices.clone___path.target' @@ -13477,7 +13627,7 @@ paths: x-version-added: '1.0' description: Clones an index. externalDocs: - url: https://opensearch.org/docs/latest/api-reference/index-apis/clone/ + url: https://docs.opensearch.org/latest/api-reference/index-apis/clone/ parameters: - $ref: '#/components/parameters/indices.clone___path.index' - $ref: '#/components/parameters/indices.clone___path.target' @@ -13504,7 +13654,7 @@ paths: x-version-added: '1.0' description: Closes an index. externalDocs: - url: https://opensearch.org/docs/latest/api-reference/index-apis/close-index/ + url: https://docs.opensearch.org/latest/api-reference/index-apis/close-index/ parameters: - $ref: '#/components/parameters/indices.close___path.index' - $ref: '#/components/parameters/indices.close___query.allow_no_indices' @@ -13529,7 +13679,7 @@ paths: x-version-added: '1.0' description: Returns number of documents matching a query. externalDocs: - url: https://opensearch.org/docs/latest/api-reference/count/ + url: https://docs.opensearch.org/latest/api-reference/count/ parameters: - $ref: '#/components/parameters/count___path.index' - $ref: '#/components/parameters/count___query.allow_no_indices' @@ -13562,7 +13712,7 @@ paths: x-version-added: '1.0' description: Returns number of documents matching a query. externalDocs: - url: https://opensearch.org/docs/latest/api-reference/count/ + url: https://docs.opensearch.org/latest/api-reference/count/ parameters: - $ref: '#/components/parameters/count___path.index' - $ref: '#/components/parameters/count___query.allow_no_indices' @@ -13599,7 +13749,7 @@ paths: Returns a 409 response when a document with a same ID already exists in the index. externalDocs: - url: https://opensearch.org/docs/latest/api-reference/document-apis/index-document/ + url: https://docs.opensearch.org/latest/api-reference/document-apis/index-document/ parameters: - $ref: '#/components/parameters/create___path.id' - $ref: '#/components/parameters/create___path.index' @@ -13629,7 +13779,7 @@ paths: Returns a 409 response when a document with a same ID already exists in the index. externalDocs: - url: https://opensearch.org/docs/latest/api-reference/document-apis/index-document/ + url: https://docs.opensearch.org/latest/api-reference/document-apis/index-document/ parameters: - $ref: '#/components/parameters/create___path.id' - $ref: '#/components/parameters/create___path.index' @@ -13657,7 +13807,7 @@ paths: x-version-added: '1.0' description: Deletes documents matching the provided query. externalDocs: - url: https://opensearch.org/docs/latest/api-reference/document-apis/delete-by-query/ + url: https://docs.opensearch.org/latest/api-reference/document-apis/delete-by-query/ parameters: - $ref: '#/components/parameters/delete_by_query___path.index' - $ref: '#/components/parameters/delete_by_query___query._source' @@ -13710,7 +13860,7 @@ paths: x-version-added: '1.0' description: Creates or updates a document in an index. externalDocs: - url: https://opensearch.org/docs/latest/api-reference/document-apis/index-document/ + url: https://docs.opensearch.org/latest/api-reference/document-apis/index-document/ parameters: - $ref: '#/components/parameters/index___path.index' - $ref: '#/components/parameters/index___query.if_primary_term' @@ -13743,7 +13893,7 @@ paths: x-version-added: '1.0' description: Removes a document from the index. externalDocs: - url: https://opensearch.org/docs/latest/api-reference/document-apis/delete-document/ + url: https://docs.opensearch.org/latest/api-reference/document-apis/delete-document/ parameters: - $ref: '#/components/parameters/delete___path.id' - $ref: '#/components/parameters/delete___path.index' @@ -13771,7 +13921,7 @@ paths: x-version-added: '1.0' description: Returns a document. externalDocs: - url: https://opensearch.org/docs/latest/api-reference/document-apis/get-documents/ + url: https://docs.opensearch.org/latest/api-reference/document-apis/get-documents/ parameters: - $ref: '#/components/parameters/get___path.id' - $ref: '#/components/parameters/get___path.index' @@ -13801,7 +13951,7 @@ paths: x-version-added: '1.0' description: Returns information about whether a document exists in an index. externalDocs: - url: https://opensearch.org/docs/latest/api-reference/document-apis/get-documents/ + url: https://docs.opensearch.org/latest/api-reference/document-apis/get-documents/ parameters: - $ref: '#/components/parameters/exists___path.id' - $ref: '#/components/parameters/exists___path.index' @@ -13831,7 +13981,7 @@ paths: x-version-added: '1.0' description: Creates or updates a document in an index. externalDocs: - url: https://opensearch.org/docs/latest/api-reference/document-apis/index-document/ + url: https://docs.opensearch.org/latest/api-reference/document-apis/index-document/ parameters: - $ref: '#/components/parameters/index___path.id' - $ref: '#/components/parameters/index___path.index' @@ -13864,7 +14014,7 @@ paths: x-version-added: '1.0' description: Creates or updates a document in an index. externalDocs: - url: https://opensearch.org/docs/latest/api-reference/document-apis/index-document/ + url: https://docs.opensearch.org/latest/api-reference/document-apis/index-document/ parameters: - $ref: '#/components/parameters/index___path.id' - $ref: '#/components/parameters/index___path.index' @@ -13898,7 +14048,7 @@ paths: x-version-added: '1.0' description: Returns information about why a specific document matches (or doesn't match) a query. externalDocs: - url: https://opensearch.org/docs/latest/api-reference/explain/ + url: https://docs.opensearch.org/latest/api-reference/explain/ parameters: - $ref: '#/components/parameters/explain___path.id' - $ref: '#/components/parameters/explain___path.index' @@ -13930,7 +14080,7 @@ paths: x-version-added: '1.0' description: Returns information about why a specific document matches (or doesn't match) a query. externalDocs: - url: https://opensearch.org/docs/latest/api-reference/explain/ + url: https://docs.opensearch.org/latest/api-reference/explain/ parameters: - $ref: '#/components/parameters/explain___path.id' - $ref: '#/components/parameters/explain___path.index' @@ -13963,7 +14113,7 @@ paths: x-version-added: '1.0' description: Returns the information about the capabilities of fields among multiple indexes. externalDocs: - url: https://opensearch.org/docs/latest/field-types/supported-field-types/alias/#using-aliases-in-field-capabilities-api-operations + url: https://docs.opensearch.org/latest/mappings/supported-field-types/alias/#using-aliases-in-field-capabilities-api-operations parameters: - $ref: '#/components/parameters/field_caps___path.index' - $ref: '#/components/parameters/field_caps___query.allow_no_indices' @@ -13987,7 +14137,7 @@ paths: x-version-added: '1.0' description: Returns the information about the capabilities of fields among multiple indexes. externalDocs: - url: https://opensearch.org/docs/latest/field-types/supported-field-types/alias/#using-aliases-in-field-capabilities-api-operations + url: https://docs.opensearch.org/latest/mappings/supported-field-types/alias/#using-aliases-in-field-capabilities-api-operations parameters: - $ref: '#/components/parameters/field_caps___path.index' - $ref: '#/components/parameters/field_caps___query.allow_no_indices' @@ -14012,7 +14162,7 @@ paths: x-version-added: '1.0' description: Performs the flush operation on one or more indexes. externalDocs: - url: https://opensearch.org/docs/latest + url: https://docs.opensearch.org/latest/ parameters: - $ref: '#/components/parameters/indices.flush___path.index' - $ref: '#/components/parameters/indices.flush___query.allow_no_indices' @@ -14034,7 +14184,7 @@ paths: x-version-added: '1.0' description: Performs the flush operation on one or more indexes. externalDocs: - url: https://opensearch.org/docs/latest + url: https://docs.opensearch.org/latest/ parameters: - $ref: '#/components/parameters/indices.flush___path.index' - $ref: '#/components/parameters/indices.flush___query.allow_no_indices' @@ -14057,7 +14207,7 @@ paths: x-version-added: '1.0' description: Performs the force merge operation on one or more indexes. externalDocs: - url: https://opensearch.org/docs/latest + url: https://docs.opensearch.org/latest/ parameters: - $ref: '#/components/parameters/indices.forcemerge___path.index' - $ref: '#/components/parameters/indices.forcemerge___query.allow_no_indices' @@ -14083,7 +14233,7 @@ paths: x-version-added: '1.0' description: Returns mappings for one or more indexes. externalDocs: - url: https://opensearch.org/docs/latest/field-types/index/#get-a-mapping + url: https://docs.opensearch.org/latest/api-reference/index-apis/get-mapping/ parameters: - $ref: '#/components/parameters/indices.get_mapping___path.index' - $ref: '#/components/parameters/indices.get_mapping___query.allow_no_indices' @@ -14107,7 +14257,7 @@ paths: x-version-added: '1.0' description: Updates the index mappings. externalDocs: - url: https://opensearch.org/docs/latest/api-reference/index-apis/put-mapping/ + url: https://docs.opensearch.org/latest/api-reference/index-apis/put-mapping/ parameters: - $ref: '#/components/parameters/indices.put_mapping___path.index' - $ref: '#/components/parameters/indices.put_mapping___query.allow_no_indices' @@ -14133,7 +14283,7 @@ paths: x-version-added: '1.0' description: Updates the index mappings. externalDocs: - url: https://opensearch.org/docs/latest/api-reference/index-apis/put-mapping/ + url: https://docs.opensearch.org/latest/api-reference/index-apis/put-mapping/ parameters: - $ref: '#/components/parameters/indices.put_mapping___path.index' - $ref: '#/components/parameters/indices.put_mapping___query.allow_no_indices' @@ -14160,7 +14310,7 @@ paths: x-version-added: '1.0' description: Returns mapping for one or more fields. externalDocs: - url: https://opensearch.org/docs/latest/field-types/index/ + url: https://docs.opensearch.org/latest/field-types/index/ parameters: - $ref: '#/components/parameters/indices.get_field_mapping___path.fields' - $ref: '#/components/parameters/indices.get_field_mapping___path.index' @@ -14184,7 +14334,7 @@ paths: x-version-added: '1.0' description: Allows to get multiple documents in one request. externalDocs: - url: https://opensearch.org/docs/latest/api-reference/document-apis/multi-get/ + url: https://docs.opensearch.org/latest/api-reference/document-apis/multi-get/ parameters: - $ref: '#/components/parameters/mget___path.index' - $ref: '#/components/parameters/mget___query._source' @@ -14211,7 +14361,7 @@ paths: x-version-added: '1.0' description: Allows to get multiple documents in one request. externalDocs: - url: https://opensearch.org/docs/latest/api-reference/document-apis/multi-get/ + url: https://docs.opensearch.org/latest/api-reference/document-apis/multi-get/ parameters: - $ref: '#/components/parameters/mget___path.index' - $ref: '#/components/parameters/mget___query._source' @@ -14239,7 +14389,7 @@ paths: x-version-added: '1.0' description: Allows to execute several search operations in one request. externalDocs: - url: https://opensearch.org/docs/latest/api-reference/multi-search/ + url: https://docs.opensearch.org/latest/api-reference/multi-search/ parameters: - $ref: '#/components/parameters/msearch___path.index' - $ref: '#/components/parameters/msearch___query.allow_partial_results' @@ -14266,7 +14416,7 @@ paths: x-version-added: '1.0' description: Allows to execute several search operations in one request. externalDocs: - url: https://opensearch.org/docs/latest/api-reference/multi-search/ + url: https://docs.opensearch.org/latest/api-reference/multi-search/ parameters: - $ref: '#/components/parameters/msearch___path.index' - $ref: '#/components/parameters/msearch___query.allow_partial_results' @@ -14294,7 +14444,7 @@ paths: x-version-added: '1.0' description: Allows to execute several search template operations in one request. externalDocs: - url: https://opensearch.org/docs/latest/search-plugins/search-template/ + url: https://docs.opensearch.org/latest/search-plugins/search-template/ parameters: - $ref: '#/components/parameters/msearch_template___path.index' - $ref: '#/components/parameters/msearch_template___query.ccs_minimize_roundtrips' @@ -14318,7 +14468,7 @@ paths: x-version-added: '1.0' description: Allows to execute several search template operations in one request. externalDocs: - url: https://opensearch.org/docs/latest/search-plugins/search-template/ + url: https://docs.opensearch.org/latest/search-plugins/search-template/ parameters: - $ref: '#/components/parameters/msearch_template___path.index' - $ref: '#/components/parameters/msearch_template___query.ccs_minimize_roundtrips' @@ -14343,7 +14493,7 @@ paths: x-version-added: '1.0' description: Returns multiple termvectors in one request. externalDocs: - url: https://opensearch.org/docs/latest + url: https://docs.opensearch.org/latest/ parameters: - $ref: '#/components/parameters/mtermvectors___path.index' - $ref: '#/components/parameters/mtermvectors___query.field_statistics' @@ -14374,7 +14524,7 @@ paths: x-version-added: '1.0' description: Returns multiple termvectors in one request. externalDocs: - url: https://opensearch.org/docs/latest + url: https://docs.opensearch.org/latest/ parameters: - $ref: '#/components/parameters/mtermvectors___path.index' - $ref: '#/components/parameters/mtermvectors___query.field_statistics' @@ -14406,7 +14556,7 @@ paths: x-version-added: '1.0' description: Opens an index. externalDocs: - url: https://opensearch.org/docs/latest/api-reference/index-apis/open-index/ + url: https://docs.opensearch.org/latest/api-reference/index-apis/open-index/ parameters: - $ref: '#/components/parameters/indices.open___path.index' - $ref: '#/components/parameters/indices.open___query.allow_no_indices' @@ -14433,7 +14583,7 @@ paths: x-version-added: '1.0' description: Allows to evaluate the quality of ranked search results over a set of typical search queries. externalDocs: - url: https://opensearch.org/docs/latest/api-reference/rank-eval/ + url: https://docs.opensearch.org/latest/api-reference/rank-eval/ parameters: - $ref: '#/components/parameters/rank_eval___path.index' - $ref: '#/components/parameters/rank_eval___query.allow_no_indices' @@ -14456,7 +14606,7 @@ paths: x-version-added: '1.0' description: Allows to evaluate the quality of ranked search results over a set of typical search queries. externalDocs: - url: https://opensearch.org/docs/latest/api-reference/rank-eval/ + url: https://docs.opensearch.org/latest/api-reference/rank-eval/ parameters: - $ref: '#/components/parameters/rank_eval___path.index' - $ref: '#/components/parameters/rank_eval___query.allow_no_indices' @@ -14480,7 +14630,7 @@ paths: x-version-added: '1.0' description: Returns information about ongoing index shard recoveries. externalDocs: - url: https://opensearch.org/docs/latest + url: https://docs.opensearch.org/latest/ parameters: - $ref: '#/components/parameters/indices.recovery___path.index' - $ref: '#/components/parameters/indices.recovery___query.active_only' @@ -14500,7 +14650,7 @@ paths: x-version-added: '1.0' description: Performs the refresh operation in one or more indexes. externalDocs: - url: https://opensearch.org/docs/latest/tuning-your-cluster/availability-and-recovery/remote-store/index/#refresh-level-and-request-level-durability + url: https://docs.opensearch.org/latest/api-reference/index-apis/refresh/ parameters: - $ref: '#/components/parameters/indices.refresh___path.index' - $ref: '#/components/parameters/indices.refresh___query.allow_no_indices' @@ -14520,7 +14670,7 @@ paths: x-version-added: '1.0' description: Performs the refresh operation in one or more indexes. externalDocs: - url: https://opensearch.org/docs/latest/tuning-your-cluster/availability-and-recovery/remote-store/index/#refresh-level-and-request-level-durability + url: https://docs.opensearch.org/latest/api-reference/index-apis/refresh/ parameters: - $ref: '#/components/parameters/indices.refresh___path.index' - $ref: '#/components/parameters/indices.refresh___query.allow_no_indices' @@ -14541,7 +14691,7 @@ paths: x-version-added: '1.0' description: Returns results matching a query. externalDocs: - url: https://opensearch.org/docs/latest/api-reference/search/ + url: https://docs.opensearch.org/latest/api-reference/search/ parameters: - $ref: '#/components/parameters/search___path.index' - $ref: '#/components/parameters/search___query._source' @@ -14612,7 +14762,7 @@ paths: x-version-added: '1.0' description: Returns results matching a query. externalDocs: - url: https://opensearch.org/docs/latest/api-reference/search/ + url: https://docs.opensearch.org/latest/api-reference/search/ parameters: - $ref: '#/components/parameters/search___path.index' - $ref: '#/components/parameters/search___query._source' @@ -14684,7 +14834,7 @@ paths: x-version-added: '1.0' description: Returns information about the indexes and shards that a search request would be executed against. externalDocs: - url: https://opensearch.org/docs/latest + url: https://docs.opensearch.org/latest/ parameters: - $ref: '#/components/parameters/search_shards___path.index' - $ref: '#/components/parameters/search_shards___query.allow_no_indices' @@ -14709,7 +14859,7 @@ paths: x-version-added: '1.0' description: Returns information about the indexes and shards that a search request would be executed against. externalDocs: - url: https://opensearch.org/docs/latest + url: https://docs.opensearch.org/latest/ parameters: - $ref: '#/components/parameters/search_shards___path.index' - $ref: '#/components/parameters/search_shards___query.allow_no_indices' @@ -14735,11 +14885,14 @@ paths: x-version-added: '2.4' description: Creates point in time context. externalDocs: - url: https://opensearch.org/docs/latest/search-plugins/point-in-time-api/#create-a-pit + url: https://docs.opensearch.org/latest/api-reference/search-apis/point-in-time-api/#create-a-pit parameters: - $ref: '#/components/parameters/create_pit___path.index' + - $ref: '#/components/parameters/create_pit___query.allow_no_indices' - $ref: '#/components/parameters/create_pit___query.allow_partial_pit_creation' - $ref: '#/components/parameters/create_pit___query.expand_wildcards' + - $ref: '#/components/parameters/create_pit___query.ignore_throttled' + - $ref: '#/components/parameters/create_pit___query.ignore_unavailable' - $ref: '#/components/parameters/create_pit___query.keep_alive' - $ref: '#/components/parameters/create_pit___query.preference' - $ref: '#/components/parameters/create_pit___query.routing' @@ -14758,7 +14911,7 @@ paths: x-version-added: '1.0' description: Allows to use the Mustache language to pre-render a search definition. externalDocs: - url: https://opensearch.org/docs/latest/search-plugins/search-template/ + url: https://docs.opensearch.org/latest/search-plugins/search-template/ parameters: - $ref: '#/components/parameters/search_template___path.index' - $ref: '#/components/parameters/search_template___query.allow_no_indices' @@ -14792,7 +14945,7 @@ paths: x-version-added: '1.0' description: Allows to use the Mustache language to pre-render a search definition. externalDocs: - url: https://opensearch.org/docs/latest/search-plugins/search-template/ + url: https://docs.opensearch.org/latest/search-plugins/search-template/ parameters: - $ref: '#/components/parameters/search_template___path.index' - $ref: '#/components/parameters/search_template___query.allow_no_indices' @@ -14830,7 +14983,7 @@ paths: - amazon-serverless description: Provides low-level information about segments in a Lucene index. externalDocs: - url: https://opensearch.org/docs/latest + url: https://docs.opensearch.org/latest/ parameters: - $ref: '#/components/parameters/indices.segments___path.index' - $ref: '#/components/parameters/indices.segments___query.allow_no_indices' @@ -14852,7 +15005,7 @@ paths: x-version-added: '1.0' description: Returns settings for one or more indexes. externalDocs: - url: https://opensearch.org/docs/latest/api-reference/index-apis/get-settings/ + url: https://docs.opensearch.org/latest/api-reference/index-apis/get-settings/ parameters: - $ref: '#/components/parameters/indices.get_settings___path.index' - $ref: '#/components/parameters/indices.get_settings___query.allow_no_indices' @@ -14877,7 +15030,7 @@ paths: x-version-added: '1.0' description: Updates the index settings. externalDocs: - url: https://opensearch.org/docs/latest/api-reference/index-apis/update-settings/ + url: https://docs.opensearch.org/latest/api-reference/index-apis/update-settings/ parameters: - $ref: '#/components/parameters/indices.put_settings___path.index' - $ref: '#/components/parameters/indices.put_settings___query.allow_no_indices' @@ -14905,7 +15058,7 @@ paths: x-version-added: '1.0' description: Returns settings for one or more indexes. externalDocs: - url: https://opensearch.org/docs/latest/api-reference/index-apis/get-settings/ + url: https://docs.opensearch.org/latest/api-reference/index-apis/get-settings/ parameters: - $ref: '#/components/parameters/indices.get_settings___path.index' - $ref: '#/components/parameters/indices.get_settings___path.name' @@ -14932,7 +15085,7 @@ paths: x-version-added: '1.0' description: Provides store information for shard copies of indexes. externalDocs: - url: https://opensearch.org/docs/latest + url: https://docs.opensearch.org/latest/ parameters: - $ref: '#/components/parameters/indices.shard_stores___path.index' - $ref: '#/components/parameters/indices.shard_stores___query.allow_no_indices' @@ -14954,7 +15107,7 @@ paths: x-version-added: '1.0' description: Allow to shrink an existing index into a new index with fewer primary shards. externalDocs: - url: https://opensearch.org/docs/latest/api-reference/index-apis/shrink-index/ + url: https://docs.opensearch.org/latest/api-reference/index-apis/shrink-index/ parameters: - $ref: '#/components/parameters/indices.shrink___path.index' - $ref: '#/components/parameters/indices.shrink___path.target' @@ -14981,7 +15134,7 @@ paths: x-version-added: '1.0' description: Allow to shrink an existing index into a new index with fewer primary shards. externalDocs: - url: https://opensearch.org/docs/latest/api-reference/index-apis/shrink-index/ + url: https://docs.opensearch.org/latest/api-reference/index-apis/shrink-index/ parameters: - $ref: '#/components/parameters/indices.shrink___path.index' - $ref: '#/components/parameters/indices.shrink___path.target' @@ -15009,7 +15162,7 @@ paths: x-version-added: '1.0' description: Returns the source of a document. externalDocs: - url: https://opensearch.org/docs/latest/api-reference/document-apis/get-documents/ + url: https://docs.opensearch.org/latest/api-reference/document-apis/get-documents/ parameters: - $ref: '#/components/parameters/get_source___path.id' - $ref: '#/components/parameters/get_source___path.index' @@ -15038,7 +15191,7 @@ paths: x-version-added: '1.0' description: Returns information about whether a document source exists in an index. externalDocs: - url: https://opensearch.org/docs/latest/api-reference/document-apis/get-documents/ + url: https://docs.opensearch.org/latest/api-reference/document-apis/get-documents/ parameters: - $ref: '#/components/parameters/exists_source___path.id' - $ref: '#/components/parameters/exists_source___path.index' @@ -15068,7 +15221,7 @@ paths: x-version-added: '1.0' description: Allows you to split an existing index into a new index with more primary shards. externalDocs: - url: https://opensearch.org/docs/latest/api-reference/index-apis/split/ + url: https://docs.opensearch.org/latest/api-reference/index-apis/split/ parameters: - $ref: '#/components/parameters/indices.split___path.index' - $ref: '#/components/parameters/indices.split___path.target' @@ -15095,7 +15248,7 @@ paths: x-version-added: '1.0' description: Allows you to split an existing index into a new index with more primary shards. externalDocs: - url: https://opensearch.org/docs/latest/api-reference/index-apis/split/ + url: https://docs.opensearch.org/latest/api-reference/index-apis/split/ parameters: - $ref: '#/components/parameters/indices.split___path.index' - $ref: '#/components/parameters/indices.split___path.target' @@ -15123,7 +15276,7 @@ paths: x-version-added: '1.0' description: Provides statistics on operations happening in an index. externalDocs: - url: https://opensearch.org/docs/latest + url: https://docs.opensearch.org/latest/ parameters: - $ref: '#/components/parameters/indices.stats___path.index' - $ref: '#/components/parameters/indices.stats___query.completion_fields' @@ -15150,7 +15303,7 @@ paths: x-version-added: '1.0' description: Provides statistics on operations happening in an index. externalDocs: - url: https://opensearch.org/docs/latest + url: https://docs.opensearch.org/latest/ parameters: - $ref: '#/components/parameters/indices.stats___path.index' - $ref: '#/components/parameters/indices.stats___path.metric' @@ -15178,7 +15331,7 @@ paths: x-version-added: '1.0' description: Returns information and statistics about terms in the fields of a particular document. externalDocs: - url: https://opensearch.org/docs/latest + url: https://docs.opensearch.org/latest/ parameters: - $ref: '#/components/parameters/termvectors___path.index' - $ref: '#/components/parameters/termvectors___query.field_statistics' @@ -15208,7 +15361,7 @@ paths: x-version-added: '1.0' description: Returns information and statistics about terms in the fields of a particular document. externalDocs: - url: https://opensearch.org/docs/latest + url: https://docs.opensearch.org/latest/ parameters: - $ref: '#/components/parameters/termvectors___path.index' - $ref: '#/components/parameters/termvectors___query.field_statistics' @@ -15239,7 +15392,7 @@ paths: x-version-added: '1.0' description: Returns information and statistics about terms in the fields of a particular document. externalDocs: - url: https://opensearch.org/docs/latest + url: https://docs.opensearch.org/latest/ parameters: - $ref: '#/components/parameters/termvectors___path.id' - $ref: '#/components/parameters/termvectors___path.index' @@ -15270,7 +15423,7 @@ paths: x-version-added: '1.0' description: Returns information and statistics about terms in the fields of a particular document. externalDocs: - url: https://opensearch.org/docs/latest + url: https://docs.opensearch.org/latest/ parameters: - $ref: '#/components/parameters/termvectors___path.id' - $ref: '#/components/parameters/termvectors___path.index' @@ -15304,7 +15457,7 @@ paths: Performs an update on every document in the index without changing the source, for example to pick up a mapping change. externalDocs: - url: https://opensearch.org/docs/latest/api-reference/document-apis/update-by-query/ + url: https://docs.opensearch.org/latest/api-reference/document-apis/update-by-query/ parameters: - $ref: '#/components/parameters/update_by_query___path.index' - $ref: '#/components/parameters/update_by_query___query._source' @@ -15358,7 +15511,7 @@ paths: x-version-added: '1.0' description: Updates a document with a script or partial document. externalDocs: - url: https://opensearch.org/docs/latest/api-reference/document-apis/update-document/ + url: https://docs.opensearch.org/latest/api-reference/document-apis/update-document/ parameters: - $ref: '#/components/parameters/update___path.id' - $ref: '#/components/parameters/update___path.index' @@ -15392,7 +15545,7 @@ paths: x-version-deprecated: '1.0' description: The `_upgrade` API is no longer useful and will be removed. externalDocs: - url: https://opensearch.org/docs/latest + url: https://docs.opensearch.org/latest/ parameters: - $ref: '#/components/parameters/indices.get_upgrade___path.index' - $ref: '#/components/parameters/indices.get_upgrade___query.allow_no_indices' @@ -15413,7 +15566,7 @@ paths: x-version-deprecated: '1.0' description: The `_upgrade` API is no longer useful and will be removed. externalDocs: - url: https://opensearch.org/docs/latest + url: https://docs.opensearch.org/latest/ parameters: - $ref: '#/components/parameters/indices.upgrade___path.index' - $ref: '#/components/parameters/indices.upgrade___query.allow_no_indices' @@ -15436,7 +15589,7 @@ paths: x-version-added: '1.0' description: Allows a user to validate a potentially expensive query without executing it. externalDocs: - url: https://opensearch.org/docs/latest + url: https://docs.opensearch.org/latest/ parameters: - $ref: '#/components/parameters/indices.validate_query___path.index' - $ref: '#/components/parameters/indices.validate_query___query.all_shards' @@ -15467,7 +15620,7 @@ paths: x-version-added: '1.0' description: Allows a user to validate a potentially expensive query without executing it. externalDocs: - url: https://opensearch.org/docs/latest + url: https://docs.opensearch.org/latest/ parameters: - $ref: '#/components/parameters/indices.validate_query___path.index' - $ref: '#/components/parameters/indices.validate_query___query.all_shards' @@ -15500,7 +15653,7 @@ paths: x-version-added: '3.1' description: Use this API to pause ingestion for a given index. externalDocs: - url: https://docs.opensearch.org/docs/latest/api-reference/document-apis/pull-based-ingestion-management/ + url: https://docs.opensearch.org/latest/api-reference/document-apis/pull-based-ingestion-management/ parameters: - $ref: '#/components/parameters/ingestion.pause___path.index' - $ref: '#/components/parameters/ingestion.pause___query.cluster_manager_timeout' @@ -15521,7 +15674,7 @@ paths: x-version-added: '3.1' description: Use this API to resume ingestion for the given index. externalDocs: - url: https://docs.opensearch.org/docs/latest/api-reference/document-apis/pull-based-ingestion-management/ + url: https://docs.opensearch.org/latest/api-reference/document-apis/pull-based-ingestion-management/ parameters: - $ref: '#/components/parameters/ingestion.resume___path.index' - $ref: '#/components/parameters/ingestion.resume___query.cluster_manager_timeout' @@ -15544,7 +15697,7 @@ paths: x-version-added: '3.1' description: Use this API to retrieve the ingestion state for a given index. externalDocs: - url: https://docs.opensearch.org/docs/latest/api-reference/document-apis/pull-based-ingestion-management/ + url: https://docs.opensearch.org/latest/api-reference/document-apis/pull-based-ingestion-management/ parameters: - $ref: '#/components/parameters/ingestion.get_state___path.index' - $ref: '#/components/parameters/ingestion.get_state___query.next_token' @@ -15565,7 +15718,7 @@ paths: x-version-added: '1.0' description: Performs an asynchronous search. externalDocs: - url: https://opensearch.org/docs/latest/search-plugins/async/index/#rest-api + url: https://docs.opensearch.org/latest/search-plugins/async/index/#rest-api parameters: - $ref: '#/components/parameters/asynchronous_search.search___query.index' - $ref: '#/components/parameters/asynchronous_search.search___query.keep_alive' @@ -15590,7 +15743,7 @@ paths: x-version-added: '1.0' description: Monitors any asynchronous searches that are `running`, `completed`, or `persisted`. externalDocs: - url: https://opensearch.org/docs/latest/search-plugins/async/index/#monitor-stats + url: https://docs.opensearch.org/latest/search-plugins/async/index/#monitor-stats responses: '200': $ref: '#/components/responses/asynchronous_search.stats___200' @@ -15609,7 +15762,7 @@ paths: x-version-added: '1.0' description: Gets partial responses from an asynchronous search. externalDocs: - url: https://opensearch.org/docs/latest/search-plugins/async/index/#get-partial-results + url: https://docs.opensearch.org/latest/search-plugins/async/index/#get-partial-results parameters: - $ref: '#/components/parameters/asynchronous_search.get___path.id' - $ref: '#/components/parameters/_global___query.pretty' @@ -15628,7 +15781,7 @@ paths: x-version-added: '1.0' description: Deletes any responses from an asynchronous search. externalDocs: - url: https://opensearch.org/docs/latest/search-plugins/async/index/#delete-searches-and-results + url: https://docs.opensearch.org/latest/search-plugins/async/index/#delete-searches-and-results parameters: - $ref: '#/components/parameters/asynchronous_search.delete___path.id' - $ref: '#/components/parameters/_global___query.pretty' @@ -15647,7 +15800,7 @@ paths: x-operation-group: ism.add_policy description: Adds a policy to an index. externalDocs: - url: https://opensearch.org/docs/latest/im-plugin/ism/api/#add-policy + url: https://docs.opensearch.org/latest/im-plugin/ism/api/#add-policy parameters: - $ref: '#/components/parameters/ism.add_policy___query.index' - $ref: '#/components/parameters/_global___query.pretty' @@ -15668,7 +15821,7 @@ paths: x-operation-group: ism.add_policy description: Adds a policy to an index. externalDocs: - url: https://opensearch.org/docs/latest/im-plugin/ism/api/#add-policy + url: https://docs.opensearch.org/latest/im-plugin/ism/api/#add-policy parameters: - $ref: '#/components/parameters/ism.add_policy___path.index' - $ref: '#/components/parameters/ism.add_policy___query.index' @@ -15690,7 +15843,7 @@ paths: x-operation-group: ism.change_policy description: Updates the managed index policy to a new policy. externalDocs: - url: https://opensearch.org/docs/latest/im-plugin/ism/api/#update-managed-index-policy + url: https://docs.opensearch.org/latest/im-plugin/ism/api/#update-managed-index-policy parameters: - $ref: '#/components/parameters/ism.change_policy___query.index' - $ref: '#/components/parameters/_global___query.pretty' @@ -15711,7 +15864,7 @@ paths: x-operation-group: ism.change_policy description: Updates the managed index policy to a new policy. externalDocs: - url: https://opensearch.org/docs/latest/im-plugin/ism/api/#update-managed-index-policy + url: https://docs.opensearch.org/latest/im-plugin/ism/api/#update-managed-index-policy parameters: - $ref: '#/components/parameters/ism.change_policy___path.index' - $ref: '#/components/parameters/ism.change_policy___query.index' @@ -15733,7 +15886,7 @@ paths: x-operation-group: ism.explain_policy description: Retrieves the currently applied policy on the specified indexes. externalDocs: - url: https://opensearch.org/docs/latest/im-plugin/ism/api/#explain-index + url: https://docs.opensearch.org/latest/im-plugin/ism/api/#explain-index requestBody: $ref: '#/components/requestBodies/ism.explain_policy' responses: @@ -15752,7 +15905,7 @@ paths: x-operation-group: ism.explain_policy description: Retrieves the currently applied policy on the specified indexes. externalDocs: - url: https://opensearch.org/docs/latest/im-plugin/ism/api/#explain-index + url: https://docs.opensearch.org/latest/im-plugin/ism/api/#explain-index requestBody: $ref: '#/components/requestBodies/ism.explain_policy' responses: @@ -15772,7 +15925,7 @@ paths: x-operation-group: ism.explain_policy description: Retrieves the currently applied policy on the specified indexes. externalDocs: - url: https://opensearch.org/docs/latest/im-plugin/ism/api/#explain-index + url: https://docs.opensearch.org/latest/im-plugin/ism/api/#explain-index parameters: - $ref: '#/components/parameters/ism.explain_policy___path.index' - $ref: '#/components/parameters/_global___query.pretty' @@ -15792,7 +15945,7 @@ paths: x-operation-group: ism.explain_policy description: Retrieves the currently applied policy on the specified indexes. externalDocs: - url: https://opensearch.org/docs/latest/im-plugin/ism/api/#explain-index + url: https://docs.opensearch.org/latest/im-plugin/ism/api/#explain-index parameters: - $ref: '#/components/parameters/ism.explain_policy___path.index' - $ref: '#/components/parameters/_global___query.pretty' @@ -15813,7 +15966,7 @@ paths: x-operation-group: ism.get_policies description: Retrieves the policies. externalDocs: - url: https://opensearch.org/docs/latest/im-plugin/ism/api/#get-policy + url: https://docs.opensearch.org/latest/im-plugin/ism/api/#get-policy responses: '200': $ref: '#/components/responses/ism.get_policies___200' @@ -15830,7 +15983,7 @@ paths: x-operation-group: ism.put_policies description: Creates or updates policies. externalDocs: - url: https://opensearch.org/docs/latest/im-plugin/ism/api/#create-policy + url: https://docs.opensearch.org/latest/im-plugin/ism/api/#create-policy requestBody: $ref: '#/components/requestBodies/ism.put_policies' parameters: @@ -15853,7 +16006,7 @@ paths: x-operation-group: ism.get_policy description: Retrieves a specific policy. externalDocs: - url: https://opensearch.org/docs/latest/im-plugin/ism/api/#put-policy + url: https://docs.opensearch.org/latest/im-plugin/ism/api/#get-policy parameters: - $ref: '#/components/parameters/ism.get_policy___path.policy_id' - $ref: '#/components/parameters/_global___query.pretty' @@ -15871,7 +16024,7 @@ paths: x-operation-group: ism.exists_policy description: Checks for the existence of a policy. externalDocs: - url: https://opensearch.org/docs/latest/im-plugin/ism/api/#get-policy + url: https://docs.opensearch.org/latest/im-plugin/ism/api/#get-policy parameters: - $ref: '#/components/parameters/ism.exists_policy___path.policy_id' - $ref: '#/components/parameters/_global___query.pretty' @@ -15891,7 +16044,7 @@ paths: x-operation-group: ism.put_policy description: Creates or updates a policy. externalDocs: - url: https://opensearch.org/docs/latest/im-plugin/ism/api/#create-policy + url: https://docs.opensearch.org/latest/im-plugin/ism/api/#create-policy parameters: - $ref: '#/components/parameters/ism.put_policy___path.policy_id' - $ref: '#/components/parameters/ism.put_policy___query.if_primary_term' @@ -15915,7 +16068,7 @@ paths: x-operation-group: ism.delete_policy description: Deletes a policy. externalDocs: - url: https://opensearch.org/docs/latest/im-plugin/ism/api/#delete-policy + url: https://docs.opensearch.org/latest/im-plugin/ism/api/#delete-policy parameters: - $ref: '#/components/parameters/ism.delete_policy___path.policy_id' - $ref: '#/components/parameters/_global___query.pretty' @@ -15934,7 +16087,7 @@ paths: x-operation-group: ism.remove_policy description: Removes a policy from an index. externalDocs: - url: https://opensearch.org/docs/latest/im-plugin/ism/api/#remove-policy + url: https://docs.opensearch.org/latest/im-plugin/ism/api/#remove-policy-from-index parameters: - $ref: '#/components/parameters/ism.remove_policy___query.index' - $ref: '#/components/parameters/_global___query.pretty' @@ -15953,7 +16106,7 @@ paths: x-operation-group: ism.remove_policy description: Removes a policy from an index. externalDocs: - url: https://opensearch.org/docs/latest/im-plugin/ism/api/#remove-policy + url: https://docs.opensearch.org/latest/im-plugin/ism/api/#remove-policy-from-index parameters: - $ref: '#/components/parameters/ism.remove_policy___path.index' - $ref: '#/components/parameters/ism.remove_policy___query.index' @@ -15973,7 +16126,7 @@ paths: x-operation-group: ism.retry_index description: Retries the failed action for an index. externalDocs: - url: https://opensearch.org/docs/latest/im-plugin/ism/api/#retry-failed-index + url: https://docs.opensearch.org/latest/im-plugin/ism/api/#retry-failed-index parameters: - $ref: '#/components/parameters/ism.retry_index___query.index' - $ref: '#/components/parameters/_global___query.pretty' @@ -15994,7 +16147,7 @@ paths: x-operation-group: ism.retry_index description: Retries the failed action for an index. externalDocs: - url: https://opensearch.org/docs/latest/im-plugin/ism/api/#retry-failed-index + url: https://docs.opensearch.org/latest/im-plugin/ism/api/#retry-failed-index parameters: - $ref: '#/components/parameters/ism.retry_index___path.index' - $ref: '#/components/parameters/ism.retry_index___query.index' @@ -16080,7 +16233,7 @@ paths: x-version-added: '1.0' description: Executes a PPL query against OpenSearch indexes. externalDocs: - url: https://opensearch.org/docs/latest/search-plugins/sql/sql-ppl-api/ + url: https://docs.opensearch.org/latest/search-plugins/sql/sql-ppl-api/ parameters: - $ref: '#/components/parameters/ppl.query___query.format' - $ref: '#/components/parameters/ppl.query___query.sanitize' @@ -16103,7 +16256,7 @@ paths: x-version-added: '1.0' description: Returns the execution plan for a PPL query. externalDocs: - url: https://opensearch.org/docs/latest/search-plugins/sql/sql-ppl-api/ + url: https://docs.opensearch.org/latest/search-plugins/sql/sql-ppl-api/ parameters: - $ref: '#/components/parameters/ppl.explain___query.format' - $ref: '#/components/parameters/ppl.explain___query.sanitize' @@ -16126,7 +16279,7 @@ paths: x-version-added: '1.0' description: Retrieves performance metrics for the PPL plugin. externalDocs: - url: https://opensearch.org/docs/latest/search-plugins/sql/monitoring/ + url: https://docs.opensearch.org/latest/search-plugins/sql/monitoring/ parameters: - $ref: '#/components/parameters/ppl.get_stats___query.format' - $ref: '#/components/parameters/ppl.get_stats___query.sanitize' @@ -16146,7 +16299,7 @@ paths: x-version-added: '1.0' description: Retrieves filtered performance metrics for the PPL plugin. externalDocs: - url: https://opensearch.org/docs/latest/search-plugins/sql/monitoring/ + url: https://docs.opensearch.org/latest/search-plugins/sql/monitoring/ parameters: - $ref: '#/components/parameters/ppl.post_stats___query.format' - $ref: '#/components/parameters/ppl.post_stats___query.sanitize' @@ -16168,7 +16321,7 @@ paths: x-operation-group: ism.refresh_search_analyzers description: Refreshes search analyzers in real time. externalDocs: - url: https://opensearch.org/docs/latest/im-plugin/refresh-analyzer/ + url: https://docs.opensearch.org/latest/im-plugin/refresh-analyzer/ parameters: - $ref: '#/components/parameters/ism.refresh_search_analyzers___path.index' - $ref: '#/components/parameters/_global___query.pretty' @@ -16188,7 +16341,7 @@ paths: x-version-added: '1.0' description: Retrieves an index rollup job configuration by ID. externalDocs: - url: https://opensearch.org/docs/latest/im-plugin/index-rollups/rollup-api/#get-an-index-rollup-job + url: https://docs.opensearch.org/latest/im-plugin/index-rollups/rollup-api/#get-an-index-rollup-job parameters: - $ref: '#/components/parameters/rollups.get___path.id' - $ref: '#/components/parameters/_global___query.pretty' @@ -16207,7 +16360,7 @@ paths: x-version-added: '1.0' description: Creates or updates an index rollup job configuration. externalDocs: - url: https://opensearch.org/docs/latest/im-plugin/index-rollups/rollup-api/#create-or-update-an-index-rollup-job + url: https://docs.opensearch.org/latest/im-plugin/index-rollups/rollup-api/#create-or-update-an-index-rollup-job responses: '201': $ref: '#/components/responses/rollups.put___201' @@ -16230,7 +16383,7 @@ paths: x-version-added: '1.0' description: Deletes an index rollup job configuration. externalDocs: - url: https://opensearch.org/docs/latest/im-plugin/index-rollups/rollup-api/#delete-an-index-rollup-job + url: https://docs.opensearch.org/latest/im-plugin/index-rollups/rollup-api/#delete-an-index-rollup-job responses: '200': $ref: '#/components/responses/rollups.delete___200' @@ -16250,7 +16403,7 @@ paths: x-version-added: '1.0' description: Retrieves the execution status information for an index rollup job. externalDocs: - url: https://opensearch.org/docs/latest/im-plugin/index-rollups/rollup-api/#explain-an-index-rollup-job + url: https://docs.opensearch.org/latest/im-plugin/index-rollups/rollup-api/#explain-an-index-rollup-job parameters: - $ref: '#/components/parameters/rollups.explain___path.id' - $ref: '#/components/parameters/_global___query.pretty' @@ -16270,7 +16423,7 @@ paths: x-version-added: '1.0' description: Starts the execution of an index rollup job. externalDocs: - url: https://opensearch.org/docs/latest/im-plugin/index-rollups/rollup-api/#start-or-stop-an-index-rollup-job + url: https://docs.opensearch.org/latest/im-plugin/index-rollups/rollup-api/#start-or-stop-an-index-rollup-job parameters: - $ref: '#/components/parameters/rollups.start___path.id' - $ref: '#/components/parameters/_global___query.pretty' @@ -16290,7 +16443,7 @@ paths: x-version-added: '1.0' description: Stops the execution of an index rollup job. externalDocs: - url: https://opensearch.org/docs/latest/im-plugin/index-rollups/rollup-api/#start-or-stop-an-index-rollup-job + url: https://docs.opensearch.org/latest/im-plugin/index-rollups/rollup-api/#start-or-stop-an-index-rollup-job parameters: - $ref: '#/components/parameters/rollups.stop___path.id' - $ref: '#/components/parameters/_global___query.pretty' @@ -16313,7 +16466,7 @@ paths: - amazon-serverless description: Returns account information for the current user. externalDocs: - url: https://opensearch.org/docs/latest/security/access-control/api/#get-account-details + url: https://docs.opensearch.org/latest/security/access-control/api/#get-account-details responses: '200': $ref: '#/components/responses/security.get_account_details___200' @@ -16334,7 +16487,7 @@ paths: - amazon-serverless description: Changes the password for the current user. externalDocs: - url: https://opensearch.org/docs/latest/security/access-control/api/#change-password + url: https://docs.opensearch.org/latest/security/access-control/api/#change-password requestBody: $ref: '#/components/requestBodies/security.change_password' responses: @@ -16360,7 +16513,7 @@ paths: - amazon-serverless description: Retrieves one action group. externalDocs: - url: https://opensearch.org/docs/latest/security/access-control/api/#get-action-group + url: https://docs.opensearch.org/latest/security/access-control/api/#get-action-group parameters: - $ref: '#/components/parameters/security.get_action_group___path.action_group' - $ref: '#/components/parameters/_global___query.pretty' @@ -16382,7 +16535,7 @@ paths: - amazon-serverless description: Creates or replaces the specified action group. externalDocs: - url: https://opensearch.org/docs/latest/security/access-control/api/#create-action-group + url: https://docs.opensearch.org/latest/security/access-control/api/#create-action-group parameters: - $ref: '#/components/parameters/security.create_action_group___path.action_group' - $ref: '#/components/parameters/_global___query.pretty' @@ -16408,7 +16561,7 @@ paths: - amazon-serverless description: Updates the individual attributes of an action group. externalDocs: - url: https://opensearch.org/docs/latest/security/access-control/api/#patch-action-group + url: https://docs.opensearch.org/latest/security/access-control/api/#patch-action-group parameters: - $ref: '#/components/parameters/security.patch_action_group___path.action_group' - $ref: '#/components/parameters/_global___query.pretty' @@ -16432,7 +16585,7 @@ paths: - amazon-serverless description: Deletes the specified action group. externalDocs: - url: https://opensearch.org/docs/latest/security/access-control/api/#delete-action-group + url: https://docs.opensearch.org/latest/security/access-control/api/#delete-action-group parameters: - $ref: '#/components/parameters/security.delete_action_group___path.action_group' - $ref: '#/components/parameters/_global___query.pretty' @@ -16455,7 +16608,7 @@ paths: - amazon-serverless description: Updates the audit configuration. externalDocs: - url: https://opensearch.org/docs/latest/security/access-control/api/#audit-logs + url: https://docs.opensearch.org/latest/security/access-control/api/#audit-logs requestBody: $ref: '#/components/requestBodies/security.update_audit_configuration' responses: @@ -16562,7 +16715,7 @@ paths: - amazon-serverless description: Flushes the Security plugin's user, authentication, and authorization cache. externalDocs: - url: https://opensearch.org/docs/latest/security/access-control/api/#flush-cache + url: https://docs.opensearch.org/latest/security/access-control/api/#flush-cache responses: '200': $ref: '#/components/responses/security.flush_cache___200' @@ -16584,7 +16737,7 @@ paths: - amazon-serverless description: Retrieve information about the specified internal user. externalDocs: - url: https://opensearch.org/docs/latest/security/access-control/api/#get-user + url: https://docs.opensearch.org/latest/security/access-control/api/#get-user parameters: - $ref: '#/components/parameters/security.get_user___path.username' - $ref: '#/components/parameters/_global___query.pretty' @@ -16606,7 +16759,7 @@ paths: - amazon-serverless description: Creates or replaces the specified user. externalDocs: - url: https://opensearch.org/docs/latest/security/access-control/api/#create-user + url: https://docs.opensearch.org/latest/security/access-control/api/#create-user parameters: - $ref: '#/components/parameters/security.create_user___path.username' - $ref: '#/components/parameters/_global___query.pretty' @@ -16632,7 +16785,7 @@ paths: - amazon-serverless description: Updates individual attributes for an internal user. externalDocs: - url: https://opensearch.org/docs/latest/security/access-control/api/#patch-user + url: https://docs.opensearch.org/latest/security/access-control/api/#patch-user parameters: - $ref: '#/components/parameters/security.patch_user___path.username' - $ref: '#/components/parameters/_global___query.pretty' @@ -16656,7 +16809,7 @@ paths: - amazon-serverless description: Deletes the specified internal user. externalDocs: - url: https://opensearch.org/docs/latest/security/access-control/api/#delete-user + url: https://docs.opensearch.org/latest/security/access-control/api/#delete-user parameters: - $ref: '#/components/parameters/security.delete_user___path.username' - $ref: '#/components/parameters/_global___query.pretty' @@ -16746,7 +16899,7 @@ paths: - amazon-serverless description: Retrieves one role. externalDocs: - url: https://opensearch.org/docs/latest/security/access-control/api/#get-role + url: https://docs.opensearch.org/latest/security/access-control/api/#get-role parameters: - $ref: '#/components/parameters/security.get_role___path.role' - $ref: '#/components/parameters/_global___query.pretty' @@ -16768,7 +16921,7 @@ paths: - amazon-serverless description: Creates or replaces the specified role. externalDocs: - url: https://opensearch.org/docs/latest/security/access-control/api/#create-role + url: https://docs.opensearch.org/latest/security/access-control/api/#create-role parameters: - $ref: '#/components/parameters/security.create_role___path.role' - $ref: '#/components/parameters/_global___query.pretty' @@ -16794,7 +16947,7 @@ paths: - amazon-serverless description: Updates the individual attributes of a role. externalDocs: - url: https://opensearch.org/docs/latest/security/access-control/api/#patch-role + url: https://docs.opensearch.org/latest/security/access-control/api/#patch-role parameters: - $ref: '#/components/parameters/security.patch_role___path.role' - $ref: '#/components/parameters/_global___query.pretty' @@ -16820,7 +16973,7 @@ paths: - amazon-serverless description: Deletes the specified role. externalDocs: - url: https://opensearch.org/docs/latest/security/access-control/api/#delete-role + url: https://docs.opensearch.org/latest/security/access-control/api/#delete-role parameters: - $ref: '#/components/parameters/security.delete_role___path.role' - $ref: '#/components/parameters/_global___query.pretty' @@ -16843,7 +16996,7 @@ paths: - amazon-serverless description: Retrieves the specified role mapping. externalDocs: - url: https://opensearch.org/docs/latest/security/access-control/api/#get-role-mapping + url: https://docs.opensearch.org/latest/security/access-control/api/#get-role-mapping parameters: - $ref: '#/components/parameters/security.get_role_mapping___path.role' - $ref: '#/components/parameters/_global___query.pretty' @@ -16865,7 +17018,7 @@ paths: - amazon-serverless description: Creates or replaces the specified role mapping. externalDocs: - url: https://opensearch.org/docs/latest/security/access-control/api/#create-role-mapping + url: https://docs.opensearch.org/latest/security/access-control/api/#create-role-mapping parameters: - $ref: '#/components/parameters/security.create_role_mapping___path.role' - $ref: '#/components/parameters/_global___query.pretty' @@ -16891,7 +17044,7 @@ paths: - amazon-serverless description: Updates the individual attributes of a role mapping. externalDocs: - url: https://opensearch.org/docs/latest/security/access-control/api/#patch-role-mapping + url: https://docs.opensearch.org/latest/security/access-control/api/#patch-role-mapping parameters: - $ref: '#/components/parameters/security.patch_role_mapping___path.role' - $ref: '#/components/parameters/_global___query.pretty' @@ -16917,7 +17070,7 @@ paths: - amazon-serverless description: Deletes the specified role mapping. externalDocs: - url: https://opensearch.org/docs/latest/security/access-control/api/#delete-role-mapping + url: https://docs.opensearch.org/latest/security/access-control/api/#delete-role-mapping parameters: - $ref: '#/components/parameters/security.delete_role_mapping___path.role' - $ref: '#/components/parameters/_global___query.pretty' @@ -16940,7 +17093,7 @@ paths: - amazon-serverless description: Returns the current Security plugin configuration in a JSON format. externalDocs: - url: https://opensearch.org/docs/latest/security/access-control/api/#get-configuration + url: https://docs.opensearch.org/latest/security/access-control/api/#get-configuration responses: '200': $ref: '#/components/responses/security.get_configuration___200' @@ -16961,7 +17114,7 @@ paths: - amazon-serverless description: Updates the existing security configuration using the REST API. Requires super admin or REST API permissions. externalDocs: - url: https://opensearch.org/docs/latest/security/access-control/api/#patch-configuration + url: https://docs.opensearch.org/latest/security/access-control/api/#patch-configuration requestBody: $ref: '#/components/requestBodies/security.patch_configuration' responses: @@ -16987,7 +17140,7 @@ paths: - amazon-serverless description: Updates the settings for an existing security configuration. Requires super admin or REST API permissions. externalDocs: - url: https://opensearch.org/docs/latest/security/access-control/api/#update-configuration + url: https://docs.opensearch.org/latest/security/access-control/api/#update-configuration requestBody: $ref: '#/components/requestBodies/security.update_configuration' responses: @@ -17013,7 +17166,7 @@ paths: - amazon-serverless description: Retrieves the cluster security certificates. externalDocs: - url: https://opensearch.org/docs/latest/security/access-control/api/#get-certificates + url: https://docs.opensearch.org/latest/security/access-control/api/#get-certificates responses: '200': $ref: '#/components/responses/security.get_certificates___200' @@ -17039,7 +17192,7 @@ paths: - amazon-serverless description: Reloads the transport communication certificates. externalDocs: - url: https://opensearch.org/docs/latest/security/access-control/api/#reload-transport-certificates + url: https://docs.opensearch.org/latest/security/access-control/api/#reload-transport-certificates responses: '200': $ref: '#/components/responses/security.reload_transport_certificates___200' @@ -17065,7 +17218,7 @@ paths: - amazon-serverless description: Reloads the HTTP communication certificates. externalDocs: - url: https://opensearch.org/docs/latest/security/access-control/api/#reload-http-certificates + url: https://docs.opensearch.org/latest/security/access-control/api/#reload-http-certificates responses: '200': $ref: '#/components/responses/security.reload_http_certificates___200' @@ -17091,7 +17244,7 @@ paths: - amazon-serverless description: Retrieves all node distinguished names. Requires super admin or REST API permissions. externalDocs: - url: https://opensearch.org/docs/latest/security/access-control/api/#get-distinguished-names + url: https://docs.opensearch.org/latest/security/access-control/api/#get-distinguished-names parameters: - $ref: '#/components/parameters/security.get_distinguished_name___path.cluster_name' - $ref: '#/components/parameters/security.get_distinguished_name___query.show_all' @@ -17118,7 +17271,7 @@ paths: - amazon-serverless description: Adds or updates the specified distinguished names in the cluster or node allowlist. Requires super admin or REST API permissions. externalDocs: - url: https://opensearch.org/docs/latest/security/access-control/api/#update-distinguished-names + url: https://docs.opensearch.org/latest/security/access-control/api/#update-distinguished-names parameters: - $ref: '#/components/parameters/security.update_distinguished_name___path.cluster_name' - $ref: '#/components/parameters/_global___query.pretty' @@ -17174,7 +17327,7 @@ paths: - amazon-serverless description: Deletes all distinguished names in the specified cluster or node allowlist. Requires super admin or REST API permissions. externalDocs: - url: https://opensearch.org/docs/latest/security/access-control/api/#delete-distinguished-names + url: https://docs.opensearch.org/latest/security/access-control/api/#delete-distinguished-names parameters: - $ref: '#/components/parameters/security.delete_distinguished_name___path.cluster_name' - $ref: '#/components/parameters/_global___query.pretty' @@ -17201,7 +17354,7 @@ paths: - amazon-serverless description: Retrieves the multi-tenancy configuration. Requires super admin or REST API permissions. externalDocs: - url: https://opensearch.org/docs/latest/security/multi-tenancy/dynamic-config/#configuring-multi-tenancy-with-the-rest-api + url: https://docs.opensearch.org/latest/security/multi-tenancy/dynamic-config/#configuring-multi-tenancy-with-the-rest-api responses: '200': $ref: '#/components/responses/security.get_tenancy_config___200' @@ -17224,7 +17377,7 @@ paths: - amazon-serverless description: Creates or replaces the multi-tenancy configuration. Requires super admin or REST API permissions. externalDocs: - url: https://opensearch.org/docs/latest/security/multi-tenancy/dynamic-config/#configuring-multi-tenancy-with-the-rest-api + url: https://docs.opensearch.org/latest/security/multi-tenancy/dynamic-config/#configuring-multi-tenancy-with-the-rest-api requestBody: $ref: '#/components/requestBodies/security.create_update_tenancy_config' responses: @@ -17250,7 +17403,7 @@ paths: - amazon-serverless description: Retrieves all tenants. externalDocs: - url: https://opensearch.org/docs/latest/security/access-control/api/#get-tenants + url: https://docs.opensearch.org/latest/security/access-control/api/#get-tenants responses: '200': $ref: '#/components/responses/security.get_tenants___200' @@ -17273,7 +17426,7 @@ paths: - amazon-serverless description: Adds, deletes, or modifies multiple tenants in a single request. externalDocs: - url: https://opensearch.org/docs/latest/security/access-control/api/#patch-tenants + url: https://docs.opensearch.org/latest/security/access-control/api/#patch-tenants requestBody: $ref: '#/components/requestBodies/security.patch_tenants' responses: @@ -17299,7 +17452,7 @@ paths: - amazon-serverless description: Retrieves the specified tenant. externalDocs: - url: https://opensearch.org/docs/latest/security/access-control/api/#get-tenant + url: https://docs.opensearch.org/latest/security/access-control/api/#get-tenant parameters: - $ref: '#/components/parameters/security.get_tenant___path.tenant' - $ref: '#/components/parameters/_global___query.pretty' @@ -17321,7 +17474,7 @@ paths: - amazon-serverless description: Creates or replaces the specified tenant. externalDocs: - url: https://opensearch.org/docs/latest/security/access-control/api/#create-tenant + url: https://docs.opensearch.org/latest/security/access-control/api/#create-tenant parameters: - $ref: '#/components/parameters/security.create_tenant___path.tenant' - $ref: '#/components/parameters/_global___query.pretty' @@ -17349,7 +17502,7 @@ paths: - amazon-serverless description: Adds, deletes, or modifies a single tenant. externalDocs: - url: https://opensearch.org/docs/latest/security/access-control/api/#patch-tenant + url: https://docs.opensearch.org/latest/security/access-control/api/#patch-tenant parameters: - $ref: '#/components/parameters/security.patch_tenant___path.tenant' - $ref: '#/components/parameters/_global___query.pretty' @@ -17375,7 +17528,7 @@ paths: - amazon-serverless description: Deletes the specified tenant. externalDocs: - url: https://opensearch.org/docs/latest/security/access-control/api/#delete-action-group + url: https://docs.opensearch.org/latest/security/access-control/api/#delete-action-group parameters: - $ref: '#/components/parameters/security.delete_tenant___path.tenant' - $ref: '#/components/parameters/_global___query.pretty' @@ -17529,7 +17682,7 @@ paths: - amazon-serverless description: Retrieves the current list of allowed APIs accessible to a normal user. externalDocs: - url: https://opensearch.org/docs/latest/security/access-control/api/#access-control-for-the-api + url: https://docs.opensearch.org/latest/security/access-control/api/#access-control-for-the-api responses: '200': $ref: '#/components/responses/security.get_allowlist___200' @@ -17552,7 +17705,7 @@ paths: - amazon-serverless description: Creates or replaces APIs permitted for users on the allow list. Requires a super admin certificate or REST API permissions. externalDocs: - url: https://opensearch.org/docs/latest/security/access-control/api/#access-control-for-the-api + url: https://docs.opensearch.org/latest/security/access-control/api/#access-control-for-the-api requestBody: $ref: '#/components/requestBodies/security.create_allowlist' responses: @@ -17577,7 +17730,7 @@ paths: - amazon-serverless description: Updates the current list of APIs accessible for users on the allow list. externalDocs: - url: https://opensearch.org/docs/latest/security/access-control/api/#access-control-for-the-api + url: https://docs.opensearch.org/latest/security/access-control/api/#access-control-for-the-api requestBody: $ref: '#/components/requestBodies/security.patch_allowlist' responses: @@ -17657,7 +17810,7 @@ paths: - $ref: '#/components/parameters/_global___query.source' - $ref: '#/components/parameters/_global___query.filter_path' externalDocs: - url: https://opensearch.org/docs/latest/security/access-control/api/#health-check + url: https://docs.opensearch.org/latest/security/access-control/api/#health-check responses: '200': $ref: '#/components/responses/security.health___200' @@ -17679,7 +17832,7 @@ paths: - $ref: '#/components/parameters/_global___query.source' - $ref: '#/components/parameters/_global___query.filter_path' externalDocs: - url: https://opensearch.org/docs/latest/security/access-control/api/#health-check + url: https://docs.opensearch.org/latest/security/access-control/api/#health-check responses: '200': $ref: '#/components/responses/security.health___200' @@ -17782,7 +17935,7 @@ paths: x-version-added: '1.0' description: Executes SQL or PPL queries against OpenSearch indexes. externalDocs: - url: https://opensearch.org/docs/latest/search-plugins/sql/sql-ppl-api/ + url: https://docs.opensearch.org/latest/search-plugins/sql/sql-ppl-api/ parameters: - $ref: '#/components/parameters/sql.query___query.format' - $ref: '#/components/parameters/sql.query___query.sanitize' @@ -17805,7 +17958,7 @@ paths: x-version-added: '1.0' description: Returns the execution plan for a SQL or PPL query. externalDocs: - url: https://opensearch.org/docs/latest/search-plugins/sql/sql-ppl-api/ + url: https://docs.opensearch.org/latest/search-plugins/sql/sql-ppl-api/ parameters: - $ref: '#/components/parameters/sql.explain___query.format' - $ref: '#/components/parameters/sql.explain___query.sanitize' @@ -17828,7 +17981,7 @@ paths: x-version-added: '1.0' description: Closes an open cursor to free server-side resources. externalDocs: - url: https://opensearch.org/docs/latest/search-plugins/sql/sql-ppl-api/ + url: https://docs.opensearch.org/latest/search-plugins/sql/sql-ppl-api/ parameters: - $ref: '#/components/parameters/sql.close___query.format' - $ref: '#/components/parameters/sql.close___query.sanitize' @@ -17851,7 +18004,7 @@ paths: x-version-added: '1.0' description: Updates SQL plugin settings in the OpenSearch cluster configuration. externalDocs: - url: https://opensearch.org/docs/latest/search-plugins/sql/settings/ + url: https://docs.opensearch.org/latest/search-plugins/sql/settings/ parameters: - $ref: '#/components/parameters/sql.settings___query.format' - $ref: '#/components/parameters/_global___query.pretty' @@ -17873,7 +18026,7 @@ paths: x-version-added: '1.0' description: Retrieves performance metrics for the SQL plugin. externalDocs: - url: https://opensearch.org/docs/latest/search-plugins/sql/monitoring/ + url: https://docs.opensearch.org/latest/search-plugins/sql/monitoring/ parameters: - $ref: '#/components/parameters/sql.get_stats___query.format' - $ref: '#/components/parameters/sql.get_stats___query.sanitize' @@ -17893,7 +18046,7 @@ paths: x-version-added: '1.0' description: Retrieves filtered performance metrics for the SQL plugin. externalDocs: - url: https://opensearch.org/docs/latest/search-plugins/sql/monitoring/ + url: https://docs.opensearch.org/latest/search-plugins/sql/monitoring/ parameters: - $ref: '#/components/parameters/sql.post_stats___query.format' - $ref: '#/components/parameters/sql.post_stats___query.sanitize' @@ -17920,7 +18073,7 @@ paths: x-version-deprecated: '1.0' description: Returns information about hot threads on each node in the cluster. externalDocs: - url: https://opensearch.org/docs/latest/api-reference/nodes-apis/nodes-hot-threads/ + url: https://docs.opensearch.org/latest/api-reference/nodes-apis/nodes-hot-threads/ parameters: - $ref: '#/components/parameters/nodes.hot_threads___query.ignore_idle_threads' - $ref: '#/components/parameters/nodes.hot_threads___query.interval' @@ -17947,7 +18100,7 @@ paths: x-version-deprecated: '1.0' description: Returns information about hot threads on each node in the cluster. externalDocs: - url: https://opensearch.org/docs/latest/api-reference/nodes-apis/nodes-hot-threads/ + url: https://docs.opensearch.org/latest/api-reference/nodes-apis/nodes-hot-threads/ parameters: - $ref: '#/components/parameters/nodes.hot_threads___path.node_id' - $ref: '#/components/parameters/nodes.hot_threads___query.ignore_idle_threads' @@ -17971,7 +18124,7 @@ paths: x-version-added: '1.0' description: Returns information about hot threads on each node in the cluster. externalDocs: - url: https://opensearch.org/docs/latest/api-reference/nodes-apis/nodes-hot-threads/ + url: https://docs.opensearch.org/latest/api-reference/nodes-apis/nodes-hot-threads/ parameters: - $ref: '#/components/parameters/nodes.hot_threads___path.node_id' - $ref: '#/components/parameters/nodes.hot_threads___query.ignore_idle_threads' @@ -17997,7 +18150,7 @@ paths: x-version-added: '1.0' description: Returns information about hot threads on each node in the cluster. externalDocs: - url: https://opensearch.org/docs/latest/api-reference/nodes-apis/nodes-hot-threads/ + url: https://docs.opensearch.org/latest/api-reference/nodes-apis/nodes-hot-threads/ parameters: - $ref: '#/components/parameters/nodes.hot_threads___query.ignore_idle_threads' - $ref: '#/components/parameters/nodes.hot_threads___query.interval' @@ -18311,8 +18464,7 @@ components: in: query description: A short version of the `Accept` header, such as `json` or `yaml`. schema: - type: string - description: A short version of the `Accept` header, such as `json` or `yaml`. + $ref: '#/components/schemas/cat._common___ResponseFormat' cat.aliases___query.h: name: h in: query @@ -18370,8 +18522,7 @@ components: in: query description: A short version of the `Accept` header, such as `json` or `yaml`. schema: - type: string - description: A short version of the `Accept` header, such as `json` or `yaml`. + $ref: '#/components/schemas/cat._common___ResponseFormat' cat.all_pit_segments___query.h: name: h in: query @@ -18437,8 +18588,7 @@ components: in: query description: A short version of the HTTP `Accept` header, such as `json` or `yaml`. schema: - type: string - description: A short version of the HTTP `Accept` header, such as `json` or `yaml`. + $ref: '#/components/schemas/cat._common___ResponseFormat' cat.allocation___query.h: name: h in: query @@ -18506,8 +18656,7 @@ components: in: query description: A short version of the HTTP `Accept` header, such as `json` or `yaml`. schema: - type: string - description: A short version of the HTTP `Accept` header, such as `json` or `yaml`. + $ref: '#/components/schemas/cat._common___ResponseFormat' cat.cluster_manager___query.h: name: h in: query @@ -18578,8 +18727,7 @@ components: in: query description: A short version of the `Accept` header, such as `json` or `yaml`. schema: - type: string - description: A short version of the `Accept` header, such as `json` or `yaml`. + $ref: '#/components/schemas/cat._common___ResponseFormat' cat.count___query.h: name: h in: query @@ -18647,8 +18795,7 @@ components: in: query description: A short version of the `Accept` header, such as `json` or `yaml`. schema: - type: string - description: A short version of the `Accept` header, such as `json` or `yaml`. + $ref: '#/components/schemas/cat._common___ResponseFormat' cat.fielddata___query.h: name: h in: query @@ -18692,8 +18839,7 @@ components: in: query description: A short version of the `Accept` header, such as `json` or `yaml`. schema: - type: string - description: A short version of the `Accept` header, such as `json` or `yaml`. + $ref: '#/components/schemas/cat._common___ResponseFormat' cat.health___query.h: name: h in: query @@ -18782,8 +18928,7 @@ components: in: query description: A short version of the `Accept` header, such as `json` or `yaml`. schema: - type: string - description: A short version of the `Accept` header, such as `json` or `yaml`. + $ref: '#/components/schemas/cat._common___ResponseFormat' cat.indices___query.h: name: h in: query @@ -18881,8 +19026,7 @@ components: in: query description: A short version of the `Accept` header, such as `json` or `yaml`. schema: - type: string - description: A short version of the `Accept` header, such as `json` or `yaml`. + $ref: '#/components/schemas/cat._common___ResponseFormat' cat.master___query.h: name: h in: query @@ -18950,8 +19094,7 @@ components: in: query description: A short version of the `Accept` header, such as `json` or `yaml`. schema: - type: string - description: A short version of the `Accept` header, such as `json` or `yaml`. + $ref: '#/components/schemas/cat._common___ResponseFormat' cat.nodeattrs___query.h: name: h in: query @@ -19026,8 +19169,7 @@ components: in: query description: A short version of the `Accept` header, such as `json` or `yaml`. schema: - type: string - description: A short version of the `Accept` header, such as `json` or `yaml`. + $ref: '#/components/schemas/cat._common___ResponseFormat' cat.nodes___query.full_id: in: query name: full_id @@ -19089,7 +19231,7 @@ components: cat.nodes___query.time: name: time in: query - description: Specifies the time units, for example, `5d` or `7h`. For more information, see [Supported units](https://opensearch.org/docs/latest/api-reference/units/). + description: Specifies the time units, for example, `5d` or `7h`. For more information, see [Supported units](https://docs.opensearch.org/latest/api-reference/units/). schema: $ref: '#/components/schemas/_common___TimeUnit' cat.nodes___query.v: @@ -19112,8 +19254,7 @@ components: in: query description: A short version of the `Accept` header, such as `json` or `yaml`. schema: - type: string - description: A short version of the `Accept` header, such as `json` or `yaml`. + $ref: '#/components/schemas/cat._common___ResponseFormat' cat.pending_tasks___query.h: name: h in: query @@ -19164,7 +19305,7 @@ components: cat.pending_tasks___query.time: name: time in: query - description: Specifies the time units, for example, `5d` or `7h`. For more information, see [Supported units](https://opensearch.org/docs/latest/api-reference/units/). + description: Specifies the time units, for example, `5d` or `7h`. For more information, see [Supported units](https://docs.opensearch.org/latest/api-reference/units/). schema: $ref: '#/components/schemas/_common___TimeUnit' cat.pending_tasks___query.v: @@ -19186,8 +19327,7 @@ components: in: query description: A short version of the `Accept` header, such as `json` or `yaml`. schema: - type: string - description: A short version of the `Accept` header, such as `json` or `yaml`. + $ref: '#/components/schemas/cat._common___ResponseFormat' cat.pit_segments___query.h: name: h in: query @@ -19238,8 +19378,7 @@ components: in: query description: A short version of the `Accept` header, such as `json` or `yaml`. schema: - type: string - description: A short version of the `Accept` header, such as `json` or `yaml`. + $ref: '#/components/schemas/cat._common___ResponseFormat' cat.plugins___query.h: name: h in: query @@ -19333,8 +19472,7 @@ components: in: query description: A short version of the `Accept` header, such as `json` or `yaml`. schema: - type: string - description: A short version of the `Accept` header, such as `json` or `yaml`. + $ref: '#/components/schemas/cat._common___ResponseFormat' cat.recovery___query.h: name: h in: query @@ -19383,7 +19521,7 @@ components: cat.recovery___query.time: name: time in: query - description: Specifies the time units, for example, `5d` or `7h`. For more information, see [Supported units](https://opensearch.org/docs/latest/api-reference/units/). + description: Specifies the time units, for example, `5d` or `7h`. For more information, see [Supported units](https://docs.opensearch.org/latest/api-reference/units/). schema: $ref: '#/components/schemas/_common___TimeUnit' cat.recovery___query.v: @@ -19406,8 +19544,7 @@ components: in: query description: A short version of the `Accept` header, such as `json` or `yaml`. schema: - type: string - description: A short version of the `Accept` header, such as `json` or `yaml`. + $ref: '#/components/schemas/cat._common___ResponseFormat' cat.repositories___query.h: name: h in: query @@ -19477,6 +19614,7 @@ components: items: type: string required: true + style: simple cat.segment_replication___query.active_only: name: active_only in: query @@ -19524,8 +19662,7 @@ components: in: query description: A short version of the `Accept` header, such as `json` or `yaml`. schema: - type: string - description: A short version of the `Accept` header, such as `json` or `yaml`. + $ref: '#/components/schemas/cat._common___ResponseFormat' cat.segment_replication___query.h: name: h in: query @@ -19599,7 +19736,7 @@ components: cat.segment_replication___query.time: name: time in: query - description: Specifies the time units, for example, `5d` or `7h`. For more information, see [Supported units](https://opensearch.org/docs/latest/api-reference/units/). + description: Specifies the time units, for example, `5d` or `7h`. For more information, see [Supported units](https://docs.opensearch.org/latest/api-reference/units/). schema: $ref: '#/components/schemas/_common___TimeUnit' cat.segment_replication___query.timeout: @@ -19646,8 +19783,7 @@ components: in: query description: A short version of the `Accept` header, such as `json` or `yaml`. schema: - type: string - description: A short version of the `Accept` header, such as `json` or `yaml`. + $ref: '#/components/schemas/cat._common___ResponseFormat' cat.segments___query.h: name: h in: query @@ -19721,8 +19857,7 @@ components: in: query description: A short version of the `Accept` header, such as `json` or `yaml`. schema: - type: string - description: A short version of the `Accept` header, such as `json` or `yaml`. + $ref: '#/components/schemas/cat._common___ResponseFormat' cat.shards___query.h: name: h in: query @@ -19807,8 +19942,7 @@ components: in: query description: A short version of the `Accept` header, such as `json` or `yaml`. schema: - type: string - description: A short version of the `Accept` header, such as `json` or `yaml`. + $ref: '#/components/schemas/cat._common___ResponseFormat' cat.snapshots___query.h: name: h in: query @@ -19870,7 +20004,7 @@ components: cat.snapshots___query.time: name: time in: query - description: Specifies the time units, for example, `5d` or `7h`. For more information, see [Supported units](https://opensearch.org/docs/latest/api-reference/units/). + description: Specifies the time units, for example, `5d` or `7h`. For more information, see [Supported units](https://docs.opensearch.org/latest/api-reference/units/). schema: $ref: '#/components/schemas/_common___TimeUnit' cat.snapshots___query.v: @@ -19903,8 +20037,7 @@ components: in: query description: A short version of the `Accept` header, such as `json` or `yaml`. schema: - type: string - description: A short version of the `Accept` header, such as `json` or `yaml`. + $ref: '#/components/schemas/cat._common___ResponseFormat' cat.tasks___query.h: name: h in: query @@ -19959,7 +20092,7 @@ components: cat.tasks___query.time: name: time in: query - description: Specifies the time units, for example, `5d` or `7h`. For more information, see [Supported units](https://opensearch.org/docs/latest/api-reference/units/). + description: Specifies the time units, for example, `5d` or `7h`. For more information, see [Supported units](https://docs.opensearch.org/latest/api-reference/units/). schema: $ref: '#/components/schemas/_common___TimeUnit' cat.tasks___query.v: @@ -19992,8 +20125,7 @@ components: in: query description: A short version of the `Accept` header, such as `json` or `yaml`. schema: - type: string - description: A short version of the `Accept` header, such as `json` or `yaml`. + $ref: '#/components/schemas/cat._common___ResponseFormat' cat.templates___query.h: name: h in: query @@ -20071,8 +20203,7 @@ components: in: query description: A short version of the `Accept` header, such as `json` or `yaml`. schema: - type: string - description: A short version of the `Accept` header, such as `json` or `yaml`. + $ref: '#/components/schemas/cat._common___ResponseFormat' cat.thread_pool___query.h: name: h in: query @@ -20176,7 +20307,7 @@ components: cluster.delete_component_template___query.cluster_manager_timeout: name: cluster_manager_timeout in: query - description: The amount of time to wait for a response from the cluster manager node. For more information about supported time units, see [Common parameters](https://opensearch.org/docs/latest/api-reference/common-parameters/#time-units). + description: The amount of time to wait for a response from the cluster manager node. For more information about supported time units, see [Common parameters](https://docs.opensearch.org/latest/api-reference/common-parameters/#time-units). schema: $ref: '#/components/schemas/_common___Duration' x-version-added: '2.0' @@ -20221,7 +20352,7 @@ components: style: simple cluster.exists_component_template___query.cluster_manager_timeout: name: cluster_manager_timeout - description: The amount of time to wait for a response from the cluster manager node. For more information about supported time units, see [Common parameters](https://opensearch.org/docs/latest/api-reference/common-parameters/#time-units). + description: The amount of time to wait for a response from the cluster manager node. For more information about supported time units, see [Common parameters](https://docs.opensearch.org/latest/api-reference/common-parameters/#time-units). in: query schema: $ref: '#/components/schemas/_common___Duration' @@ -20257,7 +20388,7 @@ components: style: simple cluster.get_component_template___query.cluster_manager_timeout: name: cluster_manager_timeout - description: The amount of time to wait for a response from the cluster manager node. For more information about supported time units, see [Common parameters](https://opensearch.org/docs/latest/api-reference/common-parameters/#time-units). + description: The amount of time to wait for a response from the cluster manager node. For more information about supported time units, see [Common parameters](https://docs.opensearch.org/latest/api-reference/common-parameters/#time-units). in: query schema: $ref: '#/components/schemas/_common___Duration' @@ -20302,7 +20433,7 @@ components: required: true cluster.get_settings___query.cluster_manager_timeout: name: cluster_manager_timeout - description: The amount of time to wait for a response from the cluster manager node. For more information about supported time units, see [Common parameters](https://opensearch.org/docs/latest/api-reference/common-parameters/#time-units). + description: The amount of time to wait for a response from the cluster manager node. For more information about supported time units, see [Common parameters](https://docs.opensearch.org/latest/api-reference/common-parameters/#time-units). in: query schema: $ref: '#/components/schemas/_common___Duration' @@ -20365,7 +20496,7 @@ components: cluster.health___query.cluster_manager_timeout: name: cluster_manager_timeout in: query - description: The amount of time to wait for a response from the cluster manager node. For more information about supported time units, see [Common parameters](https://opensearch.org/docs/latest/api-reference/common-parameters/#time-units). + description: The amount of time to wait for a response from the cluster manager node. For more information about supported time units, see [Common parameters](https://docs.opensearch.org/latest/api-reference/common-parameters/#time-units). schema: $ref: '#/components/schemas/_common___Duration' x-version-added: '2.0' @@ -20403,7 +20534,7 @@ components: cluster.health___query.timeout: in: query name: timeout - description: The amount of time to wait for a response from the cluster manager node. For more information about supported time units, see [Common parameters](https://opensearch.org/docs/latest/api-reference/common-parameters/#time-units). + description: The amount of time to wait for a response from the cluster manager node. For more information about supported time units, see [Common parameters](https://docs.opensearch.org/latest/api-reference/common-parameters/#time-units). schema: $ref: '#/components/schemas/_common___Duration' style: form @@ -20452,7 +20583,7 @@ components: style: form cluster.pending_tasks___query.cluster_manager_timeout: name: cluster_manager_timeout - description: The amount of time to wait for a response from the cluster manager node. For more information about supported time units, see [Common parameters](https://opensearch.org/docs/latest/api-reference/common-parameters/#time-units). + description: The amount of time to wait for a response from the cluster manager node. For more information about supported time units, see [Common parameters](https://docs.opensearch.org/latest/api-reference/common-parameters/#time-units). in: query schema: $ref: '#/components/schemas/_common___Duration' @@ -20513,14 +20644,14 @@ components: OpenSearch includes the following built-in component templates: `logs-mappings`, `logs-settings`, `metrics-mappings`, `metrics-settings`, `synthetics-mapping`, and `synthetics-settings`. OpenSearch uses these templates to configure backing indexes for its data streams. If you want to overwrite one of these templates, set the replacement template `version` to a higher value than the current version. - If you want to disable all built-in component and index templates, set `stack.templates.enabled` to `false` using the [Cluster Update Settings API](https://opensearch.org/docs/latest/api-reference/cluster-api/cluster-settings/). + If you want to disable all built-in component and index templates, set `stack.templates.enabled` to `false` using the [Cluster Update Settings API](https://docs.opensearch.org/latest/api-reference/cluster-api/cluster-settings/). required: true schema: $ref: '#/components/schemas/_common___Name' style: simple cluster.put_component_template___query.cluster_manager_timeout: name: cluster_manager_timeout - description: The amount of time to wait for a response from the cluster manager node. For more information about supported time units, see [Common parameters](https://opensearch.org/docs/latest/api-reference/common-parameters/#time-units). + description: The amount of time to wait for a response from the cluster manager node. For more information about supported time units, see [Common parameters](https://docs.opensearch.org/latest/api-reference/common-parameters/#time-units). in: query schema: $ref: '#/components/schemas/_common___Duration' @@ -20565,7 +20696,7 @@ components: required: true cluster.put_settings___query.cluster_manager_timeout: name: cluster_manager_timeout - description: The amount of time to wait for a response from the cluster manager node. For more information about supported time units, see [Common parameters](https://opensearch.org/docs/latest/api-reference/common-parameters/#time-units). + description: The amount of time to wait for a response from the cluster manager node. For more information about supported time units, see [Common parameters](https://docs.opensearch.org/latest/api-reference/common-parameters/#time-units). in: query schema: $ref: '#/components/schemas/_common___Duration' @@ -20606,7 +20737,7 @@ components: cluster.reroute___query.cluster_manager_timeout: name: cluster_manager_timeout in: query - description: The amount of time to wait for a response from the cluster manager node. For more information about supported time units, see [Common parameters](https://opensearch.org/docs/latest/api-reference/common-parameters/#time-units). + description: The amount of time to wait for a response from the cluster manager node. For more information about supported time units, see [Common parameters](https://docs.opensearch.org/latest/api-reference/common-parameters/#time-units). schema: $ref: '#/components/schemas/_common___Duration' x-version-added: '2.0' @@ -20667,7 +20798,7 @@ components: cluster.state___path.metric: in: path name: metric - description: Limits the information returned to only the [specified metric groups](https://opensearch.org/docs/latest/api-reference/cluster-api/cluster-stats/#metric-groups). + description: Limits the information returned to only the [specified metric groups](https://docs.opensearch.org/latest/api-reference/cluster-api/cluster-stats/#metric-groups). required: true schema: type: array @@ -20683,7 +20814,7 @@ components: style: form cluster.state___query.cluster_manager_timeout: name: cluster_manager_timeout - description: The amount of time to wait for a response from the cluster manager node. For more information about supported time units, see [Common parameters](https://opensearch.org/docs/latest/api-reference/common-parameters/#time-units). + description: The amount of time to wait for a response from the cluster manager node. For more information about supported time units, see [Common parameters](https://docs.opensearch.org/latest/api-reference/common-parameters/#time-units). in: query schema: $ref: '#/components/schemas/_common___Duration' @@ -20745,7 +20876,7 @@ components: cluster.stats___path.index_metric: in: path name: index_metric - description: A comma-separated list of [index metric groups](https://opensearch.org/docs/latest/api-reference/cluster-api/cluster-stats/#index-metric-groups), for example, `docs,store`. + description: A comma-separated list of [index metric groups](https://docs.opensearch.org/latest/api-reference/cluster-api/cluster-stats/#index-metric-groups), for example, `docs,store`. required: true schema: type: array @@ -20926,6 +21057,16 @@ components: items: type: string required: true + style: simple + create_pit___query.allow_no_indices: + in: query + name: allow_no_indices + description: |- + If `false`, the request returns an error if any wildcard expression, index alias, or `_all` value targets only missing or closed indexes. + This behavior applies even if the request targets other open indexes. + schema: + type: boolean + style: form create_pit___query.allow_partial_pit_creation: name: allow_partial_pit_creation in: query @@ -20939,9 +21080,25 @@ components: description: Whether to expand wildcard expression to concrete indexes that are open, closed or both. schema: $ref: '#/components/schemas/_common___ExpandWildcards' + style: form + create_pit___query.ignore_throttled: + in: query + name: ignore_throttled + description: If `true`, concrete, expanded or aliased indexes will be ignored when frozen. + schema: + type: boolean + style: form + create_pit___query.ignore_unavailable: + in: query + name: ignore_unavailable + description: If `false`, the request returns an error if it targets a missing or closed index. + schema: + type: boolean + style: form create_pit___query.keep_alive: name: keep_alive in: query + required: true description: Specify the keep alive for point in time. schema: $ref: '#/components/schemas/_common___Duration' @@ -22011,6 +22168,7 @@ components: required: true schema: $ref: '#/components/schemas/_common___StringOrStringArray' + style: simple geospatial.put_ip2geo_datasource_settings___path.name: name: name in: path @@ -23626,6 +23784,7 @@ components: items: type: string required: true + style: simple indices.get_upgrade___query.allow_no_indices: name: allow_no_indices in: query @@ -24709,6 +24868,7 @@ components: items: type: string required: true + style: simple indices.upgrade___query.allow_no_indices: name: allow_no_indices in: query @@ -25056,27 +25216,27 @@ components: in: path required: true schema: - $ref: '#/components/schemas/_common___IndexName' + $ref: '#/components/schemas/_common___Indices' style: simple ism.add_policy___query.index: name: index in: query required: true schema: - $ref: '#/components/schemas/_common___IndexName' + $ref: '#/components/schemas/_common___Indices' ism.change_policy___path.index: name: index in: path required: true schema: - $ref: '#/components/schemas/_common___IndexName' + $ref: '#/components/schemas/_common___Indices' style: simple ism.change_policy___query.index: name: index in: query required: true schema: - $ref: '#/components/schemas/_common___IndexName' + $ref: '#/components/schemas/_common___Indices' ism.delete_policy___path.policy_id: name: policy_id in: path @@ -25094,7 +25254,7 @@ components: in: path required: true schema: - $ref: '#/components/schemas/_common___IndexName' + $ref: '#/components/schemas/_common___Indices' style: simple ism.get_policy___path.policy_id: name: policy_id @@ -25148,34 +25308,34 @@ components: in: path required: true schema: - $ref: '#/components/schemas/_common___IndexName' + $ref: '#/components/schemas/_common___Indices' style: simple ism.remove_policy___path.index: name: index in: path required: true schema: - $ref: '#/components/schemas/_common___IndexName' + $ref: '#/components/schemas/_common___Indices' style: simple ism.remove_policy___query.index: name: index in: query required: true schema: - $ref: '#/components/schemas/_common___IndexName' + $ref: '#/components/schemas/_common___Indices' ism.retry_index___path.index: name: index in: path required: true schema: - $ref: '#/components/schemas/_common___IndexName' + $ref: '#/components/schemas/_common___Indices' style: simple ism.retry_index___query.index: name: index in: query required: true schema: - $ref: '#/components/schemas/_common___IndexName' + $ref: '#/components/schemas/_common___Indices' knn.delete_model___path.model_id: name: model_id in: path @@ -25535,6 +25695,7 @@ components: items: type: string required: true + style: simple knn.stats___path.stat: name: stat in: path @@ -25547,6 +25708,7 @@ components: items: $ref: '#/components/schemas/knn._common___KnnStatName' required: true + style: simple knn.stats___query.timeout: name: timeout in: query @@ -25578,6 +25740,7 @@ components: items: type: string required: true + style: simple list.indices___path.index: in: path name: index @@ -25614,8 +25777,7 @@ components: in: query description: A short version of the Accept header, such as `JSON`, `YAML`. schema: - type: string - description: A short version of the Accept header, such as `JSON`, `YAML`. + $ref: '#/components/schemas/list._common___ResponseFormat' list.indices___query.h: name: h in: query @@ -25753,8 +25915,7 @@ components: in: query description: A short version of the Accept header, such as `JSON`, `YAML`. schema: - type: string - description: A short version of the Accept header, such as `JSON`, `YAML`. + $ref: '#/components/schemas/list._common___ResponseFormat' list.shards___query.h: name: h in: query @@ -26213,6 +26374,7 @@ components: items: type: string required: true + style: simple ltr.stats___path.stat: name: stat in: path @@ -26225,6 +26387,7 @@ components: items: $ref: '#/components/schemas/ltr._common___LtrStatName' required: true + style: simple ltr.stats___query.timeout: name: timeout in: query @@ -26651,6 +26814,7 @@ components: - type: array items: $ref: '#/components/schemas/ml._common___MlStatName' + style: simple ml.get_task___path.task_id: name: task_id in: path @@ -27052,6 +27216,7 @@ components: items: $ref: '#/components/schemas/neural._common___NeuralStatName' required: true + style: simple neural.stats___query.flat_stat_paths: in: query name: flat_stat_paths @@ -27116,6 +27281,7 @@ components: items: type: string required: true + style: simple nodes.hot_threads___query.ignore_idle_threads: name: ignore_idle_threads in: query @@ -27629,7 +27795,7 @@ components: in: query description: Specifies the response format (JSON, YAML). schema: - type: string + $ref: '#/components/schemas/ppl._common___ResponseFormat' ppl.explain___query.sanitize: name: sanitize in: query @@ -27642,7 +27808,7 @@ components: in: query description: Specifies the response format (JSON, YAML). schema: - type: string + $ref: '#/components/schemas/ppl._common___ResponseFormat' ppl.get_stats___query.sanitize: name: sanitize in: query @@ -27655,7 +27821,7 @@ components: in: query description: Specifies the response format (JSON, YAML). schema: - type: string + $ref: '#/components/schemas/ppl._common___ResponseFormat' ppl.post_stats___query.sanitize: name: sanitize in: query @@ -27668,7 +27834,7 @@ components: in: query description: Specifies the response format (JSON OR YAML). schema: - type: string + $ref: '#/components/schemas/ppl._common___ResponseFormat' ppl.query___query.sanitize: name: sanitize in: query @@ -29541,7 +29707,7 @@ components: snapshot.cleanup_repository___query.cluster_manager_timeout: name: cluster_manager_timeout in: query - description: The amount of time to wait for a response from the cluster manager node. For more information about supported time units, see [Common parameters](https://opensearch.org/docs/latest/api-reference/common-parameters/#time-units). + description: The amount of time to wait for a response from the cluster manager node. For more information about supported time units, see [Common parameters](https://docs.opensearch.org/latest/api-reference/common-parameters/#time-units). schema: $ref: '#/components/schemas/_common___Duration' x-version-added: '2.0' @@ -29589,7 +29755,7 @@ components: snapshot.clone___query.cluster_manager_timeout: name: cluster_manager_timeout in: query - description: The amount of time to wait for a response from the cluster manager node. For more information about supported time units, see [Common parameters](https://opensearch.org/docs/latest/api-reference/common-parameters/#time-units). + description: The amount of time to wait for a response from the cluster manager node. For more information about supported time units, see [Common parameters](https://docs.opensearch.org/latest/api-reference/common-parameters/#time-units). schema: $ref: '#/components/schemas/_common___Duration' x-version-added: '2.0' @@ -29614,7 +29780,7 @@ components: snapshot.create_repository___query.cluster_manager_timeout: name: cluster_manager_timeout in: query - description: The amount of time to wait for a response from the cluster manager node. For more information about supported time units, see [Common parameters](https://opensearch.org/docs/latest/api-reference/common-parameters/#time-units). + description: The amount of time to wait for a response from the cluster manager node. For more information about supported time units, see [Common parameters](https://docs.opensearch.org/latest/api-reference/common-parameters/#time-units). schema: $ref: '#/components/schemas/_common___Duration' x-version-added: '2.0' @@ -29661,7 +29827,7 @@ components: snapshot.create___query.cluster_manager_timeout: name: cluster_manager_timeout in: query - description: The amount of time to wait for a response from the cluster manager node. For more information about supported time units, see [Common parameters](https://opensearch.org/docs/latest/api-reference/common-parameters/#time-units). + description: The amount of time to wait for a response from the cluster manager node. For more information about supported time units, see [Common parameters](https://docs.opensearch.org/latest/api-reference/common-parameters/#time-units). schema: $ref: '#/components/schemas/_common___Duration' x-version-added: '2.0' @@ -29694,7 +29860,7 @@ components: snapshot.delete_repository___query.cluster_manager_timeout: name: cluster_manager_timeout in: query - description: The amount of time to wait for a response from the cluster manager node. For more information about supported time units, see [Common parameters](https://opensearch.org/docs/latest/api-reference/common-parameters/#time-units). + description: The amount of time to wait for a response from the cluster manager node. For more information about supported time units, see [Common parameters](https://docs.opensearch.org/latest/api-reference/common-parameters/#time-units). schema: $ref: '#/components/schemas/_common___Duration' x-version-added: '2.0' @@ -29734,7 +29900,7 @@ components: snapshot.delete___query.cluster_manager_timeout: name: cluster_manager_timeout in: query - description: The amount of time to wait for a response from the cluster manager node. For more information about supported time units, see [Common parameters](https://opensearch.org/docs/latest/api-reference/common-parameters/#time-units). + description: The amount of time to wait for a response from the cluster manager node. For more information about supported time units, see [Common parameters](https://docs.opensearch.org/latest/api-reference/common-parameters/#time-units). schema: $ref: '#/components/schemas/_common___Duration' x-version-added: '2.0' @@ -29759,7 +29925,7 @@ components: snapshot.get_repository___query.cluster_manager_timeout: name: cluster_manager_timeout in: query - description: The amount of time to wait for a response from the cluster manager node. For more information about supported time units, see [Common parameters](https://opensearch.org/docs/latest/api-reference/common-parameters/#time-units). + description: The amount of time to wait for a response from the cluster manager node. For more information about supported time units, see [Common parameters](https://docs.opensearch.org/latest/api-reference/common-parameters/#time-units). schema: $ref: '#/components/schemas/_common___Duration' x-version-added: '2.0' @@ -29803,7 +29969,7 @@ components: snapshot.get___query.cluster_manager_timeout: name: cluster_manager_timeout in: query - description: The amount of time to wait for a response from the cluster manager node. For more information about supported time units, see [Common parameters](https://opensearch.org/docs/latest/api-reference/common-parameters/#time-units). + description: The amount of time to wait for a response from the cluster manager node. For more information about supported time units, see [Common parameters](https://docs.opensearch.org/latest/api-reference/common-parameters/#time-units). schema: $ref: '#/components/schemas/_common___Duration' x-version-added: '2.0' @@ -29851,7 +30017,7 @@ components: snapshot.restore___query.cluster_manager_timeout: name: cluster_manager_timeout in: query - description: The amount of time to wait for a response from the cluster manager node. For more information about supported time units, see [Common parameters](https://opensearch.org/docs/latest/api-reference/common-parameters/#time-units). + description: The amount of time to wait for a response from the cluster manager node. For more information about supported time units, see [Common parameters](https://docs.opensearch.org/latest/api-reference/common-parameters/#time-units). schema: $ref: '#/components/schemas/_common___Duration' x-version-added: '2.0' @@ -29892,7 +30058,7 @@ components: snapshot.status___query.cluster_manager_timeout: name: cluster_manager_timeout in: query - description: The amount of time to wait for a response from the cluster manager node. For more information about supported time units, see [Common parameters](https://opensearch.org/docs/latest/api-reference/common-parameters/#time-units). + description: The amount of time to wait for a response from the cluster manager node. For more information about supported time units, see [Common parameters](https://docs.opensearch.org/latest/api-reference/common-parameters/#time-units). schema: $ref: '#/components/schemas/_common___Duration' x-version-added: '2.0' @@ -29925,7 +30091,7 @@ components: snapshot.verify_repository___query.cluster_manager_timeout: name: cluster_manager_timeout in: query - description: The amount of time to wait for a response from the cluster manager node. For more information about supported time units, see [Common parameters](https://opensearch.org/docs/latest/api-reference/common-parameters/#time-units). + description: The amount of time to wait for a response from the cluster manager node. For more information about supported time units, see [Common parameters](https://docs.opensearch.org/latest/api-reference/common-parameters/#time-units). schema: $ref: '#/components/schemas/_common___Duration' x-version-added: '2.0' @@ -29951,7 +30117,7 @@ components: in: query description: Specifies the response format (JSON or YAML). schema: - type: string + $ref: '#/components/schemas/sql._common___ResponseFormat' sql.close___query.sanitize: name: sanitize in: query @@ -29964,7 +30130,7 @@ components: in: query description: Specifies the response format (JSON or YAML). schema: - type: string + $ref: '#/components/schemas/sql._common___ResponseFormat' sql.explain___query.sanitize: name: sanitize in: query @@ -29977,7 +30143,7 @@ components: in: query description: Specifies the response format (JSON or YAML). schema: - type: string + $ref: '#/components/schemas/sql._common___ResponseFormat' sql.get_stats___query.sanitize: name: sanitize in: query @@ -29990,7 +30156,7 @@ components: in: query description: Specifies the response format (JSON or YAML). schema: - type: string + $ref: '#/components/schemas/sql._common___ResponseFormat' sql.post_stats___query.sanitize: name: sanitize in: query @@ -30003,7 +30169,7 @@ components: in: query description: Specifies the response format (JSON or YAML). schema: - type: string + $ref: '#/components/schemas/sql._common___ResponseFormat' sql.query___query.sanitize: name: sanitize in: query @@ -30016,7 +30182,7 @@ components: in: query description: Specifies the response format (JSON or YAML). schema: - type: string + $ref: '#/components/schemas/sql._common___ResponseFormat' tasks.cancel___path.task_id: in: path name: task_id @@ -31893,27 +32059,52 @@ components: schema: type: object properties: - query_text: - type: string - description: The query text. + parameters: + type: object + additionalProperties: + type: string + description: The parameters to pass to the model. Used by remote connector models to fill the connector request_body template variables from this map. + action_type: + $ref: '#/components/schemas/ml._common___PredictionActionType' + description: Overrides the action type derived from the request path. Used for remote connector models. + dlq: + type: object + additionalProperties: + type: string + description: Dead-letter queue configuration for batch predict on remote connector models (since OpenSearch 2.19). text_docs: type: array items: type: string - description: The text documents. - required: - - text_docs + description: The text documents. Used by local text-embedding and sparse-encoding models. + query_text: + type: string + description: The query text. Used by local text-similarity models. + question: + type: string + description: The question input. Used by local question-answering models. + context: + type: string + description: The context input. Used by local question-answering models. ml.predict_model_stream: content: application/json: schema: type: object - title: MLPredictModelStreamRequestBody properties: parameters: - $ref: '#/components/schemas/ml._common___Parameters' - required: - - parameters + type: object + additionalProperties: + type: string + description: The parameters to pass to the remote connector model. + action_type: + $ref: '#/components/schemas/ml._common___PredictionActionType' + description: Overrides the action type derived from the request path. + dlq: + type: object + additionalProperties: + type: string + description: Dead-letter queue configuration for batch predict on remote connector models. ml.register_agents: content: application/json: @@ -32893,6 +33084,16 @@ components: schema: $ref: '#/components/schemas/search_pipeline._common___SearchPipelineStructure' required: true + search_relevance.experiments_search: + content: + application/json: + schema: + $ref: '#/components/schemas/search_relevance._common___SearchRequest' + search_relevance.judgments_search: + content: + application/json: + schema: + $ref: '#/components/schemas/search_relevance._common___SearchRequest' search_relevance.post_query_sets: content: application/json: @@ -32929,6 +33130,16 @@ components: application/json: schema: $ref: '#/components/schemas/search_relevance._common___PutSearchConfigurationRequest' + search_relevance.query_sets_search: + content: + application/json: + schema: + $ref: '#/components/schemas/search_relevance._common___SearchRequest' + search_relevance.search_configurations_search: + content: + application/json: + schema: + $ref: '#/components/schemas/search_relevance._common___SearchRequest' search_shards: content: application/json: @@ -34110,6 +34321,7 @@ components: content: application/json: schema: + title: CreatePITResponse type: object properties: pit_id: @@ -34119,6 +34331,10 @@ components: creation_time: type: integer format: int64 + required: + - _shards + - creation_time + - pit_id description: '' create___201: content: @@ -34187,6 +34403,7 @@ components: content: application/json: schema: + title: DeletePITResponse type: object properties: pits: @@ -37150,6 +37367,12 @@ components: schema: $ref: '#/components/schemas/_common___WriteResponseBase' description: '' + search_relevance.experiments_search___200: + content: + application/json: + schema: + $ref: '#/components/schemas/_core.search___SearchResult' + description: '' search_relevance.get_experiments___200: content: application/json: @@ -37218,6 +37441,12 @@ components: required: - nodes description: '' + search_relevance.judgments_search___200: + content: + application/json: + schema: + $ref: '#/components/schemas/_core.search___SearchResult' + description: '' search_relevance.post_query_sets___200: content: application/json: @@ -37254,6 +37483,18 @@ components: schema: $ref: '#/components/schemas/search_relevance._common___PutSearchConfigurationResponse' description: '' + search_relevance.query_sets_search___200: + content: + application/json: + schema: + $ref: '#/components/schemas/_core.search___SearchResult' + description: '' + search_relevance.search_configurations_search___200: + content: + application/json: + schema: + $ref: '#/components/schemas/_core.search___SearchResult' + description: '' search_shards___200: content: application/json: @@ -39793,7 +40034,7 @@ components: type: string description: The unique identifier of a node. _common___NodeIds: - description: A comma-separated list of node IDs used to filter results. Supports [node filters](https://opensearch.org/docs/latest/api-reference/nodes-apis/index/#node-filters). + description: A comma-separated list of node IDs used to filter results. Supports [node filters](https://docs.opensearch.org/latest/api-reference/nodes-apis/index/#node-filters). oneOf: - $ref: '#/components/schemas/_common___NodeId' - type: array @@ -39852,6 +40093,19 @@ components: const: cluster_manager description: The node can act as a cluster manager. x-version-added: '2.0' + - type: string + const: search + description: The node was dedicated to provide search capability for searchable snapshots. Renamed to `warm` in 3.0. + x-version-added: '2.4' + x-version-removed: '3.0' + - type: string + const: search + description: The node can host search replicas (search-only shards). This role must not be combined with any other role on a node. Introduced in 3.0; not to be confused with the pre-3.0 `search` role that was renamed to `warm`. + x-version-added: '3.0' + - type: string + const: warm + description: The node can hold warm indexes for searchable snapshots. Before 3.0 this role was named `search`. + x-version-added: '3.0' _common___NodeRoles: description: The role assigned to the node. type: array @@ -41179,7 +41433,7 @@ components: description: Time of day, expressed as HH:MM:SS. type: string _common___TimeUnit: - description: Specifies the time units, for example, `5d` or `7h`. For more information, see [Supported units](https://opensearch.org/docs/latest/api-reference/units/). + description: Specifies the time units, for example, `5d` or `7h`. For more information, see [Supported units](https://docs.opensearch.org/latest/api-reference/units/). oneOf: - title: nanoseconds type: string @@ -41326,7 +41580,7 @@ components: Although "void" is generally used for a unit type that has only one value, this is interpreted as the bottom type, which has no value. Most languages have a unit type, but few have a bottom type. - See https://en.m.wikipedia.org/wiki/Unit_type and https://en.m.wikipedia.org/wiki/Bottom_type. + See https://en.wikipedia.org/wiki/Unit_type and https://en.wikipedia.org/wiki/Bottom_type. type: object _common___WaitForActiveShardOptions: oneOf: @@ -41467,19 +41721,25 @@ components: _common.aggregations___AdjacencyMatrixAggregate: allOf: - $ref: '#/components/schemas/_common.aggregations___MultiBucketAggregateBaseAdjacencyMatrixBucket' - - type: object _common.aggregations___AdjacencyMatrixAggregation: allOf: - $ref: '#/components/schemas/_common.aggregations___BucketAggregationBase' - type: object properties: - filters: - description: |- - Filters used to create buckets. - At least one filter is required. - type: object - additionalProperties: - $ref: '#/components/schemas/_common.query_dsl___QueryContainer' + adjacency_matrix: + $ref: '#/components/schemas/_common.aggregations___AdjacencyMatrixAggregationFields' + required: + - adjacency_matrix + _common.aggregations___AdjacencyMatrixAggregationFields: + type: object + properties: + filters: + description: |- + Filters used to create buckets. + At least one filter is required. + type: object + additionalProperties: + $ref: '#/components/schemas/_common.query_dsl___QueryContainer' _common.aggregations___AdjacencyMatrixBucket: allOf: - $ref: '#/components/schemas/_common.aggregations___MultiBucketBase' @@ -41602,6 +41862,8 @@ components: $ref: '#/components/schemas/_common.aggregations___TTestAggregate' - title: top_hits $ref: '#/components/schemas/_common.aggregations___TopHitsAggregate' + - title: ulterms + $ref: '#/components/schemas/_common.aggregations___UnsignedLongTermsAggregate' - title: umrareterms $ref: '#/components/schemas/_common.aggregations___UnmappedRareTermsAggregate' - title: umsigterms @@ -41637,29 +41899,15 @@ components: type: object properties: meta: + description: Custom metadata to associate with the aggregation (optional) $ref: '#/components/schemas/_common___Metadata' - name: - type: string _common.aggregations___AggregationContainer: allOf: - - type: object - properties: - meta: - $ref: '#/components/schemas/_common___Metadata' + - $ref: '#/components/schemas/_common.aggregations___Aggregation' - type: object oneOf: - - properties: - adjacency_matrix: - $ref: '#/components/schemas/_common.aggregations___AdjacencyMatrixAggregation' - required: - - adjacency_matrix - unevaluatedProperties: true - - properties: - auto_date_histogram: - $ref: '#/components/schemas/_common.aggregations___AutoDateHistogramAggregation' - required: - - auto_date_histogram - unevaluatedProperties: true + - $ref: '#/components/schemas/_common.aggregations___AdjacencyMatrixAggregation' + - $ref: '#/components/schemas/_common.aggregations___AutoDateHistogramAggregation' - properties: avg: $ref: '#/components/schemas/_common.aggregations___AverageAggregation' @@ -41702,18 +41950,8 @@ components: required: - cardinality unevaluatedProperties: true - - properties: - children: - $ref: '#/components/schemas/_common.aggregations___ChildrenAggregation' - required: - - children - unevaluatedProperties: true - - properties: - composite: - $ref: '#/components/schemas/_common.aggregations___CompositeAggregation' - required: - - composite - unevaluatedProperties: true + - $ref: '#/components/schemas/_common.aggregations___ChildrenAggregation' + - $ref: '#/components/schemas/_common.aggregations___CompositeAggregation' - properties: cumulative_cardinality: $ref: '#/components/schemas/_common.aggregations___CumulativeCardinalityAggregation' @@ -41726,30 +41964,15 @@ components: required: - cumulative_sum unevaluatedProperties: true - - properties: - date_histogram: - $ref: '#/components/schemas/_common.aggregations___DateHistogramAggregation' - required: - - date_histogram - unevaluatedProperties: true - - properties: - date_range: - $ref: '#/components/schemas/_common.aggregations___DateRangeAggregation' - required: - - date_range - unevaluatedProperties: true + - $ref: '#/components/schemas/_common.aggregations___DateHistogramAggregation' + - $ref: '#/components/schemas/_common.aggregations___DateRangeAggregation' - properties: derivative: $ref: '#/components/schemas/_common.aggregations___DerivativeAggregation' required: - derivative unevaluatedProperties: true - - properties: - diversified_sampler: - $ref: '#/components/schemas/_common.aggregations___DiversifiedSamplerAggregation' - required: - - diversified_sampler - unevaluatedProperties: true + - $ref: '#/components/schemas/_common.aggregations___DiversifiedSamplerAggregation' - properties: extended_stats: $ref: '#/components/schemas/_common.aggregations___ExtendedStatsAggregation' @@ -41762,19 +41985,8 @@ components: required: - extended_stats_bucket unevaluatedProperties: true - - properties: - filter: - $ref: '#/components/schemas/_common.query_dsl___QueryContainer' - required: - - filter - unevaluatedProperties: true - x-protobuf-excluded: true - - properties: - filters: - $ref: '#/components/schemas/_common.aggregations___FiltersAggregation' - required: - - filters - unevaluatedProperties: true + - $ref: '#/components/schemas/_common.aggregations___FilterAggregation' + - $ref: '#/components/schemas/_common.aggregations___FiltersAggregation' - properties: geo_bounds: $ref: '#/components/schemas/_common.aggregations___GeoBoundsAggregation' @@ -41787,42 +41999,12 @@ components: required: - geo_centroid unevaluatedProperties: true - - properties: - geo_distance: - $ref: '#/components/schemas/_common.aggregations___GeoDistanceAggregation' - required: - - geo_distance - unevaluatedProperties: true - - properties: - geohash_grid: - $ref: '#/components/schemas/_common.aggregations___GeoHashGridAggregation' - required: - - geohash_grid - unevaluatedProperties: true - - properties: - geotile_grid: - $ref: '#/components/schemas/_common.aggregations___GeoTileGridAggregation' - required: - - geotile_grid - unevaluatedProperties: true - - properties: - global: - $ref: '#/components/schemas/_common.aggregations___GlobalAggregation' - required: - - global - unevaluatedProperties: true - - properties: - histogram: - $ref: '#/components/schemas/_common.aggregations___HistogramAggregation' - required: - - histogram - unevaluatedProperties: true - - properties: - ip_range: - $ref: '#/components/schemas/_common.aggregations___IpRangeAggregation' - required: - - ip_range - unevaluatedProperties: true + - $ref: '#/components/schemas/_common.aggregations___GeoDistanceAggregation' + - $ref: '#/components/schemas/_common.aggregations___GeoHashGridAggregation' + - $ref: '#/components/schemas/_common.aggregations___GeoTileGridAggregation' + - $ref: '#/components/schemas/_common.aggregations___GlobalAggregation' + - $ref: '#/components/schemas/_common.aggregations___HistogramAggregation' + - $ref: '#/components/schemas/_common.aggregations___IpRangeAggregation' - properties: matrix_stats: $ref: '#/components/schemas/_common.aggregations___MatrixStatsAggregation' @@ -41859,12 +42041,7 @@ components: required: - min_bucket unevaluatedProperties: true - - properties: - missing: - $ref: '#/components/schemas/_common.aggregations___MissingAggregation' - required: - - missing - unevaluatedProperties: true + - $ref: '#/components/schemas/_common.aggregations___MissingAggregation' - properties: moving_avg: $ref: '#/components/schemas/_common.aggregations___MovingAverageAggregation' @@ -41883,30 +42060,15 @@ components: required: - moving_fn unevaluatedProperties: true - - properties: - multi_terms: - $ref: '#/components/schemas/_common.aggregations___MultiTermsAggregation' - required: - - multi_terms - unevaluatedProperties: true - - properties: - nested: - $ref: '#/components/schemas/_common.aggregations___NestedAggregation' - required: - - nested - unevaluatedProperties: true + - $ref: '#/components/schemas/_common.aggregations___MultiTermsAggregation' + - $ref: '#/components/schemas/_common.aggregations___NestedAggregation' - properties: normalize: $ref: '#/components/schemas/_common.aggregations___NormalizeAggregation' required: - normalize unevaluatedProperties: true - - properties: - parent: - $ref: '#/components/schemas/_common.aggregations___ParentAggregation' - required: - - parent - unevaluatedProperties: true + - $ref: '#/components/schemas/_common.aggregations___ParentAggregation' - properties: percentile_ranks: $ref: '#/components/schemas/_common.aggregations___PercentileRanksAggregation' @@ -41925,36 +42087,16 @@ components: required: - percentiles_bucket unevaluatedProperties: true - - properties: - range: - $ref: '#/components/schemas/_common.aggregations___RangeAggregation' - required: - - range - unevaluatedProperties: true - - properties: - rare_terms: - $ref: '#/components/schemas/_common.aggregations___RareTermsAggregation' - required: - - rare_terms - unevaluatedProperties: true + - $ref: '#/components/schemas/_common.aggregations___RangeAggregation' + - $ref: '#/components/schemas/_common.aggregations___RareTermsAggregation' - properties: rate: $ref: '#/components/schemas/_common.aggregations___RateAggregation' required: - rate unevaluatedProperties: true - - properties: - reverse_nested: - $ref: '#/components/schemas/_common.aggregations___ReverseNestedAggregation' - required: - - reverse_nested - unevaluatedProperties: true - - properties: - sampler: - $ref: '#/components/schemas/_common.aggregations___SamplerAggregation' - required: - - sampler - unevaluatedProperties: true + - $ref: '#/components/schemas/_common.aggregations___ReverseNestedAggregation' + - $ref: '#/components/schemas/_common.aggregations___SamplerAggregation' - properties: scripted_metric: $ref: '#/components/schemas/_common.aggregations___ScriptedMetricAggregation' @@ -41967,18 +42109,8 @@ components: required: - serial_diff unevaluatedProperties: true - - properties: - significant_terms: - $ref: '#/components/schemas/_common.aggregations___SignificantTermsAggregation' - required: - - significant_terms - unevaluatedProperties: true - - properties: - significant_text: - $ref: '#/components/schemas/_common.aggregations___SignificantTextAggregation' - required: - - significant_text - unevaluatedProperties: true + - $ref: '#/components/schemas/_common.aggregations___SignificantTermsAggregation' + - $ref: '#/components/schemas/_common.aggregations___SignificantTextAggregation' - properties: stats: $ref: '#/components/schemas/_common.aggregations___StatsAggregation' @@ -42003,12 +42135,7 @@ components: required: - sum_bucket unevaluatedProperties: true - - properties: - terms: - $ref: '#/components/schemas/_common.aggregations___TermsAggregation' - required: - - terms - unevaluatedProperties: true + - $ref: '#/components/schemas/_common.aggregations___TermsAggregation' - properties: top_hits: $ref: '#/components/schemas/_common.aggregations___TopHitsAggregation' @@ -42088,31 +42215,38 @@ components: - $ref: '#/components/schemas/_common.aggregations___BucketAggregationBase' - type: object properties: - buckets: - description: The target number of buckets. - type: integer - format: int32 - field: - $ref: '#/components/schemas/_common___Field' - format: - description: |- - The date format used to format `key_as_string` in the response. - If no `format` is specified, the first date format specified in the field mapping is used. - type: string - minimum_interval: - $ref: '#/components/schemas/_common.aggregations___MinimumInterval' - missing: - $ref: '#/components/schemas/_common___DateTime' - offset: - description: Time zone specified as a ISO 8601 UTC offset. - type: string - params: - type: object - additionalProperties: true - script: - $ref: '#/components/schemas/_common___Script' - time_zone: - $ref: '#/components/schemas/_common___TimeZone' + auto_date_histogram: + $ref: '#/components/schemas/_common.aggregations___AutoDateHistogramAggregationFields' + required: + - auto_date_histogram + _common.aggregations___AutoDateHistogramAggregationFields: + type: object + properties: + buckets: + description: The target number of buckets. + type: integer + format: int32 + field: + $ref: '#/components/schemas/_common___Field' + format: + description: |- + The date format used to format `key_as_string` in the response. + If no `format` is specified, the first date format specified in the field mapping is used. + type: string + minimum_interval: + $ref: '#/components/schemas/_common.aggregations___MinimumInterval' + missing: + $ref: '#/components/schemas/_common___DateTime' + offset: + description: Time zone specified as a ISO 8601 UTC offset. + type: string + params: + type: object + additionalProperties: true + script: + $ref: '#/components/schemas/_common___Script' + time_zone: + $ref: '#/components/schemas/_common___TimeZone' _common.aggregations___AverageAggregation: allOf: - $ref: '#/components/schemas/_common.aggregations___FormatMetricAggregationBase' @@ -42124,7 +42258,6 @@ components: _common.aggregations___AvgAggregate: allOf: - $ref: '#/components/schemas/_common.aggregations___SingleMetricAggregateBase' - - type: object _common.aggregations___BoxPlotAggregate: allOf: - $ref: '#/components/schemas/_common.aggregations___AggregateBase' @@ -42183,20 +42316,39 @@ components: type: number format: double _common.aggregations___BucketAggregationBase: - allOf: - - $ref: '#/components/schemas/_common.aggregations___Aggregation' - - type: object - properties: - aggregations: - description: Sub-aggregations for this bucket aggregation - type: object - additionalProperties: - $ref: '#/components/schemas/_common.aggregations___AggregationContainer' - aggs: - description: Sub-aggregations for this bucket aggregation - type: object - additionalProperties: - $ref: '#/components/schemas/_common.aggregations___AggregationContainer' + type: object + properties: + aggregations: + description: Sub-aggregations for this bucket aggregation + type: object + propertyNames: + title: aggregation_name + description: Sub-aggregation name + type: string + additionalProperties: + title: aggregation_container + $ref: '#/components/schemas/_common.aggregations___AggregationContainer' + aggs: + description: Sub-aggregations for this bucket aggregation (alias for 'aggregations') + type: object + x-protobuf-excluded: true + propertyNames: + title: aggregation_name + description: Sub-aggregation name + type: string + additionalProperties: + title: aggregation_container + $ref: '#/components/schemas/_common.aggregations___AggregationContainer' + not: + type: object + properties: + aggregations: + type: object + aggs: + type: object + required: + - aggregations + - aggs _common.aggregations___BucketMetricValueAggregate: allOf: - $ref: '#/components/schemas/_common.aggregations___SingleMetricAggregateBase' @@ -42209,12 +42361,10 @@ components: required: - keys _common.aggregations___BucketPathAggregation: - allOf: - - $ref: '#/components/schemas/_common.aggregations___Aggregation' - - type: object - properties: - buckets_path: - $ref: '#/components/schemas/_common.aggregations___BucketsPath' + type: object + properties: + buckets_path: + $ref: '#/components/schemas/_common.aggregations___BucketsPath' _common.aggregations___Buckets: description: |- Aggregation buckets. By default they are returned as an array, but if the aggregation has keys configured for @@ -42243,24 +42393,22 @@ components: script: $ref: '#/components/schemas/_common___Script' _common.aggregations___BucketSortAggregation: - allOf: - - $ref: '#/components/schemas/_common.aggregations___Aggregation' - - type: object - properties: - from: - description: Buckets in positions prior to `from` will be truncated. - type: integer - format: int32 - gap_policy: - $ref: '#/components/schemas/_common.aggregations___GapPolicy' - size: - description: |- - The number of buckets to return. - Defaults to all buckets of the parent aggregation. - type: integer - format: int32 - sort: - $ref: '#/components/schemas/_common___Sort' + type: object + properties: + from: + description: Buckets in positions prior to `from` will be truncated. + type: integer + format: int32 + gap_policy: + $ref: '#/components/schemas/_common.aggregations___GapPolicy' + size: + description: |- + The number of buckets to return. + Defaults to all buckets of the parent aggregation. + type: integer + format: int32 + sort: + $ref: '#/components/schemas/_common___Sort' _common.aggregations___BucketsPath: description: |- Buckets path can be expressed in different ways, and an aggregation may accept some or all of these @@ -42369,8 +42517,15 @@ components: - $ref: '#/components/schemas/_common.aggregations___BucketAggregationBase' - type: object properties: - type: - $ref: '#/components/schemas/_common___RelationName' + children: + $ref: '#/components/schemas/_common.aggregations___ChildrenAggregationFields' + required: + - children + _common.aggregations___ChildrenAggregationFields: + type: object + properties: + type: + $ref: '#/components/schemas/_common___RelationName' _common.aggregations___ChiSquareHeuristic: type: object properties: @@ -42399,21 +42554,28 @@ components: - $ref: '#/components/schemas/_common.aggregations___BucketAggregationBase' - type: object properties: - after: - $ref: '#/components/schemas/_common.aggregations___CompositeAggregateKey' - size: - description: The number of composite buckets that should be returned. - type: integer - format: int32 - sources: - description: |- - The value sources used to build composite buckets. - Keys are returned in the order of the `sources` definition. - type: array - items: - type: object - additionalProperties: - $ref: '#/components/schemas/_common.aggregations___CompositeAggregationSource' + composite: + $ref: '#/components/schemas/_common.aggregations___CompositeAggregationFields' + required: + - composite + _common.aggregations___CompositeAggregationFields: + type: object + properties: + after: + $ref: '#/components/schemas/_common.aggregations___CompositeAggregateKey' + size: + description: The number of composite buckets that should be returned. + type: integer + format: int32 + sources: + description: |- + The value sources used to build composite buckets. + Keys are returned in the order of the `sources` definition. + type: array + items: + type: object + additionalProperties: + $ref: '#/components/schemas/_common.aggregations___CompositeAggregationSource' _common.aggregations___CompositeAggregationSource: type: object properties: @@ -42511,51 +42673,57 @@ components: _common.aggregations___DateHistogramAggregate: allOf: - $ref: '#/components/schemas/_common.aggregations___MultiBucketAggregateBaseDateHistogramBucket' - - type: object _common.aggregations___DateHistogramAggregation: allOf: - $ref: '#/components/schemas/_common.aggregations___BucketAggregationBase' - type: object properties: - calendar_interval: - $ref: '#/components/schemas/_common.aggregations___CalendarInterval' - extended_bounds: - $ref: '#/components/schemas/_common.aggregations___ExtendedBoundsFieldDateMath' - hard_bounds: - $ref: '#/components/schemas/_common.aggregations___ExtendedBoundsFieldDateMath' - field: - $ref: '#/components/schemas/_common___Field' - fixed_interval: - $ref: '#/components/schemas/_common___Duration' - format: - description: |- - The date format used to format `key_as_string` in the response. - If no `format` is specified, the first date format specified in the field mapping is used. - type: string - interval: - $ref: '#/components/schemas/_common___Duration' - min_doc_count: - description: |- - Only returns buckets that have `min_doc_count` number of documents. - By default, all buckets between the first bucket that matches documents and the last one are returned. - type: integer - format: int32 - missing: - $ref: '#/components/schemas/_common___DateTime' - offset: - $ref: '#/components/schemas/_common___Duration' - order: - $ref: '#/components/schemas/_common.aggregations___HistogramOrder' - params: - type: object - additionalProperties: true - script: - $ref: '#/components/schemas/_common___Script' - time_zone: - $ref: '#/components/schemas/_common___TimeZone' - keyed: - description: Set to `true` to associate a unique string key with each bucket and return the ranges as a hash rather than an array. - type: boolean + date_histogram: + $ref: '#/components/schemas/_common.aggregations___DateHistogramAggregationFields' + required: + - date_histogram + _common.aggregations___DateHistogramAggregationFields: + type: object + properties: + calendar_interval: + $ref: '#/components/schemas/_common.aggregations___CalendarInterval' + extended_bounds: + $ref: '#/components/schemas/_common.aggregations___ExtendedBoundsFieldDateMath' + hard_bounds: + $ref: '#/components/schemas/_common.aggregations___ExtendedBoundsFieldDateMath' + field: + $ref: '#/components/schemas/_common___Field' + fixed_interval: + $ref: '#/components/schemas/_common___Duration' + format: + description: |- + The date format used to format `key_as_string` in the response. + If no `format` is specified, the first date format specified in the field mapping is used. + type: string + interval: + $ref: '#/components/schemas/_common___Duration' + min_doc_count: + description: |- + Only returns buckets that have `min_doc_count` number of documents. + By default, all buckets between the first bucket that matches documents and the last one are returned. + type: integer + format: int32 + missing: + $ref: '#/components/schemas/_common___DateTime' + offset: + $ref: '#/components/schemas/_common___Duration' + order: + $ref: '#/components/schemas/_common.aggregations___HistogramOrder' + params: + type: object + additionalProperties: true + script: + $ref: '#/components/schemas/_common___Script' + time_zone: + $ref: '#/components/schemas/_common___TimeZone' + keyed: + description: Set to `true` to associate a unique string key with each bucket and return the ranges as a hash rather than an array. + type: boolean _common.aggregations___DateHistogramBucket: allOf: - $ref: '#/components/schemas/_common.aggregations___MultiBucketBase' @@ -42570,29 +42738,35 @@ components: _common.aggregations___DateRangeAggregate: allOf: - $ref: '#/components/schemas/_common.aggregations___RangeAggregateBase' - - type: object _common.aggregations___DateRangeAggregation: allOf: - $ref: '#/components/schemas/_common.aggregations___BucketAggregationBase' - type: object properties: - field: - $ref: '#/components/schemas/_common___Field' - format: - description: The date format used to format `from` and `to` in the response. - type: string - missing: - $ref: '#/components/schemas/_common___FieldValue' - ranges: - description: Array of date ranges. - type: array - items: - $ref: '#/components/schemas/_common.aggregations___DateRangeExpression' - time_zone: - $ref: '#/components/schemas/_common___TimeZone' - keyed: - description: Set to `true` to associate a unique string key with each bucket and returns the ranges as a hash rather than an array. - type: boolean + date_range: + $ref: '#/components/schemas/_common.aggregations___DateRangeAggregationFields' + required: + - date_range + _common.aggregations___DateRangeAggregationFields: + type: object + properties: + field: + $ref: '#/components/schemas/_common___Field' + format: + description: The date format used to format `from` and `to` in the response. + type: string + missing: + $ref: '#/components/schemas/_common___FieldValue' + ranges: + description: Array of date ranges. + type: array + items: + $ref: '#/components/schemas/_common.aggregations___DateRangeExpression' + time_zone: + $ref: '#/components/schemas/_common___TimeZone' + keyed: + description: Set to `true` to associate a unique string key with each bucket and returns the ranges as a hash rather than an array. + type: boolean _common.aggregations___DateRangeExpression: type: object properties: @@ -42622,20 +42796,27 @@ components: - $ref: '#/components/schemas/_common.aggregations___BucketAggregationBase' - type: object properties: - execution_hint: - $ref: '#/components/schemas/_common.aggregations___SamplerAggregationExecutionHint' - max_docs_per_value: - description: Limits how many documents are permitted per choice of de-duplicating value. - type: integer - format: int32 - script: - $ref: '#/components/schemas/_common___Script' - shard_size: - description: Limits how many top-scoring documents are collected in the sample processed on each shard. - type: integer - format: int32 - field: - $ref: '#/components/schemas/_common___Field' + diversified_sampler: + $ref: '#/components/schemas/_common.aggregations___DiversifiedSamplerAggregationFields' + required: + - diversified_sampler + _common.aggregations___DiversifiedSamplerAggregationFields: + type: object + properties: + execution_hint: + $ref: '#/components/schemas/_common.aggregations___SamplerAggregationExecutionHint' + max_docs_per_value: + description: Limits how many documents are permitted per choice of de-duplicating value. + type: integer + format: int32 + script: + $ref: '#/components/schemas/_common___Script' + shard_size: + description: Limits how many top-scoring documents are collected in the sample processed on each shard. + type: integer + format: int32 + field: + $ref: '#/components/schemas/_common___Field' _common.aggregations___DoubleTermsAggregate: description: Result of a `terms` aggregation when the field is some kind of decimal number like a float, double, or distance. allOf: @@ -42782,7 +42963,6 @@ components: _common.aggregations___ExtendedStatsBucketAggregate: allOf: - $ref: '#/components/schemas/_common.aggregations___ExtendedStatsAggregateBase' - - type: object _common.aggregations___ExtendedStatsBucketAggregation: allOf: - $ref: '#/components/schemas/_common.aggregations___PipelineAggregationBase' @@ -42806,28 +42986,47 @@ components: allOf: - $ref: '#/components/schemas/_common.aggregations___SingleBucketAggregateBase' - type: object + _common.aggregations___FilterAggregation: + allOf: + - $ref: '#/components/schemas/_common.aggregations___BucketAggregationBase' + - type: object + properties: + filter: + $ref: '#/components/schemas/_common.aggregations___FilterAggregationFields' + required: + - filter + x-protobuf-excluded: true + _common.aggregations___FilterAggregationFields: + allOf: + - $ref: '#/components/schemas/_common.query_dsl___QueryContainer' _common.aggregations___FiltersAggregate: allOf: - $ref: '#/components/schemas/_common.aggregations___MultiBucketAggregateBaseFiltersBucket' - - type: object _common.aggregations___FiltersAggregation: allOf: - $ref: '#/components/schemas/_common.aggregations___BucketAggregationBase' - type: object properties: filters: - $ref: '#/components/schemas/_common.aggregations___BucketsQueryContainer' - other_bucket: - description: Set to `true` to add a bucket to the response which will contain all documents that do not match any of the given filters. - type: boolean - other_bucket_key: - description: The key with which the other bucket is returned. - type: string - keyed: - description: |- - By default, the named filters aggregation returns the buckets as an object. - Set to `false` to return the buckets as an array of objects. - type: boolean + $ref: '#/components/schemas/_common.aggregations___FiltersAggregationFields' + required: + - filters + _common.aggregations___FiltersAggregationFields: + type: object + properties: + filters: + $ref: '#/components/schemas/_common.aggregations___BucketsQueryContainer' + other_bucket: + description: Set to `true` to add a bucket to the response which will contain all documents that do not match any of the given filters. + type: boolean + other_bucket_key: + description: The key with which the other bucket is returned. + type: string + keyed: + description: |- + By default, the named filters aggregation returns the buckets as an object. + Set to `false` to return the buckets as an array of objects. + type: boolean _common.aggregations___FiltersBucket: allOf: - $ref: '#/components/schemas/_common.aggregations___MultiBucketBase' @@ -42892,50 +43091,62 @@ components: _common.aggregations___GeoDistanceAggregate: allOf: - $ref: '#/components/schemas/_common.aggregations___RangeAggregateBase' - - type: object _common.aggregations___GeoDistanceAggregation: allOf: - $ref: '#/components/schemas/_common.aggregations___BucketAggregationBase' - type: object properties: - distance_type: - $ref: '#/components/schemas/_common___GeoDistanceType' - field: - $ref: '#/components/schemas/_common___Field' - origin: - $ref: '#/components/schemas/_common___GeoLocation' - ranges: - description: An array of ranges used to bucket documents. - type: array - items: - $ref: '#/components/schemas/_common.aggregations___AggregationRange' - unit: - $ref: '#/components/schemas/_common___DistanceUnit' + geo_distance: + $ref: '#/components/schemas/_common.aggregations___GeoDistanceAggregationFields' + required: + - geo_distance + _common.aggregations___GeoDistanceAggregationFields: + type: object + properties: + distance_type: + $ref: '#/components/schemas/_common___GeoDistanceType' + field: + $ref: '#/components/schemas/_common___Field' + origin: + $ref: '#/components/schemas/_common___GeoLocation' + ranges: + description: An array of ranges used to bucket documents. + type: array + items: + $ref: '#/components/schemas/_common.aggregations___AggregationRange' + unit: + $ref: '#/components/schemas/_common___DistanceUnit' _common.aggregations___GeoHashGridAggregate: allOf: - $ref: '#/components/schemas/_common.aggregations___MultiBucketAggregateBaseGeoHashGridBucket' - - type: object _common.aggregations___GeoHashGridAggregation: allOf: - $ref: '#/components/schemas/_common.aggregations___BucketAggregationBase' - type: object properties: - bounds: - $ref: '#/components/schemas/_common___GeoBounds' - field: - $ref: '#/components/schemas/_common___Field' - precision: - $ref: '#/components/schemas/_common___GeoHashPrecision' - shard_size: - description: |- - Allows for more accurate counting of the top cells returned in the final result the aggregation. - Defaults to returning `max(10,(size x number-of-shards))` buckets from each shard. - type: integer - format: int32 - size: - description: The maximum number of geohash buckets to return. - type: integer - format: int32 + geohash_grid: + $ref: '#/components/schemas/_common.aggregations___GeoHashGridAggregationFields' + required: + - geohash_grid + _common.aggregations___GeoHashGridAggregationFields: + type: object + properties: + bounds: + $ref: '#/components/schemas/_common___GeoBounds' + field: + $ref: '#/components/schemas/_common___Field' + precision: + $ref: '#/components/schemas/_common___GeoHashPrecision' + shard_size: + description: |- + Allows for more accurate counting of the top cells returned in the final result the aggregation. + Defaults to returning `max(10,(size x number-of-shards))` buckets from each shard. + type: integer + format: int32 + size: + description: The maximum number of geohash buckets to return. + type: integer + format: int32 _common.aggregations___GeoHashGridBucket: allOf: - $ref: '#/components/schemas/_common.aggregations___MultiBucketBase' @@ -42948,28 +43159,34 @@ components: _common.aggregations___GeoTileGridAggregate: allOf: - $ref: '#/components/schemas/_common.aggregations___MultiBucketAggregateBaseGeoTileGridBucket' - - type: object _common.aggregations___GeoTileGridAggregation: allOf: - $ref: '#/components/schemas/_common.aggregations___BucketAggregationBase' - type: object properties: - field: - $ref: '#/components/schemas/_common___Field' - precision: - $ref: '#/components/schemas/_common___GeoTilePrecision' - shard_size: - description: |- - Allows for more accurate counting of the top cells returned in the final result the aggregation. - Defaults to returning `max(10,(size x number-of-shards))` buckets from each shard. - type: integer - format: int32 - size: - description: The maximum number of buckets to return. - type: integer - format: int32 - bounds: - $ref: '#/components/schemas/_common___GeoBounds' + geotile_grid: + $ref: '#/components/schemas/_common.aggregations___GeoTileGridAggregationFields' + required: + - geotile_grid + _common.aggregations___GeoTileGridAggregationFields: + type: object + properties: + field: + $ref: '#/components/schemas/_common___Field' + precision: + $ref: '#/components/schemas/_common___GeoTilePrecision' + shard_size: + description: |- + Allows for more accurate counting of the top cells returned in the final result the aggregation. + Defaults to returning `max(10,(size x number-of-shards))` buckets from each shard. + type: integer + format: int32 + size: + description: The maximum number of buckets to return. + type: integer + format: int32 + bounds: + $ref: '#/components/schemas/_common___GeoBounds' _common.aggregations___GeoTileGridBucket: allOf: - $ref: '#/components/schemas/_common.aggregations___MultiBucketBase' @@ -42987,6 +43204,13 @@ components: allOf: - $ref: '#/components/schemas/_common.aggregations___BucketAggregationBase' - type: object + properties: + global: + $ref: '#/components/schemas/_common.aggregations___GlobalAggregationFields' + required: + - global + _common.aggregations___GlobalAggregationFields: + type: object _common.aggregations___GoogleNormalizedDistanceHeuristic: type: object properties: @@ -43003,59 +43227,63 @@ components: _common.aggregations___HdrPercentileRanksAggregate: allOf: - $ref: '#/components/schemas/_common.aggregations___PercentilesAggregateBase' - - type: object _common.aggregations___HdrPercentilesAggregate: allOf: - $ref: '#/components/schemas/_common.aggregations___PercentilesAggregateBase' - - type: object _common.aggregations___HistogramAggregate: allOf: - $ref: '#/components/schemas/_common.aggregations___MultiBucketAggregateBaseHistogramBucket' - - type: object _common.aggregations___HistogramAggregation: allOf: - $ref: '#/components/schemas/_common.aggregations___BucketAggregationBase' - type: object properties: - extended_bounds: - $ref: '#/components/schemas/_common.aggregations___ExtendedBoundsDouble' - hard_bounds: - $ref: '#/components/schemas/_common.aggregations___ExtendedBoundsDouble' - field: - $ref: '#/components/schemas/_common___Field' - interval: - description: |- - The interval for the buckets. - Must be a positive decimal. - type: number - format: double - min_doc_count: - description: |- - Only returns buckets that have `min_doc_count` number of documents. - By default, the response will fill gaps in the histogram with empty buckets. - type: integer - format: int32 - missing: - description: |- - The value to apply to documents that do not have a value. - By default, documents without a value are ignored. - type: number - format: double - offset: - description: |- - By default, the bucket keys start with 0 and then continue in even spaced steps of `interval`. - The bucket boundaries can be shifted by using the `offset` option. - type: number - format: double - order: - $ref: '#/components/schemas/_common.aggregations___HistogramOrder' - script: - $ref: '#/components/schemas/_common___Script' - format: - type: string - keyed: - description: If `true`, returns buckets as a hash instead of an array, keyed by the bucket keys. - type: boolean + histogram: + $ref: '#/components/schemas/_common.aggregations___HistogramAggregationFields' + required: + - histogram + _common.aggregations___HistogramAggregationFields: + type: object + properties: + extended_bounds: + $ref: '#/components/schemas/_common.aggregations___ExtendedBoundsDouble' + hard_bounds: + $ref: '#/components/schemas/_common.aggregations___ExtendedBoundsDouble' + field: + $ref: '#/components/schemas/_common___Field' + interval: + description: |- + The interval for the buckets. + Must be a positive decimal. + type: number + format: double + min_doc_count: + description: |- + Only returns buckets that have `min_doc_count` number of documents. + By default, the response will fill gaps in the histogram with empty buckets. + type: integer + format: int32 + missing: + description: |- + The value to apply to documents that do not have a value. + By default, documents without a value are ignored. + type: number + format: double + offset: + description: |- + By default, the bucket keys start with 0 and then continue in even spaced steps of `interval`. + The bucket boundaries can be shifted by using the `offset` option. + type: number + format: double + order: + $ref: '#/components/schemas/_common.aggregations___HistogramOrder' + script: + $ref: '#/components/schemas/_common___Script' + format: + type: string + keyed: + description: If `true`, returns buckets as a hash instead of an array, keyed by the bucket keys. + type: boolean _common.aggregations___HistogramBucket: allOf: - $ref: '#/components/schemas/_common.aggregations___MultiBucketBase' @@ -43142,19 +43370,25 @@ components: _common.aggregations___IpRangeAggregate: allOf: - $ref: '#/components/schemas/_common.aggregations___MultiBucketAggregateBaseIpRangeBucket' - - type: object _common.aggregations___IpRangeAggregation: allOf: - $ref: '#/components/schemas/_common.aggregations___BucketAggregationBase' - type: object properties: - field: - $ref: '#/components/schemas/_common___Field' - ranges: - description: Array of IP ranges. - type: array - items: - $ref: '#/components/schemas/_common.aggregations___IpRangeAggregationRange' + ip_range: + $ref: '#/components/schemas/_common.aggregations___IpRangeAggregationFields' + required: + - ip_range + _common.aggregations___IpRangeAggregationFields: + type: object + properties: + field: + $ref: '#/components/schemas/_common___Field' + ranges: + description: Array of IP ranges. + type: array + items: + $ref: '#/components/schemas/_common.aggregations___IpRangeAggregationRange' _common.aggregations___IpRangeAggregationRange: type: object properties: @@ -43245,20 +43479,18 @@ components: - title: unsigned type: string _common.aggregations___MatrixAggregation: - allOf: - - $ref: '#/components/schemas/_common.aggregations___Aggregation' - - type: object - properties: - fields: - $ref: '#/components/schemas/_common___Fields' - missing: - description: |- - The value to apply to documents that do not have a value. - By default, documents without a value are ignored. - type: object - additionalProperties: - type: number - format: double + type: object + properties: + fields: + $ref: '#/components/schemas/_common___Fields' + missing: + description: |- + The value to apply to documents that do not have a value. + By default, documents without a value are ignored. + type: object + additionalProperties: + type: number + format: double _common.aggregations___MatrixStatsAggregate: allOf: - $ref: '#/components/schemas/_common.aggregations___AggregateBase' @@ -43322,7 +43554,6 @@ components: _common.aggregations___MaxAggregate: allOf: - $ref: '#/components/schemas/_common.aggregations___SingleMetricAggregateBase' - - type: object _common.aggregations___MaxAggregation: allOf: - $ref: '#/components/schemas/_common.aggregations___FormatMetricAggregationBase' @@ -43337,7 +43568,6 @@ components: _common.aggregations___MedianAbsoluteDeviationAggregate: allOf: - $ref: '#/components/schemas/_common.aggregations___SingleMetricAggregateBase' - - type: object _common.aggregations___MedianAbsoluteDeviationAggregation: allOf: - $ref: '#/components/schemas/_common.aggregations___FormatMetricAggregationBase' @@ -43349,7 +43579,6 @@ components: format: double _common.aggregations___MetricAggregationBase: allOf: - - $ref: '#/components/schemas/_common.aggregations___Aggregation' - type: object properties: missing: @@ -43366,7 +43595,6 @@ components: _common.aggregations___MinAggregate: allOf: - $ref: '#/components/schemas/_common.aggregations___SingleMetricAggregateBase' - - type: object _common.aggregations___MinAggregation: allOf: - $ref: '#/components/schemas/_common.aggregations___FormatMetricAggregationBase' @@ -43396,10 +43624,17 @@ components: - $ref: '#/components/schemas/_common.aggregations___BucketAggregationBase' - type: object properties: - field: - $ref: '#/components/schemas/_common___Field' missing: - $ref: '#/components/schemas/_common___FieldValue' + $ref: '#/components/schemas/_common.aggregations___MissingAggregationFields' + required: + - missing + _common.aggregations___MissingAggregationFields: + type: object + properties: + field: + $ref: '#/components/schemas/_common___Field' + missing: + $ref: '#/components/schemas/_common___FieldValue' _common.aggregations___MissingOrder: type: string enum: @@ -43704,6 +43939,8 @@ components: doc_count: type: integer format: int64 + additionalProperties: + $ref: '#/components/schemas/_common.aggregations___Aggregate' required: - doc_count _common.aggregations___MultiTermLookup: @@ -43718,44 +43955,50 @@ components: _common.aggregations___MultiTermsAggregate: allOf: - $ref: '#/components/schemas/_common.aggregations___TermsAggregateBaseMultiTermsBucket' - - type: object _common.aggregations___MultiTermsAggregation: allOf: - $ref: '#/components/schemas/_common.aggregations___BucketAggregationBase' - type: object properties: - collect_mode: - $ref: '#/components/schemas/_common.aggregations___TermsAggregationCollectMode' - order: - $ref: '#/components/schemas/_common.aggregations___HistogramOrder' - min_doc_count: - description: The minimum number of documents in a bucket for it to be returned. - type: integer - format: int32 - shard_min_doc_count: - description: The minimum number of documents in a bucket on each shard for it to be returned. - type: integer - format: int32 - shard_size: - description: |- - The number of candidate terms produced by each shard. - By default, `shard_size` will be automatically estimated based on the number of shards and the `size` parameter. - type: integer - format: int32 - show_term_doc_count_error: - description: Calculates the doc count error on per term basis. - type: boolean - size: - description: The number of term buckets should be returned out of the overall terms list. - type: integer - format: int32 - terms: - description: The field from which to generate sets of terms. - type: array - items: - $ref: '#/components/schemas/_common.aggregations___MultiTermLookup' + multi_terms: + $ref: '#/components/schemas/_common.aggregations___MultiTermsAggregationFields' required: - - terms + - multi_terms + _common.aggregations___MultiTermsAggregationFields: + type: object + properties: + collect_mode: + $ref: '#/components/schemas/_common.aggregations___TermsAggregationCollectMode' + order: + $ref: '#/components/schemas/_common.aggregations___HistogramOrder' + min_doc_count: + description: The minimum number of documents in a bucket for it to be returned. + type: integer + format: int32 + shard_min_doc_count: + description: The minimum number of documents in a bucket on each shard for it to be returned. + type: integer + format: int32 + shard_size: + description: |- + The number of candidate terms produced by each shard. + By default, `shard_size` will be automatically estimated based on the number of shards and the `size` parameter. + type: integer + format: int32 + show_term_doc_count_error: + description: Calculates the doc count error on per term basis. + type: boolean + size: + description: The number of term buckets should be returned out of the overall terms list. + type: integer + format: int32 + terms: + description: The field from which to generate sets of terms. + type: array + items: + $ref: '#/components/schemas/_common.aggregations___MultiTermLookup' + required: + - terms _common.aggregations___MultiTermsBucket: allOf: - $ref: '#/components/schemas/_common.aggregations___MultiBucketBase' @@ -43785,14 +44028,20 @@ components: allOf: - $ref: '#/components/schemas/_common.aggregations___SingleBucketAggregateBase' - type: object - properties: {} _common.aggregations___NestedAggregation: allOf: - $ref: '#/components/schemas/_common.aggregations___BucketAggregationBase' - type: object properties: - path: - $ref: '#/components/schemas/_common___Field' + nested: + $ref: '#/components/schemas/_common.aggregations___NestedAggregationFields' + required: + - nested + _common.aggregations___NestedAggregationFields: + type: object + properties: + path: + $ref: '#/components/schemas/_common___Field' _common.aggregations___NormalizeAggregation: allOf: - $ref: '#/components/schemas/_common.aggregations___PipelineAggregationBase' @@ -43818,8 +44067,15 @@ components: - $ref: '#/components/schemas/_common.aggregations___BucketAggregationBase' - type: object properties: - type: - $ref: '#/components/schemas/_common___RelationName' + parent: + $ref: '#/components/schemas/_common.aggregations___ParentAggregationFields' + required: + - parent + _common.aggregations___ParentAggregationFields: + type: object + properties: + type: + $ref: '#/components/schemas/_common___RelationName' _common.aggregations___PercentageScoreHeuristic: type: object _common.aggregations___PercentileRanksAggregation: @@ -43882,7 +44138,6 @@ components: _common.aggregations___PercentilesBucketAggregate: allOf: - $ref: '#/components/schemas/_common.aggregations___PercentilesAggregateBase' - - type: object _common.aggregations___PercentilesBucketAggregation: allOf: - $ref: '#/components/schemas/_common.aggregations___PipelineAggregationBase' @@ -43909,7 +44164,6 @@ components: _common.aggregations___RangeAggregate: allOf: - $ref: '#/components/schemas/_common.aggregations___RangeAggregateBase' - - type: object _common.aggregations___RangeAggregateBase: allOf: - $ref: '#/components/schemas/_common.aggregations___MultiBucketAggregateBaseRangeBucket' @@ -43919,26 +44173,33 @@ components: - $ref: '#/components/schemas/_common.aggregations___BucketAggregationBase' - type: object properties: - field: - $ref: '#/components/schemas/_common___Field' - missing: - description: |- - The value to apply to documents that do not have a value. - By default, documents without a value are ignored. - type: integer - format: int32 - ranges: - description: An array of ranges used to bucket documents. - type: array - items: - $ref: '#/components/schemas/_common.aggregations___AggregationRange' - script: - $ref: '#/components/schemas/_common___Script' - keyed: - description: Set to `true` to associate a unique string key with each bucket and return the ranges as a hash rather than an array. - type: boolean - format: - type: string + range: + $ref: '#/components/schemas/_common.aggregations___RangeAggregationFields' + required: + - range + _common.aggregations___RangeAggregationFields: + type: object + properties: + field: + $ref: '#/components/schemas/_common___Field' + missing: + description: |- + The value to apply to documents that do not have a value. + By default, documents without a value are ignored. + type: integer + format: int32 + ranges: + description: An array of ranges used to bucket documents. + type: array + items: + $ref: '#/components/schemas/_common.aggregations___AggregationRange' + script: + $ref: '#/components/schemas/_common___Script' + keyed: + description: Set to `true` to associate a unique string key with each bucket and return the ranges as a hash rather than an array. + type: boolean + format: + type: string _common.aggregations___RangeBucket: allOf: - $ref: '#/components/schemas/_common.aggregations___MultiBucketBase' @@ -43962,26 +44223,33 @@ components: - $ref: '#/components/schemas/_common.aggregations___BucketAggregationBase' - type: object properties: - exclude: - $ref: '#/components/schemas/_common.aggregations___TermsExclude' - field: - $ref: '#/components/schemas/_common___Field' - include: - $ref: '#/components/schemas/_common.aggregations___TermsInclude' - max_doc_count: - description: The maximum number of documents a term should appear in. - type: integer - format: int64 - missing: - $ref: '#/components/schemas/_common___FieldValue' - precision: - description: |- - The precision of the internal CuckooFilters. - Smaller precision leads to better approximation, but higher memory usage. - type: number - format: double - value_type: - type: string + rare_terms: + $ref: '#/components/schemas/_common.aggregations___RareTermsAggregationFields' + required: + - rare_terms + _common.aggregations___RareTermsAggregationFields: + type: object + properties: + exclude: + $ref: '#/components/schemas/_common.aggregations___TermsExclude' + field: + $ref: '#/components/schemas/_common___Field' + include: + $ref: '#/components/schemas/_common.aggregations___TermsInclude' + max_doc_count: + description: The maximum number of documents a term should appear in. + type: integer + format: int64 + missing: + $ref: '#/components/schemas/_common___FieldValue' + precision: + description: |- + The precision of the internal CuckooFilters. + Smaller precision leads to better approximation, but higher memory usage. + type: number + format: double + value_type: + type: string _common.aggregations___RateAggregate: allOf: - $ref: '#/components/schemas/_common.aggregations___AggregateBase' @@ -44017,8 +44285,15 @@ components: - $ref: '#/components/schemas/_common.aggregations___BucketAggregationBase' - type: object properties: - path: - $ref: '#/components/schemas/_common___Field' + reverse_nested: + $ref: '#/components/schemas/_common.aggregations___ReverseNestedAggregationFields' + required: + - reverse_nested + _common.aggregations___ReverseNestedAggregationFields: + type: object + properties: + path: + $ref: '#/components/schemas/_common___Field' _common.aggregations___SamplerAggregate: allOf: - $ref: '#/components/schemas/_common.aggregations___SingleBucketAggregateBase' @@ -44028,16 +44303,23 @@ components: - $ref: '#/components/schemas/_common.aggregations___BucketAggregationBase' - type: object properties: - shard_size: - description: Limits how many top-scoring documents are collected in the sample processed on each shard. - type: integer - format: int32 + sampler: + $ref: '#/components/schemas/_common.aggregations___SamplerAggregationFields' + required: + - sampler _common.aggregations___SamplerAggregationExecutionHint: type: string enum: - bytes_hash - global_ordinals - map + _common.aggregations___SamplerAggregationFields: + type: object + properties: + shard_size: + description: Limits how many top-scoring documents are collected in the sample processed on each shard. + type: integer + format: int32 _common.aggregations___ScriptedHeuristic: type: object properties: @@ -44086,7 +44368,6 @@ components: _common.aggregations___SignificantLongTermsAggregate: allOf: - $ref: '#/components/schemas/_common.aggregations___SignificantTermsAggregateBaseSignificantLongTermsBucket' - - type: object _common.aggregations___SignificantLongTermsBucket: allOf: - $ref: '#/components/schemas/_common.aggregations___SignificantTermsBucketBase' @@ -44102,7 +44383,6 @@ components: _common.aggregations___SignificantStringTermsAggregate: allOf: - $ref: '#/components/schemas/_common.aggregations___SignificantTermsAggregateBaseSignificantStringTermsBucket' - - type: object _common.aggregations___SignificantStringTermsBucket: allOf: - $ref: '#/components/schemas/_common.aggregations___SignificantTermsBucketBase' @@ -44173,48 +44453,55 @@ components: - $ref: '#/components/schemas/_common.aggregations___BucketAggregationBase' - type: object properties: - background_filter: - $ref: '#/components/schemas/_common.query_dsl___QueryContainer' - chi_square: - $ref: '#/components/schemas/_common.aggregations___ChiSquareHeuristic' - exclude: - $ref: '#/components/schemas/_common.aggregations___TermsExclude' - execution_hint: - $ref: '#/components/schemas/_common.aggregations___TermsAggregationExecutionHint' - field: - $ref: '#/components/schemas/_common___Field' - gnd: - $ref: '#/components/schemas/_common.aggregations___GoogleNormalizedDistanceHeuristic' - include: - $ref: '#/components/schemas/_common.aggregations___TermsInclude' - jlh: - $ref: '#/components/schemas/_common___EmptyObject' - min_doc_count: - description: Only return terms that are found in more than `min_doc_count` hits. - type: integer - format: int64 - mutual_information: - $ref: '#/components/schemas/_common.aggregations___MutualInformationHeuristic' - percentage: - $ref: '#/components/schemas/_common.aggregations___PercentageScoreHeuristic' - script_heuristic: - $ref: '#/components/schemas/_common.aggregations___ScriptedHeuristic' - shard_min_doc_count: - description: |- - Regulates the certainty a shard has if the term should actually be added to the candidate list or not with respect to the `min_doc_count`. - Terms will only be considered if their local shard frequency within the set is higher than the `shard_min_doc_count`. - type: integer - format: int64 - shard_size: - description: |- - Can be used to control the volumes of candidate terms produced by each shard. - By default, `shard_size` will be automatically estimated based on the number of shards and the `size` parameter. - type: integer - format: int32 - size: - description: The number of buckets returned out of the overall terms list. - type: integer - format: int32 + significant_terms: + $ref: '#/components/schemas/_common.aggregations___SignificantTermsAggregationFields' + required: + - significant_terms + _common.aggregations___SignificantTermsAggregationFields: + type: object + properties: + background_filter: + $ref: '#/components/schemas/_common.query_dsl___QueryContainer' + chi_square: + $ref: '#/components/schemas/_common.aggregations___ChiSquareHeuristic' + exclude: + $ref: '#/components/schemas/_common.aggregations___TermsExclude' + execution_hint: + $ref: '#/components/schemas/_common.aggregations___TermsAggregationExecutionHint' + field: + $ref: '#/components/schemas/_common___Field' + gnd: + $ref: '#/components/schemas/_common.aggregations___GoogleNormalizedDistanceHeuristic' + include: + $ref: '#/components/schemas/_common.aggregations___TermsInclude' + jlh: + $ref: '#/components/schemas/_common___EmptyObject' + min_doc_count: + description: Only return terms that are found in more than `min_doc_count` hits. + type: integer + format: int64 + mutual_information: + $ref: '#/components/schemas/_common.aggregations___MutualInformationHeuristic' + percentage: + $ref: '#/components/schemas/_common.aggregations___PercentageScoreHeuristic' + script_heuristic: + $ref: '#/components/schemas/_common.aggregations___ScriptedHeuristic' + shard_min_doc_count: + description: |- + Regulates the certainty a shard has if the term should actually be added to the candidate list or not with respect to the `min_doc_count`. + Terms will only be considered if their local shard frequency within the set is higher than the `shard_min_doc_count`. + type: integer + format: int64 + shard_size: + description: |- + Can be used to control the volumes of candidate terms produced by each shard. + By default, `shard_size` will be automatically estimated based on the number of shards and the `size` parameter. + type: integer + format: int32 + size: + description: The number of buckets returned out of the overall terms list. + type: integer + format: int32 _common.aggregations___SignificantTermsBucketBase: allOf: - $ref: '#/components/schemas/_common.aggregations___MultiBucketBase' @@ -44234,53 +44521,60 @@ components: - $ref: '#/components/schemas/_common.aggregations___BucketAggregationBase' - type: object properties: - background_filter: - $ref: '#/components/schemas/_common.query_dsl___QueryContainer' - chi_square: - $ref: '#/components/schemas/_common.aggregations___ChiSquareHeuristic' - exclude: - $ref: '#/components/schemas/_common.aggregations___TermsExclude' - execution_hint: - $ref: '#/components/schemas/_common.aggregations___TermsAggregationExecutionHint' - field: - $ref: '#/components/schemas/_common___Field' - filter_duplicate_text: - description: Whether to out duplicate text to deal with noisy data. - type: boolean - gnd: - $ref: '#/components/schemas/_common.aggregations___GoogleNormalizedDistanceHeuristic' - include: - $ref: '#/components/schemas/_common.aggregations___TermsInclude' - jlh: - $ref: '#/components/schemas/_common___EmptyObject' - min_doc_count: - description: Only return values that are found in more than `min_doc_count` hits. - type: integer - format: int64 - mutual_information: - $ref: '#/components/schemas/_common.aggregations___MutualInformationHeuristic' - percentage: - $ref: '#/components/schemas/_common.aggregations___PercentageScoreHeuristic' - script_heuristic: - $ref: '#/components/schemas/_common.aggregations___ScriptedHeuristic' - shard_min_doc_count: - description: |- - Regulates the certainty a shard has if the values should actually be added to the candidate list or not with respect to the `min_doc_count`. - Values will only be considered if their local shard frequency within the set is higher than the `shard_min_doc_count`. - type: integer - format: int64 - shard_size: - description: |- - The number of candidate terms produced by each shard. - By default, `shard_size` will be automatically estimated based on the number of shards and the `size` parameter. - type: integer - format: int32 - size: - description: The number of buckets returned out of the overall terms list. - type: integer - format: int32 - source_fields: - $ref: '#/components/schemas/_common___Fields' + significant_text: + $ref: '#/components/schemas/_common.aggregations___SignificantTextAggregationFields' + required: + - significant_text + _common.aggregations___SignificantTextAggregationFields: + type: object + properties: + background_filter: + $ref: '#/components/schemas/_common.query_dsl___QueryContainer' + chi_square: + $ref: '#/components/schemas/_common.aggregations___ChiSquareHeuristic' + exclude: + $ref: '#/components/schemas/_common.aggregations___TermsExclude' + execution_hint: + $ref: '#/components/schemas/_common.aggregations___TermsAggregationExecutionHint' + field: + $ref: '#/components/schemas/_common___Field' + filter_duplicate_text: + description: Whether to out duplicate text to deal with noisy data. + type: boolean + gnd: + $ref: '#/components/schemas/_common.aggregations___GoogleNormalizedDistanceHeuristic' + include: + $ref: '#/components/schemas/_common.aggregations___TermsInclude' + jlh: + $ref: '#/components/schemas/_common___EmptyObject' + min_doc_count: + description: Only return values that are found in more than `min_doc_count` hits. + type: integer + format: int64 + mutual_information: + $ref: '#/components/schemas/_common.aggregations___MutualInformationHeuristic' + percentage: + $ref: '#/components/schemas/_common.aggregations___PercentageScoreHeuristic' + script_heuristic: + $ref: '#/components/schemas/_common.aggregations___ScriptedHeuristic' + shard_min_doc_count: + description: |- + Regulates the certainty a shard has if the values should actually be added to the candidate list or not with respect to the `min_doc_count`. + Values will only be considered if their local shard frequency within the set is higher than the `shard_min_doc_count`. + type: integer + format: int64 + shard_size: + description: |- + The number of candidate terms produced by each shard. + By default, `shard_size` will be automatically estimated based on the number of shards and the `size` parameter. + type: integer + format: int32 + size: + description: The number of buckets returned out of the overall terms list. + type: integer + format: int32 + source_fields: + $ref: '#/components/schemas/_common___Fields' _common.aggregations___SimpleMovingAverageAggregation: allOf: - $ref: '#/components/schemas/_common.aggregations___MovingAverageAggregationBase' @@ -44298,8 +44592,8 @@ components: _common.aggregations___SimpleValueAggregate: allOf: - $ref: '#/components/schemas/_common.aggregations___SingleMetricAggregateBase' - - type: object _common.aggregations___SingleBucketAggregateBase: + type: object allOf: - $ref: '#/components/schemas/_common.aggregations___AggregateBase' - type: object @@ -44309,9 +44603,9 @@ components: format: int64 required: - doc_count - additionalProperties: - title: aggregations - $ref: '#/components/schemas/_common.aggregations___Aggregate' + unevaluatedProperties: + title: aggregations + $ref: '#/components/schemas/_common.aggregations___Aggregate' _common.aggregations___SingleMetricAggregateBase: allOf: - $ref: '#/components/schemas/_common.aggregations___AggregateBase' @@ -44443,7 +44737,6 @@ components: _common.aggregations___StatsBucketAggregate: allOf: - $ref: '#/components/schemas/_common.aggregations___StatsAggregateBase' - - type: object _common.aggregations___StatsBucketAggregation: allOf: - $ref: '#/components/schemas/_common.aggregations___PipelineAggregationBase' @@ -44479,7 +44772,6 @@ components: _common.aggregations___SumAggregate: allOf: - $ref: '#/components/schemas/_common.aggregations___SingleMetricAggregateBase' - - type: object _common.aggregations___SumAggregation: allOf: - $ref: '#/components/schemas/_common.aggregations___FormatMetricAggregationBase' @@ -44502,11 +44794,9 @@ components: _common.aggregations___TDigestPercentileRanksAggregate: allOf: - $ref: '#/components/schemas/_common.aggregations___PercentilesAggregateBase' - - type: object _common.aggregations___TDigestPercentilesAggregate: allOf: - $ref: '#/components/schemas/_common.aggregations___PercentilesAggregateBase' - - type: object _common.aggregations___TermsAggregateBase: allOf: - $ref: '#/components/schemas/_common.aggregations___MultiBucketAggregateBase' @@ -44524,30 +44814,22 @@ components: - type: object properties: buckets: - allOf: - - $ref: '#/components/schemas/_common.aggregations___Buckets' - - oneOf: - - type: object - additionalProperties: - $ref: '#/components/schemas/_common.aggregations___DoubleTermsBucket' - - type: array - items: - $ref: '#/components/schemas/_common.aggregations___DoubleTermsBucket' + type: array + items: + $ref: '#/components/schemas/_common.aggregations___DoubleTermsBucket' + required: + - buckets _common.aggregations___TermsAggregateBaseLongTermsBucket: allOf: - $ref: '#/components/schemas/_common.aggregations___TermsAggregateBase' - type: object properties: buckets: - allOf: - - $ref: '#/components/schemas/_common.aggregations___Buckets' - - oneOf: - - type: object - additionalProperties: - $ref: '#/components/schemas/_common.aggregations___LongTermsBucket' - - type: array - items: - $ref: '#/components/schemas/_common.aggregations___LongTermsBucket' + type: array + items: + $ref: '#/components/schemas/_common.aggregations___LongTermsBucket' + required: + - buckets _common.aggregations___TermsAggregateBaseMultiTermsBucket: allOf: - $ref: '#/components/schemas/_common.aggregations___TermsAggregateBase' @@ -44569,33 +44851,56 @@ components: - type: object properties: buckets: - allOf: - - $ref: '#/components/schemas/_common.aggregations___Buckets' - - oneOf: - - type: object - additionalProperties: - $ref: '#/components/schemas/_common.aggregations___StringTermsBucket' - - type: array - items: - $ref: '#/components/schemas/_common.aggregations___StringTermsBucket' + type: array + items: + $ref: '#/components/schemas/_common.aggregations___StringTermsBucket' + required: + - buckets + _common.aggregations___TermsAggregateBaseUnsignedLongTermsBucket: + allOf: + - $ref: '#/components/schemas/_common.aggregations___TermsAggregateBase' + - type: object + properties: + buckets: + type: array + items: + $ref: '#/components/schemas/_common.aggregations___UnsignedLongTermsBucket' + required: + - buckets _common.aggregations___TermsAggregateBaseVoid: allOf: - $ref: '#/components/schemas/_common.aggregations___TermsAggregateBase' - type: object properties: buckets: - allOf: - - $ref: '#/components/schemas/_common.aggregations___Buckets' - - oneOf: - - type: object - additionalProperties: - $ref: '#/components/schemas/_common___Void' - - type: array - items: - $ref: '#/components/schemas/_common___Void' + type: array + items: + $ref: '#/components/schemas/_common___Void' + required: + - buckets _common.aggregations___TermsAggregation: allOf: - $ref: '#/components/schemas/_common.aggregations___BucketAggregationBase' + - type: object + properties: + terms: + $ref: '#/components/schemas/_common.aggregations___TermsAggregationFields' + required: + - terms + _common.aggregations___TermsAggregationCollectMode: + type: string + enum: + - breadth_first + - depth_first + _common.aggregations___TermsAggregationExecutionHint: + type: string + enum: + - global_ordinals + - global_ordinals_hash + - global_ordinals_low_cardinality + - map + _common.aggregations___TermsAggregationFields: + allOf: - type: object properties: collect_mode: @@ -44645,24 +44950,12 @@ components: properties: script: $ref: '#/components/schemas/_common___Script' - _common.aggregations___TermsAggregationCollectMode: - type: string - enum: - - breadth_first - - depth_first - _common.aggregations___TermsAggregationExecutionHint: - type: string - enum: - - global_ordinals - - global_ordinals_hash - - global_ordinals_low_cardinality - - map _common.aggregations___TermsBucketBase: allOf: - $ref: '#/components/schemas/_common.aggregations___MultiBucketBase' - type: object properties: - doc_count_error: + doc_count_error_upper_bound: type: integer format: int64 description: Upper bound of the document count error. Only present when `show_term_doc_count_error` is true. @@ -44773,16 +45066,14 @@ components: required: - value _common.aggregations___TTestAggregation: - allOf: - - $ref: '#/components/schemas/_common.aggregations___Aggregation' - - type: object - properties: - a: - $ref: '#/components/schemas/_common.aggregations___TestPopulation' - b: - $ref: '#/components/schemas/_common.aggregations___TestPopulation' - type: - $ref: '#/components/schemas/_common.aggregations___TTestType' + type: object + properties: + a: + $ref: '#/components/schemas/_common.aggregations___TestPopulation' + b: + $ref: '#/components/schemas/_common.aggregations___TestPopulation' + type: + $ref: '#/components/schemas/_common.aggregations___TTestType' _common.aggregations___TTestType: type: string enum: @@ -44797,16 +45088,49 @@ components: _common.aggregations___UnmappedSignificantTermsAggregate: allOf: - $ref: '#/components/schemas/_common.aggregations___SignificantTermsAggregateBaseVoid' - - type: object _common.aggregations___UnmappedTermsAggregate: description: Result of a `terms` aggregation when the field is unmapped. `buckets` is always empty. allOf: - $ref: '#/components/schemas/_common.aggregations___TermsAggregateBaseVoid' - type: object + _common.aggregations___UnsignedLongTermsAggregate: + description: |- + Result of a `terms` aggregation when the field is an `unsigned_long` (64-bit unsigned integer). + OpenSearch stores `unsigned_long` values as Long or BigInteger internally. In JSON responses, + bucket keys are represented as numbers, which may lose precision for values larger than 2^53--1 + due to IEEE 754 double precision limitations. In protocol buffer representations, keys are + manually defined as uint64 to preserve the full 64-bit unsigned range. Use `key_as_string` in + buckets for exact string representation of large unsigned long values. + allOf: + - $ref: '#/components/schemas/_common.aggregations___TermsAggregateBaseUnsignedLongTermsBucket' + - type: object + _common.aggregations___UnsignedLongTermsBucket: + description: |- + Terms bucket for `unsigned_long` field type. The server returns 64-bit unsigned integer values + as Long or BigInteger types. Due to JSON specification limitations (IEEE 754 double precision + provides only 53 bits of integer precision), the key is represented as `type: number` in the + OpenAPI spec. For protocol buffer definitions, this is manually overridden to `uint64` to + preserve the full 64-bit unsigned integer range in binary encoding. + allOf: + - $ref: '#/components/schemas/_common.aggregations___TermsBucketBase' + - type: object + properties: + key: + type: number + description: | + The unsigned 64-bit integer bucket key. While JSON represents this as a number, + values larger than 2^53--1 may lose precision in JSON serialization. The gRPC + protocol buffer definition uses uint64 to preserve full precision. Use `key_as_string` + for exact string representation of large values. + x-protobuf-data-type: uint64 + key_as_string: + type: string + description: String representation of the key. Only present when a custom `format` parameter is specified in the aggregation request. + required: + - key _common.aggregations___ValueCountAggregate: allOf: - $ref: '#/components/schemas/_common.aggregations___SingleMetricAggregateBase' - - type: object _common.aggregations___ValueCountAggregation: allOf: - $ref: '#/components/schemas/_common.aggregations___FormattableMetricAggregation' @@ -44822,20 +45146,17 @@ components: - date - double - float - - geo_point - integer - ip - long - number - numeric - - range - short - string - unsigned_long _common.aggregations___VariableWidthHistogramAggregate: allOf: - $ref: '#/components/schemas/_common.aggregations___MultiBucketAggregateBaseVariableWidthHistogramBucket' - - type: object _common.aggregations___VariableWidthHistogramAggregation: type: object properties: @@ -44882,19 +45203,17 @@ components: - max - min _common.aggregations___WeightedAverageAggregation: - allOf: - - $ref: '#/components/schemas/_common.aggregations___Aggregation' - - type: object - properties: - format: - description: A numeric response formatter. - type: string - value: - $ref: '#/components/schemas/_common.aggregations___WeightedAverageValue' - value_type: - $ref: '#/components/schemas/_common.aggregations___ValueType' - weight: - $ref: '#/components/schemas/_common.aggregations___WeightedAverageValue' + type: object + properties: + format: + description: A numeric response formatter. + type: string + value: + $ref: '#/components/schemas/_common.aggregations___WeightedAverageValue' + value_type: + $ref: '#/components/schemas/_common.aggregations___ValueType' + weight: + $ref: '#/components/schemas/_common.aggregations___WeightedAverageValue' _common.aggregations___WeightedAverageValue: type: object properties: @@ -44909,7 +45228,6 @@ components: _common.aggregations___WeightedAvgAggregate: allOf: - $ref: '#/components/schemas/_common.aggregations___SingleMetricAggregateBase' - - type: object _common.analysis___Analyzer: type: object discriminator: @@ -49289,6 +49607,31 @@ components: format: float filter: $ref: '#/components/schemas/_common.query_dsl___QueryContainer' + _common.query_dsl___NeuralSparseQuery: + allOf: + - $ref: '#/components/schemas/_common.query_dsl___QueryBase' + - type: object + properties: + query_text: + description: The query text to be encoded into sparse tokens by the model. + type: string + model_id: + description: The ID of the sparse encoding model or tokenizer model at the ML node. + type: string + query_tokens: + description: Pre-computed sparse tokens and their weights. Use instead of query_text+model_id when tokens are already available. + type: object + additionalProperties: + type: number + format: float + max_token_score: + description: The maximum score threshold for sparse tokens. Deprecated since OpenSearch 2.12. + type: number + format: float + deprecated: true + analyzer: + description: The analyzer to use for tokenization instead of an ML model. + type: string _common.query_dsl___NumberRangeQuery: allOf: - $ref: '#/components/schemas/_common.query_dsl___RangeQueryBase' @@ -49560,6 +49903,14 @@ components: $ref: '#/components/schemas/_common.query_dsl___NeuralQuery' minProperties: 1 maxProperties: 1 + neural_sparse: + type: object + propertyNames: + $ref: '#/components/schemas/_common___Field' + additionalProperties: + $ref: '#/components/schemas/_common.query_dsl___NeuralSparseQuery' + minProperties: 1 + maxProperties: 1 parent_id: $ref: '#/components/schemas/_common.query_dsl___ParentIdQuery' percolate: @@ -49601,6 +49952,8 @@ components: $ref: '#/components/schemas/_common.query_dsl___ScriptScoreQuery' simple_query_string: $ref: '#/components/schemas/_common.query_dsl___SimpleQueryStringQuery' + sltr: + $ref: '#/components/schemas/_common.query_dsl___StoredLtrQuery' span_containing: $ref: '#/components/schemas/_common.query_dsl___SpanContainingQuery' field_masking_span: @@ -50158,6 +50511,31 @@ components: required: - big - little + _common.query_dsl___StoredLtrQuery: + type: object + properties: + _name: + type: string + active_features: + type: array + items: + type: string + boost: + type: number + format: float + cache: + type: boolean + featureset: + type: string + model: + type: string + params: + type: object + additionalProperties: true + store: + type: string + required: + - params _common.query_dsl___TermQuery: oneOf: - title: value @@ -50186,12 +50564,29 @@ components: $ref: '#/components/schemas/_common___Field' routing: $ref: '#/components/schemas/_common___Routing' + query: + $ref: '#/components/schemas/_common.query_dsl___QueryContainer' + x-version-added: 3.2.0 store: type: boolean required: - - id - index - path + allOf: + - oneOf: + - type: object + properties: + id: + $ref: '#/components/schemas/_common___Id' + required: + - id + - type: object + properties: + query: + $ref: '#/components/schemas/_common.query_dsl___QueryContainer' + required: + - query + x-version-added: 3.2.0 _common.query_dsl___TermsQuery: type: object properties: @@ -50960,10 +51355,13 @@ components: _core.pit___DeletedPit: type: object properties: - successful: - type: boolean pit_id: type: string + successful: + type: boolean + required: + - pit_id + - successful _core.pit___PitDetail: type: object properties: @@ -52018,6 +52416,7 @@ components: format: float required: - hits + - max_score _core.search___HitsMetadataJsonValue: allOf: - $ref: '#/components/schemas/_core.search___HitsMetadata' @@ -53062,6 +53461,18 @@ components: type: object additionalProperties: $ref: '#/components/schemas/asynchronous_search._common___NodesStats' + cat._common___ResponseFormat: + type: string + description: |- + The response format returned by `_cat` operations. Equivalent to the HTTP `Accept` header but expressed as a query parameter. + When the parameter is omitted the server responds with `text`. + default: text + enum: + - cbor + - json + - smile + - text + - yaml cat.aliases___AliasesRecord: type: object properties: @@ -57347,7 +57758,7 @@ components: - $ref: '#/components/schemas/geospatial._common___Envelope' description: |- GeoJSON `geoshape` types supported by OpenSearch. - For more details, see: https://docs.opensearch.org/docs/latest/field-types/supported-field-types/geo-shape. + For more information, see [Geoshape field type](https://docs.opensearch.org/latest/mappings/supported-field-types/geo-shape/). geospatial._common___GeospatialFieldType: type: string enum: @@ -58775,6 +59186,20 @@ components: all_active: description: Indicates if all-active ingestion is enabled for this index. $ref: '#/components/schemas/_common___StringifiedBoolean' + mapper_type: + description: The type of message mapper used to extract document fields from ingestion messages. + $ref: '#/components/schemas/indices._common___IngestionSourceMapperType' + mapper_settings: + type: object + description: Configuration settings for the selected mapper type. + additionalProperties: true + indices._common___IngestionSourceMapperType: + type: string + description: The type of message mapper used to extract document fields from ingestion messages. + enum: + - default + - field_mapping + - raw_payload indices._common___IngestionSourcePointer: type: object properties: @@ -60280,6 +60705,13 @@ components: $ref: '#/components/schemas/_common___Field' required: - field + ingest._common___ChunkingAlgorithm: + type: object + properties: + fixed_token_length: + $ref: '#/components/schemas/ingest._common___FixedTokenLengthChunkingAlgorithm' + delimiter: + $ref: '#/components/schemas/ingest._common___DelimiterChunkingAlgorithm' ingest._common___CircleProcessor: allOf: - $ref: '#/components/schemas/ingest._common___ProcessorBase' @@ -60428,6 +60860,15 @@ components: required: - field - formats + ingest._common___DelimiterChunkingAlgorithm: + type: object + properties: + delimiter: + description: The string delimiter to split on. + type: string + max_chunk_limit: + type: integer + format: int32 ingest._common___DissectProcessor: allOf: - $ref: '#/components/schemas/ingest._common___ProcessorBase' @@ -60477,6 +60918,23 @@ components: type: string required: - message + ingest._common___FixedTokenLengthChunkingAlgorithm: + type: object + properties: + token_limit: + description: Maximum number of tokens per chunk. + type: integer + format: int32 + overlap_rate: + description: Fraction of tokens to overlap between consecutive chunks. Value between 0 and 0.5. + type: number + format: double + tokenizer: + description: The tokenizer to use, for example "standard". + type: string + max_chunk_limit: + type: integer + format: int32 ingest._common___ForeachProcessor: allOf: - $ref: '#/components/schemas/ingest._common___ProcessorBase' @@ -60799,6 +61257,12 @@ components: $ref: '#/components/schemas/ingest._common___CircleProcessor' text_embedding: $ref: '#/components/schemas/ingest._common___TextEmbeddingProcessor' + sparse_encoding: + $ref: '#/components/schemas/ingest._common___SparseEncodingProcessor' + text_image_embedding: + $ref: '#/components/schemas/ingest._common___TextImageEmbeddingProcessor' + text_chunking: + $ref: '#/components/schemas/ingest._common___TextChunkingProcessor' minProperties: 1 maxProperties: 1 ingest._common___RemoveProcessor: @@ -60890,6 +61354,24 @@ components: $ref: '#/components/schemas/_common___Field' required: - field + ingest._common___SparseEncodingProcessor: + allOf: + - $ref: '#/components/schemas/ingest._common___ProcessorBase' + - type: object + properties: + model_id: + $ref: '#/components/schemas/_common___Id' + field_map: + description: Contains key-value pairs that specify the mapping of a text field to a sparse vector field. + type: object + additionalProperties: + type: string + batch_size: + type: integer + format: int32 + required: + - field_map + - model_id ingest._common___SplitProcessor: allOf: - $ref: '#/components/schemas/ingest._common___ProcessorBase' @@ -60911,6 +61393,25 @@ components: required: - field - separator + ingest._common___TextChunkingProcessor: + allOf: + - $ref: '#/components/schemas/ingest._common___ProcessorBase' + - type: object + properties: + algorithm: + $ref: '#/components/schemas/ingest._common___ChunkingAlgorithm' + field_map: + description: Contains key-value pairs that specify the mapping of a source text field to a target chunked field. + type: object + additionalProperties: + type: string + max_chunk_limit: + description: Maximum number of chunks a document field can be split into. Defaults to 100. + type: integer + format: int32 + required: + - algorithm + - field_map ingest._common___TextEmbeddingProcessor: allOf: - $ref: '#/components/schemas/ingest._common___ProcessorBase' @@ -60929,6 +61430,21 @@ components: required: - field_map - model_id + ingest._common___TextImageEmbeddingProcessor: + allOf: + - $ref: '#/components/schemas/ingest._common___ProcessorBase' + - type: object + properties: + model_id: + $ref: '#/components/schemas/_common___Id' + field_map: + description: Contains key-value pairs that specify the mapping of text/image fields to a vector field. + type: object + additionalProperties: + type: string + required: + - field_map + - model_id ingest._common___TrimProcessor: allOf: - $ref: '#/components/schemas/ingest._common___ProcessorBase' @@ -61107,9 +61623,12 @@ components: type: boolean description: Indicates if the pause request has been acknowledged by individual shards. failures: - type: array - items: - $ref: '#/components/schemas/ingestion._common___IngestionStateShardFailure' + type: object + description: Shard-level failures grouped by index name. + additionalProperties: + type: array + items: + $ref: '#/components/schemas/ingestion._common___IngestionStateShardFailure' error: type: string required: @@ -61162,9 +61681,12 @@ components: type: boolean description: Indicates if the resume request has been acknowledged by individual shards. failures: - type: array - items: - $ref: '#/components/schemas/ingestion._common___IngestionStateShardFailure' + type: object + description: Shard-level failures grouped by index name. + additionalProperties: + type: array + items: + $ref: '#/components/schemas/ingestion._common___IngestionStateShardFailure' error: type: string required: @@ -62245,6 +62767,18 @@ components: - dimension - training_field - training_index + list._common___ResponseFormat: + type: string + description: |- + The response format returned by `_list` operations. Equivalent to the HTTP `Accept` header but expressed as a query parameter. + When the parameter is omitted the server responds with `text`. + default: text + enum: + - cbor + - json + - smile + - text + - yaml ltr._common___AcknowledgedResponse: type: object properties: @@ -62301,22 +62835,22 @@ components: model: $ref: '#/components/schemas/ltr._common___CacheStat' ltr._common___CacheStatsResponse: - type: object - properties: - _nodes: - $ref: '#/components/schemas/_common___NodeStatistics' - cluster_name: - $ref: '#/components/schemas/_common___Name' - all: - $ref: '#/components/schemas/ltr._common___CacheAllStats' - stores: - type: object - description: Cache statistics by store. - nodes: - type: object - description: Cache statistics per node. - additionalProperties: - $ref: '#/components/schemas/ltr._common___NodeDetails' + allOf: + - $ref: '#/components/schemas/nodes._common___NodesResponseBase' + - type: object + properties: + cluster_name: + $ref: '#/components/schemas/_common___Name' + all: + $ref: '#/components/schemas/ltr._common___CacheAllStats' + stores: + type: object + description: Cache statistics by store. + nodes: + type: object + description: Cache statistics per node. + additionalProperties: + $ref: '#/components/schemas/ltr._common___NodeDetails' ltr._common___ListStoresResponse: type: object properties: @@ -63550,6 +64084,15 @@ components: enum: - conversational - data + ml._common___PredictionActionType: + type: string + description: The action type for model prediction. + enum: + - batch_predict + - batch_predict_status + - cancel_batch_predict + - execute + - predict ml._common___PredictionResult: type: object properties: @@ -63740,8 +64283,6 @@ components: description: The score. _source: $ref: '#/components/schemas/ml._common___Source' - model_id: - $ref: '#/components/schemas/_common___Name' sort: type: array items: @@ -67734,6 +68275,23 @@ components: - w - x - 'y' + ppl._common___ResponseFormat: + type: string + description: |- + The response format selector for PPL plugin operations. The valid set is the union of values accepted across `_plugins/_ppl/*` endpoints; + defaults and per-endpoint subsets mirror the SQL plugin. + default: jdbc + enum: + - cost + - csv + - extended + - jdbc + - json + - raw + - simple + - standard + - viz + - yaml query._common___Credentials: type: object properties: @@ -68980,6 +69538,9 @@ components: type: string index: type: string + description: + type: string + x-version-added: '3.5' query: type: string searchPipeline: @@ -69005,6 +69566,23 @@ components: type: string maxRank: type: integer + search_relevance._common___SearchRequest: + type: object + description: A search request body delegated to SearchSourceBuilder. + properties: + query: + $ref: '#/components/schemas/_common.query_dsl___QueryContainer' + size: + type: integer + format: int32 + description: The maximum number of results to return. + from: + type: integer + format: int32 + description: The starting offset for the results. + sort: + $ref: '#/components/schemas/_common___Sort' + description: The sort order. security_analytics.alerts___ActionExecutionResult: type: object properties: @@ -70752,6 +71330,24 @@ components: status: type: integer description: The status code of the response. + sql._common___ResponseFormat: + type: string + description: |- + The response format selector for SQL plugin operations. The valid set is the union of values accepted across `_plugins/_sql/*` endpoints: + query responses use `jdbc` (default), `csv`, `raw`, or `viz`; explain responses use `json`, `yaml`, `simple`, `standard`, `extended`, or `cost`. + Not every endpoint accepts every value. + default: jdbc + enum: + - cost + - csv + - extended + - jdbc + - json + - raw + - simple + - standard + - viz + - yaml sql._common___Sql: type: object properties: diff --git a/java-codegen/src/main/java/org/opensearch/client/codegen/openapi/rewriter/SpecificationRewriter.java b/java-codegen/src/main/java/org/opensearch/client/codegen/openapi/rewriter/SpecificationRewriter.java index 0369bdb9b8..d47e50bfd6 100644 --- a/java-codegen/src/main/java/org/opensearch/client/codegen/openapi/rewriter/SpecificationRewriter.java +++ b/java-codegen/src/main/java/org/opensearch/client/codegen/openapi/rewriter/SpecificationRewriter.java @@ -44,18 +44,17 @@ public static OpenApiSpecification rewrite(@Nonnull OpenApiSpecification specifi } private static void patchSpecification(OpenApiSpecification specification) { + OpenApiSchema additionalProperties = OpenApiSchema.builder() + .withDescription("Nested aggregations.") + .withTitle("aggregations") + .with$ref(RelativeRef.parse("#/components/schemas/_common.aggregations___Aggregate")) + .build(); + // TODO: Workaround difficulty in representing the MultiBucketBase nested aggregations in the upstream OpenAPI specification - specification.getComponents() - .flatMap(OpenApiComponents::getSchemas) - .flatMap(s -> Maps.tryGet(s, "_common.aggregations___MultiBucketBase")) - .ifPresent( - s -> s.setAdditionalProperties( - OpenApiSchema.builder() - .withDescription("Nested aggregations.") - .withTitle("aggregations") - .with$ref(RelativeRef.parse("#/components/schemas/_common.aggregations___Aggregate")) - .build() - ) - ); + specification.getComponents().flatMap(OpenApiComponents::getSchemas).ifPresent(schemas -> { + Maps.tryGet(schemas, "_common.aggregations___MultiBucketBase").ifPresent(s -> s.setAdditionalProperties(additionalProperties)); + Maps.tryGet(schemas, "_common.aggregations___SingleBucketAggregateBase") + .ifPresent(s -> s.setAdditionalProperties(additionalProperties)); + }); } } diff --git a/java-codegen/src/main/java/org/opensearch/client/codegen/transformer/TypeMapper.java b/java-codegen/src/main/java/org/opensearch/client/codegen/transformer/TypeMapper.java index eb6742b373..6443bd4078 100644 --- a/java-codegen/src/main/java/org/opensearch/client/codegen/transformer/TypeMapper.java +++ b/java-codegen/src/main/java/org/opensearch/client/codegen/transformer/TypeMapper.java @@ -227,6 +227,31 @@ private TypeRef mapAllOf(List allOf) { return mapType(allOf.get(0)); } + if (allOf.size() > 1) { + OpenApiSchema primary = null; + for (final OpenApiSchema schema : allOf) { + if (schema.hasAllOf() || schema.hasOneOf()) { + primary = schema; + break; + } + } + + if (primary == null) { + for (final OpenApiSchema schema : allOf) { + if (schema.has$ref()) { + primary = schema; + break; + } + } + } + + if (primary != null) { + primary = allOf.get(allOf.size() - 1); + } + + return mapType(primary); + } + throw new UnsupportedOperationException("Can not get type name for allOf: " + allOf); } diff --git a/samples/src/main/java/org/opensearch/client/samples/Search.java b/samples/src/main/java/org/opensearch/client/samples/Search.java index 6c83a7a6a4..ad6bbe3c5d 100644 --- a/samples/src/main/java/org/opensearch/client/samples/Search.java +++ b/samples/src/main/java/org/opensearch/client/samples/Search.java @@ -20,8 +20,9 @@ import org.opensearch.client.opensearch._types.SortOrder; import org.opensearch.client.opensearch._types.aggregations.Aggregate; import org.opensearch.client.opensearch._types.aggregations.Aggregation; -import org.opensearch.client.opensearch._types.aggregations.CompositeAggregation; +import org.opensearch.client.opensearch._types.aggregations.CompositeAggregationFields; import org.opensearch.client.opensearch._types.aggregations.CompositeAggregationSource; +import org.opensearch.client.opensearch._types.aggregations.StringRareTermsBucket; import org.opensearch.client.opensearch._types.analysis.Analyzer; import org.opensearch.client.opensearch._types.analysis.CustomAnalyzer; import org.opensearch.client.opensearch._types.analysis.ShingleTokenFilter; @@ -107,7 +108,13 @@ public static void main(String[] args) { searchResponse = client.search(searchRequest, IndexData.class); for (Map.Entry entry : searchResponse.aggregations().entrySet()) { LOGGER.info("Agg - {}", entry.getKey()); - entry.getValue().sterms().buckets().array().forEach(b -> LOGGER.info("{} : {}", b.key(), b.docCount())); + entry.getValue() + .sterms() + .buckets() + .array() + .stream() + .map(b -> b.to(StringRareTermsBucket.class)) + .forEach(b -> LOGGER.info("{} : {}", b.key(), b.docCount())); } // Custom Aggregations @@ -117,7 +124,7 @@ public static void main(String[] args) { ).build(); comAggrSrcMap.put("titles", compositeAggregationSource1); - CompositeAggregation compAgg = new CompositeAggregation.Builder().sources(comAggrSrcMap).build(); + CompositeAggregationFields compAgg = new CompositeAggregationFields.Builder().sources(comAggrSrcMap).build(); Aggregation aggregation = new Aggregation.Builder().composite(compAgg).build(); SearchRequest request = SearchRequest.of(