diff --git a/java-client/src/main/java/co/elastic/clients/elasticsearch/_types/mapping/TextIndexPrefixes.java b/java-client/src/main/java/co/elastic/clients/elasticsearch/_types/mapping/TextIndexPrefixes.java index 1802423738..7dc1a8c21b 100644 --- a/java-client/src/main/java/co/elastic/clients/elasticsearch/_types/mapping/TextIndexPrefixes.java +++ b/java-client/src/main/java/co/elastic/clients/elasticsearch/_types/mapping/TextIndexPrefixes.java @@ -26,13 +26,13 @@ import co.elastic.clients.json.JsonpUtils; import co.elastic.clients.json.ObjectBuilderDeserializer; import co.elastic.clients.json.ObjectDeserializer; -import co.elastic.clients.util.ApiTypeHelper; import co.elastic.clients.util.ObjectBuilder; import co.elastic.clients.util.WithJsonObjectBuilderBase; import jakarta.json.stream.JsonGenerator; import java.lang.Integer; import java.util.Objects; import java.util.function.Function; +import javax.annotation.Nullable; //---------------------------------------------------------------- // THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. @@ -59,16 +59,18 @@ */ @JsonpDeserializable public class TextIndexPrefixes implements JsonpSerializable { - private final int maxChars; + @Nullable + private final Integer maxChars; - private final int minChars; + @Nullable + private final Integer minChars; // --------------------------------------------------------------------------------------------- private TextIndexPrefixes(Builder builder) { - this.maxChars = ApiTypeHelper.requireNonNull(builder.maxChars, this, "maxChars", 0); - this.minChars = ApiTypeHelper.requireNonNull(builder.minChars, this, "minChars", 0); + this.maxChars = builder.maxChars; + this.minChars = builder.minChars; } @@ -77,16 +79,18 @@ public static TextIndexPrefixes of(Function implements ObjectBuilder { + @Nullable private Integer maxChars; + @Nullable private Integer minChars; public Builder() { @@ -133,17 +144,17 @@ private Builder(TextIndexPrefixes instance) { } /** - * Required - API name: {@code max_chars} + * API name: {@code max_chars} */ - public final Builder maxChars(int value) { + public final Builder maxChars(@Nullable Integer value) { this.maxChars = value; return this; } /** - * Required - API name: {@code min_chars} + * API name: {@code min_chars} */ - public final Builder minChars(int value) { + public final Builder minChars(@Nullable Integer value) { this.minChars = value; return this; } diff --git a/java-client/src/main/java/co/elastic/clients/elasticsearch/doc-files/api-spec.html b/java-client/src/main/java/co/elastic/clients/elasticsearch/doc-files/api-spec.html index 4751164572..34f667e788 100644 --- a/java-client/src/main/java/co/elastic/clients/elasticsearch/doc-files/api-spec.html +++ b/java-client/src/main/java/co/elastic/clients/elasticsearch/doc-files/api-spec.html @@ -2184,7 +2184,7 @@ 'inference.stream_completion.Response': 'inference/stream_completion/StreamInferenceResponse.ts#L22-L25', 'inference.text_embedding.Request': 'inference/text_embedding/TextEmbeddingRequest.ts#L25-L79', 'inference.text_embedding.Response': 'inference/text_embedding/TextEmbeddingResponse.ts#L22-L25', -'inference.update.Request': 'inference/update/UpdateInferenceRequest.ts#L25-L64', +'inference.update.Request': 'inference/update/UpdateInferenceRequest.ts#L26-L74', 'inference.update.Response': 'inference/update/UpdateInferenceResponse.ts#L22-L25', 'ingest._types.AppendProcessor': 'ingest/_types/Processors.ts#L334-L366', 'ingest._types.AttachmentProcessor': 'ingest/_types/Processors.ts#L368-L419', @@ -3571,10 +3571,10 @@ if (hash.length > 1) { hash = hash.substring(1); } - window.location = "https://github.com/elastic/elasticsearch-specification/tree/7c4055b7a8e6c585dd8ed999086000838dcdf35e/specification/" + (paths[hash] || ""); + window.location = "https://github.com/elastic/elasticsearch-specification/tree/e889bcfe71d60657cae811fb0b8e105569cc499f/specification/" + (paths[hash] || ""); - Please see the Elasticsearch API specification. + Please see the Elasticsearch API specification. diff --git a/java-client/src/main/java/co/elastic/clients/elasticsearch/inference/PutRequest.java b/java-client/src/main/java/co/elastic/clients/elasticsearch/inference/PutRequest.java index a32dedef7b..ebb6d4febb 100644 --- a/java-client/src/main/java/co/elastic/clients/elasticsearch/inference/PutRequest.java +++ b/java-client/src/main/java/co/elastic/clients/elasticsearch/inference/PutRequest.java @@ -171,7 +171,9 @@ public final TaskType taskType() { /** * Specifies the amount of time to wait for the inference endpoint to be - * created. + * created. The default depends on the task type: 120s for + * completion and chat_completion, and 30s for all + * other task types. *

