diff --git a/UPGRADING.md b/UPGRADING.md
index 8316532651..7edfe5b589 100644
--- a/UPGRADING.md
+++ b/UPGRADING.md
@@ -112,4 +112,35 @@ After:
- The `creationDate` property is now of type `Long` instead of `String`.
- The `translogDurability` property now accepts a `TranslogDurability` enum instead of a `String`.
- The `numberOfReplicas` property is now of type `Integer` instead of `String`.
-- The `numberOfShards` property is now of type `Integer` instead of `String`.
\ No newline at end of file
+- The `numberOfShards` property is now of type `Integer` instead of `String`.
+
+### BoostingQuery
+- The `negativeBoost` property has been corrected to be of type `float` instead of `double`.
+
+### DisMaxQuery
+- The `tieBreaker` property has been corrected to be of type `Float` instead of `Double`.
+
+### FunctionScoreQuery
+- The `maxBoost` property has been corrected to be of type `Float` instead of `Double`.
+- The `minScore` property has been corrected to be of type `Float` instead of `Double`.
+
+### KnnQuery
+- The `filter` property is now of type `List` instead of `Query`.
+- The `vector` property is now of type `List` instead of `float[]`.
+
+### LikeDocument
+- The `type` property has been removed as it is not supported by OpenSearch as of version 2.0.0.
+
+### MatchQuery
+- The `cutoffFrequency` property has been corrected to be of type `Float` instead of `Double`.
+
+### MoreLikeThisQuery
+- The `boostTerms` property has been corrected to be of type `Float` instead of `Double`.
+
+### MultiMatchQuery
+- The `cutoffFrequency` property has been corrected to be of type `Float` instead of `Double`.
+- The `tieBreaker` property has been corrected to be of type `Float` instead of `Double`.
+
+### QueryStringQuery
+- The `phraseSlop` property has been corrected to be of type `Integer` instead of `Double`.
+- The `tieBreaker` property has been corrected to be of type `Float` instead of `Double`.
\ No newline at end of file
diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/AcknowledgedResponseBase.java b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/AcknowledgedResponseBase.java
index a10d8d9293..4062ed6692 100644
--- a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/AcknowledgedResponseBase.java
+++ b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/AcknowledgedResponseBase.java
@@ -113,7 +113,6 @@ public final BuilderT acknowledged(boolean value) {
this.acknowledged = value;
return self();
}
-
}
// ---------------------------------------------------------------------------------------------
diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/BaseNode.java b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/BaseNode.java
index 7844ae7e27..8dfc818156 100644
--- a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/BaseNode.java
+++ b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/BaseNode.java
@@ -306,7 +306,6 @@ public final BuilderT transportAddress(@Nullable String value) {
this.transportAddress = value;
return self();
}
-
}
// ---------------------------------------------------------------------------------------------
diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/BulkByScrollTaskStatusOrException.java b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/BulkByScrollTaskStatusOrException.java
index c4a0e8fdf3..da0183f905 100644
--- a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/BulkByScrollTaskStatusOrException.java
+++ b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/BulkByScrollTaskStatusOrException.java
@@ -40,6 +40,7 @@
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;
@@ -136,10 +137,27 @@ public void serialize(JsonGenerator generator, JsonpMapper mapper) {
}
}
+ @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(BulkByScrollTaskStatusOrException o) {
+ this._kind = o._kind;
+ this._value = o._value;
+ }
+
public ObjectBuilder exception(ErrorCause v) {
this._kind = Kind.Exception;
this._value = v;
diff --git a/java-client/src/main/java/org/opensearch/client/opensearch/_types/CoordsGeoBounds.java b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/CoordsGeoBounds.java
similarity index 71%
rename from java-client/src/main/java/org/opensearch/client/opensearch/_types/CoordsGeoBounds.java
rename to java-client/src/generated/java/org/opensearch/client/opensearch/_types/CoordsGeoBounds.java
index d6851e85f1..f4a02ab237 100644
--- a/java-client/src/main/java/org/opensearch/client/opensearch/_types/CoordsGeoBounds.java
+++ b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/CoordsGeoBounds.java
@@ -30,10 +30,16 @@
* GitHub history for details.
*/
+//----------------------------------------------------
+// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST.
+//----------------------------------------------------
+
package org.opensearch.client.opensearch._types;
import jakarta.json.stream.JsonGenerator;
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;
@@ -41,14 +47,16 @@
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.CoordsGeoBounds
@JsonpDeserializable
-public class CoordsGeoBounds implements PlainJsonSerializable {
- private final double top;
+@Generated("org.opensearch.client.codegen.CodeGenerator")
+public class CoordsGeoBounds implements PlainJsonSerializable, ToCopyableBuilder {
private final double bottom;
@@ -56,28 +64,21 @@ public class CoordsGeoBounds implements PlainJsonSerializable {
private final double right;
+ private final double top;
+
// ---------------------------------------------------------------------------------------------
private CoordsGeoBounds(Builder builder) {
-
- this.top = ApiTypeHelper.requireNonNull(builder.top, this, "top");
this.bottom = ApiTypeHelper.requireNonNull(builder.bottom, this, "bottom");
this.left = ApiTypeHelper.requireNonNull(builder.left, this, "left");
this.right = ApiTypeHelper.requireNonNull(builder.right, this, "right");
-
+ this.top = ApiTypeHelper.requireNonNull(builder.top, this, "top");
}
- public static CoordsGeoBounds of(Function> fn) {
+ public static CoordsGeoBounds of(Function> fn) {
return fn.apply(new Builder()).build();
}
- /**
- * Required - API name: {@code top}
- */
- public final double top() {
- return this.top;
- }
-
/**
* Required - API name: {@code bottom}
*/
@@ -99,9 +100,17 @@ public final double right() {
return this.right;
}
+ /**
+ * Required - API name: {@code top}
+ */
+ public final double top() {
+ return this.top;
+ }
+
/**
* Serialize this object to JSON.
*/
+ @Override
public void serialize(JsonGenerator generator, JsonpMapper mapper) {
generator.writeStartObject();
serializeInternal(generator, mapper);
@@ -109,10 +118,6 @@ public void serialize(JsonGenerator generator, JsonpMapper mapper) {
}
protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) {
-
- generator.writeKey("top");
- generator.write(this.top);
-
generator.writeKey("bottom");
generator.write(this.bottom);
@@ -122,34 +127,58 @@ protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) {
generator.writeKey("right");
generator.write(this.right);
+ generator.writeKey("top");
+ generator.write(this.top);
}
// ---------------------------------------------------------------------------------------------
+ @Override
+ @Nonnull
+ public Builder toBuilder() {
+ return new Builder(this);
+ }
+
+ @Nonnull
+ public static Builder builder() {
+ return new Builder();
+ }
+
/**
* Builder for {@link CoordsGeoBounds}.
*/
-
- public static class Builder extends ObjectBuilderBase implements ObjectBuilder {
+ public static class Builder extends ObjectBuilderBase implements CopyableBuilder {
+ private Double bottom;
+ private Double left;
+ private Double right;
private Double top;
- private Double bottom;
+ public Builder() {}
- private Double left;
+ private Builder(CoordsGeoBounds o) {
+ this.bottom = o.bottom;
+ this.left = o.left;
+ this.right = o.right;
+ this.top = o.top;
+ }
- private Double right;
+ private Builder(Builder o) {
+ this.bottom = o.bottom;
+ this.left = o.left;
+ this.right = o.right;
+ this.top = o.top;
+ }
- /**
- * Required - API name: {@code top}
- */
- public final Builder top(double value) {
- this.top = value;
- return this;
+ @Override
+ @Nonnull
+ public Builder copy() {
+ return new Builder(this);
}
/**
* Required - API name: {@code bottom}
*/
+ @Nonnull
public final Builder bottom(double value) {
this.bottom = value;
return this;
@@ -158,6 +187,7 @@ public final Builder bottom(double value) {
/**
* Required - API name: {@code left}
*/
+ @Nonnull
public final Builder left(double value) {
this.left = value;
return this;
@@ -166,17 +196,28 @@ public final Builder left(double value) {
/**
* Required - API name: {@code right}
*/
+ @Nonnull
public final Builder right(double value) {
this.right = value;
return this;
}
+ /**
+ * Required - API name: {@code top}
+ */
+ @Nonnull
+ public final Builder top(double value) {
+ this.top = value;
+ return this;
+ }
+
/**
* Builds a {@link CoordsGeoBounds}.
*
- * @throws NullPointerException
- * if some of the required fields are null.
+ * @throws NullPointerException if some of the required fields are null.
*/
+ @Override
+ @Nonnull
public CoordsGeoBounds build() {
_checkSingleUse();
@@ -195,12 +236,27 @@ public CoordsGeoBounds build() {
);
protected static void setupCoordsGeoBoundsDeserializer(ObjectDeserializer op) {
-
- op.add(Builder::top, JsonpDeserializer.doubleDeserializer(), "top");
op.add(Builder::bottom, JsonpDeserializer.doubleDeserializer(), "bottom");
op.add(Builder::left, JsonpDeserializer.doubleDeserializer(), "left");
op.add(Builder::right, JsonpDeserializer.doubleDeserializer(), "right");
+ op.add(Builder::top, JsonpDeserializer.doubleDeserializer(), "top");
+ }
+ @Override
+ public int hashCode() {
+ int result = 17;
+ result = 31 * result + Double.hashCode(this.bottom);
+ result = 31 * result + Double.hashCode(this.left);
+ result = 31 * result + Double.hashCode(this.right);
+ result = 31 * result + Double.hashCode(this.top);
+ return result;
}
+ @Override
+ public boolean equals(Object o) {
+ if (this == o) return true;
+ if (o == null || this.getClass() != o.getClass()) return false;
+ CoordsGeoBounds other = (CoordsGeoBounds) o;
+ return this.bottom == other.bottom && this.left == other.left && this.right == other.right && this.top == other.top;
+ }
}
diff --git a/java-client/src/main/java/org/opensearch/client/opensearch/_types/DistanceUnit.java b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/DistanceUnit.java
similarity index 84%
rename from java-client/src/main/java/org/opensearch/client/opensearch/_types/DistanceUnit.java
rename to java-client/src/generated/java/org/opensearch/client/opensearch/_types/DistanceUnit.java
index fa3511a98c..ea808a7e54 100644
--- a/java-client/src/main/java/org/opensearch/client/opensearch/_types/DistanceUnit.java
+++ b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/DistanceUnit.java
@@ -30,32 +30,38 @@
* GitHub history for details.
*/
+//----------------------------------------------------
+// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST.
+//----------------------------------------------------
+
package org.opensearch.client.opensearch._types;
+import javax.annotation.Generated;
import org.opensearch.client.json.JsonEnum;
import org.opensearch.client.json.JsonpDeserializable;
+// typedef: _types.DistanceUnit
+
@JsonpDeserializable
+@Generated("org.opensearch.client.codegen.CodeGenerator")
public enum DistanceUnit implements JsonEnum {
- Inches("in"),
+ Centimeters("cm"),
Feet("ft"),
- Yards("yd"),
-
- Miles("mi"),
-
- NauticMiles("nmi"),
+ Inches("in"),
Kilometers("km"),
Meters("m"),
- Centimeters("cm"),
+ Miles("mi"),
Millimeters("mm"),
- ;
+ NauticalMiles("nmi"),
+
+ Yards("yd");
private final String jsonValue;
diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/ErrorCause.java b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/ErrorCause.java
index cf7142a23d..f7e967d882 100644
--- a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/ErrorCause.java
+++ b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/ErrorCause.java
@@ -67,6 +67,9 @@ public class ErrorCause implements PlainJsonSerializable, ToCopyableBuilder metadata;
+
@Nullable
private final String reason;
@@ -82,19 +85,16 @@ public class ErrorCause implements PlainJsonSerializable, ToCopyableBuilder metadata;
-
// ---------------------------------------------------------------------------------------------
private ErrorCause(Builder builder) {
this.causedBy = builder.causedBy;
+ this.metadata = ApiTypeHelper.unmodifiable(builder.metadata);
this.reason = builder.reason;
this.rootCause = ApiTypeHelper.unmodifiable(builder.rootCause);
this.stackTrace = builder.stackTrace;
this.suppressed = ApiTypeHelper.unmodifiable(builder.suppressed);
this.type = ApiTypeHelper.requireNonNull(builder.type, this, "type");
- this.metadata = ApiTypeHelper.unmodifiable(builder.metadata);
}
public static ErrorCause of(Function> fn) {
@@ -109,6 +109,14 @@ public final ErrorCause causedBy() {
return this.causedBy;
}
+ /**
+ * Any additional information about the error.
+ */
+ @Nonnull
+ public final Map metadata() {
+ return this.metadata;
+ }
+
/**
* A human-readable explanation of the error, in English.
*
@@ -158,14 +166,6 @@ public final String type() {
return this.type;
}
- /**
- * Any additional information about the error.
- */
- @Nonnull
- public final Map metadata() {
- return this.metadata;
- }
-
/**
* Serialize this object to JSON.
*/
@@ -238,6 +238,8 @@ public static class Builder extends ObjectBuilderBase implements CopyableBuilder
@Nullable
private ErrorCause causedBy;
@Nullable
+ private Map metadata;
+ @Nullable
private String reason;
@Nullable
private List rootCause;
@@ -246,29 +248,27 @@ public static class Builder extends ObjectBuilderBase implements CopyableBuilder
@Nullable
private List suppressed;
private String type;
- @Nullable
- private Map metadata;
public Builder() {}
private Builder(ErrorCause o) {
this.causedBy = o.causedBy;
+ this.metadata = _mapCopy(o.metadata);
this.reason = o.reason;
this.rootCause = _listCopy(o.rootCause);
this.stackTrace = o.stackTrace;
this.suppressed = _listCopy(o.suppressed);
this.type = o.type;
- this.metadata = _mapCopy(o.metadata);
}
private Builder(Builder o) {
this.causedBy = o.causedBy;
+ this.metadata = _mapCopy(o.metadata);
this.reason = o.reason;
this.rootCause = _listCopy(o.rootCause);
this.stackTrace = o.stackTrace;
this.suppressed = _listCopy(o.suppressed);
this.type = o.type;
- this.metadata = _mapCopy(o.metadata);
}
@Override
@@ -294,6 +294,32 @@ public final Builder causedBy(Function
+ * Adds all elements of map
to metadata
.
+ *
+ */
+ @Nonnull
+ public final Builder metadata(Map map) {
+ this.metadata = _mapPutAll(this.metadata, map);
+ return this;
+ }
+
+ /**
+ * Any additional information about the error.
+ *
+ *
+ * Adds an entry to metadata
.
+ *
+ */
+ @Nonnull
+ public final Builder metadata(String key, JsonData value) {
+ this.metadata = _mapPut(this.metadata, key, value);
+ return this;
+ }
+
/**
* A human-readable explanation of the error, in English.
*
@@ -406,32 +432,6 @@ public final Builder type(String value) {
return this;
}
- /**
- * Any additional information about the error.
- *
- *
- * Adds all elements of map
to metadata
.
- *
- */
- @Nonnull
- public final Builder metadata(Map map) {
- this.metadata = _mapPutAll(this.metadata, map);
- return this;
- }
-
- /**
- * Any additional information about the error.
- *
- *
- * Adds an entry to metadata
.
- *
- */
- @Nonnull
- public final Builder metadata(String key, JsonData value) {
- this.metadata = _mapPut(this.metadata, key, value);
- return this;
- }
-
/**
* Builds a {@link ErrorCause}.
*
@@ -475,12 +475,12 @@ protected static void setupErrorCauseDeserializer(ObjectDeserializer
+ * A geo-bounding box. It can be represented in the following ways:
+ *
*
- * - as 4 top/bottom/left/right coordinates
- * - as 2 top_left / bottom_right points
- * - as 2 top_right / bottom_left points
- * - as a WKT bounding box
+ * - As 4 top/bottom/left/right coordinates.
+ * - As 2 top_left/bottom_right points.
+ * - As 2 top_right/bottom_left points.
+ * - As a Well Known Text (WKT) bounding box.
*
- *
*/
@JsonpDeserializable
-public class GeoBounds implements TaggedUnion, JsonpSerializable {
-
+@Generated("org.opensearch.client.codegen.CodeGenerator")
+public class GeoBounds implements TaggedUnion, PlainJsonSerializable {
+ /**
+ * {@link GeoBounds} variant kinds.
+ */
public enum Kind {
Coords,
Tlbr,
Trbl,
Wkt
-
}
private final Kind _kind;
@@ -87,13 +98,11 @@ private GeoBounds(Kind kind, Object value) {
}
private GeoBounds(Builder builder) {
-
this._kind = ApiTypeHelper.requireNonNull(builder._kind, builder, "");
this._value = ApiTypeHelper.requireNonNull(builder._value, builder, "");
-
}
- public static GeoBounds of(Function> fn) {
+ public static GeoBounds of(Function> fn) {
return fn.apply(new Builder()).build();
}
@@ -107,8 +116,7 @@ public boolean isCoords() {
/**
* Get the {@code coords} variant value.
*
- * @throws IllegalStateException
- * if the current variant is not of the {@code coords} kind.
+ * @throws IllegalStateException if the current variant is not the {@code coords} kind.
*/
public CoordsGeoBounds coords() {
return TaggedUnionUtils.get(this, Kind.Coords);
@@ -124,8 +132,7 @@ public boolean isTlbr() {
/**
* Get the {@code tlbr} variant value.
*
- * @throws IllegalStateException
- * if the current variant is not of the {@code tlbr} kind.
+ * @throws IllegalStateException if the current variant is not the {@code tlbr} kind.
*/
public TopLeftBottomRightGeoBounds tlbr() {
return TaggedUnionUtils.get(this, Kind.Tlbr);
@@ -141,8 +148,7 @@ public boolean isTrbl() {
/**
* Get the {@code trbl} variant value.
*
- * @throws IllegalStateException
- * if the current variant is not of the {@code trbl} kind.
+ * @throws IllegalStateException if the current variant is not the {@code trbl} kind.
*/
public TopRightBottomLeftGeoBounds trbl() {
return TaggedUnionUtils.get(this, Kind.Trbl);
@@ -158,8 +164,7 @@ public boolean isWkt() {
/**
* Get the {@code wkt} variant value.
*
- * @throws IllegalStateException
- * if the current variant is not of the {@code wkt} kind.
+ * @throws IllegalStateException if the current variant is not the {@code wkt} kind.
*/
public WktGeoBounds wkt() {
return TaggedUnionUtils.get(this, Kind.Wkt);
@@ -170,13 +175,29 @@ public void serialize(JsonGenerator generator, JsonpMapper mapper) {
if (_value instanceof JsonpSerializable) {
((JsonpSerializable) _value).serialize(generator, mapper);
}
+ }
+
+ @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(GeoBounds o) {
+ this._kind = o._kind;
+ this._value = o._value;
+ }
+
public ObjectBuilder coords(CoordsGeoBounds v) {
this._kind = Kind.Coords;
this._value = v;
@@ -217,11 +238,11 @@ public ObjectBuilder wkt(Function buildGeoBoundsDeserializer() {
@@ -236,4 +257,20 @@ private static JsonpDeserializer buildGeoBoundsDeserializer() {
}
public static final JsonpDeserializer _DESERIALIZER = JsonpDeserializer.lazy(GeoBounds::buildGeoBoundsDeserializer);
+
+ @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;
+ GeoBounds other = (GeoBounds) o;
+ return Objects.equals(this._kind, other._kind) && Objects.equals(this._value, other._value);
+ }
}
diff --git a/java-client/src/main/java/org/opensearch/client/opensearch/_types/GeoBoundsBuilders.java b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/GeoBoundsBuilders.java
similarity index 85%
rename from java-client/src/main/java/org/opensearch/client/opensearch/_types/GeoBoundsBuilders.java
rename to java-client/src/generated/java/org/opensearch/client/opensearch/_types/GeoBoundsBuilders.java
index 614522f557..55706b8502 100644
--- a/java-client/src/main/java/org/opensearch/client/opensearch/_types/GeoBoundsBuilders.java
+++ b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/GeoBoundsBuilders.java
@@ -30,33 +30,37 @@
* GitHub history for details.
*/
+//----------------------------------------------------
+// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST.
+//----------------------------------------------------
+
package org.opensearch.client.opensearch._types;
+import javax.annotation.Generated;
+
/**
* Builders for {@link GeoBounds} variants.
*/
+@Generated("org.opensearch.client.codegen.CodeGenerator")
public class GeoBoundsBuilders {
private GeoBoundsBuilders() {}
/**
- * Creates a builder for the {@link CoordsGeoBounds coords} {@code GeoBounds}
- * variant.
+ * Creates a builder for the {@link CoordsGeoBounds coords} {@code GeoBounds} variant.
*/
public static CoordsGeoBounds.Builder coords() {
return new CoordsGeoBounds.Builder();
}
/**
- * Creates a builder for the {@link TopLeftBottomRightGeoBounds tlbr}
- * {@code GeoBounds} variant.
+ * Creates a builder for the {@link TopLeftBottomRightGeoBounds tlbr} {@code GeoBounds} variant.
*/
public static TopLeftBottomRightGeoBounds.Builder tlbr() {
return new TopLeftBottomRightGeoBounds.Builder();
}
/**
- * Creates a builder for the {@link TopRightBottomLeftGeoBounds trbl}
- * {@code GeoBounds} variant.
+ * Creates a builder for the {@link TopRightBottomLeftGeoBounds trbl} {@code GeoBounds} variant.
*/
public static TopRightBottomLeftGeoBounds.Builder trbl() {
return new TopRightBottomLeftGeoBounds.Builder();
@@ -68,5 +72,4 @@ public static TopRightBottomLeftGeoBounds.Builder trbl() {
public static WktGeoBounds.Builder wkt() {
return new WktGeoBounds.Builder();
}
-
}
diff --git a/java-client/src/main/java/org/opensearch/client/opensearch/_types/GeoDistanceType.java b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/GeoDistanceType.java
similarity index 84%
rename from java-client/src/main/java/org/opensearch/client/opensearch/_types/GeoDistanceType.java
rename to java-client/src/generated/java/org/opensearch/client/opensearch/_types/GeoDistanceType.java
index ff616f352f..dacd401b7f 100644
--- a/java-client/src/main/java/org/opensearch/client/opensearch/_types/GeoDistanceType.java
+++ b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/GeoDistanceType.java
@@ -30,18 +30,24 @@
* GitHub history for details.
*/
+//----------------------------------------------------
+// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST.
+//----------------------------------------------------
+
package org.opensearch.client.opensearch._types;
+import javax.annotation.Generated;
import org.opensearch.client.json.JsonEnum;
import org.opensearch.client.json.JsonpDeserializable;
+// typedef: _types.GeoDistanceType
+
@JsonpDeserializable
+@Generated("org.opensearch.client.codegen.CodeGenerator")
public enum GeoDistanceType implements JsonEnum {
Arc("arc"),
- Plane("plane"),
-
- ;
+ Plane("plane");
private final String jsonValue;
diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/GeoLocation.java b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/GeoLocation.java
index bd20ce101b..4555b1e87a 100644
--- a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/GeoLocation.java
+++ b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/GeoLocation.java
@@ -41,6 +41,7 @@
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;
@@ -190,10 +191,27 @@ public void serialize(JsonGenerator generator, JsonpMapper mapper) {
}
}
+ @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(GeoLocation o) {
+ this._kind = o._kind;
+ this._value = o._value;
+ }
+
public ObjectBuilder coords(List v) {
this._kind = Kind.Coords;
this._value = v;
diff --git a/java-client/src/main/java/org/opensearch/client/opensearch/_types/GeoShapeRelation.java b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/GeoShapeRelation.java
similarity index 84%
rename from java-client/src/main/java/org/opensearch/client/opensearch/_types/GeoShapeRelation.java
rename to java-client/src/generated/java/org/opensearch/client/opensearch/_types/GeoShapeRelation.java
index f51d42a238..f9802a2130 100644
--- a/java-client/src/main/java/org/opensearch/client/opensearch/_types/GeoShapeRelation.java
+++ b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/GeoShapeRelation.java
@@ -30,22 +30,28 @@
* GitHub history for details.
*/
+//----------------------------------------------------
+// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST.
+//----------------------------------------------------
+
package org.opensearch.client.opensearch._types;
+import javax.annotation.Generated;
import org.opensearch.client.json.JsonEnum;
import org.opensearch.client.json.JsonpDeserializable;
+// typedef: _types.GeoShapeRelation
+
@JsonpDeserializable
+@Generated("org.opensearch.client.codegen.CodeGenerator")
public enum GeoShapeRelation implements JsonEnum {
- Intersects("intersects"),
+ Contains("contains"),
Disjoint("disjoint"),
- Within("within"),
-
- Contains("contains"),
+ Intersects("intersects"),
- ;
+ Within("within");
private final String jsonValue;
diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/IndicesResponseBase.java b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/IndicesResponseBase.java
index 4acf5c0423..4000cd23b4 100644
--- a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/IndicesResponseBase.java
+++ b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/IndicesResponseBase.java
@@ -112,7 +112,6 @@ public final BuilderT shards(@Nullable ShardStatistics value) {
public final BuilderT shards(Function> fn) {
return shards(fn.apply(new ShardStatistics.Builder()).build());
}
-
}
// ---------------------------------------------------------------------------------------------
diff --git a/java-client/src/main/java/org/opensearch/client/opensearch/_types/NestedSortValue.java b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/NestedSortValue.java
similarity index 70%
rename from java-client/src/main/java/org/opensearch/client/opensearch/_types/NestedSortValue.java
rename to java-client/src/generated/java/org/opensearch/client/opensearch/_types/NestedSortValue.java
index d6ad211a56..2a450edfff 100644
--- a/java-client/src/main/java/org/opensearch/client/opensearch/_types/NestedSortValue.java
+++ b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/NestedSortValue.java
@@ -30,10 +30,17 @@
* GitHub history for details.
*/
+//----------------------------------------------------
+// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST.
+//----------------------------------------------------
+
package org.opensearch.client.opensearch._types;
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;
@@ -43,13 +50,17 @@
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.NestedSortValue
@JsonpDeserializable
-public class NestedSortValue implements PlainJsonSerializable {
+@Generated("org.opensearch.client.codegen.CodeGenerator")
+public class NestedSortValue implements PlainJsonSerializable, ToCopyableBuilder {
+
@Nullable
private final Query filter;
@@ -59,20 +70,19 @@ public class NestedSortValue implements PlainJsonSerializable {
@Nullable
private final NestedSortValue nested;
+ @Nonnull
private final String path;
// ---------------------------------------------------------------------------------------------
private NestedSortValue(Builder builder) {
-
this.filter = builder.filter;
this.maxChildren = builder.maxChildren;
this.nested = builder.nested;
this.path = ApiTypeHelper.requireNonNull(builder.path, this, "path");
-
}
- public static NestedSortValue of(Function> fn) {
+ public static NestedSortValue of(Function> fn) {
return fn.apply(new Builder()).build();
}
@@ -103,6 +113,7 @@ public final NestedSortValue nested() {
/**
* Required - API name: {@code path}
*/
+ @Nonnull
public final String path() {
return this.path;
}
@@ -110,6 +121,7 @@ public final String path() {
/**
* Serialize this object to JSON.
*/
+ @Override
public void serialize(JsonGenerator generator, JsonpMapper mapper) {
generator.writeStartObject();
serializeInternal(generator, mapper);
@@ -117,48 +129,76 @@ public void serialize(JsonGenerator generator, JsonpMapper mapper) {
}
protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) {
-
if (this.filter != null) {
generator.writeKey("filter");
this.filter.serialize(generator, mapper);
-
}
+
if (this.maxChildren != null) {
generator.writeKey("max_children");
generator.write(this.maxChildren);
-
}
+
if (this.nested != null) {
generator.writeKey("nested");
this.nested.serialize(generator, mapper);
-
}
+
generator.writeKey("path");
generator.write(this.path);
-
}
// ---------------------------------------------------------------------------------------------
+ @Override
+ @Nonnull
+ public Builder toBuilder() {
+ return new Builder(this);
+ }
+
+ @Nonnull
+ public static Builder builder() {
+ return new Builder();
+ }
+
/**
* Builder for {@link NestedSortValue}.
*/
-
- public static class Builder extends ObjectBuilderBase implements ObjectBuilder {
+ public static class Builder extends ObjectBuilderBase implements CopyableBuilder {
@Nullable
private Query filter;
-
@Nullable
private Integer maxChildren;
-
@Nullable
private NestedSortValue nested;
-
private String path;
+ public Builder() {}
+
+ private Builder(NestedSortValue o) {
+ this.filter = o.filter;
+ this.maxChildren = o.maxChildren;
+ this.nested = o.nested;
+ this.path = o.path;
+ }
+
+ private Builder(Builder o) {
+ this.filter = o.filter;
+ this.maxChildren = o.maxChildren;
+ this.nested = o.nested;
+ this.path = o.path;
+ }
+
+ @Override
+ @Nonnull
+ public Builder copy() {
+ return new Builder(this);
+ }
+
/**
* API name: {@code filter}
*/
+ @Nonnull
public final Builder filter(@Nullable Query value) {
this.filter = value;
return this;
@@ -167,13 +207,15 @@ public final Builder filter(@Nullable Query value) {
/**
* API name: {@code filter}
*/
+ @Nonnull
public final Builder filter(Function> fn) {
- return this.filter(fn.apply(new Query.Builder()).build());
+ return filter(fn.apply(new Query.Builder()).build());
}
/**
* API name: {@code max_children}
*/
+ @Nonnull
public final Builder maxChildren(@Nullable Integer value) {
this.maxChildren = value;
return this;
@@ -182,6 +224,7 @@ public final Builder maxChildren(@Nullable Integer value) {
/**
* API name: {@code nested}
*/
+ @Nonnull
public final Builder nested(@Nullable NestedSortValue value) {
this.nested = value;
return this;
@@ -190,13 +233,15 @@ public final Builder nested(@Nullable NestedSortValue value) {
/**
* API name: {@code nested}
*/
+ @Nonnull
public final Builder nested(Function> fn) {
- return this.nested(fn.apply(new NestedSortValue.Builder()).build());
+ return nested(fn.apply(new NestedSortValue.Builder()).build());
}
/**
* Required - API name: {@code path}
*/
+ @Nonnull
public final Builder path(String value) {
this.path = value;
return this;
@@ -205,9 +250,10 @@ public final Builder path(String value) {
/**
* Builds a {@link NestedSortValue}.
*
- * @throws NullPointerException
- * if some of the required fields are null.
+ * @throws NullPointerException if some of the required fields are null.
*/
+ @Override
+ @Nonnull
public NestedSortValue build() {
_checkSingleUse();
@@ -226,12 +272,30 @@ public NestedSortValue build() {
);
protected static void setupNestedSortValueDeserializer(ObjectDeserializer op) {
-
op.add(Builder::filter, Query._DESERIALIZER, "filter");
op.add(Builder::maxChildren, JsonpDeserializer.integerDeserializer(), "max_children");
op.add(Builder::nested, NestedSortValue._DESERIALIZER, "nested");
op.add(Builder::path, JsonpDeserializer.stringDeserializer(), "path");
+ }
+ @Override
+ public int hashCode() {
+ int result = 17;
+ result = 31 * result + Objects.hashCode(this.filter);
+ result = 31 * result + Objects.hashCode(this.maxChildren);
+ result = 31 * result + Objects.hashCode(this.nested);
+ result = 31 * result + this.path.hashCode();
+ return result;
}
+ @Override
+ public boolean equals(Object o) {
+ if (this == o) return true;
+ if (o == null || this.getClass() != o.getClass()) return false;
+ NestedSortValue other = (NestedSortValue) o;
+ return Objects.equals(this.filter, other.filter)
+ && Objects.equals(this.maxChildren, other.maxChildren)
+ && Objects.equals(this.nested, other.nested)
+ && this.path.equals(other.path);
+ }
}
diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/ResourceStat.java b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/ResourceStat.java
new file mode 100644
index 0000000000..2040ccd255
--- /dev/null
+++ b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/ResourceStat.java
@@ -0,0 +1,208 @@
+/*
+ * 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;
+
+import jakarta.json.stream.JsonGenerator;
+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.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.ResourceStat
+
+@JsonpDeserializable
+@Generated("org.opensearch.client.codegen.CodeGenerator")
+public class ResourceStat implements PlainJsonSerializable, ToCopyableBuilder {
+
+ private final long cpuTimeInNanos;
+
+ private final long memoryInBytes;
+
+ // ---------------------------------------------------------------------------------------------
+
+ private ResourceStat(Builder builder) {
+ this.cpuTimeInNanos = ApiTypeHelper.requireNonNull(builder.cpuTimeInNanos, this, "cpuTimeInNanos");
+ this.memoryInBytes = ApiTypeHelper.requireNonNull(builder.memoryInBytes, this, "memoryInBytes");
+ }
+
+ public static ResourceStat of(Function> fn) {
+ return fn.apply(new Builder()).build();
+ }
+
+ /**
+ * Required - API name: {@code cpu_time_in_nanos}
+ */
+ public final long cpuTimeInNanos() {
+ return this.cpuTimeInNanos;
+ }
+
+ /**
+ * Required - API name: {@code memory_in_bytes}
+ */
+ public final long memoryInBytes() {
+ return this.memoryInBytes;
+ }
+
+ /**
+ * 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("cpu_time_in_nanos");
+ generator.write(this.cpuTimeInNanos);
+
+ generator.writeKey("memory_in_bytes");
+ generator.write(this.memoryInBytes);
+ }
+
+ // ---------------------------------------------------------------------------------------------
+
+ @Override
+ @Nonnull
+ public Builder toBuilder() {
+ return new Builder(this);
+ }
+
+ @Nonnull
+ public static Builder builder() {
+ return new Builder();
+ }
+
+ /**
+ * Builder for {@link ResourceStat}.
+ */
+ public static class Builder extends ObjectBuilderBase implements CopyableBuilder {
+ private Long cpuTimeInNanos;
+ private Long memoryInBytes;
+
+ public Builder() {}
+
+ private Builder(ResourceStat o) {
+ this.cpuTimeInNanos = o.cpuTimeInNanos;
+ this.memoryInBytes = o.memoryInBytes;
+ }
+
+ private Builder(Builder o) {
+ this.cpuTimeInNanos = o.cpuTimeInNanos;
+ this.memoryInBytes = o.memoryInBytes;
+ }
+
+ @Override
+ @Nonnull
+ public Builder copy() {
+ return new Builder(this);
+ }
+
+ /**
+ * Required - API name: {@code cpu_time_in_nanos}
+ */
+ @Nonnull
+ public final Builder cpuTimeInNanos(long value) {
+ this.cpuTimeInNanos = value;
+ return this;
+ }
+
+ /**
+ * Required - API name: {@code memory_in_bytes}
+ */
+ @Nonnull
+ public final Builder memoryInBytes(long value) {
+ this.memoryInBytes = value;
+ return this;
+ }
+
+ /**
+ * Builds a {@link ResourceStat}.
+ *
+ * @throws NullPointerException if some of the required fields are null.
+ */
+ @Override
+ @Nonnull
+ public ResourceStat build() {
+ _checkSingleUse();
+
+ return new ResourceStat(this);
+ }
+ }
+
+ // ---------------------------------------------------------------------------------------------
+
+ /**
+ * Json deserializer for {@link ResourceStat}
+ */
+ public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer.lazy(
+ Builder::new,
+ ResourceStat::setupResourceStatDeserializer
+ );
+
+ protected static void setupResourceStatDeserializer(ObjectDeserializer op) {
+ op.add(Builder::cpuTimeInNanos, JsonpDeserializer.longDeserializer(), "cpu_time_in_nanos");
+ op.add(Builder::memoryInBytes, JsonpDeserializer.longDeserializer(), "memory_in_bytes");
+ }
+
+ @Override
+ public int hashCode() {
+ int result = 17;
+ result = 31 * result + Long.hashCode(this.cpuTimeInNanos);
+ result = 31 * result + Long.hashCode(this.memoryInBytes);
+ return result;
+ }
+
+ @Override
+ public boolean equals(Object o) {
+ if (this == o) return true;
+ if (o == null || this.getClass() != o.getClass()) return false;
+ ResourceStat other = (ResourceStat) o;
+ return this.cpuTimeInNanos == other.cpuTimeInNanos && this.memoryInBytes == other.memoryInBytes;
+ }
+}
diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/ResourceStats.java b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/ResourceStats.java
new file mode 100644
index 0000000000..a346fc4ec8
--- /dev/null
+++ b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/ResourceStats.java
@@ -0,0 +1,343 @@
+/*
+ * 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;
+
+import jakarta.json.stream.JsonGenerator;
+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.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.ResourceStats
+
+@JsonpDeserializable
+@Generated("org.opensearch.client.codegen.CodeGenerator")
+public class ResourceStats implements PlainJsonSerializable, ToCopyableBuilder {
+
+ @Nonnull
+ private final ResourceStat average;
+
+ @Nonnull
+ private final ResourceStat max;
+
+ @Nonnull
+ private final ResourceStat min;
+
+ @Nonnull
+ private final ThreadInfo threadInfo;
+
+ @Nonnull
+ private final ResourceStat total;
+
+ // ---------------------------------------------------------------------------------------------
+
+ private ResourceStats(Builder builder) {
+ this.average = ApiTypeHelper.requireNonNull(builder.average, this, "average");
+ this.max = ApiTypeHelper.requireNonNull(builder.max, this, "max");
+ this.min = ApiTypeHelper.requireNonNull(builder.min, this, "min");
+ this.threadInfo = ApiTypeHelper.requireNonNull(builder.threadInfo, this, "threadInfo");
+ this.total = ApiTypeHelper.requireNonNull(builder.total, this, "total");
+ }
+
+ public static ResourceStats of(Function> fn) {
+ return fn.apply(new Builder()).build();
+ }
+
+ /**
+ * Required - API name: {@code average}
+ */
+ @Nonnull
+ public final ResourceStat average() {
+ return this.average;
+ }
+
+ /**
+ * Required - API name: {@code max}
+ */
+ @Nonnull
+ public final ResourceStat max() {
+ return this.max;
+ }
+
+ /**
+ * Required - API name: {@code min}
+ */
+ @Nonnull
+ public final ResourceStat min() {
+ return this.min;
+ }
+
+ /**
+ * Required - API name: {@code thread_info}
+ */
+ @Nonnull
+ public final ThreadInfo threadInfo() {
+ return this.threadInfo;
+ }
+
+ /**
+ * Required - API name: {@code total}
+ */
+ @Nonnull
+ public final ResourceStat total() {
+ return this.total;
+ }
+
+ /**
+ * 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("average");
+ this.average.serialize(generator, mapper);
+
+ generator.writeKey("max");
+ this.max.serialize(generator, mapper);
+
+ generator.writeKey("min");
+ this.min.serialize(generator, mapper);
+
+ generator.writeKey("thread_info");
+ this.threadInfo.serialize(generator, mapper);
+
+ generator.writeKey("total");
+ this.total.serialize(generator, mapper);
+ }
+
+ // ---------------------------------------------------------------------------------------------
+
+ @Override
+ @Nonnull
+ public Builder toBuilder() {
+ return new Builder(this);
+ }
+
+ @Nonnull
+ public static Builder builder() {
+ return new Builder();
+ }
+
+ /**
+ * Builder for {@link ResourceStats}.
+ */
+ public static class Builder extends ObjectBuilderBase implements CopyableBuilder {
+ private ResourceStat average;
+ private ResourceStat max;
+ private ResourceStat min;
+ private ThreadInfo threadInfo;
+ private ResourceStat total;
+
+ public Builder() {}
+
+ private Builder(ResourceStats o) {
+ this.average = o.average;
+ this.max = o.max;
+ this.min = o.min;
+ this.threadInfo = o.threadInfo;
+ this.total = o.total;
+ }
+
+ private Builder(Builder o) {
+ this.average = o.average;
+ this.max = o.max;
+ this.min = o.min;
+ this.threadInfo = o.threadInfo;
+ this.total = o.total;
+ }
+
+ @Override
+ @Nonnull
+ public Builder copy() {
+ return new Builder(this);
+ }
+
+ /**
+ * Required - API name: {@code average}
+ */
+ @Nonnull
+ public final Builder average(ResourceStat value) {
+ this.average = value;
+ return this;
+ }
+
+ /**
+ * Required - API name: {@code average}
+ */
+ @Nonnull
+ public final Builder average(Function> fn) {
+ return average(fn.apply(new ResourceStat.Builder()).build());
+ }
+
+ /**
+ * Required - API name: {@code max}
+ */
+ @Nonnull
+ public final Builder max(ResourceStat value) {
+ this.max = value;
+ return this;
+ }
+
+ /**
+ * Required - API name: {@code max}
+ */
+ @Nonnull
+ public final Builder max(Function> fn) {
+ return max(fn.apply(new ResourceStat.Builder()).build());
+ }
+
+ /**
+ * Required - API name: {@code min}
+ */
+ @Nonnull
+ public final Builder min(ResourceStat value) {
+ this.min = value;
+ return this;
+ }
+
+ /**
+ * Required - API name: {@code min}
+ */
+ @Nonnull
+ public final Builder min(Function> fn) {
+ return min(fn.apply(new ResourceStat.Builder()).build());
+ }
+
+ /**
+ * Required - API name: {@code thread_info}
+ */
+ @Nonnull
+ public final Builder threadInfo(ThreadInfo value) {
+ this.threadInfo = value;
+ return this;
+ }
+
+ /**
+ * Required - API name: {@code thread_info}
+ */
+ @Nonnull
+ public final Builder threadInfo(Function> fn) {
+ return threadInfo(fn.apply(new ThreadInfo.Builder()).build());
+ }
+
+ /**
+ * Required - API name: {@code total}
+ */
+ @Nonnull
+ public final Builder total(ResourceStat value) {
+ this.total = value;
+ return this;
+ }
+
+ /**
+ * Required - API name: {@code total}
+ */
+ @Nonnull
+ public final Builder total(Function> fn) {
+ return total(fn.apply(new ResourceStat.Builder()).build());
+ }
+
+ /**
+ * Builds a {@link ResourceStats}.
+ *
+ * @throws NullPointerException if some of the required fields are null.
+ */
+ @Override
+ @Nonnull
+ public ResourceStats build() {
+ _checkSingleUse();
+
+ return new ResourceStats(this);
+ }
+ }
+
+ // ---------------------------------------------------------------------------------------------
+
+ /**
+ * Json deserializer for {@link ResourceStats}
+ */
+ public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer.lazy(
+ Builder::new,
+ ResourceStats::setupResourceStatsDeserializer
+ );
+
+ protected static void setupResourceStatsDeserializer(ObjectDeserializer op) {
+ op.add(Builder::average, ResourceStat._DESERIALIZER, "average");
+ op.add(Builder::max, ResourceStat._DESERIALIZER, "max");
+ op.add(Builder::min, ResourceStat._DESERIALIZER, "min");
+ op.add(Builder::threadInfo, ThreadInfo._DESERIALIZER, "thread_info");
+ op.add(Builder::total, ResourceStat._DESERIALIZER, "total");
+ }
+
+ @Override
+ public int hashCode() {
+ int result = 17;
+ result = 31 * result + this.average.hashCode();
+ result = 31 * result + this.max.hashCode();
+ result = 31 * result + this.min.hashCode();
+ result = 31 * result + this.threadInfo.hashCode();
+ result = 31 * result + this.total.hashCode();
+ return result;
+ }
+
+ @Override
+ public boolean equals(Object o) {
+ if (this == o) return true;
+ if (o == null || this.getClass() != o.getClass()) return false;
+ ResourceStats other = (ResourceStats) o;
+ return this.average.equals(other.average)
+ && this.max.equals(other.max)
+ && this.min.equals(other.min)
+ && this.threadInfo.equals(other.threadInfo)
+ && this.total.equals(other.total);
+ }
+}
diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/Script.java b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/Script.java
index 811438381d..a15e98f626 100644
--- a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/Script.java
+++ b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/Script.java
@@ -40,12 +40,15 @@
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.opensearch._types.query_dsl.IntervalsFilter;
+import org.opensearch.client.opensearch._types.query_dsl.IntervalsFilterVariant;
import org.opensearch.client.util.ApiTypeHelper;
import org.opensearch.client.util.ObjectBuilder;
import org.opensearch.client.util.ObjectBuilderBase;
@@ -56,7 +59,7 @@
@JsonpDeserializable
@Generated("org.opensearch.client.codegen.CodeGenerator")
-public class Script implements TaggedUnion, PlainJsonSerializable {
+public class Script implements TaggedUnion, IntervalsFilterVariant, PlainJsonSerializable {
/**
* {@link Script} variant kinds.
*/
@@ -65,6 +68,14 @@ public enum Kind {
Stored
}
+ /**
+ * {@link IntervalsFilter} variant kind.
+ */
+ @Override
+ public IntervalsFilter.Kind _intervalsFilterKind() {
+ return IntervalsFilter.Kind.Script;
+ }
+
private final Kind _kind;
private final Object _value;
@@ -131,10 +142,27 @@ public void serialize(JsonGenerator generator, JsonpMapper mapper) {
}
}
+ @Nonnull
+ public Builder toBuilder() {
+ return new Builder(this);
+ }
+
+ @Nonnull
+ public static Builder builder() {
+ return new Builder();
+ }
+
public static class Builder extends ObjectBuilderBase implements ObjectBuilder