Skip to content

Commit bde56eb

Browse files
authored
Update API spec, fix some spec-related java client issues (#344)
1 parent 843718a commit bde56eb

File tree

187 files changed

+7271
-2863
lines changed

Some content is hidden

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

187 files changed

+7271
-2863
lines changed

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

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -305,7 +305,7 @@ public ElasticsearchXpackAsyncClient xpack() {
305305
* request.
306306
*
307307
* @see <a href=
308-
* "https://www.elastic.co/guide/en/elasticsearch/reference/8.3/docs-bulk.html">Documentation
308+
* "https://www.elastic.co/guide/en/elasticsearch/reference/8.4/docs-bulk.html">Documentation
309309
* on elastic.co</a>
310310
*/
311311

@@ -324,7 +324,7 @@ public CompletableFuture<BulkResponse> bulk(BulkRequest request) {
324324
* a function that initializes a builder to create the
325325
* {@link BulkRequest}
326326
* @see <a href=
327-
* "https://www.elastic.co/guide/en/elasticsearch/reference/8.3/docs-bulk.html">Documentation
327+
* "https://www.elastic.co/guide/en/elasticsearch/reference/8.4/docs-bulk.html">Documentation
328328
* on elastic.co</a>
329329
*/
330330

@@ -337,7 +337,7 @@ public final CompletableFuture<BulkResponse> bulk(Function<BulkRequest.Builder,
337337
* request.
338338
*
339339
* @see <a href=
340-
* "https://www.elastic.co/guide/en/elasticsearch/reference/8.3/docs-bulk.html">Documentation
340+
* "https://www.elastic.co/guide/en/elasticsearch/reference/8.4/docs-bulk.html">Documentation
341341
* on elastic.co</a>
342342
*/
343343

@@ -352,7 +352,7 @@ public CompletableFuture<BulkResponse> bulk() {
352352
* Explicitly clears the search context for a scroll.
353353
*
354354
* @see <a href=
355-
* "https://www.elastic.co/guide/en/elasticsearch/reference/8.3/clear-scroll-api.html">Documentation
355+
* "https://www.elastic.co/guide/en/elasticsearch/reference/8.4/clear-scroll-api.html">Documentation
356356
* on elastic.co</a>
357357
*/
358358

@@ -370,7 +370,7 @@ public CompletableFuture<ClearScrollResponse> clearScroll(ClearScrollRequest req
370370
* a function that initializes a builder to create the
371371
* {@link ClearScrollRequest}
372372
* @see <a href=
373-
* "https://www.elastic.co/guide/en/elasticsearch/reference/8.3/clear-scroll-api.html">Documentation
373+
* "https://www.elastic.co/guide/en/elasticsearch/reference/8.4/clear-scroll-api.html">Documentation
374374
* on elastic.co</a>
375375
*/
376376

@@ -383,7 +383,7 @@ public final CompletableFuture<ClearScrollResponse> clearScroll(
383383
* Explicitly clears the search context for a scroll.
384384
*
385385
* @see <a href=
386-
* "https://www.elastic.co/guide/en/elasticsearch/reference/8.3/clear-scroll-api.html">Documentation
386+
* "https://www.elastic.co/guide/en/elasticsearch/reference/8.4/clear-scroll-api.html">Documentation
387387
* on elastic.co</a>
388388
*/
389389

@@ -398,7 +398,7 @@ public CompletableFuture<ClearScrollResponse> clearScroll() {
398398
* Close a point in time
399399
*
400400
* @see <a href=
401-
* "https://www.elastic.co/guide/en/elasticsearch/reference/8.3/point-in-time-api.html">Documentation
401+
* "https://www.elastic.co/guide/en/elasticsearch/reference/8.4/point-in-time-api.html">Documentation
402402
* on elastic.co</a>
403403
*/
404404

@@ -416,7 +416,7 @@ public CompletableFuture<ClosePointInTimeResponse> closePointInTime(ClosePointIn
416416
* a function that initializes a builder to create the
417417
* {@link ClosePointInTimeRequest}
418418
* @see <a href=
419-
* "https://www.elastic.co/guide/en/elasticsearch/reference/8.3/point-in-time-api.html">Documentation
419+
* "https://www.elastic.co/guide/en/elasticsearch/reference/8.4/point-in-time-api.html">Documentation
420420
* on elastic.co</a>
421421
*/
422422

@@ -1158,7 +1158,7 @@ public CompletableFuture<MtermvectorsResponse> mtermvectors() {
11581158
* Open a point in time that can be used in subsequent searches
11591159
*
11601160
* @see <a href=
1161-
* "https://www.elastic.co/guide/en/elasticsearch/reference/8.3/point-in-time-api.html">Documentation
1161+
* "https://www.elastic.co/guide/en/elasticsearch/reference/8.4/point-in-time-api.html">Documentation
11621162
* on elastic.co</a>
11631163
*/
11641164

@@ -1176,7 +1176,7 @@ public CompletableFuture<OpenPointInTimeResponse> openPointInTime(OpenPointInTim
11761176
* a function that initializes a builder to create the
11771177
* {@link OpenPointInTimeRequest}
11781178
* @see <a href=
1179-
* "https://www.elastic.co/guide/en/elasticsearch/reference/8.3/point-in-time-api.html">Documentation
1179+
* "https://www.elastic.co/guide/en/elasticsearch/reference/8.4/point-in-time-api.html">Documentation
11801180
* on elastic.co</a>
11811181
*/
11821182

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

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -306,7 +306,7 @@ public ElasticsearchXpackClient xpack() {
306306
* request.
307307
*
308308
* @see <a href=
309-
* "https://www.elastic.co/guide/en/elasticsearch/reference/8.3/docs-bulk.html">Documentation
309+
* "https://www.elastic.co/guide/en/elasticsearch/reference/8.4/docs-bulk.html">Documentation
310310
* on elastic.co</a>
311311
*/
312312

@@ -325,7 +325,7 @@ public BulkResponse bulk(BulkRequest request) throws IOException, ElasticsearchE
325325
* a function that initializes a builder to create the
326326
* {@link BulkRequest}
327327
* @see <a href=
328-
* "https://www.elastic.co/guide/en/elasticsearch/reference/8.3/docs-bulk.html">Documentation
328+
* "https://www.elastic.co/guide/en/elasticsearch/reference/8.4/docs-bulk.html">Documentation
329329
* on elastic.co</a>
330330
*/
331331

@@ -339,7 +339,7 @@ public final BulkResponse bulk(Function<BulkRequest.Builder, ObjectBuilder<BulkR
339339
* request.
340340
*
341341
* @see <a href=
342-
* "https://www.elastic.co/guide/en/elasticsearch/reference/8.3/docs-bulk.html">Documentation
342+
* "https://www.elastic.co/guide/en/elasticsearch/reference/8.4/docs-bulk.html">Documentation
343343
* on elastic.co</a>
344344
*/
345345

@@ -354,7 +354,7 @@ public BulkResponse bulk() throws IOException, ElasticsearchException {
354354
* Explicitly clears the search context for a scroll.
355355
*
356356
* @see <a href=
357-
* "https://www.elastic.co/guide/en/elasticsearch/reference/8.3/clear-scroll-api.html">Documentation
357+
* "https://www.elastic.co/guide/en/elasticsearch/reference/8.4/clear-scroll-api.html">Documentation
358358
* on elastic.co</a>
359359
*/
360360

@@ -372,7 +372,7 @@ public ClearScrollResponse clearScroll(ClearScrollRequest request) throws IOExce
372372
* a function that initializes a builder to create the
373373
* {@link ClearScrollRequest}
374374
* @see <a href=
375-
* "https://www.elastic.co/guide/en/elasticsearch/reference/8.3/clear-scroll-api.html">Documentation
375+
* "https://www.elastic.co/guide/en/elasticsearch/reference/8.4/clear-scroll-api.html">Documentation
376376
* on elastic.co</a>
377377
*/
378378

@@ -386,7 +386,7 @@ public final ClearScrollResponse clearScroll(
386386
* Explicitly clears the search context for a scroll.
387387
*
388388
* @see <a href=
389-
* "https://www.elastic.co/guide/en/elasticsearch/reference/8.3/clear-scroll-api.html">Documentation
389+
* "https://www.elastic.co/guide/en/elasticsearch/reference/8.4/clear-scroll-api.html">Documentation
390390
* on elastic.co</a>
391391
*/
392392

@@ -401,7 +401,7 @@ public ClearScrollResponse clearScroll() throws IOException, ElasticsearchExcept
401401
* Close a point in time
402402
*
403403
* @see <a href=
404-
* "https://www.elastic.co/guide/en/elasticsearch/reference/8.3/point-in-time-api.html">Documentation
404+
* "https://www.elastic.co/guide/en/elasticsearch/reference/8.4/point-in-time-api.html">Documentation
405405
* on elastic.co</a>
406406
*/
407407

@@ -420,7 +420,7 @@ public ClosePointInTimeResponse closePointInTime(ClosePointInTimeRequest request
420420
* a function that initializes a builder to create the
421421
* {@link ClosePointInTimeRequest}
422422
* @see <a href=
423-
* "https://www.elastic.co/guide/en/elasticsearch/reference/8.3/point-in-time-api.html">Documentation
423+
* "https://www.elastic.co/guide/en/elasticsearch/reference/8.4/point-in-time-api.html">Documentation
424424
* on elastic.co</a>
425425
*/
426426

@@ -1176,7 +1176,7 @@ public MtermvectorsResponse mtermvectors() throws IOException, ElasticsearchExce
11761176
* Open a point in time that can be used in subsequent searches
11771177
*
11781178
* @see <a href=
1179-
* "https://www.elastic.co/guide/en/elasticsearch/reference/8.3/point-in-time-api.html">Documentation
1179+
* "https://www.elastic.co/guide/en/elasticsearch/reference/8.4/point-in-time-api.html">Documentation
11801180
* on elastic.co</a>
11811181
*/
11821182

@@ -1195,7 +1195,7 @@ public OpenPointInTimeResponse openPointInTime(OpenPointInTimeRequest request)
11951195
* a function that initializes a builder to create the
11961196
* {@link OpenPointInTimeRequest}
11971197
* @see <a href=
1198-
* "https://www.elastic.co/guide/en/elasticsearch/reference/8.3/point-in-time-api.html">Documentation
1198+
* "https://www.elastic.co/guide/en/elasticsearch/reference/8.4/point-in-time-api.html">Documentation
11991199
* on elastic.co</a>
12001200
*/
12011201

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

Lines changed: 26 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ public class BulkStats implements JsonpSerializable {
5252
private final long totalOperations;
5353

5454
@Nullable
55-
private final String totalTime;
55+
private final Time totalTime;
5656

5757
private final long totalTimeInMillis;
5858

@@ -62,7 +62,7 @@ public class BulkStats implements JsonpSerializable {
6262
private final long totalSizeInBytes;
6363

6464
@Nullable
65-
private final String avgTime;
65+
private final Time avgTime;
6666

6767
private final long avgTimeInMillis;
6868

@@ -102,7 +102,7 @@ public final long totalOperations() {
102102
* API name: {@code total_time}
103103
*/
104104
@Nullable
105-
public final String totalTime() {
105+
public final Time totalTime() {
106106
return this.totalTime;
107107
}
108108

@@ -132,7 +132,7 @@ public final long totalSizeInBytes() {
132132
* API name: {@code avg_time}
133133
*/
134134
@Nullable
135-
public final String avgTime() {
135+
public final Time avgTime() {
136136
return this.avgTime;
137137
}
138138

@@ -174,7 +174,7 @@ protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) {
174174

175175
if (this.totalTime != null) {
176176
generator.writeKey("total_time");
177-
generator.write(this.totalTime);
177+
this.totalTime.serialize(generator, mapper);
178178

179179
}
180180
generator.writeKey("total_time_in_millis");
@@ -190,7 +190,7 @@ protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) {
190190

191191
if (this.avgTime != null) {
192192
generator.writeKey("avg_time");
193-
generator.write(this.avgTime);
193+
this.avgTime.serialize(generator, mapper);
194194

195195
}
196196
generator.writeKey("avg_time_in_millis");
@@ -221,7 +221,7 @@ public static class Builder extends WithJsonObjectBuilderBase<Builder> implement
221221
private Long totalOperations;
222222

223223
@Nullable
224-
private String totalTime;
224+
private Time totalTime;
225225

226226
private Long totalTimeInMillis;
227227

@@ -231,7 +231,7 @@ public static class Builder extends WithJsonObjectBuilderBase<Builder> implement
231231
private Long totalSizeInBytes;
232232

233233
@Nullable
234-
private String avgTime;
234+
private Time avgTime;
235235

236236
private Long avgTimeInMillis;
237237

@@ -251,11 +251,18 @@ public final Builder totalOperations(long value) {
251251
/**
252252
* API name: {@code total_time}
253253
*/
254-
public final Builder totalTime(@Nullable String value) {
254+
public final Builder totalTime(@Nullable Time value) {
255255
this.totalTime = value;
256256
return this;
257257
}
258258

259+
/**
260+
* API name: {@code total_time}
261+
*/
262+
public final Builder totalTime(Function<Time.Builder, ObjectBuilder<Time>> fn) {
263+
return this.totalTime(fn.apply(new Time.Builder()).build());
264+
}
265+
259266
/**
260267
* Required - API name: {@code total_time_in_millis}
261268
*/
@@ -283,11 +290,18 @@ public final Builder totalSizeInBytes(long value) {
283290
/**
284291
* API name: {@code avg_time}
285292
*/
286-
public final Builder avgTime(@Nullable String value) {
293+
public final Builder avgTime(@Nullable Time value) {
287294
this.avgTime = value;
288295
return this;
289296
}
290297

298+
/**
299+
* API name: {@code avg_time}
300+
*/
301+
public final Builder avgTime(Function<Time.Builder, ObjectBuilder<Time>> fn) {
302+
return this.avgTime(fn.apply(new Time.Builder()).build());
303+
}
304+
291305
/**
292306
* Required - API name: {@code avg_time_in_millis}
293307
*/
@@ -341,11 +355,11 @@ public BulkStats build() {
341355
protected static void setupBulkStatsDeserializer(ObjectDeserializer<BulkStats.Builder> op) {
342356

343357
op.add(Builder::totalOperations, JsonpDeserializer.longDeserializer(), "total_operations");
344-
op.add(Builder::totalTime, JsonpDeserializer.stringDeserializer(), "total_time");
358+
op.add(Builder::totalTime, Time._DESERIALIZER, "total_time");
345359
op.add(Builder::totalTimeInMillis, JsonpDeserializer.longDeserializer(), "total_time_in_millis");
346360
op.add(Builder::totalSize, JsonpDeserializer.stringDeserializer(), "total_size");
347361
op.add(Builder::totalSizeInBytes, JsonpDeserializer.longDeserializer(), "total_size_in_bytes");
348-
op.add(Builder::avgTime, JsonpDeserializer.stringDeserializer(), "avg_time");
362+
op.add(Builder::avgTime, Time._DESERIALIZER, "avg_time");
349363
op.add(Builder::avgTimeInMillis, JsonpDeserializer.longDeserializer(), "avg_time_in_millis");
350364
op.add(Builder::avgSize, JsonpDeserializer.stringDeserializer(), "avg_size");
351365
op.add(Builder::avgSizeInBytes, JsonpDeserializer.longDeserializer(), "avg_size_in_bytes");

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

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,6 @@
3535
import co.elastic.clients.util.WithJsonObjectBuilderBase;
3636
import jakarta.json.stream.JsonGenerator;
3737
import java.lang.Long;
38-
import java.lang.String;
3938
import java.util.Objects;
4039
import java.util.function.Function;
4140
import javax.annotation.Nullable;
@@ -54,7 +53,7 @@ public class FlushStats implements JsonpSerializable {
5453
private final long total;
5554

5655
@Nullable
57-
private final String totalTime;
56+
private final Time totalTime;
5857

5958
private final long totalTimeInMillis;
6059

@@ -91,7 +90,7 @@ public final long total() {
9190
* API name: {@code total_time}
9291
*/
9392
@Nullable
94-
public final String totalTime() {
93+
public final Time totalTime() {
9594
return this.totalTime;
9695
}
9796

@@ -121,7 +120,7 @@ protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) {
121120

122121
if (this.totalTime != null) {
123122
generator.writeKey("total_time");
124-
generator.write(this.totalTime);
123+
this.totalTime.serialize(generator, mapper);
125124

126125
}
127126
generator.writeKey("total_time_in_millis");
@@ -146,7 +145,7 @@ public static class Builder extends WithJsonObjectBuilderBase<Builder> implement
146145
private Long total;
147146

148147
@Nullable
149-
private String totalTime;
148+
private Time totalTime;
150149

151150
private Long totalTimeInMillis;
152151

@@ -169,11 +168,18 @@ public final Builder total(long value) {
169168
/**
170169
* API name: {@code total_time}
171170
*/
172-
public final Builder totalTime(@Nullable String value) {
171+
public final Builder totalTime(@Nullable Time value) {
173172
this.totalTime = value;
174173
return this;
175174
}
176175

176+
/**
177+
* API name: {@code total_time}
178+
*/
179+
public final Builder totalTime(Function<Time.Builder, ObjectBuilder<Time>> fn) {
180+
return this.totalTime(fn.apply(new Time.Builder()).build());
181+
}
182+
177183
/**
178184
* Required - API name: {@code total_time_in_millis}
179185
*/
@@ -212,7 +218,7 @@ protected static void setupFlushStatsDeserializer(ObjectDeserializer<FlushStats.
212218

213219
op.add(Builder::periodic, JsonpDeserializer.longDeserializer(), "periodic");
214220
op.add(Builder::total, JsonpDeserializer.longDeserializer(), "total");
215-
op.add(Builder::totalTime, JsonpDeserializer.stringDeserializer(), "total_time");
221+
op.add(Builder::totalTime, Time._DESERIALIZER, "total_time");
216222
op.add(Builder::totalTimeInMillis, JsonpDeserializer.longDeserializer(), "total_time_in_millis");
217223

218224
}

0 commit comments

Comments
 (0)