* API name: {@code timeout} */ @@ -244,7 +246,9 @@ public final Builder taskType(@Nullable TaskType value) { /** * Specifies the amount of time to wait for the inference endpoint to be - * created. + * created. The default depends on the task type: 120s for + * completion and chat_completion, and 30s for all + * other task types. *

* API name: {@code timeout} */ @@ -255,7 +259,9 @@ public final Builder timeout(@Nullable Time value) { /** * Specifies the amount of time to wait for the inference endpoint to be - * created. + * created. The default depends on the task type: 120s for + * completion and chat_completion, and 30s for all + * other task types. *

* API name: {@code timeout} */ diff --git a/java-client/src/main/java/co/elastic/clients/elasticsearch/inference/UpdateInferenceRequest.java b/java-client/src/main/java/co/elastic/clients/elasticsearch/inference/UpdateInferenceRequest.java index 5a48e9c6de..300825e17b 100644 --- a/java-client/src/main/java/co/elastic/clients/elasticsearch/inference/UpdateInferenceRequest.java +++ b/java-client/src/main/java/co/elastic/clients/elasticsearch/inference/UpdateInferenceRequest.java @@ -21,6 +21,7 @@ import co.elastic.clients.elasticsearch._types.ErrorResponse; import co.elastic.clients.elasticsearch._types.RequestBase; +import co.elastic.clients.elasticsearch._types.Time; import co.elastic.clients.json.JsonpDeserializable; import co.elastic.clients.json.JsonpDeserializer; import co.elastic.clients.json.JsonpMapper; @@ -34,7 +35,6 @@ import jakarta.json.stream.JsonGenerator; import jakarta.json.stream.JsonParser; import java.lang.String; -import java.util.Collections; import java.util.HashMap; import java.util.Map; import java.util.Objects; @@ -85,6 +85,9 @@ public class UpdateInferenceRequest extends RequestBase implements JsonpSerializ @Nullable private final TaskType taskType; + @Nullable + private final Time timeout; + private final InferenceEndpoint inferenceConfig; // --------------------------------------------------------------------------------------------- @@ -93,6 +96,7 @@ private UpdateInferenceRequest(Builder builder) { this.inferenceId = ApiTypeHelper.requireNonNull(builder.inferenceId, this, "inferenceId"); this.taskType = builder.taskType; + this.timeout = builder.timeout; this.inferenceConfig = ApiTypeHelper.requireNonNull(builder.inferenceConfig, this, "inferenceConfig"); } @@ -120,6 +124,19 @@ public final TaskType taskType() { return this.taskType; } + /** + * Specifies the amount of time to wait for the inference endpoint to be + * updated. The default depends on the task type: 120s for + * completion and chat_completion, and 30s for all + * other task types. + *

+ * API name: {@code timeout} + */ + @Nullable + public final Time timeout() { + return this.timeout; + } + /** * Required - Request body. */ @@ -149,6 +166,9 @@ public static class Builder extends RequestBase.AbstractBuilder @Nullable private TaskType taskType; + @Nullable + private Time timeout; + private InferenceEndpoint inferenceConfig; public Builder() { @@ -156,6 +176,7 @@ public Builder() { private Builder(UpdateInferenceRequest instance) { this.inferenceId = instance.inferenceId; this.taskType = instance.taskType; + this.timeout = instance.timeout; this.inferenceConfig = instance.inferenceConfig; } @@ -179,6 +200,31 @@ public final Builder taskType(@Nullable TaskType value) { return this; } + /** + * Specifies the amount of time to wait for the inference endpoint to be + * updated. The default depends on the task type: 120s for + * completion and chat_completion, and 30s for all + * other task types. + *

+ * API name: {@code timeout} + */ + public final Builder timeout(@Nullable Time value) { + this.timeout = value; + return this; + } + + /** + * Specifies the amount of time to wait for the inference endpoint to be + * updated. The default depends on the task type: 120s for + * completion and chat_completion, and 30s for all + * other task types. + *

+ * API name: {@code timeout} + */ + public final Builder timeout(Function> fn) { + return this.timeout(fn.apply(new Time.Builder()).build()); + } + /** * Required - Request body. */ @@ -306,7 +352,11 @@ protected static JsonpDeserializer createUpdateInference // Request parameters request -> { - return Collections.emptyMap(); + Map params = new HashMap<>(); + if (request.timeout != null) { + params.put("timeout", request.timeout._toJsonString()); + } + return params; }, SimpleEndpoint.emptyMap(), true, UpdateInferenceResponse._DESERIALIZER); }