From 00045e55749ab61516b06cb50c477632deb7c087 Mon Sep 17 00:00:00 2001 From: Laura Trotta Date: Fri, 4 Sep 2026 14:16:08 +0000 Subject: [PATCH] [codegen] update to latest spec --- .../elasticsearch/_types/InnerRetriever.java | 68 ++++-- .../elasticsearch/_types/KnnRetriever.java | 21 +- .../mapping/DenseVectorIndexOptions.java | 210 ++++++++++++++++- .../_types/mapping/SemanticTextProperty.java | 14 +- .../_types/mapping/SourceFieldMode.java | 2 + .../elasticsearch/cat/CatRecoveryColumn.java | 11 + .../elasticsearch/cat/RecoveryRequest.java | 6 +- .../cat/recovery/RecoveryRecord.java | 104 ++++++++- .../elasticsearch/doc-files/api-spec.html | 182 +++++++-------- .../clients/elasticsearch/esql/ESQLView.java | 35 +++ .../elasticsearch/esql/PutViewRequest.java | 34 +++ .../indices/RecoveryRequest.java | 6 +- .../indices/recovery/RecoveryPriority.java | 103 +++++++++ .../indices/recovery/RecoveryStage.java | 8 +- .../indices/recovery/ShardRecovery.java | 112 ++++++++- .../clients/elasticsearch/ml/Datafeed.java | 42 ++++ .../elasticsearch/ml/DatafeedConfig.java | 42 ++++ .../elasticsearch/ml/PutDatafeedRequest.java | 42 ++++ .../elasticsearch/ml/PutDatafeedResponse.java | 42 ++++ .../ml/UpdateDatafeedRequest.java | 84 +++++++ .../ml/UpdateDatafeedResponse.java | 42 ++++ .../security/RoleDescriptor.java | 44 +--- .../security/RoleDescriptorRead.java | 44 +--- .../snapshot/DeleteSnapshotRequest.java | 30 ++- .../elasticsearch/transform/Destination.java | 88 ++++++++ .../transform/DestinationAlias.java | 212 ++++++++++++++++++ .../transform/UpdateTransformRequest.java | 40 ++++ .../transform/UpdateTransformResponse.java | 1 - .../get_transform/TransformSummary.java | 2 +- 29 files changed, 1459 insertions(+), 212 deletions(-) create mode 100644 java-client/src/main/java/co/elastic/clients/elasticsearch/indices/recovery/RecoveryPriority.java create mode 100644 java-client/src/main/java/co/elastic/clients/elasticsearch/transform/DestinationAlias.java diff --git a/java-client/src/main/java/co/elastic/clients/elasticsearch/_types/InnerRetriever.java b/java-client/src/main/java/co/elastic/clients/elasticsearch/_types/InnerRetriever.java index 40c4c7067d..894f5ea813 100644 --- a/java-client/src/main/java/co/elastic/clients/elasticsearch/_types/InnerRetriever.java +++ b/java-client/src/main/java/co/elastic/clients/elasticsearch/_types/InnerRetriever.java @@ -61,8 +61,10 @@ public class InnerRetriever implements JsonpSerializable { private final Retriever retriever; - private final float weight; + @Nullable + private final Float weight; + @Nullable private final ScoreNormalizer normalizer; // --------------------------------------------------------------------------------------------- @@ -70,8 +72,8 @@ public class InnerRetriever implements JsonpSerializable { private InnerRetriever(Builder builder) { this.retriever = ApiTypeHelper.requireNonNull(builder.retriever, this, "retriever"); - this.weight = ApiTypeHelper.requireNonNull(builder.weight, this, "weight", 0); - this.normalizer = ApiTypeHelper.requireNonNull(builder.normalizer, this, "normalizer"); + this.weight = builder.weight; + this.normalizer = builder.normalizer; } @@ -80,22 +82,33 @@ public static InnerRetriever of(Function> } /** - * Required - API name: {@code retriever} + * Required - The nested retriever configuration. + *

+ * API name: {@code retriever} */ public final Retriever retriever() { return this.retriever; } /** - * Required - API name: {@code weight} + * Weight multiplier for this retriever's contribution to the linear + * combination. Must be non-negative. + *

+ * API name: {@code weight} */ - public final float weight() { + @Nullable + public final Float weight() { return this.weight; } /** - * Required - API name: {@code normalizer} + * Score normalizer to apply to this retriever's results before weighting. Falls + * back to the top-level normalizer on the linear retriever if + * unset, then to none (identity) if neither is set. + *

+ * API name: {@code normalizer} */ + @Nullable public final ScoreNormalizer normalizer() { return this.normalizer; } @@ -114,11 +127,15 @@ protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { generator.writeKey("retriever"); this.retriever.serialize(generator, mapper); - generator.writeKey("weight"); - generator.write(this.weight); + if (this.weight != null) { + generator.writeKey("weight"); + generator.write(this.weight); - generator.writeKey("normalizer"); - this.normalizer.serialize(generator, mapper); + } + if (this.normalizer != null) { + generator.writeKey("normalizer"); + this.normalizer.serialize(generator, mapper); + } } @@ -136,8 +153,10 @@ public String toString() { public static class Builder extends WithJsonObjectBuilderBase implements ObjectBuilder { private Retriever retriever; + @Nullable private Float weight; + @Nullable private ScoreNormalizer normalizer; public Builder() { @@ -149,7 +168,9 @@ private Builder(InnerRetriever instance) { } /** - * Required - API name: {@code retriever} + * Required - The nested retriever configuration. + *

+ * API name: {@code retriever} */ public final Builder retriever(Retriever value) { this.retriever = value; @@ -157,14 +178,18 @@ public final Builder retriever(Retriever value) { } /** - * Required - API name: {@code retriever} + * Required - The nested retriever configuration. + *

+ * API name: {@code retriever} */ public final Builder retriever(Function> fn) { return this.retriever(fn.apply(new Retriever.Builder()).build()); } /** - * Required - API name: {@code retriever} + * Required - The nested retriever configuration. + *

+ * API name: {@code retriever} */ public final Builder retriever(RetrieverVariant value) { this.retriever = value._toRetriever(); @@ -172,17 +197,24 @@ public final Builder retriever(RetrieverVariant value) { } /** - * Required - API name: {@code weight} + * Weight multiplier for this retriever's contribution to the linear + * combination. Must be non-negative. + *

+ * API name: {@code weight} */ - public final Builder weight(float value) { + public final Builder weight(@Nullable Float value) { this.weight = value; return this; } /** - * Required - API name: {@code normalizer} + * Score normalizer to apply to this retriever's results before weighting. Falls + * back to the top-level normalizer on the linear retriever if + * unset, then to none (identity) if neither is set. + *

+ * API name: {@code normalizer} */ - public final Builder normalizer(ScoreNormalizer value) { + public final Builder normalizer(@Nullable ScoreNormalizer value) { this.normalizer = value; return this; } diff --git a/java-client/src/main/java/co/elastic/clients/elasticsearch/_types/KnnRetriever.java b/java-client/src/main/java/co/elastic/clients/elasticsearch/_types/KnnRetriever.java index 5dfb7d454a..23efbc0e66 100644 --- a/java-client/src/main/java/co/elastic/clients/elasticsearch/_types/KnnRetriever.java +++ b/java-client/src/main/java/co/elastic/clients/elasticsearch/_types/KnnRetriever.java @@ -68,7 +68,8 @@ public class KnnRetriever extends RetrieverBase implements RetrieverVariant { private final int k; - private final int numCandidates; + @Nullable + private final Integer numCandidates; @Nullable private final Float visitPercentage; @@ -88,7 +89,7 @@ private KnnRetriever(Builder builder) { this.queryVector = ApiTypeHelper.unmodifiable(builder.queryVector); this.queryVectorBuilder = builder.queryVectorBuilder; this.k = ApiTypeHelper.requireNonNull(builder.k, this, "k", 0); - this.numCandidates = ApiTypeHelper.requireNonNull(builder.numCandidates, this, "numCandidates", 0); + this.numCandidates = builder.numCandidates; this.visitPercentage = builder.visitPercentage; this.similarity = builder.similarity; this.rescoreVector = builder.rescoreVector; @@ -147,11 +148,12 @@ public final int k() { } /** - * Required - Number of nearest neighbor candidates to consider per shard. + * Number of nearest neighbor candidates to consider per shard. *

* API name: {@code num_candidates} */ - public final int numCandidates() { + @Nullable + public final Integer numCandidates() { return this.numCandidates; } @@ -210,9 +212,11 @@ protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { generator.writeKey("k"); generator.write(this.k); - generator.writeKey("num_candidates"); - generator.write(this.numCandidates); + if (this.numCandidates != null) { + generator.writeKey("num_candidates"); + generator.write(this.numCandidates); + } if (this.visitPercentage != null) { generator.writeKey("visit_percentage"); generator.write(this.visitPercentage); @@ -248,6 +252,7 @@ public static class Builder extends RetrieverBase.AbstractBuilder imple private Integer k; + @Nullable private Integer numCandidates; @Nullable @@ -351,11 +356,11 @@ public final Builder k(int value) { } /** - * Required - Number of nearest neighbor candidates to consider per shard. + * Number of nearest neighbor candidates to consider per shard. *

* API name: {@code num_candidates} */ - public final Builder numCandidates(int value) { + public final Builder numCandidates(@Nullable Integer value) { this.numCandidates = value; return this; } diff --git a/java-client/src/main/java/co/elastic/clients/elasticsearch/_types/mapping/DenseVectorIndexOptions.java b/java-client/src/main/java/co/elastic/clients/elasticsearch/_types/mapping/DenseVectorIndexOptions.java index 3435ead818..9012e03463 100644 --- a/java-client/src/main/java/co/elastic/clients/elasticsearch/_types/mapping/DenseVectorIndexOptions.java +++ b/java-client/src/main/java/co/elastic/clients/elasticsearch/_types/mapping/DenseVectorIndexOptions.java @@ -82,6 +82,21 @@ public class DenseVectorIndexOptions implements JsonpSerializable { @Nullable private final Integer flatIndexThreshold; + @Nullable + private final Integer clusterSize; + + @Nullable + private final Float defaultVisitPercentage; + + @Nullable + private final Integer bits; + + @Nullable + private final Boolean precondition; + + @Nullable + private final Boolean autoCalibrate; + // --------------------------------------------------------------------------------------------- private DenseVectorIndexOptions(Builder builder) { @@ -93,6 +108,11 @@ private DenseVectorIndexOptions(Builder builder) { this.rescoreVector = builder.rescoreVector; this.onDiskRescore = builder.onDiskRescore; this.flatIndexThreshold = builder.flatIndexThreshold; + this.clusterSize = builder.clusterSize; + this.defaultVisitPercentage = builder.defaultVisitPercentage; + this.bits = builder.bits; + this.precondition = builder.precondition; + this.autoCalibrate = builder.autoCalibrate; } @@ -119,7 +139,10 @@ public static DenseVectorIndexOptions of(Functionint8_flat, and int4_flat index types. *

* API name: {@code confidence_interval} + * + * @deprecated 9.5.0 */ + @Deprecated @Nullable public final Float confidenceInterval() { return this.confidenceInterval; @@ -196,7 +219,8 @@ public final Boolean onDiskRescore() { * value overrides the format default. *

* Only applicable to hnsw, int8_hnsw, - * int4_hnsw, and bbq_hnsw index types. + * int4_hnsw, bbq_hnsw, and bbq_disk + * index types. *

* API name: {@code flat_index_threshold} */ @@ -205,6 +229,70 @@ public final Integer flatIndexThreshold() { return this.flatIndexThreshold; } + /** + * Only applicable to bbq_disk. The number of vectors per cluster. + * Must be between 64 and 65536. + *

+ * API name: {@code cluster_size} + */ + @Nullable + public final Integer clusterSize() { + return this.clusterSize; + } + + /** + * Only applicable to bbq_disk. The percentage of clusters to visit + * during search. Must be between 0 and 100. A value of 0 defaults to using + * num_candidates for calculating the visit percentage. + *

+ * API name: {@code default_visit_percentage} + */ + @Nullable + public final Float defaultVisitPercentage() { + return this.defaultVisitPercentage; + } + + /** + * Only applicable to bbq_disk. The number of bits per dimension + * for quantization encoding. Valid values are 1, 2, + * 4, or 7. When no rescore_vector is + * explicitly set, the default oversampling is automatically adjusted based on + * the bits value. This setting can be changed without reindexing. + *

+ * API name: {@code bits} + */ + @Nullable + public final Integer bits() { + return this.bits; + } + + /** + * Only applicable to bbq_disk. When true, transforms + * indexed vectors using a random orthogonal projection before quantization, + * which can improve accuracy when vector components are not normally + * distributed. Cannot be changed after the field is created. + *

+ * API name: {@code precondition} + */ + @Nullable + public final Boolean precondition() { + return this.precondition; + } + + /** + * Only applicable to bbq_disk. When true, + * Elasticsearch automatically selects the optimal quantization encoding, + * oversampling factor, and preconditioning for each merged segment based on + * estimated recall characteristics. Cannot be changed after the field is + * created. + *

+ * API name: {@code auto_calibrate} + */ + @Nullable + public final Boolean autoCalibrate() { + return this.autoCalibrate; + } + /** * Serialize this object to JSON. */ @@ -248,6 +336,31 @@ protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { generator.write(this.flatIndexThreshold); } + if (this.clusterSize != null) { + generator.writeKey("cluster_size"); + generator.write(this.clusterSize); + + } + if (this.defaultVisitPercentage != null) { + generator.writeKey("default_visit_percentage"); + generator.write(this.defaultVisitPercentage); + + } + if (this.bits != null) { + generator.writeKey("bits"); + generator.write(this.bits); + + } + if (this.precondition != null) { + generator.writeKey("precondition"); + generator.write(this.precondition); + + } + if (this.autoCalibrate != null) { + generator.writeKey("auto_calibrate"); + generator.write(this.autoCalibrate); + + } } @@ -285,6 +398,21 @@ public static class Builder extends WithJsonObjectBuilderBase @Nullable private Integer flatIndexThreshold; + @Nullable + private Integer clusterSize; + + @Nullable + private Float defaultVisitPercentage; + + @Nullable + private Integer bits; + + @Nullable + private Boolean precondition; + + @Nullable + private Boolean autoCalibrate; + public Builder() { } private Builder(DenseVectorIndexOptions instance) { @@ -295,6 +423,11 @@ private Builder(DenseVectorIndexOptions instance) { this.rescoreVector = instance.rescoreVector; this.onDiskRescore = instance.onDiskRescore; this.flatIndexThreshold = instance.flatIndexThreshold; + this.clusterSize = instance.clusterSize; + this.defaultVisitPercentage = instance.defaultVisitPercentage; + this.bits = instance.bits; + this.precondition = instance.precondition; + this.autoCalibrate = instance.autoCalibrate; } /** @@ -316,7 +449,10 @@ private Builder(DenseVectorIndexOptions instance) { * int8_flat, and int4_flat index types. *

* API name: {@code confidence_interval} + * + * @deprecated 9.5.0 */ + @Deprecated public final Builder confidenceInterval(@Nullable Float value) { this.confidenceInterval = value; return this; @@ -407,7 +543,8 @@ public final Builder onDiskRescore(@Nullable Boolean value) { * value overrides the format default. *

* Only applicable to hnsw, int8_hnsw, - * int4_hnsw, and bbq_hnsw index types. + * int4_hnsw, bbq_hnsw, and bbq_disk + * index types. *

* API name: {@code flat_index_threshold} */ @@ -416,6 +553,70 @@ public final Builder flatIndexThreshold(@Nullable Integer value) { return this; } + /** + * Only applicable to bbq_disk. The number of vectors per cluster. + * Must be between 64 and 65536. + *

+ * API name: {@code cluster_size} + */ + public final Builder clusterSize(@Nullable Integer value) { + this.clusterSize = value; + return this; + } + + /** + * Only applicable to bbq_disk. The percentage of clusters to visit + * during search. Must be between 0 and 100. A value of 0 defaults to using + * num_candidates for calculating the visit percentage. + *

+ * API name: {@code default_visit_percentage} + */ + public final Builder defaultVisitPercentage(@Nullable Float value) { + this.defaultVisitPercentage = value; + return this; + } + + /** + * Only applicable to bbq_disk. The number of bits per dimension + * for quantization encoding. Valid values are 1, 2, + * 4, or 7. When no rescore_vector is + * explicitly set, the default oversampling is automatically adjusted based on + * the bits value. This setting can be changed without reindexing. + *

+ * API name: {@code bits} + */ + public final Builder bits(@Nullable Integer value) { + this.bits = value; + return this; + } + + /** + * Only applicable to bbq_disk. When true, transforms + * indexed vectors using a random orthogonal projection before quantization, + * which can improve accuracy when vector components are not normally + * distributed. Cannot be changed after the field is created. + *

+ * API name: {@code precondition} + */ + public final Builder precondition(@Nullable Boolean value) { + this.precondition = value; + return this; + } + + /** + * Only applicable to bbq_disk. When true, + * Elasticsearch automatically selects the optimal quantization encoding, + * oversampling factor, and preconditioning for each merged segment based on + * estimated recall characteristics. Cannot be changed after the field is + * created. + *

+ * API name: {@code auto_calibrate} + */ + public final Builder autoCalibrate(@Nullable Boolean value) { + this.autoCalibrate = value; + return this; + } + @Override protected Builder self() { return this; @@ -458,6 +659,11 @@ protected static void setupDenseVectorIndexOptionsDeserializer( op.add(Builder::rescoreVector, DenseVectorIndexOptionsRescoreVector._DESERIALIZER, "rescore_vector"); op.add(Builder::onDiskRescore, JsonpDeserializer.booleanDeserializer(), "on_disk_rescore"); op.add(Builder::flatIndexThreshold, JsonpDeserializer.integerDeserializer(), "flat_index_threshold"); + op.add(Builder::clusterSize, JsonpDeserializer.integerDeserializer(), "cluster_size"); + op.add(Builder::defaultVisitPercentage, JsonpDeserializer.floatDeserializer(), "default_visit_percentage"); + op.add(Builder::bits, JsonpDeserializer.integerDeserializer(), "bits"); + op.add(Builder::precondition, JsonpDeserializer.booleanDeserializer(), "precondition"); + op.add(Builder::autoCalibrate, JsonpDeserializer.booleanDeserializer(), "auto_calibrate"); } diff --git a/java-client/src/main/java/co/elastic/clients/elasticsearch/_types/mapping/SemanticTextProperty.java b/java-client/src/main/java/co/elastic/clients/elasticsearch/_types/mapping/SemanticTextProperty.java index 04eb762d6a..f0ca987f3b 100644 --- a/java-client/src/main/java/co/elastic/clients/elasticsearch/_types/mapping/SemanticTextProperty.java +++ b/java-client/src/main/java/co/elastic/clients/elasticsearch/_types/mapping/SemanticTextProperty.java @@ -113,7 +113,12 @@ public final Map meta() { * Inference endpoint that will be used to generate embeddings for the field. * This parameter cannot be updated. Use the Create inference API to create the * endpoint. If search_inference_id is specified, the inference - * endpoint will only be used at index time. + * endpoint will only be used at index time. If the inference_id is + * not specified, it will default to .jina-embeddings-v5-text-small + * if the cluster is authorized to use the Elastic Inference Service, otherwise + * it will default to .elser-2-elasticsearch. The + * .elser-2-elasticsearch inference endpoint relies on a local ML + * node to run the ELSER model. *

* API name: {@code inference_id} */ @@ -296,7 +301,12 @@ public final Builder meta(String key, String value) { * Inference endpoint that will be used to generate embeddings for the field. * This parameter cannot be updated. Use the Create inference API to create the * endpoint. If search_inference_id is specified, the inference - * endpoint will only be used at index time. + * endpoint will only be used at index time. If the inference_id is + * not specified, it will default to .jina-embeddings-v5-text-small + * if the cluster is authorized to use the Elastic Inference Service, otherwise + * it will default to .elser-2-elasticsearch. The + * .elser-2-elasticsearch inference endpoint relies on a local ML + * node to run the ELSER model. *

* API name: {@code inference_id} */ diff --git a/java-client/src/main/java/co/elastic/clients/elasticsearch/_types/mapping/SourceFieldMode.java b/java-client/src/main/java/co/elastic/clients/elasticsearch/_types/mapping/SourceFieldMode.java index 0edfa6b561..b090d5f6db 100644 --- a/java-client/src/main/java/co/elastic/clients/elasticsearch/_types/mapping/SourceFieldMode.java +++ b/java-client/src/main/java/co/elastic/clients/elasticsearch/_types/mapping/SourceFieldMode.java @@ -50,6 +50,8 @@ public enum SourceFieldMode implements JsonEnum { Stored("stored"), + ColumnarStored("columnar_stored"), + /** * Instead of storing source documents on disk exactly as you send them, * Elasticsearch can reconstruct source content on the fly upon retrieval. diff --git a/java-client/src/main/java/co/elastic/clients/elasticsearch/cat/CatRecoveryColumn.java b/java-client/src/main/java/co/elastic/clients/elasticsearch/cat/CatRecoveryColumn.java index d0341c62e3..7631f49977 100644 --- a/java-client/src/main/java/co/elastic/clients/elasticsearch/cat/CatRecoveryColumn.java +++ b/java-client/src/main/java/co/elastic/clients/elasticsearch/cat/CatRecoveryColumn.java @@ -90,6 +90,17 @@ public enum CatRecoveryColumn implements JsonEnum { */ Stage("stage", "st"), + /** + * The number of times this recovery has failed in a way which is retried + * locally (i.e. on the data node). + */ + LocalRetries("local_retries", "lr"), + + /** + * The recovery priority. + */ + Priority("priority", "pr"), + /** * The source host. */ diff --git a/java-client/src/main/java/co/elastic/clients/elasticsearch/cat/RecoveryRequest.java b/java-client/src/main/java/co/elastic/clients/elasticsearch/cat/RecoveryRequest.java index 5678c9b78d..060e94e46a 100644 --- a/java-client/src/main/java/co/elastic/clients/elasticsearch/cat/RecoveryRequest.java +++ b/java-client/src/main/java/co/elastic/clients/elasticsearch/cat/RecoveryRequest.java @@ -113,7 +113,8 @@ public static RecoveryRequest of(Functiontrue, the response only includes ongoing shard recoveries. + * If true, the response only includes shard recoveries that have + * not yet completed (excludes done stage). *

* API name: {@code active_only} */ @@ -242,7 +243,8 @@ private Builder(RecoveryRequest instance) { } /** - * If true, the response only includes ongoing shard recoveries. + * If true, the response only includes shard recoveries that have + * not yet completed (excludes done stage). *

* API name: {@code active_only} */ diff --git a/java-client/src/main/java/co/elastic/clients/elasticsearch/cat/recovery/RecoveryRecord.java b/java-client/src/main/java/co/elastic/clients/elasticsearch/cat/recovery/RecoveryRecord.java index c8c613c68e..c5784e6199 100644 --- a/java-client/src/main/java/co/elastic/clients/elasticsearch/cat/recovery/RecoveryRecord.java +++ b/java-client/src/main/java/co/elastic/clients/elasticsearch/cat/recovery/RecoveryRecord.java @@ -31,6 +31,7 @@ import co.elastic.clients.util.ObjectBuilder; import co.elastic.clients.util.WithJsonObjectBuilderBase; import jakarta.json.stream.JsonGenerator; +import java.lang.Integer; import java.lang.Long; import java.lang.String; import java.util.Objects; @@ -88,6 +89,12 @@ public class RecoveryRecord implements JsonpSerializable { @Nullable private final String stage; + @Nullable + private final Integer localRetries; + + @Nullable + private final String priority; + @Nullable private final String sourceHost; @@ -152,6 +159,8 @@ private RecoveryRecord(Builder builder) { this.time = builder.time; this.type = builder.type; this.stage = builder.stage; + this.localRetries = builder.localRetries; + this.priority = builder.priority; this.sourceHost = builder.sourceHost; this.sourceNode = builder.sourceNode; this.targetHost = builder.targetHost; @@ -197,7 +206,8 @@ public final String shard() { } /** - * The recovery start time. + * The recovery start time. For recoveries in the created stage + * (not yet started), this value is the Unix epoch (1970-01-01T00:00:00.000Z). *

* API name: {@code start_time} */ @@ -207,7 +217,8 @@ public final DateTime startTime() { } /** - * The recovery start time in epoch milliseconds. + * The recovery start time in epoch milliseconds. For recoveries in the + * created stage (not yet started), this value is 0. *

* API name: {@code start_time_millis} */ @@ -217,7 +228,8 @@ public final Long startTimeMillis() { } /** - * The recovery stop time. + * The recovery stop time. For recoveries that have not yet completed, this + * value is the Unix epoch (1970-01-01T00:00:00.000Z). *

* API name: {@code stop_time} */ @@ -227,7 +239,8 @@ public final DateTime stopTime() { } /** - * The recovery stop time in epoch milliseconds. + * The recovery stop time in epoch milliseconds. For recoveries that have not + * yet completed, this value is 0. *

* API name: {@code stop_time_millis} */ @@ -237,7 +250,8 @@ public final Long stopTimeMillis() { } /** - * The recovery time. + * The recovery time. For recoveries in the created stage (not yet + * started), this value is 0. *

* API name: {@code time} */ @@ -266,6 +280,27 @@ public final String stage() { return this.stage; } + /** + * The number of times this recovery has failed in a way which is retried + * locally (i.e. on the data node). + *

+ * API name: {@code local_retries} + */ + @Nullable + public final Integer localRetries() { + return this.localRetries; + } + + /** + * The recovery priority. + *

+ * API name: {@code priority} + */ + @Nullable + public final String priority() { + return this.priority; + } + /** * The source host. *

@@ -489,6 +524,16 @@ protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { generator.writeKey("stage"); generator.write(this.stage); + } + if (this.localRetries != null) { + generator.writeKey("local_retries"); + generator.write(this.localRetries); + + } + if (this.priority != null) { + generator.writeKey("priority"); + generator.write(this.priority); + } if (this.sourceHost != null) { generator.writeKey("source_host"); @@ -617,6 +662,12 @@ public static class Builder extends WithJsonObjectBuilderBase implement @Nullable private String stage; + @Nullable + private Integer localRetries; + + @Nullable + private String priority; + @Nullable private String sourceHost; @@ -680,6 +731,8 @@ private Builder(RecoveryRecord instance) { this.time = instance.time; this.type = instance.type; this.stage = instance.stage; + this.localRetries = instance.localRetries; + this.priority = instance.priority; this.sourceHost = instance.sourceHost; this.sourceNode = instance.sourceNode; this.targetHost = instance.targetHost; @@ -720,7 +773,8 @@ public final Builder shard(@Nullable String value) { } /** - * The recovery start time. + * The recovery start time. For recoveries in the created stage + * (not yet started), this value is the Unix epoch (1970-01-01T00:00:00.000Z). *

* API name: {@code start_time} */ @@ -730,7 +784,8 @@ public final Builder startTime(@Nullable DateTime value) { } /** - * The recovery start time in epoch milliseconds. + * The recovery start time in epoch milliseconds. For recoveries in the + * created stage (not yet started), this value is 0. *

* API name: {@code start_time_millis} */ @@ -740,7 +795,8 @@ public final Builder startTimeMillis(@Nullable Long value) { } /** - * The recovery stop time. + * The recovery stop time. For recoveries that have not yet completed, this + * value is the Unix epoch (1970-01-01T00:00:00.000Z). *

* API name: {@code stop_time} */ @@ -750,7 +806,8 @@ public final Builder stopTime(@Nullable DateTime value) { } /** - * The recovery stop time in epoch milliseconds. + * The recovery stop time in epoch milliseconds. For recoveries that have not + * yet completed, this value is 0. *

* API name: {@code stop_time_millis} */ @@ -760,7 +817,8 @@ public final Builder stopTimeMillis(@Nullable Long value) { } /** - * The recovery time. + * The recovery time. For recoveries in the created stage (not yet + * started), this value is 0. *

* API name: {@code time} */ @@ -770,7 +828,8 @@ public final Builder time(@Nullable Time value) { } /** - * The recovery time. + * The recovery time. For recoveries in the created stage (not yet + * started), this value is 0. *

* API name: {@code time} */ @@ -798,6 +857,27 @@ public final Builder stage(@Nullable String value) { return this; } + /** + * The number of times this recovery has failed in a way which is retried + * locally (i.e. on the data node). + *

+ * API name: {@code local_retries} + */ + public final Builder localRetries(@Nullable Integer value) { + this.localRetries = value; + return this; + } + + /** + * The recovery priority. + *

+ * API name: {@code priority} + */ + public final Builder priority(@Nullable String value) { + this.priority = value; + return this; + } + /** * The source host. *

@@ -1011,6 +1091,8 @@ protected static void setupRecoveryRecordDeserializer(ObjectDeserializerElasticsearch API specification - Please see the Elasticsearch API specification. + Please see the Elasticsearch API specification. diff --git a/java-client/src/main/java/co/elastic/clients/elasticsearch/esql/ESQLView.java b/java-client/src/main/java/co/elastic/clients/elasticsearch/esql/ESQLView.java index aa51461a6f..d90b89cd8a 100644 --- a/java-client/src/main/java/co/elastic/clients/elasticsearch/esql/ESQLView.java +++ b/java-client/src/main/java/co/elastic/clients/elasticsearch/esql/ESQLView.java @@ -64,12 +64,16 @@ public class ESQLView implements JsonpSerializable { private final String query; + @Nullable + private final String description; + // --------------------------------------------------------------------------------------------- private ESQLView(Builder builder) { this.name = ApiTypeHelper.requireNonNull(builder.name, this, "name"); this.query = ApiTypeHelper.requireNonNull(builder.query, this, "query"); + this.description = builder.description; } @@ -95,6 +99,16 @@ public final String query() { return this.query; } + /** + * A free-text description of the view. + *

+ * API name: {@code description} + */ + @Nullable + public final String description() { + return this.description; + } + /** * Serialize this object to JSON. */ @@ -112,6 +126,12 @@ protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { generator.writeKey("query"); generator.write(this.query); + if (this.description != null) { + generator.writeKey("description"); + generator.write(this.description); + + } + } @Override @@ -130,11 +150,15 @@ public static class Builder extends WithJsonObjectBuilderBase implement private String query; + @Nullable + private String description; + public Builder() { } private Builder(ESQLView instance) { this.name = instance.name; this.query = instance.query; + this.description = instance.description; } /** @@ -157,6 +181,16 @@ public final Builder query(String value) { return this; } + /** + * A free-text description of the view. + *

+ * API name: {@code description} + */ + public final Builder description(@Nullable String value) { + this.description = value; + return this; + } + @Override protected Builder self() { return this; @@ -193,6 +227,7 @@ protected static void setupESQLViewDeserializer(ObjectDeserializer> return fn.apply(new Builder()).build(); } + /** + * A free-text description of the view. + *

+ * API name: {@code description} + */ + @Nullable + public final String description() { + return this.description; + } + /** * Required - The view name to create or update. *

@@ -111,6 +125,11 @@ public void serialize(JsonGenerator generator, JsonpMapper mapper) { protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { + if (this.description != null) { + generator.writeKey("description"); + generator.write(this.description); + + } generator.writeKey("query"); generator.write(this.query); @@ -123,6 +142,9 @@ protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { */ public static class Builder extends RequestBase.AbstractBuilder implements ObjectBuilder { + @Nullable + private String description; + private String name; private String query; @@ -130,10 +152,21 @@ public static class Builder extends RequestBase.AbstractBuilder impleme public Builder() { } private Builder(PutViewRequest instance) { + this.description = instance.description; this.name = instance.name; this.query = instance.query; } + /** + * A free-text description of the view. + *

+ * API name: {@code description} + */ + public final Builder description(@Nullable String value) { + this.description = value; + return this; + } + /** * Required - The view name to create or update. *

@@ -188,6 +221,7 @@ public Builder rebuild() { protected static void setupPutViewRequestDeserializer(ObjectDeserializer op) { + op.add(Builder::description, JsonpDeserializer.stringDeserializer(), "description"); op.add(Builder::query, JsonpDeserializer.stringDeserializer(), "query"); } diff --git a/java-client/src/main/java/co/elastic/clients/elasticsearch/indices/RecoveryRequest.java b/java-client/src/main/java/co/elastic/clients/elasticsearch/indices/RecoveryRequest.java index f25bf21c39..29d974ecad 100644 --- a/java-client/src/main/java/co/elastic/clients/elasticsearch/indices/RecoveryRequest.java +++ b/java-client/src/main/java/co/elastic/clients/elasticsearch/indices/RecoveryRequest.java @@ -135,7 +135,8 @@ public static RecoveryRequest of(Functiontrue, the response only includes ongoing shard recoveries. + * If true, the response only includes shard recoveries that have + * not yet completed (excludes DONE stage). *

* API name: {@code active_only} */ @@ -244,7 +245,8 @@ private Builder(RecoveryRequest instance) { } /** - * If true, the response only includes ongoing shard recoveries. + * If true, the response only includes shard recoveries that have + * not yet completed (excludes DONE stage). *

* API name: {@code active_only} */ diff --git a/java-client/src/main/java/co/elastic/clients/elasticsearch/indices/recovery/RecoveryPriority.java b/java-client/src/main/java/co/elastic/clients/elasticsearch/indices/recovery/RecoveryPriority.java new file mode 100644 index 0000000000..450658bc01 --- /dev/null +++ b/java-client/src/main/java/co/elastic/clients/elasticsearch/indices/recovery/RecoveryPriority.java @@ -0,0 +1,103 @@ +/* + * Licensed to Elasticsearch B.V. under one or more contributor + * license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright + * ownership. Elasticsearch B.V. licenses this file to you under + * the Apache License, Version 2.0 (the "License"); you may + * not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +package co.elastic.clients.elasticsearch.indices.recovery; + +import co.elastic.clients.json.JsonEnum; +import co.elastic.clients.json.JsonpDeserializable; +import co.elastic.clients.json.JsonpDeserializer; + +//---------------------------------------------------------------- +// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. +//---------------------------------------------------------------- +// +// This code is generated from the Elasticsearch API specification +// at https://github.com/elastic/elasticsearch-specification +// +// Manual updates to this file will be lost when the code is +// re-generated. +// +// If you find a property that is missing or wrongly typed, please +// open an issue or a PR on the API specification repository. +// +//---------------------------------------------------------------- + +/** + * + * @see API + * specification + */ +@JsonpDeserializable +public enum RecoveryPriority implements JsonEnum { + /** + * A primary shard which is unassigned because it is newly created. + */ + UnassignedNewPrimary("UNASSIGNED_NEW_PRIMARY"), + + /** + * A shard which is unassigned because of an unexpected condition, i.e. some + * kind of failure. + */ + UnassignedUnexpected("UNASSIGNED_UNEXPECTED"), + + /** + * A shard which is unassigned for an expected condition, i.e. because of a user + * operation such as opening or restoring an index, but which is not an + * UNASSIGNED_NEW_PRIMARY. + */ + UnassignedExpected("UNASSIGNED_EXPECTED"), + + /** + * A shard which is assigned, and is being relocated because it cannot remain on + * its current node according to the allocation deciders. + */ + RelocationCanRemainNo("RELOCATION_CAN_REMAIN_NO"), + + /** + * A shard which is assigned, and is being relocated because it is not preferred + * for it to remain on its current node according to the allocation deciders. + */ + RelocationCanRemainNotPreferred("RELOCATION_CAN_REMAIN_NOT_PREFERRED"), + + /** + * A shard which is assigned, and is being relocated for rebalancing. + */ + RelocateRebalancing("RELOCATE_REBALANCING"), + + /** + * Placeholder value for unknown priorities. + */ + Unknown("UNKNOWN"), + + ; + + private final String jsonValue; + + RecoveryPriority(String jsonValue) { + this.jsonValue = jsonValue; + } + + public String jsonValue() { + return this.jsonValue; + } + + public static final JsonEnum.Deserializer _DESERIALIZER = new JsonEnum.Deserializer<>( + RecoveryPriority.values()); +} diff --git a/java-client/src/main/java/co/elastic/clients/elasticsearch/indices/recovery/RecoveryStage.java b/java-client/src/main/java/co/elastic/clients/elasticsearch/indices/recovery/RecoveryStage.java index da866eb214..c664ff65c3 100644 --- a/java-client/src/main/java/co/elastic/clients/elasticsearch/indices/recovery/RecoveryStage.java +++ b/java-client/src/main/java/co/elastic/clients/elasticsearch/indices/recovery/RecoveryStage.java @@ -47,7 +47,13 @@ @JsonpDeserializable public enum RecoveryStage implements JsonEnum { /** - * Recovery has not started. + * The shard's recovery state has been created, but the recovery has not started + * yet (it may be queued behind other ongoing recoveries). + */ + Created("CREATED"), + + /** + * Recovery has started and is initializing. */ Init("INIT"), diff --git a/java-client/src/main/java/co/elastic/clients/elasticsearch/indices/recovery/ShardRecovery.java b/java-client/src/main/java/co/elastic/clients/elasticsearch/indices/recovery/ShardRecovery.java index 7e67d4a05c..c091485e99 100644 --- a/java-client/src/main/java/co/elastic/clients/elasticsearch/indices/recovery/ShardRecovery.java +++ b/java-client/src/main/java/co/elastic/clients/elasticsearch/indices/recovery/ShardRecovery.java @@ -33,6 +33,7 @@ import co.elastic.clients.util.WithJsonObjectBuilderBase; import jakarta.json.stream.JsonGenerator; import java.lang.Boolean; +import java.lang.Integer; import java.lang.Long; import java.util.Objects; import java.util.function.Function; @@ -73,6 +74,12 @@ public class ShardRecovery implements JsonpSerializable { private final RecoveryStage stage; + @Nullable + private final Integer localRetries; + + @Nullable + private final RecoveryPriority priority; + @Nullable private final RecoveryStartStatus start; @@ -109,6 +116,8 @@ private ShardRecovery(Builder builder) { this.primary = ApiTypeHelper.requireNonNull(builder.primary, this, "primary", false); this.source = ApiTypeHelper.requireNonNull(builder.source, this, "source"); this.stage = ApiTypeHelper.requireNonNull(builder.stage, this, "stage"); + this.localRetries = builder.localRetries; + this.priority = builder.priority; this.start = builder.start; this.startTime = builder.startTime; this.startTimeInMillis = ApiTypeHelper.requireNonNull(builder.startTimeInMillis, this, "startTimeInMillis", 0); @@ -164,6 +173,27 @@ public final RecoveryStage stage() { return this.stage; } + /** + * The number of times this recovery has failed in a way which is retried + * locally (i.e. on the data node). + *

+ * API name: {@code local_retries} + */ + @Nullable + public final Integer localRetries() { + return this.localRetries; + } + + /** + * The recovery priority. + *

+ * API name: {@code priority} + */ + @Nullable + public final RecoveryPriority priority() { + return this.priority; + } + /** * API name: {@code start} */ @@ -173,6 +203,10 @@ public final RecoveryStartStatus start() { } /** + * The time the recovery started. For recoveries in the CREATED + * stage (not yet started), this value is the Unix epoch + * (1970-01-01T00:00:00.000Z). + *

* API name: {@code start_time} */ @Nullable @@ -181,13 +215,20 @@ public final DateTime startTime() { } /** - * Required - API name: {@code start_time_in_millis} + * Required - The time the recovery started, in milliseconds since the Unix + * epoch. For recoveries in the CREATED stage (not yet started), + * this value is 0. + *

+ * API name: {@code start_time_in_millis} */ public final long startTimeInMillis() { return this.startTimeInMillis; } /** + * The time the recovery completed. Only present for completed recoveries + * (DONE stage). + *

* API name: {@code stop_time} */ @Nullable @@ -196,6 +237,9 @@ public final DateTime stopTime() { } /** + * The time the recovery completed, in milliseconds since the Unix epoch. Only + * present for completed recoveries (DONE stage). + *

* API name: {@code stop_time_in_millis} */ @Nullable @@ -219,7 +263,10 @@ public final Time totalTime() { } /** - * Required - API name: {@code total_time_in_millis} + * Required - The total elapsed recovery time in milliseconds. For recoveries in + * the CREATED stage (not yet started), this value is 0. + *

+ * API name: {@code total_time_in_millis} */ public final long totalTimeInMillis() { return this.totalTimeInMillis; @@ -273,6 +320,15 @@ protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { generator.writeKey("stage"); this.stage.serialize(generator, mapper); + if (this.localRetries != null) { + generator.writeKey("local_retries"); + generator.write(this.localRetries); + + } + if (this.priority != null) { + generator.writeKey("priority"); + this.priority.serialize(generator, mapper); + } if (this.start != null) { generator.writeKey("start"); this.start.serialize(generator, mapper); @@ -337,6 +393,12 @@ public static class Builder extends WithJsonObjectBuilderBase implement private RecoveryStage stage; + @Nullable + private Integer localRetries; + + @Nullable + private RecoveryPriority priority; + @Nullable private RecoveryStartStatus start; @@ -372,6 +434,8 @@ private Builder(ShardRecovery instance) { this.primary = instance.primary; this.source = instance.source; this.stage = instance.stage; + this.localRetries = instance.localRetries; + this.priority = instance.priority; this.start = instance.start; this.startTime = instance.startTime; this.startTimeInMillis = instance.startTimeInMillis; @@ -441,6 +505,27 @@ public final Builder stage(RecoveryStage value) { return this; } + /** + * The number of times this recovery has failed in a way which is retried + * locally (i.e. on the data node). + *

+ * API name: {@code local_retries} + */ + public final Builder localRetries(@Nullable Integer value) { + this.localRetries = value; + return this; + } + + /** + * The recovery priority. + *

+ * API name: {@code priority} + */ + public final Builder priority(@Nullable RecoveryPriority value) { + this.priority = value; + return this; + } + /** * API name: {@code start} */ @@ -457,6 +542,10 @@ public final Builder start(FunctionCREATED + * stage (not yet started), this value is the Unix epoch + * (1970-01-01T00:00:00.000Z). + *

* API name: {@code start_time} */ public final Builder startTime(@Nullable DateTime value) { @@ -465,7 +554,11 @@ public final Builder startTime(@Nullable DateTime value) { } /** - * Required - API name: {@code start_time_in_millis} + * Required - The time the recovery started, in milliseconds since the Unix + * epoch. For recoveries in the CREATED stage (not yet started), + * this value is 0. + *

+ * API name: {@code start_time_in_millis} */ public final Builder startTimeInMillis(long value) { this.startTimeInMillis = value; @@ -473,6 +566,9 @@ public final Builder startTimeInMillis(long value) { } /** + * The time the recovery completed. Only present for completed recoveries + * (DONE stage). + *

* API name: {@code stop_time} */ public final Builder stopTime(@Nullable DateTime value) { @@ -481,6 +577,9 @@ public final Builder stopTime(@Nullable DateTime value) { } /** + * The time the recovery completed, in milliseconds since the Unix epoch. Only + * present for completed recoveries (DONE stage). + *

* API name: {@code stop_time_in_millis} */ public final Builder stopTimeInMillis(@Nullable Long value) { @@ -519,7 +618,10 @@ public final Builder totalTime(Function> fn) { } /** - * Required - API name: {@code total_time_in_millis} + * Required - The total elapsed recovery time in milliseconds. For recoveries in + * the CREATED stage (not yet started), this value is 0. + *

+ * API name: {@code total_time_in_millis} */ public final Builder totalTimeInMillis(long value) { this.totalTimeInMillis = value; @@ -605,6 +707,8 @@ protected static void setupShardRecoveryDeserializer(ObjectDeserializer_alias:_origin, _alias:prod-*. If omitted, searches + * all linked projects within the cross-project search scope. Rejected when CPS + * is not enabled for datafeeds. + *

+ * API name: {@code project_routing} + */ + @Nullable + public final String projectRouting() { + return this.projectRouting; + } + /** * Serialize this object to JSON. */ @@ -380,6 +398,11 @@ protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { this.indicesOptions.serialize(generator, mapper); } + if (this.projectRouting != null) { + generator.writeKey("project_routing"); + generator.write(this.projectRouting); + + } } @@ -438,6 +461,9 @@ public static class Builder extends WithJsonObjectBuilderBase implement @Nullable private IndicesOptions indicesOptions; + @Nullable + private String projectRouting; + public Builder() { } private Builder(Datafeed instance) { @@ -457,6 +483,7 @@ private Builder(Datafeed instance) { this.delayedDataCheckConfig = instance.delayedDataCheckConfig; this.runtimeMappings = instance.runtimeMappings; this.indicesOptions = instance.indicesOptions; + this.projectRouting = instance.projectRouting; } /** @@ -770,6 +797,20 @@ public final Builder indicesOptions(Function_alias:_origin, _alias:prod-*. If omitted, searches + * all linked projects within the cross-project search scope. Rejected when CPS + * is not enabled for datafeeds. + *

+ * API name: {@code project_routing} + */ + public final Builder projectRouting(@Nullable String value) { + this.projectRouting = value; + return this; + } + @Override protected Builder self() { return this; @@ -825,6 +866,7 @@ protected static void setupDatafeedDeserializer(ObjectDeserializer_alias:_origin, _alias:prod-*. If omitted, searches + * all linked projects within the cross-project search scope. Rejected when CPS + * is not enabled for datafeeds. + *

+ * API name: {@code project_routing} + */ + @Nullable + public final String projectRouting() { + return this.projectRouting; + } + /** * API name: {@code job_id} */ @@ -364,6 +382,11 @@ protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { generator.writeKey("indices_options"); this.indicesOptions.serialize(generator, mapper); + } + if (this.projectRouting != null) { + generator.writeKey("project_routing"); + generator.write(this.projectRouting); + } if (this.jobId != null) { generator.writeKey("job_id"); @@ -448,6 +471,9 @@ public static class Builder extends WithJsonObjectBuilderBase implement @Nullable private IndicesOptions indicesOptions; + @Nullable + private String projectRouting; + @Nullable private String jobId; @@ -479,6 +505,7 @@ private Builder(DatafeedConfig instance) { this.frequency = instance.frequency; this.indices = instance.indices; this.indicesOptions = instance.indicesOptions; + this.projectRouting = instance.projectRouting; this.jobId = instance.jobId; this.maxEmptySearches = instance.maxEmptySearches; this.query = instance.query; @@ -691,6 +718,20 @@ public final Builder indicesOptions(Function_alias:_origin, _alias:prod-*. If omitted, searches + * all linked projects within the cross-project search scope. Rejected when CPS + * is not enabled for datafeeds. + *

+ * API name: {@code project_routing} + */ + public final Builder projectRouting(@Nullable String value) { + this.projectRouting = value; + return this; + } + /** * API name: {@code job_id} */ @@ -914,6 +955,7 @@ protected static void setupDatafeedConfigDeserializer(ObjectDeserializer_alias:_origin, _alias:prod-*. If omitted, searches + * all linked projects within the cross-project search scope. Rejected when CPS + * is not enabled for datafeeds. + *

+ * API name: {@code project_routing} + */ + @Nullable + public final String projectRouting() { + return this.projectRouting; + } + /** * The Elasticsearch query domain-specific language (DSL). This value * corresponds to the query object in an Elasticsearch search POST body. All the @@ -487,6 +505,11 @@ protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { generator.writeKey("max_empty_searches"); generator.write(this.maxEmptySearches); + } + if (this.projectRouting != null) { + generator.writeKey("project_routing"); + generator.write(this.projectRouting); + } if (this.query != null) { generator.writeKey("query"); @@ -578,6 +601,9 @@ public static class Builder extends RequestBase.AbstractBuilder @Nullable private Integer maxEmptySearches; + @Nullable + private String projectRouting; + @Nullable private Query query; @@ -610,6 +636,7 @@ private Builder(PutDatafeedRequest instance) { this.indicesOptions = instance.indicesOptions; this.jobId = instance.jobId; this.maxEmptySearches = instance.maxEmptySearches; + this.projectRouting = instance.projectRouting; this.query = instance.query; this.queryDelay = instance.queryDelay; this.runtimeMappings = instance.runtimeMappings; @@ -934,6 +961,20 @@ public final Builder maxEmptySearches(@Nullable Integer value) { return this; } + /** + * A Lucene-style expression that limits which linked projects the datafeed + * searches when cross-project search is enabled. Examples: + * _alias:_origin, _alias:prod-*. If omitted, searches + * all linked projects within the cross-project search scope. Rejected when CPS + * is not enabled for datafeeds. + *

+ * API name: {@code project_routing} + */ + public final Builder projectRouting(@Nullable String value) { + this.projectRouting = value; + return this; + } + /** * The Elasticsearch query domain-specific language (DSL). This value * corresponds to the query object in an Elasticsearch search POST body. All the @@ -1136,6 +1177,7 @@ protected static void setupPutDatafeedRequestDeserializer(ObjectDeserializer_alias:_origin, _alias:prod-*. If omitted, searches + * all linked projects within the cross-project search scope. Rejected when CPS + * is not enabled for datafeeds. + *

+ * API name: {@code project_routing} + */ + @Nullable + public final String projectRouting() { + return this.projectRouting; + } + /** * Serialize this object to JSON. */ @@ -338,6 +356,12 @@ protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { generator.writeKey("scroll_size"); generator.write(this.scrollSize); + if (this.projectRouting != null) { + generator.writeKey("project_routing"); + generator.write(this.projectRouting); + + } + } @Override @@ -392,6 +416,9 @@ public static class Builder extends WithJsonObjectBuilderBase private Integer scrollSize; + @Nullable + private String projectRouting; + /** * API name: {@code aggregations} *

@@ -657,6 +684,20 @@ public final Builder scrollSize(int value) { return this; } + /** + * A Lucene-style expression that limits which linked projects the datafeed + * searches when cross-project search is enabled. Examples: + * _alias:_origin, _alias:prod-*. If omitted, searches + * all linked projects within the cross-project search scope. Rejected when CPS + * is not enabled for datafeeds. + *

+ * API name: {@code project_routing} + */ + public final Builder projectRouting(@Nullable String value) { + this.projectRouting = value; + return this; + } + @Override protected Builder self() { return this; @@ -704,6 +745,7 @@ protected static void setupPutDatafeedResponseDeserializer(ObjectDeserializer aggregations; @Nullable @@ -118,6 +121,9 @@ public class UpdateDatafeedRequest extends RequestBase implements JsonpSerializa @Nullable private final Integer maxEmptySearches; + @Nullable + private final String projectRouting; + @Nullable private final Query query; @@ -135,6 +141,7 @@ public class UpdateDatafeedRequest extends RequestBase implements JsonpSerializa private UpdateDatafeedRequest(Builder builder) { + this.forceRekeying = builder.forceRekeying; this.aggregations = ApiTypeHelper.unmodifiable(builder.aggregations); this.allowNoIndices = builder.allowNoIndices; this.chunkingConfig = builder.chunkingConfig; @@ -148,6 +155,7 @@ private UpdateDatafeedRequest(Builder builder) { this.indicesOptions = builder.indicesOptions; this.jobId = builder.jobId; this.maxEmptySearches = builder.maxEmptySearches; + this.projectRouting = builder.projectRouting; this.query = builder.query; this.queryDelay = builder.queryDelay; this.runtimeMappings = ApiTypeHelper.unmodifiable(builder.runtimeMappings); @@ -160,6 +168,20 @@ public static UpdateDatafeedRequest of(Function + * API name: {@code _force_rekeying} + */ + @Nullable + public final Boolean forceRekeying() { + return this.forceRekeying; + } + /** * If set, the datafeed performs aggregation searches. Support for aggregations * is limited and should be used only with low cardinality data. @@ -326,6 +348,20 @@ public final Integer maxEmptySearches() { return this.maxEmptySearches; } + /** + * A Lucene-style expression that limits which linked projects the datafeed + * searches when cross-project search is enabled. Examples: + * _alias:_origin, _alias:prod-*. If omitted, searches + * all linked projects within the cross-project search scope. Rejected when CPS + * is not enabled for datafeeds. + *

+ * API name: {@code project_routing} + */ + @Nullable + public final String projectRouting() { + return this.projectRouting; + } + /** * The Elasticsearch query domain-specific language (DSL). This value * corresponds to the query object in an Elasticsearch search POST body. All the @@ -402,6 +438,11 @@ public void serialize(JsonGenerator generator, JsonpMapper mapper) { protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { + if (this.forceRekeying != null) { + generator.writeKey("_force_rekeying"); + generator.write(this.forceRekeying); + + } if (ApiTypeHelper.isDefined(this.aggregations)) { generator.writeKey("aggregations"); generator.writeStartObject(); @@ -452,6 +493,11 @@ protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { generator.writeKey("max_empty_searches"); generator.write(this.maxEmptySearches); + } + if (this.projectRouting != null) { + generator.writeKey("project_routing"); + generator.write(this.projectRouting); + } if (this.query != null) { generator.writeKey("query"); @@ -502,6 +548,9 @@ protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { public static class Builder extends RequestBase.AbstractBuilder implements ObjectBuilder { + @Nullable + private Boolean forceRekeying; + @Nullable private Map aggregations; @@ -540,6 +589,9 @@ public static class Builder extends RequestBase.AbstractBuilder @Nullable private Integer maxEmptySearches; + @Nullable + private String projectRouting; + @Nullable private Query query; @@ -558,6 +610,7 @@ public static class Builder extends RequestBase.AbstractBuilder public Builder() { } private Builder(UpdateDatafeedRequest instance) { + this.forceRekeying = instance.forceRekeying; this.aggregations = instance.aggregations; this.allowNoIndices = instance.allowNoIndices; this.chunkingConfig = instance.chunkingConfig; @@ -571,6 +624,7 @@ private Builder(UpdateDatafeedRequest instance) { this.indicesOptions = instance.indicesOptions; this.jobId = instance.jobId; this.maxEmptySearches = instance.maxEmptySearches; + this.projectRouting = instance.projectRouting; this.query = instance.query; this.queryDelay = instance.queryDelay; this.runtimeMappings = instance.runtimeMappings; @@ -578,6 +632,20 @@ private Builder(UpdateDatafeedRequest instance) { this.scrollSize = instance.scrollSize; } + /** + * When true, force reminting of the datafeed's internal cloud API key from the + * caller's cloud credential without requiring other configuration changes. + * Requires a cloud-authenticated caller and an environment that supports + * cross-project calls. Rejected with 400 otherwise. The datafeed must be + * stopped. + *

+ * API name: {@code _force_rekeying} + */ + public final Builder forceRekeying(@Nullable Boolean value) { + this.forceRekeying = value; + return this; + } + /** * If set, the datafeed performs aggregation searches. Support for aggregations * is limited and should be used only with low cardinality data. @@ -872,6 +940,20 @@ public final Builder maxEmptySearches(@Nullable Integer value) { return this; } + /** + * A Lucene-style expression that limits which linked projects the datafeed + * searches when cross-project search is enabled. Examples: + * _alias:_origin, _alias:prod-*. If omitted, searches + * all linked projects within the cross-project search scope. Rejected when CPS + * is not enabled for datafeeds. + *

+ * API name: {@code project_routing} + */ + public final Builder projectRouting(@Nullable String value) { + this.projectRouting = value; + return this; + } + /** * The Elasticsearch query domain-specific language (DSL). This value * corresponds to the query object in an Elasticsearch search POST body. All the @@ -1077,6 +1159,7 @@ public Builder rebuild() { protected static void setupUpdateDatafeedRequestDeserializer(ObjectDeserializer op) { + op.add(Builder::forceRekeying, JsonpDeserializer.booleanDeserializer(), "_force_rekeying"); op.add(Builder::aggregations, JsonpDeserializer.stringMapDeserializer(Aggregation._DESERIALIZER), "aggregations"); op.add(Builder::chunkingConfig, ChunkingConfig._DESERIALIZER, "chunking_config"); @@ -1087,6 +1170,7 @@ protected static void setupUpdateDatafeedRequestDeserializer(ObjectDeserializer< op.add(Builder::indicesOptions, IndicesOptions._DESERIALIZER, "indices_options"); op.add(Builder::jobId, JsonpDeserializer.stringDeserializer(), "job_id"); op.add(Builder::maxEmptySearches, JsonpDeserializer.integerDeserializer(), "max_empty_searches"); + op.add(Builder::projectRouting, JsonpDeserializer.stringDeserializer(), "project_routing"); op.add(Builder::query, Query._DESERIALIZER, "query"); op.add(Builder::queryDelay, Time._DESERIALIZER, "query_delay"); op.add(Builder::runtimeMappings, JsonpDeserializer.stringMapDeserializer(RuntimeField._DESERIALIZER), diff --git a/java-client/src/main/java/co/elastic/clients/elasticsearch/ml/UpdateDatafeedResponse.java b/java-client/src/main/java/co/elastic/clients/elasticsearch/ml/UpdateDatafeedResponse.java index db45fd2556..34e6fcb81b 100644 --- a/java-client/src/main/java/co/elastic/clients/elasticsearch/ml/UpdateDatafeedResponse.java +++ b/java-client/src/main/java/co/elastic/clients/elasticsearch/ml/UpdateDatafeedResponse.java @@ -105,6 +105,9 @@ public class UpdateDatafeedResponse implements JsonpSerializable { private final int scrollSize; + @Nullable + private final String projectRouting; + // --------------------------------------------------------------------------------------------- private UpdateDatafeedResponse(Builder builder) { @@ -124,6 +127,7 @@ private UpdateDatafeedResponse(Builder builder) { this.runtimeMappings = ApiTypeHelper.unmodifiable(builder.runtimeMappings); this.scriptFields = ApiTypeHelper.unmodifiable(builder.scriptFields); this.scrollSize = ApiTypeHelper.requireNonNull(builder.scrollSize, this, "scrollSize", 0); + this.projectRouting = builder.projectRouting; } @@ -250,6 +254,20 @@ public final int scrollSize() { return this.scrollSize; } + /** + * A Lucene-style expression that limits which linked projects the datafeed + * searches when cross-project search is enabled. Examples: + * _alias:_origin, _alias:prod-*. If omitted, searches + * all linked projects within the cross-project search scope. Rejected when CPS + * is not enabled for datafeeds. + *

+ * API name: {@code project_routing} + */ + @Nullable + public final String projectRouting() { + return this.projectRouting; + } + /** * Serialize this object to JSON. */ @@ -347,6 +365,12 @@ protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { generator.writeKey("scroll_size"); generator.write(this.scrollSize); + if (this.projectRouting != null) { + generator.writeKey("project_routing"); + generator.write(this.projectRouting); + + } + } @Override @@ -401,6 +425,9 @@ public static class Builder extends WithJsonObjectBuilderBase private Integer scrollSize; + @Nullable + private String projectRouting; + /** * API name: {@code authorization} */ @@ -684,6 +711,20 @@ public final Builder scrollSize(int value) { return this; } + /** + * A Lucene-style expression that limits which linked projects the datafeed + * searches when cross-project search is enabled. Examples: + * _alias:_origin, _alias:prod-*. If omitted, searches + * all linked projects within the cross-project search scope. Rejected when CPS + * is not enabled for datafeeds. + *

+ * API name: {@code project_routing} + */ + public final Builder projectRouting(@Nullable String value) { + this.projectRouting = value; + return this; + } + @Override protected Builder self() { return this; @@ -732,6 +773,7 @@ protected static void setupUpdateDatafeedResponseDeserializer( op.add(Builder::scriptFields, JsonpDeserializer.stringMapDeserializer(ScriptField._DESERIALIZER), "script_fields"); op.add(Builder::scrollSize, JsonpDeserializer.integerDeserializer(), "scroll_size"); + op.add(Builder::projectRouting, JsonpDeserializer.stringDeserializer(), "project_routing"); } diff --git a/java-client/src/main/java/co/elastic/clients/elasticsearch/security/RoleDescriptor.java b/java-client/src/main/java/co/elastic/clients/elasticsearch/security/RoleDescriptor.java index 37f9dec81c..cc688331ae 100644 --- a/java-client/src/main/java/co/elastic/clients/elasticsearch/security/RoleDescriptor.java +++ b/java-client/src/main/java/co/elastic/clients/elasticsearch/security/RoleDescriptor.java @@ -71,7 +71,8 @@ public class RoleDescriptor implements JsonpSerializable { private final List remoteCluster; - private final List global; + @Nullable + private final GlobalPrivilege global; private final List applications; @@ -95,7 +96,7 @@ protected RoleDescriptor(AbstractBuilder builder) { this.indices = ApiTypeHelper.unmodifiable(builder.indices); this.remoteIndices = ApiTypeHelper.unmodifiable(builder.remoteIndices); this.remoteCluster = ApiTypeHelper.unmodifiable(builder.remoteCluster); - this.global = ApiTypeHelper.unmodifiable(builder.global); + this.global = builder.global; this.applications = ApiTypeHelper.unmodifiable(builder.applications); this.metadata = ApiTypeHelper.unmodifiable(builder.metadata); this.runAs = ApiTypeHelper.unmodifiable(builder.runAs); @@ -153,7 +154,8 @@ public final List remoteCluster() { *

* API name: {@code global} */ - public final List global() { + @Nullable + public final GlobalPrivilege global() { return this.global; } @@ -266,14 +268,9 @@ protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { generator.writeEnd(); } - if (ApiTypeHelper.isDefined(this.global)) { + if (this.global != null) { generator.writeKey("global"); - generator.writeStartArray(); - for (GlobalPrivilege item0 : this.global) { - item0.serialize(generator, mapper); - - } - generator.writeEnd(); + this.global.serialize(generator, mapper); } if (ApiTypeHelper.isDefined(this.applications)) { @@ -379,7 +376,7 @@ public abstract static class AbstractBuilder remoteCluster; @Nullable - private List global; + private GlobalPrivilege global; @Nullable private List applications; @@ -554,11 +551,9 @@ public final BuilderT remoteCluster( * privilege that is request-aware. *

* API name: {@code global} - *

- * Adds all elements of list to global. */ - public final BuilderT global(List list) { - this.global = _listAddAll(this.global, list); + public final BuilderT global(@Nullable GlobalPrivilege value) { + this.global = value; return self(); } @@ -567,24 +562,9 @@ public final BuilderT global(List list) { * privilege that is request-aware. *

* API name: {@code global} - *

- * Adds one or more values to global. - */ - public final BuilderT global(GlobalPrivilege value, GlobalPrivilege... values) { - this.global = _listAdd(this.global, value, values); - return self(); - } - - /** - * An object defining global privileges. A global privilege is a form of cluster - * privilege that is request-aware. - *

- * API name: {@code global} - *

- * Adds a value to global using a builder lambda. */ public final BuilderT global(Function> fn) { - return global(fn.apply(new GlobalPrivilege.Builder()).build()); + return this.global(fn.apply(new GlobalPrivilege.Builder()).build()); } /** @@ -751,7 +731,7 @@ protected static > void setupRoleDesc JsonpDeserializer.arrayDeserializer(RemoteIndicesPrivileges._DESERIALIZER), "remote_indices"); op.add(AbstractBuilder::remoteCluster, JsonpDeserializer.arrayDeserializer(RemoteClusterPrivileges._DESERIALIZER), "remote_cluster"); - op.add(AbstractBuilder::global, JsonpDeserializer.arrayDeserializer(GlobalPrivilege._DESERIALIZER), "global"); + op.add(AbstractBuilder::global, GlobalPrivilege._DESERIALIZER, "global"); op.add(AbstractBuilder::applications, JsonpDeserializer.arrayDeserializer(ApplicationPrivileges._DESERIALIZER), "applications"); op.add(AbstractBuilder::metadata, JsonpDeserializer.stringMapDeserializer(JsonData._DESERIALIZER), "metadata"); diff --git a/java-client/src/main/java/co/elastic/clients/elasticsearch/security/RoleDescriptorRead.java b/java-client/src/main/java/co/elastic/clients/elasticsearch/security/RoleDescriptorRead.java index 26b04e9e9b..bcf46304c6 100644 --- a/java-client/src/main/java/co/elastic/clients/elasticsearch/security/RoleDescriptorRead.java +++ b/java-client/src/main/java/co/elastic/clients/elasticsearch/security/RoleDescriptorRead.java @@ -72,7 +72,8 @@ public class RoleDescriptorRead implements JsonpSerializable { private final List remoteCluster; - private final List global; + @Nullable + private final GlobalPrivilege global; private final List applications; @@ -96,7 +97,7 @@ private RoleDescriptorRead(Builder builder) { this.indices = ApiTypeHelper.unmodifiableRequired(builder.indices, this, "indices"); this.remoteIndices = ApiTypeHelper.unmodifiable(builder.remoteIndices); this.remoteCluster = ApiTypeHelper.unmodifiable(builder.remoteCluster); - this.global = ApiTypeHelper.unmodifiable(builder.global); + this.global = builder.global; this.applications = ApiTypeHelper.unmodifiable(builder.applications); this.metadata = ApiTypeHelper.unmodifiable(builder.metadata); this.runAs = ApiTypeHelper.unmodifiable(builder.runAs); @@ -154,7 +155,8 @@ public final List remoteCluster() { *

* API name: {@code global} */ - public final List global() { + @Nullable + public final GlobalPrivilege global() { return this.global; } @@ -267,14 +269,9 @@ protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { generator.writeEnd(); } - if (ApiTypeHelper.isDefined(this.global)) { + if (this.global != null) { generator.writeKey("global"); - generator.writeStartArray(); - for (GlobalPrivilege item0 : this.global) { - item0.serialize(generator, mapper); - - } - generator.writeEnd(); + this.global.serialize(generator, mapper); } if (ApiTypeHelper.isDefined(this.applications)) { @@ -357,7 +354,7 @@ public static class Builder extends WithJsonObjectBuilderBase private List remoteCluster; @Nullable - private List global; + private GlobalPrivilege global; @Nullable private List applications; @@ -548,11 +545,9 @@ public final Builder remoteCluster( * privilege that is request-aware. *

* API name: {@code global} - *

- * Adds all elements of list to global. */ - public final Builder global(List list) { - this.global = _listAddAll(this.global, list); + public final Builder global(@Nullable GlobalPrivilege value) { + this.global = value; return this; } @@ -561,24 +556,9 @@ public final Builder global(List list) { * privilege that is request-aware. *

* API name: {@code global} - *

- * Adds one or more values to global. - */ - public final Builder global(GlobalPrivilege value, GlobalPrivilege... values) { - this.global = _listAdd(this.global, value, values); - return this; - } - - /** - * An object defining global privileges. A global privilege is a form of cluster - * privilege that is request-aware. - *

- * API name: {@code global} - *

- * Adds a value to global using a builder lambda. */ public final Builder global(Function> fn) { - return global(fn.apply(new GlobalPrivilege.Builder()).build()); + return this.global(fn.apply(new GlobalPrivilege.Builder()).build()); } /** @@ -764,7 +744,7 @@ protected static void setupRoleDescriptorReadDeserializer(ObjectDeserializer snapshot() { } /** - * If true, the request returns a response when the matching - * snapshots are all deleted. If false, the request returns a - * response as soon as the deletes are scheduled. + * If false, the request returns a response as soon as the deletes + * are scheduled. If true, the request returns a response when the + * matching snapshots are all deleted, and the post-deletion cleanup work + * associated with the request has completed. If you make several requests to + * the delete-snapshots API targetting overlapping collections of snapshots then + * some of those requests may perform different parts of the associated + * post-deletion cleanup work, returning their responses at different times. For + * example, if you make two requests to delete the same snapshot then sometimes + * all of the post-deletion cleanup work will be associated with the first + * request, delaying its response, while the second request has no associated + * post-deletion cleanup work and receives its response as soon as the snapshot + * has been deleted. *

* API name: {@code wait_for_completion} */ @@ -222,9 +231,18 @@ public final Builder snapshot(String value, String... values) { } /** - * If true, the request returns a response when the matching - * snapshots are all deleted. If false, the request returns a - * response as soon as the deletes are scheduled. + * If false, the request returns a response as soon as the deletes + * are scheduled. If true, the request returns a response when the + * matching snapshots are all deleted, and the post-deletion cleanup work + * associated with the request has completed. If you make several requests to + * the delete-snapshots API targetting overlapping collections of snapshots then + * some of those requests may perform different parts of the associated + * post-deletion cleanup work, returning their responses at different times. For + * example, if you make two requests to delete the same snapshot then sometimes + * all of the post-deletion cleanup work will be associated with the first + * request, delaying its response, while the second request has no associated + * post-deletion cleanup work and receives its response as soon as the snapshot + * has been deleted. *

* API name: {@code wait_for_completion} */ diff --git a/java-client/src/main/java/co/elastic/clients/elasticsearch/transform/Destination.java b/java-client/src/main/java/co/elastic/clients/elasticsearch/transform/Destination.java index 354ce564a0..e3da279432 100644 --- a/java-client/src/main/java/co/elastic/clients/elasticsearch/transform/Destination.java +++ b/java-client/src/main/java/co/elastic/clients/elasticsearch/transform/Destination.java @@ -26,10 +26,12 @@ import co.elastic.clients.json.JsonpUtils; import co.elastic.clients.json.ObjectBuilderDeserializer; import co.elastic.clients.json.ObjectDeserializer; +import co.elastic.clients.util.ApiTypeHelper; import co.elastic.clients.util.ObjectBuilder; import co.elastic.clients.util.WithJsonObjectBuilderBase; import jakarta.json.stream.JsonGenerator; import java.lang.String; +import java.util.List; import java.util.Objects; import java.util.function.Function; import javax.annotation.Nullable; @@ -61,6 +63,8 @@ public class Destination implements JsonpSerializable { @Nullable private final String index; + private final List aliases; + @Nullable private final String pipeline; @@ -69,6 +73,7 @@ public class Destination implements JsonpSerializable { private Destination(Builder builder) { this.index = builder.index; + this.aliases = ApiTypeHelper.unmodifiable(builder.aliases); this.pipeline = builder.pipeline; } @@ -90,6 +95,21 @@ public final String index() { return this.index; } + /** + * The aliases that the destination index for the transform should have. Aliases + * are manipulated using the stored credentials of the transform, which means + * the secondary credentials supplied at creation time (if both primary and + * secondary credentials are specified). + *

+ * The destination index is added to the aliases regardless of whether the + * destination index was created by the transform or pre-created by the user. + *

+ * API name: {@code aliases} + */ + public final List aliases() { + return this.aliases; + } + /** * The unique identifier for an ingest pipeline. *

@@ -115,6 +135,16 @@ protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { generator.writeKey("index"); generator.write(this.index); + } + if (ApiTypeHelper.isDefined(this.aliases)) { + generator.writeKey("aliases"); + generator.writeStartArray(); + for (DestinationAlias item0 : this.aliases) { + item0.serialize(generator, mapper); + + } + generator.writeEnd(); + } if (this.pipeline != null) { generator.writeKey("pipeline"); @@ -139,6 +169,9 @@ public static class Builder extends WithJsonObjectBuilderBase implement @Nullable private String index; + @Nullable + private List aliases; + @Nullable private String pipeline; @@ -146,6 +179,7 @@ public Builder() { } private Builder(Destination instance) { this.index = instance.index; + this.aliases = instance.aliases; this.pipeline = instance.pipeline; } @@ -162,6 +196,59 @@ public final Builder index(@Nullable String value) { return this; } + /** + * The aliases that the destination index for the transform should have. Aliases + * are manipulated using the stored credentials of the transform, which means + * the secondary credentials supplied at creation time (if both primary and + * secondary credentials are specified). + *

+ * The destination index is added to the aliases regardless of whether the + * destination index was created by the transform or pre-created by the user. + *

+ * API name: {@code aliases} + *

+ * Adds all elements of list to aliases. + */ + public final Builder aliases(List list) { + this.aliases = _listAddAll(this.aliases, list); + return this; + } + + /** + * The aliases that the destination index for the transform should have. Aliases + * are manipulated using the stored credentials of the transform, which means + * the secondary credentials supplied at creation time (if both primary and + * secondary credentials are specified). + *

+ * The destination index is added to the aliases regardless of whether the + * destination index was created by the transform or pre-created by the user. + *

+ * API name: {@code aliases} + *

+ * Adds one or more values to aliases. + */ + public final Builder aliases(DestinationAlias value, DestinationAlias... values) { + this.aliases = _listAdd(this.aliases, value, values); + return this; + } + + /** + * The aliases that the destination index for the transform should have. Aliases + * are manipulated using the stored credentials of the transform, which means + * the secondary credentials supplied at creation time (if both primary and + * secondary credentials are specified). + *

+ * The destination index is added to the aliases regardless of whether the + * destination index was created by the transform or pre-created by the user. + *

+ * API name: {@code aliases} + *

+ * Adds a value to aliases using a builder lambda. + */ + public final Builder aliases(Function> fn) { + return aliases(fn.apply(new DestinationAlias.Builder()).build()); + } + /** * The unique identifier for an ingest pipeline. *

@@ -207,6 +294,7 @@ public Builder rebuild() { protected static void setupDestinationDeserializer(ObjectDeserializer op) { op.add(Builder::index, JsonpDeserializer.stringDeserializer(), "index"); + op.add(Builder::aliases, JsonpDeserializer.arrayDeserializer(DestinationAlias._DESERIALIZER), "aliases"); op.add(Builder::pipeline, JsonpDeserializer.stringDeserializer(), "pipeline"); } diff --git a/java-client/src/main/java/co/elastic/clients/elasticsearch/transform/DestinationAlias.java b/java-client/src/main/java/co/elastic/clients/elasticsearch/transform/DestinationAlias.java new file mode 100644 index 0000000000..3eed44e13e --- /dev/null +++ b/java-client/src/main/java/co/elastic/clients/elasticsearch/transform/DestinationAlias.java @@ -0,0 +1,212 @@ +/* + * Licensed to Elasticsearch B.V. under one or more contributor + * license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright + * ownership. Elasticsearch B.V. licenses this file to you under + * the Apache License, Version 2.0 (the "License"); you may + * not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +package co.elastic.clients.elasticsearch.transform; + +import co.elastic.clients.json.JsonpDeserializable; +import co.elastic.clients.json.JsonpDeserializer; +import co.elastic.clients.json.JsonpMapper; +import co.elastic.clients.json.JsonpSerializable; +import co.elastic.clients.json.JsonpUtils; +import co.elastic.clients.json.ObjectBuilderDeserializer; +import co.elastic.clients.json.ObjectDeserializer; +import co.elastic.clients.util.ApiTypeHelper; +import co.elastic.clients.util.ObjectBuilder; +import co.elastic.clients.util.WithJsonObjectBuilderBase; +import jakarta.json.stream.JsonGenerator; +import java.lang.Boolean; +import java.lang.String; +import java.util.Objects; +import java.util.function.Function; +import javax.annotation.Nullable; + +//---------------------------------------------------------------- +// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. +//---------------------------------------------------------------- +// +// This code is generated from the Elasticsearch API specification +// at https://github.com/elastic/elasticsearch-specification +// +// Manual updates to this file will be lost when the code is +// re-generated. +// +// If you find a property that is missing or wrongly typed, please +// open an issue or a PR on the API specification repository. +// +//---------------------------------------------------------------- + +// typedef: transform._types.DestinationAlias + +/** + * + * @see API + * specification + */ +@JsonpDeserializable +public class DestinationAlias implements JsonpSerializable { + private final String alias; + + @Nullable + private final Boolean moveOnCreation; + + // --------------------------------------------------------------------------------------------- + + private DestinationAlias(Builder builder) { + + this.alias = ApiTypeHelper.requireNonNull(builder.alias, this, "alias"); + this.moveOnCreation = builder.moveOnCreation; + + } + + public static DestinationAlias of(Function> fn) { + return fn.apply(new Builder()).build(); + } + + /** + * Required - The name of the alias. + *

+ * API name: {@code alias} + */ + public final String alias() { + return this.alias; + } + + /** + * Whether the destination index should be the only index in this alias. If + * true, all the other indices will be removed from this alias + * before adding the destination index to this alias. This does not delete the + * removed indices; it only removes them from the alias. + *

+ * API name: {@code move_on_creation} + */ + @Nullable + public final Boolean moveOnCreation() { + return this.moveOnCreation; + } + + /** + * Serialize this object to JSON. + */ + public void serialize(JsonGenerator generator, JsonpMapper mapper) { + generator.writeStartObject(); + serializeInternal(generator, mapper); + generator.writeEnd(); + } + + protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { + + generator.writeKey("alias"); + generator.write(this.alias); + + if (this.moveOnCreation != null) { + generator.writeKey("move_on_creation"); + generator.write(this.moveOnCreation); + + } + + } + + @Override + public String toString() { + return JsonpUtils.toString(this); + } + + // --------------------------------------------------------------------------------------------- + + /** + * Builder for {@link DestinationAlias}. + */ + + public static class Builder extends WithJsonObjectBuilderBase implements ObjectBuilder { + private String alias; + + @Nullable + private Boolean moveOnCreation; + + public Builder() { + } + private Builder(DestinationAlias instance) { + this.alias = instance.alias; + this.moveOnCreation = instance.moveOnCreation; + + } + /** + * Required - The name of the alias. + *

+ * API name: {@code alias} + */ + public final Builder alias(String value) { + this.alias = value; + return this; + } + + /** + * Whether the destination index should be the only index in this alias. If + * true, all the other indices will be removed from this alias + * before adding the destination index to this alias. This does not delete the + * removed indices; it only removes them from the alias. + *

+ * API name: {@code move_on_creation} + */ + public final Builder moveOnCreation(@Nullable Boolean value) { + this.moveOnCreation = value; + return this; + } + + @Override + protected Builder self() { + return this; + } + + /** + * Builds a {@link DestinationAlias}. + * + * @throws NullPointerException + * if some of the required fields are null. + */ + public DestinationAlias build() { + _checkSingleUse(); + + return new DestinationAlias(this); + } + } + + /** + * @return New {@link Builder} initialized with field values of this instance + */ + public Builder rebuild() { + return new Builder(this); + } + // --------------------------------------------------------------------------------------------- + + /** + * Json deserializer for {@link DestinationAlias} + */ + public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer.lazy(Builder::new, + DestinationAlias::setupDestinationAliasDeserializer); + + protected static void setupDestinationAliasDeserializer(ObjectDeserializer op) { + + op.add(Builder::alias, JsonpDeserializer.stringDeserializer(), "alias"); + op.add(Builder::moveOnCreation, JsonpDeserializer.booleanDeserializer(), "move_on_creation"); + + } + +} diff --git a/java-client/src/main/java/co/elastic/clients/elasticsearch/transform/UpdateTransformRequest.java b/java-client/src/main/java/co/elastic/clients/elasticsearch/transform/UpdateTransformRequest.java index ca6d53f330..210ccda0f5 100644 --- a/java-client/src/main/java/co/elastic/clients/elasticsearch/transform/UpdateTransformRequest.java +++ b/java-client/src/main/java/co/elastic/clients/elasticsearch/transform/UpdateTransformRequest.java @@ -79,6 +79,9 @@ */ @JsonpDeserializable public class UpdateTransformRequest extends RequestBase implements JsonpSerializable { + @Nullable + private final Boolean forceRekeying; + private final Map meta; @Nullable @@ -114,6 +117,7 @@ public class UpdateTransformRequest extends RequestBase implements JsonpSerializ private UpdateTransformRequest(Builder builder) { + this.forceRekeying = builder.forceRekeying; this.meta = ApiTypeHelper.unmodifiable(builder.meta); this.deferValidation = builder.deferValidation; this.description = builder.description; @@ -132,6 +136,19 @@ public static UpdateTransformRequest of(Function + * API name: {@code _force_rekeying} + */ + @Nullable + public final Boolean forceRekeying() { + return this.forceRekeying; + } + /** * Defines optional transform metadata. *

@@ -257,6 +274,11 @@ public void serialize(JsonGenerator generator, JsonpMapper mapper) { protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { + if (this.forceRekeying != null) { + generator.writeKey("_force_rekeying"); + generator.write(this.forceRekeying); + + } if (ApiTypeHelper.isDefined(this.meta)) { generator.writeKey("_meta"); generator.writeStartObject(); @@ -315,6 +337,9 @@ protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { public static class Builder extends RequestBase.AbstractBuilder implements ObjectBuilder { + @Nullable + private Boolean forceRekeying; + @Nullable private Map meta; @@ -350,6 +375,7 @@ public static class Builder extends RequestBase.AbstractBuilder public Builder() { } private Builder(UpdateTransformRequest instance) { + this.forceRekeying = instance.forceRekeying; this.meta = instance.meta; this.deferValidation = instance.deferValidation; this.description = instance.description; @@ -363,6 +389,19 @@ private Builder(UpdateTransformRequest instance) { this.transformId = instance.transformId; } + /** + * When true, force reminting of the transform's internal cloud API key from the + * caller's cloud credential without requiring other configuration changes. + * Requires a cloud-authenticated caller and an environment that supports + * cross-project calls. Rejected with 400 otherwise. + *

+ * API name: {@code _force_rekeying} + */ + public final Builder forceRekeying(@Nullable Boolean value) { + this.forceRekeying = value; + return this; + } + /** * Defines optional transform metadata. *

@@ -617,6 +656,7 @@ public Builder rebuild() { protected static void setupUpdateTransformRequestDeserializer( ObjectDeserializer op) { + op.add(Builder::forceRekeying, JsonpDeserializer.booleanDeserializer(), "_force_rekeying"); op.add(Builder::meta, JsonpDeserializer.stringMapDeserializer(JsonData._DESERIALIZER), "_meta"); op.add(Builder::description, JsonpDeserializer.stringDeserializer(), "description"); op.add(Builder::dest, Destination._DESERIALIZER, "dest"); diff --git a/java-client/src/main/java/co/elastic/clients/elasticsearch/transform/UpdateTransformResponse.java b/java-client/src/main/java/co/elastic/clients/elasticsearch/transform/UpdateTransformResponse.java index f9d0f339dd..03229e27e3 100644 --- a/java-client/src/main/java/co/elastic/clients/elasticsearch/transform/UpdateTransformResponse.java +++ b/java-client/src/main/java/co/elastic/clients/elasticsearch/transform/UpdateTransformResponse.java @@ -20,7 +20,6 @@ package co.elastic.clients.elasticsearch.transform; import co.elastic.clients.elasticsearch._types.Time; -import co.elastic.clients.elasticsearch.core.reindex.Destination; import co.elastic.clients.elasticsearch.core.reindex.Source; import co.elastic.clients.elasticsearch.ml.TransformAuthorization; import co.elastic.clients.json.JsonData; diff --git a/java-client/src/main/java/co/elastic/clients/elasticsearch/transform/get_transform/TransformSummary.java b/java-client/src/main/java/co/elastic/clients/elasticsearch/transform/get_transform/TransformSummary.java index f1a8c70c19..d8b3208ab8 100644 --- a/java-client/src/main/java/co/elastic/clients/elasticsearch/transform/get_transform/TransformSummary.java +++ b/java-client/src/main/java/co/elastic/clients/elasticsearch/transform/get_transform/TransformSummary.java @@ -20,8 +20,8 @@ package co.elastic.clients.elasticsearch.transform.get_transform; import co.elastic.clients.elasticsearch._types.Time; -import co.elastic.clients.elasticsearch.core.reindex.Destination; import co.elastic.clients.elasticsearch.ml.TransformAuthorization; +import co.elastic.clients.elasticsearch.transform.Destination; import co.elastic.clients.elasticsearch.transform.Latest; import co.elastic.clients.elasticsearch.transform.Pivot; import co.elastic.clients.elasticsearch.transform.RetentionPolicy;