Skip to content

Commit

Permalink
[codegen] updated to latest api spec
Browse files Browse the repository at this point in the history
  • Loading branch information
l-trotta committed Aug 9, 2024
1 parent 4f87a27 commit 156f858
Show file tree
Hide file tree
Showing 6 changed files with 128 additions and 48 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -148,8 +148,9 @@ public final List<ExpandWildcard> expandWildcards() {

/**
* Comma-separated list of data streams, indices, and index aliases used to
* limit the request. Wildcard expressions (*) are supported. To target all data
* streams and indices in a cluster, omit this parameter or use _all or *.
* limit the request. Wildcard expressions (<code>*</code>) are supported. To
* target all data streams and indices in a cluster, omit this parameter or use
* _all or <code>*</code>.
* <p>
* API name: {@code index}
*/
Expand Down Expand Up @@ -342,8 +343,9 @@ public final Builder expandWildcards(ExpandWildcard value, ExpandWildcard... val

/**
* Comma-separated list of data streams, indices, and index aliases used to
* limit the request. Wildcard expressions (*) are supported. To target all data
* streams and indices in a cluster, omit this parameter or use _all or *.
* limit the request. Wildcard expressions (<code>*</code>) are supported. To
* target all data streams and indices in a cluster, omit this parameter or use
* _all or <code>*</code>.
* <p>
* API name: {@code index}
* <p>
Expand All @@ -356,8 +358,9 @@ public final Builder index(List<String> list) {

/**
* Comma-separated list of data streams, indices, and index aliases used to
* limit the request. Wildcard expressions (*) are supported. To target all data
* streams and indices in a cluster, omit this parameter or use _all or *.
* limit the request. Wildcard expressions (<code>*</code>) are supported. To
* target all data streams and indices in a cluster, omit this parameter or use
* _all or <code>*</code>.
* <p>
* API name: {@code index}
* <p>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -578,9 +578,6 @@ public MsearchRequest build() {
request -> {
Map<String, String> params = new HashMap<>();
params.put("typed_keys", "true");
if (request.routing != null) {
params.put("routing", request.routing);
}
if (request.preFilterShardSize != null) {
params.put("pre_filter_shard_size", String.valueOf(request.preFilterShardSize));
}
Expand All @@ -591,6 +588,15 @@ public MsearchRequest build() {
params.put("expand_wildcards",
request.expandWildcards.stream().map(v -> v.jsonValue()).collect(Collectors.joining(",")));
}
if (request.searchType != null) {
params.put("search_type", request.searchType.jsonValue());
}
if (request.ccsMinimizeRoundtrips != null) {
params.put("ccs_minimize_roundtrips", String.valueOf(request.ccsMinimizeRoundtrips));
}
if (request.routing != null) {
params.put("routing", request.routing);
}
if (request.ignoreUnavailable != null) {
params.put("ignore_unavailable", String.valueOf(request.ignoreUnavailable));
}
Expand All @@ -603,12 +609,6 @@ public MsearchRequest build() {
if (request.maxConcurrentSearches != null) {
params.put("max_concurrent_searches", String.valueOf(request.maxConcurrentSearches));
}
if (request.searchType != null) {
params.put("search_type", request.searchType.jsonValue());
}
if (request.ccsMinimizeRoundtrips != null) {
params.put("ccs_minimize_roundtrips", String.valueOf(request.ccsMinimizeRoundtrips));
}
return params;

}, SimpleEndpoint.emptyMap(), true, MsearchResponse._DESERIALIZER);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@
'_global.msearch.MultiSearchResult': '_global/msearch/types.ts#L203-L206',
'_global.msearch.MultisearchBody': '_global/msearch/types.ts#L70-L201',
'_global.msearch.MultisearchHeader': '_global/msearch/types.ts#L52-L67',
'_global.msearch.Request': '_global/msearch/MultiSearchRequest.ts#L25-L96',
'_global.msearch.Request': '_global/msearch/MultiSearchRequest.ts#L25-L106',
'_global.msearch.Response': '_global/msearch/MultiSearchResponse.ts#L25-L27',
'_global.msearch.ResponseItem': '_global/msearch/types.ts#L208-L211',
'_global.msearch_template.Request': '_global/msearch_template/MultiSearchTemplateRequest.ts#L25-L70',
Expand Down Expand Up @@ -149,7 +149,7 @@
'_global.scripts_painless_execute.Response': '_global/scripts_painless_execute/ExecutePainlessScriptResponse.ts#L20-L24',
'_global.scroll.Request': '_global/scroll/ScrollRequest.ts#L24-L59',
'_global.scroll.Response': '_global/scroll/ScrollResponse.ts#L22-L24',
'_global.search.Request': '_global/search/SearchRequest.ts#L54-L520',
'_global.search.Request': '_global/search/SearchRequest.ts#L54-L530',
'_global.search.Response': '_global/search/SearchResponse.ts#L34-L36',
'_global.search.ResponseBody': '_global/search/SearchResponse.ts#L38-L54',
'_global.search._types.AggregationBreakdown': '_global/search/_types/profile.ts#L23-L36',
Expand Down Expand Up @@ -1302,20 +1302,20 @@
'graph._types.VertexInclude': 'graph/_types/Vertex.ts#L61-L64',
'graph.explore.Request': 'graph/explore/GraphExploreRequest.ts#L28-L72',
'graph.explore.Response': 'graph/explore/GraphExploreResponse.ts#L25-L33',
'ilm._types.Actions': 'ilm/_types/Phase.ts#L42-L91',
'ilm._types.AllocateAction': 'ilm/_types/Phase.ts#L131-L137',
'ilm._types.DeleteAction': 'ilm/_types/Phase.ts#L147-L149',
'ilm._types.DownsampleAction': 'ilm/_types/Phase.ts#L110-L113',
'ilm._types.ForceMergeAction': 'ilm/_types/Phase.ts#L121-L124',
'ilm._types.MigrateAction': 'ilm/_types/Phase.ts#L139-L141',
'ilm._types.Actions': 'ilm/_types/Phase.ts#L42-L96',
'ilm._types.AllocateAction': 'ilm/_types/Phase.ts#L136-L142',
'ilm._types.DeleteAction': 'ilm/_types/Phase.ts#L152-L154',
'ilm._types.DownsampleAction': 'ilm/_types/Phase.ts#L115-L118',
'ilm._types.ForceMergeAction': 'ilm/_types/Phase.ts#L126-L129',
'ilm._types.MigrateAction': 'ilm/_types/Phase.ts#L144-L146',
'ilm._types.Phase': 'ilm/_types/Phase.ts#L26-L32',
'ilm._types.Phases': 'ilm/_types/Phase.ts#L34-L40',
'ilm._types.Policy': 'ilm/_types/Policy.ts#L23-L26',
'ilm._types.RolloverAction': 'ilm/_types/Phase.ts#L97-L108',
'ilm._types.SearchableSnapshotAction': 'ilm/_types/Phase.ts#L126-L129',
'ilm._types.SetPriorityAction': 'ilm/_types/Phase.ts#L93-L95',
'ilm._types.ShrinkAction': 'ilm/_types/Phase.ts#L115-L119',
'ilm._types.WaitForSnapshotAction': 'ilm/_types/Phase.ts#L143-L145',
'ilm._types.RolloverAction': 'ilm/_types/Phase.ts#L102-L113',
'ilm._types.SearchableSnapshotAction': 'ilm/_types/Phase.ts#L131-L134',
'ilm._types.SetPriorityAction': 'ilm/_types/Phase.ts#L98-L100',
'ilm._types.ShrinkAction': 'ilm/_types/Phase.ts#L120-L124',
'ilm._types.WaitForSnapshotAction': 'ilm/_types/Phase.ts#L148-L150',
'ilm.delete_lifecycle.Request': 'ilm/delete_lifecycle/DeleteLifecycleRequest.ts#L24-L51',
'ilm.delete_lifecycle.Response': 'ilm/delete_lifecycle/DeleteLifecycleResponse.ts#L22-L24',
'ilm.explain_lifecycle.LifecycleExplain': 'ilm/explain_lifecycle/types.ts#L59-L62',
Expand Down Expand Up @@ -2843,10 +2843,10 @@
if (hash.length > 1) {
hash = hash.substring(1);
}
window.location = "https://github.com/elastic/elasticsearch-specification/tree/b0bf13170793e6e66db261a456ff726a690216d8/specification/" + (paths[hash] || "");
window.location = "https://github.com/elastic/elasticsearch-specification/tree/19027dbdd366978ccae41842a040a636730e7c10/specification/" + (paths[hash] || "");
</script>
</head>
<body>
Please see the <a href="https://github.com/elastic/elasticsearch-specification/tree/b0bf13170793e6e66db261a456ff726a690216d8/specification/">Elasticsearch API specification</a>.
Please see the <a href="https://github.com/elastic/elasticsearch-specification/tree/19027dbdd366978ccae41842a040a636730e7c10/specification/">Elasticsearch API specification</a>.
</body>
</html>
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,9 @@ public class Actions implements JsonpSerializable {
@Nullable
private final DownsampleAction downsample;

@Nullable
private final EmptyObject freeze;

@Nullable
private final ForceMergeAction forcemerge;

Expand Down Expand Up @@ -101,6 +104,7 @@ private Actions(Builder builder) {
this.allocate = builder.allocate;
this.delete = builder.delete;
this.downsample = builder.downsample;
this.freeze = builder.freeze;
this.forcemerge = builder.forcemerge;
this.migrate = builder.migrate;
this.readonly = builder.readonly;
Expand Down Expand Up @@ -147,6 +151,19 @@ public final DownsampleAction downsample() {
return this.downsample;
}

/**
* The freeze action is a noop in 8.x
* <p>
* API name: {@code freeze}
*
* @deprecated 7.0.0
*/
@Deprecated
@Nullable
public final EmptyObject freeze() {
return this.freeze;
}

/**
* Phases allowed: hot, warm.
* <p>
Expand Down Expand Up @@ -262,6 +279,11 @@ protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) {
generator.writeKey("downsample");
this.downsample.serialize(generator, mapper);

}
if (this.freeze != null) {
generator.writeKey("freeze");
this.freeze.serialize(generator, mapper);

}
if (this.forcemerge != null) {
generator.writeKey("forcemerge");
Expand Down Expand Up @@ -332,6 +354,9 @@ public static class Builder extends WithJsonObjectBuilderBase<Builder> implement
@Nullable
private DownsampleAction downsample;

@Nullable
private EmptyObject freeze;

@Nullable
private ForceMergeAction forcemerge;

Expand Down Expand Up @@ -416,6 +441,31 @@ public final Builder downsample(Function<DownsampleAction.Builder, ObjectBuilder
return this.downsample(fn.apply(new DownsampleAction.Builder()).build());
}

/**
* The freeze action is a noop in 8.x
* <p>
* API name: {@code freeze}
*
* @deprecated 7.0.0
*/
@Deprecated
public final Builder freeze(@Nullable EmptyObject value) {
this.freeze = value;
return this;
}

/**
* The freeze action is a noop in 8.x
* <p>
* API name: {@code freeze}
*
* @deprecated 7.0.0
*/
@Deprecated
public final Builder freeze(Function<EmptyObject.Builder, ObjectBuilder<EmptyObject>> fn) {
return this.freeze(fn.apply(new EmptyObject.Builder()).build());
}

/**
* Phases allowed: hot, warm.
* <p>
Expand Down Expand Up @@ -620,6 +670,7 @@ protected static void setupActionsDeserializer(ObjectDeserializer<Actions.Builde
op.add(Builder::allocate, AllocateAction._DESERIALIZER, "allocate");
op.add(Builder::delete, DeleteAction._DESERIALIZER, "delete");
op.add(Builder::downsample, DownsampleAction._DESERIALIZER, "downsample");
op.add(Builder::freeze, EmptyObject._DESERIALIZER, "freeze");
op.add(Builder::forcemerge, ForceMergeAction._DESERIALIZER, "forcemerge");
op.add(Builder::migrate, MigrateAction._DESERIALIZER, "migrate");
op.add(Builder::readonly, EmptyObject._DESERIALIZER, "readonly");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
import java.lang.Integer;
import java.lang.Long;
import java.lang.String;
import java.util.List;
import java.util.Objects;
import java.util.function.Function;
import javax.annotation.Nullable;
Expand Down Expand Up @@ -75,7 +76,7 @@ public class TrainedModelDeploymentStats implements JsonpSerializable {

private final String modelId;

private final TrainedModelDeploymentNodesStats nodes;
private final List<TrainedModelDeploymentNodesStats> nodes;

private final int numberOfAllocations;

Expand Down Expand Up @@ -103,7 +104,7 @@ private TrainedModelDeploymentStats(Builder builder) {
this.errorCount = ApiTypeHelper.requireNonNull(builder.errorCount, this, "errorCount");
this.inferenceCount = ApiTypeHelper.requireNonNull(builder.inferenceCount, this, "inferenceCount");
this.modelId = ApiTypeHelper.requireNonNull(builder.modelId, this, "modelId");
this.nodes = ApiTypeHelper.requireNonNull(builder.nodes, this, "nodes");
this.nodes = ApiTypeHelper.unmodifiableRequired(builder.nodes, this, "nodes");
this.numberOfAllocations = ApiTypeHelper.requireNonNull(builder.numberOfAllocations, this,
"numberOfAllocations");
this.queueCapacity = ApiTypeHelper.requireNonNull(builder.queueCapacity, this, "queueCapacity");
Expand Down Expand Up @@ -184,7 +185,7 @@ public final String modelId() {
* <p>
* API name: {@code nodes}
*/
public final TrainedModelDeploymentNodesStats nodes() {
public final List<TrainedModelDeploymentNodesStats> nodes() {
return this.nodes;
}

Expand Down Expand Up @@ -298,9 +299,16 @@ protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) {
generator.writeKey("model_id");
generator.write(this.modelId);

generator.writeKey("nodes");
this.nodes.serialize(generator, mapper);
if (ApiTypeHelper.isDefined(this.nodes)) {
generator.writeKey("nodes");
generator.writeStartArray();
for (TrainedModelDeploymentNodesStats item0 : this.nodes) {
item0.serialize(generator, mapper);

}
generator.writeEnd();

}
generator.writeKey("number_of_allocations");
generator.write(this.numberOfAllocations);

Expand Down Expand Up @@ -353,7 +361,7 @@ public static class Builder extends WithJsonObjectBuilderBase<Builder>

private String modelId;

private TrainedModelDeploymentNodesStats nodes;
private List<TrainedModelDeploymentNodesStats> nodes;

private Integer numberOfAllocations;

Expand Down Expand Up @@ -447,9 +455,11 @@ public final Builder modelId(String value) {
* node.
* <p>
* API name: {@code nodes}
* <p>
* Adds all elements of <code>list</code> to <code>nodes</code>.
*/
public final Builder nodes(TrainedModelDeploymentNodesStats value) {
this.nodes = value;
public final Builder nodes(List<TrainedModelDeploymentNodesStats> list) {
this.nodes = _listAddAll(this.nodes, list);
return this;
}

Expand All @@ -459,10 +469,26 @@ public final Builder nodes(TrainedModelDeploymentNodesStats value) {
* node.
* <p>
* API name: {@code nodes}
* <p>
* Adds one or more values to <code>nodes</code>.
*/
public final Builder nodes(TrainedModelDeploymentNodesStats value, TrainedModelDeploymentNodesStats... values) {
this.nodes = _listAdd(this.nodes, value, values);
return this;
}

/**
* Required - The deployment stats for each node that currently has the model
* allocated. In serverless, stats are reported for a single unnamed virtual
* node.
* <p>
* API name: {@code nodes}
* <p>
* Adds a value to <code>nodes</code> using a builder lambda.
*/
public final Builder nodes(
Function<TrainedModelDeploymentNodesStats.Builder, ObjectBuilder<TrainedModelDeploymentNodesStats>> fn) {
return this.nodes(fn.apply(new TrainedModelDeploymentNodesStats.Builder()).build());
return nodes(fn.apply(new TrainedModelDeploymentNodesStats.Builder()).build());
}

/**
Expand Down Expand Up @@ -587,7 +613,8 @@ protected static void setupTrainedModelDeploymentStatsDeserializer(
op.add(Builder::errorCount, JsonpDeserializer.integerDeserializer(), "error_count");
op.add(Builder::inferenceCount, JsonpDeserializer.integerDeserializer(), "inference_count");
op.add(Builder::modelId, JsonpDeserializer.stringDeserializer(), "model_id");
op.add(Builder::nodes, TrainedModelDeploymentNodesStats._DESERIALIZER, "nodes");
op.add(Builder::nodes, JsonpDeserializer.arrayDeserializer(TrainedModelDeploymentNodesStats._DESERIALIZER),
"nodes");
op.add(Builder::numberOfAllocations, JsonpDeserializer.integerDeserializer(), "number_of_allocations");
op.add(Builder::queueCapacity, JsonpDeserializer.integerDeserializer(), "queue_capacity");
op.add(Builder::rejectedExecutionCount, JsonpDeserializer.integerDeserializer(), "rejected_execution_count");
Expand Down
Loading

0 comments on commit 156f858

Please sign in to comment.