map) {
+ this.shardSizes = _mapPutAll(this.shardSizes, map);
return this;
}
/**
- * Required - API name: {@code reserved_sizes}
+ * Required - API name: {@code shard_sizes}
+ *
*
- * Adds one or more values to reservedSizes
.
+ * Adds an entry to shardSizes
.
+ *
*/
- public final Builder reservedSizes(ReservedSize value, ReservedSize... values) {
- this.reservedSizes = _listAdd(this.reservedSizes, value, values);
+ @Nonnull
+ public final Builder shardSizes(String key, String value) {
+ this.shardSizes = _mapPut(this.shardSizes, key, value);
return this;
}
- /**
- * Required - API name: {@code reserved_sizes}
- *
- * Adds a value to reservedSizes
using a builder lambda.
- */
- public final Builder reservedSizes(Function> fn) {
- return reservedSizes(fn.apply(new ReservedSize.Builder()).build());
- }
-
/**
* Builds a {@link ClusterInfo}.
*
- * @throws NullPointerException
- * if some of the required fields are null.
+ * @throws NullPointerException if some of the required fields are null.
*/
+ @Override
+ @Nonnull
public ClusterInfo build() {
_checkSingleUse();
@@ -340,17 +411,37 @@ public ClusterInfo build() {
);
protected static void setupClusterInfoDeserializer(ObjectDeserializer op) {
-
op.add(Builder::nodes, JsonpDeserializer.stringMapDeserializer(NodeDiskUsage._DESERIALIZER), "nodes");
- op.add(Builder::shardSizes, JsonpDeserializer.stringMapDeserializer(JsonpDeserializer.longDeserializer()), "shard_sizes");
+ op.add(Builder::reservedSizes, JsonpDeserializer.arrayDeserializer(ReservedSize._DESERIALIZER), "reserved_sizes");
op.add(
Builder::shardDataSetSizes,
JsonpDeserializer.stringMapDeserializer(JsonpDeserializer.stringDeserializer()),
"shard_data_set_sizes"
);
op.add(Builder::shardPaths, JsonpDeserializer.stringMapDeserializer(JsonpDeserializer.stringDeserializer()), "shard_paths");
- op.add(Builder::reservedSizes, JsonpDeserializer.arrayDeserializer(ReservedSize._DESERIALIZER), "reserved_sizes");
+ op.add(Builder::shardSizes, JsonpDeserializer.stringMapDeserializer(JsonpDeserializer.stringDeserializer()), "shard_sizes");
+ }
+ @Override
+ public int hashCode() {
+ int result = 17;
+ result = 31 * result + this.nodes.hashCode();
+ result = 31 * result + this.reservedSizes.hashCode();
+ result = 31 * result + Objects.hashCode(this.shardDataSetSizes);
+ result = 31 * result + this.shardPaths.hashCode();
+ result = 31 * result + this.shardSizes.hashCode();
+ return result;
}
+ @Override
+ public boolean equals(Object o) {
+ if (this == o) return true;
+ if (o == null || this.getClass() != o.getClass()) return false;
+ ClusterInfo other = (ClusterInfo) o;
+ return this.nodes.equals(other.nodes)
+ && this.reservedSizes.equals(other.reservedSizes)
+ && Objects.equals(this.shardDataSetSizes, other.shardDataSetSizes)
+ && this.shardPaths.equals(other.shardPaths)
+ && this.shardSizes.equals(other.shardSizes);
+ }
}
diff --git a/java-client/src/main/java/org/opensearch/client/opensearch/cluster/allocation_explain/CurrentNode.java b/java-client/src/generated/java/org/opensearch/client/opensearch/cluster/allocation_explain/CurrentNode.java
similarity index 69%
rename from java-client/src/main/java/org/opensearch/client/opensearch/cluster/allocation_explain/CurrentNode.java
rename to java-client/src/generated/java/org/opensearch/client/opensearch/cluster/allocation_explain/CurrentNode.java
index 441340aaa4..55d99fa11c 100644
--- a/java-client/src/main/java/org/opensearch/client/opensearch/cluster/allocation_explain/CurrentNode.java
+++ b/java-client/src/generated/java/org/opensearch/client/opensearch/cluster/allocation_explain/CurrentNode.java
@@ -30,11 +30,17 @@
* GitHub history for details.
*/
+//----------------------------------------------------
+// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST.
+//----------------------------------------------------
+
package org.opensearch.client.opensearch.cluster.allocation_explain;
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,19 +48,27 @@
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.allocation_explain.CurrentNode
@JsonpDeserializable
-public class CurrentNode implements PlainJsonSerializable {
+@Generated("org.opensearch.client.codegen.CodeGenerator")
+public class CurrentNode implements PlainJsonSerializable, ToCopyableBuilder {
+
+ @Nonnull
+ private final Map attributes;
+
+ @Nonnull
private final String id;
+ @Nonnull
private final String name;
- private final Map attributes;
-
+ @Nonnull
private final String transportAddress;
private final int weightRanking;
@@ -62,22 +76,29 @@ public class CurrentNode implements PlainJsonSerializable {
// ---------------------------------------------------------------------------------------------
private CurrentNode(Builder builder) {
-
+ this.attributes = ApiTypeHelper.unmodifiableRequired(builder.attributes, this, "attributes");
this.id = ApiTypeHelper.requireNonNull(builder.id, this, "id");
this.name = ApiTypeHelper.requireNonNull(builder.name, this, "name");
- this.attributes = ApiTypeHelper.unmodifiableRequired(builder.attributes, this, "attributes");
this.transportAddress = ApiTypeHelper.requireNonNull(builder.transportAddress, this, "transportAddress");
this.weightRanking = ApiTypeHelper.requireNonNull(builder.weightRanking, this, "weightRanking");
-
}
- public static CurrentNode of(Function> fn) {
+ public static CurrentNode of(Function> fn) {
return fn.apply(new Builder()).build();
}
+ /**
+ * Required - API name: {@code attributes}
+ */
+ @Nonnull
+ public final Map attributes() {
+ return this.attributes;
+ }
+
/**
* Required - API name: {@code id}
*/
+ @Nonnull
public final String id() {
return this.id;
}
@@ -85,20 +106,15 @@ public final String id() {
/**
* Required - API name: {@code name}
*/
+ @Nonnull
public final String name() {
return this.name;
}
- /**
- * Required - API name: {@code attributes}
- */
- public final Map attributes() {
- return this.attributes;
- }
-
/**
* Required - API name: {@code transport_address}
*/
+ @Nonnull
public final String transportAddress() {
return this.transportAddress;
}
@@ -113,6 +129,7 @@ public final int weightRanking() {
/**
* Serialize this object to JSON.
*/
+ @Override
public void serialize(JsonGenerator generator, JsonpMapper mapper) {
generator.writeStartObject();
serializeInternal(generator, mapper);
@@ -120,6 +137,13 @@ public void serialize(JsonGenerator generator, JsonpMapper mapper) {
}
protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) {
+ generator.writeKey("attributes");
+ generator.writeStartObject();
+ for (Map.Entry item0 : this.attributes.entrySet()) {
+ generator.writeKey(item0.getKey());
+ generator.write(item0.getValue());
+ }
+ generator.writeEnd();
generator.writeKey("id");
generator.write(this.id);
@@ -127,63 +151,68 @@ protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) {
generator.writeKey("name");
generator.write(this.name);
- if (ApiTypeHelper.isDefined(this.attributes)) {
- generator.writeKey("attributes");
- generator.writeStartObject();
- for (Map.Entry item0 : this.attributes.entrySet()) {
- generator.writeKey(item0.getKey());
- generator.write(item0.getValue());
-
- }
- generator.writeEnd();
-
- }
generator.writeKey("transport_address");
generator.write(this.transportAddress);
generator.writeKey("weight_ranking");
generator.write(this.weightRanking);
-
}
// ---------------------------------------------------------------------------------------------
+ @Override
+ @Nonnull
+ public Builder toBuilder() {
+ return new Builder(this);
+ }
+
+ @Nonnull
+ public static Builder builder() {
+ return new Builder();
+ }
+
/**
* Builder for {@link CurrentNode}.
*/
-
- public static class Builder extends ObjectBuilderBase implements ObjectBuilder {
+ public static class Builder extends ObjectBuilderBase implements CopyableBuilder {
+ private Map attributes;
private String id;
-
private String name;
-
- private Map attributes;
-
private String transportAddress;
-
private Integer weightRanking;
- /**
- * Required - API name: {@code id}
- */
- public final Builder id(String value) {
- this.id = value;
- return this;
+ public Builder() {}
+
+ private Builder(CurrentNode o) {
+ this.attributes = _mapCopy(o.attributes);
+ this.id = o.id;
+ this.name = o.name;
+ this.transportAddress = o.transportAddress;
+ this.weightRanking = o.weightRanking;
}
- /**
- * Required - API name: {@code name}
- */
- public final Builder name(String value) {
- this.name = value;
- return this;
+ private Builder(Builder o) {
+ this.attributes = _mapCopy(o.attributes);
+ this.id = o.id;
+ this.name = o.name;
+ this.transportAddress = o.transportAddress;
+ this.weightRanking = o.weightRanking;
+ }
+
+ @Override
+ @Nonnull
+ public Builder copy() {
+ return new Builder(this);
}
/**
* Required - API name: {@code attributes}
+ *
*
- * Adds all entries of map
to attributes
.
+ * Adds all elements of map
to attributes
.
+ *
*/
+ @Nonnull
public final Builder attributes(Map map) {
this.attributes = _mapPutAll(this.attributes, map);
return this;
@@ -191,17 +220,39 @@ public final Builder attributes(Map map) {
/**
* Required - API name: {@code attributes}
+ *
*
* Adds an entry to attributes
.
+ *
*/
+ @Nonnull
public final Builder attributes(String key, String value) {
this.attributes = _mapPut(this.attributes, key, value);
return this;
}
+ /**
+ * Required - API name: {@code id}
+ */
+ @Nonnull
+ public final Builder id(String value) {
+ this.id = value;
+ return this;
+ }
+
+ /**
+ * Required - API name: {@code name}
+ */
+ @Nonnull
+ public final Builder name(String value) {
+ this.name = value;
+ return this;
+ }
+
/**
* Required - API name: {@code transport_address}
*/
+ @Nonnull
public final Builder transportAddress(String value) {
this.transportAddress = value;
return this;
@@ -210,6 +261,7 @@ public final Builder transportAddress(String value) {
/**
* Required - API name: {@code weight_ranking}
*/
+ @Nonnull
public final Builder weightRanking(int value) {
this.weightRanking = value;
return this;
@@ -218,9 +270,10 @@ public final Builder weightRanking(int value) {
/**
* Builds a {@link CurrentNode}.
*
- * @throws NullPointerException
- * if some of the required fields are null.
+ * @throws NullPointerException if some of the required fields are null.
*/
+ @Override
+ @Nonnull
public CurrentNode build() {
_checkSingleUse();
@@ -239,13 +292,33 @@ public CurrentNode build() {
);
protected static void setupCurrentNodeDeserializer(ObjectDeserializer op) {
-
+ op.add(Builder::attributes, JsonpDeserializer.stringMapDeserializer(JsonpDeserializer.stringDeserializer()), "attributes");
op.add(Builder::id, JsonpDeserializer.stringDeserializer(), "id");
op.add(Builder::name, JsonpDeserializer.stringDeserializer(), "name");
- op.add(Builder::attributes, JsonpDeserializer.stringMapDeserializer(JsonpDeserializer.stringDeserializer()), "attributes");
op.add(Builder::transportAddress, JsonpDeserializer.stringDeserializer(), "transport_address");
op.add(Builder::weightRanking, JsonpDeserializer.integerDeserializer(), "weight_ranking");
+ }
+ @Override
+ public int hashCode() {
+ int result = 17;
+ result = 31 * result + this.attributes.hashCode();
+ result = 31 * result + this.id.hashCode();
+ result = 31 * result + this.name.hashCode();
+ result = 31 * result + this.transportAddress.hashCode();
+ result = 31 * result + Integer.hashCode(this.weightRanking);
+ return result;
}
+ @Override
+ public boolean equals(Object o) {
+ if (this == o) return true;
+ if (o == null || this.getClass() != o.getClass()) return false;
+ CurrentNode other = (CurrentNode) o;
+ return this.attributes.equals(other.attributes)
+ && this.id.equals(other.id)
+ && this.name.equals(other.name)
+ && this.transportAddress.equals(other.transportAddress)
+ && this.weightRanking == other.weightRanking;
+ }
}
diff --git a/java-client/src/main/java/org/opensearch/client/opensearch/cluster/allocation_explain/Decision.java b/java-client/src/generated/java/org/opensearch/client/opensearch/cluster/allocation_explain/Decision.java
similarity index 85%
rename from java-client/src/main/java/org/opensearch/client/opensearch/cluster/allocation_explain/Decision.java
rename to java-client/src/generated/java/org/opensearch/client/opensearch/cluster/allocation_explain/Decision.java
index 6d152438b2..0145ded795 100644
--- a/java-client/src/main/java/org/opensearch/client/opensearch/cluster/allocation_explain/Decision.java
+++ b/java-client/src/generated/java/org/opensearch/client/opensearch/cluster/allocation_explain/Decision.java
@@ -30,30 +30,36 @@
* GitHub history for details.
*/
+//----------------------------------------------------
+// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST.
+//----------------------------------------------------
+
package org.opensearch.client.opensearch.cluster.allocation_explain;
+import javax.annotation.Generated;
import org.opensearch.client.json.JsonEnum;
import org.opensearch.client.json.JsonpDeserializable;
+// typedef: cluster.allocation_explain.Decision
+
@JsonpDeserializable
+@Generated("org.opensearch.client.codegen.CodeGenerator")
public enum Decision implements JsonEnum {
- Yes("yes"),
-
- No("no"),
-
- WorseBalance("worse_balance"),
-
- Throttled("throttled"),
+ AllocationDelayed("allocation_delayed"),
AwaitingInfo("awaiting_info"),
- AllocationDelayed("allocation_delayed"),
+ No("no"),
+
+ NoAttempt("no_attempt"),
NoValidShardCopy("no_valid_shard_copy"),
- NoAttempt("no_attempt"),
+ Throttled("throttled"),
+
+ WorseBalance("worse_balance"),
- ;
+ Yes("yes");
private final String jsonValue;
diff --git a/java-client/src/main/java/org/opensearch/client/opensearch/cluster/allocation_explain/DiskUsage.java b/java-client/src/generated/java/org/opensearch/client/opensearch/cluster/allocation_explain/DiskUsage.java
similarity index 57%
rename from java-client/src/main/java/org/opensearch/client/opensearch/cluster/allocation_explain/DiskUsage.java
rename to java-client/src/generated/java/org/opensearch/client/opensearch/cluster/allocation_explain/DiskUsage.java
index 3b061ba5f0..cbfdbd92f7 100644
--- a/java-client/src/main/java/org/opensearch/client/opensearch/cluster/allocation_explain/DiskUsage.java
+++ b/java-client/src/generated/java/org/opensearch/client/opensearch/cluster/allocation_explain/DiskUsage.java
@@ -30,10 +30,18 @@
* GitHub history for details.
*/
+//----------------------------------------------------
+// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST.
+//----------------------------------------------------
+
package org.opensearch.client.opensearch.cluster.allocation_explain;
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;
@@ -41,75 +49,115 @@
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.allocation_explain.DiskUsage
@JsonpDeserializable
-public class DiskUsage implements PlainJsonSerializable {
- private final String path;
+@Generated("org.opensearch.client.codegen.CodeGenerator")
+public class DiskUsage implements PlainJsonSerializable, ToCopyableBuilder {
- private final long totalBytes;
-
- private final long usedBytes;
+ @Nullable
+ private final String free;
private final long freeBytes;
private final double freeDiskPercent;
+ @Nonnull
+ private final String path;
+
+ @Nullable
+ private final String total;
+
+ private final long totalBytes;
+
+ @Nullable
+ private final String used;
+
+ private final long usedBytes;
+
private final double usedDiskPercent;
// ---------------------------------------------------------------------------------------------
private DiskUsage(Builder builder) {
-
+ this.free = builder.free;
+ this.freeBytes = ApiTypeHelper.requireNonNull(builder.freeBytes, this, "freeBytes");
+ this.freeDiskPercent = ApiTypeHelper.requireNonNull(builder.freeDiskPercent, this, "freeDiskPercent");
this.path = ApiTypeHelper.requireNonNull(builder.path, this, "path");
+ this.total = builder.total;
this.totalBytes = ApiTypeHelper.requireNonNull(builder.totalBytes, this, "totalBytes");
+ this.used = builder.used;
this.usedBytes = ApiTypeHelper.requireNonNull(builder.usedBytes, this, "usedBytes");
- this.freeBytes = ApiTypeHelper.requireNonNull(builder.freeBytes, this, "freeBytes");
- this.freeDiskPercent = ApiTypeHelper.requireNonNull(builder.freeDiskPercent, this, "freeDiskPercent");
this.usedDiskPercent = ApiTypeHelper.requireNonNull(builder.usedDiskPercent, this, "usedDiskPercent");
-
}
- public static DiskUsage of(Function> fn) {
+ public static DiskUsage of(Function> fn) {
return fn.apply(new Builder()).build();
}
+ /**
+ * API name: {@code free}
+ */
+ @Nullable
+ public final String free() {
+ return this.free;
+ }
+
+ /**
+ * Required - API name: {@code free_bytes}
+ */
+ public final long freeBytes() {
+ return this.freeBytes;
+ }
+
+ /**
+ * Required - API name: {@code free_disk_percent}
+ */
+ public final double freeDiskPercent() {
+ return this.freeDiskPercent;
+ }
+
/**
* Required - API name: {@code path}
*/
+ @Nonnull
public final String path() {
return this.path;
}
/**
- * Required - API name: {@code total_bytes}
+ * API name: {@code total}
*/
- public final long totalBytes() {
- return this.totalBytes;
+ @Nullable
+ public final String total() {
+ return this.total;
}
/**
- * Required - API name: {@code used_bytes}
+ * Required - API name: {@code total_bytes}
*/
- public final long usedBytes() {
- return this.usedBytes;
+ public final long totalBytes() {
+ return this.totalBytes;
}
/**
- * Required - API name: {@code free_bytes}
+ * API name: {@code used}
*/
- public final long freeBytes() {
- return this.freeBytes;
+ @Nullable
+ public final String used() {
+ return this.used;
}
/**
- * Required - API name: {@code free_disk_percent}
+ * Required - API name: {@code used_bytes}
*/
- public final double freeDiskPercent() {
- return this.freeDiskPercent;
+ public final long usedBytes() {
+ return this.usedBytes;
}
/**
@@ -122,6 +170,7 @@ public final double usedDiskPercent() {
/**
* Serialize this object to JSON.
*/
+ @Override
public void serialize(JsonGenerator generator, JsonpMapper mapper) {
generator.writeStartObject();
serializeInternal(generator, mapper);
@@ -129,89 +178,178 @@ public void serialize(JsonGenerator generator, JsonpMapper mapper) {
}
protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) {
+ if (this.free != null) {
+ generator.writeKey("free");
+ generator.write(this.free);
+ }
+
+ generator.writeKey("free_bytes");
+ generator.write(this.freeBytes);
+
+ generator.writeKey("free_disk_percent");
+ generator.write(this.freeDiskPercent);
generator.writeKey("path");
generator.write(this.path);
+ if (this.total != null) {
+ generator.writeKey("total");
+ generator.write(this.total);
+ }
+
generator.writeKey("total_bytes");
generator.write(this.totalBytes);
+ if (this.used != null) {
+ generator.writeKey("used");
+ generator.write(this.used);
+ }
+
generator.writeKey("used_bytes");
generator.write(this.usedBytes);
- generator.writeKey("free_bytes");
- generator.write(this.freeBytes);
-
- generator.writeKey("free_disk_percent");
- generator.write(this.freeDiskPercent);
-
generator.writeKey("used_disk_percent");
generator.write(this.usedDiskPercent);
-
}
// ---------------------------------------------------------------------------------------------
+ @Override
+ @Nonnull
+ public Builder toBuilder() {
+ return new Builder(this);
+ }
+
+ @Nonnull
+ public static Builder builder() {
+ return new Builder();
+ }
+
/**
* Builder for {@link DiskUsage}.
*/
-
- public static class Builder extends ObjectBuilderBase implements ObjectBuilder {
+ public static class Builder extends ObjectBuilderBase implements CopyableBuilder {
+ @Nullable
+ private String free;
+ private Long freeBytes;
+ private Double freeDiskPercent;
private String path;
-
+ @Nullable
+ private String total;
private Long totalBytes;
-
+ @Nullable
+ private String used;
private Long usedBytes;
+ private Double usedDiskPercent;
- private Long freeBytes;
+ public Builder() {}
+
+ private Builder(DiskUsage o) {
+ this.free = o.free;
+ this.freeBytes = o.freeBytes;
+ this.freeDiskPercent = o.freeDiskPercent;
+ this.path = o.path;
+ this.total = o.total;
+ this.totalBytes = o.totalBytes;
+ this.used = o.used;
+ this.usedBytes = o.usedBytes;
+ this.usedDiskPercent = o.usedDiskPercent;
+ }
- private Double freeDiskPercent;
+ private Builder(Builder o) {
+ this.free = o.free;
+ this.freeBytes = o.freeBytes;
+ this.freeDiskPercent = o.freeDiskPercent;
+ this.path = o.path;
+ this.total = o.total;
+ this.totalBytes = o.totalBytes;
+ this.used = o.used;
+ this.usedBytes = o.usedBytes;
+ this.usedDiskPercent = o.usedDiskPercent;
+ }
- private Double usedDiskPercent;
+ @Override
+ @Nonnull
+ public Builder copy() {
+ return new Builder(this);
+ }
+
+ /**
+ * API name: {@code free}
+ */
+ @Nonnull
+ public final Builder free(@Nullable String value) {
+ this.free = value;
+ return this;
+ }
+
+ /**
+ * Required - API name: {@code free_bytes}
+ */
+ @Nonnull
+ public final Builder freeBytes(long value) {
+ this.freeBytes = value;
+ return this;
+ }
+
+ /**
+ * Required - API name: {@code free_disk_percent}
+ */
+ @Nonnull
+ public final Builder freeDiskPercent(double value) {
+ this.freeDiskPercent = value;
+ return this;
+ }
/**
* Required - API name: {@code path}
*/
+ @Nonnull
public final Builder path(String value) {
this.path = value;
return this;
}
/**
- * Required - API name: {@code total_bytes}
+ * API name: {@code total}
*/
- public final Builder totalBytes(long value) {
- this.totalBytes = value;
+ @Nonnull
+ public final Builder total(@Nullable String value) {
+ this.total = value;
return this;
}
/**
- * Required - API name: {@code used_bytes}
+ * Required - API name: {@code total_bytes}
*/
- public final Builder usedBytes(long value) {
- this.usedBytes = value;
+ @Nonnull
+ public final Builder totalBytes(long value) {
+ this.totalBytes = value;
return this;
}
/**
- * Required - API name: {@code free_bytes}
+ * API name: {@code used}
*/
- public final Builder freeBytes(long value) {
- this.freeBytes = value;
+ @Nonnull
+ public final Builder used(@Nullable String value) {
+ this.used = value;
return this;
}
/**
- * Required - API name: {@code free_disk_percent}
+ * Required - API name: {@code used_bytes}
*/
- public final Builder freeDiskPercent(double value) {
- this.freeDiskPercent = value;
+ @Nonnull
+ public final Builder usedBytes(long value) {
+ this.usedBytes = value;
return this;
}
/**
* Required - API name: {@code used_disk_percent}
*/
+ @Nonnull
public final Builder usedDiskPercent(double value) {
this.usedDiskPercent = value;
return this;
@@ -220,9 +358,10 @@ public final Builder usedDiskPercent(double value) {
/**
* Builds a {@link DiskUsage}.
*
- * @throws NullPointerException
- * if some of the required fields are null.
+ * @throws NullPointerException if some of the required fields are null.
*/
+ @Override
+ @Nonnull
public DiskUsage build() {
_checkSingleUse();
@@ -241,14 +380,45 @@ public DiskUsage build() {
);
protected static void setupDiskUsageDeserializer(ObjectDeserializer op) {
-
+ op.add(Builder::free, JsonpDeserializer.stringDeserializer(), "free");
+ op.add(Builder::freeBytes, JsonpDeserializer.longDeserializer(), "free_bytes");
+ op.add(Builder::freeDiskPercent, JsonpDeserializer.doubleDeserializer(), "free_disk_percent");
op.add(Builder::path, JsonpDeserializer.stringDeserializer(), "path");
+ op.add(Builder::total, JsonpDeserializer.stringDeserializer(), "total");
op.add(Builder::totalBytes, JsonpDeserializer.longDeserializer(), "total_bytes");
+ op.add(Builder::used, JsonpDeserializer.stringDeserializer(), "used");
op.add(Builder::usedBytes, JsonpDeserializer.longDeserializer(), "used_bytes");
- op.add(Builder::freeBytes, JsonpDeserializer.longDeserializer(), "free_bytes");
- op.add(Builder::freeDiskPercent, JsonpDeserializer.doubleDeserializer(), "free_disk_percent");
op.add(Builder::usedDiskPercent, JsonpDeserializer.doubleDeserializer(), "used_disk_percent");
+ }
+ @Override
+ public int hashCode() {
+ int result = 17;
+ result = 31 * result + Objects.hashCode(this.free);
+ result = 31 * result + Long.hashCode(this.freeBytes);
+ result = 31 * result + Double.hashCode(this.freeDiskPercent);
+ result = 31 * result + this.path.hashCode();
+ result = 31 * result + Objects.hashCode(this.total);
+ result = 31 * result + Long.hashCode(this.totalBytes);
+ result = 31 * result + Objects.hashCode(this.used);
+ result = 31 * result + Long.hashCode(this.usedBytes);
+ result = 31 * result + Double.hashCode(this.usedDiskPercent);
+ return result;
}
+ @Override
+ public boolean equals(Object o) {
+ if (this == o) return true;
+ if (o == null || this.getClass() != o.getClass()) return false;
+ DiskUsage other = (DiskUsage) o;
+ return Objects.equals(this.free, other.free)
+ && this.freeBytes == other.freeBytes
+ && this.freeDiskPercent == other.freeDiskPercent
+ && this.path.equals(other.path)
+ && Objects.equals(this.total, other.total)
+ && this.totalBytes == other.totalBytes
+ && Objects.equals(this.used, other.used)
+ && this.usedBytes == other.usedBytes
+ && this.usedDiskPercent == other.usedDiskPercent;
+ }
}
diff --git a/java-client/src/main/java/org/opensearch/client/opensearch/cluster/allocation_explain/NodeAllocationExplanation.java b/java-client/src/generated/java/org/opensearch/client/opensearch/cluster/allocation_explain/NodeAllocationExplanation.java
similarity index 66%
rename from java-client/src/main/java/org/opensearch/client/opensearch/cluster/allocation_explain/NodeAllocationExplanation.java
rename to java-client/src/generated/java/org/opensearch/client/opensearch/cluster/allocation_explain/NodeAllocationExplanation.java
index 79c7783b31..97f031b238 100644
--- a/java-client/src/main/java/org/opensearch/client/opensearch/cluster/allocation_explain/NodeAllocationExplanation.java
+++ b/java-client/src/generated/java/org/opensearch/client/opensearch/cluster/allocation_explain/NodeAllocationExplanation.java
@@ -30,12 +30,19 @@
* GitHub history for details.
*/
+//----------------------------------------------------
+// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST.
+//----------------------------------------------------
+
package org.opensearch.client.opensearch.cluster.allocation_explain;
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;
@@ -44,34 +51,47 @@
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.allocation_explain.NodeAllocationExplanation
@JsonpDeserializable
-public class NodeAllocationExplanation implements PlainJsonSerializable {
+@Generated("org.opensearch.client.codegen.CodeGenerator")
+public class NodeAllocationExplanation
+ implements
+ PlainJsonSerializable,
+ ToCopyableBuilder {
+
+ @Nonnull
private final List deciders;
+ @Nonnull
private final Map nodeAttributes;
+ @Nonnull
private final Decision nodeDecision;
+ @Nonnull
private final String nodeId;
+ @Nonnull
private final String nodeName;
@Nullable
private final AllocationStore store;
+ @Nonnull
private final String transportAddress;
- private final int weightRanking;
+ @Nullable
+ private final Integer weightRanking;
// ---------------------------------------------------------------------------------------------
private NodeAllocationExplanation(Builder builder) {
-
this.deciders = ApiTypeHelper.unmodifiableRequired(builder.deciders, this, "deciders");
this.nodeAttributes = ApiTypeHelper.unmodifiableRequired(builder.nodeAttributes, this, "nodeAttributes");
this.nodeDecision = ApiTypeHelper.requireNonNull(builder.nodeDecision, this, "nodeDecision");
@@ -79,17 +99,17 @@ private NodeAllocationExplanation(Builder builder) {
this.nodeName = ApiTypeHelper.requireNonNull(builder.nodeName, this, "nodeName");
this.store = builder.store;
this.transportAddress = ApiTypeHelper.requireNonNull(builder.transportAddress, this, "transportAddress");
- this.weightRanking = ApiTypeHelper.requireNonNull(builder.weightRanking, this, "weightRanking");
-
+ this.weightRanking = builder.weightRanking;
}
- public static NodeAllocationExplanation of(Function> fn) {
+ public static NodeAllocationExplanation of(Function> fn) {
return fn.apply(new Builder()).build();
}
/**
* Required - API name: {@code deciders}
*/
+ @Nonnull
public final List deciders() {
return this.deciders;
}
@@ -97,6 +117,7 @@ public final List deciders() {
/**
* Required - API name: {@code node_attributes}
*/
+ @Nonnull
public final Map nodeAttributes() {
return this.nodeAttributes;
}
@@ -104,6 +125,7 @@ public final Map nodeAttributes() {
/**
* Required - API name: {@code node_decision}
*/
+ @Nonnull
public final Decision nodeDecision() {
return this.nodeDecision;
}
@@ -111,6 +133,7 @@ public final Decision nodeDecision() {
/**
* Required - API name: {@code node_id}
*/
+ @Nonnull
public final String nodeId() {
return this.nodeId;
}
@@ -118,6 +141,7 @@ public final String nodeId() {
/**
* Required - API name: {@code node_name}
*/
+ @Nonnull
public final String nodeName() {
return this.nodeName;
}
@@ -133,20 +157,23 @@ public final AllocationStore store() {
/**
* Required - API name: {@code transport_address}
*/
+ @Nonnull
public final String transportAddress() {
return this.transportAddress;
}
/**
- * Required - API name: {@code weight_ranking}
+ * API name: {@code weight_ranking}
*/
- public final int weightRanking() {
+ @Nullable
+ public final Integer weightRanking() {
return this.weightRanking;
}
/**
* Serialize this object to JSON.
*/
+ @Override
public void serialize(JsonGenerator generator, JsonpMapper mapper) {
generator.writeStartObject();
serializeInternal(generator, mapper);
@@ -154,30 +181,24 @@ public void serialize(JsonGenerator generator, JsonpMapper mapper) {
}
protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) {
-
- if (ApiTypeHelper.isDefined(this.deciders)) {
- generator.writeKey("deciders");
- generator.writeStartArray();
- for (AllocationDecision item0 : this.deciders) {
- item0.serialize(generator, mapper);
-
- }
- generator.writeEnd();
-
+ generator.writeKey("deciders");
+ generator.writeStartArray();
+ for (AllocationDecision item0 : this.deciders) {
+ item0.serialize(generator, mapper);
}
- if (ApiTypeHelper.isDefined(this.nodeAttributes)) {
- generator.writeKey("node_attributes");
- generator.writeStartObject();
- for (Map.Entry item0 : this.nodeAttributes.entrySet()) {
- generator.writeKey(item0.getKey());
- generator.write(item0.getValue());
-
- }
- generator.writeEnd();
+ generator.writeEnd();
+ generator.writeKey("node_attributes");
+ generator.writeStartObject();
+ for (Map.Entry item0 : this.nodeAttributes.entrySet()) {
+ generator.writeKey(item0.getKey());
+ generator.write(item0.getValue());
}
+ generator.writeEnd();
+
generator.writeKey("node_decision");
this.nodeDecision.serialize(generator, mapper);
+
generator.writeKey("node_id");
generator.write(this.nodeId);
@@ -187,45 +208,83 @@ protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) {
if (this.store != null) {
generator.writeKey("store");
this.store.serialize(generator, mapper);
-
}
+
generator.writeKey("transport_address");
generator.write(this.transportAddress);
- generator.writeKey("weight_ranking");
- generator.write(this.weightRanking);
-
+ if (this.weightRanking != null) {
+ generator.writeKey("weight_ranking");
+ generator.write(this.weightRanking);
+ }
}
// ---------------------------------------------------------------------------------------------
+ @Override
+ @Nonnull
+ public Builder toBuilder() {
+ return new Builder(this);
+ }
+
+ @Nonnull
+ public static Builder builder() {
+ return new Builder();
+ }
+
/**
* Builder for {@link NodeAllocationExplanation}.
*/
-
- public static class Builder extends ObjectBuilderBase implements ObjectBuilder {
+ public static class Builder extends ObjectBuilderBase implements CopyableBuilder {
private List deciders;
-
private Map nodeAttributes;
-
private Decision nodeDecision;
-
private String nodeId;
-
private String nodeName;
-
@Nullable
private AllocationStore store;
-
private String transportAddress;
-
+ @Nullable
private Integer weightRanking;
+ public Builder() {}
+
+ private Builder(NodeAllocationExplanation o) {
+ this.deciders = _listCopy(o.deciders);
+ this.nodeAttributes = _mapCopy(o.nodeAttributes);
+ this.nodeDecision = o.nodeDecision;
+ this.nodeId = o.nodeId;
+ this.nodeName = o.nodeName;
+ this.store = o.store;
+ this.transportAddress = o.transportAddress;
+ this.weightRanking = o.weightRanking;
+ }
+
+ private Builder(Builder o) {
+ this.deciders = _listCopy(o.deciders);
+ this.nodeAttributes = _mapCopy(o.nodeAttributes);
+ this.nodeDecision = o.nodeDecision;
+ this.nodeId = o.nodeId;
+ this.nodeName = o.nodeName;
+ this.store = o.store;
+ this.transportAddress = o.transportAddress;
+ this.weightRanking = o.weightRanking;
+ }
+
+ @Override
+ @Nonnull
+ public Builder copy() {
+ return new Builder(this);
+ }
+
/**
* Required - API name: {@code deciders}
+ *
*
* Adds all elements of list
to deciders
.
+ *
*/
+ @Nonnull
public final Builder deciders(List list) {
this.deciders = _listAddAll(this.deciders, list);
return this;
@@ -233,9 +292,12 @@ public final Builder deciders(List list) {
/**
* Required - API name: {@code deciders}
+ *
*
* Adds one or more values to deciders
.
+ *
*/
+ @Nonnull
public final Builder deciders(AllocationDecision value, AllocationDecision... values) {
this.deciders = _listAdd(this.deciders, value, values);
return this;
@@ -243,18 +305,24 @@ public final Builder deciders(AllocationDecision value, AllocationDecision... va
/**
* Required - API name: {@code deciders}
+ *
*
* Adds a value to deciders
using a builder lambda.
+ *
*/
+ @Nonnull
public final Builder deciders(Function> fn) {
return deciders(fn.apply(new AllocationDecision.Builder()).build());
}
/**
* Required - API name: {@code node_attributes}
+ *
*
- * Adds all entries of map
to nodeAttributes
.
+ * Adds all elements of map
to nodeAttributes
.
+ *
*/
+ @Nonnull
public final Builder nodeAttributes(Map map) {
this.nodeAttributes = _mapPutAll(this.nodeAttributes, map);
return this;
@@ -262,9 +330,12 @@ public final Builder nodeAttributes(Map map) {
/**
* Required - API name: {@code node_attributes}
+ *
*
* Adds an entry to nodeAttributes
.
+ *
*/
+ @Nonnull
public final Builder nodeAttributes(String key, String value) {
this.nodeAttributes = _mapPut(this.nodeAttributes, key, value);
return this;
@@ -273,6 +344,7 @@ public final Builder nodeAttributes(String key, String value) {
/**
* Required - API name: {@code node_decision}
*/
+ @Nonnull
public final Builder nodeDecision(Decision value) {
this.nodeDecision = value;
return this;
@@ -281,6 +353,7 @@ public final Builder nodeDecision(Decision value) {
/**
* Required - API name: {@code node_id}
*/
+ @Nonnull
public final Builder nodeId(String value) {
this.nodeId = value;
return this;
@@ -289,6 +362,7 @@ public final Builder nodeId(String value) {
/**
* Required - API name: {@code node_name}
*/
+ @Nonnull
public final Builder nodeName(String value) {
this.nodeName = value;
return this;
@@ -297,6 +371,7 @@ public final Builder nodeName(String value) {
/**
* API name: {@code store}
*/
+ @Nonnull
public final Builder store(@Nullable AllocationStore value) {
this.store = value;
return this;
@@ -305,22 +380,25 @@ public final Builder store(@Nullable AllocationStore value) {
/**
* API name: {@code store}
*/
+ @Nonnull
public final Builder store(Function> fn) {
- return this.store(fn.apply(new AllocationStore.Builder()).build());
+ return store(fn.apply(new AllocationStore.Builder()).build());
}
/**
* Required - API name: {@code transport_address}
*/
+ @Nonnull
public final Builder transportAddress(String value) {
this.transportAddress = value;
return this;
}
/**
- * Required - API name: {@code weight_ranking}
+ * API name: {@code weight_ranking}
*/
- public final Builder weightRanking(int value) {
+ @Nonnull
+ public final Builder weightRanking(@Nullable Integer value) {
this.weightRanking = value;
return this;
}
@@ -328,9 +406,10 @@ public final Builder weightRanking(int value) {
/**
* Builds a {@link NodeAllocationExplanation}.
*
- * @throws NullPointerException
- * if some of the required fields are null.
+ * @throws NullPointerException if some of the required fields are null.
*/
+ @Override
+ @Nonnull
public NodeAllocationExplanation build() {
_checkSingleUse();
@@ -349,7 +428,6 @@ public NodeAllocationExplanation build() {
);
protected static void setupNodeAllocationExplanationDeserializer(ObjectDeserializer op) {
-
op.add(Builder::deciders, JsonpDeserializer.arrayDeserializer(AllocationDecision._DESERIALIZER), "deciders");
op.add(Builder::nodeAttributes, JsonpDeserializer.stringMapDeserializer(JsonpDeserializer.stringDeserializer()), "node_attributes");
op.add(Builder::nodeDecision, Decision._DESERIALIZER, "node_decision");
@@ -358,7 +436,34 @@ protected static void setupNodeAllocationExplanationDeserializer(ObjectDeseriali
op.add(Builder::store, AllocationStore._DESERIALIZER, "store");
op.add(Builder::transportAddress, JsonpDeserializer.stringDeserializer(), "transport_address");
op.add(Builder::weightRanking, JsonpDeserializer.integerDeserializer(), "weight_ranking");
+ }
+ @Override
+ public int hashCode() {
+ int result = 17;
+ result = 31 * result + this.deciders.hashCode();
+ result = 31 * result + this.nodeAttributes.hashCode();
+ result = 31 * result + this.nodeDecision.hashCode();
+ result = 31 * result + this.nodeId.hashCode();
+ result = 31 * result + this.nodeName.hashCode();
+ result = 31 * result + Objects.hashCode(this.store);
+ result = 31 * result + this.transportAddress.hashCode();
+ result = 31 * result + Objects.hashCode(this.weightRanking);
+ return result;
}
+ @Override
+ public boolean equals(Object o) {
+ if (this == o) return true;
+ if (o == null || this.getClass() != o.getClass()) return false;
+ NodeAllocationExplanation other = (NodeAllocationExplanation) o;
+ return this.deciders.equals(other.deciders)
+ && this.nodeAttributes.equals(other.nodeAttributes)
+ && this.nodeDecision.equals(other.nodeDecision)
+ && this.nodeId.equals(other.nodeId)
+ && this.nodeName.equals(other.nodeName)
+ && Objects.equals(this.store, other.store)
+ && this.transportAddress.equals(other.transportAddress)
+ && Objects.equals(this.weightRanking, other.weightRanking);
+ }
}
diff --git a/java-client/src/main/java/org/opensearch/client/opensearch/cluster/allocation_explain/NodeDiskUsage.java b/java-client/src/generated/java/org/opensearch/client/opensearch/cluster/allocation_explain/NodeDiskUsage.java
similarity index 70%
rename from java-client/src/main/java/org/opensearch/client/opensearch/cluster/allocation_explain/NodeDiskUsage.java
rename to java-client/src/generated/java/org/opensearch/client/opensearch/cluster/allocation_explain/NodeDiskUsage.java
index 7baacdeb83..a4f5ae523d 100644
--- a/java-client/src/main/java/org/opensearch/client/opensearch/cluster/allocation_explain/NodeDiskUsage.java
+++ b/java-client/src/generated/java/org/opensearch/client/opensearch/cluster/allocation_explain/NodeDiskUsage.java
@@ -30,10 +30,16 @@
* GitHub history for details.
*/
+//----------------------------------------------------
+// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST.
+//----------------------------------------------------
+
package org.opensearch.client.opensearch.cluster.allocation_explain;
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,43 +47,42 @@
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.allocation_explain.NodeDiskUsage
@JsonpDeserializable
-public class NodeDiskUsage implements PlainJsonSerializable {
- private final String nodeName;
+@Generated("org.opensearch.client.codegen.CodeGenerator")
+public class NodeDiskUsage implements PlainJsonSerializable, ToCopyableBuilder {
+ @Nonnull
private final DiskUsage leastAvailable;
+ @Nonnull
private final DiskUsage mostAvailable;
+ @Nonnull
+ private final String nodeName;
+
// ---------------------------------------------------------------------------------------------
private NodeDiskUsage(Builder builder) {
-
- this.nodeName = ApiTypeHelper.requireNonNull(builder.nodeName, this, "nodeName");
this.leastAvailable = ApiTypeHelper.requireNonNull(builder.leastAvailable, this, "leastAvailable");
this.mostAvailable = ApiTypeHelper.requireNonNull(builder.mostAvailable, this, "mostAvailable");
-
+ this.nodeName = ApiTypeHelper.requireNonNull(builder.nodeName, this, "nodeName");
}
- public static NodeDiskUsage of(Function> fn) {
+ public static NodeDiskUsage of(Function> fn) {
return fn.apply(new Builder()).build();
}
- /**
- * Required - API name: {@code node_name}
- */
- public final String nodeName() {
- return this.nodeName;
- }
-
/**
* Required - API name: {@code least_available}
*/
+ @Nonnull
public final DiskUsage leastAvailable() {
return this.leastAvailable;
}
@@ -85,13 +90,23 @@ public final DiskUsage leastAvailable() {
/**
* Required - API name: {@code most_available}
*/
+ @Nonnull
public final DiskUsage mostAvailable() {
return this.mostAvailable;
}
+ /**
+ * Required - API name: {@code node_name}
+ */
+ @Nonnull
+ public final String nodeName() {
+ return this.nodeName;
+ }
+
/**
* Serialize this object to JSON.
*/
+ @Override
public void serialize(JsonGenerator generator, JsonpMapper mapper) {
generator.writeStartObject();
serializeInternal(generator, mapper);
@@ -99,42 +114,61 @@ public void serialize(JsonGenerator generator, JsonpMapper mapper) {
}
protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) {
-
- generator.writeKey("node_name");
- generator.write(this.nodeName);
-
generator.writeKey("least_available");
this.leastAvailable.serialize(generator, mapper);
generator.writeKey("most_available");
this.mostAvailable.serialize(generator, mapper);
+ generator.writeKey("node_name");
+ generator.write(this.nodeName);
}
// ---------------------------------------------------------------------------------------------
+ @Override
+ @Nonnull
+ public Builder toBuilder() {
+ return new Builder(this);
+ }
+
+ @Nonnull
+ public static Builder builder() {
+ return new Builder();
+ }
+
/**
* Builder for {@link NodeDiskUsage}.
*/
-
- public static class Builder extends ObjectBuilderBase implements ObjectBuilder {
+ public static class Builder extends ObjectBuilderBase implements CopyableBuilder {
+ private DiskUsage leastAvailable;
+ private DiskUsage mostAvailable;
private String nodeName;
- private DiskUsage leastAvailable;
+ public Builder() {}
- private DiskUsage mostAvailable;
+ private Builder(NodeDiskUsage o) {
+ this.leastAvailable = o.leastAvailable;
+ this.mostAvailable = o.mostAvailable;
+ this.nodeName = o.nodeName;
+ }
- /**
- * Required - API name: {@code node_name}
- */
- public final Builder nodeName(String value) {
- this.nodeName = value;
- return this;
+ private Builder(Builder o) {
+ this.leastAvailable = o.leastAvailable;
+ this.mostAvailable = o.mostAvailable;
+ this.nodeName = o.nodeName;
+ }
+
+ @Override
+ @Nonnull
+ public Builder copy() {
+ return new Builder(this);
}
/**
* Required - API name: {@code least_available}
*/
+ @Nonnull
public final Builder leastAvailable(DiskUsage value) {
this.leastAvailable = value;
return this;
@@ -143,13 +177,15 @@ public final Builder leastAvailable(DiskUsage value) {
/**
* Required - API name: {@code least_available}
*/
+ @Nonnull
public final Builder leastAvailable(Function> fn) {
- return this.leastAvailable(fn.apply(new DiskUsage.Builder()).build());
+ return leastAvailable(fn.apply(new DiskUsage.Builder()).build());
}
/**
* Required - API name: {@code most_available}
*/
+ @Nonnull
public final Builder mostAvailable(DiskUsage value) {
this.mostAvailable = value;
return this;
@@ -158,16 +194,27 @@ public final Builder mostAvailable(DiskUsage value) {
/**
* Required - API name: {@code most_available}
*/
+ @Nonnull
public final Builder mostAvailable(Function> fn) {
- return this.mostAvailable(fn.apply(new DiskUsage.Builder()).build());
+ return mostAvailable(fn.apply(new DiskUsage.Builder()).build());
+ }
+
+ /**
+ * Required - API name: {@code node_name}
+ */
+ @Nonnull
+ public final Builder nodeName(String value) {
+ this.nodeName = value;
+ return this;
}
/**
* Builds a {@link NodeDiskUsage}.
*
- * @throws NullPointerException
- * if some of the required fields are null.
+ * @throws NullPointerException if some of the required fields are null.
*/
+ @Override
+ @Nonnull
public NodeDiskUsage build() {
_checkSingleUse();
@@ -186,11 +233,27 @@ public NodeDiskUsage build() {
);
protected static void setupNodeDiskUsageDeserializer(ObjectDeserializer op) {
-
- op.add(Builder::nodeName, JsonpDeserializer.stringDeserializer(), "node_name");
op.add(Builder::leastAvailable, DiskUsage._DESERIALIZER, "least_available");
op.add(Builder::mostAvailable, DiskUsage._DESERIALIZER, "most_available");
+ op.add(Builder::nodeName, JsonpDeserializer.stringDeserializer(), "node_name");
+ }
+ @Override
+ public int hashCode() {
+ int result = 17;
+ result = 31 * result + this.leastAvailable.hashCode();
+ result = 31 * result + this.mostAvailable.hashCode();
+ result = 31 * result + this.nodeName.hashCode();
+ return result;
}
+ @Override
+ public boolean equals(Object o) {
+ if (this == o) return true;
+ if (o == null || this.getClass() != o.getClass()) return false;
+ NodeDiskUsage other = (NodeDiskUsage) o;
+ return this.leastAvailable.equals(other.leastAvailable)
+ && this.mostAvailable.equals(other.mostAvailable)
+ && this.nodeName.equals(other.nodeName);
+ }
}
diff --git a/java-client/src/main/java/org/opensearch/client/opensearch/cluster/allocation_explain/ReservedSize.java b/java-client/src/generated/java/org/opensearch/client/opensearch/cluster/allocation_explain/ReservedSize.java
similarity index 70%
rename from java-client/src/main/java/org/opensearch/client/opensearch/cluster/allocation_explain/ReservedSize.java
rename to java-client/src/generated/java/org/opensearch/client/opensearch/cluster/allocation_explain/ReservedSize.java
index 45fee7fb15..ead5bacf16 100644
--- a/java-client/src/main/java/org/opensearch/client/opensearch/cluster/allocation_explain/ReservedSize.java
+++ b/java-client/src/generated/java/org/opensearch/client/opensearch/cluster/allocation_explain/ReservedSize.java
@@ -30,11 +30,17 @@
* GitHub history for details.
*/
+//----------------------------------------------------
+// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST.
+//----------------------------------------------------
+
package org.opensearch.client.opensearch.cluster.allocation_explain;
import jakarta.json.stream.JsonGenerator;
import java.util.List;
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,39 +48,45 @@
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.allocation_explain.ReservedSize
@JsonpDeserializable
-public class ReservedSize implements PlainJsonSerializable {
+@Generated("org.opensearch.client.codegen.CodeGenerator")
+public class ReservedSize implements PlainJsonSerializable, ToCopyableBuilder {
+
+ @Nonnull
private final String nodeId;
+ @Nonnull
private final String path;
- private final long total;
-
+ @Nonnull
private final List shards;
+ private final long total;
+
// ---------------------------------------------------------------------------------------------
private ReservedSize(Builder builder) {
-
this.nodeId = ApiTypeHelper.requireNonNull(builder.nodeId, this, "nodeId");
this.path = ApiTypeHelper.requireNonNull(builder.path, this, "path");
- this.total = ApiTypeHelper.requireNonNull(builder.total, this, "total");
this.shards = ApiTypeHelper.unmodifiableRequired(builder.shards, this, "shards");
-
+ this.total = ApiTypeHelper.requireNonNull(builder.total, this, "total");
}
- public static ReservedSize of(Function> fn) {
+ public static ReservedSize of(Function> fn) {
return fn.apply(new Builder()).build();
}
/**
* Required - API name: {@code node_id}
*/
+ @Nonnull
public final String nodeId() {
return this.nodeId;
}
@@ -82,27 +94,30 @@ public final String nodeId() {
/**
* Required - API name: {@code path}
*/
+ @Nonnull
public final String path() {
return this.path;
}
/**
- * Required - API name: {@code total}
+ * Required - API name: {@code shards}
*/
- public final long total() {
- return this.total;
+ @Nonnull
+ public final List shards() {
+ return this.shards;
}
/**
- * Required - API name: {@code shards}
+ * Required - API name: {@code total}
*/
- public final List shards() {
- return this.shards;
+ public final long total() {
+ return this.total;
}
/**
* Serialize this object to JSON.
*/
+ @Override
public void serialize(JsonGenerator generator, JsonpMapper mapper) {
generator.writeStartObject();
serializeInternal(generator, mapper);
@@ -110,47 +125,71 @@ public void serialize(JsonGenerator generator, JsonpMapper mapper) {
}
protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) {
-
generator.writeKey("node_id");
generator.write(this.nodeId);
generator.writeKey("path");
generator.write(this.path);
+ generator.writeKey("shards");
+ generator.writeStartArray();
+ for (String item0 : this.shards) {
+ generator.write(item0);
+ }
+ generator.writeEnd();
+
generator.writeKey("total");
generator.write(this.total);
+ }
- if (ApiTypeHelper.isDefined(this.shards)) {
- generator.writeKey("shards");
- generator.writeStartArray();
- for (String item0 : this.shards) {
- 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 ReservedSize}.
*/
-
- public static class Builder extends ObjectBuilderBase implements ObjectBuilder {
+ public static class Builder extends ObjectBuilderBase implements CopyableBuilder {
private String nodeId;
-
private String path;
-
+ private List shards;
private Long total;
- private List shards;
+ public Builder() {}
+
+ private Builder(ReservedSize o) {
+ this.nodeId = o.nodeId;
+ this.path = o.path;
+ this.shards = _listCopy(o.shards);
+ this.total = o.total;
+ }
+
+ private Builder(Builder o) {
+ this.nodeId = o.nodeId;
+ this.path = o.path;
+ this.shards = _listCopy(o.shards);
+ this.total = o.total;
+ }
+
+ @Override
+ @Nonnull
+ public Builder copy() {
+ return new Builder(this);
+ }
/**
* Required - API name: {@code node_id}
*/
+ @Nonnull
public final Builder nodeId(String value) {
this.nodeId = value;
return this;
@@ -159,24 +198,20 @@ public final Builder nodeId(String value) {
/**
* Required - API name: {@code path}
*/
+ @Nonnull
public final Builder path(String value) {
this.path = value;
return this;
}
- /**
- * Required - API name: {@code total}
- */
- public final Builder total(long value) {
- this.total = value;
- return this;
- }
-
/**
* Required - API name: {@code shards}
+ *
*
* Adds all elements of list
to shards
.
+ *
*/
+ @Nonnull
public final Builder shards(List list) {
this.shards = _listAddAll(this.shards, list);
return this;
@@ -184,20 +219,33 @@ public final Builder shards(List list) {
/**
* Required - API name: {@code shards}
+ *
*
* Adds one or more values to shards
.
+ *
*/
+ @Nonnull
public final Builder shards(String value, String... values) {
this.shards = _listAdd(this.shards, value, values);
return this;
}
+ /**
+ * Required - API name: {@code total}
+ */
+ @Nonnull
+ public final Builder total(long value) {
+ this.total = value;
+ return this;
+ }
+
/**
* Builds a {@link ReservedSize}.
*
- * @throws NullPointerException
- * if some of the required fields are null.
+ * @throws NullPointerException if some of the required fields are null.
*/
+ @Override
+ @Nonnull
public ReservedSize build() {
_checkSingleUse();
@@ -216,12 +264,30 @@ public ReservedSize build() {
);
protected static void setupReservedSizeDeserializer(ObjectDeserializer op) {
-
op.add(Builder::nodeId, JsonpDeserializer.stringDeserializer(), "node_id");
op.add(Builder::path, JsonpDeserializer.stringDeserializer(), "path");
- op.add(Builder::total, JsonpDeserializer.longDeserializer(), "total");
op.add(Builder::shards, JsonpDeserializer.arrayDeserializer(JsonpDeserializer.stringDeserializer()), "shards");
+ op.add(Builder::total, JsonpDeserializer.longDeserializer(), "total");
+ }
+ @Override
+ public int hashCode() {
+ int result = 17;
+ result = 31 * result + this.nodeId.hashCode();
+ result = 31 * result + this.path.hashCode();
+ result = 31 * result + this.shards.hashCode();
+ result = 31 * result + Long.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;
+ ReservedSize other = (ReservedSize) o;
+ return this.nodeId.equals(other.nodeId)
+ && this.path.equals(other.path)
+ && this.shards.equals(other.shards)
+ && this.total == other.total;
+ }
}
diff --git a/java-client/src/main/java/org/opensearch/client/opensearch/cluster/allocation_explain/UnassignedInformation.java b/java-client/src/generated/java/org/opensearch/client/opensearch/cluster/allocation_explain/UnassignedInformation.java
similarity index 71%
rename from java-client/src/main/java/org/opensearch/client/opensearch/cluster/allocation_explain/UnassignedInformation.java
rename to java-client/src/generated/java/org/opensearch/client/opensearch/cluster/allocation_explain/UnassignedInformation.java
index 918f22ce28..a7b751ca0c 100644
--- a/java-client/src/main/java/org/opensearch/client/opensearch/cluster/allocation_explain/UnassignedInformation.java
+++ b/java-client/src/generated/java/org/opensearch/client/opensearch/cluster/allocation_explain/UnassignedInformation.java
@@ -30,10 +30,17 @@
* GitHub history for details.
*/
+//----------------------------------------------------
+// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST.
+//----------------------------------------------------
+
package org.opensearch.client.opensearch.cluster.allocation_explain;
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;
@@ -42,19 +49,28 @@
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.allocation_explain.UnassignedInformation
@JsonpDeserializable
-public class UnassignedInformation implements PlainJsonSerializable {
- private final String at;
+@Generated("org.opensearch.client.codegen.CodeGenerator")
+public class UnassignedInformation
+ implements
+ PlainJsonSerializable,
+ ToCopyableBuilder {
@Nullable
- private final String lastAllocationStatus;
+ private final String allocationStatus;
- private final UnassignedInformationReason reason;
+ @Nonnull
+ private final String at;
+
+ @Nullable
+ private final Boolean delayed;
@Nullable
private final String details;
@@ -63,49 +79,49 @@ public class UnassignedInformation implements PlainJsonSerializable {
private final Integer failedAllocationAttempts;
@Nullable
- private final Boolean delayed;
+ private final String lastAllocationStatus;
- @Nullable
- private final String allocationStatus;
+ @Nonnull
+ private final UnassignedInformationReason reason;
// ---------------------------------------------------------------------------------------------
private UnassignedInformation(Builder builder) {
-
+ this.allocationStatus = builder.allocationStatus;
this.at = ApiTypeHelper.requireNonNull(builder.at, this, "at");
- this.lastAllocationStatus = builder.lastAllocationStatus;
- this.reason = ApiTypeHelper.requireNonNull(builder.reason, this, "reason");
+ this.delayed = builder.delayed;
this.details = builder.details;
this.failedAllocationAttempts = builder.failedAllocationAttempts;
- this.delayed = builder.delayed;
- this.allocationStatus = builder.allocationStatus;
-
+ this.lastAllocationStatus = builder.lastAllocationStatus;
+ this.reason = ApiTypeHelper.requireNonNull(builder.reason, this, "reason");
}
- public static UnassignedInformation of(Function> fn) {
+ public static UnassignedInformation of(Function> fn) {
return fn.apply(new Builder()).build();
}
/**
- * Required - API name: {@code at}
+ * API name: {@code allocation_status}
*/
- public final String at() {
- return this.at;
+ @Nullable
+ public final String allocationStatus() {
+ return this.allocationStatus;
}
/**
- * API name: {@code last_allocation_status}
+ * Required - API name: {@code at}
*/
- @Nullable
- public final String lastAllocationStatus() {
- return this.lastAllocationStatus;
+ @Nonnull
+ public final String at() {
+ return this.at;
}
/**
- * Required - API name: {@code reason}
+ * API name: {@code delayed}
*/
- public final UnassignedInformationReason reason() {
- return this.reason;
+ @Nullable
+ public final Boolean delayed() {
+ return this.delayed;
}
/**
@@ -125,24 +141,25 @@ public final Integer failedAllocationAttempts() {
}
/**
- * API name: {@code delayed}
+ * API name: {@code last_allocation_status}
*/
@Nullable
- public final Boolean delayed() {
- return this.delayed;
+ public final String lastAllocationStatus() {
+ return this.lastAllocationStatus;
}
/**
- * API name: {@code allocation_status}
+ * Required - API name: {@code reason}
*/
- @Nullable
- public final String allocationStatus() {
- return this.allocationStatus;
+ @Nonnull
+ public final UnassignedInformationReason reason() {
+ return this.reason;
}
/**
* Serialize this object to JSON.
*/
+ @Override
public void serialize(JsonGenerator generator, JsonpMapper mapper) {
generator.writeStartObject();
serializeInternal(generator, mapper);
@@ -150,93 +167,127 @@ public void serialize(JsonGenerator generator, JsonpMapper mapper) {
}
protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) {
+ if (this.allocationStatus != null) {
+ generator.writeKey("allocation_status");
+ generator.write(this.allocationStatus);
+ }
generator.writeKey("at");
generator.write(this.at);
- if (this.lastAllocationStatus != null) {
- generator.writeKey("last_allocation_status");
- generator.write(this.lastAllocationStatus);
-
+ if (this.delayed != null) {
+ generator.writeKey("delayed");
+ generator.write(this.delayed);
}
- generator.writeKey("reason");
- this.reason.serialize(generator, mapper);
+
if (this.details != null) {
generator.writeKey("details");
generator.write(this.details);
-
}
+
if (this.failedAllocationAttempts != null) {
generator.writeKey("failed_allocation_attempts");
generator.write(this.failedAllocationAttempts);
-
}
- if (this.delayed != null) {
- generator.writeKey("delayed");
- generator.write(this.delayed);
-
- }
- if (this.allocationStatus != null) {
- generator.writeKey("allocation_status");
- generator.write(this.allocationStatus);
+ if (this.lastAllocationStatus != null) {
+ generator.writeKey("last_allocation_status");
+ generator.write(this.lastAllocationStatus);
}
+ generator.writeKey("reason");
+ this.reason.serialize(generator, mapper);
}
// ---------------------------------------------------------------------------------------------
+ @Override
+ @Nonnull
+ public Builder toBuilder() {
+ return new Builder(this);
+ }
+
+ @Nonnull
+ public static Builder builder() {
+ return new Builder();
+ }
+
/**
* Builder for {@link UnassignedInformation}.
*/
-
- public static class Builder extends ObjectBuilderBase implements ObjectBuilder {
+ public static class Builder extends ObjectBuilderBase implements CopyableBuilder {
+ @Nullable
+ private String allocationStatus;
private String at;
-
@Nullable
- private String lastAllocationStatus;
-
- private UnassignedInformationReason reason;
-
+ private Boolean delayed;
@Nullable
private String details;
-
@Nullable
private Integer failedAllocationAttempts;
-
@Nullable
- private Boolean delayed;
+ private String lastAllocationStatus;
+ private UnassignedInformationReason reason;
- @Nullable
- private String allocationStatus;
+ public Builder() {}
+
+ private Builder(UnassignedInformation o) {
+ this.allocationStatus = o.allocationStatus;
+ this.at = o.at;
+ this.delayed = o.delayed;
+ this.details = o.details;
+ this.failedAllocationAttempts = o.failedAllocationAttempts;
+ this.lastAllocationStatus = o.lastAllocationStatus;
+ this.reason = o.reason;
+ }
+
+ private Builder(Builder o) {
+ this.allocationStatus = o.allocationStatus;
+ this.at = o.at;
+ this.delayed = o.delayed;
+ this.details = o.details;
+ this.failedAllocationAttempts = o.failedAllocationAttempts;
+ this.lastAllocationStatus = o.lastAllocationStatus;
+ this.reason = o.reason;
+ }
+
+ @Override
+ @Nonnull
+ public Builder copy() {
+ return new Builder(this);
+ }
/**
- * Required - API name: {@code at}
+ * API name: {@code allocation_status}
*/
- public final Builder at(String value) {
- this.at = value;
+ @Nonnull
+ public final Builder allocationStatus(@Nullable String value) {
+ this.allocationStatus = value;
return this;
}
/**
- * API name: {@code last_allocation_status}
+ * Required - API name: {@code at}
*/
- public final Builder lastAllocationStatus(@Nullable String value) {
- this.lastAllocationStatus = value;
+ @Nonnull
+ public final Builder at(String value) {
+ this.at = value;
return this;
}
/**
- * Required - API name: {@code reason}
+ * API name: {@code delayed}
*/
- public final Builder reason(UnassignedInformationReason value) {
- this.reason = value;
+ @Nonnull
+ public final Builder delayed(@Nullable Boolean value) {
+ this.delayed = value;
return this;
}
/**
* API name: {@code details}
*/
+ @Nonnull
public final Builder details(@Nullable String value) {
this.details = value;
return this;
@@ -245,33 +296,37 @@ public final Builder details(@Nullable String value) {
/**
* API name: {@code failed_allocation_attempts}
*/
+ @Nonnull
public final Builder failedAllocationAttempts(@Nullable Integer value) {
this.failedAllocationAttempts = value;
return this;
}
/**
- * API name: {@code delayed}
+ * API name: {@code last_allocation_status}
*/
- public final Builder delayed(@Nullable Boolean value) {
- this.delayed = value;
+ @Nonnull
+ public final Builder lastAllocationStatus(@Nullable String value) {
+ this.lastAllocationStatus = value;
return this;
}
/**
- * API name: {@code allocation_status}
+ * Required - API name: {@code reason}
*/
- public final Builder allocationStatus(@Nullable String value) {
- this.allocationStatus = value;
+ @Nonnull
+ public final Builder reason(UnassignedInformationReason value) {
+ this.reason = value;
return this;
}
/**
* Builds a {@link UnassignedInformation}.
*
- * @throws NullPointerException
- * if some of the required fields are null.
+ * @throws NullPointerException if some of the required fields are null.
*/
+ @Override
+ @Nonnull
public UnassignedInformation build() {
_checkSingleUse();
@@ -290,15 +345,39 @@ public UnassignedInformation build() {
);
protected static void setupUnassignedInformationDeserializer(ObjectDeserializer op) {
-
+ op.add(Builder::allocationStatus, JsonpDeserializer.stringDeserializer(), "allocation_status");
op.add(Builder::at, JsonpDeserializer.stringDeserializer(), "at");
- op.add(Builder::lastAllocationStatus, JsonpDeserializer.stringDeserializer(), "last_allocation_status");
- op.add(Builder::reason, UnassignedInformationReason._DESERIALIZER, "reason");
+ op.add(Builder::delayed, JsonpDeserializer.booleanDeserializer(), "delayed");
op.add(Builder::details, JsonpDeserializer.stringDeserializer(), "details");
op.add(Builder::failedAllocationAttempts, JsonpDeserializer.integerDeserializer(), "failed_allocation_attempts");
- op.add(Builder::delayed, JsonpDeserializer.booleanDeserializer(), "delayed");
- op.add(Builder::allocationStatus, JsonpDeserializer.stringDeserializer(), "allocation_status");
+ op.add(Builder::lastAllocationStatus, JsonpDeserializer.stringDeserializer(), "last_allocation_status");
+ op.add(Builder::reason, UnassignedInformationReason._DESERIALIZER, "reason");
+ }
+ @Override
+ public int hashCode() {
+ int result = 17;
+ result = 31 * result + Objects.hashCode(this.allocationStatus);
+ result = 31 * result + this.at.hashCode();
+ result = 31 * result + Objects.hashCode(this.delayed);
+ result = 31 * result + Objects.hashCode(this.details);
+ result = 31 * result + Objects.hashCode(this.failedAllocationAttempts);
+ result = 31 * result + Objects.hashCode(this.lastAllocationStatus);
+ result = 31 * result + this.reason.hashCode();
+ return result;
}
+ @Override
+ public boolean equals(Object o) {
+ if (this == o) return true;
+ if (o == null || this.getClass() != o.getClass()) return false;
+ UnassignedInformation other = (UnassignedInformation) o;
+ return Objects.equals(this.allocationStatus, other.allocationStatus)
+ && this.at.equals(other.at)
+ && Objects.equals(this.delayed, other.delayed)
+ && Objects.equals(this.details, other.details)
+ && Objects.equals(this.failedAllocationAttempts, other.failedAllocationAttempts)
+ && Objects.equals(this.lastAllocationStatus, other.lastAllocationStatus)
+ && this.reason.equals(other.reason);
+ }
}
diff --git a/java-client/src/main/java/org/opensearch/client/opensearch/cluster/allocation_explain/UnassignedInformationReason.java b/java-client/src/generated/java/org/opensearch/client/opensearch/cluster/allocation_explain/UnassignedInformationReason.java
similarity index 86%
rename from java-client/src/main/java/org/opensearch/client/opensearch/cluster/allocation_explain/UnassignedInformationReason.java
rename to java-client/src/generated/java/org/opensearch/client/opensearch/cluster/allocation_explain/UnassignedInformationReason.java
index 4c8ba850ed..21aae7d629 100644
--- a/java-client/src/main/java/org/opensearch/client/opensearch/cluster/allocation_explain/UnassignedInformationReason.java
+++ b/java-client/src/generated/java/org/opensearch/client/opensearch/cluster/allocation_explain/UnassignedInformationReason.java
@@ -30,44 +30,50 @@
* GitHub history for details.
*/
+//----------------------------------------------------
+// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST.
+//----------------------------------------------------
+
package org.opensearch.client.opensearch.cluster.allocation_explain;
+import javax.annotation.Generated;
import org.opensearch.client.json.JsonEnum;
import org.opensearch.client.json.JsonpDeserializable;
+// typedef: cluster.allocation_explain.UnassignedInformationReason
+
@JsonpDeserializable
+@Generated("org.opensearch.client.codegen.CodeGenerator")
public enum UnassignedInformationReason implements JsonEnum {
- IndexCreated("INDEX_CREATED"),
+ AllocationFailed("ALLOCATION_FAILED"),
ClusterRecovered("CLUSTER_RECOVERED"),
- IndexReopened("INDEX_REOPENED"),
-
DanglingIndexImported("DANGLING_INDEX_IMPORTED"),
- NewIndexRestored("NEW_INDEX_RESTORED"),
-
ExistingIndexRestored("EXISTING_INDEX_RESTORED"),
- ReplicaAdded("REPLICA_ADDED"),
+ ForcedEmptyPrimary("FORCED_EMPTY_PRIMARY"),
- AllocationFailed("ALLOCATION_FAILED"),
+ IndexCreated("INDEX_CREATED"),
- NodeLeft("NODE_LEFT"),
+ IndexReopened("INDEX_REOPENED"),
- RerouteCancelled("REROUTE_CANCELLED"),
+ ManualAllocation("MANUAL_ALLOCATION"),
- Reinitialized("REINITIALIZED"),
+ NewIndexRestored("NEW_INDEX_RESTORED"),
- ReallocatedReplica("REALLOCATED_REPLICA"),
+ NodeLeft("NODE_LEFT"),
PrimaryFailed("PRIMARY_FAILED"),
- ForcedEmptyPrimary("FORCED_EMPTY_PRIMARY"),
+ ReallocatedReplica("REALLOCATED_REPLICA"),
- ManualAllocation("MANUAL_ALLOCATION"),
+ Reinitialized("REINITIALIZED"),
+
+ ReplicaAdded("REPLICA_ADDED"),
- ;
+ RerouteCancelled("REROUTE_CANCELLED");
private final String jsonValue;
diff --git a/java-client/src/main/java/org/opensearch/client/opensearch/cluster/OpenSearchClusterAsyncClient.java b/java-client/src/main/java/org/opensearch/client/opensearch/cluster/OpenSearchClusterAsyncClient.java
index 30e4ea5117..f247e5a7de 100644
--- a/java-client/src/main/java/org/opensearch/client/opensearch/cluster/OpenSearchClusterAsyncClient.java
+++ b/java-client/src/main/java/org/opensearch/client/opensearch/cluster/OpenSearchClusterAsyncClient.java
@@ -48,7 +48,7 @@
/**
* Client for the cluster namespace.
*/
-public class OpenSearchClusterAsyncClient extends ApiClient {
+public class OpenSearchClusterAsyncClient extends OpenSearchClusterAsyncClientBase {
public OpenSearchClusterAsyncClient(OpenSearchTransport transport) {
super(transport, null);
@@ -63,54 +63,6 @@ public OpenSearchClusterAsyncClient withTransportOptions(@Nullable TransportOpti
return new OpenSearchClusterAsyncClient(this.transport, transportOptions);
}
- // ----- Endpoint: cluster.allocation_explain
-
- /**
- * Provides explanations for shard allocations in the cluster.
- *
- *
- */
-
- public CompletableFuture allocationExplain(AllocationExplainRequest request) throws IOException,
- OpenSearchException {
- @SuppressWarnings("unchecked")
- JsonEndpoint endpoint = (JsonEndpoint<
- AllocationExplainRequest,
- AllocationExplainResponse,
- ErrorResponse>) AllocationExplainRequest._ENDPOINT;
-
- return this.transport.performRequestAsync(request, endpoint, this.transportOptions);
- }
-
- /**
- * Provides explanations for shard allocations in the cluster.
- *
- * @param fn
- * a function that initializes a builder to create the
- * {@link AllocationExplainRequest}
- *
- */
-
- public final CompletableFuture allocationExplain(
- Function> fn
- ) throws IOException, OpenSearchException {
- return allocationExplain(fn.apply(new AllocationExplainRequest.Builder()).build());
- }
-
- /**
- * Provides explanations for shard allocations in the cluster.
- *
- *
- */
-
- public CompletableFuture allocationExplain() throws IOException, OpenSearchException {
- return this.transport.performRequestAsync(
- new AllocationExplainRequest.Builder().build(),
- AllocationExplainRequest._ENDPOINT,
- this.transportOptions
- );
- }
-
// ----- Endpoint: cluster.delete_component_template
/**
diff --git a/java-client/src/main/java/org/opensearch/client/opensearch/cluster/OpenSearchClusterClient.java b/java-client/src/main/java/org/opensearch/client/opensearch/cluster/OpenSearchClusterClient.java
index 1b1efae0ad..3a9b8d8a3b 100644
--- a/java-client/src/main/java/org/opensearch/client/opensearch/cluster/OpenSearchClusterClient.java
+++ b/java-client/src/main/java/org/opensearch/client/opensearch/cluster/OpenSearchClusterClient.java
@@ -47,7 +47,7 @@
/**
* Client for the cluster namespace.
*/
-public class OpenSearchClusterClient extends ApiClient {
+public class OpenSearchClusterClient extends OpenSearchClusterClientBase {
public OpenSearchClusterClient(OpenSearchTransport transport) {
super(transport, null);
@@ -62,53 +62,6 @@ public OpenSearchClusterClient withTransportOptions(@Nullable TransportOptions t
return new OpenSearchClusterClient(this.transport, transportOptions);
}
- // ----- Endpoint: cluster.allocation_explain
-
- /**
- * Provides explanations for shard allocations in the cluster.
- *
- *
- */
-
- public AllocationExplainResponse allocationExplain(AllocationExplainRequest request) throws IOException, OpenSearchException {
- @SuppressWarnings("unchecked")
- JsonEndpoint endpoint = (JsonEndpoint<
- AllocationExplainRequest,
- AllocationExplainResponse,
- ErrorResponse>) AllocationExplainRequest._ENDPOINT;
-
- return this.transport.performRequest(request, endpoint, this.transportOptions);
- }
-
- /**
- * Provides explanations for shard allocations in the cluster.
- *
- * @param fn
- * a function that initializes a builder to create the
- * {@link AllocationExplainRequest}
- *
- */
-
- public final AllocationExplainResponse allocationExplain(
- Function> fn
- ) throws IOException, OpenSearchException {
- return allocationExplain(fn.apply(new AllocationExplainRequest.Builder()).build());
- }
-
- /**
- * Provides explanations for shard allocations in the cluster.
- *
- *
- */
-
- public AllocationExplainResponse allocationExplain() throws IOException, OpenSearchException {
- return this.transport.performRequest(
- new AllocationExplainRequest.Builder().build(),
- AllocationExplainRequest._ENDPOINT,
- this.transportOptions
- );
- }
-
// ----- Endpoint: cluster.delete_component_template
/**
diff --git a/java-codegen/opensearch-openapi.yaml b/java-codegen/opensearch-openapi.yaml
index 29bcb35349..dcf5bbd877 100644
--- a/java-codegen/opensearch-openapi.yaml
+++ b/java-codegen/opensearch-openapi.yaml
@@ -26428,7 +26428,8 @@ components:
type: boolean
shard:
description: Specifies the ID of the shard that you would like an explanation for.
- type: number
+ type: integer
+ format: int32
description: The index, shard, and primary flag to explain. Empty means 'explain the first unassigned shard'
cluster.delete_weighted_routing:
content:
@@ -28581,7 +28582,8 @@ components:
remaining_delay_in_millis:
$ref: '#/components/schemas/_common___DurationValueUnitMillis'
shard:
- type: number
+ type: integer
+ format: int32
unassigned_info:
$ref: '#/components/schemas/cluster.allocation_explain___UnassignedInformation'
note:
@@ -47804,7 +47806,8 @@ components:
transport_address:
$ref: '#/components/schemas/_common___TransportAddress'
weight_ranking:
- type: number
+ type: integer
+ format: int32
required:
- attributes
- id
@@ -47872,7 +47875,8 @@ components:
transport_address:
$ref: '#/components/schemas/_common___TransportAddress'
weight_ranking:
- type: number
+ type: integer
+ format: int32
required:
- deciders
- node_attributes
@@ -47901,7 +47905,8 @@ components:
path:
type: string
total:
- type: number
+ type: integer
+ format: int64
shards:
type: array
items:
@@ -47923,7 +47928,8 @@ components:
details:
type: string
failed_allocation_attempts:
- type: number
+ type: integer
+ format: int32
delayed:
type: boolean
allocation_status:
diff --git a/java-codegen/src/main/java/org/opensearch/client/codegen/CodeGenerator.java b/java-codegen/src/main/java/org/opensearch/client/codegen/CodeGenerator.java
index c210d89f17..3a04e888bf 100644
--- a/java-codegen/src/main/java/org/opensearch/client/codegen/CodeGenerator.java
+++ b/java-codegen/src/main/java/org/opensearch/client/codegen/CodeGenerator.java
@@ -14,6 +14,7 @@
import static org.opensearch.client.codegen.utils.matcher.Matcher.is;
import static org.opensearch.client.codegen.utils.matcher.Matcher.isNot;
import static org.opensearch.client.codegen.utils.matcher.Matcher.isNull;
+import static org.opensearch.client.codegen.utils.matcher.Matcher.isOneOf;
import static org.opensearch.client.codegen.utils.matcher.Matcher.or;
import java.io.File;
@@ -45,6 +46,9 @@ public class CodeGenerator {
private static final Logger LOGGER = LogManager.getLogger();
private static final Matcher OPERATION_MATCHER = or(
and(namespace(isNull()), name(is("info"))),
+ and(namespace(is("cluster")), name(isOneOf(
+ "allocation_explain"
+ ))),
namespace(is("dangling_indices")),
and(namespace(is("indices")), name(isNot("get_field_mapping"))),
and(
diff --git a/java-codegen/src/main/java/org/opensearch/client/codegen/model/Namespace.java b/java-codegen/src/main/java/org/opensearch/client/codegen/model/Namespace.java
index 1e2d186b5a..d995c118b3 100644
--- a/java-codegen/src/main/java/org/opensearch/client/codegen/model/Namespace.java
+++ b/java-codegen/src/main/java/org/opensearch/client/codegen/model/Namespace.java
@@ -24,7 +24,7 @@
import org.opensearch.client.codegen.utils.Strings;
public class Namespace {
- private static final Set PARTIAL_NAMESPACES = Set.of("", "indices");
+ private static final Set PARTIAL_NAMESPACES = Set.of("", "cluster", "indices");
private final Namespace parent;
private final String name;
From 816e365bdea40349eebc800a6fa96a8f46d02a4b Mon Sep 17 00:00:00 2001
From: Thomas Farr
Date: Fri, 20 Dec 2024 14:04:42 +1300
Subject: [PATCH 02/13] Generate component_template operations
Signed-off-by: Thomas Farr
---
UPGRADING.md | 5 +-
.../opensearch/cluster/ComponentTemplate.java | 115 +++--
.../cluster/ComponentTemplateNode.java | 171 ++++---
.../cluster/ComponentTemplateSummary.java | 316 +++++++-----
.../DeleteComponentTemplateRequest.java | 224 ++++++---
.../DeleteComponentTemplateResponse.java | 72 ++-
.../ExistsComponentTemplateRequest.java | 268 ++++++-----
.../cluster/GetComponentTemplateRequest.java | 234 ++++++---
.../cluster/GetComponentTemplateResponse.java | 98 +++-
.../OpenSearchClusterAsyncClientBase.java | 92 ++++
.../cluster/OpenSearchClusterClientBase.java | 89 ++++
.../cluster/PutComponentTemplateRequest.java | 449 ++++++++++--------
.../cluster/PutComponentTemplateResponse.java | 72 ++-
.../ExistsComponentTemplateResponse.java | 51 --
.../cluster/OpenSearchClusterAsyncClient.java | 150 ------
.../cluster/OpenSearchClusterClient.java | 147 ------
java-codegen/opensearch-openapi.yaml | 10 +
.../client/codegen/CodeGenerator.java | 6 +-
18 files changed, 1515 insertions(+), 1054 deletions(-)
rename java-client/src/{main => generated}/java/org/opensearch/client/opensearch/cluster/ComponentTemplate.java (69%)
rename java-client/src/{main => generated}/java/org/opensearch/client/opensearch/cluster/ComponentTemplateNode.java (70%)
rename java-client/src/{main => generated}/java/org/opensearch/client/opensearch/cluster/ComponentTemplateSummary.java (71%)
rename java-client/src/{main => generated}/java/org/opensearch/client/opensearch/cluster/DeleteComponentTemplateRequest.java (57%)
rename java-client/src/{main => generated}/java/org/opensearch/client/opensearch/cluster/DeleteComponentTemplateResponse.java (63%)
rename java-client/src/{main => generated}/java/org/opensearch/client/opensearch/cluster/ExistsComponentTemplateRequest.java (57%)
rename java-client/src/{main => generated}/java/org/opensearch/client/opensearch/cluster/GetComponentTemplateRequest.java (59%)
rename java-client/src/{main => generated}/java/org/opensearch/client/opensearch/cluster/GetComponentTemplateResponse.java (68%)
rename java-client/src/{main => generated}/java/org/opensearch/client/opensearch/cluster/PutComponentTemplateRequest.java (52%)
rename java-client/src/{main => generated}/java/org/opensearch/client/opensearch/cluster/PutComponentTemplateResponse.java (63%)
delete mode 100644 java-client/src/main/java/org/opensearch/client/opensearch/cluster/ExistsComponentTemplateResponse.java
diff --git a/UPGRADING.md b/UPGRADING.md
index 6571327dc6..82e0f65b73 100644
--- a/UPGRADING.md
+++ b/UPGRADING.md
@@ -282,4 +282,7 @@ After:
- `IndicesStats`'s `shards` field.
### AllocationExplainResponse
-- The `allocationDelay`, `configuredDelay` and `remainingDelay` properties have been corrected to be of type `Time` instead of `String`.
\ No newline at end of file
+- The `allocationDelay`, `configuredDelay` and `remainingDelay` properties have been corrected to be of type `Time` instead of `String`.
+
+### PutComponentTemplateRequest
+- The `aliases`, `mappings` and `settings` properties have been removed as they should be set within the `template` property.
\ No newline at end of file
diff --git a/java-client/src/main/java/org/opensearch/client/opensearch/cluster/ComponentTemplate.java b/java-client/src/generated/java/org/opensearch/client/opensearch/cluster/ComponentTemplate.java
similarity index 69%
rename from java-client/src/main/java/org/opensearch/client/opensearch/cluster/ComponentTemplate.java
rename to java-client/src/generated/java/org/opensearch/client/opensearch/cluster/ComponentTemplate.java
index a6cce10988..b1f1bdbf16 100644
--- a/java-client/src/main/java/org/opensearch/client/opensearch/cluster/ComponentTemplate.java
+++ b/java-client/src/generated/java/org/opensearch/client/opensearch/cluster/ComponentTemplate.java
@@ -30,10 +30,16 @@
* GitHub history for details.
*/
+//----------------------------------------------------
+// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST.
+//----------------------------------------------------
+
package org.opensearch.client.opensearch.cluster;
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,47 +47,54 @@
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._types.ComponentTemplate
+// typedef: cluster.ComponentTemplate
@JsonpDeserializable
-public class ComponentTemplate implements PlainJsonSerializable {
- private final String name;
+@Generated("org.opensearch.client.codegen.CodeGenerator")
+public class ComponentTemplate implements PlainJsonSerializable, ToCopyableBuilder {
+ @Nonnull
private final ComponentTemplateNode componentTemplate;
+ @Nonnull
+ private final String name;
+
// ---------------------------------------------------------------------------------------------
private ComponentTemplate(Builder builder) {
-
- this.name = ApiTypeHelper.requireNonNull(builder.name, this, "name");
this.componentTemplate = ApiTypeHelper.requireNonNull(builder.componentTemplate, this, "componentTemplate");
-
+ this.name = ApiTypeHelper.requireNonNull(builder.name, this, "name");
}
- public static ComponentTemplate of(Function> fn) {
+ public static ComponentTemplate of(Function> fn) {
return fn.apply(new Builder()).build();
}
/**
- * Required - API name: {@code name}
+ * Required - API name: {@code component_template}
*/
- public final String name() {
- return this.name;
+ @Nonnull
+ public final ComponentTemplateNode componentTemplate() {
+ return this.componentTemplate;
}
/**
- * Required - API name: {@code component_template}
+ * Required - API name: {@code name}
*/
- public final ComponentTemplateNode componentTemplate() {
- return this.componentTemplate;
+ @Nonnull
+ public final String name() {
+ return this.name;
}
/**
* Serialize this object to JSON.
*/
+ @Override
public void serialize(JsonGenerator generator, JsonpMapper mapper) {
generator.writeStartObject();
serializeInternal(generator, mapper);
@@ -89,37 +102,55 @@ public void serialize(JsonGenerator generator, JsonpMapper mapper) {
}
protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) {
+ generator.writeKey("component_template");
+ this.componentTemplate.serialize(generator, mapper);
generator.writeKey("name");
generator.write(this.name);
+ }
- generator.writeKey("component_template");
- this.componentTemplate.serialize(generator, mapper);
+ // ---------------------------------------------------------------------------------------------
+ @Override
+ @Nonnull
+ public Builder toBuilder() {
+ return new Builder(this);
}
- // ---------------------------------------------------------------------------------------------
+ @Nonnull
+ public static Builder builder() {
+ return new Builder();
+ }
/**
* Builder for {@link ComponentTemplate}.
*/
-
- public static class Builder extends ObjectBuilderBase implements ObjectBuilder {
+ public static class Builder extends ObjectBuilderBase implements CopyableBuilder {
+ private ComponentTemplateNode componentTemplate;
private String name;
- private ComponentTemplateNode componentTemplate;
+ public Builder() {}
- /**
- * Required - API name: {@code name}
- */
- public final Builder name(String value) {
- this.name = value;
- return this;
+ private Builder(ComponentTemplate o) {
+ this.componentTemplate = o.componentTemplate;
+ this.name = o.name;
+ }
+
+ private Builder(Builder o) {
+ this.componentTemplate = o.componentTemplate;
+ this.name = o.name;
+ }
+
+ @Override
+ @Nonnull
+ public Builder copy() {
+ return new Builder(this);
}
/**
* Required - API name: {@code component_template}
*/
+ @Nonnull
public final Builder componentTemplate(ComponentTemplateNode value) {
this.componentTemplate = value;
return this;
@@ -128,16 +159,27 @@ public final Builder componentTemplate(ComponentTemplateNode value) {
/**
* Required - API name: {@code component_template}
*/
+ @Nonnull
public final Builder componentTemplate(Function> fn) {
- return this.componentTemplate(fn.apply(new ComponentTemplateNode.Builder()).build());
+ return componentTemplate(fn.apply(new ComponentTemplateNode.Builder()).build());
+ }
+
+ /**
+ * Required - API name: {@code name}
+ */
+ @Nonnull
+ public final Builder name(String value) {
+ this.name = value;
+ return this;
}
/**
* Builds a {@link ComponentTemplate}.
*
- * @throws NullPointerException
- * if some of the required fields are null.
+ * @throws NullPointerException if some of the required fields are null.
*/
+ @Override
+ @Nonnull
public ComponentTemplate build() {
_checkSingleUse();
@@ -156,10 +198,23 @@ public ComponentTemplate build() {
);
protected static void setupComponentTemplateDeserializer(ObjectDeserializer op) {
-
- op.add(Builder::name, JsonpDeserializer.stringDeserializer(), "name");
op.add(Builder::componentTemplate, ComponentTemplateNode._DESERIALIZER, "component_template");
+ op.add(Builder::name, JsonpDeserializer.stringDeserializer(), "name");
+ }
+ @Override
+ public int hashCode() {
+ int result = 17;
+ result = 31 * result + this.componentTemplate.hashCode();
+ result = 31 * result + this.name.hashCode();
+ return result;
}
+ @Override
+ public boolean equals(Object o) {
+ if (this == o) return true;
+ if (o == null || this.getClass() != o.getClass()) return false;
+ ComponentTemplate other = (ComponentTemplate) o;
+ return this.componentTemplate.equals(other.componentTemplate) && this.name.equals(other.name);
+ }
}
diff --git a/java-client/src/main/java/org/opensearch/client/opensearch/cluster/ComponentTemplateNode.java b/java-client/src/generated/java/org/opensearch/client/opensearch/cluster/ComponentTemplateNode.java
similarity index 70%
rename from java-client/src/main/java/org/opensearch/client/opensearch/cluster/ComponentTemplateNode.java
rename to java-client/src/generated/java/org/opensearch/client/opensearch/cluster/ComponentTemplateNode.java
index 1b2273457d..19a28d99d2 100644
--- a/java-client/src/main/java/org/opensearch/client/opensearch/cluster/ComponentTemplateNode.java
+++ b/java-client/src/generated/java/org/opensearch/client/opensearch/cluster/ComponentTemplateNode.java
@@ -30,11 +30,18 @@
* GitHub history for details.
*/
+//----------------------------------------------------
+// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST.
+//----------------------------------------------------
+
package org.opensearch.client.opensearch.cluster;
import jakarta.json.stream.JsonGenerator;
import java.util.Map;
+import java.util.Objects;
import java.util.function.Function;
+import javax.annotation.Generated;
+import javax.annotation.Nonnull;
import javax.annotation.Nullable;
import org.opensearch.client.json.JsonData;
import org.opensearch.client.json.JsonpDeserializable;
@@ -44,37 +51,53 @@
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._types.ComponentTemplateNode
+// typedef: cluster.ComponentTemplateNode
@JsonpDeserializable
-public class ComponentTemplateNode implements PlainJsonSerializable {
+@Generated("org.opensearch.client.codegen.CodeGenerator")
+public class ComponentTemplateNode
+ implements
+ PlainJsonSerializable,
+ ToCopyableBuilder {
+
+ @Nonnull
+ private final Map meta;
+
+ @Nonnull
private final ComponentTemplateSummary template;
@Nullable
private final Long version;
- private final Map meta;
-
// ---------------------------------------------------------------------------------------------
private ComponentTemplateNode(Builder builder) {
-
+ this.meta = ApiTypeHelper.unmodifiable(builder.meta);
this.template = ApiTypeHelper.requireNonNull(builder.template, this, "template");
this.version = builder.version;
- this.meta = ApiTypeHelper.unmodifiable(builder.meta);
-
}
- public static ComponentTemplateNode of(Function> fn) {
+ public static ComponentTemplateNode of(Function> fn) {
return fn.apply(new Builder()).build();
}
+ /**
+ * API name: {@code _meta}
+ */
+ @Nonnull
+ public final Map meta() {
+ return this.meta;
+ }
+
/**
* Required - API name: {@code template}
*/
+ @Nonnull
public final ComponentTemplateSummary template() {
return this.template;
}
@@ -87,16 +110,10 @@ public final Long version() {
return this.version;
}
- /**
- * API name: {@code _meta}
- */
- public final Map meta() {
- return this.meta;
- }
-
/**
* Serialize this object to JSON.
*/
+ @Override
public void serialize(JsonGenerator generator, JsonpMapper mapper) {
generator.writeStartObject();
serializeInternal(generator, mapper);
@@ -104,72 +121,76 @@ public void serialize(JsonGenerator generator, JsonpMapper mapper) {
}
protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) {
-
- generator.writeKey("template");
- this.template.serialize(generator, mapper);
-
- if (this.version != null) {
- generator.writeKey("version");
- generator.write(this.version);
-
- }
if (ApiTypeHelper.isDefined(this.meta)) {
generator.writeKey("_meta");
generator.writeStartObject();
for (Map.Entry item0 : this.meta.entrySet()) {
generator.writeKey(item0.getKey());
item0.getValue().serialize(generator, mapper);
-
}
generator.writeEnd();
-
}
+ generator.writeKey("template");
+ this.template.serialize(generator, mapper);
+
+ if (this.version != null) {
+ generator.writeKey("version");
+ generator.write(this.version);
+ }
}
// ---------------------------------------------------------------------------------------------
+ @Override
+ @Nonnull
+ public Builder toBuilder() {
+ return new Builder(this);
+ }
+
+ @Nonnull
+ public static Builder builder() {
+ return new Builder();
+ }
+
/**
* Builder for {@link ComponentTemplateNode}.
*/
-
- public static class Builder extends ObjectBuilderBase implements ObjectBuilder {
+ public static class Builder extends ObjectBuilderBase implements CopyableBuilder {
+ @Nullable
+ private Map meta;
private ComponentTemplateSummary template;
-
@Nullable
private Long version;
- @Nullable
- private Map meta;
+ public Builder() {}
- /**
- * Required - API name: {@code template}
- */
- public final Builder template(ComponentTemplateSummary value) {
- this.template = value;
- return this;
+ private Builder(ComponentTemplateNode o) {
+ this.meta = _mapCopy(o.meta);
+ this.template = o.template;
+ this.version = o.version;
}
- /**
- * Required - API name: {@code template}
- */
- public final Builder template(Function> fn) {
- return this.template(fn.apply(new ComponentTemplateSummary.Builder()).build());
+ private Builder(Builder o) {
+ this.meta = _mapCopy(o.meta);
+ this.template = o.template;
+ this.version = o.version;
}
- /**
- * API name: {@code version}
- */
- public final Builder version(@Nullable Long value) {
- this.version = value;
- return this;
+ @Override
+ @Nonnull
+ public Builder copy() {
+ return new Builder(this);
}
/**
* API name: {@code _meta}
+ *
*
- * Adds all entries of map
to meta
.
+ * Adds all elements of map
to meta
.
+ *
*/
+ @Nonnull
public final Builder meta(Map map) {
this.meta = _mapPutAll(this.meta, map);
return this;
@@ -177,20 +198,50 @@ public final Builder meta(Map map) {
/**
* API name: {@code _meta}
+ *
*
* Adds an entry to meta
.
+ *
*/
+ @Nonnull
public final Builder meta(String key, JsonData value) {
this.meta = _mapPut(this.meta, key, value);
return this;
}
+ /**
+ * Required - API name: {@code template}
+ */
+ @Nonnull
+ public final Builder template(ComponentTemplateSummary value) {
+ this.template = value;
+ return this;
+ }
+
+ /**
+ * Required - API name: {@code template}
+ */
+ @Nonnull
+ public final Builder template(Function> fn) {
+ return template(fn.apply(new ComponentTemplateSummary.Builder()).build());
+ }
+
+ /**
+ * API name: {@code version}
+ */
+ @Nonnull
+ public final Builder version(@Nullable Long value) {
+ this.version = value;
+ return this;
+ }
+
/**
* Builds a {@link ComponentTemplateNode}.
*
- * @throws NullPointerException
- * if some of the required fields are null.
+ * @throws NullPointerException if some of the required fields are null.
*/
+ @Override
+ @Nonnull
public ComponentTemplateNode build() {
_checkSingleUse();
@@ -209,11 +260,25 @@ public ComponentTemplateNode build() {
);
protected static void setupComponentTemplateNodeDeserializer(ObjectDeserializer op) {
-
+ op.add(Builder::meta, JsonpDeserializer.stringMapDeserializer(JsonData._DESERIALIZER), "_meta");
op.add(Builder::template, ComponentTemplateSummary._DESERIALIZER, "template");
op.add(Builder::version, JsonpDeserializer.longDeserializer(), "version");
- op.add(Builder::meta, JsonpDeserializer.stringMapDeserializer(JsonData._DESERIALIZER), "_meta");
+ }
+ @Override
+ public int hashCode() {
+ int result = 17;
+ result = 31 * result + Objects.hashCode(this.meta);
+ result = 31 * result + this.template.hashCode();
+ result = 31 * result + Objects.hashCode(this.version);
+ return result;
}
+ @Override
+ public boolean equals(Object o) {
+ if (this == o) return true;
+ if (o == null || this.getClass() != o.getClass()) return false;
+ ComponentTemplateNode other = (ComponentTemplateNode) o;
+ return Objects.equals(this.meta, other.meta) && this.template.equals(other.template) && Objects.equals(this.version, other.version);
+ }
}
diff --git a/java-client/src/main/java/org/opensearch/client/opensearch/cluster/ComponentTemplateSummary.java b/java-client/src/generated/java/org/opensearch/client/opensearch/cluster/ComponentTemplateSummary.java
similarity index 71%
rename from java-client/src/main/java/org/opensearch/client/opensearch/cluster/ComponentTemplateSummary.java
rename to java-client/src/generated/java/org/opensearch/client/opensearch/cluster/ComponentTemplateSummary.java
index 3f6006441e..ff0fda7efc 100644
--- a/java-client/src/main/java/org/opensearch/client/opensearch/cluster/ComponentTemplateSummary.java
+++ b/java-client/src/generated/java/org/opensearch/client/opensearch/cluster/ComponentTemplateSummary.java
@@ -30,11 +30,18 @@
* GitHub history for details.
*/
+//----------------------------------------------------
+// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST.
+//----------------------------------------------------
+
package org.opensearch.client.opensearch.cluster;
import jakarta.json.stream.JsonGenerator;
import java.util.Map;
+import java.util.Objects;
import java.util.function.Function;
+import javax.annotation.Generated;
+import javax.annotation.Nonnull;
import javax.annotation.Nullable;
import org.opensearch.client.json.JsonData;
import org.opensearch.client.json.JsonpDeserializable;
@@ -47,81 +54,93 @@
import org.opensearch.client.opensearch.indices.AliasDefinition;
import org.opensearch.client.opensearch.indices.IndexSettings;
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._types.ComponentTemplateSummary
+// typedef: cluster.ComponentTemplateSummary
@JsonpDeserializable
-public class ComponentTemplateSummary implements PlainJsonSerializable {
- private final Map meta;
+@Generated("org.opensearch.client.codegen.CodeGenerator")
+public class ComponentTemplateSummary
+ implements
+ PlainJsonSerializable,
+ ToCopyableBuilder {
+
+ @Nonnull
+ private final Map aliases;
@Nullable
- private final Long version;
+ private final TypeMapping mappings;
+ @Nonnull
+ private final Map meta;
+
+ @Nonnull
private final Map settings;
@Nullable
- private final TypeMapping mappings;
-
- private final Map aliases;
+ private final Long version;
// ---------------------------------------------------------------------------------------------
private ComponentTemplateSummary(Builder builder) {
-
+ this.aliases = ApiTypeHelper.unmodifiable(builder.aliases);
+ this.mappings = builder.mappings;
this.meta = ApiTypeHelper.unmodifiable(builder.meta);
+ this.settings = ApiTypeHelper.unmodifiable(builder.settings);
this.version = builder.version;
- this.settings = ApiTypeHelper.unmodifiableRequired(builder.settings, this, "settings");
- this.mappings = builder.mappings;
- this.aliases = ApiTypeHelper.unmodifiable(builder.aliases);
-
}
- public static ComponentTemplateSummary of(Function> fn) {
+ public static ComponentTemplateSummary of(Function> fn) {
return fn.apply(new Builder()).build();
}
/**
- * API name: {@code _meta}
+ * API name: {@code aliases}
*/
- public final Map meta() {
- return this.meta;
+ @Nonnull
+ public final Map aliases() {
+ return this.aliases;
}
/**
- * API name: {@code version}
+ * API name: {@code mappings}
*/
@Nullable
- public final Long version() {
- return this.version;
+ public final TypeMapping mappings() {
+ return this.mappings;
}
/**
- * Required - API name: {@code settings}
+ * API name: {@code _meta}
*/
- public final Map settings() {
- return this.settings;
+ @Nonnull
+ public final Map meta() {
+ return this.meta;
}
/**
- * API name: {@code mappings}
+ * API name: {@code settings}
*/
- @Nullable
- public final TypeMapping mappings() {
- return this.mappings;
+ @Nonnull
+ public final Map settings() {
+ return this.settings;
}
/**
- * API name: {@code aliases}
+ * API name: {@code version}
*/
- public final Map aliases() {
- return this.aliases;
+ @Nullable
+ public final Long version() {
+ return this.version;
}
/**
* Serialize this object to JSON.
*/
+ @Override
public void serialize(JsonGenerator generator, JsonpMapper mapper) {
generator.writeStartObject();
serializeInternal(generator, mapper);
@@ -129,6 +148,20 @@ public void serialize(JsonGenerator generator, JsonpMapper mapper) {
}
protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) {
+ if (ApiTypeHelper.isDefined(this.aliases)) {
+ generator.writeKey("aliases");
+ generator.writeStartObject();
+ for (Map.Entry item0 : this.aliases.entrySet()) {
+ generator.writeKey(item0.getKey());
+ item0.getValue().serialize(generator, mapper);
+ }
+ generator.writeEnd();
+ }
+
+ if (this.mappings != null) {
+ generator.writeKey("mappings");
+ this.mappings.serialize(generator, mapper);
+ }
if (ApiTypeHelper.isDefined(this.meta)) {
generator.writeKey("_meta");
@@ -136,174 +169,213 @@ protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) {
for (Map.Entry item0 : this.meta.entrySet()) {
generator.writeKey(item0.getKey());
item0.getValue().serialize(generator, mapper);
-
}
generator.writeEnd();
-
}
- if (this.version != null) {
- generator.writeKey("version");
- generator.write(this.version);
- }
if (ApiTypeHelper.isDefined(this.settings)) {
generator.writeKey("settings");
generator.writeStartObject();
for (Map.Entry item0 : this.settings.entrySet()) {
generator.writeKey(item0.getKey());
item0.getValue().serialize(generator, mapper);
-
}
generator.writeEnd();
-
}
- if (this.mappings != null) {
- generator.writeKey("mappings");
- this.mappings.serialize(generator, mapper);
+ if (this.version != null) {
+ generator.writeKey("version");
+ generator.write(this.version);
}
- if (ApiTypeHelper.isDefined(this.aliases)) {
- generator.writeKey("aliases");
- generator.writeStartObject();
- for (Map.Entry item0 : this.aliases.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 ComponentTemplateSummary}.
*/
-
- public static class Builder extends ObjectBuilderBase implements ObjectBuilder {
+ public static class Builder extends ObjectBuilderBase implements CopyableBuilder {
+ @Nullable
+ private Map aliases;
+ @Nullable
+ private TypeMapping mappings;
@Nullable
private Map meta;
-
+ @Nullable
+ private Map settings;
@Nullable
private Long version;
- private Map settings;
+ public Builder() {}
- @Nullable
- private TypeMapping mappings;
+ private Builder(ComponentTemplateSummary o) {
+ this.aliases = _mapCopy(o.aliases);
+ this.mappings = o.mappings;
+ this.meta = _mapCopy(o.meta);
+ this.settings = _mapCopy(o.settings);
+ this.version = o.version;
+ }
- @Nullable
- private Map aliases;
+ private Builder(Builder o) {
+ this.aliases = _mapCopy(o.aliases);
+ this.mappings = o.mappings;
+ this.meta = _mapCopy(o.meta);
+ this.settings = _mapCopy(o.settings);
+ this.version = o.version;
+ }
+
+ @Override
+ @Nonnull
+ public Builder copy() {
+ return new Builder(this);
+ }
/**
- * API name: {@code _meta}
+ * API name: {@code aliases}
+ *
*
- * Adds all entries of map
to meta
.
+ * Adds all elements of map
to aliases
.
+ *
*/
- public final Builder meta(Map map) {
- this.meta = _mapPutAll(this.meta, map);
+ @Nonnull
+ public final Builder aliases(Map map) {
+ this.aliases = _mapPutAll(this.aliases, map);
return this;
}
/**
- * API name: {@code _meta}
+ * API name: {@code aliases}
+ *
*
- * Adds an entry to meta
.
+ * Adds an entry to aliases
.
+ *
*/
- public final Builder meta(String key, JsonData value) {
- this.meta = _mapPut(this.meta, key, value);
+ @Nonnull
+ public final Builder aliases(String key, AliasDefinition value) {
+ this.aliases = _mapPut(this.aliases, key, value);
return this;
}
/**
- * API name: {@code version}
+ * API name: {@code aliases}
+ *
+ *
+ * Adds a value to aliases
using a builder lambda.
+ *
*/
- public final Builder version(@Nullable Long value) {
- this.version = value;
- return this;
+ @Nonnull
+ public final Builder aliases(String key, Function> fn) {
+ return aliases(key, fn.apply(new AliasDefinition.Builder()).build());
}
/**
- * Required - API name: {@code settings}
- *
- * Adds all entries of map
to settings
.
+ * API name: {@code mappings}
*/
- public final Builder settings(Map map) {
- this.settings = _mapPutAll(this.settings, map);
+ @Nonnull
+ public final Builder mappings(@Nullable TypeMapping value) {
+ this.mappings = value;
return this;
}
/**
- * Required - API name: {@code settings}
- *
- * Adds an entry to settings
.
+ * API name: {@code mappings}
*/
- public final Builder settings(String key, IndexSettings value) {
- this.settings = _mapPut(this.settings, key, value);
- return this;
+ @Nonnull
+ public final Builder mappings(Function> fn) {
+ return mappings(fn.apply(new TypeMapping.Builder()).build());
}
/**
- * Required - API name: {@code settings}
+ * API name: {@code _meta}
+ *
*
- * Adds an entry to settings
using a builder lambda.
+ * Adds all elements of map
to meta
.
+ *
*/
- public final Builder settings(String key, Function> fn) {
- return settings(key, fn.apply(new IndexSettings.Builder()).build());
+ @Nonnull
+ public final Builder meta(Map map) {
+ this.meta = _mapPutAll(this.meta, map);
+ return this;
}
/**
- * API name: {@code mappings}
+ * API name: {@code _meta}
+ *
+ *
+ * Adds an entry to meta
.
+ *
*/
- public final Builder mappings(@Nullable TypeMapping value) {
- this.mappings = value;
+ @Nonnull
+ public final Builder meta(String key, JsonData value) {
+ this.meta = _mapPut(this.meta, key, value);
return this;
}
/**
- * API name: {@code mappings}
+ * API name: {@code settings}
+ *
+ *
+ * Adds all elements of map
to settings
.
+ *
*/
- public final Builder mappings(Function> fn) {
- return this.mappings(fn.apply(new TypeMapping.Builder()).build());
+ @Nonnull
+ public final Builder settings(Map map) {
+ this.settings = _mapPutAll(this.settings, map);
+ return this;
}
/**
- * API name: {@code aliases}
+ * API name: {@code settings}
+ *
*
- * Adds all entries of map
to aliases
.
+ * Adds an entry to settings
.
+ *
*/
- public final Builder aliases(Map map) {
- this.aliases = _mapPutAll(this.aliases, map);
+ @Nonnull
+ public final Builder settings(String key, IndexSettings value) {
+ this.settings = _mapPut(this.settings, key, value);
return this;
}
/**
- * API name: {@code aliases}
+ * API name: {@code settings}
+ *
*
- * Adds an entry to aliases
.
+ * Adds a value to settings
using a builder lambda.
+ *
*/
- public final Builder aliases(String key, AliasDefinition value) {
- this.aliases = _mapPut(this.aliases, key, value);
- return this;
+ @Nonnull
+ public final Builder settings(String key, Function> fn) {
+ return settings(key, fn.apply(new IndexSettings.Builder()).build());
}
/**
- * API name: {@code aliases}
- *
- * Adds an entry to aliases
using a builder lambda.
+ * API name: {@code version}
*/
- public final Builder aliases(String key, Function> fn) {
- return aliases(key, fn.apply(new AliasDefinition.Builder()).build());
+ @Nonnull
+ public final Builder version(@Nullable Long value) {
+ this.version = value;
+ return this;
}
/**
* Builds a {@link ComponentTemplateSummary}.
*
- * @throws NullPointerException
- * if some of the required fields are null.
+ * @throws NullPointerException if some of the required fields are null.
*/
+ @Override
+ @Nonnull
public ComponentTemplateSummary build() {
_checkSingleUse();
@@ -322,13 +394,33 @@ public ComponentTemplateSummary build() {
);
protected static void setupComponentTemplateSummaryDeserializer(ObjectDeserializer op) {
-
+ op.add(Builder::aliases, JsonpDeserializer.stringMapDeserializer(AliasDefinition._DESERIALIZER), "aliases");
+ op.add(Builder::mappings, TypeMapping._DESERIALIZER, "mappings");
op.add(Builder::meta, JsonpDeserializer.stringMapDeserializer(JsonData._DESERIALIZER), "_meta");
- op.add(Builder::version, JsonpDeserializer.longDeserializer(), "version");
op.add(Builder::settings, JsonpDeserializer.stringMapDeserializer(IndexSettings._DESERIALIZER), "settings");
- op.add(Builder::mappings, TypeMapping._DESERIALIZER, "mappings");
- op.add(Builder::aliases, JsonpDeserializer.stringMapDeserializer(AliasDefinition._DESERIALIZER), "aliases");
+ op.add(Builder::version, JsonpDeserializer.longDeserializer(), "version");
+ }
+ @Override
+ public int hashCode() {
+ int result = 17;
+ result = 31 * result + Objects.hashCode(this.aliases);
+ result = 31 * result + Objects.hashCode(this.mappings);
+ result = 31 * result + Objects.hashCode(this.meta);
+ result = 31 * result + Objects.hashCode(this.settings);
+ result = 31 * result + Objects.hashCode(this.version);
+ return result;
}
+ @Override
+ public boolean equals(Object o) {
+ if (this == o) return true;
+ if (o == null || this.getClass() != o.getClass()) return false;
+ ComponentTemplateSummary other = (ComponentTemplateSummary) o;
+ return Objects.equals(this.aliases, other.aliases)
+ && Objects.equals(this.mappings, other.mappings)
+ && Objects.equals(this.meta, other.meta)
+ && Objects.equals(this.settings, other.settings)
+ && Objects.equals(this.version, other.version);
+ }
}
diff --git a/java-client/src/main/java/org/opensearch/client/opensearch/cluster/DeleteComponentTemplateRequest.java b/java-client/src/generated/java/org/opensearch/client/opensearch/cluster/DeleteComponentTemplateRequest.java
similarity index 57%
rename from java-client/src/main/java/org/opensearch/client/opensearch/cluster/DeleteComponentTemplateRequest.java
rename to java-client/src/generated/java/org/opensearch/client/opensearch/cluster/DeleteComponentTemplateRequest.java
index 043dae54fc..8e0ec5708b 100644
--- a/java-client/src/main/java/org/opensearch/client/opensearch/cluster/DeleteComponentTemplateRequest.java
+++ b/java-client/src/generated/java/org/opensearch/client/opensearch/cluster/DeleteComponentTemplateRequest.java
@@ -30,11 +30,18 @@
* GitHub history for details.
*/
+//----------------------------------------------------
+// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST.
+//----------------------------------------------------
+
package org.opensearch.client.opensearch.cluster;
import java.util.HashMap;
import java.util.Map;
+import java.util.Objects;
import java.util.function.Function;
+import javax.annotation.Generated;
+import javax.annotation.Nonnull;
import javax.annotation.Nullable;
import org.opensearch.client.opensearch._types.ErrorResponse;
import org.opensearch.client.opensearch._types.RequestBase;
@@ -42,24 +49,29 @@
import org.opensearch.client.transport.Endpoint;
import org.opensearch.client.transport.endpoints.SimpleEndpoint;
import org.opensearch.client.util.ApiTypeHelper;
+import org.opensearch.client.util.CopyableBuilder;
import org.opensearch.client.util.ObjectBuilder;
import org.opensearch.client.util.ObjectBuilderBase;
+import org.opensearch.client.util.ToCopyableBuilder;
// typedef: cluster.delete_component_template.Request
/**
- * Deletes a component template
- *
+ * Deletes a component template.
*/
+@Generated("org.opensearch.client.codegen.CodeGenerator")
+public class DeleteComponentTemplateRequest extends RequestBase
+ implements
+ ToCopyableBuilder {
-public class DeleteComponentTemplateRequest extends RequestBase {
- @Deprecated
@Nullable
- private final Time masterTimeout;
+ private final Time clusterManagerTimeout;
+ @Deprecated
@Nullable
- private final Time clusterManagerTimeout;
+ private final Time masterTimeout;
+ @Nonnull
private final String name;
@Nullable
@@ -68,52 +80,58 @@ public class DeleteComponentTemplateRequest extends RequestBase {
// ---------------------------------------------------------------------------------------------
private DeleteComponentTemplateRequest(Builder builder) {
-
- this.masterTimeout = builder.masterTimeout;
this.clusterManagerTimeout = builder.clusterManagerTimeout;
+ this.masterTimeout = builder.masterTimeout;
this.name = ApiTypeHelper.requireNonNull(builder.name, this, "name");
this.timeout = builder.timeout;
-
}
- public static DeleteComponentTemplateRequest of(Function> fn) {
+ public static DeleteComponentTemplateRequest of(
+ Function> fn
+ ) {
return fn.apply(new Builder()).build();
}
/**
- * Specify timeout for connection to master
+ * Operation timeout for connection to cluster-manager node.
*
- * API name: {@code master_timeout}
+ * API name: {@code cluster_manager_timeout}
+ *
*/
- @Deprecated
@Nullable
- public final Time masterTimeout() {
- return this.masterTimeout;
+ public final Time clusterManagerTimeout() {
+ return this.clusterManagerTimeout;
}
/**
- * Specify timeout for connection to cluster-manager
+ * Period to wait for a connection to the cluster-manager node. If no response is received before the timeout expires, the request fails
+ * and returns an error.
*
- * API name: {@code cluster_manager_timeout}
+ * API name: {@code master_timeout}
+ *
*/
+ @Deprecated
@Nullable
- public final Time clusterManagerTimeout() {
- return this.clusterManagerTimeout;
+ public final Time masterTimeout() {
+ return this.masterTimeout;
}
/**
- * Required - The name of the template
+ * Required - Name of the component template to delete. Wildcard (*) expressions are supported.
*
* API name: {@code name}
+ *
*/
+ @Nonnull
public final String name() {
return this.name;
}
/**
- * Explicit operation timeout
+ * Period to wait for a response. If no response is received before the timeout expires, the request fails and returns an error.
*
* API name: {@code timeout}
+ *
*/
@Nullable
public final Time timeout() {
@@ -122,98 +140,143 @@ public final Time timeout() {
// ---------------------------------------------------------------------------------------------
+ @Override
+ @Nonnull
+ public Builder toBuilder() {
+ return new Builder(this);
+ }
+
+ @Nonnull
+ public static Builder builder() {
+ return new Builder();
+ }
+
/**
* Builder for {@link DeleteComponentTemplateRequest}.
*/
-
- public static class Builder extends ObjectBuilderBase implements ObjectBuilder {
- @Deprecated
- @Nullable
- private Time masterTimeout;
-
+ public static class Builder extends ObjectBuilderBase implements CopyableBuilder {
@Nullable
private Time clusterManagerTimeout;
-
+ @Nullable
+ private Time masterTimeout;
private String name;
-
@Nullable
private Time timeout;
+ public Builder() {}
+
+ private Builder(DeleteComponentTemplateRequest o) {
+ this.clusterManagerTimeout = o.clusterManagerTimeout;
+ this.masterTimeout = o.masterTimeout;
+ this.name = o.name;
+ this.timeout = o.timeout;
+ }
+
+ private Builder(Builder o) {
+ this.clusterManagerTimeout = o.clusterManagerTimeout;
+ this.masterTimeout = o.masterTimeout;
+ this.name = o.name;
+ this.timeout = o.timeout;
+ }
+
+ @Override
+ @Nonnull
+ public Builder copy() {
+ return new Builder(this);
+ }
+
/**
- * Specify timeout for connection to master
+ * Operation timeout for connection to cluster-manager node.
*
- * API name: {@code master_timeout}
+ * API name: {@code cluster_manager_timeout}
+ *
*/
- @Deprecated
- public final Builder masterTimeout(@Nullable Time value) {
- this.masterTimeout = value;
+ @Nonnull
+ public final Builder clusterManagerTimeout(@Nullable Time value) {
+ this.clusterManagerTimeout = value;
return this;
}
/**
- * Specify timeout for connection to master
+ * Operation timeout for connection to cluster-manager node.
*
- * API name: {@code master_timeout}
+ * API name: {@code cluster_manager_timeout}
+ *
*/
- @Deprecated
- public final Builder masterTimeout(Function> fn) {
- return this.masterTimeout(fn.apply(new Time.Builder()).build());
+ @Nonnull
+ public final Builder clusterManagerTimeout(Function> fn) {
+ return clusterManagerTimeout(fn.apply(new Time.Builder()).build());
}
/**
- * Specify timeout for connection to cluster-manager
+ * Period to wait for a connection to the cluster-manager node. If no response is received before the timeout expires, the request
+ * fails and returns an error.
*
- * API name: {@code cluster_manager_timeout}
+ * API name: {@code master_timeout}
+ *
*/
- public final Builder clusterManagerTimeout(@Nullable Time value) {
- this.clusterManagerTimeout = value;
+ @Deprecated
+ @Nonnull
+ public final Builder masterTimeout(@Nullable Time value) {
+ this.masterTimeout = value;
return this;
}
/**
- * Specify timeout for connection to cluster-manager
+ * Period to wait for a connection to the cluster-manager node. If no response is received before the timeout expires, the request
+ * fails and returns an error.
*
- * API name: {@code cluster_manager_timeout}
+ * API name: {@code master_timeout}
+ *
*/
- public final Builder clusterManagerTimeout(Function> fn) {
- return this.clusterManagerTimeout(fn.apply(new Time.Builder()).build());
+ @Deprecated
+ @Nonnull
+ public final Builder masterTimeout(Function> fn) {
+ return masterTimeout(fn.apply(new Time.Builder()).build());
}
/**
- * Required - The name of the template
+ * Required - Name of the component template to delete. Wildcard (*) expressions are supported.
*
* API name: {@code name}
+ *
*/
+ @Nonnull
public final Builder name(String value) {
this.name = value;
return this;
}
/**
- * Explicit operation timeout
+ * Period to wait for a response. If no response is received before the timeout expires, the request fails and returns an error.
*
* API name: {@code timeout}
+ *
*/
+ @Nonnull
public final Builder timeout(@Nullable Time value) {
this.timeout = value;
return this;
}
/**
- * Explicit operation timeout
+ * Period to wait for a response. If no response is received before the timeout expires, the request fails and returns an error.
*
* API name: {@code timeout}
+ *
*/
+ @Nonnull
public final Builder timeout(Function> fn) {
- return this.timeout(fn.apply(new Time.Builder()).build());
+ return timeout(fn.apply(new Time.Builder()).build());
}
/**
* Builds a {@link DeleteComponentTemplateRequest}.
*
- * @throws NullPointerException
- * if some of the required fields are null.
+ * @throws NullPointerException if some of the required fields are null.
*/
+ @Override
+ @Nonnull
public DeleteComponentTemplateRequest build() {
_checkSingleUse();
@@ -228,49 +291,52 @@ public DeleteComponentTemplateRequest build() {
*/
public static final Endpoint _ENDPOINT =
new SimpleEndpoint<>(
-
// Request method
- request -> {
- return "DELETE";
-
- },
-
+ request -> "DELETE",
// Request path
request -> {
- final int _name = 1 << 0;
-
- int propsSet = 0;
-
- propsSet |= _name;
-
- if (propsSet == (_name)) {
- StringBuilder buf = new StringBuilder();
- buf.append("/_component_template");
- buf.append("/");
- SimpleEndpoint.pathEncode(request.name, buf);
- return buf.toString();
- }
- throw SimpleEndpoint.noPathTemplateFound("path");
-
+ StringBuilder buf = new StringBuilder();
+ buf.append("/_component_template/");
+ SimpleEndpoint.pathEncode(request.name, buf);
+ return buf.toString();
},
-
// Request parameters
request -> {
Map params = new HashMap<>();
- if (request.masterTimeout != null) {
- params.put("master_timeout", request.masterTimeout._toJsonString());
- }
if (request.clusterManagerTimeout != null) {
params.put("cluster_manager_timeout", request.clusterManagerTimeout._toJsonString());
}
+ if (request.masterTimeout != null) {
+ params.put("master_timeout", request.masterTimeout._toJsonString());
+ }
if (request.timeout != null) {
params.put("timeout", request.timeout._toJsonString());
}
return params;
-
},
SimpleEndpoint.emptyMap(),
false,
DeleteComponentTemplateResponse._DESERIALIZER
);
+
+ @Override
+ public int hashCode() {
+ int result = 17;
+ result = 31 * result + Objects.hashCode(this.clusterManagerTimeout);
+ result = 31 * result + Objects.hashCode(this.masterTimeout);
+ result = 31 * result + this.name.hashCode();
+ result = 31 * result + Objects.hashCode(this.timeout);
+ return result;
+ }
+
+ @Override
+ public boolean equals(Object o) {
+ if (this == o) return true;
+ if (o == null || this.getClass() != o.getClass()) return false;
+ DeleteComponentTemplateRequest other = (DeleteComponentTemplateRequest) o;
+ return Objects.equals(this.clusterManagerTimeout, other.clusterManagerTimeout)
+ && Objects.equals(this.masterTimeout, other.masterTimeout)
+ && this.name.equals(other.name)
+ && Objects.equals(this.timeout, other.timeout);
+ }
}
diff --git a/java-client/src/main/java/org/opensearch/client/opensearch/cluster/DeleteComponentTemplateResponse.java b/java-client/src/generated/java/org/opensearch/client/opensearch/cluster/DeleteComponentTemplateResponse.java
similarity index 63%
rename from java-client/src/main/java/org/opensearch/client/opensearch/cluster/DeleteComponentTemplateResponse.java
rename to java-client/src/generated/java/org/opensearch/client/opensearch/cluster/DeleteComponentTemplateResponse.java
index 4b37536fbc..1a10fd0750 100644
--- a/java-client/src/main/java/org/opensearch/client/opensearch/cluster/DeleteComponentTemplateResponse.java
+++ b/java-client/src/generated/java/org/opensearch/client/opensearch/cluster/DeleteComponentTemplateResponse.java
@@ -30,41 +30,82 @@
* GitHub history for details.
*/
+//----------------------------------------------------
+// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST.
+//----------------------------------------------------
+
package org.opensearch.client.opensearch.cluster;
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.ObjectBuilderDeserializer;
import org.opensearch.client.json.ObjectDeserializer;
import org.opensearch.client.opensearch._types.AcknowledgedResponseBase;
+import org.opensearch.client.util.CopyableBuilder;
import org.opensearch.client.util.ObjectBuilder;
+import org.opensearch.client.util.ToCopyableBuilder;
// typedef: cluster.delete_component_template.Response
@JsonpDeserializable
-public class DeleteComponentTemplateResponse extends AcknowledgedResponseBase {
+@Generated("org.opensearch.client.codegen.CodeGenerator")
+public class DeleteComponentTemplateResponse extends AcknowledgedResponseBase
+ implements
+ ToCopyableBuilder {
+
// ---------------------------------------------------------------------------------------------
private DeleteComponentTemplateResponse(Builder builder) {
super(builder);
-
}
- public static DeleteComponentTemplateResponse of(Function> fn) {
+ public static DeleteComponentTemplateResponse of(
+ Function> fn
+ ) {
return fn.apply(new Builder()).build();
}
// ---------------------------------------------------------------------------------------------
+ @Override
+ @Nonnull
+ public Builder toBuilder() {
+ return new Builder(this);
+ }
+
+ @Nonnull
+ public static Builder builder() {
+ return new Builder();
+ }
+
/**
* Builder for {@link DeleteComponentTemplateResponse}.
*/
-
public static class Builder extends AcknowledgedResponseBase.AbstractBuilder
implements
- ObjectBuilder {
+ CopyableBuilder {
+
+ public Builder() {}
+
+ private Builder(DeleteComponentTemplateResponse o) {
+ super(o);
+ }
+
+ private Builder(Builder o) {
+ super(o);
+ }
+
+ @Override
+ @Nonnull
+ public Builder copy() {
+ return new Builder(this);
+ }
+
@Override
+ @Nonnull
protected Builder self() {
return this;
}
@@ -72,9 +113,10 @@ protected Builder self() {
/**
* Builds a {@link DeleteComponentTemplateResponse}.
*
- * @throws NullPointerException
- * if some of the required fields are null.
+ * @throws NullPointerException if some of the required fields are null.
*/
+ @Override
+ @Nonnull
public DeleteComponentTemplateResponse build() {
_checkSingleUse();
@@ -93,8 +135,22 @@ public DeleteComponentTemplateResponse build() {
);
protected static void setupDeleteComponentTemplateResponseDeserializer(ObjectDeserializer op) {
- AcknowledgedResponseBase.setupAcknowledgedResponseBaseDeserializer(op);
+ setupAcknowledgedResponseBaseDeserializer(op);
+ }
+ @Override
+ public int hashCode() {
+ int result = super.hashCode();
+ return result;
}
+ @Override
+ public boolean equals(Object o) {
+ if (!super.equals(o)) {
+ return false;
+ }
+ if (this == o) return true;
+ if (o == null || this.getClass() != o.getClass()) return false;
+ return true;
+ }
}
diff --git a/java-client/src/main/java/org/opensearch/client/opensearch/cluster/ExistsComponentTemplateRequest.java b/java-client/src/generated/java/org/opensearch/client/opensearch/cluster/ExistsComponentTemplateRequest.java
similarity index 57%
rename from java-client/src/main/java/org/opensearch/client/opensearch/cluster/ExistsComponentTemplateRequest.java
rename to java-client/src/generated/java/org/opensearch/client/opensearch/cluster/ExistsComponentTemplateRequest.java
index ba84b76951..914e5a2313 100644
--- a/java-client/src/main/java/org/opensearch/client/opensearch/cluster/ExistsComponentTemplateRequest.java
+++ b/java-client/src/generated/java/org/opensearch/client/opensearch/cluster/ExistsComponentTemplateRequest.java
@@ -30,13 +30,18 @@
* GitHub history for details.
*/
+//----------------------------------------------------
+// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST.
+//----------------------------------------------------
+
package org.opensearch.client.opensearch.cluster;
import java.util.HashMap;
-import java.util.List;
import java.util.Map;
+import java.util.Objects;
import java.util.function.Function;
-import java.util.stream.Collectors;
+import javax.annotation.Generated;
+import javax.annotation.Nonnull;
import javax.annotation.Nullable;
import org.opensearch.client.opensearch._types.ErrorResponse;
import org.opensearch.client.opensearch._types.RequestBase;
@@ -46,17 +51,24 @@
import org.opensearch.client.transport.endpoints.BooleanResponse;
import org.opensearch.client.transport.endpoints.SimpleEndpoint;
import org.opensearch.client.util.ApiTypeHelper;
+import org.opensearch.client.util.CopyableBuilder;
import org.opensearch.client.util.ObjectBuilder;
import org.opensearch.client.util.ObjectBuilderBase;
+import org.opensearch.client.util.ToCopyableBuilder;
// typedef: cluster.exists_component_template.Request
/**
- * Returns information about whether a particular component template exist
- *
+ * Returns information about whether a particular component template exist.
*/
+@Generated("org.opensearch.client.codegen.CodeGenerator")
+public class ExistsComponentTemplateRequest extends RequestBase
+ implements
+ ToCopyableBuilder {
+
+ @Nullable
+ private final Time clusterManagerTimeout;
-public class ExistsComponentTemplateRequest extends RequestBase {
@Nullable
private final Boolean local;
@@ -64,31 +76,41 @@ public class ExistsComponentTemplateRequest extends RequestBase {
@Nullable
private final Time masterTimeout;
- @Nullable
- private final Time clusterManagerTimeout;
-
- private final List name;
+ @Nonnull
+ private final String name;
// ---------------------------------------------------------------------------------------------
private ExistsComponentTemplateRequest(Builder builder) {
-
+ this.clusterManagerTimeout = builder.clusterManagerTimeout;
this.local = builder.local;
this.masterTimeout = builder.masterTimeout;
- this.clusterManagerTimeout = builder.clusterManagerTimeout;
- this.name = ApiTypeHelper.unmodifiableRequired(builder.name, this, "name");
-
+ this.name = ApiTypeHelper.requireNonNull(builder.name, this, "name");
}
- public static ExistsComponentTemplateRequest of(Function> fn) {
+ public static ExistsComponentTemplateRequest of(
+ Function> fn
+ ) {
return fn.apply(new Builder()).build();
}
/**
- * If true, the request retrieves information from the local node only. Defaults
- * to false, which means information is retrieved from the cluster-manager node.
+ * Operation timeout for connection to cluster-manager node.
+ *