Skip to content

Commit 16a80a8

Browse files
committed
[codegen] update to latest spec
1 parent 116bc89 commit 16a80a8

20 files changed

+193
-195
lines changed

java-client/src/main/java/co/elastic/clients/elasticsearch/ElasticsearchAsyncClient.java

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -459,6 +459,7 @@ public ElasticsearchXpackAsyncClient xpack() {
459459
* <li>JavaScript: Check out <code>client.helpers.*</code></li>
460460
* <li>.NET: Check out <code>BulkAllObservable</code></li>
461461
* <li>PHP: Check out bulk indexing.</li>
462+
* <li>Ruby: Check out <code>Elasticsearch::Helpers::BulkHelper</code></li>
462463
* </ul>
463464
* <p>
464465
* <strong>Submitting bulk requests with cURL</strong>
@@ -633,6 +634,7 @@ public CompletableFuture<BulkResponse> bulk(BulkRequest request) {
633634
* <li>JavaScript: Check out <code>client.helpers.*</code></li>
634635
* <li>.NET: Check out <code>BulkAllObservable</code></li>
635636
* <li>PHP: Check out bulk indexing.</li>
637+
* <li>Ruby: Check out <code>Elasticsearch::Helpers::BulkHelper</code></li>
636638
* </ul>
637639
* <p>
638640
* <strong>Submitting bulk requests with cURL</strong>
@@ -807,6 +809,7 @@ public final CompletableFuture<BulkResponse> bulk(Function<BulkRequest.Builder,
807809
* <li>JavaScript: Check out <code>client.helpers.*</code></li>
808810
* <li>.NET: Check out <code>BulkAllObservable</code></li>
809811
* <li>PHP: Check out bulk indexing.</li>
812+
* <li>Ruby: Check out <code>Elasticsearch::Helpers::BulkHelper</code></li>
810813
* </ul>
811814
* <p>
812815
* <strong>Submitting bulk requests with cURL</strong>
@@ -3256,7 +3259,9 @@ public final <TDocument> CompletableFuture<IndexResponse> index(
32563259
// ----- Endpoint: info
32573260

32583261
/**
3259-
* Get cluster info. Get basic build, version, and cluster information.
3262+
* Get cluster info. Get basic build, version, and cluster information. ::: In
3263+
* Serverless, this API is retained for backward compatibility only. Some
3264+
* response fields, such as the version number, should be ignored.
32603265
*
32613266
* @see <a href=
32623267
* "https://www.elastic.co/guide/en/elasticsearch/reference/8.18/rest-api-root.html">Documentation

java-client/src/main/java/co/elastic/clients/elasticsearch/ElasticsearchClient.java

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -460,6 +460,7 @@ public ElasticsearchXpackClient xpack() {
460460
* <li>JavaScript: Check out <code>client.helpers.*</code></li>
461461
* <li>.NET: Check out <code>BulkAllObservable</code></li>
462462
* <li>PHP: Check out bulk indexing.</li>
463+
* <li>Ruby: Check out <code>Elasticsearch::Helpers::BulkHelper</code></li>
463464
* </ul>
464465
* <p>
465466
* <strong>Submitting bulk requests with cURL</strong>
@@ -634,6 +635,7 @@ public BulkResponse bulk(BulkRequest request) throws IOException, ElasticsearchE
634635
* <li>JavaScript: Check out <code>client.helpers.*</code></li>
635636
* <li>.NET: Check out <code>BulkAllObservable</code></li>
636637
* <li>PHP: Check out bulk indexing.</li>
638+
* <li>Ruby: Check out <code>Elasticsearch::Helpers::BulkHelper</code></li>
637639
* </ul>
638640
* <p>
639641
* <strong>Submitting bulk requests with cURL</strong>
@@ -809,6 +811,7 @@ public final BulkResponse bulk(Function<BulkRequest.Builder, ObjectBuilder<BulkR
809811
* <li>JavaScript: Check out <code>client.helpers.*</code></li>
810812
* <li>.NET: Check out <code>BulkAllObservable</code></li>
811813
* <li>PHP: Check out bulk indexing.</li>
814+
* <li>Ruby: Check out <code>Elasticsearch::Helpers::BulkHelper</code></li>
812815
* </ul>
813816
* <p>
814817
* <strong>Submitting bulk requests with cURL</strong>
@@ -3277,7 +3280,9 @@ public final <TDocument> IndexResponse index(
32773280
// ----- Endpoint: info
32783281

32793282
/**
3280-
* Get cluster info. Get basic build, version, and cluster information.
3283+
* Get cluster info. Get basic build, version, and cluster information. ::: In
3284+
* Serverless, this API is retained for backward compatibility only. Some
3285+
* response fields, such as the version number, should be ignored.
32813286
*
32823287
* @see <a href=
32833288
* "https://www.elastic.co/guide/en/elasticsearch/reference/8.18/rest-api-root.html">Documentation

java-client/src/main/java/co/elastic/clients/elasticsearch/_types/ElasticsearchVersionInfo.java

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -181,6 +181,11 @@ public final String minimumWireCompatibilityVersion() {
181181
/**
182182
* Required - The Elasticsearch version number.
183183
* <p>
184+
* ::: IMPORTANT: For Serverless deployments, this static value is always
185+
* <code>8.11.0</code> and is used solely for backward compatibility with legacy
186+
* clients. Serverless environments are versionless and automatically upgraded,
187+
* so this value can be safely ignored.
188+
* <p>
184189
* API name: {@code number}
185190
*/
186191
public final String number() {
@@ -346,6 +351,11 @@ public final Builder minimumWireCompatibilityVersion(String value) {
346351
/**
347352
* Required - The Elasticsearch version number.
348353
* <p>
354+
* ::: IMPORTANT: For Serverless deployments, this static value is always
355+
* <code>8.11.0</code> and is used solely for backward compatibility with legacy
356+
* clients. Serverless environments are versionless and automatically upgraded,
357+
* so this value can be safely ignored.
358+
* <p>
349359
* API name: {@code number}
350360
*/
351361
public final Builder number(String value) {

java-client/src/main/java/co/elastic/clients/elasticsearch/_types/aggregations/DateHistogramAggregation.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -656,6 +656,7 @@ public final Builder order(List<NamedValue<SortOrder>> list) {
656656
* <p>
657657
* Adds one or more values to <code>order</code>.
658658
*/
659+
@SafeVarargs
659660
public final Builder order(NamedValue<SortOrder> value, NamedValue<SortOrder>... values) {
660661
this.order = _listAdd(this.order, value, values);
661662
return this;

java-client/src/main/java/co/elastic/clients/elasticsearch/_types/aggregations/FiltersBucket.java

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,12 +21,15 @@
2121

2222
import co.elastic.clients.json.JsonpDeserializable;
2323
import co.elastic.clients.json.JsonpDeserializer;
24+
import co.elastic.clients.json.JsonpMapper;
2425
import co.elastic.clients.json.ObjectBuilderDeserializer;
2526
import co.elastic.clients.json.ObjectDeserializer;
2627
import co.elastic.clients.util.ObjectBuilder;
2728
import jakarta.json.stream.JsonGenerator;
29+
import java.lang.String;
2830
import java.util.Objects;
2931
import java.util.function.Function;
32+
import javax.annotation.Nullable;
3033

3134
//----------------------------------------------------------------
3235
// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST.
@@ -53,17 +56,41 @@
5356
*/
5457
@JsonpDeserializable
5558
public class FiltersBucket extends MultiBucketBase {
59+
@Nullable
60+
private final String key;
61+
5662
// ---------------------------------------------------------------------------------------------
5763

5864
private FiltersBucket(Builder builder) {
5965
super(builder);
6066

67+
this.key = builder.key;
68+
6169
}
6270

6371
public static FiltersBucket of(Function<Builder, ObjectBuilder<FiltersBucket>> fn) {
6472
return fn.apply(new Builder()).build();
6573
}
6674

75+
/**
76+
* API name: {@code key}
77+
*/
78+
@Nullable
79+
public final String key() {
80+
return this.key;
81+
}
82+
83+
protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) {
84+
85+
super.serializeInternal(generator, mapper);
86+
if (this.key != null) {
87+
generator.writeKey("key");
88+
generator.write(this.key);
89+
90+
}
91+
92+
}
93+
6794
// ---------------------------------------------------------------------------------------------
6895

6996
/**
@@ -73,6 +100,17 @@ public static FiltersBucket of(Function<Builder, ObjectBuilder<FiltersBucket>> f
73100
public static class Builder extends MultiBucketBase.AbstractBuilder<Builder>
74101
implements
75102
ObjectBuilder<FiltersBucket> {
103+
@Nullable
104+
private String key;
105+
106+
/**
107+
* API name: {@code key}
108+
*/
109+
public final Builder key(@Nullable String value) {
110+
this.key = value;
111+
return this;
112+
}
113+
76114
@Override
77115
protected Builder self() {
78116
return this;
@@ -101,6 +139,7 @@ public FiltersBucket build() {
101139

102140
protected static void setupFiltersBucketDeserializer(ObjectDeserializer<FiltersBucket.Builder> op) {
103141
MultiBucketBase.setupMultiBucketBaseDeserializer(op);
142+
op.add(Builder::key, JsonpDeserializer.stringDeserializer(), "key");
104143

105144
}
106145

java-client/src/main/java/co/elastic/clients/elasticsearch/_types/aggregations/HistogramAggregation.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -500,6 +500,7 @@ public final Builder order(List<NamedValue<SortOrder>> list) {
500500
* <p>
501501
* Adds one or more values to <code>order</code>.
502502
*/
503+
@SafeVarargs
503504
public final Builder order(NamedValue<SortOrder> value, NamedValue<SortOrder>... values) {
504505
this.order = _listAdd(this.order, value, values);
505506
return this;

java-client/src/main/java/co/elastic/clients/elasticsearch/_types/aggregations/MultiTermsAggregation.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -329,6 +329,7 @@ public final Builder order(List<NamedValue<SortOrder>> list) {
329329
* <p>
330330
* Adds one or more values to <code>order</code>.
331331
*/
332+
@SafeVarargs
332333
public final Builder order(NamedValue<SortOrder> value, NamedValue<SortOrder>... values) {
333334
this.order = _listAdd(this.order, value, values);
334335
return this;

java-client/src/main/java/co/elastic/clients/elasticsearch/_types/aggregations/TermsAggregation.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -713,6 +713,7 @@ public final Builder order(List<NamedValue<SortOrder>> list) {
713713
* <p>
714714
* Adds one or more values to <code>order</code>.
715715
*/
716+
@SafeVarargs
716717
public final Builder order(NamedValue<SortOrder> value, NamedValue<SortOrder>... values) {
717718
this.order = _listAdd(this.order, value, values);
718719
return this;

java-client/src/main/java/co/elastic/clients/elasticsearch/_types/mapping/TypeMapping.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -527,6 +527,7 @@ public final Builder dynamicTemplates(List<NamedValue<DynamicTemplate>> list) {
527527
* <p>
528528
* Adds one or more values to <code>dynamicTemplates</code>.
529529
*/
530+
@SafeVarargs
530531
public final Builder dynamicTemplates(NamedValue<DynamicTemplate> value,
531532
NamedValue<DynamicTemplate>... values) {
532533
this.dynamicTemplates = _listAdd(this.dynamicTemplates, value, values);

java-client/src/main/java/co/elastic/clients/elasticsearch/async_search/SubmitRequest.java

Lines changed: 1 addition & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -181,9 +181,6 @@ public class SubmitRequest extends RequestBase implements JsonpSerializable {
181181
@Nullable
182182
private final Long maxConcurrentShardRequests;
183183

184-
@Nullable
185-
private final String minCompatibleShardNode;
186-
187184
@Nullable
188185
private final Double minScore;
189186

@@ -289,7 +286,6 @@ private SubmitRequest(Builder builder) {
289286
this.knn = ApiTypeHelper.unmodifiable(builder.knn);
290287
this.lenient = builder.lenient;
291288
this.maxConcurrentShardRequests = builder.maxConcurrentShardRequests;
292-
this.minCompatibleShardNode = builder.minCompatibleShardNode;
293289
this.minScore = builder.minScore;
294290
this.pit = builder.pit;
295291
this.postFilter = builder.postFilter;
@@ -603,14 +599,6 @@ public final Long maxConcurrentShardRequests() {
603599
return this.maxConcurrentShardRequests;
604600
}
605601

606-
/**
607-
* API name: {@code min_compatible_shard_node}
608-
*/
609-
@Nullable
610-
public final String minCompatibleShardNode() {
611-
return this.minCompatibleShardNode;
612-
}
613-
614602
/**
615603
* Minimum _score for matching documents. Documents with a lower _score are not
616604
* included in the search results.
@@ -1225,9 +1213,6 @@ public static class Builder extends RequestBase.AbstractBuilder<Builder> impleme
12251213
@Nullable
12261214
private Long maxConcurrentShardRequests;
12271215

1228-
@Nullable
1229-
private String minCompatibleShardNode;
1230-
12311216
@Nullable
12321217
private Double minScore;
12331218

@@ -1703,6 +1688,7 @@ public final Builder indicesBoost(List<NamedValue<Double>> list) {
17031688
* <p>
17041689
* Adds one or more values to <code>indicesBoost</code>.
17051690
*/
1691+
@SafeVarargs
17061692
public final Builder indicesBoost(NamedValue<Double> value, NamedValue<Double>... values) {
17071693
this.indicesBoost = _listAdd(this.indicesBoost, value, values);
17081694
return this;
@@ -1798,14 +1784,6 @@ public final Builder maxConcurrentShardRequests(@Nullable Long value) {
17981784
return this;
17991785
}
18001786

1801-
/**
1802-
* API name: {@code min_compatible_shard_node}
1803-
*/
1804-
public final Builder minCompatibleShardNode(@Nullable String value) {
1805-
this.minCompatibleShardNode = value;
1806-
return this;
1807-
}
1808-
18091787
/**
18101788
* Minimum _score for matching documents. Documents with a lower _score are not
18111789
* included in the search results.
@@ -2513,9 +2491,6 @@ protected static void setupSubmitRequestDeserializer(ObjectDeserializer<SubmitRe
25132491
if (request.df != null) {
25142492
params.put("df", request.df);
25152493
}
2516-
if (request.minCompatibleShardNode != null) {
2517-
params.put("min_compatible_shard_node", request.minCompatibleShardNode);
2518-
}
25192494
if (request.lenient != null) {
25202495
params.put("lenient", String.valueOf(request.lenient));
25212496
}

0 commit comments

Comments
 (0)