From ccf45bf5afb100dbe415308690f908b57fe40202 Mon Sep 17 00:00:00 2001 From: Mital Awachat Date: Thu, 29 Jul 2021 22:01:53 +0530 Subject: [PATCH] Remove ilm package (#3) Signed-off-by: Mital Awachat --- .../ElasticsearchAsyncClient.java | 5 - .../elasticsearch/ElasticsearchClient.java | 5 - .../ilm/DeleteLifecycleRequest.java | 150 ----- .../ilm/DeleteLifecycleResponse.java | 98 ---- .../ilm/ElasticsearchIlmAsyncClient.java | 433 -------------- .../ilm/ElasticsearchIlmClient.java | 424 -------------- .../ilm/ExplainLifecycleRequest.java | 215 ------- .../ilm/ExplainLifecycleResponse.java | 166 ------ .../ilm/GetIlmStatusRequest.java | 83 --- .../ilm/GetIlmStatusResponse.java | 132 ----- .../ilm/GetLifecycleRequest.java | 159 ------ .../ilm/GetLifecycleResponse.java | 102 ---- .../clients/elasticsearch/ilm/IlmPolicy.java | 169 ------ .../elasticsearch/ilm/MoveToStepRequest.java | 251 -------- .../elasticsearch/ilm/MoveToStepResponse.java | 97 ---- .../clients/elasticsearch/ilm/Phase.java | 174 ------ .../clients/elasticsearch/ilm/Phases.java | 251 -------- .../ilm/PutLifecycleRequest.java | 214 ------- .../ilm/PutLifecycleResponse.java | 97 ---- .../ilm/RemovePolicyRequest.java | 149 ----- .../ilm/RemovePolicyResponse.java | 178 ------ .../elasticsearch/ilm/RetryRequest.java | 151 ----- .../elasticsearch/ilm/RetryResponse.java | 97 ---- .../elasticsearch/ilm/StartIlmRequest.java | 178 ------ .../elasticsearch/ilm/StartIlmResponse.java | 97 ---- .../elasticsearch/ilm/StopIlmRequest.java | 179 ------ .../elasticsearch/ilm/StopIlmResponse.java | 97 ---- .../explain_lifecycle/LifecycleExplain.java | 199 ------- .../LifecycleExplainBuilders.java | 49 -- .../LifecycleExplainManaged.java | 537 ------------------ .../LifecycleExplainPhaseExecution.java | 184 ------ .../LifecycleExplainUnmanaged.java | 144 ----- .../LifecycleExplainVariant.java | 39 -- .../ilm/get_lifecycle/Lifecycle.java | 189 ------ .../ilm/move_to_step/StepKey.java | 180 ------ 35 files changed, 5872 deletions(-) delete mode 100644 java-client/src/main/java/co/elastic/clients/elasticsearch/ilm/DeleteLifecycleRequest.java delete mode 100644 java-client/src/main/java/co/elastic/clients/elasticsearch/ilm/DeleteLifecycleResponse.java delete mode 100644 java-client/src/main/java/co/elastic/clients/elasticsearch/ilm/ElasticsearchIlmAsyncClient.java delete mode 100644 java-client/src/main/java/co/elastic/clients/elasticsearch/ilm/ElasticsearchIlmClient.java delete mode 100644 java-client/src/main/java/co/elastic/clients/elasticsearch/ilm/ExplainLifecycleRequest.java delete mode 100644 java-client/src/main/java/co/elastic/clients/elasticsearch/ilm/ExplainLifecycleResponse.java delete mode 100644 java-client/src/main/java/co/elastic/clients/elasticsearch/ilm/GetIlmStatusRequest.java delete mode 100644 java-client/src/main/java/co/elastic/clients/elasticsearch/ilm/GetIlmStatusResponse.java delete mode 100644 java-client/src/main/java/co/elastic/clients/elasticsearch/ilm/GetLifecycleRequest.java delete mode 100644 java-client/src/main/java/co/elastic/clients/elasticsearch/ilm/GetLifecycleResponse.java delete mode 100644 java-client/src/main/java/co/elastic/clients/elasticsearch/ilm/IlmPolicy.java delete mode 100644 java-client/src/main/java/co/elastic/clients/elasticsearch/ilm/MoveToStepRequest.java delete mode 100644 java-client/src/main/java/co/elastic/clients/elasticsearch/ilm/MoveToStepResponse.java delete mode 100644 java-client/src/main/java/co/elastic/clients/elasticsearch/ilm/Phase.java delete mode 100644 java-client/src/main/java/co/elastic/clients/elasticsearch/ilm/Phases.java delete mode 100644 java-client/src/main/java/co/elastic/clients/elasticsearch/ilm/PutLifecycleRequest.java delete mode 100644 java-client/src/main/java/co/elastic/clients/elasticsearch/ilm/PutLifecycleResponse.java delete mode 100644 java-client/src/main/java/co/elastic/clients/elasticsearch/ilm/RemovePolicyRequest.java delete mode 100644 java-client/src/main/java/co/elastic/clients/elasticsearch/ilm/RemovePolicyResponse.java delete mode 100644 java-client/src/main/java/co/elastic/clients/elasticsearch/ilm/RetryRequest.java delete mode 100644 java-client/src/main/java/co/elastic/clients/elasticsearch/ilm/RetryResponse.java delete mode 100644 java-client/src/main/java/co/elastic/clients/elasticsearch/ilm/StartIlmRequest.java delete mode 100644 java-client/src/main/java/co/elastic/clients/elasticsearch/ilm/StartIlmResponse.java delete mode 100644 java-client/src/main/java/co/elastic/clients/elasticsearch/ilm/StopIlmRequest.java delete mode 100644 java-client/src/main/java/co/elastic/clients/elasticsearch/ilm/StopIlmResponse.java delete mode 100644 java-client/src/main/java/co/elastic/clients/elasticsearch/ilm/explain_lifecycle/LifecycleExplain.java delete mode 100644 java-client/src/main/java/co/elastic/clients/elasticsearch/ilm/explain_lifecycle/LifecycleExplainBuilders.java delete mode 100644 java-client/src/main/java/co/elastic/clients/elasticsearch/ilm/explain_lifecycle/LifecycleExplainManaged.java delete mode 100644 java-client/src/main/java/co/elastic/clients/elasticsearch/ilm/explain_lifecycle/LifecycleExplainPhaseExecution.java delete mode 100644 java-client/src/main/java/co/elastic/clients/elasticsearch/ilm/explain_lifecycle/LifecycleExplainUnmanaged.java delete mode 100644 java-client/src/main/java/co/elastic/clients/elasticsearch/ilm/explain_lifecycle/LifecycleExplainVariant.java delete mode 100644 java-client/src/main/java/co/elastic/clients/elasticsearch/ilm/get_lifecycle/Lifecycle.java delete mode 100644 java-client/src/main/java/co/elastic/clients/elasticsearch/ilm/move_to_step/StepKey.java diff --git a/java-client/src/main/java/co/elastic/clients/elasticsearch/ElasticsearchAsyncClient.java b/java-client/src/main/java/co/elastic/clients/elasticsearch/ElasticsearchAsyncClient.java index 05e0be6ab4031..cd839dd72deb6 100644 --- a/java-client/src/main/java/co/elastic/clients/elasticsearch/ElasticsearchAsyncClient.java +++ b/java-client/src/main/java/co/elastic/clients/elasticsearch/ElasticsearchAsyncClient.java @@ -109,7 +109,6 @@ import co.elastic.clients.elasticsearch.core.UpdateResponse; import co.elastic.clients.elasticsearch.dangling_indices.ElasticsearchDanglingIndicesAsyncClient; import co.elastic.clients.elasticsearch.features.ElasticsearchFeaturesAsyncClient; -import co.elastic.clients.elasticsearch.ilm.ElasticsearchIlmAsyncClient; import co.elastic.clients.elasticsearch.indices.ElasticsearchIndicesAsyncClient; import co.elastic.clients.elasticsearch.ingest.ElasticsearchIngestAsyncClient; import co.elastic.clients.elasticsearch.nodes.ElasticsearchNodesAsyncClient; @@ -166,10 +165,6 @@ public ElasticsearchFeaturesAsyncClient features() { return new ElasticsearchFeaturesAsyncClient(this.transport, this.transportOptions); } - public ElasticsearchIlmAsyncClient ilm() { - return new ElasticsearchIlmAsyncClient(this.transport, this.transportOptions); - } - public ElasticsearchIndicesAsyncClient indices() { return new ElasticsearchIndicesAsyncClient(this.transport, this.transportOptions); } diff --git a/java-client/src/main/java/co/elastic/clients/elasticsearch/ElasticsearchClient.java b/java-client/src/main/java/co/elastic/clients/elasticsearch/ElasticsearchClient.java index 7f8c604d552d2..bcf6837a1d4a3 100644 --- a/java-client/src/main/java/co/elastic/clients/elasticsearch/ElasticsearchClient.java +++ b/java-client/src/main/java/co/elastic/clients/elasticsearch/ElasticsearchClient.java @@ -109,7 +109,6 @@ import co.elastic.clients.elasticsearch.core.UpdateResponse; import co.elastic.clients.elasticsearch.dangling_indices.ElasticsearchDanglingIndicesClient; import co.elastic.clients.elasticsearch.features.ElasticsearchFeaturesClient; -import co.elastic.clients.elasticsearch.ilm.ElasticsearchIlmClient; import co.elastic.clients.elasticsearch.indices.ElasticsearchIndicesClient; import co.elastic.clients.elasticsearch.ingest.ElasticsearchIngestClient; import co.elastic.clients.elasticsearch.nodes.ElasticsearchNodesClient; @@ -164,10 +163,6 @@ public ElasticsearchFeaturesClient features() { return new ElasticsearchFeaturesClient(this.transport, this.transportOptions); } - public ElasticsearchIlmClient ilm() { - return new ElasticsearchIlmClient(this.transport, this.transportOptions); - } - public ElasticsearchIndicesClient indices() { return new ElasticsearchIndicesClient(this.transport, this.transportOptions); } diff --git a/java-client/src/main/java/co/elastic/clients/elasticsearch/ilm/DeleteLifecycleRequest.java b/java-client/src/main/java/co/elastic/clients/elasticsearch/ilm/DeleteLifecycleRequest.java deleted file mode 100644 index 3647a2225ebcd..0000000000000 --- a/java-client/src/main/java/co/elastic/clients/elasticsearch/ilm/DeleteLifecycleRequest.java +++ /dev/null @@ -1,150 +0,0 @@ -/* - * 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. - */ - -//---------------------------------------------------- -// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. -//---------------------------------------------------- - -package co.elastic.clients.elasticsearch.ilm; - -import co.elastic.clients.elasticsearch._types.ErrorResponse; -import co.elastic.clients.elasticsearch._types.RequestBase; -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.ApiTypeHelper; -import co.elastic.clients.util.ObjectBuilder; -import co.elastic.clients.util.ObjectBuilderBase; -import jakarta.json.stream.JsonGenerator; -import java.lang.String; -import java.util.Collections; -import java.util.Objects; -import java.util.function.Function; -import javax.annotation.Nullable; - -// typedef: ilm.delete_lifecycle.Request - -/** - * Deletes the specified lifecycle policy definition. A currently used policy - * cannot be deleted. - * - * @see API - * specification - */ - -public class DeleteLifecycleRequest extends RequestBase { - private final String name; - - // --------------------------------------------------------------------------------------------- - - private DeleteLifecycleRequest(Builder builder) { - - this.name = ApiTypeHelper.requireNonNull(builder.name, this, "name"); - - } - - public static DeleteLifecycleRequest of(Function> fn) { - return fn.apply(new Builder()).build(); - } - - /** - * Required - The name of the index lifecycle policy - *

- * API name: {@code policy} - */ - public final String name() { - return this.name; - } - - // --------------------------------------------------------------------------------------------- - - /** - * Builder for {@link DeleteLifecycleRequest}. - */ - - public static class Builder extends ObjectBuilderBase implements ObjectBuilder { - private String name; - - /** - * Required - The name of the index lifecycle policy - *

- * API name: {@code policy} - */ - public final Builder name(String value) { - this.name = value; - return this; - } - - /** - * Builds a {@link DeleteLifecycleRequest}. - * - * @throws NullPointerException - * if some of the required fields are null. - */ - public DeleteLifecycleRequest build() { - _checkSingleUse(); - - return new DeleteLifecycleRequest(this); - } - } - - // --------------------------------------------------------------------------------------------- - - /** - * Endpoint "{@code ilm.delete_lifecycle}". - */ - public static final Endpoint _ENDPOINT = new SimpleEndpoint<>( - "es/ilm.delete_lifecycle", - - // Request method - request -> { - return "DELETE"; - - }, - - // Request path - request -> { - final int _name = 1 << 0; - - int propsSet = 0; - - propsSet |= _name; - - if (propsSet == (_name)) { - StringBuilder buf = new StringBuilder(); - buf.append("/_ilm"); - buf.append("/policy"); - buf.append("/"); - SimpleEndpoint.pathEncode(request.name, buf); - return buf.toString(); - } - throw SimpleEndpoint.noPathTemplateFound("path"); - - }, - - // Request parameters - request -> { - return Collections.emptyMap(); - - }, SimpleEndpoint.emptyMap(), false, DeleteLifecycleResponse._DESERIALIZER); -} diff --git a/java-client/src/main/java/co/elastic/clients/elasticsearch/ilm/DeleteLifecycleResponse.java b/java-client/src/main/java/co/elastic/clients/elasticsearch/ilm/DeleteLifecycleResponse.java deleted file mode 100644 index d8821c4f8e392..0000000000000 --- a/java-client/src/main/java/co/elastic/clients/elasticsearch/ilm/DeleteLifecycleResponse.java +++ /dev/null @@ -1,98 +0,0 @@ -/* - * 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. - */ - -//---------------------------------------------------- -// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. -//---------------------------------------------------- - -package co.elastic.clients.elasticsearch.ilm; - -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; - -// typedef: ilm.delete_lifecycle.Response - -/** - * - * @see API - * specification - */ -@JsonpDeserializable -public class DeleteLifecycleResponse extends AcknowledgedResponseBase { - // --------------------------------------------------------------------------------------------- - - private DeleteLifecycleResponse(Builder builder) { - super(builder); - - } - - public static DeleteLifecycleResponse of(Function> fn) { - return fn.apply(new Builder()).build(); - } - - // --------------------------------------------------------------------------------------------- - - /** - * Builder for {@link DeleteLifecycleResponse}. - */ - - public static class Builder extends AcknowledgedResponseBase.AbstractBuilder - implements - ObjectBuilder { - @Override - protected Builder self() { - return this; - } - - /** - * Builds a {@link DeleteLifecycleResponse}. - * - * @throws NullPointerException - * if some of the required fields are null. - */ - public DeleteLifecycleResponse build() { - _checkSingleUse(); - - return new DeleteLifecycleResponse(this); - } - } - - // --------------------------------------------------------------------------------------------- - - /** - * Json deserializer for {@link DeleteLifecycleResponse} - */ - public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer - .lazy(Builder::new, DeleteLifecycleResponse::setupDeleteLifecycleResponseDeserializer); - - protected static void setupDeleteLifecycleResponseDeserializer( - ObjectDeserializer op) { - AcknowledgedResponseBase.setupAcknowledgedResponseBaseDeserializer(op); - - } - -} diff --git a/java-client/src/main/java/co/elastic/clients/elasticsearch/ilm/ElasticsearchIlmAsyncClient.java b/java-client/src/main/java/co/elastic/clients/elasticsearch/ilm/ElasticsearchIlmAsyncClient.java deleted file mode 100644 index 09476934e74f4..0000000000000 --- a/java-client/src/main/java/co/elastic/clients/elasticsearch/ilm/ElasticsearchIlmAsyncClient.java +++ /dev/null @@ -1,433 +0,0 @@ -/* - * 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. - */ - -//---------------------------------------------------- -// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. -//---------------------------------------------------- - -package co.elastic.clients.elasticsearch.ilm; - -import co.elastic.clients.ApiClient; -import co.elastic.clients.elasticsearch._types.ElasticsearchException; -import co.elastic.clients.elasticsearch._types.ErrorResponse; -import co.elastic.clients.transport.ElasticsearchTransport; -import co.elastic.clients.transport.Endpoint; -import co.elastic.clients.transport.JsonEndpoint; -import co.elastic.clients.transport.Transport; -import co.elastic.clients.transport.TransportOptions; -import co.elastic.clients.util.ObjectBuilder; -import java.io.IOException; -import java.util.concurrent.CompletableFuture; -import java.util.function.Function; -import javax.annotation.Nullable; - -/** - * Client for the ilm namespace. - */ -public class ElasticsearchIlmAsyncClient extends ApiClient { - - public ElasticsearchIlmAsyncClient(ElasticsearchTransport transport) { - super(transport, null); - } - - public ElasticsearchIlmAsyncClient(ElasticsearchTransport transport, @Nullable TransportOptions transportOptions) { - super(transport, transportOptions); - } - - @Override - public ElasticsearchIlmAsyncClient withTransportOptions(@Nullable TransportOptions transportOptions) { - return new ElasticsearchIlmAsyncClient(this.transport, transportOptions); - } - - // ----- Endpoint: ilm.delete_lifecycle - - /** - * Deletes the specified lifecycle policy definition. A currently used policy - * cannot be deleted. - * - * @see Documentation - * on elastic.co - */ - - public CompletableFuture deleteLifecycle(DeleteLifecycleRequest request) - throws IOException, ElasticsearchException { - @SuppressWarnings("unchecked") - JsonEndpoint endpoint = (JsonEndpoint) DeleteLifecycleRequest._ENDPOINT; - - return this.transport.performRequestAsync(request, endpoint, this.transportOptions); - } - - /** - * Deletes the specified lifecycle policy definition. A currently used policy - * cannot be deleted. - * - * @param fn - * a function that initializes a builder to create the - * {@link DeleteLifecycleRequest} - * @see Documentation - * on elastic.co - */ - - public final CompletableFuture deleteLifecycle( - Function> fn) - throws IOException, ElasticsearchException { - return deleteLifecycle(fn.apply(new DeleteLifecycleRequest.Builder()).build()); - } - - // ----- Endpoint: ilm.explain_lifecycle - - /** - * Retrieves information about the index's current lifecycle state, such as the - * currently executing phase, action, and step. - * - * @see Documentation - * on elastic.co - */ - - public CompletableFuture explainLifecycle(ExplainLifecycleRequest request) - throws IOException, ElasticsearchException { - @SuppressWarnings("unchecked") - JsonEndpoint endpoint = (JsonEndpoint) ExplainLifecycleRequest._ENDPOINT; - - return this.transport.performRequestAsync(request, endpoint, this.transportOptions); - } - - /** - * Retrieves information about the index's current lifecycle state, such as the - * currently executing phase, action, and step. - * - * @param fn - * a function that initializes a builder to create the - * {@link ExplainLifecycleRequest} - * @see Documentation - * on elastic.co - */ - - public final CompletableFuture explainLifecycle( - Function> fn) - throws IOException, ElasticsearchException { - return explainLifecycle(fn.apply(new ExplainLifecycleRequest.Builder()).build()); - } - - // ----- Endpoint: ilm.get_lifecycle - - /** - * Returns the specified policy definition. Includes the policy version and last - * modified date. - * - * @see Documentation - * on elastic.co - */ - - public CompletableFuture getLifecycle(GetLifecycleRequest request) - throws IOException, ElasticsearchException { - @SuppressWarnings("unchecked") - JsonEndpoint endpoint = (JsonEndpoint) GetLifecycleRequest._ENDPOINT; - - return this.transport.performRequestAsync(request, endpoint, this.transportOptions); - } - - /** - * Returns the specified policy definition. Includes the policy version and last - * modified date. - * - * @param fn - * a function that initializes a builder to create the - * {@link GetLifecycleRequest} - * @see Documentation - * on elastic.co - */ - - public final CompletableFuture getLifecycle( - Function> fn) - throws IOException, ElasticsearchException { - return getLifecycle(fn.apply(new GetLifecycleRequest.Builder()).build()); - } - - /** - * Returns the specified policy definition. Includes the policy version and last - * modified date. - * - * @see Documentation - * on elastic.co - */ - - public CompletableFuture getLifecycle() throws IOException, ElasticsearchException { - return this.transport.performRequestAsync(new GetLifecycleRequest.Builder().build(), - GetLifecycleRequest._ENDPOINT, this.transportOptions); - } - - // ----- Endpoint: ilm.get_status - - /** - * Retrieves the current index lifecycle management (ILM) status. - * - * @see Documentation - * on elastic.co - */ - public CompletableFuture getStatus() throws IOException, ElasticsearchException { - return this.transport.performRequestAsync(GetIlmStatusRequest._INSTANCE, GetIlmStatusRequest._ENDPOINT, - this.transportOptions); - } - - // ----- Endpoint: ilm.move_to_step - - /** - * Manually moves an index into the specified step and executes that step. - * - * @see Documentation - * on elastic.co - */ - - public CompletableFuture moveToStep(MoveToStepRequest request) - throws IOException, ElasticsearchException { - @SuppressWarnings("unchecked") - JsonEndpoint endpoint = (JsonEndpoint) MoveToStepRequest._ENDPOINT; - - return this.transport.performRequestAsync(request, endpoint, this.transportOptions); - } - - /** - * Manually moves an index into the specified step and executes that step. - * - * @param fn - * a function that initializes a builder to create the - * {@link MoveToStepRequest} - * @see Documentation - * on elastic.co - */ - - public final CompletableFuture moveToStep( - Function> fn) - throws IOException, ElasticsearchException { - return moveToStep(fn.apply(new MoveToStepRequest.Builder()).build()); - } - - // ----- Endpoint: ilm.put_lifecycle - - /** - * Creates a lifecycle policy - * - * @see Documentation - * on elastic.co - */ - - public CompletableFuture putLifecycle(PutLifecycleRequest request) - throws IOException, ElasticsearchException { - @SuppressWarnings("unchecked") - JsonEndpoint endpoint = (JsonEndpoint) PutLifecycleRequest._ENDPOINT; - - return this.transport.performRequestAsync(request, endpoint, this.transportOptions); - } - - /** - * Creates a lifecycle policy - * - * @param fn - * a function that initializes a builder to create the - * {@link PutLifecycleRequest} - * @see Documentation - * on elastic.co - */ - - public final CompletableFuture putLifecycle( - Function> fn) - throws IOException, ElasticsearchException { - return putLifecycle(fn.apply(new PutLifecycleRequest.Builder()).build()); - } - - // ----- Endpoint: ilm.remove_policy - - /** - * Removes the assigned lifecycle policy and stops managing the specified index - * - * @see Documentation - * on elastic.co - */ - - public CompletableFuture removePolicy(RemovePolicyRequest request) - throws IOException, ElasticsearchException { - @SuppressWarnings("unchecked") - JsonEndpoint endpoint = (JsonEndpoint) RemovePolicyRequest._ENDPOINT; - - return this.transport.performRequestAsync(request, endpoint, this.transportOptions); - } - - /** - * Removes the assigned lifecycle policy and stops managing the specified index - * - * @param fn - * a function that initializes a builder to create the - * {@link RemovePolicyRequest} - * @see Documentation - * on elastic.co - */ - - public final CompletableFuture removePolicy( - Function> fn) - throws IOException, ElasticsearchException { - return removePolicy(fn.apply(new RemovePolicyRequest.Builder()).build()); - } - - // ----- Endpoint: ilm.retry - - /** - * Retries executing the policy for an index that is in the ERROR step. - * - * @see Documentation - * on elastic.co - */ - - public CompletableFuture retry(RetryRequest request) throws IOException, ElasticsearchException { - @SuppressWarnings("unchecked") - JsonEndpoint endpoint = (JsonEndpoint) RetryRequest._ENDPOINT; - - return this.transport.performRequestAsync(request, endpoint, this.transportOptions); - } - - /** - * Retries executing the policy for an index that is in the ERROR step. - * - * @param fn - * a function that initializes a builder to create the - * {@link RetryRequest} - * @see Documentation - * on elastic.co - */ - - public final CompletableFuture retry(Function> fn) - throws IOException, ElasticsearchException { - return retry(fn.apply(new RetryRequest.Builder()).build()); - } - - // ----- Endpoint: ilm.start - - /** - * Start the index lifecycle management (ILM) plugin. - * - * @see Documentation - * on elastic.co - */ - - public CompletableFuture start(StartIlmRequest request) - throws IOException, ElasticsearchException { - @SuppressWarnings("unchecked") - JsonEndpoint endpoint = (JsonEndpoint) StartIlmRequest._ENDPOINT; - - return this.transport.performRequestAsync(request, endpoint, this.transportOptions); - } - - /** - * Start the index lifecycle management (ILM) plugin. - * - * @param fn - * a function that initializes a builder to create the - * {@link StartIlmRequest} - * @see Documentation - * on elastic.co - */ - - public final CompletableFuture start( - Function> fn) - throws IOException, ElasticsearchException { - return start(fn.apply(new StartIlmRequest.Builder()).build()); - } - - /** - * Start the index lifecycle management (ILM) plugin. - * - * @see Documentation - * on elastic.co - */ - - public CompletableFuture start() throws IOException, ElasticsearchException { - return this.transport.performRequestAsync(new StartIlmRequest.Builder().build(), StartIlmRequest._ENDPOINT, - this.transportOptions); - } - - // ----- Endpoint: ilm.stop - - /** - * Halts all lifecycle management operations and stops the index lifecycle - * management (ILM) plugin - * - * @see Documentation - * on elastic.co - */ - - public CompletableFuture stop(StopIlmRequest request) throws IOException, ElasticsearchException { - @SuppressWarnings("unchecked") - JsonEndpoint endpoint = (JsonEndpoint) StopIlmRequest._ENDPOINT; - - return this.transport.performRequestAsync(request, endpoint, this.transportOptions); - } - - /** - * Halts all lifecycle management operations and stops the index lifecycle - * management (ILM) plugin - * - * @param fn - * a function that initializes a builder to create the - * {@link StopIlmRequest} - * @see Documentation - * on elastic.co - */ - - public final CompletableFuture stop( - Function> fn) - throws IOException, ElasticsearchException { - return stop(fn.apply(new StopIlmRequest.Builder()).build()); - } - - /** - * Halts all lifecycle management operations and stops the index lifecycle - * management (ILM) plugin - * - * @see Documentation - * on elastic.co - */ - - public CompletableFuture stop() throws IOException, ElasticsearchException { - return this.transport.performRequestAsync(new StopIlmRequest.Builder().build(), StopIlmRequest._ENDPOINT, - this.transportOptions); - } - -} diff --git a/java-client/src/main/java/co/elastic/clients/elasticsearch/ilm/ElasticsearchIlmClient.java b/java-client/src/main/java/co/elastic/clients/elasticsearch/ilm/ElasticsearchIlmClient.java deleted file mode 100644 index a0102cff28097..0000000000000 --- a/java-client/src/main/java/co/elastic/clients/elasticsearch/ilm/ElasticsearchIlmClient.java +++ /dev/null @@ -1,424 +0,0 @@ -/* - * 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. - */ - -//---------------------------------------------------- -// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. -//---------------------------------------------------- - -package co.elastic.clients.elasticsearch.ilm; - -import co.elastic.clients.ApiClient; -import co.elastic.clients.elasticsearch._types.ElasticsearchException; -import co.elastic.clients.elasticsearch._types.ErrorResponse; -import co.elastic.clients.transport.ElasticsearchTransport; -import co.elastic.clients.transport.Endpoint; -import co.elastic.clients.transport.JsonEndpoint; -import co.elastic.clients.transport.Transport; -import co.elastic.clients.transport.TransportOptions; -import co.elastic.clients.util.ObjectBuilder; -import java.io.IOException; -import java.util.function.Function; -import javax.annotation.Nullable; - -/** - * Client for the ilm namespace. - */ -public class ElasticsearchIlmClient extends ApiClient { - - public ElasticsearchIlmClient(ElasticsearchTransport transport) { - super(transport, null); - } - - public ElasticsearchIlmClient(ElasticsearchTransport transport, @Nullable TransportOptions transportOptions) { - super(transport, transportOptions); - } - - @Override - public ElasticsearchIlmClient withTransportOptions(@Nullable TransportOptions transportOptions) { - return new ElasticsearchIlmClient(this.transport, transportOptions); - } - - // ----- Endpoint: ilm.delete_lifecycle - - /** - * Deletes the specified lifecycle policy definition. A currently used policy - * cannot be deleted. - * - * @see Documentation - * on elastic.co - */ - - public DeleteLifecycleResponse deleteLifecycle(DeleteLifecycleRequest request) - throws IOException, ElasticsearchException { - @SuppressWarnings("unchecked") - JsonEndpoint endpoint = (JsonEndpoint) DeleteLifecycleRequest._ENDPOINT; - - return this.transport.performRequest(request, endpoint, this.transportOptions); - } - - /** - * Deletes the specified lifecycle policy definition. A currently used policy - * cannot be deleted. - * - * @param fn - * a function that initializes a builder to create the - * {@link DeleteLifecycleRequest} - * @see Documentation - * on elastic.co - */ - - public final DeleteLifecycleResponse deleteLifecycle( - Function> fn) - throws IOException, ElasticsearchException { - return deleteLifecycle(fn.apply(new DeleteLifecycleRequest.Builder()).build()); - } - - // ----- Endpoint: ilm.explain_lifecycle - - /** - * Retrieves information about the index's current lifecycle state, such as the - * currently executing phase, action, and step. - * - * @see Documentation - * on elastic.co - */ - - public ExplainLifecycleResponse explainLifecycle(ExplainLifecycleRequest request) - throws IOException, ElasticsearchException { - @SuppressWarnings("unchecked") - JsonEndpoint endpoint = (JsonEndpoint) ExplainLifecycleRequest._ENDPOINT; - - return this.transport.performRequest(request, endpoint, this.transportOptions); - } - - /** - * Retrieves information about the index's current lifecycle state, such as the - * currently executing phase, action, and step. - * - * @param fn - * a function that initializes a builder to create the - * {@link ExplainLifecycleRequest} - * @see Documentation - * on elastic.co - */ - - public final ExplainLifecycleResponse explainLifecycle( - Function> fn) - throws IOException, ElasticsearchException { - return explainLifecycle(fn.apply(new ExplainLifecycleRequest.Builder()).build()); - } - - // ----- Endpoint: ilm.get_lifecycle - - /** - * Returns the specified policy definition. Includes the policy version and last - * modified date. - * - * @see Documentation - * on elastic.co - */ - - public GetLifecycleResponse getLifecycle(GetLifecycleRequest request) throws IOException, ElasticsearchException { - @SuppressWarnings("unchecked") - JsonEndpoint endpoint = (JsonEndpoint) GetLifecycleRequest._ENDPOINT; - - return this.transport.performRequest(request, endpoint, this.transportOptions); - } - - /** - * Returns the specified policy definition. Includes the policy version and last - * modified date. - * - * @param fn - * a function that initializes a builder to create the - * {@link GetLifecycleRequest} - * @see Documentation - * on elastic.co - */ - - public final GetLifecycleResponse getLifecycle( - Function> fn) - throws IOException, ElasticsearchException { - return getLifecycle(fn.apply(new GetLifecycleRequest.Builder()).build()); - } - - /** - * Returns the specified policy definition. Includes the policy version and last - * modified date. - * - * @see Documentation - * on elastic.co - */ - - public GetLifecycleResponse getLifecycle() throws IOException, ElasticsearchException { - return this.transport.performRequest(new GetLifecycleRequest.Builder().build(), GetLifecycleRequest._ENDPOINT, - this.transportOptions); - } - - // ----- Endpoint: ilm.get_status - - /** - * Retrieves the current index lifecycle management (ILM) status. - * - * @see Documentation - * on elastic.co - */ - public GetIlmStatusResponse getStatus() throws IOException, ElasticsearchException { - return this.transport.performRequest(GetIlmStatusRequest._INSTANCE, GetIlmStatusRequest._ENDPOINT, - this.transportOptions); - } - - // ----- Endpoint: ilm.move_to_step - - /** - * Manually moves an index into the specified step and executes that step. - * - * @see Documentation - * on elastic.co - */ - - public MoveToStepResponse moveToStep(MoveToStepRequest request) throws IOException, ElasticsearchException { - @SuppressWarnings("unchecked") - JsonEndpoint endpoint = (JsonEndpoint) MoveToStepRequest._ENDPOINT; - - return this.transport.performRequest(request, endpoint, this.transportOptions); - } - - /** - * Manually moves an index into the specified step and executes that step. - * - * @param fn - * a function that initializes a builder to create the - * {@link MoveToStepRequest} - * @see Documentation - * on elastic.co - */ - - public final MoveToStepResponse moveToStep(Function> fn) - throws IOException, ElasticsearchException { - return moveToStep(fn.apply(new MoveToStepRequest.Builder()).build()); - } - - // ----- Endpoint: ilm.put_lifecycle - - /** - * Creates a lifecycle policy - * - * @see Documentation - * on elastic.co - */ - - public PutLifecycleResponse putLifecycle(PutLifecycleRequest request) throws IOException, ElasticsearchException { - @SuppressWarnings("unchecked") - JsonEndpoint endpoint = (JsonEndpoint) PutLifecycleRequest._ENDPOINT; - - return this.transport.performRequest(request, endpoint, this.transportOptions); - } - - /** - * Creates a lifecycle policy - * - * @param fn - * a function that initializes a builder to create the - * {@link PutLifecycleRequest} - * @see Documentation - * on elastic.co - */ - - public final PutLifecycleResponse putLifecycle( - Function> fn) - throws IOException, ElasticsearchException { - return putLifecycle(fn.apply(new PutLifecycleRequest.Builder()).build()); - } - - // ----- Endpoint: ilm.remove_policy - - /** - * Removes the assigned lifecycle policy and stops managing the specified index - * - * @see Documentation - * on elastic.co - */ - - public RemovePolicyResponse removePolicy(RemovePolicyRequest request) throws IOException, ElasticsearchException { - @SuppressWarnings("unchecked") - JsonEndpoint endpoint = (JsonEndpoint) RemovePolicyRequest._ENDPOINT; - - return this.transport.performRequest(request, endpoint, this.transportOptions); - } - - /** - * Removes the assigned lifecycle policy and stops managing the specified index - * - * @param fn - * a function that initializes a builder to create the - * {@link RemovePolicyRequest} - * @see Documentation - * on elastic.co - */ - - public final RemovePolicyResponse removePolicy( - Function> fn) - throws IOException, ElasticsearchException { - return removePolicy(fn.apply(new RemovePolicyRequest.Builder()).build()); - } - - // ----- Endpoint: ilm.retry - - /** - * Retries executing the policy for an index that is in the ERROR step. - * - * @see Documentation - * on elastic.co - */ - - public RetryResponse retry(RetryRequest request) throws IOException, ElasticsearchException { - @SuppressWarnings("unchecked") - JsonEndpoint endpoint = (JsonEndpoint) RetryRequest._ENDPOINT; - - return this.transport.performRequest(request, endpoint, this.transportOptions); - } - - /** - * Retries executing the policy for an index that is in the ERROR step. - * - * @param fn - * a function that initializes a builder to create the - * {@link RetryRequest} - * @see Documentation - * on elastic.co - */ - - public final RetryResponse retry(Function> fn) - throws IOException, ElasticsearchException { - return retry(fn.apply(new RetryRequest.Builder()).build()); - } - - // ----- Endpoint: ilm.start - - /** - * Start the index lifecycle management (ILM) plugin. - * - * @see Documentation - * on elastic.co - */ - - public StartIlmResponse start(StartIlmRequest request) throws IOException, ElasticsearchException { - @SuppressWarnings("unchecked") - JsonEndpoint endpoint = (JsonEndpoint) StartIlmRequest._ENDPOINT; - - return this.transport.performRequest(request, endpoint, this.transportOptions); - } - - /** - * Start the index lifecycle management (ILM) plugin. - * - * @param fn - * a function that initializes a builder to create the - * {@link StartIlmRequest} - * @see Documentation - * on elastic.co - */ - - public final StartIlmResponse start(Function> fn) - throws IOException, ElasticsearchException { - return start(fn.apply(new StartIlmRequest.Builder()).build()); - } - - /** - * Start the index lifecycle management (ILM) plugin. - * - * @see Documentation - * on elastic.co - */ - - public StartIlmResponse start() throws IOException, ElasticsearchException { - return this.transport.performRequest(new StartIlmRequest.Builder().build(), StartIlmRequest._ENDPOINT, - this.transportOptions); - } - - // ----- Endpoint: ilm.stop - - /** - * Halts all lifecycle management operations and stops the index lifecycle - * management (ILM) plugin - * - * @see Documentation - * on elastic.co - */ - - public StopIlmResponse stop(StopIlmRequest request) throws IOException, ElasticsearchException { - @SuppressWarnings("unchecked") - JsonEndpoint endpoint = (JsonEndpoint) StopIlmRequest._ENDPOINT; - - return this.transport.performRequest(request, endpoint, this.transportOptions); - } - - /** - * Halts all lifecycle management operations and stops the index lifecycle - * management (ILM) plugin - * - * @param fn - * a function that initializes a builder to create the - * {@link StopIlmRequest} - * @see Documentation - * on elastic.co - */ - - public final StopIlmResponse stop(Function> fn) - throws IOException, ElasticsearchException { - return stop(fn.apply(new StopIlmRequest.Builder()).build()); - } - - /** - * Halts all lifecycle management operations and stops the index lifecycle - * management (ILM) plugin - * - * @see Documentation - * on elastic.co - */ - - public StopIlmResponse stop() throws IOException, ElasticsearchException { - return this.transport.performRequest(new StopIlmRequest.Builder().build(), StopIlmRequest._ENDPOINT, - this.transportOptions); - } - -} diff --git a/java-client/src/main/java/co/elastic/clients/elasticsearch/ilm/ExplainLifecycleRequest.java b/java-client/src/main/java/co/elastic/clients/elasticsearch/ilm/ExplainLifecycleRequest.java deleted file mode 100644 index 74861be917317..0000000000000 --- a/java-client/src/main/java/co/elastic/clients/elasticsearch/ilm/ExplainLifecycleRequest.java +++ /dev/null @@ -1,215 +0,0 @@ -/* - * 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. - */ - -//---------------------------------------------------- -// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. -//---------------------------------------------------- - -package co.elastic.clients.elasticsearch.ilm; - -import co.elastic.clients.elasticsearch._types.ErrorResponse; -import co.elastic.clients.elasticsearch._types.RequestBase; -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.ApiTypeHelper; -import co.elastic.clients.util.ObjectBuilder; -import co.elastic.clients.util.ObjectBuilderBase; -import jakarta.json.stream.JsonGenerator; -import java.lang.Boolean; -import java.lang.String; -import java.util.HashMap; -import java.util.Map; -import java.util.Objects; -import java.util.function.Function; -import javax.annotation.Nullable; - -// typedef: ilm.explain_lifecycle.Request - -/** - * Retrieves information about the index's current lifecycle state, such as the - * currently executing phase, action, and step. - * - * @see API - * specification - */ - -public class ExplainLifecycleRequest extends RequestBase { - private final String index; - - @Nullable - private final Boolean onlyErrors; - - @Nullable - private final Boolean onlyManaged; - - // --------------------------------------------------------------------------------------------- - - private ExplainLifecycleRequest(Builder builder) { - - this.index = ApiTypeHelper.requireNonNull(builder.index, this, "index"); - this.onlyErrors = builder.onlyErrors; - this.onlyManaged = builder.onlyManaged; - - } - - public static ExplainLifecycleRequest of(Function> fn) { - return fn.apply(new Builder()).build(); - } - - /** - * Required - The name of the index to explain - *

