Skip to content

Commit 950d2af

Browse files
committed
[codegen] Update to latest API specification
1 parent 40fb890 commit 950d2af

File tree

8 files changed

+67
-111
lines changed

8 files changed

+67
-111
lines changed

java-client/src/main/java/co/elastic/clients/elasticsearch/_types/mapping/PropertyBase.java

Lines changed: 0 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@
2323

2424
package co.elastic.clients.elasticsearch._types.mapping;
2525

26-
import co.elastic.clients.json.JsonData;
2726
import co.elastic.clients.json.JsonpDeserializable;
2827
import co.elastic.clients.json.JsonpDeserializer;
2928
import co.elastic.clients.json.JsonpMapper;
@@ -51,8 +50,6 @@
5150
*/
5251

5352
public abstract class PropertyBase implements JsonpSerializable {
54-
private final Map<String, JsonData> localMetadata;
55-
5653
private final Map<String, String> meta;
5754

5855
private final Map<String, Property> properties;
@@ -69,7 +66,6 @@ public abstract class PropertyBase implements JsonpSerializable {
6966

7067
protected PropertyBase(AbstractBuilder<?> builder) {
7168

72-
this.localMetadata = ApiTypeHelper.unmodifiable(builder.localMetadata);
7369
this.meta = ApiTypeHelper.unmodifiable(builder.meta);
7470
this.properties = ApiTypeHelper.unmodifiable(builder.properties);
7571
this.ignoreAbove = builder.ignoreAbove;
@@ -78,13 +74,6 @@ protected PropertyBase(AbstractBuilder<?> builder) {
7874

7975
}
8076

81-
/**
82-
* API name: {@code local_metadata}
83-
*/
84-
public final Map<String, JsonData> localMetadata() {
85-
return this.localMetadata;
86-
}
87-
8877
/**
8978
* Metadata about the field.
9079
* <p>
@@ -135,17 +124,6 @@ public void serialize(JsonGenerator generator, JsonpMapper mapper) {
135124

136125
protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) {
137126

138-
if (ApiTypeHelper.isDefined(this.localMetadata)) {
139-
generator.writeKey("local_metadata");
140-
generator.writeStartObject();
141-
for (Map.Entry<String, JsonData> item0 : this.localMetadata.entrySet()) {
142-
generator.writeKey(item0.getKey());
143-
item0.getValue().serialize(generator, mapper);
144-
145-
}
146-
generator.writeEnd();
147-
148-
}
149127
if (ApiTypeHelper.isDefined(this.meta)) {
150128
generator.writeKey("meta");
151129
generator.writeStartObject();
@@ -199,9 +177,6 @@ public String toString() {
199177
protected abstract static class AbstractBuilder<BuilderT extends AbstractBuilder<BuilderT>>
200178
extends
201179
WithJsonObjectBuilderBase<BuilderT> {
202-
@Nullable
203-
private Map<String, JsonData> localMetadata;
204-
205180
@Nullable
206181
private Map<String, String> meta;
207182

@@ -217,26 +192,6 @@ protected abstract static class AbstractBuilder<BuilderT extends AbstractBuilder
217192
@Nullable
218193
private Map<String, Property> fields;
219194

220-
/**
221-
* API name: {@code local_metadata}
222-
* <p>
223-
* Adds all entries of <code>map</code> to <code>localMetadata</code>.
224-
*/
225-
public final BuilderT localMetadata(Map<String, JsonData> map) {
226-
this.localMetadata = _mapPutAll(this.localMetadata, map);
227-
return self();
228-
}
229-
230-
/**
231-
* API name: {@code local_metadata}
232-
* <p>
233-
* Adds an entry to <code>localMetadata</code>.
234-
*/
235-
public final BuilderT localMetadata(String key, JsonData value) {
236-
this.localMetadata = _mapPut(this.localMetadata, key, value);
237-
return self();
238-
}
239-
240195
/**
241196
* Metadata about the field.
242197
* <p>
@@ -343,8 +298,6 @@ public final BuilderT fields(String key, Function<Property.Builder, ObjectBuilde
343298
protected static <BuilderT extends AbstractBuilder<BuilderT>> void setupPropertyBaseDeserializer(
344299
ObjectDeserializer<BuilderT> op) {
345300

346-
op.add(AbstractBuilder::localMetadata, JsonpDeserializer.stringMapDeserializer(JsonData._DESERIALIZER),
347-
"local_metadata");
348301
op.add(AbstractBuilder::meta, JsonpDeserializer.stringMapDeserializer(JsonpDeserializer.stringDeserializer()),
349302
"meta");
350303
op.add(AbstractBuilder::properties, JsonpDeserializer.stringMapDeserializer(Property._DESERIALIZER),

java-client/src/main/java/co/elastic/clients/elasticsearch/cat/IndicesRequest.java

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
2727
import co.elastic.clients.elasticsearch._types.ErrorResponse;
2828
import co.elastic.clients.elasticsearch._types.ExpandWildcard;
2929
import co.elastic.clients.elasticsearch._types.HealthStatus;
30+
import co.elastic.clients.elasticsearch._types.TimeUnit;
3031
import co.elastic.clients.json.JsonpDeserializable;
3132
import co.elastic.clients.json.JsonpDeserializer;
3233
import co.elastic.clients.json.ObjectBuilderDeserializer;
@@ -73,6 +74,9 @@ public class IndicesRequest extends CatRequestBase {
7374
@Nullable
7475
private final Boolean pri;
7576

77+
@Nullable
78+
private final TimeUnit time;
79+
7680
// ---------------------------------------------------------------------------------------------
7781

7882
private IndicesRequest(Builder builder) {
@@ -83,6 +87,7 @@ private IndicesRequest(Builder builder) {
8387
this.includeUnloadedSegments = builder.includeUnloadedSegments;
8488
this.index = ApiTypeHelper.unmodifiable(builder.index);
8589
this.pri = builder.pri;
90+
this.time = builder.time;
8691

8792
}
8893

@@ -151,6 +156,16 @@ public final Boolean pri() {
151156
return this.pri;
152157
}
153158

159+
/**
160+
* The unit in which to display time values
161+
* <p>
162+
* API name: {@code time}
163+
*/
164+
@Nullable
165+
public final TimeUnit time() {
166+
return this.time;
167+
}
168+
154169
// ---------------------------------------------------------------------------------------------
155170

156171
/**
@@ -178,6 +193,9 @@ public static class Builder extends CatRequestBase.AbstractBuilder<Builder>
178193
@Nullable
179194
private Boolean pri;
180195

196+
@Nullable
197+
private TimeUnit time;
198+
181199
/**
182200
* The unit in which to display byte values
183201
* <p>
@@ -270,6 +288,16 @@ public final Builder pri(@Nullable Boolean value) {
270288
return this;
271289
}
272290

291+
/**
292+
* The unit in which to display time values
293+
* <p>
294+
* API name: {@code time}
295+
*/
296+
public final Builder time(@Nullable TimeUnit value) {
297+
this.time = value;
298+
return this;
299+
}
300+
273301
@Override
274302
protected Builder self() {
275303
return this;
@@ -349,6 +377,9 @@ public IndicesRequest build() {
349377
if (request.includeUnloadedSegments != null) {
350378
params.put("include_unloaded_segments", String.valueOf(request.includeUnloadedSegments));
351379
}
380+
if (request.time != null) {
381+
params.put("time", request.time.jsonValue());
382+
}
352383
return params;
353384

354385
}, SimpleEndpoint.emptyMap(), false, IndicesResponse._DESERIALIZER);

java-client/src/main/java/co/elastic/clients/elasticsearch/core/RankEvalRequest.java

Lines changed: 16 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ private RankEvalRequest(Builder builder) {
8585
this.allowNoIndices = builder.allowNoIndices;
8686
this.expandWildcards = ApiTypeHelper.unmodifiable(builder.expandWildcards);
8787
this.ignoreUnavailable = builder.ignoreUnavailable;
88-
this.index = ApiTypeHelper.unmodifiableRequired(builder.index, this, "index");
88+
this.index = ApiTypeHelper.unmodifiable(builder.index);
8989
this.metric = builder.metric;
9090
this.requests = ApiTypeHelper.unmodifiableRequired(builder.requests, this, "requests");
9191
this.searchType = builder.searchType;
@@ -133,10 +133,10 @@ public final Boolean ignoreUnavailable() {
133133
}
134134

135135
/**
136-
* Required - Comma-separated list of data streams, indices, and index aliases
137-
* used to limit the request. Wildcard (<code>*</code>) expressions are
138-
* supported. To target all data streams and indices in a cluster, omit this
139-
* parameter or use <code>_all</code> or <code>*</code>.
136+
* Comma-separated list of data streams, indices, and index aliases used to
137+
* limit the request. Wildcard (<code>*</code>) expressions are supported. To
138+
* target all data streams and indices in a cluster, omit this parameter or use
139+
* <code>_all</code> or <code>*</code>.
140140
* <p>
141141
* API name: {@code index}
142142
*/
@@ -219,6 +219,7 @@ public static class Builder extends RequestBase.AbstractBuilder<Builder> impleme
219219
@Nullable
220220
private Boolean ignoreUnavailable;
221221

222+
@Nullable
222223
private List<String> index;
223224

224225
@Nullable
@@ -282,10 +283,10 @@ public final Builder ignoreUnavailable(@Nullable Boolean value) {
282283
}
283284

284285
/**
285-
* Required - Comma-separated list of data streams, indices, and index aliases
286-
* used to limit the request. Wildcard (<code>*</code>) expressions are
287-
* supported. To target all data streams and indices in a cluster, omit this
288-
* parameter or use <code>_all</code> or <code>*</code>.
286+
* Comma-separated list of data streams, indices, and index aliases used to
287+
* limit the request. Wildcard (<code>*</code>) expressions are supported. To
288+
* target all data streams and indices in a cluster, omit this parameter or use
289+
* <code>_all</code> or <code>*</code>.
289290
* <p>
290291
* API name: {@code index}
291292
* <p>
@@ -297,10 +298,10 @@ public final Builder index(List<String> list) {
297298
}
298299

299300
/**
300-
* Required - Comma-separated list of data streams, indices, and index aliases
301-
* used to limit the request. Wildcard (<code>*</code>) expressions are
302-
* supported. To target all data streams and indices in a cluster, omit this
303-
* parameter or use <code>_all</code> or <code>*</code>.
301+
* Comma-separated list of data streams, indices, and index aliases used to
302+
* limit the request. Wildcard (<code>*</code>) expressions are supported. To
303+
* target all data streams and indices in a cluster, omit this parameter or use
304+
* <code>_all</code> or <code>*</code>.
304305
* <p>
305306
* API name: {@code index}
306307
* <p>
@@ -431,7 +432,8 @@ protected static void setupRankEvalRequestDeserializer(ObjectDeserializer<RankEv
431432

432433
int propsSet = 0;
433434

434-
propsSet |= _index;
435+
if (ApiTypeHelper.isDefined(request.index()))
436+
propsSet |= _index;
435437

436438
if (propsSet == 0) {
437439
StringBuilder buf = new StringBuilder();

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

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -695,7 +695,7 @@
695695
'_types.mapping.FieldAliasProperty': '_types/mapping/specialized.ts#L49-L52',
696696
'_types.mapping.FieldMapping': '_types/mapping/meta-fields.ts#L24-L27',
697697
'_types.mapping.FieldNamesField': '_types/mapping/meta-fields.ts#L42-L44',
698-
'_types.mapping.FieldType': '_types/mapping/Property.ts#L159-L202',
698+
'_types.mapping.FieldType': '_types/mapping/Property.ts#L158-L201',
699699
'_types.mapping.FlattenedProperty': '_types/mapping/complex.ts#L26-L37',
700700
'_types.mapping.FloatNumberProperty': '_types/mapping/core.ts#L131-L134',
701701
'_types.mapping.FloatRangeProperty': '_types/mapping/range.ts#L38-L40',
@@ -724,8 +724,8 @@
724724
'_types.mapping.OnScriptError': '_types/mapping/core.ts#L126-L129',
725725
'_types.mapping.PercolatorProperty': '_types/mapping/core.ts#L177-L179',
726726
'_types.mapping.PointProperty': '_types/mapping/geo.ts#L62-L67',
727-
'_types.mapping.Property': '_types/mapping/Property.ts#L94-L157',
728-
'_types.mapping.PropertyBase': '_types/mapping/Property.ts#L81-L92',
727+
'_types.mapping.Property': '_types/mapping/Property.ts#L93-L156',
728+
'_types.mapping.PropertyBase': '_types/mapping/Property.ts#L81-L91',
729729
'_types.mapping.RangePropertyBase': '_types/mapping/range.ts#L23-L27',
730730
'_types.mapping.RankFeatureProperty': '_types/mapping/core.ts#L181-L184',
731731
'_types.mapping.RankFeaturesProperty': '_types/mapping/core.ts#L186-L188',
@@ -906,7 +906,7 @@
906906
'cat.help.Request': 'cat/help/CatHelpRequest.ts#L22-L28',
907907
'cat.help.Response': 'cat/help/CatHelpResponse.ts#L22-L24',
908908
'cat.indices.IndicesRecord': 'cat/indices/types.ts#L20-L801',
909-
'cat.indices.Request': 'cat/indices/CatIndicesRequest.ts#L23-L40',
909+
'cat.indices.Request': 'cat/indices/CatIndicesRequest.ts#L24-L42',
910910
'cat.indices.Response': 'cat/indices/CatIndicesResponse.ts#L22-L24',
911911
'cat.master.MasterRecord': 'cat/master/types.ts#L20-L39',
912912
'cat.master.Request': 'cat/master/CatMasterRequest.ts#L22-L28',
@@ -2522,10 +2522,10 @@
25222522
if (hash.length > 1) {
25232523
hash = hash.substring(1);
25242524
}
2525-
window.location = "https://github.com/elastic/elasticsearch-specification/tree/5d3e3a096596aeb750b2c33947ff54dcbc8ba6a4/specification/" + (paths[hash] || "");
2525+
window.location = "https://github.com/elastic/elasticsearch-specification/tree/555082f38110f65b60d470107d211fc354a5c55a/specification/" + (paths[hash] || "");
25262526
</script>
25272527
</head>
25282528
<body>
2529-
Please see the <a href="https://github.com/elastic/elasticsearch-specification/tree/5d3e3a096596aeb750b2c33947ff54dcbc8ba6a4/specification/">Elasticsearch API specification</a>.
2529+
Please see the <a href="https://github.com/elastic/elasticsearch-specification/tree/555082f38110f65b60d470107d211fc354a5c55a/specification/">Elasticsearch API specification</a>.
25302530
</body>
25312531
</html>

java-client/src/main/java/co/elastic/clients/elasticsearch/ilm/ExplainLifecycleRequest.java

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,9 @@ public final Time masterTimeout() {
109109
}
110110

111111
/**
112-
* Filters the returned indices to only indices that are managed by ILM.
112+
* Filters the returned indices to only indices that are managed by ILM and are
113+
* in an error state, either due to an encountering an error while executing the
114+
* policy, or attempting to use a policy that does not exist.
113115
* <p>
114116
* API name: {@code only_errors}
115117
*/
@@ -119,9 +121,7 @@ public final Boolean onlyErrors() {
119121
}
120122

121123
/**
122-
* Filters the returned indices to only indices that are managed by ILM and are
123-
* in an error state, either due to an encountering an error while executing the
124-
* policy, or attempting to use a policy that does not exist.
124+
* Filters the returned indices to only indices that are managed by ILM.
125125
* <p>
126126
* API name: {@code only_managed}
127127
*/
@@ -198,7 +198,9 @@ public final Builder masterTimeout(Function<Time.Builder, ObjectBuilder<Time>> f
198198
}
199199

200200
/**
201-
* Filters the returned indices to only indices that are managed by ILM.
201+
* Filters the returned indices to only indices that are managed by ILM and are
202+
* in an error state, either due to an encountering an error while executing the
203+
* policy, or attempting to use a policy that does not exist.
202204
* <p>
203205
* API name: {@code only_errors}
204206
*/
@@ -208,9 +210,7 @@ public final Builder onlyErrors(@Nullable Boolean value) {
208210
}
209211

210212
/**
211-
* Filters the returned indices to only indices that are managed by ILM and are
212-
* in an error state, either due to an encountering an error while executing the
213-
* policy, or attempting to use a policy that does not exist.
213+
* Filters the returned indices to only indices that are managed by ILM.
214214
* <p>
215215
* API name: {@code only_managed}
216216
*/

0 commit comments

Comments
 (0)