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/doc-files/api-spec.html b/java-client/src/main/java/co/elastic/clients/elasticsearch/doc-files/api-spec.html index ffe52ea8f7..d792186b70 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 @@ -4,19 +4,19 @@ Elasticsearch 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/ml/DatafeedConfig.java b/java-client/src/main/java/co/elastic/clients/elasticsearch/ml/DatafeedConfig.java index da08f28f63..a6d1a58980 100644 --- a/java-client/src/main/java/co/elastic/clients/elasticsearch/ml/DatafeedConfig.java +++ b/java-client/src/main/java/co/elastic/clients/elasticsearch/ml/DatafeedConfig.java @@ -95,6 +95,9 @@ public class DatafeedConfig implements JsonpSerializable { @Nullable private final Integer maxEmptySearches; + @Nullable + private final Integer maxConsecutiveExtractionFailures; + @Nullable private final Query query; @@ -121,6 +124,7 @@ private DatafeedConfig(Builder builder) { this.indicesOptions = builder.indicesOptions; this.jobId = builder.jobId; this.maxEmptySearches = builder.maxEmptySearches; + this.maxConsecutiveExtractionFailures = builder.maxConsecutiveExtractionFailures; this.query = builder.query; this.queryDelay = builder.queryDelay; this.runtimeMappings = ApiTypeHelper.unmodifiable(builder.runtimeMappings); @@ -248,6 +252,23 @@ public final Integer maxEmptySearches() { return this.maxEmptySearches; } + /** + * The maximum number of consecutive real-time data extraction failures the + * datafeed tolerates before it automatically stops itself, leaving the + * associated job open. The consecutive-failure counter resets on any cycle that + * extracts successfully, including empty-data cycles. If not set, the threshold + * defaults to roughly one day's worth of searches based on the datafeed + * frequency (floored at 1). Set to -1 to disable + * auto-stop and retry indefinitely. Values of 0 or less than + * -1 are rejected. + *

+ * API name: {@code max_consecutive_extraction_failures} + */ + @Nullable + public final Integer maxConsecutiveExtractionFailures() { + return this.maxConsecutiveExtractionFailures; + } + /** * The Elasticsearch query domain-specific language (DSL). This value * corresponds to the query object in an Elasticsearch search POST body. All the @@ -374,6 +395,11 @@ protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { generator.writeKey("max_empty_searches"); generator.write(this.maxEmptySearches); + } + if (this.maxConsecutiveExtractionFailures != null) { + generator.writeKey("max_consecutive_extraction_failures"); + generator.write(this.maxConsecutiveExtractionFailures); + } if (this.query != null) { generator.writeKey("query"); @@ -454,6 +480,9 @@ public static class Builder extends WithJsonObjectBuilderBase implement @Nullable private Integer maxEmptySearches; + @Nullable + private Integer maxConsecutiveExtractionFailures; + @Nullable private Query query; @@ -481,6 +510,7 @@ private Builder(DatafeedConfig instance) { this.indicesOptions = instance.indicesOptions; this.jobId = instance.jobId; this.maxEmptySearches = instance.maxEmptySearches; + this.maxConsecutiveExtractionFailures = instance.maxConsecutiveExtractionFailures; this.query = instance.query; this.queryDelay = instance.queryDelay; this.runtimeMappings = instance.runtimeMappings; @@ -715,6 +745,23 @@ public final Builder maxEmptySearches(@Nullable Integer value) { return this; } + /** + * The maximum number of consecutive real-time data extraction failures the + * datafeed tolerates before it automatically stops itself, leaving the + * associated job open. The consecutive-failure counter resets on any cycle that + * extracts successfully, including empty-data cycles. If not set, the threshold + * defaults to roughly one day's worth of searches based on the datafeed + * frequency (floored at 1). Set to -1 to disable + * auto-stop and retry indefinitely. Values of 0 or less than + * -1 are rejected. + *

+ * API name: {@code max_consecutive_extraction_failures} + */ + public final Builder maxConsecutiveExtractionFailures(@Nullable Integer value) { + this.maxConsecutiveExtractionFailures = 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 @@ -916,6 +963,8 @@ protected static void setupDatafeedConfigDeserializer(ObjectDeserializerfrequency (floored at 1). Set to -1 to disable + * auto-stop and retry indefinitely. Values of 0 or less than + * -1 are rejected. + *

+ * API name: {@code max_consecutive_extraction_failures} + */ + @Nullable + public final Integer maxConsecutiveExtractionFailures() { + return this.maxConsecutiveExtractionFailures; + } + /** * If a real-time datafeed has never seen any data (including during any initial * training period), it automatically stops and closes the associated job after @@ -473,6 +494,11 @@ protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { generator.writeKey("job_id"); generator.write(this.jobId); + } + if (this.maxConsecutiveExtractionFailures != null) { + generator.writeKey("max_consecutive_extraction_failures"); + generator.write(this.maxConsecutiveExtractionFailures); + } if (this.maxEmptySearches != null) { generator.writeKey("max_empty_searches"); @@ -566,6 +592,9 @@ public static class Builder extends RequestBase.AbstractBuilder @Nullable private String jobId; + @Nullable + private Integer maxConsecutiveExtractionFailures; + @Nullable private Integer maxEmptySearches; @@ -600,6 +629,7 @@ private Builder(PutDatafeedRequest instance) { this.indices = instance.indices; this.indicesOptions = instance.indicesOptions; this.jobId = instance.jobId; + this.maxConsecutiveExtractionFailures = instance.maxConsecutiveExtractionFailures; this.maxEmptySearches = instance.maxEmptySearches; this.query = instance.query; this.queryDelay = instance.queryDelay; @@ -902,6 +932,23 @@ public final Builder jobId(@Nullable String value) { return this; } + /** + * The maximum number of consecutive real-time data extraction failures the + * datafeed tolerates before it automatically stops itself, leaving the + * associated job open. The consecutive-failure counter resets on any cycle that + * extracts successfully, including empty-data cycles. If not set, the threshold + * defaults to roughly one day's worth of searches based on the datafeed + * frequency (floored at 1). Set to -1 to disable + * auto-stop and retry indefinitely. Values of 0 or less than + * -1 are rejected. + *

+ * API name: {@code max_consecutive_extraction_failures} + */ + public final Builder maxConsecutiveExtractionFailures(@Nullable Integer value) { + this.maxConsecutiveExtractionFailures = value; + return this; + } + /** * If a real-time datafeed has never seen any data (including during any initial * training period), it automatically stops and closes the associated job after @@ -1119,6 +1166,8 @@ protected static void setupPutDatafeedRequestDeserializer(ObjectDeserializer @Nullable private Integer maxEmptySearches; + @Nullable + private Integer maxConsecutiveExtractionFailures; + private Query query; private Time queryDelay; @@ -552,6 +572,14 @@ public final Builder maxEmptySearches(@Nullable Integer value) { return this; } + /** + * API name: {@code max_consecutive_extraction_failures} + */ + public final Builder maxConsecutiveExtractionFailures(@Nullable Integer value) { + this.maxConsecutiveExtractionFailures = value; + return this; + } + /** * Required - API name: {@code query} */ @@ -697,6 +725,8 @@ protected static void setupPutDatafeedResponseDeserializer(ObjectDeserializerfrequency (floored at 1). Set to -1 to disable + * auto-stop and retry indefinitely. Values of 0 or less than + * -1 are rejected. + *

+ * API name: {@code max_consecutive_extraction_failures} + */ + @Nullable + public final Integer maxConsecutiveExtractionFailures() { + return this.maxConsecutiveExtractionFailures; + } + /** * If a real-time datafeed has never seen any data (including during any initial * training period), it automatically stops and closes the associated job after @@ -438,6 +459,11 @@ protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { generator.writeKey("job_id"); generator.write(this.jobId); + } + if (this.maxConsecutiveExtractionFailures != null) { + generator.writeKey("max_consecutive_extraction_failures"); + generator.write(this.maxConsecutiveExtractionFailures); + } if (this.maxEmptySearches != null) { generator.writeKey("max_empty_searches"); @@ -528,6 +554,9 @@ public static class Builder extends RequestBase.AbstractBuilder @Nullable private String jobId; + @Nullable + private Integer maxConsecutiveExtractionFailures; + @Nullable private Integer maxEmptySearches; @@ -561,6 +590,7 @@ private Builder(UpdateDatafeedRequest instance) { this.indices = instance.indices; this.indicesOptions = instance.indicesOptions; this.jobId = instance.jobId; + this.maxConsecutiveExtractionFailures = instance.maxConsecutiveExtractionFailures; this.maxEmptySearches = instance.maxEmptySearches; this.query = instance.query; this.queryDelay = instance.queryDelay; @@ -840,6 +870,23 @@ public final Builder jobId(@Nullable String value) { return this; } + /** + * The maximum number of consecutive real-time data extraction failures the + * datafeed tolerates before it automatically stops itself, leaving the + * associated job open. The consecutive-failure counter resets on any cycle that + * extracts successfully, including empty-data cycles. If not set, the threshold + * defaults to roughly one day's worth of searches based on the datafeed + * frequency (floored at 1). Set to -1 to disable + * auto-stop and retry indefinitely. Values of 0 or less than + * -1 are rejected. + *

+ * API name: {@code max_consecutive_extraction_failures} + */ + public final Builder maxConsecutiveExtractionFailures(@Nullable Integer value) { + this.maxConsecutiveExtractionFailures = value; + return this; + } + /** * If a real-time datafeed has never seen any data (including during any initial * training period), it automatically stops and closes the associated job after @@ -1070,6 +1117,8 @@ protected static void setupUpdateDatafeedRequestDeserializer(ObjectDeserializer< "indexes"); op.add(Builder::indicesOptions, IndicesOptions._DESERIALIZER, "indices_options"); op.add(Builder::jobId, JsonpDeserializer.stringDeserializer(), "job_id"); + op.add(Builder::maxConsecutiveExtractionFailures, JsonpDeserializer.integerDeserializer(), + "max_consecutive_extraction_failures"); op.add(Builder::maxEmptySearches, JsonpDeserializer.integerDeserializer(), "max_empty_searches"); op.add(Builder::query, Query._DESERIALIZER, "query"); op.add(Builder::queryDelay, Time._DESERIALIZER, "query_delay"); 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 519cfc854a..28c3896f8d 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 @@ -95,6 +95,9 @@ public class UpdateDatafeedResponse implements JsonpSerializable { @Nullable private final Integer maxEmptySearches; + @Nullable + private final Integer maxConsecutiveExtractionFailures; + private final Query query; private final Time queryDelay; @@ -119,6 +122,7 @@ private UpdateDatafeedResponse(Builder builder) { this.indicesOptions = builder.indicesOptions; this.jobId = ApiTypeHelper.requireNonNull(builder.jobId, this, "jobId"); this.maxEmptySearches = builder.maxEmptySearches; + this.maxConsecutiveExtractionFailures = builder.maxConsecutiveExtractionFailures; this.query = ApiTypeHelper.requireNonNull(builder.query, this, "query"); this.queryDelay = ApiTypeHelper.requireNonNull(builder.queryDelay, this, "queryDelay"); this.runtimeMappings = ApiTypeHelper.unmodifiable(builder.runtimeMappings); @@ -206,6 +210,14 @@ public final Integer maxEmptySearches() { return this.maxEmptySearches; } + /** + * API name: {@code max_consecutive_extraction_failures} + */ + @Nullable + public final Integer maxConsecutiveExtractionFailures() { + return this.maxConsecutiveExtractionFailures; + } + /** * Required - API name: {@code query} */ @@ -306,6 +318,11 @@ protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { generator.writeKey("max_empty_searches"); generator.write(this.maxEmptySearches); + } + if (this.maxConsecutiveExtractionFailures != null) { + generator.writeKey("max_consecutive_extraction_failures"); + generator.write(this.maxConsecutiveExtractionFailures); + } generator.writeKey("query"); this.query.serialize(generator, mapper); @@ -380,6 +397,9 @@ public static class Builder extends WithJsonObjectBuilderBase @Nullable private Integer maxEmptySearches; + @Nullable + private Integer maxConsecutiveExtractionFailures; + private Query query; private Time queryDelay; @@ -552,6 +572,14 @@ public final Builder maxEmptySearches(@Nullable Integer value) { return this; } + /** + * API name: {@code max_consecutive_extraction_failures} + */ + public final Builder maxConsecutiveExtractionFailures(@Nullable Integer value) { + this.maxConsecutiveExtractionFailures = value; + return this; + } + /** * Required - API name: {@code query} */ @@ -698,6 +726,8 @@ protected static void setupUpdateDatafeedResponseDeserializer( 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::maxConsecutiveExtractionFailures, JsonpDeserializer.integerDeserializer(), + "max_consecutive_extraction_failures"); 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/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