- * API name: {@code index} - */ - public final String index() { - return this.index; - } - - /** - * filters the indices included in the response to ones in an ILM error state, - * implies only_managed - *

- * API name: {@code only_errors} - */ - @Nullable - public final Boolean onlyErrors() { - return this.onlyErrors; - } - - /** - * filters the indices included in the response to ones managed by ILM - *

- * API name: {@code only_managed} - */ - @Nullable - public final Boolean onlyManaged() { - return this.onlyManaged; - } - - // --------------------------------------------------------------------------------------------- - - /** - * Builder for {@link ExplainLifecycleRequest}. - */ - - public static class Builder extends ObjectBuilderBase implements ObjectBuilder { - private String index; - - @Nullable - private Boolean onlyErrors; - - @Nullable - private Boolean onlyManaged; - - /** - * Required - The name of the index to explain - *

- * API name: {@code index} - */ - public final Builder index(String value) { - this.index = value; - return this; - } - - /** - * filters the indices included in the response to ones in an ILM error state, - * implies only_managed - *

- * API name: {@code only_errors} - */ - public final Builder onlyErrors(@Nullable Boolean value) { - this.onlyErrors = value; - return this; - } - - /** - * filters the indices included in the response to ones managed by ILM - *

- * API name: {@code only_managed} - */ - public final Builder onlyManaged(@Nullable Boolean value) { - this.onlyManaged = value; - return this; - } - - /** - * Builds a {@link ExplainLifecycleRequest}. - * - * @throws NullPointerException - * if some of the required fields are null. - */ - public ExplainLifecycleRequest build() { - _checkSingleUse(); - - return new ExplainLifecycleRequest(this); - } - } - - // --------------------------------------------------------------------------------------------- - - /** - * Endpoint "{@code ilm.explain_lifecycle}". - */ - public static final Endpoint _ENDPOINT = new SimpleEndpoint<>( - "es/ilm.explain_lifecycle", - - // Request method - request -> { - return "GET"; - - }, - - // Request path - request -> { - final int _index = 1 << 0; - - int propsSet = 0; - - propsSet |= _index; - - if (propsSet == (_index)) { - StringBuilder buf = new StringBuilder(); - buf.append("/"); - SimpleEndpoint.pathEncode(request.index, buf); - buf.append("/_ilm"); - buf.append("/explain"); - return buf.toString(); - } - throw SimpleEndpoint.noPathTemplateFound("path"); - - }, - - // Request parameters - request -> { - Map params = new HashMap<>(); - if (request.onlyErrors != null) { - params.put("only_errors", String.valueOf(request.onlyErrors)); - } - if (request.onlyManaged != null) { - params.put("only_managed", String.valueOf(request.onlyManaged)); - } - return params; - - }, SimpleEndpoint.emptyMap(), false, ExplainLifecycleResponse._DESERIALIZER); -} diff --git a/java-client/src/main/java/co/elastic/clients/elasticsearch/ilm/ExplainLifecycleResponse.java b/java-client/src/main/java/co/elastic/clients/elasticsearch/ilm/ExplainLifecycleResponse.java deleted file mode 100644 index b860dd6118de4..0000000000000 --- a/java-client/src/main/java/co/elastic/clients/elasticsearch/ilm/ExplainLifecycleResponse.java +++ /dev/null @@ -1,166 +0,0 @@ -/* - * 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. - */ - -//---------------------------------------------------- -// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. -//---------------------------------------------------- - -package co.elastic.clients.elasticsearch.ilm; - -import co.elastic.clients.elasticsearch.ilm.explain_lifecycle.LifecycleExplain; -import co.elastic.clients.json.JsonpDeserializable; -import co.elastic.clients.json.JsonpDeserializer; -import co.elastic.clients.json.JsonpMapper; -import co.elastic.clients.json.JsonpSerializable; -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 co.elastic.clients.util.ObjectBuilderBase; -import jakarta.json.stream.JsonGenerator; -import java.lang.String; -import java.util.Map; -import java.util.Objects; -import java.util.function.Function; -import javax.annotation.Nullable; - -// typedef: ilm.explain_lifecycle.Response - -/** - * - * @see API - * specification - */ -@JsonpDeserializable -public class ExplainLifecycleResponse implements JsonpSerializable { - private final Map indices; - - // --------------------------------------------------------------------------------------------- - - private ExplainLifecycleResponse(Builder builder) { - - this.indices = ApiTypeHelper.unmodifiableRequired(builder.indices, this, "indices"); - - } - - public static ExplainLifecycleResponse of(Function> fn) { - return fn.apply(new Builder()).build(); - } - - /** - * Required - API name: {@code indices} - */ - public final Map indices() { - return this.indices; - } - - /** - * 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) { - - if (ApiTypeHelper.isDefined(this.indices)) { - generator.writeKey("indices"); - generator.writeStartObject(); - for (Map.Entry item0 : this.indices.entrySet()) { - generator.writeKey(item0.getKey()); - item0.getValue().serialize(generator, mapper); - - } - generator.writeEnd(); - - } - - } - - // --------------------------------------------------------------------------------------------- - - /** - * Builder for {@link ExplainLifecycleResponse}. - */ - - public static class Builder extends ObjectBuilderBase implements ObjectBuilder { - private Map indices; - - /** - * Required - API name: {@code indices} - *

