Skip to content

Commit

Permalink
[codegen] Update to latest API spec
Browse files Browse the repository at this point in the history
  • Loading branch information
swallez committed Apr 17, 2023
1 parent bac7a0e commit d6a33d3
Show file tree
Hide file tree
Showing 45 changed files with 6,107 additions and 323 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,8 @@
import co.elastic.clients.elasticsearch.core.GetScriptResponse;
import co.elastic.clients.elasticsearch.core.GetSourceRequest;
import co.elastic.clients.elasticsearch.core.GetSourceResponse;
import co.elastic.clients.elasticsearch.core.HealthReportRequest;
import co.elastic.clients.elasticsearch.core.HealthReportResponse;
import co.elastic.clients.elasticsearch.core.IndexRequest;
import co.elastic.clients.elasticsearch.core.IndexResponse;
import co.elastic.clients.elasticsearch.core.InfoRequest;
Expand Down Expand Up @@ -1033,6 +1035,52 @@ public final <TDocument> CompletableFuture<GetSourceResponse<TDocument>> getSour
return getSource(fn.apply(new GetSourceRequest.Builder()).build(), tDocumentType);
}

// ----- Endpoint: health_report

/**
* Returns the health of the cluster.
*
* @see <a href=
* "https://www.elastic.co/guide/en/elasticsearch/reference/current/health-api.html">Documentation
* on elastic.co</a>
*/

public CompletableFuture<HealthReportResponse> healthReport(HealthReportRequest request) {
@SuppressWarnings("unchecked")
JsonEndpoint<HealthReportRequest, HealthReportResponse, ErrorResponse> endpoint = (JsonEndpoint<HealthReportRequest, HealthReportResponse, ErrorResponse>) HealthReportRequest._ENDPOINT;

return this.transport.performRequestAsync(request, endpoint, this.transportOptions);
}

/**
* Returns the health of the cluster.
*
* @param fn
* a function that initializes a builder to create the
* {@link HealthReportRequest}
* @see <a href=
* "https://www.elastic.co/guide/en/elasticsearch/reference/current/health-api.html">Documentation
* on elastic.co</a>
*/

public final CompletableFuture<HealthReportResponse> healthReport(
Function<HealthReportRequest.Builder, ObjectBuilder<HealthReportRequest>> fn) {
return healthReport(fn.apply(new HealthReportRequest.Builder()).build());
}

/**
* Returns the health of the cluster.
*
* @see <a href=
* "https://www.elastic.co/guide/en/elasticsearch/reference/current/health-api.html">Documentation
* on elastic.co</a>
*/

public CompletableFuture<HealthReportResponse> healthReport() {
return this.transport.performRequestAsync(new HealthReportRequest.Builder().build(),
HealthReportRequest._ENDPOINT, this.transportOptions);
}

// ----- Endpoint: index

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,8 @@
import co.elastic.clients.elasticsearch.core.GetScriptResponse;
import co.elastic.clients.elasticsearch.core.GetSourceRequest;
import co.elastic.clients.elasticsearch.core.GetSourceResponse;
import co.elastic.clients.elasticsearch.core.HealthReportRequest;
import co.elastic.clients.elasticsearch.core.HealthReportResponse;
import co.elastic.clients.elasticsearch.core.IndexRequest;
import co.elastic.clients.elasticsearch.core.IndexResponse;
import co.elastic.clients.elasticsearch.core.InfoRequest;
Expand Down Expand Up @@ -1050,6 +1052,53 @@ public final <TDocument> GetSourceResponse<TDocument> getSource(
return getSource(fn.apply(new GetSourceRequest.Builder()).build(), tDocumentType);
}

// ----- Endpoint: health_report

/**
* Returns the health of the cluster.
*
* @see <a href=
* "https://www.elastic.co/guide/en/elasticsearch/reference/current/health-api.html">Documentation
* on elastic.co</a>
*/

public HealthReportResponse healthReport(HealthReportRequest request) throws IOException, ElasticsearchException {
@SuppressWarnings("unchecked")
JsonEndpoint<HealthReportRequest, HealthReportResponse, ErrorResponse> endpoint = (JsonEndpoint<HealthReportRequest, HealthReportResponse, ErrorResponse>) HealthReportRequest._ENDPOINT;

return this.transport.performRequest(request, endpoint, this.transportOptions);
}

/**
* Returns the health of the cluster.
*
* @param fn
* a function that initializes a builder to create the
* {@link HealthReportRequest}
* @see <a href=
* "https://www.elastic.co/guide/en/elasticsearch/reference/current/health-api.html">Documentation
* on elastic.co</a>
*/

public final HealthReportResponse healthReport(
Function<HealthReportRequest.Builder, ObjectBuilder<HealthReportRequest>> fn)
throws IOException, ElasticsearchException {
return healthReport(fn.apply(new HealthReportRequest.Builder()).build());
}

/**
* Returns the health of the cluster.
*
* @see <a href=
* "https://www.elastic.co/guide/en/elasticsearch/reference/current/health-api.html">Documentation
* on elastic.co</a>
*/

public HealthReportResponse healthReport() throws IOException, ElasticsearchException {
return this.transport.performRequest(new HealthReportRequest.Builder().build(), HealthReportRequest._ENDPOINT,
this.transportOptions);
}

// ----- Endpoint: index

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
import co.elastic.clients.util.WithJsonObjectBuilderBase;
import jakarta.json.stream.JsonGenerator;
import java.lang.Integer;
import java.lang.Long;
import java.lang.String;
import java.util.Objects;
import java.util.function.Function;
Expand All @@ -60,7 +61,7 @@ public class QueryCacheStats implements JsonpSerializable {
@Nullable
private final String memorySize;

private final int memorySizeInBytes;
private final long memorySizeInBytes;

private final int missCount;

Expand Down Expand Up @@ -124,7 +125,7 @@ public final String memorySize() {
/**
* Required - API name: {@code memory_size_in_bytes}
*/
public final int memorySizeInBytes() {
public final long memorySizeInBytes() {
return this.memorySizeInBytes;
}

Expand Down Expand Up @@ -204,7 +205,7 @@ public static class Builder extends WithJsonObjectBuilderBase<Builder> implement
@Nullable
private String memorySize;

private Integer memorySizeInBytes;
private Long memorySizeInBytes;

private Integer missCount;

Expand Down Expand Up @@ -253,7 +254,7 @@ public final Builder memorySize(@Nullable String value) {
/**
* Required - API name: {@code memory_size_in_bytes}
*/
public final Builder memorySizeInBytes(int value) {
public final Builder memorySizeInBytes(long value) {
this.memorySizeInBytes = value;
return this;
}
Expand Down Expand Up @@ -307,7 +308,7 @@ protected static void setupQueryCacheStatsDeserializer(ObjectDeserializer<QueryC
op.add(Builder::evictions, JsonpDeserializer.integerDeserializer(), "evictions");
op.add(Builder::hitCount, JsonpDeserializer.integerDeserializer(), "hit_count");
op.add(Builder::memorySize, JsonpDeserializer.stringDeserializer(), "memory_size");
op.add(Builder::memorySizeInBytes, JsonpDeserializer.integerDeserializer(), "memory_size_in_bytes");
op.add(Builder::memorySizeInBytes, JsonpDeserializer.longDeserializer(), "memory_size_in_bytes");
op.add(Builder::missCount, JsonpDeserializer.integerDeserializer(), "miss_count");
op.add(Builder::totalCount, JsonpDeserializer.integerDeserializer(), "total_count");

Expand Down
Loading

0 comments on commit d6a33d3

Please sign in to comment.