Skip to content

Commit 2a6b749

Browse files
authored
Merge branch 'main' into json-docs
2 parents a885844 + c027cda commit 2a6b749

File tree

150 files changed

+13557
-935
lines changed

Some content is hidden

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

150 files changed

+13557
-935
lines changed

.ci/make.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -196,8 +196,8 @@ if [[ "$CMD" == "release" ]]; then
196196
echo "Dry run: building and publishing to the local repository"
197197
gradle_task="publishForReleaseManager"
198198
else
199-
echo "Releasing to Maven snapshot repo"
200-
gradle_task="publishToSonatype closeAndReleaseStagingRepositories"
199+
echo "Releasing to Maven repo"
200+
gradle_task="publishForMavenCentral"
201201
fi
202202
docker run --rm --env VERSION=$VERSION -u "$(id -u)" \
203203
$git_mount $src_mount $output_mount \

README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,10 @@ compatible with default distributions and without guarantees made.
5858
| 9.x | 9.x | 9.x |
5959
| 8.x | 8.x | 8.17 |
6060

61+
Java client releases are synchronized with the Elasticsearch server for major and minor versions,
62+
while patches are released independently, to allow for faster bugfixes. This does not affect compatibility:
63+
for example, version 8.13.x of the client will be compatible with versions of the server 8.13.y where y >= x.
64+
6165
## Usage
6266

6367
- [Creating an index](https://www.elastic.co/guide/en/elasticsearch/client/java-api-client/current/getting-started-java.html#_creating_an_index)

build.gradle.kts

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,40 @@ tasks.register<Task>(name = "resolveDependencies") {
8585
}
8686
}
8787