- * Adds all entries of map to indices. - */ - public final Builder indices(Map map) { - this.indices = _mapPutAll(this.indices, map); - return this; - } - - /** - * Required - API name: {@code indices} - *

- * Adds an entry to indices. - */ - public final Builder indices(String key, LifecycleExplain value) { - this.indices = _mapPut(this.indices, key, value); - return this; - } - - /** - * Required - API name: {@code indices} - *

- * Adds an entry to indices using a builder lambda. - */ - public final Builder indices(String key, - Function> fn) { - return indices(key, fn.apply(new LifecycleExplain.Builder()).build()); - } - - /** - * Builds a {@link ExplainLifecycleResponse}. - * - * @throws NullPointerException - * if some of the required fields are null. - */ - public ExplainLifecycleResponse build() { - _checkSingleUse(); - - return new ExplainLifecycleResponse(this); - } - } - - // --------------------------------------------------------------------------------------------- - - /** - * Json deserializer for {@link ExplainLifecycleResponse} - */ - public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer - .lazy(Builder::new, ExplainLifecycleResponse::setupExplainLifecycleResponseDeserializer); - - protected static void setupExplainLifecycleResponseDeserializer( - ObjectDeserializer op) { - - op.add(Builder::indices, JsonpDeserializer.stringMapDeserializer(LifecycleExplain._DESERIALIZER), "indices"); - - } - -} diff --git a/java-client/src/main/java/co/elastic/clients/elasticsearch/ilm/GetIlmStatusRequest.java b/java-client/src/main/java/co/elastic/clients/elasticsearch/ilm/GetIlmStatusRequest.java deleted file mode 100644 index a7ec28be20b53..0000000000000 --- a/java-client/src/main/java/co/elastic/clients/elasticsearch/ilm/GetIlmStatusRequest.java +++ /dev/null @@ -1,83 +0,0 @@ -/* - * 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. - */ - -//---------------------------------------------------- -// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. -//---------------------------------------------------- - -package co.elastic.clients.elasticsearch.ilm; - -import co.elastic.clients.elasticsearch._types.ErrorResponse; -import co.elastic.clients.elasticsearch._types.RequestBase; -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.util.Collections; -import java.util.Objects; - -// typedef: ilm.get_status.Request - -/** - * Retrieves the current index lifecycle management (ILM) status. - * - * @see API - * specification - */ - -public class GetIlmStatusRequest extends RequestBase { - public GetIlmStatusRequest() { - } - - /** - * Singleton instance for {@link GetIlmStatusRequest}. - */ - public static final GetIlmStatusRequest _INSTANCE = new GetIlmStatusRequest(); - - // --------------------------------------------------------------------------------------------- - - /** - * Endpoint "{@code ilm.get_status}". - */ - public static final Endpoint _ENDPOINT = new SimpleEndpoint<>( - "es/ilm.get_status", - - // Request method - request -> { - return "GET"; - - }, - - // Request path - request -> { - return "/_ilm/status"; - - }, - - // Request parameters - request -> { - return Collections.emptyMap(); - - }, SimpleEndpoint.emptyMap(), false, GetIlmStatusResponse._DESERIALIZER); -} diff --git a/java-client/src/main/java/co/elastic/clients/elasticsearch/ilm/GetIlmStatusResponse.java b/java-client/src/main/java/co/elastic/clients/elasticsearch/ilm/GetIlmStatusResponse.java deleted file mode 100644 index 3d5d293d9c857..0000000000000 --- a/java-client/src/main/java/co/elastic/clients/elasticsearch/ilm/GetIlmStatusResponse.java +++ /dev/null @@ -1,132 +0,0 @@ -/* - * 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. - */ - -//---------------------------------------------------- -// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. -//---------------------------------------------------- - -package co.elastic.clients.elasticsearch.ilm; - -import co.elastic.clients.elasticsearch._types.LifecycleOperationMode; -import co.elastic.clients.json.JsonpDeserializable; -import co.elastic.clients.json.JsonpDeserializer; -import co.elastic.clients.json.JsonpMapper; -import co.elastic.clients.json.JsonpSerializable; -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 co.elastic.clients.util.ObjectBuilderBase; -import jakarta.json.stream.JsonGenerator; -import java.util.Objects; -import java.util.function.Function; -import javax.annotation.Nullable; - -// typedef: ilm.get_status.Response - -/** - * - * @see API - * specification - */ -@JsonpDeserializable -public class GetIlmStatusResponse implements JsonpSerializable { - private final LifecycleOperationMode operationMode; - - // --------------------------------------------------------------------------------------------- - - private GetIlmStatusResponse(Builder builder) { - - this.operationMode = ApiTypeHelper.requireNonNull(builder.operationMode, this, "operationMode"); - - } - - public static GetIlmStatusResponse of(Function> fn) { - return fn.apply(new Builder()).build(); - } - - /** - * Required - API name: {@code operation_mode} - */ - public final LifecycleOperationMode operationMode() { - return this.operationMode; - } - - /** - * 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("operation_mode"); - this.operationMode.serialize(generator, mapper); - - } - - // --------------------------------------------------------------------------------------------- - - /** - * Builder for {@link GetIlmStatusResponse}. - */ - - public static class Builder extends ObjectBuilderBase implements ObjectBuilder { - private LifecycleOperationMode operationMode; - - /** - * Required - API name: {@code operation_mode} - */ - public final Builder operationMode(LifecycleOperationMode value) { - this.operationMode = value; - return this; - } - - /** - * Builds a {@link GetIlmStatusResponse}. - * - * @throws NullPointerException - * if some of the required fields are null. - */ - public GetIlmStatusResponse build() { - _checkSingleUse(); - - return new GetIlmStatusResponse(this); - } - } - - // --------------------------------------------------------------------------------------------- - - /** - * Json deserializer for {@link GetIlmStatusResponse} - */ - public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer - .lazy(Builder::new, GetIlmStatusResponse::setupGetIlmStatusResponseDeserializer); - - protected static void setupGetIlmStatusResponseDeserializer(ObjectDeserializer op) { - - op.add(Builder::operationMode, LifecycleOperationMode._DESERIALIZER, "operation_mode"); - - } - -} diff --git a/java-client/src/main/java/co/elastic/clients/elasticsearch/ilm/GetLifecycleRequest.java b/java-client/src/main/java/co/elastic/clients/elasticsearch/ilm/GetLifecycleRequest.java deleted file mode 100644 index 3cf643736fc31..0000000000000 --- a/java-client/src/main/java/co/elastic/clients/elasticsearch/ilm/GetLifecycleRequest.java +++ /dev/null @@ -1,159 +0,0 @@ -/* - * 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. - */ - -//---------------------------------------------------- -// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. -//---------------------------------------------------- - -package co.elastic.clients.elasticsearch.ilm; - -import co.elastic.clients.elasticsearch._types.ErrorResponse; -import co.elastic.clients.elasticsearch._types.RequestBase; -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 co.elastic.clients.util.ObjectBuilderBase; -import jakarta.json.stream.JsonGenerator; -import java.lang.String; -import java.util.Collections; -import java.util.Objects; -import java.util.function.Function; -import javax.annotation.Nullable; - -// typedef: ilm.get_lifecycle.Request - -/** - * Returns the specified policy definition. Includes the policy version and last - * modified date. - * - * @see API - * specification - */ - -public class GetLifecycleRequest extends RequestBase { - @Nullable - private final String name; - - // --------------------------------------------------------------------------------------------- - - private GetLifecycleRequest(Builder builder) { - - this.name = builder.name; - - } - - public static GetLifecycleRequest of(Function> fn) { - return fn.apply(new Builder()).build(); - } - - /** - * The name of the index lifecycle policy - *

