From abc18157dfba8a0fe3ca9bc5ef3cab96db2f3cf7 Mon Sep 17 00:00:00 2001 From: Laura Trotta Date: Tue, 15 Sep 2026 08:50:34 +0000 Subject: [PATCH] [codegen] update to latest spec --- .../_types/ElasticsearchException.java | 3 +- .../elasticsearch/_types/InnerRetriever.java | 68 ++++++-- .../elasticsearch/_types/KnnRetriever.java | 21 ++- .../mapping/DenseVectorIndexOptions.java | 162 +++++++++++++++++- .../elasticsearch/doc-files/api-spec.html | 70 ++++---- .../security/ClusterPrivilege.java | 2 + .../security/RoleDescriptor.java | 45 ++--- .../security/RoleDescriptorRead.java | 45 ++--- 8 files changed, 286 insertions(+), 130 deletions(-) diff --git a/java-client/src/main/java/co/elastic/clients/elasticsearch/_types/ElasticsearchException.java b/java-client/src/main/java/co/elastic/clients/elasticsearch/_types/ElasticsearchException.java index 74b927db6c..0c2c5b5d03 100644 --- a/java-client/src/main/java/co/elastic/clients/elasticsearch/_types/ElasticsearchException.java +++ b/java-client/src/main/java/co/elastic/clients/elasticsearch/_types/ElasticsearchException.java @@ -58,7 +58,8 @@ private static String buildCompleteErrorMessage(String endpointId, ErrorResponse message.append("; caused by: [").append(cause.type()).append("] ").append(cause.reason()); } - // Root causes carry the actual error for generic errors such "all shards failed" + // Root causes carry the actual error for generic errors such "all shards + // failed" for (ErrorCause rootCause : error.rootCause()) { // Avoid repeating same message if (Objects.equals(rootCause.type(), error.type()) && Objects.equals(rootCause.reason(), error.reason())) { 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..fd384a9f39 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,18 @@ 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; + // --------------------------------------------------------------------------------------------- private DenseVectorIndexOptions(Builder builder) { @@ -93,6 +105,10 @@ 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; } @@ -196,7 +212,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 +222,56 @@ 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; + } + /** * Serialize this object to JSON. */ @@ -248,6 +315,26 @@ 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); + + } } @@ -285,6 +372,18 @@ 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; + public Builder() { } private Builder(DenseVectorIndexOptions instance) { @@ -295,6 +394,10 @@ 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; } /** @@ -407,7 +510,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 +520,56 @@ 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; + } + @Override protected Builder self() { return this; @@ -458,6 +612,10 @@ 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"); } diff --git a/java-client/src/main/java/co/elastic/clients/elasticsearch/doc-files/api-spec.html b/java-client/src/main/java/co/elastic/clients/elasticsearch/doc-files/api-spec.html index 45145f909d..948fa5ebf9 100644 --- a/java-client/src/main/java/co/elastic/clients/elasticsearch/doc-files/api-spec.html +++ b/java-client/src/main/java/co/elastic/clients/elasticsearch/doc-files/api-spec.html @@ -272,7 +272,7 @@ '_types.BulkStats': '_types/Stats.ts#L71-L81', '_types.Bytes': '_types/common.ts#L164-L176', '_types.CartesianPoint': '_types/Geo.ts#L125-L128', -'_types.ChunkRescorer': '_types/Retriever.ts#L205-L210', +'_types.ChunkRescorer': '_types/Retriever.ts#L217-L222', '_types.ClusterDetails': '_types/Stats.ts#L45-L52', '_types.ClusterInfoTarget': '_types/common.ts#L408-L414', '_types.ClusterSearchStatus': '_types/Stats.ts#L37-L43', @@ -285,8 +285,8 @@ '_types.DFRAfterEffect': '_types/Similarity.ts#L26-L30', '_types.DFRBasicModel': '_types/Similarity.ts#L32-L40', '_types.DistanceUnit': '_types/Geo.ts#L30-L40', -'_types.DiversifyRetriever': '_types/Retriever.ts#L216-L233', -'_types.DiversifyRetrieverTypes': '_types/Retriever.ts#L212-L214', +'_types.DiversifyRetriever': '_types/Retriever.ts#L228-L245', +'_types.DiversifyRetrieverTypes': '_types/Retriever.ts#L224-L226', '_types.DocStats': '_types/Stats.ts#L100-L121', '_types.ElasticsearchVersionInfo': '_types/Base.ts#L81-L123', '_types.ElasticsearchVersionMinInfo': '_types/Base.ts#L125-L133', @@ -320,10 +320,10 @@ '_types.IndicesResponseBase': '_types/Base.ts#L146-L148', '_types.InferenceString': '_types/Knn.ts#L139-L154', '_types.InlineGet': '_types/common.ts#L342-L355', -'_types.InnerRetriever': '_types/Retriever.ts#L88-L92', +'_types.InnerRetriever': '_types/Retriever.ts#L88-L104', '_types.KnnEmbeddingInput': '_types/Knn.ts#L130-L135', '_types.KnnQuery': '_types/Knn.ts#L79-L109', -'_types.KnnRetriever': '_types/Retriever.ts#L118-L143', +'_types.KnnRetriever': '_types/Retriever.ts#L130-L155', '_types.KnnSearch': '_types/Knn.ts#L40-L77', '_types.LatLonGeoLocation': '_types/Geo.ts#L114-L123', '_types.Level': '_types/common.ts#L260-L264', @@ -343,9 +343,9 @@ '_types.PluginStats': '_types/Stats.ts#L207-L217', '_types.QueryCacheStats': '_types/Stats.ts#L219-L253', '_types.QueryVectorBuilder': '_types/Knn.ts#L111-L122', -'_types.RRFRetriever': '_types/Retriever.ts#L164-L173', -'_types.RRFRetrieverComponent': '_types/Retriever.ts#L145-L156', -'_types.RRFRetrieverEntry': '_types/Retriever.ts#L158-L162', +'_types.RRFRetriever': '_types/Retriever.ts#L176-L185', +'_types.RRFRetrieverComponent': '_types/Retriever.ts#L157-L168', +'_types.RRFRetrieverEntry': '_types/Retriever.ts#L170-L174', '_types.RankBase': '_types/Rank.ts#L33-L33', '_types.RankContainer': '_types/Rank.ts#L22-L31', '_types.RecoveryStats': '_types/Stats.ts#L255-L260', @@ -364,8 +364,8 @@ '_types.RetrieverBase': '_types/Retriever.ts#L56-L63', '_types.RetrieverContainer': '_types/Retriever.ts#L29-L54', '_types.RrfRank': '_types/Rank.ts#L35-L40', -'_types.RuleRetriever': '_types/Retriever.ts#L194-L203', -'_types.ScoreNormalizer': '_types/Retriever.ts#L94-L98', +'_types.RuleRetriever': '_types/Retriever.ts#L206-L215', +'_types.ScoreNormalizer': '_types/Retriever.ts#L106-L110', '_types.ScoreSort': '_types/sort.ts#L54-L56', '_types.Script': '_types/Scripting.ts#L65-L89', '_types.ScriptField': '_types/Scripting.ts#L91-L94', @@ -387,14 +387,14 @@ '_types.SortMode': '_types/sort.ts#L108-L117', '_types.SortOptions': '_types/sort.ts#L86-L96', '_types.SortOrder': '_types/sort.ts#L119-L128', -'_types.SpecifiedDocument': '_types/Retriever.ts#L100-L103', -'_types.StandardRetriever': '_types/Retriever.ts#L105-L116', +'_types.SpecifiedDocument': '_types/Retriever.ts#L112-L115', +'_types.StandardRetriever': '_types/Retriever.ts#L117-L128', '_types.StoreStats': '_types/Stats.ts#L398-L425', '_types.StoredScript': '_types/Scripting.ts#L51-L63', '_types.SuggestMode': '_types/common.ts#L299-L312', '_types.TaskFailure': '_types/Errors.ts#L71-L76', '_types.TextEmbedding': '_types/Knn.ts#L156-L166', -'_types.TextSimilarityReranker': '_types/Retriever.ts#L175-L192', +'_types.TextSimilarityReranker': '_types/Retriever.ts#L187-L204', '_types.ThreadType': '_types/common.ts#L314-L325', '_types.TimeUnit': '_types/Time.ts#L70-L78', '_types.TokenPruningConfig': '_types/TokenPruningConfig.ts#L22-L38', @@ -883,9 +883,9 @@ '_types.mapping.DateProperty': '_types/mapping/core.ts#L78-L90', '_types.mapping.DateRangeProperty': '_types/mapping/range.ts#L29-L32', '_types.mapping.DenseVectorElementType': '_types/mapping/DenseVectorProperty.ts#L64-L85', -'_types.mapping.DenseVectorIndexOptions': '_types/mapping/DenseVectorProperty.ts#L134-L189', -'_types.mapping.DenseVectorIndexOptionsRescoreVector': '_types/mapping/DenseVectorProperty.ts#L247-L255', -'_types.mapping.DenseVectorIndexOptionsType': '_types/mapping/DenseVectorProperty.ts#L191-L245', +'_types.mapping.DenseVectorIndexOptions': '_types/mapping/DenseVectorProperty.ts#L134-L219', +'_types.mapping.DenseVectorIndexOptionsRescoreVector': '_types/mapping/DenseVectorProperty.ts#L277-L285', +'_types.mapping.DenseVectorIndexOptionsType': '_types/mapping/DenseVectorProperty.ts#L221-L275', '_types.mapping.DenseVectorProperty': '_types/mapping/DenseVectorProperty.ts#L23-L62', '_types.mapping.DenseVectorSimilarity': '_types/mapping/DenseVectorProperty.ts#L87-L132', '_types.mapping.DocValuesPropertyBase': '_types/mapping/core.ts#L53-L55', @@ -2930,27 +2930,27 @@ 'security._types.Access': 'security/_types/Access.ts#L22-L31', 'security._types.ApiKey': 'security/_types/ApiKey.ts#L27-L120', 'security._types.ApiKeyType': 'security/_types/ApiKey.ts#L122-L125', -'security._types.ApplicationGlobalUserPrivileges': 'security/_types/Privileges.ts#L412-L414', +'security._types.ApplicationGlobalUserPrivileges': 'security/_types/Privileges.ts#L416-L418', 'security._types.ApplicationPrivileges': 'security/_types/Privileges.ts#L28-L41', 'security._types.BulkError': 'security/_types/Bulk.ts#L24-L33', 'security._types.ClusterNode': 'security/_types/ClusterNode.ts#L22-L24', -'security._types.ClusterPrivilege': 'security/_types/Privileges.ts#L43-L210', +'security._types.ClusterPrivilege': 'security/_types/Privileges.ts#L43-L214', 'security._types.CreatedStatus': 'security/_types/CreatedStatus.ts#L20-L22', 'security._types.CredentialManagedBy': 'security/_types/CredentialManagedBy.ts#L20-L23', 'security._types.FieldSecurity': 'security/_types/FieldSecurity.ts#L22-L25', -'security._types.GlobalPrivilege': 'security/_types/Privileges.ts#L408-L410', +'security._types.GlobalPrivilege': 'security/_types/Privileges.ts#L412-L414', 'security._types.GrantType': 'security/_types/GrantType.ts#L20-L30', -'security._types.IndexPrivilege': 'security/_types/Privileges.ts#L360-L406', -'security._types.IndicesPrivileges': 'security/_types/Privileges.ts#L254-L254', -'security._types.IndicesPrivilegesQuery': 'security/_types/Privileges.ts#L315-L323', -'security._types.ManageUserPrivileges': 'security/_types/Privileges.ts#L416-L418', +'security._types.IndexPrivilege': 'security/_types/Privileges.ts#L364-L410', +'security._types.IndicesPrivileges': 'security/_types/Privileges.ts#L258-L258', +'security._types.IndicesPrivilegesQuery': 'security/_types/Privileges.ts#L319-L327', +'security._types.ManageUserPrivileges': 'security/_types/Privileges.ts#L420-L422', 'security._types.NodeSecurityStats': 'security/_types/NodeSecurityStats.ts#L22-L27', 'security._types.RealmInfo': 'security/_types/RealmInfo.ts#L22-L25', -'security._types.RemoteClusterPrivilege': 'security/_types/Privileges.ts#L212-L224', -'security._types.RemoteClusterPrivileges': 'security/_types/Privileges.ts#L268-L280', -'security._types.RemoteIndicesPrivileges': 'security/_types/Privileges.ts#L256-L266', -'security._types.RemoteUserIndicesPrivileges': 'security/_types/Privileges.ts#L309-L313', -'security._types.ReplicationAccess': 'security/_types/Privileges.ts#L420-L430', +'security._types.RemoteClusterPrivilege': 'security/_types/Privileges.ts#L216-L228', +'security._types.RemoteClusterPrivileges': 'security/_types/Privileges.ts#L272-L284', +'security._types.RemoteIndicesPrivileges': 'security/_types/Privileges.ts#L260-L270', +'security._types.RemoteUserIndicesPrivileges': 'security/_types/Privileges.ts#L313-L317', +'security._types.ReplicationAccess': 'security/_types/Privileges.ts#L424-L434', 'security._types.Restriction': 'security/_types/RoleDescriptor.ts#L90-L96', 'security._types.RestrictionWorkflow': 'security/_types/RoleDescriptor.ts#L98-L101', 'security._types.RoleDescriptor': 'security/_types/RoleDescriptor.ts#L33-L83', @@ -2958,15 +2958,15 @@ 'security._types.RoleMapping': 'security/_types/RoleMapping.ts#L25-L33', 'security._types.RoleMappingRule': 'security/_types/RoleMappingRule.ts#L23-L31', 'security._types.RoleTemplate': 'security/_types/RoleTemplate.ts#L28-L31', -'security._types.RoleTemplateInlineQuery': 'security/_types/Privileges.ts#L357-L358', -'security._types.RoleTemplateQuery': 'security/_types/Privileges.ts#L325-L335', -'security._types.RoleTemplateScript': 'security/_types/Privileges.ts#L337-L355', +'security._types.RoleTemplateInlineQuery': 'security/_types/Privileges.ts#L361-L362', +'security._types.RoleTemplateQuery': 'security/_types/Privileges.ts#L329-L339', +'security._types.RoleTemplateScript': 'security/_types/Privileges.ts#L341-L359', 'security._types.RolesStats': 'security/_types/NodeSecurityStats.ts#L29-L34', -'security._types.SearchAccess': 'security/_types/Privileges.ts#L432-L452', +'security._types.SearchAccess': 'security/_types/Privileges.ts#L436-L456', 'security._types.SecuritySettings': 'security/_types/SecuritySettings.ts#L22-L24', 'security._types.TemplateFormat': 'security/_types/RoleTemplate.ts#L22-L25', 'security._types.User': 'security/_types/User.ts#L23-L31', -'security._types.UserIndicesPrivileges': 'security/_types/Privileges.ts#L306-L307', +'security._types.UserIndicesPrivileges': 'security/_types/Privileges.ts#L310-L311', 'security._types.UserProfile': 'security/_types/UserProfile.ts#L41-L47', 'security._types.UserProfileHitMetadata': 'security/_types/UserProfile.ts#L27-L30', 'security._types.UserProfileUser': 'security/_types/UserProfile.ts#L32-L39', @@ -3570,10 +3570,10 @@ if (hash.length > 1) { hash = hash.substring(1); } - window.location = "https://github.com/elastic/elasticsearch-specification/tree/964a36594f01c23463551aa7d09d17e514f361d1/specification/" + (paths[hash] || ""); + window.location = "https://github.com/elastic/elasticsearch-specification/tree/ad07e24d224fcd526ebde387edfa4d9975684a21/specification/" + (paths[hash] || ""); - Please see the Elasticsearch API specification. + Please see the Elasticsearch API specification. diff --git a/java-client/src/main/java/co/elastic/clients/elasticsearch/security/ClusterPrivilege.java b/java-client/src/main/java/co/elastic/clients/elasticsearch/security/ClusterPrivilege.java index e0f8365e99..031b4aad04 100644 --- a/java-client/src/main/java/co/elastic/clients/elasticsearch/security/ClusterPrivilege.java +++ b/java-client/src/main/java/co/elastic/clients/elasticsearch/security/ClusterPrivilege.java @@ -50,6 +50,8 @@ public enum ClusterPrivilege implements JsonEnum { CancelTask("cancel_task"), + CloneApiKey("clone_api_key"), + CreateSnapshot("create_snapshot"), CrossClusterReplication("cross_cluster_replication"), 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 742f16ecf2..3a37f101f9 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); @@ -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)) { @@ -380,7 +377,7 @@ public abstract static class AbstractBuilder remoteCluster; @Nullable - private List global; + private GlobalPrivilege global; @Nullable private List applications; @@ -556,25 +553,9 @@ public final BuilderT remoteCluster( * limited to the management of application privileges. *