88+
// gradle tasks --all to check tasks in subprojects
89+
tasks.register<Task>(name = "publishForMavenCentral") {
90+
group = "Publishing"
91+
description = "Publishes artifacts to Maven Central"
92+
dependsOn(
93+
":java-client:publishAllPublicationsToBuildRepository",
94+
":java-client:generateLicenseReport",
95+
":java-client:publishToSonatype",
96+
"closeAndReleaseStagingRepositories",
97+
)
98+
doLast {
99+
val version = this.project.version.toString()
100+
println("Releasing version $version")
101+
102+
val releaseDir = File(rootProject.layout.buildDirectory.get().asFile, "release")
103+
releaseDir.mkdirs()
104+
105+
File(rootProject.layout.buildDirectory.get().asFile, "repository/co/elastic/clients").listFiles()?.forEach { artifact ->
106+
println("Releasing artifact " + artifact.name)
107+
108+
val versionDir = File(artifact, version)
109+
110+
versionDir.listFiles()?.forEach { file ->
111+
if (file.name.endsWith(".jar") || file.name.endsWith(".pom")) {
112+
var name = file.name
113+
114+
file.copyTo(File(releaseDir, name), overwrite = true)
115+
}
116+
}
117+
}
118+
}
119+
}
120+
121+
// TODO delete
88122
tasks.register<Task>(name = "publishForReleaseManager") {
89123
group = "Publishing"
90124
description = "Publishes artifacts in a format suitable for the Elastic release manager"

docs/reference/index.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,3 +29,4 @@ The {{es}} Java client is forward compatible; meaning that the client supports c
2929
| 9.x | 9.x | 9.x |
3030
| 8.x | 8.x | 8.17 |
3131

32+
Java client releases are synchronized with the Elasticsearch server for major and minor versions, while patches are released independently, to allow for faster bugfixes. This does not affect compatibility: for example, version 8.13.x of the client will be compatible with versions of the server 8.13.y where y >= x.

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

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -126,6 +126,7 @@
126126
import co.elastic.clients.elasticsearch.ml.ElasticsearchMlAsyncClient;
127127
import co.elastic.clients.elasticsearch.monitoring.ElasticsearchMonitoringAsyncClient;
128128
import co.elastic.clients.elasticsearch.nodes.ElasticsearchNodesAsyncClient;
129+
import co.elastic.clients.elasticsearch.project.ElasticsearchProjectAsyncClient;
129130
import co.elastic.clients.elasticsearch.query_rules.ElasticsearchQueryRulesAsyncClient;
130131
import co.elastic.clients.elasticsearch.rollup.ElasticsearchRollupAsyncClient;
131132
import co.elastic.clients.elasticsearch.search_application.ElasticsearchSearchApplicationAsyncClient;
@@ -137,6 +138,7 @@
137138
import co.elastic.clients.elasticsearch.snapshot.ElasticsearchSnapshotAsyncClient;
138139
import co.elastic.clients.elasticsearch.sql.ElasticsearchSqlAsyncClient;
139140
import co.elastic.clients.elasticsearch.ssl.ElasticsearchSslAsyncClient;
141+
import co.elastic.clients.elasticsearch.streams.ElasticsearchStreamsAsyncClient;
140142
import co.elastic.clients.elasticsearch.synonyms.ElasticsearchSynonymsAsyncClient;
141143
import co.elastic.clients.elasticsearch.tasks.ElasticsearchTasksAsyncClient;
142144
import co.elastic.clients.elasticsearch.text_structure.ElasticsearchTextStructureAsyncClient;
@@ -302,6 +304,10 @@ public ElasticsearchNodesAsyncClient nodes() {
302304
return new ElasticsearchNodesAsyncClient(this.transport, this.transportOptions);
303305
}
304306

307+
public ElasticsearchProjectAsyncClient project() {
308+
return new ElasticsearchProjectAsyncClient(this.transport, this.transportOptions);
309+
}
310+
305311
public ElasticsearchQueryRulesAsyncClient queryRules() {
306312
return new ElasticsearchQueryRulesAsyncClient(this.transport, this.transportOptions);
307313
}
@@ -346,6 +352,10 @@ public ElasticsearchSslAsyncClient ssl() {
346352
return new ElasticsearchSslAsyncClient(this.transport, this.transportOptions);
347353
}
348354

355+
public ElasticsearchStreamsAsyncClient streams() {
356+
return new ElasticsearchStreamsAsyncClient(this.transport, this.transportOptions);
357+
}
358+
349359
public ElasticsearchSynonymsAsyncClient synonyms() {
350360
return new ElasticsearchSynonymsAsyncClient(this.transport, this.transportOptions);
351361
}

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

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,7 @@
127127
import co.elastic.clients.elasticsearch.ml.ElasticsearchMlClient;
128128
import co.elastic.clients.elasticsearch.monitoring.ElasticsearchMonitoringClient;
129129
import co.elastic.clients.elasticsearch.nodes.ElasticsearchNodesClient;
130+
import co.elastic.clients.elasticsearch.project.ElasticsearchProjectClient;
130131
import co.elastic.clients.elasticsearch.query_rules.ElasticsearchQueryRulesClient;
131132
import co.elastic.clients.elasticsearch.rollup.ElasticsearchRollupClient;
132133
import co.elastic.clients.elasticsearch.search_application.ElasticsearchSearchApplicationClient;
@@ -138,6 +139,7 @@
138139
import co.elastic.clients.elasticsearch.snapshot.ElasticsearchSnapshotClient;
139140
import co.elastic.clients.elasticsearch.sql.ElasticsearchSqlClient;
140141
import co.elastic.clients.elasticsearch.ssl.ElasticsearchSslClient;
142+
import co.elastic.clients.elasticsearch.streams.ElasticsearchStreamsClient;
141143
import co.elastic.clients.elasticsearch.synonyms.ElasticsearchSynonymsClient;
142144
import co.elastic.clients.elasticsearch.tasks.ElasticsearchTasksClient;
143145
import co.elastic.clients.elasticsearch.text_structure.ElasticsearchTextStructureClient;
@@ -302,6 +304,10 @@ public ElasticsearchNodesClient nodes() {
302304
return new ElasticsearchNodesClient(this.transport, this.transportOptions);
303305
}
304306

307+
public ElasticsearchProjectClient project() {
308+
return new ElasticsearchProjectClient(this.transport, this.transportOptions);
309+
}
310+
305311
public ElasticsearchQueryRulesClient queryRules() {
306312
return new ElasticsearchQueryRulesClient(this.transport, this.transportOptions);
307313
}
@@ -346,6 +352,10 @@ public ElasticsearchSslClient ssl() {
346352
return new ElasticsearchSslClient(this.transport, this.transportOptions);
347353
}
348354

355+
public ElasticsearchStreamsClient streams() {
356+
return new ElasticsearchStreamsClient(this.transport, this.transportOptions);
357+
}
358+
349359
public ElasticsearchSynonymsClient synonyms() {
350360
return new ElasticsearchSynonymsClient(this.transport, this.transportOptions);
351361
}
Lines changed: 176 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,176 @@
1+
/*
2+
* Licensed to Elasticsearch B.V. under one or more contributor
3+
* license agreements. See the NOTICE file distributed with
4+
* this work for additional information regarding copyright
5+
* ownership. Elasticsearch B.V. licenses this file to you under
6+
* the Apache License, Version 2.0 (the "License"); you may
7+
* not use this file except in compliance with the License.
8+
* You may obtain a copy of the License at
9+
*
10+
* http://www.apache.org/licenses/LICENSE-2.0
11+
*
12+
* Unless required by applicable law or agreed to in writing,
13+
* software distributed under the License is distributed on an
14+
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15+
* KIND, either express or implied. See the License for the
16+
* specific language governing permissions and limitations
17+
* under the License.
18+
*/
19+
20+
package co.elastic.clients.elasticsearch._types;
21+
22+
import co.elastic.clients.json.JsonpDeserializable;
23+
import co.elastic.clients.json.JsonpDeserializer;
24+
import co.elastic.clients.json.JsonpMapper;
25+
import co.elastic.clients.json.JsonpSerializable;
26+
import co.elastic.clients.json.JsonpUtils;
27+
import co.elastic.clients.json.ObjectBuilderDeserializer;
28+
import co.elastic.clients.json.ObjectDeserializer;
29+
import co.elastic.clients.util.ApiTypeHelper;
30+
import co.elastic.clients.util.ObjectBuilder;
31+
import co.elastic.clients.util.WithJsonObjectBuilderBase;
32+
import jakarta.json.stream.JsonGenerator;
33+
import java.lang.Double;
34+
import java.util.Objects;
35+
import java.util.function.Function;
36+
37+
//----------------------------------------------------------------
38+
// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST.
39+
//----------------------------------------------------------------
40+
//
41+
// This code is generated from the Elasticsearch API specification
42+
// at https://github.com/elastic/elasticsearch-specification
43+
//
44+
// Manual updates to this file will be lost when the code is
45+
// re-generated.
46+
//
47+
// If you find a property that is missing or wrongly typed, please
48+
// open an issue or a PR on the API specification repository.
49+
//
50+
//----------------------------------------------------------------
51+
52+
// typedef: _types.CartesianPoint
53+
54+
/**
55+
*
56+
* @see <a href="../doc-files/api-spec.html#_types.CartesianPoint">API
57+
* specification</a>
58+
*/
59+
@JsonpDeserializable
60+
public class CartesianPoint implements JsonpSerializable {
61+
private final double x;
62+
63+
private final double y;
64+
65+
// ---------------------------------------------------------------------------------------------
66+
67+
private CartesianPoint(Builder builder) {
68+
69+
this.x = ApiTypeHelper.requireNonNull(builder.x, this, "x", 0);
70+
this.y = ApiTypeHelper.requireNonNull(builder.y, this, "y", 0);
71+
72+
}
73+
74+
public static CartesianPoint of(Function<Builder, ObjectBuilder<CartesianPoint>> fn) {
75+
return fn.apply(new Builder()).build();
76+
}
77+
78+
/**
79+
* Required - API name: {@code x}
80+
*/
81+
public final double x() {
82+
return this.x;
83+
}
84+
85+
/**
86+
* Required - API name: {@code y}
87+
*/
88+
public final double y() {
89+
return this.y;
90+
}
91+
92+
/**
93+
* Serialize this object to JSON.
94+
*/
95+
public void serialize(JsonGenerator generator, JsonpMapper mapper) {
96+
generator.writeStartObject();
97+
serializeInternal(generator, mapper);
98+
generator.writeEnd();
99+
}
100+
101+
protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) {
102+
103+
generator.writeKey("x");
104+
generator.write(this.x);
105+
106+
generator.writeKey("y");
107+
generator.write(this.y);
108+
109+
}
110+
111+
@Override
112+
public String toString() {
113+
return JsonpUtils.toString(this);
114+
}
115+
116+
// ---------------------------------------------------------------------------------------------
117+
118+
/**
119+
* Builder for {@link CartesianPoint}.
120+
*/
121+
122+
public static class Builder extends WithJsonObjectBuilderBase<Builder> implements ObjectBuilder<CartesianPoint> {
123+
private Double x;
124+
125+
private Double y;
126+
127+
/**
128+
* Required - API name: {@code x}
129+
*/
130+
public final Builder x(double value) {
131+
this.x = value;
132+
return this;
133+
}
134+
135+
/**
136+
* Required - API name: {@code y}
137+
*/
138+
public final Builder y(double value) {
139+
this.y = value;
140+
return this;
141+
}
142+
143+
@Override
144+
protected Builder self() {
145+
return this;
146+
}
147+
148+
/**
149+
* Builds a {@link CartesianPoint}.
150+
*
151+
* @throws NullPointerException
152+
* if some of the required fields are null.
153+
*/
154+
public CartesianPoint build() {
155+
_checkSingleUse();
156+
157+
return new CartesianPoint(this);
158+
}
159+
}
160+
161+
// ---------------------------------------------------------------------------------------------
162+
163+
/**
164+
* Json deserializer for {@link CartesianPoint}
165+
*/
166+
public static final JsonpDeserializer<CartesianPoint> _DESERIALIZER = ObjectBuilderDeserializer.lazy(Builder::new,
167+
CartesianPoint::setupCartesianPointDeserializer);
168+
169+
protected static void setupCartesianPointDeserializer(ObjectDeserializer<CartesianPoint.Builder> op) {
170+
171+
op.add(Builder::x, JsonpDeserializer.doubleDeserializer(), "x");
172+
op.add(Builder::y, JsonpDeserializer.doubleDeserializer(), "y");
173+
174+
}
175+
176+
}

0 commit comments

Comments
 (0)