Skip to content

Commit 013608d

Browse files
committed
[codegen] Update code to latest API specification
1 parent 3c47c81 commit 013608d

File tree

77 files changed

+5446
-993
lines changed

Some content is hidden

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

77 files changed

+5446
-993
lines changed

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

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@
3535
import co.elastic.clients.util.WithJsonObjectBuilderBase;
3636
import jakarta.json.stream.JsonGenerator;
3737
import java.lang.Boolean;
38+
import java.lang.Double;
3839
import java.lang.Long;
3940
import java.lang.String;
4041
import java.util.Map;
@@ -82,6 +83,9 @@ public class IndexingStats implements JsonpSerializable {
8283

8384
private final Map<String, IndexingStats> types;
8485

86+
@Nullable
87+
private final Double writeLoad;
88+
8589
// ---------------------------------------------------------------------------------------------
8690

8791
private IndexingStats(Builder builder) {
@@ -101,6 +105,7 @@ private IndexingStats(Builder builder) {
101105
this.indexTotal = ApiTypeHelper.requireNonNull(builder.indexTotal, this, "indexTotal");
102106
this.indexFailed = ApiTypeHelper.requireNonNull(builder.indexFailed, this, "indexFailed");
103107
this.types = ApiTypeHelper.unmodifiable(builder.types);
108+
this.writeLoad = builder.writeLoad;
104109

105110
}
106111

@@ -209,6 +214,14 @@ public final Map<String, IndexingStats> types() {
209214
return this.types;
210215
}
211216

217+
/**
218+
* API name: {@code write_load}
219+
*/
220+
@Nullable
221+
public final Double writeLoad() {
222+
return this.writeLoad;
223+
}
224+
212225
/**
213226
* Serialize this object to JSON.
214227
*/
@@ -276,6 +289,11 @@ protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) {
276289
generator.writeEnd();
277290

278291
}
292+
if (this.writeLoad != null) {
293+
generator.writeKey("write_load");
294+
generator.write(this.writeLoad);
295+
296+
}
279297

280298
}
281299

@@ -323,6 +341,9 @@ public static class Builder extends WithJsonObjectBuilderBase<Builder> implement
323341
@Nullable
324342
private Map<String, IndexingStats> types;
325343

344+
@Nullable
345+
private Double writeLoad;
346+
326347
/**
327348
* Required - API name: {@code index_current}
328349
*/
@@ -477,6 +498,14 @@ public final Builder types(String key, Function<IndexingStats.Builder, ObjectBui
477498
return types(key, fn.apply(new IndexingStats.Builder()).build());
478499
}
479500

501+
/**
502+
* API name: {@code write_load}
503+
*/
504+
public final Builder writeLoad(@Nullable Double value) {
505+
this.writeLoad = value;
506+
return this;
507+
}
508+
480509
@Override
481510
protected Builder self() {
482511
return this;
@@ -519,6 +548,7 @@ protected static void setupIndexingStatsDeserializer(ObjectDeserializer<Indexing
519548
op.add(Builder::indexTotal, JsonpDeserializer.longDeserializer(), "index_total");
520549
op.add(Builder::indexFailed, JsonpDeserializer.longDeserializer(), "index_failed");
521550
op.add(Builder::types, JsonpDeserializer.stringMapDeserializer(IndexingStats._DESERIALIZER), "types");
551+
op.add(Builder::writeLoad, JsonpDeserializer.doubleDeserializer(), "write_load");
522552

523553
}
524554

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

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

6464
private final List<NodeRole> roles;
6565

66+
@Nullable
6667
private final String externalId;
6768

6869
// ---------------------------------------------------------------------------------------------
@@ -75,7 +76,7 @@ private NodeAttributes(Builder builder) {
7576
this.name = ApiTypeHelper.requireNonNull(builder.name, this, "name");
7677
this.transportAddress = ApiTypeHelper.requireNonNull(builder.transportAddress, this, "transportAddress");
7778
this.roles = ApiTypeHelper.unmodifiable(builder.roles);
78-
this.externalId = ApiTypeHelper.requireNonNull(builder.externalId, this, "externalId");
79+
this.externalId = builder.externalId;
7980

8081
}
8182

@@ -137,8 +138,9 @@ public final List<NodeRole> roles() {
137138
}
138139

139140
/**
140-
* Required - API name: {@code external_id}
141+
* API name: {@code external_id}
141142
*/
143+
@Nullable
142144
public final String externalId() {
143145
return this.externalId;
144146
}
@@ -188,8 +190,11 @@ protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) {
188190
generator.writeEnd();
189191

190192
}
191-
generator.writeKey("external_id");
192-
generator.write(this.externalId);
193+
if (this.externalId != null) {
194+
generator.writeKey("external_id");
195+
generator.write(this.externalId);
196+
197+
}
193198

194199
}
195200

@@ -219,6 +224,7 @@ public static class Builder extends WithJsonObjectBuilderBase<Builder> implement
219224
@Nullable
220225
private List<NodeRole> roles;
221226

227+
@Nullable
222228
private String externalId;
223229

