Skip to content

Commit d658c65

Browse files
committed
[codegen-serverless] update to latest api spec
1 parent ebe8cfa commit d658c65

Some content is hidden

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

46 files changed

+4153
-1809
lines changed

java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/GeoDistanceSort.java

+36
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,9 @@ public class GeoDistanceSort implements SortOptionsVariant, JsonpSerializable {
8080
@Nullable
8181
private final DistanceUnit unit;
8282

83+
@Nullable
84+
private final NestedSortValue nested;
85+
8386
// ---------------------------------------------------------------------------------------------
8487

8588
private GeoDistanceSort(Builder builder) {
@@ -92,6 +95,7 @@ private GeoDistanceSort(Builder builder) {
9295
this.ignoreUnmapped = builder.ignoreUnmapped;
9396
this.order = builder.order;
9497
this.unit = builder.unit;
98+
this.nested = builder.nested;
9599

96100
}
97101

@@ -161,6 +165,14 @@ public final DistanceUnit unit() {
161165
return this.unit;
162166
}
163167

168+
/**
169+
* API name: {@code nested}
170+
*/
171+
@Nullable
172+
public final NestedSortValue nested() {
173+
return this.nested;
174+
}
175+
164176
/**
165177
* Serialize this object to JSON.
166178
*/
@@ -200,6 +212,11 @@ protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) {
200212
generator.writeKey("unit");
201213
this.unit.serialize(generator, mapper);
202214
}
215+
if (this.nested != null) {
216+
generator.writeKey("nested");
217+
this.nested.serialize(generator, mapper);
218+
219+
}
203220

204221
}
205222

