diff --git a/.buildkite/release_central.yml b/.buildkite/release_central.yml index 648205d35..11c20c4af 100644 --- a/.buildkite/release_central.yml +++ b/.buildkite/release_central.yml @@ -7,6 +7,15 @@ steps: command: ".ci/release_central.sh" artifact_paths: - ".ci/output/repository/**/*" + - "signed-artifacts/**/*" + - wait: ~ + - label: "Publish S3 Artifacts :s3:" + trigger: unified-release-publish-s3-artifacts + key: publish-s3-service + build: + env: + DESTINATION_PATH: "s3://artifacts.elastic.co/javadoc/co/elastic/clients/elasticsearch-java/" + EXTRACT_ARTIFACT: "${VERSION}/elasticsearch-java-${VERSION}-javadoc.jar" #notify: # - slack: "#devtools-notify" diff --git a/.ci/make.sh b/.ci/make.sh index 8f1cebfe2..43c43195b 100755 --- a/.ci/make.sh +++ b/.ci/make.sh @@ -188,12 +188,13 @@ fi if [[ "$CMD" == "release" ]]; then rm -rf .ci/output/repository + rm -rf signed-artifacts build_image echo -e "\033[34;1mINFO:\033[0m Building version ${VERSION}\033[0m" if [[ "$DRY_RUN" = "true" ]]; then echo "Dry run: building and publishing to the local repository" - gradle_task="publishAllPublicationsToDryRunRepository" + gradle_task="publishForReleaseManager" else echo "Releasing to Maven snapshot repo" gradle_task="publishToSonatype closeAndReleaseStagingRepositories" @@ -203,6 +204,9 @@ if [[ "$CMD" == "release" ]]; then -v /tmp/secured:/tmp/secured \ $docker_image \ $gradle_task + + mkdir -p signed-artifacts/$VERSION + cp .ci/output/repository/co/elastic/clients/elasticsearch-java/$VERSION/elasticsearch-java-${VERSION}-javadoc.jar signed-artifacts/$VERSION/elasticsearch-java-${VERSION}-javadoc.jar fi if [[ "$CMD" == "bump" ]]; then diff --git a/config/version.txt b/config/version.txt index b0b6fd6a4..ee21f1efe 100644 --- a/config/version.txt +++ b/config/version.txt @@ -1 +1 @@ -8.19.2 +8.19.3 diff --git a/java-client/src/main-flavored/java/co/elastic/clients/transport/VersionInfo.java b/java-client/src/main-flavored/java/co/elastic/clients/transport/VersionInfo.java index a4a6f1dbe..2d786a833 100644 --- a/java-client/src/main-flavored/java/co/elastic/clients/transport/VersionInfo.java +++ b/java-client/src/main-flavored/java/co/elastic/clients/transport/VersionInfo.java @@ -21,5 +21,5 @@ // Package private class VersionInfo { - static final String VERSION = "8.19.2"; + static final String VERSION = "8.19.3"; } diff --git a/java-client/src/main/java/co/elastic/clients/elasticsearch/_types/ShardFailure.java b/java-client/src/main/java/co/elastic/clients/elasticsearch/_types/ShardFailure.java index ac333cab0..7bedf6ad2 100644 --- a/java-client/src/main/java/co/elastic/clients/elasticsearch/_types/ShardFailure.java +++ b/java-client/src/main/java/co/elastic/clients/elasticsearch/_types/ShardFailure.java @@ -30,6 +30,7 @@ import co.elastic.clients.util.ObjectBuilder; import co.elastic.clients.util.WithJsonObjectBuilderBase; import jakarta.json.stream.JsonGenerator; +import java.lang.Boolean; import java.lang.Integer; import java.lang.String; import java.util.Objects; @@ -68,11 +69,15 @@ public class ShardFailure implements JsonpSerializable { private final ErrorCause reason; - private final int shard; + @Nullable + private final Integer shard; @Nullable private final String status; + @Nullable + private final Boolean primary; + // --------------------------------------------------------------------------------------------- private ShardFailure(Builder builder) { @@ -80,8 +85,9 @@ private ShardFailure(Builder builder) { this.index = builder.index; this.node = builder.node; this.reason = ApiTypeHelper.requireNonNull(builder.reason, this, "reason"); - this.shard = ApiTypeHelper.requireNonNull(builder.shard, this, "shard", 0); + this.shard = builder.shard; this.status = builder.status; + this.primary = builder.primary; } @@ -113,9 +119,10 @@ public final ErrorCause reason() { } /** - * Required - API name: {@code shard} + * API name: {@code shard} */ - public final int shard() { + @Nullable + public final Integer shard() { return this.shard; } @@ -127,6 +134,14 @@ public final String status() { return this.status; } + /** + * API name: {@code primary} + */ + @Nullable + public final Boolean primary() { + return this.primary; + } + /** * Serialize this object to JSON. */ @@ -151,14 +166,21 @@ protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { generator.writeKey("reason"); this.reason.serialize(generator, mapper); - generator.writeKey("shard"); - generator.write(this.shard); + if (this.shard != null) { + generator.writeKey("shard"); + generator.write(this.shard); + } if (this.status != null) { generator.writeKey("status"); generator.write(this.status); } + if (this.primary != null) { + generator.writeKey("primary"); + generator.write(this.primary); + + } } @@ -182,11 +204,15 @@ public static class Builder extends WithJsonObjectBuilderBase implement private ErrorCause reason; + @Nullable private Integer shard; @Nullable private String status; + @Nullable + private Boolean primary; + /** * API name: {@code index} */ @@ -219,9 +245,9 @@ public final Builder reason(Function op) { - op.add(Builder::index, JsonpDeserializer.stringDeserializer(), "index"); - op.add(Builder::node, JsonpDeserializer.stringDeserializer(), "node"); + op.add(Builder::index, JsonpDeserializer.stringDeserializer(), "index", "_index"); + op.add(Builder::node, JsonpDeserializer.stringDeserializer(), "node", "_node"); op.add(Builder::reason, ErrorCause._DESERIALIZER, "reason"); - op.add(Builder::shard, JsonpDeserializer.integerDeserializer(), "shard"); + op.add(Builder::shard, JsonpDeserializer.integerDeserializer(), "shard", "_shard"); op.add(Builder::status, JsonpDeserializer.stringDeserializer(), "status"); + op.add(Builder::primary, JsonpDeserializer.booleanDeserializer(), "primary"); } diff --git a/java-client/src/main/java/co/elastic/clients/elasticsearch/cat/AliasesRequest.java b/java-client/src/main/java/co/elastic/clients/elasticsearch/cat/AliasesRequest.java index 3b28a8109..ebed0622e 100644 --- a/java-client/src/main/java/co/elastic/clients/elasticsearch/cat/AliasesRequest.java +++ b/java-client/src/main/java/co/elastic/clients/elasticsearch/cat/AliasesRequest.java @@ -32,6 +32,7 @@ import jakarta.json.stream.JsonGenerator; import java.lang.Boolean; import java.lang.String; +import java.util.Arrays; import java.util.HashMap; import java.util.List; import java.util.Map; @@ -112,7 +113,8 @@ public final List expandWildcards() { } /** - * List of columns to appear in the response. Supports simple wildcards. + * A comma-separated list of columns names to display. It supports simple + * wildcards. *

