From a4d058428c7d1163db104e9ab0edbb921d098b31 Mon Sep 17 00:00:00 2001 From: Laura Trotta Date: Thu, 26 Feb 2026 14:09:51 +0000 Subject: [PATCH] [codegen] update to latest spec --- .../elasticsearch/doc-files/api-spec.html | 16 +- .../elasticsearch/esql/QueryRequest.java | 40 +++ .../inference/GetInferenceRequest.java | 25 +- .../xpack/XpackUsageResponse.java | 38 +++ .../elasticsearch/xpack/info/Features.java | 37 +++ .../xpack/usage/GpuNodeStats.java | 261 ++++++++++++++++++ .../xpack/usage/GpuVectorIndexing.java | 253 +++++++++++++++++ 7 files changed, 659 insertions(+), 11 deletions(-) create mode 100644 java-client/src/main/java/co/elastic/clients/elasticsearch/xpack/usage/GpuNodeStats.java create mode 100644 java-client/src/main/java/co/elastic/clients/elasticsearch/xpack/usage/GpuVectorIndexing.java 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 26598d100a..b3b37720fb 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 @@ -1487,7 +1487,7 @@ 'esql.list_queries.Response': 'esql/list_queries/ListQueriesResponse.ts#L32-L36', 'esql.put_view.Request': 'esql/put_view/PutViewRequest.ts#L23-L49', 'esql.put_view.Response': 'esql/put_view/PutViewResponse.ts#L22-L25', -'esql.query.Request': 'esql/query/QueryRequest.ts#L28-L128', +'esql.query.Request': 'esql/query/QueryRequest.ts#L28-L140', 'esql.query.Response': 'esql/query/QueryResponse.ts#L22-L25', 'features._types.Feature': 'features/_types/Feature.ts#L20-L23', 'features.get_features.Request': 'features/get_features/GetFeaturesRequest.ts#L24-L56', @@ -2074,7 +2074,7 @@ 'inference.completion.Response': 'inference/completion/CompletionResponse.ts#L22-L25', 'inference.delete.Request': 'inference/delete/DeleteRequest.ts#L24-L69', 'inference.delete.Response': 'inference/delete/DeleteResponse.ts#L22-L25', -'inference.get.Request': 'inference/get/GetRequest.ts#L24-L59', +'inference.get.Request': 'inference/get/GetRequest.ts#L24-L64', 'inference.get.Response': 'inference/get/GetResponse.ts#L22-L26', 'inference.inference.Request': 'inference/inference/InferenceRequest.ts#L26-L106', 'inference.inference.Response': 'inference/inference/InferenceResponse.ts#L22-L25', @@ -3423,8 +3423,8 @@ 'watcher.update_settings.Request': 'watcher/update_settings/WatcherUpdateSettingsRequest.ts#L25-L66', 'watcher.update_settings.Response': 'watcher/update_settings/WatcherUpdateSettingsResponse.ts#L20-L24', 'xpack.info.BuildInformation': 'xpack/info/types.ts#L24-L27', -'xpack.info.Feature': 'xpack/info/types.ts#L84-L89', -'xpack.info.Features': 'xpack/info/types.ts#L42-L82', +'xpack.info.Feature': 'xpack/info/types.ts#L88-L93', +'xpack.info.Features': 'xpack/info/types.ts#L42-L86', 'xpack.info.MinimalLicenseInformation': 'xpack/info/types.ts#L34-L40', 'xpack.info.NativeCodeInformation': 'xpack/info/types.ts#L29-L32', 'xpack.info.Request': 'xpack/info/XPackInfoRequest.ts#L23-L63', @@ -3449,6 +3449,8 @@ 'xpack.usage.EqlFeaturesSequences': 'xpack/usage/types.ts#L127-L134', 'xpack.usage.FeatureToggle': 'xpack/usage/types.ts#L37-L39', 'xpack.usage.Flattened': 'xpack/usage/types.ts#L399-L401', +'xpack.usage.GpuNodeStats': 'xpack/usage/types.ts#L510-L522', +'xpack.usage.GpuVectorIndexing': 'xpack/usage/types.ts#L524-L534', 'xpack.usage.HealthStatistics': 'xpack/usage/types.ts#L150-L152', 'xpack.usage.Ilm': 'xpack/usage/types.ts#L172-L175', 'xpack.usage.IlmPolicyStatistics': 'xpack/usage/types.ts#L167-L170', @@ -3476,7 +3478,7 @@ 'xpack.usage.Realm': 'xpack/usage/types.ts#L456-L465', 'xpack.usage.RealmCache': 'xpack/usage/types.ts#L276-L278', 'xpack.usage.Request': 'xpack/usage/XPackUsageRequest.ts#L24-L52', -'xpack.usage.Response': 'xpack/usage/XPackUsageResponse.ts#L42-L77', +'xpack.usage.Response': 'xpack/usage/XPackUsageResponse.ts#L43-L82', 'xpack.usage.RoleMapping': 'xpack/usage/types.ts#L280-L283', 'xpack.usage.RuntimeFieldTypes': 'xpack/usage/types.ts#L285-L287', 'xpack.usage.RuntimeFieldsType': 'xpack/usage/types.ts#L289-L304', @@ -3502,10 +3504,10 @@ if (hash.length > 1) { hash = hash.substring(1); } - window.location = "https://github.com/elastic/elasticsearch-specification/tree/0d7660dad7514c66b2d9beebacca4fb54575d857/specification/" + (paths[hash] || ""); + window.location = "https://github.com/elastic/elasticsearch-specification/tree/e19c0a81f07307768d2b3db53a8d885a25479d34/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/esql/QueryRequest.java b/java-client/src/main/java/co/elastic/clients/elasticsearch/esql/QueryRequest.java index 709642c5ab..c0f88375ee 100644 --- a/java-client/src/main/java/co/elastic/clients/elasticsearch/esql/QueryRequest.java +++ b/java-client/src/main/java/co/elastic/clients/elasticsearch/esql/QueryRequest.java @@ -106,6 +106,9 @@ public class QueryRequest extends RequestBase implements JsonpSerializable { @Nullable private final Boolean profile; + @Nullable + private final String projectRouting; + private final String query; private final Map> tables; @@ -125,6 +128,7 @@ private QueryRequest(Builder builder) { this.locale = builder.locale; this.params = ApiTypeHelper.unmodifiable(builder.params); this.profile = builder.profile; + this.projectRouting = builder.projectRouting; this.query = ApiTypeHelper.requireNonNull(builder.query, this, "query"); this.tables = ApiTypeHelper.unmodifiable(builder.tables); @@ -272,6 +276,19 @@ public final Boolean profile() { return this.profile; } + /** + * Specifies a subset of projects to target using project metadata tags in a + * subset of Lucene query syntax. Allowed Lucene queries: the _alias tag and a + * single value (possibly wildcarded). Examples: _alias:my-project + * _alias:_origin _alias:pr Supported in serverless only. + *

