From 779e31a2e579f684e608610a8e010b574ea00ef8 Mon Sep 17 00:00:00 2001
From: Andriy Redko
Date: Sun, 22 Feb 2026 15:43:36 -0500
Subject: [PATCH] Update Specification and Re-generate Code (#1890)
Signed-off-by: Andriy Redko
---
.../opensearch/_types/ShardSearchFailure.java | 308 +++++++
.../opensearch/_types/ShardStatistics.java | 18 +-
.../client/opensearch/ml/DataAsMap.java | 207 +++++
.../ml/ExecuteAgentStreamRequest.java | 256 ++++++
.../ml/ExecuteAgentStreamResponse.java | 121 +++
.../ml/OpenSearchMlAsyncClient.java | 42 +
.../opensearch/ml/OpenSearchMlClient.java | 40 +
.../client/opensearch/ml/Output.java | 41 +
.../ml/PredictModelStreamRequest.java | 256 ++++++
.../ml/PredictModelStreamResponse.java | 121 +++
.../DeleteExperimentsResponse.java | 61 +-
.../DeleteJudgmentsResponse.java | 61 +-
.../DeleteQuerySetsResponse.java | 61 +-
.../DeleteScheduledExperimentsRequest.java | 202 +++++
.../DeleteScheduledExperimentsResponse.java | 158 ++++
.../DeleteSearchConfigurationsResponse.java | 63 +-
.../GetExperimentsRequest.java | 13 +-
.../GetExperimentsResponse.java | 694 ++++++++--------
.../search_relevance/GetJudgmentsRequest.java | 13 +-
.../GetJudgmentsResponse.java | 670 +++++++++------
.../GetNodeStatsResponse.java | 253 +++++-
.../search_relevance/GetQuerySetsRequest.java | 13 +-
.../GetQuerySetsResponse.java | 637 ++++++++++-----
.../GetScheduledExperimentsRequest.java | 229 ++++++
.../GetScheduledExperimentsResponse.java | 763 ++++++++++++++++++
.../GetSearchConfigurationsRequest.java | 78 +-
.../GetSearchConfigurationsResponse.java | 643 ++++++++++-----
.../search_relevance/GetStatsResponse.java | 247 +++++-
.../OpenSearchSearchRelevanceAsyncClient.java | 208 +++--
.../OpenSearchSearchRelevanceClient.java | 205 +++--
.../PostScheduledExperimentsRequest.java | 265 ++++++
.../PostScheduledExperimentsResponse.java | 226 ++++++
.../PutExperimentsRequest.java | 49 +-
.../PutExperimentsResponse.java | 97 ++-
.../json/PlainJsonSerializableTest.java | 4 +-
java-codegen/opensearch-openapi.yaml | 588 +++++++++-----
.../client/codegen/openapi/MimeType.java | 1 +
37 files changed, 6408 insertions(+), 1504 deletions(-)
create mode 100644 java-client/src/generated/java/org/opensearch/client/opensearch/_types/ShardSearchFailure.java
create mode 100644 java-client/src/generated/java/org/opensearch/client/opensearch/ml/DataAsMap.java
create mode 100644 java-client/src/generated/java/org/opensearch/client/opensearch/ml/ExecuteAgentStreamRequest.java
create mode 100644 java-client/src/generated/java/org/opensearch/client/opensearch/ml/ExecuteAgentStreamResponse.java
create mode 100644 java-client/src/generated/java/org/opensearch/client/opensearch/ml/PredictModelStreamRequest.java
create mode 100644 java-client/src/generated/java/org/opensearch/client/opensearch/ml/PredictModelStreamResponse.java
create mode 100644 java-client/src/generated/java/org/opensearch/client/opensearch/search_relevance/DeleteScheduledExperimentsRequest.java
create mode 100644 java-client/src/generated/java/org/opensearch/client/opensearch/search_relevance/DeleteScheduledExperimentsResponse.java
create mode 100644 java-client/src/generated/java/org/opensearch/client/opensearch/search_relevance/GetScheduledExperimentsRequest.java
create mode 100644 java-client/src/generated/java/org/opensearch/client/opensearch/search_relevance/GetScheduledExperimentsResponse.java
create mode 100644 java-client/src/generated/java/org/opensearch/client/opensearch/search_relevance/PostScheduledExperimentsRequest.java
create mode 100644 java-client/src/generated/java/org/opensearch/client/opensearch/search_relevance/PostScheduledExperimentsResponse.java
diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/ShardSearchFailure.java b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/ShardSearchFailure.java
new file mode 100644
index 0000000000..7ebed2637f
--- /dev/null
+++ b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/ShardSearchFailure.java
@@ -0,0 +1,308 @@
+/*
+ * 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._types;
+
+import jakarta.json.stream.JsonGenerator;
+import java.util.Objects;
+import java.util.function.Function;
+import javax.annotation.Generated;
+import javax.annotation.Nonnull;
+import javax.annotation.Nullable;
+import org.opensearch.client.json.JsonpDeserializable;
+import org.opensearch.client.json.JsonpDeserializer;
+import org.opensearch.client.json.JsonpMapper;
+import org.opensearch.client.json.ObjectBuilderDeserializer;
+import org.opensearch.client.json.ObjectDeserializer;
+import org.opensearch.client.json.PlainJsonSerializable;
+import org.opensearch.client.util.ApiTypeHelper;
+import org.opensearch.client.util.CopyableBuilder;
+import org.opensearch.client.util.ObjectBuilder;
+import org.opensearch.client.util.ObjectBuilderBase;
+import org.opensearch.client.util.ToCopyableBuilder;
+
+// typedef: _types.ShardSearchFailure
+
+/**
+ * Represents a failure to search on a specific shard. Used in search responses.
+ */
+@JsonpDeserializable
+@Generated("org.opensearch.client.codegen.CodeGenerator")
+public class ShardSearchFailure implements PlainJsonSerializable, ToCopyableBuilder {
+
+ @Nullable
+ private final String index;
+
+ @Nullable
+ private final String node;
+
+ @Nonnull
+ private final ErrorCause reason;
+
+ private final int shard;
+
+ // ---------------------------------------------------------------------------------------------
+
+ private ShardSearchFailure(Builder builder) {
+ this.index = builder.index;
+ this.node = builder.node;
+ this.reason = ApiTypeHelper.requireNonNull(builder.reason, this, "reason");
+ this.shard = ApiTypeHelper.requireNonNull(builder.shard, this, "shard");
+ }
+
+ public static ShardSearchFailure of(Function> fn) {
+ return fn.apply(new Builder()).build();
+ }
+
+ /**
+ * The index name where the failure occurred.
+ *
+ * API name: {@code index}
+ *
+ */
+ @Nullable
+ public final String index() {
+ return this.index;
+ }
+
+ /**
+ * The node id where the failure occurred.
+ *
+ * API name: {@code node}
+ *
+ */
+ @Nullable
+ public final String node() {
+ return this.node;
+ }
+
+ /**
+ * Required - API name: {@code reason}
+ */
+ @Nonnull
+ public final ErrorCause reason() {
+ return this.reason;
+ }
+
+ /**
+ * Required - The shard id where the failure occurred.
+ *
+ * API name: {@code shard}
+ *
+ */
+ public final int shard() {
+ return this.shard;
+ }
+
+ /**
+ * 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.index != null) {
+ generator.writeKey("index");
+ generator.write(this.index);
+ }
+
+ if (this.node != null) {
+ generator.writeKey("node");
+ generator.write(this.node);
+ }
+
+ generator.writeKey("reason");
+ this.reason.serialize(generator, mapper);
+
+ generator.writeKey("shard");
+ generator.write(this.shard);
+ }
+
+ // ---------------------------------------------------------------------------------------------
+
+ @Override
+ @Nonnull
+ public Builder toBuilder() {
+ return new Builder(this);
+ }
+
+ @Nonnull
+ public static Builder builder() {
+ return new Builder();
+ }
+
+ /**
+ * Builder for {@link ShardSearchFailure}.
+ */
+ public static class Builder extends ObjectBuilderBase implements CopyableBuilder {
+ @Nullable
+ private String index;
+ @Nullable
+ private String node;
+ private ErrorCause reason;
+ private Integer shard;
+
+ public Builder() {}
+
+ private Builder(ShardSearchFailure o) {
+ this.index = o.index;
+ this.node = o.node;
+ this.reason = o.reason;
+ this.shard = o.shard;
+ }
+
+ private Builder(Builder o) {
+ this.index = o.index;
+ this.node = o.node;
+ this.reason = o.reason;
+ this.shard = o.shard;
+ }
+
+ @Override
+ @Nonnull
+ public Builder copy() {
+ return new Builder(this);
+ }
+
+ /**
+ * The index name where the failure occurred.
+ *
+ * API name: {@code index}
+ *
+ */
+ @Nonnull
+ public final Builder index(@Nullable String value) {
+ this.index = value;
+ return this;
+ }
+
+ /**
+ * The node id where the failure occurred.
+ *
+ * API name: {@code node}
+ *
+ */
+ @Nonnull
+ public final Builder node(@Nullable String value) {
+ this.node = value;
+ return this;
+ }
+
+ /**
+ * Required - API name: {@code reason}
+ */
+ @Nonnull
+ public final Builder reason(ErrorCause value) {
+ this.reason = value;
+ return this;
+ }
+
+ /**
+ * Required - API name: {@code reason}
+ */
+ @Nonnull
+ public final Builder reason(Function> fn) {
+ return reason(fn.apply(new ErrorCause.Builder()).build());
+ }
+
+ /**
+ * Required - The shard id where the failure occurred.
+ *
+ * API name: {@code shard}
+ *
+ */
+ @Nonnull
+ public final Builder shard(int value) {
+ this.shard = value;
+ return this;
+ }
+
+ /**
+ * Builds a {@link ShardSearchFailure}.
+ *
+ * @throws NullPointerException if some of the required fields are null.
+ */
+ @Override
+ @Nonnull
+ public ShardSearchFailure build() {
+ _checkSingleUse();
+
+ return new ShardSearchFailure(this);
+ }
+ }
+
+ // ---------------------------------------------------------------------------------------------
+
+ /**
+ * Json deserializer for {@link ShardSearchFailure}
+ */
+ public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer.lazy(
+ Builder::new,
+ ShardSearchFailure::setupShardSearchFailureDeserializer
+ );
+
+ protected static void setupShardSearchFailureDeserializer(ObjectDeserializer op) {
+ op.add(Builder::index, JsonpDeserializer.stringDeserializer(), "index");
+ op.add(Builder::node, JsonpDeserializer.stringDeserializer(), "node");
+ op.add(Builder::reason, ErrorCause._DESERIALIZER, "reason");
+ op.add(Builder::shard, JsonpDeserializer.integerDeserializer(), "shard");
+ }
+
+ @Override
+ public int hashCode() {
+ int result = 17;
+ result = 31 * result + Objects.hashCode(this.index);
+ result = 31 * result + Objects.hashCode(this.node);
+ result = 31 * result + this.reason.hashCode();
+ result = 31 * result + Integer.hashCode(this.shard);
+ return result;
+ }
+
+ @Override
+ public boolean equals(Object o) {
+ if (this == o) return true;
+ if (o == null || this.getClass() != o.getClass()) return false;
+ ShardSearchFailure other = (ShardSearchFailure) o;
+ return Objects.equals(this.index, other.index)
+ && Objects.equals(this.node, other.node)
+ && this.reason.equals(other.reason)
+ && this.shard == other.shard;
+ }
+}
diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/ShardStatistics.java b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/ShardStatistics.java
index 57fc99f388..ef64450839 100644
--- a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/ShardStatistics.java
+++ b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/ShardStatistics.java
@@ -64,7 +64,7 @@ public class ShardStatistics implements PlainJsonSerializable, ToCopyableBuilder
private final int failed;
@Nonnull
- private final List failures;
+ private final List failures;
@Nullable
private final Integer skipped;
@@ -98,7 +98,7 @@ public final int failed() {
* API name: {@code failures}
*/
@Nonnull
- public final List failures() {
+ public final List failures() {
return this.failures;
}
@@ -141,7 +141,7 @@ protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) {
if (ApiTypeHelper.isDefined(this.failures)) {
generator.writeKey("failures");
generator.writeStartArray();
- for (ShardFailure item0 : this.failures) {
+ for (ShardSearchFailure item0 : this.failures) {
item0.serialize(generator, mapper);
}
generator.writeEnd();
@@ -178,7 +178,7 @@ public static Builder builder() {
public static class Builder extends ObjectBuilderBase implements CopyableBuilder {
private Integer failed;
@Nullable
- private List failures;
+ private List failures;
@Nullable
private Integer skipped;
private Integer successful;
@@ -225,7 +225,7 @@ public final Builder failed(int value) {
*
*/
@Nonnull
- public final Builder failures(List list) {
+ public final Builder failures(List list) {
this.failures = _listAddAll(this.failures, list);
return this;
}
@@ -238,7 +238,7 @@ public final Builder failures(List list) {
*
*/
@Nonnull
- public final Builder failures(ShardFailure value, ShardFailure... values) {
+ public final Builder failures(ShardSearchFailure value, ShardSearchFailure... values) {
this.failures = _listAdd(this.failures, value, values);
return this;
}
@@ -251,8 +251,8 @@ public final Builder failures(ShardFailure value, ShardFailure... values) {
*
*/
@Nonnull
- public final Builder failures(Function> fn) {
- return failures(fn.apply(new ShardFailure.Builder()).build());
+ public final Builder failures(Function> fn) {
+ return failures(fn.apply(new ShardSearchFailure.Builder()).build());
}
/**
@@ -308,7 +308,7 @@ public ShardStatistics build() {
protected static void setupShardStatisticsDeserializer(ObjectDeserializer op) {
op.add(Builder::failed, JsonpDeserializer.integerDeserializer(), "failed");
- op.add(Builder::failures, JsonpDeserializer.arrayDeserializer(ShardFailure._DESERIALIZER), "failures");
+ op.add(Builder::failures, JsonpDeserializer.arrayDeserializer(ShardSearchFailure._DESERIALIZER), "failures");
op.add(Builder::skipped, JsonpDeserializer.integerDeserializer(), "skipped");
op.add(Builder::successful, JsonpDeserializer.integerDeserializer(), "successful");
op.add(Builder::total, JsonpDeserializer.integerDeserializer(), "total");
diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/ml/DataAsMap.java b/java-client/src/generated/java/org/opensearch/client/opensearch/ml/DataAsMap.java
new file mode 100644
index 0000000000..6941738496
--- /dev/null
+++ b/java-client/src/generated/java/org/opensearch/client/opensearch/ml/DataAsMap.java
@@ -0,0 +1,207 @@
+/*
+ * 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.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: ml.DataAsMap
+
+@JsonpDeserializable
+@Generated("org.opensearch.client.codegen.CodeGenerator")
+public class DataAsMap implements PlainJsonSerializable, ToCopyableBuilder {
+
+ @Nullable
+ private final String content;
+
+ @Nullable
+ private final Boolean isLast;
+
+ // ---------------------------------------------------------------------------------------------
+
+ private DataAsMap(Builder builder) {
+ this.content = builder.content;
+ this.isLast = builder.isLast;
+ }
+
+ public static DataAsMap of(Function> fn) {
+ return fn.apply(new Builder()).build();
+ }
+
+ /**
+ * The streaming content chunk.
+ *
+ * API name: {@code content}
+ *
+ */
+ @Nullable
+ public final String content() {
+ return this.content;
+ }
+
+ /**
+ * Whether this is the last chunk.
+ *
+ * API name: {@code is_last}
+ *
+ */
+ @Nullable
+ public final Boolean isLast() {
+ return this.isLast;
+ }
+
+ /**
+ * 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.content != null) {
+ generator.writeKey("content");
+ generator.write(this.content);
+ }
+
+ if (this.isLast != null) {
+ generator.writeKey("is_last");
+ generator.write(this.isLast);
+ }
+ }
+
+ // ---------------------------------------------------------------------------------------------
+
+ @Override
+ @Nonnull
+ public Builder toBuilder() {
+ return new Builder(this);
+ }
+
+ @Nonnull
+ public static Builder builder() {
+ return new Builder();
+ }
+
+ /**
+ * Builder for {@link DataAsMap}.
+ */
+ public static class Builder extends ObjectBuilderBase implements CopyableBuilder {
+ @Nullable
+ private String content;
+ @Nullable
+ private Boolean isLast;
+
+ public Builder() {}
+
+ private Builder(DataAsMap o) {
+ this.content = o.content;
+ this.isLast = o.isLast;
+ }
+
+ private Builder(Builder o) {
+ this.content = o.content;
+ this.isLast = o.isLast;
+ }
+
+ @Override
+ @Nonnull
+ public Builder copy() {
+ return new Builder(this);
+ }
+
+ /**
+ * The streaming content chunk.
+ *
+ * API name: {@code content}
+ *
+ */
+ @Nonnull
+ public final Builder content(@Nullable String value) {
+ this.content = value;
+ return this;
+ }
+
+ /**
+ * Whether this is the last chunk.
+ *
+ * API name: {@code is_last}
+ *
+ */
+ @Nonnull
+ public final Builder isLast(@Nullable Boolean value) {
+ this.isLast = value;
+ return this;
+ }
+
+ /**
+ * Builds a {@link DataAsMap}.
+ *
+ * @throws NullPointerException if some of the required fields are null.
+ */
+ @Override
+ @Nonnull
+ public DataAsMap build() {
+ _checkSingleUse();
+
+ return new DataAsMap(this);
+ }
+ }
+
+ // ---------------------------------------------------------------------------------------------
+
+ /**
+ * Json deserializer for {@link DataAsMap}
+ */
+ public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer.lazy(
+ Builder::new,
+ DataAsMap::setupDataAsMapDeserializer
+ );
+
+ protected static void setupDataAsMapDeserializer(ObjectDeserializer op) {
+ op.add(Builder::content, JsonpDeserializer.stringDeserializer(), "content");
+ op.add(Builder::isLast, JsonpDeserializer.booleanDeserializer(), "is_last");
+ }
+
+ @Override
+ public int hashCode() {
+ int result = 17;
+ result = 31 * result + Objects.hashCode(this.content);
+ result = 31 * result + Objects.hashCode(this.isLast);
+ return result;
+ }
+
+ @Override
+ public boolean equals(Object o) {
+ if (this == o) return true;
+ if (o == null || this.getClass() != o.getClass()) return false;
+ DataAsMap other = (DataAsMap) o;
+ return Objects.equals(this.content, other.content) && Objects.equals(this.isLast, other.isLast);
+ }
+}
diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/ml/ExecuteAgentStreamRequest.java b/java-client/src/generated/java/org/opensearch/client/opensearch/ml/ExecuteAgentStreamRequest.java
new file mode 100644
index 0000000000..2e4cd24e03
--- /dev/null
+++ b/java-client/src/generated/java/org/opensearch/client/opensearch/ml/ExecuteAgentStreamRequest.java
@@ -0,0 +1,256 @@
+/*
+ * 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.HashMap;
+import java.util.Map;
+import java.util.function.Function;
+import javax.annotation.Generated;
+import javax.annotation.Nonnull;
+import org.opensearch.client.json.JsonData;
+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.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.ApiTypeHelper;
+import org.opensearch.client.util.CopyableBuilder;
+import org.opensearch.client.util.ObjectBuilder;
+import org.opensearch.client.util.ToCopyableBuilder;
+
+// typedef: ml.execute_agent_stream.Request
+
+/**
+ * Execute an agent in streaming mode.
+ */
+@JsonpDeserializable
+@Generated("org.opensearch.client.codegen.CodeGenerator")
+public final class ExecuteAgentStreamRequest extends RequestBase
+ implements
+ PlainJsonSerializable,
+ ToCopyableBuilder {
+
+ @Nonnull
+ private final String agentId;
+
+ @Nonnull
+ private final Map parameters;
+
+ // ---------------------------------------------------------------------------------------------
+
+ private ExecuteAgentStreamRequest(Builder builder) {
+ super(builder);
+ this.agentId = ApiTypeHelper.requireNonNull(builder.agentId, this, "agentId");
+ this.parameters = ApiTypeHelper.unmodifiableRequired(builder.parameters, this, "parameters");
+ }
+
+ public static ExecuteAgentStreamRequest of(Function> fn) {
+ return fn.apply(new Builder()).build();
+ }
+
+ /**
+ * Required - API name: {@code agent_id}
+ */
+ @Nonnull
+ public final String agentId() {
+ return this.agentId;
+ }
+
+ /**
+ * Required - API name: {@code parameters}
+ */
+ @Nonnull
+ public final Map parameters() {
+ return this.parameters;
+ }
+
+ /**
+ * 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("parameters");
+ generator.writeStartObject();
+ for (Map.Entry item0 : this.parameters.entrySet()) {
+ generator.writeKey(item0.getKey());
+ item0.getValue().serialize(generator, mapper);
+ }
+ generator.writeEnd();
+ }
+
+ // ---------------------------------------------------------------------------------------------
+
+ @Override
+ @Nonnull
+ public Builder toBuilder() {
+ return new Builder(this);
+ }
+
+ @Nonnull
+ public static Builder builder() {
+ return new Builder();
+ }
+
+ /**
+ * Builder for {@link ExecuteAgentStreamRequest}.
+ */
+ public static class Builder extends RequestBase.AbstractBuilder
+ implements
+ CopyableBuilder {
+ private String agentId;
+ private Map parameters;
+
+ public Builder() {}
+
+ private Builder(ExecuteAgentStreamRequest o) {
+ super(o);
+ this.agentId = o.agentId;
+ this.parameters = _mapCopy(o.parameters);
+ }
+
+ private Builder(Builder o) {
+ super(o);
+ this.agentId = o.agentId;
+ this.parameters = _mapCopy(o.parameters);
+ }
+
+ @Override
+ @Nonnull
+ public Builder copy() {
+ return new Builder(this);
+ }
+
+ @Override
+ @Nonnull
+ protected Builder self() {
+ return this;
+ }
+
+ /**
+ * Required - API name: {@code agent_id}
+ */
+ @Nonnull
+ public final Builder agentId(String value) {
+ this.agentId = value;
+ return this;
+ }
+
+ /**
+ * Required - API name: {@code parameters}
+ *
+ *
+ * Adds all elements of map to parameters.
+ *
+ */
+ @Nonnull
+ public final Builder parameters(Map map) {
+ this.parameters = _mapPutAll(this.parameters, map);
+ return this;
+ }
+
+ /**
+ * Required - API name: {@code parameters}
+ *
+ *
+ * Adds an entry to parameters.
+ *
+ */
+ @Nonnull
+ public final Builder parameters(String key, JsonData value) {
+ this.parameters = _mapPut(this.parameters, key, value);
+ return this;
+ }
+
+ /**
+ * Builds a {@link ExecuteAgentStreamRequest}.
+ *
+ * @throws NullPointerException if some of the required fields are null.
+ */
+ @Override
+ @Nonnull
+ public ExecuteAgentStreamRequest build() {
+ _checkSingleUse();
+
+ return new ExecuteAgentStreamRequest(this);
+ }
+ }
+
+ // ---------------------------------------------------------------------------------------------
+
+ /**
+ * Json deserializer for {@link ExecuteAgentStreamRequest}
+ */
+ public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer.lazy(
+ Builder::new,
+ ExecuteAgentStreamRequest::setupExecuteAgentStreamRequestDeserializer
+ );
+
+ protected static void setupExecuteAgentStreamRequestDeserializer(ObjectDeserializer op) {
+ op.add(Builder::parameters, JsonpDeserializer.stringMapDeserializer(JsonData._DESERIALIZER), "parameters");
+ }
+
+ // ---------------------------------------------------------------------------------------------
+
+ /**
+ * Endpoint "{@code ml.execute_agent_stream}".
+ */
+ public static final Endpoint _ENDPOINT = new SimpleEndpoint<>(
+ // Request method
+ request -> "POST",
+ // Request path
+ request -> {
+ StringBuilder buf = new StringBuilder();
+ buf.append("/_plugins/_ml/agents/");
+ SimpleEndpoint.pathEncode(request.agentId, buf);
+ buf.append("/_execute/stream");
+ return buf.toString();
+ },
+ // Request parameters
+ request -> {
+ Map params = new HashMap<>();
+ request.applyQueryParameters(params);
+ return params;
+ },
+ SimpleEndpoint.emptyMap(),
+ true,
+ ExecuteAgentStreamResponse._DESERIALIZER
+ );
+
+ @Override
+ public int hashCode() {
+ int result = 17;
+ result = 31 * result + this.agentId.hashCode();
+ result = 31 * result + this.parameters.hashCode();
+ return result;
+ }
+
+ @Override
+ public boolean equals(Object o) {
+ if (this == o) return true;
+ if (o == null || this.getClass() != o.getClass()) return false;
+ ExecuteAgentStreamRequest other = (ExecuteAgentStreamRequest) o;
+ return this.agentId.equals(other.agentId) && this.parameters.equals(other.parameters);
+ }
+}
diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/ml/ExecuteAgentStreamResponse.java b/java-client/src/generated/java/org/opensearch/client/opensearch/ml/ExecuteAgentStreamResponse.java
new file mode 100644
index 0000000000..8ef748015d
--- /dev/null
+++ b/java-client/src/generated/java/org/opensearch/client/opensearch/ml/ExecuteAgentStreamResponse.java
@@ -0,0 +1,121 @@
+/*
+ * 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.function.Function;
+import javax.annotation.Generated;
+import javax.annotation.Nonnull;
+import org.opensearch.client.json.JsonpDeserializer;
+import org.opensearch.client.json.JsonpMapper;
+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: ml.execute_agent_stream.Response
+
+@Generated("org.opensearch.client.codegen.CodeGenerator")
+public class ExecuteAgentStreamResponse
+ implements
+ PlainJsonSerializable,
+ ToCopyableBuilder {
+
+ // ---------------------------------------------------------------------------------------------
+
+ private ExecuteAgentStreamResponse(Builder builder) {}
+
+ public static ExecuteAgentStreamResponse of(
+ Function> fn
+ ) {
+ return fn.apply(new Builder()).build();
+ }
+
+ /**
+ * Serialize this object to JSON.
+ */
+ @Override
+ public void serialize(JsonGenerator generator, JsonpMapper mapper) {
+ generator.writeStartObject();
+ generator.writeEnd();
+ }
+
+ // ---------------------------------------------------------------------------------------------
+
+ @Override
+ @Nonnull
+ public Builder toBuilder() {
+ return new Builder(this);
+ }
+
+ @Nonnull
+ public static Builder builder() {
+ return new Builder();
+ }
+
+ /**
+ * Builder for {@link ExecuteAgentStreamResponse}.
+ */
+ public static class Builder extends ObjectBuilderBase implements CopyableBuilder {
+
+ public Builder() {}
+
+ private Builder(ExecuteAgentStreamResponse o) {}
+
+ private Builder(Builder o) {}
+
+ @Override
+ @Nonnull
+ public Builder copy() {
+ return new Builder(this);
+ }
+
+ /**
+ * Builds a {@link ExecuteAgentStreamResponse}.
+ *
+ * @throws NullPointerException if some of the required fields are null.
+ */
+ @Override
+ @Nonnull
+ public ExecuteAgentStreamResponse build() {
+ _checkSingleUse();
+
+ return new ExecuteAgentStreamResponse(this);
+ }
+ }
+
+ // ---------------------------------------------------------------------------------------------
+
+ /**
+ * Singleton instance for {@link ExecuteAgentStreamResponse}.
+ */
+ public static final ExecuteAgentStreamResponse _INSTANCE = builder().build();
+
+ public static final JsonpDeserializer _DESERIALIZER = JsonpDeserializer.emptyObject(
+ ExecuteAgentStreamResponse._INSTANCE
+ );
+
+ @Override
+ public int hashCode() {
+ int result = 17;
+ return result;
+ }
+
+ @Override
+ public boolean equals(Object o) {
+ if (this == o) return true;
+ if (o == null || this.getClass() != o.getClass()) return false;
+ return true;
+ }
+}
diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/ml/OpenSearchMlAsyncClient.java b/java-client/src/generated/java/org/opensearch/client/opensearch/ml/OpenSearchMlAsyncClient.java
index dc52333065..28bc5185ff 100644
--- a/java-client/src/generated/java/org/opensearch/client/opensearch/ml/OpenSearchMlAsyncClient.java
+++ b/java-client/src/generated/java/org/opensearch/client/opensearch/ml/OpenSearchMlAsyncClient.java
@@ -461,6 +461,27 @@ public final CompletableFuture executeAgent(
return executeAgent(fn.apply(new ExecuteAgentRequest.Builder()).build());
}
+ // ----- Endpoint: ml.execute_agent_stream
+
+ /**
+ * Execute an agent in streaming mode.
+ */
+ public CompletableFuture executeAgentStream(ExecuteAgentStreamRequest request) throws IOException,
+ OpenSearchException {
+ return this.transport.performRequestAsync(request, ExecuteAgentStreamRequest._ENDPOINT, this.transportOptions);
+ }
+
+ /**
+ * Execute an agent in streaming mode.
+ *
+ * @param fn a function that initializes a builder to create the {@link ExecuteAgentStreamRequest}
+ */
+ public final CompletableFuture executeAgentStream(
+ Function> fn
+ ) throws IOException, OpenSearchException {
+ return executeAgentStream(fn.apply(new ExecuteAgentStreamRequest.Builder()).build());
+ }
+
// ----- Endpoint: ml.execute_tool
/**
@@ -921,6 +942,27 @@ public final CompletableFuture loadModel(Function predictModelStream(PredictModelStreamRequest request) throws IOException,
+ OpenSearchException {
+ return this.transport.performRequestAsync(request, PredictModelStreamRequest._ENDPOINT, this.transportOptions);
+ }
+
+ /**
+ * Predicts a model in streaming mode.
+ *
+ * @param fn a function that initializes a builder to create the {@link PredictModelStreamRequest}
+ */
+ public final CompletableFuture predictModelStream(
+ Function> fn
+ ) throws IOException, OpenSearchException {
+ return predictModelStream(fn.apply(new PredictModelStreamRequest.Builder()).build());
+ }
+
// ----- Endpoint: ml.register_agents
/**
diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/ml/OpenSearchMlClient.java b/java-client/src/generated/java/org/opensearch/client/opensearch/ml/OpenSearchMlClient.java
index f8dbb0098d..a2c629f176 100644
--- a/java-client/src/generated/java/org/opensearch/client/opensearch/ml/OpenSearchMlClient.java
+++ b/java-client/src/generated/java/org/opensearch/client/opensearch/ml/OpenSearchMlClient.java
@@ -442,6 +442,26 @@ public final ExecuteAgentResponse executeAgent(Function> fn
+ ) throws IOException, OpenSearchException {
+ return executeAgentStream(fn.apply(new ExecuteAgentStreamRequest.Builder()).build());
+ }
+
// ----- Endpoint: ml.execute_tool
/**
@@ -889,6 +909,26 @@ public final LoadModelResponse loadModel(Function> fn
+ ) throws IOException, OpenSearchException {
+ return predictModelStream(fn.apply(new PredictModelStreamRequest.Builder()).build());
+ }
+
// ----- Endpoint: ml.register_agents
/**
diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/ml/Output.java b/java-client/src/generated/java/org/opensearch/client/opensearch/ml/Output.java
index 0a8793c5b3..dec0a727f8 100644
--- a/java-client/src/generated/java/org/opensearch/client/opensearch/ml/Output.java
+++ b/java-client/src/generated/java/org/opensearch/client/opensearch/ml/Output.java
@@ -43,6 +43,9 @@ public class Output implements PlainJsonSerializable, ToCopyableBuilder data;
+ @Nullable
+ private final DataAsMap dataAsMap;
+
@Nullable
private final MlResultDataType dataType;
@@ -60,6 +63,7 @@ public class Output implements PlainJsonSerializable, ToCopyableBuilder data() {
return this.data;
}
+ /**
+ * API name: {@code dataAsMap}
+ */
+ @Nullable
+ public final DataAsMap dataAsMap() {
+ return this.dataAsMap;
+ }
+
/**
* API name: {@code data_type}
*/
@@ -149,6 +161,11 @@ protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) {
generator.writeEnd();
}
+ if (this.dataAsMap != null) {
+ generator.writeKey("dataAsMap");
+ this.dataAsMap.serialize(generator, mapper);
+ }
+
if (this.dataType != null) {
generator.writeKey("data_type");
this.dataType.serialize(generator, mapper);
@@ -196,6 +213,8 @@ public static class Builder extends ObjectBuilderBase implements CopyableBuilder
@Nullable
private List data;
@Nullable
+ private DataAsMap dataAsMap;
+ @Nullable
private MlResultDataType dataType;
@Nullable
private String name;
@@ -209,6 +228,7 @@ public Builder() {}
private Builder(Output o) {
this.byteBuffer = o.byteBuffer;
this.data = _listCopy(o.data);
+ this.dataAsMap = o.dataAsMap;
this.dataType = o.dataType;
this.name = o.name;
this.result = o.result;
@@ -218,6 +238,7 @@ private Builder(Output o) {
private Builder(Builder o) {
this.byteBuffer = o.byteBuffer;
this.data = _listCopy(o.data);
+ this.dataAsMap = o.dataAsMap;
this.dataType = o.dataType;
this.name = o.name;
this.result = o.result;
@@ -273,6 +294,23 @@ public final Builder data(Double value, Double... values) {
return this;
}
+ /**
+ * API name: {@code dataAsMap}
+ */
+ @Nonnull
+ public final Builder dataAsMap(@Nullable DataAsMap value) {
+ this.dataAsMap = value;
+ return this;
+ }
+
+ /**
+ * API name: {@code dataAsMap}
+ */
+ @Nonnull
+ public final Builder dataAsMap(Function> fn) {
+ return dataAsMap(fn.apply(new DataAsMap.Builder()).build());
+ }
+
/**
* API name: {@code data_type}
*/
@@ -359,6 +397,7 @@ public Output build() {
protected static void setupOutputDeserializer(ObjectDeserializer op) {
op.add(Builder::byteBuffer, ByteBuffer._DESERIALIZER, "byte_buffer");
op.add(Builder::data, JsonpDeserializer.arrayDeserializer(JsonpDeserializer.doubleDeserializer()), "data");
+ op.add(Builder::dataAsMap, DataAsMap._DESERIALIZER, "dataAsMap");
op.add(Builder::dataType, MlResultDataType._DESERIALIZER, "data_type");
op.add(Builder::name, JsonpDeserializer.stringDeserializer(), "name");
op.add(Builder::result, JsonpDeserializer.stringDeserializer(), "result");
@@ -370,6 +409,7 @@ public int hashCode() {
int result = 17;
result = 31 * result + Objects.hashCode(this.byteBuffer);
result = 31 * result + Objects.hashCode(this.data);
+ result = 31 * result + Objects.hashCode(this.dataAsMap);
result = 31 * result + Objects.hashCode(this.dataType);
result = 31 * result + Objects.hashCode(this.name);
result = 31 * result + Objects.hashCode(this.result);
@@ -384,6 +424,7 @@ public boolean equals(Object o) {
Output other = (Output) o;
return Objects.equals(this.byteBuffer, other.byteBuffer)
&& Objects.equals(this.data, other.data)
+ && Objects.equals(this.dataAsMap, other.dataAsMap)
&& Objects.equals(this.dataType, other.dataType)
&& Objects.equals(this.name, other.name)
&& Objects.equals(this.result, other.result)
diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/ml/PredictModelStreamRequest.java b/java-client/src/generated/java/org/opensearch/client/opensearch/ml/PredictModelStreamRequest.java
new file mode 100644
index 0000000000..ed3f164fd1
--- /dev/null
+++ b/java-client/src/generated/java/org/opensearch/client/opensearch/ml/PredictModelStreamRequest.java
@@ -0,0 +1,256 @@
+/*
+ * 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.HashMap;
+import java.util.Map;
+import java.util.function.Function;
+import javax.annotation.Generated;
+import javax.annotation.Nonnull;
+import org.opensearch.client.json.JsonData;
+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.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.ApiTypeHelper;
+import org.opensearch.client.util.CopyableBuilder;
+import org.opensearch.client.util.ObjectBuilder;
+import org.opensearch.client.util.ToCopyableBuilder;
+
+// typedef: ml.predict_model_stream.Request
+
+/**
+ * Predicts a model in streaming mode.
+ */
+@JsonpDeserializable
+@Generated("org.opensearch.client.codegen.CodeGenerator")
+public final class PredictModelStreamRequest extends RequestBase
+ implements
+ PlainJsonSerializable,
+ ToCopyableBuilder {
+
+ @Nonnull
+ private final String modelId;
+
+ @Nonnull
+ private final Map parameters;
+
+ // ---------------------------------------------------------------------------------------------
+
+ private PredictModelStreamRequest(Builder builder) {
+ super(builder);
+ this.modelId = ApiTypeHelper.requireNonNull(builder.modelId, this, "modelId");
+ this.parameters = ApiTypeHelper.unmodifiableRequired(builder.parameters, this, "parameters");
+ }
+
+ public static PredictModelStreamRequest of(Function> fn) {
+ return fn.apply(new Builder()).build();
+ }
+
+ /**
+ * Required - API name: {@code model_id}
+ */
+ @Nonnull
+ public final String modelId() {
+ return this.modelId;
+ }
+
+ /**
+ * Required - API name: {@code parameters}
+ */
+ @Nonnull
+ public final Map parameters() {
+ return this.parameters;
+ }
+
+ /**
+ * 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("parameters");
+ generator.writeStartObject();
+ for (Map.Entry item0 : this.parameters.entrySet()) {
+ generator.writeKey(item0.getKey());
+ item0.getValue().serialize(generator, mapper);
+ }
+ generator.writeEnd();
+ }
+
+ // ---------------------------------------------------------------------------------------------
+
+ @Override
+ @Nonnull
+ public Builder toBuilder() {
+ return new Builder(this);
+ }
+
+ @Nonnull
+ public static Builder builder() {
+ return new Builder();
+ }
+
+ /**
+ * Builder for {@link PredictModelStreamRequest}.
+ */
+ public static class Builder extends RequestBase.AbstractBuilder
+ implements
+ CopyableBuilder {
+ private String modelId;
+ private Map parameters;
+
+ public Builder() {}
+
+ private Builder(PredictModelStreamRequest o) {
+ super(o);
+ this.modelId = o.modelId;
+ this.parameters = _mapCopy(o.parameters);
+ }
+
+ private Builder(Builder o) {
+ super(o);
+ this.modelId = o.modelId;
+ this.parameters = _mapCopy(o.parameters);
+ }
+
+ @Override
+ @Nonnull
+ public Builder copy() {
+ return new Builder(this);
+ }
+
+ @Override
+ @Nonnull
+ protected Builder self() {
+ return this;
+ }
+
+ /**
+ * Required - API name: {@code model_id}
+ */
+ @Nonnull
+ public final Builder modelId(String value) {
+ this.modelId = value;
+ return this;
+ }
+
+ /**
+ * Required - API name: {@code parameters}
+ *
+ *
+ * Adds all elements of map to parameters.
+ *
+ */
+ @Nonnull
+ public final Builder parameters(Map map) {
+ this.parameters = _mapPutAll(this.parameters, map);
+ return this;
+ }
+
+ /**
+ * Required - API name: {@code parameters}
+ *
+ *
+ * Adds an entry to parameters.
+ *
+ */
+ @Nonnull
+ public final Builder parameters(String key, JsonData value) {
+ this.parameters = _mapPut(this.parameters, key, value);
+ return this;
+ }
+
+ /**
+ * Builds a {@link PredictModelStreamRequest}.
+ *
+ * @throws NullPointerException if some of the required fields are null.
+ */
+ @Override
+ @Nonnull
+ public PredictModelStreamRequest build() {
+ _checkSingleUse();
+
+ return new PredictModelStreamRequest(this);
+ }
+ }
+
+ // ---------------------------------------------------------------------------------------------
+
+ /**
+ * Json deserializer for {@link PredictModelStreamRequest}
+ */
+ public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer.lazy(
+ Builder::new,
+ PredictModelStreamRequest::setupPredictModelStreamRequestDeserializer
+ );
+
+ protected static void setupPredictModelStreamRequestDeserializer(ObjectDeserializer op) {
+ op.add(Builder::parameters, JsonpDeserializer.stringMapDeserializer(JsonData._DESERIALIZER), "parameters");
+ }
+
+ // ---------------------------------------------------------------------------------------------
+
+ /**
+ * Endpoint "{@code ml.predict_model_stream}".
+ */
+ public static final Endpoint _ENDPOINT = new SimpleEndpoint<>(
+ // Request method
+ request -> "POST",
+ // Request path
+ request -> {
+ StringBuilder buf = new StringBuilder();
+ buf.append("/_plugins/_ml/models/");
+ SimpleEndpoint.pathEncode(request.modelId, buf);
+ buf.append("/_predict/stream");
+ return buf.toString();
+ },
+ // Request parameters
+ request -> {
+ Map params = new HashMap<>();
+ request.applyQueryParameters(params);
+ return params;
+ },
+ SimpleEndpoint.emptyMap(),
+ true,
+ PredictModelStreamResponse._DESERIALIZER
+ );
+
+ @Override
+ public int hashCode() {
+ int result = 17;
+ result = 31 * result + this.modelId.hashCode();
+ result = 31 * result + this.parameters.hashCode();
+ return result;
+ }
+
+ @Override
+ public boolean equals(Object o) {
+ if (this == o) return true;
+ if (o == null || this.getClass() != o.getClass()) return false;
+ PredictModelStreamRequest other = (PredictModelStreamRequest) o;
+ return this.modelId.equals(other.modelId) && this.parameters.equals(other.parameters);
+ }
+}
diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/ml/PredictModelStreamResponse.java b/java-client/src/generated/java/org/opensearch/client/opensearch/ml/PredictModelStreamResponse.java
new file mode 100644
index 0000000000..d72fd39b2d
--- /dev/null
+++ b/java-client/src/generated/java/org/opensearch/client/opensearch/ml/PredictModelStreamResponse.java
@@ -0,0 +1,121 @@
+/*
+ * 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.function.Function;
+import javax.annotation.Generated;
+import javax.annotation.Nonnull;
+import org.opensearch.client.json.JsonpDeserializer;
+import org.opensearch.client.json.JsonpMapper;
+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: ml.predict_model_stream.Response
+
+@Generated("org.opensearch.client.codegen.CodeGenerator")
+public class PredictModelStreamResponse
+ implements
+ PlainJsonSerializable,
+ ToCopyableBuilder {
+
+ // ---------------------------------------------------------------------------------------------
+
+ private PredictModelStreamResponse(Builder builder) {}
+
+ public static PredictModelStreamResponse of(
+ Function> fn
+ ) {
+ return fn.apply(new Builder()).build();
+ }
+
+ /**
+ * Serialize this object to JSON.
+ */
+ @Override
+ public void serialize(JsonGenerator generator, JsonpMapper mapper) {
+ generator.writeStartObject();
+ generator.writeEnd();
+ }
+
+ // ---------------------------------------------------------------------------------------------
+
+ @Override
+ @Nonnull
+ public Builder toBuilder() {
+ return new Builder(this);
+ }
+
+ @Nonnull
+ public static Builder builder() {
+ return new Builder();
+ }
+
+ /**
+ * Builder for {@link PredictModelStreamResponse}.
+ */
+ public static class Builder extends ObjectBuilderBase implements CopyableBuilder {
+
+ public Builder() {}
+
+ private Builder(PredictModelStreamResponse o) {}
+
+ private Builder(Builder o) {}
+
+ @Override
+ @Nonnull
+ public Builder copy() {
+ return new Builder(this);
+ }
+
+ /**
+ * Builds a {@link PredictModelStreamResponse}.
+ *
+ * @throws NullPointerException if some of the required fields are null.
+ */
+ @Override
+ @Nonnull
+ public PredictModelStreamResponse build() {
+ _checkSingleUse();
+
+ return new PredictModelStreamResponse(this);
+ }
+ }
+
+ // ---------------------------------------------------------------------------------------------
+
+ /**
+ * Singleton instance for {@link PredictModelStreamResponse}.
+ */
+ public static final PredictModelStreamResponse _INSTANCE = builder().build();
+
+ public static final JsonpDeserializer _DESERIALIZER = JsonpDeserializer.emptyObject(
+ PredictModelStreamResponse._INSTANCE
+ );
+
+ @Override
+ public int hashCode() {
+ int result = 17;
+ return result;
+ }
+
+ @Override
+ public boolean equals(Object o) {
+ if (this == o) return true;
+ if (o == null || this.getClass() != o.getClass()) return false;
+ return true;
+ }
+}
diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/search_relevance/DeleteExperimentsResponse.java b/java-client/src/generated/java/org/opensearch/client/opensearch/search_relevance/DeleteExperimentsResponse.java
index 1272be8356..29e8ccd3f1 100644
--- a/java-client/src/generated/java/org/opensearch/client/opensearch/search_relevance/DeleteExperimentsResponse.java
+++ b/java-client/src/generated/java/org/opensearch/client/opensearch/search_relevance/DeleteExperimentsResponse.java
@@ -36,43 +36,36 @@
package org.opensearch.client.opensearch.search_relevance;
-import jakarta.json.stream.JsonGenerator;
import java.util.function.Function;
import javax.annotation.Generated;
import javax.annotation.Nonnull;
+import org.opensearch.client.json.JsonpDeserializable;
import org.opensearch.client.json.JsonpDeserializer;
-import org.opensearch.client.json.JsonpMapper;
-import org.opensearch.client.json.PlainJsonSerializable;
+import org.opensearch.client.json.ObjectBuilderDeserializer;
+import org.opensearch.client.json.ObjectDeserializer;
+import org.opensearch.client.opensearch._types.WriteResponseBase;
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: search_relevance.delete_experiments.Response
+@JsonpDeserializable
@Generated("org.opensearch.client.codegen.CodeGenerator")
-public class DeleteExperimentsResponse
+public class DeleteExperimentsResponse extends WriteResponseBase
implements
- PlainJsonSerializable,
ToCopyableBuilder {
// ---------------------------------------------------------------------------------------------
- private DeleteExperimentsResponse(Builder builder) {}
+ private DeleteExperimentsResponse(Builder builder) {
+ super(builder);
+ }
public static DeleteExperimentsResponse of(Function> fn) {
return fn.apply(new Builder()).build();
}
- /**
- * Serialize this object to JSON.
- */
- @Override
- public void serialize(JsonGenerator generator, JsonpMapper mapper) {
- generator.writeStartObject();
- generator.writeEnd();
- }
-
// ---------------------------------------------------------------------------------------------
@Override
@@ -89,13 +82,19 @@ public static Builder builder() {
/**
* Builder for {@link DeleteExperimentsResponse}.
*/
- public static class Builder extends ObjectBuilderBase implements CopyableBuilder {
+ public static class Builder extends WriteResponseBase.AbstractBuilder
+ implements
+ CopyableBuilder {
public Builder() {}
- private Builder(DeleteExperimentsResponse o) {}
+ private Builder(DeleteExperimentsResponse o) {
+ super(o);
+ }
- private Builder(Builder o) {}
+ private Builder(Builder o) {
+ super(o);
+ }
@Override
@Nonnull
@@ -103,6 +102,12 @@ public Builder copy() {
return new Builder(this);
}
+ @Override
+ @Nonnull
+ protected Builder self() {
+ return this;
+ }
+
/**
* Builds a {@link DeleteExperimentsResponse}.
*
@@ -120,22 +125,28 @@ public DeleteExperimentsResponse build() {
// ---------------------------------------------------------------------------------------------
/**
- * Singleton instance for {@link DeleteExperimentsResponse}.
+ * Json deserializer for {@link DeleteExperimentsResponse}
*/
- public static final DeleteExperimentsResponse _INSTANCE = builder().build();
-
- public static final JsonpDeserializer _DESERIALIZER = JsonpDeserializer.emptyObject(
- DeleteExperimentsResponse._INSTANCE
+ public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer.lazy(
+ Builder::new,
+ DeleteExperimentsResponse::setupDeleteExperimentsResponseDeserializer
);
+ protected static void setupDeleteExperimentsResponseDeserializer(ObjectDeserializer op) {
+ setupWriteResponseBaseDeserializer(op);
+ }
+
@Override
public int hashCode() {
- int result = 17;
+ int result = super.hashCode();
return result;
}
@Override
public boolean equals(Object o) {
+ if (!super.equals(o)) {
+ return false;
+ }
if (this == o) return true;
if (o == null || this.getClass() != o.getClass()) return false;
return true;
diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/search_relevance/DeleteJudgmentsResponse.java b/java-client/src/generated/java/org/opensearch/client/opensearch/search_relevance/DeleteJudgmentsResponse.java
index ef7c412ea5..99a08729ef 100644
--- a/java-client/src/generated/java/org/opensearch/client/opensearch/search_relevance/DeleteJudgmentsResponse.java
+++ b/java-client/src/generated/java/org/opensearch/client/opensearch/search_relevance/DeleteJudgmentsResponse.java
@@ -36,43 +36,36 @@
package org.opensearch.client.opensearch.search_relevance;
-import jakarta.json.stream.JsonGenerator;
import java.util.function.Function;
import javax.annotation.Generated;
import javax.annotation.Nonnull;
+import org.opensearch.client.json.JsonpDeserializable;
import org.opensearch.client.json.JsonpDeserializer;
-import org.opensearch.client.json.JsonpMapper;
-import org.opensearch.client.json.PlainJsonSerializable;
+import org.opensearch.client.json.ObjectBuilderDeserializer;
+import org.opensearch.client.json.ObjectDeserializer;
+import org.opensearch.client.opensearch._types.WriteResponseBase;
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: search_relevance.delete_judgments.Response
+@JsonpDeserializable
@Generated("org.opensearch.client.codegen.CodeGenerator")
-public class DeleteJudgmentsResponse
+public class DeleteJudgmentsResponse extends WriteResponseBase
implements
- PlainJsonSerializable,
ToCopyableBuilder {
// ---------------------------------------------------------------------------------------------
- private DeleteJudgmentsResponse(Builder builder) {}
+ private DeleteJudgmentsResponse(Builder builder) {
+ super(builder);
+ }
public static DeleteJudgmentsResponse of(Function> fn) {
return fn.apply(new Builder()).build();
}
- /**
- * Serialize this object to JSON.
- */
- @Override
- public void serialize(JsonGenerator generator, JsonpMapper mapper) {
- generator.writeStartObject();
- generator.writeEnd();
- }
-
// ---------------------------------------------------------------------------------------------
@Override
@@ -89,13 +82,19 @@ public static Builder builder() {
/**
* Builder for {@link DeleteJudgmentsResponse}.
*/
- public static class Builder extends ObjectBuilderBase implements CopyableBuilder {
+ public static class Builder extends WriteResponseBase.AbstractBuilder
+ implements
+ CopyableBuilder {
public Builder() {}
- private Builder(DeleteJudgmentsResponse o) {}
+ private Builder(DeleteJudgmentsResponse o) {
+ super(o);
+ }
- private Builder(Builder o) {}
+ private Builder(Builder o) {
+ super(o);
+ }
@Override
@Nonnull
@@ -103,6 +102,12 @@ public Builder copy() {
return new Builder(this);
}
+ @Override
+ @Nonnull
+ protected Builder self() {
+ return this;
+ }
+
/**
* Builds a {@link DeleteJudgmentsResponse}.
*
@@ -120,22 +125,28 @@ public DeleteJudgmentsResponse build() {
// ---------------------------------------------------------------------------------------------
/**
- * Singleton instance for {@link DeleteJudgmentsResponse}.
+ * Json deserializer for {@link DeleteJudgmentsResponse}
*/
- public static final DeleteJudgmentsResponse _INSTANCE = builder().build();
-
- public static final JsonpDeserializer _DESERIALIZER = JsonpDeserializer.emptyObject(
- DeleteJudgmentsResponse._INSTANCE
+ public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer.lazy(
+ Builder::new,
+ DeleteJudgmentsResponse::setupDeleteJudgmentsResponseDeserializer
);
+ protected static void setupDeleteJudgmentsResponseDeserializer(ObjectDeserializer op) {
+ setupWriteResponseBaseDeserializer(op);
+ }
+
@Override
public int hashCode() {
- int result = 17;
+ int result = super.hashCode();
return result;
}
@Override
public boolean equals(Object o) {
+ if (!super.equals(o)) {
+ return false;
+ }
if (this == o) return true;
if (o == null || this.getClass() != o.getClass()) return false;
return true;
diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/search_relevance/DeleteQuerySetsResponse.java b/java-client/src/generated/java/org/opensearch/client/opensearch/search_relevance/DeleteQuerySetsResponse.java
index e10c9adfbc..0bf4b769c6 100644
--- a/java-client/src/generated/java/org/opensearch/client/opensearch/search_relevance/DeleteQuerySetsResponse.java
+++ b/java-client/src/generated/java/org/opensearch/client/opensearch/search_relevance/DeleteQuerySetsResponse.java
@@ -36,43 +36,36 @@
package org.opensearch.client.opensearch.search_relevance;
-import jakarta.json.stream.JsonGenerator;
import java.util.function.Function;
import javax.annotation.Generated;
import javax.annotation.Nonnull;
+import org.opensearch.client.json.JsonpDeserializable;
import org.opensearch.client.json.JsonpDeserializer;
-import org.opensearch.client.json.JsonpMapper;
-import org.opensearch.client.json.PlainJsonSerializable;
+import org.opensearch.client.json.ObjectBuilderDeserializer;
+import org.opensearch.client.json.ObjectDeserializer;
+import org.opensearch.client.opensearch._types.WriteResponseBase;
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: search_relevance.delete_query_sets.Response
+@JsonpDeserializable
@Generated("org.opensearch.client.codegen.CodeGenerator")
-public class DeleteQuerySetsResponse
+public class DeleteQuerySetsResponse extends WriteResponseBase
implements
- PlainJsonSerializable,
ToCopyableBuilder {
// ---------------------------------------------------------------------------------------------
- private DeleteQuerySetsResponse(Builder builder) {}
+ private DeleteQuerySetsResponse(Builder builder) {
+ super(builder);
+ }
public static DeleteQuerySetsResponse of(Function> fn) {
return fn.apply(new Builder()).build();
}
- /**
- * Serialize this object to JSON.
- */
- @Override
- public void serialize(JsonGenerator generator, JsonpMapper mapper) {
- generator.writeStartObject();
- generator.writeEnd();
- }
-
// ---------------------------------------------------------------------------------------------
@Override
@@ -89,13 +82,19 @@ public static Builder builder() {
/**
* Builder for {@link DeleteQuerySetsResponse}.
*/
- public static class Builder extends ObjectBuilderBase implements CopyableBuilder {
+ public static class Builder extends WriteResponseBase.AbstractBuilder
+ implements
+ CopyableBuilder {
public Builder() {}
- private Builder(DeleteQuerySetsResponse o) {}
+ private Builder(DeleteQuerySetsResponse o) {
+ super(o);
+ }
- private Builder(Builder o) {}
+ private Builder(Builder o) {
+ super(o);
+ }
@Override
@Nonnull
@@ -103,6 +102,12 @@ public Builder copy() {
return new Builder(this);
}
+ @Override
+ @Nonnull
+ protected Builder self() {
+ return this;
+ }
+
/**
* Builds a {@link DeleteQuerySetsResponse}.
*
@@ -120,22 +125,28 @@ public DeleteQuerySetsResponse build() {
// ---------------------------------------------------------------------------------------------
/**
- * Singleton instance for {@link DeleteQuerySetsResponse}.
+ * Json deserializer for {@link DeleteQuerySetsResponse}
*/
- public static final DeleteQuerySetsResponse _INSTANCE = builder().build();
-
- public static final JsonpDeserializer _DESERIALIZER = JsonpDeserializer.emptyObject(
- DeleteQuerySetsResponse._INSTANCE
+ public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer.lazy(
+ Builder::new,
+ DeleteQuerySetsResponse::setupDeleteQuerySetsResponseDeserializer
);
+ protected static void setupDeleteQuerySetsResponseDeserializer(ObjectDeserializer op) {
+ setupWriteResponseBaseDeserializer(op);
+ }
+
@Override
public int hashCode() {
- int result = 17;
+ int result = super.hashCode();
return result;
}
@Override
public boolean equals(Object o) {
+ if (!super.equals(o)) {
+ return false;
+ }
if (this == o) return true;
if (o == null || this.getClass() != o.getClass()) return false;
return true;
diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/search_relevance/DeleteScheduledExperimentsRequest.java b/java-client/src/generated/java/org/opensearch/client/opensearch/search_relevance/DeleteScheduledExperimentsRequest.java
new file mode 100644
index 0000000000..a6e7a16786
--- /dev/null
+++ b/java-client/src/generated/java/org/opensearch/client/opensearch/search_relevance/DeleteScheduledExperimentsRequest.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.search_relevance;
+
+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.ApiTypeHelper;
+import org.opensearch.client.util.CopyableBuilder;
+import org.opensearch.client.util.ObjectBuilder;
+import org.opensearch.client.util.ToCopyableBuilder;
+
+// typedef: search_relevance.delete_scheduled_experiments.Request
+
+/**
+ * Deletes a specified scheduled experiment.
+ */
+@Generated("org.opensearch.client.codegen.CodeGenerator")
+public final class DeleteScheduledExperimentsRequest extends RequestBase
+ implements
+ ToCopyableBuilder {
+
+ @Nonnull
+ private final String experimentId;
+
+ // ---------------------------------------------------------------------------------------------
+
+ private DeleteScheduledExperimentsRequest(Builder builder) {
+ super(builder);
+ this.experimentId = ApiTypeHelper.requireNonNull(builder.experimentId, this, "experimentId");
+ }
+
+ public static DeleteScheduledExperimentsRequest of(
+ Function> fn
+ ) {
+ return fn.apply(new Builder()).build();
+ }
+
+ /**
+ * Required - The experiment id
+ *
+ * API name: {@code experiment_id}
+ *
+ */
+ @Nonnull
+ public final String experimentId() {
+ return this.experimentId;
+ }
+
+ // ---------------------------------------------------------------------------------------------
+
+ @Override
+ @Nonnull
+ public Builder toBuilder() {
+ return new Builder(this);
+ }
+
+ @Nonnull
+ public static Builder builder() {
+ return new Builder();
+ }
+
+ /**
+ * Builder for {@link DeleteScheduledExperimentsRequest}.
+ */
+ public static class Builder extends RequestBase.AbstractBuilder
+ implements
+ CopyableBuilder {
+ private String experimentId;
+
+ public Builder() {}
+
+ private Builder(DeleteScheduledExperimentsRequest o) {
+ super(o);
+ this.experimentId = o.experimentId;
+ }
+
+ private Builder(Builder o) {
+ super(o);
+ this.experimentId = o.experimentId;
+ }
+
+ @Override
+ @Nonnull
+ public Builder copy() {
+ return new Builder(this);
+ }
+
+ @Override
+ @Nonnull
+ protected Builder self() {
+ return this;
+ }
+
+ /**
+ * Required - The experiment id
+ *
+ * API name: {@code experiment_id}
+ *
+ */
+ @Nonnull
+ public final Builder experimentId(String value) {
+ this.experimentId = value;
+ return this;
+ }
+
+ /**
+ * Builds a {@link DeleteScheduledExperimentsRequest}.
+ *
+ * @throws NullPointerException if some of the required fields are null.
+ */
+ @Override
+ @Nonnull
+ public DeleteScheduledExperimentsRequest build() {
+ _checkSingleUse();
+
+ return new DeleteScheduledExperimentsRequest(this);
+ }
+ }
+
+ // ---------------------------------------------------------------------------------------------
+
+ /**
+ * Endpoint "{@code search_relevance.delete_scheduled_experiments}".
+ */
+ public static final Endpoint _ENDPOINT =
+ new SimpleEndpoint<>(
+ // Request method
+ request -> "DELETE",
+ // Request path
+ request -> {
+ StringBuilder buf = new StringBuilder();
+ buf.append("/_plugins/_search_relevance/experiments/schedule/");
+ SimpleEndpoint.pathEncode(request.experimentId, buf);
+ return buf.toString();
+ },
+ // Request parameters
+ request -> {
+ Map params = new HashMap<>();
+ request.applyQueryParameters(params);
+ return params;
+ },
+ SimpleEndpoint.emptyMap(),
+ false,
+ DeleteScheduledExperimentsResponse._DESERIALIZER
+ );
+
+ @Override
+ public int hashCode() {
+ int result = 17;
+ result = 31 * result + this.experimentId.hashCode();
+ return result;
+ }
+
+ @Override
+ public boolean equals(Object o) {
+ if (this == o) return true;
+ if (o == null || this.getClass() != o.getClass()) return false;
+ DeleteScheduledExperimentsRequest other = (DeleteScheduledExperimentsRequest) o;
+ return this.experimentId.equals(other.experimentId);
+ }
+}
diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/search_relevance/DeleteScheduledExperimentsResponse.java b/java-client/src/generated/java/org/opensearch/client/opensearch/search_relevance/DeleteScheduledExperimentsResponse.java
new file mode 100644
index 0000000000..e7b516f831
--- /dev/null
+++ b/java-client/src/generated/java/org/opensearch/client/opensearch/search_relevance/DeleteScheduledExperimentsResponse.java
@@ -0,0 +1,158 @@
+/*
+ * 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.search_relevance;
+
+import java.util.function.Function;
+import javax.annotation.Generated;
+import javax.annotation.Nonnull;
+import org.opensearch.client.json.JsonpDeserializable;
+import org.opensearch.client.json.JsonpDeserializer;
+import org.opensearch.client.json.ObjectBuilderDeserializer;
+import org.opensearch.client.json.ObjectDeserializer;
+import org.opensearch.client.opensearch._types.WriteResponseBase;
+import org.opensearch.client.util.CopyableBuilder;
+import org.opensearch.client.util.ObjectBuilder;
+import org.opensearch.client.util.ToCopyableBuilder;
+
+// typedef: search_relevance.delete_scheduled_experiments.Response
+
+@JsonpDeserializable
+@Generated("org.opensearch.client.codegen.CodeGenerator")
+public class DeleteScheduledExperimentsResponse extends WriteResponseBase
+ implements
+ ToCopyableBuilder {
+
+ // ---------------------------------------------------------------------------------------------
+
+ private DeleteScheduledExperimentsResponse(Builder builder) {
+ super(builder);
+ }
+
+ public static DeleteScheduledExperimentsResponse of(
+ Function> fn
+ ) {
+ return fn.apply(new Builder()).build();
+ }
+
+ // ---------------------------------------------------------------------------------------------
+
+ @Override
+ @Nonnull
+ public Builder toBuilder() {
+ return new Builder(this);
+ }
+
+ @Nonnull
+ public static Builder builder() {
+ return new Builder();
+ }
+
+ /**
+ * Builder for {@link DeleteScheduledExperimentsResponse}.
+ */
+ public static class Builder extends WriteResponseBase.AbstractBuilder
+ implements
+ CopyableBuilder {
+
+ public Builder() {}
+
+ private Builder(DeleteScheduledExperimentsResponse 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 DeleteScheduledExperimentsResponse}.
+ *
+ * @throws NullPointerException if some of the required fields are null.
+ */
+ @Override
+ @Nonnull
+ public DeleteScheduledExperimentsResponse build() {
+ _checkSingleUse();
+
+ return new DeleteScheduledExperimentsResponse(this);
+ }
+ }
+
+ // ---------------------------------------------------------------------------------------------
+
+ /**
+ * Json deserializer for {@link DeleteScheduledExperimentsResponse}
+ */
+ public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer.lazy(
+ Builder::new,
+ DeleteScheduledExperimentsResponse::setupDeleteScheduledExperimentsResponseDeserializer
+ );
+
+ protected static void setupDeleteScheduledExperimentsResponseDeserializer(
+ ObjectDeserializer op
+ ) {
+ setupWriteResponseBaseDeserializer(op);
+ }
+
+ @Override
+ public int hashCode() {
+ int result = super.hashCode();
+ return result;
+ }
+
+ @Override
+ public boolean equals(Object o) {
+ if (!super.equals(o)) {
+ return false;
+ }
+ if (this == o) return true;
+ if (o == null || this.getClass() != o.getClass()) return false;
+ return true;
+ }
+}
diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/search_relevance/DeleteSearchConfigurationsResponse.java b/java-client/src/generated/java/org/opensearch/client/opensearch/search_relevance/DeleteSearchConfigurationsResponse.java
index 23d8bfe4f1..e8804d0ce4 100644
--- a/java-client/src/generated/java/org/opensearch/client/opensearch/search_relevance/DeleteSearchConfigurationsResponse.java
+++ b/java-client/src/generated/java/org/opensearch/client/opensearch/search_relevance/DeleteSearchConfigurationsResponse.java
@@ -36,29 +36,31 @@
package org.opensearch.client.opensearch.search_relevance;
-import jakarta.json.stream.JsonGenerator;
import java.util.function.Function;
import javax.annotation.Generated;
import javax.annotation.Nonnull;
+import org.opensearch.client.json.JsonpDeserializable;
import org.opensearch.client.json.JsonpDeserializer;
-import org.opensearch.client.json.JsonpMapper;
-import org.opensearch.client.json.PlainJsonSerializable;
+import org.opensearch.client.json.ObjectBuilderDeserializer;
+import org.opensearch.client.json.ObjectDeserializer;
+import org.opensearch.client.opensearch._types.WriteResponseBase;
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: search_relevance.delete_search_configurations.Response
+@JsonpDeserializable
@Generated("org.opensearch.client.codegen.CodeGenerator")
-public class DeleteSearchConfigurationsResponse
+public class DeleteSearchConfigurationsResponse extends WriteResponseBase
implements
- PlainJsonSerializable,
ToCopyableBuilder {
// ---------------------------------------------------------------------------------------------
- private DeleteSearchConfigurationsResponse(Builder builder) {}
+ private DeleteSearchConfigurationsResponse(Builder builder) {
+ super(builder);
+ }
public static DeleteSearchConfigurationsResponse of(
Function> fn
@@ -66,15 +68,6 @@ public static DeleteSearchConfigurationsResponse of(
return fn.apply(new Builder()).build();
}
- /**
- * Serialize this object to JSON.
- */
- @Override
- public void serialize(JsonGenerator generator, JsonpMapper mapper) {
- generator.writeStartObject();
- generator.writeEnd();
- }
-
// ---------------------------------------------------------------------------------------------
@Override
@@ -91,13 +84,19 @@ public static Builder builder() {
/**
* Builder for {@link DeleteSearchConfigurationsResponse}.
*/
- public static class Builder extends ObjectBuilderBase implements CopyableBuilder {
+ public static class Builder extends WriteResponseBase.AbstractBuilder
+ implements
+ CopyableBuilder {
public Builder() {}
- private Builder(DeleteSearchConfigurationsResponse o) {}
+ private Builder(DeleteSearchConfigurationsResponse o) {
+ super(o);
+ }
- private Builder(Builder o) {}
+ private Builder(Builder o) {
+ super(o);
+ }
@Override
@Nonnull
@@ -105,6 +104,12 @@ public Builder copy() {
return new Builder(this);
}
+ @Override
+ @Nonnull
+ protected Builder self() {
+ return this;
+ }
+
/**
* Builds a {@link DeleteSearchConfigurationsResponse}.
*
@@ -122,22 +127,30 @@ public DeleteSearchConfigurationsResponse build() {
// ---------------------------------------------------------------------------------------------
/**
- * Singleton instance for {@link DeleteSearchConfigurationsResponse}.
+ * Json deserializer for {@link DeleteSearchConfigurationsResponse}
*/
- public static final DeleteSearchConfigurationsResponse _INSTANCE = builder().build();
-
- public static final JsonpDeserializer _DESERIALIZER = JsonpDeserializer.emptyObject(
- DeleteSearchConfigurationsResponse._INSTANCE
+ public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer.lazy(
+ Builder::new,
+ DeleteSearchConfigurationsResponse::setupDeleteSearchConfigurationsResponseDeserializer
);
+ protected static void setupDeleteSearchConfigurationsResponseDeserializer(
+ ObjectDeserializer op
+ ) {
+ setupWriteResponseBaseDeserializer(op);
+ }
+
@Override
public int hashCode() {
- int result = 17;
+ int result = super.hashCode();
return result;
}
@Override
public boolean equals(Object o) {
+ if (!super.equals(o)) {
+ return false;
+ }
if (this == o) return true;
if (o == null || this.getClass() != o.getClass()) return false;
return true;
diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/search_relevance/GetExperimentsRequest.java b/java-client/src/generated/java/org/opensearch/client/opensearch/search_relevance/GetExperimentsRequest.java
index b1e82bc12a..c479314d19 100644
--- a/java-client/src/generated/java/org/opensearch/client/opensearch/search_relevance/GetExperimentsRequest.java
+++ b/java-client/src/generated/java/org/opensearch/client/opensearch/search_relevance/GetExperimentsRequest.java
@@ -43,6 +43,7 @@
import javax.annotation.Generated;
import javax.annotation.Nonnull;
import javax.annotation.Nullable;
+import org.opensearch.client.json.JsonpDeserializer;
import org.opensearch.client.opensearch._types.ErrorResponse;
import org.opensearch.client.opensearch._types.RequestBase;
import org.opensearch.client.transport.Endpoint;
@@ -161,7 +162,7 @@ public GetExperimentsRequest build() {
/**
* Endpoint "{@code search_relevance.get_experiments}".
*/
- public static final Endpoint _ENDPOINT = new SimpleEndpoint<>(
+ public static final SimpleEndpoint _ENDPOINT = new SimpleEndpoint<>(
// Request method
request -> "GET",
// Request path
@@ -195,6 +196,16 @@ public GetExperimentsRequest build() {
GetExperimentsResponse._DESERIALIZER
);
+ /**
+ * Create an "{@code search_relevance.get_experiments}" endpoint.
+ */
+ public static <
+ TDocument>
+ Endpoint, ErrorResponse>
+ createSearchRelevanceGetExperimentsEndpoint(JsonpDeserializer tDocumentDeserializer) {
+ return _ENDPOINT.withResponseDeserializer(GetExperimentsResponse.createGetExperimentsResponseDeserializer(tDocumentDeserializer));
+ }
+
@Override
public int hashCode() {
int result = 17;
diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/search_relevance/GetExperimentsResponse.java b/java-client/src/generated/java/org/opensearch/client/opensearch/search_relevance/GetExperimentsResponse.java
index e415227d9f..7d7edfdab9 100644
--- a/java-client/src/generated/java/org/opensearch/client/opensearch/search_relevance/GetExperimentsResponse.java
+++ b/java-client/src/generated/java/org/opensearch/client/opensearch/search_relevance/GetExperimentsResponse.java
@@ -44,13 +44,23 @@
import javax.annotation.Generated;
import javax.annotation.Nonnull;
import javax.annotation.Nullable;
+import org.opensearch.client.json.ExternallyTaggedUnion;
import org.opensearch.client.json.JsonData;
import org.opensearch.client.json.JsonpDeserializable;
import org.opensearch.client.json.JsonpDeserializer;
import org.opensearch.client.json.JsonpMapper;
+import org.opensearch.client.json.NamedDeserializer;
import org.opensearch.client.json.ObjectBuilderDeserializer;
import org.opensearch.client.json.ObjectDeserializer;
import org.opensearch.client.json.PlainJsonSerializable;
+import org.opensearch.client.opensearch._types.ClusterStatistics;
+import org.opensearch.client.opensearch._types.PhaseTook;
+import org.opensearch.client.opensearch._types.ShardStatistics;
+import org.opensearch.client.opensearch._types.aggregations.Aggregate;
+import org.opensearch.client.opensearch.core.search.HitsMetadata;
+import org.opensearch.client.opensearch.core.search.ProcessorExecutionDetail;
+import org.opensearch.client.opensearch.core.search.Profile;
+import org.opensearch.client.opensearch.core.search.Suggest;
import org.opensearch.client.util.ApiTypeHelper;
import org.opensearch.client.util.CopyableBuilder;
import org.opensearch.client.util.ObjectBuilder;
@@ -61,174 +71,184 @@
@JsonpDeserializable
@Generated("org.opensearch.client.codegen.CodeGenerator")
-public class GetExperimentsResponse
+public class GetExperimentsResponse
implements
PlainJsonSerializable,
- ToCopyableBuilder {
+ ToCopyableBuilder, GetExperimentsResponse> {
@Nonnull
- private final Map hits;
+ private final Map aggregations;
@Nullable
- private final String id;
+ private final ClusterStatistics clusters;
@Nonnull
- private final List judgmentList;
+ private final HitsMetadata hits;
@Nullable
- private final String querySetId;
+ private final Integer numReducePhases;
- @Nonnull
- private final Map results;
+ @Nullable
+ private final PhaseTook phaseTook;
- @Nonnull
- private final List searchConfigurationList;
+ @Nullable
+ private final String pitId;
@Nonnull
- private final Map shards;
+ private final List processorResults;
@Nullable
- private final Integer size;
+ private final Profile profile;
@Nullable
- private final String status;
+ private final String scrollId;
- @Nullable
- private final Boolean timedOut;
+ @Nonnull
+ private final ShardStatistics shards;
- @Nullable
- private final String timestamp;
+ @Nonnull
+ private final Map>> suggest;
@Nullable
- private final Integer took;
+ private final Boolean terminatedEarly;
- @Nullable
- private final String type;
+ private final boolean timedOut;
+
+ private final long took;
// ---------------------------------------------------------------------------------------------
- private GetExperimentsResponse(Builder builder) {
- this.hits = ApiTypeHelper.unmodifiable(builder.hits);
- this.id = builder.id;
- this.judgmentList = ApiTypeHelper.unmodifiable(builder.judgmentList);
- this.querySetId = builder.querySetId;
- this.results = ApiTypeHelper.unmodifiable(builder.results);
- this.searchConfigurationList = ApiTypeHelper.unmodifiable(builder.searchConfigurationList);
- this.shards = ApiTypeHelper.unmodifiable(builder.shards);
- this.size = builder.size;
- this.status = builder.status;
- this.timedOut = builder.timedOut;
- this.timestamp = builder.timestamp;
- this.took = builder.took;
- this.type = builder.type;
+ private GetExperimentsResponse(Builder builder) {
+ this.aggregations = ApiTypeHelper.unmodifiable(builder.aggregations);
+ this.clusters = builder.clusters;
+ this.hits = ApiTypeHelper.requireNonNull(builder.hits, this, "hits");
+ this.numReducePhases = builder.numReducePhases;
+ this.phaseTook = builder.phaseTook;
+ this.pitId = builder.pitId;
+ this.processorResults = ApiTypeHelper.unmodifiable(builder.processorResults);
+ this.profile = builder.profile;
+ this.scrollId = builder.scrollId;
+ this.shards = ApiTypeHelper.requireNonNull(builder.shards, this, "shards");
+ this.suggest = ApiTypeHelper.unmodifiable(builder.suggest);
+ this.terminatedEarly = builder.terminatedEarly;
+ this.timedOut = ApiTypeHelper.requireNonNull(builder.timedOut, this, "timedOut");
+ this.took = ApiTypeHelper.requireNonNull(builder.took, this, "took");
}
- public static GetExperimentsResponse of(Function> fn) {
- return fn.apply(new Builder()).build();
+ public static GetExperimentsResponse of(
+ Function, ObjectBuilder>> fn
+ ) {
+ return fn.apply(new Builder<>()).build();
}
/**
- * API name: {@code hits}
+ * API name: {@code aggregations}
*/
@Nonnull
- public final Map hits() {
- return this.hits;
+ public final Map aggregations() {
+ return this.aggregations;
}
/**
- * API name: {@code id}
+ * API name: {@code _clusters}
*/
@Nullable
- public final String id() {
- return this.id;
+ public final ClusterStatistics clusters() {
+ return this.clusters;
}
/**
- * API name: {@code judgmentList}
+ * Required - API name: {@code hits}
*/
@Nonnull
- public final List judgmentList() {
- return this.judgmentList;
+ public final HitsMetadata hits() {
+ return this.hits;
}
/**
- * API name: {@code querySetId}
+ * API name: {@code num_reduce_phases}
*/
@Nullable
- public final String querySetId() {
- return this.querySetId;
+ public final Integer numReducePhases() {
+ return this.numReducePhases;
}
/**
- * API name: {@code results}
+ * API name: {@code phase_took}
*/
- @Nonnull
- public final Map results() {
- return this.results;
+ @Nullable
+ public final PhaseTook phaseTook() {
+ return this.phaseTook;
}
/**
- * API name: {@code searchConfigurationList}
+ * API name: {@code pit_id}
*/
- @Nonnull
- public final List searchConfigurationList() {
- return this.searchConfigurationList;
+ @Nullable
+ public final String pitId() {
+ return this.pitId;
}
/**
- * API name: {@code _shards}
+ * API name: {@code processor_results}
*/
@Nonnull
- public final Map shards() {
- return this.shards;
+ public final List processorResults() {
+ return this.processorResults;
}
/**
- * API name: {@code size}
+ * API name: {@code profile}
*/
@Nullable
- public final Integer size() {
- return this.size;
+ public final Profile profile() {
+ return this.profile;
}
/**
- * API name: {@code status}
+ * API name: {@code _scroll_id}
*/
@Nullable
- public final String status() {
- return this.status;
+ public final String scrollId() {
+ return this.scrollId;
}
/**
- * API name: {@code timed_out}
+ * Required - API name: {@code _shards}
*/
- @Nullable
- public final Boolean timedOut() {
- return this.timedOut;
+ @Nonnull
+ public final ShardStatistics shards() {
+ return this.shards;
}
/**
- * API name: {@code timestamp}
+ * API name: {@code suggest}
*/
- @Nullable
- public final String timestamp() {
- return this.timestamp;
+ @Nonnull
+ public final Map>> suggest() {
+ return this.suggest;
}
/**
- * API name: {@code took}
+ * API name: {@code terminated_early}
*/
@Nullable
- public final Integer took() {
- return this.took;
+ public final Boolean terminatedEarly() {
+ return this.terminatedEarly;
}
/**
- * API name: {@code type}
+ * Required - API name: {@code timed_out}
*/
- @Nullable
- public final String type() {
- return this.type;
+ public final boolean timedOut() {
+ return this.timedOut;
+ }
+
+ /**
+ * Required - API name: {@code took}
+ */
+ public final long took() {
+ return this.took;
}
/**
@@ -242,378 +262,399 @@ public void serialize(JsonGenerator generator, JsonpMapper mapper) {
}
protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) {
- if (ApiTypeHelper.isDefined(this.hits)) {
- generator.writeKey("hits");
- generator.writeStartObject();
- for (Map.Entry item0 : this.hits.entrySet()) {
- generator.writeKey(item0.getKey());
- item0.getValue().serialize(generator, mapper);
- }
- generator.writeEnd();
+ if (ApiTypeHelper.isDefined(this.aggregations)) {
+ generator.writeKey("aggregations");
+ ExternallyTaggedUnion.serializeTypedKeys(this.aggregations, generator, mapper);
}
- if (this.id != null) {
- generator.writeKey("id");
- generator.write(this.id);
+ if (this.clusters != null) {
+ generator.writeKey("_clusters");
+ this.clusters.serialize(generator, mapper);
}
- if (ApiTypeHelper.isDefined(this.judgmentList)) {
- generator.writeKey("judgmentList");
- generator.writeStartArray();
- for (String item0 : this.judgmentList) {
- generator.write(item0);
- }
- generator.writeEnd();
+ generator.writeKey("hits");
+ this.hits.serialize(generator, mapper);
+
+ if (this.numReducePhases != null) {
+ generator.writeKey("num_reduce_phases");
+ generator.write(this.numReducePhases);
}
- if (this.querySetId != null) {
- generator.writeKey("querySetId");
- generator.write(this.querySetId);
+ if (this.phaseTook != null) {
+ generator.writeKey("phase_took");
+ this.phaseTook.serialize(generator, mapper);
}
- if (ApiTypeHelper.isDefined(this.results)) {
- generator.writeKey("results");
- generator.writeStartObject();
- for (Map.Entry item0 : this.results.entrySet()) {
- generator.writeKey(item0.getKey());
- item0.getValue().serialize(generator, mapper);
- }
- generator.writeEnd();
+ if (this.pitId != null) {
+ generator.writeKey("pit_id");
+ generator.write(this.pitId);
}
- if (ApiTypeHelper.isDefined(this.searchConfigurationList)) {
- generator.writeKey("searchConfigurationList");
+ if (ApiTypeHelper.isDefined(this.processorResults)) {
+ generator.writeKey("processor_results");
generator.writeStartArray();
- for (String item0 : this.searchConfigurationList) {
- generator.write(item0);
+ for (ProcessorExecutionDetail item0 : this.processorResults) {
+ item0.serialize(generator, mapper);
}
generator.writeEnd();
}
- if (ApiTypeHelper.isDefined(this.shards)) {
- generator.writeKey("_shards");
- generator.writeStartObject();
- for (Map.Entry item0 : this.shards.entrySet()) {
- generator.writeKey(item0.getKey());
- item0.getValue().serialize(generator, mapper);
- }
- generator.writeEnd();
+ if (this.profile != null) {
+ generator.writeKey("profile");
+ this.profile.serialize(generator, mapper);
}
- if (this.size != null) {
- generator.writeKey("size");
- generator.write(this.size);
+ if (this.scrollId != null) {
+ generator.writeKey("_scroll_id");
+ generator.write(this.scrollId);
}
- if (this.status != null) {
- generator.writeKey("status");
- generator.write(this.status);
- }
+ generator.writeKey("_shards");
+ this.shards.serialize(generator, mapper);
- if (this.timedOut != null) {
- generator.writeKey("timed_out");
- generator.write(this.timedOut);
+ if (ApiTypeHelper.isDefined(this.suggest)) {
+ generator.writeKey("suggest");
+ ExternallyTaggedUnion.serializeTypedKeysArray(this.suggest, generator, mapper);
}
- if (this.timestamp != null) {
- generator.writeKey("timestamp");
- generator.write(this.timestamp);
+ if (this.terminatedEarly != null) {
+ generator.writeKey("terminated_early");
+ generator.write(this.terminatedEarly);
}
- if (this.took != null) {
- generator.writeKey("took");
- generator.write(this.took);
- }
+ generator.writeKey("timed_out");
+ generator.write(this.timedOut);
- if (this.type != null) {
- generator.writeKey("type");
- generator.write(this.type);
- }
+ generator.writeKey("took");
+ generator.write(this.took);
}
// ---------------------------------------------------------------------------------------------
@Override
@Nonnull
- public Builder toBuilder() {
- return new Builder(this);
+ public Builder toBuilder() {
+ return new Builder<>(this);
}
@Nonnull
- public static Builder builder() {
- return new Builder();
+ public static Builder builder() {
+ return new Builder<>();
}
/**
* Builder for {@link GetExperimentsResponse}.
*/
- public static class Builder extends ObjectBuilderBase implements CopyableBuilder {
+ public static class Builder extends ObjectBuilderBase
+ implements
+ CopyableBuilder, GetExperimentsResponse> {
@Nullable
- private Map hits;
+ private Map aggregations;
@Nullable
- private String id;
+ private ClusterStatistics clusters;
+ private HitsMetadata hits;
@Nullable
- private List judgmentList;
+ private Integer numReducePhases;
@Nullable
- private String querySetId;
+ private PhaseTook phaseTook;
@Nullable
- private Map results;
+ private String pitId;
@Nullable
- private List searchConfigurationList;
+ private List processorResults;
@Nullable
- private Map shards;
+ private Profile profile;
@Nullable
- private Integer size;
+ private String scrollId;
+ private ShardStatistics shards;
@Nullable
- private String status;
+ private Map>> suggest;
@Nullable
+ private Boolean terminatedEarly;
private Boolean timedOut;
- @Nullable
- private String timestamp;
- @Nullable
- private Integer took;
- @Nullable
- private String type;
+ private Long took;
public Builder() {}
- private Builder(GetExperimentsResponse o) {
- this.hits = _mapCopy(o.hits);
- this.id = o.id;
- this.judgmentList = _listCopy(o.judgmentList);
- this.querySetId = o.querySetId;
- this.results = _mapCopy(o.results);
- this.searchConfigurationList = _listCopy(o.searchConfigurationList);
- this.shards = _mapCopy(o.shards);
- this.size = o.size;
- this.status = o.status;
+ private Builder(GetExperimentsResponse o) {
+ this.aggregations = _mapCopy(o.aggregations);
+ this.clusters = o.clusters;
+ this.hits = o.hits;
+ this.numReducePhases = o.numReducePhases;
+ this.phaseTook = o.phaseTook;
+ this.pitId = o.pitId;
+ this.processorResults = _listCopy(o.processorResults);
+ this.profile = o.profile;
+ this.scrollId = o.scrollId;
+ this.shards = o.shards;
+ this.suggest = _mapCopy(o.suggest);
+ this.terminatedEarly = o.terminatedEarly;
this.timedOut = o.timedOut;
- this.timestamp = o.timestamp;
this.took = o.took;
- this.type = o.type;
- }
-
- private Builder(Builder o) {
- this.hits = _mapCopy(o.hits);
- this.id = o.id;
- this.judgmentList = _listCopy(o.judgmentList);
- this.querySetId = o.querySetId;
- this.results = _mapCopy(o.results);
- this.searchConfigurationList = _listCopy(o.searchConfigurationList);
- this.shards = _mapCopy(o.shards);
- this.size = o.size;
- this.status = o.status;
+ }
+
+ private Builder(Builder o) {
+ this.aggregations = _mapCopy(o.aggregations);
+ this.clusters = o.clusters;
+ this.hits = o.hits;
+ this.numReducePhases = o.numReducePhases;
+ this.phaseTook = o.phaseTook;
+ this.pitId = o.pitId;
+ this.processorResults = _listCopy(o.processorResults);
+ this.profile = o.profile;
+ this.scrollId = o.scrollId;
+ this.shards = o.shards;
+ this.suggest = _mapCopy(o.suggest);
+ this.terminatedEarly = o.terminatedEarly;
this.timedOut = o.timedOut;
- this.timestamp = o.timestamp;
this.took = o.took;
- this.type = o.type;
}
@Override
@Nonnull
- public Builder copy() {
- return new Builder(this);
+ public Builder copy() {
+ return new Builder<>(this);
}
/**
- * API name: {@code hits}
+ * API name: {@code aggregations}
*
*
- * Adds all elements of map to hits.
+ * Adds all elements of map to aggregations.
*
*/
@Nonnull
- public final Builder hits(Map map) {
- this.hits = _mapPutAll(this.hits, map);
+ public final Builder aggregations(Map map) {
+ this.aggregations = _mapPutAll(this.aggregations, map);
return this;
}
/**
- * API name: {@code hits}
+ * API name: {@code aggregations}
*
*
- * Adds an entry to hits.
+ * Adds an entry to aggregations.
*
*/
@Nonnull
- public final Builder hits(String key, JsonData value) {
- this.hits = _mapPut(this.hits, key, value);
+ public final Builder aggregations(String key, Aggregate value) {
+ this.aggregations = _mapPut(this.aggregations, key, value);
return this;
}
/**
- * API name: {@code id}
+ * API name: {@code aggregations}
+ *
+ *
+ * Adds a value to aggregations using a builder lambda.
+ *
*/
@Nonnull
- public final Builder id(@Nullable String value) {
- this.id = value;
- return this;
+ public final Builder aggregations(String key, Function> fn) {
+ return aggregations(key, fn.apply(new Aggregate.Builder()).build());
}
/**
- * API name: {@code judgmentList}
- *
- *
- * Adds all elements of list to judgmentList.
- *
+ * API name: {@code _clusters}
*/
@Nonnull
- public final Builder judgmentList(List list) {
- this.judgmentList = _listAddAll(this.judgmentList, list);
+ public final Builder clusters(@Nullable ClusterStatistics value) {
+ this.clusters = value;
return this;
}
/**
- * API name: {@code judgmentList}
- *
- *
- * Adds one or more values to judgmentList.
- *
+ * API name: {@code _clusters}
+ */
+ @Nonnull
+ public final Builder clusters(Function> fn) {
+ return clusters(fn.apply(new ClusterStatistics.Builder()).build());
+ }
+
+ /**
+ * Required - API name: {@code hits}
*/
@Nonnull
- public final Builder judgmentList(String value, String... values) {
- this.judgmentList = _listAdd(this.judgmentList, value, values);
+ public final Builder hits(HitsMetadata value) {
+ this.hits = value;
return this;
}
/**
- * API name: {@code querySetId}
+ * Required - API name: {@code hits}
*/
@Nonnull
- public final Builder querySetId(@Nullable String value) {
- this.querySetId = value;
+ public final Builder hits(Function, ObjectBuilder>> fn) {
+ return hits(fn.apply(new HitsMetadata.Builder()).build());
+ }
+
+ /**
+ * API name: {@code num_reduce_phases}
+ */
+ @Nonnull
+ public final Builder numReducePhases(@Nullable Integer value) {
+ this.numReducePhases = value;
return this;
}
/**
- * API name: {@code results}
- *
- *
- * Adds all elements of map to results.
- *
+ * API name: {@code phase_took}
*/
@Nonnull
- public final Builder results(Map map) {
- this.results = _mapPutAll(this.results, map);
+ public final Builder phaseTook(@Nullable PhaseTook value) {
+ this.phaseTook = value;
return this;
}
/**
- * API name: {@code results}
- *
- *
- * Adds an entry to results.
- *
+ * API name: {@code phase_took}
+ */
+ @Nonnull
+ public final Builder phaseTook(Function> fn) {
+ return phaseTook(fn.apply(new PhaseTook.Builder()).build());
+ }
+
+ /**
+ * API name: {@code pit_id}
*/
@Nonnull
- public final Builder results(String key, JsonData value) {
- this.results = _mapPut(this.results, key, value);
+ public final Builder pitId(@Nullable String value) {
+ this.pitId = value;
return this;
}
/**
- * API name: {@code searchConfigurationList}
+ * API name: {@code processor_results}
*
*
- * Adds all elements of list to searchConfigurationList.
+ * Adds all elements of list to processorResults.
*
*/
@Nonnull
- public final Builder searchConfigurationList(List list) {
- this.searchConfigurationList = _listAddAll(this.searchConfigurationList, list);
+ public final Builder processorResults(List list) {
+ this.processorResults = _listAddAll(this.processorResults, list);
return this;
}
/**
- * API name: {@code searchConfigurationList}
+ * API name: {@code processor_results}
*
*
- * Adds one or more values to searchConfigurationList.
+ * Adds one or more values to processorResults.
*
*/
@Nonnull
- public final Builder searchConfigurationList(String value, String... values) {
- this.searchConfigurationList = _listAdd(this.searchConfigurationList, value, values);
+ public final Builder processorResults(ProcessorExecutionDetail value, ProcessorExecutionDetail... values) {
+ this.processorResults = _listAdd(this.processorResults, value, values);
return this;
}
/**
- * API name: {@code _shards}
+ * API name: {@code processor_results}
*
*
- * Adds all elements of map to shards.
+ * Adds a value to processorResults using a builder lambda.
*
*/
@Nonnull
- public final Builder shards(Map map) {
- this.shards = _mapPutAll(this.shards, map);
+ public final Builder processorResults(
+ Function> fn
+ ) {
+ return processorResults(fn.apply(new ProcessorExecutionDetail.Builder()).build());
+ }
+
+ /**
+ * API name: {@code profile}
+ */
+ @Nonnull
+ public final Builder profile(@Nullable Profile value) {
+ this.profile = value;
return this;
}
/**
- * API name: {@code _shards}
- *
- *
- * Adds an entry to shards.
- *
+ * API name: {@code profile}
+ */
+ @Nonnull
+ public final Builder profile(Function> fn) {
+ return profile(fn.apply(new Profile.Builder()).build());
+ }
+
+ /**
+ * API name: {@code _scroll_id}
*/
@Nonnull
- public final Builder shards(String key, JsonData value) {
- this.shards = _mapPut(this.shards, key, value);
+ public final Builder scrollId(@Nullable String value) {
+ this.scrollId = value;
return this;
}
/**
- * API name: {@code size}
+ * Required - API name: {@code _shards}
*/
@Nonnull
- public final Builder size(@Nullable Integer value) {
- this.size = value;
+ public final Builder shards(ShardStatistics value) {
+ this.shards = value;
return this;
}
/**
- * API name: {@code status}
+ * Required - API name: {@code _shards}
+ */
+ @Nonnull
+ public final Builder shards(Function> fn) {
+ return shards(fn.apply(new ShardStatistics.Builder()).build());
+ }
+
+ /**
+ * API name: {@code suggest}
+ *
+ *
+ * Adds all elements of map to suggest.
+ *
*/
@Nonnull
- public final Builder status(@Nullable String value) {
- this.status = value;
+ public final Builder suggest(Map>> map) {
+ this.suggest = _mapPutAll(this.suggest, map);
return this;
}
/**
- * API name: {@code timed_out}
+ * API name: {@code suggest}
+ *
+ *
+ * Adds an entry to suggest.
+ *
*/
@Nonnull
- public final Builder timedOut(@Nullable Boolean value) {
- this.timedOut = value;
+ public final Builder suggest(String key, List> value) {
+ this.suggest = _mapPut(this.suggest, key, value);
return this;
}
/**
- * API name: {@code timestamp}
+ * API name: {@code terminated_early}
*/
@Nonnull
- public final Builder timestamp(@Nullable String value) {
- this.timestamp = value;
+ public final Builder terminatedEarly(@Nullable Boolean value) {
+ this.terminatedEarly = value;
return this;
}
/**
- * API name: {@code took}
+ * Required - API name: {@code timed_out}
*/
@Nonnull
- public final Builder took(@Nullable Integer value) {
- this.took = value;
+ public final Builder timedOut(boolean value) {
+ this.timedOut = value;
return this;
}
/**
- * API name: {@code type}
+ * Required - API name: {@code took}
*/
@Nonnull
- public final Builder type(@Nullable String value) {
- this.type = value;
+ public final Builder took(long value) {
+ this.took = value;
return this;
}
@@ -624,59 +665,75 @@ public final Builder type(@Nullable String value) {
*/
@Override
@Nonnull
- public GetExperimentsResponse build() {
+ public GetExperimentsResponse build() {
_checkSingleUse();
- return new GetExperimentsResponse(this);
+ return new GetExperimentsResponse<>(this);
}
}
// ---------------------------------------------------------------------------------------------
/**
- * Json deserializer for {@link GetExperimentsResponse}
+ * Create a JSON deserializer for GetExperimentsResponse.
+ */
+ public static JsonpDeserializer> createGetExperimentsResponseDeserializer(
+ JsonpDeserializer tDocumentDeserializer
+ ) {
+ return ObjectBuilderDeserializer.createForObject(
+ Builder::new,
+ op -> GetExperimentsResponse.setupGetExperimentsResponseDeserializer(op, tDocumentDeserializer)
+ );
+ }
+
+ /**
+ * Json deserializer for {@link GetExperimentsResponse} based on named deserializers provided by the calling {@code JsonMapper}.
*/
- public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer.lazy(
- Builder::new,
- GetExperimentsResponse::setupGetExperimentsResponseDeserializer
+ public static final JsonpDeserializer> _DESERIALIZER = createGetExperimentsResponseDeserializer(
+ new NamedDeserializer<>("org.opensearch.client:Deserializer:search_relevance.get_experiments.TDocument")
);
- protected static void setupGetExperimentsResponseDeserializer(ObjectDeserializer op) {
- op.add(Builder::hits, JsonpDeserializer.stringMapDeserializer(JsonData._DESERIALIZER), "hits");
- op.add(Builder::id, JsonpDeserializer.stringDeserializer(), "id");
- op.add(Builder::judgmentList, JsonpDeserializer.arrayDeserializer(JsonpDeserializer.stringDeserializer()), "judgmentList");
- op.add(Builder::querySetId, JsonpDeserializer.stringDeserializer(), "querySetId");
- op.add(Builder::results, JsonpDeserializer.stringMapDeserializer(JsonData._DESERIALIZER), "results");
+ protected static void setupGetExperimentsResponseDeserializer(
+ ObjectDeserializer> op,
+ JsonpDeserializer tDocumentDeserializer
+ ) {
+ op.add(Builder::aggregations, Aggregate._TYPED_KEYS_DESERIALIZER, "aggregations");
+ op.add(Builder::clusters, ClusterStatistics._DESERIALIZER, "_clusters");
+ op.add(Builder::hits, HitsMetadata.createHitsMetadataDeserializer(tDocumentDeserializer), "hits");
+ op.add(Builder::numReducePhases, JsonpDeserializer.integerDeserializer(), "num_reduce_phases");
+ op.add(Builder::phaseTook, PhaseTook._DESERIALIZER, "phase_took");
+ op.add(Builder::pitId, JsonpDeserializer.stringDeserializer(), "pit_id");
+ op.add(Builder::processorResults, JsonpDeserializer.arrayDeserializer(ProcessorExecutionDetail._DESERIALIZER), "processor_results");
+ op.add(Builder::profile, Profile._DESERIALIZER, "profile");
+ op.add(Builder::scrollId, JsonpDeserializer.stringDeserializer(), "_scroll_id");
+ op.add(Builder::shards, ShardStatistics._DESERIALIZER, "_shards");
op.add(
- Builder::searchConfigurationList,
- JsonpDeserializer.arrayDeserializer(JsonpDeserializer.stringDeserializer()),
- "searchConfigurationList"
+ Builder::suggest,
+ ExternallyTaggedUnion.arrayDeserializer(Suggest.createSuggestDeserializer(JsonData._DESERIALIZER)),
+ "suggest"
);
- op.add(Builder::shards, JsonpDeserializer.stringMapDeserializer(JsonData._DESERIALIZER), "_shards");
- op.add(Builder::size, JsonpDeserializer.integerDeserializer(), "size");
- op.add(Builder::status, JsonpDeserializer.stringDeserializer(), "status");
+ op.add(Builder::terminatedEarly, JsonpDeserializer.booleanDeserializer(), "terminated_early");
op.add(Builder::timedOut, JsonpDeserializer.booleanDeserializer(), "timed_out");
- op.add(Builder::timestamp, JsonpDeserializer.stringDeserializer(), "timestamp");
- op.add(Builder::took, JsonpDeserializer.integerDeserializer(), "took");
- op.add(Builder::type, JsonpDeserializer.stringDeserializer(), "type");
+ op.add(Builder::took, JsonpDeserializer.longDeserializer(), "took");
}
@Override
public int hashCode() {
int result = 17;
- result = 31 * result + Objects.hashCode(this.hits);
- result = 31 * result + Objects.hashCode(this.id);
- result = 31 * result + Objects.hashCode(this.judgmentList);
- result = 31 * result + Objects.hashCode(this.querySetId);
- result = 31 * result + Objects.hashCode(this.results);
- result = 31 * result + Objects.hashCode(this.searchConfigurationList);
- result = 31 * result + Objects.hashCode(this.shards);
- result = 31 * result + Objects.hashCode(this.size);
- result = 31 * result + Objects.hashCode(this.status);
- result = 31 * result + Objects.hashCode(this.timedOut);
- result = 31 * result + Objects.hashCode(this.timestamp);
- result = 31 * result + Objects.hashCode(this.took);
- result = 31 * result + Objects.hashCode(this.type);
+ result = 31 * result + Objects.hashCode(this.aggregations);
+ result = 31 * result + Objects.hashCode(this.clusters);
+ result = 31 * result + this.hits.hashCode();
+ result = 31 * result + Objects.hashCode(this.numReducePhases);
+ result = 31 * result + Objects.hashCode(this.phaseTook);
+ result = 31 * result + Objects.hashCode(this.pitId);
+ result = 31 * result + Objects.hashCode(this.processorResults);
+ result = 31 * result + Objects.hashCode(this.profile);
+ result = 31 * result + Objects.hashCode(this.scrollId);
+ result = 31 * result + this.shards.hashCode();
+ result = 31 * result + Objects.hashCode(this.suggest);
+ result = 31 * result + Objects.hashCode(this.terminatedEarly);
+ result = 31 * result + Boolean.hashCode(this.timedOut);
+ result = 31 * result + Long.hashCode(this.took);
return result;
}
@@ -684,19 +741,20 @@ public int hashCode() {
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || this.getClass() != o.getClass()) return false;
- GetExperimentsResponse other = (GetExperimentsResponse) o;
- return Objects.equals(this.hits, other.hits)
- && Objects.equals(this.id, other.id)
- && Objects.equals(this.judgmentList, other.judgmentList)
- && Objects.equals(this.querySetId, other.querySetId)
- && Objects.equals(this.results, other.results)
- && Objects.equals(this.searchConfigurationList, other.searchConfigurationList)
- && Objects.equals(this.shards, other.shards)
- && Objects.equals(this.size, other.size)
- && Objects.equals(this.status, other.status)
- && Objects.equals(this.timedOut, other.timedOut)
- && Objects.equals(this.timestamp, other.timestamp)
- && Objects.equals(this.took, other.took)
- && Objects.equals(this.type, other.type);
+ GetExperimentsResponse> other = (GetExperimentsResponse>) o;
+ return Objects.equals(this.aggregations, other.aggregations)
+ && Objects.equals(this.clusters, other.clusters)
+ && this.hits.equals(other.hits)
+ && Objects.equals(this.numReducePhases, other.numReducePhases)
+ && Objects.equals(this.phaseTook, other.phaseTook)
+ && Objects.equals(this.pitId, other.pitId)
+ && Objects.equals(this.processorResults, other.processorResults)
+ && Objects.equals(this.profile, other.profile)
+ && Objects.equals(this.scrollId, other.scrollId)
+ && this.shards.equals(other.shards)
+ && Objects.equals(this.suggest, other.suggest)
+ && Objects.equals(this.terminatedEarly, other.terminatedEarly)
+ && this.timedOut == other.timedOut
+ && this.took == other.took;
}
}
diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/search_relevance/GetJudgmentsRequest.java b/java-client/src/generated/java/org/opensearch/client/opensearch/search_relevance/GetJudgmentsRequest.java
index 00cc849109..14eaded7a3 100644
--- a/java-client/src/generated/java/org/opensearch/client/opensearch/search_relevance/GetJudgmentsRequest.java
+++ b/java-client/src/generated/java/org/opensearch/client/opensearch/search_relevance/GetJudgmentsRequest.java
@@ -43,6 +43,7 @@
import javax.annotation.Generated;
import javax.annotation.Nonnull;
import javax.annotation.Nullable;
+import org.opensearch.client.json.JsonpDeserializer;
import org.opensearch.client.opensearch._types.ErrorResponse;
import org.opensearch.client.opensearch._types.RequestBase;
import org.opensearch.client.transport.Endpoint;
@@ -159,7 +160,7 @@ public GetJudgmentsRequest build() {
/**
* Endpoint "{@code search_relevance.get_judgments}".
*/
- public static final Endpoint _ENDPOINT = new SimpleEndpoint<>(
+ public static final SimpleEndpoint _ENDPOINT = new SimpleEndpoint<>(
// Request method
request -> "GET",
// Request path
@@ -193,6 +194,16 @@ public GetJudgmentsRequest build() {
GetJudgmentsResponse._DESERIALIZER
);
+ /**
+ * Create an "{@code search_relevance.get_judgments}" endpoint.
+ */
+ public static <
+ TDocument> Endpoint, ErrorResponse> createSearchRelevanceGetJudgmentsEndpoint(
+ JsonpDeserializer tDocumentDeserializer
+ ) {
+ return _ENDPOINT.withResponseDeserializer(GetJudgmentsResponse.createGetJudgmentsResponseDeserializer(tDocumentDeserializer));
+ }
+
@Override
public int hashCode() {
int result = 17;
diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/search_relevance/GetJudgmentsResponse.java b/java-client/src/generated/java/org/opensearch/client/opensearch/search_relevance/GetJudgmentsResponse.java
index 9565a6f474..54eec79956 100644
--- a/java-client/src/generated/java/org/opensearch/client/opensearch/search_relevance/GetJudgmentsResponse.java
+++ b/java-client/src/generated/java/org/opensearch/client/opensearch/search_relevance/GetJudgmentsResponse.java
@@ -37,19 +37,30 @@
package org.opensearch.client.opensearch.search_relevance;
import jakarta.json.stream.JsonGenerator;
+import java.util.List;
import java.util.Map;
import java.util.Objects;
import java.util.function.Function;
import javax.annotation.Generated;
import javax.annotation.Nonnull;
import javax.annotation.Nullable;
+import org.opensearch.client.json.ExternallyTaggedUnion;
import org.opensearch.client.json.JsonData;
import org.opensearch.client.json.JsonpDeserializable;
import org.opensearch.client.json.JsonpDeserializer;
import org.opensearch.client.json.JsonpMapper;
+import org.opensearch.client.json.NamedDeserializer;
import org.opensearch.client.json.ObjectBuilderDeserializer;
import org.opensearch.client.json.ObjectDeserializer;
import org.opensearch.client.json.PlainJsonSerializable;
+import org.opensearch.client.opensearch._types.ClusterStatistics;
+import org.opensearch.client.opensearch._types.PhaseTook;
+import org.opensearch.client.opensearch._types.ShardStatistics;
+import org.opensearch.client.opensearch._types.aggregations.Aggregate;
+import org.opensearch.client.opensearch.core.search.HitsMetadata;
+import org.opensearch.client.opensearch.core.search.ProcessorExecutionDetail;
+import org.opensearch.client.opensearch.core.search.Profile;
+import org.opensearch.client.opensearch.core.search.Suggest;
import org.opensearch.client.util.ApiTypeHelper;
import org.opensearch.client.util.CopyableBuilder;
import org.opensearch.client.util.ObjectBuilder;
@@ -60,147 +71,184 @@
@JsonpDeserializable
@Generated("org.opensearch.client.codegen.CodeGenerator")
-public class GetJudgmentsResponse implements PlainJsonSerializable, ToCopyableBuilder {
+public class GetJudgmentsResponse
+ implements
+ PlainJsonSerializable,
+ ToCopyableBuilder, GetJudgmentsResponse> {
@Nonnull
- private final Map hits;
+ private final Map aggregations;
@Nullable
- private final String id;
+ private final ClusterStatistics clusters;
@Nonnull
- private final Map judgmentScores;
+ private final HitsMetadata hits;
- @Nonnull
- private final Map metadata;
+ @Nullable
+ private final Integer numReducePhases;
+
+ @Nullable
+ private final PhaseTook phaseTook;
@Nullable
- private final String name;
+ private final String pitId;
@Nonnull
- private final Map shards;
+ private final List processorResults;
@Nullable
- private final String status;
+ private final Profile profile;
@Nullable
- private final Boolean timedOut;
+ private final String scrollId;
- @Nullable
- private final String timestamp;
+ @Nonnull
+ private final ShardStatistics shards;
- @Nullable
- private final Integer took;
+ @Nonnull
+ private final Map>> suggest;
@Nullable
- private final String type;
+ private final Boolean terminatedEarly;
+
+ private final boolean timedOut;
+
+ private final long took;
// ---------------------------------------------------------------------------------------------
- private GetJudgmentsResponse(Builder builder) {
- this.hits = ApiTypeHelper.unmodifiable(builder.hits);
- this.id = builder.id;
- this.judgmentScores = ApiTypeHelper.unmodifiable(builder.judgmentScores);
- this.metadata = ApiTypeHelper.unmodifiable(builder.metadata);
- this.name = builder.name;
- this.shards = ApiTypeHelper.unmodifiable(builder.shards);
- this.status = builder.status;
- this.timedOut = builder.timedOut;
- this.timestamp = builder.timestamp;
- this.took = builder.took;
- this.type = builder.type;
+ private GetJudgmentsResponse(Builder builder) {
+ this.aggregations = ApiTypeHelper.unmodifiable(builder.aggregations);
+ this.clusters = builder.clusters;
+ this.hits = ApiTypeHelper.requireNonNull(builder.hits, this, "hits");
+ this.numReducePhases = builder.numReducePhases;
+ this.phaseTook = builder.phaseTook;
+ this.pitId = builder.pitId;
+ this.processorResults = ApiTypeHelper.unmodifiable(builder.processorResults);
+ this.profile = builder.profile;
+ this.scrollId = builder.scrollId;
+ this.shards = ApiTypeHelper.requireNonNull(builder.shards, this, "shards");
+ this.suggest = ApiTypeHelper.unmodifiable(builder.suggest);
+ this.terminatedEarly = builder.terminatedEarly;
+ this.timedOut = ApiTypeHelper.requireNonNull(builder.timedOut, this, "timedOut");
+ this.took = ApiTypeHelper.requireNonNull(builder.took, this, "took");
}
- public static GetJudgmentsResponse of(Function> fn) {
- return fn.apply(new Builder()).build();
+ public static GetJudgmentsResponse of(
+ Function, ObjectBuilder>> fn
+ ) {
+ return fn.apply(new Builder<>()).build();
}
/**
- * API name: {@code hits}
+ * API name: {@code aggregations}
*/
@Nonnull
- public final Map hits() {
- return this.hits;
+ public final Map aggregations() {
+ return this.aggregations;
}
/**
- * API name: {@code id}
+ * API name: {@code _clusters}
*/
@Nullable
- public final String id() {
- return this.id;
+ public final ClusterStatistics clusters() {
+ return this.clusters;
}
/**
- * API name: {@code judgmentScores}
+ * Required - API name: {@code hits}
*/
@Nonnull
- public final Map judgmentScores() {
- return this.judgmentScores;
+ public final HitsMetadata hits() {
+ return this.hits;
}
/**
- * API name: {@code metadata}
+ * API name: {@code num_reduce_phases}
*/
- @Nonnull
- public final Map metadata() {
- return this.metadata;
+ @Nullable
+ public final Integer numReducePhases() {
+ return this.numReducePhases;
+ }
+
+ /**
+ * API name: {@code phase_took}
+ */
+ @Nullable
+ public final PhaseTook phaseTook() {
+ return this.phaseTook;
}
/**
- * API name: {@code name}
+ * API name: {@code pit_id}
*/
@Nullable
- public final String name() {
- return this.name;
+ public final String pitId() {
+ return this.pitId;
}
/**
- * API name: {@code _shards}
+ * API name: {@code processor_results}
*/
@Nonnull
- public final Map shards() {
- return this.shards;
+ public final List processorResults() {
+ return this.processorResults;
}
/**
- * API name: {@code status}
+ * API name: {@code profile}
*/
@Nullable
- public final String status() {
- return this.status;
+ public final Profile profile() {
+ return this.profile;
}
/**
- * API name: {@code timed_out}
+ * API name: {@code _scroll_id}
*/
@Nullable
- public final Boolean timedOut() {
- return this.timedOut;
+ public final String scrollId() {
+ return this.scrollId;
}
/**
- * API name: {@code timestamp}
+ * Required - API name: {@code _shards}
*/
- @Nullable
- public final String timestamp() {
- return this.timestamp;
+ @Nonnull
+ public final ShardStatistics shards() {
+ return this.shards;
}
/**
- * API name: {@code took}
+ * API name: {@code suggest}
*/
- @Nullable
- public final Integer took() {
- return this.took;
+ @Nonnull
+ public final Map>> suggest() {
+ return this.suggest;
}
/**
- * API name: {@code type}
+ * API name: {@code terminated_early}
*/
@Nullable
- public final String type() {
- return this.type;
+ public final Boolean terminatedEarly() {
+ return this.terminatedEarly;
+ }
+
+ /**
+ * Required - API name: {@code timed_out}
+ */
+ public final boolean timedOut() {
+ return this.timedOut;
+ }
+
+ /**
+ * Required - API name: {@code took}
+ */
+ public final long took() {
+ return this.took;
}
/**
@@ -214,322 +262,399 @@ public void serialize(JsonGenerator generator, JsonpMapper mapper) {
}
protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) {
- if (ApiTypeHelper.isDefined(this.hits)) {
- generator.writeKey("hits");
- generator.writeStartObject();
- for (Map.Entry item0 : this.hits.entrySet()) {
- generator.writeKey(item0.getKey());
- item0.getValue().serialize(generator, mapper);
- }
- generator.writeEnd();
+ if (ApiTypeHelper.isDefined(this.aggregations)) {
+ generator.writeKey("aggregations");
+ ExternallyTaggedUnion.serializeTypedKeys(this.aggregations, generator, mapper);
}
- if (this.id != null) {
- generator.writeKey("id");
- generator.write(this.id);
+ if (this.clusters != null) {
+ generator.writeKey("_clusters");
+ this.clusters.serialize(generator, mapper);
}
- if (ApiTypeHelper.isDefined(this.judgmentScores)) {
- generator.writeKey("judgmentScores");
- generator.writeStartObject();
- for (Map.Entry item0 : this.judgmentScores.entrySet()) {
- generator.writeKey(item0.getKey());
- item0.getValue().serialize(generator, mapper);
- }
- generator.writeEnd();
+ generator.writeKey("hits");
+ this.hits.serialize(generator, mapper);
+
+ if (this.numReducePhases != null) {
+ generator.writeKey("num_reduce_phases");
+ generator.write(this.numReducePhases);
}
- if (ApiTypeHelper.isDefined(this.metadata)) {
- generator.writeKey("metadata");
- generator.writeStartObject();
- for (Map.Entry item0 : this.metadata.entrySet()) {
- generator.writeKey(item0.getKey());
- item0.getValue().serialize(generator, mapper);
- }
- generator.writeEnd();
+ if (this.phaseTook != null) {
+ generator.writeKey("phase_took");
+ this.phaseTook.serialize(generator, mapper);
}
- if (this.name != null) {
- generator.writeKey("name");
- generator.write(this.name);
+ if (this.pitId != null) {
+ generator.writeKey("pit_id");
+ generator.write(this.pitId);
}
- if (ApiTypeHelper.isDefined(this.shards)) {
- generator.writeKey("_shards");
- generator.writeStartObject();
- for (Map.Entry item0 : this.shards.entrySet()) {
- generator.writeKey(item0.getKey());
- item0.getValue().serialize(generator, mapper);
+ if (ApiTypeHelper.isDefined(this.processorResults)) {
+ generator.writeKey("processor_results");
+ generator.writeStartArray();
+ for (ProcessorExecutionDetail item0 : this.processorResults) {
+ item0.serialize(generator, mapper);
}
generator.writeEnd();
}
- if (this.status != null) {
- generator.writeKey("status");
- generator.write(this.status);
+ if (this.profile != null) {
+ generator.writeKey("profile");
+ this.profile.serialize(generator, mapper);
}
- if (this.timedOut != null) {
- generator.writeKey("timed_out");
- generator.write(this.timedOut);
+ if (this.scrollId != null) {
+ generator.writeKey("_scroll_id");
+ generator.write(this.scrollId);
}
- if (this.timestamp != null) {
- generator.writeKey("timestamp");
- generator.write(this.timestamp);
- }
+ generator.writeKey("_shards");
+ this.shards.serialize(generator, mapper);
- if (this.took != null) {
- generator.writeKey("took");
- generator.write(this.took);
+ if (ApiTypeHelper.isDefined(this.suggest)) {
+ generator.writeKey("suggest");
+ ExternallyTaggedUnion.serializeTypedKeysArray(this.suggest, generator, mapper);
}
- if (this.type != null) {
- generator.writeKey("type");
- generator.write(this.type);
+ if (this.terminatedEarly != null) {
+ generator.writeKey("terminated_early");
+ generator.write(this.terminatedEarly);
}
+
+ generator.writeKey("timed_out");
+ generator.write(this.timedOut);
+
+ generator.writeKey("took");
+ generator.write(this.took);
}
// ---------------------------------------------------------------------------------------------
@Override
@Nonnull
- public Builder toBuilder() {
- return new Builder(this);
+ public Builder toBuilder() {
+ return new Builder<>(this);
}
@Nonnull
- public static Builder builder() {
- return new Builder();
+ public static Builder builder() {
+ return new Builder<>();
}
/**
* Builder for {@link GetJudgmentsResponse}.
*/
- public static class Builder extends ObjectBuilderBase implements CopyableBuilder {
+ public static class Builder extends ObjectBuilderBase
+ implements
+ CopyableBuilder, GetJudgmentsResponse> {
@Nullable
- private Map hits;
+ private Map aggregations;
@Nullable
- private String id;
+ private ClusterStatistics clusters;
+ private HitsMetadata