Skip to content

Update API spec, fix some spec-related java client issues #344

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jul 12, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -305,7 +305,7 @@ public ElasticsearchXpackAsyncClient xpack() {
* request.
*
* @see <a href=
* "https://www.elastic.co/guide/en/elasticsearch/reference/8.3/docs-bulk.html">Documentation
* "https://www.elastic.co/guide/en/elasticsearch/reference/8.4/docs-bulk.html">Documentation
* on elastic.co</a>
*/

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

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

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

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

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

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

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

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

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

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -306,7 +306,7 @@ public ElasticsearchXpackClient xpack() {
* request.
*
* @see <a href=
* "https://www.elastic.co/guide/en/elasticsearch/reference/8.3/docs-bulk.html">Documentation
* "https://www.elastic.co/guide/en/elasticsearch/reference/8.4/docs-bulk.html">Documentation
* on elastic.co</a>
*/

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

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

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

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

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

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

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

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

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

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ public class BulkStats implements JsonpSerializable {
private final long totalOperations;

@Nullable
private final String totalTime;
private final Time totalTime;

private final long totalTimeInMillis;

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

@Nullable
private final String avgTime;
private final Time avgTime;

private final long avgTimeInMillis;

Expand Down Expand Up @@ -102,7 +102,7 @@ public final long totalOperations() {
* API name: {@code total_time}
*/
@Nullable
public final String totalTime() {
public final Time totalTime() {
return this.totalTime;
}

Expand Down Expand Up @@ -132,7 +132,7 @@ public final long totalSizeInBytes() {
* API name: {@code avg_time}
*/
@Nullable
public final String avgTime() {
public final Time avgTime() {
return this.avgTime;
}

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

if (this.totalTime != null) {
generator.writeKey("total_time");
generator.write(this.totalTime);
this.totalTime.serialize(generator, mapper);

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

if (this.avgTime != null) {
generator.writeKey("avg_time");
generator.write(this.avgTime);
this.avgTime.serialize(generator, mapper);

}
generator.writeKey("avg_time_in_millis");
Expand Down Expand Up @@ -221,7 +221,7 @@ public static class Builder extends WithJsonObjectBuilderBase<Builder> implement
private Long totalOperations;

@Nullable
private String totalTime;
private Time totalTime;

private Long totalTimeInMillis;

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

@Nullable
private String avgTime;
private Time avgTime;

private Long avgTimeInMillis;

Expand All @@ -251,11 +251,18 @@ public final Builder totalOperations(long value) {
/**
* API name: {@code total_time}
*/
public final Builder totalTime(@Nullable String value) {
public final Builder totalTime(@Nullable Time value) {
this.totalTime = value;
return this;
}

/**
* API name: {@code total_time}
*/
public final Builder totalTime(Function<Time.Builder, ObjectBuilder<Time>> fn) {
return this.totalTime(fn.apply(new Time.Builder()).build());
}

/**
* Required - API name: {@code total_time_in_millis}
*/
Expand Down Expand Up @@ -283,11 +290,18 @@ public final Builder totalSizeInBytes(long value) {
/**
* API name: {@code avg_time}
*/
public final Builder avgTime(@Nullable String value) {
public final Builder avgTime(@Nullable Time value) {
this.avgTime = value;
return this;
}

/**
* API name: {@code avg_time}
*/
public final Builder avgTime(Function<Time.Builder, ObjectBuilder<Time>> fn) {
return this.avgTime(fn.apply(new Time.Builder()).build());
}

/**
* Required - API name: {@code avg_time_in_millis}
*/
Expand Down Expand Up @@ -341,11 +355,11 @@ public BulkStats build() {
protected static void setupBulkStatsDeserializer(ObjectDeserializer<BulkStats.Builder> op) {

op.add(Builder::totalOperations, JsonpDeserializer.longDeserializer(), "total_operations");
op.add(Builder::totalTime, JsonpDeserializer.stringDeserializer(), "total_time");
op.add(Builder::totalTime, Time._DESERIALIZER, "total_time");
op.add(Builder::totalTimeInMillis, JsonpDeserializer.longDeserializer(), "total_time_in_millis");
op.add(Builder::totalSize, JsonpDeserializer.stringDeserializer(), "total_size");
op.add(Builder::totalSizeInBytes, JsonpDeserializer.longDeserializer(), "total_size_in_bytes");
op.add(Builder::avgTime, JsonpDeserializer.stringDeserializer(), "avg_time");
op.add(Builder::avgTime, Time._DESERIALIZER, "avg_time");
op.add(Builder::avgTimeInMillis, JsonpDeserializer.longDeserializer(), "avg_time_in_millis");
op.add(Builder::avgSize, JsonpDeserializer.stringDeserializer(), "avg_size");
op.add(Builder::avgSizeInBytes, JsonpDeserializer.longDeserializer(), "avg_size_in_bytes");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@
import co.elastic.clients.util.WithJsonObjectBuilderBase;
import jakarta.json.stream.JsonGenerator;
import java.lang.Long;
import java.lang.String;
import java.util.Objects;
import java.util.function.Function;
import javax.annotation.Nullable;
Expand All @@ -54,7 +53,7 @@ public class FlushStats implements JsonpSerializable {
private final long total;

@Nullable
private final String totalTime;
private final Time totalTime;

private final long totalTimeInMillis;

Expand Down Expand Up @@ -91,7 +90,7 @@ public final long total() {
* API name: {@code total_time}
*/
@Nullable
public final String totalTime() {
public final Time totalTime() {
return this.totalTime;
}

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

if (this.totalTime != null) {
generator.writeKey("total_time");
generator.write(this.totalTime);
this.totalTime.serialize(generator, mapper);

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

@Nullable
private String totalTime;
private Time totalTime;

private Long totalTimeInMillis;

Expand All @@ -169,11 +168,18 @@ public final Builder total(long value) {
/**
* API name: {@code total_time}
*/
public final Builder totalTime(@Nullable String value) {
public final Builder totalTime(@Nullable Time value) {
this.totalTime = value;
return this;
}

/**
* API name: {@code total_time}
*/
public final Builder totalTime(Function<Time.Builder, ObjectBuilder<Time>> fn) {
return this.totalTime(fn.apply(new Time.Builder()).build());
}

/**
* Required - API name: {@code total_time_in_millis}
*/
Expand Down Expand Up @@ -212,7 +218,7 @@ protected static void setupFlushStatsDeserializer(ObjectDeserializer<FlushStats.

op.add(Builder::periodic, JsonpDeserializer.longDeserializer(), "periodic");
op.add(Builder::total, JsonpDeserializer.longDeserializer(), "total");
op.add(Builder::totalTime, JsonpDeserializer.stringDeserializer(), "total_time");
op.add(Builder::totalTime, Time._DESERIALIZER, "total_time");
op.add(Builder::totalTimeInMillis, JsonpDeserializer.longDeserializer(), "total_time_in_millis");

}
Expand Down
Loading