Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand All @@ -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;

}

Expand All @@ -77,16 +79,18 @@ public static TextIndexPrefixes of(Function<Builder, ObjectBuilder<TextIndexPref
}

/**
* Required - API name: {@code max_chars}
* API name: {@code max_chars}
*/
public final int maxChars() {
@Nullable
public final Integer maxChars() {
return this.maxChars;
}

/**
* Required - API name: {@code min_chars}
* API name: {@code min_chars}
*/
public final int minChars() {
@Nullable
public final Integer minChars() {
return this.minChars;
}

Expand All @@ -101,11 +105,16 @@ public void serialize(JsonGenerator generator, JsonpMapper mapper) {

protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) {

generator.writeKey("max_chars");
generator.write(this.maxChars);
if (this.maxChars != null) {
generator.writeKey("max_chars");
generator.write(this.maxChars);

generator.writeKey("min_chars");
generator.write(this.minChars);
}
if (this.minChars != null) {
generator.writeKey("min_chars");
generator.write(this.minChars);

}

}

Expand All @@ -121,8 +130,10 @@ public String toString() {
*/

public static class Builder extends WithJsonObjectBuilderBase<Builder> implements ObjectBuilder<TextIndexPrefixes> {
@Nullable
private Integer maxChars;

@Nullable
private Integer minChars;

public Builder() {
Expand All @@ -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;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down Expand Up @@ -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] || "");
</script>
</head>
<body>
Please see the <a href="https://github.com/elastic/elasticsearch-specification/tree/7c4055b7a8e6c585dd8ed999086000838dcdf35e/specification/">Elasticsearch API specification</a>.
Please see the <a href="https://github.com/elastic/elasticsearch-specification/tree/e889bcfe71d60657cae811fb0b8e105569cc499f/specification/">Elasticsearch API specification</a>.
</body>
</html>
Original file line number Diff line number Diff line change
Expand Up @@ -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
* <code>completion</code> and <code>chat_completion</code>, and 30s for all
* other task types.
* <p>
* API name: {@code timeout}
*/
Expand Down Expand Up @@ -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
* <code>completion</code> and <code>chat_completion</code>, and 30s for all
* other task types.
* <p>
* API name: {@code timeout}
*/
Expand All @@ -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
* <code>completion</code> and <code>chat_completion</code>, and 30s for all
* other task types.
* <p>
* API name: {@code timeout}
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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;
Expand Down Expand Up @@ -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;

// ---------------------------------------------------------------------------------------------
Expand All @@ -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");

}
Expand Down Expand Up @@ -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
* <code>completion</code> and <code>chat_completion</code>, and 30s for all
* other task types.
* <p>
* API name: {@code timeout}
*/
@Nullable
public final Time timeout() {
return this.timeout;
}

/**
* Required - Request body.
*/
Expand Down Expand Up @@ -149,13 +166,17 @@ public static class Builder extends RequestBase.AbstractBuilder<Builder>
@Nullable
private TaskType taskType;

@Nullable
private Time timeout;

private InferenceEndpoint inferenceConfig;

public Builder() {
}
private Builder(UpdateInferenceRequest instance) {
this.inferenceId = instance.inferenceId;
this.taskType = instance.taskType;
this.timeout = instance.timeout;
this.inferenceConfig = instance.inferenceConfig;

}
Expand All @@ -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
* <code>completion</code> and <code>chat_completion</code>, and 30s for all
* other task types.
* <p>
* 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
* <code>completion</code> and <code>chat_completion</code>, and 30s for all
* other task types.
* <p>
* API name: {@code timeout}
*/
public final Builder timeout(Function<Time.Builder, ObjectBuilder<Time>> fn) {
return this.timeout(fn.apply(new Time.Builder()).build());
}

/**
* Required - Request body.
*/
Expand Down Expand Up @@ -306,7 +352,11 @@ protected static JsonpDeserializer<UpdateInferenceRequest> createUpdateInference

// Request parameters
request -> {
return Collections.emptyMap();
Map<String, String> params = new HashMap<>();
if (request.timeout != null) {
params.put("timeout", request.timeout._toJsonString());
}
return params;

}, SimpleEndpoint.emptyMap(), true, UpdateInferenceResponse._DESERIALIZER);
}
Loading