Skip to content

Commit 9b924bb

Browse files
committed
[codegen] Update to latest API spec
1 parent d6a70d4 commit 9b924bb

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

50 files changed

+2489
-553
lines changed

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

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -782,6 +782,20 @@ public final CompletableFuture<FieldCapsResponse> fieldCaps(
782782
return fieldCaps(fn.apply(new FieldCapsRequest.Builder()).build());
783783
}
784784

785+
/**
786+
* Returns the information about the capabilities of fields among multiple
787+
* indices.
788+
*
789+
* @see <a href=
790+
* "https://www.elastic.co/guide/en/elasticsearch/reference/master/search-field-caps.html">Documentation
791+
* on elastic.co</a>
792+
*/
793+
794+
public CompletableFuture<FieldCapsResponse> fieldCaps() {
795+
return this.transport.performRequestAsync(new FieldCapsRequest.Builder().build(), FieldCapsRequest._ENDPOINT,
796+
this.transportOptions);
797+
}
798+
785799
// ----- Endpoint: get
786800

787801
/**

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

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -795,6 +795,20 @@ public final FieldCapsResponse fieldCaps(Function<FieldCapsRequest.Builder, Obje
795795
return fieldCaps(fn.apply(new FieldCapsRequest.Builder()).build());
796796
}
797797

798+
/**
799+
* Returns the information about the capabilities of fields among multiple
800+
* indices.
801+
*
802+
* @see <a href=
803+
* "https://www.elastic.co/guide/en/elasticsearch/reference/master/search-field-caps.html">Documentation
804+
* on elastic.co</a>
805+
*/
806+
807+
public FieldCapsResponse fieldCaps() throws IOException, ElasticsearchException {
808+
return this.transport.performRequest(new FieldCapsRequest.Builder().build(), FieldCapsRequest._ENDPOINT,
809+
this.transportOptions);
810+
}
811+
798812
// ----- Endpoint: get
799813

800814
/**

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

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,8 @@ public class NodeAttributes implements JsonpSerializable {
6363

6464
private final List<NodeRole> roles;
6565

66+
private final String externalId;
67+
6668
// ---------------------------------------------------------------------------------------------
6769

6870
private NodeAttributes(Builder builder) {
@@ -73,6 +75,7 @@ private NodeAttributes(Builder builder) {
7375
this.name = ApiTypeHelper.requireNonNull(builder.name, this, "name");
7476
this.transportAddress = ApiTypeHelper.requireNonNull(builder.transportAddress, this, "transportAddress");
7577
this.roles = ApiTypeHelper.unmodifiable(builder.roles);
78+
this.externalId = ApiTypeHelper.requireNonNull(builder.externalId, this, "externalId");
7679

7780
}
7881

@@ -133,6 +136,13 @@ public final List<NodeRole> roles() {
133136
return this.roles;
134137
}
135138

139+
/**
140+
* Required - API name: {@code external_id}
141+
*/
142+
public final String externalId() {
143+
return this.externalId;
144+
}
145+
136146
/**
137147
* Serialize this object to JSON.
138148
*/
@@ -178,6 +188,8 @@ protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) {
178188
generator.writeEnd();
179189

180190
}
191+
generator.writeKey("external_id");
192+
generator.write(this.externalId);
181193

182194
}
183195

@@ -207,6 +219,8 @@ public static class Builder extends WithJsonObjectBuilderBase<Builder> implement
207219
@Nullable
208220
private List<NodeRole> roles;
209221

