Skip to content

Commit 0a1f748

Browse files
committed
[codegen] update to latest spec
1 parent f13590d commit 0a1f748

9 files changed

Lines changed: 247 additions & 25 deletions

File tree

java-client/src/main/java/co/elastic/clients/elasticsearch/_types/aggregations/FieldDateMath.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232
import co.elastic.clients.util.TaggedUnion;
3333
import co.elastic.clients.util.TaggedUnionUtils;
3434
import jakarta.json.stream.JsonGenerator;
35-
import java.lang.Double;
35+
import java.lang.Long;
3636
import java.lang.Object;
3737
import java.lang.String;
3838
import java.util.Objects;
@@ -143,7 +143,7 @@ public boolean isValue() {
143143
* @throws IllegalStateException
144144
* if the current variant is not of the {@code value} kind.
145145
*/
146-
public Double value() {
146+
public Long value() {
147147
return TaggedUnionUtils.get(this, Kind.Value);
148148
}
149149

@@ -158,7 +158,7 @@ public void serialize(JsonGenerator generator, JsonpMapper mapper) {
158158

159159
break;
160160
case Value :
161-
generator.write(((Double) this._value));
161+
generator.write(((Long) this._value));
162162

163163
break;
164164
}
@@ -181,7 +181,7 @@ public ObjectBuilder<FieldDateMath> expr(String v) {
181181
return this;
182182
}
183183

184-
public ObjectBuilder<FieldDateMath> value(Double v) {
184+
public ObjectBuilder<FieldDateMath> value(Long v) {
185185
this._kind = Kind.Value;
186186
this._value = v;
187187
return this;
@@ -197,7 +197,7 @@ public FieldDateMath build() {
197197
private static JsonpDeserializer<FieldDateMath> buildFieldDateMathDeserializer() {
198198
return new UnionDeserializer.Builder<FieldDateMath, Kind, Object>(FieldDateMath::new, false)
199199
.addMember(Kind.Expr, JsonpDeserializer.stringDeserializer())
200-
.addMember(Kind.Value, JsonpDeserializer.doubleDeserializer()).build();
200+
.addMember(Kind.Value, JsonpDeserializer.longDeserializer()).build();
201201
}
202202

203203
public static final JsonpDeserializer<FieldDateMath> _DESERIALIZER = JsonpDeserializer

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,8 @@ public enum FieldType implements JsonEnum {
6161

6262
SearchAsYouType("search_as_you_type"),
6363

64+
Wildcard("wildcard"),
65+
6466
Date("date"),
6567

6668
DateNanos("date_nanos"),
Lines changed: 164 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,164 @@
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.query_dsl;
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.ObjectBuilderDeserializer;
26+
import co.elastic.clients.json.ObjectDeserializer;
27+
import co.elastic.clients.util.ApiTypeHelper;
28+
import co.elastic.clients.util.ObjectBuilder;
29+
import jakarta.json.stream.JsonGenerator;
30+
import java.lang.Long;
31+
import java.lang.String;
32+
import java.util.Objects;
33+
import java.util.function.Function;
34+
import javax.annotation.Nullable;
35+
36+
//----------------------------------------------------------------
37+
// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST.
38+
//----------------------------------------------------------------
39+
//
40+
// This code is generated from the Elasticsearch API specification
41+
// at https://github.com/elastic/elasticsearch-specification
42+
//
43+
// Manual updates to this file will be lost when the code is
44+
// re-generated.
45+
//
46+
// If you find a property that is missing or wrongly typed, please
47+
// open an issue or a PR on the API specification repository.
48+
//
49+
//----------------------------------------------------------------
50+
51+
// typedef: _types.query_dsl.LongNumberRangeQuery
52+
53+
/**
54+
*
55+
* @see <a href=
56+
* "../../doc-files/api-spec.html#_types.query_dsl.LongNumberRangeQuery">API
57+
* specification</a>
58+
*/
59+
@JsonpDeserializable
60+
public class LongNumberRangeQuery extends RangeQueryBase<Long> implements RangeQueryVariant {
61+
// Single key dictionary
62+
private final String field;
63+
64+
// ---------------------------------------------------------------------------------------------
65+
66+
private LongNumberRangeQuery(Builder builder) {
67+
super(builder);
68+
this.field = ApiTypeHelper.requireNonNull(builder.field, this, "field");
69+
70+
}
71+
72+
public static LongNumberRangeQuery of(Function<Builder, ObjectBuilder<LongNumberRangeQuery>> fn) {
73+
return fn.apply(new Builder()).build();
74+
}
75+
76+
/**
77+
* RangeQuery variant kind.
78+
*/
79+
@Override
80+
public RangeQuery.Kind _rangeQueryKind() {
81+
return RangeQuery.Kind.LongNumber;
82+
}
83+
84+
/**
85+
* Required - the required field
86+
*/
87+
public final String field() {
88+
return this.field;
89+
}
90+
91+
protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) {
92+
generator.writeStartObject(this.field);
93+
94+
super.serializeInternal(generator, mapper);
95+
96+
generator.writeEnd();
97+
98+
}
99+
100+
// ---------------------------------------------------------------------------------------------
101+
102+
/**
103+
* Builder for {@link LongNumberRangeQuery}.
104+
*/
105+
106+
public static class Builder extends RangeQueryBase.AbstractBuilder<Long, Builder>
107+
implements
108+
ObjectBuilder<LongNumberRangeQuery> {
109+
private String field;
110+
111+
/**
112+
* Required - the required field
113+
*/
114+
public final Builder field(String value) {
115+
this.field = value;
116+
return this;
117+
}
118+
119+
public Builder() {
120+
}
121+
private Builder(LongNumberRangeQuery instance) {
122+
123+
}
124+
@Override
125+
protected Builder self() {
126+
return this;
127+
}
128+
129+
/**
130+
* Builds a {@link LongNumberRangeQuery}.
131+
*
132+
* @throws NullPointerException
133+
* if some of the required fields are null.
134+
*/
135+
public LongNumberRangeQuery build() {
136+
_checkSingleUse();
137+
super.tSerializer(null);
138+
139+
return new LongNumberRangeQuery(this);
140+
}
141+
}
142+
143+
/**
144+
* @return New {@link Builder} initialized with field values of this instance
145+
*/
146+
public Builder rebuild() {
147+
return new Builder(this);
148+
}
149+
// ---------------------------------------------------------------------------------------------
150+
151+
/**
152+
* Json deserializer for {@link LongNumberRangeQuery}
153+
*/
154+
public static final JsonpDeserializer<LongNumberRangeQuery> _DESERIALIZER = ObjectBuilderDeserializer
155+
.lazy(Builder::new, LongNumberRangeQuery::setupLongNumberRangeQueryDeserializer);
156+
157+
protected static void setupLongNumberRangeQueryDeserializer(ObjectDeserializer<LongNumberRangeQuery.Builder> op) {
158+
RangeQueryBase.setupRangeQueryBaseDeserializer(op, JsonpDeserializer.longDeserializer());
159+
160+
op.setKey(Builder::field, JsonpDeserializer.stringDeserializer());
161+
162+
}
163+
164+
}

java-client/src/main/java/co/elastic/clients/elasticsearch/_types/query_dsl/RangeQuery.java

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,8 @@ public class RangeQuery
8585
public enum Kind implements JsonEnum {
8686
Date("date"),
8787

88+
LongNumber("long_number"),
89+
8890
Number("number"),
8991

9092
Term("term"),
@@ -190,6 +192,23 @@ public DateRangeQuery date() {
190192
return TaggedUnionUtils.get(this, Kind.Date);
191193
}
192194

195+
/**
196+
* Is this variant instance of kind {@code long_number}?
197+
*/
198+
public boolean isLongNumber() {
199+
return _kind == Kind.LongNumber;
200+
}
201+
202+
/**
203+
* Get the {@code long_number} variant value.
204+
*
205+
* @throws IllegalStateException
206+
* if the current variant is not of the {@code long_number} kind.
207+
*/
208+
public LongNumberRangeQuery longNumber() {
209+
return TaggedUnionUtils.get(this, Kind.LongNumber);
210+
}
211+
193212
/**
194213
* Is this variant instance of kind {@code number}?
195214
*/
@@ -267,6 +286,17 @@ public ObjectBuilder<RangeQuery> date(Function<DateRangeQuery.Builder, ObjectBui
267286
return this.date(fn.apply(new DateRangeQuery.Builder()).build());
268287
}
269288

289+
public ObjectBuilder<RangeQuery> longNumber(LongNumberRangeQuery v) {
290+
this._kind = Kind.LongNumber;
291+
this._value = v;
292+
return this;
293+
}
294+
295+
public ObjectBuilder<RangeQuery> longNumber(
296+
Function<LongNumberRangeQuery.Builder, ObjectBuilder<LongNumberRangeQuery>> fn) {
297+
return this.longNumber(fn.apply(new LongNumberRangeQuery.Builder()).build());
298+
}
299+
270300
public ObjectBuilder<RangeQuery> number(NumberRangeQuery v) {
271301
this._kind = Kind.Number;
272302
this._value = v;

java-client/src/main/java/co/elastic/clients/elasticsearch/_types/query_dsl/RangeQueryBuilders.java

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,25 @@ public static RangeQuery date(Function<DateRangeQuery.Builder, ObjectBuilder<Dat
6262
return builder.build();
6363
}
6464

65+
/**
66+
* Creates a builder for the {@link LongNumberRangeQuery long_number}
67+
* {@code RangeQuery} variant.
68+
*/
69+
public static LongNumberRangeQuery.Builder longNumber() {
70+
return new LongNumberRangeQuery.Builder();
71+
}
72+
73+
/**
74+
* Creates a RangeQuery of the {@link LongNumberRangeQuery long_number}
75+
* {@code RangeQuery} variant.
76+
*/
77+
public static RangeQuery longNumber(
78+
Function<LongNumberRangeQuery.Builder, ObjectBuilder<LongNumberRangeQuery>> fn) {
79+
RangeQuery.Builder builder = new RangeQuery.Builder();
80+
builder.longNumber(fn.apply(new LongNumberRangeQuery.Builder()).build());
81+
return builder.build();
82+
}
83+
6584
/**
6685
* Creates a builder for the {@link NumberRangeQuery number} {@code RangeQuery}
6786
* variant.

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@
3939
import java.lang.Long;
4040
import java.lang.String;
4141
import java.util.Map;
42+
import java.util.Objects;
4243
import java.util.function.Function;
4344
import javax.annotation.Nullable;
4445

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

Lines changed: 19 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -869,7 +869,7 @@
869869
'_types.mapping.FieldAliasProperty': '_types/mapping/specialized.ts#L64-L67',
870870
'_types.mapping.FieldMapping': '_types/mapping/meta-fields.ts#L24-L27',
871871
'_types.mapping.FieldNamesField': '_types/mapping/meta-fields.ts#L42-L44',
872-
'_types.mapping.FieldType': '_types/mapping/Property.ts#L193-L242',
872+
'_types.mapping.FieldType': '_types/mapping/Property.ts#L193-L243',
873873
'_types.mapping.FlattenedProperty': '_types/mapping/complex.ts#L26-L38',
874874
'_types.mapping.FloatNumberProperty': '_types/mapping/core.ts#L158-L161',
875875
'_types.mapping.FloatRangeProperty': '_types/mapping/range.ts#L38-L40',
@@ -989,6 +989,7 @@
989989
'_types.query_dsl.IntervalsWildcard': '_types/query_dsl/fulltext.ts#L319-L334',
990990
'_types.query_dsl.Like': '_types/query_dsl/specialized.ts#L198-L203',
991991
'_types.query_dsl.LikeDocument': '_types/query_dsl/specialized.ts#L174-L196',
992+
'_types.query_dsl.LongNumberRangeQuery': '_types/query_dsl/term.ts#L174-L174',
992993
'_types.query_dsl.MatchAllQuery': '_types/query_dsl/MatchAllQuery.ts#L22-L25',
993994
'_types.query_dsl.MatchBoolPrefixQuery': '_types/query_dsl/fulltext.ts#L406-L463',
994995
'_types.query_dsl.MatchNoneQuery': '_types/query_dsl/MatchNoneQuery.ts#L22-L25',
@@ -1011,16 +1012,16 @@
10111012
'_types.query_dsl.QueryContainer': '_types/query_dsl/abstractions.ts#L103-L434',
10121013
'_types.query_dsl.QueryStringQuery': '_types/query_dsl/fulltext.ts#L649-L772',
10131014
'_types.query_dsl.RandomScoreFunction': '_types/query_dsl/compound.ts#L144-L147',
1014-
'_types.query_dsl.RangeQuery': '_types/query_dsl/term.ts#L176-L186',
1015+
'_types.query_dsl.RangeQuery': '_types/query_dsl/term.ts#L178-L189',
10151016
'_types.query_dsl.RangeQueryBase': '_types/query_dsl/term.ts#L122-L148',
1016-
'_types.query_dsl.RangeRelation': '_types/query_dsl/term.ts#L188-L201',
1017+
'_types.query_dsl.RangeRelation': '_types/query_dsl/term.ts#L191-L204',
10171018
'_types.query_dsl.RankFeatureFunction': '_types/query_dsl/specialized.ts#L280-L280',
10181019
'_types.query_dsl.RankFeatureFunctionLinear': '_types/query_dsl/specialized.ts#L282-L282',
10191020
'_types.query_dsl.RankFeatureFunctionLogarithm': '_types/query_dsl/specialized.ts#L284-L289',
10201021
'_types.query_dsl.RankFeatureFunctionSaturation': '_types/query_dsl/specialized.ts#L291-L296',
10211022
'_types.query_dsl.RankFeatureFunctionSigmoid': '_types/query_dsl/specialized.ts#L298-L307',
10221023
'_types.query_dsl.RankFeatureQuery': '_types/query_dsl/specialized.ts#L309-L335',
1023-
'_types.query_dsl.RegexpQuery': '_types/query_dsl/term.ts#L203-L236',
1024+
'_types.query_dsl.RegexpQuery': '_types/query_dsl/term.ts#L206-L239',
10241025
'_types.query_dsl.RuleQuery': '_types/query_dsl/specialized.ts#L398-L406',
10251026
'_types.query_dsl.ScriptQuery': '_types/query_dsl/specialized.ts#L337-L346',
10261027
'_types.query_dsl.ScriptScoreFunction': '_types/query_dsl/compound.ts#L137-L142',
@@ -1041,20 +1042,20 @@
10411042
'_types.query_dsl.SpanTermQuery': '_types/query_dsl/span.ts#L134-L140',
10421043
'_types.query_dsl.SpanWithinQuery': '_types/query_dsl/span.ts#L142-L156',
10431044
'_types.query_dsl.SparseVectorQuery': '_types/query_dsl/SparseVectorQuery.ts#L26-L80',
1044-
'_types.query_dsl.TermQuery': '_types/query_dsl/term.ts#L238-L255',
1045-
'_types.query_dsl.TermRangeQuery': '_types/query_dsl/term.ts#L174-L174',
1046-
'_types.query_dsl.TermsLookup': '_types/query_dsl/term.ts#L270-L275',
1047-
'_types.query_dsl.TermsQuery': '_types/query_dsl/term.ts#L257-L263',
1048-
'_types.query_dsl.TermsQueryField': '_types/query_dsl/term.ts#L265-L268',
1049-
'_types.query_dsl.TermsSetQuery': '_types/query_dsl/term.ts#L277-L299',
1045+
'_types.query_dsl.TermQuery': '_types/query_dsl/term.ts#L241-L258',
1046+
'_types.query_dsl.TermRangeQuery': '_types/query_dsl/term.ts#L176-L176',
1047+
'_types.query_dsl.TermsLookup': '_types/query_dsl/term.ts#L273-L278',
1048+
'_types.query_dsl.TermsQuery': '_types/query_dsl/term.ts#L260-L266',
1049+
'_types.query_dsl.TermsQueryField': '_types/query_dsl/term.ts#L268-L271',
1050+
'_types.query_dsl.TermsSetQuery': '_types/query_dsl/term.ts#L280-L302',
10501051
'_types.query_dsl.TextExpansionQuery': '_types/query_dsl/TextExpansionQuery.ts#L23-L36',
10511052
'_types.query_dsl.TextQueryType': '_types/query_dsl/fulltext.ts#L610-L636',
1052-
'_types.query_dsl.TypeQuery': '_types/query_dsl/term.ts#L301-L303',
1053+
'_types.query_dsl.TypeQuery': '_types/query_dsl/term.ts#L304-L306',
10531054
'_types.query_dsl.UntypedDecayFunction': '_types/query_dsl/compound.ts#L204-L207',
10541055
'_types.query_dsl.UntypedDistanceFeatureQuery': '_types/query_dsl/specialized.ts#L61-L64',
10551056
'_types.query_dsl.UntypedRangeQuery': '_types/query_dsl/term.ts#L150-L159',
10561057
'_types.query_dsl.WeightedTokensQuery': '_types/query_dsl/WeightedTokensQuery.ts#L25-L33',
1057-
'_types.query_dsl.WildcardQuery': '_types/query_dsl/term.ts#L305-L325',
1058+
'_types.query_dsl.WildcardQuery': '_types/query_dsl/term.ts#L308-L328',
10581059
'_types.query_dsl.WrapperQuery': '_types/query_dsl/abstractions.ts#L508-L517',
10591060
'_types.query_dsl.ZeroTermsQuery': '_types/query_dsl/fulltext.ts#L638-L647',
10601061
'async_search._types.AsyncSearch': 'async_search/_types/AsyncSearch.ts#L30-L56',
@@ -3132,10 +3133,10 @@
31323133
'transform._types.PivotGroupByContainer': 'transform/_types/Transform.ts#L70-L78',
31333134
'transform._types.RetentionPolicy': 'transform/_types/Transform.ts#L88-L96',
31343135
'transform._types.RetentionPolicyContainer': 'transform/_types/Transform.ts#L80-L86',
3135-
'transform._types.Settings': 'transform/_types/Transform.ts#L98-L166',
3136-
'transform._types.Source': 'transform/_types/Transform.ts#L168-L187',
3137-
'transform._types.SyncContainer': 'transform/_types/Transform.ts#L191-L197',
3138-
'transform._types.TimeSync': 'transform/_types/Transform.ts#L199-L211',
3136+
'transform._types.Settings': 'transform/_types/Transform.ts#L98-L165',
3137+
'transform._types.Source': 'transform/_types/Transform.ts#L167-L186',
3138+
'transform._types.SyncContainer': 'transform/_types/Transform.ts#L190-L196',
3139+
'transform._types.TimeSync': 'transform/_types/Transform.ts#L198-L210',
31393140
'transform.delete_transform.Request': 'transform/delete_transform/DeleteTransformRequest.ts#L24-L65',
31403141
'transform.delete_transform.Response': 'transform/delete_transform/DeleteTransformResponse.ts#L22-L24',
31413142
'transform.get_node_stats.Request': 'transform/get_node_stats/GetNodeStatsRequest.ts#L23-L40',
@@ -3378,10 +3379,10 @@
33783379
if (hash.length > 1) {
33793380
hash = hash.substring(1);
33803381
}
3381-
window.location = "https://github.com/elastic/elasticsearch-specification/tree/6ee016a765be615b0205fc209d3d3c515044689d/specification/" + (paths[hash] || "");
3382+
window.location = "https://github.com/elastic/elasticsearch-specification/tree/fb6b5c55b2fdb0dd963d8902a0c7c427a2653371/specification/" + (paths[hash] || "");
33823383
</script>
33833384
</head>
33843385
<body>
3385-
Please see the <a href="https://github.com/elastic/elasticsearch-specification/tree/6ee016a765be615b0205fc209d3d3c515044689d/specification/">Elasticsearch API specification</a>.
3386+
Please see the <a href="https://github.com/elastic/elasticsearch-specification/tree/fb6b5c55b2fdb0dd963d8902a0c7c427a2653371/specification/">Elasticsearch API specification</a>.
33863387
</body>
33873388
</html>

0 commit comments

Comments
 (0)