> fn) {
- return this.completion(fn.apply(new CompletionStats.Builder()).build());
+ return completion(fn.apply(new CompletionStats.Builder()).build());
}
/**
- * Required - Total number of indices with shards assigned to selected nodes.
+ * Total number of indexes with shards assigned to selected nodes.
*
* API name: {@code count}
+ *
*/
- public final Builder count(long value) {
+ @Nonnull
+ public final Builder count(@Nullable Long value) {
this.count = value;
return this;
}
/**
- * Required - Contains counts for documents in selected nodes.
- *
* API name: {@code docs}
*/
- public final Builder docs(DocStats value) {
+ @Nonnull
+ public final Builder docs(@Nullable DocStats value) {
this.docs = value;
return this;
}
/**
- * Required - Contains counts for documents in selected nodes.
- *
* API name: {@code docs}
*/
+ @Nonnull
public final Builder docs(Function> fn) {
- return this.docs(fn.apply(new DocStats.Builder()).build());
+ return docs(fn.apply(new DocStats.Builder()).build());
}
/**
- * Required - Contains statistics about the field data cache of selected nodes.
- *
* API name: {@code fielddata}
*/
- public final Builder fielddata(FielddataStats value) {
+ @Nonnull
+ public final Builder fielddata(@Nullable FielddataStats value) {
this.fielddata = value;
return this;
}
/**
- * Required - Contains statistics about the field data cache of selected nodes.
- *
* API name: {@code fielddata}
*/
+ @Nonnull
public final Builder fielddata(Function> fn) {
- return this.fielddata(fn.apply(new FielddataStats.Builder()).build());
+ return fielddata(fn.apply(new FielddataStats.Builder()).build());
+ }
+
+ /**
+ * API name: {@code mappings}
+ */
+ @Nonnull
+ public final Builder mappings(@Nullable FieldTypesMappings value) {
+ this.mappings = value;
+ return this;
+ }
+
+ /**
+ * API name: {@code mappings}
+ */
+ @Nonnull
+ public final Builder mappings(Function> fn) {
+ return mappings(fn.apply(new FieldTypesMappings.Builder()).build());
}
/**
- * Required - Contains statistics about the query cache of selected nodes.
- *
* API name: {@code query_cache}
*/
- public final Builder queryCache(QueryCacheStats value) {
+ @Nonnull
+ public final Builder queryCache(@Nullable QueryCacheStats value) {
this.queryCache = value;
return this;
}
/**
- * Required - Contains statistics about the query cache of selected nodes.
- *
* API name: {@code query_cache}
*/
+ @Nonnull
public final Builder queryCache(Function> fn) {
- return this.queryCache(fn.apply(new QueryCacheStats.Builder()).build());
+ return queryCache(fn.apply(new QueryCacheStats.Builder()).build());
}
/**
- * Required - Contains statistics about segments in selected nodes.
- *
* API name: {@code segments}
*/
- public final Builder segments(SegmentsStats value) {
+ @Nonnull
+ public final Builder segments(@Nullable SegmentsStats value) {
this.segments = value;
return this;
}
/**
- * Required - Contains statistics about segments in selected nodes.
- *
* API name: {@code segments}
*/
+ @Nonnull
public final Builder segments(Function> fn) {
- return this.segments(fn.apply(new SegmentsStats.Builder()).build());
+ return segments(fn.apply(new SegmentsStats.Builder()).build());
}
/**
- * Required - Contains statistics about indices with shards assigned to selected
- * nodes.
- *
* API name: {@code shards}
*/
- public final Builder shards(ClusterIndicesShards value) {
+ @Nonnull
+ public final Builder shards(@Nullable ClusterIndicesShards value) {
this.shards = value;
return this;
}
/**
- * Required - Contains statistics about indices with shards assigned to selected
- * nodes.
- *
* API name: {@code shards}
*/
+ @Nonnull
public final Builder shards(Function> fn) {
- return this.shards(fn.apply(new ClusterIndicesShards.Builder()).build());
+ return shards(fn.apply(new ClusterIndicesShards.Builder()).build());
}
/**
- * Required - Contains statistics about the size of shards assigned to selected
- * nodes.
- *
* API name: {@code store}
*/
- public final Builder store(StoreStats value) {
+ @Nonnull
+ public final Builder store(@Nullable StoreStats value) {
this.store = value;
return this;
}
/**
- * Required - Contains statistics about the size of shards assigned to selected
- * nodes.
- *
* API name: {@code store}
*/
+ @Nonnull
public final Builder store(Function> fn) {
- return this.store(fn.apply(new StoreStats.Builder()).build());
- }
-
- /**
- * Required - Contains statistics about field mappings in selected nodes.
- *
- * API name: {@code mappings}
- */
- public final Builder mappings(FieldTypesMappings value) {
- this.mappings = value;
- return this;
- }
-
- /**
- * Required - Contains statistics about field mappings in selected nodes.
- *
- * API name: {@code mappings}
- */
- public final Builder mappings(Function> fn) {
- return this.mappings(fn.apply(new FieldTypesMappings.Builder()).build());
- }
-
- /**
- * Required - Contains statistics about analyzers and analyzer components used
- * in selected nodes.
- *
- * API name: {@code analysis}
- */
- public final Builder analysis(CharFilterTypes value) {
- this.analysis = value;
- return this;
+ return store(fn.apply(new StoreStats.Builder()).build());
}
/**
- * Required - Contains statistics about analyzers and analyzer components used
- * in selected nodes.
+ * Contains statistics about analyzers and analyzer components used in selected nodes.
*
- * API name: {@code analysis}
- */
- public final Builder analysis(Function> fn) {
- return this.analysis(fn.apply(new CharFilterTypes.Builder()).build());
- }
-
- /**
* API name: {@code versions}
+ *
+ *
*
* Adds all elements of list
to versions
.
+ *
*/
+ @Nonnull
public final Builder versions(List list) {
this.versions = _listAddAll(this.versions, list);
return this;
}
/**
+ * Contains statistics about analyzers and analyzer components used in selected nodes.
+ *
* API name: {@code versions}
+ *
+ *
*
* Adds one or more values to versions
.
+ *
*/
+ @Nonnull
public final Builder versions(IndicesVersions value, IndicesVersions... values) {
this.versions = _listAdd(this.versions, value, values);
return this;
}
/**
+ * Contains statistics about analyzers and analyzer components used in selected nodes.
+ *
* API name: {@code versions}
+ *
+ *
*
* Adds a value to versions
using a builder lambda.
+ *
*/
+ @Nonnull
public final Builder versions(Function> fn) {
return versions(fn.apply(new IndicesVersions.Builder()).build());
}
@@ -506,9 +576,10 @@ public final Builder versions(Function op) {
-
+ op.add(Builder::analysis, CharFilterTypes._DESERIALIZER, "analysis");
op.add(Builder::completion, CompletionStats._DESERIALIZER, "completion");
op.add(Builder::count, JsonpDeserializer.longDeserializer(), "count");
op.add(Builder::docs, DocStats._DESERIALIZER, "docs");
op.add(Builder::fielddata, FielddataStats._DESERIALIZER, "fielddata");
+ op.add(Builder::mappings, FieldTypesMappings._DESERIALIZER, "mappings");
op.add(Builder::queryCache, QueryCacheStats._DESERIALIZER, "query_cache");
op.add(Builder::segments, SegmentsStats._DESERIALIZER, "segments");
op.add(Builder::shards, ClusterIndicesShards._DESERIALIZER, "shards");
op.add(Builder::store, StoreStats._DESERIALIZER, "store");
- op.add(Builder::mappings, FieldTypesMappings._DESERIALIZER, "mappings");
- op.add(Builder::analysis, CharFilterTypes._DESERIALIZER, "analysis");
op.add(Builder::versions, JsonpDeserializer.arrayDeserializer(IndicesVersions._DESERIALIZER), "versions");
+ }
+ @Override
+ public int hashCode() {
+ int result = 17;
+ result = 31 * result + Objects.hashCode(this.analysis);
+ result = 31 * result + Objects.hashCode(this.completion);
+ result = 31 * result + Objects.hashCode(this.count);
+ result = 31 * result + Objects.hashCode(this.docs);
+ result = 31 * result + Objects.hashCode(this.fielddata);
+ result = 31 * result + Objects.hashCode(this.mappings);
+ result = 31 * result + Objects.hashCode(this.queryCache);
+ result = 31 * result + Objects.hashCode(this.segments);
+ result = 31 * result + Objects.hashCode(this.shards);
+ result = 31 * result + Objects.hashCode(this.store);
+ result = 31 * result + Objects.hashCode(this.versions);
+ return result;
}
+ @Override
+ public boolean equals(Object o) {
+ if (this == o) return true;
+ if (o == null || this.getClass() != o.getClass()) return false;
+ ClusterIndices other = (ClusterIndices) o;
+ return Objects.equals(this.analysis, other.analysis)
+ && Objects.equals(this.completion, other.completion)
+ && Objects.equals(this.count, other.count)
+ && Objects.equals(this.docs, other.docs)
+ && Objects.equals(this.fielddata, other.fielddata)
+ && Objects.equals(this.mappings, other.mappings)
+ && Objects.equals(this.queryCache, other.queryCache)
+ && Objects.equals(this.segments, other.segments)
+ && Objects.equals(this.shards, other.shards)
+ && Objects.equals(this.store, other.store)
+ && Objects.equals(this.versions, other.versions);
+ }
}
diff --git a/java-client/src/main/java/org/opensearch/client/opensearch/cluster/stats/ClusterIndicesShards.java b/java-client/src/generated/java/org/opensearch/client/opensearch/cluster/stats/ClusterIndicesShards.java
similarity index 64%
rename from java-client/src/main/java/org/opensearch/client/opensearch/cluster/stats/ClusterIndicesShards.java
rename to java-client/src/generated/java/org/opensearch/client/opensearch/cluster/stats/ClusterIndicesShards.java
index e4137d918b..b6105431be 100644
--- a/java-client/src/main/java/org/opensearch/client/opensearch/cluster/stats/ClusterIndicesShards.java
+++ b/java-client/src/generated/java/org/opensearch/client/opensearch/cluster/stats/ClusterIndicesShards.java
@@ -30,10 +30,17 @@
* GitHub history for details.
*/
+//----------------------------------------------------
+// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST.
+//----------------------------------------------------
+
package org.opensearch.client.opensearch.cluster.stats;
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;
@@ -41,47 +48,43 @@
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: cluster.stats.ClusterIndicesShards
-/**
- * Contains statistics about shards assigned to selected nodes.
-*
- */
@JsonpDeserializable
-public class ClusterIndicesShards implements PlainJsonSerializable {
+@Generated("org.opensearch.client.codegen.CodeGenerator")
+public class ClusterIndicesShards implements PlainJsonSerializable, ToCopyableBuilder {
+
@Nullable
private final ClusterIndicesShardsIndex index;
@Nullable
- private final Double primaries;
+ private final Integer primaries;
@Nullable
- private final Double replication;
+ private final Integer replication;
@Nullable
- private final Double total;
+ private final Integer total;
// ---------------------------------------------------------------------------------------------
private ClusterIndicesShards(Builder builder) {
-
this.index = builder.index;
this.primaries = builder.primaries;
this.replication = builder.replication;
this.total = builder.total;
-
}
- public static ClusterIndicesShards of(Function> fn) {
+ public static ClusterIndicesShards of(Function> fn) {
return fn.apply(new Builder()).build();
}
/**
- * Contains statistics about shards assigned to selected nodes.
- *
* API name: {@code index}
*/
@Nullable
@@ -93,9 +96,10 @@ public final ClusterIndicesShardsIndex index() {
* Number of primary shards assigned to selected nodes.
*
* API name: {@code primaries}
+ *
*/
@Nullable
- public final Double primaries() {
+ public final Integer primaries() {
return this.primaries;
}
@@ -103,9 +107,10 @@ public final Double primaries() {
* Ratio of replica shards to primary shards across all selected nodes.
*
* API name: {@code replication}
+ *
*/
@Nullable
- public final Double replication() {
+ public final Integer replication() {
return this.replication;
}
@@ -113,15 +118,17 @@ public final Double replication() {
* Total number of shards assigned to selected nodes.
*
* API name: {@code total}
+ *
*/
@Nullable
- public final Double total() {
+ public final Integer total() {
return this.total;
}
/**
* Serialize this object to JSON.
*/
+ @Override
public void serialize(JsonGenerator generator, JsonpMapper mapper) {
generator.writeStartObject();
serializeInternal(generator, mapper);
@@ -129,74 +136,100 @@ public void serialize(JsonGenerator generator, JsonpMapper mapper) {
}
protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) {
-
if (this.index != null) {
generator.writeKey("index");
this.index.serialize(generator, mapper);
-
}
+
if (this.primaries != null) {
generator.writeKey("primaries");
generator.write(this.primaries);
-
}
+
if (this.replication != null) {
generator.writeKey("replication");
generator.write(this.replication);
-
}
+
if (this.total != null) {
generator.writeKey("total");
generator.write(this.total);
-
}
-
}
// ---------------------------------------------------------------------------------------------
+ @Override
+ @Nonnull
+ public Builder toBuilder() {
+ return new Builder(this);
+ }
+
+ @Nonnull
+ public static Builder builder() {
+ return new Builder();
+ }
+
/**
* Builder for {@link ClusterIndicesShards}.
*/
-
- public static class Builder extends ObjectBuilderBase implements ObjectBuilder {
+ public static class Builder extends ObjectBuilderBase implements CopyableBuilder {
@Nullable
private ClusterIndicesShardsIndex index;
-
@Nullable
- private Double primaries;
-
+ private Integer primaries;
@Nullable
- private Double replication;
-
+ private Integer replication;
@Nullable
- private Double total;
+ private Integer total;
+
+ public Builder() {}
+
+ private Builder(ClusterIndicesShards o) {
+ this.index = o.index;
+ this.primaries = o.primaries;
+ this.replication = o.replication;
+ this.total = o.total;
+ }
+
+ private Builder(Builder o) {
+ this.index = o.index;
+ this.primaries = o.primaries;
+ this.replication = o.replication;
+ this.total = o.total;
+ }
+
+ @Override
+ @Nonnull
+ public Builder copy() {
+ return new Builder(this);
+ }
/**
- * Contains statistics about shards assigned to selected nodes.
- *
* API name: {@code index}
*/
+ @Nonnull
public final Builder index(@Nullable ClusterIndicesShardsIndex value) {
this.index = value;
return this;
}
/**
- * Contains statistics about shards assigned to selected nodes.
- *
* API name: {@code index}
*/
+ @Nonnull
public final Builder index(Function> fn) {
- return this.index(fn.apply(new ClusterIndicesShardsIndex.Builder()).build());
+ return index(fn.apply(new ClusterIndicesShardsIndex.Builder()).build());
}
/**
* Number of primary shards assigned to selected nodes.
*
* API name: {@code primaries}
+ *
*/
- public final Builder primaries(@Nullable Double value) {
+ @Nonnull
+ public final Builder primaries(@Nullable Integer value) {
this.primaries = value;
return this;
}
@@ -205,8 +238,10 @@ public final Builder primaries(@Nullable Double value) {
* Ratio of replica shards to primary shards across all selected nodes.
*
* API name: {@code replication}
+ *
*/
- public final Builder replication(@Nullable Double value) {
+ @Nonnull
+ public final Builder replication(@Nullable Integer value) {
this.replication = value;
return this;
}
@@ -215,8 +250,10 @@ public final Builder replication(@Nullable Double value) {
* Total number of shards assigned to selected nodes.
*
* API name: {@code total}
+ *
*/
- public final Builder total(@Nullable Double value) {
+ @Nonnull
+ public final Builder total(@Nullable Integer value) {
this.total = value;
return this;
}
@@ -224,9 +261,10 @@ public final Builder total(@Nullable Double value) {
/**
* Builds a {@link ClusterIndicesShards}.
*
- * @throws NullPointerException
- * if some of the required fields are null.
+ * @throws NullPointerException if some of the required fields are null.
*/
+ @Override
+ @Nonnull
public ClusterIndicesShards build() {
_checkSingleUse();
@@ -245,12 +283,30 @@ public ClusterIndicesShards build() {
);
protected static void setupClusterIndicesShardsDeserializer(ObjectDeserializer op) {
-
op.add(Builder::index, ClusterIndicesShardsIndex._DESERIALIZER, "index");
- op.add(Builder::primaries, JsonpDeserializer.doubleDeserializer(), "primaries");
- op.add(Builder::replication, JsonpDeserializer.doubleDeserializer(), "replication");
- op.add(Builder::total, JsonpDeserializer.doubleDeserializer(), "total");
+ op.add(Builder::primaries, JsonpDeserializer.integerDeserializer(), "primaries");
+ op.add(Builder::replication, JsonpDeserializer.integerDeserializer(), "replication");
+ op.add(Builder::total, JsonpDeserializer.integerDeserializer(), "total");
+ }
+ @Override
+ public int hashCode() {
+ int result = 17;
+ result = 31 * result + Objects.hashCode(this.index);
+ result = 31 * result + Objects.hashCode(this.primaries);
+ result = 31 * result + Objects.hashCode(this.replication);
+ result = 31 * result + Objects.hashCode(this.total);
+ return result;
}
+ @Override
+ public boolean equals(Object o) {
+ if (this == o) return true;
+ if (o == null || this.getClass() != o.getClass()) return false;
+ ClusterIndicesShards other = (ClusterIndicesShards) o;
+ return Objects.equals(this.index, other.index)
+ && Objects.equals(this.primaries, other.primaries)
+ && Objects.equals(this.replication, other.replication)
+ && Objects.equals(this.total, other.total);
+ }
}
diff --git a/java-client/src/main/java/org/opensearch/client/opensearch/cluster/stats/ClusterIndicesShardsIndex.java b/java-client/src/generated/java/org/opensearch/client/opensearch/cluster/stats/ClusterIndicesShardsIndex.java
similarity index 68%
rename from java-client/src/main/java/org/opensearch/client/opensearch/cluster/stats/ClusterIndicesShardsIndex.java
rename to java-client/src/generated/java/org/opensearch/client/opensearch/cluster/stats/ClusterIndicesShardsIndex.java
index e0c709f48b..3d88fca2b4 100644
--- a/java-client/src/main/java/org/opensearch/client/opensearch/cluster/stats/ClusterIndicesShardsIndex.java
+++ b/java-client/src/generated/java/org/opensearch/client/opensearch/cluster/stats/ClusterIndicesShardsIndex.java
@@ -30,10 +30,16 @@
* GitHub history for details.
*/
+//----------------------------------------------------
+// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST.
+//----------------------------------------------------
+
package org.opensearch.client.opensearch.cluster.stats;
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,59 +47,70 @@
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: cluster.stats.ClusterIndicesShardsIndex
@JsonpDeserializable
-public class ClusterIndicesShardsIndex implements PlainJsonSerializable {
+@Generated("org.opensearch.client.codegen.CodeGenerator")
+public class ClusterIndicesShardsIndex
+ implements
+ PlainJsonSerializable,
+ ToCopyableBuilder {
+
+ @Nonnull
private final ClusterShardMetrics primaries;
+ @Nonnull
private final ClusterShardMetrics replication;
+ @Nonnull
private final ClusterShardMetrics shards;
// ---------------------------------------------------------------------------------------------
private ClusterIndicesShardsIndex(Builder builder) {
-
this.primaries = ApiTypeHelper.requireNonNull(builder.primaries, this, "primaries");
this.replication = ApiTypeHelper.requireNonNull(builder.replication, this, "replication");
this.shards = ApiTypeHelper.requireNonNull(builder.shards, this, "shards");
-
}
- public static ClusterIndicesShardsIndex of(Function> fn) {
+ public static ClusterIndicesShardsIndex of(Function> fn) {
return fn.apply(new Builder()).build();
}
/**
- * Required - Contains statistics about the number of primary shards assigned to
- * selected nodes.
+ * Required - Contains statistics about the number of primary shards assigned to selected nodes.
*
* API name: {@code primaries}
+ *
*/
+ @Nonnull
public final ClusterShardMetrics primaries() {
return this.primaries;
}
/**
- * Required - Contains statistics about the number of replication shards
- * assigned to selected nodes.
+ * Required - Contains statistics about the number of replication shards assigned to selected nodes.
*
* API name: {@code replication}
+ *
*/
+ @Nonnull
public final ClusterShardMetrics replication() {
return this.replication;
}
/**
- * Required - Contains statistics about the number of shards assigned to
- * selected nodes.
+ * Required - Contains statistics about the number of shards assigned to selected nodes.
*
* API name: {@code shards}
+ *
*/
+ @Nonnull
public final ClusterShardMetrics shards() {
return this.shards;
}
@@ -101,6 +118,7 @@ public final ClusterShardMetrics shards() {
/**
* Serialize this object to JSON.
*/
+ @Override
public void serialize(JsonGenerator generator, JsonpMapper mapper) {
generator.writeStartObject();
serializeInternal(generator, mapper);
@@ -108,7 +126,6 @@ public void serialize(JsonGenerator generator, JsonpMapper mapper) {
}
protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) {
-
generator.writeKey("primaries");
this.primaries.serialize(generator, mapper);
@@ -117,91 +134,125 @@ protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) {
generator.writeKey("shards");
this.shards.serialize(generator, mapper);
-
}
// ---------------------------------------------------------------------------------------------
+ @Override
+ @Nonnull
+ public Builder toBuilder() {
+ return new Builder(this);
+ }
+
+ @Nonnull
+ public static Builder builder() {
+ return new Builder();
+ }
+
/**
* Builder for {@link ClusterIndicesShardsIndex}.
*/
-
- public static class Builder extends ObjectBuilderBase implements ObjectBuilder {
+ public static class Builder extends ObjectBuilderBase implements CopyableBuilder {
private ClusterShardMetrics primaries;
-
private ClusterShardMetrics replication;
-
private ClusterShardMetrics shards;
+ public Builder() {}
+
+ private Builder(ClusterIndicesShardsIndex o) {
+ this.primaries = o.primaries;
+ this.replication = o.replication;
+ this.shards = o.shards;
+ }
+
+ private Builder(Builder o) {
+ this.primaries = o.primaries;
+ this.replication = o.replication;
+ this.shards = o.shards;
+ }
+
+ @Override
+ @Nonnull
+ public Builder copy() {
+ return new Builder(this);
+ }
+
/**
- * Required - Contains statistics about the number of primary shards assigned to
- * selected nodes.
+ * Required - Contains statistics about the number of primary shards assigned to selected nodes.
*
* API name: {@code primaries}
+ *
*/
+ @Nonnull
public final Builder primaries(ClusterShardMetrics value) {
this.primaries = value;
return this;
}
/**
- * Required - Contains statistics about the number of primary shards assigned to
- * selected nodes.
+ * Required - Contains statistics about the number of primary shards assigned to selected nodes.
*
* API name: {@code primaries}
+ *
*/
+ @Nonnull
public final Builder primaries(Function> fn) {
- return this.primaries(fn.apply(new ClusterShardMetrics.Builder()).build());
+ return primaries(fn.apply(new ClusterShardMetrics.Builder()).build());
}
/**
- * Required - Contains statistics about the number of replication shards
- * assigned to selected nodes.
+ * Required - Contains statistics about the number of replication shards assigned to selected nodes.
*
* API name: {@code replication}
+ *
*/
+ @Nonnull
public final Builder replication(ClusterShardMetrics value) {
this.replication = value;
return this;
}
/**
- * Required - Contains statistics about the number of replication shards
- * assigned to selected nodes.
+ * Required - Contains statistics about the number of replication shards assigned to selected nodes.
*
* API name: {@code replication}
+ *
*/
+ @Nonnull
public final Builder replication(Function> fn) {
- return this.replication(fn.apply(new ClusterShardMetrics.Builder()).build());
+ return replication(fn.apply(new ClusterShardMetrics.Builder()).build());
}
/**
- * Required - Contains statistics about the number of shards assigned to
- * selected nodes.
+ * Required - Contains statistics about the number of shards assigned to selected nodes.
*
* API name: {@code shards}
+ *
*/
+ @Nonnull
public final Builder shards(ClusterShardMetrics value) {
this.shards = value;
return this;
}
/**
- * Required - Contains statistics about the number of shards assigned to
- * selected nodes.
+ * Required - Contains statistics about the number of shards assigned to selected nodes.
*
* API name: {@code shards}
+ *
*/
+ @Nonnull
public final Builder shards(Function> fn) {
- return this.shards(fn.apply(new ClusterShardMetrics.Builder()).build());
+ return shards(fn.apply(new ClusterShardMetrics.Builder()).build());
}
/**
* Builds a {@link ClusterIndicesShardsIndex}.
*
- * @throws NullPointerException
- * if some of the required fields are null.
+ * @throws NullPointerException if some of the required fields are null.
*/
+ @Override
+ @Nonnull
public ClusterIndicesShardsIndex build() {
_checkSingleUse();
@@ -220,11 +271,25 @@ public ClusterIndicesShardsIndex build() {
);
protected static void setupClusterIndicesShardsIndexDeserializer(ObjectDeserializer op) {
-
op.add(Builder::primaries, ClusterShardMetrics._DESERIALIZER, "primaries");
op.add(Builder::replication, ClusterShardMetrics._DESERIALIZER, "replication");
op.add(Builder::shards, ClusterShardMetrics._DESERIALIZER, "shards");
+ }
+ @Override
+ public int hashCode() {
+ int result = 17;
+ result = 31 * result + this.primaries.hashCode();
+ result = 31 * result + this.replication.hashCode();
+ result = 31 * result + this.shards.hashCode();
+ return result;
}
+ @Override
+ public boolean equals(Object o) {
+ if (this == o) return true;
+ if (o == null || this.getClass() != o.getClass()) return false;
+ ClusterIndicesShardsIndex other = (ClusterIndicesShardsIndex) o;
+ return this.primaries.equals(other.primaries) && this.replication.equals(other.replication) && this.shards.equals(other.shards);
+ }
}
diff --git a/java-client/src/main/java/org/opensearch/client/opensearch/cluster/stats/ClusterIngest.java b/java-client/src/generated/java/org/opensearch/client/opensearch/cluster/stats/ClusterIngest.java
similarity index 67%
rename from java-client/src/main/java/org/opensearch/client/opensearch/cluster/stats/ClusterIngest.java
rename to java-client/src/generated/java/org/opensearch/client/opensearch/cluster/stats/ClusterIngest.java
index 5edf71cbd4..34e8ea63a8 100644
--- a/java-client/src/main/java/org/opensearch/client/opensearch/cluster/stats/ClusterIngest.java
+++ b/java-client/src/generated/java/org/opensearch/client/opensearch/cluster/stats/ClusterIngest.java
@@ -30,11 +30,17 @@
* GitHub history for details.
*/
+//----------------------------------------------------
+// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST.
+//----------------------------------------------------
+
package org.opensearch.client.opensearch.cluster.stats;
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;
@@ -42,27 +48,30 @@
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: cluster.stats.ClusterIngest
@JsonpDeserializable
-public class ClusterIngest implements PlainJsonSerializable {
+@Generated("org.opensearch.client.codegen.CodeGenerator")
+public class ClusterIngest implements PlainJsonSerializable, ToCopyableBuilder {
+
private final int numberOfPipelines;
+ @Nonnull
private final Map processorStats;
// ---------------------------------------------------------------------------------------------
private ClusterIngest(Builder builder) {
-
this.numberOfPipelines = ApiTypeHelper.requireNonNull(builder.numberOfPipelines, this, "numberOfPipelines");
this.processorStats = ApiTypeHelper.unmodifiableRequired(builder.processorStats, this, "processorStats");
-
}
- public static ClusterIngest of(Function> fn) {
+ public static ClusterIngest of(Function> fn) {
return fn.apply(new Builder()).build();
}
@@ -76,6 +85,7 @@ public final int numberOfPipelines() {
/**
* Required - API name: {@code processor_stats}
*/
+ @Nonnull
public final Map processorStats() {
return this.processorStats;
}
@@ -83,6 +93,7 @@ public final Map processorStats() {
/**
* Serialize this object to JSON.
*/
+ @Override
public void serialize(JsonGenerator generator, JsonpMapper mapper) {
generator.writeStartObject();
serializeInternal(generator, mapper);
@@ -90,38 +101,60 @@ public void serialize(JsonGenerator generator, JsonpMapper mapper) {
}
protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) {
-
generator.writeKey("number_of_pipelines");
generator.write(this.numberOfPipelines);
- if (ApiTypeHelper.isDefined(this.processorStats)) {
- generator.writeKey("processor_stats");
- generator.writeStartObject();
- for (Map.Entry item0 : this.processorStats.entrySet()) {
- generator.writeKey(item0.getKey());
- item0.getValue().serialize(generator, mapper);
-
- }
- generator.writeEnd();
-
+ generator.writeKey("processor_stats");
+ generator.writeStartObject();
+ for (Map.Entry item0 : this.processorStats.entrySet()) {
+ generator.writeKey(item0.getKey());
+ item0.getValue().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 ClusterIngest}.
*/
-
- public static class Builder extends ObjectBuilderBase implements ObjectBuilder {
+ public static class Builder extends ObjectBuilderBase implements CopyableBuilder {
private Integer numberOfPipelines;
-
private Map processorStats;
+ public Builder() {}
+
+ private Builder(ClusterIngest o) {
+ this.numberOfPipelines = o.numberOfPipelines;
+ this.processorStats = _mapCopy(o.processorStats);
+ }
+
+ private Builder(Builder o) {
+ this.numberOfPipelines = o.numberOfPipelines;
+ this.processorStats = _mapCopy(o.processorStats);
+ }
+
+ @Override
+ @Nonnull
+ public Builder copy() {
+ return new Builder(this);
+ }
+
/**
* Required - API name: {@code number_of_pipelines}
*/
+ @Nonnull
public final Builder numberOfPipelines(int value) {
this.numberOfPipelines = value;
return this;
@@ -129,9 +162,12 @@ public final Builder numberOfPipelines(int value) {
/**
* Required - API name: {@code processor_stats}
+ *
*
- * Adds all entries of map
to processorStats
.
+ * Adds all elements of map
to processorStats
.
+ *
*/
+ @Nonnull
public final Builder processorStats(Map map) {
this.processorStats = _mapPutAll(this.processorStats, map);
return this;
@@ -139,9 +175,12 @@ public final Builder processorStats(Map map) {
/**
* Required - API name: {@code processor_stats}
+ *
*
* Adds an entry to processorStats
.
+ *
*/
+ @Nonnull
public final Builder processorStats(String key, ClusterProcessor value) {
this.processorStats = _mapPut(this.processorStats, key, value);
return this;
@@ -149,9 +188,12 @@ public final Builder processorStats(String key, ClusterProcessor value) {
/**
* Required - API name: {@code processor_stats}
+ *
*
- * Adds an entry to processorStats
using a builder lambda.
+ * Adds a value to processorStats
using a builder lambda.
+ *
*/
+ @Nonnull
public final Builder processorStats(String key, Function> fn) {
return processorStats(key, fn.apply(new ClusterProcessor.Builder()).build());
}
@@ -159,9 +201,10 @@ public final Builder processorStats(String key, Function op) {
-
op.add(Builder::numberOfPipelines, JsonpDeserializer.integerDeserializer(), "number_of_pipelines");
op.add(Builder::processorStats, JsonpDeserializer.stringMapDeserializer(ClusterProcessor._DESERIALIZER), "processor_stats");
+ }
+ @Override
+ public int hashCode() {
+ int result = 17;
+ result = 31 * result + Integer.hashCode(this.numberOfPipelines);
+ result = 31 * result + this.processorStats.hashCode();
+ return result;
}
+ @Override
+ public boolean equals(Object o) {
+ if (this == o) return true;
+ if (o == null || this.getClass() != o.getClass()) return false;
+ ClusterIngest other = (ClusterIngest) o;
+ return this.numberOfPipelines == other.numberOfPipelines && this.processorStats.equals(other.processorStats);
+ }
}
diff --git a/java-client/src/main/java/org/opensearch/client/opensearch/cluster/stats/ClusterJvm.java b/java-client/src/generated/java/org/opensearch/client/opensearch/cluster/stats/ClusterJvm.java
similarity index 57%
rename from java-client/src/main/java/org/opensearch/client/opensearch/cluster/stats/ClusterJvm.java
rename to java-client/src/generated/java/org/opensearch/client/opensearch/cluster/stats/ClusterJvm.java
index 78493245ee..20c6128354 100644
--- a/java-client/src/main/java/org/opensearch/client/opensearch/cluster/stats/ClusterJvm.java
+++ b/java-client/src/generated/java/org/opensearch/client/opensearch/cluster/stats/ClusterJvm.java
@@ -30,48 +30,73 @@
* GitHub history for details.
*/
+//----------------------------------------------------
+// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST.
+//----------------------------------------------------
+
package org.opensearch.client.opensearch.cluster.stats;
import jakarta.json.stream.JsonGenerator;
import java.util.List;
+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.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: cluster.stats.ClusterJvm
@JsonpDeserializable
-public class ClusterJvm implements PlainJsonSerializable {
+@Generated("org.opensearch.client.codegen.CodeGenerator")
+public class ClusterJvm implements PlainJsonSerializable, ToCopyableBuilder {
+
+ @Nullable
+ private final Time maxUptime;
+
private final long maxUptimeInMillis;
+ @Nonnull
private final ClusterJvmMemory mem;
private final long threads;
+ @Nonnull
private final List versions;
// ---------------------------------------------------------------------------------------------
private ClusterJvm(Builder builder) {
-
+ this.maxUptime = builder.maxUptime;
this.maxUptimeInMillis = ApiTypeHelper.requireNonNull(builder.maxUptimeInMillis, this, "maxUptimeInMillis");
this.mem = ApiTypeHelper.requireNonNull(builder.mem, this, "mem");
this.threads = ApiTypeHelper.requireNonNull(builder.threads, this, "threads");
this.versions = ApiTypeHelper.unmodifiableRequired(builder.versions, this, "versions");
-
}
- public static ClusterJvm of(Function> fn) {
+ public static ClusterJvm of(Function> fn) {
return fn.apply(new Builder()).build();
}
+ /**
+ * API name: {@code max_uptime}
+ */
+ @Nullable
+ public final Time maxUptime() {
+ return this.maxUptime;
+ }
+
/**
* Required - API name: {@code max_uptime_in_millis}
*/
@@ -82,20 +107,28 @@ public final long maxUptimeInMillis() {
/**
* Required - API name: {@code mem}
*/
+ @Nonnull
public final ClusterJvmMemory mem() {
return this.mem;
}
/**
- * Required - API name: {@code threads}
+ * Required - Number of active threads in use by JVM across all selected nodes.
+ *
+ * API name: {@code threads}
+ *
*/
public final long threads() {
return this.threads;
}
/**
- * Required - API name: {@code versions}
+ * Required - Contains statistics about the JVM versions used by selected nodes.
+ *
+ * API name: {@code versions}
+ *
*/
+ @Nonnull
public final List versions() {
return this.versions;
}
@@ -103,6 +136,7 @@ public final List versions() {
/**
* Serialize this object to JSON.
*/
+ @Override
public void serialize(JsonGenerator generator, JsonpMapper mapper) {
generator.writeStartObject();
serializeInternal(generator, mapper);
@@ -110,6 +144,10 @@ public void serialize(JsonGenerator generator, JsonpMapper mapper) {
}
protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) {
+ if (this.maxUptime != null) {
+ generator.writeKey("max_uptime");
+ this.maxUptime.serialize(generator, mapper);
+ }
generator.writeKey("max_uptime_in_millis");
generator.write(this.maxUptimeInMillis);
@@ -120,37 +158,83 @@ protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) {
generator.writeKey("threads");
generator.write(this.threads);
- if (ApiTypeHelper.isDefined(this.versions)) {
- generator.writeKey("versions");
- generator.writeStartArray();
- for (ClusterJvmVersion item0 : this.versions) {
- item0.serialize(generator, mapper);
-
- }
- generator.writeEnd();
-
+ generator.writeKey("versions");
+ generator.writeStartArray();
+ for (ClusterJvmVersion item0 : this.versions) {
+ 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 ClusterJvm}.
*/
-
- public static class Builder extends ObjectBuilderBase implements ObjectBuilder {
+ public static class Builder extends ObjectBuilderBase implements CopyableBuilder {
+ @Nullable
+ private Time maxUptime;
private Long maxUptimeInMillis;
-
private ClusterJvmMemory mem;
-
private Long threads;
-
private List versions;
+ public Builder() {}
+
+ private Builder(ClusterJvm o) {
+ this.maxUptime = o.maxUptime;
+ this.maxUptimeInMillis = o.maxUptimeInMillis;
+ this.mem = o.mem;
+ this.threads = o.threads;
+ this.versions = _listCopy(o.versions);
+ }
+
+ private Builder(Builder o) {
+ this.maxUptime = o.maxUptime;
+ this.maxUptimeInMillis = o.maxUptimeInMillis;
+ this.mem = o.mem;
+ this.threads = o.threads;
+ this.versions = _listCopy(o.versions);
+ }
+
+ @Override
+ @Nonnull
+ public Builder copy() {
+ return new Builder(this);
+ }
+
+ /**
+ * API name: {@code max_uptime}
+ */
+ @Nonnull
+ public final Builder maxUptime(@Nullable Time value) {
+ this.maxUptime = value;
+ return this;
+ }
+
+ /**
+ * API name: {@code max_uptime}
+ */
+ @Nonnull
+ public final Builder maxUptime(Function> fn) {
+ return maxUptime(fn.apply(new Time.Builder()).build());
+ }
+
/**
* Required - API name: {@code max_uptime_in_millis}
*/
+ @Nonnull
public final Builder maxUptimeInMillis(long value) {
this.maxUptimeInMillis = value;
return this;
@@ -159,6 +243,7 @@ public final Builder maxUptimeInMillis(long value) {
/**
* Required - API name: {@code mem}
*/
+ @Nonnull
public final Builder mem(ClusterJvmMemory value) {
this.mem = value;
return this;
@@ -167,43 +252,66 @@ public final Builder mem(ClusterJvmMemory value) {
/**
* Required - API name: {@code mem}
*/
+ @Nonnull
public final Builder mem(Function> fn) {
- return this.mem(fn.apply(new ClusterJvmMemory.Builder()).build());
+ return mem(fn.apply(new ClusterJvmMemory.Builder()).build());
}
/**
- * Required - API name: {@code threads}
+ * Required - Number of active threads in use by JVM across all selected nodes.
+ *
+ * API name: {@code threads}
+ *
*/
+ @Nonnull
public final Builder threads(long value) {
this.threads = value;
return this;
}
/**
- * Required - API name: {@code versions}
+ * Required - Contains statistics about the JVM versions used by selected nodes.
+ *
+ * API name: {@code versions}
+ *
+ *
*
* Adds all elements of list
to versions
.
+ *
*/
+ @Nonnull
public final Builder versions(List list) {
this.versions = _listAddAll(this.versions, list);
return this;
}
/**
- * Required - API name: {@code versions}
+ * Required - Contains statistics about the JVM versions used by selected nodes.
+ *
+ * API name: {@code versions}
+ *
+ *
*
* Adds one or more values to versions
.
+ *
*/
+ @Nonnull
public final Builder versions(ClusterJvmVersion value, ClusterJvmVersion... values) {
this.versions = _listAdd(this.versions, value, values);
return this;
}
/**
- * Required - API name: {@code versions}
+ * Required - Contains statistics about the JVM versions used by selected nodes.
+ *
+ * API name: {@code versions}
+ *
+ *
*
* Adds a value to versions
using a builder lambda.
+ *
*/
+ @Nonnull
public final Builder versions(Function> fn) {
return versions(fn.apply(new ClusterJvmVersion.Builder()).build());
}
@@ -211,9 +319,10 @@ public final Builder versions(Function op) {
-
+ op.add(Builder::maxUptime, Time._DESERIALIZER, "max_uptime");
op.add(Builder::maxUptimeInMillis, JsonpDeserializer.longDeserializer(), "max_uptime_in_millis");
op.add(Builder::mem, ClusterJvmMemory._DESERIALIZER, "mem");
op.add(Builder::threads, JsonpDeserializer.longDeserializer(), "threads");
op.add(Builder::versions, JsonpDeserializer.arrayDeserializer(ClusterJvmVersion._DESERIALIZER), "versions");
+ }
+ @Override
+ public int hashCode() {
+ int result = 17;
+ result = 31 * result + Objects.hashCode(this.maxUptime);
+ result = 31 * result + Long.hashCode(this.maxUptimeInMillis);
+ result = 31 * result + this.mem.hashCode();
+ result = 31 * result + Long.hashCode(this.threads);
+ result = 31 * result + this.versions.hashCode();
+ return result;
}
+ @Override
+ public boolean equals(Object o) {
+ if (this == o) return true;
+ if (o == null || this.getClass() != o.getClass()) return false;
+ ClusterJvm other = (ClusterJvm) o;
+ return Objects.equals(this.maxUptime, other.maxUptime)
+ && this.maxUptimeInMillis == other.maxUptimeInMillis
+ && this.mem.equals(other.mem)
+ && this.threads == other.threads
+ && this.versions.equals(other.versions);
+ }
}
diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/cluster/stats/ClusterJvmMemory.java b/java-client/src/generated/java/org/opensearch/client/opensearch/cluster/stats/ClusterJvmMemory.java
new file mode 100644
index 0000000000..5f5f2b214c
--- /dev/null
+++ b/java-client/src/generated/java/org/opensearch/client/opensearch/cluster/stats/ClusterJvmMemory.java
@@ -0,0 +1,301 @@
+/*
+ * 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.cluster.stats;
+
+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.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: cluster.stats.ClusterJvmMemory
+
+@JsonpDeserializable
+@Generated("org.opensearch.client.codegen.CodeGenerator")
+public class ClusterJvmMemory implements PlainJsonSerializable, ToCopyableBuilder {
+
+ @Nullable
+ private final String heapMax;
+
+ private final long heapMaxInBytes;
+
+ @Nullable
+ private final String heapUsed;
+
+ private final long heapUsedInBytes;
+
+ // ---------------------------------------------------------------------------------------------
+
+ private ClusterJvmMemory(Builder builder) {
+ this.heapMax = builder.heapMax;
+ this.heapMaxInBytes = ApiTypeHelper.requireNonNull(builder.heapMaxInBytes, this, "heapMaxInBytes");
+ this.heapUsed = builder.heapUsed;
+ this.heapUsedInBytes = ApiTypeHelper.requireNonNull(builder.heapUsedInBytes, this, "heapUsedInBytes");
+ }
+
+ public static ClusterJvmMemory of(Function> fn) {
+ return fn.apply(new Builder()).build();
+ }
+
+ /**
+ * Maximum amount of memory available for use by the heap across all selected nodes.
+ *
+ * API name: {@code heap_max}
+ *
+ */
+ @Nullable
+ public final String heapMax() {
+ return this.heapMax;
+ }
+
+ /**
+ * Required - Maximum amount of memory, in bytes, available for use by the heap across all selected nodes.
+ *
+ * API name: {@code heap_max_in_bytes}
+ *
+ */
+ public final long heapMaxInBytes() {
+ return this.heapMaxInBytes;
+ }
+
+ /**
+ * Memory currently in use by the heap across all selected nodes.
+ *
+ * API name: {@code heap_used}
+ *
+ */
+ @Nullable
+ public final String heapUsed() {
+ return this.heapUsed;
+ }
+
+ /**
+ * Required - Memory, in bytes, currently in use by the heap across all selected nodes.
+ *
+ * API name: {@code heap_used_in_bytes}
+ *
+ */
+ public final long heapUsedInBytes() {
+ return this.heapUsedInBytes;
+ }
+
+ /**
+ * 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.heapMax != null) {
+ generator.writeKey("heap_max");
+ generator.write(this.heapMax);
+ }
+
+ generator.writeKey("heap_max_in_bytes");
+ generator.write(this.heapMaxInBytes);
+
+ if (this.heapUsed != null) {
+ generator.writeKey("heap_used");
+ generator.write(this.heapUsed);
+ }
+
+ generator.writeKey("heap_used_in_bytes");
+ generator.write(this.heapUsedInBytes);
+ }
+
+ // ---------------------------------------------------------------------------------------------
+
+ @Override
+ @Nonnull
+ public Builder toBuilder() {
+ return new Builder(this);
+ }
+
+ @Nonnull
+ public static Builder builder() {
+ return new Builder();
+ }
+
+ /**
+ * Builder for {@link ClusterJvmMemory}.
+ */
+ public static class Builder extends ObjectBuilderBase implements CopyableBuilder {
+ @Nullable
+ private String heapMax;
+ private Long heapMaxInBytes;
+ @Nullable
+ private String heapUsed;
+ private Long heapUsedInBytes;
+
+ public Builder() {}
+
+ private Builder(ClusterJvmMemory o) {
+ this.heapMax = o.heapMax;
+ this.heapMaxInBytes = o.heapMaxInBytes;
+ this.heapUsed = o.heapUsed;
+ this.heapUsedInBytes = o.heapUsedInBytes;
+ }
+
+ private Builder(Builder o) {
+ this.heapMax = o.heapMax;
+ this.heapMaxInBytes = o.heapMaxInBytes;
+ this.heapUsed = o.heapUsed;
+ this.heapUsedInBytes = o.heapUsedInBytes;
+ }
+
+ @Override
+ @Nonnull
+ public Builder copy() {
+ return new Builder(this);
+ }
+
+ /**
+ * Maximum amount of memory available for use by the heap across all selected nodes.
+ *
+ * API name: {@code heap_max}
+ *
+ */
+ @Nonnull
+ public final Builder heapMax(@Nullable String value) {
+ this.heapMax = value;
+ return this;
+ }
+
+ /**
+ * Required - Maximum amount of memory, in bytes, available for use by the heap across all selected nodes.
+ *
+ * API name: {@code heap_max_in_bytes}
+ *
+ */
+ @Nonnull
+ public final Builder heapMaxInBytes(long value) {
+ this.heapMaxInBytes = value;
+ return this;
+ }
+
+ /**
+ * Memory currently in use by the heap across all selected nodes.
+ *
+ * API name: {@code heap_used}
+ *
+ */
+ @Nonnull
+ public final Builder heapUsed(@Nullable String value) {
+ this.heapUsed = value;
+ return this;
+ }
+
+ /**
+ * Required - Memory, in bytes, currently in use by the heap across all selected nodes.
+ *
+ * API name: {@code heap_used_in_bytes}
+ *
+ */
+ @Nonnull
+ public final Builder heapUsedInBytes(long value) {
+ this.heapUsedInBytes = value;
+ return this;
+ }
+
+ /**
+ * Builds a {@link ClusterJvmMemory}.
+ *
+ * @throws NullPointerException if some of the required fields are null.
+ */
+ @Override
+ @Nonnull
+ public ClusterJvmMemory build() {
+ _checkSingleUse();
+
+ return new ClusterJvmMemory(this);
+ }
+ }
+
+ // ---------------------------------------------------------------------------------------------
+
+ /**
+ * Json deserializer for {@link ClusterJvmMemory}
+ */
+ public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer.lazy(
+ Builder::new,
+ ClusterJvmMemory::setupClusterJvmMemoryDeserializer
+ );
+
+ protected static void setupClusterJvmMemoryDeserializer(ObjectDeserializer op) {
+ op.add(Builder::heapMax, JsonpDeserializer.stringDeserializer(), "heap_max");
+ op.add(Builder::heapMaxInBytes, JsonpDeserializer.longDeserializer(), "heap_max_in_bytes");
+ op.add(Builder::heapUsed, JsonpDeserializer.stringDeserializer(), "heap_used");
+ op.add(Builder::heapUsedInBytes, JsonpDeserializer.longDeserializer(), "heap_used_in_bytes");
+ }
+
+ @Override
+ public int hashCode() {
+ int result = 17;
+ result = 31 * result + Objects.hashCode(this.heapMax);
+ result = 31 * result + Long.hashCode(this.heapMaxInBytes);
+ result = 31 * result + Objects.hashCode(this.heapUsed);
+ result = 31 * result + Long.hashCode(this.heapUsedInBytes);
+ return result;
+ }
+
+ @Override
+ public boolean equals(Object o) {
+ if (this == o) return true;
+ if (o == null || this.getClass() != o.getClass()) return false;
+ ClusterJvmMemory other = (ClusterJvmMemory) o;
+ return Objects.equals(this.heapMax, other.heapMax)
+ && this.heapMaxInBytes == other.heapMaxInBytes
+ && Objects.equals(this.heapUsed, other.heapUsed)
+ && this.heapUsedInBytes == other.heapUsedInBytes;
+ }
+}
diff --git a/java-client/src/main/java/org/opensearch/client/opensearch/cluster/stats/ClusterJvmVersion.java b/java-client/src/generated/java/org/opensearch/client/opensearch/cluster/stats/ClusterJvmVersion.java
similarity index 63%
rename from java-client/src/main/java/org/opensearch/client/opensearch/cluster/stats/ClusterJvmVersion.java
rename to java-client/src/generated/java/org/opensearch/client/opensearch/cluster/stats/ClusterJvmVersion.java
index cc366a9f80..85caafb241 100644
--- a/java-client/src/main/java/org/opensearch/client/opensearch/cluster/stats/ClusterJvmVersion.java
+++ b/java-client/src/generated/java/org/opensearch/client/opensearch/cluster/stats/ClusterJvmVersion.java
@@ -30,10 +30,16 @@
* GitHub history for details.
*/
+//----------------------------------------------------
+// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST.
+//----------------------------------------------------
+
package org.opensearch.client.opensearch.cluster.stats;
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,31 +47,38 @@
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: cluster.stats.ClusterJvmVersion
@JsonpDeserializable
-public class ClusterJvmVersion implements PlainJsonSerializable {
+@Generated("org.opensearch.client.codegen.CodeGenerator")
+public class ClusterJvmVersion implements PlainJsonSerializable, ToCopyableBuilder {
+
private final boolean bundledJdk;
private final int count;
private final boolean usingBundledJdk;
+ @Nonnull
private final String version;
+ @Nonnull
private final String vmName;
+ @Nonnull
private final String vmVendor;
+ @Nonnull
private final String vmVersion;
// ---------------------------------------------------------------------------------------------
private ClusterJvmVersion(Builder builder) {
-
this.bundledJdk = ApiTypeHelper.requireNonNull(builder.bundledJdk, this, "bundledJdk");
this.count = ApiTypeHelper.requireNonNull(builder.count, this, "count");
this.usingBundledJdk = ApiTypeHelper.requireNonNull(builder.usingBundledJdk, this, "usingBundledJdk");
@@ -73,29 +86,37 @@ private ClusterJvmVersion(Builder builder) {
this.vmName = ApiTypeHelper.requireNonNull(builder.vmName, this, "vmName");
this.vmVendor = ApiTypeHelper.requireNonNull(builder.vmVendor, this, "vmVendor");
this.vmVersion = ApiTypeHelper.requireNonNull(builder.vmVersion, this, "vmVersion");
-
}
- public static ClusterJvmVersion of(Function> fn) {
+ public static ClusterJvmVersion of(Function> fn) {
return fn.apply(new Builder()).build();
}
/**
- * Required - API name: {@code bundled_jdk}
+ * Required - Always true
. All distributions come with a bundled Java Development Kit (JDK).
+ *
+ * API name: {@code bundled_jdk}
+ *
*/
public final boolean bundledJdk() {
return this.bundledJdk;
}
/**
- * Required - API name: {@code count}
+ * Required - Total number of selected nodes using JVM.
+ *
+ * API name: {@code count}
+ *
*/
public final int count() {
return this.count;
}
/**
- * Required - API name: {@code using_bundled_jdk}
+ * Required - If true
, a bundled JDK is in use by JVM.
+ *
+ * API name: {@code using_bundled_jdk}
+ *
*/
public final boolean usingBundledJdk() {
return this.usingBundledJdk;
@@ -104,20 +125,29 @@ public final boolean usingBundledJdk() {
/**
* Required - API name: {@code version}
*/
+ @Nonnull
public final String version() {
return this.version;
}
/**
- * Required - API name: {@code vm_name}
+ * Required - Name of the JVM.
+ *
+ * API name: {@code vm_name}
+ *
*/
+ @Nonnull
public final String vmName() {
return this.vmName;
}
/**
- * Required - API name: {@code vm_vendor}
+ * Required - Vendor of the JVM.
+ *
+ * API name: {@code vm_vendor}
+ *
*/
+ @Nonnull
public final String vmVendor() {
return this.vmVendor;
}
@@ -125,6 +155,7 @@ public final String vmVendor() {
/**
* Required - API name: {@code vm_version}
*/
+ @Nonnull
public final String vmVersion() {
return this.vmVersion;
}
@@ -132,6 +163,7 @@ public final String vmVersion() {
/**
* Serialize this object to JSON.
*/
+ @Override
public void serialize(JsonGenerator generator, JsonpMapper mapper) {
generator.writeStartObject();
serializeInternal(generator, mapper);
@@ -139,7 +171,6 @@ public void serialize(JsonGenerator generator, JsonpMapper mapper) {
}
protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) {
-
generator.writeKey("bundled_jdk");
generator.write(this.bundledJdk);
@@ -160,49 +191,92 @@ protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) {
generator.writeKey("vm_version");
generator.write(this.vmVersion);
-
}
// ---------------------------------------------------------------------------------------------
+ @Override
+ @Nonnull
+ public Builder toBuilder() {
+ return new Builder(this);
+ }
+
+ @Nonnull
+ public static Builder builder() {
+ return new Builder();
+ }
+
/**
* Builder for {@link ClusterJvmVersion}.
*/
-
- public static class Builder extends ObjectBuilderBase implements ObjectBuilder {
+ public static class Builder extends ObjectBuilderBase implements CopyableBuilder {
private Boolean bundledJdk;
-
private Integer count;
-
private Boolean usingBundledJdk;
-
private String version;
-
private String vmName;
-
private String vmVendor;
-
private String vmVersion;
+ public Builder() {}
+
+ private Builder(ClusterJvmVersion o) {
+ this.bundledJdk = o.bundledJdk;
+ this.count = o.count;
+ this.usingBundledJdk = o.usingBundledJdk;
+ this.version = o.version;
+ this.vmName = o.vmName;
+ this.vmVendor = o.vmVendor;
+ this.vmVersion = o.vmVersion;
+ }
+
+ private Builder(Builder o) {
+ this.bundledJdk = o.bundledJdk;
+ this.count = o.count;
+ this.usingBundledJdk = o.usingBundledJdk;
+ this.version = o.version;
+ this.vmName = o.vmName;
+ this.vmVendor = o.vmVendor;
+ this.vmVersion = o.vmVersion;
+ }
+
+ @Override
+ @Nonnull
+ public Builder copy() {
+ return new Builder(this);
+ }
+
/**
- * Required - API name: {@code bundled_jdk}
+ * Required - Always true
. All distributions come with a bundled Java Development Kit (JDK).
+ *
+ * API name: {@code bundled_jdk}
+ *
*/
+ @Nonnull
public final Builder bundledJdk(boolean value) {
this.bundledJdk = value;
return this;
}
/**
- * Required - API name: {@code count}
+ * Required - Total number of selected nodes using JVM.
+ *
+ * API name: {@code count}
+ *
*/
+ @Nonnull
public final Builder count(int value) {
this.count = value;
return this;
}
/**
- * Required - API name: {@code using_bundled_jdk}
+ * Required - If true
, a bundled JDK is in use by JVM.
+ *
+ * API name: {@code using_bundled_jdk}
+ *
*/
+ @Nonnull
public final Builder usingBundledJdk(boolean value) {
this.usingBundledJdk = value;
return this;
@@ -211,22 +285,31 @@ public final Builder usingBundledJdk(boolean value) {
/**
* Required - API name: {@code version}
*/
+ @Nonnull
public final Builder version(String value) {
this.version = value;
return this;
}
/**
- * Required - API name: {@code vm_name}
+ * Required - Name of the JVM.
+ *
+ * API name: {@code vm_name}
+ *
*/
+ @Nonnull
public final Builder vmName(String value) {
this.vmName = value;
return this;
}
/**
- * Required - API name: {@code vm_vendor}
+ * Required - Vendor of the JVM.
+ *
+ * API name: {@code vm_vendor}
+ *
*/
+ @Nonnull
public final Builder vmVendor(String value) {
this.vmVendor = value;
return this;
@@ -235,6 +318,7 @@ public final Builder vmVendor(String value) {
/**
* Required - API name: {@code vm_version}
*/
+ @Nonnull
public final Builder vmVersion(String value) {
this.vmVersion = value;
return this;
@@ -243,9 +327,10 @@ public final Builder vmVersion(String value) {
/**
* Builds a {@link ClusterJvmVersion}.
*
- * @throws NullPointerException
- * if some of the required fields are null.
+ * @throws NullPointerException if some of the required fields are null.
*/
+ @Override
+ @Nonnull
public ClusterJvmVersion build() {
_checkSingleUse();
@@ -264,7 +349,6 @@ public ClusterJvmVersion build() {
);
protected static void setupClusterJvmVersionDeserializer(ObjectDeserializer op) {
-
op.add(Builder::bundledJdk, JsonpDeserializer.booleanDeserializer(), "bundled_jdk");
op.add(Builder::count, JsonpDeserializer.integerDeserializer(), "count");
op.add(Builder::usingBundledJdk, JsonpDeserializer.booleanDeserializer(), "using_bundled_jdk");
@@ -272,7 +356,32 @@ protected static void setupClusterJvmVersionDeserializer(ObjectDeserializer {
+
+ @Nonnull
private final Map httpTypes;
+ @Nonnull
private final Map transportTypes;
// ---------------------------------------------------------------------------------------------
private ClusterNetworkTypes(Builder builder) {
-
this.httpTypes = ApiTypeHelper.unmodifiableRequired(builder.httpTypes, this, "httpTypes");
this.transportTypes = ApiTypeHelper.unmodifiableRequired(builder.transportTypes, this, "transportTypes");
-
}
- public static ClusterNetworkTypes of(Function> fn) {
+ public static ClusterNetworkTypes of(Function> fn) {
return fn.apply(new Builder()).build();
}
/**
- * Required - API name: {@code http_types}
+ * Required - Contains statistics about the HTTP network types used by selected nodes.
+ *
+ * API name: {@code http_types}
+ *
*/
+ @Nonnull
public final Map httpTypes() {
return this.httpTypes;
}
/**
- * Required - API name: {@code transport_types}
+ * Required - Contains statistics about the transport network types used by selected nodes.
+ *
+ * API name: {@code transport_types}
+ *
*/
+ @Nonnull
public final Map transportTypes() {
return this.transportTypes;
}
@@ -83,6 +101,7 @@ public final Map transportTypes() {
/**
* Serialize this object to JSON.
*/
+ @Override
public void serialize(JsonGenerator generator, JsonpMapper mapper) {
generator.writeStartObject();
serializeInternal(generator, mapper);
@@ -90,78 +109,120 @@ public void serialize(JsonGenerator generator, JsonpMapper mapper) {
}
protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) {
-
- if (ApiTypeHelper.isDefined(this.httpTypes)) {
- generator.writeKey("http_types");
- generator.writeStartObject();
- for (Map.Entry item0 : this.httpTypes.entrySet()) {
- generator.writeKey(item0.getKey());
- generator.write(item0.getValue());
-
- }
- generator.writeEnd();
-
+ generator.writeKey("http_types");
+ generator.writeStartObject();
+ for (Map.Entry item0 : this.httpTypes.entrySet()) {
+ generator.writeKey(item0.getKey());
+ generator.write(item0.getValue());
}
- if (ApiTypeHelper.isDefined(this.transportTypes)) {
- generator.writeKey("transport_types");
- generator.writeStartObject();
- for (Map.Entry item0 : this.transportTypes.entrySet()) {
- generator.writeKey(item0.getKey());
- generator.write(item0.getValue());
-
- }
- generator.writeEnd();
+ generator.writeEnd();
+ generator.writeKey("transport_types");
+ generator.writeStartObject();
+ for (Map.Entry item0 : this.transportTypes.entrySet()) {
+ generator.writeKey(item0.getKey());
+ generator.write(item0.getValue());
}
-
+ generator.writeEnd();
}
// ---------------------------------------------------------------------------------------------
+ @Override
+ @Nonnull
+ public Builder toBuilder() {
+ return new Builder(this);
+ }
+
+ @Nonnull
+ public static Builder builder() {
+ return new Builder();
+ }
+
/**
* Builder for {@link ClusterNetworkTypes}.
*/
-
- public static class Builder extends ObjectBuilderBase implements ObjectBuilder {
+ public static class Builder extends ObjectBuilderBase implements CopyableBuilder {
private Map httpTypes;
-
private Map transportTypes;
+ public Builder() {}
+
+ private Builder(ClusterNetworkTypes o) {
+ this.httpTypes = _mapCopy(o.httpTypes);
+ this.transportTypes = _mapCopy(o.transportTypes);
+ }
+
+ private Builder(Builder o) {
+ this.httpTypes = _mapCopy(o.httpTypes);
+ this.transportTypes = _mapCopy(o.transportTypes);
+ }
+
+ @Override
+ @Nonnull
+ public Builder copy() {
+ return new Builder(this);
+ }
+
/**
- * Required - API name: {@code http_types}
+ * Required - Contains statistics about the HTTP network types used by selected nodes.
+ *
+ * API name: {@code http_types}
+ *
+ *
*
- * Adds all entries of map
to httpTypes
.
+ * Adds all elements of map
to httpTypes
.
+ *
*/
+ @Nonnull
public final Builder httpTypes(Map map) {
this.httpTypes = _mapPutAll(this.httpTypes, map);
return this;
}
/**
- * Required - API name: {@code http_types}
+ * Required - Contains statistics about the HTTP network types used by selected nodes.
+ *
+ * API name: {@code http_types}
+ *
+ *
*
* Adds an entry to httpTypes
.
+ *
*/
+ @Nonnull
public final Builder httpTypes(String key, Integer value) {
this.httpTypes = _mapPut(this.httpTypes, key, value);
return this;
}
/**
- * Required - API name: {@code transport_types}
+ * Required - Contains statistics about the transport network types used by selected nodes.
*
- * Adds all entries of map
to transportTypes
.
+ * API name: {@code transport_types}
+ *
+ *
+ *
+ * Adds all elements of map
to transportTypes
.
+ *
*/
+ @Nonnull
public final Builder transportTypes(Map map) {
this.transportTypes = _mapPutAll(this.transportTypes, map);
return this;
}
/**
- * Required - API name: {@code transport_types}
+ * Required - Contains statistics about the transport network types used by selected nodes.
+ *
+ * API name: {@code transport_types}
+ *
+ *
*
* Adds an entry to transportTypes
.
+ *
*/
+ @Nonnull
public final Builder transportTypes(String key, Integer value) {
this.transportTypes = _mapPut(this.transportTypes, key, value);
return this;
@@ -170,9 +231,10 @@ public final Builder transportTypes(String key, Integer value) {
/**
* Builds a {@link ClusterNetworkTypes}.
*
- * @throws NullPointerException
- * if some of the required fields are null.
+ * @throws NullPointerException if some of the required fields are null.
*/
+ @Override
+ @Nonnull
public ClusterNetworkTypes build() {
_checkSingleUse();
@@ -191,14 +253,27 @@ public ClusterNetworkTypes build() {
);
protected static void setupClusterNetworkTypesDeserializer(ObjectDeserializer op) {
-
op.add(Builder::httpTypes, JsonpDeserializer.stringMapDeserializer(JsonpDeserializer.integerDeserializer()), "http_types");
op.add(
Builder::transportTypes,
JsonpDeserializer.stringMapDeserializer(JsonpDeserializer.integerDeserializer()),
"transport_types"
);
+ }
+ @Override
+ public int hashCode() {
+ int result = 17;
+ result = 31 * result + this.httpTypes.hashCode();
+ result = 31 * result + this.transportTypes.hashCode();
+ return result;
}
+ @Override
+ public boolean equals(Object o) {
+ if (this == o) return true;
+ if (o == null || this.getClass() != o.getClass()) return false;
+ ClusterNetworkTypes other = (ClusterNetworkTypes) o;
+ return this.httpTypes.equals(other.httpTypes) && this.transportTypes.equals(other.transportTypes);
+ }
}
diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/cluster/stats/ClusterNodeCount.java b/java-client/src/generated/java/org/opensearch/client/opensearch/cluster/stats/ClusterNodeCount.java
new file mode 100644
index 0000000000..df3d3cdb45
--- /dev/null
+++ b/java-client/src/generated/java/org/opensearch/client/opensearch/cluster/stats/ClusterNodeCount.java
@@ -0,0 +1,653 @@
+/*
+ * 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.cluster.stats;
+
+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.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: cluster.stats.ClusterNodeCount
+
+@JsonpDeserializable
+@Generated("org.opensearch.client.codegen.CodeGenerator")
+public class ClusterNodeCount implements PlainJsonSerializable, ToCopyableBuilder {
+
+ @Nullable
+ private final Integer clusterManager;
+
+ private final int coordinatingOnly;
+
+ private final int data;
+
+ @Nullable
+ private final Integer dataCold;
+
+ @Nullable
+ private final Integer dataContent;
+
+ @Nullable
+ private final Integer dataFrozen;
+
+ @Nullable
+ private final Integer dataHot;
+
+ @Nullable
+ private final Integer dataWarm;
+
+ private final int ingest;
+
+ private final int master;
+
+ @Nullable
+ private final Integer ml;
+
+ private final int remoteClusterClient;
+
+ @Nullable
+ private final Integer search;
+
+ private final int total;
+
+ @Nullable
+ private final Integer transform;
+
+ @Nullable
+ private final Integer votingOnly;
+
+ // ---------------------------------------------------------------------------------------------
+
+ private ClusterNodeCount(Builder builder) {
+ this.clusterManager = builder.clusterManager;
+ this.coordinatingOnly = ApiTypeHelper.requireNonNull(builder.coordinatingOnly, this, "coordinatingOnly");
+ this.data = ApiTypeHelper.requireNonNull(builder.data, this, "data");
+ this.dataCold = builder.dataCold;
+ this.dataContent = builder.dataContent;
+ this.dataFrozen = builder.dataFrozen;
+ this.dataHot = builder.dataHot;
+ this.dataWarm = builder.dataWarm;
+ this.ingest = ApiTypeHelper.requireNonNull(builder.ingest, this, "ingest");
+ this.master = ApiTypeHelper.requireNonNull(builder.master, this, "master");
+ this.ml = builder.ml;
+ this.remoteClusterClient = ApiTypeHelper.requireNonNull(builder.remoteClusterClient, this, "remoteClusterClient");
+ this.search = builder.search;
+ this.total = ApiTypeHelper.requireNonNull(builder.total, this, "total");
+ this.transform = builder.transform;
+ this.votingOnly = builder.votingOnly;
+ }
+
+ public static ClusterNodeCount of(Function> fn) {
+ return fn.apply(new Builder()).build();
+ }
+
+ /**
+ * API name: {@code cluster_manager}
+ */
+ @Nullable
+ public final Integer clusterManager() {
+ return this.clusterManager;
+ }
+
+ /**
+ * Required - API name: {@code coordinating_only}
+ */
+ public final int coordinatingOnly() {
+ return this.coordinatingOnly;
+ }
+
+ /**
+ * Required - API name: {@code data}
+ */
+ public final int data() {
+ return this.data;
+ }
+
+ /**
+ * API name: {@code data_cold}
+ */
+ @Nullable
+ public final Integer dataCold() {
+ return this.dataCold;
+ }
+
+ /**
+ * API name: {@code data_content}
+ */
+ @Nullable
+ public final Integer dataContent() {
+ return this.dataContent;
+ }
+
+ /**
+ * API name: {@code data_frozen}
+ */
+ @Nullable
+ public final Integer dataFrozen() {
+ return this.dataFrozen;
+ }
+
+ /**
+ * API name: {@code data_hot}
+ */
+ @Nullable
+ public final Integer dataHot() {
+ return this.dataHot;
+ }
+
+ /**
+ * API name: {@code data_warm}
+ */
+ @Nullable
+ public final Integer dataWarm() {
+ return this.dataWarm;
+ }
+
+ /**
+ * Required - API name: {@code ingest}
+ */
+ public final int ingest() {
+ return this.ingest;
+ }
+
+ /**
+ * Required - API name: {@code master}
+ */
+ public final int master() {
+ return this.master;
+ }
+
+ /**
+ * API name: {@code ml}
+ */
+ @Nullable
+ public final Integer ml() {
+ return this.ml;
+ }
+
+ /**
+ * Required - API name: {@code remote_cluster_client}
+ */
+ public final int remoteClusterClient() {
+ return this.remoteClusterClient;
+ }
+
+ /**
+ * API name: {@code search}
+ */
+ @Nullable
+ public final Integer search() {
+ return this.search;
+ }
+
+ /**
+ * Required - API name: {@code total}
+ */
+ public final int total() {
+ return this.total;
+ }
+
+ /**
+ * API name: {@code transform}
+ */
+ @Nullable
+ public final Integer transform() {
+ return this.transform;
+ }
+
+ /**
+ * API name: {@code voting_only}
+ */
+ @Nullable
+ public final Integer votingOnly() {
+ return this.votingOnly;
+ }
+
+ /**
+ * 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.clusterManager != null) {
+ generator.writeKey("cluster_manager");
+ generator.write(this.clusterManager);
+ }
+
+ generator.writeKey("coordinating_only");
+ generator.write(this.coordinatingOnly);
+
+ generator.writeKey("data");
+ generator.write(this.data);
+
+ if (this.dataCold != null) {
+ generator.writeKey("data_cold");
+ generator.write(this.dataCold);
+ }
+
+ if (this.dataContent != null) {
+ generator.writeKey("data_content");
+ generator.write(this.dataContent);
+ }
+
+ if (this.dataFrozen != null) {
+ generator.writeKey("data_frozen");
+ generator.write(this.dataFrozen);
+ }
+
+ if (this.dataHot != null) {
+ generator.writeKey("data_hot");
+ generator.write(this.dataHot);
+ }
+
+ if (this.dataWarm != null) {
+ generator.writeKey("data_warm");
+ generator.write(this.dataWarm);
+ }
+
+ generator.writeKey("ingest");
+ generator.write(this.ingest);
+
+ generator.writeKey("master");
+ generator.write(this.master);
+
+ if (this.ml != null) {
+ generator.writeKey("ml");
+ generator.write(this.ml);
+ }
+
+ generator.writeKey("remote_cluster_client");
+ generator.write(this.remoteClusterClient);
+
+ if (this.search != null) {
+ generator.writeKey("search");
+ generator.write(this.search);
+ }
+
+ generator.writeKey("total");
+ generator.write(this.total);
+
+ if (this.transform != null) {
+ generator.writeKey("transform");
+ generator.write(this.transform);
+ }
+
+ if (this.votingOnly != null) {
+ generator.writeKey("voting_only");
+ generator.write(this.votingOnly);
+ }
+ }
+
+ // ---------------------------------------------------------------------------------------------
+
+ @Override
+ @Nonnull
+ public Builder toBuilder() {
+ return new Builder(this);
+ }
+
+ @Nonnull
+ public static Builder builder() {
+ return new Builder();
+ }
+
+ /**
+ * Builder for {@link ClusterNodeCount}.
+ */
+ public static class Builder extends ObjectBuilderBase implements CopyableBuilder {
+ @Nullable
+ private Integer clusterManager;
+ private Integer coordinatingOnly;
+ private Integer data;
+ @Nullable
+ private Integer dataCold;
+ @Nullable
+ private Integer dataContent;
+ @Nullable
+ private Integer dataFrozen;
+ @Nullable
+ private Integer dataHot;
+ @Nullable
+ private Integer dataWarm;
+ private Integer ingest;
+ private Integer master;
+ @Nullable
+ private Integer ml;
+ private Integer remoteClusterClient;
+ @Nullable
+ private Integer search;
+ private Integer total;
+ @Nullable
+ private Integer transform;
+ @Nullable
+ private Integer votingOnly;
+
+ public Builder() {}
+
+ private Builder(ClusterNodeCount o) {
+ this.clusterManager = o.clusterManager;
+ this.coordinatingOnly = o.coordinatingOnly;
+ this.data = o.data;
+ this.dataCold = o.dataCold;
+ this.dataContent = o.dataContent;
+ this.dataFrozen = o.dataFrozen;
+ this.dataHot = o.dataHot;
+ this.dataWarm = o.dataWarm;
+ this.ingest = o.ingest;
+ this.master = o.master;
+ this.ml = o.ml;
+ this.remoteClusterClient = o.remoteClusterClient;
+ this.search = o.search;
+ this.total = o.total;
+ this.transform = o.transform;
+ this.votingOnly = o.votingOnly;
+ }
+
+ private Builder(Builder o) {
+ this.clusterManager = o.clusterManager;
+ this.coordinatingOnly = o.coordinatingOnly;
+ this.data = o.data;
+ this.dataCold = o.dataCold;
+ this.dataContent = o.dataContent;
+ this.dataFrozen = o.dataFrozen;
+ this.dataHot = o.dataHot;
+ this.dataWarm = o.dataWarm;
+ this.ingest = o.ingest;
+ this.master = o.master;
+ this.ml = o.ml;
+ this.remoteClusterClient = o.remoteClusterClient;
+ this.search = o.search;
+ this.total = o.total;
+ this.transform = o.transform;
+ this.votingOnly = o.votingOnly;
+ }
+
+ @Override
+ @Nonnull
+ public Builder copy() {
+ return new Builder(this);
+ }
+
+ /**
+ * API name: {@code cluster_manager}
+ */
+ @Nonnull
+ public final Builder clusterManager(@Nullable Integer value) {
+ this.clusterManager = value;
+ return this;
+ }
+
+ /**
+ * Required - API name: {@code coordinating_only}
+ */
+ @Nonnull
+ public final Builder coordinatingOnly(int value) {
+ this.coordinatingOnly = value;
+ return this;
+ }
+
+ /**
+ * Required - API name: {@code data}
+ */
+ @Nonnull
+ public final Builder data(int value) {
+ this.data = value;
+ return this;
+ }
+
+ /**
+ * API name: {@code data_cold}
+ */
+ @Nonnull
+ public final Builder dataCold(@Nullable Integer value) {
+ this.dataCold = value;
+ return this;
+ }
+
+ /**
+ * API name: {@code data_content}
+ */
+ @Nonnull
+ public final Builder dataContent(@Nullable Integer value) {
+ this.dataContent = value;
+ return this;
+ }
+
+ /**
+ * API name: {@code data_frozen}
+ */
+ @Nonnull
+ public final Builder dataFrozen(@Nullable Integer value) {
+ this.dataFrozen = value;
+ return this;
+ }
+
+ /**
+ * API name: {@code data_hot}
+ */
+ @Nonnull
+ public final Builder dataHot(@Nullable Integer value) {
+ this.dataHot = value;
+ return this;
+ }
+
+ /**
+ * API name: {@code data_warm}
+ */
+ @Nonnull
+ public final Builder dataWarm(@Nullable Integer value) {
+ this.dataWarm = value;
+ return this;
+ }
+
+ /**
+ * Required - API name: {@code ingest}
+ */
+ @Nonnull
+ public final Builder ingest(int value) {
+ this.ingest = value;
+ return this;
+ }
+
+ /**
+ * Required - API name: {@code master}
+ */
+ @Nonnull
+ public final Builder master(int value) {
+ this.master = value;
+ return this;
+ }
+
+ /**
+ * API name: {@code ml}
+ */
+ @Nonnull
+ public final Builder ml(@Nullable Integer value) {
+ this.ml = value;
+ return this;
+ }
+
+ /**
+ * Required - API name: {@code remote_cluster_client}
+ */
+ @Nonnull
+ public final Builder remoteClusterClient(int value) {
+ this.remoteClusterClient = value;
+ return this;
+ }
+
+ /**
+ * API name: {@code search}
+ */
+ @Nonnull
+ public final Builder search(@Nullable Integer value) {
+ this.search = value;
+ return this;
+ }
+
+ /**
+ * Required - API name: {@code total}
+ */
+ @Nonnull
+ public final Builder total(int value) {
+ this.total = value;
+ return this;
+ }
+
+ /**
+ * API name: {@code transform}
+ */
+ @Nonnull
+ public final Builder transform(@Nullable Integer value) {
+ this.transform = value;
+ return this;
+ }
+
+ /**
+ * API name: {@code voting_only}
+ */
+ @Nonnull
+ public final Builder votingOnly(@Nullable Integer value) {
+ this.votingOnly = value;
+ return this;
+ }
+
+ /**
+ * Builds a {@link ClusterNodeCount}.
+ *
+ * @throws NullPointerException if some of the required fields are null.
+ */
+ @Override
+ @Nonnull
+ public ClusterNodeCount build() {
+ _checkSingleUse();
+
+ return new ClusterNodeCount(this);
+ }
+ }
+
+ // ---------------------------------------------------------------------------------------------
+
+ /**
+ * Json deserializer for {@link ClusterNodeCount}
+ */
+ public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer.lazy(
+ Builder::new,
+ ClusterNodeCount::setupClusterNodeCountDeserializer
+ );
+
+ protected static void setupClusterNodeCountDeserializer(ObjectDeserializer op) {
+ op.add(Builder::clusterManager, JsonpDeserializer.integerDeserializer(), "cluster_manager");
+ op.add(Builder::coordinatingOnly, JsonpDeserializer.integerDeserializer(), "coordinating_only");
+ op.add(Builder::data, JsonpDeserializer.integerDeserializer(), "data");
+ op.add(Builder::dataCold, JsonpDeserializer.integerDeserializer(), "data_cold");
+ op.add(Builder::dataContent, JsonpDeserializer.integerDeserializer(), "data_content");
+ op.add(Builder::dataFrozen, JsonpDeserializer.integerDeserializer(), "data_frozen");
+ op.add(Builder::dataHot, JsonpDeserializer.integerDeserializer(), "data_hot");
+ op.add(Builder::dataWarm, JsonpDeserializer.integerDeserializer(), "data_warm");
+ op.add(Builder::ingest, JsonpDeserializer.integerDeserializer(), "ingest");
+ op.add(Builder::master, JsonpDeserializer.integerDeserializer(), "master");
+ op.add(Builder::ml, JsonpDeserializer.integerDeserializer(), "ml");
+ op.add(Builder::remoteClusterClient, JsonpDeserializer.integerDeserializer(), "remote_cluster_client");
+ op.add(Builder::search, JsonpDeserializer.integerDeserializer(), "search");
+ op.add(Builder::total, JsonpDeserializer.integerDeserializer(), "total");
+ op.add(Builder::transform, JsonpDeserializer.integerDeserializer(), "transform");
+ op.add(Builder::votingOnly, JsonpDeserializer.integerDeserializer(), "voting_only");
+ }
+
+ @Override
+ public int hashCode() {
+ int result = 17;
+ result = 31 * result + Objects.hashCode(this.clusterManager);
+ result = 31 * result + Integer.hashCode(this.coordinatingOnly);
+ result = 31 * result + Integer.hashCode(this.data);
+ result = 31 * result + Objects.hashCode(this.dataCold);
+ result = 31 * result + Objects.hashCode(this.dataContent);
+ result = 31 * result + Objects.hashCode(this.dataFrozen);
+ result = 31 * result + Objects.hashCode(this.dataHot);
+ result = 31 * result + Objects.hashCode(this.dataWarm);
+ result = 31 * result + Integer.hashCode(this.ingest);
+ result = 31 * result + Integer.hashCode(this.master);
+ result = 31 * result + Objects.hashCode(this.ml);
+ result = 31 * result + Integer.hashCode(this.remoteClusterClient);
+ result = 31 * result + Objects.hashCode(this.search);
+ result = 31 * result + Integer.hashCode(this.total);
+ result = 31 * result + Objects.hashCode(this.transform);
+ result = 31 * result + Objects.hashCode(this.votingOnly);
+ return result;
+ }
+
+ @Override
+ public boolean equals(Object o) {
+ if (this == o) return true;
+ if (o == null || this.getClass() != o.getClass()) return false;
+ ClusterNodeCount other = (ClusterNodeCount) o;
+ return Objects.equals(this.clusterManager, other.clusterManager)
+ && this.coordinatingOnly == other.coordinatingOnly
+ && this.data == other.data
+ && Objects.equals(this.dataCold, other.dataCold)
+ && Objects.equals(this.dataContent, other.dataContent)
+ && Objects.equals(this.dataFrozen, other.dataFrozen)
+ && Objects.equals(this.dataHot, other.dataHot)
+ && Objects.equals(this.dataWarm, other.dataWarm)
+ && this.ingest == other.ingest
+ && this.master == other.master
+ && Objects.equals(this.ml, other.ml)
+ && this.remoteClusterClient == other.remoteClusterClient
+ && Objects.equals(this.search, other.search)
+ && this.total == other.total
+ && Objects.equals(this.transform, other.transform)
+ && Objects.equals(this.votingOnly, other.votingOnly);
+ }
+}
diff --git a/java-client/src/main/java/org/opensearch/client/opensearch/cluster/stats/ClusterNodes.java b/java-client/src/generated/java/org/opensearch/client/opensearch/cluster/stats/ClusterNodes.java
similarity index 52%
rename from java-client/src/main/java/org/opensearch/client/opensearch/cluster/stats/ClusterNodes.java
rename to java-client/src/generated/java/org/opensearch/client/opensearch/cluster/stats/ClusterNodes.java
index 95b3ebd674..68aa358f36 100644
--- a/java-client/src/main/java/org/opensearch/client/opensearch/cluster/stats/ClusterNodes.java
+++ b/java-client/src/generated/java/org/opensearch/client/opensearch/cluster/stats/ClusterNodes.java
@@ -30,12 +30,20 @@
* GitHub history for details.
*/
+//----------------------------------------------------
+// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST.
+//----------------------------------------------------
+
package org.opensearch.client.opensearch.cluster.stats;
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.JsonpDeserializable;
import org.opensearch.client.json.JsonpDeserializer;
import org.opensearch.client.json.JsonpMapper;
@@ -44,156 +52,197 @@
import org.opensearch.client.json.PlainJsonSerializable;
import org.opensearch.client.opensearch._types.PluginStats;
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: cluster.stats.ClusterNodes
@JsonpDeserializable
-public class ClusterNodes implements PlainJsonSerializable {
+@Generated("org.opensearch.client.codegen.CodeGenerator")
+public class ClusterNodes implements PlainJsonSerializable, ToCopyableBuilder {
+
+ @Nullable
private final ClusterNodeCount count;
+ @Nonnull
private final Map discoveryTypes;
+ @Nullable
private final ClusterFileSystem fs;
+ @Nullable
+ private final IndexingPressure indexingPressure;
+
+ @Nullable
private final ClusterIngest ingest;
+ @Nullable
private final ClusterJvm jvm;
+ @Nullable
private final ClusterNetworkTypes networkTypes;
+ @Nullable
private final ClusterOperatingSystem os;
+ @Nonnull
private final List packagingTypes;
+ @Nonnull
private final List plugins;
+ @Nullable
private final ClusterProcess process;
+ @Nonnull
private final List versions;
// ---------------------------------------------------------------------------------------------
private ClusterNodes(Builder builder) {
-
- this.count = ApiTypeHelper.requireNonNull(builder.count, this, "count");
- this.discoveryTypes = ApiTypeHelper.unmodifiableRequired(builder.discoveryTypes, this, "discoveryTypes");
- this.fs = ApiTypeHelper.requireNonNull(builder.fs, this, "fs");
- this.ingest = ApiTypeHelper.requireNonNull(builder.ingest, this, "ingest");
- this.jvm = ApiTypeHelper.requireNonNull(builder.jvm, this, "jvm");
- this.networkTypes = ApiTypeHelper.requireNonNull(builder.networkTypes, this, "networkTypes");
- this.os = ApiTypeHelper.requireNonNull(builder.os, this, "os");
- this.packagingTypes = ApiTypeHelper.unmodifiableRequired(builder.packagingTypes, this, "packagingTypes");
- this.plugins = ApiTypeHelper.unmodifiableRequired(builder.plugins, this, "plugins");
- this.process = ApiTypeHelper.requireNonNull(builder.process, this, "process");
- this.versions = ApiTypeHelper.unmodifiableRequired(builder.versions, this, "versions");
-
+ this.count = builder.count;
+ this.discoveryTypes = ApiTypeHelper.unmodifiable(builder.discoveryTypes);
+ this.fs = builder.fs;
+ this.indexingPressure = builder.indexingPressure;
+ this.ingest = builder.ingest;
+ this.jvm = builder.jvm;
+ this.networkTypes = builder.networkTypes;
+ this.os = builder.os;
+ this.packagingTypes = ApiTypeHelper.unmodifiable(builder.packagingTypes);
+ this.plugins = ApiTypeHelper.unmodifiable(builder.plugins);
+ this.process = builder.process;
+ this.versions = ApiTypeHelper.unmodifiable(builder.versions);
}
- public static ClusterNodes of(Function> fn) {
+ public static ClusterNodes of(Function> fn) {
return fn.apply(new Builder()).build();
}
/**
- * Required - Contains counts for nodes selected by the request's node filters.
+ * Contains counts for nodes selected by the request's node filters.
*
* API name: {@code count}
+ *
*/
+ @Nullable
public final ClusterNodeCount count() {
return this.count;
}
/**
- * Required - Contains statistics about the discovery types used by selected
- * nodes.
+ * Contains statistics about the discovery types used by selected nodes.
*
* API name: {@code discovery_types}
+ *
*/
+ @Nonnull
public final Map discoveryTypes() {
return this.discoveryTypes;
}
/**
- * Required - Contains statistics about file stores by selected nodes.
+ * Contains statistics about file stores by selected nodes.
*
* API name: {@code fs}
+ *
*/
+ @Nullable
public final ClusterFileSystem fs() {
return this.fs;
}
/**
- * Required - API name: {@code ingest}
+ * API name: {@code indexing_pressure}
+ */
+ @Nullable
+ public final IndexingPressure indexingPressure() {
+ return this.indexingPressure;
+ }
+
+ /**
+ * API name: {@code ingest}
*/
+ @Nullable
public final ClusterIngest ingest() {
return this.ingest;
}
/**
- * Required - Contains statistics about the Java Virtual Machines (JVMs) used by
- * selected nodes.
+ * Contains statistics about the Java Virtual Machines (JVMs) used by selected nodes.
*
* API name: {@code jvm}
+ *
*/
+ @Nullable
public final ClusterJvm jvm() {
return this.jvm;
}
/**
- * Required - Contains statistics about the transport and HTTP networks used by
- * selected nodes.
+ * Contains statistics about the transport and HTTP networks used by selected nodes.
*
* API name: {@code network_types}
+ *
*/
+ @Nullable
public final ClusterNetworkTypes networkTypes() {
return this.networkTypes;
}
/**
- * Required - Contains statistics about the operating systems used by selected
- * nodes.
+ * Contains statistics about the operating systems used by selected nodes.
*
* API name: {@code os}
+ *
*/
+ @Nullable
public final ClusterOperatingSystem os() {
return this.os;
}
/**
- * Required - Contains statistics about OpenSearch distributions installed on
- * selected nodes.
+ * Contains statistics about OpenSearch distributions installed on selected nodes.
*
* API name: {@code packaging_types}
+ *
*/
+ @Nonnull
public final List packagingTypes() {
return this.packagingTypes;
}
/**
- * Required - Contains statistics about installed plugins and modules by
- * selected nodes.
+ * Contains statistics about installed plugins and modules by selected nodes. If no plugins or modules are installed, this array is
+ * empty.
*
* API name: {@code plugins}
+ *
*/
+ @Nonnull
public final List plugins() {
return this.plugins;
}
/**
- * Required - Contains statistics about processes used by selected nodes.
+ * Contains statistics about processes used by selected nodes.
*
* API name: {@code process}
+ *
*/
+ @Nullable
public final ClusterProcess process() {
return this.process;
}
/**
- * Required - Array of OpenSearch versions used on selected nodes.
+ * Array of OpenSearch versions used on selected nodes.
*
* API name: {@code versions}
+ *
*/
+ @Nonnull
public final List versions() {
return this.versions;
}
@@ -201,6 +250,7 @@ public final List versions() {
/**
* Serialize this object to JSON.
*/
+ @Override
public void serialize(JsonGenerator generator, JsonpMapper mapper) {
generator.writeStartObject();
serializeInternal(generator, mapper);
@@ -208,9 +258,10 @@ public void serialize(JsonGenerator generator, JsonpMapper mapper) {
}
protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) {
-
- generator.writeKey("count");
- this.count.serialize(generator, mapper);
+ if (this.count != null) {
+ generator.writeKey("count");
+ this.count.serialize(generator, mapper);
+ }
if (ApiTypeHelper.isDefined(this.discoveryTypes)) {
generator.writeKey("discovery_types");
@@ -218,347 +269,481 @@ protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) {
for (Map.Entry item0 : this.discoveryTypes.entrySet()) {
generator.writeKey(item0.getKey());
generator.write(item0.getValue());
-
}
generator.writeEnd();
+ }
+ if (this.fs != null) {
+ generator.writeKey("fs");
+ this.fs.serialize(generator, mapper);
}
- generator.writeKey("fs");
- this.fs.serialize(generator, mapper);
- generator.writeKey("ingest");
- this.ingest.serialize(generator, mapper);
+ if (this.indexingPressure != null) {
+ generator.writeKey("indexing_pressure");
+ this.indexingPressure.serialize(generator, mapper);
+ }
- generator.writeKey("jvm");
- this.jvm.serialize(generator, mapper);
+ if (this.ingest != null) {
+ generator.writeKey("ingest");
+ this.ingest.serialize(generator, mapper);
+ }
- generator.writeKey("network_types");
- this.networkTypes.serialize(generator, mapper);
+ if (this.jvm != null) {
+ generator.writeKey("jvm");
+ this.jvm.serialize(generator, mapper);
+ }
- generator.writeKey("os");
- this.os.serialize(generator, mapper);
+ if (this.networkTypes != null) {
+ generator.writeKey("network_types");
+ this.networkTypes.serialize(generator, mapper);
+ }
+
+ if (this.os != null) {
+ generator.writeKey("os");
+ this.os.serialize(generator, mapper);
+ }
if (ApiTypeHelper.isDefined(this.packagingTypes)) {
generator.writeKey("packaging_types");
generator.writeStartArray();
for (NodePackagingType item0 : this.packagingTypes) {
item0.serialize(generator, mapper);
-
}
generator.writeEnd();
-
}
+
if (ApiTypeHelper.isDefined(this.plugins)) {
generator.writeKey("plugins");
generator.writeStartArray();
for (PluginStats item0 : this.plugins) {
item0.serialize(generator, mapper);
-
}
generator.writeEnd();
+ }
+ if (this.process != null) {
+ generator.writeKey("process");
+ this.process.serialize(generator, mapper);
}
- generator.writeKey("process");
- this.process.serialize(generator, mapper);
if (ApiTypeHelper.isDefined(this.versions)) {
generator.writeKey("versions");
generator.writeStartArray();
for (String item0 : this.versions) {
generator.write(item0);
-
}
generator.writeEnd();
-
}
-
}
// ---------------------------------------------------------------------------------------------
+ @Override
+ @Nonnull
+ public Builder toBuilder() {
+ return new Builder(this);
+ }
+
+ @Nonnull
+ public static Builder builder() {
+ return new Builder();
+ }
+
/**
* Builder for {@link ClusterNodes}.
*/
-
- public static class Builder extends ObjectBuilderBase implements ObjectBuilder {
+ public static class Builder extends ObjectBuilderBase implements CopyableBuilder {
+ @Nullable
private ClusterNodeCount count;
-
+ @Nullable
private Map discoveryTypes;
-
+ @Nullable
private ClusterFileSystem fs;
-
+ @Nullable
+ private IndexingPressure indexingPressure;
+ @Nullable
private ClusterIngest ingest;
-
+ @Nullable
private ClusterJvm jvm;
-
+ @Nullable
private ClusterNetworkTypes networkTypes;
-
+ @Nullable
private ClusterOperatingSystem os;
-
+ @Nullable
private List packagingTypes;
-
+ @Nullable
private List plugins;
-
+ @Nullable
private ClusterProcess process;
-
+ @Nullable
private List versions;
+ public Builder() {}
+
+ private Builder(ClusterNodes o) {
+ this.count = o.count;
+ this.discoveryTypes = _mapCopy(o.discoveryTypes);
+ this.fs = o.fs;
+ this.indexingPressure = o.indexingPressure;
+ this.ingest = o.ingest;
+ this.jvm = o.jvm;
+ this.networkTypes = o.networkTypes;
+ this.os = o.os;
+ this.packagingTypes = _listCopy(o.packagingTypes);
+ this.plugins = _listCopy(o.plugins);
+ this.process = o.process;
+ this.versions = _listCopy(o.versions);
+ }
+
+ private Builder(Builder o) {
+ this.count = o.count;
+ this.discoveryTypes = _mapCopy(o.discoveryTypes);
+ this.fs = o.fs;
+ this.indexingPressure = o.indexingPressure;
+ this.ingest = o.ingest;
+ this.jvm = o.jvm;
+ this.networkTypes = o.networkTypes;
+ this.os = o.os;
+ this.packagingTypes = _listCopy(o.packagingTypes);
+ this.plugins = _listCopy(o.plugins);
+ this.process = o.process;
+ this.versions = _listCopy(o.versions);
+ }
+
+ @Override
+ @Nonnull
+ public Builder copy() {
+ return new Builder(this);
+ }
+
/**
- * Required - Contains counts for nodes selected by the request's node filters.
+ * Contains counts for nodes selected by the request's node filters.
*
* API name: {@code count}
+ *
*/
- public final Builder count(ClusterNodeCount value) {
+ @Nonnull
+ public final Builder count(@Nullable ClusterNodeCount value) {
this.count = value;
return this;
}
/**
- * Required - Contains counts for nodes selected by the request's node filters.
+ * Contains counts for nodes selected by the request's node filters.
*
* API name: {@code count}
+ *
*/
+ @Nonnull
public final Builder count(Function> fn) {
- return this.count(fn.apply(new ClusterNodeCount.Builder()).build());
+ return count(fn.apply(new ClusterNodeCount.Builder()).build());
}
/**
- * Required - Contains statistics about the discovery types used by selected
- * nodes.
+ * Contains statistics about the discovery types used by selected nodes.
*
* API name: {@code discovery_types}
+ *
+ *
*
- * Adds all entries of map
to discoveryTypes
.
+ * Adds all elements of map
to discoveryTypes
.
+ *
*/
+ @Nonnull
public final Builder discoveryTypes(Map map) {
this.discoveryTypes = _mapPutAll(this.discoveryTypes, map);
return this;
}
/**
- * Required - Contains statistics about the discovery types used by selected
- * nodes.
+ * Contains statistics about the discovery types used by selected nodes.
*
* API name: {@code discovery_types}
+ *
+ *
*
* Adds an entry to discoveryTypes
.
+ *
*/
+ @Nonnull
public final Builder discoveryTypes(String key, Integer value) {
this.discoveryTypes = _mapPut(this.discoveryTypes, key, value);
return this;
}
/**
- * Required - Contains statistics about file stores by selected nodes.
+ * Contains statistics about file stores by selected nodes.
*
* API name: {@code fs}
+ *
*/
- public final Builder fs(ClusterFileSystem value) {
+ @Nonnull
+ public final Builder fs(@Nullable ClusterFileSystem value) {
this.fs = value;
return this;
}
/**
- * Required - Contains statistics about file stores by selected nodes.
+ * Contains statistics about file stores by selected nodes.
*
* API name: {@code fs}
+ *
*/
+ @Nonnull
public final Builder fs(Function> fn) {
- return this.fs(fn.apply(new ClusterFileSystem.Builder()).build());
+ return fs(fn.apply(new ClusterFileSystem.Builder()).build());
}
/**
- * Required - API name: {@code ingest}
+ * API name: {@code indexing_pressure}
*/
- public final Builder ingest(ClusterIngest value) {
+ @Nonnull
+ public final Builder indexingPressure(@Nullable IndexingPressure value) {
+ this.indexingPressure = value;
+ return this;
+ }
+
+ /**
+ * API name: {@code indexing_pressure}
+ */
+ @Nonnull
+ public final Builder indexingPressure(Function> fn) {
+ return indexingPressure(fn.apply(new IndexingPressure.Builder()).build());
+ }
+
+ /**
+ * API name: {@code ingest}
+ */
+ @Nonnull
+ public final Builder ingest(@Nullable ClusterIngest value) {
this.ingest = value;
return this;
}
/**
- * Required - API name: {@code ingest}
+ * API name: {@code ingest}
*/
+ @Nonnull
public final Builder ingest(Function> fn) {
- return this.ingest(fn.apply(new ClusterIngest.Builder()).build());
+ return ingest(fn.apply(new ClusterIngest.Builder()).build());
}
/**
- * Required - Contains statistics about the Java Virtual Machines (JVMs) used by
- * selected nodes.
+ * Contains statistics about the Java Virtual Machines (JVMs) used by selected nodes.
*
* API name: {@code jvm}
+ *
*/
- public final Builder jvm(ClusterJvm value) {
+ @Nonnull
+ public final Builder jvm(@Nullable ClusterJvm value) {
this.jvm = value;
return this;
}
/**
- * Required - Contains statistics about the Java Virtual Machines (JVMs) used by
- * selected nodes.
+ * Contains statistics about the Java Virtual Machines (JVMs) used by selected nodes.
*
* API name: {@code jvm}
+ *
*/
+ @Nonnull
public final Builder jvm(Function> fn) {
- return this.jvm(fn.apply(new ClusterJvm.Builder()).build());
+ return jvm(fn.apply(new ClusterJvm.Builder()).build());
}
/**
- * Required - Contains statistics about the transport and HTTP networks used by
- * selected nodes.
+ * Contains statistics about the transport and HTTP networks used by selected nodes.
*
* API name: {@code network_types}
+ *
*/
- public final Builder networkTypes(ClusterNetworkTypes value) {
+ @Nonnull
+ public final Builder networkTypes(@Nullable ClusterNetworkTypes value) {
this.networkTypes = value;
return this;
}
/**
- * Required - Contains statistics about the transport and HTTP networks used by
- * selected nodes.
+ * Contains statistics about the transport and HTTP networks used by selected nodes.
*
* API name: {@code network_types}
+ *
*/
+ @Nonnull
public final Builder networkTypes(Function> fn) {
- return this.networkTypes(fn.apply(new ClusterNetworkTypes.Builder()).build());
+ return networkTypes(fn.apply(new ClusterNetworkTypes.Builder()).build());
}
/**
- * Required - Contains statistics about the operating systems used by selected
- * nodes.
+ * Contains statistics about the operating systems used by selected nodes.
*
* API name: {@code os}
+ *
*/
- public final Builder os(ClusterOperatingSystem value) {
+ @Nonnull
+ public final Builder os(@Nullable ClusterOperatingSystem value) {
this.os = value;
return this;
}
/**
- * Required - Contains statistics about the operating systems used by selected
- * nodes.
+ * Contains statistics about the operating systems used by selected nodes.
*
* API name: {@code os}
+ *
*/
+ @Nonnull
public final Builder os(Function> fn) {
- return this.os(fn.apply(new ClusterOperatingSystem.Builder()).build());
+ return os(fn.apply(new ClusterOperatingSystem.Builder()).build());
}
/**
- * Required - Contains statistics about OpenSearch distributions installed on
- * selected nodes.
+ * Contains statistics about OpenSearch distributions installed on selected nodes.
*
* API name: {@code packaging_types}
+ *
+ *
*
* Adds all elements of list
to packagingTypes
.
+ *
*/
+ @Nonnull
public final Builder packagingTypes(List list) {
this.packagingTypes = _listAddAll(this.packagingTypes, list);
return this;
}
/**
- * Required - Contains statistics about OpenSearch distributions installed on
- * selected nodes.
+ * Contains statistics about OpenSearch distributions installed on selected nodes.
*
* API name: {@code packaging_types}
+ *
+ *
*
* Adds one or more values to packagingTypes
.
+ *
*/
+ @Nonnull
public final Builder packagingTypes(NodePackagingType value, NodePackagingType... values) {
this.packagingTypes = _listAdd(this.packagingTypes, value, values);
return this;
}
/**
- * Required - Contains statistics about OpenSearch distributions installed on
- * selected nodes.
+ * Contains statistics about OpenSearch distributions installed on selected nodes.
*
* API name: {@code packaging_types}
+ *
+ *
*
* Adds a value to packagingTypes
using a builder lambda.
+ *
*/
+ @Nonnull
public final Builder packagingTypes(Function> fn) {
return packagingTypes(fn.apply(new NodePackagingType.Builder()).build());
}
/**
- * Required - Contains statistics about installed plugins and modules by
- * selected nodes.
+ * Contains statistics about installed plugins and modules by selected nodes. If no plugins or modules are installed, this array is
+ * empty.
*
* API name: {@code plugins}
+ *
+ *
*
* Adds all elements of list
to plugins
.
+ *
*/
+ @Nonnull
public final Builder plugins(List list) {
this.plugins = _listAddAll(this.plugins, list);
return this;
}
/**
- * Required - Contains statistics about installed plugins and modules by
- * selected nodes.
+ * Contains statistics about installed plugins and modules by selected nodes. If no plugins or modules are installed, this array is
+ * empty.
*
* API name: {@code plugins}
+ *
+ *
*
* Adds one or more values to plugins
.
+ *
*/
+ @Nonnull
public final Builder plugins(PluginStats value, PluginStats... values) {
this.plugins = _listAdd(this.plugins, value, values);
return this;
}
/**
- * Required - Contains statistics about installed plugins and modules by
- * selected nodes.
+ * Contains statistics about installed plugins and modules by selected nodes. If no plugins or modules are installed, this array is
+ * empty.
*
* API name: {@code plugins}
+ *
+ *
*
* Adds a value to plugins
using a builder lambda.
+ *
*/
+ @Nonnull
public final Builder plugins(Function> fn) {
return plugins(fn.apply(new PluginStats.Builder()).build());
}
/**
- * Required - Contains statistics about processes used by selected nodes.
+ * Contains statistics about processes used by selected nodes.
*
* API name: {@code process}
+ *
*/
- public final Builder process(ClusterProcess value) {
+ @Nonnull
+ public final Builder process(@Nullable ClusterProcess value) {
this.process = value;
return this;
}
/**
- * Required - Contains statistics about processes used by selected nodes.
+ * Contains statistics about processes used by selected nodes.
*
* API name: {@code process}
+ *
*/
+ @Nonnull
public final Builder process(Function> fn) {
- return this.process(fn.apply(new ClusterProcess.Builder()).build());
+ return process(fn.apply(new ClusterProcess.Builder()).build());
}
/**
- * Required - Array of OpenSearch versions used on selected nodes.
+ * Array of OpenSearch versions used on selected nodes.
*
* API name: {@code versions}
+ *
+ *
*
* Adds all elements of list
to versions
.
+ *
*/
+ @Nonnull
public final Builder versions(List list) {
this.versions = _listAddAll(this.versions, list);
return this;
}
/**
- * Required - Array of OpenSearch versions used on selected nodes.
+ * Array of OpenSearch versions used on selected nodes.
*
* API name: {@code versions}
+ *
+ *
*
* Adds one or more values to versions
.
+ *
*/
+ @Nonnull
public final Builder versions(String value, String... values) {
this.versions = _listAdd(this.versions, value, values);
return this;
@@ -567,9 +752,10 @@ public final Builder versions(String value, String... values) {
/**
* Builds a {@link ClusterNodes}.
*
- * @throws NullPointerException
- * if some of the required fields are null.
+ * @throws NullPointerException if some of the required fields are null.
*/
+ @Override
+ @Nonnull
public ClusterNodes build() {
_checkSingleUse();
@@ -588,7 +774,6 @@ public ClusterNodes build() {
);
protected static void setupClusterNodesDeserializer(ObjectDeserializer op) {
-
op.add(Builder::count, ClusterNodeCount._DESERIALIZER, "count");
op.add(
Builder::discoveryTypes,
@@ -596,6 +781,7 @@ protected static void setupClusterNodesDeserializer(ObjectDeserializer {
+
private final int allocatedProcessors;
+ @Nonnull
+ private final List architectures;
+
private final int availableProcessors;
+ @Nonnull
private final OperatingSystemMemoryInfo mem;
+ @Nonnull
private final List names;
+ @Nonnull
private final List prettyNames;
- private final List architectures;
-
// ---------------------------------------------------------------------------------------------
private ClusterOperatingSystem(Builder builder) {
-
this.allocatedProcessors = ApiTypeHelper.requireNonNull(builder.allocatedProcessors, this, "allocatedProcessors");
+ this.architectures = ApiTypeHelper.unmodifiable(builder.architectures);
this.availableProcessors = ApiTypeHelper.requireNonNull(builder.availableProcessors, this, "availableProcessors");
this.mem = ApiTypeHelper.requireNonNull(builder.mem, this, "mem");
this.names = ApiTypeHelper.unmodifiableRequired(builder.names, this, "names");
this.prettyNames = ApiTypeHelper.unmodifiableRequired(builder.prettyNames, this, "prettyNames");
- this.architectures = ApiTypeHelper.unmodifiable(builder.architectures);
-
}
- public static ClusterOperatingSystem of(Function