> 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/DeleteVotingConfigExclusionsRequest.java b/java-client/src/generated/java/org/opensearch/client/opensearch/cluster/DeleteVotingConfigExclusionsRequest.java
similarity index 58%
rename from java-client/src/main/java/org/opensearch/client/opensearch/cluster/DeleteVotingConfigExclusionsRequest.java
rename to java-client/src/generated/java/org/opensearch/client/opensearch/cluster/DeleteVotingConfigExclusionsRequest.java
index fcf952f4bf..5fd9c2ac0a 100644
--- a/java-client/src/main/java/org/opensearch/client/opensearch/cluster/DeleteVotingConfigExclusionsRequest.java
+++ b/java-client/src/generated/java/org/opensearch/client/opensearch/cluster/DeleteVotingConfigExclusionsRequest.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,41 +49,43 @@
import org.opensearch.client.transport.endpoints.BooleanEndpoint;
import org.opensearch.client.transport.endpoints.BooleanResponse;
import org.opensearch.client.transport.endpoints.SimpleEndpoint;
+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_voting_config_exclusions.Request
/**
* Clears cluster voting config exclusions.
- *
*/
+@Generated("org.opensearch.client.codegen.CodeGenerator")
+public class DeleteVotingConfigExclusionsRequest extends RequestBase
+ implements
+ ToCopyableBuilder {
-public class DeleteVotingConfigExclusionsRequest extends RequestBase {
@Nullable
private final Boolean waitForRemoval;
// ---------------------------------------------------------------------------------------------
private DeleteVotingConfigExclusionsRequest(Builder builder) {
-
this.waitForRemoval = builder.waitForRemoval;
-
}
- public static DeleteVotingConfigExclusionsRequest of(Function> fn) {
+ public static DeleteVotingConfigExclusionsRequest of(
+ Function> fn
+ ) {
return fn.apply(new Builder()).build();
}
/**
- * Specifies whether to wait for all excluded nodes to be removed from the
- * cluster before clearing the voting configuration exclusions list. Defaults to
- * true, meaning that all excluded nodes must be removed from the cluster before
- * this API takes any action. If set to false then the voting configuration
- * exclusions list is cleared even if some excluded nodes are still in the
- * cluster.
+ * Specifies whether to wait for all excluded nodes to be removed from the cluster before clearing the voting configuration exclusions
+ * list. Defaults to true, meaning that all excluded nodes must be removed from the cluster before this API takes any action. If set to
+ * false
then the voting configuration exclusions list is cleared even if some excluded nodes are still in the cluster.
*
* API name: {@code wait_for_removal}
+ *
*/
@Nullable
public final Boolean waitForRemoval() {
@@ -85,24 +94,50 @@ public final Boolean waitForRemoval() {
// ---------------------------------------------------------------------------------------------
+ @Override
+ @Nonnull
+ public Builder toBuilder() {
+ return new Builder(this);
+ }
+
+ @Nonnull
+ public static Builder builder() {
+ return new Builder();
+ }
+
/**
* Builder for {@link DeleteVotingConfigExclusionsRequest}.
*/
-
- public static class Builder extends ObjectBuilderBase implements ObjectBuilder {
+ public static class Builder extends ObjectBuilderBase implements CopyableBuilder {
@Nullable
private Boolean waitForRemoval;
+ public Builder() {}
+
+ private Builder(DeleteVotingConfigExclusionsRequest o) {
+ this.waitForRemoval = o.waitForRemoval;
+ }
+
+ private Builder(Builder o) {
+ this.waitForRemoval = o.waitForRemoval;
+ }
+
+ @Override
+ @Nonnull
+ public Builder copy() {
+ return new Builder(this);
+ }
+
/**
- * Specifies whether to wait for all excluded nodes to be removed from the
- * cluster before clearing the voting configuration exclusions list. Defaults to
- * true, meaning that all excluded nodes must be removed from the cluster before
- * this API takes any action. If set to false then the voting configuration
- * exclusions list is cleared even if some excluded nodes are still in the
- * cluster.
+ * Specifies whether to wait for all excluded nodes to be removed from the cluster before clearing the voting configuration
+ * exclusions list. Defaults to true, meaning that all excluded nodes must be removed from the cluster before this API takes any
+ * action. If set to false
then the voting configuration exclusions list is cleared even if some excluded nodes are
+ * still in the cluster.
*
* API name: {@code wait_for_removal}
+ *
*/
+ @Nonnull
public final Builder waitForRemoval(@Nullable Boolean value) {
this.waitForRemoval = value;
return this;
@@ -111,9 +146,10 @@ public final Builder waitForRemoval(@Nullable Boolean value) {
/**
* Builds a {@link DeleteVotingConfigExclusionsRequest}.
*
- * @throws NullPointerException
- * if some of the required fields are null.
+ * @throws NullPointerException if some of the required fields are null.
*/
+ @Override
+ @Nonnull
public DeleteVotingConfigExclusionsRequest build() {
_checkSingleUse();
@@ -127,20 +163,10 @@ public DeleteVotingConfigExclusionsRequest build() {
* Endpoint "{@code cluster.delete_voting_config_exclusions}".
*/
public static final Endpoint _ENDPOINT = new BooleanEndpoint<>(
- "opensearch/cluster.delete_voting_config_exclusions",
-
// Request method
- request -> {
- return "DELETE";
-
- },
-
+ request -> "DELETE",
// Request path
- request -> {
- return "/_cluster/voting_config_exclusions";
-
- },
-
+ request -> "/_cluster/voting_config_exclusions",
// Request parameters
request -> {
Map params = new HashMap<>();
@@ -148,10 +174,22 @@ public DeleteVotingConfigExclusionsRequest build() {
params.put("wait_for_removal", String.valueOf(request.waitForRemoval));
}
return params;
-
},
- SimpleEndpoint.emptyMap(),
- false,
- null
+ SimpleEndpoint.emptyMap()
);
+
+ @Override
+ public int hashCode() {
+ int result = 17;
+ result = 31 * result + Objects.hashCode(this.waitForRemoval);
+ return result;
+ }
+
+ @Override
+ public boolean equals(Object o) {
+ if (this == o) return true;
+ if (o == null || this.getClass() != o.getClass()) return false;
+ DeleteVotingConfigExclusionsRequest other = (DeleteVotingConfigExclusionsRequest) o;
+ return Objects.equals(this.waitForRemoval, other.waitForRemoval);
+ }
}
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.
+ *
+ * API name: {@code cluster_manager_timeout}
+ *
+ */
+ @Nullable
+ public final Time clusterManagerTimeout() {
+ return this.clusterManagerTimeout;
+ }
+
+ /**
+ * If true
, the request retrieves information from the local node only. Defaults to false, which means information is
+ * retrieved from the cluster-manager node.
*
* API name: {@code local}
+ *
*/
@Nullable
public final Boolean local() {
@@ -96,10 +118,11 @@ public final Boolean local() {
}
/**
- * Period to wait for a connection to the master node. If no response is
- * received before the timeout expires, the request fails and returns an error.
+ * 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 master_timeout}
+ *
*/
@Deprecated
@Nullable
@@ -108,132 +131,145 @@ public final Time masterTimeout() {
}
/**
- * 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}
- */
- @Nullable
- public final Time clusterManagerTimeout() {
- return this.clusterManagerTimeout;
- }
-
- /**
- * Required - Comma-separated list of component template names used to limit the
- * request. Wildcard (*) expressions are supported.
+ * Required - Name of the component template to check existence of. Wildcard (*) expressions are supported.
*
* API name: {@code name}
+ *
*/
- public final List name() {
+ @Nonnull
+ public final String name() {
return this.name;
}
// ---------------------------------------------------------------------------------------------
+ @Override
+ @Nonnull
+ public Builder toBuilder() {
+ return new Builder(this);
+ }
+
+ @Nonnull
+ public static Builder builder() {
+ return new Builder();
+ }
+
/**
* Builder for {@link ExistsComponentTemplateRequest}.
*/
-
- public static class Builder extends ObjectBuilderBase implements ObjectBuilder {
+ public static class Builder extends ObjectBuilderBase implements CopyableBuilder {
+ @Nullable
+ private Time clusterManagerTimeout;
@Nullable
private Boolean local;
-
- @Deprecated
@Nullable
private Time masterTimeout;
+ private String name;
- @Nullable
- private Time clusterManagerTimeout;
+ public Builder() {}
- private List name;
+ private Builder(ExistsComponentTemplateRequest o) {
+ this.clusterManagerTimeout = o.clusterManagerTimeout;
+ this.local = o.local;
+ this.masterTimeout = o.masterTimeout;
+ this.name = o.name;
+ }
- /**
- * If true, the request retrieves information from the local node only. Defaults
- * to false, which means information is retrieved from the cluster-manager node.
- *
- * API name: {@code local}
- */
- public final Builder local(@Nullable Boolean value) {
- this.local = value;
- return this;
+ private Builder(Builder o) {
+ this.clusterManagerTimeout = o.clusterManagerTimeout;
+ this.local = o.local;
+ this.masterTimeout = o.masterTimeout;
+ this.name = o.name;
+ }
+
+ @Override
+ @Nonnull
+ public Builder copy() {
+ return new Builder(this);
}
/**
- * Period to wait for a connection to the master node. If no response is
- * received before the timeout expires, the request fails and returns an error.
+ * 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;
}
/**
- * Period to wait for a connection to the master node. If no response is
- * received before the timeout expires, the request fails and returns an error.
+ * 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());
}
/**
- * 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.
+ * If true
, the request retrieves information from the local node only. Defaults to false, which means information is
+ * retrieved from the cluster-manager node.
*
- * API name: {@code cluster_manager_timeout}
+ * API name: {@code local}
+ *
*/
- public final Builder clusterManagerTimeout(@Nullable Time value) {
- this.clusterManagerTimeout = value;
+ @Nonnull
+ public final Builder local(@Nullable Boolean value) {
+ this.local = value;
return this;
}
/**
- * 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.
+ * 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(@Nullable Time value) {
+ this.masterTimeout = value;
+ return this;
}
/**
- * Required - Comma-separated list of component template names used to limit the
- * request. Wildcard (*) expressions are supported.
+ * 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 name}
- *
- * Adds all elements of list
to name
.
+ * API name: {@code master_timeout}
+ *
*/
- public final Builder name(List list) {
- this.name = _listAddAll(this.name, list);
- return this;
+ @Deprecated
+ @Nonnull
+ public final Builder masterTimeout(Function> fn) {
+ return masterTimeout(fn.apply(new Time.Builder()).build());
}
/**
- * Required - Comma-separated list of component template names used to limit the
- * request. Wildcard (*) expressions are supported.
+ * Required - Name of the component template to check existence of. Wildcard (*) expressions are supported.
*
* API name: {@code name}
- *
- * Adds one or more values to name
.
+ *
*/
- public final Builder name(String value, String... values) {
- this.name = _listAdd(this.name, value, values);
+ @Nonnull
+ public final Builder name(String value) {
+ this.name = value;
return this;
}
/**
* Builds a {@link ExistsComponentTemplateRequest}.
*
- * @throws NullPointerException
- * if some of the required fields are null.
+ * @throws NullPointerException if some of the required fields are null.
*/
+ @Override
+ @Nonnull
public ExistsComponentTemplateRequest build() {
_checkSingleUse();
@@ -247,50 +283,50 @@ public ExistsComponentTemplateRequest build() {
* Endpoint "{@code cluster.exists_component_template}".
*/
public static final Endpoint _ENDPOINT = new BooleanEndpoint<>(
- "opensearch/cluster.exists_component_template",
-
// Request method
- request -> {
- return "HEAD";
-
- },
-
+ request -> "HEAD",
// 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.stream().map(v -> v).collect(Collectors.joining(",")), 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.local != null) {
params.put("local", String.valueOf(request.local));
}
+ if (request.masterTimeout != null) {
+ params.put("master_timeout", request.masterTimeout._toJsonString());
+ }
return params;
-
},
- SimpleEndpoint.emptyMap(),
- false,
- null
+ SimpleEndpoint.emptyMap()
);
+
+ @Override
+ public int hashCode() {
+ int result = 17;
+ result = 31 * result + Objects.hashCode(this.clusterManagerTimeout);
+ result = 31 * result + Objects.hashCode(this.local);
+ result = 31 * result + Objects.hashCode(this.masterTimeout);
+ 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;
+ ExistsComponentTemplateRequest other = (ExistsComponentTemplateRequest) o;
+ return Objects.equals(this.clusterManagerTimeout, other.clusterManagerTimeout)
+ && Objects.equals(this.local, other.local)
+ && Objects.equals(this.masterTimeout, other.masterTimeout)
+ && this.name.equals(other.name);
+ }
}
diff --git a/java-client/src/main/java/org/opensearch/client/opensearch/cluster/GetClusterSettingsRequest.java b/java-client/src/generated/java/org/opensearch/client/opensearch/cluster/GetClusterSettingsRequest.java
similarity index 59%
rename from java-client/src/main/java/org/opensearch/client/opensearch/cluster/GetClusterSettingsRequest.java
rename to java-client/src/generated/java/org/opensearch/client/opensearch/cluster/GetClusterSettingsRequest.java
index af3bd90d05..a8624547b1 100644
--- a/java-client/src/main/java/org/opensearch/client/opensearch/cluster/GetClusterSettingsRequest.java
+++ b/java-client/src/generated/java/org/opensearch/client/opensearch/cluster/GetClusterSettingsRequest.java
@@ -30,28 +30,42 @@
* 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;
import org.opensearch.client.opensearch._types.Time;
import org.opensearch.client.transport.Endpoint;
import org.opensearch.client.transport.endpoints.SimpleEndpoint;
+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.get_settings.Request
/**
* Returns cluster settings.
- *
*/
+@Generated("org.opensearch.client.codegen.CodeGenerator")
+public class GetClusterSettingsRequest extends RequestBase
+ implements
+ ToCopyableBuilder {
+
+ @Nullable
+ private final Time clusterManagerTimeout;
-public class GetClusterSettingsRequest extends RequestBase {
@Nullable
private final Boolean flatSettings;
@@ -62,32 +76,39 @@ public class GetClusterSettingsRequest extends RequestBase {
@Nullable
private final Time masterTimeout;
- @Nullable
- private final Time clusterManagerTimeout;
-
@Nullable
private final Time timeout;
// ---------------------------------------------------------------------------------------------
private GetClusterSettingsRequest(Builder builder) {
-
+ this.clusterManagerTimeout = builder.clusterManagerTimeout;
this.flatSettings = builder.flatSettings;
this.includeDefaults = builder.includeDefaults;
this.masterTimeout = builder.masterTimeout;
- this.clusterManagerTimeout = builder.clusterManagerTimeout;
this.timeout = builder.timeout;
-
}
- public static GetClusterSettingsRequest of(Function> fn) {
+ public static GetClusterSettingsRequest of(Function> fn) {
return fn.apply(new Builder()).build();
}
/**
- * Return settings in flat format (default: false)
+ * Operation timeout for connection to cluster-manager node.
+ *
+ * API name: {@code cluster_manager_timeout}
+ *
+ */
+ @Nullable
+ public final Time clusterManagerTimeout() {
+ return this.clusterManagerTimeout;
+ }
+
+ /**
+ * If true
, returns settings in flat format.
*
* API name: {@code flat_settings}
+ *
*/
@Nullable
public final Boolean flatSettings() {
@@ -95,9 +116,10 @@ public final Boolean flatSettings() {
}
/**
- * Whether to return all default clusters setting.
+ * If true
, returns default cluster settings from the local node.
*
* API name: {@code include_defaults}
+ *
*/
@Nullable
public final Boolean includeDefaults() {
@@ -105,9 +127,11 @@ public final Boolean includeDefaults() {
}
/**
- * Explicit operation timeout for connection to master node
+ * 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 master_timeout}
+ *
*/
@Deprecated
@Nullable
@@ -116,19 +140,10 @@ public final Time masterTimeout() {
}
/**
- * Explicit operation timeout for connection to cluster-manager node
- *
- * API name: {@code cluster_manager_timeout}
- */
- @Nullable
- public final Time clusterManagerTimeout() {
- return this.clusterManagerTimeout;
- }
-
- /**
- * 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() {
@@ -137,112 +152,160 @@ public final Time timeout() {
// ---------------------------------------------------------------------------------------------
+ @Override
+ @Nonnull
+ public Builder toBuilder() {
+ return new Builder(this);
+ }
+
+ @Nonnull
+ public static Builder builder() {
+ return new Builder();
+ }
+
/**
* Builder for {@link GetClusterSettingsRequest}.
*/
-
- public static class Builder extends ObjectBuilderBase implements ObjectBuilder {
+ public static class Builder extends ObjectBuilderBase implements CopyableBuilder {
+ @Nullable
+ private Time clusterManagerTimeout;
@Nullable
private Boolean flatSettings;
-
@Nullable
private Boolean includeDefaults;
-
- @Deprecated
@Nullable
private Time masterTimeout;
-
- @Nullable
- private Time clusterManagerTimeout;
-
@Nullable
private Time timeout;
+ public Builder() {}
+
+ private Builder(GetClusterSettingsRequest o) {
+ this.clusterManagerTimeout = o.clusterManagerTimeout;
+ this.flatSettings = o.flatSettings;
+ this.includeDefaults = o.includeDefaults;
+ this.masterTimeout = o.masterTimeout;
+ this.timeout = o.timeout;
+ }
+
+ private Builder(Builder o) {
+ this.clusterManagerTimeout = o.clusterManagerTimeout;
+ this.flatSettings = o.flatSettings;
+ this.includeDefaults = o.includeDefaults;
+ this.masterTimeout = o.masterTimeout;
+ this.timeout = o.timeout;
+ }
+
+ @Override
+ @Nonnull
+ public Builder copy() {
+ return new Builder(this);
+ }
+
/**
- * Return settings in flat format (default: false)
+ * Operation timeout for connection to cluster-manager node.
+ *
+ * API name: {@code cluster_manager_timeout}
+ *
+ */
+ @Nonnull
+ public final Builder clusterManagerTimeout(@Nullable Time value) {
+ this.clusterManagerTimeout = value;
+ return this;
+ }
+
+ /**
+ * Operation timeout for connection to cluster-manager node.
+ *
+ * API name: {@code cluster_manager_timeout}
+ *
+ */
+ @Nonnull
+ public final Builder clusterManagerTimeout(Function> fn) {
+ return clusterManagerTimeout(fn.apply(new Time.Builder()).build());
+ }
+
+ /**
+ * If true
, returns settings in flat format.
*
* API name: {@code flat_settings}
+ *
*/
+ @Nonnull
public final Builder flatSettings(@Nullable Boolean value) {
this.flatSettings = value;
return this;
}
/**
- * Whether to return all default clusters setting.
+ * If true
, returns default cluster settings from the local node.
*
* API name: {@code include_defaults}
+ *
*/
+ @Nonnull
public final Builder includeDefaults(@Nullable Boolean value) {
this.includeDefaults = value;
return this;
}
/**
- * Explicit operation timeout for connection to master node
+ * 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 master_timeout}
+ *
*/
@Deprecated
+ @Nonnull
public final Builder masterTimeout(@Nullable Time value) {
this.masterTimeout = value;
return this;
}
/**
- * Explicit operation timeout for connection to master node
+ * 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 master_timeout}
+ *
*/
@Deprecated
+ @Nonnull
public final Builder masterTimeout(Function> fn) {
- return this.masterTimeout(fn.apply(new Time.Builder()).build());
+ return masterTimeout(fn.apply(new Time.Builder()).build());
}
/**
- * Explicit operation timeout for connection to cluster-manager node
- *
- * API name: {@code cluster_manager_timeout}
- */
- public final Builder clusterManagerTimeout(@Nullable Time value) {
- this.clusterManagerTimeout = value;
- return this;
- }
-
- /**
- * Explicit operation timeout for connection to cluster-manager node
- *
- * API name: {@code cluster_manager_timeout}
- */
- public final Builder clusterManagerTimeout(Function> fn) {
- return this.clusterManagerTimeout(fn.apply(new Time.Builder()).build());
- }
-
- /**
- * 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 GetClusterSettingsRequest}.
*
- * @throws NullPointerException
- * if some of the required fields are null.
+ * @throws NullPointerException if some of the required fields are null.
*/
+ @Override
+ @Nonnull
public GetClusterSettingsRequest build() {
_checkSingleUse();
@@ -256,25 +319,13 @@ public GetClusterSettingsRequest build() {
* Endpoint "{@code cluster.get_settings}".
*/
public static final Endpoint _ENDPOINT = new SimpleEndpoint<>(
-
// Request method
- request -> {
- return "GET";
-
- },
-
+ request -> "GET",
// Request path
- request -> {
- return "/_cluster/settings";
-
- },
-
+ request -> "/_cluster/settings",
// 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());
}
@@ -284,14 +335,39 @@ public GetClusterSettingsRequest build() {
if (request.includeDefaults != null) {
params.put("include_defaults", String.valueOf(request.includeDefaults));
}
+ 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,
GetClusterSettingsResponse._DESERIALIZER
);
+
+ @Override
+ public int hashCode() {
+ int result = 17;
+ result = 31 * result + Objects.hashCode(this.clusterManagerTimeout);
+ result = 31 * result + Objects.hashCode(this.flatSettings);
+ result = 31 * result + Objects.hashCode(this.includeDefaults);
+ result = 31 * result + Objects.hashCode(this.masterTimeout);
+ 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;
+ GetClusterSettingsRequest other = (GetClusterSettingsRequest) o;
+ return Objects.equals(this.clusterManagerTimeout, other.clusterManagerTimeout)
+ && Objects.equals(this.flatSettings, other.flatSettings)
+ && Objects.equals(this.includeDefaults, other.includeDefaults)
+ && Objects.equals(this.masterTimeout, other.masterTimeout)
+ && Objects.equals(this.timeout, other.timeout);
+ }
}
diff --git a/java-client/src/main/java/org/opensearch/client/opensearch/cluster/GetClusterSettingsResponse.java b/java-client/src/generated/java/org/opensearch/client/opensearch/cluster/GetClusterSettingsResponse.java
similarity index 66%
rename from java-client/src/main/java/org/opensearch/client/opensearch/cluster/GetClusterSettingsResponse.java
rename to java-client/src/generated/java/org/opensearch/client/opensearch/cluster/GetClusterSettingsResponse.java
index 98824bdf2c..112652826f 100644
--- a/java-client/src/main/java/org/opensearch/client/opensearch/cluster/GetClusterSettingsResponse.java
+++ b/java-client/src/generated/java/org/opensearch/client/opensearch/cluster/GetClusterSettingsResponse.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,36 +51,55 @@
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.get_settings.Response
@JsonpDeserializable
-public class GetClusterSettingsResponse implements PlainJsonSerializable {
+@Generated("org.opensearch.client.codegen.CodeGenerator")
+public class GetClusterSettingsResponse
+ implements
+ PlainJsonSerializable,
+ ToCopyableBuilder {
+
+ @Nonnull
+ private final Map defaults;
+
+ @Nonnull
private final Map persistent;
+ @Nonnull
private final Map transient_;
- private final Map defaults;
-
// ---------------------------------------------------------------------------------------------
private GetClusterSettingsResponse(Builder builder) {
-
+ this.defaults = ApiTypeHelper.unmodifiable(builder.defaults);
this.persistent = ApiTypeHelper.unmodifiableRequired(builder.persistent, this, "persistent");
this.transient_ = ApiTypeHelper.unmodifiableRequired(builder.transient_, this, "transient_");
- this.defaults = ApiTypeHelper.unmodifiable(builder.defaults);
-
}
- public static GetClusterSettingsResponse of(Function> fn) {
+ public static GetClusterSettingsResponse of(
+ Function> fn
+ ) {
return fn.apply(new Builder()).build();
}
+ /**
+ * API name: {@code defaults}
+ */
+ @Nonnull
+ public final Map defaults() {
+ return this.defaults;
+ }
+
/**
* Required - API name: {@code persistent}
*/
+ @Nonnull
public final Map persistent() {
return this.persistent;
}
@@ -81,20 +107,15 @@ public final Map persistent() {
/**
* Required - API name: {@code transient}
*/
+ @Nonnull
public final Map transient_() {
return this.transient_;
}
- /**
- * API name: {@code defaults}
- */
- public final Map defaults() {
- return this.defaults;
- }
-
/**
* Serialize this object to JSON.
*/
+ @Override
public void serialize(JsonGenerator generator, JsonpMapper mapper) {
generator.writeStartObject();
serializeInternal(generator, mapper);
@@ -102,62 +123,109 @@ public void serialize(JsonGenerator generator, JsonpMapper mapper) {
}
protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) {
-
- if (ApiTypeHelper.isDefined(this.persistent)) {
- generator.writeKey("persistent");
- generator.writeStartObject();
- for (Map.Entry item0 : this.persistent.entrySet()) {
- generator.writeKey(item0.getKey());
- item0.getValue().serialize(generator, mapper);
-
- }
- generator.writeEnd();
-
- }
- if (ApiTypeHelper.isDefined(this.transient_)) {
- generator.writeKey("transient");
- generator.writeStartObject();
- for (Map.Entry item0 : this.transient_.entrySet()) {
- generator.writeKey(item0.getKey());
- item0.getValue().serialize(generator, mapper);
-
- }
- generator.writeEnd();
-
- }
if (ApiTypeHelper.isDefined(this.defaults)) {
generator.writeKey("defaults");
generator.writeStartObject();
for (Map.Entry item0 : this.defaults.entrySet()) {
generator.writeKey(item0.getKey());
item0.getValue().serialize(generator, mapper);
-
}
generator.writeEnd();
+ }
+ generator.writeKey("persistent");
+ generator.writeStartObject();
+ for (Map.Entry item0 : this.persistent.entrySet()) {
+ generator.writeKey(item0.getKey());
+ item0.getValue().serialize(generator, mapper);
}
+ generator.writeEnd();
+ generator.writeKey("transient");
+ generator.writeStartObject();
+ for (Map.Entry item0 : this.transient_.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 GetClusterSettingsResponse}.
*/
-
- public static class Builder extends ObjectBuilderBase implements ObjectBuilder {
+ public static class Builder extends ObjectBuilderBase implements CopyableBuilder {
+ @Nullable
+ private Map defaults;
private Map persistent;
-
private Map transient_;
- @Nullable
- private Map defaults;
+ public Builder() {}
+
+ private Builder(GetClusterSettingsResponse o) {
+ this.defaults = _mapCopy(o.defaults);
+ this.persistent = _mapCopy(o.persistent);
+ this.transient_ = _mapCopy(o.transient_);
+ }
+
+ private Builder(Builder o) {
+ this.defaults = _mapCopy(o.defaults);
+ this.persistent = _mapCopy(o.persistent);
+ this.transient_ = _mapCopy(o.transient_);
+ }
+
+ @Override
+ @Nonnull
+ public Builder copy() {
+ return new Builder(this);
+ }
+
+ /**
+ * API name: {@code defaults}
+ *
+ *
+ * Adds all elements of map
to defaults
.
+ *
+ */
+ @Nonnull
+ public final Builder defaults(Map map) {
+ this.defaults = _mapPutAll(this.defaults, map);
+ return this;
+ }
+
+ /**
+ * API name: {@code defaults}
+ *
+ *
+ * Adds an entry to defaults
.
+ *
+ */
+ @Nonnull
+ public final Builder defaults(String key, JsonData value) {
+ this.defaults = _mapPut(this.defaults, key, value);
+ return this;
+ }
/**
* Required - API name: {@code persistent}
+ *
*
- * Adds all entries of map
to persistent
.
+ * Adds all elements of map
to persistent
.
+ *
*/
+ @Nonnull
public final Builder persistent(Map map) {
this.persistent = _mapPutAll(this.persistent, map);
return this;
@@ -165,9 +233,12 @@ public final Builder persistent(Map map) {
/**
* Required - API name: {@code persistent}
+ *
*
* Adds an entry to persistent
.
+ *
*/
+ @Nonnull
public final Builder persistent(String key, JsonData value) {
this.persistent = _mapPut(this.persistent, key, value);
return this;
@@ -175,9 +246,12 @@ public final Builder persistent(String key, JsonData value) {
/**
* Required - API name: {@code transient}
+ *
*
- * Adds all entries of map
to transient_
.
+ * Adds all elements of map
to transient_
.
+ *
*/
+ @Nonnull
public final Builder transient_(Map map) {
this.transient_ = _mapPutAll(this.transient_, map);
return this;
@@ -185,40 +259,24 @@ public final Builder transient_(Map map) {
/**
* Required - API name: {@code transient}
+ *
*
* Adds an entry to transient_
.
+ *
*/
+ @Nonnull
public final Builder transient_(String key, JsonData value) {
this.transient_ = _mapPut(this.transient_, key, value);
return this;
}
- /**
- * API name: {@code defaults}
- *
- * Adds all entries of map
to defaults
.
- */
- public final Builder defaults(Map map) {
- this.defaults = _mapPutAll(this.defaults, map);
- return this;
- }
-
- /**
- * API name: {@code defaults}
- *
- * Adds an entry to defaults
.
- */
- public final Builder defaults(String key, JsonData value) {
- this.defaults = _mapPut(this.defaults, key, value);
- return this;
- }
-
/**
* Builds a {@link GetClusterSettingsResponse}.
*
- * @throws NullPointerException
- * if some of the required fields are null.
+ * @throws NullPointerException if some of the required fields are null.
*/
+ @Override
+ @Nonnull
public GetClusterSettingsResponse build() {
_checkSingleUse();
@@ -237,11 +295,27 @@ public GetClusterSettingsResponse build() {
);
protected static void setupGetClusterSettingsResponseDeserializer(ObjectDeserializer op) {
-
+ op.add(Builder::defaults, JsonpDeserializer.stringMapDeserializer(JsonData._DESERIALIZER), "defaults");
op.add(Builder::persistent, JsonpDeserializer.stringMapDeserializer(JsonData._DESERIALIZER), "persistent");
op.add(Builder::transient_, JsonpDeserializer.stringMapDeserializer(JsonData._DESERIALIZER), "transient");
- op.add(Builder::defaults, JsonpDeserializer.stringMapDeserializer(JsonData._DESERIALIZER), "defaults");
+ }
+ @Override
+ public int hashCode() {
+ int result = 17;
+ result = 31 * result + Objects.hashCode(this.defaults);
+ result = 31 * result + this.persistent.hashCode();
+ result = 31 * result + this.transient_.hashCode();
+ return result;
}
+ @Override
+ public boolean equals(Object o) {
+ if (this == o) return true;
+ if (o == null || this.getClass() != o.getClass()) return false;
+ GetClusterSettingsResponse other = (GetClusterSettingsResponse) o;
+ return Objects.equals(this.defaults, other.defaults)
+ && this.persistent.equals(other.persistent)
+ && this.transient_.equals(other.transient_);
+ }
}
diff --git a/java-client/src/main/java/org/opensearch/client/opensearch/cluster/GetComponentTemplateRequest.java b/java-client/src/generated/java/org/opensearch/client/opensearch/cluster/GetComponentTemplateRequest.java
similarity index 59%
rename from java-client/src/main/java/org/opensearch/client/opensearch/cluster/GetComponentTemplateRequest.java
rename to java-client/src/generated/java/org/opensearch/client/opensearch/cluster/GetComponentTemplateRequest.java
index ba1794d05a..2d60437705 100644
--- a/java-client/src/main/java/org/opensearch/client/opensearch/cluster/GetComponentTemplateRequest.java
+++ b/java-client/src/generated/java/org/opensearch/client/opensearch/cluster/GetComponentTemplateRequest.java
@@ -30,28 +30,42 @@
* 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;
import org.opensearch.client.opensearch._types.Time;
import org.opensearch.client.transport.Endpoint;
import org.opensearch.client.transport.endpoints.SimpleEndpoint;
+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.get_component_template.Request
/**
- * Returns one or more component templates
- *
+ * Returns one or more component templates.
*/
+@Generated("org.opensearch.client.codegen.CodeGenerator")
+public class GetComponentTemplateRequest extends RequestBase
+ implements
+ ToCopyableBuilder {
+
+ @Nullable
+ private final Time clusterManagerTimeout;
-public class GetComponentTemplateRequest extends RequestBase {
@Nullable
private final Boolean flatSettings;
@@ -62,30 +76,41 @@ public class GetComponentTemplateRequest extends RequestBase {
@Nullable
private final Time masterTimeout;
- @Nullable
- private final Time clusterManagerTimeout;
-
@Nullable
private final String name;
// ---------------------------------------------------------------------------------------------
private GetComponentTemplateRequest(Builder builder) {
-
+ this.clusterManagerTimeout = builder.clusterManagerTimeout;
this.flatSettings = builder.flatSettings;
this.local = builder.local;
this.masterTimeout = builder.masterTimeout;
- this.clusterManagerTimeout = builder.clusterManagerTimeout;
this.name = builder.name;
-
}
- public static GetComponentTemplateRequest of(Function> fn) {
+ public static GetComponentTemplateRequest of(
+ Function> fn
+ ) {
return fn.apply(new Builder()).build();
}
/**
+ * Operation timeout for connection to cluster-manager node.
+ *
+ * API name: {@code cluster_manager_timeout}
+ *
+ */
+ @Nullable
+ public final Time clusterManagerTimeout() {
+ return this.clusterManagerTimeout;
+ }
+
+ /**
+ * If true
, returns settings in flat format.
+ *
* API name: {@code flat_settings}
+ *
*/
@Nullable
public final Boolean flatSettings() {
@@ -93,10 +118,11 @@ public final Boolean flatSettings() {
}
/**
- * Return local information, do not retrieve the state from master node
- * (default: false)
+ * If true
, the request retrieves information from the local node only. If false
, information is retrieved
+ * from the cluster-manager node.
*
* API name: {@code local}
+ *
*/
@Nullable
public final Boolean local() {
@@ -104,9 +130,11 @@ public final Boolean local() {
}
/**
- * Explicit operation timeout for connection to master node
+ * 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 master_timeout}
+ *
*/
@Deprecated
@Nullable
@@ -115,19 +143,10 @@ public final Time masterTimeout() {
}
/**
- * Explicit operation timeout for connection to cluster-manager node
- *
- * API name: {@code cluster_manager_timeout}
- */
- @Nullable
- public final Time clusterManagerTimeout() {
- return this.clusterManagerTimeout;
- }
-
- /**
- * The comma separated names of the component templates
+ * Name of the component template to retrieve. Wildcard (*
) expressions are supported.
*
* API name: {@code name}
+ *
*/
@Nullable
public final String name() {
@@ -136,91 +155,138 @@ public final String name() {
// ---------------------------------------------------------------------------------------------
+ @Override
+ @Nonnull
+ public Builder toBuilder() {
+ return new Builder(this);
+ }
+
+ @Nonnull
+ public static Builder builder() {
+ return new Builder();
+ }
+
/**
* Builder for {@link GetComponentTemplateRequest}.
*/
-
- public static class Builder extends ObjectBuilderBase implements ObjectBuilder {
+ public static class Builder extends ObjectBuilderBase implements CopyableBuilder {
+ @Nullable
+ private Time clusterManagerTimeout;
@Nullable
private Boolean flatSettings;
-
@Nullable
private Boolean local;
-
- @Deprecated
@Nullable
private Time masterTimeout;
-
- @Nullable
- private Time clusterManagerTimeout;
-
@Nullable
private String name;
+ public Builder() {}
+
+ private Builder(GetComponentTemplateRequest o) {
+ this.clusterManagerTimeout = o.clusterManagerTimeout;
+ this.flatSettings = o.flatSettings;
+ this.local = o.local;
+ this.masterTimeout = o.masterTimeout;
+ this.name = o.name;
+ }
+
+ private Builder(Builder o) {
+ this.clusterManagerTimeout = o.clusterManagerTimeout;
+ this.flatSettings = o.flatSettings;
+ this.local = o.local;
+ this.masterTimeout = o.masterTimeout;
+ this.name = o.name;
+ }
+
+ @Override
+ @Nonnull
+ public Builder copy() {
+ return new Builder(this);
+ }
+
+ /**
+ * Operation timeout for connection to cluster-manager node.
+ *
+ * API name: {@code cluster_manager_timeout}
+ *
+ */
+ @Nonnull
+ public final Builder clusterManagerTimeout(@Nullable Time value) {
+ this.clusterManagerTimeout = value;
+ return this;
+ }
+
/**
+ * Operation timeout for connection to cluster-manager node.
+ *
+ * API name: {@code cluster_manager_timeout}
+ *
+ */
+ @Nonnull
+ public final Builder clusterManagerTimeout(Function> fn) {
+ return clusterManagerTimeout(fn.apply(new Time.Builder()).build());
+ }
+
+ /**
+ * If true
, returns settings in flat format.
+ *
* API name: {@code flat_settings}
+ *
*/
+ @Nonnull
public final Builder flatSettings(@Nullable Boolean value) {
this.flatSettings = value;
return this;
}
/**
- * Return local information, do not retrieve the state from master node
- * (default: false)
+ * If true
, the request retrieves information from the local node only. If false
, information is retrieved
+ * from the cluster-manager node.
*
* API name: {@code local}
+ *
*/
+ @Nonnull
public final Builder local(@Nullable Boolean value) {
this.local = value;
return this;
}
/**
- * Explicit operation timeout for connection to master node
+ * 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 master_timeout}
+ *
*/
@Deprecated
+ @Nonnull
public final Builder masterTimeout(@Nullable Time value) {
this.masterTimeout = value;
return this;
}
/**
- * Explicit operation timeout for connection to master node
+ * 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 master_timeout}
+ *
*/
@Deprecated
+ @Nonnull
public final Builder masterTimeout(Function> fn) {
- return this.masterTimeout(fn.apply(new Time.Builder()).build());
+ return masterTimeout(fn.apply(new Time.Builder()).build());
}
/**
- * Explicit operation timeout for connection to cluster-manager node
- *
- * API name: {@code cluster_manager_timeout}
- */
- public final Builder clusterManagerTimeout(@Nullable Time value) {
- this.clusterManagerTimeout = value;
- return this;
- }
-
- /**
- * Explicit operation timeout for connection to cluster-manager node
- *
- * API name: {@code cluster_manager_timeout}
- */
- public final Builder clusterManagerTimeout(Function> fn) {
- return this.clusterManagerTimeout(fn.apply(new Time.Builder()).build());
- }
-
- /**
- * The comma separated names of the component templates
+ * Name of the component template to retrieve. Wildcard (*
) expressions are supported.
*
* API name: {@code name}
+ *
*/
+ @Nonnull
public final Builder name(@Nullable String value) {
this.name = value;
return this;
@@ -229,9 +295,10 @@ public final Builder name(@Nullable String value) {
/**
* Builds a {@link GetComponentTemplateRequest}.
*
- * @throws NullPointerException
- * if some of the required fields are null.
+ * @throws NullPointerException if some of the required fields are null.
*/
+ @Override
+ @Nonnull
public GetComponentTemplateRequest build() {
_checkSingleUse();
@@ -245,13 +312,8 @@ public GetComponentTemplateRequest build() {
* Endpoint "{@code cluster.get_component_template}".
*/
public static final Endpoint _ENDPOINT = new SimpleEndpoint<>(
-
// Request method
- request -> {
- return "GET";
-
- },
-
+ request -> "GET",
// Request path
request -> {
final int _name = 1 << 0;
@@ -261,27 +323,20 @@ public GetComponentTemplateRequest build() {
if (request.name() != null) propsSet |= _name;
if (propsSet == 0) {
- StringBuilder buf = new StringBuilder();
- buf.append("/_component_template");
- return buf.toString();
+ return "/_component_template";
}
if (propsSet == (_name)) {
StringBuilder buf = new StringBuilder();
- buf.append("/_component_template");
- buf.append("/");
+ buf.append("/_component_template/");
SimpleEndpoint.pathEncode(request.name, buf);
return buf.toString();
}
- throw SimpleEndpoint.noPathTemplateFound("path");
+ throw SimpleEndpoint.noPathTemplateFound("path");
},
-
// 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());
}
@@ -291,11 +346,36 @@ public GetComponentTemplateRequest build() {
if (request.local != null) {
params.put("local", String.valueOf(request.local));
}
+ if (request.masterTimeout != null) {
+ params.put("master_timeout", request.masterTimeout._toJsonString());
+ }
return params;
-
},
SimpleEndpoint.emptyMap(),
false,
GetComponentTemplateResponse._DESERIALIZER
);
+
+ @Override
+ public int hashCode() {
+ int result = 17;
+ result = 31 * result + Objects.hashCode(this.clusterManagerTimeout);
+ result = 31 * result + Objects.hashCode(this.flatSettings);
+ result = 31 * result + Objects.hashCode(this.local);
+ result = 31 * result + Objects.hashCode(this.masterTimeout);
+ result = 31 * result + Objects.hashCode(this.name);
+ return result;
+ }
+
+ @Override
+ public boolean equals(Object o) {
+ if (this == o) return true;
+ if (o == null || this.getClass() != o.getClass()) return false;
+ GetComponentTemplateRequest other = (GetComponentTemplateRequest) o;
+ return Objects.equals(this.clusterManagerTimeout, other.clusterManagerTimeout)
+ && Objects.equals(this.flatSettings, other.flatSettings)
+ && Objects.equals(this.local, other.local)
+ && Objects.equals(this.masterTimeout, other.masterTimeout)
+ && Objects.equals(this.name, other.name);
+ }
}
diff --git a/java-client/src/main/java/org/opensearch/client/opensearch/cluster/GetComponentTemplateResponse.java b/java-client/src/generated/java/org/opensearch/client/opensearch/cluster/GetComponentTemplateResponse.java
similarity index 68%
rename from java-client/src/main/java/org/opensearch/client/opensearch/cluster/GetComponentTemplateResponse.java
rename to java-client/src/generated/java/org/opensearch/client/opensearch/cluster/GetComponentTemplateResponse.java
index 8cd177d19c..3fe60c9430 100644
--- a/java-client/src/main/java/org/opensearch/client/opensearch/cluster/GetComponentTemplateResponse.java
+++ b/java-client/src/generated/java/org/opensearch/client/opensearch/cluster/GetComponentTemplateResponse.java
@@ -30,11 +30,17 @@
* 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.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,30 +48,39 @@
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.get_component_template.Response
@JsonpDeserializable
-public class GetComponentTemplateResponse implements PlainJsonSerializable {
+@Generated("org.opensearch.client.codegen.CodeGenerator")
+public class GetComponentTemplateResponse
+ implements
+ PlainJsonSerializable,
+ ToCopyableBuilder {
+
+ @Nonnull
private final List componentTemplates;
// ---------------------------------------------------------------------------------------------
private GetComponentTemplateResponse(Builder builder) {
-
this.componentTemplates = ApiTypeHelper.unmodifiableRequired(builder.componentTemplates, this, "componentTemplates");
-
}
- public static GetComponentTemplateResponse of(Function> fn) {
+ public static GetComponentTemplateResponse of(
+ Function> fn
+ ) {
return fn.apply(new Builder()).build();
}
/**
* Required - API name: {@code component_templates}
*/
+ @Nonnull
public final List componentTemplates() {
return this.componentTemplates;
}
@@ -73,6 +88,7 @@ public final List componentTemplates() {
/**
* Serialize this object to JSON.
*/
+ @Override
public void serialize(JsonGenerator generator, JsonpMapper mapper) {
generator.writeStartObject();
serializeInternal(generator, mapper);
@@ -80,34 +96,57 @@ public void serialize(JsonGenerator generator, JsonpMapper mapper) {
}
protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) {
-
- if (ApiTypeHelper.isDefined(this.componentTemplates)) {
- generator.writeKey("component_templates");
- generator.writeStartArray();
- for (ComponentTemplate item0 : this.componentTemplates) {
- item0.serialize(generator, mapper);
-
- }
- generator.writeEnd();
-
+ generator.writeKey("component_templates");
+ generator.writeStartArray();
+ for (ComponentTemplate item0 : this.componentTemplates) {
+ item0.serialize(generator, mapper);
}
-
+ generator.writeEnd();
}
// ---------------------------------------------------------------------------------------------
+ @Override
+ @Nonnull
+ public Builder toBuilder() {
+ return new Builder(this);
+ }
+
+ @Nonnull
+ public static Builder builder() {
+ return new Builder();
+ }
+
/**
* Builder for {@link GetComponentTemplateResponse}.
*/
-
- public static class Builder extends ObjectBuilderBase implements ObjectBuilder {
+ public static class Builder extends ObjectBuilderBase implements CopyableBuilder {
private List componentTemplates;
+ public Builder() {}
+
+ private Builder(GetComponentTemplateResponse o) {
+ this.componentTemplates = _listCopy(o.componentTemplates);
+ }
+
+ private Builder(Builder o) {
+ this.componentTemplates = _listCopy(o.componentTemplates);
+ }
+
+ @Override
+ @Nonnull
+ public Builder copy() {
+ return new Builder(this);
+ }
+
/**
* Required - API name: {@code component_templates}
+ *
*
* Adds all elements of list
to componentTemplates
.
+ *
*/
+ @Nonnull
public final Builder componentTemplates(List list) {
this.componentTemplates = _listAddAll(this.componentTemplates, list);
return this;
@@ -115,9 +154,12 @@ public final Builder componentTemplates(List list) {
/**
* Required - API name: {@code component_templates}
+ *
*
* Adds one or more values to componentTemplates
.
+ *
*/
+ @Nonnull
public final Builder componentTemplates(ComponentTemplate value, ComponentTemplate... values) {
this.componentTemplates = _listAdd(this.componentTemplates, value, values);
return this;
@@ -125,9 +167,12 @@ public final Builder componentTemplates(ComponentTemplate value, ComponentTempla
/**
* Required - API name: {@code component_templates}
+ *
*
* Adds a value to componentTemplates
using a builder lambda.
+ *
*/
+ @Nonnull
public final Builder componentTemplates(Function> fn) {
return componentTemplates(fn.apply(new ComponentTemplate.Builder()).build());
}
@@ -135,9 +180,10 @@ public final Builder componentTemplates(Function op) {
-
op.add(Builder::componentTemplates, JsonpDeserializer.arrayDeserializer(ComponentTemplate._DESERIALIZER), "component_templates");
+ }
+ @Override
+ public int hashCode() {
+ int result = 17;
+ result = 31 * result + this.componentTemplates.hashCode();
+ return result;
}
+ @Override
+ public boolean equals(Object o) {
+ if (this == o) return true;
+ if (o == null || this.getClass() != o.getClass()) return false;
+ GetComponentTemplateResponse other = (GetComponentTemplateResponse) o;
+ return this.componentTemplates.equals(other.componentTemplates);
+ }
}
diff --git a/java-client/src/main/java/org/opensearch/client/opensearch/cluster/HealthRequest.java b/java-client/src/generated/java/org/opensearch/client/opensearch/cluster/HealthRequest.java
similarity index 57%
rename from java-client/src/main/java/org/opensearch/client/opensearch/cluster/HealthRequest.java
rename to java-client/src/generated/java/org/opensearch/client/opensearch/cluster/HealthRequest.java
index 76bb75032c..a01c427fdd 100644
--- a/java-client/src/main/java/org/opensearch/client/opensearch/cluster/HealthRequest.java
+++ b/java-client/src/generated/java/org/opensearch/client/opensearch/cluster/HealthRequest.java
@@ -30,42 +30,59 @@
* 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.ExpandWildcard;
import org.opensearch.client.opensearch._types.HealthStatus;
-import org.opensearch.client.opensearch._types.Level;
import org.opensearch.client.opensearch._types.RequestBase;
import org.opensearch.client.opensearch._types.Time;
import org.opensearch.client.opensearch._types.WaitForActiveShards;
import org.opensearch.client.opensearch._types.WaitForEvents;
+import org.opensearch.client.opensearch.cluster.health.ClusterHealthLevel;
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.health.Request
/**
* Returns basic information about the health of the cluster.
- *
*/
+@Generated("org.opensearch.client.codegen.CodeGenerator")
+public class HealthRequest extends RequestBase implements ToCopyableBuilder {
+
+ @Nullable
+ private final String awarenessAttribute;
+
+ @Nullable
+ private final Time clusterManagerTimeout;
-public class HealthRequest extends RequestBase {
+ @Nonnull
private final List expandWildcards;
+ @Nonnull
private final List index;
@Nullable
- private final Level level;
+ private final ClusterHealthLevel level;
@Nullable
private final Boolean local;
@@ -74,9 +91,6 @@ public class HealthRequest extends RequestBase {
@Nullable
private final Time masterTimeout;
- @Nullable
- private final Time clusterManagerTimeout;
-
@Nullable
private final Time timeout;
@@ -101,13 +115,13 @@ public class HealthRequest extends RequestBase {
// ---------------------------------------------------------------------------------------------
private HealthRequest(Builder builder) {
-
+ this.awarenessAttribute = builder.awarenessAttribute;
+ this.clusterManagerTimeout = builder.clusterManagerTimeout;
this.expandWildcards = ApiTypeHelper.unmodifiable(builder.expandWildcards);
this.index = ApiTypeHelper.unmodifiable(builder.index);
this.level = builder.level;
this.local = builder.local;
this.masterTimeout = builder.masterTimeout;
- this.clusterManagerTimeout = builder.clusterManagerTimeout;
this.timeout = builder.timeout;
this.waitForActiveShards = builder.waitForActiveShards;
this.waitForEvents = builder.waitForEvents;
@@ -115,50 +129,74 @@ private HealthRequest(Builder builder) {
this.waitForNoRelocatingShards = builder.waitForNoRelocatingShards;
this.waitForNodes = builder.waitForNodes;
this.waitForStatus = builder.waitForStatus;
-
}
- public static HealthRequest of(Function> fn) {
+ public static HealthRequest of(Function> fn) {
return fn.apply(new Builder()).build();
}
/**
- * Whether to expand wildcard expression to concrete indices that are open,
- * closed or both.
+ * The awareness attribute for which the health is required.
+ *
+ * API name: {@code awareness_attribute}
+ *
+ */
+ @Nullable
+ public final String awarenessAttribute() {
+ return this.awarenessAttribute;
+ }
+
+ /**
+ * Operation timeout for connection to cluster-manager node.
+ *
+ * API name: {@code cluster_manager_timeout}
+ *
+ */
+ @Nullable
+ public final Time clusterManagerTimeout() {
+ return this.clusterManagerTimeout;
+ }
+
+ /**
+ * Whether to expand wildcard expression to concrete indexes that are open, closed or both.
*
* API name: {@code expand_wildcards}
+ *
*/
+ @Nonnull
public final List expandWildcards() {
return this.expandWildcards;
}
/**
- * Comma-separated list of data streams, indices, and index aliases used to
- * limit the request. Wildcard expressions (*) are supported. To target all data
- * streams and indices in a cluster, omit this parameter or use _all or *.
+ * Comma-separated list of data streams, indexes, and index aliases used to limit the request. Wildcard expressions (*) are supported.
+ * To target all data streams and indexes in a cluster, omit this parameter or use _all
or *
.
*
* API name: {@code index}
+ *
*/
+ @Nonnull
public final List index() {
return this.index;
}
/**
- * Can be one of cluster, indices or shards. Controls the details level of the
- * health information returned.
+ * Can be one of cluster, indexes or shards. Controls the details level of the health information returned.
*
* API name: {@code level}
+ *
*/
@Nullable
- public final Level level() {
+ public final ClusterHealthLevel level() {
return this.level;
}
/**
- * If true, the request retrieves information from the local node only. Defaults
- * to false, which means information is retrieved from the cluster-manager node.
+ * If true
, the request retrieves information from the local node only. Defaults to false, which means information is
+ * retrieved from the cluster-manager node.
*
* API name: {@code local}
+ *
*/
@Nullable
public final Boolean local() {
@@ -166,10 +204,11 @@ public final Boolean local() {
}
/**
- * Period to wait for a connection to the master node. If no response is
- * received before the timeout expires, the request fails and returns an error.
+ * 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 master_timeout}
+ *
*/
@Deprecated
@Nullable
@@ -178,21 +217,10 @@ public final Time masterTimeout() {
}
/**
- * 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}
- */
- @Nullable
- public final Time clusterManagerTimeout() {
- return this.clusterManagerTimeout;
- }
-
- /**
- * Period to wait for a response. If no response is received before the timeout
- * expires, the request fails and returns an error.
+ * 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() {
@@ -200,10 +228,10 @@ public final Time timeout() {
}
/**
- * A number controlling to how many active shards to wait for, all to wait for
- * all shards in the cluster to be active, or 0 to not wait.
+ * A number controlling to how many active shards to wait for, all to wait for all shards in the cluster to be active, or 0 to not wait.
*
* API name: {@code wait_for_active_shards}
+ *
*/
@Nullable
public final WaitForActiveShards waitForActiveShards() {
@@ -211,10 +239,11 @@ public final WaitForActiveShards waitForActiveShards() {
}
/**
- * Can be one of immediate, urgent, high, normal, low, languid. Wait until all
- * currently queued events with the given priority are processed.
+ * Can be one of immediate, urgent, high, normal, low, languid. Wait until all currently queued events with the given priority are
+ * processed.
*
* API name: {@code wait_for_events}
+ *
*/
@Nullable
public final WaitForEvents waitForEvents() {
@@ -222,11 +251,11 @@ public final WaitForEvents waitForEvents() {
}
/**
- * A boolean value which controls whether to wait (until the timeout provided)
- * for the cluster to have no shard initializations. Defaults to false, which
- * means it will not wait for initializing shards.
+ * A Boolean value which controls whether to wait (until the timeout provided) for the cluster to have no shard initializations.
+ * Defaults to false, which means it will not wait for initializing shards.
*
* API name: {@code wait_for_no_initializing_shards}
+ *
*/
@Nullable
public final Boolean waitForNoInitializingShards() {
@@ -234,11 +263,11 @@ public final Boolean waitForNoInitializingShards() {
}
/**
- * A boolean value which controls whether to wait (until the timeout provided)
- * for the cluster to have no shard relocations. Defaults to false, which means
- * it will not wait for relocating shards.
+ * A Boolean value which controls whether to wait (until the timeout provided) for the cluster to have no shard relocations. Defaults to
+ * false, which means it will not wait for relocating shards.
*
* API name: {@code wait_for_no_relocating_shards}
+ *
*/
@Nullable
public final Boolean waitForNoRelocatingShards() {
@@ -246,11 +275,11 @@ public final Boolean waitForNoRelocatingShards() {
}
/**
- * The request waits until the specified number N of nodes is available. It also
- * accepts >=N, <=N, >N and <N. Alternatively, it is possible to use
- * ge(N), le(N), gt(N) and lt(N) notation.
+ * The request waits until the specified number N of nodes is available. It also accepts >=N, <=N, >N and <N. Alternatively,
+ * it is possible to use ge(N), le(N), gt(N) and lt(N) notation.
*
* API name: {@code wait_for_nodes}
+ *
*/
@Nullable
public final String waitForNodes() {
@@ -258,11 +287,11 @@ public final String waitForNodes() {
}
/**
- * One of green, yellow or red. Will wait (until the timeout provided) until the
- * status of the cluster changes to the one provided or better, i.e. green >
- * yellow > red. By default, will not wait for any status.
+ * One of green, yellow or red. Will wait (until the timeout provided) until the status of the cluster changes to the one provided or
+ * better, i.e. green > yellow > red. By default, will not wait for any status.
*
* API name: {@code wait_for_status}
+ *
*/
@Nullable
public final HealthStatus waitForStatus() {
@@ -271,267 +300,353 @@ public final HealthStatus waitForStatus() {
// ---------------------------------------------------------------------------------------------
+ @Override
+ @Nonnull
+ public Builder toBuilder() {
+ return new Builder(this);
+ }
+
+ @Nonnull
+ public static Builder builder() {
+ return new Builder();
+ }
+
/**
* Builder for {@link HealthRequest}.
*/
-
- public static class Builder extends ObjectBuilderBase implements ObjectBuilder {
+ public static class Builder extends ObjectBuilderBase implements CopyableBuilder {
+ @Nullable
+ private String awarenessAttribute;
+ @Nullable
+ private Time clusterManagerTimeout;
@Nullable
private List expandWildcards;
-
@Nullable
private List index;
-
@Nullable
- private Level level;
-
+ private ClusterHealthLevel level;
@Nullable
private Boolean local;
-
- @Deprecated
@Nullable
private Time masterTimeout;
-
- @Nullable
- private Time clusterManagerTimeout;
-
@Nullable
private Time timeout;
-
@Nullable
private WaitForActiveShards waitForActiveShards;
-
@Nullable
private WaitForEvents waitForEvents;
-
@Nullable
private Boolean waitForNoInitializingShards;
-
@Nullable
private Boolean waitForNoRelocatingShards;
-
@Nullable
private String waitForNodes;
-
@Nullable
private HealthStatus waitForStatus;
+ public Builder() {}
+
+ private Builder(HealthRequest o) {
+ this.awarenessAttribute = o.awarenessAttribute;
+ this.clusterManagerTimeout = o.clusterManagerTimeout;
+ this.expandWildcards = _listCopy(o.expandWildcards);
+ this.index = _listCopy(o.index);
+ this.level = o.level;
+ this.local = o.local;
+ this.masterTimeout = o.masterTimeout;
+ this.timeout = o.timeout;
+ this.waitForActiveShards = o.waitForActiveShards;
+ this.waitForEvents = o.waitForEvents;
+ this.waitForNoInitializingShards = o.waitForNoInitializingShards;
+ this.waitForNoRelocatingShards = o.waitForNoRelocatingShards;
+ this.waitForNodes = o.waitForNodes;
+ this.waitForStatus = o.waitForStatus;
+ }
+
+ private Builder(Builder o) {
+ this.awarenessAttribute = o.awarenessAttribute;
+ this.clusterManagerTimeout = o.clusterManagerTimeout;
+ this.expandWildcards = _listCopy(o.expandWildcards);
+ this.index = _listCopy(o.index);
+ this.level = o.level;
+ this.local = o.local;
+ this.masterTimeout = o.masterTimeout;
+ this.timeout = o.timeout;
+ this.waitForActiveShards = o.waitForActiveShards;
+ this.waitForEvents = o.waitForEvents;
+ this.waitForNoInitializingShards = o.waitForNoInitializingShards;
+ this.waitForNoRelocatingShards = o.waitForNoRelocatingShards;
+ this.waitForNodes = o.waitForNodes;
+ this.waitForStatus = o.waitForStatus;
+ }
+
+ @Override
+ @Nonnull
+ public Builder copy() {
+ return new Builder(this);
+ }
+
/**
- * Whether to expand wildcard expression to concrete indices that are open,
- * closed or both.
+ * The awareness attribute for which the health is required.
+ *
+ * API name: {@code awareness_attribute}
+ *
+ */
+ @Nonnull
+ public final Builder awarenessAttribute(@Nullable String value) {
+ this.awarenessAttribute = value;
+ return this;
+ }
+
+ /**
+ * Operation timeout for connection to cluster-manager node.
+ *
+ * API name: {@code cluster_manager_timeout}
+ *
+ */
+ @Nonnull
+ public final Builder clusterManagerTimeout(@Nullable Time value) {
+ this.clusterManagerTimeout = value;
+ return this;
+ }
+
+ /**
+ * Operation timeout for connection to cluster-manager node.
+ *
+ * API name: {@code cluster_manager_timeout}
+ *
+ */
+ @Nonnull
+ public final Builder clusterManagerTimeout(Function> fn) {
+ return clusterManagerTimeout(fn.apply(new Time.Builder()).build());
+ }
+
+ /**
+ * Whether to expand wildcard expression to concrete indexes that are open, closed or both.
*
* API name: {@code expand_wildcards}
+ *
+ *
*
* Adds all elements of list
to expandWildcards
.
+ *
*/
+ @Nonnull
public final Builder expandWildcards(List list) {
this.expandWildcards = _listAddAll(this.expandWildcards, list);
return this;
}
/**
- * Whether to expand wildcard expression to concrete indices that are open,
- * closed or both.
+ * Whether to expand wildcard expression to concrete indexes that are open, closed or both.
*
* API name: {@code expand_wildcards}
+ *
+ *
*
* Adds one or more values to expandWildcards
.
+ *
*/
+ @Nonnull
public final Builder expandWildcards(ExpandWildcard value, ExpandWildcard... values) {
this.expandWildcards = _listAdd(this.expandWildcards, value, values);
return this;
}
/**
- * Comma-separated list of data streams, indices, and index aliases used to
- * limit the request. Wildcard expressions (*) are supported. To target all data
- * streams and indices in a cluster, omit this parameter or use _all or *.
+ * Comma-separated list of data streams, indexes, and index aliases used to limit the request. Wildcard expressions (*) are
+ * supported. To target all data streams and indexes in a cluster, omit this parameter or use _all
or *
.
*
* API name: {@code index}
+ *
+ *
*
* Adds all elements of list
to index
.
+ *
*/
+ @Nonnull
public final Builder index(List list) {
this.index = _listAddAll(this.index, list);
return this;
}
/**
- * Comma-separated list of data streams, indices, and index aliases used to
- * limit the request. Wildcard expressions (*) are supported. To target all data
- * streams and indices in a cluster, omit this parameter or use _all or *.
+ * Comma-separated list of data streams, indexes, and index aliases used to limit the request. Wildcard expressions (*) are
+ * supported. To target all data streams and indexes in a cluster, omit this parameter or use _all
or *
.
*
* API name: {@code index}
+ *
+ *
*
* Adds one or more values to index
.
+ *
*/
+ @Nonnull
public final Builder index(String value, String... values) {
this.index = _listAdd(this.index, value, values);
return this;
}
/**
- * Can be one of cluster, indices or shards. Controls the details level of the
- * health information returned.
+ * Can be one of cluster, indexes or shards. Controls the details level of the health information returned.
*
* API name: {@code level}
+ *
*/
- public final Builder level(@Nullable Level value) {
+ @Nonnull
+ public final Builder level(@Nullable ClusterHealthLevel value) {
this.level = value;
return this;
}
/**
- * If true, the request retrieves information from the local node only. Defaults
- * to false, which means information is retrieved from the cluster-manager node.
+ * If true
, the request retrieves information from the local node only. Defaults to false, which means information is
+ * retrieved from the cluster-manager node.
*
* API name: {@code local}
+ *
*/
+ @Nonnull
public final Builder local(@Nullable Boolean value) {
this.local = value;
return this;
}
/**
- * Period to wait for a connection to the master node. If no response is
- * received before the timeout expires, the request fails and returns an error.
+ * 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 master_timeout}
+ *
*/
@Deprecated
+ @Nonnull
public final Builder masterTimeout(@Nullable Time value) {
this.masterTimeout = value;
return this;
}
/**
- * Period to wait for a connection to the master node. If no response is
- * received before the timeout expires, the request fails and returns an error.
+ * 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 master_timeout}
+ *
*/
@Deprecated
+ @Nonnull
public final Builder masterTimeout(Function> fn) {
- return this.masterTimeout(fn.apply(new Time.Builder()).build());
- }
-
- /**
- * 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}
- */
- public final Builder clusterManagerTimeout(@Nullable Time value) {
- this.clusterManagerTimeout = value;
- return this;
+ return masterTimeout(fn.apply(new Time.Builder()).build());
}
/**
- * 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}
- */
- public final Builder clusterManagerTimeout(Function> fn) {
- return this.clusterManagerTimeout(fn.apply(new Time.Builder()).build());
- }
-
- /**
- * Period to wait for a response. If no response is received before the timeout
- * expires, the request fails and returns an error.
+ * 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;
}
/**
- * Period to wait for a response. If no response is received before the timeout
- * expires, the request fails and returns an error.
+ * 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());
}
/**
- * A number controlling to how many active shards to wait for, all to wait for
- * all shards in the cluster to be active, or 0 to not wait.
+ * A number controlling to how many active shards to wait for, all to wait for all shards in the cluster to be active, or 0 to not
+ * wait.
*
* API name: {@code wait_for_active_shards}
+ *
*/
+ @Nonnull
public final Builder waitForActiveShards(@Nullable WaitForActiveShards value) {
this.waitForActiveShards = value;
return this;
}
/**
- * A number controlling to how many active shards to wait for, all to wait for
- * all shards in the cluster to be active, or 0 to not wait.
+ * A number controlling to how many active shards to wait for, all to wait for all shards in the cluster to be active, or 0 to not
+ * wait.
*
* API name: {@code wait_for_active_shards}
+ *
*/
+ @Nonnull
public final Builder waitForActiveShards(Function> fn) {
- return this.waitForActiveShards(fn.apply(new WaitForActiveShards.Builder()).build());
+ return waitForActiveShards(fn.apply(new WaitForActiveShards.Builder()).build());
}
/**
- * Can be one of immediate, urgent, high, normal, low, languid. Wait until all
- * currently queued events with the given priority are processed.
+ * Can be one of immediate, urgent, high, normal, low, languid. Wait until all currently queued events with the given priority are
+ * processed.
*
* API name: {@code wait_for_events}
+ *
*/
+ @Nonnull
public final Builder waitForEvents(@Nullable WaitForEvents value) {
this.waitForEvents = value;
return this;
}
/**
- * A boolean value which controls whether to wait (until the timeout provided)
- * for the cluster to have no shard initializations. Defaults to false, which
- * means it will not wait for initializing shards.
+ * A Boolean value which controls whether to wait (until the timeout provided) for the cluster to have no shard initializations.
+ * Defaults to false, which means it will not wait for initializing shards.
*
* API name: {@code wait_for_no_initializing_shards}
+ *
*/
+ @Nonnull
public final Builder waitForNoInitializingShards(@Nullable Boolean value) {
this.waitForNoInitializingShards = value;
return this;
}
/**
- * A boolean value which controls whether to wait (until the timeout provided)
- * for the cluster to have no shard relocations. Defaults to false, which means
- * it will not wait for relocating shards.
+ * A Boolean value which controls whether to wait (until the timeout provided) for the cluster to have no shard relocations.
+ * Defaults to false, which means it will not wait for relocating shards.
*
* API name: {@code wait_for_no_relocating_shards}
+ *
*/
+ @Nonnull
public final Builder waitForNoRelocatingShards(@Nullable Boolean value) {
this.waitForNoRelocatingShards = value;
return this;
}
/**
- * The request waits until the specified number N of nodes is available. It also
- * accepts >=N, <=N, >N and <N. Alternatively, it is possible to use
- * ge(N), le(N), gt(N) and lt(N) notation.
+ * The request waits until the specified number N of nodes is available. It also accepts >=N, <=N, >N and <N.
+ * Alternatively, it is possible to use ge(N), le(N), gt(N) and lt(N) notation.
*
* API name: {@code wait_for_nodes}
+ *
*/
+ @Nonnull
public final Builder waitForNodes(@Nullable String value) {
this.waitForNodes = value;
return this;
}
/**
- * One of green, yellow or red. Will wait (until the timeout provided) until the
- * status of the cluster changes to the one provided or better, i.e. green >
- * yellow > red. By default, will not wait for any status.
+ * One of green, yellow or red. Will wait (until the timeout provided) until the status of the cluster changes to the one provided
+ * or better, i.e. green > yellow > red. By default, will not wait for any status.
*
* API name: {@code wait_for_status}
+ *
*/
+ @Nonnull
public final Builder waitForStatus(@Nullable HealthStatus value) {
this.waitForStatus = value;
return this;
@@ -540,9 +655,10 @@ public final Builder waitForStatus(@Nullable HealthStatus value) {
/**
* Builds a {@link HealthRequest}.
*
- * @throws NullPointerException
- * if some of the required fields are null.
+ * @throws NullPointerException if some of the required fields are null.
*/
+ @Override
+ @Nonnull
public HealthRequest build() {
_checkSingleUse();
@@ -556,13 +672,8 @@ public HealthRequest build() {
* Endpoint "{@code cluster.health}".
*/
public static final Endpoint _ENDPOINT = new SimpleEndpoint<>(
-
// Request method
- request -> {
- return "GET";
-
- },
-
+ request -> "GET",
// Request path
request -> {
final int _index = 1 << 0;
@@ -572,28 +683,22 @@ public HealthRequest build() {
if (ApiTypeHelper.isDefined(request.index())) propsSet |= _index;
if (propsSet == 0) {
- StringBuilder buf = new StringBuilder();
- buf.append("/_cluster");
- buf.append("/health");
- return buf.toString();
+ return "/_cluster/health";
}
if (propsSet == (_index)) {
StringBuilder buf = new StringBuilder();
- buf.append("/_cluster");
- buf.append("/health");
- buf.append("/");
- SimpleEndpoint.pathEncode(request.index.stream().map(v -> v).collect(Collectors.joining(",")), buf);
+ buf.append("/_cluster/health/");
+ SimpleEndpoint.pathEncode(String.join(",", request.index), buf);
return buf.toString();
}
- throw SimpleEndpoint.noPathTemplateFound("path");
+ throw SimpleEndpoint.noPathTemplateFound("path");
},
-
// Request parameters
request -> {
Map params = new HashMap<>();
- if (request.masterTimeout != null) {
- params.put("master_timeout", request.masterTimeout._toJsonString());
+ if (request.awarenessAttribute != null) {
+ params.put("awareness_attribute", request.awarenessAttribute);
}
if (request.clusterManagerTimeout != null) {
params.put("cluster_manager_timeout", request.clusterManagerTimeout._toJsonString());
@@ -604,35 +709,78 @@ public HealthRequest build() {
if (request.level != null) {
params.put("level", request.level.jsonValue());
}
- if (request.waitForEvents != null) {
- params.put("wait_for_events", request.waitForEvents.jsonValue());
+ if (request.local != null) {
+ params.put("local", String.valueOf(request.local));
}
- if (request.waitForNoInitializingShards != null) {
- params.put("wait_for_no_initializing_shards", String.valueOf(request.waitForNoInitializingShards));
+ if (request.masterTimeout != null) {
+ params.put("master_timeout", request.masterTimeout._toJsonString());
}
- if (request.waitForStatus != null) {
- params.put("wait_for_status", request.waitForStatus.jsonValue());
+ if (request.timeout != null) {
+ params.put("timeout", request.timeout._toJsonString());
}
if (request.waitForActiveShards != null) {
params.put("wait_for_active_shards", request.waitForActiveShards._toJsonString());
}
- if (request.waitForNodes != null) {
- params.put("wait_for_nodes", request.waitForNodes);
+ if (request.waitForEvents != null) {
+ params.put("wait_for_events", request.waitForEvents.jsonValue());
+ }
+ if (request.waitForNoInitializingShards != null) {
+ params.put("wait_for_no_initializing_shards", String.valueOf(request.waitForNoInitializingShards));
}
if (request.waitForNoRelocatingShards != null) {
params.put("wait_for_no_relocating_shards", String.valueOf(request.waitForNoRelocatingShards));
}
- if (request.local != null) {
- params.put("local", String.valueOf(request.local));
+ if (request.waitForNodes != null) {
+ params.put("wait_for_nodes", request.waitForNodes);
}
- if (request.timeout != null) {
- params.put("timeout", request.timeout._toJsonString());
+ if (request.waitForStatus != null) {
+ params.put("wait_for_status", request.waitForStatus.jsonValue());
}
return params;
-
},
SimpleEndpoint.emptyMap(),
false,
HealthResponse._DESERIALIZER
);
+
+ @Override
+ public int hashCode() {
+ int result = 17;
+ result = 31 * result + Objects.hashCode(this.awarenessAttribute);
+ result = 31 * result + Objects.hashCode(this.clusterManagerTimeout);
+ result = 31 * result + Objects.hashCode(this.expandWildcards);
+ result = 31 * result + Objects.hashCode(this.index);
+ result = 31 * result + Objects.hashCode(this.level);
+ result = 31 * result + Objects.hashCode(this.local);
+ result = 31 * result + Objects.hashCode(this.masterTimeout);
+ result = 31 * result + Objects.hashCode(this.timeout);
+ result = 31 * result + Objects.hashCode(this.waitForActiveShards);
+ result = 31 * result + Objects.hashCode(this.waitForEvents);
+ result = 31 * result + Objects.hashCode(this.waitForNoInitializingShards);
+ result = 31 * result + Objects.hashCode(this.waitForNoRelocatingShards);
+ result = 31 * result + Objects.hashCode(this.waitForNodes);
+ result = 31 * result + Objects.hashCode(this.waitForStatus);
+ return result;
+ }
+
+ @Override
+ public boolean equals(Object o) {
+ if (this == o) return true;
+ if (o == null || this.getClass() != o.getClass()) return false;
+ HealthRequest other = (HealthRequest) o;
+ return Objects.equals(this.awarenessAttribute, other.awarenessAttribute)
+ && Objects.equals(this.clusterManagerTimeout, other.clusterManagerTimeout)
+ && Objects.equals(this.expandWildcards, other.expandWildcards)
+ && Objects.equals(this.index, other.index)
+ && Objects.equals(this.level, other.level)
+ && Objects.equals(this.local, other.local)
+ && Objects.equals(this.masterTimeout, other.masterTimeout)
+ && Objects.equals(this.timeout, other.timeout)
+ && Objects.equals(this.waitForActiveShards, other.waitForActiveShards)
+ && Objects.equals(this.waitForEvents, other.waitForEvents)
+ && Objects.equals(this.waitForNoInitializingShards, other.waitForNoInitializingShards)
+ && Objects.equals(this.waitForNoRelocatingShards, other.waitForNoRelocatingShards)
+ && Objects.equals(this.waitForNodes, other.waitForNodes)
+ && Objects.equals(this.waitForStatus, other.waitForStatus);
+ }
}
diff --git a/java-client/src/main/java/org/opensearch/client/opensearch/cluster/HealthResponse.java b/java-client/src/generated/java/org/opensearch/client/opensearch/cluster/HealthResponse.java
similarity index 50%
rename from java-client/src/main/java/org/opensearch/client/opensearch/cluster/HealthResponse.java
rename to java-client/src/generated/java/org/opensearch/client/opensearch/cluster/HealthResponse.java
index 9f015f4acc..f6d70d6429 100644
--- a/java-client/src/main/java/org/opensearch/client/opensearch/cluster/HealthResponse.java
+++ b/java-client/src/generated/java/org/opensearch/client/opensearch/cluster/HealthResponse.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.JsonpDeserializable;
import org.opensearch.client.json.JsonpDeserializer;
@@ -43,25 +50,45 @@
import org.opensearch.client.json.ObjectDeserializer;
import org.opensearch.client.json.PlainJsonSerializable;
import org.opensearch.client.opensearch._types.HealthStatus;
+import org.opensearch.client.opensearch._types.Time;
+import org.opensearch.client.opensearch.cluster.health.AwarenessAttributeStats;
import org.opensearch.client.opensearch.cluster.health.IndexHealthStats;
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.health.Response
@JsonpDeserializable
-public class HealthResponse implements PlainJsonSerializable {
+@Generated("org.opensearch.client.codegen.CodeGenerator")
+public class HealthResponse implements PlainJsonSerializable, ToCopyableBuilder {
+
private final int activePrimaryShards;
private final int activeShards;
- private final String activeShardsPercentAsNumber;
+ @Nullable
+ private final String activeShardsPercent;
+
+ private final double activeShardsPercentAsNumber;
+ @Nonnull
+ private final Map awarenessAttributes;
+
+ @Nonnull
private final String clusterName;
private final int delayedUnassignedShards;
+ @Nullable
+ private final Boolean discoveredClusterManager;
+
+ @Nullable
+ private final Boolean discoveredMaster;
+
+ @Nonnull
private final Map indices;
private final int initializingShards;
@@ -76,9 +103,13 @@ public class HealthResponse implements PlainJsonSerializable {
private final int relocatingShards;
+ @Nonnull
private final HealthStatus status;
- private final String taskMaxWaitingInQueueMillis;
+ @Nullable
+ private final Time taskMaxWaitingInQueue;
+
+ private final long taskMaxWaitingInQueueMillis;
private final boolean timedOut;
@@ -87,16 +118,19 @@ public class HealthResponse implements PlainJsonSerializable {
// ---------------------------------------------------------------------------------------------
private HealthResponse(Builder builder) {
-
this.activePrimaryShards = ApiTypeHelper.requireNonNull(builder.activePrimaryShards, this, "activePrimaryShards");
this.activeShards = ApiTypeHelper.requireNonNull(builder.activeShards, this, "activeShards");
+ this.activeShardsPercent = builder.activeShardsPercent;
this.activeShardsPercentAsNumber = ApiTypeHelper.requireNonNull(
builder.activeShardsPercentAsNumber,
this,
"activeShardsPercentAsNumber"
);
+ this.awarenessAttributes = ApiTypeHelper.unmodifiable(builder.awarenessAttributes);
this.clusterName = ApiTypeHelper.requireNonNull(builder.clusterName, this, "clusterName");
this.delayedUnassignedShards = ApiTypeHelper.requireNonNull(builder.delayedUnassignedShards, this, "delayedUnassignedShards");
+ this.discoveredClusterManager = builder.discoveredClusterManager;
+ this.discoveredMaster = builder.discoveredMaster;
this.indices = ApiTypeHelper.unmodifiable(builder.indices);
this.initializingShards = ApiTypeHelper.requireNonNull(builder.initializingShards, this, "initializingShards");
this.numberOfDataNodes = ApiTypeHelper.requireNonNull(builder.numberOfDataNodes, this, "numberOfDataNodes");
@@ -105,6 +139,7 @@ private HealthResponse(Builder builder) {
this.numberOfPendingTasks = ApiTypeHelper.requireNonNull(builder.numberOfPendingTasks, this, "numberOfPendingTasks");
this.relocatingShards = ApiTypeHelper.requireNonNull(builder.relocatingShards, this, "relocatingShards");
this.status = ApiTypeHelper.requireNonNull(builder.status, this, "status");
+ this.taskMaxWaitingInQueue = builder.taskMaxWaitingInQueue;
this.taskMaxWaitingInQueueMillis = ApiTypeHelper.requireNonNull(
builder.taskMaxWaitingInQueueMillis,
this,
@@ -112,10 +147,9 @@ private HealthResponse(Builder builder) {
);
this.timedOut = ApiTypeHelper.requireNonNull(builder.timedOut, this, "timedOut");
this.unassignedShards = ApiTypeHelper.requireNonNull(builder.unassignedShards, this, "unassignedShards");
-
}
- public static HealthResponse of(Function> fn) {
+ public static HealthResponse of(Function> fn) {
return fn.apply(new Builder()).build();
}
@@ -123,6 +157,7 @@ public static HealthResponse of(Function>
* Required - The number of active primary shards.
*
* API name: {@code active_primary_shards}
+ *
*/
public final int activePrimaryShards() {
return this.activePrimaryShards;
@@ -132,43 +167,82 @@ public final int activePrimaryShards() {
* Required - The total number of active primary and replica shards.
*
* API name: {@code active_shards}
+ *
*/
public final int activeShards() {
return this.activeShards;
}
/**
- * Required - The ratio of active shards in the cluster expressed as a
- * percentage.
- *
- * API name: {@code active_shards_percent_as_number}
+ * API name: {@code active_shards_percent}
+ */
+ @Nullable
+ public final String activeShardsPercent() {
+ return this.activeShardsPercent;
+ }
+
+ /**
+ * Required - API name: {@code active_shards_percent_as_number}
*/
- public final String activeShardsPercentAsNumber() {
+ public final double activeShardsPercentAsNumber() {
return this.activeShardsPercentAsNumber;
}
/**
- * Required - The name of the cluster.
+ * Cluster health information for each awareness attribute.
*
- * API name: {@code cluster_name}
+ * API name: {@code awareness_attributes}
+ *
+ */
+ @Nonnull
+ public final Map awarenessAttributes() {
+ return this.awarenessAttributes;
+ }
+
+ /**
+ * Required - API name: {@code cluster_name}
*/
+ @Nonnull
public final String clusterName() {
return this.clusterName;
}
/**
- * Required - The number of shards whose allocation has been delayed by the
- * timeout settings.
+ * Required - The number of shards whose allocation has been delayed by the timeout settings.
*
* API name: {@code delayed_unassigned_shards}
+ *
*/
public final int delayedUnassignedShards() {
return this.delayedUnassignedShards;
}
+ /**
+ * True if the cluster-manager node has been discovered.
+ *
+ * API name: {@code discovered_cluster_manager}
+ *
+ */
+ @Nullable
+ public final Boolean discoveredClusterManager() {
+ return this.discoveredClusterManager;
+ }
+
+ /**
+ * True if the cluster-manager node has been discovered.
+ *
+ * API name: {@code discovered_master}
+ *
+ */
+ @Nullable
+ public final Boolean discoveredMaster() {
+ return this.discoveredMaster;
+ }
+
/**
* API name: {@code indices}
*/
+ @Nonnull
public final Map indices() {
return this.indices;
}
@@ -177,6 +251,7 @@ public final Map indices() {
* Required - The number of shards that are under initialization.
*
* API name: {@code initializing_shards}
+ *
*/
public final int initializingShards() {
return this.initializingShards;
@@ -186,13 +261,17 @@ public final int initializingShards() {
* Required - The number of nodes that are dedicated data nodes.
*
* API name: {@code number_of_data_nodes}
+ *
*/
public final int numberOfDataNodes() {
return this.numberOfDataNodes;
}
/**
- * Required - API name: {@code number_of_in_flight_fetch}
+ * Required - The number of unfinished fetches.
+ *
+ * API name: {@code number_of_in_flight_fetch}
+ *
*/
public final int numberOfInFlightFetch() {
return this.numberOfInFlightFetch;
@@ -202,16 +281,17 @@ public final int numberOfInFlightFetch() {
* Required - The number of nodes within the cluster.
*
* API name: {@code number_of_nodes}
+ *
*/
public final int numberOfNodes() {
return this.numberOfNodes;
}
/**
- * Required - The number of cluster-level changes that have not yet been
- * executed.
+ * Required - The number of cluster-level changes that have not yet been executed.
*
* API name: {@code number_of_pending_tasks}
+ *
*/
public final int numberOfPendingTasks() {
return this.numberOfPendingTasks;
@@ -221,6 +301,7 @@ public final int numberOfPendingTasks() {
* Required - The number of shards that are under relocation.
*
* API name: {@code relocating_shards}
+ *
*/
public final int relocatingShards() {
return this.relocatingShards;
@@ -229,25 +310,32 @@ public final int relocatingShards() {
/**
* Required - API name: {@code status}
*/
+ @Nonnull
public final HealthStatus status() {
return this.status;
}
/**
- * Required - The time expressed in milliseconds since the earliest initiated
- * task is waiting for being performed.
- *
- * API name: {@code task_max_waiting_in_queue_millis}
+ * API name: {@code task_max_waiting_in_queue}
*/
- public final String taskMaxWaitingInQueueMillis() {
+ @Nullable
+ public final Time taskMaxWaitingInQueue() {
+ return this.taskMaxWaitingInQueue;
+ }
+
+ /**
+ * Required - API name: {@code task_max_waiting_in_queue_millis}
+ */
+ public final long taskMaxWaitingInQueueMillis() {
return this.taskMaxWaitingInQueueMillis;
}
/**
- * Required - If false the response returned within the period of time that is
- * specified by the timeout parameter (30s by default)
+ * Required - If false
the response returned within the period of time that is specified by the timeout parameter
+ * (30s
by default).
*
* API name: {@code timed_out}
+ *
*/
public final boolean timedOut() {
return this.timedOut;
@@ -257,6 +345,7 @@ public final boolean timedOut() {
* Required - The number of shards that are not allocated.
*
* API name: {@code unassigned_shards}
+ *
*/
public final int unassignedShards() {
return this.unassignedShards;
@@ -265,6 +354,7 @@ public final int unassignedShards() {
/**
* Serialize this object to JSON.
*/
+ @Override
public void serialize(JsonGenerator generator, JsonpMapper mapper) {
generator.writeStartObject();
serializeInternal(generator, mapper);
@@ -272,33 +362,56 @@ public void serialize(JsonGenerator generator, JsonpMapper mapper) {
}
protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) {
-
generator.writeKey("active_primary_shards");
generator.write(this.activePrimaryShards);
generator.writeKey("active_shards");
generator.write(this.activeShards);
+ if (this.activeShardsPercent != null) {
+ generator.writeKey("active_shards_percent");
+ generator.write(this.activeShardsPercent);
+ }
+
generator.writeKey("active_shards_percent_as_number");
generator.write(this.activeShardsPercentAsNumber);
+ if (ApiTypeHelper.isDefined(this.awarenessAttributes)) {
+ generator.writeKey("awareness_attributes");
+ generator.writeStartObject();
+ for (Map.Entry item0 : this.awarenessAttributes.entrySet()) {
+ generator.writeKey(item0.getKey());
+ item0.getValue().serialize(generator, mapper);
+ }
+ generator.writeEnd();
+ }
+
generator.writeKey("cluster_name");
generator.write(this.clusterName);
generator.writeKey("delayed_unassigned_shards");
generator.write(this.delayedUnassignedShards);
+ if (this.discoveredClusterManager != null) {
+ generator.writeKey("discovered_cluster_manager");
+ generator.write(this.discoveredClusterManager);
+ }
+
+ if (this.discoveredMaster != null) {
+ generator.writeKey("discovered_master");
+ generator.write(this.discoveredMaster);
+ }
+
if (ApiTypeHelper.isDefined(this.indices)) {
generator.writeKey("indices");
generator.writeStartObject();
for (Map.Entry item0 : this.indices.entrySet()) {
generator.writeKey(item0.getKey());
item0.getValue().serialize(generator, mapper);
-
}
generator.writeEnd();
-
}
+
generator.writeKey("initializing_shards");
generator.write(this.initializingShards);
@@ -319,6 +432,12 @@ protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) {
generator.writeKey("status");
this.status.serialize(generator, mapper);
+
+ if (this.taskMaxWaitingInQueue != null) {
+ generator.writeKey("task_max_waiting_in_queue");
+ this.taskMaxWaitingInQueue.serialize(generator, mapper);
+ }
+
generator.writeKey("task_max_waiting_in_queue_millis");
generator.write(this.taskMaxWaitingInQueueMillis);
@@ -327,54 +446,116 @@ protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) {
generator.writeKey("unassigned_shards");
generator.write(this.unassignedShards);
-
}
// ---------------------------------------------------------------------------------------------
+ @Override
+ @Nonnull
+ public Builder toBuilder() {
+ return new Builder(this);
+ }
+
+ @Nonnull
+ public static Builder builder() {
+ return new Builder();
+ }
+
/**
* Builder for {@link HealthResponse}.
*/
-
- public static class Builder extends ObjectBuilderBase implements ObjectBuilder {
+ public static class Builder extends ObjectBuilderBase implements CopyableBuilder {
private Integer activePrimaryShards;
-
private Integer activeShards;
-
- private String activeShardsPercentAsNumber;
-
+ @Nullable
+ private String activeShardsPercent;
+ private Double activeShardsPercentAsNumber;
+ @Nullable
+ private Map awarenessAttributes;
private String clusterName;
-
private Integer delayedUnassignedShards;
-
+ @Nullable
+ private Boolean discoveredClusterManager;
+ @Nullable
+ private Boolean discoveredMaster;
@Nullable
private Map indices;
-
private Integer initializingShards;
-
private Integer numberOfDataNodes;
-
private Integer numberOfInFlightFetch;
-
private Integer numberOfNodes;
-
private Integer numberOfPendingTasks;
-
private Integer relocatingShards;
-
private HealthStatus status;
+ @Nullable
+ private Time taskMaxWaitingInQueue;
+ private Long taskMaxWaitingInQueueMillis;
+ private Boolean timedOut;
+ private Integer unassignedShards;
- private String taskMaxWaitingInQueueMillis;
+ public Builder() {}
+
+ private Builder(HealthResponse o) {
+ this.activePrimaryShards = o.activePrimaryShards;
+ this.activeShards = o.activeShards;
+ this.activeShardsPercent = o.activeShardsPercent;
+ this.activeShardsPercentAsNumber = o.activeShardsPercentAsNumber;
+ this.awarenessAttributes = _mapCopy(o.awarenessAttributes);
+ this.clusterName = o.clusterName;
+ this.delayedUnassignedShards = o.delayedUnassignedShards;
+ this.discoveredClusterManager = o.discoveredClusterManager;
+ this.discoveredMaster = o.discoveredMaster;
+ this.indices = _mapCopy(o.indices);
+ this.initializingShards = o.initializingShards;
+ this.numberOfDataNodes = o.numberOfDataNodes;
+ this.numberOfInFlightFetch = o.numberOfInFlightFetch;
+ this.numberOfNodes = o.numberOfNodes;
+ this.numberOfPendingTasks = o.numberOfPendingTasks;
+ this.relocatingShards = o.relocatingShards;
+ this.status = o.status;
+ this.taskMaxWaitingInQueue = o.taskMaxWaitingInQueue;
+ this.taskMaxWaitingInQueueMillis = o.taskMaxWaitingInQueueMillis;
+ this.timedOut = o.timedOut;
+ this.unassignedShards = o.unassignedShards;
+ }
- private Boolean timedOut;
+ private Builder(Builder o) {
+ this.activePrimaryShards = o.activePrimaryShards;
+ this.activeShards = o.activeShards;
+ this.activeShardsPercent = o.activeShardsPercent;
+ this.activeShardsPercentAsNumber = o.activeShardsPercentAsNumber;
+ this.awarenessAttributes = _mapCopy(o.awarenessAttributes);
+ this.clusterName = o.clusterName;
+ this.delayedUnassignedShards = o.delayedUnassignedShards;
+ this.discoveredClusterManager = o.discoveredClusterManager;
+ this.discoveredMaster = o.discoveredMaster;
+ this.indices = _mapCopy(o.indices);
+ this.initializingShards = o.initializingShards;
+ this.numberOfDataNodes = o.numberOfDataNodes;
+ this.numberOfInFlightFetch = o.numberOfInFlightFetch;
+ this.numberOfNodes = o.numberOfNodes;
+ this.numberOfPendingTasks = o.numberOfPendingTasks;
+ this.relocatingShards = o.relocatingShards;
+ this.status = o.status;
+ this.taskMaxWaitingInQueue = o.taskMaxWaitingInQueue;
+ this.taskMaxWaitingInQueueMillis = o.taskMaxWaitingInQueueMillis;
+ this.timedOut = o.timedOut;
+ this.unassignedShards = o.unassignedShards;
+ }
- private Integer unassignedShards;
+ @Override
+ @Nonnull
+ public Builder copy() {
+ return new Builder(this);
+ }
/**
* Required - The number of active primary shards.
*
* API name: {@code active_primary_shards}
+ *
*/
+ @Nonnull
public final Builder activePrimaryShards(int value) {
this.activePrimaryShards = value;
return this;
@@ -384,49 +565,135 @@ public final Builder activePrimaryShards(int value) {
* Required - The total number of active primary and replica shards.
*
* API name: {@code active_shards}
+ *
*/
+ @Nonnull
public final Builder activeShards(int value) {
this.activeShards = value;
return this;
}
/**
- * Required - The ratio of active shards in the cluster expressed as a
- * percentage.
- *
- * API name: {@code active_shards_percent_as_number}
+ * API name: {@code active_shards_percent}
+ */
+ @Nonnull
+ public final Builder activeShardsPercent(@Nullable String value) {
+ this.activeShardsPercent = value;
+ return this;
+ }
+
+ /**
+ * Required - API name: {@code active_shards_percent_as_number}
*/
- public final Builder activeShardsPercentAsNumber(String value) {
+ @Nonnull
+ public final Builder activeShardsPercentAsNumber(double value) {
this.activeShardsPercentAsNumber = value;
return this;
}
/**
- * Required - The name of the cluster.
+ * Cluster health information for each awareness attribute.
+ *
+ * API name: {@code awareness_attributes}
+ *
+ *
+ *
+ * Adds all elements of map
to awarenessAttributes
.
+ *
+ */
+ @Nonnull
+ public final Builder awarenessAttributes(Map map) {
+ this.awarenessAttributes = _mapPutAll(this.awarenessAttributes, map);
+ return this;
+ }
+
+ /**
+ * Cluster health information for each awareness attribute.
*
- * API name: {@code cluster_name}
+ * API name: {@code awareness_attributes}
+ *
+ *
+ *
+ * Adds an entry to awarenessAttributes
.
+ *
*/
+ @Nonnull
+ public final Builder awarenessAttributes(String key, AwarenessAttributeStats value) {
+ this.awarenessAttributes = _mapPut(this.awarenessAttributes, key, value);
+ return this;
+ }
+
+ /**
+ * Cluster health information for each awareness attribute.
+ *
+ * API name: {@code awareness_attributes}
+ *
+ *
+ *
+ * Adds a value to awarenessAttributes
using a builder lambda.
+ *
+ */
+ @Nonnull
+ public final Builder awarenessAttributes(
+ String key,
+ Function> fn
+ ) {
+ return awarenessAttributes(key, fn.apply(new AwarenessAttributeStats.Builder()).build());
+ }
+
+ /**
+ * Required - API name: {@code cluster_name}
+ */
+ @Nonnull
public final Builder clusterName(String value) {
this.clusterName = value;
return this;
}
/**
- * Required - The number of shards whose allocation has been delayed by the
- * timeout settings.
+ * Required - The number of shards whose allocation has been delayed by the timeout settings.
*
* API name: {@code delayed_unassigned_shards}
+ *
*/
+ @Nonnull
public final Builder delayedUnassignedShards(int value) {
this.delayedUnassignedShards = value;
return this;
}
+ /**
+ * True if the cluster-manager node has been discovered.
+ *
+ * API name: {@code discovered_cluster_manager}
+ *
+ */
+ @Nonnull
+ public final Builder discoveredClusterManager(@Nullable Boolean value) {
+ this.discoveredClusterManager = value;
+ return this;
+ }
+
+ /**
+ * True if the cluster-manager node has been discovered.
+ *
+ * API name: {@code discovered_master}
+ *
+ */
+ @Nonnull
+ public final Builder discoveredMaster(@Nullable Boolean value) {
+ this.discoveredMaster = value;
+ return this;
+ }
+
/**
* API name: {@code indices}
+ *
*
- * Adds all entries of map
to indices
.
+ * Adds all elements of map
to indices
.
+ *
*/
+ @Nonnull
public final Builder indices(Map map) {
this.indices = _mapPutAll(this.indices, map);
return this;
@@ -434,9 +701,12 @@ public final Builder indices(Map map) {
/**
* API name: {@code indices}
+ *
*