Skip to content

Commit 1d82d94

Browse files
committed
[codegen] update to latest spec
1 parent 7a06678 commit 1d82d94

File tree

11 files changed

+497
-59
lines changed

11 files changed

+497
-59
lines changed

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

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -240,6 +240,9 @@ public class BulkRequest extends RequestBase implements NdJsonpSerializable, Jso
240240

241241
private final List<String> sourceIncludes;
242242

243+
@Nullable
244+
private final Boolean includeSourceOnError;
245+
243246
@Nullable
244247
private final String index;
245248

@@ -276,6 +279,7 @@ private BulkRequest(Builder builder) {
276279
this.source = builder.source;
277280
this.sourceExcludes = ApiTypeHelper.unmodifiable(builder.sourceExcludes);
278281
this.sourceIncludes = ApiTypeHelper.unmodifiable(builder.sourceIncludes);
282+
this.includeSourceOnError = builder.includeSourceOnError;
279283
this.index = builder.index;
280284
this.listExecutedPipelines = builder.listExecutedPipelines;
281285
this.pipeline = builder.pipeline;
@@ -333,6 +337,17 @@ public final List<String> sourceIncludes() {
333337
return this.sourceIncludes;
334338
}
335339

340+
/**
341+
* True or false if to include the document source in the error message in case
342+
* of parsing errors.
343+
* <p>
344+
* API name: {@code include_source_on_error}
345+
*/
346+
@Nullable
347+
public final Boolean includeSourceOnError() {
348+
return this.includeSourceOnError;
349+
}
350+
336351
/**
337352
* The name of the data stream, index, or index alias to perform bulk actions
338353
* on.
@@ -477,6 +492,9 @@ public static class Builder extends RequestBase.AbstractBuilder<Builder> impleme
477492
@Nullable
478493
private List<String> sourceIncludes;
479494

495+
@Nullable
496+
private Boolean includeSourceOnError;
497+
480498
@Nullable
481499
private String index;
482500

@@ -589,6 +607,17 @@ public final Builder sourceIncludes(String value, String... values) {
589607
return this;
590608
}
591609

610+
/**
611+
* True or false if to include the document source in the error message in case
612+
* of parsing errors.
613+
* <p>
614+
* API name: {@code include_source_on_error}
615+
*/
616+
public final Builder includeSourceOnError(@Nullable Boolean value) {
617+
this.includeSourceOnError = value;
618+
return this;
619+
}
620+
592621
/**
593622
* The name of the data stream, index, or index alias to perform bulk actions
594623
* on.
@@ -835,6 +864,9 @@ public BulkRequest build() {
835864
if (request.routing != null) {
836865
params.put("routing", request.routing);
837866
}
867+
if (request.includeSourceOnError != null) {
868+
params.put("include_source_on_error", String.valueOf(request.includeSourceOnError));
869+
}
838870
if (request.requireAlias != null) {
839871
params.put("require_alias", String.valueOf(request.requireAlias));
840872
}

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

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@
4141
import co.elastic.clients.util.ObjectBuilder;
4242
import jakarta.json.stream.JsonGenerator;
4343
import jakarta.json.stream.JsonParser;
44+
import java.lang.Boolean;
4445
import java.lang.Long;
4546
import java.lang.String;
4647
import java.util.HashMap;
@@ -198,6 +199,9 @@
198199
public class CreateRequest<TDocument> extends RequestBase implements JsonpSerializable {
199200
private final String id;
200201

202+
@Nullable
203+
private final Boolean includeSourceOnError;
204+
201205
private final String index;
202206

203207
@Nullable
@@ -231,6 +235,7 @@ public class CreateRequest<TDocument> extends RequestBase implements JsonpSerial
231235
private CreateRequest(Builder<TDocument> builder) {
232236

233237
this.id = ApiTypeHelper.requireNonNull(builder.id, this, "id");
238+
this.includeSourceOnError = builder.includeSourceOnError;
234239
this.index = ApiTypeHelper.requireNonNull(builder.index, this, "index");
235240
this.pipeline = builder.pipeline;
236241
this.refresh = builder.refresh;
@@ -259,6 +264,17 @@ public final String id() {
259264
return this.id;
260265
}
261266

267+
/**
268+
* True or false if to include the document source in the error message in case
269+
* of parsing errors.
270+
* <p>
271+
* API name: {@code include_source_on_error}
272+
*/
273+
@Nullable
274+
public final Boolean includeSourceOnError() {
275+
return this.includeSourceOnError;
276+
}
277+
262278
/**
263279
* Required - The name of the data stream or index to target. If the target
264280
* doesn't exist and matches the name or wildcard (<code>*</code>) pattern of an
@@ -391,6 +407,9 @@ public static class Builder<TDocument> extends RequestBase.AbstractBuilder<Build
391407
ObjectBuilder<CreateRequest<TDocument>> {
392408
private String id;
393409

410+
@Nullable
411+
private Boolean includeSourceOnError;
412+
394413
private String index;
395414

396415
@Nullable
@@ -430,6 +449,17 @@ public final Builder<TDocument> id(String value) {
430449
return this;
431450
}
432451

452+
/**
453+
* True or false if to include the document source in the error message in case
454+
* of parsing errors.
455+
* <p>
456+
* API name: {@code include_source_on_error}
457+
*/
458+
public final Builder<TDocument> includeSourceOnError(@Nullable Boolean value) {
459+
this.includeSourceOnError = value;
460+
return this;
461+
}
462+
433463
/**
434464
* Required - The name of the data stream or index to target. If the target
435465
* doesn't exist and matches the name or wildcard (<code>*</code>) pattern of an
@@ -696,6 +726,9 @@ public static <TDocument> JsonpDeserializer<CreateRequest<TDocument>> createCrea
696726
if (request.routing != null) {
697727
params.put("routing", request.routing);
698728
}
729+
if (request.includeSourceOnError != null) {
730+
params.put("include_source_on_error", String.valueOf(request.includeSourceOnError));
731+
}
699732
if (request.versionType != null) {
700733
params.put("version_type", request.versionType.jsonValue());
701734
}

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

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -273,6 +273,9 @@ public class IndexRequest<TDocument> extends RequestBase implements JsonpSeriali
273273
@Nullable
274274
private final Long ifSeqNo;
275275

276+
@Nullable
277+
private final Boolean includeSourceOnError;
278+
276279
private final String index;
277280

278281
@Nullable
@@ -314,6 +317,7 @@ private IndexRequest(Builder<TDocument> builder) {
314317
this.id = builder.id;
315318
this.ifPrimaryTerm = builder.ifPrimaryTerm;
316319
this.ifSeqNo = builder.ifSeqNo;
320+
this.includeSourceOnError = builder.includeSourceOnError;
317321
this.index = ApiTypeHelper.requireNonNull(builder.index, this, "index");
318322
this.opType = builder.opType;
319323
this.pipeline = builder.pipeline;
@@ -366,6 +370,17 @@ public final Long ifSeqNo() {
366370
return this.ifSeqNo;
367371
}
368372

373+
/**
374+
* True or false if to include the document source in the error message in case
375+
* of parsing errors.
376+
* <p>
377+
* API name: {@code include_source_on_error}
378+
*/
379+
@Nullable
380+
public final Boolean includeSourceOnError() {
381+
return this.includeSourceOnError;
382+
}
383+
369384
/**
370385
* Required - The name of the data stream or index to target. If the target
371386
* doesn't exist and matches the name or wildcard (<code>*</code>) pattern of an
@@ -530,6 +545,9 @@ public static class Builder<TDocument> extends RequestBase.AbstractBuilder<Build
530545
@Nullable
531546
private Long ifSeqNo;
532547

548+
@Nullable
549+
private Boolean includeSourceOnError;
550+
533551
private String index;
534552

535553
@Nullable
@@ -596,6 +614,17 @@ public final Builder<TDocument> ifSeqNo(@Nullable Long value) {
596614
return this;
597615
}
598616

617+
/**
618+
* True or false if to include the document source in the error message in case
619+
* of parsing errors.
620+
* <p>
621+
* API name: {@code include_source_on_error}
622+
*/
623+
public final Builder<TDocument> includeSourceOnError(@Nullable Boolean value) {
624+
this.includeSourceOnError = value;
625+
return this;
626+
}
627+
599628
/**
600629
* Required - The name of the data stream or index to target. If the target
601630
* doesn't exist and matches the name or wildcard (<code>*</code>) pattern of an
@@ -910,6 +939,9 @@ public static <TDocument> JsonpDeserializer<IndexRequest<TDocument>> createIndex
910939
if (request.routing != null) {
911940
params.put("routing", request.routing);
912941
}
942+
if (request.includeSourceOnError != null) {
943+
params.put("include_source_on_error", String.valueOf(request.includeSourceOnError));
944+
}
913945
if (request.requireAlias != null) {
914946
params.put("require_alias", String.valueOf(request.requireAlias));
915947
}

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

Lines changed: 38 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -122,6 +122,9 @@ public class UpdateRequest<TDocument, TPartialDocument> extends RequestBase impl
122122
@Nullable
123123
private final Long ifSeqNo;
124124

125+
@Nullable
126+
private final Boolean includeSourceOnError;
127+
125128
private final String index;
126129

127130
@Nullable
@@ -171,6 +174,7 @@ private UpdateRequest(Builder<TDocument, TPartialDocument> builder) {
171174
this.id = ApiTypeHelper.requireNonNull(builder.id, this, "id");
172175
this.ifPrimaryTerm = builder.ifPrimaryTerm;
173176
this.ifSeqNo = builder.ifSeqNo;
177+
this.includeSourceOnError = builder.includeSourceOnError;
174178
this.index = ApiTypeHelper.requireNonNull(builder.index, this, "index");
175179
this.lang = builder.lang;
176180
this.refresh = builder.refresh;
@@ -266,6 +270,17 @@ public final Long ifSeqNo() {
266270
return this.ifSeqNo;
267271
}
268272

273+
/**
274+
* True or false if to include the document source in the error message in case
275+
* of parsing errors.
276+
* <p>
277+
* API name: {@code include_source_on_error}
278+
*/
279+
@Nullable
280+
public final Boolean includeSourceOnError() {
281+
return this.includeSourceOnError;
282+
}
283+
269284
/**
270285
* Required - The name of the target index. By default, the index is created
271286
* automatically if it doesn't exist.
@@ -465,6 +480,9 @@ public static class Builder<TDocument, TPartialDocument>
465480
@Nullable
466481
private Long ifSeqNo;
467482

483+
@Nullable
484+
private Boolean includeSourceOnError;
485+
468486
private String index;
469487

470488
@Nullable
@@ -589,6 +607,17 @@ public final Builder<TDocument, TPartialDocument> ifSeqNo(@Nullable Long value)
589607
return this;
590608
}
591609

610+
/**
611+
* True or false if to include the document source in the error message in case
612+
* of parsing errors.
613+
* <p>
614+
* API name: {@code include_source_on_error}
615+
*/
616+
public final Builder<TDocument, TPartialDocument> includeSourceOnError(@Nullable Boolean value) {
617+
this.includeSourceOnError = value;
618+
return this;
619+
}
620+
592621
/**
593622
* Required - The name of the target index. By default, the index is created
594623
* automatically if it doesn't exist.
@@ -876,6 +905,15 @@ protected static <TDocument, TPartialDocument> void setupUpdateRequestDeserializ
876905
// Request parameters
877906
request -> {
878907
Map<String, String> params = new HashMap<>();
908+
if (request.includeSourceOnError != null) {
909+
params.put("include_source_on_error", String.valueOf(request.includeSourceOnError));
910+
}
911+
if (request.refresh != null) {
912+
params.put("refresh", request.refresh.jsonValue());
913+
}
914+
if (request.timeout != null) {
915+
params.put("timeout", request.timeout._toJsonString());
916+
}
879917
if (request.routing != null) {
880918
params.put("routing", request.routing);
881919
}
@@ -888,9 +926,6 @@ protected static <TDocument, TPartialDocument> void setupUpdateRequestDeserializ
888926
if (request.ifSeqNo != null) {
889927
params.put("if_seq_no", String.valueOf(request.ifSeqNo));
890928
}
891-
if (request.refresh != null) {
892-
params.put("refresh", request.refresh.jsonValue());
893-
}
894929
if (request.waitForActiveShards != null) {
895930
params.put("wait_for_active_shards", request.waitForActiveShards._toJsonString());
896931
}
@@ -900,9 +935,6 @@ protected static <TDocument, TPartialDocument> void setupUpdateRequestDeserializ
900935
if (request.retryOnConflict != null) {
901936
params.put("retry_on_conflict", String.valueOf(request.retryOnConflict));
902937
}
903-
if (request.timeout != null) {
904-
params.put("timeout", request.timeout._toJsonString());
905-
}
906938
return params;
907939

908940
}, SimpleEndpoint.emptyMap(), true, UpdateResponse._DESERIALIZER);

0 commit comments

Comments
 (0)