All Downloads are FREE. Search and download functionalities are using the official Maven repository.

co.elastic.clients.elasticsearch.ilm.MigrateToDataTiersResponse Maven / Gradle / Ivy

There is a newer version: 8.17.0
Show newest version
/*
 * 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.WithJsonObjectBuilderBase;
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.migrate_to_data_tiers.Response

/**
 *
 * @see API
 *      specification
 */
@JsonpDeserializable
public class MigrateToDataTiersResponse implements JsonpSerializable {
	private final boolean dryRun;

	private final String removedLegacyTemplate;

	private final List migratedIlmPolicies;

	private final List migratedIndices;

	private final List migratedLegacyTemplates;

	private final List migratedComposableTemplates;

	private final List migratedComponentTemplates;

	// ---------------------------------------------------------------------------------------------

	private MigrateToDataTiersResponse(Builder builder) {

		this.dryRun = ApiTypeHelper.requireNonNull(builder.dryRun, this, "dryRun");
		this.removedLegacyTemplate = ApiTypeHelper.requireNonNull(builder.removedLegacyTemplate, this,
				"removedLegacyTemplate");
		this.migratedIlmPolicies = ApiTypeHelper.unmodifiableRequired(builder.migratedIlmPolicies, this,
				"migratedIlmPolicies");
		this.migratedIndices = ApiTypeHelper.unmodifiableRequired(builder.migratedIndices, this, "migratedIndices");
		this.migratedLegacyTemplates = ApiTypeHelper.unmodifiableRequired(builder.migratedLegacyTemplates, this,
				"migratedLegacyTemplates");
		this.migratedComposableTemplates = ApiTypeHelper.unmodifiableRequired(builder.migratedComposableTemplates, this,
				"migratedComposableTemplates");
		this.migratedComponentTemplates = ApiTypeHelper.unmodifiableRequired(builder.migratedComponentTemplates, this,
				"migratedComponentTemplates");

	}

	public static MigrateToDataTiersResponse of(Function> fn) {
		return fn.apply(new Builder()).build();
	}

	/**
	 * Required - API name: {@code dry_run}
	 */
	public final boolean dryRun() {
		return this.dryRun;
	}

	/**
	 * Required - API name: {@code removed_legacy_template}
	 */
	public final String removedLegacyTemplate() {
		return this.removedLegacyTemplate;
	}

	/**
	 * Required - API name: {@code migrated_ilm_policies}
	 */
	public final List migratedIlmPolicies() {
		return this.migratedIlmPolicies;
	}

	/**
	 * Required - API name: {@code migrated_indices}
	 */
	public final List migratedIndices() {
		return this.migratedIndices;
	}

	/**
	 * Required - API name: {@code migrated_legacy_templates}
	 */
	public final List migratedLegacyTemplates() {
		return this.migratedLegacyTemplates;
	}

	/**
	 * Required - API name: {@code migrated_composable_templates}
	 */
	public final List migratedComposableTemplates() {
		return this.migratedComposableTemplates;
	}

	/**
	 * Required - API name: {@code migrated_component_templates}
	 */
	public final List migratedComponentTemplates() {
		return this.migratedComponentTemplates;
	}

	/**
	 * 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("dry_run");
		generator.write(this.dryRun);

		generator.writeKey("removed_legacy_template");
		generator.write(this.removedLegacyTemplate);

		if (ApiTypeHelper.isDefined(this.migratedIlmPolicies)) {
			generator.writeKey("migrated_ilm_policies");
			generator.writeStartArray();
			for (String item0 : this.migratedIlmPolicies) {
				generator.write(item0);

			}
			generator.writeEnd();

		}
		if (ApiTypeHelper.isDefined(this.migratedIndices)) {
			generator.writeKey("migrated_indices");
			generator.writeStartArray();
			for (String item0 : this.migratedIndices) {
				generator.write(item0);

			}
			generator.writeEnd();

		}
		if (ApiTypeHelper.isDefined(this.migratedLegacyTemplates)) {
			generator.writeKey("migrated_legacy_templates");
			generator.writeStartArray();
			for (String item0 : this.migratedLegacyTemplates) {
				generator.write(item0);

			}
			generator.writeEnd();

		}
		if (ApiTypeHelper.isDefined(this.migratedComposableTemplates)) {
			generator.writeKey("migrated_composable_templates");
			generator.writeStartArray();
			for (String item0 : this.migratedComposableTemplates) {
				generator.write(item0);

			}
			generator.writeEnd();

		}
		if (ApiTypeHelper.isDefined(this.migratedComponentTemplates)) {
			generator.writeKey("migrated_component_templates");
			generator.writeStartArray();
			for (String item0 : this.migratedComponentTemplates) {
				generator.write(item0);

			}
			generator.writeEnd();

		}

	}

	// ---------------------------------------------------------------------------------------------

	/**
	 * Builder for {@link MigrateToDataTiersResponse}.
	 */