* API name: {@code global} - *

- * Adds all elements of list to global. - */ - public final BuilderT global(List list) { - this.global = _listAddAll(this.global, list); - return self(); - } - - /** - * An object defining global privileges. A global privilege is a form of cluster - * privilege that is request-aware. Support for global privileges is currently - * limited to the management of application privileges. - *

- * 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); + public final BuilderT global(@Nullable GlobalPrivilege value) { + this.global = value; return self(); } @@ -584,11 +565,9 @@ public final BuilderT global(GlobalPrivilege value, GlobalPrivilege... values) { * limited to the management of application privileges. *

* 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()); } /** @@ -755,7 +734,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 bcd6f0aaba..b1b7a4f35b 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); @@ -155,7 +156,8 @@ public final List remoteCluster() { *

* API name: {@code global} */ - public final List global() { + @Nullable + public final GlobalPrivilege global() { return this.global; } @@ -268,14 +270,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)) { @@ -358,7 +355,7 @@ public static class Builder extends WithJsonObjectBuilderBase private List remoteCluster; @Nullable - private List global; + private GlobalPrivilege global; @Nullable private List applications; @@ -550,25 +547,9 @@ public final Builder remoteCluster( * limited to the management of application privileges. *

* API name: {@code global} - *

- * Adds all elements of list to global. - */ - public final Builder global(List list) { - this.global = _listAddAll(this.global, list); - return this; - } - - /** - * An object defining global privileges. A global privilege is a form of cluster - * privilege that is request-aware. Support for global privileges is currently - * limited to the management of application privileges. - *

- * 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); + public final Builder global(@Nullable GlobalPrivilege value) { + this.global = value; return this; } @@ -578,11 +559,9 @@ public final Builder global(GlobalPrivilege value, GlobalPrivilege... values) { * limited to the management of application privileges. *

* 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()); } /** @@ -768,7 +747,7 @@ protected static void setupRoleDescriptorReadDeserializer(ObjectDeserializer