Skip to content

Commit f660a7e

Browse files
committed
[codegen] update to latest spec and generator
1 parent db60266 commit f660a7e

File tree

9 files changed

+14
-403
lines changed

9 files changed

+14
-403
lines changed

Diff for: java-client/src/main/java/co/elastic/clients/elasticsearch/_types/query_dsl/FunctionScoreQuery.java

-2
Original file line numberDiff line numberDiff line change
@@ -325,8 +325,6 @@ protected static void setupFunctionScoreQueryDeserializer(ObjectDeserializer<Fun
325325
op.add(Builder::query, Query._DESERIALIZER, "query");
326326
op.add(Builder::scoreMode, FunctionScoreMode._DESERIALIZER, "score_mode");
327327

328-
op.shortcutProperty("functions", true);
329-
330328
}
331329

332330
}

Diff for: java-client/src/main/java/co/elastic/clients/elasticsearch/_types/query_dsl/FuzzyQuery.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -353,7 +353,7 @@ protected static void setupFuzzyQueryDeserializer(ObjectDeserializer<FuzzyQuery.
353353
op.add(Builder::value, FieldValue._DESERIALIZER, "value");
354354

355355
op.setKey(Builder::field, JsonpDeserializer.stringDeserializer());
356-
op.shortcutProperty("value");
356+
op.shortcutProperty("value", true);
357357

358358
}
359359

Diff for: java-client/src/main/java/co/elastic/clients/elasticsearch/_types/query_dsl/MatchQuery.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -563,7 +563,7 @@ protected static void setupMatchQueryDeserializer(ObjectDeserializer<MatchQuery.
563563
op.add(Builder::zeroTermsQuery, ZeroTermsQuery._DESERIALIZER, "zero_terms_query");
564564

565565
op.setKey(Builder::field, JsonpDeserializer.stringDeserializer());
566-
op.shortcutProperty("query");
566+
op.shortcutProperty("query", true);
567567

568568
}
569569

Diff for: java-client/src/main/java/co/elastic/clients/elasticsearch/_types/query_dsl/TermQuery.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -237,7 +237,7 @@ protected static void setupTermQueryDeserializer(ObjectDeserializer<TermQuery.Bu
237237
op.add(Builder::caseInsensitive, JsonpDeserializer.booleanDeserializer(), "case_insensitive");
238238

239239
op.setKey(Builder::field, JsonpDeserializer.stringDeserializer());
240-
op.shortcutProperty("value");
240+
op.shortcutProperty("value", true);
241241

242242
}
243243

Diff for: java-client/src/main/java/co/elastic/clients/elasticsearch/core/search/CompletionContext.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -307,7 +307,7 @@ protected static void setupCompletionContextDeserializer(ObjectDeserializer<Comp
307307
op.add(Builder::precision, GeoHashPrecision._DESERIALIZER, "precision");
308308
op.add(Builder::prefix, JsonpDeserializer.booleanDeserializer(), "prefix");
309309

310-
op.shortcutProperty("context");
310+
op.shortcutProperty("context", true);
311311

312312
}
313313

Diff for: java-client/src/main/java/co/elastic/clients/elasticsearch/doc-files/api-spec.html

