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 @@ -150,8 +150,8 @@ public final Time masterTimeout() {
}

/**
* Comma-separated list of component template names used to limit the request.
* Wildcard (<code>*</code>) expressions are supported.
* Name of component template to retrieve. Wildcard (<code>*</code>) expressions
* are supported.
* <p>
* API name: {@code name}
*/
Expand Down Expand Up @@ -254,8 +254,8 @@ public final Builder masterTimeout(Function<Time.Builder, ObjectBuilder<Time>> f
}

/**
* Comma-separated list of component template names used to limit the request.
* Wildcard (<code>*</code>) expressions are supported.
* Name of component template to retrieve. Wildcard (<code>*</code>) expressions
* are supported.
* <p>
* API name: {@code name}
*/
Expand Down

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -236,7 +236,7 @@ public final List<String> index() {
}

/**
* The number of segments the index should be merged into (defayult: dynamic)
* The number of segments the index should be merged into (default: dynamic)
* <p>
* API name: {@code max_num_segments}
*/
Expand Down Expand Up @@ -384,7 +384,7 @@ public final Builder index(String value, String... values) {
}

/**
* The number of segments the index should be merged into (defayult: dynamic)
* The number of segments the index should be merged into (default: dynamic)
* <p>
* API name: {@code max_num_segments}
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
import co.elastic.clients.elasticsearch._types.mapping.TypeMapping;
import co.elastic.clients.elasticsearch.indices.Alias;
import co.elastic.clients.elasticsearch.indices.DataStreamLifecycle;
import co.elastic.clients.elasticsearch.indices.DataStreamOptionsTemplate;
import co.elastic.clients.elasticsearch.indices.IndexSettings;
import co.elastic.clients.json.JsonpDeserializable;
import co.elastic.clients.json.JsonpDeserializer;
Expand Down Expand Up @@ -76,6 +77,9 @@ public class IndexTemplateMapping implements JsonpSerializable {
@Nullable
private final DataStreamLifecycle lifecycle;

@Nullable
private final DataStreamOptionsTemplate dataStreamOptions;

// ---------------------------------------------------------------------------------------------

private IndexTemplateMapping(Builder builder) {
Expand All @@ -84,6 +88,7 @@ private IndexTemplateMapping(Builder builder) {
this.mappings = builder.mappings;
this.settings = builder.settings;
this.lifecycle = builder.lifecycle;
this.dataStreamOptions = builder.dataStreamOptions;

}

Expand Down Expand Up @@ -132,6 +137,14 @@ public final DataStreamLifecycle lifecycle() {
return this.lifecycle;
}

/**
* API name: {@code data_stream_options}
*/
@Nullable
public final DataStreamOptionsTemplate dataStreamOptions() {
return this.dataStreamOptions;
}

/**
* Serialize this object to JSON.
*/
Expand Down Expand Up @@ -169,6 +182,11 @@ protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) {
this.lifecycle.serialize(generator, mapper);

}
if (this.dataStreamOptions != null) {
generator.writeKey("data_stream_options");
this.dataStreamOptions.serialize(generator, mapper);

}

}

Expand Down Expand Up @@ -198,6 +216,9 @@ public static class Builder extends WithJsonObjectBuilderBase<Builder>
@Nullable
private DataStreamLifecycle lifecycle;

@Nullable
private DataStreamOptionsTemplate dataStreamOptions;

/**
* Aliases to add. If the index template includes a <code>data_stream</code>
* object, these are data stream aliases. Otherwise, these are index aliases.
Expand Down Expand Up @@ -297,6 +318,22 @@ public final Builder lifecycle(Function<DataStreamLifecycle.Builder, ObjectBuild
return this.lifecycle(fn.apply(new DataStreamLifecycle.Builder()).build());
}

/**
* API name: {@code data_stream_options}
*/
public final Builder dataStreamOptions(@Nullable DataStreamOptionsTemplate value) {
this.dataStreamOptions = value;
return this;
}

/**
* API name: {@code data_stream_options}
*/
public final Builder dataStreamOptions(
Function<DataStreamOptionsTemplate.Builder, ObjectBuilder<DataStreamOptionsTemplate>> fn) {
return this.dataStreamOptions(fn.apply(new DataStreamOptionsTemplate.Builder()).build());
}

