From c87d3ea777709ace65dbed13ce56c0f2aaf43c1f Mon Sep 17 00:00:00 2001 From: Thomas Farr Date: Tue, 7 Jan 2025 16:24:24 +1300 Subject: [PATCH 01/18] Generate cat.aliases and refactor CatRequestBase and RequestBase Signed-off-by: Thomas Farr --- .../opensearch/OpenSearchAsyncClientBase.java | 28 ++- .../opensearch/OpenSearchClientBase.java | 27 ++- .../client/opensearch/cat/AliasesRequest.java | 165 ++++++++++---- .../opensearch/cat/AliasesResponse.java | 74 ++++-- .../cat/OpenSearchCatAsyncClientBase.java | 86 +++++++ .../cat/OpenSearchCatClientBase.java | 83 +++++++ .../opensearch/cat/aliases/AliasesRecord.java | 213 ++++++++++++------ .../cluster/AllocationExplainRequest.java | 32 ++- .../cluster/ClusterStatsRequest.java | 32 ++- .../DeleteComponentTemplateRequest.java | 40 +++- .../DeleteVotingConfigExclusionsRequest.java | 28 ++- .../ExistsComponentTemplateRequest.java | 40 +++- .../cluster/GetClusterSettingsRequest.java | 52 +++-- .../cluster/GetComponentTemplateRequest.java | 46 ++-- .../opensearch/cluster/HealthRequest.java | 98 ++++---- .../cluster/OpenSearchClusterAsyncClient.java | 21 +- .../cluster/OpenSearchClusterClient.java | 21 +- .../cluster/PendingTasksRequest.java | 38 +++- .../PostVotingConfigExclusionsRequest.java | 40 +++- .../cluster/PutClusterSettingsRequest.java | 46 ++-- .../cluster/PutComponentTemplateRequest.java | 46 ++-- .../opensearch/cluster/RemoteInfoRequest.java | 79 ++++++- .../opensearch/cluster/RerouteRequest.java | 62 +++-- .../opensearch/cluster/StateRequest.java | 74 +++--- .../client/opensearch/core/InfoRequest.java | 79 ++++++- .../DeleteDanglingIndexRequest.java | 42 ++-- .../ImportDanglingIndexRequest.java | 42 ++-- .../ListDanglingIndicesRequest.java | 85 ++++++- .../OpenSearchDanglingIndicesAsyncClient.java | 27 ++- .../OpenSearchDanglingIndicesClient.java | 26 ++- .../opensearch/indices/AddBlockRequest.java | 56 +++-- .../opensearch/indices/AnalyzeRequest.java | 22 +- .../opensearch/indices/ClearCacheRequest.java | 68 +++--- .../opensearch/indices/CloneIndexRequest.java | 56 +++-- .../opensearch/indices/CloseIndexRequest.java | 62 +++-- .../indices/CreateDataStreamRequest.java | 22 +- .../indices/CreateIndexRequest.java | 44 ++-- .../indices/DataStreamsStatsRequest.java | 22 +- .../indices/DeleteAliasRequest.java | 38 +++- .../indices/DeleteDataStreamRequest.java | 22 +- .../indices/DeleteIndexRequest.java | 56 +++-- .../indices/DeleteIndexTemplateRequest.java | 40 +++- .../indices/DeleteTemplateRequest.java | 40 +++- .../indices/ExistsAliasRequest.java | 44 ++-- .../indices/ExistsIndexTemplateRequest.java | 46 ++-- .../opensearch/indices/ExistsRequest.java | 62 +++-- .../indices/ExistsTemplateRequest.java | 46 ++-- .../opensearch/indices/FlushRequest.java | 50 ++-- .../opensearch/indices/ForcemergeRequest.java | 68 +++--- .../opensearch/indices/GetAliasRequest.java | 44 ++-- .../indices/GetDataStreamRequest.java | 24 +- .../opensearch/indices/GetIndexRequest.java | 68 +++--- .../indices/GetIndexTemplateRequest.java | 44 ++-- .../indices/GetIndicesSettingsRequest.java | 70 +++--- .../opensearch/indices/GetMappingRequest.java | 56 +++-- .../indices/GetTemplateRequest.java | 44 ++-- .../opensearch/indices/GetUpgradeRequest.java | 38 +++- .../indices/IndicesStatsRequest.java | 74 +++--- .../opensearch/indices/OpenRequest.java | 74 +++--- .../opensearch/indices/PutAliasRequest.java | 38 +++- .../indices/PutIndexTemplateRequest.java | 44 ++-- .../indices/PutIndicesSettingsRequest.java | 70 +++--- .../opensearch/indices/PutMappingRequest.java | 62 +++-- .../indices/PutTemplateRequest.java | 38 +++- .../opensearch/indices/RecoveryRequest.java | 32 ++- .../opensearch/indices/RefreshRequest.java | 38 +++- .../indices/ResolveIndexRequest.java | 26 ++- .../opensearch/indices/RolloverRequest.java | 50 ++-- .../opensearch/indices/SegmentsRequest.java | 44 ++-- .../indices/ShardStoresRequest.java | 44 ++-- .../opensearch/indices/ShrinkRequest.java | 65 ++++-- .../indices/SimulateIndexTemplateRequest.java | 34 ++- .../indices/SimulateTemplateRequest.java | 44 ++-- .../opensearch/indices/SplitRequest.java | 65 ++++-- .../indices/UpdateAliasesRequest.java | 38 +++- .../opensearch/indices/UpgradeRequest.java | 50 ++-- .../indices/ValidateQueryRequest.java | 92 ++++---- .../ingest/DeletePipelineRequest.java | 40 +++- .../opensearch/ingest/GetPipelineRequest.java | 32 ++- .../ingest/ProcessorGrokRequest.java | 28 ++- .../opensearch/ingest/PutPipelineRequest.java | 38 +++- .../opensearch/ingest/SimulateRequest.java | 26 ++- .../opensearch/ml/CreateConnectorRequest.java | 21 +- .../opensearch/ml/DeleteAgentRequest.java | 22 +- .../opensearch/ml/DeleteConnectorRequest.java | 22 +- .../ml/DeleteModelGroupRequest.java | 22 +- .../opensearch/ml/DeleteModelRequest.java | 22 +- .../opensearch/ml/DeleteTaskRequest.java | 22 +- .../opensearch/ml/DeployModelRequest.java | 22 +- .../opensearch/ml/GetModelGroupRequest.java | 24 +- .../client/opensearch/ml/GetTaskRequest.java | 22 +- .../opensearch/ml/RegisterAgentsRequest.java | 21 +- .../ml/RegisterModelGroupRequest.java | 24 +- .../opensearch/ml/RegisterModelRequest.java | 22 +- .../opensearch/ml/UndeployModelRequest.java | 24 +- .../opensearch/nodes/NodesInfoRequest.java | 32 ++- .../opensearch/nodes/NodesStatsRequest.java | 68 +++--- .../opensearch/nodes/NodesUsageRequest.java | 26 ++- .../nodes/ReloadSecureSettingsRequest.java | 28 ++- .../snapshot/CleanupRepositoryRequest.java | 38 +++- .../snapshot/CloneSnapshotRequest.java | 32 ++- .../snapshot/CreateRepositoryRequest.java | 44 ++-- .../snapshot/CreateSnapshotRequest.java | 38 +++- .../snapshot/DeleteRepositoryRequest.java | 38 +++- .../snapshot/DeleteSnapshotRequest.java | 34 ++- .../snapshot/GetRepositoryRequest.java | 40 +++- .../snapshot/GetSnapshotRequest.java | 44 ++-- .../snapshot/RestoreSnapshotRequest.java | 38 +++- .../snapshot/SnapshotStatusRequest.java | 40 +++- .../snapshot/VerifyRepositoryRequest.java | 38 +++- .../opensearch/tasks/CancelRequest.java | 44 ++-- .../opensearch/tasks/GetTasksRequest.java | 32 ++- .../client/opensearch/tasks/ListRequest.java | 62 +++-- .../opensearch/OpenSearchAsyncClient.java | 7 - .../client/opensearch/OpenSearchClient.java | 5 - .../client/opensearch/_types/RequestBase.java | 90 +++++++- .../client/opensearch/cat/CatRequestBase.java | 128 +++++++---- .../cat/OpenSearchCatAsyncClient.java | 48 +--- .../opensearch/cat/OpenSearchCatClient.java | 48 +--- .../client/codegen/CodeGenerator.java | 1 + .../client/codegen/model/ArrayShape.java | 10 +- .../client/codegen/model/Namespace.java | 7 +- .../client/codegen/model/ObjectShape.java | 6 +- .../client/codegen/model/RequestShape.java | 8 +- .../client/codegen/model/Shape.java | 15 +- .../client/codegen/model/SpecTransformer.java | 6 +- .../client/codegen/model/Types.java | 5 + .../codegen/openapi/OpenApiParameter.java | 7 + .../codegen/utils/JavaAbstractionLevel.java | 40 ++++ .../codegen/templates/ArrayShape.mustache | 2 + .../client/codegen/templates/Client.mustache | 13 -- .../templates/ObjectShape/Builder.mustache | 14 +- .../ObjectShape/Builder/CopyCtorImpl.mustache | 4 +- .../ObjectShape/ConstructorImpl.mustache | 4 +- .../Partials/ClassDeclaration.mustache | 2 +- .../codegen/templates/RequestShape.mustache | 41 ++-- 136 files changed, 3971 insertions(+), 1756 deletions(-) rename java-client/src/{main => generated}/java/org/opensearch/client/opensearch/cat/AliasesRequest.java (54%) rename java-client/src/{main => generated}/java/org/opensearch/client/opensearch/cat/AliasesResponse.java (75%) create mode 100644 java-client/src/generated/java/org/opensearch/client/opensearch/cat/OpenSearchCatAsyncClientBase.java create mode 100644 java-client/src/generated/java/org/opensearch/client/opensearch/cat/OpenSearchCatClientBase.java rename java-client/src/{main => generated}/java/org/opensearch/client/opensearch/cat/aliases/AliasesRecord.java (70%) create mode 100644 java-codegen/src/main/java/org/opensearch/client/codegen/utils/JavaAbstractionLevel.java diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/OpenSearchAsyncClientBase.java b/java-client/src/generated/java/org/opensearch/client/opensearch/OpenSearchAsyncClientBase.java index d9ba1b3596..16716c25ab 100644 --- a/java-client/src/generated/java/org/opensearch/client/opensearch/OpenSearchAsyncClientBase.java +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/OpenSearchAsyncClientBase.java @@ -38,10 +38,12 @@ import java.io.IOException; import java.util.concurrent.CompletableFuture; +import java.util.function.Function; import javax.annotation.Generated; import javax.annotation.Nullable; import org.opensearch.client.ApiClient; import org.opensearch.client.opensearch._types.OpenSearchException; +import org.opensearch.client.opensearch.cat.OpenSearchCatAsyncClient; import org.opensearch.client.opensearch.cluster.OpenSearchClusterAsyncClient; import org.opensearch.client.opensearch.core.InfoRequest; import org.opensearch.client.opensearch.core.InfoResponse; @@ -54,6 +56,7 @@ import org.opensearch.client.opensearch.tasks.OpenSearchTasksAsyncClient; import org.opensearch.client.transport.OpenSearchTransport; import org.opensearch.client.transport.TransportOptions; +import org.opensearch.client.util.ObjectBuilder; /** * Client for the namespace. @@ -66,6 +69,10 @@ public OpenSearchAsyncClientBase(OpenSearchTransport transport, @Nullable Transp // ----- Child clients + public OpenSearchCatAsyncClient cat() { + return new OpenSearchCatAsyncClient(this.transport, this.transportOptions); + } + public OpenSearchClusterAsyncClient cluster() { return new OpenSearchClusterAsyncClient(this.transport, this.transportOptions); } @@ -103,7 +110,24 @@ public OpenSearchTasksAsyncClient tasks() { /** * Returns basic information about the cluster. */ - public CompletableFuture info() throws IOException, OpenSearchException { - return this.transport.performRequestAsync(InfoRequest._INSTANCE, InfoRequest._ENDPOINT, this.transportOptions); + public CompletableFuture info(InfoRequest request) throws IOException, OpenSearchException { + return this.transport.performRequestAsync(request, InfoRequest._ENDPOINT, this.transportOptions); + } + + /** + * Returns basic information about the cluster. + * + * @param fn a function that initializes a builder to create the {@link InfoRequest} + */ + public final CompletableFuture info(Function> fn) throws IOException, + OpenSearchException { + return info(fn.apply(new InfoRequest.Builder()).build()); + } + + /** + * Returns basic information about the cluster. + */ + public final CompletableFuture info() throws IOException, OpenSearchException { + return info(new InfoRequest.Builder().build()); } } diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/OpenSearchClientBase.java b/java-client/src/generated/java/org/opensearch/client/opensearch/OpenSearchClientBase.java index 1269efecaf..c9205fb0ce 100644 --- a/java-client/src/generated/java/org/opensearch/client/opensearch/OpenSearchClientBase.java +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/OpenSearchClientBase.java @@ -37,10 +37,12 @@ package org.opensearch.client.opensearch; import java.io.IOException; +import java.util.function.Function; import javax.annotation.Generated; import javax.annotation.Nullable; import org.opensearch.client.ApiClient; import org.opensearch.client.opensearch._types.OpenSearchException; +import org.opensearch.client.opensearch.cat.OpenSearchCatClient; import org.opensearch.client.opensearch.cluster.OpenSearchClusterClient; import org.opensearch.client.opensearch.core.InfoRequest; import org.opensearch.client.opensearch.core.InfoResponse; @@ -53,6 +55,7 @@ import org.opensearch.client.opensearch.tasks.OpenSearchTasksClient; import org.opensearch.client.transport.OpenSearchTransport; import org.opensearch.client.transport.TransportOptions; +import org.opensearch.client.util.ObjectBuilder; /** * Client for the namespace. @@ -65,6 +68,10 @@ public OpenSearchClientBase(OpenSearchTransport transport, @Nullable TransportOp // ----- Child clients + public OpenSearchCatClient cat() { + return new OpenSearchCatClient(this.transport, this.transportOptions); + } + public OpenSearchClusterClient cluster() { return new OpenSearchClusterClient(this.transport, this.transportOptions); } @@ -102,7 +109,23 @@ public OpenSearchTasksClient tasks() { /** * Returns basic information about the cluster. */ - public InfoResponse info() throws IOException, OpenSearchException { - return this.transport.performRequest(InfoRequest._INSTANCE, InfoRequest._ENDPOINT, this.transportOptions); + public InfoResponse info(InfoRequest request) throws IOException, OpenSearchException { + return this.transport.performRequest(request, InfoRequest._ENDPOINT, this.transportOptions); + } + + /** + * Returns basic information about the cluster. + * + * @param fn a function that initializes a builder to create the {@link InfoRequest} + */ + public final InfoResponse info(Function> fn) throws IOException, OpenSearchException { + return info(fn.apply(new InfoRequest.Builder()).build()); + } + + /** + * Returns basic information about the cluster. + */ + public final InfoResponse info() throws IOException, OpenSearchException { + return info(new InfoRequest.Builder().build()); } } diff --git a/java-client/src/main/java/org/opensearch/client/opensearch/cat/AliasesRequest.java b/java-client/src/generated/java/org/opensearch/client/opensearch/cat/AliasesRequest.java similarity index 54% rename from java-client/src/main/java/org/opensearch/client/opensearch/cat/AliasesRequest.java rename to java-client/src/generated/java/org/opensearch/client/opensearch/cat/AliasesRequest.java index 8a8c226c8c..8e317c17cc 100644 --- a/java-client/src/main/java/org/opensearch/client/opensearch/cat/AliasesRequest.java +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/cat/AliasesRequest.java @@ -30,32 +30,42 @@ * GitHub history for details. */ +//---------------------------------------------------- +// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. +//---------------------------------------------------- + package org.opensearch.client.opensearch.cat; 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.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.ToCopyableBuilder; // typedef: cat.aliases.Request /** - * Shows information about currently configured aliases to indices including - * filter and routing infos. - * + * Shows information about aliases currently configured to indexes, including filter and routing information. */ +@Generated("org.opensearch.client.codegen.CodeGenerator") +public final class AliasesRequest extends CatRequestBase implements ToCopyableBuilder { -public class AliasesRequest extends CatRequestBase { + @Nonnull private final List expandWildcards; + @Nonnull private final List name; // --------------------------------------------------------------------------------------------- @@ -64,90 +74,147 @@ private AliasesRequest(Builder builder) { super(builder); this.expandWildcards = ApiTypeHelper.unmodifiable(builder.expandWildcards); this.name = ApiTypeHelper.unmodifiable(builder.name); - } - public static AliasesRequest of(Function> fn) { + public static AliasesRequest of(Function> fn) { return fn.apply(new Builder()).build(); } /** - * Whether to expand wildcard expression to concrete indices that are open, - * closed or both. + * Expands wildcard expressions to concrete indexes. Combine multiple values with commas. Supported values are all, + * open, closed, hidden, and none. *

* API name: {@code expand_wildcards} + *

*/ + @Nonnull public final List expandWildcards() { return this.expandWildcards; } /** - * A comma-separated list of alias names to return + * A comma-separated list of aliases to retrieve. Supports wildcards (*). To retrieve all aliases, omit this parameter or + * use * or _all. *

* API name: {@code name} + *

*/ + @Nonnull public final List name() { return this.name; } // --------------------------------------------------------------------------------------------- + @Override + @Nonnull + public Builder toBuilder() { + return new Builder(this); + } + + @Nonnull + public static Builder builder() { + return new Builder(); + } + /** * Builder for {@link AliasesRequest}. */ - - public static class Builder extends CatRequestBaseBuilder { + public static class Builder extends CatRequestBase.AbstractBuilder implements CopyableBuilder { @Nullable private List expandWildcards; - @Nullable private List name; + public Builder() {} + + private Builder(AliasesRequest o) { + super(o); + this.expandWildcards = _listCopy(o.expandWildcards); + this.name = _listCopy(o.name); + } + + private Builder(Builder o) { + super(o); + this.expandWildcards = _listCopy(o.expandWildcards); + this.name = _listCopy(o.name); + } + + @Override + @Nonnull + public Builder copy() { + return new Builder(this); + } + + @Override + @Nonnull + protected Builder self() { + return this; + } + /** - * Whether to expand wildcard expression to concrete indices that are open, - * closed or both. + * Expands wildcard expressions to concrete indexes. Combine multiple values with commas. Supported values are all, + * open, closed, hidden, and none. *

* 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. + * Expands wildcard expressions to concrete indexes. Combine multiple values with commas. Supported values are all, + * open, closed, hidden, and none. *

* 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; } /** - * A comma-separated list of alias names to return + * A comma-separated list of aliases to retrieve. Supports wildcards (*). To retrieve all aliases, omit this parameter + * or use * or _all. *

* API name: {@code name} + *

+ * *

* Adds all elements of list to name. + *

*/ + @Nonnull public final Builder name(List list) { this.name = _listAddAll(this.name, list); return this; } /** - * A comma-separated list of alias names to return + * A comma-separated list of aliases to retrieve. Supports wildcards (*). To retrieve all aliases, omit this parameter + * or use * or _all. *

* API name: {@code name} + *

+ * *

* Adds one or more values to name. + *

*/ + @Nonnull public final Builder name(String value, String... values) { this.name = _listAdd(this.name, value, values); return this; @@ -156,34 +223,33 @@ public final Builder name(String value, String... values) { /** * Builds a {@link AliasesRequest}. * - * @throws NullPointerException - * if some of the required fields are null. + * @throws NullPointerException if some of the required fields are null. */ + @Override + @Nonnull public AliasesRequest build() { _checkSingleUse(); return new AliasesRequest(this); } - - @Override - protected Builder self() { - return this; - } } // --------------------------------------------------------------------------------------------- + @Override + protected void applyQueryParameters(@Nonnull Map params) { + super.applyQueryParameters(params); + if (ApiTypeHelper.isDefined(this.expandWildcards)) { + params.put("expand_wildcards", this.expandWildcards.stream().map(v -> v.jsonValue()).collect(Collectors.joining(","))); + } + } + /** * Endpoint "{@code cat.aliases}". */ public static final Endpoint _ENDPOINT = new SimpleEndpoint<>( - // Request method - request -> { - return "GET"; - - }, - + request -> "GET", // Request path request -> { final int _name = 1 << 0; @@ -193,34 +259,41 @@ protected Builder self() { if (ApiTypeHelper.isDefined(request.name())) propsSet |= _name; if (propsSet == 0) { - StringBuilder buf = new StringBuilder(); - buf.append("/_cat"); - buf.append("/aliases"); - return buf.toString(); + return "/_cat/aliases"; } if (propsSet == (_name)) { StringBuilder buf = new StringBuilder(); - buf.append("/_cat"); - buf.append("/aliases"); - buf.append("/"); - SimpleEndpoint.pathEncode(request.name.stream().map(v -> v).collect(Collectors.joining(",")), buf); + buf.append("/_cat/aliases/"); + SimpleEndpoint.pathEncode(String.join(",", request.name), buf); return buf.toString(); } - throw SimpleEndpoint.noPathTemplateFound("path"); + throw SimpleEndpoint.noPathTemplateFound("path"); }, - // Request parameters request -> { - Map params = new HashMap<>(request.queryParameters()); - if (ApiTypeHelper.isDefined(request.expandWildcards)) { - params.put("expand_wildcards", request.expandWildcards.stream().map(v -> v.jsonValue()).collect(Collectors.joining(","))); - } + Map params = new HashMap<>(); + request.applyQueryParameters(params); return params; - }, SimpleEndpoint.emptyMap(), false, AliasesResponse._DESERIALIZER ); + + @Override + public int hashCode() { + int result = 17; + result = 31 * result + Objects.hashCode(this.expandWildcards); + 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; + AliasesRequest other = (AliasesRequest) o; + return Objects.equals(this.expandWildcards, other.expandWildcards) && Objects.equals(this.name, other.name); + } } diff --git a/java-client/src/main/java/org/opensearch/client/opensearch/cat/AliasesResponse.java b/java-client/src/generated/java/org/opensearch/client/opensearch/cat/AliasesResponse.java similarity index 75% rename from java-client/src/main/java/org/opensearch/client/opensearch/cat/AliasesResponse.java rename to java-client/src/generated/java/org/opensearch/client/opensearch/cat/AliasesResponse.java index 9988b93b0c..31c2ac2c98 100644 --- a/java-client/src/main/java/org/opensearch/client/opensearch/cat/AliasesResponse.java +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/cat/AliasesResponse.java @@ -30,43 +30,51 @@ * GitHub history for details. */ +//---------------------------------------------------- +// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. +//---------------------------------------------------- + package org.opensearch.client.opensearch.cat; 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; import org.opensearch.client.json.PlainJsonSerializable; import org.opensearch.client.opensearch.cat.aliases.AliasesRecord; 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: cat.aliases.Response @JsonpDeserializable -public class AliasesResponse implements PlainJsonSerializable { +@Generated("org.opensearch.client.codegen.CodeGenerator") +public class AliasesResponse implements PlainJsonSerializable, ToCopyableBuilder { + + @Nonnull private final List valueBody; // --------------------------------------------------------------------------------------------- private AliasesResponse(Builder builder) { - this.valueBody = ApiTypeHelper.unmodifiableRequired(builder.valueBody, this, "valueBody"); - } - public static AliasesResponse of(Function> fn) { + public static AliasesResponse of(Function> fn) { return fn.apply(new Builder()).build(); } /** * Required - Response value. - *

- * API name: {@code _value_body} */ + @Nonnull public final List valueBody() { return this.valueBody; } @@ -78,28 +86,53 @@ public void serialize(JsonGenerator generator, JsonpMapper mapper) { generator.writeStartArray(); for (AliasesRecord item0 : this.valueBody) { 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 AliasesResponse}. */ - - public static class Builder extends ObjectBuilderBase implements ObjectBuilder { + public static class Builder extends ObjectBuilderBase implements CopyableBuilder { private List valueBody; + public Builder() {} + + private Builder(AliasesResponse o) { + this.valueBody = _listCopy(o.valueBody); + } + + private Builder(Builder o) { + this.valueBody = _listCopy(o.valueBody); + } + + @Override + @Nonnull + public Builder copy() { + return new Builder(this); + } + /** * Required - Response value. - *

- * API name: {@code _value_body} + * *

* Adds all elements of list to valueBody. + *

*/ + @Nonnull public final Builder valueBody(List list) { this.valueBody = _listAddAll(this.valueBody, list); return this; @@ -107,11 +140,12 @@ public final Builder valueBody(List list) { /** * Required - Response value. - *

- * API name: {@code _value_body} + * *

* Adds one or more values to valueBody. + *

*/ + @Nonnull public final Builder valueBody(AliasesRecord value, AliasesRecord... values) { this.valueBody = _listAdd(this.valueBody, value, values); return this; @@ -119,11 +153,12 @@ public final Builder valueBody(AliasesRecord value, AliasesRecord... values) { /** * Required - Response value. - *

- * API name: {@code _value_body} + * *

* Adds a value to valueBody using a builder lambda. + *

*/ + @Nonnull public final Builder valueBody(Function> fn) { return valueBody(fn.apply(new AliasesRecord.Builder()).build()); } @@ -131,9 +166,10 @@ public final Builder valueBody(Function _DESERIALIZER = createAliasesResponseDeserializer(); protected static JsonpDeserializer createAliasesResponseDeserializer() { - JsonpDeserializer> valueDeserializer = JsonpDeserializer.arrayDeserializer(AliasesRecord._DESERIALIZER); return JsonpDeserializer.of( @@ -152,5 +187,4 @@ protected static JsonpDeserializer createAliasesResponseDeseria (parser, mapper) -> new Builder().valueBody(valueDeserializer.deserialize(parser, mapper)).build() ); } - } diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/cat/OpenSearchCatAsyncClientBase.java b/java-client/src/generated/java/org/opensearch/client/opensearch/cat/OpenSearchCatAsyncClientBase.java new file mode 100644 index 0000000000..587f11d1ac --- /dev/null +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/cat/OpenSearchCatAsyncClientBase.java @@ -0,0 +1,86 @@ +/* + * SPDX-License-Identifier: Apache-2.0 + * + * The OpenSearch Contributors require contributions made to + * this file be licensed under the Apache-2.0 license or a + * compatible open source license. + */ + +/* + * Licensed to Elasticsearch B.V. under one or more contributor + * license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright + * ownership. Elasticsearch B.V. licenses this file to you under + * the Apache License, Version 2.0 (the "License"); you may + * not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +/* + * Modifications Copyright OpenSearch Contributors. See + * GitHub history for details. + */ + +//---------------------------------------------------- +// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. +//---------------------------------------------------- + +package org.opensearch.client.opensearch.cat; + +import java.io.IOException; +import java.util.concurrent.CompletableFuture; +import java.util.function.Function; +import javax.annotation.Generated; +import javax.annotation.Nullable; +import org.opensearch.client.ApiClient; +import org.opensearch.client.opensearch._types.OpenSearchException; +import org.opensearch.client.transport.OpenSearchTransport; +import org.opensearch.client.transport.TransportOptions; +import org.opensearch.client.util.ObjectBuilder; + +/** + * Client for the cat namespace. + */ +@Generated("org.opensearch.client.codegen.CodeGenerator") +public abstract class OpenSearchCatAsyncClientBase> extends ApiClient< + OpenSearchTransport, + Self> { + public OpenSearchCatAsyncClientBase(OpenSearchTransport transport, @Nullable TransportOptions transportOptions) { + super(transport, transportOptions); + } + + // ----- Endpoint: cat.aliases + + /** + * Shows information about aliases currently configured to indexes, including filter and routing information. + */ + public CompletableFuture aliases(AliasesRequest request) throws IOException, OpenSearchException { + return this.transport.performRequestAsync(request, AliasesRequest._ENDPOINT, this.transportOptions); + } + + /** + * Shows information about aliases currently configured to indexes, including filter and routing information. + * + * @param fn a function that initializes a builder to create the {@link AliasesRequest} + */ + public final CompletableFuture aliases(Function> fn) + throws IOException, OpenSearchException { + return aliases(fn.apply(new AliasesRequest.Builder()).build()); + } + + /** + * Shows information about aliases currently configured to indexes, including filter and routing information. + */ + public final CompletableFuture aliases() throws IOException, OpenSearchException { + return aliases(new AliasesRequest.Builder().build()); + } +} diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/cat/OpenSearchCatClientBase.java b/java-client/src/generated/java/org/opensearch/client/opensearch/cat/OpenSearchCatClientBase.java new file mode 100644 index 0000000000..754a61570a --- /dev/null +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/cat/OpenSearchCatClientBase.java @@ -0,0 +1,83 @@ +/* + * SPDX-License-Identifier: Apache-2.0 + * + * The OpenSearch Contributors require contributions made to + * this file be licensed under the Apache-2.0 license or a + * compatible open source license. + */ + +/* + * Licensed to Elasticsearch B.V. under one or more contributor + * license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright + * ownership. Elasticsearch B.V. licenses this file to you under + * the Apache License, Version 2.0 (the "License"); you may + * not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +/* + * Modifications Copyright OpenSearch Contributors. See + * GitHub history for details. + */ + +//---------------------------------------------------- +// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. +//---------------------------------------------------- + +package org.opensearch.client.opensearch.cat; + +import java.io.IOException; +import java.util.function.Function; +import javax.annotation.Generated; +import javax.annotation.Nullable; +import org.opensearch.client.ApiClient; +import org.opensearch.client.opensearch._types.OpenSearchException; +import org.opensearch.client.transport.OpenSearchTransport; +import org.opensearch.client.transport.TransportOptions; +import org.opensearch.client.util.ObjectBuilder; + +/** + * Client for the cat namespace. + */ +@Generated("org.opensearch.client.codegen.CodeGenerator") +public abstract class OpenSearchCatClientBase> extends ApiClient { + public OpenSearchCatClientBase(OpenSearchTransport transport, @Nullable TransportOptions transportOptions) { + super(transport, transportOptions); + } + + // ----- Endpoint: cat.aliases + + /** + * Shows information about aliases currently configured to indexes, including filter and routing information. + */ + public AliasesResponse aliases(AliasesRequest request) throws IOException, OpenSearchException { + return this.transport.performRequest(request, AliasesRequest._ENDPOINT, this.transportOptions); + } + + /** + * Shows information about aliases currently configured to indexes, including filter and routing information. + * + * @param fn a function that initializes a builder to create the {@link AliasesRequest} + */ + public final AliasesResponse aliases(Function> fn) throws IOException, + OpenSearchException { + return aliases(fn.apply(new AliasesRequest.Builder()).build()); + } + + /** + * Shows information about aliases currently configured to indexes, including filter and routing information. + */ + public final AliasesResponse aliases() throws IOException, OpenSearchException { + return aliases(new AliasesRequest.Builder().build()); + } +} diff --git a/java-client/src/main/java/org/opensearch/client/opensearch/cat/aliases/AliasesRecord.java b/java-client/src/generated/java/org/opensearch/client/opensearch/cat/aliases/AliasesRecord.java similarity index 70% rename from java-client/src/main/java/org/opensearch/client/opensearch/cat/aliases/AliasesRecord.java rename to java-client/src/generated/java/org/opensearch/client/opensearch/cat/aliases/AliasesRecord.java index 54c40dc8d1..afbedc8f78 100644 --- a/java-client/src/main/java/org/opensearch/client/opensearch/cat/aliases/AliasesRecord.java +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/cat/aliases/AliasesRecord.java @@ -30,10 +30,17 @@ * GitHub history for details. */ +//---------------------------------------------------- +// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. +//---------------------------------------------------- + package org.opensearch.client.opensearch.cat.aliases; import jakarta.json.stream.JsonGenerator; +import java.util.Objects; import java.util.function.Function; +import javax.annotation.Generated; +import javax.annotation.Nonnull; import javax.annotation.Nullable; import org.opensearch.client.json.JsonpDeserializable; import org.opensearch.client.json.JsonpDeserializer; @@ -41,21 +48,28 @@ import org.opensearch.client.json.ObjectBuilderDeserializer; import org.opensearch.client.json.ObjectDeserializer; import org.opensearch.client.json.PlainJsonSerializable; +import org.opensearch.client.util.CopyableBuilder; import org.opensearch.client.util.ObjectBuilder; import org.opensearch.client.util.ObjectBuilderBase; +import org.opensearch.client.util.ToCopyableBuilder; // typedef: cat.aliases.AliasesRecord @JsonpDeserializable -public class AliasesRecord implements PlainJsonSerializable { +@Generated("org.opensearch.client.codegen.CodeGenerator") +public class AliasesRecord implements PlainJsonSerializable, ToCopyableBuilder { + @Nullable private final String alias; + @Nullable + private final String filter; + @Nullable private final String index; @Nullable - private final String filter; + private final String isWriteIndex; @Nullable private final String routingIndex; @@ -63,23 +77,18 @@ public class AliasesRecord implements PlainJsonSerializable { @Nullable private final String routingSearch; - @Nullable - private final String isWriteIndex; - // --------------------------------------------------------------------------------------------- private AliasesRecord(Builder builder) { - this.alias = builder.alias; - this.index = builder.index; this.filter = builder.filter; + this.index = builder.index; + this.isWriteIndex = builder.isWriteIndex; this.routingIndex = builder.routingIndex; this.routingSearch = builder.routingSearch; - this.isWriteIndex = builder.isWriteIndex; - } - public static AliasesRecord of(Function> fn) { + public static AliasesRecord of(Function> fn) { return fn.apply(new Builder()).build(); } @@ -87,6 +96,7 @@ public static AliasesRecord of(Function> f * alias name *

* API name: {@code alias} + *

*/ @Nullable public final String alias() { @@ -94,8 +104,17 @@ public final String alias() { } /** - * index alias points to + * filter *

+ * API name: {@code filter} + *

+ */ + @Nullable + public final String filter() { + return this.filter; + } + + /** * API name: {@code index} */ @Nullable @@ -104,19 +123,21 @@ public final String index() { } /** - * filter + * write index *

- * API name: {@code filter} + * API name: {@code is_write_index} + *

*/ @Nullable - public final String filter() { - return this.filter; + public final String isWriteIndex() { + return this.isWriteIndex; } /** * index routing *

* API name: {@code routing.index} + *

*/ @Nullable public final String routingIndex() { @@ -127,25 +148,17 @@ public final String routingIndex() { * search routing *

* API name: {@code routing.search} + *

*/ @Nullable public final String routingSearch() { return this.routingSearch; } - /** - * write index - *

- * API name: {@code is_write_index} - */ - @Nullable - public final String isWriteIndex() { - return this.isWriteIndex; - } - /** * Serialize this object to JSON. */ + @Override public void serialize(JsonGenerator generator, JsonpMapper mapper) { generator.writeStartObject(); serializeInternal(generator, mapper); @@ -153,92 +166,135 @@ public void serialize(JsonGenerator generator, JsonpMapper mapper) { } protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { - if (this.alias != null) { generator.writeKey("alias"); generator.write(this.alias); + } + if (this.filter != null) { + generator.writeKey("filter"); + generator.write(this.filter); } + if (this.index != null) { generator.writeKey("index"); generator.write(this.index); - } - if (this.filter != null) { - generator.writeKey("filter"); - generator.write(this.filter); + if (this.isWriteIndex != null) { + generator.writeKey("is_write_index"); + generator.write(this.isWriteIndex); } + if (this.routingIndex != null) { generator.writeKey("routing.index"); generator.write(this.routingIndex); - } + if (this.routingSearch != null) { generator.writeKey("routing.search"); generator.write(this.routingSearch); - } - if (this.isWriteIndex != null) { - generator.writeKey("is_write_index"); - generator.write(this.isWriteIndex); + } - } + // --------------------------------------------------------------------------------------------- + @Override + @Nonnull + public Builder toBuilder() { + return new Builder(this); } - // --------------------------------------------------------------------------------------------- + @Nonnull + public static Builder builder() { + return new Builder(); + } /** * Builder for {@link AliasesRecord}. */ - - public static class Builder extends ObjectBuilderBase implements ObjectBuilder { + public static class Builder extends ObjectBuilderBase implements CopyableBuilder { @Nullable private String alias; - + @Nullable + private String filter; @Nullable private String index; - @Nullable - private String filter; - + private String isWriteIndex; @Nullable private String routingIndex; - @Nullable private String routingSearch; - @Nullable - private String isWriteIndex; + public Builder() {} + + private Builder(AliasesRecord o) { + this.alias = o.alias; + this.filter = o.filter; + this.index = o.index; + this.isWriteIndex = o.isWriteIndex; + this.routingIndex = o.routingIndex; + this.routingSearch = o.routingSearch; + } + + private Builder(Builder o) { + this.alias = o.alias; + this.filter = o.filter; + this.index = o.index; + this.isWriteIndex = o.isWriteIndex; + this.routingIndex = o.routingIndex; + this.routingSearch = o.routingSearch; + } + + @Override + @Nonnull + public Builder copy() { + return new Builder(this); + } /** * alias name *

* API name: {@code alias} + *

*/ + @Nonnull public final Builder alias(@Nullable String value) { this.alias = value; return this; } /** - * index alias points to + * filter *

+ * API name: {@code filter} + *

+ */ + @Nonnull + public final Builder filter(@Nullable String value) { + this.filter = value; + return this; + } + + /** * API name: {@code index} */ + @Nonnull public final Builder index(@Nullable String value) { this.index = value; return this; } /** - * filter + * write index *

- * API name: {@code filter} + * API name: {@code is_write_index} + *

*/ - public final Builder filter(@Nullable String value) { - this.filter = value; + @Nonnull + public final Builder isWriteIndex(@Nullable String value) { + this.isWriteIndex = value; return this; } @@ -246,7 +302,9 @@ public final Builder filter(@Nullable String value) { * index routing *

* API name: {@code routing.index} + *

*/ + @Nonnull public final Builder routingIndex(@Nullable String value) { this.routingIndex = value; return this; @@ -256,28 +314,21 @@ public final Builder routingIndex(@Nullable String value) { * search routing *

* API name: {@code routing.search} + *

*/ + @Nonnull public final Builder routingSearch(@Nullable String value) { this.routingSearch = value; return this; } - /** - * write index - *

- * API name: {@code is_write_index} - */ - public final Builder isWriteIndex(@Nullable String value) { - this.isWriteIndex = value; - return this; - } - /** * Builds a {@link AliasesRecord}. * - * @throws NullPointerException - * if some of the required fields are null. + * @throws NullPointerException if some of the required fields are null. */ + @Override + @Nonnull public AliasesRecord build() { _checkSingleUse(); @@ -296,14 +347,36 @@ public AliasesRecord build() { ); protected static void setupAliasesRecordDeserializer(ObjectDeserializer op) { + op.add(Builder::alias, JsonpDeserializer.stringDeserializer(), "alias"); + op.add(Builder::filter, JsonpDeserializer.stringDeserializer(), "filter"); + op.add(Builder::index, JsonpDeserializer.stringDeserializer(), "index"); + op.add(Builder::isWriteIndex, JsonpDeserializer.stringDeserializer(), "is_write_index"); + op.add(Builder::routingIndex, JsonpDeserializer.stringDeserializer(), "routing.index"); + op.add(Builder::routingSearch, JsonpDeserializer.stringDeserializer(), "routing.search"); + } - op.add(Builder::alias, JsonpDeserializer.stringDeserializer(), "alias", "a"); - op.add(Builder::index, JsonpDeserializer.stringDeserializer(), "index", "i", "idx"); - op.add(Builder::filter, JsonpDeserializer.stringDeserializer(), "filter", "f", "fi"); - op.add(Builder::routingIndex, JsonpDeserializer.stringDeserializer(), "routing.index", "ri", "routingIndex"); - op.add(Builder::routingSearch, JsonpDeserializer.stringDeserializer(), "routing.search", "rs", "routingSearch"); - op.add(Builder::isWriteIndex, JsonpDeserializer.stringDeserializer(), "is_write_index", "w", "isWriteIndex"); - + @Override + public int hashCode() { + int result = 17; + result = 31 * result + Objects.hashCode(this.alias); + result = 31 * result + Objects.hashCode(this.filter); + result = 31 * result + Objects.hashCode(this.index); + result = 31 * result + Objects.hashCode(this.isWriteIndex); + result = 31 * result + Objects.hashCode(this.routingIndex); + result = 31 * result + Objects.hashCode(this.routingSearch); + return result; } + @Override + public boolean equals(Object o) { + if (this == o) return true; + if (o == null || this.getClass() != o.getClass()) return false; + AliasesRecord other = (AliasesRecord) o; + return Objects.equals(this.alias, other.alias) + && Objects.equals(this.filter, other.filter) + && Objects.equals(this.index, other.index) + && Objects.equals(this.isWriteIndex, other.isWriteIndex) + && Objects.equals(this.routingIndex, other.routingIndex) + && Objects.equals(this.routingSearch, other.routingSearch); + } } diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/cluster/AllocationExplainRequest.java b/java-client/src/generated/java/org/opensearch/client/opensearch/cluster/AllocationExplainRequest.java index 82be688d25..559e882753 100644 --- a/java-client/src/generated/java/org/opensearch/client/opensearch/cluster/AllocationExplainRequest.java +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/cluster/AllocationExplainRequest.java @@ -56,7 +56,6 @@ 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.allocation_explain.Request @@ -66,7 +65,7 @@ */ @JsonpDeserializable @Generated("org.opensearch.client.codegen.CodeGenerator") -public class AllocationExplainRequest extends RequestBase +public final class AllocationExplainRequest extends RequestBase implements PlainJsonSerializable, ToCopyableBuilder { @@ -92,6 +91,7 @@ public class AllocationExplainRequest extends RequestBase // --------------------------------------------------------------------------------------------- private AllocationExplainRequest(Builder builder) { + super(builder); this.currentNode = builder.currentNode; this.includeDiskInfo = builder.includeDiskInfo; this.includeYesDecisions = builder.includeYesDecisions; @@ -214,7 +214,7 @@ public static Builder builder() { /** * Builder for {@link AllocationExplainRequest}. */ - public static class Builder extends ObjectBuilderBase implements CopyableBuilder { + public static class Builder extends RequestBase.AbstractBuilder implements CopyableBuilder { @Nullable private String currentNode; @Nullable @@ -231,6 +231,7 @@ public static class Builder extends ObjectBuilderBase implements CopyableBuilder public Builder() {} private Builder(AllocationExplainRequest o) { + super(o); this.currentNode = o.currentNode; this.includeDiskInfo = o.includeDiskInfo; this.includeYesDecisions = o.includeYesDecisions; @@ -240,6 +241,7 @@ private Builder(AllocationExplainRequest o) { } private Builder(Builder o) { + super(o); this.currentNode = o.currentNode; this.includeDiskInfo = o.includeDiskInfo; this.includeYesDecisions = o.includeYesDecisions; @@ -254,6 +256,12 @@ public Builder copy() { return new Builder(this); } + @Override + @Nonnull + protected Builder self() { + return this; + } + /** * Specifies the node ID or the name of the node to only explain a shard that is currently located on the specified node. *

@@ -356,6 +364,17 @@ protected static void setupAllocationExplainRequestDeserializer(ObjectDeserializ // --------------------------------------------------------------------------------------------- + @Override + protected void applyQueryParameters(@Nonnull Map params) { + super.applyQueryParameters(params); + if (this.includeDiskInfo != null) { + params.put("include_disk_info", String.valueOf(this.includeDiskInfo)); + } + if (this.includeYesDecisions != null) { + params.put("include_yes_decisions", String.valueOf(this.includeYesDecisions)); + } + } + /** * Endpoint "{@code cluster.allocation_explain}". */ @@ -367,12 +386,7 @@ protected static void setupAllocationExplainRequestDeserializer(ObjectDeserializ // Request parameters request -> { Map params = new HashMap<>(); - if (request.includeDiskInfo != null) { - params.put("include_disk_info", String.valueOf(request.includeDiskInfo)); - } - if (request.includeYesDecisions != null) { - params.put("include_yes_decisions", String.valueOf(request.includeYesDecisions)); - } + request.applyQueryParameters(params); return params; }, SimpleEndpoint.emptyMap(), diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/cluster/ClusterStatsRequest.java b/java-client/src/generated/java/org/opensearch/client/opensearch/cluster/ClusterStatsRequest.java index 12ad974985..d93b69d5d5 100644 --- a/java-client/src/generated/java/org/opensearch/client/opensearch/cluster/ClusterStatsRequest.java +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/cluster/ClusterStatsRequest.java @@ -55,7 +55,6 @@ import org.opensearch.client.util.ApiTypeHelper; import org.opensearch.client.util.CopyableBuilder; import org.opensearch.client.util.ObjectBuilder; -import org.opensearch.client.util.ObjectBuilderBase; import org.opensearch.client.util.ToCopyableBuilder; // typedef: cluster.stats.Request @@ -64,7 +63,7 @@ * Returns high-level overview of cluster statistics. */ @Generated("org.opensearch.client.codegen.CodeGenerator") -public class ClusterStatsRequest extends RequestBase implements ToCopyableBuilder { +public final class ClusterStatsRequest extends RequestBase implements ToCopyableBuilder { @Nullable private final Boolean flatSettings; @@ -84,6 +83,7 @@ public class ClusterStatsRequest extends RequestBase implements ToCopyableBuilde // --------------------------------------------------------------------------------------------- private ClusterStatsRequest(Builder builder) { + super(builder); this.flatSettings = builder.flatSettings; this.indexMetric = ApiTypeHelper.unmodifiable(builder.indexMetric); this.metric = ApiTypeHelper.unmodifiable(builder.metric); @@ -168,7 +168,7 @@ public static Builder builder() { /** * Builder for {@link ClusterStatsRequest}. */ - public static class Builder extends ObjectBuilderBase implements CopyableBuilder { + public static class Builder extends RequestBase.AbstractBuilder implements CopyableBuilder { @Nullable private Boolean flatSettings; @Nullable @@ -183,6 +183,7 @@ public static class Builder extends ObjectBuilderBase implements CopyableBuilder public Builder() {} private Builder(ClusterStatsRequest o) { + super(o); this.flatSettings = o.flatSettings; this.indexMetric = _listCopy(o.indexMetric); this.metric = _listCopy(o.metric); @@ -191,6 +192,7 @@ private Builder(ClusterStatsRequest o) { } private Builder(Builder o) { + super(o); this.flatSettings = o.flatSettings; this.indexMetric = _listCopy(o.indexMetric); this.metric = _listCopy(o.metric); @@ -204,6 +206,12 @@ public Builder copy() { return new Builder(this); } + @Override + @Nonnull + protected Builder self() { + return this; + } + /** * If true, returns settings in flat format. *

@@ -355,6 +363,17 @@ public ClusterStatsRequest build() { // --------------------------------------------------------------------------------------------- + @Override + protected void applyQueryParameters(@Nonnull Map params) { + super.applyQueryParameters(params); + if (this.flatSettings != null) { + params.put("flat_settings", String.valueOf(this.flatSettings)); + } + if (this.timeout != null) { + params.put("timeout", this.timeout._toJsonString()); + } + } + /** * Endpoint "{@code cluster.stats}". */ @@ -406,12 +425,7 @@ public ClusterStatsRequest build() { // Request parameters request -> { Map params = new HashMap<>(); - if (request.flatSettings != null) { - params.put("flat_settings", String.valueOf(request.flatSettings)); - } - if (request.timeout != null) { - params.put("timeout", request.timeout._toJsonString()); - } + request.applyQueryParameters(params); return params; }, SimpleEndpoint.emptyMap(), diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/cluster/DeleteComponentTemplateRequest.java b/java-client/src/generated/java/org/opensearch/client/opensearch/cluster/DeleteComponentTemplateRequest.java index 8e0ec5708b..42314b2414 100644 --- a/java-client/src/generated/java/org/opensearch/client/opensearch/cluster/DeleteComponentTemplateRequest.java +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/cluster/DeleteComponentTemplateRequest.java @@ -51,7 +51,6 @@ 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 @@ -60,7 +59,7 @@ * Deletes a component template. */ @Generated("org.opensearch.client.codegen.CodeGenerator") -public class DeleteComponentTemplateRequest extends RequestBase +public final class DeleteComponentTemplateRequest extends RequestBase implements ToCopyableBuilder { @@ -80,6 +79,7 @@ public class DeleteComponentTemplateRequest extends RequestBase // --------------------------------------------------------------------------------------------- private DeleteComponentTemplateRequest(Builder builder) { + super(builder); this.clusterManagerTimeout = builder.clusterManagerTimeout; this.masterTimeout = builder.masterTimeout; this.name = ApiTypeHelper.requireNonNull(builder.name, this, "name"); @@ -154,7 +154,9 @@ public static Builder builder() { /** * Builder for {@link DeleteComponentTemplateRequest}. */ - public static class Builder extends ObjectBuilderBase implements CopyableBuilder { + public static class Builder extends RequestBase.AbstractBuilder + implements + CopyableBuilder { @Nullable private Time clusterManagerTimeout; @Nullable @@ -166,6 +168,7 @@ public static class Builder extends ObjectBuilderBase implements CopyableBuilder public Builder() {} private Builder(DeleteComponentTemplateRequest o) { + super(o); this.clusterManagerTimeout = o.clusterManagerTimeout; this.masterTimeout = o.masterTimeout; this.name = o.name; @@ -173,6 +176,7 @@ private Builder(DeleteComponentTemplateRequest o) { } private Builder(Builder o) { + super(o); this.clusterManagerTimeout = o.clusterManagerTimeout; this.masterTimeout = o.masterTimeout; this.name = o.name; @@ -185,6 +189,12 @@ public Builder copy() { return new Builder(this); } + @Override + @Nonnull + protected Builder self() { + return this; + } + /** * Operation timeout for connection to cluster-manager node. *

@@ -286,6 +296,20 @@ public DeleteComponentTemplateRequest build() { // --------------------------------------------------------------------------------------------- + @Override + protected void applyQueryParameters(@Nonnull Map params) { + super.applyQueryParameters(params); + if (this.clusterManagerTimeout != null) { + params.put("cluster_manager_timeout", this.clusterManagerTimeout._toJsonString()); + } + if (this.masterTimeout != null) { + params.put("master_timeout", this.masterTimeout._toJsonString()); + } + if (this.timeout != null) { + params.put("timeout", this.timeout._toJsonString()); + } + } + /** * Endpoint "{@code cluster.delete_component_template}". */ @@ -303,15 +327,7 @@ public DeleteComponentTemplateRequest build() { // Request parameters request -> { Map params = new HashMap<>(); - 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()); - } + request.applyQueryParameters(params); return params; }, SimpleEndpoint.emptyMap(), diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/cluster/DeleteVotingConfigExclusionsRequest.java b/java-client/src/generated/java/org/opensearch/client/opensearch/cluster/DeleteVotingConfigExclusionsRequest.java index 5fd9c2ac0a..07d115512a 100644 --- a/java-client/src/generated/java/org/opensearch/client/opensearch/cluster/DeleteVotingConfigExclusionsRequest.java +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/cluster/DeleteVotingConfigExclusionsRequest.java @@ -51,7 +51,6 @@ 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 @@ -60,7 +59,7 @@ * Clears cluster voting config exclusions. */ @Generated("org.opensearch.client.codegen.CodeGenerator") -public class DeleteVotingConfigExclusionsRequest extends RequestBase +public final class DeleteVotingConfigExclusionsRequest extends RequestBase implements ToCopyableBuilder { @@ -70,6 +69,7 @@ public class DeleteVotingConfigExclusionsRequest extends RequestBase // --------------------------------------------------------------------------------------------- private DeleteVotingConfigExclusionsRequest(Builder builder) { + super(builder); this.waitForRemoval = builder.waitForRemoval; } @@ -108,17 +108,21 @@ public static Builder builder() { /** * Builder for {@link DeleteVotingConfigExclusionsRequest}. */ - public static class Builder extends ObjectBuilderBase implements CopyableBuilder { + public static class Builder extends RequestBase.AbstractBuilder + implements + CopyableBuilder { @Nullable private Boolean waitForRemoval; public Builder() {} private Builder(DeleteVotingConfigExclusionsRequest o) { + super(o); this.waitForRemoval = o.waitForRemoval; } private Builder(Builder o) { + super(o); this.waitForRemoval = o.waitForRemoval; } @@ -128,6 +132,12 @@ public Builder copy() { return new Builder(this); } + @Override + @Nonnull + protected Builder self() { + return 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 @@ -159,6 +169,14 @@ public DeleteVotingConfigExclusionsRequest build() { // --------------------------------------------------------------------------------------------- + @Override + protected void applyQueryParameters(@Nonnull Map params) { + super.applyQueryParameters(params); + if (this.waitForRemoval != null) { + params.put("wait_for_removal", String.valueOf(this.waitForRemoval)); + } + } + /** * Endpoint "{@code cluster.delete_voting_config_exclusions}". */ @@ -170,9 +188,7 @@ public DeleteVotingConfigExclusionsRequest build() { // Request parameters request -> { Map params = new HashMap<>(); - if (request.waitForRemoval != null) { - params.put("wait_for_removal", String.valueOf(request.waitForRemoval)); - } + request.applyQueryParameters(params); return params; }, SimpleEndpoint.emptyMap() diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/cluster/ExistsComponentTemplateRequest.java b/java-client/src/generated/java/org/opensearch/client/opensearch/cluster/ExistsComponentTemplateRequest.java index 914e5a2313..752130a6e7 100644 --- a/java-client/src/generated/java/org/opensearch/client/opensearch/cluster/ExistsComponentTemplateRequest.java +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/cluster/ExistsComponentTemplateRequest.java @@ -53,7 +53,6 @@ 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 @@ -62,7 +61,7 @@ * Returns information about whether a particular component template exist. */ @Generated("org.opensearch.client.codegen.CodeGenerator") -public class ExistsComponentTemplateRequest extends RequestBase +public final class ExistsComponentTemplateRequest extends RequestBase implements ToCopyableBuilder { @@ -82,6 +81,7 @@ public class ExistsComponentTemplateRequest extends RequestBase // --------------------------------------------------------------------------------------------- private ExistsComponentTemplateRequest(Builder builder) { + super(builder); this.clusterManagerTimeout = builder.clusterManagerTimeout; this.local = builder.local; this.masterTimeout = builder.masterTimeout; @@ -157,7 +157,9 @@ public static Builder builder() { /** * Builder for {@link ExistsComponentTemplateRequest}. */ - public static class Builder extends ObjectBuilderBase implements CopyableBuilder { + public static class Builder extends RequestBase.AbstractBuilder + implements + CopyableBuilder { @Nullable private Time clusterManagerTimeout; @Nullable @@ -169,6 +171,7 @@ public static class Builder extends ObjectBuilderBase implements CopyableBuilder public Builder() {} private Builder(ExistsComponentTemplateRequest o) { + super(o); this.clusterManagerTimeout = o.clusterManagerTimeout; this.local = o.local; this.masterTimeout = o.masterTimeout; @@ -176,6 +179,7 @@ private Builder(ExistsComponentTemplateRequest o) { } private Builder(Builder o) { + super(o); this.clusterManagerTimeout = o.clusterManagerTimeout; this.local = o.local; this.masterTimeout = o.masterTimeout; @@ -188,6 +192,12 @@ public Builder copy() { return new Builder(this); } + @Override + @Nonnull + protected Builder self() { + return this; + } + /** * Operation timeout for connection to cluster-manager node. *

@@ -279,6 +289,20 @@ public ExistsComponentTemplateRequest build() { // --------------------------------------------------------------------------------------------- + @Override + protected void applyQueryParameters(@Nonnull Map params) { + super.applyQueryParameters(params); + if (this.clusterManagerTimeout != null) { + params.put("cluster_manager_timeout", this.clusterManagerTimeout._toJsonString()); + } + if (this.local != null) { + params.put("local", String.valueOf(this.local)); + } + if (this.masterTimeout != null) { + params.put("master_timeout", this.masterTimeout._toJsonString()); + } + } + /** * Endpoint "{@code cluster.exists_component_template}". */ @@ -295,15 +319,7 @@ public ExistsComponentTemplateRequest build() { // Request parameters request -> { Map params = new HashMap<>(); - 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()); - } + request.applyQueryParameters(params); return params; }, SimpleEndpoint.emptyMap() diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/cluster/GetClusterSettingsRequest.java b/java-client/src/generated/java/org/opensearch/client/opensearch/cluster/GetClusterSettingsRequest.java index a8624547b1..4e0b6f49bc 100644 --- a/java-client/src/generated/java/org/opensearch/client/opensearch/cluster/GetClusterSettingsRequest.java +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/cluster/GetClusterSettingsRequest.java @@ -50,7 +50,6 @@ 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 @@ -59,7 +58,7 @@ * Returns cluster settings. */ @Generated("org.opensearch.client.codegen.CodeGenerator") -public class GetClusterSettingsRequest extends RequestBase +public final class GetClusterSettingsRequest extends RequestBase implements ToCopyableBuilder { @@ -82,6 +81,7 @@ public class GetClusterSettingsRequest extends RequestBase // --------------------------------------------------------------------------------------------- private GetClusterSettingsRequest(Builder builder) { + super(builder); this.clusterManagerTimeout = builder.clusterManagerTimeout; this.flatSettings = builder.flatSettings; this.includeDefaults = builder.includeDefaults; @@ -166,7 +166,9 @@ public static Builder builder() { /** * Builder for {@link GetClusterSettingsRequest}. */ - public static class Builder extends ObjectBuilderBase implements CopyableBuilder { + public static class Builder extends RequestBase.AbstractBuilder + implements + CopyableBuilder { @Nullable private Time clusterManagerTimeout; @Nullable @@ -181,6 +183,7 @@ public static class Builder extends ObjectBuilderBase implements CopyableBuilder public Builder() {} private Builder(GetClusterSettingsRequest o) { + super(o); this.clusterManagerTimeout = o.clusterManagerTimeout; this.flatSettings = o.flatSettings; this.includeDefaults = o.includeDefaults; @@ -189,6 +192,7 @@ private Builder(GetClusterSettingsRequest o) { } private Builder(Builder o) { + super(o); this.clusterManagerTimeout = o.clusterManagerTimeout; this.flatSettings = o.flatSettings; this.includeDefaults = o.includeDefaults; @@ -202,6 +206,12 @@ public Builder copy() { return new Builder(this); } + @Override + @Nonnull + protected Builder self() { + return this; + } + /** * Operation timeout for connection to cluster-manager node. *

@@ -315,6 +325,26 @@ public GetClusterSettingsRequest build() { // --------------------------------------------------------------------------------------------- + @Override + protected void applyQueryParameters(@Nonnull Map params) { + super.applyQueryParameters(params); + if (this.clusterManagerTimeout != null) { + params.put("cluster_manager_timeout", this.clusterManagerTimeout._toJsonString()); + } + if (this.flatSettings != null) { + params.put("flat_settings", String.valueOf(this.flatSettings)); + } + if (this.includeDefaults != null) { + params.put("include_defaults", String.valueOf(this.includeDefaults)); + } + if (this.masterTimeout != null) { + params.put("master_timeout", this.masterTimeout._toJsonString()); + } + if (this.timeout != null) { + params.put("timeout", this.timeout._toJsonString()); + } + } + /** * Endpoint "{@code cluster.get_settings}". */ @@ -326,21 +356,7 @@ public GetClusterSettingsRequest build() { // Request parameters request -> { Map params = new HashMap<>(); - if (request.clusterManagerTimeout != null) { - params.put("cluster_manager_timeout", request.clusterManagerTimeout._toJsonString()); - } - if (request.flatSettings != null) { - params.put("flat_settings", String.valueOf(request.flatSettings)); - } - 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()); - } + request.applyQueryParameters(params); return params; }, SimpleEndpoint.emptyMap(), diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/cluster/GetComponentTemplateRequest.java b/java-client/src/generated/java/org/opensearch/client/opensearch/cluster/GetComponentTemplateRequest.java index 2d60437705..4fcda488df 100644 --- a/java-client/src/generated/java/org/opensearch/client/opensearch/cluster/GetComponentTemplateRequest.java +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/cluster/GetComponentTemplateRequest.java @@ -50,7 +50,6 @@ 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 @@ -59,7 +58,7 @@ * Returns one or more component templates. */ @Generated("org.opensearch.client.codegen.CodeGenerator") -public class GetComponentTemplateRequest extends RequestBase +public final class GetComponentTemplateRequest extends RequestBase implements ToCopyableBuilder { @@ -82,6 +81,7 @@ public class GetComponentTemplateRequest extends RequestBase // --------------------------------------------------------------------------------------------- private GetComponentTemplateRequest(Builder builder) { + super(builder); this.clusterManagerTimeout = builder.clusterManagerTimeout; this.flatSettings = builder.flatSettings; this.local = builder.local; @@ -169,7 +169,9 @@ public static Builder builder() { /** * Builder for {@link GetComponentTemplateRequest}. */ - public static class Builder extends ObjectBuilderBase implements CopyableBuilder { + public static class Builder extends RequestBase.AbstractBuilder + implements + CopyableBuilder { @Nullable private Time clusterManagerTimeout; @Nullable @@ -184,6 +186,7 @@ public static class Builder extends ObjectBuilderBase implements CopyableBuilder public Builder() {} private Builder(GetComponentTemplateRequest o) { + super(o); this.clusterManagerTimeout = o.clusterManagerTimeout; this.flatSettings = o.flatSettings; this.local = o.local; @@ -192,6 +195,7 @@ private Builder(GetComponentTemplateRequest o) { } private Builder(Builder o) { + super(o); this.clusterManagerTimeout = o.clusterManagerTimeout; this.flatSettings = o.flatSettings; this.local = o.local; @@ -205,6 +209,12 @@ public Builder copy() { return new Builder(this); } + @Override + @Nonnull + protected Builder self() { + return this; + } + /** * Operation timeout for connection to cluster-manager node. *

@@ -308,6 +318,23 @@ public GetComponentTemplateRequest build() { // --------------------------------------------------------------------------------------------- + @Override + protected void applyQueryParameters(@Nonnull Map params) { + super.applyQueryParameters(params); + if (this.clusterManagerTimeout != null) { + params.put("cluster_manager_timeout", this.clusterManagerTimeout._toJsonString()); + } + if (this.flatSettings != null) { + params.put("flat_settings", String.valueOf(this.flatSettings)); + } + if (this.local != null) { + params.put("local", String.valueOf(this.local)); + } + if (this.masterTimeout != null) { + params.put("master_timeout", this.masterTimeout._toJsonString()); + } + } + /** * Endpoint "{@code cluster.get_component_template}". */ @@ -337,18 +364,7 @@ public GetComponentTemplateRequest build() { // Request parameters request -> { Map params = new HashMap<>(); - if (request.clusterManagerTimeout != null) { - params.put("cluster_manager_timeout", request.clusterManagerTimeout._toJsonString()); - } - if (request.flatSettings != null) { - params.put("flat_settings", String.valueOf(request.flatSettings)); - } - if (request.local != null) { - params.put("local", String.valueOf(request.local)); - } - if (request.masterTimeout != null) { - params.put("master_timeout", request.masterTimeout._toJsonString()); - } + request.applyQueryParameters(params); return params; }, SimpleEndpoint.emptyMap(), diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/cluster/HealthRequest.java b/java-client/src/generated/java/org/opensearch/client/opensearch/cluster/HealthRequest.java index a01c427fdd..957f556aea 100644 --- a/java-client/src/generated/java/org/opensearch/client/opensearch/cluster/HealthRequest.java +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/cluster/HealthRequest.java @@ -58,7 +58,6 @@ 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 @@ -67,7 +66,7 @@ * Returns basic information about the health of the cluster. */ @Generated("org.opensearch.client.codegen.CodeGenerator") -public class HealthRequest extends RequestBase implements ToCopyableBuilder { +public final class HealthRequest extends RequestBase implements ToCopyableBuilder { @Nullable private final String awarenessAttribute; @@ -115,6 +114,7 @@ public class HealthRequest extends RequestBase implements ToCopyableBuilder { + public static class Builder extends RequestBase.AbstractBuilder implements CopyableBuilder { @Nullable private String awarenessAttribute; @Nullable @@ -347,6 +347,7 @@ public static class Builder extends ObjectBuilderBase implements CopyableBuilder public Builder() {} private Builder(HealthRequest o) { + super(o); this.awarenessAttribute = o.awarenessAttribute; this.clusterManagerTimeout = o.clusterManagerTimeout; this.expandWildcards = _listCopy(o.expandWildcards); @@ -364,6 +365,7 @@ private Builder(HealthRequest o) { } private Builder(Builder o) { + super(o); this.awarenessAttribute = o.awarenessAttribute; this.clusterManagerTimeout = o.clusterManagerTimeout; this.expandWildcards = _listCopy(o.expandWildcards); @@ -386,6 +388,12 @@ public Builder copy() { return new Builder(this); } + @Override + @Nonnull + protected Builder self() { + return this; + } + /** * The awareness attribute for which the health is required. *

@@ -668,6 +676,50 @@ public HealthRequest build() { // --------------------------------------------------------------------------------------------- + @Override + protected void applyQueryParameters(@Nonnull Map params) { + super.applyQueryParameters(params); + if (this.awarenessAttribute != null) { + params.put("awareness_attribute", this.awarenessAttribute); + } + if (this.clusterManagerTimeout != null) { + params.put("cluster_manager_timeout", this.clusterManagerTimeout._toJsonString()); + } + if (ApiTypeHelper.isDefined(this.expandWildcards)) { + params.put("expand_wildcards", this.expandWildcards.stream().map(v -> v.jsonValue()).collect(Collectors.joining(","))); + } + if (this.level != null) { + params.put("level", this.level.jsonValue()); + } + if (this.local != null) { + params.put("local", String.valueOf(this.local)); + } + if (this.masterTimeout != null) { + params.put("master_timeout", this.masterTimeout._toJsonString()); + } + if (this.timeout != null) { + params.put("timeout", this.timeout._toJsonString()); + } + if (this.waitForActiveShards != null) { + params.put("wait_for_active_shards", this.waitForActiveShards._toJsonString()); + } + if (this.waitForEvents != null) { + params.put("wait_for_events", this.waitForEvents.jsonValue()); + } + if (this.waitForNoInitializingShards != null) { + params.put("wait_for_no_initializing_shards", String.valueOf(this.waitForNoInitializingShards)); + } + if (this.waitForNoRelocatingShards != null) { + params.put("wait_for_no_relocating_shards", String.valueOf(this.waitForNoRelocatingShards)); + } + if (this.waitForNodes != null) { + params.put("wait_for_nodes", this.waitForNodes); + } + if (this.waitForStatus != null) { + params.put("wait_for_status", this.waitForStatus.jsonValue()); + } + } + /** * Endpoint "{@code cluster.health}". */ @@ -697,45 +749,7 @@ public HealthRequest build() { // Request parameters request -> { Map params = new HashMap<>(); - if (request.awarenessAttribute != null) { - params.put("awareness_attribute", request.awarenessAttribute); - } - if (request.clusterManagerTimeout != null) { - params.put("cluster_manager_timeout", request.clusterManagerTimeout._toJsonString()); - } - if (ApiTypeHelper.isDefined(request.expandWildcards)) { - params.put("expand_wildcards", request.expandWildcards.stream().map(v -> v.jsonValue()).collect(Collectors.joining(","))); - } - if (request.level != null) { - params.put("level", request.level.jsonValue()); - } - if (request.local != null) { - params.put("local", String.valueOf(request.local)); - } - if (request.masterTimeout != null) { - params.put("master_timeout", request.masterTimeout._toJsonString()); - } - 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.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.waitForNodes != null) { - params.put("wait_for_nodes", request.waitForNodes); - } - if (request.waitForStatus != null) { - params.put("wait_for_status", request.waitForStatus.jsonValue()); - } + request.applyQueryParameters(params); return params; }, SimpleEndpoint.emptyMap(), diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/cluster/OpenSearchClusterAsyncClient.java b/java-client/src/generated/java/org/opensearch/client/opensearch/cluster/OpenSearchClusterAsyncClient.java index cfd560c291..f309032f98 100644 --- a/java-client/src/generated/java/org/opensearch/client/opensearch/cluster/OpenSearchClusterAsyncClient.java +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/cluster/OpenSearchClusterAsyncClient.java @@ -358,8 +358,25 @@ public final CompletableFuture putSettings() throws /** * Returns the information about configured remote clusters. */ - public CompletableFuture remoteInfo() throws IOException, OpenSearchException { - return this.transport.performRequestAsync(RemoteInfoRequest._INSTANCE, RemoteInfoRequest._ENDPOINT, this.transportOptions); + public CompletableFuture remoteInfo(RemoteInfoRequest request) throws IOException, OpenSearchException { + return this.transport.performRequestAsync(request, RemoteInfoRequest._ENDPOINT, this.transportOptions); + } + + /** + * Returns the information about configured remote clusters. + * + * @param fn a function that initializes a builder to create the {@link RemoteInfoRequest} + */ + public final CompletableFuture remoteInfo(Function> fn) + throws IOException, OpenSearchException { + return remoteInfo(fn.apply(new RemoteInfoRequest.Builder()).build()); + } + + /** + * Returns the information about configured remote clusters. + */ + public final CompletableFuture remoteInfo() throws IOException, OpenSearchException { + return remoteInfo(new RemoteInfoRequest.Builder().build()); } // ----- Endpoint: cluster.reroute diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/cluster/OpenSearchClusterClient.java b/java-client/src/generated/java/org/opensearch/client/opensearch/cluster/OpenSearchClusterClient.java index a8e946665b..30990eec77 100644 --- a/java-client/src/generated/java/org/opensearch/client/opensearch/cluster/OpenSearchClusterClient.java +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/cluster/OpenSearchClusterClient.java @@ -349,8 +349,25 @@ public final PutClusterSettingsResponse putSettings() throws IOException, OpenSe /** * Returns the information about configured remote clusters. */ - public RemoteInfoResponse remoteInfo() throws IOException, OpenSearchException { - return this.transport.performRequest(RemoteInfoRequest._INSTANCE, RemoteInfoRequest._ENDPOINT, this.transportOptions); + public RemoteInfoResponse remoteInfo(RemoteInfoRequest request) throws IOException, OpenSearchException { + return this.transport.performRequest(request, RemoteInfoRequest._ENDPOINT, this.transportOptions); + } + + /** + * Returns the information about configured remote clusters. + * + * @param fn a function that initializes a builder to create the {@link RemoteInfoRequest} + */ + public final RemoteInfoResponse remoteInfo(Function> fn) throws IOException, + OpenSearchException { + return remoteInfo(fn.apply(new RemoteInfoRequest.Builder()).build()); + } + + /** + * Returns the information about configured remote clusters. + */ + public final RemoteInfoResponse remoteInfo() throws IOException, OpenSearchException { + return remoteInfo(new RemoteInfoRequest.Builder().build()); } // ----- Endpoint: cluster.reroute diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/cluster/PendingTasksRequest.java b/java-client/src/generated/java/org/opensearch/client/opensearch/cluster/PendingTasksRequest.java index 752bf1bfde..7c0a01183e 100644 --- a/java-client/src/generated/java/org/opensearch/client/opensearch/cluster/PendingTasksRequest.java +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/cluster/PendingTasksRequest.java @@ -50,7 +50,6 @@ 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.pending_tasks.Request @@ -59,7 +58,7 @@ * Returns a list of any cluster-level changes (e.g. create index, update mapping, allocate or fail shard) which have not yet been executed. */ @Generated("org.opensearch.client.codegen.CodeGenerator") -public class PendingTasksRequest extends RequestBase implements ToCopyableBuilder { +public final class PendingTasksRequest extends RequestBase implements ToCopyableBuilder { @Nullable private final Time clusterManagerTimeout; @@ -74,6 +73,7 @@ public class PendingTasksRequest extends RequestBase implements ToCopyableBuilde // --------------------------------------------------------------------------------------------- private PendingTasksRequest(Builder builder) { + super(builder); this.clusterManagerTimeout = builder.clusterManagerTimeout; this.local = builder.local; this.masterTimeout = builder.masterTimeout; @@ -135,7 +135,7 @@ public static Builder builder() { /** * Builder for {@link PendingTasksRequest}. */ - public static class Builder extends ObjectBuilderBase implements CopyableBuilder { + public static class Builder extends RequestBase.AbstractBuilder implements CopyableBuilder { @Nullable private Time clusterManagerTimeout; @Nullable @@ -146,12 +146,14 @@ public static class Builder extends ObjectBuilderBase implements CopyableBuilder public Builder() {} private Builder(PendingTasksRequest o) { + super(o); this.clusterManagerTimeout = o.clusterManagerTimeout; this.local = o.local; this.masterTimeout = o.masterTimeout; } private Builder(Builder o) { + super(o); this.clusterManagerTimeout = o.clusterManagerTimeout; this.local = o.local; this.masterTimeout = o.masterTimeout; @@ -163,6 +165,12 @@ public Builder copy() { return new Builder(this); } + @Override + @Nonnull + protected Builder self() { + return this; + } + /** * Operation timeout for connection to cluster-manager node. *

@@ -242,6 +250,20 @@ public PendingTasksRequest build() { // --------------------------------------------------------------------------------------------- + @Override + protected void applyQueryParameters(@Nonnull Map params) { + super.applyQueryParameters(params); + if (this.clusterManagerTimeout != null) { + params.put("cluster_manager_timeout", this.clusterManagerTimeout._toJsonString()); + } + if (this.local != null) { + params.put("local", String.valueOf(this.local)); + } + if (this.masterTimeout != null) { + params.put("master_timeout", this.masterTimeout._toJsonString()); + } + } + /** * Endpoint "{@code cluster.pending_tasks}". */ @@ -253,15 +275,7 @@ public PendingTasksRequest build() { // Request parameters request -> { Map params = new HashMap<>(); - 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()); - } + request.applyQueryParameters(params); return params; }, SimpleEndpoint.emptyMap(), diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/cluster/PostVotingConfigExclusionsRequest.java b/java-client/src/generated/java/org/opensearch/client/opensearch/cluster/PostVotingConfigExclusionsRequest.java index 79ca2c4a67..aa6042bde8 100644 --- a/java-client/src/generated/java/org/opensearch/client/opensearch/cluster/PostVotingConfigExclusionsRequest.java +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/cluster/PostVotingConfigExclusionsRequest.java @@ -54,7 +54,6 @@ 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.post_voting_config_exclusions.Request @@ -63,7 +62,7 @@ * Updates the cluster voting config exclusions by node ids or node names. */ @Generated("org.opensearch.client.codegen.CodeGenerator") -public class PostVotingConfigExclusionsRequest extends RequestBase +public final class PostVotingConfigExclusionsRequest extends RequestBase implements ToCopyableBuilder { @@ -79,6 +78,7 @@ public class PostVotingConfigExclusionsRequest extends RequestBase // --------------------------------------------------------------------------------------------- private PostVotingConfigExclusionsRequest(Builder builder) { + super(builder); this.nodeIds = ApiTypeHelper.unmodifiable(builder.nodeIds); this.nodeNames = ApiTypeHelper.unmodifiable(builder.nodeNames); this.timeout = builder.timeout; @@ -142,7 +142,9 @@ public static Builder builder() { /** * Builder for {@link PostVotingConfigExclusionsRequest}. */ - public static class Builder extends ObjectBuilderBase implements CopyableBuilder { + public static class Builder extends RequestBase.AbstractBuilder + implements + CopyableBuilder { @Nullable private List nodeIds; @Nullable @@ -153,12 +155,14 @@ public static class Builder extends ObjectBuilderBase implements CopyableBuilder public Builder() {} private Builder(PostVotingConfigExclusionsRequest o) { + super(o); this.nodeIds = _listCopy(o.nodeIds); this.nodeNames = _listCopy(o.nodeNames); this.timeout = o.timeout; } private Builder(Builder o) { + super(o); this.nodeIds = _listCopy(o.nodeIds); this.nodeNames = _listCopy(o.nodeNames); this.timeout = o.timeout; @@ -170,6 +174,12 @@ public Builder copy() { return new Builder(this); } + @Override + @Nonnull + protected Builder self() { + return this; + } + /** * A comma-separated list of the persistent ids of the nodes to exclude from the voting configuration. If specified, you may not * also specify node_names. @@ -279,6 +289,20 @@ public PostVotingConfigExclusionsRequest build() { // --------------------------------------------------------------------------------------------- + @Override + protected void applyQueryParameters(@Nonnull Map params) { + super.applyQueryParameters(params); + if (ApiTypeHelper.isDefined(this.nodeIds)) { + params.put("node_ids", String.join(",", this.nodeIds)); + } + if (ApiTypeHelper.isDefined(this.nodeNames)) { + params.put("node_names", String.join(",", this.nodeNames)); + } + if (this.timeout != null) { + params.put("timeout", this.timeout._toJsonString()); + } + } + /** * Endpoint "{@code cluster.post_voting_config_exclusions}". */ @@ -290,15 +314,7 @@ public PostVotingConfigExclusionsRequest build() { // Request parameters request -> { Map params = new HashMap<>(); - if (ApiTypeHelper.isDefined(request.nodeIds)) { - params.put("node_ids", String.join(",", request.nodeIds)); - } - if (ApiTypeHelper.isDefined(request.nodeNames)) { - params.put("node_names", String.join(",", request.nodeNames)); - } - if (request.timeout != null) { - params.put("timeout", request.timeout._toJsonString()); - } + request.applyQueryParameters(params); return params; }, SimpleEndpoint.emptyMap() diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/cluster/PutClusterSettingsRequest.java b/java-client/src/generated/java/org/opensearch/client/opensearch/cluster/PutClusterSettingsRequest.java index dce1c4be27..236dc1b7fb 100644 --- a/java-client/src/generated/java/org/opensearch/client/opensearch/cluster/PutClusterSettingsRequest.java +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/cluster/PutClusterSettingsRequest.java @@ -59,7 +59,6 @@ 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.put_settings.Request @@ -69,7 +68,7 @@ */ @JsonpDeserializable @Generated("org.opensearch.client.codegen.CodeGenerator") -public class PutClusterSettingsRequest extends RequestBase +public final class PutClusterSettingsRequest extends RequestBase implements PlainJsonSerializable, ToCopyableBuilder { @@ -96,6 +95,7 @@ public class PutClusterSettingsRequest extends RequestBase // --------------------------------------------------------------------------------------------- private PutClusterSettingsRequest(Builder builder) { + super(builder); this.clusterManagerTimeout = builder.clusterManagerTimeout; this.flatSettings = builder.flatSettings; this.masterTimeout = builder.masterTimeout; @@ -216,7 +216,9 @@ public static Builder builder() { /** * Builder for {@link PutClusterSettingsRequest}. */ - public static class Builder extends ObjectBuilderBase implements CopyableBuilder { + public static class Builder extends RequestBase.AbstractBuilder + implements + CopyableBuilder { @Nullable private Time clusterManagerTimeout; @Nullable @@ -233,6 +235,7 @@ public static class Builder extends ObjectBuilderBase implements CopyableBuilder public Builder() {} private Builder(PutClusterSettingsRequest o) { + super(o); this.clusterManagerTimeout = o.clusterManagerTimeout; this.flatSettings = o.flatSettings; this.masterTimeout = o.masterTimeout; @@ -242,6 +245,7 @@ private Builder(PutClusterSettingsRequest o) { } private Builder(Builder o) { + super(o); this.clusterManagerTimeout = o.clusterManagerTimeout; this.flatSettings = o.flatSettings; this.masterTimeout = o.masterTimeout; @@ -256,6 +260,12 @@ public Builder copy() { return new Builder(this); } + @Override + @Nonnull + protected Builder self() { + return this; + } + /** * Operation timeout for connection to cluster-manager node. *

@@ -422,6 +432,23 @@ protected static void setupPutClusterSettingsRequestDeserializer(ObjectDeseriali // --------------------------------------------------------------------------------------------- + @Override + protected void applyQueryParameters(@Nonnull Map params) { + super.applyQueryParameters(params); + if (this.clusterManagerTimeout != null) { + params.put("cluster_manager_timeout", this.clusterManagerTimeout._toJsonString()); + } + if (this.flatSettings != null) { + params.put("flat_settings", String.valueOf(this.flatSettings)); + } + if (this.masterTimeout != null) { + params.put("master_timeout", this.masterTimeout._toJsonString()); + } + if (this.timeout != null) { + params.put("timeout", this.timeout._toJsonString()); + } + } + /** * Endpoint "{@code cluster.put_settings}". */ @@ -433,18 +460,7 @@ protected static void setupPutClusterSettingsRequestDeserializer(ObjectDeseriali // Request parameters request -> { Map params = new HashMap<>(); - if (request.clusterManagerTimeout != null) { - params.put("cluster_manager_timeout", request.clusterManagerTimeout._toJsonString()); - } - if (request.flatSettings != null) { - params.put("flat_settings", String.valueOf(request.flatSettings)); - } - if (request.masterTimeout != null) { - params.put("master_timeout", request.masterTimeout._toJsonString()); - } - if (request.timeout != null) { - params.put("timeout", request.timeout._toJsonString()); - } + request.applyQueryParameters(params); return params; }, SimpleEndpoint.emptyMap(), diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/cluster/PutComponentTemplateRequest.java b/java-client/src/generated/java/org/opensearch/client/opensearch/cluster/PutComponentTemplateRequest.java index 6d39894842..ed471951ba 100644 --- a/java-client/src/generated/java/org/opensearch/client/opensearch/cluster/PutComponentTemplateRequest.java +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/cluster/PutComponentTemplateRequest.java @@ -60,7 +60,6 @@ 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.put_component_template.Request @@ -70,7 +69,7 @@ */ @JsonpDeserializable @Generated("org.opensearch.client.codegen.CodeGenerator") -public class PutComponentTemplateRequest extends RequestBase +public final class PutComponentTemplateRequest extends RequestBase implements PlainJsonSerializable, ToCopyableBuilder { @@ -106,6 +105,7 @@ public class PutComponentTemplateRequest extends RequestBase // --------------------------------------------------------------------------------------------- private PutComponentTemplateRequest(Builder builder) { + super(builder); this.allowAutoCreate = builder.allowAutoCreate; this.clusterManagerTimeout = builder.clusterManagerTimeout; this.create = builder.create; @@ -271,7 +271,9 @@ public static Builder builder() { /** * Builder for {@link PutComponentTemplateRequest}. */ - public static class Builder extends ObjectBuilderBase implements CopyableBuilder { + public static class Builder extends RequestBase.AbstractBuilder + implements + CopyableBuilder { @Nullable private Boolean allowAutoCreate; @Nullable @@ -292,6 +294,7 @@ public static class Builder extends ObjectBuilderBase implements CopyableBuilder public Builder() {} private Builder(PutComponentTemplateRequest o) { + super(o); this.allowAutoCreate = o.allowAutoCreate; this.clusterManagerTimeout = o.clusterManagerTimeout; this.create = o.create; @@ -304,6 +307,7 @@ private Builder(PutComponentTemplateRequest o) { } private Builder(Builder o) { + super(o); this.allowAutoCreate = o.allowAutoCreate; this.clusterManagerTimeout = o.clusterManagerTimeout; this.create = o.create; @@ -321,6 +325,12 @@ public Builder copy() { return new Builder(this); } + @Override + @Nonnull + protected Builder self() { + return this; + } + /** * This setting overrides the value of the action.auto_create_index cluster setting. If set to true in a * template, then indexes can be automatically created using that template even if auto-creation of indexes is disabled using @@ -521,6 +531,23 @@ protected static void setupPutComponentTemplateRequestDeserializer(ObjectDeseria // --------------------------------------------------------------------------------------------- + @Override + protected void applyQueryParameters(@Nonnull Map params) { + super.applyQueryParameters(params); + if (this.clusterManagerTimeout != null) { + params.put("cluster_manager_timeout", this.clusterManagerTimeout._toJsonString()); + } + if (this.create != null) { + params.put("create", String.valueOf(this.create)); + } + if (this.masterTimeout != null) { + params.put("master_timeout", this.masterTimeout._toJsonString()); + } + if (this.timeout != null) { + params.put("timeout", this.timeout._toJsonString()); + } + } + /** * Endpoint "{@code cluster.put_component_template}". */ @@ -537,18 +564,7 @@ protected static void setupPutComponentTemplateRequestDeserializer(ObjectDeseria // Request parameters request -> { Map params = new HashMap<>(); - if (request.clusterManagerTimeout != null) { - params.put("cluster_manager_timeout", request.clusterManagerTimeout._toJsonString()); - } - if (request.create != null) { - params.put("create", String.valueOf(request.create)); - } - if (request.masterTimeout != null) { - params.put("master_timeout", request.masterTimeout._toJsonString()); - } - if (request.timeout != null) { - params.put("timeout", request.timeout._toJsonString()); - } + request.applyQueryParameters(params); return params; }, SimpleEndpoint.emptyMap(), diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/cluster/RemoteInfoRequest.java b/java-client/src/generated/java/org/opensearch/client/opensearch/cluster/RemoteInfoRequest.java index f1c36b07a2..9a0acab00a 100644 --- a/java-client/src/generated/java/org/opensearch/client/opensearch/cluster/RemoteInfoRequest.java +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/cluster/RemoteInfoRequest.java @@ -36,11 +36,18 @@ package org.opensearch.client.opensearch.cluster; +import java.util.HashMap; +import java.util.Map; +import java.util.function.Function; import javax.annotation.Generated; +import javax.annotation.Nonnull; import org.opensearch.client.opensearch._types.ErrorResponse; import org.opensearch.client.opensearch._types.RequestBase; 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.ToCopyableBuilder; // typedef: cluster.remote_info.Request @@ -48,13 +55,71 @@ * Returns the information about configured remote clusters. */ @Generated("org.opensearch.client.codegen.CodeGenerator") -public class RemoteInfoRequest extends RequestBase { - public RemoteInfoRequest() {} +public final class RemoteInfoRequest extends RequestBase implements ToCopyableBuilder { + + // --------------------------------------------------------------------------------------------- + + private RemoteInfoRequest(Builder builder) { + super(builder); + } + + public static RemoteInfoRequest 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(); + } /** - * Singleton instance for {@link RemoteInfoRequest}. + * Builder for {@link RemoteInfoRequest}. */ - public static final RemoteInfoRequest _INSTANCE = new RemoteInfoRequest(); + public static class Builder extends RequestBase.AbstractBuilder implements CopyableBuilder { + + public Builder() {} + + private Builder(RemoteInfoRequest 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; + } + + /** + * Builds a {@link RemoteInfoRequest}. + * + * @throws NullPointerException if some of the required fields are null. + */ + @Override + @Nonnull + public RemoteInfoRequest build() { + _checkSingleUse(); + + return new RemoteInfoRequest(this); + } + } // --------------------------------------------------------------------------------------------- @@ -67,7 +132,11 @@ public RemoteInfoRequest() {} // Request path request -> "/_remote/info", // Request parameters - SimpleEndpoint.emptyMap(), + request -> { + Map params = new HashMap<>(); + request.applyQueryParameters(params); + return params; + }, SimpleEndpoint.emptyMap(), false, RemoteInfoResponse._DESERIALIZER diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/cluster/RerouteRequest.java b/java-client/src/generated/java/org/opensearch/client/opensearch/cluster/RerouteRequest.java index 434bb33491..290f56524a 100644 --- a/java-client/src/generated/java/org/opensearch/client/opensearch/cluster/RerouteRequest.java +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/cluster/RerouteRequest.java @@ -62,7 +62,6 @@ 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.reroute.Request @@ -72,7 +71,7 @@ */ @JsonpDeserializable @Generated("org.opensearch.client.codegen.CodeGenerator") -public class RerouteRequest extends RequestBase +public final class RerouteRequest extends RequestBase implements PlainJsonSerializable, ToCopyableBuilder { @@ -105,6 +104,7 @@ public class RerouteRequest extends RequestBase // --------------------------------------------------------------------------------------------- private RerouteRequest(Builder builder) { + super(builder); this.clusterManagerTimeout = builder.clusterManagerTimeout; this.commands = ApiTypeHelper.unmodifiable(builder.commands); this.dryRun = builder.dryRun; @@ -245,7 +245,7 @@ public static Builder builder() { /** * Builder for {@link RerouteRequest}. */ - public static class Builder extends ObjectBuilderBase implements CopyableBuilder { + public static class Builder extends RequestBase.AbstractBuilder implements CopyableBuilder { @Nullable private Time clusterManagerTimeout; @Nullable @@ -266,6 +266,7 @@ public static class Builder extends ObjectBuilderBase implements CopyableBuilder public Builder() {} private Builder(RerouteRequest o) { + super(o); this.clusterManagerTimeout = o.clusterManagerTimeout; this.commands = _listCopy(o.commands); this.dryRun = o.dryRun; @@ -277,6 +278,7 @@ private Builder(RerouteRequest o) { } private Builder(Builder o) { + super(o); this.clusterManagerTimeout = o.clusterManagerTimeout; this.commands = _listCopy(o.commands); this.dryRun = o.dryRun; @@ -293,6 +295,12 @@ public Builder copy() { return new Builder(this); } + @Override + @Nonnull + protected Builder self() { + return this; + } + /** * Operation timeout for connection to cluster-manager node. *

@@ -511,6 +519,32 @@ protected static void setupRerouteRequestDeserializer(ObjectDeserializer params) { + super.applyQueryParameters(params); + if (this.clusterManagerTimeout != null) { + params.put("cluster_manager_timeout", this.clusterManagerTimeout._toJsonString()); + } + if (this.dryRun != null) { + params.put("dry_run", String.valueOf(this.dryRun)); + } + if (this.explain != null) { + params.put("explain", String.valueOf(this.explain)); + } + if (this.masterTimeout != null) { + params.put("master_timeout", this.masterTimeout._toJsonString()); + } + if (ApiTypeHelper.isDefined(this.metric)) { + params.put("metric", this.metric.stream().map(v -> v.jsonValue()).collect(Collectors.joining(","))); + } + if (this.retryFailed != null) { + params.put("retry_failed", String.valueOf(this.retryFailed)); + } + if (this.timeout != null) { + params.put("timeout", this.timeout._toJsonString()); + } + } + /** * Endpoint "{@code cluster.reroute}". */ @@ -522,27 +556,7 @@ protected static void setupRerouteRequestDeserializer(ObjectDeserializer { Map params = new HashMap<>(); - if (request.clusterManagerTimeout != null) { - params.put("cluster_manager_timeout", request.clusterManagerTimeout._toJsonString()); - } - if (request.dryRun != null) { - params.put("dry_run", String.valueOf(request.dryRun)); - } - if (request.explain != null) { - params.put("explain", String.valueOf(request.explain)); - } - if (request.masterTimeout != null) { - params.put("master_timeout", request.masterTimeout._toJsonString()); - } - if (ApiTypeHelper.isDefined(request.metric)) { - params.put("metric", request.metric.stream().map(v -> v.jsonValue()).collect(Collectors.joining(","))); - } - if (request.retryFailed != null) { - params.put("retry_failed", String.valueOf(request.retryFailed)); - } - if (request.timeout != null) { - params.put("timeout", request.timeout._toJsonString()); - } + request.applyQueryParameters(params); return params; }, SimpleEndpoint.emptyMap(), diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/cluster/StateRequest.java b/java-client/src/generated/java/org/opensearch/client/opensearch/cluster/StateRequest.java index 6eb5b900d4..25d323c2ae 100644 --- a/java-client/src/generated/java/org/opensearch/client/opensearch/cluster/StateRequest.java +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/cluster/StateRequest.java @@ -55,7 +55,6 @@ 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.state.Request @@ -64,7 +63,7 @@ * Returns a comprehensive information about the state of the cluster. */ @Generated("org.opensearch.client.codegen.CodeGenerator") -public class StateRequest extends RequestBase implements ToCopyableBuilder { +public final class StateRequest extends RequestBase implements ToCopyableBuilder { @Nullable private final Boolean allowNoIndices; @@ -103,6 +102,7 @@ public class StateRequest extends RequestBase implements ToCopyableBuilder { + public static class Builder extends RequestBase.AbstractBuilder implements CopyableBuilder { @Nullable private Boolean allowNoIndices; @Nullable @@ -286,6 +286,7 @@ public static class Builder extends ObjectBuilderBase implements CopyableBuilder public Builder() {} private Builder(StateRequest o) { + super(o); this.allowNoIndices = o.allowNoIndices; this.clusterManagerTimeout = o.clusterManagerTimeout; this.expandWildcards = _listCopy(o.expandWildcards); @@ -300,6 +301,7 @@ private Builder(StateRequest o) { } private Builder(Builder o) { + super(o); this.allowNoIndices = o.allowNoIndices; this.clusterManagerTimeout = o.clusterManagerTimeout; this.expandWildcards = _listCopy(o.expandWildcards); @@ -319,6 +321,12 @@ public Builder copy() { return new Builder(this); } + @Override + @Nonnull + protected Builder self() { + return this; + } + /** * Whether to ignore if a wildcard indexes expression resolves into no concrete indexes. (This includes _all string or * when no indexes have been specified) @@ -563,6 +571,38 @@ public StateRequest build() { // --------------------------------------------------------------------------------------------- + @Override + protected void applyQueryParameters(@Nonnull Map params) { + super.applyQueryParameters(params); + if (this.allowNoIndices != null) { + params.put("allow_no_indices", String.valueOf(this.allowNoIndices)); + } + if (this.clusterManagerTimeout != null) { + params.put("cluster_manager_timeout", this.clusterManagerTimeout._toJsonString()); + } + if (ApiTypeHelper.isDefined(this.expandWildcards)) { + params.put("expand_wildcards", this.expandWildcards.stream().map(v -> v.jsonValue()).collect(Collectors.joining(","))); + } + if (this.flatSettings != null) { + params.put("flat_settings", String.valueOf(this.flatSettings)); + } + if (this.ignoreUnavailable != null) { + params.put("ignore_unavailable", String.valueOf(this.ignoreUnavailable)); + } + if (this.local != null) { + params.put("local", String.valueOf(this.local)); + } + if (this.masterTimeout != null) { + params.put("master_timeout", this.masterTimeout._toJsonString()); + } + if (this.waitForMetadataVersion != null) { + params.put("wait_for_metadata_version", String.valueOf(this.waitForMetadataVersion)); + } + if (this.waitForTimeout != null) { + params.put("wait_for_timeout", this.waitForTimeout._toJsonString()); + } + } + /** * Endpoint "{@code cluster.state}". */ @@ -602,33 +642,7 @@ public StateRequest build() { // Request parameters request -> { Map params = new HashMap<>(); - if (request.allowNoIndices != null) { - params.put("allow_no_indices", String.valueOf(request.allowNoIndices)); - } - if (request.clusterManagerTimeout != null) { - params.put("cluster_manager_timeout", request.clusterManagerTimeout._toJsonString()); - } - if (ApiTypeHelper.isDefined(request.expandWildcards)) { - params.put("expand_wildcards", request.expandWildcards.stream().map(v -> v.jsonValue()).collect(Collectors.joining(","))); - } - if (request.flatSettings != null) { - params.put("flat_settings", String.valueOf(request.flatSettings)); - } - if (request.ignoreUnavailable != null) { - params.put("ignore_unavailable", String.valueOf(request.ignoreUnavailable)); - } - if (request.local != null) { - params.put("local", String.valueOf(request.local)); - } - if (request.masterTimeout != null) { - params.put("master_timeout", request.masterTimeout._toJsonString()); - } - if (request.waitForMetadataVersion != null) { - params.put("wait_for_metadata_version", String.valueOf(request.waitForMetadataVersion)); - } - if (request.waitForTimeout != null) { - params.put("wait_for_timeout", request.waitForTimeout._toJsonString()); - } + request.applyQueryParameters(params); return params; }, SimpleEndpoint.emptyMap(), diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/core/InfoRequest.java b/java-client/src/generated/java/org/opensearch/client/opensearch/core/InfoRequest.java index f2753f32fa..5e3c536c3d 100644 --- a/java-client/src/generated/java/org/opensearch/client/opensearch/core/InfoRequest.java +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/core/InfoRequest.java @@ -36,11 +36,18 @@ package org.opensearch.client.opensearch.core; +import java.util.HashMap; +import java.util.Map; +import java.util.function.Function; import javax.annotation.Generated; +import javax.annotation.Nonnull; import org.opensearch.client.opensearch._types.ErrorResponse; import org.opensearch.client.opensearch._types.RequestBase; 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.ToCopyableBuilder; // typedef: _global.info.Request @@ -48,13 +55,71 @@ * Returns basic information about the cluster. */ @Generated("org.opensearch.client.codegen.CodeGenerator") -public class InfoRequest extends RequestBase { - public InfoRequest() {} +public final class InfoRequest extends RequestBase implements ToCopyableBuilder { + + // --------------------------------------------------------------------------------------------- + + private InfoRequest(Builder builder) { + super(builder); + } + + public static InfoRequest 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(); + } /** - * Singleton instance for {@link InfoRequest}. + * Builder for {@link InfoRequest}. */ - public static final InfoRequest _INSTANCE = new InfoRequest(); + public static class Builder extends RequestBase.AbstractBuilder implements CopyableBuilder { + + public Builder() {} + + private Builder(InfoRequest 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; + } + + /** + * Builds a {@link InfoRequest}. + * + * @throws NullPointerException if some of the required fields are null. + */ + @Override + @Nonnull + public InfoRequest build() { + _checkSingleUse(); + + return new InfoRequest(this); + } + } // --------------------------------------------------------------------------------------------- @@ -67,7 +132,11 @@ public InfoRequest() {} // Request path request -> "/", // Request parameters - SimpleEndpoint.emptyMap(), + request -> { + Map params = new HashMap<>(); + request.applyQueryParameters(params); + return params; + }, SimpleEndpoint.emptyMap(), false, InfoResponse._DESERIALIZER diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/dangling_indices/DeleteDanglingIndexRequest.java b/java-client/src/generated/java/org/opensearch/client/opensearch/dangling_indices/DeleteDanglingIndexRequest.java index b957a11d32..85a64981e4 100644 --- a/java-client/src/generated/java/org/opensearch/client/opensearch/dangling_indices/DeleteDanglingIndexRequest.java +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/dangling_indices/DeleteDanglingIndexRequest.java @@ -51,7 +51,6 @@ 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: dangling_indices.delete_dangling_index.Request @@ -60,7 +59,7 @@ * Deletes the specified dangling index. */ @Generated("org.opensearch.client.codegen.CodeGenerator") -public class DeleteDanglingIndexRequest extends RequestBase +public final class DeleteDanglingIndexRequest extends RequestBase implements ToCopyableBuilder { @@ -82,6 +81,7 @@ public class DeleteDanglingIndexRequest extends RequestBase // --------------------------------------------------------------------------------------------- private DeleteDanglingIndexRequest(Builder builder) { + super(builder); this.acceptDataLoss = ApiTypeHelper.requireNonNull(builder.acceptDataLoss, this, "acceptDataLoss"); this.clusterManagerTimeout = builder.clusterManagerTimeout; this.indexUuid = ApiTypeHelper.requireNonNull(builder.indexUuid, this, "indexUuid"); @@ -166,7 +166,9 @@ public static Builder builder() { /** * Builder for {@link DeleteDanglingIndexRequest}. */ - public static class Builder extends ObjectBuilderBase implements CopyableBuilder { + public static class Builder extends RequestBase.AbstractBuilder + implements + CopyableBuilder { private Boolean acceptDataLoss; @Nullable private Time clusterManagerTimeout; @@ -179,6 +181,7 @@ public static class Builder extends ObjectBuilderBase implements CopyableBuilder public Builder() {} private Builder(DeleteDanglingIndexRequest o) { + super(o); this.acceptDataLoss = o.acceptDataLoss; this.clusterManagerTimeout = o.clusterManagerTimeout; this.indexUuid = o.indexUuid; @@ -187,6 +190,7 @@ private Builder(DeleteDanglingIndexRequest o) { } private Builder(Builder o) { + super(o); this.acceptDataLoss = o.acceptDataLoss; this.clusterManagerTimeout = o.clusterManagerTimeout; this.indexUuid = o.indexUuid; @@ -200,6 +204,12 @@ public Builder copy() { return new Builder(this); } + @Override + @Nonnull + protected Builder self() { + return this; + } + /** * Required - Must be set to true in order to delete the dangling index. *

@@ -311,6 +321,21 @@ public DeleteDanglingIndexRequest build() { // --------------------------------------------------------------------------------------------- + @Override + protected void applyQueryParameters(@Nonnull Map params) { + super.applyQueryParameters(params); + params.put("accept_data_loss", String.valueOf(this.acceptDataLoss)); + if (this.clusterManagerTimeout != null) { + params.put("cluster_manager_timeout", this.clusterManagerTimeout._toJsonString()); + } + if (this.masterTimeout != null) { + params.put("master_timeout", this.masterTimeout._toJsonString()); + } + if (this.timeout != null) { + params.put("timeout", this.timeout._toJsonString()); + } + } + /** * Endpoint "{@code dangling_indices.delete_dangling_index}". */ @@ -327,16 +352,7 @@ public DeleteDanglingIndexRequest build() { // Request parameters request -> { Map params = new HashMap<>(); - params.put("accept_data_loss", String.valueOf(request.acceptDataLoss)); - 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()); - } + request.applyQueryParameters(params); return params; }, SimpleEndpoint.emptyMap(), diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/dangling_indices/ImportDanglingIndexRequest.java b/java-client/src/generated/java/org/opensearch/client/opensearch/dangling_indices/ImportDanglingIndexRequest.java index 1193c30050..ec4ebb7489 100644 --- a/java-client/src/generated/java/org/opensearch/client/opensearch/dangling_indices/ImportDanglingIndexRequest.java +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/dangling_indices/ImportDanglingIndexRequest.java @@ -51,7 +51,6 @@ 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: dangling_indices.import_dangling_index.Request @@ -60,7 +59,7 @@ * Imports the specified dangling index. */ @Generated("org.opensearch.client.codegen.CodeGenerator") -public class ImportDanglingIndexRequest extends RequestBase +public final class ImportDanglingIndexRequest extends RequestBase implements ToCopyableBuilder { @@ -82,6 +81,7 @@ public class ImportDanglingIndexRequest extends RequestBase // --------------------------------------------------------------------------------------------- private ImportDanglingIndexRequest(Builder builder) { + super(builder); this.acceptDataLoss = ApiTypeHelper.requireNonNull(builder.acceptDataLoss, this, "acceptDataLoss"); this.clusterManagerTimeout = builder.clusterManagerTimeout; this.indexUuid = ApiTypeHelper.requireNonNull(builder.indexUuid, this, "indexUuid"); @@ -166,7 +166,9 @@ public static Builder builder() { /** * Builder for {@link ImportDanglingIndexRequest}. */ - public static class Builder extends ObjectBuilderBase implements CopyableBuilder { + public static class Builder extends RequestBase.AbstractBuilder + implements + CopyableBuilder { private Boolean acceptDataLoss; @Nullable private Time clusterManagerTimeout; @@ -179,6 +181,7 @@ public static class Builder extends ObjectBuilderBase implements CopyableBuilder public Builder() {} private Builder(ImportDanglingIndexRequest o) { + super(o); this.acceptDataLoss = o.acceptDataLoss; this.clusterManagerTimeout = o.clusterManagerTimeout; this.indexUuid = o.indexUuid; @@ -187,6 +190,7 @@ private Builder(ImportDanglingIndexRequest o) { } private Builder(Builder o) { + super(o); this.acceptDataLoss = o.acceptDataLoss; this.clusterManagerTimeout = o.clusterManagerTimeout; this.indexUuid = o.indexUuid; @@ -200,6 +204,12 @@ public Builder copy() { return new Builder(this); } + @Override + @Nonnull + protected Builder self() { + return this; + } + /** * Required - Must be set to true in order to import the dangling index. *

@@ -311,6 +321,21 @@ public ImportDanglingIndexRequest build() { // --------------------------------------------------------------------------------------------- + @Override + protected void applyQueryParameters(@Nonnull Map params) { + super.applyQueryParameters(params); + params.put("accept_data_loss", String.valueOf(this.acceptDataLoss)); + if (this.clusterManagerTimeout != null) { + params.put("cluster_manager_timeout", this.clusterManagerTimeout._toJsonString()); + } + if (this.masterTimeout != null) { + params.put("master_timeout", this.masterTimeout._toJsonString()); + } + if (this.timeout != null) { + params.put("timeout", this.timeout._toJsonString()); + } + } + /** * Endpoint "{@code dangling_indices.import_dangling_index}". */ @@ -327,16 +352,7 @@ public ImportDanglingIndexRequest build() { // Request parameters request -> { Map params = new HashMap<>(); - params.put("accept_data_loss", String.valueOf(request.acceptDataLoss)); - 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()); - } + request.applyQueryParameters(params); return params; }, SimpleEndpoint.emptyMap(), diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/dangling_indices/ListDanglingIndicesRequest.java b/java-client/src/generated/java/org/opensearch/client/opensearch/dangling_indices/ListDanglingIndicesRequest.java index 9faeab6729..9c2fef9079 100644 --- a/java-client/src/generated/java/org/opensearch/client/opensearch/dangling_indices/ListDanglingIndicesRequest.java +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/dangling_indices/ListDanglingIndicesRequest.java @@ -36,11 +36,18 @@ package org.opensearch.client.opensearch.dangling_indices; +import java.util.HashMap; +import java.util.Map; +import java.util.function.Function; import javax.annotation.Generated; +import javax.annotation.Nonnull; import org.opensearch.client.opensearch._types.ErrorResponse; import org.opensearch.client.opensearch._types.RequestBase; 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.ToCopyableBuilder; // typedef: dangling_indices.list_dangling_indices.Request @@ -48,13 +55,77 @@ * Returns all dangling indexes. */ @Generated("org.opensearch.client.codegen.CodeGenerator") -public class ListDanglingIndicesRequest extends RequestBase { - public ListDanglingIndicesRequest() {} +public final class ListDanglingIndicesRequest extends RequestBase + implements + ToCopyableBuilder { + + // --------------------------------------------------------------------------------------------- + + private ListDanglingIndicesRequest(Builder builder) { + super(builder); + } + + public static ListDanglingIndicesRequest 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(); + } /** - * Singleton instance for {@link ListDanglingIndicesRequest}. + * Builder for {@link ListDanglingIndicesRequest}. */ - public static final ListDanglingIndicesRequest _INSTANCE = new ListDanglingIndicesRequest(); + public static class Builder extends RequestBase.AbstractBuilder + implements + CopyableBuilder { + + public Builder() {} + + private Builder(ListDanglingIndicesRequest 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; + } + + /** + * Builds a {@link ListDanglingIndicesRequest}. + * + * @throws NullPointerException if some of the required fields are null. + */ + @Override + @Nonnull + public ListDanglingIndicesRequest build() { + _checkSingleUse(); + + return new ListDanglingIndicesRequest(this); + } + } // --------------------------------------------------------------------------------------------- @@ -67,7 +138,11 @@ public ListDanglingIndicesRequest() {} // Request path request -> "/_dangling", // Request parameters - SimpleEndpoint.emptyMap(), + request -> { + Map params = new HashMap<>(); + request.applyQueryParameters(params); + return params; + }, SimpleEndpoint.emptyMap(), false, ListDanglingIndicesResponse._DESERIALIZER diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/dangling_indices/OpenSearchDanglingIndicesAsyncClient.java b/java-client/src/generated/java/org/opensearch/client/opensearch/dangling_indices/OpenSearchDanglingIndicesAsyncClient.java index 5ebdc746f2..7f73f61df0 100644 --- a/java-client/src/generated/java/org/opensearch/client/opensearch/dangling_indices/OpenSearchDanglingIndicesAsyncClient.java +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/dangling_indices/OpenSearchDanglingIndicesAsyncClient.java @@ -112,11 +112,26 @@ public final CompletableFuture importDanglingIndex( /** * Returns all dangling indexes. */ - public CompletableFuture listDanglingIndices() throws IOException, OpenSearchException { - return this.transport.performRequestAsync( - ListDanglingIndicesRequest._INSTANCE, - ListDanglingIndicesRequest._ENDPOINT, - this.transportOptions - ); + public CompletableFuture listDanglingIndices(ListDanglingIndicesRequest request) throws IOException, + OpenSearchException { + return this.transport.performRequestAsync(request, ListDanglingIndicesRequest._ENDPOINT, this.transportOptions); + } + + /** + * Returns all dangling indexes. + * + * @param fn a function that initializes a builder to create the {@link ListDanglingIndicesRequest} + */ + public final CompletableFuture listDanglingIndices( + Function> fn + ) throws IOException, OpenSearchException { + return listDanglingIndices(fn.apply(new ListDanglingIndicesRequest.Builder()).build()); + } + + /** + * Returns all dangling indexes. + */ + public final CompletableFuture listDanglingIndices() throws IOException, OpenSearchException { + return listDanglingIndices(new ListDanglingIndicesRequest.Builder().build()); } } diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/dangling_indices/OpenSearchDanglingIndicesClient.java b/java-client/src/generated/java/org/opensearch/client/opensearch/dangling_indices/OpenSearchDanglingIndicesClient.java index 131b78c595..cce5770114 100644 --- a/java-client/src/generated/java/org/opensearch/client/opensearch/dangling_indices/OpenSearchDanglingIndicesClient.java +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/dangling_indices/OpenSearchDanglingIndicesClient.java @@ -109,11 +109,25 @@ public final ImportDanglingIndexResponse importDanglingIndex( /** * Returns all dangling indexes. */ - public ListDanglingIndicesResponse listDanglingIndices() throws IOException, OpenSearchException { - return this.transport.performRequest( - ListDanglingIndicesRequest._INSTANCE, - ListDanglingIndicesRequest._ENDPOINT, - this.transportOptions - ); + public ListDanglingIndicesResponse listDanglingIndices(ListDanglingIndicesRequest request) throws IOException, OpenSearchException { + return this.transport.performRequest(request, ListDanglingIndicesRequest._ENDPOINT, this.transportOptions); + } + + /** + * Returns all dangling indexes. + * + * @param fn a function that initializes a builder to create the {@link ListDanglingIndicesRequest} + */ + public final ListDanglingIndicesResponse listDanglingIndices( + Function> fn + ) throws IOException, OpenSearchException { + return listDanglingIndices(fn.apply(new ListDanglingIndicesRequest.Builder()).build()); + } + + /** + * Returns all dangling indexes. + */ + public final ListDanglingIndicesResponse listDanglingIndices() throws IOException, OpenSearchException { + return listDanglingIndices(new ListDanglingIndicesRequest.Builder().build()); } } diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/indices/AddBlockRequest.java b/java-client/src/generated/java/org/opensearch/client/opensearch/indices/AddBlockRequest.java index 7714853e04..e43849de60 100644 --- a/java-client/src/generated/java/org/opensearch/client/opensearch/indices/AddBlockRequest.java +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/indices/AddBlockRequest.java @@ -55,7 +55,6 @@ 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: indices.add_block.Request @@ -64,7 +63,7 @@ * Adds a block to an index. */ @Generated("org.opensearch.client.codegen.CodeGenerator") -public class AddBlockRequest extends RequestBase implements ToCopyableBuilder { +public final class AddBlockRequest extends RequestBase implements ToCopyableBuilder { @Nullable private final Boolean allowNoIndices; @@ -94,6 +93,7 @@ public class AddBlockRequest extends RequestBase implements ToCopyableBuilder { + public static class Builder extends RequestBase.AbstractBuilder implements CopyableBuilder { @Nullable private Boolean allowNoIndices; private IndicesBlockOptions block; @@ -233,6 +233,7 @@ public static class Builder extends ObjectBuilderBase implements CopyableBuilder public Builder() {} private Builder(AddBlockRequest o) { + super(o); this.allowNoIndices = o.allowNoIndices; this.block = o.block; this.clusterManagerTimeout = o.clusterManagerTimeout; @@ -244,6 +245,7 @@ private Builder(AddBlockRequest o) { } private Builder(Builder o) { + super(o); this.allowNoIndices = o.allowNoIndices; this.block = o.block; this.clusterManagerTimeout = o.clusterManagerTimeout; @@ -260,6 +262,12 @@ public Builder copy() { return new Builder(this); } + @Override + @Nonnull + protected Builder self() { + return this; + } + /** * Whether to ignore if a wildcard indexes expression resolves into no concrete indexes. (This includes _all string or * when no indexes have been specified). @@ -448,6 +456,29 @@ public AddBlockRequest build() { // --------------------------------------------------------------------------------------------- + @Override + protected void applyQueryParameters(@Nonnull Map params) { + super.applyQueryParameters(params); + if (this.allowNoIndices != null) { + params.put("allow_no_indices", String.valueOf(this.allowNoIndices)); + } + if (this.clusterManagerTimeout != null) { + params.put("cluster_manager_timeout", this.clusterManagerTimeout._toJsonString()); + } + if (ApiTypeHelper.isDefined(this.expandWildcards)) { + params.put("expand_wildcards", this.expandWildcards.stream().map(v -> v.jsonValue()).collect(Collectors.joining(","))); + } + if (this.ignoreUnavailable != null) { + params.put("ignore_unavailable", String.valueOf(this.ignoreUnavailable)); + } + if (this.masterTimeout != null) { + params.put("master_timeout", this.masterTimeout._toJsonString()); + } + if (this.timeout != null) { + params.put("timeout", this.timeout._toJsonString()); + } + } + /** * Endpoint "{@code indices.add_block}". */ @@ -466,24 +497,7 @@ public AddBlockRequest build() { // Request parameters request -> { Map params = new HashMap<>(); - if (request.allowNoIndices != null) { - params.put("allow_no_indices", String.valueOf(request.allowNoIndices)); - } - if (request.clusterManagerTimeout != null) { - params.put("cluster_manager_timeout", request.clusterManagerTimeout._toJsonString()); - } - if (ApiTypeHelper.isDefined(request.expandWildcards)) { - params.put("expand_wildcards", request.expandWildcards.stream().map(v -> v.jsonValue()).collect(Collectors.joining(","))); - } - if (request.ignoreUnavailable != null) { - params.put("ignore_unavailable", String.valueOf(request.ignoreUnavailable)); - } - if (request.masterTimeout != null) { - params.put("master_timeout", request.masterTimeout._toJsonString()); - } - if (request.timeout != null) { - params.put("timeout", request.timeout._toJsonString()); - } + request.applyQueryParameters(params); return params; }, SimpleEndpoint.emptyMap(), diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/indices/AnalyzeRequest.java b/java-client/src/generated/java/org/opensearch/client/opensearch/indices/AnalyzeRequest.java index 9a11f21ba2..431b6af007 100644 --- a/java-client/src/generated/java/org/opensearch/client/opensearch/indices/AnalyzeRequest.java +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/indices/AnalyzeRequest.java @@ -37,7 +37,9 @@ package org.opensearch.client.opensearch.indices; import jakarta.json.stream.JsonGenerator; +import java.util.HashMap; import java.util.List; +import java.util.Map; import java.util.Objects; import java.util.function.Function; import javax.annotation.Generated; @@ -59,7 +61,6 @@ 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: indices.analyze.Request @@ -69,7 +70,7 @@ */ @JsonpDeserializable @Generated("org.opensearch.client.codegen.CodeGenerator") -public class AnalyzeRequest extends RequestBase +public final class AnalyzeRequest extends RequestBase implements PlainJsonSerializable, ToCopyableBuilder { @@ -107,6 +108,7 @@ public class AnalyzeRequest extends RequestBase // --------------------------------------------------------------------------------------------- private AnalyzeRequest(Builder builder) { + super(builder); this.analyzer = builder.analyzer; this.attributes = ApiTypeHelper.unmodifiable(builder.attributes); this.charFilter = ApiTypeHelper.unmodifiable(builder.charFilter); @@ -314,7 +316,7 @@ public static Builder builder() { /** * Builder for {@link AnalyzeRequest}. */ - public static class Builder extends ObjectBuilderBase implements CopyableBuilder { + public static class Builder extends RequestBase.AbstractBuilder implements CopyableBuilder { @Nullable private String analyzer; @Nullable @@ -339,6 +341,7 @@ public static class Builder extends ObjectBuilderBase implements CopyableBuilder public Builder() {} private Builder(AnalyzeRequest o) { + super(o); this.analyzer = o.analyzer; this.attributes = _listCopy(o.attributes); this.charFilter = _listCopy(o.charFilter); @@ -352,6 +355,7 @@ private Builder(AnalyzeRequest o) { } private Builder(Builder o) { + super(o); this.analyzer = o.analyzer; this.attributes = _listCopy(o.attributes); this.charFilter = _listCopy(o.charFilter); @@ -370,6 +374,12 @@ public Builder copy() { return new Builder(this); } + @Override + @Nonnull + protected Builder self() { + return this; + } + /** * The name of the analyzer that should be applied to the provided text. This could be a built-in analyzer, or an * analyzer that's been configured in the index. @@ -664,7 +674,11 @@ protected static void setupAnalyzeRequestDeserializer(ObjectDeserializer { + Map params = new HashMap<>(); + request.applyQueryParameters(params); + return params; + }, SimpleEndpoint.emptyMap(), true, AnalyzeResponse._DESERIALIZER diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/indices/ClearCacheRequest.java b/java-client/src/generated/java/org/opensearch/client/opensearch/indices/ClearCacheRequest.java index bcdb1e5454..b3c5004acc 100644 --- a/java-client/src/generated/java/org/opensearch/client/opensearch/indices/ClearCacheRequest.java +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/indices/ClearCacheRequest.java @@ -53,7 +53,6 @@ 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: indices.clear_cache.Request @@ -62,7 +61,7 @@ * Clears all or specific caches for one or more indexes. */ @Generated("org.opensearch.client.codegen.CodeGenerator") -public class ClearCacheRequest extends RequestBase implements ToCopyableBuilder { +public final class ClearCacheRequest extends RequestBase implements ToCopyableBuilder { @Nullable private final Boolean allowNoIndices; @@ -94,6 +93,7 @@ public class ClearCacheRequest extends RequestBase implements ToCopyableBuilder< // --------------------------------------------------------------------------------------------- private ClearCacheRequest(Builder builder) { + super(builder); this.allowNoIndices = builder.allowNoIndices; this.expandWildcards = ApiTypeHelper.unmodifiable(builder.expandWildcards); this.fielddata = builder.fielddata; @@ -228,7 +228,7 @@ public static Builder builder() { /** * Builder for {@link ClearCacheRequest}. */ - public static class Builder extends ObjectBuilderBase implements CopyableBuilder { + public static class Builder extends RequestBase.AbstractBuilder implements CopyableBuilder { @Nullable private Boolean allowNoIndices; @Nullable @@ -251,6 +251,7 @@ public static class Builder extends ObjectBuilderBase implements CopyableBuilder public Builder() {} private Builder(ClearCacheRequest o) { + super(o); this.allowNoIndices = o.allowNoIndices; this.expandWildcards = _listCopy(o.expandWildcards); this.fielddata = o.fielddata; @@ -263,6 +264,7 @@ private Builder(ClearCacheRequest o) { } private Builder(Builder o) { + super(o); this.allowNoIndices = o.allowNoIndices; this.expandWildcards = _listCopy(o.expandWildcards); this.fielddata = o.fielddata; @@ -280,6 +282,12 @@ public Builder copy() { return new Builder(this); } + @Override + @Nonnull + protected Builder self() { + return this; + } + /** * If false, the request returns an error if any wildcard expression, index alias, or _all value targets * only missing or closed indexes. This behavior applies even if the request targets other open indexes. @@ -471,6 +479,35 @@ public ClearCacheRequest build() { // --------------------------------------------------------------------------------------------- + @Override + protected void applyQueryParameters(@Nonnull Map params) { + super.applyQueryParameters(params); + if (this.allowNoIndices != null) { + params.put("allow_no_indices", String.valueOf(this.allowNoIndices)); + } + if (ApiTypeHelper.isDefined(this.expandWildcards)) { + params.put("expand_wildcards", this.expandWildcards.stream().map(v -> v.jsonValue()).collect(Collectors.joining(","))); + } + if (this.fielddata != null) { + params.put("fielddata", String.valueOf(this.fielddata)); + } + if (ApiTypeHelper.isDefined(this.fields)) { + params.put("fields", String.join(",", this.fields)); + } + if (this.file != null) { + params.put("file", String.valueOf(this.file)); + } + if (this.ignoreUnavailable != null) { + params.put("ignore_unavailable", String.valueOf(this.ignoreUnavailable)); + } + if (this.query != null) { + params.put("query", String.valueOf(this.query)); + } + if (this.request != null) { + params.put("request", String.valueOf(this.request)); + } + } + /** * Endpoint "{@code indices.clear_cache}". */ @@ -501,30 +538,7 @@ public ClearCacheRequest build() { // Request parameters request -> { Map params = new HashMap<>(); - if (request.allowNoIndices != null) { - params.put("allow_no_indices", String.valueOf(request.allowNoIndices)); - } - if (ApiTypeHelper.isDefined(request.expandWildcards)) { - params.put("expand_wildcards", request.expandWildcards.stream().map(v -> v.jsonValue()).collect(Collectors.joining(","))); - } - if (request.fielddata != null) { - params.put("fielddata", String.valueOf(request.fielddata)); - } - if (ApiTypeHelper.isDefined(request.fields)) { - params.put("fields", String.join(",", request.fields)); - } - if (request.file != null) { - params.put("file", String.valueOf(request.file)); - } - if (request.ignoreUnavailable != null) { - params.put("ignore_unavailable", String.valueOf(request.ignoreUnavailable)); - } - if (request.query != null) { - params.put("query", String.valueOf(request.query)); - } - if (request.request != null) { - params.put("request", String.valueOf(request.request)); - } + request.applyQueryParameters(params); return params; }, SimpleEndpoint.emptyMap(), diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/indices/CloneIndexRequest.java b/java-client/src/generated/java/org/opensearch/client/opensearch/indices/CloneIndexRequest.java index b1141255b2..81a967abf6 100644 --- a/java-client/src/generated/java/org/opensearch/client/opensearch/indices/CloneIndexRequest.java +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/indices/CloneIndexRequest.java @@ -60,7 +60,6 @@ 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: indices.clone.Request @@ -70,7 +69,7 @@ */ @JsonpDeserializable @Generated("org.opensearch.client.codegen.CodeGenerator") -public class CloneIndexRequest extends RequestBase +public final class CloneIndexRequest extends RequestBase implements PlainJsonSerializable, ToCopyableBuilder { @@ -109,6 +108,7 @@ public class CloneIndexRequest extends RequestBase // --------------------------------------------------------------------------------------------- private CloneIndexRequest(Builder builder) { + super(builder); this.aliases = ApiTypeHelper.unmodifiable(builder.aliases); this.clusterManagerTimeout = builder.clusterManagerTimeout; this.index = ApiTypeHelper.requireNonNull(builder.index, this, "index"); @@ -285,7 +285,7 @@ public static Builder builder() { /** * Builder for {@link CloneIndexRequest}. */ - public static class Builder extends ObjectBuilderBase implements CopyableBuilder { + public static class Builder extends RequestBase.AbstractBuilder implements CopyableBuilder { @Nullable private Map aliases; @Nullable @@ -308,6 +308,7 @@ public static class Builder extends ObjectBuilderBase implements CopyableBuilder public Builder() {} private Builder(CloneIndexRequest o) { + super(o); this.aliases = _mapCopy(o.aliases); this.clusterManagerTimeout = o.clusterManagerTimeout; this.index = o.index; @@ -321,6 +322,7 @@ private Builder(CloneIndexRequest o) { } private Builder(Builder o) { + super(o); this.aliases = _mapCopy(o.aliases); this.clusterManagerTimeout = o.clusterManagerTimeout; this.index = o.index; @@ -339,6 +341,12 @@ public Builder copy() { return new Builder(this); } + @Override + @Nonnull + protected Builder self() { + return this; + } + /** * Aliases for the resulting index. *

@@ -606,6 +614,29 @@ protected static void setupCloneIndexRequestDeserializer(ObjectDeserializer params) { + super.applyQueryParameters(params); + if (this.clusterManagerTimeout != null) { + params.put("cluster_manager_timeout", this.clusterManagerTimeout._toJsonString()); + } + if (this.masterTimeout != null) { + params.put("master_timeout", this.masterTimeout._toJsonString()); + } + if (this.taskExecutionTimeout != null) { + params.put("task_execution_timeout", this.taskExecutionTimeout._toJsonString()); + } + if (this.timeout != null) { + params.put("timeout", this.timeout._toJsonString()); + } + if (this.waitForActiveShards != null) { + params.put("wait_for_active_shards", this.waitForActiveShards._toJsonString()); + } + if (this.waitForCompletion != null) { + params.put("wait_for_completion", String.valueOf(this.waitForCompletion)); + } + } + /** * Endpoint "{@code indices.clone}". */ @@ -624,24 +655,7 @@ protected static void setupCloneIndexRequestDeserializer(ObjectDeserializer { Map params = new HashMap<>(); - 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.taskExecutionTimeout != null) { - params.put("task_execution_timeout", request.taskExecutionTimeout._toJsonString()); - } - 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.waitForCompletion != null) { - params.put("wait_for_completion", String.valueOf(request.waitForCompletion)); - } + request.applyQueryParameters(params); return params; }, SimpleEndpoint.emptyMap(), diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/indices/CloseIndexRequest.java b/java-client/src/generated/java/org/opensearch/client/opensearch/indices/CloseIndexRequest.java index 2740b47027..a282462b57 100644 --- a/java-client/src/generated/java/org/opensearch/client/opensearch/indices/CloseIndexRequest.java +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/indices/CloseIndexRequest.java @@ -55,7 +55,6 @@ 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: indices.close.Request @@ -64,7 +63,7 @@ * Closes an index. */ @Generated("org.opensearch.client.codegen.CodeGenerator") -public class CloseIndexRequest extends RequestBase implements ToCopyableBuilder { +public final class CloseIndexRequest extends RequestBase implements ToCopyableBuilder { @Nullable private final Boolean allowNoIndices; @@ -94,6 +93,7 @@ public class CloseIndexRequest extends RequestBase implements ToCopyableBuilder< // --------------------------------------------------------------------------------------------- private CloseIndexRequest(Builder builder) { + super(builder); this.allowNoIndices = builder.allowNoIndices; this.clusterManagerTimeout = builder.clusterManagerTimeout; this.expandWildcards = ApiTypeHelper.unmodifiable(builder.expandWildcards); @@ -218,7 +218,7 @@ public static Builder builder() { /** * Builder for {@link CloseIndexRequest}. */ - public static class Builder extends ObjectBuilderBase implements CopyableBuilder { + public static class Builder extends RequestBase.AbstractBuilder implements CopyableBuilder { @Nullable private Boolean allowNoIndices; @Nullable @@ -238,6 +238,7 @@ public static class Builder extends ObjectBuilderBase implements CopyableBuilder public Builder() {} private Builder(CloseIndexRequest o) { + super(o); this.allowNoIndices = o.allowNoIndices; this.clusterManagerTimeout = o.clusterManagerTimeout; this.expandWildcards = _listCopy(o.expandWildcards); @@ -249,6 +250,7 @@ private Builder(CloseIndexRequest o) { } private Builder(Builder o) { + super(o); this.allowNoIndices = o.allowNoIndices; this.clusterManagerTimeout = o.clusterManagerTimeout; this.expandWildcards = _listCopy(o.expandWildcards); @@ -265,6 +267,12 @@ public Builder copy() { return new Builder(this); } + @Override + @Nonnull + protected Builder self() { + return this; + } + /** * If false, the request returns an error if any wildcard expression, index alias, or _all value targets * only missing or closed indexes. This behavior applies even if the request targets other open indexes. @@ -472,6 +480,32 @@ public CloseIndexRequest build() { // --------------------------------------------------------------------------------------------- + @Override + protected void applyQueryParameters(@Nonnull Map params) { + super.applyQueryParameters(params); + if (this.allowNoIndices != null) { + params.put("allow_no_indices", String.valueOf(this.allowNoIndices)); + } + if (this.clusterManagerTimeout != null) { + params.put("cluster_manager_timeout", this.clusterManagerTimeout._toJsonString()); + } + if (ApiTypeHelper.isDefined(this.expandWildcards)) { + params.put("expand_wildcards", this.expandWildcards.stream().map(v -> v.jsonValue()).collect(Collectors.joining(","))); + } + if (this.ignoreUnavailable != null) { + params.put("ignore_unavailable", String.valueOf(this.ignoreUnavailable)); + } + if (this.masterTimeout != null) { + params.put("master_timeout", this.masterTimeout._toJsonString()); + } + if (this.timeout != null) { + params.put("timeout", this.timeout._toJsonString()); + } + if (this.waitForActiveShards != null) { + params.put("wait_for_active_shards", this.waitForActiveShards._toJsonString()); + } + } + /** * Endpoint "{@code indices.close}". */ @@ -489,27 +523,7 @@ public CloseIndexRequest build() { // Request parameters request -> { Map params = new HashMap<>(); - if (request.allowNoIndices != null) { - params.put("allow_no_indices", String.valueOf(request.allowNoIndices)); - } - if (request.clusterManagerTimeout != null) { - params.put("cluster_manager_timeout", request.clusterManagerTimeout._toJsonString()); - } - if (ApiTypeHelper.isDefined(request.expandWildcards)) { - params.put("expand_wildcards", request.expandWildcards.stream().map(v -> v.jsonValue()).collect(Collectors.joining(","))); - } - if (request.ignoreUnavailable != null) { - params.put("ignore_unavailable", String.valueOf(request.ignoreUnavailable)); - } - if (request.masterTimeout != null) { - params.put("master_timeout", request.masterTimeout._toJsonString()); - } - if (request.timeout != null) { - params.put("timeout", request.timeout._toJsonString()); - } - if (request.waitForActiveShards != null) { - params.put("wait_for_active_shards", request.waitForActiveShards._toJsonString()); - } + request.applyQueryParameters(params); return params; }, SimpleEndpoint.emptyMap(), diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/indices/CreateDataStreamRequest.java b/java-client/src/generated/java/org/opensearch/client/opensearch/indices/CreateDataStreamRequest.java index 620b38124a..cc4066f4d5 100644 --- a/java-client/src/generated/java/org/opensearch/client/opensearch/indices/CreateDataStreamRequest.java +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/indices/CreateDataStreamRequest.java @@ -36,6 +36,8 @@ package org.opensearch.client.opensearch.indices; +import java.util.HashMap; +import java.util.Map; import java.util.function.Function; import javax.annotation.Generated; import javax.annotation.Nonnull; @@ -46,7 +48,6 @@ 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: indices.create_data_stream.Request @@ -55,7 +56,7 @@ * Creates or updates a data stream. */ @Generated("org.opensearch.client.codegen.CodeGenerator") -public class CreateDataStreamRequest extends RequestBase +public final class CreateDataStreamRequest extends RequestBase implements ToCopyableBuilder { @@ -65,6 +66,7 @@ public class CreateDataStreamRequest extends RequestBase // --------------------------------------------------------------------------------------------- private CreateDataStreamRequest(Builder builder) { + super(builder); this.name = ApiTypeHelper.requireNonNull(builder.name, this, "name"); } @@ -103,16 +105,18 @@ public static Builder builder() { /** * Builder for {@link CreateDataStreamRequest}. */ - public static class Builder extends ObjectBuilderBase implements CopyableBuilder { + public static class Builder extends RequestBase.AbstractBuilder implements CopyableBuilder { private String name; public Builder() {} private Builder(CreateDataStreamRequest o) { + super(o); this.name = o.name; } private Builder(Builder o) { + super(o); this.name = o.name; } @@ -122,6 +126,12 @@ public Builder copy() { return new Builder(this); } + @Override + @Nonnull + protected Builder self() { + return this; + } + /** * Required - Name of the data stream, which must meet the following criteria: Lowercase only; Cannot include \, * /, *, ?, ", <, >, |, @@ -168,7 +178,11 @@ public CreateDataStreamRequest build() { return buf.toString(); }, // Request parameters - SimpleEndpoint.emptyMap(), + request -> { + Map params = new HashMap<>(); + request.applyQueryParameters(params); + return params; + }, SimpleEndpoint.emptyMap(), false, CreateDataStreamResponse._DESERIALIZER diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/indices/CreateIndexRequest.java b/java-client/src/generated/java/org/opensearch/client/opensearch/indices/CreateIndexRequest.java index 581cd228cf..fae06e97cb 100644 --- a/java-client/src/generated/java/org/opensearch/client/opensearch/indices/CreateIndexRequest.java +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/indices/CreateIndexRequest.java @@ -60,7 +60,6 @@ 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: indices.create.Request @@ -70,7 +69,7 @@ */ @JsonpDeserializable @Generated("org.opensearch.client.codegen.CodeGenerator") -public class CreateIndexRequest extends RequestBase +public final class CreateIndexRequest extends RequestBase implements PlainJsonSerializable, ToCopyableBuilder { @@ -103,6 +102,7 @@ public class CreateIndexRequest extends RequestBase // --------------------------------------------------------------------------------------------- private CreateIndexRequest(Builder builder) { + super(builder); this.aliases = ApiTypeHelper.unmodifiable(builder.aliases); this.clusterManagerTimeout = builder.clusterManagerTimeout; this.index = ApiTypeHelper.requireNonNull(builder.index, this, "index"); @@ -249,7 +249,7 @@ public static Builder builder() { /** * Builder for {@link CreateIndexRequest}. */ - public static class Builder extends ObjectBuilderBase implements CopyableBuilder { + public static class Builder extends RequestBase.AbstractBuilder implements CopyableBuilder { @Nullable private Map aliases; @Nullable @@ -269,6 +269,7 @@ public static class Builder extends ObjectBuilderBase implements CopyableBuilder public Builder() {} private Builder(CreateIndexRequest o) { + super(o); this.aliases = _mapCopy(o.aliases); this.clusterManagerTimeout = o.clusterManagerTimeout; this.index = o.index; @@ -280,6 +281,7 @@ private Builder(CreateIndexRequest o) { } private Builder(Builder o) { + super(o); this.aliases = _mapCopy(o.aliases); this.clusterManagerTimeout = o.clusterManagerTimeout; this.index = o.index; @@ -296,6 +298,12 @@ public Builder copy() { return new Builder(this); } + @Override + @Nonnull + protected Builder self() { + return this; + } + /** * Aliases for the index. *

@@ -519,6 +527,23 @@ protected static void setupCreateIndexRequestDeserializer(ObjectDeserializer params) { + super.applyQueryParameters(params); + if (this.clusterManagerTimeout != null) { + params.put("cluster_manager_timeout", this.clusterManagerTimeout._toJsonString()); + } + if (this.masterTimeout != null) { + params.put("master_timeout", this.masterTimeout._toJsonString()); + } + if (this.timeout != null) { + params.put("timeout", this.timeout._toJsonString()); + } + if (this.waitForActiveShards != null) { + params.put("wait_for_active_shards", this.waitForActiveShards._toJsonString()); + } + } + /** * Endpoint "{@code indices.create}". */ @@ -535,18 +560,7 @@ protected static void setupCreateIndexRequestDeserializer(ObjectDeserializer { Map params = new HashMap<>(); - 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()); - } - if (request.waitForActiveShards != null) { - params.put("wait_for_active_shards", request.waitForActiveShards._toJsonString()); - } + request.applyQueryParameters(params); return params; }, SimpleEndpoint.emptyMap(), diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/indices/DataStreamsStatsRequest.java b/java-client/src/generated/java/org/opensearch/client/opensearch/indices/DataStreamsStatsRequest.java index 1705c606cc..d5f9c1bf4f 100644 --- a/java-client/src/generated/java/org/opensearch/client/opensearch/indices/DataStreamsStatsRequest.java +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/indices/DataStreamsStatsRequest.java @@ -36,7 +36,9 @@ package org.opensearch.client.opensearch.indices; +import java.util.HashMap; import java.util.List; +import java.util.Map; import java.util.Objects; import java.util.function.Function; import javax.annotation.Generated; @@ -49,7 +51,6 @@ 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: indices.data_streams_stats.Request @@ -58,7 +59,7 @@ * Provides statistics on operations happening in a data stream. */ @Generated("org.opensearch.client.codegen.CodeGenerator") -public class DataStreamsStatsRequest extends RequestBase +public final class DataStreamsStatsRequest extends RequestBase implements ToCopyableBuilder { @@ -68,6 +69,7 @@ public class DataStreamsStatsRequest extends RequestBase // --------------------------------------------------------------------------------------------- private DataStreamsStatsRequest(Builder builder) { + super(builder); this.name = ApiTypeHelper.unmodifiable(builder.name); } @@ -103,17 +105,19 @@ public static Builder builder() { /** * Builder for {@link DataStreamsStatsRequest}. */ - public static class Builder extends ObjectBuilderBase implements CopyableBuilder { + public static class Builder extends RequestBase.AbstractBuilder implements CopyableBuilder { @Nullable private List name; public Builder() {} private Builder(DataStreamsStatsRequest o) { + super(o); this.name = _listCopy(o.name); } private Builder(Builder o) { + super(o); this.name = _listCopy(o.name); } @@ -123,6 +127,12 @@ public Builder copy() { return new Builder(this); } + @Override + @Nonnull + protected Builder self() { + return this; + } + /** * Comma-separated list of data streams used to limit the request. Wildcard expressions (*) are supported. To target * all data streams in a cluster, omit this parameter or use *. @@ -201,7 +211,11 @@ public DataStreamsStatsRequest build() { throw SimpleEndpoint.noPathTemplateFound("path"); }, // Request parameters - SimpleEndpoint.emptyMap(), + request -> { + Map params = new HashMap<>(); + request.applyQueryParameters(params); + return params; + }, SimpleEndpoint.emptyMap(), false, DataStreamsStatsResponse._DESERIALIZER diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/indices/DeleteAliasRequest.java b/java-client/src/generated/java/org/opensearch/client/opensearch/indices/DeleteAliasRequest.java index d706fc851e..0b5d8392b5 100644 --- a/java-client/src/generated/java/org/opensearch/client/opensearch/indices/DeleteAliasRequest.java +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/indices/DeleteAliasRequest.java @@ -52,7 +52,6 @@ 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: indices.delete_alias.Request @@ -61,7 +60,7 @@ * Deletes an alias. */ @Generated("org.opensearch.client.codegen.CodeGenerator") -public class DeleteAliasRequest extends RequestBase implements ToCopyableBuilder { +public final class DeleteAliasRequest extends RequestBase implements ToCopyableBuilder { @Nullable private final Time clusterManagerTimeout; @@ -82,6 +81,7 @@ public class DeleteAliasRequest extends RequestBase implements ToCopyableBuilder // --------------------------------------------------------------------------------------------- private DeleteAliasRequest(Builder builder) { + super(builder); this.clusterManagerTimeout = builder.clusterManagerTimeout; this.index = ApiTypeHelper.unmodifiableRequired(builder.index, this, "index"); this.masterTimeout = builder.masterTimeout; @@ -167,7 +167,7 @@ public static Builder builder() { /** * Builder for {@link DeleteAliasRequest}. */ - public static class Builder extends ObjectBuilderBase implements CopyableBuilder { + public static class Builder extends RequestBase.AbstractBuilder implements CopyableBuilder { @Nullable private Time clusterManagerTimeout; private List index; @@ -180,6 +180,7 @@ public static class Builder extends ObjectBuilderBase implements CopyableBuilder public Builder() {} private Builder(DeleteAliasRequest o) { + super(o); this.clusterManagerTimeout = o.clusterManagerTimeout; this.index = _listCopy(o.index); this.masterTimeout = o.masterTimeout; @@ -188,6 +189,7 @@ private Builder(DeleteAliasRequest o) { } private Builder(Builder o) { + super(o); this.clusterManagerTimeout = o.clusterManagerTimeout; this.index = _listCopy(o.index); this.masterTimeout = o.masterTimeout; @@ -201,6 +203,12 @@ public Builder copy() { return new Builder(this); } + @Override + @Nonnull + protected Builder self() { + return this; + } + /** * Operation timeout for connection to cluster-manager node. *

@@ -356,6 +364,20 @@ public DeleteAliasRequest build() { // --------------------------------------------------------------------------------------------- + @Override + protected void applyQueryParameters(@Nonnull Map params) { + super.applyQueryParameters(params); + if (this.clusterManagerTimeout != null) { + params.put("cluster_manager_timeout", this.clusterManagerTimeout._toJsonString()); + } + if (this.masterTimeout != null) { + params.put("master_timeout", this.masterTimeout._toJsonString()); + } + if (this.timeout != null) { + params.put("timeout", this.timeout._toJsonString()); + } + } + /** * Endpoint "{@code indices.delete_alias}". */ @@ -374,15 +396,7 @@ public DeleteAliasRequest build() { // Request parameters request -> { Map params = new HashMap<>(); - 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()); - } + request.applyQueryParameters(params); return params; }, SimpleEndpoint.emptyMap(), diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/indices/DeleteDataStreamRequest.java b/java-client/src/generated/java/org/opensearch/client/opensearch/indices/DeleteDataStreamRequest.java index 5e4008ead8..2445b1f8d7 100644 --- a/java-client/src/generated/java/org/opensearch/client/opensearch/indices/DeleteDataStreamRequest.java +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/indices/DeleteDataStreamRequest.java @@ -36,7 +36,9 @@ package org.opensearch.client.opensearch.indices; +import java.util.HashMap; import java.util.List; +import java.util.Map; import java.util.function.Function; import javax.annotation.Generated; import javax.annotation.Nonnull; @@ -47,7 +49,6 @@ 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: indices.delete_data_stream.Request @@ -56,7 +57,7 @@ * Deletes a data stream. */ @Generated("org.opensearch.client.codegen.CodeGenerator") -public class DeleteDataStreamRequest extends RequestBase +public final class DeleteDataStreamRequest extends RequestBase implements ToCopyableBuilder { @@ -66,6 +67,7 @@ public class DeleteDataStreamRequest extends RequestBase // --------------------------------------------------------------------------------------------- private DeleteDataStreamRequest(Builder builder) { + super(builder); this.name = ApiTypeHelper.unmodifiableRequired(builder.name, this, "name"); } @@ -100,16 +102,18 @@ public static Builder builder() { /** * Builder for {@link DeleteDataStreamRequest}. */ - public static class Builder extends ObjectBuilderBase implements CopyableBuilder { + public static class Builder extends RequestBase.AbstractBuilder implements CopyableBuilder { private List name; public Builder() {} private Builder(DeleteDataStreamRequest o) { + super(o); this.name = _listCopy(o.name); } private Builder(Builder o) { + super(o); this.name = _listCopy(o.name); } @@ -119,6 +123,12 @@ public Builder copy() { return new Builder(this); } + @Override + @Nonnull + protected Builder self() { + return this; + } + /** * Required - Comma-separated list of data streams to delete. Wildcard (*) expressions are supported. *

@@ -181,7 +191,11 @@ public DeleteDataStreamRequest build() { return buf.toString(); }, // Request parameters - SimpleEndpoint.emptyMap(), + request -> { + Map params = new HashMap<>(); + request.applyQueryParameters(params); + return params; + }, SimpleEndpoint.emptyMap(), false, DeleteDataStreamResponse._DESERIALIZER diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/indices/DeleteIndexRequest.java b/java-client/src/generated/java/org/opensearch/client/opensearch/indices/DeleteIndexRequest.java index fa19cfbdda..44a580f7e6 100644 --- a/java-client/src/generated/java/org/opensearch/client/opensearch/indices/DeleteIndexRequest.java +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/indices/DeleteIndexRequest.java @@ -54,7 +54,6 @@ 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: indices.delete.Request @@ -63,7 +62,7 @@ * Deletes an index. */ @Generated("org.opensearch.client.codegen.CodeGenerator") -public class DeleteIndexRequest extends RequestBase implements ToCopyableBuilder { +public final class DeleteIndexRequest extends RequestBase implements ToCopyableBuilder { @Nullable private final Boolean allowNoIndices; @@ -90,6 +89,7 @@ public class DeleteIndexRequest extends RequestBase implements ToCopyableBuilder // --------------------------------------------------------------------------------------------- private DeleteIndexRequest(Builder builder) { + super(builder); this.allowNoIndices = builder.allowNoIndices; this.clusterManagerTimeout = builder.clusterManagerTimeout; this.expandWildcards = ApiTypeHelper.unmodifiable(builder.expandWildcards); @@ -203,7 +203,7 @@ public static Builder builder() { /** * Builder for {@link DeleteIndexRequest}. */ - public static class Builder extends ObjectBuilderBase implements CopyableBuilder { + public static class Builder extends RequestBase.AbstractBuilder implements CopyableBuilder { @Nullable private Boolean allowNoIndices; @Nullable @@ -221,6 +221,7 @@ public static class Builder extends ObjectBuilderBase implements CopyableBuilder public Builder() {} private Builder(DeleteIndexRequest o) { + super(o); this.allowNoIndices = o.allowNoIndices; this.clusterManagerTimeout = o.clusterManagerTimeout; this.expandWildcards = _listCopy(o.expandWildcards); @@ -231,6 +232,7 @@ private Builder(DeleteIndexRequest o) { } private Builder(Builder o) { + super(o); this.allowNoIndices = o.allowNoIndices; this.clusterManagerTimeout = o.clusterManagerTimeout; this.expandWildcards = _listCopy(o.expandWildcards); @@ -246,6 +248,12 @@ public Builder copy() { return new Builder(this); } + @Override + @Nonnull + protected Builder self() { + return this; + } + /** * If false, the request returns an error if any wildcard expression, index alias, or _all value targets * only missing or closed indexes. This behavior applies even if the request targets other open indexes. @@ -432,6 +440,29 @@ public DeleteIndexRequest build() { // --------------------------------------------------------------------------------------------- + @Override + protected void applyQueryParameters(@Nonnull Map params) { + super.applyQueryParameters(params); + if (this.allowNoIndices != null) { + params.put("allow_no_indices", String.valueOf(this.allowNoIndices)); + } + if (this.clusterManagerTimeout != null) { + params.put("cluster_manager_timeout", this.clusterManagerTimeout._toJsonString()); + } + if (ApiTypeHelper.isDefined(this.expandWildcards)) { + params.put("expand_wildcards", this.expandWildcards.stream().map(v -> v.jsonValue()).collect(Collectors.joining(","))); + } + if (this.ignoreUnavailable != null) { + params.put("ignore_unavailable", String.valueOf(this.ignoreUnavailable)); + } + if (this.masterTimeout != null) { + params.put("master_timeout", this.masterTimeout._toJsonString()); + } + if (this.timeout != null) { + params.put("timeout", this.timeout._toJsonString()); + } + } + /** * Endpoint "{@code indices.delete}". */ @@ -448,24 +479,7 @@ public DeleteIndexRequest build() { // Request parameters request -> { Map params = new HashMap<>(); - if (request.allowNoIndices != null) { - params.put("allow_no_indices", String.valueOf(request.allowNoIndices)); - } - if (request.clusterManagerTimeout != null) { - params.put("cluster_manager_timeout", request.clusterManagerTimeout._toJsonString()); - } - if (ApiTypeHelper.isDefined(request.expandWildcards)) { - params.put("expand_wildcards", request.expandWildcards.stream().map(v -> v.jsonValue()).collect(Collectors.joining(","))); - } - if (request.ignoreUnavailable != null) { - params.put("ignore_unavailable", String.valueOf(request.ignoreUnavailable)); - } - if (request.masterTimeout != null) { - params.put("master_timeout", request.masterTimeout._toJsonString()); - } - if (request.timeout != null) { - params.put("timeout", request.timeout._toJsonString()); - } + request.applyQueryParameters(params); return params; }, SimpleEndpoint.emptyMap(), diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/indices/DeleteIndexTemplateRequest.java b/java-client/src/generated/java/org/opensearch/client/opensearch/indices/DeleteIndexTemplateRequest.java index bca2da317d..0290988f29 100644 --- a/java-client/src/generated/java/org/opensearch/client/opensearch/indices/DeleteIndexTemplateRequest.java +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/indices/DeleteIndexTemplateRequest.java @@ -51,7 +51,6 @@ 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: indices.delete_index_template.Request @@ -60,7 +59,7 @@ * Deletes an index template. */ @Generated("org.opensearch.client.codegen.CodeGenerator") -public class DeleteIndexTemplateRequest extends RequestBase +public final class DeleteIndexTemplateRequest extends RequestBase implements ToCopyableBuilder { @@ -80,6 +79,7 @@ public class DeleteIndexTemplateRequest extends RequestBase // --------------------------------------------------------------------------------------------- private DeleteIndexTemplateRequest(Builder builder) { + super(builder); this.clusterManagerTimeout = builder.clusterManagerTimeout; this.masterTimeout = builder.masterTimeout; this.name = ApiTypeHelper.requireNonNull(builder.name, this, "name"); @@ -154,7 +154,9 @@ public static Builder builder() { /** * Builder for {@link DeleteIndexTemplateRequest}. */ - public static class Builder extends ObjectBuilderBase implements CopyableBuilder { + public static class Builder extends RequestBase.AbstractBuilder + implements + CopyableBuilder { @Nullable private Time clusterManagerTimeout; @Nullable @@ -166,6 +168,7 @@ public static class Builder extends ObjectBuilderBase implements CopyableBuilder public Builder() {} private Builder(DeleteIndexTemplateRequest o) { + super(o); this.clusterManagerTimeout = o.clusterManagerTimeout; this.masterTimeout = o.masterTimeout; this.name = o.name; @@ -173,6 +176,7 @@ private Builder(DeleteIndexTemplateRequest o) { } private Builder(Builder o) { + super(o); this.clusterManagerTimeout = o.clusterManagerTimeout; this.masterTimeout = o.masterTimeout; this.name = o.name; @@ -185,6 +189,12 @@ public Builder copy() { return new Builder(this); } + @Override + @Nonnull + protected Builder self() { + return this; + } + /** * Operation timeout for connection to cluster-manager node. *

@@ -286,6 +296,20 @@ public DeleteIndexTemplateRequest build() { // --------------------------------------------------------------------------------------------- + @Override + protected void applyQueryParameters(@Nonnull Map params) { + super.applyQueryParameters(params); + if (this.clusterManagerTimeout != null) { + params.put("cluster_manager_timeout", this.clusterManagerTimeout._toJsonString()); + } + if (this.masterTimeout != null) { + params.put("master_timeout", this.masterTimeout._toJsonString()); + } + if (this.timeout != null) { + params.put("timeout", this.timeout._toJsonString()); + } + } + /** * Endpoint "{@code indices.delete_index_template}". */ @@ -302,15 +326,7 @@ public DeleteIndexTemplateRequest build() { // Request parameters request -> { Map params = new HashMap<>(); - 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()); - } + request.applyQueryParameters(params); return params; }, SimpleEndpoint.emptyMap(), diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/indices/DeleteTemplateRequest.java b/java-client/src/generated/java/org/opensearch/client/opensearch/indices/DeleteTemplateRequest.java index aebbba89f1..ffa3ce4787 100644 --- a/java-client/src/generated/java/org/opensearch/client/opensearch/indices/DeleteTemplateRequest.java +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/indices/DeleteTemplateRequest.java @@ -51,7 +51,6 @@ 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: indices.delete_template.Request @@ -60,7 +59,9 @@ * Deletes an index template. */ @Generated("org.opensearch.client.codegen.CodeGenerator") -public class DeleteTemplateRequest extends RequestBase implements ToCopyableBuilder { +public final class DeleteTemplateRequest extends RequestBase + implements + ToCopyableBuilder { @Nullable private final Time clusterManagerTimeout; @@ -78,6 +79,7 @@ public class DeleteTemplateRequest extends RequestBase implements ToCopyableBuil // --------------------------------------------------------------------------------------------- private DeleteTemplateRequest(Builder builder) { + super(builder); this.clusterManagerTimeout = builder.clusterManagerTimeout; this.masterTimeout = builder.masterTimeout; this.name = ApiTypeHelper.requireNonNull(builder.name, this, "name"); @@ -150,7 +152,7 @@ public static Builder builder() { /** * Builder for {@link DeleteTemplateRequest}. */ - public static class Builder extends ObjectBuilderBase implements CopyableBuilder { + public static class Builder extends RequestBase.AbstractBuilder implements CopyableBuilder { @Nullable private Time clusterManagerTimeout; @Nullable @@ -162,6 +164,7 @@ public static class Builder extends ObjectBuilderBase implements CopyableBuilder public Builder() {} private Builder(DeleteTemplateRequest o) { + super(o); this.clusterManagerTimeout = o.clusterManagerTimeout; this.masterTimeout = o.masterTimeout; this.name = o.name; @@ -169,6 +172,7 @@ private Builder(DeleteTemplateRequest o) { } private Builder(Builder o) { + super(o); this.clusterManagerTimeout = o.clusterManagerTimeout; this.masterTimeout = o.masterTimeout; this.name = o.name; @@ -181,6 +185,12 @@ public Builder copy() { return new Builder(this); } + @Override + @Nonnull + protected Builder self() { + return this; + } + /** * Operation timeout for connection to cluster-manager node. *

@@ -282,6 +292,20 @@ public DeleteTemplateRequest build() { // --------------------------------------------------------------------------------------------- + @Override + protected void applyQueryParameters(@Nonnull Map params) { + super.applyQueryParameters(params); + if (this.clusterManagerTimeout != null) { + params.put("cluster_manager_timeout", this.clusterManagerTimeout._toJsonString()); + } + if (this.masterTimeout != null) { + params.put("master_timeout", this.masterTimeout._toJsonString()); + } + if (this.timeout != null) { + params.put("timeout", this.timeout._toJsonString()); + } + } + /** * Endpoint "{@code indices.delete_template}". */ @@ -298,15 +322,7 @@ public DeleteTemplateRequest build() { // Request parameters request -> { Map params = new HashMap<>(); - 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()); - } + request.applyQueryParameters(params); return params; }, SimpleEndpoint.emptyMap(), diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/indices/ExistsAliasRequest.java b/java-client/src/generated/java/org/opensearch/client/opensearch/indices/ExistsAliasRequest.java index a5486e25de..d273a89430 100644 --- a/java-client/src/generated/java/org/opensearch/client/opensearch/indices/ExistsAliasRequest.java +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/indices/ExistsAliasRequest.java @@ -55,7 +55,6 @@ 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: indices.exists_alias.Request @@ -64,7 +63,7 @@ * Returns information about whether a particular alias exists. */ @Generated("org.opensearch.client.codegen.CodeGenerator") -public class ExistsAliasRequest extends RequestBase implements ToCopyableBuilder { +public final class ExistsAliasRequest extends RequestBase implements ToCopyableBuilder { @Nullable private final Boolean allowNoIndices; @@ -87,6 +86,7 @@ public class ExistsAliasRequest extends RequestBase implements ToCopyableBuilder // --------------------------------------------------------------------------------------------- private ExistsAliasRequest(Builder builder) { + super(builder); this.allowNoIndices = builder.allowNoIndices; this.expandWildcards = ApiTypeHelper.unmodifiable(builder.expandWildcards); this.ignoreUnavailable = builder.ignoreUnavailable; @@ -185,7 +185,7 @@ public static Builder builder() { /** * Builder for {@link ExistsAliasRequest}. */ - public static class Builder extends ObjectBuilderBase implements CopyableBuilder { + public static class Builder extends RequestBase.AbstractBuilder implements CopyableBuilder { @Nullable private Boolean allowNoIndices; @Nullable @@ -201,6 +201,7 @@ public static class Builder extends ObjectBuilderBase implements CopyableBuilder public Builder() {} private Builder(ExistsAliasRequest o) { + super(o); this.allowNoIndices = o.allowNoIndices; this.expandWildcards = _listCopy(o.expandWildcards); this.ignoreUnavailable = o.ignoreUnavailable; @@ -210,6 +211,7 @@ private Builder(ExistsAliasRequest o) { } private Builder(Builder o) { + super(o); this.allowNoIndices = o.allowNoIndices; this.expandWildcards = _listCopy(o.expandWildcards); this.ignoreUnavailable = o.ignoreUnavailable; @@ -224,6 +226,12 @@ public Builder copy() { return new Builder(this); } + @Override + @Nonnull + protected Builder self() { + return this; + } + /** * If false, the request returns an error if any wildcard expression, index alias, or _all value targets * only missing or closed indexes. This behavior applies even if the request targets other open indexes. @@ -380,6 +388,23 @@ public ExistsAliasRequest build() { // --------------------------------------------------------------------------------------------- + @Override + protected void applyQueryParameters(@Nonnull Map params) { + super.applyQueryParameters(params); + if (this.allowNoIndices != null) { + params.put("allow_no_indices", String.valueOf(this.allowNoIndices)); + } + if (ApiTypeHelper.isDefined(this.expandWildcards)) { + params.put("expand_wildcards", this.expandWildcards.stream().map(v -> v.jsonValue()).collect(Collectors.joining(","))); + } + if (this.ignoreUnavailable != null) { + params.put("ignore_unavailable", String.valueOf(this.ignoreUnavailable)); + } + if (this.local != null) { + params.put("local", String.valueOf(this.local)); + } + } + /** * Endpoint "{@code indices.exists_alias}". */ @@ -416,18 +441,7 @@ public ExistsAliasRequest build() { // Request parameters request -> { Map params = new HashMap<>(); - if (request.allowNoIndices != null) { - params.put("allow_no_indices", String.valueOf(request.allowNoIndices)); - } - if (ApiTypeHelper.isDefined(request.expandWildcards)) { - params.put("expand_wildcards", request.expandWildcards.stream().map(v -> v.jsonValue()).collect(Collectors.joining(","))); - } - if (request.ignoreUnavailable != null) { - params.put("ignore_unavailable", String.valueOf(request.ignoreUnavailable)); - } - if (request.local != null) { - params.put("local", String.valueOf(request.local)); - } + request.applyQueryParameters(params); return params; }, SimpleEndpoint.emptyMap() diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/indices/ExistsIndexTemplateRequest.java b/java-client/src/generated/java/org/opensearch/client/opensearch/indices/ExistsIndexTemplateRequest.java index 214c8333e3..9c87e0bffc 100644 --- a/java-client/src/generated/java/org/opensearch/client/opensearch/indices/ExistsIndexTemplateRequest.java +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/indices/ExistsIndexTemplateRequest.java @@ -53,7 +53,6 @@ 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: indices.exists_index_template.Request @@ -62,7 +61,7 @@ * Returns information about whether a particular index template exists. */ @Generated("org.opensearch.client.codegen.CodeGenerator") -public class ExistsIndexTemplateRequest extends RequestBase +public final class ExistsIndexTemplateRequest extends RequestBase implements ToCopyableBuilder { @@ -85,6 +84,7 @@ public class ExistsIndexTemplateRequest extends RequestBase // --------------------------------------------------------------------------------------------- private ExistsIndexTemplateRequest(Builder builder) { + super(builder); this.clusterManagerTimeout = builder.clusterManagerTimeout; this.flatSettings = builder.flatSettings; this.local = builder.local; @@ -171,7 +171,9 @@ public static Builder builder() { /** * Builder for {@link ExistsIndexTemplateRequest}. */ - public static class Builder extends ObjectBuilderBase implements CopyableBuilder { + public static class Builder extends RequestBase.AbstractBuilder + implements + CopyableBuilder { @Nullable private Time clusterManagerTimeout; @Nullable @@ -185,6 +187,7 @@ public static class Builder extends ObjectBuilderBase implements CopyableBuilder public Builder() {} private Builder(ExistsIndexTemplateRequest o) { + super(o); this.clusterManagerTimeout = o.clusterManagerTimeout; this.flatSettings = o.flatSettings; this.local = o.local; @@ -193,6 +196,7 @@ private Builder(ExistsIndexTemplateRequest o) { } private Builder(Builder o) { + super(o); this.clusterManagerTimeout = o.clusterManagerTimeout; this.flatSettings = o.flatSettings; this.local = o.local; @@ -206,6 +210,12 @@ public Builder copy() { return new Builder(this); } + @Override + @Nonnull + protected Builder self() { + return this; + } + /** * Operation timeout for connection to cluster-manager node. *

@@ -308,6 +318,23 @@ public ExistsIndexTemplateRequest build() { // --------------------------------------------------------------------------------------------- + @Override + protected void applyQueryParameters(@Nonnull Map params) { + super.applyQueryParameters(params); + if (this.clusterManagerTimeout != null) { + params.put("cluster_manager_timeout", this.clusterManagerTimeout._toJsonString()); + } + if (this.flatSettings != null) { + params.put("flat_settings", String.valueOf(this.flatSettings)); + } + if (this.local != null) { + params.put("local", String.valueOf(this.local)); + } + if (this.masterTimeout != null) { + params.put("master_timeout", this.masterTimeout._toJsonString()); + } + } + /** * Endpoint "{@code indices.exists_index_template}". */ @@ -324,18 +351,7 @@ public ExistsIndexTemplateRequest build() { // Request parameters request -> { Map params = new HashMap<>(); - if (request.clusterManagerTimeout != null) { - params.put("cluster_manager_timeout", request.clusterManagerTimeout._toJsonString()); - } - if (request.flatSettings != null) { - params.put("flat_settings", String.valueOf(request.flatSettings)); - } - if (request.local != null) { - params.put("local", String.valueOf(request.local)); - } - if (request.masterTimeout != null) { - params.put("master_timeout", request.masterTimeout._toJsonString()); - } + request.applyQueryParameters(params); return params; }, SimpleEndpoint.emptyMap() diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/indices/ExistsRequest.java b/java-client/src/generated/java/org/opensearch/client/opensearch/indices/ExistsRequest.java index c84d766469..96a8c6ca03 100644 --- a/java-client/src/generated/java/org/opensearch/client/opensearch/indices/ExistsRequest.java +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/indices/ExistsRequest.java @@ -56,7 +56,6 @@ 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: indices.exists.Request @@ -65,7 +64,7 @@ * Returns information about whether a particular index exists. */ @Generated("org.opensearch.client.codegen.CodeGenerator") -public class ExistsRequest extends RequestBase implements ToCopyableBuilder { +public final class ExistsRequest extends RequestBase implements ToCopyableBuilder { @Nullable private final Boolean allowNoIndices; @@ -94,6 +93,7 @@ public class ExistsRequest extends RequestBase implements ToCopyableBuilder { + public static class Builder extends RequestBase.AbstractBuilder implements CopyableBuilder { @Nullable private Boolean allowNoIndices; @Nullable @@ -235,6 +235,7 @@ public static class Builder extends ObjectBuilderBase implements CopyableBuilder public Builder() {} private Builder(ExistsRequest o) { + super(o); this.allowNoIndices = o.allowNoIndices; this.clusterManagerTimeout = o.clusterManagerTimeout; this.expandWildcards = _listCopy(o.expandWildcards); @@ -246,6 +247,7 @@ private Builder(ExistsRequest o) { } private Builder(Builder o) { + super(o); this.allowNoIndices = o.allowNoIndices; this.clusterManagerTimeout = o.clusterManagerTimeout; this.expandWildcards = _listCopy(o.expandWildcards); @@ -262,6 +264,12 @@ public Builder copy() { return new Builder(this); } + @Override + @Nonnull + protected Builder self() { + return this; + } + /** * If false, the request returns an error if any wildcard expression, index alias, or _all value targets * only missing or closed indexes. This behavior applies even if the request targets other open indexes. @@ -430,6 +438,32 @@ public ExistsRequest build() { // --------------------------------------------------------------------------------------------- + @Override + protected void applyQueryParameters(@Nonnull Map params) { + super.applyQueryParameters(params); + if (this.allowNoIndices != null) { + params.put("allow_no_indices", String.valueOf(this.allowNoIndices)); + } + if (this.clusterManagerTimeout != null) { + params.put("cluster_manager_timeout", this.clusterManagerTimeout._toJsonString()); + } + if (ApiTypeHelper.isDefined(this.expandWildcards)) { + params.put("expand_wildcards", this.expandWildcards.stream().map(v -> v.jsonValue()).collect(Collectors.joining(","))); + } + if (this.flatSettings != null) { + params.put("flat_settings", String.valueOf(this.flatSettings)); + } + if (this.ignoreUnavailable != null) { + params.put("ignore_unavailable", String.valueOf(this.ignoreUnavailable)); + } + if (this.includeDefaults != null) { + params.put("include_defaults", String.valueOf(this.includeDefaults)); + } + if (this.local != null) { + params.put("local", String.valueOf(this.local)); + } + } + /** * Endpoint "{@code indices.exists}". */ @@ -446,27 +480,7 @@ public ExistsRequest build() { // Request parameters request -> { Map params = new HashMap<>(); - if (request.allowNoIndices != null) { - params.put("allow_no_indices", String.valueOf(request.allowNoIndices)); - } - if (request.clusterManagerTimeout != null) { - params.put("cluster_manager_timeout", request.clusterManagerTimeout._toJsonString()); - } - if (ApiTypeHelper.isDefined(request.expandWildcards)) { - params.put("expand_wildcards", request.expandWildcards.stream().map(v -> v.jsonValue()).collect(Collectors.joining(","))); - } - if (request.flatSettings != null) { - params.put("flat_settings", String.valueOf(request.flatSettings)); - } - if (request.ignoreUnavailable != null) { - params.put("ignore_unavailable", String.valueOf(request.ignoreUnavailable)); - } - if (request.includeDefaults != null) { - params.put("include_defaults", String.valueOf(request.includeDefaults)); - } - if (request.local != null) { - params.put("local", String.valueOf(request.local)); - } + request.applyQueryParameters(params); return params; }, SimpleEndpoint.emptyMap() diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/indices/ExistsTemplateRequest.java b/java-client/src/generated/java/org/opensearch/client/opensearch/indices/ExistsTemplateRequest.java index bf1df9d4f5..bcc89fdabd 100644 --- a/java-client/src/generated/java/org/opensearch/client/opensearch/indices/ExistsTemplateRequest.java +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/indices/ExistsTemplateRequest.java @@ -54,7 +54,6 @@ 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: indices.exists_template.Request @@ -63,7 +62,9 @@ * Returns information about whether a particular index template exists. */ @Generated("org.opensearch.client.codegen.CodeGenerator") -public class ExistsTemplateRequest extends RequestBase implements ToCopyableBuilder { +public final class ExistsTemplateRequest extends RequestBase + implements + ToCopyableBuilder { @Nullable private final Time clusterManagerTimeout; @@ -84,6 +85,7 @@ public class ExistsTemplateRequest extends RequestBase implements ToCopyableBuil // --------------------------------------------------------------------------------------------- private ExistsTemplateRequest(Builder builder) { + super(builder); this.clusterManagerTimeout = builder.clusterManagerTimeout; this.flatSettings = builder.flatSettings; this.local = builder.local; @@ -167,7 +169,7 @@ public static Builder builder() { /** * Builder for {@link ExistsTemplateRequest}. */ - public static class Builder extends ObjectBuilderBase implements CopyableBuilder { + public static class Builder extends RequestBase.AbstractBuilder implements CopyableBuilder { @Nullable private Time clusterManagerTimeout; @Nullable @@ -181,6 +183,7 @@ public static class Builder extends ObjectBuilderBase implements CopyableBuilder public Builder() {} private Builder(ExistsTemplateRequest o) { + super(o); this.clusterManagerTimeout = o.clusterManagerTimeout; this.flatSettings = o.flatSettings; this.local = o.local; @@ -189,6 +192,7 @@ private Builder(ExistsTemplateRequest o) { } private Builder(Builder o) { + super(o); this.clusterManagerTimeout = o.clusterManagerTimeout; this.flatSettings = o.flatSettings; this.local = o.local; @@ -202,6 +206,12 @@ public Builder copy() { return new Builder(this); } + @Override + @Nonnull + protected Builder self() { + return this; + } + /** * Operation timeout for connection to cluster-manager node. *

@@ -322,6 +332,23 @@ public ExistsTemplateRequest build() { // --------------------------------------------------------------------------------------------- + @Override + protected void applyQueryParameters(@Nonnull Map params) { + super.applyQueryParameters(params); + if (this.clusterManagerTimeout != null) { + params.put("cluster_manager_timeout", this.clusterManagerTimeout._toJsonString()); + } + if (this.flatSettings != null) { + params.put("flat_settings", String.valueOf(this.flatSettings)); + } + if (this.local != null) { + params.put("local", String.valueOf(this.local)); + } + if (this.masterTimeout != null) { + params.put("master_timeout", this.masterTimeout._toJsonString()); + } + } + /** * Endpoint "{@code indices.exists_template}". */ @@ -338,18 +365,7 @@ public ExistsTemplateRequest build() { // Request parameters request -> { Map params = new HashMap<>(); - if (request.clusterManagerTimeout != null) { - params.put("cluster_manager_timeout", request.clusterManagerTimeout._toJsonString()); - } - if (request.flatSettings != null) { - params.put("flat_settings", String.valueOf(request.flatSettings)); - } - if (request.local != null) { - params.put("local", String.valueOf(request.local)); - } - if (request.masterTimeout != null) { - params.put("master_timeout", request.masterTimeout._toJsonString()); - } + request.applyQueryParameters(params); return params; }, SimpleEndpoint.emptyMap() diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/indices/FlushRequest.java b/java-client/src/generated/java/org/opensearch/client/opensearch/indices/FlushRequest.java index 60d356c64c..429ce86842 100644 --- a/java-client/src/generated/java/org/opensearch/client/opensearch/indices/FlushRequest.java +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/indices/FlushRequest.java @@ -53,7 +53,6 @@ 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: indices.flush.Request @@ -62,7 +61,7 @@ * Performs the flush operation on one or more indexes. */ @Generated("org.opensearch.client.codegen.CodeGenerator") -public class FlushRequest extends RequestBase implements ToCopyableBuilder { +public final class FlushRequest extends RequestBase implements ToCopyableBuilder { @Nullable private final Boolean allowNoIndices; @@ -85,6 +84,7 @@ public class FlushRequest extends RequestBase implements ToCopyableBuilder { + public static class Builder extends RequestBase.AbstractBuilder implements CopyableBuilder { @Nullable private Boolean allowNoIndices; @Nullable @@ -201,6 +201,7 @@ public static class Builder extends ObjectBuilderBase implements CopyableBuilder public Builder() {} private Builder(FlushRequest o) { + super(o); this.allowNoIndices = o.allowNoIndices; this.expandWildcards = _listCopy(o.expandWildcards); this.force = o.force; @@ -210,6 +211,7 @@ private Builder(FlushRequest o) { } private Builder(Builder o) { + super(o); this.allowNoIndices = o.allowNoIndices; this.expandWildcards = _listCopy(o.expandWildcards); this.force = o.force; @@ -224,6 +226,12 @@ public Builder copy() { return new Builder(this); } + @Override + @Nonnull + protected Builder self() { + return this; + } + /** * If false, the request returns an error if any wildcard expression, index alias, or _all value targets * only missing or closed indexes. This behavior applies even if the request targets other open indexes. @@ -360,6 +368,26 @@ public FlushRequest build() { // --------------------------------------------------------------------------------------------- + @Override + protected void applyQueryParameters(@Nonnull Map params) { + super.applyQueryParameters(params); + if (this.allowNoIndices != null) { + params.put("allow_no_indices", String.valueOf(this.allowNoIndices)); + } + if (ApiTypeHelper.isDefined(this.expandWildcards)) { + params.put("expand_wildcards", this.expandWildcards.stream().map(v -> v.jsonValue()).collect(Collectors.joining(","))); + } + if (this.force != null) { + params.put("force", String.valueOf(this.force)); + } + if (this.ignoreUnavailable != null) { + params.put("ignore_unavailable", String.valueOf(this.ignoreUnavailable)); + } + if (this.waitIfOngoing != null) { + params.put("wait_if_ongoing", String.valueOf(this.waitIfOngoing)); + } + } + /** * Endpoint "{@code indices.flush}". */ @@ -390,21 +418,7 @@ public FlushRequest build() { // Request parameters request -> { Map params = new HashMap<>(); - if (request.allowNoIndices != null) { - params.put("allow_no_indices", String.valueOf(request.allowNoIndices)); - } - if (ApiTypeHelper.isDefined(request.expandWildcards)) { - params.put("expand_wildcards", request.expandWildcards.stream().map(v -> v.jsonValue()).collect(Collectors.joining(","))); - } - if (request.force != null) { - params.put("force", String.valueOf(request.force)); - } - if (request.ignoreUnavailable != null) { - params.put("ignore_unavailable", String.valueOf(request.ignoreUnavailable)); - } - if (request.waitIfOngoing != null) { - params.put("wait_if_ongoing", String.valueOf(request.waitIfOngoing)); - } + request.applyQueryParameters(params); return params; }, SimpleEndpoint.emptyMap(), diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/indices/ForcemergeRequest.java b/java-client/src/generated/java/org/opensearch/client/opensearch/indices/ForcemergeRequest.java index 7fe66f814a..c2befdba9c 100644 --- a/java-client/src/generated/java/org/opensearch/client/opensearch/indices/ForcemergeRequest.java +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/indices/ForcemergeRequest.java @@ -53,7 +53,6 @@ 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: indices.forcemerge.Request @@ -62,7 +61,7 @@ * Performs the force merge operation on one or more indexes. */ @Generated("org.opensearch.client.codegen.CodeGenerator") -public class ForcemergeRequest extends RequestBase implements ToCopyableBuilder { +public final class ForcemergeRequest extends RequestBase implements ToCopyableBuilder { @Nullable private final Boolean allowNoIndices; @@ -94,6 +93,7 @@ public class ForcemergeRequest extends RequestBase implements ToCopyableBuilder< // --------------------------------------------------------------------------------------------- private ForcemergeRequest(Builder builder) { + super(builder); this.allowNoIndices = builder.allowNoIndices; this.expandWildcards = ApiTypeHelper.unmodifiable(builder.expandWildcards); this.flush = builder.flush; @@ -226,7 +226,7 @@ public static Builder builder() { /** * Builder for {@link ForcemergeRequest}. */ - public static class Builder extends ObjectBuilderBase implements CopyableBuilder { + public static class Builder extends RequestBase.AbstractBuilder implements CopyableBuilder { @Nullable private Boolean allowNoIndices; @Nullable @@ -249,6 +249,7 @@ public static class Builder extends ObjectBuilderBase implements CopyableBuilder public Builder() {} private Builder(ForcemergeRequest o) { + super(o); this.allowNoIndices = o.allowNoIndices; this.expandWildcards = _listCopy(o.expandWildcards); this.flush = o.flush; @@ -261,6 +262,7 @@ private Builder(ForcemergeRequest o) { } private Builder(Builder o) { + super(o); this.allowNoIndices = o.allowNoIndices; this.expandWildcards = _listCopy(o.expandWildcards); this.flush = o.flush; @@ -278,6 +280,12 @@ public Builder copy() { return new Builder(this); } + @Override + @Nonnull + protected Builder self() { + return this; + } + /** * Whether to ignore if a wildcard indexes expression resolves into no concrete indexes. (This includes _all string or * when no indexes have been specified) @@ -444,6 +452,35 @@ public ForcemergeRequest build() { // --------------------------------------------------------------------------------------------- + @Override + protected void applyQueryParameters(@Nonnull Map params) { + super.applyQueryParameters(params); + if (this.allowNoIndices != null) { + params.put("allow_no_indices", String.valueOf(this.allowNoIndices)); + } + if (ApiTypeHelper.isDefined(this.expandWildcards)) { + params.put("expand_wildcards", this.expandWildcards.stream().map(v -> v.jsonValue()).collect(Collectors.joining(","))); + } + if (this.flush != null) { + params.put("flush", String.valueOf(this.flush)); + } + if (this.ignoreUnavailable != null) { + params.put("ignore_unavailable", String.valueOf(this.ignoreUnavailable)); + } + if (this.maxNumSegments != null) { + params.put("max_num_segments", String.valueOf(this.maxNumSegments)); + } + if (this.onlyExpungeDeletes != null) { + params.put("only_expunge_deletes", String.valueOf(this.onlyExpungeDeletes)); + } + if (this.primaryOnly != null) { + params.put("primary_only", String.valueOf(this.primaryOnly)); + } + if (this.waitForCompletion != null) { + params.put("wait_for_completion", String.valueOf(this.waitForCompletion)); + } + } + /** * Endpoint "{@code indices.forcemerge}". */ @@ -474,30 +511,7 @@ public ForcemergeRequest build() { // Request parameters request -> { Map params = new HashMap<>(); - if (request.allowNoIndices != null) { - params.put("allow_no_indices", String.valueOf(request.allowNoIndices)); - } - if (ApiTypeHelper.isDefined(request.expandWildcards)) { - params.put("expand_wildcards", request.expandWildcards.stream().map(v -> v.jsonValue()).collect(Collectors.joining(","))); - } - if (request.flush != null) { - params.put("flush", String.valueOf(request.flush)); - } - if (request.ignoreUnavailable != null) { - params.put("ignore_unavailable", String.valueOf(request.ignoreUnavailable)); - } - if (request.maxNumSegments != null) { - params.put("max_num_segments", String.valueOf(request.maxNumSegments)); - } - if (request.onlyExpungeDeletes != null) { - params.put("only_expunge_deletes", String.valueOf(request.onlyExpungeDeletes)); - } - if (request.primaryOnly != null) { - params.put("primary_only", String.valueOf(request.primaryOnly)); - } - if (request.waitForCompletion != null) { - params.put("wait_for_completion", String.valueOf(request.waitForCompletion)); - } + request.applyQueryParameters(params); return params; }, SimpleEndpoint.emptyMap(), diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/indices/GetAliasRequest.java b/java-client/src/generated/java/org/opensearch/client/opensearch/indices/GetAliasRequest.java index 69c427fe1f..55f7f9a9f1 100644 --- a/java-client/src/generated/java/org/opensearch/client/opensearch/indices/GetAliasRequest.java +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/indices/GetAliasRequest.java @@ -53,7 +53,6 @@ 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: indices.get_alias.Request @@ -62,7 +61,7 @@ * Returns an alias. */ @Generated("org.opensearch.client.codegen.CodeGenerator") -public class GetAliasRequest extends RequestBase implements ToCopyableBuilder { +public final class GetAliasRequest extends RequestBase implements ToCopyableBuilder { @Nullable private final Boolean allowNoIndices; @@ -85,6 +84,7 @@ public class GetAliasRequest extends RequestBase implements ToCopyableBuilder { + public static class Builder extends RequestBase.AbstractBuilder implements CopyableBuilder { @Nullable private Boolean allowNoIndices; @Nullable @@ -201,6 +201,7 @@ public static class Builder extends ObjectBuilderBase implements CopyableBuilder public Builder() {} private Builder(GetAliasRequest o) { + super(o); this.allowNoIndices = o.allowNoIndices; this.expandWildcards = _listCopy(o.expandWildcards); this.ignoreUnavailable = o.ignoreUnavailable; @@ -210,6 +211,7 @@ private Builder(GetAliasRequest o) { } private Builder(Builder o) { + super(o); this.allowNoIndices = o.allowNoIndices; this.expandWildcards = _listCopy(o.expandWildcards); this.ignoreUnavailable = o.ignoreUnavailable; @@ -224,6 +226,12 @@ public Builder copy() { return new Builder(this); } + @Override + @Nonnull + protected Builder self() { + return this; + } + /** * If false, the request returns an error if any wildcard expression, index alias, or _all value targets * only missing or closed indexes. This behavior applies even if the request targets other open indexes. @@ -381,6 +389,23 @@ public GetAliasRequest build() { // --------------------------------------------------------------------------------------------- + @Override + protected void applyQueryParameters(@Nonnull Map params) { + super.applyQueryParameters(params); + if (this.allowNoIndices != null) { + params.put("allow_no_indices", String.valueOf(this.allowNoIndices)); + } + if (ApiTypeHelper.isDefined(this.expandWildcards)) { + params.put("expand_wildcards", this.expandWildcards.stream().map(v -> v.jsonValue()).collect(Collectors.joining(","))); + } + if (this.ignoreUnavailable != null) { + params.put("ignore_unavailable", String.valueOf(this.ignoreUnavailable)); + } + if (this.local != null) { + params.put("local", String.valueOf(this.local)); + } + } + /** * Endpoint "{@code indices.get_alias}". */ @@ -427,18 +452,7 @@ public GetAliasRequest build() { // Request parameters request -> { Map params = new HashMap<>(); - if (request.allowNoIndices != null) { - params.put("allow_no_indices", String.valueOf(request.allowNoIndices)); - } - if (ApiTypeHelper.isDefined(request.expandWildcards)) { - params.put("expand_wildcards", request.expandWildcards.stream().map(v -> v.jsonValue()).collect(Collectors.joining(","))); - } - if (request.ignoreUnavailable != null) { - params.put("ignore_unavailable", String.valueOf(request.ignoreUnavailable)); - } - if (request.local != null) { - params.put("local", String.valueOf(request.local)); - } + request.applyQueryParameters(params); return params; }, SimpleEndpoint.emptyMap(), diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/indices/GetDataStreamRequest.java b/java-client/src/generated/java/org/opensearch/client/opensearch/indices/GetDataStreamRequest.java index e9e21e39a3..ead15c3f13 100644 --- a/java-client/src/generated/java/org/opensearch/client/opensearch/indices/GetDataStreamRequest.java +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/indices/GetDataStreamRequest.java @@ -36,7 +36,9 @@ package org.opensearch.client.opensearch.indices; +import java.util.HashMap; import java.util.List; +import java.util.Map; import java.util.Objects; import java.util.function.Function; import javax.annotation.Generated; @@ -49,7 +51,6 @@ 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: indices.get_data_stream.Request @@ -58,7 +59,9 @@ * Returns data streams. */ @Generated("org.opensearch.client.codegen.CodeGenerator") -public class GetDataStreamRequest extends RequestBase implements ToCopyableBuilder { +public final class GetDataStreamRequest extends RequestBase + implements + ToCopyableBuilder { @Nonnull private final List name; @@ -66,6 +69,7 @@ public class GetDataStreamRequest extends RequestBase implements ToCopyableBuild // --------------------------------------------------------------------------------------------- private GetDataStreamRequest(Builder builder) { + super(builder); this.name = ApiTypeHelper.unmodifiable(builder.name); } @@ -101,17 +105,19 @@ public static Builder builder() { /** * Builder for {@link GetDataStreamRequest}. */ - public static class Builder extends ObjectBuilderBase implements CopyableBuilder { + public static class Builder extends RequestBase.AbstractBuilder implements CopyableBuilder { @Nullable private List name; public Builder() {} private Builder(GetDataStreamRequest o) { + super(o); this.name = _listCopy(o.name); } private Builder(Builder o) { + super(o); this.name = _listCopy(o.name); } @@ -121,6 +127,12 @@ public Builder copy() { return new Builder(this); } + @Override + @Nonnull + protected Builder self() { + return this; + } + /** * Comma-separated list of data stream names used to limit the request. Wildcard (*) expressions are supported. If * omitted, all data streams are returned. @@ -198,7 +210,11 @@ public GetDataStreamRequest build() { throw SimpleEndpoint.noPathTemplateFound("path"); }, // Request parameters - SimpleEndpoint.emptyMap(), + request -> { + Map params = new HashMap<>(); + request.applyQueryParameters(params); + return params; + }, SimpleEndpoint.emptyMap(), false, GetDataStreamResponse._DESERIALIZER diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/indices/GetIndexRequest.java b/java-client/src/generated/java/org/opensearch/client/opensearch/indices/GetIndexRequest.java index 1145cc3a79..36587fbe13 100644 --- a/java-client/src/generated/java/org/opensearch/client/opensearch/indices/GetIndexRequest.java +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/indices/GetIndexRequest.java @@ -54,7 +54,6 @@ 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: indices.get.Request @@ -63,7 +62,7 @@ * Returns information about one or more indexes. */ @Generated("org.opensearch.client.codegen.CodeGenerator") -public class GetIndexRequest extends RequestBase implements ToCopyableBuilder { +public final class GetIndexRequest extends RequestBase implements ToCopyableBuilder { @Nullable private final Boolean allowNoIndices; @@ -96,6 +95,7 @@ public class GetIndexRequest extends RequestBase implements ToCopyableBuilder { + public static class Builder extends RequestBase.AbstractBuilder implements CopyableBuilder { @Nullable private Boolean allowNoIndices; @Nullable @@ -255,6 +255,7 @@ public static class Builder extends ObjectBuilderBase implements CopyableBuilder public Builder() {} private Builder(GetIndexRequest o) { + super(o); this.allowNoIndices = o.allowNoIndices; this.clusterManagerTimeout = o.clusterManagerTimeout; this.expandWildcards = _listCopy(o.expandWildcards); @@ -267,6 +268,7 @@ private Builder(GetIndexRequest o) { } private Builder(Builder o) { + super(o); this.allowNoIndices = o.allowNoIndices; this.clusterManagerTimeout = o.clusterManagerTimeout; this.expandWildcards = _listCopy(o.expandWildcards); @@ -284,6 +286,12 @@ public Builder copy() { return new Builder(this); } + @Override + @Nonnull + protected Builder self() { + return this; + } + /** * If false, the request returns an error if any wildcard expression, index alias, or _all value targets * only missing or closed indexes. This behavior applies even if the request targets other open indexes. For example, a request @@ -481,6 +489,35 @@ public GetIndexRequest build() { // --------------------------------------------------------------------------------------------- + @Override + protected void applyQueryParameters(@Nonnull Map params) { + super.applyQueryParameters(params); + if (this.allowNoIndices != null) { + params.put("allow_no_indices", String.valueOf(this.allowNoIndices)); + } + if (this.clusterManagerTimeout != null) { + params.put("cluster_manager_timeout", this.clusterManagerTimeout._toJsonString()); + } + if (ApiTypeHelper.isDefined(this.expandWildcards)) { + params.put("expand_wildcards", this.expandWildcards.stream().map(v -> v.jsonValue()).collect(Collectors.joining(","))); + } + if (this.flatSettings != null) { + params.put("flat_settings", String.valueOf(this.flatSettings)); + } + if (this.ignoreUnavailable != null) { + params.put("ignore_unavailable", String.valueOf(this.ignoreUnavailable)); + } + if (this.includeDefaults != null) { + params.put("include_defaults", String.valueOf(this.includeDefaults)); + } + if (this.local != null) { + params.put("local", String.valueOf(this.local)); + } + if (this.masterTimeout != null) { + params.put("master_timeout", this.masterTimeout._toJsonString()); + } + } + /** * Endpoint "{@code indices.get}". */ @@ -497,30 +534,7 @@ public GetIndexRequest build() { // Request parameters request -> { Map params = new HashMap<>(); - if (request.allowNoIndices != null) { - params.put("allow_no_indices", String.valueOf(request.allowNoIndices)); - } - if (request.clusterManagerTimeout != null) { - params.put("cluster_manager_timeout", request.clusterManagerTimeout._toJsonString()); - } - if (ApiTypeHelper.isDefined(request.expandWildcards)) { - params.put("expand_wildcards", request.expandWildcards.stream().map(v -> v.jsonValue()).collect(Collectors.joining(","))); - } - if (request.flatSettings != null) { - params.put("flat_settings", String.valueOf(request.flatSettings)); - } - if (request.ignoreUnavailable != null) { - params.put("ignore_unavailable", String.valueOf(request.ignoreUnavailable)); - } - if (request.includeDefaults != null) { - params.put("include_defaults", String.valueOf(request.includeDefaults)); - } - if (request.local != null) { - params.put("local", String.valueOf(request.local)); - } - if (request.masterTimeout != null) { - params.put("master_timeout", request.masterTimeout._toJsonString()); - } + request.applyQueryParameters(params); return params; }, SimpleEndpoint.emptyMap(), diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/indices/GetIndexTemplateRequest.java b/java-client/src/generated/java/org/opensearch/client/opensearch/indices/GetIndexTemplateRequest.java index b20b9c1b36..fc6f35c265 100644 --- a/java-client/src/generated/java/org/opensearch/client/opensearch/indices/GetIndexTemplateRequest.java +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/indices/GetIndexTemplateRequest.java @@ -50,7 +50,6 @@ 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: indices.get_index_template.Request @@ -59,7 +58,7 @@ * Returns an index template. */ @Generated("org.opensearch.client.codegen.CodeGenerator") -public class GetIndexTemplateRequest extends RequestBase +public final class GetIndexTemplateRequest extends RequestBase implements ToCopyableBuilder { @@ -82,6 +81,7 @@ public class GetIndexTemplateRequest extends RequestBase // --------------------------------------------------------------------------------------------- private GetIndexTemplateRequest(Builder builder) { + super(builder); this.clusterManagerTimeout = builder.clusterManagerTimeout; this.flatSettings = builder.flatSettings; this.local = builder.local; @@ -167,7 +167,7 @@ public static Builder builder() { /** * Builder for {@link GetIndexTemplateRequest}. */ - public static class Builder extends ObjectBuilderBase implements CopyableBuilder { + public static class Builder extends RequestBase.AbstractBuilder implements CopyableBuilder { @Nullable private Time clusterManagerTimeout; @Nullable @@ -182,6 +182,7 @@ public static class Builder extends ObjectBuilderBase implements CopyableBuilder public Builder() {} private Builder(GetIndexTemplateRequest o) { + super(o); this.clusterManagerTimeout = o.clusterManagerTimeout; this.flatSettings = o.flatSettings; this.local = o.local; @@ -190,6 +191,7 @@ private Builder(GetIndexTemplateRequest o) { } private Builder(Builder o) { + super(o); this.clusterManagerTimeout = o.clusterManagerTimeout; this.flatSettings = o.flatSettings; this.local = o.local; @@ -203,6 +205,12 @@ public Builder copy() { return new Builder(this); } + @Override + @Nonnull + protected Builder self() { + return this; + } + /** * Operation timeout for connection to cluster-manager node. *

@@ -306,6 +314,23 @@ public GetIndexTemplateRequest build() { // --------------------------------------------------------------------------------------------- + @Override + protected void applyQueryParameters(@Nonnull Map params) { + super.applyQueryParameters(params); + if (this.clusterManagerTimeout != null) { + params.put("cluster_manager_timeout", this.clusterManagerTimeout._toJsonString()); + } + if (this.flatSettings != null) { + params.put("flat_settings", String.valueOf(this.flatSettings)); + } + if (this.local != null) { + params.put("local", String.valueOf(this.local)); + } + if (this.masterTimeout != null) { + params.put("master_timeout", this.masterTimeout._toJsonString()); + } + } + /** * Endpoint "{@code indices.get_index_template}". */ @@ -335,18 +360,7 @@ public GetIndexTemplateRequest build() { // Request parameters request -> { Map params = new HashMap<>(); - if (request.clusterManagerTimeout != null) { - params.put("cluster_manager_timeout", request.clusterManagerTimeout._toJsonString()); - } - if (request.flatSettings != null) { - params.put("flat_settings", String.valueOf(request.flatSettings)); - } - if (request.local != null) { - params.put("local", String.valueOf(request.local)); - } - if (request.masterTimeout != null) { - params.put("master_timeout", request.masterTimeout._toJsonString()); - } + request.applyQueryParameters(params); return params; }, SimpleEndpoint.emptyMap(), diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/indices/GetIndicesSettingsRequest.java b/java-client/src/generated/java/org/opensearch/client/opensearch/indices/GetIndicesSettingsRequest.java index cead52f23d..7ef380466f 100644 --- a/java-client/src/generated/java/org/opensearch/client/opensearch/indices/GetIndicesSettingsRequest.java +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/indices/GetIndicesSettingsRequest.java @@ -54,7 +54,6 @@ 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: indices.get_settings.Request @@ -63,7 +62,7 @@ * Returns settings for one or more indexes. */ @Generated("org.opensearch.client.codegen.CodeGenerator") -public class GetIndicesSettingsRequest extends RequestBase +public final class GetIndicesSettingsRequest extends RequestBase implements ToCopyableBuilder { @@ -101,6 +100,7 @@ public class GetIndicesSettingsRequest extends RequestBase // --------------------------------------------------------------------------------------------- private GetIndicesSettingsRequest(Builder builder) { + super(builder); this.allowNoIndices = builder.allowNoIndices; this.clusterManagerTimeout = builder.clusterManagerTimeout; this.expandWildcards = ApiTypeHelper.unmodifiable(builder.expandWildcards); @@ -250,7 +250,9 @@ public static Builder builder() { /** * Builder for {@link GetIndicesSettingsRequest}. */ - public static class Builder extends ObjectBuilderBase implements CopyableBuilder { + public static class Builder extends RequestBase.AbstractBuilder + implements + CopyableBuilder { @Nullable private Boolean allowNoIndices; @Nullable @@ -275,6 +277,7 @@ public static class Builder extends ObjectBuilderBase implements CopyableBuilder public Builder() {} private Builder(GetIndicesSettingsRequest o) { + super(o); this.allowNoIndices = o.allowNoIndices; this.clusterManagerTimeout = o.clusterManagerTimeout; this.expandWildcards = _listCopy(o.expandWildcards); @@ -288,6 +291,7 @@ private Builder(GetIndicesSettingsRequest o) { } private Builder(Builder o) { + super(o); this.allowNoIndices = o.allowNoIndices; this.clusterManagerTimeout = o.clusterManagerTimeout; this.expandWildcards = _listCopy(o.expandWildcards); @@ -306,6 +310,12 @@ public Builder copy() { return new Builder(this); } + @Override + @Nonnull + protected Builder self() { + return this; + } + /** * If false, the request returns an error if any wildcard expression, index alias, or _all value targets * only missing or closed indexes. This behavior applies even if the request targets other open indexes. For example, a request @@ -535,6 +545,35 @@ public GetIndicesSettingsRequest build() { // --------------------------------------------------------------------------------------------- + @Override + protected void applyQueryParameters(@Nonnull Map params) { + super.applyQueryParameters(params); + if (this.allowNoIndices != null) { + params.put("allow_no_indices", String.valueOf(this.allowNoIndices)); + } + if (this.clusterManagerTimeout != null) { + params.put("cluster_manager_timeout", this.clusterManagerTimeout._toJsonString()); + } + if (ApiTypeHelper.isDefined(this.expandWildcards)) { + params.put("expand_wildcards", this.expandWildcards.stream().map(v -> v.jsonValue()).collect(Collectors.joining(","))); + } + if (this.flatSettings != null) { + params.put("flat_settings", String.valueOf(this.flatSettings)); + } + if (this.ignoreUnavailable != null) { + params.put("ignore_unavailable", String.valueOf(this.ignoreUnavailable)); + } + if (this.includeDefaults != null) { + params.put("include_defaults", String.valueOf(this.includeDefaults)); + } + if (this.local != null) { + params.put("local", String.valueOf(this.local)); + } + if (this.masterTimeout != null) { + params.put("master_timeout", this.masterTimeout._toJsonString()); + } + } + /** * Endpoint "{@code indices.get_settings}". */ @@ -581,30 +620,7 @@ public GetIndicesSettingsRequest build() { // Request parameters request -> { Map params = new HashMap<>(); - if (request.allowNoIndices != null) { - params.put("allow_no_indices", String.valueOf(request.allowNoIndices)); - } - if (request.clusterManagerTimeout != null) { - params.put("cluster_manager_timeout", request.clusterManagerTimeout._toJsonString()); - } - if (ApiTypeHelper.isDefined(request.expandWildcards)) { - params.put("expand_wildcards", request.expandWildcards.stream().map(v -> v.jsonValue()).collect(Collectors.joining(","))); - } - if (request.flatSettings != null) { - params.put("flat_settings", String.valueOf(request.flatSettings)); - } - if (request.ignoreUnavailable != null) { - params.put("ignore_unavailable", String.valueOf(request.ignoreUnavailable)); - } - if (request.includeDefaults != null) { - params.put("include_defaults", String.valueOf(request.includeDefaults)); - } - if (request.local != null) { - params.put("local", String.valueOf(request.local)); - } - if (request.masterTimeout != null) { - params.put("master_timeout", request.masterTimeout._toJsonString()); - } + request.applyQueryParameters(params); return params; }, SimpleEndpoint.emptyMap(), diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/indices/GetMappingRequest.java b/java-client/src/generated/java/org/opensearch/client/opensearch/indices/GetMappingRequest.java index 22723b2cf4..9bf4168ae9 100644 --- a/java-client/src/generated/java/org/opensearch/client/opensearch/indices/GetMappingRequest.java +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/indices/GetMappingRequest.java @@ -54,7 +54,6 @@ 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: indices.get_mapping.Request @@ -63,7 +62,7 @@ * Returns mappings for one or more indexes. */ @Generated("org.opensearch.client.codegen.CodeGenerator") -public class GetMappingRequest extends RequestBase implements ToCopyableBuilder { +public final class GetMappingRequest extends RequestBase implements ToCopyableBuilder { @Nullable private final Boolean allowNoIndices; @@ -90,6 +89,7 @@ public class GetMappingRequest extends RequestBase implements ToCopyableBuilder< // --------------------------------------------------------------------------------------------- private GetMappingRequest(Builder builder) { + super(builder); this.allowNoIndices = builder.allowNoIndices; this.clusterManagerTimeout = builder.clusterManagerTimeout; this.expandWildcards = ApiTypeHelper.unmodifiable(builder.expandWildcards); @@ -202,7 +202,7 @@ public static Builder builder() { /** * Builder for {@link GetMappingRequest}. */ - public static class Builder extends ObjectBuilderBase implements CopyableBuilder { + public static class Builder extends RequestBase.AbstractBuilder implements CopyableBuilder { @Nullable private Boolean allowNoIndices; @Nullable @@ -221,6 +221,7 @@ public static class Builder extends ObjectBuilderBase implements CopyableBuilder public Builder() {} private Builder(GetMappingRequest o) { + super(o); this.allowNoIndices = o.allowNoIndices; this.clusterManagerTimeout = o.clusterManagerTimeout; this.expandWildcards = _listCopy(o.expandWildcards); @@ -231,6 +232,7 @@ private Builder(GetMappingRequest o) { } private Builder(Builder o) { + super(o); this.allowNoIndices = o.allowNoIndices; this.clusterManagerTimeout = o.clusterManagerTimeout; this.expandWildcards = _listCopy(o.expandWildcards); @@ -246,6 +248,12 @@ public Builder copy() { return new Builder(this); } + @Override + @Nonnull + protected Builder self() { + return this; + } + /** * If false, the request returns an error if any wildcard expression, index alias, or _all value targets * only missing or closed indexes. This behavior applies even if the request targets other open indexes. @@ -419,6 +427,29 @@ public GetMappingRequest build() { // --------------------------------------------------------------------------------------------- + @Override + protected void applyQueryParameters(@Nonnull Map params) { + super.applyQueryParameters(params); + if (this.allowNoIndices != null) { + params.put("allow_no_indices", String.valueOf(this.allowNoIndices)); + } + if (this.clusterManagerTimeout != null) { + params.put("cluster_manager_timeout", this.clusterManagerTimeout._toJsonString()); + } + if (ApiTypeHelper.isDefined(this.expandWildcards)) { + params.put("expand_wildcards", this.expandWildcards.stream().map(v -> v.jsonValue()).collect(Collectors.joining(","))); + } + if (this.ignoreUnavailable != null) { + params.put("ignore_unavailable", String.valueOf(this.ignoreUnavailable)); + } + if (this.local != null) { + params.put("local", String.valueOf(this.local)); + } + if (this.masterTimeout != null) { + params.put("master_timeout", this.masterTimeout._toJsonString()); + } + } + /** * Endpoint "{@code indices.get_mapping}". */ @@ -449,24 +480,7 @@ public GetMappingRequest build() { // Request parameters request -> { Map params = new HashMap<>(); - if (request.allowNoIndices != null) { - params.put("allow_no_indices", String.valueOf(request.allowNoIndices)); - } - if (request.clusterManagerTimeout != null) { - params.put("cluster_manager_timeout", request.clusterManagerTimeout._toJsonString()); - } - if (ApiTypeHelper.isDefined(request.expandWildcards)) { - params.put("expand_wildcards", request.expandWildcards.stream().map(v -> v.jsonValue()).collect(Collectors.joining(","))); - } - if (request.ignoreUnavailable != null) { - params.put("ignore_unavailable", String.valueOf(request.ignoreUnavailable)); - } - if (request.local != null) { - params.put("local", String.valueOf(request.local)); - } - if (request.masterTimeout != null) { - params.put("master_timeout", request.masterTimeout._toJsonString()); - } + request.applyQueryParameters(params); return params; }, SimpleEndpoint.emptyMap(), diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/indices/GetTemplateRequest.java b/java-client/src/generated/java/org/opensearch/client/opensearch/indices/GetTemplateRequest.java index fada14bad7..c42da70853 100644 --- a/java-client/src/generated/java/org/opensearch/client/opensearch/indices/GetTemplateRequest.java +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/indices/GetTemplateRequest.java @@ -52,7 +52,6 @@ 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: indices.get_template.Request @@ -61,7 +60,7 @@ * Returns an index template. */ @Generated("org.opensearch.client.codegen.CodeGenerator") -public class GetTemplateRequest extends RequestBase implements ToCopyableBuilder { +public final class GetTemplateRequest extends RequestBase implements ToCopyableBuilder { @Nullable private final Time clusterManagerTimeout; @@ -82,6 +81,7 @@ public class GetTemplateRequest extends RequestBase implements ToCopyableBuilder // --------------------------------------------------------------------------------------------- private GetTemplateRequest(Builder builder) { + super(builder); this.clusterManagerTimeout = builder.clusterManagerTimeout; this.flatSettings = builder.flatSettings; this.local = builder.local; @@ -167,7 +167,7 @@ public static Builder builder() { /** * Builder for {@link GetTemplateRequest}. */ - public static class Builder extends ObjectBuilderBase implements CopyableBuilder { + public static class Builder extends RequestBase.AbstractBuilder implements CopyableBuilder { @Nullable private Time clusterManagerTimeout; @Nullable @@ -182,6 +182,7 @@ public static class Builder extends ObjectBuilderBase implements CopyableBuilder public Builder() {} private Builder(GetTemplateRequest o) { + super(o); this.clusterManagerTimeout = o.clusterManagerTimeout; this.flatSettings = o.flatSettings; this.local = o.local; @@ -190,6 +191,7 @@ private Builder(GetTemplateRequest o) { } private Builder(Builder o) { + super(o); this.clusterManagerTimeout = o.clusterManagerTimeout; this.flatSettings = o.flatSettings; this.local = o.local; @@ -203,6 +205,12 @@ public Builder copy() { return new Builder(this); } + @Override + @Nonnull + protected Builder self() { + return this; + } + /** * Operation timeout for connection to cluster-manager node. *

@@ -327,6 +335,23 @@ public GetTemplateRequest build() { // --------------------------------------------------------------------------------------------- + @Override + protected void applyQueryParameters(@Nonnull Map params) { + super.applyQueryParameters(params); + if (this.clusterManagerTimeout != null) { + params.put("cluster_manager_timeout", this.clusterManagerTimeout._toJsonString()); + } + if (this.flatSettings != null) { + params.put("flat_settings", String.valueOf(this.flatSettings)); + } + if (this.local != null) { + params.put("local", String.valueOf(this.local)); + } + if (this.masterTimeout != null) { + params.put("master_timeout", this.masterTimeout._toJsonString()); + } + } + /** * Endpoint "{@code indices.get_template}". */ @@ -356,18 +381,7 @@ public GetTemplateRequest build() { // Request parameters request -> { Map params = new HashMap<>(); - if (request.clusterManagerTimeout != null) { - params.put("cluster_manager_timeout", request.clusterManagerTimeout._toJsonString()); - } - if (request.flatSettings != null) { - params.put("flat_settings", String.valueOf(request.flatSettings)); - } - if (request.local != null) { - params.put("local", String.valueOf(request.local)); - } - if (request.masterTimeout != null) { - params.put("master_timeout", request.masterTimeout._toJsonString()); - } + request.applyQueryParameters(params); return params; }, SimpleEndpoint.emptyMap(), diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/indices/GetUpgradeRequest.java b/java-client/src/generated/java/org/opensearch/client/opensearch/indices/GetUpgradeRequest.java index 6da869c3fc..753a22b6be 100644 --- a/java-client/src/generated/java/org/opensearch/client/opensearch/indices/GetUpgradeRequest.java +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/indices/GetUpgradeRequest.java @@ -53,7 +53,6 @@ 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: indices.get_upgrade.Request @@ -62,7 +61,7 @@ * The _upgrade API is no longer useful and will be removed. */ @Generated("org.opensearch.client.codegen.CodeGenerator") -public class GetUpgradeRequest extends RequestBase implements ToCopyableBuilder { +public final class GetUpgradeRequest extends RequestBase implements ToCopyableBuilder { @Nullable private final Boolean allowNoIndices; @@ -79,6 +78,7 @@ public class GetUpgradeRequest extends RequestBase implements ToCopyableBuilder< // --------------------------------------------------------------------------------------------- private GetUpgradeRequest(Builder builder) { + super(builder); this.allowNoIndices = builder.allowNoIndices; this.expandWildcards = ApiTypeHelper.unmodifiable(builder.expandWildcards); this.ignoreUnavailable = builder.ignoreUnavailable; @@ -150,7 +150,7 @@ public static Builder builder() { /** * Builder for {@link GetUpgradeRequest}. */ - public static class Builder extends ObjectBuilderBase implements CopyableBuilder { + public static class Builder extends RequestBase.AbstractBuilder implements CopyableBuilder { @Nullable private Boolean allowNoIndices; @Nullable @@ -163,6 +163,7 @@ public static class Builder extends ObjectBuilderBase implements CopyableBuilder public Builder() {} private Builder(GetUpgradeRequest o) { + super(o); this.allowNoIndices = o.allowNoIndices; this.expandWildcards = _listCopy(o.expandWildcards); this.ignoreUnavailable = o.ignoreUnavailable; @@ -170,6 +171,7 @@ private Builder(GetUpgradeRequest o) { } private Builder(Builder o) { + super(o); this.allowNoIndices = o.allowNoIndices; this.expandWildcards = _listCopy(o.expandWildcards); this.ignoreUnavailable = o.ignoreUnavailable; @@ -182,6 +184,12 @@ public Builder copy() { return new Builder(this); } + @Override + @Nonnull + protected Builder self() { + return this; + } + /** * Whether to ignore if a wildcard indexes expression resolves into no concrete indexes. (This includes _all string or * when no indexes have been specified). @@ -287,6 +295,20 @@ public GetUpgradeRequest build() { // --------------------------------------------------------------------------------------------- + @Override + protected void applyQueryParameters(@Nonnull Map params) { + super.applyQueryParameters(params); + if (this.allowNoIndices != null) { + params.put("allow_no_indices", String.valueOf(this.allowNoIndices)); + } + if (ApiTypeHelper.isDefined(this.expandWildcards)) { + params.put("expand_wildcards", this.expandWildcards.stream().map(v -> v.jsonValue()).collect(Collectors.joining(","))); + } + if (this.ignoreUnavailable != null) { + params.put("ignore_unavailable", String.valueOf(this.ignoreUnavailable)); + } + } + /** * Endpoint "{@code indices.get_upgrade}". */ @@ -317,15 +339,7 @@ public GetUpgradeRequest build() { // Request parameters request -> { Map params = new HashMap<>(); - if (request.allowNoIndices != null) { - params.put("allow_no_indices", String.valueOf(request.allowNoIndices)); - } - if (ApiTypeHelper.isDefined(request.expandWildcards)) { - params.put("expand_wildcards", request.expandWildcards.stream().map(v -> v.jsonValue()).collect(Collectors.joining(","))); - } - if (request.ignoreUnavailable != null) { - params.put("ignore_unavailable", String.valueOf(request.ignoreUnavailable)); - } + request.applyQueryParameters(params); return params; }, SimpleEndpoint.emptyMap(), diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/indices/IndicesStatsRequest.java b/java-client/src/generated/java/org/opensearch/client/opensearch/indices/IndicesStatsRequest.java index 0645cd1493..1881aea8dd 100644 --- a/java-client/src/generated/java/org/opensearch/client/opensearch/indices/IndicesStatsRequest.java +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/indices/IndicesStatsRequest.java @@ -55,7 +55,6 @@ 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: indices.stats.Request @@ -64,7 +63,7 @@ * Provides statistics on operations happening in an index. */ @Generated("org.opensearch.client.codegen.CodeGenerator") -public class IndicesStatsRequest extends RequestBase implements ToCopyableBuilder { +public final class IndicesStatsRequest extends RequestBase implements ToCopyableBuilder { @Nonnull private final List completionFields; @@ -102,6 +101,7 @@ public class IndicesStatsRequest extends RequestBase implements ToCopyableBuilde // --------------------------------------------------------------------------------------------- private IndicesStatsRequest(Builder builder) { + super(builder); this.completionFields = ApiTypeHelper.unmodifiable(builder.completionFields); this.expandWildcards = ApiTypeHelper.unmodifiable(builder.expandWildcards); this.fielddataFields = ApiTypeHelper.unmodifiable(builder.fielddataFields); @@ -258,7 +258,7 @@ public static Builder builder() { /** * Builder for {@link IndicesStatsRequest}. */ - public static class Builder extends ObjectBuilderBase implements CopyableBuilder { + public static class Builder extends RequestBase.AbstractBuilder implements CopyableBuilder { @Nullable private List completionFields; @Nullable @@ -285,6 +285,7 @@ public static class Builder extends ObjectBuilderBase implements CopyableBuilder public Builder() {} private Builder(IndicesStatsRequest o) { + super(o); this.completionFields = _listCopy(o.completionFields); this.expandWildcards = _listCopy(o.expandWildcards); this.fielddataFields = _listCopy(o.fielddataFields); @@ -299,6 +300,7 @@ private Builder(IndicesStatsRequest o) { } private Builder(Builder o) { + super(o); this.completionFields = _listCopy(o.completionFields); this.expandWildcards = _listCopy(o.expandWildcards); this.fielddataFields = _listCopy(o.fielddataFields); @@ -318,6 +320,12 @@ public Builder copy() { return new Builder(this); } + @Override + @Nonnull + protected Builder self() { + return this; + } + /** * Comma-separated list or wildcard expressions of fields to include in field data and suggest statistics. *

@@ -609,6 +617,38 @@ public IndicesStatsRequest build() { // --------------------------------------------------------------------------------------------- + @Override + protected void applyQueryParameters(@Nonnull Map params) { + super.applyQueryParameters(params); + if (ApiTypeHelper.isDefined(this.completionFields)) { + params.put("completion_fields", String.join(",", this.completionFields)); + } + if (ApiTypeHelper.isDefined(this.expandWildcards)) { + params.put("expand_wildcards", this.expandWildcards.stream().map(v -> v.jsonValue()).collect(Collectors.joining(","))); + } + if (ApiTypeHelper.isDefined(this.fielddataFields)) { + params.put("fielddata_fields", String.join(",", this.fielddataFields)); + } + if (ApiTypeHelper.isDefined(this.fields)) { + params.put("fields", String.join(",", this.fields)); + } + if (this.forbidClosedIndices != null) { + params.put("forbid_closed_indices", String.valueOf(this.forbidClosedIndices)); + } + if (ApiTypeHelper.isDefined(this.groups)) { + params.put("groups", String.join(",", this.groups)); + } + if (this.includeSegmentFileSizes != null) { + params.put("include_segment_file_sizes", String.valueOf(this.includeSegmentFileSizes)); + } + if (this.includeUnloadedSegments != null) { + params.put("include_unloaded_segments", String.valueOf(this.includeUnloadedSegments)); + } + if (this.level != null) { + params.put("level", this.level.jsonValue()); + } + } + /** * Endpoint "{@code indices.stats}". */ @@ -655,33 +695,7 @@ public IndicesStatsRequest build() { // Request parameters request -> { Map params = new HashMap<>(); - if (ApiTypeHelper.isDefined(request.completionFields)) { - params.put("completion_fields", String.join(",", request.completionFields)); - } - if (ApiTypeHelper.isDefined(request.expandWildcards)) { - params.put("expand_wildcards", request.expandWildcards.stream().map(v -> v.jsonValue()).collect(Collectors.joining(","))); - } - if (ApiTypeHelper.isDefined(request.fielddataFields)) { - params.put("fielddata_fields", String.join(",", request.fielddataFields)); - } - if (ApiTypeHelper.isDefined(request.fields)) { - params.put("fields", String.join(",", request.fields)); - } - if (request.forbidClosedIndices != null) { - params.put("forbid_closed_indices", String.valueOf(request.forbidClosedIndices)); - } - if (ApiTypeHelper.isDefined(request.groups)) { - params.put("groups", String.join(",", request.groups)); - } - if (request.includeSegmentFileSizes != null) { - params.put("include_segment_file_sizes", String.valueOf(request.includeSegmentFileSizes)); - } - if (request.includeUnloadedSegments != null) { - params.put("include_unloaded_segments", String.valueOf(request.includeUnloadedSegments)); - } - if (request.level != null) { - params.put("level", request.level.jsonValue()); - } + request.applyQueryParameters(params); return params; }, SimpleEndpoint.emptyMap(), diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/indices/OpenRequest.java b/java-client/src/generated/java/org/opensearch/client/opensearch/indices/OpenRequest.java index 1075d20220..5971d1aeb7 100644 --- a/java-client/src/generated/java/org/opensearch/client/opensearch/indices/OpenRequest.java +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/indices/OpenRequest.java @@ -55,7 +55,6 @@ 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: indices.open.Request @@ -64,7 +63,7 @@ * Opens an index. */ @Generated("org.opensearch.client.codegen.CodeGenerator") -public class OpenRequest extends RequestBase implements ToCopyableBuilder { +public final class OpenRequest extends RequestBase implements ToCopyableBuilder { @Nullable private final Boolean allowNoIndices; @@ -100,6 +99,7 @@ public class OpenRequest extends RequestBase implements ToCopyableBuilder { + public static class Builder extends RequestBase.AbstractBuilder implements CopyableBuilder { @Nullable private Boolean allowNoIndices; @Nullable @@ -275,6 +275,7 @@ public static class Builder extends ObjectBuilderBase implements CopyableBuilder public Builder() {} private Builder(OpenRequest o) { + super(o); this.allowNoIndices = o.allowNoIndices; this.clusterManagerTimeout = o.clusterManagerTimeout; this.expandWildcards = _listCopy(o.expandWildcards); @@ -288,6 +289,7 @@ private Builder(OpenRequest o) { } private Builder(Builder o) { + super(o); this.allowNoIndices = o.allowNoIndices; this.clusterManagerTimeout = o.clusterManagerTimeout; this.expandWildcards = _listCopy(o.expandWildcards); @@ -306,6 +308,12 @@ public Builder copy() { return new Builder(this); } + @Override + @Nonnull + protected Builder self() { + return this; + } + /** * If false, the request returns an error if any wildcard expression, index alias, or _all value targets * only missing or closed indexes. This behavior applies even if the request targets other open indexes. @@ -554,6 +562,38 @@ public OpenRequest build() { // --------------------------------------------------------------------------------------------- + @Override + protected void applyQueryParameters(@Nonnull Map params) { + super.applyQueryParameters(params); + if (this.allowNoIndices != null) { + params.put("allow_no_indices", String.valueOf(this.allowNoIndices)); + } + if (this.clusterManagerTimeout != null) { + params.put("cluster_manager_timeout", this.clusterManagerTimeout._toJsonString()); + } + if (ApiTypeHelper.isDefined(this.expandWildcards)) { + params.put("expand_wildcards", this.expandWildcards.stream().map(v -> v.jsonValue()).collect(Collectors.joining(","))); + } + if (this.ignoreUnavailable != null) { + params.put("ignore_unavailable", String.valueOf(this.ignoreUnavailable)); + } + if (this.masterTimeout != null) { + params.put("master_timeout", this.masterTimeout._toJsonString()); + } + if (this.taskExecutionTimeout != null) { + params.put("task_execution_timeout", this.taskExecutionTimeout._toJsonString()); + } + if (this.timeout != null) { + params.put("timeout", this.timeout._toJsonString()); + } + if (this.waitForActiveShards != null) { + params.put("wait_for_active_shards", this.waitForActiveShards._toJsonString()); + } + if (this.waitForCompletion != null) { + params.put("wait_for_completion", String.valueOf(this.waitForCompletion)); + } + } + /** * Endpoint "{@code indices.open}". */ @@ -571,33 +611,7 @@ public OpenRequest build() { // Request parameters request -> { Map params = new HashMap<>(); - if (request.allowNoIndices != null) { - params.put("allow_no_indices", String.valueOf(request.allowNoIndices)); - } - if (request.clusterManagerTimeout != null) { - params.put("cluster_manager_timeout", request.clusterManagerTimeout._toJsonString()); - } - if (ApiTypeHelper.isDefined(request.expandWildcards)) { - params.put("expand_wildcards", request.expandWildcards.stream().map(v -> v.jsonValue()).collect(Collectors.joining(","))); - } - if (request.ignoreUnavailable != null) { - params.put("ignore_unavailable", String.valueOf(request.ignoreUnavailable)); - } - if (request.masterTimeout != null) { - params.put("master_timeout", request.masterTimeout._toJsonString()); - } - if (request.taskExecutionTimeout != null) { - params.put("task_execution_timeout", request.taskExecutionTimeout._toJsonString()); - } - 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.waitForCompletion != null) { - params.put("wait_for_completion", String.valueOf(request.waitForCompletion)); - } + request.applyQueryParameters(params); return params; }, SimpleEndpoint.emptyMap(), diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/indices/PutAliasRequest.java b/java-client/src/generated/java/org/opensearch/client/opensearch/indices/PutAliasRequest.java index 96d2f66a72..9cb49cb9ca 100644 --- a/java-client/src/generated/java/org/opensearch/client/opensearch/indices/PutAliasRequest.java +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/indices/PutAliasRequest.java @@ -60,7 +60,6 @@ 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: indices.put_alias.Request @@ -70,7 +69,7 @@ */ @JsonpDeserializable @Generated("org.opensearch.client.codegen.CodeGenerator") -public class PutAliasRequest extends RequestBase +public final class PutAliasRequest extends RequestBase implements PlainJsonSerializable, ToCopyableBuilder { @@ -115,6 +114,7 @@ public class PutAliasRequest extends RequestBase // --------------------------------------------------------------------------------------------- private PutAliasRequest(Builder builder) { + super(builder); this.alias = builder.alias; this.clusterManagerTimeout = builder.clusterManagerTimeout; this.filter = builder.filter; @@ -318,7 +318,7 @@ public static Builder builder() { /** * Builder for {@link PutAliasRequest}. */ - public static class Builder extends ObjectBuilderBase implements CopyableBuilder { + public static class Builder extends RequestBase.AbstractBuilder implements CopyableBuilder { @Nullable private String alias; @Nullable @@ -347,6 +347,7 @@ public static class Builder extends ObjectBuilderBase implements CopyableBuilder public Builder() {} private Builder(PutAliasRequest o) { + super(o); this.alias = o.alias; this.clusterManagerTimeout = o.clusterManagerTimeout; this.filter = o.filter; @@ -362,6 +363,7 @@ private Builder(PutAliasRequest o) { } private Builder(Builder o) { + super(o); this.alias = o.alias; this.clusterManagerTimeout = o.clusterManagerTimeout; this.filter = o.filter; @@ -382,6 +384,12 @@ public Builder copy() { return new Builder(this); } + @Override + @Nonnull + protected Builder self() { + return this; + } + /** * API name: {@code alias} */ @@ -617,6 +625,20 @@ protected static void setupPutAliasRequestDeserializer(ObjectDeserializer params) { + super.applyQueryParameters(params); + if (this.clusterManagerTimeout != null) { + params.put("cluster_manager_timeout", this.clusterManagerTimeout._toJsonString()); + } + if (this.masterTimeout != null) { + params.put("master_timeout", this.masterTimeout._toJsonString()); + } + if (this.timeout != null) { + params.put("timeout", this.timeout._toJsonString()); + } + } + /** * Endpoint "{@code indices.put_alias}". */ @@ -663,15 +685,7 @@ protected static void setupPutAliasRequestDeserializer(ObjectDeserializer { Map params = new HashMap<>(); - 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()); - } + request.applyQueryParameters(params); return params; }, SimpleEndpoint.emptyMap(), diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/indices/PutIndexTemplateRequest.java b/java-client/src/generated/java/org/opensearch/client/opensearch/indices/PutIndexTemplateRequest.java index 1d92dc0dd8..5b1a2e33d3 100644 --- a/java-client/src/generated/java/org/opensearch/client/opensearch/indices/PutIndexTemplateRequest.java +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/indices/PutIndexTemplateRequest.java @@ -61,7 +61,6 @@ 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: indices.put_index_template.Request @@ -71,7 +70,7 @@ */ @JsonpDeserializable @Generated("org.opensearch.client.codegen.CodeGenerator") -public class PutIndexTemplateRequest extends RequestBase +public final class PutIndexTemplateRequest extends RequestBase implements PlainJsonSerializable, ToCopyableBuilder { @@ -116,6 +115,7 @@ public class PutIndexTemplateRequest extends RequestBase // --------------------------------------------------------------------------------------------- private PutIndexTemplateRequest(Builder builder) { + super(builder); this.cause = builder.cause; this.clusterManagerTimeout = builder.clusterManagerTimeout; this.composedOf = ApiTypeHelper.unmodifiable(builder.composedOf); @@ -330,7 +330,7 @@ public static Builder builder() { /** * Builder for {@link PutIndexTemplateRequest}. */ - public static class Builder extends ObjectBuilderBase implements CopyableBuilder { + public static class Builder extends RequestBase.AbstractBuilder implements CopyableBuilder { @Nullable private String cause; @Nullable @@ -358,6 +358,7 @@ public static class Builder extends ObjectBuilderBase implements CopyableBuilder public Builder() {} private Builder(PutIndexTemplateRequest o) { + super(o); this.cause = o.cause; this.clusterManagerTimeout = o.clusterManagerTimeout; this.composedOf = _listCopy(o.composedOf); @@ -373,6 +374,7 @@ private Builder(PutIndexTemplateRequest o) { } private Builder(Builder o) { + super(o); this.cause = o.cause; this.clusterManagerTimeout = o.clusterManagerTimeout; this.composedOf = _listCopy(o.composedOf); @@ -393,6 +395,12 @@ public Builder copy() { return new Builder(this); } + @Override + @Nonnull + protected Builder self() { + return this; + } + /** * User defined reason for creating/updating the index template. *

@@ -658,6 +666,23 @@ protected static void setupPutIndexTemplateRequestDeserializer(ObjectDeserialize // --------------------------------------------------------------------------------------------- + @Override + protected void applyQueryParameters(@Nonnull Map params) { + super.applyQueryParameters(params); + if (this.cause != null) { + params.put("cause", this.cause); + } + if (this.clusterManagerTimeout != null) { + params.put("cluster_manager_timeout", this.clusterManagerTimeout._toJsonString()); + } + if (this.create != null) { + params.put("create", String.valueOf(this.create)); + } + if (this.masterTimeout != null) { + params.put("master_timeout", this.masterTimeout._toJsonString()); + } + } + /** * Endpoint "{@code indices.put_index_template}". */ @@ -674,18 +699,7 @@ protected static void setupPutIndexTemplateRequestDeserializer(ObjectDeserialize // Request parameters request -> { Map params = new HashMap<>(); - if (request.cause != null) { - params.put("cause", request.cause); - } - if (request.clusterManagerTimeout != null) { - params.put("cluster_manager_timeout", request.clusterManagerTimeout._toJsonString()); - } - if (request.create != null) { - params.put("create", String.valueOf(request.create)); - } - if (request.masterTimeout != null) { - params.put("master_timeout", request.masterTimeout._toJsonString()); - } + request.applyQueryParameters(params); return params; }, SimpleEndpoint.emptyMap(), diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/indices/PutIndicesSettingsRequest.java b/java-client/src/generated/java/org/opensearch/client/opensearch/indices/PutIndicesSettingsRequest.java index e338763804..677bf0aa02 100644 --- a/java-client/src/generated/java/org/opensearch/client/opensearch/indices/PutIndicesSettingsRequest.java +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/indices/PutIndicesSettingsRequest.java @@ -59,7 +59,6 @@ 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: indices.put_settings.Request @@ -69,7 +68,7 @@ */ @JsonpDeserializable @Generated("org.opensearch.client.codegen.CodeGenerator") -public class PutIndicesSettingsRequest extends RequestBase +public final class PutIndicesSettingsRequest extends RequestBase implements PlainJsonSerializable, ToCopyableBuilder { @@ -108,6 +107,7 @@ public class PutIndicesSettingsRequest extends RequestBase // --------------------------------------------------------------------------------------------- private PutIndicesSettingsRequest(Builder builder) { + super(builder); this.allowNoIndices = builder.allowNoIndices; this.clusterManagerTimeout = builder.clusterManagerTimeout; this.expandWildcards = ApiTypeHelper.unmodifiable(builder.expandWildcards); @@ -261,7 +261,9 @@ public static Builder builder() { /** * Builder for {@link PutIndicesSettingsRequest}. */ - public static class Builder extends ObjectBuilderBase implements CopyableBuilder { + public static class Builder extends RequestBase.AbstractBuilder + implements + CopyableBuilder { @Nullable private Boolean allowNoIndices; @Nullable @@ -285,6 +287,7 @@ public static class Builder extends ObjectBuilderBase implements CopyableBuilder public Builder() {} private Builder(PutIndicesSettingsRequest o) { + super(o); this.allowNoIndices = o.allowNoIndices; this.clusterManagerTimeout = o.clusterManagerTimeout; this.expandWildcards = _listCopy(o.expandWildcards); @@ -298,6 +301,7 @@ private Builder(PutIndicesSettingsRequest o) { } private Builder(Builder o) { + super(o); this.allowNoIndices = o.allowNoIndices; this.clusterManagerTimeout = o.clusterManagerTimeout; this.expandWildcards = _listCopy(o.expandWildcards); @@ -316,6 +320,12 @@ public Builder copy() { return new Builder(this); } + @Override + @Nonnull + protected Builder self() { + return this; + } + /** * If false, the request returns an error if any wildcard expression, index alias, or _all value targets * only missing or closed indexes. This behavior applies even if the request targets other open indexes. For example, a request @@ -553,6 +563,35 @@ protected static JsonpDeserializer createPutIndicesSe // --------------------------------------------------------------------------------------------- + @Override + protected void applyQueryParameters(@Nonnull Map params) { + super.applyQueryParameters(params); + if (this.allowNoIndices != null) { + params.put("allow_no_indices", String.valueOf(this.allowNoIndices)); + } + if (this.clusterManagerTimeout != null) { + params.put("cluster_manager_timeout", this.clusterManagerTimeout._toJsonString()); + } + if (ApiTypeHelper.isDefined(this.expandWildcards)) { + params.put("expand_wildcards", this.expandWildcards.stream().map(v -> v.jsonValue()).collect(Collectors.joining(","))); + } + if (this.flatSettings != null) { + params.put("flat_settings", String.valueOf(this.flatSettings)); + } + if (this.ignoreUnavailable != null) { + params.put("ignore_unavailable", String.valueOf(this.ignoreUnavailable)); + } + if (this.masterTimeout != null) { + params.put("master_timeout", this.masterTimeout._toJsonString()); + } + if (this.preserveExisting != null) { + params.put("preserve_existing", String.valueOf(this.preserveExisting)); + } + if (this.timeout != null) { + params.put("timeout", this.timeout._toJsonString()); + } + } + /** * Endpoint "{@code indices.put_settings}". */ @@ -583,30 +622,7 @@ protected static JsonpDeserializer createPutIndicesSe // Request parameters request -> { Map params = new HashMap<>(); - if (request.allowNoIndices != null) { - params.put("allow_no_indices", String.valueOf(request.allowNoIndices)); - } - if (request.clusterManagerTimeout != null) { - params.put("cluster_manager_timeout", request.clusterManagerTimeout._toJsonString()); - } - if (ApiTypeHelper.isDefined(request.expandWildcards)) { - params.put("expand_wildcards", request.expandWildcards.stream().map(v -> v.jsonValue()).collect(Collectors.joining(","))); - } - if (request.flatSettings != null) { - params.put("flat_settings", String.valueOf(request.flatSettings)); - } - if (request.ignoreUnavailable != null) { - params.put("ignore_unavailable", String.valueOf(request.ignoreUnavailable)); - } - if (request.masterTimeout != null) { - params.put("master_timeout", request.masterTimeout._toJsonString()); - } - if (request.preserveExisting != null) { - params.put("preserve_existing", String.valueOf(request.preserveExisting)); - } - if (request.timeout != null) { - params.put("timeout", request.timeout._toJsonString()); - } + request.applyQueryParameters(params); return params; }, SimpleEndpoint.emptyMap(), diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/indices/PutMappingRequest.java b/java-client/src/generated/java/org/opensearch/client/opensearch/indices/PutMappingRequest.java index 6bb2a993d1..9d4bdaee01 100644 --- a/java-client/src/generated/java/org/opensearch/client/opensearch/indices/PutMappingRequest.java +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/indices/PutMappingRequest.java @@ -68,7 +68,6 @@ 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: indices.put_mapping.Request @@ -78,7 +77,7 @@ */ @JsonpDeserializable @Generated("org.opensearch.client.codegen.CodeGenerator") -public class PutMappingRequest extends RequestBase +public final class PutMappingRequest extends RequestBase implements PlainJsonSerializable, ToCopyableBuilder { @@ -141,6 +140,7 @@ public class PutMappingRequest extends RequestBase // --------------------------------------------------------------------------------------------- private PutMappingRequest(Builder builder) { + super(builder); this.allowNoIndices = builder.allowNoIndices; this.clusterManagerTimeout = builder.clusterManagerTimeout; this.dateDetection = builder.dateDetection; @@ -464,7 +464,7 @@ public static Builder builder() { /** * Builder for {@link PutMappingRequest}. */ - public static class Builder extends ObjectBuilderBase implements CopyableBuilder { + public static class Builder extends RequestBase.AbstractBuilder implements CopyableBuilder { @Nullable private Boolean allowNoIndices; @Nullable @@ -504,6 +504,7 @@ public static class Builder extends ObjectBuilderBase implements CopyableBuilder public Builder() {} private Builder(PutMappingRequest o) { + super(o); this.allowNoIndices = o.allowNoIndices; this.clusterManagerTimeout = o.clusterManagerTimeout; this.dateDetection = o.dateDetection; @@ -525,6 +526,7 @@ private Builder(PutMappingRequest o) { } private Builder(Builder o) { + super(o); this.allowNoIndices = o.allowNoIndices; this.clusterManagerTimeout = o.clusterManagerTimeout; this.dateDetection = o.dateDetection; @@ -551,6 +553,12 @@ public Builder copy() { return new Builder(this); } + @Override + @Nonnull + protected Builder self() { + return this; + } + /** * If false, the request returns an error if any wildcard expression, index alias, or _all value targets * only missing or closed indexes. This behavior applies even if the request targets other open indexes. @@ -1022,6 +1030,32 @@ protected static void setupPutMappingRequestDeserializer(ObjectDeserializer params) { + super.applyQueryParameters(params); + if (this.allowNoIndices != null) { + params.put("allow_no_indices", String.valueOf(this.allowNoIndices)); + } + if (this.clusterManagerTimeout != null) { + params.put("cluster_manager_timeout", this.clusterManagerTimeout._toJsonString()); + } + if (ApiTypeHelper.isDefined(this.expandWildcards)) { + params.put("expand_wildcards", this.expandWildcards.stream().map(v -> v.jsonValue()).collect(Collectors.joining(","))); + } + if (this.ignoreUnavailable != null) { + params.put("ignore_unavailable", String.valueOf(this.ignoreUnavailable)); + } + if (this.masterTimeout != null) { + params.put("master_timeout", this.masterTimeout._toJsonString()); + } + if (this.timeout != null) { + params.put("timeout", this.timeout._toJsonString()); + } + if (this.writeIndexOnly != null) { + params.put("write_index_only", String.valueOf(this.writeIndexOnly)); + } + } + /** * Endpoint "{@code indices.put_mapping}". */ @@ -1039,27 +1073,7 @@ protected static void setupPutMappingRequestDeserializer(ObjectDeserializer { Map params = new HashMap<>(); - if (request.allowNoIndices != null) { - params.put("allow_no_indices", String.valueOf(request.allowNoIndices)); - } - if (request.clusterManagerTimeout != null) { - params.put("cluster_manager_timeout", request.clusterManagerTimeout._toJsonString()); - } - if (ApiTypeHelper.isDefined(request.expandWildcards)) { - params.put("expand_wildcards", request.expandWildcards.stream().map(v -> v.jsonValue()).collect(Collectors.joining(","))); - } - if (request.ignoreUnavailable != null) { - params.put("ignore_unavailable", String.valueOf(request.ignoreUnavailable)); - } - if (request.masterTimeout != null) { - params.put("master_timeout", request.masterTimeout._toJsonString()); - } - if (request.timeout != null) { - params.put("timeout", request.timeout._toJsonString()); - } - if (request.writeIndexOnly != null) { - params.put("write_index_only", String.valueOf(request.writeIndexOnly)); - } + request.applyQueryParameters(params); return params; }, SimpleEndpoint.emptyMap(), diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/indices/PutTemplateRequest.java b/java-client/src/generated/java/org/opensearch/client/opensearch/indices/PutTemplateRequest.java index 593813250b..8288592720 100644 --- a/java-client/src/generated/java/org/opensearch/client/opensearch/indices/PutTemplateRequest.java +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/indices/PutTemplateRequest.java @@ -61,7 +61,6 @@ 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: indices.put_template.Request @@ -71,7 +70,7 @@ */ @JsonpDeserializable @Generated("org.opensearch.client.codegen.CodeGenerator") -public class PutTemplateRequest extends RequestBase +public final class PutTemplateRequest extends RequestBase implements PlainJsonSerializable, ToCopyableBuilder { @@ -110,6 +109,7 @@ public class PutTemplateRequest extends RequestBase // --------------------------------------------------------------------------------------------- private PutTemplateRequest(Builder builder) { + super(builder); this.aliases = ApiTypeHelper.unmodifiable(builder.aliases); this.clusterManagerTimeout = builder.clusterManagerTimeout; this.create = builder.create; @@ -309,7 +309,7 @@ public static Builder builder() { /** * Builder for {@link PutTemplateRequest}. */ - public static class Builder extends ObjectBuilderBase implements CopyableBuilder { + public static class Builder extends RequestBase.AbstractBuilder implements CopyableBuilder { @Nullable private Map aliases; @Nullable @@ -333,6 +333,7 @@ public static class Builder extends ObjectBuilderBase implements CopyableBuilder public Builder() {} private Builder(PutTemplateRequest o) { + super(o); this.aliases = _mapCopy(o.aliases); this.clusterManagerTimeout = o.clusterManagerTimeout; this.create = o.create; @@ -346,6 +347,7 @@ private Builder(PutTemplateRequest o) { } private Builder(Builder o) { + super(o); this.aliases = _mapCopy(o.aliases); this.clusterManagerTimeout = o.clusterManagerTimeout; this.create = o.create; @@ -364,6 +366,12 @@ public Builder copy() { return new Builder(this); } + @Override + @Nonnull + protected Builder self() { + return this; + } + /** * Aliases for the index. *

@@ -628,6 +636,20 @@ protected static void setupPutTemplateRequestDeserializer(ObjectDeserializer params) { + super.applyQueryParameters(params); + if (this.clusterManagerTimeout != null) { + params.put("cluster_manager_timeout", this.clusterManagerTimeout._toJsonString()); + } + if (this.create != null) { + params.put("create", String.valueOf(this.create)); + } + if (this.masterTimeout != null) { + params.put("master_timeout", this.masterTimeout._toJsonString()); + } + } + /** * Endpoint "{@code indices.put_template}". */ @@ -644,15 +666,7 @@ protected static void setupPutTemplateRequestDeserializer(ObjectDeserializer { Map params = new HashMap<>(); - if (request.clusterManagerTimeout != null) { - params.put("cluster_manager_timeout", request.clusterManagerTimeout._toJsonString()); - } - if (request.create != null) { - params.put("create", String.valueOf(request.create)); - } - if (request.masterTimeout != null) { - params.put("master_timeout", request.masterTimeout._toJsonString()); - } + request.applyQueryParameters(params); return params; }, SimpleEndpoint.emptyMap(), diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/indices/RecoveryRequest.java b/java-client/src/generated/java/org/opensearch/client/opensearch/indices/RecoveryRequest.java index 59dafdeb9e..066db78051 100644 --- a/java-client/src/generated/java/org/opensearch/client/opensearch/indices/RecoveryRequest.java +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/indices/RecoveryRequest.java @@ -51,7 +51,6 @@ 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: indices.recovery.Request @@ -60,7 +59,7 @@ * Returns information about ongoing index shard recoveries. */ @Generated("org.opensearch.client.codegen.CodeGenerator") -public class RecoveryRequest extends RequestBase implements ToCopyableBuilder { +public final class RecoveryRequest extends RequestBase implements ToCopyableBuilder { @Nullable private final Boolean activeOnly; @@ -74,6 +73,7 @@ public class RecoveryRequest extends RequestBase implements ToCopyableBuilder { + public static class Builder extends RequestBase.AbstractBuilder implements CopyableBuilder { @Nullable private Boolean activeOnly; @Nullable @@ -144,12 +144,14 @@ public static class Builder extends ObjectBuilderBase implements CopyableBuilder public Builder() {} private Builder(RecoveryRequest o) { + super(o); this.activeOnly = o.activeOnly; this.detailed = o.detailed; this.index = _listCopy(o.index); } private Builder(Builder o) { + super(o); this.activeOnly = o.activeOnly; this.detailed = o.detailed; this.index = _listCopy(o.index); @@ -161,6 +163,12 @@ public Builder copy() { return new Builder(this); } + @Override + @Nonnull + protected Builder self() { + return this; + } + /** * If true, the response only includes ongoing shard recoveries. *

@@ -235,6 +243,17 @@ public RecoveryRequest build() { // --------------------------------------------------------------------------------------------- + @Override + protected void applyQueryParameters(@Nonnull Map params) { + super.applyQueryParameters(params); + if (this.activeOnly != null) { + params.put("active_only", String.valueOf(this.activeOnly)); + } + if (this.detailed != null) { + params.put("detailed", String.valueOf(this.detailed)); + } + } + /** * Endpoint "{@code indices.recovery}". */ @@ -265,12 +284,7 @@ public RecoveryRequest build() { // Request parameters request -> { Map params = new HashMap<>(); - if (request.activeOnly != null) { - params.put("active_only", String.valueOf(request.activeOnly)); - } - if (request.detailed != null) { - params.put("detailed", String.valueOf(request.detailed)); - } + request.applyQueryParameters(params); return params; }, SimpleEndpoint.emptyMap(), diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/indices/RefreshRequest.java b/java-client/src/generated/java/org/opensearch/client/opensearch/indices/RefreshRequest.java index 8e7cdf9400..3dc38252f2 100644 --- a/java-client/src/generated/java/org/opensearch/client/opensearch/indices/RefreshRequest.java +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/indices/RefreshRequest.java @@ -53,7 +53,6 @@ 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: indices.refresh.Request @@ -62,7 +61,7 @@ * Performs the refresh operation in one or more indexes. */ @Generated("org.opensearch.client.codegen.CodeGenerator") -public class RefreshRequest extends RequestBase implements ToCopyableBuilder { +public final class RefreshRequest extends RequestBase implements ToCopyableBuilder { @Nullable private final Boolean allowNoIndices; @@ -79,6 +78,7 @@ public class RefreshRequest extends RequestBase implements ToCopyableBuilder { + public static class Builder extends RequestBase.AbstractBuilder implements CopyableBuilder { @Nullable private Boolean allowNoIndices; @Nullable @@ -166,6 +166,7 @@ public static class Builder extends ObjectBuilderBase implements CopyableBuilder public Builder() {} private Builder(RefreshRequest o) { + super(o); this.allowNoIndices = o.allowNoIndices; this.expandWildcards = _listCopy(o.expandWildcards); this.ignoreUnavailable = o.ignoreUnavailable; @@ -173,6 +174,7 @@ private Builder(RefreshRequest o) { } private Builder(Builder o) { + super(o); this.allowNoIndices = o.allowNoIndices; this.expandWildcards = _listCopy(o.expandWildcards); this.ignoreUnavailable = o.ignoreUnavailable; @@ -185,6 +187,12 @@ public Builder copy() { return new Builder(this); } + @Override + @Nonnull + protected Builder self() { + return this; + } + /** * If false, the request returns an error if any wildcard expression, index alias, or _all value targets * only missing or closed indexes. This behavior applies even if the request targets other open indexes. @@ -296,6 +304,20 @@ public RefreshRequest build() { // --------------------------------------------------------------------------------------------- + @Override + protected void applyQueryParameters(@Nonnull Map params) { + super.applyQueryParameters(params); + if (this.allowNoIndices != null) { + params.put("allow_no_indices", String.valueOf(this.allowNoIndices)); + } + if (ApiTypeHelper.isDefined(this.expandWildcards)) { + params.put("expand_wildcards", this.expandWildcards.stream().map(v -> v.jsonValue()).collect(Collectors.joining(","))); + } + if (this.ignoreUnavailable != null) { + params.put("ignore_unavailable", String.valueOf(this.ignoreUnavailable)); + } + } + /** * Endpoint "{@code indices.refresh}". */ @@ -326,15 +348,7 @@ public RefreshRequest build() { // Request parameters request -> { Map params = new HashMap<>(); - if (request.allowNoIndices != null) { - params.put("allow_no_indices", String.valueOf(request.allowNoIndices)); - } - if (ApiTypeHelper.isDefined(request.expandWildcards)) { - params.put("expand_wildcards", request.expandWildcards.stream().map(v -> v.jsonValue()).collect(Collectors.joining(","))); - } - if (request.ignoreUnavailable != null) { - params.put("ignore_unavailable", String.valueOf(request.ignoreUnavailable)); - } + request.applyQueryParameters(params); return params; }, SimpleEndpoint.emptyMap(), diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/indices/ResolveIndexRequest.java b/java-client/src/generated/java/org/opensearch/client/opensearch/indices/ResolveIndexRequest.java index 9b32844ca6..8b912a797c 100644 --- a/java-client/src/generated/java/org/opensearch/client/opensearch/indices/ResolveIndexRequest.java +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/indices/ResolveIndexRequest.java @@ -53,7 +53,6 @@ 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: indices.resolve_index.Request @@ -62,7 +61,7 @@ * Returns information about any matching indexes, aliases, and data streams. */ @Generated("org.opensearch.client.codegen.CodeGenerator") -public class ResolveIndexRequest extends RequestBase implements ToCopyableBuilder { +public final class ResolveIndexRequest extends RequestBase implements ToCopyableBuilder { @Nonnull private final List expandWildcards; @@ -73,6 +72,7 @@ public class ResolveIndexRequest extends RequestBase implements ToCopyableBuilde // --------------------------------------------------------------------------------------------- private ResolveIndexRequest(Builder builder) { + super(builder); this.expandWildcards = ApiTypeHelper.unmodifiable(builder.expandWildcards); this.name = ApiTypeHelper.unmodifiableRequired(builder.name, this, "name"); } @@ -122,7 +122,7 @@ public static Builder builder() { /** * Builder for {@link ResolveIndexRequest}. */ - public static class Builder extends ObjectBuilderBase implements CopyableBuilder { + public static class Builder extends RequestBase.AbstractBuilder implements CopyableBuilder { @Nullable private List expandWildcards; private List name; @@ -130,11 +130,13 @@ public static class Builder extends ObjectBuilderBase implements CopyableBuilder public Builder() {} private Builder(ResolveIndexRequest o) { + super(o); this.expandWildcards = _listCopy(o.expandWildcards); this.name = _listCopy(o.name); } private Builder(Builder o) { + super(o); this.expandWildcards = _listCopy(o.expandWildcards); this.name = _listCopy(o.name); } @@ -145,6 +147,12 @@ public Builder copy() { return new Builder(this); } + @Override + @Nonnull + protected Builder self() { + return this; + } + /** * Type of index that wildcard patterns can match. If the request can target data streams, this argument determines whether wildcard * expressions match hidden data streams. Supports comma-separated values, such as open,hidden. Valid values are: @@ -231,6 +239,14 @@ public ResolveIndexRequest build() { // --------------------------------------------------------------------------------------------- + @Override + protected void applyQueryParameters(@Nonnull Map params) { + super.applyQueryParameters(params); + if (ApiTypeHelper.isDefined(this.expandWildcards)) { + params.put("expand_wildcards", this.expandWildcards.stream().map(v -> v.jsonValue()).collect(Collectors.joining(","))); + } + } + /** * Endpoint "{@code indices.resolve_index}". */ @@ -247,9 +263,7 @@ public ResolveIndexRequest build() { // Request parameters request -> { Map params = new HashMap<>(); - if (ApiTypeHelper.isDefined(request.expandWildcards)) { - params.put("expand_wildcards", request.expandWildcards.stream().map(v -> v.jsonValue()).collect(Collectors.joining(","))); - } + request.applyQueryParameters(params); return params; }, SimpleEndpoint.emptyMap(), diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/indices/RolloverRequest.java b/java-client/src/generated/java/org/opensearch/client/opensearch/indices/RolloverRequest.java index 2c25f2c99e..df8cf15ccc 100644 --- a/java-client/src/generated/java/org/opensearch/client/opensearch/indices/RolloverRequest.java +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/indices/RolloverRequest.java @@ -62,7 +62,6 @@ 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: indices.rollover.Request @@ -72,7 +71,7 @@ */ @JsonpDeserializable @Generated("org.opensearch.client.codegen.CodeGenerator") -public class RolloverRequest extends RequestBase +public final class RolloverRequest extends RequestBase implements PlainJsonSerializable, ToCopyableBuilder { @@ -114,6 +113,7 @@ public class RolloverRequest extends RequestBase // --------------------------------------------------------------------------------------------- private RolloverRequest(Builder builder) { + super(builder); this.alias = ApiTypeHelper.requireNonNull(builder.alias, this, "alias"); this.aliases = ApiTypeHelper.unmodifiable(builder.aliases); this.clusterManagerTimeout = builder.clusterManagerTimeout; @@ -306,7 +306,7 @@ public static Builder builder() { /** * Builder for {@link RolloverRequest}. */ - public static class Builder extends ObjectBuilderBase implements CopyableBuilder { + public static class Builder extends RequestBase.AbstractBuilder implements CopyableBuilder { private String alias; @Nullable private Map aliases; @@ -332,6 +332,7 @@ public static class Builder extends ObjectBuilderBase implements CopyableBuilder public Builder() {} private Builder(RolloverRequest o) { + super(o); this.alias = o.alias; this.aliases = _mapCopy(o.aliases); this.clusterManagerTimeout = o.clusterManagerTimeout; @@ -346,6 +347,7 @@ private Builder(RolloverRequest o) { } private Builder(Builder o) { + super(o); this.alias = o.alias; this.aliases = _mapCopy(o.aliases); this.clusterManagerTimeout = o.clusterManagerTimeout; @@ -365,6 +367,12 @@ public Builder copy() { return new Builder(this); } + @Override + @Nonnull + protected Builder self() { + return this; + } + /** * Required - Name of the data stream or index alias to roll over. *

@@ -645,6 +653,26 @@ protected static void setupRolloverRequestDeserializer(ObjectDeserializer params) { + super.applyQueryParameters(params); + if (this.clusterManagerTimeout != null) { + params.put("cluster_manager_timeout", this.clusterManagerTimeout._toJsonString()); + } + if (this.dryRun != null) { + params.put("dry_run", String.valueOf(this.dryRun)); + } + if (this.masterTimeout != null) { + params.put("master_timeout", this.masterTimeout._toJsonString()); + } + if (this.timeout != null) { + params.put("timeout", this.timeout._toJsonString()); + } + if (this.waitForActiveShards != null) { + params.put("wait_for_active_shards", this.waitForActiveShards._toJsonString()); + } + } + /** * Endpoint "{@code indices.rollover}". */ @@ -682,21 +710,7 @@ protected static void setupRolloverRequestDeserializer(ObjectDeserializer { Map params = new HashMap<>(); - if (request.clusterManagerTimeout != null) { - params.put("cluster_manager_timeout", request.clusterManagerTimeout._toJsonString()); - } - if (request.dryRun != null) { - params.put("dry_run", String.valueOf(request.dryRun)); - } - if (request.masterTimeout != null) { - params.put("master_timeout", request.masterTimeout._toJsonString()); - } - if (request.timeout != null) { - params.put("timeout", request.timeout._toJsonString()); - } - if (request.waitForActiveShards != null) { - params.put("wait_for_active_shards", request.waitForActiveShards._toJsonString()); - } + request.applyQueryParameters(params); return params; }, SimpleEndpoint.emptyMap(), diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/indices/SegmentsRequest.java b/java-client/src/generated/java/org/opensearch/client/opensearch/indices/SegmentsRequest.java index 55918d3208..54e706bbcd 100644 --- a/java-client/src/generated/java/org/opensearch/client/opensearch/indices/SegmentsRequest.java +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/indices/SegmentsRequest.java @@ -53,7 +53,6 @@ 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: indices.segments.Request @@ -62,7 +61,7 @@ * Provides low-level information about segments in a Lucene index. */ @Generated("org.opensearch.client.codegen.CodeGenerator") -public class SegmentsRequest extends RequestBase implements ToCopyableBuilder { +public final class SegmentsRequest extends RequestBase implements ToCopyableBuilder { @Nullable private final Boolean allowNoIndices; @@ -82,6 +81,7 @@ public class SegmentsRequest extends RequestBase implements ToCopyableBuilder { + public static class Builder extends RequestBase.AbstractBuilder implements CopyableBuilder { @Nullable private Boolean allowNoIndices; @Nullable @@ -183,6 +183,7 @@ public static class Builder extends ObjectBuilderBase implements CopyableBuilder public Builder() {} private Builder(SegmentsRequest o) { + super(o); this.allowNoIndices = o.allowNoIndices; this.expandWildcards = _listCopy(o.expandWildcards); this.ignoreUnavailable = o.ignoreUnavailable; @@ -191,6 +192,7 @@ private Builder(SegmentsRequest o) { } private Builder(Builder o) { + super(o); this.allowNoIndices = o.allowNoIndices; this.expandWildcards = _listCopy(o.expandWildcards); this.ignoreUnavailable = o.ignoreUnavailable; @@ -204,6 +206,12 @@ public Builder copy() { return new Builder(this); } + @Override + @Nonnull + protected Builder self() { + return this; + } + /** * If false, the request returns an error if any wildcard expression, index alias, or _all value targets * only missing or closed indexes. This behavior applies even if the request targets other open indexes. @@ -327,6 +335,23 @@ public SegmentsRequest build() { // --------------------------------------------------------------------------------------------- + @Override + protected void applyQueryParameters(@Nonnull Map params) { + super.applyQueryParameters(params); + if (this.allowNoIndices != null) { + params.put("allow_no_indices", String.valueOf(this.allowNoIndices)); + } + if (ApiTypeHelper.isDefined(this.expandWildcards)) { + params.put("expand_wildcards", this.expandWildcards.stream().map(v -> v.jsonValue()).collect(Collectors.joining(","))); + } + if (this.ignoreUnavailable != null) { + params.put("ignore_unavailable", String.valueOf(this.ignoreUnavailable)); + } + if (this.verbose != null) { + params.put("verbose", String.valueOf(this.verbose)); + } + } + /** * Endpoint "{@code indices.segments}". */ @@ -357,18 +382,7 @@ public SegmentsRequest build() { // Request parameters request -> { Map params = new HashMap<>(); - if (request.allowNoIndices != null) { - params.put("allow_no_indices", String.valueOf(request.allowNoIndices)); - } - if (ApiTypeHelper.isDefined(request.expandWildcards)) { - params.put("expand_wildcards", request.expandWildcards.stream().map(v -> v.jsonValue()).collect(Collectors.joining(","))); - } - if (request.ignoreUnavailable != null) { - params.put("ignore_unavailable", String.valueOf(request.ignoreUnavailable)); - } - if (request.verbose != null) { - params.put("verbose", String.valueOf(request.verbose)); - } + request.applyQueryParameters(params); return params; }, SimpleEndpoint.emptyMap(), diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/indices/ShardStoresRequest.java b/java-client/src/generated/java/org/opensearch/client/opensearch/indices/ShardStoresRequest.java index e4ae7cac8c..ff94fad6c2 100644 --- a/java-client/src/generated/java/org/opensearch/client/opensearch/indices/ShardStoresRequest.java +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/indices/ShardStoresRequest.java @@ -54,7 +54,6 @@ 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: indices.shard_stores.Request @@ -63,7 +62,7 @@ * Provides store information for shard copies of indexes. */ @Generated("org.opensearch.client.codegen.CodeGenerator") -public class ShardStoresRequest extends RequestBase implements ToCopyableBuilder { +public final class ShardStoresRequest extends RequestBase implements ToCopyableBuilder { @Nullable private final Boolean allowNoIndices; @@ -83,6 +82,7 @@ public class ShardStoresRequest extends RequestBase implements ToCopyableBuilder // --------------------------------------------------------------------------------------------- private ShardStoresRequest(Builder builder) { + super(builder); this.allowNoIndices = builder.allowNoIndices; this.expandWildcards = ApiTypeHelper.unmodifiable(builder.expandWildcards); this.ignoreUnavailable = builder.ignoreUnavailable; @@ -167,7 +167,7 @@ public static Builder builder() { /** * Builder for {@link ShardStoresRequest}. */ - public static class Builder extends ObjectBuilderBase implements CopyableBuilder { + public static class Builder extends RequestBase.AbstractBuilder implements CopyableBuilder { @Nullable private Boolean allowNoIndices; @Nullable @@ -182,6 +182,7 @@ public static class Builder extends ObjectBuilderBase implements CopyableBuilder public Builder() {} private Builder(ShardStoresRequest o) { + super(o); this.allowNoIndices = o.allowNoIndices; this.expandWildcards = _listCopy(o.expandWildcards); this.ignoreUnavailable = o.ignoreUnavailable; @@ -190,6 +191,7 @@ private Builder(ShardStoresRequest o) { } private Builder(Builder o) { + super(o); this.allowNoIndices = o.allowNoIndices; this.expandWildcards = _listCopy(o.expandWildcards); this.ignoreUnavailable = o.ignoreUnavailable; @@ -203,6 +205,12 @@ public Builder copy() { return new Builder(this); } + @Override + @Nonnull + protected Builder self() { + return this; + } + /** * If false, the request returns an error if any wildcard expression, index alias, or _all value targets * only missing or closed indexes. This behavior applies even if the request targets other open indexes. @@ -342,6 +350,23 @@ public ShardStoresRequest build() { // --------------------------------------------------------------------------------------------- + @Override + protected void applyQueryParameters(@Nonnull Map params) { + super.applyQueryParameters(params); + if (this.allowNoIndices != null) { + params.put("allow_no_indices", String.valueOf(this.allowNoIndices)); + } + if (ApiTypeHelper.isDefined(this.expandWildcards)) { + params.put("expand_wildcards", this.expandWildcards.stream().map(v -> v.jsonValue()).collect(Collectors.joining(","))); + } + if (this.ignoreUnavailable != null) { + params.put("ignore_unavailable", String.valueOf(this.ignoreUnavailable)); + } + if (ApiTypeHelper.isDefined(this.status)) { + params.put("status", this.status.stream().map(v -> v.jsonValue()).collect(Collectors.joining(","))); + } + } + /** * Endpoint "{@code indices.shard_stores}". */ @@ -372,18 +397,7 @@ public ShardStoresRequest build() { // Request parameters request -> { Map params = new HashMap<>(); - if (request.allowNoIndices != null) { - params.put("allow_no_indices", String.valueOf(request.allowNoIndices)); - } - if (ApiTypeHelper.isDefined(request.expandWildcards)) { - params.put("expand_wildcards", request.expandWildcards.stream().map(v -> v.jsonValue()).collect(Collectors.joining(","))); - } - if (request.ignoreUnavailable != null) { - params.put("ignore_unavailable", String.valueOf(request.ignoreUnavailable)); - } - if (ApiTypeHelper.isDefined(request.status)) { - params.put("status", request.status.stream().map(v -> v.jsonValue()).collect(Collectors.joining(","))); - } + request.applyQueryParameters(params); return params; }, SimpleEndpoint.emptyMap(), diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/indices/ShrinkRequest.java b/java-client/src/generated/java/org/opensearch/client/opensearch/indices/ShrinkRequest.java index b433e14305..f9ecb771ab 100644 --- a/java-client/src/generated/java/org/opensearch/client/opensearch/indices/ShrinkRequest.java +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/indices/ShrinkRequest.java @@ -60,7 +60,6 @@ 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: indices.shrink.Request @@ -70,7 +69,10 @@ */ @JsonpDeserializable @Generated("org.opensearch.client.codegen.CodeGenerator") -public class ShrinkRequest extends RequestBase implements PlainJsonSerializable, ToCopyableBuilder { +public final class ShrinkRequest extends RequestBase + implements + PlainJsonSerializable, + ToCopyableBuilder { @Nonnull private final Map aliases; @@ -109,6 +111,7 @@ public class ShrinkRequest extends RequestBase implements PlainJsonSerializable, // --------------------------------------------------------------------------------------------- private ShrinkRequest(Builder builder) { + super(builder); this.aliases = ApiTypeHelper.unmodifiable(builder.aliases); this.clusterManagerTimeout = builder.clusterManagerTimeout; this.copySettings = builder.copySettings; @@ -297,7 +300,7 @@ public static Builder builder() { /** * Builder for {@link ShrinkRequest}. */ - public static class Builder extends ObjectBuilderBase implements CopyableBuilder { + public static class Builder extends RequestBase.AbstractBuilder implements CopyableBuilder { @Nullable private Map aliases; @Nullable @@ -322,6 +325,7 @@ public static class Builder extends ObjectBuilderBase implements CopyableBuilder public Builder() {} private Builder(ShrinkRequest o) { + super(o); this.aliases = _mapCopy(o.aliases); this.clusterManagerTimeout = o.clusterManagerTimeout; this.copySettings = o.copySettings; @@ -336,6 +340,7 @@ private Builder(ShrinkRequest o) { } private Builder(Builder o) { + super(o); this.aliases = _mapCopy(o.aliases); this.clusterManagerTimeout = o.clusterManagerTimeout; this.copySettings = o.copySettings; @@ -355,6 +360,12 @@ public Builder copy() { return new Builder(this); } + @Override + @Nonnull + protected Builder self() { + return this; + } + /** * The key is the alias name. Index alias names support date math. *

@@ -634,6 +645,32 @@ protected static void setupShrinkRequestDeserializer(ObjectDeserializer params) { + super.applyQueryParameters(params); + if (this.clusterManagerTimeout != null) { + params.put("cluster_manager_timeout", this.clusterManagerTimeout._toJsonString()); + } + if (this.copySettings != null) { + params.put("copy_settings", String.valueOf(this.copySettings)); + } + if (this.masterTimeout != null) { + params.put("master_timeout", this.masterTimeout._toJsonString()); + } + if (this.taskExecutionTimeout != null) { + params.put("task_execution_timeout", this.taskExecutionTimeout._toJsonString()); + } + if (this.timeout != null) { + params.put("timeout", this.timeout._toJsonString()); + } + if (this.waitForActiveShards != null) { + params.put("wait_for_active_shards", this.waitForActiveShards._toJsonString()); + } + if (this.waitForCompletion != null) { + params.put("wait_for_completion", String.valueOf(this.waitForCompletion)); + } + } + /** * Endpoint "{@code indices.shrink}". */ @@ -652,27 +689,7 @@ protected static void setupShrinkRequestDeserializer(ObjectDeserializer { Map params = new HashMap<>(); - if (request.clusterManagerTimeout != null) { - params.put("cluster_manager_timeout", request.clusterManagerTimeout._toJsonString()); - } - if (request.copySettings != null) { - params.put("copy_settings", String.valueOf(request.copySettings)); - } - if (request.masterTimeout != null) { - params.put("master_timeout", request.masterTimeout._toJsonString()); - } - if (request.taskExecutionTimeout != null) { - params.put("task_execution_timeout", request.taskExecutionTimeout._toJsonString()); - } - 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.waitForCompletion != null) { - params.put("wait_for_completion", String.valueOf(request.waitForCompletion)); - } + request.applyQueryParameters(params); return params; }, SimpleEndpoint.emptyMap(), diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/indices/SimulateIndexTemplateRequest.java b/java-client/src/generated/java/org/opensearch/client/opensearch/indices/SimulateIndexTemplateRequest.java index 872719d5c5..ddb9bd0c10 100644 --- a/java-client/src/generated/java/org/opensearch/client/opensearch/indices/SimulateIndexTemplateRequest.java +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/indices/SimulateIndexTemplateRequest.java @@ -61,7 +61,6 @@ 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: indices.simulate_index_template.Request @@ -71,7 +70,7 @@ */ @JsonpDeserializable @Generated("org.opensearch.client.codegen.CodeGenerator") -public class SimulateIndexTemplateRequest extends RequestBase +public final class SimulateIndexTemplateRequest extends RequestBase implements PlainJsonSerializable, ToCopyableBuilder { @@ -113,6 +112,7 @@ public class SimulateIndexTemplateRequest extends RequestBase // --------------------------------------------------------------------------------------------- private SimulateIndexTemplateRequest(Builder builder) { + super(builder); this.allowAutoCreate = builder.allowAutoCreate; this.clusterManagerTimeout = builder.clusterManagerTimeout; this.composedOf = ApiTypeHelper.unmodifiable(builder.composedOf); @@ -326,7 +326,9 @@ public static Builder builder() { /** * Builder for {@link SimulateIndexTemplateRequest}. */ - public static class Builder extends ObjectBuilderBase implements CopyableBuilder { + public static class Builder extends RequestBase.AbstractBuilder + implements + CopyableBuilder { @Nullable private Boolean allowAutoCreate; @Nullable @@ -352,6 +354,7 @@ public static class Builder extends ObjectBuilderBase implements CopyableBuilder public Builder() {} private Builder(SimulateIndexTemplateRequest o) { + super(o); this.allowAutoCreate = o.allowAutoCreate; this.clusterManagerTimeout = o.clusterManagerTimeout; this.composedOf = _listCopy(o.composedOf); @@ -366,6 +369,7 @@ private Builder(SimulateIndexTemplateRequest o) { } private Builder(Builder o) { + super(o); this.allowAutoCreate = o.allowAutoCreate; this.clusterManagerTimeout = o.clusterManagerTimeout; this.composedOf = _listCopy(o.composedOf); @@ -385,6 +389,12 @@ public Builder copy() { return new Builder(this); } + @Override + @Nonnull + protected Builder self() { + return this; + } + /** * This setting overrides the value of the action.auto_create_index cluster setting. If set to true in a * template, then indexes can be automatically created using that template even if auto-creation of indexes is disabled using @@ -644,6 +654,17 @@ protected static void setupSimulateIndexTemplateRequestDeserializer(ObjectDeseri // --------------------------------------------------------------------------------------------- + @Override + protected void applyQueryParameters(@Nonnull Map params) { + super.applyQueryParameters(params); + if (this.clusterManagerTimeout != null) { + params.put("cluster_manager_timeout", this.clusterManagerTimeout._toJsonString()); + } + if (this.masterTimeout != null) { + params.put("master_timeout", this.masterTimeout._toJsonString()); + } + } + /** * Endpoint "{@code indices.simulate_index_template}". */ @@ -661,12 +682,7 @@ protected static void setupSimulateIndexTemplateRequestDeserializer(ObjectDeseri // Request parameters request -> { Map params = new HashMap<>(); - if (request.clusterManagerTimeout != null) { - params.put("cluster_manager_timeout", request.clusterManagerTimeout._toJsonString()); - } - if (request.masterTimeout != null) { - params.put("master_timeout", request.masterTimeout._toJsonString()); - } + request.applyQueryParameters(params); return params; }, SimpleEndpoint.emptyMap(), diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/indices/SimulateTemplateRequest.java b/java-client/src/generated/java/org/opensearch/client/opensearch/indices/SimulateTemplateRequest.java index b54b27bcd8..d0fed4dcc1 100644 --- a/java-client/src/generated/java/org/opensearch/client/opensearch/indices/SimulateTemplateRequest.java +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/indices/SimulateTemplateRequest.java @@ -56,7 +56,6 @@ 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: indices.simulate_template.Request @@ -66,7 +65,7 @@ */ @JsonpDeserializable @Generated("org.opensearch.client.codegen.CodeGenerator") -public class SimulateTemplateRequest extends RequestBase +public final class SimulateTemplateRequest extends RequestBase implements PlainJsonSerializable, ToCopyableBuilder { @@ -93,6 +92,7 @@ public class SimulateTemplateRequest extends RequestBase // --------------------------------------------------------------------------------------------- private SimulateTemplateRequest(Builder builder) { + super(builder); this.cause = builder.cause; this.clusterManagerTimeout = builder.clusterManagerTimeout; this.create = builder.create; @@ -197,7 +197,7 @@ public static Builder builder() { /** * Builder for {@link SimulateTemplateRequest}. */ - public static class Builder extends ObjectBuilderBase implements CopyableBuilder { + public static class Builder extends RequestBase.AbstractBuilder implements CopyableBuilder { @Nullable private String cause; @Nullable @@ -213,6 +213,7 @@ public static class Builder extends ObjectBuilderBase implements CopyableBuilder public Builder() {} private Builder(SimulateTemplateRequest o) { + super(o); this.cause = o.cause; this.clusterManagerTimeout = o.clusterManagerTimeout; this.create = o.create; @@ -222,6 +223,7 @@ private Builder(SimulateTemplateRequest o) { } private Builder(Builder o) { + super(o); this.cause = o.cause; this.clusterManagerTimeout = o.clusterManagerTimeout; this.create = o.create; @@ -236,6 +238,12 @@ public Builder copy() { return new Builder(this); } + @Override + @Nonnull + protected Builder self() { + return this; + } + /** * User defined reason for dry-run creating the new template for simulation purposes. *

@@ -370,6 +378,23 @@ protected static JsonpDeserializer createSimulateTempla // --------------------------------------------------------------------------------------------- + @Override + protected void applyQueryParameters(@Nonnull Map params) { + super.applyQueryParameters(params); + if (this.cause != null) { + params.put("cause", this.cause); + } + if (this.clusterManagerTimeout != null) { + params.put("cluster_manager_timeout", this.clusterManagerTimeout._toJsonString()); + } + if (this.create != null) { + params.put("create", String.valueOf(this.create)); + } + if (this.masterTimeout != null) { + params.put("master_timeout", this.masterTimeout._toJsonString()); + } + } + /** * Endpoint "{@code indices.simulate_template}". */ @@ -399,18 +424,7 @@ protected static JsonpDeserializer createSimulateTempla // Request parameters request -> { Map params = new HashMap<>(); - if (request.cause != null) { - params.put("cause", request.cause); - } - if (request.clusterManagerTimeout != null) { - params.put("cluster_manager_timeout", request.clusterManagerTimeout._toJsonString()); - } - if (request.create != null) { - params.put("create", String.valueOf(request.create)); - } - if (request.masterTimeout != null) { - params.put("master_timeout", request.masterTimeout._toJsonString()); - } + request.applyQueryParameters(params); return params; }, SimpleEndpoint.emptyMap(), diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/indices/SplitRequest.java b/java-client/src/generated/java/org/opensearch/client/opensearch/indices/SplitRequest.java index e6b6f22226..be2e1664f1 100644 --- a/java-client/src/generated/java/org/opensearch/client/opensearch/indices/SplitRequest.java +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/indices/SplitRequest.java @@ -60,7 +60,6 @@ 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: indices.split.Request @@ -70,7 +69,10 @@ */ @JsonpDeserializable @Generated("org.opensearch.client.codegen.CodeGenerator") -public class SplitRequest extends RequestBase implements PlainJsonSerializable, ToCopyableBuilder { +public final class SplitRequest extends RequestBase + implements + PlainJsonSerializable, + ToCopyableBuilder { @Nonnull private final Map aliases; @@ -109,6 +111,7 @@ public class SplitRequest extends RequestBase implements PlainJsonSerializable, // --------------------------------------------------------------------------------------------- private SplitRequest(Builder builder) { + super(builder); this.aliases = ApiTypeHelper.unmodifiable(builder.aliases); this.clusterManagerTimeout = builder.clusterManagerTimeout; this.copySettings = builder.copySettings; @@ -297,7 +300,7 @@ public static Builder builder() { /** * Builder for {@link SplitRequest}. */ - public static class Builder extends ObjectBuilderBase implements CopyableBuilder { + public static class Builder extends RequestBase.AbstractBuilder implements CopyableBuilder { @Nullable private Map aliases; @Nullable @@ -322,6 +325,7 @@ public static class Builder extends ObjectBuilderBase implements CopyableBuilder public Builder() {} private Builder(SplitRequest o) { + super(o); this.aliases = _mapCopy(o.aliases); this.clusterManagerTimeout = o.clusterManagerTimeout; this.copySettings = o.copySettings; @@ -336,6 +340,7 @@ private Builder(SplitRequest o) { } private Builder(Builder o) { + super(o); this.aliases = _mapCopy(o.aliases); this.clusterManagerTimeout = o.clusterManagerTimeout; this.copySettings = o.copySettings; @@ -355,6 +360,12 @@ public Builder copy() { return new Builder(this); } + @Override + @Nonnull + protected Builder self() { + return this; + } + /** * Aliases for the resulting index. *

@@ -634,6 +645,32 @@ protected static void setupSplitRequestDeserializer(ObjectDeserializer params) { + super.applyQueryParameters(params); + if (this.clusterManagerTimeout != null) { + params.put("cluster_manager_timeout", this.clusterManagerTimeout._toJsonString()); + } + if (this.copySettings != null) { + params.put("copy_settings", String.valueOf(this.copySettings)); + } + if (this.masterTimeout != null) { + params.put("master_timeout", this.masterTimeout._toJsonString()); + } + if (this.taskExecutionTimeout != null) { + params.put("task_execution_timeout", this.taskExecutionTimeout._toJsonString()); + } + if (this.timeout != null) { + params.put("timeout", this.timeout._toJsonString()); + } + if (this.waitForActiveShards != null) { + params.put("wait_for_active_shards", this.waitForActiveShards._toJsonString()); + } + if (this.waitForCompletion != null) { + params.put("wait_for_completion", String.valueOf(this.waitForCompletion)); + } + } + /** * Endpoint "{@code indices.split}". */ @@ -652,27 +689,7 @@ protected static void setupSplitRequestDeserializer(ObjectDeserializer { Map params = new HashMap<>(); - if (request.clusterManagerTimeout != null) { - params.put("cluster_manager_timeout", request.clusterManagerTimeout._toJsonString()); - } - if (request.copySettings != null) { - params.put("copy_settings", String.valueOf(request.copySettings)); - } - if (request.masterTimeout != null) { - params.put("master_timeout", request.masterTimeout._toJsonString()); - } - if (request.taskExecutionTimeout != null) { - params.put("task_execution_timeout", request.taskExecutionTimeout._toJsonString()); - } - 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.waitForCompletion != null) { - params.put("wait_for_completion", String.valueOf(request.waitForCompletion)); - } + request.applyQueryParameters(params); return params; }, SimpleEndpoint.emptyMap(), diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/indices/UpdateAliasesRequest.java b/java-client/src/generated/java/org/opensearch/client/opensearch/indices/UpdateAliasesRequest.java index 633d6255d6..823e276476 100644 --- a/java-client/src/generated/java/org/opensearch/client/opensearch/indices/UpdateAliasesRequest.java +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/indices/UpdateAliasesRequest.java @@ -60,7 +60,6 @@ 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: indices.update_aliases.Request @@ -70,7 +69,7 @@ */ @JsonpDeserializable @Generated("org.opensearch.client.codegen.CodeGenerator") -public class UpdateAliasesRequest extends RequestBase +public final class UpdateAliasesRequest extends RequestBase implements PlainJsonSerializable, ToCopyableBuilder { @@ -91,6 +90,7 @@ public class UpdateAliasesRequest extends RequestBase // --------------------------------------------------------------------------------------------- private UpdateAliasesRequest(Builder builder) { + super(builder); this.actions = ApiTypeHelper.unmodifiable(builder.actions); this.clusterManagerTimeout = builder.clusterManagerTimeout; this.masterTimeout = builder.masterTimeout; @@ -183,7 +183,7 @@ public static Builder builder() { /** * Builder for {@link UpdateAliasesRequest}. */ - public static class Builder extends ObjectBuilderBase implements CopyableBuilder { + public static class Builder extends RequestBase.AbstractBuilder implements CopyableBuilder { @Nullable private List actions; @Nullable @@ -196,6 +196,7 @@ public static class Builder extends ObjectBuilderBase implements CopyableBuilder public Builder() {} private Builder(UpdateAliasesRequest o) { + super(o); this.actions = _listCopy(o.actions); this.clusterManagerTimeout = o.clusterManagerTimeout; this.masterTimeout = o.masterTimeout; @@ -203,6 +204,7 @@ private Builder(UpdateAliasesRequest o) { } private Builder(Builder o) { + super(o); this.actions = _listCopy(o.actions); this.clusterManagerTimeout = o.clusterManagerTimeout; this.masterTimeout = o.masterTimeout; @@ -215,6 +217,12 @@ public Builder copy() { return new Builder(this); } + @Override + @Nonnull + protected Builder self() { + return this; + } + /** * Actions to perform. *

@@ -365,6 +373,20 @@ protected static void setupUpdateAliasesRequestDeserializer(ObjectDeserializer params) { + super.applyQueryParameters(params); + if (this.clusterManagerTimeout != null) { + params.put("cluster_manager_timeout", this.clusterManagerTimeout._toJsonString()); + } + if (this.masterTimeout != null) { + params.put("master_timeout", this.masterTimeout._toJsonString()); + } + if (this.timeout != null) { + params.put("timeout", this.timeout._toJsonString()); + } + } + /** * Endpoint "{@code indices.update_aliases}". */ @@ -376,15 +398,7 @@ protected static void setupUpdateAliasesRequestDeserializer(ObjectDeserializer { Map params = new HashMap<>(); - 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()); - } + request.applyQueryParameters(params); return params; }, SimpleEndpoint.emptyMap(), diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/indices/UpgradeRequest.java b/java-client/src/generated/java/org/opensearch/client/opensearch/indices/UpgradeRequest.java index f4851bf742..1a3589cf02 100644 --- a/java-client/src/generated/java/org/opensearch/client/opensearch/indices/UpgradeRequest.java +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/indices/UpgradeRequest.java @@ -53,7 +53,6 @@ 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: indices.upgrade.Request @@ -62,7 +61,7 @@ * The _upgrade API is no longer useful and will be removed. */ @Generated("org.opensearch.client.codegen.CodeGenerator") -public class UpgradeRequest extends RequestBase implements ToCopyableBuilder { +public final class UpgradeRequest extends RequestBase implements ToCopyableBuilder { @Nullable private final Boolean allowNoIndices; @@ -85,6 +84,7 @@ public class UpgradeRequest extends RequestBase implements ToCopyableBuilder { + public static class Builder extends RequestBase.AbstractBuilder implements CopyableBuilder { @Nullable private Boolean allowNoIndices; @Nullable @@ -197,6 +197,7 @@ public static class Builder extends ObjectBuilderBase implements CopyableBuilder public Builder() {} private Builder(UpgradeRequest o) { + super(o); this.allowNoIndices = o.allowNoIndices; this.expandWildcards = _listCopy(o.expandWildcards); this.ignoreUnavailable = o.ignoreUnavailable; @@ -206,6 +207,7 @@ private Builder(UpgradeRequest o) { } private Builder(Builder o) { + super(o); this.allowNoIndices = o.allowNoIndices; this.expandWildcards = _listCopy(o.expandWildcards); this.ignoreUnavailable = o.ignoreUnavailable; @@ -220,6 +222,12 @@ public Builder copy() { return new Builder(this); } + @Override + @Nonnull + protected Builder self() { + return this; + } + /** * Whether to ignore if a wildcard indexes expression resolves into no concrete indexes. (This includes _all string or * when no indexes have been specified). @@ -349,6 +357,26 @@ public UpgradeRequest build() { // --------------------------------------------------------------------------------------------- + @Override + protected void applyQueryParameters(@Nonnull Map params) { + super.applyQueryParameters(params); + if (this.allowNoIndices != null) { + params.put("allow_no_indices", String.valueOf(this.allowNoIndices)); + } + if (ApiTypeHelper.isDefined(this.expandWildcards)) { + params.put("expand_wildcards", this.expandWildcards.stream().map(v -> v.jsonValue()).collect(Collectors.joining(","))); + } + if (this.ignoreUnavailable != null) { + params.put("ignore_unavailable", String.valueOf(this.ignoreUnavailable)); + } + if (this.onlyAncientSegments != null) { + params.put("only_ancient_segments", String.valueOf(this.onlyAncientSegments)); + } + if (this.waitForCompletion != null) { + params.put("wait_for_completion", String.valueOf(this.waitForCompletion)); + } + } + /** * Endpoint "{@code indices.upgrade}". */ @@ -379,21 +407,7 @@ public UpgradeRequest build() { // Request parameters request -> { Map params = new HashMap<>(); - if (request.allowNoIndices != null) { - params.put("allow_no_indices", String.valueOf(request.allowNoIndices)); - } - if (ApiTypeHelper.isDefined(request.expandWildcards)) { - params.put("expand_wildcards", request.expandWildcards.stream().map(v -> v.jsonValue()).collect(Collectors.joining(","))); - } - if (request.ignoreUnavailable != null) { - params.put("ignore_unavailable", String.valueOf(request.ignoreUnavailable)); - } - if (request.onlyAncientSegments != null) { - params.put("only_ancient_segments", String.valueOf(request.onlyAncientSegments)); - } - if (request.waitForCompletion != null) { - params.put("wait_for_completion", String.valueOf(request.waitForCompletion)); - } + request.applyQueryParameters(params); return params; }, SimpleEndpoint.emptyMap(), diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/indices/ValidateQueryRequest.java b/java-client/src/generated/java/org/opensearch/client/opensearch/indices/ValidateQueryRequest.java index d6c93d2e29..5e8ee0333a 100644 --- a/java-client/src/generated/java/org/opensearch/client/opensearch/indices/ValidateQueryRequest.java +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/indices/ValidateQueryRequest.java @@ -62,7 +62,6 @@ 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: indices.validate_query.Request @@ -72,7 +71,7 @@ */ @JsonpDeserializable @Generated("org.opensearch.client.codegen.CodeGenerator") -public class ValidateQueryRequest extends RequestBase +public final class ValidateQueryRequest extends RequestBase implements PlainJsonSerializable, ToCopyableBuilder { @@ -122,6 +121,7 @@ public class ValidateQueryRequest extends RequestBase // --------------------------------------------------------------------------------------------- private ValidateQueryRequest(Builder builder) { + super(builder); this.allShards = builder.allShards; this.allowNoIndices = builder.allowNoIndices; this.analyzeWildcard = builder.analyzeWildcard; @@ -330,7 +330,7 @@ public static Builder builder() { /** * Builder for {@link ValidateQueryRequest}. */ - public static class Builder extends ObjectBuilderBase implements CopyableBuilder { + public static class Builder extends RequestBase.AbstractBuilder implements CopyableBuilder { @Nullable private Boolean allShards; @Nullable @@ -363,6 +363,7 @@ public static class Builder extends ObjectBuilderBase implements CopyableBuilder public Builder() {} private Builder(ValidateQueryRequest o) { + super(o); this.allShards = o.allShards; this.allowNoIndices = o.allowNoIndices; this.analyzeWildcard = o.analyzeWildcard; @@ -380,6 +381,7 @@ private Builder(ValidateQueryRequest o) { } private Builder(Builder o) { + super(o); this.allShards = o.allShards; this.allowNoIndices = o.allowNoIndices; this.analyzeWildcard = o.analyzeWildcard; @@ -402,6 +404,12 @@ public Builder copy() { return new Builder(this); } + @Override + @Nonnull + protected Builder self() { + return this; + } + /** * If true, the validation is executed on all shards instead of one random shard per index. *

@@ -655,6 +663,47 @@ protected static void setupValidateQueryRequestDeserializer(ObjectDeserializer params) { + super.applyQueryParameters(params); + if (this.allShards != null) { + params.put("all_shards", String.valueOf(this.allShards)); + } + if (this.allowNoIndices != null) { + params.put("allow_no_indices", String.valueOf(this.allowNoIndices)); + } + if (this.analyzeWildcard != null) { + params.put("analyze_wildcard", String.valueOf(this.analyzeWildcard)); + } + if (this.analyzer != null) { + params.put("analyzer", this.analyzer); + } + if (this.defaultOperator != null) { + params.put("default_operator", this.defaultOperator.jsonValue()); + } + if (this.df != null) { + params.put("df", this.df); + } + if (ApiTypeHelper.isDefined(this.expandWildcards)) { + params.put("expand_wildcards", this.expandWildcards.stream().map(v -> v.jsonValue()).collect(Collectors.joining(","))); + } + if (this.explain != null) { + params.put("explain", String.valueOf(this.explain)); + } + if (this.ignoreUnavailable != null) { + params.put("ignore_unavailable", String.valueOf(this.ignoreUnavailable)); + } + if (this.lenient != null) { + params.put("lenient", String.valueOf(this.lenient)); + } + if (this.q != null) { + params.put("q", this.q); + } + if (this.rewrite != null) { + params.put("rewrite", String.valueOf(this.rewrite)); + } + } + /** * Endpoint "{@code indices.validate_query}". */ @@ -685,42 +734,7 @@ protected static void setupValidateQueryRequestDeserializer(ObjectDeserializer { Map params = new HashMap<>(); - if (request.allShards != null) { - params.put("all_shards", String.valueOf(request.allShards)); - } - if (request.allowNoIndices != null) { - params.put("allow_no_indices", String.valueOf(request.allowNoIndices)); - } - if (request.analyzeWildcard != null) { - params.put("analyze_wildcard", String.valueOf(request.analyzeWildcard)); - } - if (request.analyzer != null) { - params.put("analyzer", request.analyzer); - } - if (request.defaultOperator != null) { - params.put("default_operator", request.defaultOperator.jsonValue()); - } - if (request.df != null) { - params.put("df", request.df); - } - if (ApiTypeHelper.isDefined(request.expandWildcards)) { - params.put("expand_wildcards", request.expandWildcards.stream().map(v -> v.jsonValue()).collect(Collectors.joining(","))); - } - if (request.explain != null) { - params.put("explain", String.valueOf(request.explain)); - } - if (request.ignoreUnavailable != null) { - params.put("ignore_unavailable", String.valueOf(request.ignoreUnavailable)); - } - if (request.lenient != null) { - params.put("lenient", String.valueOf(request.lenient)); - } - if (request.q != null) { - params.put("q", request.q); - } - if (request.rewrite != null) { - params.put("rewrite", String.valueOf(request.rewrite)); - } + request.applyQueryParameters(params); return params; }, SimpleEndpoint.emptyMap(), diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/ingest/DeletePipelineRequest.java b/java-client/src/generated/java/org/opensearch/client/opensearch/ingest/DeletePipelineRequest.java index fa066234b2..cba2d96bf9 100644 --- a/java-client/src/generated/java/org/opensearch/client/opensearch/ingest/DeletePipelineRequest.java +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/ingest/DeletePipelineRequest.java @@ -51,7 +51,6 @@ 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: ingest.delete_pipeline.Request @@ -60,7 +59,9 @@ * Deletes a pipeline. */ @Generated("org.opensearch.client.codegen.CodeGenerator") -public class DeletePipelineRequest extends RequestBase implements ToCopyableBuilder { +public final class DeletePipelineRequest extends RequestBase + implements + ToCopyableBuilder { @Nullable private final Time clusterManagerTimeout; @@ -78,6 +79,7 @@ public class DeletePipelineRequest extends RequestBase implements ToCopyableBuil // --------------------------------------------------------------------------------------------- private DeletePipelineRequest(Builder builder) { + super(builder); this.clusterManagerTimeout = builder.clusterManagerTimeout; this.id = ApiTypeHelper.requireNonNull(builder.id, this, "id"); this.masterTimeout = builder.masterTimeout; @@ -151,7 +153,7 @@ public static Builder builder() { /** * Builder for {@link DeletePipelineRequest}. */ - public static class Builder extends ObjectBuilderBase implements CopyableBuilder { + public static class Builder extends RequestBase.AbstractBuilder implements CopyableBuilder { @Nullable private Time clusterManagerTimeout; private String id; @@ -163,6 +165,7 @@ public static class Builder extends ObjectBuilderBase implements CopyableBuilder public Builder() {} private Builder(DeletePipelineRequest o) { + super(o); this.clusterManagerTimeout = o.clusterManagerTimeout; this.id = o.id; this.masterTimeout = o.masterTimeout; @@ -170,6 +173,7 @@ private Builder(DeletePipelineRequest o) { } private Builder(Builder o) { + super(o); this.clusterManagerTimeout = o.clusterManagerTimeout; this.id = o.id; this.masterTimeout = o.masterTimeout; @@ -182,6 +186,12 @@ public Builder copy() { return new Builder(this); } + @Override + @Nonnull + protected Builder self() { + return this; + } + /** * Operation timeout for connection to cluster-manager node. *

@@ -284,6 +294,20 @@ public DeletePipelineRequest build() { // --------------------------------------------------------------------------------------------- + @Override + protected void applyQueryParameters(@Nonnull Map params) { + super.applyQueryParameters(params); + if (this.clusterManagerTimeout != null) { + params.put("cluster_manager_timeout", this.clusterManagerTimeout._toJsonString()); + } + if (this.masterTimeout != null) { + params.put("master_timeout", this.masterTimeout._toJsonString()); + } + if (this.timeout != null) { + params.put("timeout", this.timeout._toJsonString()); + } + } + /** * Endpoint "{@code ingest.delete_pipeline}". */ @@ -300,15 +324,7 @@ public DeletePipelineRequest build() { // Request parameters request -> { Map params = new HashMap<>(); - 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()); - } + request.applyQueryParameters(params); return params; }, SimpleEndpoint.emptyMap(), diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/ingest/GetPipelineRequest.java b/java-client/src/generated/java/org/opensearch/client/opensearch/ingest/GetPipelineRequest.java index c7b8fe5aa7..1344d5582f 100644 --- a/java-client/src/generated/java/org/opensearch/client/opensearch/ingest/GetPipelineRequest.java +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/ingest/GetPipelineRequest.java @@ -50,7 +50,6 @@ 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: ingest.get_pipeline.Request @@ -59,7 +58,7 @@ * Returns a pipeline. */ @Generated("org.opensearch.client.codegen.CodeGenerator") -public class GetPipelineRequest extends RequestBase implements ToCopyableBuilder { +public final class GetPipelineRequest extends RequestBase implements ToCopyableBuilder { @Nullable private final Time clusterManagerTimeout; @@ -74,6 +73,7 @@ public class GetPipelineRequest extends RequestBase implements ToCopyableBuilder // --------------------------------------------------------------------------------------------- private GetPipelineRequest(Builder builder) { + super(builder); this.clusterManagerTimeout = builder.clusterManagerTimeout; this.id = builder.id; this.masterTimeout = builder.masterTimeout; @@ -135,7 +135,7 @@ public static Builder builder() { /** * Builder for {@link GetPipelineRequest}. */ - public static class Builder extends ObjectBuilderBase implements CopyableBuilder { + public static class Builder extends RequestBase.AbstractBuilder implements CopyableBuilder { @Nullable private Time clusterManagerTimeout; @Nullable @@ -146,12 +146,14 @@ public static class Builder extends ObjectBuilderBase implements CopyableBuilder public Builder() {} private Builder(GetPipelineRequest o) { + super(o); this.clusterManagerTimeout = o.clusterManagerTimeout; this.id = o.id; this.masterTimeout = o.masterTimeout; } private Builder(Builder o) { + super(o); this.clusterManagerTimeout = o.clusterManagerTimeout; this.id = o.id; this.masterTimeout = o.masterTimeout; @@ -163,6 +165,12 @@ public Builder copy() { return new Builder(this); } + @Override + @Nonnull + protected Builder self() { + return this; + } + /** * Operation timeout for connection to cluster-manager node. *

@@ -242,6 +250,17 @@ public GetPipelineRequest build() { // --------------------------------------------------------------------------------------------- + @Override + protected void applyQueryParameters(@Nonnull Map params) { + super.applyQueryParameters(params); + if (this.clusterManagerTimeout != null) { + params.put("cluster_manager_timeout", this.clusterManagerTimeout._toJsonString()); + } + if (this.masterTimeout != null) { + params.put("master_timeout", this.masterTimeout._toJsonString()); + } + } + /** * Endpoint "{@code ingest.get_pipeline}". */ @@ -271,12 +290,7 @@ public GetPipelineRequest build() { // Request parameters request -> { Map params = new HashMap<>(); - if (request.clusterManagerTimeout != null) { - params.put("cluster_manager_timeout", request.clusterManagerTimeout._toJsonString()); - } - if (request.masterTimeout != null) { - params.put("master_timeout", request.masterTimeout._toJsonString()); - } + request.applyQueryParameters(params); return params; }, SimpleEndpoint.emptyMap(), diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/ingest/ProcessorGrokRequest.java b/java-client/src/generated/java/org/opensearch/client/opensearch/ingest/ProcessorGrokRequest.java index e9ec4957ff..603e2605b2 100644 --- a/java-client/src/generated/java/org/opensearch/client/opensearch/ingest/ProcessorGrokRequest.java +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/ingest/ProcessorGrokRequest.java @@ -49,7 +49,6 @@ 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: ingest.processor_grok.Request @@ -58,7 +57,9 @@ * Returns a list of the built-in patterns. */ @Generated("org.opensearch.client.codegen.CodeGenerator") -public class ProcessorGrokRequest extends RequestBase implements ToCopyableBuilder { +public final class ProcessorGrokRequest extends RequestBase + implements + ToCopyableBuilder { @Nullable private final Boolean s; @@ -66,6 +67,7 @@ public class ProcessorGrokRequest extends RequestBase implements ToCopyableBuild // --------------------------------------------------------------------------------------------- private ProcessorGrokRequest(Builder builder) { + super(builder); this.s = builder.s; } @@ -100,17 +102,19 @@ public static Builder builder() { /** * Builder for {@link ProcessorGrokRequest}. */ - public static class Builder extends ObjectBuilderBase implements CopyableBuilder { + public static class Builder extends RequestBase.AbstractBuilder implements CopyableBuilder { @Nullable private Boolean s; public Builder() {} private Builder(ProcessorGrokRequest o) { + super(o); this.s = o.s; } private Builder(Builder o) { + super(o); this.s = o.s; } @@ -120,6 +124,12 @@ public Builder copy() { return new Builder(this); } + @Override + @Nonnull + protected Builder self() { + return this; + } + /** * Sort returned patterns by key name. *

@@ -148,6 +158,14 @@ public ProcessorGrokRequest build() { // --------------------------------------------------------------------------------------------- + @Override + protected void applyQueryParameters(@Nonnull Map params) { + super.applyQueryParameters(params); + if (this.s != null) { + params.put("s", String.valueOf(this.s)); + } + } + /** * Endpoint "{@code ingest.processor_grok}". */ @@ -159,9 +177,7 @@ public ProcessorGrokRequest build() { // Request parameters request -> { Map params = new HashMap<>(); - if (request.s != null) { - params.put("s", String.valueOf(request.s)); - } + request.applyQueryParameters(params); return params; }, SimpleEndpoint.emptyMap(), diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/ingest/PutPipelineRequest.java b/java-client/src/generated/java/org/opensearch/client/opensearch/ingest/PutPipelineRequest.java index 031e8352d4..8a74d5b979 100644 --- a/java-client/src/generated/java/org/opensearch/client/opensearch/ingest/PutPipelineRequest.java +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/ingest/PutPipelineRequest.java @@ -60,7 +60,6 @@ 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: ingest.put_pipeline.Request @@ -70,7 +69,7 @@ */ @JsonpDeserializable @Generated("org.opensearch.client.codegen.CodeGenerator") -public class PutPipelineRequest extends RequestBase +public final class PutPipelineRequest extends RequestBase implements PlainJsonSerializable, ToCopyableBuilder { @@ -106,6 +105,7 @@ public class PutPipelineRequest extends RequestBase // --------------------------------------------------------------------------------------------- private PutPipelineRequest(Builder builder) { + super(builder); this.clusterManagerTimeout = builder.clusterManagerTimeout; this.description = builder.description; this.id = ApiTypeHelper.requireNonNull(builder.id, this, "id"); @@ -284,7 +284,7 @@ public static Builder builder() { /** * Builder for {@link PutPipelineRequest}. */ - public static class Builder extends ObjectBuilderBase implements CopyableBuilder { + public static class Builder extends RequestBase.AbstractBuilder implements CopyableBuilder { @Nullable private Time clusterManagerTimeout; @Nullable @@ -306,6 +306,7 @@ public static class Builder extends ObjectBuilderBase implements CopyableBuilder public Builder() {} private Builder(PutPipelineRequest o) { + super(o); this.clusterManagerTimeout = o.clusterManagerTimeout; this.description = o.description; this.id = o.id; @@ -318,6 +319,7 @@ private Builder(PutPipelineRequest o) { } private Builder(Builder o) { + super(o); this.clusterManagerTimeout = o.clusterManagerTimeout; this.description = o.description; this.id = o.id; @@ -335,6 +337,12 @@ public Builder copy() { return new Builder(this); } + @Override + @Nonnull + protected Builder self() { + return this; + } + /** * Operation timeout for connection to cluster-manager node. *

@@ -604,6 +612,20 @@ protected static void setupPutPipelineRequestDeserializer(ObjectDeserializer params) { + super.applyQueryParameters(params); + if (this.clusterManagerTimeout != null) { + params.put("cluster_manager_timeout", this.clusterManagerTimeout._toJsonString()); + } + if (this.masterTimeout != null) { + params.put("master_timeout", this.masterTimeout._toJsonString()); + } + if (this.timeout != null) { + params.put("timeout", this.timeout._toJsonString()); + } + } + /** * Endpoint "{@code ingest.put_pipeline}". */ @@ -620,15 +642,7 @@ protected static void setupPutPipelineRequestDeserializer(ObjectDeserializer { Map params = new HashMap<>(); - 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()); - } + request.applyQueryParameters(params); return params; }, SimpleEndpoint.emptyMap(), diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/ingest/SimulateRequest.java b/java-client/src/generated/java/org/opensearch/client/opensearch/ingest/SimulateRequest.java index 9933a84243..cb246e11c3 100644 --- a/java-client/src/generated/java/org/opensearch/client/opensearch/ingest/SimulateRequest.java +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/ingest/SimulateRequest.java @@ -59,7 +59,6 @@ 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: ingest.simulate.Request @@ -69,7 +68,7 @@ */ @JsonpDeserializable @Generated("org.opensearch.client.codegen.CodeGenerator") -public class SimulateRequest extends RequestBase +public final class SimulateRequest extends RequestBase implements PlainJsonSerializable, ToCopyableBuilder { @@ -89,6 +88,7 @@ public class SimulateRequest extends RequestBase // --------------------------------------------------------------------------------------------- private SimulateRequest(Builder builder) { + super(builder); this.docs = ApiTypeHelper.unmodifiable(builder.docs); this.id = builder.id; this.pipeline = builder.pipeline; @@ -181,7 +181,7 @@ public static Builder builder() { /** * Builder for {@link SimulateRequest}. */ - public static class Builder extends ObjectBuilderBase implements CopyableBuilder { + public static class Builder extends RequestBase.AbstractBuilder implements CopyableBuilder { @Nullable private List docs; @Nullable @@ -194,6 +194,7 @@ public static class Builder extends ObjectBuilderBase implements CopyableBuilder public Builder() {} private Builder(SimulateRequest o) { + super(o); this.docs = _listCopy(o.docs); this.id = o.id; this.pipeline = o.pipeline; @@ -201,6 +202,7 @@ private Builder(SimulateRequest o) { } private Builder(Builder o) { + super(o); this.docs = _listCopy(o.docs); this.id = o.id; this.pipeline = o.pipeline; @@ -213,6 +215,12 @@ public Builder copy() { return new Builder(this); } + @Override + @Nonnull + protected Builder self() { + return this; + } + /** * Sample documents to test in the pipeline. *

@@ -332,6 +340,14 @@ protected static void setupSimulateRequestDeserializer(ObjectDeserializer params) { + super.applyQueryParameters(params); + if (this.verbose != null) { + params.put("verbose", String.valueOf(this.verbose)); + } + } + /** * Endpoint "{@code ingest.simulate}". */ @@ -362,9 +378,7 @@ protected static void setupSimulateRequestDeserializer(ObjectDeserializer { Map params = new HashMap<>(); - if (request.verbose != null) { - params.put("verbose", String.valueOf(request.verbose)); - } + request.applyQueryParameters(params); return params; }, SimpleEndpoint.emptyMap(), diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/ml/CreateConnectorRequest.java b/java-client/src/generated/java/org/opensearch/client/opensearch/ml/CreateConnectorRequest.java index 9bdb0d4801..0b870f4ae6 100644 --- a/java-client/src/generated/java/org/opensearch/client/opensearch/ml/CreateConnectorRequest.java +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/ml/CreateConnectorRequest.java @@ -13,6 +13,7 @@ package org.opensearch.client.opensearch.ml; import jakarta.json.stream.JsonGenerator; +import java.util.HashMap; import java.util.List; import java.util.Map; import java.util.Objects; @@ -34,7 +35,6 @@ 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: ml.create_connector.Request @@ -44,7 +44,7 @@ */ @JsonpDeserializable @Generated("org.opensearch.client.codegen.CodeGenerator") -public class CreateConnectorRequest extends RequestBase +public final class CreateConnectorRequest extends RequestBase implements PlainJsonSerializable, ToCopyableBuilder { @@ -75,6 +75,7 @@ public class CreateConnectorRequest extends RequestBase // --------------------------------------------------------------------------------------------- private CreateConnectorRequest(Builder builder) { + super(builder); this.actions = ApiTypeHelper.unmodifiableRequired(builder.actions, this, "actions"); this.clientConfig = builder.clientConfig; this.credential = ApiTypeHelper.requireNonNull(builder.credential, this, "credential"); @@ -214,7 +215,7 @@ public static Builder builder() { /** * Builder for {@link CreateConnectorRequest}. */ - public static class Builder extends ObjectBuilderBase implements CopyableBuilder { + public static class Builder extends RequestBase.AbstractBuilder implements CopyableBuilder { private List actions; @Nullable private ClientConfig clientConfig; @@ -228,6 +229,7 @@ public static class Builder extends ObjectBuilderBase implements CopyableBuilder public Builder() {} private Builder(CreateConnectorRequest o) { + super(o); this.actions = _listCopy(o.actions); this.clientConfig = o.clientConfig; this.credential = o.credential; @@ -239,6 +241,7 @@ private Builder(CreateConnectorRequest o) { } private Builder(Builder o) { + super(o); this.actions = _listCopy(o.actions); this.clientConfig = o.clientConfig; this.credential = o.credential; @@ -255,6 +258,12 @@ public Builder copy() { return new Builder(this); } + @Override + @Nonnull + protected Builder self() { + return this; + } + /** * Required - API name: {@code actions} * @@ -435,7 +444,11 @@ protected static void setupCreateConnectorRequestDeserializer(ObjectDeserializer // Request path request -> "/_plugins/_ml/connectors/_create", // Request parameters - SimpleEndpoint.emptyMap(), + request -> { + Map params = new HashMap<>(); + request.applyQueryParameters(params); + return params; + }, SimpleEndpoint.emptyMap(), true, CreateConnectorResponse._DESERIALIZER diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/ml/DeleteAgentRequest.java b/java-client/src/generated/java/org/opensearch/client/opensearch/ml/DeleteAgentRequest.java index f2a3437e27..63b03089d8 100644 --- a/java-client/src/generated/java/org/opensearch/client/opensearch/ml/DeleteAgentRequest.java +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/ml/DeleteAgentRequest.java @@ -12,6 +12,8 @@ package org.opensearch.client.opensearch.ml; +import java.util.HashMap; +import java.util.Map; import java.util.function.Function; import javax.annotation.Generated; import javax.annotation.Nonnull; @@ -22,7 +24,6 @@ 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: ml.delete_agent.Request @@ -31,7 +32,7 @@ * Delete an agent. */ @Generated("org.opensearch.client.codegen.CodeGenerator") -public class DeleteAgentRequest extends RequestBase implements ToCopyableBuilder { +public final class DeleteAgentRequest extends RequestBase implements ToCopyableBuilder { @Nonnull private final String agentId; @@ -39,6 +40,7 @@ public class DeleteAgentRequest extends RequestBase implements ToCopyableBuilder // --------------------------------------------------------------------------------------------- private DeleteAgentRequest(Builder builder) { + super(builder); this.agentId = ApiTypeHelper.requireNonNull(builder.agentId, this, "agentId"); } @@ -70,16 +72,18 @@ public static Builder builder() { /** * Builder for {@link DeleteAgentRequest}. */ - public static class Builder extends ObjectBuilderBase implements CopyableBuilder { + public static class Builder extends RequestBase.AbstractBuilder implements CopyableBuilder { private String agentId; public Builder() {} private Builder(DeleteAgentRequest o) { + super(o); this.agentId = o.agentId; } private Builder(Builder o) { + super(o); this.agentId = o.agentId; } @@ -89,6 +93,12 @@ public Builder copy() { return new Builder(this); } + @Override + @Nonnull + protected Builder self() { + return this; + } + /** * Required - API name: {@code agent_id} */ @@ -128,7 +138,11 @@ public DeleteAgentRequest build() { return buf.toString(); }, // Request parameters - SimpleEndpoint.emptyMap(), + request -> { + Map params = new HashMap<>(); + request.applyQueryParameters(params); + return params; + }, SimpleEndpoint.emptyMap(), false, DeleteAgentResponse._DESERIALIZER diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/ml/DeleteConnectorRequest.java b/java-client/src/generated/java/org/opensearch/client/opensearch/ml/DeleteConnectorRequest.java index 2c47cdabb7..52fb11766e 100644 --- a/java-client/src/generated/java/org/opensearch/client/opensearch/ml/DeleteConnectorRequest.java +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/ml/DeleteConnectorRequest.java @@ -12,6 +12,8 @@ package org.opensearch.client.opensearch.ml; +import java.util.HashMap; +import java.util.Map; import java.util.function.Function; import javax.annotation.Generated; import javax.annotation.Nonnull; @@ -22,7 +24,6 @@ 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: ml.delete_connector.Request @@ -31,7 +32,7 @@ * Deletes a standalone connector. */ @Generated("org.opensearch.client.codegen.CodeGenerator") -public class DeleteConnectorRequest extends RequestBase +public final class DeleteConnectorRequest extends RequestBase implements ToCopyableBuilder { @@ -41,6 +42,7 @@ public class DeleteConnectorRequest extends RequestBase // --------------------------------------------------------------------------------------------- private DeleteConnectorRequest(Builder builder) { + super(builder); this.connectorId = ApiTypeHelper.requireNonNull(builder.connectorId, this, "connectorId"); } @@ -72,16 +74,18 @@ public static Builder builder() { /** * Builder for {@link DeleteConnectorRequest}. */ - public static class Builder extends ObjectBuilderBase implements CopyableBuilder { + public static class Builder extends RequestBase.AbstractBuilder implements CopyableBuilder { private String connectorId; public Builder() {} private Builder(DeleteConnectorRequest o) { + super(o); this.connectorId = o.connectorId; } private Builder(Builder o) { + super(o); this.connectorId = o.connectorId; } @@ -91,6 +95,12 @@ public Builder copy() { return new Builder(this); } + @Override + @Nonnull + protected Builder self() { + return this; + } + /** * Required - API name: {@code connector_id} */ @@ -130,7 +140,11 @@ public DeleteConnectorRequest build() { return buf.toString(); }, // Request parameters - SimpleEndpoint.emptyMap(), + request -> { + Map params = new HashMap<>(); + request.applyQueryParameters(params); + return params; + }, SimpleEndpoint.emptyMap(), false, DeleteConnectorResponse._DESERIALIZER diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/ml/DeleteModelGroupRequest.java b/java-client/src/generated/java/org/opensearch/client/opensearch/ml/DeleteModelGroupRequest.java index 4c0388273a..1c99d5fc95 100644 --- a/java-client/src/generated/java/org/opensearch/client/opensearch/ml/DeleteModelGroupRequest.java +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/ml/DeleteModelGroupRequest.java @@ -12,6 +12,8 @@ package org.opensearch.client.opensearch.ml; +import java.util.HashMap; +import java.util.Map; import java.util.function.Function; import javax.annotation.Generated; import javax.annotation.Nonnull; @@ -22,7 +24,6 @@ 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: ml.delete_model_group.Request @@ -31,7 +32,7 @@ * Deletes a model group. */ @Generated("org.opensearch.client.codegen.CodeGenerator") -public class DeleteModelGroupRequest extends RequestBase +public final class DeleteModelGroupRequest extends RequestBase implements ToCopyableBuilder { @@ -41,6 +42,7 @@ public class DeleteModelGroupRequest extends RequestBase // --------------------------------------------------------------------------------------------- private DeleteModelGroupRequest(Builder builder) { + super(builder); this.modelGroupId = ApiTypeHelper.requireNonNull(builder.modelGroupId, this, "modelGroupId"); } @@ -72,16 +74,18 @@ public static Builder builder() { /** * Builder for {@link DeleteModelGroupRequest}. */ - public static class Builder extends ObjectBuilderBase implements CopyableBuilder { + public static class Builder extends RequestBase.AbstractBuilder implements CopyableBuilder { private String modelGroupId; public Builder() {} private Builder(DeleteModelGroupRequest o) { + super(o); this.modelGroupId = o.modelGroupId; } private Builder(Builder o) { + super(o); this.modelGroupId = o.modelGroupId; } @@ -91,6 +95,12 @@ public Builder copy() { return new Builder(this); } + @Override + @Nonnull + protected Builder self() { + return this; + } + /** * Required - API name: {@code model_group_id} */ @@ -130,7 +140,11 @@ public DeleteModelGroupRequest build() { return buf.toString(); }, // Request parameters - SimpleEndpoint.emptyMap(), + request -> { + Map params = new HashMap<>(); + request.applyQueryParameters(params); + return params; + }, SimpleEndpoint.emptyMap(), false, DeleteModelGroupResponse._DESERIALIZER diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/ml/DeleteModelRequest.java b/java-client/src/generated/java/org/opensearch/client/opensearch/ml/DeleteModelRequest.java index afe161a6af..8c2ee16106 100644 --- a/java-client/src/generated/java/org/opensearch/client/opensearch/ml/DeleteModelRequest.java +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/ml/DeleteModelRequest.java @@ -12,6 +12,8 @@ package org.opensearch.client.opensearch.ml; +import java.util.HashMap; +import java.util.Map; import java.util.function.Function; import javax.annotation.Generated; import javax.annotation.Nonnull; @@ -22,7 +24,6 @@ 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: ml.delete_model.Request @@ -31,7 +32,7 @@ * Deletes a model. */ @Generated("org.opensearch.client.codegen.CodeGenerator") -public class DeleteModelRequest extends RequestBase implements ToCopyableBuilder { +public final class DeleteModelRequest extends RequestBase implements ToCopyableBuilder { @Nonnull private final String modelId; @@ -39,6 +40,7 @@ public class DeleteModelRequest extends RequestBase implements ToCopyableBuilder // --------------------------------------------------------------------------------------------- private DeleteModelRequest(Builder builder) { + super(builder); this.modelId = ApiTypeHelper.requireNonNull(builder.modelId, this, "modelId"); } @@ -70,16 +72,18 @@ public static Builder builder() { /** * Builder for {@link DeleteModelRequest}. */ - public static class Builder extends ObjectBuilderBase implements CopyableBuilder { + public static class Builder extends RequestBase.AbstractBuilder implements CopyableBuilder { private String modelId; public Builder() {} private Builder(DeleteModelRequest o) { + super(o); this.modelId = o.modelId; } private Builder(Builder o) { + super(o); this.modelId = o.modelId; } @@ -89,6 +93,12 @@ public Builder copy() { return new Builder(this); } + @Override + @Nonnull + protected Builder self() { + return this; + } + /** * Required - API name: {@code model_id} */ @@ -128,7 +138,11 @@ public DeleteModelRequest build() { return buf.toString(); }, // Request parameters - SimpleEndpoint.emptyMap(), + request -> { + Map params = new HashMap<>(); + request.applyQueryParameters(params); + return params; + }, SimpleEndpoint.emptyMap(), false, DeleteModelResponse._DESERIALIZER diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/ml/DeleteTaskRequest.java b/java-client/src/generated/java/org/opensearch/client/opensearch/ml/DeleteTaskRequest.java index 2d2f956fb7..769bf46340 100644 --- a/java-client/src/generated/java/org/opensearch/client/opensearch/ml/DeleteTaskRequest.java +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/ml/DeleteTaskRequest.java @@ -12,6 +12,8 @@ package org.opensearch.client.opensearch.ml; +import java.util.HashMap; +import java.util.Map; import java.util.function.Function; import javax.annotation.Generated; import javax.annotation.Nonnull; @@ -22,7 +24,6 @@ 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: ml.delete_task.Request @@ -31,7 +32,7 @@ * Deletes a task. */ @Generated("org.opensearch.client.codegen.CodeGenerator") -public class DeleteTaskRequest extends RequestBase implements ToCopyableBuilder { +public final class DeleteTaskRequest extends RequestBase implements ToCopyableBuilder { @Nonnull private final String taskId; @@ -39,6 +40,7 @@ public class DeleteTaskRequest extends RequestBase implements ToCopyableBuilder< // --------------------------------------------------------------------------------------------- private DeleteTaskRequest(Builder builder) { + super(builder); this.taskId = ApiTypeHelper.requireNonNull(builder.taskId, this, "taskId"); } @@ -70,16 +72,18 @@ public static Builder builder() { /** * Builder for {@link DeleteTaskRequest}. */ - public static class Builder extends ObjectBuilderBase implements CopyableBuilder { + public static class Builder extends RequestBase.AbstractBuilder implements CopyableBuilder { private String taskId; public Builder() {} private Builder(DeleteTaskRequest o) { + super(o); this.taskId = o.taskId; } private Builder(Builder o) { + super(o); this.taskId = o.taskId; } @@ -89,6 +93,12 @@ public Builder copy() { return new Builder(this); } + @Override + @Nonnull + protected Builder self() { + return this; + } + /** * Required - API name: {@code task_id} */ @@ -128,7 +138,11 @@ public DeleteTaskRequest build() { return buf.toString(); }, // Request parameters - SimpleEndpoint.emptyMap(), + request -> { + Map params = new HashMap<>(); + request.applyQueryParameters(params); + return params; + }, SimpleEndpoint.emptyMap(), false, DeleteTaskResponse._DESERIALIZER diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/ml/DeployModelRequest.java b/java-client/src/generated/java/org/opensearch/client/opensearch/ml/DeployModelRequest.java index f8b0f487ef..88c03f764b 100644 --- a/java-client/src/generated/java/org/opensearch/client/opensearch/ml/DeployModelRequest.java +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/ml/DeployModelRequest.java @@ -12,6 +12,8 @@ package org.opensearch.client.opensearch.ml; +import java.util.HashMap; +import java.util.Map; import java.util.function.Function; import javax.annotation.Generated; import javax.annotation.Nonnull; @@ -22,7 +24,6 @@ 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: ml.deploy_model.Request @@ -31,7 +32,7 @@ * Deploys a model. */ @Generated("org.opensearch.client.codegen.CodeGenerator") -public class DeployModelRequest extends RequestBase implements ToCopyableBuilder { +public final class DeployModelRequest extends RequestBase implements ToCopyableBuilder { @Nonnull private final String modelId; @@ -39,6 +40,7 @@ public class DeployModelRequest extends RequestBase implements ToCopyableBuilder // --------------------------------------------------------------------------------------------- private DeployModelRequest(Builder builder) { + super(builder); this.modelId = ApiTypeHelper.requireNonNull(builder.modelId, this, "modelId"); } @@ -70,16 +72,18 @@ public static Builder builder() { /** * Builder for {@link DeployModelRequest}. */ - public static class Builder extends ObjectBuilderBase implements CopyableBuilder { + public static class Builder extends RequestBase.AbstractBuilder implements CopyableBuilder { private String modelId; public Builder() {} private Builder(DeployModelRequest o) { + super(o); this.modelId = o.modelId; } private Builder(Builder o) { + super(o); this.modelId = o.modelId; } @@ -89,6 +93,12 @@ public Builder copy() { return new Builder(this); } + @Override + @Nonnull + protected Builder self() { + return this; + } + /** * Required - API name: {@code model_id} */ @@ -129,7 +139,11 @@ public DeployModelRequest build() { return buf.toString(); }, // Request parameters - SimpleEndpoint.emptyMap(), + request -> { + Map params = new HashMap<>(); + request.applyQueryParameters(params); + return params; + }, SimpleEndpoint.emptyMap(), false, DeployModelResponse._DESERIALIZER diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/ml/GetModelGroupRequest.java b/java-client/src/generated/java/org/opensearch/client/opensearch/ml/GetModelGroupRequest.java index f593849918..7eb7b58065 100644 --- a/java-client/src/generated/java/org/opensearch/client/opensearch/ml/GetModelGroupRequest.java +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/ml/GetModelGroupRequest.java @@ -12,6 +12,8 @@ package org.opensearch.client.opensearch.ml; +import java.util.HashMap; +import java.util.Map; import java.util.function.Function; import javax.annotation.Generated; import javax.annotation.Nonnull; @@ -22,7 +24,6 @@ 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: ml.get_model_group.Request @@ -31,7 +32,9 @@ * Retrieves a model group. */ @Generated("org.opensearch.client.codegen.CodeGenerator") -public class GetModelGroupRequest extends RequestBase implements ToCopyableBuilder { +public final class GetModelGroupRequest extends RequestBase + implements + ToCopyableBuilder { @Nonnull private final String modelGroupId; @@ -39,6 +42,7 @@ public class GetModelGroupRequest extends RequestBase implements ToCopyableBuild // --------------------------------------------------------------------------------------------- private GetModelGroupRequest(Builder builder) { + super(builder); this.modelGroupId = ApiTypeHelper.requireNonNull(builder.modelGroupId, this, "modelGroupId"); } @@ -70,16 +74,18 @@ public static Builder builder() { /** * Builder for {@link GetModelGroupRequest}. */ - public static class Builder extends ObjectBuilderBase implements CopyableBuilder { + public static class Builder extends RequestBase.AbstractBuilder implements CopyableBuilder { private String modelGroupId; public Builder() {} private Builder(GetModelGroupRequest o) { + super(o); this.modelGroupId = o.modelGroupId; } private Builder(Builder o) { + super(o); this.modelGroupId = o.modelGroupId; } @@ -89,6 +95,12 @@ public Builder copy() { return new Builder(this); } + @Override + @Nonnull + protected Builder self() { + return this; + } + /** * Required - API name: {@code model_group_id} */ @@ -128,7 +140,11 @@ public GetModelGroupRequest build() { return buf.toString(); }, // Request parameters - SimpleEndpoint.emptyMap(), + request -> { + Map params = new HashMap<>(); + request.applyQueryParameters(params); + return params; + }, SimpleEndpoint.emptyMap(), false, GetModelGroupResponse._DESERIALIZER diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/ml/GetTaskRequest.java b/java-client/src/generated/java/org/opensearch/client/opensearch/ml/GetTaskRequest.java index 4803211923..ed1e9e95f3 100644 --- a/java-client/src/generated/java/org/opensearch/client/opensearch/ml/GetTaskRequest.java +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/ml/GetTaskRequest.java @@ -12,6 +12,8 @@ package org.opensearch.client.opensearch.ml; +import java.util.HashMap; +import java.util.Map; import java.util.function.Function; import javax.annotation.Generated; import javax.annotation.Nonnull; @@ -22,7 +24,6 @@ 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: ml.get_task.Request @@ -31,7 +32,7 @@ * Retrieves a task. */ @Generated("org.opensearch.client.codegen.CodeGenerator") -public class GetTaskRequest extends RequestBase implements ToCopyableBuilder { +public final class GetTaskRequest extends RequestBase implements ToCopyableBuilder { @Nonnull private final String taskId; @@ -39,6 +40,7 @@ public class GetTaskRequest extends RequestBase implements ToCopyableBuilder { + public static class Builder extends RequestBase.AbstractBuilder implements CopyableBuilder { private String taskId; public Builder() {} private Builder(GetTaskRequest o) { + super(o); this.taskId = o.taskId; } private Builder(Builder o) { + super(o); this.taskId = o.taskId; } @@ -89,6 +93,12 @@ public Builder copy() { return new Builder(this); } + @Override + @Nonnull + protected Builder self() { + return this; + } + /** * Required - API name: {@code task_id} */ @@ -128,7 +138,11 @@ public GetTaskRequest build() { return buf.toString(); }, // Request parameters - SimpleEndpoint.emptyMap(), + request -> { + Map params = new HashMap<>(); + request.applyQueryParameters(params); + return params; + }, SimpleEndpoint.emptyMap(), false, GetTaskResponse._DESERIALIZER diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/ml/RegisterAgentsRequest.java b/java-client/src/generated/java/org/opensearch/client/opensearch/ml/RegisterAgentsRequest.java index 4b19877fa6..3ee05277af 100644 --- a/java-client/src/generated/java/org/opensearch/client/opensearch/ml/RegisterAgentsRequest.java +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/ml/RegisterAgentsRequest.java @@ -13,6 +13,7 @@ package org.opensearch.client.opensearch.ml; import jakarta.json.stream.JsonGenerator; +import java.util.HashMap; import java.util.List; import java.util.Map; import java.util.Objects; @@ -34,7 +35,6 @@ 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: ml.register_agents.Request @@ -44,7 +44,7 @@ */ @JsonpDeserializable @Generated("org.opensearch.client.codegen.CodeGenerator") -public class RegisterAgentsRequest extends RequestBase +public final class RegisterAgentsRequest extends RequestBase implements PlainJsonSerializable, ToCopyableBuilder { @@ -76,6 +76,7 @@ public class RegisterAgentsRequest extends RequestBase // --------------------------------------------------------------------------------------------- private RegisterAgentsRequest(Builder builder) { + super(builder); this.appType = builder.appType; this.description = builder.description; this.llm = builder.llm; @@ -226,7 +227,7 @@ public static Builder builder() { /** * Builder for {@link RegisterAgentsRequest}. */ - public static class Builder extends ObjectBuilderBase implements CopyableBuilder { + public static class Builder extends RequestBase.AbstractBuilder implements CopyableBuilder { @Nullable private String appType; @Nullable @@ -245,6 +246,7 @@ public static class Builder extends ObjectBuilderBase implements CopyableBuilder public Builder() {} private Builder(RegisterAgentsRequest o) { + super(o); this.appType = o.appType; this.description = o.description; this.llm = o.llm; @@ -256,6 +258,7 @@ private Builder(RegisterAgentsRequest o) { } private Builder(Builder o) { + super(o); this.appType = o.appType; this.description = o.description; this.llm = o.llm; @@ -272,6 +275,12 @@ public Builder copy() { return new Builder(this); } + @Override + @Nonnull + protected Builder self() { + return this; + } + /** * API name: {@code app_type} */ @@ -452,7 +461,11 @@ protected static void setupRegisterAgentsRequestDeserializer(ObjectDeserializer< // Request path request -> "/_plugins/_ml/agents/_register", // Request parameters - SimpleEndpoint.emptyMap(), + request -> { + Map params = new HashMap<>(); + request.applyQueryParameters(params); + return params; + }, SimpleEndpoint.emptyMap(), true, RegisterAgentsResponse._DESERIALIZER diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/ml/RegisterModelGroupRequest.java b/java-client/src/generated/java/org/opensearch/client/opensearch/ml/RegisterModelGroupRequest.java index 72a8620dc3..d1254fb7bb 100644 --- a/java-client/src/generated/java/org/opensearch/client/opensearch/ml/RegisterModelGroupRequest.java +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/ml/RegisterModelGroupRequest.java @@ -13,7 +13,9 @@ package org.opensearch.client.opensearch.ml; import jakarta.json.stream.JsonGenerator; +import java.util.HashMap; import java.util.List; +import java.util.Map; import java.util.Objects; import java.util.function.Function; import javax.annotation.Generated; @@ -32,7 +34,6 @@ 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: ml.register_model_group.Request @@ -42,7 +43,7 @@ */ @JsonpDeserializable @Generated("org.opensearch.client.codegen.CodeGenerator") -public class RegisterModelGroupRequest extends RequestBase +public final class RegisterModelGroupRequest extends RequestBase implements PlainJsonSerializable, ToCopyableBuilder { @@ -65,6 +66,7 @@ public class RegisterModelGroupRequest extends RequestBase // --------------------------------------------------------------------------------------------- private RegisterModelGroupRequest(Builder builder) { + super(builder); this.accessMode = builder.accessMode; this.addAllBackendRoles = builder.addAllBackendRoles; this.backendRoles = ApiTypeHelper.unmodifiable(builder.backendRoles); @@ -185,7 +187,9 @@ public static Builder builder() { /** * Builder for {@link RegisterModelGroupRequest}. */ - public static class Builder extends ObjectBuilderBase implements CopyableBuilder { + public static class Builder extends RequestBase.AbstractBuilder + implements + CopyableBuilder { @Nullable private String accessMode; @Nullable @@ -199,6 +203,7 @@ public static class Builder extends ObjectBuilderBase implements CopyableBuilder public Builder() {} private Builder(RegisterModelGroupRequest o) { + super(o); this.accessMode = o.accessMode; this.addAllBackendRoles = o.addAllBackendRoles; this.backendRoles = _listCopy(o.backendRoles); @@ -207,6 +212,7 @@ private Builder(RegisterModelGroupRequest o) { } private Builder(Builder o) { + super(o); this.accessMode = o.accessMode; this.addAllBackendRoles = o.addAllBackendRoles; this.backendRoles = _listCopy(o.backendRoles); @@ -220,6 +226,12 @@ public Builder copy() { return new Builder(this); } + @Override + @Nonnull + protected Builder self() { + return this; + } + /** * The model group access mode. *

@@ -343,7 +355,11 @@ protected static void setupRegisterModelGroupRequestDeserializer(ObjectDeseriali // Request path request -> "/_plugins/_ml/model_groups/_register", // Request parameters - SimpleEndpoint.emptyMap(), + request -> { + Map params = new HashMap<>(); + request.applyQueryParameters(params); + return params; + }, SimpleEndpoint.emptyMap(), true, RegisterModelGroupResponse._DESERIALIZER diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/ml/RegisterModelRequest.java b/java-client/src/generated/java/org/opensearch/client/opensearch/ml/RegisterModelRequest.java index f04bb7275c..9892bec807 100644 --- a/java-client/src/generated/java/org/opensearch/client/opensearch/ml/RegisterModelRequest.java +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/ml/RegisterModelRequest.java @@ -13,6 +13,8 @@ package org.opensearch.client.opensearch.ml; import jakarta.json.stream.JsonGenerator; +import java.util.HashMap; +import java.util.Map; import java.util.Objects; import java.util.function.Function; import javax.annotation.Generated; @@ -31,7 +33,6 @@ 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: ml.register_model.Request @@ -41,7 +42,7 @@ */ @JsonpDeserializable @Generated("org.opensearch.client.codegen.CodeGenerator") -public class RegisterModelRequest extends RequestBase +public final class RegisterModelRequest extends RequestBase implements PlainJsonSerializable, ToCopyableBuilder { @@ -64,6 +65,7 @@ public class RegisterModelRequest extends RequestBase // --------------------------------------------------------------------------------------------- private RegisterModelRequest(Builder builder) { + super(builder); this.description = builder.description; this.modelFormat = ApiTypeHelper.requireNonNull(builder.modelFormat, this, "modelFormat"); this.modelGroupId = builder.modelGroupId; @@ -176,7 +178,7 @@ public static Builder builder() { /** * Builder for {@link RegisterModelRequest}. */ - public static class Builder extends ObjectBuilderBase implements CopyableBuilder { + public static class Builder extends RequestBase.AbstractBuilder implements CopyableBuilder { @Nullable private String description; private String modelFormat; @@ -188,6 +190,7 @@ public static class Builder extends ObjectBuilderBase implements CopyableBuilder public Builder() {} private Builder(RegisterModelRequest o) { + super(o); this.description = o.description; this.modelFormat = o.modelFormat; this.modelGroupId = o.modelGroupId; @@ -196,6 +199,7 @@ private Builder(RegisterModelRequest o) { } private Builder(Builder o) { + super(o); this.description = o.description; this.modelFormat = o.modelFormat; this.modelGroupId = o.modelGroupId; @@ -209,6 +213,12 @@ public Builder copy() { return new Builder(this); } + @Override + @Nonnull + protected Builder self() { + return this; + } + /** * The model description. *

@@ -312,7 +322,11 @@ protected static void setupRegisterModelRequestDeserializer(ObjectDeserializer "/_plugins/_ml/models/_register", // Request parameters - SimpleEndpoint.emptyMap(), + request -> { + Map params = new HashMap<>(); + request.applyQueryParameters(params); + return params; + }, SimpleEndpoint.emptyMap(), true, RegisterModelResponse._DESERIALIZER diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/ml/UndeployModelRequest.java b/java-client/src/generated/java/org/opensearch/client/opensearch/ml/UndeployModelRequest.java index f01a11023f..d941595bf7 100644 --- a/java-client/src/generated/java/org/opensearch/client/opensearch/ml/UndeployModelRequest.java +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/ml/UndeployModelRequest.java @@ -12,6 +12,8 @@ package org.opensearch.client.opensearch.ml; +import java.util.HashMap; +import java.util.Map; import java.util.function.Function; import javax.annotation.Generated; import javax.annotation.Nonnull; @@ -22,7 +24,6 @@ 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: ml.undeploy_model.Request @@ -31,7 +32,9 @@ * Undeploys a model. */ @Generated("org.opensearch.client.codegen.CodeGenerator") -public class UndeployModelRequest extends RequestBase implements ToCopyableBuilder { +public final class UndeployModelRequest extends RequestBase + implements + ToCopyableBuilder { @Nonnull private final String modelId; @@ -39,6 +42,7 @@ public class UndeployModelRequest extends RequestBase implements ToCopyableBuild // --------------------------------------------------------------------------------------------- private UndeployModelRequest(Builder builder) { + super(builder); this.modelId = ApiTypeHelper.requireNonNull(builder.modelId, this, "modelId"); } @@ -70,16 +74,18 @@ public static Builder builder() { /** * Builder for {@link UndeployModelRequest}. */ - public static class Builder extends ObjectBuilderBase implements CopyableBuilder { + public static class Builder extends RequestBase.AbstractBuilder implements CopyableBuilder { private String modelId; public Builder() {} private Builder(UndeployModelRequest o) { + super(o); this.modelId = o.modelId; } private Builder(Builder o) { + super(o); this.modelId = o.modelId; } @@ -89,6 +95,12 @@ public Builder copy() { return new Builder(this); } + @Override + @Nonnull + protected Builder self() { + return this; + } + /** * Required - API name: {@code model_id} */ @@ -129,7 +141,11 @@ public UndeployModelRequest build() { return buf.toString(); }, // Request parameters - SimpleEndpoint.emptyMap(), + request -> { + Map params = new HashMap<>(); + request.applyQueryParameters(params); + return params; + }, SimpleEndpoint.emptyMap(), false, UndeployModelResponse._DESERIALIZER diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/nodes/NodesInfoRequest.java b/java-client/src/generated/java/org/opensearch/client/opensearch/nodes/NodesInfoRequest.java index 08bdb65f79..7e8464bda8 100644 --- a/java-client/src/generated/java/org/opensearch/client/opensearch/nodes/NodesInfoRequest.java +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/nodes/NodesInfoRequest.java @@ -54,7 +54,6 @@ 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: nodes.info.Request @@ -63,7 +62,7 @@ * Returns information about nodes in the cluster. */ @Generated("org.opensearch.client.codegen.CodeGenerator") -public class NodesInfoRequest extends RequestBase implements ToCopyableBuilder { +public final class NodesInfoRequest extends RequestBase implements ToCopyableBuilder { @Nullable private final Boolean flatSettings; @@ -80,6 +79,7 @@ public class NodesInfoRequest extends RequestBase implements ToCopyableBuilder { + public static class Builder extends RequestBase.AbstractBuilder implements CopyableBuilder { @Nullable private Boolean flatSettings; @Nullable @@ -163,6 +163,7 @@ public static class Builder extends ObjectBuilderBase implements CopyableBuilder public Builder() {} private Builder(NodesInfoRequest o) { + super(o); this.flatSettings = o.flatSettings; this.metric = _listCopy(o.metric); this.nodeId = _listCopy(o.nodeId); @@ -170,6 +171,7 @@ private Builder(NodesInfoRequest o) { } private Builder(Builder o) { + super(o); this.flatSettings = o.flatSettings; this.metric = _listCopy(o.metric); this.nodeId = _listCopy(o.nodeId); @@ -182,6 +184,12 @@ public Builder copy() { return new Builder(this); } + @Override + @Nonnull + protected Builder self() { + return this; + } + /** * If true, returns settings in flat format. *

@@ -297,6 +305,17 @@ public NodesInfoRequest build() { // --------------------------------------------------------------------------------------------- + @Override + protected void applyQueryParameters(@Nonnull Map params) { + super.applyQueryParameters(params); + if (this.flatSettings != null) { + params.put("flat_settings", String.valueOf(this.flatSettings)); + } + if (this.timeout != null) { + params.put("timeout", this.timeout._toJsonString()); + } + } + /** * Endpoint "{@code nodes.info}". */ @@ -342,12 +361,7 @@ public NodesInfoRequest build() { // Request parameters request -> { Map params = new HashMap<>(); - if (request.flatSettings != null) { - params.put("flat_settings", String.valueOf(request.flatSettings)); - } - if (request.timeout != null) { - params.put("timeout", request.timeout._toJsonString()); - } + request.applyQueryParameters(params); return params; }, SimpleEndpoint.emptyMap(), diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/nodes/NodesStatsRequest.java b/java-client/src/generated/java/org/opensearch/client/opensearch/nodes/NodesStatsRequest.java index 49c6e296ce..21ac31c013 100644 --- a/java-client/src/generated/java/org/opensearch/client/opensearch/nodes/NodesStatsRequest.java +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/nodes/NodesStatsRequest.java @@ -56,7 +56,6 @@ 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: nodes.stats.Request @@ -65,7 +64,7 @@ * Returns statistical information about nodes in the cluster. */ @Generated("org.opensearch.client.codegen.CodeGenerator") -public class NodesStatsRequest extends RequestBase implements ToCopyableBuilder { +public final class NodesStatsRequest extends RequestBase implements ToCopyableBuilder { @Nonnull private final List completionFields; @@ -103,6 +102,7 @@ public class NodesStatsRequest extends RequestBase implements ToCopyableBuilder< // --------------------------------------------------------------------------------------------- private NodesStatsRequest(Builder builder) { + super(builder); this.completionFields = ApiTypeHelper.unmodifiable(builder.completionFields); this.fielddataFields = ApiTypeHelper.unmodifiable(builder.fielddataFields); this.fields = ApiTypeHelper.unmodifiable(builder.fields); @@ -259,7 +259,7 @@ public static Builder builder() { /** * Builder for {@link NodesStatsRequest}. */ - public static class Builder extends ObjectBuilderBase implements CopyableBuilder { + public static class Builder extends RequestBase.AbstractBuilder implements CopyableBuilder { @Nullable private List completionFields; @Nullable @@ -286,6 +286,7 @@ public static class Builder extends ObjectBuilderBase implements CopyableBuilder public Builder() {} private Builder(NodesStatsRequest o) { + super(o); this.completionFields = _listCopy(o.completionFields); this.fielddataFields = _listCopy(o.fielddataFields); this.fields = _listCopy(o.fields); @@ -300,6 +301,7 @@ private Builder(NodesStatsRequest o) { } private Builder(Builder o) { + super(o); this.completionFields = _listCopy(o.completionFields); this.fielddataFields = _listCopy(o.fielddataFields); this.fields = _listCopy(o.fields); @@ -319,6 +321,12 @@ public Builder copy() { return new Builder(this); } + @Override + @Nonnull + protected Builder self() { + return this; + } + /** * Comma-separated list or wildcard expressions of fields to include in field data and suggest statistics. *

@@ -641,6 +649,35 @@ public NodesStatsRequest build() { // --------------------------------------------------------------------------------------------- + @Override + protected void applyQueryParameters(@Nonnull Map params) { + super.applyQueryParameters(params); + if (ApiTypeHelper.isDefined(this.completionFields)) { + params.put("completion_fields", String.join(",", this.completionFields)); + } + if (ApiTypeHelper.isDefined(this.fielddataFields)) { + params.put("fielddata_fields", String.join(",", this.fielddataFields)); + } + if (ApiTypeHelper.isDefined(this.fields)) { + params.put("fields", String.join(",", this.fields)); + } + if (ApiTypeHelper.isDefined(this.groups)) { + params.put("groups", String.join(",", this.groups)); + } + if (this.includeSegmentFileSizes != null) { + params.put("include_segment_file_sizes", String.valueOf(this.includeSegmentFileSizes)); + } + if (this.level != null) { + params.put("level", this.level.jsonValue()); + } + if (this.timeout != null) { + params.put("timeout", this.timeout._toJsonString()); + } + if (ApiTypeHelper.isDefined(this.types)) { + params.put("types", String.join(",", this.types)); + } + } + /** * Endpoint "{@code nodes.stats}". */ @@ -707,30 +744,7 @@ public NodesStatsRequest build() { // Request parameters request -> { Map params = new HashMap<>(); - if (ApiTypeHelper.isDefined(request.completionFields)) { - params.put("completion_fields", String.join(",", request.completionFields)); - } - if (ApiTypeHelper.isDefined(request.fielddataFields)) { - params.put("fielddata_fields", String.join(",", request.fielddataFields)); - } - if (ApiTypeHelper.isDefined(request.fields)) { - params.put("fields", String.join(",", request.fields)); - } - if (ApiTypeHelper.isDefined(request.groups)) { - params.put("groups", String.join(",", request.groups)); - } - if (request.includeSegmentFileSizes != null) { - params.put("include_segment_file_sizes", String.valueOf(request.includeSegmentFileSizes)); - } - if (request.level != null) { - params.put("level", request.level.jsonValue()); - } - if (request.timeout != null) { - params.put("timeout", request.timeout._toJsonString()); - } - if (ApiTypeHelper.isDefined(request.types)) { - params.put("types", String.join(",", request.types)); - } + request.applyQueryParameters(params); return params; }, SimpleEndpoint.emptyMap(), diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/nodes/NodesUsageRequest.java b/java-client/src/generated/java/org/opensearch/client/opensearch/nodes/NodesUsageRequest.java index 1445a68e33..6cef7383db 100644 --- a/java-client/src/generated/java/org/opensearch/client/opensearch/nodes/NodesUsageRequest.java +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/nodes/NodesUsageRequest.java @@ -54,7 +54,6 @@ 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: nodes.usage.Request @@ -63,7 +62,7 @@ * Returns low-level information about REST actions usage on nodes. */ @Generated("org.opensearch.client.codegen.CodeGenerator") -public class NodesUsageRequest extends RequestBase implements ToCopyableBuilder { +public final class NodesUsageRequest extends RequestBase implements ToCopyableBuilder { @Nonnull private final List metric; @@ -77,6 +76,7 @@ public class NodesUsageRequest extends RequestBase implements ToCopyableBuilder< // --------------------------------------------------------------------------------------------- private NodesUsageRequest(Builder builder) { + super(builder); this.metric = ApiTypeHelper.unmodifiable(builder.metric); this.nodeId = ApiTypeHelper.unmodifiable(builder.nodeId); this.timeout = builder.timeout; @@ -137,7 +137,7 @@ public static Builder builder() { /** * Builder for {@link NodesUsageRequest}. */ - public static class Builder extends ObjectBuilderBase implements CopyableBuilder { + public static class Builder extends RequestBase.AbstractBuilder implements CopyableBuilder { @Nullable private List metric; @Nullable @@ -148,12 +148,14 @@ public static class Builder extends ObjectBuilderBase implements CopyableBuilder public Builder() {} private Builder(NodesUsageRequest o) { + super(o); this.metric = _listCopy(o.metric); this.nodeId = _listCopy(o.nodeId); this.timeout = o.timeout; } private Builder(Builder o) { + super(o); this.metric = _listCopy(o.metric); this.nodeId = _listCopy(o.nodeId); this.timeout = o.timeout; @@ -165,6 +167,12 @@ public Builder copy() { return new Builder(this); } + @Override + @Nonnull + protected Builder self() { + return this; + } + /** * Limits the information returned to the specific metrics. A comma-separated list of the following options: _all, * rest_actions. @@ -272,6 +280,14 @@ public NodesUsageRequest build() { // --------------------------------------------------------------------------------------------- + @Override + protected void applyQueryParameters(@Nonnull Map params) { + super.applyQueryParameters(params); + if (this.timeout != null) { + params.put("timeout", this.timeout._toJsonString()); + } + } + /** * Endpoint "{@code nodes.usage}". */ @@ -318,9 +334,7 @@ public NodesUsageRequest build() { // Request parameters request -> { Map params = new HashMap<>(); - if (request.timeout != null) { - params.put("timeout", request.timeout._toJsonString()); - } + request.applyQueryParameters(params); return params; }, SimpleEndpoint.emptyMap(), diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/nodes/ReloadSecureSettingsRequest.java b/java-client/src/generated/java/org/opensearch/client/opensearch/nodes/ReloadSecureSettingsRequest.java index 0317505fa3..895b00446d 100644 --- a/java-client/src/generated/java/org/opensearch/client/opensearch/nodes/ReloadSecureSettingsRequest.java +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/nodes/ReloadSecureSettingsRequest.java @@ -59,7 +59,6 @@ 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: nodes.reload_secure_settings.Request @@ -69,7 +68,7 @@ */ @JsonpDeserializable @Generated("org.opensearch.client.codegen.CodeGenerator") -public class ReloadSecureSettingsRequest extends RequestBase +public final class ReloadSecureSettingsRequest extends RequestBase implements PlainJsonSerializable, ToCopyableBuilder { @@ -86,6 +85,7 @@ public class ReloadSecureSettingsRequest extends RequestBase // --------------------------------------------------------------------------------------------- private ReloadSecureSettingsRequest(Builder builder) { + super(builder); this.nodeId = ApiTypeHelper.unmodifiable(builder.nodeId); this.secureSettingsPassword = builder.secureSettingsPassword; this.timeout = builder.timeout; @@ -159,7 +159,9 @@ public static Builder builder() { /** * Builder for {@link ReloadSecureSettingsRequest}. */ - public static class Builder extends ObjectBuilderBase implements CopyableBuilder { + public static class Builder extends RequestBase.AbstractBuilder + implements + CopyableBuilder { @Nullable private List nodeId; @Nullable @@ -170,12 +172,14 @@ public static class Builder extends ObjectBuilderBase implements CopyableBuilder public Builder() {} private Builder(ReloadSecureSettingsRequest o) { + super(o); this.nodeId = _listCopy(o.nodeId); this.secureSettingsPassword = o.secureSettingsPassword; this.timeout = o.timeout; } private Builder(Builder o) { + super(o); this.nodeId = _listCopy(o.nodeId); this.secureSettingsPassword = o.secureSettingsPassword; this.timeout = o.timeout; @@ -187,6 +191,12 @@ public Builder copy() { return new Builder(this); } + @Override + @Nonnull + protected Builder self() { + return this; + } + /** * The names of particular nodes in the cluster to target. *

@@ -281,6 +291,14 @@ protected static void setupReloadSecureSettingsRequestDeserializer(ObjectDeseria // --------------------------------------------------------------------------------------------- + @Override + protected void applyQueryParameters(@Nonnull Map params) { + super.applyQueryParameters(params); + if (this.timeout != null) { + params.put("timeout", this.timeout._toJsonString()); + } + } + /** * Endpoint "{@code nodes.reload_secure_settings}". */ @@ -311,9 +329,7 @@ protected static void setupReloadSecureSettingsRequestDeserializer(ObjectDeseria // Request parameters request -> { Map params = new HashMap<>(); - if (request.timeout != null) { - params.put("timeout", request.timeout._toJsonString()); - } + request.applyQueryParameters(params); return params; }, SimpleEndpoint.emptyMap(), diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/snapshot/CleanupRepositoryRequest.java b/java-client/src/generated/java/org/opensearch/client/opensearch/snapshot/CleanupRepositoryRequest.java index 8cca465b44..fc1da21715 100644 --- a/java-client/src/generated/java/org/opensearch/client/opensearch/snapshot/CleanupRepositoryRequest.java +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/snapshot/CleanupRepositoryRequest.java @@ -51,7 +51,6 @@ 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: snapshot.cleanup_repository.Request @@ -60,7 +59,7 @@ * Removes stale data from repository. */ @Generated("org.opensearch.client.codegen.CodeGenerator") -public class CleanupRepositoryRequest extends RequestBase +public final class CleanupRepositoryRequest extends RequestBase implements ToCopyableBuilder { @@ -80,6 +79,7 @@ public class CleanupRepositoryRequest extends RequestBase // --------------------------------------------------------------------------------------------- private CleanupRepositoryRequest(Builder builder) { + super(builder); this.clusterManagerTimeout = builder.clusterManagerTimeout; this.masterTimeout = builder.masterTimeout; this.repository = ApiTypeHelper.requireNonNull(builder.repository, this, "repository"); @@ -151,7 +151,7 @@ public static Builder builder() { /** * Builder for {@link CleanupRepositoryRequest}. */ - public static class Builder extends ObjectBuilderBase implements CopyableBuilder { + public static class Builder extends RequestBase.AbstractBuilder implements CopyableBuilder { @Nullable private Time clusterManagerTimeout; @Nullable @@ -163,6 +163,7 @@ public static class Builder extends ObjectBuilderBase implements CopyableBuilder public Builder() {} private Builder(CleanupRepositoryRequest o) { + super(o); this.clusterManagerTimeout = o.clusterManagerTimeout; this.masterTimeout = o.masterTimeout; this.repository = o.repository; @@ -170,6 +171,7 @@ private Builder(CleanupRepositoryRequest o) { } private Builder(Builder o) { + super(o); this.clusterManagerTimeout = o.clusterManagerTimeout; this.masterTimeout = o.masterTimeout; this.repository = o.repository; @@ -182,6 +184,12 @@ public Builder copy() { return new Builder(this); } + @Override + @Nonnull + protected Builder self() { + return this; + } + /** * Operation timeout for connection to cluster-manager node. *

@@ -281,6 +289,20 @@ public CleanupRepositoryRequest build() { // --------------------------------------------------------------------------------------------- + @Override + protected void applyQueryParameters(@Nonnull Map params) { + super.applyQueryParameters(params); + if (this.clusterManagerTimeout != null) { + params.put("cluster_manager_timeout", this.clusterManagerTimeout._toJsonString()); + } + if (this.masterTimeout != null) { + params.put("master_timeout", this.masterTimeout._toJsonString()); + } + if (this.timeout != null) { + params.put("timeout", this.timeout._toJsonString()); + } + } + /** * Endpoint "{@code snapshot.cleanup_repository}". */ @@ -298,15 +320,7 @@ public CleanupRepositoryRequest build() { // Request parameters request -> { Map params = new HashMap<>(); - 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()); - } + request.applyQueryParameters(params); return params; }, SimpleEndpoint.emptyMap(), diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/snapshot/CloneSnapshotRequest.java b/java-client/src/generated/java/org/opensearch/client/opensearch/snapshot/CloneSnapshotRequest.java index ccd6ceefdd..75883ead6f 100644 --- a/java-client/src/generated/java/org/opensearch/client/opensearch/snapshot/CloneSnapshotRequest.java +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/snapshot/CloneSnapshotRequest.java @@ -58,7 +58,6 @@ 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: snapshot.clone.Request @@ -68,7 +67,7 @@ */ @JsonpDeserializable @Generated("org.opensearch.client.codegen.CodeGenerator") -public class CloneSnapshotRequest extends RequestBase +public final class CloneSnapshotRequest extends RequestBase implements PlainJsonSerializable, ToCopyableBuilder { @@ -95,6 +94,7 @@ public class CloneSnapshotRequest extends RequestBase // --------------------------------------------------------------------------------------------- private CloneSnapshotRequest(Builder builder) { + super(builder); this.clusterManagerTimeout = builder.clusterManagerTimeout; this.indices = ApiTypeHelper.requireNonNull(builder.indices, this, "indices"); this.masterTimeout = builder.masterTimeout; @@ -201,7 +201,7 @@ public static Builder builder() { /** * Builder for {@link CloneSnapshotRequest}. */ - public static class Builder extends ObjectBuilderBase implements CopyableBuilder { + public static class Builder extends RequestBase.AbstractBuilder implements CopyableBuilder { @Nullable private Time clusterManagerTimeout; private String indices; @@ -214,6 +214,7 @@ public static class Builder extends ObjectBuilderBase implements CopyableBuilder public Builder() {} private Builder(CloneSnapshotRequest o) { + super(o); this.clusterManagerTimeout = o.clusterManagerTimeout; this.indices = o.indices; this.masterTimeout = o.masterTimeout; @@ -223,6 +224,7 @@ private Builder(CloneSnapshotRequest o) { } private Builder(Builder o) { + super(o); this.clusterManagerTimeout = o.clusterManagerTimeout; this.indices = o.indices; this.masterTimeout = o.masterTimeout; @@ -237,6 +239,12 @@ public Builder copy() { return new Builder(this); } + @Override + @Nonnull + protected Builder self() { + return this; + } + /** * Operation timeout for connection to cluster-manager node. *

@@ -360,6 +368,17 @@ protected static void setupCloneSnapshotRequestDeserializer(ObjectDeserializer params) { + super.applyQueryParameters(params); + if (this.clusterManagerTimeout != null) { + params.put("cluster_manager_timeout", this.clusterManagerTimeout._toJsonString()); + } + if (this.masterTimeout != null) { + params.put("master_timeout", this.masterTimeout._toJsonString()); + } + } + /** * Endpoint "{@code snapshot.clone}". */ @@ -380,12 +399,7 @@ protected static void setupCloneSnapshotRequestDeserializer(ObjectDeserializer { Map params = new HashMap<>(); - if (request.clusterManagerTimeout != null) { - params.put("cluster_manager_timeout", request.clusterManagerTimeout._toJsonString()); - } - if (request.masterTimeout != null) { - params.put("master_timeout", request.masterTimeout._toJsonString()); - } + request.applyQueryParameters(params); return params; }, SimpleEndpoint.emptyMap(), diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/snapshot/CreateRepositoryRequest.java b/java-client/src/generated/java/org/opensearch/client/opensearch/snapshot/CreateRepositoryRequest.java index e6af47caff..f83851962a 100644 --- a/java-client/src/generated/java/org/opensearch/client/opensearch/snapshot/CreateRepositoryRequest.java +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/snapshot/CreateRepositoryRequest.java @@ -58,7 +58,6 @@ 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: snapshot.create_repository.Request @@ -68,7 +67,7 @@ */ @JsonpDeserializable @Generated("org.opensearch.client.codegen.CodeGenerator") -public class CreateRepositoryRequest extends RequestBase +public final class CreateRepositoryRequest extends RequestBase implements PlainJsonSerializable, ToCopyableBuilder { @@ -101,6 +100,7 @@ public class CreateRepositoryRequest extends RequestBase // --------------------------------------------------------------------------------------------- private CreateRepositoryRequest(Builder builder) { + super(builder); this.clusterManagerTimeout = builder.clusterManagerTimeout; this.masterTimeout = builder.masterTimeout; this.name = ApiTypeHelper.requireNonNull(builder.name, this, "name"); @@ -233,7 +233,7 @@ public static Builder builder() { /** * Builder for {@link CreateRepositoryRequest}. */ - public static class Builder extends ObjectBuilderBase implements CopyableBuilder { + public static class Builder extends RequestBase.AbstractBuilder implements CopyableBuilder { @Nullable private Time clusterManagerTimeout; @Nullable @@ -251,6 +251,7 @@ public static class Builder extends ObjectBuilderBase implements CopyableBuilder public Builder() {} private Builder(CreateRepositoryRequest o) { + super(o); this.clusterManagerTimeout = o.clusterManagerTimeout; this.masterTimeout = o.masterTimeout; this.name = o.name; @@ -262,6 +263,7 @@ private Builder(CreateRepositoryRequest o) { } private Builder(Builder o) { + super(o); this.clusterManagerTimeout = o.clusterManagerTimeout; this.masterTimeout = o.masterTimeout; this.name = o.name; @@ -278,6 +280,12 @@ public Builder copy() { return new Builder(this); } + @Override + @Nonnull + protected Builder self() { + return this; + } + /** * Operation timeout for connection to cluster-manager node. *

@@ -448,6 +456,23 @@ protected static void setupCreateRepositoryRequestDeserializer(ObjectDeserialize // --------------------------------------------------------------------------------------------- + @Override + protected void applyQueryParameters(@Nonnull Map params) { + super.applyQueryParameters(params); + if (this.clusterManagerTimeout != null) { + params.put("cluster_manager_timeout", this.clusterManagerTimeout._toJsonString()); + } + if (this.masterTimeout != null) { + params.put("master_timeout", this.masterTimeout._toJsonString()); + } + if (this.timeout != null) { + params.put("timeout", this.timeout._toJsonString()); + } + if (this.verify != null) { + params.put("verify", String.valueOf(this.verify)); + } + } + /** * Endpoint "{@code snapshot.create_repository}". */ @@ -464,18 +489,7 @@ protected static void setupCreateRepositoryRequestDeserializer(ObjectDeserialize // Request parameters request -> { Map params = new HashMap<>(); - 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()); - } - if (request.verify != null) { - params.put("verify", String.valueOf(request.verify)); - } + request.applyQueryParameters(params); return params; }, SimpleEndpoint.emptyMap(), diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/snapshot/CreateSnapshotRequest.java b/java-client/src/generated/java/org/opensearch/client/opensearch/snapshot/CreateSnapshotRequest.java index bfaa7410e8..d384a5e335 100644 --- a/java-client/src/generated/java/org/opensearch/client/opensearch/snapshot/CreateSnapshotRequest.java +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/snapshot/CreateSnapshotRequest.java @@ -60,7 +60,6 @@ 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: snapshot.create.Request @@ -70,7 +69,7 @@ */ @JsonpDeserializable @Generated("org.opensearch.client.codegen.CodeGenerator") -public class CreateSnapshotRequest extends RequestBase +public final class CreateSnapshotRequest extends RequestBase implements PlainJsonSerializable, ToCopyableBuilder { @@ -112,6 +111,7 @@ public class CreateSnapshotRequest extends RequestBase // --------------------------------------------------------------------------------------------- private CreateSnapshotRequest(Builder builder) { + super(builder); this.clusterManagerTimeout = builder.clusterManagerTimeout; this.featureStates = ApiTypeHelper.unmodifiable(builder.featureStates); this.ignoreUnavailable = builder.ignoreUnavailable; @@ -325,7 +325,7 @@ public static Builder builder() { /** * Builder for {@link CreateSnapshotRequest}. */ - public static class Builder extends ObjectBuilderBase implements CopyableBuilder { + public static class Builder extends RequestBase.AbstractBuilder implements CopyableBuilder { @Nullable private Time clusterManagerTimeout; @Nullable @@ -350,6 +350,7 @@ public static class Builder extends ObjectBuilderBase implements CopyableBuilder public Builder() {} private Builder(CreateSnapshotRequest o) { + super(o); this.clusterManagerTimeout = o.clusterManagerTimeout; this.featureStates = _listCopy(o.featureStates); this.ignoreUnavailable = o.ignoreUnavailable; @@ -364,6 +365,7 @@ private Builder(CreateSnapshotRequest o) { } private Builder(Builder o) { + super(o); this.clusterManagerTimeout = o.clusterManagerTimeout; this.featureStates = _listCopy(o.featureStates); this.ignoreUnavailable = o.ignoreUnavailable; @@ -383,6 +385,12 @@ public Builder copy() { return new Builder(this); } + @Override + @Nonnull + protected Builder self() { + return this; + } + /** * Operation timeout for connection to cluster-manager node. *

@@ -636,6 +644,20 @@ protected static void setupCreateSnapshotRequestDeserializer(ObjectDeserializer< // --------------------------------------------------------------------------------------------- + @Override + protected void applyQueryParameters(@Nonnull Map params) { + super.applyQueryParameters(params); + if (this.clusterManagerTimeout != null) { + params.put("cluster_manager_timeout", this.clusterManagerTimeout._toJsonString()); + } + if (this.masterTimeout != null) { + params.put("master_timeout", this.masterTimeout._toJsonString()); + } + if (this.waitForCompletion != null) { + params.put("wait_for_completion", String.valueOf(this.waitForCompletion)); + } + } + /** * Endpoint "{@code snapshot.create}". */ @@ -654,15 +676,7 @@ protected static void setupCreateSnapshotRequestDeserializer(ObjectDeserializer< // Request parameters request -> { Map params = new HashMap<>(); - 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.waitForCompletion != null) { - params.put("wait_for_completion", String.valueOf(request.waitForCompletion)); - } + request.applyQueryParameters(params); return params; }, SimpleEndpoint.emptyMap(), diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/snapshot/DeleteRepositoryRequest.java b/java-client/src/generated/java/org/opensearch/client/opensearch/snapshot/DeleteRepositoryRequest.java index 66f0aa35e4..1de359b8c1 100644 --- a/java-client/src/generated/java/org/opensearch/client/opensearch/snapshot/DeleteRepositoryRequest.java +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/snapshot/DeleteRepositoryRequest.java @@ -52,7 +52,6 @@ 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: snapshot.delete_repository.Request @@ -61,7 +60,7 @@ * Deletes a repository. */ @Generated("org.opensearch.client.codegen.CodeGenerator") -public class DeleteRepositoryRequest extends RequestBase +public final class DeleteRepositoryRequest extends RequestBase implements ToCopyableBuilder { @@ -81,6 +80,7 @@ public class DeleteRepositoryRequest extends RequestBase // --------------------------------------------------------------------------------------------- private DeleteRepositoryRequest(Builder builder) { + super(builder); this.clusterManagerTimeout = builder.clusterManagerTimeout; this.masterTimeout = builder.masterTimeout; this.name = ApiTypeHelper.unmodifiableRequired(builder.name, this, "name"); @@ -152,7 +152,7 @@ public static Builder builder() { /** * Builder for {@link DeleteRepositoryRequest}. */ - public static class Builder extends ObjectBuilderBase implements CopyableBuilder { + public static class Builder extends RequestBase.AbstractBuilder implements CopyableBuilder { @Nullable private Time clusterManagerTimeout; @Nullable @@ -164,6 +164,7 @@ public static class Builder extends ObjectBuilderBase implements CopyableBuilder public Builder() {} private Builder(DeleteRepositoryRequest o) { + super(o); this.clusterManagerTimeout = o.clusterManagerTimeout; this.masterTimeout = o.masterTimeout; this.name = _listCopy(o.name); @@ -171,6 +172,7 @@ private Builder(DeleteRepositoryRequest o) { } private Builder(Builder o) { + super(o); this.clusterManagerTimeout = o.clusterManagerTimeout; this.masterTimeout = o.masterTimeout; this.name = _listCopy(o.name); @@ -183,6 +185,12 @@ public Builder copy() { return new Builder(this); } + @Override + @Nonnull + protected Builder self() { + return this; + } + /** * Operation timeout for connection to cluster-manager node. *

@@ -302,6 +310,20 @@ public DeleteRepositoryRequest build() { // --------------------------------------------------------------------------------------------- + @Override + protected void applyQueryParameters(@Nonnull Map params) { + super.applyQueryParameters(params); + if (this.clusterManagerTimeout != null) { + params.put("cluster_manager_timeout", this.clusterManagerTimeout._toJsonString()); + } + if (this.masterTimeout != null) { + params.put("master_timeout", this.masterTimeout._toJsonString()); + } + if (this.timeout != null) { + params.put("timeout", this.timeout._toJsonString()); + } + } + /** * Endpoint "{@code snapshot.delete_repository}". */ @@ -318,15 +340,7 @@ public DeleteRepositoryRequest build() { // Request parameters request -> { Map params = new HashMap<>(); - 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()); - } + request.applyQueryParameters(params); return params; }, SimpleEndpoint.emptyMap(), diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/snapshot/DeleteSnapshotRequest.java b/java-client/src/generated/java/org/opensearch/client/opensearch/snapshot/DeleteSnapshotRequest.java index d1f539cc4a..75385f0d32 100644 --- a/java-client/src/generated/java/org/opensearch/client/opensearch/snapshot/DeleteSnapshotRequest.java +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/snapshot/DeleteSnapshotRequest.java @@ -51,7 +51,6 @@ 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: snapshot.delete.Request @@ -60,7 +59,9 @@ * Deletes a snapshot. */ @Generated("org.opensearch.client.codegen.CodeGenerator") -public class DeleteSnapshotRequest extends RequestBase implements ToCopyableBuilder { +public final class DeleteSnapshotRequest extends RequestBase + implements + ToCopyableBuilder { @Nullable private final Time clusterManagerTimeout; @@ -78,6 +79,7 @@ public class DeleteSnapshotRequest extends RequestBase implements ToCopyableBuil // --------------------------------------------------------------------------------------------- private DeleteSnapshotRequest(Builder builder) { + super(builder); this.clusterManagerTimeout = builder.clusterManagerTimeout; this.masterTimeout = builder.masterTimeout; this.repository = ApiTypeHelper.requireNonNull(builder.repository, this, "repository"); @@ -149,7 +151,7 @@ public static Builder builder() { /** * Builder for {@link DeleteSnapshotRequest}. */ - public static class Builder extends ObjectBuilderBase implements CopyableBuilder { + public static class Builder extends RequestBase.AbstractBuilder implements CopyableBuilder { @Nullable private Time clusterManagerTimeout; @Nullable @@ -160,6 +162,7 @@ public static class Builder extends ObjectBuilderBase implements CopyableBuilder public Builder() {} private Builder(DeleteSnapshotRequest o) { + super(o); this.clusterManagerTimeout = o.clusterManagerTimeout; this.masterTimeout = o.masterTimeout; this.repository = o.repository; @@ -167,6 +170,7 @@ private Builder(DeleteSnapshotRequest o) { } private Builder(Builder o) { + super(o); this.clusterManagerTimeout = o.clusterManagerTimeout; this.masterTimeout = o.masterTimeout; this.repository = o.repository; @@ -179,6 +183,12 @@ public Builder copy() { return new Builder(this); } + @Override + @Nonnull + protected Builder self() { + return this; + } + /** * Operation timeout for connection to cluster-manager node. *

@@ -267,6 +277,17 @@ public DeleteSnapshotRequest build() { // --------------------------------------------------------------------------------------------- + @Override + protected void applyQueryParameters(@Nonnull Map params) { + super.applyQueryParameters(params); + if (this.clusterManagerTimeout != null) { + params.put("cluster_manager_timeout", this.clusterManagerTimeout._toJsonString()); + } + if (this.masterTimeout != null) { + params.put("master_timeout", this.masterTimeout._toJsonString()); + } + } + /** * Endpoint "{@code snapshot.delete}". */ @@ -285,12 +306,7 @@ public DeleteSnapshotRequest build() { // Request parameters request -> { Map params = new HashMap<>(); - if (request.clusterManagerTimeout != null) { - params.put("cluster_manager_timeout", request.clusterManagerTimeout._toJsonString()); - } - if (request.masterTimeout != null) { - params.put("master_timeout", request.masterTimeout._toJsonString()); - } + request.applyQueryParameters(params); return params; }, SimpleEndpoint.emptyMap(), diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/snapshot/GetRepositoryRequest.java b/java-client/src/generated/java/org/opensearch/client/opensearch/snapshot/GetRepositoryRequest.java index 31e8b5aaf1..472d4ae0e9 100644 --- a/java-client/src/generated/java/org/opensearch/client/opensearch/snapshot/GetRepositoryRequest.java +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/snapshot/GetRepositoryRequest.java @@ -52,7 +52,6 @@ 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: snapshot.get_repository.Request @@ -61,7 +60,9 @@ * Returns information about a repository. */ @Generated("org.opensearch.client.codegen.CodeGenerator") -public class GetRepositoryRequest extends RequestBase implements ToCopyableBuilder { +public final class GetRepositoryRequest extends RequestBase + implements + ToCopyableBuilder { @Nullable private final Time clusterManagerTimeout; @@ -79,6 +80,7 @@ public class GetRepositoryRequest extends RequestBase implements ToCopyableBuild // --------------------------------------------------------------------------------------------- private GetRepositoryRequest(Builder builder) { + super(builder); this.clusterManagerTimeout = builder.clusterManagerTimeout; this.local = builder.local; this.masterTimeout = builder.masterTimeout; @@ -150,7 +152,7 @@ public static Builder builder() { /** * Builder for {@link GetRepositoryRequest}. */ - public static class Builder extends ObjectBuilderBase implements CopyableBuilder { + public static class Builder extends RequestBase.AbstractBuilder implements CopyableBuilder { @Nullable private Time clusterManagerTimeout; @Nullable @@ -163,6 +165,7 @@ public static class Builder extends ObjectBuilderBase implements CopyableBuilder public Builder() {} private Builder(GetRepositoryRequest o) { + super(o); this.clusterManagerTimeout = o.clusterManagerTimeout; this.local = o.local; this.masterTimeout = o.masterTimeout; @@ -170,6 +173,7 @@ private Builder(GetRepositoryRequest o) { } private Builder(Builder o) { + super(o); this.clusterManagerTimeout = o.clusterManagerTimeout; this.local = o.local; this.masterTimeout = o.masterTimeout; @@ -182,6 +186,12 @@ public Builder copy() { return new Builder(this); } + @Override + @Nonnull + protected Builder self() { + return this; + } + /** * Operation timeout for connection to cluster-manager node. *

@@ -290,6 +300,20 @@ public GetRepositoryRequest build() { // --------------------------------------------------------------------------------------------- + @Override + protected void applyQueryParameters(@Nonnull Map params) { + super.applyQueryParameters(params); + if (this.clusterManagerTimeout != null) { + params.put("cluster_manager_timeout", this.clusterManagerTimeout._toJsonString()); + } + if (this.local != null) { + params.put("local", String.valueOf(this.local)); + } + if (this.masterTimeout != null) { + params.put("master_timeout", this.masterTimeout._toJsonString()); + } + } + /** * Endpoint "{@code snapshot.get_repository}". */ @@ -319,15 +343,7 @@ public GetRepositoryRequest build() { // Request parameters request -> { Map params = new HashMap<>(); - 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()); - } + request.applyQueryParameters(params); return params; }, SimpleEndpoint.emptyMap(), diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/snapshot/GetSnapshotRequest.java b/java-client/src/generated/java/org/opensearch/client/opensearch/snapshot/GetSnapshotRequest.java index 3b1776a93b..36fb18c0f5 100644 --- a/java-client/src/generated/java/org/opensearch/client/opensearch/snapshot/GetSnapshotRequest.java +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/snapshot/GetSnapshotRequest.java @@ -52,7 +52,6 @@ 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: snapshot.get.Request @@ -61,7 +60,7 @@ * Returns information about a snapshot. */ @Generated("org.opensearch.client.codegen.CodeGenerator") -public class GetSnapshotRequest extends RequestBase implements ToCopyableBuilder { +public final class GetSnapshotRequest extends RequestBase implements ToCopyableBuilder { @Nullable private final Time clusterManagerTimeout; @@ -85,6 +84,7 @@ public class GetSnapshotRequest extends RequestBase implements ToCopyableBuilder // --------------------------------------------------------------------------------------------- private GetSnapshotRequest(Builder builder) { + super(builder); this.clusterManagerTimeout = builder.clusterManagerTimeout; this.ignoreUnavailable = builder.ignoreUnavailable; this.masterTimeout = builder.masterTimeout; @@ -189,7 +189,7 @@ public static Builder builder() { /** * Builder for {@link GetSnapshotRequest}. */ - public static class Builder extends ObjectBuilderBase implements CopyableBuilder { + public static class Builder extends RequestBase.AbstractBuilder implements CopyableBuilder { @Nullable private Time clusterManagerTimeout; @Nullable @@ -204,6 +204,7 @@ public static class Builder extends ObjectBuilderBase implements CopyableBuilder public Builder() {} private Builder(GetSnapshotRequest o) { + super(o); this.clusterManagerTimeout = o.clusterManagerTimeout; this.ignoreUnavailable = o.ignoreUnavailable; this.masterTimeout = o.masterTimeout; @@ -213,6 +214,7 @@ private Builder(GetSnapshotRequest o) { } private Builder(Builder o) { + super(o); this.clusterManagerTimeout = o.clusterManagerTimeout; this.ignoreUnavailable = o.ignoreUnavailable; this.masterTimeout = o.masterTimeout; @@ -227,6 +229,12 @@ public Builder copy() { return new Builder(this); } + @Override + @Nonnull + protected Builder self() { + return this; + } + /** * Operation timeout for connection to cluster-manager node. *

@@ -376,6 +384,23 @@ public GetSnapshotRequest build() { // --------------------------------------------------------------------------------------------- + @Override + protected void applyQueryParameters(@Nonnull Map params) { + super.applyQueryParameters(params); + if (this.clusterManagerTimeout != null) { + params.put("cluster_manager_timeout", this.clusterManagerTimeout._toJsonString()); + } + if (this.ignoreUnavailable != null) { + params.put("ignore_unavailable", String.valueOf(this.ignoreUnavailable)); + } + if (this.masterTimeout != null) { + params.put("master_timeout", this.masterTimeout._toJsonString()); + } + if (this.verbose != null) { + params.put("verbose", String.valueOf(this.verbose)); + } + } + /** * Endpoint "{@code snapshot.get}". */ @@ -394,18 +419,7 @@ public GetSnapshotRequest build() { // Request parameters request -> { Map params = new HashMap<>(); - if (request.clusterManagerTimeout != null) { - params.put("cluster_manager_timeout", request.clusterManagerTimeout._toJsonString()); - } - if (request.ignoreUnavailable != null) { - params.put("ignore_unavailable", String.valueOf(request.ignoreUnavailable)); - } - if (request.masterTimeout != null) { - params.put("master_timeout", request.masterTimeout._toJsonString()); - } - if (request.verbose != null) { - params.put("verbose", String.valueOf(request.verbose)); - } + request.applyQueryParameters(params); return params; }, SimpleEndpoint.emptyMap(), diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/snapshot/RestoreSnapshotRequest.java b/java-client/src/generated/java/org/opensearch/client/opensearch/snapshot/RestoreSnapshotRequest.java index 901602f755..075a66ab86 100644 --- a/java-client/src/generated/java/org/opensearch/client/opensearch/snapshot/RestoreSnapshotRequest.java +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/snapshot/RestoreSnapshotRequest.java @@ -60,7 +60,6 @@ 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: snapshot.restore.Request @@ -70,7 +69,7 @@ */ @JsonpDeserializable @Generated("org.opensearch.client.codegen.CodeGenerator") -public class RestoreSnapshotRequest extends RequestBase +public final class RestoreSnapshotRequest extends RequestBase implements PlainJsonSerializable, ToCopyableBuilder { @@ -133,6 +132,7 @@ public class RestoreSnapshotRequest extends RequestBase // --------------------------------------------------------------------------------------------- private RestoreSnapshotRequest(Builder builder) { + super(builder); this.clusterManagerTimeout = builder.clusterManagerTimeout; this.ignoreIndexSettings = ApiTypeHelper.unmodifiable(builder.ignoreIndexSettings); this.ignoreUnavailable = builder.ignoreUnavailable; @@ -481,7 +481,7 @@ public static Builder builder() { /** * Builder for {@link RestoreSnapshotRequest}. */ - public static class Builder extends ObjectBuilderBase implements CopyableBuilder { + public static class Builder extends RequestBase.AbstractBuilder implements CopyableBuilder { @Nullable private Time clusterManagerTimeout; @Nullable @@ -520,6 +520,7 @@ public static class Builder extends ObjectBuilderBase implements CopyableBuilder public Builder() {} private Builder(RestoreSnapshotRequest o) { + super(o); this.clusterManagerTimeout = o.clusterManagerTimeout; this.ignoreIndexSettings = _listCopy(o.ignoreIndexSettings); this.ignoreUnavailable = o.ignoreUnavailable; @@ -541,6 +542,7 @@ private Builder(RestoreSnapshotRequest o) { } private Builder(Builder o) { + super(o); this.clusterManagerTimeout = o.clusterManagerTimeout; this.ignoreIndexSettings = _listCopy(o.ignoreIndexSettings); this.ignoreUnavailable = o.ignoreUnavailable; @@ -567,6 +569,12 @@ public Builder copy() { return new Builder(this); } + @Override + @Nonnull + protected Builder self() { + return this; + } + /** * Operation timeout for connection to cluster-manager node. *

@@ -932,6 +940,20 @@ protected static void setupRestoreSnapshotRequestDeserializer(ObjectDeserializer // --------------------------------------------------------------------------------------------- + @Override + protected void applyQueryParameters(@Nonnull Map params) { + super.applyQueryParameters(params); + if (this.clusterManagerTimeout != null) { + params.put("cluster_manager_timeout", this.clusterManagerTimeout._toJsonString()); + } + if (this.masterTimeout != null) { + params.put("master_timeout", this.masterTimeout._toJsonString()); + } + if (this.waitForCompletion != null) { + params.put("wait_for_completion", String.valueOf(this.waitForCompletion)); + } + } + /** * Endpoint "{@code snapshot.restore}". */ @@ -951,15 +973,7 @@ protected static void setupRestoreSnapshotRequestDeserializer(ObjectDeserializer // Request parameters request -> { Map params = new HashMap<>(); - 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.waitForCompletion != null) { - params.put("wait_for_completion", String.valueOf(request.waitForCompletion)); - } + request.applyQueryParameters(params); return params; }, SimpleEndpoint.emptyMap(), diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/snapshot/SnapshotStatusRequest.java b/java-client/src/generated/java/org/opensearch/client/opensearch/snapshot/SnapshotStatusRequest.java index 9de668e4ac..b05f208cdb 100644 --- a/java-client/src/generated/java/org/opensearch/client/opensearch/snapshot/SnapshotStatusRequest.java +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/snapshot/SnapshotStatusRequest.java @@ -52,7 +52,6 @@ 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: snapshot.status.Request @@ -61,7 +60,9 @@ * Returns information about the status of a snapshot. */ @Generated("org.opensearch.client.codegen.CodeGenerator") -public class SnapshotStatusRequest extends RequestBase implements ToCopyableBuilder { +public final class SnapshotStatusRequest extends RequestBase + implements + ToCopyableBuilder { @Nullable private final Time clusterManagerTimeout; @@ -82,6 +83,7 @@ public class SnapshotStatusRequest extends RequestBase implements ToCopyableBuil // --------------------------------------------------------------------------------------------- private SnapshotStatusRequest(Builder builder) { + super(builder); this.clusterManagerTimeout = builder.clusterManagerTimeout; this.ignoreUnavailable = builder.ignoreUnavailable; this.masterTimeout = builder.masterTimeout; @@ -165,7 +167,7 @@ public static Builder builder() { /** * Builder for {@link SnapshotStatusRequest}. */ - public static class Builder extends ObjectBuilderBase implements CopyableBuilder { + public static class Builder extends RequestBase.AbstractBuilder implements CopyableBuilder { @Nullable private Time clusterManagerTimeout; @Nullable @@ -180,6 +182,7 @@ public static class Builder extends ObjectBuilderBase implements CopyableBuilder public Builder() {} private Builder(SnapshotStatusRequest o) { + super(o); this.clusterManagerTimeout = o.clusterManagerTimeout; this.ignoreUnavailable = o.ignoreUnavailable; this.masterTimeout = o.masterTimeout; @@ -188,6 +191,7 @@ private Builder(SnapshotStatusRequest o) { } private Builder(Builder o) { + super(o); this.clusterManagerTimeout = o.clusterManagerTimeout; this.ignoreUnavailable = o.ignoreUnavailable; this.masterTimeout = o.masterTimeout; @@ -201,6 +205,12 @@ public Builder copy() { return new Builder(this); } + @Override + @Nonnull + protected Builder self() { + return this; + } + /** * Operation timeout for connection to cluster-manager node. *

@@ -321,6 +331,20 @@ public SnapshotStatusRequest build() { // --------------------------------------------------------------------------------------------- + @Override + protected void applyQueryParameters(@Nonnull Map params) { + super.applyQueryParameters(params); + if (this.clusterManagerTimeout != null) { + params.put("cluster_manager_timeout", this.clusterManagerTimeout._toJsonString()); + } + if (this.ignoreUnavailable != null) { + params.put("ignore_unavailable", String.valueOf(this.ignoreUnavailable)); + } + if (this.masterTimeout != null) { + params.put("master_timeout", this.masterTimeout._toJsonString()); + } + } + /** * Endpoint "{@code snapshot.status}". */ @@ -362,15 +386,7 @@ public SnapshotStatusRequest build() { // Request parameters request -> { Map params = new HashMap<>(); - if (request.clusterManagerTimeout != null) { - params.put("cluster_manager_timeout", request.clusterManagerTimeout._toJsonString()); - } - if (request.ignoreUnavailable != null) { - params.put("ignore_unavailable", String.valueOf(request.ignoreUnavailable)); - } - if (request.masterTimeout != null) { - params.put("master_timeout", request.masterTimeout._toJsonString()); - } + request.applyQueryParameters(params); return params; }, SimpleEndpoint.emptyMap(), diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/snapshot/VerifyRepositoryRequest.java b/java-client/src/generated/java/org/opensearch/client/opensearch/snapshot/VerifyRepositoryRequest.java index 338bb0e98a..3e476619e5 100644 --- a/java-client/src/generated/java/org/opensearch/client/opensearch/snapshot/VerifyRepositoryRequest.java +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/snapshot/VerifyRepositoryRequest.java @@ -51,7 +51,6 @@ 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: snapshot.verify_repository.Request @@ -60,7 +59,7 @@ * Verifies a repository. */ @Generated("org.opensearch.client.codegen.CodeGenerator") -public class VerifyRepositoryRequest extends RequestBase +public final class VerifyRepositoryRequest extends RequestBase implements ToCopyableBuilder { @@ -80,6 +79,7 @@ public class VerifyRepositoryRequest extends RequestBase // --------------------------------------------------------------------------------------------- private VerifyRepositoryRequest(Builder builder) { + super(builder); this.clusterManagerTimeout = builder.clusterManagerTimeout; this.masterTimeout = builder.masterTimeout; this.repository = ApiTypeHelper.requireNonNull(builder.repository, this, "repository"); @@ -151,7 +151,7 @@ public static Builder builder() { /** * Builder for {@link VerifyRepositoryRequest}. */ - public static class Builder extends ObjectBuilderBase implements CopyableBuilder { + public static class Builder extends RequestBase.AbstractBuilder implements CopyableBuilder { @Nullable private Time clusterManagerTimeout; @Nullable @@ -163,6 +163,7 @@ public static class Builder extends ObjectBuilderBase implements CopyableBuilder public Builder() {} private Builder(VerifyRepositoryRequest o) { + super(o); this.clusterManagerTimeout = o.clusterManagerTimeout; this.masterTimeout = o.masterTimeout; this.repository = o.repository; @@ -170,6 +171,7 @@ private Builder(VerifyRepositoryRequest o) { } private Builder(Builder o) { + super(o); this.clusterManagerTimeout = o.clusterManagerTimeout; this.masterTimeout = o.masterTimeout; this.repository = o.repository; @@ -182,6 +184,12 @@ public Builder copy() { return new Builder(this); } + @Override + @Nonnull + protected Builder self() { + return this; + } + /** * Operation timeout for connection to cluster-manager node. *

@@ -281,6 +289,20 @@ public VerifyRepositoryRequest build() { // --------------------------------------------------------------------------------------------- + @Override + protected void applyQueryParameters(@Nonnull Map params) { + super.applyQueryParameters(params); + if (this.clusterManagerTimeout != null) { + params.put("cluster_manager_timeout", this.clusterManagerTimeout._toJsonString()); + } + if (this.masterTimeout != null) { + params.put("master_timeout", this.masterTimeout._toJsonString()); + } + if (this.timeout != null) { + params.put("timeout", this.timeout._toJsonString()); + } + } + /** * Endpoint "{@code snapshot.verify_repository}". */ @@ -298,15 +320,7 @@ public VerifyRepositoryRequest build() { // Request parameters request -> { Map params = new HashMap<>(); - 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()); - } + request.applyQueryParameters(params); return params; }, SimpleEndpoint.emptyMap(), diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/tasks/CancelRequest.java b/java-client/src/generated/java/org/opensearch/client/opensearch/tasks/CancelRequest.java index 2a84cc1377..ce4c6c1237 100644 --- a/java-client/src/generated/java/org/opensearch/client/opensearch/tasks/CancelRequest.java +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/tasks/CancelRequest.java @@ -51,7 +51,6 @@ 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: tasks.cancel.Request @@ -60,7 +59,7 @@ * Cancels a task, if it can be cancelled through an API. */ @Generated("org.opensearch.client.codegen.CodeGenerator") -public class CancelRequest extends RequestBase implements ToCopyableBuilder { +public final class CancelRequest extends RequestBase implements ToCopyableBuilder { @Nonnull private final List actions; @@ -80,6 +79,7 @@ public class CancelRequest extends RequestBase implements ToCopyableBuilder { + public static class Builder extends RequestBase.AbstractBuilder implements CopyableBuilder { @Nullable private List actions; @Nullable @@ -177,6 +177,7 @@ public static class Builder extends ObjectBuilderBase implements CopyableBuilder public Builder() {} private Builder(CancelRequest o) { + super(o); this.actions = _listCopy(o.actions); this.nodes = _listCopy(o.nodes); this.parentTaskId = o.parentTaskId; @@ -185,6 +186,7 @@ private Builder(CancelRequest o) { } private Builder(Builder o) { + super(o); this.actions = _listCopy(o.actions); this.nodes = _listCopy(o.nodes); this.parentTaskId = o.parentTaskId; @@ -198,6 +200,12 @@ public Builder copy() { return new Builder(this); } + @Override + @Nonnull + protected Builder self() { + return this; + } + /** * Comma-separated list or wildcard expression of actions used to limit the request. *

@@ -314,6 +322,23 @@ public CancelRequest build() { // --------------------------------------------------------------------------------------------- + @Override + protected void applyQueryParameters(@Nonnull Map params) { + super.applyQueryParameters(params); + if (ApiTypeHelper.isDefined(this.actions)) { + params.put("actions", String.join(",", this.actions)); + } + if (ApiTypeHelper.isDefined(this.nodes)) { + params.put("nodes", String.join(",", this.nodes)); + } + if (this.parentTaskId != null) { + params.put("parent_task_id", this.parentTaskId); + } + if (this.waitForCompletion != null) { + params.put("wait_for_completion", String.valueOf(this.waitForCompletion)); + } + } + /** * Endpoint "{@code tasks.cancel}". */ @@ -344,18 +369,7 @@ public CancelRequest build() { // Request parameters request -> { Map params = new HashMap<>(); - if (ApiTypeHelper.isDefined(request.actions)) { - params.put("actions", String.join(",", request.actions)); - } - if (ApiTypeHelper.isDefined(request.nodes)) { - params.put("nodes", String.join(",", request.nodes)); - } - if (request.parentTaskId != null) { - params.put("parent_task_id", request.parentTaskId); - } - if (request.waitForCompletion != null) { - params.put("wait_for_completion", String.valueOf(request.waitForCompletion)); - } + request.applyQueryParameters(params); return params; }, SimpleEndpoint.emptyMap(), diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/tasks/GetTasksRequest.java b/java-client/src/generated/java/org/opensearch/client/opensearch/tasks/GetTasksRequest.java index d90fc8582f..2840f6dbe3 100644 --- a/java-client/src/generated/java/org/opensearch/client/opensearch/tasks/GetTasksRequest.java +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/tasks/GetTasksRequest.java @@ -51,7 +51,6 @@ 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: tasks.get.Request @@ -60,7 +59,7 @@ * Returns information about a task. */ @Generated("org.opensearch.client.codegen.CodeGenerator") -public class GetTasksRequest extends RequestBase implements ToCopyableBuilder { +public final class GetTasksRequest extends RequestBase implements ToCopyableBuilder { @Nonnull private final String taskId; @@ -74,6 +73,7 @@ public class GetTasksRequest extends RequestBase implements ToCopyableBuilder { + public static class Builder extends RequestBase.AbstractBuilder implements CopyableBuilder { private String taskId; @Nullable private Time timeout; @@ -142,12 +142,14 @@ public static class Builder extends ObjectBuilderBase implements CopyableBuilder public Builder() {} private Builder(GetTasksRequest o) { + super(o); this.taskId = o.taskId; this.timeout = o.timeout; this.waitForCompletion = o.waitForCompletion; } private Builder(Builder o) { + super(o); this.taskId = o.taskId; this.timeout = o.timeout; this.waitForCompletion = o.waitForCompletion; @@ -159,6 +161,12 @@ public Builder copy() { return new Builder(this); } + @Override + @Nonnull + protected Builder self() { + return this; + } + /** * Required - ID of the task. *

@@ -222,6 +230,17 @@ public GetTasksRequest build() { // --------------------------------------------------------------------------------------------- + @Override + protected void applyQueryParameters(@Nonnull Map params) { + super.applyQueryParameters(params); + if (this.timeout != null) { + params.put("timeout", this.timeout._toJsonString()); + } + if (this.waitForCompletion != null) { + params.put("wait_for_completion", String.valueOf(this.waitForCompletion)); + } + } + /** * Endpoint "{@code tasks.get}". */ @@ -238,12 +257,7 @@ public GetTasksRequest build() { // Request parameters request -> { Map params = new HashMap<>(); - if (request.timeout != null) { - params.put("timeout", request.timeout._toJsonString()); - } - if (request.waitForCompletion != null) { - params.put("wait_for_completion", String.valueOf(request.waitForCompletion)); - } + request.applyQueryParameters(params); return params; }, SimpleEndpoint.emptyMap(), diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/tasks/ListRequest.java b/java-client/src/generated/java/org/opensearch/client/opensearch/tasks/ListRequest.java index 8da89ebe71..b47b93f0b4 100644 --- a/java-client/src/generated/java/org/opensearch/client/opensearch/tasks/ListRequest.java +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/tasks/ListRequest.java @@ -52,7 +52,6 @@ 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: tasks.list.Request @@ -61,7 +60,7 @@ * Returns a list of tasks. */ @Generated("org.opensearch.client.codegen.CodeGenerator") -public class ListRequest extends RequestBase implements ToCopyableBuilder { +public final class ListRequest extends RequestBase implements ToCopyableBuilder { @Nonnull private final List actions; @@ -87,6 +86,7 @@ public class ListRequest extends RequestBase implements ToCopyableBuilder { + public static class Builder extends RequestBase.AbstractBuilder implements CopyableBuilder { @Nullable private List actions; @Nullable @@ -213,6 +213,7 @@ public static class Builder extends ObjectBuilderBase implements CopyableBuilder public Builder() {} private Builder(ListRequest o) { + super(o); this.actions = _listCopy(o.actions); this.detailed = o.detailed; this.groupBy = o.groupBy; @@ -223,6 +224,7 @@ private Builder(ListRequest o) { } private Builder(Builder o) { + super(o); this.actions = _listCopy(o.actions); this.detailed = o.detailed; this.groupBy = o.groupBy; @@ -238,6 +240,12 @@ public Builder copy() { return new Builder(this); } + @Override + @Nonnull + protected Builder self() { + return this; + } + /** * Comma-separated list or wildcard expression of actions used to limit the request. *

@@ -391,6 +399,32 @@ public ListRequest build() { // --------------------------------------------------------------------------------------------- + @Override + protected void applyQueryParameters(@Nonnull Map params) { + super.applyQueryParameters(params); + if (ApiTypeHelper.isDefined(this.actions)) { + params.put("actions", String.join(",", this.actions)); + } + if (this.detailed != null) { + params.put("detailed", String.valueOf(this.detailed)); + } + if (this.groupBy != null) { + params.put("group_by", this.groupBy.jsonValue()); + } + if (ApiTypeHelper.isDefined(this.nodes)) { + params.put("nodes", String.join(",", this.nodes)); + } + if (this.parentTaskId != null) { + params.put("parent_task_id", this.parentTaskId); + } + if (this.timeout != null) { + params.put("timeout", this.timeout._toJsonString()); + } + if (this.waitForCompletion != null) { + params.put("wait_for_completion", String.valueOf(this.waitForCompletion)); + } + } + /** * Endpoint "{@code tasks.list}". */ @@ -402,27 +436,7 @@ public ListRequest build() { // Request parameters request -> { Map params = new HashMap<>(); - if (ApiTypeHelper.isDefined(request.actions)) { - params.put("actions", String.join(",", request.actions)); - } - if (request.detailed != null) { - params.put("detailed", String.valueOf(request.detailed)); - } - if (request.groupBy != null) { - params.put("group_by", request.groupBy.jsonValue()); - } - if (ApiTypeHelper.isDefined(request.nodes)) { - params.put("nodes", String.join(",", request.nodes)); - } - if (request.parentTaskId != null) { - params.put("parent_task_id", request.parentTaskId); - } - if (request.timeout != null) { - params.put("timeout", request.timeout._toJsonString()); - } - if (request.waitForCompletion != null) { - params.put("wait_for_completion", String.valueOf(request.waitForCompletion)); - } + request.applyQueryParameters(params); return params; }, SimpleEndpoint.emptyMap(), diff --git a/java-client/src/main/java/org/opensearch/client/opensearch/OpenSearchAsyncClient.java b/java-client/src/main/java/org/opensearch/client/opensearch/OpenSearchAsyncClient.java index 6cb98b6e70..759bfae4de 100644 --- a/java-client/src/main/java/org/opensearch/client/opensearch/OpenSearchAsyncClient.java +++ b/java-client/src/main/java/org/opensearch/client/opensearch/OpenSearchAsyncClient.java @@ -38,7 +38,6 @@ import javax.annotation.Nullable; import org.opensearch.client.opensearch._types.ErrorResponse; import org.opensearch.client.opensearch._types.OpenSearchException; -import org.opensearch.client.opensearch.cat.OpenSearchCatAsyncClient; import org.opensearch.client.opensearch.core.BulkRequest; import org.opensearch.client.opensearch.core.BulkResponse; import org.opensearch.client.opensearch.core.ClearScrollRequest; @@ -142,12 +141,6 @@ public OpenSearchAsyncClient withTransportOptions(@Nullable TransportOptions tra return new OpenSearchAsyncClient(this.transport, transportOptions); } - // ----- Child clients - - public OpenSearchCatAsyncClient cat() { - return new OpenSearchCatAsyncClient(this.transport, this.transportOptions); - } - // ----- Endpoint: bulk /** diff --git a/java-client/src/main/java/org/opensearch/client/opensearch/OpenSearchClient.java b/java-client/src/main/java/org/opensearch/client/opensearch/OpenSearchClient.java index 9a8f90bb42..4d335674c5 100644 --- a/java-client/src/main/java/org/opensearch/client/opensearch/OpenSearchClient.java +++ b/java-client/src/main/java/org/opensearch/client/opensearch/OpenSearchClient.java @@ -37,7 +37,6 @@ import javax.annotation.Nullable; import org.opensearch.client.opensearch._types.ErrorResponse; import org.opensearch.client.opensearch._types.OpenSearchException; -import org.opensearch.client.opensearch.cat.OpenSearchCatClient; import org.opensearch.client.opensearch.core.BulkRequest; import org.opensearch.client.opensearch.core.BulkResponse; import org.opensearch.client.opensearch.core.ClearScrollRequest; @@ -147,10 +146,6 @@ public OpenSearchGenericClient generic() { return new OpenSearchGenericClient(this.transport, this.transportOptions); } - public OpenSearchCatClient cat() { - return new OpenSearchCatClient(this.transport, this.transportOptions); - } - // ----- Endpoint: bulk /** diff --git a/java-client/src/main/java/org/opensearch/client/opensearch/_types/RequestBase.java b/java-client/src/main/java/org/opensearch/client/opensearch/_types/RequestBase.java index 165c5258a0..3894c975dd 100644 --- a/java-client/src/main/java/org/opensearch/client/opensearch/_types/RequestBase.java +++ b/java-client/src/main/java/org/opensearch/client/opensearch/_types/RequestBase.java @@ -32,16 +32,104 @@ package org.opensearch.client.opensearch._types; +import java.util.Map; +import javax.annotation.Nonnull; +import javax.annotation.Nullable; import org.opensearch.client.util.ObjectBuilderBase; // typedef: _types.RequestBase public abstract class RequestBase { - public RequestBase() {} + @Nullable + private final Boolean errorTrace; + @Nullable + private final Boolean human; + + // TODO: Remove once all request classes are generated + protected RequestBase() { + this.errorTrace = null; + this.human = null; + } + + protected RequestBase(AbstractBuilder builder) { + this.errorTrace = builder.errorTrace; + this.human = builder.human; + } + + /** + * Whether to include the stack trace of returned errors. + *

+ * API name: {@code error_trace} + *

+ */ + @Nullable + public Boolean errorTrace() { + return this.errorTrace; + } + + /** + * Whether to return human readable values for statistics. + *

+ * API name: {@code human} + *

+ */ + @Nullable + public Boolean human() { + return this.human; + } protected abstract static class AbstractBuilder> extends ObjectBuilderBase { + @Nullable + private Boolean errorTrace; + @Nullable + private Boolean human; + + protected AbstractBuilder() {} + + protected AbstractBuilder(RequestBase o) { + this.errorTrace = o.errorTrace; + this.human = o.human; + } + + protected AbstractBuilder(AbstractBuilder o) { + this.errorTrace = o.errorTrace; + this.human = o.human; + } + + @Nonnull protected abstract BuilderT self(); + /** + * Whether to include the stack trace of returned errors. + *

+ * API name: {@code error_trace} + *

+ */ + @Nonnull + public BuilderT errorTrace(@Nullable Boolean value) { + this.errorTrace = value; + return self(); + } + + /** + * Whether to return human readable values for statistics. + *

+ * API name: {@code human} + *

+ */ + @Nonnull + public BuilderT human(@Nullable Boolean value) { + this.human = value; + return self(); + } } + protected void applyQueryParameters(@Nonnull Map params) { + if (errorTrace != null) { + params.put("error_trace", String.valueOf(errorTrace)); + } + if (human != null) { + params.put("human", String.valueOf(human)); + } + } } diff --git a/java-client/src/main/java/org/opensearch/client/opensearch/cat/CatRequestBase.java b/java-client/src/main/java/org/opensearch/client/opensearch/cat/CatRequestBase.java index 173ddb1f49..ff8dc6d734 100644 --- a/java-client/src/main/java/org/opensearch/client/opensearch/cat/CatRequestBase.java +++ b/java-client/src/main/java/org/opensearch/client/opensearch/cat/CatRequestBase.java @@ -33,42 +33,32 @@ package org.opensearch.client.opensearch.cat; import java.util.HashMap; +import java.util.List; import java.util.Map; +import javax.annotation.Nonnull; import javax.annotation.Nullable; import org.opensearch.client.opensearch._types.RequestBase; +import org.opensearch.client.util.ApiTypeHelper; import org.opensearch.client.util.ObjectBuilder; -import org.opensearch.client.util.ObjectBuilderBase; // typedef: cat._types.CatRequestBase public abstract class CatRequestBase extends RequestBase { - - @Nullable - private final String headers; - - @Nullable - private final String sort; - - public CatRequestBase() { - this.headers = null; - this.sort = null; + @Nonnull + private final List headers; + @Nonnull + private final List sort; + + // TODO: remove me once all cat operations are generated + protected CatRequestBase() { + this.headers = ApiTypeHelper.undefinedList(); + this.sort = ApiTypeHelper.undefinedList(); } - public CatRequestBase(CatRequestBaseBuilder builder) { - this.headers = builder.headers; - this.sort = builder.sort; - } - - protected final Map queryParameters() { - Map params = new HashMap<>(); - if (headers != null && !headers.trim().isEmpty()) { - params.put("h", headers); - } - if (sort != null && !sort.trim().isEmpty()) { - params.put("s", sort); - } - params.put("format", "json"); - return params; + protected CatRequestBase(AbstractBuilder builder) { + super(builder); + this.headers = ApiTypeHelper.unmodifiable(builder.headers); + this.sort = ApiTypeHelper.unmodifiable(builder.sort); } /** @@ -76,7 +66,8 @@ protected final Map queryParameters() { *

* API name: {@code h} */ - public final String headers() { + @Nonnull + public final List headers() { return this.headers; } @@ -86,21 +77,49 @@ public final String headers() { * API name: {@code s} *

*/ - public final String sort() { + @Nonnull + public final List sort() { return this.sort; } - protected abstract static class CatRequestBaseBuilder extends ObjectBuilderBase - implements - ObjectBuilder { + // TODO: remove me once all cat operations are generated + protected abstract static class CatRequestBaseBuilder> extends AbstractBuilder< + BuilderT> implements ObjectBuilder { - @Nullable - protected String headers; + } + protected abstract static class AbstractBuilder> extends RequestBase.AbstractBuilder< + BuilderT> { + @Nullable + protected List headers; @Nullable - protected String sort; + protected List sort; + + protected AbstractBuilder() {} + + protected AbstractBuilder(CatRequestBase o) { + super(o); + this.headers = _listCopy(o.headers); + this.sort = _listCopy(o.sort); + } - protected abstract BuilderT self(); + protected AbstractBuilder(AbstractBuilder o) { + super(o); + this.headers = _listCopy(o.headers); + this.sort = _listCopy(o.sort); + } + + /** + * A comma-separated list of specific headers to limits the output + *

+ * API name: {@code h} + *

+ */ + @Nonnull + public final BuilderT headers(List values) { + this.headers = _listAddAll(this.headers, values); + return self(); + } /** * A comma-separated list of specific headers to limits the output @@ -108,8 +127,21 @@ protected abstract static class CatRequestBaseBuilder */ - public final BuilderT headers(@Nullable String headers) { - this.headers = headers; + @Nonnull + public final BuilderT headers(String value, String... values) { + this.headers = _listAdd(this.headers, value, values); + return self(); + } + + /** + * A comma-separated list of headers to sort the returned information + *

+ * API name: {@code s} + *

+ */ + @Nonnull + public final BuilderT sort(List values) { + this.sort = _listAddAll(this.sort, values); return self(); } @@ -119,11 +151,29 @@ public final BuilderT headers(@Nullable String headers) { * API name: {@code s} *

*/ - public final BuilderT sort(@Nullable String sort) { - this.sort = sort; + @Nonnull + public final BuilderT sort(String value, String... values) { + this.sort = _listAdd(this.sort, value, values); return self(); } + } + @Override + protected void applyQueryParameters(@Nonnull Map params) { + super.applyQueryParameters(params); + if (ApiTypeHelper.isDefined(headers)) { + params.put("h", String.join(",", headers)); + } + if (ApiTypeHelper.isDefined(sort)) { + params.put("s", String.join(",", sort)); + } + params.put("format", "json"); } + // TODO: remove me once all cat operations are generated + protected final Map queryParameters() { + Map params = new HashMap<>(); + applyQueryParameters(params); + return params; + } } diff --git a/java-client/src/main/java/org/opensearch/client/opensearch/cat/OpenSearchCatAsyncClient.java b/java-client/src/main/java/org/opensearch/client/opensearch/cat/OpenSearchCatAsyncClient.java index f7d4a2720a..6adc082d46 100644 --- a/java-client/src/main/java/org/opensearch/client/opensearch/cat/OpenSearchCatAsyncClient.java +++ b/java-client/src/main/java/org/opensearch/client/opensearch/cat/OpenSearchCatAsyncClient.java @@ -36,7 +36,6 @@ import java.util.concurrent.CompletableFuture; import java.util.function.Function; import javax.annotation.Nullable; -import org.opensearch.client.ApiClient; import org.opensearch.client.opensearch._types.ErrorResponse; import org.opensearch.client.opensearch._types.OpenSearchException; import org.opensearch.client.transport.JsonEndpoint; @@ -47,7 +46,7 @@ /** * Client for the cat namespace. */ -public class OpenSearchCatAsyncClient extends ApiClient { +public class OpenSearchCatAsyncClient extends OpenSearchCatAsyncClientBase { public OpenSearchCatAsyncClient(OpenSearchTransport transport) { super(transport, null); @@ -62,51 +61,6 @@ public OpenSearchCatAsyncClient withTransportOptions(@Nullable TransportOptions return new OpenSearchCatAsyncClient(this.transport, transportOptions); } - // ----- Endpoint: cat.aliases - - /** - * Shows information about currently configured aliases to indices including - * filter and routing infos. - * - * - */ - - public CompletableFuture aliases(AliasesRequest request) throws IOException, OpenSearchException { - @SuppressWarnings("unchecked") - JsonEndpoint endpoint = (JsonEndpoint< - AliasesRequest, - AliasesResponse, - ErrorResponse>) AliasesRequest._ENDPOINT; - - return this.transport.performRequestAsync(request, endpoint, this.transportOptions); - } - - /** - * Shows information about currently configured aliases to indices including - * filter and routing infos. - * - * @param fn - * a function that initializes a builder to create the - * {@link AliasesRequest} - * - */ - - public final CompletableFuture aliases(Function> fn) - throws IOException, OpenSearchException { - return aliases(fn.apply(new AliasesRequest.Builder()).build()); - } - - /** - * Shows information about currently configured aliases to indices including - * filter and routing infos. - * - * - */ - - public CompletableFuture aliases() throws IOException, OpenSearchException { - return this.transport.performRequestAsync(new AliasesRequest.Builder().build(), AliasesRequest._ENDPOINT, this.transportOptions); - } - // ----- Endpoint: cat.allocation /** diff --git a/java-client/src/main/java/org/opensearch/client/opensearch/cat/OpenSearchCatClient.java b/java-client/src/main/java/org/opensearch/client/opensearch/cat/OpenSearchCatClient.java index e26653bae8..b6fb6c5ede 100644 --- a/java-client/src/main/java/org/opensearch/client/opensearch/cat/OpenSearchCatClient.java +++ b/java-client/src/main/java/org/opensearch/client/opensearch/cat/OpenSearchCatClient.java @@ -35,7 +35,6 @@ import java.io.IOException; import java.util.function.Function; import javax.annotation.Nullable; -import org.opensearch.client.ApiClient; import org.opensearch.client.opensearch._types.ErrorResponse; import org.opensearch.client.opensearch._types.OpenSearchException; import org.opensearch.client.transport.JsonEndpoint; @@ -46,7 +45,7 @@ /** * Client for the cat namespace. */ -public class OpenSearchCatClient extends ApiClient { +public class OpenSearchCatClient extends OpenSearchCatClientBase { public OpenSearchCatClient(OpenSearchTransport transport) { super(transport, null); @@ -61,51 +60,6 @@ public OpenSearchCatClient withTransportOptions(@Nullable TransportOptions trans return new OpenSearchCatClient(this.transport, transportOptions); } - // ----- Endpoint: cat.aliases - - /** - * Shows information about currently configured aliases to indices including - * filter and routing infos. - * - * - */ - - public AliasesResponse aliases(AliasesRequest request) throws IOException, OpenSearchException { - @SuppressWarnings("unchecked") - JsonEndpoint endpoint = (JsonEndpoint< - AliasesRequest, - AliasesResponse, - ErrorResponse>) AliasesRequest._ENDPOINT; - - return this.transport.performRequest(request, endpoint, this.transportOptions); - } - - /** - * Shows information about currently configured aliases to indices including - * filter and routing infos. - * - * @param fn - * a function that initializes a builder to create the - * {@link AliasesRequest} - * - */ - - public final AliasesResponse aliases(Function> fn) throws IOException, - OpenSearchException { - return aliases(fn.apply(new AliasesRequest.Builder()).build()); - } - - /** - * Shows information about currently configured aliases to indices including - * filter and routing infos. - * - * - */ - - public AliasesResponse aliases() throws IOException, OpenSearchException { - return this.transport.performRequest(new AliasesRequest.Builder().build(), AliasesRequest._ENDPOINT, this.transportOptions); - } - // ----- Endpoint: cat.allocation /** diff --git a/java-codegen/src/main/java/org/opensearch/client/codegen/CodeGenerator.java b/java-codegen/src/main/java/org/opensearch/client/codegen/CodeGenerator.java index a1f8e01bc2..1d8155270b 100644 --- a/java-codegen/src/main/java/org/opensearch/client/codegen/CodeGenerator.java +++ b/java-codegen/src/main/java/org/opensearch/client/codegen/CodeGenerator.java @@ -48,6 +48,7 @@ public class CodeGenerator { private static final Logger LOGGER = LogManager.getLogger(); private static final Matcher OPERATION_MATCHER = or( and(namespace(isNull()), name(is("info"))), + and(namespace(is("cat")), name(isOneOf("aliases"))), and( namespace(is("cluster")), name( diff --git a/java-codegen/src/main/java/org/opensearch/client/codegen/model/ArrayShape.java b/java-codegen/src/main/java/org/opensearch/client/codegen/model/ArrayShape.java index 3923265807..93064e5d52 100644 --- a/java-codegen/src/main/java/org/opensearch/client/codegen/model/ArrayShape.java +++ b/java-codegen/src/main/java/org/opensearch/client/codegen/model/ArrayShape.java @@ -30,6 +30,7 @@ public ArrayShape( .withRequired(true) .withDescription("Response value.") .build(); + tryAddReference(ReferenceKind.Field, arrayType); } @Override @@ -43,11 +44,16 @@ public Collection getAnnotations() { } @Override - public Collection getImplementsTypes() { - return List.of(Types.Client.Json.PlainJsonSerializable); + public boolean shouldImplementJsonSerializable() { + return true; } public Field getValueBodyField() { return valueBodyField; } + + @Override + public boolean canBeSingleton() { + return false; + } } diff --git a/java-codegen/src/main/java/org/opensearch/client/codegen/model/Namespace.java b/java-codegen/src/main/java/org/opensearch/client/codegen/model/Namespace.java index 5b9bbce8fc..cf6a9a1d5c 100644 --- a/java-codegen/src/main/java/org/opensearch/client/codegen/model/Namespace.java +++ b/java-codegen/src/main/java/org/opensearch/client/codegen/model/Namespace.java @@ -20,11 +20,12 @@ import org.apache.commons.lang3.builder.ToStringBuilder; import org.opensearch.client.codegen.exceptions.RenderException; import org.opensearch.client.codegen.model.overrides.ShouldGenerate; +import org.opensearch.client.codegen.utils.JavaAbstractionLevel; import org.opensearch.client.codegen.utils.Lists; import org.opensearch.client.codegen.utils.Strings; public class Namespace { - private static final Set PARTIAL_NAMESPACES = Set.of("", "indices", "nodes"); + private static final Set PARTIAL_NAMESPACES = Set.of("", "cat", "indices", "nodes"); private final Namespace parent; private final String name; @@ -138,8 +139,8 @@ public TypeParameterDiamond getTypeParameters() { } @Override - public boolean isAbstract() { - return base; + public JavaAbstractionLevel getAbstractionLevel() { + return base ? JavaAbstractionLevel.Abstract : JavaAbstractionLevel.Concrete; } @Override diff --git a/java-codegen/src/main/java/org/opensearch/client/codegen/model/ObjectShape.java b/java-codegen/src/main/java/org/opensearch/client/codegen/model/ObjectShape.java index 5fadc430ff..3c10d2bab4 100644 --- a/java-codegen/src/main/java/org/opensearch/client/codegen/model/ObjectShape.java +++ b/java-codegen/src/main/java/org/opensearch/client/codegen/model/ObjectShape.java @@ -28,10 +28,14 @@ public Set> getDistinctDiscriminatorFieldValues() { .collect(Collectors.toSet()); } + public boolean shouldImplementJsonSerializable() { + return hasFieldsToSerialize() && !extendsOtherShape(); + } + public Collection getImplementsTypes() { var types = new ArrayList<>(super.getImplementsTypes()); - if (hasFieldsToSerialize() && !extendsOtherShape()) { + if (shouldImplementJsonSerializable()) { types.add(Types.Client.Json.PlainJsonSerializable); } diff --git a/java-codegen/src/main/java/org/opensearch/client/codegen/model/RequestShape.java b/java-codegen/src/main/java/org/opensearch/client/codegen/model/RequestShape.java index fa99177a8e..df49c93b5f 100644 --- a/java-codegen/src/main/java/org/opensearch/client/codegen/model/RequestShape.java +++ b/java-codegen/src/main/java/org/opensearch/client/codegen/model/RequestShape.java @@ -25,6 +25,7 @@ import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; import org.opensearch.client.codegen.model.overrides.ShouldGenerate; +import org.opensearch.client.codegen.utils.JavaAbstractionLevel; import org.opensearch.client.codegen.utils.Streams; public class RequestShape extends ObjectShape { @@ -102,7 +103,7 @@ public Type getResponseType() { @Override public boolean canBeSingleton() { - return !hasRequestBody() && !hasQueryParams() && hasSinglePath() && !getFirstPath().hasParams(); + return false; } @Override @@ -224,6 +225,11 @@ public Deprecation getDeprecation() { return deprecations.get(deprecations.size() - 1); } + @Override + public JavaAbstractionLevel getAbstractionLevel() { + return JavaAbstractionLevel.Final; + } + @Nonnull private static String requestClassName(@Nonnull OperationGroup operationGroup) { return classBaseName(operationGroup) + "Request"; diff --git a/java-codegen/src/main/java/org/opensearch/client/codegen/model/Shape.java b/java-codegen/src/main/java/org/opensearch/client/codegen/model/Shape.java index 9ea6af1ea2..8db9c1d89f 100644 --- a/java-codegen/src/main/java/org/opensearch/client/codegen/model/Shape.java +++ b/java-codegen/src/main/java/org/opensearch/client/codegen/model/Shape.java @@ -26,6 +26,7 @@ import org.apache.logging.log4j.Logger; import org.opensearch.client.codegen.exceptions.RenderException; import org.opensearch.client.codegen.model.overrides.ShouldGenerate; +import org.opensearch.client.codegen.utils.JavaAbstractionLevel; import org.opensearch.client.codegen.utils.JavaClassKind; import org.opensearch.client.codegen.utils.Markdown; @@ -61,13 +62,19 @@ public JavaClassKind getClassKind() { return JavaClassKind.Class; } - public boolean isAbstract() { + public JavaAbstractionLevel getAbstractionLevel() { var refKinds = incomingReferences.entrySet() .stream() .filter(e -> !e.getValue().isEmpty()) .map(Map.Entry::getKey) .collect(Collectors.toSet()); - return !refKinds.isEmpty() && refKinds.stream().noneMatch(ReferenceKind::isConcreteUsage); + return !refKinds.isEmpty() && refKinds.stream().noneMatch(ReferenceKind::isConcreteUsage) + ? JavaAbstractionLevel.Abstract + : JavaAbstractionLevel.Concrete; + } + + public final boolean isAbstract() { + return getAbstractionLevel() == JavaAbstractionLevel.Abstract; } public String getTypedefName() { @@ -95,6 +102,10 @@ public void setExtendsType(Type extendsType) { tryAddReference(ReferenceKind.Extends, extendsType); } + public boolean doesExtendType() { + return extendsType != null; + } + public boolean extendsOtherShape() { return extendsType != null && extendsType.getTargetShape().isPresent(); } diff --git a/java-codegen/src/main/java/org/opensearch/client/codegen/model/SpecTransformer.java b/java-codegen/src/main/java/org/opensearch/client/codegen/model/SpecTransformer.java index 47869de45b..931c52d8b0 100644 --- a/java-codegen/src/main/java/org/opensearch/client/codegen/model/SpecTransformer.java +++ b/java-codegen/src/main/java/org/opensearch/client/codegen/model/SpecTransformer.java @@ -251,14 +251,16 @@ private RequestShape visit(@Nonnull Namespace parent, @Nonnull OperationGroup gr var seenQueryParams = new HashSet(); + var isCatNs = group.getNamespace().orElse("").equals("cat"); + variants.stream() .flatMap(v -> v.getAllRelevantParameters(In.Query).stream()) - .filter(p -> seenQueryParams.add(p.getName().orElseThrow()) && !p.isGlobal()) + .filter(p -> seenQueryParams.add(p.getName().orElseThrow()) && !p.isGlobal() && (!isCatNs || !p.isGlobalCatParameter())) .map(this::visit) .forEachOrdered(shape::addQueryParam); if (shape.getExtendsType() == null) { - shape.setExtendsType(Types.Client.OpenSearch._Types.RequestBase); + shape.setExtendsType(isCatNs ? Types.Client.OpenSearch.Cat.CatRequestBase : Types.Client.OpenSearch._Types.RequestBase); } return shape; diff --git a/java-codegen/src/main/java/org/opensearch/client/codegen/model/Types.java b/java-codegen/src/main/java/org/opensearch/client/codegen/model/Types.java index 12cd2e43d5..a071306dd7 100644 --- a/java-codegen/src/main/java/org/opensearch/client/codegen/model/Types.java +++ b/java-codegen/src/main/java/org/opensearch/client/codegen/model/Types.java @@ -176,6 +176,11 @@ public static final class _Types { public static final Type RequestBase = type(PACKAGE, "RequestBase"); public static final Type Time = type(PACKAGE, "Time"); } + + public static final class Cat { + public static final String PACKAGE = OpenSearch.PACKAGE + ".cat"; + public static final Type CatRequestBase = type(PACKAGE, "CatRequestBase"); + } } public static final class Transport { diff --git a/java-codegen/src/main/java/org/opensearch/client/codegen/openapi/OpenApiParameter.java b/java-codegen/src/main/java/org/opensearch/client/codegen/openapi/OpenApiParameter.java index bc4960e2b5..df8f8bcb6b 100644 --- a/java-codegen/src/main/java/org/opensearch/client/codegen/openapi/OpenApiParameter.java +++ b/java-codegen/src/main/java/org/opensearch/client/codegen/openapi/OpenApiParameter.java @@ -12,6 +12,7 @@ import io.swagger.v3.oas.models.parameters.Parameter; import java.util.Optional; +import java.util.Set; import javax.annotation.Nonnull; import javax.annotation.Nullable; import org.opensearch.client.codegen.model.Deprecation; @@ -94,4 +95,10 @@ public Optional getDeprecation() { public boolean isOverloaded() { return schema != null && schema.hasAnyOf() && schema.getAnyOf().orElseThrow().stream().allMatch(OpenApiSchema::hasTitle); } + + private static final Set GLOBAL_CAT_PARAMETERS = Set.of("format", "h", "help", "local", "s", "v"); + + public boolean isGlobalCatParameter() { + return GLOBAL_CAT_PARAMETERS.contains(name); + } } diff --git a/java-codegen/src/main/java/org/opensearch/client/codegen/utils/JavaAbstractionLevel.java b/java-codegen/src/main/java/org/opensearch/client/codegen/utils/JavaAbstractionLevel.java new file mode 100644 index 0000000000..e1b1182bf3 --- /dev/null +++ b/java-codegen/src/main/java/org/opensearch/client/codegen/utils/JavaAbstractionLevel.java @@ -0,0 +1,40 @@ +/* + * SPDX-License-Identifier: Apache-2.0 + * + * The OpenSearch Contributors require contributions made to + * this file be licensed under the Apache-2.0 license or a + * compatible open source license. + */ + +package org.opensearch.client.codegen.utils; + +import java.util.Map; +import javax.annotation.Nonnull; + +public enum JavaAbstractionLevel { + Abstract("abstract"), + Concrete(""), + Final("final"); + + private static final Map VALUES = Maps.createLookupOf(values(), JavaAbstractionLevel::toString); + + private final String value; + + JavaAbstractionLevel(String value) { + this.value = value; + } + + @Nonnull + public static JavaAbstractionLevel from(@Nonnull String level) { + var value = VALUES.get(Strings.requireNonBlank(level, "level must not be blank")); + if (value == null) { + throw new IllegalArgumentException("Unknown level: " + level); + } + return value; + } + + @Override + public String toString() { + return this.value; + } +} diff --git a/java-codegen/src/main/resources/org/opensearch/client/codegen/templates/ArrayShape.mustache b/java-codegen/src/main/resources/org/opensearch/client/codegen/templates/ArrayShape.mustache index c3fb5ff0d0..9e8727dd05 100644 --- a/java-codegen/src/main/resources/org/opensearch/client/codegen/templates/ArrayShape.mustache +++ b/java-codegen/src/main/resources/org/opensearch/client/codegen/templates/ArrayShape.mustache @@ -16,6 +16,8 @@ // --------------------------------------------------------------------------------------------- + {{>ObjectShape/ToBuilder}} + {{>ObjectShape/Builder}} public static final {{TYPES.Client.Json.JsonpDeserializer}}<{{className}}> _DESERIALIZER = create{{className}}Deserializer(); diff --git a/java-codegen/src/main/resources/org/opensearch/client/codegen/templates/Client.mustache b/java-codegen/src/main/resources/org/opensearch/client/codegen/templates/Client.mustache index e0cbb3b14d..3ef95affc9 100644 --- a/java-codegen/src/main/resources/org/opensearch/client/codegen/templates/Client.mustache +++ b/java-codegen/src/main/resources/org/opensearch/client/codegen/templates/Client.mustache @@ -29,18 +29,6 @@ // ----- Endpoint: {{operationGroup}} - {{#canBeSingleton}} - /** - * {{description}} - */ - {{#deprecation}} - @Deprecated - {{/deprecation}} - public {{#async}}{{TYPES.Java.Util.Concurrent.CompletableFuture}}<{{/async}}{{responseType}}{{#async}}>{{/async}} {{#camelCase}}{{id}}{{/camelCase}}() throws {{TYPES.Java.Io.IOException}}, {{TYPES.Client.OpenSearch._Types.OpenSearchException}} { - return this.transport.performRequest{{#async}}Async{{/async}}({{type}}._INSTANCE, {{type}}._ENDPOINT, this.transportOptions); - } - {{/canBeSingleton}} - {{^canBeSingleton}} /** * {{description}} */ @@ -76,6 +64,5 @@ return {{#camelCase}}{{id}}{{/camelCase}}(new {{type.builderType}}().build()); } {{/hasAnyRequiredFields}} - {{/canBeSingleton}} {{/operations}} } diff --git a/java-codegen/src/main/resources/org/opensearch/client/codegen/templates/ObjectShape/Builder.mustache b/java-codegen/src/main/resources/org/opensearch/client/codegen/templates/ObjectShape/Builder.mustache index 8a0fa2b82b..67f1518ebb 100644 --- a/java-codegen/src/main/resources/org/opensearch/client/codegen/templates/ObjectShape/Builder.mustache +++ b/java-codegen/src/main/resources/org/opensearch/client/codegen/templates/ObjectShape/Builder.mustache @@ -29,7 +29,7 @@ } {{/extendedByOtherShape}} {{^extendedByOtherShape}} - {{#extendsOtherShape}} + {{#doesExtendType}} public static class Builder extends {{extendsType}}.AbstractBuilder implements {{TYPES.Client.Util.CopyableBuilder}} {{#shouldImplementPlainDeserializable}}, {{TYPES.Client.Json.PlainDeserializable}}{{/shouldImplementPlainDeserializable}} { {{>ObjectShape/Builder/Fields}} @@ -58,8 +58,8 @@ {{>ObjectShape/Builder/BuildImpl}} } - {{/extendsOtherShape}} - {{^extendsOtherShape}} + {{/doesExtendType}} + {{^doesExtendType}} public static class Builder extends {{TYPES.Client.Util.ObjectBuilderBase}} implements {{TYPES.Client.Util.CopyableBuilder}}{{#shouldImplementPlainDeserializable}}, {{TYPES.Client.Json.PlainDeserializable}}{{/shouldImplementPlainDeserializable}} { {{>ObjectShape/Builder/Fields}} @@ -91,12 +91,12 @@ {{>ObjectShape/Builder/BuildImpl}} } - {{/extendsOtherShape}} + {{/doesExtendType}} {{/extendedByOtherShape}} {{/abstract}} {{#extendedByOtherShape}} protected abstract static class AbstractBuilder> - extends {{#extendsOtherShape}}{{extendsType}}.AbstractBuilder{{/extendsOtherShape}}{{^extendsOtherShape}}{{TYPES.Client.Util.ObjectBuilderBase}}{{/extendsOtherShape}} { + extends {{#doesExtendType}}{{extendsType}}.AbstractBuilder{{/doesExtendType}}{{^doesExtendType}}{{TYPES.Client.Util.ObjectBuilderBase}}{{/doesExtendType}} { {{>ObjectShape/Builder/Fields}} protected AbstractBuilder() {} @@ -108,11 +108,11 @@ protected AbstractBuilder(AbstractBuilder o) { {{>ObjectShape/Builder/CopyCtorImpl}} } - {{^extendsOtherShape}} + {{^doesExtendType}} @{{TYPES.Javax.Annotation.Nonnull}} protected abstract BuilderT self(); - {{/extendsOtherShape}} + {{/doesExtendType}} {{#abstractBuilderSetters}} {{>ObjectShape/Builder/Setter}} diff --git a/java-codegen/src/main/resources/org/opensearch/client/codegen/templates/ObjectShape/Builder/CopyCtorImpl.mustache b/java-codegen/src/main/resources/org/opensearch/client/codegen/templates/ObjectShape/Builder/CopyCtorImpl.mustache index 61fe211db7..c7f9dec1d2 100644 --- a/java-codegen/src/main/resources/org/opensearch/client/codegen/templates/ObjectShape/Builder/CopyCtorImpl.mustache +++ b/java-codegen/src/main/resources/org/opensearch/client/codegen/templates/ObjectShape/Builder/CopyCtorImpl.mustache @@ -1,6 +1,6 @@ -{{#extendsOtherShape}} +{{#doesExtendType}} super(o); -{{/extendsOtherShape}} +{{/doesExtendType}} {{#fields}} {{#type.isList}} this.{{name}} = _listCopy(o.{{name}}); diff --git a/java-codegen/src/main/resources/org/opensearch/client/codegen/templates/ObjectShape/ConstructorImpl.mustache b/java-codegen/src/main/resources/org/opensearch/client/codegen/templates/ObjectShape/ConstructorImpl.mustache index 16173128a0..2fdd78300f 100644 --- a/java-codegen/src/main/resources/org/opensearch/client/codegen/templates/ObjectShape/ConstructorImpl.mustache +++ b/java-codegen/src/main/resources/org/opensearch/client/codegen/templates/ObjectShape/ConstructorImpl.mustache @@ -1,6 +1,6 @@ -{{#extendsOtherShape}} +{{#doesExtendType}} super(builder); -{{/extendsOtherShape}} +{{/doesExtendType}} {{#fields}} {{#type.isListOrMap}} {{#required}} diff --git a/java-codegen/src/main/resources/org/opensearch/client/codegen/templates/Partials/ClassDeclaration.mustache b/java-codegen/src/main/resources/org/opensearch/client/codegen/templates/Partials/ClassDeclaration.mustache index 5fa66eb9ee..4b3e6693e8 100644 --- a/java-codegen/src/main/resources/org/opensearch/client/codegen/templates/Partials/ClassDeclaration.mustache +++ b/java-codegen/src/main/resources/org/opensearch/client/codegen/templates/Partials/ClassDeclaration.mustache @@ -11,4 +11,4 @@ @{{.}} {{/annotations}} @{{TYPES.Javax.Annotation.Generated}}("org.opensearch.client.codegen.CodeGenerator") -public {{#abstract}}abstract {{/abstract}}{{classKind}} {{className}}{{#typeParameters}}{{.}}{{/typeParameters}}{{#extendsType}} extends {{.}}{{/extendsType}}{{#implementsTypes}}{{#-first}} implements{{/-first}} {{.}}{{^-last}},{{/-last}}{{/implementsTypes}} +public {{abstractionLevel}} {{classKind}} {{className}}{{#typeParameters}}{{.}}{{/typeParameters}}{{#extendsType}} extends {{.}}{{/extendsType}}{{#implementsTypes}}{{#-first}} implements{{/-first}} {{.}}{{^-last}},{{/-last}}{{/implementsTypes}} diff --git a/java-codegen/src/main/resources/org/opensearch/client/codegen/templates/RequestShape.mustache b/java-codegen/src/main/resources/org/opensearch/client/codegen/templates/RequestShape.mustache index 4a1fb00565..d890c79003 100644 --- a/java-codegen/src/main/resources/org/opensearch/client/codegen/templates/RequestShape.mustache +++ b/java-codegen/src/main/resources/org/opensearch/client/codegen/templates/RequestShape.mustache @@ -1,13 +1,4 @@ {{>Partials/ClassDeclaration}} { -{{#canBeSingleton}} - public {{className}}() {} - - /** - * Singleton instance for {@link {{className}}}. - */ - public static final {{className}} _INSTANCE = new {{className}}(); -{{/canBeSingleton}} -{{^canBeSingleton}} {{>ObjectShape/Fields}} // --------------------------------------------------------------------------------------------- @@ -32,10 +23,25 @@ {{>RequestShape/Deserialize}} {{/hasRequestBody}} -{{/canBeSingleton}} // --------------------------------------------------------------------------------------------- +{{#hasQueryParams}} + @Override + protected void applyQueryParameters(@{{TYPES.Javax.Annotation.Nonnull}} {{TYPES.Java.Util.Map}} params) { + super.applyQueryParameters(params); +{{#queryParams}} + {{^required}} + if ({{#type.isDefined}}this.{{name}}{{/type.isDefined}}) { + {{/required}} + params.put({{#quoted}}{{wireName}}{{/quoted}}, {{#type.queryParamify}}this.{{name}}{{/type.queryParamify}}); + {{^required}} + } + {{/required}} +{{/queryParams}} + } +{{/hasQueryParams}} + /** * Endpoint "{@code {{operationGroup}}}". */ @@ -78,24 +84,11 @@ } {{/hasSinglePath}}, // Request parameters - {{#hasQueryParams}} request -> { {{TYPES.Java.Util.Map}} params = new {{TYPES.Java.Util.HashMap}}<>(); - {{#queryParams}} - {{^required}} - if ({{#type.isDefined}}request.{{name}}{{/type.isDefined}}) { - {{/required}} - params.put({{#quoted}}{{wireName}}{{/quoted}}, {{#type.queryParamify}}request.{{name}}{{/type.queryParamify}}); - {{^required}} - } - {{/required}} - {{/queryParams}} + request.applyQueryParameters(params); return params; }, - {{/hasQueryParams}} - {{^hasQueryParams}} - {{TYPES.Client.Transport.Endpoints.SimpleEndpoint}}.emptyMap(), - {{/hasQueryParams}} {{TYPES.Client.Transport.Endpoints.SimpleEndpoint}}.emptyMap() {{^isBooleanRequest}} , From f20f5463d58a2ada0b67b79772392e12f0df851f Mon Sep 17 00:00:00 2001 From: Thomas Farr Date: Tue, 7 Jan 2025 16:53:10 +1300 Subject: [PATCH 02/18] Generate cat.allocation Signed-off-by: Thomas Farr --- .../client/opensearch/_types/Bytes.java | 28 +- .../opensearch/cat/AllocationRequest.java | 372 +++++++++++ .../opensearch/cat/AllocationResponse.java | 74 ++- .../cat/OpenSearchCatAsyncClientBase.java | 26 + .../cat/OpenSearchCatClientBase.java | 26 + .../cat/allocation/AllocationRecord.java | 333 ++++++---- .../opensearch/ml/GetModelGroupResponse.java | 43 +- .../client/opensearch/ml/Owner.java | 394 +++++++++++ .../opensearch/cat/AllocationRequest.java | 211 ------ .../cat/OpenSearchCatAsyncClient.java | 49 -- .../opensearch/cat/OpenSearchCatClient.java | 45 -- java-codegen/opensearch-openapi.yaml | 610 +++++++++++++++++- .../client/codegen/CodeGenerator.java | 11 +- .../client/codegen/model/SpecTransformer.java | 1 + .../codegen/model/overrides/Overrides.java | 3 +- 15 files changed, 1753 insertions(+), 473 deletions(-) rename java-client/src/{main => generated}/java/org/opensearch/client/opensearch/_types/Bytes.java (72%) create mode 100644 java-client/src/generated/java/org/opensearch/client/opensearch/cat/AllocationRequest.java rename java-client/src/{main => generated}/java/org/opensearch/client/opensearch/cat/AllocationResponse.java (76%) rename java-client/src/{main => generated}/java/org/opensearch/client/opensearch/cat/allocation/AllocationRecord.java (58%) create mode 100644 java-client/src/generated/java/org/opensearch/client/opensearch/ml/Owner.java delete mode 100644 java-client/src/main/java/org/opensearch/client/opensearch/cat/AllocationRequest.java diff --git a/java-client/src/main/java/org/opensearch/client/opensearch/_types/Bytes.java b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/Bytes.java similarity index 72% rename from java-client/src/main/java/org/opensearch/client/opensearch/_types/Bytes.java rename to java-client/src/generated/java/org/opensearch/client/opensearch/_types/Bytes.java index 0d6077e653..8082e5452f 100644 --- a/java-client/src/main/java/org/opensearch/client/opensearch/_types/Bytes.java +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/Bytes.java @@ -30,36 +30,48 @@ * GitHub history for details. */ +//---------------------------------------------------- +// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. +//---------------------------------------------------- + package org.opensearch.client.opensearch._types; +import javax.annotation.Generated; import org.opensearch.client.json.JsonEnum; import org.opensearch.client.json.JsonpDeserializable; +// typedef: _types.ByteUnit + @JsonpDeserializable +@Generated("org.opensearch.client.codegen.CodeGenerator") public enum Bytes implements JsonEnum { Bytes("b"), - KiloBytes("kb"), - - MegaBytes("mb"), + GigaBytes("gb", "g"), - GigaBytes("gb"), + KiloBytes("kb", "k"), - TeraBytes("tb"), + MegaBytes("mb", "m"), - PetaBytes("pb"), + PetaBytes("pb", "p"), - ; + TeraBytes("tb", "t"); private final String jsonValue; + private final String[] aliases; - Bytes(String jsonValue) { + Bytes(String jsonValue, String... aliases) { this.jsonValue = jsonValue; + this.aliases = aliases; } public String jsonValue() { return this.jsonValue; } + public String[] aliases() { + return this.aliases; + } + public static final JsonEnum.Deserializer _DESERIALIZER = new JsonEnum.Deserializer<>(Bytes.values()); } diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/cat/AllocationRequest.java b/java-client/src/generated/java/org/opensearch/client/opensearch/cat/AllocationRequest.java new file mode 100644 index 0000000000..f174627c12 --- /dev/null +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/cat/AllocationRequest.java @@ -0,0 +1,372 @@ +/* + * SPDX-License-Identifier: Apache-2.0 + * + * The OpenSearch Contributors require contributions made to + * this file be licensed under the Apache-2.0 license or a + * compatible open source license. + */ + +/* + * Licensed to Elasticsearch B.V. under one or more contributor + * license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright + * ownership. Elasticsearch B.V. licenses this file to you under + * the Apache License, Version 2.0 (the "License"); you may + * not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +/* + * Modifications Copyright OpenSearch Contributors. See + * GitHub history for details. + */ + +//---------------------------------------------------- +// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. +//---------------------------------------------------- + +package org.opensearch.client.opensearch.cat; + +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.function.Function; +import javax.annotation.Generated; +import javax.annotation.Nonnull; +import javax.annotation.Nullable; +import org.opensearch.client.opensearch._types.Bytes; +import org.opensearch.client.opensearch._types.ErrorResponse; +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.ApiTypeHelper; +import org.opensearch.client.util.CopyableBuilder; +import org.opensearch.client.util.ObjectBuilder; +import org.opensearch.client.util.ToCopyableBuilder; + +// typedef: cat.allocation.Request + +/** + * Provides a snapshot of how many shards are allocated to each data node and how much disk space they are using. + */ +@Generated("org.opensearch.client.codegen.CodeGenerator") +public final class AllocationRequest extends CatRequestBase implements ToCopyableBuilder { + + @Nullable + private final Bytes bytes; + + @Nullable + private final Time clusterManagerTimeout; + + @Deprecated + @Nullable + private final Time masterTimeout; + + @Nonnull + private final List nodeId; + + // --------------------------------------------------------------------------------------------- + + private AllocationRequest(Builder builder) { + super(builder); + this.bytes = builder.bytes; + this.clusterManagerTimeout = builder.clusterManagerTimeout; + this.masterTimeout = builder.masterTimeout; + this.nodeId = ApiTypeHelper.unmodifiable(builder.nodeId); + } + + public static AllocationRequest of(Function> fn) { + return fn.apply(new Builder()).build(); + } + + /** + * The units used to display byte values. + *

+ * API name: {@code bytes} + *

+ */ + @Nullable + public final Bytes bytes() { + return this.bytes; + } + + /** + * A timeout for connection to the cluster manager node. + *

+ * API name: {@code cluster_manager_timeout} + *

+ */ + @Nullable + public final Time clusterManagerTimeout() { + return this.clusterManagerTimeout; + } + + /** + * A timeout for connection to the cluster manager node. + *

+ * API name: {@code master_timeout} + *

+ */ + @Deprecated + @Nullable + public final Time masterTimeout() { + return this.masterTimeout; + } + + /** + * A comma-separated list of node IDs or names used to limit the returned information. + *

+ * API name: {@code node_id} + *

+ */ + @Nonnull + public final List nodeId() { + return this.nodeId; + } + + // --------------------------------------------------------------------------------------------- + + @Override + @Nonnull + public Builder toBuilder() { + return new Builder(this); + } + + @Nonnull + public static Builder builder() { + return new Builder(); + } + + /** + * Builder for {@link AllocationRequest}. + */ + public static class Builder extends CatRequestBase.AbstractBuilder implements CopyableBuilder { + @Nullable + private Bytes bytes; + @Nullable + private Time clusterManagerTimeout; + @Nullable + private Time masterTimeout; + @Nullable + private List nodeId; + + public Builder() {} + + private Builder(AllocationRequest o) { + super(o); + this.bytes = o.bytes; + this.clusterManagerTimeout = o.clusterManagerTimeout; + this.masterTimeout = o.masterTimeout; + this.nodeId = _listCopy(o.nodeId); + } + + private Builder(Builder o) { + super(o); + this.bytes = o.bytes; + this.clusterManagerTimeout = o.clusterManagerTimeout; + this.masterTimeout = o.masterTimeout; + this.nodeId = _listCopy(o.nodeId); + } + + @Override + @Nonnull + public Builder copy() { + return new Builder(this); + } + + @Override + @Nonnull + protected Builder self() { + return this; + } + + /** + * The units used to display byte values. + *

+ * API name: {@code bytes} + *

+ */ + @Nonnull + public final Builder bytes(@Nullable Bytes value) { + this.bytes = value; + return this; + } + + /** + * A timeout for connection to the cluster manager node. + *

+ * API name: {@code cluster_manager_timeout} + *

+ */ + @Nonnull + public final Builder clusterManagerTimeout(@Nullable Time value) { + this.clusterManagerTimeout = value; + return this; + } + + /** + * A timeout for connection to the cluster manager node. + *

+ * API name: {@code cluster_manager_timeout} + *

+ */ + @Nonnull + public final Builder clusterManagerTimeout(Function> fn) { + return clusterManagerTimeout(fn.apply(new Time.Builder()).build()); + } + + /** + * A timeout for connection to the cluster manager node. + *

+ * API name: {@code master_timeout} + *

+ */ + @Deprecated + @Nonnull + public final Builder masterTimeout(@Nullable Time value) { + this.masterTimeout = value; + return this; + } + + /** + * A timeout for connection to the cluster manager node. + *

+ * API name: {@code master_timeout} + *

+ */ + @Deprecated + @Nonnull + public final Builder masterTimeout(Function> fn) { + return masterTimeout(fn.apply(new Time.Builder()).build()); + } + + /** + * A comma-separated list of node IDs or names used to limit the returned information. + *

+ * API name: {@code node_id} + *

+ * + *

+ * Adds all elements of list to nodeId. + *

+ */ + @Nonnull + public final Builder nodeId(List list) { + this.nodeId = _listAddAll(this.nodeId, list); + return this; + } + + /** + * A comma-separated list of node IDs or names used to limit the returned information. + *

+ * API name: {@code node_id} + *

+ * + *

+ * Adds one or more values to nodeId. + *

+ */ + @Nonnull + public final Builder nodeId(String value, String... values) { + this.nodeId = _listAdd(this.nodeId, value, values); + return this; + } + + /** + * Builds a {@link AllocationRequest}. + * + * @throws NullPointerException if some of the required fields are null. + */ + @Override + @Nonnull + public AllocationRequest build() { + _checkSingleUse(); + + return new AllocationRequest(this); + } + } + + // --------------------------------------------------------------------------------------------- + + @Override + protected void applyQueryParameters(@Nonnull Map params) { + super.applyQueryParameters(params); + if (this.bytes != null) { + params.put("bytes", this.bytes.jsonValue()); + } + if (this.clusterManagerTimeout != null) { + params.put("cluster_manager_timeout", this.clusterManagerTimeout._toJsonString()); + } + if (this.masterTimeout != null) { + params.put("master_timeout", this.masterTimeout._toJsonString()); + } + } + + /** + * Endpoint "{@code cat.allocation}". + */ + public static final Endpoint _ENDPOINT = new SimpleEndpoint<>( + // Request method + request -> "GET", + // Request path + request -> { + final int _nodeId = 1 << 0; + + int propsSet = 0; + + if (ApiTypeHelper.isDefined(request.nodeId())) propsSet |= _nodeId; + + if (propsSet == 0) { + return "/_cat/allocation"; + } + if (propsSet == (_nodeId)) { + StringBuilder buf = new StringBuilder(); + buf.append("/_cat/allocation/"); + SimpleEndpoint.pathEncode(String.join(",", request.nodeId), buf); + return buf.toString(); + } + + throw SimpleEndpoint.noPathTemplateFound("path"); + }, + // Request parameters + request -> { + Map params = new HashMap<>(); + request.applyQueryParameters(params); + return params; + }, + SimpleEndpoint.emptyMap(), + false, + AllocationResponse._DESERIALIZER + ); + + @Override + public int hashCode() { + int result = 17; + result = 31 * result + Objects.hashCode(this.bytes); + result = 31 * result + Objects.hashCode(this.clusterManagerTimeout); + result = 31 * result + Objects.hashCode(this.masterTimeout); + result = 31 * result + Objects.hashCode(this.nodeId); + return result; + } + + @Override + public boolean equals(Object o) { + if (this == o) return true; + if (o == null || this.getClass() != o.getClass()) return false; + AllocationRequest other = (AllocationRequest) o; + return Objects.equals(this.bytes, other.bytes) + && Objects.equals(this.clusterManagerTimeout, other.clusterManagerTimeout) + && Objects.equals(this.masterTimeout, other.masterTimeout) + && Objects.equals(this.nodeId, other.nodeId); + } +} diff --git a/java-client/src/main/java/org/opensearch/client/opensearch/cat/AllocationResponse.java b/java-client/src/generated/java/org/opensearch/client/opensearch/cat/AllocationResponse.java similarity index 76% rename from java-client/src/main/java/org/opensearch/client/opensearch/cat/AllocationResponse.java rename to java-client/src/generated/java/org/opensearch/client/opensearch/cat/AllocationResponse.java index 0e4c06f275..1b4152cefb 100644 --- a/java-client/src/main/java/org/opensearch/client/opensearch/cat/AllocationResponse.java +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/cat/AllocationResponse.java @@ -30,43 +30,51 @@ * GitHub history for details. */ +//---------------------------------------------------- +// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. +//---------------------------------------------------- + package org.opensearch.client.opensearch.cat; 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; import org.opensearch.client.json.PlainJsonSerializable; import org.opensearch.client.opensearch.cat.allocation.AllocationRecord; 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: cat.allocation.Response @JsonpDeserializable -public class AllocationResponse implements PlainJsonSerializable { +@Generated("org.opensearch.client.codegen.CodeGenerator") +public class AllocationResponse implements PlainJsonSerializable, ToCopyableBuilder { + + @Nonnull private final List valueBody; // --------------------------------------------------------------------------------------------- private AllocationResponse(Builder builder) { - this.valueBody = ApiTypeHelper.unmodifiableRequired(builder.valueBody, this, "valueBody"); - } - public static AllocationResponse of(Function> fn) { + public static AllocationResponse of(Function> fn) { return fn.apply(new Builder()).build(); } /** * Required - Response value. - *

- * API name: {@code _value_body} */ + @Nonnull public final List valueBody() { return this.valueBody; } @@ -78,28 +86,53 @@ public void serialize(JsonGenerator generator, JsonpMapper mapper) { generator.writeStartArray(); for (AllocationRecord item0 : this.valueBody) { 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 AllocationResponse}. */ - - public static class Builder extends ObjectBuilderBase implements ObjectBuilder { + public static class Builder extends ObjectBuilderBase implements CopyableBuilder { private List valueBody; + public Builder() {} + + private Builder(AllocationResponse o) { + this.valueBody = _listCopy(o.valueBody); + } + + private Builder(Builder o) { + this.valueBody = _listCopy(o.valueBody); + } + + @Override + @Nonnull + public Builder copy() { + return new Builder(this); + } + /** * Required - Response value. - *

- * API name: {@code _value_body} + * *

* Adds all elements of list to valueBody. + *

*/ + @Nonnull public final Builder valueBody(List list) { this.valueBody = _listAddAll(this.valueBody, list); return this; @@ -107,11 +140,12 @@ public final Builder valueBody(List list) { /** * Required - Response value. - *

- * API name: {@code _value_body} + * *

* Adds one or more values to valueBody. + *

*/ + @Nonnull public final Builder valueBody(AllocationRecord value, AllocationRecord... values) { this.valueBody = _listAdd(this.valueBody, value, values); return this; @@ -119,11 +153,12 @@ public final Builder valueBody(AllocationRecord value, AllocationRecord... value /** * Required - Response value. - *

- * API name: {@code _value_body} + * *

* Adds a value to valueBody using a builder lambda. + *

*/ + @Nonnull public final Builder valueBody(Function> fn) { return valueBody(fn.apply(new AllocationRecord.Builder()).build()); } @@ -131,9 +166,10 @@ public final Builder valueBody(Function _DESERIALIZER = createAllocationResponseDeserializer(); protected static JsonpDeserializer createAllocationResponseDeserializer() { - JsonpDeserializer> valueDeserializer = JsonpDeserializer.arrayDeserializer(AllocationRecord._DESERIALIZER); return JsonpDeserializer.of( @@ -152,5 +187,4 @@ protected static JsonpDeserializer createAllocationResponseD (parser, mapper) -> new Builder().valueBody(valueDeserializer.deserialize(parser, mapper)).build() ); } - } diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/cat/OpenSearchCatAsyncClientBase.java b/java-client/src/generated/java/org/opensearch/client/opensearch/cat/OpenSearchCatAsyncClientBase.java index 587f11d1ac..08ad680d21 100644 --- a/java-client/src/generated/java/org/opensearch/client/opensearch/cat/OpenSearchCatAsyncClientBase.java +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/cat/OpenSearchCatAsyncClientBase.java @@ -83,4 +83,30 @@ public final CompletableFuture aliases(Function aliases() throws IOException, OpenSearchException { return aliases(new AliasesRequest.Builder().build()); } + + // ----- Endpoint: cat.allocation + + /** + * Provides a snapshot of how many shards are allocated to each data node and how much disk space they are using. + */ + public CompletableFuture allocation(AllocationRequest request) throws IOException, OpenSearchException { + return this.transport.performRequestAsync(request, AllocationRequest._ENDPOINT, this.transportOptions); + } + + /** + * Provides a snapshot of how many shards are allocated to each data node and how much disk space they are using. + * + * @param fn a function that initializes a builder to create the {@link AllocationRequest} + */ + public final CompletableFuture allocation(Function> fn) + throws IOException, OpenSearchException { + return allocation(fn.apply(new AllocationRequest.Builder()).build()); + } + + /** + * Provides a snapshot of how many shards are allocated to each data node and how much disk space they are using. + */ + public final CompletableFuture allocation() throws IOException, OpenSearchException { + return allocation(new AllocationRequest.Builder().build()); + } } diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/cat/OpenSearchCatClientBase.java b/java-client/src/generated/java/org/opensearch/client/opensearch/cat/OpenSearchCatClientBase.java index 754a61570a..003478c44f 100644 --- a/java-client/src/generated/java/org/opensearch/client/opensearch/cat/OpenSearchCatClientBase.java +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/cat/OpenSearchCatClientBase.java @@ -80,4 +80,30 @@ public final AliasesResponse aliases(Function> fn) throws IOException, + OpenSearchException { + return allocation(fn.apply(new AllocationRequest.Builder()).build()); + } + + /** + * Provides a snapshot of how many shards are allocated to each data node and how much disk space they are using. + */ + public final AllocationResponse allocation() throws IOException, OpenSearchException { + return allocation(new AllocationRequest.Builder().build()); + } } diff --git a/java-client/src/main/java/org/opensearch/client/opensearch/cat/allocation/AllocationRecord.java b/java-client/src/generated/java/org/opensearch/client/opensearch/cat/allocation/AllocationRecord.java similarity index 58% rename from java-client/src/main/java/org/opensearch/client/opensearch/cat/allocation/AllocationRecord.java rename to java-client/src/generated/java/org/opensearch/client/opensearch/cat/allocation/AllocationRecord.java index 6e5e783d3d..75367c7ae6 100644 --- a/java-client/src/main/java/org/opensearch/client/opensearch/cat/allocation/AllocationRecord.java +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/cat/allocation/AllocationRecord.java @@ -30,10 +30,17 @@ * GitHub history for details. */ +//---------------------------------------------------- +// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. +//---------------------------------------------------- + package org.opensearch.client.opensearch.cat.allocation; import jakarta.json.stream.JsonGenerator; +import java.util.Objects; import java.util.function.Function; +import javax.annotation.Generated; +import javax.annotation.Nonnull; import javax.annotation.Nullable; import org.opensearch.client.json.JsonpDeserializable; import org.opensearch.client.json.JsonpDeserializer; @@ -41,30 +48,31 @@ import org.opensearch.client.json.ObjectBuilderDeserializer; import org.opensearch.client.json.ObjectDeserializer; import org.opensearch.client.json.PlainJsonSerializable; +import org.opensearch.client.util.CopyableBuilder; import org.opensearch.client.util.ObjectBuilder; import org.opensearch.client.util.ObjectBuilderBase; +import org.opensearch.client.util.ToCopyableBuilder; // typedef: cat.allocation.AllocationRecord @JsonpDeserializable -public class AllocationRecord implements PlainJsonSerializable { - @Nullable - private final String shards; +@Generated("org.opensearch.client.codegen.CodeGenerator") +public class AllocationRecord implements PlainJsonSerializable, ToCopyableBuilder { @Nullable - private final String diskIndices; + private final String diskAvail; @Nullable - private final String diskUsed; + private final String diskIndices; @Nullable - private final String diskAvail; + private final String diskPercent; @Nullable private final String diskTotal; @Nullable - private final String diskPercent; + private final String diskUsed; @Nullable private final String host; @@ -75,40 +83,45 @@ public class AllocationRecord implements PlainJsonSerializable { @Nullable private final String node; + @Nullable + private final String shards; + // --------------------------------------------------------------------------------------------- private AllocationRecord(Builder builder) { - - this.shards = builder.shards; - this.diskIndices = builder.diskIndices; - this.diskUsed = builder.diskUsed; this.diskAvail = builder.diskAvail; - this.diskTotal = builder.diskTotal; + this.diskIndices = builder.diskIndices; this.diskPercent = builder.diskPercent; + this.diskTotal = builder.diskTotal; + this.diskUsed = builder.diskUsed; this.host = builder.host; this.ip = builder.ip; this.node = builder.node; - + this.shards = builder.shards; } - public static AllocationRecord of(Function> fn) { + public static AllocationRecord of(Function> fn) { return fn.apply(new Builder()).build(); } /** - * number of shards on node + * Free disk space available to OpenSearch. OpenSearch retrieves this metric from the node's operating system. Disk-based shard + * allocation uses this metric to assign shards to nodes based on available disk space. *

- * API name: {@code shards} + * API name: {@code disk.avail} + *

*/ @Nullable - public final String shards() { - return this.shards; + public final String diskAvail() { + return this.diskAvail; } /** - * disk used by ES indices + * Disk space used by the node's shards. Does not include disk space for the translog or unassigned shards. IMPORTANT: This metric + * double-counts disk space for hard-linked files, such as those created when shrinking, splitting, or cloning an index. *

* API name: {@code disk.indices} + *

*/ @Nullable public final String diskIndices() { @@ -116,29 +129,21 @@ public final String diskIndices() { } /** - * disk used (total, not just ES) + * Total percentage of disk space in use. Calculated as disk.used / disk.total. *

- * API name: {@code disk.used} - */ - @Nullable - public final String diskUsed() { - return this.diskUsed; - } - - /** - * disk available - *

- * API name: {@code disk.avail} + * API name: {@code disk.percent} + *

*/ @Nullable - public final String diskAvail() { - return this.diskAvail; + public final String diskPercent() { + return this.diskPercent; } /** - * total capacity of all volumes + * Total disk space for the node, including in-use and available space. *

* API name: {@code disk.total} + *

*/ @Nullable public final String diskTotal() { @@ -146,19 +151,23 @@ public final String diskTotal() { } /** - * percent disk used + * Total disk space in use. OpenSearch retrieves this metric from the node's operating system (OS). The metric includes disk space for: + * OpenSearch, including the translog and unassigned shards; the node's operating system; any other applications or files on the node. + * Unlike disk.indices, this metric does not double-count disk space for hard-linked files. *

- * API name: {@code disk.percent} + * API name: {@code disk.used} + *

*/ @Nullable - public final String diskPercent() { - return this.diskPercent; + public final String diskUsed() { + return this.diskUsed; } /** - * host of node + * Network host for the node. Set using the network.host setting. *

* API name: {@code host} + *

*/ @Nullable public final String host() { @@ -166,9 +175,10 @@ public final String host() { } /** - * ip of node + * IP address and port for the node. *

* API name: {@code ip} + *

*/ @Nullable public final String ip() { @@ -176,18 +186,31 @@ public final String ip() { } /** - * name of node + * Name for the node. Set using the node.name setting. *

* API name: {@code node} + *

*/ @Nullable public final String node() { return this.node; } + /** + * Number of primary and replica shards assigned to the node. + *

+ * API name: {@code shards} + *

+ */ + @Nullable + public final String shards() { + return this.shards; + } + /** * Serialize this object to JSON. */ + @Override public void serialize(JsonGenerator generator, JsonpMapper mapper) { generator.writeStartObject(); serializeInternal(generator, mapper); @@ -195,185 +218,239 @@ public void serialize(JsonGenerator generator, JsonpMapper mapper) { } protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { - - if (this.shards != null) { - generator.writeKey("shards"); - generator.write(this.shards); - + if (this.diskAvail != null) { + generator.writeKey("disk.avail"); + generator.write(this.diskAvail); } + if (this.diskIndices != null) { generator.writeKey("disk.indices"); generator.write(this.diskIndices); - } - if (this.diskUsed != null) { - generator.writeKey("disk.used"); - generator.write(this.diskUsed); + if (this.diskPercent != null) { + generator.writeKey("disk.percent"); + generator.write(this.diskPercent); } - if (this.diskAvail != null) { - generator.writeKey("disk.avail"); - generator.write(this.diskAvail); - } if (this.diskTotal != null) { generator.writeKey("disk.total"); generator.write(this.diskTotal); - } - if (this.diskPercent != null) { - generator.writeKey("disk.percent"); - generator.write(this.diskPercent); + if (this.diskUsed != null) { + generator.writeKey("disk.used"); + generator.write(this.diskUsed); } + if (this.host != null) { generator.writeKey("host"); generator.write(this.host); - } + if (this.ip != null) { generator.writeKey("ip"); generator.write(this.ip); - } + if (this.node != null) { generator.writeKey("node"); generator.write(this.node); - } + if (this.shards != null) { + generator.writeKey("shards"); + generator.write(this.shards); + } } // --------------------------------------------------------------------------------------------- + @Override + @Nonnull + public Builder toBuilder() { + return new Builder(this); + } + + @Nonnull + public static Builder builder() { + return new Builder(); + } + /** * Builder for {@link AllocationRecord}. */ - - public static class Builder extends ObjectBuilderBase implements ObjectBuilder { + public static class Builder extends ObjectBuilderBase implements CopyableBuilder { @Nullable - private String shards; - + private String diskAvail; @Nullable private String diskIndices; - - @Nullable - private String diskUsed; - @Nullable - private String diskAvail; - + private String diskPercent; @Nullable private String diskTotal; - @Nullable - private String diskPercent; - + private String diskUsed; @Nullable private String host; - @Nullable private String ip; - @Nullable private String node; + @Nullable + private String shards; + + public Builder() {} + + private Builder(AllocationRecord o) { + this.diskAvail = o.diskAvail; + this.diskIndices = o.diskIndices; + this.diskPercent = o.diskPercent; + this.diskTotal = o.diskTotal; + this.diskUsed = o.diskUsed; + this.host = o.host; + this.ip = o.ip; + this.node = o.node; + this.shards = o.shards; + } + + private Builder(Builder o) { + this.diskAvail = o.diskAvail; + this.diskIndices = o.diskIndices; + this.diskPercent = o.diskPercent; + this.diskTotal = o.diskTotal; + this.diskUsed = o.diskUsed; + this.host = o.host; + this.ip = o.ip; + this.node = o.node; + this.shards = o.shards; + } + + @Override + @Nonnull + public Builder copy() { + return new Builder(this); + } /** - * number of shards on node + * Free disk space available to OpenSearch. OpenSearch retrieves this metric from the node's operating system. Disk-based shard + * allocation uses this metric to assign shards to nodes based on available disk space. *

- * API name: {@code shards} + * API name: {@code disk.avail} + *

*/ - public final Builder shards(@Nullable String value) { - this.shards = value; + @Nonnull + public final Builder diskAvail(@Nullable String value) { + this.diskAvail = value; return this; } /** - * disk used by ES indices + * Disk space used by the node's shards. Does not include disk space for the translog or unassigned shards. IMPORTANT: This metric + * double-counts disk space for hard-linked files, such as those created when shrinking, splitting, or cloning an index. *

* API name: {@code disk.indices} + *

*/ + @Nonnull public final Builder diskIndices(@Nullable String value) { this.diskIndices = value; return this; } /** - * disk used (total, not just ES) + * Total percentage of disk space in use. Calculated as disk.used / disk.total. *

- * API name: {@code disk.used} - */ - public final Builder diskUsed(@Nullable String value) { - this.diskUsed = value; - return this; - } - - /** - * disk available - *

- * API name: {@code disk.avail} + * API name: {@code disk.percent} + *

*/ - public final Builder diskAvail(@Nullable String value) { - this.diskAvail = value; + @Nonnull + public final Builder diskPercent(@Nullable String value) { + this.diskPercent = value; return this; } /** - * total capacity of all volumes + * Total disk space for the node, including in-use and available space. *

* API name: {@code disk.total} + *

*/ + @Nonnull public final Builder diskTotal(@Nullable String value) { this.diskTotal = value; return this; } /** - * percent disk used + * Total disk space in use. OpenSearch retrieves this metric from the node's operating system (OS). The metric includes disk space + * for: OpenSearch, including the translog and unassigned shards; the node's operating system; any other applications or files on + * the node. Unlike disk.indices, this metric does not double-count disk space for hard-linked files. *

- * API name: {@code disk.percent} + * API name: {@code disk.used} + *

*/ - public final Builder diskPercent(@Nullable String value) { - this.diskPercent = value; + @Nonnull + public final Builder diskUsed(@Nullable String value) { + this.diskUsed = value; return this; } /** - * host of node + * Network host for the node. Set using the network.host setting. *

* API name: {@code host} + *

*/ + @Nonnull public final Builder host(@Nullable String value) { this.host = value; return this; } /** - * ip of node + * IP address and port for the node. *

* API name: {@code ip} + *

*/ + @Nonnull public final Builder ip(@Nullable String value) { this.ip = value; return this; } /** - * name of node + * Name for the node. Set using the node.name setting. *

* API name: {@code node} + *

*/ + @Nonnull public final Builder node(@Nullable String value) { this.node = value; return this; } + /** + * Number of primary and replica shards assigned to the node. + *

+ * API name: {@code shards} + *

+ */ + @Nonnull + public final Builder shards(@Nullable String value) { + this.shards = value; + return this; + } + /** * Builds a {@link AllocationRecord}. * - * @throws NullPointerException - * if some of the required fields are null. + * @throws NullPointerException if some of the required fields are null. */ + @Override + @Nonnull public AllocationRecord build() { _checkSingleUse(); @@ -392,17 +469,45 @@ public AllocationRecord build() { ); protected static void setupAllocationRecordDeserializer(ObjectDeserializer op) { - - op.add(Builder::shards, JsonpDeserializer.stringDeserializer(), "shards", "s"); - op.add(Builder::diskIndices, JsonpDeserializer.stringDeserializer(), "disk.indices", "di", "diskIndices"); - op.add(Builder::diskUsed, JsonpDeserializer.stringDeserializer(), "disk.used", "du", "diskUsed"); - op.add(Builder::diskAvail, JsonpDeserializer.stringDeserializer(), "disk.avail", "da", "diskAvail"); - op.add(Builder::diskTotal, JsonpDeserializer.stringDeserializer(), "disk.total", "dt", "diskTotal"); - op.add(Builder::diskPercent, JsonpDeserializer.stringDeserializer(), "disk.percent", "dp", "diskPercent"); - op.add(Builder::host, JsonpDeserializer.stringDeserializer(), "host", "h"); + op.add(Builder::diskAvail, JsonpDeserializer.stringDeserializer(), "disk.avail"); + op.add(Builder::diskIndices, JsonpDeserializer.stringDeserializer(), "disk.indices"); + op.add(Builder::diskPercent, JsonpDeserializer.stringDeserializer(), "disk.percent"); + op.add(Builder::diskTotal, JsonpDeserializer.stringDeserializer(), "disk.total"); + op.add(Builder::diskUsed, JsonpDeserializer.stringDeserializer(), "disk.used"); + op.add(Builder::host, JsonpDeserializer.stringDeserializer(), "host"); op.add(Builder::ip, JsonpDeserializer.stringDeserializer(), "ip"); - op.add(Builder::node, JsonpDeserializer.stringDeserializer(), "node", "n"); + op.add(Builder::node, JsonpDeserializer.stringDeserializer(), "node"); + op.add(Builder::shards, JsonpDeserializer.stringDeserializer(), "shards"); + } + @Override + public int hashCode() { + int result = 17; + result = 31 * result + Objects.hashCode(this.diskAvail); + result = 31 * result + Objects.hashCode(this.diskIndices); + result = 31 * result + Objects.hashCode(this.diskPercent); + result = 31 * result + Objects.hashCode(this.diskTotal); + result = 31 * result + Objects.hashCode(this.diskUsed); + result = 31 * result + Objects.hashCode(this.host); + result = 31 * result + Objects.hashCode(this.ip); + result = 31 * result + Objects.hashCode(this.node); + result = 31 * result + Objects.hashCode(this.shards); + return result; } + @Override + public boolean equals(Object o) { + if (this == o) return true; + if (o == null || this.getClass() != o.getClass()) return false; + AllocationRecord other = (AllocationRecord) o; + return Objects.equals(this.diskAvail, other.diskAvail) + && Objects.equals(this.diskIndices, other.diskIndices) + && Objects.equals(this.diskPercent, other.diskPercent) + && Objects.equals(this.diskTotal, other.diskTotal) + && Objects.equals(this.diskUsed, other.diskUsed) + && Objects.equals(this.host, other.host) + && Objects.equals(this.ip, other.ip) + && Objects.equals(this.node, other.node) + && Objects.equals(this.shards, other.shards); + } } diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/ml/GetModelGroupResponse.java b/java-client/src/generated/java/org/opensearch/client/opensearch/ml/GetModelGroupResponse.java index 143e1227f1..25aec0746c 100644 --- a/java-client/src/generated/java/org/opensearch/client/opensearch/ml/GetModelGroupResponse.java +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/ml/GetModelGroupResponse.java @@ -56,6 +56,9 @@ public class GetModelGroupResponse @Nonnull private final String name; + @Nullable + private final Owner owner; + // --------------------------------------------------------------------------------------------- private GetModelGroupResponse(Builder builder) { @@ -65,6 +68,7 @@ private GetModelGroupResponse(Builder builder) { this.lastUpdatedTime = builder.lastUpdatedTime; this.latestVersion = ApiTypeHelper.requireNonNull(builder.latestVersion, this, "latestVersion"); this.name = ApiTypeHelper.requireNonNull(builder.name, this, "name"); + this.owner = builder.owner; } public static GetModelGroupResponse of(Function> fn) { @@ -130,6 +134,14 @@ public final String name() { return this.name; } + /** + * API name: {@code owner} + */ + @Nullable + public final Owner owner() { + return this.owner; + } + /** * Serialize this object to JSON. */ @@ -162,6 +174,11 @@ protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { generator.writeKey("name"); generator.write(this.name); + + if (this.owner != null) { + generator.writeKey("owner"); + this.owner.serialize(generator, mapper); + } } // --------------------------------------------------------------------------------------------- @@ -189,6 +206,8 @@ public static class Builder extends ObjectBuilderBase implements CopyableBuilder private Long lastUpdatedTime; private Integer latestVersion; private String name; + @Nullable + private Owner owner; public Builder() {} @@ -199,6 +218,7 @@ private Builder(GetModelGroupResponse o) { this.lastUpdatedTime = o.lastUpdatedTime; this.latestVersion = o.latestVersion; this.name = o.name; + this.owner = o.owner; } private Builder(Builder o) { @@ -208,6 +228,7 @@ private Builder(Builder o) { this.lastUpdatedTime = o.lastUpdatedTime; this.latestVersion = o.latestVersion; this.name = o.name; + this.owner = o.owner; } @Override @@ -282,6 +303,23 @@ public final Builder name(String value) { return this; } + /** + * API name: {@code owner} + */ + @Nonnull + public final Builder owner(@Nullable Owner value) { + this.owner = value; + return this; + } + + /** + * API name: {@code owner} + */ + @Nonnull + public final Builder owner(Function> fn) { + return owner(fn.apply(new Owner.Builder()).build()); + } + /** * Builds a {@link GetModelGroupResponse}. * @@ -313,6 +351,7 @@ protected static void setupGetModelGroupResponseDeserializer(ObjectDeserializer< op.add(Builder::lastUpdatedTime, JsonpDeserializer.longDeserializer(), "last_updated_time"); op.add(Builder::latestVersion, JsonpDeserializer.integerDeserializer(), "latest_version"); op.add(Builder::name, JsonpDeserializer.stringDeserializer(), "name"); + op.add(Builder::owner, Owner._DESERIALIZER, "owner"); } @Override @@ -324,6 +363,7 @@ public int hashCode() { result = 31 * result + Objects.hashCode(this.lastUpdatedTime); result = 31 * result + Integer.hashCode(this.latestVersion); result = 31 * result + this.name.hashCode(); + result = 31 * result + Objects.hashCode(this.owner); return result; } @@ -337,6 +377,7 @@ public boolean equals(Object o) { && this.description.equals(other.description) && Objects.equals(this.lastUpdatedTime, other.lastUpdatedTime) && this.latestVersion == other.latestVersion - && this.name.equals(other.name); + && this.name.equals(other.name) + && Objects.equals(this.owner, other.owner); } } diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/ml/Owner.java b/java-client/src/generated/java/org/opensearch/client/opensearch/ml/Owner.java new file mode 100644 index 0000000000..3075afda05 --- /dev/null +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/ml/Owner.java @@ -0,0 +1,394 @@ +/* + * SPDX-License-Identifier: Apache-2.0 + * + * The OpenSearch Contributors require contributions made to + * this file be licensed under the Apache-2.0 license or a + * compatible open source license. + */ + +//---------------------------------------------------- +// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. +//---------------------------------------------------- + +package org.opensearch.client.opensearch.ml; + +import jakarta.json.stream.JsonGenerator; +import java.util.List; +import java.util.Objects; +import java.util.function.Function; +import javax.annotation.Generated; +import javax.annotation.Nonnull; +import javax.annotation.Nullable; +import org.opensearch.client.json.JsonpDeserializable; +import org.opensearch.client.json.JsonpDeserializer; +import org.opensearch.client.json.JsonpMapper; +import org.opensearch.client.json.ObjectBuilderDeserializer; +import org.opensearch.client.json.ObjectDeserializer; +import org.opensearch.client.json.PlainJsonSerializable; +import org.opensearch.client.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: ml.Owner + +@JsonpDeserializable +@Generated("org.opensearch.client.codegen.CodeGenerator") +public class Owner implements PlainJsonSerializable, ToCopyableBuilder { + + @Nonnull + private final List backendRoles; + + @Nonnull + private final List customAttributeNames; + + @Nonnull + private final String name; + + @Nonnull + private final List roles; + + @Nullable + private final String userRequestedTenant; + + // --------------------------------------------------------------------------------------------- + + private Owner(Builder builder) { + this.backendRoles = ApiTypeHelper.unmodifiable(builder.backendRoles); + this.customAttributeNames = ApiTypeHelper.unmodifiable(builder.customAttributeNames); + this.name = ApiTypeHelper.requireNonNull(builder.name, this, "name"); + this.roles = ApiTypeHelper.unmodifiable(builder.roles); + this.userRequestedTenant = builder.userRequestedTenant; + } + + public static Owner of(Function> fn) { + return fn.apply(new Builder()).build(); + } + + /** + * The backend roles. + *

+ * API name: {@code backend_roles} + *

+ */ + @Nonnull + public final List backendRoles() { + return this.backendRoles; + } + + /** + * The custom attribute names. + *

+ * API name: {@code custom_attribute_names} + *

+ */ + @Nonnull + public final List customAttributeNames() { + return this.customAttributeNames; + } + + /** + * Required - API name: {@code name} + */ + @Nonnull + public final String name() { + return this.name; + } + + /** + * The roles. + *

+ * API name: {@code roles} + *

+ */ + @Nonnull + public final List roles() { + return this.roles; + } + + /** + * The user requested tenant. + *

+ * API name: {@code user_requested_tenant} + *

+ */ + @Nullable + public final String userRequestedTenant() { + return this.userRequestedTenant; + } + + /** + * Serialize this object to JSON. + */ + @Override + public void serialize(JsonGenerator generator, JsonpMapper mapper) { + generator.writeStartObject(); + serializeInternal(generator, mapper); + generator.writeEnd(); + } + + protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { + if (ApiTypeHelper.isDefined(this.backendRoles)) { + generator.writeKey("backend_roles"); + generator.writeStartArray(); + for (String item0 : this.backendRoles) { + generator.write(item0); + } + generator.writeEnd(); + } + + if (ApiTypeHelper.isDefined(this.customAttributeNames)) { + generator.writeKey("custom_attribute_names"); + generator.writeStartArray(); + for (String item0 : this.customAttributeNames) { + generator.write(item0); + } + generator.writeEnd(); + } + + generator.writeKey("name"); + generator.write(this.name); + + if (ApiTypeHelper.isDefined(this.roles)) { + generator.writeKey("roles"); + generator.writeStartArray(); + for (String item0 : this.roles) { + generator.write(item0); + } + generator.writeEnd(); + } + + if (this.userRequestedTenant != null) { + generator.writeKey("user_requested_tenant"); + generator.write(this.userRequestedTenant); + } + } + + // --------------------------------------------------------------------------------------------- + + @Override + @Nonnull + public Builder toBuilder() { + return new Builder(this); + } + + @Nonnull + public static Builder builder() { + return new Builder(); + } + + /** + * Builder for {@link Owner}. + */ + public static class Builder extends ObjectBuilderBase implements CopyableBuilder { + @Nullable + private List backendRoles; + @Nullable + private List customAttributeNames; + private String name; + @Nullable + private List roles; + @Nullable + private String userRequestedTenant; + + public Builder() {} + + private Builder(Owner o) { + this.backendRoles = _listCopy(o.backendRoles); + this.customAttributeNames = _listCopy(o.customAttributeNames); + this.name = o.name; + this.roles = _listCopy(o.roles); + this.userRequestedTenant = o.userRequestedTenant; + } + + private Builder(Builder o) { + this.backendRoles = _listCopy(o.backendRoles); + this.customAttributeNames = _listCopy(o.customAttributeNames); + this.name = o.name; + this.roles = _listCopy(o.roles); + this.userRequestedTenant = o.userRequestedTenant; + } + + @Override + @Nonnull + public Builder copy() { + return new Builder(this); + } + + /** + * The backend roles. + *

+ * API name: {@code backend_roles} + *

+ * + *

+ * Adds all elements of list to backendRoles. + *

+ */ + @Nonnull + public final Builder backendRoles(List list) { + this.backendRoles = _listAddAll(this.backendRoles, list); + return this; + } + + /** + * The backend roles. + *

+ * API name: {@code backend_roles} + *

+ * + *

+ * Adds one or more values to backendRoles. + *

+ */ + @Nonnull + public final Builder backendRoles(String value, String... values) { + this.backendRoles = _listAdd(this.backendRoles, value, values); + return this; + } + + /** + * The custom attribute names. + *

+ * API name: {@code custom_attribute_names} + *

+ * + *

+ * Adds all elements of list to customAttributeNames. + *

+ */ + @Nonnull + public final Builder customAttributeNames(List list) { + this.customAttributeNames = _listAddAll(this.customAttributeNames, list); + return this; + } + + /** + * The custom attribute names. + *

+ * API name: {@code custom_attribute_names} + *

+ * + *

+ * Adds one or more values to customAttributeNames. + *

+ */ + @Nonnull + public final Builder customAttributeNames(String value, String... values) { + this.customAttributeNames = _listAdd(this.customAttributeNames, value, values); + return this; + } + + /** + * Required - API name: {@code name} + */ + @Nonnull + public final Builder name(String value) { + this.name = value; + return this; + } + + /** + * The roles. + *

+ * API name: {@code roles} + *

+ * + *

+ * Adds all elements of list to roles. + *

+ */ + @Nonnull + public final Builder roles(List list) { + this.roles = _listAddAll(this.roles, list); + return this; + } + + /** + * The roles. + *

+ * API name: {@code roles} + *

+ * + *

+ * Adds one or more values to roles. + *

+ */ + @Nonnull + public final Builder roles(String value, String... values) { + this.roles = _listAdd(this.roles, value, values); + return this; + } + + /** + * The user requested tenant. + *

+ * API name: {@code user_requested_tenant} + *

+ */ + @Nonnull + public final Builder userRequestedTenant(@Nullable String value) { + this.userRequestedTenant = value; + return this; + } + + /** + * Builds a {@link Owner}. + * + * @throws NullPointerException if some of the required fields are null. + */ + @Override + @Nonnull + public Owner build() { + _checkSingleUse(); + + return new Owner(this); + } + } + + // --------------------------------------------------------------------------------------------- + + /** + * Json deserializer for {@link Owner} + */ + public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer.lazy( + Builder::new, + Owner::setupOwnerDeserializer + ); + + protected static void setupOwnerDeserializer(ObjectDeserializer op) { + op.add(Builder::backendRoles, JsonpDeserializer.arrayDeserializer(JsonpDeserializer.stringDeserializer()), "backend_roles"); + op.add( + Builder::customAttributeNames, + JsonpDeserializer.arrayDeserializer(JsonpDeserializer.stringDeserializer()), + "custom_attribute_names" + ); + op.add(Builder::name, JsonpDeserializer.stringDeserializer(), "name"); + op.add(Builder::roles, JsonpDeserializer.arrayDeserializer(JsonpDeserializer.stringDeserializer()), "roles"); + op.add(Builder::userRequestedTenant, JsonpDeserializer.stringDeserializer(), "user_requested_tenant"); + } + + @Override + public int hashCode() { + int result = 17; + result = 31 * result + Objects.hashCode(this.backendRoles); + result = 31 * result + Objects.hashCode(this.customAttributeNames); + result = 31 * result + this.name.hashCode(); + result = 31 * result + Objects.hashCode(this.roles); + result = 31 * result + Objects.hashCode(this.userRequestedTenant); + return result; + } + + @Override + public boolean equals(Object o) { + if (this == o) return true; + if (o == null || this.getClass() != o.getClass()) return false; + Owner other = (Owner) o; + return Objects.equals(this.backendRoles, other.backendRoles) + && Objects.equals(this.customAttributeNames, other.customAttributeNames) + && this.name.equals(other.name) + && Objects.equals(this.roles, other.roles) + && Objects.equals(this.userRequestedTenant, other.userRequestedTenant); + } +} diff --git a/java-client/src/main/java/org/opensearch/client/opensearch/cat/AllocationRequest.java b/java-client/src/main/java/org/opensearch/client/opensearch/cat/AllocationRequest.java deleted file mode 100644 index 515322e0e5..0000000000 --- a/java-client/src/main/java/org/opensearch/client/opensearch/cat/AllocationRequest.java +++ /dev/null @@ -1,211 +0,0 @@ -/* - * SPDX-License-Identifier: Apache-2.0 - * - * The OpenSearch Contributors require contributions made to - * this file be licensed under the Apache-2.0 license or a - * compatible open source license. - */ - -/* - * Licensed to Elasticsearch B.V. under one or more contributor - * license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright - * ownership. Elasticsearch B.V. licenses this file to you under - * the Apache License, Version 2.0 (the "License"); you may - * not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -/* - * Modifications Copyright OpenSearch Contributors. See - * GitHub history for details. - */ - -package org.opensearch.client.opensearch.cat; - -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.function.Function; -import java.util.stream.Collectors; -import javax.annotation.Nullable; -import org.opensearch.client.opensearch._types.Bytes; -import org.opensearch.client.opensearch._types.ErrorResponse; -import org.opensearch.client.transport.Endpoint; -import org.opensearch.client.transport.endpoints.SimpleEndpoint; -import org.opensearch.client.util.ApiTypeHelper; -import org.opensearch.client.util.ObjectBuilder; - -// typedef: cat.allocation.Request - -/** - * Provides a snapshot of how many shards are allocated to each data node and - * how much disk space they are using. - * - */ - -public class AllocationRequest extends CatRequestBase { - @Nullable - private final Bytes bytes; - - private final List nodeId; - - // --------------------------------------------------------------------------------------------- - - private AllocationRequest(Builder builder) { - super(builder); - this.bytes = builder.bytes; - this.nodeId = ApiTypeHelper.unmodifiable(builder.nodeId); - - } - - public static AllocationRequest of(Function> fn) { - return fn.apply(new Builder()).build(); - } - - /** - * The unit in which to display byte values - *

- * API name: {@code bytes} - */ - @Nullable - public final Bytes bytes() { - return this.bytes; - } - - /** - * A comma-separated list of node IDs or names to limit the returned information - *

- * API name: {@code node_id} - */ - public final List nodeId() { - return this.nodeId; - } - - // --------------------------------------------------------------------------------------------- - - /** - * Builder for {@link AllocationRequest}. - */ - - public static class Builder extends CatRequestBaseBuilder { - @Nullable - private Bytes bytes; - - @Nullable - private List nodeId; - - /** - * The unit in which to display byte values - *

- * API name: {@code bytes} - */ - public final Builder bytes(@Nullable Bytes value) { - this.bytes = value; - return this; - } - - /** - * A comma-separated list of node IDs or names to limit the returned information - *

- * API name: {@code node_id} - *

- * Adds all elements of list to nodeId. - */ - public final Builder nodeId(List list) { - this.nodeId = _listAddAll(this.nodeId, list); - return this; - } - - /** - * A comma-separated list of node IDs or names to limit the returned information - *

- * API name: {@code node_id} - *

- * Adds one or more values to nodeId. - */ - public final Builder nodeId(String value, String... values) { - this.nodeId = _listAdd(this.nodeId, value, values); - return this; - } - - /** - * Builds a {@link AllocationRequest}. - * - * @throws NullPointerException - * if some of the required fields are null. - */ - public AllocationRequest build() { - _checkSingleUse(); - - return new AllocationRequest(this); - } - - @Override - protected Builder self() { - return this; - } - } - - // --------------------------------------------------------------------------------------------- - - /** - * Endpoint "{@code cat.allocation}". - */ - public static final Endpoint _ENDPOINT = new SimpleEndpoint<>( - - // Request method - request -> { - return "GET"; - - }, - - // Request path - request -> { - final int _nodeId = 1 << 0; - - int propsSet = 0; - - if (ApiTypeHelper.isDefined(request.nodeId())) propsSet |= _nodeId; - - if (propsSet == 0) { - StringBuilder buf = new StringBuilder(); - buf.append("/_cat"); - buf.append("/allocation"); - return buf.toString(); - } - if (propsSet == (_nodeId)) { - StringBuilder buf = new StringBuilder(); - buf.append("/_cat"); - buf.append("/allocation"); - buf.append("/"); - SimpleEndpoint.pathEncode(request.nodeId.stream().map(v -> v).collect(Collectors.joining(",")), buf); - return buf.toString(); - } - throw SimpleEndpoint.noPathTemplateFound("path"); - - }, - - // Request parameters - request -> { - Map params = new HashMap<>(request.queryParameters()); - if (request.bytes != null) { - params.put("bytes", request.bytes.jsonValue()); - } - return params; - - }, - SimpleEndpoint.emptyMap(), - false, - AllocationResponse._DESERIALIZER - ); -} diff --git a/java-client/src/main/java/org/opensearch/client/opensearch/cat/OpenSearchCatAsyncClient.java b/java-client/src/main/java/org/opensearch/client/opensearch/cat/OpenSearchCatAsyncClient.java index 6adc082d46..f2f7cce3b1 100644 --- a/java-client/src/main/java/org/opensearch/client/opensearch/cat/OpenSearchCatAsyncClient.java +++ b/java-client/src/main/java/org/opensearch/client/opensearch/cat/OpenSearchCatAsyncClient.java @@ -61,55 +61,6 @@ public OpenSearchCatAsyncClient withTransportOptions(@Nullable TransportOptions return new OpenSearchCatAsyncClient(this.transport, transportOptions); } - // ----- Endpoint: cat.allocation - - /** - * Provides a snapshot of how many shards are allocated to each data node and - * how much disk space they are using. - * - * - */ - - public CompletableFuture allocation(AllocationRequest request) throws IOException, OpenSearchException { - @SuppressWarnings("unchecked") - JsonEndpoint endpoint = (JsonEndpoint< - AllocationRequest, - AllocationResponse, - ErrorResponse>) AllocationRequest._ENDPOINT; - - return this.transport.performRequestAsync(request, endpoint, this.transportOptions); - } - - /** - * Provides a snapshot of how many shards are allocated to each data node and - * how much disk space they are using. - * - * @param fn - * a function that initializes a builder to create the - * {@link AllocationRequest} - * - */ - - public final CompletableFuture allocation(Function> fn) - throws IOException, OpenSearchException { - return allocation(fn.apply(new AllocationRequest.Builder()).build()); - } - - /** - * Provides a snapshot of how many shards are allocated to each data node and - * how much disk space they are using. - * - * - */ - - public CompletableFuture allocation() throws IOException, OpenSearchException { - return this.transport.performRequestAsync( - new AllocationRequest.Builder().build(), - AllocationRequest._ENDPOINT, - this.transportOptions - ); - } - // ----- Endpoint: cat.count /** diff --git a/java-client/src/main/java/org/opensearch/client/opensearch/cat/OpenSearchCatClient.java b/java-client/src/main/java/org/opensearch/client/opensearch/cat/OpenSearchCatClient.java index b6fb6c5ede..9d918654fa 100644 --- a/java-client/src/main/java/org/opensearch/client/opensearch/cat/OpenSearchCatClient.java +++ b/java-client/src/main/java/org/opensearch/client/opensearch/cat/OpenSearchCatClient.java @@ -60,51 +60,6 @@ public OpenSearchCatClient withTransportOptions(@Nullable TransportOptions trans return new OpenSearchCatClient(this.transport, transportOptions); } - // ----- Endpoint: cat.allocation - - /** - * Provides a snapshot of how many shards are allocated to each data node and - * how much disk space they are using. - * - * - */ - - public AllocationResponse allocation(AllocationRequest request) throws IOException, OpenSearchException { - @SuppressWarnings("unchecked") - JsonEndpoint endpoint = (JsonEndpoint< - AllocationRequest, - AllocationResponse, - ErrorResponse>) AllocationRequest._ENDPOINT; - - return this.transport.performRequest(request, endpoint, this.transportOptions); - } - - /** - * Provides a snapshot of how many shards are allocated to each data node and - * how much disk space they are using. - * - * @param fn - * a function that initializes a builder to create the - * {@link AllocationRequest} - * - */ - - public final AllocationResponse allocation(Function> fn) throws IOException, - OpenSearchException { - return allocation(fn.apply(new AllocationRequest.Builder()).build()); - } - - /** - * Provides a snapshot of how many shards are allocated to each data node and - * how much disk space they are using. - * - * - */ - - public AllocationResponse allocation() throws IOException, OpenSearchException { - return this.transport.performRequest(new AllocationRequest.Builder().build(), AllocationRequest._ENDPOINT, this.transportOptions); - } - // ----- Endpoint: cat.count /** diff --git a/java-codegen/opensearch-openapi.yaml b/java-codegen/opensearch-openapi.yaml index 04e06395d6..bc8ea49dfc 100644 --- a/java-codegen/opensearch-openapi.yaml +++ b/java-codegen/opensearch-openapi.yaml @@ -4734,6 +4734,39 @@ paths: - $ref: '#/components/parameters/_global___query.error_trace' - $ref: '#/components/parameters/_global___query.source' - $ref: '#/components/parameters/_global___query.filter_path' + /_plugins/_ml/connectors/_search: + get: + operationId: ml.search_connectors.0 + x-operation-group: ml.search_connectors + x-version-added: '2.11' + description: Searches for standalone connectors. + requestBody: + $ref: '#/components/requestBodies/ml.search_connectors' + responses: + '200': + $ref: '#/components/responses/ml.search_connectors___200' + parameters: + - $ref: '#/components/parameters/_global___query.pretty' + - $ref: '#/components/parameters/_global___query.human' + - $ref: '#/components/parameters/_global___query.error_trace' + - $ref: '#/components/parameters/_global___query.source' + - $ref: '#/components/parameters/_global___query.filter_path' + post: + operationId: ml.search_connectors.1 + x-operation-group: ml.search_connectors + x-version-added: '2.11' + description: Searches for standalone connectors. + requestBody: + $ref: '#/components/requestBodies/ml.search_connectors' + responses: + '200': + $ref: '#/components/responses/ml.search_connectors___200' + parameters: + - $ref: '#/components/parameters/_global___query.pretty' + - $ref: '#/components/parameters/_global___query.human' + - $ref: '#/components/parameters/_global___query.error_trace' + - $ref: '#/components/parameters/_global___query.source' + - $ref: '#/components/parameters/_global___query.filter_path' /_plugins/_ml/connectors/{connector_id}: delete: operationId: ml.delete_connector.0 @@ -4749,6 +4782,38 @@ paths: responses: '200': $ref: '#/components/responses/ml.delete_connector___200' + get: + operationId: ml.get_connector.0 + x-operation-group: ml.get_connector + x-version-added: '2.11' + description: Retrieves a standalone connector. + parameters: + - $ref: '#/components/parameters/ml.get_connector___path.connector_id' + - $ref: '#/components/parameters/_global___query.pretty' + - $ref: '#/components/parameters/_global___query.human' + - $ref: '#/components/parameters/_global___query.error_trace' + - $ref: '#/components/parameters/_global___query.source' + - $ref: '#/components/parameters/_global___query.filter_path' + responses: + '200': + $ref: '#/components/responses/ml.get_connector___200' + put: + operationId: ml.update_connector.0 + x-operation-group: ml.update_connector + x-version-added: '2.12' + description: Updates a standalone connector. + parameters: + - $ref: '#/components/parameters/ml.update_connector___path.connector_id' + - $ref: '#/components/parameters/_global___query.pretty' + - $ref: '#/components/parameters/_global___query.human' + - $ref: '#/components/parameters/_global___query.error_trace' + - $ref: '#/components/parameters/_global___query.source' + - $ref: '#/components/parameters/_global___query.filter_path' + requestBody: + $ref: '#/components/requestBodies/ml.update_connector' + responses: + '200': + $ref: '#/components/responses/ml.update_connector___200' /_plugins/_ml/model_groups/_register: post: operationId: ml.register_model_group.0 @@ -4765,6 +4830,39 @@ paths: - $ref: '#/components/parameters/_global___query.error_trace' - $ref: '#/components/parameters/_global___query.source' - $ref: '#/components/parameters/_global___query.filter_path' + /_plugins/_ml/model_groups/_search: + get: + operationId: ml.search_model_group.0 + x-operation-group: ml.search_model_group + x-version-added: '2.9' + description: Searches for model groups. + requestBody: + $ref: '#/components/requestBodies/ml.search_model_group' + responses: + '200': + $ref: '#/components/responses/ml.search_model_group___200' + parameters: + - $ref: '#/components/parameters/_global___query.pretty' + - $ref: '#/components/parameters/_global___query.human' + - $ref: '#/components/parameters/_global___query.error_trace' + - $ref: '#/components/parameters/_global___query.source' + - $ref: '#/components/parameters/_global___query.filter_path' + post: + operationId: ml.search_model_group.1 + x-operation-group: ml.search_model_group + x-version-added: '2.9' + description: Searches for model groups. + requestBody: + $ref: '#/components/requestBodies/ml.search_model_group' + responses: + '200': + $ref: '#/components/responses/ml.search_model_group___200' + parameters: + - $ref: '#/components/parameters/_global___query.pretty' + - $ref: '#/components/parameters/_global___query.human' + - $ref: '#/components/parameters/_global___query.error_trace' + - $ref: '#/components/parameters/_global___query.source' + - $ref: '#/components/parameters/_global___query.filter_path' /_plugins/_ml/model_groups/{model_group_id}: delete: operationId: ml.delete_model_group.0 @@ -4794,6 +4892,23 @@ paths: responses: '200': $ref: '#/components/responses/ml.get_model_group___200' + put: + operationId: ml.update_model_group.0 + x-operation-group: ml.update_model_group + x-version-added: '2.9' + description: Updates a model group. + parameters: + - $ref: '#/components/parameters/ml.update_model_group___path.model_group_id' + - $ref: '#/components/parameters/_global___query.pretty' + - $ref: '#/components/parameters/_global___query.human' + - $ref: '#/components/parameters/_global___query.error_trace' + - $ref: '#/components/parameters/_global___query.source' + - $ref: '#/components/parameters/_global___query.filter_path' + requestBody: + $ref: '#/components/requestBodies/ml.update_model_group' + responses: + '200': + $ref: '#/components/responses/ml.update_model_group___200' /_plugins/_ml/models/_register: post: operationId: ml.register_model.0 @@ -22924,6 +23039,12 @@ components: required: true schema: type: string + ml.get_connector___path.connector_id: + name: connector_id + in: path + required: true + schema: + type: string ml.get_model_group___path.model_group_id: name: model_group_id in: path @@ -22966,6 +23087,18 @@ components: required: true schema: type: string + ml.update_connector___path.connector_id: + name: connector_id + in: path + required: true + schema: + type: string + ml.update_model_group___path.model_group_id: + name: model_group_id + in: path + required: true + schema: + type: string msearch_template___path.index: in: path name: index @@ -27141,6 +27274,9 @@ components: type: integer protocol: type: string + enum: + - aws_sigv4 + - http credential: $ref: '#/components/schemas/ml._common___Credential' parameters: @@ -27269,6 +27405,39 @@ components: description: The add all backend roles. required: - name + ml.search_connectors: + content: + application/json: + schema: + type: object + properties: + query: + $ref: '#/components/schemas/ml._common___Query' + size: + type: integer + description: The number of connectors to return. + sort: + type: array + items: + type: string + description: The sort order. + ml.search_model_group: + content: + application/json: + schema: + type: object + properties: + query: + $ref: '#/components/schemas/ml._common___Query' + size: + type: integer + format: int64 + description: The number of model groups to return. + sort: + type: array + items: + $ref: '#/components/schemas/ml._common___Sort' + description: The sort order. ml.search_models: content: application/json: @@ -27277,13 +27446,16 @@ components: properties: query: type: object - description: The query. + $ref: '#/components/schemas/ml._common___Query' size: type: integer + format: int64 description: The number of models to return. - required: - - query - - size + sort: + type: array + items: + $ref: '#/components/schemas/ml._common___Sort' + description: The sort order. ml.train: content: application/json: @@ -27316,6 +27488,76 @@ components: type: string input_data: $ref: '#/components/schemas/ml._common___PredictionResult' + ml.update_connector: + content: + application/json: + schema: + type: object + properties: + name: + $ref: '#/components/schemas/_common___Name' + description: + type: string + description: The connector description. + version: + $ref: '#/components/schemas/_common___VersionNumber' + protocol: + type: string + description: The connector protocol. + enum: + - aws_sigv4 + - http + parameters: + $ref: '#/components/schemas/ml._common___Parameters' + credential: + $ref: '#/components/schemas/ml._common___Credential' + actions: + type: array + items: + $ref: '#/components/schemas/ml._common___Action' + backend_roles: + type: array + items: + type: string + description: The backend roles. + access_mode: + type: string + description: The model group access mode. + enum: + - private + - public + - restricted + parameters.skip_validating_missing_parameters: + type: boolean + description: Whether to skip validating missing parameters. + ml.update_model_group: + content: + application/json: + schema: + type: object + properties: + name: + type: string + description: The model group name. + description: + type: string + description: The model group description. + add_all_backend_roles: + type: boolean + description: Whether to include all backend roles. + model_access_name: + type: string + description: The model access name + backend_roles: + type: array + items: + type: string + description: The backend roles. + add_backend_roles: + type: array + items: + type: string + description: The backend roles to add. msearch: content: application/x-ndjson: @@ -30358,6 +30600,12 @@ components: - status - task_id description: '' + ml.get_connector___200: + content: + application/json: + schema: + $ref: '#/components/schemas/ml._common___GetConnectorResponse' + description: '' ml.get_model_group___200: content: application/json: @@ -30405,6 +30653,18 @@ components: - status - task_id description: '' + ml.search_connectors___200: + content: + application/json: + schema: + $ref: '#/components/schemas/ml._common___SearchConnectorsResponse' + description: '' + ml.search_model_group___200: + content: + application/json: + schema: + $ref: '#/components/schemas/ml._common___SearchModelGroupsResponse' + description: '' ml.search_models___200: content: application/json: @@ -30429,6 +30689,18 @@ components: schema: $ref: '#/components/schemas/ml._common___UndeployModelResponse' description: '' + ml.update_connector___200: + content: + application/json: + schema: + $ref: '#/components/schemas/_common___WriteResponseBase' + description: '' + ml.update_model_group___200: + content: + application/json: + schema: + $ref: '#/components/schemas/ml._common___UpdateModelGroupResponse' + description: '' msearch_template___200: content: application/json: @@ -32486,19 +32758,35 @@ components: type: integer format: int64 _common___ByteUnit: - type: string - enum: - - b - - g - - gb - - k - - kb - - m - - mb - - p - - pb - - t - - tb + oneOf: + - title: bytes + type: string + const: b + - title: kilo_bytes + type: string + enum: + - kb + - k + - title: mega_bytes + type: string + enum: + - mb + - m + - title: giga_bytes + type: string + enum: + - gb + - g + - title: tera_bytes + type: string + enum: + - tb + - t + - title: peta_bytes + type: string + enum: + - pb + - p _common___ClusterDetails: type: object properties: @@ -53862,6 +54150,33 @@ components: type: string post_process_function: type: string + ml._common___Algorithm: + type: object + description: The algorithm. + properties: + value: + type: string + description: The function name. + enum: + - AD_LIBSVM + - AGENT + - ANOMALY_LOCALIZATION + - BATCH_RCF + - CONNECTOR + - FIT_RCF + - KMEANS + - LINEAR_REGRESSION + - LOCAL_SAMPLE_CALCULATOR + - LOGISTIC_REGRESSION + - METRICS_CORRELATION + - QUESTION_ANSWERING + - RCF_SUMMARIZE + - REMOTE + - SAMPLE_ALGO + - SPARSE_ENCODING + - SPARSE_TOKENIZE + - TEXT_EMBEDDING + - TEXT_SIMILARITY ml._common___BoolQuery: type: object description: The Boolean query. @@ -53871,6 +54186,19 @@ components: description: Filter query that appears in matching documents. items: $ref: '#/components/schemas/ml._common___Filter' + must: + type: array + description: Query that must appears in matching documents + items: + $ref: '#/components/schemas/ml._common___Filter' + must_not: + description: Query that must not appears in matching documents. + $ref: '#/components/schemas/ml._common___Filter' + should: + type: array + description: Query that should appear in matching documents. + items: + $ref: '#/components/schemas/ml._common___Filter' ml._common___ByteBuffer: type: object properties: @@ -53923,12 +54251,58 @@ components: session_token: type: string additionalProperties: true + ml._common___Exists: + type: object + description: The exists filter. + properties: + field: + $ref: '#/components/schemas/_common___Field' ml._common___Filter: type: object description: The filter element. properties: range: $ref: '#/components/schemas/ml._common___Range' + nested: + $ref: '#/components/schemas/ml._common___Nested' + exists: + $ref: '#/components/schemas/ml._common___Exists' + term: + $ref: '#/components/schemas/ml._common___Term' + terms: + $ref: '#/components/schemas/ml._common___Term' + match: + $ref: '#/components/schemas/ml._common___Match' + ml._common___GetConnectorResponse: + type: object + properties: + name: + $ref: '#/components/schemas/_common___Name' + version: + $ref: '#/components/schemas/_common___VersionString' + description: + type: string + description: The connector description. + protocol: + type: string + description: The connector protocol. + enum: + - aws_sigv4 + - http + parameters: + $ref: '#/components/schemas/ml._common___Parameters' + actions: + type: array + items: + $ref: '#/components/schemas/ml._common___Action' + created_time: + type: integer + format: int64 + description: The created time. + last_updated_time: + type: integer + format: int64 + description: The last updated time. ml._common___Headers: type: object properties: @@ -53992,6 +54366,17 @@ components: type: string parameters: $ref: '#/components/schemas/ml._common___Parameters' + ml._common___Match: + type: object + description: Match query. + properties: + description: + type: string + description: The description. + ml._common___MatchAllQuery: + type: object + description: The match all query. + properties: {} ml._common___Memory: type: object properties: @@ -54025,9 +54410,15 @@ components: description: type: string description: The model group description. + owner: + $ref: '#/components/schemas/ml._common___Owner' access: type: string description: The model group access. + enum: + - private + - public + - restricted created_time: type: integer format: int64 @@ -54051,6 +54442,29 @@ components: required: - model_group_id - status + ml._common___Nested: + type: object + description: The nested filter. + properties: + query: + $ref: '#/components/schemas/ml._common___Query' + path: + $ref: '#/components/schemas/_common___Field' + ignore_unmapped: + type: boolean + description: Whether to ignore unmapped fields. + score_mode: + type: string + description: The score mode. + enum: + - avg + - max + - min + - none + - sum + boost: + type: number + description: Adjust the relevance score of a match. ml._common___Output: type: object properties: @@ -54087,6 +54501,42 @@ components: $ref: '#/components/schemas/ml._common___ByteBuffer' required: - data + ml._common___Owner: + type: object + properties: + name: + $ref: '#/components/schemas/_common___Name' + backend_roles: + type: array + items: + type: string + description: The backend roles. + roles: + type: array + items: + type: string + description: The roles. + custom_attribute_names: + type: array + items: + type: string + description: The custom attribute names. + user_requested_tenant: + type: + - 'null' + - string + description: The user requested tenant. + required: + - name + ml._common___OwnerNameKeyword: + type: object + description: The owner name keyword. + properties: + value: + $ref: '#/components/schemas/_common___FieldValue' + boost: + type: number + description: Adjust the relevance score of a match. ml._common___Parameters: type: object additionalProperties: true @@ -54118,6 +54568,10 @@ components: properties: bool: $ref: '#/components/schemas/ml._common___BoolQuery' + match_all: + $ref: '#/components/schemas/ml._common___MatchAllQuery' + term: + $ref: '#/components/schemas/ml._common___Term' ml._common___Range: type: object description: The filter range. @@ -54135,7 +54589,9 @@ components: type: array items: $ref: '#/components/schemas/ml._common___Values' - ml._common___SearchModelsHits: + ml._common___SearchConnectorsResponse: + $ref: '#/components/schemas/ml._common___SearchResponse' + ml._common___SearchHits: type: object properties: total: @@ -54143,7 +54599,7 @@ components: hits: type: array items: - $ref: '#/components/schemas/ml._common___SearchModelsHitsHit' + $ref: '#/components/schemas/ml._common___SearchHitsHit' max_score: type: number format: float @@ -54151,7 +54607,7 @@ components: required: - hits - total - ml._common___SearchModelsHitsHit: + ml._common___SearchHitsHit: type: object properties: _version: @@ -54175,7 +54631,11 @@ components: $ref: '#/components/schemas/_common___Name' required: - _score + ml._common___SearchModelGroupsResponse: + $ref: '#/components/schemas/ml._common___SearchResponse' ml._common___SearchModelsResponse: + $ref: '#/components/schemas/ml._common___SearchResponse' + ml._common___SearchResponse: type: object properties: took: @@ -54187,9 +54647,67 @@ components: _shards: $ref: '#/components/schemas/_common___ShardStatistics' hits: - $ref: '#/components/schemas/ml._common___SearchModelsHits' + $ref: '#/components/schemas/ml._common___SearchHits' required: - hits + ml._common___Sort: + type: object + description: Sort query. + properties: + algorithm: + $ref: '#/components/schemas/ml._common___SortOrder' + auto_redeploy_retry_times: + $ref: '#/components/schemas/ml._common___SortOrder' + chunk_number: + $ref: '#/components/schemas/ml._common___SortOrder' + created_time: + $ref: '#/components/schemas/ml._common___SortOrder' + current_worker_node_count: + $ref: '#/components/schemas/ml._common___SortOrder' + deploy_to_all_nodes: + $ref: '#/components/schemas/ml._common___SortOrder' + is_hidden: + $ref: '#/components/schemas/ml._common___SortOrder' + last_registered_time: + $ref: '#/components/schemas/ml._common___SortOrder' + last_updated_time: + $ref: '#/components/schemas/ml._common___SortOrder' + model_content_hash_value: + $ref: '#/components/schemas/ml._common___SortOrder' + model_content_size_in_bytes: + $ref: '#/components/schemas/ml._common___SortOrder' + model_format: + $ref: '#/components/schemas/ml._common___SortOrder' + model_group_id: + $ref: '#/components/schemas/ml._common___SortOrder' + model_state: + $ref: '#/components/schemas/ml._common___SortOrder' + model_version: + $ref: '#/components/schemas/ml._common___SortOrder' + planning_worker_nodes: + $ref: '#/components/schemas/ml._common___SortOrder' + planning_worker_node_count: + $ref: '#/components/schemas/ml._common___SortOrder' + total_chunks: + $ref: '#/components/schemas/ml._common___SortOrder' + _index: + $ref: '#/components/schemas/ml._common___SortOrder' + _id: + $ref: '#/components/schemas/ml._common___SortOrder' + _seq_no: + $ref: '#/components/schemas/ml._common___SortOrder' + _score: + $ref: '#/components/schemas/ml._common___SortOrder' + ml._common___SortOrder: + type: object + description: The order of the sort. + properties: + order: + type: string + description: The order. + enum: + - asc + - desc ml._common___Source: type: object properties: @@ -54231,6 +54749,7 @@ components: - PARTIALLY_DEPLOYED - REGISTERED - REGISTERING + - UNDEPLOYED model_content_size_in_bytes: type: integer format: int64 @@ -54287,6 +54806,35 @@ components: url: type: string description: The model URL. + backend_roles: + type: array + items: + type: string + description: The backend roles. + owner: + $ref: '#/components/schemas/ml._common___Owner' + access: + type: string + description: The model group access. + enum: + - private + - public + - restricted + latest_version: + type: integer + description: The latest version. + protocol: + type: string + description: The connector protocol. + enum: + - aws_sigv4 + - http + parameters: + $ref: '#/components/schemas/ml._common___Parameters' + actions: + type: array + items: + $ref: '#/components/schemas/ml._common___Action' ml._common___Status: type: string description: The status. @@ -54339,6 +54887,20 @@ components: type: string required: - state + ml._common___Term: + type: object + description: Term to match the query. + properties: + algorithm: + $ref: '#/components/schemas/ml._common___Algorithm' + _id: + type: array + items: + $ref: '#/components/schemas/_common___Id' + model_id: + $ref: '#/components/schemas/_common___Name' + owner.name.keyword: + $ref: '#/components/schemas/ml._common___OwnerNameKeyword' ml._common___ToolItems: type: object properties: @@ -54398,6 +54960,12 @@ components: additionalProperties: title: nodes $ref: '#/components/schemas/ml._common___UndeployModelNode' + ml._common___UpdateModelGroupResponse: + type: object + properties: + status: + type: string + description: The status. ml._common___Values: type: object properties: diff --git a/java-codegen/src/main/java/org/opensearch/client/codegen/CodeGenerator.java b/java-codegen/src/main/java/org/opensearch/client/codegen/CodeGenerator.java index 1d8155270b..977086758f 100644 --- a/java-codegen/src/main/java/org/opensearch/client/codegen/CodeGenerator.java +++ b/java-codegen/src/main/java/org/opensearch/client/codegen/CodeGenerator.java @@ -13,9 +13,9 @@ import static org.opensearch.client.codegen.utils.matcher.Matcher.and; import static org.opensearch.client.codegen.utils.matcher.Matcher.is; import static org.opensearch.client.codegen.utils.matcher.Matcher.isNot; -import static org.opensearch.client.codegen.utils.matcher.Matcher.isNotOneOf; import static org.opensearch.client.codegen.utils.matcher.Matcher.isNull; import static org.opensearch.client.codegen.utils.matcher.Matcher.isOneOf; +import static org.opensearch.client.codegen.utils.matcher.Matcher.not; import static org.opensearch.client.codegen.utils.matcher.Matcher.or; import static org.opensearch.client.codegen.utils.matcher.StringMatcher.contains; @@ -48,7 +48,7 @@ public class CodeGenerator { private static final Logger LOGGER = LogManager.getLogger(); private static final Matcher OPERATION_MATCHER = or( and(namespace(isNull()), name(is("info"))), - and(namespace(is("cat")), name(isOneOf("aliases"))), + and(namespace(is("cat")), name(isOneOf("aliases", "allocation"))), and( namespace(is("cluster")), name( @@ -67,7 +67,12 @@ public class CodeGenerator { namespace(is("ml")), name( // TODO: search_models is complex and ideally should re-use the search structures - isNotOneOf("predict", "search_models", "train", "train_predict") + not(or( + contains("predict"), + contains("search"), + contains("train"), + isOneOf("get_connector", "update_connector", "update_model_group") + )) ) ), and( diff --git a/java-codegen/src/main/java/org/opensearch/client/codegen/model/SpecTransformer.java b/java-codegen/src/main/java/org/opensearch/client/codegen/model/SpecTransformer.java index 931c52d8b0..30d1f10d40 100644 --- a/java-codegen/src/main/java/org/opensearch/client/codegen/model/SpecTransformer.java +++ b/java-codegen/src/main/java/org/opensearch/client/codegen/model/SpecTransformer.java @@ -705,6 +705,7 @@ private Type mapOneOf(List oneOf) { } var types = OpenApiSchema.determineTypes(oneOf); + types.remove(OpenApiSchemaType.Null); if (types.size() == 1) { switch (types.iterator().next()) { diff --git a/java-codegen/src/main/java/org/opensearch/client/codegen/model/overrides/Overrides.java b/java-codegen/src/main/java/org/opensearch/client/codegen/model/overrides/Overrides.java index 46fb33c999..980f832f1e 100644 --- a/java-codegen/src/main/java/org/opensearch/client/codegen/model/overrides/Overrides.java +++ b/java-codegen/src/main/java/org/opensearch/client/codegen/model/overrides/Overrides.java @@ -43,7 +43,8 @@ private static JsonPointer schema(String namespace, String name) { ) ) .withSchemas( - s -> s.with(schema("_common", "Duration"), so -> so.withMappedType(Types.Client.OpenSearch._Types.Time)) + s -> s.with(schema("_common", "ByteUnit"), so -> so.withClassName("Bytes")) + .with(schema("_common", "Duration"), so -> so.withMappedType(Types.Client.OpenSearch._Types.Time)) .with(schema("_common", "FieldValue"), so -> so.withMappedType(Types.Client.OpenSearch._Types.FieldValue)) .with(schema("_common", "StringifiedBoolean"), so -> so.withMappedType(Types.Primitive.Boolean)) .with(schema("_common", "StringifiedDouble"), so -> so.withMappedType(Types.Primitive.Double)) From b10defba6afc6b0673bd8e4b656e08f07fd9a526 Mon Sep 17 00:00:00 2001 From: Thomas Farr Date: Tue, 7 Jan 2025 16:56:42 +1300 Subject: [PATCH 03/18] Generate cat.cluster_manager & cat.master Signed-off-by: Thomas Farr --- .../opensearch/cat/ClusterManagerRequest.java | 264 +++++++++++++++ .../cat/ClusterManagerResponse.java | 77 +++-- .../client/opensearch/cat/MasterRequest.java | 262 +++++++++++++++ .../client/opensearch/cat/MasterResponse.java | 190 +++++++++++ .../cat/OpenSearchCatAsyncClientBase.java | 56 ++++ .../cat/OpenSearchCatClientBase.java | 55 ++++ .../cluster_manager/ClusterManagerRecord.java | 157 ++++++--- .../opensearch/cat/master/MasterRecord.java | 310 ++++++++++++++++++ .../opensearch/cat/ClusterManagerRequest.java | 104 ------ .../cat/OpenSearchCatAsyncClient.java | 27 -- .../opensearch/cat/OpenSearchCatClient.java | 27 -- .../client/codegen/CodeGenerator.java | 2 +- 12 files changed, 1307 insertions(+), 224 deletions(-) create mode 100644 java-client/src/generated/java/org/opensearch/client/opensearch/cat/ClusterManagerRequest.java rename java-client/src/{main => generated}/java/org/opensearch/client/opensearch/cat/ClusterManagerResponse.java (75%) create mode 100644 java-client/src/generated/java/org/opensearch/client/opensearch/cat/MasterRequest.java create mode 100644 java-client/src/generated/java/org/opensearch/client/opensearch/cat/MasterResponse.java rename java-client/src/{main => generated}/java/org/opensearch/client/opensearch/cat/cluster_manager/ClusterManagerRecord.java (70%) create mode 100644 java-client/src/generated/java/org/opensearch/client/opensearch/cat/master/MasterRecord.java delete mode 100644 java-client/src/main/java/org/opensearch/client/opensearch/cat/ClusterManagerRequest.java diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/cat/ClusterManagerRequest.java b/java-client/src/generated/java/org/opensearch/client/opensearch/cat/ClusterManagerRequest.java new file mode 100644 index 0000000000..2c819cbbe2 --- /dev/null +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/cat/ClusterManagerRequest.java @@ -0,0 +1,264 @@ +/* + * SPDX-License-Identifier: Apache-2.0 + * + * The OpenSearch Contributors require contributions made to + * this file be licensed under the Apache-2.0 license or a + * compatible open source license. + */ + +/* + * Licensed to Elasticsearch B.V. under one or more contributor + * license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright + * ownership. Elasticsearch B.V. licenses this file to you under + * the Apache License, Version 2.0 (the "License"); you may + * not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +/* + * Modifications Copyright OpenSearch Contributors. See + * GitHub history for details. + */ + +//---------------------------------------------------- +// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. +//---------------------------------------------------- + +package org.opensearch.client.opensearch.cat; + +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.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.ToCopyableBuilder; + +// typedef: cat.cluster_manager.Request + +/** + * Returns information about the cluster-manager node. + */ +@Generated("org.opensearch.client.codegen.CodeGenerator") +public final class ClusterManagerRequest extends CatRequestBase + implements + ToCopyableBuilder { + + @Nullable + private final Time clusterManagerTimeout; + + @Deprecated + @Nullable + private final Time masterTimeout; + + // --------------------------------------------------------------------------------------------- + + private ClusterManagerRequest(Builder builder) { + super(builder); + this.clusterManagerTimeout = builder.clusterManagerTimeout; + this.masterTimeout = builder.masterTimeout; + } + + public static ClusterManagerRequest of(Function> fn) { + return fn.apply(new Builder()).build(); + } + + /** + * A timeout for connection to the cluster manager node. + *

+ * API name: {@code cluster_manager_timeout} + *

+ */ + @Nullable + public final Time clusterManagerTimeout() { + return this.clusterManagerTimeout; + } + + /** + * A timeout for connection to the cluster manager node. + *

+ * API name: {@code master_timeout} + *

+ */ + @Deprecated + @Nullable + public final Time masterTimeout() { + return this.masterTimeout; + } + + // --------------------------------------------------------------------------------------------- + + @Override + @Nonnull + public Builder toBuilder() { + return new Builder(this); + } + + @Nonnull + public static Builder builder() { + return new Builder(); + } + + /** + * Builder for {@link ClusterManagerRequest}. + */ + public static class Builder extends CatRequestBase.AbstractBuilder implements CopyableBuilder { + @Nullable + private Time clusterManagerTimeout; + @Nullable + private Time masterTimeout; + + public Builder() {} + + private Builder(ClusterManagerRequest o) { + super(o); + this.clusterManagerTimeout = o.clusterManagerTimeout; + this.masterTimeout = o.masterTimeout; + } + + private Builder(Builder o) { + super(o); + this.clusterManagerTimeout = o.clusterManagerTimeout; + this.masterTimeout = o.masterTimeout; + } + + @Override + @Nonnull + public Builder copy() { + return new Builder(this); + } + + @Override + @Nonnull + protected Builder self() { + return this; + } + + /** + * A timeout for connection to the cluster manager node. + *

+ * API name: {@code cluster_manager_timeout} + *

+ */ + @Nonnull + public final Builder clusterManagerTimeout(@Nullable Time value) { + this.clusterManagerTimeout = value; + return this; + } + + /** + * A timeout for connection to the cluster manager node. + *

+ * API name: {@code cluster_manager_timeout} + *

+ */ + @Nonnull + public final Builder clusterManagerTimeout(Function> fn) { + return clusterManagerTimeout(fn.apply(new Time.Builder()).build()); + } + + /** + * A timeout for connection to the cluster manager node. + *

+ * API name: {@code master_timeout} + *

+ */ + @Deprecated + @Nonnull + public final Builder masterTimeout(@Nullable Time value) { + this.masterTimeout = value; + return this; + } + + /** + * A timeout for connection to the cluster manager node. + *

+ * API name: {@code master_timeout} + *

+ */ + @Deprecated + @Nonnull + public final Builder masterTimeout(Function> fn) { + return masterTimeout(fn.apply(new Time.Builder()).build()); + } + + /** + * Builds a {@link ClusterManagerRequest}. + * + * @throws NullPointerException if some of the required fields are null. + */ + @Override + @Nonnull + public ClusterManagerRequest build() { + _checkSingleUse(); + + return new ClusterManagerRequest(this); + } + } + + // --------------------------------------------------------------------------------------------- + + @Override + protected void applyQueryParameters(@Nonnull Map params) { + super.applyQueryParameters(params); + if (this.clusterManagerTimeout != null) { + params.put("cluster_manager_timeout", this.clusterManagerTimeout._toJsonString()); + } + if (this.masterTimeout != null) { + params.put("master_timeout", this.masterTimeout._toJsonString()); + } + } + + /** + * Endpoint "{@code cat.cluster_manager}". + */ + public static final Endpoint _ENDPOINT = new SimpleEndpoint<>( + // Request method + request -> "GET", + // Request path + request -> "/_cat/cluster_manager", + // Request parameters + request -> { + Map params = new HashMap<>(); + request.applyQueryParameters(params); + return params; + }, + SimpleEndpoint.emptyMap(), + false, + ClusterManagerResponse._DESERIALIZER + ); + + @Override + public int hashCode() { + int result = 17; + result = 31 * result + Objects.hashCode(this.clusterManagerTimeout); + result = 31 * result + Objects.hashCode(this.masterTimeout); + return result; + } + + @Override + public boolean equals(Object o) { + if (this == o) return true; + if (o == null || this.getClass() != o.getClass()) return false; + ClusterManagerRequest other = (ClusterManagerRequest) o; + return Objects.equals(this.clusterManagerTimeout, other.clusterManagerTimeout) + && Objects.equals(this.masterTimeout, other.masterTimeout); + } +} diff --git a/java-client/src/main/java/org/opensearch/client/opensearch/cat/ClusterManagerResponse.java b/java-client/src/generated/java/org/opensearch/client/opensearch/cat/ClusterManagerResponse.java similarity index 75% rename from java-client/src/main/java/org/opensearch/client/opensearch/cat/ClusterManagerResponse.java rename to java-client/src/generated/java/org/opensearch/client/opensearch/cat/ClusterManagerResponse.java index 2e85797fc9..67355ca6d1 100644 --- a/java-client/src/main/java/org/opensearch/client/opensearch/cat/ClusterManagerResponse.java +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/cat/ClusterManagerResponse.java @@ -30,43 +30,54 @@ * GitHub history for details. */ +//---------------------------------------------------- +// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. +//---------------------------------------------------- + package org.opensearch.client.opensearch.cat; 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; import org.opensearch.client.json.PlainJsonSerializable; import org.opensearch.client.opensearch.cat.cluster_manager.ClusterManagerRecord; 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: cat.cluster_manager.Response @JsonpDeserializable -public class ClusterManagerResponse implements PlainJsonSerializable { +@Generated("org.opensearch.client.codegen.CodeGenerator") +public class ClusterManagerResponse + implements + PlainJsonSerializable, + ToCopyableBuilder { + + @Nonnull private final List valueBody; // --------------------------------------------------------------------------------------------- private ClusterManagerResponse(Builder builder) { - this.valueBody = ApiTypeHelper.unmodifiableRequired(builder.valueBody, this, "valueBody"); - } - public static ClusterManagerResponse of(Function> fn) { + public static ClusterManagerResponse of(Function> fn) { return fn.apply(new Builder()).build(); } /** * Required - Response value. - *

- * API name: {@code _value_body} */ + @Nonnull public final List valueBody() { return this.valueBody; } @@ -78,28 +89,53 @@ public void serialize(JsonGenerator generator, JsonpMapper mapper) { generator.writeStartArray(); for (ClusterManagerRecord item0 : this.valueBody) { 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 ClusterManagerResponse}. */ - - public static class Builder extends ObjectBuilderBase implements ObjectBuilder { + public static class Builder extends ObjectBuilderBase implements CopyableBuilder { private List valueBody; + public Builder() {} + + private Builder(ClusterManagerResponse o) { + this.valueBody = _listCopy(o.valueBody); + } + + private Builder(Builder o) { + this.valueBody = _listCopy(o.valueBody); + } + + @Override + @Nonnull + public Builder copy() { + return new Builder(this); + } + /** * Required - Response value. - *

- * API name: {@code _value_body} + * *

* Adds all elements of list to valueBody. + *

*/ + @Nonnull public final Builder valueBody(List list) { this.valueBody = _listAddAll(this.valueBody, list); return this; @@ -107,11 +143,12 @@ public final Builder valueBody(List list) { /** * Required - Response value. - *

- * API name: {@code _value_body} + * *

* Adds one or more values to valueBody. + *

*/ + @Nonnull public final Builder valueBody(ClusterManagerRecord value, ClusterManagerRecord... values) { this.valueBody = _listAdd(this.valueBody, value, values); return this; @@ -119,11 +156,12 @@ public final Builder valueBody(ClusterManagerRecord value, ClusterManagerRecord. /** * Required - Response value. - *

- * API name: {@code _value_body} + * *

* Adds a value to valueBody using a builder lambda. + *

*/ + @Nonnull public final Builder valueBody(Function> fn) { return valueBody(fn.apply(new ClusterManagerRecord.Builder()).build()); } @@ -131,9 +169,10 @@ public final Builder valueBody(Function _DESERIALIZER = createClusterManagerResponseDeserializer(); protected static JsonpDeserializer createClusterManagerResponseDeserializer() { - JsonpDeserializer> valueDeserializer = JsonpDeserializer.arrayDeserializer( ClusterManagerRecord._DESERIALIZER ); @@ -154,5 +192,4 @@ protected static JsonpDeserializer createClusterManagerR (parser, mapper) -> new Builder().valueBody(valueDeserializer.deserialize(parser, mapper)).build() ); } - } diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/cat/MasterRequest.java b/java-client/src/generated/java/org/opensearch/client/opensearch/cat/MasterRequest.java new file mode 100644 index 0000000000..09c4923c36 --- /dev/null +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/cat/MasterRequest.java @@ -0,0 +1,262 @@ +/* + * SPDX-License-Identifier: Apache-2.0 + * + * The OpenSearch Contributors require contributions made to + * this file be licensed under the Apache-2.0 license or a + * compatible open source license. + */ + +/* + * Licensed to Elasticsearch B.V. under one or more contributor + * license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright + * ownership. Elasticsearch B.V. licenses this file to you under + * the Apache License, Version 2.0 (the "License"); you may + * not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +/* + * Modifications Copyright OpenSearch Contributors. See + * GitHub history for details. + */ + +//---------------------------------------------------- +// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. +//---------------------------------------------------- + +package org.opensearch.client.opensearch.cat; + +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.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.ToCopyableBuilder; + +// typedef: cat.master.Request + +/** + * Returns information about the cluster-manager node. + */ +@Generated("org.opensearch.client.codegen.CodeGenerator") +public final class MasterRequest extends CatRequestBase implements ToCopyableBuilder { + + @Nullable + private final Time clusterManagerTimeout; + + @Deprecated + @Nullable + private final Time masterTimeout; + + // --------------------------------------------------------------------------------------------- + + private MasterRequest(Builder builder) { + super(builder); + this.clusterManagerTimeout = builder.clusterManagerTimeout; + this.masterTimeout = builder.masterTimeout; + } + + public static MasterRequest of(Function> fn) { + return fn.apply(new Builder()).build(); + } + + /** + * The amount of time allowed to establish a connection to the cluster manager node. + *

+ * API name: {@code cluster_manager_timeout} + *

+ */ + @Nullable + public final Time clusterManagerTimeout() { + return this.clusterManagerTimeout; + } + + /** + * The amount of time allowed to establish a connection to the cluster manager node. + *

+ * API name: {@code master_timeout} + *

+ */ + @Deprecated + @Nullable + public final Time masterTimeout() { + return this.masterTimeout; + } + + // --------------------------------------------------------------------------------------------- + + @Override + @Nonnull + public Builder toBuilder() { + return new Builder(this); + } + + @Nonnull + public static Builder builder() { + return new Builder(); + } + + /** + * Builder for {@link MasterRequest}. + */ + public static class Builder extends CatRequestBase.AbstractBuilder implements CopyableBuilder { + @Nullable + private Time clusterManagerTimeout; + @Nullable + private Time masterTimeout; + + public Builder() {} + + private Builder(MasterRequest o) { + super(o); + this.clusterManagerTimeout = o.clusterManagerTimeout; + this.masterTimeout = o.masterTimeout; + } + + private Builder(Builder o) { + super(o); + this.clusterManagerTimeout = o.clusterManagerTimeout; + this.masterTimeout = o.masterTimeout; + } + + @Override + @Nonnull + public Builder copy() { + return new Builder(this); + } + + @Override + @Nonnull + protected Builder self() { + return this; + } + + /** + * The amount of time allowed to establish a connection to the cluster manager node. + *

+ * API name: {@code cluster_manager_timeout} + *

+ */ + @Nonnull + public final Builder clusterManagerTimeout(@Nullable Time value) { + this.clusterManagerTimeout = value; + return this; + } + + /** + * The amount of time allowed to establish a connection to the cluster manager node. + *

+ * API name: {@code cluster_manager_timeout} + *

+ */ + @Nonnull + public final Builder clusterManagerTimeout(Function> fn) { + return clusterManagerTimeout(fn.apply(new Time.Builder()).build()); + } + + /** + * The amount of time allowed to establish a connection to the cluster manager node. + *

+ * API name: {@code master_timeout} + *

+ */ + @Deprecated + @Nonnull + public final Builder masterTimeout(@Nullable Time value) { + this.masterTimeout = value; + return this; + } + + /** + * The amount of time allowed to establish a connection to the cluster manager node. + *

+ * API name: {@code master_timeout} + *

+ */ + @Deprecated + @Nonnull + public final Builder masterTimeout(Function> fn) { + return masterTimeout(fn.apply(new Time.Builder()).build()); + } + + /** + * Builds a {@link MasterRequest}. + * + * @throws NullPointerException if some of the required fields are null. + */ + @Override + @Nonnull + public MasterRequest build() { + _checkSingleUse(); + + return new MasterRequest(this); + } + } + + // --------------------------------------------------------------------------------------------- + + @Override + protected void applyQueryParameters(@Nonnull Map params) { + super.applyQueryParameters(params); + if (this.clusterManagerTimeout != null) { + params.put("cluster_manager_timeout", this.clusterManagerTimeout._toJsonString()); + } + if (this.masterTimeout != null) { + params.put("master_timeout", this.masterTimeout._toJsonString()); + } + } + + /** + * Endpoint "{@code cat.master}". + */ + public static final Endpoint _ENDPOINT = new SimpleEndpoint<>( + // Request method + request -> "GET", + // Request path + request -> "/_cat/master", + // Request parameters + request -> { + Map params = new HashMap<>(); + request.applyQueryParameters(params); + return params; + }, + SimpleEndpoint.emptyMap(), + false, + MasterResponse._DESERIALIZER + ); + + @Override + public int hashCode() { + int result = 17; + result = 31 * result + Objects.hashCode(this.clusterManagerTimeout); + result = 31 * result + Objects.hashCode(this.masterTimeout); + return result; + } + + @Override + public boolean equals(Object o) { + if (this == o) return true; + if (o == null || this.getClass() != o.getClass()) return false; + MasterRequest other = (MasterRequest) o; + return Objects.equals(this.clusterManagerTimeout, other.clusterManagerTimeout) + && Objects.equals(this.masterTimeout, other.masterTimeout); + } +} diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/cat/MasterResponse.java b/java-client/src/generated/java/org/opensearch/client/opensearch/cat/MasterResponse.java new file mode 100644 index 0000000000..46e124edd6 --- /dev/null +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/cat/MasterResponse.java @@ -0,0 +1,190 @@ +/* + * SPDX-License-Identifier: Apache-2.0 + * + * The OpenSearch Contributors require contributions made to + * this file be licensed under the Apache-2.0 license or a + * compatible open source license. + */ + +/* + * Licensed to Elasticsearch B.V. under one or more contributor + * license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright + * ownership. Elasticsearch B.V. licenses this file to you under + * the Apache License, Version 2.0 (the "License"); you may + * not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +/* + * Modifications Copyright OpenSearch Contributors. See + * GitHub history for details. + */ + +//---------------------------------------------------- +// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. +//---------------------------------------------------- + +package org.opensearch.client.opensearch.cat; + +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; +import org.opensearch.client.json.PlainJsonSerializable; +import org.opensearch.client.opensearch.cat.master.MasterRecord; +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: cat.master.Response + +@JsonpDeserializable +@Generated("org.opensearch.client.codegen.CodeGenerator") +public class MasterResponse implements PlainJsonSerializable, ToCopyableBuilder { + + @Nonnull + private final List valueBody; + + // --------------------------------------------------------------------------------------------- + + private MasterResponse(Builder builder) { + this.valueBody = ApiTypeHelper.unmodifiableRequired(builder.valueBody, this, "valueBody"); + } + + public static MasterResponse of(Function> fn) { + return fn.apply(new Builder()).build(); + } + + /** + * Required - Response value. + */ + @Nonnull + public final List valueBody() { + return this.valueBody; + } + + /** + * Serialize this value to JSON. + */ + public void serialize(JsonGenerator generator, JsonpMapper mapper) { + generator.writeStartArray(); + for (MasterRecord item0 : this.valueBody) { + 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 MasterResponse}. + */ + public static class Builder extends ObjectBuilderBase implements CopyableBuilder { + private List valueBody; + + public Builder() {} + + private Builder(MasterResponse o) { + this.valueBody = _listCopy(o.valueBody); + } + + private Builder(Builder o) { + this.valueBody = _listCopy(o.valueBody); + } + + @Override + @Nonnull + public Builder copy() { + return new Builder(this); + } + + /** + * Required - Response value. + * + *

+ * Adds all elements of list to valueBody. + *

+ */ + @Nonnull + public final Builder valueBody(List list) { + this.valueBody = _listAddAll(this.valueBody, list); + return this; + } + + /** + * Required - Response value. + * + *

+ * Adds one or more values to valueBody. + *

+ */ + @Nonnull + public final Builder valueBody(MasterRecord value, MasterRecord... values) { + this.valueBody = _listAdd(this.valueBody, value, values); + return this; + } + + /** + * Required - Response value. + * + *

+ * Adds a value to valueBody using a builder lambda. + *

+ */ + @Nonnull + public final Builder valueBody(Function> fn) { + return valueBody(fn.apply(new MasterRecord.Builder()).build()); + } + + /** + * Builds a {@link MasterResponse}. + * + * @throws NullPointerException if some of the required fields are null. + */ + @Override + @Nonnull + public MasterResponse build() { + _checkSingleUse(); + + return new MasterResponse(this); + } + } + + public static final JsonpDeserializer _DESERIALIZER = createMasterResponseDeserializer(); + + protected static JsonpDeserializer createMasterResponseDeserializer() { + JsonpDeserializer> valueDeserializer = JsonpDeserializer.arrayDeserializer(MasterRecord._DESERIALIZER); + + return JsonpDeserializer.of( + valueDeserializer.acceptedEvents(), + (parser, mapper) -> new Builder().valueBody(valueDeserializer.deserialize(parser, mapper)).build() + ); + } +} diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/cat/OpenSearchCatAsyncClientBase.java b/java-client/src/generated/java/org/opensearch/client/opensearch/cat/OpenSearchCatAsyncClientBase.java index 08ad680d21..631246e690 100644 --- a/java-client/src/generated/java/org/opensearch/client/opensearch/cat/OpenSearchCatAsyncClientBase.java +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/cat/OpenSearchCatAsyncClientBase.java @@ -109,4 +109,60 @@ public final CompletableFuture allocation(Function allocation() throws IOException, OpenSearchException { return allocation(new AllocationRequest.Builder().build()); } + + // ----- Endpoint: cat.cluster_manager + + /** + * Returns information about the cluster-manager node. + */ + public CompletableFuture clusterManager(ClusterManagerRequest request) throws IOException, OpenSearchException { + return this.transport.performRequestAsync(request, ClusterManagerRequest._ENDPOINT, this.transportOptions); + } + + /** + * Returns information about the cluster-manager node. + * + * @param fn a function that initializes a builder to create the {@link ClusterManagerRequest} + */ + public final CompletableFuture clusterManager( + Function> fn + ) throws IOException, OpenSearchException { + return clusterManager(fn.apply(new ClusterManagerRequest.Builder()).build()); + } + + /** + * Returns information about the cluster-manager node. + */ + public final CompletableFuture clusterManager() throws IOException, OpenSearchException { + return clusterManager(new ClusterManagerRequest.Builder().build()); + } + + // ----- Endpoint: cat.master + + /** + * Returns information about the cluster-manager node. + */ + @Deprecated + public CompletableFuture master(MasterRequest request) throws IOException, OpenSearchException { + return this.transport.performRequestAsync(request, MasterRequest._ENDPOINT, this.transportOptions); + } + + /** + * Returns information about the cluster-manager node. + * + * @param fn a function that initializes a builder to create the {@link MasterRequest} + */ + @Deprecated + public final CompletableFuture master(Function> fn) + throws IOException, OpenSearchException { + return master(fn.apply(new MasterRequest.Builder()).build()); + } + + /** + * Returns information about the cluster-manager node. + */ + @Deprecated + public final CompletableFuture master() throws IOException, OpenSearchException { + return master(new MasterRequest.Builder().build()); + } } diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/cat/OpenSearchCatClientBase.java b/java-client/src/generated/java/org/opensearch/client/opensearch/cat/OpenSearchCatClientBase.java index 003478c44f..a6051e4587 100644 --- a/java-client/src/generated/java/org/opensearch/client/opensearch/cat/OpenSearchCatClientBase.java +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/cat/OpenSearchCatClientBase.java @@ -106,4 +106,59 @@ public final AllocationResponse allocation(Function> fn) + throws IOException, OpenSearchException { + return clusterManager(fn.apply(new ClusterManagerRequest.Builder()).build()); + } + + /** + * Returns information about the cluster-manager node. + */ + public final ClusterManagerResponse clusterManager() throws IOException, OpenSearchException { + return clusterManager(new ClusterManagerRequest.Builder().build()); + } + + // ----- Endpoint: cat.master + + /** + * Returns information about the cluster-manager node. + */ + @Deprecated + public MasterResponse master(MasterRequest request) throws IOException, OpenSearchException { + return this.transport.performRequest(request, MasterRequest._ENDPOINT, this.transportOptions); + } + + /** + * Returns information about the cluster-manager node. + * + * @param fn a function that initializes a builder to create the {@link MasterRequest} + */ + @Deprecated + public final MasterResponse master(Function> fn) throws IOException, + OpenSearchException { + return master(fn.apply(new MasterRequest.Builder()).build()); + } + + /** + * Returns information about the cluster-manager node. + */ + @Deprecated + public final MasterResponse master() throws IOException, OpenSearchException { + return master(new MasterRequest.Builder().build()); + } } diff --git a/java-client/src/main/java/org/opensearch/client/opensearch/cat/cluster_manager/ClusterManagerRecord.java b/java-client/src/generated/java/org/opensearch/client/opensearch/cat/cluster_manager/ClusterManagerRecord.java similarity index 70% rename from java-client/src/main/java/org/opensearch/client/opensearch/cat/cluster_manager/ClusterManagerRecord.java rename to java-client/src/generated/java/org/opensearch/client/opensearch/cat/cluster_manager/ClusterManagerRecord.java index 908e990c5a..6639340db5 100644 --- a/java-client/src/main/java/org/opensearch/client/opensearch/cat/cluster_manager/ClusterManagerRecord.java +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/cat/cluster_manager/ClusterManagerRecord.java @@ -30,10 +30,17 @@ * GitHub history for details. */ +//---------------------------------------------------- +// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. +//---------------------------------------------------- + package org.opensearch.client.opensearch.cat.cluster_manager; import jakarta.json.stream.JsonGenerator; +import java.util.Objects; import java.util.function.Function; +import javax.annotation.Generated; +import javax.annotation.Nonnull; import javax.annotation.Nullable; import org.opensearch.client.json.JsonpDeserializable; import org.opensearch.client.json.JsonpDeserializer; @@ -41,19 +48,23 @@ import org.opensearch.client.json.ObjectBuilderDeserializer; import org.opensearch.client.json.ObjectDeserializer; import org.opensearch.client.json.PlainJsonSerializable; +import org.opensearch.client.util.CopyableBuilder; import org.opensearch.client.util.ObjectBuilder; import org.opensearch.client.util.ObjectBuilderBase; +import org.opensearch.client.util.ToCopyableBuilder; // typedef: cat.cluster_manager.ClusterManagerRecord @JsonpDeserializable -public class ClusterManagerRecord implements PlainJsonSerializable { - @Nullable - private final String id; +@Generated("org.opensearch.client.codegen.CodeGenerator") +public class ClusterManagerRecord implements PlainJsonSerializable, ToCopyableBuilder { @Nullable private final String host; + @Nullable + private final String id; + @Nullable private final String ip; @@ -63,42 +74,43 @@ public class ClusterManagerRecord implements PlainJsonSerializable { // --------------------------------------------------------------------------------------------- private ClusterManagerRecord(Builder builder) { - - this.id = builder.id; this.host = builder.host; + this.id = builder.id; this.ip = builder.ip; this.node = builder.node; - } - public static ClusterManagerRecord of(Function> fn) { + public static ClusterManagerRecord of(Function> fn) { return fn.apply(new Builder()).build(); } /** - * node id + * hostname *

- * API name: {@code id} + * API name: {@code host} + *

*/ @Nullable - public final String id() { - return this.id; + public final String host() { + return this.host; } /** - * host name + * node id *

- * API name: {@code host} + * API name: {@code id} + *

*/ @Nullable - public final String host() { - return this.host; + public final String id() { + return this.id; } /** - * ip address + * IP address *

* API name: {@code ip} + *

*/ @Nullable public final String ip() { @@ -109,6 +121,7 @@ public final String ip() { * node name *

* API name: {@code node} + *

*/ @Nullable public final String node() { @@ -118,6 +131,7 @@ public final String node() { /** * Serialize this object to JSON. */ + @Override public void serialize(JsonGenerator generator, JsonpMapper mapper) { generator.writeStartObject(); serializeInternal(generator, mapper); @@ -125,74 +139,106 @@ public void serialize(JsonGenerator generator, JsonpMapper mapper) { } protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { + if (this.host != null) { + generator.writeKey("host"); + generator.write(this.host); + } if (this.id != null) { generator.writeKey("id"); generator.write(this.id); - } - if (this.host != null) { - generator.writeKey("host"); - generator.write(this.host); - } if (this.ip != null) { generator.writeKey("ip"); generator.write(this.ip); - } + if (this.node != null) { generator.writeKey("node"); generator.write(this.node); - } - } // --------------------------------------------------------------------------------------------- + @Override + @Nonnull + public Builder toBuilder() { + return new Builder(this); + } + + @Nonnull + public static Builder builder() { + return new Builder(); + } + /** * Builder for {@link ClusterManagerRecord}. */ - - public static class Builder extends ObjectBuilderBase implements ObjectBuilder { - @Nullable - private String id; - + public static class Builder extends ObjectBuilderBase implements CopyableBuilder { @Nullable private String host; - + @Nullable + private String id; @Nullable private String ip; - @Nullable private String node; + public Builder() {} + + private Builder(ClusterManagerRecord o) { + this.host = o.host; + this.id = o.id; + this.ip = o.ip; + this.node = o.node; + } + + private Builder(Builder o) { + this.host = o.host; + this.id = o.id; + this.ip = o.ip; + this.node = o.node; + } + + @Override + @Nonnull + public Builder copy() { + return new Builder(this); + } + /** - * node id + * hostname *

- * API name: {@code id} + * API name: {@code host} + *

*/ - public final Builder id(@Nullable String value) { - this.id = value; + @Nonnull + public final Builder host(@Nullable String value) { + this.host = value; return this; } /** - * host name + * node id *

- * API name: {@code host} + * API name: {@code id} + *

*/ - public final Builder host(@Nullable String value) { - this.host = value; + @Nonnull + public final Builder id(@Nullable String value) { + this.id = value; return this; } /** - * ip address + * IP address *

* API name: {@code ip} + *

*/ + @Nonnull public final Builder ip(@Nullable String value) { this.ip = value; return this; @@ -202,7 +248,9 @@ public final Builder ip(@Nullable String value) { * node name *

* API name: {@code node} + *

*/ + @Nonnull public final Builder node(@Nullable String value) { this.node = value; return this; @@ -211,9 +259,10 @@ public final Builder node(@Nullable String value) { /** * Builds a {@link ClusterManagerRecord}. * - * @throws NullPointerException - * if some of the required fields are null. + * @throws NullPointerException if some of the required fields are null. */ + @Override + @Nonnull public ClusterManagerRecord build() { _checkSingleUse(); @@ -232,12 +281,30 @@ public ClusterManagerRecord build() { ); protected static void setupClusterManagerRecordDeserializer(ObjectDeserializer op) { - + op.add(Builder::host, JsonpDeserializer.stringDeserializer(), "host"); op.add(Builder::id, JsonpDeserializer.stringDeserializer(), "id"); - op.add(Builder::host, JsonpDeserializer.stringDeserializer(), "host", "h"); op.add(Builder::ip, JsonpDeserializer.stringDeserializer(), "ip"); - op.add(Builder::node, JsonpDeserializer.stringDeserializer(), "node", "n"); + op.add(Builder::node, JsonpDeserializer.stringDeserializer(), "node"); + } + @Override + public int hashCode() { + int result = 17; + result = 31 * result + Objects.hashCode(this.host); + result = 31 * result + Objects.hashCode(this.id); + result = 31 * result + Objects.hashCode(this.ip); + result = 31 * result + Objects.hashCode(this.node); + return result; } + @Override + public boolean equals(Object o) { + if (this == o) return true; + if (o == null || this.getClass() != o.getClass()) return false; + ClusterManagerRecord other = (ClusterManagerRecord) o; + return Objects.equals(this.host, other.host) + && Objects.equals(this.id, other.id) + && Objects.equals(this.ip, other.ip) + && Objects.equals(this.node, other.node); + } } diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/cat/master/MasterRecord.java b/java-client/src/generated/java/org/opensearch/client/opensearch/cat/master/MasterRecord.java new file mode 100644 index 0000000000..a63396cbcf --- /dev/null +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/cat/master/MasterRecord.java @@ -0,0 +1,310 @@ +/* + * SPDX-License-Identifier: Apache-2.0 + * + * The OpenSearch Contributors require contributions made to + * this file be licensed under the Apache-2.0 license or a + * compatible open source license. + */ + +/* + * Licensed to Elasticsearch B.V. under one or more contributor + * license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright + * ownership. Elasticsearch B.V. licenses this file to you under + * the Apache License, Version 2.0 (the "License"); you may + * not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +/* + * Modifications Copyright OpenSearch Contributors. See + * GitHub history for details. + */ + +//---------------------------------------------------- +// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. +//---------------------------------------------------- + +package org.opensearch.client.opensearch.cat.master; + +import jakarta.json.stream.JsonGenerator; +import java.util.Objects; +import java.util.function.Function; +import javax.annotation.Generated; +import javax.annotation.Nonnull; +import javax.annotation.Nullable; +import org.opensearch.client.json.JsonpDeserializable; +import org.opensearch.client.json.JsonpDeserializer; +import org.opensearch.client.json.JsonpMapper; +import org.opensearch.client.json.ObjectBuilderDeserializer; +import org.opensearch.client.json.ObjectDeserializer; +import org.opensearch.client.json.PlainJsonSerializable; +import org.opensearch.client.util.CopyableBuilder; +import org.opensearch.client.util.ObjectBuilder; +import org.opensearch.client.util.ObjectBuilderBase; +import org.opensearch.client.util.ToCopyableBuilder; + +// typedef: cat.master.MasterRecord + +@JsonpDeserializable +@Generated("org.opensearch.client.codegen.CodeGenerator") +public class MasterRecord implements PlainJsonSerializable, ToCopyableBuilder { + + @Nullable + private final String host; + + @Nullable + private final String id; + + @Nullable + private final String ip; + + @Nullable + private final String node; + + // --------------------------------------------------------------------------------------------- + + private MasterRecord(Builder builder) { + this.host = builder.host; + this.id = builder.id; + this.ip = builder.ip; + this.node = builder.node; + } + + public static MasterRecord of(Function> fn) { + return fn.apply(new Builder()).build(); + } + + /** + * hostname + *

+ * API name: {@code host} + *

+ */ + @Nullable + public final String host() { + return this.host; + } + + /** + * node id + *

+ * API name: {@code id} + *

+ */ + @Nullable + public final String id() { + return this.id; + } + + /** + * IP address + *

+ * API name: {@code ip} + *

+ */ + @Nullable + public final String ip() { + return this.ip; + } + + /** + * node name + *

+ * API name: {@code node} + *

+ */ + @Nullable + public final String node() { + return this.node; + } + + /** + * Serialize this object to JSON. + */ + @Override + public void serialize(JsonGenerator generator, JsonpMapper mapper) { + generator.writeStartObject(); + serializeInternal(generator, mapper); + generator.writeEnd(); + } + + protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { + if (this.host != null) { + generator.writeKey("host"); + generator.write(this.host); + } + + if (this.id != null) { + generator.writeKey("id"); + generator.write(this.id); + } + + if (this.ip != null) { + generator.writeKey("ip"); + generator.write(this.ip); + } + + if (this.node != null) { + generator.writeKey("node"); + generator.write(this.node); + } + } + + // --------------------------------------------------------------------------------------------- + + @Override + @Nonnull + public Builder toBuilder() { + return new Builder(this); + } + + @Nonnull + public static Builder builder() { + return new Builder(); + } + + /** + * Builder for {@link MasterRecord}. + */ + public static class Builder extends ObjectBuilderBase implements CopyableBuilder { + @Nullable + private String host; + @Nullable + private String id; + @Nullable + private String ip; + @Nullable + private String node; + + public Builder() {} + + private Builder(MasterRecord o) { + this.host = o.host; + this.id = o.id; + this.ip = o.ip; + this.node = o.node; + } + + private Builder(Builder o) { + this.host = o.host; + this.id = o.id; + this.ip = o.ip; + this.node = o.node; + } + + @Override + @Nonnull + public Builder copy() { + return new Builder(this); + } + + /** + * hostname + *

+ * API name: {@code host} + *

+ */ + @Nonnull + public final Builder host(@Nullable String value) { + this.host = value; + return this; + } + + /** + * node id + *

+ * API name: {@code id} + *

+ */ + @Nonnull + public final Builder id(@Nullable String value) { + this.id = value; + return this; + } + + /** + * IP address + *

+ * API name: {@code ip} + *

+ */ + @Nonnull + public final Builder ip(@Nullable String value) { + this.ip = value; + return this; + } + + /** + * node name + *

+ * API name: {@code node} + *

+ */ + @Nonnull + public final Builder node(@Nullable String value) { + this.node = value; + return this; + } + + /** + * Builds a {@link MasterRecord}. + * + * @throws NullPointerException if some of the required fields are null. + */ + @Override + @Nonnull + public MasterRecord build() { + _checkSingleUse(); + + return new MasterRecord(this); + } + } + + // --------------------------------------------------------------------------------------------- + + /** + * Json deserializer for {@link MasterRecord} + */ + public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer.lazy( + Builder::new, + MasterRecord::setupMasterRecordDeserializer + ); + + protected static void setupMasterRecordDeserializer(ObjectDeserializer op) { + op.add(Builder::host, JsonpDeserializer.stringDeserializer(), "host"); + op.add(Builder::id, JsonpDeserializer.stringDeserializer(), "id"); + op.add(Builder::ip, JsonpDeserializer.stringDeserializer(), "ip"); + op.add(Builder::node, JsonpDeserializer.stringDeserializer(), "node"); + } + + @Override + public int hashCode() { + int result = 17; + result = 31 * result + Objects.hashCode(this.host); + result = 31 * result + Objects.hashCode(this.id); + result = 31 * result + Objects.hashCode(this.ip); + result = 31 * result + Objects.hashCode(this.node); + return result; + } + + @Override + public boolean equals(Object o) { + if (this == o) return true; + if (o == null || this.getClass() != o.getClass()) return false; + MasterRecord other = (MasterRecord) o; + return Objects.equals(this.host, other.host) + && Objects.equals(this.id, other.id) + && Objects.equals(this.ip, other.ip) + && Objects.equals(this.node, other.node); + } +} diff --git a/java-client/src/main/java/org/opensearch/client/opensearch/cat/ClusterManagerRequest.java b/java-client/src/main/java/org/opensearch/client/opensearch/cat/ClusterManagerRequest.java deleted file mode 100644 index 155bac91f4..0000000000 --- a/java-client/src/main/java/org/opensearch/client/opensearch/cat/ClusterManagerRequest.java +++ /dev/null @@ -1,104 +0,0 @@ -/* - * SPDX-License-Identifier: Apache-2.0 - * - * The OpenSearch Contributors require contributions made to - * this file be licensed under the Apache-2.0 license or a - * compatible open source license. - */ - -/* - * Licensed to Elasticsearch B.V. under one or more contributor - * license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright - * ownership. Elasticsearch B.V. licenses this file to you under - * the Apache License, Version 2.0 (the "License"); you may - * not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -/* - * Modifications Copyright OpenSearch Contributors. See - * GitHub history for details. - */ - -package org.opensearch.client.opensearch.cat; - -import java.util.HashMap; -import org.opensearch.client.opensearch._types.ErrorResponse; -import org.opensearch.client.transport.Endpoint; -import org.opensearch.client.transport.endpoints.SimpleEndpoint; - -// typedef: cat.cluster_manager.Request - -/** - * Returns information about the cluster-manager node. - * - */ -public class ClusterManagerRequest extends CatRequestBase { - public ClusterManagerRequest() {} - - /** - * Singleton instance for {@link ClusterManagerRequest}. - */ - public static final ClusterManagerRequest _INSTANCE = new ClusterManagerRequest(); - - // --------------------------------------------------------------------------------------------- - - /** - * Endpoint "{@code cat.master}". - */ - @Deprecated - public static final Endpoint _DEPRECATED_ENDPOINT = new SimpleEndpoint<>( - - // Request method - request -> { - return "GET"; - - }, - - // Request path - request -> { - return "/_cat/master"; - - }, - - // Request parameters - request -> new HashMap<>(request.queryParameters()), - SimpleEndpoint.emptyMap(), - false, - ClusterManagerResponse._DESERIALIZER - ); - - /** - * Endpoint "{@code cat.cluster_manager}". - */ - public static final Endpoint _ENDPOINT = new SimpleEndpoint<>( - - // Request method - request -> { - return "GET"; - - }, - - // Request path - request -> { - return "/_cat/cluster_manager"; - - }, - - // Request parameters - request -> new HashMap<>(request.queryParameters()), - SimpleEndpoint.emptyMap(), - false, - ClusterManagerResponse._DESERIALIZER - ); -} diff --git a/java-client/src/main/java/org/opensearch/client/opensearch/cat/OpenSearchCatAsyncClient.java b/java-client/src/main/java/org/opensearch/client/opensearch/cat/OpenSearchCatAsyncClient.java index f2f7cce3b1..afa6a161bd 100644 --- a/java-client/src/main/java/org/opensearch/client/opensearch/cat/OpenSearchCatAsyncClient.java +++ b/java-client/src/main/java/org/opensearch/client/opensearch/cat/OpenSearchCatAsyncClient.java @@ -253,33 +253,6 @@ public CompletableFuture indices() throws IOException, OpenSear return this.transport.performRequestAsync(new IndicesRequest.Builder().build(), IndicesRequest._ENDPOINT, this.transportOptions); } - // ----- Endpoint: cat.master - - /** - * Returns information about the master node. - * - * - */ - @Deprecated - public CompletableFuture master() throws IOException, OpenSearchException { - return this.transport.performRequestAsync( - ClusterManagerRequest._INSTANCE, - ClusterManagerRequest._DEPRECATED_ENDPOINT, - this.transportOptions - ); - } - - // ----- Endpoint: cat.cluster_manager - - /** - * Returns information about the cluster-manager node. - * - * - */ - public CompletableFuture clusterManager() throws IOException, OpenSearchException { - return this.transport.performRequestAsync(ClusterManagerRequest._INSTANCE, ClusterManagerRequest._ENDPOINT, this.transportOptions); - } - // ----- Endpoint: cat.nodeattrs /** diff --git a/java-client/src/main/java/org/opensearch/client/opensearch/cat/OpenSearchCatClient.java b/java-client/src/main/java/org/opensearch/client/opensearch/cat/OpenSearchCatClient.java index 9d918654fa..114fe6c63a 100644 --- a/java-client/src/main/java/org/opensearch/client/opensearch/cat/OpenSearchCatClient.java +++ b/java-client/src/main/java/org/opensearch/client/opensearch/cat/OpenSearchCatClient.java @@ -248,33 +248,6 @@ public IndicesResponse indices() throws IOException, OpenSearchException { return this.transport.performRequest(new IndicesRequest.Builder().build(), IndicesRequest._ENDPOINT, this.transportOptions); } - // ----- Endpoint: cat.master - - /** - * Returns information about the master node. - * - * - */ - @Deprecated - public ClusterManagerResponse master() throws IOException, OpenSearchException { - return this.transport.performRequest( - ClusterManagerRequest._INSTANCE, - ClusterManagerRequest._DEPRECATED_ENDPOINT, - this.transportOptions - ); - } - - // ----- Endpoint: cat.cluster_manager - - /** - * Returns information about the cluster-manager node. - * - * - */ - public ClusterManagerResponse clusterManager() throws IOException, OpenSearchException { - return this.transport.performRequest(ClusterManagerRequest._INSTANCE, ClusterManagerRequest._ENDPOINT, this.transportOptions); - } - // ----- Endpoint: cat.nodeattrs /** diff --git a/java-codegen/src/main/java/org/opensearch/client/codegen/CodeGenerator.java b/java-codegen/src/main/java/org/opensearch/client/codegen/CodeGenerator.java index 977086758f..0038754aa8 100644 --- a/java-codegen/src/main/java/org/opensearch/client/codegen/CodeGenerator.java +++ b/java-codegen/src/main/java/org/opensearch/client/codegen/CodeGenerator.java @@ -48,7 +48,7 @@ public class CodeGenerator { private static final Logger LOGGER = LogManager.getLogger(); private static final Matcher OPERATION_MATCHER = or( and(namespace(isNull()), name(is("info"))), - and(namespace(is("cat")), name(isOneOf("aliases", "allocation"))), + and(namespace(is("cat")), name(isOneOf("aliases", "allocation", "cluster_manager", "master"))), and( namespace(is("cluster")), name( From a144de55d3f91be0b4792d683301bc6c18c37588 Mon Sep 17 00:00:00 2001 From: Thomas Farr Date: Tue, 7 Jan 2025 17:00:16 +1300 Subject: [PATCH 04/18] Generate cat.count Signed-off-by: Thomas Farr --- .../client/opensearch/cat/CountRequest.java | 131 ++++++++++----- .../client/opensearch/cat/CountResponse.java | 74 ++++++--- .../cat/OpenSearchCatAsyncClientBase.java | 26 +++ .../cat/OpenSearchCatClientBase.java | 26 +++ .../opensearch/cat/count/CountRecord.java | 153 ++++++++++++------ .../cat/OpenSearchCatAsyncClient.java | 45 ------ .../opensearch/cat/OpenSearchCatClient.java | 45 ------ .../client/codegen/CodeGenerator.java | 2 +- 8 files changed, 303 insertions(+), 199 deletions(-) rename java-client/src/{main => generated}/java/org/opensearch/client/opensearch/cat/CountRequest.java (56%) rename java-client/src/{main => generated}/java/org/opensearch/client/opensearch/cat/CountResponse.java (75%) rename java-client/src/{main => generated}/java/org/opensearch/client/opensearch/cat/count/CountRecord.java (69%) diff --git a/java-client/src/main/java/org/opensearch/client/opensearch/cat/CountRequest.java b/java-client/src/generated/java/org/opensearch/client/opensearch/cat/CountRequest.java similarity index 56% rename from java-client/src/main/java/org/opensearch/client/opensearch/cat/CountRequest.java rename to java-client/src/generated/java/org/opensearch/client/opensearch/cat/CountRequest.java index bd6879f747..bd654926ef 100644 --- a/java-client/src/main/java/org/opensearch/client/opensearch/cat/CountRequest.java +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/cat/CountRequest.java @@ -30,28 +30,37 @@ * GitHub history for details. */ +//---------------------------------------------------- +// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. +//---------------------------------------------------- + package org.opensearch.client.opensearch.cat; 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.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.ToCopyableBuilder; // typedef: cat.count.Request /** - * Provides quick access to the document count of the entire cluster, or - * individual indices. - * + * Provides quick access to the document count of the entire cluster or of an individual index. */ +@Generated("org.opensearch.client.codegen.CodeGenerator") +public final class CountRequest extends CatRequestBase implements ToCopyableBuilder { -public class CountRequest extends CatRequestBase { + @Nonnull private final List index; // --------------------------------------------------------------------------------------------- @@ -59,51 +68,97 @@ public class CountRequest extends CatRequestBase { private CountRequest(Builder builder) { super(builder); this.index = ApiTypeHelper.unmodifiable(builder.index); - } - public static CountRequest of(Function> fn) { + public static CountRequest of(Function> fn) { return fn.apply(new Builder()).build(); } /** - * A comma-separated list of index names to limit the returned information + * Comma-separated list of data streams, indexes, and aliases used to limit the request. Supports wildcards (*). To target + * all data streams and indexes, omit this parameter or use * or _all. *

* API name: {@code index} + *

*/ + @Nonnull public final List index() { return this.index; } // --------------------------------------------------------------------------------------------- + @Override + @Nonnull + public Builder toBuilder() { + return new Builder(this); + } + + @Nonnull + public static Builder builder() { + return new Builder(); + } + /** * Builder for {@link CountRequest}. */ - - public static class Builder extends CatRequestBaseBuilder { + public static class Builder extends CatRequestBase.AbstractBuilder implements CopyableBuilder { @Nullable private List index; + public Builder() {} + + private Builder(CountRequest o) { + super(o); + this.index = _listCopy(o.index); + } + + private Builder(Builder o) { + super(o); + this.index = _listCopy(o.index); + } + + @Override + @Nonnull + public Builder copy() { + return new Builder(this); + } + + @Override + @Nonnull + protected Builder self() { + return this; + } + /** - * A comma-separated list of index names to limit the returned information + * Comma-separated list of data streams, indexes, and aliases used to limit the request. Supports wildcards (*). To + * target all data streams and indexes, omit this parameter or use * or _all. *

* 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; } /** - * A comma-separated list of index names to limit the returned information + * Comma-separated list of data streams, indexes, and aliases used to limit the request. Supports wildcards (*). To + * target all data streams and indexes, omit this parameter or use * or _all. *

* 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; @@ -112,19 +167,15 @@ public final Builder index(String value, String... values) { /** * Builds a {@link CountRequest}. * - * @throws NullPointerException - * if some of the required fields are null. + * @throws NullPointerException if some of the required fields are null. */ + @Override + @Nonnull public CountRequest build() { _checkSingleUse(); return new CountRequest(this); } - - @Override - protected Builder self() { - return this; - } } // --------------------------------------------------------------------------------------------- @@ -133,13 +184,8 @@ protected Builder self() { * Endpoint "{@code cat.count}". */ public static final Endpoint _ENDPOINT = new SimpleEndpoint<>( - // Request method - request -> { - return "GET"; - - }, - + request -> "GET", // Request path request -> { final int _index = 1 << 0; @@ -149,27 +195,40 @@ protected Builder self() { if (ApiTypeHelper.isDefined(request.index())) propsSet |= _index; if (propsSet == 0) { - StringBuilder buf = new StringBuilder(); - buf.append("/_cat"); - buf.append("/count"); - return buf.toString(); + return "/_cat/count"; } if (propsSet == (_index)) { StringBuilder buf = new StringBuilder(); - buf.append("/_cat"); - buf.append("/count"); - buf.append("/"); - SimpleEndpoint.pathEncode(request.index.stream().map(v -> v).collect(Collectors.joining(",")), buf); + buf.append("/_cat/count/"); + SimpleEndpoint.pathEncode(String.join(",", request.index), buf); return buf.toString(); } - throw SimpleEndpoint.noPathTemplateFound("path"); + throw SimpleEndpoint.noPathTemplateFound("path"); }, - // Request parameters - request -> new HashMap<>(request.queryParameters()), + request -> { + Map params = new HashMap<>(); + request.applyQueryParameters(params); + return params; + }, SimpleEndpoint.emptyMap(), false, CountResponse._DESERIALIZER ); + + @Override + public int hashCode() { + int result = 17; + result = 31 * result + Objects.hashCode(this.index); + return result; + } + + @Override + public boolean equals(Object o) { + if (this == o) return true; + if (o == null || this.getClass() != o.getClass()) return false; + CountRequest other = (CountRequest) o; + return Objects.equals(this.index, other.index); + } } diff --git a/java-client/src/main/java/org/opensearch/client/opensearch/cat/CountResponse.java b/java-client/src/generated/java/org/opensearch/client/opensearch/cat/CountResponse.java similarity index 75% rename from java-client/src/main/java/org/opensearch/client/opensearch/cat/CountResponse.java rename to java-client/src/generated/java/org/opensearch/client/opensearch/cat/CountResponse.java index 435c126280..f60b43f5e9 100644 --- a/java-client/src/main/java/org/opensearch/client/opensearch/cat/CountResponse.java +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/cat/CountResponse.java @@ -30,43 +30,51 @@ * GitHub history for details. */ +//---------------------------------------------------- +// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. +//---------------------------------------------------- + package org.opensearch.client.opensearch.cat; 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; import org.opensearch.client.json.PlainJsonSerializable; import org.opensearch.client.opensearch.cat.count.CountRecord; 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: cat.count.Response @JsonpDeserializable -public class CountResponse implements PlainJsonSerializable { +@Generated("org.opensearch.client.codegen.CodeGenerator") +public class CountResponse implements PlainJsonSerializable, ToCopyableBuilder { + + @Nonnull private final List valueBody; // --------------------------------------------------------------------------------------------- private CountResponse(Builder builder) { - this.valueBody = ApiTypeHelper.unmodifiableRequired(builder.valueBody, this, "valueBody"); - } - public static CountResponse of(Function> fn) { + public static CountResponse of(Function> fn) { return fn.apply(new Builder()).build(); } /** * Required - Response value. - *

- * API name: {@code _value_body} */ + @Nonnull public final List valueBody() { return this.valueBody; } @@ -78,28 +86,53 @@ public void serialize(JsonGenerator generator, JsonpMapper mapper) { generator.writeStartArray(); for (CountRecord item0 : this.valueBody) { 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 CountResponse}. */ - - public static class Builder extends ObjectBuilderBase implements ObjectBuilder { + public static class Builder extends ObjectBuilderBase implements CopyableBuilder { private List valueBody; + public Builder() {} + + private Builder(CountResponse o) { + this.valueBody = _listCopy(o.valueBody); + } + + private Builder(Builder o) { + this.valueBody = _listCopy(o.valueBody); + } + + @Override + @Nonnull + public Builder copy() { + return new Builder(this); + } + /** * Required - Response value. - *

- * API name: {@code _value_body} + * *

* Adds all elements of list to valueBody. + *

*/ + @Nonnull public final Builder valueBody(List list) { this.valueBody = _listAddAll(this.valueBody, list); return this; @@ -107,11 +140,12 @@ public final Builder valueBody(List list) { /** * Required - Response value. - *

- * API name: {@code _value_body} + * *

* Adds one or more values to valueBody. + *

*/ + @Nonnull public final Builder valueBody(CountRecord value, CountRecord... values) { this.valueBody = _listAdd(this.valueBody, value, values); return this; @@ -119,11 +153,12 @@ public final Builder valueBody(CountRecord value, CountRecord... values) { /** * Required - Response value. - *

- * API name: {@code _value_body} + * *

* Adds a value to valueBody using a builder lambda. + *

*/ + @Nonnull public final Builder valueBody(Function> fn) { return valueBody(fn.apply(new CountRecord.Builder()).build()); } @@ -131,9 +166,10 @@ public final Builder valueBody(Function _DESERIALIZER = createCountResponseDeserializer(); protected static JsonpDeserializer createCountResponseDeserializer() { - JsonpDeserializer> valueDeserializer = JsonpDeserializer.arrayDeserializer(CountRecord._DESERIALIZER); return JsonpDeserializer.of( @@ -152,5 +187,4 @@ protected static JsonpDeserializer createCountResponseDeserialize (parser, mapper) -> new Builder().valueBody(valueDeserializer.deserialize(parser, mapper)).build() ); } - } diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/cat/OpenSearchCatAsyncClientBase.java b/java-client/src/generated/java/org/opensearch/client/opensearch/cat/OpenSearchCatAsyncClientBase.java index 631246e690..cff45b8ca8 100644 --- a/java-client/src/generated/java/org/opensearch/client/opensearch/cat/OpenSearchCatAsyncClientBase.java +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/cat/OpenSearchCatAsyncClientBase.java @@ -137,6 +137,32 @@ public final CompletableFuture clusterManager() throws I return clusterManager(new ClusterManagerRequest.Builder().build()); } + // ----- Endpoint: cat.count + + /** + * Provides quick access to the document count of the entire cluster or of an individual index. + */ + public CompletableFuture count(CountRequest request) throws IOException, OpenSearchException { + return this.transport.performRequestAsync(request, CountRequest._ENDPOINT, this.transportOptions); + } + + /** + * Provides quick access to the document count of the entire cluster or of an individual index. + * + * @param fn a function that initializes a builder to create the {@link CountRequest} + */ + public final CompletableFuture count(Function> fn) throws IOException, + OpenSearchException { + return count(fn.apply(new CountRequest.Builder()).build()); + } + + /** + * Provides quick access to the document count of the entire cluster or of an individual index. + */ + public final CompletableFuture count() throws IOException, OpenSearchException { + return count(new CountRequest.Builder().build()); + } + // ----- Endpoint: cat.master /** diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/cat/OpenSearchCatClientBase.java b/java-client/src/generated/java/org/opensearch/client/opensearch/cat/OpenSearchCatClientBase.java index a6051e4587..8213283727 100644 --- a/java-client/src/generated/java/org/opensearch/client/opensearch/cat/OpenSearchCatClientBase.java +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/cat/OpenSearchCatClientBase.java @@ -133,6 +133,32 @@ public final ClusterManagerResponse clusterManager() throws IOException, OpenSea return clusterManager(new ClusterManagerRequest.Builder().build()); } + // ----- Endpoint: cat.count + + /** + * Provides quick access to the document count of the entire cluster or of an individual index. + */ + public CountResponse count(CountRequest request) throws IOException, OpenSearchException { + return this.transport.performRequest(request, CountRequest._ENDPOINT, this.transportOptions); + } + + /** + * Provides quick access to the document count of the entire cluster or of an individual index. + * + * @param fn a function that initializes a builder to create the {@link CountRequest} + */ + public final CountResponse count(Function> fn) throws IOException, + OpenSearchException { + return count(fn.apply(new CountRequest.Builder()).build()); + } + + /** + * Provides quick access to the document count of the entire cluster or of an individual index. + */ + public final CountResponse count() throws IOException, OpenSearchException { + return count(new CountRequest.Builder().build()); + } + // ----- Endpoint: cat.master /** diff --git a/java-client/src/main/java/org/opensearch/client/opensearch/cat/count/CountRecord.java b/java-client/src/generated/java/org/opensearch/client/opensearch/cat/count/CountRecord.java similarity index 69% rename from java-client/src/main/java/org/opensearch/client/opensearch/cat/count/CountRecord.java rename to java-client/src/generated/java/org/opensearch/client/opensearch/cat/count/CountRecord.java index 93d9867cf2..c9a0f15466 100644 --- a/java-client/src/main/java/org/opensearch/client/opensearch/cat/count/CountRecord.java +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/cat/count/CountRecord.java @@ -30,10 +30,17 @@ * GitHub history for details. */ +//---------------------------------------------------- +// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. +//---------------------------------------------------- + package org.opensearch.client.opensearch.cat.count; import jakarta.json.stream.JsonGenerator; +import java.util.Objects; import java.util.function.Function; +import javax.annotation.Generated; +import javax.annotation.Nonnull; import javax.annotation.Nullable; import org.opensearch.client.json.JsonpDeserializable; import org.opensearch.client.json.JsonpDeserializer; @@ -41,39 +48,50 @@ import org.opensearch.client.json.ObjectBuilderDeserializer; import org.opensearch.client.json.ObjectDeserializer; import org.opensearch.client.json.PlainJsonSerializable; +import org.opensearch.client.util.CopyableBuilder; import org.opensearch.client.util.ObjectBuilder; import org.opensearch.client.util.ObjectBuilderBase; +import org.opensearch.client.util.ToCopyableBuilder; // typedef: cat.count.CountRecord @JsonpDeserializable -public class CountRecord implements PlainJsonSerializable { +@Generated("org.opensearch.client.codegen.CodeGenerator") +public class CountRecord implements PlainJsonSerializable, ToCopyableBuilder { + @Nullable - private final String epoch; + private final String count; @Nullable - private final String timestamp; + private final String epoch; @Nullable - private final String count; + private final String timestamp; // --------------------------------------------------------------------------------------------- private CountRecord(Builder builder) { - + this.count = builder.count; this.epoch = builder.epoch; this.timestamp = builder.timestamp; - this.count = builder.count; - } - public static CountRecord of(Function> fn) { + public static CountRecord of(Function> fn) { return fn.apply(new Builder()).build(); } /** - * seconds since 1969-01-01 00:00:00 + * the document count *

+ * API name: {@code count} + *

+ */ + @Nullable + public final String count() { + return this.count; + } + + /** * API name: {@code epoch} */ @Nullable @@ -82,8 +100,6 @@ public final String epoch() { } /** - * time in HH:MM:SS - *

* API name: {@code timestamp} */ @Nullable @@ -91,19 +107,10 @@ public final String timestamp() { return this.timestamp; } - /** - * the document count - *

- * API name: {@code count} - */ - @Nullable - public final String count() { - return this.count; - } - /** * Serialize this object to JSON. */ + @Override public void serialize(JsonGenerator generator, JsonpMapper mapper) { generator.writeStartObject(); serializeInternal(generator, mapper); @@ -111,77 +118,103 @@ public void serialize(JsonGenerator generator, JsonpMapper mapper) { } protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { + if (this.count != null) { + generator.writeKey("count"); + generator.write(this.count); + } if (this.epoch != null) { generator.writeKey("epoch"); generator.write(this.epoch); - } + if (this.timestamp != null) { generator.writeKey("timestamp"); generator.write(this.timestamp); - } - if (this.count != null) { - generator.writeKey("count"); - generator.write(this.count); + } - } + // --------------------------------------------------------------------------------------------- + @Override + @Nonnull + public Builder toBuilder() { + return new Builder(this); } - // --------------------------------------------------------------------------------------------- + @Nonnull + public static Builder builder() { + return new Builder(); + } /** * Builder for {@link CountRecord}. */ - - public static class Builder extends ObjectBuilderBase implements ObjectBuilder { + public static class Builder extends ObjectBuilderBase implements CopyableBuilder { + @Nullable + private String count; @Nullable private String epoch; - @Nullable private String timestamp; - @Nullable - private String count; + public Builder() {} + + private Builder(CountRecord o) { + this.count = o.count; + this.epoch = o.epoch; + this.timestamp = o.timestamp; + } + + private Builder(Builder o) { + this.count = o.count; + this.epoch = o.epoch; + this.timestamp = o.timestamp; + } + + @Override + @Nonnull + public Builder copy() { + return new Builder(this); + } /** - * seconds since 1969-01-01 00:00:00 + * the document count *

+ * API name: {@code count} + *

+ */ + @Nonnull + public final Builder count(@Nullable String value) { + this.count = value; + return this; + } + + /** * API name: {@code epoch} */ + @Nonnull public final Builder epoch(@Nullable String value) { this.epoch = value; return this; } /** - * time in HH:MM:SS - *

* API name: {@code timestamp} */ + @Nonnull public final Builder timestamp(@Nullable String value) { this.timestamp = value; return this; } - /** - * the document count - *

- * API name: {@code count} - */ - public final Builder count(@Nullable String value) { - this.count = value; - return this; - } - /** * Builds a {@link CountRecord}. * - * @throws NullPointerException - * if some of the required fields are null. + * @throws NullPointerException if some of the required fields are null. */ + @Override + @Nonnull public CountRecord build() { _checkSingleUse(); @@ -200,11 +233,27 @@ public CountRecord build() { ); protected static void setupCountRecordDeserializer(ObjectDeserializer op) { + op.add(Builder::count, JsonpDeserializer.stringDeserializer(), "count"); + op.add(Builder::epoch, JsonpDeserializer.stringDeserializer(), "epoch"); + op.add(Builder::timestamp, JsonpDeserializer.stringDeserializer(), "timestamp"); + } - op.add(Builder::epoch, JsonpDeserializer.stringDeserializer(), "epoch", "t", "time"); - op.add(Builder::timestamp, JsonpDeserializer.stringDeserializer(), "timestamp", "ts", "hms", "hhmmss"); - op.add(Builder::count, JsonpDeserializer.stringDeserializer(), "count", "dc", "docs.count", "docsCount"); - + @Override + public int hashCode() { + int result = 17; + result = 31 * result + Objects.hashCode(this.count); + result = 31 * result + Objects.hashCode(this.epoch); + result = 31 * result + Objects.hashCode(this.timestamp); + return result; } + @Override + public boolean equals(Object o) { + if (this == o) return true; + if (o == null || this.getClass() != o.getClass()) return false; + CountRecord other = (CountRecord) o; + return Objects.equals(this.count, other.count) + && Objects.equals(this.epoch, other.epoch) + && Objects.equals(this.timestamp, other.timestamp); + } } diff --git a/java-client/src/main/java/org/opensearch/client/opensearch/cat/OpenSearchCatAsyncClient.java b/java-client/src/main/java/org/opensearch/client/opensearch/cat/OpenSearchCatAsyncClient.java index afa6a161bd..08f1056bca 100644 --- a/java-client/src/main/java/org/opensearch/client/opensearch/cat/OpenSearchCatAsyncClient.java +++ b/java-client/src/main/java/org/opensearch/client/opensearch/cat/OpenSearchCatAsyncClient.java @@ -61,51 +61,6 @@ public OpenSearchCatAsyncClient withTransportOptions(@Nullable TransportOptions return new OpenSearchCatAsyncClient(this.transport, transportOptions); } - // ----- Endpoint: cat.count - - /** - * Provides quick access to the document count of the entire cluster, or - * individual indices. - * - * - */ - - public CompletableFuture count(CountRequest request) throws IOException, OpenSearchException { - @SuppressWarnings("unchecked") - JsonEndpoint endpoint = (JsonEndpoint< - CountRequest, - CountResponse, - ErrorResponse>) CountRequest._ENDPOINT; - - return this.transport.performRequestAsync(request, endpoint, this.transportOptions); - } - - /** - * Provides quick access to the document count of the entire cluster, or - * individual indices. - * - * @param fn - * a function that initializes a builder to create the - * {@link CountRequest} - * - */ - - public final CompletableFuture count(Function> fn) throws IOException, - OpenSearchException { - return count(fn.apply(new CountRequest.Builder()).build()); - } - - /** - * Provides quick access to the document count of the entire cluster, or - * individual indices. - * - * - */ - - public CompletableFuture count() throws IOException, OpenSearchException { - return this.transport.performRequestAsync(new CountRequest.Builder().build(), CountRequest._ENDPOINT, this.transportOptions); - } - // ----- Endpoint: cat.fielddata /** diff --git a/java-client/src/main/java/org/opensearch/client/opensearch/cat/OpenSearchCatClient.java b/java-client/src/main/java/org/opensearch/client/opensearch/cat/OpenSearchCatClient.java index 114fe6c63a..58ada8b461 100644 --- a/java-client/src/main/java/org/opensearch/client/opensearch/cat/OpenSearchCatClient.java +++ b/java-client/src/main/java/org/opensearch/client/opensearch/cat/OpenSearchCatClient.java @@ -60,51 +60,6 @@ public OpenSearchCatClient withTransportOptions(@Nullable TransportOptions trans return new OpenSearchCatClient(this.transport, transportOptions); } - // ----- Endpoint: cat.count - - /** - * Provides quick access to the document count of the entire cluster, or - * individual indices. - * - * - */ - - public CountResponse count(CountRequest request) throws IOException, OpenSearchException { - @SuppressWarnings("unchecked") - JsonEndpoint endpoint = (JsonEndpoint< - CountRequest, - CountResponse, - ErrorResponse>) CountRequest._ENDPOINT; - - return this.transport.performRequest(request, endpoint, this.transportOptions); - } - - /** - * Provides quick access to the document count of the entire cluster, or - * individual indices. - * - * @param fn - * a function that initializes a builder to create the - * {@link CountRequest} - * - */ - - public final CountResponse count(Function> fn) throws IOException, - OpenSearchException { - return count(fn.apply(new CountRequest.Builder()).build()); - } - - /** - * Provides quick access to the document count of the entire cluster, or - * individual indices. - * - * - */ - - public CountResponse count() throws IOException, OpenSearchException { - return this.transport.performRequest(new CountRequest.Builder().build(), CountRequest._ENDPOINT, this.transportOptions); - } - // ----- Endpoint: cat.fielddata /** diff --git a/java-codegen/src/main/java/org/opensearch/client/codegen/CodeGenerator.java b/java-codegen/src/main/java/org/opensearch/client/codegen/CodeGenerator.java index 0038754aa8..6585bfb955 100644 --- a/java-codegen/src/main/java/org/opensearch/client/codegen/CodeGenerator.java +++ b/java-codegen/src/main/java/org/opensearch/client/codegen/CodeGenerator.java @@ -48,7 +48,7 @@ public class CodeGenerator { private static final Logger LOGGER = LogManager.getLogger(); private static final Matcher OPERATION_MATCHER = or( and(namespace(isNull()), name(is("info"))), - and(namespace(is("cat")), name(isOneOf("aliases", "allocation", "cluster_manager", "master"))), + and(namespace(is("cat")), name(isOneOf("aliases", "allocation", "cluster_manager", "count", "master"))), and( namespace(is("cluster")), name( From 3636652f84455ed58a78b1cebe325fd741c78ddc Mon Sep 17 00:00:00 2001 From: Thomas Farr Date: Tue, 7 Jan 2025 17:02:34 +1300 Subject: [PATCH 05/18] Generate cat.fielddata Signed-off-by: Thomas Farr --- .../opensearch/cat/FielddataRequest.java | 147 ++++++++---- .../opensearch/cat/FielddataResponse.java | 74 ++++-- .../cat/OpenSearchCatAsyncClientBase.java | 26 +++ .../cat/OpenSearchCatClientBase.java | 26 +++ .../cat/fielddata/FielddataRecord.java | 221 ++++++++++++------ .../cat/OpenSearchCatAsyncClient.java | 49 ---- .../opensearch/cat/OpenSearchCatClient.java | 45 ---- .../client/codegen/CodeGenerator.java | 16 +- 8 files changed, 369 insertions(+), 235 deletions(-) rename java-client/src/{main => generated}/java/org/opensearch/client/opensearch/cat/FielddataRequest.java (57%) rename java-client/src/{main => generated}/java/org/opensearch/client/opensearch/cat/FielddataResponse.java (75%) rename java-client/src/{main => generated}/java/org/opensearch/client/opensearch/cat/fielddata/FielddataRecord.java (70%) diff --git a/java-client/src/main/java/org/opensearch/client/opensearch/cat/FielddataRequest.java b/java-client/src/generated/java/org/opensearch/client/opensearch/cat/FielddataRequest.java similarity index 57% rename from java-client/src/main/java/org/opensearch/client/opensearch/cat/FielddataRequest.java rename to java-client/src/generated/java/org/opensearch/client/opensearch/cat/FielddataRequest.java index 9ff5497bc4..a4547b25be 100644 --- a/java-client/src/main/java/org/opensearch/client/opensearch/cat/FielddataRequest.java +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/cat/FielddataRequest.java @@ -30,33 +30,41 @@ * GitHub history for details. */ +//---------------------------------------------------- +// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. +//---------------------------------------------------- + package org.opensearch.client.opensearch.cat; 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.Bytes; import org.opensearch.client.opensearch._types.ErrorResponse; 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.ToCopyableBuilder; // typedef: cat.fielddata.Request /** - * Shows how much heap memory is currently being used by fielddata on every data - * node in the cluster. - * + * Shows how much heap memory is currently being used by field data on every data node in the cluster. */ +@Generated("org.opensearch.client.codegen.CodeGenerator") +public final class FielddataRequest extends CatRequestBase implements ToCopyableBuilder { -public class FielddataRequest extends CatRequestBase { @Nullable private final Bytes bytes; + @Nonnull private final List fields; // --------------------------------------------------------------------------------------------- @@ -65,17 +73,17 @@ private FielddataRequest(Builder builder) { super(builder); this.bytes = builder.bytes; this.fields = ApiTypeHelper.unmodifiable(builder.fields); - } - public static FielddataRequest of(Function> fn) { + public static FielddataRequest of(Function> fn) { return fn.apply(new Builder()).build(); } /** - * The unit in which to display byte values + * The units used to display byte values. *

* API name: {@code bytes} + *

*/ @Nullable public final Bytes bytes() { @@ -83,56 +91,103 @@ public final Bytes bytes() { } /** - * A comma-separated list of fields to return the fielddata size + * A comma-separated list of fields used to limit the amount of returned information. To retrieve all fields, omit this parameter. *

* API name: {@code fields} + *

*/ + @Nonnull public final List fields() { return this.fields; } // --------------------------------------------------------------------------------------------- + @Override + @Nonnull + public Builder toBuilder() { + return new Builder(this); + } + + @Nonnull + public static Builder builder() { + return new Builder(); + } + /** * Builder for {@link FielddataRequest}. */ - - public static class Builder extends CatRequestBaseBuilder { + public static class Builder extends CatRequestBase.AbstractBuilder implements CopyableBuilder { @Nullable private Bytes bytes; - @Nullable private List fields; + public Builder() {} + + private Builder(FielddataRequest o) { + super(o); + this.bytes = o.bytes; + this.fields = _listCopy(o.fields); + } + + private Builder(Builder o) { + super(o); + this.bytes = o.bytes; + this.fields = _listCopy(o.fields); + } + + @Override + @Nonnull + public Builder copy() { + return new Builder(this); + } + + @Override + @Nonnull + protected Builder self() { + return this; + } + /** - * The unit in which to display byte values + * The units used to display byte values. *

* API name: {@code bytes} + *

*/ + @Nonnull public final Builder bytes(@Nullable Bytes value) { this.bytes = value; return this; } /** - * A comma-separated list of fields to return the fielddata size + * A comma-separated list of fields used to limit the amount of returned information. To retrieve all fields, omit this parameter. *

* API name: {@code fields} + *

+ * *

* Adds all elements of list to fields. + *

*/ + @Nonnull public final Builder fields(List list) { this.fields = _listAddAll(this.fields, list); return this; } /** - * A comma-separated list of fields to return the fielddata size + * A comma-separated list of fields used to limit the amount of returned information. To retrieve all fields, omit this parameter. *

* API name: {@code fields} + *

+ * *

* Adds one or more values to fields. + *

*/ + @Nonnull public final Builder fields(String value, String... values) { this.fields = _listAdd(this.fields, value, values); return this; @@ -141,34 +196,33 @@ public final Builder fields(String value, String... values) { /** * Builds a {@link FielddataRequest}. * - * @throws NullPointerException - * if some of the required fields are null. + * @throws NullPointerException if some of the required fields are null. */ + @Override + @Nonnull public FielddataRequest build() { _checkSingleUse(); return new FielddataRequest(this); } - - @Override - protected Builder self() { - return this; - } } // --------------------------------------------------------------------------------------------- + @Override + protected void applyQueryParameters(@Nonnull Map params) { + super.applyQueryParameters(params); + if (this.bytes != null) { + params.put("bytes", this.bytes.jsonValue()); + } + } + /** * Endpoint "{@code cat.fielddata}". */ public static final Endpoint _ENDPOINT = new SimpleEndpoint<>( - // Request method - request -> { - return "GET"; - - }, - + request -> "GET", // Request path request -> { final int _fields = 1 << 0; @@ -178,34 +232,41 @@ protected Builder self() { if (ApiTypeHelper.isDefined(request.fields())) propsSet |= _fields; if (propsSet == 0) { - StringBuilder buf = new StringBuilder(); - buf.append("/_cat"); - buf.append("/fielddata"); - return buf.toString(); + return "/_cat/fielddata"; } if (propsSet == (_fields)) { StringBuilder buf = new StringBuilder(); - buf.append("/_cat"); - buf.append("/fielddata"); - buf.append("/"); - SimpleEndpoint.pathEncode(request.fields.stream().map(v -> v).collect(Collectors.joining(",")), buf); + buf.append("/_cat/fielddata/"); + SimpleEndpoint.pathEncode(String.join(",", request.fields), buf); return buf.toString(); } - throw SimpleEndpoint.noPathTemplateFound("path"); + throw SimpleEndpoint.noPathTemplateFound("path"); }, - // Request parameters request -> { - Map params = new HashMap<>(request.queryParameters()); - if (request.bytes != null) { - params.put("bytes", request.bytes.jsonValue()); - } + Map params = new HashMap<>(); + request.applyQueryParameters(params); return params; - }, SimpleEndpoint.emptyMap(), false, FielddataResponse._DESERIALIZER ); + + @Override + public int hashCode() { + int result = 17; + result = 31 * result + Objects.hashCode(this.bytes); + result = 31 * result + Objects.hashCode(this.fields); + return result; + } + + @Override + public boolean equals(Object o) { + if (this == o) return true; + if (o == null || this.getClass() != o.getClass()) return false; + FielddataRequest other = (FielddataRequest) o; + return Objects.equals(this.bytes, other.bytes) && Objects.equals(this.fields, other.fields); + } } diff --git a/java-client/src/main/java/org/opensearch/client/opensearch/cat/FielddataResponse.java b/java-client/src/generated/java/org/opensearch/client/opensearch/cat/FielddataResponse.java similarity index 75% rename from java-client/src/main/java/org/opensearch/client/opensearch/cat/FielddataResponse.java rename to java-client/src/generated/java/org/opensearch/client/opensearch/cat/FielddataResponse.java index 47edbd31ce..778a48f300 100644 --- a/java-client/src/main/java/org/opensearch/client/opensearch/cat/FielddataResponse.java +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/cat/FielddataResponse.java @@ -30,43 +30,51 @@ * GitHub history for details. */ +//---------------------------------------------------- +// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. +//---------------------------------------------------- + package org.opensearch.client.opensearch.cat; 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; import org.opensearch.client.json.PlainJsonSerializable; import org.opensearch.client.opensearch.cat.fielddata.FielddataRecord; 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: cat.fielddata.Response @JsonpDeserializable -public class FielddataResponse implements PlainJsonSerializable { +@Generated("org.opensearch.client.codegen.CodeGenerator") +public class FielddataResponse implements PlainJsonSerializable, ToCopyableBuilder { + + @Nonnull private final List valueBody; // --------------------------------------------------------------------------------------------- private FielddataResponse(Builder builder) { - this.valueBody = ApiTypeHelper.unmodifiableRequired(builder.valueBody, this, "valueBody"); - } - public static FielddataResponse of(Function> fn) { + public static FielddataResponse of(Function> fn) { return fn.apply(new Builder()).build(); } /** * Required - Response value. - *

- * API name: {@code _value_body} */ + @Nonnull public final List valueBody() { return this.valueBody; } @@ -78,28 +86,53 @@ public void serialize(JsonGenerator generator, JsonpMapper mapper) { generator.writeStartArray(); for (FielddataRecord item0 : this.valueBody) { 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 FielddataResponse}. */ - - public static class Builder extends ObjectBuilderBase implements ObjectBuilder { + public static class Builder extends ObjectBuilderBase implements CopyableBuilder { private List valueBody; + public Builder() {} + + private Builder(FielddataResponse o) { + this.valueBody = _listCopy(o.valueBody); + } + + private Builder(Builder o) { + this.valueBody = _listCopy(o.valueBody); + } + + @Override + @Nonnull + public Builder copy() { + return new Builder(this); + } + /** * Required - Response value. - *

- * API name: {@code _value_body} + * *

* Adds all elements of list to valueBody. + *

*/ + @Nonnull public final Builder valueBody(List list) { this.valueBody = _listAddAll(this.valueBody, list); return this; @@ -107,11 +140,12 @@ public final Builder valueBody(List list) { /** * Required - Response value. - *

- * API name: {@code _value_body} + * *

* Adds one or more values to valueBody. + *

*/ + @Nonnull public final Builder valueBody(FielddataRecord value, FielddataRecord... values) { this.valueBody = _listAdd(this.valueBody, value, values); return this; @@ -119,11 +153,12 @@ public final Builder valueBody(FielddataRecord value, FielddataRecord... values) /** * Required - Response value. - *

- * API name: {@code _value_body} + * *

* Adds a value to valueBody using a builder lambda. + *

*/ + @Nonnull public final Builder valueBody(Function> fn) { return valueBody(fn.apply(new FielddataRecord.Builder()).build()); } @@ -131,9 +166,10 @@ public final Builder valueBody(Function _DESERIALIZER = createFielddataResponseDeserializer(); protected static JsonpDeserializer createFielddataResponseDeserializer() { - JsonpDeserializer> valueDeserializer = JsonpDeserializer.arrayDeserializer(FielddataRecord._DESERIALIZER); return JsonpDeserializer.of( @@ -152,5 +187,4 @@ protected static JsonpDeserializer createFielddataResponseDes (parser, mapper) -> new Builder().valueBody(valueDeserializer.deserialize(parser, mapper)).build() ); } - } diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/cat/OpenSearchCatAsyncClientBase.java b/java-client/src/generated/java/org/opensearch/client/opensearch/cat/OpenSearchCatAsyncClientBase.java index cff45b8ca8..45989f4f19 100644 --- a/java-client/src/generated/java/org/opensearch/client/opensearch/cat/OpenSearchCatAsyncClientBase.java +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/cat/OpenSearchCatAsyncClientBase.java @@ -163,6 +163,32 @@ public final CompletableFuture count() throws IOException, OpenSe return count(new CountRequest.Builder().build()); } + // ----- Endpoint: cat.fielddata + + /** + * Shows how much heap memory is currently being used by field data on every data node in the cluster. + */ + public CompletableFuture fielddata(FielddataRequest request) throws IOException, OpenSearchException { + return this.transport.performRequestAsync(request, FielddataRequest._ENDPOINT, this.transportOptions); + } + + /** + * Shows how much heap memory is currently being used by field data on every data node in the cluster. + * + * @param fn a function that initializes a builder to create the {@link FielddataRequest} + */ + public final CompletableFuture fielddata(Function> fn) + throws IOException, OpenSearchException { + return fielddata(fn.apply(new FielddataRequest.Builder()).build()); + } + + /** + * Shows how much heap memory is currently being used by field data on every data node in the cluster. + */ + public final CompletableFuture fielddata() throws IOException, OpenSearchException { + return fielddata(new FielddataRequest.Builder().build()); + } + // ----- Endpoint: cat.master /** diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/cat/OpenSearchCatClientBase.java b/java-client/src/generated/java/org/opensearch/client/opensearch/cat/OpenSearchCatClientBase.java index 8213283727..2192a05580 100644 --- a/java-client/src/generated/java/org/opensearch/client/opensearch/cat/OpenSearchCatClientBase.java +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/cat/OpenSearchCatClientBase.java @@ -159,6 +159,32 @@ public final CountResponse count() throws IOException, OpenSearchException { return count(new CountRequest.Builder().build()); } + // ----- Endpoint: cat.fielddata + + /** + * Shows how much heap memory is currently being used by field data on every data node in the cluster. + */ + public FielddataResponse fielddata(FielddataRequest request) throws IOException, OpenSearchException { + return this.transport.performRequest(request, FielddataRequest._ENDPOINT, this.transportOptions); + } + + /** + * Shows how much heap memory is currently being used by field data on every data node in the cluster. + * + * @param fn a function that initializes a builder to create the {@link FielddataRequest} + */ + public final FielddataResponse fielddata(Function> fn) throws IOException, + OpenSearchException { + return fielddata(fn.apply(new FielddataRequest.Builder()).build()); + } + + /** + * Shows how much heap memory is currently being used by field data on every data node in the cluster. + */ + public final FielddataResponse fielddata() throws IOException, OpenSearchException { + return fielddata(new FielddataRequest.Builder().build()); + } + // ----- Endpoint: cat.master /** diff --git a/java-client/src/main/java/org/opensearch/client/opensearch/cat/fielddata/FielddataRecord.java b/java-client/src/generated/java/org/opensearch/client/opensearch/cat/fielddata/FielddataRecord.java similarity index 70% rename from java-client/src/main/java/org/opensearch/client/opensearch/cat/fielddata/FielddataRecord.java rename to java-client/src/generated/java/org/opensearch/client/opensearch/cat/fielddata/FielddataRecord.java index 4ffb1e12c0..aaabb2fc0c 100644 --- a/java-client/src/main/java/org/opensearch/client/opensearch/cat/fielddata/FielddataRecord.java +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/cat/fielddata/FielddataRecord.java @@ -30,10 +30,17 @@ * GitHub history for details. */ +//---------------------------------------------------- +// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. +//---------------------------------------------------- + package org.opensearch.client.opensearch.cat.fielddata; import jakarta.json.stream.JsonGenerator; +import java.util.Objects; import java.util.function.Function; +import javax.annotation.Generated; +import javax.annotation.Nonnull; import javax.annotation.Nullable; import org.opensearch.client.json.JsonpDeserializable; import org.opensearch.client.json.JsonpDeserializer; @@ -41,27 +48,31 @@ import org.opensearch.client.json.ObjectBuilderDeserializer; import org.opensearch.client.json.ObjectDeserializer; import org.opensearch.client.json.PlainJsonSerializable; +import org.opensearch.client.util.CopyableBuilder; import org.opensearch.client.util.ObjectBuilder; import org.opensearch.client.util.ObjectBuilderBase; +import org.opensearch.client.util.ToCopyableBuilder; // typedef: cat.fielddata.FielddataRecord @JsonpDeserializable -public class FielddataRecord implements PlainJsonSerializable { +@Generated("org.opensearch.client.codegen.CodeGenerator") +public class FielddataRecord implements PlainJsonSerializable, ToCopyableBuilder { + @Nullable - private final String id; + private final String field; @Nullable private final String host; @Nullable - private final String ip; + private final String id; @Nullable - private final String node; + private final String ip; @Nullable - private final String field; + private final String node; @Nullable private final String size; @@ -69,34 +80,34 @@ public class FielddataRecord implements PlainJsonSerializable { // --------------------------------------------------------------------------------------------- private FielddataRecord(Builder builder) { - - this.id = builder.id; + this.field = builder.field; this.host = builder.host; + this.id = builder.id; this.ip = builder.ip; this.node = builder.node; - this.field = builder.field; this.size = builder.size; - } - public static FielddataRecord of(Function> fn) { + public static FielddataRecord of(Function> fn) { return fn.apply(new Builder()).build(); } /** - * node id + * field name *

- * API name: {@code id} + * API name: {@code field} + *

*/ @Nullable - public final String id() { - return this.id; + public final String field() { + return this.field; } /** - * host name + * hostname *

* API name: {@code host} + *

*/ @Nullable public final String host() { @@ -104,9 +115,21 @@ public final String host() { } /** - * ip address + * node id + *

+ * API name: {@code id} + *

+ */ + @Nullable + public final String id() { + return this.id; + } + + /** + * IP address *

* API name: {@code ip} + *

*/ @Nullable public final String ip() { @@ -117,26 +140,18 @@ public final String ip() { * node name *

* API name: {@code node} + *

*/ @Nullable public final String node() { return this.node; } - /** - * field name - *

- * API name: {@code field} - */ - @Nullable - public final String field() { - return this.field; - } - /** * field data usage *

* API name: {@code size} + *

*/ @Nullable public final String size() { @@ -146,6 +161,7 @@ public final String size() { /** * Serialize this object to JSON. */ + @Override public void serialize(JsonGenerator generator, JsonpMapper mapper) { generator.writeStartObject(); serializeInternal(generator, mapper); @@ -153,90 +169,136 @@ public void serialize(JsonGenerator generator, JsonpMapper mapper) { } protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { - - if (this.id != null) { - generator.writeKey("id"); - generator.write(this.id); - + if (this.field != null) { + generator.writeKey("field"); + generator.write(this.field); } + if (this.host != null) { generator.writeKey("host"); generator.write(this.host); + } + if (this.id != null) { + generator.writeKey("id"); + generator.write(this.id); } + if (this.ip != null) { generator.writeKey("ip"); generator.write(this.ip); - } + if (this.node != null) { generator.writeKey("node"); generator.write(this.node); - } - if (this.field != null) { - generator.writeKey("field"); - generator.write(this.field); - } if (this.size != null) { generator.writeKey("size"); generator.write(this.size); - } - } // --------------------------------------------------------------------------------------------- + @Override + @Nonnull + public Builder toBuilder() { + return new Builder(this); + } + + @Nonnull + public static Builder builder() { + return new Builder(); + } + /** * Builder for {@link FielddataRecord}. */ - - public static class Builder extends ObjectBuilderBase implements ObjectBuilder { + public static class Builder extends ObjectBuilderBase implements CopyableBuilder { @Nullable - private String id; - + private String field; @Nullable private String host; - + @Nullable + private String id; @Nullable private String ip; - @Nullable private String node; - - @Nullable - private String field; - @Nullable private String size; + public Builder() {} + + private Builder(FielddataRecord o) { + this.field = o.field; + this.host = o.host; + this.id = o.id; + this.ip = o.ip; + this.node = o.node; + this.size = o.size; + } + + private Builder(Builder o) { + this.field = o.field; + this.host = o.host; + this.id = o.id; + this.ip = o.ip; + this.node = o.node; + this.size = o.size; + } + + @Override + @Nonnull + public Builder copy() { + return new Builder(this); + } + /** - * node id + * field name *

- * API name: {@code id} + * API name: {@code field} + *

*/ - public final Builder id(@Nullable String value) { - this.id = value; + @Nonnull + public final Builder field(@Nullable String value) { + this.field = value; return this; } /** - * host name + * hostname *

* API name: {@code host} + *

*/ + @Nonnull public final Builder host(@Nullable String value) { this.host = value; return this; } /** - * ip address + * node id + *

+ * API name: {@code id} + *

+ */ + @Nonnull + public final Builder id(@Nullable String value) { + this.id = value; + return this; + } + + /** + * IP address *

* API name: {@code ip} + *

*/ + @Nonnull public final Builder ip(@Nullable String value) { this.ip = value; return this; @@ -246,27 +308,21 @@ public final Builder ip(@Nullable String value) { * node name *

* API name: {@code node} + *

*/ + @Nonnull public final Builder node(@Nullable String value) { this.node = value; return this; } - /** - * field name - *

- * API name: {@code field} - */ - public final Builder field(@Nullable String value) { - this.field = value; - return this; - } - /** * field data usage *

* API name: {@code size} + *

*/ + @Nonnull public final Builder size(@Nullable String value) { this.size = value; return this; @@ -275,9 +331,10 @@ public final Builder size(@Nullable String value) { /** * Builds a {@link FielddataRecord}. * - * @throws NullPointerException - * if some of the required fields are null. + * @throws NullPointerException if some of the required fields are null. */ + @Override + @Nonnull public FielddataRecord build() { _checkSingleUse(); @@ -296,14 +353,36 @@ public FielddataRecord build() { ); protected static void setupFielddataRecordDeserializer(ObjectDeserializer op) { - + op.add(Builder::field, JsonpDeserializer.stringDeserializer(), "field"); + op.add(Builder::host, JsonpDeserializer.stringDeserializer(), "host"); op.add(Builder::id, JsonpDeserializer.stringDeserializer(), "id"); - op.add(Builder::host, JsonpDeserializer.stringDeserializer(), "host", "h"); op.add(Builder::ip, JsonpDeserializer.stringDeserializer(), "ip"); - op.add(Builder::node, JsonpDeserializer.stringDeserializer(), "node", "n"); - op.add(Builder::field, JsonpDeserializer.stringDeserializer(), "field", "f"); + op.add(Builder::node, JsonpDeserializer.stringDeserializer(), "node"); op.add(Builder::size, JsonpDeserializer.stringDeserializer(), "size"); + } + @Override + public int hashCode() { + int result = 17; + result = 31 * result + Objects.hashCode(this.field); + result = 31 * result + Objects.hashCode(this.host); + result = 31 * result + Objects.hashCode(this.id); + result = 31 * result + Objects.hashCode(this.ip); + result = 31 * result + Objects.hashCode(this.node); + result = 31 * result + Objects.hashCode(this.size); + return result; } + @Override + public boolean equals(Object o) { + if (this == o) return true; + if (o == null || this.getClass() != o.getClass()) return false; + FielddataRecord other = (FielddataRecord) o; + return Objects.equals(this.field, other.field) + && Objects.equals(this.host, other.host) + && Objects.equals(this.id, other.id) + && Objects.equals(this.ip, other.ip) + && Objects.equals(this.node, other.node) + && Objects.equals(this.size, other.size); + } } diff --git a/java-client/src/main/java/org/opensearch/client/opensearch/cat/OpenSearchCatAsyncClient.java b/java-client/src/main/java/org/opensearch/client/opensearch/cat/OpenSearchCatAsyncClient.java index 08f1056bca..006fc0b487 100644 --- a/java-client/src/main/java/org/opensearch/client/opensearch/cat/OpenSearchCatAsyncClient.java +++ b/java-client/src/main/java/org/opensearch/client/opensearch/cat/OpenSearchCatAsyncClient.java @@ -61,55 +61,6 @@ public OpenSearchCatAsyncClient withTransportOptions(@Nullable TransportOptions return new OpenSearchCatAsyncClient(this.transport, transportOptions); } - // ----- Endpoint: cat.fielddata - - /** - * Shows how much heap memory is currently being used by fielddata on every data - * node in the cluster. - * - * - */ - - public CompletableFuture fielddata(FielddataRequest request) throws IOException, OpenSearchException { - @SuppressWarnings("unchecked") - JsonEndpoint endpoint = (JsonEndpoint< - FielddataRequest, - FielddataResponse, - ErrorResponse>) FielddataRequest._ENDPOINT; - - return this.transport.performRequestAsync(request, endpoint, this.transportOptions); - } - - /** - * Shows how much heap memory is currently being used by fielddata on every data - * node in the cluster. - * - * @param fn - * a function that initializes a builder to create the - * {@link FielddataRequest} - * - */ - - public final CompletableFuture fielddata(Function> fn) - throws IOException, OpenSearchException { - return fielddata(fn.apply(new FielddataRequest.Builder()).build()); - } - - /** - * Shows how much heap memory is currently being used by fielddata on every data - * node in the cluster. - * - * - */ - - public CompletableFuture fielddata() throws IOException, OpenSearchException { - return this.transport.performRequestAsync( - new FielddataRequest.Builder().build(), - FielddataRequest._ENDPOINT, - this.transportOptions - ); - } - // ----- Endpoint: cat.health /** diff --git a/java-client/src/main/java/org/opensearch/client/opensearch/cat/OpenSearchCatClient.java b/java-client/src/main/java/org/opensearch/client/opensearch/cat/OpenSearchCatClient.java index 58ada8b461..f7e39f7275 100644 --- a/java-client/src/main/java/org/opensearch/client/opensearch/cat/OpenSearchCatClient.java +++ b/java-client/src/main/java/org/opensearch/client/opensearch/cat/OpenSearchCatClient.java @@ -60,51 +60,6 @@ public OpenSearchCatClient withTransportOptions(@Nullable TransportOptions trans return new OpenSearchCatClient(this.transport, transportOptions); } - // ----- Endpoint: cat.fielddata - - /** - * Shows how much heap memory is currently being used by fielddata on every data - * node in the cluster. - * - * - */ - - public FielddataResponse fielddata(FielddataRequest request) throws IOException, OpenSearchException { - @SuppressWarnings("unchecked") - JsonEndpoint endpoint = (JsonEndpoint< - FielddataRequest, - FielddataResponse, - ErrorResponse>) FielddataRequest._ENDPOINT; - - return this.transport.performRequest(request, endpoint, this.transportOptions); - } - - /** - * Shows how much heap memory is currently being used by fielddata on every data - * node in the cluster. - * - * @param fn - * a function that initializes a builder to create the - * {@link FielddataRequest} - * - */ - - public final FielddataResponse fielddata(Function> fn) throws IOException, - OpenSearchException { - return fielddata(fn.apply(new FielddataRequest.Builder()).build()); - } - - /** - * Shows how much heap memory is currently being used by fielddata on every data - * node in the cluster. - * - * - */ - - public FielddataResponse fielddata() throws IOException, OpenSearchException { - return this.transport.performRequest(new FielddataRequest.Builder().build(), FielddataRequest._ENDPOINT, this.transportOptions); - } - // ----- Endpoint: cat.health /** diff --git a/java-codegen/src/main/java/org/opensearch/client/codegen/CodeGenerator.java b/java-codegen/src/main/java/org/opensearch/client/codegen/CodeGenerator.java index 6585bfb955..336bd29152 100644 --- a/java-codegen/src/main/java/org/opensearch/client/codegen/CodeGenerator.java +++ b/java-codegen/src/main/java/org/opensearch/client/codegen/CodeGenerator.java @@ -48,7 +48,7 @@ public class CodeGenerator { private static final Logger LOGGER = LogManager.getLogger(); private static final Matcher OPERATION_MATCHER = or( and(namespace(isNull()), name(is("info"))), - and(namespace(is("cat")), name(isOneOf("aliases", "allocation", "cluster_manager", "count", "master"))), + and(namespace(is("cat")), name(isOneOf("aliases", "allocation", "cluster_manager", "count", "fielddata", "master"))), and( namespace(is("cluster")), name( @@ -67,12 +67,14 @@ public class CodeGenerator { namespace(is("ml")), name( // TODO: search_models is complex and ideally should re-use the search structures - not(or( - contains("predict"), - contains("search"), - contains("train"), - isOneOf("get_connector", "update_connector", "update_model_group") - )) + not( + or( + contains("predict"), + contains("search"), + contains("train"), + isOneOf("get_connector", "update_connector", "update_model_group") + ) + ) ) ), and( From 8395eea170ae5dba371f31fb031648badcc51ece Mon Sep 17 00:00:00 2001 From: Thomas Farr Date: Tue, 7 Jan 2025 17:09:34 +1300 Subject: [PATCH 06/18] Generate cat.health Signed-off-by: Thomas Farr --- .../client/opensearch/_types/TimeUnit.java | 20 +- .../client/opensearch/cat/HealthRequest.java | 235 ++++++++ .../client/opensearch/cat/HealthResponse.java | 74 ++- .../cat/OpenSearchCatAsyncClientBase.java | 26 + .../cat/OpenSearchCatClientBase.java | 26 + .../opensearch/cat/health/HealthRecord.java | 568 +++++++++++------- .../client/opensearch/cat/HealthRequest.java | 147 ----- .../cat/OpenSearchCatAsyncClient.java | 42 -- .../opensearch/cat/OpenSearchCatClient.java | 42 -- java-codegen/opensearch-openapi.yaml | 31 +- .../client/codegen/CodeGenerator.java | 2 +- 11 files changed, 738 insertions(+), 475 deletions(-) rename java-client/src/{main => generated}/java/org/opensearch/client/opensearch/_types/TimeUnit.java (85%) create mode 100644 java-client/src/generated/java/org/opensearch/client/opensearch/cat/HealthRequest.java rename java-client/src/{main => generated}/java/org/opensearch/client/opensearch/cat/HealthResponse.java (75%) rename java-client/src/{main => generated}/java/org/opensearch/client/opensearch/cat/health/HealthRecord.java (67%) delete mode 100644 java-client/src/main/java/org/opensearch/client/opensearch/cat/HealthRequest.java diff --git a/java-client/src/main/java/org/opensearch/client/opensearch/_types/TimeUnit.java b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/TimeUnit.java similarity index 85% rename from java-client/src/main/java/org/opensearch/client/opensearch/_types/TimeUnit.java rename to java-client/src/generated/java/org/opensearch/client/opensearch/_types/TimeUnit.java index a525661224..1d9da9696e 100644 --- a/java-client/src/main/java/org/opensearch/client/opensearch/_types/TimeUnit.java +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/TimeUnit.java @@ -30,28 +30,34 @@ * GitHub history for details. */ +//---------------------------------------------------- +// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. +//---------------------------------------------------- + package org.opensearch.client.opensearch._types; +import javax.annotation.Generated; import org.opensearch.client.json.JsonEnum; import org.opensearch.client.json.JsonpDeserializable; +// typedef: _types.TimeUnit + @JsonpDeserializable +@Generated("org.opensearch.client.codegen.CodeGenerator") public enum TimeUnit implements JsonEnum { - Nanoseconds("nanos"), + Days("d"), + + Hours("h"), Microseconds("micros"), Milliseconds("ms"), - Seconds("s"), - Minutes("m"), - Hours("h"), - - Days("d"), + Nanoseconds("nanos"), - ; + Seconds("s"); private final String jsonValue; diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/cat/HealthRequest.java b/java-client/src/generated/java/org/opensearch/client/opensearch/cat/HealthRequest.java new file mode 100644 index 0000000000..b619b3b11a --- /dev/null +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/cat/HealthRequest.java @@ -0,0 +1,235 @@ +/* + * SPDX-License-Identifier: Apache-2.0 + * + * The OpenSearch Contributors require contributions made to + * this file be licensed under the Apache-2.0 license or a + * compatible open source license. + */ + +/* + * Licensed to Elasticsearch B.V. under one or more contributor + * license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright + * ownership. Elasticsearch B.V. licenses this file to you under + * the Apache License, Version 2.0 (the "License"); you may + * not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +/* + * Modifications Copyright OpenSearch Contributors. See + * GitHub history for details. + */ + +//---------------------------------------------------- +// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. +//---------------------------------------------------- + +package org.opensearch.client.opensearch.cat; + +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.TimeUnit; +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.ToCopyableBuilder; + +// typedef: cat.health.Request + +/** + * Returns a concise representation of the cluster health. + */ +@Generated("org.opensearch.client.codegen.CodeGenerator") +public final class HealthRequest extends CatRequestBase implements ToCopyableBuilder { + + @Nullable + private final TimeUnit time; + + @Nullable + private final Boolean ts; + + // --------------------------------------------------------------------------------------------- + + private HealthRequest(Builder builder) { + super(builder); + this.time = builder.time; + this.ts = builder.ts; + } + + public static HealthRequest of(Function> fn) { + return fn.apply(new Builder()).build(); + } + + /** + * The unit used to display time values. + *

+ * API name: {@code time} + *

+ */ + @Nullable + public final TimeUnit time() { + return this.time; + } + + /** + * When true, returns HH:MM:SS and Unix epoch timestamps. + *

+ * API name: {@code ts} + *

+ */ + @Nullable + public final Boolean ts() { + return this.ts; + } + + // --------------------------------------------------------------------------------------------- + + @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 CatRequestBase.AbstractBuilder implements CopyableBuilder { + @Nullable + private TimeUnit time; + @Nullable + private Boolean ts; + + public Builder() {} + + private Builder(HealthRequest o) { + super(o); + this.time = o.time; + this.ts = o.ts; + } + + private Builder(Builder o) { + super(o); + this.time = o.time; + this.ts = o.ts; + } + + @Override + @Nonnull + public Builder copy() { + return new Builder(this); + } + + @Override + @Nonnull + protected Builder self() { + return this; + } + + /** + * The unit used to display time values. + *

+ * API name: {@code time} + *

+ */ + @Nonnull + public final Builder time(@Nullable TimeUnit value) { + this.time = value; + return this; + } + + /** + * When true, returns HH:MM:SS and Unix epoch timestamps. + *

+ * API name: {@code ts} + *

+ */ + @Nonnull + public final Builder ts(@Nullable Boolean value) { + this.ts = value; + return this; + } + + /** + * Builds a {@link HealthRequest}. + * + * @throws NullPointerException if some of the required fields are null. + */ + @Override + @Nonnull + public HealthRequest build() { + _checkSingleUse(); + + return new HealthRequest(this); + } + } + + // --------------------------------------------------------------------------------------------- + + @Override + protected void applyQueryParameters(@Nonnull Map params) { + super.applyQueryParameters(params); + if (this.time != null) { + params.put("time", this.time.jsonValue()); + } + if (this.ts != null) { + params.put("ts", String.valueOf(this.ts)); + } + } + + /** + * Endpoint "{@code cat.health}". + */ + public static final Endpoint _ENDPOINT = new SimpleEndpoint<>( + // Request method + request -> "GET", + // Request path + request -> "/_cat/health", + // Request parameters + request -> { + Map params = new HashMap<>(); + request.applyQueryParameters(params); + return params; + }, + SimpleEndpoint.emptyMap(), + false, + HealthResponse._DESERIALIZER + ); + + @Override + public int hashCode() { + int result = 17; + result = 31 * result + Objects.hashCode(this.time); + result = 31 * result + Objects.hashCode(this.ts); + 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.time, other.time) && Objects.equals(this.ts, other.ts); + } +} diff --git a/java-client/src/main/java/org/opensearch/client/opensearch/cat/HealthResponse.java b/java-client/src/generated/java/org/opensearch/client/opensearch/cat/HealthResponse.java similarity index 75% rename from java-client/src/main/java/org/opensearch/client/opensearch/cat/HealthResponse.java rename to java-client/src/generated/java/org/opensearch/client/opensearch/cat/HealthResponse.java index e6c9ba92dd..f477c4d73f 100644 --- a/java-client/src/main/java/org/opensearch/client/opensearch/cat/HealthResponse.java +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/cat/HealthResponse.java @@ -30,43 +30,51 @@ * GitHub history for details. */ +//---------------------------------------------------- +// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. +//---------------------------------------------------- + package org.opensearch.client.opensearch.cat; 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; import org.opensearch.client.json.PlainJsonSerializable; import org.opensearch.client.opensearch.cat.health.HealthRecord; 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: cat.health.Response @JsonpDeserializable -public class HealthResponse implements PlainJsonSerializable { +@Generated("org.opensearch.client.codegen.CodeGenerator") +public class HealthResponse implements PlainJsonSerializable, ToCopyableBuilder { + + @Nonnull private final List valueBody; // --------------------------------------------------------------------------------------------- private HealthResponse(Builder builder) { - this.valueBody = ApiTypeHelper.unmodifiableRequired(builder.valueBody, this, "valueBody"); - } - public static HealthResponse of(Function> fn) { + public static HealthResponse of(Function> fn) { return fn.apply(new Builder()).build(); } /** * Required - Response value. - *

- * API name: {@code _value_body} */ + @Nonnull public final List valueBody() { return this.valueBody; } @@ -78,28 +86,53 @@ public void serialize(JsonGenerator generator, JsonpMapper mapper) { generator.writeStartArray(); for (HealthRecord item0 : this.valueBody) { 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 HealthResponse}. */ - - public static class Builder extends ObjectBuilderBase implements ObjectBuilder { + public static class Builder extends ObjectBuilderBase implements CopyableBuilder { private List valueBody; + public Builder() {} + + private Builder(HealthResponse o) { + this.valueBody = _listCopy(o.valueBody); + } + + private Builder(Builder o) { + this.valueBody = _listCopy(o.valueBody); + } + + @Override + @Nonnull + public Builder copy() { + return new Builder(this); + } + /** * Required - Response value. - *

- * API name: {@code _value_body} + * *

* Adds all elements of list to valueBody. + *

*/ + @Nonnull public final Builder valueBody(List list) { this.valueBody = _listAddAll(this.valueBody, list); return this; @@ -107,11 +140,12 @@ public final Builder valueBody(List list) { /** * Required - Response value. - *

- * API name: {@code _value_body} + * *

* Adds one or more values to valueBody. + *

*/ + @Nonnull public final Builder valueBody(HealthRecord value, HealthRecord... values) { this.valueBody = _listAdd(this.valueBody, value, values); return this; @@ -119,11 +153,12 @@ public final Builder valueBody(HealthRecord value, HealthRecord... values) { /** * Required - Response value. - *

- * API name: {@code _value_body} + * *

* Adds a value to valueBody using a builder lambda. + *

*/ + @Nonnull public final Builder valueBody(Function> fn) { return valueBody(fn.apply(new HealthRecord.Builder()).build()); } @@ -131,9 +166,10 @@ public final Builder valueBody(Function _DESERIALIZER = createHealthResponseDeserializer(); protected static JsonpDeserializer createHealthResponseDeserializer() { - JsonpDeserializer> valueDeserializer = JsonpDeserializer.arrayDeserializer(HealthRecord._DESERIALIZER); return JsonpDeserializer.of( @@ -152,5 +187,4 @@ protected static JsonpDeserializer createHealthResponseDeseriali (parser, mapper) -> new Builder().valueBody(valueDeserializer.deserialize(parser, mapper)).build() ); } - } diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/cat/OpenSearchCatAsyncClientBase.java b/java-client/src/generated/java/org/opensearch/client/opensearch/cat/OpenSearchCatAsyncClientBase.java index 45989f4f19..1f31d7ee84 100644 --- a/java-client/src/generated/java/org/opensearch/client/opensearch/cat/OpenSearchCatAsyncClientBase.java +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/cat/OpenSearchCatAsyncClientBase.java @@ -189,6 +189,32 @@ public final CompletableFuture fielddata() throws IOException return fielddata(new FielddataRequest.Builder().build()); } + // ----- Endpoint: cat.health + + /** + * Returns a concise representation of the cluster health. + */ + public CompletableFuture health(HealthRequest request) throws IOException, OpenSearchException { + return this.transport.performRequestAsync(request, HealthRequest._ENDPOINT, this.transportOptions); + } + + /** + * Returns a concise representation of the cluster health. + * + * @param fn a function that initializes a builder to create the {@link HealthRequest} + */ + public final CompletableFuture health(Function> fn) + throws IOException, OpenSearchException { + return health(fn.apply(new HealthRequest.Builder()).build()); + } + + /** + * Returns a concise representation of the cluster health. + */ + public final CompletableFuture health() throws IOException, OpenSearchException { + return health(new HealthRequest.Builder().build()); + } + // ----- Endpoint: cat.master /** diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/cat/OpenSearchCatClientBase.java b/java-client/src/generated/java/org/opensearch/client/opensearch/cat/OpenSearchCatClientBase.java index 2192a05580..105a764342 100644 --- a/java-client/src/generated/java/org/opensearch/client/opensearch/cat/OpenSearchCatClientBase.java +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/cat/OpenSearchCatClientBase.java @@ -185,6 +185,32 @@ public final FielddataResponse fielddata() throws IOException, OpenSearchExcepti return fielddata(new FielddataRequest.Builder().build()); } + // ----- Endpoint: cat.health + + /** + * Returns a concise representation of the cluster health. + */ + public HealthResponse health(HealthRequest request) throws IOException, OpenSearchException { + return this.transport.performRequest(request, HealthRequest._ENDPOINT, this.transportOptions); + } + + /** + * Returns a concise representation of the cluster health. + * + * @param fn a function that initializes a builder to create the {@link HealthRequest} + */ + public final HealthResponse health(Function> fn) throws IOException, + OpenSearchException { + return health(fn.apply(new HealthRequest.Builder()).build()); + } + + /** + * Returns a concise representation of the cluster health. + */ + public final HealthResponse health() throws IOException, OpenSearchException { + return health(new HealthRequest.Builder().build()); + } + // ----- Endpoint: cat.master /** diff --git a/java-client/src/main/java/org/opensearch/client/opensearch/cat/health/HealthRecord.java b/java-client/src/generated/java/org/opensearch/client/opensearch/cat/health/HealthRecord.java similarity index 67% rename from java-client/src/main/java/org/opensearch/client/opensearch/cat/health/HealthRecord.java rename to java-client/src/generated/java/org/opensearch/client/opensearch/cat/health/HealthRecord.java index 5ce99313d3..726dcfbe06 100644 --- a/java-client/src/main/java/org/opensearch/client/opensearch/cat/health/HealthRecord.java +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/cat/health/HealthRecord.java @@ -30,10 +30,17 @@ * GitHub history for details. */ +//---------------------------------------------------- +// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. +//---------------------------------------------------- + package org.opensearch.client.opensearch.cat.health; import jakarta.json.stream.JsonGenerator; +import java.util.Objects; import java.util.function.Function; +import javax.annotation.Generated; +import javax.annotation.Nonnull; import javax.annotation.Nullable; import org.opensearch.client.json.JsonpDeserializable; import org.opensearch.client.json.JsonpDeserializer; @@ -41,134 +48,154 @@ import org.opensearch.client.json.ObjectBuilderDeserializer; import org.opensearch.client.json.ObjectDeserializer; import org.opensearch.client.json.PlainJsonSerializable; +import org.opensearch.client.util.CopyableBuilder; import org.opensearch.client.util.ObjectBuilder; import org.opensearch.client.util.ObjectBuilderBase; +import org.opensearch.client.util.ToCopyableBuilder; // typedef: cat.health.HealthRecord @JsonpDeserializable -public class HealthRecord implements PlainJsonSerializable { - @Nullable - private final String epoch; +@Generated("org.opensearch.client.codegen.CodeGenerator") +public class HealthRecord implements PlainJsonSerializable, ToCopyableBuilder { @Nullable - private final String timestamp; + private final String activeShardsPercent; @Nullable private final String cluster; @Nullable - private final String status; + private final String discoveredClusterManager; @Nullable - private final String nodeTotal; + private final String epoch; + + @Nullable + private final String init; + + @Nullable + private final String maxTaskWaitTime; @Nullable private final String nodeData; @Nullable - private final String shards; + private final String nodeTotal; @Nullable - private final String pri; + private final String pendingTasks; @Nullable - private final String relo; + private final String pri; @Nullable - private final String init; + private final String relo; @Nullable - private final String unassign; + private final String shards; @Nullable - private final String pendingTasks; + private final String status; @Nullable - private final String maxTaskWaitTime; + private final String timestamp; @Nullable - private final String activeShardsPercent; + private final String unassign; // --------------------------------------------------------------------------------------------- private HealthRecord(Builder builder) { - - this.epoch = builder.epoch; - this.timestamp = builder.timestamp; + this.activeShardsPercent = builder.activeShardsPercent; this.cluster = builder.cluster; - this.status = builder.status; - this.nodeTotal = builder.nodeTotal; + this.discoveredClusterManager = builder.discoveredClusterManager; + this.epoch = builder.epoch; + this.init = builder.init; + this.maxTaskWaitTime = builder.maxTaskWaitTime; this.nodeData = builder.nodeData; - this.shards = builder.shards; + this.nodeTotal = builder.nodeTotal; + this.pendingTasks = builder.pendingTasks; this.pri = builder.pri; this.relo = builder.relo; - this.init = builder.init; + this.shards = builder.shards; + this.status = builder.status; + this.timestamp = builder.timestamp; this.unassign = builder.unassign; - this.pendingTasks = builder.pendingTasks; - this.maxTaskWaitTime = builder.maxTaskWaitTime; - this.activeShardsPercent = builder.activeShardsPercent; - } - public static HealthRecord of(Function> fn) { + public static HealthRecord of(Function> fn) { return fn.apply(new Builder()).build(); } /** - * seconds since 1969-01-01 00:00:00 + * active number of shards in percent *

- * API name: {@code epoch} + * API name: {@code active_shards_percent} + *

*/ @Nullable - public final String epoch() { - return this.epoch; + public final String activeShardsPercent() { + return this.activeShardsPercent; } /** - * time in HH:MM:SS + * cluster name *

- * API name: {@code timestamp} + * API name: {@code cluster} + *

*/ @Nullable - public final String timestamp() { - return this.timestamp; + public final String cluster() { + return this.cluster; } /** - * cluster name + * cluster manager is discovered or not *

- * API name: {@code cluster} + * API name: {@code discovered_cluster_manager} + *

*/ @Nullable - public final String cluster() { - return this.cluster; + public final String discoveredClusterManager() { + return this.discoveredClusterManager; } /** - * health status + * API name: {@code epoch} + */ + @Nullable + public final String epoch() { + return this.epoch; + } + + /** + * number of initializing nodes *

- * API name: {@code status} + * API name: {@code init} + *

*/ @Nullable - public final String status() { - return this.status; + public final String init() { + return this.init; } /** - * total number of nodes + * wait time of longest task pending *

- * API name: {@code node.total} + * API name: {@code max_task_wait_time} + *

*/ @Nullable - public final String nodeTotal() { - return this.nodeTotal; + public final String maxTaskWaitTime() { + return this.maxTaskWaitTime; } /** * number of nodes that can store data *

* API name: {@code node.data} + *

*/ @Nullable public final String nodeData() { @@ -176,19 +203,32 @@ public final String nodeData() { } /** - * total number of shards + * total number of nodes *

- * API name: {@code shards} + * API name: {@code node.total} + *

*/ @Nullable - public final String shards() { - return this.shards; + public final String nodeTotal() { + return this.nodeTotal; + } + + /** + * number of pending tasks + *

+ * API name: {@code pending_tasks} + *

+ */ + @Nullable + public final String pendingTasks() { + return this.pendingTasks; } /** * number of primary shards *

* API name: {@code pri} + *

*/ @Nullable public final String pri() { @@ -199,6 +239,7 @@ public final String pri() { * number of relocating nodes *

* API name: {@code relo} + *

*/ @Nullable public final String relo() { @@ -206,58 +247,50 @@ public final String relo() { } /** - * number of initializing nodes - *

- * API name: {@code init} - */ - @Nullable - public final String init() { - return this.init; - } - - /** - * number of unassigned shards + * total number of shards *

- * API name: {@code unassign} + * API name: {@code shards} + *

*/ @Nullable - public final String unassign() { - return this.unassign; + public final String shards() { + return this.shards; } /** - * number of pending tasks + * health status *

- * API name: {@code pending_tasks} + * API name: {@code status} + *

*/ @Nullable - public final String pendingTasks() { - return this.pendingTasks; + public final String status() { + return this.status; } /** - * wait time of longest task pending - *

- * API name: {@code max_task_wait_time} + * API name: {@code timestamp} */ @Nullable - public final String maxTaskWaitTime() { - return this.maxTaskWaitTime; + public final String timestamp() { + return this.timestamp; } /** - * active number of shards in percent + * number of unassigned shards *

- * API name: {@code active_shards_percent} + * API name: {@code unassign} + *

*/ @Nullable - public final String activeShardsPercent() { - return this.activeShardsPercent; + public final String unassign() { + return this.unassign; } /** * Serialize this object to JSON. */ + @Override public void serialize(JsonGenerator generator, JsonpMapper mapper) { generator.writeStartObject(); serializeInternal(generator, mapper); @@ -265,176 +298,240 @@ public void serialize(JsonGenerator generator, JsonpMapper mapper) { } protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { - - if (this.epoch != null) { - generator.writeKey("epoch"); - generator.write(this.epoch); - + if (this.activeShardsPercent != null) { + generator.writeKey("active_shards_percent"); + generator.write(this.activeShardsPercent); } - if (this.timestamp != null) { - generator.writeKey("timestamp"); - generator.write(this.timestamp); - } if (this.cluster != null) { generator.writeKey("cluster"); generator.write(this.cluster); + } + if (this.discoveredClusterManager != null) { + generator.writeKey("discovered_cluster_manager"); + generator.write(this.discoveredClusterManager); } - if (this.status != null) { - generator.writeKey("status"); - generator.write(this.status); + if (this.epoch != null) { + generator.writeKey("epoch"); + generator.write(this.epoch); } - if (this.nodeTotal != null) { - generator.writeKey("node.total"); - generator.write(this.nodeTotal); + if (this.init != null) { + generator.writeKey("init"); + generator.write(this.init); } + + if (this.maxTaskWaitTime != null) { + generator.writeKey("max_task_wait_time"); + generator.write(this.maxTaskWaitTime); + } + if (this.nodeData != null) { generator.writeKey("node.data"); generator.write(this.nodeData); + } + if (this.nodeTotal != null) { + generator.writeKey("node.total"); + generator.write(this.nodeTotal); } - if (this.shards != null) { - generator.writeKey("shards"); - generator.write(this.shards); + if (this.pendingTasks != null) { + generator.writeKey("pending_tasks"); + generator.write(this.pendingTasks); } + if (this.pri != null) { generator.writeKey("pri"); generator.write(this.pri); - } + if (this.relo != null) { generator.writeKey("relo"); generator.write(this.relo); - } - if (this.init != null) { - generator.writeKey("init"); - generator.write(this.init); + if (this.shards != null) { + generator.writeKey("shards"); + generator.write(this.shards); } - if (this.unassign != null) { - generator.writeKey("unassign"); - generator.write(this.unassign); + if (this.status != null) { + generator.writeKey("status"); + generator.write(this.status); } - if (this.pendingTasks != null) { - generator.writeKey("pending_tasks"); - generator.write(this.pendingTasks); + if (this.timestamp != null) { + generator.writeKey("timestamp"); + generator.write(this.timestamp); } - if (this.maxTaskWaitTime != null) { - generator.writeKey("max_task_wait_time"); - generator.write(this.maxTaskWaitTime); + if (this.unassign != null) { + generator.writeKey("unassign"); + generator.write(this.unassign); } - if (this.activeShardsPercent != null) { - generator.writeKey("active_shards_percent"); - generator.write(this.activeShardsPercent); + } - } + // --------------------------------------------------------------------------------------------- + @Override + @Nonnull + public Builder toBuilder() { + return new Builder(this); } - // --------------------------------------------------------------------------------------------- + @Nonnull + public static Builder builder() { + return new Builder(); + } /** * Builder for {@link HealthRecord}. */ - - public static class Builder extends ObjectBuilderBase implements ObjectBuilder { + public static class Builder extends ObjectBuilderBase implements CopyableBuilder { @Nullable - private String epoch; - - @Nullable - private String timestamp; - + private String activeShardsPercent; @Nullable private String cluster; - @Nullable - private String status; - + private String discoveredClusterManager; @Nullable - private String nodeTotal; - + private String epoch; + @Nullable + private String init; + @Nullable + private String maxTaskWaitTime; @Nullable private String nodeData; - @Nullable - private String shards; - + private String nodeTotal; + @Nullable + private String pendingTasks; @Nullable private String pri; - @Nullable private String relo; - @Nullable - private String init; - + private String shards; + @Nullable + private String status; + @Nullable + private String timestamp; @Nullable private String unassign; - @Nullable - private String pendingTasks; + public Builder() {} + + private Builder(HealthRecord o) { + this.activeShardsPercent = o.activeShardsPercent; + this.cluster = o.cluster; + this.discoveredClusterManager = o.discoveredClusterManager; + this.epoch = o.epoch; + this.init = o.init; + this.maxTaskWaitTime = o.maxTaskWaitTime; + this.nodeData = o.nodeData; + this.nodeTotal = o.nodeTotal; + this.pendingTasks = o.pendingTasks; + this.pri = o.pri; + this.relo = o.relo; + this.shards = o.shards; + this.status = o.status; + this.timestamp = o.timestamp; + this.unassign = o.unassign; + } - @Nullable - private String maxTaskWaitTime; + private Builder(Builder o) { + this.activeShardsPercent = o.activeShardsPercent; + this.cluster = o.cluster; + this.discoveredClusterManager = o.discoveredClusterManager; + this.epoch = o.epoch; + this.init = o.init; + this.maxTaskWaitTime = o.maxTaskWaitTime; + this.nodeData = o.nodeData; + this.nodeTotal = o.nodeTotal; + this.pendingTasks = o.pendingTasks; + this.pri = o.pri; + this.relo = o.relo; + this.shards = o.shards; + this.status = o.status; + this.timestamp = o.timestamp; + this.unassign = o.unassign; + } - @Nullable - private String activeShardsPercent; + @Override + @Nonnull + public Builder copy() { + return new Builder(this); + } /** - * seconds since 1969-01-01 00:00:00 + * active number of shards in percent *

- * API name: {@code epoch} + * API name: {@code active_shards_percent} + *

*/ - public final Builder epoch(@Nullable String value) { - this.epoch = value; + @Nonnull + public final Builder activeShardsPercent(@Nullable String value) { + this.activeShardsPercent = value; return this; } /** - * time in HH:MM:SS + * cluster name *

- * API name: {@code timestamp} + * API name: {@code cluster} + *

*/ - public final Builder timestamp(@Nullable String value) { - this.timestamp = value; + @Nonnull + public final Builder cluster(@Nullable String value) { + this.cluster = value; return this; } /** - * cluster name + * cluster manager is discovered or not *

- * API name: {@code cluster} + * API name: {@code discovered_cluster_manager} + *

*/ - public final Builder cluster(@Nullable String value) { - this.cluster = value; + @Nonnull + public final Builder discoveredClusterManager(@Nullable String value) { + this.discoveredClusterManager = value; return this; } /** - * health status + * API name: {@code epoch} + */ + @Nonnull + public final Builder epoch(@Nullable String value) { + this.epoch = value; + return this; + } + + /** + * number of initializing nodes *

- * API name: {@code status} + * API name: {@code init} + *

*/ - public final Builder status(@Nullable String value) { - this.status = value; + @Nonnull + public final Builder init(@Nullable String value) { + this.init = value; return this; } /** - * total number of nodes + * wait time of longest task pending *

- * API name: {@code node.total} + * API name: {@code max_task_wait_time} + *

*/ - public final Builder nodeTotal(@Nullable String value) { - this.nodeTotal = value; + @Nonnull + public final Builder maxTaskWaitTime(@Nullable String value) { + this.maxTaskWaitTime = value; return this; } @@ -442,19 +539,35 @@ public final Builder nodeTotal(@Nullable String value) { * number of nodes that can store data *

* API name: {@code node.data} + *

*/ + @Nonnull public final Builder nodeData(@Nullable String value) { this.nodeData = value; return this; } /** - * total number of shards + * total number of nodes *

- * API name: {@code shards} + * API name: {@code node.total} + *

*/ - public final Builder shards(@Nullable String value) { - this.shards = value; + @Nonnull + public final Builder nodeTotal(@Nullable String value) { + this.nodeTotal = value; + return this; + } + + /** + * number of pending tasks + *

+ * API name: {@code pending_tasks} + *

+ */ + @Nonnull + public final Builder pendingTasks(@Nullable String value) { + this.pendingTasks = value; return this; } @@ -462,7 +575,9 @@ public final Builder shards(@Nullable String value) { * number of primary shards *

* API name: {@code pri} + *

*/ + @Nonnull public final Builder pri(@Nullable String value) { this.pri = value; return this; @@ -472,68 +587,66 @@ public final Builder pri(@Nullable String value) { * number of relocating nodes *

* API name: {@code relo} + *

*/ + @Nonnull public final Builder relo(@Nullable String value) { this.relo = value; return this; } /** - * number of initializing nodes - *

- * API name: {@code init} - */ - public final Builder init(@Nullable String value) { - this.init = value; - return this; - } - - /** - * number of unassigned shards + * total number of shards *

- * API name: {@code unassign} + * API name: {@code shards} + *

*/ - public final Builder unassign(@Nullable String value) { - this.unassign = value; + @Nonnull + public final Builder shards(@Nullable String value) { + this.shards = value; return this; } /** - * number of pending tasks + * health status *

- * API name: {@code pending_tasks} + * API name: {@code status} + *

*/ - public final Builder pendingTasks(@Nullable String value) { - this.pendingTasks = value; + @Nonnull + public final Builder status(@Nullable String value) { + this.status = value; return this; } /** - * wait time of longest task pending - *

- * API name: {@code max_task_wait_time} + * API name: {@code timestamp} */ - public final Builder maxTaskWaitTime(@Nullable String value) { - this.maxTaskWaitTime = value; + @Nonnull + public final Builder timestamp(@Nullable String value) { + this.timestamp = value; return this; } /** - * active number of shards in percent + * number of unassigned shards *

- * API name: {@code active_shards_percent} + * API name: {@code unassign} + *

*/ - public final Builder activeShardsPercent(@Nullable String value) { - this.activeShardsPercent = value; + @Nonnull + public final Builder unassign(@Nullable String value) { + this.unassign = value; return this; } /** * Builds a {@link HealthRecord}. * - * @throws NullPointerException - * if some of the required fields are null. + * @throws NullPointerException if some of the required fields are null. */ + @Override + @Nonnull public HealthRecord build() { _checkSingleUse(); @@ -552,22 +665,63 @@ public HealthRecord build() { ); protected static void setupHealthRecordDeserializer(ObjectDeserializer op) { + op.add(Builder::activeShardsPercent, JsonpDeserializer.stringDeserializer(), "active_shards_percent"); + op.add(Builder::cluster, JsonpDeserializer.stringDeserializer(), "cluster"); + op.add(Builder::discoveredClusterManager, JsonpDeserializer.stringDeserializer(), "discovered_cluster_manager"); + op.add(Builder::epoch, JsonpDeserializer.stringDeserializer(), "epoch"); + op.add(Builder::init, JsonpDeserializer.stringDeserializer(), "init"); + op.add(Builder::maxTaskWaitTime, JsonpDeserializer.stringDeserializer(), "max_task_wait_time"); + op.add(Builder::nodeData, JsonpDeserializer.stringDeserializer(), "node.data"); + op.add(Builder::nodeTotal, JsonpDeserializer.stringDeserializer(), "node.total"); + op.add(Builder::pendingTasks, JsonpDeserializer.stringDeserializer(), "pending_tasks"); + op.add(Builder::pri, JsonpDeserializer.stringDeserializer(), "pri"); + op.add(Builder::relo, JsonpDeserializer.stringDeserializer(), "relo"); + op.add(Builder::shards, JsonpDeserializer.stringDeserializer(), "shards"); + op.add(Builder::status, JsonpDeserializer.stringDeserializer(), "status"); + op.add(Builder::timestamp, JsonpDeserializer.stringDeserializer(), "timestamp"); + op.add(Builder::unassign, JsonpDeserializer.stringDeserializer(), "unassign"); + } - op.add(Builder::epoch, JsonpDeserializer.stringDeserializer(), "epoch", "time"); - op.add(Builder::timestamp, JsonpDeserializer.stringDeserializer(), "timestamp", "ts", "hms", "hhmmss"); - op.add(Builder::cluster, JsonpDeserializer.stringDeserializer(), "cluster", "cl"); - op.add(Builder::status, JsonpDeserializer.stringDeserializer(), "status", "st"); - op.add(Builder::nodeTotal, JsonpDeserializer.stringDeserializer(), "node.total", "nt", "nodeTotal"); - op.add(Builder::nodeData, JsonpDeserializer.stringDeserializer(), "node.data", "nd", "nodeData"); - op.add(Builder::shards, JsonpDeserializer.stringDeserializer(), "shards", "t", "sh", "shards.total", "shardsTotal"); - op.add(Builder::pri, JsonpDeserializer.stringDeserializer(), "pri", "p", "shards.primary", "shardsPrimary"); - op.add(Builder::relo, JsonpDeserializer.stringDeserializer(), "relo", "r", "shards.relocating", "shardsRelocating"); - op.add(Builder::init, JsonpDeserializer.stringDeserializer(), "init", "i", "shards.initializing", "shardsInitializing"); - op.add(Builder::unassign, JsonpDeserializer.stringDeserializer(), "unassign", "u", "shards.unassigned", "shardsUnassigned"); - op.add(Builder::pendingTasks, JsonpDeserializer.stringDeserializer(), "pending_tasks", "pt", "pendingTasks"); - op.add(Builder::maxTaskWaitTime, JsonpDeserializer.stringDeserializer(), "max_task_wait_time", "mtwt", "maxTaskWaitTime"); - op.add(Builder::activeShardsPercent, JsonpDeserializer.stringDeserializer(), "active_shards_percent", "asp", "activeShardsPercent"); - + @Override + public int hashCode() { + int result = 17; + result = 31 * result + Objects.hashCode(this.activeShardsPercent); + result = 31 * result + Objects.hashCode(this.cluster); + result = 31 * result + Objects.hashCode(this.discoveredClusterManager); + result = 31 * result + Objects.hashCode(this.epoch); + result = 31 * result + Objects.hashCode(this.init); + result = 31 * result + Objects.hashCode(this.maxTaskWaitTime); + result = 31 * result + Objects.hashCode(this.nodeData); + result = 31 * result + Objects.hashCode(this.nodeTotal); + result = 31 * result + Objects.hashCode(this.pendingTasks); + result = 31 * result + Objects.hashCode(this.pri); + result = 31 * result + Objects.hashCode(this.relo); + result = 31 * result + Objects.hashCode(this.shards); + result = 31 * result + Objects.hashCode(this.status); + result = 31 * result + Objects.hashCode(this.timestamp); + result = 31 * result + Objects.hashCode(this.unassign); + return result; } + @Override + public boolean equals(Object o) { + if (this == o) return true; + if (o == null || this.getClass() != o.getClass()) return false; + HealthRecord other = (HealthRecord) o; + return Objects.equals(this.activeShardsPercent, other.activeShardsPercent) + && Objects.equals(this.cluster, other.cluster) + && Objects.equals(this.discoveredClusterManager, other.discoveredClusterManager) + && Objects.equals(this.epoch, other.epoch) + && Objects.equals(this.init, other.init) + && Objects.equals(this.maxTaskWaitTime, other.maxTaskWaitTime) + && Objects.equals(this.nodeData, other.nodeData) + && Objects.equals(this.nodeTotal, other.nodeTotal) + && Objects.equals(this.pendingTasks, other.pendingTasks) + && Objects.equals(this.pri, other.pri) + && Objects.equals(this.relo, other.relo) + && Objects.equals(this.shards, other.shards) + && Objects.equals(this.status, other.status) + && Objects.equals(this.timestamp, other.timestamp) + && Objects.equals(this.unassign, other.unassign); + } } diff --git a/java-client/src/main/java/org/opensearch/client/opensearch/cat/HealthRequest.java b/java-client/src/main/java/org/opensearch/client/opensearch/cat/HealthRequest.java deleted file mode 100644 index 86071c4ad1..0000000000 --- a/java-client/src/main/java/org/opensearch/client/opensearch/cat/HealthRequest.java +++ /dev/null @@ -1,147 +0,0 @@ -/* - * SPDX-License-Identifier: Apache-2.0 - * - * The OpenSearch Contributors require contributions made to - * this file be licensed under the Apache-2.0 license or a - * compatible open source license. - */ - -/* - * Licensed to Elasticsearch B.V. under one or more contributor - * license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright - * ownership. Elasticsearch B.V. licenses this file to you under - * the Apache License, Version 2.0 (the "License"); you may - * not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -/* - * Modifications Copyright OpenSearch Contributors. See - * GitHub history for details. - */ - -package org.opensearch.client.opensearch.cat; - -import java.util.HashMap; -import java.util.Map; -import java.util.function.Function; -import javax.annotation.Nullable; -import org.opensearch.client.opensearch._types.ErrorResponse; -import org.opensearch.client.transport.Endpoint; -import org.opensearch.client.transport.endpoints.SimpleEndpoint; -import org.opensearch.client.util.ObjectBuilder; - -// typedef: cat.health.Request - -/** - * Returns a concise representation of the cluster health. - * - */ - -public class HealthRequest extends CatRequestBase { - @Nullable - private final Boolean ts; - - // --------------------------------------------------------------------------------------------- - - private HealthRequest(Builder builder) { - super(builder); - this.ts = builder.ts; - - } - - public static HealthRequest of(Function> fn) { - return fn.apply(new Builder()).build(); - } - - /** - * Set to false to disable timestamping - *

- * API name: {@code ts} - */ - @Nullable - public final Boolean ts() { - return this.ts; - } - - // --------------------------------------------------------------------------------------------- - - /** - * Builder for {@link HealthRequest}. - */ - - public static class Builder extends CatRequestBaseBuilder { - @Nullable - private Boolean ts; - - /** - * Set to false to disable timestamping - *

- * API name: {@code ts} - */ - public final Builder ts(@Nullable Boolean value) { - this.ts = value; - return this; - } - - /** - * Builds a {@link HealthRequest}. - * - * @throws NullPointerException - * if some of the required fields are null. - */ - public HealthRequest build() { - _checkSingleUse(); - - return new HealthRequest(this); - } - - @Override - protected Builder self() { - return this; - } - } - - // --------------------------------------------------------------------------------------------- - - /** - * Endpoint "{@code cat.health}". - */ - public static final Endpoint _ENDPOINT = new SimpleEndpoint<>( - - // Request method - request -> { - return "GET"; - - }, - - // Request path - request -> { - return "/_cat/health"; - - }, - - // Request parameters - request -> { - Map params = new HashMap<>(request.queryParameters()); - if (request.ts != null) { - params.put("ts", String.valueOf(request.ts)); - } - return params; - - }, - SimpleEndpoint.emptyMap(), - false, - HealthResponse._DESERIALIZER - ); -} diff --git a/java-client/src/main/java/org/opensearch/client/opensearch/cat/OpenSearchCatAsyncClient.java b/java-client/src/main/java/org/opensearch/client/opensearch/cat/OpenSearchCatAsyncClient.java index 006fc0b487..717fca4bd4 100644 --- a/java-client/src/main/java/org/opensearch/client/opensearch/cat/OpenSearchCatAsyncClient.java +++ b/java-client/src/main/java/org/opensearch/client/opensearch/cat/OpenSearchCatAsyncClient.java @@ -61,48 +61,6 @@ public OpenSearchCatAsyncClient withTransportOptions(@Nullable TransportOptions return new OpenSearchCatAsyncClient(this.transport, transportOptions); } - // ----- Endpoint: cat.health - - /** - * Returns a concise representation of the cluster health. - * - * - */ - - public CompletableFuture health(HealthRequest request) throws IOException, OpenSearchException { - @SuppressWarnings("unchecked") - JsonEndpoint endpoint = (JsonEndpoint< - HealthRequest, - HealthResponse, - ErrorResponse>) HealthRequest._ENDPOINT; - - return this.transport.performRequestAsync(request, endpoint, this.transportOptions); - } - - /** - * Returns a concise representation of the cluster health. - * - * @param fn - * a function that initializes a builder to create the - * {@link HealthRequest} - * - */ - - public final CompletableFuture health(Function> fn) - throws IOException, OpenSearchException { - return health(fn.apply(new HealthRequest.Builder()).build()); - } - - /** - * Returns a concise representation of the cluster health. - * - * - */ - - public CompletableFuture health() throws IOException, OpenSearchException { - return this.transport.performRequestAsync(new HealthRequest.Builder().build(), HealthRequest._ENDPOINT, this.transportOptions); - } - // ----- Endpoint: cat.help /** diff --git a/java-client/src/main/java/org/opensearch/client/opensearch/cat/OpenSearchCatClient.java b/java-client/src/main/java/org/opensearch/client/opensearch/cat/OpenSearchCatClient.java index f7e39f7275..4505952bfc 100644 --- a/java-client/src/main/java/org/opensearch/client/opensearch/cat/OpenSearchCatClient.java +++ b/java-client/src/main/java/org/opensearch/client/opensearch/cat/OpenSearchCatClient.java @@ -60,48 +60,6 @@ public OpenSearchCatClient withTransportOptions(@Nullable TransportOptions trans return new OpenSearchCatClient(this.transport, transportOptions); } - // ----- Endpoint: cat.health - - /** - * Returns a concise representation of the cluster health. - * - * - */ - - public HealthResponse health(HealthRequest request) throws IOException, OpenSearchException { - @SuppressWarnings("unchecked") - JsonEndpoint endpoint = (JsonEndpoint< - HealthRequest, - HealthResponse, - ErrorResponse>) HealthRequest._ENDPOINT; - - return this.transport.performRequest(request, endpoint, this.transportOptions); - } - - /** - * Returns a concise representation of the cluster health. - * - * @param fn - * a function that initializes a builder to create the - * {@link HealthRequest} - * - */ - - public final HealthResponse health(Function> fn) throws IOException, - OpenSearchException { - return health(fn.apply(new HealthRequest.Builder()).build()); - } - - /** - * Returns a concise representation of the cluster health. - * - * - */ - - public HealthResponse health() throws IOException, OpenSearchException { - return this.transport.performRequest(new HealthRequest.Builder().build(), HealthRequest._ENDPOINT, this.transportOptions); - } - // ----- Endpoint: cat.help /** diff --git a/java-codegen/opensearch-openapi.yaml b/java-codegen/opensearch-openapi.yaml index bc8ea49dfc..3f2712892a 100644 --- a/java-codegen/opensearch-openapi.yaml +++ b/java-codegen/opensearch-openapi.yaml @@ -34857,15 +34857,28 @@ components: description: Time of day, expressed as HH:MM:SS. type: string _common___TimeUnit: - type: string - enum: - - d - - h - - m - - micros - - ms - - nanos - - s + oneOf: + - title: nanoseconds + type: string + const: nanos + - title: microseconds + type: string + const: micros + - title: milliseconds + type: string + const: ms + - title: seconds + type: string + const: s + - title: minutes + type: string + const: m + - title: hours + type: string + const: h + - title: days + type: string + const: d _common___TimeZone: type: string _common___TopLeftBottomRightGeoBounds: diff --git a/java-codegen/src/main/java/org/opensearch/client/codegen/CodeGenerator.java b/java-codegen/src/main/java/org/opensearch/client/codegen/CodeGenerator.java index 336bd29152..f12c551062 100644 --- a/java-codegen/src/main/java/org/opensearch/client/codegen/CodeGenerator.java +++ b/java-codegen/src/main/java/org/opensearch/client/codegen/CodeGenerator.java @@ -48,7 +48,7 @@ public class CodeGenerator { private static final Logger LOGGER = LogManager.getLogger(); private static final Matcher OPERATION_MATCHER = or( and(namespace(isNull()), name(is("info"))), - and(namespace(is("cat")), name(isOneOf("aliases", "allocation", "cluster_manager", "count", "fielddata", "master"))), + and(namespace(is("cat")), name(isOneOf("aliases", "allocation", "cluster_manager", "count", "fielddata", "health", "master"))), and( namespace(is("cluster")), name( From c3d4161db19f3a199a869f800e8a6510f28934ec Mon Sep 17 00:00:00 2001 From: Thomas Farr Date: Tue, 7 Jan 2025 17:16:17 +1300 Subject: [PATCH 07/18] Generate cat.indices Signed-off-by: Thomas Farr --- .../client/opensearch/cat/IndicesRequest.java | 580 ++ .../opensearch/cat/IndicesResponse.java | 74 +- .../cat/OpenSearchCatAsyncClientBase.java | 29 + .../cat/OpenSearchCatClientBase.java | 29 + .../opensearch/cat/indices/IndicesRecord.java | 5517 ++++++++++------- .../client/opensearch/cat/IndicesRequest.java | 349 -- .../cat/OpenSearchCatAsyncClient.java | 45 - .../opensearch/cat/OpenSearchCatClient.java | 45 - .../client/codegen/CodeGenerator.java | 5 +- 9 files changed, 3901 insertions(+), 2772 deletions(-) create mode 100644 java-client/src/generated/java/org/opensearch/client/opensearch/cat/IndicesRequest.java rename java-client/src/{main => generated}/java/org/opensearch/client/opensearch/cat/IndicesResponse.java (75%) rename java-client/src/{main => generated}/java/org/opensearch/client/opensearch/cat/indices/IndicesRecord.java (66%) delete mode 100644 java-client/src/main/java/org/opensearch/client/opensearch/cat/IndicesRequest.java diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/cat/IndicesRequest.java b/java-client/src/generated/java/org/opensearch/client/opensearch/cat/IndicesRequest.java new file mode 100644 index 0000000000..95a097b22c --- /dev/null +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/cat/IndicesRequest.java @@ -0,0 +1,580 @@ +/* + * SPDX-License-Identifier: Apache-2.0 + * + * The OpenSearch Contributors require contributions made to + * this file be licensed under the Apache-2.0 license or a + * compatible open source license. + */ + +/* + * Licensed to Elasticsearch B.V. under one or more contributor + * license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright + * ownership. Elasticsearch B.V. licenses this file to you under + * the Apache License, Version 2.0 (the "License"); you may + * not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +/* + * Modifications Copyright OpenSearch Contributors. See + * GitHub history for details. + */ + +//---------------------------------------------------- +// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. +//---------------------------------------------------- + +package org.opensearch.client.opensearch.cat; + +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.Bytes; +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.Time; +import org.opensearch.client.opensearch._types.TimeUnit; +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.ToCopyableBuilder; + +// typedef: cat.indices.Request + +/** + * Lists information related to indexes, that is, how much disk space they are using, how many shards they have, their health status, and so + * on. + */ +@Generated("org.opensearch.client.codegen.CodeGenerator") +public final class IndicesRequest extends CatRequestBase implements ToCopyableBuilder { + + @Nullable + private final Bytes bytes; + + @Nullable + private final Time clusterManagerTimeout; + + @Nonnull + private final List expandWildcards; + + @Nullable + private final HealthStatus health; + + @Nullable + private final Boolean includeUnloadedSegments; + + @Nonnull + private final List index; + + @Deprecated + @Nullable + private final Time masterTimeout; + + @Nullable + private final Boolean pri; + + @Nullable + private final TimeUnit time; + + // --------------------------------------------------------------------------------------------- + + private IndicesRequest(Builder builder) { + super(builder); + this.bytes = builder.bytes; + this.clusterManagerTimeout = builder.clusterManagerTimeout; + this.expandWildcards = ApiTypeHelper.unmodifiable(builder.expandWildcards); + this.health = builder.health; + this.includeUnloadedSegments = builder.includeUnloadedSegments; + this.index = ApiTypeHelper.unmodifiable(builder.index); + this.masterTimeout = builder.masterTimeout; + this.pri = builder.pri; + this.time = builder.time; + } + + public static IndicesRequest of(Function> fn) { + return fn.apply(new Builder()).build(); + } + + /** + * The units used to display byte values. + *

+ * API name: {@code bytes} + *

+ */ + @Nullable + public final Bytes bytes() { + return this.bytes; + } + + /** + * The amount of time allowed to establish a connection to the cluster manager node. + *

+ * API name: {@code cluster_manager_timeout} + *

+ */ + @Nullable + public final Time clusterManagerTimeout() { + return this.clusterManagerTimeout; + } + + /** + * The type of index that wildcard patterns can match. + *

+ * API name: {@code expand_wildcards} + *

+ */ + @Nonnull + public final List expandWildcards() { + return this.expandWildcards; + } + + /** + * Limits indexes based on their health status. Supported values are green, yellow, and red. + *

+ * API name: {@code health} + *

+ */ + @Nullable + public final HealthStatus health() { + return this.health; + } + + /** + * Whether to include information from segments not loaded into memory. + *

+ * API name: {@code include_unloaded_segments} + *

+ */ + @Nullable + public final Boolean includeUnloadedSegments() { + return this.includeUnloadedSegments; + } + + /** + * A comma-separated list of data streams, indexes, and aliases used to limit the request. Supports wildcards (*). To + * target all data streams and indexes, omit this parameter or use * or _all. + *

+ * API name: {@code index} + *

+ */ + @Nonnull + public final List index() { + return this.index; + } + + /** + * The amount of time allowed to establish a connection to the cluster manager node. + *

+ * API name: {@code master_timeout} + *

+ */ + @Deprecated + @Nullable + public final Time masterTimeout() { + return this.masterTimeout; + } + + /** + * When true, returns information only from the primary shards. + *

+ * API name: {@code pri} + *

+ */ + @Nullable + public final Boolean pri() { + return this.pri; + } + + /** + * Specifies the time units. + *

+ * API name: {@code time} + *

+ */ + @Nullable + public final TimeUnit time() { + return this.time; + } + + // --------------------------------------------------------------------------------------------- + + @Override + @Nonnull + public Builder toBuilder() { + return new Builder(this); + } + + @Nonnull + public static Builder builder() { + return new Builder(); + } + + /** + * Builder for {@link IndicesRequest}. + */ + public static class Builder extends CatRequestBase.AbstractBuilder implements CopyableBuilder { + @Nullable + private Bytes bytes; + @Nullable + private Time clusterManagerTimeout; + @Nullable + private List expandWildcards; + @Nullable + private HealthStatus health; + @Nullable + private Boolean includeUnloadedSegments; + @Nullable + private List index; + @Nullable + private Time masterTimeout; + @Nullable + private Boolean pri; + @Nullable + private TimeUnit time; + + public Builder() {} + + private Builder(IndicesRequest o) { + super(o); + this.bytes = o.bytes; + this.clusterManagerTimeout = o.clusterManagerTimeout; + this.expandWildcards = _listCopy(o.expandWildcards); + this.health = o.health; + this.includeUnloadedSegments = o.includeUnloadedSegments; + this.index = _listCopy(o.index); + this.masterTimeout = o.masterTimeout; + this.pri = o.pri; + this.time = o.time; + } + + private Builder(Builder o) { + super(o); + this.bytes = o.bytes; + this.clusterManagerTimeout = o.clusterManagerTimeout; + this.expandWildcards = _listCopy(o.expandWildcards); + this.health = o.health; + this.includeUnloadedSegments = o.includeUnloadedSegments; + this.index = _listCopy(o.index); + this.masterTimeout = o.masterTimeout; + this.pri = o.pri; + this.time = o.time; + } + + @Override + @Nonnull + public Builder copy() { + return new Builder(this); + } + + @Override + @Nonnull + protected Builder self() { + return this; + } + + /** + * The units used to display byte values. + *

+ * API name: {@code bytes} + *

+ */ + @Nonnull + public final Builder bytes(@Nullable Bytes value) { + this.bytes = value; + return this; + } + + /** + * The amount of time allowed to establish a connection to the cluster manager node. + *

+ * API name: {@code cluster_manager_timeout} + *

+ */ + @Nonnull + public final Builder clusterManagerTimeout(@Nullable Time value) { + this.clusterManagerTimeout = value; + return this; + } + + /** + * The amount of time allowed to establish a connection to the cluster manager node. + *

+ * API name: {@code cluster_manager_timeout} + *

+ */ + @Nonnull + public final Builder clusterManagerTimeout(Function> fn) { + return clusterManagerTimeout(fn.apply(new Time.Builder()).build()); + } + + /** + * The type of index that wildcard patterns can match. + *

+ * 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; + } + + /** + * The type of index that wildcard patterns can match. + *

+ * 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; + } + + /** + * Limits indexes based on their health status. Supported values are green, yellow, and red. + *

+ * API name: {@code health} + *

+ */ + @Nonnull + public final Builder health(@Nullable HealthStatus value) { + this.health = value; + return this; + } + + /** + * Whether to include information from segments not loaded into memory. + *

+ * API name: {@code include_unloaded_segments} + *

+ */ + @Nonnull + public final Builder includeUnloadedSegments(@Nullable Boolean value) { + this.includeUnloadedSegments = value; + return this; + } + + /** + * A comma-separated list of data streams, indexes, and aliases used to limit the request. Supports wildcards (*). To + * target all data streams and indexes, omit this parameter or use * or _all. + *

+ * 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; + } + + /** + * A comma-separated list of data streams, indexes, and aliases used to limit the request. Supports wildcards (*). To + * target all data streams and indexes, omit this parameter or use * or _all. + *

+ * 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; + } + + /** + * The amount of time allowed to establish a connection to the cluster manager node. + *

+ * API name: {@code master_timeout} + *

+ */ + @Deprecated + @Nonnull + public final Builder masterTimeout(@Nullable Time value) { + this.masterTimeout = value; + return this; + } + + /** + * The amount of time allowed to establish a connection to the cluster manager node. + *

+ * API name: {@code master_timeout} + *

+ */ + @Deprecated + @Nonnull + public final Builder masterTimeout(Function> fn) { + return masterTimeout(fn.apply(new Time.Builder()).build()); + } + + /** + * When true, returns information only from the primary shards. + *

+ * API name: {@code pri} + *

+ */ + @Nonnull + public final Builder pri(@Nullable Boolean value) { + this.pri = value; + return this; + } + + /** + * Specifies the time units. + *

+ * API name: {@code time} + *

+ */ + @Nonnull + public final Builder time(@Nullable TimeUnit value) { + this.time = value; + return this; + } + + /** + * Builds a {@link IndicesRequest}. + * + * @throws NullPointerException if some of the required fields are null. + */ + @Override + @Nonnull + public IndicesRequest build() { + _checkSingleUse(); + + return new IndicesRequest(this); + } + } + + // --------------------------------------------------------------------------------------------- + + @Override + protected void applyQueryParameters(@Nonnull Map params) { + super.applyQueryParameters(params); + if (this.bytes != null) { + params.put("bytes", this.bytes.jsonValue()); + } + if (this.clusterManagerTimeout != null) { + params.put("cluster_manager_timeout", this.clusterManagerTimeout._toJsonString()); + } + if (ApiTypeHelper.isDefined(this.expandWildcards)) { + params.put("expand_wildcards", this.expandWildcards.stream().map(v -> v.jsonValue()).collect(Collectors.joining(","))); + } + if (this.health != null) { + params.put("health", this.health.jsonValue()); + } + if (this.includeUnloadedSegments != null) { + params.put("include_unloaded_segments", String.valueOf(this.includeUnloadedSegments)); + } + if (this.masterTimeout != null) { + params.put("master_timeout", this.masterTimeout._toJsonString()); + } + if (this.pri != null) { + params.put("pri", String.valueOf(this.pri)); + } + if (this.time != null) { + params.put("time", this.time.jsonValue()); + } + } + + /** + * Endpoint "{@code cat.indices}". + */ + public static final Endpoint _ENDPOINT = new SimpleEndpoint<>( + // Request method + request -> "GET", + // Request path + request -> { + final int _index = 1 << 0; + + int propsSet = 0; + + if (ApiTypeHelper.isDefined(request.index())) propsSet |= _index; + + if (propsSet == 0) { + return "/_cat/indices"; + } + if (propsSet == (_index)) { + StringBuilder buf = new StringBuilder(); + buf.append("/_cat/indices/"); + SimpleEndpoint.pathEncode(String.join(",", request.index), buf); + return buf.toString(); + } + + throw SimpleEndpoint.noPathTemplateFound("path"); + }, + // Request parameters + request -> { + Map params = new HashMap<>(); + request.applyQueryParameters(params); + return params; + }, + SimpleEndpoint.emptyMap(), + false, + IndicesResponse._DESERIALIZER + ); + + @Override + public int hashCode() { + int result = 17; + result = 31 * result + Objects.hashCode(this.bytes); + result = 31 * result + Objects.hashCode(this.clusterManagerTimeout); + result = 31 * result + Objects.hashCode(this.expandWildcards); + result = 31 * result + Objects.hashCode(this.health); + result = 31 * result + Objects.hashCode(this.includeUnloadedSegments); + result = 31 * result + Objects.hashCode(this.index); + result = 31 * result + Objects.hashCode(this.masterTimeout); + result = 31 * result + Objects.hashCode(this.pri); + result = 31 * result + Objects.hashCode(this.time); + return result; + } + + @Override + public boolean equals(Object o) { + if (this == o) return true; + if (o == null || this.getClass() != o.getClass()) return false; + IndicesRequest other = (IndicesRequest) o; + return Objects.equals(this.bytes, other.bytes) + && Objects.equals(this.clusterManagerTimeout, other.clusterManagerTimeout) + && Objects.equals(this.expandWildcards, other.expandWildcards) + && Objects.equals(this.health, other.health) + && Objects.equals(this.includeUnloadedSegments, other.includeUnloadedSegments) + && Objects.equals(this.index, other.index) + && Objects.equals(this.masterTimeout, other.masterTimeout) + && Objects.equals(this.pri, other.pri) + && Objects.equals(this.time, other.time); + } +} diff --git a/java-client/src/main/java/org/opensearch/client/opensearch/cat/IndicesResponse.java b/java-client/src/generated/java/org/opensearch/client/opensearch/cat/IndicesResponse.java similarity index 75% rename from java-client/src/main/java/org/opensearch/client/opensearch/cat/IndicesResponse.java rename to java-client/src/generated/java/org/opensearch/client/opensearch/cat/IndicesResponse.java index f8fb10bf5b..1448820a80 100644 --- a/java-client/src/main/java/org/opensearch/client/opensearch/cat/IndicesResponse.java +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/cat/IndicesResponse.java @@ -30,43 +30,51 @@ * GitHub history for details. */ +//---------------------------------------------------- +// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. +//---------------------------------------------------- + package org.opensearch.client.opensearch.cat; 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; import org.opensearch.client.json.PlainJsonSerializable; import org.opensearch.client.opensearch.cat.indices.IndicesRecord; 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: cat.indices.Response @JsonpDeserializable -public class IndicesResponse implements PlainJsonSerializable { +@Generated("org.opensearch.client.codegen.CodeGenerator") +public class IndicesResponse implements PlainJsonSerializable, ToCopyableBuilder { + + @Nonnull private final List valueBody; // --------------------------------------------------------------------------------------------- private IndicesResponse(Builder builder) { - this.valueBody = ApiTypeHelper.unmodifiableRequired(builder.valueBody, this, "valueBody"); - } - public static IndicesResponse of(Function> fn) { + public static IndicesResponse of(Function> fn) { return fn.apply(new Builder()).build(); } /** * Required - Response value. - *

- * API name: {@code _value_body} */ + @Nonnull public final List valueBody() { return this.valueBody; } @@ -78,28 +86,53 @@ public void serialize(JsonGenerator generator, JsonpMapper mapper) { generator.writeStartArray(); for (IndicesRecord item0 : this.valueBody) { 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 IndicesResponse}. */ - - public static class Builder extends ObjectBuilderBase implements ObjectBuilder { + public static class Builder extends ObjectBuilderBase implements CopyableBuilder { private List valueBody; + public Builder() {} + + private Builder(IndicesResponse o) { + this.valueBody = _listCopy(o.valueBody); + } + + private Builder(Builder o) { + this.valueBody = _listCopy(o.valueBody); + } + + @Override + @Nonnull + public Builder copy() { + return new Builder(this); + } + /** * Required - Response value. - *

- * API name: {@code _value_body} + * *

* Adds all elements of list to valueBody. + *

*/ + @Nonnull public final Builder valueBody(List list) { this.valueBody = _listAddAll(this.valueBody, list); return this; @@ -107,11 +140,12 @@ public final Builder valueBody(List list) { /** * Required - Response value. - *

- * API name: {@code _value_body} + * *

* Adds one or more values to valueBody. + *

*/ + @Nonnull public final Builder valueBody(IndicesRecord value, IndicesRecord... values) { this.valueBody = _listAdd(this.valueBody, value, values); return this; @@ -119,11 +153,12 @@ public final Builder valueBody(IndicesRecord value, IndicesRecord... values) { /** * Required - Response value. - *

- * API name: {@code _value_body} + * *

* Adds a value to valueBody using a builder lambda. + *

*/ + @Nonnull public final Builder valueBody(Function> fn) { return valueBody(fn.apply(new IndicesRecord.Builder()).build()); } @@ -131,9 +166,10 @@ public final Builder valueBody(Function _DESERIALIZER = createIndicesResponseDeserializer(); protected static JsonpDeserializer createIndicesResponseDeserializer() { - JsonpDeserializer> valueDeserializer = JsonpDeserializer.arrayDeserializer(IndicesRecord._DESERIALIZER); return JsonpDeserializer.of( @@ -152,5 +187,4 @@ protected static JsonpDeserializer createIndicesResponseDeseria (parser, mapper) -> new Builder().valueBody(valueDeserializer.deserialize(parser, mapper)).build() ); } - } diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/cat/OpenSearchCatAsyncClientBase.java b/java-client/src/generated/java/org/opensearch/client/opensearch/cat/OpenSearchCatAsyncClientBase.java index 1f31d7ee84..2b1b38631a 100644 --- a/java-client/src/generated/java/org/opensearch/client/opensearch/cat/OpenSearchCatAsyncClientBase.java +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/cat/OpenSearchCatAsyncClientBase.java @@ -215,6 +215,35 @@ public final CompletableFuture health() throws IOException, Open return health(new HealthRequest.Builder().build()); } + // ----- Endpoint: cat.indices + + /** + * Lists information related to indexes, that is, how much disk space they are using, how many shards they have, their health status, + * and so on. + */ + public CompletableFuture indices(IndicesRequest request) throws IOException, OpenSearchException { + return this.transport.performRequestAsync(request, IndicesRequest._ENDPOINT, this.transportOptions); + } + + /** + * Lists information related to indexes, that is, how much disk space they are using, how many shards they have, their health status, + * and so on. + * + * @param fn a function that initializes a builder to create the {@link IndicesRequest} + */ + public final CompletableFuture indices(Function> fn) + throws IOException, OpenSearchException { + return indices(fn.apply(new IndicesRequest.Builder()).build()); + } + + /** + * Lists information related to indexes, that is, how much disk space they are using, how many shards they have, their health status, + * and so on. + */ + public final CompletableFuture indices() throws IOException, OpenSearchException { + return indices(new IndicesRequest.Builder().build()); + } + // ----- Endpoint: cat.master /** diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/cat/OpenSearchCatClientBase.java b/java-client/src/generated/java/org/opensearch/client/opensearch/cat/OpenSearchCatClientBase.java index 105a764342..cdc069fff4 100644 --- a/java-client/src/generated/java/org/opensearch/client/opensearch/cat/OpenSearchCatClientBase.java +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/cat/OpenSearchCatClientBase.java @@ -211,6 +211,35 @@ public final HealthResponse health() throws IOException, OpenSearchException { return health(new HealthRequest.Builder().build()); } + // ----- Endpoint: cat.indices + + /** + * Lists information related to indexes, that is, how much disk space they are using, how many shards they have, their health status, + * and so on. + */ + public IndicesResponse indices(IndicesRequest request) throws IOException, OpenSearchException { + return this.transport.performRequest(request, IndicesRequest._ENDPOINT, this.transportOptions); + } + + /** + * Lists information related to indexes, that is, how much disk space they are using, how many shards they have, their health status, + * and so on. + * + * @param fn a function that initializes a builder to create the {@link IndicesRequest} + */ + public final IndicesResponse indices(Function> fn) throws IOException, + OpenSearchException { + return indices(fn.apply(new IndicesRequest.Builder()).build()); + } + + /** + * Lists information related to indexes, that is, how much disk space they are using, how many shards they have, their health status, + * and so on. + */ + public final IndicesResponse indices() throws IOException, OpenSearchException { + return indices(new IndicesRequest.Builder().build()); + } + // ----- Endpoint: cat.master /** diff --git a/java-client/src/main/java/org/opensearch/client/opensearch/cat/indices/IndicesRecord.java b/java-client/src/generated/java/org/opensearch/client/opensearch/cat/indices/IndicesRecord.java similarity index 66% rename from java-client/src/main/java/org/opensearch/client/opensearch/cat/indices/IndicesRecord.java rename to java-client/src/generated/java/org/opensearch/client/opensearch/cat/indices/IndicesRecord.java index 0dfb136833..2738ac85d6 100644 --- a/java-client/src/main/java/org/opensearch/client/opensearch/cat/indices/IndicesRecord.java +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/cat/indices/IndicesRecord.java @@ -30,10 +30,17 @@ * GitHub history for details. */ +//---------------------------------------------------- +// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. +//---------------------------------------------------- + package org.opensearch.client.opensearch.cat.indices; import jakarta.json.stream.JsonGenerator; +import java.util.Objects; import java.util.function.Function; +import javax.annotation.Generated; +import javax.annotation.Nonnull; import javax.annotation.Nullable; import org.opensearch.client.json.JsonpDeserializable; import org.opensearch.client.json.JsonpDeserializer; @@ -41,30 +48,25 @@ import org.opensearch.client.json.ObjectBuilderDeserializer; import org.opensearch.client.json.ObjectDeserializer; import org.opensearch.client.json.PlainJsonSerializable; +import org.opensearch.client.util.CopyableBuilder; import org.opensearch.client.util.ObjectBuilder; import org.opensearch.client.util.ObjectBuilderBase; +import org.opensearch.client.util.ToCopyableBuilder; // typedef: cat.indices.IndicesRecord @JsonpDeserializable -public class IndicesRecord implements PlainJsonSerializable { - @Nullable - private final String health; - - @Nullable - private final String status; - - @Nullable - private final String index; +@Generated("org.opensearch.client.codegen.CodeGenerator") +public class IndicesRecord implements PlainJsonSerializable, ToCopyableBuilder { @Nullable - private final String uuid; + private final String completionSize; @Nullable - private final String pri; + private final String creationDate; @Nullable - private final String rep; + private final String creationDateString; @Nullable private final String docsCount; @@ -73,1010 +75,1046 @@ public class IndicesRecord implements PlainJsonSerializable { private final String docsDeleted; @Nullable - private final String creationDate; + private final String fielddataEvictions; @Nullable - private final String creationDateString; + private final String fielddataMemorySize; @Nullable - private final String storeSize; + private final String flushTotal; @Nullable - private final String priStoreSize; + private final String flushTotalTime; @Nullable - private final String completionSize; + private final String getCurrent; @Nullable - private final String priCompletionSize; + private final String getExistsTime; @Nullable - private final String fielddataMemorySize; + private final String getExistsTotal; @Nullable - private final String priFielddataMemorySize; + private final String getMissingTime; @Nullable - private final String fielddataEvictions; + private final String getMissingTotal; @Nullable - private final String priFielddataEvictions; + private final String getTime; @Nullable - private final String queryCacheMemorySize; + private final String getTotal; @Nullable - private final String priQueryCacheMemorySize; + private final String health; @Nullable - private final String queryCacheEvictions; + private final String index; @Nullable - private final String priQueryCacheEvictions; + private final String indexingDeleteCurrent; @Nullable - private final String requestCacheMemorySize; + private final String indexingDeleteTime; @Nullable - private final String priRequestCacheMemorySize; + private final String indexingDeleteTotal; @Nullable - private final String requestCacheEvictions; + private final String indexingIndexCurrent; @Nullable - private final String priRequestCacheEvictions; + private final String indexingIndexFailed; @Nullable - private final String requestCacheHitCount; + private final String indexingIndexTime; @Nullable - private final String priRequestCacheHitCount; + private final String indexingIndexTotal; @Nullable - private final String requestCacheMissCount; + private final String memoryTotal; @Nullable - private final String priRequestCacheMissCount; + private final String mergesCurrent; @Nullable - private final String flushTotal; + private final String mergesCurrentDocs; @Nullable - private final String priFlushTotal; + private final String mergesCurrentSize; @Nullable - private final String flushTotalTime; + private final String mergesTotal; @Nullable - private final String priFlushTotalTime; + private final String mergesTotalDocs; @Nullable - private final String getCurrent; + private final String mergesTotalSize; @Nullable - private final String priGetCurrent; + private final String mergesTotalTime; @Nullable - private final String getTime; + private final String pri; @Nullable - private final String priGetTime; + private final String priCompletionSize; @Nullable - private final String getTotal; + private final String priFielddataEvictions; @Nullable - private final String priGetTotal; + private final String priFielddataMemorySize; @Nullable - private final String getExistsTime; + private final String priFlushTotal; @Nullable - private final String priGetExistsTime; + private final String priFlushTotalTime; @Nullable - private final String getExistsTotal; + private final String priGetCurrent; @Nullable - private final String priGetExistsTotal; + private final String priGetExistsTime; @Nullable - private final String getMissingTime; + private final String priGetExistsTotal; @Nullable private final String priGetMissingTime; @Nullable - private final String getMissingTotal; + private final String priGetMissingTotal; @Nullable - private final String priGetMissingTotal; + private final String priGetTime; @Nullable - private final String indexingDeleteCurrent; + private final String priGetTotal; @Nullable private final String priIndexingDeleteCurrent; @Nullable - private final String indexingDeleteTime; + private final String priIndexingDeleteTime; @Nullable - private final String priIndexingDeleteTime; + private final String priIndexingDeleteTotal; @Nullable - private final String indexingDeleteTotal; + private final String priIndexingIndexCurrent; @Nullable - private final String priIndexingDeleteTotal; + private final String priIndexingIndexFailed; @Nullable - private final String indexingIndexCurrent; + private final String priIndexingIndexTime; @Nullable - private final String priIndexingIndexCurrent; + private final String priIndexingIndexTotal; @Nullable - private final String indexingIndexTime; + private final String priMemoryTotal; @Nullable - private final String priIndexingIndexTime; + private final String priMergesCurrent; @Nullable - private final String indexingIndexTotal; + private final String priMergesCurrentDocs; @Nullable - private final String priIndexingIndexTotal; + private final String priMergesCurrentSize; @Nullable - private final String indexingIndexFailed; + private final String priMergesTotal; @Nullable - private final String priIndexingIndexFailed; + private final String priMergesTotalDocs; @Nullable - private final String mergesCurrent; + private final String priMergesTotalSize; @Nullable - private final String priMergesCurrent; + private final String priMergesTotalTime; @Nullable - private final String mergesCurrentDocs; + private final String priQueryCacheEvictions; @Nullable - private final String priMergesCurrentDocs; + private final String priQueryCacheMemorySize; @Nullable - private final String mergesCurrentSize; + private final String priRefreshExternalTime; @Nullable - private final String priMergesCurrentSize; + private final String priRefreshExternalTotal; @Nullable - private final String mergesTotal; + private final String priRefreshListeners; @Nullable - private final String priMergesTotal; + private final String priRefreshTime; @Nullable - private final String mergesTotalDocs; + private final String priRefreshTotal; @Nullable - private final String priMergesTotalDocs; + private final String priRequestCacheEvictions; @Nullable - private final String mergesTotalSize; + private final String priRequestCacheHitCount; @Nullable - private final String priMergesTotalSize; + private final String priRequestCacheMemorySize; @Nullable - private final String mergesTotalTime; + private final String priRequestCacheMissCount; @Nullable - private final String priMergesTotalTime; + private final String priSearchConcurrentAvgSliceCount; @Nullable - private final String refreshTotal; + private final String priSearchConcurrentQueryCurrent; @Nullable - private final String priRefreshTotal; + private final String priSearchConcurrentQueryTime; @Nullable - private final String refreshTime; + private final String priSearchConcurrentQueryTotal; @Nullable - private final String priRefreshTime; + private final String priSearchFetchCurrent; @Nullable - private final String refreshExternalTotal; + private final String priSearchFetchTime; @Nullable - private final String priRefreshExternalTotal; + private final String priSearchFetchTotal; @Nullable - private final String refreshExternalTime; + private final String priSearchOpenContexts; @Nullable - private final String priRefreshExternalTime; + private final String priSearchPointInTimeCurrent; @Nullable - private final String refreshListeners; + private final String priSearchPointInTimeTime; @Nullable - private final String priRefreshListeners; + private final String priSearchPointInTimeTotal; @Nullable - private final String searchFetchCurrent; + private final String priSearchQueryCurrent; @Nullable - private final String priSearchFetchCurrent; + private final String priSearchQueryTime; @Nullable - private final String searchFetchTime; + private final String priSearchQueryTotal; @Nullable - private final String priSearchFetchTime; + private final String priSearchScrollCurrent; @Nullable - private final String searchFetchTotal; + private final String priSearchScrollTime; @Nullable - private final String priSearchFetchTotal; + private final String priSearchScrollTotal; @Nullable - private final String searchOpenContexts; + private final String priSegmentsCount; @Nullable - private final String priSearchOpenContexts; + private final String priSegmentsFixedBitsetMemory; @Nullable - private final String searchQueryCurrent; + private final String priSegmentsIndexWriterMemory; @Nullable - private final String priSearchQueryCurrent; + private final String priSegmentsMemory; @Nullable - private final String searchQueryTime; + private final String priSegmentsVersionMapMemory; @Nullable - private final String priSearchQueryTime; + private final String priStoreSize; @Nullable - private final String searchQueryTotal; + private final String priSuggestCurrent; @Nullable - private final String priSearchQueryTotal; + private final String priSuggestTime; @Nullable - private final String searchScrollCurrent; + private final String priSuggestTotal; @Nullable - private final String priSearchScrollCurrent; + private final String priWarmerCurrent; @Nullable - private final String searchScrollTime; + private final String priWarmerTotal; @Nullable - private final String priSearchScrollTime; + private final String priWarmerTotalTime; @Nullable - private final String searchScrollTotal; + private final String queryCacheEvictions; @Nullable - private final String priSearchScrollTotal; + private final String queryCacheMemorySize; @Nullable - private final String segmentsCount; + private final String refreshExternalTime; @Nullable - private final String priSegmentsCount; + private final String refreshExternalTotal; @Nullable - private final String segmentsMemory; + private final String refreshListeners; @Nullable - private final String priSegmentsMemory; + private final String refreshTime; @Nullable - private final String segmentsIndexWriterMemory; + private final String refreshTotal; @Nullable - private final String priSegmentsIndexWriterMemory; + private final String rep; @Nullable - private final String segmentsVersionMapMemory; + private final String requestCacheEvictions; @Nullable - private final String priSegmentsVersionMapMemory; + private final String requestCacheHitCount; @Nullable - private final String segmentsFixedBitsetMemory; + private final String requestCacheMemorySize; @Nullable - private final String priSegmentsFixedBitsetMemory; + private final String requestCacheMissCount; @Nullable - private final String warmerCurrent; + private final String searchConcurrentAvgSliceCount; @Nullable - private final String priWarmerCurrent; + private final String searchConcurrentQueryCurrent; @Nullable - private final String warmerTotal; + private final String searchConcurrentQueryTime; @Nullable - private final String priWarmerTotal; + private final String searchConcurrentQueryTotal; @Nullable - private final String warmerTotalTime; + private final String searchFetchCurrent; @Nullable - private final String priWarmerTotalTime; + private final String searchFetchTime; @Nullable - private final String suggestCurrent; + private final String searchFetchTotal; @Nullable - private final String priSuggestCurrent; + private final String searchOpenContexts; @Nullable - private final String suggestTime; + private final String searchPointInTimeCurrent; @Nullable - private final String priSuggestTime; + private final String searchPointInTimeTime; @Nullable - private final String suggestTotal; + private final String searchPointInTimeTotal; @Nullable - private final String priSuggestTotal; + private final String searchQueryCurrent; @Nullable - private final String memoryTotal; + private final String searchQueryTime; @Nullable - private final String priMemoryTotal; + private final String searchQueryTotal; @Nullable - private final String searchThrottled; + private final String searchScrollCurrent; @Nullable - private final String bulkTotalOperations; + private final String searchScrollTime; @Nullable - private final String priBulkTotalOperations; + private final String searchScrollTotal; @Nullable - private final String bulkTotalTime; + private final String searchThrottled; @Nullable - private final String priBulkTotalTime; + private final String segmentsCount; @Nullable - private final String bulkTotalSizeInBytes; + private final String segmentsFixedBitsetMemory; @Nullable - private final String priBulkTotalSizeInBytes; + private final String segmentsIndexWriterMemory; @Nullable - private final String bulkAvgTime; + private final String segmentsMemory; @Nullable - private final String priBulkAvgTime; + private final String segmentsVersionMapMemory; @Nullable - private final String bulkAvgSizeInBytes; + private final String status; @Nullable - private final String priBulkAvgSizeInBytes; + private final String storeSize; - // --------------------------------------------------------------------------------------------- + @Nullable + private final String suggestCurrent; - private IndicesRecord(Builder builder) { + @Nullable + private final String suggestTime; - this.health = builder.health; - this.status = builder.status; - this.index = builder.index; - this.uuid = builder.uuid; - this.pri = builder.pri; - this.rep = builder.rep; - this.docsCount = builder.docsCount; - this.docsDeleted = builder.docsDeleted; + @Nullable + private final String suggestTotal; + + @Nullable + private final String uuid; + + @Nullable + private final String warmerCurrent; + + @Nullable + private final String warmerTotal; + + @Nullable + private final String warmerTotalTime; + + // --------------------------------------------------------------------------------------------- + + private IndicesRecord(Builder builder) { + this.completionSize = builder.completionSize; this.creationDate = builder.creationDate; this.creationDateString = builder.creationDateString; - this.storeSize = builder.storeSize; - this.priStoreSize = builder.priStoreSize; - this.completionSize = builder.completionSize; - this.priCompletionSize = builder.priCompletionSize; - this.fielddataMemorySize = builder.fielddataMemorySize; - this.priFielddataMemorySize = builder.priFielddataMemorySize; + this.docsCount = builder.docsCount; + this.docsDeleted = builder.docsDeleted; this.fielddataEvictions = builder.fielddataEvictions; - this.priFielddataEvictions = builder.priFielddataEvictions; - this.queryCacheMemorySize = builder.queryCacheMemorySize; - this.priQueryCacheMemorySize = builder.priQueryCacheMemorySize; - this.queryCacheEvictions = builder.queryCacheEvictions; - this.priQueryCacheEvictions = builder.priQueryCacheEvictions; - this.requestCacheMemorySize = builder.requestCacheMemorySize; - this.priRequestCacheMemorySize = builder.priRequestCacheMemorySize; - this.requestCacheEvictions = builder.requestCacheEvictions; - this.priRequestCacheEvictions = builder.priRequestCacheEvictions; - this.requestCacheHitCount = builder.requestCacheHitCount; - this.priRequestCacheHitCount = builder.priRequestCacheHitCount; - this.requestCacheMissCount = builder.requestCacheMissCount; - this.priRequestCacheMissCount = builder.priRequestCacheMissCount; + this.fielddataMemorySize = builder.fielddataMemorySize; this.flushTotal = builder.flushTotal; - this.priFlushTotal = builder.priFlushTotal; this.flushTotalTime = builder.flushTotalTime; - this.priFlushTotalTime = builder.priFlushTotalTime; this.getCurrent = builder.getCurrent; - this.priGetCurrent = builder.priGetCurrent; + this.getExistsTime = builder.getExistsTime; + this.getExistsTotal = builder.getExistsTotal; + this.getMissingTime = builder.getMissingTime; + this.getMissingTotal = builder.getMissingTotal; this.getTime = builder.getTime; - this.priGetTime = builder.priGetTime; this.getTotal = builder.getTotal; - this.priGetTotal = builder.priGetTotal; - this.getExistsTime = builder.getExistsTime; + this.health = builder.health; + this.index = builder.index; + this.indexingDeleteCurrent = builder.indexingDeleteCurrent; + this.indexingDeleteTime = builder.indexingDeleteTime; + this.indexingDeleteTotal = builder.indexingDeleteTotal; + this.indexingIndexCurrent = builder.indexingIndexCurrent; + this.indexingIndexFailed = builder.indexingIndexFailed; + this.indexingIndexTime = builder.indexingIndexTime; + this.indexingIndexTotal = builder.indexingIndexTotal; + this.memoryTotal = builder.memoryTotal; + this.mergesCurrent = builder.mergesCurrent; + this.mergesCurrentDocs = builder.mergesCurrentDocs; + this.mergesCurrentSize = builder.mergesCurrentSize; + this.mergesTotal = builder.mergesTotal; + this.mergesTotalDocs = builder.mergesTotalDocs; + this.mergesTotalSize = builder.mergesTotalSize; + this.mergesTotalTime = builder.mergesTotalTime; + this.pri = builder.pri; + this.priCompletionSize = builder.priCompletionSize; + this.priFielddataEvictions = builder.priFielddataEvictions; + this.priFielddataMemorySize = builder.priFielddataMemorySize; + this.priFlushTotal = builder.priFlushTotal; + this.priFlushTotalTime = builder.priFlushTotalTime; + this.priGetCurrent = builder.priGetCurrent; this.priGetExistsTime = builder.priGetExistsTime; - this.getExistsTotal = builder.getExistsTotal; this.priGetExistsTotal = builder.priGetExistsTotal; - this.getMissingTime = builder.getMissingTime; this.priGetMissingTime = builder.priGetMissingTime; - this.getMissingTotal = builder.getMissingTotal; this.priGetMissingTotal = builder.priGetMissingTotal; - this.indexingDeleteCurrent = builder.indexingDeleteCurrent; + this.priGetTime = builder.priGetTime; + this.priGetTotal = builder.priGetTotal; this.priIndexingDeleteCurrent = builder.priIndexingDeleteCurrent; - this.indexingDeleteTime = builder.indexingDeleteTime; this.priIndexingDeleteTime = builder.priIndexingDeleteTime; - this.indexingDeleteTotal = builder.indexingDeleteTotal; this.priIndexingDeleteTotal = builder.priIndexingDeleteTotal; - this.indexingIndexCurrent = builder.indexingIndexCurrent; this.priIndexingIndexCurrent = builder.priIndexingIndexCurrent; - this.indexingIndexTime = builder.indexingIndexTime; + this.priIndexingIndexFailed = builder.priIndexingIndexFailed; this.priIndexingIndexTime = builder.priIndexingIndexTime; - this.indexingIndexTotal = builder.indexingIndexTotal; this.priIndexingIndexTotal = builder.priIndexingIndexTotal; - this.indexingIndexFailed = builder.indexingIndexFailed; - this.priIndexingIndexFailed = builder.priIndexingIndexFailed; - this.mergesCurrent = builder.mergesCurrent; + this.priMemoryTotal = builder.priMemoryTotal; this.priMergesCurrent = builder.priMergesCurrent; - this.mergesCurrentDocs = builder.mergesCurrentDocs; this.priMergesCurrentDocs = builder.priMergesCurrentDocs; - this.mergesCurrentSize = builder.mergesCurrentSize; this.priMergesCurrentSize = builder.priMergesCurrentSize; - this.mergesTotal = builder.mergesTotal; this.priMergesTotal = builder.priMergesTotal; - this.mergesTotalDocs = builder.mergesTotalDocs; this.priMergesTotalDocs = builder.priMergesTotalDocs; - this.mergesTotalSize = builder.mergesTotalSize; this.priMergesTotalSize = builder.priMergesTotalSize; - this.mergesTotalTime = builder.mergesTotalTime; this.priMergesTotalTime = builder.priMergesTotalTime; - this.refreshTotal = builder.refreshTotal; - this.priRefreshTotal = builder.priRefreshTotal; - this.refreshTime = builder.refreshTime; - this.priRefreshTime = builder.priRefreshTime; - this.refreshExternalTotal = builder.refreshExternalTotal; - this.priRefreshExternalTotal = builder.priRefreshExternalTotal; - this.refreshExternalTime = builder.refreshExternalTime; + this.priQueryCacheEvictions = builder.priQueryCacheEvictions; + this.priQueryCacheMemorySize = builder.priQueryCacheMemorySize; this.priRefreshExternalTime = builder.priRefreshExternalTime; - this.refreshListeners = builder.refreshListeners; + this.priRefreshExternalTotal = builder.priRefreshExternalTotal; this.priRefreshListeners = builder.priRefreshListeners; - this.searchFetchCurrent = builder.searchFetchCurrent; + this.priRefreshTime = builder.priRefreshTime; + this.priRefreshTotal = builder.priRefreshTotal; + this.priRequestCacheEvictions = builder.priRequestCacheEvictions; + this.priRequestCacheHitCount = builder.priRequestCacheHitCount; + this.priRequestCacheMemorySize = builder.priRequestCacheMemorySize; + this.priRequestCacheMissCount = builder.priRequestCacheMissCount; + this.priSearchConcurrentAvgSliceCount = builder.priSearchConcurrentAvgSliceCount; + this.priSearchConcurrentQueryCurrent = builder.priSearchConcurrentQueryCurrent; + this.priSearchConcurrentQueryTime = builder.priSearchConcurrentQueryTime; + this.priSearchConcurrentQueryTotal = builder.priSearchConcurrentQueryTotal; this.priSearchFetchCurrent = builder.priSearchFetchCurrent; - this.searchFetchTime = builder.searchFetchTime; this.priSearchFetchTime = builder.priSearchFetchTime; - this.searchFetchTotal = builder.searchFetchTotal; this.priSearchFetchTotal = builder.priSearchFetchTotal; - this.searchOpenContexts = builder.searchOpenContexts; this.priSearchOpenContexts = builder.priSearchOpenContexts; - this.searchQueryCurrent = builder.searchQueryCurrent; + this.priSearchPointInTimeCurrent = builder.priSearchPointInTimeCurrent; + this.priSearchPointInTimeTime = builder.priSearchPointInTimeTime; + this.priSearchPointInTimeTotal = builder.priSearchPointInTimeTotal; this.priSearchQueryCurrent = builder.priSearchQueryCurrent; - this.searchQueryTime = builder.searchQueryTime; this.priSearchQueryTime = builder.priSearchQueryTime; - this.searchQueryTotal = builder.searchQueryTotal; this.priSearchQueryTotal = builder.priSearchQueryTotal; - this.searchScrollCurrent = builder.searchScrollCurrent; this.priSearchScrollCurrent = builder.priSearchScrollCurrent; - this.searchScrollTime = builder.searchScrollTime; this.priSearchScrollTime = builder.priSearchScrollTime; - this.searchScrollTotal = builder.searchScrollTotal; this.priSearchScrollTotal = builder.priSearchScrollTotal; - this.segmentsCount = builder.segmentsCount; this.priSegmentsCount = builder.priSegmentsCount; - this.segmentsMemory = builder.segmentsMemory; - this.priSegmentsMemory = builder.priSegmentsMemory; - this.segmentsIndexWriterMemory = builder.segmentsIndexWriterMemory; + this.priSegmentsFixedBitsetMemory = builder.priSegmentsFixedBitsetMemory; this.priSegmentsIndexWriterMemory = builder.priSegmentsIndexWriterMemory; - this.segmentsVersionMapMemory = builder.segmentsVersionMapMemory; + this.priSegmentsMemory = builder.priSegmentsMemory; this.priSegmentsVersionMapMemory = builder.priSegmentsVersionMapMemory; - this.segmentsFixedBitsetMemory = builder.segmentsFixedBitsetMemory; - this.priSegmentsFixedBitsetMemory = builder.priSegmentsFixedBitsetMemory; - this.warmerCurrent = builder.warmerCurrent; + this.priStoreSize = builder.priStoreSize; + this.priSuggestCurrent = builder.priSuggestCurrent; + this.priSuggestTime = builder.priSuggestTime; + this.priSuggestTotal = builder.priSuggestTotal; this.priWarmerCurrent = builder.priWarmerCurrent; - this.warmerTotal = builder.warmerTotal; this.priWarmerTotal = builder.priWarmerTotal; - this.warmerTotalTime = builder.warmerTotalTime; this.priWarmerTotalTime = builder.priWarmerTotalTime; + this.queryCacheEvictions = builder.queryCacheEvictions; + this.queryCacheMemorySize = builder.queryCacheMemorySize; + this.refreshExternalTime = builder.refreshExternalTime; + this.refreshExternalTotal = builder.refreshExternalTotal; + this.refreshListeners = builder.refreshListeners; + this.refreshTime = builder.refreshTime; + this.refreshTotal = builder.refreshTotal; + this.rep = builder.rep; + this.requestCacheEvictions = builder.requestCacheEvictions; + this.requestCacheHitCount = builder.requestCacheHitCount; + this.requestCacheMemorySize = builder.requestCacheMemorySize; + this.requestCacheMissCount = builder.requestCacheMissCount; + this.searchConcurrentAvgSliceCount = builder.searchConcurrentAvgSliceCount; + this.searchConcurrentQueryCurrent = builder.searchConcurrentQueryCurrent; + this.searchConcurrentQueryTime = builder.searchConcurrentQueryTime; + this.searchConcurrentQueryTotal = builder.searchConcurrentQueryTotal; + this.searchFetchCurrent = builder.searchFetchCurrent; + this.searchFetchTime = builder.searchFetchTime; + this.searchFetchTotal = builder.searchFetchTotal; + this.searchOpenContexts = builder.searchOpenContexts; + this.searchPointInTimeCurrent = builder.searchPointInTimeCurrent; + this.searchPointInTimeTime = builder.searchPointInTimeTime; + this.searchPointInTimeTotal = builder.searchPointInTimeTotal; + this.searchQueryCurrent = builder.searchQueryCurrent; + this.searchQueryTime = builder.searchQueryTime; + this.searchQueryTotal = builder.searchQueryTotal; + this.searchScrollCurrent = builder.searchScrollCurrent; + this.searchScrollTime = builder.searchScrollTime; + this.searchScrollTotal = builder.searchScrollTotal; + this.searchThrottled = builder.searchThrottled; + this.segmentsCount = builder.segmentsCount; + this.segmentsFixedBitsetMemory = builder.segmentsFixedBitsetMemory; + this.segmentsIndexWriterMemory = builder.segmentsIndexWriterMemory; + this.segmentsMemory = builder.segmentsMemory; + this.segmentsVersionMapMemory = builder.segmentsVersionMapMemory; + this.status = builder.status; + this.storeSize = builder.storeSize; this.suggestCurrent = builder.suggestCurrent; - this.priSuggestCurrent = builder.priSuggestCurrent; this.suggestTime = builder.suggestTime; - this.priSuggestTime = builder.priSuggestTime; this.suggestTotal = builder.suggestTotal; - this.priSuggestTotal = builder.priSuggestTotal; - this.memoryTotal = builder.memoryTotal; - this.priMemoryTotal = builder.priMemoryTotal; - this.searchThrottled = builder.searchThrottled; - this.bulkTotalOperations = builder.bulkTotalOperations; - this.priBulkTotalOperations = builder.priBulkTotalOperations; - this.bulkTotalTime = builder.bulkTotalTime; - this.priBulkTotalTime = builder.priBulkTotalTime; - this.bulkTotalSizeInBytes = builder.bulkTotalSizeInBytes; - this.priBulkTotalSizeInBytes = builder.priBulkTotalSizeInBytes; - this.bulkAvgTime = builder.bulkAvgTime; - this.priBulkAvgTime = builder.priBulkAvgTime; - this.bulkAvgSizeInBytes = builder.bulkAvgSizeInBytes; - this.priBulkAvgSizeInBytes = builder.priBulkAvgSizeInBytes; - + this.uuid = builder.uuid; + this.warmerCurrent = builder.warmerCurrent; + this.warmerTotal = builder.warmerTotal; + this.warmerTotalTime = builder.warmerTotalTime; } - public static IndicesRecord of(Function> fn) { + public static IndicesRecord of(Function> fn) { return fn.apply(new Builder()).build(); } /** - * current health status + * size of completion *

- * API name: {@code health} + * API name: {@code completion.size} + *

*/ @Nullable - public final String health() { - return this.health; + public final String completionSize() { + return this.completionSize; } /** - * open/close status + * index creation date (millisecond value) *

- * API name: {@code status} + * API name: {@code creation.date} + *

*/ @Nullable - public final String status() { - return this.status; + public final String creationDate() { + return this.creationDate; } /** - * index name + * index creation date (as string) *

- * API name: {@code index} + * API name: {@code creation.date.string} + *

*/ @Nullable - public final String index() { - return this.index; + public final String creationDateString() { + return this.creationDateString; } /** - * index uuid + * available docs *

- * API name: {@code uuid} + * API name: {@code docs.count} + *

*/ @Nullable - public final String uuid() { - return this.uuid; + public final String docsCount() { + return this.docsCount; } /** - * number of primary shards + * deleted docs *

- * API name: {@code pri} + * API name: {@code docs.deleted} + *

*/ @Nullable - public final String pri() { - return this.pri; + public final String docsDeleted() { + return this.docsDeleted; } /** - * number of replica shards + * field data evictions *

- * API name: {@code rep} + * API name: {@code fielddata.evictions} + *

*/ @Nullable - public final String rep() { - return this.rep; + public final String fielddataEvictions() { + return this.fielddataEvictions; } /** - * available docs + * used field data cache *

- * API name: {@code docs.count} + * API name: {@code fielddata.memory_size} + *

*/ @Nullable - public final String docsCount() { - return this.docsCount; + public final String fielddataMemorySize() { + return this.fielddataMemorySize; } /** - * deleted docs + * number of flushes *

- * API name: {@code docs.deleted} + * API name: {@code flush.total} + *

*/ @Nullable - public final String docsDeleted() { - return this.docsDeleted; + public final String flushTotal() { + return this.flushTotal; } /** - * index creation date (millisecond value) + * time spent in flush *

- * API name: {@code creation.date} - */ - @Nullable - public final String creationDate() { - return this.creationDate; - } - - /** - * index creation date (as string) - *

- * API name: {@code creation.date.string} + * API name: {@code flush.total_time} + *

*/ @Nullable - public final String creationDateString() { - return this.creationDateString; + public final String flushTotalTime() { + return this.flushTotalTime; } /** - * store size of primaries & replicas + * number of current get ops *

- * API name: {@code store.size} + * API name: {@code get.current} + *

*/ @Nullable - public final String storeSize() { - return this.storeSize; + public final String getCurrent() { + return this.getCurrent; } /** - * store size of primaries + * time spent in successful gets *

- * API name: {@code pri.store.size} + * API name: {@code get.exists_time} + *

*/ @Nullable - public final String priStoreSize() { - return this.priStoreSize; + public final String getExistsTime() { + return this.getExistsTime; } /** - * size of completion + * number of successful gets *

- * API name: {@code completion.size} + * API name: {@code get.exists_total} + *

*/ @Nullable - public final String completionSize() { - return this.completionSize; + public final String getExistsTotal() { + return this.getExistsTotal; } /** - * size of completion + * time spent in failed gets *

- * API name: {@code pri.completion.size} + * API name: {@code get.missing_time} + *

*/ @Nullable - public final String priCompletionSize() { - return this.priCompletionSize; + public final String getMissingTime() { + return this.getMissingTime; } /** - * used fielddata cache + * number of failed gets *

- * API name: {@code fielddata.memory_size} + * API name: {@code get.missing_total} + *

*/ @Nullable - public final String fielddataMemorySize() { - return this.fielddataMemorySize; + public final String getMissingTotal() { + return this.getMissingTotal; } /** - * used fielddata cache + * time spent in get *

- * API name: {@code pri.fielddata.memory_size} + * API name: {@code get.time} + *

*/ @Nullable - public final String priFielddataMemorySize() { - return this.priFielddataMemorySize; + public final String getTime() { + return this.getTime; } /** - * fielddata evictions + * number of get ops *

- * API name: {@code fielddata.evictions} + * API name: {@code get.total} + *

*/ @Nullable - public final String fielddataEvictions() { - return this.fielddataEvictions; + public final String getTotal() { + return this.getTotal; } /** - * fielddata evictions + * current health status *

- * API name: {@code pri.fielddata.evictions} + * API name: {@code health} + *

*/ @Nullable - public final String priFielddataEvictions() { - return this.priFielddataEvictions; + public final String health() { + return this.health; } /** - * used query cache + * index name *

- * API name: {@code query_cache.memory_size} + * API name: {@code index} + *

*/ @Nullable - public final String queryCacheMemorySize() { - return this.queryCacheMemorySize; + public final String index() { + return this.index; } /** - * used query cache + * number of current deletions *

- * API name: {@code pri.query_cache.memory_size} + * API name: {@code indexing.delete_current} + *

*/ @Nullable - public final String priQueryCacheMemorySize() { - return this.priQueryCacheMemorySize; + public final String indexingDeleteCurrent() { + return this.indexingDeleteCurrent; } /** - * query cache evictions + * time spent in deletions *

- * API name: {@code query_cache.evictions} + * API name: {@code indexing.delete_time} + *

*/ @Nullable - public final String queryCacheEvictions() { - return this.queryCacheEvictions; + public final String indexingDeleteTime() { + return this.indexingDeleteTime; } /** - * query cache evictions + * number of delete ops *

- * API name: {@code pri.query_cache.evictions} + * API name: {@code indexing.delete_total} + *

*/ @Nullable - public final String priQueryCacheEvictions() { - return this.priQueryCacheEvictions; + public final String indexingDeleteTotal() { + return this.indexingDeleteTotal; } /** - * used request cache + * number of current indexing ops *

- * API name: {@code request_cache.memory_size} + * API name: {@code indexing.index_current} + *

*/ @Nullable - public final String requestCacheMemorySize() { - return this.requestCacheMemorySize; + public final String indexingIndexCurrent() { + return this.indexingIndexCurrent; } /** - * used request cache + * number of failed indexing ops *

- * API name: {@code pri.request_cache.memory_size} + * API name: {@code indexing.index_failed} + *

*/ @Nullable - public final String priRequestCacheMemorySize() { - return this.priRequestCacheMemorySize; + public final String indexingIndexFailed() { + return this.indexingIndexFailed; } /** - * request cache evictions + * time spent in indexing *

- * API name: {@code request_cache.evictions} + * API name: {@code indexing.index_time} + *

*/ @Nullable - public final String requestCacheEvictions() { - return this.requestCacheEvictions; + public final String indexingIndexTime() { + return this.indexingIndexTime; } /** - * request cache evictions + * number of indexing ops *

- * API name: {@code pri.request_cache.evictions} + * API name: {@code indexing.index_total} + *

*/ @Nullable - public final String priRequestCacheEvictions() { - return this.priRequestCacheEvictions; + public final String indexingIndexTotal() { + return this.indexingIndexTotal; } /** - * request cache hit count + * total used memory *

- * API name: {@code request_cache.hit_count} + * API name: {@code memory.total} + *

*/ @Nullable - public final String requestCacheHitCount() { - return this.requestCacheHitCount; + public final String memoryTotal() { + return this.memoryTotal; } /** - * request cache hit count + * number of current merges *

- * API name: {@code pri.request_cache.hit_count} + * API name: {@code merges.current} + *

*/ @Nullable - public final String priRequestCacheHitCount() { - return this.priRequestCacheHitCount; + public final String mergesCurrent() { + return this.mergesCurrent; } /** - * request cache miss count + * number of current merging docs *

- * API name: {@code request_cache.miss_count} + * API name: {@code merges.current_docs} + *

*/ @Nullable - public final String requestCacheMissCount() { - return this.requestCacheMissCount; + public final String mergesCurrentDocs() { + return this.mergesCurrentDocs; } /** - * request cache miss count + * size of current merges *

- * API name: {@code pri.request_cache.miss_count} + * API name: {@code merges.current_size} + *

*/ @Nullable - public final String priRequestCacheMissCount() { - return this.priRequestCacheMissCount; + public final String mergesCurrentSize() { + return this.mergesCurrentSize; } /** - * number of flushes + * number of completed merge ops *

- * API name: {@code flush.total} + * API name: {@code merges.total} + *

*/ @Nullable - public final String flushTotal() { - return this.flushTotal; + public final String mergesTotal() { + return this.mergesTotal; } /** - * number of flushes + * docs merged *

- * API name: {@code pri.flush.total} + * API name: {@code merges.total_docs} + *

*/ @Nullable - public final String priFlushTotal() { - return this.priFlushTotal; + public final String mergesTotalDocs() { + return this.mergesTotalDocs; } /** - * time spent in flush + * size merged *

- * API name: {@code flush.total_time} + * API name: {@code merges.total_size} + *

*/ @Nullable - public final String flushTotalTime() { - return this.flushTotalTime; + public final String mergesTotalSize() { + return this.mergesTotalSize; } /** - * time spent in flush + * time spent in merges *

- * API name: {@code pri.flush.total_time} + * API name: {@code merges.total_time} + *

*/ @Nullable - public final String priFlushTotalTime() { - return this.priFlushTotalTime; + public final String mergesTotalTime() { + return this.mergesTotalTime; } /** - * number of current get ops + * number of primary shards *

- * API name: {@code get.current} + * API name: {@code pri} + *

*/ @Nullable - public final String getCurrent() { - return this.getCurrent; + public final String pri() { + return this.pri; } /** - * number of current get ops + * size of completion *

- * API name: {@code pri.get.current} + * API name: {@code pri.completion.size} + *

*/ @Nullable - public final String priGetCurrent() { - return this.priGetCurrent; + public final String priCompletionSize() { + return this.priCompletionSize; } /** - * time spent in get + * field data evictions *

- * API name: {@code get.time} + * API name: {@code pri.fielddata.evictions} + *

*/ @Nullable - public final String getTime() { - return this.getTime; + public final String priFielddataEvictions() { + return this.priFielddataEvictions; } /** - * time spent in get + * used field data cache *

- * API name: {@code pri.get.time} + * API name: {@code pri.fielddata.memory_size} + *

*/ @Nullable - public final String priGetTime() { - return this.priGetTime; + public final String priFielddataMemorySize() { + return this.priFielddataMemorySize; } /** - * number of get ops + * number of flushes *

- * API name: {@code get.total} + * API name: {@code pri.flush.total} + *

*/ @Nullable - public final String getTotal() { - return this.getTotal; + public final String priFlushTotal() { + return this.priFlushTotal; } /** - * number of get ops + * time spent in flush *

- * API name: {@code pri.get.total} + * API name: {@code pri.flush.total_time} + *

*/ @Nullable - public final String priGetTotal() { - return this.priGetTotal; + public final String priFlushTotalTime() { + return this.priFlushTotalTime; } /** - * time spent in successful gets + * number of current get ops *

- * API name: {@code get.exists_time} + * API name: {@code pri.get.current} + *

*/ @Nullable - public final String getExistsTime() { - return this.getExistsTime; + public final String priGetCurrent() { + return this.priGetCurrent; } /** * time spent in successful gets *

* API name: {@code pri.get.exists_time} + *

*/ @Nullable public final String priGetExistsTime() { return this.priGetExistsTime; } - /** - * number of successful gets - *

- * API name: {@code get.exists_total} - */ - @Nullable - public final String getExistsTotal() { - return this.getExistsTotal; - } - /** * number of successful gets *

* API name: {@code pri.get.exists_total} + *

*/ @Nullable public final String priGetExistsTotal() { return this.priGetExistsTotal; } - /** - * time spent in failed gets - *

- * API name: {@code get.missing_time} - */ - @Nullable - public final String getMissingTime() { - return this.getMissingTime; - } - /** * time spent in failed gets *

* API name: {@code pri.get.missing_time} + *

*/ @Nullable public final String priGetMissingTime() { @@ -1086,97 +1124,74 @@ public final String priGetMissingTime() { /** * number of failed gets *

- * API name: {@code get.missing_total} + * API name: {@code pri.get.missing_total} + *

*/ @Nullable - public final String getMissingTotal() { - return this.getMissingTotal; + public final String priGetMissingTotal() { + return this.priGetMissingTotal; } /** - * number of failed gets + * time spent in get *

- * API name: {@code pri.get.missing_total} + * API name: {@code pri.get.time} + *

*/ @Nullable - public final String priGetMissingTotal() { - return this.priGetMissingTotal; + public final String priGetTime() { + return this.priGetTime; } /** - * number of current deletions + * number of get ops *

- * API name: {@code indexing.delete_current} + * API name: {@code pri.get.total} + *

*/ @Nullable - public final String indexingDeleteCurrent() { - return this.indexingDeleteCurrent; + public final String priGetTotal() { + return this.priGetTotal; } /** * number of current deletions *

* API name: {@code pri.indexing.delete_current} + *

*/ @Nullable public final String priIndexingDeleteCurrent() { return this.priIndexingDeleteCurrent; } - /** - * time spent in deletions - *

- * API name: {@code indexing.delete_time} - */ - @Nullable - public final String indexingDeleteTime() { - return this.indexingDeleteTime; - } - /** * time spent in deletions *

* API name: {@code pri.indexing.delete_time} + *

*/ @Nullable public final String priIndexingDeleteTime() { return this.priIndexingDeleteTime; } - /** - * number of delete ops - *

- * API name: {@code indexing.delete_total} - */ - @Nullable - public final String indexingDeleteTotal() { - return this.indexingDeleteTotal; - } - /** * number of delete ops *

* API name: {@code pri.indexing.delete_total} + *

*/ @Nullable public final String priIndexingDeleteTotal() { return this.priIndexingDeleteTotal; } - /** - * number of current indexing ops - *

- * API name: {@code indexing.index_current} - */ - @Nullable - public final String indexingIndexCurrent() { - return this.indexingIndexCurrent; - } - /** * number of current indexing ops *

* API name: {@code pri.indexing.index_current} + *

*/ @Nullable public final String priIndexingIndexCurrent() { @@ -1184,39 +1199,32 @@ public final String priIndexingIndexCurrent() { } /** - * time spent in indexing + * number of failed indexing ops *

- * API name: {@code indexing.index_time} + * API name: {@code pri.indexing.index_failed} + *

*/ @Nullable - public final String indexingIndexTime() { - return this.indexingIndexTime; + public final String priIndexingIndexFailed() { + return this.priIndexingIndexFailed; } /** * time spent in indexing *

* API name: {@code pri.indexing.index_time} + *

*/ @Nullable public final String priIndexingIndexTime() { return this.priIndexingIndexTime; } - /** - * number of indexing ops - *

- * API name: {@code indexing.index_total} - */ - @Nullable - public final String indexingIndexTotal() { - return this.indexingIndexTotal; - } - /** * number of indexing ops *

* API name: {@code pri.indexing.index_total} + *

*/ @Nullable public final String priIndexingIndexTotal() { @@ -1224,119 +1232,65 @@ public final String priIndexingIndexTotal() { } /** - * number of failed indexing ops - *

- * API name: {@code indexing.index_failed} - */ - @Nullable - public final String indexingIndexFailed() { - return this.indexingIndexFailed; - } - - /** - * number of failed indexing ops - *

- * API name: {@code pri.indexing.index_failed} - */ - @Nullable - public final String priIndexingIndexFailed() { - return this.priIndexingIndexFailed; - } - - /** - * number of current merges + * total user memory *

- * API name: {@code merges.current} + * API name: {@code pri.memory.total} + *

*/ @Nullable - public final String mergesCurrent() { - return this.mergesCurrent; + public final String priMemoryTotal() { + return this.priMemoryTotal; } /** * number of current merges *

* API name: {@code pri.merges.current} + *

*/ @Nullable public final String priMergesCurrent() { return this.priMergesCurrent; } - /** - * number of current merging docs - *

- * API name: {@code merges.current_docs} - */ - @Nullable - public final String mergesCurrentDocs() { - return this.mergesCurrentDocs; - } - /** * number of current merging docs *

* API name: {@code pri.merges.current_docs} + *

*/ @Nullable public final String priMergesCurrentDocs() { return this.priMergesCurrentDocs; } - /** - * size of current merges - *

- * API name: {@code merges.current_size} - */ - @Nullable - public final String mergesCurrentSize() { - return this.mergesCurrentSize; - } - /** * size of current merges *

* API name: {@code pri.merges.current_size} + *

*/ @Nullable public final String priMergesCurrentSize() { return this.priMergesCurrentSize; } - /** - * number of completed merge ops - *

- * API name: {@code merges.total} - */ - @Nullable - public final String mergesTotal() { - return this.mergesTotal; - } - /** * number of completed merge ops *

* API name: {@code pri.merges.total} + *

*/ @Nullable public final String priMergesTotal() { return this.priMergesTotal; } - /** - * docs merged - *

- * API name: {@code merges.total_docs} - */ - @Nullable - public final String mergesTotalDocs() { - return this.mergesTotalDocs; - } - /** * docs merged *

* API name: {@code pri.merges.total_docs} + *

*/ @Nullable public final String priMergesTotalDocs() { @@ -1346,77 +1300,85 @@ public final String priMergesTotalDocs() { /** * size merged *

- * API name: {@code merges.total_size} + * API name: {@code pri.merges.total_size} + *

*/ @Nullable - public final String mergesTotalSize() { - return this.mergesTotalSize; + public final String priMergesTotalSize() { + return this.priMergesTotalSize; } /** - * size merged + * time spent in merges *

- * API name: {@code pri.merges.total_size} + * API name: {@code pri.merges.total_time} + *

*/ @Nullable - public final String priMergesTotalSize() { - return this.priMergesTotalSize; + public final String priMergesTotalTime() { + return this.priMergesTotalTime; } /** - * time spent in merges + * query cache evictions *

- * API name: {@code merges.total_time} + * API name: {@code pri.query_cache.evictions} + *

*/ @Nullable - public final String mergesTotalTime() { - return this.mergesTotalTime; + public final String priQueryCacheEvictions() { + return this.priQueryCacheEvictions; } /** - * time spent in merges + * used query cache *

- * API name: {@code pri.merges.total_time} + * API name: {@code pri.query_cache.memory_size} + *

*/ @Nullable - public final String priMergesTotalTime() { - return this.priMergesTotalTime; + public final String priQueryCacheMemorySize() { + return this.priQueryCacheMemorySize; } /** - * total refreshes + * time spent in external refreshes *

- * API name: {@code refresh.total} + * API name: {@code pri.refresh.external_time} + *

*/ @Nullable - public final String refreshTotal() { - return this.refreshTotal; + public final String priRefreshExternalTime() { + return this.priRefreshExternalTime; } /** - * total refreshes + * total external refreshes *

- * API name: {@code pri.refresh.total} + * API name: {@code pri.refresh.external_total} + *

*/ @Nullable - public final String priRefreshTotal() { - return this.priRefreshTotal; + public final String priRefreshExternalTotal() { + return this.priRefreshExternalTotal; } /** - * time spent in refreshes + * number of pending refresh listeners *

- * API name: {@code refresh.time} + * API name: {@code pri.refresh.listeners} + *

*/ @Nullable - public final String refreshTime() { - return this.refreshTime; + public final String priRefreshListeners() { + return this.priRefreshListeners; } /** * time spent in refreshes *

* API name: {@code pri.refresh.time} + *

*/ @Nullable public final String priRefreshTime() { @@ -1424,119 +1386,119 @@ public final String priRefreshTime() { } /** - * total external refreshes + * total refreshes *

- * API name: {@code refresh.external_total} + * API name: {@code pri.refresh.total} + *

*/ @Nullable - public final String refreshExternalTotal() { - return this.refreshExternalTotal; + public final String priRefreshTotal() { + return this.priRefreshTotal; } /** - * total external refreshes + * request cache evictions *

- * API name: {@code pri.refresh.external_total} + * API name: {@code pri.request_cache.evictions} + *

*/ @Nullable - public final String priRefreshExternalTotal() { - return this.priRefreshExternalTotal; + public final String priRequestCacheEvictions() { + return this.priRequestCacheEvictions; } /** - * time spent in external refreshes + * request cache hit count *

- * API name: {@code refresh.external_time} + * API name: {@code pri.request_cache.hit_count} + *

*/ @Nullable - public final String refreshExternalTime() { - return this.refreshExternalTime; + public final String priRequestCacheHitCount() { + return this.priRequestCacheHitCount; } /** - * time spent in external refreshes + * used request cache *

- * API name: {@code pri.refresh.external_time} + * API name: {@code pri.request_cache.memory_size} + *

*/ @Nullable - public final String priRefreshExternalTime() { - return this.priRefreshExternalTime; + public final String priRequestCacheMemorySize() { + return this.priRequestCacheMemorySize; } /** - * number of pending refresh listeners + * request cache miss count *

- * API name: {@code refresh.listeners} + * API name: {@code pri.request_cache.miss_count} + *

*/ @Nullable - public final String refreshListeners() { - return this.refreshListeners; + public final String priRequestCacheMissCount() { + return this.priRequestCacheMissCount; } /** - * number of pending refresh listeners - *

- * API name: {@code pri.refresh.listeners} + * API name: {@code pri.search.concurrent_avg_slice_count} */ @Nullable - public final String priRefreshListeners() { - return this.priRefreshListeners; + public final String priSearchConcurrentAvgSliceCount() { + return this.priSearchConcurrentAvgSliceCount; } /** - * current fetch phase ops - *

- * API name: {@code search.fetch_current} + * API name: {@code pri.search.concurrent_query_current} */ @Nullable - public final String searchFetchCurrent() { - return this.searchFetchCurrent; + public final String priSearchConcurrentQueryCurrent() { + return this.priSearchConcurrentQueryCurrent; } /** - * current fetch phase ops - *

- * API name: {@code pri.search.fetch_current} + * API name: {@code pri.search.concurrent_query_time} */ @Nullable - public final String priSearchFetchCurrent() { - return this.priSearchFetchCurrent; + public final String priSearchConcurrentQueryTime() { + return this.priSearchConcurrentQueryTime; } /** - * time spent in fetch phase - *

- * API name: {@code search.fetch_time} + * API name: {@code pri.search.concurrent_query_total} */ @Nullable - public final String searchFetchTime() { - return this.searchFetchTime; + public final String priSearchConcurrentQueryTotal() { + return this.priSearchConcurrentQueryTotal; } /** - * time spent in fetch phase + * current fetch phase ops *

- * API name: {@code pri.search.fetch_time} + * API name: {@code pri.search.fetch_current} + *

*/ @Nullable - public final String priSearchFetchTime() { - return this.priSearchFetchTime; + public final String priSearchFetchCurrent() { + return this.priSearchFetchCurrent; } /** - * total fetch ops + * time spent in fetch phase *

- * API name: {@code search.fetch_total} + * API name: {@code pri.search.fetch_time} + *

*/ @Nullable - public final String searchFetchTotal() { - return this.searchFetchTotal; + public final String priSearchFetchTime() { + return this.priSearchFetchTime; } /** * total fetch ops *

* API name: {@code pri.search.fetch_total} + *

*/ @Nullable public final String priSearchFetchTotal() { @@ -1546,157 +1508,109 @@ public final String priSearchFetchTotal() { /** * open search contexts *

- * API name: {@code search.open_contexts} + * API name: {@code pri.search.open_contexts} + *

*/ @Nullable - public final String searchOpenContexts() { - return this.searchOpenContexts; + public final String priSearchOpenContexts() { + return this.priSearchOpenContexts; } /** - * open search contexts - *

- * API name: {@code pri.search.open_contexts} + * API name: {@code pri.search.point_in_time_current} */ @Nullable - public final String priSearchOpenContexts() { - return this.priSearchOpenContexts; + public final String priSearchPointInTimeCurrent() { + return this.priSearchPointInTimeCurrent; } /** - * current query phase ops - *

- * API name: {@code search.query_current} + * API name: {@code pri.search.point_in_time_time} */ @Nullable - public final String searchQueryCurrent() { - return this.searchQueryCurrent; + public final String priSearchPointInTimeTime() { + return this.priSearchPointInTimeTime; } /** - * current query phase ops - *

- * API name: {@code pri.search.query_current} + * API name: {@code pri.search.point_in_time_total} */ @Nullable - public final String priSearchQueryCurrent() { - return this.priSearchQueryCurrent; + public final String priSearchPointInTimeTotal() { + return this.priSearchPointInTimeTotal; } /** - * time spent in query phase + * current query phase ops *

- * API name: {@code search.query_time} + * API name: {@code pri.search.query_current} + *

*/ @Nullable - public final String searchQueryTime() { - return this.searchQueryTime; + public final String priSearchQueryCurrent() { + return this.priSearchQueryCurrent; } /** * time spent in query phase *

* API name: {@code pri.search.query_time} + *

*/ @Nullable public final String priSearchQueryTime() { return this.priSearchQueryTime; } - /** - * total query phase ops - *

- * API name: {@code search.query_total} - */ - @Nullable - public final String searchQueryTotal() { - return this.searchQueryTotal; - } - /** * total query phase ops *

* API name: {@code pri.search.query_total} + *

*/ @Nullable public final String priSearchQueryTotal() { return this.priSearchQueryTotal; } - /** - * open scroll contexts - *

- * API name: {@code search.scroll_current} - */ - @Nullable - public final String searchScrollCurrent() { - return this.searchScrollCurrent; - } - /** * open scroll contexts *

* API name: {@code pri.search.scroll_current} + *

*/ @Nullable public final String priSearchScrollCurrent() { return this.priSearchScrollCurrent; } - /** - * time scroll contexts held open - *

- * API name: {@code search.scroll_time} - */ - @Nullable - public final String searchScrollTime() { - return this.searchScrollTime; - } - /** * time scroll contexts held open *

* API name: {@code pri.search.scroll_time} + *

*/ @Nullable public final String priSearchScrollTime() { return this.priSearchScrollTime; } - /** - * completed scroll contexts - *

- * API name: {@code search.scroll_total} - */ - @Nullable - public final String searchScrollTotal() { - return this.searchScrollTotal; - } - /** * completed scroll contexts *

* API name: {@code pri.search.scroll_total} + *

*/ @Nullable public final String priSearchScrollTotal() { return this.priSearchScrollTotal; } - /** - * number of segments - *

- * API name: {@code segments.count} - */ - @Nullable - public final String segmentsCount() { - return this.segmentsCount; - } - /** * number of segments *

* API name: {@code pri.segments.count} + *

*/ @Nullable public final String priSegmentsCount() { @@ -1704,39 +1618,21 @@ public final String priSegmentsCount() { } /** - * memory used by segments - *

- * API name: {@code segments.memory} - */ - @Nullable - public final String segmentsMemory() { - return this.segmentsMemory; - } - - /** - * memory used by segments - *

- * API name: {@code pri.segments.memory} - */ - @Nullable - public final String priSegmentsMemory() { - return this.priSegmentsMemory; - } - - /** - * memory used by index writer + * memory used by fixed bit sets for nested object field types and export type filters for types referred in _parent fields *

- * API name: {@code segments.index_writer_memory} + * API name: {@code pri.segments.fixed_bitset_memory} + *

*/ @Nullable - public final String segmentsIndexWriterMemory() { - return this.segmentsIndexWriterMemory; + public final String priSegmentsFixedBitsetMemory() { + return this.priSegmentsFixedBitsetMemory; } /** * memory used by index writer *

* API name: {@code pri.segments.index_writer_memory} + *

*/ @Nullable public final String priSegmentsIndexWriterMemory() { @@ -1744,19 +1640,21 @@ public final String priSegmentsIndexWriterMemory() { } /** - * memory used by version map + * memory used by segments *

- * API name: {@code segments.version_map_memory} + * API name: {@code pri.segments.memory} + *

*/ @Nullable - public final String segmentsVersionMapMemory() { - return this.segmentsVersionMapMemory; + public final String priSegmentsMemory() { + return this.priSegmentsMemory; } /** * memory used by version map *

* API name: {@code pri.segments.version_map_memory} + *

*/ @Nullable public final String priSegmentsVersionMapMemory() { @@ -1764,61 +1662,65 @@ public final String priSegmentsVersionMapMemory() { } /** - * memory used by fixed bit sets for nested object field types and export type - * filters for types referred in _parent fields + * store size of primaries *

- * API name: {@code segments.fixed_bitset_memory} + * API name: {@code pri.store.size} + *

*/ @Nullable - public final String segmentsFixedBitsetMemory() { - return this.segmentsFixedBitsetMemory; + public final String priStoreSize() { + return this.priStoreSize; } /** - * memory used by fixed bit sets for nested object field types and export type - * filters for types referred in _parent fields + * number of current suggest ops *

- * API name: {@code pri.segments.fixed_bitset_memory} + * API name: {@code pri.suggest.current} + *

*/ @Nullable - public final String priSegmentsFixedBitsetMemory() { - return this.priSegmentsFixedBitsetMemory; + public final String priSuggestCurrent() { + return this.priSuggestCurrent; } /** - * current warmer ops + * time spend in suggest *

- * API name: {@code warmer.current} + * API name: {@code pri.suggest.time} + *

*/ @Nullable - public final String warmerCurrent() { - return this.warmerCurrent; + public final String priSuggestTime() { + return this.priSuggestTime; } /** - * current warmer ops + * number of suggest ops *

- * API name: {@code pri.warmer.current} + * API name: {@code pri.suggest.total} + *

*/ @Nullable - public final String priWarmerCurrent() { - return this.priWarmerCurrent; + public final String priSuggestTotal() { + return this.priSuggestTotal; } /** - * total warmer ops + * current warmer ops *

- * API name: {@code warmer.total} + * API name: {@code pri.warmer.current} + *

*/ @Nullable - public final String warmerTotal() { - return this.warmerTotal; + public final String priWarmerCurrent() { + return this.priWarmerCurrent; } /** * total warmer ops *

* API name: {@code pri.warmer.total} + *

*/ @Nullable public final String priWarmerTotal() { @@ -1828,1669 +1730,2267 @@ public final String priWarmerTotal() { /** * time spent in warmers *

- * API name: {@code warmer.total_time} + * API name: {@code pri.warmer.total_time} + *

*/ @Nullable - public final String warmerTotalTime() { - return this.warmerTotalTime; + public final String priWarmerTotalTime() { + return this.priWarmerTotalTime; } /** - * time spent in warmers + * query cache evictions *

- * API name: {@code pri.warmer.total_time} + * API name: {@code query_cache.evictions} + *

*/ @Nullable - public final String priWarmerTotalTime() { - return this.priWarmerTotalTime; + public final String queryCacheEvictions() { + return this.queryCacheEvictions; } /** - * number of current suggest ops + * used query cache *

- * API name: {@code suggest.current} + * API name: {@code query_cache.memory_size} + *

*/ @Nullable - public final String suggestCurrent() { - return this.suggestCurrent; + public final String queryCacheMemorySize() { + return this.queryCacheMemorySize; } /** - * number of current suggest ops + * time spent in external refreshes *

- * API name: {@code pri.suggest.current} + * API name: {@code refresh.external_time} + *

*/ @Nullable - public final String priSuggestCurrent() { - return this.priSuggestCurrent; + public final String refreshExternalTime() { + return this.refreshExternalTime; } /** - * time spend in suggest + * total external refreshes *

- * API name: {@code suggest.time} + * API name: {@code refresh.external_total} + *

*/ @Nullable - public final String suggestTime() { - return this.suggestTime; + public final String refreshExternalTotal() { + return this.refreshExternalTotal; } /** - * time spend in suggest + * number of pending refresh listeners *

- * API name: {@code pri.suggest.time} + * API name: {@code refresh.listeners} + *

*/ @Nullable - public final String priSuggestTime() { - return this.priSuggestTime; + public final String refreshListeners() { + return this.refreshListeners; } /** - * number of suggest ops + * time spent in refreshes *

- * API name: {@code suggest.total} + * API name: {@code refresh.time} + *

*/ @Nullable - public final String suggestTotal() { - return this.suggestTotal; + public final String refreshTime() { + return this.refreshTime; } /** - * number of suggest ops + * total refreshes *

- * API name: {@code pri.suggest.total} + * API name: {@code refresh.total} + *

*/ @Nullable - public final String priSuggestTotal() { - return this.priSuggestTotal; + public final String refreshTotal() { + return this.refreshTotal; } /** - * total used memory + * number of replica shards *

- * API name: {@code memory.total} + * API name: {@code rep} + *

*/ @Nullable - public final String memoryTotal() { - return this.memoryTotal; + public final String rep() { + return this.rep; } /** - * total user memory + * request cache evictions *

- * API name: {@code pri.memory.total} + * API name: {@code request_cache.evictions} + *

*/ @Nullable - public final String priMemoryTotal() { - return this.priMemoryTotal; + public final String requestCacheEvictions() { + return this.requestCacheEvictions; } /** - * indicates if the index is search throttled + * request cache hit count *

- * API name: {@code search.throttled} + * API name: {@code request_cache.hit_count} + *

*/ @Nullable - public final String searchThrottled() { - return this.searchThrottled; + public final String requestCacheHitCount() { + return this.requestCacheHitCount; } /** - * number of bulk shard ops + * used request cache *

- * API name: {@code bulk.total_operations} + * API name: {@code request_cache.memory_size} + *

*/ @Nullable - public final String bulkTotalOperations() { - return this.bulkTotalOperations; + public final String requestCacheMemorySize() { + return this.requestCacheMemorySize; } /** - * number of bulk shard ops + * request cache miss count *

- * API name: {@code pri.bulk.total_operations} + * API name: {@code request_cache.miss_count} + *

*/ @Nullable - public final String priBulkTotalOperations() { - return this.priBulkTotalOperations; + public final String requestCacheMissCount() { + return this.requestCacheMissCount; } /** - * time spend in shard bulk - *

- * API name: {@code bulk.total_time} + * API name: {@code search.concurrent_avg_slice_count} */ @Nullable - public final String bulkTotalTime() { - return this.bulkTotalTime; + public final String searchConcurrentAvgSliceCount() { + return this.searchConcurrentAvgSliceCount; } /** - * time spend in shard bulk - *

- * API name: {@code pri.bulk.total_time} + * API name: {@code search.concurrent_query_current} */ @Nullable - public final String priBulkTotalTime() { - return this.priBulkTotalTime; + public final String searchConcurrentQueryCurrent() { + return this.searchConcurrentQueryCurrent; } /** - * total size in bytes of shard bulk - *

- * API name: {@code bulk.total_size_in_bytes} + * API name: {@code search.concurrent_query_time} */ @Nullable - public final String bulkTotalSizeInBytes() { - return this.bulkTotalSizeInBytes; + public final String searchConcurrentQueryTime() { + return this.searchConcurrentQueryTime; } /** - * total size in bytes of shard bulk - *

- * API name: {@code pri.bulk.total_size_in_bytes} + * API name: {@code search.concurrent_query_total} */ @Nullable - public final String priBulkTotalSizeInBytes() { - return this.priBulkTotalSizeInBytes; + public final String searchConcurrentQueryTotal() { + return this.searchConcurrentQueryTotal; } /** - * average time spend in shard bulk + * current fetch phase ops *

- * API name: {@code bulk.avg_time} + * API name: {@code search.fetch_current} + *

*/ @Nullable - public final String bulkAvgTime() { - return this.bulkAvgTime; + public final String searchFetchCurrent() { + return this.searchFetchCurrent; } /** - * average time spend in shard bulk + * time spent in fetch phase *

- * API name: {@code pri.bulk.avg_time} + * API name: {@code search.fetch_time} + *

*/ @Nullable - public final String priBulkAvgTime() { - return this.priBulkAvgTime; + public final String searchFetchTime() { + return this.searchFetchTime; } /** - * average size in bytes of shard bulk + * total fetch ops *

- * API name: {@code bulk.avg_size_in_bytes} + * API name: {@code search.fetch_total} + *

*/ @Nullable - public final String bulkAvgSizeInBytes() { - return this.bulkAvgSizeInBytes; + public final String searchFetchTotal() { + return this.searchFetchTotal; } /** - * average size in bytes of shard bulk + * open search contexts *

- * API name: {@code pri.bulk.avg_size_in_bytes} + * API name: {@code search.open_contexts} + *

*/ @Nullable - public final String priBulkAvgSizeInBytes() { - return this.priBulkAvgSizeInBytes; + public final String searchOpenContexts() { + return this.searchOpenContexts; } /** - * Serialize this object to JSON. + * API name: {@code search.point_in_time_current} */ - public void serialize(JsonGenerator generator, JsonpMapper mapper) { - generator.writeStartObject(); - serializeInternal(generator, mapper); - generator.writeEnd(); + @Nullable + public final String searchPointInTimeCurrent() { + return this.searchPointInTimeCurrent; } - protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { + /** + * API name: {@code search.point_in_time_time} + */ + @Nullable + public final String searchPointInTimeTime() { + return this.searchPointInTimeTime; + } - if (this.health != null) { - generator.writeKey("health"); - generator.write(this.health); + /** + * API name: {@code search.point_in_time_total} + */ + @Nullable + public final String searchPointInTimeTotal() { + return this.searchPointInTimeTotal; + } - } - if (this.status != null) { - generator.writeKey("status"); - generator.write(this.status); + /** + * current query phase ops + *

+ * API name: {@code search.query_current} + *

+ */ + @Nullable + public final String searchQueryCurrent() { + return this.searchQueryCurrent; + } - } - if (this.index != null) { - generator.writeKey("index"); - generator.write(this.index); + /** + * time spent in query phase + *

+ * API name: {@code search.query_time} + *

+ */ + @Nullable + public final String searchQueryTime() { + return this.searchQueryTime; + } - } - if (this.uuid != null) { - generator.writeKey("uuid"); - generator.write(this.uuid); + /** + * total query phase ops + *

+ * API name: {@code search.query_total} + *

+ */ + @Nullable + public final String searchQueryTotal() { + return this.searchQueryTotal; + } - } - if (this.pri != null) { - generator.writeKey("pri"); - generator.write(this.pri); + /** + * open scroll contexts + *

+ * API name: {@code search.scroll_current} + *

+ */ + @Nullable + public final String searchScrollCurrent() { + return this.searchScrollCurrent; + } - } - if (this.rep != null) { - generator.writeKey("rep"); - generator.write(this.rep); + /** + * time scroll contexts held open + *

+ * API name: {@code search.scroll_time} + *

+ */ + @Nullable + public final String searchScrollTime() { + return this.searchScrollTime; + } - } - if (this.docsCount != null) { - generator.writeKey("docs.count"); - generator.write(this.docsCount); + /** + * completed scroll contexts + *

+ * API name: {@code search.scroll_total} + *

+ */ + @Nullable + public final String searchScrollTotal() { + return this.searchScrollTotal; + } - } - if (this.docsDeleted != null) { - generator.writeKey("docs.deleted"); - generator.write(this.docsDeleted); + /** + * indicates if the index is search throttled + *

+ * API name: {@code search.throttled} + *

+ */ + @Nullable + public final String searchThrottled() { + return this.searchThrottled; + } - } - if (this.creationDate != null) { - generator.writeKey("creation.date"); - generator.write(this.creationDate); + /** + * number of segments + *

+ * API name: {@code segments.count} + *

+ */ + @Nullable + public final String segmentsCount() { + return this.segmentsCount; + } - } - if (this.creationDateString != null) { - generator.writeKey("creation.date.string"); - generator.write(this.creationDateString); + /** + * memory used by fixed bit sets for nested object field types and export type filters for types referred in _parent fields + *

+ * API name: {@code segments.fixed_bitset_memory} + *

+ */ + @Nullable + public final String segmentsFixedBitsetMemory() { + return this.segmentsFixedBitsetMemory; + } - } - if (this.storeSize != null) { - generator.writeKey("store.size"); - generator.write(this.storeSize); + /** + * memory used by index writer + *

+ * API name: {@code segments.index_writer_memory} + *

+ */ + @Nullable + public final String segmentsIndexWriterMemory() { + return this.segmentsIndexWriterMemory; + } - } - if (this.priStoreSize != null) { - generator.writeKey("pri.store.size"); - generator.write(this.priStoreSize); + /** + * memory used by segments + *

+ * API name: {@code segments.memory} + *

+ */ + @Nullable + public final String segmentsMemory() { + return this.segmentsMemory; + } - } - if (this.completionSize != null) { - generator.writeKey("completion.size"); - generator.write(this.completionSize); + /** + * memory used by version map + *

+ * API name: {@code segments.version_map_memory} + *

+ */ + @Nullable + public final String segmentsVersionMapMemory() { + return this.segmentsVersionMapMemory; + } - } - if (this.priCompletionSize != null) { - generator.writeKey("pri.completion.size"); - generator.write(this.priCompletionSize); + /** + * open/close status + *

+ * API name: {@code status} + *

+ */ + @Nullable + public final String status() { + return this.status; + } - } - if (this.fielddataMemorySize != null) { - generator.writeKey("fielddata.memory_size"); - generator.write(this.fielddataMemorySize); + /** + * store size of primaries and replicas + *

+ * API name: {@code store.size} + *

+ */ + @Nullable + public final String storeSize() { + return this.storeSize; + } - } - if (this.priFielddataMemorySize != null) { - generator.writeKey("pri.fielddata.memory_size"); - generator.write(this.priFielddataMemorySize); + /** + * number of current suggest ops + *

+ * API name: {@code suggest.current} + *

+ */ + @Nullable + public final String suggestCurrent() { + return this.suggestCurrent; + } - } - if (this.fielddataEvictions != null) { - generator.writeKey("fielddata.evictions"); - generator.write(this.fielddataEvictions); + /** + * time spend in suggest + *

+ * API name: {@code suggest.time} + *

+ */ + @Nullable + public final String suggestTime() { + return this.suggestTime; + } - } - if (this.priFielddataEvictions != null) { - generator.writeKey("pri.fielddata.evictions"); - generator.write(this.priFielddataEvictions); + /** + * number of suggest ops + *

+ * API name: {@code suggest.total} + *

+ */ + @Nullable + public final String suggestTotal() { + return this.suggestTotal; + } - } - if (this.queryCacheMemorySize != null) { - generator.writeKey("query_cache.memory_size"); - generator.write(this.queryCacheMemorySize); + /** + * index UUID + *

+ * API name: {@code uuid} + *

+ */ + @Nullable + public final String uuid() { + return this.uuid; + } - } - if (this.priQueryCacheMemorySize != null) { - generator.writeKey("pri.query_cache.memory_size"); - generator.write(this.priQueryCacheMemorySize); + /** + * current warmer ops + *

+ * API name: {@code warmer.current} + *

+ */ + @Nullable + public final String warmerCurrent() { + return this.warmerCurrent; + } - } - if (this.queryCacheEvictions != null) { - generator.writeKey("query_cache.evictions"); - generator.write(this.queryCacheEvictions); + /** + * total warmer ops + *

+ * API name: {@code warmer.total} + *

+ */ + @Nullable + public final String warmerTotal() { + return this.warmerTotal; + } - } - if (this.priQueryCacheEvictions != null) { - generator.writeKey("pri.query_cache.evictions"); - generator.write(this.priQueryCacheEvictions); + /** + * time spent in warmers + *

+ * API name: {@code warmer.total_time} + *

+ */ + @Nullable + public final String warmerTotalTime() { + return this.warmerTotalTime; + } - } - if (this.requestCacheMemorySize != null) { - generator.writeKey("request_cache.memory_size"); - generator.write(this.requestCacheMemorySize); + /** + * Serialize this object to JSON. + */ + @Override + public void serialize(JsonGenerator generator, JsonpMapper mapper) { + generator.writeStartObject(); + serializeInternal(generator, mapper); + generator.writeEnd(); + } + protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { + if (this.completionSize != null) { + generator.writeKey("completion.size"); + generator.write(this.completionSize); } - if (this.priRequestCacheMemorySize != null) { - generator.writeKey("pri.request_cache.memory_size"); - generator.write(this.priRequestCacheMemorySize); + if (this.creationDate != null) { + generator.writeKey("creation.date"); + generator.write(this.creationDate); } - if (this.requestCacheEvictions != null) { - generator.writeKey("request_cache.evictions"); - generator.write(this.requestCacheEvictions); + if (this.creationDateString != null) { + generator.writeKey("creation.date.string"); + generator.write(this.creationDateString); } - if (this.priRequestCacheEvictions != null) { - generator.writeKey("pri.request_cache.evictions"); - generator.write(this.priRequestCacheEvictions); + if (this.docsCount != null) { + generator.writeKey("docs.count"); + generator.write(this.docsCount); } - if (this.requestCacheHitCount != null) { - generator.writeKey("request_cache.hit_count"); - generator.write(this.requestCacheHitCount); + if (this.docsDeleted != null) { + generator.writeKey("docs.deleted"); + generator.write(this.docsDeleted); } - if (this.priRequestCacheHitCount != null) { - generator.writeKey("pri.request_cache.hit_count"); - generator.write(this.priRequestCacheHitCount); + if (this.fielddataEvictions != null) { + generator.writeKey("fielddata.evictions"); + generator.write(this.fielddataEvictions); } - if (this.requestCacheMissCount != null) { - generator.writeKey("request_cache.miss_count"); - generator.write(this.requestCacheMissCount); + if (this.fielddataMemorySize != null) { + generator.writeKey("fielddata.memory_size"); + generator.write(this.fielddataMemorySize); } - if (this.priRequestCacheMissCount != null) { - generator.writeKey("pri.request_cache.miss_count"); - generator.write(this.priRequestCacheMissCount); - } if (this.flushTotal != null) { generator.writeKey("flush.total"); generator.write(this.flushTotal); - } - if (this.priFlushTotal != null) { - generator.writeKey("pri.flush.total"); - generator.write(this.priFlushTotal); - } if (this.flushTotalTime != null) { generator.writeKey("flush.total_time"); generator.write(this.flushTotalTime); - } - if (this.priFlushTotalTime != null) { - generator.writeKey("pri.flush.total_time"); - generator.write(this.priFlushTotalTime); - } if (this.getCurrent != null) { generator.writeKey("get.current"); generator.write(this.getCurrent); - - } - if (this.priGetCurrent != null) { - generator.writeKey("pri.get.current"); - generator.write(this.priGetCurrent); - - } - if (this.getTime != null) { - generator.writeKey("get.time"); - generator.write(this.getTime); - - } - if (this.priGetTime != null) { - generator.writeKey("pri.get.time"); - generator.write(this.priGetTime); - - } - if (this.getTotal != null) { - generator.writeKey("get.total"); - generator.write(this.getTotal); - } - if (this.priGetTotal != null) { - generator.writeKey("pri.get.total"); - generator.write(this.priGetTotal); - } if (this.getExistsTime != null) { generator.writeKey("get.exists_time"); generator.write(this.getExistsTime); - } - if (this.priGetExistsTime != null) { - generator.writeKey("pri.get.exists_time"); - generator.write(this.priGetExistsTime); - } if (this.getExistsTotal != null) { generator.writeKey("get.exists_total"); generator.write(this.getExistsTotal); - } - if (this.priGetExistsTotal != null) { - generator.writeKey("pri.get.exists_total"); - generator.write(this.priGetExistsTotal); - } if (this.getMissingTime != null) { generator.writeKey("get.missing_time"); generator.write(this.getMissingTime); - } - if (this.priGetMissingTime != null) { - generator.writeKey("pri.get.missing_time"); - generator.write(this.priGetMissingTime); - } if (this.getMissingTotal != null) { generator.writeKey("get.missing_total"); generator.write(this.getMissingTotal); + } + + if (this.getTime != null) { + generator.writeKey("get.time"); + generator.write(this.getTime); + } + if (this.getTotal != null) { + generator.writeKey("get.total"); + generator.write(this.getTotal); } - if (this.priGetMissingTotal != null) { - generator.writeKey("pri.get.missing_total"); - generator.write(this.priGetMissingTotal); + if (this.health != null) { + generator.writeKey("health"); + generator.write(this.health); + } + + if (this.index != null) { + generator.writeKey("index"); + generator.write(this.index); } + if (this.indexingDeleteCurrent != null) { generator.writeKey("indexing.delete_current"); generator.write(this.indexingDeleteCurrent); - } - if (this.priIndexingDeleteCurrent != null) { - generator.writeKey("pri.indexing.delete_current"); - generator.write(this.priIndexingDeleteCurrent); - } if (this.indexingDeleteTime != null) { generator.writeKey("indexing.delete_time"); generator.write(this.indexingDeleteTime); - } - if (this.priIndexingDeleteTime != null) { - generator.writeKey("pri.indexing.delete_time"); - generator.write(this.priIndexingDeleteTime); - } if (this.indexingDeleteTotal != null) { generator.writeKey("indexing.delete_total"); generator.write(this.indexingDeleteTotal); - } - if (this.priIndexingDeleteTotal != null) { - generator.writeKey("pri.indexing.delete_total"); - generator.write(this.priIndexingDeleteTotal); - } if (this.indexingIndexCurrent != null) { generator.writeKey("indexing.index_current"); generator.write(this.indexingIndexCurrent); - } - if (this.priIndexingIndexCurrent != null) { - generator.writeKey("pri.indexing.index_current"); - generator.write(this.priIndexingIndexCurrent); + if (this.indexingIndexFailed != null) { + generator.writeKey("indexing.index_failed"); + generator.write(this.indexingIndexFailed); } + if (this.indexingIndexTime != null) { generator.writeKey("indexing.index_time"); generator.write(this.indexingIndexTime); - } - if (this.priIndexingIndexTime != null) { - generator.writeKey("pri.indexing.index_time"); - generator.write(this.priIndexingIndexTime); - } if (this.indexingIndexTotal != null) { generator.writeKey("indexing.index_total"); generator.write(this.indexingIndexTotal); - - } - if (this.priIndexingIndexTotal != null) { - generator.writeKey("pri.indexing.index_total"); - generator.write(this.priIndexingIndexTotal); - } - if (this.indexingIndexFailed != null) { - generator.writeKey("indexing.index_failed"); - generator.write(this.indexingIndexFailed); + if (this.memoryTotal != null) { + generator.writeKey("memory.total"); + generator.write(this.memoryTotal); } - if (this.priIndexingIndexFailed != null) { - generator.writeKey("pri.indexing.index_failed"); - generator.write(this.priIndexingIndexFailed); - } if (this.mergesCurrent != null) { generator.writeKey("merges.current"); generator.write(this.mergesCurrent); - } - if (this.priMergesCurrent != null) { - generator.writeKey("pri.merges.current"); - generator.write(this.priMergesCurrent); - } if (this.mergesCurrentDocs != null) { generator.writeKey("merges.current_docs"); generator.write(this.mergesCurrentDocs); - } - if (this.priMergesCurrentDocs != null) { - generator.writeKey("pri.merges.current_docs"); - generator.write(this.priMergesCurrentDocs); - } if (this.mergesCurrentSize != null) { generator.writeKey("merges.current_size"); generator.write(this.mergesCurrentSize); - } - if (this.priMergesCurrentSize != null) { - generator.writeKey("pri.merges.current_size"); - generator.write(this.priMergesCurrentSize); - } if (this.mergesTotal != null) { generator.writeKey("merges.total"); generator.write(this.mergesTotal); - } - if (this.priMergesTotal != null) { - generator.writeKey("pri.merges.total"); - generator.write(this.priMergesTotal); - } if (this.mergesTotalDocs != null) { generator.writeKey("merges.total_docs"); generator.write(this.mergesTotalDocs); - } - if (this.priMergesTotalDocs != null) { - generator.writeKey("pri.merges.total_docs"); - generator.write(this.priMergesTotalDocs); - } if (this.mergesTotalSize != null) { generator.writeKey("merges.total_size"); generator.write(this.mergesTotalSize); - } - if (this.priMergesTotalSize != null) { - generator.writeKey("pri.merges.total_size"); - generator.write(this.priMergesTotalSize); - } if (this.mergesTotalTime != null) { generator.writeKey("merges.total_time"); generator.write(this.mergesTotalTime); + } + if (this.pri != null) { + generator.writeKey("pri"); + generator.write(this.pri); } - if (this.priMergesTotalTime != null) { - generator.writeKey("pri.merges.total_time"); - generator.write(this.priMergesTotalTime); + if (this.priCompletionSize != null) { + generator.writeKey("pri.completion.size"); + generator.write(this.priCompletionSize); } - if (this.refreshTotal != null) { - generator.writeKey("refresh.total"); - generator.write(this.refreshTotal); + if (this.priFielddataEvictions != null) { + generator.writeKey("pri.fielddata.evictions"); + generator.write(this.priFielddataEvictions); } - if (this.priRefreshTotal != null) { - generator.writeKey("pri.refresh.total"); - generator.write(this.priRefreshTotal); + if (this.priFielddataMemorySize != null) { + generator.writeKey("pri.fielddata.memory_size"); + generator.write(this.priFielddataMemorySize); } - if (this.refreshTime != null) { - generator.writeKey("refresh.time"); - generator.write(this.refreshTime); + if (this.priFlushTotal != null) { + generator.writeKey("pri.flush.total"); + generator.write(this.priFlushTotal); } - if (this.priRefreshTime != null) { - generator.writeKey("pri.refresh.time"); - generator.write(this.priRefreshTime); + if (this.priFlushTotalTime != null) { + generator.writeKey("pri.flush.total_time"); + generator.write(this.priFlushTotalTime); } - if (this.refreshExternalTotal != null) { - generator.writeKey("refresh.external_total"); - generator.write(this.refreshExternalTotal); + if (this.priGetCurrent != null) { + generator.writeKey("pri.get.current"); + generator.write(this.priGetCurrent); } - if (this.priRefreshExternalTotal != null) { - generator.writeKey("pri.refresh.external_total"); - generator.write(this.priRefreshExternalTotal); + if (this.priGetExistsTime != null) { + generator.writeKey("pri.get.exists_time"); + generator.write(this.priGetExistsTime); } - if (this.refreshExternalTime != null) { - generator.writeKey("refresh.external_time"); - generator.write(this.refreshExternalTime); + if (this.priGetExistsTotal != null) { + generator.writeKey("pri.get.exists_total"); + generator.write(this.priGetExistsTotal); } - if (this.priRefreshExternalTime != null) { - generator.writeKey("pri.refresh.external_time"); - generator.write(this.priRefreshExternalTime); + if (this.priGetMissingTime != null) { + generator.writeKey("pri.get.missing_time"); + generator.write(this.priGetMissingTime); } - if (this.refreshListeners != null) { - generator.writeKey("refresh.listeners"); - generator.write(this.refreshListeners); + if (this.priGetMissingTotal != null) { + generator.writeKey("pri.get.missing_total"); + generator.write(this.priGetMissingTotal); } - if (this.priRefreshListeners != null) { - generator.writeKey("pri.refresh.listeners"); - generator.write(this.priRefreshListeners); + if (this.priGetTime != null) { + generator.writeKey("pri.get.time"); + generator.write(this.priGetTime); } - if (this.searchFetchCurrent != null) { - generator.writeKey("search.fetch_current"); - generator.write(this.searchFetchCurrent); + if (this.priGetTotal != null) { + generator.writeKey("pri.get.total"); + generator.write(this.priGetTotal); } - if (this.priSearchFetchCurrent != null) { - generator.writeKey("pri.search.fetch_current"); - generator.write(this.priSearchFetchCurrent); + if (this.priIndexingDeleteCurrent != null) { + generator.writeKey("pri.indexing.delete_current"); + generator.write(this.priIndexingDeleteCurrent); } - if (this.searchFetchTime != null) { - generator.writeKey("search.fetch_time"); - generator.write(this.searchFetchTime); + if (this.priIndexingDeleteTime != null) { + generator.writeKey("pri.indexing.delete_time"); + generator.write(this.priIndexingDeleteTime); } - if (this.priSearchFetchTime != null) { - generator.writeKey("pri.search.fetch_time"); - generator.write(this.priSearchFetchTime); + if (this.priIndexingDeleteTotal != null) { + generator.writeKey("pri.indexing.delete_total"); + generator.write(this.priIndexingDeleteTotal); } - if (this.searchFetchTotal != null) { - generator.writeKey("search.fetch_total"); - generator.write(this.searchFetchTotal); + if (this.priIndexingIndexCurrent != null) { + generator.writeKey("pri.indexing.index_current"); + generator.write(this.priIndexingIndexCurrent); } - if (this.priSearchFetchTotal != null) { - generator.writeKey("pri.search.fetch_total"); - generator.write(this.priSearchFetchTotal); + if (this.priIndexingIndexFailed != null) { + generator.writeKey("pri.indexing.index_failed"); + generator.write(this.priIndexingIndexFailed); } - if (this.searchOpenContexts != null) { - generator.writeKey("search.open_contexts"); - generator.write(this.searchOpenContexts); + if (this.priIndexingIndexTime != null) { + generator.writeKey("pri.indexing.index_time"); + generator.write(this.priIndexingIndexTime); } - if (this.priSearchOpenContexts != null) { - generator.writeKey("pri.search.open_contexts"); - generator.write(this.priSearchOpenContexts); + if (this.priIndexingIndexTotal != null) { + generator.writeKey("pri.indexing.index_total"); + generator.write(this.priIndexingIndexTotal); } - if (this.searchQueryCurrent != null) { - generator.writeKey("search.query_current"); - generator.write(this.searchQueryCurrent); + if (this.priMemoryTotal != null) { + generator.writeKey("pri.memory.total"); + generator.write(this.priMemoryTotal); } - if (this.priSearchQueryCurrent != null) { - generator.writeKey("pri.search.query_current"); - generator.write(this.priSearchQueryCurrent); + if (this.priMergesCurrent != null) { + generator.writeKey("pri.merges.current"); + generator.write(this.priMergesCurrent); } - if (this.searchQueryTime != null) { - generator.writeKey("search.query_time"); - generator.write(this.searchQueryTime); + if (this.priMergesCurrentDocs != null) { + generator.writeKey("pri.merges.current_docs"); + generator.write(this.priMergesCurrentDocs); } - if (this.priSearchQueryTime != null) { - generator.writeKey("pri.search.query_time"); - generator.write(this.priSearchQueryTime); + if (this.priMergesCurrentSize != null) { + generator.writeKey("pri.merges.current_size"); + generator.write(this.priMergesCurrentSize); } - if (this.searchQueryTotal != null) { - generator.writeKey("search.query_total"); - generator.write(this.searchQueryTotal); + if (this.priMergesTotal != null) { + generator.writeKey("pri.merges.total"); + generator.write(this.priMergesTotal); } - if (this.priSearchQueryTotal != null) { - generator.writeKey("pri.search.query_total"); - generator.write(this.priSearchQueryTotal); + if (this.priMergesTotalDocs != null) { + generator.writeKey("pri.merges.total_docs"); + generator.write(this.priMergesTotalDocs); } - if (this.searchScrollCurrent != null) { - generator.writeKey("search.scroll_current"); - generator.write(this.searchScrollCurrent); + if (this.priMergesTotalSize != null) { + generator.writeKey("pri.merges.total_size"); + generator.write(this.priMergesTotalSize); } - if (this.priSearchScrollCurrent != null) { - generator.writeKey("pri.search.scroll_current"); - generator.write(this.priSearchScrollCurrent); + if (this.priMergesTotalTime != null) { + generator.writeKey("pri.merges.total_time"); + generator.write(this.priMergesTotalTime); } - if (this.searchScrollTime != null) { - generator.writeKey("search.scroll_time"); - generator.write(this.searchScrollTime); + if (this.priQueryCacheEvictions != null) { + generator.writeKey("pri.query_cache.evictions"); + generator.write(this.priQueryCacheEvictions); } - if (this.priSearchScrollTime != null) { - generator.writeKey("pri.search.scroll_time"); - generator.write(this.priSearchScrollTime); + if (this.priQueryCacheMemorySize != null) { + generator.writeKey("pri.query_cache.memory_size"); + generator.write(this.priQueryCacheMemorySize); } - if (this.searchScrollTotal != null) { - generator.writeKey("search.scroll_total"); - generator.write(this.searchScrollTotal); + if (this.priRefreshExternalTime != null) { + generator.writeKey("pri.refresh.external_time"); + generator.write(this.priRefreshExternalTime); } - if (this.priSearchScrollTotal != null) { - generator.writeKey("pri.search.scroll_total"); - generator.write(this.priSearchScrollTotal); + if (this.priRefreshExternalTotal != null) { + generator.writeKey("pri.refresh.external_total"); + generator.write(this.priRefreshExternalTotal); } - if (this.segmentsCount != null) { - generator.writeKey("segments.count"); - generator.write(this.segmentsCount); + if (this.priRefreshListeners != null) { + generator.writeKey("pri.refresh.listeners"); + generator.write(this.priRefreshListeners); } - if (this.priSegmentsCount != null) { - generator.writeKey("pri.segments.count"); - generator.write(this.priSegmentsCount); + if (this.priRefreshTime != null) { + generator.writeKey("pri.refresh.time"); + generator.write(this.priRefreshTime); } - if (this.segmentsMemory != null) { - generator.writeKey("segments.memory"); - generator.write(this.segmentsMemory); + if (this.priRefreshTotal != null) { + generator.writeKey("pri.refresh.total"); + generator.write(this.priRefreshTotal); } - if (this.priSegmentsMemory != null) { - generator.writeKey("pri.segments.memory"); - generator.write(this.priSegmentsMemory); + if (this.priRequestCacheEvictions != null) { + generator.writeKey("pri.request_cache.evictions"); + generator.write(this.priRequestCacheEvictions); } - if (this.segmentsIndexWriterMemory != null) { - generator.writeKey("segments.index_writer_memory"); - generator.write(this.segmentsIndexWriterMemory); + if (this.priRequestCacheHitCount != null) { + generator.writeKey("pri.request_cache.hit_count"); + generator.write(this.priRequestCacheHitCount); } - if (this.priSegmentsIndexWriterMemory != null) { - generator.writeKey("pri.segments.index_writer_memory"); - generator.write(this.priSegmentsIndexWriterMemory); + if (this.priRequestCacheMemorySize != null) { + generator.writeKey("pri.request_cache.memory_size"); + generator.write(this.priRequestCacheMemorySize); } - if (this.segmentsVersionMapMemory != null) { - generator.writeKey("segments.version_map_memory"); - generator.write(this.segmentsVersionMapMemory); + if (this.priRequestCacheMissCount != null) { + generator.writeKey("pri.request_cache.miss_count"); + generator.write(this.priRequestCacheMissCount); } - if (this.priSegmentsVersionMapMemory != null) { - generator.writeKey("pri.segments.version_map_memory"); - generator.write(this.priSegmentsVersionMapMemory); + if (this.priSearchConcurrentAvgSliceCount != null) { + generator.writeKey("pri.search.concurrent_avg_slice_count"); + generator.write(this.priSearchConcurrentAvgSliceCount); } - if (this.segmentsFixedBitsetMemory != null) { - generator.writeKey("segments.fixed_bitset_memory"); - generator.write(this.segmentsFixedBitsetMemory); + if (this.priSearchConcurrentQueryCurrent != null) { + generator.writeKey("pri.search.concurrent_query_current"); + generator.write(this.priSearchConcurrentQueryCurrent); } - if (this.priSegmentsFixedBitsetMemory != null) { - generator.writeKey("pri.segments.fixed_bitset_memory"); - generator.write(this.priSegmentsFixedBitsetMemory); + if (this.priSearchConcurrentQueryTime != null) { + generator.writeKey("pri.search.concurrent_query_time"); + generator.write(this.priSearchConcurrentQueryTime); } - if (this.warmerCurrent != null) { - generator.writeKey("warmer.current"); - generator.write(this.warmerCurrent); + if (this.priSearchConcurrentQueryTotal != null) { + generator.writeKey("pri.search.concurrent_query_total"); + generator.write(this.priSearchConcurrentQueryTotal); } - if (this.priWarmerCurrent != null) { - generator.writeKey("pri.warmer.current"); - generator.write(this.priWarmerCurrent); + if (this.priSearchFetchCurrent != null) { + generator.writeKey("pri.search.fetch_current"); + generator.write(this.priSearchFetchCurrent); } - if (this.warmerTotal != null) { - generator.writeKey("warmer.total"); - generator.write(this.warmerTotal); + if (this.priSearchFetchTime != null) { + generator.writeKey("pri.search.fetch_time"); + generator.write(this.priSearchFetchTime); } - if (this.priWarmerTotal != null) { - generator.writeKey("pri.warmer.total"); - generator.write(this.priWarmerTotal); + if (this.priSearchFetchTotal != null) { + generator.writeKey("pri.search.fetch_total"); + generator.write(this.priSearchFetchTotal); } - if (this.warmerTotalTime != null) { - generator.writeKey("warmer.total_time"); - generator.write(this.warmerTotalTime); + if (this.priSearchOpenContexts != null) { + generator.writeKey("pri.search.open_contexts"); + generator.write(this.priSearchOpenContexts); } - if (this.priWarmerTotalTime != null) { - generator.writeKey("pri.warmer.total_time"); - generator.write(this.priWarmerTotalTime); + if (this.priSearchPointInTimeCurrent != null) { + generator.writeKey("pri.search.point_in_time_current"); + generator.write(this.priSearchPointInTimeCurrent); } - if (this.suggestCurrent != null) { - generator.writeKey("suggest.current"); - generator.write(this.suggestCurrent); + if (this.priSearchPointInTimeTime != null) { + generator.writeKey("pri.search.point_in_time_time"); + generator.write(this.priSearchPointInTimeTime); } - if (this.priSuggestCurrent != null) { - generator.writeKey("pri.suggest.current"); - generator.write(this.priSuggestCurrent); + if (this.priSearchPointInTimeTotal != null) { + generator.writeKey("pri.search.point_in_time_total"); + generator.write(this.priSearchPointInTimeTotal); } - if (this.suggestTime != null) { - generator.writeKey("suggest.time"); - generator.write(this.suggestTime); + if (this.priSearchQueryCurrent != null) { + generator.writeKey("pri.search.query_current"); + generator.write(this.priSearchQueryCurrent); } - if (this.priSuggestTime != null) { - generator.writeKey("pri.suggest.time"); - generator.write(this.priSuggestTime); + if (this.priSearchQueryTime != null) { + generator.writeKey("pri.search.query_time"); + generator.write(this.priSearchQueryTime); } - if (this.suggestTotal != null) { - generator.writeKey("suggest.total"); - generator.write(this.suggestTotal); + if (this.priSearchQueryTotal != null) { + generator.writeKey("pri.search.query_total"); + generator.write(this.priSearchQueryTotal); } - if (this.priSuggestTotal != null) { - generator.writeKey("pri.suggest.total"); - generator.write(this.priSuggestTotal); + if (this.priSearchScrollCurrent != null) { + generator.writeKey("pri.search.scroll_current"); + generator.write(this.priSearchScrollCurrent); } - if (this.memoryTotal != null) { - generator.writeKey("memory.total"); - generator.write(this.memoryTotal); + if (this.priSearchScrollTime != null) { + generator.writeKey("pri.search.scroll_time"); + generator.write(this.priSearchScrollTime); } - if (this.priMemoryTotal != null) { - generator.writeKey("pri.memory.total"); - generator.write(this.priMemoryTotal); + if (this.priSearchScrollTotal != null) { + generator.writeKey("pri.search.scroll_total"); + generator.write(this.priSearchScrollTotal); } - if (this.searchThrottled != null) { - generator.writeKey("search.throttled"); - generator.write(this.searchThrottled); + if (this.priSegmentsCount != null) { + generator.writeKey("pri.segments.count"); + generator.write(this.priSegmentsCount); } - if (this.bulkTotalOperations != null) { - generator.writeKey("bulk.total_operations"); - generator.write(this.bulkTotalOperations); + if (this.priSegmentsFixedBitsetMemory != null) { + generator.writeKey("pri.segments.fixed_bitset_memory"); + generator.write(this.priSegmentsFixedBitsetMemory); } - if (this.priBulkTotalOperations != null) { - generator.writeKey("pri.bulk.total_operations"); - generator.write(this.priBulkTotalOperations); + if (this.priSegmentsIndexWriterMemory != null) { + generator.writeKey("pri.segments.index_writer_memory"); + generator.write(this.priSegmentsIndexWriterMemory); } - if (this.bulkTotalTime != null) { - generator.writeKey("bulk.total_time"); - generator.write(this.bulkTotalTime); + if (this.priSegmentsMemory != null) { + generator.writeKey("pri.segments.memory"); + generator.write(this.priSegmentsMemory); } - if (this.priBulkTotalTime != null) { - generator.writeKey("pri.bulk.total_time"); - generator.write(this.priBulkTotalTime); + if (this.priSegmentsVersionMapMemory != null) { + generator.writeKey("pri.segments.version_map_memory"); + generator.write(this.priSegmentsVersionMapMemory); } - if (this.bulkTotalSizeInBytes != null) { - generator.writeKey("bulk.total_size_in_bytes"); - generator.write(this.bulkTotalSizeInBytes); + if (this.priStoreSize != null) { + generator.writeKey("pri.store.size"); + generator.write(this.priStoreSize); } - if (this.priBulkTotalSizeInBytes != null) { - generator.writeKey("pri.bulk.total_size_in_bytes"); - generator.write(this.priBulkTotalSizeInBytes); + if (this.priSuggestCurrent != null) { + generator.writeKey("pri.suggest.current"); + generator.write(this.priSuggestCurrent); } - if (this.bulkAvgTime != null) { - generator.writeKey("bulk.avg_time"); - generator.write(this.bulkAvgTime); + if (this.priSuggestTime != null) { + generator.writeKey("pri.suggest.time"); + generator.write(this.priSuggestTime); } - if (this.priBulkAvgTime != null) { - generator.writeKey("pri.bulk.avg_time"); - generator.write(this.priBulkAvgTime); + if (this.priSuggestTotal != null) { + generator.writeKey("pri.suggest.total"); + generator.write(this.priSuggestTotal); } - if (this.bulkAvgSizeInBytes != null) { - generator.writeKey("bulk.avg_size_in_bytes"); - generator.write(this.bulkAvgSizeInBytes); + if (this.priWarmerCurrent != null) { + generator.writeKey("pri.warmer.current"); + generator.write(this.priWarmerCurrent); } - if (this.priBulkAvgSizeInBytes != null) { - generator.writeKey("pri.bulk.avg_size_in_bytes"); - generator.write(this.priBulkAvgSizeInBytes); + if (this.priWarmerTotal != null) { + generator.writeKey("pri.warmer.total"); + generator.write(this.priWarmerTotal); } - } - - // --------------------------------------------------------------------------------------------- + if (this.priWarmerTotalTime != null) { + generator.writeKey("pri.warmer.total_time"); + generator.write(this.priWarmerTotalTime); + } - /** - * Builder for {@link IndicesRecord}. - */ + if (this.queryCacheEvictions != null) { + generator.writeKey("query_cache.evictions"); + generator.write(this.queryCacheEvictions); + } - public static class Builder extends ObjectBuilderBase implements ObjectBuilder { - @Nullable - private String health; + if (this.queryCacheMemorySize != null) { + generator.writeKey("query_cache.memory_size"); + generator.write(this.queryCacheMemorySize); + } - @Nullable - private String status; + if (this.refreshExternalTime != null) { + generator.writeKey("refresh.external_time"); + generator.write(this.refreshExternalTime); + } - @Nullable - private String index; + if (this.refreshExternalTotal != null) { + generator.writeKey("refresh.external_total"); + generator.write(this.refreshExternalTotal); + } - @Nullable - private String uuid; + if (this.refreshListeners != null) { + generator.writeKey("refresh.listeners"); + generator.write(this.refreshListeners); + } - @Nullable - private String pri; + if (this.refreshTime != null) { + generator.writeKey("refresh.time"); + generator.write(this.refreshTime); + } - @Nullable - private String rep; + if (this.refreshTotal != null) { + generator.writeKey("refresh.total"); + generator.write(this.refreshTotal); + } - @Nullable - private String docsCount; + if (this.rep != null) { + generator.writeKey("rep"); + generator.write(this.rep); + } - @Nullable - private String docsDeleted; + if (this.requestCacheEvictions != null) { + generator.writeKey("request_cache.evictions"); + generator.write(this.requestCacheEvictions); + } - @Nullable - private String creationDate; + if (this.requestCacheHitCount != null) { + generator.writeKey("request_cache.hit_count"); + generator.write(this.requestCacheHitCount); + } - @Nullable - private String creationDateString; + if (this.requestCacheMemorySize != null) { + generator.writeKey("request_cache.memory_size"); + generator.write(this.requestCacheMemorySize); + } - @Nullable - private String storeSize; + if (this.requestCacheMissCount != null) { + generator.writeKey("request_cache.miss_count"); + generator.write(this.requestCacheMissCount); + } - @Nullable - private String priStoreSize; + if (this.searchConcurrentAvgSliceCount != null) { + generator.writeKey("search.concurrent_avg_slice_count"); + generator.write(this.searchConcurrentAvgSliceCount); + } - @Nullable - private String completionSize; + if (this.searchConcurrentQueryCurrent != null) { + generator.writeKey("search.concurrent_query_current"); + generator.write(this.searchConcurrentQueryCurrent); + } - @Nullable - private String priCompletionSize; + if (this.searchConcurrentQueryTime != null) { + generator.writeKey("search.concurrent_query_time"); + generator.write(this.searchConcurrentQueryTime); + } - @Nullable - private String fielddataMemorySize; + if (this.searchConcurrentQueryTotal != null) { + generator.writeKey("search.concurrent_query_total"); + generator.write(this.searchConcurrentQueryTotal); + } - @Nullable - private String priFielddataMemorySize; + if (this.searchFetchCurrent != null) { + generator.writeKey("search.fetch_current"); + generator.write(this.searchFetchCurrent); + } - @Nullable - private String fielddataEvictions; + if (this.searchFetchTime != null) { + generator.writeKey("search.fetch_time"); + generator.write(this.searchFetchTime); + } - @Nullable - private String priFielddataEvictions; + if (this.searchFetchTotal != null) { + generator.writeKey("search.fetch_total"); + generator.write(this.searchFetchTotal); + } - @Nullable - private String queryCacheMemorySize; + if (this.searchOpenContexts != null) { + generator.writeKey("search.open_contexts"); + generator.write(this.searchOpenContexts); + } - @Nullable - private String priQueryCacheMemorySize; + if (this.searchPointInTimeCurrent != null) { + generator.writeKey("search.point_in_time_current"); + generator.write(this.searchPointInTimeCurrent); + } - @Nullable - private String queryCacheEvictions; + if (this.searchPointInTimeTime != null) { + generator.writeKey("search.point_in_time_time"); + generator.write(this.searchPointInTimeTime); + } - @Nullable - private String priQueryCacheEvictions; + if (this.searchPointInTimeTotal != null) { + generator.writeKey("search.point_in_time_total"); + generator.write(this.searchPointInTimeTotal); + } - @Nullable - private String requestCacheMemorySize; + if (this.searchQueryCurrent != null) { + generator.writeKey("search.query_current"); + generator.write(this.searchQueryCurrent); + } - @Nullable - private String priRequestCacheMemorySize; + if (this.searchQueryTime != null) { + generator.writeKey("search.query_time"); + generator.write(this.searchQueryTime); + } - @Nullable - private String requestCacheEvictions; + if (this.searchQueryTotal != null) { + generator.writeKey("search.query_total"); + generator.write(this.searchQueryTotal); + } - @Nullable - private String priRequestCacheEvictions; + if (this.searchScrollCurrent != null) { + generator.writeKey("search.scroll_current"); + generator.write(this.searchScrollCurrent); + } - @Nullable - private String requestCacheHitCount; + if (this.searchScrollTime != null) { + generator.writeKey("search.scroll_time"); + generator.write(this.searchScrollTime); + } - @Nullable - private String priRequestCacheHitCount; + if (this.searchScrollTotal != null) { + generator.writeKey("search.scroll_total"); + generator.write(this.searchScrollTotal); + } - @Nullable - private String requestCacheMissCount; + if (this.searchThrottled != null) { + generator.writeKey("search.throttled"); + generator.write(this.searchThrottled); + } - @Nullable - private String priRequestCacheMissCount; + if (this.segmentsCount != null) { + generator.writeKey("segments.count"); + generator.write(this.segmentsCount); + } - @Nullable - private String flushTotal; + if (this.segmentsFixedBitsetMemory != null) { + generator.writeKey("segments.fixed_bitset_memory"); + generator.write(this.segmentsFixedBitsetMemory); + } - @Nullable - private String priFlushTotal; + if (this.segmentsIndexWriterMemory != null) { + generator.writeKey("segments.index_writer_memory"); + generator.write(this.segmentsIndexWriterMemory); + } - @Nullable - private String flushTotalTime; + if (this.segmentsMemory != null) { + generator.writeKey("segments.memory"); + generator.write(this.segmentsMemory); + } - @Nullable - private String priFlushTotalTime; + if (this.segmentsVersionMapMemory != null) { + generator.writeKey("segments.version_map_memory"); + generator.write(this.segmentsVersionMapMemory); + } - @Nullable - private String getCurrent; + if (this.status != null) { + generator.writeKey("status"); + generator.write(this.status); + } - @Nullable - private String priGetCurrent; + if (this.storeSize != null) { + generator.writeKey("store.size"); + generator.write(this.storeSize); + } - @Nullable - private String getTime; + if (this.suggestCurrent != null) { + generator.writeKey("suggest.current"); + generator.write(this.suggestCurrent); + } - @Nullable - private String priGetTime; + if (this.suggestTime != null) { + generator.writeKey("suggest.time"); + generator.write(this.suggestTime); + } - @Nullable - private String getTotal; + if (this.suggestTotal != null) { + generator.writeKey("suggest.total"); + generator.write(this.suggestTotal); + } - @Nullable - private String priGetTotal; + if (this.uuid != null) { + generator.writeKey("uuid"); + generator.write(this.uuid); + } - @Nullable - private String getExistsTime; + if (this.warmerCurrent != null) { + generator.writeKey("warmer.current"); + generator.write(this.warmerCurrent); + } - @Nullable - private String priGetExistsTime; + if (this.warmerTotal != null) { + generator.writeKey("warmer.total"); + generator.write(this.warmerTotal); + } - @Nullable - private String getExistsTotal; + if (this.warmerTotalTime != null) { + generator.writeKey("warmer.total_time"); + generator.write(this.warmerTotalTime); + } + } - @Nullable - private String priGetExistsTotal; + // --------------------------------------------------------------------------------------------- - @Nullable - private String getMissingTime; + @Override + @Nonnull + public Builder toBuilder() { + return new Builder(this); + } - @Nullable - private String priGetMissingTime; + @Nonnull + public static Builder builder() { + return new Builder(); + } + /** + * Builder for {@link IndicesRecord}. + */ + public static class Builder extends ObjectBuilderBase implements CopyableBuilder { + @Nullable + private String completionSize; + @Nullable + private String creationDate; + @Nullable + private String creationDateString; + @Nullable + private String docsCount; + @Nullable + private String docsDeleted; + @Nullable + private String fielddataEvictions; + @Nullable + private String fielddataMemorySize; + @Nullable + private String flushTotal; + @Nullable + private String flushTotalTime; + @Nullable + private String getCurrent; + @Nullable + private String getExistsTime; + @Nullable + private String getExistsTotal; + @Nullable + private String getMissingTime; @Nullable private String getMissingTotal; - @Nullable - private String priGetMissingTotal; - + private String getTime; @Nullable - private String indexingDeleteCurrent; - + private String getTotal; @Nullable - private String priIndexingDeleteCurrent; - + private String health; @Nullable - private String indexingDeleteTime; - + private String index; @Nullable - private String priIndexingDeleteTime; - + private String indexingDeleteCurrent; @Nullable - private String indexingDeleteTotal; - + private String indexingDeleteTime; @Nullable - private String priIndexingDeleteTotal; - + private String indexingDeleteTotal; @Nullable private String indexingIndexCurrent; - @Nullable - private String priIndexingIndexCurrent; - + private String indexingIndexFailed; @Nullable private String indexingIndexTime; - - @Nullable - private String priIndexingIndexTime; - @Nullable private String indexingIndexTotal; - @Nullable - private String priIndexingIndexTotal; - + private String memoryTotal; @Nullable - private String indexingIndexFailed; - + private String mergesCurrent; + @Nullable + private String mergesCurrentDocs; + @Nullable + private String mergesCurrentSize; + @Nullable + private String mergesTotal; + @Nullable + private String mergesTotalDocs; + @Nullable + private String mergesTotalSize; + @Nullable + private String mergesTotalTime; + @Nullable + private String pri; + @Nullable + private String priCompletionSize; + @Nullable + private String priFielddataEvictions; + @Nullable + private String priFielddataMemorySize; + @Nullable + private String priFlushTotal; + @Nullable + private String priFlushTotalTime; + @Nullable + private String priGetCurrent; + @Nullable + private String priGetExistsTime; + @Nullable + private String priGetExistsTotal; + @Nullable + private String priGetMissingTime; + @Nullable + private String priGetMissingTotal; + @Nullable + private String priGetTime; + @Nullable + private String priGetTotal; + @Nullable + private String priIndexingDeleteCurrent; + @Nullable + private String priIndexingDeleteTime; + @Nullable + private String priIndexingDeleteTotal; + @Nullable + private String priIndexingIndexCurrent; @Nullable private String priIndexingIndexFailed; - @Nullable - private String mergesCurrent; - + private String priIndexingIndexTime; @Nullable - private String priMergesCurrent; - + private String priIndexingIndexTotal; @Nullable - private String mergesCurrentDocs; - + private String priMemoryTotal; + @Nullable + private String priMergesCurrent; @Nullable private String priMergesCurrentDocs; - @Nullable - private String mergesCurrentSize; - + private String priMergesCurrentSize; + @Nullable + private String priMergesTotal; + @Nullable + private String priMergesTotalDocs; + @Nullable + private String priMergesTotalSize; + @Nullable + private String priMergesTotalTime; + @Nullable + private String priQueryCacheEvictions; + @Nullable + private String priQueryCacheMemorySize; + @Nullable + private String priRefreshExternalTime; + @Nullable + private String priRefreshExternalTotal; + @Nullable + private String priRefreshListeners; + @Nullable + private String priRefreshTime; + @Nullable + private String priRefreshTotal; + @Nullable + private String priRequestCacheEvictions; + @Nullable + private String priRequestCacheHitCount; + @Nullable + private String priRequestCacheMemorySize; + @Nullable + private String priRequestCacheMissCount; + @Nullable + private String priSearchConcurrentAvgSliceCount; + @Nullable + private String priSearchConcurrentQueryCurrent; + @Nullable + private String priSearchConcurrentQueryTime; + @Nullable + private String priSearchConcurrentQueryTotal; + @Nullable + private String priSearchFetchCurrent; + @Nullable + private String priSearchFetchTime; + @Nullable + private String priSearchFetchTotal; + @Nullable + private String priSearchOpenContexts; + @Nullable + private String priSearchPointInTimeCurrent; + @Nullable + private String priSearchPointInTimeTime; + @Nullable + private String priSearchPointInTimeTotal; + @Nullable + private String priSearchQueryCurrent; + @Nullable + private String priSearchQueryTime; + @Nullable + private String priSearchQueryTotal; + @Nullable + private String priSearchScrollCurrent; + @Nullable + private String priSearchScrollTime; + @Nullable + private String priSearchScrollTotal; + @Nullable + private String priSegmentsCount; + @Nullable + private String priSegmentsFixedBitsetMemory; + @Nullable + private String priSegmentsIndexWriterMemory; + @Nullable + private String priSegmentsMemory; + @Nullable + private String priSegmentsVersionMapMemory; + @Nullable + private String priStoreSize; + @Nullable + private String priSuggestCurrent; + @Nullable + private String priSuggestTime; @Nullable - private String priMergesCurrentSize; - + private String priSuggestTotal; @Nullable - private String mergesTotal; - + private String priWarmerCurrent; @Nullable - private String priMergesTotal; - + private String priWarmerTotal; @Nullable - private String mergesTotalDocs; - + private String priWarmerTotalTime; @Nullable - private String priMergesTotalDocs; - + private String queryCacheEvictions; @Nullable - private String mergesTotalSize; - + private String queryCacheMemorySize; @Nullable - private String priMergesTotalSize; - + private String refreshExternalTime; @Nullable - private String mergesTotalTime; - + private String refreshExternalTotal; @Nullable - private String priMergesTotalTime; - + private String refreshListeners; + @Nullable + private String refreshTime; @Nullable private String refreshTotal; - @Nullable - private String priRefreshTotal; - + private String rep; @Nullable - private String refreshTime; - + private String requestCacheEvictions; @Nullable - private String priRefreshTime; - + private String requestCacheHitCount; @Nullable - private String refreshExternalTotal; - + private String requestCacheMemorySize; @Nullable - private String priRefreshExternalTotal; - + private String requestCacheMissCount; @Nullable - private String refreshExternalTime; - + private String searchConcurrentAvgSliceCount; @Nullable - private String priRefreshExternalTime; - + private String searchConcurrentQueryCurrent; @Nullable - private String refreshListeners; - + private String searchConcurrentQueryTime; @Nullable - private String priRefreshListeners; - + private String searchConcurrentQueryTotal; @Nullable private String searchFetchCurrent; - - @Nullable - private String priSearchFetchCurrent; - @Nullable private String searchFetchTime; - - @Nullable - private String priSearchFetchTime; - @Nullable private String searchFetchTotal; - - @Nullable - private String priSearchFetchTotal; - @Nullable private String searchOpenContexts; - @Nullable - private String priSearchOpenContexts; - + private String searchPointInTimeCurrent; @Nullable - private String searchQueryCurrent; - + private String searchPointInTimeTime; @Nullable - private String priSearchQueryCurrent; - + private String searchPointInTimeTotal; @Nullable - private String searchQueryTime; - + private String searchQueryCurrent; @Nullable - private String priSearchQueryTime; - + private String searchQueryTime; @Nullable private String searchQueryTotal; - - @Nullable - private String priSearchQueryTotal; - @Nullable private String searchScrollCurrent; - - @Nullable - private String priSearchScrollCurrent; - @Nullable private String searchScrollTime; - - @Nullable - private String priSearchScrollTime; - @Nullable private String searchScrollTotal; - @Nullable - private String priSearchScrollTotal; - + private String searchThrottled; @Nullable private String segmentsCount; - - @Nullable - private String priSegmentsCount; - - @Nullable - private String segmentsMemory; - @Nullable - private String priSegmentsMemory; - + private String segmentsFixedBitsetMemory; @Nullable private String segmentsIndexWriterMemory; - @Nullable - private String priSegmentsIndexWriterMemory; - + private String segmentsMemory; @Nullable private String segmentsVersionMapMemory; - - @Nullable - private String priSegmentsVersionMapMemory; - - @Nullable - private String segmentsFixedBitsetMemory; - - @Nullable - private String priSegmentsFixedBitsetMemory; - - @Nullable - private String warmerCurrent; - - @Nullable - private String priWarmerCurrent; - - @Nullable - private String warmerTotal; - - @Nullable - private String priWarmerTotal; - @Nullable - private String warmerTotalTime; - + private String status; @Nullable - private String priWarmerTotalTime; - + private String storeSize; @Nullable private String suggestCurrent; - - @Nullable - private String priSuggestCurrent; - @Nullable private String suggestTime; - - @Nullable - private String priSuggestTime; - @Nullable private String suggestTotal; - - @Nullable - private String priSuggestTotal; - - @Nullable - private String memoryTotal; - - @Nullable - private String priMemoryTotal; - @Nullable - private String searchThrottled; - + private String uuid; @Nullable - private String bulkTotalOperations; - + private String warmerCurrent; @Nullable - private String priBulkTotalOperations; - + private String warmerTotal; @Nullable - private String bulkTotalTime; + private String warmerTotalTime; - @Nullable - private String priBulkTotalTime; + public Builder() {} + + private Builder(IndicesRecord o) { + this.completionSize = o.completionSize; + this.creationDate = o.creationDate; + this.creationDateString = o.creationDateString; + this.docsCount = o.docsCount; + this.docsDeleted = o.docsDeleted; + this.fielddataEvictions = o.fielddataEvictions; + this.fielddataMemorySize = o.fielddataMemorySize; + this.flushTotal = o.flushTotal; + this.flushTotalTime = o.flushTotalTime; + this.getCurrent = o.getCurrent; + this.getExistsTime = o.getExistsTime; + this.getExistsTotal = o.getExistsTotal; + this.getMissingTime = o.getMissingTime; + this.getMissingTotal = o.getMissingTotal; + this.getTime = o.getTime; + this.getTotal = o.getTotal; + this.health = o.health; + this.index = o.index; + this.indexingDeleteCurrent = o.indexingDeleteCurrent; + this.indexingDeleteTime = o.indexingDeleteTime; + this.indexingDeleteTotal = o.indexingDeleteTotal; + this.indexingIndexCurrent = o.indexingIndexCurrent; + this.indexingIndexFailed = o.indexingIndexFailed; + this.indexingIndexTime = o.indexingIndexTime; + this.indexingIndexTotal = o.indexingIndexTotal; + this.memoryTotal = o.memoryTotal; + this.mergesCurrent = o.mergesCurrent; + this.mergesCurrentDocs = o.mergesCurrentDocs; + this.mergesCurrentSize = o.mergesCurrentSize; + this.mergesTotal = o.mergesTotal; + this.mergesTotalDocs = o.mergesTotalDocs; + this.mergesTotalSize = o.mergesTotalSize; + this.mergesTotalTime = o.mergesTotalTime; + this.pri = o.pri; + this.priCompletionSize = o.priCompletionSize; + this.priFielddataEvictions = o.priFielddataEvictions; + this.priFielddataMemorySize = o.priFielddataMemorySize; + this.priFlushTotal = o.priFlushTotal; + this.priFlushTotalTime = o.priFlushTotalTime; + this.priGetCurrent = o.priGetCurrent; + this.priGetExistsTime = o.priGetExistsTime; + this.priGetExistsTotal = o.priGetExistsTotal; + this.priGetMissingTime = o.priGetMissingTime; + this.priGetMissingTotal = o.priGetMissingTotal; + this.priGetTime = o.priGetTime; + this.priGetTotal = o.priGetTotal; + this.priIndexingDeleteCurrent = o.priIndexingDeleteCurrent; + this.priIndexingDeleteTime = o.priIndexingDeleteTime; + this.priIndexingDeleteTotal = o.priIndexingDeleteTotal; + this.priIndexingIndexCurrent = o.priIndexingIndexCurrent; + this.priIndexingIndexFailed = o.priIndexingIndexFailed; + this.priIndexingIndexTime = o.priIndexingIndexTime; + this.priIndexingIndexTotal = o.priIndexingIndexTotal; + this.priMemoryTotal = o.priMemoryTotal; + this.priMergesCurrent = o.priMergesCurrent; + this.priMergesCurrentDocs = o.priMergesCurrentDocs; + this.priMergesCurrentSize = o.priMergesCurrentSize; + this.priMergesTotal = o.priMergesTotal; + this.priMergesTotalDocs = o.priMergesTotalDocs; + this.priMergesTotalSize = o.priMergesTotalSize; + this.priMergesTotalTime = o.priMergesTotalTime; + this.priQueryCacheEvictions = o.priQueryCacheEvictions; + this.priQueryCacheMemorySize = o.priQueryCacheMemorySize; + this.priRefreshExternalTime = o.priRefreshExternalTime; + this.priRefreshExternalTotal = o.priRefreshExternalTotal; + this.priRefreshListeners = o.priRefreshListeners; + this.priRefreshTime = o.priRefreshTime; + this.priRefreshTotal = o.priRefreshTotal; + this.priRequestCacheEvictions = o.priRequestCacheEvictions; + this.priRequestCacheHitCount = o.priRequestCacheHitCount; + this.priRequestCacheMemorySize = o.priRequestCacheMemorySize; + this.priRequestCacheMissCount = o.priRequestCacheMissCount; + this.priSearchConcurrentAvgSliceCount = o.priSearchConcurrentAvgSliceCount; + this.priSearchConcurrentQueryCurrent = o.priSearchConcurrentQueryCurrent; + this.priSearchConcurrentQueryTime = o.priSearchConcurrentQueryTime; + this.priSearchConcurrentQueryTotal = o.priSearchConcurrentQueryTotal; + this.priSearchFetchCurrent = o.priSearchFetchCurrent; + this.priSearchFetchTime = o.priSearchFetchTime; + this.priSearchFetchTotal = o.priSearchFetchTotal; + this.priSearchOpenContexts = o.priSearchOpenContexts; + this.priSearchPointInTimeCurrent = o.priSearchPointInTimeCurrent; + this.priSearchPointInTimeTime = o.priSearchPointInTimeTime; + this.priSearchPointInTimeTotal = o.priSearchPointInTimeTotal; + this.priSearchQueryCurrent = o.priSearchQueryCurrent; + this.priSearchQueryTime = o.priSearchQueryTime; + this.priSearchQueryTotal = o.priSearchQueryTotal; + this.priSearchScrollCurrent = o.priSearchScrollCurrent; + this.priSearchScrollTime = o.priSearchScrollTime; + this.priSearchScrollTotal = o.priSearchScrollTotal; + this.priSegmentsCount = o.priSegmentsCount; + this.priSegmentsFixedBitsetMemory = o.priSegmentsFixedBitsetMemory; + this.priSegmentsIndexWriterMemory = o.priSegmentsIndexWriterMemory; + this.priSegmentsMemory = o.priSegmentsMemory; + this.priSegmentsVersionMapMemory = o.priSegmentsVersionMapMemory; + this.priStoreSize = o.priStoreSize; + this.priSuggestCurrent = o.priSuggestCurrent; + this.priSuggestTime = o.priSuggestTime; + this.priSuggestTotal = o.priSuggestTotal; + this.priWarmerCurrent = o.priWarmerCurrent; + this.priWarmerTotal = o.priWarmerTotal; + this.priWarmerTotalTime = o.priWarmerTotalTime; + this.queryCacheEvictions = o.queryCacheEvictions; + this.queryCacheMemorySize = o.queryCacheMemorySize; + this.refreshExternalTime = o.refreshExternalTime; + this.refreshExternalTotal = o.refreshExternalTotal; + this.refreshListeners = o.refreshListeners; + this.refreshTime = o.refreshTime; + this.refreshTotal = o.refreshTotal; + this.rep = o.rep; + this.requestCacheEvictions = o.requestCacheEvictions; + this.requestCacheHitCount = o.requestCacheHitCount; + this.requestCacheMemorySize = o.requestCacheMemorySize; + this.requestCacheMissCount = o.requestCacheMissCount; + this.searchConcurrentAvgSliceCount = o.searchConcurrentAvgSliceCount; + this.searchConcurrentQueryCurrent = o.searchConcurrentQueryCurrent; + this.searchConcurrentQueryTime = o.searchConcurrentQueryTime; + this.searchConcurrentQueryTotal = o.searchConcurrentQueryTotal; + this.searchFetchCurrent = o.searchFetchCurrent; + this.searchFetchTime = o.searchFetchTime; + this.searchFetchTotal = o.searchFetchTotal; + this.searchOpenContexts = o.searchOpenContexts; + this.searchPointInTimeCurrent = o.searchPointInTimeCurrent; + this.searchPointInTimeTime = o.searchPointInTimeTime; + this.searchPointInTimeTotal = o.searchPointInTimeTotal; + this.searchQueryCurrent = o.searchQueryCurrent; + this.searchQueryTime = o.searchQueryTime; + this.searchQueryTotal = o.searchQueryTotal; + this.searchScrollCurrent = o.searchScrollCurrent; + this.searchScrollTime = o.searchScrollTime; + this.searchScrollTotal = o.searchScrollTotal; + this.searchThrottled = o.searchThrottled; + this.segmentsCount = o.segmentsCount; + this.segmentsFixedBitsetMemory = o.segmentsFixedBitsetMemory; + this.segmentsIndexWriterMemory = o.segmentsIndexWriterMemory; + this.segmentsMemory = o.segmentsMemory; + this.segmentsVersionMapMemory = o.segmentsVersionMapMemory; + this.status = o.status; + this.storeSize = o.storeSize; + this.suggestCurrent = o.suggestCurrent; + this.suggestTime = o.suggestTime; + this.suggestTotal = o.suggestTotal; + this.uuid = o.uuid; + this.warmerCurrent = o.warmerCurrent; + this.warmerTotal = o.warmerTotal; + this.warmerTotalTime = o.warmerTotalTime; + } + + private Builder(Builder o) { + this.completionSize = o.completionSize; + this.creationDate = o.creationDate; + this.creationDateString = o.creationDateString; + this.docsCount = o.docsCount; + this.docsDeleted = o.docsDeleted; + this.fielddataEvictions = o.fielddataEvictions; + this.fielddataMemorySize = o.fielddataMemorySize; + this.flushTotal = o.flushTotal; + this.flushTotalTime = o.flushTotalTime; + this.getCurrent = o.getCurrent; + this.getExistsTime = o.getExistsTime; + this.getExistsTotal = o.getExistsTotal; + this.getMissingTime = o.getMissingTime; + this.getMissingTotal = o.getMissingTotal; + this.getTime = o.getTime; + this.getTotal = o.getTotal; + this.health = o.health; + this.index = o.index; + this.indexingDeleteCurrent = o.indexingDeleteCurrent; + this.indexingDeleteTime = o.indexingDeleteTime; + this.indexingDeleteTotal = o.indexingDeleteTotal; + this.indexingIndexCurrent = o.indexingIndexCurrent; + this.indexingIndexFailed = o.indexingIndexFailed; + this.indexingIndexTime = o.indexingIndexTime; + this.indexingIndexTotal = o.indexingIndexTotal; + this.memoryTotal = o.memoryTotal; + this.mergesCurrent = o.mergesCurrent; + this.mergesCurrentDocs = o.mergesCurrentDocs; + this.mergesCurrentSize = o.mergesCurrentSize; + this.mergesTotal = o.mergesTotal; + this.mergesTotalDocs = o.mergesTotalDocs; + this.mergesTotalSize = o.mergesTotalSize; + this.mergesTotalTime = o.mergesTotalTime; + this.pri = o.pri; + this.priCompletionSize = o.priCompletionSize; + this.priFielddataEvictions = o.priFielddataEvictions; + this.priFielddataMemorySize = o.priFielddataMemorySize; + this.priFlushTotal = o.priFlushTotal; + this.priFlushTotalTime = o.priFlushTotalTime; + this.priGetCurrent = o.priGetCurrent; + this.priGetExistsTime = o.priGetExistsTime; + this.priGetExistsTotal = o.priGetExistsTotal; + this.priGetMissingTime = o.priGetMissingTime; + this.priGetMissingTotal = o.priGetMissingTotal; + this.priGetTime = o.priGetTime; + this.priGetTotal = o.priGetTotal; + this.priIndexingDeleteCurrent = o.priIndexingDeleteCurrent; + this.priIndexingDeleteTime = o.priIndexingDeleteTime; + this.priIndexingDeleteTotal = o.priIndexingDeleteTotal; + this.priIndexingIndexCurrent = o.priIndexingIndexCurrent; + this.priIndexingIndexFailed = o.priIndexingIndexFailed; + this.priIndexingIndexTime = o.priIndexingIndexTime; + this.priIndexingIndexTotal = o.priIndexingIndexTotal; + this.priMemoryTotal = o.priMemoryTotal; + this.priMergesCurrent = o.priMergesCurrent; + this.priMergesCurrentDocs = o.priMergesCurrentDocs; + this.priMergesCurrentSize = o.priMergesCurrentSize; + this.priMergesTotal = o.priMergesTotal; + this.priMergesTotalDocs = o.priMergesTotalDocs; + this.priMergesTotalSize = o.priMergesTotalSize; + this.priMergesTotalTime = o.priMergesTotalTime; + this.priQueryCacheEvictions = o.priQueryCacheEvictions; + this.priQueryCacheMemorySize = o.priQueryCacheMemorySize; + this.priRefreshExternalTime = o.priRefreshExternalTime; + this.priRefreshExternalTotal = o.priRefreshExternalTotal; + this.priRefreshListeners = o.priRefreshListeners; + this.priRefreshTime = o.priRefreshTime; + this.priRefreshTotal = o.priRefreshTotal; + this.priRequestCacheEvictions = o.priRequestCacheEvictions; + this.priRequestCacheHitCount = o.priRequestCacheHitCount; + this.priRequestCacheMemorySize = o.priRequestCacheMemorySize; + this.priRequestCacheMissCount = o.priRequestCacheMissCount; + this.priSearchConcurrentAvgSliceCount = o.priSearchConcurrentAvgSliceCount; + this.priSearchConcurrentQueryCurrent = o.priSearchConcurrentQueryCurrent; + this.priSearchConcurrentQueryTime = o.priSearchConcurrentQueryTime; + this.priSearchConcurrentQueryTotal = o.priSearchConcurrentQueryTotal; + this.priSearchFetchCurrent = o.priSearchFetchCurrent; + this.priSearchFetchTime = o.priSearchFetchTime; + this.priSearchFetchTotal = o.priSearchFetchTotal; + this.priSearchOpenContexts = o.priSearchOpenContexts; + this.priSearchPointInTimeCurrent = o.priSearchPointInTimeCurrent; + this.priSearchPointInTimeTime = o.priSearchPointInTimeTime; + this.priSearchPointInTimeTotal = o.priSearchPointInTimeTotal; + this.priSearchQueryCurrent = o.priSearchQueryCurrent; + this.priSearchQueryTime = o.priSearchQueryTime; + this.priSearchQueryTotal = o.priSearchQueryTotal; + this.priSearchScrollCurrent = o.priSearchScrollCurrent; + this.priSearchScrollTime = o.priSearchScrollTime; + this.priSearchScrollTotal = o.priSearchScrollTotal; + this.priSegmentsCount = o.priSegmentsCount; + this.priSegmentsFixedBitsetMemory = o.priSegmentsFixedBitsetMemory; + this.priSegmentsIndexWriterMemory = o.priSegmentsIndexWriterMemory; + this.priSegmentsMemory = o.priSegmentsMemory; + this.priSegmentsVersionMapMemory = o.priSegmentsVersionMapMemory; + this.priStoreSize = o.priStoreSize; + this.priSuggestCurrent = o.priSuggestCurrent; + this.priSuggestTime = o.priSuggestTime; + this.priSuggestTotal = o.priSuggestTotal; + this.priWarmerCurrent = o.priWarmerCurrent; + this.priWarmerTotal = o.priWarmerTotal; + this.priWarmerTotalTime = o.priWarmerTotalTime; + this.queryCacheEvictions = o.queryCacheEvictions; + this.queryCacheMemorySize = o.queryCacheMemorySize; + this.refreshExternalTime = o.refreshExternalTime; + this.refreshExternalTotal = o.refreshExternalTotal; + this.refreshListeners = o.refreshListeners; + this.refreshTime = o.refreshTime; + this.refreshTotal = o.refreshTotal; + this.rep = o.rep; + this.requestCacheEvictions = o.requestCacheEvictions; + this.requestCacheHitCount = o.requestCacheHitCount; + this.requestCacheMemorySize = o.requestCacheMemorySize; + this.requestCacheMissCount = o.requestCacheMissCount; + this.searchConcurrentAvgSliceCount = o.searchConcurrentAvgSliceCount; + this.searchConcurrentQueryCurrent = o.searchConcurrentQueryCurrent; + this.searchConcurrentQueryTime = o.searchConcurrentQueryTime; + this.searchConcurrentQueryTotal = o.searchConcurrentQueryTotal; + this.searchFetchCurrent = o.searchFetchCurrent; + this.searchFetchTime = o.searchFetchTime; + this.searchFetchTotal = o.searchFetchTotal; + this.searchOpenContexts = o.searchOpenContexts; + this.searchPointInTimeCurrent = o.searchPointInTimeCurrent; + this.searchPointInTimeTime = o.searchPointInTimeTime; + this.searchPointInTimeTotal = o.searchPointInTimeTotal; + this.searchQueryCurrent = o.searchQueryCurrent; + this.searchQueryTime = o.searchQueryTime; + this.searchQueryTotal = o.searchQueryTotal; + this.searchScrollCurrent = o.searchScrollCurrent; + this.searchScrollTime = o.searchScrollTime; + this.searchScrollTotal = o.searchScrollTotal; + this.searchThrottled = o.searchThrottled; + this.segmentsCount = o.segmentsCount; + this.segmentsFixedBitsetMemory = o.segmentsFixedBitsetMemory; + this.segmentsIndexWriterMemory = o.segmentsIndexWriterMemory; + this.segmentsMemory = o.segmentsMemory; + this.segmentsVersionMapMemory = o.segmentsVersionMapMemory; + this.status = o.status; + this.storeSize = o.storeSize; + this.suggestCurrent = o.suggestCurrent; + this.suggestTime = o.suggestTime; + this.suggestTotal = o.suggestTotal; + this.uuid = o.uuid; + this.warmerCurrent = o.warmerCurrent; + this.warmerTotal = o.warmerTotal; + this.warmerTotalTime = o.warmerTotalTime; + } + + @Override + @Nonnull + public Builder copy() { + return new Builder(this); + } - @Nullable - private String bulkTotalSizeInBytes; + /** + * size of completion + *

+ * API name: {@code completion.size} + *

+ */ + @Nonnull + public final Builder completionSize(@Nullable String value) { + this.completionSize = value; + return this; + } - @Nullable - private String priBulkTotalSizeInBytes; + /** + * index creation date (millisecond value) + *

+ * API name: {@code creation.date} + *

+ */ + @Nonnull + public final Builder creationDate(@Nullable String value) { + this.creationDate = value; + return this; + } - @Nullable - private String bulkAvgTime; + /** + * index creation date (as string) + *

+ * API name: {@code creation.date.string} + *

+ */ + @Nonnull + public final Builder creationDateString(@Nullable String value) { + this.creationDateString = value; + return this; + } - @Nullable - private String priBulkAvgTime; + /** + * available docs + *

+ * API name: {@code docs.count} + *

+ */ + @Nonnull + public final Builder docsCount(@Nullable String value) { + this.docsCount = value; + return this; + } - @Nullable - private String bulkAvgSizeInBytes; + /** + * deleted docs + *

+ * API name: {@code docs.deleted} + *

+ */ + @Nonnull + public final Builder docsDeleted(@Nullable String value) { + this.docsDeleted = value; + return this; + } - @Nullable - private String priBulkAvgSizeInBytes; + /** + * field data evictions + *

+ * API name: {@code fielddata.evictions} + *

+ */ + @Nonnull + public final Builder fielddataEvictions(@Nullable String value) { + this.fielddataEvictions = value; + return this; + } /** - * current health status + * used field data cache *

- * API name: {@code health} + * API name: {@code fielddata.memory_size} + *

*/ - public final Builder health(@Nullable String value) { - this.health = value; + @Nonnull + public final Builder fielddataMemorySize(@Nullable String value) { + this.fielddataMemorySize = value; return this; } /** - * open/close status + * number of flushes *

- * API name: {@code status} + * API name: {@code flush.total} + *

*/ - public final Builder status(@Nullable String value) { - this.status = value; + @Nonnull + public final Builder flushTotal(@Nullable String value) { + this.flushTotal = value; return this; } /** - * index name + * time spent in flush *

- * API name: {@code index} + * API name: {@code flush.total_time} + *

*/ - public final Builder index(@Nullable String value) { - this.index = value; + @Nonnull + public final Builder flushTotalTime(@Nullable String value) { + this.flushTotalTime = value; return this; } /** - * index uuid + * number of current get ops *

- * API name: {@code uuid} + * API name: {@code get.current} + *

*/ - public final Builder uuid(@Nullable String value) { - this.uuid = value; + @Nonnull + public final Builder getCurrent(@Nullable String value) { + this.getCurrent = value; return this; } /** - * number of primary shards + * time spent in successful gets *

- * API name: {@code pri} + * API name: {@code get.exists_time} + *

*/ - public final Builder pri(@Nullable String value) { - this.pri = value; + @Nonnull + public final Builder getExistsTime(@Nullable String value) { + this.getExistsTime = value; return this; } /** - * number of replica shards + * number of successful gets *

- * API name: {@code rep} + * API name: {@code get.exists_total} + *

*/ - public final Builder rep(@Nullable String value) { - this.rep = value; + @Nonnull + public final Builder getExistsTotal(@Nullable String value) { + this.getExistsTotal = value; return this; } /** - * available docs + * time spent in failed gets *

- * API name: {@code docs.count} + * API name: {@code get.missing_time} + *

*/ - public final Builder docsCount(@Nullable String value) { - this.docsCount = value; + @Nonnull + public final Builder getMissingTime(@Nullable String value) { + this.getMissingTime = value; return this; } /** - * deleted docs + * number of failed gets *

- * API name: {@code docs.deleted} + * API name: {@code get.missing_total} + *

*/ - public final Builder docsDeleted(@Nullable String value) { - this.docsDeleted = value; + @Nonnull + public final Builder getMissingTotal(@Nullable String value) { + this.getMissingTotal = value; return this; } /** - * index creation date (millisecond value) + * time spent in get *

- * API name: {@code creation.date} + * API name: {@code get.time} + *

*/ - public final Builder creationDate(@Nullable String value) { - this.creationDate = value; + @Nonnull + public final Builder getTime(@Nullable String value) { + this.getTime = value; return this; } /** - * index creation date (as string) + * number of get ops *

- * API name: {@code creation.date.string} + * API name: {@code get.total} + *

*/ - public final Builder creationDateString(@Nullable String value) { - this.creationDateString = value; + @Nonnull + public final Builder getTotal(@Nullable String value) { + this.getTotal = value; return this; } /** - * store size of primaries & replicas + * current health status *

- * API name: {@code store.size} + * API name: {@code health} + *

*/ - public final Builder storeSize(@Nullable String value) { - this.storeSize = value; + @Nonnull + public final Builder health(@Nullable String value) { + this.health = value; return this; } /** - * store size of primaries + * index name *

- * API name: {@code pri.store.size} + * API name: {@code index} + *

*/ - public final Builder priStoreSize(@Nullable String value) { - this.priStoreSize = value; + @Nonnull + public final Builder index(@Nullable String value) { + this.index = value; return this; } /** - * size of completion + * number of current deletions *

- * API name: {@code completion.size} + * API name: {@code indexing.delete_current} + *

*/ - public final Builder completionSize(@Nullable String value) { - this.completionSize = value; + @Nonnull + public final Builder indexingDeleteCurrent(@Nullable String value) { + this.indexingDeleteCurrent = value; return this; } /** - * size of completion + * time spent in deletions *

- * API name: {@code pri.completion.size} + * API name: {@code indexing.delete_time} + *

*/ - public final Builder priCompletionSize(@Nullable String value) { - this.priCompletionSize = value; + @Nonnull + public final Builder indexingDeleteTime(@Nullable String value) { + this.indexingDeleteTime = value; return this; } /** - * used fielddata cache + * number of delete ops *

- * API name: {@code fielddata.memory_size} + * API name: {@code indexing.delete_total} + *

*/ - public final Builder fielddataMemorySize(@Nullable String value) { - this.fielddataMemorySize = value; + @Nonnull + public final Builder indexingDeleteTotal(@Nullable String value) { + this.indexingDeleteTotal = value; return this; } /** - * used fielddata cache + * number of current indexing ops *

- * API name: {@code pri.fielddata.memory_size} + * API name: {@code indexing.index_current} + *

*/ - public final Builder priFielddataMemorySize(@Nullable String value) { - this.priFielddataMemorySize = value; + @Nonnull + public final Builder indexingIndexCurrent(@Nullable String value) { + this.indexingIndexCurrent = value; return this; } /** - * fielddata evictions + * number of failed indexing ops *

- * API name: {@code fielddata.evictions} + * API name: {@code indexing.index_failed} + *

*/ - public final Builder fielddataEvictions(@Nullable String value) { - this.fielddataEvictions = value; + @Nonnull + public final Builder indexingIndexFailed(@Nullable String value) { + this.indexingIndexFailed = value; return this; } /** - * fielddata evictions + * time spent in indexing *

- * API name: {@code pri.fielddata.evictions} + * API name: {@code indexing.index_time} + *

*/ - public final Builder priFielddataEvictions(@Nullable String value) { - this.priFielddataEvictions = value; + @Nonnull + public final Builder indexingIndexTime(@Nullable String value) { + this.indexingIndexTime = value; return this; } /** - * used query cache + * number of indexing ops *

- * API name: {@code query_cache.memory_size} + * API name: {@code indexing.index_total} + *

*/ - public final Builder queryCacheMemorySize(@Nullable String value) { - this.queryCacheMemorySize = value; + @Nonnull + public final Builder indexingIndexTotal(@Nullable String value) { + this.indexingIndexTotal = value; return this; } /** - * used query cache + * total used memory *

- * API name: {@code pri.query_cache.memory_size} + * API name: {@code memory.total} + *

*/ - public final Builder priQueryCacheMemorySize(@Nullable String value) { - this.priQueryCacheMemorySize = value; + @Nonnull + public final Builder memoryTotal(@Nullable String value) { + this.memoryTotal = value; return this; } /** - * query cache evictions + * number of current merges *

- * API name: {@code query_cache.evictions} + * API name: {@code merges.current} + *

*/ - public final Builder queryCacheEvictions(@Nullable String value) { - this.queryCacheEvictions = value; + @Nonnull + public final Builder mergesCurrent(@Nullable String value) { + this.mergesCurrent = value; return this; } /** - * query cache evictions + * number of current merging docs *

- * API name: {@code pri.query_cache.evictions} + * API name: {@code merges.current_docs} + *

*/ - public final Builder priQueryCacheEvictions(@Nullable String value) { - this.priQueryCacheEvictions = value; + @Nonnull + public final Builder mergesCurrentDocs(@Nullable String value) { + this.mergesCurrentDocs = value; return this; } /** - * used request cache + * size of current merges *

- * API name: {@code request_cache.memory_size} + * API name: {@code merges.current_size} + *

*/ - public final Builder requestCacheMemorySize(@Nullable String value) { - this.requestCacheMemorySize = value; + @Nonnull + public final Builder mergesCurrentSize(@Nullable String value) { + this.mergesCurrentSize = value; return this; } /** - * used request cache + * number of completed merge ops *

- * API name: {@code pri.request_cache.memory_size} + * API name: {@code merges.total} + *

*/ - public final Builder priRequestCacheMemorySize(@Nullable String value) { - this.priRequestCacheMemorySize = value; + @Nonnull + public final Builder mergesTotal(@Nullable String value) { + this.mergesTotal = value; return this; } /** - * request cache evictions + * docs merged *

- * API name: {@code request_cache.evictions} + * API name: {@code merges.total_docs} + *

*/ - public final Builder requestCacheEvictions(@Nullable String value) { - this.requestCacheEvictions = value; + @Nonnull + public final Builder mergesTotalDocs(@Nullable String value) { + this.mergesTotalDocs = value; return this; } /** - * request cache evictions + * size merged *

- * API name: {@code pri.request_cache.evictions} + * API name: {@code merges.total_size} + *

*/ - public final Builder priRequestCacheEvictions(@Nullable String value) { - this.priRequestCacheEvictions = value; + @Nonnull + public final Builder mergesTotalSize(@Nullable String value) { + this.mergesTotalSize = value; return this; } /** - * request cache hit count + * time spent in merges *

- * API name: {@code request_cache.hit_count} + * API name: {@code merges.total_time} + *

*/ - public final Builder requestCacheHitCount(@Nullable String value) { - this.requestCacheHitCount = value; + @Nonnull + public final Builder mergesTotalTime(@Nullable String value) { + this.mergesTotalTime = value; return this; } /** - * request cache hit count + * number of primary shards *

- * API name: {@code pri.request_cache.hit_count} + * API name: {@code pri} + *

*/ - public final Builder priRequestCacheHitCount(@Nullable String value) { - this.priRequestCacheHitCount = value; + @Nonnull + public final Builder pri(@Nullable String value) { + this.pri = value; return this; } /** - * request cache miss count + * size of completion *

- * API name: {@code request_cache.miss_count} + * API name: {@code pri.completion.size} + *

*/ - public final Builder requestCacheMissCount(@Nullable String value) { - this.requestCacheMissCount = value; + @Nonnull + public final Builder priCompletionSize(@Nullable String value) { + this.priCompletionSize = value; return this; } /** - * request cache miss count + * field data evictions *

- * API name: {@code pri.request_cache.miss_count} + * API name: {@code pri.fielddata.evictions} + *

*/ - public final Builder priRequestCacheMissCount(@Nullable String value) { - this.priRequestCacheMissCount = value; + @Nonnull + public final Builder priFielddataEvictions(@Nullable String value) { + this.priFielddataEvictions = value; return this; } /** - * number of flushes + * used field data cache *

- * API name: {@code flush.total} + * API name: {@code pri.fielddata.memory_size} + *

*/ - public final Builder flushTotal(@Nullable String value) { - this.flushTotal = value; + @Nonnull + public final Builder priFielddataMemorySize(@Nullable String value) { + this.priFielddataMemorySize = value; return this; } @@ -3498,1110 +3998,1265 @@ public final Builder flushTotal(@Nullable String value) { * number of flushes *

* API name: {@code pri.flush.total} + *

*/ + @Nonnull public final Builder priFlushTotal(@Nullable String value) { this.priFlushTotal = value; return this; } - /** - * time spent in flush - *

- * API name: {@code flush.total_time} - */ - public final Builder flushTotalTime(@Nullable String value) { - this.flushTotalTime = value; - return this; - } - /** * time spent in flush *

* API name: {@code pri.flush.total_time} + *

*/ + @Nonnull public final Builder priFlushTotalTime(@Nullable String value) { this.priFlushTotalTime = value; return this; } - /** - * number of current get ops - *

- * API name: {@code get.current} - */ - public final Builder getCurrent(@Nullable String value) { - this.getCurrent = value; - return this; - } - /** * number of current get ops *

* API name: {@code pri.get.current} + *

*/ + @Nonnull public final Builder priGetCurrent(@Nullable String value) { this.priGetCurrent = value; return this; } /** - * time spent in get + * time spent in successful gets *

- * API name: {@code get.time} + * API name: {@code pri.get.exists_time} + *

*/ - public final Builder getTime(@Nullable String value) { - this.getTime = value; + @Nonnull + public final Builder priGetExistsTime(@Nullable String value) { + this.priGetExistsTime = value; return this; } /** - * time spent in get + * number of successful gets *

- * API name: {@code pri.get.time} + * API name: {@code pri.get.exists_total} + *

*/ - public final Builder priGetTime(@Nullable String value) { - this.priGetTime = value; + @Nonnull + public final Builder priGetExistsTotal(@Nullable String value) { + this.priGetExistsTotal = value; return this; } /** - * number of get ops + * time spent in failed gets *

- * API name: {@code get.total} + * API name: {@code pri.get.missing_time} + *

*/ - public final Builder getTotal(@Nullable String value) { - this.getTotal = value; + @Nonnull + public final Builder priGetMissingTime(@Nullable String value) { + this.priGetMissingTime = value; return this; } /** - * number of get ops + * number of failed gets *

- * API name: {@code pri.get.total} + * API name: {@code pri.get.missing_total} + *

*/ - public final Builder priGetTotal(@Nullable String value) { - this.priGetTotal = value; + @Nonnull + public final Builder priGetMissingTotal(@Nullable String value) { + this.priGetMissingTotal = value; return this; } /** - * time spent in successful gets + * time spent in get *

- * API name: {@code get.exists_time} + * API name: {@code pri.get.time} + *

*/ - public final Builder getExistsTime(@Nullable String value) { - this.getExistsTime = value; + @Nonnull + public final Builder priGetTime(@Nullable String value) { + this.priGetTime = value; return this; } /** - * time spent in successful gets + * number of get ops *

- * API name: {@code pri.get.exists_time} + * API name: {@code pri.get.total} + *

*/ - public final Builder priGetExistsTime(@Nullable String value) { - this.priGetExistsTime = value; + @Nonnull + public final Builder priGetTotal(@Nullable String value) { + this.priGetTotal = value; return this; } /** - * number of successful gets + * number of current deletions *

- * API name: {@code get.exists_total} + * API name: {@code pri.indexing.delete_current} + *

*/ - public final Builder getExistsTotal(@Nullable String value) { - this.getExistsTotal = value; + @Nonnull + public final Builder priIndexingDeleteCurrent(@Nullable String value) { + this.priIndexingDeleteCurrent = value; return this; } /** - * number of successful gets + * time spent in deletions *

- * API name: {@code pri.get.exists_total} + * API name: {@code pri.indexing.delete_time} + *

*/ - public final Builder priGetExistsTotal(@Nullable String value) { - this.priGetExistsTotal = value; + @Nonnull + public final Builder priIndexingDeleteTime(@Nullable String value) { + this.priIndexingDeleteTime = value; return this; } /** - * time spent in failed gets + * number of delete ops *

- * API name: {@code get.missing_time} + * API name: {@code pri.indexing.delete_total} + *

*/ - public final Builder getMissingTime(@Nullable String value) { - this.getMissingTime = value; + @Nonnull + public final Builder priIndexingDeleteTotal(@Nullable String value) { + this.priIndexingDeleteTotal = value; return this; } /** - * time spent in failed gets + * number of current indexing ops *

- * API name: {@code pri.get.missing_time} + * API name: {@code pri.indexing.index_current} + *

*/ - public final Builder priGetMissingTime(@Nullable String value) { - this.priGetMissingTime = value; + @Nonnull + public final Builder priIndexingIndexCurrent(@Nullable String value) { + this.priIndexingIndexCurrent = value; return this; } /** - * number of failed gets + * number of failed indexing ops *

- * API name: {@code get.missing_total} + * API name: {@code pri.indexing.index_failed} + *

*/ - public final Builder getMissingTotal(@Nullable String value) { - this.getMissingTotal = value; + @Nonnull + public final Builder priIndexingIndexFailed(@Nullable String value) { + this.priIndexingIndexFailed = value; return this; } /** - * number of failed gets + * time spent in indexing *

- * API name: {@code pri.get.missing_total} + * API name: {@code pri.indexing.index_time} + *

*/ - public final Builder priGetMissingTotal(@Nullable String value) { - this.priGetMissingTotal = value; + @Nonnull + public final Builder priIndexingIndexTime(@Nullable String value) { + this.priIndexingIndexTime = value; return this; } /** - * number of current deletions + * number of indexing ops *

- * API name: {@code indexing.delete_current} + * API name: {@code pri.indexing.index_total} + *

*/ - public final Builder indexingDeleteCurrent(@Nullable String value) { - this.indexingDeleteCurrent = value; + @Nonnull + public final Builder priIndexingIndexTotal(@Nullable String value) { + this.priIndexingIndexTotal = value; return this; } /** - * number of current deletions + * total user memory *

- * API name: {@code pri.indexing.delete_current} + * API name: {@code pri.memory.total} + *

*/ - public final Builder priIndexingDeleteCurrent(@Nullable String value) { - this.priIndexingDeleteCurrent = value; + @Nonnull + public final Builder priMemoryTotal(@Nullable String value) { + this.priMemoryTotal = value; return this; } /** - * time spent in deletions + * number of current merges *

- * API name: {@code indexing.delete_time} + * API name: {@code pri.merges.current} + *

*/ - public final Builder indexingDeleteTime(@Nullable String value) { - this.indexingDeleteTime = value; + @Nonnull + public final Builder priMergesCurrent(@Nullable String value) { + this.priMergesCurrent = value; return this; } /** - * time spent in deletions + * number of current merging docs *

- * API name: {@code pri.indexing.delete_time} + * API name: {@code pri.merges.current_docs} + *

*/ - public final Builder priIndexingDeleteTime(@Nullable String value) { - this.priIndexingDeleteTime = value; + @Nonnull + public final Builder priMergesCurrentDocs(@Nullable String value) { + this.priMergesCurrentDocs = value; return this; } /** - * number of delete ops + * size of current merges *

- * API name: {@code indexing.delete_total} + * API name: {@code pri.merges.current_size} + *

*/ - public final Builder indexingDeleteTotal(@Nullable String value) { - this.indexingDeleteTotal = value; + @Nonnull + public final Builder priMergesCurrentSize(@Nullable String value) { + this.priMergesCurrentSize = value; return this; } /** - * number of delete ops + * number of completed merge ops *

- * API name: {@code pri.indexing.delete_total} + * API name: {@code pri.merges.total} + *

*/ - public final Builder priIndexingDeleteTotal(@Nullable String value) { - this.priIndexingDeleteTotal = value; + @Nonnull + public final Builder priMergesTotal(@Nullable String value) { + this.priMergesTotal = value; return this; } /** - * number of current indexing ops + * docs merged *

- * API name: {@code indexing.index_current} + * API name: {@code pri.merges.total_docs} + *

*/ - public final Builder indexingIndexCurrent(@Nullable String value) { - this.indexingIndexCurrent = value; + @Nonnull + public final Builder priMergesTotalDocs(@Nullable String value) { + this.priMergesTotalDocs = value; return this; } /** - * number of current indexing ops + * size merged *

- * API name: {@code pri.indexing.index_current} + * API name: {@code pri.merges.total_size} + *

*/ - public final Builder priIndexingIndexCurrent(@Nullable String value) { - this.priIndexingIndexCurrent = value; + @Nonnull + public final Builder priMergesTotalSize(@Nullable String value) { + this.priMergesTotalSize = value; return this; } /** - * time spent in indexing + * time spent in merges *

- * API name: {@code indexing.index_time} + * API name: {@code pri.merges.total_time} + *

*/ - public final Builder indexingIndexTime(@Nullable String value) { - this.indexingIndexTime = value; + @Nonnull + public final Builder priMergesTotalTime(@Nullable String value) { + this.priMergesTotalTime = value; return this; } /** - * time spent in indexing + * query cache evictions *

- * API name: {@code pri.indexing.index_time} + * API name: {@code pri.query_cache.evictions} + *

*/ - public final Builder priIndexingIndexTime(@Nullable String value) { - this.priIndexingIndexTime = value; + @Nonnull + public final Builder priQueryCacheEvictions(@Nullable String value) { + this.priQueryCacheEvictions = value; return this; } /** - * number of indexing ops + * used query cache *

- * API name: {@code indexing.index_total} + * API name: {@code pri.query_cache.memory_size} + *

*/ - public final Builder indexingIndexTotal(@Nullable String value) { - this.indexingIndexTotal = value; + @Nonnull + public final Builder priQueryCacheMemorySize(@Nullable String value) { + this.priQueryCacheMemorySize = value; return this; } /** - * number of indexing ops + * time spent in external refreshes *

- * API name: {@code pri.indexing.index_total} + * API name: {@code pri.refresh.external_time} + *

*/ - public final Builder priIndexingIndexTotal(@Nullable String value) { - this.priIndexingIndexTotal = value; + @Nonnull + public final Builder priRefreshExternalTime(@Nullable String value) { + this.priRefreshExternalTime = value; return this; } /** - * number of failed indexing ops + * total external refreshes *

- * API name: {@code indexing.index_failed} + * API name: {@code pri.refresh.external_total} + *

*/ - public final Builder indexingIndexFailed(@Nullable String value) { - this.indexingIndexFailed = value; + @Nonnull + public final Builder priRefreshExternalTotal(@Nullable String value) { + this.priRefreshExternalTotal = value; return this; } /** - * number of failed indexing ops + * number of pending refresh listeners *

- * API name: {@code pri.indexing.index_failed} + * API name: {@code pri.refresh.listeners} + *

*/ - public final Builder priIndexingIndexFailed(@Nullable String value) { - this.priIndexingIndexFailed = value; + @Nonnull + public final Builder priRefreshListeners(@Nullable String value) { + this.priRefreshListeners = value; return this; } /** - * number of current merges + * time spent in refreshes *

- * API name: {@code merges.current} + * API name: {@code pri.refresh.time} + *

*/ - public final Builder mergesCurrent(@Nullable String value) { - this.mergesCurrent = value; + @Nonnull + public final Builder priRefreshTime(@Nullable String value) { + this.priRefreshTime = value; return this; } /** - * number of current merges + * total refreshes *

- * API name: {@code pri.merges.current} + * API name: {@code pri.refresh.total} + *

*/ - public final Builder priMergesCurrent(@Nullable String value) { - this.priMergesCurrent = value; + @Nonnull + public final Builder priRefreshTotal(@Nullable String value) { + this.priRefreshTotal = value; return this; } /** - * number of current merging docs + * request cache evictions *

- * API name: {@code merges.current_docs} + * API name: {@code pri.request_cache.evictions} + *

*/ - public final Builder mergesCurrentDocs(@Nullable String value) { - this.mergesCurrentDocs = value; + @Nonnull + public final Builder priRequestCacheEvictions(@Nullable String value) { + this.priRequestCacheEvictions = value; return this; } /** - * number of current merging docs + * request cache hit count *

- * API name: {@code pri.merges.current_docs} + * API name: {@code pri.request_cache.hit_count} + *

*/ - public final Builder priMergesCurrentDocs(@Nullable String value) { - this.priMergesCurrentDocs = value; + @Nonnull + public final Builder priRequestCacheHitCount(@Nullable String value) { + this.priRequestCacheHitCount = value; return this; } /** - * size of current merges + * used request cache *

- * API name: {@code merges.current_size} + * API name: {@code pri.request_cache.memory_size} + *

*/ - public final Builder mergesCurrentSize(@Nullable String value) { - this.mergesCurrentSize = value; + @Nonnull + public final Builder priRequestCacheMemorySize(@Nullable String value) { + this.priRequestCacheMemorySize = value; return this; } /** - * size of current merges + * request cache miss count *

- * API name: {@code pri.merges.current_size} + * API name: {@code pri.request_cache.miss_count} + *

*/ - public final Builder priMergesCurrentSize(@Nullable String value) { - this.priMergesCurrentSize = value; + @Nonnull + public final Builder priRequestCacheMissCount(@Nullable String value) { + this.priRequestCacheMissCount = value; return this; } /** - * number of completed merge ops - *

- * API name: {@code merges.total} + * API name: {@code pri.search.concurrent_avg_slice_count} */ - public final Builder mergesTotal(@Nullable String value) { - this.mergesTotal = value; + @Nonnull + public final Builder priSearchConcurrentAvgSliceCount(@Nullable String value) { + this.priSearchConcurrentAvgSliceCount = value; return this; } /** - * number of completed merge ops - *

- * API name: {@code pri.merges.total} + * API name: {@code pri.search.concurrent_query_current} */ - public final Builder priMergesTotal(@Nullable String value) { - this.priMergesTotal = value; + @Nonnull + public final Builder priSearchConcurrentQueryCurrent(@Nullable String value) { + this.priSearchConcurrentQueryCurrent = value; return this; } /** - * docs merged - *

- * API name: {@code merges.total_docs} + * API name: {@code pri.search.concurrent_query_time} */ - public final Builder mergesTotalDocs(@Nullable String value) { - this.mergesTotalDocs = value; + @Nonnull + public final Builder priSearchConcurrentQueryTime(@Nullable String value) { + this.priSearchConcurrentQueryTime = value; return this; } /** - * docs merged - *

- * API name: {@code pri.merges.total_docs} + * API name: {@code pri.search.concurrent_query_total} */ - public final Builder priMergesTotalDocs(@Nullable String value) { - this.priMergesTotalDocs = value; + @Nonnull + public final Builder priSearchConcurrentQueryTotal(@Nullable String value) { + this.priSearchConcurrentQueryTotal = value; return this; } /** - * size merged + * current fetch phase ops *

- * API name: {@code merges.total_size} + * API name: {@code pri.search.fetch_current} + *

*/ - public final Builder mergesTotalSize(@Nullable String value) { - this.mergesTotalSize = value; + @Nonnull + public final Builder priSearchFetchCurrent(@Nullable String value) { + this.priSearchFetchCurrent = value; return this; } /** - * size merged + * time spent in fetch phase *

- * API name: {@code pri.merges.total_size} + * API name: {@code pri.search.fetch_time} + *

*/ - public final Builder priMergesTotalSize(@Nullable String value) { - this.priMergesTotalSize = value; + @Nonnull + public final Builder priSearchFetchTime(@Nullable String value) { + this.priSearchFetchTime = value; return this; } /** - * time spent in merges + * total fetch ops *

- * API name: {@code merges.total_time} + * API name: {@code pri.search.fetch_total} + *

*/ - public final Builder mergesTotalTime(@Nullable String value) { - this.mergesTotalTime = value; + @Nonnull + public final Builder priSearchFetchTotal(@Nullable String value) { + this.priSearchFetchTotal = value; return this; } /** - * time spent in merges + * open search contexts *

- * API name: {@code pri.merges.total_time} + * API name: {@code pri.search.open_contexts} + *

*/ - public final Builder priMergesTotalTime(@Nullable String value) { - this.priMergesTotalTime = value; + @Nonnull + public final Builder priSearchOpenContexts(@Nullable String value) { + this.priSearchOpenContexts = value; return this; } /** - * total refreshes - *

- * API name: {@code refresh.total} + * API name: {@code pri.search.point_in_time_current} */ - public final Builder refreshTotal(@Nullable String value) { - this.refreshTotal = value; + @Nonnull + public final Builder priSearchPointInTimeCurrent(@Nullable String value) { + this.priSearchPointInTimeCurrent = value; return this; } /** - * total refreshes - *

- * API name: {@code pri.refresh.total} + * API name: {@code pri.search.point_in_time_time} */ - public final Builder priRefreshTotal(@Nullable String value) { - this.priRefreshTotal = value; + @Nonnull + public final Builder priSearchPointInTimeTime(@Nullable String value) { + this.priSearchPointInTimeTime = value; return this; } /** - * time spent in refreshes - *

- * API name: {@code refresh.time} + * API name: {@code pri.search.point_in_time_total} */ - public final Builder refreshTime(@Nullable String value) { - this.refreshTime = value; + @Nonnull + public final Builder priSearchPointInTimeTotal(@Nullable String value) { + this.priSearchPointInTimeTotal = value; return this; } /** - * time spent in refreshes + * current query phase ops *

- * API name: {@code pri.refresh.time} + * API name: {@code pri.search.query_current} + *

*/ - public final Builder priRefreshTime(@Nullable String value) { - this.priRefreshTime = value; + @Nonnull + public final Builder priSearchQueryCurrent(@Nullable String value) { + this.priSearchQueryCurrent = value; return this; } /** - * total external refreshes + * time spent in query phase *

- * API name: {@code refresh.external_total} + * API name: {@code pri.search.query_time} + *

*/ - public final Builder refreshExternalTotal(@Nullable String value) { - this.refreshExternalTotal = value; + @Nonnull + public final Builder priSearchQueryTime(@Nullable String value) { + this.priSearchQueryTime = value; return this; } /** - * total external refreshes + * total query phase ops *

- * API name: {@code pri.refresh.external_total} + * API name: {@code pri.search.query_total} + *

*/ - public final Builder priRefreshExternalTotal(@Nullable String value) { - this.priRefreshExternalTotal = value; + @Nonnull + public final Builder priSearchQueryTotal(@Nullable String value) { + this.priSearchQueryTotal = value; return this; } /** - * time spent in external refreshes + * open scroll contexts *

- * API name: {@code refresh.external_time} + * API name: {@code pri.search.scroll_current} + *

*/ - public final Builder refreshExternalTime(@Nullable String value) { - this.refreshExternalTime = value; + @Nonnull + public final Builder priSearchScrollCurrent(@Nullable String value) { + this.priSearchScrollCurrent = value; return this; } /** - * time spent in external refreshes + * time scroll contexts held open *

- * API name: {@code pri.refresh.external_time} + * API name: {@code pri.search.scroll_time} + *

*/ - public final Builder priRefreshExternalTime(@Nullable String value) { - this.priRefreshExternalTime = value; + @Nonnull + public final Builder priSearchScrollTime(@Nullable String value) { + this.priSearchScrollTime = value; return this; } /** - * number of pending refresh listeners + * completed scroll contexts *

- * API name: {@code refresh.listeners} + * API name: {@code pri.search.scroll_total} + *

*/ - public final Builder refreshListeners(@Nullable String value) { - this.refreshListeners = value; + @Nonnull + public final Builder priSearchScrollTotal(@Nullable String value) { + this.priSearchScrollTotal = value; return this; } /** - * number of pending refresh listeners + * number of segments *

- * API name: {@code pri.refresh.listeners} + * API name: {@code pri.segments.count} + *

*/ - public final Builder priRefreshListeners(@Nullable String value) { - this.priRefreshListeners = value; + @Nonnull + public final Builder priSegmentsCount(@Nullable String value) { + this.priSegmentsCount = value; return this; } /** - * current fetch phase ops + * memory used by fixed bit sets for nested object field types and export type filters for types referred in _parent + * fields *

- * API name: {@code search.fetch_current} + * API name: {@code pri.segments.fixed_bitset_memory} + *

*/ - public final Builder searchFetchCurrent(@Nullable String value) { - this.searchFetchCurrent = value; + @Nonnull + public final Builder priSegmentsFixedBitsetMemory(@Nullable String value) { + this.priSegmentsFixedBitsetMemory = value; return this; } /** - * current fetch phase ops + * memory used by index writer *

- * API name: {@code pri.search.fetch_current} + * API name: {@code pri.segments.index_writer_memory} + *

*/ - public final Builder priSearchFetchCurrent(@Nullable String value) { - this.priSearchFetchCurrent = value; + @Nonnull + public final Builder priSegmentsIndexWriterMemory(@Nullable String value) { + this.priSegmentsIndexWriterMemory = value; return this; } /** - * time spent in fetch phase + * memory used by segments *

- * API name: {@code search.fetch_time} + * API name: {@code pri.segments.memory} + *

*/ - public final Builder searchFetchTime(@Nullable String value) { - this.searchFetchTime = value; + @Nonnull + public final Builder priSegmentsMemory(@Nullable String value) { + this.priSegmentsMemory = value; return this; } /** - * time spent in fetch phase + * memory used by version map *

- * API name: {@code pri.search.fetch_time} + * API name: {@code pri.segments.version_map_memory} + *

*/ - public final Builder priSearchFetchTime(@Nullable String value) { - this.priSearchFetchTime = value; + @Nonnull + public final Builder priSegmentsVersionMapMemory(@Nullable String value) { + this.priSegmentsVersionMapMemory = value; return this; } /** - * total fetch ops + * store size of primaries *

- * API name: {@code search.fetch_total} + * API name: {@code pri.store.size} + *

*/ - public final Builder searchFetchTotal(@Nullable String value) { - this.searchFetchTotal = value; + @Nonnull + public final Builder priStoreSize(@Nullable String value) { + this.priStoreSize = value; return this; } /** - * total fetch ops + * number of current suggest ops *

- * API name: {@code pri.search.fetch_total} + * API name: {@code pri.suggest.current} + *

*/ - public final Builder priSearchFetchTotal(@Nullable String value) { - this.priSearchFetchTotal = value; + @Nonnull + public final Builder priSuggestCurrent(@Nullable String value) { + this.priSuggestCurrent = value; return this; } /** - * open search contexts + * time spend in suggest *

- * API name: {@code search.open_contexts} + * API name: {@code pri.suggest.time} + *

*/ - public final Builder searchOpenContexts(@Nullable String value) { - this.searchOpenContexts = value; + @Nonnull + public final Builder priSuggestTime(@Nullable String value) { + this.priSuggestTime = value; return this; } /** - * open search contexts + * number of suggest ops *

- * API name: {@code pri.search.open_contexts} + * API name: {@code pri.suggest.total} + *

*/ - public final Builder priSearchOpenContexts(@Nullable String value) { - this.priSearchOpenContexts = value; + @Nonnull + public final Builder priSuggestTotal(@Nullable String value) { + this.priSuggestTotal = value; return this; } /** - * current query phase ops + * current warmer ops *

- * API name: {@code search.query_current} + * API name: {@code pri.warmer.current} + *

*/ - public final Builder searchQueryCurrent(@Nullable String value) { - this.searchQueryCurrent = value; + @Nonnull + public final Builder priWarmerCurrent(@Nullable String value) { + this.priWarmerCurrent = value; return this; } /** - * current query phase ops + * total warmer ops *

- * API name: {@code pri.search.query_current} + * API name: {@code pri.warmer.total} + *

*/ - public final Builder priSearchQueryCurrent(@Nullable String value) { - this.priSearchQueryCurrent = value; + @Nonnull + public final Builder priWarmerTotal(@Nullable String value) { + this.priWarmerTotal = value; return this; } /** - * time spent in query phase + * time spent in warmers *

- * API name: {@code search.query_time} + * API name: {@code pri.warmer.total_time} + *

*/ - public final Builder searchQueryTime(@Nullable String value) { - this.searchQueryTime = value; + @Nonnull + public final Builder priWarmerTotalTime(@Nullable String value) { + this.priWarmerTotalTime = value; return this; } /** - * time spent in query phase + * query cache evictions *

- * API name: {@code pri.search.query_time} + * API name: {@code query_cache.evictions} + *

*/ - public final Builder priSearchQueryTime(@Nullable String value) { - this.priSearchQueryTime = value; + @Nonnull + public final Builder queryCacheEvictions(@Nullable String value) { + this.queryCacheEvictions = value; return this; } /** - * total query phase ops + * used query cache *

- * API name: {@code search.query_total} + * API name: {@code query_cache.memory_size} + *

*/ - public final Builder searchQueryTotal(@Nullable String value) { - this.searchQueryTotal = value; + @Nonnull + public final Builder queryCacheMemorySize(@Nullable String value) { + this.queryCacheMemorySize = value; return this; } /** - * total query phase ops + * time spent in external refreshes *

- * API name: {@code pri.search.query_total} + * API name: {@code refresh.external_time} + *

*/ - public final Builder priSearchQueryTotal(@Nullable String value) { - this.priSearchQueryTotal = value; + @Nonnull + public final Builder refreshExternalTime(@Nullable String value) { + this.refreshExternalTime = value; return this; } /** - * open scroll contexts + * total external refreshes *

- * API name: {@code search.scroll_current} + * API name: {@code refresh.external_total} + *

*/ - public final Builder searchScrollCurrent(@Nullable String value) { - this.searchScrollCurrent = value; + @Nonnull + public final Builder refreshExternalTotal(@Nullable String value) { + this.refreshExternalTotal = value; return this; } /** - * open scroll contexts + * number of pending refresh listeners *

- * API name: {@code pri.search.scroll_current} + * API name: {@code refresh.listeners} + *

*/ - public final Builder priSearchScrollCurrent(@Nullable String value) { - this.priSearchScrollCurrent = value; + @Nonnull + public final Builder refreshListeners(@Nullable String value) { + this.refreshListeners = value; return this; } /** - * time scroll contexts held open + * time spent in refreshes *

- * API name: {@code search.scroll_time} + * API name: {@code refresh.time} + *

*/ - public final Builder searchScrollTime(@Nullable String value) { - this.searchScrollTime = value; + @Nonnull + public final Builder refreshTime(@Nullable String value) { + this.refreshTime = value; return this; } /** - * time scroll contexts held open + * total refreshes *

- * API name: {@code pri.search.scroll_time} + * API name: {@code refresh.total} + *

*/ - public final Builder priSearchScrollTime(@Nullable String value) { - this.priSearchScrollTime = value; + @Nonnull + public final Builder refreshTotal(@Nullable String value) { + this.refreshTotal = value; return this; } /** - * completed scroll contexts + * number of replica shards *

- * API name: {@code search.scroll_total} + * API name: {@code rep} + *

*/ - public final Builder searchScrollTotal(@Nullable String value) { - this.searchScrollTotal = value; + @Nonnull + public final Builder rep(@Nullable String value) { + this.rep = value; return this; } /** - * completed scroll contexts + * request cache evictions *

- * API name: {@code pri.search.scroll_total} + * API name: {@code request_cache.evictions} + *

*/ - public final Builder priSearchScrollTotal(@Nullable String value) { - this.priSearchScrollTotal = value; + @Nonnull + public final Builder requestCacheEvictions(@Nullable String value) { + this.requestCacheEvictions = value; return this; } /** - * number of segments + * request cache hit count *

- * API name: {@code segments.count} + * API name: {@code request_cache.hit_count} + *

*/ - public final Builder segmentsCount(@Nullable String value) { - this.segmentsCount = value; + @Nonnull + public final Builder requestCacheHitCount(@Nullable String value) { + this.requestCacheHitCount = value; return this; } /** - * number of segments + * used request cache *

- * API name: {@code pri.segments.count} + * API name: {@code request_cache.memory_size} + *

*/ - public final Builder priSegmentsCount(@Nullable String value) { - this.priSegmentsCount = value; + @Nonnull + public final Builder requestCacheMemorySize(@Nullable String value) { + this.requestCacheMemorySize = value; return this; } /** - * memory used by segments + * request cache miss count *

- * API name: {@code segments.memory} + * API name: {@code request_cache.miss_count} + *

*/ - public final Builder segmentsMemory(@Nullable String value) { - this.segmentsMemory = value; + @Nonnull + public final Builder requestCacheMissCount(@Nullable String value) { + this.requestCacheMissCount = value; return this; } /** - * memory used by segments - *

- * API name: {@code pri.segments.memory} + * API name: {@code search.concurrent_avg_slice_count} */ - public final Builder priSegmentsMemory(@Nullable String value) { - this.priSegmentsMemory = value; + @Nonnull + public final Builder searchConcurrentAvgSliceCount(@Nullable String value) { + this.searchConcurrentAvgSliceCount = value; return this; } /** - * memory used by index writer - *

- * API name: {@code segments.index_writer_memory} + * API name: {@code search.concurrent_query_current} */ - public final Builder segmentsIndexWriterMemory(@Nullable String value) { - this.segmentsIndexWriterMemory = value; + @Nonnull + public final Builder searchConcurrentQueryCurrent(@Nullable String value) { + this.searchConcurrentQueryCurrent = value; return this; } /** - * memory used by index writer - *

- * API name: {@code pri.segments.index_writer_memory} + * API name: {@code search.concurrent_query_time} */ - public final Builder priSegmentsIndexWriterMemory(@Nullable String value) { - this.priSegmentsIndexWriterMemory = value; + @Nonnull + public final Builder searchConcurrentQueryTime(@Nullable String value) { + this.searchConcurrentQueryTime = value; return this; } /** - * memory used by version map - *

- * API name: {@code segments.version_map_memory} + * API name: {@code search.concurrent_query_total} */ - public final Builder segmentsVersionMapMemory(@Nullable String value) { - this.segmentsVersionMapMemory = value; + @Nonnull + public final Builder searchConcurrentQueryTotal(@Nullable String value) { + this.searchConcurrentQueryTotal = value; return this; } /** - * memory used by version map + * current fetch phase ops *

- * API name: {@code pri.segments.version_map_memory} + * API name: {@code search.fetch_current} + *

*/ - public final Builder priSegmentsVersionMapMemory(@Nullable String value) { - this.priSegmentsVersionMapMemory = value; + @Nonnull + public final Builder searchFetchCurrent(@Nullable String value) { + this.searchFetchCurrent = value; return this; } /** - * memory used by fixed bit sets for nested object field types and export type - * filters for types referred in _parent fields + * time spent in fetch phase *

- * API name: {@code segments.fixed_bitset_memory} + * API name: {@code search.fetch_time} + *

*/ - public final Builder segmentsFixedBitsetMemory(@Nullable String value) { - this.segmentsFixedBitsetMemory = value; + @Nonnull + public final Builder searchFetchTime(@Nullable String value) { + this.searchFetchTime = value; return this; } /** - * memory used by fixed bit sets for nested object field types and export type - * filters for types referred in _parent fields + * total fetch ops *

- * API name: {@code pri.segments.fixed_bitset_memory} + * API name: {@code search.fetch_total} + *

*/ - public final Builder priSegmentsFixedBitsetMemory(@Nullable String value) { - this.priSegmentsFixedBitsetMemory = value; + @Nonnull + public final Builder searchFetchTotal(@Nullable String value) { + this.searchFetchTotal = value; return this; } /** - * current warmer ops + * open search contexts *

- * API name: {@code warmer.current} + * API name: {@code search.open_contexts} + *

*/ - public final Builder warmerCurrent(@Nullable String value) { - this.warmerCurrent = value; + @Nonnull + public final Builder searchOpenContexts(@Nullable String value) { + this.searchOpenContexts = value; return this; } /** - * current warmer ops - *

- * API name: {@code pri.warmer.current} + * API name: {@code search.point_in_time_current} */ - public final Builder priWarmerCurrent(@Nullable String value) { - this.priWarmerCurrent = value; + @Nonnull + public final Builder searchPointInTimeCurrent(@Nullable String value) { + this.searchPointInTimeCurrent = value; return this; } /** - * total warmer ops - *

- * API name: {@code warmer.total} + * API name: {@code search.point_in_time_time} */ - public final Builder warmerTotal(@Nullable String value) { - this.warmerTotal = value; + @Nonnull + public final Builder searchPointInTimeTime(@Nullable String value) { + this.searchPointInTimeTime = value; return this; } /** - * total warmer ops - *

- * API name: {@code pri.warmer.total} + * API name: {@code search.point_in_time_total} */ - public final Builder priWarmerTotal(@Nullable String value) { - this.priWarmerTotal = value; + @Nonnull + public final Builder searchPointInTimeTotal(@Nullable String value) { + this.searchPointInTimeTotal = value; return this; } /** - * time spent in warmers + * current query phase ops *

- * API name: {@code warmer.total_time} + * API name: {@code search.query_current} + *

*/ - public final Builder warmerTotalTime(@Nullable String value) { - this.warmerTotalTime = value; + @Nonnull + public final Builder searchQueryCurrent(@Nullable String value) { + this.searchQueryCurrent = value; return this; } /** - * time spent in warmers + * time spent in query phase *

- * API name: {@code pri.warmer.total_time} + * API name: {@code search.query_time} + *

*/ - public final Builder priWarmerTotalTime(@Nullable String value) { - this.priWarmerTotalTime = value; + @Nonnull + public final Builder searchQueryTime(@Nullable String value) { + this.searchQueryTime = value; return this; } /** - * number of current suggest ops + * total query phase ops *

- * API name: {@code suggest.current} + * API name: {@code search.query_total} + *

*/ - public final Builder suggestCurrent(@Nullable String value) { - this.suggestCurrent = value; + @Nonnull + public final Builder searchQueryTotal(@Nullable String value) { + this.searchQueryTotal = value; return this; } /** - * number of current suggest ops + * open scroll contexts *

- * API name: {@code pri.suggest.current} + * API name: {@code search.scroll_current} + *

*/ - public final Builder priSuggestCurrent(@Nullable String value) { - this.priSuggestCurrent = value; + @Nonnull + public final Builder searchScrollCurrent(@Nullable String value) { + this.searchScrollCurrent = value; return this; } /** - * time spend in suggest + * time scroll contexts held open *

- * API name: {@code suggest.time} + * API name: {@code search.scroll_time} + *

*/ - public final Builder suggestTime(@Nullable String value) { - this.suggestTime = value; + @Nonnull + public final Builder searchScrollTime(@Nullable String value) { + this.searchScrollTime = value; return this; } /** - * time spend in suggest + * completed scroll contexts *

- * API name: {@code pri.suggest.time} + * API name: {@code search.scroll_total} + *

*/ - public final Builder priSuggestTime(@Nullable String value) { - this.priSuggestTime = value; + @Nonnull + public final Builder searchScrollTotal(@Nullable String value) { + this.searchScrollTotal = value; return this; } /** - * number of suggest ops + * indicates if the index is search throttled *

- * API name: {@code suggest.total} + * API name: {@code search.throttled} + *

*/ - public final Builder suggestTotal(@Nullable String value) { - this.suggestTotal = value; + @Nonnull + public final Builder searchThrottled(@Nullable String value) { + this.searchThrottled = value; return this; } /** - * number of suggest ops + * number of segments *

- * API name: {@code pri.suggest.total} + * API name: {@code segments.count} + *

*/ - public final Builder priSuggestTotal(@Nullable String value) { - this.priSuggestTotal = value; + @Nonnull + public final Builder segmentsCount(@Nullable String value) { + this.segmentsCount = value; return this; } /** - * total used memory + * memory used by fixed bit sets for nested object field types and export type filters for types referred in _parent + * fields *

- * API name: {@code memory.total} + * API name: {@code segments.fixed_bitset_memory} + *

*/ - public final Builder memoryTotal(@Nullable String value) { - this.memoryTotal = value; + @Nonnull + public final Builder segmentsFixedBitsetMemory(@Nullable String value) { + this.segmentsFixedBitsetMemory = value; return this; } /** - * total user memory + * memory used by index writer *

- * API name: {@code pri.memory.total} + * API name: {@code segments.index_writer_memory} + *

*/ - public final Builder priMemoryTotal(@Nullable String value) { - this.priMemoryTotal = value; + @Nonnull + public final Builder segmentsIndexWriterMemory(@Nullable String value) { + this.segmentsIndexWriterMemory = value; return this; } /** - * indicates if the index is search throttled + * memory used by segments *

- * API name: {@code search.throttled} + * API name: {@code segments.memory} + *

*/ - public final Builder searchThrottled(@Nullable String value) { - this.searchThrottled = value; + @Nonnull + public final Builder segmentsMemory(@Nullable String value) { + this.segmentsMemory = value; return this; } /** - * number of bulk shard ops + * memory used by version map *

- * API name: {@code bulk.total_operations} + * API name: {@code segments.version_map_memory} + *

*/ - public final Builder bulkTotalOperations(@Nullable String value) { - this.bulkTotalOperations = value; + @Nonnull + public final Builder segmentsVersionMapMemory(@Nullable String value) { + this.segmentsVersionMapMemory = value; return this; } /** - * number of bulk shard ops + * open/close status *

- * API name: {@code pri.bulk.total_operations} + * API name: {@code status} + *

*/ - public final Builder priBulkTotalOperations(@Nullable String value) { - this.priBulkTotalOperations = value; + @Nonnull + public final Builder status(@Nullable String value) { + this.status = value; return this; } /** - * time spend in shard bulk + * store size of primaries and replicas *

- * API name: {@code bulk.total_time} + * API name: {@code store.size} + *

*/ - public final Builder bulkTotalTime(@Nullable String value) { - this.bulkTotalTime = value; + @Nonnull + public final Builder storeSize(@Nullable String value) { + this.storeSize = value; return this; } /** - * time spend in shard bulk + * number of current suggest ops *

- * API name: {@code pri.bulk.total_time} + * API name: {@code suggest.current} + *

*/ - public final Builder priBulkTotalTime(@Nullable String value) { - this.priBulkTotalTime = value; + @Nonnull + public final Builder suggestCurrent(@Nullable String value) { + this.suggestCurrent = value; return this; } /** - * total size in bytes of shard bulk + * time spend in suggest *

- * API name: {@code bulk.total_size_in_bytes} + * API name: {@code suggest.time} + *

*/ - public final Builder bulkTotalSizeInBytes(@Nullable String value) { - this.bulkTotalSizeInBytes = value; + @Nonnull + public final Builder suggestTime(@Nullable String value) { + this.suggestTime = value; return this; } /** - * total size in bytes of shard bulk + * number of suggest ops *

- * API name: {@code pri.bulk.total_size_in_bytes} + * API name: {@code suggest.total} + *

*/ - public final Builder priBulkTotalSizeInBytes(@Nullable String value) { - this.priBulkTotalSizeInBytes = value; + @Nonnull + public final Builder suggestTotal(@Nullable String value) { + this.suggestTotal = value; return this; } /** - * average time spend in shard bulk + * index UUID *

- * API name: {@code bulk.avg_time} + * API name: {@code uuid} + *

*/ - public final Builder bulkAvgTime(@Nullable String value) { - this.bulkAvgTime = value; + @Nonnull + public final Builder uuid(@Nullable String value) { + this.uuid = value; return this; } /** - * average time spend in shard bulk + * current warmer ops *

- * API name: {@code pri.bulk.avg_time} + * API name: {@code warmer.current} + *

*/ - public final Builder priBulkAvgTime(@Nullable String value) { - this.priBulkAvgTime = value; + @Nonnull + public final Builder warmerCurrent(@Nullable String value) { + this.warmerCurrent = value; return this; } /** - * average size in bytes of shard bulk + * total warmer ops *

- * API name: {@code bulk.avg_size_in_bytes} + * API name: {@code warmer.total} + *

*/ - public final Builder bulkAvgSizeInBytes(@Nullable String value) { - this.bulkAvgSizeInBytes = value; + @Nonnull + public final Builder warmerTotal(@Nullable String value) { + this.warmerTotal = value; return this; } /** - * average size in bytes of shard bulk + * time spent in warmers *

- * API name: {@code pri.bulk.avg_size_in_bytes} + * API name: {@code warmer.total_time} + *

*/ - public final Builder priBulkAvgSizeInBytes(@Nullable String value) { - this.priBulkAvgSizeInBytes = value; + @Nonnull + public final Builder warmerTotalTime(@Nullable String value) { + this.warmerTotalTime = value; return this; } /** * Builds a {@link IndicesRecord}. * - * @throws NullPointerException - * if some of the required fields are null. + * @throws NullPointerException if some of the required fields are null. */ + @Override + @Nonnull public IndicesRecord build() { _checkSingleUse(); @@ -4620,215 +5275,453 @@ public IndicesRecord build() { ); protected static void setupIndicesRecordDeserializer(ObjectDeserializer op) { - - op.add(Builder::health, JsonpDeserializer.stringDeserializer(), "health", "h"); - op.add(Builder::status, JsonpDeserializer.stringDeserializer(), "status", "s"); - op.add(Builder::index, JsonpDeserializer.stringDeserializer(), "index", "i", "idx"); - op.add(Builder::uuid, JsonpDeserializer.stringDeserializer(), "uuid", "id"); - op.add(Builder::pri, JsonpDeserializer.stringDeserializer(), "pri", "p", "shards.primary", "shardsPrimary"); - op.add(Builder::rep, JsonpDeserializer.stringDeserializer(), "rep", "r", "shards.replica", "shardsReplica"); - op.add(Builder::docsCount, JsonpDeserializer.stringDeserializer(), "docs.count", "dc", "docsCount"); - op.add(Builder::docsDeleted, JsonpDeserializer.stringDeserializer(), "docs.deleted", "dd", "docsDeleted"); - op.add(Builder::creationDate, JsonpDeserializer.stringDeserializer(), "creation.date", "cd"); - op.add(Builder::creationDateString, JsonpDeserializer.stringDeserializer(), "creation.date.string", "cds"); - op.add(Builder::storeSize, JsonpDeserializer.stringDeserializer(), "store.size", "ss", "storeSize"); - op.add(Builder::priStoreSize, JsonpDeserializer.stringDeserializer(), "pri.store.size"); - op.add(Builder::completionSize, JsonpDeserializer.stringDeserializer(), "completion.size", "cs", "completionSize"); + op.add(Builder::completionSize, JsonpDeserializer.stringDeserializer(), "completion.size"); + op.add(Builder::creationDate, JsonpDeserializer.stringDeserializer(), "creation.date"); + op.add(Builder::creationDateString, JsonpDeserializer.stringDeserializer(), "creation.date.string"); + op.add(Builder::docsCount, JsonpDeserializer.stringDeserializer(), "docs.count"); + op.add(Builder::docsDeleted, JsonpDeserializer.stringDeserializer(), "docs.deleted"); + op.add(Builder::fielddataEvictions, JsonpDeserializer.stringDeserializer(), "fielddata.evictions"); + op.add(Builder::fielddataMemorySize, JsonpDeserializer.stringDeserializer(), "fielddata.memory_size"); + op.add(Builder::flushTotal, JsonpDeserializer.stringDeserializer(), "flush.total"); + op.add(Builder::flushTotalTime, JsonpDeserializer.stringDeserializer(), "flush.total_time"); + op.add(Builder::getCurrent, JsonpDeserializer.stringDeserializer(), "get.current"); + op.add(Builder::getExistsTime, JsonpDeserializer.stringDeserializer(), "get.exists_time"); + op.add(Builder::getExistsTotal, JsonpDeserializer.stringDeserializer(), "get.exists_total"); + op.add(Builder::getMissingTime, JsonpDeserializer.stringDeserializer(), "get.missing_time"); + op.add(Builder::getMissingTotal, JsonpDeserializer.stringDeserializer(), "get.missing_total"); + op.add(Builder::getTime, JsonpDeserializer.stringDeserializer(), "get.time"); + op.add(Builder::getTotal, JsonpDeserializer.stringDeserializer(), "get.total"); + op.add(Builder::health, JsonpDeserializer.stringDeserializer(), "health"); + op.add(Builder::index, JsonpDeserializer.stringDeserializer(), "index"); + op.add(Builder::indexingDeleteCurrent, JsonpDeserializer.stringDeserializer(), "indexing.delete_current"); + op.add(Builder::indexingDeleteTime, JsonpDeserializer.stringDeserializer(), "indexing.delete_time"); + op.add(Builder::indexingDeleteTotal, JsonpDeserializer.stringDeserializer(), "indexing.delete_total"); + op.add(Builder::indexingIndexCurrent, JsonpDeserializer.stringDeserializer(), "indexing.index_current"); + op.add(Builder::indexingIndexFailed, JsonpDeserializer.stringDeserializer(), "indexing.index_failed"); + op.add(Builder::indexingIndexTime, JsonpDeserializer.stringDeserializer(), "indexing.index_time"); + op.add(Builder::indexingIndexTotal, JsonpDeserializer.stringDeserializer(), "indexing.index_total"); + op.add(Builder::memoryTotal, JsonpDeserializer.stringDeserializer(), "memory.total"); + op.add(Builder::mergesCurrent, JsonpDeserializer.stringDeserializer(), "merges.current"); + op.add(Builder::mergesCurrentDocs, JsonpDeserializer.stringDeserializer(), "merges.current_docs"); + op.add(Builder::mergesCurrentSize, JsonpDeserializer.stringDeserializer(), "merges.current_size"); + op.add(Builder::mergesTotal, JsonpDeserializer.stringDeserializer(), "merges.total"); + op.add(Builder::mergesTotalDocs, JsonpDeserializer.stringDeserializer(), "merges.total_docs"); + op.add(Builder::mergesTotalSize, JsonpDeserializer.stringDeserializer(), "merges.total_size"); + op.add(Builder::mergesTotalTime, JsonpDeserializer.stringDeserializer(), "merges.total_time"); + op.add(Builder::pri, JsonpDeserializer.stringDeserializer(), "pri"); op.add(Builder::priCompletionSize, JsonpDeserializer.stringDeserializer(), "pri.completion.size"); - op.add(Builder::fielddataMemorySize, JsonpDeserializer.stringDeserializer(), "fielddata.memory_size", "fm", "fielddataMemory"); - op.add(Builder::priFielddataMemorySize, JsonpDeserializer.stringDeserializer(), "pri.fielddata.memory_size"); - op.add(Builder::fielddataEvictions, JsonpDeserializer.stringDeserializer(), "fielddata.evictions", "fe", "fielddataEvictions"); op.add(Builder::priFielddataEvictions, JsonpDeserializer.stringDeserializer(), "pri.fielddata.evictions"); - op.add(Builder::queryCacheMemorySize, JsonpDeserializer.stringDeserializer(), "query_cache.memory_size", "qcm", "queryCacheMemory"); - op.add(Builder::priQueryCacheMemorySize, JsonpDeserializer.stringDeserializer(), "pri.query_cache.memory_size"); - op.add(Builder::queryCacheEvictions, JsonpDeserializer.stringDeserializer(), "query_cache.evictions", "qce", "queryCacheEvictions"); - op.add(Builder::priQueryCacheEvictions, JsonpDeserializer.stringDeserializer(), "pri.query_cache.evictions"); - op.add( - Builder::requestCacheMemorySize, - JsonpDeserializer.stringDeserializer(), - "request_cache.memory_size", - "rcm", - "requestCacheMemory" - ); - op.add(Builder::priRequestCacheMemorySize, JsonpDeserializer.stringDeserializer(), "pri.request_cache.memory_size"); - op.add( - Builder::requestCacheEvictions, - JsonpDeserializer.stringDeserializer(), - "request_cache.evictions", - "rce", - "requestCacheEvictions" - ); - op.add(Builder::priRequestCacheEvictions, JsonpDeserializer.stringDeserializer(), "pri.request_cache.evictions"); - op.add( - Builder::requestCacheHitCount, - JsonpDeserializer.stringDeserializer(), - "request_cache.hit_count", - "rchc", - "requestCacheHitCount" - ); - op.add(Builder::priRequestCacheHitCount, JsonpDeserializer.stringDeserializer(), "pri.request_cache.hit_count"); - op.add( - Builder::requestCacheMissCount, - JsonpDeserializer.stringDeserializer(), - "request_cache.miss_count", - "rcmc", - "requestCacheMissCount" - ); - op.add(Builder::priRequestCacheMissCount, JsonpDeserializer.stringDeserializer(), "pri.request_cache.miss_count"); - op.add(Builder::flushTotal, JsonpDeserializer.stringDeserializer(), "flush.total", "ft", "flushTotal"); + op.add(Builder::priFielddataMemorySize, JsonpDeserializer.stringDeserializer(), "pri.fielddata.memory_size"); op.add(Builder::priFlushTotal, JsonpDeserializer.stringDeserializer(), "pri.flush.total"); - op.add(Builder::flushTotalTime, JsonpDeserializer.stringDeserializer(), "flush.total_time", "ftt", "flushTotalTime"); op.add(Builder::priFlushTotalTime, JsonpDeserializer.stringDeserializer(), "pri.flush.total_time"); - op.add(Builder::getCurrent, JsonpDeserializer.stringDeserializer(), "get.current", "gc", "getCurrent"); op.add(Builder::priGetCurrent, JsonpDeserializer.stringDeserializer(), "pri.get.current"); - op.add(Builder::getTime, JsonpDeserializer.stringDeserializer(), "get.time", "gti", "getTime"); - op.add(Builder::priGetTime, JsonpDeserializer.stringDeserializer(), "pri.get.time"); - op.add(Builder::getTotal, JsonpDeserializer.stringDeserializer(), "get.total", "gto", "getTotal"); - op.add(Builder::priGetTotal, JsonpDeserializer.stringDeserializer(), "pri.get.total"); - op.add(Builder::getExistsTime, JsonpDeserializer.stringDeserializer(), "get.exists_time", "geti", "getExistsTime"); op.add(Builder::priGetExistsTime, JsonpDeserializer.stringDeserializer(), "pri.get.exists_time"); - op.add(Builder::getExistsTotal, JsonpDeserializer.stringDeserializer(), "get.exists_total", "geto", "getExistsTotal"); op.add(Builder::priGetExistsTotal, JsonpDeserializer.stringDeserializer(), "pri.get.exists_total"); - op.add(Builder::getMissingTime, JsonpDeserializer.stringDeserializer(), "get.missing_time", "gmti", "getMissingTime"); op.add(Builder::priGetMissingTime, JsonpDeserializer.stringDeserializer(), "pri.get.missing_time"); - op.add(Builder::getMissingTotal, JsonpDeserializer.stringDeserializer(), "get.missing_total", "gmto", "getMissingTotal"); op.add(Builder::priGetMissingTotal, JsonpDeserializer.stringDeserializer(), "pri.get.missing_total"); - op.add( - Builder::indexingDeleteCurrent, - JsonpDeserializer.stringDeserializer(), - "indexing.delete_current", - "idc", - "indexingDeleteCurrent" - ); + op.add(Builder::priGetTime, JsonpDeserializer.stringDeserializer(), "pri.get.time"); + op.add(Builder::priGetTotal, JsonpDeserializer.stringDeserializer(), "pri.get.total"); op.add(Builder::priIndexingDeleteCurrent, JsonpDeserializer.stringDeserializer(), "pri.indexing.delete_current"); - op.add(Builder::indexingDeleteTime, JsonpDeserializer.stringDeserializer(), "indexing.delete_time", "idti", "indexingDeleteTime"); op.add(Builder::priIndexingDeleteTime, JsonpDeserializer.stringDeserializer(), "pri.indexing.delete_time"); - op.add( - Builder::indexingDeleteTotal, - JsonpDeserializer.stringDeserializer(), - "indexing.delete_total", - "idto", - "indexingDeleteTotal" - ); op.add(Builder::priIndexingDeleteTotal, JsonpDeserializer.stringDeserializer(), "pri.indexing.delete_total"); - op.add( - Builder::indexingIndexCurrent, - JsonpDeserializer.stringDeserializer(), - "indexing.index_current", - "iic", - "indexingIndexCurrent" - ); op.add(Builder::priIndexingIndexCurrent, JsonpDeserializer.stringDeserializer(), "pri.indexing.index_current"); - op.add(Builder::indexingIndexTime, JsonpDeserializer.stringDeserializer(), "indexing.index_time", "iiti", "indexingIndexTime"); + op.add(Builder::priIndexingIndexFailed, JsonpDeserializer.stringDeserializer(), "pri.indexing.index_failed"); op.add(Builder::priIndexingIndexTime, JsonpDeserializer.stringDeserializer(), "pri.indexing.index_time"); - op.add(Builder::indexingIndexTotal, JsonpDeserializer.stringDeserializer(), "indexing.index_total", "iito", "indexingIndexTotal"); op.add(Builder::priIndexingIndexTotal, JsonpDeserializer.stringDeserializer(), "pri.indexing.index_total"); - op.add(Builder::indexingIndexFailed, JsonpDeserializer.stringDeserializer(), "indexing.index_failed", "iif", "indexingIndexFailed"); - op.add(Builder::priIndexingIndexFailed, JsonpDeserializer.stringDeserializer(), "pri.indexing.index_failed"); - op.add(Builder::mergesCurrent, JsonpDeserializer.stringDeserializer(), "merges.current", "mc", "mergesCurrent"); + op.add(Builder::priMemoryTotal, JsonpDeserializer.stringDeserializer(), "pri.memory.total"); op.add(Builder::priMergesCurrent, JsonpDeserializer.stringDeserializer(), "pri.merges.current"); - op.add(Builder::mergesCurrentDocs, JsonpDeserializer.stringDeserializer(), "merges.current_docs", "mcd", "mergesCurrentDocs"); op.add(Builder::priMergesCurrentDocs, JsonpDeserializer.stringDeserializer(), "pri.merges.current_docs"); - op.add(Builder::mergesCurrentSize, JsonpDeserializer.stringDeserializer(), "merges.current_size", "mcs", "mergesCurrentSize"); op.add(Builder::priMergesCurrentSize, JsonpDeserializer.stringDeserializer(), "pri.merges.current_size"); - op.add(Builder::mergesTotal, JsonpDeserializer.stringDeserializer(), "merges.total", "mt", "mergesTotal"); op.add(Builder::priMergesTotal, JsonpDeserializer.stringDeserializer(), "pri.merges.total"); - op.add(Builder::mergesTotalDocs, JsonpDeserializer.stringDeserializer(), "merges.total_docs", "mtd", "mergesTotalDocs"); op.add(Builder::priMergesTotalDocs, JsonpDeserializer.stringDeserializer(), "pri.merges.total_docs"); - op.add(Builder::mergesTotalSize, JsonpDeserializer.stringDeserializer(), "merges.total_size", "mts", "mergesTotalSize"); op.add(Builder::priMergesTotalSize, JsonpDeserializer.stringDeserializer(), "pri.merges.total_size"); - op.add(Builder::mergesTotalTime, JsonpDeserializer.stringDeserializer(), "merges.total_time", "mtt", "mergesTotalTime"); op.add(Builder::priMergesTotalTime, JsonpDeserializer.stringDeserializer(), "pri.merges.total_time"); - op.add(Builder::refreshTotal, JsonpDeserializer.stringDeserializer(), "refresh.total", "rto", "refreshTotal"); - op.add(Builder::priRefreshTotal, JsonpDeserializer.stringDeserializer(), "pri.refresh.total"); - op.add(Builder::refreshTime, JsonpDeserializer.stringDeserializer(), "refresh.time", "rti", "refreshTime"); - op.add(Builder::priRefreshTime, JsonpDeserializer.stringDeserializer(), "pri.refresh.time"); - op.add(Builder::refreshExternalTotal, JsonpDeserializer.stringDeserializer(), "refresh.external_total", "reto"); - op.add(Builder::priRefreshExternalTotal, JsonpDeserializer.stringDeserializer(), "pri.refresh.external_total"); - op.add(Builder::refreshExternalTime, JsonpDeserializer.stringDeserializer(), "refresh.external_time", "reti"); + op.add(Builder::priQueryCacheEvictions, JsonpDeserializer.stringDeserializer(), "pri.query_cache.evictions"); + op.add(Builder::priQueryCacheMemorySize, JsonpDeserializer.stringDeserializer(), "pri.query_cache.memory_size"); op.add(Builder::priRefreshExternalTime, JsonpDeserializer.stringDeserializer(), "pri.refresh.external_time"); - op.add(Builder::refreshListeners, JsonpDeserializer.stringDeserializer(), "refresh.listeners", "rli", "refreshListeners"); + op.add(Builder::priRefreshExternalTotal, JsonpDeserializer.stringDeserializer(), "pri.refresh.external_total"); op.add(Builder::priRefreshListeners, JsonpDeserializer.stringDeserializer(), "pri.refresh.listeners"); - op.add(Builder::searchFetchCurrent, JsonpDeserializer.stringDeserializer(), "search.fetch_current", "sfc", "searchFetchCurrent"); + op.add(Builder::priRefreshTime, JsonpDeserializer.stringDeserializer(), "pri.refresh.time"); + op.add(Builder::priRefreshTotal, JsonpDeserializer.stringDeserializer(), "pri.refresh.total"); + op.add(Builder::priRequestCacheEvictions, JsonpDeserializer.stringDeserializer(), "pri.request_cache.evictions"); + op.add(Builder::priRequestCacheHitCount, JsonpDeserializer.stringDeserializer(), "pri.request_cache.hit_count"); + op.add(Builder::priRequestCacheMemorySize, JsonpDeserializer.stringDeserializer(), "pri.request_cache.memory_size"); + op.add(Builder::priRequestCacheMissCount, JsonpDeserializer.stringDeserializer(), "pri.request_cache.miss_count"); + op.add(Builder::priSearchConcurrentAvgSliceCount, JsonpDeserializer.stringDeserializer(), "pri.search.concurrent_avg_slice_count"); + op.add(Builder::priSearchConcurrentQueryCurrent, JsonpDeserializer.stringDeserializer(), "pri.search.concurrent_query_current"); + op.add(Builder::priSearchConcurrentQueryTime, JsonpDeserializer.stringDeserializer(), "pri.search.concurrent_query_time"); + op.add(Builder::priSearchConcurrentQueryTotal, JsonpDeserializer.stringDeserializer(), "pri.search.concurrent_query_total"); op.add(Builder::priSearchFetchCurrent, JsonpDeserializer.stringDeserializer(), "pri.search.fetch_current"); - op.add(Builder::searchFetchTime, JsonpDeserializer.stringDeserializer(), "search.fetch_time", "sfti", "searchFetchTime"); op.add(Builder::priSearchFetchTime, JsonpDeserializer.stringDeserializer(), "pri.search.fetch_time"); - op.add(Builder::searchFetchTotal, JsonpDeserializer.stringDeserializer(), "search.fetch_total", "sfto", "searchFetchTotal"); op.add(Builder::priSearchFetchTotal, JsonpDeserializer.stringDeserializer(), "pri.search.fetch_total"); - op.add(Builder::searchOpenContexts, JsonpDeserializer.stringDeserializer(), "search.open_contexts", "so", "searchOpenContexts"); op.add(Builder::priSearchOpenContexts, JsonpDeserializer.stringDeserializer(), "pri.search.open_contexts"); - op.add(Builder::searchQueryCurrent, JsonpDeserializer.stringDeserializer(), "search.query_current", "sqc", "searchQueryCurrent"); + op.add(Builder::priSearchPointInTimeCurrent, JsonpDeserializer.stringDeserializer(), "pri.search.point_in_time_current"); + op.add(Builder::priSearchPointInTimeTime, JsonpDeserializer.stringDeserializer(), "pri.search.point_in_time_time"); + op.add(Builder::priSearchPointInTimeTotal, JsonpDeserializer.stringDeserializer(), "pri.search.point_in_time_total"); op.add(Builder::priSearchQueryCurrent, JsonpDeserializer.stringDeserializer(), "pri.search.query_current"); - op.add(Builder::searchQueryTime, JsonpDeserializer.stringDeserializer(), "search.query_time", "sqti", "searchQueryTime"); op.add(Builder::priSearchQueryTime, JsonpDeserializer.stringDeserializer(), "pri.search.query_time"); - op.add(Builder::searchQueryTotal, JsonpDeserializer.stringDeserializer(), "search.query_total", "sqto", "searchQueryTotal"); op.add(Builder::priSearchQueryTotal, JsonpDeserializer.stringDeserializer(), "pri.search.query_total"); - op.add(Builder::searchScrollCurrent, JsonpDeserializer.stringDeserializer(), "search.scroll_current", "scc", "searchScrollCurrent"); op.add(Builder::priSearchScrollCurrent, JsonpDeserializer.stringDeserializer(), "pri.search.scroll_current"); - op.add(Builder::searchScrollTime, JsonpDeserializer.stringDeserializer(), "search.scroll_time", "scti", "searchScrollTime"); op.add(Builder::priSearchScrollTime, JsonpDeserializer.stringDeserializer(), "pri.search.scroll_time"); - op.add(Builder::searchScrollTotal, JsonpDeserializer.stringDeserializer(), "search.scroll_total", "scto", "searchScrollTotal"); op.add(Builder::priSearchScrollTotal, JsonpDeserializer.stringDeserializer(), "pri.search.scroll_total"); - op.add(Builder::segmentsCount, JsonpDeserializer.stringDeserializer(), "segments.count", "sc", "segmentsCount"); op.add(Builder::priSegmentsCount, JsonpDeserializer.stringDeserializer(), "pri.segments.count"); - op.add(Builder::segmentsMemory, JsonpDeserializer.stringDeserializer(), "segments.memory", "sm", "segmentsMemory"); - op.add(Builder::priSegmentsMemory, JsonpDeserializer.stringDeserializer(), "pri.segments.memory"); - op.add( - Builder::segmentsIndexWriterMemory, - JsonpDeserializer.stringDeserializer(), - "segments.index_writer_memory", - "siwm", - "segmentsIndexWriterMemory" - ); + op.add(Builder::priSegmentsFixedBitsetMemory, JsonpDeserializer.stringDeserializer(), "pri.segments.fixed_bitset_memory"); op.add(Builder::priSegmentsIndexWriterMemory, JsonpDeserializer.stringDeserializer(), "pri.segments.index_writer_memory"); - op.add( - Builder::segmentsVersionMapMemory, - JsonpDeserializer.stringDeserializer(), - "segments.version_map_memory", - "svmm", - "segmentsVersionMapMemory" - ); + op.add(Builder::priSegmentsMemory, JsonpDeserializer.stringDeserializer(), "pri.segments.memory"); op.add(Builder::priSegmentsVersionMapMemory, JsonpDeserializer.stringDeserializer(), "pri.segments.version_map_memory"); - op.add( - Builder::segmentsFixedBitsetMemory, - JsonpDeserializer.stringDeserializer(), - "segments.fixed_bitset_memory", - "sfbm", - "fixedBitsetMemory" - ); - op.add(Builder::priSegmentsFixedBitsetMemory, JsonpDeserializer.stringDeserializer(), "pri.segments.fixed_bitset_memory"); - op.add(Builder::warmerCurrent, JsonpDeserializer.stringDeserializer(), "warmer.current", "wc", "warmerCurrent"); - op.add(Builder::priWarmerCurrent, JsonpDeserializer.stringDeserializer(), "pri.warmer.current"); - op.add(Builder::warmerTotal, JsonpDeserializer.stringDeserializer(), "warmer.total", "wto", "warmerTotal"); - op.add(Builder::priWarmerTotal, JsonpDeserializer.stringDeserializer(), "pri.warmer.total"); - op.add(Builder::warmerTotalTime, JsonpDeserializer.stringDeserializer(), "warmer.total_time", "wtt", "warmerTotalTime"); - op.add(Builder::priWarmerTotalTime, JsonpDeserializer.stringDeserializer(), "pri.warmer.total_time"); - op.add(Builder::suggestCurrent, JsonpDeserializer.stringDeserializer(), "suggest.current", "suc", "suggestCurrent"); + op.add(Builder::priStoreSize, JsonpDeserializer.stringDeserializer(), "pri.store.size"); op.add(Builder::priSuggestCurrent, JsonpDeserializer.stringDeserializer(), "pri.suggest.current"); - op.add(Builder::suggestTime, JsonpDeserializer.stringDeserializer(), "suggest.time", "suti", "suggestTime"); op.add(Builder::priSuggestTime, JsonpDeserializer.stringDeserializer(), "pri.suggest.time"); - op.add(Builder::suggestTotal, JsonpDeserializer.stringDeserializer(), "suggest.total", "suto", "suggestTotal"); op.add(Builder::priSuggestTotal, JsonpDeserializer.stringDeserializer(), "pri.suggest.total"); - op.add(Builder::memoryTotal, JsonpDeserializer.stringDeserializer(), "memory.total", "tm", "memoryTotal"); - op.add(Builder::priMemoryTotal, JsonpDeserializer.stringDeserializer(), "pri.memory.total"); - op.add(Builder::searchThrottled, JsonpDeserializer.stringDeserializer(), "search.throttled", "sth"); - op.add(Builder::bulkTotalOperations, JsonpDeserializer.stringDeserializer(), "bulk.total_operations", "bto", "bulkTotalOperation"); - op.add(Builder::priBulkTotalOperations, JsonpDeserializer.stringDeserializer(), "pri.bulk.total_operations"); - op.add(Builder::bulkTotalTime, JsonpDeserializer.stringDeserializer(), "bulk.total_time", "btti", "bulkTotalTime"); - op.add(Builder::priBulkTotalTime, JsonpDeserializer.stringDeserializer(), "pri.bulk.total_time"); - op.add( - Builder::bulkTotalSizeInBytes, - JsonpDeserializer.stringDeserializer(), - "bulk.total_size_in_bytes", - "btsi", - "bulkTotalSizeInBytes" - ); - op.add(Builder::priBulkTotalSizeInBytes, JsonpDeserializer.stringDeserializer(), "pri.bulk.total_size_in_bytes"); - op.add(Builder::bulkAvgTime, JsonpDeserializer.stringDeserializer(), "bulk.avg_time", "bati", "bulkAvgTime"); - op.add(Builder::priBulkAvgTime, JsonpDeserializer.stringDeserializer(), "pri.bulk.avg_time"); - op.add(Builder::bulkAvgSizeInBytes, JsonpDeserializer.stringDeserializer(), "bulk.avg_size_in_bytes", "basi", "bulkAvgSizeInBytes"); - op.add(Builder::priBulkAvgSizeInBytes, JsonpDeserializer.stringDeserializer(), "pri.bulk.avg_size_in_bytes"); - + op.add(Builder::priWarmerCurrent, JsonpDeserializer.stringDeserializer(), "pri.warmer.current"); + op.add(Builder::priWarmerTotal, JsonpDeserializer.stringDeserializer(), "pri.warmer.total"); + op.add(Builder::priWarmerTotalTime, JsonpDeserializer.stringDeserializer(), "pri.warmer.total_time"); + op.add(Builder::queryCacheEvictions, JsonpDeserializer.stringDeserializer(), "query_cache.evictions"); + op.add(Builder::queryCacheMemorySize, JsonpDeserializer.stringDeserializer(), "query_cache.memory_size"); + op.add(Builder::refreshExternalTime, JsonpDeserializer.stringDeserializer(), "refresh.external_time"); + op.add(Builder::refreshExternalTotal, JsonpDeserializer.stringDeserializer(), "refresh.external_total"); + op.add(Builder::refreshListeners, JsonpDeserializer.stringDeserializer(), "refresh.listeners"); + op.add(Builder::refreshTime, JsonpDeserializer.stringDeserializer(), "refresh.time"); + op.add(Builder::refreshTotal, JsonpDeserializer.stringDeserializer(), "refresh.total"); + op.add(Builder::rep, JsonpDeserializer.stringDeserializer(), "rep"); + op.add(Builder::requestCacheEvictions, JsonpDeserializer.stringDeserializer(), "request_cache.evictions"); + op.add(Builder::requestCacheHitCount, JsonpDeserializer.stringDeserializer(), "request_cache.hit_count"); + op.add(Builder::requestCacheMemorySize, JsonpDeserializer.stringDeserializer(), "request_cache.memory_size"); + op.add(Builder::requestCacheMissCount, JsonpDeserializer.stringDeserializer(), "request_cache.miss_count"); + op.add(Builder::searchConcurrentAvgSliceCount, JsonpDeserializer.stringDeserializer(), "search.concurrent_avg_slice_count"); + op.add(Builder::searchConcurrentQueryCurrent, JsonpDeserializer.stringDeserializer(), "search.concurrent_query_current"); + op.add(Builder::searchConcurrentQueryTime, JsonpDeserializer.stringDeserializer(), "search.concurrent_query_time"); + op.add(Builder::searchConcurrentQueryTotal, JsonpDeserializer.stringDeserializer(), "search.concurrent_query_total"); + op.add(Builder::searchFetchCurrent, JsonpDeserializer.stringDeserializer(), "search.fetch_current"); + op.add(Builder::searchFetchTime, JsonpDeserializer.stringDeserializer(), "search.fetch_time"); + op.add(Builder::searchFetchTotal, JsonpDeserializer.stringDeserializer(), "search.fetch_total"); + op.add(Builder::searchOpenContexts, JsonpDeserializer.stringDeserializer(), "search.open_contexts"); + op.add(Builder::searchPointInTimeCurrent, JsonpDeserializer.stringDeserializer(), "search.point_in_time_current"); + op.add(Builder::searchPointInTimeTime, JsonpDeserializer.stringDeserializer(), "search.point_in_time_time"); + op.add(Builder::searchPointInTimeTotal, JsonpDeserializer.stringDeserializer(), "search.point_in_time_total"); + op.add(Builder::searchQueryCurrent, JsonpDeserializer.stringDeserializer(), "search.query_current"); + op.add(Builder::searchQueryTime, JsonpDeserializer.stringDeserializer(), "search.query_time"); + op.add(Builder::searchQueryTotal, JsonpDeserializer.stringDeserializer(), "search.query_total"); + op.add(Builder::searchScrollCurrent, JsonpDeserializer.stringDeserializer(), "search.scroll_current"); + op.add(Builder::searchScrollTime, JsonpDeserializer.stringDeserializer(), "search.scroll_time"); + op.add(Builder::searchScrollTotal, JsonpDeserializer.stringDeserializer(), "search.scroll_total"); + op.add(Builder::searchThrottled, JsonpDeserializer.stringDeserializer(), "search.throttled"); + op.add(Builder::segmentsCount, JsonpDeserializer.stringDeserializer(), "segments.count"); + op.add(Builder::segmentsFixedBitsetMemory, JsonpDeserializer.stringDeserializer(), "segments.fixed_bitset_memory"); + op.add(Builder::segmentsIndexWriterMemory, JsonpDeserializer.stringDeserializer(), "segments.index_writer_memory"); + op.add(Builder::segmentsMemory, JsonpDeserializer.stringDeserializer(), "segments.memory"); + op.add(Builder::segmentsVersionMapMemory, JsonpDeserializer.stringDeserializer(), "segments.version_map_memory"); + op.add(Builder::status, JsonpDeserializer.stringDeserializer(), "status"); + op.add(Builder::storeSize, JsonpDeserializer.stringDeserializer(), "store.size"); + op.add(Builder::suggestCurrent, JsonpDeserializer.stringDeserializer(), "suggest.current"); + op.add(Builder::suggestTime, JsonpDeserializer.stringDeserializer(), "suggest.time"); + op.add(Builder::suggestTotal, JsonpDeserializer.stringDeserializer(), "suggest.total"); + op.add(Builder::uuid, JsonpDeserializer.stringDeserializer(), "uuid"); + op.add(Builder::warmerCurrent, JsonpDeserializer.stringDeserializer(), "warmer.current"); + op.add(Builder::warmerTotal, JsonpDeserializer.stringDeserializer(), "warmer.total"); + op.add(Builder::warmerTotalTime, JsonpDeserializer.stringDeserializer(), "warmer.total_time"); + } + + @Override + public int hashCode() { + int result = 17; + result = 31 * result + Objects.hashCode(this.completionSize); + result = 31 * result + Objects.hashCode(this.creationDate); + result = 31 * result + Objects.hashCode(this.creationDateString); + result = 31 * result + Objects.hashCode(this.docsCount); + result = 31 * result + Objects.hashCode(this.docsDeleted); + result = 31 * result + Objects.hashCode(this.fielddataEvictions); + result = 31 * result + Objects.hashCode(this.fielddataMemorySize); + result = 31 * result + Objects.hashCode(this.flushTotal); + result = 31 * result + Objects.hashCode(this.flushTotalTime); + result = 31 * result + Objects.hashCode(this.getCurrent); + result = 31 * result + Objects.hashCode(this.getExistsTime); + result = 31 * result + Objects.hashCode(this.getExistsTotal); + result = 31 * result + Objects.hashCode(this.getMissingTime); + result = 31 * result + Objects.hashCode(this.getMissingTotal); + result = 31 * result + Objects.hashCode(this.getTime); + result = 31 * result + Objects.hashCode(this.getTotal); + result = 31 * result + Objects.hashCode(this.health); + result = 31 * result + Objects.hashCode(this.index); + result = 31 * result + Objects.hashCode(this.indexingDeleteCurrent); + result = 31 * result + Objects.hashCode(this.indexingDeleteTime); + result = 31 * result + Objects.hashCode(this.indexingDeleteTotal); + result = 31 * result + Objects.hashCode(this.indexingIndexCurrent); + result = 31 * result + Objects.hashCode(this.indexingIndexFailed); + result = 31 * result + Objects.hashCode(this.indexingIndexTime); + result = 31 * result + Objects.hashCode(this.indexingIndexTotal); + result = 31 * result + Objects.hashCode(this.memoryTotal); + result = 31 * result + Objects.hashCode(this.mergesCurrent); + result = 31 * result + Objects.hashCode(this.mergesCurrentDocs); + result = 31 * result + Objects.hashCode(this.mergesCurrentSize); + result = 31 * result + Objects.hashCode(this.mergesTotal); + result = 31 * result + Objects.hashCode(this.mergesTotalDocs); + result = 31 * result + Objects.hashCode(this.mergesTotalSize); + result = 31 * result + Objects.hashCode(this.mergesTotalTime); + result = 31 * result + Objects.hashCode(this.pri); + result = 31 * result + Objects.hashCode(this.priCompletionSize); + result = 31 * result + Objects.hashCode(this.priFielddataEvictions); + result = 31 * result + Objects.hashCode(this.priFielddataMemorySize); + result = 31 * result + Objects.hashCode(this.priFlushTotal); + result = 31 * result + Objects.hashCode(this.priFlushTotalTime); + result = 31 * result + Objects.hashCode(this.priGetCurrent); + result = 31 * result + Objects.hashCode(this.priGetExistsTime); + result = 31 * result + Objects.hashCode(this.priGetExistsTotal); + result = 31 * result + Objects.hashCode(this.priGetMissingTime); + result = 31 * result + Objects.hashCode(this.priGetMissingTotal); + result = 31 * result + Objects.hashCode(this.priGetTime); + result = 31 * result + Objects.hashCode(this.priGetTotal); + result = 31 * result + Objects.hashCode(this.priIndexingDeleteCurrent); + result = 31 * result + Objects.hashCode(this.priIndexingDeleteTime); + result = 31 * result + Objects.hashCode(this.priIndexingDeleteTotal); + result = 31 * result + Objects.hashCode(this.priIndexingIndexCurrent); + result = 31 * result + Objects.hashCode(this.priIndexingIndexFailed); + result = 31 * result + Objects.hashCode(this.priIndexingIndexTime); + result = 31 * result + Objects.hashCode(this.priIndexingIndexTotal); + result = 31 * result + Objects.hashCode(this.priMemoryTotal); + result = 31 * result + Objects.hashCode(this.priMergesCurrent); + result = 31 * result + Objects.hashCode(this.priMergesCurrentDocs); + result = 31 * result + Objects.hashCode(this.priMergesCurrentSize); + result = 31 * result + Objects.hashCode(this.priMergesTotal); + result = 31 * result + Objects.hashCode(this.priMergesTotalDocs); + result = 31 * result + Objects.hashCode(this.priMergesTotalSize); + result = 31 * result + Objects.hashCode(this.priMergesTotalTime); + result = 31 * result + Objects.hashCode(this.priQueryCacheEvictions); + result = 31 * result + Objects.hashCode(this.priQueryCacheMemorySize); + result = 31 * result + Objects.hashCode(this.priRefreshExternalTime); + result = 31 * result + Objects.hashCode(this.priRefreshExternalTotal); + result = 31 * result + Objects.hashCode(this.priRefreshListeners); + result = 31 * result + Objects.hashCode(this.priRefreshTime); + result = 31 * result + Objects.hashCode(this.priRefreshTotal); + result = 31 * result + Objects.hashCode(this.priRequestCacheEvictions); + result = 31 * result + Objects.hashCode(this.priRequestCacheHitCount); + result = 31 * result + Objects.hashCode(this.priRequestCacheMemorySize); + result = 31 * result + Objects.hashCode(this.priRequestCacheMissCount); + result = 31 * result + Objects.hashCode(this.priSearchConcurrentAvgSliceCount); + result = 31 * result + Objects.hashCode(this.priSearchConcurrentQueryCurrent); + result = 31 * result + Objects.hashCode(this.priSearchConcurrentQueryTime); + result = 31 * result + Objects.hashCode(this.priSearchConcurrentQueryTotal); + result = 31 * result + Objects.hashCode(this.priSearchFetchCurrent); + result = 31 * result + Objects.hashCode(this.priSearchFetchTime); + result = 31 * result + Objects.hashCode(this.priSearchFetchTotal); + result = 31 * result + Objects.hashCode(this.priSearchOpenContexts); + result = 31 * result + Objects.hashCode(this.priSearchPointInTimeCurrent); + result = 31 * result + Objects.hashCode(this.priSearchPointInTimeTime); + result = 31 * result + Objects.hashCode(this.priSearchPointInTimeTotal); + result = 31 * result + Objects.hashCode(this.priSearchQueryCurrent); + result = 31 * result + Objects.hashCode(this.priSearchQueryTime); + result = 31 * result + Objects.hashCode(this.priSearchQueryTotal); + result = 31 * result + Objects.hashCode(this.priSearchScrollCurrent); + result = 31 * result + Objects.hashCode(this.priSearchScrollTime); + result = 31 * result + Objects.hashCode(this.priSearchScrollTotal); + result = 31 * result + Objects.hashCode(this.priSegmentsCount); + result = 31 * result + Objects.hashCode(this.priSegmentsFixedBitsetMemory); + result = 31 * result + Objects.hashCode(this.priSegmentsIndexWriterMemory); + result = 31 * result + Objects.hashCode(this.priSegmentsMemory); + result = 31 * result + Objects.hashCode(this.priSegmentsVersionMapMemory); + result = 31 * result + Objects.hashCode(this.priStoreSize); + result = 31 * result + Objects.hashCode(this.priSuggestCurrent); + result = 31 * result + Objects.hashCode(this.priSuggestTime); + result = 31 * result + Objects.hashCode(this.priSuggestTotal); + result = 31 * result + Objects.hashCode(this.priWarmerCurrent); + result = 31 * result + Objects.hashCode(this.priWarmerTotal); + result = 31 * result + Objects.hashCode(this.priWarmerTotalTime); + result = 31 * result + Objects.hashCode(this.queryCacheEvictions); + result = 31 * result + Objects.hashCode(this.queryCacheMemorySize); + result = 31 * result + Objects.hashCode(this.refreshExternalTime); + result = 31 * result + Objects.hashCode(this.refreshExternalTotal); + result = 31 * result + Objects.hashCode(this.refreshListeners); + result = 31 * result + Objects.hashCode(this.refreshTime); + result = 31 * result + Objects.hashCode(this.refreshTotal); + result = 31 * result + Objects.hashCode(this.rep); + result = 31 * result + Objects.hashCode(this.requestCacheEvictions); + result = 31 * result + Objects.hashCode(this.requestCacheHitCount); + result = 31 * result + Objects.hashCode(this.requestCacheMemorySize); + result = 31 * result + Objects.hashCode(this.requestCacheMissCount); + result = 31 * result + Objects.hashCode(this.searchConcurrentAvgSliceCount); + result = 31 * result + Objects.hashCode(this.searchConcurrentQueryCurrent); + result = 31 * result + Objects.hashCode(this.searchConcurrentQueryTime); + result = 31 * result + Objects.hashCode(this.searchConcurrentQueryTotal); + result = 31 * result + Objects.hashCode(this.searchFetchCurrent); + result = 31 * result + Objects.hashCode(this.searchFetchTime); + result = 31 * result + Objects.hashCode(this.searchFetchTotal); + result = 31 * result + Objects.hashCode(this.searchOpenContexts); + result = 31 * result + Objects.hashCode(this.searchPointInTimeCurrent); + result = 31 * result + Objects.hashCode(this.searchPointInTimeTime); + result = 31 * result + Objects.hashCode(this.searchPointInTimeTotal); + result = 31 * result + Objects.hashCode(this.searchQueryCurrent); + result = 31 * result + Objects.hashCode(this.searchQueryTime); + result = 31 * result + Objects.hashCode(this.searchQueryTotal); + result = 31 * result + Objects.hashCode(this.searchScrollCurrent); + result = 31 * result + Objects.hashCode(this.searchScrollTime); + result = 31 * result + Objects.hashCode(this.searchScrollTotal); + result = 31 * result + Objects.hashCode(this.searchThrottled); + result = 31 * result + Objects.hashCode(this.segmentsCount); + result = 31 * result + Objects.hashCode(this.segmentsFixedBitsetMemory); + result = 31 * result + Objects.hashCode(this.segmentsIndexWriterMemory); + result = 31 * result + Objects.hashCode(this.segmentsMemory); + result = 31 * result + Objects.hashCode(this.segmentsVersionMapMemory); + result = 31 * result + Objects.hashCode(this.status); + result = 31 * result + Objects.hashCode(this.storeSize); + result = 31 * result + Objects.hashCode(this.suggestCurrent); + result = 31 * result + Objects.hashCode(this.suggestTime); + result = 31 * result + Objects.hashCode(this.suggestTotal); + result = 31 * result + Objects.hashCode(this.uuid); + result = 31 * result + Objects.hashCode(this.warmerCurrent); + result = 31 * result + Objects.hashCode(this.warmerTotal); + result = 31 * result + Objects.hashCode(this.warmerTotalTime); + return result; + } + + @Override + public boolean equals(Object o) { + if (this == o) return true; + if (o == null || this.getClass() != o.getClass()) return false; + IndicesRecord other = (IndicesRecord) o; + return Objects.equals(this.completionSize, other.completionSize) + && Objects.equals(this.creationDate, other.creationDate) + && Objects.equals(this.creationDateString, other.creationDateString) + && Objects.equals(this.docsCount, other.docsCount) + && Objects.equals(this.docsDeleted, other.docsDeleted) + && Objects.equals(this.fielddataEvictions, other.fielddataEvictions) + && Objects.equals(this.fielddataMemorySize, other.fielddataMemorySize) + && Objects.equals(this.flushTotal, other.flushTotal) + && Objects.equals(this.flushTotalTime, other.flushTotalTime) + && Objects.equals(this.getCurrent, other.getCurrent) + && Objects.equals(this.getExistsTime, other.getExistsTime) + && Objects.equals(this.getExistsTotal, other.getExistsTotal) + && Objects.equals(this.getMissingTime, other.getMissingTime) + && Objects.equals(this.getMissingTotal, other.getMissingTotal) + && Objects.equals(this.getTime, other.getTime) + && Objects.equals(this.getTotal, other.getTotal) + && Objects.equals(this.health, other.health) + && Objects.equals(this.index, other.index) + && Objects.equals(this.indexingDeleteCurrent, other.indexingDeleteCurrent) + && Objects.equals(this.indexingDeleteTime, other.indexingDeleteTime) + && Objects.equals(this.indexingDeleteTotal, other.indexingDeleteTotal) + && Objects.equals(this.indexingIndexCurrent, other.indexingIndexCurrent) + && Objects.equals(this.indexingIndexFailed, other.indexingIndexFailed) + && Objects.equals(this.indexingIndexTime, other.indexingIndexTime) + && Objects.equals(this.indexingIndexTotal, other.indexingIndexTotal) + && Objects.equals(this.memoryTotal, other.memoryTotal) + && Objects.equals(this.mergesCurrent, other.mergesCurrent) + && Objects.equals(this.mergesCurrentDocs, other.mergesCurrentDocs) + && Objects.equals(this.mergesCurrentSize, other.mergesCurrentSize) + && Objects.equals(this.mergesTotal, other.mergesTotal) + && Objects.equals(this.mergesTotalDocs, other.mergesTotalDocs) + && Objects.equals(this.mergesTotalSize, other.mergesTotalSize) + && Objects.equals(this.mergesTotalTime, other.mergesTotalTime) + && Objects.equals(this.pri, other.pri) + && Objects.equals(this.priCompletionSize, other.priCompletionSize) + && Objects.equals(this.priFielddataEvictions, other.priFielddataEvictions) + && Objects.equals(this.priFielddataMemorySize, other.priFielddataMemorySize) + && Objects.equals(this.priFlushTotal, other.priFlushTotal) + && Objects.equals(this.priFlushTotalTime, other.priFlushTotalTime) + && Objects.equals(this.priGetCurrent, other.priGetCurrent) + && Objects.equals(this.priGetExistsTime, other.priGetExistsTime) + && Objects.equals(this.priGetExistsTotal, other.priGetExistsTotal) + && Objects.equals(this.priGetMissingTime, other.priGetMissingTime) + && Objects.equals(this.priGetMissingTotal, other.priGetMissingTotal) + && Objects.equals(this.priGetTime, other.priGetTime) + && Objects.equals(this.priGetTotal, other.priGetTotal) + && Objects.equals(this.priIndexingDeleteCurrent, other.priIndexingDeleteCurrent) + && Objects.equals(this.priIndexingDeleteTime, other.priIndexingDeleteTime) + && Objects.equals(this.priIndexingDeleteTotal, other.priIndexingDeleteTotal) + && Objects.equals(this.priIndexingIndexCurrent, other.priIndexingIndexCurrent) + && Objects.equals(this.priIndexingIndexFailed, other.priIndexingIndexFailed) + && Objects.equals(this.priIndexingIndexTime, other.priIndexingIndexTime) + && Objects.equals(this.priIndexingIndexTotal, other.priIndexingIndexTotal) + && Objects.equals(this.priMemoryTotal, other.priMemoryTotal) + && Objects.equals(this.priMergesCurrent, other.priMergesCurrent) + && Objects.equals(this.priMergesCurrentDocs, other.priMergesCurrentDocs) + && Objects.equals(this.priMergesCurrentSize, other.priMergesCurrentSize) + && Objects.equals(this.priMergesTotal, other.priMergesTotal) + && Objects.equals(this.priMergesTotalDocs, other.priMergesTotalDocs) + && Objects.equals(this.priMergesTotalSize, other.priMergesTotalSize) + && Objects.equals(this.priMergesTotalTime, other.priMergesTotalTime) + && Objects.equals(this.priQueryCacheEvictions, other.priQueryCacheEvictions) + && Objects.equals(this.priQueryCacheMemorySize, other.priQueryCacheMemorySize) + && Objects.equals(this.priRefreshExternalTime, other.priRefreshExternalTime) + && Objects.equals(this.priRefreshExternalTotal, other.priRefreshExternalTotal) + && Objects.equals(this.priRefreshListeners, other.priRefreshListeners) + && Objects.equals(this.priRefreshTime, other.priRefreshTime) + && Objects.equals(this.priRefreshTotal, other.priRefreshTotal) + && Objects.equals(this.priRequestCacheEvictions, other.priRequestCacheEvictions) + && Objects.equals(this.priRequestCacheHitCount, other.priRequestCacheHitCount) + && Objects.equals(this.priRequestCacheMemorySize, other.priRequestCacheMemorySize) + && Objects.equals(this.priRequestCacheMissCount, other.priRequestCacheMissCount) + && Objects.equals(this.priSearchConcurrentAvgSliceCount, other.priSearchConcurrentAvgSliceCount) + && Objects.equals(this.priSearchConcurrentQueryCurrent, other.priSearchConcurrentQueryCurrent) + && Objects.equals(this.priSearchConcurrentQueryTime, other.priSearchConcurrentQueryTime) + && Objects.equals(this.priSearchConcurrentQueryTotal, other.priSearchConcurrentQueryTotal) + && Objects.equals(this.priSearchFetchCurrent, other.priSearchFetchCurrent) + && Objects.equals(this.priSearchFetchTime, other.priSearchFetchTime) + && Objects.equals(this.priSearchFetchTotal, other.priSearchFetchTotal) + && Objects.equals(this.priSearchOpenContexts, other.priSearchOpenContexts) + && Objects.equals(this.priSearchPointInTimeCurrent, other.priSearchPointInTimeCurrent) + && Objects.equals(this.priSearchPointInTimeTime, other.priSearchPointInTimeTime) + && Objects.equals(this.priSearchPointInTimeTotal, other.priSearchPointInTimeTotal) + && Objects.equals(this.priSearchQueryCurrent, other.priSearchQueryCurrent) + && Objects.equals(this.priSearchQueryTime, other.priSearchQueryTime) + && Objects.equals(this.priSearchQueryTotal, other.priSearchQueryTotal) + && Objects.equals(this.priSearchScrollCurrent, other.priSearchScrollCurrent) + && Objects.equals(this.priSearchScrollTime, other.priSearchScrollTime) + && Objects.equals(this.priSearchScrollTotal, other.priSearchScrollTotal) + && Objects.equals(this.priSegmentsCount, other.priSegmentsCount) + && Objects.equals(this.priSegmentsFixedBitsetMemory, other.priSegmentsFixedBitsetMemory) + && Objects.equals(this.priSegmentsIndexWriterMemory, other.priSegmentsIndexWriterMemory) + && Objects.equals(this.priSegmentsMemory, other.priSegmentsMemory) + && Objects.equals(this.priSegmentsVersionMapMemory, other.priSegmentsVersionMapMemory) + && Objects.equals(this.priStoreSize, other.priStoreSize) + && Objects.equals(this.priSuggestCurrent, other.priSuggestCurrent) + && Objects.equals(this.priSuggestTime, other.priSuggestTime) + && Objects.equals(this.priSuggestTotal, other.priSuggestTotal) + && Objects.equals(this.priWarmerCurrent, other.priWarmerCurrent) + && Objects.equals(this.priWarmerTotal, other.priWarmerTotal) + && Objects.equals(this.priWarmerTotalTime, other.priWarmerTotalTime) + && Objects.equals(this.queryCacheEvictions, other.queryCacheEvictions) + && Objects.equals(this.queryCacheMemorySize, other.queryCacheMemorySize) + && Objects.equals(this.refreshExternalTime, other.refreshExternalTime) + && Objects.equals(this.refreshExternalTotal, other.refreshExternalTotal) + && Objects.equals(this.refreshListeners, other.refreshListeners) + && Objects.equals(this.refreshTime, other.refreshTime) + && Objects.equals(this.refreshTotal, other.refreshTotal) + && Objects.equals(this.rep, other.rep) + && Objects.equals(this.requestCacheEvictions, other.requestCacheEvictions) + && Objects.equals(this.requestCacheHitCount, other.requestCacheHitCount) + && Objects.equals(this.requestCacheMemorySize, other.requestCacheMemorySize) + && Objects.equals(this.requestCacheMissCount, other.requestCacheMissCount) + && Objects.equals(this.searchConcurrentAvgSliceCount, other.searchConcurrentAvgSliceCount) + && Objects.equals(this.searchConcurrentQueryCurrent, other.searchConcurrentQueryCurrent) + && Objects.equals(this.searchConcurrentQueryTime, other.searchConcurrentQueryTime) + && Objects.equals(this.searchConcurrentQueryTotal, other.searchConcurrentQueryTotal) + && Objects.equals(this.searchFetchCurrent, other.searchFetchCurrent) + && Objects.equals(this.searchFetchTime, other.searchFetchTime) + && Objects.equals(this.searchFetchTotal, other.searchFetchTotal) + && Objects.equals(this.searchOpenContexts, other.searchOpenContexts) + && Objects.equals(this.searchPointInTimeCurrent, other.searchPointInTimeCurrent) + && Objects.equals(this.searchPointInTimeTime, other.searchPointInTimeTime) + && Objects.equals(this.searchPointInTimeTotal, other.searchPointInTimeTotal) + && Objects.equals(this.searchQueryCurrent, other.searchQueryCurrent) + && Objects.equals(this.searchQueryTime, other.searchQueryTime) + && Objects.equals(this.searchQueryTotal, other.searchQueryTotal) + && Objects.equals(this.searchScrollCurrent, other.searchScrollCurrent) + && Objects.equals(this.searchScrollTime, other.searchScrollTime) + && Objects.equals(this.searchScrollTotal, other.searchScrollTotal) + && Objects.equals(this.searchThrottled, other.searchThrottled) + && Objects.equals(this.segmentsCount, other.segmentsCount) + && Objects.equals(this.segmentsFixedBitsetMemory, other.segmentsFixedBitsetMemory) + && Objects.equals(this.segmentsIndexWriterMemory, other.segmentsIndexWriterMemory) + && Objects.equals(this.segmentsMemory, other.segmentsMemory) + && Objects.equals(this.segmentsVersionMapMemory, other.segmentsVersionMapMemory) + && Objects.equals(this.status, other.status) + && Objects.equals(this.storeSize, other.storeSize) + && Objects.equals(this.suggestCurrent, other.suggestCurrent) + && Objects.equals(this.suggestTime, other.suggestTime) + && Objects.equals(this.suggestTotal, other.suggestTotal) + && Objects.equals(this.uuid, other.uuid) + && Objects.equals(this.warmerCurrent, other.warmerCurrent) + && Objects.equals(this.warmerTotal, other.warmerTotal) + && Objects.equals(this.warmerTotalTime, other.warmerTotalTime); } - } diff --git a/java-client/src/main/java/org/opensearch/client/opensearch/cat/IndicesRequest.java b/java-client/src/main/java/org/opensearch/client/opensearch/cat/IndicesRequest.java deleted file mode 100644 index e2020e6070..0000000000 --- a/java-client/src/main/java/org/opensearch/client/opensearch/cat/IndicesRequest.java +++ /dev/null @@ -1,349 +0,0 @@ -/* - * SPDX-License-Identifier: Apache-2.0 - * - * The OpenSearch Contributors require contributions made to - * this file be licensed under the Apache-2.0 license or a - * compatible open source license. - */ - -/* - * Licensed to Elasticsearch B.V. under one or more contributor - * license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright - * ownership. Elasticsearch B.V. licenses this file to you under - * the Apache License, Version 2.0 (the "License"); you may - * not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -/* - * Modifications Copyright OpenSearch Contributors. See - * GitHub history for details. - */ - -package org.opensearch.client.opensearch.cat; - -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.function.Function; -import java.util.stream.Collectors; -import javax.annotation.Nullable; -import org.opensearch.client.opensearch._types.Bytes; -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.transport.Endpoint; -import org.opensearch.client.transport.endpoints.SimpleEndpoint; -import org.opensearch.client.util.ApiTypeHelper; -import org.opensearch.client.util.ObjectBuilder; - -// typedef: cat.indices.Request - -/** - * Returns information about indices: number of primaries and replicas, document - * counts, disk size, ... - */ - -public class IndicesRequest extends CatRequestBase { - @Nullable - private final Bytes bytes; - - private final List expandWildcards; - - @Nullable - private final HealthStatus health; - - @Nullable - private final Boolean includeUnloadedSegments; - - private final List index; - - @Nullable - private final Boolean pri; - - // --------------------------------------------------------------------------------------------- - - private IndicesRequest(Builder builder) { - super(builder); - this.bytes = builder.bytes; - this.expandWildcards = ApiTypeHelper.unmodifiable(builder.expandWildcards); - this.health = builder.health; - this.includeUnloadedSegments = builder.includeUnloadedSegments; - this.index = ApiTypeHelper.unmodifiable(builder.index); - this.pri = builder.pri; - } - - public static IndicesRequest of(Function> fn) { - return fn.apply(new Builder()).build(); - } - - /** - * The unit in which to display byte values - *

- * API name: {@code bytes} - */ - @Nullable - public final Bytes bytes() { - return this.bytes; - } - - /** - * Whether to expand wildcard expression to concrete indices that are open, - * closed or both. - *

- * API name: {@code expand_wildcards} - */ - public final List expandWildcards() { - return this.expandWildcards; - } - - /** - * A health status ("green", "yellow", or "red" to - * filter only indices matching the specified health status - *

- * API name: {@code health} - */ - @Nullable - public final HealthStatus health() { - return this.health; - } - - /** - * If set to true segment stats will include stats for segments that are not - * currently loaded into memory - *

- * API name: {@code include_unloaded_segments} - */ - @Nullable - public final Boolean includeUnloadedSegments() { - return this.includeUnloadedSegments; - } - - /** - * A comma-separated list of index names to limit the returned information - *

- * API name: {@code index} - */ - public final List index() { - return this.index; - } - - /** - * Set to true to return stats only for primary shards - *

- * API name: {@code pri} - */ - @Nullable - public final Boolean pri() { - return this.pri; - } - - // --------------------------------------------------------------------------------------------- - - /** - * Builder for {@link IndicesRequest}. - */ - - public static class Builder extends CatRequestBaseBuilder { - @Nullable - private Bytes bytes; - - @Nullable - private List expandWildcards; - - @Nullable - private HealthStatus health; - - @Nullable - private Boolean includeUnloadedSegments; - - @Nullable - private List index; - - @Nullable - private Boolean pri; - - /** - * The unit in which to display byte values - *

- * API name: {@code bytes} - */ - public final Builder bytes(@Nullable Bytes value) { - this.bytes = value; - return this; - } - - /** - * Whether to expand wildcard expression to concrete indices that are open, - * closed or both. - *

- * API name: {@code expand_wildcards} - *

- * Adds all elements of list to expandWildcards. - */ - 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. - *

- * API name: {@code expand_wildcards} - *

- * Adds one or more values to expandWildcards. - */ - public final Builder expandWildcards(ExpandWildcard value, ExpandWildcard... values) { - this.expandWildcards = _listAdd(this.expandWildcards, value, values); - return this; - } - - /** - * A health status ("green", "yellow", or "red" to - * filter only indices matching the specified health status - *

- * API name: {@code health} - */ - public final Builder health(@Nullable HealthStatus value) { - this.health = value; - return this; - } - - /** - * If set to true segment stats will include stats for segments that are not - * currently loaded into memory - *

- * API name: {@code include_unloaded_segments} - */ - public final Builder includeUnloadedSegments(@Nullable Boolean value) { - this.includeUnloadedSegments = value; - return this; - } - - /** - * A comma-separated list of index names to limit the returned information - *

- * API name: {@code index} - *

- * Adds all elements of list to index. - */ - public final Builder index(List list) { - this.index = _listAddAll(this.index, list); - return this; - } - - /** - * A comma-separated list of index names to limit the returned information - *

- * API name: {@code index} - *

- * Adds one or more values to index. - */ - public final Builder index(String value, String... values) { - this.index = _listAdd(this.index, value, values); - return this; - } - - /** - * Set to true to return stats only for primary shards - *

- * API name: {@code pri} - */ - public final Builder pri(@Nullable Boolean value) { - this.pri = value; - return this; - } - - @Override - protected Builder self() { - return this; - } - - /** - * Builds a {@link IndicesRequest}. - * - * @throws NullPointerException if some of the required fields are null. - */ - public IndicesRequest build() { - _checkSingleUse(); - - return new IndicesRequest(this); - } - } - - // --------------------------------------------------------------------------------------------- - - /** - * Endpoint "{@code cat.indices}". - */ - public static final Endpoint _ENDPOINT = new SimpleEndpoint<>( - - // Request method - request -> { - return "GET"; - - }, - - // Request path - request -> { - final int _index = 1 << 0; - - int propsSet = 0; - - if (ApiTypeHelper.isDefined(request.index())) propsSet |= _index; - - if (propsSet == 0) { - StringBuilder buf = new StringBuilder(); - buf.append("/_cat"); - buf.append("/indices"); - return buf.toString(); - } - if (propsSet == (_index)) { - StringBuilder buf = new StringBuilder(); - buf.append("/_cat"); - buf.append("/indices"); - buf.append("/"); - SimpleEndpoint.pathEncode(request.index.stream().map(v -> v).collect(Collectors.joining(",")), buf); - return buf.toString(); - } - throw SimpleEndpoint.noPathTemplateFound("path"); - - }, - - // Request parameters - request -> { - Map params = new HashMap<>(request.queryParameters()); - if (ApiTypeHelper.isDefined(request.expandWildcards)) { - params.put("expand_wildcards", request.expandWildcards.stream().map(v -> v.jsonValue()).collect(Collectors.joining(","))); - } - if (request.bytes != null) { - params.put("bytes", request.bytes.jsonValue()); - } - if (request.pri != null) { - params.put("pri", String.valueOf(request.pri)); - } - if (request.health != null) { - params.put("health", request.health.jsonValue()); - } - if (request.includeUnloadedSegments != null) { - params.put("include_unloaded_segments", String.valueOf(request.includeUnloadedSegments)); - } - return params; - - }, - SimpleEndpoint.emptyMap(), - false, - IndicesResponse._DESERIALIZER - ); -} diff --git a/java-client/src/main/java/org/opensearch/client/opensearch/cat/OpenSearchCatAsyncClient.java b/java-client/src/main/java/org/opensearch/client/opensearch/cat/OpenSearchCatAsyncClient.java index 717fca4bd4..e4f237320e 100644 --- a/java-client/src/main/java/org/opensearch/client/opensearch/cat/OpenSearchCatAsyncClient.java +++ b/java-client/src/main/java/org/opensearch/client/opensearch/cat/OpenSearchCatAsyncClient.java @@ -72,51 +72,6 @@ public CompletableFuture help() throws IOException, OpenSearchExce return this.transport.performRequestAsync(HelpRequest._INSTANCE, HelpRequest._ENDPOINT, this.transportOptions); } - // ----- Endpoint: cat.indices - - /** - * Returns information about indices: number of primaries and replicas, document - * counts, disk size, ... - * - * - */ - - public CompletableFuture indices(IndicesRequest request) throws IOException, OpenSearchException { - @SuppressWarnings("unchecked") - JsonEndpoint endpoint = (JsonEndpoint< - IndicesRequest, - IndicesResponse, - ErrorResponse>) IndicesRequest._ENDPOINT; - - return this.transport.performRequestAsync(request, endpoint, this.transportOptions); - } - - /** - * Returns information about indices: number of primaries and replicas, document - * counts, disk size, ... - * - * @param fn - * a function that initializes a builder to create the - * {@link IndicesRequest} - * - */ - - public final CompletableFuture indices(Function> fn) - throws IOException, OpenSearchException { - return indices(fn.apply(new IndicesRequest.Builder()).build()); - } - - /** - * Returns information about indices: number of primaries and replicas, document - * counts, disk size, ... - * - * - */ - - public CompletableFuture indices() throws IOException, OpenSearchException { - return this.transport.performRequestAsync(new IndicesRequest.Builder().build(), IndicesRequest._ENDPOINT, this.transportOptions); - } - // ----- Endpoint: cat.nodeattrs /** diff --git a/java-client/src/main/java/org/opensearch/client/opensearch/cat/OpenSearchCatClient.java b/java-client/src/main/java/org/opensearch/client/opensearch/cat/OpenSearchCatClient.java index 4505952bfc..88ef1d791b 100644 --- a/java-client/src/main/java/org/opensearch/client/opensearch/cat/OpenSearchCatClient.java +++ b/java-client/src/main/java/org/opensearch/client/opensearch/cat/OpenSearchCatClient.java @@ -71,51 +71,6 @@ public HelpResponse help() throws IOException, OpenSearchException { return this.transport.performRequest(HelpRequest._INSTANCE, HelpRequest._ENDPOINT, this.transportOptions); } - // ----- Endpoint: cat.indices - - /** - * Returns information about indices: number of primaries and replicas, document - * counts, disk size, ... - * - * - */ - - public IndicesResponse indices(IndicesRequest request) throws IOException, OpenSearchException { - @SuppressWarnings("unchecked") - JsonEndpoint endpoint = (JsonEndpoint< - IndicesRequest, - IndicesResponse, - ErrorResponse>) IndicesRequest._ENDPOINT; - - return this.transport.performRequest(request, endpoint, this.transportOptions); - } - - /** - * Returns information about indices: number of primaries and replicas, document - * counts, disk size, ... - * - * @param fn - * a function that initializes a builder to create the - * {@link IndicesRequest} - * - */ - - public final IndicesResponse indices(Function> fn) throws IOException, - OpenSearchException { - return indices(fn.apply(new IndicesRequest.Builder()).build()); - } - - /** - * Returns information about indices: number of primaries and replicas, document - * counts, disk size, ... - * - * - */ - - public IndicesResponse indices() throws IOException, OpenSearchException { - return this.transport.performRequest(new IndicesRequest.Builder().build(), IndicesRequest._ENDPOINT, this.transportOptions); - } - // ----- Endpoint: cat.nodeattrs /** diff --git a/java-codegen/src/main/java/org/opensearch/client/codegen/CodeGenerator.java b/java-codegen/src/main/java/org/opensearch/client/codegen/CodeGenerator.java index f12c551062..87bfa2f5d2 100644 --- a/java-codegen/src/main/java/org/opensearch/client/codegen/CodeGenerator.java +++ b/java-codegen/src/main/java/org/opensearch/client/codegen/CodeGenerator.java @@ -48,7 +48,10 @@ public class CodeGenerator { private static final Logger LOGGER = LogManager.getLogger(); private static final Matcher OPERATION_MATCHER = or( and(namespace(isNull()), name(is("info"))), - and(namespace(is("cat")), name(isOneOf("aliases", "allocation", "cluster_manager", "count", "fielddata", "health", "master"))), + and( + namespace(is("cat")), + name(isOneOf("aliases", "allocation", "cluster_manager", "count", "fielddata", "health", "indices", "master")) + ), and( namespace(is("cluster")), name( From 3b7e366a98322e4da35eafadcff93cdaaa6bbec9 Mon Sep 17 00:00:00 2001 From: Thomas Farr Date: Tue, 7 Jan 2025 17:18:42 +1300 Subject: [PATCH 08/18] Generate cat.nodeattrs Signed-off-by: Thomas Farr --- .../opensearch/cat/NodeattrsRequest.java | 262 ++++++++++++++ .../opensearch/cat/NodeattrsResponse.java | 74 ++-- .../cat/OpenSearchCatAsyncClientBase.java | 26 ++ .../cat/OpenSearchCatClientBase.java | 26 ++ .../cat/nodeattrs/NodeAttributesRecord.java | 323 +++++++++++------- .../opensearch/cat/NodeattrsRequest.java | 79 ----- .../cat/OpenSearchCatAsyncClient.java | 11 - .../opensearch/cat/OpenSearchCatClient.java | 11 - .../client/codegen/CodeGenerator.java | 2 +- 9 files changed, 576 insertions(+), 238 deletions(-) create mode 100644 java-client/src/generated/java/org/opensearch/client/opensearch/cat/NodeattrsRequest.java rename java-client/src/{main => generated}/java/org/opensearch/client/opensearch/cat/NodeattrsResponse.java (75%) rename java-client/src/{main => generated}/java/org/opensearch/client/opensearch/cat/nodeattrs/NodeAttributesRecord.java (69%) delete mode 100644 java-client/src/main/java/org/opensearch/client/opensearch/cat/NodeattrsRequest.java diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/cat/NodeattrsRequest.java b/java-client/src/generated/java/org/opensearch/client/opensearch/cat/NodeattrsRequest.java new file mode 100644 index 0000000000..028681d51d --- /dev/null +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/cat/NodeattrsRequest.java @@ -0,0 +1,262 @@ +/* + * SPDX-License-Identifier: Apache-2.0 + * + * The OpenSearch Contributors require contributions made to + * this file be licensed under the Apache-2.0 license or a + * compatible open source license. + */ + +/* + * Licensed to Elasticsearch B.V. under one or more contributor + * license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright + * ownership. Elasticsearch B.V. licenses this file to you under + * the Apache License, Version 2.0 (the "License"); you may + * not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +/* + * Modifications Copyright OpenSearch Contributors. See + * GitHub history for details. + */ + +//---------------------------------------------------- +// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. +//---------------------------------------------------- + +package org.opensearch.client.opensearch.cat; + +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.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.ToCopyableBuilder; + +// typedef: cat.nodeattrs.Request + +/** + * Returns information about custom node attributes. + */ +@Generated("org.opensearch.client.codegen.CodeGenerator") +public final class NodeattrsRequest extends CatRequestBase implements ToCopyableBuilder { + + @Nullable + private final Time clusterManagerTimeout; + + @Deprecated + @Nullable + private final Time masterTimeout; + + // --------------------------------------------------------------------------------------------- + + private NodeattrsRequest(Builder builder) { + super(builder); + this.clusterManagerTimeout = builder.clusterManagerTimeout; + this.masterTimeout = builder.masterTimeout; + } + + public static NodeattrsRequest of(Function> fn) { + return fn.apply(new Builder()).build(); + } + + /** + * The amount of time allowed to establish a connection to the cluster manager node. + *

+ * API name: {@code cluster_manager_timeout} + *

+ */ + @Nullable + public final Time clusterManagerTimeout() { + return this.clusterManagerTimeout; + } + + /** + * The amount of time allowed to establish a connection to the cluster manager node. + *

+ * API name: {@code master_timeout} + *

+ */ + @Deprecated + @Nullable + public final Time masterTimeout() { + return this.masterTimeout; + } + + // --------------------------------------------------------------------------------------------- + + @Override + @Nonnull + public Builder toBuilder() { + return new Builder(this); + } + + @Nonnull + public static Builder builder() { + return new Builder(); + } + + /** + * Builder for {@link NodeattrsRequest}. + */ + public static class Builder extends CatRequestBase.AbstractBuilder implements CopyableBuilder { + @Nullable + private Time clusterManagerTimeout; + @Nullable + private Time masterTimeout; + + public Builder() {} + + private Builder(NodeattrsRequest o) { + super(o); + this.clusterManagerTimeout = o.clusterManagerTimeout; + this.masterTimeout = o.masterTimeout; + } + + private Builder(Builder o) { + super(o); + this.clusterManagerTimeout = o.clusterManagerTimeout; + this.masterTimeout = o.masterTimeout; + } + + @Override + @Nonnull + public Builder copy() { + return new Builder(this); + } + + @Override + @Nonnull + protected Builder self() { + return this; + } + + /** + * The amount of time allowed to establish a connection to the cluster manager node. + *

+ * API name: {@code cluster_manager_timeout} + *

+ */ + @Nonnull + public final Builder clusterManagerTimeout(@Nullable Time value) { + this.clusterManagerTimeout = value; + return this; + } + + /** + * The amount of time allowed to establish a connection to the cluster manager node. + *

+ * API name: {@code cluster_manager_timeout} + *

+ */ + @Nonnull + public final Builder clusterManagerTimeout(Function> fn) { + return clusterManagerTimeout(fn.apply(new Time.Builder()).build()); + } + + /** + * The amount of time allowed to establish a connection to the cluster manager node. + *

+ * API name: {@code master_timeout} + *

+ */ + @Deprecated + @Nonnull + public final Builder masterTimeout(@Nullable Time value) { + this.masterTimeout = value; + return this; + } + + /** + * The amount of time allowed to establish a connection to the cluster manager node. + *

+ * API name: {@code master_timeout} + *

+ */ + @Deprecated + @Nonnull + public final Builder masterTimeout(Function> fn) { + return masterTimeout(fn.apply(new Time.Builder()).build()); + } + + /** + * Builds a {@link NodeattrsRequest}. + * + * @throws NullPointerException if some of the required fields are null. + */ + @Override + @Nonnull + public NodeattrsRequest build() { + _checkSingleUse(); + + return new NodeattrsRequest(this); + } + } + + // --------------------------------------------------------------------------------------------- + + @Override + protected void applyQueryParameters(@Nonnull Map params) { + super.applyQueryParameters(params); + if (this.clusterManagerTimeout != null) { + params.put("cluster_manager_timeout", this.clusterManagerTimeout._toJsonString()); + } + if (this.masterTimeout != null) { + params.put("master_timeout", this.masterTimeout._toJsonString()); + } + } + + /** + * Endpoint "{@code cat.nodeattrs}". + */ + public static final Endpoint _ENDPOINT = new SimpleEndpoint<>( + // Request method + request -> "GET", + // Request path + request -> "/_cat/nodeattrs", + // Request parameters + request -> { + Map params = new HashMap<>(); + request.applyQueryParameters(params); + return params; + }, + SimpleEndpoint.emptyMap(), + false, + NodeattrsResponse._DESERIALIZER + ); + + @Override + public int hashCode() { + int result = 17; + result = 31 * result + Objects.hashCode(this.clusterManagerTimeout); + result = 31 * result + Objects.hashCode(this.masterTimeout); + return result; + } + + @Override + public boolean equals(Object o) { + if (this == o) return true; + if (o == null || this.getClass() != o.getClass()) return false; + NodeattrsRequest other = (NodeattrsRequest) o; + return Objects.equals(this.clusterManagerTimeout, other.clusterManagerTimeout) + && Objects.equals(this.masterTimeout, other.masterTimeout); + } +} diff --git a/java-client/src/main/java/org/opensearch/client/opensearch/cat/NodeattrsResponse.java b/java-client/src/generated/java/org/opensearch/client/opensearch/cat/NodeattrsResponse.java similarity index 75% rename from java-client/src/main/java/org/opensearch/client/opensearch/cat/NodeattrsResponse.java rename to java-client/src/generated/java/org/opensearch/client/opensearch/cat/NodeattrsResponse.java index dd336e44df..ddaa825887 100644 --- a/java-client/src/main/java/org/opensearch/client/opensearch/cat/NodeattrsResponse.java +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/cat/NodeattrsResponse.java @@ -30,43 +30,51 @@ * GitHub history for details. */ +//---------------------------------------------------- +// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. +//---------------------------------------------------- + package org.opensearch.client.opensearch.cat; 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; import org.opensearch.client.json.PlainJsonSerializable; import org.opensearch.client.opensearch.cat.nodeattrs.NodeAttributesRecord; 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: cat.nodeattrs.Response @JsonpDeserializable -public class NodeattrsResponse implements PlainJsonSerializable { +@Generated("org.opensearch.client.codegen.CodeGenerator") +public class NodeattrsResponse implements PlainJsonSerializable, ToCopyableBuilder { + + @Nonnull private final List valueBody; // --------------------------------------------------------------------------------------------- private NodeattrsResponse(Builder builder) { - this.valueBody = ApiTypeHelper.unmodifiableRequired(builder.valueBody, this, "valueBody"); - } - public static NodeattrsResponse of(Function> fn) { + public static NodeattrsResponse of(Function> fn) { return fn.apply(new Builder()).build(); } /** * Required - Response value. - *

- * API name: {@code _value_body} */ + @Nonnull public final List valueBody() { return this.valueBody; } @@ -78,28 +86,53 @@ public void serialize(JsonGenerator generator, JsonpMapper mapper) { generator.writeStartArray(); for (NodeAttributesRecord item0 : this.valueBody) { 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 NodeattrsResponse}. */ - - public static class Builder extends ObjectBuilderBase implements ObjectBuilder { + public static class Builder extends ObjectBuilderBase implements CopyableBuilder { private List valueBody; + public Builder() {} + + private Builder(NodeattrsResponse o) { + this.valueBody = _listCopy(o.valueBody); + } + + private Builder(Builder o) { + this.valueBody = _listCopy(o.valueBody); + } + + @Override + @Nonnull + public Builder copy() { + return new Builder(this); + } + /** * Required - Response value. - *

- * API name: {@code _value_body} + * *

* Adds all elements of list to valueBody. + *

*/ + @Nonnull public final Builder valueBody(List list) { this.valueBody = _listAddAll(this.valueBody, list); return this; @@ -107,11 +140,12 @@ public final Builder valueBody(List list) { /** * Required - Response value. - *

- * API name: {@code _value_body} + * *

* Adds one or more values to valueBody. + *

*/ + @Nonnull public final Builder valueBody(NodeAttributesRecord value, NodeAttributesRecord... values) { this.valueBody = _listAdd(this.valueBody, value, values); return this; @@ -119,11 +153,12 @@ public final Builder valueBody(NodeAttributesRecord value, NodeAttributesRecord. /** * Required - Response value. - *

- * API name: {@code _value_body} + * *

* Adds a value to valueBody using a builder lambda. + *

*/ + @Nonnull public final Builder valueBody(Function> fn) { return valueBody(fn.apply(new NodeAttributesRecord.Builder()).build()); } @@ -131,9 +166,10 @@ public final Builder valueBody(Function _DESERIALIZER = createNodeattrsResponseDeserializer(); protected static JsonpDeserializer createNodeattrsResponseDeserializer() { - JsonpDeserializer> valueDeserializer = JsonpDeserializer.arrayDeserializer( NodeAttributesRecord._DESERIALIZER ); @@ -154,5 +189,4 @@ protected static JsonpDeserializer createNodeattrsResponseDes (parser, mapper) -> new Builder().valueBody(valueDeserializer.deserialize(parser, mapper)).build() ); } - } diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/cat/OpenSearchCatAsyncClientBase.java b/java-client/src/generated/java/org/opensearch/client/opensearch/cat/OpenSearchCatAsyncClientBase.java index 2b1b38631a..02ac7bdbb5 100644 --- a/java-client/src/generated/java/org/opensearch/client/opensearch/cat/OpenSearchCatAsyncClientBase.java +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/cat/OpenSearchCatAsyncClientBase.java @@ -272,4 +272,30 @@ public final CompletableFuture master(Function master() throws IOException, OpenSearchException { return master(new MasterRequest.Builder().build()); } + + // ----- Endpoint: cat.nodeattrs + + /** + * Returns information about custom node attributes. + */ + public CompletableFuture nodeattrs(NodeattrsRequest request) throws IOException, OpenSearchException { + return this.transport.performRequestAsync(request, NodeattrsRequest._ENDPOINT, this.transportOptions); + } + + /** + * Returns information about custom node attributes. + * + * @param fn a function that initializes a builder to create the {@link NodeattrsRequest} + */ + public final CompletableFuture nodeattrs(Function> fn) + throws IOException, OpenSearchException { + return nodeattrs(fn.apply(new NodeattrsRequest.Builder()).build()); + } + + /** + * Returns information about custom node attributes. + */ + public final CompletableFuture nodeattrs() throws IOException, OpenSearchException { + return nodeattrs(new NodeattrsRequest.Builder().build()); + } } diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/cat/OpenSearchCatClientBase.java b/java-client/src/generated/java/org/opensearch/client/opensearch/cat/OpenSearchCatClientBase.java index cdc069fff4..6aee3da47e 100644 --- a/java-client/src/generated/java/org/opensearch/client/opensearch/cat/OpenSearchCatClientBase.java +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/cat/OpenSearchCatClientBase.java @@ -268,4 +268,30 @@ public final MasterResponse master(Function> fn) throws IOException, + OpenSearchException { + return nodeattrs(fn.apply(new NodeattrsRequest.Builder()).build()); + } + + /** + * Returns information about custom node attributes. + */ + public final NodeattrsResponse nodeattrs() throws IOException, OpenSearchException { + return nodeattrs(new NodeattrsRequest.Builder().build()); + } } diff --git a/java-client/src/main/java/org/opensearch/client/opensearch/cat/nodeattrs/NodeAttributesRecord.java b/java-client/src/generated/java/org/opensearch/client/opensearch/cat/nodeattrs/NodeAttributesRecord.java similarity index 69% rename from java-client/src/main/java/org/opensearch/client/opensearch/cat/nodeattrs/NodeAttributesRecord.java rename to java-client/src/generated/java/org/opensearch/client/opensearch/cat/nodeattrs/NodeAttributesRecord.java index cc1a3185b1..49ffacea67 100644 --- a/java-client/src/main/java/org/opensearch/client/opensearch/cat/nodeattrs/NodeAttributesRecord.java +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/cat/nodeattrs/NodeAttributesRecord.java @@ -30,10 +30,17 @@ * GitHub history for details. */ +//---------------------------------------------------- +// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. +//---------------------------------------------------- + package org.opensearch.client.opensearch.cat.nodeattrs; import jakarta.json.stream.JsonGenerator; +import java.util.Objects; import java.util.function.Function; +import javax.annotation.Generated; +import javax.annotation.Nonnull; import javax.annotation.Nullable; import org.opensearch.client.json.JsonpDeserializable; import org.opensearch.client.json.JsonpDeserializer; @@ -41,33 +48,37 @@ import org.opensearch.client.json.ObjectBuilderDeserializer; import org.opensearch.client.json.ObjectDeserializer; import org.opensearch.client.json.PlainJsonSerializable; +import org.opensearch.client.util.CopyableBuilder; import org.opensearch.client.util.ObjectBuilder; import org.opensearch.client.util.ObjectBuilderBase; +import org.opensearch.client.util.ToCopyableBuilder; // typedef: cat.nodeattrs.NodeAttributesRecord @JsonpDeserializable -public class NodeAttributesRecord implements PlainJsonSerializable { - @Nullable - private final String node; +@Generated("org.opensearch.client.codegen.CodeGenerator") +public class NodeAttributesRecord implements PlainJsonSerializable, ToCopyableBuilder { @Nullable - private final String id; + private final String attr; @Nullable - private final String pid; + private final String host; @Nullable - private final String host; + private final String id; @Nullable private final String ip; @Nullable - private final String port; + private final String node; @Nullable - private final String attr; + private final String pid; + + @Nullable + private final String port; @Nullable private final String value; @@ -75,96 +86,102 @@ public class NodeAttributesRecord implements PlainJsonSerializable { // --------------------------------------------------------------------------------------------- private NodeAttributesRecord(Builder builder) { - - this.node = builder.node; - this.id = builder.id; - this.pid = builder.pid; + this.attr = builder.attr; this.host = builder.host; + this.id = builder.id; this.ip = builder.ip; + this.node = builder.node; + this.pid = builder.pid; this.port = builder.port; - this.attr = builder.attr; this.value = builder.value; - } - public static NodeAttributesRecord of(Function> fn) { + public static NodeAttributesRecord of(Function> fn) { return fn.apply(new Builder()).build(); } /** - * node name + * The attribute name. *

- * API name: {@code node} + * API name: {@code attr} + *

*/ @Nullable - public final String node() { - return this.node; + public final String attr() { + return this.attr; } /** - * unique node id + * The hostname. *

- * API name: {@code id} + * API name: {@code host} + *

*/ @Nullable - public final String id() { - return this.id; + public final String host() { + return this.host; } /** - * process id + * The unique node identifier. *

- * API name: {@code pid} + * API name: {@code id} + *

*/ @Nullable - public final String pid() { - return this.pid; + public final String id() { + return this.id; } /** - * host name + * The IP address. *

- * API name: {@code host} + * API name: {@code ip} + *

*/ @Nullable - public final String host() { - return this.host; + public final String ip() { + return this.ip; } /** - * ip address + * The node name. *

- * API name: {@code ip} + * API name: {@code node} + *

*/ @Nullable - public final String ip() { - return this.ip; + public final String node() { + return this.node; } /** - * bound transport port + * The process identifier. *

- * API name: {@code port} + * API name: {@code pid} + *

*/ @Nullable - public final String port() { - return this.port; + public final String pid() { + return this.pid; } /** - * attribute description + * The bound transport port. *

- * API name: {@code attr} + * API name: {@code port} + *

*/ @Nullable - public final String attr() { - return this.attr; + public final String port() { + return this.port; } /** - * attribute value + * The attribute value. *

* API name: {@code value} + *

*/ @Nullable public final String value() { @@ -174,6 +191,7 @@ public final String value() { /** * Serialize this object to JSON. */ + @Override public void serialize(JsonGenerator generator, JsonpMapper mapper) { generator.writeStartObject(); serializeInternal(generator, mapper); @@ -181,156 +199,202 @@ public void serialize(JsonGenerator generator, JsonpMapper mapper) { } protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { - - if (this.node != null) { - generator.writeKey("node"); - generator.write(this.node); - + if (this.attr != null) { + generator.writeKey("attr"); + generator.write(this.attr); } - if (this.id != null) { - generator.writeKey("id"); - generator.write(this.id); - } - if (this.pid != null) { - generator.writeKey("pid"); - generator.write(this.pid); - - } if (this.host != null) { generator.writeKey("host"); generator.write(this.host); + } + if (this.id != null) { + generator.writeKey("id"); + generator.write(this.id); } + if (this.ip != null) { generator.writeKey("ip"); generator.write(this.ip); + } + + if (this.node != null) { + generator.writeKey("node"); + generator.write(this.node); + } + if (this.pid != null) { + generator.writeKey("pid"); + generator.write(this.pid); } + if (this.port != null) { generator.writeKey("port"); generator.write(this.port); - } - if (this.attr != null) { - generator.writeKey("attr"); - generator.write(this.attr); - } if (this.value != null) { generator.writeKey("value"); generator.write(this.value); - } - } // --------------------------------------------------------------------------------------------- + @Override + @Nonnull + public Builder toBuilder() { + return new Builder(this); + } + + @Nonnull + public static Builder builder() { + return new Builder(); + } + /** * Builder for {@link NodeAttributesRecord}. */ - - public static class Builder extends ObjectBuilderBase implements ObjectBuilder { + public static class Builder extends ObjectBuilderBase implements CopyableBuilder { @Nullable - private String node; - + private String attr; + @Nullable + private String host; @Nullable private String id; - @Nullable - private String pid; - + private String ip; @Nullable - private String host; - + private String node; @Nullable - private String ip; - + private String pid; @Nullable private String port; - - @Nullable - private String attr; - @Nullable private String value; + public Builder() {} + + private Builder(NodeAttributesRecord o) { + this.attr = o.attr; + this.host = o.host; + this.id = o.id; + this.ip = o.ip; + this.node = o.node; + this.pid = o.pid; + this.port = o.port; + this.value = o.value; + } + + private Builder(Builder o) { + this.attr = o.attr; + this.host = o.host; + this.id = o.id; + this.ip = o.ip; + this.node = o.node; + this.pid = o.pid; + this.port = o.port; + this.value = o.value; + } + + @Override + @Nonnull + public Builder copy() { + return new Builder(this); + } + /** - * node name + * The attribute name. *

- * API name: {@code node} + * API name: {@code attr} + *

*/ - public final Builder node(@Nullable String value) { - this.node = value; + @Nonnull + public final Builder attr(@Nullable String value) { + this.attr = value; return this; } /** - * unique node id + * The hostname. *

- * API name: {@code id} + * API name: {@code host} + *

*/ - public final Builder id(@Nullable String value) { - this.id = value; + @Nonnull + public final Builder host(@Nullable String value) { + this.host = value; return this; } /** - * process id + * The unique node identifier. *

- * API name: {@code pid} + * API name: {@code id} + *

*/ - public final Builder pid(@Nullable String value) { - this.pid = value; + @Nonnull + public final Builder id(@Nullable String value) { + this.id = value; return this; } /** - * host name + * The IP address. *

- * API name: {@code host} + * API name: {@code ip} + *

*/ - public final Builder host(@Nullable String value) { - this.host = value; + @Nonnull + public final Builder ip(@Nullable String value) { + this.ip = value; return this; } /** - * ip address + * The node name. *

- * API name: {@code ip} + * API name: {@code node} + *

*/ - public final Builder ip(@Nullable String value) { - this.ip = value; + @Nonnull + public final Builder node(@Nullable String value) { + this.node = value; return this; } /** - * bound transport port + * The process identifier. *

- * API name: {@code port} + * API name: {@code pid} + *

*/ - public final Builder port(@Nullable String value) { - this.port = value; + @Nonnull + public final Builder pid(@Nullable String value) { + this.pid = value; return this; } /** - * attribute description + * The bound transport port. *

- * API name: {@code attr} + * API name: {@code port} + *

*/ - public final Builder attr(@Nullable String value) { - this.attr = value; + @Nonnull + public final Builder port(@Nullable String value) { + this.port = value; return this; } /** - * attribute value + * The attribute value. *

* API name: {@code value} + *

*/ + @Nonnull public final Builder value(@Nullable String value) { this.value = value; return this; @@ -339,9 +403,10 @@ public final Builder value(@Nullable String value) { /** * Builds a {@link NodeAttributesRecord}. * - * @throws NullPointerException - * if some of the required fields are null. + * @throws NullPointerException if some of the required fields are null. */ + @Override + @Nonnull public NodeAttributesRecord build() { _checkSingleUse(); @@ -360,16 +425,42 @@ public NodeAttributesRecord build() { ); protected static void setupNodeAttributesRecordDeserializer(ObjectDeserializer op) { - - op.add(Builder::node, JsonpDeserializer.stringDeserializer(), "node"); + op.add(Builder::attr, JsonpDeserializer.stringDeserializer(), "attr"); + op.add(Builder::host, JsonpDeserializer.stringDeserializer(), "host"); op.add(Builder::id, JsonpDeserializer.stringDeserializer(), "id"); + op.add(Builder::ip, JsonpDeserializer.stringDeserializer(), "ip"); + op.add(Builder::node, JsonpDeserializer.stringDeserializer(), "node"); op.add(Builder::pid, JsonpDeserializer.stringDeserializer(), "pid"); - op.add(Builder::host, JsonpDeserializer.stringDeserializer(), "host", "h"); - op.add(Builder::ip, JsonpDeserializer.stringDeserializer(), "ip", "i"); op.add(Builder::port, JsonpDeserializer.stringDeserializer(), "port"); - op.add(Builder::attr, JsonpDeserializer.stringDeserializer(), "attr"); op.add(Builder::value, JsonpDeserializer.stringDeserializer(), "value"); + } + @Override + public int hashCode() { + int result = 17; + result = 31 * result + Objects.hashCode(this.attr); + result = 31 * result + Objects.hashCode(this.host); + result = 31 * result + Objects.hashCode(this.id); + result = 31 * result + Objects.hashCode(this.ip); + result = 31 * result + Objects.hashCode(this.node); + result = 31 * result + Objects.hashCode(this.pid); + result = 31 * result + Objects.hashCode(this.port); + result = 31 * result + Objects.hashCode(this.value); + return result; } + @Override + public boolean equals(Object o) { + if (this == o) return true; + if (o == null || this.getClass() != o.getClass()) return false; + NodeAttributesRecord other = (NodeAttributesRecord) o; + return Objects.equals(this.attr, other.attr) + && Objects.equals(this.host, other.host) + && Objects.equals(this.id, other.id) + && Objects.equals(this.ip, other.ip) + && Objects.equals(this.node, other.node) + && Objects.equals(this.pid, other.pid) + && Objects.equals(this.port, other.port) + && Objects.equals(this.value, other.value); + } } diff --git a/java-client/src/main/java/org/opensearch/client/opensearch/cat/NodeattrsRequest.java b/java-client/src/main/java/org/opensearch/client/opensearch/cat/NodeattrsRequest.java deleted file mode 100644 index eb4ce34115..0000000000 --- a/java-client/src/main/java/org/opensearch/client/opensearch/cat/NodeattrsRequest.java +++ /dev/null @@ -1,79 +0,0 @@ -/* - * SPDX-License-Identifier: Apache-2.0 - * - * The OpenSearch Contributors require contributions made to - * this file be licensed under the Apache-2.0 license or a - * compatible open source license. - */ - -/* - * Licensed to Elasticsearch B.V. under one or more contributor - * license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright - * ownership. Elasticsearch B.V. licenses this file to you under - * the Apache License, Version 2.0 (the "License"); you may - * not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -/* - * Modifications Copyright OpenSearch Contributors. See - * GitHub history for details. - */ - -package org.opensearch.client.opensearch.cat; - -import java.util.HashMap; -import org.opensearch.client.opensearch._types.ErrorResponse; -import org.opensearch.client.transport.Endpoint; -import org.opensearch.client.transport.endpoints.SimpleEndpoint; - -// typedef: cat.nodeattrs.Request - -/** - * Returns information about custom node attributes. - */ - -public class NodeattrsRequest extends CatRequestBase { - public NodeattrsRequest() {} - - /** - * Singleton instance for {@link NodeattrsRequest}. - */ - public static final NodeattrsRequest _INSTANCE = new NodeattrsRequest(); - - // --------------------------------------------------------------------------------------------- - - /** - * Endpoint "{@code cat.nodeattrs}". - */ - public static final Endpoint _ENDPOINT = new SimpleEndpoint<>( - - // Request method - request -> { - return "GET"; - - }, - - // Request path - request -> { - return "/_cat/nodeattrs"; - - }, - - // Request parameters - request -> new HashMap<>(request.queryParameters()), - SimpleEndpoint.emptyMap(), - false, - NodeattrsResponse._DESERIALIZER - ); -} diff --git a/java-client/src/main/java/org/opensearch/client/opensearch/cat/OpenSearchCatAsyncClient.java b/java-client/src/main/java/org/opensearch/client/opensearch/cat/OpenSearchCatAsyncClient.java index e4f237320e..6ffa69a975 100644 --- a/java-client/src/main/java/org/opensearch/client/opensearch/cat/OpenSearchCatAsyncClient.java +++ b/java-client/src/main/java/org/opensearch/client/opensearch/cat/OpenSearchCatAsyncClient.java @@ -72,17 +72,6 @@ public CompletableFuture help() throws IOException, OpenSearchExce return this.transport.performRequestAsync(HelpRequest._INSTANCE, HelpRequest._ENDPOINT, this.transportOptions); } - // ----- Endpoint: cat.nodeattrs - - /** - * Returns information about custom node attributes. - * - * - */ - public CompletableFuture nodeattrs() throws IOException, OpenSearchException { - return this.transport.performRequestAsync(NodeattrsRequest._INSTANCE, NodeattrsRequest._ENDPOINT, this.transportOptions); - } - // ----- Endpoint: cat.nodes /** diff --git a/java-client/src/main/java/org/opensearch/client/opensearch/cat/OpenSearchCatClient.java b/java-client/src/main/java/org/opensearch/client/opensearch/cat/OpenSearchCatClient.java index 88ef1d791b..6033959821 100644 --- a/java-client/src/main/java/org/opensearch/client/opensearch/cat/OpenSearchCatClient.java +++ b/java-client/src/main/java/org/opensearch/client/opensearch/cat/OpenSearchCatClient.java @@ -71,17 +71,6 @@ public HelpResponse help() throws IOException, OpenSearchException { return this.transport.performRequest(HelpRequest._INSTANCE, HelpRequest._ENDPOINT, this.transportOptions); } - // ----- Endpoint: cat.nodeattrs - - /** - * Returns information about custom node attributes. - * - * - */ - public NodeattrsResponse nodeattrs() throws IOException, OpenSearchException { - return this.transport.performRequest(NodeattrsRequest._INSTANCE, NodeattrsRequest._ENDPOINT, this.transportOptions); - } - // ----- Endpoint: cat.nodes /** diff --git a/java-codegen/src/main/java/org/opensearch/client/codegen/CodeGenerator.java b/java-codegen/src/main/java/org/opensearch/client/codegen/CodeGenerator.java index 87bfa2f5d2..2c55e62939 100644 --- a/java-codegen/src/main/java/org/opensearch/client/codegen/CodeGenerator.java +++ b/java-codegen/src/main/java/org/opensearch/client/codegen/CodeGenerator.java @@ -50,7 +50,7 @@ public class CodeGenerator { and(namespace(isNull()), name(is("info"))), and( namespace(is("cat")), - name(isOneOf("aliases", "allocation", "cluster_manager", "count", "fielddata", "health", "indices", "master")) + name(isOneOf("aliases", "allocation", "cluster_manager", "count", "fielddata", "health", "indices", "master", "nodeattrs")) ), and( namespace(is("cluster")), From 17ece309cb2b3750bfac9f1c859e2ec16caf28e9 Mon Sep 17 00:00:00 2001 From: Thomas Farr Date: Tue, 7 Jan 2025 21:51:05 +1300 Subject: [PATCH 09/18] Generate cat.nodes Signed-off-by: Thomas Farr --- .../client/opensearch/cat/NodesRequest.java | 374 ++ .../client/opensearch/cat/NodesResponse.java | 74 +- .../cat/OpenSearchCatAsyncClientBase.java | 26 + .../cat/OpenSearchCatClientBase.java | 26 + .../opensearch/cat/nodes/NodesRecord.java | 3729 ++++++++++------- .../client/opensearch/cat/NodesRequest.java | 176 - .../cat/OpenSearchCatAsyncClient.java | 42 - .../opensearch/cat/OpenSearchCatClient.java | 42 - java-codegen/opensearch-openapi.yaml | 4 +- .../client/codegen/CodeGenerator.java | 15 +- 10 files changed, 2740 insertions(+), 1768 deletions(-) create mode 100644 java-client/src/generated/java/org/opensearch/client/opensearch/cat/NodesRequest.java rename java-client/src/{main => generated}/java/org/opensearch/client/opensearch/cat/NodesResponse.java (75%) rename java-client/src/{main => generated}/java/org/opensearch/client/opensearch/cat/nodes/NodesRecord.java (59%) delete mode 100644 java-client/src/main/java/org/opensearch/client/opensearch/cat/NodesRequest.java diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/cat/NodesRequest.java b/java-client/src/generated/java/org/opensearch/client/opensearch/cat/NodesRequest.java new file mode 100644 index 0000000000..30ee374b70 --- /dev/null +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/cat/NodesRequest.java @@ -0,0 +1,374 @@ +/* + * SPDX-License-Identifier: Apache-2.0 + * + * The OpenSearch Contributors require contributions made to + * this file be licensed under the Apache-2.0 license or a + * compatible open source license. + */ + +/* + * Licensed to Elasticsearch B.V. under one or more contributor + * license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright + * ownership. Elasticsearch B.V. licenses this file to you under + * the Apache License, Version 2.0 (the "License"); you may + * not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +/* + * Modifications Copyright OpenSearch Contributors. See + * GitHub history for details. + */ + +//---------------------------------------------------- +// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. +//---------------------------------------------------- + +package org.opensearch.client.opensearch.cat; + +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.Bytes; +import org.opensearch.client.opensearch._types.ErrorResponse; +import org.opensearch.client.opensearch._types.Time; +import org.opensearch.client.opensearch._types.TimeUnit; +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.ToCopyableBuilder; + +// typedef: cat.nodes.Request + +/** + * Returns basic statistics about the performance of cluster nodes. + */ +@Generated("org.opensearch.client.codegen.CodeGenerator") +public final class NodesRequest extends CatRequestBase implements ToCopyableBuilder { + + @Nullable + private final Bytes bytes; + + @Nullable + private final Time clusterManagerTimeout; + + @Nullable + private final Boolean fullId; + + @Deprecated + @Nullable + private final Time masterTimeout; + + @Nullable + private final TimeUnit time; + + // --------------------------------------------------------------------------------------------- + + private NodesRequest(Builder builder) { + super(builder); + this.bytes = builder.bytes; + this.clusterManagerTimeout = builder.clusterManagerTimeout; + this.fullId = builder.fullId; + this.masterTimeout = builder.masterTimeout; + this.time = builder.time; + } + + public static NodesRequest of(Function> fn) { + return fn.apply(new Builder()).build(); + } + + /** + * The units used to display byte values. + *

+ * API name: {@code bytes} + *

+ */ + @Nullable + public final Bytes bytes() { + return this.bytes; + } + + /** + * The amount of time allowed to establish a connection to the cluster manager node. + *

+ * API name: {@code cluster_manager_timeout} + *

+ */ + @Nullable + public final Time clusterManagerTimeout() { + return this.clusterManagerTimeout; + } + + /** + * When true, returns the full node ID. When false, returns the shortened node ID. + *

+ * API name: {@code full_id} + *

+ */ + @Nullable + public final Boolean fullId() { + return this.fullId; + } + + /** + * The amount of time allowed to establish a connection to the cluster manager node. + *

+ * API name: {@code master_timeout} + *

+ */ + @Deprecated + @Nullable + public final Time masterTimeout() { + return this.masterTimeout; + } + + /** + * Specifies the time units, for example, 5d or 7h. For more information, see + * Supported units. + *

+ * API name: {@code time} + *

+ */ + @Nullable + public final TimeUnit time() { + return this.time; + } + + // --------------------------------------------------------------------------------------------- + + @Override + @Nonnull + public Builder toBuilder() { + return new Builder(this); + } + + @Nonnull + public static Builder builder() { + return new Builder(); + } + + /** + * Builder for {@link NodesRequest}. + */ + public static class Builder extends CatRequestBase.AbstractBuilder implements CopyableBuilder { + @Nullable + private Bytes bytes; + @Nullable + private Time clusterManagerTimeout; + @Nullable + private Boolean fullId; + @Nullable + private Time masterTimeout; + @Nullable + private TimeUnit time; + + public Builder() {} + + private Builder(NodesRequest o) { + super(o); + this.bytes = o.bytes; + this.clusterManagerTimeout = o.clusterManagerTimeout; + this.fullId = o.fullId; + this.masterTimeout = o.masterTimeout; + this.time = o.time; + } + + private Builder(Builder o) { + super(o); + this.bytes = o.bytes; + this.clusterManagerTimeout = o.clusterManagerTimeout; + this.fullId = o.fullId; + this.masterTimeout = o.masterTimeout; + this.time = o.time; + } + + @Override + @Nonnull + public Builder copy() { + return new Builder(this); + } + + @Override + @Nonnull + protected Builder self() { + return this; + } + + /** + * The units used to display byte values. + *

+ * API name: {@code bytes} + *

+ */ + @Nonnull + public final Builder bytes(@Nullable Bytes value) { + this.bytes = value; + return this; + } + + /** + * The amount of time allowed to establish a connection to the cluster manager node. + *

+ * API name: {@code cluster_manager_timeout} + *

+ */ + @Nonnull + public final Builder clusterManagerTimeout(@Nullable Time value) { + this.clusterManagerTimeout = value; + return this; + } + + /** + * The amount of time allowed to establish a connection to the cluster manager node. + *

+ * API name: {@code cluster_manager_timeout} + *

+ */ + @Nonnull + public final Builder clusterManagerTimeout(Function> fn) { + return clusterManagerTimeout(fn.apply(new Time.Builder()).build()); + } + + /** + * When true, returns the full node ID. When false, returns the shortened node ID. + *

+ * API name: {@code full_id} + *

+ */ + @Nonnull + public final Builder fullId(@Nullable Boolean value) { + this.fullId = value; + return this; + } + + /** + * The amount of time allowed to establish a connection to the cluster manager node. + *

+ * API name: {@code master_timeout} + *

+ */ + @Deprecated + @Nonnull + public final Builder masterTimeout(@Nullable Time value) { + this.masterTimeout = value; + return this; + } + + /** + * The amount of time allowed to establish a connection to the cluster manager node. + *

+ * API name: {@code master_timeout} + *

+ */ + @Deprecated + @Nonnull + public final Builder masterTimeout(Function> fn) { + return masterTimeout(fn.apply(new Time.Builder()).build()); + } + + /** + * Specifies the time units, for example, 5d or 7h. For more information, see + * Supported units. + *

+ * API name: {@code time} + *

+ */ + @Nonnull + public final Builder time(@Nullable TimeUnit value) { + this.time = value; + return this; + } + + /** + * Builds a {@link NodesRequest}. + * + * @throws NullPointerException if some of the required fields are null. + */ + @Override + @Nonnull + public NodesRequest build() { + _checkSingleUse(); + + return new NodesRequest(this); + } + } + + // --------------------------------------------------------------------------------------------- + + @Override + protected void applyQueryParameters(@Nonnull Map params) { + super.applyQueryParameters(params); + if (this.bytes != null) { + params.put("bytes", this.bytes.jsonValue()); + } + if (this.clusterManagerTimeout != null) { + params.put("cluster_manager_timeout", this.clusterManagerTimeout._toJsonString()); + } + if (this.fullId != null) { + params.put("full_id", String.valueOf(this.fullId)); + } + if (this.masterTimeout != null) { + params.put("master_timeout", this.masterTimeout._toJsonString()); + } + if (this.time != null) { + params.put("time", this.time.jsonValue()); + } + } + + /** + * Endpoint "{@code cat.nodes}". + */ + public static final Endpoint _ENDPOINT = new SimpleEndpoint<>( + // Request method + request -> "GET", + // Request path + request -> "/_cat/nodes", + // Request parameters + request -> { + Map params = new HashMap<>(); + request.applyQueryParameters(params); + return params; + }, + SimpleEndpoint.emptyMap(), + false, + NodesResponse._DESERIALIZER + ); + + @Override + public int hashCode() { + int result = 17; + result = 31 * result + Objects.hashCode(this.bytes); + result = 31 * result + Objects.hashCode(this.clusterManagerTimeout); + result = 31 * result + Objects.hashCode(this.fullId); + result = 31 * result + Objects.hashCode(this.masterTimeout); + result = 31 * result + Objects.hashCode(this.time); + return result; + } + + @Override + public boolean equals(Object o) { + if (this == o) return true; + if (o == null || this.getClass() != o.getClass()) return false; + NodesRequest other = (NodesRequest) o; + return Objects.equals(this.bytes, other.bytes) + && Objects.equals(this.clusterManagerTimeout, other.clusterManagerTimeout) + && Objects.equals(this.fullId, other.fullId) + && Objects.equals(this.masterTimeout, other.masterTimeout) + && Objects.equals(this.time, other.time); + } +} diff --git a/java-client/src/main/java/org/opensearch/client/opensearch/cat/NodesResponse.java b/java-client/src/generated/java/org/opensearch/client/opensearch/cat/NodesResponse.java similarity index 75% rename from java-client/src/main/java/org/opensearch/client/opensearch/cat/NodesResponse.java rename to java-client/src/generated/java/org/opensearch/client/opensearch/cat/NodesResponse.java index 9843ab40b0..e5d44e78af 100644 --- a/java-client/src/main/java/org/opensearch/client/opensearch/cat/NodesResponse.java +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/cat/NodesResponse.java @@ -30,43 +30,51 @@ * GitHub history for details. */ +//---------------------------------------------------- +// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. +//---------------------------------------------------- + package org.opensearch.client.opensearch.cat; 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; import org.opensearch.client.json.PlainJsonSerializable; import org.opensearch.client.opensearch.cat.nodes.NodesRecord; 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: cat.nodes.Response @JsonpDeserializable -public class NodesResponse implements PlainJsonSerializable { +@Generated("org.opensearch.client.codegen.CodeGenerator") +public class NodesResponse implements PlainJsonSerializable, ToCopyableBuilder { + + @Nonnull private final List valueBody; // --------------------------------------------------------------------------------------------- private NodesResponse(Builder builder) { - this.valueBody = ApiTypeHelper.unmodifiableRequired(builder.valueBody, this, "valueBody"); - } - public static NodesResponse of(Function> fn) { + public static NodesResponse of(Function> fn) { return fn.apply(new Builder()).build(); } /** * Required - Response value. - *

- * API name: {@code _value_body} */ + @Nonnull public final List valueBody() { return this.valueBody; } @@ -78,28 +86,53 @@ public void serialize(JsonGenerator generator, JsonpMapper mapper) { generator.writeStartArray(); for (NodesRecord item0 : this.valueBody) { 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 NodesResponse}. */ - - public static class Builder extends ObjectBuilderBase implements ObjectBuilder { + public static class Builder extends ObjectBuilderBase implements CopyableBuilder { private List valueBody; + public Builder() {} + + private Builder(NodesResponse o) { + this.valueBody = _listCopy(o.valueBody); + } + + private Builder(Builder o) { + this.valueBody = _listCopy(o.valueBody); + } + + @Override + @Nonnull + public Builder copy() { + return new Builder(this); + } + /** * Required - Response value. - *

- * API name: {@code _value_body} + * *

* Adds all elements of list to valueBody. + *

*/ + @Nonnull public final Builder valueBody(List list) { this.valueBody = _listAddAll(this.valueBody, list); return this; @@ -107,11 +140,12 @@ public final Builder valueBody(List list) { /** * Required - Response value. - *

- * API name: {@code _value_body} + * *

* Adds one or more values to valueBody. + *

*/ + @Nonnull public final Builder valueBody(NodesRecord value, NodesRecord... values) { this.valueBody = _listAdd(this.valueBody, value, values); return this; @@ -119,11 +153,12 @@ public final Builder valueBody(NodesRecord value, NodesRecord... values) { /** * Required - Response value. - *

- * API name: {@code _value_body} + * *

* Adds a value to valueBody using a builder lambda. + *

*/ + @Nonnull public final Builder valueBody(Function> fn) { return valueBody(fn.apply(new NodesRecord.Builder()).build()); } @@ -131,9 +166,10 @@ public final Builder valueBody(Function _DESERIALIZER = createNodesResponseDeserializer(); protected static JsonpDeserializer createNodesResponseDeserializer() { - JsonpDeserializer> valueDeserializer = JsonpDeserializer.arrayDeserializer(NodesRecord._DESERIALIZER); return JsonpDeserializer.of( @@ -152,5 +187,4 @@ protected static JsonpDeserializer createNodesResponseDeserialize (parser, mapper) -> new Builder().valueBody(valueDeserializer.deserialize(parser, mapper)).build() ); } - } diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/cat/OpenSearchCatAsyncClientBase.java b/java-client/src/generated/java/org/opensearch/client/opensearch/cat/OpenSearchCatAsyncClientBase.java index 02ac7bdbb5..3aaea79a27 100644 --- a/java-client/src/generated/java/org/opensearch/client/opensearch/cat/OpenSearchCatAsyncClientBase.java +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/cat/OpenSearchCatAsyncClientBase.java @@ -298,4 +298,30 @@ public final CompletableFuture nodeattrs(Function nodeattrs() throws IOException, OpenSearchException { return nodeattrs(new NodeattrsRequest.Builder().build()); } + + // ----- Endpoint: cat.nodes + + /** + * Returns basic statistics about the performance of cluster nodes. + */ + public CompletableFuture nodes(NodesRequest request) throws IOException, OpenSearchException { + return this.transport.performRequestAsync(request, NodesRequest._ENDPOINT, this.transportOptions); + } + + /** + * Returns basic statistics about the performance of cluster nodes. + * + * @param fn a function that initializes a builder to create the {@link NodesRequest} + */ + public final CompletableFuture nodes(Function> fn) throws IOException, + OpenSearchException { + return nodes(fn.apply(new NodesRequest.Builder()).build()); + } + + /** + * Returns basic statistics about the performance of cluster nodes. + */ + public final CompletableFuture nodes() throws IOException, OpenSearchException { + return nodes(new NodesRequest.Builder().build()); + } } diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/cat/OpenSearchCatClientBase.java b/java-client/src/generated/java/org/opensearch/client/opensearch/cat/OpenSearchCatClientBase.java index 6aee3da47e..d6ff3100f4 100644 --- a/java-client/src/generated/java/org/opensearch/client/opensearch/cat/OpenSearchCatClientBase.java +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/cat/OpenSearchCatClientBase.java @@ -294,4 +294,30 @@ public final NodeattrsResponse nodeattrs(Function> fn) throws IOException, + OpenSearchException { + return nodes(fn.apply(new NodesRequest.Builder()).build()); + } + + /** + * Returns basic statistics about the performance of cluster nodes. + */ + public final NodesResponse nodes() throws IOException, OpenSearchException { + return nodes(new NodesRequest.Builder().build()); + } } diff --git a/java-client/src/main/java/org/opensearch/client/opensearch/cat/nodes/NodesRecord.java b/java-client/src/generated/java/org/opensearch/client/opensearch/cat/nodes/NodesRecord.java similarity index 59% rename from java-client/src/main/java/org/opensearch/client/opensearch/cat/nodes/NodesRecord.java rename to java-client/src/generated/java/org/opensearch/client/opensearch/cat/nodes/NodesRecord.java index 3ffe2ce5e1..b0beb34c4a 100644 --- a/java-client/src/main/java/org/opensearch/client/opensearch/cat/nodes/NodesRecord.java +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/cat/nodes/NodesRecord.java @@ -30,10 +30,17 @@ * GitHub history for details. */ +//---------------------------------------------------- +// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. +//---------------------------------------------------- + package org.opensearch.client.opensearch.cat.nodes; import jakarta.json.stream.JsonGenerator; +import java.util.Objects; import java.util.function.Function; +import javax.annotation.Generated; +import javax.annotation.Nonnull; import javax.annotation.Nullable; import org.opensearch.client.json.JsonpDeserializable; import org.opensearch.client.json.JsonpDeserializer; @@ -41,42 +48,46 @@ import org.opensearch.client.json.ObjectBuilderDeserializer; import org.opensearch.client.json.ObjectDeserializer; import org.opensearch.client.json.PlainJsonSerializable; +import org.opensearch.client.util.CopyableBuilder; import org.opensearch.client.util.ObjectBuilder; import org.opensearch.client.util.ObjectBuilderBase; +import org.opensearch.client.util.ToCopyableBuilder; // typedef: cat.nodes.NodesRecord @JsonpDeserializable -public class NodesRecord implements PlainJsonSerializable { +@Generated("org.opensearch.client.codegen.CodeGenerator") +public class NodesRecord implements PlainJsonSerializable, ToCopyableBuilder { + @Nullable - private final String id; + private final String build; @Nullable - private final String pid; + private final String bulkAvgSizeInBytes; @Nullable - private final String ip; + private final String bulkAvgTime; @Nullable - private final String port; + private final String bulkTotalOperations; @Nullable - private final String httpAddress; + private final String bulkTotalSizeInBytes; @Nullable - private final String version; + private final String bulkTotalTime; @Nullable - private final String flavor; + private final String clusterManager; @Nullable - private final String type; + private final String completionSize; @Nullable - private final String build; + private final String cpu; @Nullable - private final String jdk; + private final String diskAvail; @Nullable private final String diskTotal; @@ -85,185 +96,190 @@ public class NodesRecord implements PlainJsonSerializable { private final String diskUsed; @Nullable - private final String diskAvail; + private final String diskUsedPercent; @Nullable - private final String diskUsedPercent; + private final String fielddataEvictions; @Nullable - private final String heapCurrent; + private final String fielddataMemorySize; @Nullable - private final String heapPercent; + private final String fileDescCurrent; @Nullable - private final String heapMax; + private final String fileDescMax; @Nullable - private final String ramCurrent; + private final String fileDescPercent; @Nullable - private final String ramPercent; + private final String flavor; @Nullable - private final String ramMax; + private final String flushTotal; @Nullable - private final String fileDescCurrent; + private final String flushTotalTime; @Nullable - private final String fileDescPercent; + private final String getCurrent; @Nullable - private final String fileDescMax; + private final String getExistsTime; @Nullable - private final String cpu; + private final String getExistsTotal; @Nullable - private final String load1m; + private final String getMissingTime; @Nullable - private final String load5m; + private final String getMissingTotal; @Nullable - private final String load15m; + private final String getTime; @Nullable - private final String uptime; + private final String getTotal; @Nullable - private final String nodeRole; + private final String heapCurrent; - @Deprecated @Nullable - private final String master; + private final String heapMax; @Nullable - private final String clusterManager; + private final String heapPercent; @Nullable - private final String name; + private final String httpAddress; @Nullable - private final String completionSize; + private final String id; @Nullable - private final String fielddataMemorySize; + private final String indexingDeleteCurrent; @Nullable - private final String fielddataEvictions; + private final String indexingDeleteTime; @Nullable - private final String queryCacheMemorySize; + private final String indexingDeleteTotal; @Nullable - private final String queryCacheEvictions; + private final String indexingIndexCurrent; @Nullable - private final String queryCacheHitCount; + private final String indexingIndexFailed; @Nullable - private final String queryCacheMissCount; + private final String indexingIndexTime; @Nullable - private final String requestCacheMemorySize; + private final String indexingIndexTotal; @Nullable - private final String requestCacheEvictions; + private final String ip; @Nullable - private final String requestCacheHitCount; + private final String jdk; @Nullable - private final String requestCacheMissCount; + private final String load15m; @Nullable - private final String flushTotal; + private final String load1m; @Nullable - private final String flushTotalTime; + private final String load5m; @Nullable - private final String getCurrent; + private final String master; @Nullable - private final String getTime; + private final String mergesCurrent; @Nullable - private final String getTotal; + private final String mergesCurrentDocs; @Nullable - private final String getExistsTime; + private final String mergesCurrentSize; @Nullable - private final String getExistsTotal; + private final String mergesTotal; @Nullable - private final String getMissingTime; + private final String mergesTotalDocs; @Nullable - private final String getMissingTotal; + private final String mergesTotalSize; @Nullable - private final String indexingDeleteCurrent; + private final String mergesTotalTime; @Nullable - private final String indexingDeleteTime; + private final String name; @Nullable - private final String indexingDeleteTotal; + private final String nodeRole; @Nullable - private final String indexingIndexCurrent; + private final String nodeRoles; @Nullable - private final String indexingIndexTime; + private final String pid; @Nullable - private final String indexingIndexTotal; + private final String port; @Nullable - private final String indexingIndexFailed; + private final String queryCacheEvictions; @Nullable - private final String mergesCurrent; + private final String queryCacheHitCount; @Nullable - private final String mergesCurrentDocs; + private final String queryCacheMemorySize; @Nullable - private final String mergesCurrentSize; + private final String queryCacheMissCount; @Nullable - private final String mergesTotal; + private final String ramCurrent; @Nullable - private final String mergesTotalDocs; + private final String ramMax; @Nullable - private final String mergesTotalSize; + private final String ramPercent; @Nullable - private final String mergesTotalTime; + private final String refreshExternalTime; @Nullable - private final String refreshTotal; + private final String refreshExternalTotal; + + @Nullable + private final String refreshListeners; @Nullable private final String refreshTime; @Nullable - private final String refreshExternalTotal; + private final String refreshTotal; @Nullable - private final String refreshExternalTime; + private final String requestCacheEvictions; @Nullable - private final String refreshListeners; + private final String requestCacheHitCount; @Nullable - private final String scriptCompilations; + private final String requestCacheMemorySize; + + @Nullable + private final String requestCacheMissCount; @Nullable private final String scriptCacheEvictions; @@ -271,6 +287,21 @@ public class NodesRecord implements PlainJsonSerializable { @Nullable private final String scriptCompilationLimitTriggered; + @Nullable + private final String scriptCompilations; + + @Nullable + private final String searchConcurrentAvgSliceCount; + + @Nullable + private final String searchConcurrentQueryCurrent; + + @Nullable + private final String searchConcurrentQueryTime; + + @Nullable + private final String searchConcurrentQueryTotal; + @Nullable private final String searchFetchCurrent; @@ -283,6 +314,15 @@ public class NodesRecord implements PlainJsonSerializable { @Nullable private final String searchOpenContexts; + @Nullable + private final String searchPointInTimeCurrent; + + @Nullable + private final String searchPointInTimeTime; + + @Nullable + private final String searchPointInTimeTotal; + @Nullable private final String searchQueryCurrent; @@ -305,16 +345,16 @@ public class NodesRecord implements PlainJsonSerializable { private final String segmentsCount; @Nullable - private final String segmentsMemory; + private final String segmentsFixedBitsetMemory; @Nullable private final String segmentsIndexWriterMemory; @Nullable - private final String segmentsVersionMapMemory; + private final String segmentsMemory; @Nullable - private final String segmentsFixedBitsetMemory; + private final String segmentsVersionMapMemory; @Nullable private final String suggestCurrent; @@ -326,83 +366,63 @@ public class NodesRecord implements PlainJsonSerializable { private final String suggestTotal; @Nullable - private final String bulkTotalOperations; - - @Nullable - private final String bulkTotalTime; - - @Nullable - private final String bulkTotalSizeInBytes; + private final String type; @Nullable - private final String bulkAvgTime; + private final String uptime; @Nullable - private final String bulkAvgSizeInBytes; + private final String version; // --------------------------------------------------------------------------------------------- private NodesRecord(Builder builder) { - - this.id = builder.id; - this.pid = builder.pid; - this.ip = builder.ip; - this.port = builder.port; - this.httpAddress = builder.httpAddress; - this.version = builder.version; - this.flavor = builder.flavor; - this.type = builder.type; this.build = builder.build; - this.jdk = builder.jdk; + this.bulkAvgSizeInBytes = builder.bulkAvgSizeInBytes; + this.bulkAvgTime = builder.bulkAvgTime; + this.bulkTotalOperations = builder.bulkTotalOperations; + this.bulkTotalSizeInBytes = builder.bulkTotalSizeInBytes; + this.bulkTotalTime = builder.bulkTotalTime; + this.clusterManager = builder.clusterManager; + this.completionSize = builder.completionSize; + this.cpu = builder.cpu; + this.diskAvail = builder.diskAvail; this.diskTotal = builder.diskTotal; this.diskUsed = builder.diskUsed; - this.diskAvail = builder.diskAvail; this.diskUsedPercent = builder.diskUsedPercent; - this.heapCurrent = builder.heapCurrent; - this.heapPercent = builder.heapPercent; - this.heapMax = builder.heapMax; - this.ramCurrent = builder.ramCurrent; - this.ramPercent = builder.ramPercent; - this.ramMax = builder.ramMax; + this.fielddataEvictions = builder.fielddataEvictions; + this.fielddataMemorySize = builder.fielddataMemorySize; this.fileDescCurrent = builder.fileDescCurrent; - this.fileDescPercent = builder.fileDescPercent; this.fileDescMax = builder.fileDescMax; - this.cpu = builder.cpu; - this.load1m = builder.load1m; - this.load5m = builder.load5m; - this.load15m = builder.load15m; - this.uptime = builder.uptime; - this.nodeRole = builder.nodeRole; - this.master = builder.master; - this.clusterManager = builder.clusterManager; - this.name = builder.name; - this.completionSize = builder.completionSize; - this.fielddataMemorySize = builder.fielddataMemorySize; - this.fielddataEvictions = builder.fielddataEvictions; - this.queryCacheMemorySize = builder.queryCacheMemorySize; - this.queryCacheEvictions = builder.queryCacheEvictions; - this.queryCacheHitCount = builder.queryCacheHitCount; - this.queryCacheMissCount = builder.queryCacheMissCount; - this.requestCacheMemorySize = builder.requestCacheMemorySize; - this.requestCacheEvictions = builder.requestCacheEvictions; - this.requestCacheHitCount = builder.requestCacheHitCount; - this.requestCacheMissCount = builder.requestCacheMissCount; + this.fileDescPercent = builder.fileDescPercent; + this.flavor = builder.flavor; this.flushTotal = builder.flushTotal; this.flushTotalTime = builder.flushTotalTime; this.getCurrent = builder.getCurrent; - this.getTime = builder.getTime; - this.getTotal = builder.getTotal; this.getExistsTime = builder.getExistsTime; this.getExistsTotal = builder.getExistsTotal; this.getMissingTime = builder.getMissingTime; this.getMissingTotal = builder.getMissingTotal; + this.getTime = builder.getTime; + this.getTotal = builder.getTotal; + this.heapCurrent = builder.heapCurrent; + this.heapMax = builder.heapMax; + this.heapPercent = builder.heapPercent; + this.httpAddress = builder.httpAddress; + this.id = builder.id; this.indexingDeleteCurrent = builder.indexingDeleteCurrent; this.indexingDeleteTime = builder.indexingDeleteTime; this.indexingDeleteTotal = builder.indexingDeleteTotal; this.indexingIndexCurrent = builder.indexingIndexCurrent; + this.indexingIndexFailed = builder.indexingIndexFailed; this.indexingIndexTime = builder.indexingIndexTime; this.indexingIndexTotal = builder.indexingIndexTotal; - this.indexingIndexFailed = builder.indexingIndexFailed; + this.ip = builder.ip; + this.jdk = builder.jdk; + this.load15m = builder.load15m; + this.load1m = builder.load1m; + this.load5m = builder.load5m; + this.master = builder.master; this.mergesCurrent = builder.mergesCurrent; this.mergesCurrentDocs = builder.mergesCurrentDocs; this.mergesCurrentSize = builder.mergesCurrentSize; @@ -410,18 +430,41 @@ private NodesRecord(Builder builder) { this.mergesTotalDocs = builder.mergesTotalDocs; this.mergesTotalSize = builder.mergesTotalSize; this.mergesTotalTime = builder.mergesTotalTime; - this.refreshTotal = builder.refreshTotal; - this.refreshTime = builder.refreshTime; - this.refreshExternalTotal = builder.refreshExternalTotal; - this.refreshExternalTime = builder.refreshExternalTime; - this.refreshListeners = builder.refreshListeners; - this.scriptCompilations = builder.scriptCompilations; - this.scriptCacheEvictions = builder.scriptCacheEvictions; - this.scriptCompilationLimitTriggered = builder.scriptCompilationLimitTriggered; + this.name = builder.name; + this.nodeRole = builder.nodeRole; + this.nodeRoles = builder.nodeRoles; + this.pid = builder.pid; + this.port = builder.port; + this.queryCacheEvictions = builder.queryCacheEvictions; + this.queryCacheHitCount = builder.queryCacheHitCount; + this.queryCacheMemorySize = builder.queryCacheMemorySize; + this.queryCacheMissCount = builder.queryCacheMissCount; + this.ramCurrent = builder.ramCurrent; + this.ramMax = builder.ramMax; + this.ramPercent = builder.ramPercent; + this.refreshExternalTime = builder.refreshExternalTime; + this.refreshExternalTotal = builder.refreshExternalTotal; + this.refreshListeners = builder.refreshListeners; + this.refreshTime = builder.refreshTime; + this.refreshTotal = builder.refreshTotal; + this.requestCacheEvictions = builder.requestCacheEvictions; + this.requestCacheHitCount = builder.requestCacheHitCount; + this.requestCacheMemorySize = builder.requestCacheMemorySize; + this.requestCacheMissCount = builder.requestCacheMissCount; + this.scriptCacheEvictions = builder.scriptCacheEvictions; + this.scriptCompilationLimitTriggered = builder.scriptCompilationLimitTriggered; + this.scriptCompilations = builder.scriptCompilations; + this.searchConcurrentAvgSliceCount = builder.searchConcurrentAvgSliceCount; + this.searchConcurrentQueryCurrent = builder.searchConcurrentQueryCurrent; + this.searchConcurrentQueryTime = builder.searchConcurrentQueryTime; + this.searchConcurrentQueryTotal = builder.searchConcurrentQueryTotal; this.searchFetchCurrent = builder.searchFetchCurrent; this.searchFetchTime = builder.searchFetchTime; this.searchFetchTotal = builder.searchFetchTotal; this.searchOpenContexts = builder.searchOpenContexts; + this.searchPointInTimeCurrent = builder.searchPointInTimeCurrent; + this.searchPointInTimeTime = builder.searchPointInTimeTime; + this.searchPointInTimeTotal = builder.searchPointInTimeTotal; this.searchQueryCurrent = builder.searchQueryCurrent; this.searchQueryTime = builder.searchQueryTime; this.searchQueryTotal = builder.searchQueryTotal; @@ -429,128 +472,131 @@ private NodesRecord(Builder builder) { this.searchScrollTime = builder.searchScrollTime; this.searchScrollTotal = builder.searchScrollTotal; this.segmentsCount = builder.segmentsCount; - this.segmentsMemory = builder.segmentsMemory; + this.segmentsFixedBitsetMemory = builder.segmentsFixedBitsetMemory; this.segmentsIndexWriterMemory = builder.segmentsIndexWriterMemory; + this.segmentsMemory = builder.segmentsMemory; this.segmentsVersionMapMemory = builder.segmentsVersionMapMemory; - this.segmentsFixedBitsetMemory = builder.segmentsFixedBitsetMemory; this.suggestCurrent = builder.suggestCurrent; this.suggestTime = builder.suggestTime; this.suggestTotal = builder.suggestTotal; - this.bulkTotalOperations = builder.bulkTotalOperations; - this.bulkTotalTime = builder.bulkTotalTime; - this.bulkTotalSizeInBytes = builder.bulkTotalSizeInBytes; - this.bulkAvgTime = builder.bulkAvgTime; - this.bulkAvgSizeInBytes = builder.bulkAvgSizeInBytes; - + this.type = builder.type; + this.uptime = builder.uptime; + this.version = builder.version; } - public static NodesRecord of(Function> fn) { + public static NodesRecord of(Function> fn) { return fn.apply(new Builder()).build(); } /** - * unique node id + * The OpenSearch build hash. *

- * API name: {@code id} + * API name: {@code build} + *

*/ @Nullable - public final String id() { - return this.id; + public final String build() { + return this.build; } /** - * process id + * The average size in bytes of shard bulk. *

- * API name: {@code pid} + * API name: {@code bulk.avg_size_in_bytes} + *

*/ @Nullable - public final String pid() { - return this.pid; + public final String bulkAvgSizeInBytes() { + return this.bulkAvgSizeInBytes; } /** - * ip address + * The average time spend in shard bulk. *

- * API name: {@code ip} + * API name: {@code bulk.avg_time} + *

*/ @Nullable - public final String ip() { - return this.ip; + public final String bulkAvgTime() { + return this.bulkAvgTime; } /** - * bound transport port + * The number of bulk shard operations. *

- * API name: {@code port} + * API name: {@code bulk.total_operations} + *

*/ @Nullable - public final String port() { - return this.port; + public final String bulkTotalOperations() { + return this.bulkTotalOperations; } /** - * bound http address + * The total size in bytes of shard bulk. *

- * API name: {@code http_address} + * API name: {@code bulk.total_size_in_bytes} + *

*/ @Nullable - public final String httpAddress() { - return this.httpAddress; + public final String bulkTotalSizeInBytes() { + return this.bulkTotalSizeInBytes; } /** - * es version + * The time spend in shard bulk. *

- * API name: {@code version} + * API name: {@code bulk.total_time} + *

*/ @Nullable - public final String version() { - return this.version; + public final String bulkTotalTime() { + return this.bulkTotalTime; } /** - * es distribution flavor + * Indicates whether the node is the elected cluster-manager node. Returned values include *(elected cluster-manager) and + * -(not elected cluster-manager). *

- * API name: {@code flavor} + * API name: {@code cluster_manager} + *

*/ @Nullable - public final String flavor() { - return this.flavor; + public final String clusterManager() { + return this.clusterManager; } /** - * es distribution type + * The size of completion. *

- * API name: {@code type} + * API name: {@code completion.size} + *

*/ @Nullable - public final String type() { - return this.type; + public final String completionSize() { + return this.completionSize; } /** - * es build hash + * The recent system CPU usage as a percentage. *

- * API name: {@code build} + * API name: {@code cpu} + *

*/ @Nullable - public final String build() { - return this.build; + public final String cpu() { + return this.cpu; } /** - * jdk version - *

- * API name: {@code jdk} + * API name: {@code disk.avail} */ @Nullable - public final String jdk() { - return this.jdk; + public final String diskAvail() { + return this.diskAvail; } /** - * total disk space - *

* API name: {@code disk.total} */ @Nullable @@ -559,8 +605,6 @@ public final String diskTotal() { } /** - * used disk space - *

* API name: {@code disk.used} */ @Nullable @@ -569,18 +613,6 @@ public final String diskUsed() { } /** - * available disk space - *

- * API name: {@code disk.avail} - */ - @Nullable - public final String diskAvail() { - return this.diskAvail; - } - - /** - * used disk space percentage - *

* API name: {@code disk.used_percent} */ @Nullable @@ -589,540 +621,606 @@ public final String diskUsedPercent() { } /** - * used heap + * The field data evictions. *

- * API name: {@code heap.current} + * API name: {@code fielddata.evictions} + *

*/ @Nullable - public final String heapCurrent() { - return this.heapCurrent; + public final String fielddataEvictions() { + return this.fielddataEvictions; } /** - * used heap ratio + * The used field data cache. *

- * API name: {@code heap.percent} + * API name: {@code fielddata.memory_size} + *

*/ @Nullable - public final String heapPercent() { - return this.heapPercent; + public final String fielddataMemorySize() { + return this.fielddataMemorySize; } /** - * max configured heap + * The used file descriptors. *

- * API name: {@code heap.max} + * API name: {@code file_desc.current} + *

*/ @Nullable - public final String heapMax() { - return this.heapMax; + public final String fileDescCurrent() { + return this.fileDescCurrent; } /** - * used machine memory + * The maximum number of file descriptors. *

- * API name: {@code ram.current} + * API name: {@code file_desc.max} + *

*/ @Nullable - public final String ramCurrent() { - return this.ramCurrent; + public final String fileDescMax() { + return this.fileDescMax; } /** - * used machine memory ratio - *

- * API name: {@code ram.percent} + * API name: {@code file_desc.percent} */ @Nullable - public final String ramPercent() { - return this.ramPercent; + public final String fileDescPercent() { + return this.fileDescPercent; } /** - * total machine memory + * The OpenSearch distribution flavor. *

- * API name: {@code ram.max} + * API name: {@code flavor} + *

*/ @Nullable - public final String ramMax() { - return this.ramMax; + public final String flavor() { + return this.flavor; } /** - * used file descriptors + * The number of flushes. *

- * API name: {@code file_desc.current} + * API name: {@code flush.total} + *

*/ @Nullable - public final String fileDescCurrent() { - return this.fileDescCurrent; + public final String flushTotal() { + return this.flushTotal; } /** - * used file descriptor ratio + * The time spent in flush. *

- * API name: {@code file_desc.percent} + * API name: {@code flush.total_time} + *

*/ @Nullable - public final String fileDescPercent() { - return this.fileDescPercent; + public final String flushTotalTime() { + return this.flushTotalTime; } /** - * max file descriptors + * The number of current get ops. *

- * API name: {@code file_desc.max} + * API name: {@code get.current} + *

*/ @Nullable - public final String fileDescMax() { - return this.fileDescMax; + public final String getCurrent() { + return this.getCurrent; } /** - * recent cpu usage + * The time spent in successful gets. *

- * API name: {@code cpu} + * API name: {@code get.exists_time} + *

*/ @Nullable - public final String cpu() { - return this.cpu; + public final String getExistsTime() { + return this.getExistsTime; } /** - * 1m load avg + * The number of successful get operations. *

- * API name: {@code load_1m} + * API name: {@code get.exists_total} + *

*/ @Nullable - public final String load1m() { - return this.load1m; + public final String getExistsTotal() { + return this.getExistsTotal; } /** - * 5m load avg + * The time spent in failed gets. *

- * API name: {@code load_5m} + * API name: {@code get.missing_time} + *

*/ @Nullable - public final String load5m() { - return this.load5m; + public final String getMissingTime() { + return this.getMissingTime; } /** - * 15m load avg + * The number of failed gets. *

- * API name: {@code load_15m} + * API name: {@code get.missing_total} + *

*/ @Nullable - public final String load15m() { - return this.load15m; + public final String getMissingTotal() { + return this.getMissingTotal; } /** - * node uptime + * The time spent in get. *

- * API name: {@code uptime} + * API name: {@code get.time} + *

*/ @Nullable - public final String uptime() { - return this.uptime; + public final String getTime() { + return this.getTime; } /** - * m:cluster-manager eligible node, d:data node, i:ingest node, -:coordinating node only + * The number of get ops. *

- * API name: {@code node.role} + * API name: {@code get.total} + *

*/ @Nullable - public final String nodeRole() { - return this.nodeRole; + public final String getTotal() { + return this.getTotal; } /** - * *:current master + * The used heap. *

- * API name: {@code master} + * API name: {@code heap.current} + *

*/ - @Deprecated @Nullable - public final String master() { - return this.master; + public final String heapCurrent() { + return this.heapCurrent; } /** - * *:current cluster-manager + * The maximum configured heap. *

- * API name: {@code clusterManager} + * API name: {@code heap.max} + *

*/ @Nullable - public final String clusterManager() { - return this.clusterManager; + public final String heapMax() { + return this.heapMax; } /** - * node name - *

- * API name: {@code name} + * API name: {@code heap.percent} */ @Nullable - public final String name() { - return this.name; + public final String heapPercent() { + return this.heapPercent; } /** - * size of completion + * The bound HTTP address. *

- * API name: {@code completion.size} + * API name: {@code http_address} + *

*/ @Nullable - public final String completionSize() { - return this.completionSize; + public final String httpAddress() { + return this.httpAddress; } /** - * used fielddata cache - *

- * API name: {@code fielddata.memory_size} + * API name: {@code id} */ @Nullable - public final String fielddataMemorySize() { - return this.fielddataMemorySize; + public final String id() { + return this.id; } /** - * fielddata evictions + * The number of current deletions. *

- * API name: {@code fielddata.evictions} + * API name: {@code indexing.delete_current} + *

*/ @Nullable - public final String fielddataEvictions() { - return this.fielddataEvictions; + public final String indexingDeleteCurrent() { + return this.indexingDeleteCurrent; } /** - * used query cache + * The time spent in deletions. *

- * API name: {@code query_cache.memory_size} + * API name: {@code indexing.delete_time} + *

*/ @Nullable - public final String queryCacheMemorySize() { - return this.queryCacheMemorySize; + public final String indexingDeleteTime() { + return this.indexingDeleteTime; } /** - * query cache evictions + * The number of delete operations. *

- * API name: {@code query_cache.evictions} + * API name: {@code indexing.delete_total} + *

*/ @Nullable - public final String queryCacheEvictions() { - return this.queryCacheEvictions; + public final String indexingDeleteTotal() { + return this.indexingDeleteTotal; } /** - * query cache hit counts + * The number of current indexing operations. *

- * API name: {@code query_cache.hit_count} + * API name: {@code indexing.index_current} + *

*/ @Nullable - public final String queryCacheHitCount() { - return this.queryCacheHitCount; + public final String indexingIndexCurrent() { + return this.indexingIndexCurrent; } /** - * query cache miss counts + * The number of failed indexing operations. *

- * API name: {@code query_cache.miss_count} + * API name: {@code indexing.index_failed} + *

*/ @Nullable - public final String queryCacheMissCount() { - return this.queryCacheMissCount; + public final String indexingIndexFailed() { + return this.indexingIndexFailed; } /** - * used request cache + * The time spent in indexing. *

- * API name: {@code request_cache.memory_size} + * API name: {@code indexing.index_time} + *

*/ @Nullable - public final String requestCacheMemorySize() { - return this.requestCacheMemorySize; + public final String indexingIndexTime() { + return this.indexingIndexTime; } /** - * request cache evictions + * The number of indexing operations. *

- * API name: {@code request_cache.evictions} + * API name: {@code indexing.index_total} + *

*/ @Nullable - public final String requestCacheEvictions() { - return this.requestCacheEvictions; + public final String indexingIndexTotal() { + return this.indexingIndexTotal; } /** - * request cache hit counts + * The IP address. *

- * API name: {@code request_cache.hit_count} + * API name: {@code ip} + *

*/ @Nullable - public final String requestCacheHitCount() { - return this.requestCacheHitCount; + public final String ip() { + return this.ip; } /** - * request cache miss counts + * The Java version. *

- * API name: {@code request_cache.miss_count} + * API name: {@code jdk} + *

*/ @Nullable - public final String requestCacheMissCount() { - return this.requestCacheMissCount; + public final String jdk() { + return this.jdk; } /** - * number of flushes + * The load average for the last fifteen minutes. *

- * API name: {@code flush.total} + * API name: {@code load_15m} + *

*/ @Nullable - public final String flushTotal() { - return this.flushTotal; + public final String load15m() { + return this.load15m; } /** - * time spent in flush + * The load average for the most recent minute. *

- * API name: {@code flush.total_time} + * API name: {@code load_1m} + *

*/ @Nullable - public final String flushTotalTime() { - return this.flushTotalTime; + public final String load1m() { + return this.load1m; } /** - * number of current get ops + * The load average for the last five minutes. *

- * API name: {@code get.current} + * API name: {@code load_5m} + *

*/ @Nullable - public final String getCurrent() { - return this.getCurrent; + public final String load5m() { + return this.load5m; } /** - * time spent in get + * Indicates whether the node is the elected cluster-manager node. Returned values include *(elected cluster manager) and + * -(not elected cluster manager). *

- * API name: {@code get.time} + * API name: {@code master} + *

*/ @Nullable - public final String getTime() { - return this.getTime; + public final String master() { + return this.master; } /** - * number of get ops + * The number of current merges. *

- * API name: {@code get.total} + * API name: {@code merges.current} + *

*/ @Nullable - public final String getTotal() { - return this.getTotal; + public final String mergesCurrent() { + return this.mergesCurrent; } /** - * time spent in successful gets + * The number of current merging docs. *

- * API name: {@code get.exists_time} + * API name: {@code merges.current_docs} + *

*/ @Nullable - public final String getExistsTime() { - return this.getExistsTime; + public final String mergesCurrentDocs() { + return this.mergesCurrentDocs; } /** - * number of successful gets + * The size of current merges. *

- * API name: {@code get.exists_total} + * API name: {@code merges.current_size} + *

*/ @Nullable - public final String getExistsTotal() { - return this.getExistsTotal; + public final String mergesCurrentSize() { + return this.mergesCurrentSize; } /** - * time spent in failed gets + * The number of completed merge operations. *

- * API name: {@code get.missing_time} + * API name: {@code merges.total} + *

*/ @Nullable - public final String getMissingTime() { - return this.getMissingTime; + public final String mergesTotal() { + return this.mergesTotal; } /** - * number of failed gets + * The docs merged. *

- * API name: {@code get.missing_total} + * API name: {@code merges.total_docs} + *

*/ @Nullable - public final String getMissingTotal() { - return this.getMissingTotal; + public final String mergesTotalDocs() { + return this.mergesTotalDocs; } /** - * number of current deletions + * The size merged. *

- * API name: {@code indexing.delete_current} + * API name: {@code merges.total_size} + *

*/ @Nullable - public final String indexingDeleteCurrent() { - return this.indexingDeleteCurrent; + public final String mergesTotalSize() { + return this.mergesTotalSize; } /** - * time spent in deletions + * The time spent in merges. *

- * API name: {@code indexing.delete_time} + * API name: {@code merges.total_time} + *

*/ @Nullable - public final String indexingDeleteTime() { - return this.indexingDeleteTime; + public final String mergesTotalTime() { + return this.mergesTotalTime; + } + + /** + * API name: {@code name} + */ + @Nullable + public final String name() { + return this.name; } /** - * number of delete ops + * The roles of the node. Returned values include c(cold node), d(data node), f(frozen node), + * h(hot node), i(ingest node), l(machine learning node), m (cluster-manager + * eligible node), r(remote cluster client node), s(content node), t(transform node), + * v(voting-only node), w(warm node),and -(coordinating node only). *

- * API name: {@code indexing.delete_total} + * API name: {@code node.role} + *

*/ @Nullable - public final String indexingDeleteTotal() { - return this.indexingDeleteTotal; + public final String nodeRole() { + return this.nodeRole; } /** - * number of current indexing ops + * A comma-separated list of the roles of the node. Returned values may include but are not limited to: data, + * ingest, master, cluster_manager, remote_cluster_client, search, and + * -(coordinating node only). *

- * API name: {@code indexing.index_current} + * API name: {@code node.roles} + *

*/ @Nullable - public final String indexingIndexCurrent() { - return this.indexingIndexCurrent; + public final String nodeRoles() { + return this.nodeRoles; } /** - * time spent in indexing + * The process identifier. *

- * API name: {@code indexing.index_time} + * API name: {@code pid} + *

*/ @Nullable - public final String indexingIndexTime() { - return this.indexingIndexTime; + public final String pid() { + return this.pid; } /** - * number of indexing ops + * The bound transport port. *

- * API name: {@code indexing.index_total} + * API name: {@code port} + *

*/ @Nullable - public final String indexingIndexTotal() { - return this.indexingIndexTotal; + public final String port() { + return this.port; } /** - * number of failed indexing ops + * The query cache evictions. *

- * API name: {@code indexing.index_failed} + * API name: {@code query_cache.evictions} + *

*/ @Nullable - public final String indexingIndexFailed() { - return this.indexingIndexFailed; + public final String queryCacheEvictions() { + return this.queryCacheEvictions; } /** - * number of current merges + * The query cache hit counts. *

- * API name: {@code merges.current} + * API name: {@code query_cache.hit_count} + *

*/ @Nullable - public final String mergesCurrent() { - return this.mergesCurrent; + public final String queryCacheHitCount() { + return this.queryCacheHitCount; } /** - * number of current merging docs + * The used query cache. *

- * API name: {@code merges.current_docs} + * API name: {@code query_cache.memory_size} + *

*/ @Nullable - public final String mergesCurrentDocs() { - return this.mergesCurrentDocs; + public final String queryCacheMemorySize() { + return this.queryCacheMemorySize; } /** - * size of current merges + * The query cache miss counts. *

- * API name: {@code merges.current_size} + * API name: {@code query_cache.miss_count} + *

*/ @Nullable - public final String mergesCurrentSize() { - return this.mergesCurrentSize; + public final String queryCacheMissCount() { + return this.queryCacheMissCount; } /** - * number of completed merge ops + * The used machine memory. *

- * API name: {@code merges.total} + * API name: {@code ram.current} + *

*/ @Nullable - public final String mergesTotal() { - return this.mergesTotal; + public final String ramCurrent() { + return this.ramCurrent; } /** - * docs merged + * The total machine memory. *

- * API name: {@code merges.total_docs} + * API name: {@code ram.max} + *

*/ @Nullable - public final String mergesTotalDocs() { - return this.mergesTotalDocs; + public final String ramMax() { + return this.ramMax; + } + + /** + * API name: {@code ram.percent} + */ + @Nullable + public final String ramPercent() { + return this.ramPercent; } /** - * size merged + * The time spent in external refreshes. *

- * API name: {@code merges.total_size} + * API name: {@code refresh.external_time} + *

*/ @Nullable - public final String mergesTotalSize() { - return this.mergesTotalSize; + public final String refreshExternalTime() { + return this.refreshExternalTime; } /** - * time spent in merges + * The total external refreshes. *

- * API name: {@code merges.total_time} + * API name: {@code refresh.external_total} + *

*/ @Nullable - public final String mergesTotalTime() { - return this.mergesTotalTime; + public final String refreshExternalTotal() { + return this.refreshExternalTotal; } /** - * total refreshes + * The number of pending refresh listeners. *

- * API name: {@code refresh.total} + * API name: {@code refresh.listeners} + *

*/ @Nullable - public final String refreshTotal() { - return this.refreshTotal; + public final String refreshListeners() { + return this.refreshListeners; } /** - * time spent in refreshes + * The time spent in refreshes. *

* API name: {@code refresh.time} + *

*/ @Nullable public final String refreshTime() { @@ -1130,49 +1228,65 @@ public final String refreshTime() { } /** - * total external refreshes + * The total refreshes. *

- * API name: {@code refresh.external_total} + * API name: {@code refresh.total} + *

*/ @Nullable - public final String refreshExternalTotal() { - return this.refreshExternalTotal; + public final String refreshTotal() { + return this.refreshTotal; } /** - * time spent in external refreshes + * The request cache evictions. *

- * API name: {@code refresh.external_time} + * API name: {@code request_cache.evictions} + *

*/ @Nullable - public final String refreshExternalTime() { - return this.refreshExternalTime; + public final String requestCacheEvictions() { + return this.requestCacheEvictions; } /** - * number of pending refresh listeners + * The request cache hit counts. *

- * API name: {@code refresh.listeners} + * API name: {@code request_cache.hit_count} + *

*/ @Nullable - public final String refreshListeners() { - return this.refreshListeners; + public final String requestCacheHitCount() { + return this.requestCacheHitCount; } /** - * script compilations + * The used request cache. *

- * API name: {@code script.compilations} + * API name: {@code request_cache.memory_size} + *

*/ @Nullable - public final String scriptCompilations() { - return this.scriptCompilations; + public final String requestCacheMemorySize() { + return this.requestCacheMemorySize; + } + + /** + * The request cache miss counts. + *

+ * API name: {@code request_cache.miss_count} + *

+ */ + @Nullable + public final String requestCacheMissCount() { + return this.requestCacheMissCount; } /** - * script cache evictions + * The total compiled scripts evicted from the cache. *

* API name: {@code script.cache_evictions} + *

*/ @Nullable public final String scriptCacheEvictions() { @@ -1180,9 +1294,10 @@ public final String scriptCacheEvictions() { } /** - * script cache compilation limit triggered + * The script cache compilation limit triggered. *

* API name: {@code script.compilation_limit_triggered} + *

*/ @Nullable public final String scriptCompilationLimitTriggered() { @@ -1190,9 +1305,53 @@ public final String scriptCompilationLimitTriggered() { } /** - * current fetch phase ops + * The total script compilations. + *

+ * API name: {@code script.compilations} + *

+ */ + @Nullable + public final String scriptCompilations() { + return this.scriptCompilations; + } + + /** + * API name: {@code search.concurrent_avg_slice_count} + */ + @Nullable + public final String searchConcurrentAvgSliceCount() { + return this.searchConcurrentAvgSliceCount; + } + + /** + * API name: {@code search.concurrent_query_current} + */ + @Nullable + public final String searchConcurrentQueryCurrent() { + return this.searchConcurrentQueryCurrent; + } + + /** + * API name: {@code search.concurrent_query_time} + */ + @Nullable + public final String searchConcurrentQueryTime() { + return this.searchConcurrentQueryTime; + } + + /** + * API name: {@code search.concurrent_query_total} + */ + @Nullable + public final String searchConcurrentQueryTotal() { + return this.searchConcurrentQueryTotal; + } + + /** + * The current fetch phase operations. *

* API name: {@code search.fetch_current} + *

*/ @Nullable public final String searchFetchCurrent() { @@ -1200,9 +1359,10 @@ public final String searchFetchCurrent() { } /** - * time spent in fetch phase + * The time spent in fetch phase. *

* API name: {@code search.fetch_time} + *

*/ @Nullable public final String searchFetchTime() { @@ -1210,9 +1370,10 @@ public final String searchFetchTime() { } /** - * total fetch ops + * The total fetch operations. *

* API name: {@code search.fetch_total} + *

*/ @Nullable public final String searchFetchTotal() { @@ -1220,9 +1381,10 @@ public final String searchFetchTotal() { } /** - * open search contexts + * The open search contexts. *

* API name: {@code search.open_contexts} + *

*/ @Nullable public final String searchOpenContexts() { @@ -1230,29 +1392,56 @@ public final String searchOpenContexts() { } /** - * current query phase ops - *

- * API name: {@code search.query_current} + * API name: {@code search.point_in_time_current} */ @Nullable - public final String searchQueryCurrent() { - return this.searchQueryCurrent; + public final String searchPointInTimeCurrent() { + return this.searchPointInTimeCurrent; } /** - * time spent in query phase - *

- * API name: {@code search.query_time} + * API name: {@code search.point_in_time_time} */ @Nullable - public final String searchQueryTime() { - return this.searchQueryTime; + public final String searchPointInTimeTime() { + return this.searchPointInTimeTime; } /** - * total query phase ops - *

+ * API name: {@code search.point_in_time_total} + */ + @Nullable + public final String searchPointInTimeTotal() { + return this.searchPointInTimeTotal; + } + + /** + * The current query phase operations. + *

+ * API name: {@code search.query_current} + *

+ */ + @Nullable + public final String searchQueryCurrent() { + return this.searchQueryCurrent; + } + + /** + * The time spent in query phase. + *

+ * API name: {@code search.query_time} + *

+ */ + @Nullable + public final String searchQueryTime() { + return this.searchQueryTime; + } + + /** + * The total query phase operations. + *

* API name: {@code search.query_total} + *

*/ @Nullable public final String searchQueryTotal() { @@ -1260,9 +1449,10 @@ public final String searchQueryTotal() { } /** - * open scroll contexts + * The open scroll contexts. *

* API name: {@code search.scroll_current} + *

*/ @Nullable public final String searchScrollCurrent() { @@ -1270,9 +1460,10 @@ public final String searchScrollCurrent() { } /** - * time scroll contexts held open + * The time scroll contexts held open. *

* API name: {@code search.scroll_time} + *

*/ @Nullable public final String searchScrollTime() { @@ -1280,9 +1471,10 @@ public final String searchScrollTime() { } /** - * completed scroll contexts + * The completed scroll contexts. *

* API name: {@code search.scroll_total} + *

*/ @Nullable public final String searchScrollTotal() { @@ -1290,9 +1482,10 @@ public final String searchScrollTotal() { } /** - * number of segments + * The number of segments. *

* API name: {@code segments.count} + *

*/ @Nullable public final String segmentsCount() { @@ -1300,19 +1493,22 @@ public final String segmentsCount() { } /** - * memory used by segments + * The memory used by fixed bit sets for nested object field types and export type filters for types referred in _parent + * fields. *

- * API name: {@code segments.memory} + * API name: {@code segments.fixed_bitset_memory} + *

*/ @Nullable - public final String segmentsMemory() { - return this.segmentsMemory; + public final String segmentsFixedBitsetMemory() { + return this.segmentsFixedBitsetMemory; } /** - * memory used by index writer + * The memory used by the index writer. *

* API name: {@code segments.index_writer_memory} + *

*/ @Nullable public final String segmentsIndexWriterMemory() { @@ -1320,30 +1516,32 @@ public final String segmentsIndexWriterMemory() { } /** - * memory used by version map + * The memory used by segments. *

- * API name: {@code segments.version_map_memory} + * API name: {@code segments.memory} + *

*/ @Nullable - public final String segmentsVersionMapMemory() { - return this.segmentsVersionMapMemory; + public final String segmentsMemory() { + return this.segmentsMemory; } /** - * memory used by fixed bit sets for nested object field types and export type - * filters for types referred in _parent fields + * The memory used by the version map. *

- * API name: {@code segments.fixed_bitset_memory} + * API name: {@code segments.version_map_memory} + *

*/ @Nullable - public final String segmentsFixedBitsetMemory() { - return this.segmentsFixedBitsetMemory; + public final String segmentsVersionMapMemory() { + return this.segmentsVersionMapMemory; } /** - * number of current suggest ops + * The number of current suggest operations. *

* API name: {@code suggest.current} + *

*/ @Nullable public final String suggestCurrent() { @@ -1351,9 +1549,10 @@ public final String suggestCurrent() { } /** - * time spend in suggest + * The time spend in suggest. *

* API name: {@code suggest.time} + *

*/ @Nullable public final String suggestTime() { @@ -1361,9 +1560,10 @@ public final String suggestTime() { } /** - * number of suggest ops + * The number of suggest operations. *

* API name: {@code suggest.total} + *

*/ @Nullable public final String suggestTotal() { @@ -1371,58 +1571,39 @@ public final String suggestTotal() { } /** - * number of bulk shard ops - *

- * API name: {@code bulk.total_operations} - */ - @Nullable - public final String bulkTotalOperations() { - return this.bulkTotalOperations; - } - - /** - * time spend in shard bulk - *

- * API name: {@code bulk.total_time} - */ - @Nullable - public final String bulkTotalTime() { - return this.bulkTotalTime; - } - - /** - * total size in bytes of shard bulk + * The OpenSearch distribution type. *

- * API name: {@code bulk.total_size_in_bytes} + * API name: {@code type} + *

*/ @Nullable - public final String bulkTotalSizeInBytes() { - return this.bulkTotalSizeInBytes; + public final String type() { + return this.type; } /** - * average time spend in shard bulk + * The node uptime. *

- * API name: {@code bulk.avg_time} + * API name: {@code uptime} + *

*/ @Nullable - public final String bulkAvgTime() { - return this.bulkAvgTime; + public final String uptime() { + return this.uptime; } /** - * average size in bytes of shard bulk - *

- * API name: {@code bulk.avg_size_in_bytes} + * API name: {@code version} */ @Nullable - public final String bulkAvgSizeInBytes() { - return this.bulkAvgSizeInBytes; + public final String version() { + return this.version; } /** * Serialize this object to JSON. */ + @Override public void serialize(JsonGenerator generator, JsonpMapper mapper) { generator.writeStartObject(); serializeInternal(generator, mapper); @@ -1430,1772 +1611,2208 @@ public void serialize(JsonGenerator generator, JsonpMapper mapper) { } protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { - - if (this.id != null) { - generator.writeKey("id"); - generator.write(this.id); - + if (this.build != null) { + generator.writeKey("build"); + generator.write(this.build); } - if (this.pid != null) { - generator.writeKey("pid"); - generator.write(this.pid); + if (this.bulkAvgSizeInBytes != null) { + generator.writeKey("bulk.avg_size_in_bytes"); + generator.write(this.bulkAvgSizeInBytes); } - if (this.ip != null) { - generator.writeKey("ip"); - generator.write(this.ip); + if (this.bulkAvgTime != null) { + generator.writeKey("bulk.avg_time"); + generator.write(this.bulkAvgTime); } - if (this.port != null) { - generator.writeKey("port"); - generator.write(this.port); + if (this.bulkTotalOperations != null) { + generator.writeKey("bulk.total_operations"); + generator.write(this.bulkTotalOperations); } - if (this.httpAddress != null) { - generator.writeKey("http_address"); - generator.write(this.httpAddress); + if (this.bulkTotalSizeInBytes != null) { + generator.writeKey("bulk.total_size_in_bytes"); + generator.write(this.bulkTotalSizeInBytes); } - if (this.version != null) { - generator.writeKey("version"); - generator.write(this.version); + if (this.bulkTotalTime != null) { + generator.writeKey("bulk.total_time"); + generator.write(this.bulkTotalTime); } - if (this.flavor != null) { - generator.writeKey("flavor"); - generator.write(this.flavor); + if (this.clusterManager != null) { + generator.writeKey("cluster_manager"); + generator.write(this.clusterManager); } - if (this.type != null) { - generator.writeKey("type"); - generator.write(this.type); + if (this.completionSize != null) { + generator.writeKey("completion.size"); + generator.write(this.completionSize); } - if (this.build != null) { - generator.writeKey("build"); - generator.write(this.build); + if (this.cpu != null) { + generator.writeKey("cpu"); + generator.write(this.cpu); } - if (this.jdk != null) { - generator.writeKey("jdk"); - generator.write(this.jdk); + if (this.diskAvail != null) { + generator.writeKey("disk.avail"); + generator.write(this.diskAvail); } + if (this.diskTotal != null) { generator.writeKey("disk.total"); generator.write(this.diskTotal); - } + if (this.diskUsed != null) { generator.writeKey("disk.used"); generator.write(this.diskUsed); - } - if (this.diskAvail != null) { - generator.writeKey("disk.avail"); - generator.write(this.diskAvail); - } if (this.diskUsedPercent != null) { generator.writeKey("disk.used_percent"); generator.write(this.diskUsedPercent); - - } - if (this.heapCurrent != null) { - generator.writeKey("heap.current"); - generator.write(this.heapCurrent); - - } - if (this.heapPercent != null) { - generator.writeKey("heap.percent"); - generator.write(this.heapPercent); - } - if (this.heapMax != null) { - generator.writeKey("heap.max"); - generator.write(this.heapMax); - - } - if (this.ramCurrent != null) { - generator.writeKey("ram.current"); - generator.write(this.ramCurrent); + if (this.fielddataEvictions != null) { + generator.writeKey("fielddata.evictions"); + generator.write(this.fielddataEvictions); } - if (this.ramPercent != null) { - generator.writeKey("ram.percent"); - generator.write(this.ramPercent); + if (this.fielddataMemorySize != null) { + generator.writeKey("fielddata.memory_size"); + generator.write(this.fielddataMemorySize); } - if (this.ramMax != null) { - generator.writeKey("ram.max"); - generator.write(this.ramMax); - } if (this.fileDescCurrent != null) { generator.writeKey("file_desc.current"); generator.write(this.fileDescCurrent); - } - if (this.fileDescPercent != null) { - generator.writeKey("file_desc.percent"); - generator.write(this.fileDescPercent); - } if (this.fileDescMax != null) { generator.writeKey("file_desc.max"); generator.write(this.fileDescMax); - } - if (this.cpu != null) { - generator.writeKey("cpu"); - generator.write(this.cpu); + if (this.fileDescPercent != null) { + generator.writeKey("file_desc.percent"); + generator.write(this.fileDescPercent); } - if (this.load1m != null) { - generator.writeKey("load_1m"); - generator.write(this.load1m); + if (this.flavor != null) { + generator.writeKey("flavor"); + generator.write(this.flavor); } - if (this.load5m != null) { - generator.writeKey("load_5m"); - generator.write(this.load5m); + if (this.flushTotal != null) { + generator.writeKey("flush.total"); + generator.write(this.flushTotal); } - if (this.load15m != null) { - generator.writeKey("load_15m"); - generator.write(this.load15m); + if (this.flushTotalTime != null) { + generator.writeKey("flush.total_time"); + generator.write(this.flushTotalTime); } - if (this.uptime != null) { - generator.writeKey("uptime"); - generator.write(this.uptime); + if (this.getCurrent != null) { + generator.writeKey("get.current"); + generator.write(this.getCurrent); } - if (this.nodeRole != null) { - generator.writeKey("node.role"); - generator.write(this.nodeRole); + if (this.getExistsTime != null) { + generator.writeKey("get.exists_time"); + generator.write(this.getExistsTime); } - if (this.master != null) { - generator.writeKey("master"); - generator.write(this.master); + if (this.getExistsTotal != null) { + generator.writeKey("get.exists_total"); + generator.write(this.getExistsTotal); } - if (this.clusterManager != null) { - generator.writeKey("cluster_manager"); - generator.write(this.clusterManager); + if (this.getMissingTime != null) { + generator.writeKey("get.missing_time"); + generator.write(this.getMissingTime); } - if (this.name != null) { - generator.writeKey("name"); - generator.write(this.name); + if (this.getMissingTotal != null) { + generator.writeKey("get.missing_total"); + generator.write(this.getMissingTotal); } - if (this.completionSize != null) { - generator.writeKey("completion.size"); - generator.write(this.completionSize); + if (this.getTime != null) { + generator.writeKey("get.time"); + generator.write(this.getTime); } - if (this.fielddataMemorySize != null) { - generator.writeKey("fielddata.memory_size"); - generator.write(this.fielddataMemorySize); + if (this.getTotal != null) { + generator.writeKey("get.total"); + generator.write(this.getTotal); } - if (this.fielddataEvictions != null) { - generator.writeKey("fielddata.evictions"); - generator.write(this.fielddataEvictions); - - } - if (this.queryCacheMemorySize != null) { - generator.writeKey("query_cache.memory_size"); - generator.write(this.queryCacheMemorySize); - - } - if (this.queryCacheEvictions != null) { - generator.writeKey("query_cache.evictions"); - generator.write(this.queryCacheEvictions); - - } - if (this.queryCacheHitCount != null) { - generator.writeKey("query_cache.hit_count"); - generator.write(this.queryCacheHitCount); - - } - if (this.queryCacheMissCount != null) { - generator.writeKey("query_cache.miss_count"); - generator.write(this.queryCacheMissCount); - - } - if (this.requestCacheMemorySize != null) { - generator.writeKey("request_cache.memory_size"); - generator.write(this.requestCacheMemorySize); - - } - if (this.requestCacheEvictions != null) { - generator.writeKey("request_cache.evictions"); - generator.write(this.requestCacheEvictions); - - } - if (this.requestCacheHitCount != null) { - generator.writeKey("request_cache.hit_count"); - generator.write(this.requestCacheHitCount); - - } - if (this.requestCacheMissCount != null) { - generator.writeKey("request_cache.miss_count"); - generator.write(this.requestCacheMissCount); - - } - if (this.flushTotal != null) { - generator.writeKey("flush.total"); - generator.write(this.flushTotal); - - } - if (this.flushTotalTime != null) { - generator.writeKey("flush.total_time"); - generator.write(this.flushTotalTime); - - } - if (this.getCurrent != null) { - generator.writeKey("get.current"); - generator.write(this.getCurrent); - - } - if (this.getTime != null) { - generator.writeKey("get.time"); - generator.write(this.getTime); + if (this.heapCurrent != null) { + generator.writeKey("heap.current"); + generator.write(this.heapCurrent); } - if (this.getTotal != null) { - generator.writeKey("get.total"); - generator.write(this.getTotal); + if (this.heapMax != null) { + generator.writeKey("heap.max"); + generator.write(this.heapMax); } - if (this.getExistsTime != null) { - generator.writeKey("get.exists_time"); - generator.write(this.getExistsTime); + if (this.heapPercent != null) { + generator.writeKey("heap.percent"); + generator.write(this.heapPercent); } - if (this.getExistsTotal != null) { - generator.writeKey("get.exists_total"); - generator.write(this.getExistsTotal); + if (this.httpAddress != null) { + generator.writeKey("http_address"); + generator.write(this.httpAddress); } - if (this.getMissingTime != null) { - generator.writeKey("get.missing_time"); - generator.write(this.getMissingTime); + if (this.id != null) { + generator.writeKey("id"); + generator.write(this.id); } - if (this.getMissingTotal != null) { - generator.writeKey("get.missing_total"); - generator.write(this.getMissingTotal); - } if (this.indexingDeleteCurrent != null) { generator.writeKey("indexing.delete_current"); generator.write(this.indexingDeleteCurrent); - } + if (this.indexingDeleteTime != null) { generator.writeKey("indexing.delete_time"); generator.write(this.indexingDeleteTime); - } + if (this.indexingDeleteTotal != null) { generator.writeKey("indexing.delete_total"); generator.write(this.indexingDeleteTotal); - } + if (this.indexingIndexCurrent != null) { generator.writeKey("indexing.index_current"); generator.write(this.indexingIndexCurrent); + } + if (this.indexingIndexFailed != null) { + generator.writeKey("indexing.index_failed"); + generator.write(this.indexingIndexFailed); } + if (this.indexingIndexTime != null) { generator.writeKey("indexing.index_time"); generator.write(this.indexingIndexTime); - } + if (this.indexingIndexTotal != null) { generator.writeKey("indexing.index_total"); generator.write(this.indexingIndexTotal); + } + if (this.ip != null) { + generator.writeKey("ip"); + generator.write(this.ip); + } + + if (this.jdk != null) { + generator.writeKey("jdk"); + generator.write(this.jdk); } - if (this.indexingIndexFailed != null) { - generator.writeKey("indexing.index_failed"); - generator.write(this.indexingIndexFailed); + if (this.load15m != null) { + generator.writeKey("load_15m"); + generator.write(this.load15m); } + + if (this.load1m != null) { + generator.writeKey("load_1m"); + generator.write(this.load1m); + } + + if (this.load5m != null) { + generator.writeKey("load_5m"); + generator.write(this.load5m); + } + + if (this.master != null) { + generator.writeKey("master"); + generator.write(this.master); + } + if (this.mergesCurrent != null) { generator.writeKey("merges.current"); generator.write(this.mergesCurrent); - } + if (this.mergesCurrentDocs != null) { generator.writeKey("merges.current_docs"); generator.write(this.mergesCurrentDocs); - } + if (this.mergesCurrentSize != null) { generator.writeKey("merges.current_size"); generator.write(this.mergesCurrentSize); - } + if (this.mergesTotal != null) { generator.writeKey("merges.total"); generator.write(this.mergesTotal); - } + if (this.mergesTotalDocs != null) { generator.writeKey("merges.total_docs"); generator.write(this.mergesTotalDocs); - } + if (this.mergesTotalSize != null) { generator.writeKey("merges.total_size"); generator.write(this.mergesTotalSize); - } + if (this.mergesTotalTime != null) { generator.writeKey("merges.total_time"); generator.write(this.mergesTotalTime); + } + if (this.name != null) { + generator.writeKey("name"); + generator.write(this.name); } - if (this.refreshTotal != null) { - generator.writeKey("refresh.total"); - generator.write(this.refreshTotal); + if (this.nodeRole != null) { + generator.writeKey("node.role"); + generator.write(this.nodeRole); } - if (this.refreshTime != null) { - generator.writeKey("refresh.time"); - generator.write(this.refreshTime); + if (this.nodeRoles != null) { + generator.writeKey("node.roles"); + generator.write(this.nodeRoles); + } + + if (this.pid != null) { + generator.writeKey("pid"); + generator.write(this.pid); + } + + if (this.port != null) { + generator.writeKey("port"); + generator.write(this.port); + } + + if (this.queryCacheEvictions != null) { + generator.writeKey("query_cache.evictions"); + generator.write(this.queryCacheEvictions); + } + + if (this.queryCacheHitCount != null) { + generator.writeKey("query_cache.hit_count"); + generator.write(this.queryCacheHitCount); + } + + if (this.queryCacheMemorySize != null) { + generator.writeKey("query_cache.memory_size"); + generator.write(this.queryCacheMemorySize); + } + + if (this.queryCacheMissCount != null) { + generator.writeKey("query_cache.miss_count"); + generator.write(this.queryCacheMissCount); + } + + if (this.ramCurrent != null) { + generator.writeKey("ram.current"); + generator.write(this.ramCurrent); } - if (this.refreshExternalTotal != null) { - generator.writeKey("refresh.external_total"); - generator.write(this.refreshExternalTotal); + if (this.ramMax != null) { + generator.writeKey("ram.max"); + generator.write(this.ramMax); } + + if (this.ramPercent != null) { + generator.writeKey("ram.percent"); + generator.write(this.ramPercent); + } + if (this.refreshExternalTime != null) { generator.writeKey("refresh.external_time"); generator.write(this.refreshExternalTime); + } + if (this.refreshExternalTotal != null) { + generator.writeKey("refresh.external_total"); + generator.write(this.refreshExternalTotal); } + if (this.refreshListeners != null) { generator.writeKey("refresh.listeners"); generator.write(this.refreshListeners); + } + if (this.refreshTime != null) { + generator.writeKey("refresh.time"); + generator.write(this.refreshTime); + } + + if (this.refreshTotal != null) { + generator.writeKey("refresh.total"); + generator.write(this.refreshTotal); } - if (this.scriptCompilations != null) { - generator.writeKey("script.compilations"); - generator.write(this.scriptCompilations); + if (this.requestCacheEvictions != null) { + generator.writeKey("request_cache.evictions"); + generator.write(this.requestCacheEvictions); + } + + if (this.requestCacheHitCount != null) { + generator.writeKey("request_cache.hit_count"); + generator.write(this.requestCacheHitCount); + } + + if (this.requestCacheMemorySize != null) { + generator.writeKey("request_cache.memory_size"); + generator.write(this.requestCacheMemorySize); } + + if (this.requestCacheMissCount != null) { + generator.writeKey("request_cache.miss_count"); + generator.write(this.requestCacheMissCount); + } + if (this.scriptCacheEvictions != null) { generator.writeKey("script.cache_evictions"); generator.write(this.scriptCacheEvictions); - } + if (this.scriptCompilationLimitTriggered != null) { generator.writeKey("script.compilation_limit_triggered"); generator.write(this.scriptCompilationLimitTriggered); + } + + if (this.scriptCompilations != null) { + generator.writeKey("script.compilations"); + generator.write(this.scriptCompilations); + } + + if (this.searchConcurrentAvgSliceCount != null) { + generator.writeKey("search.concurrent_avg_slice_count"); + generator.write(this.searchConcurrentAvgSliceCount); + } + + if (this.searchConcurrentQueryCurrent != null) { + generator.writeKey("search.concurrent_query_current"); + generator.write(this.searchConcurrentQueryCurrent); + } + + if (this.searchConcurrentQueryTime != null) { + generator.writeKey("search.concurrent_query_time"); + generator.write(this.searchConcurrentQueryTime); + } + if (this.searchConcurrentQueryTotal != null) { + generator.writeKey("search.concurrent_query_total"); + generator.write(this.searchConcurrentQueryTotal); } + if (this.searchFetchCurrent != null) { generator.writeKey("search.fetch_current"); generator.write(this.searchFetchCurrent); - } + if (this.searchFetchTime != null) { generator.writeKey("search.fetch_time"); generator.write(this.searchFetchTime); - } + if (this.searchFetchTotal != null) { generator.writeKey("search.fetch_total"); generator.write(this.searchFetchTotal); - } + if (this.searchOpenContexts != null) { generator.writeKey("search.open_contexts"); generator.write(this.searchOpenContexts); + } + + if (this.searchPointInTimeCurrent != null) { + generator.writeKey("search.point_in_time_current"); + generator.write(this.searchPointInTimeCurrent); + } + if (this.searchPointInTimeTime != null) { + generator.writeKey("search.point_in_time_time"); + generator.write(this.searchPointInTimeTime); } + + if (this.searchPointInTimeTotal != null) { + generator.writeKey("search.point_in_time_total"); + generator.write(this.searchPointInTimeTotal); + } + if (this.searchQueryCurrent != null) { generator.writeKey("search.query_current"); generator.write(this.searchQueryCurrent); - } + if (this.searchQueryTime != null) { generator.writeKey("search.query_time"); generator.write(this.searchQueryTime); - } + if (this.searchQueryTotal != null) { generator.writeKey("search.query_total"); generator.write(this.searchQueryTotal); - } + if (this.searchScrollCurrent != null) { generator.writeKey("search.scroll_current"); generator.write(this.searchScrollCurrent); - } + if (this.searchScrollTime != null) { generator.writeKey("search.scroll_time"); generator.write(this.searchScrollTime); - } + if (this.searchScrollTotal != null) { generator.writeKey("search.scroll_total"); generator.write(this.searchScrollTotal); - } + if (this.segmentsCount != null) { generator.writeKey("segments.count"); generator.write(this.segmentsCount); - } - if (this.segmentsMemory != null) { - generator.writeKey("segments.memory"); - generator.write(this.segmentsMemory); + if (this.segmentsFixedBitsetMemory != null) { + generator.writeKey("segments.fixed_bitset_memory"); + generator.write(this.segmentsFixedBitsetMemory); } + if (this.segmentsIndexWriterMemory != null) { generator.writeKey("segments.index_writer_memory"); generator.write(this.segmentsIndexWriterMemory); + } + if (this.segmentsMemory != null) { + generator.writeKey("segments.memory"); + generator.write(this.segmentsMemory); } + if (this.segmentsVersionMapMemory != null) { generator.writeKey("segments.version_map_memory"); generator.write(this.segmentsVersionMapMemory); - } - if (this.segmentsFixedBitsetMemory != null) { - generator.writeKey("segments.fixed_bitset_memory"); - generator.write(this.segmentsFixedBitsetMemory); - } if (this.suggestCurrent != null) { generator.writeKey("suggest.current"); generator.write(this.suggestCurrent); - } + if (this.suggestTime != null) { generator.writeKey("suggest.time"); generator.write(this.suggestTime); - } + if (this.suggestTotal != null) { generator.writeKey("suggest.total"); generator.write(this.suggestTotal); - } - if (this.bulkTotalOperations != null) { - generator.writeKey("bulk.total_operations"); - generator.write(this.bulkTotalOperations); - - } - if (this.bulkTotalTime != null) { - generator.writeKey("bulk.total_time"); - generator.write(this.bulkTotalTime); + if (this.type != null) { + generator.writeKey("type"); + generator.write(this.type); } - if (this.bulkTotalSizeInBytes != null) { - generator.writeKey("bulk.total_size_in_bytes"); - generator.write(this.bulkTotalSizeInBytes); + if (this.uptime != null) { + generator.writeKey("uptime"); + generator.write(this.uptime); } - if (this.bulkAvgTime != null) { - generator.writeKey("bulk.avg_time"); - generator.write(this.bulkAvgTime); + if (this.version != null) { + generator.writeKey("version"); + generator.write(this.version); } - if (this.bulkAvgSizeInBytes != null) { - generator.writeKey("bulk.avg_size_in_bytes"); - generator.write(this.bulkAvgSizeInBytes); + } - } + // --------------------------------------------------------------------------------------------- + @Override + @Nonnull + public Builder toBuilder() { + return new Builder(this); } - // --------------------------------------------------------------------------------------------- + @Nonnull + public static Builder builder() { + return new Builder(); + } /** * Builder for {@link NodesRecord}. */ - - public static class Builder extends ObjectBuilderBase implements ObjectBuilder { - @Nullable - private String id; - - @Nullable - private String pid; - - @Nullable - private String ip; - - @Nullable - private String port; - - @Nullable - private String httpAddress; - - @Nullable - private String version; - - @Nullable - private String flavor; - - @Nullable - private String type; - + public static class Builder extends ObjectBuilderBase implements CopyableBuilder { @Nullable private String build; - - @Nullable - private String jdk; - - @Nullable - private String diskTotal; - - @Nullable - private String diskUsed; - - @Nullable - private String diskAvail; - - @Nullable - private String diskUsedPercent; - - @Nullable - private String heapCurrent; - - @Nullable - private String heapPercent; - - @Nullable - private String heapMax; - - @Nullable - private String ramCurrent; - - @Nullable - private String ramPercent; - - @Nullable - private String ramMax; - - @Nullable - private String fileDescCurrent; - - @Nullable - private String fileDescPercent; - - @Nullable - private String fileDescMax; - - @Nullable - private String cpu; - - @Nullable - private String load1m; - - @Nullable - private String load5m; - @Nullable - private String load15m; - + private String bulkAvgSizeInBytes; @Nullable - private String uptime; - + private String bulkAvgTime; @Nullable - private String nodeRole; - - @Deprecated + private String bulkTotalOperations; @Nullable - private String master; - + private String bulkTotalSizeInBytes; @Nullable - private String clusterManager; - + private String bulkTotalTime; @Nullable - private String name; - + private String clusterManager; @Nullable private String completionSize; - @Nullable - private String fielddataMemorySize; - + private String cpu; @Nullable - private String fielddataEvictions; - + private String diskAvail; @Nullable - private String queryCacheMemorySize; - + private String diskTotal; @Nullable - private String queryCacheEvictions; - + private String diskUsed; @Nullable - private String queryCacheHitCount; - + private String diskUsedPercent; @Nullable - private String queryCacheMissCount; - + private String fielddataEvictions; @Nullable - private String requestCacheMemorySize; - + private String fielddataMemorySize; @Nullable - private String requestCacheEvictions; - + private String fileDescCurrent; @Nullable - private String requestCacheHitCount; - + private String fileDescMax; @Nullable - private String requestCacheMissCount; - + private String fileDescPercent; + @Nullable + private String flavor; @Nullable private String flushTotal; - @Nullable private String flushTotalTime; - @Nullable private String getCurrent; - - @Nullable - private String getTime; - - @Nullable - private String getTotal; - @Nullable private String getExistsTime; - @Nullable private String getExistsTotal; - @Nullable private String getMissingTime; - @Nullable private String getMissingTotal; - + @Nullable + private String getTime; + @Nullable + private String getTotal; + @Nullable + private String heapCurrent; + @Nullable + private String heapMax; + @Nullable + private String heapPercent; + @Nullable + private String httpAddress; + @Nullable + private String id; @Nullable private String indexingDeleteCurrent; - @Nullable private String indexingDeleteTime; - @Nullable private String indexingDeleteTotal; - @Nullable private String indexingIndexCurrent; - + @Nullable + private String indexingIndexFailed; @Nullable private String indexingIndexTime; - @Nullable private String indexingIndexTotal; - @Nullable - private String indexingIndexFailed; - + private String ip; + @Nullable + private String jdk; + @Nullable + private String load15m; + @Nullable + private String load1m; + @Nullable + private String load5m; + @Nullable + private String master; @Nullable private String mergesCurrent; - @Nullable private String mergesCurrentDocs; - @Nullable private String mergesCurrentSize; - @Nullable private String mergesTotal; - @Nullable private String mergesTotalDocs; - @Nullable private String mergesTotalSize; - @Nullable private String mergesTotalTime; - @Nullable - private String refreshTotal; - + private String name; @Nullable - private String refreshTime; - + private String nodeRole; @Nullable - private String refreshExternalTotal; - + private String nodeRoles; + @Nullable + private String pid; + @Nullable + private String port; + @Nullable + private String queryCacheEvictions; + @Nullable + private String queryCacheHitCount; + @Nullable + private String queryCacheMemorySize; + @Nullable + private String queryCacheMissCount; + @Nullable + private String ramCurrent; + @Nullable + private String ramMax; + @Nullable + private String ramPercent; @Nullable private String refreshExternalTime; - + @Nullable + private String refreshExternalTotal; @Nullable private String refreshListeners; - @Nullable - private String scriptCompilations; - + private String refreshTime; + @Nullable + private String refreshTotal; + @Nullable + private String requestCacheEvictions; + @Nullable + private String requestCacheHitCount; + @Nullable + private String requestCacheMemorySize; + @Nullable + private String requestCacheMissCount; @Nullable private String scriptCacheEvictions; - @Nullable private String scriptCompilationLimitTriggered; - + @Nullable + private String scriptCompilations; + @Nullable + private String searchConcurrentAvgSliceCount; + @Nullable + private String searchConcurrentQueryCurrent; + @Nullable + private String searchConcurrentQueryTime; + @Nullable + private String searchConcurrentQueryTotal; @Nullable private String searchFetchCurrent; - @Nullable private String searchFetchTime; - @Nullable private String searchFetchTotal; - @Nullable private String searchOpenContexts; - + @Nullable + private String searchPointInTimeCurrent; + @Nullable + private String searchPointInTimeTime; + @Nullable + private String searchPointInTimeTotal; @Nullable private String searchQueryCurrent; - @Nullable private String searchQueryTime; - @Nullable private String searchQueryTotal; - @Nullable private String searchScrollCurrent; - @Nullable private String searchScrollTime; - @Nullable private String searchScrollTotal; - @Nullable private String segmentsCount; - @Nullable - private String segmentsMemory; - + private String segmentsFixedBitsetMemory; @Nullable private String segmentsIndexWriterMemory; - @Nullable - private String segmentsVersionMapMemory; - + private String segmentsMemory; @Nullable - private String segmentsFixedBitsetMemory; - + private String segmentsVersionMapMemory; @Nullable private String suggestCurrent; - @Nullable private String suggestTime; - @Nullable private String suggestTotal; - @Nullable - private String bulkTotalOperations; - + private String type; @Nullable - private String bulkTotalTime; - + private String uptime; @Nullable - private String bulkTotalSizeInBytes; + private String version; - @Nullable - private String bulkAvgTime; + public Builder() {} + + private Builder(NodesRecord o) { + this.build = o.build; + this.bulkAvgSizeInBytes = o.bulkAvgSizeInBytes; + this.bulkAvgTime = o.bulkAvgTime; + this.bulkTotalOperations = o.bulkTotalOperations; + this.bulkTotalSizeInBytes = o.bulkTotalSizeInBytes; + this.bulkTotalTime = o.bulkTotalTime; + this.clusterManager = o.clusterManager; + this.completionSize = o.completionSize; + this.cpu = o.cpu; + this.diskAvail = o.diskAvail; + this.diskTotal = o.diskTotal; + this.diskUsed = o.diskUsed; + this.diskUsedPercent = o.diskUsedPercent; + this.fielddataEvictions = o.fielddataEvictions; + this.fielddataMemorySize = o.fielddataMemorySize; + this.fileDescCurrent = o.fileDescCurrent; + this.fileDescMax = o.fileDescMax; + this.fileDescPercent = o.fileDescPercent; + this.flavor = o.flavor; + this.flushTotal = o.flushTotal; + this.flushTotalTime = o.flushTotalTime; + this.getCurrent = o.getCurrent; + this.getExistsTime = o.getExistsTime; + this.getExistsTotal = o.getExistsTotal; + this.getMissingTime = o.getMissingTime; + this.getMissingTotal = o.getMissingTotal; + this.getTime = o.getTime; + this.getTotal = o.getTotal; + this.heapCurrent = o.heapCurrent; + this.heapMax = o.heapMax; + this.heapPercent = o.heapPercent; + this.httpAddress = o.httpAddress; + this.id = o.id; + this.indexingDeleteCurrent = o.indexingDeleteCurrent; + this.indexingDeleteTime = o.indexingDeleteTime; + this.indexingDeleteTotal = o.indexingDeleteTotal; + this.indexingIndexCurrent = o.indexingIndexCurrent; + this.indexingIndexFailed = o.indexingIndexFailed; + this.indexingIndexTime = o.indexingIndexTime; + this.indexingIndexTotal = o.indexingIndexTotal; + this.ip = o.ip; + this.jdk = o.jdk; + this.load15m = o.load15m; + this.load1m = o.load1m; + this.load5m = o.load5m; + this.master = o.master; + this.mergesCurrent = o.mergesCurrent; + this.mergesCurrentDocs = o.mergesCurrentDocs; + this.mergesCurrentSize = o.mergesCurrentSize; + this.mergesTotal = o.mergesTotal; + this.mergesTotalDocs = o.mergesTotalDocs; + this.mergesTotalSize = o.mergesTotalSize; + this.mergesTotalTime = o.mergesTotalTime; + this.name = o.name; + this.nodeRole = o.nodeRole; + this.nodeRoles = o.nodeRoles; + this.pid = o.pid; + this.port = o.port; + this.queryCacheEvictions = o.queryCacheEvictions; + this.queryCacheHitCount = o.queryCacheHitCount; + this.queryCacheMemorySize = o.queryCacheMemorySize; + this.queryCacheMissCount = o.queryCacheMissCount; + this.ramCurrent = o.ramCurrent; + this.ramMax = o.ramMax; + this.ramPercent = o.ramPercent; + this.refreshExternalTime = o.refreshExternalTime; + this.refreshExternalTotal = o.refreshExternalTotal; + this.refreshListeners = o.refreshListeners; + this.refreshTime = o.refreshTime; + this.refreshTotal = o.refreshTotal; + this.requestCacheEvictions = o.requestCacheEvictions; + this.requestCacheHitCount = o.requestCacheHitCount; + this.requestCacheMemorySize = o.requestCacheMemorySize; + this.requestCacheMissCount = o.requestCacheMissCount; + this.scriptCacheEvictions = o.scriptCacheEvictions; + this.scriptCompilationLimitTriggered = o.scriptCompilationLimitTriggered; + this.scriptCompilations = o.scriptCompilations; + this.searchConcurrentAvgSliceCount = o.searchConcurrentAvgSliceCount; + this.searchConcurrentQueryCurrent = o.searchConcurrentQueryCurrent; + this.searchConcurrentQueryTime = o.searchConcurrentQueryTime; + this.searchConcurrentQueryTotal = o.searchConcurrentQueryTotal; + this.searchFetchCurrent = o.searchFetchCurrent; + this.searchFetchTime = o.searchFetchTime; + this.searchFetchTotal = o.searchFetchTotal; + this.searchOpenContexts = o.searchOpenContexts; + this.searchPointInTimeCurrent = o.searchPointInTimeCurrent; + this.searchPointInTimeTime = o.searchPointInTimeTime; + this.searchPointInTimeTotal = o.searchPointInTimeTotal; + this.searchQueryCurrent = o.searchQueryCurrent; + this.searchQueryTime = o.searchQueryTime; + this.searchQueryTotal = o.searchQueryTotal; + this.searchScrollCurrent = o.searchScrollCurrent; + this.searchScrollTime = o.searchScrollTime; + this.searchScrollTotal = o.searchScrollTotal; + this.segmentsCount = o.segmentsCount; + this.segmentsFixedBitsetMemory = o.segmentsFixedBitsetMemory; + this.segmentsIndexWriterMemory = o.segmentsIndexWriterMemory; + this.segmentsMemory = o.segmentsMemory; + this.segmentsVersionMapMemory = o.segmentsVersionMapMemory; + this.suggestCurrent = o.suggestCurrent; + this.suggestTime = o.suggestTime; + this.suggestTotal = o.suggestTotal; + this.type = o.type; + this.uptime = o.uptime; + this.version = o.version; + } + + private Builder(Builder o) { + this.build = o.build; + this.bulkAvgSizeInBytes = o.bulkAvgSizeInBytes; + this.bulkAvgTime = o.bulkAvgTime; + this.bulkTotalOperations = o.bulkTotalOperations; + this.bulkTotalSizeInBytes = o.bulkTotalSizeInBytes; + this.bulkTotalTime = o.bulkTotalTime; + this.clusterManager = o.clusterManager; + this.completionSize = o.completionSize; + this.cpu = o.cpu; + this.diskAvail = o.diskAvail; + this.diskTotal = o.diskTotal; + this.diskUsed = o.diskUsed; + this.diskUsedPercent = o.diskUsedPercent; + this.fielddataEvictions = o.fielddataEvictions; + this.fielddataMemorySize = o.fielddataMemorySize; + this.fileDescCurrent = o.fileDescCurrent; + this.fileDescMax = o.fileDescMax; + this.fileDescPercent = o.fileDescPercent; + this.flavor = o.flavor; + this.flushTotal = o.flushTotal; + this.flushTotalTime = o.flushTotalTime; + this.getCurrent = o.getCurrent; + this.getExistsTime = o.getExistsTime; + this.getExistsTotal = o.getExistsTotal; + this.getMissingTime = o.getMissingTime; + this.getMissingTotal = o.getMissingTotal; + this.getTime = o.getTime; + this.getTotal = o.getTotal; + this.heapCurrent = o.heapCurrent; + this.heapMax = o.heapMax; + this.heapPercent = o.heapPercent; + this.httpAddress = o.httpAddress; + this.id = o.id; + this.indexingDeleteCurrent = o.indexingDeleteCurrent; + this.indexingDeleteTime = o.indexingDeleteTime; + this.indexingDeleteTotal = o.indexingDeleteTotal; + this.indexingIndexCurrent = o.indexingIndexCurrent; + this.indexingIndexFailed = o.indexingIndexFailed; + this.indexingIndexTime = o.indexingIndexTime; + this.indexingIndexTotal = o.indexingIndexTotal; + this.ip = o.ip; + this.jdk = o.jdk; + this.load15m = o.load15m; + this.load1m = o.load1m; + this.load5m = o.load5m; + this.master = o.master; + this.mergesCurrent = o.mergesCurrent; + this.mergesCurrentDocs = o.mergesCurrentDocs; + this.mergesCurrentSize = o.mergesCurrentSize; + this.mergesTotal = o.mergesTotal; + this.mergesTotalDocs = o.mergesTotalDocs; + this.mergesTotalSize = o.mergesTotalSize; + this.mergesTotalTime = o.mergesTotalTime; + this.name = o.name; + this.nodeRole = o.nodeRole; + this.nodeRoles = o.nodeRoles; + this.pid = o.pid; + this.port = o.port; + this.queryCacheEvictions = o.queryCacheEvictions; + this.queryCacheHitCount = o.queryCacheHitCount; + this.queryCacheMemorySize = o.queryCacheMemorySize; + this.queryCacheMissCount = o.queryCacheMissCount; + this.ramCurrent = o.ramCurrent; + this.ramMax = o.ramMax; + this.ramPercent = o.ramPercent; + this.refreshExternalTime = o.refreshExternalTime; + this.refreshExternalTotal = o.refreshExternalTotal; + this.refreshListeners = o.refreshListeners; + this.refreshTime = o.refreshTime; + this.refreshTotal = o.refreshTotal; + this.requestCacheEvictions = o.requestCacheEvictions; + this.requestCacheHitCount = o.requestCacheHitCount; + this.requestCacheMemorySize = o.requestCacheMemorySize; + this.requestCacheMissCount = o.requestCacheMissCount; + this.scriptCacheEvictions = o.scriptCacheEvictions; + this.scriptCompilationLimitTriggered = o.scriptCompilationLimitTriggered; + this.scriptCompilations = o.scriptCompilations; + this.searchConcurrentAvgSliceCount = o.searchConcurrentAvgSliceCount; + this.searchConcurrentQueryCurrent = o.searchConcurrentQueryCurrent; + this.searchConcurrentQueryTime = o.searchConcurrentQueryTime; + this.searchConcurrentQueryTotal = o.searchConcurrentQueryTotal; + this.searchFetchCurrent = o.searchFetchCurrent; + this.searchFetchTime = o.searchFetchTime; + this.searchFetchTotal = o.searchFetchTotal; + this.searchOpenContexts = o.searchOpenContexts; + this.searchPointInTimeCurrent = o.searchPointInTimeCurrent; + this.searchPointInTimeTime = o.searchPointInTimeTime; + this.searchPointInTimeTotal = o.searchPointInTimeTotal; + this.searchQueryCurrent = o.searchQueryCurrent; + this.searchQueryTime = o.searchQueryTime; + this.searchQueryTotal = o.searchQueryTotal; + this.searchScrollCurrent = o.searchScrollCurrent; + this.searchScrollTime = o.searchScrollTime; + this.searchScrollTotal = o.searchScrollTotal; + this.segmentsCount = o.segmentsCount; + this.segmentsFixedBitsetMemory = o.segmentsFixedBitsetMemory; + this.segmentsIndexWriterMemory = o.segmentsIndexWriterMemory; + this.segmentsMemory = o.segmentsMemory; + this.segmentsVersionMapMemory = o.segmentsVersionMapMemory; + this.suggestCurrent = o.suggestCurrent; + this.suggestTime = o.suggestTime; + this.suggestTotal = o.suggestTotal; + this.type = o.type; + this.uptime = o.uptime; + this.version = o.version; + } + + @Override + @Nonnull + public Builder copy() { + return new Builder(this); + } - @Nullable - private String bulkAvgSizeInBytes; + /** + * The OpenSearch build hash. + *

+ * API name: {@code build} + *

+ */ + @Nonnull + public final Builder build(@Nullable String value) { + this.build = value; + return this; + } /** - * unique node id + * The average size in bytes of shard bulk. *

- * API name: {@code id} + * API name: {@code bulk.avg_size_in_bytes} + *

*/ - public final Builder id(@Nullable String value) { - this.id = value; + @Nonnull + public final Builder bulkAvgSizeInBytes(@Nullable String value) { + this.bulkAvgSizeInBytes = value; + return this; + } + + /** + * The average time spend in shard bulk. + *

+ * API name: {@code bulk.avg_time} + *

+ */ + @Nonnull + public final Builder bulkAvgTime(@Nullable String value) { + this.bulkAvgTime = value; + return this; + } + + /** + * The number of bulk shard operations. + *

+ * API name: {@code bulk.total_operations} + *

+ */ + @Nonnull + public final Builder bulkTotalOperations(@Nullable String value) { + this.bulkTotalOperations = value; + return this; + } + + /** + * The total size in bytes of shard bulk. + *

+ * API name: {@code bulk.total_size_in_bytes} + *

+ */ + @Nonnull + public final Builder bulkTotalSizeInBytes(@Nullable String value) { + this.bulkTotalSizeInBytes = value; + return this; + } + + /** + * The time spend in shard bulk. + *

+ * API name: {@code bulk.total_time} + *

+ */ + @Nonnull + public final Builder bulkTotalTime(@Nullable String value) { + this.bulkTotalTime = value; + return this; + } + + /** + * Indicates whether the node is the elected cluster-manager node. Returned values include *(elected cluster-manager) + * and -(not elected cluster-manager). + *

+ * API name: {@code cluster_manager} + *

+ */ + @Nonnull + public final Builder clusterManager(@Nullable String value) { + this.clusterManager = value; + return this; + } + + /** + * The size of completion. + *

+ * API name: {@code completion.size} + *

+ */ + @Nonnull + public final Builder completionSize(@Nullable String value) { + this.completionSize = value; return this; } /** - * process id + * The recent system CPU usage as a percentage. *

- * API name: {@code pid} + * API name: {@code cpu} + *

*/ - public final Builder pid(@Nullable String value) { - this.pid = value; + @Nonnull + public final Builder cpu(@Nullable String value) { + this.cpu = value; return this; } /** - * ip address - *

- * API name: {@code ip} + * API name: {@code disk.avail} */ - public final Builder ip(@Nullable String value) { - this.ip = value; + @Nonnull + public final Builder diskAvail(@Nullable String value) { + this.diskAvail = value; return this; } /** - * bound transport port - *

- * API name: {@code port} + * API name: {@code disk.total} */ - public final Builder port(@Nullable String value) { - this.port = value; + @Nonnull + public final Builder diskTotal(@Nullable String value) { + this.diskTotal = value; return this; } /** - * bound http address - *

- * API name: {@code http_address} + * API name: {@code disk.used} */ - public final Builder httpAddress(@Nullable String value) { - this.httpAddress = value; + @Nonnull + public final Builder diskUsed(@Nullable String value) { + this.diskUsed = value; return this; } /** - * es version - *

- * API name: {@code version} + * API name: {@code disk.used_percent} */ - public final Builder version(@Nullable String value) { - this.version = value; + @Nonnull + public final Builder diskUsedPercent(@Nullable String value) { + this.diskUsedPercent = value; return this; } /** - * es distribution flavor + * The field data evictions. *

- * API name: {@code flavor} + * API name: {@code fielddata.evictions} + *

*/ - public final Builder flavor(@Nullable String value) { - this.flavor = value; + @Nonnull + public final Builder fielddataEvictions(@Nullable String value) { + this.fielddataEvictions = value; return this; } /** - * es distribution type + * The used field data cache. *

- * API name: {@code type} + * API name: {@code fielddata.memory_size} + *

*/ - public final Builder type(@Nullable String value) { - this.type = value; + @Nonnull + public final Builder fielddataMemorySize(@Nullable String value) { + this.fielddataMemorySize = value; return this; } /** - * es build hash + * The used file descriptors. *

- * API name: {@code build} + * API name: {@code file_desc.current} + *

*/ - public final Builder build(@Nullable String value) { - this.build = value; + @Nonnull + public final Builder fileDescCurrent(@Nullable String value) { + this.fileDescCurrent = value; return this; } /** - * jdk version + * The maximum number of file descriptors. *

- * API name: {@code jdk} + * API name: {@code file_desc.max} + *

*/ - public final Builder jdk(@Nullable String value) { - this.jdk = value; + @Nonnull + public final Builder fileDescMax(@Nullable String value) { + this.fileDescMax = value; return this; } /** - * total disk space - *

- * API name: {@code disk.total} + * API name: {@code file_desc.percent} */ - public final Builder diskTotal(@Nullable String value) { - this.diskTotal = value; + @Nonnull + public final Builder fileDescPercent(@Nullable String value) { + this.fileDescPercent = value; return this; } /** - * used disk space + * The OpenSearch distribution flavor. *

- * API name: {@code disk.used} + * API name: {@code flavor} + *

*/ - public final Builder diskUsed(@Nullable String value) { - this.diskUsed = value; + @Nonnull + public final Builder flavor(@Nullable String value) { + this.flavor = value; return this; } /** - * available disk space + * The number of flushes. *

- * API name: {@code disk.avail} + * API name: {@code flush.total} + *

*/ - public final Builder diskAvail(@Nullable String value) { - this.diskAvail = value; + @Nonnull + public final Builder flushTotal(@Nullable String value) { + this.flushTotal = value; return this; } /** - * used disk space percentage + * The time spent in flush. *

- * API name: {@code disk.used_percent} + * API name: {@code flush.total_time} + *

*/ - public final Builder diskUsedPercent(@Nullable String value) { - this.diskUsedPercent = value; + @Nonnull + public final Builder flushTotalTime(@Nullable String value) { + this.flushTotalTime = value; return this; } /** - * used heap + * The number of current get ops. *

- * API name: {@code heap.current} + * API name: {@code get.current} + *

*/ - public final Builder heapCurrent(@Nullable String value) { - this.heapCurrent = value; + @Nonnull + public final Builder getCurrent(@Nullable String value) { + this.getCurrent = value; return this; } /** - * used heap ratio + * The time spent in successful gets. *

- * API name: {@code heap.percent} + * API name: {@code get.exists_time} + *

*/ - public final Builder heapPercent(@Nullable String value) { - this.heapPercent = value; + @Nonnull + public final Builder getExistsTime(@Nullable String value) { + this.getExistsTime = value; return this; } /** - * max configured heap + * The number of successful get operations. *

- * API name: {@code heap.max} + * API name: {@code get.exists_total} + *

*/ - public final Builder heapMax(@Nullable String value) { - this.heapMax = value; + @Nonnull + public final Builder getExistsTotal(@Nullable String value) { + this.getExistsTotal = value; return this; } /** - * used machine memory + * The time spent in failed gets. *

- * API name: {@code ram.current} + * API name: {@code get.missing_time} + *

*/ - public final Builder ramCurrent(@Nullable String value) { - this.ramCurrent = value; + @Nonnull + public final Builder getMissingTime(@Nullable String value) { + this.getMissingTime = value; return this; } /** - * used machine memory ratio + * The number of failed gets. *

- * API name: {@code ram.percent} + * API name: {@code get.missing_total} + *

*/ - public final Builder ramPercent(@Nullable String value) { - this.ramPercent = value; + @Nonnull + public final Builder getMissingTotal(@Nullable String value) { + this.getMissingTotal = value; return this; } /** - * total machine memory + * The time spent in get. *

- * API name: {@code ram.max} + * API name: {@code get.time} + *

*/ - public final Builder ramMax(@Nullable String value) { - this.ramMax = value; + @Nonnull + public final Builder getTime(@Nullable String value) { + this.getTime = value; return this; } /** - * used file descriptors + * The number of get ops. *

- * API name: {@code file_desc.current} + * API name: {@code get.total} + *

*/ - public final Builder fileDescCurrent(@Nullable String value) { - this.fileDescCurrent = value; + @Nonnull + public final Builder getTotal(@Nullable String value) { + this.getTotal = value; return this; } /** - * used file descriptor ratio + * The used heap. *

- * API name: {@code file_desc.percent} + * API name: {@code heap.current} + *

*/ - public final Builder fileDescPercent(@Nullable String value) { - this.fileDescPercent = value; + @Nonnull + public final Builder heapCurrent(@Nullable String value) { + this.heapCurrent = value; return this; } /** - * max file descriptors + * The maximum configured heap. *

- * API name: {@code file_desc.max} + * API name: {@code heap.max} + *

*/ - public final Builder fileDescMax(@Nullable String value) { - this.fileDescMax = value; + @Nonnull + public final Builder heapMax(@Nullable String value) { + this.heapMax = value; return this; } /** - * recent cpu usage - *

- * API name: {@code cpu} + * API name: {@code heap.percent} */ - public final Builder cpu(@Nullable String value) { - this.cpu = value; + @Nonnull + public final Builder heapPercent(@Nullable String value) { + this.heapPercent = value; return this; } /** - * 1m load avg + * The bound HTTP address. *

- * API name: {@code load_1m} + * API name: {@code http_address} + *

*/ - public final Builder load1m(@Nullable String value) { - this.load1m = value; + @Nonnull + public final Builder httpAddress(@Nullable String value) { + this.httpAddress = value; return this; } /** - * 5m load avg - *

- * API name: {@code load_5m} + * API name: {@code id} */ - public final Builder load5m(@Nullable String value) { - this.load5m = value; + @Nonnull + public final Builder id(@Nullable String value) { + this.id = value; return this; } /** - * 15m load avg + * The number of current deletions. *

- * API name: {@code load_15m} + * API name: {@code indexing.delete_current} + *

*/ - public final Builder load15m(@Nullable String value) { - this.load15m = value; + @Nonnull + public final Builder indexingDeleteCurrent(@Nullable String value) { + this.indexingDeleteCurrent = value; return this; } /** - * node uptime + * The time spent in deletions. *

- * API name: {@code uptime} + * API name: {@code indexing.delete_time} + *

*/ - public final Builder uptime(@Nullable String value) { - this.uptime = value; + @Nonnull + public final Builder indexingDeleteTime(@Nullable String value) { + this.indexingDeleteTime = value; return this; } /** - * m:cluster-manager eligible node, d:data node, i:ingest node, -:coordinating node only + * The number of delete operations. *

- * API name: {@code node.role} + * API name: {@code indexing.delete_total} + *

*/ - public final Builder nodeRole(@Nullable String value) { - this.nodeRole = value; + @Nonnull + public final Builder indexingDeleteTotal(@Nullable String value) { + this.indexingDeleteTotal = value; return this; } /** - * *:current master + * The number of current indexing operations. *

- * API name: {@code master} + * API name: {@code indexing.index_current} + *

*/ - @Deprecated - public final Builder master(@Nullable String value) { - this.master = value; + @Nonnull + public final Builder indexingIndexCurrent(@Nullable String value) { + this.indexingIndexCurrent = value; return this; } /** - * *:current cluster-manager + * The number of failed indexing operations. *

- * API name: {@code clusterManager} + * API name: {@code indexing.index_failed} + *

*/ - public final Builder clusterManager(@Nullable String value) { - this.clusterManager = value; + @Nonnull + public final Builder indexingIndexFailed(@Nullable String value) { + this.indexingIndexFailed = value; return this; } /** - * node name + * The time spent in indexing. *

- * API name: {@code name} + * API name: {@code indexing.index_time} + *

*/ - public final Builder name(@Nullable String value) { - this.name = value; + @Nonnull + public final Builder indexingIndexTime(@Nullable String value) { + this.indexingIndexTime = value; return this; } /** - * size of completion + * The number of indexing operations. *

- * API name: {@code completion.size} + * API name: {@code indexing.index_total} + *

*/ - public final Builder completionSize(@Nullable String value) { - this.completionSize = value; + @Nonnull + public final Builder indexingIndexTotal(@Nullable String value) { + this.indexingIndexTotal = value; return this; } /** - * used fielddata cache + * The IP address. *

- * API name: {@code fielddata.memory_size} + * API name: {@code ip} + *

*/ - public final Builder fielddataMemorySize(@Nullable String value) { - this.fielddataMemorySize = value; + @Nonnull + public final Builder ip(@Nullable String value) { + this.ip = value; return this; } /** - * fielddata evictions + * The Java version. *

- * API name: {@code fielddata.evictions} + * API name: {@code jdk} + *

*/ - public final Builder fielddataEvictions(@Nullable String value) { - this.fielddataEvictions = value; + @Nonnull + public final Builder jdk(@Nullable String value) { + this.jdk = value; return this; } /** - * used query cache + * The load average for the last fifteen minutes. *

- * API name: {@code query_cache.memory_size} + * API name: {@code load_15m} + *

*/ - public final Builder queryCacheMemorySize(@Nullable String value) { - this.queryCacheMemorySize = value; + @Nonnull + public final Builder load15m(@Nullable String value) { + this.load15m = value; return this; } /** - * query cache evictions + * The load average for the most recent minute. *

- * API name: {@code query_cache.evictions} + * API name: {@code load_1m} + *

*/ - public final Builder queryCacheEvictions(@Nullable String value) { - this.queryCacheEvictions = value; + @Nonnull + public final Builder load1m(@Nullable String value) { + this.load1m = value; return this; } /** - * query cache hit counts + * The load average for the last five minutes. *

- * API name: {@code query_cache.hit_count} + * API name: {@code load_5m} + *

*/ - public final Builder queryCacheHitCount(@Nullable String value) { - this.queryCacheHitCount = value; + @Nonnull + public final Builder load5m(@Nullable String value) { + this.load5m = value; return this; } /** - * query cache miss counts + * Indicates whether the node is the elected cluster-manager node. Returned values include *(elected cluster manager) + * and -(not elected cluster manager). *

- * API name: {@code query_cache.miss_count} + * API name: {@code master} + *

*/ - public final Builder queryCacheMissCount(@Nullable String value) { - this.queryCacheMissCount = value; + @Nonnull + public final Builder master(@Nullable String value) { + this.master = value; return this; } /** - * used request cache + * The number of current merges. *

- * API name: {@code request_cache.memory_size} + * API name: {@code merges.current} + *

*/ - public final Builder requestCacheMemorySize(@Nullable String value) { - this.requestCacheMemorySize = value; + @Nonnull + public final Builder mergesCurrent(@Nullable String value) { + this.mergesCurrent = value; return this; } /** - * request cache evictions + * The number of current merging docs. *

- * API name: {@code request_cache.evictions} + * API name: {@code merges.current_docs} + *

*/ - public final Builder requestCacheEvictions(@Nullable String value) { - this.requestCacheEvictions = value; + @Nonnull + public final Builder mergesCurrentDocs(@Nullable String value) { + this.mergesCurrentDocs = value; return this; } /** - * request cache hit counts + * The size of current merges. *

- * API name: {@code request_cache.hit_count} + * API name: {@code merges.current_size} + *

*/ - public final Builder requestCacheHitCount(@Nullable String value) { - this.requestCacheHitCount = value; + @Nonnull + public final Builder mergesCurrentSize(@Nullable String value) { + this.mergesCurrentSize = value; return this; } /** - * request cache miss counts + * The number of completed merge operations. *

- * API name: {@code request_cache.miss_count} + * API name: {@code merges.total} + *

*/ - public final Builder requestCacheMissCount(@Nullable String value) { - this.requestCacheMissCount = value; + @Nonnull + public final Builder mergesTotal(@Nullable String value) { + this.mergesTotal = value; return this; } /** - * number of flushes + * The docs merged. *

- * API name: {@code flush.total} + * API name: {@code merges.total_docs} + *

*/ - public final Builder flushTotal(@Nullable String value) { - this.flushTotal = value; + @Nonnull + public final Builder mergesTotalDocs(@Nullable String value) { + this.mergesTotalDocs = value; return this; } /** - * time spent in flush + * The size merged. *

- * API name: {@code flush.total_time} + * API name: {@code merges.total_size} + *

*/ - public final Builder flushTotalTime(@Nullable String value) { - this.flushTotalTime = value; + @Nonnull + public final Builder mergesTotalSize(@Nullable String value) { + this.mergesTotalSize = value; return this; } /** - * number of current get ops + * The time spent in merges. *

- * API name: {@code get.current} + * API name: {@code merges.total_time} + *

*/ - public final Builder getCurrent(@Nullable String value) { - this.getCurrent = value; + @Nonnull + public final Builder mergesTotalTime(@Nullable String value) { + this.mergesTotalTime = value; return this; } /** - * time spent in get - *

- * API name: {@code get.time} + * API name: {@code name} */ - public final Builder getTime(@Nullable String value) { - this.getTime = value; + @Nonnull + public final Builder name(@Nullable String value) { + this.name = value; return this; } /** - * number of get ops + * The roles of the node. Returned values include c(cold node), d(data node), f(frozen node), + * h(hot node), i(ingest node), l(machine learning node), m (cluster-manager + * eligible node), r(remote cluster client node), s(content node), t(transform node), + * v(voting-only node), w(warm node),and -(coordinating node only). *

- * API name: {@code get.total} + * API name: {@code node.role} + *

*/ - public final Builder getTotal(@Nullable String value) { - this.getTotal = value; + @Nonnull + public final Builder nodeRole(@Nullable String value) { + this.nodeRole = value; return this; } /** - * time spent in successful gets + * A comma-separated list of the roles of the node. Returned values may include but are not limited to: data, + * ingest, master, cluster_manager, remote_cluster_client, search, + * and -(coordinating node only). *

- * API name: {@code get.exists_time} + * API name: {@code node.roles} + *

*/ - public final Builder getExistsTime(@Nullable String value) { - this.getExistsTime = value; + @Nonnull + public final Builder nodeRoles(@Nullable String value) { + this.nodeRoles = value; return this; } /** - * number of successful gets + * The process identifier. *

- * API name: {@code get.exists_total} + * API name: {@code pid} + *

*/ - public final Builder getExistsTotal(@Nullable String value) { - this.getExistsTotal = value; + @Nonnull + public final Builder pid(@Nullable String value) { + this.pid = value; return this; } /** - * time spent in failed gets + * The bound transport port. *

- * API name: {@code get.missing_time} + * API name: {@code port} + *

*/ - public final Builder getMissingTime(@Nullable String value) { - this.getMissingTime = value; + @Nonnull + public final Builder port(@Nullable String value) { + this.port = value; return this; } /** - * number of failed gets + * The query cache evictions. *

- * API name: {@code get.missing_total} + * API name: {@code query_cache.evictions} + *

*/ - public final Builder getMissingTotal(@Nullable String value) { - this.getMissingTotal = value; + @Nonnull + public final Builder queryCacheEvictions(@Nullable String value) { + this.queryCacheEvictions = value; return this; } /** - * number of current deletions + * The query cache hit counts. *

- * API name: {@code indexing.delete_current} + * API name: {@code query_cache.hit_count} + *

*/ - public final Builder indexingDeleteCurrent(@Nullable String value) { - this.indexingDeleteCurrent = value; + @Nonnull + public final Builder queryCacheHitCount(@Nullable String value) { + this.queryCacheHitCount = value; return this; } /** - * time spent in deletions + * The used query cache. *

- * API name: {@code indexing.delete_time} + * API name: {@code query_cache.memory_size} + *

*/ - public final Builder indexingDeleteTime(@Nullable String value) { - this.indexingDeleteTime = value; + @Nonnull + public final Builder queryCacheMemorySize(@Nullable String value) { + this.queryCacheMemorySize = value; return this; } /** - * number of delete ops + * The query cache miss counts. *

- * API name: {@code indexing.delete_total} + * API name: {@code query_cache.miss_count} + *

*/ - public final Builder indexingDeleteTotal(@Nullable String value) { - this.indexingDeleteTotal = value; + @Nonnull + public final Builder queryCacheMissCount(@Nullable String value) { + this.queryCacheMissCount = value; return this; } /** - * number of current indexing ops + * The used machine memory. *

- * API name: {@code indexing.index_current} + * API name: {@code ram.current} + *

*/ - public final Builder indexingIndexCurrent(@Nullable String value) { - this.indexingIndexCurrent = value; + @Nonnull + public final Builder ramCurrent(@Nullable String value) { + this.ramCurrent = value; return this; } /** - * time spent in indexing + * The total machine memory. *

- * API name: {@code indexing.index_time} + * API name: {@code ram.max} + *

*/ - public final Builder indexingIndexTime(@Nullable String value) { - this.indexingIndexTime = value; + @Nonnull + public final Builder ramMax(@Nullable String value) { + this.ramMax = value; return this; } /** - * number of indexing ops - *

- * API name: {@code indexing.index_total} + * API name: {@code ram.percent} */ - public final Builder indexingIndexTotal(@Nullable String value) { - this.indexingIndexTotal = value; + @Nonnull + public final Builder ramPercent(@Nullable String value) { + this.ramPercent = value; return this; } /** - * number of failed indexing ops + * The time spent in external refreshes. *

- * API name: {@code indexing.index_failed} + * API name: {@code refresh.external_time} + *

*/ - public final Builder indexingIndexFailed(@Nullable String value) { - this.indexingIndexFailed = value; + @Nonnull + public final Builder refreshExternalTime(@Nullable String value) { + this.refreshExternalTime = value; return this; } /** - * number of current merges + * The total external refreshes. *

- * API name: {@code merges.current} + * API name: {@code refresh.external_total} + *

*/ - public final Builder mergesCurrent(@Nullable String value) { - this.mergesCurrent = value; + @Nonnull + public final Builder refreshExternalTotal(@Nullable String value) { + this.refreshExternalTotal = value; return this; } /** - * number of current merging docs + * The number of pending refresh listeners. *

- * API name: {@code merges.current_docs} + * API name: {@code refresh.listeners} + *

*/ - public final Builder mergesCurrentDocs(@Nullable String value) { - this.mergesCurrentDocs = value; + @Nonnull + public final Builder refreshListeners(@Nullable String value) { + this.refreshListeners = value; return this; } /** - * size of current merges + * The time spent in refreshes. *

- * API name: {@code merges.current_size} + * API name: {@code refresh.time} + *

*/ - public final Builder mergesCurrentSize(@Nullable String value) { - this.mergesCurrentSize = value; + @Nonnull + public final Builder refreshTime(@Nullable String value) { + this.refreshTime = value; return this; } /** - * number of completed merge ops + * The total refreshes. *

- * API name: {@code merges.total} + * API name: {@code refresh.total} + *

*/ - public final Builder mergesTotal(@Nullable String value) { - this.mergesTotal = value; + @Nonnull + public final Builder refreshTotal(@Nullable String value) { + this.refreshTotal = value; return this; } /** - * docs merged + * The request cache evictions. *

- * API name: {@code merges.total_docs} + * API name: {@code request_cache.evictions} + *

*/ - public final Builder mergesTotalDocs(@Nullable String value) { - this.mergesTotalDocs = value; + @Nonnull + public final Builder requestCacheEvictions(@Nullable String value) { + this.requestCacheEvictions = value; return this; } /** - * size merged + * The request cache hit counts. *

- * API name: {@code merges.total_size} + * API name: {@code request_cache.hit_count} + *

*/ - public final Builder mergesTotalSize(@Nullable String value) { - this.mergesTotalSize = value; + @Nonnull + public final Builder requestCacheHitCount(@Nullable String value) { + this.requestCacheHitCount = value; return this; } /** - * time spent in merges + * The used request cache. *

- * API name: {@code merges.total_time} + * API name: {@code request_cache.memory_size} + *

*/ - public final Builder mergesTotalTime(@Nullable String value) { - this.mergesTotalTime = value; + @Nonnull + public final Builder requestCacheMemorySize(@Nullable String value) { + this.requestCacheMemorySize = value; return this; } /** - * total refreshes + * The request cache miss counts. *

- * API name: {@code refresh.total} + * API name: {@code request_cache.miss_count} + *

*/ - public final Builder refreshTotal(@Nullable String value) { - this.refreshTotal = value; + @Nonnull + public final Builder requestCacheMissCount(@Nullable String value) { + this.requestCacheMissCount = value; return this; } /** - * time spent in refreshes + * The total compiled scripts evicted from the cache. *

- * API name: {@code refresh.time} + * API name: {@code script.cache_evictions} + *

*/ - public final Builder refreshTime(@Nullable String value) { - this.refreshTime = value; + @Nonnull + public final Builder scriptCacheEvictions(@Nullable String value) { + this.scriptCacheEvictions = value; return this; } /** - * total external refreshes + * The script cache compilation limit triggered. *

- * API name: {@code refresh.external_total} + * API name: {@code script.compilation_limit_triggered} + *

*/ - public final Builder refreshExternalTotal(@Nullable String value) { - this.refreshExternalTotal = value; + @Nonnull + public final Builder scriptCompilationLimitTriggered(@Nullable String value) { + this.scriptCompilationLimitTriggered = value; return this; } /** - * time spent in external refreshes + * The total script compilations. *

- * API name: {@code refresh.external_time} + * API name: {@code script.compilations} + *

*/ - public final Builder refreshExternalTime(@Nullable String value) { - this.refreshExternalTime = value; + @Nonnull + public final Builder scriptCompilations(@Nullable String value) { + this.scriptCompilations = value; return this; } /** - * number of pending refresh listeners - *

- * API name: {@code refresh.listeners} + * API name: {@code search.concurrent_avg_slice_count} */ - public final Builder refreshListeners(@Nullable String value) { - this.refreshListeners = value; + @Nonnull + public final Builder searchConcurrentAvgSliceCount(@Nullable String value) { + this.searchConcurrentAvgSliceCount = value; return this; } /** - * script compilations - *

- * API name: {@code script.compilations} + * API name: {@code search.concurrent_query_current} */ - public final Builder scriptCompilations(@Nullable String value) { - this.scriptCompilations = value; + @Nonnull + public final Builder searchConcurrentQueryCurrent(@Nullable String value) { + this.searchConcurrentQueryCurrent = value; return this; } /** - * script cache evictions - *

- * API name: {@code script.cache_evictions} + * API name: {@code search.concurrent_query_time} */ - public final Builder scriptCacheEvictions(@Nullable String value) { - this.scriptCacheEvictions = value; + @Nonnull + public final Builder searchConcurrentQueryTime(@Nullable String value) { + this.searchConcurrentQueryTime = value; return this; } /** - * script cache compilation limit triggered - *

- * API name: {@code script.compilation_limit_triggered} + * API name: {@code search.concurrent_query_total} */ - public final Builder scriptCompilationLimitTriggered(@Nullable String value) { - this.scriptCompilationLimitTriggered = value; + @Nonnull + public final Builder searchConcurrentQueryTotal(@Nullable String value) { + this.searchConcurrentQueryTotal = value; return this; } /** - * current fetch phase ops + * The current fetch phase operations. *

* API name: {@code search.fetch_current} + *

*/ + @Nonnull public final Builder searchFetchCurrent(@Nullable String value) { this.searchFetchCurrent = value; return this; } /** - * time spent in fetch phase + * The time spent in fetch phase. *

* API name: {@code search.fetch_time} + *

*/ + @Nonnull public final Builder searchFetchTime(@Nullable String value) { this.searchFetchTime = value; return this; } /** - * total fetch ops + * The total fetch operations. *

* API name: {@code search.fetch_total} + *

*/ + @Nonnull public final Builder searchFetchTotal(@Nullable String value) { this.searchFetchTotal = value; return this; } /** - * open search contexts + * The open search contexts. *

* API name: {@code search.open_contexts} + *

*/ + @Nonnull public final Builder searchOpenContexts(@Nullable String value) { this.searchOpenContexts = value; return this; } /** - * current query phase ops + * API name: {@code search.point_in_time_current} + */ + @Nonnull + public final Builder searchPointInTimeCurrent(@Nullable String value) { + this.searchPointInTimeCurrent = value; + return this; + } + + /** + * API name: {@code search.point_in_time_time} + */ + @Nonnull + public final Builder searchPointInTimeTime(@Nullable String value) { + this.searchPointInTimeTime = value; + return this; + } + + /** + * API name: {@code search.point_in_time_total} + */ + @Nonnull + public final Builder searchPointInTimeTotal(@Nullable String value) { + this.searchPointInTimeTotal = value; + return this; + } + + /** + * The current query phase operations. *

* API name: {@code search.query_current} + *

*/ + @Nonnull public final Builder searchQueryCurrent(@Nullable String value) { this.searchQueryCurrent = value; return this; } /** - * time spent in query phase + * The time spent in query phase. *

* API name: {@code search.query_time} + *

*/ + @Nonnull public final Builder searchQueryTime(@Nullable String value) { this.searchQueryTime = value; return this; } /** - * total query phase ops + * The total query phase operations. *

* API name: {@code search.query_total} + *

*/ + @Nonnull public final Builder searchQueryTotal(@Nullable String value) { this.searchQueryTotal = value; return this; } /** - * open scroll contexts + * The open scroll contexts. *

* API name: {@code search.scroll_current} + *

*/ + @Nonnull public final Builder searchScrollCurrent(@Nullable String value) { this.searchScrollCurrent = value; return this; } /** - * time scroll contexts held open + * The time scroll contexts held open. *

* API name: {@code search.scroll_time} + *

*/ + @Nonnull public final Builder searchScrollTime(@Nullable String value) { this.searchScrollTime = value; return this; } /** - * completed scroll contexts + * The completed scroll contexts. *

* API name: {@code search.scroll_total} + *

*/ + @Nonnull public final Builder searchScrollTotal(@Nullable String value) { this.searchScrollTotal = value; return this; } /** - * number of segments + * The number of segments. *

* API name: {@code segments.count} + *

*/ + @Nonnull public final Builder segmentsCount(@Nullable String value) { this.segmentsCount = value; return this; } /** - * memory used by segments + * The memory used by fixed bit sets for nested object field types and export type filters for types referred in + * _parent fields. *

- * API name: {@code segments.memory} + * API name: {@code segments.fixed_bitset_memory} + *

*/ - public final Builder segmentsMemory(@Nullable String value) { - this.segmentsMemory = value; + @Nonnull + public final Builder segmentsFixedBitsetMemory(@Nullable String value) { + this.segmentsFixedBitsetMemory = value; return this; } /** - * memory used by index writer + * The memory used by the index writer. *

* API name: {@code segments.index_writer_memory} + *

*/ + @Nonnull public final Builder segmentsIndexWriterMemory(@Nullable String value) { this.segmentsIndexWriterMemory = value; return this; } /** - * memory used by version map + * The memory used by segments. *

- * API name: {@code segments.version_map_memory} + * API name: {@code segments.memory} + *

*/ - public final Builder segmentsVersionMapMemory(@Nullable String value) { - this.segmentsVersionMapMemory = value; + @Nonnull + public final Builder segmentsMemory(@Nullable String value) { + this.segmentsMemory = value; return this; } /** - * memory used by fixed bit sets for nested object field types and export type - * filters for types referred in _parent fields + * The memory used by the version map. *

- * API name: {@code segments.fixed_bitset_memory} + * API name: {@code segments.version_map_memory} + *

*/ - public final Builder segmentsFixedBitsetMemory(@Nullable String value) { - this.segmentsFixedBitsetMemory = value; + @Nonnull + public final Builder segmentsVersionMapMemory(@Nullable String value) { + this.segmentsVersionMapMemory = value; return this; } /** - * number of current suggest ops + * The number of current suggest operations. *

* API name: {@code suggest.current} + *

*/ + @Nonnull public final Builder suggestCurrent(@Nullable String value) { this.suggestCurrent = value; return this; } /** - * time spend in suggest + * The time spend in suggest. *

* API name: {@code suggest.time} + *

*/ + @Nonnull public final Builder suggestTime(@Nullable String value) { this.suggestTime = value; return this; } /** - * number of suggest ops + * The number of suggest operations. *

* API name: {@code suggest.total} + *

*/ + @Nonnull public final Builder suggestTotal(@Nullable String value) { this.suggestTotal = value; return this; } /** - * number of bulk shard ops - *

- * API name: {@code bulk.total_operations} - */ - public final Builder bulkTotalOperations(@Nullable String value) { - this.bulkTotalOperations = value; - return this; - } - - /** - * time spend in shard bulk - *

- * API name: {@code bulk.total_time} - */ - public final Builder bulkTotalTime(@Nullable String value) { - this.bulkTotalTime = value; - return this; - } - - /** - * total size in bytes of shard bulk + * The OpenSearch distribution type. *

- * API name: {@code bulk.total_size_in_bytes} + * API name: {@code type} + *

*/ - public final Builder bulkTotalSizeInBytes(@Nullable String value) { - this.bulkTotalSizeInBytes = value; + @Nonnull + public final Builder type(@Nullable String value) { + this.type = value; return this; } /** - * average time spend in shard bulk + * The node uptime. *

- * API name: {@code bulk.avg_time} + * API name: {@code uptime} + *

*/ - public final Builder bulkAvgTime(@Nullable String value) { - this.bulkAvgTime = value; + @Nonnull + public final Builder uptime(@Nullable String value) { + this.uptime = value; return this; } /** - * average size in bytes of shard bulk - *

- * API name: {@code bulk.avg_size_in_bytes} + * API name: {@code version} */ - public final Builder bulkAvgSizeInBytes(@Nullable String value) { - this.bulkAvgSizeInBytes = value; + @Nonnull + public final Builder version(@Nullable String value) { + this.version = value; return this; } /** * Builds a {@link NodesRecord}. * - * @throws NullPointerException - * if some of the required fields are null. + * @throws NullPointerException if some of the required fields are null. */ + @Override + @Nonnull public NodesRecord build() { _checkSingleUse(); @@ -3214,189 +3831,333 @@ public NodesRecord build() { ); protected static void setupNodesRecordDeserializer(ObjectDeserializer op) { - - op.add(Builder::id, JsonpDeserializer.stringDeserializer(), "id", "nodeId"); - op.add(Builder::pid, JsonpDeserializer.stringDeserializer(), "pid", "p"); - op.add(Builder::ip, JsonpDeserializer.stringDeserializer(), "ip", "i"); - op.add(Builder::port, JsonpDeserializer.stringDeserializer(), "port", "po"); - op.add(Builder::httpAddress, JsonpDeserializer.stringDeserializer(), "http_address", "http"); - op.add(Builder::version, JsonpDeserializer.stringDeserializer(), "version", "v"); - op.add(Builder::flavor, JsonpDeserializer.stringDeserializer(), "flavor", "f"); - op.add(Builder::type, JsonpDeserializer.stringDeserializer(), "type", "t"); - op.add(Builder::build, JsonpDeserializer.stringDeserializer(), "build", "b"); - op.add(Builder::jdk, JsonpDeserializer.stringDeserializer(), "jdk", "j"); - op.add(Builder::diskTotal, JsonpDeserializer.stringDeserializer(), "disk.total", "dt", "diskTotal"); - op.add(Builder::diskUsed, JsonpDeserializer.stringDeserializer(), "disk.used", "du", "diskUsed"); - op.add(Builder::diskAvail, JsonpDeserializer.stringDeserializer(), "disk.avail", "d", "da", "disk", "diskAvail"); - op.add(Builder::diskUsedPercent, JsonpDeserializer.stringDeserializer(), "disk.used_percent", "dup", "diskUsedPercent"); - op.add(Builder::heapCurrent, JsonpDeserializer.stringDeserializer(), "heap.current", "hc", "heapCurrent"); - op.add(Builder::heapPercent, JsonpDeserializer.stringDeserializer(), "heap.percent", "hp", "heapPercent"); - op.add(Builder::heapMax, JsonpDeserializer.stringDeserializer(), "heap.max", "hm", "heapMax"); - op.add(Builder::ramCurrent, JsonpDeserializer.stringDeserializer(), "ram.current", "rc", "ramCurrent"); - op.add(Builder::ramPercent, JsonpDeserializer.stringDeserializer(), "ram.percent", "rp", "ramPercent"); - op.add(Builder::ramMax, JsonpDeserializer.stringDeserializer(), "ram.max", "rn", "ramMax"); - op.add(Builder::fileDescCurrent, JsonpDeserializer.stringDeserializer(), "file_desc.current", "fdc", "fileDescriptorCurrent"); - op.add(Builder::fileDescPercent, JsonpDeserializer.stringDeserializer(), "file_desc.percent", "fdp", "fileDescriptorPercent"); - op.add(Builder::fileDescMax, JsonpDeserializer.stringDeserializer(), "file_desc.max", "fdm", "fileDescriptorMax"); + op.add(Builder::build, JsonpDeserializer.stringDeserializer(), "build"); + op.add(Builder::bulkAvgSizeInBytes, JsonpDeserializer.stringDeserializer(), "bulk.avg_size_in_bytes"); + op.add(Builder::bulkAvgTime, JsonpDeserializer.stringDeserializer(), "bulk.avg_time"); + op.add(Builder::bulkTotalOperations, JsonpDeserializer.stringDeserializer(), "bulk.total_operations"); + op.add(Builder::bulkTotalSizeInBytes, JsonpDeserializer.stringDeserializer(), "bulk.total_size_in_bytes"); + op.add(Builder::bulkTotalTime, JsonpDeserializer.stringDeserializer(), "bulk.total_time"); + op.add(Builder::clusterManager, JsonpDeserializer.stringDeserializer(), "cluster_manager"); + op.add(Builder::completionSize, JsonpDeserializer.stringDeserializer(), "completion.size"); op.add(Builder::cpu, JsonpDeserializer.stringDeserializer(), "cpu"); + op.add(Builder::diskAvail, JsonpDeserializer.stringDeserializer(), "disk.avail"); + op.add(Builder::diskTotal, JsonpDeserializer.stringDeserializer(), "disk.total"); + op.add(Builder::diskUsed, JsonpDeserializer.stringDeserializer(), "disk.used"); + op.add(Builder::diskUsedPercent, JsonpDeserializer.stringDeserializer(), "disk.used_percent"); + op.add(Builder::fielddataEvictions, JsonpDeserializer.stringDeserializer(), "fielddata.evictions"); + op.add(Builder::fielddataMemorySize, JsonpDeserializer.stringDeserializer(), "fielddata.memory_size"); + op.add(Builder::fileDescCurrent, JsonpDeserializer.stringDeserializer(), "file_desc.current"); + op.add(Builder::fileDescMax, JsonpDeserializer.stringDeserializer(), "file_desc.max"); + op.add(Builder::fileDescPercent, JsonpDeserializer.stringDeserializer(), "file_desc.percent"); + op.add(Builder::flavor, JsonpDeserializer.stringDeserializer(), "flavor"); + op.add(Builder::flushTotal, JsonpDeserializer.stringDeserializer(), "flush.total"); + op.add(Builder::flushTotalTime, JsonpDeserializer.stringDeserializer(), "flush.total_time"); + op.add(Builder::getCurrent, JsonpDeserializer.stringDeserializer(), "get.current"); + op.add(Builder::getExistsTime, JsonpDeserializer.stringDeserializer(), "get.exists_time"); + op.add(Builder::getExistsTotal, JsonpDeserializer.stringDeserializer(), "get.exists_total"); + op.add(Builder::getMissingTime, JsonpDeserializer.stringDeserializer(), "get.missing_time"); + op.add(Builder::getMissingTotal, JsonpDeserializer.stringDeserializer(), "get.missing_total"); + op.add(Builder::getTime, JsonpDeserializer.stringDeserializer(), "get.time"); + op.add(Builder::getTotal, JsonpDeserializer.stringDeserializer(), "get.total"); + op.add(Builder::heapCurrent, JsonpDeserializer.stringDeserializer(), "heap.current"); + op.add(Builder::heapMax, JsonpDeserializer.stringDeserializer(), "heap.max"); + op.add(Builder::heapPercent, JsonpDeserializer.stringDeserializer(), "heap.percent"); + op.add(Builder::httpAddress, JsonpDeserializer.stringDeserializer(), "http_address"); + op.add(Builder::id, JsonpDeserializer.stringDeserializer(), "id"); + op.add(Builder::indexingDeleteCurrent, JsonpDeserializer.stringDeserializer(), "indexing.delete_current"); + op.add(Builder::indexingDeleteTime, JsonpDeserializer.stringDeserializer(), "indexing.delete_time"); + op.add(Builder::indexingDeleteTotal, JsonpDeserializer.stringDeserializer(), "indexing.delete_total"); + op.add(Builder::indexingIndexCurrent, JsonpDeserializer.stringDeserializer(), "indexing.index_current"); + op.add(Builder::indexingIndexFailed, JsonpDeserializer.stringDeserializer(), "indexing.index_failed"); + op.add(Builder::indexingIndexTime, JsonpDeserializer.stringDeserializer(), "indexing.index_time"); + op.add(Builder::indexingIndexTotal, JsonpDeserializer.stringDeserializer(), "indexing.index_total"); + op.add(Builder::ip, JsonpDeserializer.stringDeserializer(), "ip"); + op.add(Builder::jdk, JsonpDeserializer.stringDeserializer(), "jdk"); + op.add(Builder::load15m, JsonpDeserializer.stringDeserializer(), "load_15m"); op.add(Builder::load1m, JsonpDeserializer.stringDeserializer(), "load_1m"); op.add(Builder::load5m, JsonpDeserializer.stringDeserializer(), "load_5m"); - op.add(Builder::load15m, JsonpDeserializer.stringDeserializer(), "load_15m", "l"); - op.add(Builder::uptime, JsonpDeserializer.stringDeserializer(), "uptime", "u"); - op.add(Builder::nodeRole, JsonpDeserializer.stringDeserializer(), "node.role", "r", "role", "nodeRole"); - op.add(Builder::master, JsonpDeserializer.stringDeserializer(), "master", "m"); - op.add(Builder::clusterManager, JsonpDeserializer.stringDeserializer(), "cluster_manager", "m"); - op.add(Builder::name, JsonpDeserializer.stringDeserializer(), "name", "n"); - op.add(Builder::completionSize, JsonpDeserializer.stringDeserializer(), "completion.size", "cs", "completionSize"); - op.add(Builder::fielddataMemorySize, JsonpDeserializer.stringDeserializer(), "fielddata.memory_size", "fm", "fielddataMemory"); - op.add(Builder::fielddataEvictions, JsonpDeserializer.stringDeserializer(), "fielddata.evictions", "fe", "fielddataEvictions"); - op.add(Builder::queryCacheMemorySize, JsonpDeserializer.stringDeserializer(), "query_cache.memory_size", "qcm", "queryCacheMemory"); - op.add(Builder::queryCacheEvictions, JsonpDeserializer.stringDeserializer(), "query_cache.evictions", "qce", "queryCacheEvictions"); - op.add(Builder::queryCacheHitCount, JsonpDeserializer.stringDeserializer(), "query_cache.hit_count", "qchc", "queryCacheHitCount"); - op.add( - Builder::queryCacheMissCount, - JsonpDeserializer.stringDeserializer(), - "query_cache.miss_count", - "qcmc", - "queryCacheMissCount" - ); - op.add( - Builder::requestCacheMemorySize, - JsonpDeserializer.stringDeserializer(), - "request_cache.memory_size", - "rcm", - "requestCacheMemory" - ); - op.add( - Builder::requestCacheEvictions, - JsonpDeserializer.stringDeserializer(), - "request_cache.evictions", - "rce", - "requestCacheEvictions" - ); - op.add( - Builder::requestCacheHitCount, - JsonpDeserializer.stringDeserializer(), - "request_cache.hit_count", - "rchc", - "requestCacheHitCount" - ); - op.add( - Builder::requestCacheMissCount, - JsonpDeserializer.stringDeserializer(), - "request_cache.miss_count", - "rcmc", - "requestCacheMissCount" - ); - op.add(Builder::flushTotal, JsonpDeserializer.stringDeserializer(), "flush.total", "ft", "flushTotal"); - op.add(Builder::flushTotalTime, JsonpDeserializer.stringDeserializer(), "flush.total_time", "ftt", "flushTotalTime"); - op.add(Builder::getCurrent, JsonpDeserializer.stringDeserializer(), "get.current", "gc", "getCurrent"); - op.add(Builder::getTime, JsonpDeserializer.stringDeserializer(), "get.time", "gti", "getTime"); - op.add(Builder::getTotal, JsonpDeserializer.stringDeserializer(), "get.total", "gto", "getTotal"); - op.add(Builder::getExistsTime, JsonpDeserializer.stringDeserializer(), "get.exists_time", "geti", "getExistsTime"); - op.add(Builder::getExistsTotal, JsonpDeserializer.stringDeserializer(), "get.exists_total", "geto", "getExistsTotal"); - op.add(Builder::getMissingTime, JsonpDeserializer.stringDeserializer(), "get.missing_time", "gmti", "getMissingTime"); - op.add(Builder::getMissingTotal, JsonpDeserializer.stringDeserializer(), "get.missing_total", "gmto", "getMissingTotal"); - op.add( - Builder::indexingDeleteCurrent, - JsonpDeserializer.stringDeserializer(), - "indexing.delete_current", - "idc", - "indexingDeleteCurrent" - ); - op.add(Builder::indexingDeleteTime, JsonpDeserializer.stringDeserializer(), "indexing.delete_time", "idti", "indexingDeleteTime"); - op.add( - Builder::indexingDeleteTotal, - JsonpDeserializer.stringDeserializer(), - "indexing.delete_total", - "idto", - "indexingDeleteTotal" - ); - op.add( - Builder::indexingIndexCurrent, - JsonpDeserializer.stringDeserializer(), - "indexing.index_current", - "iic", - "indexingIndexCurrent" - ); - op.add(Builder::indexingIndexTime, JsonpDeserializer.stringDeserializer(), "indexing.index_time", "iiti", "indexingIndexTime"); - op.add(Builder::indexingIndexTotal, JsonpDeserializer.stringDeserializer(), "indexing.index_total", "iito", "indexingIndexTotal"); - op.add(Builder::indexingIndexFailed, JsonpDeserializer.stringDeserializer(), "indexing.index_failed", "iif", "indexingIndexFailed"); - op.add(Builder::mergesCurrent, JsonpDeserializer.stringDeserializer(), "merges.current", "mc", "mergesCurrent"); - op.add(Builder::mergesCurrentDocs, JsonpDeserializer.stringDeserializer(), "merges.current_docs", "mcd", "mergesCurrentDocs"); - op.add(Builder::mergesCurrentSize, JsonpDeserializer.stringDeserializer(), "merges.current_size", "mcs", "mergesCurrentSize"); - op.add(Builder::mergesTotal, JsonpDeserializer.stringDeserializer(), "merges.total", "mt", "mergesTotal"); - op.add(Builder::mergesTotalDocs, JsonpDeserializer.stringDeserializer(), "merges.total_docs", "mtd", "mergesTotalDocs"); - op.add(Builder::mergesTotalSize, JsonpDeserializer.stringDeserializer(), "merges.total_size", "mts", "mergesTotalSize"); - op.add(Builder::mergesTotalTime, JsonpDeserializer.stringDeserializer(), "merges.total_time", "mtt", "mergesTotalTime"); - op.add(Builder::refreshTotal, JsonpDeserializer.stringDeserializer(), "refresh.total"); + op.add(Builder::master, JsonpDeserializer.stringDeserializer(), "master"); + op.add(Builder::mergesCurrent, JsonpDeserializer.stringDeserializer(), "merges.current"); + op.add(Builder::mergesCurrentDocs, JsonpDeserializer.stringDeserializer(), "merges.current_docs"); + op.add(Builder::mergesCurrentSize, JsonpDeserializer.stringDeserializer(), "merges.current_size"); + op.add(Builder::mergesTotal, JsonpDeserializer.stringDeserializer(), "merges.total"); + op.add(Builder::mergesTotalDocs, JsonpDeserializer.stringDeserializer(), "merges.total_docs"); + op.add(Builder::mergesTotalSize, JsonpDeserializer.stringDeserializer(), "merges.total_size"); + op.add(Builder::mergesTotalTime, JsonpDeserializer.stringDeserializer(), "merges.total_time"); + op.add(Builder::name, JsonpDeserializer.stringDeserializer(), "name"); + op.add(Builder::nodeRole, JsonpDeserializer.stringDeserializer(), "node.role"); + op.add(Builder::nodeRoles, JsonpDeserializer.stringDeserializer(), "node.roles"); + op.add(Builder::pid, JsonpDeserializer.stringDeserializer(), "pid"); + op.add(Builder::port, JsonpDeserializer.stringDeserializer(), "port"); + op.add(Builder::queryCacheEvictions, JsonpDeserializer.stringDeserializer(), "query_cache.evictions"); + op.add(Builder::queryCacheHitCount, JsonpDeserializer.stringDeserializer(), "query_cache.hit_count"); + op.add(Builder::queryCacheMemorySize, JsonpDeserializer.stringDeserializer(), "query_cache.memory_size"); + op.add(Builder::queryCacheMissCount, JsonpDeserializer.stringDeserializer(), "query_cache.miss_count"); + op.add(Builder::ramCurrent, JsonpDeserializer.stringDeserializer(), "ram.current"); + op.add(Builder::ramMax, JsonpDeserializer.stringDeserializer(), "ram.max"); + op.add(Builder::ramPercent, JsonpDeserializer.stringDeserializer(), "ram.percent"); + op.add(Builder::refreshExternalTime, JsonpDeserializer.stringDeserializer(), "refresh.external_time"); + op.add(Builder::refreshExternalTotal, JsonpDeserializer.stringDeserializer(), "refresh.external_total"); + op.add(Builder::refreshListeners, JsonpDeserializer.stringDeserializer(), "refresh.listeners"); op.add(Builder::refreshTime, JsonpDeserializer.stringDeserializer(), "refresh.time"); - op.add(Builder::refreshExternalTotal, JsonpDeserializer.stringDeserializer(), "refresh.external_total", "rto", "refreshTotal"); - op.add(Builder::refreshExternalTime, JsonpDeserializer.stringDeserializer(), "refresh.external_time", "rti", "refreshTime"); - op.add(Builder::refreshListeners, JsonpDeserializer.stringDeserializer(), "refresh.listeners", "rli", "refreshListeners"); - op.add(Builder::scriptCompilations, JsonpDeserializer.stringDeserializer(), "script.compilations", "scrcc", "scriptCompilations"); - op.add( - Builder::scriptCacheEvictions, - JsonpDeserializer.stringDeserializer(), - "script.cache_evictions", - "scrce", - "scriptCacheEvictions" - ); - op.add( - Builder::scriptCompilationLimitTriggered, - JsonpDeserializer.stringDeserializer(), - "script.compilation_limit_triggered", - "scrclt", - "scriptCacheCompilationLimitTriggered" - ); - op.add(Builder::searchFetchCurrent, JsonpDeserializer.stringDeserializer(), "search.fetch_current", "sfc", "searchFetchCurrent"); - op.add(Builder::searchFetchTime, JsonpDeserializer.stringDeserializer(), "search.fetch_time", "sfti", "searchFetchTime"); - op.add(Builder::searchFetchTotal, JsonpDeserializer.stringDeserializer(), "search.fetch_total", "sfto", "searchFetchTotal"); - op.add(Builder::searchOpenContexts, JsonpDeserializer.stringDeserializer(), "search.open_contexts", "so", "searchOpenContexts"); - op.add(Builder::searchQueryCurrent, JsonpDeserializer.stringDeserializer(), "search.query_current", "sqc", "searchQueryCurrent"); - op.add(Builder::searchQueryTime, JsonpDeserializer.stringDeserializer(), "search.query_time", "sqti", "searchQueryTime"); - op.add(Builder::searchQueryTotal, JsonpDeserializer.stringDeserializer(), "search.query_total", "sqto", "searchQueryTotal"); - op.add(Builder::searchScrollCurrent, JsonpDeserializer.stringDeserializer(), "search.scroll_current", "scc", "searchScrollCurrent"); - op.add(Builder::searchScrollTime, JsonpDeserializer.stringDeserializer(), "search.scroll_time", "scti", "searchScrollTime"); - op.add(Builder::searchScrollTotal, JsonpDeserializer.stringDeserializer(), "search.scroll_total", "scto", "searchScrollTotal"); - op.add(Builder::segmentsCount, JsonpDeserializer.stringDeserializer(), "segments.count", "sc", "segmentsCount"); - op.add(Builder::segmentsMemory, JsonpDeserializer.stringDeserializer(), "segments.memory", "sm", "segmentsMemory"); - op.add( - Builder::segmentsIndexWriterMemory, - JsonpDeserializer.stringDeserializer(), - "segments.index_writer_memory", - "siwm", - "segmentsIndexWriterMemory" - ); - op.add( - Builder::segmentsVersionMapMemory, - JsonpDeserializer.stringDeserializer(), - "segments.version_map_memory", - "svmm", - "segmentsVersionMapMemory" - ); - op.add( - Builder::segmentsFixedBitsetMemory, - JsonpDeserializer.stringDeserializer(), - "segments.fixed_bitset_memory", - "sfbm", - "fixedBitsetMemory" - ); - op.add(Builder::suggestCurrent, JsonpDeserializer.stringDeserializer(), "suggest.current", "suc", "suggestCurrent"); - op.add(Builder::suggestTime, JsonpDeserializer.stringDeserializer(), "suggest.time", "suti", "suggestTime"); - op.add(Builder::suggestTotal, JsonpDeserializer.stringDeserializer(), "suggest.total", "suto", "suggestTotal"); - op.add(Builder::bulkTotalOperations, JsonpDeserializer.stringDeserializer(), "bulk.total_operations", "bto", "bulkTotalOperations"); - op.add(Builder::bulkTotalTime, JsonpDeserializer.stringDeserializer(), "bulk.total_time", "btti", "bulkTotalTime"); - op.add( - Builder::bulkTotalSizeInBytes, - JsonpDeserializer.stringDeserializer(), - "bulk.total_size_in_bytes", - "btsi", - "bulkTotalSizeInBytes" - ); - op.add(Builder::bulkAvgTime, JsonpDeserializer.stringDeserializer(), "bulk.avg_time", "bati", "bulkAvgTime"); - op.add(Builder::bulkAvgSizeInBytes, JsonpDeserializer.stringDeserializer(), "bulk.avg_size_in_bytes", "basi", "bulkAvgSizeInBytes"); + op.add(Builder::refreshTotal, JsonpDeserializer.stringDeserializer(), "refresh.total"); + op.add(Builder::requestCacheEvictions, JsonpDeserializer.stringDeserializer(), "request_cache.evictions"); + op.add(Builder::requestCacheHitCount, JsonpDeserializer.stringDeserializer(), "request_cache.hit_count"); + op.add(Builder::requestCacheMemorySize, JsonpDeserializer.stringDeserializer(), "request_cache.memory_size"); + op.add(Builder::requestCacheMissCount, JsonpDeserializer.stringDeserializer(), "request_cache.miss_count"); + op.add(Builder::scriptCacheEvictions, JsonpDeserializer.stringDeserializer(), "script.cache_evictions"); + op.add(Builder::scriptCompilationLimitTriggered, JsonpDeserializer.stringDeserializer(), "script.compilation_limit_triggered"); + op.add(Builder::scriptCompilations, JsonpDeserializer.stringDeserializer(), "script.compilations"); + op.add(Builder::searchConcurrentAvgSliceCount, JsonpDeserializer.stringDeserializer(), "search.concurrent_avg_slice_count"); + op.add(Builder::searchConcurrentQueryCurrent, JsonpDeserializer.stringDeserializer(), "search.concurrent_query_current"); + op.add(Builder::searchConcurrentQueryTime, JsonpDeserializer.stringDeserializer(), "search.concurrent_query_time"); + op.add(Builder::searchConcurrentQueryTotal, JsonpDeserializer.stringDeserializer(), "search.concurrent_query_total"); + op.add(Builder::searchFetchCurrent, JsonpDeserializer.stringDeserializer(), "search.fetch_current"); + op.add(Builder::searchFetchTime, JsonpDeserializer.stringDeserializer(), "search.fetch_time"); + op.add(Builder::searchFetchTotal, JsonpDeserializer.stringDeserializer(), "search.fetch_total"); + op.add(Builder::searchOpenContexts, JsonpDeserializer.stringDeserializer(), "search.open_contexts"); + op.add(Builder::searchPointInTimeCurrent, JsonpDeserializer.stringDeserializer(), "search.point_in_time_current"); + op.add(Builder::searchPointInTimeTime, JsonpDeserializer.stringDeserializer(), "search.point_in_time_time"); + op.add(Builder::searchPointInTimeTotal, JsonpDeserializer.stringDeserializer(), "search.point_in_time_total"); + op.add(Builder::searchQueryCurrent, JsonpDeserializer.stringDeserializer(), "search.query_current"); + op.add(Builder::searchQueryTime, JsonpDeserializer.stringDeserializer(), "search.query_time"); + op.add(Builder::searchQueryTotal, JsonpDeserializer.stringDeserializer(), "search.query_total"); + op.add(Builder::searchScrollCurrent, JsonpDeserializer.stringDeserializer(), "search.scroll_current"); + op.add(Builder::searchScrollTime, JsonpDeserializer.stringDeserializer(), "search.scroll_time"); + op.add(Builder::searchScrollTotal, JsonpDeserializer.stringDeserializer(), "search.scroll_total"); + op.add(Builder::segmentsCount, JsonpDeserializer.stringDeserializer(), "segments.count"); + op.add(Builder::segmentsFixedBitsetMemory, JsonpDeserializer.stringDeserializer(), "segments.fixed_bitset_memory"); + op.add(Builder::segmentsIndexWriterMemory, JsonpDeserializer.stringDeserializer(), "segments.index_writer_memory"); + op.add(Builder::segmentsMemory, JsonpDeserializer.stringDeserializer(), "segments.memory"); + op.add(Builder::segmentsVersionMapMemory, JsonpDeserializer.stringDeserializer(), "segments.version_map_memory"); + op.add(Builder::suggestCurrent, JsonpDeserializer.stringDeserializer(), "suggest.current"); + op.add(Builder::suggestTime, JsonpDeserializer.stringDeserializer(), "suggest.time"); + op.add(Builder::suggestTotal, JsonpDeserializer.stringDeserializer(), "suggest.total"); + op.add(Builder::type, JsonpDeserializer.stringDeserializer(), "type"); + op.add(Builder::uptime, JsonpDeserializer.stringDeserializer(), "uptime"); + op.add(Builder::version, JsonpDeserializer.stringDeserializer(), "version"); + } + @Override + public int hashCode() { + int result = 17; + result = 31 * result + Objects.hashCode(this.build); + result = 31 * result + Objects.hashCode(this.bulkAvgSizeInBytes); + result = 31 * result + Objects.hashCode(this.bulkAvgTime); + result = 31 * result + Objects.hashCode(this.bulkTotalOperations); + result = 31 * result + Objects.hashCode(this.bulkTotalSizeInBytes); + result = 31 * result + Objects.hashCode(this.bulkTotalTime); + result = 31 * result + Objects.hashCode(this.clusterManager); + result = 31 * result + Objects.hashCode(this.completionSize); + result = 31 * result + Objects.hashCode(this.cpu); + result = 31 * result + Objects.hashCode(this.diskAvail); + result = 31 * result + Objects.hashCode(this.diskTotal); + result = 31 * result + Objects.hashCode(this.diskUsed); + result = 31 * result + Objects.hashCode(this.diskUsedPercent); + result = 31 * result + Objects.hashCode(this.fielddataEvictions); + result = 31 * result + Objects.hashCode(this.fielddataMemorySize); + result = 31 * result + Objects.hashCode(this.fileDescCurrent); + result = 31 * result + Objects.hashCode(this.fileDescMax); + result = 31 * result + Objects.hashCode(this.fileDescPercent); + result = 31 * result + Objects.hashCode(this.flavor); + result = 31 * result + Objects.hashCode(this.flushTotal); + result = 31 * result + Objects.hashCode(this.flushTotalTime); + result = 31 * result + Objects.hashCode(this.getCurrent); + result = 31 * result + Objects.hashCode(this.getExistsTime); + result = 31 * result + Objects.hashCode(this.getExistsTotal); + result = 31 * result + Objects.hashCode(this.getMissingTime); + result = 31 * result + Objects.hashCode(this.getMissingTotal); + result = 31 * result + Objects.hashCode(this.getTime); + result = 31 * result + Objects.hashCode(this.getTotal); + result = 31 * result + Objects.hashCode(this.heapCurrent); + result = 31 * result + Objects.hashCode(this.heapMax); + result = 31 * result + Objects.hashCode(this.heapPercent); + result = 31 * result + Objects.hashCode(this.httpAddress); + result = 31 * result + Objects.hashCode(this.id); + result = 31 * result + Objects.hashCode(this.indexingDeleteCurrent); + result = 31 * result + Objects.hashCode(this.indexingDeleteTime); + result = 31 * result + Objects.hashCode(this.indexingDeleteTotal); + result = 31 * result + Objects.hashCode(this.indexingIndexCurrent); + result = 31 * result + Objects.hashCode(this.indexingIndexFailed); + result = 31 * result + Objects.hashCode(this.indexingIndexTime); + result = 31 * result + Objects.hashCode(this.indexingIndexTotal); + result = 31 * result + Objects.hashCode(this.ip); + result = 31 * result + Objects.hashCode(this.jdk); + result = 31 * result + Objects.hashCode(this.load15m); + result = 31 * result + Objects.hashCode(this.load1m); + result = 31 * result + Objects.hashCode(this.load5m); + result = 31 * result + Objects.hashCode(this.master); + result = 31 * result + Objects.hashCode(this.mergesCurrent); + result = 31 * result + Objects.hashCode(this.mergesCurrentDocs); + result = 31 * result + Objects.hashCode(this.mergesCurrentSize); + result = 31 * result + Objects.hashCode(this.mergesTotal); + result = 31 * result + Objects.hashCode(this.mergesTotalDocs); + result = 31 * result + Objects.hashCode(this.mergesTotalSize); + result = 31 * result + Objects.hashCode(this.mergesTotalTime); + result = 31 * result + Objects.hashCode(this.name); + result = 31 * result + Objects.hashCode(this.nodeRole); + result = 31 * result + Objects.hashCode(this.nodeRoles); + result = 31 * result + Objects.hashCode(this.pid); + result = 31 * result + Objects.hashCode(this.port); + result = 31 * result + Objects.hashCode(this.queryCacheEvictions); + result = 31 * result + Objects.hashCode(this.queryCacheHitCount); + result = 31 * result + Objects.hashCode(this.queryCacheMemorySize); + result = 31 * result + Objects.hashCode(this.queryCacheMissCount); + result = 31 * result + Objects.hashCode(this.ramCurrent); + result = 31 * result + Objects.hashCode(this.ramMax); + result = 31 * result + Objects.hashCode(this.ramPercent); + result = 31 * result + Objects.hashCode(this.refreshExternalTime); + result = 31 * result + Objects.hashCode(this.refreshExternalTotal); + result = 31 * result + Objects.hashCode(this.refreshListeners); + result = 31 * result + Objects.hashCode(this.refreshTime); + result = 31 * result + Objects.hashCode(this.refreshTotal); + result = 31 * result + Objects.hashCode(this.requestCacheEvictions); + result = 31 * result + Objects.hashCode(this.requestCacheHitCount); + result = 31 * result + Objects.hashCode(this.requestCacheMemorySize); + result = 31 * result + Objects.hashCode(this.requestCacheMissCount); + result = 31 * result + Objects.hashCode(this.scriptCacheEvictions); + result = 31 * result + Objects.hashCode(this.scriptCompilationLimitTriggered); + result = 31 * result + Objects.hashCode(this.scriptCompilations); + result = 31 * result + Objects.hashCode(this.searchConcurrentAvgSliceCount); + result = 31 * result + Objects.hashCode(this.searchConcurrentQueryCurrent); + result = 31 * result + Objects.hashCode(this.searchConcurrentQueryTime); + result = 31 * result + Objects.hashCode(this.searchConcurrentQueryTotal); + result = 31 * result + Objects.hashCode(this.searchFetchCurrent); + result = 31 * result + Objects.hashCode(this.searchFetchTime); + result = 31 * result + Objects.hashCode(this.searchFetchTotal); + result = 31 * result + Objects.hashCode(this.searchOpenContexts); + result = 31 * result + Objects.hashCode(this.searchPointInTimeCurrent); + result = 31 * result + Objects.hashCode(this.searchPointInTimeTime); + result = 31 * result + Objects.hashCode(this.searchPointInTimeTotal); + result = 31 * result + Objects.hashCode(this.searchQueryCurrent); + result = 31 * result + Objects.hashCode(this.searchQueryTime); + result = 31 * result + Objects.hashCode(this.searchQueryTotal); + result = 31 * result + Objects.hashCode(this.searchScrollCurrent); + result = 31 * result + Objects.hashCode(this.searchScrollTime); + result = 31 * result + Objects.hashCode(this.searchScrollTotal); + result = 31 * result + Objects.hashCode(this.segmentsCount); + result = 31 * result + Objects.hashCode(this.segmentsFixedBitsetMemory); + result = 31 * result + Objects.hashCode(this.segmentsIndexWriterMemory); + result = 31 * result + Objects.hashCode(this.segmentsMemory); + result = 31 * result + Objects.hashCode(this.segmentsVersionMapMemory); + result = 31 * result + Objects.hashCode(this.suggestCurrent); + result = 31 * result + Objects.hashCode(this.suggestTime); + result = 31 * result + Objects.hashCode(this.suggestTotal); + result = 31 * result + Objects.hashCode(this.type); + result = 31 * result + Objects.hashCode(this.uptime); + 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; + NodesRecord other = (NodesRecord) o; + return Objects.equals(this.build, other.build) + && Objects.equals(this.bulkAvgSizeInBytes, other.bulkAvgSizeInBytes) + && Objects.equals(this.bulkAvgTime, other.bulkAvgTime) + && Objects.equals(this.bulkTotalOperations, other.bulkTotalOperations) + && Objects.equals(this.bulkTotalSizeInBytes, other.bulkTotalSizeInBytes) + && Objects.equals(this.bulkTotalTime, other.bulkTotalTime) + && Objects.equals(this.clusterManager, other.clusterManager) + && Objects.equals(this.completionSize, other.completionSize) + && Objects.equals(this.cpu, other.cpu) + && Objects.equals(this.diskAvail, other.diskAvail) + && Objects.equals(this.diskTotal, other.diskTotal) + && Objects.equals(this.diskUsed, other.diskUsed) + && Objects.equals(this.diskUsedPercent, other.diskUsedPercent) + && Objects.equals(this.fielddataEvictions, other.fielddataEvictions) + && Objects.equals(this.fielddataMemorySize, other.fielddataMemorySize) + && Objects.equals(this.fileDescCurrent, other.fileDescCurrent) + && Objects.equals(this.fileDescMax, other.fileDescMax) + && Objects.equals(this.fileDescPercent, other.fileDescPercent) + && Objects.equals(this.flavor, other.flavor) + && Objects.equals(this.flushTotal, other.flushTotal) + && Objects.equals(this.flushTotalTime, other.flushTotalTime) + && Objects.equals(this.getCurrent, other.getCurrent) + && Objects.equals(this.getExistsTime, other.getExistsTime) + && Objects.equals(this.getExistsTotal, other.getExistsTotal) + && Objects.equals(this.getMissingTime, other.getMissingTime) + && Objects.equals(this.getMissingTotal, other.getMissingTotal) + && Objects.equals(this.getTime, other.getTime) + && Objects.equals(this.getTotal, other.getTotal) + && Objects.equals(this.heapCurrent, other.heapCurrent) + && Objects.equals(this.heapMax, other.heapMax) + && Objects.equals(this.heapPercent, other.heapPercent) + && Objects.equals(this.httpAddress, other.httpAddress) + && Objects.equals(this.id, other.id) + && Objects.equals(this.indexingDeleteCurrent, other.indexingDeleteCurrent) + && Objects.equals(this.indexingDeleteTime, other.indexingDeleteTime) + && Objects.equals(this.indexingDeleteTotal, other.indexingDeleteTotal) + && Objects.equals(this.indexingIndexCurrent, other.indexingIndexCurrent) + && Objects.equals(this.indexingIndexFailed, other.indexingIndexFailed) + && Objects.equals(this.indexingIndexTime, other.indexingIndexTime) + && Objects.equals(this.indexingIndexTotal, other.indexingIndexTotal) + && Objects.equals(this.ip, other.ip) + && Objects.equals(this.jdk, other.jdk) + && Objects.equals(this.load15m, other.load15m) + && Objects.equals(this.load1m, other.load1m) + && Objects.equals(this.load5m, other.load5m) + && Objects.equals(this.master, other.master) + && Objects.equals(this.mergesCurrent, other.mergesCurrent) + && Objects.equals(this.mergesCurrentDocs, other.mergesCurrentDocs) + && Objects.equals(this.mergesCurrentSize, other.mergesCurrentSize) + && Objects.equals(this.mergesTotal, other.mergesTotal) + && Objects.equals(this.mergesTotalDocs, other.mergesTotalDocs) + && Objects.equals(this.mergesTotalSize, other.mergesTotalSize) + && Objects.equals(this.mergesTotalTime, other.mergesTotalTime) + && Objects.equals(this.name, other.name) + && Objects.equals(this.nodeRole, other.nodeRole) + && Objects.equals(this.nodeRoles, other.nodeRoles) + && Objects.equals(this.pid, other.pid) + && Objects.equals(this.port, other.port) + && Objects.equals(this.queryCacheEvictions, other.queryCacheEvictions) + && Objects.equals(this.queryCacheHitCount, other.queryCacheHitCount) + && Objects.equals(this.queryCacheMemorySize, other.queryCacheMemorySize) + && Objects.equals(this.queryCacheMissCount, other.queryCacheMissCount) + && Objects.equals(this.ramCurrent, other.ramCurrent) + && Objects.equals(this.ramMax, other.ramMax) + && Objects.equals(this.ramPercent, other.ramPercent) + && Objects.equals(this.refreshExternalTime, other.refreshExternalTime) + && Objects.equals(this.refreshExternalTotal, other.refreshExternalTotal) + && Objects.equals(this.refreshListeners, other.refreshListeners) + && Objects.equals(this.refreshTime, other.refreshTime) + && Objects.equals(this.refreshTotal, other.refreshTotal) + && Objects.equals(this.requestCacheEvictions, other.requestCacheEvictions) + && Objects.equals(this.requestCacheHitCount, other.requestCacheHitCount) + && Objects.equals(this.requestCacheMemorySize, other.requestCacheMemorySize) + && Objects.equals(this.requestCacheMissCount, other.requestCacheMissCount) + && Objects.equals(this.scriptCacheEvictions, other.scriptCacheEvictions) + && Objects.equals(this.scriptCompilationLimitTriggered, other.scriptCompilationLimitTriggered) + && Objects.equals(this.scriptCompilations, other.scriptCompilations) + && Objects.equals(this.searchConcurrentAvgSliceCount, other.searchConcurrentAvgSliceCount) + && Objects.equals(this.searchConcurrentQueryCurrent, other.searchConcurrentQueryCurrent) + && Objects.equals(this.searchConcurrentQueryTime, other.searchConcurrentQueryTime) + && Objects.equals(this.searchConcurrentQueryTotal, other.searchConcurrentQueryTotal) + && Objects.equals(this.searchFetchCurrent, other.searchFetchCurrent) + && Objects.equals(this.searchFetchTime, other.searchFetchTime) + && Objects.equals(this.searchFetchTotal, other.searchFetchTotal) + && Objects.equals(this.searchOpenContexts, other.searchOpenContexts) + && Objects.equals(this.searchPointInTimeCurrent, other.searchPointInTimeCurrent) + && Objects.equals(this.searchPointInTimeTime, other.searchPointInTimeTime) + && Objects.equals(this.searchPointInTimeTotal, other.searchPointInTimeTotal) + && Objects.equals(this.searchQueryCurrent, other.searchQueryCurrent) + && Objects.equals(this.searchQueryTime, other.searchQueryTime) + && Objects.equals(this.searchQueryTotal, other.searchQueryTotal) + && Objects.equals(this.searchScrollCurrent, other.searchScrollCurrent) + && Objects.equals(this.searchScrollTime, other.searchScrollTime) + && Objects.equals(this.searchScrollTotal, other.searchScrollTotal) + && Objects.equals(this.segmentsCount, other.segmentsCount) + && Objects.equals(this.segmentsFixedBitsetMemory, other.segmentsFixedBitsetMemory) + && Objects.equals(this.segmentsIndexWriterMemory, other.segmentsIndexWriterMemory) + && Objects.equals(this.segmentsMemory, other.segmentsMemory) + && Objects.equals(this.segmentsVersionMapMemory, other.segmentsVersionMapMemory) + && Objects.equals(this.suggestCurrent, other.suggestCurrent) + && Objects.equals(this.suggestTime, other.suggestTime) + && Objects.equals(this.suggestTotal, other.suggestTotal) + && Objects.equals(this.type, other.type) + && Objects.equals(this.uptime, other.uptime) + && Objects.equals(this.version, other.version); + } } diff --git a/java-client/src/main/java/org/opensearch/client/opensearch/cat/NodesRequest.java b/java-client/src/main/java/org/opensearch/client/opensearch/cat/NodesRequest.java deleted file mode 100644 index f6aa649809..0000000000 --- a/java-client/src/main/java/org/opensearch/client/opensearch/cat/NodesRequest.java +++ /dev/null @@ -1,176 +0,0 @@ -/* - * SPDX-License-Identifier: Apache-2.0 - * - * The OpenSearch Contributors require contributions made to - * this file be licensed under the Apache-2.0 license or a - * compatible open source license. - */ - -/* - * Licensed to Elasticsearch B.V. under one or more contributor - * license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright - * ownership. Elasticsearch B.V. licenses this file to you under - * the Apache License, Version 2.0 (the "License"); you may - * not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -/* - * Modifications Copyright OpenSearch Contributors. See - * GitHub history for details. - */ - -package org.opensearch.client.opensearch.cat; - -import java.util.HashMap; -import java.util.Map; -import java.util.function.Function; -import javax.annotation.Nullable; -import org.opensearch.client.opensearch._types.Bytes; -import org.opensearch.client.opensearch._types.ErrorResponse; -import org.opensearch.client.transport.Endpoint; -import org.opensearch.client.transport.endpoints.SimpleEndpoint; -import org.opensearch.client.util.ObjectBuilder; - -// typedef: cat.nodes.Request - -/** - * Returns basic statistics about performance of cluster nodes. - */ - -public class NodesRequest extends CatRequestBase { - @Nullable - private final Bytes bytes; - - @Nullable - private final Boolean fullId; - - // --------------------------------------------------------------------------------------------- - - private NodesRequest(Builder builder) { - super(builder); - this.bytes = builder.bytes; - this.fullId = builder.fullId; - - } - - public static NodesRequest of(Function> fn) { - return fn.apply(new Builder()).build(); - } - - /** - * The unit in which to display byte values - *

- * API name: {@code bytes} - */ - @Nullable - public final Bytes bytes() { - return this.bytes; - } - - /** - * Return the full node ID instead of the shortened version (default: false) - *

- * API name: {@code full_id} - */ - @Nullable - public final Boolean fullId() { - return this.fullId; - } - - // --------------------------------------------------------------------------------------------- - - /** - * Builder for {@link NodesRequest}. - */ - - public static class Builder extends CatRequestBaseBuilder { - @Nullable - private Bytes bytes; - - @Nullable - private Boolean fullId; - - /** - * The unit in which to display byte values - *

- * API name: {@code bytes} - */ - public final Builder bytes(@Nullable Bytes value) { - this.bytes = value; - return this; - } - - /** - * Return the full node ID instead of the shortened version (default: false) - *

- * API name: {@code full_id} - */ - public final Builder fullId(@Nullable Boolean value) { - this.fullId = value; - return this; - } - - /** - * Builds a {@link NodesRequest}. - * - * @throws NullPointerException if some of the required fields are null. - */ - public NodesRequest build() { - _checkSingleUse(); - - return new NodesRequest(this); - } - - @Override - protected Builder self() { - return this; - } - } - - // --------------------------------------------------------------------------------------------- - - /** - * Endpoint "{@code cat.nodes}". - */ - public static final Endpoint _ENDPOINT = new SimpleEndpoint<>( - - // Request method - request -> { - return "GET"; - - }, - - // Request path - request -> { - return "/_cat/nodes"; - - }, - - // Request parameters - request -> { - Map params = new HashMap<>(request.queryParameters()); - if (request.bytes != null) { - params.put("bytes", request.bytes.jsonValue()); - } - if (request.fullId != null) { - params.put("full_id", String.valueOf(request.fullId)); - } - return params; - - }, - SimpleEndpoint.emptyMap(), - false, - NodesResponse._DESERIALIZER - ); -} diff --git a/java-client/src/main/java/org/opensearch/client/opensearch/cat/OpenSearchCatAsyncClient.java b/java-client/src/main/java/org/opensearch/client/opensearch/cat/OpenSearchCatAsyncClient.java index 6ffa69a975..9c4830f0ca 100644 --- a/java-client/src/main/java/org/opensearch/client/opensearch/cat/OpenSearchCatAsyncClient.java +++ b/java-client/src/main/java/org/opensearch/client/opensearch/cat/OpenSearchCatAsyncClient.java @@ -72,48 +72,6 @@ public CompletableFuture help() throws IOException, OpenSearchExce return this.transport.performRequestAsync(HelpRequest._INSTANCE, HelpRequest._ENDPOINT, this.transportOptions); } - // ----- Endpoint: cat.nodes - - /** - * Returns basic statistics about performance of cluster nodes. - * - * - */ - - public CompletableFuture nodes(NodesRequest request) throws IOException, OpenSearchException { - @SuppressWarnings("unchecked") - JsonEndpoint endpoint = (JsonEndpoint< - NodesRequest, - NodesResponse, - ErrorResponse>) NodesRequest._ENDPOINT; - - return this.transport.performRequestAsync(request, endpoint, this.transportOptions); - } - - /** - * Returns basic statistics about performance of cluster nodes. - * - * @param fn - * a function that initializes a builder to create the - * {@link NodesRequest} - * - */ - - public final CompletableFuture nodes(Function> fn) throws IOException, - OpenSearchException { - return nodes(fn.apply(new NodesRequest.Builder()).build()); - } - - /** - * Returns basic statistics about performance of cluster nodes. - * - * - */ - - public CompletableFuture nodes() throws IOException, OpenSearchException { - return this.transport.performRequestAsync(new NodesRequest.Builder().build(), NodesRequest._ENDPOINT, this.transportOptions); - } - // ----- Endpoint: cat.point_in_time_segments /** diff --git a/java-client/src/main/java/org/opensearch/client/opensearch/cat/OpenSearchCatClient.java b/java-client/src/main/java/org/opensearch/client/opensearch/cat/OpenSearchCatClient.java index 6033959821..b62ef7b72f 100644 --- a/java-client/src/main/java/org/opensearch/client/opensearch/cat/OpenSearchCatClient.java +++ b/java-client/src/main/java/org/opensearch/client/opensearch/cat/OpenSearchCatClient.java @@ -71,48 +71,6 @@ public HelpResponse help() throws IOException, OpenSearchException { return this.transport.performRequest(HelpRequest._INSTANCE, HelpRequest._ENDPOINT, this.transportOptions); } - // ----- Endpoint: cat.nodes - - /** - * Returns basic statistics about performance of cluster nodes. - * - * - */ - - public NodesResponse nodes(NodesRequest request) throws IOException, OpenSearchException { - @SuppressWarnings("unchecked") - JsonEndpoint endpoint = (JsonEndpoint< - NodesRequest, - NodesResponse, - ErrorResponse>) NodesRequest._ENDPOINT; - - return this.transport.performRequest(request, endpoint, this.transportOptions); - } - - /** - * Returns basic statistics about performance of cluster nodes. - * - * @param fn - * a function that initializes a builder to create the - * {@link NodesRequest} - * - */ - - public final NodesResponse nodes(Function> fn) throws IOException, - OpenSearchException { - return nodes(fn.apply(new NodesRequest.Builder()).build()); - } - - /** - * Returns basic statistics about performance of cluster nodes. - * - * - */ - - public NodesResponse nodes() throws IOException, OpenSearchException { - return this.transport.performRequest(new NodesRequest.Builder().build(), NodesRequest._ENDPOINT, this.transportOptions); - } - // ----- Endpoint: cat.point_in_time_segments /** diff --git a/java-codegen/opensearch-openapi.yaml b/java-codegen/opensearch-openapi.yaml index 3f2712892a..f2b773e2a2 100644 --- a/java-codegen/opensearch-openapi.yaml +++ b/java-codegen/opensearch-openapi.yaml @@ -16111,9 +16111,7 @@ components: name: full_id description: When `true`, returns the full node ID. When `false`, returns the shortened node ID. schema: - anyOf: - - type: boolean - - type: string + $ref: '#/components/schemas/_common___StringifiedBoolean' default: false style: form cat.nodes___query.h: diff --git a/java-codegen/src/main/java/org/opensearch/client/codegen/CodeGenerator.java b/java-codegen/src/main/java/org/opensearch/client/codegen/CodeGenerator.java index 2c55e62939..092dfb2109 100644 --- a/java-codegen/src/main/java/org/opensearch/client/codegen/CodeGenerator.java +++ b/java-codegen/src/main/java/org/opensearch/client/codegen/CodeGenerator.java @@ -50,7 +50,20 @@ public class CodeGenerator { and(namespace(isNull()), name(is("info"))), and( namespace(is("cat")), - name(isOneOf("aliases", "allocation", "cluster_manager", "count", "fielddata", "health", "indices", "master", "nodeattrs")) + name( + isOneOf( + "aliases", + "allocation", + "cluster_manager", + "count", + "fielddata", + "health", + "indices", + "master", + "nodeattrs", + "nodes" + ) + ) ), and( namespace(is("cluster")), From 59f44c2c3af3a9dc1a484a2a31563f17fe73fa43 Mon Sep 17 00:00:00 2001 From: Thomas Farr Date: Tue, 7 Jan 2025 22:06:16 +1300 Subject: [PATCH 10/18] Generate cat.all_pit_segments, cat.pending_tasks, cat.pit_segments & cat.plugins Signed-off-by: Thomas Farr --- .../opensearch/cat/AllPitSegmentsRequest.java | 202 ++++++ .../cat/AllPitSegmentsResponse.java | 193 ++++++ .../cat/OpenSearchCatAsyncClientBase.java | 100 +++ .../cat/OpenSearchCatClientBase.java | 97 +++ .../opensearch/cat/PendingTasksRequest.java | 303 +++++++++ .../opensearch/cat/PendingTasksResponse.java | 74 ++- .../opensearch/cat/PitSegmentsRequest.java | 287 +++++++++ .../opensearch/cat/PitSegmentsResponse.java | 190 ++++++ .../client/opensearch/cat/PluginsRequest.java | 262 ++++++++ .../opensearch/cat/PluginsResponse.java | 74 ++- .../cat/pending_tasks/PendingTasksRecord.java | 193 ++++-- .../opensearch/cat/plugins/PluginsRecord.java | 263 +++++--- .../cat/segments/SegmentsRecord.java | 608 +++++++++++------- .../cat/OpenSearchCatAsyncClient.java | 38 -- .../opensearch/cat/OpenSearchCatClient.java | 63 -- .../opensearch/cat/PendingTasksRequest.java | 80 --- .../opensearch/cat/PitSegmentsRequest.java | 107 --- .../client/opensearch/cat/PluginsRequest.java | 80 --- java-codegen/opensearch-openapi.yaml | 35 +- .../client/codegen/CodeGenerator.java | 6 +- 20 files changed, 2406 insertions(+), 849 deletions(-) create mode 100644 java-client/src/generated/java/org/opensearch/client/opensearch/cat/AllPitSegmentsRequest.java create mode 100644 java-client/src/generated/java/org/opensearch/client/opensearch/cat/AllPitSegmentsResponse.java create mode 100644 java-client/src/generated/java/org/opensearch/client/opensearch/cat/PendingTasksRequest.java rename java-client/src/{main => generated}/java/org/opensearch/client/opensearch/cat/PendingTasksResponse.java (76%) create mode 100644 java-client/src/generated/java/org/opensearch/client/opensearch/cat/PitSegmentsRequest.java create mode 100644 java-client/src/generated/java/org/opensearch/client/opensearch/cat/PitSegmentsResponse.java create mode 100644 java-client/src/generated/java/org/opensearch/client/opensearch/cat/PluginsRequest.java rename java-client/src/{main => generated}/java/org/opensearch/client/opensearch/cat/PluginsResponse.java (75%) rename java-client/src/{main => generated}/java/org/opensearch/client/opensearch/cat/pending_tasks/PendingTasksRecord.java (57%) rename java-client/src/{main => generated}/java/org/opensearch/client/opensearch/cat/plugins/PluginsRecord.java (69%) rename java-client/src/{main => generated}/java/org/opensearch/client/opensearch/cat/segments/SegmentsRecord.java (59%) delete mode 100644 java-client/src/main/java/org/opensearch/client/opensearch/cat/PendingTasksRequest.java delete mode 100644 java-client/src/main/java/org/opensearch/client/opensearch/cat/PitSegmentsRequest.java delete mode 100644 java-client/src/main/java/org/opensearch/client/opensearch/cat/PluginsRequest.java diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/cat/AllPitSegmentsRequest.java b/java-client/src/generated/java/org/opensearch/client/opensearch/cat/AllPitSegmentsRequest.java new file mode 100644 index 0000000000..7be5271731 --- /dev/null +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/cat/AllPitSegmentsRequest.java @@ -0,0 +1,202 @@ +/* + * SPDX-License-Identifier: Apache-2.0 + * + * The OpenSearch Contributors require contributions made to + * this file be licensed under the Apache-2.0 license or a + * compatible open source license. + */ + +/* + * Licensed to Elasticsearch B.V. under one or more contributor + * license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright + * ownership. Elasticsearch B.V. licenses this file to you under + * the Apache License, Version 2.0 (the "License"); you may + * not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +/* + * Modifications Copyright OpenSearch Contributors. See + * GitHub history for details. + */ + +//---------------------------------------------------- +// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. +//---------------------------------------------------- + +package org.opensearch.client.opensearch.cat; + +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.Bytes; +import org.opensearch.client.opensearch._types.ErrorResponse; +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.ToCopyableBuilder; + +// typedef: cat.all_pit_segments.Request + +/** + * Lists all active CAT point-in-time segments. + */ +@Generated("org.opensearch.client.codegen.CodeGenerator") +public final class AllPitSegmentsRequest extends CatRequestBase + implements + ToCopyableBuilder { + + @Nullable + private final Bytes bytes; + + // --------------------------------------------------------------------------------------------- + + private AllPitSegmentsRequest(Builder builder) { + super(builder); + this.bytes = builder.bytes; + } + + public static AllPitSegmentsRequest of(Function> fn) { + return fn.apply(new Builder()).build(); + } + + /** + * The units used to display byte values. + *

+ * API name: {@code bytes} + *

+ */ + @Nullable + public final Bytes bytes() { + return this.bytes; + } + + // --------------------------------------------------------------------------------------------- + + @Override + @Nonnull + public Builder toBuilder() { + return new Builder(this); + } + + @Nonnull + public static Builder builder() { + return new Builder(); + } + + /** + * Builder for {@link AllPitSegmentsRequest}. + */ + public static class Builder extends CatRequestBase.AbstractBuilder implements CopyableBuilder { + @Nullable + private Bytes bytes; + + public Builder() {} + + private Builder(AllPitSegmentsRequest o) { + super(o); + this.bytes = o.bytes; + } + + private Builder(Builder o) { + super(o); + this.bytes = o.bytes; + } + + @Override + @Nonnull + public Builder copy() { + return new Builder(this); + } + + @Override + @Nonnull + protected Builder self() { + return this; + } + + /** + * The units used to display byte values. + *

+ * API name: {@code bytes} + *

+ */ + @Nonnull + public final Builder bytes(@Nullable Bytes value) { + this.bytes = value; + return this; + } + + /** + * Builds a {@link AllPitSegmentsRequest}. + * + * @throws NullPointerException if some of the required fields are null. + */ + @Override + @Nonnull + public AllPitSegmentsRequest build() { + _checkSingleUse(); + + return new AllPitSegmentsRequest(this); + } + } + + // --------------------------------------------------------------------------------------------- + + @Override + protected void applyQueryParameters(@Nonnull Map params) { + super.applyQueryParameters(params); + if (this.bytes != null) { + params.put("bytes", this.bytes.jsonValue()); + } + } + + /** + * Endpoint "{@code cat.all_pit_segments}". + */ + public static final Endpoint _ENDPOINT = new SimpleEndpoint<>( + // Request method + request -> "GET", + // Request path + request -> "/_cat/pit_segments/_all", + // Request parameters + request -> { + Map params = new HashMap<>(); + request.applyQueryParameters(params); + return params; + }, + SimpleEndpoint.emptyMap(), + false, + AllPitSegmentsResponse._DESERIALIZER + ); + + @Override + public int hashCode() { + int result = 17; + result = 31 * result + Objects.hashCode(this.bytes); + return result; + } + + @Override + public boolean equals(Object o) { + if (this == o) return true; + if (o == null || this.getClass() != o.getClass()) return false; + AllPitSegmentsRequest other = (AllPitSegmentsRequest) o; + return Objects.equals(this.bytes, other.bytes); + } +} diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/cat/AllPitSegmentsResponse.java b/java-client/src/generated/java/org/opensearch/client/opensearch/cat/AllPitSegmentsResponse.java new file mode 100644 index 0000000000..7aedf26409 --- /dev/null +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/cat/AllPitSegmentsResponse.java @@ -0,0 +1,193 @@ +/* + * SPDX-License-Identifier: Apache-2.0 + * + * The OpenSearch Contributors require contributions made to + * this file be licensed under the Apache-2.0 license or a + * compatible open source license. + */ + +/* + * Licensed to Elasticsearch B.V. under one or more contributor + * license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright + * ownership. Elasticsearch B.V. licenses this file to you under + * the Apache License, Version 2.0 (the "License"); you may + * not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +/* + * Modifications Copyright OpenSearch Contributors. See + * GitHub history for details. + */ + +//---------------------------------------------------- +// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. +//---------------------------------------------------- + +package org.opensearch.client.opensearch.cat; + +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; +import org.opensearch.client.json.PlainJsonSerializable; +import org.opensearch.client.opensearch.cat.segments.SegmentsRecord; +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: cat.all_pit_segments.Response + +@JsonpDeserializable +@Generated("org.opensearch.client.codegen.CodeGenerator") +public class AllPitSegmentsResponse + implements + PlainJsonSerializable, + ToCopyableBuilder { + + @Nonnull + private final List valueBody; + + // --------------------------------------------------------------------------------------------- + + private AllPitSegmentsResponse(Builder builder) { + this.valueBody = ApiTypeHelper.unmodifiableRequired(builder.valueBody, this, "valueBody"); + } + + public static AllPitSegmentsResponse of(Function> fn) { + return fn.apply(new Builder()).build(); + } + + /** + * Required - Response value. + */ + @Nonnull + public final List valueBody() { + return this.valueBody; + } + + /** + * Serialize this value to JSON. + */ + public void serialize(JsonGenerator generator, JsonpMapper mapper) { + generator.writeStartArray(); + for (SegmentsRecord item0 : this.valueBody) { + 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 AllPitSegmentsResponse}. + */ + public static class Builder extends ObjectBuilderBase implements CopyableBuilder { + private List valueBody; + + public Builder() {} + + private Builder(AllPitSegmentsResponse o) { + this.valueBody = _listCopy(o.valueBody); + } + + private Builder(Builder o) { + this.valueBody = _listCopy(o.valueBody); + } + + @Override + @Nonnull + public Builder copy() { + return new Builder(this); + } + + /** + * Required - Response value. + * + *

+ * Adds all elements of list to valueBody. + *

+ */ + @Nonnull + public final Builder valueBody(List list) { + this.valueBody = _listAddAll(this.valueBody, list); + return this; + } + + /** + * Required - Response value. + * + *

+ * Adds one or more values to valueBody. + *

+ */ + @Nonnull + public final Builder valueBody(SegmentsRecord value, SegmentsRecord... values) { + this.valueBody = _listAdd(this.valueBody, value, values); + return this; + } + + /** + * Required - Response value. + * + *

+ * Adds a value to valueBody using a builder lambda. + *

+ */ + @Nonnull + public final Builder valueBody(Function> fn) { + return valueBody(fn.apply(new SegmentsRecord.Builder()).build()); + } + + /** + * Builds a {@link AllPitSegmentsResponse}. + * + * @throws NullPointerException if some of the required fields are null. + */ + @Override + @Nonnull + public AllPitSegmentsResponse build() { + _checkSingleUse(); + + return new AllPitSegmentsResponse(this); + } + } + + public static final JsonpDeserializer _DESERIALIZER = createAllPitSegmentsResponseDeserializer(); + + protected static JsonpDeserializer createAllPitSegmentsResponseDeserializer() { + JsonpDeserializer> valueDeserializer = JsonpDeserializer.arrayDeserializer(SegmentsRecord._DESERIALIZER); + + return JsonpDeserializer.of( + valueDeserializer.acceptedEvents(), + (parser, mapper) -> new Builder().valueBody(valueDeserializer.deserialize(parser, mapper)).build() + ); + } +} diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/cat/OpenSearchCatAsyncClientBase.java b/java-client/src/generated/java/org/opensearch/client/opensearch/cat/OpenSearchCatAsyncClientBase.java index 3aaea79a27..8fa8a0231c 100644 --- a/java-client/src/generated/java/org/opensearch/client/opensearch/cat/OpenSearchCatAsyncClientBase.java +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/cat/OpenSearchCatAsyncClientBase.java @@ -84,6 +84,33 @@ public final CompletableFuture aliases() throws IOException, Op return aliases(new AliasesRequest.Builder().build()); } + // ----- Endpoint: cat.all_pit_segments + + /** + * Lists all active CAT point-in-time segments. + */ + public CompletableFuture allPitSegments(AllPitSegmentsRequest request) throws IOException, OpenSearchException { + return this.transport.performRequestAsync(request, AllPitSegmentsRequest._ENDPOINT, this.transportOptions); + } + + /** + * Lists all active CAT point-in-time segments. + * + * @param fn a function that initializes a builder to create the {@link AllPitSegmentsRequest} + */ + public final CompletableFuture allPitSegments( + Function> fn + ) throws IOException, OpenSearchException { + return allPitSegments(fn.apply(new AllPitSegmentsRequest.Builder()).build()); + } + + /** + * Lists all active CAT point-in-time segments. + */ + public final CompletableFuture allPitSegments() throws IOException, OpenSearchException { + return allPitSegments(new AllPitSegmentsRequest.Builder().build()); + } + // ----- Endpoint: cat.allocation /** @@ -324,4 +351,77 @@ public final CompletableFuture nodes(Function nodes() throws IOException, OpenSearchException { return nodes(new NodesRequest.Builder().build()); } + + // ----- Endpoint: cat.pending_tasks + + /** + * Returns a concise representation of the cluster's pending tasks. + */ + public CompletableFuture pendingTasks(PendingTasksRequest request) throws IOException, OpenSearchException { + return this.transport.performRequestAsync(request, PendingTasksRequest._ENDPOINT, this.transportOptions); + } + + /** + * Returns a concise representation of the cluster's pending tasks. + * + * @param fn a function that initializes a builder to create the {@link PendingTasksRequest} + */ + public final CompletableFuture pendingTasks( + Function> fn + ) throws IOException, OpenSearchException { + return pendingTasks(fn.apply(new PendingTasksRequest.Builder()).build()); + } + + /** + * Returns a concise representation of the cluster's pending tasks. + */ + public final CompletableFuture pendingTasks() throws IOException, OpenSearchException { + return pendingTasks(new PendingTasksRequest.Builder().build()); + } + + // ----- Endpoint: cat.pit_segments + + /** + * Lists one or several CAT point-in-time segments. + */ + public CompletableFuture pitSegments(PitSegmentsRequest request) throws IOException, OpenSearchException { + return this.transport.performRequestAsync(request, PitSegmentsRequest._ENDPOINT, this.transportOptions); + } + + /** + * Lists one or several CAT point-in-time segments. + * + * @param fn a function that initializes a builder to create the {@link PitSegmentsRequest} + */ + public final CompletableFuture pitSegments( + Function> fn + ) throws IOException, OpenSearchException { + return pitSegments(fn.apply(new PitSegmentsRequest.Builder()).build()); + } + + // ----- Endpoint: cat.plugins + + /** + * Returns information about the names, components, and versions of the installed plugins. + */ + public CompletableFuture plugins(PluginsRequest request) throws IOException, OpenSearchException { + return this.transport.performRequestAsync(request, PluginsRequest._ENDPOINT, this.transportOptions); + } + + /** + * Returns information about the names, components, and versions of the installed plugins. + * + * @param fn a function that initializes a builder to create the {@link PluginsRequest} + */ + public final CompletableFuture plugins(Function> fn) + throws IOException, OpenSearchException { + return plugins(fn.apply(new PluginsRequest.Builder()).build()); + } + + /** + * Returns information about the names, components, and versions of the installed plugins. + */ + public final CompletableFuture plugins() throws IOException, OpenSearchException { + return plugins(new PluginsRequest.Builder().build()); + } } diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/cat/OpenSearchCatClientBase.java b/java-client/src/generated/java/org/opensearch/client/opensearch/cat/OpenSearchCatClientBase.java index d6ff3100f4..fcab2a436c 100644 --- a/java-client/src/generated/java/org/opensearch/client/opensearch/cat/OpenSearchCatClientBase.java +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/cat/OpenSearchCatClientBase.java @@ -81,6 +81,32 @@ public final AliasesResponse aliases() throws IOException, OpenSearchException { return aliases(new AliasesRequest.Builder().build()); } + // ----- Endpoint: cat.all_pit_segments + + /** + * Lists all active CAT point-in-time segments. + */ + public AllPitSegmentsResponse allPitSegments(AllPitSegmentsRequest request) throws IOException, OpenSearchException { + return this.transport.performRequest(request, AllPitSegmentsRequest._ENDPOINT, this.transportOptions); + } + + /** + * Lists all active CAT point-in-time segments. + * + * @param fn a function that initializes a builder to create the {@link AllPitSegmentsRequest} + */ + public final AllPitSegmentsResponse allPitSegments(Function> fn) + throws IOException, OpenSearchException { + return allPitSegments(fn.apply(new AllPitSegmentsRequest.Builder()).build()); + } + + /** + * Lists all active CAT point-in-time segments. + */ + public final AllPitSegmentsResponse allPitSegments() throws IOException, OpenSearchException { + return allPitSegments(new AllPitSegmentsRequest.Builder().build()); + } + // ----- Endpoint: cat.allocation /** @@ -320,4 +346,75 @@ public final NodesResponse nodes(Function> fn) + throws IOException, OpenSearchException { + return pendingTasks(fn.apply(new PendingTasksRequest.Builder()).build()); + } + + /** + * Returns a concise representation of the cluster's pending tasks. + */ + public final PendingTasksResponse pendingTasks() throws IOException, OpenSearchException { + return pendingTasks(new PendingTasksRequest.Builder().build()); + } + + // ----- Endpoint: cat.pit_segments + + /** + * Lists one or several CAT point-in-time segments. + */ + public PitSegmentsResponse pitSegments(PitSegmentsRequest request) throws IOException, OpenSearchException { + return this.transport.performRequest(request, PitSegmentsRequest._ENDPOINT, this.transportOptions); + } + + /** + * Lists one or several CAT point-in-time segments. + * + * @param fn a function that initializes a builder to create the {@link PitSegmentsRequest} + */ + public final PitSegmentsResponse pitSegments(Function> fn) + throws IOException, OpenSearchException { + return pitSegments(fn.apply(new PitSegmentsRequest.Builder()).build()); + } + + // ----- Endpoint: cat.plugins + + /** + * Returns information about the names, components, and versions of the installed plugins. + */ + public PluginsResponse plugins(PluginsRequest request) throws IOException, OpenSearchException { + return this.transport.performRequest(request, PluginsRequest._ENDPOINT, this.transportOptions); + } + + /** + * Returns information about the names, components, and versions of the installed plugins. + * + * @param fn a function that initializes a builder to create the {@link PluginsRequest} + */ + public final PluginsResponse plugins(Function> fn) throws IOException, + OpenSearchException { + return plugins(fn.apply(new PluginsRequest.Builder()).build()); + } + + /** + * Returns information about the names, components, and versions of the installed plugins. + */ + public final PluginsResponse plugins() throws IOException, OpenSearchException { + return plugins(new PluginsRequest.Builder().build()); + } } diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/cat/PendingTasksRequest.java b/java-client/src/generated/java/org/opensearch/client/opensearch/cat/PendingTasksRequest.java new file mode 100644 index 0000000000..f99e9f0681 --- /dev/null +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/cat/PendingTasksRequest.java @@ -0,0 +1,303 @@ +/* + * SPDX-License-Identifier: Apache-2.0 + * + * The OpenSearch Contributors require contributions made to + * this file be licensed under the Apache-2.0 license or a + * compatible open source license. + */ + +/* + * Licensed to Elasticsearch B.V. under one or more contributor + * license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright + * ownership. Elasticsearch B.V. licenses this file to you under + * the Apache License, Version 2.0 (the "License"); you may + * not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +/* + * Modifications Copyright OpenSearch Contributors. See + * GitHub history for details. + */ + +//---------------------------------------------------- +// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. +//---------------------------------------------------- + +package org.opensearch.client.opensearch.cat; + +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.Time; +import org.opensearch.client.opensearch._types.TimeUnit; +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.ToCopyableBuilder; + +// typedef: cat.pending_tasks.Request + +/** + * Returns a concise representation of the cluster's pending tasks. + */ +@Generated("org.opensearch.client.codegen.CodeGenerator") +public final class PendingTasksRequest extends CatRequestBase + implements + ToCopyableBuilder { + + @Nullable + private final Time clusterManagerTimeout; + + @Deprecated + @Nullable + private final Time masterTimeout; + + @Nullable + private final TimeUnit time; + + // --------------------------------------------------------------------------------------------- + + private PendingTasksRequest(Builder builder) { + super(builder); + this.clusterManagerTimeout = builder.clusterManagerTimeout; + this.masterTimeout = builder.masterTimeout; + this.time = builder.time; + } + + public static PendingTasksRequest of(Function> fn) { + return fn.apply(new Builder()).build(); + } + + /** + * The amount of time allowed to establish a connection to the cluster manager node. + *

+ * API name: {@code cluster_manager_timeout} + *

+ */ + @Nullable + public final Time clusterManagerTimeout() { + return this.clusterManagerTimeout; + } + + /** + * The amount of time allowed to establish a connection to the cluster manager node. + *

+ * API name: {@code master_timeout} + *

+ */ + @Deprecated + @Nullable + public final Time masterTimeout() { + return this.masterTimeout; + } + + /** + * Specifies the time units, for example, 5d or 7h. For more information, see + * Supported units. + *

+ * API name: {@code time} + *

+ */ + @Nullable + public final TimeUnit time() { + return this.time; + } + + // --------------------------------------------------------------------------------------------- + + @Override + @Nonnull + public Builder toBuilder() { + return new Builder(this); + } + + @Nonnull + public static Builder builder() { + return new Builder(); + } + + /** + * Builder for {@link PendingTasksRequest}. + */ + public static class Builder extends CatRequestBase.AbstractBuilder implements CopyableBuilder { + @Nullable + private Time clusterManagerTimeout; + @Nullable + private Time masterTimeout; + @Nullable + private TimeUnit time; + + public Builder() {} + + private Builder(PendingTasksRequest o) { + super(o); + this.clusterManagerTimeout = o.clusterManagerTimeout; + this.masterTimeout = o.masterTimeout; + this.time = o.time; + } + + private Builder(Builder o) { + super(o); + this.clusterManagerTimeout = o.clusterManagerTimeout; + this.masterTimeout = o.masterTimeout; + this.time = o.time; + } + + @Override + @Nonnull + public Builder copy() { + return new Builder(this); + } + + @Override + @Nonnull + protected Builder self() { + return this; + } + + /** + * The amount of time allowed to establish a connection to the cluster manager node. + *

+ * API name: {@code cluster_manager_timeout} + *

+ */ + @Nonnull + public final Builder clusterManagerTimeout(@Nullable Time value) { + this.clusterManagerTimeout = value; + return this; + } + + /** + * The amount of time allowed to establish a connection to the cluster manager node. + *

+ * API name: {@code cluster_manager_timeout} + *

+ */ + @Nonnull + public final Builder clusterManagerTimeout(Function> fn) { + return clusterManagerTimeout(fn.apply(new Time.Builder()).build()); + } + + /** + * The amount of time allowed to establish a connection to the cluster manager node. + *

+ * API name: {@code master_timeout} + *

+ */ + @Deprecated + @Nonnull + public final Builder masterTimeout(@Nullable Time value) { + this.masterTimeout = value; + return this; + } + + /** + * The amount of time allowed to establish a connection to the cluster manager node. + *

+ * API name: {@code master_timeout} + *

+ */ + @Deprecated + @Nonnull + public final Builder masterTimeout(Function> fn) { + return masterTimeout(fn.apply(new Time.Builder()).build()); + } + + /** + * Specifies the time units, for example, 5d or 7h. For more information, see + * Supported units. + *

+ * API name: {@code time} + *

+ */ + @Nonnull + public final Builder time(@Nullable TimeUnit value) { + this.time = value; + return this; + } + + /** + * Builds a {@link PendingTasksRequest}. + * + * @throws NullPointerException if some of the required fields are null. + */ + @Override + @Nonnull + public PendingTasksRequest build() { + _checkSingleUse(); + + return new PendingTasksRequest(this); + } + } + + // --------------------------------------------------------------------------------------------- + + @Override + protected void applyQueryParameters(@Nonnull Map params) { + super.applyQueryParameters(params); + if (this.clusterManagerTimeout != null) { + params.put("cluster_manager_timeout", this.clusterManagerTimeout._toJsonString()); + } + if (this.masterTimeout != null) { + params.put("master_timeout", this.masterTimeout._toJsonString()); + } + if (this.time != null) { + params.put("time", this.time.jsonValue()); + } + } + + /** + * Endpoint "{@code cat.pending_tasks}". + */ + public static final Endpoint _ENDPOINT = new SimpleEndpoint<>( + // Request method + request -> "GET", + // Request path + request -> "/_cat/pending_tasks", + // Request parameters + request -> { + Map params = new HashMap<>(); + request.applyQueryParameters(params); + return params; + }, + SimpleEndpoint.emptyMap(), + false, + PendingTasksResponse._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 + Objects.hashCode(this.time); + return result; + } + + @Override + public boolean equals(Object o) { + if (this == o) return true; + if (o == null || this.getClass() != o.getClass()) return false; + PendingTasksRequest other = (PendingTasksRequest) o; + return Objects.equals(this.clusterManagerTimeout, other.clusterManagerTimeout) + && Objects.equals(this.masterTimeout, other.masterTimeout) + && Objects.equals(this.time, other.time); + } +} diff --git a/java-client/src/main/java/org/opensearch/client/opensearch/cat/PendingTasksResponse.java b/java-client/src/generated/java/org/opensearch/client/opensearch/cat/PendingTasksResponse.java similarity index 76% rename from java-client/src/main/java/org/opensearch/client/opensearch/cat/PendingTasksResponse.java rename to java-client/src/generated/java/org/opensearch/client/opensearch/cat/PendingTasksResponse.java index 3d7e4545ab..c4e6443252 100644 --- a/java-client/src/main/java/org/opensearch/client/opensearch/cat/PendingTasksResponse.java +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/cat/PendingTasksResponse.java @@ -30,43 +30,51 @@ * GitHub history for details. */ +//---------------------------------------------------- +// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. +//---------------------------------------------------- + package org.opensearch.client.opensearch.cat; 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; import org.opensearch.client.json.PlainJsonSerializable; import org.opensearch.client.opensearch.cat.pending_tasks.PendingTasksRecord; 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: cat.pending_tasks.Response @JsonpDeserializable -public class PendingTasksResponse implements PlainJsonSerializable { +@Generated("org.opensearch.client.codegen.CodeGenerator") +public class PendingTasksResponse implements PlainJsonSerializable, ToCopyableBuilder { + + @Nonnull private final List valueBody; // --------------------------------------------------------------------------------------------- private PendingTasksResponse(Builder builder) { - this.valueBody = ApiTypeHelper.unmodifiableRequired(builder.valueBody, this, "valueBody"); - } - public static PendingTasksResponse of(Function> fn) { + public static PendingTasksResponse of(Function> fn) { return fn.apply(new Builder()).build(); } /** * Required - Response value. - *

- * API name: {@code _value_body} */ + @Nonnull public final List valueBody() { return this.valueBody; } @@ -78,28 +86,53 @@ public void serialize(JsonGenerator generator, JsonpMapper mapper) { generator.writeStartArray(); for (PendingTasksRecord item0 : this.valueBody) { 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 PendingTasksResponse}. */ - - public static class Builder extends ObjectBuilderBase implements ObjectBuilder { + public static class Builder extends ObjectBuilderBase implements CopyableBuilder { private List valueBody; + public Builder() {} + + private Builder(PendingTasksResponse o) { + this.valueBody = _listCopy(o.valueBody); + } + + private Builder(Builder o) { + this.valueBody = _listCopy(o.valueBody); + } + + @Override + @Nonnull + public Builder copy() { + return new Builder(this); + } + /** * Required - Response value. - *

- * API name: {@code _value_body} + * *

* Adds all elements of list to valueBody. + *

*/ + @Nonnull public final Builder valueBody(List list) { this.valueBody = _listAddAll(this.valueBody, list); return this; @@ -107,11 +140,12 @@ public final Builder valueBody(List list) { /** * Required - Response value. - *

- * API name: {@code _value_body} + * *

* Adds one or more values to valueBody. + *

*/ + @Nonnull public final Builder valueBody(PendingTasksRecord value, PendingTasksRecord... values) { this.valueBody = _listAdd(this.valueBody, value, values); return this; @@ -119,11 +153,12 @@ public final Builder valueBody(PendingTasksRecord value, PendingTasksRecord... v /** * Required - Response value. - *

- * API name: {@code _value_body} + * *

* Adds a value to valueBody using a builder lambda. + *

*/ + @Nonnull public final Builder valueBody(Function> fn) { return valueBody(fn.apply(new PendingTasksRecord.Builder()).build()); } @@ -131,9 +166,10 @@ public final Builder valueBody(Function _DESERIALIZER = createPendingTasksResponseDeserializer(); protected static JsonpDeserializer createPendingTasksResponseDeserializer() { - JsonpDeserializer> valueDeserializer = JsonpDeserializer.arrayDeserializer( PendingTasksRecord._DESERIALIZER ); @@ -154,5 +189,4 @@ protected static JsonpDeserializer createPendingTasksRespo (parser, mapper) -> new Builder().valueBody(valueDeserializer.deserialize(parser, mapper)).build() ); } - } diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/cat/PitSegmentsRequest.java b/java-client/src/generated/java/org/opensearch/client/opensearch/cat/PitSegmentsRequest.java new file mode 100644 index 0000000000..2d2d9c8657 --- /dev/null +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/cat/PitSegmentsRequest.java @@ -0,0 +1,287 @@ +/* + * SPDX-License-Identifier: Apache-2.0 + * + * The OpenSearch Contributors require contributions made to + * this file be licensed under the Apache-2.0 license or a + * compatible open source license. + */ + +/* + * Licensed to Elasticsearch B.V. under one or more contributor + * license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright + * ownership. Elasticsearch B.V. licenses this file to you under + * the Apache License, Version 2.0 (the "License"); you may + * not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +/* + * Modifications Copyright OpenSearch Contributors. See + * GitHub history for details. + */ + +//---------------------------------------------------- +// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. +//---------------------------------------------------- + +package org.opensearch.client.opensearch.cat; + +import jakarta.json.stream.JsonGenerator; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.function.Function; +import javax.annotation.Generated; +import javax.annotation.Nonnull; +import javax.annotation.Nullable; +import org.opensearch.client.json.JsonpDeserializable; +import org.opensearch.client.json.JsonpDeserializer; +import org.opensearch.client.json.JsonpMapper; +import org.opensearch.client.json.ObjectBuilderDeserializer; +import org.opensearch.client.json.ObjectDeserializer; +import org.opensearch.client.json.PlainJsonSerializable; +import org.opensearch.client.opensearch._types.Bytes; +import org.opensearch.client.opensearch._types.ErrorResponse; +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.ToCopyableBuilder; + +// typedef: cat.pit_segments.Request + +/** + * Lists one or several CAT point-in-time segments. + */ +@JsonpDeserializable +@Generated("org.opensearch.client.codegen.CodeGenerator") +public final class PitSegmentsRequest extends CatRequestBase + implements + PlainJsonSerializable, + ToCopyableBuilder { + + @Nullable + private final Bytes bytes; + + @Nonnull + private final List pitId; + + // --------------------------------------------------------------------------------------------- + + private PitSegmentsRequest(Builder builder) { + super(builder); + this.bytes = builder.bytes; + this.pitId = ApiTypeHelper.unmodifiableRequired(builder.pitId, this, "pitId"); + } + + public static PitSegmentsRequest of(Function> fn) { + return fn.apply(new Builder()).build(); + } + + /** + * The units used to display byte values. + *

+ * API name: {@code bytes} + *

+ */ + @Nullable + public final Bytes bytes() { + return this.bytes; + } + + /** + * Required - API name: {@code pit_id} + */ + @Nonnull + public final List pitId() { + return this.pitId; + } + + /** + * Serialize this object to JSON. + */ + @Override + public void serialize(JsonGenerator generator, JsonpMapper mapper) { + generator.writeStartObject(); + serializeInternal(generator, mapper); + generator.writeEnd(); + } + + protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { + generator.writeKey("pit_id"); + generator.writeStartArray(); + for (String item0 : this.pitId) { + generator.write(item0); + } + generator.writeEnd(); + } + // --------------------------------------------------------------------------------------------- + + @Override + @Nonnull + public Builder toBuilder() { + return new Builder(this); + } + + @Nonnull + public static Builder builder() { + return new Builder(); + } + + /** + * Builder for {@link PitSegmentsRequest}. + */ + public static class Builder extends CatRequestBase.AbstractBuilder implements CopyableBuilder { + @Nullable + private Bytes bytes; + private List pitId; + + public Builder() {} + + private Builder(PitSegmentsRequest o) { + super(o); + this.bytes = o.bytes; + this.pitId = _listCopy(o.pitId); + } + + private Builder(Builder o) { + super(o); + this.bytes = o.bytes; + this.pitId = _listCopy(o.pitId); + } + + @Override + @Nonnull + public Builder copy() { + return new Builder(this); + } + + @Override + @Nonnull + protected Builder self() { + return this; + } + + /** + * The units used to display byte values. + *

+ * API name: {@code bytes} + *

+ */ + @Nonnull + public final Builder bytes(@Nullable Bytes value) { + this.bytes = value; + return this; + } + + /** + * Required - API name: {@code pit_id} + * + *

+ * Adds all elements of list to pitId. + *

+ */ + @Nonnull + public final Builder pitId(List list) { + this.pitId = _listAddAll(this.pitId, list); + return this; + } + + /** + * Required - API name: {@code pit_id} + * + *

+ * Adds one or more values to pitId. + *

+ */ + @Nonnull + public final Builder pitId(String value, String... values) { + this.pitId = _listAdd(this.pitId, value, values); + return this; + } + + /** + * Builds a {@link PitSegmentsRequest}. + * + * @throws NullPointerException if some of the required fields are null. + */ + @Override + @Nonnull + public PitSegmentsRequest build() { + _checkSingleUse(); + + return new PitSegmentsRequest(this); + } + } + + // --------------------------------------------------------------------------------------------- + + /** + * Json deserializer for {@link PitSegmentsRequest} + */ + public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer.lazy( + Builder::new, + PitSegmentsRequest::setupPitSegmentsRequestDeserializer + ); + + protected static void setupPitSegmentsRequestDeserializer(ObjectDeserializer op) { + op.add(Builder::pitId, JsonpDeserializer.arrayDeserializer(JsonpDeserializer.stringDeserializer()), "pit_id"); + } + + // --------------------------------------------------------------------------------------------- + + @Override + protected void applyQueryParameters(@Nonnull Map params) { + super.applyQueryParameters(params); + if (this.bytes != null) { + params.put("bytes", this.bytes.jsonValue()); + } + } + + /** + * Endpoint "{@code cat.pit_segments}". + */ + public static final Endpoint _ENDPOINT = new SimpleEndpoint<>( + // Request method + request -> "GET", + // Request path + request -> "/_cat/pit_segments", + // Request parameters + request -> { + Map params = new HashMap<>(); + request.applyQueryParameters(params); + return params; + }, + SimpleEndpoint.emptyMap(), + true, + PitSegmentsResponse._DESERIALIZER + ); + + @Override + public int hashCode() { + int result = 17; + result = 31 * result + Objects.hashCode(this.bytes); + result = 31 * result + this.pitId.hashCode(); + return result; + } + + @Override + public boolean equals(Object o) { + if (this == o) return true; + if (o == null || this.getClass() != o.getClass()) return false; + PitSegmentsRequest other = (PitSegmentsRequest) o; + return Objects.equals(this.bytes, other.bytes) && this.pitId.equals(other.pitId); + } +} diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/cat/PitSegmentsResponse.java b/java-client/src/generated/java/org/opensearch/client/opensearch/cat/PitSegmentsResponse.java new file mode 100644 index 0000000000..165813fdc4 --- /dev/null +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/cat/PitSegmentsResponse.java @@ -0,0 +1,190 @@ +/* + * SPDX-License-Identifier: Apache-2.0 + * + * The OpenSearch Contributors require contributions made to + * this file be licensed under the Apache-2.0 license or a + * compatible open source license. + */ + +/* + * Licensed to Elasticsearch B.V. under one or more contributor + * license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright + * ownership. Elasticsearch B.V. licenses this file to you under + * the Apache License, Version 2.0 (the "License"); you may + * not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +/* + * Modifications Copyright OpenSearch Contributors. See + * GitHub history for details. + */ + +//---------------------------------------------------- +// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. +//---------------------------------------------------- + +package org.opensearch.client.opensearch.cat; + +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; +import org.opensearch.client.json.PlainJsonSerializable; +import org.opensearch.client.opensearch.cat.segments.SegmentsRecord; +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: cat.pit_segments.Response + +@JsonpDeserializable +@Generated("org.opensearch.client.codegen.CodeGenerator") +public class PitSegmentsResponse implements PlainJsonSerializable, ToCopyableBuilder { + + @Nonnull + private final List valueBody; + + // --------------------------------------------------------------------------------------------- + + private PitSegmentsResponse(Builder builder) { + this.valueBody = ApiTypeHelper.unmodifiableRequired(builder.valueBody, this, "valueBody"); + } + + public static PitSegmentsResponse of(Function> fn) { + return fn.apply(new Builder()).build(); + } + + /** + * Required - Response value. + */ + @Nonnull + public final List valueBody() { + return this.valueBody; + } + + /** + * Serialize this value to JSON. + */ + public void serialize(JsonGenerator generator, JsonpMapper mapper) { + generator.writeStartArray(); + for (SegmentsRecord item0 : this.valueBody) { + 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 PitSegmentsResponse}. + */ + public static class Builder extends ObjectBuilderBase implements CopyableBuilder { + private List valueBody; + + public Builder() {} + + private Builder(PitSegmentsResponse o) { + this.valueBody = _listCopy(o.valueBody); + } + + private Builder(Builder o) { + this.valueBody = _listCopy(o.valueBody); + } + + @Override + @Nonnull + public Builder copy() { + return new Builder(this); + } + + /** + * Required - Response value. + * + *

+ * Adds all elements of list to valueBody. + *

+ */ + @Nonnull + public final Builder valueBody(List list) { + this.valueBody = _listAddAll(this.valueBody, list); + return this; + } + + /** + * Required - Response value. + * + *

+ * Adds one or more values to valueBody. + *

+ */ + @Nonnull + public final Builder valueBody(SegmentsRecord value, SegmentsRecord... values) { + this.valueBody = _listAdd(this.valueBody, value, values); + return this; + } + + /** + * Required - Response value. + * + *

+ * Adds a value to valueBody using a builder lambda. + *

+ */ + @Nonnull + public final Builder valueBody(Function> fn) { + return valueBody(fn.apply(new SegmentsRecord.Builder()).build()); + } + + /** + * Builds a {@link PitSegmentsResponse}. + * + * @throws NullPointerException if some of the required fields are null. + */ + @Override + @Nonnull + public PitSegmentsResponse build() { + _checkSingleUse(); + + return new PitSegmentsResponse(this); + } + } + + public static final JsonpDeserializer _DESERIALIZER = createPitSegmentsResponseDeserializer(); + + protected static JsonpDeserializer createPitSegmentsResponseDeserializer() { + JsonpDeserializer> valueDeserializer = JsonpDeserializer.arrayDeserializer(SegmentsRecord._DESERIALIZER); + + return JsonpDeserializer.of( + valueDeserializer.acceptedEvents(), + (parser, mapper) -> new Builder().valueBody(valueDeserializer.deserialize(parser, mapper)).build() + ); + } +} diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/cat/PluginsRequest.java b/java-client/src/generated/java/org/opensearch/client/opensearch/cat/PluginsRequest.java new file mode 100644 index 0000000000..959932c2b4 --- /dev/null +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/cat/PluginsRequest.java @@ -0,0 +1,262 @@ +/* + * SPDX-License-Identifier: Apache-2.0 + * + * The OpenSearch Contributors require contributions made to + * this file be licensed under the Apache-2.0 license or a + * compatible open source license. + */ + +/* + * Licensed to Elasticsearch B.V. under one or more contributor + * license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright + * ownership. Elasticsearch B.V. licenses this file to you under + * the Apache License, Version 2.0 (the "License"); you may + * not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +/* + * Modifications Copyright OpenSearch Contributors. See + * GitHub history for details. + */ + +//---------------------------------------------------- +// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. +//---------------------------------------------------- + +package org.opensearch.client.opensearch.cat; + +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.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.ToCopyableBuilder; + +// typedef: cat.plugins.Request + +/** + * Returns information about the names, components, and versions of the installed plugins. + */ +@Generated("org.opensearch.client.codegen.CodeGenerator") +public final class PluginsRequest extends CatRequestBase implements ToCopyableBuilder { + + @Nullable + private final Time clusterManagerTimeout; + + @Deprecated + @Nullable + private final Time masterTimeout; + + // --------------------------------------------------------------------------------------------- + + private PluginsRequest(Builder builder) { + super(builder); + this.clusterManagerTimeout = builder.clusterManagerTimeout; + this.masterTimeout = builder.masterTimeout; + } + + public static PluginsRequest of(Function> fn) { + return fn.apply(new Builder()).build(); + } + + /** + * The amount of time allowed to establish a connection to the cluster manager node. + *

+ * API name: {@code cluster_manager_timeout} + *

+ */ + @Nullable + public final Time clusterManagerTimeout() { + return this.clusterManagerTimeout; + } + + /** + * The amount of time allowed to establish a connection to the cluster manager node. + *

+ * API name: {@code master_timeout} + *

+ */ + @Deprecated + @Nullable + public final Time masterTimeout() { + return this.masterTimeout; + } + + // --------------------------------------------------------------------------------------------- + + @Override + @Nonnull + public Builder toBuilder() { + return new Builder(this); + } + + @Nonnull + public static Builder builder() { + return new Builder(); + } + + /** + * Builder for {@link PluginsRequest}. + */ + public static class Builder extends CatRequestBase.AbstractBuilder implements CopyableBuilder { + @Nullable + private Time clusterManagerTimeout; + @Nullable + private Time masterTimeout; + + public Builder() {} + + private Builder(PluginsRequest o) { + super(o); + this.clusterManagerTimeout = o.clusterManagerTimeout; + this.masterTimeout = o.masterTimeout; + } + + private Builder(Builder o) { + super(o); + this.clusterManagerTimeout = o.clusterManagerTimeout; + this.masterTimeout = o.masterTimeout; + } + + @Override + @Nonnull + public Builder copy() { + return new Builder(this); + } + + @Override + @Nonnull + protected Builder self() { + return this; + } + + /** + * The amount of time allowed to establish a connection to the cluster manager node. + *

+ * API name: {@code cluster_manager_timeout} + *

+ */ + @Nonnull + public final Builder clusterManagerTimeout(@Nullable Time value) { + this.clusterManagerTimeout = value; + return this; + } + + /** + * The amount of time allowed to establish a connection to the cluster manager node. + *

+ * API name: {@code cluster_manager_timeout} + *

+ */ + @Nonnull + public final Builder clusterManagerTimeout(Function> fn) { + return clusterManagerTimeout(fn.apply(new Time.Builder()).build()); + } + + /** + * The amount of time allowed to establish a connection to the cluster manager node. + *

+ * API name: {@code master_timeout} + *

+ */ + @Deprecated + @Nonnull + public final Builder masterTimeout(@Nullable Time value) { + this.masterTimeout = value; + return this; + } + + /** + * The amount of time allowed to establish a connection to the cluster manager node. + *

+ * API name: {@code master_timeout} + *

+ */ + @Deprecated + @Nonnull + public final Builder masterTimeout(Function> fn) { + return masterTimeout(fn.apply(new Time.Builder()).build()); + } + + /** + * Builds a {@link PluginsRequest}. + * + * @throws NullPointerException if some of the required fields are null. + */ + @Override + @Nonnull + public PluginsRequest build() { + _checkSingleUse(); + + return new PluginsRequest(this); + } + } + + // --------------------------------------------------------------------------------------------- + + @Override + protected void applyQueryParameters(@Nonnull Map params) { + super.applyQueryParameters(params); + if (this.clusterManagerTimeout != null) { + params.put("cluster_manager_timeout", this.clusterManagerTimeout._toJsonString()); + } + if (this.masterTimeout != null) { + params.put("master_timeout", this.masterTimeout._toJsonString()); + } + } + + /** + * Endpoint "{@code cat.plugins}". + */ + public static final Endpoint _ENDPOINT = new SimpleEndpoint<>( + // Request method + request -> "GET", + // Request path + request -> "/_cat/plugins", + // Request parameters + request -> { + Map params = new HashMap<>(); + request.applyQueryParameters(params); + return params; + }, + SimpleEndpoint.emptyMap(), + false, + PluginsResponse._DESERIALIZER + ); + + @Override + public int hashCode() { + int result = 17; + result = 31 * result + Objects.hashCode(this.clusterManagerTimeout); + result = 31 * result + Objects.hashCode(this.masterTimeout); + return result; + } + + @Override + public boolean equals(Object o) { + if (this == o) return true; + if (o == null || this.getClass() != o.getClass()) return false; + PluginsRequest other = (PluginsRequest) o; + return Objects.equals(this.clusterManagerTimeout, other.clusterManagerTimeout) + && Objects.equals(this.masterTimeout, other.masterTimeout); + } +} diff --git a/java-client/src/main/java/org/opensearch/client/opensearch/cat/PluginsResponse.java b/java-client/src/generated/java/org/opensearch/client/opensearch/cat/PluginsResponse.java similarity index 75% rename from java-client/src/main/java/org/opensearch/client/opensearch/cat/PluginsResponse.java rename to java-client/src/generated/java/org/opensearch/client/opensearch/cat/PluginsResponse.java index 1c43156668..f10e409e4a 100644 --- a/java-client/src/main/java/org/opensearch/client/opensearch/cat/PluginsResponse.java +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/cat/PluginsResponse.java @@ -30,43 +30,51 @@ * GitHub history for details. */ +//---------------------------------------------------- +// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. +//---------------------------------------------------- + package org.opensearch.client.opensearch.cat; 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; import org.opensearch.client.json.PlainJsonSerializable; import org.opensearch.client.opensearch.cat.plugins.PluginsRecord; 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: cat.plugins.Response @JsonpDeserializable -public class PluginsResponse implements PlainJsonSerializable { +@Generated("org.opensearch.client.codegen.CodeGenerator") +public class PluginsResponse implements PlainJsonSerializable, ToCopyableBuilder { + + @Nonnull private final List valueBody; // --------------------------------------------------------------------------------------------- private PluginsResponse(Builder builder) { - this.valueBody = ApiTypeHelper.unmodifiableRequired(builder.valueBody, this, "valueBody"); - } - public static PluginsResponse of(Function> fn) { + public static PluginsResponse of(Function> fn) { return fn.apply(new Builder()).build(); } /** * Required - Response value. - *

- * API name: {@code _value_body} */ + @Nonnull public final List valueBody() { return this.valueBody; } @@ -78,28 +86,53 @@ public void serialize(JsonGenerator generator, JsonpMapper mapper) { generator.writeStartArray(); for (PluginsRecord item0 : this.valueBody) { 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 PluginsResponse}. */ - - public static class Builder extends ObjectBuilderBase implements ObjectBuilder { + public static class Builder extends ObjectBuilderBase implements CopyableBuilder { private List valueBody; + public Builder() {} + + private Builder(PluginsResponse o) { + this.valueBody = _listCopy(o.valueBody); + } + + private Builder(Builder o) { + this.valueBody = _listCopy(o.valueBody); + } + + @Override + @Nonnull + public Builder copy() { + return new Builder(this); + } + /** * Required - Response value. - *

- * API name: {@code _value_body} + * *

* Adds all elements of list to valueBody. + *

*/ + @Nonnull public final Builder valueBody(List list) { this.valueBody = _listAddAll(this.valueBody, list); return this; @@ -107,11 +140,12 @@ public final Builder valueBody(List list) { /** * Required - Response value. - *

- * API name: {@code _value_body} + * *

* Adds one or more values to valueBody. + *

*/ + @Nonnull public final Builder valueBody(PluginsRecord value, PluginsRecord... values) { this.valueBody = _listAdd(this.valueBody, value, values); return this; @@ -119,11 +153,12 @@ public final Builder valueBody(PluginsRecord value, PluginsRecord... values) { /** * Required - Response value. - *

- * API name: {@code _value_body} + * *

* Adds a value to valueBody using a builder lambda. + *

*/ + @Nonnull public final Builder valueBody(Function> fn) { return valueBody(fn.apply(new PluginsRecord.Builder()).build()); } @@ -131,9 +166,10 @@ public final Builder valueBody(Function _DESERIALIZER = createPluginsResponseDeserializer(); protected static JsonpDeserializer createPluginsResponseDeserializer() { - JsonpDeserializer> valueDeserializer = JsonpDeserializer.arrayDeserializer(PluginsRecord._DESERIALIZER); return JsonpDeserializer.of( @@ -152,5 +187,4 @@ protected static JsonpDeserializer createPluginsResponseDeseria (parser, mapper) -> new Builder().valueBody(valueDeserializer.deserialize(parser, mapper)).build() ); } - } diff --git a/java-client/src/main/java/org/opensearch/client/opensearch/cat/pending_tasks/PendingTasksRecord.java b/java-client/src/generated/java/org/opensearch/client/opensearch/cat/pending_tasks/PendingTasksRecord.java similarity index 57% rename from java-client/src/main/java/org/opensearch/client/opensearch/cat/pending_tasks/PendingTasksRecord.java rename to java-client/src/generated/java/org/opensearch/client/opensearch/cat/pending_tasks/PendingTasksRecord.java index 369ffd0af9..18f67587ca 100644 --- a/java-client/src/main/java/org/opensearch/client/opensearch/cat/pending_tasks/PendingTasksRecord.java +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/cat/pending_tasks/PendingTasksRecord.java @@ -30,10 +30,17 @@ * GitHub history for details. */ +//---------------------------------------------------- +// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. +//---------------------------------------------------- + package org.opensearch.client.opensearch.cat.pending_tasks; import jakarta.json.stream.JsonGenerator; +import java.util.Objects; import java.util.function.Function; +import javax.annotation.Generated; +import javax.annotation.Nonnull; import javax.annotation.Nullable; import org.opensearch.client.json.JsonpDeserializable; import org.opensearch.client.json.JsonpDeserializer; @@ -41,18 +48,19 @@ import org.opensearch.client.json.ObjectBuilderDeserializer; import org.opensearch.client.json.ObjectDeserializer; import org.opensearch.client.json.PlainJsonSerializable; +import org.opensearch.client.util.CopyableBuilder; import org.opensearch.client.util.ObjectBuilder; import org.opensearch.client.util.ObjectBuilderBase; +import org.opensearch.client.util.ToCopyableBuilder; // typedef: cat.pending_tasks.PendingTasksRecord @JsonpDeserializable -public class PendingTasksRecord implements PlainJsonSerializable { - @Nullable - private final String insertorder; +@Generated("org.opensearch.client.codegen.CodeGenerator") +public class PendingTasksRecord implements PlainJsonSerializable, ToCopyableBuilder { @Nullable - private final String timeinqueue; + private final String insertOrder; @Nullable private final String priority; @@ -60,45 +68,38 @@ public class PendingTasksRecord implements PlainJsonSerializable { @Nullable private final String source; + @Nullable + private final String timeInQueue; + // --------------------------------------------------------------------------------------------- private PendingTasksRecord(Builder builder) { - - this.insertorder = builder.insertorder; - this.timeinqueue = builder.timeinqueue; + this.insertOrder = builder.insertOrder; this.priority = builder.priority; this.source = builder.source; - + this.timeInQueue = builder.timeInQueue; } - public static PendingTasksRecord of(Function> fn) { + public static PendingTasksRecord of(Function> fn) { return fn.apply(new Builder()).build(); } /** - * task insertion order + * The task insertion order. *

* API name: {@code insertOrder} + *

*/ @Nullable - public final String insertorder() { - return this.insertorder; - } - - /** - * how long task has been in queue - *

- * API name: {@code timeInQueue} - */ - @Nullable - public final String timeinqueue() { - return this.timeinqueue; + public final String insertOrder() { + return this.insertOrder; } /** - * task priority + * The task priority. *

* API name: {@code priority} + *

*/ @Nullable public final String priority() { @@ -106,18 +107,31 @@ public final String priority() { } /** - * task source + * The task source. *

* API name: {@code source} + *

*/ @Nullable public final String source() { return this.source; } + /** + * Indicates how long the task has been in queue. + *

+ * API name: {@code timeInQueue} + *

+ */ + @Nullable + public final String timeInQueue() { + return this.timeInQueue; + } + /** * Serialize this object to JSON. */ + @Override public void serialize(JsonGenerator generator, JsonpMapper mapper) { generator.writeStartObject(); serializeInternal(generator, mapper); @@ -125,95 +139,130 @@ public void serialize(JsonGenerator generator, JsonpMapper mapper) { } protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { - - if (this.insertorder != null) { + if (this.insertOrder != null) { generator.writeKey("insertOrder"); - generator.write(this.insertorder); - + generator.write(this.insertOrder); } - if (this.timeinqueue != null) { - generator.writeKey("timeInQueue"); - generator.write(this.timeinqueue); - } if (this.priority != null) { generator.writeKey("priority"); generator.write(this.priority); - } + if (this.source != null) { generator.writeKey("source"); generator.write(this.source); - } + if (this.timeInQueue != null) { + generator.writeKey("timeInQueue"); + generator.write(this.timeInQueue); + } } // --------------------------------------------------------------------------------------------- + @Override + @Nonnull + public Builder toBuilder() { + return new Builder(this); + } + + @Nonnull + public static Builder builder() { + return new Builder(); + } + /** * Builder for {@link PendingTasksRecord}. */ - - public static class Builder extends ObjectBuilderBase implements ObjectBuilder { - @Nullable - private String insertorder; - + public static class Builder extends ObjectBuilderBase implements CopyableBuilder { @Nullable - private String timeinqueue; - + private String insertOrder; @Nullable private String priority; - @Nullable private String source; + @Nullable + private String timeInQueue; - /** - * task insertion order - *

- * API name: {@code insertOrder} - */ - public final Builder insertorder(@Nullable String value) { - this.insertorder = value; - return this; + public Builder() {} + + private Builder(PendingTasksRecord o) { + this.insertOrder = o.insertOrder; + this.priority = o.priority; + this.source = o.source; + this.timeInQueue = o.timeInQueue; + } + + private Builder(Builder o) { + this.insertOrder = o.insertOrder; + this.priority = o.priority; + this.source = o.source; + this.timeInQueue = o.timeInQueue; + } + + @Override + @Nonnull + public Builder copy() { + return new Builder(this); } /** - * how long task has been in queue + * The task insertion order. *

- * API name: {@code timeInQueue} + * API name: {@code insertOrder} + *

*/ - public final Builder timeinqueue(@Nullable String value) { - this.timeinqueue = value; + @Nonnull + public final Builder insertOrder(@Nullable String value) { + this.insertOrder = value; return this; } /** - * task priority + * The task priority. *

* API name: {@code priority} + *

*/ + @Nonnull public final Builder priority(@Nullable String value) { this.priority = value; return this; } /** - * task source + * The task source. *

* API name: {@code source} + *

*/ + @Nonnull public final Builder source(@Nullable String value) { this.source = value; return this; } + /** + * Indicates how long the task has been in queue. + *

+ * API name: {@code timeInQueue} + *

+ */ + @Nonnull + public final Builder timeInQueue(@Nullable String value) { + this.timeInQueue = value; + return this; + } + /** * Builds a {@link PendingTasksRecord}. * - * @throws NullPointerException - * if some of the required fields are null. + * @throws NullPointerException if some of the required fields are null. */ + @Override + @Nonnull public PendingTasksRecord build() { _checkSingleUse(); @@ -232,12 +281,30 @@ public PendingTasksRecord build() { ); protected static void setupPendingTasksRecordDeserializer(ObjectDeserializer op) { + op.add(Builder::insertOrder, JsonpDeserializer.stringDeserializer(), "insertOrder"); + op.add(Builder::priority, JsonpDeserializer.stringDeserializer(), "priority"); + op.add(Builder::source, JsonpDeserializer.stringDeserializer(), "source"); + op.add(Builder::timeInQueue, JsonpDeserializer.stringDeserializer(), "timeInQueue"); + } - op.add(Builder::insertorder, JsonpDeserializer.stringDeserializer(), "insertOrder", "o"); - op.add(Builder::timeinqueue, JsonpDeserializer.stringDeserializer(), "timeInQueue", "t"); - op.add(Builder::priority, JsonpDeserializer.stringDeserializer(), "priority", "p"); - op.add(Builder::source, JsonpDeserializer.stringDeserializer(), "source", "s"); - + @Override + public int hashCode() { + int result = 17; + result = 31 * result + Objects.hashCode(this.insertOrder); + result = 31 * result + Objects.hashCode(this.priority); + result = 31 * result + Objects.hashCode(this.source); + result = 31 * result + Objects.hashCode(this.timeInQueue); + return result; } + @Override + public boolean equals(Object o) { + if (this == o) return true; + if (o == null || this.getClass() != o.getClass()) return false; + PendingTasksRecord other = (PendingTasksRecord) o; + return Objects.equals(this.insertOrder, other.insertOrder) + && Objects.equals(this.priority, other.priority) + && Objects.equals(this.source, other.source) + && Objects.equals(this.timeInQueue, other.timeInQueue); + } } diff --git a/java-client/src/main/java/org/opensearch/client/opensearch/cat/plugins/PluginsRecord.java b/java-client/src/generated/java/org/opensearch/client/opensearch/cat/plugins/PluginsRecord.java similarity index 69% rename from java-client/src/main/java/org/opensearch/client/opensearch/cat/plugins/PluginsRecord.java rename to java-client/src/generated/java/org/opensearch/client/opensearch/cat/plugins/PluginsRecord.java index 4d6db17ce2..d040fa0b10 100644 --- a/java-client/src/main/java/org/opensearch/client/opensearch/cat/plugins/PluginsRecord.java +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/cat/plugins/PluginsRecord.java @@ -30,10 +30,17 @@ * GitHub history for details. */ +//---------------------------------------------------- +// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. +//---------------------------------------------------- + package org.opensearch.client.opensearch.cat.plugins; import jakarta.json.stream.JsonGenerator; +import java.util.Objects; import java.util.function.Function; +import javax.annotation.Generated; +import javax.annotation.Nonnull; import javax.annotation.Nullable; import org.opensearch.client.json.JsonpDeserializable; import org.opensearch.client.json.JsonpDeserializer; @@ -41,111 +48,111 @@ import org.opensearch.client.json.ObjectBuilderDeserializer; import org.opensearch.client.json.ObjectDeserializer; import org.opensearch.client.json.PlainJsonSerializable; +import org.opensearch.client.util.CopyableBuilder; import org.opensearch.client.util.ObjectBuilder; import org.opensearch.client.util.ObjectBuilderBase; +import org.opensearch.client.util.ToCopyableBuilder; // typedef: cat.plugins.PluginsRecord @JsonpDeserializable -public class PluginsRecord implements PlainJsonSerializable { - @Nullable - private final String id; +@Generated("org.opensearch.client.codegen.CodeGenerator") +public class PluginsRecord implements PlainJsonSerializable, ToCopyableBuilder { @Nullable - private final String name; + private final String component; @Nullable - private final String component; + private final String description; @Nullable - private final String version; + private final String id; @Nullable - private final String description; + private final String name; @Nullable private final String type; + @Nullable + private final String version; + // --------------------------------------------------------------------------------------------- private PluginsRecord(Builder builder) { - - this.id = builder.id; - this.name = builder.name; this.component = builder.component; - this.version = builder.version; this.description = builder.description; + this.id = builder.id; + this.name = builder.name; this.type = builder.type; - + this.version = builder.version; } - public static PluginsRecord of(Function> fn) { + public static PluginsRecord of(Function> fn) { return fn.apply(new Builder()).build(); } /** - * unique node id + * The component name. *

- * API name: {@code id} + * API name: {@code component} + *

*/ @Nullable - public final String id() { - return this.id; + public final String component() { + return this.component; } /** - * node name + * The plugin details. *

- * API name: {@code name} + * API name: {@code description} + *

*/ @Nullable - public final String name() { - return this.name; + public final String description() { + return this.description; } /** - * component - *

- * API name: {@code component} + * API name: {@code id} */ @Nullable - public final String component() { - return this.component; + public final String id() { + return this.id; } /** - * component version - *

- * API name: {@code version} + * API name: {@code name} */ @Nullable - public final String version() { - return this.version; + public final String name() { + return this.name; } /** - * plugin details + * The plugin type. *

- * API name: {@code description} + * API name: {@code type} + *

*/ @Nullable - public final String description() { - return this.description; + public final String type() { + return this.type; } /** - * plugin type - *

- * API name: {@code type} + * API name: {@code version} */ @Nullable - public final String type() { - return this.type; + public final String version() { + return this.version; } /** * Serialize this object to JSON. */ + @Override public void serialize(JsonGenerator generator, JsonpMapper mapper) { generator.writeStartObject(); serializeInternal(generator, mapper); @@ -153,131 +160,163 @@ public void serialize(JsonGenerator generator, JsonpMapper mapper) { } protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { + if (this.component != null) { + generator.writeKey("component"); + generator.write(this.component); + } + + if (this.description != null) { + generator.writeKey("description"); + generator.write(this.description); + } if (this.id != null) { generator.writeKey("id"); generator.write(this.id); - } + if (this.name != null) { generator.writeKey("name"); generator.write(this.name); - } - if (this.component != null) { - generator.writeKey("component"); - generator.write(this.component); + if (this.type != null) { + generator.writeKey("type"); + generator.write(this.type); } + if (this.version != null) { generator.writeKey("version"); generator.write(this.version); - - } - if (this.description != null) { - generator.writeKey("description"); - generator.write(this.description); - } - if (this.type != null) { - generator.writeKey("type"); - generator.write(this.type); + } - } + // --------------------------------------------------------------------------------------------- + @Override + @Nonnull + public Builder toBuilder() { + return new Builder(this); } - // --------------------------------------------------------------------------------------------- + @Nonnull + public static Builder builder() { + return new Builder(); + } /** * Builder for {@link PluginsRecord}. */ - - public static class Builder extends ObjectBuilderBase implements ObjectBuilder { + public static class Builder extends ObjectBuilderBase implements CopyableBuilder { + @Nullable + private String component; + @Nullable + private String description; @Nullable private String id; - @Nullable private String name; - @Nullable - private String component; - + private String type; @Nullable private String version; - @Nullable - private String description; + public Builder() {} - @Nullable - private String type; + private Builder(PluginsRecord o) { + this.component = o.component; + this.description = o.description; + this.id = o.id; + this.name = o.name; + this.type = o.type; + this.version = o.version; + } - /** - * unique node id - *

- * API name: {@code id} - */ - public final Builder id(@Nullable String value) { - this.id = value; - return this; + private Builder(Builder o) { + this.component = o.component; + this.description = o.description; + this.id = o.id; + this.name = o.name; + this.type = o.type; + this.version = o.version; } - /** - * node name - *

- * API name: {@code name} - */ - public final Builder name(@Nullable String value) { - this.name = value; - return this; + @Override + @Nonnull + public Builder copy() { + return new Builder(this); } /** - * component + * The component name. *

* API name: {@code component} + *

*/ + @Nonnull public final Builder component(@Nullable String value) { this.component = value; return this; } /** - * component version + * The plugin details. *

- * API name: {@code version} + * API name: {@code description} + *

*/ - public final Builder version(@Nullable String value) { - this.version = value; + @Nonnull + public final Builder description(@Nullable String value) { + this.description = value; return this; } /** - * plugin details - *

- * API name: {@code description} + * API name: {@code id} */ - public final Builder description(@Nullable String value) { - this.description = value; + @Nonnull + public final Builder id(@Nullable String value) { + this.id = value; return this; } /** - * plugin type + * API name: {@code name} + */ + @Nonnull + public final Builder name(@Nullable String value) { + this.name = value; + return this; + } + + /** + * The plugin type. *

* API name: {@code type} + *

*/ + @Nonnull public final Builder type(@Nullable String value) { this.type = value; return this; } + /** + * API name: {@code version} + */ + @Nonnull + public final Builder version(@Nullable String value) { + this.version = value; + return this; + } + /** * Builds a {@link PluginsRecord}. * - * @throws NullPointerException - * if some of the required fields are null. + * @throws NullPointerException if some of the required fields are null. */ + @Override + @Nonnull public PluginsRecord build() { _checkSingleUse(); @@ -296,14 +335,36 @@ public PluginsRecord build() { ); protected static void setupPluginsRecordDeserializer(ObjectDeserializer op) { - + op.add(Builder::component, JsonpDeserializer.stringDeserializer(), "component"); + op.add(Builder::description, JsonpDeserializer.stringDeserializer(), "description"); op.add(Builder::id, JsonpDeserializer.stringDeserializer(), "id"); - op.add(Builder::name, JsonpDeserializer.stringDeserializer(), "name", "n"); - op.add(Builder::component, JsonpDeserializer.stringDeserializer(), "component", "c"); - op.add(Builder::version, JsonpDeserializer.stringDeserializer(), "version", "v"); - op.add(Builder::description, JsonpDeserializer.stringDeserializer(), "description", "d"); - op.add(Builder::type, JsonpDeserializer.stringDeserializer(), "type", "t"); + op.add(Builder::name, JsonpDeserializer.stringDeserializer(), "name"); + op.add(Builder::type, JsonpDeserializer.stringDeserializer(), "type"); + op.add(Builder::version, JsonpDeserializer.stringDeserializer(), "version"); + } + @Override + public int hashCode() { + int result = 17; + result = 31 * result + Objects.hashCode(this.component); + result = 31 * result + Objects.hashCode(this.description); + result = 31 * result + Objects.hashCode(this.id); + result = 31 * result + Objects.hashCode(this.name); + result = 31 * result + Objects.hashCode(this.type); + 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; + PluginsRecord other = (PluginsRecord) o; + return Objects.equals(this.component, other.component) + && Objects.equals(this.description, other.description) + && Objects.equals(this.id, other.id) + && Objects.equals(this.name, other.name) + && Objects.equals(this.type, other.type) + && Objects.equals(this.version, other.version); + } } diff --git a/java-client/src/main/java/org/opensearch/client/opensearch/cat/segments/SegmentsRecord.java b/java-client/src/generated/java/org/opensearch/client/opensearch/cat/segments/SegmentsRecord.java similarity index 59% rename from java-client/src/main/java/org/opensearch/client/opensearch/cat/segments/SegmentsRecord.java rename to java-client/src/generated/java/org/opensearch/client/opensearch/cat/segments/SegmentsRecord.java index abed6827f3..a3311d9683 100644 --- a/java-client/src/main/java/org/opensearch/client/opensearch/cat/segments/SegmentsRecord.java +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/cat/segments/SegmentsRecord.java @@ -30,10 +30,17 @@ * GitHub history for details. */ +//---------------------------------------------------- +// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. +//---------------------------------------------------- + package org.opensearch.client.opensearch.cat.segments; import jakarta.json.stream.JsonGenerator; +import java.util.Objects; import java.util.function.Function; +import javax.annotation.Generated; +import javax.annotation.Nonnull; import javax.annotation.Nullable; import org.opensearch.client.json.JsonpDeserializable; import org.opensearch.client.json.JsonpDeserializer; @@ -41,127 +48,149 @@ import org.opensearch.client.json.ObjectBuilderDeserializer; import org.opensearch.client.json.ObjectDeserializer; import org.opensearch.client.json.PlainJsonSerializable; +import org.opensearch.client.util.CopyableBuilder; import org.opensearch.client.util.ObjectBuilder; import org.opensearch.client.util.ObjectBuilderBase; +import org.opensearch.client.util.ToCopyableBuilder; // typedef: cat.segments.SegmentsRecord @JsonpDeserializable -public class SegmentsRecord implements PlainJsonSerializable { +@Generated("org.opensearch.client.codegen.CodeGenerator") +public class SegmentsRecord implements PlainJsonSerializable, ToCopyableBuilder { + @Nullable - private final String index; + private final String committed; @Nullable - private final String shard; + private final String compound; @Nullable - private final String prirep; + private final String docsCount; @Nullable - private final String ip; + private final String docsDeleted; @Nullable - private final String id; + private final String generation; @Nullable - private final String segment; + private final String id; @Nullable - private final String generation; + private final String index; @Nullable - private final String docsCount; + private final String ip; @Nullable - private final String docsDeleted; + private final String prirep; @Nullable - private final String size; + private final String searchable; @Nullable - private final String sizeMemory; + private final String segment; @Nullable - private final String committed; + private final String shard; @Nullable - private final String searchable; + private final String size; @Nullable - private final String version; + private final String sizeMemory; @Nullable - private final String compound; + private final String version; // --------------------------------------------------------------------------------------------- private SegmentsRecord(Builder builder) { - + this.committed = builder.committed; + this.compound = builder.compound; + this.docsCount = builder.docsCount; + this.docsDeleted = builder.docsDeleted; + this.generation = builder.generation; + this.id = builder.id; this.index = builder.index; - this.shard = builder.shard; - this.prirep = builder.prirep; this.ip = builder.ip; - this.id = builder.id; + this.prirep = builder.prirep; + this.searchable = builder.searchable; this.segment = builder.segment; - this.generation = builder.generation; - this.docsCount = builder.docsCount; - this.docsDeleted = builder.docsDeleted; + this.shard = builder.shard; this.size = builder.size; this.sizeMemory = builder.sizeMemory; - this.committed = builder.committed; - this.searchable = builder.searchable; this.version = builder.version; - this.compound = builder.compound; - } - public static SegmentsRecord of(Function> fn) { + public static SegmentsRecord of(Function> fn) { return fn.apply(new Builder()).build(); } /** - * index name + * If true, the segment is synced to disk. Segments that are synced can survive a hard reboot. If false, the + * data from uncommitted segments is also stored in the transaction log so that OpenSearch is able to replay changes on the next start. *

- * API name: {@code index} + * API name: {@code committed} + *

*/ @Nullable - public final String index() { - return this.index; + public final String committed() { + return this.committed; } /** - * shard name + * If true, the segment is stored in a compound file. This means Lucene merged all files from the segment in a single file + * to save file descriptors. *

- * API name: {@code shard} + * API name: {@code compound} + *

*/ @Nullable - public final String shard() { - return this.shard; + public final String compound() { + return this.compound; } /** - * primary or replica + * The number of documents in the segment. This excludes deleted documents and counts any nested documents separately from their + * parents. It also excludes documents which were indexed recently and do not yet belong to a segment. *

- * API name: {@code prirep} + * API name: {@code docs.count} + *

*/ @Nullable - public final String prirep() { - return this.prirep; + public final String docsCount() { + return this.docsCount; } /** - * ip of node where it lives + * The number of deleted documents in the segment, which might be higher or lower than the number of delete operations you have + * performed. This number excludes deletes that were performed recently and do not yet belong to a segment. Deleted documents are + * cleaned up by the automatic merge process if it makes sense to do so. Also, OpenSearch creates extra deleted documents to internally + * track the recent history of operations on a shard. *

- * API name: {@code ip} + * API name: {@code docs.deleted} + *

*/ @Nullable - public final String ip() { - return this.ip; + public final String docsDeleted() { + return this.docsDeleted; } /** - * unique id of node where it lives + * The segment generation number. OpenSearch increments this generation number for each segment written then uses this number to derive + * the segment name. *

+ * API name: {@code generation} + *

+ */ + @Nullable + public final String generation() { + return this.generation; + } + + /** * API name: {@code id} */ @Nullable @@ -170,88 +199,87 @@ public final String id() { } /** - * segment name - *

- * API name: {@code segment} + * API name: {@code index} */ @Nullable - public final String segment() { - return this.segment; + public final String index() { + return this.index; } /** - * segment generation + * The IP address of the node where it lives. *

- * API name: {@code generation} + * API name: {@code ip} + *

*/ @Nullable - public final String generation() { - return this.generation; + public final String ip() { + return this.ip; } /** - * number of docs in segment + * The shard type: primary or replica. *

- * API name: {@code docs.count} + * API name: {@code prirep} + *

*/ @Nullable - public final String docsCount() { - return this.docsCount; + public final String prirep() { + return this.prirep; } /** - * number of deleted docs in segment + * If true, the segment is searchable. If false, the segment has most likely been written to disk but needs a + * refresh to be searchable. *

- * API name: {@code docs.deleted} + * API name: {@code searchable} + *

*/ @Nullable - public final String docsDeleted() { - return this.docsDeleted; + public final String searchable() { + return this.searchable; } /** - * segment size in bytes + * The segment name, which is derived from the segment generation and used internally to create file names in the directory of the + * shard. *

- * API name: {@code size} + * API name: {@code segment} + *

*/ @Nullable - public final String size() { - return this.size; + public final String segment() { + return this.segment; } /** - * segment memory in bytes + * The shard name. *

- * API name: {@code size.memory} + * API name: {@code shard} + *

*/ @Nullable - public final String sizeMemory() { - return this.sizeMemory; + public final String shard() { + return this.shard; } /** - * is segment committed - *

- * API name: {@code committed} + * API name: {@code size} */ @Nullable - public final String committed() { - return this.committed; + public final String size() { + return this.size; } /** - * is segment searched - *

- * API name: {@code searchable} + * API name: {@code size.memory} */ @Nullable - public final String searchable() { - return this.searchable; + public final String sizeMemory() { + return this.sizeMemory; } /** - * version - *

* API name: {@code version} */ @Nullable @@ -259,19 +287,10 @@ public final String version() { return this.version; } - /** - * is segment compound - *

- * API name: {@code compound} - */ - @Nullable - public final String compound() { - return this.compound; - } - /** * Serialize this object to JSON. */ + @Override public void serialize(JsonGenerator generator, JsonpMapper mapper) { generator.writeStartObject(); serializeInternal(generator, mapper); @@ -279,293 +298,356 @@ public void serialize(JsonGenerator generator, JsonpMapper mapper) { } protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { + if (this.committed != null) { + generator.writeKey("committed"); + generator.write(this.committed); + } - if (this.index != null) { - generator.writeKey("index"); - generator.write(this.index); - + if (this.compound != null) { + generator.writeKey("compound"); + generator.write(this.compound); } - if (this.shard != null) { - generator.writeKey("shard"); - generator.write(this.shard); + if (this.docsCount != null) { + generator.writeKey("docs.count"); + generator.write(this.docsCount); } - if (this.prirep != null) { - generator.writeKey("prirep"); - generator.write(this.prirep); + if (this.docsDeleted != null) { + generator.writeKey("docs.deleted"); + generator.write(this.docsDeleted); } - if (this.ip != null) { - generator.writeKey("ip"); - generator.write(this.ip); + if (this.generation != null) { + generator.writeKey("generation"); + generator.write(this.generation); } + if (this.id != null) { generator.writeKey("id"); generator.write(this.id); + } + if (this.index != null) { + generator.writeKey("index"); + generator.write(this.index); } - if (this.segment != null) { - generator.writeKey("segment"); - generator.write(this.segment); + if (this.ip != null) { + generator.writeKey("ip"); + generator.write(this.ip); } - if (this.generation != null) { - generator.writeKey("generation"); - generator.write(this.generation); + if (this.prirep != null) { + generator.writeKey("prirep"); + generator.write(this.prirep); } - if (this.docsCount != null) { - generator.writeKey("docs.count"); - generator.write(this.docsCount); + if (this.searchable != null) { + generator.writeKey("searchable"); + generator.write(this.searchable); + } + + if (this.segment != null) { + generator.writeKey("segment"); + generator.write(this.segment); } - if (this.docsDeleted != null) { - generator.writeKey("docs.deleted"); - generator.write(this.docsDeleted); + if (this.shard != null) { + generator.writeKey("shard"); + generator.write(this.shard); } + if (this.size != null) { generator.writeKey("size"); generator.write(this.size); - } + if (this.sizeMemory != null) { generator.writeKey("size.memory"); generator.write(this.sizeMemory); - - } - if (this.committed != null) { - generator.writeKey("committed"); - generator.write(this.committed); - } - if (this.searchable != null) { - generator.writeKey("searchable"); - generator.write(this.searchable); - } if (this.version != null) { generator.writeKey("version"); generator.write(this.version); - } - if (this.compound != null) { - generator.writeKey("compound"); - generator.write(this.compound); + } - } + // --------------------------------------------------------------------------------------------- + @Override + @Nonnull + public Builder toBuilder() { + return new Builder(this); } - // --------------------------------------------------------------------------------------------- + @Nonnull + public static Builder builder() { + return new Builder(); + } /** * Builder for {@link SegmentsRecord}. */ - - public static class Builder extends ObjectBuilderBase implements ObjectBuilder { + public static class Builder extends ObjectBuilderBase implements CopyableBuilder { @Nullable - private String index; - + private String committed; @Nullable - private String shard; - + private String compound; @Nullable - private String prirep; - + private String docsCount; @Nullable - private String ip; - + private String docsDeleted; + @Nullable + private String generation; @Nullable private String id; - @Nullable - private String segment; - + private String index; @Nullable - private String generation; - + private String ip; @Nullable - private String docsCount; - + private String prirep; @Nullable - private String docsDeleted; - + private String searchable; + @Nullable + private String segment; + @Nullable + private String shard; @Nullable private String size; - @Nullable private String sizeMemory; - @Nullable - private String committed; + private String version; - @Nullable - private String searchable; + public Builder() {} + + private Builder(SegmentsRecord o) { + this.committed = o.committed; + this.compound = o.compound; + this.docsCount = o.docsCount; + this.docsDeleted = o.docsDeleted; + this.generation = o.generation; + this.id = o.id; + this.index = o.index; + this.ip = o.ip; + this.prirep = o.prirep; + this.searchable = o.searchable; + this.segment = o.segment; + this.shard = o.shard; + this.size = o.size; + this.sizeMemory = o.sizeMemory; + this.version = o.version; + } - @Nullable - private String version; + private Builder(Builder o) { + this.committed = o.committed; + this.compound = o.compound; + this.docsCount = o.docsCount; + this.docsDeleted = o.docsDeleted; + this.generation = o.generation; + this.id = o.id; + this.index = o.index; + this.ip = o.ip; + this.prirep = o.prirep; + this.searchable = o.searchable; + this.segment = o.segment; + this.shard = o.shard; + this.size = o.size; + this.sizeMemory = o.sizeMemory; + this.version = o.version; + } - @Nullable - private String compound; + @Override + @Nonnull + public Builder copy() { + return new Builder(this); + } /** - * index name + * If true, the segment is synced to disk. Segments that are synced can survive a hard reboot. If false, + * the data from uncommitted segments is also stored in the transaction log so that OpenSearch is able to replay changes on the next + * start. *

- * API name: {@code index} + * API name: {@code committed} + *

*/ - public final Builder index(@Nullable String value) { - this.index = value; + @Nonnull + public final Builder committed(@Nullable String value) { + this.committed = value; return this; } /** - * shard name + * If true, the segment is stored in a compound file. This means Lucene merged all files from the segment in a single + * file to save file descriptors. *

- * API name: {@code shard} + * API name: {@code compound} + *

*/ - public final Builder shard(@Nullable String value) { - this.shard = value; + @Nonnull + public final Builder compound(@Nullable String value) { + this.compound = value; return this; } /** - * primary or replica + * The number of documents in the segment. This excludes deleted documents and counts any nested documents separately from their + * parents. It also excludes documents which were indexed recently and do not yet belong to a segment. *

- * API name: {@code prirep} + * API name: {@code docs.count} + *

*/ - public final Builder prirep(@Nullable String value) { - this.prirep = value; + @Nonnull + public final Builder docsCount(@Nullable String value) { + this.docsCount = value; return this; } /** - * ip of node where it lives + * The number of deleted documents in the segment, which might be higher or lower than the number of delete operations you have + * performed. This number excludes deletes that were performed recently and do not yet belong to a segment. Deleted documents are + * cleaned up by the automatic merge process if it makes sense to do so. Also, OpenSearch creates extra deleted documents to + * internally track the recent history of operations on a shard. *

- * API name: {@code ip} + * API name: {@code docs.deleted} + *

*/ - public final Builder ip(@Nullable String value) { - this.ip = value; + @Nonnull + public final Builder docsDeleted(@Nullable String value) { + this.docsDeleted = value; return this; } /** - * unique id of node where it lives + * The segment generation number. OpenSearch increments this generation number for each segment written then uses this number to + * derive the segment name. *

+ * API name: {@code generation} + *

+ */ + @Nonnull + public final Builder generation(@Nullable String value) { + this.generation = value; + return this; + } + + /** * API name: {@code id} */ + @Nonnull public final Builder id(@Nullable String value) { this.id = value; return this; } /** - * segment name - *

- * API name: {@code segment} + * API name: {@code index} */ - public final Builder segment(@Nullable String value) { - this.segment = value; + @Nonnull + public final Builder index(@Nullable String value) { + this.index = value; return this; } /** - * segment generation + * The IP address of the node where it lives. *

- * API name: {@code generation} + * API name: {@code ip} + *

*/ - public final Builder generation(@Nullable String value) { - this.generation = value; + @Nonnull + public final Builder ip(@Nullable String value) { + this.ip = value; return this; } /** - * number of docs in segment + * The shard type: primary or replica. *

- * API name: {@code docs.count} + * API name: {@code prirep} + *

*/ - public final Builder docsCount(@Nullable String value) { - this.docsCount = value; + @Nonnull + public final Builder prirep(@Nullable String value) { + this.prirep = value; return this; } /** - * number of deleted docs in segment + * If true, the segment is searchable. If false, the segment has most likely been written to disk but + * needs a refresh to be searchable. *

- * API name: {@code docs.deleted} + * API name: {@code searchable} + *

*/ - public final Builder docsDeleted(@Nullable String value) { - this.docsDeleted = value; + @Nonnull + public final Builder searchable(@Nullable String value) { + this.searchable = value; return this; } /** - * segment size in bytes + * The segment name, which is derived from the segment generation and used internally to create file names in the directory of the + * shard. *

- * API name: {@code size} + * API name: {@code segment} + *

*/ - public final Builder size(@Nullable String value) { - this.size = value; + @Nonnull + public final Builder segment(@Nullable String value) { + this.segment = value; return this; } /** - * segment memory in bytes + * The shard name. *

- * API name: {@code size.memory} + * API name: {@code shard} + *

*/ - public final Builder sizeMemory(@Nullable String value) { - this.sizeMemory = value; + @Nonnull + public final Builder shard(@Nullable String value) { + this.shard = value; return this; } /** - * is segment committed - *

- * API name: {@code committed} + * API name: {@code size} */ - public final Builder committed(@Nullable String value) { - this.committed = value; + @Nonnull + public final Builder size(@Nullable String value) { + this.size = value; return this; } /** - * is segment searched - *

- * API name: {@code searchable} + * API name: {@code size.memory} */ - public final Builder searchable(@Nullable String value) { - this.searchable = value; + @Nonnull + public final Builder sizeMemory(@Nullable String value) { + this.sizeMemory = value; return this; } /** - * version - *

* API name: {@code version} */ + @Nonnull public final Builder version(@Nullable String value) { this.version = value; return this; } - /** - * is segment compound - *

- * API name: {@code compound} - */ - public final Builder compound(@Nullable String value) { - this.compound = value; - return this; - } - /** * Builds a {@link SegmentsRecord}. * - * @throws NullPointerException - * if some of the required fields are null. + * @throws NullPointerException if some of the required fields are null. */ + @Override + @Nonnull public SegmentsRecord build() { _checkSingleUse(); @@ -584,23 +666,63 @@ public SegmentsRecord build() { ); protected static void setupSegmentsRecordDeserializer(ObjectDeserializer op) { - - op.add(Builder::index, JsonpDeserializer.stringDeserializer(), "index", "i", "idx"); - op.add(Builder::shard, JsonpDeserializer.stringDeserializer(), "shard", "s", "sh"); - op.add(Builder::prirep, JsonpDeserializer.stringDeserializer(), "prirep", "p", "pr", "primaryOrReplica"); - op.add(Builder::ip, JsonpDeserializer.stringDeserializer(), "ip"); + op.add(Builder::committed, JsonpDeserializer.stringDeserializer(), "committed"); + op.add(Builder::compound, JsonpDeserializer.stringDeserializer(), "compound"); + op.add(Builder::docsCount, JsonpDeserializer.stringDeserializer(), "docs.count"); + op.add(Builder::docsDeleted, JsonpDeserializer.stringDeserializer(), "docs.deleted"); + op.add(Builder::generation, JsonpDeserializer.stringDeserializer(), "generation"); op.add(Builder::id, JsonpDeserializer.stringDeserializer(), "id"); - op.add(Builder::segment, JsonpDeserializer.stringDeserializer(), "segment", "seg"); - op.add(Builder::generation, JsonpDeserializer.stringDeserializer(), "generation", "g", "gen"); - op.add(Builder::docsCount, JsonpDeserializer.stringDeserializer(), "docs.count", "dc", "docsCount"); - op.add(Builder::docsDeleted, JsonpDeserializer.stringDeserializer(), "docs.deleted", "dd", "docsDeleted"); - op.add(Builder::size, JsonpDeserializer.stringDeserializer(), "size", "si"); - op.add(Builder::sizeMemory, JsonpDeserializer.stringDeserializer(), "size.memory", "sm", "sizeMemory"); - op.add(Builder::committed, JsonpDeserializer.stringDeserializer(), "committed", "ic", "isCommitted"); - op.add(Builder::searchable, JsonpDeserializer.stringDeserializer(), "searchable", "is", "isSearchable"); - op.add(Builder::version, JsonpDeserializer.stringDeserializer(), "version", "v"); - op.add(Builder::compound, JsonpDeserializer.stringDeserializer(), "compound", "ico", "isCompound"); + op.add(Builder::index, JsonpDeserializer.stringDeserializer(), "index"); + op.add(Builder::ip, JsonpDeserializer.stringDeserializer(), "ip"); + op.add(Builder::prirep, JsonpDeserializer.stringDeserializer(), "prirep"); + op.add(Builder::searchable, JsonpDeserializer.stringDeserializer(), "searchable"); + op.add(Builder::segment, JsonpDeserializer.stringDeserializer(), "segment"); + op.add(Builder::shard, JsonpDeserializer.stringDeserializer(), "shard"); + op.add(Builder::size, JsonpDeserializer.stringDeserializer(), "size"); + op.add(Builder::sizeMemory, JsonpDeserializer.stringDeserializer(), "size.memory"); + op.add(Builder::version, JsonpDeserializer.stringDeserializer(), "version"); + } + @Override + public int hashCode() { + int result = 17; + result = 31 * result + Objects.hashCode(this.committed); + result = 31 * result + Objects.hashCode(this.compound); + result = 31 * result + Objects.hashCode(this.docsCount); + result = 31 * result + Objects.hashCode(this.docsDeleted); + result = 31 * result + Objects.hashCode(this.generation); + result = 31 * result + Objects.hashCode(this.id); + result = 31 * result + Objects.hashCode(this.index); + result = 31 * result + Objects.hashCode(this.ip); + result = 31 * result + Objects.hashCode(this.prirep); + result = 31 * result + Objects.hashCode(this.searchable); + result = 31 * result + Objects.hashCode(this.segment); + result = 31 * result + Objects.hashCode(this.shard); + result = 31 * result + Objects.hashCode(this.size); + result = 31 * result + Objects.hashCode(this.sizeMemory); + 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; + SegmentsRecord other = (SegmentsRecord) o; + return Objects.equals(this.committed, other.committed) + && Objects.equals(this.compound, other.compound) + && Objects.equals(this.docsCount, other.docsCount) + && Objects.equals(this.docsDeleted, other.docsDeleted) + && Objects.equals(this.generation, other.generation) + && Objects.equals(this.id, other.id) + && Objects.equals(this.index, other.index) + && Objects.equals(this.ip, other.ip) + && Objects.equals(this.prirep, other.prirep) + && Objects.equals(this.searchable, other.searchable) + && Objects.equals(this.segment, other.segment) + && Objects.equals(this.shard, other.shard) + && Objects.equals(this.size, other.size) + && Objects.equals(this.sizeMemory, other.sizeMemory) + && Objects.equals(this.version, other.version); + } } diff --git a/java-client/src/main/java/org/opensearch/client/opensearch/cat/OpenSearchCatAsyncClient.java b/java-client/src/main/java/org/opensearch/client/opensearch/cat/OpenSearchCatAsyncClient.java index 9c4830f0ca..2ef05358f1 100644 --- a/java-client/src/main/java/org/opensearch/client/opensearch/cat/OpenSearchCatAsyncClient.java +++ b/java-client/src/main/java/org/opensearch/client/opensearch/cat/OpenSearchCatAsyncClient.java @@ -72,44 +72,6 @@ public CompletableFuture help() throws IOException, OpenSearchExce return this.transport.performRequestAsync(HelpRequest._INSTANCE, HelpRequest._ENDPOINT, this.transportOptions); } - // ----- Endpoint: cat.point_in_time_segments - - /** - * Provides low-level information about the disk utilization of a PIT by - * describing its Lucene segments. - * - * - */ - public CompletableFuture pitSegments() throws IOException, OpenSearchException { - return this.transport.performRequestAsync( - new PitSegmentsRequest.Builder().build(), - PitSegmentsRequest._ENDPOINT, - this.transportOptions - ); - } - - // ----- Endpoint: cat.pending_tasks - - /** - * Returns a concise representation of the cluster pending tasks. - * - * - */ - public CompletableFuture pendingTasks() throws IOException, OpenSearchException { - return this.transport.performRequestAsync(PendingTasksRequest._INSTANCE, PendingTasksRequest._ENDPOINT, this.transportOptions); - } - - // ----- Endpoint: cat.plugins - - /** - * Returns information about installed plugins across nodes node. - * - * - */ - public CompletableFuture plugins() throws IOException, OpenSearchException { - return this.transport.performRequestAsync(PluginsRequest._INSTANCE, PluginsRequest._ENDPOINT, this.transportOptions); - } - // ----- Endpoint: cat.recovery /** diff --git a/java-client/src/main/java/org/opensearch/client/opensearch/cat/OpenSearchCatClient.java b/java-client/src/main/java/org/opensearch/client/opensearch/cat/OpenSearchCatClient.java index b62ef7b72f..477cc78073 100644 --- a/java-client/src/main/java/org/opensearch/client/opensearch/cat/OpenSearchCatClient.java +++ b/java-client/src/main/java/org/opensearch/client/opensearch/cat/OpenSearchCatClient.java @@ -71,69 +71,6 @@ public HelpResponse help() throws IOException, OpenSearchException { return this.transport.performRequest(HelpRequest._INSTANCE, HelpRequest._ENDPOINT, this.transportOptions); } - // ----- Endpoint: cat.point_in_time_segments - - /** - * Provides low-level information about the disk utilization of a PIT by - * describing its Lucene segments. - * - * - */ - public SegmentsResponse pitSegments(PitSegmentsRequest request) throws IOException, OpenSearchException { - @SuppressWarnings("unchecked") - JsonEndpoint endpoint = (JsonEndpoint< - PitSegmentsRequest, - SegmentsResponse, - ErrorResponse>) PitSegmentsRequest._ENDPOINT; - - return this.transport.performRequest(request, endpoint, this.transportOptions); - } - - /** - * Provides low-level information about the disk utilization of a PIT by - * describing its Lucene segments. - * - * * @param fn - * a function that initializes a builder to create the - * {@link PitSegmentsRequest} - */ - - public final SegmentsResponse pitSegments(Function> fn) - throws IOException, OpenSearchException { - return pitSegments(fn.apply(new PitSegmentsRequest.Builder()).build()); - } - - /** - * Provides low-level information about the disk utilization of a PIT by - * describing its Lucene segments. - * - */ - public SegmentsResponse pitSegments() throws IOException, OpenSearchException { - return this.transport.performRequest(new PitSegmentsRequest.Builder().build(), PitSegmentsRequest._ENDPOINT, this.transportOptions); - } - - // ----- Endpoint: cat.pending_tasks - - /** - * Returns a concise representation of the cluster pending tasks. - * - * - */ - public PendingTasksResponse pendingTasks() throws IOException, OpenSearchException { - return this.transport.performRequest(PendingTasksRequest._INSTANCE, PendingTasksRequest._ENDPOINT, this.transportOptions); - } - - // ----- Endpoint: cat.plugins - - /** - * Returns information about installed plugins across nodes node. - * - * - */ - public PluginsResponse plugins() throws IOException, OpenSearchException { - return this.transport.performRequest(PluginsRequest._INSTANCE, PluginsRequest._ENDPOINT, this.transportOptions); - } - // ----- Endpoint: cat.recovery /** diff --git a/java-client/src/main/java/org/opensearch/client/opensearch/cat/PendingTasksRequest.java b/java-client/src/main/java/org/opensearch/client/opensearch/cat/PendingTasksRequest.java deleted file mode 100644 index ce398e3df4..0000000000 --- a/java-client/src/main/java/org/opensearch/client/opensearch/cat/PendingTasksRequest.java +++ /dev/null @@ -1,80 +0,0 @@ -/* - * SPDX-License-Identifier: Apache-2.0 - * - * The OpenSearch Contributors require contributions made to - * this file be licensed under the Apache-2.0 license or a - * compatible open source license. - */ - -/* - * Licensed to Elasticsearch B.V. under one or more contributor - * license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright - * ownership. Elasticsearch B.V. licenses this file to you under - * the Apache License, Version 2.0 (the "License"); you may - * not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -/* - * Modifications Copyright OpenSearch Contributors. See - * GitHub history for details. - */ - -package org.opensearch.client.opensearch.cat; - -import java.util.HashMap; -import org.opensearch.client.opensearch._types.ErrorResponse; -import org.opensearch.client.transport.Endpoint; -import org.opensearch.client.transport.endpoints.SimpleEndpoint; - -// typedef: cat.pending_tasks.Request - -/** - * Returns a concise representation of the cluster pending tasks. - * - */ - -public class PendingTasksRequest extends CatRequestBase { - public PendingTasksRequest() {} - - /** - * Singleton instance for {@link PendingTasksRequest}. - */ - public static final PendingTasksRequest _INSTANCE = new PendingTasksRequest(); - - // --------------------------------------------------------------------------------------------- - - /** - * Endpoint "{@code cat.pending_tasks}". - */ - public static final Endpoint _ENDPOINT = new SimpleEndpoint<>( - - // Request method - request -> { - return "GET"; - - }, - - // Request path - request -> { - return "/_cat/pending_tasks"; - - }, - - // Request parameters - request -> new HashMap<>(request.queryParameters()), - SimpleEndpoint.emptyMap(), - false, - PendingTasksResponse._DESERIALIZER - ); -} diff --git a/java-client/src/main/java/org/opensearch/client/opensearch/cat/PitSegmentsRequest.java b/java-client/src/main/java/org/opensearch/client/opensearch/cat/PitSegmentsRequest.java deleted file mode 100644 index 79eca7b82f..0000000000 --- a/java-client/src/main/java/org/opensearch/client/opensearch/cat/PitSegmentsRequest.java +++ /dev/null @@ -1,107 +0,0 @@ -/* - * SPDX-License-Identifier: Apache-2.0 - * - * The OpenSearch Contributors require contributions made to - * this file be licensed under the Apache-2.0 license or a - * compatible open source license. - */ - -package org.opensearch.client.opensearch.cat; - -import java.util.List; -import java.util.function.Function; -import javax.annotation.Nullable; -import org.opensearch.client.opensearch._types.ErrorResponse; -import org.opensearch.client.transport.Endpoint; -import org.opensearch.client.transport.endpoints.SimpleEndpoint; -import org.opensearch.client.util.ObjectBuilder; - -/** - * Provides low-level information about the disk utilization of a PIT by - * describing its Lucene segments - * - */ -public class PitSegmentsRequest extends CatRequestBase { - - @Nullable - private List pitId; - - public PitSegmentsRequest(Builder builder) { - this.pitId = builder.pitId; - } - - public static PitSegmentsRequest of(Function> fn) { - return fn.apply(new Builder()).build(); - } - - /** - * A list of Pit IDs to get segments - *

- * API name - {@code pit_id} - */ - @Nullable - public final List pitId() { - return this.pitId; - } - - /** - * Builder for {@link PitSegmentsRequest} - */ - public static class Builder extends CatRequestBaseBuilder { - private List pitId; - - /** - * A list of Pit IDs to get segments - *

- * API name - {@code pit_id} - */ - public final Builder pitId(@Nullable List pitId) { - this.pitId = pitId; - return this; - } - - /** - * Builds a {@link PitSegmentsRequest}. - * - * @throws NullPointerException if some of the required fields are null. - */ - public PitSegmentsRequest build() { - _checkSingleUse(); - return new PitSegmentsRequest(this); - } - - @Override - protected Builder self() { - return this; - } - } - - /** - * Endpoint "{@code point_in_time_segments}" - */ - public static final Endpoint _ENDPOINT = new SimpleEndpoint<>( - // Request Method - request -> { return "GET"; }, - - // Request Path - request -> { - final int _all = 1 << 0; - - int propsSet = 0; - - if (request.pitId() == null) { - propsSet |= _all; - } - if (propsSet == 0) { - return "/_cat/pit_segments"; - } else { - return "/_cat/pit_segments/_all"; - } - }, - SimpleEndpoint.emptyMap(), - SimpleEndpoint.emptyMap(), - false, - SegmentsResponse._DESERIALIZER - ); - -} diff --git a/java-client/src/main/java/org/opensearch/client/opensearch/cat/PluginsRequest.java b/java-client/src/main/java/org/opensearch/client/opensearch/cat/PluginsRequest.java deleted file mode 100644 index 2f7c944968..0000000000 --- a/java-client/src/main/java/org/opensearch/client/opensearch/cat/PluginsRequest.java +++ /dev/null @@ -1,80 +0,0 @@ -/* - * SPDX-License-Identifier: Apache-2.0 - * - * The OpenSearch Contributors require contributions made to - * this file be licensed under the Apache-2.0 license or a - * compatible open source license. - */ - -/* - * Licensed to Elasticsearch B.V. under one or more contributor - * license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright - * ownership. Elasticsearch B.V. licenses this file to you under - * the Apache License, Version 2.0 (the "License"); you may - * not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -/* - * Modifications Copyright OpenSearch Contributors. See - * GitHub history for details. - */ - -package org.opensearch.client.opensearch.cat; - -import java.util.HashMap; -import org.opensearch.client.opensearch._types.ErrorResponse; -import org.opensearch.client.transport.Endpoint; -import org.opensearch.client.transport.endpoints.SimpleEndpoint; - -// typedef: cat.plugins.Request - -/** - * Returns information about installed plugins across nodes node. - * - */ - -public class PluginsRequest extends CatRequestBase { - public PluginsRequest() {} - - /** - * Singleton instance for {@link PluginsRequest}. - */ - public static final PluginsRequest _INSTANCE = new PluginsRequest(); - - // --------------------------------------------------------------------------------------------- - - /** - * Endpoint "{@code cat.plugins}". - */ - public static final Endpoint _ENDPOINT = new SimpleEndpoint<>( - - // Request method - request -> { - return "GET"; - - }, - - // Request path - request -> { - return "/_cat/plugins"; - - }, - - // Request parameters - request -> new HashMap<>(request.queryParameters()), - SimpleEndpoint.emptyMap(), - false, - PluginsResponse._DESERIALIZER - ); -} diff --git a/java-codegen/opensearch-openapi.yaml b/java-codegen/opensearch-openapi.yaml index f2b773e2a2..1bc0735454 100644 --- a/java-codegen/opensearch-openapi.yaml +++ b/java-codegen/opensearch-openapi.yaml @@ -28605,7 +28605,7 @@ components: schema: type: array items: - $ref: '#/components/schemas/cat._common___CatPitSegmentsRecord' + $ref: '#/components/schemas/cat.segments___SegmentsRecord' description: '' cat.allocation___200: content: @@ -28762,7 +28762,7 @@ components: schema: type: array items: - $ref: '#/components/schemas/cat._common___CatPitSegmentsRecord' + $ref: '#/components/schemas/cat.segments___SegmentsRecord' description: '' cat.plugins___200: content: @@ -46114,37 +46114,6 @@ components: type: object additionalProperties: $ref: '#/components/schemas/asynchronous_search._common___NodesStats' - cat._common___CatPitSegmentsRecord: - type: object - properties: - index: - type: string - shard: - type: string - prirep: - type: string - ip: - type: string - segment: - type: string - generation: - type: string - docs.count: - type: string - docs.deleted: - type: string - size: - type: string - size.memory: - type: string - committed: - type: string - searchable: - type: string - version: - type: string - compound: - type: string cat._common___CatSegmentReplicationRecord: type: object properties: diff --git a/java-codegen/src/main/java/org/opensearch/client/codegen/CodeGenerator.java b/java-codegen/src/main/java/org/opensearch/client/codegen/CodeGenerator.java index 092dfb2109..25304cda5e 100644 --- a/java-codegen/src/main/java/org/opensearch/client/codegen/CodeGenerator.java +++ b/java-codegen/src/main/java/org/opensearch/client/codegen/CodeGenerator.java @@ -53,6 +53,7 @@ public class CodeGenerator { name( isOneOf( "aliases", + "all_pit_segments", "allocation", "cluster_manager", "count", @@ -61,7 +62,10 @@ public class CodeGenerator { "indices", "master", "nodeattrs", - "nodes" + "nodes", + "pending_tasks", + "pit_segments", + "plugins" ) ) ), From c5508218162a9df3487651e11e918c30162d036c Mon Sep 17 00:00:00 2001 From: Thomas Farr Date: Tue, 7 Jan 2025 22:14:42 +1300 Subject: [PATCH 11/18] Generate cat.recovery, cat.repositories & cat.segments Signed-off-by: Thomas Farr --- .../cat/OpenSearchCatAsyncClientBase.java | 79 ++ .../cat/OpenSearchCatClientBase.java | 78 ++ .../opensearch/cat/RecoveryRequest.java | 226 +++- .../opensearch/cat/RecoveryResponse.java | 74 +- .../opensearch/cat/RepositoriesRequest.java | 264 +++++ .../opensearch/cat/RepositoriesResponse.java | 74 +- .../opensearch/cat/SegmentsRequest.java | 375 +++++++ .../opensearch/cat/SegmentsResponse.java | 74 +- .../cat/recovery/RecoveryRecord.java | 994 ++++++++++-------- .../cat/repositories/RepositoriesRecord.java | 94 +- .../cat/OpenSearchCatAsyncClient.java | 95 -- .../opensearch/cat/OpenSearchCatClient.java | 95 -- .../opensearch/cat/RepositoriesRequest.java | 80 -- .../opensearch/cat/SegmentsRequest.java | 210 ---- .../client/codegen/CodeGenerator.java | 5 +- 15 files changed, 1780 insertions(+), 1037 deletions(-) rename java-client/src/{main => generated}/java/org/opensearch/client/opensearch/cat/RecoveryRequest.java (50%) rename java-client/src/{main => generated}/java/org/opensearch/client/opensearch/cat/RecoveryResponse.java (75%) create mode 100644 java-client/src/generated/java/org/opensearch/client/opensearch/cat/RepositoriesRequest.java rename java-client/src/{main => generated}/java/org/opensearch/client/opensearch/cat/RepositoriesResponse.java (76%) create mode 100644 java-client/src/generated/java/org/opensearch/client/opensearch/cat/SegmentsRequest.java rename java-client/src/{main => generated}/java/org/opensearch/client/opensearch/cat/SegmentsResponse.java (75%) rename java-client/src/{main => generated}/java/org/opensearch/client/opensearch/cat/recovery/RecoveryRecord.java (65%) rename java-client/src/{main => generated}/java/org/opensearch/client/opensearch/cat/repositories/RepositoriesRecord.java (68%) delete mode 100644 java-client/src/main/java/org/opensearch/client/opensearch/cat/RepositoriesRequest.java delete mode 100644 java-client/src/main/java/org/opensearch/client/opensearch/cat/SegmentsRequest.java diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/cat/OpenSearchCatAsyncClientBase.java b/java-client/src/generated/java/org/opensearch/client/opensearch/cat/OpenSearchCatAsyncClientBase.java index 8fa8a0231c..8af7a12aec 100644 --- a/java-client/src/generated/java/org/opensearch/client/opensearch/cat/OpenSearchCatAsyncClientBase.java +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/cat/OpenSearchCatAsyncClientBase.java @@ -424,4 +424,83 @@ public final CompletableFuture plugins(Function plugins() throws IOException, OpenSearchException { return plugins(new PluginsRequest.Builder().build()); } + + // ----- Endpoint: cat.recovery + + /** + * Returns all completed and ongoing index and shard recoveries. + */ + public CompletableFuture recovery(RecoveryRequest request) throws IOException, OpenSearchException { + return this.transport.performRequestAsync(request, RecoveryRequest._ENDPOINT, this.transportOptions); + } + + /** + * Returns all completed and ongoing index and shard recoveries. + * + * @param fn a function that initializes a builder to create the {@link RecoveryRequest} + */ + public final CompletableFuture recovery(Function> fn) + throws IOException, OpenSearchException { + return recovery(fn.apply(new RecoveryRequest.Builder()).build()); + } + + /** + * Returns all completed and ongoing index and shard recoveries. + */ + public final CompletableFuture recovery() throws IOException, OpenSearchException { + return recovery(new RecoveryRequest.Builder().build()); + } + + // ----- Endpoint: cat.repositories + + /** + * Returns information about all snapshot repositories for a cluster. + */ + public CompletableFuture repositories(RepositoriesRequest request) throws IOException, OpenSearchException { + return this.transport.performRequestAsync(request, RepositoriesRequest._ENDPOINT, this.transportOptions); + } + + /** + * Returns information about all snapshot repositories for a cluster. + * + * @param fn a function that initializes a builder to create the {@link RepositoriesRequest} + */ + public final CompletableFuture repositories( + Function> fn + ) throws IOException, OpenSearchException { + return repositories(fn.apply(new RepositoriesRequest.Builder()).build()); + } + + /** + * Returns information about all snapshot repositories for a cluster. + */ + public final CompletableFuture repositories() throws IOException, OpenSearchException { + return repositories(new RepositoriesRequest.Builder().build()); + } + + // ----- Endpoint: cat.segments + + /** + * Provides low-level information about the segments in the shards of an index. + */ + public CompletableFuture segments(SegmentsRequest request) throws IOException, OpenSearchException { + return this.transport.performRequestAsync(request, SegmentsRequest._ENDPOINT, this.transportOptions); + } + + /** + * Provides low-level information about the segments in the shards of an index. + * + * @param fn a function that initializes a builder to create the {@link SegmentsRequest} + */ + public final CompletableFuture segments(Function> fn) + throws IOException, OpenSearchException { + return segments(fn.apply(new SegmentsRequest.Builder()).build()); + } + + /** + * Provides low-level information about the segments in the shards of an index. + */ + public final CompletableFuture segments() throws IOException, OpenSearchException { + return segments(new SegmentsRequest.Builder().build()); + } } diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/cat/OpenSearchCatClientBase.java b/java-client/src/generated/java/org/opensearch/client/opensearch/cat/OpenSearchCatClientBase.java index fcab2a436c..be8c9b1e05 100644 --- a/java-client/src/generated/java/org/opensearch/client/opensearch/cat/OpenSearchCatClientBase.java +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/cat/OpenSearchCatClientBase.java @@ -417,4 +417,82 @@ public final PluginsResponse plugins(Function> fn) throws IOException, + OpenSearchException { + return recovery(fn.apply(new RecoveryRequest.Builder()).build()); + } + + /** + * Returns all completed and ongoing index and shard recoveries. + */ + public final RecoveryResponse recovery() throws IOException, OpenSearchException { + return recovery(new RecoveryRequest.Builder().build()); + } + + // ----- Endpoint: cat.repositories + + /** + * Returns information about all snapshot repositories for a cluster. + */ + public RepositoriesResponse repositories(RepositoriesRequest request) throws IOException, OpenSearchException { + return this.transport.performRequest(request, RepositoriesRequest._ENDPOINT, this.transportOptions); + } + + /** + * Returns information about all snapshot repositories for a cluster. + * + * @param fn a function that initializes a builder to create the {@link RepositoriesRequest} + */ + public final RepositoriesResponse repositories(Function> fn) + throws IOException, OpenSearchException { + return repositories(fn.apply(new RepositoriesRequest.Builder()).build()); + } + + /** + * Returns information about all snapshot repositories for a cluster. + */ + public final RepositoriesResponse repositories() throws IOException, OpenSearchException { + return repositories(new RepositoriesRequest.Builder().build()); + } + + // ----- Endpoint: cat.segments + + /** + * Provides low-level information about the segments in the shards of an index. + */ + public SegmentsResponse segments(SegmentsRequest request) throws IOException, OpenSearchException { + return this.transport.performRequest(request, SegmentsRequest._ENDPOINT, this.transportOptions); + } + + /** + * Provides low-level information about the segments in the shards of an index. + * + * @param fn a function that initializes a builder to create the {@link SegmentsRequest} + */ + public final SegmentsResponse segments(Function> fn) throws IOException, + OpenSearchException { + return segments(fn.apply(new SegmentsRequest.Builder()).build()); + } + + /** + * Provides low-level information about the segments in the shards of an index. + */ + public final SegmentsResponse segments() throws IOException, OpenSearchException { + return segments(new SegmentsRequest.Builder().build()); + } } diff --git a/java-client/src/main/java/org/opensearch/client/opensearch/cat/RecoveryRequest.java b/java-client/src/generated/java/org/opensearch/client/opensearch/cat/RecoveryRequest.java similarity index 50% rename from java-client/src/main/java/org/opensearch/client/opensearch/cat/RecoveryRequest.java rename to java-client/src/generated/java/org/opensearch/client/opensearch/cat/RecoveryRequest.java index 53b98cdd71..6dc4b8347d 100644 --- a/java-client/src/main/java/org/opensearch/client/opensearch/cat/RecoveryRequest.java +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/cat/RecoveryRequest.java @@ -30,28 +30,38 @@ * GitHub history for details. */ +//---------------------------------------------------- +// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. +//---------------------------------------------------- + package org.opensearch.client.opensearch.cat; 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.Bytes; import org.opensearch.client.opensearch._types.ErrorResponse; +import org.opensearch.client.opensearch._types.TimeUnit; 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.ToCopyableBuilder; // typedef: cat.recovery.Request /** - * Returns information about index shard recoveries, both on-going completed. + * Returns all completed and ongoing index and shard recoveries. */ +@Generated("org.opensearch.client.codegen.CodeGenerator") +public final class RecoveryRequest extends CatRequestBase implements ToCopyableBuilder { -public class RecoveryRequest extends CatRequestBase { @Nullable private final Boolean activeOnly; @@ -61,8 +71,12 @@ public class RecoveryRequest extends CatRequestBase { @Nullable private final Boolean detailed; + @Nonnull private final List index; + @Nullable + private final TimeUnit time; + // --------------------------------------------------------------------------------------------- private RecoveryRequest(Builder builder) { @@ -71,17 +85,18 @@ private RecoveryRequest(Builder builder) { this.bytes = builder.bytes; this.detailed = builder.detailed; this.index = ApiTypeHelper.unmodifiable(builder.index); - + this.time = builder.time; } - public static RecoveryRequest of(Function> fn) { + public static RecoveryRequest of(Function> fn) { return fn.apply(new Builder()).build(); } /** - * If true, the response only includes ongoing shard recoveries + * If true, the response only includes ongoing shard recoveries. *

* API name: {@code active_only} + *

*/ @Nullable public final Boolean activeOnly() { @@ -89,9 +104,10 @@ public final Boolean activeOnly() { } /** - * The unit in which to display byte values + * The units used to display byte values. *

* API name: {@code bytes} + *

*/ @Nullable public final Bytes bytes() { @@ -99,10 +115,10 @@ public final Bytes bytes() { } /** - * If true, the response includes detailed information about shard - * recoveries + * When true, includes detailed information about shard recoveries. *

* API name: {@code detailed} + *

*/ @Nullable public final Boolean detailed() { @@ -110,121 +126,211 @@ public final Boolean detailed() { } /** - * Comma-separated list or wildcard expression of index names to limit the - * returned information + * A comma-separated list of data streams, indexes, and aliases used to limit the request. Supports wildcards (*). To + * target all data streams and indexes, omit this parameter or use * or _all. *

* API name: {@code index} + *

*/ + @Nonnull public final List index() { return this.index; } + /** + * Specifies the time units, for example, 5d or 7h. For more information, see + * Supported units. + *

+ * API name: {@code time} + *

+ */ + @Nullable + public final TimeUnit time() { + return this.time; + } + // --------------------------------------------------------------------------------------------- + @Override + @Nonnull + public Builder toBuilder() { + return new Builder(this); + } + + @Nonnull + public static Builder builder() { + return new Builder(); + } + /** * Builder for {@link RecoveryRequest}. */ - - public static class Builder extends CatRequestBaseBuilder { + public static class Builder extends CatRequestBase.AbstractBuilder implements CopyableBuilder { @Nullable private Boolean activeOnly; - @Nullable private Bytes bytes; - @Nullable private Boolean detailed; - @Nullable private List index; + @Nullable + private TimeUnit time; + + public Builder() {} + + private Builder(RecoveryRequest o) { + super(o); + this.activeOnly = o.activeOnly; + this.bytes = o.bytes; + this.detailed = o.detailed; + this.index = _listCopy(o.index); + this.time = o.time; + } + + private Builder(Builder o) { + super(o); + this.activeOnly = o.activeOnly; + this.bytes = o.bytes; + this.detailed = o.detailed; + this.index = _listCopy(o.index); + this.time = o.time; + } + + @Override + @Nonnull + public Builder copy() { + return new Builder(this); + } + + @Override + @Nonnull + protected Builder self() { + return this; + } /** - * If true, the response only includes ongoing shard recoveries + * If true, the response only includes ongoing shard recoveries. *

* API name: {@code active_only} + *

*/ + @Nonnull public final Builder activeOnly(@Nullable Boolean value) { this.activeOnly = value; return this; } /** - * The unit in which to display byte values + * The units used to display byte values. *

* API name: {@code bytes} + *

*/ + @Nonnull public final Builder bytes(@Nullable Bytes value) { this.bytes = value; return this; } /** - * If true, the response includes detailed information about shard - * recoveries + * When true, includes detailed information about shard recoveries. *

* API name: {@code detailed} + *

*/ + @Nonnull public final Builder detailed(@Nullable Boolean value) { this.detailed = value; return this; } /** - * Comma-separated list or wildcard expression of index names to limit the - * returned information + * A comma-separated list of data streams, indexes, and aliases used to limit the request. Supports wildcards (*). To + * target all data streams and indexes, omit this parameter or use * or _all. *

* 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 or wildcard expression of index names to limit the - * returned information + * A comma-separated list of data streams, indexes, and aliases used to limit the request. Supports wildcards (*). To + * target all data streams and indexes, omit this parameter or use * or _all. *

* 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; } + /** + * Specifies the time units, for example, 5d or 7h. For more information, see + * Supported units. + *

+ * API name: {@code time} + *

+ */ + @Nonnull + public final Builder time(@Nullable TimeUnit value) { + this.time = value; + return this; + } + /** * Builds a {@link RecoveryRequest}. * * @throws NullPointerException if some of the required fields are null. */ + @Override + @Nonnull public RecoveryRequest build() { _checkSingleUse(); return new RecoveryRequest(this); } - - @Override - protected Builder self() { - return this; - } } // --------------------------------------------------------------------------------------------- + @Override + protected void applyQueryParameters(@Nonnull Map params) { + super.applyQueryParameters(params); + if (this.activeOnly != null) { + params.put("active_only", String.valueOf(this.activeOnly)); + } + if (this.bytes != null) { + params.put("bytes", this.bytes.jsonValue()); + } + if (this.detailed != null) { + params.put("detailed", String.valueOf(this.detailed)); + } + if (this.time != null) { + params.put("time", this.time.jsonValue()); + } + } + /** * Endpoint "{@code cat.recovery}". */ public static final Endpoint _ENDPOINT = new SimpleEndpoint<>( - // Request method - request -> { - return "GET"; - - }, - + request -> "GET", // Request path request -> { final int _index = 1 << 0; @@ -234,40 +340,48 @@ protected Builder self() { if (ApiTypeHelper.isDefined(request.index())) propsSet |= _index; if (propsSet == 0) { - StringBuilder buf = new StringBuilder(); - buf.append("/_cat"); - buf.append("/recovery"); - return buf.toString(); + return "/_cat/recovery"; } if (propsSet == (_index)) { StringBuilder buf = new StringBuilder(); - buf.append("/_cat"); - buf.append("/recovery"); - buf.append("/"); - SimpleEndpoint.pathEncode(request.index.stream().map(v -> v).collect(Collectors.joining(",")), buf); + buf.append("/_cat/recovery/"); + 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<>(request.queryParameters()); - if (request.detailed != null) { - params.put("detailed", String.valueOf(request.detailed)); - } - if (request.activeOnly != null) { - params.put("active_only", String.valueOf(request.activeOnly)); - } - if (request.bytes != null) { - params.put("bytes", request.bytes.jsonValue()); - } + Map params = new HashMap<>(); + request.applyQueryParameters(params); return params; - }, SimpleEndpoint.emptyMap(), false, RecoveryResponse._DESERIALIZER ); + + @Override + public int hashCode() { + int result = 17; + result = 31 * result + Objects.hashCode(this.activeOnly); + result = 31 * result + Objects.hashCode(this.bytes); + result = 31 * result + Objects.hashCode(this.detailed); + result = 31 * result + Objects.hashCode(this.index); + result = 31 * result + Objects.hashCode(this.time); + return result; + } + + @Override + public boolean equals(Object o) { + if (this == o) return true; + if (o == null || this.getClass() != o.getClass()) return false; + RecoveryRequest other = (RecoveryRequest) o; + return Objects.equals(this.activeOnly, other.activeOnly) + && Objects.equals(this.bytes, other.bytes) + && Objects.equals(this.detailed, other.detailed) + && Objects.equals(this.index, other.index) + && Objects.equals(this.time, other.time); + } } diff --git a/java-client/src/main/java/org/opensearch/client/opensearch/cat/RecoveryResponse.java b/java-client/src/generated/java/org/opensearch/client/opensearch/cat/RecoveryResponse.java similarity index 75% rename from java-client/src/main/java/org/opensearch/client/opensearch/cat/RecoveryResponse.java rename to java-client/src/generated/java/org/opensearch/client/opensearch/cat/RecoveryResponse.java index 8f38f6a5f5..5c4566ffb6 100644 --- a/java-client/src/main/java/org/opensearch/client/opensearch/cat/RecoveryResponse.java +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/cat/RecoveryResponse.java @@ -30,43 +30,51 @@ * GitHub history for details. */ +//---------------------------------------------------- +// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. +//---------------------------------------------------- + package org.opensearch.client.opensearch.cat; 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; import org.opensearch.client.json.PlainJsonSerializable; import org.opensearch.client.opensearch.cat.recovery.RecoveryRecord; 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: cat.recovery.Response @JsonpDeserializable -public class RecoveryResponse implements PlainJsonSerializable { +@Generated("org.opensearch.client.codegen.CodeGenerator") +public class RecoveryResponse implements PlainJsonSerializable, ToCopyableBuilder { + + @Nonnull private final List valueBody; // --------------------------------------------------------------------------------------------- private RecoveryResponse(Builder builder) { - this.valueBody = ApiTypeHelper.unmodifiableRequired(builder.valueBody, this, "valueBody"); - } - public static RecoveryResponse of(Function> fn) { + public static RecoveryResponse of(Function> fn) { return fn.apply(new Builder()).build(); } /** * Required - Response value. - *

- * API name: {@code _value_body} */ + @Nonnull public final List valueBody() { return this.valueBody; } @@ -78,28 +86,53 @@ public void serialize(JsonGenerator generator, JsonpMapper mapper) { generator.writeStartArray(); for (RecoveryRecord item0 : this.valueBody) { 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 RecoveryResponse}. */ - - public static class Builder extends ObjectBuilderBase implements ObjectBuilder { + public static class Builder extends ObjectBuilderBase implements CopyableBuilder { private List valueBody; + public Builder() {} + + private Builder(RecoveryResponse o) { + this.valueBody = _listCopy(o.valueBody); + } + + private Builder(Builder o) { + this.valueBody = _listCopy(o.valueBody); + } + + @Override + @Nonnull + public Builder copy() { + return new Builder(this); + } + /** * Required - Response value. - *

- * API name: {@code _value_body} + * *

* Adds all elements of list to valueBody. + *

*/ + @Nonnull public final Builder valueBody(List list) { this.valueBody = _listAddAll(this.valueBody, list); return this; @@ -107,11 +140,12 @@ public final Builder valueBody(List list) { /** * Required - Response value. - *

- * API name: {@code _value_body} + * *

* Adds one or more values to valueBody. + *

*/ + @Nonnull public final Builder valueBody(RecoveryRecord value, RecoveryRecord... values) { this.valueBody = _listAdd(this.valueBody, value, values); return this; @@ -119,11 +153,12 @@ public final Builder valueBody(RecoveryRecord value, RecoveryRecord... values) { /** * Required - Response value. - *

- * API name: {@code _value_body} + * *

* Adds a value to valueBody using a builder lambda. + *

*/ + @Nonnull public final Builder valueBody(Function> fn) { return valueBody(fn.apply(new RecoveryRecord.Builder()).build()); } @@ -131,9 +166,10 @@ public final Builder valueBody(Function _DESERIALIZER = createRecoveryResponseDeserializer(); protected static JsonpDeserializer createRecoveryResponseDeserializer() { - JsonpDeserializer> valueDeserializer = JsonpDeserializer.arrayDeserializer(RecoveryRecord._DESERIALIZER); return JsonpDeserializer.of( @@ -152,5 +187,4 @@ protected static JsonpDeserializer createRecoveryResponseDeser (parser, mapper) -> new Builder().valueBody(valueDeserializer.deserialize(parser, mapper)).build() ); } - } diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/cat/RepositoriesRequest.java b/java-client/src/generated/java/org/opensearch/client/opensearch/cat/RepositoriesRequest.java new file mode 100644 index 0000000000..e41b9da80f --- /dev/null +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/cat/RepositoriesRequest.java @@ -0,0 +1,264 @@ +/* + * SPDX-License-Identifier: Apache-2.0 + * + * The OpenSearch Contributors require contributions made to + * this file be licensed under the Apache-2.0 license or a + * compatible open source license. + */ + +/* + * Licensed to Elasticsearch B.V. under one or more contributor + * license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright + * ownership. Elasticsearch B.V. licenses this file to you under + * the Apache License, Version 2.0 (the "License"); you may + * not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +/* + * Modifications Copyright OpenSearch Contributors. See + * GitHub history for details. + */ + +//---------------------------------------------------- +// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. +//---------------------------------------------------- + +package org.opensearch.client.opensearch.cat; + +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.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.ToCopyableBuilder; + +// typedef: cat.repositories.Request + +/** + * Returns information about all snapshot repositories for a cluster. + */ +@Generated("org.opensearch.client.codegen.CodeGenerator") +public final class RepositoriesRequest extends CatRequestBase + implements + ToCopyableBuilder { + + @Nullable + private final Time clusterManagerTimeout; + + @Deprecated + @Nullable + private final Time masterTimeout; + + // --------------------------------------------------------------------------------------------- + + private RepositoriesRequest(Builder builder) { + super(builder); + this.clusterManagerTimeout = builder.clusterManagerTimeout; + this.masterTimeout = builder.masterTimeout; + } + + public static RepositoriesRequest of(Function> fn) { + return fn.apply(new Builder()).build(); + } + + /** + * The amount of time allowed to establish a connection to the cluster manager node. + *

+ * API name: {@code cluster_manager_timeout} + *

+ */ + @Nullable + public final Time clusterManagerTimeout() { + return this.clusterManagerTimeout; + } + + /** + * The amount of time allowed to establish a connection to the cluster manager node. + *

+ * API name: {@code master_timeout} + *

+ */ + @Deprecated + @Nullable + public final Time masterTimeout() { + return this.masterTimeout; + } + + // --------------------------------------------------------------------------------------------- + + @Override + @Nonnull + public Builder toBuilder() { + return new Builder(this); + } + + @Nonnull + public static Builder builder() { + return new Builder(); + } + + /** + * Builder for {@link RepositoriesRequest}. + */ + public static class Builder extends CatRequestBase.AbstractBuilder implements CopyableBuilder { + @Nullable + private Time clusterManagerTimeout; + @Nullable + private Time masterTimeout; + + public Builder() {} + + private Builder(RepositoriesRequest o) { + super(o); + this.clusterManagerTimeout = o.clusterManagerTimeout; + this.masterTimeout = o.masterTimeout; + } + + private Builder(Builder o) { + super(o); + this.clusterManagerTimeout = o.clusterManagerTimeout; + this.masterTimeout = o.masterTimeout; + } + + @Override + @Nonnull + public Builder copy() { + return new Builder(this); + } + + @Override + @Nonnull + protected Builder self() { + return this; + } + + /** + * The amount of time allowed to establish a connection to the cluster manager node. + *

+ * API name: {@code cluster_manager_timeout} + *

+ */ + @Nonnull + public final Builder clusterManagerTimeout(@Nullable Time value) { + this.clusterManagerTimeout = value; + return this; + } + + /** + * The amount of time allowed to establish a connection to the cluster manager node. + *

+ * API name: {@code cluster_manager_timeout} + *

+ */ + @Nonnull + public final Builder clusterManagerTimeout(Function> fn) { + return clusterManagerTimeout(fn.apply(new Time.Builder()).build()); + } + + /** + * The amount of time allowed to establish a connection to the cluster manager node. + *

+ * API name: {@code master_timeout} + *

+ */ + @Deprecated + @Nonnull + public final Builder masterTimeout(@Nullable Time value) { + this.masterTimeout = value; + return this; + } + + /** + * The amount of time allowed to establish a connection to the cluster manager node. + *

+ * API name: {@code master_timeout} + *

+ */ + @Deprecated + @Nonnull + public final Builder masterTimeout(Function> fn) { + return masterTimeout(fn.apply(new Time.Builder()).build()); + } + + /** + * Builds a {@link RepositoriesRequest}. + * + * @throws NullPointerException if some of the required fields are null. + */ + @Override + @Nonnull + public RepositoriesRequest build() { + _checkSingleUse(); + + return new RepositoriesRequest(this); + } + } + + // --------------------------------------------------------------------------------------------- + + @Override + protected void applyQueryParameters(@Nonnull Map params) { + super.applyQueryParameters(params); + if (this.clusterManagerTimeout != null) { + params.put("cluster_manager_timeout", this.clusterManagerTimeout._toJsonString()); + } + if (this.masterTimeout != null) { + params.put("master_timeout", this.masterTimeout._toJsonString()); + } + } + + /** + * Endpoint "{@code cat.repositories}". + */ + public static final Endpoint _ENDPOINT = new SimpleEndpoint<>( + // Request method + request -> "GET", + // Request path + request -> "/_cat/repositories", + // Request parameters + request -> { + Map params = new HashMap<>(); + request.applyQueryParameters(params); + return params; + }, + SimpleEndpoint.emptyMap(), + false, + RepositoriesResponse._DESERIALIZER + ); + + @Override + public int hashCode() { + int result = 17; + result = 31 * result + Objects.hashCode(this.clusterManagerTimeout); + result = 31 * result + Objects.hashCode(this.masterTimeout); + return result; + } + + @Override + public boolean equals(Object o) { + if (this == o) return true; + if (o == null || this.getClass() != o.getClass()) return false; + RepositoriesRequest other = (RepositoriesRequest) o; + return Objects.equals(this.clusterManagerTimeout, other.clusterManagerTimeout) + && Objects.equals(this.masterTimeout, other.masterTimeout); + } +} diff --git a/java-client/src/main/java/org/opensearch/client/opensearch/cat/RepositoriesResponse.java b/java-client/src/generated/java/org/opensearch/client/opensearch/cat/RepositoriesResponse.java similarity index 76% rename from java-client/src/main/java/org/opensearch/client/opensearch/cat/RepositoriesResponse.java rename to java-client/src/generated/java/org/opensearch/client/opensearch/cat/RepositoriesResponse.java index 009f736bd9..6af92be4b7 100644 --- a/java-client/src/main/java/org/opensearch/client/opensearch/cat/RepositoriesResponse.java +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/cat/RepositoriesResponse.java @@ -30,43 +30,51 @@ * GitHub history for details. */ +//---------------------------------------------------- +// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. +//---------------------------------------------------- + package org.opensearch.client.opensearch.cat; 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; import org.opensearch.client.json.PlainJsonSerializable; import org.opensearch.client.opensearch.cat.repositories.RepositoriesRecord; 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: cat.repositories.Response @JsonpDeserializable -public class RepositoriesResponse implements PlainJsonSerializable { +@Generated("org.opensearch.client.codegen.CodeGenerator") +public class RepositoriesResponse implements PlainJsonSerializable, ToCopyableBuilder { + + @Nonnull private final List valueBody; // --------------------------------------------------------------------------------------------- private RepositoriesResponse(Builder builder) { - this.valueBody = ApiTypeHelper.unmodifiableRequired(builder.valueBody, this, "valueBody"); - } - public static RepositoriesResponse of(Function> fn) { + public static RepositoriesResponse of(Function> fn) { return fn.apply(new Builder()).build(); } /** * Required - Response value. - *

- * API name: {@code _value_body} */ + @Nonnull public final List valueBody() { return this.valueBody; } @@ -78,28 +86,53 @@ public void serialize(JsonGenerator generator, JsonpMapper mapper) { generator.writeStartArray(); for (RepositoriesRecord item0 : this.valueBody) { 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 RepositoriesResponse}. */ - - public static class Builder extends ObjectBuilderBase implements ObjectBuilder { + public static class Builder extends ObjectBuilderBase implements CopyableBuilder { private List valueBody; + public Builder() {} + + private Builder(RepositoriesResponse o) { + this.valueBody = _listCopy(o.valueBody); + } + + private Builder(Builder o) { + this.valueBody = _listCopy(o.valueBody); + } + + @Override + @Nonnull + public Builder copy() { + return new Builder(this); + } + /** * Required - Response value. - *

- * API name: {@code _value_body} + * *

* Adds all elements of list to valueBody. + *

*/ + @Nonnull public final Builder valueBody(List list) { this.valueBody = _listAddAll(this.valueBody, list); return this; @@ -107,11 +140,12 @@ public final Builder valueBody(List list) { /** * Required - Response value. - *

- * API name: {@code _value_body} + * *

* Adds one or more values to valueBody. + *

*/ + @Nonnull public final Builder valueBody(RepositoriesRecord value, RepositoriesRecord... values) { this.valueBody = _listAdd(this.valueBody, value, values); return this; @@ -119,11 +153,12 @@ public final Builder valueBody(RepositoriesRecord value, RepositoriesRecord... v /** * Required - Response value. - *

- * API name: {@code _value_body} + * *

* Adds a value to valueBody using a builder lambda. + *

*/ + @Nonnull public final Builder valueBody(Function> fn) { return valueBody(fn.apply(new RepositoriesRecord.Builder()).build()); } @@ -131,9 +166,10 @@ public final Builder valueBody(Function _DESERIALIZER = createRepositoriesResponseDeserializer(); protected static JsonpDeserializer createRepositoriesResponseDeserializer() { - JsonpDeserializer> valueDeserializer = JsonpDeserializer.arrayDeserializer( RepositoriesRecord._DESERIALIZER ); @@ -154,5 +189,4 @@ protected static JsonpDeserializer createRepositoriesRespo (parser, mapper) -> new Builder().valueBody(valueDeserializer.deserialize(parser, mapper)).build() ); } - } diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/cat/SegmentsRequest.java b/java-client/src/generated/java/org/opensearch/client/opensearch/cat/SegmentsRequest.java new file mode 100644 index 0000000000..4452bea5d8 --- /dev/null +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/cat/SegmentsRequest.java @@ -0,0 +1,375 @@ +/* + * SPDX-License-Identifier: Apache-2.0 + * + * The OpenSearch Contributors require contributions made to + * this file be licensed under the Apache-2.0 license or a + * compatible open source license. + */ + +/* + * Licensed to Elasticsearch B.V. under one or more contributor + * license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright + * ownership. Elasticsearch B.V. licenses this file to you under + * the Apache License, Version 2.0 (the "License"); you may + * not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +/* + * Modifications Copyright OpenSearch Contributors. See + * GitHub history for details. + */ + +//---------------------------------------------------- +// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. +//---------------------------------------------------- + +package org.opensearch.client.opensearch.cat; + +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.function.Function; +import javax.annotation.Generated; +import javax.annotation.Nonnull; +import javax.annotation.Nullable; +import org.opensearch.client.opensearch._types.Bytes; +import org.opensearch.client.opensearch._types.ErrorResponse; +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.ApiTypeHelper; +import org.opensearch.client.util.CopyableBuilder; +import org.opensearch.client.util.ObjectBuilder; +import org.opensearch.client.util.ToCopyableBuilder; + +// typedef: cat.segments.Request + +/** + * Provides low-level information about the segments in the shards of an index. + */ +@Generated("org.opensearch.client.codegen.CodeGenerator") +public final class SegmentsRequest extends CatRequestBase implements ToCopyableBuilder { + + @Nullable + private final Bytes bytes; + + @Nullable + private final Time clusterManagerTimeout; + + @Nonnull + private final List index; + + @Deprecated + @Nullable + private final Time masterTimeout; + + // --------------------------------------------------------------------------------------------- + + private SegmentsRequest(Builder builder) { + super(builder); + this.bytes = builder.bytes; + this.clusterManagerTimeout = builder.clusterManagerTimeout; + this.index = ApiTypeHelper.unmodifiable(builder.index); + this.masterTimeout = builder.masterTimeout; + } + + public static SegmentsRequest of(Function> fn) { + return fn.apply(new Builder()).build(); + } + + /** + * The units used to display byte values. + *

+ * API name: {@code bytes} + *

+ */ + @Nullable + public final Bytes bytes() { + return this.bytes; + } + + /** + * The amount of time allowed to establish a connection to the cluster manager node. + *

+ * API name: {@code cluster_manager_timeout} + *

+ */ + @Nullable + public final Time clusterManagerTimeout() { + return this.clusterManagerTimeout; + } + + /** + * A comma-separated list of data streams, indexes, and aliases used to limit the request. Supports wildcards (*). To + * target all data streams and indexes, omit this parameter or use * or _all. + *

+ * API name: {@code index} + *

+ */ + @Nonnull + public final List index() { + return this.index; + } + + /** + * The amount of time allowed to establish a connection to the cluster manager node. + *

+ * API name: {@code master_timeout} + *

+ */ + @Deprecated + @Nullable + public final Time masterTimeout() { + return this.masterTimeout; + } + + // --------------------------------------------------------------------------------------------- + + @Override + @Nonnull + public Builder toBuilder() { + return new Builder(this); + } + + @Nonnull + public static Builder builder() { + return new Builder(); + } + + /** + * Builder for {@link SegmentsRequest}. + */ + public static class Builder extends CatRequestBase.AbstractBuilder implements CopyableBuilder { + @Nullable + private Bytes bytes; + @Nullable + private Time clusterManagerTimeout; + @Nullable + private List index; + @Nullable + private Time masterTimeout; + + public Builder() {} + + private Builder(SegmentsRequest o) { + super(o); + this.bytes = o.bytes; + this.clusterManagerTimeout = o.clusterManagerTimeout; + this.index = _listCopy(o.index); + this.masterTimeout = o.masterTimeout; + } + + private Builder(Builder o) { + super(o); + this.bytes = o.bytes; + this.clusterManagerTimeout = o.clusterManagerTimeout; + this.index = _listCopy(o.index); + this.masterTimeout = o.masterTimeout; + } + + @Override + @Nonnull + public Builder copy() { + return new Builder(this); + } + + @Override + @Nonnull + protected Builder self() { + return this; + } + + /** + * The units used to display byte values. + *

+ * API name: {@code bytes} + *

+ */ + @Nonnull + public final Builder bytes(@Nullable Bytes value) { + this.bytes = value; + return this; + } + + /** + * The amount of time allowed to establish a connection to the cluster manager node. + *

+ * API name: {@code cluster_manager_timeout} + *

+ */ + @Nonnull + public final Builder clusterManagerTimeout(@Nullable Time value) { + this.clusterManagerTimeout = value; + return this; + } + + /** + * The amount of time allowed to establish a connection to the cluster manager node. + *

+ * API name: {@code cluster_manager_timeout} + *

+ */ + @Nonnull + public final Builder clusterManagerTimeout(Function> fn) { + return clusterManagerTimeout(fn.apply(new Time.Builder()).build()); + } + + /** + * A comma-separated list of data streams, indexes, and aliases used to limit the request. Supports wildcards (*). To + * target all data streams and indexes, omit this parameter or use * or _all. + *

+ * 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; + } + + /** + * A comma-separated list of data streams, indexes, and aliases used to limit the request. Supports wildcards (*). To + * target all data streams and indexes, omit this parameter or use * or _all. + *

+ * 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; + } + + /** + * The amount of time allowed to establish a connection to the cluster manager node. + *

+ * API name: {@code master_timeout} + *

+ */ + @Deprecated + @Nonnull + public final Builder masterTimeout(@Nullable Time value) { + this.masterTimeout = value; + return this; + } + + /** + * The amount of time allowed to establish a connection to the cluster manager node. + *

+ * API name: {@code master_timeout} + *

+ */ + @Deprecated + @Nonnull + public final Builder masterTimeout(Function> fn) { + return masterTimeout(fn.apply(new Time.Builder()).build()); + } + + /** + * Builds a {@link SegmentsRequest}. + * + * @throws NullPointerException if some of the required fields are null. + */ + @Override + @Nonnull + public SegmentsRequest build() { + _checkSingleUse(); + + return new SegmentsRequest(this); + } + } + + // --------------------------------------------------------------------------------------------- + + @Override + protected void applyQueryParameters(@Nonnull Map params) { + super.applyQueryParameters(params); + if (this.bytes != null) { + params.put("bytes", this.bytes.jsonValue()); + } + if (this.clusterManagerTimeout != null) { + params.put("cluster_manager_timeout", this.clusterManagerTimeout._toJsonString()); + } + if (this.masterTimeout != null) { + params.put("master_timeout", this.masterTimeout._toJsonString()); + } + } + + /** + * Endpoint "{@code cat.segments}". + */ + public static final Endpoint _ENDPOINT = new SimpleEndpoint<>( + // Request method + request -> "GET", + // Request path + request -> { + final int _index = 1 << 0; + + int propsSet = 0; + + if (ApiTypeHelper.isDefined(request.index())) propsSet |= _index; + + if (propsSet == 0) { + return "/_cat/segments"; + } + if (propsSet == (_index)) { + StringBuilder buf = new StringBuilder(); + buf.append("/_cat/segments/"); + SimpleEndpoint.pathEncode(String.join(",", request.index), buf); + return buf.toString(); + } + + throw SimpleEndpoint.noPathTemplateFound("path"); + }, + // Request parameters + request -> { + Map params = new HashMap<>(); + request.applyQueryParameters(params); + return params; + }, + SimpleEndpoint.emptyMap(), + false, + SegmentsResponse._DESERIALIZER + ); + + @Override + public int hashCode() { + int result = 17; + result = 31 * result + Objects.hashCode(this.bytes); + result = 31 * result + Objects.hashCode(this.clusterManagerTimeout); + result = 31 * result + Objects.hashCode(this.index); + result = 31 * result + Objects.hashCode(this.masterTimeout); + return result; + } + + @Override + public boolean equals(Object o) { + if (this == o) return true; + if (o == null || this.getClass() != o.getClass()) return false; + SegmentsRequest other = (SegmentsRequest) o; + return Objects.equals(this.bytes, other.bytes) + && Objects.equals(this.clusterManagerTimeout, other.clusterManagerTimeout) + && Objects.equals(this.index, other.index) + && Objects.equals(this.masterTimeout, other.masterTimeout); + } +} diff --git a/java-client/src/main/java/org/opensearch/client/opensearch/cat/SegmentsResponse.java b/java-client/src/generated/java/org/opensearch/client/opensearch/cat/SegmentsResponse.java similarity index 75% rename from java-client/src/main/java/org/opensearch/client/opensearch/cat/SegmentsResponse.java rename to java-client/src/generated/java/org/opensearch/client/opensearch/cat/SegmentsResponse.java index b3a6ee422e..6b12a24eb1 100644 --- a/java-client/src/main/java/org/opensearch/client/opensearch/cat/SegmentsResponse.java +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/cat/SegmentsResponse.java @@ -30,43 +30,51 @@ * GitHub history for details. */ +//---------------------------------------------------- +// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. +//---------------------------------------------------- + package org.opensearch.client.opensearch.cat; 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; import org.opensearch.client.json.PlainJsonSerializable; import org.opensearch.client.opensearch.cat.segments.SegmentsRecord; 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: cat.segments.Response @JsonpDeserializable -public class SegmentsResponse implements PlainJsonSerializable { +@Generated("org.opensearch.client.codegen.CodeGenerator") +public class SegmentsResponse implements PlainJsonSerializable, ToCopyableBuilder { + + @Nonnull private final List valueBody; // --------------------------------------------------------------------------------------------- private SegmentsResponse(Builder builder) { - this.valueBody = ApiTypeHelper.unmodifiableRequired(builder.valueBody, this, "valueBody"); - } - public static SegmentsResponse of(Function> fn) { + public static SegmentsResponse of(Function> fn) { return fn.apply(new Builder()).build(); } /** * Required - Response value. - *

- * API name: {@code _value_body} */ + @Nonnull public final List valueBody() { return this.valueBody; } @@ -78,28 +86,53 @@ public void serialize(JsonGenerator generator, JsonpMapper mapper) { generator.writeStartArray(); for (SegmentsRecord item0 : this.valueBody) { 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 SegmentsResponse}. */ - - public static class Builder extends ObjectBuilderBase implements ObjectBuilder { + public static class Builder extends ObjectBuilderBase implements CopyableBuilder { private List valueBody; + public Builder() {} + + private Builder(SegmentsResponse o) { + this.valueBody = _listCopy(o.valueBody); + } + + private Builder(Builder o) { + this.valueBody = _listCopy(o.valueBody); + } + + @Override + @Nonnull + public Builder copy() { + return new Builder(this); + } + /** * Required - Response value. - *

- * API name: {@code _value_body} + * *

* Adds all elements of list to valueBody. + *

*/ + @Nonnull public final Builder valueBody(List list) { this.valueBody = _listAddAll(this.valueBody, list); return this; @@ -107,11 +140,12 @@ public final Builder valueBody(List list) { /** * Required - Response value. - *

- * API name: {@code _value_body} + * *

* Adds one or more values to valueBody. + *

*/ + @Nonnull public final Builder valueBody(SegmentsRecord value, SegmentsRecord... values) { this.valueBody = _listAdd(this.valueBody, value, values); return this; @@ -119,11 +153,12 @@ public final Builder valueBody(SegmentsRecord value, SegmentsRecord... values) { /** * Required - Response value. - *

- * API name: {@code _value_body} + * *

* Adds a value to valueBody using a builder lambda. + *

*/ + @Nonnull public final Builder valueBody(Function> fn) { return valueBody(fn.apply(new SegmentsRecord.Builder()).build()); } @@ -131,9 +166,10 @@ public final Builder valueBody(Function _DESERIALIZER = createSegmentsResponseDeserializer(); protected static JsonpDeserializer createSegmentsResponseDeserializer() { - JsonpDeserializer> valueDeserializer = JsonpDeserializer.arrayDeserializer(SegmentsRecord._DESERIALIZER); return JsonpDeserializer.of( @@ -152,5 +187,4 @@ protected static JsonpDeserializer createSegmentsResponseDeser (parser, mapper) -> new Builder().valueBody(valueDeserializer.deserialize(parser, mapper)).build() ); } - } diff --git a/java-client/src/main/java/org/opensearch/client/opensearch/cat/recovery/RecoveryRecord.java b/java-client/src/generated/java/org/opensearch/client/opensearch/cat/recovery/RecoveryRecord.java similarity index 65% rename from java-client/src/main/java/org/opensearch/client/opensearch/cat/recovery/RecoveryRecord.java rename to java-client/src/generated/java/org/opensearch/client/opensearch/cat/recovery/RecoveryRecord.java index 477ab7fc9a..dfed2ad58b 100644 --- a/java-client/src/main/java/org/opensearch/client/opensearch/cat/recovery/RecoveryRecord.java +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/cat/recovery/RecoveryRecord.java @@ -30,10 +30,17 @@ * GitHub history for details. */ +//---------------------------------------------------- +// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. +//---------------------------------------------------- + package org.opensearch.client.opensearch.cat.recovery; import jakarta.json.stream.JsonGenerator; +import java.util.Objects; import java.util.function.Function; +import javax.annotation.Generated; +import javax.annotation.Nonnull; import javax.annotation.Nullable; import org.opensearch.client.json.JsonpDeserializable; import org.opensearch.client.json.JsonpDeserializer; @@ -41,372 +48,373 @@ import org.opensearch.client.json.ObjectBuilderDeserializer; import org.opensearch.client.json.ObjectDeserializer; import org.opensearch.client.json.PlainJsonSerializable; +import org.opensearch.client.opensearch._types.Time; +import org.opensearch.client.util.CopyableBuilder; import org.opensearch.client.util.ObjectBuilder; import org.opensearch.client.util.ObjectBuilderBase; +import org.opensearch.client.util.ToCopyableBuilder; // typedef: cat.recovery.RecoveryRecord @JsonpDeserializable -public class RecoveryRecord implements PlainJsonSerializable { - @Nullable - private final String index; +@Generated("org.opensearch.client.codegen.CodeGenerator") +public class RecoveryRecord implements PlainJsonSerializable, ToCopyableBuilder { @Nullable - private final String shard; + private final String bytes; @Nullable - private final String startTime; + private final String bytesPercent; @Nullable - private final String startTimeMillis; + private final String bytesRecovered; @Nullable - private final String stopTime; + private final String bytesTotal; @Nullable - private final String stopTimeMillis; + private final String files; @Nullable - private final String time; + private final String filesPercent; @Nullable - private final String type; + private final String filesRecovered; @Nullable - private final String stage; + private final String filesTotal; @Nullable - private final String sourceHost; + private final String index; @Nullable - private final String sourceNode; + private final String repository; @Nullable - private final String targetHost; + private final String shard; @Nullable - private final String targetNode; + private final String snapshot; @Nullable - private final String repository; + private final String sourceHost; @Nullable - private final String snapshot; + private final String sourceNode; @Nullable - private final String files; + private final String stage; @Nullable - private final String filesRecovered; + private final String startTime; @Nullable - private final String filesPercent; + private final Long startTimeMillis; @Nullable - private final String filesTotal; + private final String stopTime; @Nullable - private final String bytes; + private final Long stopTimeMillis; @Nullable - private final String bytesRecovered; + private final String targetHost; @Nullable - private final String bytesPercent; + private final String targetNode; @Nullable - private final String bytesTotal; + private final Time time; @Nullable private final String translogOps; + @Nullable + private final String translogOpsPercent; + @Nullable private final String translogOpsRecovered; @Nullable - private final String translogOpsPercent; + private final String type; // --------------------------------------------------------------------------------------------- private RecoveryRecord(Builder builder) { - + this.bytes = builder.bytes; + this.bytesPercent = builder.bytesPercent; + this.bytesRecovered = builder.bytesRecovered; + this.bytesTotal = builder.bytesTotal; + this.files = builder.files; + this.filesPercent = builder.filesPercent; + this.filesRecovered = builder.filesRecovered; + this.filesTotal = builder.filesTotal; this.index = builder.index; + this.repository = builder.repository; this.shard = builder.shard; + this.snapshot = builder.snapshot; + this.sourceHost = builder.sourceHost; + this.sourceNode = builder.sourceNode; + this.stage = builder.stage; this.startTime = builder.startTime; this.startTimeMillis = builder.startTimeMillis; this.stopTime = builder.stopTime; this.stopTimeMillis = builder.stopTimeMillis; - this.time = builder.time; - this.type = builder.type; - this.stage = builder.stage; - this.sourceHost = builder.sourceHost; - this.sourceNode = builder.sourceNode; this.targetHost = builder.targetHost; this.targetNode = builder.targetNode; - this.repository = builder.repository; - this.snapshot = builder.snapshot; - this.files = builder.files; - this.filesRecovered = builder.filesRecovered; - this.filesPercent = builder.filesPercent; - this.filesTotal = builder.filesTotal; - this.bytes = builder.bytes; - this.bytesRecovered = builder.bytesRecovered; - this.bytesPercent = builder.bytesPercent; - this.bytesTotal = builder.bytesTotal; + this.time = builder.time; this.translogOps = builder.translogOps; - this.translogOpsRecovered = builder.translogOpsRecovered; this.translogOpsPercent = builder.translogOpsPercent; - + this.translogOpsRecovered = builder.translogOpsRecovered; + this.type = builder.type; } - public static RecoveryRecord of(Function> fn) { + public static RecoveryRecord of(Function> fn) { return fn.apply(new Builder()).build(); } /** - * index name + * The number of bytes to recover. *

- * API name: {@code index} + * API name: {@code bytes} + *

*/ @Nullable - public final String index() { - return this.index; + public final String bytes() { + return this.bytes; } /** - * shard name - *

- * API name: {@code shard} + * API name: {@code bytes_percent} */ @Nullable - public final String shard() { - return this.shard; + public final String bytesPercent() { + return this.bytesPercent; } /** - * recovery start time + * The bytes recovered. *

- * API name: {@code start_time} + * API name: {@code bytes_recovered} + *

*/ @Nullable - public final String startTime() { - return this.startTime; + public final String bytesRecovered() { + return this.bytesRecovered; } /** - * recovery start time in epoch milliseconds + * The total number of bytes. *

- * API name: {@code start_time_millis} + * API name: {@code bytes_total} + *

*/ @Nullable - public final String startTimeMillis() { - return this.startTimeMillis; + public final String bytesTotal() { + return this.bytesTotal; } /** - * recovery stop time + * The number of files to recover. *

- * API name: {@code stop_time} + * API name: {@code files} + *

*/ @Nullable - public final String stopTime() { - return this.stopTime; + public final String files() { + return this.files; } /** - * recovery stop time in epoch milliseconds - *

- * API name: {@code stop_time_millis} + * API name: {@code files_percent} */ @Nullable - public final String stopTimeMillis() { - return this.stopTimeMillis; + public final String filesPercent() { + return this.filesPercent; } /** - * recovery time + * The files recovered. *

- * API name: {@code time} + * API name: {@code files_recovered} + *

*/ @Nullable - public final String time() { - return this.time; + public final String filesRecovered() { + return this.filesRecovered; } /** - * recovery type + * The total number of files. *

- * API name: {@code type} + * API name: {@code files_total} + *

*/ @Nullable - public final String type() { - return this.type; + public final String filesTotal() { + return this.filesTotal; } /** - * recovery stage - *

- * API name: {@code stage} + * API name: {@code index} */ @Nullable - public final String stage() { - return this.stage; + public final String index() { + return this.index; } /** - * source host + * The repository name. *

- * API name: {@code source_host} + * API name: {@code repository} + *

*/ @Nullable - public final String sourceHost() { - return this.sourceHost; + public final String repository() { + return this.repository; } /** - * source node name + * The shard name. *

- * API name: {@code source_node} + * API name: {@code shard} + *

*/ @Nullable - public final String sourceNode() { - return this.sourceNode; + public final String shard() { + return this.shard; } /** - * target host + * The snapshot name. *

- * API name: {@code target_host} + * API name: {@code snapshot} + *

*/ @Nullable - public final String targetHost() { - return this.targetHost; + public final String snapshot() { + return this.snapshot; } /** - * target node name + * The source host. *

- * API name: {@code target_node} + * API name: {@code source_host} + *

*/ @Nullable - public final String targetNode() { - return this.targetNode; + public final String sourceHost() { + return this.sourceHost; } /** - * repository + * The source node name. *

- * API name: {@code repository} + * API name: {@code source_node} + *

*/ @Nullable - public final String repository() { - return this.repository; + public final String sourceNode() { + return this.sourceNode; } /** - * snapshot + * The recovery stage. *

- * API name: {@code snapshot} + * API name: {@code stage} + *

*/ @Nullable - public final String snapshot() { - return this.snapshot; + public final String stage() { + return this.stage; } /** - * number of files to recover - *

- * API name: {@code files} + * API name: {@code start_time} */ @Nullable - public final String files() { - return this.files; + public final String startTime() { + return this.startTime; } /** - * files recovered - *

- * API name: {@code files_recovered} + * API name: {@code start_time_millis} */ @Nullable - public final String filesRecovered() { - return this.filesRecovered; + public final Long startTimeMillis() { + return this.startTimeMillis; } /** - * percent of files recovered - *

- * API name: {@code files_percent} + * API name: {@code stop_time} */ @Nullable - public final String filesPercent() { - return this.filesPercent; + public final String stopTime() { + return this.stopTime; } /** - * total number of files - *

- * API name: {@code files_total} + * API name: {@code stop_time_millis} */ @Nullable - public final String filesTotal() { - return this.filesTotal; + public final Long stopTimeMillis() { + return this.stopTimeMillis; } /** - * number of bytes to recover + * The target host. *

- * API name: {@code bytes} + * API name: {@code target_host} + *

*/ @Nullable - public final String bytes() { - return this.bytes; + public final String targetHost() { + return this.targetHost; } /** - * bytes recovered + * The target node name. *

- * API name: {@code bytes_recovered} + * API name: {@code target_node} + *

*/ @Nullable - public final String bytesRecovered() { - return this.bytesRecovered; + public final String targetNode() { + return this.targetNode; } /** - * percent of bytes recovered - *

- * API name: {@code bytes_percent} + * API name: {@code time} */ @Nullable - public final String bytesPercent() { - return this.bytesPercent; + public final Time time() { + return this.time; } /** - * total number of bytes + * The number of translog operations to recover. *

- * API name: {@code bytes_total} + * API name: {@code translog_ops} + *

*/ @Nullable - public final String bytesTotal() { - return this.bytesTotal; + public final String translogOps() { + return this.translogOps; } /** - * number of translog ops to recover - *

- * API name: {@code translog_ops} + * API name: {@code translog_ops_percent} */ @Nullable - public final String translogOps() { - return this.translogOps; + public final String translogOpsPercent() { + return this.translogOpsPercent; } /** - * translog ops recovered + * The translog operations recovered. *

* API name: {@code translog_ops_recovered} + *

*/ @Nullable public final String translogOpsRecovered() { @@ -414,18 +422,20 @@ public final String translogOpsRecovered() { } /** - * percent of translog ops recovered + * The recovery type. *

- * API name: {@code translog_ops_percent} + * API name: {@code type} + *

*/ @Nullable - public final String translogOpsPercent() { - return this.translogOpsPercent; + public final String type() { + return this.type; } /** * Serialize this object to JSON. */ + @Override public void serialize(JsonGenerator generator, JsonpMapper mapper) { generator.writeStartObject(); serializeInternal(generator, mapper); @@ -433,491 +443,573 @@ public void serialize(JsonGenerator generator, JsonpMapper mapper) { } protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { - - if (this.index != null) { - generator.writeKey("index"); - generator.write(this.index); - + if (this.bytes != null) { + generator.writeKey("bytes"); + generator.write(this.bytes); } - if (this.shard != null) { - generator.writeKey("shard"); - generator.write(this.shard); + if (this.bytesPercent != null) { + generator.writeKey("bytes_percent"); + generator.write(this.bytesPercent); } - if (this.startTime != null) { - generator.writeKey("start_time"); - generator.write(this.startTime); + if (this.bytesRecovered != null) { + generator.writeKey("bytes_recovered"); + generator.write(this.bytesRecovered); } - if (this.startTimeMillis != null) { - generator.writeKey("start_time_millis"); - generator.write(this.startTimeMillis); - - } - if (this.stopTime != null) { - generator.writeKey("stop_time"); - generator.write(this.stopTime); - - } - if (this.stopTimeMillis != null) { - generator.writeKey("stop_time_millis"); - generator.write(this.stopTimeMillis); - - } - if (this.time != null) { - generator.writeKey("time"); - generator.write(this.time); + if (this.bytesTotal != null) { + generator.writeKey("bytes_total"); + generator.write(this.bytesTotal); } - if (this.type != null) { - generator.writeKey("type"); - generator.write(this.type); + if (this.files != null) { + generator.writeKey("files"); + generator.write(this.files); } - if (this.stage != null) { - generator.writeKey("stage"); - generator.write(this.stage); + if (this.filesPercent != null) { + generator.writeKey("files_percent"); + generator.write(this.filesPercent); } - if (this.sourceHost != null) { - generator.writeKey("source_host"); - generator.write(this.sourceHost); + if (this.filesRecovered != null) { + generator.writeKey("files_recovered"); + generator.write(this.filesRecovered); } - if (this.sourceNode != null) { - generator.writeKey("source_node"); - generator.write(this.sourceNode); + if (this.filesTotal != null) { + generator.writeKey("files_total"); + generator.write(this.filesTotal); } - if (this.targetHost != null) { - generator.writeKey("target_host"); - generator.write(this.targetHost); + if (this.index != null) { + generator.writeKey("index"); + generator.write(this.index); } - if (this.targetNode != null) { - generator.writeKey("target_node"); - generator.write(this.targetNode); - } if (this.repository != null) { generator.writeKey("repository"); generator.write(this.repository); + } + if (this.shard != null) { + generator.writeKey("shard"); + generator.write(this.shard); } + if (this.snapshot != null) { generator.writeKey("snapshot"); generator.write(this.snapshot); + } + if (this.sourceHost != null) { + generator.writeKey("source_host"); + generator.write(this.sourceHost); } - if (this.files != null) { - generator.writeKey("files"); - generator.write(this.files); + if (this.sourceNode != null) { + generator.writeKey("source_node"); + generator.write(this.sourceNode); } - if (this.filesRecovered != null) { - generator.writeKey("files_recovered"); - generator.write(this.filesRecovered); + if (this.stage != null) { + generator.writeKey("stage"); + generator.write(this.stage); } - if (this.filesPercent != null) { - generator.writeKey("files_percent"); - generator.write(this.filesPercent); + if (this.startTime != null) { + generator.writeKey("start_time"); + generator.write(this.startTime); } - if (this.filesTotal != null) { - generator.writeKey("files_total"); - generator.write(this.filesTotal); + if (this.startTimeMillis != null) { + generator.writeKey("start_time_millis"); + generator.write(this.startTimeMillis); } - if (this.bytes != null) { - generator.writeKey("bytes"); - generator.write(this.bytes); + if (this.stopTime != null) { + generator.writeKey("stop_time"); + generator.write(this.stopTime); } - if (this.bytesRecovered != null) { - generator.writeKey("bytes_recovered"); - generator.write(this.bytesRecovered); + if (this.stopTimeMillis != null) { + generator.writeKey("stop_time_millis"); + generator.write(this.stopTimeMillis); } - if (this.bytesPercent != null) { - generator.writeKey("bytes_percent"); - generator.write(this.bytesPercent); + if (this.targetHost != null) { + generator.writeKey("target_host"); + generator.write(this.targetHost); } - if (this.bytesTotal != null) { - generator.writeKey("bytes_total"); - generator.write(this.bytesTotal); + if (this.targetNode != null) { + generator.writeKey("target_node"); + generator.write(this.targetNode); } + + if (this.time != null) { + generator.writeKey("time"); + this.time.serialize(generator, mapper); + } + if (this.translogOps != null) { generator.writeKey("translog_ops"); generator.write(this.translogOps); - } - if (this.translogOpsRecovered != null) { - generator.writeKey("translog_ops_recovered"); - generator.write(this.translogOpsRecovered); - } if (this.translogOpsPercent != null) { generator.writeKey("translog_ops_percent"); generator.write(this.translogOpsPercent); + } + if (this.translogOpsRecovered != null) { + generator.writeKey("translog_ops_recovered"); + generator.write(this.translogOpsRecovered); } + if (this.type != null) { + generator.writeKey("type"); + generator.write(this.type); + } } // --------------------------------------------------------------------------------------------- + @Override + @Nonnull + public Builder toBuilder() { + return new Builder(this); + } + + @Nonnull + public static Builder builder() { + return new Builder(); + } + /** * Builder for {@link RecoveryRecord}. */ - - public static class Builder extends ObjectBuilderBase implements ObjectBuilder { + public static class Builder extends ObjectBuilderBase implements CopyableBuilder { @Nullable - private String index; - + private String bytes; @Nullable - private String shard; - + private String bytesPercent; @Nullable - private String startTime; - + private String bytesRecovered; @Nullable - private String startTimeMillis; - + private String bytesTotal; @Nullable - private String stopTime; - + private String files; @Nullable - private String stopTimeMillis; - + private String filesPercent; @Nullable - private String time; - + private String filesRecovered; @Nullable - private String type; - + private String filesTotal; @Nullable - private String stage; - + private String index; + @Nullable + private String repository; + @Nullable + private String shard; + @Nullable + private String snapshot; @Nullable private String sourceHost; - @Nullable private String sourceNode; - @Nullable - private String targetHost; - + private String stage; @Nullable - private String targetNode; - + private String startTime; @Nullable - private String repository; - + private Long startTimeMillis; @Nullable - private String snapshot; - + private String stopTime; @Nullable - private String files; - + private Long stopTimeMillis; @Nullable - private String filesRecovered; - + private String targetHost; @Nullable - private String filesPercent; - + private String targetNode; @Nullable - private String filesTotal; - + private Time time; @Nullable - private String bytes; - + private String translogOps; @Nullable - private String bytesRecovered; - + private String translogOpsPercent; @Nullable - private String bytesPercent; - + private String translogOpsRecovered; @Nullable - private String bytesTotal; + private String type; - @Nullable - private String translogOps; + public Builder() {} + + private Builder(RecoveryRecord o) { + this.bytes = o.bytes; + this.bytesPercent = o.bytesPercent; + this.bytesRecovered = o.bytesRecovered; + this.bytesTotal = o.bytesTotal; + this.files = o.files; + this.filesPercent = o.filesPercent; + this.filesRecovered = o.filesRecovered; + this.filesTotal = o.filesTotal; + this.index = o.index; + this.repository = o.repository; + this.shard = o.shard; + this.snapshot = o.snapshot; + this.sourceHost = o.sourceHost; + this.sourceNode = o.sourceNode; + this.stage = o.stage; + this.startTime = o.startTime; + this.startTimeMillis = o.startTimeMillis; + this.stopTime = o.stopTime; + this.stopTimeMillis = o.stopTimeMillis; + this.targetHost = o.targetHost; + this.targetNode = o.targetNode; + this.time = o.time; + this.translogOps = o.translogOps; + this.translogOpsPercent = o.translogOpsPercent; + this.translogOpsRecovered = o.translogOpsRecovered; + this.type = o.type; + } - @Nullable - private String translogOpsRecovered; + private Builder(Builder o) { + this.bytes = o.bytes; + this.bytesPercent = o.bytesPercent; + this.bytesRecovered = o.bytesRecovered; + this.bytesTotal = o.bytesTotal; + this.files = o.files; + this.filesPercent = o.filesPercent; + this.filesRecovered = o.filesRecovered; + this.filesTotal = o.filesTotal; + this.index = o.index; + this.repository = o.repository; + this.shard = o.shard; + this.snapshot = o.snapshot; + this.sourceHost = o.sourceHost; + this.sourceNode = o.sourceNode; + this.stage = o.stage; + this.startTime = o.startTime; + this.startTimeMillis = o.startTimeMillis; + this.stopTime = o.stopTime; + this.stopTimeMillis = o.stopTimeMillis; + this.targetHost = o.targetHost; + this.targetNode = o.targetNode; + this.time = o.time; + this.translogOps = o.translogOps; + this.translogOpsPercent = o.translogOpsPercent; + this.translogOpsRecovered = o.translogOpsRecovered; + this.type = o.type; + } - @Nullable - private String translogOpsPercent; + @Override + @Nonnull + public Builder copy() { + return new Builder(this); + } /** - * index name + * The number of bytes to recover. *

- * API name: {@code index} + * API name: {@code bytes} + *

*/ - public final Builder index(@Nullable String value) { - this.index = value; + @Nonnull + public final Builder bytes(@Nullable String value) { + this.bytes = value; return this; } /** - * shard name - *

- * API name: {@code shard} + * API name: {@code bytes_percent} */ - public final Builder shard(@Nullable String value) { - this.shard = value; + @Nonnull + public final Builder bytesPercent(@Nullable String value) { + this.bytesPercent = value; return this; } /** - * recovery start time + * The bytes recovered. *

- * API name: {@code start_time} + * API name: {@code bytes_recovered} + *

*/ - public final Builder startTime(@Nullable String value) { - this.startTime = value; + @Nonnull + public final Builder bytesRecovered(@Nullable String value) { + this.bytesRecovered = value; return this; } /** - * recovery start time in epoch milliseconds + * The total number of bytes. *

- * API name: {@code start_time_millis} + * API name: {@code bytes_total} + *

*/ - public final Builder startTimeMillis(@Nullable String value) { - this.startTimeMillis = value; + @Nonnull + public final Builder bytesTotal(@Nullable String value) { + this.bytesTotal = value; return this; } /** - * recovery stop time + * The number of files to recover. *

- * API name: {@code stop_time} + * API name: {@code files} + *

*/ - public final Builder stopTime(@Nullable String value) { - this.stopTime = value; + @Nonnull + public final Builder files(@Nullable String value) { + this.files = value; return this; } /** - * recovery stop time in epoch milliseconds - *

- * API name: {@code stop_time_millis} + * API name: {@code files_percent} */ - public final Builder stopTimeMillis(@Nullable String value) { - this.stopTimeMillis = value; + @Nonnull + public final Builder filesPercent(@Nullable String value) { + this.filesPercent = value; return this; } /** - * recovery time + * The files recovered. *

- * API name: {@code time} + * API name: {@code files_recovered} + *

*/ - public final Builder time(@Nullable String value) { - this.time = value; + @Nonnull + public final Builder filesRecovered(@Nullable String value) { + this.filesRecovered = value; return this; } /** - * recovery type + * The total number of files. *

- * API name: {@code type} + * API name: {@code files_total} + *

*/ - public final Builder type(@Nullable String value) { - this.type = value; + @Nonnull + public final Builder filesTotal(@Nullable String value) { + this.filesTotal = value; return this; } /** - * recovery stage - *

- * API name: {@code stage} + * API name: {@code index} */ - public final Builder stage(@Nullable String value) { - this.stage = value; + @Nonnull + public final Builder index(@Nullable String value) { + this.index = value; return this; } /** - * source host + * The repository name. *

- * API name: {@code source_host} + * API name: {@code repository} + *

*/ - public final Builder sourceHost(@Nullable String value) { - this.sourceHost = value; + @Nonnull + public final Builder repository(@Nullable String value) { + this.repository = value; return this; } /** - * source node name + * The shard name. *

- * API name: {@code source_node} + * API name: {@code shard} + *

*/ - public final Builder sourceNode(@Nullable String value) { - this.sourceNode = value; + @Nonnull + public final Builder shard(@Nullable String value) { + this.shard = value; return this; } /** - * target host + * The snapshot name. *

- * API name: {@code target_host} + * API name: {@code snapshot} + *

*/ - public final Builder targetHost(@Nullable String value) { - this.targetHost = value; + @Nonnull + public final Builder snapshot(@Nullable String value) { + this.snapshot = value; return this; } /** - * target node name + * The source host. *

- * API name: {@code target_node} + * API name: {@code source_host} + *

*/ - public final Builder targetNode(@Nullable String value) { - this.targetNode = value; + @Nonnull + public final Builder sourceHost(@Nullable String value) { + this.sourceHost = value; return this; } /** - * repository + * The source node name. *

- * API name: {@code repository} + * API name: {@code source_node} + *

*/ - public final Builder repository(@Nullable String value) { - this.repository = value; + @Nonnull + public final Builder sourceNode(@Nullable String value) { + this.sourceNode = value; return this; } /** - * snapshot + * The recovery stage. *

- * API name: {@code snapshot} + * API name: {@code stage} + *

*/ - public final Builder snapshot(@Nullable String value) { - this.snapshot = value; + @Nonnull + public final Builder stage(@Nullable String value) { + this.stage = value; return this; } /** - * number of files to recover - *

- * API name: {@code files} + * API name: {@code start_time} */ - public final Builder files(@Nullable String value) { - this.files = value; + @Nonnull + public final Builder startTime(@Nullable String value) { + this.startTime = value; return this; } /** - * files recovered - *

- * API name: {@code files_recovered} + * API name: {@code start_time_millis} */ - public final Builder filesRecovered(@Nullable String value) { - this.filesRecovered = value; + @Nonnull + public final Builder startTimeMillis(@Nullable Long value) { + this.startTimeMillis = value; return this; } /** - * percent of files recovered - *

- * API name: {@code files_percent} + * API name: {@code stop_time} */ - public final Builder filesPercent(@Nullable String value) { - this.filesPercent = value; + @Nonnull + public final Builder stopTime(@Nullable String value) { + this.stopTime = value; return this; } /** - * total number of files - *

- * API name: {@code files_total} + * API name: {@code stop_time_millis} */ - public final Builder filesTotal(@Nullable String value) { - this.filesTotal = value; + @Nonnull + public final Builder stopTimeMillis(@Nullable Long value) { + this.stopTimeMillis = value; return this; } /** - * number of bytes to recover + * The target host. *

- * API name: {@code bytes} + * API name: {@code target_host} + *

*/ - public final Builder bytes(@Nullable String value) { - this.bytes = value; + @Nonnull + public final Builder targetHost(@Nullable String value) { + this.targetHost = value; return this; } /** - * bytes recovered + * The target node name. *

- * API name: {@code bytes_recovered} + * API name: {@code target_node} + *

*/ - public final Builder bytesRecovered(@Nullable String value) { - this.bytesRecovered = value; + @Nonnull + public final Builder targetNode(@Nullable String value) { + this.targetNode = value; return this; } /** - * percent of bytes recovered - *

- * API name: {@code bytes_percent} + * API name: {@code time} */ - public final Builder bytesPercent(@Nullable String value) { - this.bytesPercent = value; + @Nonnull + public final Builder time(@Nullable Time value) { + this.time = value; return this; } /** - * total number of bytes - *

- * API name: {@code bytes_total} + * API name: {@code time} */ - public final Builder bytesTotal(@Nullable String value) { - this.bytesTotal = value; - return this; + @Nonnull + public final Builder time(Function> fn) { + return time(fn.apply(new Time.Builder()).build()); } /** - * number of translog ops to recover + * The number of translog operations to recover. *

* API name: {@code translog_ops} + *

*/ + @Nonnull public final Builder translogOps(@Nullable String value) { this.translogOps = value; return this; } /** - * translog ops recovered + * API name: {@code translog_ops_percent} + */ + @Nonnull + public final Builder translogOpsPercent(@Nullable String value) { + this.translogOpsPercent = value; + return this; + } + + /** + * The translog operations recovered. *

* API name: {@code translog_ops_recovered} + *

*/ + @Nonnull public final Builder translogOpsRecovered(@Nullable String value) { this.translogOpsRecovered = value; return this; } /** - * percent of translog ops recovered + * The recovery type. *

- * API name: {@code translog_ops_percent} + * API name: {@code type} + *

*/ - public final Builder translogOpsPercent(@Nullable String value) { - this.translogOpsPercent = value; + @Nonnull + public final Builder type(@Nullable String value) { + this.type = value; return this; } /** * Builds a {@link RecoveryRecord}. * - * @throws NullPointerException - * if some of the required fields are null. + * @throws NullPointerException if some of the required fields are null. */ + @Override + @Nonnull public RecoveryRecord build() { _checkSingleUse(); @@ -936,34 +1028,96 @@ public RecoveryRecord build() { ); protected static void setupRecoveryRecordDeserializer(ObjectDeserializer op) { + op.add(Builder::bytes, JsonpDeserializer.stringDeserializer(), "bytes"); + op.add(Builder::bytesPercent, JsonpDeserializer.stringDeserializer(), "bytes_percent"); + op.add(Builder::bytesRecovered, JsonpDeserializer.stringDeserializer(), "bytes_recovered"); + op.add(Builder::bytesTotal, JsonpDeserializer.stringDeserializer(), "bytes_total"); + op.add(Builder::files, JsonpDeserializer.stringDeserializer(), "files"); + op.add(Builder::filesPercent, JsonpDeserializer.stringDeserializer(), "files_percent"); + op.add(Builder::filesRecovered, JsonpDeserializer.stringDeserializer(), "files_recovered"); + op.add(Builder::filesTotal, JsonpDeserializer.stringDeserializer(), "files_total"); + op.add(Builder::index, JsonpDeserializer.stringDeserializer(), "index"); + op.add(Builder::repository, JsonpDeserializer.stringDeserializer(), "repository"); + op.add(Builder::shard, JsonpDeserializer.stringDeserializer(), "shard"); + op.add(Builder::snapshot, JsonpDeserializer.stringDeserializer(), "snapshot"); + op.add(Builder::sourceHost, JsonpDeserializer.stringDeserializer(), "source_host"); + op.add(Builder::sourceNode, JsonpDeserializer.stringDeserializer(), "source_node"); + op.add(Builder::stage, JsonpDeserializer.stringDeserializer(), "stage"); + op.add(Builder::startTime, JsonpDeserializer.stringDeserializer(), "start_time"); + op.add(Builder::startTimeMillis, JsonpDeserializer.longDeserializer(), "start_time_millis"); + op.add(Builder::stopTime, JsonpDeserializer.stringDeserializer(), "stop_time"); + op.add(Builder::stopTimeMillis, JsonpDeserializer.longDeserializer(), "stop_time_millis"); + op.add(Builder::targetHost, JsonpDeserializer.stringDeserializer(), "target_host"); + op.add(Builder::targetNode, JsonpDeserializer.stringDeserializer(), "target_node"); + op.add(Builder::time, Time._DESERIALIZER, "time"); + op.add(Builder::translogOps, JsonpDeserializer.stringDeserializer(), "translog_ops"); + op.add(Builder::translogOpsPercent, JsonpDeserializer.stringDeserializer(), "translog_ops_percent"); + op.add(Builder::translogOpsRecovered, JsonpDeserializer.stringDeserializer(), "translog_ops_recovered"); + op.add(Builder::type, JsonpDeserializer.stringDeserializer(), "type"); + } - op.add(Builder::index, JsonpDeserializer.stringDeserializer(), "index", "i", "idx"); - op.add(Builder::shard, JsonpDeserializer.stringDeserializer(), "shard", "s", "sh"); - op.add(Builder::startTime, JsonpDeserializer.stringDeserializer(), "start_time", "start"); - op.add(Builder::startTimeMillis, JsonpDeserializer.stringDeserializer(), "start_time_millis", "start_millis"); - op.add(Builder::stopTime, JsonpDeserializer.stringDeserializer(), "stop_time", "stop"); - op.add(Builder::stopTimeMillis, JsonpDeserializer.stringDeserializer(), "stop_time_millis", "stop_millis"); - op.add(Builder::time, JsonpDeserializer.stringDeserializer(), "time", "t", "ti"); - op.add(Builder::type, JsonpDeserializer.stringDeserializer(), "type", "ty"); - op.add(Builder::stage, JsonpDeserializer.stringDeserializer(), "stage", "st"); - op.add(Builder::sourceHost, JsonpDeserializer.stringDeserializer(), "source_host", "shost"); - op.add(Builder::sourceNode, JsonpDeserializer.stringDeserializer(), "source_node", "snode"); - op.add(Builder::targetHost, JsonpDeserializer.stringDeserializer(), "target_host", "thost"); - op.add(Builder::targetNode, JsonpDeserializer.stringDeserializer(), "target_node", "tnode"); - op.add(Builder::repository, JsonpDeserializer.stringDeserializer(), "repository", "rep"); - op.add(Builder::snapshot, JsonpDeserializer.stringDeserializer(), "snapshot", "snap"); - op.add(Builder::files, JsonpDeserializer.stringDeserializer(), "files", "f"); - op.add(Builder::filesRecovered, JsonpDeserializer.stringDeserializer(), "files_recovered", "fr"); - op.add(Builder::filesPercent, JsonpDeserializer.stringDeserializer(), "files_percent", "fp"); - op.add(Builder::filesTotal, JsonpDeserializer.stringDeserializer(), "files_total", "tf"); - op.add(Builder::bytes, JsonpDeserializer.stringDeserializer(), "bytes", "b"); - op.add(Builder::bytesRecovered, JsonpDeserializer.stringDeserializer(), "bytes_recovered", "br"); - op.add(Builder::bytesPercent, JsonpDeserializer.stringDeserializer(), "bytes_percent", "bp"); - op.add(Builder::bytesTotal, JsonpDeserializer.stringDeserializer(), "bytes_total", "tb"); - op.add(Builder::translogOps, JsonpDeserializer.stringDeserializer(), "translog_ops", "to"); - op.add(Builder::translogOpsRecovered, JsonpDeserializer.stringDeserializer(), "translog_ops_recovered", "tor"); - op.add(Builder::translogOpsPercent, JsonpDeserializer.stringDeserializer(), "translog_ops_percent", "top"); - + @Override + public int hashCode() { + int result = 17; + result = 31 * result + Objects.hashCode(this.bytes); + result = 31 * result + Objects.hashCode(this.bytesPercent); + result = 31 * result + Objects.hashCode(this.bytesRecovered); + result = 31 * result + Objects.hashCode(this.bytesTotal); + result = 31 * result + Objects.hashCode(this.files); + result = 31 * result + Objects.hashCode(this.filesPercent); + result = 31 * result + Objects.hashCode(this.filesRecovered); + result = 31 * result + Objects.hashCode(this.filesTotal); + result = 31 * result + Objects.hashCode(this.index); + result = 31 * result + Objects.hashCode(this.repository); + result = 31 * result + Objects.hashCode(this.shard); + result = 31 * result + Objects.hashCode(this.snapshot); + result = 31 * result + Objects.hashCode(this.sourceHost); + result = 31 * result + Objects.hashCode(this.sourceNode); + result = 31 * result + Objects.hashCode(this.stage); + result = 31 * result + Objects.hashCode(this.startTime); + result = 31 * result + Objects.hashCode(this.startTimeMillis); + result = 31 * result + Objects.hashCode(this.stopTime); + result = 31 * result + Objects.hashCode(this.stopTimeMillis); + result = 31 * result + Objects.hashCode(this.targetHost); + result = 31 * result + Objects.hashCode(this.targetNode); + result = 31 * result + Objects.hashCode(this.time); + result = 31 * result + Objects.hashCode(this.translogOps); + result = 31 * result + Objects.hashCode(this.translogOpsPercent); + result = 31 * result + Objects.hashCode(this.translogOpsRecovered); + result = 31 * result + Objects.hashCode(this.type); + return result; } + @Override + public boolean equals(Object o) { + if (this == o) return true; + if (o == null || this.getClass() != o.getClass()) return false; + RecoveryRecord other = (RecoveryRecord) o; + return Objects.equals(this.bytes, other.bytes) + && Objects.equals(this.bytesPercent, other.bytesPercent) + && Objects.equals(this.bytesRecovered, other.bytesRecovered) + && Objects.equals(this.bytesTotal, other.bytesTotal) + && Objects.equals(this.files, other.files) + && Objects.equals(this.filesPercent, other.filesPercent) + && Objects.equals(this.filesRecovered, other.filesRecovered) + && Objects.equals(this.filesTotal, other.filesTotal) + && Objects.equals(this.index, other.index) + && Objects.equals(this.repository, other.repository) + && Objects.equals(this.shard, other.shard) + && Objects.equals(this.snapshot, other.snapshot) + && Objects.equals(this.sourceHost, other.sourceHost) + && Objects.equals(this.sourceNode, other.sourceNode) + && Objects.equals(this.stage, other.stage) + && Objects.equals(this.startTime, other.startTime) + && Objects.equals(this.startTimeMillis, other.startTimeMillis) + && Objects.equals(this.stopTime, other.stopTime) + && Objects.equals(this.stopTimeMillis, other.stopTimeMillis) + && Objects.equals(this.targetHost, other.targetHost) + && Objects.equals(this.targetNode, other.targetNode) + && Objects.equals(this.time, other.time) + && Objects.equals(this.translogOps, other.translogOps) + && Objects.equals(this.translogOpsPercent, other.translogOpsPercent) + && Objects.equals(this.translogOpsRecovered, other.translogOpsRecovered) + && Objects.equals(this.type, other.type); + } } diff --git a/java-client/src/main/java/org/opensearch/client/opensearch/cat/repositories/RepositoriesRecord.java b/java-client/src/generated/java/org/opensearch/client/opensearch/cat/repositories/RepositoriesRecord.java similarity index 68% rename from java-client/src/main/java/org/opensearch/client/opensearch/cat/repositories/RepositoriesRecord.java rename to java-client/src/generated/java/org/opensearch/client/opensearch/cat/repositories/RepositoriesRecord.java index 24a236b59e..08a72d6f0c 100644 --- a/java-client/src/main/java/org/opensearch/client/opensearch/cat/repositories/RepositoriesRecord.java +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/cat/repositories/RepositoriesRecord.java @@ -30,10 +30,17 @@ * GitHub history for details. */ +//---------------------------------------------------- +// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. +//---------------------------------------------------- + package org.opensearch.client.opensearch.cat.repositories; import jakarta.json.stream.JsonGenerator; +import java.util.Objects; import java.util.function.Function; +import javax.annotation.Generated; +import javax.annotation.Nonnull; import javax.annotation.Nullable; import org.opensearch.client.json.JsonpDeserializable; import org.opensearch.client.json.JsonpDeserializer; @@ -41,13 +48,17 @@ import org.opensearch.client.json.ObjectBuilderDeserializer; import org.opensearch.client.json.ObjectDeserializer; import org.opensearch.client.json.PlainJsonSerializable; +import org.opensearch.client.util.CopyableBuilder; import org.opensearch.client.util.ObjectBuilder; import org.opensearch.client.util.ObjectBuilderBase; +import org.opensearch.client.util.ToCopyableBuilder; // typedef: cat.repositories.RepositoriesRecord @JsonpDeserializable -public class RepositoriesRecord implements PlainJsonSerializable { +@Generated("org.opensearch.client.codegen.CodeGenerator") +public class RepositoriesRecord implements PlainJsonSerializable, ToCopyableBuilder { + @Nullable private final String id; @@ -57,20 +68,19 @@ public class RepositoriesRecord implements PlainJsonSerializable { // --------------------------------------------------------------------------------------------- private RepositoriesRecord(Builder builder) { - this.id = builder.id; this.type = builder.type; - } - public static RepositoriesRecord of(Function> fn) { + public static RepositoriesRecord of(Function> fn) { return fn.apply(new Builder()).build(); } /** - * unique repository id + * The unique repository identifier. *

* API name: {@code id} + *

*/ @Nullable public final String id() { @@ -78,9 +88,10 @@ public final String id() { } /** - * repository type + * The repository type. *

* API name: {@code type} + *

*/ @Nullable public final String type() { @@ -90,6 +101,7 @@ public final String type() { /** * Serialize this object to JSON. */ + @Override public void serialize(JsonGenerator generator, JsonpMapper mapper) { generator.writeStartObject(); serializeInternal(generator, mapper); @@ -97,48 +109,76 @@ public void serialize(JsonGenerator generator, JsonpMapper mapper) { } protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { - if (this.id != null) { generator.writeKey("id"); generator.write(this.id); - } + if (this.type != null) { generator.writeKey("type"); generator.write(this.type); - } - } // --------------------------------------------------------------------------------------------- + @Override + @Nonnull + public Builder toBuilder() { + return new Builder(this); + } + + @Nonnull + public static Builder builder() { + return new Builder(); + } + /** * Builder for {@link RepositoriesRecord}. */ - - public static class Builder extends ObjectBuilderBase implements ObjectBuilder { + public static class Builder extends ObjectBuilderBase implements CopyableBuilder { @Nullable private String id; - @Nullable private String type; + public Builder() {} + + private Builder(RepositoriesRecord o) { + this.id = o.id; + this.type = o.type; + } + + private Builder(Builder o) { + this.id = o.id; + this.type = o.type; + } + + @Override + @Nonnull + public Builder copy() { + return new Builder(this); + } + /** - * unique repository id + * The unique repository identifier. *

* API name: {@code id} + *

*/ + @Nonnull public final Builder id(@Nullable String value) { this.id = value; return this; } /** - * repository type + * The repository type. *

* API name: {@code type} + *

*/ + @Nonnull public final Builder type(@Nullable String value) { this.type = value; return this; @@ -147,9 +187,10 @@ public final Builder type(@Nullable String value) { /** * Builds a {@link RepositoriesRecord}. * - * @throws NullPointerException - * if some of the required fields are null. + * @throws NullPointerException if some of the required fields are null. */ + @Override + @Nonnull public RepositoriesRecord build() { _checkSingleUse(); @@ -168,10 +209,23 @@ public RepositoriesRecord build() { ); protected static void setupRepositoriesRecordDeserializer(ObjectDeserializer op) { + op.add(Builder::id, JsonpDeserializer.stringDeserializer(), "id"); + op.add(Builder::type, JsonpDeserializer.stringDeserializer(), "type"); + } - op.add(Builder::id, JsonpDeserializer.stringDeserializer(), "id", "repoId"); - op.add(Builder::type, JsonpDeserializer.stringDeserializer(), "type", "t"); - + @Override + public int hashCode() { + int result = 17; + result = 31 * result + Objects.hashCode(this.id); + result = 31 * result + Objects.hashCode(this.type); + return result; } + @Override + public boolean equals(Object o) { + if (this == o) return true; + if (o == null || this.getClass() != o.getClass()) return false; + RepositoriesRecord other = (RepositoriesRecord) o; + return Objects.equals(this.id, other.id) && Objects.equals(this.type, other.type); + } } diff --git a/java-client/src/main/java/org/opensearch/client/opensearch/cat/OpenSearchCatAsyncClient.java b/java-client/src/main/java/org/opensearch/client/opensearch/cat/OpenSearchCatAsyncClient.java index 2ef05358f1..15fb114489 100644 --- a/java-client/src/main/java/org/opensearch/client/opensearch/cat/OpenSearchCatAsyncClient.java +++ b/java-client/src/main/java/org/opensearch/client/opensearch/cat/OpenSearchCatAsyncClient.java @@ -72,101 +72,6 @@ public CompletableFuture help() throws IOException, OpenSearchExce return this.transport.performRequestAsync(HelpRequest._INSTANCE, HelpRequest._ENDPOINT, this.transportOptions); } - // ----- Endpoint: cat.recovery - - /** - * Returns information about index shard recoveries, both on-going completed. - * - * - */ - - public CompletableFuture recovery(RecoveryRequest request) throws IOException, OpenSearchException { - @SuppressWarnings("unchecked") - JsonEndpoint endpoint = (JsonEndpoint< - RecoveryRequest, - RecoveryResponse, - ErrorResponse>) RecoveryRequest._ENDPOINT; - - return this.transport.performRequestAsync(request, endpoint, this.transportOptions); - } - - /** - * Returns information about index shard recoveries, both on-going completed. - * - * @param fn - * a function that initializes a builder to create the - * {@link RecoveryRequest} - * - */ - - public final CompletableFuture recovery(Function> fn) - throws IOException, OpenSearchException { - return recovery(fn.apply(new RecoveryRequest.Builder()).build()); - } - - /** - * Returns information about index shard recoveries, both on-going completed. - * - * - */ - - public CompletableFuture recovery() throws IOException, OpenSearchException { - return this.transport.performRequestAsync(new RecoveryRequest.Builder().build(), RecoveryRequest._ENDPOINT, this.transportOptions); - } - - // ----- Endpoint: cat.repositories - - /** - * Returns information about snapshot repositories registered in the cluster. - * - * - */ - public CompletableFuture repositories() throws IOException, OpenSearchException { - return this.transport.performRequestAsync(RepositoriesRequest._INSTANCE, RepositoriesRequest._ENDPOINT, this.transportOptions); - } - - // ----- Endpoint: cat.segments - - /** - * Provides low-level information about the segments in the shards of an index. - * - * - */ - - public CompletableFuture segments(SegmentsRequest request) throws IOException, OpenSearchException { - @SuppressWarnings("unchecked") - JsonEndpoint endpoint = (JsonEndpoint< - SegmentsRequest, - SegmentsResponse, - ErrorResponse>) SegmentsRequest._ENDPOINT; - - return this.transport.performRequestAsync(request, endpoint, this.transportOptions); - } - - /** - * Provides low-level information about the segments in the shards of an index. - * - * @param fn - * a function that initializes a builder to create the - * {@link SegmentsRequest} - * - */ - - public final CompletableFuture segments(Function> fn) - throws IOException, OpenSearchException { - return segments(fn.apply(new SegmentsRequest.Builder()).build()); - } - - /** - * Provides low-level information about the segments in the shards of an index. - * - * - */ - - public CompletableFuture segments() throws IOException, OpenSearchException { - return this.transport.performRequestAsync(new SegmentsRequest.Builder().build(), SegmentsRequest._ENDPOINT, this.transportOptions); - } - // ----- Endpoint: cat.shards /** diff --git a/java-client/src/main/java/org/opensearch/client/opensearch/cat/OpenSearchCatClient.java b/java-client/src/main/java/org/opensearch/client/opensearch/cat/OpenSearchCatClient.java index 477cc78073..b12dc4dbc2 100644 --- a/java-client/src/main/java/org/opensearch/client/opensearch/cat/OpenSearchCatClient.java +++ b/java-client/src/main/java/org/opensearch/client/opensearch/cat/OpenSearchCatClient.java @@ -71,101 +71,6 @@ public HelpResponse help() throws IOException, OpenSearchException { return this.transport.performRequest(HelpRequest._INSTANCE, HelpRequest._ENDPOINT, this.transportOptions); } - // ----- Endpoint: cat.recovery - - /** - * Returns information about index shard recoveries, both on-going completed. - * - * - */ - - public RecoveryResponse recovery(RecoveryRequest request) throws IOException, OpenSearchException { - @SuppressWarnings("unchecked") - JsonEndpoint endpoint = (JsonEndpoint< - RecoveryRequest, - RecoveryResponse, - ErrorResponse>) RecoveryRequest._ENDPOINT; - - return this.transport.performRequest(request, endpoint, this.transportOptions); - } - - /** - * Returns information about index shard recoveries, both on-going completed. - * - * @param fn - * a function that initializes a builder to create the - * {@link RecoveryRequest} - * - */ - - public final RecoveryResponse recovery(Function> fn) throws IOException, - OpenSearchException { - return recovery(fn.apply(new RecoveryRequest.Builder()).build()); - } - - /** - * Returns information about index shard recoveries, both on-going completed. - * - * - */ - - public RecoveryResponse recovery() throws IOException, OpenSearchException { - return this.transport.performRequest(new RecoveryRequest.Builder().build(), RecoveryRequest._ENDPOINT, this.transportOptions); - } - - // ----- Endpoint: cat.repositories - - /** - * Returns information about snapshot repositories registered in the cluster. - * - * - */ - public RepositoriesResponse repositories() throws IOException, OpenSearchException { - return this.transport.performRequest(RepositoriesRequest._INSTANCE, RepositoriesRequest._ENDPOINT, this.transportOptions); - } - - // ----- Endpoint: cat.segments - - /** - * Provides low-level information about the segments in the shards of an index. - * - * - */ - - public SegmentsResponse segments(SegmentsRequest request) throws IOException, OpenSearchException { - @SuppressWarnings("unchecked") - JsonEndpoint endpoint = (JsonEndpoint< - SegmentsRequest, - SegmentsResponse, - ErrorResponse>) SegmentsRequest._ENDPOINT; - - return this.transport.performRequest(request, endpoint, this.transportOptions); - } - - /** - * Provides low-level information about the segments in the shards of an index. - * - * @param fn - * a function that initializes a builder to create the - * {@link SegmentsRequest} - * - */ - - public final SegmentsResponse segments(Function> fn) throws IOException, - OpenSearchException { - return segments(fn.apply(new SegmentsRequest.Builder()).build()); - } - - /** - * Provides low-level information about the segments in the shards of an index. - * - * - */ - - public SegmentsResponse segments() throws IOException, OpenSearchException { - return this.transport.performRequest(new SegmentsRequest.Builder().build(), SegmentsRequest._ENDPOINT, this.transportOptions); - } - // ----- Endpoint: cat.shards /** diff --git a/java-client/src/main/java/org/opensearch/client/opensearch/cat/RepositoriesRequest.java b/java-client/src/main/java/org/opensearch/client/opensearch/cat/RepositoriesRequest.java deleted file mode 100644 index a46803f881..0000000000 --- a/java-client/src/main/java/org/opensearch/client/opensearch/cat/RepositoriesRequest.java +++ /dev/null @@ -1,80 +0,0 @@ -/* - * SPDX-License-Identifier: Apache-2.0 - * - * The OpenSearch Contributors require contributions made to - * this file be licensed under the Apache-2.0 license or a - * compatible open source license. - */ - -/* - * Licensed to Elasticsearch B.V. under one or more contributor - * license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright - * ownership. Elasticsearch B.V. licenses this file to you under - * the Apache License, Version 2.0 (the "License"); you may - * not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -/* - * Modifications Copyright OpenSearch Contributors. See - * GitHub history for details. - */ - -package org.opensearch.client.opensearch.cat; - -import java.util.HashMap; -import org.opensearch.client.opensearch._types.ErrorResponse; -import org.opensearch.client.transport.Endpoint; -import org.opensearch.client.transport.endpoints.SimpleEndpoint; - -// typedef: cat.repositories.Request - -/** - * Returns information about snapshot repositories registered in the cluster. - * - */ - -public class RepositoriesRequest extends CatRequestBase { - public RepositoriesRequest() {} - - /** - * Singleton instance for {@link RepositoriesRequest}. - */ - public static final RepositoriesRequest _INSTANCE = new RepositoriesRequest(); - - // --------------------------------------------------------------------------------------------- - - /** - * Endpoint "{@code cat.repositories}". - */ - public static final Endpoint _ENDPOINT = new SimpleEndpoint<>( - - // Request method - request -> { - return "GET"; - - }, - - // Request path - request -> { - return "/_cat/repositories"; - - }, - - // Request parameters - request -> new HashMap<>(request.queryParameters()), - SimpleEndpoint.emptyMap(), - false, - RepositoriesResponse._DESERIALIZER - ); -} diff --git a/java-client/src/main/java/org/opensearch/client/opensearch/cat/SegmentsRequest.java b/java-client/src/main/java/org/opensearch/client/opensearch/cat/SegmentsRequest.java deleted file mode 100644 index 20e4560b66..0000000000 --- a/java-client/src/main/java/org/opensearch/client/opensearch/cat/SegmentsRequest.java +++ /dev/null @@ -1,210 +0,0 @@ -/* - * SPDX-License-Identifier: Apache-2.0 - * - * The OpenSearch Contributors require contributions made to - * this file be licensed under the Apache-2.0 license or a - * compatible open source license. - */ - -/* - * Licensed to Elasticsearch B.V. under one or more contributor - * license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright - * ownership. Elasticsearch B.V. licenses this file to you under - * the Apache License, Version 2.0 (the "License"); you may - * not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -/* - * Modifications Copyright OpenSearch Contributors. See - * GitHub history for details. - */ - -package org.opensearch.client.opensearch.cat; - -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.function.Function; -import java.util.stream.Collectors; -import javax.annotation.Nullable; -import org.opensearch.client.opensearch._types.Bytes; -import org.opensearch.client.opensearch._types.ErrorResponse; -import org.opensearch.client.transport.Endpoint; -import org.opensearch.client.transport.endpoints.SimpleEndpoint; -import org.opensearch.client.util.ApiTypeHelper; -import org.opensearch.client.util.ObjectBuilder; - -// typedef: cat.segments.Request - -/** - * Provides low-level information about the segments in the shards of an index. - * - */ - -public class SegmentsRequest extends CatRequestBase { - @Nullable - private final Bytes bytes; - - private final List index; - - // --------------------------------------------------------------------------------------------- - - private SegmentsRequest(Builder builder) { - super(builder); - this.bytes = builder.bytes; - this.index = ApiTypeHelper.unmodifiable(builder.index); - - } - - public static SegmentsRequest of(Function> fn) { - return fn.apply(new Builder()).build(); - } - - /** - * The unit in which to display byte values - *

- * API name: {@code bytes} - */ - @Nullable - public final Bytes bytes() { - return this.bytes; - } - - /** - * A comma-separated list of index names to limit the returned information - *

- * API name: {@code index} - */ - public final List index() { - return this.index; - } - - // --------------------------------------------------------------------------------------------- - - /** - * Builder for {@link SegmentsRequest}. - */ - - public static class Builder extends CatRequestBaseBuilder { - @Nullable - private Bytes bytes; - - @Nullable - private List index; - - /** - * The unit in which to display byte values - *

- * API name: {@code bytes} - */ - public final Builder bytes(@Nullable Bytes value) { - this.bytes = value; - return this; - } - - /** - * A comma-separated list of index names to limit the returned information - *

- * API name: {@code index} - *

- * Adds all elements of list to index. - */ - public final Builder index(List list) { - this.index = _listAddAll(this.index, list); - return this; - } - - /** - * A comma-separated list of index names to limit the returned information - *

- * API name: {@code index} - *

- * Adds one or more values to index. - */ - public final Builder index(String value, String... values) { - this.index = _listAdd(this.index, value, values); - return this; - } - - /** - * Builds a {@link SegmentsRequest}. - * - * @throws NullPointerException - * if some of the required fields are null. - */ - public SegmentsRequest build() { - _checkSingleUse(); - - return new SegmentsRequest(this); - } - - @Override - protected Builder self() { - return this; - } - } - - // --------------------------------------------------------------------------------------------- - - /** - * Endpoint "{@code cat.segments}". - */ - public static final Endpoint _ENDPOINT = new SimpleEndpoint<>( - - // Request method - request -> { - return "GET"; - - }, - - // Request path - request -> { - final int _index = 1 << 0; - - int propsSet = 0; - - if (ApiTypeHelper.isDefined(request.index())) propsSet |= _index; - - if (propsSet == 0) { - StringBuilder buf = new StringBuilder(); - buf.append("/_cat"); - buf.append("/segments"); - return buf.toString(); - } - if (propsSet == (_index)) { - StringBuilder buf = new StringBuilder(); - buf.append("/_cat"); - buf.append("/segments"); - buf.append("/"); - SimpleEndpoint.pathEncode(request.index.stream().map(v -> v).collect(Collectors.joining(",")), buf); - return buf.toString(); - } - throw SimpleEndpoint.noPathTemplateFound("path"); - - }, - - // Request parameters - request -> { - Map params = new HashMap<>(request.queryParameters()); - if (request.bytes != null) { - params.put("bytes", request.bytes.jsonValue()); - } - return params; - - }, - SimpleEndpoint.emptyMap(), - false, - SegmentsResponse._DESERIALIZER - ); -} diff --git a/java-codegen/src/main/java/org/opensearch/client/codegen/CodeGenerator.java b/java-codegen/src/main/java/org/opensearch/client/codegen/CodeGenerator.java index 25304cda5e..98e25c103e 100644 --- a/java-codegen/src/main/java/org/opensearch/client/codegen/CodeGenerator.java +++ b/java-codegen/src/main/java/org/opensearch/client/codegen/CodeGenerator.java @@ -65,7 +65,10 @@ public class CodeGenerator { "nodes", "pending_tasks", "pit_segments", - "plugins" + "plugins", + "recovery", + "repositories", + "segments" ) ) ), From b705aa52d37f7649f645de5d9824f50ef064e6ed Mon Sep 17 00:00:00 2001 From: Thomas Farr Date: Tue, 7 Jan 2025 22:36:09 +1300 Subject: [PATCH 12/18] Generate cat.shards, cat.snapshots & cat.tasks Signed-off-by: Thomas Farr --- .../cat/OpenSearchCatAsyncClientBase.java | 78 + .../cat/OpenSearchCatClientBase.java | 78 + .../client/opensearch/cat/ShardsRequest.java | 414 +++ .../client/opensearch/cat/ShardsResponse.java | 74 +- .../opensearch/cat/SnapshotsRequest.java | 413 +++ .../opensearch/cat/SnapshotsResponse.java | 74 +- .../client/opensearch/cat/TasksRequest.java | 394 +++ .../client/opensearch/cat/TasksResponse.java | 74 +- .../opensearch/cat/shards/ShardsRecord.java | 2983 +++++++++++------ .../cat/snapshots/SnapshotsRecord.java | 538 +-- .../opensearch/cat/tasks/TasksRecord.java | 605 ++-- .../cat/OpenSearchCatAsyncClient.java | 133 - .../opensearch/cat/OpenSearchCatClient.java | 129 - .../client/opensearch/cat/ShardsRequest.java | 210 -- .../opensearch/cat/SnapshotsRequest.java | 209 -- .../client/opensearch/cat/TasksRequest.java | 258 -- java-codegen/opensearch-openapi.yaml | 2 +- .../client/codegen/CodeGenerator.java | 5 +- 18 files changed, 4106 insertions(+), 2565 deletions(-) create mode 100644 java-client/src/generated/java/org/opensearch/client/opensearch/cat/ShardsRequest.java rename java-client/src/{main => generated}/java/org/opensearch/client/opensearch/cat/ShardsResponse.java (75%) create mode 100644 java-client/src/generated/java/org/opensearch/client/opensearch/cat/SnapshotsRequest.java rename java-client/src/{main => generated}/java/org/opensearch/client/opensearch/cat/SnapshotsResponse.java (75%) create mode 100644 java-client/src/generated/java/org/opensearch/client/opensearch/cat/TasksRequest.java rename java-client/src/{main => generated}/java/org/opensearch/client/opensearch/cat/TasksResponse.java (75%) rename java-client/src/{main => generated}/java/org/opensearch/client/opensearch/cat/shards/ShardsRecord.java (55%) rename java-client/src/{main => generated}/java/org/opensearch/client/opensearch/cat/snapshots/SnapshotsRecord.java (65%) rename java-client/src/{main => generated}/java/org/opensearch/client/opensearch/cat/tasks/TasksRecord.java (68%) delete mode 100644 java-client/src/main/java/org/opensearch/client/opensearch/cat/ShardsRequest.java delete mode 100644 java-client/src/main/java/org/opensearch/client/opensearch/cat/SnapshotsRequest.java delete mode 100644 java-client/src/main/java/org/opensearch/client/opensearch/cat/TasksRequest.java diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/cat/OpenSearchCatAsyncClientBase.java b/java-client/src/generated/java/org/opensearch/client/opensearch/cat/OpenSearchCatAsyncClientBase.java index 8af7a12aec..15130ac692 100644 --- a/java-client/src/generated/java/org/opensearch/client/opensearch/cat/OpenSearchCatAsyncClientBase.java +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/cat/OpenSearchCatAsyncClientBase.java @@ -503,4 +503,82 @@ public final CompletableFuture segments(Function segments() throws IOException, OpenSearchException { return segments(new SegmentsRequest.Builder().build()); } + + // ----- Endpoint: cat.shards + + /** + * Lists the states of all primary and replica shards and how they are distributed. + */ + public CompletableFuture shards(ShardsRequest request) throws IOException, OpenSearchException { + return this.transport.performRequestAsync(request, ShardsRequest._ENDPOINT, this.transportOptions); + } + + /** + * Lists the states of all primary and replica shards and how they are distributed. + * + * @param fn a function that initializes a builder to create the {@link ShardsRequest} + */ + public final CompletableFuture shards(Function> fn) + throws IOException, OpenSearchException { + return shards(fn.apply(new ShardsRequest.Builder()).build()); + } + + /** + * Lists the states of all primary and replica shards and how they are distributed. + */ + public final CompletableFuture shards() throws IOException, OpenSearchException { + return shards(new ShardsRequest.Builder().build()); + } + + // ----- Endpoint: cat.snapshots + + /** + * Lists all of the snapshots stored in a specific repository. + */ + public CompletableFuture snapshots(SnapshotsRequest request) throws IOException, OpenSearchException { + return this.transport.performRequestAsync(request, SnapshotsRequest._ENDPOINT, this.transportOptions); + } + + /** + * Lists all of the snapshots stored in a specific repository. + * + * @param fn a function that initializes a builder to create the {@link SnapshotsRequest} + */ + public final CompletableFuture snapshots(Function> fn) + throws IOException, OpenSearchException { + return snapshots(fn.apply(new SnapshotsRequest.Builder()).build()); + } + + /** + * Lists all of the snapshots stored in a specific repository. + */ + public final CompletableFuture snapshots() throws IOException, OpenSearchException { + return snapshots(new SnapshotsRequest.Builder().build()); + } + + // ----- Endpoint: cat.tasks + + /** + * Lists the progress of all tasks currently running on the cluster. + */ + public CompletableFuture tasks(TasksRequest request) throws IOException, OpenSearchException { + return this.transport.performRequestAsync(request, TasksRequest._ENDPOINT, this.transportOptions); + } + + /** + * Lists the progress of all tasks currently running on the cluster. + * + * @param fn a function that initializes a builder to create the {@link TasksRequest} + */ + public final CompletableFuture tasks(Function> fn) throws IOException, + OpenSearchException { + return tasks(fn.apply(new TasksRequest.Builder()).build()); + } + + /** + * Lists the progress of all tasks currently running on the cluster. + */ + public final CompletableFuture tasks() throws IOException, OpenSearchException { + return tasks(new TasksRequest.Builder().build()); + } } diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/cat/OpenSearchCatClientBase.java b/java-client/src/generated/java/org/opensearch/client/opensearch/cat/OpenSearchCatClientBase.java index be8c9b1e05..4038bae1a2 100644 --- a/java-client/src/generated/java/org/opensearch/client/opensearch/cat/OpenSearchCatClientBase.java +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/cat/OpenSearchCatClientBase.java @@ -495,4 +495,82 @@ public final SegmentsResponse segments(Function> fn) throws IOException, + OpenSearchException { + return shards(fn.apply(new ShardsRequest.Builder()).build()); + } + + /** + * Lists the states of all primary and replica shards and how they are distributed. + */ + public final ShardsResponse shards() throws IOException, OpenSearchException { + return shards(new ShardsRequest.Builder().build()); + } + + // ----- Endpoint: cat.snapshots + + /** + * Lists all of the snapshots stored in a specific repository. + */ + public SnapshotsResponse snapshots(SnapshotsRequest request) throws IOException, OpenSearchException { + return this.transport.performRequest(request, SnapshotsRequest._ENDPOINT, this.transportOptions); + } + + /** + * Lists all of the snapshots stored in a specific repository. + * + * @param fn a function that initializes a builder to create the {@link SnapshotsRequest} + */ + public final SnapshotsResponse snapshots(Function> fn) throws IOException, + OpenSearchException { + return snapshots(fn.apply(new SnapshotsRequest.Builder()).build()); + } + + /** + * Lists all of the snapshots stored in a specific repository. + */ + public final SnapshotsResponse snapshots() throws IOException, OpenSearchException { + return snapshots(new SnapshotsRequest.Builder().build()); + } + + // ----- Endpoint: cat.tasks + + /** + * Lists the progress of all tasks currently running on the cluster. + */ + public TasksResponse tasks(TasksRequest request) throws IOException, OpenSearchException { + return this.transport.performRequest(request, TasksRequest._ENDPOINT, this.transportOptions); + } + + /** + * Lists the progress of all tasks currently running on the cluster. + * + * @param fn a function that initializes a builder to create the {@link TasksRequest} + */ + public final TasksResponse tasks(Function> fn) throws IOException, + OpenSearchException { + return tasks(fn.apply(new TasksRequest.Builder()).build()); + } + + /** + * Lists the progress of all tasks currently running on the cluster. + */ + public final TasksResponse tasks() throws IOException, OpenSearchException { + return tasks(new TasksRequest.Builder().build()); + } } diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/cat/ShardsRequest.java b/java-client/src/generated/java/org/opensearch/client/opensearch/cat/ShardsRequest.java new file mode 100644 index 0000000000..27cc6565de --- /dev/null +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/cat/ShardsRequest.java @@ -0,0 +1,414 @@ +/* + * SPDX-License-Identifier: Apache-2.0 + * + * The OpenSearch Contributors require contributions made to + * this file be licensed under the Apache-2.0 license or a + * compatible open source license. + */ + +/* + * Licensed to Elasticsearch B.V. under one or more contributor + * license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright + * ownership. Elasticsearch B.V. licenses this file to you under + * the Apache License, Version 2.0 (the "License"); you may + * not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +/* + * Modifications Copyright OpenSearch Contributors. See + * GitHub history for details. + */ + +//---------------------------------------------------- +// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. +//---------------------------------------------------- + +package org.opensearch.client.opensearch.cat; + +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.function.Function; +import javax.annotation.Generated; +import javax.annotation.Nonnull; +import javax.annotation.Nullable; +import org.opensearch.client.opensearch._types.Bytes; +import org.opensearch.client.opensearch._types.ErrorResponse; +import org.opensearch.client.opensearch._types.Time; +import org.opensearch.client.opensearch._types.TimeUnit; +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.ToCopyableBuilder; + +// typedef: cat.shards.Request + +/** + * Lists the states of all primary and replica shards and how they are distributed. + */ +@Generated("org.opensearch.client.codegen.CodeGenerator") +public final class ShardsRequest extends CatRequestBase implements ToCopyableBuilder { + + @Nullable + private final Bytes bytes; + + @Nullable + private final Time clusterManagerTimeout; + + @Nonnull + private final List index; + + @Deprecated + @Nullable + private final Time masterTimeout; + + @Nullable + private final TimeUnit time; + + // --------------------------------------------------------------------------------------------- + + private ShardsRequest(Builder builder) { + super(builder); + this.bytes = builder.bytes; + this.clusterManagerTimeout = builder.clusterManagerTimeout; + this.index = ApiTypeHelper.unmodifiable(builder.index); + this.masterTimeout = builder.masterTimeout; + this.time = builder.time; + } + + public static ShardsRequest of(Function> fn) { + return fn.apply(new Builder()).build(); + } + + /** + * The units used to display byte values. + *

+ * API name: {@code bytes} + *

+ */ + @Nullable + public final Bytes bytes() { + return this.bytes; + } + + /** + * The amount of time allowed to establish a connection to the cluster manager node. + *

+ * API name: {@code cluster_manager_timeout} + *

+ */ + @Nullable + public final Time clusterManagerTimeout() { + return this.clusterManagerTimeout; + } + + /** + * A comma-separated list of data streams, indexes, and aliases used to limit the request. Supports wildcards (*). To + * target all data streams and indexes, omit this parameter or use * or _all. + *

+ * API name: {@code index} + *

+ */ + @Nonnull + public final List index() { + return this.index; + } + + /** + * The amount of time allowed to establish a connection to the cluster manager node. + *

+ * API name: {@code master_timeout} + *

+ */ + @Deprecated + @Nullable + public final Time masterTimeout() { + return this.masterTimeout; + } + + /** + * Specifies the time units, for example, 5d or 7h. For more information, see + * Supported units. + *

+ * API name: {@code time} + *

+ */ + @Nullable + public final TimeUnit time() { + return this.time; + } + + // --------------------------------------------------------------------------------------------- + + @Override + @Nonnull + public Builder toBuilder() { + return new Builder(this); + } + + @Nonnull + public static Builder builder() { + return new Builder(); + } + + /** + * Builder for {@link ShardsRequest}. + */ + public static class Builder extends CatRequestBase.AbstractBuilder implements CopyableBuilder { + @Nullable + private Bytes bytes; + @Nullable + private Time clusterManagerTimeout; + @Nullable + private List index; + @Nullable + private Time masterTimeout; + @Nullable + private TimeUnit time; + + public Builder() {} + + private Builder(ShardsRequest o) { + super(o); + this.bytes = o.bytes; + this.clusterManagerTimeout = o.clusterManagerTimeout; + this.index = _listCopy(o.index); + this.masterTimeout = o.masterTimeout; + this.time = o.time; + } + + private Builder(Builder o) { + super(o); + this.bytes = o.bytes; + this.clusterManagerTimeout = o.clusterManagerTimeout; + this.index = _listCopy(o.index); + this.masterTimeout = o.masterTimeout; + this.time = o.time; + } + + @Override + @Nonnull + public Builder copy() { + return new Builder(this); + } + + @Override + @Nonnull + protected Builder self() { + return this; + } + + /** + * The units used to display byte values. + *

+ * API name: {@code bytes} + *

+ */ + @Nonnull + public final Builder bytes(@Nullable Bytes value) { + this.bytes = value; + return this; + } + + /** + * The amount of time allowed to establish a connection to the cluster manager node. + *

+ * API name: {@code cluster_manager_timeout} + *

+ */ + @Nonnull + public final Builder clusterManagerTimeout(@Nullable Time value) { + this.clusterManagerTimeout = value; + return this; + } + + /** + * The amount of time allowed to establish a connection to the cluster manager node. + *

+ * API name: {@code cluster_manager_timeout} + *

+ */ + @Nonnull + public final Builder clusterManagerTimeout(Function> fn) { + return clusterManagerTimeout(fn.apply(new Time.Builder()).build()); + } + + /** + * A comma-separated list of data streams, indexes, and aliases used to limit the request. Supports wildcards (*). To + * target all data streams and indexes, omit this parameter or use * or _all. + *

+ * 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; + } + + /** + * A comma-separated list of data streams, indexes, and aliases used to limit the request. Supports wildcards (*). To + * target all data streams and indexes, omit this parameter or use * or _all. + *

+ * 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; + } + + /** + * The amount of time allowed to establish a connection to the cluster manager node. + *

+ * API name: {@code master_timeout} + *

+ */ + @Deprecated + @Nonnull + public final Builder masterTimeout(@Nullable Time value) { + this.masterTimeout = value; + return this; + } + + /** + * The amount of time allowed to establish a connection to the cluster manager node. + *

+ * API name: {@code master_timeout} + *

+ */ + @Deprecated + @Nonnull + public final Builder masterTimeout(Function> fn) { + return masterTimeout(fn.apply(new Time.Builder()).build()); + } + + /** + * Specifies the time units, for example, 5d or 7h. For more information, see + * Supported units. + *

+ * API name: {@code time} + *

+ */ + @Nonnull + public final Builder time(@Nullable TimeUnit value) { + this.time = value; + return this; + } + + /** + * Builds a {@link ShardsRequest}. + * + * @throws NullPointerException if some of the required fields are null. + */ + @Override + @Nonnull + public ShardsRequest build() { + _checkSingleUse(); + + return new ShardsRequest(this); + } + } + + // --------------------------------------------------------------------------------------------- + + @Override + protected void applyQueryParameters(@Nonnull Map params) { + super.applyQueryParameters(params); + if (this.bytes != null) { + params.put("bytes", this.bytes.jsonValue()); + } + if (this.clusterManagerTimeout != null) { + params.put("cluster_manager_timeout", this.clusterManagerTimeout._toJsonString()); + } + if (this.masterTimeout != null) { + params.put("master_timeout", this.masterTimeout._toJsonString()); + } + if (this.time != null) { + params.put("time", this.time.jsonValue()); + } + } + + /** + * Endpoint "{@code cat.shards}". + */ + public static final Endpoint _ENDPOINT = new SimpleEndpoint<>( + // Request method + request -> "GET", + // Request path + request -> { + final int _index = 1 << 0; + + int propsSet = 0; + + if (ApiTypeHelper.isDefined(request.index())) propsSet |= _index; + + if (propsSet == 0) { + return "/_cat/shards"; + } + if (propsSet == (_index)) { + StringBuilder buf = new StringBuilder(); + buf.append("/_cat/shards/"); + SimpleEndpoint.pathEncode(String.join(",", request.index), buf); + return buf.toString(); + } + + throw SimpleEndpoint.noPathTemplateFound("path"); + }, + // Request parameters + request -> { + Map params = new HashMap<>(); + request.applyQueryParameters(params); + return params; + }, + SimpleEndpoint.emptyMap(), + false, + ShardsResponse._DESERIALIZER + ); + + @Override + public int hashCode() { + int result = 17; + result = 31 * result + Objects.hashCode(this.bytes); + result = 31 * result + Objects.hashCode(this.clusterManagerTimeout); + result = 31 * result + Objects.hashCode(this.index); + result = 31 * result + Objects.hashCode(this.masterTimeout); + result = 31 * result + Objects.hashCode(this.time); + return result; + } + + @Override + public boolean equals(Object o) { + if (this == o) return true; + if (o == null || this.getClass() != o.getClass()) return false; + ShardsRequest other = (ShardsRequest) o; + return Objects.equals(this.bytes, other.bytes) + && Objects.equals(this.clusterManagerTimeout, other.clusterManagerTimeout) + && Objects.equals(this.index, other.index) + && Objects.equals(this.masterTimeout, other.masterTimeout) + && Objects.equals(this.time, other.time); + } +} diff --git a/java-client/src/main/java/org/opensearch/client/opensearch/cat/ShardsResponse.java b/java-client/src/generated/java/org/opensearch/client/opensearch/cat/ShardsResponse.java similarity index 75% rename from java-client/src/main/java/org/opensearch/client/opensearch/cat/ShardsResponse.java rename to java-client/src/generated/java/org/opensearch/client/opensearch/cat/ShardsResponse.java index d714051353..975eba29ac 100644 --- a/java-client/src/main/java/org/opensearch/client/opensearch/cat/ShardsResponse.java +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/cat/ShardsResponse.java @@ -30,43 +30,51 @@ * GitHub history for details. */ +//---------------------------------------------------- +// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. +//---------------------------------------------------- + package org.opensearch.client.opensearch.cat; 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; import org.opensearch.client.json.PlainJsonSerializable; import org.opensearch.client.opensearch.cat.shards.ShardsRecord; 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: cat.shards.Response @JsonpDeserializable -public class ShardsResponse implements PlainJsonSerializable { +@Generated("org.opensearch.client.codegen.CodeGenerator") +public class ShardsResponse implements PlainJsonSerializable, ToCopyableBuilder { + + @Nonnull private final List valueBody; // --------------------------------------------------------------------------------------------- private ShardsResponse(Builder builder) { - this.valueBody = ApiTypeHelper.unmodifiableRequired(builder.valueBody, this, "valueBody"); - } - public static ShardsResponse of(Function> fn) { + public static ShardsResponse of(Function> fn) { return fn.apply(new Builder()).build(); } /** * Required - Response value. - *

- * API name: {@code _value_body} */ + @Nonnull public final List valueBody() { return this.valueBody; } @@ -78,28 +86,53 @@ public void serialize(JsonGenerator generator, JsonpMapper mapper) { generator.writeStartArray(); for (ShardsRecord item0 : this.valueBody) { 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 ShardsResponse}. */ - - public static class Builder extends ObjectBuilderBase implements ObjectBuilder { + public static class Builder extends ObjectBuilderBase implements CopyableBuilder { private List valueBody; + public Builder() {} + + private Builder(ShardsResponse o) { + this.valueBody = _listCopy(o.valueBody); + } + + private Builder(Builder o) { + this.valueBody = _listCopy(o.valueBody); + } + + @Override + @Nonnull + public Builder copy() { + return new Builder(this); + } + /** * Required - Response value. - *

- * API name: {@code _value_body} + * *

* Adds all elements of list to valueBody. + *

*/ + @Nonnull public final Builder valueBody(List list) { this.valueBody = _listAddAll(this.valueBody, list); return this; @@ -107,11 +140,12 @@ public final Builder valueBody(List list) { /** * Required - Response value. - *

- * API name: {@code _value_body} + * *

* Adds one or more values to valueBody. + *

*/ + @Nonnull public final Builder valueBody(ShardsRecord value, ShardsRecord... values) { this.valueBody = _listAdd(this.valueBody, value, values); return this; @@ -119,11 +153,12 @@ public final Builder valueBody(ShardsRecord value, ShardsRecord... values) { /** * Required - Response value. - *

- * API name: {@code _value_body} + * *

* Adds a value to valueBody using a builder lambda. + *

*/ + @Nonnull public final Builder valueBody(Function> fn) { return valueBody(fn.apply(new ShardsRecord.Builder()).build()); } @@ -131,9 +166,10 @@ public final Builder valueBody(Function _DESERIALIZER = createShardsResponseDeserializer(); protected static JsonpDeserializer createShardsResponseDeserializer() { - JsonpDeserializer> valueDeserializer = JsonpDeserializer.arrayDeserializer(ShardsRecord._DESERIALIZER); return JsonpDeserializer.of( @@ -152,5 +187,4 @@ protected static JsonpDeserializer createShardsResponseDeseriali (parser, mapper) -> new Builder().valueBody(valueDeserializer.deserialize(parser, mapper)).build() ); } - } diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/cat/SnapshotsRequest.java b/java-client/src/generated/java/org/opensearch/client/opensearch/cat/SnapshotsRequest.java new file mode 100644 index 0000000000..35ec192567 --- /dev/null +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/cat/SnapshotsRequest.java @@ -0,0 +1,413 @@ +/* + * SPDX-License-Identifier: Apache-2.0 + * + * The OpenSearch Contributors require contributions made to + * this file be licensed under the Apache-2.0 license or a + * compatible open source license. + */ + +/* + * Licensed to Elasticsearch B.V. under one or more contributor + * license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright + * ownership. Elasticsearch B.V. licenses this file to you under + * the Apache License, Version 2.0 (the "License"); you may + * not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +/* + * Modifications Copyright OpenSearch Contributors. See + * GitHub history for details. + */ + +//---------------------------------------------------- +// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. +//---------------------------------------------------- + +package org.opensearch.client.opensearch.cat; + +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.function.Function; +import javax.annotation.Generated; +import javax.annotation.Nonnull; +import javax.annotation.Nullable; +import org.opensearch.client.opensearch._types.ErrorResponse; +import org.opensearch.client.opensearch._types.Time; +import org.opensearch.client.opensearch._types.TimeUnit; +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.ToCopyableBuilder; + +// typedef: cat.snapshots.Request + +/** + * Lists all of the snapshots stored in a specific repository. + */ +@Generated("org.opensearch.client.codegen.CodeGenerator") +public final class SnapshotsRequest extends CatRequestBase implements ToCopyableBuilder { + + @Nullable + private final Time clusterManagerTimeout; + + @Nullable + private final Boolean ignoreUnavailable; + + @Deprecated + @Nullable + private final Time masterTimeout; + + @Nonnull + private final List repository; + + @Nullable + private final TimeUnit time; + + // --------------------------------------------------------------------------------------------- + + private SnapshotsRequest(Builder builder) { + super(builder); + this.clusterManagerTimeout = builder.clusterManagerTimeout; + this.ignoreUnavailable = builder.ignoreUnavailable; + this.masterTimeout = builder.masterTimeout; + this.repository = ApiTypeHelper.unmodifiable(builder.repository); + this.time = builder.time; + } + + public static SnapshotsRequest of(Function> fn) { + return fn.apply(new Builder()).build(); + } + + /** + * The amount of time allowed to establish a connection to the cluster manager node. + *

+ * API name: {@code cluster_manager_timeout} + *

+ */ + @Nullable + public final Time clusterManagerTimeout() { + return this.clusterManagerTimeout; + } + + /** + * When true, the response does not include information from unavailable snapshots. + *

+ * API name: {@code ignore_unavailable} + *

+ */ + @Nullable + public final Boolean ignoreUnavailable() { + return this.ignoreUnavailable; + } + + /** + * The amount of time allowed to establish a connection to the cluster manager node. + *

+ * API name: {@code master_timeout} + *

+ */ + @Deprecated + @Nullable + public final Time masterTimeout() { + return this.masterTimeout; + } + + /** + * A comma-separated list of snapshot repositories used to limit the request. Accepts wildcard expressions. _all returns + * all repositories. If any repository fails during the request, OpenSearch returns an error. + *

+ * API name: {@code repository} + *

+ */ + @Nonnull + public final List repository() { + return this.repository; + } + + /** + * Specifies the time units, for example, 5d or 7h. For more information, see + * Supported units. + *

+ * API name: {@code time} + *

+ */ + @Nullable + public final TimeUnit time() { + return this.time; + } + + // --------------------------------------------------------------------------------------------- + + @Override + @Nonnull + public Builder toBuilder() { + return new Builder(this); + } + + @Nonnull + public static Builder builder() { + return new Builder(); + } + + /** + * Builder for {@link SnapshotsRequest}. + */ + public static class Builder extends CatRequestBase.AbstractBuilder implements CopyableBuilder { + @Nullable + private Time clusterManagerTimeout; + @Nullable + private Boolean ignoreUnavailable; + @Nullable + private Time masterTimeout; + @Nullable + private List repository; + @Nullable + private TimeUnit time; + + public Builder() {} + + private Builder(SnapshotsRequest o) { + super(o); + this.clusterManagerTimeout = o.clusterManagerTimeout; + this.ignoreUnavailable = o.ignoreUnavailable; + this.masterTimeout = o.masterTimeout; + this.repository = _listCopy(o.repository); + this.time = o.time; + } + + private Builder(Builder o) { + super(o); + this.clusterManagerTimeout = o.clusterManagerTimeout; + this.ignoreUnavailable = o.ignoreUnavailable; + this.masterTimeout = o.masterTimeout; + this.repository = _listCopy(o.repository); + this.time = o.time; + } + + @Override + @Nonnull + public Builder copy() { + return new Builder(this); + } + + @Override + @Nonnull + protected Builder self() { + return this; + } + + /** + * The amount of time allowed to establish a connection to the cluster manager node. + *

+ * API name: {@code cluster_manager_timeout} + *

+ */ + @Nonnull + public final Builder clusterManagerTimeout(@Nullable Time value) { + this.clusterManagerTimeout = value; + return this; + } + + /** + * The amount of time allowed to establish a connection to the cluster manager node. + *

+ * API name: {@code cluster_manager_timeout} + *

+ */ + @Nonnull + public final Builder clusterManagerTimeout(Function> fn) { + return clusterManagerTimeout(fn.apply(new Time.Builder()).build()); + } + + /** + * When true, the response does not include information from unavailable snapshots. + *

+ * API name: {@code ignore_unavailable} + *

+ */ + @Nonnull + public final Builder ignoreUnavailable(@Nullable Boolean value) { + this.ignoreUnavailable = value; + return this; + } + + /** + * The amount of time allowed to establish a connection to the cluster manager node. + *

+ * API name: {@code master_timeout} + *

+ */ + @Deprecated + @Nonnull + public final Builder masterTimeout(@Nullable Time value) { + this.masterTimeout = value; + return this; + } + + /** + * The amount of time allowed to establish a connection to the cluster manager node. + *

+ * API name: {@code master_timeout} + *

+ */ + @Deprecated + @Nonnull + public final Builder masterTimeout(Function> fn) { + return masterTimeout(fn.apply(new Time.Builder()).build()); + } + + /** + * A comma-separated list of snapshot repositories used to limit the request. Accepts wildcard expressions. _all + * returns all repositories. If any repository fails during the request, OpenSearch returns an error. + *

+ * API name: {@code repository} + *

+ * + *

+ * Adds all elements of list to repository. + *

+ */ + @Nonnull + public final Builder repository(List list) { + this.repository = _listAddAll(this.repository, list); + return this; + } + + /** + * A comma-separated list of snapshot repositories used to limit the request. Accepts wildcard expressions. _all + * returns all repositories. If any repository fails during the request, OpenSearch returns an error. + *

+ * API name: {@code repository} + *

+ * + *

+ * Adds one or more values to repository. + *

+ */ + @Nonnull + public final Builder repository(String value, String... values) { + this.repository = _listAdd(this.repository, value, values); + return this; + } + + /** + * Specifies the time units, for example, 5d or 7h. For more information, see + * Supported units. + *

+ * API name: {@code time} + *

+ */ + @Nonnull + public final Builder time(@Nullable TimeUnit value) { + this.time = value; + return this; + } + + /** + * Builds a {@link SnapshotsRequest}. + * + * @throws NullPointerException if some of the required fields are null. + */ + @Override + @Nonnull + public SnapshotsRequest build() { + _checkSingleUse(); + + return new SnapshotsRequest(this); + } + } + + // --------------------------------------------------------------------------------------------- + + @Override + protected void applyQueryParameters(@Nonnull Map params) { + super.applyQueryParameters(params); + if (this.clusterManagerTimeout != null) { + params.put("cluster_manager_timeout", this.clusterManagerTimeout._toJsonString()); + } + if (this.ignoreUnavailable != null) { + params.put("ignore_unavailable", String.valueOf(this.ignoreUnavailable)); + } + if (this.masterTimeout != null) { + params.put("master_timeout", this.masterTimeout._toJsonString()); + } + if (this.time != null) { + params.put("time", this.time.jsonValue()); + } + } + + /** + * Endpoint "{@code cat.snapshots}". + */ + public static final Endpoint _ENDPOINT = new SimpleEndpoint<>( + // Request method + request -> "GET", + // Request path + request -> { + final int _repository = 1 << 0; + + int propsSet = 0; + + if (ApiTypeHelper.isDefined(request.repository())) propsSet |= _repository; + + if (propsSet == 0) { + return "/_cat/snapshots"; + } + if (propsSet == (_repository)) { + StringBuilder buf = new StringBuilder(); + buf.append("/_cat/snapshots/"); + SimpleEndpoint.pathEncode(String.join(",", request.repository), buf); + return buf.toString(); + } + + throw SimpleEndpoint.noPathTemplateFound("path"); + }, + // Request parameters + request -> { + Map params = new HashMap<>(); + request.applyQueryParameters(params); + return params; + }, + SimpleEndpoint.emptyMap(), + false, + SnapshotsResponse._DESERIALIZER + ); + + @Override + public int hashCode() { + int result = 17; + result = 31 * result + Objects.hashCode(this.clusterManagerTimeout); + result = 31 * result + Objects.hashCode(this.ignoreUnavailable); + result = 31 * result + Objects.hashCode(this.masterTimeout); + result = 31 * result + Objects.hashCode(this.repository); + result = 31 * result + Objects.hashCode(this.time); + return result; + } + + @Override + public boolean equals(Object o) { + if (this == o) return true; + if (o == null || this.getClass() != o.getClass()) return false; + SnapshotsRequest other = (SnapshotsRequest) o; + return Objects.equals(this.clusterManagerTimeout, other.clusterManagerTimeout) + && Objects.equals(this.ignoreUnavailable, other.ignoreUnavailable) + && Objects.equals(this.masterTimeout, other.masterTimeout) + && Objects.equals(this.repository, other.repository) + && Objects.equals(this.time, other.time); + } +} diff --git a/java-client/src/main/java/org/opensearch/client/opensearch/cat/SnapshotsResponse.java b/java-client/src/generated/java/org/opensearch/client/opensearch/cat/SnapshotsResponse.java similarity index 75% rename from java-client/src/main/java/org/opensearch/client/opensearch/cat/SnapshotsResponse.java rename to java-client/src/generated/java/org/opensearch/client/opensearch/cat/SnapshotsResponse.java index b059a35cec..ff85c2d933 100644 --- a/java-client/src/main/java/org/opensearch/client/opensearch/cat/SnapshotsResponse.java +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/cat/SnapshotsResponse.java @@ -30,43 +30,51 @@ * GitHub history for details. */ +//---------------------------------------------------- +// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. +//---------------------------------------------------- + package org.opensearch.client.opensearch.cat; 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; import org.opensearch.client.json.PlainJsonSerializable; import org.opensearch.client.opensearch.cat.snapshots.SnapshotsRecord; 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: cat.snapshots.Response @JsonpDeserializable -public class SnapshotsResponse implements PlainJsonSerializable { +@Generated("org.opensearch.client.codegen.CodeGenerator") +public class SnapshotsResponse implements PlainJsonSerializable, ToCopyableBuilder { + + @Nonnull private final List valueBody; // --------------------------------------------------------------------------------------------- private SnapshotsResponse(Builder builder) { - this.valueBody = ApiTypeHelper.unmodifiableRequired(builder.valueBody, this, "valueBody"); - } - public static SnapshotsResponse of(Function> fn) { + public static SnapshotsResponse of(Function> fn) { return fn.apply(new Builder()).build(); } /** * Required - Response value. - *

- * API name: {@code _value_body} */ + @Nonnull public final List valueBody() { return this.valueBody; } @@ -78,28 +86,53 @@ public void serialize(JsonGenerator generator, JsonpMapper mapper) { generator.writeStartArray(); for (SnapshotsRecord item0 : this.valueBody) { 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 SnapshotsResponse}. */ - - public static class Builder extends ObjectBuilderBase implements ObjectBuilder { + public static class Builder extends ObjectBuilderBase implements CopyableBuilder { private List valueBody; + public Builder() {} + + private Builder(SnapshotsResponse o) { + this.valueBody = _listCopy(o.valueBody); + } + + private Builder(Builder o) { + this.valueBody = _listCopy(o.valueBody); + } + + @Override + @Nonnull + public Builder copy() { + return new Builder(this); + } + /** * Required - Response value. - *

- * API name: {@code _value_body} + * *

* Adds all elements of list to valueBody. + *

*/ + @Nonnull public final Builder valueBody(List list) { this.valueBody = _listAddAll(this.valueBody, list); return this; @@ -107,11 +140,12 @@ public final Builder valueBody(List list) { /** * Required - Response value. - *

- * API name: {@code _value_body} + * *

* Adds one or more values to valueBody. + *

*/ + @Nonnull public final Builder valueBody(SnapshotsRecord value, SnapshotsRecord... values) { this.valueBody = _listAdd(this.valueBody, value, values); return this; @@ -119,11 +153,12 @@ public final Builder valueBody(SnapshotsRecord value, SnapshotsRecord... values) /** * Required - Response value. - *

- * API name: {@code _value_body} + * *

* Adds a value to valueBody using a builder lambda. + *

*/ + @Nonnull public final Builder valueBody(Function> fn) { return valueBody(fn.apply(new SnapshotsRecord.Builder()).build()); } @@ -131,9 +166,10 @@ public final Builder valueBody(Function _DESERIALIZER = createSnapshotsResponseDeserializer(); protected static JsonpDeserializer createSnapshotsResponseDeserializer() { - JsonpDeserializer> valueDeserializer = JsonpDeserializer.arrayDeserializer(SnapshotsRecord._DESERIALIZER); return JsonpDeserializer.of( @@ -152,5 +187,4 @@ protected static JsonpDeserializer createSnapshotsResponseDes (parser, mapper) -> new Builder().valueBody(valueDeserializer.deserialize(parser, mapper)).build() ); } - } diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/cat/TasksRequest.java b/java-client/src/generated/java/org/opensearch/client/opensearch/cat/TasksRequest.java new file mode 100644 index 0000000000..9caf91c953 --- /dev/null +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/cat/TasksRequest.java @@ -0,0 +1,394 @@ +/* + * SPDX-License-Identifier: Apache-2.0 + * + * The OpenSearch Contributors require contributions made to + * this file be licensed under the Apache-2.0 license or a + * compatible open source license. + */ + +/* + * Licensed to Elasticsearch B.V. under one or more contributor + * license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright + * ownership. Elasticsearch B.V. licenses this file to you under + * the Apache License, Version 2.0 (the "License"); you may + * not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +/* + * Modifications Copyright OpenSearch Contributors. See + * GitHub history for details. + */ + +//---------------------------------------------------- +// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. +//---------------------------------------------------- + +package org.opensearch.client.opensearch.cat; + +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.function.Function; +import javax.annotation.Generated; +import javax.annotation.Nonnull; +import javax.annotation.Nullable; +import org.opensearch.client.opensearch._types.ErrorResponse; +import org.opensearch.client.opensearch._types.TimeUnit; +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.ToCopyableBuilder; + +// typedef: cat.tasks.Request + +/** + * Lists the progress of all tasks currently running on the cluster. + */ +@Generated("org.opensearch.client.codegen.CodeGenerator") +public final class TasksRequest extends CatRequestBase implements ToCopyableBuilder { + + @Nonnull + private final List actions; + + @Nullable + private final Boolean detailed; + + @Nonnull + private final List nodes; + + @Nullable + private final String parentTaskId; + + @Nullable + private final TimeUnit time; + + // --------------------------------------------------------------------------------------------- + + private TasksRequest(Builder builder) { + super(builder); + this.actions = ApiTypeHelper.unmodifiable(builder.actions); + this.detailed = builder.detailed; + this.nodes = ApiTypeHelper.unmodifiable(builder.nodes); + this.parentTaskId = builder.parentTaskId; + this.time = builder.time; + } + + public static TasksRequest of(Function> fn) { + return fn.apply(new Builder()).build(); + } + + /** + * The task action names used to limit the response. + *

+ * API name: {@code actions} + *

+ */ + @Nonnull + public final List actions() { + return this.actions; + } + + /** + * If true, the response includes detailed information about shard recoveries. + *

+ * API name: {@code detailed} + *

+ */ + @Nullable + public final Boolean detailed() { + return this.detailed; + } + + /** + * A comma-separated list of node IDs or names used to limit the returned information. Use _local to return information + * from the node to which you're connecting, specify a specific node from which to get information, or keep the parameter empty to get + * information from all nodes. + *

+ * API name: {@code nodes} + *

+ */ + @Nonnull + public final List nodes() { + return this.nodes; + } + + /** + * The parent task identifier, which is used to limit the response. + *

+ * API name: {@code parent_task_id} + *

+ */ + @Nullable + public final String parentTaskId() { + return this.parentTaskId; + } + + /** + * Specifies the time units, for example, 5d or 7h. For more information, see + * Supported units. + *

+ * API name: {@code time} + *

+ */ + @Nullable + public final TimeUnit time() { + return this.time; + } + + // --------------------------------------------------------------------------------------------- + + @Override + @Nonnull + public Builder toBuilder() { + return new Builder(this); + } + + @Nonnull + public static Builder builder() { + return new Builder(); + } + + /** + * Builder for {@link TasksRequest}. + */ + public static class Builder extends CatRequestBase.AbstractBuilder implements CopyableBuilder { + @Nullable + private List actions; + @Nullable + private Boolean detailed; + @Nullable + private List nodes; + @Nullable + private String parentTaskId; + @Nullable + private TimeUnit time; + + public Builder() {} + + private Builder(TasksRequest o) { + super(o); + this.actions = _listCopy(o.actions); + this.detailed = o.detailed; + this.nodes = _listCopy(o.nodes); + this.parentTaskId = o.parentTaskId; + this.time = o.time; + } + + private Builder(Builder o) { + super(o); + this.actions = _listCopy(o.actions); + this.detailed = o.detailed; + this.nodes = _listCopy(o.nodes); + this.parentTaskId = o.parentTaskId; + this.time = o.time; + } + + @Override + @Nonnull + public Builder copy() { + return new Builder(this); + } + + @Override + @Nonnull + protected Builder self() { + return this; + } + + /** + * The task action names used to limit the response. + *

+ * API name: {@code actions} + *

+ * + *

+ * Adds all elements of list to actions. + *

+ */ + @Nonnull + public final Builder actions(List list) { + this.actions = _listAddAll(this.actions, list); + return this; + } + + /** + * The task action names used to limit the response. + *

+ * API name: {@code actions} + *

+ * + *

+ * Adds one or more values to actions. + *

+ */ + @Nonnull + public final Builder actions(String value, String... values) { + this.actions = _listAdd(this.actions, value, values); + return this; + } + + /** + * If true, the response includes detailed information about shard recoveries. + *

+ * API name: {@code detailed} + *

+ */ + @Nonnull + public final Builder detailed(@Nullable Boolean value) { + this.detailed = value; + return this; + } + + /** + * A comma-separated list of node IDs or names used to limit the returned information. Use _local to return information + * from the node to which you're connecting, specify a specific node from which to get information, or keep the parameter empty to + * get information from all nodes. + *

+ * API name: {@code nodes} + *

+ * + *

+ * Adds all elements of list to nodes. + *

+ */ + @Nonnull + public final Builder nodes(List list) { + this.nodes = _listAddAll(this.nodes, list); + return this; + } + + /** + * A comma-separated list of node IDs or names used to limit the returned information. Use _local to return information + * from the node to which you're connecting, specify a specific node from which to get information, or keep the parameter empty to + * get information from all nodes. + *

+ * API name: {@code nodes} + *

+ * + *

+ * Adds one or more values to nodes. + *

+ */ + @Nonnull + public final Builder nodes(String value, String... values) { + this.nodes = _listAdd(this.nodes, value, values); + return this; + } + + /** + * The parent task identifier, which is used to limit the response. + *

+ * API name: {@code parent_task_id} + *

+ */ + @Nonnull + public final Builder parentTaskId(@Nullable String value) { + this.parentTaskId = value; + return this; + } + + /** + * Specifies the time units, for example, 5d or 7h. For more information, see + * Supported units. + *

+ * API name: {@code time} + *

+ */ + @Nonnull + public final Builder time(@Nullable TimeUnit value) { + this.time = value; + return this; + } + + /** + * Builds a {@link TasksRequest}. + * + * @throws NullPointerException if some of the required fields are null. + */ + @Override + @Nonnull + public TasksRequest build() { + _checkSingleUse(); + + return new TasksRequest(this); + } + } + + // --------------------------------------------------------------------------------------------- + + @Override + protected void applyQueryParameters(@Nonnull Map params) { + super.applyQueryParameters(params); + if (ApiTypeHelper.isDefined(this.actions)) { + params.put("actions", String.join(",", this.actions)); + } + if (this.detailed != null) { + params.put("detailed", String.valueOf(this.detailed)); + } + if (ApiTypeHelper.isDefined(this.nodes)) { + params.put("nodes", String.join(",", this.nodes)); + } + if (this.parentTaskId != null) { + params.put("parent_task_id", this.parentTaskId); + } + if (this.time != null) { + params.put("time", this.time.jsonValue()); + } + } + + /** + * Endpoint "{@code cat.tasks}". + */ + public static final Endpoint _ENDPOINT = new SimpleEndpoint<>( + // Request method + request -> "GET", + // Request path + request -> "/_cat/tasks", + // Request parameters + request -> { + Map params = new HashMap<>(); + request.applyQueryParameters(params); + return params; + }, + SimpleEndpoint.emptyMap(), + false, + TasksResponse._DESERIALIZER + ); + + @Override + public int hashCode() { + int result = 17; + result = 31 * result + Objects.hashCode(this.actions); + result = 31 * result + Objects.hashCode(this.detailed); + result = 31 * result + Objects.hashCode(this.nodes); + result = 31 * result + Objects.hashCode(this.parentTaskId); + result = 31 * result + Objects.hashCode(this.time); + return result; + } + + @Override + public boolean equals(Object o) { + if (this == o) return true; + if (o == null || this.getClass() != o.getClass()) return false; + TasksRequest other = (TasksRequest) o; + return Objects.equals(this.actions, other.actions) + && Objects.equals(this.detailed, other.detailed) + && Objects.equals(this.nodes, other.nodes) + && Objects.equals(this.parentTaskId, other.parentTaskId) + && Objects.equals(this.time, other.time); + } +} diff --git a/java-client/src/main/java/org/opensearch/client/opensearch/cat/TasksResponse.java b/java-client/src/generated/java/org/opensearch/client/opensearch/cat/TasksResponse.java similarity index 75% rename from java-client/src/main/java/org/opensearch/client/opensearch/cat/TasksResponse.java rename to java-client/src/generated/java/org/opensearch/client/opensearch/cat/TasksResponse.java index bff415e614..c67fcc52b5 100644 --- a/java-client/src/main/java/org/opensearch/client/opensearch/cat/TasksResponse.java +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/cat/TasksResponse.java @@ -30,43 +30,51 @@ * GitHub history for details. */ +//---------------------------------------------------- +// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. +//---------------------------------------------------- + package org.opensearch.client.opensearch.cat; 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; import org.opensearch.client.json.PlainJsonSerializable; import org.opensearch.client.opensearch.cat.tasks.TasksRecord; 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: cat.tasks.Response @JsonpDeserializable -public class TasksResponse implements PlainJsonSerializable { +@Generated("org.opensearch.client.codegen.CodeGenerator") +public class TasksResponse implements PlainJsonSerializable, ToCopyableBuilder { + + @Nonnull private final List valueBody; // --------------------------------------------------------------------------------------------- private TasksResponse(Builder builder) { - this.valueBody = ApiTypeHelper.unmodifiableRequired(builder.valueBody, this, "valueBody"); - } - public static TasksResponse of(Function> fn) { + public static TasksResponse of(Function> fn) { return fn.apply(new Builder()).build(); } /** * Required - Response value. - *

- * API name: {@code _value_body} */ + @Nonnull public final List valueBody() { return this.valueBody; } @@ -78,28 +86,53 @@ public void serialize(JsonGenerator generator, JsonpMapper mapper) { generator.writeStartArray(); for (TasksRecord item0 : this.valueBody) { 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 TasksResponse}. */ - - public static class Builder extends ObjectBuilderBase implements ObjectBuilder { + public static class Builder extends ObjectBuilderBase implements CopyableBuilder { private List valueBody; + public Builder() {} + + private Builder(TasksResponse o) { + this.valueBody = _listCopy(o.valueBody); + } + + private Builder(Builder o) { + this.valueBody = _listCopy(o.valueBody); + } + + @Override + @Nonnull + public Builder copy() { + return new Builder(this); + } + /** * Required - Response value. - *

- * API name: {@code _value_body} + * *

* Adds all elements of list to valueBody. + *

*/ + @Nonnull public final Builder valueBody(List list) { this.valueBody = _listAddAll(this.valueBody, list); return this; @@ -107,11 +140,12 @@ public final Builder valueBody(List list) { /** * Required - Response value. - *

- * API name: {@code _value_body} + * *

* Adds one or more values to valueBody. + *

*/ + @Nonnull public final Builder valueBody(TasksRecord value, TasksRecord... values) { this.valueBody = _listAdd(this.valueBody, value, values); return this; @@ -119,11 +153,12 @@ public final Builder valueBody(TasksRecord value, TasksRecord... values) { /** * Required - Response value. - *

- * API name: {@code _value_body} + * *

* Adds a value to valueBody using a builder lambda. + *

*/ + @Nonnull public final Builder valueBody(Function> fn) { return valueBody(fn.apply(new TasksRecord.Builder()).build()); } @@ -131,9 +166,10 @@ public final Builder valueBody(Function _DESERIALIZER = createTasksResponseDeserializer(); protected static JsonpDeserializer createTasksResponseDeserializer() { - JsonpDeserializer> valueDeserializer = JsonpDeserializer.arrayDeserializer(TasksRecord._DESERIALIZER); return JsonpDeserializer.of( @@ -152,5 +187,4 @@ protected static JsonpDeserializer createTasksResponseDeserialize (parser, mapper) -> new Builder().valueBody(valueDeserializer.deserialize(parser, mapper)).build() ); } - } diff --git a/java-client/src/main/java/org/opensearch/client/opensearch/cat/shards/ShardsRecord.java b/java-client/src/generated/java/org/opensearch/client/opensearch/cat/shards/ShardsRecord.java similarity index 55% rename from java-client/src/main/java/org/opensearch/client/opensearch/cat/shards/ShardsRecord.java rename to java-client/src/generated/java/org/opensearch/client/opensearch/cat/shards/ShardsRecord.java index f56fe8a362..e3535551ab 100644 --- a/java-client/src/main/java/org/opensearch/client/opensearch/cat/shards/ShardsRecord.java +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/cat/shards/ShardsRecord.java @@ -30,10 +30,17 @@ * GitHub history for details. */ +//---------------------------------------------------- +// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. +//---------------------------------------------------- + package org.opensearch.client.opensearch.cat.shards; import jakarta.json.stream.JsonGenerator; +import java.util.Objects; import java.util.function.Function; +import javax.annotation.Generated; +import javax.annotation.Nonnull; import javax.annotation.Nullable; import org.opensearch.client.json.JsonpDeserializable; import org.opensearch.client.json.JsonpDeserializer; @@ -41,81 +48,67 @@ import org.opensearch.client.json.ObjectBuilderDeserializer; import org.opensearch.client.json.ObjectDeserializer; import org.opensearch.client.json.PlainJsonSerializable; +import org.opensearch.client.util.CopyableBuilder; import org.opensearch.client.util.ObjectBuilder; import org.opensearch.client.util.ObjectBuilderBase; +import org.opensearch.client.util.ToCopyableBuilder; // typedef: cat.shards.ShardsRecord @JsonpDeserializable -public class ShardsRecord implements PlainJsonSerializable { - @Nullable - private final String index; - - @Nullable - private final String shard; - - @Nullable - private final String prirep; - - @Nullable - private final String state; - - @Nullable - private final String docs; - - @Nullable - private final String store; +@Generated("org.opensearch.client.codegen.CodeGenerator") +public class ShardsRecord implements PlainJsonSerializable, ToCopyableBuilder { @Nullable - private final String ip; + private final String bulkAvgSizeInBytes; @Nullable - private final String id; + private final String bulkAvgTime; @Nullable - private final String node; + private final String bulkTotalOperations; @Nullable - private final String syncId; + private final String bulkTotalSizeInBytes; @Nullable - private final String unassignedReason; + private final String bulkTotalTime; @Nullable - private final String unassignedAt; + private final String completionSize; @Nullable - private final String unassignedFor; + private final String docs; @Nullable - private final String unassignedDetails; + private final String docsDeleted; @Nullable - private final String recoverysourceType; + private final String fielddataEvictions; @Nullable - private final String completionSize; + private final String fielddataMemorySize; @Nullable - private final String fielddataMemorySize; + private final String flushTotal; @Nullable - private final String fielddataEvictions; + private final String flushTotalTime; @Nullable - private final String queryCacheMemorySize; + private final String getCurrent; @Nullable - private final String queryCacheEvictions; + private final String getExistsTime; @Nullable - private final String flushTotal; + private final String getExistsTotal; @Nullable - private final String flushTotalTime; + private final String getMissingTime; @Nullable - private final String getCurrent; + private final String getMissingTotal; @Nullable private final String getTime; @@ -124,16 +117,10 @@ public class ShardsRecord implements PlainJsonSerializable { private final String getTotal; @Nullable - private final String getExistsTime; - - @Nullable - private final String getExistsTotal; - - @Nullable - private final String getMissingTime; + private final String id; @Nullable - private final String getMissingTotal; + private final String index; @Nullable private final String indexingDeleteCurrent; @@ -147,6 +134,9 @@ public class ShardsRecord implements PlainJsonSerializable { @Nullable private final String indexingIndexCurrent; + @Nullable + private final String indexingIndexFailed; + @Nullable private final String indexingIndexTime; @@ -154,7 +144,7 @@ public class ShardsRecord implements PlainJsonSerializable { private final String indexingIndexTotal; @Nullable - private final String indexingIndexFailed; + private final String ip; @Nullable private final String mergesCurrent; @@ -178,20 +168,53 @@ public class ShardsRecord implements PlainJsonSerializable { private final String mergesTotalTime; @Nullable - private final String refreshTotal; + private final String node; @Nullable - private final String refreshTime; + private final String pathData; @Nullable - private final String refreshExternalTotal; + private final String pathState; + + @Nullable + private final String prirep; + + @Nullable + private final String queryCacheEvictions; + + @Nullable + private final String queryCacheMemorySize; + + @Nullable + private final String recoverysourceType; @Nullable private final String refreshExternalTime; + @Nullable + private final String refreshExternalTotal; + @Nullable private final String refreshListeners; + @Nullable + private final String refreshTime; + + @Nullable + private final String refreshTotal; + + @Nullable + private final String searchConcurrentAvgSliceCount; + + @Nullable + private final String searchConcurrentQueryCurrent; + + @Nullable + private final String searchConcurrentQueryTime; + + @Nullable + private final String searchConcurrentQueryTotal; + @Nullable private final String searchFetchCurrent; @@ -204,6 +227,15 @@ public class ShardsRecord implements PlainJsonSerializable { @Nullable private final String searchOpenContexts; + @Nullable + private final String searchPointInTimeCurrent; + + @Nullable + private final String searchPointInTimeTime; + + @Nullable + private final String searchPointInTimeTotal; + @Nullable private final String searchQueryCurrent; @@ -222,100 +254,98 @@ public class ShardsRecord implements PlainJsonSerializable { @Nullable private final String searchScrollTotal; + @Nullable + private final String searchSearchIdleReactivateCountTotal; + @Nullable private final String segmentsCount; @Nullable - private final String segmentsMemory; + private final String segmentsFixedBitsetMemory; @Nullable private final String segmentsIndexWriterMemory; @Nullable - private final String segmentsVersionMapMemory; + private final String segmentsMemory; @Nullable - private final String segmentsFixedBitsetMemory; + private final String segmentsVersionMapMemory; @Nullable - private final String seqNoMax; + private final String seqNoGlobalCheckpoint; @Nullable private final String seqNoLocalCheckpoint; @Nullable - private final String seqNoGlobalCheckpoint; + private final String seqNoMax; @Nullable - private final String warmerCurrent; + private final String shard; @Nullable - private final String warmerTotal; + private final String state; @Nullable - private final String warmerTotalTime; + private final String store; @Nullable - private final String pathData; + private final String syncId; @Nullable - private final String pathState; + private final String unassignedAt; @Nullable - private final String bulkTotalOperations; + private final String unassignedDetails; @Nullable - private final String bulkTotalTime; + private final String unassignedFor; @Nullable - private final String bulkTotalSizeInBytes; + private final String unassignedReason; @Nullable - private final String bulkAvgTime; + private final String warmerCurrent; @Nullable - private final String bulkAvgSizeInBytes; + private final String warmerTotal; + + @Nullable + private final String warmerTotalTime; // --------------------------------------------------------------------------------------------- private ShardsRecord(Builder builder) { - - this.index = builder.index; - this.shard = builder.shard; - this.prirep = builder.prirep; - this.state = builder.state; - this.docs = builder.docs; - this.store = builder.store; - this.ip = builder.ip; - this.id = builder.id; - this.node = builder.node; - this.syncId = builder.syncId; - this.unassignedReason = builder.unassignedReason; - this.unassignedAt = builder.unassignedAt; - this.unassignedFor = builder.unassignedFor; - this.unassignedDetails = builder.unassignedDetails; - this.recoverysourceType = builder.recoverysourceType; + this.bulkAvgSizeInBytes = builder.bulkAvgSizeInBytes; + this.bulkAvgTime = builder.bulkAvgTime; + this.bulkTotalOperations = builder.bulkTotalOperations; + this.bulkTotalSizeInBytes = builder.bulkTotalSizeInBytes; + this.bulkTotalTime = builder.bulkTotalTime; this.completionSize = builder.completionSize; - this.fielddataMemorySize = builder.fielddataMemorySize; + this.docs = builder.docs; + this.docsDeleted = builder.docsDeleted; this.fielddataEvictions = builder.fielddataEvictions; - this.queryCacheMemorySize = builder.queryCacheMemorySize; - this.queryCacheEvictions = builder.queryCacheEvictions; + this.fielddataMemorySize = builder.fielddataMemorySize; this.flushTotal = builder.flushTotal; this.flushTotalTime = builder.flushTotalTime; this.getCurrent = builder.getCurrent; - this.getTime = builder.getTime; - this.getTotal = builder.getTotal; this.getExistsTime = builder.getExistsTime; this.getExistsTotal = builder.getExistsTotal; this.getMissingTime = builder.getMissingTime; this.getMissingTotal = builder.getMissingTotal; + this.getTime = builder.getTime; + this.getTotal = builder.getTotal; + this.id = builder.id; + this.index = builder.index; this.indexingDeleteCurrent = builder.indexingDeleteCurrent; this.indexingDeleteTime = builder.indexingDeleteTime; this.indexingDeleteTotal = builder.indexingDeleteTotal; this.indexingIndexCurrent = builder.indexingIndexCurrent; + this.indexingIndexFailed = builder.indexingIndexFailed; this.indexingIndexTime = builder.indexingIndexTime; this.indexingIndexTotal = builder.indexingIndexTotal; - this.indexingIndexFailed = builder.indexingIndexFailed; + this.ip = builder.ip; this.mergesCurrent = builder.mergesCurrent; this.mergesCurrentDocs = builder.mergesCurrentDocs; this.mergesCurrentSize = builder.mergesCurrentSize; @@ -323,280 +353,250 @@ private ShardsRecord(Builder builder) { this.mergesTotalDocs = builder.mergesTotalDocs; this.mergesTotalSize = builder.mergesTotalSize; this.mergesTotalTime = builder.mergesTotalTime; - this.refreshTotal = builder.refreshTotal; - this.refreshTime = builder.refreshTime; - this.refreshExternalTotal = builder.refreshExternalTotal; + this.node = builder.node; + this.pathData = builder.pathData; + this.pathState = builder.pathState; + this.prirep = builder.prirep; + this.queryCacheEvictions = builder.queryCacheEvictions; + this.queryCacheMemorySize = builder.queryCacheMemorySize; + this.recoverysourceType = builder.recoverysourceType; this.refreshExternalTime = builder.refreshExternalTime; + this.refreshExternalTotal = builder.refreshExternalTotal; this.refreshListeners = builder.refreshListeners; + this.refreshTime = builder.refreshTime; + this.refreshTotal = builder.refreshTotal; + this.searchConcurrentAvgSliceCount = builder.searchConcurrentAvgSliceCount; + this.searchConcurrentQueryCurrent = builder.searchConcurrentQueryCurrent; + this.searchConcurrentQueryTime = builder.searchConcurrentQueryTime; + this.searchConcurrentQueryTotal = builder.searchConcurrentQueryTotal; this.searchFetchCurrent = builder.searchFetchCurrent; this.searchFetchTime = builder.searchFetchTime; this.searchFetchTotal = builder.searchFetchTotal; this.searchOpenContexts = builder.searchOpenContexts; + this.searchPointInTimeCurrent = builder.searchPointInTimeCurrent; + this.searchPointInTimeTime = builder.searchPointInTimeTime; + this.searchPointInTimeTotal = builder.searchPointInTimeTotal; this.searchQueryCurrent = builder.searchQueryCurrent; this.searchQueryTime = builder.searchQueryTime; this.searchQueryTotal = builder.searchQueryTotal; this.searchScrollCurrent = builder.searchScrollCurrent; this.searchScrollTime = builder.searchScrollTime; this.searchScrollTotal = builder.searchScrollTotal; + this.searchSearchIdleReactivateCountTotal = builder.searchSearchIdleReactivateCountTotal; this.segmentsCount = builder.segmentsCount; - this.segmentsMemory = builder.segmentsMemory; + this.segmentsFixedBitsetMemory = builder.segmentsFixedBitsetMemory; this.segmentsIndexWriterMemory = builder.segmentsIndexWriterMemory; + this.segmentsMemory = builder.segmentsMemory; this.segmentsVersionMapMemory = builder.segmentsVersionMapMemory; - this.segmentsFixedBitsetMemory = builder.segmentsFixedBitsetMemory; - this.seqNoMax = builder.seqNoMax; - this.seqNoLocalCheckpoint = builder.seqNoLocalCheckpoint; this.seqNoGlobalCheckpoint = builder.seqNoGlobalCheckpoint; + this.seqNoLocalCheckpoint = builder.seqNoLocalCheckpoint; + this.seqNoMax = builder.seqNoMax; + this.shard = builder.shard; + this.state = builder.state; + this.store = builder.store; + this.syncId = builder.syncId; + this.unassignedAt = builder.unassignedAt; + this.unassignedDetails = builder.unassignedDetails; + this.unassignedFor = builder.unassignedFor; + this.unassignedReason = builder.unassignedReason; this.warmerCurrent = builder.warmerCurrent; this.warmerTotal = builder.warmerTotal; this.warmerTotalTime = builder.warmerTotalTime; - this.pathData = builder.pathData; - this.pathState = builder.pathState; - this.bulkTotalOperations = builder.bulkTotalOperations; - this.bulkTotalTime = builder.bulkTotalTime; - this.bulkTotalSizeInBytes = builder.bulkTotalSizeInBytes; - this.bulkAvgTime = builder.bulkAvgTime; - this.bulkAvgSizeInBytes = builder.bulkAvgSizeInBytes; - } - public static ShardsRecord of(Function> fn) { + public static ShardsRecord of(Function> fn) { return fn.apply(new Builder()).build(); } /** - * index name + * The average size in bytes of shard bulk operations. *

- * API name: {@code index} + * API name: {@code bulk.avg_size_in_bytes} + *

*/ @Nullable - public final String index() { - return this.index; + public final String bulkAvgSizeInBytes() { + return this.bulkAvgSizeInBytes; } /** - * shard name + * The average time spent in shard bulk operations. *

- * API name: {@code shard} + * API name: {@code bulk.avg_time} + *

*/ @Nullable - public final String shard() { - return this.shard; + public final String bulkAvgTime() { + return this.bulkAvgTime; } /** - * primary or replica + * The number of bulk shard operations. *

- * API name: {@code prirep} + * API name: {@code bulk.total_operations} + *

*/ @Nullable - public final String prirep() { - return this.prirep; + public final String bulkTotalOperations() { + return this.bulkTotalOperations; } /** - * shard state + * The total size in bytes of shard bulk operations. *

- * API name: {@code state} + * API name: {@code bulk.total_size_in_bytes} + *

*/ @Nullable - public final String state() { - return this.state; + public final String bulkTotalSizeInBytes() { + return this.bulkTotalSizeInBytes; } /** - * number of docs in shard + * The time spent in shard bulk operations. *

- * API name: {@code docs} + * API name: {@code bulk.total_time} + *

*/ @Nullable - public final String docs() { - return this.docs; + public final String bulkTotalTime() { + return this.bulkTotalTime; } /** - * store size of shard (how much disk it uses) + * The size of completion. *

- * API name: {@code store} + * API name: {@code completion.size} + *

*/ @Nullable - public final String store() { - return this.store; + public final String completionSize() { + return this.completionSize; } /** - * ip of node where it lives + * The number of documents in the shard. *

- * API name: {@code ip} + * API name: {@code docs} + *

*/ @Nullable - public final String ip() { - return this.ip; + public final String docs() { + return this.docs; } /** - * unique id of node where it lives - *

- * API name: {@code id} - */ - @Nullable - public final String id() { - return this.id; - } - - /** - * name of node where it lives - *

- * API name: {@code node} - */ - @Nullable - public final String node() { - return this.node; - } - - /** - * sync id - *

- * API name: {@code sync_id} - */ - @Nullable - public final String syncId() { - return this.syncId; - } - - /** - * reason shard is unassigned - *

- * API name: {@code unassigned.reason} - */ - @Nullable - public final String unassignedReason() { - return this.unassignedReason; - } - - /** - * time shard became unassigned (UTC) - *

- * API name: {@code unassigned.at} - */ - @Nullable - public final String unassignedAt() { - return this.unassignedAt; - } - - /** - * time has been unassigned - *

- * API name: {@code unassigned.for} - */ - @Nullable - public final String unassignedFor() { - return this.unassignedFor; - } - - /** - * additional details as to why the shard became unassigned - *

- * API name: {@code unassigned.details} + * API name: {@code docs.deleted} */ @Nullable - public final String unassignedDetails() { - return this.unassignedDetails; + public final String docsDeleted() { + return this.docsDeleted; } /** - * recovery source type + * The field data cache evictions. *

- * API name: {@code recoverysource.type} + * API name: {@code fielddata.evictions} + *

*/ @Nullable - public final String recoverysourceType() { - return this.recoverysourceType; + public final String fielddataEvictions() { + return this.fielddataEvictions; } /** - * size of completion + * The used field data cache memory. *

- * API name: {@code completion.size} + * API name: {@code fielddata.memory_size} + *

*/ @Nullable - public final String completionSize() { - return this.completionSize; + public final String fielddataMemorySize() { + return this.fielddataMemorySize; } /** - * used fielddata cache + * The number of flushes. *

- * API name: {@code fielddata.memory_size} + * API name: {@code flush.total} + *

*/ @Nullable - public final String fielddataMemorySize() { - return this.fielddataMemorySize; + public final String flushTotal() { + return this.flushTotal; } /** - * fielddata evictions + * The time spent in flush. *

- * API name: {@code fielddata.evictions} + * API name: {@code flush.total_time} + *

*/ @Nullable - public final String fielddataEvictions() { - return this.fielddataEvictions; + public final String flushTotalTime() { + return this.flushTotalTime; } /** - * used query cache + * The number of current get operations. *

- * API name: {@code query_cache.memory_size} + * API name: {@code get.current} + *

*/ @Nullable - public final String queryCacheMemorySize() { - return this.queryCacheMemorySize; + public final String getCurrent() { + return this.getCurrent; } /** - * query cache evictions + * The time spent in successful get operations. *

- * API name: {@code query_cache.evictions} + * API name: {@code get.exists_time} + *

*/ @Nullable - public final String queryCacheEvictions() { - return this.queryCacheEvictions; + public final String getExistsTime() { + return this.getExistsTime; } /** - * number of flushes + * The number of successful get operations. *

- * API name: {@code flush.total} + * API name: {@code get.exists_total} + *

*/ @Nullable - public final String flushTotal() { - return this.flushTotal; + public final String getExistsTotal() { + return this.getExistsTotal; } /** - * time spent in flush + * The time spent in failed get operations. *

- * API name: {@code flush.total_time} + * API name: {@code get.missing_time} + *

*/ @Nullable - public final String flushTotalTime() { - return this.flushTotalTime; + public final String getMissingTime() { + return this.getMissingTime; } /** - * number of current get ops + * The number of failed get operations. *

- * API name: {@code get.current} + * API name: {@code get.missing_total} + *

*/ @Nullable - public final String getCurrent() { - return this.getCurrent; + public final String getMissingTotal() { + return this.getMissingTotal; } /** - * time spent in get + * The time spent in get operations. *

* API name: {@code get.time} + *

*/ @Nullable public final String getTime() { @@ -604,9 +604,10 @@ public final String getTime() { } /** - * number of get ops + * The number of get operations. *

* API name: {@code get.total} + *

*/ @Nullable public final String getTotal() { @@ -614,49 +615,32 @@ public final String getTotal() { } /** - * time spent in successful gets - *

- * API name: {@code get.exists_time} - */ - @Nullable - public final String getExistsTime() { - return this.getExistsTime; - } - - /** - * number of successful gets - *

- * API name: {@code get.exists_total} - */ - @Nullable - public final String getExistsTotal() { - return this.getExistsTotal; - } - - /** - * time spent in failed gets + * The unique identifier for the node. *

- * API name: {@code get.missing_time} + * API name: {@code id} + *

*/ @Nullable - public final String getMissingTime() { - return this.getMissingTime; + public final String id() { + return this.id; } /** - * number of failed gets + * The index name. *

- * API name: {@code get.missing_total} + * API name: {@code index} + *

*/ @Nullable - public final String getMissingTotal() { - return this.getMissingTotal; + public final String index() { + return this.index; } /** - * number of current deletions + * The number of current deletion operations. *

* API name: {@code indexing.delete_current} + *

*/ @Nullable public final String indexingDeleteCurrent() { @@ -664,9 +648,10 @@ public final String indexingDeleteCurrent() { } /** - * time spent in deletions + * The time spent in deletion operations. *

* API name: {@code indexing.delete_time} + *

*/ @Nullable public final String indexingDeleteTime() { @@ -674,9 +659,10 @@ public final String indexingDeleteTime() { } /** - * number of delete ops + * The number of delete operations. *

* API name: {@code indexing.delete_total} + *

*/ @Nullable public final String indexingDeleteTotal() { @@ -684,9 +670,10 @@ public final String indexingDeleteTotal() { } /** - * number of current indexing ops + * The number of current indexing operations. *

* API name: {@code indexing.index_current} + *

*/ @Nullable public final String indexingIndexCurrent() { @@ -694,9 +681,21 @@ public final String indexingIndexCurrent() { } /** - * time spent in indexing + * The number of failed indexing operations. + *

+ * API name: {@code indexing.index_failed} + *

+ */ + @Nullable + public final String indexingIndexFailed() { + return this.indexingIndexFailed; + } + + /** + * The time spent in indexing operations. *

* API name: {@code indexing.index_time} + *

*/ @Nullable public final String indexingIndexTime() { @@ -704,9 +703,10 @@ public final String indexingIndexTime() { } /** - * number of indexing ops + * The number of indexing operations. *

* API name: {@code indexing.index_total} + *

*/ @Nullable public final String indexingIndexTotal() { @@ -714,19 +714,21 @@ public final String indexingIndexTotal() { } /** - * number of failed indexing ops + * The IP address of the node. *

- * API name: {@code indexing.index_failed} + * API name: {@code ip} + *

*/ @Nullable - public final String indexingIndexFailed() { - return this.indexingIndexFailed; + public final String ip() { + return this.ip; } /** - * number of current merges + * The number of current merge operations. *

* API name: {@code merges.current} + *

*/ @Nullable public final String mergesCurrent() { @@ -734,9 +736,10 @@ public final String mergesCurrent() { } /** - * number of current merging docs + * The number of current merging documents. *

* API name: {@code merges.current_docs} + *

*/ @Nullable public final String mergesCurrentDocs() { @@ -744,9 +747,10 @@ public final String mergesCurrentDocs() { } /** - * size of current merges + * The size of current merge operations. *

* API name: {@code merges.current_size} + *

*/ @Nullable public final String mergesCurrentSize() { @@ -754,9 +758,10 @@ public final String mergesCurrentSize() { } /** - * number of completed merge ops + * The number of completed merge operations. *

* API name: {@code merges.total} + *

*/ @Nullable public final String mergesTotal() { @@ -764,9 +769,10 @@ public final String mergesTotal() { } /** - * docs merged + * The number of merged documents. *

* API name: {@code merges.total_docs} + *

*/ @Nullable public final String mergesTotalDocs() { @@ -774,9 +780,10 @@ public final String mergesTotalDocs() { } /** - * size merged + * The size of current merges. *

* API name: {@code merges.total_size} + *

*/ @Nullable public final String mergesTotalSize() { @@ -784,9 +791,10 @@ public final String mergesTotalSize() { } /** - * time spent in merges + * The time spent merging documents. *

* API name: {@code merges.total_time} + *

*/ @Nullable public final String mergesTotalTime() { @@ -794,200 +802,328 @@ public final String mergesTotalTime() { } /** - * total refreshes + * The name of node. *

- * API name: {@code refresh.total} + * API name: {@code node} + *

*/ @Nullable - public final String refreshTotal() { - return this.refreshTotal; + public final String node() { + return this.node; } /** - * time spent in refreshes + * The shard data path. *

- * API name: {@code refresh.time} + * API name: {@code path.data} + *

*/ @Nullable - public final String refreshTime() { - return this.refreshTime; + public final String pathData() { + return this.pathData; } /** - * total external refreshes + * The shard state path. *

- * API name: {@code refresh.external_total} + * API name: {@code path.state} + *

*/ @Nullable - public final String refreshExternalTotal() { - return this.refreshExternalTotal; + public final String pathState() { + return this.pathState; } /** - * time spent in external refreshes + * The shard type: primary or replica. *

- * API name: {@code refresh.external_time} + * API name: {@code prirep} + *

*/ @Nullable - public final String refreshExternalTime() { - return this.refreshExternalTime; + public final String prirep() { + return this.prirep; } /** - * number of pending refresh listeners + * The query cache evictions. *

- * API name: {@code refresh.listeners} + * API name: {@code query_cache.evictions} + *

*/ @Nullable - public final String refreshListeners() { - return this.refreshListeners; + public final String queryCacheEvictions() { + return this.queryCacheEvictions; } /** - * current fetch phase ops + * The used query cache memory. *

- * API name: {@code search.fetch_current} + * API name: {@code query_cache.memory_size} + *

*/ @Nullable - public final String searchFetchCurrent() { - return this.searchFetchCurrent; + public final String queryCacheMemorySize() { + return this.queryCacheMemorySize; } /** - * time spent in fetch phase + * The type of recovery source. *

- * API name: {@code search.fetch_time} + * API name: {@code recoverysource.type} + *

*/ @Nullable - public final String searchFetchTime() { - return this.searchFetchTime; + public final String recoverysourceType() { + return this.recoverysourceType; } /** - * total fetch ops + * The time spent in external refreshes. *

- * API name: {@code search.fetch_total} + * API name: {@code refresh.external_time} + *

*/ @Nullable - public final String searchFetchTotal() { - return this.searchFetchTotal; + public final String refreshExternalTime() { + return this.refreshExternalTime; } /** - * open search contexts + * The total number of external refreshes. *

- * API name: {@code search.open_contexts} + * API name: {@code refresh.external_total} + *

*/ @Nullable - public final String searchOpenContexts() { - return this.searchOpenContexts; + public final String refreshExternalTotal() { + return this.refreshExternalTotal; } /** - * current query phase ops + * The number of pending refresh listeners. *

- * API name: {@code search.query_current} + * API name: {@code refresh.listeners} + *

*/ @Nullable - public final String searchQueryCurrent() { - return this.searchQueryCurrent; + public final String refreshListeners() { + return this.refreshListeners; } /** - * time spent in query phase + * The time spent in refreshes. *

- * API name: {@code search.query_time} + * API name: {@code refresh.time} + *

*/ @Nullable - public final String searchQueryTime() { - return this.searchQueryTime; + public final String refreshTime() { + return this.refreshTime; } /** - * total query phase ops + * The total number of refreshes. *

- * API name: {@code search.query_total} + * API name: {@code refresh.total} + *

*/ @Nullable - public final String searchQueryTotal() { - return this.searchQueryTotal; + public final String refreshTotal() { + return this.refreshTotal; } /** - * open scroll contexts - *

- * API name: {@code search.scroll_current} + * API name: {@code search.concurrent_avg_slice_count} */ @Nullable - public final String searchScrollCurrent() { - return this.searchScrollCurrent; + public final String searchConcurrentAvgSliceCount() { + return this.searchConcurrentAvgSliceCount; } /** - * time scroll contexts held open - *

- * API name: {@code search.scroll_time} + * API name: {@code search.concurrent_query_current} */ @Nullable - public final String searchScrollTime() { - return this.searchScrollTime; + public final String searchConcurrentQueryCurrent() { + return this.searchConcurrentQueryCurrent; } /** - * completed scroll contexts - *

- * API name: {@code search.scroll_total} + * API name: {@code search.concurrent_query_time} */ @Nullable - public final String searchScrollTotal() { - return this.searchScrollTotal; + public final String searchConcurrentQueryTime() { + return this.searchConcurrentQueryTime; } /** - * number of segments - *

- * API name: {@code segments.count} + * API name: {@code search.concurrent_query_total} */ @Nullable - public final String segmentsCount() { - return this.segmentsCount; + public final String searchConcurrentQueryTotal() { + return this.searchConcurrentQueryTotal; } /** - * memory used by segments + * The current fetch phase operations. *

- * API name: {@code segments.memory} + * API name: {@code search.fetch_current} + *

*/ @Nullable - public final String segmentsMemory() { - return this.segmentsMemory; + public final String searchFetchCurrent() { + return this.searchFetchCurrent; } /** - * memory used by index writer + * The time spent in fetch phase. *

- * API name: {@code segments.index_writer_memory} + * API name: {@code search.fetch_time} + *

*/ @Nullable - public final String segmentsIndexWriterMemory() { - return this.segmentsIndexWriterMemory; - } + public final String searchFetchTime() { + return this.searchFetchTime; + } /** - * memory used by version map + * The total number of fetch operations. *

- * API name: {@code segments.version_map_memory} + * API name: {@code search.fetch_total} + *

*/ @Nullable - public final String segmentsVersionMapMemory() { - return this.segmentsVersionMapMemory; + public final String searchFetchTotal() { + return this.searchFetchTotal; + } + + /** + * The number of open search contexts. + *

+ * API name: {@code search.open_contexts} + *

+ */ + @Nullable + public final String searchOpenContexts() { + return this.searchOpenContexts; + } + + /** + * API name: {@code search.point_in_time_current} + */ + @Nullable + public final String searchPointInTimeCurrent() { + return this.searchPointInTimeCurrent; + } + + /** + * API name: {@code search.point_in_time_time} + */ + @Nullable + public final String searchPointInTimeTime() { + return this.searchPointInTimeTime; } /** - * memory used by fixed bit sets for nested object field types and export type - * filters for types referred in _parent fields + * API name: {@code search.point_in_time_total} + */ + @Nullable + public final String searchPointInTimeTotal() { + return this.searchPointInTimeTotal; + } + + /** + * The current query phase operations. + *

+ * API name: {@code search.query_current} + *

+ */ + @Nullable + public final String searchQueryCurrent() { + return this.searchQueryCurrent; + } + + /** + * The time spent in query phase. + *

+ * API name: {@code search.query_time} + *

+ */ + @Nullable + public final String searchQueryTime() { + return this.searchQueryTime; + } + + /** + * The total number of query phase operations. + *

+ * API name: {@code search.query_total} + *

+ */ + @Nullable + public final String searchQueryTotal() { + return this.searchQueryTotal; + } + + /** + * The open scroll contexts. + *

+ * API name: {@code search.scroll_current} + *

+ */ + @Nullable + public final String searchScrollCurrent() { + return this.searchScrollCurrent; + } + + /** + * The time scroll contexts were held open. + *

+ * API name: {@code search.scroll_time} + *

+ */ + @Nullable + public final String searchScrollTime() { + return this.searchScrollTime; + } + + /** + * The number of completed scroll contexts. + *

+ * API name: {@code search.scroll_total} + *

+ */ + @Nullable + public final String searchScrollTotal() { + return this.searchScrollTotal; + } + + /** + * API name: {@code search.search_idle_reactivate_count_total} + */ + @Nullable + public final String searchSearchIdleReactivateCountTotal() { + return this.searchSearchIdleReactivateCountTotal; + } + + /** + * The number of segments. + *

+ * API name: {@code segments.count} + *

+ */ + @Nullable + public final String segmentsCount() { + return this.segmentsCount; + } + + /** + * The memory used by fixed bit sets for nested object field types and export type filters for types referred in _parent + * fields. *

* API name: {@code segments.fixed_bitset_memory} + *

*/ @Nullable public final String segmentsFixedBitsetMemory() { @@ -995,29 +1131,43 @@ public final String segmentsFixedBitsetMemory() { } /** - * max sequence number + * The memory used by the index writer. *

- * API name: {@code seq_no.max} + * API name: {@code segments.index_writer_memory} + *

*/ @Nullable - public final String seqNoMax() { - return this.seqNoMax; + public final String segmentsIndexWriterMemory() { + return this.segmentsIndexWriterMemory; } /** - * local checkpoint + * The memory used by segments. *

- * API name: {@code seq_no.local_checkpoint} + * API name: {@code segments.memory} + *

*/ @Nullable - public final String seqNoLocalCheckpoint() { - return this.seqNoLocalCheckpoint; + public final String segmentsMemory() { + return this.segmentsMemory; + } + + /** + * The memory used by the version map. + *

+ * API name: {@code segments.version_map_memory} + *

+ */ + @Nullable + public final String segmentsVersionMapMemory() { + return this.segmentsVersionMapMemory; } /** - * global checkpoint + * The global checkpoint. *

* API name: {@code seq_no.global_checkpoint} + *

*/ @Nullable public final String seqNoGlobalCheckpoint() { @@ -1025,108 +1175,169 @@ public final String seqNoGlobalCheckpoint() { } /** - * current warmer ops + * The local checkpoint. *

- * API name: {@code warmer.current} + * API name: {@code seq_no.local_checkpoint} + *

*/ @Nullable - public final String warmerCurrent() { - return this.warmerCurrent; + public final String seqNoLocalCheckpoint() { + return this.seqNoLocalCheckpoint; } /** - * total warmer ops + * The maximum sequence number. *

- * API name: {@code warmer.total} + * API name: {@code seq_no.max} + *

*/ @Nullable - public final String warmerTotal() { - return this.warmerTotal; + public final String seqNoMax() { + return this.seqNoMax; } /** - * time spent in warmers + * The shard name. *

- * API name: {@code warmer.total_time} + * API name: {@code shard} + *

*/ @Nullable - public final String warmerTotalTime() { - return this.warmerTotalTime; + public final String shard() { + return this.shard; } /** - * shard data path + * The shard state. Returned values include: INITIALIZING: The shard is recovering from a peer shard or gateway. + * RELOCATING: The shard is relocating. STARTED: The shard has started. UNASSIGNED: The shard is + * not assigned to any node. *

- * API name: {@code path.data} + * API name: {@code state} + *

*/ @Nullable - public final String pathData() { - return this.pathData; + public final String state() { + return this.state; } /** - * shard state path + * The disk space used by the shard. *

- * API name: {@code path.state} + * API name: {@code store} + *

*/ @Nullable - public final String pathState() { - return this.pathState; + public final String store() { + return this.store; } /** - * number of bulk shard ops + * The sync identifier. *

- * API name: {@code bulk.total_operations} + * API name: {@code sync_id} + *

*/ @Nullable - public final String bulkTotalOperations() { - return this.bulkTotalOperations; + public final String syncId() { + return this.syncId; } /** - * time spend in shard bulk + * The time at which the shard became unassigned in Coordinated Universal Time (UTC). *

- * API name: {@code bulk.total_time} + * API name: {@code unassigned.at} + *

*/ @Nullable - public final String bulkTotalTime() { - return this.bulkTotalTime; + public final String unassignedAt() { + return this.unassignedAt; } /** - * total size in bytes of shard bulk + * Additional details as to why the shard became unassigned. It does not explain why the shard is not assigned; use the cluster + * allocation explain API for that information. *

- * API name: {@code bulk.total_size_in_bytes} + * API name: {@code unassigned.details} + *

*/ @Nullable - public final String bulkTotalSizeInBytes() { - return this.bulkTotalSizeInBytes; + public final String unassignedDetails() { + return this.unassignedDetails; } /** - * average time spend in shard bulk + * The time at which the shard was requested to be unassigned in Coordinated Universal Time (UTC). *

- * API name: {@code bulk.avg_time} + * API name: {@code unassigned.for} + *

*/ @Nullable - public final String bulkAvgTime() { - return this.bulkAvgTime; + public final String unassignedFor() { + return this.unassignedFor; } /** - * avg size in bytes of shard bulk + * The reason for the last change to the state of an unassigned shard. It does not explain why the shard is currently unassigned; use + * the cluster allocation explain API for that information. Returned values include: ALLOCATION_FAILED: Unassigned as a + * result of a failed allocation of the shard. CLUSTER_RECOVERED: Unassigned as a result of a full cluster recovery. + * DANGLING_INDEX_IMPORTED: Unassigned as a result of importing a dangling index. EXISTING_INDEX_RESTORED: + * Unassigned as a result of restoring into a closed index. FORCED_EMPTY_PRIMARY: The shard's allocation was last modified + * by forcing an empty primary using the cluster reroute API. INDEX_CLOSED: Unassigned because the index was closed. + * INDEX_CREATED: Unassigned as a result of an API creation of an index. INDEX_REOPENED: Unassigned as a + * result of opening a closed index. MANUAL_ALLOCATION: The shard's allocation was last modified by the cluster reroute + * API. NEW_INDEX_RESTORED: Unassigned as a result of restoring into a new index. NODE_LEFT: Unassigned as a + * result of the node hosting it leaving the cluster. NODE_RESTARTING: Similar to NODE_LEFT, except that the + * node was registered as restarting using the node shutdown API. PRIMARY_FAILED: The shard was initializing as a replica, + * but the primary shard failed before the initialization completed. REALLOCATED_REPLICA: A better replica location is + * identified and causes the existing replica allocation to be cancelled. REINITIALIZED: When a shard moves from started + * back to initializing. REPLICA_ADDED: Unassigned as a result of explicit addition of a replica. + * REROUTE_CANCELLED: Unassigned as a result of explicit cancel reroute command. *

- * API name: {@code bulk.avg_size_in_bytes} + * API name: {@code unassigned.reason} + *

*/ @Nullable - public final String bulkAvgSizeInBytes() { - return this.bulkAvgSizeInBytes; + public final String unassignedReason() { + return this.unassignedReason; + } + + /** + * The number of current warmer operations. + *

+ * API name: {@code warmer.current} + *

+ */ + @Nullable + public final String warmerCurrent() { + return this.warmerCurrent; + } + + /** + * The total number of warmer operations. + *

+ * API name: {@code warmer.total} + *

+ */ + @Nullable + public final String warmerTotal() { + return this.warmerTotal; + } + + /** + * The time spent in warmer operations. + *

+ * API name: {@code warmer.total_time} + *

+ */ + @Nullable + public final String warmerTotalTime() { + return this.warmerTotalTime; } /** * Serialize this object to JSON. */ + @Override public void serialize(JsonGenerator generator, JsonpMapper mapper) { generator.writeStartObject(); serializeInternal(generator, mapper); @@ -1134,1392 +1345,1823 @@ public void serialize(JsonGenerator generator, JsonpMapper mapper) { } protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { - - if (this.index != null) { - generator.writeKey("index"); - generator.write(this.index); - - } - if (this.shard != null) { - generator.writeKey("shard"); - generator.write(this.shard); - - } - if (this.prirep != null) { - generator.writeKey("prirep"); - generator.write(this.prirep); - - } - if (this.state != null) { - generator.writeKey("state"); - generator.write(this.state); - - } - if (this.docs != null) { - generator.writeKey("docs"); - generator.write(this.docs); - - } - if (this.store != null) { - generator.writeKey("store"); - generator.write(this.store); - - } - if (this.ip != null) { - generator.writeKey("ip"); - generator.write(this.ip); - - } - if (this.id != null) { - generator.writeKey("id"); - generator.write(this.id); - - } - if (this.node != null) { - generator.writeKey("node"); - generator.write(this.node); - - } - if (this.syncId != null) { - generator.writeKey("sync_id"); - generator.write(this.syncId); - + if (this.bulkAvgSizeInBytes != null) { + generator.writeKey("bulk.avg_size_in_bytes"); + generator.write(this.bulkAvgSizeInBytes); } - if (this.unassignedReason != null) { - generator.writeKey("unassigned.reason"); - generator.write(this.unassignedReason); + if (this.bulkAvgTime != null) { + generator.writeKey("bulk.avg_time"); + generator.write(this.bulkAvgTime); } - if (this.unassignedAt != null) { - generator.writeKey("unassigned.at"); - generator.write(this.unassignedAt); + if (this.bulkTotalOperations != null) { + generator.writeKey("bulk.total_operations"); + generator.write(this.bulkTotalOperations); } - if (this.unassignedFor != null) { - generator.writeKey("unassigned.for"); - generator.write(this.unassignedFor); + if (this.bulkTotalSizeInBytes != null) { + generator.writeKey("bulk.total_size_in_bytes"); + generator.write(this.bulkTotalSizeInBytes); } - if (this.unassignedDetails != null) { - generator.writeKey("unassigned.details"); - generator.write(this.unassignedDetails); + if (this.bulkTotalTime != null) { + generator.writeKey("bulk.total_time"); + generator.write(this.bulkTotalTime); } - if (this.recoverysourceType != null) { - generator.writeKey("recoverysource.type"); - generator.write(this.recoverysourceType); - } if (this.completionSize != null) { generator.writeKey("completion.size"); generator.write(this.completionSize); + } + if (this.docs != null) { + generator.writeKey("docs"); + generator.write(this.docs); } - if (this.fielddataMemorySize != null) { - generator.writeKey("fielddata.memory_size"); - generator.write(this.fielddataMemorySize); + if (this.docsDeleted != null) { + generator.writeKey("docs.deleted"); + generator.write(this.docsDeleted); } + if (this.fielddataEvictions != null) { generator.writeKey("fielddata.evictions"); generator.write(this.fielddataEvictions); - } - if (this.queryCacheMemorySize != null) { - generator.writeKey("query_cache.memory_size"); - generator.write(this.queryCacheMemorySize); + if (this.fielddataMemorySize != null) { + generator.writeKey("fielddata.memory_size"); + generator.write(this.fielddataMemorySize); } - if (this.queryCacheEvictions != null) { - generator.writeKey("query_cache.evictions"); - generator.write(this.queryCacheEvictions); - } if (this.flushTotal != null) { generator.writeKey("flush.total"); generator.write(this.flushTotal); - } + if (this.flushTotalTime != null) { generator.writeKey("flush.total_time"); generator.write(this.flushTotalTime); - } + if (this.getCurrent != null) { generator.writeKey("get.current"); generator.write(this.getCurrent); - } - if (this.getTime != null) { - generator.writeKey("get.time"); - generator.write(this.getTime); - } - if (this.getTotal != null) { - generator.writeKey("get.total"); - generator.write(this.getTotal); - - } if (this.getExistsTime != null) { generator.writeKey("get.exists_time"); generator.write(this.getExistsTime); - } + if (this.getExistsTotal != null) { generator.writeKey("get.exists_total"); generator.write(this.getExistsTotal); - } + if (this.getMissingTime != null) { generator.writeKey("get.missing_time"); generator.write(this.getMissingTime); - } + if (this.getMissingTotal != null) { generator.writeKey("get.missing_total"); generator.write(this.getMissingTotal); + } + if (this.getTime != null) { + generator.writeKey("get.time"); + generator.write(this.getTime); } + + if (this.getTotal != null) { + generator.writeKey("get.total"); + generator.write(this.getTotal); + } + + if (this.id != null) { + generator.writeKey("id"); + generator.write(this.id); + } + + if (this.index != null) { + generator.writeKey("index"); + generator.write(this.index); + } + if (this.indexingDeleteCurrent != null) { generator.writeKey("indexing.delete_current"); generator.write(this.indexingDeleteCurrent); - } + if (this.indexingDeleteTime != null) { generator.writeKey("indexing.delete_time"); generator.write(this.indexingDeleteTime); - } + if (this.indexingDeleteTotal != null) { generator.writeKey("indexing.delete_total"); generator.write(this.indexingDeleteTotal); - } + if (this.indexingIndexCurrent != null) { generator.writeKey("indexing.index_current"); generator.write(this.indexingIndexCurrent); + } + if (this.indexingIndexFailed != null) { + generator.writeKey("indexing.index_failed"); + generator.write(this.indexingIndexFailed); } + if (this.indexingIndexTime != null) { generator.writeKey("indexing.index_time"); generator.write(this.indexingIndexTime); - } + if (this.indexingIndexTotal != null) { generator.writeKey("indexing.index_total"); generator.write(this.indexingIndexTotal); - } - if (this.indexingIndexFailed != null) { - generator.writeKey("indexing.index_failed"); - generator.write(this.indexingIndexFailed); + if (this.ip != null) { + generator.writeKey("ip"); + generator.write(this.ip); } + if (this.mergesCurrent != null) { generator.writeKey("merges.current"); generator.write(this.mergesCurrent); - } + if (this.mergesCurrentDocs != null) { generator.writeKey("merges.current_docs"); generator.write(this.mergesCurrentDocs); - } + if (this.mergesCurrentSize != null) { generator.writeKey("merges.current_size"); generator.write(this.mergesCurrentSize); - } + if (this.mergesTotal != null) { generator.writeKey("merges.total"); generator.write(this.mergesTotal); - } + if (this.mergesTotalDocs != null) { generator.writeKey("merges.total_docs"); generator.write(this.mergesTotalDocs); - } + if (this.mergesTotalSize != null) { generator.writeKey("merges.total_size"); generator.write(this.mergesTotalSize); - } + if (this.mergesTotalTime != null) { generator.writeKey("merges.total_time"); generator.write(this.mergesTotalTime); + } + if (this.node != null) { + generator.writeKey("node"); + generator.write(this.node); } - if (this.refreshTotal != null) { - generator.writeKey("refresh.total"); - generator.write(this.refreshTotal); + if (this.pathData != null) { + generator.writeKey("path.data"); + generator.write(this.pathData); } - if (this.refreshTime != null) { - generator.writeKey("refresh.time"); - generator.write(this.refreshTime); + if (this.pathState != null) { + generator.writeKey("path.state"); + generator.write(this.pathState); + } + + if (this.prirep != null) { + generator.writeKey("prirep"); + generator.write(this.prirep); + } + + if (this.queryCacheEvictions != null) { + generator.writeKey("query_cache.evictions"); + generator.write(this.queryCacheEvictions); } - if (this.refreshExternalTotal != null) { - generator.writeKey("refresh.external_total"); - generator.write(this.refreshExternalTotal); + if (this.queryCacheMemorySize != null) { + generator.writeKey("query_cache.memory_size"); + generator.write(this.queryCacheMemorySize); } + + if (this.recoverysourceType != null) { + generator.writeKey("recoverysource.type"); + generator.write(this.recoverysourceType); + } + if (this.refreshExternalTime != null) { generator.writeKey("refresh.external_time"); generator.write(this.refreshExternalTime); + } + + if (this.refreshExternalTotal != null) { + generator.writeKey("refresh.external_total"); + generator.write(this.refreshExternalTotal); + } + + if (this.refreshListeners != null) { + generator.writeKey("refresh.listeners"); + generator.write(this.refreshListeners); + } + + if (this.refreshTime != null) { + generator.writeKey("refresh.time"); + generator.write(this.refreshTime); + } + + if (this.refreshTotal != null) { + generator.writeKey("refresh.total"); + generator.write(this.refreshTotal); + } + + if (this.searchConcurrentAvgSliceCount != null) { + generator.writeKey("search.concurrent_avg_slice_count"); + generator.write(this.searchConcurrentAvgSliceCount); + } + if (this.searchConcurrentQueryCurrent != null) { + generator.writeKey("search.concurrent_query_current"); + generator.write(this.searchConcurrentQueryCurrent); + } + + if (this.searchConcurrentQueryTime != null) { + generator.writeKey("search.concurrent_query_time"); + generator.write(this.searchConcurrentQueryTime); } - if (this.refreshListeners != null) { - generator.writeKey("refresh.listeners"); - generator.write(this.refreshListeners); + if (this.searchConcurrentQueryTotal != null) { + generator.writeKey("search.concurrent_query_total"); + generator.write(this.searchConcurrentQueryTotal); } + if (this.searchFetchCurrent != null) { generator.writeKey("search.fetch_current"); generator.write(this.searchFetchCurrent); - } + if (this.searchFetchTime != null) { generator.writeKey("search.fetch_time"); generator.write(this.searchFetchTime); - } + if (this.searchFetchTotal != null) { generator.writeKey("search.fetch_total"); generator.write(this.searchFetchTotal); - } + if (this.searchOpenContexts != null) { generator.writeKey("search.open_contexts"); generator.write(this.searchOpenContexts); + } + + if (this.searchPointInTimeCurrent != null) { + generator.writeKey("search.point_in_time_current"); + generator.write(this.searchPointInTimeCurrent); + } + + if (this.searchPointInTimeTime != null) { + generator.writeKey("search.point_in_time_time"); + generator.write(this.searchPointInTimeTime); + } + if (this.searchPointInTimeTotal != null) { + generator.writeKey("search.point_in_time_total"); + generator.write(this.searchPointInTimeTotal); } + if (this.searchQueryCurrent != null) { generator.writeKey("search.query_current"); generator.write(this.searchQueryCurrent); - } + if (this.searchQueryTime != null) { generator.writeKey("search.query_time"); generator.write(this.searchQueryTime); - } + if (this.searchQueryTotal != null) { generator.writeKey("search.query_total"); generator.write(this.searchQueryTotal); - } + if (this.searchScrollCurrent != null) { generator.writeKey("search.scroll_current"); generator.write(this.searchScrollCurrent); - } + if (this.searchScrollTime != null) { generator.writeKey("search.scroll_time"); generator.write(this.searchScrollTime); - } + if (this.searchScrollTotal != null) { generator.writeKey("search.scroll_total"); generator.write(this.searchScrollTotal); + } + if (this.searchSearchIdleReactivateCountTotal != null) { + generator.writeKey("search.search_idle_reactivate_count_total"); + generator.write(this.searchSearchIdleReactivateCountTotal); } + if (this.segmentsCount != null) { generator.writeKey("segments.count"); generator.write(this.segmentsCount); - } - if (this.segmentsMemory != null) { - generator.writeKey("segments.memory"); - generator.write(this.segmentsMemory); + if (this.segmentsFixedBitsetMemory != null) { + generator.writeKey("segments.fixed_bitset_memory"); + generator.write(this.segmentsFixedBitsetMemory); } + if (this.segmentsIndexWriterMemory != null) { generator.writeKey("segments.index_writer_memory"); generator.write(this.segmentsIndexWriterMemory); + } + if (this.segmentsMemory != null) { + generator.writeKey("segments.memory"); + generator.write(this.segmentsMemory); } + if (this.segmentsVersionMapMemory != null) { generator.writeKey("segments.version_map_memory"); generator.write(this.segmentsVersionMapMemory); - } - if (this.segmentsFixedBitsetMemory != null) { - generator.writeKey("segments.fixed_bitset_memory"); - generator.write(this.segmentsFixedBitsetMemory); + if (this.seqNoGlobalCheckpoint != null) { + generator.writeKey("seq_no.global_checkpoint"); + generator.write(this.seqNoGlobalCheckpoint); } - if (this.seqNoMax != null) { - generator.writeKey("seq_no.max"); - generator.write(this.seqNoMax); - } if (this.seqNoLocalCheckpoint != null) { generator.writeKey("seq_no.local_checkpoint"); generator.write(this.seqNoLocalCheckpoint); - } - if (this.seqNoGlobalCheckpoint != null) { - generator.writeKey("seq_no.global_checkpoint"); - generator.write(this.seqNoGlobalCheckpoint); + if (this.seqNoMax != null) { + generator.writeKey("seq_no.max"); + generator.write(this.seqNoMax); } - if (this.warmerCurrent != null) { - generator.writeKey("warmer.current"); - generator.write(this.warmerCurrent); + if (this.shard != null) { + generator.writeKey("shard"); + generator.write(this.shard); } - if (this.warmerTotal != null) { - generator.writeKey("warmer.total"); - generator.write(this.warmerTotal); + if (this.state != null) { + generator.writeKey("state"); + generator.write(this.state); } - if (this.warmerTotalTime != null) { - generator.writeKey("warmer.total_time"); - generator.write(this.warmerTotalTime); + if (this.store != null) { + generator.writeKey("store"); + generator.write(this.store); } - if (this.pathData != null) { - generator.writeKey("path.data"); - generator.write(this.pathData); + if (this.syncId != null) { + generator.writeKey("sync_id"); + generator.write(this.syncId); } - if (this.pathState != null) { - generator.writeKey("path.state"); - generator.write(this.pathState); + if (this.unassignedAt != null) { + generator.writeKey("unassigned.at"); + generator.write(this.unassignedAt); } - if (this.bulkTotalOperations != null) { - generator.writeKey("bulk.total_operations"); - generator.write(this.bulkTotalOperations); + if (this.unassignedDetails != null) { + generator.writeKey("unassigned.details"); + generator.write(this.unassignedDetails); } - if (this.bulkTotalTime != null) { - generator.writeKey("bulk.total_time"); - generator.write(this.bulkTotalTime); + if (this.unassignedFor != null) { + generator.writeKey("unassigned.for"); + generator.write(this.unassignedFor); } - if (this.bulkTotalSizeInBytes != null) { - generator.writeKey("bulk.total_size_in_bytes"); - generator.write(this.bulkTotalSizeInBytes); + if (this.unassignedReason != null) { + generator.writeKey("unassigned.reason"); + generator.write(this.unassignedReason); } - if (this.bulkAvgTime != null) { - generator.writeKey("bulk.avg_time"); - generator.write(this.bulkAvgTime); + if (this.warmerCurrent != null) { + generator.writeKey("warmer.current"); + generator.write(this.warmerCurrent); } - if (this.bulkAvgSizeInBytes != null) { - generator.writeKey("bulk.avg_size_in_bytes"); - generator.write(this.bulkAvgSizeInBytes); + if (this.warmerTotal != null) { + generator.writeKey("warmer.total"); + generator.write(this.warmerTotal); } + if (this.warmerTotalTime != null) { + generator.writeKey("warmer.total_time"); + generator.write(this.warmerTotalTime); + } } // --------------------------------------------------------------------------------------------- + @Override + @Nonnull + public Builder toBuilder() { + return new Builder(this); + } + + @Nonnull + public static Builder builder() { + return new Builder(); + } + /** * Builder for {@link ShardsRecord}. */ - - public static class Builder extends ObjectBuilderBase implements ObjectBuilder { - @Nullable - private String index; - - @Nullable - private String shard; - - @Nullable - private String prirep; - - @Nullable - private String state; - - @Nullable - private String docs; - - @Nullable - private String store; - - @Nullable - private String ip; - - @Nullable - private String id; - - @Nullable - private String node; - - @Nullable - private String syncId; - + public static class Builder extends ObjectBuilderBase implements CopyableBuilder { @Nullable - private String unassignedReason; - + private String bulkAvgSizeInBytes; @Nullable - private String unassignedAt; - + private String bulkAvgTime; @Nullable - private String unassignedFor; - + private String bulkTotalOperations; @Nullable - private String unassignedDetails; - + private String bulkTotalSizeInBytes; @Nullable - private String recoverysourceType; - + private String bulkTotalTime; @Nullable private String completionSize; - @Nullable - private String fielddataMemorySize; - + private String docs; @Nullable - private String fielddataEvictions; - + private String docsDeleted; @Nullable - private String queryCacheMemorySize; - + private String fielddataEvictions; @Nullable - private String queryCacheEvictions; - + private String fielddataMemorySize; @Nullable private String flushTotal; - @Nullable private String flushTotalTime; - @Nullable private String getCurrent; - - @Nullable - private String getTime; - - @Nullable - private String getTotal; - @Nullable private String getExistsTime; - @Nullable private String getExistsTotal; - @Nullable private String getMissingTime; - @Nullable private String getMissingTotal; - + @Nullable + private String getTime; + @Nullable + private String getTotal; + @Nullable + private String id; + @Nullable + private String index; @Nullable private String indexingDeleteCurrent; - @Nullable private String indexingDeleteTime; - @Nullable private String indexingDeleteTotal; - @Nullable private String indexingIndexCurrent; - + @Nullable + private String indexingIndexFailed; @Nullable private String indexingIndexTime; - @Nullable private String indexingIndexTotal; - @Nullable - private String indexingIndexFailed; - + private String ip; @Nullable private String mergesCurrent; - @Nullable private String mergesCurrentDocs; - @Nullable private String mergesCurrentSize; - @Nullable private String mergesTotal; - @Nullable private String mergesTotalDocs; - @Nullable private String mergesTotalSize; - @Nullable private String mergesTotalTime; - @Nullable - private String refreshTotal; - + private String node; @Nullable - private String refreshTime; - + private String pathData; @Nullable - private String refreshExternalTotal; - + private String pathState; + @Nullable + private String prirep; + @Nullable + private String queryCacheEvictions; + @Nullable + private String queryCacheMemorySize; + @Nullable + private String recoverysourceType; @Nullable private String refreshExternalTime; - + @Nullable + private String refreshExternalTotal; @Nullable private String refreshListeners; - + @Nullable + private String refreshTime; + @Nullable + private String refreshTotal; + @Nullable + private String searchConcurrentAvgSliceCount; + @Nullable + private String searchConcurrentQueryCurrent; + @Nullable + private String searchConcurrentQueryTime; + @Nullable + private String searchConcurrentQueryTotal; @Nullable private String searchFetchCurrent; - @Nullable private String searchFetchTime; - @Nullable private String searchFetchTotal; - @Nullable private String searchOpenContexts; - + @Nullable + private String searchPointInTimeCurrent; + @Nullable + private String searchPointInTimeTime; + @Nullable + private String searchPointInTimeTotal; @Nullable private String searchQueryCurrent; - @Nullable private String searchQueryTime; - @Nullable private String searchQueryTotal; - @Nullable private String searchScrollCurrent; - @Nullable private String searchScrollTime; - @Nullable private String searchScrollTotal; - + @Nullable + private String searchSearchIdleReactivateCountTotal; @Nullable private String segmentsCount; - @Nullable - private String segmentsMemory; - + private String segmentsFixedBitsetMemory; @Nullable private String segmentsIndexWriterMemory; - @Nullable - private String segmentsVersionMapMemory; - + private String segmentsMemory; @Nullable - private String segmentsFixedBitsetMemory; - + private String segmentsVersionMapMemory; @Nullable - private String seqNoMax; - + private String seqNoGlobalCheckpoint; @Nullable private String seqNoLocalCheckpoint; - @Nullable - private String seqNoGlobalCheckpoint; - + private String seqNoMax; @Nullable - private String warmerCurrent; - + private String shard; @Nullable - private String warmerTotal; - + private String state; @Nullable - private String warmerTotalTime; - + private String store; @Nullable - private String pathData; - + private String syncId; @Nullable - private String pathState; - + private String unassignedAt; @Nullable - private String bulkTotalOperations; - + private String unassignedDetails; @Nullable - private String bulkTotalTime; - + private String unassignedFor; @Nullable - private String bulkTotalSizeInBytes; - + private String unassignedReason; @Nullable - private String bulkAvgTime; - + private String warmerCurrent; @Nullable - private String bulkAvgSizeInBytes; - - /** - * index name - *

- * API name: {@code index} - */ - public final Builder index(@Nullable String value) { - this.index = value; - return this; - } - - /** - * shard name - *

- * API name: {@code shard} - */ - public final Builder shard(@Nullable String value) { - this.shard = value; - return this; - } - - /** - * primary or replica - *

- * API name: {@code prirep} - */ - public final Builder prirep(@Nullable String value) { - this.prirep = value; - return this; - } - - /** - * shard state - *

- * API name: {@code state} - */ - public final Builder state(@Nullable String value) { - this.state = value; - return this; - } - - /** - * number of docs in shard - *

- * API name: {@code docs} - */ - public final Builder docs(@Nullable String value) { - this.docs = value; - return this; - } - - /** - * store size of shard (how much disk it uses) - *

- * API name: {@code store} - */ - public final Builder store(@Nullable String value) { - this.store = value; - return this; - } + private String warmerTotal; + @Nullable + private String warmerTotalTime; - /** - * ip of node where it lives + public Builder() {} + + private Builder(ShardsRecord o) { + this.bulkAvgSizeInBytes = o.bulkAvgSizeInBytes; + this.bulkAvgTime = o.bulkAvgTime; + this.bulkTotalOperations = o.bulkTotalOperations; + this.bulkTotalSizeInBytes = o.bulkTotalSizeInBytes; + this.bulkTotalTime = o.bulkTotalTime; + this.completionSize = o.completionSize; + this.docs = o.docs; + this.docsDeleted = o.docsDeleted; + this.fielddataEvictions = o.fielddataEvictions; + this.fielddataMemorySize = o.fielddataMemorySize; + this.flushTotal = o.flushTotal; + this.flushTotalTime = o.flushTotalTime; + this.getCurrent = o.getCurrent; + this.getExistsTime = o.getExistsTime; + this.getExistsTotal = o.getExistsTotal; + this.getMissingTime = o.getMissingTime; + this.getMissingTotal = o.getMissingTotal; + this.getTime = o.getTime; + this.getTotal = o.getTotal; + this.id = o.id; + this.index = o.index; + this.indexingDeleteCurrent = o.indexingDeleteCurrent; + this.indexingDeleteTime = o.indexingDeleteTime; + this.indexingDeleteTotal = o.indexingDeleteTotal; + this.indexingIndexCurrent = o.indexingIndexCurrent; + this.indexingIndexFailed = o.indexingIndexFailed; + this.indexingIndexTime = o.indexingIndexTime; + this.indexingIndexTotal = o.indexingIndexTotal; + this.ip = o.ip; + this.mergesCurrent = o.mergesCurrent; + this.mergesCurrentDocs = o.mergesCurrentDocs; + this.mergesCurrentSize = o.mergesCurrentSize; + this.mergesTotal = o.mergesTotal; + this.mergesTotalDocs = o.mergesTotalDocs; + this.mergesTotalSize = o.mergesTotalSize; + this.mergesTotalTime = o.mergesTotalTime; + this.node = o.node; + this.pathData = o.pathData; + this.pathState = o.pathState; + this.prirep = o.prirep; + this.queryCacheEvictions = o.queryCacheEvictions; + this.queryCacheMemorySize = o.queryCacheMemorySize; + this.recoverysourceType = o.recoverysourceType; + this.refreshExternalTime = o.refreshExternalTime; + this.refreshExternalTotal = o.refreshExternalTotal; + this.refreshListeners = o.refreshListeners; + this.refreshTime = o.refreshTime; + this.refreshTotal = o.refreshTotal; + this.searchConcurrentAvgSliceCount = o.searchConcurrentAvgSliceCount; + this.searchConcurrentQueryCurrent = o.searchConcurrentQueryCurrent; + this.searchConcurrentQueryTime = o.searchConcurrentQueryTime; + this.searchConcurrentQueryTotal = o.searchConcurrentQueryTotal; + this.searchFetchCurrent = o.searchFetchCurrent; + this.searchFetchTime = o.searchFetchTime; + this.searchFetchTotal = o.searchFetchTotal; + this.searchOpenContexts = o.searchOpenContexts; + this.searchPointInTimeCurrent = o.searchPointInTimeCurrent; + this.searchPointInTimeTime = o.searchPointInTimeTime; + this.searchPointInTimeTotal = o.searchPointInTimeTotal; + this.searchQueryCurrent = o.searchQueryCurrent; + this.searchQueryTime = o.searchQueryTime; + this.searchQueryTotal = o.searchQueryTotal; + this.searchScrollCurrent = o.searchScrollCurrent; + this.searchScrollTime = o.searchScrollTime; + this.searchScrollTotal = o.searchScrollTotal; + this.searchSearchIdleReactivateCountTotal = o.searchSearchIdleReactivateCountTotal; + this.segmentsCount = o.segmentsCount; + this.segmentsFixedBitsetMemory = o.segmentsFixedBitsetMemory; + this.segmentsIndexWriterMemory = o.segmentsIndexWriterMemory; + this.segmentsMemory = o.segmentsMemory; + this.segmentsVersionMapMemory = o.segmentsVersionMapMemory; + this.seqNoGlobalCheckpoint = o.seqNoGlobalCheckpoint; + this.seqNoLocalCheckpoint = o.seqNoLocalCheckpoint; + this.seqNoMax = o.seqNoMax; + this.shard = o.shard; + this.state = o.state; + this.store = o.store; + this.syncId = o.syncId; + this.unassignedAt = o.unassignedAt; + this.unassignedDetails = o.unassignedDetails; + this.unassignedFor = o.unassignedFor; + this.unassignedReason = o.unassignedReason; + this.warmerCurrent = o.warmerCurrent; + this.warmerTotal = o.warmerTotal; + this.warmerTotalTime = o.warmerTotalTime; + } + + private Builder(Builder o) { + this.bulkAvgSizeInBytes = o.bulkAvgSizeInBytes; + this.bulkAvgTime = o.bulkAvgTime; + this.bulkTotalOperations = o.bulkTotalOperations; + this.bulkTotalSizeInBytes = o.bulkTotalSizeInBytes; + this.bulkTotalTime = o.bulkTotalTime; + this.completionSize = o.completionSize; + this.docs = o.docs; + this.docsDeleted = o.docsDeleted; + this.fielddataEvictions = o.fielddataEvictions; + this.fielddataMemorySize = o.fielddataMemorySize; + this.flushTotal = o.flushTotal; + this.flushTotalTime = o.flushTotalTime; + this.getCurrent = o.getCurrent; + this.getExistsTime = o.getExistsTime; + this.getExistsTotal = o.getExistsTotal; + this.getMissingTime = o.getMissingTime; + this.getMissingTotal = o.getMissingTotal; + this.getTime = o.getTime; + this.getTotal = o.getTotal; + this.id = o.id; + this.index = o.index; + this.indexingDeleteCurrent = o.indexingDeleteCurrent; + this.indexingDeleteTime = o.indexingDeleteTime; + this.indexingDeleteTotal = o.indexingDeleteTotal; + this.indexingIndexCurrent = o.indexingIndexCurrent; + this.indexingIndexFailed = o.indexingIndexFailed; + this.indexingIndexTime = o.indexingIndexTime; + this.indexingIndexTotal = o.indexingIndexTotal; + this.ip = o.ip; + this.mergesCurrent = o.mergesCurrent; + this.mergesCurrentDocs = o.mergesCurrentDocs; + this.mergesCurrentSize = o.mergesCurrentSize; + this.mergesTotal = o.mergesTotal; + this.mergesTotalDocs = o.mergesTotalDocs; + this.mergesTotalSize = o.mergesTotalSize; + this.mergesTotalTime = o.mergesTotalTime; + this.node = o.node; + this.pathData = o.pathData; + this.pathState = o.pathState; + this.prirep = o.prirep; + this.queryCacheEvictions = o.queryCacheEvictions; + this.queryCacheMemorySize = o.queryCacheMemorySize; + this.recoverysourceType = o.recoverysourceType; + this.refreshExternalTime = o.refreshExternalTime; + this.refreshExternalTotal = o.refreshExternalTotal; + this.refreshListeners = o.refreshListeners; + this.refreshTime = o.refreshTime; + this.refreshTotal = o.refreshTotal; + this.searchConcurrentAvgSliceCount = o.searchConcurrentAvgSliceCount; + this.searchConcurrentQueryCurrent = o.searchConcurrentQueryCurrent; + this.searchConcurrentQueryTime = o.searchConcurrentQueryTime; + this.searchConcurrentQueryTotal = o.searchConcurrentQueryTotal; + this.searchFetchCurrent = o.searchFetchCurrent; + this.searchFetchTime = o.searchFetchTime; + this.searchFetchTotal = o.searchFetchTotal; + this.searchOpenContexts = o.searchOpenContexts; + this.searchPointInTimeCurrent = o.searchPointInTimeCurrent; + this.searchPointInTimeTime = o.searchPointInTimeTime; + this.searchPointInTimeTotal = o.searchPointInTimeTotal; + this.searchQueryCurrent = o.searchQueryCurrent; + this.searchQueryTime = o.searchQueryTime; + this.searchQueryTotal = o.searchQueryTotal; + this.searchScrollCurrent = o.searchScrollCurrent; + this.searchScrollTime = o.searchScrollTime; + this.searchScrollTotal = o.searchScrollTotal; + this.searchSearchIdleReactivateCountTotal = o.searchSearchIdleReactivateCountTotal; + this.segmentsCount = o.segmentsCount; + this.segmentsFixedBitsetMemory = o.segmentsFixedBitsetMemory; + this.segmentsIndexWriterMemory = o.segmentsIndexWriterMemory; + this.segmentsMemory = o.segmentsMemory; + this.segmentsVersionMapMemory = o.segmentsVersionMapMemory; + this.seqNoGlobalCheckpoint = o.seqNoGlobalCheckpoint; + this.seqNoLocalCheckpoint = o.seqNoLocalCheckpoint; + this.seqNoMax = o.seqNoMax; + this.shard = o.shard; + this.state = o.state; + this.store = o.store; + this.syncId = o.syncId; + this.unassignedAt = o.unassignedAt; + this.unassignedDetails = o.unassignedDetails; + this.unassignedFor = o.unassignedFor; + this.unassignedReason = o.unassignedReason; + this.warmerCurrent = o.warmerCurrent; + this.warmerTotal = o.warmerTotal; + this.warmerTotalTime = o.warmerTotalTime; + } + + @Override + @Nonnull + public Builder copy() { + return new Builder(this); + } + + /** + * The average size in bytes of shard bulk operations. *

- * API name: {@code ip} + * API name: {@code bulk.avg_size_in_bytes} + *

*/ - public final Builder ip(@Nullable String value) { - this.ip = value; + @Nonnull + public final Builder bulkAvgSizeInBytes(@Nullable String value) { + this.bulkAvgSizeInBytes = value; return this; } /** - * unique id of node where it lives + * The average time spent in shard bulk operations. *

- * API name: {@code id} + * API name: {@code bulk.avg_time} + *

*/ - public final Builder id(@Nullable String value) { - this.id = value; + @Nonnull + public final Builder bulkAvgTime(@Nullable String value) { + this.bulkAvgTime = value; return this; } /** - * name of node where it lives + * The number of bulk shard operations. *

- * API name: {@code node} + * API name: {@code bulk.total_operations} + *

*/ - public final Builder node(@Nullable String value) { - this.node = value; + @Nonnull + public final Builder bulkTotalOperations(@Nullable String value) { + this.bulkTotalOperations = value; return this; } /** - * sync id + * The total size in bytes of shard bulk operations. *

- * API name: {@code sync_id} + * API name: {@code bulk.total_size_in_bytes} + *

*/ - public final Builder syncId(@Nullable String value) { - this.syncId = value; + @Nonnull + public final Builder bulkTotalSizeInBytes(@Nullable String value) { + this.bulkTotalSizeInBytes = value; return this; } /** - * reason shard is unassigned + * The time spent in shard bulk operations. *

- * API name: {@code unassigned.reason} + * API name: {@code bulk.total_time} + *

*/ - public final Builder unassignedReason(@Nullable String value) { - this.unassignedReason = value; + @Nonnull + public final Builder bulkTotalTime(@Nullable String value) { + this.bulkTotalTime = value; return this; } /** - * time shard became unassigned (UTC) + * The size of completion. *

- * API name: {@code unassigned.at} + * API name: {@code completion.size} + *

*/ - public final Builder unassignedAt(@Nullable String value) { - this.unassignedAt = value; + @Nonnull + public final Builder completionSize(@Nullable String value) { + this.completionSize = value; return this; } /** - * time has been unassigned + * The number of documents in the shard. *

- * API name: {@code unassigned.for} + * API name: {@code docs} + *

*/ - public final Builder unassignedFor(@Nullable String value) { - this.unassignedFor = value; + @Nonnull + public final Builder docs(@Nullable String value) { + this.docs = value; return this; } /** - * additional details as to why the shard became unassigned - *

- * API name: {@code unassigned.details} + * API name: {@code docs.deleted} */ - public final Builder unassignedDetails(@Nullable String value) { - this.unassignedDetails = value; + @Nonnull + public final Builder docsDeleted(@Nullable String value) { + this.docsDeleted = value; return this; } /** - * recovery source type + * The field data cache evictions. *

- * API name: {@code recoverysource.type} + * API name: {@code fielddata.evictions} + *

*/ - public final Builder recoverysourceType(@Nullable String value) { - this.recoverysourceType = value; + @Nonnull + public final Builder fielddataEvictions(@Nullable String value) { + this.fielddataEvictions = value; return this; } /** - * size of completion + * The used field data cache memory. *

- * API name: {@code completion.size} + * API name: {@code fielddata.memory_size} + *

*/ - public final Builder completionSize(@Nullable String value) { - this.completionSize = value; + @Nonnull + public final Builder fielddataMemorySize(@Nullable String value) { + this.fielddataMemorySize = value; return this; } /** - * used fielddata cache + * The number of flushes. *

- * API name: {@code fielddata.memory_size} + * API name: {@code flush.total} + *

*/ - public final Builder fielddataMemorySize(@Nullable String value) { - this.fielddataMemorySize = value; + @Nonnull + public final Builder flushTotal(@Nullable String value) { + this.flushTotal = value; return this; } /** - * fielddata evictions + * The time spent in flush. *

- * API name: {@code fielddata.evictions} + * API name: {@code flush.total_time} + *

*/ - public final Builder fielddataEvictions(@Nullable String value) { - this.fielddataEvictions = value; + @Nonnull + public final Builder flushTotalTime(@Nullable String value) { + this.flushTotalTime = value; return this; } /** - * used query cache + * The number of current get operations. *

- * API name: {@code query_cache.memory_size} + * API name: {@code get.current} + *

*/ - public final Builder queryCacheMemorySize(@Nullable String value) { - this.queryCacheMemorySize = value; + @Nonnull + public final Builder getCurrent(@Nullable String value) { + this.getCurrent = value; return this; } /** - * query cache evictions + * The time spent in successful get operations. *

- * API name: {@code query_cache.evictions} + * API name: {@code get.exists_time} + *

*/ - public final Builder queryCacheEvictions(@Nullable String value) { - this.queryCacheEvictions = value; + @Nonnull + public final Builder getExistsTime(@Nullable String value) { + this.getExistsTime = value; return this; } /** - * number of flushes + * The number of successful get operations. *

- * API name: {@code flush.total} + * API name: {@code get.exists_total} + *

*/ - public final Builder flushTotal(@Nullable String value) { - this.flushTotal = value; + @Nonnull + public final Builder getExistsTotal(@Nullable String value) { + this.getExistsTotal = value; return this; } /** - * time spent in flush + * The time spent in failed get operations. *

- * API name: {@code flush.total_time} + * API name: {@code get.missing_time} + *

*/ - public final Builder flushTotalTime(@Nullable String value) { - this.flushTotalTime = value; + @Nonnull + public final Builder getMissingTime(@Nullable String value) { + this.getMissingTime = value; return this; } /** - * number of current get ops + * The number of failed get operations. *

- * API name: {@code get.current} + * API name: {@code get.missing_total} + *

*/ - public final Builder getCurrent(@Nullable String value) { - this.getCurrent = value; + @Nonnull + public final Builder getMissingTotal(@Nullable String value) { + this.getMissingTotal = value; return this; } /** - * time spent in get + * The time spent in get operations. *

* API name: {@code get.time} + *

*/ + @Nonnull public final Builder getTime(@Nullable String value) { this.getTime = value; return this; } /** - * number of get ops + * The number of get operations. *

* API name: {@code get.total} + *

*/ + @Nonnull public final Builder getTotal(@Nullable String value) { this.getTotal = value; return this; } /** - * time spent in successful gets - *

- * API name: {@code get.exists_time} - */ - public final Builder getExistsTime(@Nullable String value) { - this.getExistsTime = value; - return this; - } - - /** - * number of successful gets - *

- * API name: {@code get.exists_total} - */ - public final Builder getExistsTotal(@Nullable String value) { - this.getExistsTotal = value; - return this; - } - - /** - * time spent in failed gets + * The unique identifier for the node. *

- * API name: {@code get.missing_time} + * API name: {@code id} + *

*/ - public final Builder getMissingTime(@Nullable String value) { - this.getMissingTime = value; + @Nonnull + public final Builder id(@Nullable String value) { + this.id = value; return this; } /** - * number of failed gets + * The index name. *

- * API name: {@code get.missing_total} + * API name: {@code index} + *

*/ - public final Builder getMissingTotal(@Nullable String value) { - this.getMissingTotal = value; + @Nonnull + public final Builder index(@Nullable String value) { + this.index = value; return this; } /** - * number of current deletions + * The number of current deletion operations. *

* API name: {@code indexing.delete_current} + *

*/ + @Nonnull public final Builder indexingDeleteCurrent(@Nullable String value) { this.indexingDeleteCurrent = value; return this; } /** - * time spent in deletions + * The time spent in deletion operations. *

* API name: {@code indexing.delete_time} + *

*/ + @Nonnull public final Builder indexingDeleteTime(@Nullable String value) { this.indexingDeleteTime = value; return this; } /** - * number of delete ops + * The number of delete operations. *

* API name: {@code indexing.delete_total} + *

*/ + @Nonnull public final Builder indexingDeleteTotal(@Nullable String value) { this.indexingDeleteTotal = value; return this; } /** - * number of current indexing ops + * The number of current indexing operations. *

* API name: {@code indexing.index_current} + *

*/ + @Nonnull public final Builder indexingIndexCurrent(@Nullable String value) { this.indexingIndexCurrent = value; return this; } /** - * time spent in indexing + * The number of failed indexing operations. + *

+ * API name: {@code indexing.index_failed} + *

+ */ + @Nonnull + public final Builder indexingIndexFailed(@Nullable String value) { + this.indexingIndexFailed = value; + return this; + } + + /** + * The time spent in indexing operations. *

* API name: {@code indexing.index_time} + *

*/ + @Nonnull public final Builder indexingIndexTime(@Nullable String value) { this.indexingIndexTime = value; return this; } /** - * number of indexing ops + * The number of indexing operations. *

* API name: {@code indexing.index_total} + *

*/ + @Nonnull public final Builder indexingIndexTotal(@Nullable String value) { this.indexingIndexTotal = value; return this; } /** - * number of failed indexing ops + * The IP address of the node. *

- * API name: {@code indexing.index_failed} + * API name: {@code ip} + *

*/ - public final Builder indexingIndexFailed(@Nullable String value) { - this.indexingIndexFailed = value; + @Nonnull + public final Builder ip(@Nullable String value) { + this.ip = value; return this; } /** - * number of current merges + * The number of current merge operations. *

* API name: {@code merges.current} + *

*/ + @Nonnull public final Builder mergesCurrent(@Nullable String value) { this.mergesCurrent = value; return this; } /** - * number of current merging docs + * The number of current merging documents. *

* API name: {@code merges.current_docs} + *

*/ + @Nonnull public final Builder mergesCurrentDocs(@Nullable String value) { this.mergesCurrentDocs = value; return this; } /** - * size of current merges + * The size of current merge operations. *

* API name: {@code merges.current_size} + *

*/ + @Nonnull public final Builder mergesCurrentSize(@Nullable String value) { this.mergesCurrentSize = value; return this; } /** - * number of completed merge ops + * The number of completed merge operations. *

* API name: {@code merges.total} + *

*/ + @Nonnull public final Builder mergesTotal(@Nullable String value) { this.mergesTotal = value; return this; } /** - * docs merged + * The number of merged documents. *

* API name: {@code merges.total_docs} + *

*/ + @Nonnull public final Builder mergesTotalDocs(@Nullable String value) { this.mergesTotalDocs = value; return this; } /** - * size merged + * The size of current merges. *

* API name: {@code merges.total_size} + *

*/ + @Nonnull public final Builder mergesTotalSize(@Nullable String value) { this.mergesTotalSize = value; return this; } /** - * time spent in merges + * The time spent merging documents. *

* API name: {@code merges.total_time} + *

*/ + @Nonnull public final Builder mergesTotalTime(@Nullable String value) { this.mergesTotalTime = value; return this; } /** - * total refreshes + * The name of node. *

- * API name: {@code refresh.total} + * API name: {@code node} + *

*/ - public final Builder refreshTotal(@Nullable String value) { - this.refreshTotal = value; + @Nonnull + public final Builder node(@Nullable String value) { + this.node = value; return this; } /** - * time spent in refreshes + * The shard data path. *

- * API name: {@code refresh.time} + * API name: {@code path.data} + *

*/ - public final Builder refreshTime(@Nullable String value) { - this.refreshTime = value; + @Nonnull + public final Builder pathData(@Nullable String value) { + this.pathData = value; return this; } /** - * total external refreshes + * The shard state path. *

- * API name: {@code refresh.external_total} + * API name: {@code path.state} + *

*/ - public final Builder refreshExternalTotal(@Nullable String value) { - this.refreshExternalTotal = value; + @Nonnull + public final Builder pathState(@Nullable String value) { + this.pathState = value; + return this; + } + + /** + * The shard type: primary or replica. + *

+ * API name: {@code prirep} + *

+ */ + @Nonnull + public final Builder prirep(@Nullable String value) { + this.prirep = value; + return this; + } + + /** + * The query cache evictions. + *

+ * API name: {@code query_cache.evictions} + *

+ */ + @Nonnull + public final Builder queryCacheEvictions(@Nullable String value) { + this.queryCacheEvictions = value; + return this; + } + + /** + * The used query cache memory. + *

+ * API name: {@code query_cache.memory_size} + *

+ */ + @Nonnull + public final Builder queryCacheMemorySize(@Nullable String value) { + this.queryCacheMemorySize = value; + return this; + } + + /** + * The type of recovery source. + *

+ * API name: {@code recoverysource.type} + *

+ */ + @Nonnull + public final Builder recoverysourceType(@Nullable String value) { + this.recoverysourceType = value; return this; } /** - * time spent in external refreshes + * The time spent in external refreshes. *

* API name: {@code refresh.external_time} + *

*/ + @Nonnull public final Builder refreshExternalTime(@Nullable String value) { this.refreshExternalTime = value; return this; } /** - * number of pending refresh listeners + * The total number of external refreshes. + *

+ * API name: {@code refresh.external_total} + *

+ */ + @Nonnull + public final Builder refreshExternalTotal(@Nullable String value) { + this.refreshExternalTotal = value; + return this; + } + + /** + * The number of pending refresh listeners. *

* API name: {@code refresh.listeners} + *

*/ + @Nonnull public final Builder refreshListeners(@Nullable String value) { this.refreshListeners = value; return this; } /** - * current fetch phase ops + * The time spent in refreshes. + *

+ * API name: {@code refresh.time} + *

+ */ + @Nonnull + public final Builder refreshTime(@Nullable String value) { + this.refreshTime = value; + return this; + } + + /** + * The total number of refreshes. + *

+ * API name: {@code refresh.total} + *

+ */ + @Nonnull + public final Builder refreshTotal(@Nullable String value) { + this.refreshTotal = value; + return this; + } + + /** + * API name: {@code search.concurrent_avg_slice_count} + */ + @Nonnull + public final Builder searchConcurrentAvgSliceCount(@Nullable String value) { + this.searchConcurrentAvgSliceCount = value; + return this; + } + + /** + * API name: {@code search.concurrent_query_current} + */ + @Nonnull + public final Builder searchConcurrentQueryCurrent(@Nullable String value) { + this.searchConcurrentQueryCurrent = value; + return this; + } + + /** + * API name: {@code search.concurrent_query_time} + */ + @Nonnull + public final Builder searchConcurrentQueryTime(@Nullable String value) { + this.searchConcurrentQueryTime = value; + return this; + } + + /** + * API name: {@code search.concurrent_query_total} + */ + @Nonnull + public final Builder searchConcurrentQueryTotal(@Nullable String value) { + this.searchConcurrentQueryTotal = value; + return this; + } + + /** + * The current fetch phase operations. *

* API name: {@code search.fetch_current} + *

*/ + @Nonnull public final Builder searchFetchCurrent(@Nullable String value) { this.searchFetchCurrent = value; return this; } /** - * time spent in fetch phase + * The time spent in fetch phase. *

* API name: {@code search.fetch_time} + *

*/ + @Nonnull public final Builder searchFetchTime(@Nullable String value) { this.searchFetchTime = value; return this; } /** - * total fetch ops + * The total number of fetch operations. *

* API name: {@code search.fetch_total} + *

*/ + @Nonnull public final Builder searchFetchTotal(@Nullable String value) { this.searchFetchTotal = value; return this; } /** - * open search contexts + * The number of open search contexts. *

* API name: {@code search.open_contexts} + *

*/ + @Nonnull public final Builder searchOpenContexts(@Nullable String value) { this.searchOpenContexts = value; return this; } /** - * current query phase ops + * API name: {@code search.point_in_time_current} + */ + @Nonnull + public final Builder searchPointInTimeCurrent(@Nullable String value) { + this.searchPointInTimeCurrent = value; + return this; + } + + /** + * API name: {@code search.point_in_time_time} + */ + @Nonnull + public final Builder searchPointInTimeTime(@Nullable String value) { + this.searchPointInTimeTime = value; + return this; + } + + /** + * API name: {@code search.point_in_time_total} + */ + @Nonnull + public final Builder searchPointInTimeTotal(@Nullable String value) { + this.searchPointInTimeTotal = value; + return this; + } + + /** + * The current query phase operations. *

* API name: {@code search.query_current} + *

*/ + @Nonnull public final Builder searchQueryCurrent(@Nullable String value) { this.searchQueryCurrent = value; return this; } /** - * time spent in query phase + * The time spent in query phase. *

* API name: {@code search.query_time} + *

*/ + @Nonnull public final Builder searchQueryTime(@Nullable String value) { this.searchQueryTime = value; return this; } /** - * total query phase ops + * The total number of query phase operations. *

* API name: {@code search.query_total} + *

*/ + @Nonnull public final Builder searchQueryTotal(@Nullable String value) { this.searchQueryTotal = value; return this; } /** - * open scroll contexts + * The open scroll contexts. *

* API name: {@code search.scroll_current} + *

*/ + @Nonnull public final Builder searchScrollCurrent(@Nullable String value) { this.searchScrollCurrent = value; return this; } /** - * time scroll contexts held open + * The time scroll contexts were held open. *

* API name: {@code search.scroll_time} + *

*/ + @Nonnull public final Builder searchScrollTime(@Nullable String value) { this.searchScrollTime = value; return this; } /** - * completed scroll contexts + * The number of completed scroll contexts. *

* API name: {@code search.scroll_total} + *

*/ + @Nonnull public final Builder searchScrollTotal(@Nullable String value) { this.searchScrollTotal = value; return this; } /** - * number of segments + * API name: {@code search.search_idle_reactivate_count_total} + */ + @Nonnull + public final Builder searchSearchIdleReactivateCountTotal(@Nullable String value) { + this.searchSearchIdleReactivateCountTotal = value; + return this; + } + + /** + * The number of segments. *

* API name: {@code segments.count} + *

*/ + @Nonnull public final Builder segmentsCount(@Nullable String value) { this.segmentsCount = value; return this; } /** - * memory used by segments + * The memory used by fixed bit sets for nested object field types and export type filters for types referred in + * _parent fields. *

- * API name: {@code segments.memory} + * API name: {@code segments.fixed_bitset_memory} + *

*/ - public final Builder segmentsMemory(@Nullable String value) { - this.segmentsMemory = value; + @Nonnull + public final Builder segmentsFixedBitsetMemory(@Nullable String value) { + this.segmentsFixedBitsetMemory = value; return this; } /** - * memory used by index writer + * The memory used by the index writer. *

* API name: {@code segments.index_writer_memory} + *

*/ + @Nonnull public final Builder segmentsIndexWriterMemory(@Nullable String value) { this.segmentsIndexWriterMemory = value; return this; } /** - * memory used by version map + * The memory used by segments. *

- * API name: {@code segments.version_map_memory} + * API name: {@code segments.memory} + *

*/ - public final Builder segmentsVersionMapMemory(@Nullable String value) { - this.segmentsVersionMapMemory = value; + @Nonnull + public final Builder segmentsMemory(@Nullable String value) { + this.segmentsMemory = value; return this; } /** - * memory used by fixed bit sets for nested object field types and export type - * filters for types referred in _parent fields + * The memory used by the version map. *

- * API name: {@code segments.fixed_bitset_memory} + * API name: {@code segments.version_map_memory} + *

*/ - public final Builder segmentsFixedBitsetMemory(@Nullable String value) { - this.segmentsFixedBitsetMemory = value; + @Nonnull + public final Builder segmentsVersionMapMemory(@Nullable String value) { + this.segmentsVersionMapMemory = value; return this; } /** - * max sequence number + * The global checkpoint. *

- * API name: {@code seq_no.max} + * API name: {@code seq_no.global_checkpoint} + *

*/ - public final Builder seqNoMax(@Nullable String value) { - this.seqNoMax = value; + @Nonnull + public final Builder seqNoGlobalCheckpoint(@Nullable String value) { + this.seqNoGlobalCheckpoint = value; return this; } /** - * local checkpoint + * The local checkpoint. *

* API name: {@code seq_no.local_checkpoint} + *

*/ + @Nonnull public final Builder seqNoLocalCheckpoint(@Nullable String value) { this.seqNoLocalCheckpoint = value; return this; } /** - * global checkpoint + * The maximum sequence number. *

- * API name: {@code seq_no.global_checkpoint} + * API name: {@code seq_no.max} + *

*/ - public final Builder seqNoGlobalCheckpoint(@Nullable String value) { - this.seqNoGlobalCheckpoint = value; + @Nonnull + public final Builder seqNoMax(@Nullable String value) { + this.seqNoMax = value; return this; } /** - * current warmer ops + * The shard name. *

- * API name: {@code warmer.current} + * API name: {@code shard} + *

*/ - public final Builder warmerCurrent(@Nullable String value) { - this.warmerCurrent = value; + @Nonnull + public final Builder shard(@Nullable String value) { + this.shard = value; return this; } /** - * total warmer ops + * The shard state. Returned values include: INITIALIZING: The shard is recovering from a peer shard or gateway. + * RELOCATING: The shard is relocating. STARTED: The shard has started. UNASSIGNED: The shard + * is not assigned to any node. *

- * API name: {@code warmer.total} + * API name: {@code state} + *

*/ - public final Builder warmerTotal(@Nullable String value) { - this.warmerTotal = value; + @Nonnull + public final Builder state(@Nullable String value) { + this.state = value; return this; } /** - * time spent in warmers + * The disk space used by the shard. *

- * API name: {@code warmer.total_time} + * API name: {@code store} + *

*/ - public final Builder warmerTotalTime(@Nullable String value) { - this.warmerTotalTime = value; + @Nonnull + public final Builder store(@Nullable String value) { + this.store = value; return this; } /** - * shard data path + * The sync identifier. *

- * API name: {@code path.data} + * API name: {@code sync_id} + *

*/ - public final Builder pathData(@Nullable String value) { - this.pathData = value; + @Nonnull + public final Builder syncId(@Nullable String value) { + this.syncId = value; return this; } /** - * shard state path + * The time at which the shard became unassigned in Coordinated Universal Time (UTC). *

- * API name: {@code path.state} + * API name: {@code unassigned.at} + *

*/ - public final Builder pathState(@Nullable String value) { - this.pathState = value; + @Nonnull + public final Builder unassignedAt(@Nullable String value) { + this.unassignedAt = value; return this; } /** - * number of bulk shard ops + * Additional details as to why the shard became unassigned. It does not explain why the shard is not assigned; use the cluster + * allocation explain API for that information. *

- * API name: {@code bulk.total_operations} + * API name: {@code unassigned.details} + *

*/ - public final Builder bulkTotalOperations(@Nullable String value) { - this.bulkTotalOperations = value; + @Nonnull + public final Builder unassignedDetails(@Nullable String value) { + this.unassignedDetails = value; return this; } /** - * time spend in shard bulk + * The time at which the shard was requested to be unassigned in Coordinated Universal Time (UTC). *

- * API name: {@code bulk.total_time} + * API name: {@code unassigned.for} + *

*/ - public final Builder bulkTotalTime(@Nullable String value) { - this.bulkTotalTime = value; + @Nonnull + public final Builder unassignedFor(@Nullable String value) { + this.unassignedFor = value; return this; } /** - * total size in bytes of shard bulk + * The reason for the last change to the state of an unassigned shard. It does not explain why the shard is currently unassigned; + * use the cluster allocation explain API for that information. Returned values include: ALLOCATION_FAILED: Unassigned + * as a result of a failed allocation of the shard. CLUSTER_RECOVERED: Unassigned as a result of a full cluster + * recovery. DANGLING_INDEX_IMPORTED: Unassigned as a result of importing a dangling index. + * EXISTING_INDEX_RESTORED: Unassigned as a result of restoring into a closed index. FORCED_EMPTY_PRIMARY: + * The shard's allocation was last modified by forcing an empty primary using the cluster reroute API. INDEX_CLOSED: + * Unassigned because the index was closed. INDEX_CREATED: Unassigned as a result of an API creation of an index. + * INDEX_REOPENED: Unassigned as a result of opening a closed index. MANUAL_ALLOCATION: The shard's + * allocation was last modified by the cluster reroute API. NEW_INDEX_RESTORED: Unassigned as a result of restoring + * into a new index. NODE_LEFT: Unassigned as a result of the node hosting it leaving the cluster. + * NODE_RESTARTING: Similar to NODE_LEFT, except that the node was registered as restarting using the node + * shutdown API. PRIMARY_FAILED: The shard was initializing as a replica, but the primary shard failed before the + * initialization completed. REALLOCATED_REPLICA: A better replica location is identified and causes the existing + * replica allocation to be cancelled. REINITIALIZED: When a shard moves from started back to initializing. + * REPLICA_ADDED: Unassigned as a result of explicit addition of a replica. REROUTE_CANCELLED: Unassigned + * as a result of explicit cancel reroute command. *

- * API name: {@code bulk.total_size_in_bytes} + * API name: {@code unassigned.reason} + *

*/ - public final Builder bulkTotalSizeInBytes(@Nullable String value) { - this.bulkTotalSizeInBytes = value; + @Nonnull + public final Builder unassignedReason(@Nullable String value) { + this.unassignedReason = value; return this; } /** - * average time spend in shard bulk + * The number of current warmer operations. *

- * API name: {@code bulk.avg_time} + * API name: {@code warmer.current} + *

*/ - public final Builder bulkAvgTime(@Nullable String value) { - this.bulkAvgTime = value; + @Nonnull + public final Builder warmerCurrent(@Nullable String value) { + this.warmerCurrent = value; return this; } /** - * avg size in bytes of shard bulk + * The total number of warmer operations. *

- * API name: {@code bulk.avg_size_in_bytes} + * API name: {@code warmer.total} + *

*/ - public final Builder bulkAvgSizeInBytes(@Nullable String value) { - this.bulkAvgSizeInBytes = value; + @Nonnull + public final Builder warmerTotal(@Nullable String value) { + this.warmerTotal = value; + return this; + } + + /** + * The time spent in warmer operations. + *

+ * API name: {@code warmer.total_time} + *

+ */ + @Nonnull + public final Builder warmerTotalTime(@Nullable String value) { + this.warmerTotalTime = value; return this; } /** * Builds a {@link ShardsRecord}. * - * @throws NullPointerException - * if some of the required fields are null. + * @throws NullPointerException if some of the required fields are null. */ + @Override + @Nonnull public ShardsRecord build() { _checkSingleUse(); @@ -2538,132 +3180,277 @@ public ShardsRecord build() { ); protected static void setupShardsRecordDeserializer(ObjectDeserializer op) { - - op.add(Builder::index, JsonpDeserializer.stringDeserializer(), "index", "i", "idx"); - op.add(Builder::shard, JsonpDeserializer.stringDeserializer(), "shard", "s", "sh"); - op.add(Builder::prirep, JsonpDeserializer.stringDeserializer(), "prirep", "p", "pr", "primaryOrReplica"); - op.add(Builder::state, JsonpDeserializer.stringDeserializer(), "state", "st"); - op.add(Builder::docs, JsonpDeserializer.stringDeserializer(), "docs", "d", "dc"); - op.add(Builder::store, JsonpDeserializer.stringDeserializer(), "store", "sto"); - op.add(Builder::ip, JsonpDeserializer.stringDeserializer(), "ip"); + op.add(Builder::bulkAvgSizeInBytes, JsonpDeserializer.stringDeserializer(), "bulk.avg_size_in_bytes"); + op.add(Builder::bulkAvgTime, JsonpDeserializer.stringDeserializer(), "bulk.avg_time"); + op.add(Builder::bulkTotalOperations, JsonpDeserializer.stringDeserializer(), "bulk.total_operations"); + op.add(Builder::bulkTotalSizeInBytes, JsonpDeserializer.stringDeserializer(), "bulk.total_size_in_bytes"); + op.add(Builder::bulkTotalTime, JsonpDeserializer.stringDeserializer(), "bulk.total_time"); + op.add(Builder::completionSize, JsonpDeserializer.stringDeserializer(), "completion.size"); + op.add(Builder::docs, JsonpDeserializer.stringDeserializer(), "docs"); + op.add(Builder::docsDeleted, JsonpDeserializer.stringDeserializer(), "docs.deleted"); + op.add(Builder::fielddataEvictions, JsonpDeserializer.stringDeserializer(), "fielddata.evictions"); + op.add(Builder::fielddataMemorySize, JsonpDeserializer.stringDeserializer(), "fielddata.memory_size"); + op.add(Builder::flushTotal, JsonpDeserializer.stringDeserializer(), "flush.total"); + op.add(Builder::flushTotalTime, JsonpDeserializer.stringDeserializer(), "flush.total_time"); + op.add(Builder::getCurrent, JsonpDeserializer.stringDeserializer(), "get.current"); + op.add(Builder::getExistsTime, JsonpDeserializer.stringDeserializer(), "get.exists_time"); + op.add(Builder::getExistsTotal, JsonpDeserializer.stringDeserializer(), "get.exists_total"); + op.add(Builder::getMissingTime, JsonpDeserializer.stringDeserializer(), "get.missing_time"); + op.add(Builder::getMissingTotal, JsonpDeserializer.stringDeserializer(), "get.missing_total"); + op.add(Builder::getTime, JsonpDeserializer.stringDeserializer(), "get.time"); + op.add(Builder::getTotal, JsonpDeserializer.stringDeserializer(), "get.total"); op.add(Builder::id, JsonpDeserializer.stringDeserializer(), "id"); - op.add(Builder::node, JsonpDeserializer.stringDeserializer(), "node", "n"); - op.add(Builder::syncId, JsonpDeserializer.stringDeserializer(), "sync_id"); - op.add(Builder::unassignedReason, JsonpDeserializer.stringDeserializer(), "unassigned.reason", "ur"); - op.add(Builder::unassignedAt, JsonpDeserializer.stringDeserializer(), "unassigned.at", "ua"); - op.add(Builder::unassignedFor, JsonpDeserializer.stringDeserializer(), "unassigned.for", "uf"); - op.add(Builder::unassignedDetails, JsonpDeserializer.stringDeserializer(), "unassigned.details", "ud"); - op.add(Builder::recoverysourceType, JsonpDeserializer.stringDeserializer(), "recoverysource.type", "rs"); - op.add(Builder::completionSize, JsonpDeserializer.stringDeserializer(), "completion.size", "cs", "completionSize"); - op.add(Builder::fielddataMemorySize, JsonpDeserializer.stringDeserializer(), "fielddata.memory_size", "fm", "fielddataMemory"); - op.add(Builder::fielddataEvictions, JsonpDeserializer.stringDeserializer(), "fielddata.evictions", "fe", "fielddataEvictions"); - op.add(Builder::queryCacheMemorySize, JsonpDeserializer.stringDeserializer(), "query_cache.memory_size", "qcm", "queryCacheMemory"); - op.add(Builder::queryCacheEvictions, JsonpDeserializer.stringDeserializer(), "query_cache.evictions", "qce", "queryCacheEvictions"); - op.add(Builder::flushTotal, JsonpDeserializer.stringDeserializer(), "flush.total", "ft", "flushTotal"); - op.add(Builder::flushTotalTime, JsonpDeserializer.stringDeserializer(), "flush.total_time", "ftt", "flushTotalTime"); - op.add(Builder::getCurrent, JsonpDeserializer.stringDeserializer(), "get.current", "gc", "getCurrent"); - op.add(Builder::getTime, JsonpDeserializer.stringDeserializer(), "get.time", "gti", "getTime"); - op.add(Builder::getTotal, JsonpDeserializer.stringDeserializer(), "get.total", "gto", "getTotal"); - op.add(Builder::getExistsTime, JsonpDeserializer.stringDeserializer(), "get.exists_time", "geti", "getExistsTime"); - op.add(Builder::getExistsTotal, JsonpDeserializer.stringDeserializer(), "get.exists_total", "geto", "getExistsTotal"); - op.add(Builder::getMissingTime, JsonpDeserializer.stringDeserializer(), "get.missing_time", "gmti", "getMissingTime"); - op.add(Builder::getMissingTotal, JsonpDeserializer.stringDeserializer(), "get.missing_total", "gmto", "getMissingTotal"); - op.add( - Builder::indexingDeleteCurrent, - JsonpDeserializer.stringDeserializer(), - "indexing.delete_current", - "idc", - "indexingDeleteCurrent" - ); - op.add(Builder::indexingDeleteTime, JsonpDeserializer.stringDeserializer(), "indexing.delete_time", "idti", "indexingDeleteTime"); - op.add( - Builder::indexingDeleteTotal, - JsonpDeserializer.stringDeserializer(), - "indexing.delete_total", - "idto", - "indexingDeleteTotal" - ); - op.add( - Builder::indexingIndexCurrent, - JsonpDeserializer.stringDeserializer(), - "indexing.index_current", - "iic", - "indexingIndexCurrent" - ); - op.add(Builder::indexingIndexTime, JsonpDeserializer.stringDeserializer(), "indexing.index_time", "iiti", "indexingIndexTime"); - op.add(Builder::indexingIndexTotal, JsonpDeserializer.stringDeserializer(), "indexing.index_total", "iito", "indexingIndexTotal"); - op.add(Builder::indexingIndexFailed, JsonpDeserializer.stringDeserializer(), "indexing.index_failed", "iif", "indexingIndexFailed"); - op.add(Builder::mergesCurrent, JsonpDeserializer.stringDeserializer(), "merges.current", "mc", "mergesCurrent"); - op.add(Builder::mergesCurrentDocs, JsonpDeserializer.stringDeserializer(), "merges.current_docs", "mcd", "mergesCurrentDocs"); - op.add(Builder::mergesCurrentSize, JsonpDeserializer.stringDeserializer(), "merges.current_size", "mcs", "mergesCurrentSize"); - op.add(Builder::mergesTotal, JsonpDeserializer.stringDeserializer(), "merges.total", "mt", "mergesTotal"); - op.add(Builder::mergesTotalDocs, JsonpDeserializer.stringDeserializer(), "merges.total_docs", "mtd", "mergesTotalDocs"); - op.add(Builder::mergesTotalSize, JsonpDeserializer.stringDeserializer(), "merges.total_size", "mts", "mergesTotalSize"); - op.add(Builder::mergesTotalTime, JsonpDeserializer.stringDeserializer(), "merges.total_time", "mtt", "mergesTotalTime"); - op.add(Builder::refreshTotal, JsonpDeserializer.stringDeserializer(), "refresh.total"); + op.add(Builder::index, JsonpDeserializer.stringDeserializer(), "index"); + op.add(Builder::indexingDeleteCurrent, JsonpDeserializer.stringDeserializer(), "indexing.delete_current"); + op.add(Builder::indexingDeleteTime, JsonpDeserializer.stringDeserializer(), "indexing.delete_time"); + op.add(Builder::indexingDeleteTotal, JsonpDeserializer.stringDeserializer(), "indexing.delete_total"); + op.add(Builder::indexingIndexCurrent, JsonpDeserializer.stringDeserializer(), "indexing.index_current"); + op.add(Builder::indexingIndexFailed, JsonpDeserializer.stringDeserializer(), "indexing.index_failed"); + op.add(Builder::indexingIndexTime, JsonpDeserializer.stringDeserializer(), "indexing.index_time"); + op.add(Builder::indexingIndexTotal, JsonpDeserializer.stringDeserializer(), "indexing.index_total"); + op.add(Builder::ip, JsonpDeserializer.stringDeserializer(), "ip"); + op.add(Builder::mergesCurrent, JsonpDeserializer.stringDeserializer(), "merges.current"); + op.add(Builder::mergesCurrentDocs, JsonpDeserializer.stringDeserializer(), "merges.current_docs"); + op.add(Builder::mergesCurrentSize, JsonpDeserializer.stringDeserializer(), "merges.current_size"); + op.add(Builder::mergesTotal, JsonpDeserializer.stringDeserializer(), "merges.total"); + op.add(Builder::mergesTotalDocs, JsonpDeserializer.stringDeserializer(), "merges.total_docs"); + op.add(Builder::mergesTotalSize, JsonpDeserializer.stringDeserializer(), "merges.total_size"); + op.add(Builder::mergesTotalTime, JsonpDeserializer.stringDeserializer(), "merges.total_time"); + op.add(Builder::node, JsonpDeserializer.stringDeserializer(), "node"); + op.add(Builder::pathData, JsonpDeserializer.stringDeserializer(), "path.data"); + op.add(Builder::pathState, JsonpDeserializer.stringDeserializer(), "path.state"); + op.add(Builder::prirep, JsonpDeserializer.stringDeserializer(), "prirep"); + op.add(Builder::queryCacheEvictions, JsonpDeserializer.stringDeserializer(), "query_cache.evictions"); + op.add(Builder::queryCacheMemorySize, JsonpDeserializer.stringDeserializer(), "query_cache.memory_size"); + op.add(Builder::recoverysourceType, JsonpDeserializer.stringDeserializer(), "recoverysource.type"); + op.add(Builder::refreshExternalTime, JsonpDeserializer.stringDeserializer(), "refresh.external_time"); + op.add(Builder::refreshExternalTotal, JsonpDeserializer.stringDeserializer(), "refresh.external_total"); + op.add(Builder::refreshListeners, JsonpDeserializer.stringDeserializer(), "refresh.listeners"); op.add(Builder::refreshTime, JsonpDeserializer.stringDeserializer(), "refresh.time"); - op.add(Builder::refreshExternalTotal, JsonpDeserializer.stringDeserializer(), "refresh.external_total", "rto", "refreshTotal"); - op.add(Builder::refreshExternalTime, JsonpDeserializer.stringDeserializer(), "refresh.external_time", "rti", "refreshTime"); - op.add(Builder::refreshListeners, JsonpDeserializer.stringDeserializer(), "refresh.listeners", "rli", "refreshListeners"); - op.add(Builder::searchFetchCurrent, JsonpDeserializer.stringDeserializer(), "search.fetch_current", "sfc", "searchFetchCurrent"); - op.add(Builder::searchFetchTime, JsonpDeserializer.stringDeserializer(), "search.fetch_time", "sfti", "searchFetchTime"); - op.add(Builder::searchFetchTotal, JsonpDeserializer.stringDeserializer(), "search.fetch_total", "sfto", "searchFetchTotal"); - op.add(Builder::searchOpenContexts, JsonpDeserializer.stringDeserializer(), "search.open_contexts", "so", "searchOpenContexts"); - op.add(Builder::searchQueryCurrent, JsonpDeserializer.stringDeserializer(), "search.query_current", "sqc", "searchQueryCurrent"); - op.add(Builder::searchQueryTime, JsonpDeserializer.stringDeserializer(), "search.query_time", "sqti", "searchQueryTime"); - op.add(Builder::searchQueryTotal, JsonpDeserializer.stringDeserializer(), "search.query_total", "sqto", "searchQueryTotal"); - op.add(Builder::searchScrollCurrent, JsonpDeserializer.stringDeserializer(), "search.scroll_current", "scc", "searchScrollCurrent"); - op.add(Builder::searchScrollTime, JsonpDeserializer.stringDeserializer(), "search.scroll_time", "scti", "searchScrollTime"); - op.add(Builder::searchScrollTotal, JsonpDeserializer.stringDeserializer(), "search.scroll_total", "scto", "searchScrollTotal"); - op.add(Builder::segmentsCount, JsonpDeserializer.stringDeserializer(), "segments.count", "sc", "segmentsCount"); - op.add(Builder::segmentsMemory, JsonpDeserializer.stringDeserializer(), "segments.memory", "sm", "segmentsMemory"); - op.add( - Builder::segmentsIndexWriterMemory, - JsonpDeserializer.stringDeserializer(), - "segments.index_writer_memory", - "siwm", - "segmentsIndexWriterMemory" - ); - op.add( - Builder::segmentsVersionMapMemory, - JsonpDeserializer.stringDeserializer(), - "segments.version_map_memory", - "svmm", - "segmentsVersionMapMemory" - ); - op.add( - Builder::segmentsFixedBitsetMemory, - JsonpDeserializer.stringDeserializer(), - "segments.fixed_bitset_memory", - "sfbm", - "fixedBitsetMemory" - ); - op.add(Builder::seqNoMax, JsonpDeserializer.stringDeserializer(), "seq_no.max", "sqm", "maxSeqNo"); - op.add(Builder::seqNoLocalCheckpoint, JsonpDeserializer.stringDeserializer(), "seq_no.local_checkpoint", "sql", "localCheckpoint"); - op.add( - Builder::seqNoGlobalCheckpoint, - JsonpDeserializer.stringDeserializer(), - "seq_no.global_checkpoint", - "sqg", - "globalCheckpoint" - ); - op.add(Builder::warmerCurrent, JsonpDeserializer.stringDeserializer(), "warmer.current", "wc", "warmerCurrent"); - op.add(Builder::warmerTotal, JsonpDeserializer.stringDeserializer(), "warmer.total", "wto", "warmerTotal"); - op.add(Builder::warmerTotalTime, JsonpDeserializer.stringDeserializer(), "warmer.total_time", "wtt", "warmerTotalTime"); - op.add(Builder::pathData, JsonpDeserializer.stringDeserializer(), "path.data", "pd", "dataPath"); - op.add(Builder::pathState, JsonpDeserializer.stringDeserializer(), "path.state", "ps", "statsPath"); - op.add(Builder::bulkTotalOperations, JsonpDeserializer.stringDeserializer(), "bulk.total_operations", "bto", "bulkTotalOperations"); - op.add(Builder::bulkTotalTime, JsonpDeserializer.stringDeserializer(), "bulk.total_time", "btti", "bulkTotalTime"); + op.add(Builder::refreshTotal, JsonpDeserializer.stringDeserializer(), "refresh.total"); + op.add(Builder::searchConcurrentAvgSliceCount, JsonpDeserializer.stringDeserializer(), "search.concurrent_avg_slice_count"); + op.add(Builder::searchConcurrentQueryCurrent, JsonpDeserializer.stringDeserializer(), "search.concurrent_query_current"); + op.add(Builder::searchConcurrentQueryTime, JsonpDeserializer.stringDeserializer(), "search.concurrent_query_time"); + op.add(Builder::searchConcurrentQueryTotal, JsonpDeserializer.stringDeserializer(), "search.concurrent_query_total"); + op.add(Builder::searchFetchCurrent, JsonpDeserializer.stringDeserializer(), "search.fetch_current"); + op.add(Builder::searchFetchTime, JsonpDeserializer.stringDeserializer(), "search.fetch_time"); + op.add(Builder::searchFetchTotal, JsonpDeserializer.stringDeserializer(), "search.fetch_total"); + op.add(Builder::searchOpenContexts, JsonpDeserializer.stringDeserializer(), "search.open_contexts"); + op.add(Builder::searchPointInTimeCurrent, JsonpDeserializer.stringDeserializer(), "search.point_in_time_current"); + op.add(Builder::searchPointInTimeTime, JsonpDeserializer.stringDeserializer(), "search.point_in_time_time"); + op.add(Builder::searchPointInTimeTotal, JsonpDeserializer.stringDeserializer(), "search.point_in_time_total"); + op.add(Builder::searchQueryCurrent, JsonpDeserializer.stringDeserializer(), "search.query_current"); + op.add(Builder::searchQueryTime, JsonpDeserializer.stringDeserializer(), "search.query_time"); + op.add(Builder::searchQueryTotal, JsonpDeserializer.stringDeserializer(), "search.query_total"); + op.add(Builder::searchScrollCurrent, JsonpDeserializer.stringDeserializer(), "search.scroll_current"); + op.add(Builder::searchScrollTime, JsonpDeserializer.stringDeserializer(), "search.scroll_time"); + op.add(Builder::searchScrollTotal, JsonpDeserializer.stringDeserializer(), "search.scroll_total"); op.add( - Builder::bulkTotalSizeInBytes, + Builder::searchSearchIdleReactivateCountTotal, JsonpDeserializer.stringDeserializer(), - "bulk.total_size_in_bytes", - "btsi", - "bulkTotalSizeInBytes" + "search.search_idle_reactivate_count_total" ); - op.add(Builder::bulkAvgTime, JsonpDeserializer.stringDeserializer(), "bulk.avg_time", "bati", "bulkAvgTime"); - op.add(Builder::bulkAvgSizeInBytes, JsonpDeserializer.stringDeserializer(), "bulk.avg_size_in_bytes", "basi", "bulkAvgSizeInBytes"); - + op.add(Builder::segmentsCount, JsonpDeserializer.stringDeserializer(), "segments.count"); + op.add(Builder::segmentsFixedBitsetMemory, JsonpDeserializer.stringDeserializer(), "segments.fixed_bitset_memory"); + op.add(Builder::segmentsIndexWriterMemory, JsonpDeserializer.stringDeserializer(), "segments.index_writer_memory"); + op.add(Builder::segmentsMemory, JsonpDeserializer.stringDeserializer(), "segments.memory"); + op.add(Builder::segmentsVersionMapMemory, JsonpDeserializer.stringDeserializer(), "segments.version_map_memory"); + op.add(Builder::seqNoGlobalCheckpoint, JsonpDeserializer.stringDeserializer(), "seq_no.global_checkpoint"); + op.add(Builder::seqNoLocalCheckpoint, JsonpDeserializer.stringDeserializer(), "seq_no.local_checkpoint"); + op.add(Builder::seqNoMax, JsonpDeserializer.stringDeserializer(), "seq_no.max"); + op.add(Builder::shard, JsonpDeserializer.stringDeserializer(), "shard"); + op.add(Builder::state, JsonpDeserializer.stringDeserializer(), "state"); + op.add(Builder::store, JsonpDeserializer.stringDeserializer(), "store"); + op.add(Builder::syncId, JsonpDeserializer.stringDeserializer(), "sync_id"); + op.add(Builder::unassignedAt, JsonpDeserializer.stringDeserializer(), "unassigned.at"); + op.add(Builder::unassignedDetails, JsonpDeserializer.stringDeserializer(), "unassigned.details"); + op.add(Builder::unassignedFor, JsonpDeserializer.stringDeserializer(), "unassigned.for"); + op.add(Builder::unassignedReason, JsonpDeserializer.stringDeserializer(), "unassigned.reason"); + op.add(Builder::warmerCurrent, JsonpDeserializer.stringDeserializer(), "warmer.current"); + op.add(Builder::warmerTotal, JsonpDeserializer.stringDeserializer(), "warmer.total"); + op.add(Builder::warmerTotalTime, JsonpDeserializer.stringDeserializer(), "warmer.total_time"); + } + + @Override + public int hashCode() { + int result = 17; + result = 31 * result + Objects.hashCode(this.bulkAvgSizeInBytes); + result = 31 * result + Objects.hashCode(this.bulkAvgTime); + result = 31 * result + Objects.hashCode(this.bulkTotalOperations); + result = 31 * result + Objects.hashCode(this.bulkTotalSizeInBytes); + result = 31 * result + Objects.hashCode(this.bulkTotalTime); + result = 31 * result + Objects.hashCode(this.completionSize); + result = 31 * result + Objects.hashCode(this.docs); + result = 31 * result + Objects.hashCode(this.docsDeleted); + result = 31 * result + Objects.hashCode(this.fielddataEvictions); + result = 31 * result + Objects.hashCode(this.fielddataMemorySize); + result = 31 * result + Objects.hashCode(this.flushTotal); + result = 31 * result + Objects.hashCode(this.flushTotalTime); + result = 31 * result + Objects.hashCode(this.getCurrent); + result = 31 * result + Objects.hashCode(this.getExistsTime); + result = 31 * result + Objects.hashCode(this.getExistsTotal); + result = 31 * result + Objects.hashCode(this.getMissingTime); + result = 31 * result + Objects.hashCode(this.getMissingTotal); + result = 31 * result + Objects.hashCode(this.getTime); + result = 31 * result + Objects.hashCode(this.getTotal); + result = 31 * result + Objects.hashCode(this.id); + result = 31 * result + Objects.hashCode(this.index); + result = 31 * result + Objects.hashCode(this.indexingDeleteCurrent); + result = 31 * result + Objects.hashCode(this.indexingDeleteTime); + result = 31 * result + Objects.hashCode(this.indexingDeleteTotal); + result = 31 * result + Objects.hashCode(this.indexingIndexCurrent); + result = 31 * result + Objects.hashCode(this.indexingIndexFailed); + result = 31 * result + Objects.hashCode(this.indexingIndexTime); + result = 31 * result + Objects.hashCode(this.indexingIndexTotal); + result = 31 * result + Objects.hashCode(this.ip); + result = 31 * result + Objects.hashCode(this.mergesCurrent); + result = 31 * result + Objects.hashCode(this.mergesCurrentDocs); + result = 31 * result + Objects.hashCode(this.mergesCurrentSize); + result = 31 * result + Objects.hashCode(this.mergesTotal); + result = 31 * result + Objects.hashCode(this.mergesTotalDocs); + result = 31 * result + Objects.hashCode(this.mergesTotalSize); + result = 31 * result + Objects.hashCode(this.mergesTotalTime); + result = 31 * result + Objects.hashCode(this.node); + result = 31 * result + Objects.hashCode(this.pathData); + result = 31 * result + Objects.hashCode(this.pathState); + result = 31 * result + Objects.hashCode(this.prirep); + result = 31 * result + Objects.hashCode(this.queryCacheEvictions); + result = 31 * result + Objects.hashCode(this.queryCacheMemorySize); + result = 31 * result + Objects.hashCode(this.recoverysourceType); + result = 31 * result + Objects.hashCode(this.refreshExternalTime); + result = 31 * result + Objects.hashCode(this.refreshExternalTotal); + result = 31 * result + Objects.hashCode(this.refreshListeners); + result = 31 * result + Objects.hashCode(this.refreshTime); + result = 31 * result + Objects.hashCode(this.refreshTotal); + result = 31 * result + Objects.hashCode(this.searchConcurrentAvgSliceCount); + result = 31 * result + Objects.hashCode(this.searchConcurrentQueryCurrent); + result = 31 * result + Objects.hashCode(this.searchConcurrentQueryTime); + result = 31 * result + Objects.hashCode(this.searchConcurrentQueryTotal); + result = 31 * result + Objects.hashCode(this.searchFetchCurrent); + result = 31 * result + Objects.hashCode(this.searchFetchTime); + result = 31 * result + Objects.hashCode(this.searchFetchTotal); + result = 31 * result + Objects.hashCode(this.searchOpenContexts); + result = 31 * result + Objects.hashCode(this.searchPointInTimeCurrent); + result = 31 * result + Objects.hashCode(this.searchPointInTimeTime); + result = 31 * result + Objects.hashCode(this.searchPointInTimeTotal); + result = 31 * result + Objects.hashCode(this.searchQueryCurrent); + result = 31 * result + Objects.hashCode(this.searchQueryTime); + result = 31 * result + Objects.hashCode(this.searchQueryTotal); + result = 31 * result + Objects.hashCode(this.searchScrollCurrent); + result = 31 * result + Objects.hashCode(this.searchScrollTime); + result = 31 * result + Objects.hashCode(this.searchScrollTotal); + result = 31 * result + Objects.hashCode(this.searchSearchIdleReactivateCountTotal); + result = 31 * result + Objects.hashCode(this.segmentsCount); + result = 31 * result + Objects.hashCode(this.segmentsFixedBitsetMemory); + result = 31 * result + Objects.hashCode(this.segmentsIndexWriterMemory); + result = 31 * result + Objects.hashCode(this.segmentsMemory); + result = 31 * result + Objects.hashCode(this.segmentsVersionMapMemory); + result = 31 * result + Objects.hashCode(this.seqNoGlobalCheckpoint); + result = 31 * result + Objects.hashCode(this.seqNoLocalCheckpoint); + result = 31 * result + Objects.hashCode(this.seqNoMax); + result = 31 * result + Objects.hashCode(this.shard); + result = 31 * result + Objects.hashCode(this.state); + result = 31 * result + Objects.hashCode(this.store); + result = 31 * result + Objects.hashCode(this.syncId); + result = 31 * result + Objects.hashCode(this.unassignedAt); + result = 31 * result + Objects.hashCode(this.unassignedDetails); + result = 31 * result + Objects.hashCode(this.unassignedFor); + result = 31 * result + Objects.hashCode(this.unassignedReason); + result = 31 * result + Objects.hashCode(this.warmerCurrent); + result = 31 * result + Objects.hashCode(this.warmerTotal); + result = 31 * result + Objects.hashCode(this.warmerTotalTime); + return result; + } + + @Override + public boolean equals(Object o) { + if (this == o) return true; + if (o == null || this.getClass() != o.getClass()) return false; + ShardsRecord other = (ShardsRecord) o; + return Objects.equals(this.bulkAvgSizeInBytes, other.bulkAvgSizeInBytes) + && Objects.equals(this.bulkAvgTime, other.bulkAvgTime) + && Objects.equals(this.bulkTotalOperations, other.bulkTotalOperations) + && Objects.equals(this.bulkTotalSizeInBytes, other.bulkTotalSizeInBytes) + && Objects.equals(this.bulkTotalTime, other.bulkTotalTime) + && Objects.equals(this.completionSize, other.completionSize) + && Objects.equals(this.docs, other.docs) + && Objects.equals(this.docsDeleted, other.docsDeleted) + && Objects.equals(this.fielddataEvictions, other.fielddataEvictions) + && Objects.equals(this.fielddataMemorySize, other.fielddataMemorySize) + && Objects.equals(this.flushTotal, other.flushTotal) + && Objects.equals(this.flushTotalTime, other.flushTotalTime) + && Objects.equals(this.getCurrent, other.getCurrent) + && Objects.equals(this.getExistsTime, other.getExistsTime) + && Objects.equals(this.getExistsTotal, other.getExistsTotal) + && Objects.equals(this.getMissingTime, other.getMissingTime) + && Objects.equals(this.getMissingTotal, other.getMissingTotal) + && Objects.equals(this.getTime, other.getTime) + && Objects.equals(this.getTotal, other.getTotal) + && Objects.equals(this.id, other.id) + && Objects.equals(this.index, other.index) + && Objects.equals(this.indexingDeleteCurrent, other.indexingDeleteCurrent) + && Objects.equals(this.indexingDeleteTime, other.indexingDeleteTime) + && Objects.equals(this.indexingDeleteTotal, other.indexingDeleteTotal) + && Objects.equals(this.indexingIndexCurrent, other.indexingIndexCurrent) + && Objects.equals(this.indexingIndexFailed, other.indexingIndexFailed) + && Objects.equals(this.indexingIndexTime, other.indexingIndexTime) + && Objects.equals(this.indexingIndexTotal, other.indexingIndexTotal) + && Objects.equals(this.ip, other.ip) + && Objects.equals(this.mergesCurrent, other.mergesCurrent) + && Objects.equals(this.mergesCurrentDocs, other.mergesCurrentDocs) + && Objects.equals(this.mergesCurrentSize, other.mergesCurrentSize) + && Objects.equals(this.mergesTotal, other.mergesTotal) + && Objects.equals(this.mergesTotalDocs, other.mergesTotalDocs) + && Objects.equals(this.mergesTotalSize, other.mergesTotalSize) + && Objects.equals(this.mergesTotalTime, other.mergesTotalTime) + && Objects.equals(this.node, other.node) + && Objects.equals(this.pathData, other.pathData) + && Objects.equals(this.pathState, other.pathState) + && Objects.equals(this.prirep, other.prirep) + && Objects.equals(this.queryCacheEvictions, other.queryCacheEvictions) + && Objects.equals(this.queryCacheMemorySize, other.queryCacheMemorySize) + && Objects.equals(this.recoverysourceType, other.recoverysourceType) + && Objects.equals(this.refreshExternalTime, other.refreshExternalTime) + && Objects.equals(this.refreshExternalTotal, other.refreshExternalTotal) + && Objects.equals(this.refreshListeners, other.refreshListeners) + && Objects.equals(this.refreshTime, other.refreshTime) + && Objects.equals(this.refreshTotal, other.refreshTotal) + && Objects.equals(this.searchConcurrentAvgSliceCount, other.searchConcurrentAvgSliceCount) + && Objects.equals(this.searchConcurrentQueryCurrent, other.searchConcurrentQueryCurrent) + && Objects.equals(this.searchConcurrentQueryTime, other.searchConcurrentQueryTime) + && Objects.equals(this.searchConcurrentQueryTotal, other.searchConcurrentQueryTotal) + && Objects.equals(this.searchFetchCurrent, other.searchFetchCurrent) + && Objects.equals(this.searchFetchTime, other.searchFetchTime) + && Objects.equals(this.searchFetchTotal, other.searchFetchTotal) + && Objects.equals(this.searchOpenContexts, other.searchOpenContexts) + && Objects.equals(this.searchPointInTimeCurrent, other.searchPointInTimeCurrent) + && Objects.equals(this.searchPointInTimeTime, other.searchPointInTimeTime) + && Objects.equals(this.searchPointInTimeTotal, other.searchPointInTimeTotal) + && Objects.equals(this.searchQueryCurrent, other.searchQueryCurrent) + && Objects.equals(this.searchQueryTime, other.searchQueryTime) + && Objects.equals(this.searchQueryTotal, other.searchQueryTotal) + && Objects.equals(this.searchScrollCurrent, other.searchScrollCurrent) + && Objects.equals(this.searchScrollTime, other.searchScrollTime) + && Objects.equals(this.searchScrollTotal, other.searchScrollTotal) + && Objects.equals(this.searchSearchIdleReactivateCountTotal, other.searchSearchIdleReactivateCountTotal) + && Objects.equals(this.segmentsCount, other.segmentsCount) + && Objects.equals(this.segmentsFixedBitsetMemory, other.segmentsFixedBitsetMemory) + && Objects.equals(this.segmentsIndexWriterMemory, other.segmentsIndexWriterMemory) + && Objects.equals(this.segmentsMemory, other.segmentsMemory) + && Objects.equals(this.segmentsVersionMapMemory, other.segmentsVersionMapMemory) + && Objects.equals(this.seqNoGlobalCheckpoint, other.seqNoGlobalCheckpoint) + && Objects.equals(this.seqNoLocalCheckpoint, other.seqNoLocalCheckpoint) + && Objects.equals(this.seqNoMax, other.seqNoMax) + && Objects.equals(this.shard, other.shard) + && Objects.equals(this.state, other.state) + && Objects.equals(this.store, other.store) + && Objects.equals(this.syncId, other.syncId) + && Objects.equals(this.unassignedAt, other.unassignedAt) + && Objects.equals(this.unassignedDetails, other.unassignedDetails) + && Objects.equals(this.unassignedFor, other.unassignedFor) + && Objects.equals(this.unassignedReason, other.unassignedReason) + && Objects.equals(this.warmerCurrent, other.warmerCurrent) + && Objects.equals(this.warmerTotal, other.warmerTotal) + && Objects.equals(this.warmerTotalTime, other.warmerTotalTime); } - } diff --git a/java-client/src/main/java/org/opensearch/client/opensearch/cat/snapshots/SnapshotsRecord.java b/java-client/src/generated/java/org/opensearch/client/opensearch/cat/snapshots/SnapshotsRecord.java similarity index 65% rename from java-client/src/main/java/org/opensearch/client/opensearch/cat/snapshots/SnapshotsRecord.java rename to java-client/src/generated/java/org/opensearch/client/opensearch/cat/snapshots/SnapshotsRecord.java index c033acd623..bee6f78139 100644 --- a/java-client/src/main/java/org/opensearch/client/opensearch/cat/snapshots/SnapshotsRecord.java +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/cat/snapshots/SnapshotsRecord.java @@ -30,10 +30,17 @@ * GitHub history for details. */ +//---------------------------------------------------- +// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. +//---------------------------------------------------- + package org.opensearch.client.opensearch.cat.snapshots; import jakarta.json.stream.JsonGenerator; +import java.util.Objects; import java.util.function.Function; +import javax.annotation.Generated; +import javax.annotation.Nonnull; import javax.annotation.Nullable; import org.opensearch.client.json.JsonpDeserializable; import org.opensearch.client.json.JsonpDeserializer; @@ -42,209 +49,213 @@ import org.opensearch.client.json.ObjectDeserializer; import org.opensearch.client.json.PlainJsonSerializable; import org.opensearch.client.opensearch._types.Time; +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: cat.snapshots.SnapshotsRecord @JsonpDeserializable -public class SnapshotsRecord implements PlainJsonSerializable { +@Generated("org.opensearch.client.codegen.CodeGenerator") +public class SnapshotsRecord implements PlainJsonSerializable, ToCopyableBuilder { + @Nullable - private final String id; + private final Time duration; @Nullable - private final String repository; + private final String endEpoch; @Nullable - private final String status; + private final String endTime; @Nullable - private final String startEpoch; + private final String failedShards; @Nullable - private final String startTime; + private final String id; @Nullable - private final String endEpoch; + private final String indices; @Nullable - private final String endTime; + private final String reason; @Nullable - private final Time duration; + private final String repository; @Nullable - private final String indices; + private final String startEpoch; @Nullable - private final String successfulShards; + private final String startTime; @Nullable - private final String failedShards; + private final String status; @Nullable - private final String totalShards; + private final String successfulShards; @Nullable - private final String reason; + private final String totalShards; // --------------------------------------------------------------------------------------------- private SnapshotsRecord(Builder builder) { - + this.duration = builder.duration; + this.endEpoch = builder.endEpoch; + this.endTime = builder.endTime; + this.failedShards = builder.failedShards; this.id = builder.id; + this.indices = builder.indices; + this.reason = builder.reason; this.repository = builder.repository; - this.status = builder.status; this.startEpoch = builder.startEpoch; this.startTime = builder.startTime; - this.endEpoch = builder.endEpoch; - this.endTime = builder.endTime; - this.duration = builder.duration; - this.indices = builder.indices; + this.status = builder.status; this.successfulShards = builder.successfulShards; - this.failedShards = builder.failedShards; this.totalShards = builder.totalShards; - this.reason = builder.reason; - } - public static SnapshotsRecord of(Function> fn) { + public static SnapshotsRecord of(Function> fn) { return fn.apply(new Builder()).build(); } /** - * unique snapshot - *

- * API name: {@code id} + * API name: {@code duration} */ @Nullable - public final String id() { - return this.id; + public final Time duration() { + return this.duration; } /** - * repository name - *

- * API name: {@code repository} + * API name: {@code end_epoch} */ @Nullable - public final String repository() { - return this.repository; + public final String endEpoch() { + return this.endEpoch; } /** - * snapshot name - *

- * API name: {@code status} + * API name: {@code end_time} */ @Nullable - public final String status() { - return this.status; + public final String endTime() { + return this.endTime; } /** - * start time in seconds since 1970-01-01 00:00:00 + * The number of failed shards in the snapshot. *

- * API name: {@code start_epoch} + * API name: {@code failed_shards} + *

*/ @Nullable - public final String startEpoch() { - return this.startEpoch; + public final String failedShards() { + return this.failedShards; } /** - * start time in HH:MM:SS + * The unique identifier for the snapshot. *

- * API name: {@code start_time} + * API name: {@code id} + *

*/ @Nullable - public final String startTime() { - return this.startTime; + public final String id() { + return this.id; } /** - * end time in seconds since 1970-01-01 00:00:00 + * The number of indexes in the snapshot. *

- * API name: {@code end_epoch} + * API name: {@code indices} + *

*/ @Nullable - public final String endEpoch() { - return this.endEpoch; + public final String indices() { + return this.indices; } /** - * end time in HH:MM:SS + * The reason for any snapshot failures. *

- * API name: {@code end_time} + * API name: {@code reason} + *

*/ @Nullable - public final String endTime() { - return this.endTime; + public final String reason() { + return this.reason; } /** - * duration + * The repository name. *

- * API name: {@code duration} + * API name: {@code repository} + *

*/ @Nullable - public final Time duration() { - return this.duration; + public final String repository() { + return this.repository; } /** - * number of indices - *

- * API name: {@code indices} + * API name: {@code start_epoch} */ @Nullable - public final String indices() { - return this.indices; + public final String startEpoch() { + return this.startEpoch; } /** - * number of successful shards - *

- * API name: {@code successful_shards} + * API name: {@code start_time} */ @Nullable - public final String successfulShards() { - return this.successfulShards; + public final String startTime() { + return this.startTime; } /** - * number of failed shards + * The state of the snapshot process. Returned values include: FAILED: The snapshot process failed. + * INCOMPATIBLE: The snapshot process is incompatible with the current cluster version. IN_PROGRESS: The + * snapshot process started but has not completed. PARTIAL: The snapshot process completed with a partial success. + * SUCCESS: The snapshot process completed with a full success. *

- * API name: {@code failed_shards} + * API name: {@code status} + *

*/ @Nullable - public final String failedShards() { - return this.failedShards; + public final String status() { + return this.status; } /** - * number of total shards + * The number of successful shards in the snapshot. *

- * API name: {@code total_shards} + * API name: {@code successful_shards} + *

*/ @Nullable - public final String totalShards() { - return this.totalShards; + public final String successfulShards() { + return this.successfulShards; } /** - * reason for failures + * The total number of shards in the snapshot. *

- * API name: {@code reason} + * API name: {@code total_shards} + *

*/ @Nullable - public final String reason() { - return this.reason; + public final String totalShards() { + return this.totalShards; } /** * Serialize this object to JSON. */ + @Override public void serialize(JsonGenerator generator, JsonpMapper mapper) { generator.writeStartObject(); serializeInternal(generator, mapper); @@ -252,266 +263,315 @@ public void serialize(JsonGenerator generator, JsonpMapper mapper) { } protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { + if (this.duration != null) { + generator.writeKey("duration"); + this.duration.serialize(generator, mapper); + } + + if (this.endEpoch != null) { + generator.writeKey("end_epoch"); + generator.write(this.endEpoch); + } + + if (this.endTime != null) { + generator.writeKey("end_time"); + generator.write(this.endTime); + } + + if (this.failedShards != null) { + generator.writeKey("failed_shards"); + generator.write(this.failedShards); + } if (this.id != null) { generator.writeKey("id"); generator.write(this.id); + } + if (this.indices != null) { + generator.writeKey("indices"); + generator.write(this.indices); + } + + if (this.reason != null) { + generator.writeKey("reason"); + generator.write(this.reason); } + if (this.repository != null) { generator.writeKey("repository"); generator.write(this.repository); - } - if (this.status != null) { - generator.writeKey("status"); - generator.write(this.status); - } if (this.startEpoch != null) { generator.writeKey("start_epoch"); generator.write(this.startEpoch); - } + if (this.startTime != null) { generator.writeKey("start_time"); generator.write(this.startTime); - - } - if (this.endEpoch != null) { - generator.writeKey("end_epoch"); - generator.write(this.endEpoch); - } - if (this.endTime != null) { - generator.writeKey("end_time"); - generator.write(this.endTime); - - } - if (this.duration != null) { - generator.writeKey("duration"); - this.duration.serialize(generator, mapper); + if (this.status != null) { + generator.writeKey("status"); + generator.write(this.status); } - if (this.indices != null) { - generator.writeKey("indices"); - generator.write(this.indices); - } if (this.successfulShards != null) { generator.writeKey("successful_shards"); generator.write(this.successfulShards); - } - if (this.failedShards != null) { - generator.writeKey("failed_shards"); - generator.write(this.failedShards); - } if (this.totalShards != null) { generator.writeKey("total_shards"); generator.write(this.totalShards); - } - if (this.reason != null) { - generator.writeKey("reason"); - generator.write(this.reason); + } - } + // --------------------------------------------------------------------------------------------- + @Override + @Nonnull + public Builder toBuilder() { + return new Builder(this); } - // --------------------------------------------------------------------------------------------- + @Nonnull + public static Builder builder() { + return new Builder(); + } /** * Builder for {@link SnapshotsRecord}. */ - - public static class Builder extends ObjectBuilderBase implements ObjectBuilder { + public static class Builder extends ObjectBuilderBase implements CopyableBuilder { @Nullable - private String id; - + private Time duration; @Nullable - private String repository; - + private String endEpoch; @Nullable - private String status; - + private String endTime; @Nullable - private String startEpoch; - + private String failedShards; @Nullable - private String startTime; - + private String id; @Nullable - private String endEpoch; - + private String indices; @Nullable - private String endTime; - + private String reason; @Nullable - private Time duration; - + private String repository; @Nullable - private String indices; - + private String startEpoch; @Nullable - private String successfulShards; - + private String startTime; @Nullable - private String failedShards; - + private String status; + @Nullable + private String successfulShards; @Nullable private String totalShards; - @Nullable - private String reason; + public Builder() {} + + private Builder(SnapshotsRecord o) { + this.duration = o.duration; + this.endEpoch = o.endEpoch; + this.endTime = o.endTime; + this.failedShards = o.failedShards; + this.id = o.id; + this.indices = o.indices; + this.reason = o.reason; + this.repository = o.repository; + this.startEpoch = o.startEpoch; + this.startTime = o.startTime; + this.status = o.status; + this.successfulShards = o.successfulShards; + this.totalShards = o.totalShards; + } + + private Builder(Builder o) { + this.duration = o.duration; + this.endEpoch = o.endEpoch; + this.endTime = o.endTime; + this.failedShards = o.failedShards; + this.id = o.id; + this.indices = o.indices; + this.reason = o.reason; + this.repository = o.repository; + this.startEpoch = o.startEpoch; + this.startTime = o.startTime; + this.status = o.status; + this.successfulShards = o.successfulShards; + this.totalShards = o.totalShards; + } + + @Override + @Nonnull + public Builder copy() { + return new Builder(this); + } /** - * unique snapshot - *

- * API name: {@code id} + * API name: {@code duration} */ - public final Builder id(@Nullable String value) { - this.id = value; + @Nonnull + public final Builder duration(@Nullable Time value) { + this.duration = value; return this; } /** - * repository name - *

- * API name: {@code repository} + * API name: {@code duration} */ - public final Builder repository(@Nullable String value) { - this.repository = value; - return this; + @Nonnull + public final Builder duration(Function> fn) { + return duration(fn.apply(new Time.Builder()).build()); } /** - * snapshot name - *

- * API name: {@code status} + * API name: {@code end_epoch} */ - public final Builder status(@Nullable String value) { - this.status = value; + @Nonnull + public final Builder endEpoch(@Nullable String value) { + this.endEpoch = value; return this; } /** - * start time in seconds since 1970-01-01 00:00:00 - *

- * API name: {@code start_epoch} + * API name: {@code end_time} */ - public final Builder startEpoch(@Nullable String value) { - this.startEpoch = value; + @Nonnull + public final Builder endTime(@Nullable String value) { + this.endTime = value; return this; } /** - * start time in HH:MM:SS + * The number of failed shards in the snapshot. *

- * API name: {@code start_time} + * API name: {@code failed_shards} + *

*/ - public final Builder startTime(@Nullable String value) { - this.startTime = value; + @Nonnull + public final Builder failedShards(@Nullable String value) { + this.failedShards = value; return this; } /** - * end time in seconds since 1970-01-01 00:00:00 + * The unique identifier for the snapshot. *

- * API name: {@code end_epoch} + * API name: {@code id} + *

*/ - public final Builder endEpoch(@Nullable String value) { - this.endEpoch = value; + @Nonnull + public final Builder id(@Nullable String value) { + this.id = value; return this; } /** - * end time in HH:MM:SS + * The number of indexes in the snapshot. *

- * API name: {@code end_time} + * API name: {@code indices} + *

*/ - public final Builder endTime(@Nullable String value) { - this.endTime = value; + @Nonnull + public final Builder indices(@Nullable String value) { + this.indices = value; return this; } /** - * duration + * The reason for any snapshot failures. *

- * API name: {@code duration} + * API name: {@code reason} + *

*/ - public final Builder duration(@Nullable Time value) { - this.duration = value; + @Nonnull + public final Builder reason(@Nullable String value) { + this.reason = value; return this; } /** - * duration + * The repository name. *

- * API name: {@code duration} + * API name: {@code repository} + *

*/ - public final Builder duration(Function> fn) { - return this.duration(fn.apply(new Time.Builder()).build()); + @Nonnull + public final Builder repository(@Nullable String value) { + this.repository = value; + return this; } /** - * number of indices - *

- * API name: {@code indices} + * API name: {@code start_epoch} */ - public final Builder indices(@Nullable String value) { - this.indices = value; + @Nonnull + public final Builder startEpoch(@Nullable String value) { + this.startEpoch = value; return this; } /** - * number of successful shards - *

- * API name: {@code successful_shards} + * API name: {@code start_time} */ - public final Builder successfulShards(@Nullable String value) { - this.successfulShards = value; + @Nonnull + public final Builder startTime(@Nullable String value) { + this.startTime = value; return this; } /** - * number of failed shards + * The state of the snapshot process. Returned values include: FAILED: The snapshot process failed. + * INCOMPATIBLE: The snapshot process is incompatible with the current cluster version. IN_PROGRESS: The + * snapshot process started but has not completed. PARTIAL: The snapshot process completed with a partial success. + * SUCCESS: The snapshot process completed with a full success. *

- * API name: {@code failed_shards} + * API name: {@code status} + *

*/ - public final Builder failedShards(@Nullable String value) { - this.failedShards = value; + @Nonnull + public final Builder status(@Nullable String value) { + this.status = value; return this; } /** - * number of total shards + * The number of successful shards in the snapshot. *

- * API name: {@code total_shards} + * API name: {@code successful_shards} + *

*/ - public final Builder totalShards(@Nullable String value) { - this.totalShards = value; + @Nonnull + public final Builder successfulShards(@Nullable String value) { + this.successfulShards = value; return this; } /** - * reason for failures + * The total number of shards in the snapshot. *

- * API name: {@code reason} + * API name: {@code total_shards} + *

*/ - public final Builder reason(@Nullable String value) { - this.reason = value; + @Nonnull + public final Builder totalShards(@Nullable String value) { + this.totalShards = value; return this; } /** * Builds a {@link SnapshotsRecord}. * - * @throws NullPointerException - * if some of the required fields are null. + * @throws NullPointerException if some of the required fields are null. */ + @Override + @Nonnull public SnapshotsRecord build() { _checkSingleUse(); @@ -530,21 +590,57 @@ public SnapshotsRecord build() { ); protected static void setupSnapshotsRecordDeserializer(ObjectDeserializer op) { + op.add(Builder::duration, Time._DESERIALIZER, "duration"); + op.add(Builder::endEpoch, JsonpDeserializer.stringDeserializer(), "end_epoch"); + op.add(Builder::endTime, JsonpDeserializer.stringDeserializer(), "end_time"); + op.add(Builder::failedShards, JsonpDeserializer.stringDeserializer(), "failed_shards"); + op.add(Builder::id, JsonpDeserializer.stringDeserializer(), "id"); + op.add(Builder::indices, JsonpDeserializer.stringDeserializer(), "indices"); + op.add(Builder::reason, JsonpDeserializer.stringDeserializer(), "reason"); + op.add(Builder::repository, JsonpDeserializer.stringDeserializer(), "repository"); + op.add(Builder::startEpoch, JsonpDeserializer.stringDeserializer(), "start_epoch"); + op.add(Builder::startTime, JsonpDeserializer.stringDeserializer(), "start_time"); + op.add(Builder::status, JsonpDeserializer.stringDeserializer(), "status"); + op.add(Builder::successfulShards, JsonpDeserializer.stringDeserializer(), "successful_shards"); + op.add(Builder::totalShards, JsonpDeserializer.stringDeserializer(), "total_shards"); + } - op.add(Builder::id, JsonpDeserializer.stringDeserializer(), "id", "snapshot"); - op.add(Builder::repository, JsonpDeserializer.stringDeserializer(), "repository", "re", "repo"); - op.add(Builder::status, JsonpDeserializer.stringDeserializer(), "status", "s"); - op.add(Builder::startEpoch, JsonpDeserializer.stringDeserializer(), "start_epoch", "ste", "startEpoch"); - op.add(Builder::startTime, JsonpDeserializer.stringDeserializer(), "start_time", "sti", "startTime"); - op.add(Builder::endEpoch, JsonpDeserializer.stringDeserializer(), "end_epoch", "ete", "endEpoch"); - op.add(Builder::endTime, JsonpDeserializer.stringDeserializer(), "end_time", "eti", "endTime"); - op.add(Builder::duration, Time._DESERIALIZER, "duration", "dur"); - op.add(Builder::indices, JsonpDeserializer.stringDeserializer(), "indices", "i"); - op.add(Builder::successfulShards, JsonpDeserializer.stringDeserializer(), "successful_shards", "ss"); - op.add(Builder::failedShards, JsonpDeserializer.stringDeserializer(), "failed_shards", "fs"); - op.add(Builder::totalShards, JsonpDeserializer.stringDeserializer(), "total_shards", "ts"); - op.add(Builder::reason, JsonpDeserializer.stringDeserializer(), "reason", "r"); - + @Override + public int hashCode() { + int result = 17; + result = 31 * result + Objects.hashCode(this.duration); + result = 31 * result + Objects.hashCode(this.endEpoch); + result = 31 * result + Objects.hashCode(this.endTime); + result = 31 * result + Objects.hashCode(this.failedShards); + result = 31 * result + Objects.hashCode(this.id); + result = 31 * result + Objects.hashCode(this.indices); + result = 31 * result + Objects.hashCode(this.reason); + result = 31 * result + Objects.hashCode(this.repository); + result = 31 * result + Objects.hashCode(this.startEpoch); + result = 31 * result + Objects.hashCode(this.startTime); + result = 31 * result + Objects.hashCode(this.status); + result = 31 * result + Objects.hashCode(this.successfulShards); + result = 31 * result + Objects.hashCode(this.totalShards); + return result; } + @Override + public boolean equals(Object o) { + if (this == o) return true; + if (o == null || this.getClass() != o.getClass()) return false; + SnapshotsRecord other = (SnapshotsRecord) o; + return Objects.equals(this.duration, other.duration) + && Objects.equals(this.endEpoch, other.endEpoch) + && Objects.equals(this.endTime, other.endTime) + && Objects.equals(this.failedShards, other.failedShards) + && Objects.equals(this.id, other.id) + && Objects.equals(this.indices, other.indices) + && Objects.equals(this.reason, other.reason) + && Objects.equals(this.repository, other.repository) + && Objects.equals(this.startEpoch, other.startEpoch) + && Objects.equals(this.startTime, other.startTime) + && Objects.equals(this.status, other.status) + && Objects.equals(this.successfulShards, other.successfulShards) + && Objects.equals(this.totalShards, other.totalShards); + } } diff --git a/java-client/src/main/java/org/opensearch/client/opensearch/cat/tasks/TasksRecord.java b/java-client/src/generated/java/org/opensearch/client/opensearch/cat/tasks/TasksRecord.java similarity index 68% rename from java-client/src/main/java/org/opensearch/client/opensearch/cat/tasks/TasksRecord.java rename to java-client/src/generated/java/org/opensearch/client/opensearch/cat/tasks/TasksRecord.java index c45bdffe0f..7377317d65 100644 --- a/java-client/src/main/java/org/opensearch/client/opensearch/cat/tasks/TasksRecord.java +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/cat/tasks/TasksRecord.java @@ -30,10 +30,17 @@ * GitHub history for details. */ +//---------------------------------------------------- +// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. +//---------------------------------------------------- + package org.opensearch.client.opensearch.cat.tasks; import jakarta.json.stream.JsonGenerator; +import java.util.Objects; import java.util.function.Function; +import javax.annotation.Generated; +import javax.annotation.Nonnull; import javax.annotation.Nullable; import org.opensearch.client.json.JsonpDeserializable; import org.opensearch.client.json.JsonpDeserializer; @@ -41,172 +48,177 @@ import org.opensearch.client.json.ObjectBuilderDeserializer; import org.opensearch.client.json.ObjectDeserializer; import org.opensearch.client.json.PlainJsonSerializable; +import org.opensearch.client.util.CopyableBuilder; import org.opensearch.client.util.ObjectBuilder; import org.opensearch.client.util.ObjectBuilderBase; +import org.opensearch.client.util.ToCopyableBuilder; // typedef: cat.tasks.TasksRecord @JsonpDeserializable -public class TasksRecord implements PlainJsonSerializable { - @Nullable - private final String id; +@Generated("org.opensearch.client.codegen.CodeGenerator") +public class TasksRecord implements PlainJsonSerializable, ToCopyableBuilder { @Nullable private final String action; @Nullable - private final String taskId; + private final String description; @Nullable - private final String parentTaskId; + private final String id; @Nullable - private final String type; + private final String ip; @Nullable - private final String startTime; + private final String node; @Nullable - private final String timestamp; + private final String nodeId; @Nullable - private final String runningTimeNs; + private final String parentTaskId; + + @Nullable + private final String port; @Nullable private final String runningTime; @Nullable - private final String nodeId; + private final String runningTimeNs; @Nullable - private final String ip; + private final String startTime; @Nullable - private final String port; + private final String taskId; @Nullable - private final String node; + private final String timestamp; @Nullable - private final String version; + private final String type; @Nullable - private final String xOpaqueId; + private final String version; @Nullable - private final String description; + private final String xOpaqueId; // --------------------------------------------------------------------------------------------- private TasksRecord(Builder builder) { - - this.id = builder.id; this.action = builder.action; - this.taskId = builder.taskId; + this.description = builder.description; + this.id = builder.id; + this.ip = builder.ip; + this.node = builder.node; + this.nodeId = builder.nodeId; this.parentTaskId = builder.parentTaskId; - this.type = builder.type; + this.port = builder.port; + this.runningTime = builder.runningTime; + this.runningTimeNs = builder.runningTimeNs; this.startTime = builder.startTime; + this.taskId = builder.taskId; this.timestamp = builder.timestamp; - this.runningTimeNs = builder.runningTimeNs; - this.runningTime = builder.runningTime; - this.nodeId = builder.nodeId; - this.ip = builder.ip; - this.port = builder.port; - this.node = builder.node; + this.type = builder.type; this.version = builder.version; this.xOpaqueId = builder.xOpaqueId; - this.description = builder.description; - } - public static TasksRecord of(Function> fn) { + public static TasksRecord of(Function> fn) { return fn.apply(new Builder()).build(); } /** - * id of the task with the node + * The task action. *

- * API name: {@code id} + * API name: {@code action} + *

*/ @Nullable - public final String id() { - return this.id; + public final String action() { + return this.action; } /** - * task action + * The task action description. *

- * API name: {@code action} + * API name: {@code description} + *

*/ @Nullable - public final String action() { - return this.action; + public final String description() { + return this.description; } /** - * unique task id - *

- * API name: {@code task_id} + * API name: {@code id} */ @Nullable - public final String taskId() { - return this.taskId; + public final String id() { + return this.id; } /** - * parent task id + * The IP address for the node. *

- * API name: {@code parent_task_id} + * API name: {@code ip} + *

*/ @Nullable - public final String parentTaskId() { - return this.parentTaskId; + public final String ip() { + return this.ip; } /** - * task type + * The node name. *

- * API name: {@code type} + * API name: {@code node} + *

*/ @Nullable - public final String type() { - return this.type; + public final String node() { + return this.node; } /** - * start time in ms - *

- * API name: {@code start_time} + * API name: {@code node_id} */ @Nullable - public final String startTime() { - return this.startTime; + public final String nodeId() { + return this.nodeId; } /** - * start time in HH:MM:SS + * The parent task identifier. *

- * API name: {@code timestamp} + * API name: {@code parent_task_id} + *

*/ @Nullable - public final String timestamp() { - return this.timestamp; + public final String parentTaskId() { + return this.parentTaskId; } /** - * running time ns + * The bound transport port for the node. *

- * API name: {@code running_time_ns} + * API name: {@code port} + *

*/ @Nullable - public final String runningTimeNs() { - return this.runningTimeNs; + public final String port() { + return this.port; } /** - * running time + * The running time. *

* API name: {@code running_time} + *

*/ @Nullable public final String runningTime() { @@ -214,48 +226,58 @@ public final String runningTime() { } /** - * unique node id + * The running time in nanoseconds. *

- * API name: {@code node_id} + * API name: {@code running_time_ns} + *

*/ @Nullable - public final String nodeId() { - return this.nodeId; + public final String runningTimeNs() { + return this.runningTimeNs; } /** - * ip address + * The start time in milliseconds. *

- * API name: {@code ip} + * API name: {@code start_time} + *

*/ @Nullable - public final String ip() { - return this.ip; + public final String startTime() { + return this.startTime; } /** - * bound transport port - *

- * API name: {@code port} + * API name: {@code task_id} */ @Nullable - public final String port() { - return this.port; + public final String taskId() { + return this.taskId; } /** - * node name + * The start time in HH:MM:SS format. *

- * API name: {@code node} + * API name: {@code timestamp} + *

*/ @Nullable - public final String node() { - return this.node; + public final String timestamp() { + return this.timestamp; } /** - * es version + * The task type. *

+ * API name: {@code type} + *

+ */ + @Nullable + public final String type() { + return this.type; + } + + /** * API name: {@code version} */ @Nullable @@ -264,28 +286,20 @@ public final String version() { } /** - * X-Opaque-ID header + * The X-Opaque-ID header. *

* API name: {@code x_opaque_id} + *

*/ @Nullable public final String xOpaqueId() { return this.xOpaqueId; } - /** - * task action - *

- * API name: {@code description} - */ - @Nullable - public final String description() { - return this.description; - } - /** * Serialize this object to JSON. */ + @Override public void serialize(JsonGenerator generator, JsonpMapper mapper) { generator.writeStartObject(); serializeInternal(generator, mapper); @@ -293,311 +307,370 @@ public void serialize(JsonGenerator generator, JsonpMapper mapper) { } protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { + if (this.action != null) { + generator.writeKey("action"); + generator.write(this.action); + } + + if (this.description != null) { + generator.writeKey("description"); + generator.write(this.description); + } if (this.id != null) { generator.writeKey("id"); generator.write(this.id); + } + if (this.ip != null) { + generator.writeKey("ip"); + generator.write(this.ip); } - if (this.action != null) { - generator.writeKey("action"); - generator.write(this.action); + if (this.node != null) { + generator.writeKey("node"); + generator.write(this.node); } - if (this.taskId != null) { - generator.writeKey("task_id"); - generator.write(this.taskId); + if (this.nodeId != null) { + generator.writeKey("node_id"); + generator.write(this.nodeId); } + if (this.parentTaskId != null) { generator.writeKey("parent_task_id"); generator.write(this.parentTaskId); - } - if (this.type != null) { - generator.writeKey("type"); - generator.write(this.type); + if (this.port != null) { + generator.writeKey("port"); + generator.write(this.port); } - if (this.startTime != null) { - generator.writeKey("start_time"); - generator.write(this.startTime); + if (this.runningTime != null) { + generator.writeKey("running_time"); + generator.write(this.runningTime); } - if (this.timestamp != null) { - generator.writeKey("timestamp"); - generator.write(this.timestamp); - } if (this.runningTimeNs != null) { generator.writeKey("running_time_ns"); generator.write(this.runningTimeNs); - } - if (this.runningTime != null) { - generator.writeKey("running_time"); - generator.write(this.runningTime); + if (this.startTime != null) { + generator.writeKey("start_time"); + generator.write(this.startTime); } - if (this.nodeId != null) { - generator.writeKey("node_id"); - generator.write(this.nodeId); + if (this.taskId != null) { + generator.writeKey("task_id"); + generator.write(this.taskId); } - if (this.ip != null) { - generator.writeKey("ip"); - generator.write(this.ip); + if (this.timestamp != null) { + generator.writeKey("timestamp"); + generator.write(this.timestamp); } - if (this.port != null) { - generator.writeKey("port"); - generator.write(this.port); + if (this.type != null) { + generator.writeKey("type"); + generator.write(this.type); } - if (this.node != null) { - generator.writeKey("node"); - generator.write(this.node); - } if (this.version != null) { generator.writeKey("version"); generator.write(this.version); - } + if (this.xOpaqueId != null) { generator.writeKey("x_opaque_id"); generator.write(this.xOpaqueId); - } - if (this.description != null) { - generator.writeKey("description"); - generator.write(this.description); + } - } + // --------------------------------------------------------------------------------------------- + @Override + @Nonnull + public Builder toBuilder() { + return new Builder(this); } - // --------------------------------------------------------------------------------------------- + @Nonnull + public static Builder builder() { + return new Builder(); + } /** * Builder for {@link TasksRecord}. */ - - public static class Builder extends ObjectBuilderBase implements ObjectBuilder { - @Nullable - private String id; - + public static class Builder extends ObjectBuilderBase implements CopyableBuilder { @Nullable private String action; - @Nullable - private String taskId; - + private String description; @Nullable - private String parentTaskId; - + private String id; @Nullable - private String type; - + private String ip; @Nullable - private String startTime; - + private String node; @Nullable - private String timestamp; - + private String nodeId; @Nullable - private String runningTimeNs; - + private String parentTaskId; + @Nullable + private String port; @Nullable private String runningTime; - @Nullable - private String nodeId; - + private String runningTimeNs; @Nullable - private String ip; - + private String startTime; @Nullable - private String port; - + private String taskId; @Nullable - private String node; - + private String timestamp; + @Nullable + private String type; @Nullable private String version; - @Nullable private String xOpaqueId; - @Nullable - private String description; + public Builder() {} + + private Builder(TasksRecord o) { + this.action = o.action; + this.description = o.description; + this.id = o.id; + this.ip = o.ip; + this.node = o.node; + this.nodeId = o.nodeId; + this.parentTaskId = o.parentTaskId; + this.port = o.port; + this.runningTime = o.runningTime; + this.runningTimeNs = o.runningTimeNs; + this.startTime = o.startTime; + this.taskId = o.taskId; + this.timestamp = o.timestamp; + this.type = o.type; + this.version = o.version; + this.xOpaqueId = o.xOpaqueId; + } + + private Builder(Builder o) { + this.action = o.action; + this.description = o.description; + this.id = o.id; + this.ip = o.ip; + this.node = o.node; + this.nodeId = o.nodeId; + this.parentTaskId = o.parentTaskId; + this.port = o.port; + this.runningTime = o.runningTime; + this.runningTimeNs = o.runningTimeNs; + this.startTime = o.startTime; + this.taskId = o.taskId; + this.timestamp = o.timestamp; + this.type = o.type; + this.version = o.version; + this.xOpaqueId = o.xOpaqueId; + } + + @Override + @Nonnull + public Builder copy() { + return new Builder(this); + } /** - * id of the task with the node + * The task action. *

- * API name: {@code id} + * API name: {@code action} + *

*/ - public final Builder id(@Nullable String value) { - this.id = value; + @Nonnull + public final Builder action(@Nullable String value) { + this.action = value; return this; } /** - * task action + * The task action description. *

- * API name: {@code action} + * API name: {@code description} + *

*/ - public final Builder action(@Nullable String value) { - this.action = value; + @Nonnull + public final Builder description(@Nullable String value) { + this.description = value; return this; } /** - * unique task id - *

- * API name: {@code task_id} + * API name: {@code id} */ - public final Builder taskId(@Nullable String value) { - this.taskId = value; + @Nonnull + public final Builder id(@Nullable String value) { + this.id = value; return this; } /** - * parent task id + * The IP address for the node. *

- * API name: {@code parent_task_id} + * API name: {@code ip} + *

*/ - public final Builder parentTaskId(@Nullable String value) { - this.parentTaskId = value; + @Nonnull + public final Builder ip(@Nullable String value) { + this.ip = value; return this; } /** - * task type + * The node name. *

- * API name: {@code type} + * API name: {@code node} + *

*/ - public final Builder type(@Nullable String value) { - this.type = value; + @Nonnull + public final Builder node(@Nullable String value) { + this.node = value; return this; } /** - * start time in ms - *

- * API name: {@code start_time} + * API name: {@code node_id} */ - public final Builder startTime(@Nullable String value) { - this.startTime = value; + @Nonnull + public final Builder nodeId(@Nullable String value) { + this.nodeId = value; return this; } /** - * start time in HH:MM:SS + * The parent task identifier. *

- * API name: {@code timestamp} + * API name: {@code parent_task_id} + *

*/ - public final Builder timestamp(@Nullable String value) { - this.timestamp = value; + @Nonnull + public final Builder parentTaskId(@Nullable String value) { + this.parentTaskId = value; return this; } /** - * running time ns + * The bound transport port for the node. *

- * API name: {@code running_time_ns} + * API name: {@code port} + *

*/ - public final Builder runningTimeNs(@Nullable String value) { - this.runningTimeNs = value; + @Nonnull + public final Builder port(@Nullable String value) { + this.port = value; return this; } /** - * running time + * The running time. *

* API name: {@code running_time} + *

*/ + @Nonnull public final Builder runningTime(@Nullable String value) { this.runningTime = value; return this; } /** - * unique node id + * The running time in nanoseconds. *

- * API name: {@code node_id} + * API name: {@code running_time_ns} + *

*/ - public final Builder nodeId(@Nullable String value) { - this.nodeId = value; + @Nonnull + public final Builder runningTimeNs(@Nullable String value) { + this.runningTimeNs = value; return this; } /** - * ip address + * The start time in milliseconds. *

- * API name: {@code ip} + * API name: {@code start_time} + *

*/ - public final Builder ip(@Nullable String value) { - this.ip = value; + @Nonnull + public final Builder startTime(@Nullable String value) { + this.startTime = value; return this; } /** - * bound transport port - *

- * API name: {@code port} + * API name: {@code task_id} */ - public final Builder port(@Nullable String value) { - this.port = value; + @Nonnull + public final Builder taskId(@Nullable String value) { + this.taskId = value; return this; } /** - * node name + * The start time in HH:MM:SS format. *

- * API name: {@code node} + * API name: {@code timestamp} + *

*/ - public final Builder node(@Nullable String value) { - this.node = value; + @Nonnull + public final Builder timestamp(@Nullable String value) { + this.timestamp = value; return this; } /** - * es version + * The task type. *

+ * API name: {@code type} + *

+ */ + @Nonnull + public final Builder type(@Nullable String value) { + this.type = value; + return this; + } + + /** * API name: {@code version} */ + @Nonnull public final Builder version(@Nullable String value) { this.version = value; return this; } /** - * X-Opaque-ID header + * The X-Opaque-ID header. *

* API name: {@code x_opaque_id} + *

*/ + @Nonnull public final Builder xOpaqueId(@Nullable String value) { this.xOpaqueId = value; return this; } - /** - * task action - *

- * API name: {@code description} - */ - public final Builder description(@Nullable String value) { - this.description = value; - return this; - } - /** * Builds a {@link TasksRecord}. * - * @throws NullPointerException - * if some of the required fields are null. + * @throws NullPointerException if some of the required fields are null. */ + @Override + @Nonnull public TasksRecord build() { _checkSingleUse(); @@ -616,24 +689,66 @@ public TasksRecord build() { ); protected static void setupTasksRecordDeserializer(ObjectDeserializer op) { - + op.add(Builder::action, JsonpDeserializer.stringDeserializer(), "action"); + op.add(Builder::description, JsonpDeserializer.stringDeserializer(), "description"); op.add(Builder::id, JsonpDeserializer.stringDeserializer(), "id"); - op.add(Builder::action, JsonpDeserializer.stringDeserializer(), "action", "ac"); - op.add(Builder::taskId, JsonpDeserializer.stringDeserializer(), "task_id", "ti"); - op.add(Builder::parentTaskId, JsonpDeserializer.stringDeserializer(), "parent_task_id", "pti"); - op.add(Builder::type, JsonpDeserializer.stringDeserializer(), "type", "ty"); - op.add(Builder::startTime, JsonpDeserializer.stringDeserializer(), "start_time", "start"); - op.add(Builder::timestamp, JsonpDeserializer.stringDeserializer(), "timestamp", "ts", "hms", "hhmmss"); + op.add(Builder::ip, JsonpDeserializer.stringDeserializer(), "ip"); + op.add(Builder::node, JsonpDeserializer.stringDeserializer(), "node"); + op.add(Builder::nodeId, JsonpDeserializer.stringDeserializer(), "node_id"); + op.add(Builder::parentTaskId, JsonpDeserializer.stringDeserializer(), "parent_task_id"); + op.add(Builder::port, JsonpDeserializer.stringDeserializer(), "port"); + op.add(Builder::runningTime, JsonpDeserializer.stringDeserializer(), "running_time"); op.add(Builder::runningTimeNs, JsonpDeserializer.stringDeserializer(), "running_time_ns"); - op.add(Builder::runningTime, JsonpDeserializer.stringDeserializer(), "running_time", "time"); - op.add(Builder::nodeId, JsonpDeserializer.stringDeserializer(), "node_id", "ni"); - op.add(Builder::ip, JsonpDeserializer.stringDeserializer(), "ip", "i"); - op.add(Builder::port, JsonpDeserializer.stringDeserializer(), "port", "po"); - op.add(Builder::node, JsonpDeserializer.stringDeserializer(), "node", "n"); - op.add(Builder::version, JsonpDeserializer.stringDeserializer(), "version", "v"); - op.add(Builder::xOpaqueId, JsonpDeserializer.stringDeserializer(), "x_opaque_id", "x"); - op.add(Builder::description, JsonpDeserializer.stringDeserializer(), "description", "desc"); + op.add(Builder::startTime, JsonpDeserializer.stringDeserializer(), "start_time"); + op.add(Builder::taskId, JsonpDeserializer.stringDeserializer(), "task_id"); + op.add(Builder::timestamp, JsonpDeserializer.stringDeserializer(), "timestamp"); + op.add(Builder::type, JsonpDeserializer.stringDeserializer(), "type"); + op.add(Builder::version, JsonpDeserializer.stringDeserializer(), "version"); + op.add(Builder::xOpaqueId, JsonpDeserializer.stringDeserializer(), "x_opaque_id"); + } + @Override + public int hashCode() { + int result = 17; + result = 31 * result + Objects.hashCode(this.action); + result = 31 * result + Objects.hashCode(this.description); + result = 31 * result + Objects.hashCode(this.id); + result = 31 * result + Objects.hashCode(this.ip); + result = 31 * result + Objects.hashCode(this.node); + result = 31 * result + Objects.hashCode(this.nodeId); + result = 31 * result + Objects.hashCode(this.parentTaskId); + result = 31 * result + Objects.hashCode(this.port); + result = 31 * result + Objects.hashCode(this.runningTime); + result = 31 * result + Objects.hashCode(this.runningTimeNs); + result = 31 * result + Objects.hashCode(this.startTime); + result = 31 * result + Objects.hashCode(this.taskId); + result = 31 * result + Objects.hashCode(this.timestamp); + result = 31 * result + Objects.hashCode(this.type); + result = 31 * result + Objects.hashCode(this.version); + result = 31 * result + Objects.hashCode(this.xOpaqueId); + return result; } + @Override + public boolean equals(Object o) { + if (this == o) return true; + if (o == null || this.getClass() != o.getClass()) return false; + TasksRecord other = (TasksRecord) o; + return Objects.equals(this.action, other.action) + && Objects.equals(this.description, other.description) + && Objects.equals(this.id, other.id) + && Objects.equals(this.ip, other.ip) + && Objects.equals(this.node, other.node) + && Objects.equals(this.nodeId, other.nodeId) + && Objects.equals(this.parentTaskId, other.parentTaskId) + && Objects.equals(this.port, other.port) + && Objects.equals(this.runningTime, other.runningTime) + && Objects.equals(this.runningTimeNs, other.runningTimeNs) + && Objects.equals(this.startTime, other.startTime) + && Objects.equals(this.taskId, other.taskId) + && Objects.equals(this.timestamp, other.timestamp) + && Objects.equals(this.type, other.type) + && Objects.equals(this.version, other.version) + && Objects.equals(this.xOpaqueId, other.xOpaqueId); + } } diff --git a/java-client/src/main/java/org/opensearch/client/opensearch/cat/OpenSearchCatAsyncClient.java b/java-client/src/main/java/org/opensearch/client/opensearch/cat/OpenSearchCatAsyncClient.java index 15fb114489..2360bc521a 100644 --- a/java-client/src/main/java/org/opensearch/client/opensearch/cat/OpenSearchCatAsyncClient.java +++ b/java-client/src/main/java/org/opensearch/client/opensearch/cat/OpenSearchCatAsyncClient.java @@ -72,139 +72,6 @@ public CompletableFuture help() throws IOException, OpenSearchExce return this.transport.performRequestAsync(HelpRequest._INSTANCE, HelpRequest._ENDPOINT, this.transportOptions); } - // ----- Endpoint: cat.shards - - /** - * Provides a detailed view of shard allocation on nodes. - * - * - */ - - public CompletableFuture shards(ShardsRequest request) throws IOException, OpenSearchException { - @SuppressWarnings("unchecked") - JsonEndpoint endpoint = (JsonEndpoint< - ShardsRequest, - ShardsResponse, - ErrorResponse>) ShardsRequest._ENDPOINT; - - return this.transport.performRequestAsync(request, endpoint, this.transportOptions); - } - - /** - * Provides a detailed view of shard allocation on nodes. - * - * @param fn - * a function that initializes a builder to create the - * {@link ShardsRequest} - * - */ - - public final CompletableFuture shards(Function> fn) - throws IOException, OpenSearchException { - return shards(fn.apply(new ShardsRequest.Builder()).build()); - } - - /** - * Provides a detailed view of shard allocation on nodes. - * - * - */ - - public CompletableFuture shards() throws IOException, OpenSearchException { - return this.transport.performRequestAsync(new ShardsRequest.Builder().build(), ShardsRequest._ENDPOINT, this.transportOptions); - } - - // ----- Endpoint: cat.snapshots - - /** - * Returns all snapshots in a specific repository. - * - * - */ - - public CompletableFuture snapshots(SnapshotsRequest request) throws IOException, OpenSearchException { - @SuppressWarnings("unchecked") - JsonEndpoint endpoint = (JsonEndpoint< - SnapshotsRequest, - SnapshotsResponse, - ErrorResponse>) SnapshotsRequest._ENDPOINT; - - return this.transport.performRequestAsync(request, endpoint, this.transportOptions); - } - - /** - * Returns all snapshots in a specific repository. - * - * @param fn - * a function that initializes a builder to create the - * {@link SnapshotsRequest} - * - */ - - public final CompletableFuture snapshots(Function> fn) - throws IOException, OpenSearchException { - return snapshots(fn.apply(new SnapshotsRequest.Builder()).build()); - } - - /** - * Returns all snapshots in a specific repository. - * - * - */ - - public CompletableFuture snapshots() throws IOException, OpenSearchException { - return this.transport.performRequestAsync( - new SnapshotsRequest.Builder().build(), - SnapshotsRequest._ENDPOINT, - this.transportOptions - ); - } - - // ----- Endpoint: cat.tasks - - /** - * Returns information about the tasks currently executing on one or more nodes - * in the cluster. - * - * - */ - - public CompletableFuture tasks(TasksRequest request) throws IOException, OpenSearchException { - @SuppressWarnings("unchecked") - JsonEndpoint endpoint = (JsonEndpoint< - TasksRequest, - TasksResponse, - ErrorResponse>) TasksRequest._ENDPOINT; - - return this.transport.performRequestAsync(request, endpoint, this.transportOptions); - } - - /** - * Returns information about the tasks currently executing on one or more nodes - * in the cluster. - * - * @param fn - * a function that initializes a builder to create the - * {@link TasksRequest} - * - */ - - public final CompletableFuture tasks(Function> fn) throws IOException, - OpenSearchException { - return tasks(fn.apply(new TasksRequest.Builder()).build()); - } - - /** - * Returns information about the tasks currently executing on one or more nodes - * in the cluster. - * - * - */ - - public CompletableFuture tasks() throws IOException, OpenSearchException { - return this.transport.performRequestAsync(new TasksRequest.Builder().build(), TasksRequest._ENDPOINT, this.transportOptions); - } - // ----- Endpoint: cat.templates /** diff --git a/java-client/src/main/java/org/opensearch/client/opensearch/cat/OpenSearchCatClient.java b/java-client/src/main/java/org/opensearch/client/opensearch/cat/OpenSearchCatClient.java index b12dc4dbc2..e612ff8429 100644 --- a/java-client/src/main/java/org/opensearch/client/opensearch/cat/OpenSearchCatClient.java +++ b/java-client/src/main/java/org/opensearch/client/opensearch/cat/OpenSearchCatClient.java @@ -71,135 +71,6 @@ public HelpResponse help() throws IOException, OpenSearchException { return this.transport.performRequest(HelpRequest._INSTANCE, HelpRequest._ENDPOINT, this.transportOptions); } - // ----- Endpoint: cat.shards - - /** - * Provides a detailed view of shard allocation on nodes. - * - * - */ - - public ShardsResponse shards(ShardsRequest request) throws IOException, OpenSearchException { - @SuppressWarnings("unchecked") - JsonEndpoint endpoint = (JsonEndpoint< - ShardsRequest, - ShardsResponse, - ErrorResponse>) ShardsRequest._ENDPOINT; - - return this.transport.performRequest(request, endpoint, this.transportOptions); - } - - /** - * Provides a detailed view of shard allocation on nodes. - * - * @param fn - * a function that initializes a builder to create the - * {@link ShardsRequest} - * - */ - - public final ShardsResponse shards(Function> fn) throws IOException, - OpenSearchException { - return shards(fn.apply(new ShardsRequest.Builder()).build()); - } - - /** - * Provides a detailed view of shard allocation on nodes. - * - * - */ - - public ShardsResponse shards() throws IOException, OpenSearchException { - return this.transport.performRequest(new ShardsRequest.Builder().build(), ShardsRequest._ENDPOINT, this.transportOptions); - } - - // ----- Endpoint: cat.snapshots - - /** - * Returns all snapshots in a specific repository. - * - * - */ - - public SnapshotsResponse snapshots(SnapshotsRequest request) throws IOException, OpenSearchException { - @SuppressWarnings("unchecked") - JsonEndpoint endpoint = (JsonEndpoint< - SnapshotsRequest, - SnapshotsResponse, - ErrorResponse>) SnapshotsRequest._ENDPOINT; - - return this.transport.performRequest(request, endpoint, this.transportOptions); - } - - /** - * Returns all snapshots in a specific repository. - * - * @param fn - * a function that initializes a builder to create the - * {@link SnapshotsRequest} - * - */ - - public final SnapshotsResponse snapshots(Function> fn) throws IOException, - OpenSearchException { - return snapshots(fn.apply(new SnapshotsRequest.Builder()).build()); - } - - /** - * Returns all snapshots in a specific repository. - * - * - */ - - public SnapshotsResponse snapshots() throws IOException, OpenSearchException { - return this.transport.performRequest(new SnapshotsRequest.Builder().build(), SnapshotsRequest._ENDPOINT, this.transportOptions); - } - - // ----- Endpoint: cat.tasks - - /** - * Returns information about the tasks currently executing on one or more nodes - * in the cluster. - * - * - */ - - public TasksResponse tasks(TasksRequest request) throws IOException, OpenSearchException { - @SuppressWarnings("unchecked") - JsonEndpoint endpoint = (JsonEndpoint< - TasksRequest, - TasksResponse, - ErrorResponse>) TasksRequest._ENDPOINT; - - return this.transport.performRequest(request, endpoint, this.transportOptions); - } - - /** - * Returns information about the tasks currently executing on one or more nodes - * in the cluster. - * - * @param fn - * a function that initializes a builder to create the - * {@link TasksRequest} - * - */ - - public final TasksResponse tasks(Function> fn) throws IOException, - OpenSearchException { - return tasks(fn.apply(new TasksRequest.Builder()).build()); - } - - /** - * Returns information about the tasks currently executing on one or more nodes - * in the cluster. - * - * - */ - - public TasksResponse tasks() throws IOException, OpenSearchException { - return this.transport.performRequest(new TasksRequest.Builder().build(), TasksRequest._ENDPOINT, this.transportOptions); - } - // ----- Endpoint: cat.templates /** diff --git a/java-client/src/main/java/org/opensearch/client/opensearch/cat/ShardsRequest.java b/java-client/src/main/java/org/opensearch/client/opensearch/cat/ShardsRequest.java deleted file mode 100644 index 43f0901f1a..0000000000 --- a/java-client/src/main/java/org/opensearch/client/opensearch/cat/ShardsRequest.java +++ /dev/null @@ -1,210 +0,0 @@ -/* - * SPDX-License-Identifier: Apache-2.0 - * - * The OpenSearch Contributors require contributions made to - * this file be licensed under the Apache-2.0 license or a - * compatible open source license. - */ - -/* - * Licensed to Elasticsearch B.V. under one or more contributor - * license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright - * ownership. Elasticsearch B.V. licenses this file to you under - * the Apache License, Version 2.0 (the "License"); you may - * not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -/* - * Modifications Copyright OpenSearch Contributors. See - * GitHub history for details. - */ - -package org.opensearch.client.opensearch.cat; - -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.function.Function; -import java.util.stream.Collectors; -import javax.annotation.Nullable; -import org.opensearch.client.opensearch._types.Bytes; -import org.opensearch.client.opensearch._types.ErrorResponse; -import org.opensearch.client.transport.Endpoint; -import org.opensearch.client.transport.endpoints.SimpleEndpoint; -import org.opensearch.client.util.ApiTypeHelper; -import org.opensearch.client.util.ObjectBuilder; - -// typedef: cat.shards.Request - -/** - * Provides a detailed view of shard allocation on nodes. - * - */ - -public class ShardsRequest extends CatRequestBase { - @Nullable - private final Bytes bytes; - - private final List index; - - // --------------------------------------------------------------------------------------------- - - private ShardsRequest(Builder builder) { - super(builder); - this.bytes = builder.bytes; - this.index = ApiTypeHelper.unmodifiable(builder.index); - - } - - public static ShardsRequest of(Function> fn) { - return fn.apply(new Builder()).build(); - } - - /** - * The unit in which to display byte values - *

- * API name: {@code bytes} - */ - @Nullable - public final Bytes bytes() { - return this.bytes; - } - - /** - * A comma-separated list of index names to limit the returned information - *

- * API name: {@code index} - */ - public final List index() { - return this.index; - } - - // --------------------------------------------------------------------------------------------- - - /** - * Builder for {@link ShardsRequest}. - */ - - public static class Builder extends CatRequestBaseBuilder { - @Nullable - private Bytes bytes; - - @Nullable - private List index; - - /** - * The unit in which to display byte values - *

- * API name: {@code bytes} - */ - public final Builder bytes(@Nullable Bytes value) { - this.bytes = value; - return this; - } - - /** - * A comma-separated list of index names to limit the returned information - *

- * API name: {@code index} - *

- * Adds all elements of list to index. - */ - public final Builder index(List list) { - this.index = _listAddAll(this.index, list); - return this; - } - - /** - * A comma-separated list of index names to limit the returned information - *

- * API name: {@code index} - *

- * Adds one or more values to index. - */ - public final Builder index(String value, String... values) { - this.index = _listAdd(this.index, value, values); - return this; - } - - /** - * Builds a {@link ShardsRequest}. - * - * @throws NullPointerException - * if some of the required fields are null. - */ - public ShardsRequest build() { - _checkSingleUse(); - - return new ShardsRequest(this); - } - - @Override - protected Builder self() { - return this; - } - } - - // --------------------------------------------------------------------------------------------- - - /** - * Endpoint "{@code cat.shards}". - */ - public static final Endpoint _ENDPOINT = new SimpleEndpoint<>( - - // Request method - request -> { - return "GET"; - - }, - - // Request path - request -> { - final int _index = 1 << 0; - - int propsSet = 0; - - if (ApiTypeHelper.isDefined(request.index())) propsSet |= _index; - - if (propsSet == 0) { - StringBuilder buf = new StringBuilder(); - buf.append("/_cat"); - buf.append("/shards"); - return buf.toString(); - } - if (propsSet == (_index)) { - StringBuilder buf = new StringBuilder(); - buf.append("/_cat"); - buf.append("/shards"); - buf.append("/"); - SimpleEndpoint.pathEncode(request.index.stream().map(v -> v).collect(Collectors.joining(",")), buf); - return buf.toString(); - } - throw SimpleEndpoint.noPathTemplateFound("path"); - - }, - - // Request parameters - request -> { - Map params = new HashMap<>(request.queryParameters()); - if (request.bytes != null) { - params.put("bytes", request.bytes.jsonValue()); - } - return params; - - }, - SimpleEndpoint.emptyMap(), - false, - ShardsResponse._DESERIALIZER - ); -} diff --git a/java-client/src/main/java/org/opensearch/client/opensearch/cat/SnapshotsRequest.java b/java-client/src/main/java/org/opensearch/client/opensearch/cat/SnapshotsRequest.java deleted file mode 100644 index 8d8d5b06b2..0000000000 --- a/java-client/src/main/java/org/opensearch/client/opensearch/cat/SnapshotsRequest.java +++ /dev/null @@ -1,209 +0,0 @@ -/* - * SPDX-License-Identifier: Apache-2.0 - * - * The OpenSearch Contributors require contributions made to - * this file be licensed under the Apache-2.0 license or a - * compatible open source license. - */ - -/* - * Licensed to Elasticsearch B.V. under one or more contributor - * license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright - * ownership. Elasticsearch B.V. licenses this file to you under - * the Apache License, Version 2.0 (the "License"); you may - * not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -/* - * Modifications Copyright OpenSearch Contributors. See - * GitHub history for details. - */ - -package org.opensearch.client.opensearch.cat; - -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.function.Function; -import java.util.stream.Collectors; -import javax.annotation.Nullable; -import org.opensearch.client.opensearch._types.ErrorResponse; -import org.opensearch.client.transport.Endpoint; -import org.opensearch.client.transport.endpoints.SimpleEndpoint; -import org.opensearch.client.util.ApiTypeHelper; -import org.opensearch.client.util.ObjectBuilder; - -// typedef: cat.snapshots.Request - -/** - * Returns all snapshots in a specific repository. - * - */ - -public class SnapshotsRequest extends CatRequestBase { - @Nullable - private final Boolean ignoreUnavailable; - - private final List repository; - - // --------------------------------------------------------------------------------------------- - - private SnapshotsRequest(Builder builder) { - super(builder); - this.ignoreUnavailable = builder.ignoreUnavailable; - this.repository = ApiTypeHelper.unmodifiable(builder.repository); - - } - - public static SnapshotsRequest of(Function> fn) { - return fn.apply(new Builder()).build(); - } - - /** - * Set to true to ignore unavailable snapshots - *

- * API name: {@code ignore_unavailable} - */ - @Nullable - public final Boolean ignoreUnavailable() { - return this.ignoreUnavailable; - } - - /** - * Name of repository from which to fetch the snapshot information - *

- * API name: {@code repository} - */ - public final List repository() { - return this.repository; - } - - // --------------------------------------------------------------------------------------------- - - /** - * Builder for {@link SnapshotsRequest}. - */ - - public static class Builder extends CatRequestBaseBuilder { - @Nullable - private Boolean ignoreUnavailable; - - @Nullable - private List repository; - - /** - * Set to true to ignore unavailable snapshots - *

- * API name: {@code ignore_unavailable} - */ - public final Builder ignoreUnavailable(@Nullable Boolean value) { - this.ignoreUnavailable = value; - return this; - } - - /** - * Name of repository from which to fetch the snapshot information - *

- * API name: {@code repository} - *

- * Adds all elements of list to repository. - */ - public final Builder repository(List list) { - this.repository = _listAddAll(this.repository, list); - return this; - } - - /** - * Name of repository from which to fetch the snapshot information - *

- * API name: {@code repository} - *

- * Adds one or more values to repository. - */ - public final Builder repository(String value, String... values) { - this.repository = _listAdd(this.repository, value, values); - return this; - } - - /** - * Builds a {@link SnapshotsRequest}. - * - * @throws NullPointerException - * if some of the required fields are null. - */ - public SnapshotsRequest build() { - _checkSingleUse(); - - return new SnapshotsRequest(this); - } - - @Override - protected Builder self() { - return this; - } - } - - // --------------------------------------------------------------------------------------------- - - /** - * Endpoint "{@code cat.snapshots}". - */ - public static final Endpoint _ENDPOINT = new SimpleEndpoint<>( - - // Request method - request -> { - return "GET"; - - }, - - // Request path - request -> { - final int _repository = 1 << 0; - - int propsSet = 0; - - if (ApiTypeHelper.isDefined(request.repository())) propsSet |= _repository; - - if (propsSet == 0) { - StringBuilder buf = new StringBuilder(); - buf.append("/_cat"); - buf.append("/snapshots"); - return buf.toString(); - } - if (propsSet == (_repository)) { - StringBuilder buf = new StringBuilder(); - buf.append("/_cat"); - buf.append("/snapshots"); - buf.append("/"); - SimpleEndpoint.pathEncode(request.repository.stream().map(v -> v).collect(Collectors.joining(",")), buf); - return buf.toString(); - } - throw SimpleEndpoint.noPathTemplateFound("path"); - - }, - - // Request parameters - request -> { - Map params = new HashMap<>(request.queryParameters()); - if (request.ignoreUnavailable != null) { - params.put("ignore_unavailable", String.valueOf(request.ignoreUnavailable)); - } - return params; - - }, - SimpleEndpoint.emptyMap(), - false, - SnapshotsResponse._DESERIALIZER - ); -} diff --git a/java-client/src/main/java/org/opensearch/client/opensearch/cat/TasksRequest.java b/java-client/src/main/java/org/opensearch/client/opensearch/cat/TasksRequest.java deleted file mode 100644 index bbd7ad8fc6..0000000000 --- a/java-client/src/main/java/org/opensearch/client/opensearch/cat/TasksRequest.java +++ /dev/null @@ -1,258 +0,0 @@ -/* - * SPDX-License-Identifier: Apache-2.0 - * - * The OpenSearch Contributors require contributions made to - * this file be licensed under the Apache-2.0 license or a - * compatible open source license. - */ - -/* - * Licensed to Elasticsearch B.V. under one or more contributor - * license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright - * ownership. Elasticsearch B.V. licenses this file to you under - * the Apache License, Version 2.0 (the "License"); you may - * not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -/* - * Modifications Copyright OpenSearch Contributors. See - * GitHub history for details. - */ - -package org.opensearch.client.opensearch.cat; - -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.function.Function; -import java.util.stream.Collectors; -import javax.annotation.Nullable; -import org.opensearch.client.opensearch._types.ErrorResponse; -import org.opensearch.client.transport.Endpoint; -import org.opensearch.client.transport.endpoints.SimpleEndpoint; -import org.opensearch.client.util.ApiTypeHelper; -import org.opensearch.client.util.ObjectBuilder; - -// typedef: cat.tasks.Request - -/** - * Returns information about the tasks currently executing on one or more nodes - * in the cluster. - * - */ - -public class TasksRequest extends CatRequestBase { - private final List actions; - - @Nullable - private final Boolean detailed; - - private final List nodeId; - - @Nullable - private final Long parentTask; - - // --------------------------------------------------------------------------------------------- - - private TasksRequest(Builder builder) { - super(builder); - this.actions = ApiTypeHelper.unmodifiable(builder.actions); - this.detailed = builder.detailed; - this.nodeId = ApiTypeHelper.unmodifiable(builder.nodeId); - this.parentTask = builder.parentTask; - - } - - public static TasksRequest of(Function> fn) { - return fn.apply(new Builder()).build(); - } - - /** - * A comma-separated list of actions that should be returned. Leave empty to - * return all. - *

- * API name: {@code actions} - */ - public final List actions() { - return this.actions; - } - - /** - * Return detailed task information (default: false) - *

- * API name: {@code detailed} - */ - @Nullable - public final Boolean detailed() { - return this.detailed; - } - - /** - * API name: {@code node_id} - */ - public final List nodeId() { - return this.nodeId; - } - - /** - * API name: {@code parent_task} - */ - @Nullable - public final Long parentTask() { - return this.parentTask; - } - - // --------------------------------------------------------------------------------------------- - - /** - * Builder for {@link TasksRequest}. - */ - - public static class Builder extends CatRequestBaseBuilder { - @Nullable - private List actions; - - @Nullable - private Boolean detailed; - - @Nullable - private List nodeId; - - @Nullable - private Long parentTask; - - /** - * A comma-separated list of actions that should be returned. Leave empty to - * return all. - *

- * API name: {@code actions} - *

- * Adds all elements of list to actions. - */ - public final Builder actions(List list) { - this.actions = _listAddAll(this.actions, list); - return this; - } - - /** - * A comma-separated list of actions that should be returned. Leave empty to - * return all. - *

- * API name: {@code actions} - *

- * Adds one or more values to actions. - */ - public final Builder actions(String value, String... values) { - this.actions = _listAdd(this.actions, value, values); - return this; - } - - /** - * Return detailed task information (default: false) - *

- * API name: {@code detailed} - */ - public final Builder detailed(@Nullable Boolean value) { - this.detailed = value; - return this; - } - - /** - * API name: {@code node_id} - *

- * Adds all elements of list to nodeId. - */ - public final Builder nodeId(List list) { - this.nodeId = _listAddAll(this.nodeId, list); - return this; - } - - /** - * API name: {@code node_id} - *

- * Adds one or more values to nodeId. - */ - public final Builder nodeId(String value, String... values) { - this.nodeId = _listAdd(this.nodeId, value, values); - return this; - } - - /** - * API name: {@code parent_task} - */ - public final Builder parentTask(@Nullable Long value) { - this.parentTask = value; - return this; - } - - /** - * Builds a {@link TasksRequest}. - * - * @throws NullPointerException - * if some of the required fields are null. - */ - public TasksRequest build() { - _checkSingleUse(); - - return new TasksRequest(this); - } - - @Override - protected Builder self() { - return this; - } - } - - // --------------------------------------------------------------------------------------------- - - /** - * Endpoint "{@code cat.tasks}". - */ - public static final Endpoint _ENDPOINT = new SimpleEndpoint<>( - - // Request method - request -> { - return "GET"; - - }, - - // Request path - request -> { - return "/_cat/tasks"; - - }, - - // Request parameters - request -> { - Map params = new HashMap<>(request.queryParameters()); - if (request.detailed != null) { - params.put("detailed", String.valueOf(request.detailed)); - } - if (request.parentTask != null) { - params.put("parent_task", String.valueOf(request.parentTask)); - } - if (ApiTypeHelper.isDefined(request.actions)) { - params.put("actions", request.actions.stream().map(v -> v).collect(Collectors.joining(","))); - } - if (ApiTypeHelper.isDefined(request.nodeId)) { - params.put("node_id", request.nodeId.stream().map(v -> v).collect(Collectors.joining(","))); - } - return params; - - }, - SimpleEndpoint.emptyMap(), - false, - TasksResponse._DESERIALIZER - ); -} diff --git a/java-codegen/opensearch-openapi.yaml b/java-codegen/opensearch-openapi.yaml index 1bc0735454..1fb4c3a7d5 100644 --- a/java-codegen/opensearch-openapi.yaml +++ b/java-codegen/opensearch-openapi.yaml @@ -48015,7 +48015,7 @@ components: start_epoch: $ref: '#/components/schemas/_common___StringifiedEpochTimeUnitSeconds' start_time: - $ref: '#/components/schemas/_common___ScheduleTimeOfDay' + $ref: '#/components/schemas/_common___TimeOfDay' end_epoch: $ref: '#/components/schemas/_common___StringifiedEpochTimeUnitSeconds' end_time: diff --git a/java-codegen/src/main/java/org/opensearch/client/codegen/CodeGenerator.java b/java-codegen/src/main/java/org/opensearch/client/codegen/CodeGenerator.java index 98e25c103e..0c80d43fd6 100644 --- a/java-codegen/src/main/java/org/opensearch/client/codegen/CodeGenerator.java +++ b/java-codegen/src/main/java/org/opensearch/client/codegen/CodeGenerator.java @@ -68,7 +68,10 @@ public class CodeGenerator { "plugins", "recovery", "repositories", - "segments" + "segments", + "shards", + "snapshots", + "tasks" ) ) ), From d2975405f24f6bafb54f9ee68f69aecc49812da7 Mon Sep 17 00:00:00 2001 From: Thomas Farr Date: Tue, 7 Jan 2025 22:44:42 +1300 Subject: [PATCH 13/18] Generate cat.templates & cat.thread_pool Signed-off-by: Thomas Farr --- .../cat/OpenSearchCatAsyncClientBase.java | 55 ++ .../cat/OpenSearchCatClientBase.java | 55 ++ .../opensearch/cat/TemplatesRequest.java | 313 ++++++++ .../opensearch/cat/TemplatesResponse.java | 74 +- .../opensearch/cat/ThreadPoolRequest.java | 372 +++++++++ .../opensearch/cat/ThreadPoolResponse.java | 74 +- .../cat/templates/TemplatesRecord.java | 211 +++-- .../cat/thread_pool/ThreadPoolRecord.java | 758 +++++++++++------- .../cat/OpenSearchCatAsyncClient.java | 96 --- .../opensearch/cat/OpenSearchCatClient.java | 88 -- .../opensearch/cat/TemplatesRequest.java | 159 ---- .../opensearch/cat/ThreadPoolRequest.java | 214 ----- .../cat/thread_pool/ThreadPoolSize.java | 63 -- .../client/codegen/CodeGenerator.java | 4 +- .../client/codegen/model/SpecTransformer.java | 1 + 15 files changed, 1521 insertions(+), 1016 deletions(-) create mode 100644 java-client/src/generated/java/org/opensearch/client/opensearch/cat/TemplatesRequest.java rename java-client/src/{main => generated}/java/org/opensearch/client/opensearch/cat/TemplatesResponse.java (75%) create mode 100644 java-client/src/generated/java/org/opensearch/client/opensearch/cat/ThreadPoolRequest.java rename java-client/src/{main => generated}/java/org/opensearch/client/opensearch/cat/ThreadPoolResponse.java (76%) rename java-client/src/{main => generated}/java/org/opensearch/client/opensearch/cat/templates/TemplatesRecord.java (67%) rename java-client/src/{main => generated}/java/org/opensearch/client/opensearch/cat/thread_pool/ThreadPoolRecord.java (62%) delete mode 100644 java-client/src/main/java/org/opensearch/client/opensearch/cat/TemplatesRequest.java delete mode 100644 java-client/src/main/java/org/opensearch/client/opensearch/cat/ThreadPoolRequest.java delete mode 100644 java-client/src/main/java/org/opensearch/client/opensearch/cat/thread_pool/ThreadPoolSize.java diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/cat/OpenSearchCatAsyncClientBase.java b/java-client/src/generated/java/org/opensearch/client/opensearch/cat/OpenSearchCatAsyncClientBase.java index 15130ac692..e79339b59c 100644 --- a/java-client/src/generated/java/org/opensearch/client/opensearch/cat/OpenSearchCatAsyncClientBase.java +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/cat/OpenSearchCatAsyncClientBase.java @@ -581,4 +581,59 @@ public final CompletableFuture tasks(Function tasks() throws IOException, OpenSearchException { return tasks(new TasksRequest.Builder().build()); } + + // ----- Endpoint: cat.templates + + /** + * Lists the names, patterns, order numbers, and version numbers of index templates. + */ + public CompletableFuture templates(TemplatesRequest request) throws IOException, OpenSearchException { + return this.transport.performRequestAsync(request, TemplatesRequest._ENDPOINT, this.transportOptions); + } + + /** + * Lists the names, patterns, order numbers, and version numbers of index templates. + * + * @param fn a function that initializes a builder to create the {@link TemplatesRequest} + */ + public final CompletableFuture templates(Function> fn) + throws IOException, OpenSearchException { + return templates(fn.apply(new TemplatesRequest.Builder()).build()); + } + + /** + * Lists the names, patterns, order numbers, and version numbers of index templates. + */ + public final CompletableFuture templates() throws IOException, OpenSearchException { + return templates(new TemplatesRequest.Builder().build()); + } + + // ----- Endpoint: cat.thread_pool + + /** + * Returns cluster-wide thread pool statistics per node. By default the active, queued, and rejected statistics are returned for all + * thread pools. + */ + public CompletableFuture threadPool(ThreadPoolRequest request) throws IOException, OpenSearchException { + return this.transport.performRequestAsync(request, ThreadPoolRequest._ENDPOINT, this.transportOptions); + } + + /** + * Returns cluster-wide thread pool statistics per node. By default the active, queued, and rejected statistics are returned for all + * thread pools. + * + * @param fn a function that initializes a builder to create the {@link ThreadPoolRequest} + */ + public final CompletableFuture threadPool(Function> fn) + throws IOException, OpenSearchException { + return threadPool(fn.apply(new ThreadPoolRequest.Builder()).build()); + } + + /** + * Returns cluster-wide thread pool statistics per node. By default the active, queued, and rejected statistics are returned for all + * thread pools. + */ + public final CompletableFuture threadPool() throws IOException, OpenSearchException { + return threadPool(new ThreadPoolRequest.Builder().build()); + } } diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/cat/OpenSearchCatClientBase.java b/java-client/src/generated/java/org/opensearch/client/opensearch/cat/OpenSearchCatClientBase.java index 4038bae1a2..72ae6091e3 100644 --- a/java-client/src/generated/java/org/opensearch/client/opensearch/cat/OpenSearchCatClientBase.java +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/cat/OpenSearchCatClientBase.java @@ -573,4 +573,59 @@ public final TasksResponse tasks(Function> fn) throws IOException, + OpenSearchException { + return templates(fn.apply(new TemplatesRequest.Builder()).build()); + } + + /** + * Lists the names, patterns, order numbers, and version numbers of index templates. + */ + public final TemplatesResponse templates() throws IOException, OpenSearchException { + return templates(new TemplatesRequest.Builder().build()); + } + + // ----- Endpoint: cat.thread_pool + + /** + * Returns cluster-wide thread pool statistics per node. By default the active, queued, and rejected statistics are returned for all + * thread pools. + */ + public ThreadPoolResponse threadPool(ThreadPoolRequest request) throws IOException, OpenSearchException { + return this.transport.performRequest(request, ThreadPoolRequest._ENDPOINT, this.transportOptions); + } + + /** + * Returns cluster-wide thread pool statistics per node. By default the active, queued, and rejected statistics are returned for all + * thread pools. + * + * @param fn a function that initializes a builder to create the {@link ThreadPoolRequest} + */ + public final ThreadPoolResponse threadPool(Function> fn) throws IOException, + OpenSearchException { + return threadPool(fn.apply(new ThreadPoolRequest.Builder()).build()); + } + + /** + * Returns cluster-wide thread pool statistics per node. By default the active, queued, and rejected statistics are returned for all + * thread pools. + */ + public final ThreadPoolResponse threadPool() throws IOException, OpenSearchException { + return threadPool(new ThreadPoolRequest.Builder().build()); + } } diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/cat/TemplatesRequest.java b/java-client/src/generated/java/org/opensearch/client/opensearch/cat/TemplatesRequest.java new file mode 100644 index 0000000000..3272774765 --- /dev/null +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/cat/TemplatesRequest.java @@ -0,0 +1,313 @@ +/* + * SPDX-License-Identifier: Apache-2.0 + * + * The OpenSearch Contributors require contributions made to + * this file be licensed under the Apache-2.0 license or a + * compatible open source license. + */ + +/* + * Licensed to Elasticsearch B.V. under one or more contributor + * license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright + * ownership. Elasticsearch B.V. licenses this file to you under + * the Apache License, Version 2.0 (the "License"); you may + * not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +/* + * Modifications Copyright OpenSearch Contributors. See + * GitHub history for details. + */ + +//---------------------------------------------------- +// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. +//---------------------------------------------------- + +package org.opensearch.client.opensearch.cat; + +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.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.ToCopyableBuilder; + +// typedef: cat.templates.Request + +/** + * Lists the names, patterns, order numbers, and version numbers of index templates. + */ +@Generated("org.opensearch.client.codegen.CodeGenerator") +public final class TemplatesRequest extends CatRequestBase implements ToCopyableBuilder { + + @Nullable + private final Time clusterManagerTimeout; + + @Deprecated + @Nullable + private final Time masterTimeout; + + @Nullable + private final String name; + + // --------------------------------------------------------------------------------------------- + + private TemplatesRequest(Builder builder) { + super(builder); + this.clusterManagerTimeout = builder.clusterManagerTimeout; + this.masterTimeout = builder.masterTimeout; + this.name = builder.name; + } + + public static TemplatesRequest of(Function> fn) { + return fn.apply(new Builder()).build(); + } + + /** + * The amount of time allowed to establish a connection to the cluster manager node. + *

+ * API name: {@code cluster_manager_timeout} + *

+ */ + @Nullable + public final Time clusterManagerTimeout() { + return this.clusterManagerTimeout; + } + + /** + * The amount of time allowed to establish a connection to the cluster manager node. + *

+ * API name: {@code master_timeout} + *

+ */ + @Deprecated + @Nullable + public final Time masterTimeout() { + return this.masterTimeout; + } + + /** + * The name of the template to return. Accepts wildcard expressions. If omitted, all templates are returned. + *

+ * API name: {@code name} + *

+ */ + @Nullable + 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 TemplatesRequest}. + */ + public static class Builder extends CatRequestBase.AbstractBuilder implements CopyableBuilder { + @Nullable + private Time clusterManagerTimeout; + @Nullable + private Time masterTimeout; + @Nullable + private String name; + + public Builder() {} + + private Builder(TemplatesRequest o) { + super(o); + this.clusterManagerTimeout = o.clusterManagerTimeout; + this.masterTimeout = o.masterTimeout; + this.name = o.name; + } + + private Builder(Builder o) { + super(o); + this.clusterManagerTimeout = o.clusterManagerTimeout; + this.masterTimeout = o.masterTimeout; + this.name = o.name; + } + + @Override + @Nonnull + public Builder copy() { + return new Builder(this); + } + + @Override + @Nonnull + protected Builder self() { + return this; + } + + /** + * The amount of time allowed to establish a connection to the cluster manager node. + *

+ * API name: {@code cluster_manager_timeout} + *

+ */ + @Nonnull + public final Builder clusterManagerTimeout(@Nullable Time value) { + this.clusterManagerTimeout = value; + return this; + } + + /** + * The amount of time allowed to establish a connection to the cluster manager node. + *

+ * API name: {@code cluster_manager_timeout} + *

+ */ + @Nonnull + public final Builder clusterManagerTimeout(Function> fn) { + return clusterManagerTimeout(fn.apply(new Time.Builder()).build()); + } + + /** + * The amount of time allowed to establish a connection to the cluster manager node. + *

+ * API name: {@code master_timeout} + *

+ */ + @Deprecated + @Nonnull + public final Builder masterTimeout(@Nullable Time value) { + this.masterTimeout = value; + return this; + } + + /** + * The amount of time allowed to establish a connection to the cluster manager node. + *

+ * API name: {@code master_timeout} + *

+ */ + @Deprecated + @Nonnull + public final Builder masterTimeout(Function> fn) { + return masterTimeout(fn.apply(new Time.Builder()).build()); + } + + /** + * The name of the template to return. Accepts wildcard expressions. If omitted, all templates are returned. + *

+ * API name: {@code name} + *

+ */ + @Nonnull + public final Builder name(@Nullable String value) { + this.name = value; + return this; + } + + /** + * Builds a {@link TemplatesRequest}. + * + * @throws NullPointerException if some of the required fields are null. + */ + @Override + @Nonnull + public TemplatesRequest build() { + _checkSingleUse(); + + return new TemplatesRequest(this); + } + } + + // --------------------------------------------------------------------------------------------- + + @Override + protected void applyQueryParameters(@Nonnull Map params) { + super.applyQueryParameters(params); + if (this.clusterManagerTimeout != null) { + params.put("cluster_manager_timeout", this.clusterManagerTimeout._toJsonString()); + } + if (this.masterTimeout != null) { + params.put("master_timeout", this.masterTimeout._toJsonString()); + } + } + + /** + * Endpoint "{@code cat.templates}". + */ + public static final Endpoint _ENDPOINT = new SimpleEndpoint<>( + // Request method + request -> "GET", + // Request path + request -> { + final int _name = 1 << 0; + + int propsSet = 0; + + if (request.name() != null) propsSet |= _name; + + if (propsSet == 0) { + return "/_cat/templates"; + } + if (propsSet == (_name)) { + StringBuilder buf = new StringBuilder(); + buf.append("/_cat/templates/"); + SimpleEndpoint.pathEncode(request.name, buf); + return buf.toString(); + } + + throw SimpleEndpoint.noPathTemplateFound("path"); + }, + // Request parameters + request -> { + Map params = new HashMap<>(); + request.applyQueryParameters(params); + return params; + }, + SimpleEndpoint.emptyMap(), + false, + TemplatesResponse._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 + 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; + TemplatesRequest other = (TemplatesRequest) o; + return Objects.equals(this.clusterManagerTimeout, other.clusterManagerTimeout) + && Objects.equals(this.masterTimeout, other.masterTimeout) + && Objects.equals(this.name, other.name); + } +} diff --git a/java-client/src/main/java/org/opensearch/client/opensearch/cat/TemplatesResponse.java b/java-client/src/generated/java/org/opensearch/client/opensearch/cat/TemplatesResponse.java similarity index 75% rename from java-client/src/main/java/org/opensearch/client/opensearch/cat/TemplatesResponse.java rename to java-client/src/generated/java/org/opensearch/client/opensearch/cat/TemplatesResponse.java index f9be18da9e..4b63b33da7 100644 --- a/java-client/src/main/java/org/opensearch/client/opensearch/cat/TemplatesResponse.java +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/cat/TemplatesResponse.java @@ -30,43 +30,51 @@ * GitHub history for details. */ +//---------------------------------------------------- +// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. +//---------------------------------------------------- + package org.opensearch.client.opensearch.cat; 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; import org.opensearch.client.json.PlainJsonSerializable; import org.opensearch.client.opensearch.cat.templates.TemplatesRecord; 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: cat.templates.Response @JsonpDeserializable -public class TemplatesResponse implements PlainJsonSerializable { +@Generated("org.opensearch.client.codegen.CodeGenerator") +public class TemplatesResponse implements PlainJsonSerializable, ToCopyableBuilder { + + @Nonnull private final List valueBody; // --------------------------------------------------------------------------------------------- private TemplatesResponse(Builder builder) { - this.valueBody = ApiTypeHelper.unmodifiableRequired(builder.valueBody, this, "valueBody"); - } - public static TemplatesResponse of(Function> fn) { + public static TemplatesResponse of(Function> fn) { return fn.apply(new Builder()).build(); } /** * Required - Response value. - *

- * API name: {@code _value_body} */ + @Nonnull public final List valueBody() { return this.valueBody; } @@ -78,28 +86,53 @@ public void serialize(JsonGenerator generator, JsonpMapper mapper) { generator.writeStartArray(); for (TemplatesRecord item0 : this.valueBody) { 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 TemplatesResponse}. */ - - public static class Builder extends ObjectBuilderBase implements ObjectBuilder { + public static class Builder extends ObjectBuilderBase implements CopyableBuilder { private List valueBody; + public Builder() {} + + private Builder(TemplatesResponse o) { + this.valueBody = _listCopy(o.valueBody); + } + + private Builder(Builder o) { + this.valueBody = _listCopy(o.valueBody); + } + + @Override + @Nonnull + public Builder copy() { + return new Builder(this); + } + /** * Required - Response value. - *

- * API name: {@code _value_body} + * *

* Adds all elements of list to valueBody. + *

*/ + @Nonnull public final Builder valueBody(List list) { this.valueBody = _listAddAll(this.valueBody, list); return this; @@ -107,11 +140,12 @@ public final Builder valueBody(List list) { /** * Required - Response value. - *

- * API name: {@code _value_body} + * *

* Adds one or more values to valueBody. + *

*/ + @Nonnull public final Builder valueBody(TemplatesRecord value, TemplatesRecord... values) { this.valueBody = _listAdd(this.valueBody, value, values); return this; @@ -119,11 +153,12 @@ public final Builder valueBody(TemplatesRecord value, TemplatesRecord... values) /** * Required - Response value. - *

- * API name: {@code _value_body} + * *

* Adds a value to valueBody using a builder lambda. + *

*/ + @Nonnull public final Builder valueBody(Function> fn) { return valueBody(fn.apply(new TemplatesRecord.Builder()).build()); } @@ -131,9 +166,10 @@ public final Builder valueBody(Function _DESERIALIZER = createTemplatesResponseDeserializer(); protected static JsonpDeserializer createTemplatesResponseDeserializer() { - JsonpDeserializer> valueDeserializer = JsonpDeserializer.arrayDeserializer(TemplatesRecord._DESERIALIZER); return JsonpDeserializer.of( @@ -152,5 +187,4 @@ protected static JsonpDeserializer createTemplatesResponseDes (parser, mapper) -> new Builder().valueBody(valueDeserializer.deserialize(parser, mapper)).build() ); } - } diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/cat/ThreadPoolRequest.java b/java-client/src/generated/java/org/opensearch/client/opensearch/cat/ThreadPoolRequest.java new file mode 100644 index 0000000000..5699764ed5 --- /dev/null +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/cat/ThreadPoolRequest.java @@ -0,0 +1,372 @@ +/* + * SPDX-License-Identifier: Apache-2.0 + * + * The OpenSearch Contributors require contributions made to + * this file be licensed under the Apache-2.0 license or a + * compatible open source license. + */ + +/* + * Licensed to Elasticsearch B.V. under one or more contributor + * license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright + * ownership. Elasticsearch B.V. licenses this file to you under + * the Apache License, Version 2.0 (the "License"); you may + * not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +/* + * Modifications Copyright OpenSearch Contributors. See + * GitHub history for details. + */ + +//---------------------------------------------------- +// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. +//---------------------------------------------------- + +package org.opensearch.client.opensearch.cat; + +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.function.Function; +import javax.annotation.Generated; +import javax.annotation.Nonnull; +import javax.annotation.Nullable; +import org.opensearch.client.opensearch._types.ErrorResponse; +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.ApiTypeHelper; +import org.opensearch.client.util.CopyableBuilder; +import org.opensearch.client.util.ObjectBuilder; +import org.opensearch.client.util.ToCopyableBuilder; + +// typedef: cat.thread_pool.Request + +/** + * Returns cluster-wide thread pool statistics per node. By default the active, queued, and rejected statistics are returned for all thread + * pools. + */ +@Generated("org.opensearch.client.codegen.CodeGenerator") +public final class ThreadPoolRequest extends CatRequestBase implements ToCopyableBuilder { + + @Nullable + private final Time clusterManagerTimeout; + + @Deprecated + @Nullable + private final Time masterTimeout; + + @Nullable + private final Integer size; + + @Nonnull + private final List threadPoolPatterns; + + // --------------------------------------------------------------------------------------------- + + private ThreadPoolRequest(Builder builder) { + super(builder); + this.clusterManagerTimeout = builder.clusterManagerTimeout; + this.masterTimeout = builder.masterTimeout; + this.size = builder.size; + this.threadPoolPatterns = ApiTypeHelper.unmodifiable(builder.threadPoolPatterns); + } + + public static ThreadPoolRequest of(Function> fn) { + return fn.apply(new Builder()).build(); + } + + /** + * A timeout for connection to the cluster manager node. + *

+ * API name: {@code cluster_manager_timeout} + *

+ */ + @Nullable + public final Time clusterManagerTimeout() { + return this.clusterManagerTimeout; + } + + /** + * The amount of time allowed to establish a connection to the cluster manager node. + *

+ * API name: {@code master_timeout} + *

+ */ + @Deprecated + @Nullable + public final Time masterTimeout() { + return this.masterTimeout; + } + + /** + * The multiplier in which to display values. + *

+ * API name: {@code size} + *

+ */ + @Nullable + public final Integer size() { + return this.size; + } + + /** + * A comma-separated list of thread pool names used to limit the request. Accepts wildcard expressions. + *

+ * API name: {@code thread_pool_patterns} + *

+ */ + @Nonnull + public final List threadPoolPatterns() { + return this.threadPoolPatterns; + } + + // --------------------------------------------------------------------------------------------- + + @Override + @Nonnull + public Builder toBuilder() { + return new Builder(this); + } + + @Nonnull + public static Builder builder() { + return new Builder(); + } + + /** + * Builder for {@link ThreadPoolRequest}. + */ + public static class Builder extends CatRequestBase.AbstractBuilder implements CopyableBuilder { + @Nullable + private Time clusterManagerTimeout; + @Nullable + private Time masterTimeout; + @Nullable + private Integer size; + @Nullable + private List threadPoolPatterns; + + public Builder() {} + + private Builder(ThreadPoolRequest o) { + super(o); + this.clusterManagerTimeout = o.clusterManagerTimeout; + this.masterTimeout = o.masterTimeout; + this.size = o.size; + this.threadPoolPatterns = _listCopy(o.threadPoolPatterns); + } + + private Builder(Builder o) { + super(o); + this.clusterManagerTimeout = o.clusterManagerTimeout; + this.masterTimeout = o.masterTimeout; + this.size = o.size; + this.threadPoolPatterns = _listCopy(o.threadPoolPatterns); + } + + @Override + @Nonnull + public Builder copy() { + return new Builder(this); + } + + @Override + @Nonnull + protected Builder self() { + return this; + } + + /** + * A timeout for connection to the cluster manager node. + *

+ * API name: {@code cluster_manager_timeout} + *

+ */ + @Nonnull + public final Builder clusterManagerTimeout(@Nullable Time value) { + this.clusterManagerTimeout = value; + return this; + } + + /** + * A timeout for connection to the cluster manager node. + *

+ * API name: {@code cluster_manager_timeout} + *

+ */ + @Nonnull + public final Builder clusterManagerTimeout(Function> fn) { + return clusterManagerTimeout(fn.apply(new Time.Builder()).build()); + } + + /** + * The amount of time allowed to establish a connection to the cluster manager node. + *

+ * API name: {@code master_timeout} + *

+ */ + @Deprecated + @Nonnull + public final Builder masterTimeout(@Nullable Time value) { + this.masterTimeout = value; + return this; + } + + /** + * The amount of time allowed to establish a connection to the cluster manager node. + *

+ * API name: {@code master_timeout} + *

+ */ + @Deprecated + @Nonnull + public final Builder masterTimeout(Function> fn) { + return masterTimeout(fn.apply(new Time.Builder()).build()); + } + + /** + * The multiplier in which to display values. + *

+ * API name: {@code size} + *

+ */ + @Nonnull + public final Builder size(@Nullable Integer value) { + this.size = value; + return this; + } + + /** + * A comma-separated list of thread pool names used to limit the request. Accepts wildcard expressions. + *

+ * API name: {@code thread_pool_patterns} + *

+ * + *

+ * Adds all elements of list to threadPoolPatterns. + *

+ */ + @Nonnull + public final Builder threadPoolPatterns(List list) { + this.threadPoolPatterns = _listAddAll(this.threadPoolPatterns, list); + return this; + } + + /** + * A comma-separated list of thread pool names used to limit the request. Accepts wildcard expressions. + *

+ * API name: {@code thread_pool_patterns} + *

+ * + *

+ * Adds one or more values to threadPoolPatterns. + *

+ */ + @Nonnull + public final Builder threadPoolPatterns(String value, String... values) { + this.threadPoolPatterns = _listAdd(this.threadPoolPatterns, value, values); + return this; + } + + /** + * Builds a {@link ThreadPoolRequest}. + * + * @throws NullPointerException if some of the required fields are null. + */ + @Override + @Nonnull + public ThreadPoolRequest build() { + _checkSingleUse(); + + return new ThreadPoolRequest(this); + } + } + + // --------------------------------------------------------------------------------------------- + + @Override + protected void applyQueryParameters(@Nonnull Map params) { + super.applyQueryParameters(params); + if (this.clusterManagerTimeout != null) { + params.put("cluster_manager_timeout", this.clusterManagerTimeout._toJsonString()); + } + if (this.masterTimeout != null) { + params.put("master_timeout", this.masterTimeout._toJsonString()); + } + if (this.size != null) { + params.put("size", String.valueOf(this.size)); + } + } + + /** + * Endpoint "{@code cat.thread_pool}". + */ + public static final Endpoint _ENDPOINT = new SimpleEndpoint<>( + // Request method + request -> "GET", + // Request path + request -> { + final int _threadPoolPatterns = 1 << 0; + + int propsSet = 0; + + if (ApiTypeHelper.isDefined(request.threadPoolPatterns())) propsSet |= _threadPoolPatterns; + + if (propsSet == 0) { + return "/_cat/thread_pool"; + } + if (propsSet == (_threadPoolPatterns)) { + StringBuilder buf = new StringBuilder(); + buf.append("/_cat/thread_pool/"); + SimpleEndpoint.pathEncode(String.join(",", request.threadPoolPatterns), buf); + return buf.toString(); + } + + throw SimpleEndpoint.noPathTemplateFound("path"); + }, + // Request parameters + request -> { + Map params = new HashMap<>(); + request.applyQueryParameters(params); + return params; + }, + SimpleEndpoint.emptyMap(), + false, + ThreadPoolResponse._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 + Objects.hashCode(this.size); + result = 31 * result + Objects.hashCode(this.threadPoolPatterns); + return result; + } + + @Override + public boolean equals(Object o) { + if (this == o) return true; + if (o == null || this.getClass() != o.getClass()) return false; + ThreadPoolRequest other = (ThreadPoolRequest) o; + return Objects.equals(this.clusterManagerTimeout, other.clusterManagerTimeout) + && Objects.equals(this.masterTimeout, other.masterTimeout) + && Objects.equals(this.size, other.size) + && Objects.equals(this.threadPoolPatterns, other.threadPoolPatterns); + } +} diff --git a/java-client/src/main/java/org/opensearch/client/opensearch/cat/ThreadPoolResponse.java b/java-client/src/generated/java/org/opensearch/client/opensearch/cat/ThreadPoolResponse.java similarity index 76% rename from java-client/src/main/java/org/opensearch/client/opensearch/cat/ThreadPoolResponse.java rename to java-client/src/generated/java/org/opensearch/client/opensearch/cat/ThreadPoolResponse.java index 5369159405..9132d96799 100644 --- a/java-client/src/main/java/org/opensearch/client/opensearch/cat/ThreadPoolResponse.java +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/cat/ThreadPoolResponse.java @@ -30,43 +30,51 @@ * GitHub history for details. */ +//---------------------------------------------------- +// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. +//---------------------------------------------------- + package org.opensearch.client.opensearch.cat; 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; import org.opensearch.client.json.PlainJsonSerializable; import org.opensearch.client.opensearch.cat.thread_pool.ThreadPoolRecord; 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: cat.thread_pool.Response @JsonpDeserializable -public class ThreadPoolResponse implements PlainJsonSerializable { +@Generated("org.opensearch.client.codegen.CodeGenerator") +public class ThreadPoolResponse implements PlainJsonSerializable, ToCopyableBuilder { + + @Nonnull private final List valueBody; // --------------------------------------------------------------------------------------------- private ThreadPoolResponse(Builder builder) { - this.valueBody = ApiTypeHelper.unmodifiableRequired(builder.valueBody, this, "valueBody"); - } - public static ThreadPoolResponse of(Function> fn) { + public static ThreadPoolResponse of(Function> fn) { return fn.apply(new Builder()).build(); } /** * Required - Response value. - *

- * API name: {@code _value_body} */ + @Nonnull public final List valueBody() { return this.valueBody; } @@ -78,28 +86,53 @@ public void serialize(JsonGenerator generator, JsonpMapper mapper) { generator.writeStartArray(); for (ThreadPoolRecord item0 : this.valueBody) { 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 ThreadPoolResponse}. */ - - public static class Builder extends ObjectBuilderBase implements ObjectBuilder { + public static class Builder extends ObjectBuilderBase implements CopyableBuilder { private List valueBody; + public Builder() {} + + private Builder(ThreadPoolResponse o) { + this.valueBody = _listCopy(o.valueBody); + } + + private Builder(Builder o) { + this.valueBody = _listCopy(o.valueBody); + } + + @Override + @Nonnull + public Builder copy() { + return new Builder(this); + } + /** * Required - Response value. - *

- * API name: {@code _value_body} + * *

* Adds all elements of list to valueBody. + *

*/ + @Nonnull public final Builder valueBody(List list) { this.valueBody = _listAddAll(this.valueBody, list); return this; @@ -107,11 +140,12 @@ public final Builder valueBody(List list) { /** * Required - Response value. - *

- * API name: {@code _value_body} + * *

* Adds one or more values to valueBody. + *

*/ + @Nonnull public final Builder valueBody(ThreadPoolRecord value, ThreadPoolRecord... values) { this.valueBody = _listAdd(this.valueBody, value, values); return this; @@ -119,11 +153,12 @@ public final Builder valueBody(ThreadPoolRecord value, ThreadPoolRecord... value /** * Required - Response value. - *

- * API name: {@code _value_body} + * *

* Adds a value to valueBody using a builder lambda. + *

*/ + @Nonnull public final Builder valueBody(Function> fn) { return valueBody(fn.apply(new ThreadPoolRecord.Builder()).build()); } @@ -131,9 +166,10 @@ public final Builder valueBody(Function _DESERIALIZER = createThreadPoolResponseDeserializer(); protected static JsonpDeserializer createThreadPoolResponseDeserializer() { - JsonpDeserializer> valueDeserializer = JsonpDeserializer.arrayDeserializer(ThreadPoolRecord._DESERIALIZER); return JsonpDeserializer.of( @@ -152,5 +187,4 @@ protected static JsonpDeserializer createThreadPoolResponseD (parser, mapper) -> new Builder().valueBody(valueDeserializer.deserialize(parser, mapper)).build() ); } - } diff --git a/java-client/src/main/java/org/opensearch/client/opensearch/cat/templates/TemplatesRecord.java b/java-client/src/generated/java/org/opensearch/client/opensearch/cat/templates/TemplatesRecord.java similarity index 67% rename from java-client/src/main/java/org/opensearch/client/opensearch/cat/templates/TemplatesRecord.java rename to java-client/src/generated/java/org/opensearch/client/opensearch/cat/templates/TemplatesRecord.java index ce23a76798..b6dc961293 100644 --- a/java-client/src/main/java/org/opensearch/client/opensearch/cat/templates/TemplatesRecord.java +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/cat/templates/TemplatesRecord.java @@ -30,10 +30,17 @@ * GitHub history for details. */ +//---------------------------------------------------- +// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. +//---------------------------------------------------- + package org.opensearch.client.opensearch.cat.templates; import jakarta.json.stream.JsonGenerator; +import java.util.Objects; import java.util.function.Function; +import javax.annotation.Generated; +import javax.annotation.Nonnull; import javax.annotation.Nullable; import org.opensearch.client.json.JsonpDeserializable; import org.opensearch.client.json.JsonpDeserializer; @@ -41,58 +48,62 @@ import org.opensearch.client.json.ObjectBuilderDeserializer; import org.opensearch.client.json.ObjectDeserializer; import org.opensearch.client.json.PlainJsonSerializable; +import org.opensearch.client.util.CopyableBuilder; import org.opensearch.client.util.ObjectBuilder; import org.opensearch.client.util.ObjectBuilderBase; +import org.opensearch.client.util.ToCopyableBuilder; // typedef: cat.templates.TemplatesRecord @JsonpDeserializable -public class TemplatesRecord implements PlainJsonSerializable { +@Generated("org.opensearch.client.codegen.CodeGenerator") +public class TemplatesRecord implements PlainJsonSerializable, ToCopyableBuilder { + @Nullable - private final String name; + private final String composedOf; @Nullable private final String indexPatterns; @Nullable - private final String order; + private final String name; @Nullable - private final String version; + private final String order; @Nullable - private final String composedOf; + private final String version; // --------------------------------------------------------------------------------------------- private TemplatesRecord(Builder builder) { - - this.name = builder.name; + this.composedOf = builder.composedOf; this.indexPatterns = builder.indexPatterns; + this.name = builder.name; this.order = builder.order; this.version = builder.version; - this.composedOf = builder.composedOf; - } - public static TemplatesRecord of(Function> fn) { + public static TemplatesRecord of(Function> fn) { return fn.apply(new Builder()).build(); } /** - * template name + * The component templates that comprise the index template. *

- * API name: {@code name} + * API name: {@code composed_of} + *

*/ @Nullable - public final String name() { - return this.name; + public final String composedOf() { + return this.composedOf; } /** - * template index patterns + * The template index patterns. *

* API name: {@code index_patterns} + *

*/ @Nullable public final String indexPatterns() { @@ -100,9 +111,18 @@ public final String indexPatterns() { } /** - * template application order/priority number + * API name: {@code name} + */ + @Nullable + public final String name() { + return this.name; + } + + /** + * The template application order or priority number. *

* API name: {@code order} + *

*/ @Nullable public final String order() { @@ -110,28 +130,20 @@ public final String order() { } /** - * version + * The template version. *

* API name: {@code version} + *

*/ @Nullable public final String version() { return this.version; } - /** - * component templates comprising index template - *

- * API name: {@code composed_of} - */ - @Nullable - public final String composedOf() { - return this.composedOf; - } - /** * Serialize this object to JSON. */ + @Override public void serialize(JsonGenerator generator, JsonpMapper mapper) { generator.writeStartObject(); serializeInternal(generator, mapper); @@ -139,113 +151,148 @@ public void serialize(JsonGenerator generator, JsonpMapper mapper) { } protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { - - if (this.name != null) { - generator.writeKey("name"); - generator.write(this.name); - + if (this.composedOf != null) { + generator.writeKey("composed_of"); + generator.write(this.composedOf); } + if (this.indexPatterns != null) { generator.writeKey("index_patterns"); generator.write(this.indexPatterns); + } + if (this.name != null) { + generator.writeKey("name"); + generator.write(this.name); } + if (this.order != null) { generator.writeKey("order"); generator.write(this.order); - } + if (this.version != null) { generator.writeKey("version"); generator.write(this.version); - } - if (this.composedOf != null) { - generator.writeKey("composed_of"); - generator.write(this.composedOf); + } - } + // --------------------------------------------------------------------------------------------- + @Override + @Nonnull + public Builder toBuilder() { + return new Builder(this); } - // --------------------------------------------------------------------------------------------- + @Nonnull + public static Builder builder() { + return new Builder(); + } /** * Builder for {@link TemplatesRecord}. */ - - public static class Builder extends ObjectBuilderBase implements ObjectBuilder { + public static class Builder extends ObjectBuilderBase implements CopyableBuilder { @Nullable - private String name; - + private String composedOf; @Nullable private String indexPatterns; - + @Nullable + private String name; @Nullable private String order; - @Nullable private String version; - @Nullable - private String composedOf; + public Builder() {} + + private Builder(TemplatesRecord o) { + this.composedOf = o.composedOf; + this.indexPatterns = o.indexPatterns; + this.name = o.name; + this.order = o.order; + this.version = o.version; + } + + private Builder(Builder o) { + this.composedOf = o.composedOf; + this.indexPatterns = o.indexPatterns; + this.name = o.name; + this.order = o.order; + this.version = o.version; + } + + @Override + @Nonnull + public Builder copy() { + return new Builder(this); + } /** - * template name + * The component templates that comprise the index template. *

- * API name: {@code name} + * API name: {@code composed_of} + *

*/ - public final Builder name(@Nullable String value) { - this.name = value; + @Nonnull + public final Builder composedOf(@Nullable String value) { + this.composedOf = value; return this; } /** - * template index patterns + * The template index patterns. *

* API name: {@code index_patterns} + *

*/ + @Nonnull public final Builder indexPatterns(@Nullable String value) { this.indexPatterns = value; return this; } /** - * template application order/priority number + * API name: {@code name} + */ + @Nonnull + public final Builder name(@Nullable String value) { + this.name = value; + return this; + } + + /** + * The template application order or priority number. *

* API name: {@code order} + *

*/ + @Nonnull public final Builder order(@Nullable String value) { this.order = value; return this; } /** - * version + * The template version. *

* API name: {@code version} + *

*/ + @Nonnull public final Builder version(@Nullable String value) { this.version = value; return this; } - /** - * component templates comprising index template - *

- * API name: {@code composed_of} - */ - public final Builder composedOf(@Nullable String value) { - this.composedOf = value; - return this; - } - /** * Builds a {@link TemplatesRecord}. * - * @throws NullPointerException - * if some of the required fields are null. + * @throws NullPointerException if some of the required fields are null. */ + @Override + @Nonnull public TemplatesRecord build() { _checkSingleUse(); @@ -264,13 +311,33 @@ public TemplatesRecord build() { ); protected static void setupTemplatesRecordDeserializer(ObjectDeserializer op) { + op.add(Builder::composedOf, JsonpDeserializer.stringDeserializer(), "composed_of"); + op.add(Builder::indexPatterns, JsonpDeserializer.stringDeserializer(), "index_patterns"); + op.add(Builder::name, JsonpDeserializer.stringDeserializer(), "name"); + op.add(Builder::order, JsonpDeserializer.stringDeserializer(), "order"); + op.add(Builder::version, JsonpDeserializer.stringDeserializer(), "version"); + } - op.add(Builder::name, JsonpDeserializer.stringDeserializer(), "name", "n"); - op.add(Builder::indexPatterns, JsonpDeserializer.stringDeserializer(), "index_patterns", "t"); - op.add(Builder::order, JsonpDeserializer.stringDeserializer(), "order", "o", "p"); - op.add(Builder::version, JsonpDeserializer.stringDeserializer(), "version", "v"); - op.add(Builder::composedOf, JsonpDeserializer.stringDeserializer(), "composed_of", "c"); - + @Override + public int hashCode() { + int result = 17; + result = 31 * result + Objects.hashCode(this.composedOf); + result = 31 * result + Objects.hashCode(this.indexPatterns); + result = 31 * result + Objects.hashCode(this.name); + result = 31 * result + Objects.hashCode(this.order); + 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; + TemplatesRecord other = (TemplatesRecord) o; + return Objects.equals(this.composedOf, other.composedOf) + && Objects.equals(this.indexPatterns, other.indexPatterns) + && Objects.equals(this.name, other.name) + && Objects.equals(this.order, other.order) + && Objects.equals(this.version, other.version); + } } diff --git a/java-client/src/main/java/org/opensearch/client/opensearch/cat/thread_pool/ThreadPoolRecord.java b/java-client/src/generated/java/org/opensearch/client/opensearch/cat/thread_pool/ThreadPoolRecord.java similarity index 62% rename from java-client/src/main/java/org/opensearch/client/opensearch/cat/thread_pool/ThreadPoolRecord.java rename to java-client/src/generated/java/org/opensearch/client/opensearch/cat/thread_pool/ThreadPoolRecord.java index 6f918dc28c..9b22443016 100644 --- a/java-client/src/main/java/org/opensearch/client/opensearch/cat/thread_pool/ThreadPoolRecord.java +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/cat/thread_pool/ThreadPoolRecord.java @@ -30,10 +30,17 @@ * GitHub history for details. */ +//---------------------------------------------------- +// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. +//---------------------------------------------------- + package org.opensearch.client.opensearch.cat.thread_pool; import jakarta.json.stream.JsonGenerator; +import java.util.Objects; import java.util.function.Function; +import javax.annotation.Generated; +import javax.annotation.Nonnull; import javax.annotation.Nullable; import org.opensearch.client.json.JsonpDeserializable; import org.opensearch.client.json.JsonpDeserializer; @@ -41,24 +48,28 @@ import org.opensearch.client.json.ObjectBuilderDeserializer; import org.opensearch.client.json.ObjectDeserializer; import org.opensearch.client.json.PlainJsonSerializable; +import org.opensearch.client.util.CopyableBuilder; import org.opensearch.client.util.ObjectBuilder; import org.opensearch.client.util.ObjectBuilderBase; +import org.opensearch.client.util.ToCopyableBuilder; // typedef: cat.thread_pool.ThreadPoolRecord @JsonpDeserializable -public class ThreadPoolRecord implements PlainJsonSerializable { +@Generated("org.opensearch.client.codegen.CodeGenerator") +public class ThreadPoolRecord implements PlainJsonSerializable, ToCopyableBuilder { + @Nullable - private final String nodeName; + private final String active; @Nullable - private final String nodeId; + private final String completed; @Nullable - private final String ephemeralNodeId; + private final String core; @Nullable - private final String pid; + private final String ephemeralNodeId; @Nullable private final String host; @@ -67,122 +78,129 @@ public class ThreadPoolRecord implements PlainJsonSerializable { private final String ip; @Nullable - private final String port; + private final String keepAlive; @Nullable - private final String name; + private final String largest; @Nullable - private final String type; + private final String max; @Nullable - private final String active; + private final String name; @Nullable - private final String poolSize; + private final String nodeId; @Nullable - private final String queue; + private final String nodeName; @Nullable - private final String queueSize; + private final String pid; @Nullable - private final String rejected; + private final String poolSize; @Nullable - private final String largest; + private final String port; @Nullable - private final String completed; + private final String queue; @Nullable - private final String core; + private final String queueSize; @Nullable - private final String max; + private final String rejected; @Nullable private final String size; @Nullable - private final String keepAlive; + private final String totalWaitTime; + + @Nullable + private final String type; // --------------------------------------------------------------------------------------------- private ThreadPoolRecord(Builder builder) { - - this.nodeName = builder.nodeName; - this.nodeId = builder.nodeId; + this.active = builder.active; + this.completed = builder.completed; + this.core = builder.core; this.ephemeralNodeId = builder.ephemeralNodeId; - this.pid = builder.pid; this.host = builder.host; this.ip = builder.ip; - this.port = builder.port; + this.keepAlive = builder.keepAlive; + this.largest = builder.largest; + this.max = builder.max; this.name = builder.name; - this.type = builder.type; - this.active = builder.active; + this.nodeId = builder.nodeId; + this.nodeName = builder.nodeName; + this.pid = builder.pid; this.poolSize = builder.poolSize; + this.port = builder.port; this.queue = builder.queue; this.queueSize = builder.queueSize; this.rejected = builder.rejected; - this.largest = builder.largest; - this.completed = builder.completed; - this.core = builder.core; - this.max = builder.max; this.size = builder.size; - this.keepAlive = builder.keepAlive; - + this.totalWaitTime = builder.totalWaitTime; + this.type = builder.type; } - public static ThreadPoolRecord of(Function> fn) { + public static ThreadPoolRecord of(Function> fn) { return fn.apply(new Builder()).build(); } /** - * node name + * The number of active threads in the current thread pool. *

- * API name: {@code node_name} + * API name: {@code active} + *

*/ @Nullable - public final String nodeName() { - return this.nodeName; + public final String active() { + return this.active; } /** - * persistent node id + * The number of completed tasks. *

- * API name: {@code node_id} + * API name: {@code completed} + *

*/ @Nullable - public final String nodeId() { - return this.nodeId; + public final String completed() { + return this.completed; } /** - * ephemeral node id + * The core number of active threads allowed in a scaling thread pool. *

- * API name: {@code ephemeral_node_id} + * API name: {@code core} + *

*/ @Nullable - public final String ephemeralNodeId() { - return this.ephemeralNodeId; + public final String core() { + return this.core; } /** - * process id + * The ephemeral node identifier. *

- * API name: {@code pid} + * API name: {@code ephemeral_node_id} + *

*/ @Nullable - public final String pid() { - return this.pid; + public final String ephemeralNodeId() { + return this.ephemeralNodeId; } /** - * host name + * The hostname for the current node. *

* API name: {@code host} + *

*/ @Nullable public final String host() { @@ -190,9 +208,10 @@ public final String host() { } /** - * ip address + * The IP address for the current node. *

* API name: {@code ip} + *

*/ @Nullable public final String ip() { @@ -200,129 +219,139 @@ public final String ip() { } /** - * bound transport port + * The thread keep alive time. *

- * API name: {@code port} + * API name: {@code keep_alive} + *

*/ @Nullable - public final String port() { - return this.port; + public final String keepAlive() { + return this.keepAlive; } /** - * thread pool name + * The highest number of active threads in the current thread pool. *

- * API name: {@code name} + * API name: {@code largest} + *

*/ @Nullable - public final String name() { - return this.name; + public final String largest() { + return this.largest; } /** - * thread pool type + * The maximum number of active threads allowed in a scaling thread pool. *

- * API name: {@code type} + * API name: {@code max} + *

*/ @Nullable - public final String type() { - return this.type; + public final String max() { + return this.max; } /** - * number of active threads + * The thread pool name. *

- * API name: {@code active} + * API name: {@code name} + *

*/ @Nullable - public final String active() { - return this.active; + public final String name() { + return this.name; } /** - * number of threads - *

- * API name: {@code pool_size} + * API name: {@code node_id} */ @Nullable - public final String poolSize() { - return this.poolSize; + public final String nodeId() { + return this.nodeId; } /** - * number of tasks currently in queue + * The node name. *

- * API name: {@code queue} + * API name: {@code node_name} + *

*/ @Nullable - public final String queue() { - return this.queue; + public final String nodeName() { + return this.nodeName; } /** - * maximum number of tasks permitted in queue + * The process identifier. *

- * API name: {@code queue_size} + * API name: {@code pid} + *

*/ @Nullable - public final String queueSize() { - return this.queueSize; + public final String pid() { + return this.pid; } /** - * number of rejected tasks + * The number of threads in the current thread pool. *

- * API name: {@code rejected} + * API name: {@code pool_size} + *

*/ @Nullable - public final String rejected() { - return this.rejected; + public final String poolSize() { + return this.poolSize; } /** - * highest number of seen active threads + * The bound transport port for the current node. *

- * API name: {@code largest} + * API name: {@code port} + *

*/ @Nullable - public final String largest() { - return this.largest; + public final String port() { + return this.port; } /** - * number of completed tasks + * The number of tasks currently in queue. *

- * API name: {@code completed} + * API name: {@code queue} + *

*/ @Nullable - public final String completed() { - return this.completed; + public final String queue() { + return this.queue; } /** - * core number of threads in a scaling thread pool + * The maximum number of tasks permitted in the queue. *

- * API name: {@code core} + * API name: {@code queue_size} + *

*/ @Nullable - public final String core() { - return this.core; + public final String queueSize() { + return this.queueSize; } /** - * maximum number of threads in a scaling thread pool + * The number of rejected tasks. *

- * API name: {@code max} + * API name: {@code rejected} + *

*/ @Nullable - public final String max() { - return this.max; + public final String rejected() { + return this.rejected; } /** - * number of threads in a fixed thread pool + * The number of active threads allowed in a fixed thread pool. *

* API name: {@code size} + *

*/ @Nullable public final String size() { @@ -330,18 +359,29 @@ public final String size() { } /** - * thread keep alive time + * API name: {@code total_wait_time} + */ + @Nullable + public final String totalWaitTime() { + return this.totalWaitTime; + } + + /** + * The thread pool type. Returned values include fixed, fixed_auto_queue_size, direct, and + * scaling. *

- * API name: {@code keep_alive} + * API name: {@code type} + *

*/ @Nullable - public final String keepAlive() { - return this.keepAlive; + public final String type() { + return this.type; } /** * Serialize this object to JSON. */ + @Override public void serialize(JsonGenerator generator, JsonpMapper mapper) { generator.writeStartObject(); serializeInternal(generator, mapper); @@ -349,383 +389,482 @@ public void serialize(JsonGenerator generator, JsonpMapper mapper) { } protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { + if (this.active != null) { + generator.writeKey("active"); + generator.write(this.active); + } - if (this.nodeName != null) { - generator.writeKey("node_name"); - generator.write(this.nodeName); - + if (this.completed != null) { + generator.writeKey("completed"); + generator.write(this.completed); } - if (this.nodeId != null) { - generator.writeKey("node_id"); - generator.write(this.nodeId); + if (this.core != null) { + generator.writeKey("core"); + generator.write(this.core); } + if (this.ephemeralNodeId != null) { generator.writeKey("ephemeral_node_id"); generator.write(this.ephemeralNodeId); - } - if (this.pid != null) { - generator.writeKey("pid"); - generator.write(this.pid); - } if (this.host != null) { generator.writeKey("host"); generator.write(this.host); - } + if (this.ip != null) { generator.writeKey("ip"); generator.write(this.ip); + } + if (this.keepAlive != null) { + generator.writeKey("keep_alive"); + generator.write(this.keepAlive); } - if (this.port != null) { - generator.writeKey("port"); - generator.write(this.port); + if (this.largest != null) { + generator.writeKey("largest"); + generator.write(this.largest); } + + if (this.max != null) { + generator.writeKey("max"); + generator.write(this.max); + } + if (this.name != null) { generator.writeKey("name"); generator.write(this.name); + } + if (this.nodeId != null) { + generator.writeKey("node_id"); + generator.write(this.nodeId); } - if (this.type != null) { - generator.writeKey("type"); - generator.write(this.type); + if (this.nodeName != null) { + generator.writeKey("node_name"); + generator.write(this.nodeName); } - if (this.active != null) { - generator.writeKey("active"); - generator.write(this.active); + if (this.pid != null) { + generator.writeKey("pid"); + generator.write(this.pid); } + if (this.poolSize != null) { generator.writeKey("pool_size"); generator.write(this.poolSize); + } + if (this.port != null) { + generator.writeKey("port"); + generator.write(this.port); } + if (this.queue != null) { generator.writeKey("queue"); generator.write(this.queue); - } + if (this.queueSize != null) { generator.writeKey("queue_size"); generator.write(this.queueSize); - } + if (this.rejected != null) { generator.writeKey("rejected"); generator.write(this.rejected); - - } - if (this.largest != null) { - generator.writeKey("largest"); - generator.write(this.largest); - - } - if (this.completed != null) { - generator.writeKey("completed"); - generator.write(this.completed); - - } - if (this.core != null) { - generator.writeKey("core"); - generator.write(this.core); - } - if (this.max != null) { - generator.writeKey("max"); - generator.write(this.max); - } if (this.size != null) { generator.writeKey("size"); generator.write(this.size); - } - if (this.keepAlive != null) { - generator.writeKey("keep_alive"); - generator.write(this.keepAlive); + if (this.totalWaitTime != null) { + generator.writeKey("total_wait_time"); + generator.write(this.totalWaitTime); } + if (this.type != null) { + generator.writeKey("type"); + generator.write(this.type); + } } // --------------------------------------------------------------------------------------------- + @Override + @Nonnull + public Builder toBuilder() { + return new Builder(this); + } + + @Nonnull + public static Builder builder() { + return new Builder(); + } + /** * Builder for {@link ThreadPoolRecord}. */ - - public static class Builder extends ObjectBuilderBase implements ObjectBuilder { + public static class Builder extends ObjectBuilderBase implements CopyableBuilder { @Nullable - private String nodeName; - + private String active; @Nullable - private String nodeId; - + private String completed; @Nullable - private String ephemeralNodeId; - + private String core; @Nullable - private String pid; - + private String ephemeralNodeId; @Nullable private String host; - @Nullable private String ip; - @Nullable - private String port; - + private String keepAlive; + @Nullable + private String largest; + @Nullable + private String max; @Nullable private String name; - @Nullable - private String type; - + private String nodeId; @Nullable - private String active; - + private String nodeName; + @Nullable + private String pid; @Nullable private String poolSize; - + @Nullable + private String port; @Nullable private String queue; - @Nullable private String queueSize; - @Nullable private String rejected; - - @Nullable - private String largest; - - @Nullable - private String completed; - @Nullable - private String core; - + private String size; @Nullable - private String max; - + private String totalWaitTime; @Nullable - private String size; + private String type; - @Nullable - private String keepAlive; + public Builder() {} + + private Builder(ThreadPoolRecord o) { + this.active = o.active; + this.completed = o.completed; + this.core = o.core; + this.ephemeralNodeId = o.ephemeralNodeId; + this.host = o.host; + this.ip = o.ip; + this.keepAlive = o.keepAlive; + this.largest = o.largest; + this.max = o.max; + this.name = o.name; + this.nodeId = o.nodeId; + this.nodeName = o.nodeName; + this.pid = o.pid; + this.poolSize = o.poolSize; + this.port = o.port; + this.queue = o.queue; + this.queueSize = o.queueSize; + this.rejected = o.rejected; + this.size = o.size; + this.totalWaitTime = o.totalWaitTime; + this.type = o.type; + } + + private Builder(Builder o) { + this.active = o.active; + this.completed = o.completed; + this.core = o.core; + this.ephemeralNodeId = o.ephemeralNodeId; + this.host = o.host; + this.ip = o.ip; + this.keepAlive = o.keepAlive; + this.largest = o.largest; + this.max = o.max; + this.name = o.name; + this.nodeId = o.nodeId; + this.nodeName = o.nodeName; + this.pid = o.pid; + this.poolSize = o.poolSize; + this.port = o.port; + this.queue = o.queue; + this.queueSize = o.queueSize; + this.rejected = o.rejected; + this.size = o.size; + this.totalWaitTime = o.totalWaitTime; + this.type = o.type; + } + + @Override + @Nonnull + public Builder copy() { + return new Builder(this); + } /** - * node name + * The number of active threads in the current thread pool. *

- * API name: {@code node_name} + * API name: {@code active} + *

*/ - public final Builder nodeName(@Nullable String value) { - this.nodeName = value; + @Nonnull + public final Builder active(@Nullable String value) { + this.active = value; return this; } /** - * persistent node id + * The number of completed tasks. *

- * API name: {@code node_id} + * API name: {@code completed} + *

*/ - public final Builder nodeId(@Nullable String value) { - this.nodeId = value; + @Nonnull + public final Builder completed(@Nullable String value) { + this.completed = value; return this; } /** - * ephemeral node id + * The core number of active threads allowed in a scaling thread pool. *

- * API name: {@code ephemeral_node_id} + * API name: {@code core} + *

*/ - public final Builder ephemeralNodeId(@Nullable String value) { - this.ephemeralNodeId = value; + @Nonnull + public final Builder core(@Nullable String value) { + this.core = value; return this; } /** - * process id + * The ephemeral node identifier. *

- * API name: {@code pid} + * API name: {@code ephemeral_node_id} + *

*/ - public final Builder pid(@Nullable String value) { - this.pid = value; + @Nonnull + public final Builder ephemeralNodeId(@Nullable String value) { + this.ephemeralNodeId = value; return this; } /** - * host name + * The hostname for the current node. *

* API name: {@code host} + *

*/ + @Nonnull public final Builder host(@Nullable String value) { this.host = value; return this; } /** - * ip address + * The IP address for the current node. *

* API name: {@code ip} + *

*/ + @Nonnull public final Builder ip(@Nullable String value) { this.ip = value; return this; } /** - * bound transport port + * The thread keep alive time. *

- * API name: {@code port} + * API name: {@code keep_alive} + *

*/ - public final Builder port(@Nullable String value) { - this.port = value; + @Nonnull + public final Builder keepAlive(@Nullable String value) { + this.keepAlive = value; return this; } /** - * thread pool name + * The highest number of active threads in the current thread pool. *

- * API name: {@code name} + * API name: {@code largest} + *

*/ - public final Builder name(@Nullable String value) { - this.name = value; + @Nonnull + public final Builder largest(@Nullable String value) { + this.largest = value; return this; } /** - * thread pool type + * The maximum number of active threads allowed in a scaling thread pool. *

- * API name: {@code type} + * API name: {@code max} + *

*/ - public final Builder type(@Nullable String value) { - this.type = value; + @Nonnull + public final Builder max(@Nullable String value) { + this.max = value; return this; } /** - * number of active threads + * The thread pool name. *

- * API name: {@code active} + * API name: {@code name} + *

*/ - public final Builder active(@Nullable String value) { - this.active = value; + @Nonnull + public final Builder name(@Nullable String value) { + this.name = value; return this; } /** - * number of threads - *

- * API name: {@code pool_size} + * API name: {@code node_id} */ - public final Builder poolSize(@Nullable String value) { - this.poolSize = value; + @Nonnull + public final Builder nodeId(@Nullable String value) { + this.nodeId = value; return this; } /** - * number of tasks currently in queue + * The node name. *

- * API name: {@code queue} + * API name: {@code node_name} + *

*/ - public final Builder queue(@Nullable String value) { - this.queue = value; + @Nonnull + public final Builder nodeName(@Nullable String value) { + this.nodeName = value; return this; } /** - * maximum number of tasks permitted in queue + * The process identifier. *

- * API name: {@code queue_size} + * API name: {@code pid} + *

*/ - public final Builder queueSize(@Nullable String value) { - this.queueSize = value; + @Nonnull + public final Builder pid(@Nullable String value) { + this.pid = value; return this; } /** - * number of rejected tasks + * The number of threads in the current thread pool. *

- * API name: {@code rejected} + * API name: {@code pool_size} + *

*/ - public final Builder rejected(@Nullable String value) { - this.rejected = value; + @Nonnull + public final Builder poolSize(@Nullable String value) { + this.poolSize = value; return this; } /** - * highest number of seen active threads + * The bound transport port for the current node. *

- * API name: {@code largest} + * API name: {@code port} + *

*/ - public final Builder largest(@Nullable String value) { - this.largest = value; + @Nonnull + public final Builder port(@Nullable String value) { + this.port = value; return this; } /** - * number of completed tasks + * The number of tasks currently in queue. *

- * API name: {@code completed} + * API name: {@code queue} + *

*/ - public final Builder completed(@Nullable String value) { - this.completed = value; + @Nonnull + public final Builder queue(@Nullable String value) { + this.queue = value; return this; } /** - * core number of threads in a scaling thread pool + * The maximum number of tasks permitted in the queue. *

- * API name: {@code core} + * API name: {@code queue_size} + *

*/ - public final Builder core(@Nullable String value) { - this.core = value; + @Nonnull + public final Builder queueSize(@Nullable String value) { + this.queueSize = value; return this; } /** - * maximum number of threads in a scaling thread pool + * The number of rejected tasks. *

- * API name: {@code max} + * API name: {@code rejected} + *

*/ - public final Builder max(@Nullable String value) { - this.max = value; + @Nonnull + public final Builder rejected(@Nullable String value) { + this.rejected = value; return this; } /** - * number of threads in a fixed thread pool + * The number of active threads allowed in a fixed thread pool. *

* API name: {@code size} + *

*/ + @Nonnull public final Builder size(@Nullable String value) { this.size = value; return this; } /** - * thread keep alive time + * API name: {@code total_wait_time} + */ + @Nonnull + public final Builder totalWaitTime(@Nullable String value) { + this.totalWaitTime = value; + return this; + } + + /** + * The thread pool type. Returned values include fixed, fixed_auto_queue_size, direct, and + * scaling. *

- * API name: {@code keep_alive} + * API name: {@code type} + *

*/ - public final Builder keepAlive(@Nullable String value) { - this.keepAlive = value; + @Nonnull + public final Builder type(@Nullable String value) { + this.type = value; return this; } /** * Builds a {@link ThreadPoolRecord}. * - * @throws NullPointerException - * if some of the required fields are null. + * @throws NullPointerException if some of the required fields are null. */ + @Override + @Nonnull public ThreadPoolRecord build() { _checkSingleUse(); @@ -744,28 +883,81 @@ public ThreadPoolRecord build() { ); protected static void setupThreadPoolRecordDeserializer(ObjectDeserializer op) { + op.add(Builder::active, JsonpDeserializer.stringDeserializer(), "active"); + op.add(Builder::completed, JsonpDeserializer.stringDeserializer(), "completed"); + op.add(Builder::core, JsonpDeserializer.stringDeserializer(), "core"); + op.add(Builder::ephemeralNodeId, JsonpDeserializer.stringDeserializer(), "ephemeral_node_id"); + op.add(Builder::host, JsonpDeserializer.stringDeserializer(), "host"); + op.add(Builder::ip, JsonpDeserializer.stringDeserializer(), "ip"); + op.add(Builder::keepAlive, JsonpDeserializer.stringDeserializer(), "keep_alive"); + op.add(Builder::largest, JsonpDeserializer.stringDeserializer(), "largest"); + op.add(Builder::max, JsonpDeserializer.stringDeserializer(), "max"); + op.add(Builder::name, JsonpDeserializer.stringDeserializer(), "name"); + op.add(Builder::nodeId, JsonpDeserializer.stringDeserializer(), "node_id"); + op.add(Builder::nodeName, JsonpDeserializer.stringDeserializer(), "node_name"); + op.add(Builder::pid, JsonpDeserializer.stringDeserializer(), "pid"); + op.add(Builder::poolSize, JsonpDeserializer.stringDeserializer(), "pool_size"); + op.add(Builder::port, JsonpDeserializer.stringDeserializer(), "port"); + op.add(Builder::queue, JsonpDeserializer.stringDeserializer(), "queue"); + op.add(Builder::queueSize, JsonpDeserializer.stringDeserializer(), "queue_size"); + op.add(Builder::rejected, JsonpDeserializer.stringDeserializer(), "rejected"); + op.add(Builder::size, JsonpDeserializer.stringDeserializer(), "size"); + op.add(Builder::totalWaitTime, JsonpDeserializer.stringDeserializer(), "total_wait_time"); + op.add(Builder::type, JsonpDeserializer.stringDeserializer(), "type"); + } - op.add(Builder::nodeName, JsonpDeserializer.stringDeserializer(), "node_name", "nn"); - op.add(Builder::nodeId, JsonpDeserializer.stringDeserializer(), "node_id", "id"); - op.add(Builder::ephemeralNodeId, JsonpDeserializer.stringDeserializer(), "ephemeral_node_id", "eid"); - op.add(Builder::pid, JsonpDeserializer.stringDeserializer(), "pid", "p"); - op.add(Builder::host, JsonpDeserializer.stringDeserializer(), "host", "h"); - op.add(Builder::ip, JsonpDeserializer.stringDeserializer(), "ip", "i"); - op.add(Builder::port, JsonpDeserializer.stringDeserializer(), "port", "po"); - op.add(Builder::name, JsonpDeserializer.stringDeserializer(), "name", "n"); - op.add(Builder::type, JsonpDeserializer.stringDeserializer(), "type", "t"); - op.add(Builder::active, JsonpDeserializer.stringDeserializer(), "active", "a"); - op.add(Builder::poolSize, JsonpDeserializer.stringDeserializer(), "pool_size", "psz"); - op.add(Builder::queue, JsonpDeserializer.stringDeserializer(), "queue", "q"); - op.add(Builder::queueSize, JsonpDeserializer.stringDeserializer(), "queue_size", "qs"); - op.add(Builder::rejected, JsonpDeserializer.stringDeserializer(), "rejected", "r"); - op.add(Builder::largest, JsonpDeserializer.stringDeserializer(), "largest", "l"); - op.add(Builder::completed, JsonpDeserializer.stringDeserializer(), "completed", "c"); - op.add(Builder::core, JsonpDeserializer.stringDeserializer(), "core", "cr"); - op.add(Builder::max, JsonpDeserializer.stringDeserializer(), "max", "mx"); - op.add(Builder::size, JsonpDeserializer.stringDeserializer(), "size", "sz"); - op.add(Builder::keepAlive, JsonpDeserializer.stringDeserializer(), "keep_alive", "ka"); - + @Override + public int hashCode() { + int result = 17; + result = 31 * result + Objects.hashCode(this.active); + result = 31 * result + Objects.hashCode(this.completed); + result = 31 * result + Objects.hashCode(this.core); + result = 31 * result + Objects.hashCode(this.ephemeralNodeId); + result = 31 * result + Objects.hashCode(this.host); + result = 31 * result + Objects.hashCode(this.ip); + result = 31 * result + Objects.hashCode(this.keepAlive); + result = 31 * result + Objects.hashCode(this.largest); + result = 31 * result + Objects.hashCode(this.max); + result = 31 * result + Objects.hashCode(this.name); + result = 31 * result + Objects.hashCode(this.nodeId); + result = 31 * result + Objects.hashCode(this.nodeName); + result = 31 * result + Objects.hashCode(this.pid); + result = 31 * result + Objects.hashCode(this.poolSize); + result = 31 * result + Objects.hashCode(this.port); + result = 31 * result + Objects.hashCode(this.queue); + result = 31 * result + Objects.hashCode(this.queueSize); + result = 31 * result + Objects.hashCode(this.rejected); + result = 31 * result + Objects.hashCode(this.size); + result = 31 * result + Objects.hashCode(this.totalWaitTime); + result = 31 * result + Objects.hashCode(this.type); + return result; } + @Override + public boolean equals(Object o) { + if (this == o) return true; + if (o == null || this.getClass() != o.getClass()) return false; + ThreadPoolRecord other = (ThreadPoolRecord) o; + return Objects.equals(this.active, other.active) + && Objects.equals(this.completed, other.completed) + && Objects.equals(this.core, other.core) + && Objects.equals(this.ephemeralNodeId, other.ephemeralNodeId) + && Objects.equals(this.host, other.host) + && Objects.equals(this.ip, other.ip) + && Objects.equals(this.keepAlive, other.keepAlive) + && Objects.equals(this.largest, other.largest) + && Objects.equals(this.max, other.max) + && Objects.equals(this.name, other.name) + && Objects.equals(this.nodeId, other.nodeId) + && Objects.equals(this.nodeName, other.nodeName) + && Objects.equals(this.pid, other.pid) + && Objects.equals(this.poolSize, other.poolSize) + && Objects.equals(this.port, other.port) + && Objects.equals(this.queue, other.queue) + && Objects.equals(this.queueSize, other.queueSize) + && Objects.equals(this.rejected, other.rejected) + && Objects.equals(this.size, other.size) + && Objects.equals(this.totalWaitTime, other.totalWaitTime) + && Objects.equals(this.type, other.type); + } } diff --git a/java-client/src/main/java/org/opensearch/client/opensearch/cat/OpenSearchCatAsyncClient.java b/java-client/src/main/java/org/opensearch/client/opensearch/cat/OpenSearchCatAsyncClient.java index 2360bc521a..d97838d8c0 100644 --- a/java-client/src/main/java/org/opensearch/client/opensearch/cat/OpenSearchCatAsyncClient.java +++ b/java-client/src/main/java/org/opensearch/client/opensearch/cat/OpenSearchCatAsyncClient.java @@ -71,100 +71,4 @@ public OpenSearchCatAsyncClient withTransportOptions(@Nullable TransportOptions public CompletableFuture help() throws IOException, OpenSearchException { return this.transport.performRequestAsync(HelpRequest._INSTANCE, HelpRequest._ENDPOINT, this.transportOptions); } - - // ----- Endpoint: cat.templates - - /** - * Returns information about existing templates. - * - * - */ - - public CompletableFuture templates(TemplatesRequest request) throws IOException, OpenSearchException { - @SuppressWarnings("unchecked") - JsonEndpoint endpoint = (JsonEndpoint< - TemplatesRequest, - TemplatesResponse, - ErrorResponse>) TemplatesRequest._ENDPOINT; - - return this.transport.performRequestAsync(request, endpoint, this.transportOptions); - } - - /** - * Returns information about existing templates. - * - * @param fn - * a function that initializes a builder to create the - * {@link TemplatesRequest} - * - */ - - public final CompletableFuture templates(Function> fn) - throws IOException, OpenSearchException { - return templates(fn.apply(new TemplatesRequest.Builder()).build()); - } - - /** - * Returns information about existing templates. - * - * - */ - - public CompletableFuture templates() throws IOException, OpenSearchException { - return this.transport.performRequestAsync( - new TemplatesRequest.Builder().build(), - TemplatesRequest._ENDPOINT, - this.transportOptions - ); - } - - // ----- Endpoint: cat.thread_pool - - /** - * Returns cluster-wide thread pool statistics per node. By default the active, - * queue and rejected statistics are returned for all thread pools. - * - * - */ - - public CompletableFuture threadPool(ThreadPoolRequest request) throws IOException, OpenSearchException { - @SuppressWarnings("unchecked") - JsonEndpoint endpoint = (JsonEndpoint< - ThreadPoolRequest, - ThreadPoolResponse, - ErrorResponse>) ThreadPoolRequest._ENDPOINT; - - return this.transport.performRequestAsync(request, endpoint, this.transportOptions); - } - - /** - * Returns cluster-wide thread pool statistics per node. By default the active, - * queue and rejected statistics are returned for all thread pools. - * - * @param fn - * a function that initializes a builder to create the - * {@link ThreadPoolRequest} - * - */ - - public final CompletableFuture threadPool(Function> fn) - throws IOException, OpenSearchException { - return threadPool(fn.apply(new ThreadPoolRequest.Builder()).build()); - } - - /** - * Returns cluster-wide thread pool statistics per node. By default the active, - * queue and rejected statistics are returned for all thread pools. - * - * - */ - - public CompletableFuture threadPool() throws IOException, OpenSearchException { - return this.transport.performRequestAsync( - new ThreadPoolRequest.Builder().build(), - ThreadPoolRequest._ENDPOINT, - this.transportOptions - ); - } - } diff --git a/java-client/src/main/java/org/opensearch/client/opensearch/cat/OpenSearchCatClient.java b/java-client/src/main/java/org/opensearch/client/opensearch/cat/OpenSearchCatClient.java index e612ff8429..ee49ba7ebd 100644 --- a/java-client/src/main/java/org/opensearch/client/opensearch/cat/OpenSearchCatClient.java +++ b/java-client/src/main/java/org/opensearch/client/opensearch/cat/OpenSearchCatClient.java @@ -70,92 +70,4 @@ public OpenSearchCatClient withTransportOptions(@Nullable TransportOptions trans public HelpResponse help() throws IOException, OpenSearchException { return this.transport.performRequest(HelpRequest._INSTANCE, HelpRequest._ENDPOINT, this.transportOptions); } - - // ----- Endpoint: cat.templates - - /** - * Returns information about existing templates. - * - * - */ - - public TemplatesResponse templates(TemplatesRequest request) throws IOException, OpenSearchException { - @SuppressWarnings("unchecked") - JsonEndpoint endpoint = (JsonEndpoint< - TemplatesRequest, - TemplatesResponse, - ErrorResponse>) TemplatesRequest._ENDPOINT; - - return this.transport.performRequest(request, endpoint, this.transportOptions); - } - - /** - * Returns information about existing templates. - * - * @param fn - * a function that initializes a builder to create the - * {@link TemplatesRequest} - * - */ - - public final TemplatesResponse templates(Function> fn) throws IOException, - OpenSearchException { - return templates(fn.apply(new TemplatesRequest.Builder()).build()); - } - - /** - * Returns information about existing templates. - * - * - */ - - public TemplatesResponse templates() throws IOException, OpenSearchException { - return this.transport.performRequest(new TemplatesRequest.Builder().build(), TemplatesRequest._ENDPOINT, this.transportOptions); - } - - // ----- Endpoint: cat.thread_pool - - /** - * Returns cluster-wide thread pool statistics per node. By default the active, - * queue and rejected statistics are returned for all thread pools. - * - * - */ - - public ThreadPoolResponse threadPool(ThreadPoolRequest request) throws IOException, OpenSearchException { - @SuppressWarnings("unchecked") - JsonEndpoint endpoint = (JsonEndpoint< - ThreadPoolRequest, - ThreadPoolResponse, - ErrorResponse>) ThreadPoolRequest._ENDPOINT; - - return this.transport.performRequest(request, endpoint, this.transportOptions); - } - - /** - * Returns cluster-wide thread pool statistics per node. By default the active, - * queue and rejected statistics are returned for all thread pools. - * - * @param fn - * a function that initializes a builder to create the - * {@link ThreadPoolRequest} - * - */ - - public final ThreadPoolResponse threadPool(Function> fn) throws IOException, - OpenSearchException { - return threadPool(fn.apply(new ThreadPoolRequest.Builder()).build()); - } - - /** - * Returns cluster-wide thread pool statistics per node. By default the active, - * queue and rejected statistics are returned for all thread pools. - * - * - */ - - public ThreadPoolResponse threadPool() throws IOException, OpenSearchException { - return this.transport.performRequest(new ThreadPoolRequest.Builder().build(), ThreadPoolRequest._ENDPOINT, this.transportOptions); - } - } diff --git a/java-client/src/main/java/org/opensearch/client/opensearch/cat/TemplatesRequest.java b/java-client/src/main/java/org/opensearch/client/opensearch/cat/TemplatesRequest.java deleted file mode 100644 index 4a727e70da..0000000000 --- a/java-client/src/main/java/org/opensearch/client/opensearch/cat/TemplatesRequest.java +++ /dev/null @@ -1,159 +0,0 @@ -/* - * SPDX-License-Identifier: Apache-2.0 - * - * The OpenSearch Contributors require contributions made to - * this file be licensed under the Apache-2.0 license or a - * compatible open source license. - */ - -/* - * Licensed to Elasticsearch B.V. under one or more contributor - * license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright - * ownership. Elasticsearch B.V. licenses this file to you under - * the Apache License, Version 2.0 (the "License"); you may - * not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -/* - * Modifications Copyright OpenSearch Contributors. See - * GitHub history for details. - */ - -package org.opensearch.client.opensearch.cat; - -import java.util.HashMap; -import java.util.function.Function; -import javax.annotation.Nullable; -import org.opensearch.client.opensearch._types.ErrorResponse; -import org.opensearch.client.transport.Endpoint; -import org.opensearch.client.transport.endpoints.SimpleEndpoint; -import org.opensearch.client.util.ObjectBuilder; - -// typedef: cat.templates.Request - -/** - * Returns information about existing templates. - * - */ - -public class TemplatesRequest extends CatRequestBase { - @Nullable - private final String name; - - // --------------------------------------------------------------------------------------------- - - private TemplatesRequest(Builder builder) { - super(builder); - this.name = builder.name; - - } - - public static TemplatesRequest of(Function> fn) { - return fn.apply(new Builder()).build(); - } - - /** - * A pattern that returned template names must match - *

- * API name: {@code name} - */ - @Nullable - public final String name() { - return this.name; - } - - // --------------------------------------------------------------------------------------------- - - /** - * Builder for {@link TemplatesRequest}. - */ - - public static class Builder extends CatRequestBaseBuilder { - @Nullable - private String name; - - /** - * A pattern that returned template names must match - *

- * API name: {@code name} - */ - public final Builder name(@Nullable String value) { - this.name = value; - return this; - } - - /** - * Builds a {@link TemplatesRequest}. - * - * @throws NullPointerException - * if some of the required fields are null. - */ - public TemplatesRequest build() { - _checkSingleUse(); - - return new TemplatesRequest(this); - } - - @Override - protected Builder self() { - return this; - } - } - - // --------------------------------------------------------------------------------------------- - - /** - * Endpoint "{@code cat.templates}". - */ - public static final Endpoint _ENDPOINT = new SimpleEndpoint<>( - - // Request method - request -> { - return "GET"; - - }, - - // Request path - request -> { - final int _name = 1 << 0; - - int propsSet = 0; - - if (request.name() != null) propsSet |= _name; - - if (propsSet == 0) { - StringBuilder buf = new StringBuilder(); - buf.append("/_cat"); - buf.append("/templates"); - return buf.toString(); - } - if (propsSet == (_name)) { - StringBuilder buf = new StringBuilder(); - buf.append("/_cat"); - buf.append("/templates"); - buf.append("/"); - SimpleEndpoint.pathEncode(request.name, buf); - return buf.toString(); - } - throw SimpleEndpoint.noPathTemplateFound("path"); - - }, - - // Request parameters - request -> new HashMap<>(request.queryParameters()), - SimpleEndpoint.emptyMap(), - false, - TemplatesResponse._DESERIALIZER - ); -} diff --git a/java-client/src/main/java/org/opensearch/client/opensearch/cat/ThreadPoolRequest.java b/java-client/src/main/java/org/opensearch/client/opensearch/cat/ThreadPoolRequest.java deleted file mode 100644 index e49a776ad7..0000000000 --- a/java-client/src/main/java/org/opensearch/client/opensearch/cat/ThreadPoolRequest.java +++ /dev/null @@ -1,214 +0,0 @@ -/* - * SPDX-License-Identifier: Apache-2.0 - * - * The OpenSearch Contributors require contributions made to - * this file be licensed under the Apache-2.0 license or a - * compatible open source license. - */ - -/* - * Licensed to Elasticsearch B.V. under one or more contributor - * license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright - * ownership. Elasticsearch B.V. licenses this file to you under - * the Apache License, Version 2.0 (the "License"); you may - * not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -/* - * Modifications Copyright OpenSearch Contributors. See - * GitHub history for details. - */ - -package org.opensearch.client.opensearch.cat; - -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.function.Function; -import java.util.stream.Collectors; -import javax.annotation.Nullable; -import org.opensearch.client.opensearch._types.ErrorResponse; -import org.opensearch.client.opensearch.cat.thread_pool.ThreadPoolSize; -import org.opensearch.client.transport.Endpoint; -import org.opensearch.client.transport.endpoints.SimpleEndpoint; -import org.opensearch.client.util.ApiTypeHelper; -import org.opensearch.client.util.ObjectBuilder; - -// typedef: cat.thread_pool.Request - -/** - * Returns cluster-wide thread pool statistics per node. By default the active, - * queue and rejected statistics are returned for all thread pools. - * - */ - -public class ThreadPoolRequest extends CatRequestBase { - @Nullable - private final ThreadPoolSize size; - - private final List threadPoolPatterns; - - // --------------------------------------------------------------------------------------------- - - private ThreadPoolRequest(Builder builder) { - super(builder); - this.size = builder.size; - this.threadPoolPatterns = ApiTypeHelper.unmodifiable(builder.threadPoolPatterns); - - } - - public static ThreadPoolRequest of(Function> fn) { - return fn.apply(new Builder()).build(); - } - - /** - * The multiplier in which to display values - *

- * API name: {@code size} - */ - @Nullable - public final ThreadPoolSize size() { - return this.size; - } - - /** - * A comma-separated list of regular-expressions to filter the thread pools in - * the output - *

- * API name: {@code thread_pool_patterns} - */ - public final List threadPoolPatterns() { - return this.threadPoolPatterns; - } - - // --------------------------------------------------------------------------------------------- - - /** - * Builder for {@link ThreadPoolRequest}. - */ - - public static class Builder extends CatRequestBaseBuilder { - @Nullable - private ThreadPoolSize size; - - @Nullable - private List threadPoolPatterns; - - /** - * The multiplier in which to display values - *

- * API name: {@code size} - */ - public final Builder size(@Nullable ThreadPoolSize value) { - this.size = value; - return this; - } - - /** - * A comma-separated list of regular-expressions to filter the thread pools in - * the output - *

- * API name: {@code thread_pool_patterns} - *

- * Adds all elements of list to threadPoolPatterns. - */ - public final Builder threadPoolPatterns(List list) { - this.threadPoolPatterns = _listAddAll(this.threadPoolPatterns, list); - return this; - } - - /** - * A comma-separated list of regular-expressions to filter the thread pools in - * the output - *

- * API name: {@code thread_pool_patterns} - *

- * Adds one or more values to threadPoolPatterns. - */ - public final Builder threadPoolPatterns(String value, String... values) { - this.threadPoolPatterns = _listAdd(this.threadPoolPatterns, value, values); - return this; - } - - /** - * Builds a {@link ThreadPoolRequest}. - * - * @throws NullPointerException - * if some of the required fields are null. - */ - public ThreadPoolRequest build() { - _checkSingleUse(); - - return new ThreadPoolRequest(this); - } - - @Override - protected Builder self() { - return this; - } - } - - // --------------------------------------------------------------------------------------------- - - /** - * Endpoint "{@code cat.thread_pool}". - */ - public static final Endpoint _ENDPOINT = new SimpleEndpoint<>( - - // Request method - request -> { - return "GET"; - - }, - - // Request path - request -> { - final int _threadPoolPatterns = 1 << 0; - - int propsSet = 0; - - if (ApiTypeHelper.isDefined(request.threadPoolPatterns())) propsSet |= _threadPoolPatterns; - - if (propsSet == 0) { - StringBuilder buf = new StringBuilder(); - buf.append("/_cat"); - buf.append("/thread_pool"); - return buf.toString(); - } - if (propsSet == (_threadPoolPatterns)) { - StringBuilder buf = new StringBuilder(); - buf.append("/_cat"); - buf.append("/thread_pool"); - buf.append("/"); - SimpleEndpoint.pathEncode(request.threadPoolPatterns.stream().map(v -> v).collect(Collectors.joining(",")), buf); - return buf.toString(); - } - throw SimpleEndpoint.noPathTemplateFound("path"); - - }, - - // Request parameters - request -> { - Map params = new HashMap<>(request.queryParameters()); - if (request.size != null) { - params.put("size", request.size.jsonValue()); - } - return params; - - }, - SimpleEndpoint.emptyMap(), - false, - ThreadPoolResponse._DESERIALIZER - ); -} diff --git a/java-client/src/main/java/org/opensearch/client/opensearch/cat/thread_pool/ThreadPoolSize.java b/java-client/src/main/java/org/opensearch/client/opensearch/cat/thread_pool/ThreadPoolSize.java deleted file mode 100644 index ea07c6a660..0000000000 --- a/java-client/src/main/java/org/opensearch/client/opensearch/cat/thread_pool/ThreadPoolSize.java +++ /dev/null @@ -1,63 +0,0 @@ -/* - * SPDX-License-Identifier: Apache-2.0 - * - * The OpenSearch Contributors require contributions made to - * this file be licensed under the Apache-2.0 license or a - * compatible open source license. - */ - -/* - * Licensed to Elasticsearch B.V. under one or more contributor - * license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright - * ownership. Elasticsearch B.V. licenses this file to you under - * the Apache License, Version 2.0 (the "License"); you may - * not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -/* - * Modifications Copyright OpenSearch Contributors. See - * GitHub history for details. - */ - -package org.opensearch.client.opensearch.cat.thread_pool; - -import org.opensearch.client.json.JsonEnum; -import org.opensearch.client.json.JsonpDeserializable; - -@JsonpDeserializable -public enum ThreadPoolSize implements JsonEnum { - K("k"), - - M("m"), - - G("g"), - - T("t"), - - P("p"), - - ; - - private final String jsonValue; - - ThreadPoolSize(String jsonValue) { - this.jsonValue = jsonValue; - } - - public String jsonValue() { - return this.jsonValue; - } - - public static final JsonEnum.Deserializer _DESERIALIZER = new JsonEnum.Deserializer<>(ThreadPoolSize.values()); -} diff --git a/java-codegen/src/main/java/org/opensearch/client/codegen/CodeGenerator.java b/java-codegen/src/main/java/org/opensearch/client/codegen/CodeGenerator.java index 0c80d43fd6..44ac61f340 100644 --- a/java-codegen/src/main/java/org/opensearch/client/codegen/CodeGenerator.java +++ b/java-codegen/src/main/java/org/opensearch/client/codegen/CodeGenerator.java @@ -71,7 +71,9 @@ public class CodeGenerator { "segments", "shards", "snapshots", - "tasks" + "tasks", + "templates", + "thread_pool" ) ) ), diff --git a/java-codegen/src/main/java/org/opensearch/client/codegen/model/SpecTransformer.java b/java-codegen/src/main/java/org/opensearch/client/codegen/model/SpecTransformer.java index 30d1f10d40..fbef9f05c1 100644 --- a/java-codegen/src/main/java/org/opensearch/client/codegen/model/SpecTransformer.java +++ b/java-codegen/src/main/java/org/opensearch/client/codegen/model/SpecTransformer.java @@ -732,6 +732,7 @@ private Type mapOneOf(List oneOf) { private Type mapAnyOf(List anyOf) { var types = OpenApiSchema.determineTypes(anyOf); + types.remove(OpenApiSchemaType.Null); if (types.size() == 1 && types.contains(OpenApiSchemaType.String)) { return Types.Java.Lang.String; From d6af709b9b591418c90ff68e528515dec2dbf4d6 Mon Sep 17 00:00:00 2001 From: Thomas Farr Date: Tue, 7 Jan 2025 22:51:51 +1300 Subject: [PATCH 14/18] Generate cat.segment_replication Signed-off-by: Thomas Farr --- .../cat/OpenSearchCatAsyncClientBase.java | 31 + .../cat/OpenSearchCatClientBase.java | 30 + .../cat/SegmentReplicationRequest.java | 700 +++++++++++++ .../cat/SegmentReplicationResponse.java | 197 ++++ .../SegmentReplicationRecord.java | 982 ++++++++++++++++++ .../client/opensearch/cat/CatRequestBase.java | 13 - .../client/opensearch/cat/HelpRequest.java | 17 +- .../cat/OpenSearchCatAsyncClient.java | 4 - .../opensearch/cat/OpenSearchCatClient.java | 4 - java-codegen/opensearch-openapi.yaml | 108 +- .../client/codegen/CodeGenerator.java | 30 +- 11 files changed, 1998 insertions(+), 118 deletions(-) create mode 100644 java-client/src/generated/java/org/opensearch/client/opensearch/cat/SegmentReplicationRequest.java create mode 100644 java-client/src/generated/java/org/opensearch/client/opensearch/cat/SegmentReplicationResponse.java create mode 100644 java-client/src/generated/java/org/opensearch/client/opensearch/cat/segment_replication/SegmentReplicationRecord.java diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/cat/OpenSearchCatAsyncClientBase.java b/java-client/src/generated/java/org/opensearch/client/opensearch/cat/OpenSearchCatAsyncClientBase.java index e79339b59c..39398ee15b 100644 --- a/java-client/src/generated/java/org/opensearch/client/opensearch/cat/OpenSearchCatAsyncClientBase.java +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/cat/OpenSearchCatAsyncClientBase.java @@ -478,6 +478,37 @@ public final CompletableFuture repositories() throws IOExc return repositories(new RepositoriesRequest.Builder().build()); } + // ----- Endpoint: cat.segment_replication + + /** + * Returns information about active and last-completed segment replication events on each replica shard, including related shard-level + * metrics. These metrics provide information about how far behind the primary shard the replicas are lagging. + */ + public CompletableFuture segmentReplication(SegmentReplicationRequest request) throws IOException, + OpenSearchException { + return this.transport.performRequestAsync(request, SegmentReplicationRequest._ENDPOINT, this.transportOptions); + } + + /** + * Returns information about active and last-completed segment replication events on each replica shard, including related shard-level + * metrics. These metrics provide information about how far behind the primary shard the replicas are lagging. + * + * @param fn a function that initializes a builder to create the {@link SegmentReplicationRequest} + */ + public final CompletableFuture segmentReplication( + Function> fn + ) throws IOException, OpenSearchException { + return segmentReplication(fn.apply(new SegmentReplicationRequest.Builder()).build()); + } + + /** + * Returns information about active and last-completed segment replication events on each replica shard, including related shard-level + * metrics. These metrics provide information about how far behind the primary shard the replicas are lagging. + */ + public final CompletableFuture segmentReplication() throws IOException, OpenSearchException { + return segmentReplication(new SegmentReplicationRequest.Builder().build()); + } + // ----- Endpoint: cat.segments /** diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/cat/OpenSearchCatClientBase.java b/java-client/src/generated/java/org/opensearch/client/opensearch/cat/OpenSearchCatClientBase.java index 72ae6091e3..70311bfdee 100644 --- a/java-client/src/generated/java/org/opensearch/client/opensearch/cat/OpenSearchCatClientBase.java +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/cat/OpenSearchCatClientBase.java @@ -470,6 +470,36 @@ public final RepositoriesResponse repositories() throws IOException, OpenSearchE return repositories(new RepositoriesRequest.Builder().build()); } + // ----- Endpoint: cat.segment_replication + + /** + * Returns information about active and last-completed segment replication events on each replica shard, including related shard-level + * metrics. These metrics provide information about how far behind the primary shard the replicas are lagging. + */ + public SegmentReplicationResponse segmentReplication(SegmentReplicationRequest request) throws IOException, OpenSearchException { + return this.transport.performRequest(request, SegmentReplicationRequest._ENDPOINT, this.transportOptions); + } + + /** + * Returns information about active and last-completed segment replication events on each replica shard, including related shard-level + * metrics. These metrics provide information about how far behind the primary shard the replicas are lagging. + * + * @param fn a function that initializes a builder to create the {@link SegmentReplicationRequest} + */ + public final SegmentReplicationResponse segmentReplication( + Function> fn + ) throws IOException, OpenSearchException { + return segmentReplication(fn.apply(new SegmentReplicationRequest.Builder()).build()); + } + + /** + * Returns information about active and last-completed segment replication events on each replica shard, including related shard-level + * metrics. These metrics provide information about how far behind the primary shard the replicas are lagging. + */ + public final SegmentReplicationResponse segmentReplication() throws IOException, OpenSearchException { + return segmentReplication(new SegmentReplicationRequest.Builder().build()); + } + // ----- Endpoint: cat.segments /** diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/cat/SegmentReplicationRequest.java b/java-client/src/generated/java/org/opensearch/client/opensearch/cat/SegmentReplicationRequest.java new file mode 100644 index 0000000000..3ba11e1cbe --- /dev/null +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/cat/SegmentReplicationRequest.java @@ -0,0 +1,700 @@ +/* + * SPDX-License-Identifier: Apache-2.0 + * + * The OpenSearch Contributors require contributions made to + * this file be licensed under the Apache-2.0 license or a + * compatible open source license. + */ + +/* + * Licensed to Elasticsearch B.V. under one or more contributor + * license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright + * ownership. Elasticsearch B.V. licenses this file to you under + * the Apache License, Version 2.0 (the "License"); you may + * not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +/* + * Modifications Copyright OpenSearch Contributors. See + * GitHub history for details. + */ + +//---------------------------------------------------- +// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. +//---------------------------------------------------- + +package org.opensearch.client.opensearch.cat; + +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.Bytes; +import org.opensearch.client.opensearch._types.ErrorResponse; +import org.opensearch.client.opensearch._types.ExpandWildcard; +import org.opensearch.client.opensearch._types.Time; +import org.opensearch.client.opensearch._types.TimeUnit; +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.ToCopyableBuilder; + +// typedef: cat.segment_replication.Request + +/** + * Returns information about active and last-completed segment replication events on each replica shard, including related shard-level + * metrics. These metrics provide information about how far behind the primary shard the replicas are lagging. + */ +@Generated("org.opensearch.client.codegen.CodeGenerator") +public final class SegmentReplicationRequest extends CatRequestBase + implements + ToCopyableBuilder { + + @Nullable + private final Boolean activeOnly; + + @Nullable + private final Boolean allowNoIndices; + + @Nullable + private final Bytes bytes; + + @Nullable + private final Boolean completedOnly; + + @Nullable + private final Boolean detailed; + + @Nonnull + private final List expandWildcards; + + @Nullable + private final Boolean ignoreThrottled; + + @Nullable + private final Boolean ignoreUnavailable; + + @Nonnull + private final List index; + + @Nonnull + private final List shards; + + @Nullable + private final TimeUnit time; + + @Nullable + private final Time timeout; + + // --------------------------------------------------------------------------------------------- + + private SegmentReplicationRequest(Builder builder) { + super(builder); + this.activeOnly = builder.activeOnly; + this.allowNoIndices = builder.allowNoIndices; + this.bytes = builder.bytes; + this.completedOnly = builder.completedOnly; + this.detailed = builder.detailed; + this.expandWildcards = ApiTypeHelper.unmodifiable(builder.expandWildcards); + this.ignoreThrottled = builder.ignoreThrottled; + this.ignoreUnavailable = builder.ignoreUnavailable; + this.index = ApiTypeHelper.unmodifiable(builder.index); + this.shards = ApiTypeHelper.unmodifiable(builder.shards); + this.time = builder.time; + this.timeout = builder.timeout; + } + + public static SegmentReplicationRequest of(Function> fn) { + return fn.apply(new Builder()).build(); + } + + /** + * When true, the response only includes ongoing segment replication events. + *

+ * API name: {@code active_only} + *

+ */ + @Nullable + public final Boolean activeOnly() { + return this.activeOnly; + } + + /** + * Whether to ignore the index if a wildcard index expression resolves to no concrete indexes. This includes the _all + * string or when no indexes have been specified. + *

+ * API name: {@code allow_no_indices} + *

+ */ + @Nullable + public final Boolean allowNoIndices() { + return this.allowNoIndices; + } + + /** + * The units used to display byte values. + *

+ * API name: {@code bytes} + *

+ */ + @Nullable + public final Bytes bytes() { + return this.bytes; + } + + /** + * When true, the response only includes the last-completed segment replication events. + *

+ * API name: {@code completed_only} + *

+ */ + @Nullable + public final Boolean completedOnly() { + return this.completedOnly; + } + + /** + * When true, the response includes additional metrics for each stage of a segment replication event. + *

+ * API name: {@code detailed} + *

+ */ + @Nullable + public final Boolean detailed() { + return this.detailed; + } + + /** + * Whether to expand the wildcard expression to include concrete indexes that are open, closed, or both. + *

+ * API name: {@code expand_wildcards} + *

+ */ + @Nonnull + public final List expandWildcards() { + return this.expandWildcards; + } + + /** + * Whether specified concrete, expanded, or aliased indexes should be ignored when throttled. + *

+ * API name: {@code ignore_throttled} + *

+ */ + @Nullable + public final Boolean ignoreThrottled() { + return this.ignoreThrottled; + } + + /** + * Whether the specified concrete indexes should be ignored when missing or closed. + *

+ * API name: {@code ignore_unavailable} + *

+ */ + @Nullable + public final Boolean ignoreUnavailable() { + return this.ignoreUnavailable; + } + + /** + * A comma-separated list of data streams, indexes, and aliases used to limit the request. Supports wildcards (*). To + * target all data streams and indexes, omit this parameter or use * or _all. + *

+ * API name: {@code index} + *

+ */ + @Nonnull + public final List index() { + return this.index; + } + + /** + * A comma-separated list of shards to display. + *

+ * API name: {@code shards} + *

+ */ + @Nonnull + public final List shards() { + return this.shards; + } + + /** + * Specifies the time units, for example, 5d or 7h. For more information, see + * Supported units. + *

+ * API name: {@code time} + *

+ */ + @Nullable + public final TimeUnit time() { + return this.time; + } + + /** + * The operation timeout. + *

+ * API name: {@code timeout} + *

+ */ + @Nullable + public final Time timeout() { + return this.timeout; + } + + // --------------------------------------------------------------------------------------------- + + @Override + @Nonnull + public Builder toBuilder() { + return new Builder(this); + } + + @Nonnull + public static Builder builder() { + return new Builder(); + } + + /** + * Builder for {@link SegmentReplicationRequest}. + */ + public static class Builder extends CatRequestBase.AbstractBuilder + implements + CopyableBuilder { + @Nullable + private Boolean activeOnly; + @Nullable + private Boolean allowNoIndices; + @Nullable + private Bytes bytes; + @Nullable + private Boolean completedOnly; + @Nullable + private Boolean detailed; + @Nullable + private List expandWildcards; + @Nullable + private Boolean ignoreThrottled; + @Nullable + private Boolean ignoreUnavailable; + @Nullable + private List index; + @Nullable + private List shards; + @Nullable + private TimeUnit time; + @Nullable + private Time timeout; + + public Builder() {} + + private Builder(SegmentReplicationRequest o) { + super(o); + this.activeOnly = o.activeOnly; + this.allowNoIndices = o.allowNoIndices; + this.bytes = o.bytes; + this.completedOnly = o.completedOnly; + this.detailed = o.detailed; + this.expandWildcards = _listCopy(o.expandWildcards); + this.ignoreThrottled = o.ignoreThrottled; + this.ignoreUnavailable = o.ignoreUnavailable; + this.index = _listCopy(o.index); + this.shards = _listCopy(o.shards); + this.time = o.time; + this.timeout = o.timeout; + } + + private Builder(Builder o) { + super(o); + this.activeOnly = o.activeOnly; + this.allowNoIndices = o.allowNoIndices; + this.bytes = o.bytes; + this.completedOnly = o.completedOnly; + this.detailed = o.detailed; + this.expandWildcards = _listCopy(o.expandWildcards); + this.ignoreThrottled = o.ignoreThrottled; + this.ignoreUnavailable = o.ignoreUnavailable; + this.index = _listCopy(o.index); + this.shards = _listCopy(o.shards); + this.time = o.time; + this.timeout = o.timeout; + } + + @Override + @Nonnull + public Builder copy() { + return new Builder(this); + } + + @Override + @Nonnull + protected Builder self() { + return this; + } + + /** + * When true, the response only includes ongoing segment replication events. + *

+ * API name: {@code active_only} + *

+ */ + @Nonnull + public final Builder activeOnly(@Nullable Boolean value) { + this.activeOnly = value; + return this; + } + + /** + * Whether to ignore the index if a wildcard index expression resolves to no concrete indexes. This includes the _all + * string or when no indexes have been specified. + *

+ * API name: {@code allow_no_indices} + *

+ */ + @Nonnull + public final Builder allowNoIndices(@Nullable Boolean value) { + this.allowNoIndices = value; + return this; + } + + /** + * The units used to display byte values. + *

+ * API name: {@code bytes} + *

+ */ + @Nonnull + public final Builder bytes(@Nullable Bytes value) { + this.bytes = value; + return this; + } + + /** + * When true, the response only includes the last-completed segment replication events. + *

+ * API name: {@code completed_only} + *

+ */ + @Nonnull + public final Builder completedOnly(@Nullable Boolean value) { + this.completedOnly = value; + return this; + } + + /** + * When true, the response includes additional metrics for each stage of a segment replication event. + *

+ * API name: {@code detailed} + *

+ */ + @Nonnull + public final Builder detailed(@Nullable Boolean value) { + this.detailed = value; + return this; + } + + /** + * Whether to expand the wildcard expression to include 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 the wildcard expression to include 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; + } + + /** + * Whether specified concrete, expanded, or aliased indexes should be ignored when throttled. + *

+ * API name: {@code ignore_throttled} + *

+ */ + @Nonnull + public final Builder ignoreThrottled(@Nullable Boolean value) { + this.ignoreThrottled = value; + return this; + } + + /** + * Whether the specified concrete indexes should be ignored when missing or closed. + *

+ * API name: {@code ignore_unavailable} + *

+ */ + @Nonnull + public final Builder ignoreUnavailable(@Nullable Boolean value) { + this.ignoreUnavailable = value; + return this; + } + + /** + * A comma-separated list of data streams, indexes, and aliases used to limit the request. Supports wildcards (*). To + * target all data streams and indexes, omit this parameter or use * or _all. + *

+ * 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; + } + + /** + * A comma-separated list of data streams, indexes, and aliases used to limit the request. Supports wildcards (*). To + * target all data streams and indexes, omit this parameter or use * or _all. + *

+ * 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; + } + + /** + * A comma-separated list of shards to display. + *

+ * API name: {@code shards} + *

+ * + *

+ * Adds all elements of list to shards. + *

+ */ + @Nonnull + public final Builder shards(List list) { + this.shards = _listAddAll(this.shards, list); + return this; + } + + /** + * A comma-separated list of shards to display. + *

+ * API name: {@code shards} + *

+ * + *

+ * Adds one or more values to shards. + *

+ */ + @Nonnull + public final Builder shards(String value, String... values) { + this.shards = _listAdd(this.shards, value, values); + return this; + } + + /** + * Specifies the time units, for example, 5d or 7h. For more information, see + * Supported units. + *

+ * API name: {@code time} + *

+ */ + @Nonnull + public final Builder time(@Nullable TimeUnit value) { + this.time = value; + return this; + } + + /** + * The operation timeout. + *

+ * API name: {@code timeout} + *

+ */ + @Nonnull + public final Builder timeout(@Nullable Time value) { + this.timeout = value; + return this; + } + + /** + * The operation timeout. + *

+ * API name: {@code timeout} + *

+ */ + @Nonnull + public final Builder timeout(Function> fn) { + return timeout(fn.apply(new Time.Builder()).build()); + } + + /** + * Builds a {@link SegmentReplicationRequest}. + * + * @throws NullPointerException if some of the required fields are null. + */ + @Override + @Nonnull + public SegmentReplicationRequest build() { + _checkSingleUse(); + + return new SegmentReplicationRequest(this); + } + } + + // --------------------------------------------------------------------------------------------- + + @Override + protected void applyQueryParameters(@Nonnull Map params) { + super.applyQueryParameters(params); + if (this.activeOnly != null) { + params.put("active_only", String.valueOf(this.activeOnly)); + } + if (this.allowNoIndices != null) { + params.put("allow_no_indices", String.valueOf(this.allowNoIndices)); + } + if (this.bytes != null) { + params.put("bytes", this.bytes.jsonValue()); + } + if (this.completedOnly != null) { + params.put("completed_only", String.valueOf(this.completedOnly)); + } + if (this.detailed != null) { + params.put("detailed", String.valueOf(this.detailed)); + } + if (ApiTypeHelper.isDefined(this.expandWildcards)) { + params.put("expand_wildcards", this.expandWildcards.stream().map(v -> v.jsonValue()).collect(Collectors.joining(","))); + } + if (this.ignoreThrottled != null) { + params.put("ignore_throttled", String.valueOf(this.ignoreThrottled)); + } + if (this.ignoreUnavailable != null) { + params.put("ignore_unavailable", String.valueOf(this.ignoreUnavailable)); + } + if (ApiTypeHelper.isDefined(this.shards)) { + params.put("shards", String.join(",", this.shards)); + } + if (this.time != null) { + params.put("time", this.time.jsonValue()); + } + if (this.timeout != null) { + params.put("timeout", this.timeout._toJsonString()); + } + } + + /** + * Endpoint "{@code cat.segment_replication}". + */ + public static final Endpoint _ENDPOINT = new SimpleEndpoint<>( + // Request method + request -> "GET", + // Request path + request -> { + final int _index = 1 << 0; + + int propsSet = 0; + + if (ApiTypeHelper.isDefined(request.index())) propsSet |= _index; + + if (propsSet == 0) { + return "/_cat/segment_replication"; + } + if (propsSet == (_index)) { + StringBuilder buf = new StringBuilder(); + buf.append("/_cat/segment_replication/"); + SimpleEndpoint.pathEncode(String.join(",", request.index), buf); + return buf.toString(); + } + + throw SimpleEndpoint.noPathTemplateFound("path"); + }, + // Request parameters + request -> { + Map params = new HashMap<>(); + request.applyQueryParameters(params); + return params; + }, + SimpleEndpoint.emptyMap(), + false, + SegmentReplicationResponse._DESERIALIZER + ); + + @Override + public int hashCode() { + int result = 17; + result = 31 * result + Objects.hashCode(this.activeOnly); + result = 31 * result + Objects.hashCode(this.allowNoIndices); + result = 31 * result + Objects.hashCode(this.bytes); + result = 31 * result + Objects.hashCode(this.completedOnly); + result = 31 * result + Objects.hashCode(this.detailed); + result = 31 * result + Objects.hashCode(this.expandWildcards); + result = 31 * result + Objects.hashCode(this.ignoreThrottled); + result = 31 * result + Objects.hashCode(this.ignoreUnavailable); + result = 31 * result + Objects.hashCode(this.index); + result = 31 * result + Objects.hashCode(this.shards); + result = 31 * result + Objects.hashCode(this.time); + 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; + SegmentReplicationRequest other = (SegmentReplicationRequest) o; + return Objects.equals(this.activeOnly, other.activeOnly) + && Objects.equals(this.allowNoIndices, other.allowNoIndices) + && Objects.equals(this.bytes, other.bytes) + && Objects.equals(this.completedOnly, other.completedOnly) + && Objects.equals(this.detailed, other.detailed) + && Objects.equals(this.expandWildcards, other.expandWildcards) + && Objects.equals(this.ignoreThrottled, other.ignoreThrottled) + && Objects.equals(this.ignoreUnavailable, other.ignoreUnavailable) + && Objects.equals(this.index, other.index) + && Objects.equals(this.shards, other.shards) + && Objects.equals(this.time, other.time) + && Objects.equals(this.timeout, other.timeout); + } +} diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/cat/SegmentReplicationResponse.java b/java-client/src/generated/java/org/opensearch/client/opensearch/cat/SegmentReplicationResponse.java new file mode 100644 index 0000000000..be7c70d272 --- /dev/null +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/cat/SegmentReplicationResponse.java @@ -0,0 +1,197 @@ +/* + * SPDX-License-Identifier: Apache-2.0 + * + * The OpenSearch Contributors require contributions made to + * this file be licensed under the Apache-2.0 license or a + * compatible open source license. + */ + +/* + * Licensed to Elasticsearch B.V. under one or more contributor + * license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright + * ownership. Elasticsearch B.V. licenses this file to you under + * the Apache License, Version 2.0 (the "License"); you may + * not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +/* + * Modifications Copyright OpenSearch Contributors. See + * GitHub history for details. + */ + +//---------------------------------------------------- +// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. +//---------------------------------------------------- + +package org.opensearch.client.opensearch.cat; + +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; +import org.opensearch.client.json.PlainJsonSerializable; +import org.opensearch.client.opensearch.cat.segment_replication.SegmentReplicationRecord; +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: cat.segment_replication.Response + +@JsonpDeserializable +@Generated("org.opensearch.client.codegen.CodeGenerator") +public class SegmentReplicationResponse + implements + PlainJsonSerializable, + ToCopyableBuilder { + + @Nonnull + private final List valueBody; + + // --------------------------------------------------------------------------------------------- + + private SegmentReplicationResponse(Builder builder) { + this.valueBody = ApiTypeHelper.unmodifiableRequired(builder.valueBody, this, "valueBody"); + } + + public static SegmentReplicationResponse of( + Function> fn + ) { + return fn.apply(new Builder()).build(); + } + + /** + * Required - Response value. + */ + @Nonnull + public final List valueBody() { + return this.valueBody; + } + + /** + * Serialize this value to JSON. + */ + public void serialize(JsonGenerator generator, JsonpMapper mapper) { + generator.writeStartArray(); + for (SegmentReplicationRecord item0 : this.valueBody) { + 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 SegmentReplicationResponse}. + */ + public static class Builder extends ObjectBuilderBase implements CopyableBuilder { + private List valueBody; + + public Builder() {} + + private Builder(SegmentReplicationResponse o) { + this.valueBody = _listCopy(o.valueBody); + } + + private Builder(Builder o) { + this.valueBody = _listCopy(o.valueBody); + } + + @Override + @Nonnull + public Builder copy() { + return new Builder(this); + } + + /** + * Required - Response value. + * + *

+ * Adds all elements of list to valueBody. + *

+ */ + @Nonnull + public final Builder valueBody(List list) { + this.valueBody = _listAddAll(this.valueBody, list); + return this; + } + + /** + * Required - Response value. + * + *

+ * Adds one or more values to valueBody. + *

+ */ + @Nonnull + public final Builder valueBody(SegmentReplicationRecord value, SegmentReplicationRecord... values) { + this.valueBody = _listAdd(this.valueBody, value, values); + return this; + } + + /** + * Required - Response value. + * + *

+ * Adds a value to valueBody using a builder lambda. + *

+ */ + @Nonnull + public final Builder valueBody(Function> fn) { + return valueBody(fn.apply(new SegmentReplicationRecord.Builder()).build()); + } + + /** + * Builds a {@link SegmentReplicationResponse}. + * + * @throws NullPointerException if some of the required fields are null. + */ + @Override + @Nonnull + public SegmentReplicationResponse build() { + _checkSingleUse(); + + return new SegmentReplicationResponse(this); + } + } + + public static final JsonpDeserializer _DESERIALIZER = createSegmentReplicationResponseDeserializer(); + + protected static JsonpDeserializer createSegmentReplicationResponseDeserializer() { + JsonpDeserializer> valueDeserializer = JsonpDeserializer.arrayDeserializer( + SegmentReplicationRecord._DESERIALIZER + ); + + return JsonpDeserializer.of( + valueDeserializer.acceptedEvents(), + (parser, mapper) -> new Builder().valueBody(valueDeserializer.deserialize(parser, mapper)).build() + ); + } +} diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/cat/segment_replication/SegmentReplicationRecord.java b/java-client/src/generated/java/org/opensearch/client/opensearch/cat/segment_replication/SegmentReplicationRecord.java new file mode 100644 index 0000000000..7b7cfaabf9 --- /dev/null +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/cat/segment_replication/SegmentReplicationRecord.java @@ -0,0 +1,982 @@ +/* + * SPDX-License-Identifier: Apache-2.0 + * + * The OpenSearch Contributors require contributions made to + * this file be licensed under the Apache-2.0 license or a + * compatible open source license. + */ + +/* + * Licensed to Elasticsearch B.V. under one or more contributor + * license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright + * ownership. Elasticsearch B.V. licenses this file to you under + * the Apache License, Version 2.0 (the "License"); you may + * not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +/* + * Modifications Copyright OpenSearch Contributors. See + * GitHub history for details. + */ + +//---------------------------------------------------- +// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. +//---------------------------------------------------- + +package org.opensearch.client.opensearch.cat.segment_replication; + +import jakarta.json.stream.JsonGenerator; +import java.util.Objects; +import java.util.function.Function; +import javax.annotation.Generated; +import javax.annotation.Nonnull; +import javax.annotation.Nullable; +import org.opensearch.client.json.JsonpDeserializable; +import org.opensearch.client.json.JsonpDeserializer; +import org.opensearch.client.json.JsonpMapper; +import org.opensearch.client.json.ObjectBuilderDeserializer; +import org.opensearch.client.json.ObjectDeserializer; +import org.opensearch.client.json.PlainJsonSerializable; +import org.opensearch.client.util.CopyableBuilder; +import org.opensearch.client.util.ObjectBuilder; +import org.opensearch.client.util.ObjectBuilderBase; +import org.opensearch.client.util.ToCopyableBuilder; + +// typedef: cat.segment_replication.SegmentReplicationRecord + +@JsonpDeserializable +@Generated("org.opensearch.client.codegen.CodeGenerator") +public class SegmentReplicationRecord + implements + PlainJsonSerializable, + ToCopyableBuilder { + + @Nullable + private final String bytes; + + @Nullable + private final String bytesBehind; + + @Nullable + private final String bytesFetched; + + @Nullable + private final String bytesPercent; + + @Nullable + private final String bytesTotal; + + @Nullable + private final String checkpointsBehind; + + @Nullable + private final String currentLag; + + @Nullable + private final String fileDiffStageTimeTaken; + + @Nullable + private final String files; + + @Nullable + private final String filesFetched; + + @Nullable + private final String filesPercent; + + @Nullable + private final String filesTotal; + + @Nullable + private final String finalizeReplicationStageTimeTaken; + + @Nullable + private final String getCheckpointInfoStageTimeTaken; + + @Nullable + private final String getFilesStageTimeTaken; + + @Nullable + private final String lastCompletedLag; + + @Nullable + private final String rejectedRequests; + + @Nullable + private final String replicatingStageTimeTaken; + + @Nullable + private final String shardId; + + @Nullable + private final String stage; + + @Nullable + private final String startTime; + + @Nullable + private final String stopTime; + + @Nullable + private final String targetHost; + + @Nullable + private final String targetNode; + + @Nullable + private final String time; + + // --------------------------------------------------------------------------------------------- + + private SegmentReplicationRecord(Builder builder) { + this.bytes = builder.bytes; + this.bytesBehind = builder.bytesBehind; + this.bytesFetched = builder.bytesFetched; + this.bytesPercent = builder.bytesPercent; + this.bytesTotal = builder.bytesTotal; + this.checkpointsBehind = builder.checkpointsBehind; + this.currentLag = builder.currentLag; + this.fileDiffStageTimeTaken = builder.fileDiffStageTimeTaken; + this.files = builder.files; + this.filesFetched = builder.filesFetched; + this.filesPercent = builder.filesPercent; + this.filesTotal = builder.filesTotal; + this.finalizeReplicationStageTimeTaken = builder.finalizeReplicationStageTimeTaken; + this.getCheckpointInfoStageTimeTaken = builder.getCheckpointInfoStageTimeTaken; + this.getFilesStageTimeTaken = builder.getFilesStageTimeTaken; + this.lastCompletedLag = builder.lastCompletedLag; + this.rejectedRequests = builder.rejectedRequests; + this.replicatingStageTimeTaken = builder.replicatingStageTimeTaken; + this.shardId = builder.shardId; + this.stage = builder.stage; + this.startTime = builder.startTime; + this.stopTime = builder.stopTime; + this.targetHost = builder.targetHost; + this.targetNode = builder.targetNode; + this.time = builder.time; + } + + public static SegmentReplicationRecord of(Function> fn) { + return fn.apply(new Builder()).build(); + } + + /** + * API name: {@code bytes} + */ + @Nullable + public final String bytes() { + return this.bytes; + } + + /** + * API name: {@code bytes_behind} + */ + @Nullable + public final String bytesBehind() { + return this.bytesBehind; + } + + /** + * API name: {@code bytes_fetched} + */ + @Nullable + public final String bytesFetched() { + return this.bytesFetched; + } + + /** + * API name: {@code bytes_percent} + */ + @Nullable + public final String bytesPercent() { + return this.bytesPercent; + } + + /** + * API name: {@code bytes_total} + */ + @Nullable + public final String bytesTotal() { + return this.bytesTotal; + } + + /** + * API name: {@code checkpoints_behind} + */ + @Nullable + public final String checkpointsBehind() { + return this.checkpointsBehind; + } + + /** + * API name: {@code current_lag} + */ + @Nullable + public final String currentLag() { + return this.currentLag; + } + + /** + * API name: {@code file_diff_stage_time_taken} + */ + @Nullable + public final String fileDiffStageTimeTaken() { + return this.fileDiffStageTimeTaken; + } + + /** + * API name: {@code files} + */ + @Nullable + public final String files() { + return this.files; + } + + /** + * API name: {@code files_fetched} + */ + @Nullable + public final String filesFetched() { + return this.filesFetched; + } + + /** + * API name: {@code files_percent} + */ + @Nullable + public final String filesPercent() { + return this.filesPercent; + } + + /** + * API name: {@code files_total} + */ + @Nullable + public final String filesTotal() { + return this.filesTotal; + } + + /** + * API name: {@code finalize_replication_stage_time_taken} + */ + @Nullable + public final String finalizeReplicationStageTimeTaken() { + return this.finalizeReplicationStageTimeTaken; + } + + /** + * API name: {@code get_checkpoint_info_stage_time_taken} + */ + @Nullable + public final String getCheckpointInfoStageTimeTaken() { + return this.getCheckpointInfoStageTimeTaken; + } + + /** + * API name: {@code get_files_stage_time_taken} + */ + @Nullable + public final String getFilesStageTimeTaken() { + return this.getFilesStageTimeTaken; + } + + /** + * API name: {@code last_completed_lag} + */ + @Nullable + public final String lastCompletedLag() { + return this.lastCompletedLag; + } + + /** + * API name: {@code rejected_requests} + */ + @Nullable + public final String rejectedRequests() { + return this.rejectedRequests; + } + + /** + * API name: {@code replicating_stage_time_taken} + */ + @Nullable + public final String replicatingStageTimeTaken() { + return this.replicatingStageTimeTaken; + } + + /** + * API name: {@code shardId} + */ + @Nullable + public final String shardId() { + return this.shardId; + } + + /** + * API name: {@code stage} + */ + @Nullable + public final String stage() { + return this.stage; + } + + /** + * API name: {@code start_time} + */ + @Nullable + public final String startTime() { + return this.startTime; + } + + /** + * API name: {@code stop_time} + */ + @Nullable + public final String stopTime() { + return this.stopTime; + } + + /** + * API name: {@code target_host} + */ + @Nullable + public final String targetHost() { + return this.targetHost; + } + + /** + * API name: {@code target_node} + */ + @Nullable + public final String targetNode() { + return this.targetNode; + } + + /** + * API name: {@code time} + */ + @Nullable + public final String time() { + return this.time; + } + + /** + * Serialize this object to JSON. + */ + @Override + public void serialize(JsonGenerator generator, JsonpMapper mapper) { + generator.writeStartObject(); + serializeInternal(generator, mapper); + generator.writeEnd(); + } + + protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { + if (this.bytes != null) { + generator.writeKey("bytes"); + generator.write(this.bytes); + } + + if (this.bytesBehind != null) { + generator.writeKey("bytes_behind"); + generator.write(this.bytesBehind); + } + + if (this.bytesFetched != null) { + generator.writeKey("bytes_fetched"); + generator.write(this.bytesFetched); + } + + if (this.bytesPercent != null) { + generator.writeKey("bytes_percent"); + generator.write(this.bytesPercent); + } + + if (this.bytesTotal != null) { + generator.writeKey("bytes_total"); + generator.write(this.bytesTotal); + } + + if (this.checkpointsBehind != null) { + generator.writeKey("checkpoints_behind"); + generator.write(this.checkpointsBehind); + } + + if (this.currentLag != null) { + generator.writeKey("current_lag"); + generator.write(this.currentLag); + } + + if (this.fileDiffStageTimeTaken != null) { + generator.writeKey("file_diff_stage_time_taken"); + generator.write(this.fileDiffStageTimeTaken); + } + + if (this.files != null) { + generator.writeKey("files"); + generator.write(this.files); + } + + if (this.filesFetched != null) { + generator.writeKey("files_fetched"); + generator.write(this.filesFetched); + } + + if (this.filesPercent != null) { + generator.writeKey("files_percent"); + generator.write(this.filesPercent); + } + + if (this.filesTotal != null) { + generator.writeKey("files_total"); + generator.write(this.filesTotal); + } + + if (this.finalizeReplicationStageTimeTaken != null) { + generator.writeKey("finalize_replication_stage_time_taken"); + generator.write(this.finalizeReplicationStageTimeTaken); + } + + if (this.getCheckpointInfoStageTimeTaken != null) { + generator.writeKey("get_checkpoint_info_stage_time_taken"); + generator.write(this.getCheckpointInfoStageTimeTaken); + } + + if (this.getFilesStageTimeTaken != null) { + generator.writeKey("get_files_stage_time_taken"); + generator.write(this.getFilesStageTimeTaken); + } + + if (this.lastCompletedLag != null) { + generator.writeKey("last_completed_lag"); + generator.write(this.lastCompletedLag); + } + + if (this.rejectedRequests != null) { + generator.writeKey("rejected_requests"); + generator.write(this.rejectedRequests); + } + + if (this.replicatingStageTimeTaken != null) { + generator.writeKey("replicating_stage_time_taken"); + generator.write(this.replicatingStageTimeTaken); + } + + if (this.shardId != null) { + generator.writeKey("shardId"); + generator.write(this.shardId); + } + + if (this.stage != null) { + generator.writeKey("stage"); + generator.write(this.stage); + } + + if (this.startTime != null) { + generator.writeKey("start_time"); + generator.write(this.startTime); + } + + if (this.stopTime != null) { + generator.writeKey("stop_time"); + generator.write(this.stopTime); + } + + if (this.targetHost != null) { + generator.writeKey("target_host"); + generator.write(this.targetHost); + } + + if (this.targetNode != null) { + generator.writeKey("target_node"); + generator.write(this.targetNode); + } + + if (this.time != null) { + generator.writeKey("time"); + generator.write(this.time); + } + } + + // --------------------------------------------------------------------------------------------- + + @Override + @Nonnull + public Builder toBuilder() { + return new Builder(this); + } + + @Nonnull + public static Builder builder() { + return new Builder(); + } + + /** + * Builder for {@link SegmentReplicationRecord}. + */ + public static class Builder extends ObjectBuilderBase implements CopyableBuilder { + @Nullable + private String bytes; + @Nullable + private String bytesBehind; + @Nullable + private String bytesFetched; + @Nullable + private String bytesPercent; + @Nullable + private String bytesTotal; + @Nullable + private String checkpointsBehind; + @Nullable + private String currentLag; + @Nullable + private String fileDiffStageTimeTaken; + @Nullable + private String files; + @Nullable + private String filesFetched; + @Nullable + private String filesPercent; + @Nullable + private String filesTotal; + @Nullable + private String finalizeReplicationStageTimeTaken; + @Nullable + private String getCheckpointInfoStageTimeTaken; + @Nullable + private String getFilesStageTimeTaken; + @Nullable + private String lastCompletedLag; + @Nullable + private String rejectedRequests; + @Nullable + private String replicatingStageTimeTaken; + @Nullable + private String shardId; + @Nullable + private String stage; + @Nullable + private String startTime; + @Nullable + private String stopTime; + @Nullable + private String targetHost; + @Nullable + private String targetNode; + @Nullable + private String time; + + public Builder() {} + + private Builder(SegmentReplicationRecord o) { + this.bytes = o.bytes; + this.bytesBehind = o.bytesBehind; + this.bytesFetched = o.bytesFetched; + this.bytesPercent = o.bytesPercent; + this.bytesTotal = o.bytesTotal; + this.checkpointsBehind = o.checkpointsBehind; + this.currentLag = o.currentLag; + this.fileDiffStageTimeTaken = o.fileDiffStageTimeTaken; + this.files = o.files; + this.filesFetched = o.filesFetched; + this.filesPercent = o.filesPercent; + this.filesTotal = o.filesTotal; + this.finalizeReplicationStageTimeTaken = o.finalizeReplicationStageTimeTaken; + this.getCheckpointInfoStageTimeTaken = o.getCheckpointInfoStageTimeTaken; + this.getFilesStageTimeTaken = o.getFilesStageTimeTaken; + this.lastCompletedLag = o.lastCompletedLag; + this.rejectedRequests = o.rejectedRequests; + this.replicatingStageTimeTaken = o.replicatingStageTimeTaken; + this.shardId = o.shardId; + this.stage = o.stage; + this.startTime = o.startTime; + this.stopTime = o.stopTime; + this.targetHost = o.targetHost; + this.targetNode = o.targetNode; + this.time = o.time; + } + + private Builder(Builder o) { + this.bytes = o.bytes; + this.bytesBehind = o.bytesBehind; + this.bytesFetched = o.bytesFetched; + this.bytesPercent = o.bytesPercent; + this.bytesTotal = o.bytesTotal; + this.checkpointsBehind = o.checkpointsBehind; + this.currentLag = o.currentLag; + this.fileDiffStageTimeTaken = o.fileDiffStageTimeTaken; + this.files = o.files; + this.filesFetched = o.filesFetched; + this.filesPercent = o.filesPercent; + this.filesTotal = o.filesTotal; + this.finalizeReplicationStageTimeTaken = o.finalizeReplicationStageTimeTaken; + this.getCheckpointInfoStageTimeTaken = o.getCheckpointInfoStageTimeTaken; + this.getFilesStageTimeTaken = o.getFilesStageTimeTaken; + this.lastCompletedLag = o.lastCompletedLag; + this.rejectedRequests = o.rejectedRequests; + this.replicatingStageTimeTaken = o.replicatingStageTimeTaken; + this.shardId = o.shardId; + this.stage = o.stage; + this.startTime = o.startTime; + this.stopTime = o.stopTime; + this.targetHost = o.targetHost; + this.targetNode = o.targetNode; + this.time = o.time; + } + + @Override + @Nonnull + public Builder copy() { + return new Builder(this); + } + + /** + * API name: {@code bytes} + */ + @Nonnull + public final Builder bytes(@Nullable String value) { + this.bytes = value; + return this; + } + + /** + * API name: {@code bytes_behind} + */ + @Nonnull + public final Builder bytesBehind(@Nullable String value) { + this.bytesBehind = value; + return this; + } + + /** + * API name: {@code bytes_fetched} + */ + @Nonnull + public final Builder bytesFetched(@Nullable String value) { + this.bytesFetched = value; + return this; + } + + /** + * API name: {@code bytes_percent} + */ + @Nonnull + public final Builder bytesPercent(@Nullable String value) { + this.bytesPercent = value; + return this; + } + + /** + * API name: {@code bytes_total} + */ + @Nonnull + public final Builder bytesTotal(@Nullable String value) { + this.bytesTotal = value; + return this; + } + + /** + * API name: {@code checkpoints_behind} + */ + @Nonnull + public final Builder checkpointsBehind(@Nullable String value) { + this.checkpointsBehind = value; + return this; + } + + /** + * API name: {@code current_lag} + */ + @Nonnull + public final Builder currentLag(@Nullable String value) { + this.currentLag = value; + return this; + } + + /** + * API name: {@code file_diff_stage_time_taken} + */ + @Nonnull + public final Builder fileDiffStageTimeTaken(@Nullable String value) { + this.fileDiffStageTimeTaken = value; + return this; + } + + /** + * API name: {@code files} + */ + @Nonnull + public final Builder files(@Nullable String value) { + this.files = value; + return this; + } + + /** + * API name: {@code files_fetched} + */ + @Nonnull + public final Builder filesFetched(@Nullable String value) { + this.filesFetched = value; + return this; + } + + /** + * API name: {@code files_percent} + */ + @Nonnull + public final Builder filesPercent(@Nullable String value) { + this.filesPercent = value; + return this; + } + + /** + * API name: {@code files_total} + */ + @Nonnull + public final Builder filesTotal(@Nullable String value) { + this.filesTotal = value; + return this; + } + + /** + * API name: {@code finalize_replication_stage_time_taken} + */ + @Nonnull + public final Builder finalizeReplicationStageTimeTaken(@Nullable String value) { + this.finalizeReplicationStageTimeTaken = value; + return this; + } + + /** + * API name: {@code get_checkpoint_info_stage_time_taken} + */ + @Nonnull + public final Builder getCheckpointInfoStageTimeTaken(@Nullable String value) { + this.getCheckpointInfoStageTimeTaken = value; + return this; + } + + /** + * API name: {@code get_files_stage_time_taken} + */ + @Nonnull + public final Builder getFilesStageTimeTaken(@Nullable String value) { + this.getFilesStageTimeTaken = value; + return this; + } + + /** + * API name: {@code last_completed_lag} + */ + @Nonnull + public final Builder lastCompletedLag(@Nullable String value) { + this.lastCompletedLag = value; + return this; + } + + /** + * API name: {@code rejected_requests} + */ + @Nonnull + public final Builder rejectedRequests(@Nullable String value) { + this.rejectedRequests = value; + return this; + } + + /** + * API name: {@code replicating_stage_time_taken} + */ + @Nonnull + public final Builder replicatingStageTimeTaken(@Nullable String value) { + this.replicatingStageTimeTaken = value; + return this; + } + + /** + * API name: {@code shardId} + */ + @Nonnull + public final Builder shardId(@Nullable String value) { + this.shardId = value; + return this; + } + + /** + * API name: {@code stage} + */ + @Nonnull + public final Builder stage(@Nullable String value) { + this.stage = value; + return this; + } + + /** + * API name: {@code start_time} + */ + @Nonnull + public final Builder startTime(@Nullable String value) { + this.startTime = value; + return this; + } + + /** + * API name: {@code stop_time} + */ + @Nonnull + public final Builder stopTime(@Nullable String value) { + this.stopTime = value; + return this; + } + + /** + * API name: {@code target_host} + */ + @Nonnull + public final Builder targetHost(@Nullable String value) { + this.targetHost = value; + return this; + } + + /** + * API name: {@code target_node} + */ + @Nonnull + public final Builder targetNode(@Nullable String value) { + this.targetNode = value; + return this; + } + + /** + * API name: {@code time} + */ + @Nonnull + public final Builder time(@Nullable String value) { + this.time = value; + return this; + } + + /** + * Builds a {@link SegmentReplicationRecord}. + * + * @throws NullPointerException if some of the required fields are null. + */ + @Override + @Nonnull + public SegmentReplicationRecord build() { + _checkSingleUse(); + + return new SegmentReplicationRecord(this); + } + } + + // --------------------------------------------------------------------------------------------- + + /** + * Json deserializer for {@link SegmentReplicationRecord} + */ + public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer.lazy( + Builder::new, + SegmentReplicationRecord::setupSegmentReplicationRecordDeserializer + ); + + protected static void setupSegmentReplicationRecordDeserializer(ObjectDeserializer op) { + op.add(Builder::bytes, JsonpDeserializer.stringDeserializer(), "bytes"); + op.add(Builder::bytesBehind, JsonpDeserializer.stringDeserializer(), "bytes_behind"); + op.add(Builder::bytesFetched, JsonpDeserializer.stringDeserializer(), "bytes_fetched"); + op.add(Builder::bytesPercent, JsonpDeserializer.stringDeserializer(), "bytes_percent"); + op.add(Builder::bytesTotal, JsonpDeserializer.stringDeserializer(), "bytes_total"); + op.add(Builder::checkpointsBehind, JsonpDeserializer.stringDeserializer(), "checkpoints_behind"); + op.add(Builder::currentLag, JsonpDeserializer.stringDeserializer(), "current_lag"); + op.add(Builder::fileDiffStageTimeTaken, JsonpDeserializer.stringDeserializer(), "file_diff_stage_time_taken"); + op.add(Builder::files, JsonpDeserializer.stringDeserializer(), "files"); + op.add(Builder::filesFetched, JsonpDeserializer.stringDeserializer(), "files_fetched"); + op.add(Builder::filesPercent, JsonpDeserializer.stringDeserializer(), "files_percent"); + op.add(Builder::filesTotal, JsonpDeserializer.stringDeserializer(), "files_total"); + op.add(Builder::finalizeReplicationStageTimeTaken, JsonpDeserializer.stringDeserializer(), "finalize_replication_stage_time_taken"); + op.add(Builder::getCheckpointInfoStageTimeTaken, JsonpDeserializer.stringDeserializer(), "get_checkpoint_info_stage_time_taken"); + op.add(Builder::getFilesStageTimeTaken, JsonpDeserializer.stringDeserializer(), "get_files_stage_time_taken"); + op.add(Builder::lastCompletedLag, JsonpDeserializer.stringDeserializer(), "last_completed_lag"); + op.add(Builder::rejectedRequests, JsonpDeserializer.stringDeserializer(), "rejected_requests"); + op.add(Builder::replicatingStageTimeTaken, JsonpDeserializer.stringDeserializer(), "replicating_stage_time_taken"); + op.add(Builder::shardId, JsonpDeserializer.stringDeserializer(), "shardId"); + op.add(Builder::stage, JsonpDeserializer.stringDeserializer(), "stage"); + op.add(Builder::startTime, JsonpDeserializer.stringDeserializer(), "start_time"); + op.add(Builder::stopTime, JsonpDeserializer.stringDeserializer(), "stop_time"); + op.add(Builder::targetHost, JsonpDeserializer.stringDeserializer(), "target_host"); + op.add(Builder::targetNode, JsonpDeserializer.stringDeserializer(), "target_node"); + op.add(Builder::time, JsonpDeserializer.stringDeserializer(), "time"); + } + + @Override + public int hashCode() { + int result = 17; + result = 31 * result + Objects.hashCode(this.bytes); + result = 31 * result + Objects.hashCode(this.bytesBehind); + result = 31 * result + Objects.hashCode(this.bytesFetched); + result = 31 * result + Objects.hashCode(this.bytesPercent); + result = 31 * result + Objects.hashCode(this.bytesTotal); + result = 31 * result + Objects.hashCode(this.checkpointsBehind); + result = 31 * result + Objects.hashCode(this.currentLag); + result = 31 * result + Objects.hashCode(this.fileDiffStageTimeTaken); + result = 31 * result + Objects.hashCode(this.files); + result = 31 * result + Objects.hashCode(this.filesFetched); + result = 31 * result + Objects.hashCode(this.filesPercent); + result = 31 * result + Objects.hashCode(this.filesTotal); + result = 31 * result + Objects.hashCode(this.finalizeReplicationStageTimeTaken); + result = 31 * result + Objects.hashCode(this.getCheckpointInfoStageTimeTaken); + result = 31 * result + Objects.hashCode(this.getFilesStageTimeTaken); + result = 31 * result + Objects.hashCode(this.lastCompletedLag); + result = 31 * result + Objects.hashCode(this.rejectedRequests); + result = 31 * result + Objects.hashCode(this.replicatingStageTimeTaken); + result = 31 * result + Objects.hashCode(this.shardId); + result = 31 * result + Objects.hashCode(this.stage); + result = 31 * result + Objects.hashCode(this.startTime); + result = 31 * result + Objects.hashCode(this.stopTime); + result = 31 * result + Objects.hashCode(this.targetHost); + result = 31 * result + Objects.hashCode(this.targetNode); + result = 31 * result + Objects.hashCode(this.time); + return result; + } + + @Override + public boolean equals(Object o) { + if (this == o) return true; + if (o == null || this.getClass() != o.getClass()) return false; + SegmentReplicationRecord other = (SegmentReplicationRecord) o; + return Objects.equals(this.bytes, other.bytes) + && Objects.equals(this.bytesBehind, other.bytesBehind) + && Objects.equals(this.bytesFetched, other.bytesFetched) + && Objects.equals(this.bytesPercent, other.bytesPercent) + && Objects.equals(this.bytesTotal, other.bytesTotal) + && Objects.equals(this.checkpointsBehind, other.checkpointsBehind) + && Objects.equals(this.currentLag, other.currentLag) + && Objects.equals(this.fileDiffStageTimeTaken, other.fileDiffStageTimeTaken) + && Objects.equals(this.files, other.files) + && Objects.equals(this.filesFetched, other.filesFetched) + && Objects.equals(this.filesPercent, other.filesPercent) + && Objects.equals(this.filesTotal, other.filesTotal) + && Objects.equals(this.finalizeReplicationStageTimeTaken, other.finalizeReplicationStageTimeTaken) + && Objects.equals(this.getCheckpointInfoStageTimeTaken, other.getCheckpointInfoStageTimeTaken) + && Objects.equals(this.getFilesStageTimeTaken, other.getFilesStageTimeTaken) + && Objects.equals(this.lastCompletedLag, other.lastCompletedLag) + && Objects.equals(this.rejectedRequests, other.rejectedRequests) + && Objects.equals(this.replicatingStageTimeTaken, other.replicatingStageTimeTaken) + && Objects.equals(this.shardId, other.shardId) + && Objects.equals(this.stage, other.stage) + && Objects.equals(this.startTime, other.startTime) + && Objects.equals(this.stopTime, other.stopTime) + && Objects.equals(this.targetHost, other.targetHost) + && Objects.equals(this.targetNode, other.targetNode) + && Objects.equals(this.time, other.time); + } +} diff --git a/java-client/src/main/java/org/opensearch/client/opensearch/cat/CatRequestBase.java b/java-client/src/main/java/org/opensearch/client/opensearch/cat/CatRequestBase.java index ff8dc6d734..ec92b463a9 100644 --- a/java-client/src/main/java/org/opensearch/client/opensearch/cat/CatRequestBase.java +++ b/java-client/src/main/java/org/opensearch/client/opensearch/cat/CatRequestBase.java @@ -82,12 +82,6 @@ public final List sort() { return this.sort; } - // TODO: remove me once all cat operations are generated - protected abstract static class CatRequestBaseBuilder> extends AbstractBuilder< - BuilderT> implements ObjectBuilder { - - } - protected abstract static class AbstractBuilder> extends RequestBase.AbstractBuilder< BuilderT> { @Nullable @@ -169,11 +163,4 @@ protected void applyQueryParameters(@Nonnull Map params) { } params.put("format", "json"); } - - // TODO: remove me once all cat operations are generated - protected final Map queryParameters() { - Map params = new HashMap<>(); - applyQueryParameters(params); - return params; - } } diff --git a/java-client/src/main/java/org/opensearch/client/opensearch/cat/HelpRequest.java b/java-client/src/main/java/org/opensearch/client/opensearch/cat/HelpRequest.java index 6233c3661c..43621ca780 100644 --- a/java-client/src/main/java/org/opensearch/client/opensearch/cat/HelpRequest.java +++ b/java-client/src/main/java/org/opensearch/client/opensearch/cat/HelpRequest.java @@ -32,7 +32,6 @@ package org.opensearch.client.opensearch.cat; -import java.util.HashMap; import org.opensearch.client.opensearch._types.ErrorResponse; import org.opensearch.client.transport.Endpoint; import org.opensearch.client.transport.endpoints.SimpleEndpoint; @@ -57,21 +56,11 @@ public HelpRequest() {} * Endpoint "{@code cat.help}". */ public static final Endpoint _ENDPOINT = new SimpleEndpoint<>( - // Request method - request -> { - return "GET"; - - }, - + request -> "GET", // Request path - request -> { - return "/_cat"; - - }, - - // Request parameters - request -> new HashMap<>(request.queryParameters()), + request -> "/_cat", + SimpleEndpoint.emptyMap(), SimpleEndpoint.emptyMap(), false, HelpResponse._DESERIALIZER diff --git a/java-client/src/main/java/org/opensearch/client/opensearch/cat/OpenSearchCatAsyncClient.java b/java-client/src/main/java/org/opensearch/client/opensearch/cat/OpenSearchCatAsyncClient.java index d97838d8c0..f815262a44 100644 --- a/java-client/src/main/java/org/opensearch/client/opensearch/cat/OpenSearchCatAsyncClient.java +++ b/java-client/src/main/java/org/opensearch/client/opensearch/cat/OpenSearchCatAsyncClient.java @@ -34,14 +34,10 @@ import java.io.IOException; import java.util.concurrent.CompletableFuture; -import java.util.function.Function; import javax.annotation.Nullable; -import org.opensearch.client.opensearch._types.ErrorResponse; import org.opensearch.client.opensearch._types.OpenSearchException; -import org.opensearch.client.transport.JsonEndpoint; import org.opensearch.client.transport.OpenSearchTransport; import org.opensearch.client.transport.TransportOptions; -import org.opensearch.client.util.ObjectBuilder; /** * Client for the cat namespace. diff --git a/java-client/src/main/java/org/opensearch/client/opensearch/cat/OpenSearchCatClient.java b/java-client/src/main/java/org/opensearch/client/opensearch/cat/OpenSearchCatClient.java index ee49ba7ebd..d9bc88a002 100644 --- a/java-client/src/main/java/org/opensearch/client/opensearch/cat/OpenSearchCatClient.java +++ b/java-client/src/main/java/org/opensearch/client/opensearch/cat/OpenSearchCatClient.java @@ -33,14 +33,10 @@ package org.opensearch.client.opensearch.cat; import java.io.IOException; -import java.util.function.Function; import javax.annotation.Nullable; -import org.opensearch.client.opensearch._types.ErrorResponse; import org.opensearch.client.opensearch._types.OpenSearchException; -import org.opensearch.client.transport.JsonEndpoint; import org.opensearch.client.transport.OpenSearchTransport; import org.opensearch.client.transport.TransportOptions; -import org.opensearch.client.util.ObjectBuilder; /** * Client for the cat namespace. diff --git a/java-codegen/opensearch-openapi.yaml b/java-codegen/opensearch-openapi.yaml index 1fb4c3a7d5..5c36b1df67 100644 --- a/java-codegen/opensearch-openapi.yaml +++ b/java-codegen/opensearch-openapi.yaml @@ -28806,7 +28806,7 @@ components: schema: type: array items: - $ref: '#/components/schemas/cat._common___CatSegmentReplicationRecord' + $ref: '#/components/schemas/cat.segment_replication___SegmentReplicationRecord' description: '' cat.segments___200: content: @@ -46114,59 +46114,6 @@ components: type: object additionalProperties: $ref: '#/components/schemas/asynchronous_search._common___NodesStats' - cat._common___CatSegmentReplicationRecord: - type: object - properties: - shardId: - type: string - target_node: - type: string - target_host: - type: string - checkpoints_behind: - type: string - bytes_behind: - type: string - current_lag: - type: string - last_completed_lag: - type: string - rejected_requests: - type: string - stage: - type: string - time: - type: string - files_fetched: - type: string - files_percent: - $ref: '#/components/schemas/_common___PercentageString' - bytes_fetched: - type: string - bytes_percent: - $ref: '#/components/schemas/_common___PercentageString' - start_time: - type: string - stop_time: - type: string - files: - type: string - files_total: - type: string - bytes: - type: string - bytes_total: - type: string - replicating_stage_time_taken: - type: string - get_checkpoint_info_stage_time_taken: - type: string - file_diff_stage_time_taken: - type: string - get_files_stage_time_taken: - type: string - finalize_replication_stage_time_taken: - type: string cat.aliases___AliasesRecord: type: object properties: @@ -47495,6 +47442,59 @@ components: type: description: The repository type. type: string + cat.segment_replication___SegmentReplicationRecord: + type: object + properties: + shardId: + type: string + target_node: + type: string + target_host: + type: string + checkpoints_behind: + type: string + bytes_behind: + type: string + current_lag: + type: string + last_completed_lag: + type: string + rejected_requests: + type: string + stage: + type: string + time: + type: string + files_fetched: + type: string + files_percent: + $ref: '#/components/schemas/_common___PercentageString' + bytes_fetched: + type: string + bytes_percent: + $ref: '#/components/schemas/_common___PercentageString' + start_time: + type: string + stop_time: + type: string + files: + type: string + files_total: + type: string + bytes: + type: string + bytes_total: + type: string + replicating_stage_time_taken: + type: string + get_checkpoint_info_stage_time_taken: + type: string + file_diff_stage_time_taken: + type: string + get_files_stage_time_taken: + type: string + finalize_replication_stage_time_taken: + type: string cat.segments___SegmentsRecord: type: object properties: diff --git a/java-codegen/src/main/java/org/opensearch/client/codegen/CodeGenerator.java b/java-codegen/src/main/java/org/opensearch/client/codegen/CodeGenerator.java index 44ac61f340..67de77db58 100644 --- a/java-codegen/src/main/java/org/opensearch/client/codegen/CodeGenerator.java +++ b/java-codegen/src/main/java/org/opensearch/client/codegen/CodeGenerator.java @@ -48,35 +48,7 @@ public class CodeGenerator { private static final Logger LOGGER = LogManager.getLogger(); private static final Matcher OPERATION_MATCHER = or( and(namespace(isNull()), name(is("info"))), - and( - namespace(is("cat")), - name( - isOneOf( - "aliases", - "all_pit_segments", - "allocation", - "cluster_manager", - "count", - "fielddata", - "health", - "indices", - "master", - "nodeattrs", - "nodes", - "pending_tasks", - "pit_segments", - "plugins", - "recovery", - "repositories", - "segments", - "shards", - "snapshots", - "tasks", - "templates", - "thread_pool" - ) - ) - ), + and(namespace(is("cat")), name(isNot("help"))), and( namespace(is("cluster")), name( From 5cd5d2e24837f7ced196b7e9e4907024e9592b1a Mon Sep 17 00:00:00 2001 From: Thomas Farr Date: Tue, 7 Jan 2025 22:58:19 +1300 Subject: [PATCH 15/18] Fix build Signed-off-by: Thomas Farr --- .../opensearch/client/opensearch/cat/CatRequestBase.java | 2 -- .../org/opensearch/client/opensearch/model/EnumTest.java | 6 +++--- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/java-client/src/main/java/org/opensearch/client/opensearch/cat/CatRequestBase.java b/java-client/src/main/java/org/opensearch/client/opensearch/cat/CatRequestBase.java index ec92b463a9..1aa6473fa7 100644 --- a/java-client/src/main/java/org/opensearch/client/opensearch/cat/CatRequestBase.java +++ b/java-client/src/main/java/org/opensearch/client/opensearch/cat/CatRequestBase.java @@ -32,14 +32,12 @@ package org.opensearch.client.opensearch.cat; -import java.util.HashMap; import java.util.List; import java.util.Map; import javax.annotation.Nonnull; import javax.annotation.Nullable; import org.opensearch.client.opensearch._types.RequestBase; import org.opensearch.client.util.ApiTypeHelper; -import org.opensearch.client.util.ObjectBuilder; // typedef: cat._types.CatRequestBase diff --git a/java-client/src/test/java/org/opensearch/client/opensearch/model/EnumTest.java b/java-client/src/test/java/org/opensearch/client/opensearch/model/EnumTest.java index e62d4cdf06..a8647f8c94 100644 --- a/java-client/src/test/java/org/opensearch/client/opensearch/model/EnumTest.java +++ b/java-client/src/test/java/org/opensearch/client/opensearch/model/EnumTest.java @@ -34,7 +34,7 @@ import java.util.Arrays; import org.junit.Test; -import org.opensearch.client.opensearch._types.Bytes; +import org.opensearch.client.opensearch._types.DistanceUnit; import org.opensearch.client.opensearch._types.mapping.DynamicMapping; import org.opensearch.client.opensearch._types.mapping.GeoOrientation; @@ -42,8 +42,8 @@ public class EnumTest extends ModelTestCase { @Test public void testSimpleEnum() { - assertNull(Bytes.GigaBytes.aliases()); - assertEquals(Bytes.GigaBytes, Bytes._DESERIALIZER.parse("gb")); + assertNull(DistanceUnit.Meters.aliases()); + assertEquals(DistanceUnit.Meters, DistanceUnit._DESERIALIZER.parse("m")); } @Test From 2580e8f937c874100f0488b0264a88a4544bd736 Mon Sep 17 00:00:00 2001 From: Thomas Farr Date: Tue, 7 Jan 2025 23:14:17 +1300 Subject: [PATCH 16/18] Fix tests Signed-off-by: Thomas Farr --- .../opensearch/integTest/AbstractCatClientIT.java | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/java-client/src/test/java11/org/opensearch/client/opensearch/integTest/AbstractCatClientIT.java b/java-client/src/test/java11/org/opensearch/client/opensearch/integTest/AbstractCatClientIT.java index dcc626fe44..895ac297b5 100644 --- a/java-client/src/test/java11/org/opensearch/client/opensearch/integTest/AbstractCatClientIT.java +++ b/java-client/src/test/java11/org/opensearch/client/opensearch/integTest/AbstractCatClientIT.java @@ -22,6 +22,7 @@ import org.opensearch.client.opensearch.cat.AllocationResponse; import org.opensearch.client.opensearch.cat.IndicesResponse; import org.opensearch.client.opensearch.cat.NodesResponse; +import org.opensearch.client.opensearch.cat.PitSegmentsResponse; import org.opensearch.client.opensearch.cat.PluginsResponse; import org.opensearch.client.opensearch.cat.RecoveryResponse; import org.opensearch.client.opensearch.cat.SegmentsResponse; @@ -252,14 +253,14 @@ public void testCatPitSegments() throws Exception { createPit("cat-pit-segments-test-index"); - SegmentsResponse PitSegmentsResponse = javaClient().cat().pitSegments(r -> r.headers("index,shard,id,segment,size")); + PitSegmentsResponse pitSegmentsResponse = javaClient().cat().pitSegments(r -> r.headers("index,shard,id,segment,size")); - assertNotNull("PitSegmentsResponse.segments() is null", PitSegmentsResponse.valueBody()); + assertNotNull("pitSegmentsResponse.segments() is null", pitSegmentsResponse.valueBody()); if (version.onOrAfter(Version.V_2_10_0)) { - assertTrue("PitSegmentsResponse.segments().size() == 0", PitSegmentsResponse.valueBody().isEmpty()); + assertTrue("pitSegmentsResponse.segments().size() == 0", pitSegmentsResponse.valueBody().isEmpty()); } else { - assertTrue("PitSegmentsResponse.segments().size() == 0", PitSegmentsResponse.valueBody().size() > 0); + assertTrue("pitSegmentsResponse.segments().size() > 0", pitSegmentsResponse.valueBody().size() > 0); } } @@ -276,5 +277,4 @@ private void createPit(String indexName) throws Exception { assertNotNull(createPitResponse); assertNotNull(createPitResponse.pitId()); } - } From 3666af9141df68c7e6ef5424850e5c62a7f0805a Mon Sep 17 00:00:00 2001 From: Thomas Farr Date: Tue, 7 Jan 2025 23:21:30 +1300 Subject: [PATCH 17/18] Fix test Signed-off-by: Thomas Farr --- .../client/opensearch/integTest/AbstractCatClientIT.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/java-client/src/test/java11/org/opensearch/client/opensearch/integTest/AbstractCatClientIT.java b/java-client/src/test/java11/org/opensearch/client/opensearch/integTest/AbstractCatClientIT.java index 895ac297b5..8abdf144d9 100644 --- a/java-client/src/test/java11/org/opensearch/client/opensearch/integTest/AbstractCatClientIT.java +++ b/java-client/src/test/java11/org/opensearch/client/opensearch/integTest/AbstractCatClientIT.java @@ -19,6 +19,7 @@ import org.opensearch.client.opensearch._types.Result; import org.opensearch.client.opensearch._types.Time; import org.opensearch.client.opensearch.cat.AliasesResponse; +import org.opensearch.client.opensearch.cat.AllPitSegmentsResponse; import org.opensearch.client.opensearch.cat.AllocationResponse; import org.opensearch.client.opensearch.cat.IndicesResponse; import org.opensearch.client.opensearch.cat.NodesResponse; @@ -237,7 +238,7 @@ public void testCatSegments() throws Exception { } @Test - public void testCatPitSegments() throws Exception { + public void testCatAllPitSegments() throws Exception { final Version version = getServerVersion(); assumeTrue("The PIT is supported in OpenSearch 2.4.0 and later", version.onOrAfter(Version.V_2_4_0)); createIndex("cat-pit-segments-test-index"); @@ -253,7 +254,7 @@ public void testCatPitSegments() throws Exception { createPit("cat-pit-segments-test-index"); - PitSegmentsResponse pitSegmentsResponse = javaClient().cat().pitSegments(r -> r.headers("index,shard,id,segment,size")); + AllPitSegmentsResponse pitSegmentsResponse = javaClient().cat().allPitSegments(r -> r.headers("index,shard,id,segment,size")); assertNotNull("pitSegmentsResponse.segments() is null", pitSegmentsResponse.valueBody()); From 729061529289b66d998ab53c5badc5e11d8d7cac Mon Sep 17 00:00:00 2001 From: Thomas Farr Date: Tue, 7 Jan 2025 23:25:58 +1300 Subject: [PATCH 18/18] spotless Signed-off-by: Thomas Farr --- .../client/opensearch/integTest/AbstractCatClientIT.java | 1 - 1 file changed, 1 deletion(-) diff --git a/java-client/src/test/java11/org/opensearch/client/opensearch/integTest/AbstractCatClientIT.java b/java-client/src/test/java11/org/opensearch/client/opensearch/integTest/AbstractCatClientIT.java index 8abdf144d9..d03be5088e 100644 --- a/java-client/src/test/java11/org/opensearch/client/opensearch/integTest/AbstractCatClientIT.java +++ b/java-client/src/test/java11/org/opensearch/client/opensearch/integTest/AbstractCatClientIT.java @@ -23,7 +23,6 @@ import org.opensearch.client.opensearch.cat.AllocationResponse; import org.opensearch.client.opensearch.cat.IndicesResponse; import org.opensearch.client.opensearch.cat.NodesResponse; -import org.opensearch.client.opensearch.cat.PitSegmentsResponse; import org.opensearch.client.opensearch.cat.PluginsResponse; import org.opensearch.client.opensearch.cat.RecoveryResponse; import org.opensearch.client.opensearch.cat.SegmentsResponse;