+ * API name: {@code project_routing} + */ + @Nullable + public final String projectRouting() { + return this.projectRouting; + } + /** * Required - The ES|QL query API accepts an ES|QL query string in the query * parameter, runs it, and returns the results. @@ -342,6 +359,11 @@ protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { generator.writeKey("profile"); generator.write(this.profile); + } + if (this.projectRouting != null) { + generator.writeKey("project_routing"); + generator.write(this.projectRouting); + } generator.writeKey("query"); generator.write(this.query); @@ -408,6 +430,9 @@ public static class Builder extends RequestBase.AbstractBuilder impleme @Nullable private Boolean profile; + @Nullable + private String projectRouting; + private String query; @Nullable @@ -427,6 +452,7 @@ private Builder(QueryRequest instance) { this.locale = instance.locale; this.params = instance.params; this.profile = instance.profile; + this.projectRouting = instance.projectRouting; this.query = instance.query; this.tables = instance.tables; @@ -688,6 +714,19 @@ public final Builder profile(@Nullable Boolean value) { return this; } + /** + * Specifies a subset of projects to target using project metadata tags in a + * subset of Lucene query syntax. Allowed Lucene queries: the _alias tag and a + * single value (possibly wildcarded). Examples: _alias:my-project + * _alias:_origin _alias:pr Supported in serverless only. + *

+ * API name: {@code project_routing} + */ + public final Builder projectRouting(@Nullable String value) { + this.projectRouting = value; + return this; + } + /** * Required - The ES|QL query API accepts an ES|QL query string in the query * parameter, runs it, and returns the results. @@ -767,6 +806,7 @@ protected static void setupQueryRequestDeserializer(ObjectDeserializer_all or + * * will return all endpoints with the specified + * task_type if one is specified, or all endpoints for all task + * types if no task_type is specified *

* API name: {@code inference_id} */ @@ -96,7 +99,7 @@ public final String inferenceId() { } /** - * The task type + * The task type of the endpoint to return *

* API name: {@code task_type} */ @@ -128,7 +131,10 @@ private Builder(GetInferenceRequest instance) { } /** - * The inference Id + * The inference Id of the endpoint to return. Using _all or + * * will return all endpoints with the specified + * task_type if one is specified, or all endpoints for all task + * types if no task_type is specified *

* API name: {@code inference_id} */ @@ -138,7 +144,7 @@ public final Builder inferenceId(@Nullable String value) { } /** - * The task type + * The task type of the endpoint to return *

* API name: {@code task_type} */ @@ -218,6 +224,14 @@ public Builder rebuild() { SimpleEndpoint.pathEncode(request.inferenceId, buf); return buf.toString(); } + if (propsSet == (_taskType)) { + StringBuilder buf = new StringBuilder(); + buf.append("/_inference"); + buf.append("/"); + SimpleEndpoint.pathEncode(request.taskType.jsonValue(), buf); + buf.append("/_all"); + return buf.toString(); + } throw SimpleEndpoint.noPathTemplateFound("path"); }, @@ -244,6 +258,9 @@ public Builder rebuild() { params.put("taskType", request.taskType.jsonValue()); params.put("inferenceId", request.inferenceId); } + if (propsSet == (_taskType)) { + params.put("taskType", request.taskType.jsonValue()); + } return params; }, diff --git a/java-client/src/main/java/co/elastic/clients/elasticsearch/xpack/XpackUsageResponse.java b/java-client/src/main/java/co/elastic/clients/elasticsearch/xpack/XpackUsageResponse.java index 676f2ac87d..706da3aa76 100644 --- a/java-client/src/main/java/co/elastic/clients/elasticsearch/xpack/XpackUsageResponse.java +++ b/java-client/src/main/java/co/elastic/clients/elasticsearch/xpack/XpackUsageResponse.java @@ -27,6 +27,7 @@ import co.elastic.clients.elasticsearch.xpack.usage.DataTiers; import co.elastic.clients.elasticsearch.xpack.usage.Eql; import co.elastic.clients.elasticsearch.xpack.usage.Flattened; +import co.elastic.clients.elasticsearch.xpack.usage.GpuVectorIndexing; import co.elastic.clients.elasticsearch.xpack.usage.HealthStatistics; import co.elastic.clients.elasticsearch.xpack.usage.Ilm; import co.elastic.clients.elasticsearch.xpack.usage.MachineLearning; @@ -108,6 +109,9 @@ public class XpackUsageResponse implements JsonpSerializable { private final Base graph; + @Nullable + private final GpuVectorIndexing gpuVectorIndexing; + @Nullable private final HealthStatistics healthApi; @@ -158,6 +162,7 @@ private XpackUsageResponse(Builder builder) { this.eql = ApiTypeHelper.requireNonNull(builder.eql, this, "eql"); this.flattened = builder.flattened; this.graph = ApiTypeHelper.requireNonNull(builder.graph, this, "graph"); + this.gpuVectorIndexing = builder.gpuVectorIndexing; this.healthApi = builder.healthApi; this.ilm = ApiTypeHelper.requireNonNull(builder.ilm, this, "ilm"); this.logstash = ApiTypeHelper.requireNonNull(builder.logstash, this, "logstash"); @@ -277,6 +282,14 @@ public final Base graph() { return this.graph; } + /** + * API name: {@code gpu_vector_indexing} + */ + @Nullable + public final GpuVectorIndexing gpuVectorIndexing() { + return this.gpuVectorIndexing; + } + /** * API name: {@code health_api} */ @@ -445,6 +458,11 @@ protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { generator.writeKey("graph"); this.graph.serialize(generator, mapper); + if (this.gpuVectorIndexing != null) { + generator.writeKey("gpu_vector_indexing"); + this.gpuVectorIndexing.serialize(generator, mapper); + + } if (this.healthApi != null) { generator.writeKey("health_api"); this.healthApi.serialize(generator, mapper); @@ -543,6 +561,9 @@ public static class Builder extends WithJsonObjectBuilderBase private Base graph; + @Nullable + private GpuVectorIndexing gpuVectorIndexing; + @Nullable private HealthStatistics healthApi; @@ -771,6 +792,22 @@ public final Builder graph(Function> fn) { return this.graph(fn.apply(new Base.Builder()).build()); } + /** + * API name: {@code gpu_vector_indexing} + */ + public final Builder gpuVectorIndexing(@Nullable GpuVectorIndexing value) { + this.gpuVectorIndexing = value; + return this; + } + + /** + * API name: {@code gpu_vector_indexing} + */ + public final Builder gpuVectorIndexing( + Function> fn) { + return this.gpuVectorIndexing(fn.apply(new GpuVectorIndexing.Builder()).build()); + } + /** * API name: {@code health_api} */ @@ -1038,6 +1075,7 @@ protected static void setupXpackUsageResponseDeserializer(ObjectDeserializer implement private Feature graph; + @Nullable + private Feature gpuVectorIndexing; + private Feature ilm; private Feature logstash; @@ -539,6 +559,7 @@ private Builder(Features instance) { this.eql = instance.eql; this.esql = instance.esql; this.graph = instance.graph; + this.gpuVectorIndexing = instance.gpuVectorIndexing; this.ilm = instance.ilm; this.logstash = instance.logstash; this.logsdb = instance.logsdb; @@ -708,6 +729,21 @@ public final Builder graph(Function> fn) return this.graph(fn.apply(new Feature.Builder()).build()); } + /** + * Required - API name: {@code gpu_vector_indexing} + */ + public final Builder gpuVectorIndexing(@Nullable Feature value) { + this.gpuVectorIndexing = value; + return this; + } + + /** + * Required - API name: {@code gpu_vector_indexing} + */ + public final Builder gpuVectorIndexing(Function> fn) { + return this.gpuVectorIndexing(fn.apply(new Feature.Builder()).build()); + } + /** * Required - API name: {@code ilm} */ @@ -1007,6 +1043,7 @@ protected static void setupFeaturesDeserializer(ObjectDeserializerAPI + * specification + */ +@JsonpDeserializable +public class GpuNodeStats implements JsonpSerializable { + private final String type; + + private final long memoryInBytes; + + private final boolean enabled; + + private final long indexBuildCount; + + // --------------------------------------------------------------------------------------------- + + private GpuNodeStats(Builder builder) { + + this.type = ApiTypeHelper.requireNonNull(builder.type, this, "type"); + this.memoryInBytes = ApiTypeHelper.requireNonNull(builder.memoryInBytes, this, "memoryInBytes", 0); + this.enabled = ApiTypeHelper.requireNonNull(builder.enabled, this, "enabled", false); + this.indexBuildCount = ApiTypeHelper.requireNonNull(builder.indexBuildCount, this, "indexBuildCount", 0); + + } + + public static GpuNodeStats of(Function> fn) { + return fn.apply(new Builder()).build(); + } + + /** + * Required - GPU device type (e.g., "NVIDIA L4", "NVIDIA + * A100"). + *

+ * API name: {@code type} + */ + public final String type() { + return this.type; + } + + /** + * Required - GPU memory in bytes. + *

+ * API name: {@code memory_in_bytes} + */ + public final long memoryInBytes() { + return this.memoryInBytes; + } + + /** + * Required - Whether GPU vector indexing is enabled on this node. + *

+ * API name: {@code enabled} + */ + public final boolean enabled() { + return this.enabled; + } + + /** + * Required - Number of GPU index builds performed on this node. + *

+ * API name: {@code index_build_count} + */ + public final long indexBuildCount() { + return this.indexBuildCount; + } + + /** + * 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("type"); + generator.write(this.type); + + generator.writeKey("memory_in_bytes"); + generator.write(this.memoryInBytes); + + generator.writeKey("enabled"); + generator.write(this.enabled); + + generator.writeKey("index_build_count"); + generator.write(this.indexBuildCount); + + } + + @Override + public String toString() { + return JsonpUtils.toString(this); + } + + // --------------------------------------------------------------------------------------------- + + /** + * Builder for {@link GpuNodeStats}. + */ + + public static class Builder extends WithJsonObjectBuilderBase implements ObjectBuilder { + private String type; + + private Long memoryInBytes; + + private Boolean enabled; + + private Long indexBuildCount; + + public Builder() { + } + private Builder(GpuNodeStats instance) { + this.type = instance.type; + this.memoryInBytes = instance.memoryInBytes; + this.enabled = instance.enabled; + this.indexBuildCount = instance.indexBuildCount; + + } + /** + * Required - GPU device type (e.g., "NVIDIA L4", "NVIDIA + * A100"). + *

+ * API name: {@code type} + */ + public final Builder type(String value) { + this.type = value; + return this; + } + + /** + * Required - GPU memory in bytes. + *

+ * API name: {@code memory_in_bytes} + */ + public final Builder memoryInBytes(long value) { + this.memoryInBytes = value; + return this; + } + + /** + * Required - Whether GPU vector indexing is enabled on this node. + *

+ * API name: {@code enabled} + */ + public final Builder enabled(boolean value) { + this.enabled = value; + return this; + } + + /** + * Required - Number of GPU index builds performed on this node. + *

+ * API name: {@code index_build_count} + */ + public final Builder indexBuildCount(long value) { + this.indexBuildCount = value; + return this; + } + + @Override + protected Builder self() { + return this; + } + + /** + * Builds a {@link GpuNodeStats}. + * + * @throws NullPointerException + * if some of the required fields are null. + */ + public GpuNodeStats build() { + _checkSingleUse(); + + return new GpuNodeStats(this); + } + } + + /** + * @return New {@link Builder} initialized with field values of this instance + */ + public Builder rebuild() { + return new Builder(this); + } + // --------------------------------------------------------------------------------------------- + + /** + * Json deserializer for {@link GpuNodeStats} + */ + public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer.lazy(Builder::new, + GpuNodeStats::setupGpuNodeStatsDeserializer); + + protected static void setupGpuNodeStatsDeserializer(ObjectDeserializer op) { + + op.add(Builder::type, JsonpDeserializer.stringDeserializer(), "type"); + op.add(Builder::memoryInBytes, JsonpDeserializer.longDeserializer(), "memory_in_bytes"); + op.add(Builder::enabled, JsonpDeserializer.booleanDeserializer(), "enabled"); + op.add(Builder::indexBuildCount, JsonpDeserializer.longDeserializer(), "index_build_count"); + + } + +} diff --git a/java-client/src/main/java/co/elastic/clients/elasticsearch/xpack/usage/GpuVectorIndexing.java b/java-client/src/main/java/co/elastic/clients/elasticsearch/xpack/usage/GpuVectorIndexing.java new file mode 100644 index 0000000000..b90dbbb1b6 --- /dev/null +++ b/java-client/src/main/java/co/elastic/clients/elasticsearch/xpack/usage/GpuVectorIndexing.java @@ -0,0 +1,253 @@ +/* + * 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.xpack.usage; + +import co.elastic.clients.json.JsonpDeserializable; +import co.elastic.clients.json.JsonpDeserializer; +import co.elastic.clients.json.JsonpMapper; +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 jakarta.json.stream.JsonGenerator; +import java.lang.Integer; +import java.lang.Long; +import java.util.List; +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: xpack.usage.GpuVectorIndexing + +/** + * GPU vector indexing usage statistics. + * + * @see API + * specification + */ +@JsonpDeserializable +public class GpuVectorIndexing extends Base { + private final long indexBuildCount; + + private final int nodesWithGpu; + + private final List nodes; + + // --------------------------------------------------------------------------------------------- + + private GpuVectorIndexing(Builder builder) { + super(builder); + + this.indexBuildCount = ApiTypeHelper.requireNonNull(builder.indexBuildCount, this, "indexBuildCount", 0); + this.nodesWithGpu = ApiTypeHelper.requireNonNull(builder.nodesWithGpu, this, "nodesWithGpu", 0); + this.nodes = ApiTypeHelper.unmodifiableRequired(builder.nodes, this, "nodes"); + + } + + public static GpuVectorIndexing of(Function> fn) { + return fn.apply(new Builder()).build(); + } + + /** + * Required - Total GPU index builds across the cluster. + *

+ * API name: {@code index_build_count} + */ + public final long indexBuildCount() { + return this.indexBuildCount; + } + + /** + * Required - Count of data nodes with GPU support. + *

+ * API name: {@code nodes_with_gpu} + */ + public final int nodesWithGpu() { + return this.nodesWithGpu; + } + + /** + * Required - Per-node GPU details including type, memory, enabled status, and + * build count. + *

+ * API name: {@code nodes} + */ + public final List nodes() { + return this.nodes; + } + + protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { + + super.serializeInternal(generator, mapper); + generator.writeKey("index_build_count"); + generator.write(this.indexBuildCount); + + generator.writeKey("nodes_with_gpu"); + generator.write(this.nodesWithGpu); + + if (ApiTypeHelper.isDefined(this.nodes)) { + generator.writeKey("nodes"); + generator.writeStartArray(); + for (GpuNodeStats item0 : this.nodes) { + item0.serialize(generator, mapper); + + } + generator.writeEnd(); + + } + + } + + // --------------------------------------------------------------------------------------------- + + /** + * Builder for {@link GpuVectorIndexing}. + */ + + public static class Builder extends Base.AbstractBuilder implements ObjectBuilder { + private Long indexBuildCount; + + private Integer nodesWithGpu; + + private List nodes; + + public Builder() { + } + private Builder(GpuVectorIndexing instance) { + this.indexBuildCount = instance.indexBuildCount; + this.nodesWithGpu = instance.nodesWithGpu; + this.nodes = instance.nodes; + + } + /** + * Required - Total GPU index builds across the cluster. + *

+ * API name: {@code index_build_count} + */ + public final Builder indexBuildCount(long value) { + this.indexBuildCount = value; + return this; + } + + /** + * Required - Count of data nodes with GPU support. + *

+ * API name: {@code nodes_with_gpu} + */ + public final Builder nodesWithGpu(int value) { + this.nodesWithGpu = value; + return this; + } + + /** + * Required - Per-node GPU details including type, memory, enabled status, and + * build count. + *

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

+ * Adds all elements of list to nodes. + */ + public final Builder nodes(List list) { + this.nodes = _listAddAll(this.nodes, list); + return this; + } + + /** + * Required - Per-node GPU details including type, memory, enabled status, and + * build count. + *

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

+ * Adds one or more values to nodes. + */ + public final Builder nodes(GpuNodeStats value, GpuNodeStats... values) { + this.nodes = _listAdd(this.nodes, value, values); + return this; + } + + /** + * Required - Per-node GPU details including type, memory, enabled status, and + * build count. + *

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

+ * Adds a value to nodes using a builder lambda. + */ + public final Builder nodes(Function> fn) { + return nodes(fn.apply(new GpuNodeStats.Builder()).build()); + } + + @Override + protected Builder self() { + return this; + } + + /** + * Builds a {@link GpuVectorIndexing}. + * + * @throws NullPointerException + * if some of the required fields are null. + */ + public GpuVectorIndexing build() { + _checkSingleUse(); + + return new GpuVectorIndexing(this); + } + } + + /** + * @return New {@link Builder} initialized with field values of this instance + */ + public Builder rebuild() { + return new Builder(this); + } + // --------------------------------------------------------------------------------------------- + + /** + * Json deserializer for {@link GpuVectorIndexing} + */ + public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer + .lazy(Builder::new, GpuVectorIndexing::setupGpuVectorIndexingDeserializer); + + protected static void setupGpuVectorIndexingDeserializer(ObjectDeserializer op) { + Base.setupBaseDeserializer(op); + op.add(Builder::indexBuildCount, JsonpDeserializer.longDeserializer(), "index_build_count"); + op.add(Builder::nodesWithGpu, JsonpDeserializer.integerDeserializer(), "nodes_with_gpu"); + op.add(Builder::nodes, JsonpDeserializer.arrayDeserializer(GpuNodeStats._DESERIALIZER), "nodes"); + + } + +}