Skip to content

Commit 8dafdde

Browse files
committed
[codegen] update to latest spec
1 parent 5bb12b9 commit 8dafdde

File tree

13 files changed

+424
-138
lines changed

13 files changed

+424
-138
lines changed

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

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@
2626
import co.elastic.clients.json.JsonpUtils;
2727
import co.elastic.clients.json.ObjectBuilderDeserializer;
2828
import co.elastic.clients.json.ObjectDeserializer;
29-
import co.elastic.clients.util.ApiTypeHelper;
3029
import co.elastic.clients.util.ObjectBuilder;
3130
import co.elastic.clients.util.WithJsonObjectBuilderBase;
3231
import jakarta.json.stream.JsonGenerator;
@@ -60,6 +59,7 @@
6059
*/
6160
@JsonpDeserializable
6261
public class KuromojiAnalyzer implements AnalyzerVariant, JsonpSerializable {
62+
@Nullable
6363
private final KuromojiTokenizationMode mode;
6464

6565
@Nullable
@@ -69,7 +69,7 @@ public class KuromojiAnalyzer implements AnalyzerVariant, JsonpSerializable {
6969

7070
private KuromojiAnalyzer(Builder builder) {
7171

72-
this.mode = ApiTypeHelper.requireNonNull(builder.mode, this, "mode");
72+
this.mode = builder.mode;
7373
this.userDictionary = builder.userDictionary;
7474

7575
}
@@ -87,8 +87,9 @@ public Analyzer.Kind _analyzerKind() {
8787
}
8888

8989
/**
90-
* Required - API name: {@code mode}
90+
* API name: {@code mode}
9191
*/
92+
@Nullable
9293
public final KuromojiTokenizationMode mode() {
9394
return this.mode;
9495
}
@@ -114,8 +115,10 @@ protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) {
114115

115116
generator.write("type", "kuromoji");
116117

117-
generator.writeKey("mode");
118-
this.mode.serialize(generator, mapper);
118+
if (this.mode != null) {
119+
generator.writeKey("mode");
120+
this.mode.serialize(generator, mapper);
121+
}
119122
if (this.userDictionary != null) {
120123
generator.writeKey("user_dictionary");
121124
generator.write(this.userDictionary);
@@ -136,15 +139,16 @@ public String toString() {
136139
*/
137140

138141
public static class Builder extends WithJsonObjectBuilderBase<Builder> implements ObjectBuilder<KuromojiAnalyzer> {
142+
@Nullable
139143
private KuromojiTokenizationMode mode;
140144

141145
@Nullable
142146
private String userDictionary;
143147

144148
/**
145-
* Required - API name: {@code mode}
149+
* API name: {@code mode}
146150
*/
147-
public final Builder mode(KuromojiTokenizationMode value) {
151+
public final Builder mode(@Nullable KuromojiTokenizationMode value) {
148152
this.mode = value;
149153
return this;
150154
}

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ public static MlDataFrameAnalyticsRequest of(Function<Builder, ObjectBuilder<MlD
109109

110110
/**
111111
* Whether to ignore if a wildcard expression matches no configs. (This includes
112-
* <code>_all</code> string or when no configs have been specified)
112+
* <code>_all</code> string or when no configs have been specified.)
113113
* <p>
114114
* API name: {@code allow_no_match}
115115
*/
@@ -210,7 +210,7 @@ public static class Builder extends CatRequestBase.AbstractBuilder<Builder>
210210

211211
/**
212212
* Whether to ignore if a wildcard expression matches no configs. (This includes
213-
* <code>_all</code> string or when no configs have been specified)
213+
* <code>_all</code> string or when no configs have been specified.)
214214
* <p>
215215
* API name: {@code allow_no_match}
216216
*/

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

Lines changed: 182 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121

2222
import co.elastic.clients.elasticsearch._types.Bytes;
2323
import co.elastic.clients.elasticsearch._types.ErrorResponse;
24+
import co.elastic.clients.elasticsearch._types.ExpandWildcard;
2425
import co.elastic.clients.elasticsearch._types.Time;
2526
import co.elastic.clients.elasticsearch._types.TimeUnit;
2627
import co.elastic.clients.json.JsonpDeserializable;
@@ -74,11 +75,25 @@
7475
*/
7576

7677
public class SegmentsRequest extends CatRequestBase {
78+
@Nullable
79+
private final Boolean allowClosed;
80+
81+
@Nullable
82+
private final Boolean allowNoIndices;
83+
7784
@Nullable
7885
private final Bytes bytes;
7986

87+
private final List<ExpandWildcard> expandWildcards;
88+
8089
private final List<String> h;
8190

91+
@Nullable
92+
private final Boolean ignoreThrottled;
93+
94+
@Nullable
95+
private final Boolean ignoreUnavailable;
96+
8297
private final List<String> index;
8398

8499
@Nullable
@@ -96,8 +111,13 @@ public class SegmentsRequest extends CatRequestBase {
96111

97112
private SegmentsRequest(Builder builder) {
98113

114+
this.allowClosed = builder.allowClosed;
115+
this.allowNoIndices = builder.allowNoIndices;
99116
this.bytes = builder.bytes;
117+
this.expandWildcards = ApiTypeHelper.unmodifiable(builder.expandWildcards);
100118
this.h = ApiTypeHelper.unmodifiable(builder.h);
119+
this.ignoreThrottled = builder.ignoreThrottled;
120+
this.ignoreUnavailable = builder.ignoreUnavailable;
101121
this.index = ApiTypeHelper.unmodifiable(builder.index);
102122
this.local = builder.local;
103123
this.masterTimeout = builder.masterTimeout;
@@ -110,6 +130,32 @@ public static SegmentsRequest of(Function<Builder, ObjectBuilder<SegmentsRequest
110130
return fn.apply(new Builder()).build();
111131
}
112132

133+
/**
134+
* If true, allow closed indices to be returned in the response otherwise if
135+
* false, keep the legacy behaviour of throwing an exception if index pattern
136+
* matches closed indices
137+
* <p>
138+
* API name: {@code allow_closed}
139+
*/
140+
@Nullable
141+
public final Boolean allowClosed() {
142+
return this.allowClosed;
143+
}
144+
145+
/**
146+
* If false, the request returns an error if any wildcard expression, index
147+
* alias, or _all value targets only missing or closed indices. This behavior
148+
* applies even if the request targets other open indices. For example, a
149+
* request targeting foo*,bar* returns an error if an index starts with foo but
150+
* no index starts with bar.
151+
* <p>
152+
* API name: {@code allow_no_indices}
153+
*/
154+
@Nullable
155+
public final Boolean allowNoIndices() {
156+
return this.allowNoIndices;
157+
}
158+
113159
/**
114160
* Sets the units for columns that contain a byte-size value. Note that
115161
* byte-size value units work in terms of powers of 1024. For instance
@@ -128,6 +174,17 @@ public final Bytes bytes() {
128174
return this.bytes;
129175
}
130176

177+
/**
178+
* Type of index that wildcard expressions can match. If the request can target
179+
* data streams, this argument determines whether wildcard expressions match
180+
* hidden data streams. Supports comma-separated values, such as open,hidden.
181+
* <p>
182+
* API name: {@code expand_wildcards}
183+
*/
184+
public final List<ExpandWildcard> expandWildcards() {
185+
return this.expandWildcards;
186+
}
187+
131188
/**
132189
* A comma-separated list of columns names to display. It supports simple
133190
* wildcards.
@@ -138,6 +195,26 @@ public final List<String> h() {
138195
return this.h;
139196
}
140197

198+
/**
199+
* If true, concrete, expanded or aliased indices are ignored when frozen.
200+
* <p>
201+
* API name: {@code ignore_throttled}
202+
*/
203+
@Nullable
204+
public final Boolean ignoreThrottled() {
205+
return this.ignoreThrottled;
206+
}
207+
208+
/**
209+
* If true, missing or closed indices are not included in the response.
210+
* <p>
211+
* API name: {@code ignore_unavailable}
212+
*/
213+
@Nullable
214+
public final Boolean ignoreUnavailable() {
215+
return this.ignoreUnavailable;
216+
}
217+
141218
/**
142219
* A comma-separated list of data streams, indices, and aliases used to limit
143220
* the request. Supports wildcards (<code>*</code>). To target all data streams
@@ -209,12 +286,27 @@ public final TimeUnit time() {
209286
public static class Builder extends CatRequestBase.AbstractBuilder<Builder>
210287
implements
211288
ObjectBuilder<SegmentsRequest> {
289+
@Nullable
290+
private Boolean allowClosed;
291+
292+
@Nullable
293+
private Boolean allowNoIndices;
294+
212295
@Nullable
213296
private Bytes bytes;
214297

298+
@Nullable
299+
private List<ExpandWildcard> expandWildcards;
300+
215301
@Nullable
216302
private List<String> h;
217303

304+
@Nullable
305+
private Boolean ignoreThrottled;
306+
307+
@Nullable
308+
private Boolean ignoreUnavailable;
309+
218310
@Nullable
219311
private List<String> index;
220312

@@ -230,6 +322,32 @@ public static class Builder extends CatRequestBase.AbstractBuilder<Builder>
230322
@Nullable
231323
private TimeUnit time;
232324

325+
/**
326+
* If true, allow closed indices to be returned in the response otherwise if
327+
* false, keep the legacy behaviour of throwing an exception if index pattern
328+
* matches closed indices
329+
* <p>
330+
* API name: {@code allow_closed}
331+
*/
332+
public final Builder allowClosed(@Nullable Boolean value) {
333+
this.allowClosed = value;
334+
return this;
335+
}
336+
337+
/**
338+
* If false, the request returns an error if any wildcard expression, index
339+
* alias, or _all value targets only missing or closed indices. This behavior
340+
* applies even if the request targets other open indices. For example, a
341+
* request targeting foo*,bar* returns an error if an index starts with foo but
342+
* no index starts with bar.
343+
* <p>
344+
* API name: {@code allow_no_indices}
345+
*/
346+
public final Builder allowNoIndices(@Nullable Boolean value) {
347+
this.allowNoIndices = value;
348+
return this;
349+
}
350+
233351
/**
234352
* Sets the units for columns that contain a byte-size value. Note that
235353
* byte-size value units work in terms of powers of 1024. For instance
@@ -248,6 +366,34 @@ public final Builder bytes(@Nullable Bytes value) {
248366
return this;
249367
}
250368

369+
/**
370+
* Type of index that wildcard expressions can match. If the request can target
371+
* data streams, this argument determines whether wildcard expressions match
372+
* hidden data streams. Supports comma-separated values, such as open,hidden.
373+
* <p>
374+
* API name: {@code expand_wildcards}
375+
* <p>
376+
* Adds all elements of <code>list</code> to <code>expandWildcards</code>.
377+
*/
378+
public final Builder expandWildcards(List<ExpandWildcard> list) {
379+
this.expandWildcards = _listAddAll(this.expandWildcards, list);
380+
return this;
381+
}
382+
383+
/**
384+
* Type of index that wildcard expressions can match. If the request can target
385+
* data streams, this argument determines whether wildcard expressions match
386+
* hidden data streams. Supports comma-separated values, such as open,hidden.
387+
* <p>
388+
* API name: {@code expand_wildcards}
389+
* <p>
390+
* Adds one or more values to <code>expandWildcards</code>.
391+
*/
392+
public final Builder expandWildcards(ExpandWildcard value, ExpandWildcard... values) {
393+
this.expandWildcards = _listAdd(this.expandWildcards, value, values);
394+
return this;
395+
}
396+
251397
/**
252398
* A comma-separated list of columns names to display. It supports simple
253399
* wildcards.
@@ -288,6 +434,26 @@ public final Builder h(CatSegmentsColumn value, CatSegmentsColumn... values) {
288434
return this;
289435
}
290436

437+
/**
438+
* If true, concrete, expanded or aliased indices are ignored when frozen.
439+
* <p>
440+
* API name: {@code ignore_throttled}
441+
*/
442+
public final Builder ignoreThrottled(@Nullable Boolean value) {
443+
this.ignoreThrottled = value;
444+
return this;
445+
}
446+
447+
/**
448+
* If true, missing or closed indices are not included in the response.
449+
* <p>
450+
* API name: {@code ignore_unavailable}
451+
*/
452+
public final Builder ignoreUnavailable(@Nullable Boolean value) {
453+
this.ignoreUnavailable = value;
454+
return this;
455+
}
456+
291457
/**
292458
* A comma-separated list of data streams, indices, and aliases used to limit
293459
* the request. Supports wildcards (<code>*</code>). To target all data streams
@@ -480,12 +646,28 @@ public SegmentsRequest build() {
480646
if (ApiTypeHelper.isDefined(request.s)) {
481647
params.put("s", request.s.stream().map(v -> v).collect(Collectors.joining(",")));
482648
}
649+
if (ApiTypeHelper.isDefined(request.expandWildcards)) {
650+
params.put("expand_wildcards",
651+
request.expandWildcards.stream().map(v -> v.jsonValue()).collect(Collectors.joining(",")));
652+
}
653+
if (request.ignoreUnavailable != null) {
654+
params.put("ignore_unavailable", String.valueOf(request.ignoreUnavailable));
655+
}
656+
if (request.allowNoIndices != null) {
657+
params.put("allow_no_indices", String.valueOf(request.allowNoIndices));
658+
}
659+
if (request.allowClosed != null) {
660+
params.put("allow_closed", String.valueOf(request.allowClosed));
661+
}
483662
if (request.bytes != null) {
484663
params.put("bytes", request.bytes.jsonValue());
485664
}
486665
if (ApiTypeHelper.isDefined(request.h)) {
487666
params.put("h", request.h.stream().map(v -> v).collect(Collectors.joining(",")));
488667
}
668+
if (request.ignoreThrottled != null) {
669+
params.put("ignore_throttled", String.valueOf(request.ignoreThrottled));
670+
}
489671
if (request.time != null) {
490672
params.put("time", request.time.jsonValue());
491673
}

0 commit comments

Comments
 (0)