224230
/**
@@ -306,9 +312,9 @@ public final Builder roles(NodeRole value, NodeRole... values) {
306312
}
307313

308314
/**
309-
* Required - API name: {@code external_id}
315+
* API name: {@code external_id}
310316
*/
311-
public final Builder externalId(String value) {
317+
public final Builder externalId(@Nullable String value) {
312318
this.externalId = value;
313319
return this;
314320
}

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

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,9 @@ public class NodeShard implements JsonpSerializable {
7474
@Nullable
7575
private final String relocatingNode;
7676

77+
@Nullable
78+
private final RelocationFailureInfo relocationFailureInfo;
79+
7780
// ---------------------------------------------------------------------------------------------
7881

7982
private NodeShard(Builder builder) {
@@ -87,6 +90,7 @@ private NodeShard(Builder builder) {
8790
this.recoverySource = ApiTypeHelper.unmodifiable(builder.recoverySource);
8891
this.unassignedInfo = builder.unassignedInfo;
8992
this.relocatingNode = builder.relocatingNode;
93+
this.relocationFailureInfo = builder.relocationFailureInfo;
9094

9195
}
9296

@@ -160,6 +164,14 @@ public final String relocatingNode() {
160164
return this.relocatingNode;
161165
}
162166

167+
/**
168+
* API name: {@code relocation_failure_info}
169+
*/
170+
@Nullable
171+
public final RelocationFailureInfo relocationFailureInfo() {
172+
return this.relocationFailureInfo;
173+
}
174+
163175
/**
164176
* Serialize this object to JSON.
165177
*/
@@ -219,6 +231,11 @@ protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) {
219231
generator.write(this.relocatingNode);
220232

221233
}
234+
if (this.relocationFailureInfo != null) {
235+
generator.writeKey("relocation_failure_info");
236+
this.relocationFailureInfo.serialize(generator, mapper);
237+
238+
}
222239

223240
}
224241

@@ -257,6 +274,9 @@ public static class Builder extends WithJsonObjectBuilderBase<Builder> implement
257274
@Nullable
258275
private String relocatingNode;
259276

277+
@Nullable
278+
private RelocationFailureInfo relocationFailureInfo;
279+
260280
/**
261281
* Required - API name: {@code state}
262282
*/
@@ -361,6 +381,22 @@ public final Builder relocatingNode(@Nullable String value) {
361381
return this;
362382
}
363383

384+
/**
385+
* API name: {@code relocation_failure_info}
386+
*/
387+
public final Builder relocationFailureInfo(@Nullable RelocationFailureInfo value) {
388+
this.relocationFailureInfo = value;
389+
return this;
390+
}
391+
392+
/**
393+
* API name: {@code relocation_failure_info}
394+
*/
395+
public final Builder relocationFailureInfo(
396+
Function<RelocationFailureInfo.Builder, ObjectBuilder<RelocationFailureInfo>> fn) {
397+
return this.relocationFailureInfo(fn.apply(new RelocationFailureInfo.Builder()).build());
398+
}
399+
364400
@Override
365401
protected Builder self() {
366402
return this;
@@ -400,6 +436,7 @@ protected static void setupNodeShardDeserializer(ObjectDeserializer<NodeShard.Bu
400436
"recovery_source");
401437
op.add(Builder::unassignedInfo, UnassignedInformation._DESERIALIZER, "unassigned_info");
402438
op.add(Builder::relocatingNode, JsonpDeserializer.stringDeserializer(), "relocating_node");
439+
op.add(Builder::relocationFailureInfo, RelocationFailureInfo._DESERIALIZER, "relocation_failure_info");
403440

404441
}
405442

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

Lines changed: 0 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -68,8 +68,6 @@ public class PluginStats implements JsonpSerializable {
6868

6969
private final boolean licensed;
7070

71-
private final String type;
72-
7371
// ---------------------------------------------------------------------------------------------
7472

7573
private PluginStats(Builder builder) {
@@ -85,7 +83,6 @@ private PluginStats(Builder builder) {
8583
this.name = ApiTypeHelper.requireNonNull(builder.name, this, "name");
8684
this.version = ApiTypeHelper.requireNonNull(builder.version, this, "version");
8785
this.licensed = ApiTypeHelper.requireNonNull(builder.licensed, this, "licensed");
88-
this.type = ApiTypeHelper.requireNonNull(builder.type, this, "type");
8986

9087
}
9188

@@ -156,13 +153,6 @@ public final boolean licensed() {
156153
return this.licensed;
157154
}
158155

159-
/**
160-
* Required - API name: {@code type}
161-
*/
162-
public final String type() {
163-
return this.type;
164-
}
165-
166156
/**
167157
* Serialize this object to JSON.
168158
*/
@@ -208,9 +198,6 @@ protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) {
208198
generator.writeKey("licensed");
209199
generator.write(this.licensed);
210200

211-
generator.writeKey("type");
212-
generator.write(this.type);
213-
214201
}
215202

216203
@Override
@@ -243,8 +230,6 @@ public static class Builder extends WithJsonObjectBuilderBase<Builder> implement
243230

244231
private Boolean licensed;
245232

246-
private String type;
247-
248233
/**
249234
* Required - API name: {@code classname}
250235
*/
@@ -329,14 +314,6 @@ public final Builder licensed(boolean value) {
329314
return this;
330315
}
331316

332-
/**
333-
* Required - API name: {@code type}
334-
*/
335-
public final Builder type(String value) {
336-
this.type = value;
337-
return this;
338-
}
339-
340317
@Override
341318
protected Builder self() {
342319
return this;
@@ -375,7 +352,6 @@ protected static void setupPluginStatsDeserializer(ObjectDeserializer<PluginStat
375352
op.add(Builder::name, JsonpDeserializer.stringDeserializer(), "name");
376353
op.add(Builder::version, JsonpDeserializer.stringDeserializer(), "version");
377354
op.add(Builder::licensed, JsonpDeserializer.booleanDeserializer(), "licensed");
378-
op.add(Builder::type, JsonpDeserializer.stringDeserializer(), "type");
379355

380356
}
381357

0 commit comments

Comments
 (0)