2121
2222import co .elastic .clients .elasticsearch ._types .Bytes ;
2323import co .elastic .clients .elasticsearch ._types .ErrorResponse ;
24+ import co .elastic .clients .elasticsearch ._types .ExpandWildcard ;
2425import co .elastic .clients .elasticsearch ._types .Time ;
2526import co .elastic .clients .elasticsearch ._types .TimeUnit ;
2627import co .elastic .clients .json .JsonpDeserializable ;
7475 */
7576
7677public 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