+3-4
Original file line numberDiff line numberDiff line change
@@ -1809,9 +1809,8 @@
18091809
'nodes.clear_repositories_metering_archive.Response': 'nodes/clear_repositories_metering_archive/ClearRepositoriesMeteringArchiveResponse.ts#L26-L37',
18101810
'nodes.get_repositories_metering_info.Request': 'nodes/get_repositories_metering_info/GetRepositoriesMeteringInfoRequest.ts#L23-L41',
18111811
'nodes.get_repositories_metering_info.Response': 'nodes/get_repositories_metering_info/GetRepositoriesMeteringInfoResponse.ts#L26-L37',
1812-
'nodes.hot_threads.HotThread': 'nodes/hot_threads/types.ts#L23-L28',
18131812
'nodes.hot_threads.Request': 'nodes/hot_threads/NodesHotThreadsRequest.ts#L25-L81',
1814-
'nodes.hot_threads.Response': 'nodes/hot_threads/NodesHotThreadsResponse.ts#L22-L24',
1813+
'nodes.hot_threads.Response': 'nodes/hot_threads/NodesHotThreadsResponse.ts#L20-L22',
18151814
'nodes.info.DeprecationIndexing': 'nodes/info/types.ts#L140-L142',
18161815
'nodes.info.NodeInfo': 'nodes/info/types.ts#L30-L66',
18171816
'nodes.info.NodeInfoAction': 'nodes/info/types.ts#L177-L179',
@@ -2351,10 +2350,10 @@
23512350
if (hash.length > 1) {
23522351
hash = hash.substring(1);
23532352
}
2354-
window.location = "https://github.com/elastic/elasticsearch-specification/tree/02a7acb1326e163af376a0d154b01dfcdbe94ac7/specification/" + (paths[hash] || "");
2353+
window.location = "https://github.com/elastic/elasticsearch-specification/tree/43e53398502a36eb2b7d1fae305787228fa0a089/specification/" + (paths[hash] || "");
23552354
</script>
23562355
</head>
23572356
<body>
2358-
Please see the <a href="https://github.com/elastic/elasticsearch-specification/tree/02a7acb1326e163af376a0d154b01dfcdbe94ac7/specification/">Elasticsearch API specification</a>.
2357+
Please see the <a href="https://github.com/elastic/elasticsearch-specification/tree/43e53398502a36eb2b7d1fae305787228fa0a089/specification/">Elasticsearch API specification</a>.
23592358
</body>
23602359
</html>

Diff for: java-client/src/main/java/co/elastic/clients/elasticsearch/nodes/HotThreadsResponse.java

+6-126
Original file line numberDiff line numberDiff line change
@@ -19,22 +19,13 @@
1919

2020
package co.elastic.clients.elasticsearch.nodes;
2121

22-
import co.elastic.clients.elasticsearch.nodes.hot_threads.HotThread;
2322
import co.elastic.clients.json.JsonpDeserializable;
2423
import co.elastic.clients.json.JsonpDeserializer;
25-
import co.elastic.clients.json.JsonpMapper;
26-
import co.elastic.clients.json.JsonpSerializable;
27-
import co.elastic.clients.json.JsonpUtils;
2824
import co.elastic.clients.json.ObjectBuilderDeserializer;
2925
import co.elastic.clients.json.ObjectDeserializer;
30-
import co.elastic.clients.util.ApiTypeHelper;
3126
import co.elastic.clients.util.ObjectBuilder;
32-
import co.elastic.clients.util.WithJsonObjectBuilderBase;
3327
import jakarta.json.stream.JsonGenerator;
34-
import java.util.List;
3528
import java.util.Objects;
36-
import java.util.function.Function;
37-
import javax.annotation.Nullable;
3829