222+
private String externalId;
223+
210224
/**
211225
* Required - Lists node attributes.
212226
* <p>
@@ -291,6 +305,14 @@ public final Builder roles(NodeRole value, NodeRole... values) {
291305
return this;
292306
}
293307

308+
/**
309+
* Required - API name: {@code external_id}
310+
*/
311+
public final Builder externalId(String value) {
312+
this.externalId = value;
313+
return this;
314+
}
315+
294316
@Override
295317
protected Builder self() {
296318
return this;
@@ -326,6 +348,7 @@ protected static void setupNodeAttributesDeserializer(ObjectDeserializer<NodeAtt
326348
op.add(Builder::name, JsonpDeserializer.stringDeserializer(), "name");
327349
op.add(Builder::transportAddress, JsonpDeserializer.stringDeserializer(), "transport_address");
328350
op.add(Builder::roles, JsonpDeserializer.arrayDeserializer(NodeRole._DESERIALIZER), "roles");
351+
op.add(Builder::externalId, JsonpDeserializer.stringDeserializer(), "external_id");
329352

330353
}
331354

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,8 @@ public enum ScriptSortType implements JsonEnum {
3838

3939
Number("number"),
4040

41+
Version("version"),
42+
4143
;
4244

4345
private final String jsonValue;

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

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ public class SlicedScroll implements JsonpSerializable {
5252
@Nullable
5353
private final String field;
5454

55-
private final int id;
55+
private final String id;
5656

5757
private final int max;
5858

@@ -81,7 +81,7 @@ public final String field() {
8181
/**
8282
* Required - API name: {@code id}
8383
*/
84-
public final int id() {
84+
public final String id() {
8585
return this.id;
8686
}
8787

@@ -131,7 +131,7 @@ public static class Builder extends WithJsonObjectBuilderBase<Builder> implement
131131
@Nullable
132132
private String field;
133133

134-
private Integer id;
134+
private String id;
135135

136136
private Integer max;
137137

@@ -146,7 +146,7 @@ public final Builder field(@Nullable String value) {
146146
/**
147147
* Required - API name: {@code id}
148148
*/
149-
public final Builder id(int value) {
149+
public final Builder id(String value) {
150150
this.id = value;
151151
return this;
152152
}
@@ -188,7 +188,7 @@ public SlicedScroll build() {
188188
protected static void setupSlicedScrollDeserializer(ObjectDeserializer<SlicedScroll.Builder> op) {
189189

190190
op.add(Builder::field, JsonpDeserializer.stringDeserializer(), "field");
191-
op.add(Builder::id, JsonpDeserializer.integerDeserializer(), "id");
191+
op.add(Builder::id, JsonpDeserializer.stringDeserializer(), "id");
192192
op.add(Builder::max, JsonpDeserializer.integerDeserializer(), "max");
193193

194194
}

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

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@
4141
* specification</a>
4242
*/
4343
@JsonpDeserializable
44-
public class SignificantLongTermsAggregate extends MultiBucketAggregateBase<SignificantLongTermsBucket>
44+
public class SignificantLongTermsAggregate extends SignificantTermsAggregateBase<SignificantLongTermsBucket>
4545
implements
4646
AggregateVariant {
4747
// ---------------------------------------------------------------------------------------------
@@ -69,7 +69,9 @@ public Aggregate.Kind _aggregateKind() {
6969
* Builder for {@link SignificantLongTermsAggregate}.
7070
*/
7171

72-
public static class Builder extends MultiBucketAggregateBase.AbstractBuilder<SignificantLongTermsBucket, Builder>
72+
public static class Builder
73+
extends
74+
SignificantTermsAggregateBase.AbstractBuilder<SignificantLongTermsBucket, Builder>
7375
implements
7476
ObjectBuilder<SignificantLongTermsAggregate> {
7577
@Override
@@ -85,7 +87,7 @@ protected Builder self() {
8587
*/
8688
public SignificantLongTermsAggregate build() {
8789
_checkSingleUse();
88-
super.tBucketSerializer(null);
90+
super.tSerializer(null);
8991

9092
return new SignificantLongTermsAggregate(this);
9193
}
@@ -101,7 +103,7 @@ public SignificantLongTermsAggregate build() {
101103

102104
protected static void setupSignificantLongTermsAggregateDeserializer(
103105
ObjectDeserializer<SignificantLongTermsAggregate.Builder> op) {
104-
MultiBucketAggregateBase.setupMultiBucketAggregateBaseDeserializer(op,
106+
SignificantTermsAggregateBase.setupSignificantTermsAggregateBaseDeserializer(op,
105107
SignificantLongTermsBucket._DESERIALIZER);
106108

107109
}

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

Lines changed: 6 additions & 72 deletions
Original file line numberDiff line numberDiff line change
@@ -25,15 +25,12 @@
2525

2626
import co.elastic.clients.json.JsonpDeserializable;
2727
import co.elastic.clients.json.JsonpDeserializer;
28-
import co.elastic.clients.json.JsonpMapper;
2928
import co.elastic.clients.json.ObjectBuilderDeserializer;
3029
import co.elastic.clients.json.ObjectDeserializer;
3130
import co.elastic.clients.util.ObjectBuilder;
3231
import jakarta.json.stream.JsonGenerator;
33-
import java.lang.Long;
3432
import java.util.Objects;
3533
import java.util.function.Function;
36-
import javax.annotation.Nullable;
3734

3835
// typedef: _types.aggregations.SignificantStringTermsAggregate
3936

@@ -44,23 +41,14 @@
4441
* specification</a>
4542
*/
4643
@JsonpDeserializable
47-
public class SignificantStringTermsAggregate extends MultiBucketAggregateBase<SignificantStringTermsBucket>
44+
public class SignificantStringTermsAggregate extends SignificantTermsAggregateBase<SignificantStringTermsBucket>
4845
implements
4946
AggregateVariant {
50-
@Nullable
51-
private final Long bgCount;
52-
53-
@Nullable
54-
private final Long docCount;
55-
5647
// ---------------------------------------------------------------------------------------------
5748

5849
private SignificantStringTermsAggregate(Builder builder) {
5950
super(builder);
6051

61-
this.bgCount = builder.bgCount;
62-
this.docCount = builder.docCount;
63-
6452
}
6553

6654
public static SignificantStringTermsAggregate of(
@@ -76,69 +64,17 @@ public Aggregate.Kind _aggregateKind() {
7664
return Aggregate.Kind.Sigsterms;
7765
}
7866

79-
/**
80-
* API name: {@code bg_count}
81-
*/
82-
@Nullable
83-
public final Long bgCount() {
84-
return this.bgCount;
85-
}
86-
87-
/**
88-
* API name: {@code doc_count}
89-
*/
90-
@Nullable
91-
public final Long docCount() {
92-
return this.docCount;
93-
}
94-
95-
protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) {
96-
97-
super.serializeInternal(generator, mapper);
98-
if (this.bgCount != null) {
99-
generator.writeKey("bg_count");
100-
generator.write(this.bgCount);
101-
102-
}
103-
if (this.docCount != null) {
104-
generator.writeKey("doc_count");
105-
generator.write(this.docCount);
106-
107-
}
108-
109-
}
110-
11167
// ---------------------------------------------------------------------------------------------
11268

11369
/**
11470
* Builder for {@link SignificantStringTermsAggregate}.
11571
*/
11672

117-
public static class Builder extends MultiBucketAggregateBase.AbstractBuilder<SignificantStringTermsBucket, Builder>
73+
public static class Builder
74+
extends
75+
SignificantTermsAggregateBase.AbstractBuilder<SignificantStringTermsBucket, Builder>
11876
implements
11977
ObjectBuilder<SignificantStringTermsAggregate> {
120-
@Nullable
121-
private Long bgCount;
122-
123-
@Nullable
124-
private Long docCount;
125-
126-
/**
127-
* API name: {@code bg_count}
128-
*/
129-
public final Builder bgCount(@Nullable Long value) {
130-
this.bgCount = value;
131-
return this;
132-
}
133-
134-
/**
135-
* API name: {@code doc_count}
136-
*/
137-
public final Builder docCount(@Nullable Long value) {
138-
this.docCount = value;
139-
return this;
140-
}
141-
14278
@Override
14379
protected Builder self() {
14480
return this;
@@ -152,7 +88,7 @@ protected Builder self() {
15288
*/
15389
public SignificantStringTermsAggregate build() {
15490
_checkSingleUse();
155-
super.tBucketSerializer(null);
91+
super.tSerializer(null);
15692

15793
return new SignificantStringTermsAggregate(this);
15894
}
@@ -168,10 +104,8 @@ public SignificantStringTermsAggregate build() {
168104

169105
protected static void setupSignificantStringTermsAggregateDeserializer(
170106
ObjectDeserializer<SignificantStringTermsAggregate.Builder> op) {
171-
MultiBucketAggregateBase.setupMultiBucketAggregateBaseDeserializer(op,
107+
SignificantTermsAggregateBase.setupSignificantTermsAggregateBaseDeserializer(op,
172108
SignificantStringTermsBucket._DESERIALIZER);
173-
op.add(Builder::bgCount, JsonpDeserializer.longDeserializer(), "bg_count");
174-
op.add(Builder::docCount, JsonpDeserializer.longDeserializer(), "doc_count");
175109

176110
}
177111

0 commit comments

Comments
 (0)