Skip to content

Commit 482068e

Browse files
committed
[codegen] Update to latest API spec
1 parent 3af5e0c commit 482068e

File tree

2 files changed

+15
-24
lines changed

2 files changed

+15
-24
lines changed

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

+13-22
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,8 @@ public class SignificantTextAggregation extends BucketAggregationBase implements
7272
@Nullable
7373
private final GoogleNormalizedDistanceHeuristic gnd;
7474

75-
private final List<String> include;
75+
@Nullable
76+
private final TermsInclude include;
7677

7778
@Nullable
7879
private final Long minDocCount;
@@ -109,7 +110,7 @@ private SignificantTextAggregation(Builder builder) {
109110
this.field = builder.field;
110111
this.filterDuplicateText = builder.filterDuplicateText;
111112
this.gnd = builder.gnd;
112-
this.include = ApiTypeHelper.unmodifiable(builder.include);
113+
this.include = builder.include;
113114
this.minDocCount = builder.minDocCount;
114115
this.mutualInformation = builder.mutualInformation;
115116
this.percentage = builder.percentage;
@@ -192,7 +193,8 @@ public final GoogleNormalizedDistanceHeuristic gnd() {
192193
/**
193194
* API name: {@code include}
194195
*/
195-
public final List<String> include() {
196+
@Nullable
197+
public final TermsInclude include() {
196198
return this.include;
197199
}
198200

@@ -296,14 +298,9 @@ protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) {
296298
this.gnd.serialize(generator, mapper);
297299

298300
}
299-
if (ApiTypeHelper.isDefined(this.include)) {
301+
if (this.include != null) {
300302
generator.writeKey("include");
301-
generator.writeStartArray();
302-
for (String item0 : this.include) {
303-
generator.write(item0);
304-
305-
}
306-
generator.writeEnd();
303+
this.include.serialize(generator, mapper);
307304

308305
}
309306
if (this.minDocCount != null) {
@@ -385,7 +382,7 @@ public static class Builder extends BucketAggregationBase.AbstractBuilder<Builde
385382
private GoogleNormalizedDistanceHeuristic gnd;
386383

387384
@Nullable
388-
private List<String> include;
385+
private TermsInclude include;
389386

390387
@Nullable
391388
private Long minDocCount;
@@ -498,22 +495,17 @@ public final Builder gnd(
498495

499496
/**
500497
* API name: {@code include}
501-
* <p>
502-
* Adds all elements of <code>list</code> to <code>include</code>.
503498
*/
504-
public final Builder include(List<String> list) {
505-
this.include = _listAddAll(this.include, list);
499+
public final Builder include(@Nullable TermsInclude value) {
500+
this.include = value;
506501
return this;
507502
}
508503

509504
/**
510505
* API name: {@code include}
511-
* <p>
512-
* Adds one or more values to <code>include</code>.
513506
*/
514-
public final Builder include(String value, String... values) {
515-
this.include = _listAdd(this.include, value, values);
516-
return this;
507+
public final Builder include(Function<TermsInclude.Builder, ObjectBuilder<TermsInclude>> fn) {
508+
return this.include(fn.apply(new TermsInclude.Builder()).build());
517509
}
518510

519511
/**
@@ -651,8 +643,7 @@ protected static void setupSignificantTextAggregationDeserializer(
651643
op.add(Builder::field, JsonpDeserializer.stringDeserializer(), "field");
652644
op.add(Builder::filterDuplicateText, JsonpDeserializer.booleanDeserializer(), "filter_duplicate_text");
653645
op.add(Builder::gnd, GoogleNormalizedDistanceHeuristic._DESERIALIZER, "gnd");
654-
op.add(Builder::include, JsonpDeserializer.arrayDeserializer(JsonpDeserializer.stringDeserializer()),
655-
"include");
646+
op.add(Builder::include, TermsInclude._DESERIALIZER, "include");
656647
op.add(Builder::minDocCount, JsonpDeserializer.longDeserializer(), "min_doc_count");
657648
op.add(Builder::mutualInformation, MutualInformationHeuristic._DESERIALIZER, "mutual_information");
658649
op.add(Builder::percentage, PercentageScoreHeuristic._DESERIALIZER, "percentage");

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

+2-2
Original file line numberDiff line numberDiff line change
@@ -2318,10 +2318,10 @@
23182318
if (hash.length > 1) {
23192319
hash = hash.substring(1);
23202320
}
2321-
window.location = "https://github.com/elastic/elasticsearch-specification/tree/4a27c639bb874a77e19e1d5513062ea10e133909/specification/" + (paths[hash] || "");
2321+
window.location = "https://github.com/elastic/elasticsearch-specification/tree/029ebe9c353adfaa4c6e88b126ef22c64626b502/specification/" + (paths[hash] || "");
23222322
</script>
23232323
</head>
23242324
<body>
2325-
Please see the <a href="https://github.com/elastic/elasticsearch-specification/tree/4a27c639bb874a77e19e1d5513062ea10e133909/specification/">Elasticsearch API specification</a>.
2325+
Please see the <a href="https://github.com/elastic/elasticsearch-specification/tree/029ebe9c353adfaa4c6e88b126ef22c64626b502/specification/">Elasticsearch API specification</a>.
23262326
</body>
23272327
</html>

0 commit comments

Comments
 (0)