Skip to content

Commit 306ccca

Browse files
[codegen] update to latest spec (#1129)
Co-authored-by: Laura Trotta <[email protected]>
1 parent 80b4299 commit 306ccca

File tree

8 files changed

+176
-100
lines changed

8 files changed

+176
-100
lines changed

java-client/src/main/java/co/elastic/clients/elasticsearch/cluster/GetComponentTemplateRequest.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -150,8 +150,8 @@ public final Time masterTimeout() {
150150
}
151151

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

256256
/**
257-
* Comma-separated list of component template names used to limit the request.
258-
* Wildcard (<code>*</code>) expressions are supported.
257+
* Name of component template to retrieve. Wildcard (<code>*</code>) expressions
258+
* are supported.
259259
* <p>
260260
* API name: {@code name}
261261
*/

java-client/src/main/java/co/elastic/clients/elasticsearch/doc-files/api-spec.html

Lines changed: 70 additions & 70 deletions
Large diffs are not rendered by default.

java-client/src/main/java/co/elastic/clients/elasticsearch/indices/ForcemergeRequest.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -236,7 +236,7 @@ public final List<String> index() {
236236
}
237237

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

386386
/**
387-
* The number of segments the index should be merged into (defayult: dynamic)
387+
* The number of segments the index should be merged into (default: dynamic)
388388
* <p>
389389
* API name: {@code max_num_segments}
390390
*/

java-client/src/main/java/co/elastic/clients/elasticsearch/indices/put_index_template/IndexTemplateMapping.java

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
import co.elastic.clients.elasticsearch._types.mapping.TypeMapping;
2323
import co.elastic.clients.elasticsearch.indices.Alias;
2424
import co.elastic.clients.elasticsearch.indices.DataStreamLifecycle;
25+
import co.elastic.clients.elasticsearch.indices.DataStreamOptionsTemplate;
2526
import co.elastic.clients.elasticsearch.indices.IndexSettings;
2627
import co.elastic.clients.json.JsonpDeserializable;
2728
import co.elastic.clients.json.JsonpDeserializer;
@@ -76,6 +77,9 @@ public class IndexTemplateMapping implements JsonpSerializable {
7677
@Nullable
7778
private final DataStreamLifecycle lifecycle;
7879

80+
@Nullable
81+
private final DataStreamOptionsTemplate dataStreamOptions;
82+
7983
// ---------------------------------------------------------------------------------------------
8084

8185
private IndexTemplateMapping(Builder builder) {
@@ -84,6 +88,7 @@ private IndexTemplateMapping(Builder builder) {
8488
this.mappings = builder.mappings;
8589
this.settings = builder.settings;
8690
this.lifecycle = builder.lifecycle;
91+
this.dataStreamOptions = builder.dataStreamOptions;
8792

8893
}
8994

@@ -132,6 +137,14 @@ public final DataStreamLifecycle lifecycle() {
132137
return this.lifecycle;
133138
}
134139

140+
/**
141+
* API name: {@code data_stream_options}
142+
*/
143+
@Nullable
144+
public final DataStreamOptionsTemplate dataStreamOptions() {
145+
return this.dataStreamOptions;
146+
}
147+
135148
/**
136149
* Serialize this object to JSON.
137150
*/
@@ -169,6 +182,11 @@ protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) {
169182
this.lifecycle.serialize(generator, mapper);
170183

171184
}
185+
if (this.dataStreamOptions != null) {
186+
generator.writeKey("data_stream_options");
187+
this.dataStreamOptions.serialize(generator, mapper);
188+
189+
}
172190

173191
}
174192

@@ -198,6 +216,9 @@ public static class Builder extends WithJsonObjectBuilderBase<Builder>
198216
@Nullable
199217
private DataStreamLifecycle lifecycle;
200218

219+
@Nullable
220+
private DataStreamOptionsTemplate dataStreamOptions;
221+
201222
/**
202223
* Aliases to add. If the index template includes a <code>data_stream</code>
203224
* object, these are data stream aliases. Otherwise, these are index aliases.
@@ -297,6 +318,22 @@ public final Builder lifecycle(Function<DataStreamLifecycle.Builder, ObjectBuild
297318
return this.lifecycle(fn.apply(new DataStreamLifecycle.Builder()).build());
298319
}
299320

321+
/**
322+
* API name: {@code data_stream_options}
323+
*/
324+
public final Builder dataStreamOptions(@Nullable DataStreamOptionsTemplate value) {
325+
this.dataStreamOptions = value;
326+
return this;
327+
}
328+
329+
/**
330+
* API name: {@code data_stream_options}
331+
*/
332+
public final Builder dataStreamOptions(
333+
Function<DataStreamOptionsTemplate.Builder, ObjectBuilder<DataStreamOptionsTemplate>> fn) {
334+
return this.dataStreamOptions(fn.apply(new DataStreamOptionsTemplate.Builder()).build());
335+
}
336+
300337
@Override
301338
protected Builder self() {
302339
return this;
@@ -329,6 +366,7 @@ protected static void setupIndexTemplateMappingDeserializer(ObjectDeserializer<I
329366
op.add(Builder::mappings, TypeMapping._DESERIALIZER, "mappings");
330367
op.add(Builder::settings, IndexSettings._DESERIALIZER, "settings");
331368
op.add(Builder::lifecycle, DataStreamLifecycle._DESERIALIZER, "lifecycle");
369+
op.add(Builder::dataStreamOptions, DataStreamOptionsTemplate._DESERIALIZER, "data_stream_options");
332370

333371
}
334372

java-client/src/main/java/co/elastic/clients/elasticsearch/inference/ChatCompletionUnifiedRequest.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -66,15 +66,15 @@
6666
* The chat completion inference API enables real-time responses for chat
6767
* completion tasks by delivering answers incrementally, reducing response times
6868
* during computation. It only works with the <code>chat_completion</code> task
69-
* type for <code>openai</code> and <code>elastic</code> inference services.
69+
* type.
7070
* <p>
7171
* NOTE: The <code>chat_completion</code> task type is only available within the
7272
* _stream API and only supports streaming. The Chat completion inference API
7373
* and the Stream inference API differ in their response structure and
7474
* capabilities. The Chat completion inference API provides more comprehensive
75-
* customization options through more fields and function calling support. If
76-
* you use the <code>openai</code>, <code>hugging_face</code> or the
77-
* <code>elastic</code> service, use the Chat completion inference API.
75+
* customization options through more fields and function calling support. To
76+
* determine whether a given inference service supports this task type, please
77+
* see the page for that service.
7878
*
7979
* @see <a href=
8080
* "../doc-files/api-spec.html#inference.chat_completion_unified.Request">API

java-client/src/main/java/co/elastic/clients/elasticsearch/inference/ElasticsearchInferenceAsyncClient.java

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -76,15 +76,15 @@ public ElasticsearchInferenceAsyncClient withTransportOptions(@Nullable Transpor
7676
* The chat completion inference API enables real-time responses for chat
7777
* completion tasks by delivering answers incrementally, reducing response times
7878
* during computation. It only works with the <code>chat_completion</code> task
79-
* type for <code>openai</code> and <code>elastic</code> inference services.
79+
* type.
8080
* <p>
8181
* NOTE: The <code>chat_completion</code> task type is only available within the
8282
* _stream API and only supports streaming. The Chat completion inference API
8383
* and the Stream inference API differ in their response structure and
8484
* capabilities. The Chat completion inference API provides more comprehensive
85-
* customization options through more fields and function calling support. If
86-
* you use the <code>openai</code>, <code>hugging_face</code> or the
87-
* <code>elastic</code> service, use the Chat completion inference API.
85+
* customization options through more fields and function calling support. To
86+
* determine whether a given inference service supports this task type, please
87+
* see the page for that service.
8888
*
8989
* @see <a href=
9090
* "https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-inference-unified-inference">Documentation
@@ -104,15 +104,15 @@ public CompletableFuture<BinaryResponse> chatCompletionUnified(ChatCompletionUni
104104
* The chat completion inference API enables real-time responses for chat
105105
* completion tasks by delivering answers incrementally, reducing response times
106106
* during computation. It only works with the <code>chat_completion</code> task
107-
* type for <code>openai</code> and <code>elastic</code> inference services.
107+
* type.
108108
* <p>
109109
* NOTE: The <code>chat_completion</code> task type is only available within the
110110
* _stream API and only supports streaming. The Chat completion inference API
111111
* and the Stream inference API differ in their response structure and
112112
* capabilities. The Chat completion inference API provides more comprehensive
113-
* customization options through more fields and function calling support. If
114-
* you use the <code>openai</code>, <code>hugging_face</code> or the
115-
* <code>elastic</code> service, use the Chat completion inference API.
113+
* customization options through more fields and function calling support. To
114+
* determine whether a given inference service supports this task type, please
115+
* see the page for that service.
116116
*
117117
* @param fn
118118
* a function that initializes a builder to create the

java-client/src/main/java/co/elastic/clients/elasticsearch/inference/ElasticsearchInferenceClient.java

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -74,15 +74,15 @@ public ElasticsearchInferenceClient withTransportOptions(@Nullable TransportOpti
7474
* The chat completion inference API enables real-time responses for chat
7575
* completion tasks by delivering answers incrementally, reducing response times
7676
* during computation. It only works with the <code>chat_completion</code> task
77-
* type for <code>openai</code> and <code>elastic</code> inference services.
77+
* type.
7878
* <p>
7979
* NOTE: The <code>chat_completion</code> task type is only available within the
8080
* _stream API and only supports streaming. The Chat completion inference API
8181
* and the Stream inference API differ in their response structure and
8282
* capabilities. The Chat completion inference API provides more comprehensive
83-
* customization options through more fields and function calling support. If
84-
* you use the <code>openai</code>, <code>hugging_face</code> or the
85-
* <code>elastic</code> service, use the Chat completion inference API.
83+
* customization options through more fields and function calling support. To
84+
* determine whether a given inference service supports this task type, please
85+
* see the page for that service.
8686
*
8787
* @see <a href=
8888
* "https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-inference-unified-inference">Documentation
@@ -103,15 +103,15 @@ public BinaryResponse chatCompletionUnified(ChatCompletionUnifiedRequest request
103103
* The chat completion inference API enables real-time responses for chat
104104
* completion tasks by delivering answers incrementally, reducing response times
105105
* during computation. It only works with the <code>chat_completion</code> task
106-
* type for <code>openai</code> and <code>elastic</code> inference services.
106+
* type.
107107
* <p>
108108
* NOTE: The <code>chat_completion</code> task type is only available within the
109109
* _stream API and only supports streaming. The Chat completion inference API
110110
* and the Stream inference API differ in their response structure and
111111
* capabilities. The Chat completion inference API provides more comprehensive
112-
* customization options through more fields and function calling support. If
113-
* you use the <code>openai</code>, <code>hugging_face</code> or the
114-
* <code>elastic</code> service, use the Chat completion inference API.
112+
* customization options through more fields and function calling support. To
113+
* determine whether a given inference service supports this task type, please
114+
* see the page for that service.
115115
*
116116
* @param fn
117117
* a function that initializes a builder to create the

java-client/src/main/java/co/elastic/clients/elasticsearch/ingest/AppendProcessor.java

Lines changed: 42 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,9 @@ public class AppendProcessor extends ProcessorBase implements ProcessorVariant {
6363

6464
private final List<JsonData> value;
6565

66+
@Nullable
67+
private final String mediaType;
68+
6669
@Nullable
6770
private final Boolean allowDuplicates;
6871

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

7477
this.field = ApiTypeHelper.requireNonNull(builder.field, this, "field");
75-
this.value = ApiTypeHelper.unmodifiableRequired(builder.value, this, "value");
78+
this.value = ApiTypeHelper.unmodifiable(builder.value);
79+
this.mediaType = builder.mediaType;
7680
this.allowDuplicates = builder.allowDuplicates;
7781

7882
}
@@ -99,14 +103,26 @@ public final String field() {
99103
}
100104

101105
/**
102-
* Required - The value to be appended. Supports template snippets.
106+
* The value to be appended. Supports template snippets.
103107
* <p>
104108
* API name: {@code value}
105109
*/
106110
public final List<JsonData> value() {
107111
return this.value;
108112
}
109113

114+
/**
115+
* The media type for encoding <code>value</code>. Applies only when value is a
116+
* template snippet. Must be one of <code>application/json</code>,
117+
* <code>text/plain</code>, or <code>application/x-www-form-urlencoded</code>.
118+
* <p>
119+
* API name: {@code media_type}
120+
*/
121+
@Nullable
122+
public final String mediaType() {
123+
return this.mediaType;
124+
}
125+
110126
/**
111127
* If <code>false</code>, the processor does not append values already present
112128
* in the field.
@@ -133,6 +149,11 @@ protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) {
133149
}
134150
generator.writeEnd();
135151

152+
}
153+
if (this.mediaType != null) {
154+
generator.writeKey("media_type");
155+
generator.write(this.mediaType);
156+
136157
}
137158
if (this.allowDuplicates != null) {
138159
generator.writeKey("allow_duplicates");
@@ -153,8 +174,12 @@ public static class Builder extends ProcessorBase.AbstractBuilder<Builder>
153174
ObjectBuilder<AppendProcessor> {
154175
private String field;
155176

177+
@Nullable
156178
private List<JsonData> value;
157179

180+
@Nullable
181+
private String mediaType;
182+
158183
@Nullable
159184
private Boolean allowDuplicates;
160185

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

171196
/**
172-
* Required - The value to be appended. Supports template snippets.
197+
* The value to be appended. Supports template snippets.
173198
* <p>
174199
* API name: {@code value}
175200
* <p>
@@ -181,7 +206,7 @@ public final Builder value(List<JsonData> list) {
181206
}
182207

183208
/**
184-
* Required - The value to be appended. Supports template snippets.
209+
* The value to be appended. Supports template snippets.
185210
* <p>
186211
* API name: {@code value}
187212
* <p>
@@ -192,6 +217,18 @@ public final Builder value(JsonData value, JsonData... values) {
192217
return this;
193218
}
194219

220+
/**
221+
* The media type for encoding <code>value</code>. Applies only when value is a
222+
* template snippet. Must be one of <code>application/json</code>,
223+
* <code>text/plain</code>, or <code>application/x-www-form-urlencoded</code>.
224+
* <p>
225+
* API name: {@code media_type}
226+
*/
227+
public final Builder mediaType(@Nullable String value) {
228+
this.mediaType = value;
229+
return this;
230+
}
231+
195232
/**
196233
* If <code>false</code>, the processor does not append values already present
197234
* in the field.
@@ -233,6 +270,7 @@ protected static void setupAppendProcessorDeserializer(ObjectDeserializer<Append
233270
ProcessorBase.setupProcessorBaseDeserializer(op);
234271
op.add(Builder::field, JsonpDeserializer.stringDeserializer(), "field");
235272
op.add(Builder::value, JsonpDeserializer.arrayDeserializer(JsonData._DESERIALIZER), "value");
273+
op.add(Builder::mediaType, JsonpDeserializer.stringDeserializer(), "media_type");
236274
op.add(Builder::allowDuplicates, JsonpDeserializer.booleanDeserializer(), "allow_duplicates");
237275

238276
}

0 commit comments

Comments
 (0)