* API name: {@code h} */ @@ -211,7 +213,8 @@ public final Builder expandWildcards(ExpandWildcard value, ExpandWildcard... val } /** - * List of columns to appear in the response. Supports simple wildcards. + * A comma-separated list of columns names to display. It supports simple + * wildcards. *

* API name: {@code h} *

@@ -223,7 +226,8 @@ public final Builder h(List list) { } /** - * List of columns to appear in the response. Supports simple wildcards. + * A comma-separated list of columns names to display. It supports simple + * wildcards. *

* API name: {@code h} *

@@ -234,6 +238,20 @@ public final Builder h(String value, String... values) { return this; } + /** + * A comma-separated list of columns names to display. It supports simple + * wildcards. + *

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

+ * Adds one or more enum values to h. + */ + public final Builder h(CatAliasesColumn value, CatAliasesColumn... values) { + this.h = _listAdd(this.h, value.jsonValue(), + Arrays.stream(values).map(CatAliasesColumn::jsonValue).toArray(String[]::new)); + return this; + } + /** * If true, the request computes the list of selected nodes from * the local cluster state. If false the list of selected nodes are diff --git a/java-client/src/main/java/co/elastic/clients/elasticsearch/cat/AllocationRequest.java b/java-client/src/main/java/co/elastic/clients/elasticsearch/cat/AllocationRequest.java index 1ddec4603..79605fbde 100644 --- a/java-client/src/main/java/co/elastic/clients/elasticsearch/cat/AllocationRequest.java +++ b/java-client/src/main/java/co/elastic/clients/elasticsearch/cat/AllocationRequest.java @@ -33,6 +33,7 @@ import jakarta.json.stream.JsonGenerator; import java.lang.Boolean; import java.lang.String; +import java.util.Arrays; import java.util.HashMap; import java.util.List; import java.util.Map; @@ -115,7 +116,8 @@ public final Bytes bytes() { } /** - * List of columns to appear in the response. Supports simple wildcards. + * A comma-separated list of columns names to display. It supports simple + * wildcards. *

* API name: {@code h} */ @@ -206,7 +208,8 @@ public final Builder bytes(@Nullable Bytes value) { } /** - * List of columns to appear in the response. Supports simple wildcards. + * A comma-separated list of columns names to display. It supports simple + * wildcards. *

* API name: {@code h} *

@@ -218,7 +221,8 @@ public final Builder h(List list) { } /** - * List of columns to appear in the response. Supports simple wildcards. + * A comma-separated list of columns names to display. It supports simple + * wildcards. *

* API name: {@code h} *

@@ -229,6 +233,20 @@ public final Builder h(String value, String... values) { return this; } + /** + * A comma-separated list of columns names to display. It supports simple + * wildcards. + *

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

+ * Adds one or more enum values to h. + */ + public final Builder h(CatAllocationColumn value, CatAllocationColumn... values) { + this.h = _listAdd(this.h, value.jsonValue(), + Arrays.stream(values).map(CatAllocationColumn::jsonValue).toArray(String[]::new)); + return this; + } + /** * If true, the request computes the list of selected nodes from * the local cluster state. If false the list of selected nodes are diff --git a/java-client/src/main/java/co/elastic/clients/elasticsearch/cat/CatAliasesColumn.java b/java-client/src/main/java/co/elastic/clients/elasticsearch/cat/CatAliasesColumn.java new file mode 100644 index 000000000..0e2fdde81 --- /dev/null +++ b/java-client/src/main/java/co/elastic/clients/elasticsearch/cat/CatAliasesColumn.java @@ -0,0 +1,98 @@ +/* + * 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.cat; + +import co.elastic.clients.json.JsonEnum; +import co.elastic.clients.json.JsonpDeserializable; +import co.elastic.clients.json.JsonpDeserializer; + +//---------------------------------------------------------------- +// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. +//---------------------------------------------------------------- +// +// This code is generated from the Elasticsearch API specification +// at https://github.com/elastic/elasticsearch-specification +// +// Manual updates to this file will be lost when the code is +// re-generated. +// +// If you find a property that is missing or wrongly typed, please +// open an issue or a PR on the API specification repository. +// +//---------------------------------------------------------------- + +/** + * + * @see API + * specification + */ +@JsonpDeserializable +public enum CatAliasesColumn implements JsonEnum { + /** + * The name of the alias. + */ + Alias("alias", "a"), + + /** + * The name of the index the alias points to. + */ + Index("index", "i", "idx"), + + /** + * The filter applied to the alias. + */ + Filter("filter", "f", "fi"), + + /** + * Index routing value for the alias. + */ + RoutingIndex("routing.index", "ri", "routingIndex"), + + /** + * Search routing value for the alias. + */ + RoutingSearch("routing.search", "rs", "routingSearch"), + + /** + * Indicates if the index is the write index for the alias. + */ + IsWriteIndex("is_write_index", "w", "isWriteIndex"), + + ; + + private final String jsonValue; + private final String[] aliases; + + CatAliasesColumn(String jsonValue, String... aliases) { + this.jsonValue = jsonValue; + this.aliases = aliases; + } + + public String jsonValue() { + return this.jsonValue; + } + + public String[] aliases() { + return this.aliases; + } + + public static final JsonEnum.Deserializer _DESERIALIZER = new JsonEnum.Deserializer<>( + CatAliasesColumn.values()); +} diff --git a/java-client/src/main/java/co/elastic/clients/elasticsearch/cat/CatAllocationColumn.java b/java-client/src/main/java/co/elastic/clients/elasticsearch/cat/CatAllocationColumn.java new file mode 100644 index 000000000..6fb59d2cf --- /dev/null +++ b/java-client/src/main/java/co/elastic/clients/elasticsearch/cat/CatAllocationColumn.java @@ -0,0 +1,133 @@ +/* + * 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.cat; + +import co.elastic.clients.json.JsonEnum; +import co.elastic.clients.json.JsonpDeserializable; +import co.elastic.clients.json.JsonpDeserializer; + +//---------------------------------------------------------------- +// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. +//---------------------------------------------------------------- +// +// This code is generated from the Elasticsearch API specification +// at https://github.com/elastic/elasticsearch-specification +// +// Manual updates to this file will be lost when the code is +// re-generated. +// +// If you find a property that is missing or wrongly typed, please +// open an issue or a PR on the API specification repository. +// +//---------------------------------------------------------------- + +/** + * + * @see API + * specification + */ +@JsonpDeserializable +public enum CatAllocationColumn implements JsonEnum { + /** + * The number of shards on the node. + */ + Shards("shards", "s"), + + /** + * The number of shards scheduled to be moved elsewhere in the cluster. + */ + ShardsUndesired("shards.undesired"), + + /** + * The sum of index write load forecasts. + */ + WriteLoadForecast("write_load.forecast", "wlf", "writeLoadForecast"), + + /** + * The sum of shard size forecasts. + */ + DiskIndicesForecast("disk.indices.forecast", "dif", "diskIndicesForecast"), + + /** + * The disk space used by Elasticsearch indices. + */ + DiskIndices("disk.indices", "di", "diskIndices"), + + /** + * The total disk space used on the node. + */ + DiskUsed("disk.used", "du", "diskUsed"), + + /** + * The available disk space on the node. + */ + DiskAvail("disk.avail", "da", "diskAvail"), + + /** + * The total disk capacity of all volumes on the node. + */ + DiskTotal("disk.total", "dt", "diskTotal"), + + /** + * The percentage of disk space used on the node. + */ + DiskPercent("disk.percent", "dp", "diskPercent"), + + /** + * IThe host of the node. + */ + Host("host", "h"), + + /** + * The IP address of the node. + */ + Ip("ip"), + + /** + * The name of the node. + */ + Node("node", "n"), + + /** + * The roles assigned to the node. + */ + NodeRole("node.role", "r", "role", "nodeRole"), + + ; + + private final String jsonValue; + private final String[] aliases; + + CatAllocationColumn(String jsonValue, String... aliases) { + this.jsonValue = jsonValue; + this.aliases = aliases; + } + + public String jsonValue() { + return this.jsonValue; + } + + public String[] aliases() { + return this.aliases; + } + + public static final JsonEnum.Deserializer _DESERIALIZER = new JsonEnum.Deserializer<>( + CatAllocationColumn.values()); +} diff --git a/java-client/src/main/java/co/elastic/clients/elasticsearch/cat/CatComponentColumn.java b/java-client/src/main/java/co/elastic/clients/elasticsearch/cat/CatComponentColumn.java new file mode 100644 index 000000000..479a40897 --- /dev/null +++ b/java-client/src/main/java/co/elastic/clients/elasticsearch/cat/CatComponentColumn.java @@ -0,0 +1,103 @@ +/* + * Licensed to Elasticsearch B.V. under one or more contributor + * license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright + * ownership. Elasticsearch B.V. licenses this file to you under + * the Apache License, Version 2.0 (the "License"); you may + * not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +package co.elastic.clients.elasticsearch.cat; + +import co.elastic.clients.json.JsonEnum; +import co.elastic.clients.json.JsonpDeserializable; +import co.elastic.clients.json.JsonpDeserializer; + +//---------------------------------------------------------------- +// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. +//---------------------------------------------------------------- +// +// This code is generated from the Elasticsearch API specification +// at https://github.com/elastic/elasticsearch-specification +// +// Manual updates to this file will be lost when the code is +// re-generated. +// +// If you find a property that is missing or wrongly typed, please +// open an issue or a PR on the API specification repository. +// +//---------------------------------------------------------------- + +/** + * + * @see API + * specification + */ +@JsonpDeserializable +public enum CatComponentColumn implements JsonEnum { + /** + * The name of the component template. + */ + Name("name", "n"), + + /** + * The version number of the component template. + */ + Version("version", "v"), + + /** + * The number of aliases in the component template. + */ + AliasCount("alias_count", "a"), + + /** + * The number of mappings in the component template. + */ + MappingCount("mapping_count", "m"), + + /** + * The number of settings in the component template. + */ + SettingsCount("settings_count", "s"), + + /** + * The number of metadata entries in the component template. + */ + MetadataCount("metadata_count", "me"), + + /** + * The index templates that include this component template. + */ + IncludedIn("included_in", "i"), + + ; + + private final String jsonValue; + private final String[] aliases; + + CatComponentColumn(String jsonValue, String... aliases) { + this.jsonValue = jsonValue; + this.aliases = aliases; + } + + public String jsonValue() { + return this.jsonValue; + } + + public String[] aliases() { + return this.aliases; + } + + public static final JsonEnum.Deserializer _DESERIALIZER = new JsonEnum.Deserializer<>( + CatComponentColumn.values()); +} diff --git a/java-client/src/main/java/co/elastic/clients/elasticsearch/cat/CatCountColumn.java b/java-client/src/main/java/co/elastic/clients/elasticsearch/cat/CatCountColumn.java new file mode 100644 index 000000000..d959480b7 --- /dev/null +++ b/java-client/src/main/java/co/elastic/clients/elasticsearch/cat/CatCountColumn.java @@ -0,0 +1,83 @@ +/* + * 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.cat; + +import co.elastic.clients.json.JsonEnum; +import co.elastic.clients.json.JsonpDeserializable; +import co.elastic.clients.json.JsonpDeserializer; + +//---------------------------------------------------------------- +// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. +//---------------------------------------------------------------- +// +// This code is generated from the Elasticsearch API specification +// at https://github.com/elastic/elasticsearch-specification +// +// Manual updates to this file will be lost when the code is +// re-generated. +// +// If you find a property that is missing or wrongly typed, please +// open an issue or a PR on the API specification repository. +// +//---------------------------------------------------------------- + +/** + * + * @see API + * specification + */ +@JsonpDeserializable +public enum CatCountColumn implements JsonEnum { + /** + * The Unix epoch time in seconds since 1970-01-01 00:00:00. + */ + Epoch("epoch", "t", "time"), + + /** + * The current time in HH:MM:SS format. + */ + Timestamp("timestamp", "ts", "hms", "hhmmss"), + + /** + * The document count in the cluster or index. + */ + Count("count", "dc", "docs.count", "docsCount"), + + ; + + private final String jsonValue; + private final String[] aliases; + + CatCountColumn(String jsonValue, String... aliases) { + this.jsonValue = jsonValue; + this.aliases = aliases; + } + + public String jsonValue() { + return this.jsonValue; + } + + public String[] aliases() { + return this.aliases; + } + + public static final JsonEnum.Deserializer _DESERIALIZER = new JsonEnum.Deserializer<>( + CatCountColumn.values()); +} diff --git a/java-client/src/main/java/co/elastic/clients/elasticsearch/cat/CatFieldDataColumn.java b/java-client/src/main/java/co/elastic/clients/elasticsearch/cat/CatFieldDataColumn.java new file mode 100644 index 000000000..b722d337c --- /dev/null +++ b/java-client/src/main/java/co/elastic/clients/elasticsearch/cat/CatFieldDataColumn.java @@ -0,0 +1,98 @@ +/* + * 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.cat; + +import co.elastic.clients.json.JsonEnum; +import co.elastic.clients.json.JsonpDeserializable; +import co.elastic.clients.json.JsonpDeserializer; + +//---------------------------------------------------------------- +// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. +//---------------------------------------------------------------- +// +// This code is generated from the Elasticsearch API specification +// at https://github.com/elastic/elasticsearch-specification +// +// Manual updates to this file will be lost when the code is +// re-generated. +// +// If you find a property that is missing or wrongly typed, please +// open an issue or a PR on the API specification repository. +// +//---------------------------------------------------------------- + +/** + * + * @see API + * specification + */ +@JsonpDeserializable +public enum CatFieldDataColumn implements JsonEnum { + /** + * The node ID. + */ + Id("id"), + + /** + * The host name of the node. + */ + Host("host", "h"), + + /** + * The IP address of the node. + */ + Ip("ip"), + + /** + * The node name. + */ + Node("node", "n"), + + /** + * The field name. + */ + Field("field", "f"), + + /** + * The field data usage. + */ + Size("size", "s"), + + ; + + private final String jsonValue; + private final String[] aliases; + + CatFieldDataColumn(String jsonValue, String... aliases) { + this.jsonValue = jsonValue; + this.aliases = aliases; + } + + public String jsonValue() { + return this.jsonValue; + } + + public String[] aliases() { + return this.aliases; + } + + public static final JsonEnum.Deserializer _DESERIALIZER = new JsonEnum.Deserializer<>( + CatFieldDataColumn.values()); +} diff --git a/java-client/src/main/java/co/elastic/clients/elasticsearch/cat/ComponentTemplatesRequest.java b/java-client/src/main/java/co/elastic/clients/elasticsearch/cat/ComponentTemplatesRequest.java index c1ec97ce2..6b300674c 100644 --- a/java-client/src/main/java/co/elastic/clients/elasticsearch/cat/ComponentTemplatesRequest.java +++ b/java-client/src/main/java/co/elastic/clients/elasticsearch/cat/ComponentTemplatesRequest.java @@ -32,6 +32,7 @@ import jakarta.json.stream.JsonGenerator; import java.lang.Boolean; import java.lang.String; +import java.util.Arrays; import java.util.HashMap; import java.util.List; import java.util.Map; @@ -103,7 +104,8 @@ public static ComponentTemplatesRequest of(Function * API name: {@code h} */ @@ -182,7 +184,8 @@ public static class Builder extends CatRequestBase.AbstractBuilder private List s; /** - * List of columns to appear in the response. Supports simple wildcards. + * A comma-separated list of columns names to display. It supports simple + * wildcards. *

* API name: {@code h} *

@@ -194,7 +197,8 @@ public final Builder h(List list) { } /** - * List of columns to appear in the response. Supports simple wildcards. + * A comma-separated list of columns names to display. It supports simple + * wildcards. *

* API name: {@code h} *

@@ -205,6 +209,20 @@ public final Builder h(String value, String... values) { return this; } + /** + * A comma-separated list of columns names to display. It supports simple + * wildcards. + *

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

+ * Adds one or more enum values to h. + */ + public final Builder h(CatComponentColumn value, CatComponentColumn... values) { + this.h = _listAdd(this.h, value.jsonValue(), + Arrays.stream(values).map(CatComponentColumn::jsonValue).toArray(String[]::new)); + return this; + } + /** * If true, the request computes the list of selected nodes from * the local cluster state. If false the list of selected nodes are diff --git a/java-client/src/main/java/co/elastic/clients/elasticsearch/cat/CountRequest.java b/java-client/src/main/java/co/elastic/clients/elasticsearch/cat/CountRequest.java index 126e5cccd..9f0bc7281 100644 --- a/java-client/src/main/java/co/elastic/clients/elasticsearch/cat/CountRequest.java +++ b/java-client/src/main/java/co/elastic/clients/elasticsearch/cat/CountRequest.java @@ -30,6 +30,7 @@ import co.elastic.clients.util.ObjectBuilder; import jakarta.json.stream.JsonGenerator; import java.lang.String; +import java.util.Arrays; import java.util.HashMap; import java.util.List; import java.util.Map; @@ -92,7 +93,8 @@ public static CountRequest of(Function> fn) } /** - * List of columns to appear in the response. Supports simple wildcards. + * A comma-separated list of columns names to display. It supports simple + * wildcards. *

* API name: {@code h} */ @@ -140,7 +142,8 @@ public static class Builder extends CatRequestBase.AbstractBuilder impl private List s; /** - * List of columns to appear in the response. Supports simple wildcards. + * A comma-separated list of columns names to display. It supports simple + * wildcards. *

* API name: {@code h} *

@@ -152,7 +155,8 @@ public final Builder h(List list) { } /** - * List of columns to appear in the response. Supports simple wildcards. + * A comma-separated list of columns names to display. It supports simple + * wildcards. *

* API name: {@code h} *

@@ -163,6 +167,20 @@ public final Builder h(String value, String... values) { return this; } + /** + * A comma-separated list of columns names to display. It supports simple + * wildcards. + *

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

+ * Adds one or more enum values to h. + */ + public final Builder h(CatCountColumn value, CatCountColumn... values) { + this.h = _listAdd(this.h, value.jsonValue(), + Arrays.stream(values).map(CatCountColumn::jsonValue).toArray(String[]::new)); + return this; + } + /** * A comma-separated list of data streams, indices, and aliases used to limit * the request. It supports wildcards (*). To target all data diff --git a/java-client/src/main/java/co/elastic/clients/elasticsearch/cat/FielddataRequest.java b/java-client/src/main/java/co/elastic/clients/elasticsearch/cat/FielddataRequest.java index b77d03810..34f34dae6 100644 --- a/java-client/src/main/java/co/elastic/clients/elasticsearch/cat/FielddataRequest.java +++ b/java-client/src/main/java/co/elastic/clients/elasticsearch/cat/FielddataRequest.java @@ -31,6 +31,7 @@ import co.elastic.clients.util.ObjectBuilder; import jakarta.json.stream.JsonGenerator; import java.lang.String; +import java.util.Arrays; import java.util.HashMap; import java.util.List; import java.util.Map; @@ -116,7 +117,8 @@ public final List fields() { } /** - * List of columns to appear in the response. Supports simple wildcards. + * A comma-separated list of columns names to display. It supports simple + * wildcards. *

* API name: {@code h} */ @@ -193,7 +195,8 @@ public final Builder fields(String value, String... values) { } /** - * List of columns to appear in the response. Supports simple wildcards. + * A comma-separated list of columns names to display. It supports simple + * wildcards. *

* API name: {@code h} *

@@ -205,7 +208,8 @@ public final Builder h(List list) { } /** - * List of columns to appear in the response. Supports simple wildcards. + * A comma-separated list of columns names to display. It supports simple + * wildcards. *

* API name: {@code h} *

@@ -216,6 +220,20 @@ public final Builder h(String value, String... values) { return this; } + /** + * A comma-separated list of columns names to display. It supports simple + * wildcards. + *

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

+ * Adds one or more enum values to h. + */ + public final Builder h(CatFieldDataColumn value, CatFieldDataColumn... values) { + this.h = _listAdd(this.h, value.jsonValue(), + Arrays.stream(values).map(CatFieldDataColumn::jsonValue).toArray(String[]::new)); + return this; + } + /** * List of columns that determine how the table should be sorted. Sorting * defaults to ascending and can be changed by setting :asc or 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 25dd5bc9d..fab4fdb44 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 @@ -260,7 +260,7 @@ '_global.update_by_query_rethrottle.UpdateByQueryRethrottleNode': '_global/update_by_query_rethrottle/UpdateByQueryRethrottleNode.ts#L25-L27', '_spec_utils.BaseNode': '_spec_utils/BaseNode.ts#L25-L32', '_types.AcknowledgedResponseBase': '_types/Base.ts#L69-L72', -'_types.BulkIndexByScrollFailure': '_types/Errors.ts#L60-L65', +'_types.BulkIndexByScrollFailure': '_types/Errors.ts#L64-L69', '_types.BulkStats': '_types/Stats.ts#L71-L81', '_types.Bytes': '_types/common.ts#L173-L185', '_types.ClusterDetails': '_types/Stats.ts#L45-L52', @@ -354,7 +354,7 @@ '_types.SearchTransform': '_types/Transform.ts#L46-L49', '_types.SearchType': '_types/common.ts#L281-L286', '_types.SegmentsStats': '_types/Stats.ts#L298-L393', -'_types.ShardFailure': '_types/Errors.ts#L52-L58', +'_types.ShardFailure': '_types/Errors.ts#L52-L62', '_types.ShardStatistics': '_types/Stats.ts#L54-L69', '_types.ShardsOperationResponseBase': '_types/Base.ts#L145-L148', '_types.SlicedScroll': '_types/SlicedScroll.ts#L23-L27', @@ -368,7 +368,7 @@ '_types.StoreStats': '_types/Stats.ts#L395-L422', '_types.StoredScript': '_types/Scripting.ts#L47-L59', '_types.SuggestMode': '_types/common.ts#L288-L301', -'_types.TaskFailure': '_types/Errors.ts#L67-L72', +'_types.TaskFailure': '_types/Errors.ts#L71-L76', '_types.TextEmbedding': '_types/Knn.ts#L94-L97', '_types.TextSimilarityReranker': '_types/Retriever.ts#L146-L157', '_types.ThreadType': '_types/common.ts#L303-L309', @@ -1067,18 +1067,23 @@ 'autoscaling.get_autoscaling_policy.Response': 'autoscaling/get_autoscaling_policy/GetAutoscalingPolicyResponse.ts#L22-L24', 'autoscaling.put_autoscaling_policy.Request': 'autoscaling/put_autoscaling_policy/PutAutoscalingPolicyRequest.ts#L25-L57', 'autoscaling.put_autoscaling_policy.Response': 'autoscaling/put_autoscaling_policy/PutAutoscalingPolicyResponse.ts#L22-L24', +'cat._types.CatAliasesColumn': 'cat/_types/CatBase.ts#L1283-L1315', +'cat._types.CatAllocationColumn': 'cat/_types/CatBase.ts#L1317-L1382', 'cat._types.CatAnomalyDetectorColumn': 'cat/_types/CatBase.ts#L32-L401', +'cat._types.CatComponentColumn': 'cat/_types/CatBase.ts#L1384-L1421', +'cat._types.CatCountColumn': 'cat/_types/CatBase.ts#L1423-L1440', 'cat._types.CatDatafeedColumn': 'cat/_types/CatBase.ts#L405-L471', 'cat._types.CatDfaColumn': 'cat/_types/CatBase.ts#L473-L558', +'cat._types.CatFieldDataColumn': 'cat/_types/CatBase.ts#L1442-L1472', 'cat._types.CatNodeColumn': 'cat/_types/CatBase.ts#L560-L1012', 'cat._types.CatRecoveryColumn': 'cat/_types/CatBase.ts#L1014-L1145', 'cat._types.CatRequestBase': 'cat/_types/CatBase.ts#L28-L30', 'cat._types.CatSegmentsColumn': 'cat/_types/CatBase.ts#L1147-L1212', -'cat._types.CatShardColumn': 'cat/_types/CatBase.ts#L1576-L1949', +'cat._types.CatShardColumn': 'cat/_types/CatBase.ts#L1772-L2145', 'cat._types.CatSnapshotsColumn': 'cat/_types/CatBase.ts#L1214-L1281', -'cat._types.CatThreadPoolColumn': 'cat/_types/CatBase.ts#L1952-L2052', -'cat._types.CatTrainedModelsColumn': 'cat/_types/CatBase.ts#L1290-L1364', -'cat._types.CatTransformColumn': 'cat/_types/CatBase.ts#L1369-L1573', +'cat._types.CatThreadPoolColumn': 'cat/_types/CatBase.ts#L2148-L2248', +'cat._types.CatTrainedModelsColumn': 'cat/_types/CatBase.ts#L1486-L1560', +'cat._types.CatTransformColumn': 'cat/_types/CatBase.ts#L1565-L1769', 'cat.aliases.AliasesRecord': 'cat/aliases/types.ts#L22-L53', 'cat.aliases.Request': 'cat/aliases/CatAliasesRequest.ts#L23-L77', 'cat.aliases.Response': 'cat/aliases/CatAliasesResponse.ts#L22-L24', @@ -3108,6 +3113,8 @@ 'transform.reset_transform.Response': 'transform/reset_transform/ResetTransformResponse.ts#L22-L24', 'transform.schedule_now_transform.Request': 'transform/schedule_now_transform/ScheduleNowTransformRequest.ts#L23-L57', 'transform.schedule_now_transform.Response': 'transform/schedule_now_transform/ScheduleNowTransformResponse.ts#L21-L23', +'transform.set_upgrade_mode.Request': 'transform/set_upgrade_mode/TransformSetUpgradeModeRequest.ts#L23-L64', +'transform.set_upgrade_mode.Response': 'transform/set_upgrade_mode/TransformSetUpgradeModeResponse.ts#L22-L25', 'transform.start_transform.Request': 'transform/start_transform/StartTransformRequest.ts#L24-L72', 'transform.start_transform.Response': 'transform/start_transform/StartTransformResponse.ts#L22-L24', 'transform.stop_transform.Request': 'transform/stop_transform/StopTransformRequest.ts#L24-L84', @@ -3321,10 +3328,10 @@ if (hash.length > 1) { hash = hash.substring(1); } - window.location = "https://github.com/elastic/elasticsearch-specification/tree/e8eef7137294b373ed9087eb678b3aac7d7d0d07/specification/" + (paths[hash] || ""); + window.location = "https://github.com/elastic/elasticsearch-specification/tree/079cda0a96e04fbd23690a8a0404993bec8806cf/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/transform/ElasticsearchTransformAsyncClient.java b/java-client/src/main/java/co/elastic/clients/elasticsearch/transform/ElasticsearchTransformAsyncClient.java index 25396996b..a43140849 100644 --- a/java-client/src/main/java/co/elastic/clients/elasticsearch/transform/ElasticsearchTransformAsyncClient.java +++ b/java-client/src/main/java/co/elastic/clients/elasticsearch/transform/ElasticsearchTransformAsyncClient.java @@ -480,6 +480,82 @@ public final CompletableFuture scheduleNowTransfor return scheduleNowTransform(fn.apply(new ScheduleNowTransformRequest.Builder()).build()); } + // ----- Endpoint: transform.set_upgrade_mode + + /** + * Set upgrade_mode for transform indices. Sets a cluster wide upgrade_mode + * setting that prepares transform indices for an upgrade. When upgrading your + * cluster, in some circumstances you must restart your nodes and reindex your + * transform indices. In those circumstances, there must be no transforms + * running. You can close the transforms, do the upgrade, then open all the + * transforms again. Alternatively, you can use this API to temporarily halt + * tasks associated with the transforms and prevent new transforms from opening. + * You can also use this API during upgrades that do not require you to reindex + * your transform indices, though stopping transforms is not a requirement in + * that case. You can see the current value for the upgrade_mode setting by + * using the get transform info API. + * + * @see Documentation + * on elastic.co + */ + + public CompletableFuture setUpgradeMode(SetUpgradeModeRequest request) { + @SuppressWarnings("unchecked") + JsonEndpoint endpoint = (JsonEndpoint) SetUpgradeModeRequest._ENDPOINT; + + return this.transport.performRequestAsync(request, endpoint, this.transportOptions); + } + + /** + * Set upgrade_mode for transform indices. Sets a cluster wide upgrade_mode + * setting that prepares transform indices for an upgrade. When upgrading your + * cluster, in some circumstances you must restart your nodes and reindex your + * transform indices. In those circumstances, there must be no transforms + * running. You can close the transforms, do the upgrade, then open all the + * transforms again. Alternatively, you can use this API to temporarily halt + * tasks associated with the transforms and prevent new transforms from opening. + * You can also use this API during upgrades that do not require you to reindex + * your transform indices, though stopping transforms is not a requirement in + * that case. You can see the current value for the upgrade_mode setting by + * using the get transform info API. + * + * @param fn + * a function that initializes a builder to create the + * {@link SetUpgradeModeRequest} + * @see Documentation + * on elastic.co + */ + + public final CompletableFuture setUpgradeMode( + Function> fn) { + return setUpgradeMode(fn.apply(new SetUpgradeModeRequest.Builder()).build()); + } + + /** + * Set upgrade_mode for transform indices. Sets a cluster wide upgrade_mode + * setting that prepares transform indices for an upgrade. When upgrading your + * cluster, in some circumstances you must restart your nodes and reindex your + * transform indices. In those circumstances, there must be no transforms + * running. You can close the transforms, do the upgrade, then open all the + * transforms again. Alternatively, you can use this API to temporarily halt + * tasks associated with the transforms and prevent new transforms from opening. + * You can also use this API during upgrades that do not require you to reindex + * your transform indices, though stopping transforms is not a requirement in + * that case. You can see the current value for the upgrade_mode setting by + * using the get transform info API. + * + * @see Documentation + * on elastic.co + */ + + public CompletableFuture setUpgradeMode() { + return this.transport.performRequestAsync(new SetUpgradeModeRequest.Builder().build(), + SetUpgradeModeRequest._ENDPOINT, this.transportOptions); + } + // ----- Endpoint: transform.start_transform /** diff --git a/java-client/src/main/java/co/elastic/clients/elasticsearch/transform/ElasticsearchTransformClient.java b/java-client/src/main/java/co/elastic/clients/elasticsearch/transform/ElasticsearchTransformClient.java index 915f39a93..cf5ccbb5c 100644 --- a/java-client/src/main/java/co/elastic/clients/elasticsearch/transform/ElasticsearchTransformClient.java +++ b/java-client/src/main/java/co/elastic/clients/elasticsearch/transform/ElasticsearchTransformClient.java @@ -491,6 +491,84 @@ public final ScheduleNowTransformResponse scheduleNowTransform( return scheduleNowTransform(fn.apply(new ScheduleNowTransformRequest.Builder()).build()); } + // ----- Endpoint: transform.set_upgrade_mode + + /** + * Set upgrade_mode for transform indices. Sets a cluster wide upgrade_mode + * setting that prepares transform indices for an upgrade. When upgrading your + * cluster, in some circumstances you must restart your nodes and reindex your + * transform indices. In those circumstances, there must be no transforms + * running. You can close the transforms, do the upgrade, then open all the + * transforms again. Alternatively, you can use this API to temporarily halt + * tasks associated with the transforms and prevent new transforms from opening. + * You can also use this API during upgrades that do not require you to reindex + * your transform indices, though stopping transforms is not a requirement in + * that case. You can see the current value for the upgrade_mode setting by + * using the get transform info API. + * + * @see Documentation + * on elastic.co + */ + + public SetUpgradeModeResponse setUpgradeMode(SetUpgradeModeRequest request) + throws IOException, ElasticsearchException { + @SuppressWarnings("unchecked") + JsonEndpoint endpoint = (JsonEndpoint) SetUpgradeModeRequest._ENDPOINT; + + return this.transport.performRequest(request, endpoint, this.transportOptions); + } + + /** + * Set upgrade_mode for transform indices. Sets a cluster wide upgrade_mode + * setting that prepares transform indices for an upgrade. When upgrading your + * cluster, in some circumstances you must restart your nodes and reindex your + * transform indices. In those circumstances, there must be no transforms + * running. You can close the transforms, do the upgrade, then open all the + * transforms again. Alternatively, you can use this API to temporarily halt + * tasks associated with the transforms and prevent new transforms from opening. + * You can also use this API during upgrades that do not require you to reindex + * your transform indices, though stopping transforms is not a requirement in + * that case. You can see the current value for the upgrade_mode setting by + * using the get transform info API. + * + * @param fn + * a function that initializes a builder to create the + * {@link SetUpgradeModeRequest} + * @see Documentation + * on elastic.co + */ + + public final SetUpgradeModeResponse setUpgradeMode( + Function> fn) + throws IOException, ElasticsearchException { + return setUpgradeMode(fn.apply(new SetUpgradeModeRequest.Builder()).build()); + } + + /** + * Set upgrade_mode for transform indices. Sets a cluster wide upgrade_mode + * setting that prepares transform indices for an upgrade. When upgrading your + * cluster, in some circumstances you must restart your nodes and reindex your + * transform indices. In those circumstances, there must be no transforms + * running. You can close the transforms, do the upgrade, then open all the + * transforms again. Alternatively, you can use this API to temporarily halt + * tasks associated with the transforms and prevent new transforms from opening. + * You can also use this API during upgrades that do not require you to reindex + * your transform indices, though stopping transforms is not a requirement in + * that case. You can see the current value for the upgrade_mode setting by + * using the get transform info API. + * + * @see Documentation + * on elastic.co + */ + + public SetUpgradeModeResponse setUpgradeMode() throws IOException, ElasticsearchException { + return this.transport.performRequest(new SetUpgradeModeRequest.Builder().build(), + SetUpgradeModeRequest._ENDPOINT, this.transportOptions); + } + // ----- Endpoint: transform.start_transform /** diff --git a/java-client/src/main/java/co/elastic/clients/elasticsearch/transform/SetUpgradeModeRequest.java b/java-client/src/main/java/co/elastic/clients/elasticsearch/transform/SetUpgradeModeRequest.java new file mode 100644 index 000000000..1b9884f2e --- /dev/null +++ b/java-client/src/main/java/co/elastic/clients/elasticsearch/transform/SetUpgradeModeRequest.java @@ -0,0 +1,219 @@ +/* + * Licensed to Elasticsearch B.V. under one or more contributor + * license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright + * ownership. Elasticsearch B.V. licenses this file to you under + * the Apache License, Version 2.0 (the "License"); you may + * not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +package co.elastic.clients.elasticsearch.transform; + +import co.elastic.clients.elasticsearch._types.ErrorResponse; +import co.elastic.clients.elasticsearch._types.RequestBase; +import co.elastic.clients.elasticsearch._types.Time; +import co.elastic.clients.json.JsonpDeserializable; +import co.elastic.clients.json.JsonpDeserializer; +import co.elastic.clients.json.ObjectBuilderDeserializer; +import co.elastic.clients.json.ObjectDeserializer; +import co.elastic.clients.transport.Endpoint; +import co.elastic.clients.transport.endpoints.SimpleEndpoint; +import co.elastic.clients.util.ObjectBuilder; +import jakarta.json.stream.JsonGenerator; +import java.lang.Boolean; +import java.util.Collections; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.function.Function; +import javax.annotation.Nullable; + +//---------------------------------------------------------------- +// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. +//---------------------------------------------------------------- +// +// This code is generated from the Elasticsearch API specification +// at https://github.com/elastic/elasticsearch-specification +// +// Manual updates to this file will be lost when the code is +// re-generated. +// +// If you find a property that is missing or wrongly typed, please +// open an issue or a PR on the API specification repository. +// +//---------------------------------------------------------------- + +// typedef: transform.set_upgrade_mode.Request + +/** + * Set upgrade_mode for transform indices. Sets a cluster wide upgrade_mode + * setting that prepares transform indices for an upgrade. When upgrading your + * cluster, in some circumstances you must restart your nodes and reindex your + * transform indices. In those circumstances, there must be no transforms + * running. You can close the transforms, do the upgrade, then open all the + * transforms again. Alternatively, you can use this API to temporarily halt + * tasks associated with the transforms and prevent new transforms from opening. + * You can also use this API during upgrades that do not require you to reindex + * your transform indices, though stopping transforms is not a requirement in + * that case. You can see the current value for the upgrade_mode setting by + * using the get transform info API. + * + * @see API + * specification + */ + +public class SetUpgradeModeRequest extends RequestBase { + @Nullable + private final Boolean enabled; + + @Nullable + private final Time timeout; + + // --------------------------------------------------------------------------------------------- + + private SetUpgradeModeRequest(Builder builder) { + + this.enabled = builder.enabled; + this.timeout = builder.timeout; + + } + + public static SetUpgradeModeRequest of(Function> fn) { + return fn.apply(new Builder()).build(); + } + + /** + * When true, it enables upgrade_mode which + * temporarily halts all transform tasks and prohibits new transform tasks from + * starting. + *

+ * API name: {@code enabled} + */ + @Nullable + public final Boolean enabled() { + return this.enabled; + } + + /** + * The time to wait for the request to be completed. + *

+ * API name: {@code timeout} + */ + @Nullable + public final Time timeout() { + return this.timeout; + } + + // --------------------------------------------------------------------------------------------- + + /** + * Builder for {@link SetUpgradeModeRequest}. + */ + + public static class Builder extends RequestBase.AbstractBuilder + implements + ObjectBuilder { + @Nullable + private Boolean enabled; + + @Nullable + private Time timeout; + + /** + * When true, it enables upgrade_mode which + * temporarily halts all transform tasks and prohibits new transform tasks from + * starting. + *

+ * API name: {@code enabled} + */ + public final Builder enabled(@Nullable Boolean value) { + this.enabled = value; + return this; + } + + /** + * The time to wait for the request to be completed. + *

+ * API name: {@code timeout} + */ + public final Builder timeout(@Nullable Time value) { + this.timeout = value; + return this; + } + + /** + * The time to wait for the request to be completed. + *

+ * API name: {@code timeout} + */ + public final Builder timeout(Function> fn) { + return this.timeout(fn.apply(new Time.Builder()).build()); + } + + @Override + protected Builder self() { + return this; + } + + /** + * Builds a {@link SetUpgradeModeRequest}. + * + * @throws NullPointerException + * if some of the required fields are null. + */ + public SetUpgradeModeRequest build() { + _checkSingleUse(); + + return new SetUpgradeModeRequest(this); + } + } + + // --------------------------------------------------------------------------------------------- + + /** + * Endpoint "{@code transform.set_upgrade_mode}". + */ + public static final Endpoint _ENDPOINT = new SimpleEndpoint<>( + "es/transform.set_upgrade_mode", + + // Request method + request -> { + return "POST"; + + }, + + // Request path + request -> { + return "/_transform/set_upgrade_mode"; + + }, + + // Path parameters + request -> { + return Collections.emptyMap(); + }, + + // Request parameters + request -> { + Map params = new HashMap<>(); + if (request.enabled != null) { + params.put("enabled", String.valueOf(request.enabled)); + } + if (request.timeout != null) { + params.put("timeout", request.timeout._toJsonString()); + } + return params; + + }, SimpleEndpoint.emptyMap(), false, SetUpgradeModeResponse._DESERIALIZER); +} diff --git a/java-client/src/main/java/co/elastic/clients/elasticsearch/transform/SetUpgradeModeResponse.java b/java-client/src/main/java/co/elastic/clients/elasticsearch/transform/SetUpgradeModeResponse.java new file mode 100644 index 000000000..84f77f43d --- /dev/null +++ b/java-client/src/main/java/co/elastic/clients/elasticsearch/transform/SetUpgradeModeResponse.java @@ -0,0 +1,109 @@ +/* + * Licensed to Elasticsearch B.V. under one or more contributor + * license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright + * ownership. Elasticsearch B.V. licenses this file to you under + * the Apache License, Version 2.0 (the "License"); you may + * not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +package co.elastic.clients.elasticsearch.transform; + +import co.elastic.clients.elasticsearch._types.AcknowledgedResponseBase; +import co.elastic.clients.json.JsonpDeserializable; +import co.elastic.clients.json.JsonpDeserializer; +import co.elastic.clients.json.ObjectBuilderDeserializer; +import co.elastic.clients.json.ObjectDeserializer; +import co.elastic.clients.util.ObjectBuilder; +import jakarta.json.stream.JsonGenerator; +import java.util.Objects; +import java.util.function.Function; + +//---------------------------------------------------------------- +// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. +//---------------------------------------------------------------- +// +// This code is generated from the Elasticsearch API specification +// at https://github.com/elastic/elasticsearch-specification +// +// Manual updates to this file will be lost when the code is +// re-generated. +// +// If you find a property that is missing or wrongly typed, please +// open an issue or a PR on the API specification repository. +// +//---------------------------------------------------------------- + +// typedef: transform.set_upgrade_mode.Response + +/** + * + * @see API + * specification + */ +@JsonpDeserializable +public class SetUpgradeModeResponse extends AcknowledgedResponseBase { + // --------------------------------------------------------------------------------------------- + + private SetUpgradeModeResponse(Builder builder) { + super(builder); + + } + + public static SetUpgradeModeResponse of(Function> fn) { + return fn.apply(new Builder()).build(); + } + + // --------------------------------------------------------------------------------------------- + + /** + * Builder for {@link SetUpgradeModeResponse}. + */ + + public static class Builder extends AcknowledgedResponseBase.AbstractBuilder + implements + ObjectBuilder { + @Override + protected Builder self() { + return this; + } + + /** + * Builds a {@link SetUpgradeModeResponse}. + * + * @throws NullPointerException + * if some of the required fields are null. + */ + public SetUpgradeModeResponse build() { + _checkSingleUse(); + + return new SetUpgradeModeResponse(this); + } + } + + // --------------------------------------------------------------------------------------------- + + /** + * Json deserializer for {@link SetUpgradeModeResponse} + */ + public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer + .lazy(Builder::new, SetUpgradeModeResponse::setupSetUpgradeModeResponseDeserializer); + + protected static void setupSetUpgradeModeResponseDeserializer( + ObjectDeserializer op) { + AcknowledgedResponseBase.setupAcknowledgedResponseBaseDeserializer(op); + + } + +}