- * API name: {@code policy} - */ - @Nullable - public final String name() { - return this.name; - } - - // --------------------------------------------------------------------------------------------- - - /** - * Builder for {@link GetLifecycleRequest}. - */ - - public static class Builder extends ObjectBuilderBase implements ObjectBuilder { - @Nullable - private String name; - - /** - * The name of the index lifecycle policy - *

- * API name: {@code policy} - */ - public final Builder name(@Nullable String value) { - this.name = value; - return this; - } - - /** - * Builds a {@link GetLifecycleRequest}. - * - * @throws NullPointerException - * if some of the required fields are null. - */ - public GetLifecycleRequest build() { - _checkSingleUse(); - - return new GetLifecycleRequest(this); - } - } - - // --------------------------------------------------------------------------------------------- - - /** - * Endpoint "{@code ilm.get_lifecycle}". - */ - public static final Endpoint _ENDPOINT = new SimpleEndpoint<>( - "es/ilm.get_lifecycle", - - // Request method - request -> { - return "GET"; - - }, - - // Request path - request -> { - final int _name = 1 << 0; - - int propsSet = 0; - - if (request.name() != null) - propsSet |= _name; - - if (propsSet == (_name)) { - StringBuilder buf = new StringBuilder(); - buf.append("/_ilm"); - buf.append("/policy"); - buf.append("/"); - SimpleEndpoint.pathEncode(request.name, buf); - return buf.toString(); - } - if (propsSet == 0) { - StringBuilder buf = new StringBuilder(); - buf.append("/_ilm"); - buf.append("/policy"); - return buf.toString(); - } - throw SimpleEndpoint.noPathTemplateFound("path"); - - }, - - // Request parameters - request -> { - return Collections.emptyMap(); - - }, SimpleEndpoint.emptyMap(), false, GetLifecycleResponse._DESERIALIZER); -} diff --git a/java-client/src/main/java/co/elastic/clients/elasticsearch/ilm/GetLifecycleResponse.java b/java-client/src/main/java/co/elastic/clients/elasticsearch/ilm/GetLifecycleResponse.java deleted file mode 100644 index a2713f11045c4..0000000000000 --- a/java-client/src/main/java/co/elastic/clients/elasticsearch/ilm/GetLifecycleResponse.java +++ /dev/null @@ -1,102 +0,0 @@ -/* - * 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. - */ - -//---------------------------------------------------- -// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. -//---------------------------------------------------- - -package co.elastic.clients.elasticsearch.ilm; - -import co.elastic.clients.elasticsearch.ilm.get_lifecycle.Lifecycle; -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.endpoints.DictionaryResponse; -import co.elastic.clients.util.ObjectBuilder; -import jakarta.json.stream.JsonGenerator; -import java.lang.String; -import java.util.Objects; -import java.util.function.Function; - -// typedef: ilm.get_lifecycle.Response - -/** - * - * @see API - * specification - */ -@JsonpDeserializable -public class GetLifecycleResponse extends DictionaryResponse { - // --------------------------------------------------------------------------------------------- - - private GetLifecycleResponse(Builder builder) { - super(builder); - - } - - public static GetLifecycleResponse of(Function> fn) { - return fn.apply(new Builder()).build(); - } - - // --------------------------------------------------------------------------------------------- - - /** - * Builder for {@link GetLifecycleResponse}. - */ - - public static class Builder extends DictionaryResponse.AbstractBuilder - implements - ObjectBuilder { - @Override - protected Builder self() { - return this; - } - - /** - * Builds a {@link GetLifecycleResponse}. - * - * @throws NullPointerException - * if some of the required fields are null. - */ - public GetLifecycleResponse build() { - _checkSingleUse(); - super.tKeySerializer(null); - super.tValueSerializer(null); - - return new GetLifecycleResponse(this); - } - } - - // --------------------------------------------------------------------------------------------- - - /** - * Json deserializer for {@link GetLifecycleResponse} - */ - public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer - .lazy(Builder::new, GetLifecycleResponse::setupGetLifecycleResponseDeserializer); - - protected static void setupGetLifecycleResponseDeserializer(ObjectDeserializer op) { - DictionaryResponse.setupDictionaryResponseDeserializer(op, JsonpDeserializer.stringDeserializer(), - Lifecycle._DESERIALIZER); - - } - -} diff --git a/java-client/src/main/java/co/elastic/clients/elasticsearch/ilm/IlmPolicy.java b/java-client/src/main/java/co/elastic/clients/elasticsearch/ilm/IlmPolicy.java deleted file mode 100644 index 6c9240fe87b73..0000000000000 --- a/java-client/src/main/java/co/elastic/clients/elasticsearch/ilm/IlmPolicy.java +++ /dev/null @@ -1,169 +0,0 @@ -/* - * 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. - */ - -//---------------------------------------------------- -// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. -//---------------------------------------------------- - -package co.elastic.clients.elasticsearch.ilm; - -import co.elastic.clients.json.JsonpDeserializable; -import co.elastic.clients.json.JsonpDeserializer; -import co.elastic.clients.json.JsonpMapper; -import co.elastic.clients.json.JsonpSerializable; -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 co.elastic.clients.util.ObjectBuilderBase; -import jakarta.json.stream.JsonGenerator; -import java.lang.String; -import java.util.Objects; -import java.util.function.Function; -import javax.annotation.Nullable; - -// typedef: ilm._types.Policy - -/** - * - * @see API - * specification - */ -@JsonpDeserializable -public class IlmPolicy implements JsonpSerializable { - private final Phases phases; - - @Nullable - private final String name; - - // --------------------------------------------------------------------------------------------- - - private IlmPolicy(Builder builder) { - - this.phases = ApiTypeHelper.requireNonNull(builder.phases, this, "phases"); - this.name = builder.name; - - } - - public static IlmPolicy of(Function> fn) { - return fn.apply(new Builder()).build(); - } - - /** - * Required - API name: {@code phases} - */ - public final Phases phases() { - return this.phases; - } - - /** - * API name: {@code name} - */ - @Nullable - public final String name() { - return this.name; - } - - /** - * 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("phases"); - this.phases.serialize(generator, mapper); - - if (this.name != null) { - generator.writeKey("name"); - generator.write(this.name); - - } - - } - - // --------------------------------------------------------------------------------------------- - - /** - * Builder for {@link IlmPolicy}. - */ - - public static class Builder extends ObjectBuilderBase implements ObjectBuilder { - private Phases phases; - - @Nullable - private String name; - - /** - * Required - API name: {@code phases} - */ - public final Builder phases(Phases value) { - this.phases = value; - return this; - } - - /** - * Required - API name: {@code phases} - */ - public final Builder phases(Function> fn) { - return this.phases(fn.apply(new Phases.Builder()).build()); - } - - /** - * API name: {@code name} - */ - public final Builder name(@Nullable String value) { - this.name = value; - return this; - } - - /** - * Builds a {@link IlmPolicy}. - * - * @throws NullPointerException - * if some of the required fields are null. - */ - public IlmPolicy build() { - _checkSingleUse(); - - return new IlmPolicy(this); - } - } - - // --------------------------------------------------------------------------------------------- - - /** - * Json deserializer for {@link IlmPolicy} - */ - public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer.lazy(Builder::new, - IlmPolicy::setupIlmPolicyDeserializer); - - protected static void setupIlmPolicyDeserializer(ObjectDeserializer op) { - - op.add(Builder::phases, Phases._DESERIALIZER, "phases"); - op.add(Builder::name, JsonpDeserializer.stringDeserializer(), "name"); - - } - -} diff --git a/java-client/src/main/java/co/elastic/clients/elasticsearch/ilm/MoveToStepRequest.java b/java-client/src/main/java/co/elastic/clients/elasticsearch/ilm/MoveToStepRequest.java deleted file mode 100644 index 6bd3b8a9717b4..0000000000000 --- a/java-client/src/main/java/co/elastic/clients/elasticsearch/ilm/MoveToStepRequest.java +++ /dev/null @@ -1,251 +0,0 @@ -/* - * 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. - */ - -//---------------------------------------------------- -// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. -//---------------------------------------------------- - -package co.elastic.clients.elasticsearch.ilm; - -import co.elastic.clients.elasticsearch._types.ErrorResponse; -import co.elastic.clients.elasticsearch._types.RequestBase; -import co.elastic.clients.elasticsearch.ilm.move_to_step.StepKey; -import co.elastic.clients.json.JsonpDeserializable; -import co.elastic.clients.json.JsonpDeserializer; -import co.elastic.clients.json.JsonpMapper; -import co.elastic.clients.json.JsonpSerializable; -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.ApiTypeHelper; -import co.elastic.clients.util.ObjectBuilder; -import co.elastic.clients.util.ObjectBuilderBase; -import jakarta.json.stream.JsonGenerator; -import java.lang.String; -import java.util.Collections; -import java.util.Objects; -import java.util.function.Function; -import javax.annotation.Nullable; - -// typedef: ilm.move_to_step.Request - -/** - * Manually moves an index into the specified step and executes that step. - * - * @see API - * specification - */ -@JsonpDeserializable -public class MoveToStepRequest extends RequestBase implements JsonpSerializable { - @Nullable - private final StepKey currentStep; - - private final String index; - - @Nullable - private final StepKey nextStep; - - // --------------------------------------------------------------------------------------------- - - private MoveToStepRequest(Builder builder) { - - this.currentStep = builder.currentStep; - this.index = ApiTypeHelper.requireNonNull(builder.index, this, "index"); - this.nextStep = builder.nextStep; - - } - - public static MoveToStepRequest of(Function> fn) { - return fn.apply(new Builder()).build(); - } - - /** - * API name: {@code current_step} - */ - @Nullable - public final StepKey currentStep() { - return this.currentStep; - } - - /** - * Required - The name of the index whose lifecycle step is to change - *

- * API name: {@code index} - */ - public final String index() { - return this.index; - } - - /** - * API name: {@code next_step} - */ - @Nullable - public final StepKey nextStep() { - return this.nextStep; - } - - /** - * 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) { - - if (this.currentStep != null) { - generator.writeKey("current_step"); - this.currentStep.serialize(generator, mapper); - - } - if (this.nextStep != null) { - generator.writeKey("next_step"); - this.nextStep.serialize(generator, mapper); - - } - - } - - // --------------------------------------------------------------------------------------------- - - /** - * Builder for {@link MoveToStepRequest}. - */ - - public static class Builder extends ObjectBuilderBase implements ObjectBuilder { - @Nullable - private StepKey currentStep; - - private String index; - - @Nullable - private StepKey nextStep; - - /** - * API name: {@code current_step} - */ - public final Builder currentStep(@Nullable StepKey value) { - this.currentStep = value; - return this; - } - - /** - * API name: {@code current_step} - */ - public final Builder currentStep(Function> fn) { - return this.currentStep(fn.apply(new StepKey.Builder()).build()); - } - - /** - * Required - The name of the index whose lifecycle step is to change - *

- * API name: {@code index} - */ - public final Builder index(String value) { - this.index = value; - return this; - } - - /** - * API name: {@code next_step} - */ - public final Builder nextStep(@Nullable StepKey value) { - this.nextStep = value; - return this; - } - - /** - * API name: {@code next_step} - */ - public final Builder nextStep(Function> fn) { - return this.nextStep(fn.apply(new StepKey.Builder()).build()); - } - - /** - * Builds a {@link MoveToStepRequest}. - * - * @throws NullPointerException - * if some of the required fields are null. - */ - public MoveToStepRequest build() { - _checkSingleUse(); - - return new MoveToStepRequest(this); - } - } - - // --------------------------------------------------------------------------------------------- - - /** - * Json deserializer for {@link MoveToStepRequest} - */ - public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer - .lazy(Builder::new, MoveToStepRequest::setupMoveToStepRequestDeserializer); - - protected static void setupMoveToStepRequestDeserializer(ObjectDeserializer op) { - - op.add(Builder::currentStep, StepKey._DESERIALIZER, "current_step"); - op.add(Builder::nextStep, StepKey._DESERIALIZER, "next_step"); - - } - - // --------------------------------------------------------------------------------------------- - - /** - * Endpoint "{@code ilm.move_to_step}". - */ - public static final Endpoint _ENDPOINT = new SimpleEndpoint<>( - "es/ilm.move_to_step", - - // Request method - request -> { - return "POST"; - - }, - - // Request path - request -> { - final int _index = 1 << 0; - - int propsSet = 0; - - propsSet |= _index; - - if (propsSet == (_index)) { - StringBuilder buf = new StringBuilder(); - buf.append("/_ilm"); - buf.append("/move"); - buf.append("/"); - SimpleEndpoint.pathEncode(request.index, buf); - return buf.toString(); - } - throw SimpleEndpoint.noPathTemplateFound("path"); - - }, - - // Request parameters - request -> { - return Collections.emptyMap(); - - }, SimpleEndpoint.emptyMap(), true, MoveToStepResponse._DESERIALIZER); -} diff --git a/java-client/src/main/java/co/elastic/clients/elasticsearch/ilm/MoveToStepResponse.java b/java-client/src/main/java/co/elastic/clients/elasticsearch/ilm/MoveToStepResponse.java deleted file mode 100644 index a2e310ba71a06..0000000000000 --- a/java-client/src/main/java/co/elastic/clients/elasticsearch/ilm/MoveToStepResponse.java +++ /dev/null @@ -1,97 +0,0 @@ -/* - * 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. - */ - -//---------------------------------------------------- -// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. -//---------------------------------------------------- - -package co.elastic.clients.elasticsearch.ilm; - -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; - -// typedef: ilm.move_to_step.Response - -/** - * - * @see API - * specification - */ -@JsonpDeserializable -public class MoveToStepResponse extends AcknowledgedResponseBase { - // --------------------------------------------------------------------------------------------- - - private MoveToStepResponse(Builder builder) { - super(builder); - - } - - public static MoveToStepResponse of(Function> fn) { - return fn.apply(new Builder()).build(); - } - - // --------------------------------------------------------------------------------------------- - - /** - * Builder for {@link MoveToStepResponse}. - */ - - public static class Builder extends AcknowledgedResponseBase.AbstractBuilder - implements - ObjectBuilder { - @Override - protected Builder self() { - return this; - } - - /** - * Builds a {@link MoveToStepResponse}. - * - * @throws NullPointerException - * if some of the required fields are null. - */ - public MoveToStepResponse build() { - _checkSingleUse(); - - return new MoveToStepResponse(this); - } - } - - // --------------------------------------------------------------------------------------------- - - /** - * Json deserializer for {@link MoveToStepResponse} - */ - public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer - .lazy(Builder::new, MoveToStepResponse::setupMoveToStepResponseDeserializer); - - protected static void setupMoveToStepResponseDeserializer(ObjectDeserializer op) { - AcknowledgedResponseBase.setupAcknowledgedResponseBaseDeserializer(op); - - } - -} diff --git a/java-client/src/main/java/co/elastic/clients/elasticsearch/ilm/Phase.java b/java-client/src/main/java/co/elastic/clients/elasticsearch/ilm/Phase.java deleted file mode 100644 index a88d1dbcba3c5..0000000000000 --- a/java-client/src/main/java/co/elastic/clients/elasticsearch/ilm/Phase.java +++ /dev/null @@ -1,174 +0,0 @@ -/* - * 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. - */ - -//---------------------------------------------------- -// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. -//---------------------------------------------------- - -package co.elastic.clients.elasticsearch.ilm; - -import co.elastic.clients.elasticsearch._types.Time; -import co.elastic.clients.json.JsonData; -import co.elastic.clients.json.JsonpDeserializable; -import co.elastic.clients.json.JsonpDeserializer; -import co.elastic.clients.json.JsonpMapper; -import co.elastic.clients.json.JsonpSerializable; -import co.elastic.clients.json.ObjectBuilderDeserializer; -import co.elastic.clients.json.ObjectDeserializer; -import co.elastic.clients.util.ObjectBuilder; -import co.elastic.clients.util.ObjectBuilderBase; -import jakarta.json.stream.JsonGenerator; -import java.util.Objects; -import java.util.function.Function; -import javax.annotation.Nullable; - -// typedef: ilm._types.Phase - -/** - * - * @see API - * specification - */ -@JsonpDeserializable -public class Phase implements JsonpSerializable { - @Nullable - private final JsonData actions; - - @Nullable - private final Time minAge; - - // --------------------------------------------------------------------------------------------- - - private Phase(Builder builder) { - - this.actions = builder.actions; - this.minAge = builder.minAge; - - } - - public static Phase of(Function> fn) { - return fn.apply(new Builder()).build(); - } - - /** - * API name: {@code actions} - */ - @Nullable - public final JsonData actions() { - return this.actions; - } - - /** - * API name: {@code min_age} - */ - @Nullable - public final Time minAge() { - return this.minAge; - } - - /** - * 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) { - - if (this.actions != null) { - generator.writeKey("actions"); - this.actions.serialize(generator, mapper); - - } - if (this.minAge != null) { - generator.writeKey("min_age"); - this.minAge.serialize(generator, mapper); - - } - - } - - // --------------------------------------------------------------------------------------------- - - /** - * Builder for {@link Phase}. - */ - - public static class Builder extends ObjectBuilderBase implements ObjectBuilder { - @Nullable - private JsonData actions; - - @Nullable - private Time minAge; - - /** - * API name: {@code actions} - */ - public final Builder actions(@Nullable JsonData value) { - this.actions = value; - return this; - } - - /** - * API name: {@code min_age} - */ - public final Builder minAge(@Nullable Time value) { - this.minAge = value; - return this; - } - - /** - * API name: {@code min_age} - */ - public final Builder minAge(Function> fn) { - return this.minAge(fn.apply(new Time.Builder()).build()); - } - - /** - * Builds a {@link Phase}. - * - * @throws NullPointerException - * if some of the required fields are null. - */ - public Phase build() { - _checkSingleUse(); - - return new Phase(this); - } - } - - // --------------------------------------------------------------------------------------------- - - /** - * Json deserializer for {@link Phase} - */ - public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer.lazy(Builder::new, - Phase::setupPhaseDeserializer); - - protected static void setupPhaseDeserializer(ObjectDeserializer op) { - - op.add(Builder::actions, JsonData._DESERIALIZER, "actions"); - op.add(Builder::minAge, Time._DESERIALIZER, "min_age"); - - } - -} diff --git a/java-client/src/main/java/co/elastic/clients/elasticsearch/ilm/Phases.java b/java-client/src/main/java/co/elastic/clients/elasticsearch/ilm/Phases.java deleted file mode 100644 index fa3dd3a346860..0000000000000 --- a/java-client/src/main/java/co/elastic/clients/elasticsearch/ilm/Phases.java +++ /dev/null @@ -1,251 +0,0 @@ -/* - * 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. - */ - -//---------------------------------------------------- -// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. -//---------------------------------------------------- - -package co.elastic.clients.elasticsearch.ilm; - -import co.elastic.clients.json.JsonpDeserializable; -import co.elastic.clients.json.JsonpDeserializer; -import co.elastic.clients.json.JsonpMapper; -import co.elastic.clients.json.JsonpSerializable; -import co.elastic.clients.json.ObjectBuilderDeserializer; -import co.elastic.clients.json.ObjectDeserializer; -import co.elastic.clients.util.ObjectBuilder; -import co.elastic.clients.util.ObjectBuilderBase; -import jakarta.json.stream.JsonGenerator; -import java.util.Objects; -import java.util.function.Function; -import javax.annotation.Nullable; - -// typedef: ilm._types.Phases - -/** - * - * @see API - * specification - */ -@JsonpDeserializable -public class Phases implements JsonpSerializable { - @Nullable - private final Phase cold; - - @Nullable - private final Phase delete; - - @Nullable - private final Phase hot; - - @Nullable - private final Phase warm; - - // --------------------------------------------------------------------------------------------- - - private Phases(Builder builder) { - - this.cold = builder.cold; - this.delete = builder.delete; - this.hot = builder.hot; - this.warm = builder.warm; - - } - - public static Phases of(Function> fn) { - return fn.apply(new Builder()).build(); - } - - /** - * API name: {@code cold} - */ - @Nullable - public final Phase cold() { - return this.cold; - } - - /** - * API name: {@code delete} - */ - @Nullable - public final Phase delete() { - return this.delete; - } - - /** - * API name: {@code hot} - */ - @Nullable - public final Phase hot() { - return this.hot; - } - - /** - * API name: {@code warm} - */ - @Nullable - public final Phase warm() { - return this.warm; - } - - /** - * 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) { - - if (this.cold != null) { - generator.writeKey("cold"); - this.cold.serialize(generator, mapper); - - } - if (this.delete != null) { - generator.writeKey("delete"); - this.delete.serialize(generator, mapper); - - } - if (this.hot != null) { - generator.writeKey("hot"); - this.hot.serialize(generator, mapper); - - } - if (this.warm != null) { - generator.writeKey("warm"); - this.warm.serialize(generator, mapper); - - } - - } - - // --------------------------------------------------------------------------------------------- - - /** - * Builder for {@link Phases}. - */ - - public static class Builder extends ObjectBuilderBase implements ObjectBuilder { - @Nullable - private Phase cold; - - @Nullable - private Phase delete; - - @Nullable - private Phase hot; - - @Nullable - private Phase warm; - - /** - * API name: {@code cold} - */ - public final Builder cold(@Nullable Phase value) { - this.cold = value; - return this; - } - - /** - * API name: {@code cold} - */ - public final Builder cold(Function> fn) { - return this.cold(fn.apply(new Phase.Builder()).build()); - } - - /** - * API name: {@code delete} - */ - public final Builder delete(@Nullable Phase value) { - this.delete = value; - return this; - } - - /** - * API name: {@code delete} - */ - public final Builder delete(Function> fn) { - return this.delete(fn.apply(new Phase.Builder()).build()); - } - - /** - * API name: {@code hot} - */ - public final Builder hot(@Nullable Phase value) { - this.hot = value; - return this; - } - - /** - * API name: {@code hot} - */ - public final Builder hot(Function> fn) { - return this.hot(fn.apply(new Phase.Builder()).build()); - } - - /** - * API name: {@code warm} - */ - public final Builder warm(@Nullable Phase value) { - this.warm = value; - return this; - } - - /** - * API name: {@code warm} - */ - public final Builder warm(Function> fn) { - return this.warm(fn.apply(new Phase.Builder()).build()); - } - - /** - * Builds a {@link Phases}. - * - * @throws NullPointerException - * if some of the required fields are null. - */ - public Phases build() { - _checkSingleUse(); - - return new Phases(this); - } - } - - // --------------------------------------------------------------------------------------------- - - /** - * Json deserializer for {@link Phases} - */ - public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer.lazy(Builder::new, - Phases::setupPhasesDeserializer); - - protected static void setupPhasesDeserializer(ObjectDeserializer op) { - - op.add(Builder::cold, Phase._DESERIALIZER, "cold"); - op.add(Builder::delete, Phase._DESERIALIZER, "delete"); - op.add(Builder::hot, Phase._DESERIALIZER, "hot"); - op.add(Builder::warm, Phase._DESERIALIZER, "warm"); - - } - -} diff --git a/java-client/src/main/java/co/elastic/clients/elasticsearch/ilm/PutLifecycleRequest.java b/java-client/src/main/java/co/elastic/clients/elasticsearch/ilm/PutLifecycleRequest.java deleted file mode 100644 index 7242cb5cb7131..0000000000000 --- a/java-client/src/main/java/co/elastic/clients/elasticsearch/ilm/PutLifecycleRequest.java +++ /dev/null @@ -1,214 +0,0 @@ -/* - * 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. - */ - -//---------------------------------------------------- -// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. -//---------------------------------------------------- - -package co.elastic.clients.elasticsearch.ilm; - -import co.elastic.clients.elasticsearch._types.ErrorResponse; -import co.elastic.clients.elasticsearch._types.RequestBase; -import co.elastic.clients.json.JsonpDeserializable; -import co.elastic.clients.json.JsonpDeserializer; -import co.elastic.clients.json.JsonpMapper; -import co.elastic.clients.json.JsonpSerializable; -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.ApiTypeHelper; -import co.elastic.clients.util.ObjectBuilder; -import co.elastic.clients.util.ObjectBuilderBase; -import jakarta.json.stream.JsonGenerator; -import java.lang.String; -import java.util.Collections; -import java.util.Objects; -import java.util.function.Function; -import javax.annotation.Nullable; - -// typedef: ilm.put_lifecycle.Request - -/** - * Creates a lifecycle policy - * - * @see API - * specification - */ -@JsonpDeserializable -public class PutLifecycleRequest extends RequestBase implements JsonpSerializable { - private final String name; - - @Nullable - private final IlmPolicy policy; - - // --------------------------------------------------------------------------------------------- - - private PutLifecycleRequest(Builder builder) { - - this.name = ApiTypeHelper.requireNonNull(builder.name, this, "name"); - this.policy = builder.policy; - - } - - public static PutLifecycleRequest of(Function> fn) { - return fn.apply(new Builder()).build(); - } - - /** - * Required - The name of the index lifecycle policy - *