@Override
protected Builder self() {
return this;
Expand Down Expand Up @@ -329,6 +366,7 @@ protected static void setupIndexTemplateMappingDeserializer(ObjectDeserializer<I
op.add(Builder::mappings, TypeMapping._DESERIALIZER, "mappings");
op.add(Builder::settings, IndexSettings._DESERIALIZER, "settings");
op.add(Builder::lifecycle, DataStreamLifecycle._DESERIALIZER, "lifecycle");
op.add(Builder::dataStreamOptions, DataStreamOptionsTemplate._DESERIALIZER, "data_stream_options");

}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,15 +66,15 @@
* The chat completion inference API enables real-time responses for chat
* completion tasks by delivering answers incrementally, reducing response times
* during computation. It only works with the <code>chat_completion</code> task
* type for <code>openai</code> and <code>elastic</code> inference services.
* type.
* <p>
* NOTE: The <code>chat_completion</code> task type is only available within the
* _stream API and only supports streaming. The Chat completion inference API
* and the Stream inference API differ in their response structure and
* capabilities. The Chat completion inference API provides more comprehensive
* customization options through more fields and function calling support. If
* you use the <code>openai</code>, <code>hugging_face</code> or the
* <code>elastic</code> service, use the Chat completion inference API.
* customization options through more fields and function calling support. To
* determine whether a given inference service supports this task type, please
* see the page for that service.
*
* @see <a href=
* "../doc-files/api-spec.html#inference.chat_completion_unified.Request">API
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,15 +76,15 @@ public ElasticsearchInferenceAsyncClient withTransportOptions(@Nullable Transpor
* The chat completion inference API enables real-time responses for chat
* completion tasks by delivering answers incrementally, reducing response times
* during computation. It only works with the <code>chat_completion</code> task
* type for <code>openai</code> and <code>elastic</code> inference services.
* type.
* <p>
* NOTE: The <code>chat_completion</code> task type is only available within the
* _stream API and only supports streaming. The Chat completion inference API
* and the Stream inference API differ in their response structure and
* capabilities. The Chat completion inference API provides more comprehensive
* customization options through more fields and function calling support. If
* you use the <code>openai</code>, <code>hugging_face</code> or the
* <code>elastic</code> service, use the Chat completion inference API.
* customization options through more fields and function calling support. To
* determine whether a given inference service supports this task type, please
* see the page for that service.
*
* @see <a href=
* "https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-inference-unified-inference">Documentation
Expand All @@ -104,15 +104,15 @@ public CompletableFuture<BinaryResponse> chatCompletionUnified(ChatCompletionUni
* The chat completion inference API enables real-time responses for chat
* completion tasks by delivering answers incrementally, reducing response times
* during computation. It only works with the <code>chat_completion</code> task
* type for <code>openai</code> and <code>elastic</code> inference services.
* type.
* <p>
* NOTE: The <code>chat_completion</code> task type is only available within the
* _stream API and only supports streaming. The Chat completion inference API
* and the Stream inference API differ in their response structure and
* capabilities. The Chat completion inference API provides more comprehensive
* customization options through more fields and function calling support. If
* you use the <code>openai</code>, <code>hugging_face</code> or the
* <code>elastic</code> service, use the Chat completion inference API.
* customization options through more fields and function calling support. To
* determine whether a given inference service supports this task type, please
* see the page for that service.
*
* @param fn
* a function that initializes a builder to create the
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,15 +74,15 @@ public ElasticsearchInferenceClient withTransportOptions(@Nullable TransportOpti
* The chat completion inference API enables real-time responses for chat
* completion tasks by delivering answers incrementally, reducing response times
* during computation. It only works with the <code>chat_completion</code> task
* type for <code>openai</code> and <code>elastic</code> inference services.
* type.
* <p>
* NOTE: The <code>chat_completion</code> task type is only available within the
* _stream API and only supports streaming. The Chat completion inference API
* and the Stream inference API differ in their response structure and
* capabilities. The Chat completion inference API provides more comprehensive
* customization options through more fields and function calling support. If
* you use the <code>openai</code>, <code>hugging_face</code> or the
* <code>elastic</code> service, use the Chat completion inference API.
* customization options through more fields and function calling support. To
* determine whether a given inference service supports this task type, please
* see the page for that service.
*
* @see <a href=
* "https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-inference-unified-inference">Documentation
Expand All @@ -103,15 +103,15 @@ public BinaryResponse chatCompletionUnified(ChatCompletionUnifiedRequest request
* The chat completion inference API enables real-time responses for chat
* completion tasks by delivering answers incrementally, reducing response times
* during computation. It only works with the <code>chat_completion</code> task
* type for <code>openai</code> and <code>elastic</code> inference services.
* type.
* <p>
* NOTE: The <code>chat_completion</code> task type is only available within the
* _stream API and only supports streaming. The Chat completion inference API
* and the Stream inference API differ in their response structure and
* capabilities. The Chat completion inference API provides more comprehensive
* customization options through more fields and function calling support. If
* you use the <code>openai</code>, <code>hugging_face</code> or the
* <code>elastic</code> service, use the Chat completion inference API.
* customization options through more fields and function calling support. To
* determine whether a given inference service supports this task type, please
* see the page for that service.
*
* @param fn
* a function that initializes a builder to create the
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,9 @@ public class AppendProcessor extends ProcessorBase implements ProcessorVariant {

private final List<JsonData> value;

@Nullable
private final String mediaType;

@Nullable
private final Boolean allowDuplicates;

Expand All @@ -72,7 +75,8 @@ private AppendProcessor(Builder builder) {
super(builder);

this.field = ApiTypeHelper.requireNonNull(builder.field, this, "field");
this.value = ApiTypeHelper.unmodifiableRequired(builder.value, this, "value");
this.value = ApiTypeHelper.unmodifiable(builder.value);
this.mediaType = builder.mediaType;
this.allowDuplicates = builder.allowDuplicates;

}
Expand All @@ -99,14 +103,26 @@ public final String field() {
}

/**
* Required - The value to be appended. Supports template snippets.
* The value to be appended. Supports template snippets.
* <p>
* API name: {@code value}
*/
public final List<JsonData> value() {
return this.value;
}

/**
* The media type for encoding <code>value</code>. Applies only when value is a
* template snippet. Must be one of <code>application/json</code>,
* <code>text/plain</code>, or <code>application/x-www-form-urlencoded</code>.
* <p>
* API name: {@code media_type}
*/
@Nullable
public final String mediaType() {
return this.mediaType;
}

/**
* If <code>false</code>, the processor does not append values already present
* in the field.
Expand All @@ -133,6 +149,11 @@ protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) {
}
generator.writeEnd();

}
if (this.mediaType != null) {
generator.writeKey("media_type");
generator.write(this.mediaType);

}
if (this.allowDuplicates != null) {
generator.writeKey("allow_duplicates");
Expand All @@ -153,8 +174,12 @@ public static class Builder extends ProcessorBase.AbstractBuilder<Builder>
ObjectBuilder<AppendProcessor> {
private String field;

@Nullable
private List<JsonData> value;

@Nullable
private String mediaType;

@Nullable
private Boolean allowDuplicates;

Expand All @@ -169,7 +194,7 @@ public final Builder field(String value) {
}

/**
* Required - The value to be appended. Supports template snippets.
* The value to be appended. Supports template snippets.
* <p>
* API name: {@code value}
* <p>
Expand All @@ -181,7 +206,7 @@ public final Builder value(List<JsonData> list) {
}

/**
* Required - The value to be appended. Supports template snippets.
* The value to be appended. Supports template snippets.
* <p>
* API name: {@code value}
* <p>
Expand All @@ -192,6 +217,18 @@ public final Builder value(JsonData value, JsonData... values) {
return this;
}

/**
* The media type for encoding <code>value</code>. Applies only when value is a
* template snippet. Must be one of <code>application/json</code>,
* <code>text/plain</code>, or <code>application/x-www-form-urlencoded</code>.
* <p>
* API name: {@code media_type}
*/
public final Builder mediaType(@Nullable String value) {
this.mediaType = value;
return this;
}

/**
* If <code>false</code>, the processor does not append values already present
* in the field.
Expand Down Expand Up @@ -233,6 +270,7 @@ protected static void setupAppendProcessorDeserializer(ObjectDeserializer<Append
ProcessorBase.setupProcessorBaseDeserializer(op);
op.add(Builder::field, JsonpDeserializer.stringDeserializer(), "field");
op.add(Builder::value, JsonpDeserializer.arrayDeserializer(JsonData._DESERIALIZER), "value");
op.add(Builder::mediaType, JsonpDeserializer.stringDeserializer(), "media_type");
op.add(Builder::allowDuplicates, JsonpDeserializer.booleanDeserializer(), "allow_duplicates");

}
Expand Down