Skip to content

Commit

Permalink
Fixing missing required property exception for cluster manager for 1.…
Browse files Browse the repository at this point in the history
…x servers

Signed-off-by: Vacha Shah <vachshah@amazon.com>
  • Loading branch information
VachaShah committed Feb 15, 2024
1 parent 638d9b9 commit b572e7f
Showing 1 changed file with 37 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,10 @@ public class ClusterNodeCount implements JsonpSerializable {

private final int ingest;

private final int clusterManager;
@Deprecated
private final Integer master;

private final Integer clusterManager;

private final int total;

Expand All @@ -71,7 +74,8 @@ private ClusterNodeCount(Builder builder) {
this.coordinatingOnly = ApiTypeHelper.requireNonNull(builder.coordinatingOnly, this, "coordinatingOnly");
this.data = ApiTypeHelper.requireNonNull(builder.data, this, "data");
this.ingest = ApiTypeHelper.requireNonNull(builder.ingest, this, "ingest");
this.clusterManager = ApiTypeHelper.requireNonNull(builder.clusterManager, this, "clusterManager");
this.master = builder.master;
this.clusterManager = builder.clusterManager;
this.total = ApiTypeHelper.requireNonNull(builder.total, this, "total");
this.remoteClusterClient = ApiTypeHelper.requireNonNull(builder.remoteClusterClient, this, "remoteClusterClient");
this.search = builder.search;
Expand Down Expand Up @@ -103,7 +107,15 @@ public final int ingest() {
}

/**
* Required - API name: {@code clusterManager}
* API name: {@code master}
*/
@Deprecated
public final int master() {
return this.master;
}

/**
* API name: {@code clusterManager}
*/
public final int clusterManager() {
return this.clusterManager;
Expand Down Expand Up @@ -151,8 +163,15 @@ protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) {
generator.writeKey("ingest");
generator.write(this.ingest);

generator.writeKey("cluster_manager");
generator.write(this.clusterManager);
if (this.master != null) {
generator.writeKey("master");
generator.write(this.master);
}

if (this.clusterManager != null) {
generator.writeKey("cluster_manager");
generator.write(this.clusterManager);
}

generator.writeKey("total");
generator.write(this.total);
Expand Down Expand Up @@ -180,6 +199,8 @@ public static class Builder extends ObjectBuilderBase implements ObjectBuilder<C

private Integer ingest;

private Integer master;

private Integer clusterManager;

private Integer total;
Expand Down Expand Up @@ -213,7 +234,16 @@ public final Builder ingest(int value) {
}

/**
* Required - API name: {@code clusterManager}
* API name: {@code master}
*/
@Deprecated
public final Builder master(int value) {
this.master = value;
return this;
}

/**
* API name: {@code clusterManager}
*/
public final Builder clusterManager(int value) {
this.clusterManager = value;
Expand Down Expand Up @@ -273,6 +303,7 @@ protected static void setupClusterNodeCountDeserializer(ObjectDeserializer<Clust
op.add(Builder::coordinatingOnly, JsonpDeserializer.integerDeserializer(), "coordinating_only");
op.add(Builder::data, JsonpDeserializer.integerDeserializer(), "data");
op.add(Builder::ingest, JsonpDeserializer.integerDeserializer(), "ingest");
op.add(Builder::master, JsonpDeserializer.integerDeserializer(), "master");
op.add(Builder::clusterManager, JsonpDeserializer.integerDeserializer(), "cluster_manager");
op.add(Builder::total, JsonpDeserializer.integerDeserializer(), "total");
op.add(Builder::remoteClusterClient, JsonpDeserializer.integerDeserializer(), "remote_cluster_client");
Expand Down

0 comments on commit b572e7f

Please sign in to comment.