- * API name: {@code policy} - */ - public final String name() { - return this.name; - } - - /** - * API name: {@code policy} - */ - @Nullable - public final IlmPolicy policy() { - return this.policy; - } - - /** - * 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) { - - if (this.policy != null) { - generator.writeKey("policy"); - this.policy.serialize(generator, mapper); - - } - - } - - // --------------------------------------------------------------------------------------------- - - /** - * Builder for {@link PutLifecycleRequest}. - */ - - public static class Builder extends ObjectBuilderBase implements ObjectBuilder { - private String name; - - @Nullable - private IlmPolicy policy; - - /** - * Required - The name of the index lifecycle policy - *

- * API name: {@code policy} - */ - public final Builder name(String value) { - this.name = value; - return this; - } - - /** - * API name: {@code policy} - */ - public final Builder policy(@Nullable IlmPolicy value) { - this.policy = value; - return this; - } - - /** - * API name: {@code policy} - */ - public final Builder policy(Function> fn) { - return this.policy(fn.apply(new IlmPolicy.Builder()).build()); - } - - /** - * Builds a {@link PutLifecycleRequest}. - * - * @throws NullPointerException - * if some of the required fields are null. - */ - public PutLifecycleRequest build() { - _checkSingleUse(); - - return new PutLifecycleRequest(this); - } - } - - // --------------------------------------------------------------------------------------------- - - /** - * Json deserializer for {@link PutLifecycleRequest} - */ - public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer - .lazy(Builder::new, PutLifecycleRequest::setupPutLifecycleRequestDeserializer); - - protected static void setupPutLifecycleRequestDeserializer(ObjectDeserializer op) { - - op.add(Builder::policy, IlmPolicy._DESERIALIZER, "policy"); - - } - - // --------------------------------------------------------------------------------------------- - - /** - * Endpoint "{@code ilm.put_lifecycle}". - */ - public static final Endpoint _ENDPOINT = new SimpleEndpoint<>( - "es/ilm.put_lifecycle", - - // Request method - request -> { - return "PUT"; - - }, - - // Request path - request -> { - final int _name = 1 << 0; - - int propsSet = 0; - - propsSet |= _name; - - if (propsSet == (_name)) { - StringBuilder buf = new StringBuilder(); - buf.append("/_ilm"); - buf.append("/policy"); - buf.append("/"); - SimpleEndpoint.pathEncode(request.name, buf); - return buf.toString(); - } - throw SimpleEndpoint.noPathTemplateFound("path"); - - }, - - // Request parameters - request -> { - return Collections.emptyMap(); - - }, SimpleEndpoint.emptyMap(), true, PutLifecycleResponse._DESERIALIZER); -} diff --git a/java-client/src/main/java/co/elastic/clients/elasticsearch/ilm/PutLifecycleResponse.java b/java-client/src/main/java/co/elastic/clients/elasticsearch/ilm/PutLifecycleResponse.java deleted file mode 100644 index 339a2fa3a3590..0000000000000 --- a/java-client/src/main/java/co/elastic/clients/elasticsearch/ilm/PutLifecycleResponse.java +++ /dev/null @@ -1,97 +0,0 @@ -/* - * 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. - */ - -//---------------------------------------------------- -// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. -//---------------------------------------------------- - -package co.elastic.clients.elasticsearch.ilm; - -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; - -// typedef: ilm.put_lifecycle.Response - -/** - * - * @see API - * specification - */ -@JsonpDeserializable -public class PutLifecycleResponse extends AcknowledgedResponseBase { - // --------------------------------------------------------------------------------------------- - - private PutLifecycleResponse(Builder builder) { - super(builder); - - } - - public static PutLifecycleResponse of(Function> fn) { - return fn.apply(new Builder()).build(); - } - - // --------------------------------------------------------------------------------------------- - - /** - * Builder for {@link PutLifecycleResponse}. - */ - - public static class Builder extends AcknowledgedResponseBase.AbstractBuilder - implements - ObjectBuilder { - @Override - protected Builder self() { - return this; - } - - /** - * Builds a {@link PutLifecycleResponse}. - * - * @throws NullPointerException - * if some of the required fields are null. - */ - public PutLifecycleResponse build() { - _checkSingleUse(); - - return new PutLifecycleResponse(this); - } - } - - // --------------------------------------------------------------------------------------------- - - /** - * Json deserializer for {@link PutLifecycleResponse} - */ - public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer - .lazy(Builder::new, PutLifecycleResponse::setupPutLifecycleResponseDeserializer); - - protected static void setupPutLifecycleResponseDeserializer(ObjectDeserializer op) { - AcknowledgedResponseBase.setupAcknowledgedResponseBaseDeserializer(op); - - } - -} diff --git a/java-client/src/main/java/co/elastic/clients/elasticsearch/ilm/RemovePolicyRequest.java b/java-client/src/main/java/co/elastic/clients/elasticsearch/ilm/RemovePolicyRequest.java deleted file mode 100644 index 4f7df165dc477..0000000000000 --- a/java-client/src/main/java/co/elastic/clients/elasticsearch/ilm/RemovePolicyRequest.java +++ /dev/null @@ -1,149 +0,0 @@ -/* - * 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. - */ - -//---------------------------------------------------- -// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. -//---------------------------------------------------- - -package co.elastic.clients.elasticsearch.ilm; - -import co.elastic.clients.elasticsearch._types.ErrorResponse; -import co.elastic.clients.elasticsearch._types.RequestBase; -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.ApiTypeHelper; -import co.elastic.clients.util.ObjectBuilder; -import co.elastic.clients.util.ObjectBuilderBase; -import jakarta.json.stream.JsonGenerator; -import java.lang.String; -import java.util.Collections; -import java.util.Objects; -import java.util.function.Function; -import javax.annotation.Nullable; - -// typedef: ilm.remove_policy.Request - -/** - * Removes the assigned lifecycle policy and stops managing the specified index - * - * @see API - * specification - */ - -public class RemovePolicyRequest extends RequestBase { - private final String index; - - // --------------------------------------------------------------------------------------------- - - private RemovePolicyRequest(Builder builder) { - - this.index = ApiTypeHelper.requireNonNull(builder.index, this, "index"); - - } - - public static RemovePolicyRequest of(Function> fn) { - return fn.apply(new Builder()).build(); - } - - /** - * Required - The name of the index to remove policy on - *

- * API name: {@code index} - */ - public final String index() { - return this.index; - } - - // --------------------------------------------------------------------------------------------- - - /** - * Builder for {@link RemovePolicyRequest}. - */ - - public static class Builder extends ObjectBuilderBase implements ObjectBuilder { - private String index; - - /** - * Required - The name of the index to remove policy on - *

- * API name: {@code index} - */ - public final Builder index(String value) { - this.index = value; - return this; - } - - /** - * Builds a {@link RemovePolicyRequest}. - * - * @throws NullPointerException - * if some of the required fields are null. - */ - public RemovePolicyRequest build() { - _checkSingleUse(); - - return new RemovePolicyRequest(this); - } - } - - // --------------------------------------------------------------------------------------------- - - /** - * Endpoint "{@code ilm.remove_policy}". - */ - public static final Endpoint _ENDPOINT = new SimpleEndpoint<>( - "es/ilm.remove_policy", - - // Request method - request -> { - return "POST"; - - }, - - // Request path - request -> { - final int _index = 1 << 0; - - int propsSet = 0; - - propsSet |= _index; - - if (propsSet == (_index)) { - StringBuilder buf = new StringBuilder(); - buf.append("/"); - SimpleEndpoint.pathEncode(request.index, buf); - buf.append("/_ilm"); - buf.append("/remove"); - return buf.toString(); - } - throw SimpleEndpoint.noPathTemplateFound("path"); - - }, - - // Request parameters - request -> { - return Collections.emptyMap(); - - }, SimpleEndpoint.emptyMap(), false, RemovePolicyResponse._DESERIALIZER); -} diff --git a/java-client/src/main/java/co/elastic/clients/elasticsearch/ilm/RemovePolicyResponse.java b/java-client/src/main/java/co/elastic/clients/elasticsearch/ilm/RemovePolicyResponse.java deleted file mode 100644 index ad80f6cd1f3a4..0000000000000 --- a/java-client/src/main/java/co/elastic/clients/elasticsearch/ilm/RemovePolicyResponse.java +++ /dev/null @@ -1,178 +0,0 @@ -/* - * 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. - */ - -//---------------------------------------------------- -// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. -//---------------------------------------------------- - -package co.elastic.clients.elasticsearch.ilm; - -import co.elastic.clients.json.JsonpDeserializable; -import co.elastic.clients.json.JsonpDeserializer; -import co.elastic.clients.json.JsonpMapper; -import co.elastic.clients.json.JsonpSerializable; -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 co.elastic.clients.util.ObjectBuilderBase; -import jakarta.json.stream.JsonGenerator; -import java.lang.Boolean; -import java.lang.String; -import java.util.List; -import java.util.Objects; -import java.util.function.Function; -import javax.annotation.Nullable; - -// typedef: ilm.remove_policy.Response - -/** - * - * @see API - * specification - */ -@JsonpDeserializable -public class RemovePolicyResponse implements JsonpSerializable { - private final List failedIndexes; - - private final boolean hasFailures; - - // --------------------------------------------------------------------------------------------- - - private RemovePolicyResponse(Builder builder) { - - this.failedIndexes = ApiTypeHelper.unmodifiableRequired(builder.failedIndexes, this, "failedIndexes"); - this.hasFailures = ApiTypeHelper.requireNonNull(builder.hasFailures, this, "hasFailures"); - - } - - public static RemovePolicyResponse of(Function> fn) { - return fn.apply(new Builder()).build(); - } - - /** - * Required - API name: {@code failed_indexes} - */ - public final List failedIndexes() { - return this.failedIndexes; - } - - /** - * Required - API name: {@code has_failures} - */ - public final boolean hasFailures() { - return this.hasFailures; - } - - /** - * 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) { - - if (ApiTypeHelper.isDefined(this.failedIndexes)) { - generator.writeKey("failed_indexes"); - generator.writeStartArray(); - for (String item0 : this.failedIndexes) { - generator.write(item0); - - } - generator.writeEnd(); - - } - generator.writeKey("has_failures"); - generator.write(this.hasFailures); - - } - - // --------------------------------------------------------------------------------------------- - - /** - * Builder for {@link RemovePolicyResponse}. - */ - - public static class Builder extends ObjectBuilderBase implements ObjectBuilder { - private List failedIndexes; - - private Boolean hasFailures; - - /** - * Required - API name: {@code failed_indexes} - *

