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 d91eaa183..8fce3ddf3 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 @@ -36,11 +36,15 @@ 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.CopyableBuilder; @@ -56,10 +60,14 @@ public class MaxAggregation extends FormatMetricAggregationBase AggregationVariant, ToCopyableBuilder { + @Nullable + private final ValueType valueType; + // --------------------------------------------------------------------------------------------- private MaxAggregation(Builder builder) { super(builder); + this.valueType = builder.valueType; } public static MaxAggregation of(Function> fn) { @@ -74,6 +82,22 @@ public Aggregation.Kind _aggregationKind() { return Aggregation.Kind.Max; } + /** + * API name: {@code value_type} + */ + @Nullable + public final ValueType valueType() { + return this.valueType; + } + + protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { + super.serializeInternal(generator, mapper); + if (this.valueType != null) { + generator.writeKey("value_type"); + this.valueType.serialize(generator, mapper); + } + } + // --------------------------------------------------------------------------------------------- @Override @@ -93,15 +117,19 @@ public static Builder builder() { public static class Builder extends FormatMetricAggregationBase.AbstractBuilder implements CopyableBuilder { + @Nullable + private ValueType valueType; public Builder() {} private Builder(MaxAggregation o) { super(o); + this.valueType = o.valueType; } private Builder(Builder o) { super(o); + this.valueType = o.valueType; } @Override @@ -116,6 +144,15 @@ protected Builder self() { return this; } + /** + * API name: {@code value_type} + */ + @Nonnull + public final Builder valueType(@Nullable ValueType value) { + this.valueType = value; + return this; + } + /** * Builds a {@link MaxAggregation}. * @@ -142,11 +179,13 @@ public MaxAggregation build() { protected static void setupMaxAggregationDeserializer(ObjectDeserializer op) { setupFormatMetricAggregationBaseDeserializer(op); + op.add(Builder::valueType, ValueType._DESERIALIZER, "value_type"); } @Override public int hashCode() { int result = super.hashCode(); + result = 31 * result + Objects.hashCode(this.valueType); return result; } @@ -157,6 +196,7 @@ public boolean equals(Object o) { } if (this == o) return true; if (o == null || this.getClass() != o.getClass()) return false; - return true; + MaxAggregation other = (MaxAggregation) o; + return Objects.equals(this.valueType, other.valueType); } } 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 1a76910ec..8cc050a3c 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,38 +37,50 @@ 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; // typedef: _types.aggregations.MetricAggregationBase @Generated("org.opensearch.client.codegen.CodeGenerator") -public abstract class MetricAggregationBase extends AggregationBase { +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; // --------------------------------------------------------------------------------------------- protected MetricAggregationBase(AbstractBuilder builder) { - super(builder); this.field = builder.field; + this.meta = ApiTypeHelper.unmodifiable(builder.meta); this.missing = builder.missing; + this.name = builder.name; this.script = builder.script; } @@ -80,6 +92,14 @@ public final String field() { return this.field; } + /** + * API name: {@code meta} + */ + @Nonnull + public final Map meta() { + return this.meta; + } + /** * API name: {@code missing} */ @@ -88,6 +108,14 @@ public final FieldValue missing() { return this.missing; } + /** + * API name: {@code name} + */ + @Nullable + public final String name() { + return this.name; + } + /** * API name: {@code script} */ @@ -96,18 +124,42 @@ 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); } + 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); @@ -116,31 +168,39 @@ 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 String field; @Nullable + private Map meta; + @Nullable private FieldValue missing; @Nullable + private String name; + @Nullable private Script script; protected AbstractBuilder() {} protected AbstractBuilder(MetricAggregationBase o) { - super(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) { - super(o); this.field = o.field; + this.meta = _mapCopy(o.meta); this.missing = o.missing; + this.name = o.name; this.script = o.script; } + @Nonnull + protected abstract BuilderT self(); + /** * API name: {@code field} */ @@ -150,6 +210,32 @@ 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} */ @@ -167,6 +253,15 @@ public final BuilderT missing(Function> fn) protected static > void setupMetricAggregationBaseDeserializer( ObjectDeserializer op ) { - setupAggregationBaseDeserializer(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"); } @Override public int hashCode() { - int result = super.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; } @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; 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/MinAggregation.java b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/aggregations/MinAggregation.java index 9c3200da8..5d318d22e 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 @@ -36,11 +36,15 @@ 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.CopyableBuilder; @@ -56,10 +60,14 @@ public class MinAggregation extends FormatMetricAggregationBase AggregationVariant, ToCopyableBuilder { + @Nullable + private final ValueType valueType; + // --------------------------------------------------------------------------------------------- private MinAggregation(Builder builder) { super(builder); + this.valueType = builder.valueType; } public static MinAggregation of(Function> fn) { @@ -74,6 +82,22 @@ public Aggregation.Kind _aggregationKind() { return Aggregation.Kind.Min; } + /** + * API name: {@code value_type} + */ + @Nullable + public final ValueType valueType() { + return this.valueType; + } + + protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { + super.serializeInternal(generator, mapper); + if (this.valueType != null) { + generator.writeKey("value_type"); + this.valueType.serialize(generator, mapper); + } + } + // --------------------------------------------------------------------------------------------- @Override @@ -93,15 +117,19 @@ public static Builder builder() { public static class Builder extends FormatMetricAggregationBase.AbstractBuilder implements CopyableBuilder { + @Nullable + private ValueType valueType; public Builder() {} private Builder(MinAggregation o) { super(o); + this.valueType = o.valueType; } private Builder(Builder o) { super(o); + this.valueType = o.valueType; } @Override @@ -116,6 +144,15 @@ protected Builder self() { return this; } + /** + * API name: {@code value_type} + */ + @Nonnull + public final Builder valueType(@Nullable ValueType value) { + this.valueType = value; + return this; + } + /** * Builds a {@link MinAggregation}. * @@ -142,11 +179,13 @@ public MinAggregation build() { protected static void setupMinAggregationDeserializer(ObjectDeserializer op) { setupFormatMetricAggregationBaseDeserializer(op); + op.add(Builder::valueType, ValueType._DESERIALIZER, "value_type"); } @Override public int hashCode() { int result = super.hashCode(); + result = 31 * result + Objects.hashCode(this.valueType); return result; } @@ -157,6 +196,7 @@ public boolean equals(Object o) { } if (this == o) return true; if (o == null || this.getClass() != o.getClass()) return false; - return true; + MinAggregation other = (MinAggregation) o; + return Objects.equals(this.valueType, other.valueType); } } diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/aggregations/TermsAggregation.java b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/aggregations/TermsAggregation.java index bf86ef49b..22e3d5138 100644 --- a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/aggregations/TermsAggregation.java +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/aggregations/TermsAggregation.java @@ -44,28 +44,38 @@ 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.FieldValue; import org.opensearch.client.opensearch._types.Script; import org.opensearch.client.opensearch._types.SortOrder; 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.TermsAggregation @JsonpDeserializable @Generated("org.opensearch.client.codegen.CodeGenerator") -public class TermsAggregation extends BucketAggregationBase +public class TermsAggregation implements AggregationVariant, + PlainJsonSerializable, ToCopyableBuilder { + @Nonnull + private final Map aggregations; + + @Nonnull + private final Map aggs; + @Nullable private final TermsAggregationCollectMode collectMode; @@ -84,12 +94,18 @@ public class TermsAggregation extends BucketAggregationBase @Nullable private final TermsInclude include; + @Nonnull + private final Map meta; + @Nullable - private final Integer minDocCount; + private final Long minDocCount; @Nullable private final FieldValue missing; + @Nullable + private final String name; + @Nonnull private final List> order; @@ -97,7 +113,7 @@ public class TermsAggregation extends BucketAggregationBase private final Script script; @Nullable - private final Integer shardMinDocCount; + private final Long shardMinDocCount; @Nullable private final Integer shardSize; @@ -109,20 +125,23 @@ public class TermsAggregation extends BucketAggregationBase private final Integer size; @Nullable - private final String valueType; + private final ValueType valueType; // --------------------------------------------------------------------------------------------- private TermsAggregation(Builder builder) { - super(builder); + this.aggregations = ApiTypeHelper.unmodifiable(builder.aggregations); + this.aggs = ApiTypeHelper.unmodifiable(builder.aggs); 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; @@ -144,6 +163,28 @@ 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} */ @@ -192,6 +233,14 @@ 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. *

@@ -199,7 +248,7 @@ public final TermsInclude include() { *

*/ @Nullable - public final Integer minDocCount() { + public final Long minDocCount() { return this.minDocCount; } @@ -211,6 +260,14 @@ public final FieldValue missing() { return this.missing; } + /** + * API name: {@code name} + */ + @Nullable + public final String name() { + return this.name; + } + /** * API name: {@code order} */ @@ -234,7 +291,7 @@ public final Script script() { *

*/ @Nullable - public final Integer shardMinDocCount() { + public final Long shardMinDocCount() { return this.shardMinDocCount; } @@ -280,12 +337,41 @@ public final Integer size() { *

*/ @Nullable - public final String valueType() { + public final ValueType 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 (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); @@ -316,6 +402,16 @@ 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); @@ -326,6 +422,11 @@ 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(); @@ -369,7 +470,7 @@ protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { if (this.valueType != null) { generator.writeKey("value_type"); - generator.write(this.valueType); + this.valueType.serialize(generator, mapper); } } @@ -389,9 +490,11 @@ public static Builder builder() { /** * Builder for {@link TermsAggregation}. */ - public static class Builder extends BucketAggregationBase.AbstractBuilder - implements - CopyableBuilder { + public static class Builder extends ObjectBuilderBase implements CopyableBuilder { + @Nullable + private Map aggregations; + @Nullable + private Map aggs; @Nullable private TermsAggregationCollectMode collectMode; @Nullable @@ -405,15 +508,19 @@ public static class Builder extends BucketAggregationBase.AbstractBuilder meta; + @Nullable + private Long minDocCount; @Nullable private FieldValue missing; @Nullable + private String name; + @Nullable private List> order; @Nullable private Script script; @Nullable - private Integer shardMinDocCount; + private Long shardMinDocCount; @Nullable private Integer shardSize; @Nullable @@ -421,20 +528,23 @@ public static class Builder extends BucketAggregationBase.AbstractBuilder + * API name: {@code aggregations} + *

+ * + *

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

+ */ @Nonnull - protected Builder self() { + 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} */ @@ -545,6 +746,32 @@ 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. *

@@ -552,7 +779,7 @@ public final Builder include(Function */ @Nonnull - public final Builder minDocCount(@Nullable Integer value) { + public final Builder minDocCount(@Nullable Long value) { this.minDocCount = value; return this; } @@ -574,6 +801,15 @@ public final Builder missing(Function> fn) *

*/ @Nonnull - public final Builder shardMinDocCount(@Nullable Integer value) { + public final Builder shardMinDocCount(@Nullable Long value) { this.shardMinDocCount = value; return this; } @@ -674,7 +910,7 @@ public final Builder size(@Nullable Integer value) { *

*/ @Nonnull - public final Builder valueType(@Nullable String value) { + public final Builder valueType(@Nullable ValueType value) { this.valueType = value; return this; } @@ -704,39 +940,46 @@ public TermsAggregation build() { ); protected static void setupTermsAggregationDeserializer(ObjectDeserializer op) { - setupBucketAggregationBaseDeserializer(op); + op.add(Builder::aggregations, JsonpDeserializer.stringMapDeserializer(Aggregation._DESERIALIZER), "aggregations"); + op.add(Builder::aggs, JsonpDeserializer.stringMapDeserializer(Aggregation._DESERIALIZER), "aggs"); 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::minDocCount, JsonpDeserializer.integerDeserializer(), "min_doc_count"); + 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)), "order" ); op.add(Builder::script, Script._DESERIALIZER, "script"); - op.add(Builder::shardMinDocCount, JsonpDeserializer.integerDeserializer(), "shard_min_doc_count"); + op.add(Builder::shardMinDocCount, JsonpDeserializer.longDeserializer(), "shard_min_doc_count"); op.add(Builder::shardSize, JsonpDeserializer.integerDeserializer(), "shard_size"); op.add(Builder::showTermDocCountError, JsonpDeserializer.booleanDeserializer(), "show_term_doc_count_error"); op.add(Builder::size, JsonpDeserializer.integerDeserializer(), "size"); - op.add(Builder::valueType, JsonpDeserializer.stringDeserializer(), "value_type"); + op.add(Builder::valueType, ValueType._DESERIALIZER, "value_type"); } @Override public int hashCode() { - int result = super.hashCode(); + int result = 17; + result = 31 * result + Objects.hashCode(this.aggregations); + result = 31 * result + Objects.hashCode(this.aggs); result = 31 * result + Objects.hashCode(this.collectMode); result = 31 * result + Objects.hashCode(this.exclude); result = 31 * result + Objects.hashCode(this.executionHint); result = 31 * result + Objects.hashCode(this.field); result = 31 * result + Objects.hashCode(this.format); result = 31 * result + Objects.hashCode(this.include); + result = 31 * result + Objects.hashCode(this.meta); result = 31 * result + Objects.hashCode(this.minDocCount); result = 31 * result + Objects.hashCode(this.missing); + result = 31 * result + Objects.hashCode(this.name); result = 31 * result + Objects.hashCode(this.order); result = 31 * result + Objects.hashCode(this.script); result = 31 * result + Objects.hashCode(this.shardMinDocCount); @@ -749,20 +992,21 @@ 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; TermsAggregation other = (TermsAggregation) o; - return Objects.equals(this.collectMode, other.collectMode) + return Objects.equals(this.aggregations, other.aggregations) + && Objects.equals(this.aggs, other.aggs) + && Objects.equals(this.collectMode, other.collectMode) && Objects.equals(this.exclude, other.exclude) && Objects.equals(this.executionHint, other.executionHint) && Objects.equals(this.field, other.field) && Objects.equals(this.format, other.format) && Objects.equals(this.include, other.include) + && Objects.equals(this.meta, other.meta) && Objects.equals(this.minDocCount, other.minDocCount) && Objects.equals(this.missing, other.missing) + && Objects.equals(this.name, other.name) && Objects.equals(this.order, other.order) && Objects.equals(this.script, other.script) && Objects.equals(this.shardMinDocCount, other.shardMinDocCount) diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/aggregations/ValueType.java b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/aggregations/ValueType.java index 0098be922..a1e6781e3 100644 --- a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/aggregations/ValueType.java +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/aggregations/ValueType.java @@ -42,19 +42,27 @@ // typedef: _types.aggregations.ValueType +/** + * The data type for a field. The server's lenientParse accepts multiple representations for the same underlying type (for + * example, byte/short/integer/long all map to long). + */ @JsonpDeserializable @Generated("org.opensearch.client.codegen.CodeGenerator") public enum ValueType implements JsonEnum { Boolean("boolean"), - Date("date"), + Byte("byte"), - DateNanos("date_nanos"), + Date("date"), Double("double"), + Float("float"), + GeoPoint("geo_point"), + Integer("integer"), + Ip("ip"), Long("long"), @@ -63,7 +71,13 @@ public enum ValueType implements JsonEnum { Numeric("numeric"), - String("string"); + Range("range"), + + Short("short"), + + String("string"), + + UnsignedLong("unsigned_long"); private final String jsonValue; diff --git a/java-codegen/opensearch-openapi.yaml b/java-codegen/opensearch-openapi.yaml index db2b553d4..d691f2ed7 100644 --- a/java-codegen/opensearch-openapi.yaml +++ b/java-codegen/opensearch-openapi.yaml @@ -3944,6 +3944,7 @@ paths: externalDocs: url: https://opensearch.org/docs/latest/api-reference/multi-search/ parameters: + - $ref: '#/components/parameters/msearch___query.allow_partial_results' - $ref: '#/components/parameters/msearch___query.ccs_minimize_roundtrips' - $ref: '#/components/parameters/msearch___query.max_concurrent_searches' - $ref: '#/components/parameters/msearch___query.max_concurrent_shard_requests' @@ -3969,6 +3970,7 @@ paths: externalDocs: url: https://opensearch.org/docs/latest/api-reference/multi-search/ parameters: + - $ref: '#/components/parameters/msearch___query.allow_partial_results' - $ref: '#/components/parameters/msearch___query.ccs_minimize_roundtrips' - $ref: '#/components/parameters/msearch___query.max_concurrent_searches' - $ref: '#/components/parameters/msearch___query.max_concurrent_shard_requests' @@ -14240,6 +14242,7 @@ paths: url: https://opensearch.org/docs/latest/api-reference/multi-search/ parameters: - $ref: '#/components/parameters/msearch___path.index' + - $ref: '#/components/parameters/msearch___query.allow_partial_results' - $ref: '#/components/parameters/msearch___query.ccs_minimize_roundtrips' - $ref: '#/components/parameters/msearch___query.max_concurrent_searches' - $ref: '#/components/parameters/msearch___query.max_concurrent_shard_requests' @@ -14266,6 +14269,7 @@ paths: url: https://opensearch.org/docs/latest/api-reference/multi-search/ parameters: - $ref: '#/components/parameters/msearch___path.index' + - $ref: '#/components/parameters/msearch___query.allow_partial_results' - $ref: '#/components/parameters/msearch___query.ccs_minimize_roundtrips' - $ref: '#/components/parameters/msearch___query.max_concurrent_searches' - $ref: '#/components/parameters/msearch___query.max_concurrent_shard_requests' @@ -26865,6 +26869,14 @@ components: schema: $ref: '#/components/schemas/_common___Indices' style: simple + msearch___query.allow_partial_results: + in: query + name: allow_partial_results + description: Specifies whether to return partial results if there are shard request timeouts or shard failures + schema: + type: boolean + default: true + style: form msearch___query.ccs_minimize_roundtrips: in: query name: ccs_minimize_roundtrips @@ -41753,6 +41765,7 @@ components: required: - filter unevaluatedProperties: true + x-protobuf-excluded: true - properties: filters: $ref: '#/components/schemas/_common.aggregations___FiltersAggregation' @@ -43311,6 +43324,9 @@ components: allOf: - $ref: '#/components/schemas/_common.aggregations___FormatMetricAggregationBase' - type: object + properties: + value_type: + $ref: '#/components/schemas/_common.aggregations___ValueType' _common.aggregations___MaxBucketAggregation: allOf: - $ref: '#/components/schemas/_common.aggregations___PipelineAggregationBase' @@ -43333,12 +43349,17 @@ components: - $ref: '#/components/schemas/_common.aggregations___Aggregation' - type: object properties: - field: - $ref: '#/components/schemas/_common___Field' missing: $ref: '#/components/schemas/_common___FieldValue' - script: - $ref: '#/components/schemas/_common___Script' + - anyOf: + - type: object + properties: + field: + $ref: '#/components/schemas/_common___Field' + - type: object + properties: + script: + $ref: '#/components/schemas/_common___Script' _common.aggregations___MinAggregate: allOf: - $ref: '#/components/schemas/_common.aggregations___SingleMetricAggregateBase' @@ -43347,6 +43368,9 @@ components: allOf: - $ref: '#/components/schemas/_common.aggregations___FormatMetricAggregationBase' - type: object + properties: + value_type: + $ref: '#/components/schemas/_common.aggregations___ValueType' _common.aggregations___MinBucketAggregation: allOf: - $ref: '#/components/schemas/_common.aggregations___PipelineAggregationBase' @@ -44577,23 +44601,20 @@ components: $ref: '#/components/schemas/_common.aggregations___TermsExclude' execution_hint: $ref: '#/components/schemas/_common.aggregations___TermsAggregationExecutionHint' - field: - $ref: '#/components/schemas/_common___Field' include: $ref: '#/components/schemas/_common.aggregations___TermsInclude' min_doc_count: description: Only return values that are found in more than `min_doc_count` hits. type: integer - format: int32 + format: int64 missing: $ref: '#/components/schemas/_common___FieldValue' value_type: description: Coerced unmapped fields into the specified type. - type: string + $ref: '#/components/schemas/_common.aggregations___ValueType' order: $ref: '#/components/schemas/_common.aggregations___AggregateOrder' - script: - $ref: '#/components/schemas/_common___Script' + x-protobuf-excluded: true shard_size: description: |- The number of candidate terms produced by each shard. @@ -44603,7 +44624,7 @@ components: 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 + format: int64 show_term_doc_count_error: description: Set to `true` to return the `doc_count_error_upper_bound`, which is an upper bound to the error on the `doc_count` returned by each shard. type: boolean @@ -44613,6 +44634,15 @@ components: format: int32 format: type: string + - anyOf: + - type: object + properties: + field: + $ref: '#/components/schemas/_common___Field' + - type: object + properties: + script: + $ref: '#/components/schemas/_common___Script' _common.aggregations___TermsAggregationCollectMode: type: string enum: @@ -44780,17 +44810,25 @@ components: - type: object _common.aggregations___ValueType: type: string + description: |- + The data type for a field. The server's `lenientParse` accepts multiple representations + for the same underlying type (for example, byte/short/integer/long all map to long). enum: - boolean + - byte - date - - date_nanos - double + - float - geo_point + - integer - ip - long - number - numeric + - range + - short - string + - unsigned_long _common.aggregations___VariableWidthHistogramAggregate: allOf: - $ref: '#/components/schemas/_common.aggregations___MultiBucketAggregateBaseVariableWidthHistogramBucket'