3930
//----------------------------------------------------------------
4031
// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST.
@@ -58,128 +49,17 @@
5849
* @see <a href="../doc-files/api-spec.html#nodes.hot_threads.Response">API
5950
* specification</a>
6051
*/
61-
@JsonpDeserializable
62-
public class HotThreadsResponse implements JsonpSerializable {
63-
private final List<HotThread> hotThreads;
6452

65-
// ---------------------------------------------------------------------------------------------
66-
67-
private HotThreadsResponse(Builder builder) {
68-
69-
this.hotThreads = ApiTypeHelper.unmodifiableRequired(builder.hotThreads, this, "hotThreads");
70-
71-
}
72-
73-
public static HotThreadsResponse of(Function<Builder, ObjectBuilder<HotThreadsResponse>> fn) {
74-
return fn.apply(new Builder()).build();
53+
public class HotThreadsResponse {
54+
public HotThreadsResponse() {
7555
}
7656

7757
/**
78-
* Required - API name: {@code hot_threads}
58+
* Singleton instance for {@link HotThreadsResponse}.
7959
*/
80-
public final List<HotThread> hotThreads() {
81-
return this.hotThreads;
82-
}
83-
84-
/**
85-
* Serialize this object to JSON.
86-
*/
87-
public void serialize(JsonGenerator generator, JsonpMapper mapper) {
88-
generator.writeStartObject();
89-
serializeInternal(generator, mapper);
90-
generator.writeEnd();
91-
}
92-
93-
protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) {
94-
95-
if (ApiTypeHelper.isDefined(this.hotThreads)) {
96-
generator.writeKey("hot_threads");
97-
generator.writeStartArray();
98-
for (HotThread item0 : this.hotThreads) {
99-
item0.serialize(generator, mapper);
100-
101-
}
102-
generator.writeEnd();
103-
104-
}
105-
106-
}
107-
108-
@Override
109-
public String toString() {
110-
return JsonpUtils.toString(this);
111-
}
112-
113-
// ---------------------------------------------------------------------------------------------
60+
public static final HotThreadsResponse _INSTANCE = new HotThreadsResponse();
11461

115-
/**
116-
* Builder for {@link HotThreadsResponse}.
117-
*/
118-
119-
public static class Builder extends WithJsonObjectBuilderBase<Builder>
120-
implements
121-
ObjectBuilder<HotThreadsResponse> {
122-
private List<HotThread> hotThreads;
123-
124-
/**
125-
* Required - API name: {@code hot_threads}
126-
* <p>
127-
* Adds all elements of <code>list</code> to <code>hotThreads</code>.
128-
*/
129-
public final Builder hotThreads(List<HotThread> list) {
130-
this.hotThreads = _listAddAll(this.hotThreads, list);
131-
return this;
132-
}
133-
134-
/**
135-
* Required - API name: {@code hot_threads}
136-
* <p>
137-
* Adds one or more values to <code>hotThreads</code>.
138-
*/
139-
public final Builder hotThreads(HotThread value, HotThread... values) {
140-
this.hotThreads = _listAdd(this.hotThreads, value, values);
141-
return this;
142-
}
143-
144-
/**
145-
* Required - API name: {@code hot_threads}
146-
* <p>
147-
* Adds a value to <code>hotThreads</code> using a builder lambda.
148-
*/
149-
public final Builder hotThreads(Function<HotThread.Builder, ObjectBuilder<HotThread>> fn) {
150-
return hotThreads(fn.apply(new HotThread.Builder()).build());
151-
}
152-
153-
@Override
154-
protected Builder self() {
155-
return this;
156-
}
157-
158-
/**
159-
* Builds a {@link HotThreadsResponse}.
160-
*
161-
* @throws NullPointerException
162-
* if some of the required fields are null.
163-
*/
164-
public HotThreadsResponse build() {
165-
_checkSingleUse();
166-
167-
return new HotThreadsResponse(this);
168-
}
169-
}
170-
171-
// ---------------------------------------------------------------------------------------------
172-
173-
/**
174-
* Json deserializer for {@link HotThreadsResponse}
175-
*/
176-
public static final JsonpDeserializer<HotThreadsResponse> _DESERIALIZER = ObjectBuilderDeserializer
177-
.lazy(Builder::new, HotThreadsResponse::setupHotThreadsResponseDeserializer);
178-
179-
protected static void setupHotThreadsResponseDeserializer(ObjectDeserializer<HotThreadsResponse.Builder> op) {
180-
181-
op.add(Builder::hotThreads, JsonpDeserializer.arrayDeserializer(HotThread._DESERIALIZER), "hot_threads");
182-
183-
}
62+
public static final JsonpDeserializer<HotThreadsResponse> _DESERIALIZER = JsonpDeserializer
63+
.emptyObject(HotThreadsResponse._INSTANCE);
18464

18565
}

0 commit comments

Comments
 (0)