- * Adds all elements of list to failedIndexes. - */ - public final Builder failedIndexes(List list) { - this.failedIndexes = _listAddAll(this.failedIndexes, list); - return this; - } - - /** - * Required - API name: {@code failed_indexes} - *

- * Adds one or more values to failedIndexes. - */ - public final Builder failedIndexes(String value, String... values) { - this.failedIndexes = _listAdd(this.failedIndexes, value, values); - return this; - } - - /** - * Required - API name: {@code has_failures} - */ - public final Builder hasFailures(boolean value) { - this.hasFailures = value; - return this; - } - - /** - * Builds a {@link RemovePolicyResponse}. - * - * @throws NullPointerException - * if some of the required fields are null. - */ - public RemovePolicyResponse build() { - _checkSingleUse(); - - return new RemovePolicyResponse(this); - } - } - - // --------------------------------------------------------------------------------------------- - - /** - * Json deserializer for {@link RemovePolicyResponse} - */ - public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer - .lazy(Builder::new, RemovePolicyResponse::setupRemovePolicyResponseDeserializer); - - protected static void setupRemovePolicyResponseDeserializer(ObjectDeserializer op) { - - op.add(Builder::failedIndexes, JsonpDeserializer.arrayDeserializer(JsonpDeserializer.stringDeserializer()), - "failed_indexes"); - op.add(Builder::hasFailures, JsonpDeserializer.booleanDeserializer(), "has_failures"); - - } - -} diff --git a/java-client/src/main/java/co/elastic/clients/elasticsearch/ilm/RetryRequest.java b/java-client/src/main/java/co/elastic/clients/elasticsearch/ilm/RetryRequest.java deleted file mode 100644 index d9fa626b4041a..0000000000000 --- a/java-client/src/main/java/co/elastic/clients/elasticsearch/ilm/RetryRequest.java +++ /dev/null @@ -1,151 +0,0 @@ -/* - * 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. - */ - -//---------------------------------------------------- -// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. -//---------------------------------------------------- - -package co.elastic.clients.elasticsearch.ilm; - -import co.elastic.clients.elasticsearch._types.ErrorResponse; -import co.elastic.clients.elasticsearch._types.RequestBase; -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.ApiTypeHelper; -import co.elastic.clients.util.ObjectBuilder; -import co.elastic.clients.util.ObjectBuilderBase; -import jakarta.json.stream.JsonGenerator; -import java.lang.String; -import java.util.Collections; -import java.util.Objects; -import java.util.function.Function; -import javax.annotation.Nullable; - -// typedef: ilm.retry.Request - -/** - * Retries executing the policy for an index that is in the ERROR step. - * - * @see API - * specification - */ - -public class RetryRequest extends RequestBase { - private final String index; - - // --------------------------------------------------------------------------------------------- - - private RetryRequest(Builder builder) { - - this.index = ApiTypeHelper.requireNonNull(builder.index, this, "index"); - - } - - public static RetryRequest of(Function> fn) { - return fn.apply(new Builder()).build(); - } - - /** - * Required - The name of the indices (comma-separated) whose failed lifecycle - * step is to be retry - *

- * API name: {@code index} - */ - public final String index() { - return this.index; - } - - // --------------------------------------------------------------------------------------------- - - /** - * Builder for {@link RetryRequest}. - */ - - public static class Builder extends ObjectBuilderBase implements ObjectBuilder { - private String index; - - /** - * Required - The name of the indices (comma-separated) whose failed lifecycle - * step is to be retry - *

