Skip to content

Commit

Permalink
[codegen] Add binary responses, cleanup orphan boolean responses
Browse files Browse the repository at this point in the history
  • Loading branch information
swallez committed Oct 28, 2022
1 parent a263c96 commit 3254863
Show file tree
Hide file tree
Showing 25 changed files with 1,017 additions and 710 deletions.
Expand Up @@ -95,6 +95,7 @@
import co.elastic.clients.elasticsearch.core.ScriptsPainlessExecuteResponse;
import co.elastic.clients.elasticsearch.core.ScrollRequest;
import co.elastic.clients.elasticsearch.core.ScrollResponse;
import co.elastic.clients.elasticsearch.core.SearchMvtRequest;
import co.elastic.clients.elasticsearch.core.SearchRequest;
import co.elastic.clients.elasticsearch.core.SearchResponse;
import co.elastic.clients.elasticsearch.core.SearchShardsRequest;
Expand Down Expand Up @@ -143,6 +144,7 @@
import co.elastic.clients.transport.JsonEndpoint;
import co.elastic.clients.transport.Transport;
import co.elastic.clients.transport.TransportOptions;
import co.elastic.clients.transport.endpoints.BinaryResponse;
import co.elastic.clients.transport.endpoints.BooleanResponse;
import co.elastic.clients.transport.endpoints.EndpointWithResponseMapperAttr;
import co.elastic.clients.util.ObjectBuilder;
Expand Down Expand Up @@ -657,7 +659,7 @@ public final CompletableFuture<DeleteScriptResponse> deleteScript(

public CompletableFuture<BooleanResponse> exists(ExistsRequest request) {
@SuppressWarnings("unchecked")
JsonEndpoint<ExistsRequest, BooleanResponse, ErrorResponse> endpoint = (JsonEndpoint<ExistsRequest, BooleanResponse, ErrorResponse>) ExistsRequest._ENDPOINT;
Endpoint<ExistsRequest, BooleanResponse, ErrorResponse> endpoint = (Endpoint<ExistsRequest, BooleanResponse, ErrorResponse>) ExistsRequest._ENDPOINT;

return this.transport.performRequestAsync(request, endpoint, this.transportOptions);
}
Expand Down Expand Up @@ -690,7 +692,7 @@ public final CompletableFuture<BooleanResponse> exists(

public CompletableFuture<BooleanResponse> existsSource(ExistsSourceRequest request) {
@SuppressWarnings("unchecked")
JsonEndpoint<ExistsSourceRequest, BooleanResponse, ErrorResponse> endpoint = (JsonEndpoint<ExistsSourceRequest, BooleanResponse, ErrorResponse>) ExistsSourceRequest._ENDPOINT;
Endpoint<ExistsSourceRequest, BooleanResponse, ErrorResponse> endpoint = (Endpoint<ExistsSourceRequest, BooleanResponse, ErrorResponse>) ExistsSourceRequest._ENDPOINT;

return this.transport.performRequestAsync(request, endpoint, this.transportOptions);
}
Expand Down Expand Up @@ -1506,6 +1508,41 @@ public final <TDocument> CompletableFuture<SearchResponse<TDocument>> search(
return search(fn.apply(new SearchRequest.Builder()).build(), tDocumentClass);
}

// ----- Endpoint: search_mvt

/**
* Searches a vector tile for geospatial values. Returns results as a binary
* Mapbox vector tile.
*
* @see <a href=
* "https://www.elastic.co/guide/en/elasticsearch/reference/master/search-vector-tile-api.html">Documentation
* on elastic.co</a>
*/

public CompletableFuture<BinaryResponse> searchMvt(SearchMvtRequest request) {
@SuppressWarnings("unchecked")
Endpoint<SearchMvtRequest, BinaryResponse, ErrorResponse> endpoint = (Endpoint<SearchMvtRequest, BinaryResponse, ErrorResponse>) SearchMvtRequest._ENDPOINT;

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

/**
* Searches a vector tile for geospatial values. Returns results as a binary
* Mapbox vector tile.
*
* @param fn
* a function that initializes a builder to create the
* {@link SearchMvtRequest}
* @see <a href=
* "https://www.elastic.co/guide/en/elasticsearch/reference/master/search-vector-tile-api.html">Documentation
* on elastic.co</a>
*/

public final CompletableFuture<BinaryResponse> searchMvt(
Function<SearchMvtRequest.Builder, ObjectBuilder<SearchMvtRequest>> fn) {
return searchMvt(fn.apply(new SearchMvtRequest.Builder()).build());
}

// ----- Endpoint: search_shards

/**
Expand Down
Expand Up @@ -96,6 +96,7 @@
import co.elastic.clients.elasticsearch.core.ScriptsPainlessExecuteResponse;
import co.elastic.clients.elasticsearch.core.ScrollRequest;
import co.elastic.clients.elasticsearch.core.ScrollResponse;
import co.elastic.clients.elasticsearch.core.SearchMvtRequest;
import co.elastic.clients.elasticsearch.core.SearchRequest;
import co.elastic.clients.elasticsearch.core.SearchResponse;
import co.elastic.clients.elasticsearch.core.SearchShardsRequest;
Expand Down Expand Up @@ -144,6 +145,7 @@
import co.elastic.clients.transport.JsonEndpoint;
import co.elastic.clients.transport.Transport;
import co.elastic.clients.transport.TransportOptions;
import co.elastic.clients.transport.endpoints.BinaryResponse;
import co.elastic.clients.transport.endpoints.BooleanResponse;
import co.elastic.clients.transport.endpoints.EndpointWithResponseMapperAttr;
import co.elastic.clients.util.ObjectBuilder;
Expand Down Expand Up @@ -668,7 +670,7 @@ public final DeleteScriptResponse deleteScript(

public BooleanResponse exists(ExistsRequest request) throws IOException, ElasticsearchException {
@SuppressWarnings("unchecked")
JsonEndpoint<ExistsRequest, BooleanResponse, ErrorResponse> endpoint = (JsonEndpoint<ExistsRequest, BooleanResponse, ErrorResponse>) ExistsRequest._ENDPOINT;
Endpoint<ExistsRequest, BooleanResponse, ErrorResponse> endpoint = (Endpoint<ExistsRequest, BooleanResponse, ErrorResponse>) ExistsRequest._ENDPOINT;

return this.transport.performRequest(request, endpoint, this.transportOptions);
}
Expand Down Expand Up @@ -701,7 +703,7 @@ public final BooleanResponse exists(Function<ExistsRequest.Builder, ObjectBuilde

public BooleanResponse existsSource(ExistsSourceRequest request) throws IOException, ElasticsearchException {
@SuppressWarnings("unchecked")
JsonEndpoint<ExistsSourceRequest, BooleanResponse, ErrorResponse> endpoint = (JsonEndpoint<ExistsSourceRequest, BooleanResponse, ErrorResponse>) ExistsSourceRequest._ENDPOINT;
Endpoint<ExistsSourceRequest, BooleanResponse, ErrorResponse> endpoint = (Endpoint<ExistsSourceRequest, BooleanResponse, ErrorResponse>) ExistsSourceRequest._ENDPOINT;

return this.transport.performRequest(request, endpoint, this.transportOptions);
}
Expand Down Expand Up @@ -1533,6 +1535,41 @@ public final <TDocument> SearchResponse<TDocument> search(
return search(fn.apply(new SearchRequest.Builder()).build(), tDocumentClass);
}

// ----- Endpoint: search_mvt

/**
* Searches a vector tile for geospatial values. Returns results as a binary
* Mapbox vector tile.
*
* @see <a href=
* "https://www.elastic.co/guide/en/elasticsearch/reference/master/search-vector-tile-api.html">Documentation
* on elastic.co</a>
*/

public BinaryResponse searchMvt(SearchMvtRequest request) throws IOException, ElasticsearchException {
@SuppressWarnings("unchecked")
Endpoint<SearchMvtRequest, BinaryResponse, ErrorResponse> endpoint = (Endpoint<SearchMvtRequest, BinaryResponse, ErrorResponse>) SearchMvtRequest._ENDPOINT;

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

/**
* Searches a vector tile for geospatial values. Returns results as a binary
* Mapbox vector tile.
*
* @param fn
* a function that initializes a builder to create the
* {@link SearchMvtRequest}
* @see <a href=
* "https://www.elastic.co/guide/en/elasticsearch/reference/master/search-vector-tile-api.html">Documentation
* on elastic.co</a>
*/

public final BinaryResponse searchMvt(Function<SearchMvtRequest.Builder, ObjectBuilder<SearchMvtRequest>> fn)
throws IOException, ElasticsearchException {
return searchMvt(fn.apply(new SearchMvtRequest.Builder()).build());
}

// ----- Endpoint: search_shards

/**
Expand Down

This file was deleted.

Expand Up @@ -150,7 +150,7 @@ public final CompletableFuture<DeleteComponentTemplateResponse> deleteComponentT
public CompletableFuture<BooleanResponse> deleteVotingConfigExclusions(
DeleteVotingConfigExclusionsRequest request) {
@SuppressWarnings("unchecked")
JsonEndpoint<DeleteVotingConfigExclusionsRequest, BooleanResponse, ErrorResponse> endpoint = (JsonEndpoint<DeleteVotingConfigExclusionsRequest, BooleanResponse, ErrorResponse>) DeleteVotingConfigExclusionsRequest._ENDPOINT;
Endpoint<DeleteVotingConfigExclusionsRequest, BooleanResponse, ErrorResponse> endpoint = (Endpoint<DeleteVotingConfigExclusionsRequest, BooleanResponse, ErrorResponse>) DeleteVotingConfigExclusionsRequest._ENDPOINT;

return this.transport.performRequestAsync(request, endpoint, this.transportOptions);
}
Expand Down Expand Up @@ -196,7 +196,7 @@ public CompletableFuture<BooleanResponse> deleteVotingConfigExclusions() {

public CompletableFuture<BooleanResponse> existsComponentTemplate(ExistsComponentTemplateRequest request) {
@SuppressWarnings("unchecked")
JsonEndpoint<ExistsComponentTemplateRequest, BooleanResponse, ErrorResponse> endpoint = (JsonEndpoint<ExistsComponentTemplateRequest, BooleanResponse, ErrorResponse>) ExistsComponentTemplateRequest._ENDPOINT;
Endpoint<ExistsComponentTemplateRequest, BooleanResponse, ErrorResponse> endpoint = (Endpoint<ExistsComponentTemplateRequest, BooleanResponse, ErrorResponse>) ExistsComponentTemplateRequest._ENDPOINT;

return this.transport.performRequestAsync(request, endpoint, this.transportOptions);
}
Expand Down Expand Up @@ -416,7 +416,7 @@ public CompletableFuture<PendingTasksResponse> pendingTasks() {

public CompletableFuture<BooleanResponse> postVotingConfigExclusions(PostVotingConfigExclusionsRequest request) {
@SuppressWarnings("unchecked")
JsonEndpoint<PostVotingConfigExclusionsRequest, BooleanResponse, ErrorResponse> endpoint = (JsonEndpoint<PostVotingConfigExclusionsRequest, BooleanResponse, ErrorResponse>) PostVotingConfigExclusionsRequest._ENDPOINT;
Endpoint<PostVotingConfigExclusionsRequest, BooleanResponse, ErrorResponse> endpoint = (Endpoint<PostVotingConfigExclusionsRequest, BooleanResponse, ErrorResponse>) PostVotingConfigExclusionsRequest._ENDPOINT;

return this.transport.performRequestAsync(request, endpoint, this.transportOptions);
}
Expand Down
Expand Up @@ -151,7 +151,7 @@ public final DeleteComponentTemplateResponse deleteComponentTemplate(
public BooleanResponse deleteVotingConfigExclusions(DeleteVotingConfigExclusionsRequest request)
throws IOException, ElasticsearchException {
@SuppressWarnings("unchecked")
JsonEndpoint<DeleteVotingConfigExclusionsRequest, BooleanResponse, ErrorResponse> endpoint = (JsonEndpoint<DeleteVotingConfigExclusionsRequest, BooleanResponse, ErrorResponse>) DeleteVotingConfigExclusionsRequest._ENDPOINT;
Endpoint<DeleteVotingConfigExclusionsRequest, BooleanResponse, ErrorResponse> endpoint = (Endpoint<DeleteVotingConfigExclusionsRequest, BooleanResponse, ErrorResponse>) DeleteVotingConfigExclusionsRequest._ENDPOINT;

return this.transport.performRequest(request, endpoint, this.transportOptions);
}
Expand Down Expand Up @@ -199,7 +199,7 @@ public BooleanResponse deleteVotingConfigExclusions() throws IOException, Elasti
public BooleanResponse existsComponentTemplate(ExistsComponentTemplateRequest request)
throws IOException, ElasticsearchException {
@SuppressWarnings("unchecked")
JsonEndpoint<ExistsComponentTemplateRequest, BooleanResponse, ErrorResponse> endpoint = (JsonEndpoint<ExistsComponentTemplateRequest, BooleanResponse, ErrorResponse>) ExistsComponentTemplateRequest._ENDPOINT;
Endpoint<ExistsComponentTemplateRequest, BooleanResponse, ErrorResponse> endpoint = (Endpoint<ExistsComponentTemplateRequest, BooleanResponse, ErrorResponse>) ExistsComponentTemplateRequest._ENDPOINT;

return this.transport.performRequest(request, endpoint, this.transportOptions);
}
Expand Down Expand Up @@ -426,7 +426,7 @@ public PendingTasksResponse pendingTasks() throws IOException, ElasticsearchExce
public BooleanResponse postVotingConfigExclusions(PostVotingConfigExclusionsRequest request)
throws IOException, ElasticsearchException {
@SuppressWarnings("unchecked")
JsonEndpoint<PostVotingConfigExclusionsRequest, BooleanResponse, ErrorResponse> endpoint = (JsonEndpoint<PostVotingConfigExclusionsRequest, BooleanResponse, ErrorResponse>) PostVotingConfigExclusionsRequest._ENDPOINT;
Endpoint<PostVotingConfigExclusionsRequest, BooleanResponse, ErrorResponse> endpoint = (Endpoint<PostVotingConfigExclusionsRequest, BooleanResponse, ErrorResponse>) PostVotingConfigExclusionsRequest._ENDPOINT;

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

This file was deleted.

This file was deleted.

0 comments on commit 3254863

Please sign in to comment.