Skip to content

Commit 473731d

Browse files
committed
Ensure builders always extend the parent builder, bump revision
1 parent a69f3c2 commit 473731d

File tree

406 files changed

+2351
-1165
lines changed

Some content is hidden

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

406 files changed

+2351
-1165
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.5/docs-bulk.html">Documentation
308+
* "https://www.elastic.co/guide/en/elasticsearch/reference/8.6/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.5/docs-bulk.html">Documentation
327+
* "https://www.elastic.co/guide/en/elasticsearch/reference/8.6/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.5/docs-bulk.html">Documentation
340+
* "https://www.elastic.co/guide/en/elasticsearch/reference/8.6/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.5/clear-scroll-api.html">Documentation
355+
* "https://www.elastic.co/guide/en/elasticsearch/reference/8.6/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.5/clear-scroll-api.html">Documentation
373+
* "https://www.elastic.co/guide/en/elasticsearch/reference/8.6/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.5/clear-scroll-api.html">Documentation
386+
* "https://www.elastic.co/guide/en/elasticsearch/reference/8.6/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.5/point-in-time-api.html">Documentation
401+
* "https://www.elastic.co/guide/en/elasticsearch/reference/8.6/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.5/point-in-time-api.html">Documentation
419+
* "https://www.elastic.co/guide/en/elasticsearch/reference/8.6/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.5/point-in-time-api.html">Documentation
1161+
* "https://www.elastic.co/guide/en/elasticsearch/reference/8.6/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.5/point-in-time-api.html">Documentation
1179+
* "https://www.elastic.co/guide/en/elasticsearch/reference/8.6/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.5/docs-bulk.html">Documentation
309+
* "https://www.elastic.co/guide/en/elasticsearch/reference/8.6/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.5/docs-bulk.html">Documentation
328+
* "https://www.elastic.co/guide/en/elasticsearch/reference/8.6/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.5/docs-bulk.html">Documentation
342+
* "https://www.elastic.co/guide/en/elasticsearch/reference/8.6/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.5/clear-scroll-api.html">Documentation
357+
* "https://www.elastic.co/guide/en/elasticsearch/reference/8.6/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.5/clear-scroll-api.html">Documentation
375+
* "https://www.elastic.co/guide/en/elasticsearch/reference/8.6/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.5/clear-scroll-api.html">Documentation
389+
* "https://www.elastic.co/guide/en/elasticsearch/reference/8.6/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.5/point-in-time-api.html">Documentation
404+
* "https://www.elastic.co/guide/en/elasticsearch/reference/8.6/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.5/point-in-time-api.html">Documentation
423+
* "https://www.elastic.co/guide/en/elasticsearch/reference/8.6/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.5/point-in-time-api.html">Documentation
1179+
* "https://www.elastic.co/guide/en/elasticsearch/reference/8.6/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.5/point-in-time-api.html">Documentation
1198+
* "https://www.elastic.co/guide/en/elasticsearch/reference/8.6/point-in-time-api.html">Documentation
11991199
* on elastic.co</a>
12001200
*/
12011201

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

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,13 @@ public abstract class RequestBase {
5050
public RequestBase() {
5151
}
5252

53+
protected abstract static class AbstractBuilder<BuilderT extends AbstractBuilder<BuilderT>>
54+
extends
55+
WithJsonObjectBuilderBase<BuilderT> {
56+
protected abstract BuilderT self();
57+
58+
}
59+
5360
@Override
5461
public String toString() {
5562

@@ -84,11 +91,4 @@ public String toString() {
8491
return sb.toString();
8592
}
8693

87-
protected abstract static class AbstractBuilder<BuilderT extends AbstractBuilder<BuilderT>>
88-
extends
89-
WithJsonObjectBuilderBase<BuilderT> {
90-
protected abstract BuilderT self();
91-
92-
}
93-
9494
}

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@
4848
/**
4949
*
5050
* @see <a href=
51-
* "https://www.elastic.co/guide/en/elasticsearch/reference/8.5/sort-search-results.html">Documentation
51+
* "https://www.elastic.co/guide/en/elasticsearch/reference/8.6/sort-search-results.html">Documentation
5252
* on elastic.co</a>
5353
* @see <a href="../doc-files/api-spec.html#_types.SortOptions">API
5454
* specification</a>

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

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323

2424
package co.elastic.clients.elasticsearch._types.aggregations;
2525

26+
import co.elastic.clients.elasticsearch._types.Time;
2627
import co.elastic.clients.json.JsonpDeserializable;
2728
import co.elastic.clients.json.JsonpDeserializer;
2829
import co.elastic.clients.json.JsonpMapper;
@@ -31,7 +32,6 @@
3132
import co.elastic.clients.util.ApiTypeHelper;
3233
import co.elastic.clients.util.ObjectBuilder;
3334
import jakarta.json.stream.JsonGenerator;
34-
import java.lang.String;
3535
import java.util.Objects;
3636
import java.util.function.Function;
3737
import javax.annotation.Nullable;
@@ -48,7 +48,7 @@
4848
public class AutoDateHistogramAggregate extends MultiBucketAggregateBase<DateHistogramBucket>
4949
implements
5050
AggregateVariant {
51-
private final String interval;
51+
private final Time interval;
5252

5353
// ---------------------------------------------------------------------------------------------
5454

@@ -74,15 +74,15 @@ public Aggregate.Kind _aggregateKind() {
7474
/**
7575
* Required - API name: {@code interval}
7676
*/
77-
public final String interval() {
77+
public final Time interval() {
7878
return this.interval;
7979
}
8080

8181
protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) {
8282

8383
super.serializeInternal(generator, mapper);
8484
generator.writeKey("interval");
85-
generator.write(this.interval);
85+
this.interval.serialize(generator, mapper);
8686

8787
}
8888

@@ -95,16 +95,23 @@ protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) {
9595
public static class Builder extends MultiBucketAggregateBase.AbstractBuilder<DateHistogramBucket, Builder>
9696
implements
9797
ObjectBuilder<AutoDateHistogramAggregate> {
98-
private String interval;
98+
private Time interval;
9999

100100
/**
101101
* Required - API name: {@code interval}
102102
*/
103-
public final Builder interval(String value) {
103+
public final Builder interval(Time value) {
104104
this.interval = value;
105105
return this;
106106
}
107107

108+
/**
109+
* Required - API name: {@code interval}
110+
*/
111+
public final Builder interval(Function<Time.Builder, ObjectBuilder<Time>> fn) {
112+
return this.interval(fn.apply(new Time.Builder()).build());
113+
}
114+
108115
@Override
109116
protected Builder self() {
110117
return this;
@@ -135,7 +142,7 @@ public AutoDateHistogramAggregate build() {
135142
protected static void setupAutoDateHistogramAggregateDeserializer(
136143
ObjectDeserializer<AutoDateHistogramAggregate.Builder> op) {
137144
MultiBucketAggregateBase.setupMultiBucketAggregateBaseDeserializer(op, DateHistogramBucket._DESERIALIZER);
138-
op.add(Builder::interval, JsonpDeserializer.stringDeserializer(), "interval");
145+
op.add(Builder::interval, Time._DESERIALIZER, "interval");
139146

140147
}
141148

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@
4646
/**
4747
*
4848
* @see <a href=
49-
* "https://www.elastic.co/guide/en/elasticsearch/reference/8.5/analysis-normalizers.html">Documentation
49+
* "https://www.elastic.co/guide/en/elasticsearch/reference/8.6/analysis-normalizers.html">Documentation
5050
* on elastic.co</a>
5151
* @see <a href="../../doc-files/api-spec.html#_types.analysis.Normalizer">API
5252
* specification</a>

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@
4242
* searching with arbitrary geo shapes such as rectangles and polygons.
4343
*
4444
* @see <a href=
45-
* "https://www.elastic.co/guide/en/elasticsearch/reference/8.5/geo-shape.html">Documentation
45+
* "https://www.elastic.co/guide/en/elasticsearch/reference/8.6/geo-shape.html">Documentation
4646
* on elastic.co</a>
4747
* @see <a href=
4848
* "../../doc-files/api-spec.html#_types.mapping.GeoShapeProperty">API

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@
4343
* polygons.
4444
*
4545
* @see <a href=
46-
* "https://www.elastic.co/guide/en/elasticsearch/reference/8.5/shape.html">Documentation
46+
* "https://www.elastic.co/guide/en/elasticsearch/reference/8.6/shape.html">Documentation
4747
* on elastic.co</a>
4848
* @see <a href="../../doc-files/api-spec.html#_types.mapping.ShapeProperty">API
4949
* specification</a>

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@
4949
* the text.
5050
*
5151
* @see <a href=
52-
* "https://www.elastic.co/guide/en/elasticsearch/reference/8.5/query-dsl-mlt-query.html#_document_input_parameters">Documentation
52+
* "https://www.elastic.co/guide/en/elasticsearch/reference/8.6/query-dsl-mlt-query.html#_document_input_parameters">Documentation
5353
* on elastic.co</a>
5454
* @see <a href="../../doc-files/api-spec.html#_types.query_dsl.Like">API
5555
* specification</a>

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@
5050
/**
5151
*
5252
* @see <a href=
53-
* "https://www.elastic.co/guide/en/elasticsearch/reference/8.5/query-dsl.html">Documentation
53+
* "https://www.elastic.co/guide/en/elasticsearch/reference/8.6/query-dsl.html">Documentation
5454
* on elastic.co</a>
5555
* @see <a href=
5656
* "../../doc-files/api-spec.html#_types.query_dsl.QueryContainer">API

0 commit comments

Comments
 (0)