- * API name: {@code index} - */ - public final Builder index(String value) { - this.index = value; - return this; - } - - /** - * Builds a {@link RetryRequest}. - * - * @throws NullPointerException - * if some of the required fields are null. - */ - public RetryRequest build() { - _checkSingleUse(); - - return new RetryRequest(this); - } - } - - // --------------------------------------------------------------------------------------------- - - /** - * Endpoint "{@code ilm.retry}". - */ - public static final Endpoint _ENDPOINT = new SimpleEndpoint<>( - "es/ilm.retry", - - // Request method - request -> { - return "POST"; - - }, - - // Request path - request -> { - final int _index = 1 << 0; - - int propsSet = 0; - - propsSet |= _index; - - if (propsSet == (_index)) { - StringBuilder buf = new StringBuilder(); - buf.append("/"); - SimpleEndpoint.pathEncode(request.index, buf); - buf.append("/_ilm"); - buf.append("/retry"); - return buf.toString(); - } - throw SimpleEndpoint.noPathTemplateFound("path"); - - }, - - // Request parameters - request -> { - return Collections.emptyMap(); - - }, SimpleEndpoint.emptyMap(), false, RetryResponse._DESERIALIZER); -} diff --git a/java-client/src/main/java/co/elastic/clients/elasticsearch/ilm/RetryResponse.java b/java-client/src/main/java/co/elastic/clients/elasticsearch/ilm/RetryResponse.java deleted file mode 100644 index 6c61e74ef91b4..0000000000000 --- a/java-client/src/main/java/co/elastic/clients/elasticsearch/ilm/RetryResponse.java +++ /dev/null @@ -1,97 +0,0 @@ -/* - * 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. - */ - -//---------------------------------------------------- -// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. -//---------------------------------------------------- - -package co.elastic.clients.elasticsearch.ilm; - -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; - -// typedef: ilm.retry.Response - -/** - * - * @see API - * specification - */ -@JsonpDeserializable -public class RetryResponse extends AcknowledgedResponseBase { - // --------------------------------------------------------------------------------------------- - - private RetryResponse(Builder builder) { - super(builder); - - } - - public static RetryResponse of(Function> fn) { - return fn.apply(new Builder()).build(); - } - - // --------------------------------------------------------------------------------------------- - - /** - * Builder for {@link RetryResponse}. - */ - - public static class Builder extends AcknowledgedResponseBase.AbstractBuilder - implements - ObjectBuilder { - @Override - protected Builder self() { - return this; - } - - /** - * Builds a {@link RetryResponse}. - * - * @throws NullPointerException - * if some of the required fields are null. - */ - public RetryResponse build() { - _checkSingleUse(); - - return new RetryResponse(this); - } - } - - // --------------------------------------------------------------------------------------------- - - /** - * Json deserializer for {@link RetryResponse} - */ - public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer.lazy(Builder::new, - RetryResponse::setupRetryResponseDeserializer); - - protected static void setupRetryResponseDeserializer(ObjectDeserializer op) { - AcknowledgedResponseBase.setupAcknowledgedResponseBaseDeserializer(op); - - } - -} diff --git a/java-client/src/main/java/co/elastic/clients/elasticsearch/ilm/StartIlmRequest.java b/java-client/src/main/java/co/elastic/clients/elasticsearch/ilm/StartIlmRequest.java deleted file mode 100644 index b7bdf5bed7161..0000000000000 --- a/java-client/src/main/java/co/elastic/clients/elasticsearch/ilm/StartIlmRequest.java +++ /dev/null @@ -1,178 +0,0 @@ -/* - * 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. - */ - -//---------------------------------------------------- -// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. -//---------------------------------------------------- - -package co.elastic.clients.elasticsearch.ilm; - -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 co.elastic.clients.util.ObjectBuilderBase; -import jakarta.json.stream.JsonGenerator; -import java.util.HashMap; -import java.util.Map; -import java.util.Objects; -import java.util.function.Function; -import javax.annotation.Nullable; - -// typedef: ilm.start.Request - -/** - * Start the index lifecycle management (ILM) plugin. - * - * @see API - * specification - */ - -public class StartIlmRequest extends RequestBase { - @Nullable - private final Time masterTimeout; - - @Nullable - private final Time timeout; - - // --------------------------------------------------------------------------------------------- - - private StartIlmRequest(Builder builder) { - - this.masterTimeout = builder.masterTimeout; - this.timeout = builder.timeout; - - } - - public static StartIlmRequest of(Function> fn) { - return fn.apply(new Builder()).build(); - } - - /** - * API name: {@code master_timeout} - */ - @Nullable - public final Time masterTimeout() { - return this.masterTimeout; - } - - /** - * API name: {@code timeout} - */ - @Nullable - public final Time timeout() { - return this.timeout; - } - - // --------------------------------------------------------------------------------------------- - - /** - * Builder for {@link StartIlmRequest}. - */ - - public static class Builder extends ObjectBuilderBase implements ObjectBuilder { - @Nullable - private Time masterTimeout; - - @Nullable - private Time timeout; - - /** - * API name: {@code master_timeout} - */ - public final Builder masterTimeout(@Nullable Time value) { - this.masterTimeout = value; - return this; - } - - /** - * API name: {@code master_timeout} - */ - public final Builder masterTimeout(Function> fn) { - return this.masterTimeout(fn.apply(new Time.Builder()).build()); - } - - /** - * API name: {@code timeout} - */ - public final Builder timeout(@Nullable Time value) { - this.timeout = value; - return this; - } - - /** - * API name: {@code timeout} - */ - public final Builder timeout(Function> fn) { - return this.timeout(fn.apply(new Time.Builder()).build()); - } - - /** - * Builds a {@link StartIlmRequest}. - * - * @throws NullPointerException - * if some of the required fields are null. - */ - public StartIlmRequest build() { - _checkSingleUse(); - - return new StartIlmRequest(this); - } - } - - // --------------------------------------------------------------------------------------------- - - /** - * Endpoint "{@code ilm.start}". - */ - public static final Endpoint _ENDPOINT = new SimpleEndpoint<>( - "es/ilm.start", - - // Request method - request -> { - return "POST"; - - }, - - // Request path - request -> { - return "/_ilm/start"; - - }, - - // Request parameters - request -> { - Map params = new HashMap<>(); - if (request.masterTimeout != null) { - params.put("master_timeout", request.masterTimeout._toJsonString()); - } - if (request.timeout != null) { - params.put("timeout", request.timeout._toJsonString()); - } - return params; - - }, SimpleEndpoint.emptyMap(), false, StartIlmResponse._DESERIALIZER); -} diff --git a/java-client/src/main/java/co/elastic/clients/elasticsearch/ilm/StartIlmResponse.java b/java-client/src/main/java/co/elastic/clients/elasticsearch/ilm/StartIlmResponse.java deleted file mode 100644 index b83e79bce2e42..0000000000000 --- a/java-client/src/main/java/co/elastic/clients/elasticsearch/ilm/StartIlmResponse.java +++ /dev/null @@ -1,97 +0,0 @@ -/* - * 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. - */ - -//---------------------------------------------------- -// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. -//---------------------------------------------------- - -package co.elastic.clients.elasticsearch.ilm; - -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; - -// typedef: ilm.start.Response - -/** - * - * @see API - * specification - */ -@JsonpDeserializable -public class StartIlmResponse extends AcknowledgedResponseBase { - // --------------------------------------------------------------------------------------------- - - private StartIlmResponse(Builder builder) { - super(builder); - - } - - public static StartIlmResponse of(Function> fn) { - return fn.apply(new Builder()).build(); - } - - // --------------------------------------------------------------------------------------------- - - /** - * Builder for {@link StartIlmResponse}. - */ - - public static class Builder extends AcknowledgedResponseBase.AbstractBuilder - implements - ObjectBuilder { - @Override - protected Builder self() { - return this; - } - - /** - * Builds a {@link StartIlmResponse}. - * - * @throws NullPointerException - * if some of the required fields are null. - */ - public StartIlmResponse build() { - _checkSingleUse(); - - return new StartIlmResponse(this); - } - } - - // --------------------------------------------------------------------------------------------- - - /** - * Json deserializer for {@link StartIlmResponse} - */ - public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer.lazy(Builder::new, - StartIlmResponse::setupStartIlmResponseDeserializer); - - protected static void setupStartIlmResponseDeserializer(ObjectDeserializer op) { - AcknowledgedResponseBase.setupAcknowledgedResponseBaseDeserializer(op); - - } - -} diff --git a/java-client/src/main/java/co/elastic/clients/elasticsearch/ilm/StopIlmRequest.java b/java-client/src/main/java/co/elastic/clients/elasticsearch/ilm/StopIlmRequest.java deleted file mode 100644 index 613c8ba87d952..0000000000000 --- a/java-client/src/main/java/co/elastic/clients/elasticsearch/ilm/StopIlmRequest.java +++ /dev/null @@ -1,179 +0,0 @@ -/* - * 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. - */ - -//---------------------------------------------------- -// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. -//---------------------------------------------------- - -package co.elastic.clients.elasticsearch.ilm; - -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 co.elastic.clients.util.ObjectBuilderBase; -import jakarta.json.stream.JsonGenerator; -import java.util.HashMap; -import java.util.Map; -import java.util.Objects; -import java.util.function.Function; -import javax.annotation.Nullable; - -// typedef: ilm.stop.Request - -/** - * Halts all lifecycle management operations and stops the index lifecycle - * management (ILM) plugin - * - * @see API - * specification - */ - -public class StopIlmRequest extends RequestBase { - @Nullable - private final Time masterTimeout; - - @Nullable - private final Time timeout; - - // --------------------------------------------------------------------------------------------- - - private StopIlmRequest(Builder builder) { - - this.masterTimeout = builder.masterTimeout; - this.timeout = builder.timeout; - - } - - public static StopIlmRequest of(Function> fn) { - return fn.apply(new Builder()).build(); - } - - /** - * API name: {@code master_timeout} - */ - @Nullable - public final Time masterTimeout() { - return this.masterTimeout; - } - - /** - * API name: {@code timeout} - */ - @Nullable - public final Time timeout() { - return this.timeout; - } - - // --------------------------------------------------------------------------------------------- - - /** - * Builder for {@link StopIlmRequest}. - */ - - public static class Builder extends ObjectBuilderBase implements ObjectBuilder { - @Nullable - private Time masterTimeout; - - @Nullable - private Time timeout; - - /** - * API name: {@code master_timeout} - */ - public final Builder masterTimeout(@Nullable Time value) { - this.masterTimeout = value; - return this; - } - - /** - * API name: {@code master_timeout} - */ - public final Builder masterTimeout(Function> fn) { - return this.masterTimeout(fn.apply(new Time.Builder()).build()); - } - - /** - * API name: {@code timeout} - */ - public final Builder timeout(@Nullable Time value) { - this.timeout = value; - return this; - } - - /** - * API name: {@code timeout} - */ - public final Builder timeout(Function> fn) { - return this.timeout(fn.apply(new Time.Builder()).build()); - } - - /** - * Builds a {@link StopIlmRequest}. - * - * @throws NullPointerException - * if some of the required fields are null. - */ - public StopIlmRequest build() { - _checkSingleUse(); - - return new StopIlmRequest(this); - } - } - - // --------------------------------------------------------------------------------------------- - - /** - * Endpoint "{@code ilm.stop}". - */ - public static final Endpoint _ENDPOINT = new SimpleEndpoint<>( - "es/ilm.stop", - - // Request method - request -> { - return "POST"; - - }, - - // Request path - request -> { - return "/_ilm/stop"; - - }, - - // Request parameters - request -> { - Map params = new HashMap<>(); - if (request.masterTimeout != null) { - params.put("master_timeout", request.masterTimeout._toJsonString()); - } - if (request.timeout != null) { - params.put("timeout", request.timeout._toJsonString()); - } - return params; - - }, SimpleEndpoint.emptyMap(), false, StopIlmResponse._DESERIALIZER); -} diff --git a/java-client/src/main/java/co/elastic/clients/elasticsearch/ilm/StopIlmResponse.java b/java-client/src/main/java/co/elastic/clients/elasticsearch/ilm/StopIlmResponse.java deleted file mode 100644 index 598bc7e3a7913..0000000000000 --- a/java-client/src/main/java/co/elastic/clients/elasticsearch/ilm/StopIlmResponse.java +++ /dev/null @@ -1,97 +0,0 @@ -/* - * 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. - */ - -//---------------------------------------------------- -// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. -//---------------------------------------------------- - -package co.elastic.clients.elasticsearch.ilm; - -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; - -// typedef: ilm.stop.Response - -/** - * - * @see API - * specification - */ -@JsonpDeserializable -public class StopIlmResponse extends AcknowledgedResponseBase { - // --------------------------------------------------------------------------------------------- - - private StopIlmResponse(Builder builder) { - super(builder); - - } - - public static StopIlmResponse of(Function> fn) { - return fn.apply(new Builder()).build(); - } - - // --------------------------------------------------------------------------------------------- - - /** - * Builder for {@link StopIlmResponse}. - */ - - public static class Builder extends AcknowledgedResponseBase.AbstractBuilder - implements - ObjectBuilder { - @Override - protected Builder self() { - return this; - } - - /** - * Builds a {@link StopIlmResponse}. - * - * @throws NullPointerException - * if some of the required fields are null. - */ - public StopIlmResponse build() { - _checkSingleUse(); - - return new StopIlmResponse(this); - } - } - - // --------------------------------------------------------------------------------------------- - - /** - * Json deserializer for {@link StopIlmResponse} - */ - public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer.lazy(Builder::new, - StopIlmResponse::setupStopIlmResponseDeserializer); - - protected static void setupStopIlmResponseDeserializer(ObjectDeserializer op) { - AcknowledgedResponseBase.setupAcknowledgedResponseBaseDeserializer(op); - - } - -} diff --git a/java-client/src/main/java/co/elastic/clients/elasticsearch/ilm/explain_lifecycle/LifecycleExplain.java b/java-client/src/main/java/co/elastic/clients/elasticsearch/ilm/explain_lifecycle/LifecycleExplain.java deleted file mode 100644 index a97aadabc3d6a..0000000000000 --- a/java-client/src/main/java/co/elastic/clients/elasticsearch/ilm/explain_lifecycle/LifecycleExplain.java +++ /dev/null @@ -1,199 +0,0 @@ -/* - * 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. - */ - -//---------------------------------------------------- -// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. -//---------------------------------------------------- - -package co.elastic.clients.elasticsearch.ilm.explain_lifecycle; - -import co.elastic.clients.json.JsonEnum; -import co.elastic.clients.json.JsonpDeserializable; -import co.elastic.clients.json.JsonpDeserializer; -import co.elastic.clients.json.JsonpMapper; -import co.elastic.clients.json.JsonpSerializable; -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 co.elastic.clients.util.ObjectBuilderBase; -import co.elastic.clients.util.TaggedUnion; -import co.elastic.clients.util.TaggedUnionUtils; -import jakarta.json.stream.JsonGenerator; -import java.util.Objects; -import java.util.function.Function; -import javax.annotation.Nullable; - -// typedef: ilm.explain_lifecycle.LifecycleExplain - -/** - * - * @see API - * specification - */ -@JsonpDeserializable -public class LifecycleExplain - implements - TaggedUnion, - JsonpSerializable { - - /** - * {@link LifecycleExplain} variant kinds. - */ - /** - * {@link LifecycleExplain} variant kinds. - */ - - public enum Kind implements JsonEnum { - True("true"), - - False("false"), - - ; - - private final String jsonValue; - - Kind(String jsonValue) { - this.jsonValue = jsonValue; - } - - public String jsonValue() { - return this.jsonValue; - } - - } - - private final Kind _kind; - private final LifecycleExplainVariant _value; - - @Override - public final Kind _kind() { - return _kind; - } - - @Override - public final LifecycleExplainVariant _get() { - return _value; - } - - public LifecycleExplain(LifecycleExplainVariant value) { - - this._kind = ApiTypeHelper.requireNonNull(value._lifecycleExplainKind(), this, ""); - this._value = ApiTypeHelper.requireNonNull(value, this, ""); - - } - - private LifecycleExplain(Builder builder) { - - this._kind = ApiTypeHelper.requireNonNull(builder._kind, builder, ""); - this._value = ApiTypeHelper.requireNonNull(builder._value, builder, ""); - - } - - public static LifecycleExplain of(Function> fn) { - return fn.apply(new Builder()).build(); - } - - /** - * Is this variant instance of kind {@code true}? - */ - public boolean isTrue() { - return _kind == Kind.True; - } - - /** - * Get the {@code true} variant value. - * - * @throws IllegalStateException - * if the current variant is not of the {@code true} kind. - */ - public LifecycleExplainManaged true_() { - return TaggedUnionUtils.get(this, Kind.True); - } - - /** - * Is this variant instance of kind {@code false}? - */ - public boolean isFalse() { - return _kind == Kind.False; - } - - /** - * Get the {@code false} variant value. - * - * @throws IllegalStateException - * if the current variant is not of the {@code false} kind. - */ - public LifecycleExplainUnmanaged false_() { - return TaggedUnionUtils.get(this, Kind.False); - } - - @Override - public void serialize(JsonGenerator generator, JsonpMapper mapper) { - - mapper.serialize(_value, generator); - - } - - public static class Builder extends ObjectBuilderBase implements ObjectBuilder { - private Kind _kind; - private LifecycleExplainVariant _value; - - public ObjectBuilder true_(LifecycleExplainManaged v) { - this._kind = Kind.True; - this._value = v; - return this; - } - - public ObjectBuilder true_( - Function> fn) { - return this.true_(fn.apply(new LifecycleExplainManaged.Builder()).build()); - } - - public ObjectBuilder false_(LifecycleExplainUnmanaged v) { - this._kind = Kind.False; - this._value = v; - return this; - } - - public ObjectBuilder false_( - Function> fn) { - return this.false_(fn.apply(new LifecycleExplainUnmanaged.Builder()).build()); - } - - public LifecycleExplain build() { - _checkSingleUse(); - return new LifecycleExplain(this); - } - - } - - protected static void setupLifecycleExplainDeserializer(ObjectDeserializer op) { - - op.add(Builder::true_, LifecycleExplainManaged._DESERIALIZER, "true"); - op.add(Builder::false_, LifecycleExplainUnmanaged._DESERIALIZER, "false"); - - op.setTypeProperty("managed", null); - - } - - public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer.lazy(Builder::new, - LifecycleExplain::setupLifecycleExplainDeserializer, Builder::build); -} diff --git a/java-client/src/main/java/co/elastic/clients/elasticsearch/ilm/explain_lifecycle/LifecycleExplainBuilders.java b/java-client/src/main/java/co/elastic/clients/elasticsearch/ilm/explain_lifecycle/LifecycleExplainBuilders.java deleted file mode 100644 index 9423f2df85289..0000000000000 --- a/java-client/src/main/java/co/elastic/clients/elasticsearch/ilm/explain_lifecycle/LifecycleExplainBuilders.java +++ /dev/null @@ -1,49 +0,0 @@ -/* - * 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. - */ - -//---------------------------------------------------- -// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. -//---------------------------------------------------- - -package co.elastic.clients.elasticsearch.ilm.explain_lifecycle; - -/** - * Builders for {@link LifecycleExplain} variants. - */ -public class LifecycleExplainBuilders { - private LifecycleExplainBuilders() { - } - - /** - * Creates a builder for the {@link LifecycleExplainManaged true} - * {@code LifecycleExplain} variant. - */ - public static LifecycleExplainManaged.Builder true_() { - return new LifecycleExplainManaged.Builder(); - } - - /** - * Creates a builder for the {@link LifecycleExplainUnmanaged false} - * {@code LifecycleExplain} variant. - */ - public static LifecycleExplainUnmanaged.Builder false_() { - return new LifecycleExplainUnmanaged.Builder(); - } - -} diff --git a/java-client/src/main/java/co/elastic/clients/elasticsearch/ilm/explain_lifecycle/LifecycleExplainManaged.java b/java-client/src/main/java/co/elastic/clients/elasticsearch/ilm/explain_lifecycle/LifecycleExplainManaged.java deleted file mode 100644 index afea6cb361b58..0000000000000 --- a/java-client/src/main/java/co/elastic/clients/elasticsearch/ilm/explain_lifecycle/LifecycleExplainManaged.java +++ /dev/null @@ -1,537 +0,0 @@ -/* - * 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. - */ - -//---------------------------------------------------- -// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. -//---------------------------------------------------- - -package co.elastic.clients.elasticsearch.ilm.explain_lifecycle; - -import co.elastic.clients.elasticsearch._types.Time; -import co.elastic.clients.json.JsonData; -import co.elastic.clients.json.JsonpDeserializable; -import co.elastic.clients.json.JsonpDeserializer; -import co.elastic.clients.json.JsonpMapper; -import co.elastic.clients.json.JsonpSerializable; -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 co.elastic.clients.util.ObjectBuilderBase; -import jakarta.json.stream.JsonGenerator; -import java.lang.Boolean; -import java.lang.Integer; -import java.lang.String; -import java.util.Map; -import java.util.Objects; -import java.util.function.Function; -import javax.annotation.Nullable; - -// typedef: ilm.explain_lifecycle.LifecycleExplainManaged - -/** - * - * @see API - * specification - */ -@JsonpDeserializable -public class LifecycleExplainManaged implements LifecycleExplainVariant, JsonpSerializable { - private final String action; - - private final String actionTimeMillis; - - private final Time age; - - @Nullable - private final String failedStep; - - @Nullable - private final Integer failedStepRetryCount; - - private final String index; - - @Nullable - private final Boolean isAutoRetryableError; - - private final String lifecycleDateMillis; - - private final String phase; - - private final String phaseTimeMillis; - - private final String policy; - - private final String step; - - private final Map stepInfo; - - private final String stepTimeMillis; - - private final LifecycleExplainPhaseExecution phaseExecution; - - // --------------------------------------------------------------------------------------------- - - private LifecycleExplainManaged(Builder builder) { - - this.action = ApiTypeHelper.requireNonNull(builder.action, this, "action"); - this.actionTimeMillis = ApiTypeHelper.requireNonNull(builder.actionTimeMillis, this, "actionTimeMillis"); - this.age = ApiTypeHelper.requireNonNull(builder.age, this, "age"); - this.failedStep = builder.failedStep; - this.failedStepRetryCount = builder.failedStepRetryCount; - this.index = ApiTypeHelper.requireNonNull(builder.index, this, "index"); - this.isAutoRetryableError = builder.isAutoRetryableError; - this.lifecycleDateMillis = ApiTypeHelper.requireNonNull(builder.lifecycleDateMillis, this, - "lifecycleDateMillis"); - this.phase = ApiTypeHelper.requireNonNull(builder.phase, this, "phase"); - this.phaseTimeMillis = ApiTypeHelper.requireNonNull(builder.phaseTimeMillis, this, "phaseTimeMillis"); - this.policy = ApiTypeHelper.requireNonNull(builder.policy, this, "policy"); - this.step = ApiTypeHelper.requireNonNull(builder.step, this, "step"); - this.stepInfo = ApiTypeHelper.unmodifiable(builder.stepInfo); - this.stepTimeMillis = ApiTypeHelper.requireNonNull(builder.stepTimeMillis, this, "stepTimeMillis"); - this.phaseExecution = ApiTypeHelper.requireNonNull(builder.phaseExecution, this, "phaseExecution"); - - } - - public static LifecycleExplainManaged of(Function> fn) { - return fn.apply(new Builder()).build(); - } - - /** - * LifecycleExplain variant kind. - */ - @Override - public LifecycleExplain.Kind _lifecycleExplainKind() { - return LifecycleExplain.Kind.True; - } - - /** - * Required - API name: {@code action} - */ - public final String action() { - return this.action; - } - - /** - * Required - API name: {@code action_time_millis} - */ - public final String actionTimeMillis() { - return this.actionTimeMillis; - } - - /** - * Required - API name: {@code age} - */ - public final Time age() { - return this.age; - } - - /** - * API name: {@code failed_step} - */ - @Nullable - public final String failedStep() { - return this.failedStep; - } - - /** - * API name: {@code failed_step_retry_count} - */ - @Nullable - public final Integer failedStepRetryCount() { - return this.failedStepRetryCount; - } - - /** - * Required - API name: {@code index} - */ - public final String index() { - return this.index; - } - - /** - * API name: {@code is_auto_retryable_error} - */ - @Nullable - public final Boolean isAutoRetryableError() { - return this.isAutoRetryableError; - } - - /** - * Required - API name: {@code lifecycle_date_millis} - */ - public final String lifecycleDateMillis() { - return this.lifecycleDateMillis; - } - - /** - * Required - API name: {@code phase} - */ - public final String phase() { - return this.phase; - } - - /** - * Required - API name: {@code phase_time_millis} - */ - public final String phaseTimeMillis() { - return this.phaseTimeMillis; - } - - /** - * Required - API name: {@code policy} - */ - public final String policy() { - return this.policy; - } - - /** - * Required - API name: {@code step} - */ - public final String step() { - return this.step; - } - - /** - * API name: {@code step_info} - */ - public final Map stepInfo() { - return this.stepInfo; - } - - /** - * Required - API name: {@code step_time_millis} - */ - public final String stepTimeMillis() { - return this.stepTimeMillis; - } - - /** - * Required - API name: {@code phase_execution} - */ - public final LifecycleExplainPhaseExecution phaseExecution() { - return this.phaseExecution; - } - - /** - * 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.write("managed", "true"); - - generator.writeKey("action"); - generator.write(this.action); - - generator.writeKey("action_time_millis"); - generator.write(this.actionTimeMillis); - - generator.writeKey("age"); - this.age.serialize(generator, mapper); - - if (this.failedStep != null) { - generator.writeKey("failed_step"); - generator.write(this.failedStep); - - } - if (this.failedStepRetryCount != null) { - generator.writeKey("failed_step_retry_count"); - generator.write(this.failedStepRetryCount); - - } - generator.writeKey("index"); - generator.write(this.index); - - if (this.isAutoRetryableError != null) { - generator.writeKey("is_auto_retryable_error"); - generator.write(this.isAutoRetryableError); - - } - generator.writeKey("lifecycle_date_millis"); - generator.write(this.lifecycleDateMillis); - - generator.writeKey("phase"); - generator.write(this.phase); - - generator.writeKey("phase_time_millis"); - generator.write(this.phaseTimeMillis); - - generator.writeKey("policy"); - generator.write(this.policy); - - generator.writeKey("step"); - generator.write(this.step); - - if (ApiTypeHelper.isDefined(this.stepInfo)) { - generator.writeKey("step_info"); - generator.writeStartObject(); - for (Map.Entry item0 : this.stepInfo.entrySet()) { - generator.writeKey(item0.getKey()); - item0.getValue().serialize(generator, mapper); - - } - generator.writeEnd(); - - } - generator.writeKey("step_time_millis"); - generator.write(this.stepTimeMillis); - - generator.writeKey("phase_execution"); - this.phaseExecution.serialize(generator, mapper); - - } - - // --------------------------------------------------------------------------------------------- - - /** - * Builder for {@link LifecycleExplainManaged}. - */ - - public static class Builder extends ObjectBuilderBase implements ObjectBuilder { - private String action; - - private String actionTimeMillis; - - private Time age; - - @Nullable - private String failedStep; - - @Nullable - private Integer failedStepRetryCount; - - private String index; - - @Nullable - private Boolean isAutoRetryableError; - - private String lifecycleDateMillis; - - private String phase; - - private String phaseTimeMillis; - - private String policy; - - private String step; - - @Nullable - private Map stepInfo; - - private String stepTimeMillis; - - private LifecycleExplainPhaseExecution phaseExecution; - - /** - * Required - API name: {@code action} - */ - public final Builder action(String value) { - this.action = value; - return this; - } - - /** - * Required - API name: {@code action_time_millis} - */ - public final Builder actionTimeMillis(String value) { - this.actionTimeMillis = value; - return this; - } - - /** - * Required - API name: {@code age} - */ - public final Builder age(Time value) { - this.age = value; - return this; - } - - /** - * Required - API name: {@code age} - */ - public final Builder age(Function> fn) { - return this.age(fn.apply(new Time.Builder()).build()); - } - - /** - * API name: {@code failed_step} - */ - public final Builder failedStep(@Nullable String value) { - this.failedStep = value; - return this; - } - - /** - * API name: {@code failed_step_retry_count} - */ - public final Builder failedStepRetryCount(@Nullable Integer value) { - this.failedStepRetryCount = value; - return this; - } - - /** - * Required - API name: {@code index} - */ - public final Builder index(String value) { - this.index = value; - return this; - } - - /** - * API name: {@code is_auto_retryable_error} - */ - public final Builder isAutoRetryableError(@Nullable Boolean value) { - this.isAutoRetryableError = value; - return this; - } - - /** - * Required - API name: {@code lifecycle_date_millis} - */ - public final Builder lifecycleDateMillis(String value) { - this.lifecycleDateMillis = value; - return this; - } - - /** - * Required - API name: {@code phase} - */ - public final Builder phase(String value) { - this.phase = value; - return this; - } - - /** - * Required - API name: {@code phase_time_millis} - */ - public final Builder phaseTimeMillis(String value) { - this.phaseTimeMillis = value; - return this; - } - - /** - * Required - API name: {@code policy} - */ - public final Builder policy(String value) { - this.policy = value; - return this; - } - - /** - * Required - API name: {@code step} - */ - public final Builder step(String value) { - this.step = value; - return this; - } - - /** - * API name: {@code step_info} - *

