Skip to content

Commit e45b0e5

Browse files
committed
[codegen] Add binary responses, cleanup orphan boolean responses
1 parent 672f432 commit e45b0e5

26 files changed

+1026
-715
lines changed

java-client/build.gradle.kts

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -48,11 +48,15 @@ tasks.forbiddenApisMain {
4848
}
4949

5050
tasks.getByName<ProcessResources>("processResources") {
51-
// Only process main source-set resources (test files are large)
52-
expand(
53-
"version" to version,
54-
"git_revision" to (if (rootProject.extra.has("gitHashFull")) rootProject.extra["gitHashFull"] else "unknown")
55-
)
51+
eachFile {
52+
if (name != "apis.json") {
53+
// Only process main source-set resources (test files are large)
54+
expand(
55+
"version" to version,
56+
"git_revision" to (if (rootProject.extra.has("gitHashFull")) rootProject.extra["gitHashFull"] else "unknown")
57+
)
58+
}
59+
}
5660
}
5761

5862
tasks.withType<Test> {

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

Lines changed: 39 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,7 @@
9595
import co.elastic.clients.elasticsearch.core.ScriptsPainlessExecuteResponse;
9696
import co.elastic.clients.elasticsearch.core.ScrollRequest;
9797
import co.elastic.clients.elasticsearch.core.ScrollResponse;
98+
import co.elastic.clients.elasticsearch.core.SearchMvtRequest;
9899
import co.elastic.clients.elasticsearch.core.SearchRequest;
99100
import co.elastic.clients.elasticsearch.core.SearchResponse;
100101
import co.elastic.clients.elasticsearch.core.SearchShardsRequest;
@@ -143,6 +144,7 @@
143144
import co.elastic.clients.transport.JsonEndpoint;
144145
import co.elastic.clients.transport.Transport;
145146
import co.elastic.clients.transport.TransportOptions;
147+
import co.elastic.clients.transport.endpoints.BinaryResponse;
146148
import co.elastic.clients.transport.endpoints.BooleanResponse;
147149
import co.elastic.clients.transport.endpoints.EndpointWithResponseMapperAttr;
148150
import co.elastic.clients.util.ObjectBuilder;
@@ -657,7 +659,7 @@ public final CompletableFuture<DeleteScriptResponse> deleteScript(
657659

658660
public CompletableFuture<BooleanResponse> exists(ExistsRequest request) {
659661
@SuppressWarnings("unchecked")
660-
JsonEndpoint<ExistsRequest, BooleanResponse, ErrorResponse> endpoint = (JsonEndpoint<ExistsRequest, BooleanResponse, ErrorResponse>) ExistsRequest._ENDPOINT;
662+
Endpoint<ExistsRequest, BooleanResponse, ErrorResponse> endpoint = (Endpoint<ExistsRequest, BooleanResponse, ErrorResponse>) ExistsRequest._ENDPOINT;
661663

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

691693
public CompletableFuture<BooleanResponse> existsSource(ExistsSourceRequest request) {
692694
@SuppressWarnings("unchecked")
693-
JsonEndpoint<ExistsSourceRequest, BooleanResponse, ErrorResponse> endpoint = (JsonEndpoint<ExistsSourceRequest, BooleanResponse, ErrorResponse>) ExistsSourceRequest._ENDPOINT;
695+
Endpoint<ExistsSourceRequest, BooleanResponse, ErrorResponse> endpoint = (Endpoint<ExistsSourceRequest, BooleanResponse, ErrorResponse>) ExistsSourceRequest._ENDPOINT;
694696

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

1511+
// ----- Endpoint: search_mvt
1512+
1513+
/**
1514+
* Searches a vector tile for geospatial values. Returns results as a binary
1515+
* Mapbox vector tile.
1516+
*
1517+
* @see <a href=
1518+
* "https://www.elastic.co/guide/en/elasticsearch/reference/master/search-vector-tile-api.html">Documentation
1519+
* on elastic.co</a>
1520+
*/
1521+
1522+
public CompletableFuture<BinaryResponse> searchMvt(SearchMvtRequest request) {
1523+
@SuppressWarnings("unchecked")
1524+
Endpoint<SearchMvtRequest, BinaryResponse, ErrorResponse> endpoint = (Endpoint<SearchMvtRequest, BinaryResponse, ErrorResponse>) SearchMvtRequest._ENDPOINT;
1525+
1526+
return this.transport.performRequestAsync(request, endpoint, this.transportOptions);
1527+
}
1528+
1529+
/**
1530+
* Searches a vector tile for geospatial values. Returns results as a binary
1531+
* Mapbox vector tile.
1532+
*
1533+
* @param fn
1534+
* a function that initializes a builder to create the
1535+
* {@link SearchMvtRequest}
1536+
* @see <a href=
1537+
* "https://www.elastic.co/guide/en/elasticsearch/reference/master/search-vector-tile-api.html">Documentation
1538+
* on elastic.co</a>
1539+
*/
1540+
1541+
public final CompletableFuture<BinaryResponse> searchMvt(
1542+
Function<SearchMvtRequest.Builder, ObjectBuilder<SearchMvtRequest>> fn) {
1543+
return searchMvt(fn.apply(new SearchMvtRequest.Builder()).build());
1544+
}
1545+
15091546
// ----- Endpoint: search_shards
15101547

15111548
/**

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

Lines changed: 39 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,7 @@
9696
import co.elastic.clients.elasticsearch.core.ScriptsPainlessExecuteResponse;
9797
import co.elastic.clients.elasticsearch.core.ScrollRequest;
9898
import co.elastic.clients.elasticsearch.core.ScrollResponse;
99+
import co.elastic.clients.elasticsearch.core.SearchMvtRequest;
99100
import co.elastic.clients.elasticsearch.core.SearchRequest;
100101
import co.elastic.clients.elasticsearch.core.SearchResponse;
101102
import co.elastic.clients.elasticsearch.core.SearchShardsRequest;
@@ -144,6 +145,7 @@
144145
import co.elastic.clients.transport.JsonEndpoint;
145146
import co.elastic.clients.transport.Transport;
146147
import co.elastic.clients.transport.TransportOptions;
148+
import co.elastic.clients.transport.endpoints.BinaryResponse;
147149
import co.elastic.clients.transport.endpoints.BooleanResponse;
148150
import co.elastic.clients.transport.endpoints.EndpointWithResponseMapperAttr;
149151
import co.elastic.clients.util.ObjectBuilder;
@@ -668,7 +670,7 @@ public final DeleteScriptResponse deleteScript(
668670

669671
public BooleanResponse exists(ExistsRequest request) throws IOException, ElasticsearchException {
670672
@SuppressWarnings("unchecked")
671-
JsonEndpoint<ExistsRequest, BooleanResponse, ErrorResponse> endpoint = (JsonEndpoint<ExistsRequest, BooleanResponse, ErrorResponse>) ExistsRequest._ENDPOINT;
673+
Endpoint<ExistsRequest, BooleanResponse, ErrorResponse> endpoint = (Endpoint<ExistsRequest, BooleanResponse, ErrorResponse>) ExistsRequest._ENDPOINT;
672674

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

702704
public BooleanResponse existsSource(ExistsSourceRequest request) throws IOException, ElasticsearchException {
703705
@SuppressWarnings("unchecked")
704-
JsonEndpoint<ExistsSourceRequest, BooleanResponse, ErrorResponse> endpoint = (JsonEndpoint<ExistsSourceRequest, BooleanResponse, ErrorResponse>) ExistsSourceRequest._ENDPOINT;
706+
Endpoint<ExistsSourceRequest, BooleanResponse, ErrorResponse> endpoint = (Endpoint<ExistsSourceRequest, BooleanResponse, ErrorResponse>) ExistsSourceRequest._ENDPOINT;
705707

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

1538+
// ----- Endpoint: search_mvt
1539+
1540+
/**
1541+
* Searches a vector tile for geospatial values. Returns results as a binary
1542+
* Mapbox vector tile.
1543+
*
1544+
* @see <a href=
1545+
* "https://www.elastic.co/guide/en/elasticsearch/reference/master/search-vector-tile-api.html">Documentation
1546+
* on elastic.co</a>
1547+
*/
1548+
1549+
public BinaryResponse searchMvt(SearchMvtRequest request) throws IOException, ElasticsearchException {
1550+
@SuppressWarnings("unchecked")
1551+
Endpoint<SearchMvtRequest, BinaryResponse, ErrorResponse> endpoint = (Endpoint<SearchMvtRequest, BinaryResponse, ErrorResponse>) SearchMvtRequest._ENDPOINT;
1552+
1553+
return this.transport.performRequest(request, endpoint, this.transportOptions);
1554+
}
1555+
1556+
/**
1557+
* Searches a vector tile for geospatial values. Returns results as a binary
1558+
* Mapbox vector tile.
1559+
*
1560+
* @param fn
1561+
* a function that initializes a builder to create the
1562+
* {@link SearchMvtRequest}
1563+
* @see <a href=
1564+
* "https://www.elastic.co/guide/en/elasticsearch/reference/master/search-vector-tile-api.html">Documentation
1565+
* on elastic.co</a>
1566+
*/
1567+
1568+
public final BinaryResponse searchMvt(Function<SearchMvtRequest.Builder, ObjectBuilder<SearchMvtRequest>> fn)
1569+
throws IOException, ElasticsearchException {
1570+
return searchMvt(fn.apply(new SearchMvtRequest.Builder()).build());
1571+
}
1572+
15361573
// ----- Endpoint: search_shards
15371574

15381575
/**

java-client/src/main/java/co/elastic/clients/elasticsearch/cluster/DeleteVotingConfigExclusionsResponse.java

Lines changed: 0 additions & 55 deletions
This file was deleted.

java-client/src/main/java/co/elastic/clients/elasticsearch/cluster/ElasticsearchClusterAsyncClient.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,7 @@ public final CompletableFuture<DeleteComponentTemplateResponse> deleteComponentT
150150
public CompletableFuture<BooleanResponse> deleteVotingConfigExclusions(
151151
DeleteVotingConfigExclusionsRequest request) {
152152
@SuppressWarnings("unchecked")
153-
JsonEndpoint<DeleteVotingConfigExclusionsRequest, BooleanResponse, ErrorResponse> endpoint = (JsonEndpoint<DeleteVotingConfigExclusionsRequest, BooleanResponse, ErrorResponse>) DeleteVotingConfigExclusionsRequest._ENDPOINT;
153+
Endpoint<DeleteVotingConfigExclusionsRequest, BooleanResponse, ErrorResponse> endpoint = (Endpoint<DeleteVotingConfigExclusionsRequest, BooleanResponse, ErrorResponse>) DeleteVotingConfigExclusionsRequest._ENDPOINT;
154154

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

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

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

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

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

java-client/src/main/java/co/elastic/clients/elasticsearch/cluster/ElasticsearchClusterClient.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,7 @@ public final DeleteComponentTemplateResponse deleteComponentTemplate(
151151
public BooleanResponse deleteVotingConfigExclusions(DeleteVotingConfigExclusionsRequest request)
152152
throws IOException, ElasticsearchException {
153153
@SuppressWarnings("unchecked")
154-
JsonEndpoint<DeleteVotingConfigExclusionsRequest, BooleanResponse, ErrorResponse> endpoint = (JsonEndpoint<DeleteVotingConfigExclusionsRequest, BooleanResponse, ErrorResponse>) DeleteVotingConfigExclusionsRequest._ENDPOINT;
154+
Endpoint<DeleteVotingConfigExclusionsRequest, BooleanResponse, ErrorResponse> endpoint = (Endpoint<DeleteVotingConfigExclusionsRequest, BooleanResponse, ErrorResponse>) DeleteVotingConfigExclusionsRequest._ENDPOINT;
155155

156156
return this.transport.performRequest(request, endpoint, this.transportOptions);
157157
}
@@ -199,7 +199,7 @@ public BooleanResponse deleteVotingConfigExclusions() throws IOException, Elasti
199199
public BooleanResponse existsComponentTemplate(ExistsComponentTemplateRequest request)
200200
throws IOException, ElasticsearchException {
201201
@SuppressWarnings("unchecked")
202-
JsonEndpoint<ExistsComponentTemplateRequest, BooleanResponse, ErrorResponse> endpoint = (JsonEndpoint<ExistsComponentTemplateRequest, BooleanResponse, ErrorResponse>) ExistsComponentTemplateRequest._ENDPOINT;
202+
Endpoint<ExistsComponentTemplateRequest, BooleanResponse, ErrorResponse> endpoint = (Endpoint<ExistsComponentTemplateRequest, BooleanResponse, ErrorResponse>) ExistsComponentTemplateRequest._ENDPOINT;
203203

204204
return this.transport.performRequest(request, endpoint, this.transportOptions);
205205
}
@@ -426,7 +426,7 @@ public PendingTasksResponse pendingTasks() throws IOException, ElasticsearchExce
426426
public BooleanResponse postVotingConfigExclusions(PostVotingConfigExclusionsRequest request)
427427
throws IOException, ElasticsearchException {
428428
@SuppressWarnings("unchecked")
429-
JsonEndpoint<PostVotingConfigExclusionsRequest, BooleanResponse, ErrorResponse> endpoint = (JsonEndpoint<PostVotingConfigExclusionsRequest, BooleanResponse, ErrorResponse>) PostVotingConfigExclusionsRequest._ENDPOINT;
429+
Endpoint<PostVotingConfigExclusionsRequest, BooleanResponse, ErrorResponse> endpoint = (Endpoint<PostVotingConfigExclusionsRequest, BooleanResponse, ErrorResponse>) PostVotingConfigExclusionsRequest._ENDPOINT;
430430

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

java-client/src/main/java/co/elastic/clients/elasticsearch/cluster/ExistsComponentTemplateResponse.java

Lines changed: 0 additions & 55 deletions
This file was deleted.

java-client/src/main/java/co/elastic/clients/elasticsearch/cluster/PostVotingConfigExclusionsResponse.java

Lines changed: 0 additions & 55 deletions
This file was deleted.

0 commit comments

Comments
 (0)