	public static class Builder extends WithJsonObjectBuilderBase
			implements
				ObjectBuilder {
		private Boolean dryRun;

		private String removedLegacyTemplate;

		private List migratedIlmPolicies;

		private List migratedIndices;

		private List migratedLegacyTemplates;

		private List migratedComposableTemplates;

		private List migratedComponentTemplates;

		/**
		 * Required - API name: {@code dry_run}
		 */
		public final Builder dryRun(boolean value) {
			this.dryRun = value;
			return this;
		}

		/**
		 * Required - API name: {@code removed_legacy_template}
		 */
		public final Builder removedLegacyTemplate(String value) {
			this.removedLegacyTemplate = value;
			return this;
		}

		/**
		 * Required - API name: {@code migrated_ilm_policies}
		 * 

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

* Adds one or more values to migratedIlmPolicies. */ public final Builder migratedIlmPolicies(String value, String... values) { this.migratedIlmPolicies = _listAdd(this.migratedIlmPolicies, value, values); return this; } /** * Required - API name: {@code migrated_indices} *

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

* Adds one or more values to migratedIndices. */ public final Builder migratedIndices(String value, String... values) { this.migratedIndices = _listAdd(this.migratedIndices, value, values); return this; } /** * Required - API name: {@code migrated_legacy_templates} *

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

* Adds one or more values to migratedLegacyTemplates. */ public final Builder migratedLegacyTemplates(String value, String... values) { this.migratedLegacyTemplates = _listAdd(this.migratedLegacyTemplates, value, values); return this; } /** * Required - API name: {@code migrated_composable_templates} *

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

* Adds one or more values to migratedComposableTemplates. */ public final Builder migratedComposableTemplates(String value, String... values) { this.migratedComposableTemplates = _listAdd(this.migratedComposableTemplates, value, values); return this; } /** * Required - API name: {@code migrated_component_templates} *

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

* Adds one or more values to migratedComponentTemplates. */ public final Builder migratedComponentTemplates(String value, String... values) { this.migratedComponentTemplates = _listAdd(this.migratedComponentTemplates, value, values); return this; } @Override protected Builder self() { return this; } /** * Builds a {@link MigrateToDataTiersResponse}. * * @throws NullPointerException * if some of the required fields are null. */ public MigrateToDataTiersResponse build() { _checkSingleUse(); return new MigrateToDataTiersResponse(this); } } // --------------------------------------------------------------------------------------------- /** * Json deserializer for {@link MigrateToDataTiersResponse} */ public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer .lazy(Builder::new, MigrateToDataTiersResponse::setupMigrateToDataTiersResponseDeserializer); protected static void setupMigrateToDataTiersResponseDeserializer( ObjectDeserializer op) { op.add(Builder::dryRun, JsonpDeserializer.booleanDeserializer(), "dry_run"); op.add(Builder::removedLegacyTemplate, JsonpDeserializer.stringDeserializer(), "removed_legacy_template"); op.add(Builder::migratedIlmPolicies, JsonpDeserializer.arrayDeserializer(JsonpDeserializer.stringDeserializer()), "migrated_ilm_policies"); op.add(Builder::migratedIndices, JsonpDeserializer.arrayDeserializer(JsonpDeserializer.stringDeserializer()), "migrated_indices"); op.add(Builder::migratedLegacyTemplates, JsonpDeserializer.arrayDeserializer(JsonpDeserializer.stringDeserializer()), "migrated_legacy_templates"); op.add(Builder::migratedComposableTemplates, JsonpDeserializer.arrayDeserializer(JsonpDeserializer.stringDeserializer()), "migrated_composable_templates"); op.add(Builder::migratedComponentTemplates, JsonpDeserializer.arrayDeserializer(JsonpDeserializer.stringDeserializer()), "migrated_component_templates"); } }





© 2015 - 2025 Weber Informatics LLC | Privacy Policy