- * Adds all entries of map to stepInfo. - */ - public final Builder stepInfo(Map map) { - this.stepInfo = _mapPutAll(this.stepInfo, map); - return this; - } - - /** - * API name: {@code step_info} - *

- * Adds an entry to stepInfo. - */ - public final Builder stepInfo(String key, JsonData value) { - this.stepInfo = _mapPut(this.stepInfo, key, value); - return this; - } - - /** - * Required - API name: {@code step_time_millis} - */ - public final Builder stepTimeMillis(String value) { - this.stepTimeMillis = value; - return this; - } - - /** - * Required - API name: {@code phase_execution} - */ - public final Builder phaseExecution(LifecycleExplainPhaseExecution value) { - this.phaseExecution = value; - return this; - } - - /** - * Required - API name: {@code phase_execution} - */ - public final Builder phaseExecution( - Function> fn) { - return this.phaseExecution(fn.apply(new LifecycleExplainPhaseExecution.Builder()).build()); - } - - /** - * Builds a {@link LifecycleExplainManaged}. - * - * @throws NullPointerException - * if some of the required fields are null. - */ - public LifecycleExplainManaged build() { - _checkSingleUse(); - - return new LifecycleExplainManaged(this); - } - } - - // --------------------------------------------------------------------------------------------- - - /** - * Json deserializer for {@link LifecycleExplainManaged} - */ - public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer - .lazy(Builder::new, LifecycleExplainManaged::setupLifecycleExplainManagedDeserializer); - - protected static void setupLifecycleExplainManagedDeserializer( - ObjectDeserializer op) { - - op.add(Builder::action, JsonpDeserializer.stringDeserializer(), "action"); - op.add(Builder::actionTimeMillis, JsonpDeserializer.stringDeserializer(), "action_time_millis"); - op.add(Builder::age, Time._DESERIALIZER, "age"); - op.add(Builder::failedStep, JsonpDeserializer.stringDeserializer(), "failed_step"); - op.add(Builder::failedStepRetryCount, JsonpDeserializer.integerDeserializer(), "failed_step_retry_count"); - op.add(Builder::index, JsonpDeserializer.stringDeserializer(), "index"); - op.add(Builder::isAutoRetryableError, JsonpDeserializer.booleanDeserializer(), "is_auto_retryable_error"); - op.add(Builder::lifecycleDateMillis, JsonpDeserializer.stringDeserializer(), "lifecycle_date_millis"); - op.add(Builder::phase, JsonpDeserializer.stringDeserializer(), "phase"); - op.add(Builder::phaseTimeMillis, JsonpDeserializer.stringDeserializer(), "phase_time_millis"); - op.add(Builder::policy, JsonpDeserializer.stringDeserializer(), "policy"); - op.add(Builder::step, JsonpDeserializer.stringDeserializer(), "step"); - op.add(Builder::stepInfo, JsonpDeserializer.stringMapDeserializer(JsonData._DESERIALIZER), "step_info"); - op.add(Builder::stepTimeMillis, JsonpDeserializer.stringDeserializer(), "step_time_millis"); - op.add(Builder::phaseExecution, LifecycleExplainPhaseExecution._DESERIALIZER, "phase_execution"); - - op.ignore("managed"); - } - -} diff --git a/java-client/src/main/java/co/elastic/clients/elasticsearch/ilm/explain_lifecycle/LifecycleExplainPhaseExecution.java b/java-client/src/main/java/co/elastic/clients/elasticsearch/ilm/explain_lifecycle/LifecycleExplainPhaseExecution.java deleted file mode 100644 index 723ff2c50ea3c..0000000000000 --- a/java-client/src/main/java/co/elastic/clients/elasticsearch/ilm/explain_lifecycle/LifecycleExplainPhaseExecution.java +++ /dev/null @@ -1,184 +0,0 @@ -/* - * 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. - */ - -//---------------------------------------------------- -// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. -//---------------------------------------------------- - -package co.elastic.clients.elasticsearch.ilm.explain_lifecycle; - -import co.elastic.clients.json.JsonpDeserializable; -import co.elastic.clients.json.JsonpDeserializer; -import co.elastic.clients.json.JsonpMapper; -import co.elastic.clients.json.JsonpSerializable; -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 co.elastic.clients.util.ObjectBuilderBase; -import jakarta.json.stream.JsonGenerator; -import java.lang.Long; -import java.lang.String; -import java.util.Objects; -import java.util.function.Function; -import javax.annotation.Nullable; - -// typedef: ilm.explain_lifecycle.LifecycleExplainPhaseExecution - -/** - * - * @see API - * specification - */ -@JsonpDeserializable -public class LifecycleExplainPhaseExecution implements JsonpSerializable { - private final String policy; - - private final long version; - - private final String modifiedDateInMillis; - - // --------------------------------------------------------------------------------------------- - - private LifecycleExplainPhaseExecution(Builder builder) { - - this.policy = ApiTypeHelper.requireNonNull(builder.policy, this, "policy"); - this.version = ApiTypeHelper.requireNonNull(builder.version, this, "version"); - this.modifiedDateInMillis = ApiTypeHelper.requireNonNull(builder.modifiedDateInMillis, this, - "modifiedDateInMillis"); - - } - - public static LifecycleExplainPhaseExecution of( - Function> fn) { - return fn.apply(new Builder()).build(); - } - - /** - * Required - API name: {@code policy} - */ - public final String policy() { - return this.policy; - } - - /** - * Required - API name: {@code version} - */ - public final long version() { - return this.version; - } - - /** - * Required - API name: {@code modified_date_in_millis} - */ - public final String modifiedDateInMillis() { - return this.modifiedDateInMillis; - } - - /** - * 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("policy"); - generator.write(this.policy); - - generator.writeKey("version"); - generator.write(this.version); - - generator.writeKey("modified_date_in_millis"); - generator.write(this.modifiedDateInMillis); - - } - - // --------------------------------------------------------------------------------------------- - - /** - * Builder for {@link LifecycleExplainPhaseExecution}. - */ - - public static class Builder extends ObjectBuilderBase implements ObjectBuilder { - private String policy; - - private Long version; - - private String modifiedDateInMillis; - - /** - * Required - API name: {@code policy} - */ - public final Builder policy(String value) { - this.policy = value; - return this; - } - - /** - * Required - API name: {@code version} - */ - public final Builder version(long value) { - this.version = value; - return this; - } - - /** - * Required - API name: {@code modified_date_in_millis} - */ - public final Builder modifiedDateInMillis(String value) { - this.modifiedDateInMillis = value; - return this; - } - - /** - * Builds a {@link LifecycleExplainPhaseExecution}. - * - * @throws NullPointerException - * if some of the required fields are null. - */ - public LifecycleExplainPhaseExecution build() { - _checkSingleUse(); - - return new LifecycleExplainPhaseExecution(this); - } - } - - // --------------------------------------------------------------------------------------------- - - /** - * Json deserializer for {@link LifecycleExplainPhaseExecution} - */ - public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer - .lazy(Builder::new, LifecycleExplainPhaseExecution::setupLifecycleExplainPhaseExecutionDeserializer); - - protected static void setupLifecycleExplainPhaseExecutionDeserializer( - ObjectDeserializer op) { - - op.add(Builder::policy, JsonpDeserializer.stringDeserializer(), "policy"); - op.add(Builder::version, JsonpDeserializer.longDeserializer(), "version"); - op.add(Builder::modifiedDateInMillis, JsonpDeserializer.stringDeserializer(), "modified_date_in_millis"); - - } - -} diff --git a/java-client/src/main/java/co/elastic/clients/elasticsearch/ilm/explain_lifecycle/LifecycleExplainUnmanaged.java b/java-client/src/main/java/co/elastic/clients/elasticsearch/ilm/explain_lifecycle/LifecycleExplainUnmanaged.java deleted file mode 100644 index 743759f6658f9..0000000000000 --- a/java-client/src/main/java/co/elastic/clients/elasticsearch/ilm/explain_lifecycle/LifecycleExplainUnmanaged.java +++ /dev/null @@ -1,144 +0,0 @@ -/* - * 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. - */ - -//---------------------------------------------------- -// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. -//---------------------------------------------------- - -package co.elastic.clients.elasticsearch.ilm.explain_lifecycle; - -import co.elastic.clients.json.JsonpDeserializable; -import co.elastic.clients.json.JsonpDeserializer; -import co.elastic.clients.json.JsonpMapper; -import co.elastic.clients.json.JsonpSerializable; -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 co.elastic.clients.util.ObjectBuilderBase; -import jakarta.json.stream.JsonGenerator; -import java.lang.String; -import java.util.Objects; -import java.util.function.Function; -import javax.annotation.Nullable; - -// typedef: ilm.explain_lifecycle.LifecycleExplainUnmanaged - -/** - * - * @see API - * specification - */ -@JsonpDeserializable -public class LifecycleExplainUnmanaged implements LifecycleExplainVariant, JsonpSerializable { - private final String index; - - // --------------------------------------------------------------------------------------------- - - private LifecycleExplainUnmanaged(Builder builder) { - - this.index = ApiTypeHelper.requireNonNull(builder.index, this, "index"); - - } - - public static LifecycleExplainUnmanaged of(Function> fn) { - return fn.apply(new Builder()).build(); - } - - /** - * LifecycleExplain variant kind. - */ - @Override - public LifecycleExplain.Kind _lifecycleExplainKind() { - return LifecycleExplain.Kind.False; - } - - /** - * Required - API name: {@code index} - */ - public final String index() { - return this.index; - } - - /** - * 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.write("managed", "false"); - - generator.writeKey("index"); - generator.write(this.index); - - } - - // --------------------------------------------------------------------------------------------- - - /** - * Builder for {@link LifecycleExplainUnmanaged}. - */ - - public static class Builder extends ObjectBuilderBase implements ObjectBuilder { - private String index; - - /** - * Required - API name: {@code index} - */ - public final Builder index(String value) { - this.index = value; - return this; - } - - /** - * Builds a {@link LifecycleExplainUnmanaged}. - * - * @throws NullPointerException - * if some of the required fields are null. - */ - public LifecycleExplainUnmanaged build() { - _checkSingleUse(); - - return new LifecycleExplainUnmanaged(this); - } - } - - // --------------------------------------------------------------------------------------------- - - /** - * Json deserializer for {@link LifecycleExplainUnmanaged} - */ - public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer - .lazy(Builder::new, LifecycleExplainUnmanaged::setupLifecycleExplainUnmanagedDeserializer); - - protected static void setupLifecycleExplainUnmanagedDeserializer( - ObjectDeserializer op) { - - op.add(Builder::index, JsonpDeserializer.stringDeserializer(), "index"); - - op.ignore("managed"); - } - -} diff --git a/java-client/src/main/java/co/elastic/clients/elasticsearch/ilm/explain_lifecycle/LifecycleExplainVariant.java b/java-client/src/main/java/co/elastic/clients/elasticsearch/ilm/explain_lifecycle/LifecycleExplainVariant.java deleted file mode 100644 index 5ce5d487b15b9..0000000000000 --- a/java-client/src/main/java/co/elastic/clients/elasticsearch/ilm/explain_lifecycle/LifecycleExplainVariant.java +++ /dev/null @@ -1,39 +0,0 @@ -/* - * 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. - */ - -//---------------------------------------------------- -// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. -//---------------------------------------------------- - -package co.elastic.clients.elasticsearch.ilm.explain_lifecycle; - -import co.elastic.clients.json.JsonpSerializable; - -/** - * Base interface for {@link LifecycleExplain} variants. - */ -public interface LifecycleExplainVariant extends JsonpSerializable { - - LifecycleExplain.Kind _lifecycleExplainKind(); - - default LifecycleExplain _toLifecycleExplain() { - return new LifecycleExplain(this); - } - -} diff --git a/java-client/src/main/java/co/elastic/clients/elasticsearch/ilm/get_lifecycle/Lifecycle.java b/java-client/src/main/java/co/elastic/clients/elasticsearch/ilm/get_lifecycle/Lifecycle.java deleted file mode 100644 index afd7741519d2f..0000000000000 --- a/java-client/src/main/java/co/elastic/clients/elasticsearch/ilm/get_lifecycle/Lifecycle.java +++ /dev/null @@ -1,189 +0,0 @@ -/* - * 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. - */ - -//---------------------------------------------------- -// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. -//---------------------------------------------------- - -package co.elastic.clients.elasticsearch.ilm.get_lifecycle; - -import co.elastic.clients.elasticsearch.ilm.IlmPolicy; -import co.elastic.clients.json.JsonpDeserializable; -import co.elastic.clients.json.JsonpDeserializer; -import co.elastic.clients.json.JsonpMapper; -import co.elastic.clients.json.JsonpSerializable; -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 co.elastic.clients.util.ObjectBuilderBase; -import jakarta.json.stream.JsonGenerator; -import java.lang.Long; -import java.lang.String; -import java.util.Objects; -import java.util.function.Function; -import javax.annotation.Nullable; - -// typedef: ilm.get_lifecycle.Lifecycle - -/** - * - * @see API - * specification - */ -@JsonpDeserializable -public class Lifecycle implements JsonpSerializable { - private final String modifiedDate; - - private final IlmPolicy policy; - - private final long version; - - // --------------------------------------------------------------------------------------------- - - private Lifecycle(Builder builder) { - - this.modifiedDate = ApiTypeHelper.requireNonNull(builder.modifiedDate, this, "modifiedDate"); - this.policy = ApiTypeHelper.requireNonNull(builder.policy, this, "policy"); - this.version = ApiTypeHelper.requireNonNull(builder.version, this, "version"); - - } - - public static Lifecycle of(Function> fn) { - return fn.apply(new Builder()).build(); - } - - /** - * Required - API name: {@code modified_date} - */ - public final String modifiedDate() { - return this.modifiedDate; - } - - /** - * Required - API name: {@code policy} - */ - public final IlmPolicy policy() { - return this.policy; - } - - /** - * Required - API name: {@code version} - */ - public final long version() { - return this.version; - } - - /** - * 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("modified_date"); - generator.write(this.modifiedDate); - - generator.writeKey("policy"); - this.policy.serialize(generator, mapper); - - generator.writeKey("version"); - generator.write(this.version); - - } - - // --------------------------------------------------------------------------------------------- - - /** - * Builder for {@link Lifecycle}. - */ - - public static class Builder extends ObjectBuilderBase implements ObjectBuilder { - private String modifiedDate; - - private IlmPolicy policy; - - private Long version; - - /** - * Required - API name: {@code modified_date} - */ - public final Builder modifiedDate(String value) { - this.modifiedDate = value; - return this; - } - - /** - * Required - API name: {@code policy} - */ - public final Builder policy(IlmPolicy value) { - this.policy = value; - return this; - } - - /** - * Required - API name: {@code policy} - */ - public final Builder policy(Function> fn) { - return this.policy(fn.apply(new IlmPolicy.Builder()).build()); - } - - /** - * Required - API name: {@code version} - */ - public final Builder version(long value) { - this.version = value; - return this; - } - - /** - * Builds a {@link Lifecycle}. - * - * @throws NullPointerException - * if some of the required fields are null. - */ - public Lifecycle build() { - _checkSingleUse(); - - return new Lifecycle(this); - } - } - - // --------------------------------------------------------------------------------------------- - - /** - * Json deserializer for {@link Lifecycle} - */ - public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer.lazy(Builder::new, - Lifecycle::setupLifecycleDeserializer); - - protected static void setupLifecycleDeserializer(ObjectDeserializer op) { - - op.add(Builder::modifiedDate, JsonpDeserializer.stringDeserializer(), "modified_date"); - op.add(Builder::policy, IlmPolicy._DESERIALIZER, "policy"); - op.add(Builder::version, JsonpDeserializer.longDeserializer(), "version"); - - } - -} diff --git a/java-client/src/main/java/co/elastic/clients/elasticsearch/ilm/move_to_step/StepKey.java b/java-client/src/main/java/co/elastic/clients/elasticsearch/ilm/move_to_step/StepKey.java deleted file mode 100644 index 72598cf59dda5..0000000000000 --- a/java-client/src/main/java/co/elastic/clients/elasticsearch/ilm/move_to_step/StepKey.java +++ /dev/null @@ -1,180 +0,0 @@ -/* - * 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. - */ - -//---------------------------------------------------- -// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. -//---------------------------------------------------- - -package co.elastic.clients.elasticsearch.ilm.move_to_step; - -import co.elastic.clients.json.JsonpDeserializable; -import co.elastic.clients.json.JsonpDeserializer; -import co.elastic.clients.json.JsonpMapper; -import co.elastic.clients.json.JsonpSerializable; -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 co.elastic.clients.util.ObjectBuilderBase; -import jakarta.json.stream.JsonGenerator; -import java.lang.String; -import java.util.Objects; -import java.util.function.Function; -import javax.annotation.Nullable; - -// typedef: ilm.move_to_step.StepKey - -/** - * - * @see API - * specification - */ -@JsonpDeserializable -public class StepKey implements JsonpSerializable { - private final String action; - - private final String name; - - private final String phase; - - // --------------------------------------------------------------------------------------------- - - private StepKey(Builder builder) { - - this.action = ApiTypeHelper.requireNonNull(builder.action, this, "action"); - this.name = ApiTypeHelper.requireNonNull(builder.name, this, "name"); - this.phase = ApiTypeHelper.requireNonNull(builder.phase, this, "phase"); - - } - - public static StepKey of(Function> fn) { - return fn.apply(new Builder()).build(); - } - - /** - * Required - API name: {@code action} - */ - public final String action() { - return this.action; - } - - /** - * Required - API name: {@code name} - */ - public final String name() { - return this.name; - } - - /** - * Required - API name: {@code phase} - */ - public final String phase() { - return this.phase; - } - - /** - * 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("action"); - generator.write(this.action); - - generator.writeKey("name"); - generator.write(this.name); - - generator.writeKey("phase"); - generator.write(this.phase); - - } - - // --------------------------------------------------------------------------------------------- - - /** - * Builder for {@link StepKey}. - */ - - public static class Builder extends ObjectBuilderBase implements ObjectBuilder { - private String action; - - private String name; - - private String phase; - - /** - * Required - API name: {@code action} - */ - public final Builder action(String value) { - this.action = value; - return this; - } - - /** - * Required - API name: {@code name} - */ - public final Builder name(String value) { - this.name = value; - return this; - } - - /** - * Required - API name: {@code phase} - */ - public final Builder phase(String value) { - this.phase = value; - return this; - } - - /** - * Builds a {@link StepKey}. - * - * @throws NullPointerException - * if some of the required fields are null. - */ - public StepKey build() { - _checkSingleUse(); - - return new StepKey(this); - } - } - - // --------------------------------------------------------------------------------------------- - - /** - * Json deserializer for {@link StepKey} - */ - public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer.lazy(Builder::new, - StepKey::setupStepKeyDeserializer); - - protected static void setupStepKeyDeserializer(ObjectDeserializer op) { - - op.add(Builder::action, JsonpDeserializer.stringDeserializer(), "action"); - op.add(Builder::name, JsonpDeserializer.stringDeserializer(), "name"); - op.add(Builder::phase, JsonpDeserializer.stringDeserializer(), "phase"); - - } - -}