@@ -265,6 +282,9 @@ public final Builder location(Function<GeoLocation.Builder, ObjectBuilder<GeoLoc
265282
@Nullable
266283
private DistanceUnit unit;
267284

285+
@Nullable
286+
private NestedSortValue nested;
287+
268288
/**
269289
* API name: {@code mode}
270290
*/
@@ -305,6 +325,21 @@ public final Builder unit(@Nullable DistanceUnit value) {
305325
return this;
306326
}
307327

328+
/**
329+
* API name: {@code nested}
330+
*/
331+
public final Builder nested(@Nullable NestedSortValue value) {
332+
this.nested = value;
333+
return this;
334+
}
335+
336+
/**
337+
* API name: {@code nested}
338+
*/
339+
public final Builder nested(Function<NestedSortValue.Builder, ObjectBuilder<NestedSortValue>> fn) {
340+
return this.nested(fn.apply(new NestedSortValue.Builder()).build());
341+
}
342+
308343
@Override
309344
protected Builder self() {
310345
return this;
@@ -338,6 +373,7 @@ protected static void setupGeoDistanceSortDeserializer(ObjectDeserializer<GeoDis
338373
op.add(Builder::ignoreUnmapped, JsonpDeserializer.booleanDeserializer(), "ignore_unmapped");
339374
op.add(Builder::order, SortOrder._DESERIALIZER, "order");
340375
op.add(Builder::unit, DistanceUnit._DESERIALIZER, "unit");
376+
op.add(Builder::nested, NestedSortValue._DESERIALIZER, "nested");
341377

342378
op.setUnknownFieldHandler((builder, name, parser, mapper) -> {
343379
builder.field(name);

java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/analysis/SnowballTokenFilter.java

+11-7
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@
2424
import co.elastic.clients.json.JsonpMapper;
2525
import co.elastic.clients.json.ObjectBuilderDeserializer;
2626
import co.elastic.clients.json.ObjectDeserializer;
27-
import co.elastic.clients.util.ApiTypeHelper;
2827
import co.elastic.clients.util.ObjectBuilder;
2928
import jakarta.json.stream.JsonGenerator;
3029
import java.util.Objects;
@@ -56,14 +55,15 @@
5655
*/
5756
@JsonpDeserializable
5857
public class SnowballTokenFilter extends TokenFilterBase implements TokenFilterDefinitionVariant {
58+
@Nullable
5959
private final SnowballLanguage language;
6060

6161
// ---------------------------------------------------------------------------------------------
6262

6363
private SnowballTokenFilter(Builder builder) {
6464
super(builder);
6565

66-
this.language = ApiTypeHelper.requireNonNull(builder.language, this, "language");
66+
this.language = builder.language;
6767

6868
}
6969

@@ -80,8 +80,9 @@ public TokenFilterDefinition.Kind _tokenFilterDefinitionKind() {
8080
}
8181

8282
/**
83-
* Required - API name: {@code language}
83+
* API name: {@code language}
8484
*/
85+
@Nullable
8586
public final SnowballLanguage language() {
8687
return this.language;
8788
}
@@ -90,8 +91,10 @@ protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) {
9091

9192
generator.write("type", "snowball");
9293
super.serializeInternal(generator, mapper);
93-
generator.writeKey("language");
94-
this.language.serialize(generator, mapper);
94+
if (this.language != null) {
95+
generator.writeKey("language");
96+
this.language.serialize(generator, mapper);
97+
}
9598

9699
}
97100

@@ -104,12 +107,13 @@ protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) {
104107
public static class Builder extends TokenFilterBase.AbstractBuilder<Builder>
105108
implements
106109
ObjectBuilder<SnowballTokenFilter> {
110+
@Nullable
107111
private SnowballLanguage language;
108112

109113
/**
110-
* Required - API name: {@code language}
114+
* API name: {@code language}
111115
*/
112-
public final Builder language(SnowballLanguage value) {
116+
public final Builder language(@Nullable SnowballLanguage value) {
113117
this.language = value;
114118
return this;
115119
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,120 @@
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.elasticsearch._types.Time;
23+
import co.elastic.clients.json.JsonpDeserializable;
24+
import co.elastic.clients.json.JsonpDeserializer;
25+
import co.elastic.clients.json.ObjectBuilderDeserializer;
26+
import co.elastic.clients.json.ObjectDeserializer;
27+
import co.elastic.clients.util.ObjectBuilder;
28+
import jakarta.json.stream.JsonGenerator;
29+
import java.lang.String;
30+
import java.util.Objects;
31+
import java.util.function.Function;
32+
33+
//----------------------------------------------------------------
34+
// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST.
35+
//----------------------------------------------------------------
36+
//
37+
// This code is generated from the Elasticsearch API specification
38+
// at https://github.com/elastic/elasticsearch-specification
39+
//
40+
// Manual updates to this file will be lost when the code is
41+
// re-generated.
42+
//
43+
// If you find a property that is missing or wrongly typed, please
44+
// open an issue or a PR on the API specification repository.
45+
//
46+
//----------------------------------------------------------------
47+
48+
// typedef: _types.query_dsl.DateDecayFunction
49+
50+
/**
51+
*
52+
* @see <a href=
53+
* "../../doc-files/api-spec.html#_types.query_dsl.DateDecayFunction">API
54+
* specification</a>
55+
*/
56+
@JsonpDeserializable
57+
public class DateDecayFunction extends DecayFunctionBase<String, Time> implements DecayFunctionVariant {
58+
// ---------------------------------------------------------------------------------------------
59+
60+
private DateDecayFunction(Builder builder) {
61+
super(builder);
62+
63+
}
64+
65+
public static DateDecayFunction of(Function<Builder, ObjectBuilder<DateDecayFunction>> fn) {
66+
return fn.apply(new Builder()).build();
67+
}
68+
69+
/**
70+
* DecayFunction variant kind.
71+
*/
72+
@Override
73+
public DecayFunction.Kind _decayFunctionKind() {
74+
return DecayFunction.Kind.Date;
75+
}
76+
77+
// ---------------------------------------------------------------------------------------------
78+
79+
/**
80+
* Builder for {@link DateDecayFunction}.
81+
*/
82+
83+
public static class Builder extends DecayFunctionBase.AbstractBuilder<String, Time, Builder>
84+
implements
85+
ObjectBuilder<DateDecayFunction> {
86+
@Override
87+
protected Builder self() {
88+
return this;
89+
}
90+
91+
/**
92+
* Builds a {@link DateDecayFunction}.
93+
*
94+
* @throws NullPointerException
95+
* if some of the required fields are null.
96+
*/
97+
public DateDecayFunction build() {
98+
_checkSingleUse();
99+
super.tOriginSerializer(null);
100+
super.tScaleSerializer(null);
101+
102+
return new DateDecayFunction(this);
103+
}
104+
}
105+
106+
// ---------------------------------------------------------------------------------------------
107+
108+
/**
109+
* Json deserializer for {@link DateDecayFunction}
110+
*/
111+
public static final JsonpDeserializer<DateDecayFunction> _DESERIALIZER = ObjectBuilderDeserializer
112+
.lazy(Builder::new, DateDecayFunction::setupDateDecayFunctionDeserializer);
113+
114+
protected static void setupDateDecayFunctionDeserializer(ObjectDeserializer<DateDecayFunction.Builder> op) {
115+
DecayFunctionBase.setupDecayFunctionBaseDeserializer(op, JsonpDeserializer.stringDeserializer(),
116+
Time._DESERIALIZER);
117+
118+
}
119+
120+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,123 @@
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.elasticsearch._types.Time;
23+
import co.elastic.clients.json.JsonpDeserializable;
24+
import co.elastic.clients.json.JsonpDeserializer;
25+
import co.elastic.clients.json.ObjectBuilderDeserializer;
26+
import co.elastic.clients.json.ObjectDeserializer;
27+
import co.elastic.clients.util.ObjectBuilder;
28+
import jakarta.json.stream.JsonGenerator;
29+
import java.lang.String;
30+
import java.util.Objects;
31+
import java.util.function.Function;
32+
33+
//----------------------------------------------------------------
34+
// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST.
35+
//----------------------------------------------------------------
36+
//
37+
// This code is generated from the Elasticsearch API specification
38+
// at https://github.com/elastic/elasticsearch-specification
39+
//
40+
// Manual updates to this file will be lost when the code is
41+
// re-generated.
42+
//
43+
// If you find a property that is missing or wrongly typed, please
44+
// open an issue or a PR on the API specification repository.
45+
//
46+
//----------------------------------------------------------------
47+
48+
// typedef: _types.query_dsl.DateDistanceFeatureQuery
49+
50+
/**
51+
*
52+
* @see <a href=
53+
* "../../doc-files/api-spec.html#_types.query_dsl.DateDistanceFeatureQuery">API
54+
* specification</a>
55+
*/
56+
@JsonpDeserializable
57+
public class DateDistanceFeatureQuery extends DistanceFeatureQueryBase<String, Time>
58+
implements
59+
DistanceFeatureQueryVariant {
60+
// ---------------------------------------------------------------------------------------------
61+
62+
private DateDistanceFeatureQuery(Builder builder) {
63+
super(builder);
64+
65+
}
66+
67+
public static DateDistanceFeatureQuery of(Function<Builder, ObjectBuilder<DateDistanceFeatureQuery>> fn) {
68+
return fn.apply(new Builder()).build();
69+
}
70+
71+
/**
72+
* DistanceFeatureQuery variant kind.
73+
*/
74+
@Override
75+
public DistanceFeatureQuery.Kind _distanceFeatureQueryKind() {
76+
return DistanceFeatureQuery.Kind.Date;
77+
}
78+
79+
// ---------------------------------------------------------------------------------------------
80+
81+
/**
82+
* Builder for {@link DateDistanceFeatureQuery}.
83+
*/
84+
85+
public static class Builder extends DistanceFeatureQueryBase.AbstractBuilder<String, Time, Builder>
86+
implements
87+
ObjectBuilder<DateDistanceFeatureQuery> {
88+
@Override
89+
protected Builder self() {
90+
return this;
91+
}
92+
93+
/**
94+
* Builds a {@link DateDistanceFeatureQuery}.
95+
*
96+
* @throws NullPointerException
97+
* if some of the required fields are null.
98+
*/
99+
public DateDistanceFeatureQuery build() {
100+
_checkSingleUse();
101+
super.tOriginSerializer(null);
102+
super.tDistanceSerializer(null);
103+
104+
return new DateDistanceFeatureQuery(this);
105+
}
106+
}
107+
108+
// ---------------------------------------------------------------------------------------------
109+
110+
/**
111+
* Json deserializer for {@link DateDistanceFeatureQuery}
112+
*/
113+
public static final JsonpDeserializer<DateDistanceFeatureQuery> _DESERIALIZER = ObjectBuilderDeserializer
114+
.lazy(Builder::new, DateDistanceFeatureQuery::setupDateDistanceFeatureQueryDeserializer);
115+
116+
protected static void setupDateDistanceFeatureQueryDeserializer(
117+
ObjectDeserializer<DateDistanceFeatureQuery.Builder> op) {
118+
DistanceFeatureQueryBase.setupDistanceFeatureQueryBaseDeserializer(op, JsonpDeserializer.stringDeserializer(),
119+
Time._DESERIALIZER);
120+
121+
}
122+
123+
}

0 commit comments

Comments
 (0)