diff --git a/UPGRADING.md b/UPGRADING.md index 15925c7aab..8316532651 100644 --- a/UPGRADING.md +++ b/UPGRADING.md @@ -96,3 +96,20 @@ After: - The `DataStream` class has been renamed to `IndexTemplateDataStreamConfiguration`, this affects: - `PutIndexTemplateRequest`'s `dataStream` field. - `SimulateIndexTemplateRequest`'s `dataStream` field. + +### Translog +- The `durability` property now accepts a `TranslogDurability` enum instead of a `String`. + +### IndexSettingsMapping +- The mapping limit fields now have specialized types instead of a generic `IndexSettingsMappingLimit` type: + - `depth` is now of type `IndexSettingsMappingLimitDepth`. + - `fieldNameLength` is now of type `IndexSettingsMappingLimitFieldNameLength`. + - `nestedFields` is now of type `IndexSettingsMappingLimitNestedFields`. + - `nestedObjects` is now of type `IndexSettingsMappingLimitNestedObjects`. + - `totalFields` is now of type `IndexSettingsMappingLimitTotalFields`. + +### IndexSettings +- The `creationDate` property is now of type `Long` instead of `String`. +- The `translogDurability` property now accepts a `TranslogDurability` enum instead of a `String`. +- The `numberOfReplicas` property is now of type `Integer` instead of `String`. +- The `numberOfShards` property is now of type `Integer` instead of `String`. \ No newline at end of file diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/DFIIndependenceMeasure.java b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/DFIIndependenceMeasure.java new file mode 100644 index 0000000000..9fdbe62853 --- /dev/null +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/DFIIndependenceMeasure.java @@ -0,0 +1,67 @@ +/* + * SPDX-License-Identifier: Apache-2.0 + * + * The OpenSearch Contributors require contributions made to + * this file be licensed under the Apache-2.0 license or a + * compatible open source license. + */ + +/* + * 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. + */ + +/* + * Modifications Copyright OpenSearch Contributors. See + * GitHub history for details. + */ + +//---------------------------------------------------- +// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. +//---------------------------------------------------- + +package org.opensearch.client.opensearch._types; + +import javax.annotation.Generated; +import org.opensearch.client.json.JsonEnum; +import org.opensearch.client.json.JsonpDeserializable; + +// typedef: _types.DFIIndependenceMeasure + +@JsonpDeserializable +@Generated("org.opensearch.client.codegen.CodeGenerator") +public enum DFIIndependenceMeasure implements JsonEnum { + Chisquared("chisquared"), + + Saturated("saturated"), + + Standardized("standardized"); + + private final String jsonValue; + + DFIIndependenceMeasure(String jsonValue) { + this.jsonValue = jsonValue; + } + + public String jsonValue() { + return this.jsonValue; + } + + public static final JsonEnum.Deserializer _DESERIALIZER = new JsonEnum.Deserializer<>( + DFIIndependenceMeasure.values() + ); +} diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/DFRAfterEffect.java b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/DFRAfterEffect.java new file mode 100644 index 0000000000..a65e6efe72 --- /dev/null +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/DFRAfterEffect.java @@ -0,0 +1,65 @@ +/* + * SPDX-License-Identifier: Apache-2.0 + * + * The OpenSearch Contributors require contributions made to + * this file be licensed under the Apache-2.0 license or a + * compatible open source license. + */ + +/* + * 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. + */ + +/* + * Modifications Copyright OpenSearch Contributors. See + * GitHub history for details. + */ + +//---------------------------------------------------- +// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. +//---------------------------------------------------- + +package org.opensearch.client.opensearch._types; + +import javax.annotation.Generated; +import org.opensearch.client.json.JsonEnum; +import org.opensearch.client.json.JsonpDeserializable; + +// typedef: _types.DFRAfterEffect + +@JsonpDeserializable +@Generated("org.opensearch.client.codegen.CodeGenerator") +public enum DFRAfterEffect implements JsonEnum { + B("b"), + + L("l"), + + No("no"); + + private final String jsonValue; + + DFRAfterEffect(String jsonValue) { + this.jsonValue = jsonValue; + } + + public String jsonValue() { + return this.jsonValue; + } + + public static final JsonEnum.Deserializer _DESERIALIZER = new JsonEnum.Deserializer<>(DFRAfterEffect.values()); +} diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/DFRBasicModel.java b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/DFRBasicModel.java new file mode 100644 index 0000000000..2c1fbeab4e --- /dev/null +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/DFRBasicModel.java @@ -0,0 +1,73 @@ +/* + * SPDX-License-Identifier: Apache-2.0 + * + * The OpenSearch Contributors require contributions made to + * this file be licensed under the Apache-2.0 license or a + * compatible open source license. + */ + +/* + * 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. + */ + +/* + * Modifications Copyright OpenSearch Contributors. See + * GitHub history for details. + */ + +//---------------------------------------------------- +// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. +//---------------------------------------------------- + +package org.opensearch.client.opensearch._types; + +import javax.annotation.Generated; +import org.opensearch.client.json.JsonEnum; +import org.opensearch.client.json.JsonpDeserializable; + +// typedef: _types.DFRBasicModel + +@JsonpDeserializable +@Generated("org.opensearch.client.codegen.CodeGenerator") +public enum DFRBasicModel implements JsonEnum { + Be("be"), + + D("d"), + + G("g"), + + If("if"), + + In("in"), + + Ine("ine"), + + P("p"); + + private final String jsonValue; + + DFRBasicModel(String jsonValue) { + this.jsonValue = jsonValue; + } + + public String jsonValue() { + return this.jsonValue; + } + + public static final JsonEnum.Deserializer _DESERIALIZER = new JsonEnum.Deserializer<>(DFRBasicModel.values()); +} diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/IBDistribution.java b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/IBDistribution.java new file mode 100644 index 0000000000..e4812a8fdf --- /dev/null +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/IBDistribution.java @@ -0,0 +1,63 @@ +/* + * SPDX-License-Identifier: Apache-2.0 + * + * The OpenSearch Contributors require contributions made to + * this file be licensed under the Apache-2.0 license or a + * compatible open source license. + */ + +/* + * 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. + */ + +/* + * Modifications Copyright OpenSearch Contributors. See + * GitHub history for details. + */ + +//---------------------------------------------------- +// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. +//---------------------------------------------------- + +package org.opensearch.client.opensearch._types; + +import javax.annotation.Generated; +import org.opensearch.client.json.JsonEnum; +import org.opensearch.client.json.JsonpDeserializable; + +// typedef: _types.IBDistribution + +@JsonpDeserializable +@Generated("org.opensearch.client.codegen.CodeGenerator") +public enum IBDistribution implements JsonEnum { + Ll("ll"), + + Spl("spl"); + + private final String jsonValue; + + IBDistribution(String jsonValue) { + this.jsonValue = jsonValue; + } + + public String jsonValue() { + return this.jsonValue; + } + + public static final JsonEnum.Deserializer _DESERIALIZER = new JsonEnum.Deserializer<>(IBDistribution.values()); +} diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/IBLambda.java b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/IBLambda.java new file mode 100644 index 0000000000..eb9a16167e --- /dev/null +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/IBLambda.java @@ -0,0 +1,63 @@ +/* + * SPDX-License-Identifier: Apache-2.0 + * + * The OpenSearch Contributors require contributions made to + * this file be licensed under the Apache-2.0 license or a + * compatible open source license. + */ + +/* + * 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. + */ + +/* + * Modifications Copyright OpenSearch Contributors. See + * GitHub history for details. + */ + +//---------------------------------------------------- +// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. +//---------------------------------------------------- + +package org.opensearch.client.opensearch._types; + +import javax.annotation.Generated; +import org.opensearch.client.json.JsonEnum; +import org.opensearch.client.json.JsonpDeserializable; + +// typedef: _types.IBLambda + +@JsonpDeserializable +@Generated("org.opensearch.client.codegen.CodeGenerator") +public enum IBLambda implements JsonEnum { + Df("df"), + + Ttf("ttf"); + + private final String jsonValue; + + IBLambda(String jsonValue) { + this.jsonValue = jsonValue; + } + + public String jsonValue() { + return this.jsonValue; + } + + public static final JsonEnum.Deserializer _DESERIALIZER = new JsonEnum.Deserializer<>(IBLambda.values()); +} diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/TermFrequencyNormalization.java b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/TermFrequencyNormalization.java new file mode 100644 index 0000000000..09591f4cd9 --- /dev/null +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/TermFrequencyNormalization.java @@ -0,0 +1,71 @@ +/* + * SPDX-License-Identifier: Apache-2.0 + * + * The OpenSearch Contributors require contributions made to + * this file be licensed under the Apache-2.0 license or a + * compatible open source license. + */ + +/* + * 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. + */ + +/* + * Modifications Copyright OpenSearch Contributors. See + * GitHub history for details. + */ + +//---------------------------------------------------- +// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. +//---------------------------------------------------- + +package org.opensearch.client.opensearch._types; + +import javax.annotation.Generated; +import org.opensearch.client.json.JsonEnum; +import org.opensearch.client.json.JsonpDeserializable; + +// typedef: _types.TermFrequencyNormalization + +@JsonpDeserializable +@Generated("org.opensearch.client.codegen.CodeGenerator") +public enum TermFrequencyNormalization implements JsonEnum { + H1("h1"), + + H2("h2"), + + H3("h3"), + + No("no"), + + Z("z"); + + private final String jsonValue; + + TermFrequencyNormalization(String jsonValue) { + this.jsonValue = jsonValue; + } + + public String jsonValue() { + return this.jsonValue; + } + + public static final JsonEnum.Deserializer _DESERIALIZER = new JsonEnum.Deserializer<>( + TermFrequencyNormalization.values() + ); +} diff --git a/java-client/src/main/java/org/opensearch/client/opensearch/indices/IndexCheckOnStartup.java b/java-client/src/generated/java/org/opensearch/client/opensearch/indices/IndexCheckOnStartup.java similarity index 84% rename from java-client/src/main/java/org/opensearch/client/opensearch/indices/IndexCheckOnStartup.java rename to java-client/src/generated/java/org/opensearch/client/opensearch/indices/IndexCheckOnStartup.java index 9bb217fad3..b0dc86e280 100644 --- a/java-client/src/main/java/org/opensearch/client/opensearch/indices/IndexCheckOnStartup.java +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/indices/IndexCheckOnStartup.java @@ -30,20 +30,26 @@ * GitHub history for details. */ +//---------------------------------------------------- +// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. +//---------------------------------------------------- + package org.opensearch.client.opensearch.indices; +import javax.annotation.Generated; import org.opensearch.client.json.JsonEnum; import org.opensearch.client.json.JsonpDeserializable; +// typedef: indices.IndexCheckOnStartup + @JsonpDeserializable +@Generated("org.opensearch.client.codegen.CodeGenerator") public enum IndexCheckOnStartup implements JsonEnum { - False("false"), - Checksum("checksum"), - True("true"), + False("false"), - ; + True("true"); private final String jsonValue; diff --git a/java-client/src/main/java/org/opensearch/client/opensearch/indices/IndexRouting.java b/java-client/src/generated/java/org/opensearch/client/opensearch/indices/IndexRouting.java similarity index 69% rename from java-client/src/main/java/org/opensearch/client/opensearch/indices/IndexRouting.java rename to java-client/src/generated/java/org/opensearch/client/opensearch/indices/IndexRouting.java index 45adedb410..b603cb62b1 100644 --- a/java-client/src/main/java/org/opensearch/client/opensearch/indices/IndexRouting.java +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/indices/IndexRouting.java @@ -30,10 +30,17 @@ * GitHub history for details. */ +//---------------------------------------------------- +// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. +//---------------------------------------------------- + package org.opensearch.client.opensearch.indices; import jakarta.json.stream.JsonGenerator; +import java.util.Objects; import java.util.function.Function; +import javax.annotation.Generated; +import javax.annotation.Nonnull; import javax.annotation.Nullable; import org.opensearch.client.json.JsonpDeserializable; import org.opensearch.client.json.JsonpDeserializer; @@ -41,13 +48,17 @@ import org.opensearch.client.json.ObjectBuilderDeserializer; import org.opensearch.client.json.ObjectDeserializer; import org.opensearch.client.json.PlainJsonSerializable; +import org.opensearch.client.util.CopyableBuilder; import org.opensearch.client.util.ObjectBuilder; import org.opensearch.client.util.ObjectBuilderBase; +import org.opensearch.client.util.ToCopyableBuilder; -// typedef: indices._types.IndexRouting +// typedef: indices.IndexRouting @JsonpDeserializable -public class IndexRouting implements PlainJsonSerializable { +@Generated("org.opensearch.client.codegen.CodeGenerator") +public class IndexRouting implements PlainJsonSerializable, ToCopyableBuilder { + @Nullable private final IndexRoutingAllocation allocation; @@ -57,13 +68,11 @@ public class IndexRouting implements PlainJsonSerializable { // --------------------------------------------------------------------------------------------- private IndexRouting(Builder builder) { - this.allocation = builder.allocation; this.rebalance = builder.rebalance; - } - public static IndexRouting of(Function> fn) { + public static IndexRouting of(Function> fn) { return fn.apply(new Builder()).build(); } @@ -86,6 +95,7 @@ public final IndexRoutingRebalance rebalance() { /** * Serialize this object to JSON. */ + @Override public void serialize(JsonGenerator generator, JsonpMapper mapper) { generator.writeStartObject(); serializeInternal(generator, mapper); @@ -93,36 +103,61 @@ public void serialize(JsonGenerator generator, JsonpMapper mapper) { } protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { - if (this.allocation != null) { generator.writeKey("allocation"); this.allocation.serialize(generator, mapper); - } + if (this.rebalance != null) { generator.writeKey("rebalance"); this.rebalance.serialize(generator, mapper); - } - } // --------------------------------------------------------------------------------------------- + @Override + @Nonnull + public Builder toBuilder() { + return new Builder(this); + } + + @Nonnull + public static Builder builder() { + return new Builder(); + } + /** * Builder for {@link IndexRouting}. */ - - public static class Builder extends ObjectBuilderBase implements ObjectBuilder { + public static class Builder extends ObjectBuilderBase implements CopyableBuilder { @Nullable private IndexRoutingAllocation allocation; - @Nullable private IndexRoutingRebalance rebalance; + public Builder() {} + + private Builder(IndexRouting o) { + this.allocation = o.allocation; + this.rebalance = o.rebalance; + } + + private Builder(Builder o) { + this.allocation = o.allocation; + this.rebalance = o.rebalance; + } + + @Override + @Nonnull + public Builder copy() { + return new Builder(this); + } + /** * API name: {@code allocation} */ + @Nonnull public final Builder allocation(@Nullable IndexRoutingAllocation value) { this.allocation = value; return this; @@ -131,13 +166,15 @@ public final Builder allocation(@Nullable IndexRoutingAllocation value) { /** * API name: {@code allocation} */ + @Nonnull public final Builder allocation(Function> fn) { - return this.allocation(fn.apply(new IndexRoutingAllocation.Builder()).build()); + return allocation(fn.apply(new IndexRoutingAllocation.Builder()).build()); } /** * API name: {@code rebalance} */ + @Nonnull public final Builder rebalance(@Nullable IndexRoutingRebalance value) { this.rebalance = value; return this; @@ -146,16 +183,18 @@ public final Builder rebalance(@Nullable IndexRoutingRebalance value) { /** * API name: {@code rebalance} */ + @Nonnull public final Builder rebalance(Function> fn) { - return this.rebalance(fn.apply(new IndexRoutingRebalance.Builder()).build()); + return rebalance(fn.apply(new IndexRoutingRebalance.Builder()).build()); } /** * Builds a {@link IndexRouting}. * - * @throws NullPointerException - * if some of the required fields are null. + * @throws NullPointerException if some of the required fields are null. */ + @Override + @Nonnull public IndexRouting build() { _checkSingleUse(); @@ -174,10 +213,23 @@ public IndexRouting build() { ); protected static void setupIndexRoutingDeserializer(ObjectDeserializer op) { - op.add(Builder::allocation, IndexRoutingAllocation._DESERIALIZER, "allocation"); op.add(Builder::rebalance, IndexRoutingRebalance._DESERIALIZER, "rebalance"); + } + @Override + public int hashCode() { + int result = 17; + result = 31 * result + Objects.hashCode(this.allocation); + result = 31 * result + Objects.hashCode(this.rebalance); + return result; } + @Override + public boolean equals(Object o) { + if (this == o) return true; + if (o == null || this.getClass() != o.getClass()) return false; + IndexRouting other = (IndexRouting) o; + return Objects.equals(this.allocation, other.allocation) && Objects.equals(this.rebalance, other.rebalance); + } } diff --git a/java-client/src/main/java/org/opensearch/client/opensearch/indices/IndexRoutingAllocation.java b/java-client/src/generated/java/org/opensearch/client/opensearch/indices/IndexRoutingAllocation.java similarity index 63% rename from java-client/src/main/java/org/opensearch/client/opensearch/indices/IndexRoutingAllocation.java rename to java-client/src/generated/java/org/opensearch/client/opensearch/indices/IndexRoutingAllocation.java index 2dedd025e6..4691838932 100644 --- a/java-client/src/main/java/org/opensearch/client/opensearch/indices/IndexRoutingAllocation.java +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/indices/IndexRoutingAllocation.java @@ -30,10 +30,17 @@ * GitHub history for details. */ +//---------------------------------------------------- +// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. +//---------------------------------------------------- + package org.opensearch.client.opensearch.indices; import jakarta.json.stream.JsonGenerator; +import java.util.Objects; import java.util.function.Function; +import javax.annotation.Generated; +import javax.annotation.Nonnull; import javax.annotation.Nullable; import org.opensearch.client.json.JsonpDeserializable; import org.opensearch.client.json.JsonpDeserializer; @@ -41,13 +48,23 @@ import org.opensearch.client.json.ObjectBuilderDeserializer; import org.opensearch.client.json.ObjectDeserializer; import org.opensearch.client.json.PlainJsonSerializable; +import org.opensearch.client.util.CopyableBuilder; import org.opensearch.client.util.ObjectBuilder; import org.opensearch.client.util.ObjectBuilderBase; +import org.opensearch.client.util.ToCopyableBuilder; -// typedef: indices._types.IndexRoutingAllocation +// typedef: indices.IndexRoutingAllocation @JsonpDeserializable -public class IndexRoutingAllocation implements PlainJsonSerializable { +@Generated("org.opensearch.client.codegen.CodeGenerator") +public class IndexRoutingAllocation + implements + PlainJsonSerializable, + ToCopyableBuilder { + + @Nullable + private final IndexRoutingAllocationDisk disk; + @Nullable private final IndexRoutingAllocationOptions enable; @@ -58,23 +75,30 @@ public class IndexRoutingAllocation implements PlainJsonSerializable { private final IndexRoutingAllocationInitialRecovery initialRecovery; @Nullable - private final IndexRoutingAllocationDisk disk; + private final Integer totalShardsPerNode; // --------------------------------------------------------------------------------------------- private IndexRoutingAllocation(Builder builder) { - + this.disk = builder.disk; this.enable = builder.enable; this.include = builder.include; this.initialRecovery = builder.initialRecovery; - this.disk = builder.disk; - + this.totalShardsPerNode = builder.totalShardsPerNode; } - public static IndexRoutingAllocation of(Function> fn) { + public static IndexRoutingAllocation of(Function> fn) { return fn.apply(new Builder()).build(); } + /** + * API name: {@code disk} + */ + @Nullable + public final IndexRoutingAllocationDisk disk() { + return this.disk; + } + /** * API name: {@code enable} */ @@ -100,16 +124,17 @@ public final IndexRoutingAllocationInitialRecovery initialRecovery() { } /** - * API name: {@code disk} + * API name: {@code total_shards_per_node} */ @Nullable - public final IndexRoutingAllocationDisk disk() { - return this.disk; + public final Integer totalShardsPerNode() { + return this.totalShardsPerNode; } /** * Serialize this object to JSON. */ + @Override public void serialize(JsonGenerator generator, JsonpMapper mapper) { generator.writeStartObject(); serializeInternal(generator, mapper); @@ -117,51 +142,105 @@ public void serialize(JsonGenerator generator, JsonpMapper mapper) { } protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { + if (this.disk != null) { + generator.writeKey("disk"); + this.disk.serialize(generator, mapper); + } if (this.enable != null) { generator.writeKey("enable"); this.enable.serialize(generator, mapper); } + if (this.include != null) { generator.writeKey("include"); this.include.serialize(generator, mapper); - } + if (this.initialRecovery != null) { generator.writeKey("initial_recovery"); this.initialRecovery.serialize(generator, mapper); - } - if (this.disk != null) { - generator.writeKey("disk"); - this.disk.serialize(generator, mapper); + if (this.totalShardsPerNode != null) { + generator.writeKey("total_shards_per_node"); + generator.write(this.totalShardsPerNode); } - } // --------------------------------------------------------------------------------------------- + @Override + @Nonnull + public Builder toBuilder() { + return new Builder(this); + } + + @Nonnull + public static Builder builder() { + return new Builder(); + } + /** * Builder for {@link IndexRoutingAllocation}. */ - - public static class Builder extends ObjectBuilderBase implements ObjectBuilder { + public static class Builder extends ObjectBuilderBase implements CopyableBuilder { + @Nullable + private IndexRoutingAllocationDisk disk; @Nullable private IndexRoutingAllocationOptions enable; - @Nullable private IndexRoutingAllocationInclude include; - @Nullable private IndexRoutingAllocationInitialRecovery initialRecovery; - @Nullable - private IndexRoutingAllocationDisk disk; + private Integer totalShardsPerNode; + + public Builder() {} + + private Builder(IndexRoutingAllocation o) { + this.disk = o.disk; + this.enable = o.enable; + this.include = o.include; + this.initialRecovery = o.initialRecovery; + this.totalShardsPerNode = o.totalShardsPerNode; + } + + private Builder(Builder o) { + this.disk = o.disk; + this.enable = o.enable; + this.include = o.include; + this.initialRecovery = o.initialRecovery; + this.totalShardsPerNode = o.totalShardsPerNode; + } + + @Override + @Nonnull + public Builder copy() { + return new Builder(this); + } + + /** + * API name: {@code disk} + */ + @Nonnull + public final Builder disk(@Nullable IndexRoutingAllocationDisk value) { + this.disk = value; + return this; + } + + /** + * API name: {@code disk} + */ + @Nonnull + public final Builder disk(Function> fn) { + return disk(fn.apply(new IndexRoutingAllocationDisk.Builder()).build()); + } /** * API name: {@code enable} */ + @Nonnull public final Builder enable(@Nullable IndexRoutingAllocationOptions value) { this.enable = value; return this; @@ -170,6 +249,7 @@ public final Builder enable(@Nullable IndexRoutingAllocationOptions value) { /** * API name: {@code include} */ + @Nonnull public final Builder include(@Nullable IndexRoutingAllocationInclude value) { this.include = value; return this; @@ -178,13 +258,15 @@ public final Builder include(@Nullable IndexRoutingAllocationInclude value) { /** * API name: {@code include} */ + @Nonnull public final Builder include(Function> fn) { - return this.include(fn.apply(new IndexRoutingAllocationInclude.Builder()).build()); + return include(fn.apply(new IndexRoutingAllocationInclude.Builder()).build()); } /** * API name: {@code initial_recovery} */ + @Nonnull public final Builder initialRecovery(@Nullable IndexRoutingAllocationInitialRecovery value) { this.initialRecovery = value; return this; @@ -193,33 +275,29 @@ public final Builder initialRecovery(@Nullable IndexRoutingAllocationInitialReco /** * API name: {@code initial_recovery} */ + @Nonnull public final Builder initialRecovery( Function> fn ) { - return this.initialRecovery(fn.apply(new IndexRoutingAllocationInitialRecovery.Builder()).build()); + return initialRecovery(fn.apply(new IndexRoutingAllocationInitialRecovery.Builder()).build()); } /** - * API name: {@code disk} + * API name: {@code total_shards_per_node} */ - public final Builder disk(@Nullable IndexRoutingAllocationDisk value) { - this.disk = value; + @Nonnull + public final Builder totalShardsPerNode(@Nullable Integer value) { + this.totalShardsPerNode = value; return this; } - /** - * API name: {@code disk} - */ - public final Builder disk(Function> fn) { - return this.disk(fn.apply(new IndexRoutingAllocationDisk.Builder()).build()); - } - /** * Builds a {@link IndexRoutingAllocation}. * - * @throws NullPointerException - * if some of the required fields are null. + * @throws NullPointerException if some of the required fields are null. */ + @Override + @Nonnull public IndexRoutingAllocation build() { _checkSingleUse(); @@ -238,12 +316,33 @@ public IndexRoutingAllocation build() { ); protected static void setupIndexRoutingAllocationDeserializer(ObjectDeserializer op) { - + op.add(Builder::disk, IndexRoutingAllocationDisk._DESERIALIZER, "disk"); op.add(Builder::enable, IndexRoutingAllocationOptions._DESERIALIZER, "enable"); op.add(Builder::include, IndexRoutingAllocationInclude._DESERIALIZER, "include"); op.add(Builder::initialRecovery, IndexRoutingAllocationInitialRecovery._DESERIALIZER, "initial_recovery"); - op.add(Builder::disk, IndexRoutingAllocationDisk._DESERIALIZER, "disk"); + op.add(Builder::totalShardsPerNode, JsonpDeserializer.integerDeserializer(), "total_shards_per_node"); + } + @Override + public int hashCode() { + int result = 17; + result = 31 * result + Objects.hashCode(this.disk); + result = 31 * result + Objects.hashCode(this.enable); + result = 31 * result + Objects.hashCode(this.include); + result = 31 * result + Objects.hashCode(this.initialRecovery); + result = 31 * result + Objects.hashCode(this.totalShardsPerNode); + return result; } + @Override + public boolean equals(Object o) { + if (this == o) return true; + if (o == null || this.getClass() != o.getClass()) return false; + IndexRoutingAllocation other = (IndexRoutingAllocation) o; + return Objects.equals(this.disk, other.disk) + && Objects.equals(this.enable, other.enable) + && Objects.equals(this.include, other.include) + && Objects.equals(this.initialRecovery, other.initialRecovery) + && Objects.equals(this.totalShardsPerNode, other.totalShardsPerNode); + } } diff --git a/java-client/src/main/java/org/opensearch/client/opensearch/indices/IndexRoutingAllocationDisk.java b/java-client/src/generated/java/org/opensearch/client/opensearch/indices/IndexRoutingAllocationDisk.java similarity index 66% rename from java-client/src/main/java/org/opensearch/client/opensearch/indices/IndexRoutingAllocationDisk.java rename to java-client/src/generated/java/org/opensearch/client/opensearch/indices/IndexRoutingAllocationDisk.java index 7a90edd043..1d0da04e90 100644 --- a/java-client/src/main/java/org/opensearch/client/opensearch/indices/IndexRoutingAllocationDisk.java +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/indices/IndexRoutingAllocationDisk.java @@ -30,10 +30,17 @@ * GitHub history for details. */ +//---------------------------------------------------- +// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. +//---------------------------------------------------- + package org.opensearch.client.opensearch.indices; import jakarta.json.stream.JsonGenerator; +import java.util.Objects; import java.util.function.Function; +import javax.annotation.Generated; +import javax.annotation.Nonnull; import javax.annotation.Nullable; import org.opensearch.client.json.JsonpDeserializable; import org.opensearch.client.json.JsonpDeserializer; @@ -41,25 +48,32 @@ import org.opensearch.client.json.ObjectBuilderDeserializer; import org.opensearch.client.json.ObjectDeserializer; import org.opensearch.client.json.PlainJsonSerializable; +import org.opensearch.client.util.CopyableBuilder; import org.opensearch.client.util.ObjectBuilder; import org.opensearch.client.util.ObjectBuilderBase; +import org.opensearch.client.util.ToCopyableBuilder; -// typedef: indices._types.IndexRoutingAllocationDisk +// typedef: indices.IndexRoutingAllocationDisk @JsonpDeserializable -public class IndexRoutingAllocationDisk implements PlainJsonSerializable { +@Generated("org.opensearch.client.codegen.CodeGenerator") +public class IndexRoutingAllocationDisk + implements + PlainJsonSerializable, + ToCopyableBuilder { + @Nullable private final Boolean thresholdEnabled; // --------------------------------------------------------------------------------------------- private IndexRoutingAllocationDisk(Builder builder) { - this.thresholdEnabled = builder.thresholdEnabled; - } - public static IndexRoutingAllocationDisk of(Function> fn) { + public static IndexRoutingAllocationDisk of( + Function> fn + ) { return fn.apply(new Builder()).build(); } @@ -74,6 +88,7 @@ public final Boolean thresholdEnabled() { /** * Serialize this object to JSON. */ + @Override public void serialize(JsonGenerator generator, JsonpMapper mapper) { generator.writeStartObject(); serializeInternal(generator, mapper); @@ -81,28 +96,52 @@ public void serialize(JsonGenerator generator, JsonpMapper mapper) { } protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { - if (this.thresholdEnabled != null) { generator.writeKey("threshold_enabled"); generator.write(this.thresholdEnabled); - } - } // --------------------------------------------------------------------------------------------- + @Override + @Nonnull + public Builder toBuilder() { + return new Builder(this); + } + + @Nonnull + public static Builder builder() { + return new Builder(); + } + /** * Builder for {@link IndexRoutingAllocationDisk}. */ - - public static class Builder extends ObjectBuilderBase implements ObjectBuilder { + public static class Builder extends ObjectBuilderBase implements CopyableBuilder { @Nullable private Boolean thresholdEnabled; + public Builder() {} + + private Builder(IndexRoutingAllocationDisk o) { + this.thresholdEnabled = o.thresholdEnabled; + } + + private Builder(Builder o) { + this.thresholdEnabled = o.thresholdEnabled; + } + + @Override + @Nonnull + public Builder copy() { + return new Builder(this); + } + /** * API name: {@code threshold_enabled} */ + @Nonnull public final Builder thresholdEnabled(@Nullable Boolean value) { this.thresholdEnabled = value; return this; @@ -111,9 +150,10 @@ public final Builder thresholdEnabled(@Nullable Boolean value) { /** * Builds a {@link IndexRoutingAllocationDisk}. * - * @throws NullPointerException - * if some of the required fields are null. + * @throws NullPointerException if some of the required fields are null. */ + @Override + @Nonnull public IndexRoutingAllocationDisk build() { _checkSingleUse(); @@ -132,9 +172,21 @@ public IndexRoutingAllocationDisk build() { ); protected static void setupIndexRoutingAllocationDiskDeserializer(ObjectDeserializer op) { - op.add(Builder::thresholdEnabled, JsonpDeserializer.booleanDeserializer(), "threshold_enabled"); + } + @Override + public int hashCode() { + int result = 17; + result = 31 * result + Objects.hashCode(this.thresholdEnabled); + return result; } + @Override + public boolean equals(Object o) { + if (this == o) return true; + if (o == null || this.getClass() != o.getClass()) return false; + IndexRoutingAllocationDisk other = (IndexRoutingAllocationDisk) o; + return Objects.equals(this.thresholdEnabled, other.thresholdEnabled); + } } diff --git a/java-client/src/main/java/org/opensearch/client/opensearch/indices/IndexRoutingAllocationInclude.java b/java-client/src/generated/java/org/opensearch/client/opensearch/indices/IndexRoutingAllocationInclude.java similarity index 68% rename from java-client/src/main/java/org/opensearch/client/opensearch/indices/IndexRoutingAllocationInclude.java rename to java-client/src/generated/java/org/opensearch/client/opensearch/indices/IndexRoutingAllocationInclude.java index 93255ae682..f594ffa764 100644 --- a/java-client/src/main/java/org/opensearch/client/opensearch/indices/IndexRoutingAllocationInclude.java +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/indices/IndexRoutingAllocationInclude.java @@ -30,10 +30,17 @@ * GitHub history for details. */ +//---------------------------------------------------- +// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. +//---------------------------------------------------- + package org.opensearch.client.opensearch.indices; import jakarta.json.stream.JsonGenerator; +import java.util.Objects; import java.util.function.Function; +import javax.annotation.Generated; +import javax.annotation.Nonnull; import javax.annotation.Nullable; import org.opensearch.client.json.JsonpDeserializable; import org.opensearch.client.json.JsonpDeserializer; @@ -41,51 +48,59 @@ import org.opensearch.client.json.ObjectBuilderDeserializer; import org.opensearch.client.json.ObjectDeserializer; import org.opensearch.client.json.PlainJsonSerializable; +import org.opensearch.client.util.CopyableBuilder; import org.opensearch.client.util.ObjectBuilder; import org.opensearch.client.util.ObjectBuilderBase; +import org.opensearch.client.util.ToCopyableBuilder; -// typedef: indices._types.IndexRoutingAllocationInclude +// typedef: indices.IndexRoutingAllocationInclude @JsonpDeserializable -public class IndexRoutingAllocationInclude implements PlainJsonSerializable { - @Nullable - private final String tierPreference; +@Generated("org.opensearch.client.codegen.CodeGenerator") +public class IndexRoutingAllocationInclude + implements + PlainJsonSerializable, + ToCopyableBuilder { @Nullable private final String id; + @Nullable + private final String tierPreference; + // --------------------------------------------------------------------------------------------- private IndexRoutingAllocationInclude(Builder builder) { - - this.tierPreference = builder.tierPreference; this.id = builder.id; - + this.tierPreference = builder.tierPreference; } - public static IndexRoutingAllocationInclude of(Function> fn) { + public static IndexRoutingAllocationInclude of( + Function> fn + ) { return fn.apply(new Builder()).build(); } /** - * API name: {@code _tier_preference} + * API name: {@code _id} */ @Nullable - public final String tierPreference() { - return this.tierPreference; + public final String id() { + return this.id; } /** - * API name: {@code _id} + * API name: {@code _tier_preference} */ @Nullable - public final String id() { - return this.id; + public final String tierPreference() { + return this.tierPreference; } /** * Serialize this object to JSON. */ + @Override public void serialize(JsonGenerator generator, JsonpMapper mapper) { generator.writeStartObject(); serializeInternal(generator, mapper); @@ -93,55 +108,82 @@ public void serialize(JsonGenerator generator, JsonpMapper mapper) { } protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { + if (this.id != null) { + generator.writeKey("_id"); + generator.write(this.id); + } if (this.tierPreference != null) { generator.writeKey("_tier_preference"); generator.write(this.tierPreference); - } - if (this.id != null) { - generator.writeKey("_id"); - generator.write(this.id); + } - } + // --------------------------------------------------------------------------------------------- + @Override + @Nonnull + public Builder toBuilder() { + return new Builder(this); } - // --------------------------------------------------------------------------------------------- + @Nonnull + public static Builder builder() { + return new Builder(); + } /** * Builder for {@link IndexRoutingAllocationInclude}. */ - - public static class Builder extends ObjectBuilderBase implements ObjectBuilder { + public static class Builder extends ObjectBuilderBase implements CopyableBuilder { + @Nullable + private String id; @Nullable private String tierPreference; - @Nullable - private String id; + public Builder() {} - /** - * API name: {@code _tier_preference} - */ - public final Builder tierPreference(@Nullable String value) { - this.tierPreference = value; - return this; + private Builder(IndexRoutingAllocationInclude o) { + this.id = o.id; + this.tierPreference = o.tierPreference; + } + + private Builder(Builder o) { + this.id = o.id; + this.tierPreference = o.tierPreference; + } + + @Override + @Nonnull + public Builder copy() { + return new Builder(this); } /** * API name: {@code _id} */ + @Nonnull public final Builder id(@Nullable String value) { this.id = value; return this; } + /** + * API name: {@code _tier_preference} + */ + @Nonnull + public final Builder tierPreference(@Nullable String value) { + this.tierPreference = value; + return this; + } + /** * Builds a {@link IndexRoutingAllocationInclude}. * - * @throws NullPointerException - * if some of the required fields are null. + * @throws NullPointerException if some of the required fields are null. */ + @Override + @Nonnull public IndexRoutingAllocationInclude build() { _checkSingleUse(); @@ -160,10 +202,23 @@ public IndexRoutingAllocationInclude build() { ); protected static void setupIndexRoutingAllocationIncludeDeserializer(ObjectDeserializer op) { - - op.add(Builder::tierPreference, JsonpDeserializer.stringDeserializer(), "_tier_preference"); op.add(Builder::id, JsonpDeserializer.stringDeserializer(), "_id"); + op.add(Builder::tierPreference, JsonpDeserializer.stringDeserializer(), "_tier_preference"); + } + @Override + public int hashCode() { + int result = 17; + result = 31 * result + Objects.hashCode(this.id); + result = 31 * result + Objects.hashCode(this.tierPreference); + return result; } + @Override + public boolean equals(Object o) { + if (this == o) return true; + if (o == null || this.getClass() != o.getClass()) return false; + IndexRoutingAllocationInclude other = (IndexRoutingAllocationInclude) o; + return Objects.equals(this.id, other.id) && Objects.equals(this.tierPreference, other.tierPreference); + } } diff --git a/java-client/src/main/java/org/opensearch/client/opensearch/indices/IndexRoutingAllocationInitialRecovery.java b/java-client/src/generated/java/org/opensearch/client/opensearch/indices/IndexRoutingAllocationInitialRecovery.java similarity index 66% rename from java-client/src/main/java/org/opensearch/client/opensearch/indices/IndexRoutingAllocationInitialRecovery.java rename to java-client/src/generated/java/org/opensearch/client/opensearch/indices/IndexRoutingAllocationInitialRecovery.java index 1c447de0df..3e0240de23 100644 --- a/java-client/src/main/java/org/opensearch/client/opensearch/indices/IndexRoutingAllocationInitialRecovery.java +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/indices/IndexRoutingAllocationInitialRecovery.java @@ -30,10 +30,17 @@ * GitHub history for details. */ +//---------------------------------------------------- +// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. +//---------------------------------------------------- + package org.opensearch.client.opensearch.indices; import jakarta.json.stream.JsonGenerator; +import java.util.Objects; import java.util.function.Function; +import javax.annotation.Generated; +import javax.annotation.Nonnull; import javax.annotation.Nullable; import org.opensearch.client.json.JsonpDeserializable; import org.opensearch.client.json.JsonpDeserializer; @@ -41,25 +48,32 @@ import org.opensearch.client.json.ObjectBuilderDeserializer; import org.opensearch.client.json.ObjectDeserializer; import org.opensearch.client.json.PlainJsonSerializable; +import org.opensearch.client.util.CopyableBuilder; import org.opensearch.client.util.ObjectBuilder; import org.opensearch.client.util.ObjectBuilderBase; +import org.opensearch.client.util.ToCopyableBuilder; -// typedef: indices._types.IndexRoutingAllocationInitialRecovery +// typedef: indices.IndexRoutingAllocationInitialRecovery @JsonpDeserializable -public class IndexRoutingAllocationInitialRecovery implements PlainJsonSerializable { +@Generated("org.opensearch.client.codegen.CodeGenerator") +public class IndexRoutingAllocationInitialRecovery + implements + PlainJsonSerializable, + ToCopyableBuilder { + @Nullable private final String id; // --------------------------------------------------------------------------------------------- private IndexRoutingAllocationInitialRecovery(Builder builder) { - this.id = builder.id; - } - public static IndexRoutingAllocationInitialRecovery of(Function> fn) { + public static IndexRoutingAllocationInitialRecovery of( + Function> fn + ) { return fn.apply(new Builder()).build(); } @@ -74,6 +88,7 @@ public final String id() { /** * Serialize this object to JSON. */ + @Override public void serialize(JsonGenerator generator, JsonpMapper mapper) { generator.writeStartObject(); serializeInternal(generator, mapper); @@ -81,28 +96,52 @@ public void serialize(JsonGenerator generator, JsonpMapper mapper) { } protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { - if (this.id != null) { generator.writeKey("_id"); generator.write(this.id); - } - } // --------------------------------------------------------------------------------------------- + @Override + @Nonnull + public Builder toBuilder() { + return new Builder(this); + } + + @Nonnull + public static Builder builder() { + return new Builder(); + } + /** * Builder for {@link IndexRoutingAllocationInitialRecovery}. */ - - public static class Builder extends ObjectBuilderBase implements ObjectBuilder { + public static class Builder extends ObjectBuilderBase implements CopyableBuilder { @Nullable private String id; + public Builder() {} + + private Builder(IndexRoutingAllocationInitialRecovery o) { + this.id = o.id; + } + + private Builder(Builder o) { + this.id = o.id; + } + + @Override + @Nonnull + public Builder copy() { + return new Builder(this); + } + /** * API name: {@code _id} */ + @Nonnull public final Builder id(@Nullable String value) { this.id = value; return this; @@ -111,9 +150,10 @@ public final Builder id(@Nullable String value) { /** * Builds a {@link IndexRoutingAllocationInitialRecovery}. * - * @throws NullPointerException - * if some of the required fields are null. + * @throws NullPointerException if some of the required fields are null. */ + @Override + @Nonnull public IndexRoutingAllocationInitialRecovery build() { _checkSingleUse(); @@ -134,9 +174,21 @@ public IndexRoutingAllocationInitialRecovery build() { protected static void setupIndexRoutingAllocationInitialRecoveryDeserializer( ObjectDeserializer op ) { - op.add(Builder::id, JsonpDeserializer.stringDeserializer(), "_id"); + } + @Override + public int hashCode() { + int result = 17; + result = 31 * result + Objects.hashCode(this.id); + return result; } + @Override + public boolean equals(Object o) { + if (this == o) return true; + if (o == null || this.getClass() != o.getClass()) return false; + IndexRoutingAllocationInitialRecovery other = (IndexRoutingAllocationInitialRecovery) o; + return Objects.equals(this.id, other.id); + } } diff --git a/java-client/src/main/java/org/opensearch/client/opensearch/indices/IndexRoutingAllocationOptions.java b/java-client/src/generated/java/org/opensearch/client/opensearch/indices/IndexRoutingAllocationOptions.java similarity index 84% rename from java-client/src/main/java/org/opensearch/client/opensearch/indices/IndexRoutingAllocationOptions.java rename to java-client/src/generated/java/org/opensearch/client/opensearch/indices/IndexRoutingAllocationOptions.java index bcfa2e5599..86eacfe8ca 100644 --- a/java-client/src/main/java/org/opensearch/client/opensearch/indices/IndexRoutingAllocationOptions.java +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/indices/IndexRoutingAllocationOptions.java @@ -30,22 +30,28 @@ * GitHub history for details. */ +//---------------------------------------------------- +// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. +//---------------------------------------------------- + package org.opensearch.client.opensearch.indices; +import javax.annotation.Generated; import org.opensearch.client.json.JsonEnum; import org.opensearch.client.json.JsonpDeserializable; +// typedef: indices.IndexRoutingAllocationOptions + @JsonpDeserializable +@Generated("org.opensearch.client.codegen.CodeGenerator") public enum IndexRoutingAllocationOptions implements JsonEnum { All("all"), - Primaries("primaries"), - NewPrimaries("new_primaries"), None("none"), - ; + Primaries("primaries"); private final String jsonValue; diff --git a/java-client/src/main/java/org/opensearch/client/opensearch/indices/IndexRoutingRebalance.java b/java-client/src/generated/java/org/opensearch/client/opensearch/indices/IndexRoutingRebalance.java similarity index 67% rename from java-client/src/main/java/org/opensearch/client/opensearch/indices/IndexRoutingRebalance.java rename to java-client/src/generated/java/org/opensearch/client/opensearch/indices/IndexRoutingRebalance.java index 85782c3ed7..cef2fe1c34 100644 --- a/java-client/src/main/java/org/opensearch/client/opensearch/indices/IndexRoutingRebalance.java +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/indices/IndexRoutingRebalance.java @@ -30,10 +30,16 @@ * GitHub history for details. */ +//---------------------------------------------------- +// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. +//---------------------------------------------------- + package org.opensearch.client.opensearch.indices; import jakarta.json.stream.JsonGenerator; import java.util.function.Function; +import javax.annotation.Generated; +import javax.annotation.Nonnull; import org.opensearch.client.json.JsonpDeserializable; import org.opensearch.client.json.JsonpDeserializer; import org.opensearch.client.json.JsonpMapper; @@ -41,30 +47,37 @@ import org.opensearch.client.json.ObjectDeserializer; import org.opensearch.client.json.PlainJsonSerializable; import org.opensearch.client.util.ApiTypeHelper; +import org.opensearch.client.util.CopyableBuilder; import org.opensearch.client.util.ObjectBuilder; import org.opensearch.client.util.ObjectBuilderBase; +import org.opensearch.client.util.ToCopyableBuilder; -// typedef: indices._types.IndexRoutingRebalance +// typedef: indices.IndexRoutingRebalance @JsonpDeserializable -public class IndexRoutingRebalance implements PlainJsonSerializable { +@Generated("org.opensearch.client.codegen.CodeGenerator") +public class IndexRoutingRebalance + implements + PlainJsonSerializable, + ToCopyableBuilder { + + @Nonnull private final IndexRoutingRebalanceOptions enable; // --------------------------------------------------------------------------------------------- private IndexRoutingRebalance(Builder builder) { - this.enable = ApiTypeHelper.requireNonNull(builder.enable, this, "enable"); - } - public static IndexRoutingRebalance of(Function> fn) { + public static IndexRoutingRebalance of(Function> fn) { return fn.apply(new Builder()).build(); } /** * Required - API name: {@code enable} */ + @Nonnull public final IndexRoutingRebalanceOptions enable() { return this.enable; } @@ -72,6 +85,7 @@ public final IndexRoutingRebalanceOptions enable() { /** * Serialize this object to JSON. */ + @Override public void serialize(JsonGenerator generator, JsonpMapper mapper) { generator.writeStartObject(); serializeInternal(generator, mapper); @@ -79,24 +93,49 @@ public void serialize(JsonGenerator generator, JsonpMapper mapper) { } protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { - generator.writeKey("enable"); this.enable.serialize(generator, mapper); - } // --------------------------------------------------------------------------------------------- + @Override + @Nonnull + public Builder toBuilder() { + return new Builder(this); + } + + @Nonnull + public static Builder builder() { + return new Builder(); + } + /** * Builder for {@link IndexRoutingRebalance}. */ - - public static class Builder extends ObjectBuilderBase implements ObjectBuilder { + public static class Builder extends ObjectBuilderBase implements CopyableBuilder { private IndexRoutingRebalanceOptions enable; + public Builder() {} + + private Builder(IndexRoutingRebalance o) { + this.enable = o.enable; + } + + private Builder(Builder o) { + this.enable = o.enable; + } + + @Override + @Nonnull + public Builder copy() { + return new Builder(this); + } + /** * Required - API name: {@code enable} */ + @Nonnull public final Builder enable(IndexRoutingRebalanceOptions value) { this.enable = value; return this; @@ -105,9 +144,10 @@ public final Builder enable(IndexRoutingRebalanceOptions value) { /** * Builds a {@link IndexRoutingRebalance}. * - * @throws NullPointerException - * if some of the required fields are null. + * @throws NullPointerException if some of the required fields are null. */ + @Override + @Nonnull public IndexRoutingRebalance build() { _checkSingleUse(); @@ -126,9 +166,21 @@ public IndexRoutingRebalance build() { ); protected static void setupIndexRoutingRebalanceDeserializer(ObjectDeserializer op) { - op.add(Builder::enable, IndexRoutingRebalanceOptions._DESERIALIZER, "enable"); + } + @Override + public int hashCode() { + int result = 17; + result = 31 * result + this.enable.hashCode(); + return result; } + @Override + public boolean equals(Object o) { + if (this == o) return true; + if (o == null || this.getClass() != o.getClass()) return false; + IndexRoutingRebalance other = (IndexRoutingRebalance) o; + return this.enable.equals(other.enable); + } } diff --git a/java-client/src/main/java/org/opensearch/client/opensearch/indices/IndexRoutingRebalanceOptions.java b/java-client/src/generated/java/org/opensearch/client/opensearch/indices/IndexRoutingRebalanceOptions.java similarity index 84% rename from java-client/src/main/java/org/opensearch/client/opensearch/indices/IndexRoutingRebalanceOptions.java rename to java-client/src/generated/java/org/opensearch/client/opensearch/indices/IndexRoutingRebalanceOptions.java index a98781fd7e..faf899f29e 100644 --- a/java-client/src/main/java/org/opensearch/client/opensearch/indices/IndexRoutingRebalanceOptions.java +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/indices/IndexRoutingRebalanceOptions.java @@ -30,22 +30,28 @@ * GitHub history for details. */ +//---------------------------------------------------- +// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. +//---------------------------------------------------- + package org.opensearch.client.opensearch.indices; +import javax.annotation.Generated; import org.opensearch.client.json.JsonEnum; import org.opensearch.client.json.JsonpDeserializable; +// typedef: indices.IndexRoutingRebalanceOptions + @JsonpDeserializable +@Generated("org.opensearch.client.codegen.CodeGenerator") public enum IndexRoutingRebalanceOptions implements JsonEnum { All("all"), - Primaries("primaries"), - - Replicas("replicas"), - None("none"), - ; + Primaries("primaries"), + + Replicas("replicas"); private final String jsonValue; diff --git a/java-client/src/main/java/org/opensearch/client/opensearch/indices/IndexSegmentSort.java b/java-client/src/generated/java/org/opensearch/client/opensearch/indices/IndexSegmentSort.java similarity index 71% rename from java-client/src/main/java/org/opensearch/client/opensearch/indices/IndexSegmentSort.java rename to java-client/src/generated/java/org/opensearch/client/opensearch/indices/IndexSegmentSort.java index 0d67016c69..90c74f388f 100644 --- a/java-client/src/main/java/org/opensearch/client/opensearch/indices/IndexSegmentSort.java +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/indices/IndexSegmentSort.java @@ -30,11 +30,18 @@ * GitHub history for details. */ +//---------------------------------------------------- +// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. +//---------------------------------------------------- + package org.opensearch.client.opensearch.indices; import jakarta.json.stream.JsonGenerator; import java.util.List; +import java.util.Objects; import java.util.function.Function; +import javax.annotation.Generated; +import javax.annotation.Nonnull; import javax.annotation.Nullable; import org.opensearch.client.json.JsonpDeserializable; import org.opensearch.client.json.JsonpDeserializer; @@ -43,67 +50,78 @@ import org.opensearch.client.json.ObjectDeserializer; import org.opensearch.client.json.PlainJsonSerializable; import org.opensearch.client.util.ApiTypeHelper; +import org.opensearch.client.util.CopyableBuilder; import org.opensearch.client.util.ObjectBuilder; import org.opensearch.client.util.ObjectBuilderBase; +import org.opensearch.client.util.ToCopyableBuilder; -// typedef: indices._types.IndexSegmentSort +// typedef: indices.IndexSegmentSort @JsonpDeserializable -public class IndexSegmentSort implements PlainJsonSerializable { +@Generated("org.opensearch.client.codegen.CodeGenerator") +public class IndexSegmentSort implements PlainJsonSerializable, ToCopyableBuilder { + + @Nonnull private final List field; - private final List order; + @Nonnull + private final List missing; + @Nonnull private final List mode; - private final List missing; + @Nonnull + private final List order; // --------------------------------------------------------------------------------------------- private IndexSegmentSort(Builder builder) { - - this.field = ApiTypeHelper.unmodifiableRequired(builder.field, this, "field"); - this.order = ApiTypeHelper.unmodifiableRequired(builder.order, this, "order"); - this.mode = ApiTypeHelper.unmodifiable(builder.mode); + this.field = ApiTypeHelper.unmodifiable(builder.field); this.missing = ApiTypeHelper.unmodifiable(builder.missing); - + this.mode = ApiTypeHelper.unmodifiable(builder.mode); + this.order = ApiTypeHelper.unmodifiable(builder.order); } - public static IndexSegmentSort of(Function> fn) { + public static IndexSegmentSort of(Function> fn) { return fn.apply(new Builder()).build(); } /** - * Required - API name: {@code field} + * API name: {@code field} */ + @Nonnull public final List field() { return this.field; } /** - * Required - API name: {@code order} + * API name: {@code missing} */ - public final List order() { - return this.order; + @Nonnull + public final List missing() { + return this.missing; } /** * API name: {@code mode} */ + @Nonnull public final List mode() { return this.mode; } /** - * API name: {@code missing} + * API name: {@code order} */ - public final List missing() { - return this.missing; + @Nonnull + public final List order() { + return this.order; } /** * Serialize this object to JSON. */ + @Override public void serialize(JsonGenerator generator, JsonpMapper mapper) { generator.writeStartObject(); serializeInternal(generator, mapper); @@ -111,26 +129,24 @@ public void serialize(JsonGenerator generator, JsonpMapper mapper) { } protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { - if (ApiTypeHelper.isDefined(this.field)) { generator.writeKey("field"); generator.writeStartArray(); for (String item0 : this.field) { generator.write(item0); - } generator.writeEnd(); - } - if (ApiTypeHelper.isDefined(this.order)) { - generator.writeKey("order"); + + if (ApiTypeHelper.isDefined(this.missing)) { + generator.writeKey("missing"); generator.writeStartArray(); - for (SegmentSortOrder item0 : this.order) { + for (SegmentSortMissing item0 : this.missing) { item0.serialize(generator, mapper); } generator.writeEnd(); - } + if (ApiTypeHelper.isDefined(this.mode)) { generator.writeKey("mode"); generator.writeStartArray(); @@ -138,82 +154,126 @@ protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { item0.serialize(generator, mapper); } generator.writeEnd(); - } - if (ApiTypeHelper.isDefined(this.missing)) { - generator.writeKey("missing"); + + if (ApiTypeHelper.isDefined(this.order)) { + generator.writeKey("order"); generator.writeStartArray(); - for (SegmentSortMissing item0 : this.missing) { + for (SegmentSortOrder item0 : this.order) { item0.serialize(generator, mapper); } generator.writeEnd(); - } - } // --------------------------------------------------------------------------------------------- + @Override + @Nonnull + public Builder toBuilder() { + return new Builder(this); + } + + @Nonnull + public static Builder builder() { + return new Builder(); + } + /** * Builder for {@link IndexSegmentSort}. */ - - public static class Builder extends ObjectBuilderBase implements ObjectBuilder { + public static class Builder extends ObjectBuilderBase implements CopyableBuilder { + @Nullable private List field; - - private List order; - + @Nullable + private List missing; @Nullable private List mode; - @Nullable - private List missing; + private List order; + + public Builder() {} + + private Builder(IndexSegmentSort o) { + this.field = _listCopy(o.field); + this.missing = _listCopy(o.missing); + this.mode = _listCopy(o.mode); + this.order = _listCopy(o.order); + } + + private Builder(Builder o) { + this.field = _listCopy(o.field); + this.missing = _listCopy(o.missing); + this.mode = _listCopy(o.mode); + this.order = _listCopy(o.order); + } + + @Override + @Nonnull + public Builder copy() { + return new Builder(this); + } /** - * Required - API name: {@code field} + * API name: {@code field} + * *

* Adds all elements of list to field. + *

*/ + @Nonnull public final Builder field(List list) { this.field = _listAddAll(this.field, list); return this; } /** - * Required - API name: {@code field} + * API name: {@code field} + * *

* Adds one or more values to field. + *

*/ + @Nonnull public final Builder field(String value, String... values) { this.field = _listAdd(this.field, value, values); return this; } /** - * Required - API name: {@code order} + * API name: {@code missing} + * *

- * Adds all elements of list to order. + * Adds all elements of list to missing. + *

*/ - public final Builder order(List list) { - this.order = _listAddAll(this.order, list); + @Nonnull + public final Builder missing(List list) { + this.missing = _listAddAll(this.missing, list); return this; } /** - * Required - API name: {@code order} + * API name: {@code missing} + * *

- * Adds one or more values to order. + * Adds one or more values to missing. + *

*/ - public final Builder order(SegmentSortOrder value, SegmentSortOrder... values) { - this.order = _listAdd(this.order, value, values); + @Nonnull + public final Builder missing(SegmentSortMissing value, SegmentSortMissing... values) { + this.missing = _listAdd(this.missing, value, values); return this; } /** * API name: {@code mode} + * *

* Adds all elements of list to mode. + *

*/ + @Nonnull public final Builder mode(List list) { this.mode = _listAddAll(this.mode, list); return this; @@ -221,40 +281,50 @@ public final Builder mode(List list) { /** * API name: {@code mode} + * *

* Adds one or more values to mode. + *

*/ + @Nonnull public final Builder mode(SegmentSortMode value, SegmentSortMode... values) { this.mode = _listAdd(this.mode, value, values); return this; } /** - * API name: {@code missing} + * API name: {@code order} + * *

- * Adds all elements of list to missing. + * Adds all elements of list to order. + *

*/ - public final Builder missing(List list) { - this.missing = _listAddAll(this.missing, list); + @Nonnull + public final Builder order(List list) { + this.order = _listAddAll(this.order, list); return this; } /** - * API name: {@code missing} + * API name: {@code order} + * *

- * Adds one or more values to missing. + * Adds one or more values to order. + *

*/ - public final Builder missing(SegmentSortMissing value, SegmentSortMissing... values) { - this.missing = _listAdd(this.missing, value, values); + @Nonnull + public final Builder order(SegmentSortOrder value, SegmentSortOrder... values) { + this.order = _listAdd(this.order, value, values); return this; } /** * Builds a {@link IndexSegmentSort}. * - * @throws NullPointerException - * if some of the required fields are null. + * @throws NullPointerException if some of the required fields are null. */ + @Override + @Nonnull public IndexSegmentSort build() { _checkSingleUse(); @@ -273,12 +343,30 @@ public IndexSegmentSort build() { ); protected static void setupIndexSegmentSortDeserializer(ObjectDeserializer op) { - op.add(Builder::field, JsonpDeserializer.arrayDeserializer(JsonpDeserializer.stringDeserializer()), "field"); - op.add(Builder::order, JsonpDeserializer.arrayDeserializer(SegmentSortOrder._DESERIALIZER), "order"); - op.add(Builder::mode, JsonpDeserializer.arrayDeserializer(SegmentSortMode._DESERIALIZER), "mode"); op.add(Builder::missing, JsonpDeserializer.arrayDeserializer(SegmentSortMissing._DESERIALIZER), "missing"); + op.add(Builder::mode, JsonpDeserializer.arrayDeserializer(SegmentSortMode._DESERIALIZER), "mode"); + op.add(Builder::order, JsonpDeserializer.arrayDeserializer(SegmentSortOrder._DESERIALIZER), "order"); + } + @Override + public int hashCode() { + int result = 17; + result = 31 * result + Objects.hashCode(this.field); + result = 31 * result + Objects.hashCode(this.missing); + result = 31 * result + Objects.hashCode(this.mode); + result = 31 * result + Objects.hashCode(this.order); + return result; } + @Override + public boolean equals(Object o) { + if (this == o) return true; + if (o == null || this.getClass() != o.getClass()) return false; + IndexSegmentSort other = (IndexSegmentSort) o; + return Objects.equals(this.field, other.field) + && Objects.equals(this.missing, other.missing) + && Objects.equals(this.mode, other.mode) + && Objects.equals(this.order, other.order); + } } diff --git a/java-client/src/main/java/org/opensearch/client/opensearch/indices/IndexSettingBlocks.java b/java-client/src/generated/java/org/opensearch/client/opensearch/indices/IndexSettingBlocks.java similarity index 71% rename from java-client/src/main/java/org/opensearch/client/opensearch/indices/IndexSettingBlocks.java rename to java-client/src/generated/java/org/opensearch/client/opensearch/indices/IndexSettingBlocks.java index baa92c0efd..fe0d53fe8f 100644 --- a/java-client/src/main/java/org/opensearch/client/opensearch/indices/IndexSettingBlocks.java +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/indices/IndexSettingBlocks.java @@ -30,10 +30,17 @@ * GitHub history for details. */ +//---------------------------------------------------- +// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. +//---------------------------------------------------- + package org.opensearch.client.opensearch.indices; import jakarta.json.stream.JsonGenerator; +import java.util.Objects; import java.util.function.Function; +import javax.annotation.Generated; +import javax.annotation.Nonnull; import javax.annotation.Nullable; import org.opensearch.client.json.JsonpDeserializable; import org.opensearch.client.json.JsonpDeserializer; @@ -41,87 +48,90 @@ import org.opensearch.client.json.ObjectBuilderDeserializer; import org.opensearch.client.json.ObjectDeserializer; import org.opensearch.client.json.PlainJsonSerializable; +import org.opensearch.client.util.CopyableBuilder; import org.opensearch.client.util.ObjectBuilder; import org.opensearch.client.util.ObjectBuilderBase; +import org.opensearch.client.util.ToCopyableBuilder; -// typedef: indices._types.IndexSettingBlocks +// typedef: indices.IndexSettingBlocks @JsonpDeserializable -public class IndexSettingBlocks implements PlainJsonSerializable { - @Nullable - private final Boolean readOnly; +@Generated("org.opensearch.client.codegen.CodeGenerator") +public class IndexSettingBlocks implements PlainJsonSerializable, ToCopyableBuilder { @Nullable - private final Boolean readOnlyAllowDelete; + private final Boolean metadata; @Nullable private final Boolean read; @Nullable - private final Boolean write; + private final Boolean readOnly; @Nullable - private final Boolean metadata; + private final Boolean readOnlyAllowDelete; + + @Nullable + private final Boolean write; // --------------------------------------------------------------------------------------------- private IndexSettingBlocks(Builder builder) { - + this.metadata = builder.metadata; + this.read = builder.read; this.readOnly = builder.readOnly; this.readOnlyAllowDelete = builder.readOnlyAllowDelete; - this.read = builder.read; this.write = builder.write; - this.metadata = builder.metadata; - } - public static IndexSettingBlocks of(Function> fn) { + public static IndexSettingBlocks of(Function> fn) { return fn.apply(new Builder()).build(); } /** - * API name: {@code read_only} + * API name: {@code metadata} */ @Nullable - public final Boolean readOnly() { - return this.readOnly; + public final Boolean metadata() { + return this.metadata; } /** - * API name: {@code read_only_allow_delete} + * API name: {@code read} */ @Nullable - public final Boolean readOnlyAllowDelete() { - return this.readOnlyAllowDelete; + public final Boolean read() { + return this.read; } /** - * API name: {@code read} + * API name: {@code read_only} */ @Nullable - public final Boolean read() { - return this.read; + public final Boolean readOnly() { + return this.readOnly; } /** - * API name: {@code write} + * API name: {@code read_only_allow_delete} */ @Nullable - public final Boolean write() { - return this.write; + public final Boolean readOnlyAllowDelete() { + return this.readOnlyAllowDelete; } /** - * API name: {@code metadata} + * API name: {@code write} */ @Nullable - public final Boolean metadata() { - return this.metadata; + public final Boolean write() { + return this.write; } /** * Serialize this object to JSON. */ + @Override public void serialize(JsonGenerator generator, JsonpMapper mapper) { generator.writeStartObject(); serializeInternal(generator, mapper); @@ -129,103 +139,136 @@ public void serialize(JsonGenerator generator, JsonpMapper mapper) { } protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { + if (this.metadata != null) { + generator.writeKey("metadata"); + generator.write(this.metadata); + } + + if (this.read != null) { + generator.writeKey("read"); + generator.write(this.read); + } if (this.readOnly != null) { generator.writeKey("read_only"); generator.write(this.readOnly); - } + if (this.readOnlyAllowDelete != null) { generator.writeKey("read_only_allow_delete"); generator.write(this.readOnlyAllowDelete); - } - if (this.read != null) { - generator.writeKey("read"); - generator.write(this.read); - } if (this.write != null) { generator.writeKey("write"); generator.write(this.write); - } - if (this.metadata != null) { - generator.writeKey("metadata"); - generator.write(this.metadata); + } - } + // --------------------------------------------------------------------------------------------- + @Override + @Nonnull + public Builder toBuilder() { + return new Builder(this); } - // --------------------------------------------------------------------------------------------- + @Nonnull + public static Builder builder() { + return new Builder(); + } /** * Builder for {@link IndexSettingBlocks}. */ - - public static class Builder extends ObjectBuilderBase implements ObjectBuilder { + public static class Builder extends ObjectBuilderBase implements CopyableBuilder { + @Nullable + private Boolean metadata; + @Nullable + private Boolean read; @Nullable private Boolean readOnly; - @Nullable private Boolean readOnlyAllowDelete; - - @Nullable - private Boolean read; - @Nullable private Boolean write; - @Nullable - private Boolean metadata; + public Builder() {} - /** - * API name: {@code read_only} - */ - public final Builder readOnly(@Nullable Boolean value) { - this.readOnly = value; - return this; + private Builder(IndexSettingBlocks o) { + this.metadata = o.metadata; + this.read = o.read; + this.readOnly = o.readOnly; + this.readOnlyAllowDelete = o.readOnlyAllowDelete; + this.write = o.write; + } + + private Builder(Builder o) { + this.metadata = o.metadata; + this.read = o.read; + this.readOnly = o.readOnly; + this.readOnlyAllowDelete = o.readOnlyAllowDelete; + this.write = o.write; + } + + @Override + @Nonnull + public Builder copy() { + return new Builder(this); } /** - * API name: {@code read_only_allow_delete} + * API name: {@code metadata} */ - public final Builder readOnlyAllowDelete(@Nullable Boolean value) { - this.readOnlyAllowDelete = value; + @Nonnull + public final Builder metadata(@Nullable Boolean value) { + this.metadata = value; return this; } /** * API name: {@code read} */ + @Nonnull public final Builder read(@Nullable Boolean value) { this.read = value; return this; } /** - * API name: {@code write} + * API name: {@code read_only} */ - public final Builder write(@Nullable Boolean value) { - this.write = value; + @Nonnull + public final Builder readOnly(@Nullable Boolean value) { + this.readOnly = value; return this; } /** - * API name: {@code metadata} + * API name: {@code read_only_allow_delete} */ - public final Builder metadata(@Nullable Boolean value) { - this.metadata = value; + @Nonnull + public final Builder readOnlyAllowDelete(@Nullable Boolean value) { + this.readOnlyAllowDelete = value; + return this; + } + + /** + * API name: {@code write} + */ + @Nonnull + public final Builder write(@Nullable Boolean value) { + this.write = value; return this; } /** * Builds a {@link IndexSettingBlocks}. * - * @throws NullPointerException - * if some of the required fields are null. + * @throws NullPointerException if some of the required fields are null. */ + @Override + @Nonnull public IndexSettingBlocks build() { _checkSingleUse(); @@ -244,13 +287,33 @@ public IndexSettingBlocks build() { ); protected static void setupIndexSettingBlocksDeserializer(ObjectDeserializer op) { - + op.add(Builder::metadata, JsonpDeserializer.booleanDeserializer(), "metadata"); + op.add(Builder::read, JsonpDeserializer.booleanDeserializer(), "read"); op.add(Builder::readOnly, JsonpDeserializer.booleanDeserializer(), "read_only"); op.add(Builder::readOnlyAllowDelete, JsonpDeserializer.booleanDeserializer(), "read_only_allow_delete"); - op.add(Builder::read, JsonpDeserializer.booleanDeserializer(), "read"); op.add(Builder::write, JsonpDeserializer.booleanDeserializer(), "write"); - op.add(Builder::metadata, JsonpDeserializer.booleanDeserializer(), "metadata"); + } + @Override + public int hashCode() { + int result = 17; + result = 31 * result + Objects.hashCode(this.metadata); + result = 31 * result + Objects.hashCode(this.read); + result = 31 * result + Objects.hashCode(this.readOnly); + result = 31 * result + Objects.hashCode(this.readOnlyAllowDelete); + result = 31 * result + Objects.hashCode(this.write); + return result; } + @Override + public boolean equals(Object o) { + if (this == o) return true; + if (o == null || this.getClass() != o.getClass()) return false; + IndexSettingBlocks other = (IndexSettingBlocks) o; + return Objects.equals(this.metadata, other.metadata) + && Objects.equals(this.read, other.read) + && Objects.equals(this.readOnly, other.readOnly) + && Objects.equals(this.readOnlyAllowDelete, other.readOnlyAllowDelete) + && Objects.equals(this.write, other.write); + } } diff --git a/java-client/src/main/java/org/opensearch/client/opensearch/indices/IndexSettings.java b/java-client/src/generated/java/org/opensearch/client/opensearch/indices/IndexSettings.java similarity index 59% rename from java-client/src/main/java/org/opensearch/client/opensearch/indices/IndexSettings.java rename to java-client/src/generated/java/org/opensearch/client/opensearch/indices/IndexSettings.java index 12cdd73aa0..7a94bcee04 100644 --- a/java-client/src/main/java/org/opensearch/client/opensearch/indices/IndexSettings.java +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/indices/IndexSettings.java @@ -30,50 +30,73 @@ * GitHub history for details. */ +//---------------------------------------------------- +// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. +//---------------------------------------------------- + package org.opensearch.client.opensearch.indices; import jakarta.json.stream.JsonGenerator; +import java.util.HashMap; import java.util.List; +import java.util.Map; +import java.util.Objects; import java.util.function.Function; +import javax.annotation.Generated; +import javax.annotation.Nonnull; import javax.annotation.Nullable; +import org.opensearch.client.json.JsonData; import org.opensearch.client.json.JsonpDeserializable; import org.opensearch.client.json.JsonpDeserializer; import org.opensearch.client.json.JsonpMapper; import org.opensearch.client.json.ObjectBuilderDeserializer; import org.opensearch.client.json.ObjectDeserializer; -import org.opensearch.client.json.PlainDeserializable; import org.opensearch.client.json.PlainJsonSerializable; import org.opensearch.client.opensearch._types.Time; import org.opensearch.client.util.ApiTypeHelper; +import org.opensearch.client.util.CopyableBuilder; import org.opensearch.client.util.ObjectBuilder; import org.opensearch.client.util.ObjectBuilderBase; +import org.opensearch.client.util.ToCopyableBuilder; -// typedef: indices._types.IndexSettings +// typedef: indices.IndexSettings +/** + * The index settings to be updated. + */ @JsonpDeserializable -public class IndexSettings implements PlainJsonSerializable { +@Generated("org.opensearch.client.codegen.CodeGenerator") +public class IndexSettings implements PlainJsonSerializable, ToCopyableBuilder { + @Nullable - private final IndexSettings index; + private final IndexSettingsAnalysis analysis; @Nullable - private final String mode; + private final IndexSettingsAnalyze analyze; - private final List routingPath; + @Nullable + private final Integer analyzeMaxTokenCount; @Nullable - private final SoftDeletes softDeletes; + private final String autoExpandReplicas; @Nullable - private final IndexSegmentSort sort; + private final IndexSettingBlocks blocks; @Nullable - private final String numberOfShards; + private final Boolean blocksMetadata; @Nullable - private final String numberOfReplicas; + private final Boolean blocksRead; @Nullable - private final Integer numberOfRoutingShards; + private final Boolean blocksReadOnly; + + @Nullable + private final Boolean blocksReadOnlyAllowDelete; + + @Nullable + private final Boolean blocksWrite; @Nullable private final IndexCheckOnStartup checkOnStartup; @@ -82,499 +105,548 @@ public class IndexSettings implements PlainJsonSerializable { private final String codec; @Nullable - private final Integer routingPartitionSize; + private final IndexSettingsStarTree compositeIndexStarTree; @Nullable - private final Time softDeletesRetentionLeasePeriod; + private final Long creationDate; @Nullable - private final Boolean loadFixedBitsetFiltersEagerly; + private final String creationDateString; @Nullable - private final Boolean hidden; + private final String defaultPipeline; @Nullable - private final String autoExpandReplicas; + private final String finalPipeline; @Nullable - private final Integer mergeSchedulerMaxThreadCount; + private final String format; @Nullable - private final Time searchIdleAfter; + private final Time gcDeletes; @Nullable - private final Time refreshInterval; + private final Boolean hidden; @Nullable - private final Integer maxResultWindow; + private final IndexSettingsHighlight highlight; @Nullable - private final Integer maxInnerResultWindow; + private final Integer highlightMaxAnalyzedOffset; @Nullable - private final Integer maxRescoreWindow; + private final IndexSettings index; @Nullable - private final Integer maxDocvalueFieldsSearch; + private final IndexSettingsIndexing indexing; @Nullable - private final Integer maxScriptFields; + private final IndexingPressure indexingPressure; @Nullable - private final Integer maxNgramDiff; + private final Boolean knn; @Nullable - private final Integer maxShingleDiff; + private final Integer knnAlgoParamEfSearch; @Nullable - private final IndexSettingBlocks blocks; + private final IndexSettingsLifecycle lifecycle; @Nullable - private final Boolean blocksReadOnly; + private final String lifecycleName; @Nullable - private final Boolean blocksReadOnlyAllowDelete; + private final Boolean loadFixedBitsetFiltersEagerly; @Nullable - private final Boolean blocksRead; + private final IndexSettingsMapping mapping; @Nullable - private final Boolean blocksWrite; + private final Integer maxDocvalueFieldsSearch; @Nullable - private final Boolean blocksMetadata; + private final Integer maxInnerResultWindow; + + @Nullable + private final Integer maxNgramDiff; @Nullable private final Integer maxRefreshListeners; @Nullable - private final Integer analyzeMaxTokenCount; + private final Integer maxRegexLength; @Nullable - private final Integer highlightMaxAnalyzedOffset; + private final Integer maxRescoreWindow; @Nullable - private final Integer maxTermsCount; + private final Integer maxResultWindow; @Nullable - private final Integer maxRegexLength; + private final Integer maxScriptFields; @Nullable - private final IndexRouting routing; + private final Integer maxShingleDiff; @Nullable - private final Time gcDeletes; + private final Integer maxSlicesPerScroll; @Nullable - private final String defaultPipeline; + private final Integer maxTermsCount; @Nullable - private final String finalPipeline; + private final IndexSettingsMerge merge; @Nullable - private final String lifecycleName; + private final Integer mergeSchedulerMaxThreadCount; @Nullable - private final String providedName; + private final String mode; @Nullable - private final String creationDate; + private final Integer numberOfReplicas; @Nullable - private final String uuid; + private final Integer numberOfRoutingShards; @Nullable - private final IndexVersioning version; + private final Integer numberOfShards; @Nullable - private final Boolean verifiedBeforeClose; + private final String priority; @Nullable - private final String format; + private final String providedName; @Nullable - private final Integer maxSlicesPerScroll; + private final IndexSettingsQueries queries; @Nullable - private final Translog translog; + private final IndexSettingsQueryString queryString; @Nullable private final Boolean queryStringLenient; @Nullable - private final String priority; + private final Time refreshInterval; @Nullable - private final Integer topMetricsMaxSize; + private final IndexRouting routing; @Nullable - private final IndexSettingsAnalysis analysis; + private final Integer routingPartitionSize; + + @Nonnull + private final List routingPath; + + @Nullable + private final IndexSettingsSearch search; + + @Nullable + private final Time searchIdleAfter; @Nullable private final IndexSettings settings; @Nullable - private final IndexSettingsMapping mapping; + private final IndexSettingsSimilarity similarity; @Nullable - private final IndexSettingsIndexing indexing; + private final SoftDeletes softDeletes; @Nullable - private final IndexSettingsSearch search; + private final Time softDeletesRetentionLeasePeriod; @Nullable - private final Boolean knn; + private final IndexSegmentSort sort; @Nullable - private final Integer knnAlgoParamEfSearch; + private final IndexSettingsStore store; + + @Nullable + private final Integer topMetricsMaxSize; + + @Nullable + private final Translog translog; + + @Nullable + private final TranslogDurability translogDurability; + + @Nullable + private final String translogFlushThresholdSize; + + @Nullable + private final String uuid; + + @Nullable + private final Boolean verifiedBeforeClose; + + @Nullable + private final IndexVersioning version; + + @Nonnull + private final Map customSettings; // --------------------------------------------------------------------------------------------- private IndexSettings(Builder builder) { - - this.index = builder.index; - this.mode = builder.mode; - this.routingPath = ApiTypeHelper.unmodifiable(builder.routingPath); - this.softDeletes = builder.softDeletes; - this.sort = builder.sort; - this.numberOfShards = builder.numberOfShards; - this.numberOfReplicas = builder.numberOfReplicas; - this.numberOfRoutingShards = builder.numberOfRoutingShards; - this.checkOnStartup = builder.checkOnStartup; - this.codec = builder.codec; - this.routingPartitionSize = builder.routingPartitionSize; - this.softDeletesRetentionLeasePeriod = builder.softDeletesRetentionLeasePeriod; - this.loadFixedBitsetFiltersEagerly = builder.loadFixedBitsetFiltersEagerly; - this.hidden = builder.hidden; + this.analysis = builder.analysis; + this.analyze = builder.analyze; + this.analyzeMaxTokenCount = builder.analyzeMaxTokenCount; this.autoExpandReplicas = builder.autoExpandReplicas; - this.mergeSchedulerMaxThreadCount = builder.mergeSchedulerMaxThreadCount; - this.searchIdleAfter = builder.searchIdleAfter; - this.refreshInterval = builder.refreshInterval; - this.maxResultWindow = builder.maxResultWindow; - this.maxInnerResultWindow = builder.maxInnerResultWindow; - this.maxRescoreWindow = builder.maxRescoreWindow; - this.maxDocvalueFieldsSearch = builder.maxDocvalueFieldsSearch; - this.maxScriptFields = builder.maxScriptFields; - this.maxNgramDiff = builder.maxNgramDiff; - this.maxShingleDiff = builder.maxShingleDiff; this.blocks = builder.blocks; + this.blocksMetadata = builder.blocksMetadata; + this.blocksRead = builder.blocksRead; this.blocksReadOnly = builder.blocksReadOnly; this.blocksReadOnlyAllowDelete = builder.blocksReadOnlyAllowDelete; - this.blocksRead = builder.blocksRead; this.blocksWrite = builder.blocksWrite; - this.blocksMetadata = builder.blocksMetadata; - this.maxRefreshListeners = builder.maxRefreshListeners; - this.analyzeMaxTokenCount = builder.analyzeMaxTokenCount; - this.highlightMaxAnalyzedOffset = builder.highlightMaxAnalyzedOffset; - this.maxTermsCount = builder.maxTermsCount; - this.maxRegexLength = builder.maxRegexLength; - this.routing = builder.routing; - this.gcDeletes = builder.gcDeletes; + this.checkOnStartup = builder.checkOnStartup; + this.codec = builder.codec; + this.compositeIndexStarTree = builder.compositeIndexStarTree; + this.creationDate = builder.creationDate; + this.creationDateString = builder.creationDateString; this.defaultPipeline = builder.defaultPipeline; this.finalPipeline = builder.finalPipeline; - this.lifecycleName = builder.lifecycleName; - this.providedName = builder.providedName; - this.creationDate = builder.creationDate; - this.uuid = builder.uuid; - this.version = builder.version; - this.verifiedBeforeClose = builder.verifiedBeforeClose; this.format = builder.format; - this.maxSlicesPerScroll = builder.maxSlicesPerScroll; - this.translog = builder.translog; - this.queryStringLenient = builder.queryStringLenient; - this.priority = builder.priority; - this.topMetricsMaxSize = builder.topMetricsMaxSize; - this.analysis = builder.analysis; - this.settings = builder.settings; - this.mapping = builder.mapping; + this.gcDeletes = builder.gcDeletes; + this.hidden = builder.hidden; + this.highlight = builder.highlight; + this.highlightMaxAnalyzedOffset = builder.highlightMaxAnalyzedOffset; + this.index = builder.index; this.indexing = builder.indexing; - this.search = builder.search; + this.indexingPressure = builder.indexingPressure; this.knn = builder.knn; this.knnAlgoParamEfSearch = builder.knnAlgoParamEfSearch; - + this.lifecycle = builder.lifecycle; + this.lifecycleName = builder.lifecycleName; + this.loadFixedBitsetFiltersEagerly = builder.loadFixedBitsetFiltersEagerly; + this.mapping = builder.mapping; + this.maxDocvalueFieldsSearch = builder.maxDocvalueFieldsSearch; + this.maxInnerResultWindow = builder.maxInnerResultWindow; + this.maxNgramDiff = builder.maxNgramDiff; + this.maxRefreshListeners = builder.maxRefreshListeners; + this.maxRegexLength = builder.maxRegexLength; + this.maxRescoreWindow = builder.maxRescoreWindow; + this.maxResultWindow = builder.maxResultWindow; + this.maxScriptFields = builder.maxScriptFields; + this.maxShingleDiff = builder.maxShingleDiff; + this.maxSlicesPerScroll = builder.maxSlicesPerScroll; + this.maxTermsCount = builder.maxTermsCount; + this.merge = builder.merge; + this.mergeSchedulerMaxThreadCount = builder.mergeSchedulerMaxThreadCount; + this.mode = builder.mode; + this.numberOfReplicas = builder.numberOfReplicas; + this.numberOfRoutingShards = builder.numberOfRoutingShards; + this.numberOfShards = builder.numberOfShards; + this.priority = builder.priority; + this.providedName = builder.providedName; + this.queries = builder.queries; + this.queryString = builder.queryString; + this.queryStringLenient = builder.queryStringLenient; + this.refreshInterval = builder.refreshInterval; + this.routing = builder.routing; + this.routingPartitionSize = builder.routingPartitionSize; + this.routingPath = ApiTypeHelper.unmodifiable(builder.routingPath); + this.search = builder.search; + this.searchIdleAfter = builder.searchIdleAfter; + this.settings = builder.settings; + this.similarity = builder.similarity; + this.softDeletes = builder.softDeletes; + this.softDeletesRetentionLeasePeriod = builder.softDeletesRetentionLeasePeriod; + this.sort = builder.sort; + this.store = builder.store; + this.topMetricsMaxSize = builder.topMetricsMaxSize; + this.translog = builder.translog; + this.translogDurability = builder.translogDurability; + this.translogFlushThresholdSize = builder.translogFlushThresholdSize; + this.uuid = builder.uuid; + this.verifiedBeforeClose = builder.verifiedBeforeClose; + this.version = builder.version; + this.customSettings = ApiTypeHelper.unmodifiable(builder.customSettings); } - public static IndexSettings of(Function> fn) { + public static IndexSettings of(Function> fn) { return fn.apply(new Builder()).build(); } /** - * API name: {@code index} + * API name: {@code analysis} */ @Nullable - public final IndexSettings index() { - return this.index; + public final IndexSettingsAnalysis analysis() { + return this.analysis; } /** - * API name: {@code mode} + * API name: {@code analyze} */ @Nullable - public final String mode() { - return this.mode; + public final IndexSettingsAnalyze analyze() { + return this.analyze; } /** - * API name: {@code routing_path} + * API name: {@code analyze.max_token_count} */ - public final List routingPath() { - return this.routingPath; + @Nullable + public final Integer analyzeMaxTokenCount() { + return this.analyzeMaxTokenCount; } /** - * API name: {@code soft_deletes} + * API name: {@code auto_expand_replicas} */ @Nullable - public final SoftDeletes softDeletes() { - return this.softDeletes; + public final String autoExpandReplicas() { + return this.autoExpandReplicas; } /** - * API name: {@code sort} + * API name: {@code blocks} */ @Nullable - public final IndexSegmentSort sort() { - return this.sort; + public final IndexSettingBlocks blocks() { + return this.blocks; } /** - * API name: {@code number_of_shards} + * API name: {@code blocks.metadata} */ @Nullable - public final String numberOfShards() { - return this.numberOfShards; + public final Boolean blocksMetadata() { + return this.blocksMetadata; } /** - * API name: {@code number_of_replicas} + * API name: {@code blocks.read} */ @Nullable - public final String numberOfReplicas() { - return this.numberOfReplicas; + public final Boolean blocksRead() { + return this.blocksRead; } /** - * API name: {@code number_of_routing_shards} + * API name: {@code blocks.read_only} */ @Nullable - public final Integer numberOfRoutingShards() { - return this.numberOfRoutingShards; + public final Boolean blocksReadOnly() { + return this.blocksReadOnly; } /** - * API name: {@code check_on_startup} + * API name: {@code blocks.read_only_allow_delete} */ @Nullable - public final IndexCheckOnStartup checkOnStartup() { - return this.checkOnStartup; + public final Boolean blocksReadOnlyAllowDelete() { + return this.blocksReadOnlyAllowDelete; } /** - * API name: {@code codec} + * API name: {@code blocks.write} */ @Nullable - public final String codec() { - return this.codec; + public final Boolean blocksWrite() { + return this.blocksWrite; } /** - * API name: {@code routing_partition_size} + * API name: {@code check_on_startup} */ @Nullable - public final Integer routingPartitionSize() { - return this.routingPartitionSize; + public final IndexCheckOnStartup checkOnStartup() { + return this.checkOnStartup; } /** - * API name: {@code soft_deletes.retention_lease.period} + * API name: {@code codec} */ @Nullable - public final Time softDeletesRetentionLeasePeriod() { - return this.softDeletesRetentionLeasePeriod; + public final String codec() { + return this.codec; } /** - * API name: {@code load_fixed_bitset_filters_eagerly} + * API name: {@code composite_index.star_tree} */ @Nullable - public final Boolean loadFixedBitsetFiltersEagerly() { - return this.loadFixedBitsetFiltersEagerly; + public final IndexSettingsStarTree compositeIndexStarTree() { + return this.compositeIndexStarTree; } /** - * API name: {@code hidden} + * API name: {@code creation_date} */ @Nullable - public final Boolean hidden() { - return this.hidden; + public final Long creationDate() { + return this.creationDate; } /** - * API name: {@code auto_expand_replicas} + * API name: {@code creation_date_string} */ @Nullable - public final String autoExpandReplicas() { - return this.autoExpandReplicas; + public final String creationDateString() { + return this.creationDateString; } /** - * API name: {@code merge.scheduler.max_thread_count} + * API name: {@code default_pipeline} */ @Nullable - public final Integer mergeSchedulerMaxThreadCount() { - return this.mergeSchedulerMaxThreadCount; + public final String defaultPipeline() { + return this.defaultPipeline; } /** - * API name: {@code search.idle.after} + * API name: {@code final_pipeline} */ @Nullable - public final Time searchIdleAfter() { - return this.searchIdleAfter; + public final String finalPipeline() { + return this.finalPipeline; } /** - * API name: {@code refresh_interval} + * API name: {@code format} */ @Nullable - public final Time refreshInterval() { - return this.refreshInterval; + public final String format() { + return this.format; } /** - * API name: {@code max_result_window} + * API name: {@code gc_deletes} */ @Nullable - public final Integer maxResultWindow() { - return this.maxResultWindow; + public final Time gcDeletes() { + return this.gcDeletes; } /** - * API name: {@code max_inner_result_window} + * API name: {@code hidden} */ @Nullable - public final Integer maxInnerResultWindow() { - return this.maxInnerResultWindow; + public final Boolean hidden() { + return this.hidden; } /** - * API name: {@code max_rescore_window} + * API name: {@code highlight} */ @Nullable - public final Integer maxRescoreWindow() { - return this.maxRescoreWindow; + public final IndexSettingsHighlight highlight() { + return this.highlight; } /** - * API name: {@code max_docvalue_fields_search} + * API name: {@code highlight.max_analyzed_offset} */ @Nullable - public final Integer maxDocvalueFieldsSearch() { - return this.maxDocvalueFieldsSearch; + public final Integer highlightMaxAnalyzedOffset() { + return this.highlightMaxAnalyzedOffset; } /** - * API name: {@code max_script_fields} + * API name: {@code index} */ @Nullable - public final Integer maxScriptFields() { - return this.maxScriptFields; + public final IndexSettings index() { + return this.index; } /** - * API name: {@code max_ngram_diff} + * API name: {@code indexing} */ @Nullable - public final Integer maxNgramDiff() { - return this.maxNgramDiff; + public final IndexSettingsIndexing indexing() { + return this.indexing; } /** - * API name: {@code max_shingle_diff} + * API name: {@code indexing_pressure} */ @Nullable - public final Integer maxShingleDiff() { - return this.maxShingleDiff; + public final IndexingPressure indexingPressure() { + return this.indexingPressure; } /** - * API name: {@code blocks} + * API name: {@code knn} */ @Nullable - public final IndexSettingBlocks blocks() { - return this.blocks; + public final Boolean knn() { + return this.knn; } /** - * API name: {@code blocks.read_only} + * API name: {@code knn.algo_param.ef_search} */ @Nullable - public final Boolean blocksReadOnly() { - return this.blocksReadOnly; + public final Integer knnAlgoParamEfSearch() { + return this.knnAlgoParamEfSearch; } /** - * API name: {@code blocks.read_only_allow_delete} + * API name: {@code lifecycle} */ @Nullable - public final Boolean blocksReadOnlyAllowDelete() { - return this.blocksReadOnlyAllowDelete; + public final IndexSettingsLifecycle lifecycle() { + return this.lifecycle; } /** - * API name: {@code blocks.read} + * API name: {@code lifecycle.name} */ @Nullable - public final Boolean blocksRead() { - return this.blocksRead; + public final String lifecycleName() { + return this.lifecycleName; } /** - * API name: {@code blocks.write} + * API name: {@code load_fixed_bitset_filters_eagerly} */ @Nullable - public final Boolean blocksWrite() { - return this.blocksWrite; + public final Boolean loadFixedBitsetFiltersEagerly() { + return this.loadFixedBitsetFiltersEagerly; } /** - * API name: {@code blocks.metadata} + * API name: {@code mapping} */ @Nullable - public final Boolean blocksMetadata() { - return this.blocksMetadata; + public final IndexSettingsMapping mapping() { + return this.mapping; } /** - * API name: {@code max_refresh_listeners} + * API name: {@code max_docvalue_fields_search} */ @Nullable - public final Integer maxRefreshListeners() { - return this.maxRefreshListeners; + public final Integer maxDocvalueFieldsSearch() { + return this.maxDocvalueFieldsSearch; } /** - * API name: {@code analyze.max_token_count} + * API name: {@code max_inner_result_window} */ @Nullable - public final Integer analyzeMaxTokenCount() { - return this.analyzeMaxTokenCount; + public final Integer maxInnerResultWindow() { + return this.maxInnerResultWindow; } /** - * API name: {@code highlight.max_analyzed_offset} + * API name: {@code max_ngram_diff} */ @Nullable - public final Integer highlightMaxAnalyzedOffset() { - return this.highlightMaxAnalyzedOffset; + public final Integer maxNgramDiff() { + return this.maxNgramDiff; } /** - * API name: {@code max_terms_count} + * API name: {@code max_refresh_listeners} */ @Nullable - public final Integer maxTermsCount() { - return this.maxTermsCount; + public final Integer maxRefreshListeners() { + return this.maxRefreshListeners; } /** @@ -586,127 +658,131 @@ public final Integer maxRegexLength() { } /** - * API name: {@code routing} + * API name: {@code max_rescore_window} */ @Nullable - public final IndexRouting routing() { - return this.routing; + public final Integer maxRescoreWindow() { + return this.maxRescoreWindow; } /** - * API name: {@code gc_deletes} + * API name: {@code max_result_window} */ @Nullable - public final Time gcDeletes() { - return this.gcDeletes; + public final Integer maxResultWindow() { + return this.maxResultWindow; } /** - * API name: {@code default_pipeline} + * API name: {@code max_script_fields} */ @Nullable - public final String defaultPipeline() { - return this.defaultPipeline; + public final Integer maxScriptFields() { + return this.maxScriptFields; } /** - * API name: {@code final_pipeline} + * API name: {@code max_shingle_diff} */ @Nullable - public final String finalPipeline() { - return this.finalPipeline; + public final Integer maxShingleDiff() { + return this.maxShingleDiff; } /** - * API name: {@code lifecycle.name} + * API name: {@code max_slices_per_scroll} */ @Nullable - public final String lifecycleName() { - return this.lifecycleName; + public final Integer maxSlicesPerScroll() { + return this.maxSlicesPerScroll; } /** - * API name: {@code provided_name} + * API name: {@code max_terms_count} */ @Nullable - public final String providedName() { - return this.providedName; + public final Integer maxTermsCount() { + return this.maxTermsCount; } /** - * API name: {@code creation_date} + * API name: {@code merge} */ @Nullable - public final String creationDate() { - return this.creationDate; + public final IndexSettingsMerge merge() { + return this.merge; } /** - * API name: {@code uuid} + * API name: {@code merge.scheduler.max_thread_count} */ @Nullable - public final String uuid() { - return this.uuid; + public final Integer mergeSchedulerMaxThreadCount() { + return this.mergeSchedulerMaxThreadCount; } /** - * API name: {@code version} + * API name: {@code mode} */ @Nullable - public final IndexVersioning version() { - return this.version; + public final String mode() { + return this.mode; } /** - * API name: {@code verified_before_close} + * API name: {@code number_of_replicas} */ @Nullable - public final Boolean verifiedBeforeClose() { - return this.verifiedBeforeClose; + public final Integer numberOfReplicas() { + return this.numberOfReplicas; } /** - * API name: {@code format} + * API name: {@code number_of_routing_shards} */ @Nullable - public final String format() { - return this.format; + public final Integer numberOfRoutingShards() { + return this.numberOfRoutingShards; } /** - * API name: {@code max_slices_per_scroll} + * API name: {@code number_of_shards} */ @Nullable - public final Integer maxSlicesPerScroll() { - return this.maxSlicesPerScroll; + public final Integer numberOfShards() { + return this.numberOfShards; } /** - * API name: {@code translog} + * API name: {@code priority} */ @Nullable - public final Translog translog() { - return this.translog; + public final String priority() { + return this.priority; } /** - * API name: {@code translog.durability} - * @deprecated use {@link #translog()} instead + * API name: {@code provided_name} + */ + @Nullable + public final String providedName() { + return this.providedName; + } + + /** + * API name: {@code queries} */ - @Deprecated @Nullable - public final String translogDurability() { - return this.translog != null ? this.translog.durability() : null; + public final IndexSettingsQueries queries() { + return this.queries; } /** - * API name: {@code translog.flush_threshold_size} - * @deprecated use {@link #translog()} instead + * API name: {@code query_string} */ - @Deprecated @Nullable - public final String translogFlushThresholdSize() { - return this.translog != null ? this.translog.flushThresholdSize() : null; + public final IndexSettingsQueryString queryString() { + return this.queryString; } /** @@ -718,27 +794,51 @@ public final Boolean queryStringLenient() { } /** - * API name: {@code priority} + * API name: {@code refresh_interval} */ @Nullable - public final String priority() { - return this.priority; + public final Time refreshInterval() { + return this.refreshInterval; } /** - * API name: {@code top_metrics_max_size} + * API name: {@code routing} */ @Nullable - public final Integer topMetricsMaxSize() { - return this.topMetricsMaxSize; + public final IndexRouting routing() { + return this.routing; } /** - * API name: {@code analysis} + * API name: {@code routing_partition_size} */ @Nullable - public final IndexSettingsAnalysis analysis() { - return this.analysis; + public final Integer routingPartitionSize() { + return this.routingPartitionSize; + } + + /** + * API name: {@code routing_path} + */ + @Nonnull + public final List routingPath() { + return this.routingPath; + } + + /** + * API name: {@code search} + */ + @Nullable + public final IndexSettingsSearch search() { + return this.search; + } + + /** + * API name: {@code search.idle.after} + */ + @Nullable + public final Time searchIdleAfter() { + return this.searchIdleAfter; } /** @@ -750,48 +850,112 @@ public final IndexSettings settings() { } /** - * API name: {@code mapping} + * API name: {@code similarity} */ @Nullable - public final IndexSettingsMapping mapping() { - return this.mapping; + public final IndexSettingsSimilarity similarity() { + return this.similarity; } /** - * API name: {@code indexing} + * API name: {@code soft_deletes} */ @Nullable - public final IndexSettingsIndexing indexing() { - return this.indexing; + public final SoftDeletes softDeletes() { + return this.softDeletes; } /** - * API name: {@code search} + * API name: {@code soft_deletes.retention_lease.period} */ @Nullable - public final IndexSettingsSearch search() { - return this.search; + public final Time softDeletesRetentionLeasePeriod() { + return this.softDeletesRetentionLeasePeriod; } /** - * API name: {@code knn} + * API name: {@code sort} */ @Nullable - public final Boolean knn() { - return this.knn; + public final IndexSegmentSort sort() { + return this.sort; } /** - * API name: {@code knn.algo_param.ef_search} + * API name: {@code store} */ @Nullable - public final Integer knnAlgoParamEfSearch() { - return this.knnAlgoParamEfSearch; + public final IndexSettingsStore store() { + return this.store; + } + + /** + * API name: {@code top_metrics_max_size} + */ + @Nullable + public final Integer topMetricsMaxSize() { + return this.topMetricsMaxSize; + } + + /** + * API name: {@code translog} + */ + @Nullable + public final Translog translog() { + return this.translog; + } + + /** + * API name: {@code translog.durability} + */ + @Nullable + public final TranslogDurability translogDurability() { + return this.translogDurability; + } + + /** + * API name: {@code translog.flush_threshold_size} + */ + @Nullable + public final String translogFlushThresholdSize() { + return this.translogFlushThresholdSize; + } + + /** + * API name: {@code uuid} + */ + @Nullable + public final String uuid() { + return this.uuid; + } + + /** + * API name: {@code verified_before_close} + */ + @Nullable + public final Boolean verifiedBeforeClose() { + return this.verifiedBeforeClose; + } + + /** + * API name: {@code version} + */ + @Nullable + public final IndexVersioning version() { + return this.version; + } + + /** + */ + @Nonnull + public final Map customSettings() { + return this.customSettings; } /** * Serialize this object to JSON. */ + @Override public void serialize(JsonGenerator generator, JsonpMapper mapper) { generator.writeStartObject(); serializeInternal(generator, mapper); @@ -799,594 +963,817 @@ public void serialize(JsonGenerator generator, JsonpMapper mapper) { } protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { + for (Map.Entry item0 : this.customSettings.entrySet()) { + generator.writeKey(item0.getKey()); + item0.getValue().serialize(generator, mapper); + } + if (this.analysis != null) { + generator.writeKey("analysis"); + this.analysis.serialize(generator, mapper); + } - if (this.index != null) { - generator.writeKey("index"); - this.index.serialize(generator, mapper); - + if (this.analyze != null) { + generator.writeKey("analyze"); + this.analyze.serialize(generator, mapper); } - if (this.mode != null) { - generator.writeKey("mode"); - generator.write(this.mode); + if (this.analyzeMaxTokenCount != null) { + generator.writeKey("analyze.max_token_count"); + generator.write(this.analyzeMaxTokenCount); } - if (ApiTypeHelper.isDefined(this.routingPath)) { - generator.writeKey("routing_path"); - generator.writeStartArray(); - for (String item0 : this.routingPath) { - generator.write(item0); - } - generator.writeEnd(); + if (this.autoExpandReplicas != null) { + generator.writeKey("auto_expand_replicas"); + generator.write(this.autoExpandReplicas); + } + if (this.blocks != null) { + generator.writeKey("blocks"); + this.blocks.serialize(generator, mapper); } - if (this.softDeletes != null) { - generator.writeKey("soft_deletes"); - this.softDeletes.serialize(generator, mapper); + if (this.blocksMetadata != null) { + generator.writeKey("blocks.metadata"); + generator.write(this.blocksMetadata); } - if (this.sort != null) { - generator.writeKey("sort"); - this.sort.serialize(generator, mapper); + if (this.blocksRead != null) { + generator.writeKey("blocks.read"); + generator.write(this.blocksRead); } - if (this.numberOfShards != null) { - generator.writeKey("number_of_shards"); - generator.write(this.numberOfShards); + if (this.blocksReadOnly != null) { + generator.writeKey("blocks.read_only"); + generator.write(this.blocksReadOnly); } - if (this.numberOfReplicas != null) { - generator.writeKey("number_of_replicas"); - generator.write(this.numberOfReplicas); + if (this.blocksReadOnlyAllowDelete != null) { + generator.writeKey("blocks.read_only_allow_delete"); + generator.write(this.blocksReadOnlyAllowDelete); } - if (this.numberOfRoutingShards != null) { - generator.writeKey("number_of_routing_shards"); - generator.write(this.numberOfRoutingShards); + if (this.blocksWrite != null) { + generator.writeKey("blocks.write"); + generator.write(this.blocksWrite); } + if (this.checkOnStartup != null) { generator.writeKey("check_on_startup"); this.checkOnStartup.serialize(generator, mapper); } + if (this.codec != null) { generator.writeKey("codec"); generator.write(this.codec); - } - if (this.routingPartitionSize != null) { - generator.writeKey("routing_partition_size"); - generator.write(this.routingPartitionSize); + if (this.compositeIndexStarTree != null) { + generator.writeKey("composite_index.star_tree"); + this.compositeIndexStarTree.serialize(generator, mapper); } - if (this.softDeletesRetentionLeasePeriod != null) { - generator.writeKey("soft_deletes.retention_lease.period"); - this.softDeletesRetentionLeasePeriod.serialize(generator, mapper); + if (this.creationDate != null) { + generator.writeKey("creation_date"); + generator.write(this.creationDate); } - if (this.loadFixedBitsetFiltersEagerly != null) { - generator.writeKey("load_fixed_bitset_filters_eagerly"); - generator.write(this.loadFixedBitsetFiltersEagerly); + if (this.creationDateString != null) { + generator.writeKey("creation_date_string"); + generator.write(this.creationDateString); } - if (this.hidden != null) { - generator.writeKey("hidden"); - generator.write(this.hidden); + if (this.defaultPipeline != null) { + generator.writeKey("default_pipeline"); + generator.write(this.defaultPipeline); } - if (this.autoExpandReplicas != null) { - generator.writeKey("auto_expand_replicas"); - generator.write(this.autoExpandReplicas); + if (this.finalPipeline != null) { + generator.writeKey("final_pipeline"); + generator.write(this.finalPipeline); } - if (this.mergeSchedulerMaxThreadCount != null) { - generator.writeKey("merge.scheduler.max_thread_count"); - generator.write(this.mergeSchedulerMaxThreadCount); + if (this.format != null) { + generator.writeKey("format"); + generator.write(this.format); } - if (this.searchIdleAfter != null) { - generator.writeKey("search.idle.after"); - this.searchIdleAfter.serialize(generator, mapper); + if (this.gcDeletes != null) { + generator.writeKey("gc_deletes"); + this.gcDeletes.serialize(generator, mapper); } - if (this.refreshInterval != null) { - generator.writeKey("refresh_interval"); - this.refreshInterval.serialize(generator, mapper); + if (this.hidden != null) { + generator.writeKey("hidden"); + generator.write(this.hidden); } - if (this.maxResultWindow != null) { - generator.writeKey("max_result_window"); - generator.write(this.maxResultWindow); + if (this.highlight != null) { + generator.writeKey("highlight"); + this.highlight.serialize(generator, mapper); } - if (this.maxInnerResultWindow != null) { - generator.writeKey("max_inner_result_window"); - generator.write(this.maxInnerResultWindow); + if (this.highlightMaxAnalyzedOffset != null) { + generator.writeKey("highlight.max_analyzed_offset"); + generator.write(this.highlightMaxAnalyzedOffset); } - if (this.maxRescoreWindow != null) { - generator.writeKey("max_rescore_window"); - generator.write(this.maxRescoreWindow); + if (this.index != null) { + generator.writeKey("index"); + this.index.serialize(generator, mapper); } - if (this.maxDocvalueFieldsSearch != null) { - generator.writeKey("max_docvalue_fields_search"); - generator.write(this.maxDocvalueFieldsSearch); + if (this.indexing != null) { + generator.writeKey("indexing"); + this.indexing.serialize(generator, mapper); } - if (this.maxScriptFields != null) { - generator.writeKey("max_script_fields"); - generator.write(this.maxScriptFields); + if (this.indexingPressure != null) { + generator.writeKey("indexing_pressure"); + this.indexingPressure.serialize(generator, mapper); } - if (this.maxNgramDiff != null) { - generator.writeKey("max_ngram_diff"); - generator.write(this.maxNgramDiff); + if (this.knn != null) { + generator.writeKey("knn"); + generator.write(this.knn); } - if (this.maxShingleDiff != null) { - generator.writeKey("max_shingle_diff"); - generator.write(this.maxShingleDiff); + if (this.knnAlgoParamEfSearch != null) { + generator.writeKey("knn.algo_param.ef_search"); + generator.write(this.knnAlgoParamEfSearch); } - if (this.blocks != null) { - generator.writeKey("blocks"); - this.blocks.serialize(generator, mapper); + if (this.lifecycle != null) { + generator.writeKey("lifecycle"); + this.lifecycle.serialize(generator, mapper); } - if (this.blocksReadOnly != null) { - generator.writeKey("blocks.read_only"); - generator.write(this.blocksReadOnly); + if (this.lifecycleName != null) { + generator.writeKey("lifecycle.name"); + generator.write(this.lifecycleName); } - if (this.blocksReadOnlyAllowDelete != null) { - generator.writeKey("blocks.read_only_allow_delete"); - generator.write(this.blocksReadOnlyAllowDelete); + if (this.loadFixedBitsetFiltersEagerly != null) { + generator.writeKey("load_fixed_bitset_filters_eagerly"); + generator.write(this.loadFixedBitsetFiltersEagerly); + } + + if (this.mapping != null) { + generator.writeKey("mapping"); + this.mapping.serialize(generator, mapper); } - if (this.blocksRead != null) { - generator.writeKey("blocks.read"); - generator.write(this.blocksRead); + if (this.maxDocvalueFieldsSearch != null) { + generator.writeKey("max_docvalue_fields_search"); + generator.write(this.maxDocvalueFieldsSearch); } - if (this.blocksWrite != null) { - generator.writeKey("blocks.write"); - generator.write(this.blocksWrite); + if (this.maxInnerResultWindow != null) { + generator.writeKey("max_inner_result_window"); + generator.write(this.maxInnerResultWindow); } - if (this.blocksMetadata != null) { - generator.writeKey("blocks.metadata"); - generator.write(this.blocksMetadata); + if (this.maxNgramDiff != null) { + generator.writeKey("max_ngram_diff"); + generator.write(this.maxNgramDiff); } + if (this.maxRefreshListeners != null) { generator.writeKey("max_refresh_listeners"); generator.write(this.maxRefreshListeners); + } + if (this.maxRegexLength != null) { + generator.writeKey("max_regex_length"); + generator.write(this.maxRegexLength); } - if (this.analyzeMaxTokenCount != null) { - generator.writeKey("analyze.max_token_count"); - generator.write(this.analyzeMaxTokenCount); + if (this.maxRescoreWindow != null) { + generator.writeKey("max_rescore_window"); + generator.write(this.maxRescoreWindow); } - if (this.highlightMaxAnalyzedOffset != null) { - generator.writeKey("highlight.max_analyzed_offset"); - generator.write(this.highlightMaxAnalyzedOffset); + if (this.maxResultWindow != null) { + generator.writeKey("max_result_window"); + generator.write(this.maxResultWindow); + } + + if (this.maxScriptFields != null) { + generator.writeKey("max_script_fields"); + generator.write(this.maxScriptFields); + } + + if (this.maxShingleDiff != null) { + generator.writeKey("max_shingle_diff"); + generator.write(this.maxShingleDiff); + } + + if (this.maxSlicesPerScroll != null) { + generator.writeKey("max_slices_per_scroll"); + generator.write(this.maxSlicesPerScroll); } + if (this.maxTermsCount != null) { generator.writeKey("max_terms_count"); generator.write(this.maxTermsCount); - } - if (this.maxRegexLength != null) { - generator.writeKey("max_regex_length"); - generator.write(this.maxRegexLength); + if (this.merge != null) { + generator.writeKey("merge"); + this.merge.serialize(generator, mapper); } - if (this.routing != null) { - generator.writeKey("routing"); - this.routing.serialize(generator, mapper); + if (this.mergeSchedulerMaxThreadCount != null) { + generator.writeKey("merge.scheduler.max_thread_count"); + generator.write(this.mergeSchedulerMaxThreadCount); } - if (this.gcDeletes != null) { - generator.writeKey("gc_deletes"); - this.gcDeletes.serialize(generator, mapper); + if (this.mode != null) { + generator.writeKey("mode"); + generator.write(this.mode); } - if (this.defaultPipeline != null) { - generator.writeKey("default_pipeline"); - generator.write(this.defaultPipeline); + if (this.numberOfReplicas != null) { + generator.writeKey("number_of_replicas"); + generator.write(this.numberOfReplicas); } - if (this.finalPipeline != null) { - generator.writeKey("final_pipeline"); - generator.write(this.finalPipeline); + if (this.numberOfRoutingShards != null) { + generator.writeKey("number_of_routing_shards"); + generator.write(this.numberOfRoutingShards); } - if (this.lifecycleName != null) { - generator.writeKey("lifecycle.name"); - generator.write(this.lifecycleName); + if (this.numberOfShards != null) { + generator.writeKey("number_of_shards"); + generator.write(this.numberOfShards); + } + if (this.priority != null) { + generator.writeKey("priority"); + generator.write(this.priority); } + if (this.providedName != null) { generator.writeKey("provided_name"); generator.write(this.providedName); + } + if (this.queries != null) { + generator.writeKey("queries"); + this.queries.serialize(generator, mapper); } - if (this.creationDate != null) { - generator.writeKey("creation_date"); - generator.write(this.creationDate); + if (this.queryString != null) { + generator.writeKey("query_string"); + this.queryString.serialize(generator, mapper); } - if (this.uuid != null) { - generator.writeKey("uuid"); - generator.write(this.uuid); + if (this.queryStringLenient != null) { + generator.writeKey("query_string.lenient"); + generator.write(this.queryStringLenient); } - if (this.version != null) { - generator.writeKey("version"); - this.version.serialize(generator, mapper); + if (this.refreshInterval != null) { + generator.writeKey("refresh_interval"); + this.refreshInterval.serialize(generator, mapper); + } + + if (this.routing != null) { + generator.writeKey("routing"); + this.routing.serialize(generator, mapper); } - if (this.verifiedBeforeClose != null) { - generator.writeKey("verified_before_close"); - generator.write(this.verifiedBeforeClose); + if (this.routingPartitionSize != null) { + generator.writeKey("routing_partition_size"); + generator.write(this.routingPartitionSize); } - if (this.format != null) { - generator.writeKey("format"); - generator.write(this.format); + if (ApiTypeHelper.isDefined(this.routingPath)) { + generator.writeKey("routing_path"); + generator.writeStartArray(); + for (String item0 : this.routingPath) { + generator.write(item0); + } + generator.writeEnd(); } - if (this.maxSlicesPerScroll != null) { - generator.writeKey("max_slices_per_scroll"); - generator.write(this.maxSlicesPerScroll); + if (this.search != null) { + generator.writeKey("search"); + this.search.serialize(generator, mapper); } - if (this.translog != null) { - generator.writeKey("translog"); - this.translog.serialize(generator, mapper); + if (this.searchIdleAfter != null) { + generator.writeKey("search.idle.after"); + this.searchIdleAfter.serialize(generator, mapper); } - if (this.queryStringLenient != null) { - generator.writeKey("query_string.lenient"); - generator.write(this.queryStringLenient); + if (this.settings != null) { + generator.writeKey("settings"); + this.settings.serialize(generator, mapper); } - if (this.priority != null) { - generator.writeKey("priority"); - generator.write(this.priority); + if (this.similarity != null) { + generator.writeKey("similarity"); + this.similarity.serialize(generator, mapper); } - if (this.topMetricsMaxSize != null) { - generator.writeKey("top_metrics_max_size"); - generator.write(this.topMetricsMaxSize); + if (this.softDeletes != null) { + generator.writeKey("soft_deletes"); + this.softDeletes.serialize(generator, mapper); } - if (this.analysis != null) { - generator.writeKey("analysis"); - this.analysis.serialize(generator, mapper); + if (this.softDeletesRetentionLeasePeriod != null) { + generator.writeKey("soft_deletes.retention_lease.period"); + this.softDeletesRetentionLeasePeriod.serialize(generator, mapper); } - if (this.settings != null) { - generator.writeKey("settings"); - this.settings.serialize(generator, mapper); + if (this.sort != null) { + generator.writeKey("sort"); + this.sort.serialize(generator, mapper); } - if (this.mapping != null) { - generator.writeKey("mapping"); - this.mapping.serialize(generator, mapper); + if (this.store != null) { + generator.writeKey("store"); + this.store.serialize(generator, mapper); } - if (this.indexing != null) { - generator.writeKey("indexing"); - this.indexing.serialize(generator, mapper); + if (this.topMetricsMaxSize != null) { + generator.writeKey("top_metrics_max_size"); + generator.write(this.topMetricsMaxSize); } - if (this.search != null) { - generator.writeKey("search"); - this.search.serialize(generator, mapper); + if (this.translog != null) { + generator.writeKey("translog"); + this.translog.serialize(generator, mapper); } - if (this.knn != null) { - generator.writeKey("knn"); - generator.write(this.knn); + if (this.translogDurability != null) { + generator.writeKey("translog.durability"); + this.translogDurability.serialize(generator, mapper); + } + + if (this.translogFlushThresholdSize != null) { + generator.writeKey("translog.flush_threshold_size"); + generator.write(this.translogFlushThresholdSize); + } + + if (this.uuid != null) { + generator.writeKey("uuid"); + generator.write(this.uuid); } - if (this.knnAlgoParamEfSearch != null) { - generator.writeKey("knn.algo_param.ef_search"); - generator.write(this.knnAlgoParamEfSearch); + if (this.verifiedBeforeClose != null) { + generator.writeKey("verified_before_close"); + generator.write(this.verifiedBeforeClose); } + if (this.version != null) { + generator.writeKey("version"); + this.version.serialize(generator, mapper); + } } // --------------------------------------------------------------------------------------------- + @Override + @Nonnull + public Builder toBuilder() { + return new Builder(this); + } + + @Nonnull + public static Builder builder() { + return new Builder(); + } + /** * Builder for {@link IndexSettings}. */ - - public static class Builder extends ObjectBuilderBase implements ObjectBuilder, PlainDeserializable { + public static class Builder extends ObjectBuilderBase implements CopyableBuilder { @Nullable - private IndexSettings index; - + private IndexSettingsAnalysis analysis; @Nullable - private String mode; - + private IndexSettingsAnalyze analyze; @Nullable - private List routingPath; - + private Integer analyzeMaxTokenCount; @Nullable - private SoftDeletes softDeletes; - + private String autoExpandReplicas; @Nullable - private IndexSegmentSort sort; - + private IndexSettingBlocks blocks; @Nullable - private String numberOfShards; - + private Boolean blocksMetadata; @Nullable - private String numberOfReplicas; - + private Boolean blocksRead; @Nullable - private Integer numberOfRoutingShards; - + private Boolean blocksReadOnly; + @Nullable + private Boolean blocksReadOnlyAllowDelete; + @Nullable + private Boolean blocksWrite; @Nullable private IndexCheckOnStartup checkOnStartup; - @Nullable private String codec; - @Nullable - private Integer routingPartitionSize; - + private IndexSettingsStarTree compositeIndexStarTree; @Nullable - private Time softDeletesRetentionLeasePeriod; - + private Long creationDate; @Nullable - private Boolean loadFixedBitsetFiltersEagerly; - + private String creationDateString; @Nullable - private Boolean hidden; - + private String defaultPipeline; @Nullable - private String autoExpandReplicas; - + private String finalPipeline; @Nullable - private Integer mergeSchedulerMaxThreadCount; - + private String format; @Nullable - private Time searchIdleAfter; - + private Time gcDeletes; @Nullable - private Time refreshInterval; - + private Boolean hidden; @Nullable - private Integer maxResultWindow; - + private IndexSettingsHighlight highlight; @Nullable - private Integer maxInnerResultWindow; - + private Integer highlightMaxAnalyzedOffset; @Nullable - private Integer maxRescoreWindow; - + private IndexSettings index; @Nullable - private Integer maxDocvalueFieldsSearch; - + private IndexSettingsIndexing indexing; @Nullable - private Integer maxScriptFields; - + private IndexingPressure indexingPressure; @Nullable - private Integer maxNgramDiff; - + private Boolean knn; @Nullable - private Integer maxShingleDiff; - + private Integer knnAlgoParamEfSearch; @Nullable - private IndexSettingBlocks blocks; - + private IndexSettingsLifecycle lifecycle; @Nullable - private Boolean blocksReadOnly; - + private String lifecycleName; @Nullable - private Boolean blocksReadOnlyAllowDelete; - + private Boolean loadFixedBitsetFiltersEagerly; @Nullable - private Boolean blocksRead; - + private IndexSettingsMapping mapping; @Nullable - private Boolean blocksWrite; - + private Integer maxDocvalueFieldsSearch; @Nullable - private Boolean blocksMetadata; - + private Integer maxInnerResultWindow; + @Nullable + private Integer maxNgramDiff; @Nullable private Integer maxRefreshListeners; - @Nullable - private Integer analyzeMaxTokenCount; - + private Integer maxRegexLength; @Nullable - private Integer highlightMaxAnalyzedOffset; - + private Integer maxRescoreWindow; + @Nullable + private Integer maxResultWindow; + @Nullable + private Integer maxScriptFields; + @Nullable + private Integer maxShingleDiff; + @Nullable + private Integer maxSlicesPerScroll; @Nullable private Integer maxTermsCount; - @Nullable - private Integer maxRegexLength; - + private IndexSettingsMerge merge; @Nullable - private IndexRouting routing; - + private Integer mergeSchedulerMaxThreadCount; @Nullable - private Time gcDeletes; - + private String mode; @Nullable - private String defaultPipeline; - + private Integer numberOfReplicas; @Nullable - private String finalPipeline; - + private Integer numberOfRoutingShards; @Nullable - private String lifecycleName; - + private Integer numberOfShards; + @Nullable + private String priority; @Nullable private String providedName; - @Nullable - private String creationDate; - + private IndexSettingsQueries queries; @Nullable - private String uuid; - + private IndexSettingsQueryString queryString; @Nullable - private IndexVersioning version; - + private Boolean queryStringLenient; @Nullable - private Boolean verifiedBeforeClose; - + private Time refreshInterval; @Nullable - private String format; - + private IndexRouting routing; @Nullable - private Integer maxSlicesPerScroll; - + private Integer routingPartitionSize; @Nullable - private Translog translog; - + private List routingPath; @Nullable - private Boolean queryStringLenient; - + private IndexSettingsSearch search; @Nullable - private String priority; - + private Time searchIdleAfter; + @Nullable + private IndexSettings settings; + @Nullable + private IndexSettingsSimilarity similarity; + @Nullable + private SoftDeletes softDeletes; + @Nullable + private Time softDeletesRetentionLeasePeriod; + @Nullable + private IndexSegmentSort sort; + @Nullable + private IndexSettingsStore store; @Nullable private Integer topMetricsMaxSize; - @Nullable - private IndexSettingsAnalysis analysis; - + private Translog translog; @Nullable - private IndexSettings settings; - + private TranslogDurability translogDurability; @Nullable - private IndexSettingsMapping mapping; - + private String translogFlushThresholdSize; @Nullable - private IndexSettingsIndexing indexing; - + private String uuid; @Nullable - private IndexSettingsSearch search; - + private Boolean verifiedBeforeClose; @Nullable - private Boolean knn; - + private IndexVersioning version; @Nullable - private Integer knnAlgoParamEfSearch; + private Map customSettings; + + public Builder() {} + + private Builder(IndexSettings o) { + this.analysis = o.analysis; + this.analyze = o.analyze; + this.analyzeMaxTokenCount = o.analyzeMaxTokenCount; + this.autoExpandReplicas = o.autoExpandReplicas; + this.blocks = o.blocks; + this.blocksMetadata = o.blocksMetadata; + this.blocksRead = o.blocksRead; + this.blocksReadOnly = o.blocksReadOnly; + this.blocksReadOnlyAllowDelete = o.blocksReadOnlyAllowDelete; + this.blocksWrite = o.blocksWrite; + this.checkOnStartup = o.checkOnStartup; + this.codec = o.codec; + this.compositeIndexStarTree = o.compositeIndexStarTree; + this.creationDate = o.creationDate; + this.creationDateString = o.creationDateString; + this.defaultPipeline = o.defaultPipeline; + this.finalPipeline = o.finalPipeline; + this.format = o.format; + this.gcDeletes = o.gcDeletes; + this.hidden = o.hidden; + this.highlight = o.highlight; + this.highlightMaxAnalyzedOffset = o.highlightMaxAnalyzedOffset; + this.index = o.index; + this.indexing = o.indexing; + this.indexingPressure = o.indexingPressure; + this.knn = o.knn; + this.knnAlgoParamEfSearch = o.knnAlgoParamEfSearch; + this.lifecycle = o.lifecycle; + this.lifecycleName = o.lifecycleName; + this.loadFixedBitsetFiltersEagerly = o.loadFixedBitsetFiltersEagerly; + this.mapping = o.mapping; + this.maxDocvalueFieldsSearch = o.maxDocvalueFieldsSearch; + this.maxInnerResultWindow = o.maxInnerResultWindow; + this.maxNgramDiff = o.maxNgramDiff; + this.maxRefreshListeners = o.maxRefreshListeners; + this.maxRegexLength = o.maxRegexLength; + this.maxRescoreWindow = o.maxRescoreWindow; + this.maxResultWindow = o.maxResultWindow; + this.maxScriptFields = o.maxScriptFields; + this.maxShingleDiff = o.maxShingleDiff; + this.maxSlicesPerScroll = o.maxSlicesPerScroll; + this.maxTermsCount = o.maxTermsCount; + this.merge = o.merge; + this.mergeSchedulerMaxThreadCount = o.mergeSchedulerMaxThreadCount; + this.mode = o.mode; + this.numberOfReplicas = o.numberOfReplicas; + this.numberOfRoutingShards = o.numberOfRoutingShards; + this.numberOfShards = o.numberOfShards; + this.priority = o.priority; + this.providedName = o.providedName; + this.queries = o.queries; + this.queryString = o.queryString; + this.queryStringLenient = o.queryStringLenient; + this.refreshInterval = o.refreshInterval; + this.routing = o.routing; + this.routingPartitionSize = o.routingPartitionSize; + this.routingPath = _listCopy(o.routingPath); + this.search = o.search; + this.searchIdleAfter = o.searchIdleAfter; + this.settings = o.settings; + this.similarity = o.similarity; + this.softDeletes = o.softDeletes; + this.softDeletesRetentionLeasePeriod = o.softDeletesRetentionLeasePeriod; + this.sort = o.sort; + this.store = o.store; + this.topMetricsMaxSize = o.topMetricsMaxSize; + this.translog = o.translog; + this.translogDurability = o.translogDurability; + this.translogFlushThresholdSize = o.translogFlushThresholdSize; + this.uuid = o.uuid; + this.verifiedBeforeClose = o.verifiedBeforeClose; + this.version = o.version; + this.customSettings = _mapCopy(o.customSettings); + } + + private Builder(Builder o) { + this.analysis = o.analysis; + this.analyze = o.analyze; + this.analyzeMaxTokenCount = o.analyzeMaxTokenCount; + this.autoExpandReplicas = o.autoExpandReplicas; + this.blocks = o.blocks; + this.blocksMetadata = o.blocksMetadata; + this.blocksRead = o.blocksRead; + this.blocksReadOnly = o.blocksReadOnly; + this.blocksReadOnlyAllowDelete = o.blocksReadOnlyAllowDelete; + this.blocksWrite = o.blocksWrite; + this.checkOnStartup = o.checkOnStartup; + this.codec = o.codec; + this.compositeIndexStarTree = o.compositeIndexStarTree; + this.creationDate = o.creationDate; + this.creationDateString = o.creationDateString; + this.defaultPipeline = o.defaultPipeline; + this.finalPipeline = o.finalPipeline; + this.format = o.format; + this.gcDeletes = o.gcDeletes; + this.hidden = o.hidden; + this.highlight = o.highlight; + this.highlightMaxAnalyzedOffset = o.highlightMaxAnalyzedOffset; + this.index = o.index; + this.indexing = o.indexing; + this.indexingPressure = o.indexingPressure; + this.knn = o.knn; + this.knnAlgoParamEfSearch = o.knnAlgoParamEfSearch; + this.lifecycle = o.lifecycle; + this.lifecycleName = o.lifecycleName; + this.loadFixedBitsetFiltersEagerly = o.loadFixedBitsetFiltersEagerly; + this.mapping = o.mapping; + this.maxDocvalueFieldsSearch = o.maxDocvalueFieldsSearch; + this.maxInnerResultWindow = o.maxInnerResultWindow; + this.maxNgramDiff = o.maxNgramDiff; + this.maxRefreshListeners = o.maxRefreshListeners; + this.maxRegexLength = o.maxRegexLength; + this.maxRescoreWindow = o.maxRescoreWindow; + this.maxResultWindow = o.maxResultWindow; + this.maxScriptFields = o.maxScriptFields; + this.maxShingleDiff = o.maxShingleDiff; + this.maxSlicesPerScroll = o.maxSlicesPerScroll; + this.maxTermsCount = o.maxTermsCount; + this.merge = o.merge; + this.mergeSchedulerMaxThreadCount = o.mergeSchedulerMaxThreadCount; + this.mode = o.mode; + this.numberOfReplicas = o.numberOfReplicas; + this.numberOfRoutingShards = o.numberOfRoutingShards; + this.numberOfShards = o.numberOfShards; + this.priority = o.priority; + this.providedName = o.providedName; + this.queries = o.queries; + this.queryString = o.queryString; + this.queryStringLenient = o.queryStringLenient; + this.refreshInterval = o.refreshInterval; + this.routing = o.routing; + this.routingPartitionSize = o.routingPartitionSize; + this.routingPath = _listCopy(o.routingPath); + this.search = o.search; + this.searchIdleAfter = o.searchIdleAfter; + this.settings = o.settings; + this.similarity = o.similarity; + this.softDeletes = o.softDeletes; + this.softDeletesRetentionLeasePeriod = o.softDeletesRetentionLeasePeriod; + this.sort = o.sort; + this.store = o.store; + this.topMetricsMaxSize = o.topMetricsMaxSize; + this.translog = o.translog; + this.translogDurability = o.translogDurability; + this.translogFlushThresholdSize = o.translogFlushThresholdSize; + this.uuid = o.uuid; + this.verifiedBeforeClose = o.verifiedBeforeClose; + this.version = o.version; + this.customSettings = _mapCopy(o.customSettings); + } + + @Override + @Nonnull + public Builder copy() { + return new Builder(this); + } /** - * API name: {@code index} + * API name: {@code analysis} */ - public final Builder index(@Nullable IndexSettings value) { - this.index = value; + @Nonnull + public final Builder analysis(@Nullable IndexSettingsAnalysis value) { + this.analysis = value; return this; } /** - * API name: {@code index} + * API name: {@code analysis} */ - public final Builder index(Function> fn) { - return this.index(fn.apply(new IndexSettings.Builder()).build()); + @Nonnull + public final Builder analysis(Function> fn) { + return analysis(fn.apply(new IndexSettingsAnalysis.Builder()).build()); } /** - * API name: {@code mode} + * API name: {@code analyze} */ - public final Builder mode(@Nullable String value) { - this.mode = value; + @Nonnull + public final Builder analyze(@Nullable IndexSettingsAnalyze value) { + this.analyze = value; return this; } /** - * API name: {@code routing_path} - *

- * Adds all elements of list to routingPath. + * API name: {@code analyze} */ - public final Builder routingPath(List list) { - this.routingPath = _listAddAll(this.routingPath, list); + @Nonnull + public final Builder analyze(Function> fn) { + return analyze(fn.apply(new IndexSettingsAnalyze.Builder()).build()); + } + + /** + * API name: {@code analyze.max_token_count} + */ + @Nonnull + public final Builder analyzeMaxTokenCount(@Nullable Integer value) { + this.analyzeMaxTokenCount = value; return this; } /** - * API name: {@code routing_path} - *

- * Adds one or more values to routingPath. + * API name: {@code auto_expand_replicas} */ - public final Builder routingPath(String value, String... values) { - this.routingPath = _listAdd(this.routingPath, value, values); + @Nonnull + public final Builder autoExpandReplicas(@Nullable String value) { + this.autoExpandReplicas = value; return this; } /** - * API name: {@code soft_deletes} + * API name: {@code blocks} */ - public final Builder softDeletes(@Nullable SoftDeletes value) { - this.softDeletes = value; + @Nonnull + public final Builder blocks(@Nullable IndexSettingBlocks value) { + this.blocks = value; return this; } /** - * API name: {@code soft_deletes} + * API name: {@code blocks} */ - public final Builder softDeletes(Function> fn) { - return this.softDeletes(fn.apply(new SoftDeletes.Builder()).build()); + @Nonnull + public final Builder blocks(Function> fn) { + return blocks(fn.apply(new IndexSettingBlocks.Builder()).build()); } /** - * API name: {@code sort} + * API name: {@code blocks.metadata} */ - public final Builder sort(@Nullable IndexSegmentSort value) { - this.sort = value; + @Nonnull + public final Builder blocksMetadata(@Nullable Boolean value) { + this.blocksMetadata = value; return this; } /** - * API name: {@code sort} + * API name: {@code blocks.read} */ - public final Builder sort(Function> fn) { - return this.sort(fn.apply(new IndexSegmentSort.Builder()).build()); + @Nonnull + public final Builder blocksRead(@Nullable Boolean value) { + this.blocksRead = value; + return this; } /** - * API name: {@code number_of_shards} + * API name: {@code blocks.read_only} */ - public final Builder numberOfShards(@Nullable String value) { - this.numberOfShards = value; + @Nonnull + public final Builder blocksReadOnly(@Nullable Boolean value) { + this.blocksReadOnly = value; return this; } /** - * API name: {@code number_of_replicas} + * API name: {@code blocks.read_only_allow_delete} */ - public final Builder numberOfReplicas(@Nullable String value) { - this.numberOfReplicas = value; + @Nonnull + public final Builder blocksReadOnlyAllowDelete(@Nullable Boolean value) { + this.blocksReadOnlyAllowDelete = value; return this; } /** - * API name: {@code number_of_routing_shards} + * API name: {@code blocks.write} */ - public final Builder numberOfRoutingShards(@Nullable Integer value) { - this.numberOfRoutingShards = value; + @Nonnull + public final Builder blocksWrite(@Nullable Boolean value) { + this.blocksWrite = value; return this; } /** * API name: {@code check_on_startup} */ + @Nonnull public final Builder checkOnStartup(@Nullable IndexCheckOnStartup value) { this.checkOnStartup = value; return this; @@ -1395,250 +1782,490 @@ public final Builder checkOnStartup(@Nullable IndexCheckOnStartup value) { /** * API name: {@code codec} */ + @Nonnull public final Builder codec(@Nullable String value) { this.codec = value; return this; } /** - * API name: {@code routing_partition_size} + * API name: {@code composite_index.star_tree} + */ + @Nonnull + public final Builder compositeIndexStarTree(@Nullable IndexSettingsStarTree value) { + this.compositeIndexStarTree = value; + return this; + } + + /** + * API name: {@code composite_index.star_tree} + */ + @Nonnull + public final Builder compositeIndexStarTree(Function> fn) { + return compositeIndexStarTree(fn.apply(new IndexSettingsStarTree.Builder()).build()); + } + + /** + * API name: {@code creation_date} + */ + @Nonnull + public final Builder creationDate(@Nullable Long value) { + this.creationDate = value; + return this; + } + + /** + * API name: {@code creation_date_string} + */ + @Nonnull + public final Builder creationDateString(@Nullable String value) { + this.creationDateString = value; + return this; + } + + /** + * API name: {@code default_pipeline} + */ + @Nonnull + public final Builder defaultPipeline(@Nullable String value) { + this.defaultPipeline = value; + return this; + } + + /** + * API name: {@code final_pipeline} + */ + @Nonnull + public final Builder finalPipeline(@Nullable String value) { + this.finalPipeline = value; + return this; + } + + /** + * API name: {@code format} + */ + @Nonnull + public final Builder format(@Nullable String value) { + this.format = value; + return this; + } + + /** + * API name: {@code gc_deletes} + */ + @Nonnull + public final Builder gcDeletes(@Nullable Time value) { + this.gcDeletes = value; + return this; + } + + /** + * API name: {@code gc_deletes} + */ + @Nonnull + public final Builder gcDeletes(Function> fn) { + return gcDeletes(fn.apply(new Time.Builder()).build()); + } + + /** + * API name: {@code hidden} + */ + @Nonnull + public final Builder hidden(@Nullable Boolean value) { + this.hidden = value; + return this; + } + + /** + * API name: {@code highlight} + */ + @Nonnull + public final Builder highlight(@Nullable IndexSettingsHighlight value) { + this.highlight = value; + return this; + } + + /** + * API name: {@code highlight} + */ + @Nonnull + public final Builder highlight(Function> fn) { + return highlight(fn.apply(new IndexSettingsHighlight.Builder()).build()); + } + + /** + * API name: {@code highlight.max_analyzed_offset} + */ + @Nonnull + public final Builder highlightMaxAnalyzedOffset(@Nullable Integer value) { + this.highlightMaxAnalyzedOffset = value; + return this; + } + + /** + * API name: {@code index} + */ + @Nonnull + public final Builder index(@Nullable IndexSettings value) { + this.index = value; + return this; + } + + /** + * API name: {@code index} + */ + @Nonnull + public final Builder index(Function> fn) { + return index(fn.apply(new IndexSettings.Builder()).build()); + } + + /** + * API name: {@code indexing} + */ + @Nonnull + public final Builder indexing(@Nullable IndexSettingsIndexing value) { + this.indexing = value; + return this; + } + + /** + * API name: {@code indexing} + */ + @Nonnull + public final Builder indexing(Function> fn) { + return indexing(fn.apply(new IndexSettingsIndexing.Builder()).build()); + } + + /** + * API name: {@code indexing_pressure} + */ + @Nonnull + public final Builder indexingPressure(@Nullable IndexingPressure value) { + this.indexingPressure = value; + return this; + } + + /** + * API name: {@code indexing_pressure} + */ + @Nonnull + public final Builder indexingPressure(Function> fn) { + return indexingPressure(fn.apply(new IndexingPressure.Builder()).build()); + } + + /** + * API name: {@code knn} + */ + @Nonnull + public final Builder knn(@Nullable Boolean value) { + this.knn = value; + return this; + } + + /** + * API name: {@code knn.algo_param.ef_search} + */ + @Nonnull + public final Builder knnAlgoParamEfSearch(@Nullable Integer value) { + this.knnAlgoParamEfSearch = value; + return this; + } + + /** + * API name: {@code lifecycle} */ - public final Builder routingPartitionSize(@Nullable Integer value) { - this.routingPartitionSize = value; + @Nonnull + public final Builder lifecycle(@Nullable IndexSettingsLifecycle value) { + this.lifecycle = value; return this; } /** - * API name: {@code soft_deletes.retention_lease.period} + * API name: {@code lifecycle} */ - public final Builder softDeletesRetentionLeasePeriod(@Nullable Time value) { - this.softDeletesRetentionLeasePeriod = value; - return this; + @Nonnull + public final Builder lifecycle(Function> fn) { + return lifecycle(fn.apply(new IndexSettingsLifecycle.Builder()).build()); } /** - * API name: {@code soft_deletes.retention_lease.period} + * API name: {@code lifecycle.name} */ - public final Builder softDeletesRetentionLeasePeriod(Function> fn) { - return this.softDeletesRetentionLeasePeriod(fn.apply(new Time.Builder()).build()); + @Nonnull + public final Builder lifecycleName(@Nullable String value) { + this.lifecycleName = value; + return this; } /** * API name: {@code load_fixed_bitset_filters_eagerly} */ + @Nonnull public final Builder loadFixedBitsetFiltersEagerly(@Nullable Boolean value) { this.loadFixedBitsetFiltersEagerly = value; return this; } /** - * API name: {@code hidden} + * API name: {@code mapping} */ - public final Builder hidden(@Nullable Boolean value) { - this.hidden = value; + @Nonnull + public final Builder mapping(@Nullable IndexSettingsMapping value) { + this.mapping = value; return this; } /** - * API name: {@code auto_expand_replicas} + * API name: {@code mapping} */ - public final Builder autoExpandReplicas(@Nullable String value) { - this.autoExpandReplicas = value; + @Nonnull + public final Builder mapping(Function> fn) { + return mapping(fn.apply(new IndexSettingsMapping.Builder()).build()); + } + + /** + * API name: {@code max_docvalue_fields_search} + */ + @Nonnull + public final Builder maxDocvalueFieldsSearch(@Nullable Integer value) { + this.maxDocvalueFieldsSearch = value; return this; } /** - * API name: {@code merge.scheduler.max_thread_count} + * API name: {@code max_inner_result_window} */ - public final Builder mergeSchedulerMaxThreadCount(@Nullable Integer value) { - this.mergeSchedulerMaxThreadCount = value; + @Nonnull + public final Builder maxInnerResultWindow(@Nullable Integer value) { + this.maxInnerResultWindow = value; return this; } /** - * API name: {@code search.idle.after} + * API name: {@code max_ngram_diff} */ - public final Builder searchIdleAfter(@Nullable Time value) { - this.searchIdleAfter = value; + @Nonnull + public final Builder maxNgramDiff(@Nullable Integer value) { + this.maxNgramDiff = value; return this; } /** - * API name: {@code search.idle.after} + * API name: {@code max_refresh_listeners} */ - public final Builder searchIdleAfter(Function> fn) { - return this.searchIdleAfter(fn.apply(new Time.Builder()).build()); + @Nonnull + public final Builder maxRefreshListeners(@Nullable Integer value) { + this.maxRefreshListeners = value; + return this; } /** - * API name: {@code refresh_interval} + * API name: {@code max_regex_length} */ - public final Builder refreshInterval(@Nullable Time value) { - this.refreshInterval = value; + @Nonnull + public final Builder maxRegexLength(@Nullable Integer value) { + this.maxRegexLength = value; return this; } /** - * API name: {@code refresh_interval} + * API name: {@code max_rescore_window} */ - public final Builder refreshInterval(Function> fn) { - return this.refreshInterval(fn.apply(new Time.Builder()).build()); + @Nonnull + public final Builder maxRescoreWindow(@Nullable Integer value) { + this.maxRescoreWindow = value; + return this; } /** * API name: {@code max_result_window} */ + @Nonnull public final Builder maxResultWindow(@Nullable Integer value) { this.maxResultWindow = value; return this; } /** - * API name: {@code max_inner_result_window} + * API name: {@code max_script_fields} */ - public final Builder maxInnerResultWindow(@Nullable Integer value) { - this.maxInnerResultWindow = value; + @Nonnull + public final Builder maxScriptFields(@Nullable Integer value) { + this.maxScriptFields = value; return this; } /** - * API name: {@code max_rescore_window} + * API name: {@code max_shingle_diff} */ - public final Builder maxRescoreWindow(@Nullable Integer value) { - this.maxRescoreWindow = value; + @Nonnull + public final Builder maxShingleDiff(@Nullable Integer value) { + this.maxShingleDiff = value; return this; } /** - * API name: {@code max_docvalue_fields_search} + * API name: {@code max_slices_per_scroll} */ - public final Builder maxDocvalueFieldsSearch(@Nullable Integer value) { - this.maxDocvalueFieldsSearch = value; + @Nonnull + public final Builder maxSlicesPerScroll(@Nullable Integer value) { + this.maxSlicesPerScroll = value; return this; } /** - * API name: {@code max_script_fields} + * API name: {@code max_terms_count} */ - public final Builder maxScriptFields(@Nullable Integer value) { - this.maxScriptFields = value; + @Nonnull + public final Builder maxTermsCount(@Nullable Integer value) { + this.maxTermsCount = value; return this; } /** - * API name: {@code max_ngram_diff} + * API name: {@code merge} */ - public final Builder maxNgramDiff(@Nullable Integer value) { - this.maxNgramDiff = value; + @Nonnull + public final Builder merge(@Nullable IndexSettingsMerge value) { + this.merge = value; return this; } /** - * API name: {@code max_shingle_diff} + * API name: {@code merge} */ - public final Builder maxShingleDiff(@Nullable Integer value) { - this.maxShingleDiff = value; - return this; + @Nonnull + public final Builder merge(Function> fn) { + return merge(fn.apply(new IndexSettingsMerge.Builder()).build()); } /** - * API name: {@code blocks} + * API name: {@code merge.scheduler.max_thread_count} */ - public final Builder blocks(@Nullable IndexSettingBlocks value) { - this.blocks = value; + @Nonnull + public final Builder mergeSchedulerMaxThreadCount(@Nullable Integer value) { + this.mergeSchedulerMaxThreadCount = value; return this; } /** - * API name: {@code blocks} + * API name: {@code mode} */ - public final Builder blocks(Function> fn) { - return this.blocks(fn.apply(new IndexSettingBlocks.Builder()).build()); + @Nonnull + public final Builder mode(@Nullable String value) { + this.mode = value; + return this; } /** - * API name: {@code blocks.read_only} + * API name: {@code number_of_replicas} */ - public final Builder blocksReadOnly(@Nullable Boolean value) { - this.blocksReadOnly = value; + @Nonnull + public final Builder numberOfReplicas(@Nullable Integer value) { + this.numberOfReplicas = value; return this; } /** - * API name: {@code blocks.read_only_allow_delete} + * API name: {@code number_of_routing_shards} */ - public final Builder blocksReadOnlyAllowDelete(@Nullable Boolean value) { - this.blocksReadOnlyAllowDelete = value; + @Nonnull + public final Builder numberOfRoutingShards(@Nullable Integer value) { + this.numberOfRoutingShards = value; return this; } /** - * API name: {@code blocks.read} + * API name: {@code number_of_shards} */ - public final Builder blocksRead(@Nullable Boolean value) { - this.blocksRead = value; + @Nonnull + public final Builder numberOfShards(@Nullable Integer value) { + this.numberOfShards = value; return this; } /** - * API name: {@code blocks.write} + * API name: {@code priority} */ - public final Builder blocksWrite(@Nullable Boolean value) { - this.blocksWrite = value; + @Nonnull + public final Builder priority(@Nullable String value) { + this.priority = value; return this; } /** - * API name: {@code blocks.metadata} + * API name: {@code provided_name} */ - public final Builder blocksMetadata(@Nullable Boolean value) { - this.blocksMetadata = value; + @Nonnull + public final Builder providedName(@Nullable String value) { + this.providedName = value; return this; } /** - * API name: {@code max_refresh_listeners} + * API name: {@code queries} */ - public final Builder maxRefreshListeners(@Nullable Integer value) { - this.maxRefreshListeners = value; + @Nonnull + public final Builder queries(@Nullable IndexSettingsQueries value) { + this.queries = value; return this; } /** - * API name: {@code analyze.max_token_count} + * API name: {@code queries} */ - public final Builder analyzeMaxTokenCount(@Nullable Integer value) { - this.analyzeMaxTokenCount = value; - return this; + @Nonnull + public final Builder queries(Function> fn) { + return queries(fn.apply(new IndexSettingsQueries.Builder()).build()); } /** - * API name: {@code highlight.max_analyzed_offset} + * API name: {@code query_string} */ - public final Builder highlightMaxAnalyzedOffset(@Nullable Integer value) { - this.highlightMaxAnalyzedOffset = value; + @Nonnull + public final Builder queryString(@Nullable IndexSettingsQueryString value) { + this.queryString = value; return this; } /** - * API name: {@code max_terms_count} + * API name: {@code query_string} */ - public final Builder maxTermsCount(@Nullable Integer value) { - this.maxTermsCount = value; + @Nonnull + public final Builder queryString(Function> fn) { + return queryString(fn.apply(new IndexSettingsQueryString.Builder()).build()); + } + + /** + * API name: {@code query_string.lenient} + */ + @Nonnull + public final Builder queryStringLenient(@Nullable Boolean value) { + this.queryStringLenient = value; return this; } /** - * API name: {@code max_regex_length} + * API name: {@code refresh_interval} */ - public final Builder maxRegexLength(@Nullable Integer value) { - this.maxRegexLength = value; + @Nonnull + public final Builder refreshInterval(@Nullable Time value) { + this.refreshInterval = value; return this; } + /** + * API name: {@code refresh_interval} + */ + @Nonnull + public final Builder refreshInterval(Function> fn) { + return refreshInterval(fn.apply(new Time.Builder()).build()); + } + /** * API name: {@code routing} */ + @Nonnull public final Builder routing(@Nullable IndexRouting value) { this.routing = value; return this; @@ -1647,283 +2274,297 @@ public final Builder routing(@Nullable IndexRouting value) { /** * API name: {@code routing} */ + @Nonnull public final Builder routing(Function> fn) { - return this.routing(fn.apply(new IndexRouting.Builder()).build()); + return routing(fn.apply(new IndexRouting.Builder()).build()); } /** - * API name: {@code gc_deletes} + * API name: {@code routing_partition_size} */ - public final Builder gcDeletes(@Nullable Time value) { - this.gcDeletes = value; + @Nonnull + public final Builder routingPartitionSize(@Nullable Integer value) { + this.routingPartitionSize = value; return this; } /** - * API name: {@code gc_deletes} + * API name: {@code routing_path} + * + *

+ * Adds all elements of list to routingPath. + *

*/ - public final Builder gcDeletes(Function> fn) { - return this.gcDeletes(fn.apply(new Time.Builder()).build()); + @Nonnull + public final Builder routingPath(List list) { + this.routingPath = _listAddAll(this.routingPath, list); + return this; } /** - * API name: {@code default_pipeline} + * API name: {@code routing_path} + * + *

+ * Adds one or more values to routingPath. + *

*/ - public final Builder defaultPipeline(@Nullable String value) { - this.defaultPipeline = value; + @Nonnull + public final Builder routingPath(String value, String... values) { + this.routingPath = _listAdd(this.routingPath, value, values); return this; } /** - * API name: {@code final_pipeline} + * API name: {@code search} */ - public final Builder finalPipeline(@Nullable String value) { - this.finalPipeline = value; + @Nonnull + public final Builder search(@Nullable IndexSettingsSearch value) { + this.search = value; return this; } /** - * API name: {@code lifecycle.name} + * API name: {@code search} */ - public final Builder lifecycleName(@Nullable String value) { - this.lifecycleName = value; - return this; + @Nonnull + public final Builder search(Function> fn) { + return search(fn.apply(new IndexSettingsSearch.Builder()).build()); } /** - * API name: {@code provided_name} + * API name: {@code search.idle.after} */ - public final Builder providedName(@Nullable String value) { - this.providedName = value; + @Nonnull + public final Builder searchIdleAfter(@Nullable Time value) { + this.searchIdleAfter = value; return this; } /** - * API name: {@code creation_date} + * API name: {@code search.idle.after} */ - public final Builder creationDate(@Nullable String value) { - this.creationDate = value; - return this; + @Nonnull + public final Builder searchIdleAfter(Function> fn) { + return searchIdleAfter(fn.apply(new Time.Builder()).build()); } /** - * API name: {@code uuid} + * API name: {@code settings} */ - public final Builder uuid(@Nullable String value) { - this.uuid = value; + @Nonnull + public final Builder settings(@Nullable IndexSettings value) { + this.settings = value; return this; } /** - * API name: {@code version} + * API name: {@code settings} */ - public final Builder version(@Nullable IndexVersioning value) { - this.version = value; + @Nonnull + public final Builder settings(Function> fn) { + return settings(fn.apply(new IndexSettings.Builder()).build()); + } + + /** + * API name: {@code similarity} + */ + @Nonnull + public final Builder similarity(@Nullable IndexSettingsSimilarity value) { + this.similarity = value; return this; } /** - * API name: {@code version} + * API name: {@code similarity} */ - public final Builder version(Function> fn) { - return this.version(fn.apply(new IndexVersioning.Builder()).build()); + @Nonnull + public final Builder similarity(Function> fn) { + return similarity(fn.apply(new IndexSettingsSimilarity.Builder()).build()); } /** - * API name: {@code verified_before_close} + * API name: {@code soft_deletes} */ - public final Builder verifiedBeforeClose(@Nullable Boolean value) { - this.verifiedBeforeClose = value; + @Nonnull + public final Builder softDeletes(@Nullable SoftDeletes value) { + this.softDeletes = value; return this; } /** - * API name: {@code format} + * API name: {@code soft_deletes} */ - public final Builder format(@Nullable String value) { - this.format = value; - return this; + @Nonnull + public final Builder softDeletes(Function> fn) { + return softDeletes(fn.apply(new SoftDeletes.Builder()).build()); } /** - * API name: {@code max_slices_per_scroll} + * API name: {@code soft_deletes.retention_lease.period} */ - public final Builder maxSlicesPerScroll(@Nullable Integer value) { - this.maxSlicesPerScroll = value; + @Nonnull + public final Builder softDeletesRetentionLeasePeriod(@Nullable Time value) { + this.softDeletesRetentionLeasePeriod = value; return this; } /** - * API name: {@code translog} + * API name: {@code soft_deletes.retention_lease.period} */ - public final Builder translog(@Nullable Translog value) { - this.translog = value; - return this; + @Nonnull + public final Builder softDeletesRetentionLeasePeriod(Function> fn) { + return softDeletesRetentionLeasePeriod(fn.apply(new Time.Builder()).build()); } /** - * API name: {@code translog.durability} - * @deprecated use {@link #translog()} instead - */ - @Deprecated - public final Builder translogDurability(@Nullable String value) { - if (translog == null) { - translog = Translog.of(b -> b.durability(value)); - } else { - translog = Translog.of( - b -> b.durability(value).flushThresholdSize(translog.flushThresholdSize()).syncInterval(translog.syncInterval()) - ); - } + * API name: {@code sort} + */ + @Nonnull + public final Builder sort(@Nullable IndexSegmentSort value) { + this.sort = value; return this; } /** - * API name: {@code translog.flush_threshold_size} - * @deprecated use {@link #translog()} instead + * API name: {@code sort} */ - @Deprecated - public final Builder translogFlushThresholdSize(@Nullable String value) { - if (translog == null) { - translog = Translog.of(b -> b.flushThresholdSize(value)); - } else { - translog = Translog.of( - b -> b.flushThresholdSize(value).durability(translog.durability()).syncInterval(translog.syncInterval()) - ); - } - return this; + @Nonnull + public final Builder sort(Function> fn) { + return sort(fn.apply(new IndexSegmentSort.Builder()).build()); } /** - * API name: {@code query_string.lenient} + * API name: {@code store} */ - public final Builder queryStringLenient(@Nullable Boolean value) { - this.queryStringLenient = value; + @Nonnull + public final Builder store(@Nullable IndexSettingsStore value) { + this.store = value; return this; } /** - * API name: {@code priority} + * API name: {@code store} */ - public final Builder priority(@Nullable String value) { - this.priority = value; - return this; + @Nonnull + public final Builder store(Function> fn) { + return store(fn.apply(new IndexSettingsStore.Builder()).build()); } /** * API name: {@code top_metrics_max_size} */ + @Nonnull public final Builder topMetricsMaxSize(@Nullable Integer value) { this.topMetricsMaxSize = value; return this; } /** - * API name: {@code analysis} + * API name: {@code translog} */ - public final Builder analysis(@Nullable IndexSettingsAnalysis value) { - this.analysis = value; + @Nonnull + public final Builder translog(@Nullable Translog value) { + this.translog = value; return this; } /** - * API name: {@code analysis} + * API name: {@code translog} */ - public final Builder analysis(Function> fn) { - return this.analysis(fn.apply(new IndexSettingsAnalysis.Builder()).build()); + @Nonnull + public final Builder translog(Function> fn) { + return translog(fn.apply(new Translog.Builder()).build()); } /** - * API name: {@code settings} + * API name: {@code translog.durability} */ - public final Builder settings(@Nullable IndexSettings value) { - this.settings = value; + @Nonnull + public final Builder translogDurability(@Nullable TranslogDurability value) { + this.translogDurability = value; return this; } /** - * API name: {@code settings} + * API name: {@code translog.flush_threshold_size} */ - public final Builder settings(Function> fn) { - return this.settings(fn.apply(new IndexSettings.Builder()).build()); + @Nonnull + public final Builder translogFlushThresholdSize(@Nullable String value) { + this.translogFlushThresholdSize = value; + return this; } /** - * API name: {@code mapping} + * API name: {@code uuid} */ - public final Builder mapping(@Nullable IndexSettingsMapping value) { - this.mapping = value; + @Nonnull + public final Builder uuid(@Nullable String value) { + this.uuid = value; return this; } /** - * API name: {@code mapping} + * API name: {@code verified_before_close} */ - public final Builder mapping(Function> fn) { - return this.mapping(fn.apply(new IndexSettingsMapping.Builder()).build()); + @Nonnull + public final Builder verifiedBeforeClose(@Nullable Boolean value) { + this.verifiedBeforeClose = value; + return this; } /** - * API name: {@code indexing} + * API name: {@code version} */ - public final Builder indexing(@Nullable IndexSettingsIndexing value) { - this.indexing = value; + @Nonnull + public final Builder version(@Nullable IndexVersioning value) { + this.version = value; return this; } /** - * API name: {@code indexing} + * API name: {@code version} */ - public final Builder indexing(Function> fn) { - return this.indexing(fn.apply(new IndexSettingsIndexing.Builder()).build()); + @Nonnull + public final Builder version(Function> fn) { + return version(fn.apply(new IndexVersioning.Builder()).build()); } /** - * API name: {@code search} + * + *

+ * Adds all elements of map to customSettings. + *

*/ - public final Builder search(@Nullable IndexSettingsSearch value) { - this.search = value; + @Nonnull + public final Builder customSettings(Map map) { + this.customSettings = _mapPutAll(this.customSettings, map); return this; } /** - * API name: {@code search} + * + *

+ * Adds an entry to customSettings. + *

*/ - public final Builder search(Function> fn) { - return this.search(fn.apply(new IndexSettingsSearch.Builder()).build()); + @Nonnull + public final Builder customSettings(String key, JsonData value) { + this.customSettings = _mapPut(this.customSettings, key, value); + return this; } /** * Builds a {@link IndexSettings}. * - * @throws NullPointerException - * if some of the required fields are null. + * @throws NullPointerException if some of the required fields are null. */ + @Override + @Nonnull public IndexSettings build() { _checkSingleUse(); return new IndexSettings(this); } - - /** - * API name: {@code knn} - */ - public final Builder knn(@Nullable Boolean value) { - this.knn = value; - return this; - } - - /** - * API name: {@code knn.algo_param.ef_search} - */ - public final Builder knnAlgoParamEfSearch(@Nullable Integer value) { - this.knnAlgoParamEfSearch = value; - return this; - } - - @Override - public Builder self() { - return this; - } } // --------------------------------------------------------------------------------------------- @@ -1937,149 +2578,327 @@ public Builder self() { ); protected static void setupIndexSettingsDeserializer(ObjectDeserializer op) { - - op.add(Builder::index, IndexSettings._DESERIALIZER, "index"); - op.add(Builder::mode, JsonpDeserializer.stringDeserializer(), "mode", "index.mode"); + op.add(Builder::analysis, IndexSettingsAnalysis._DESERIALIZER, "analysis", "index.analysis"); + op.add(Builder::analyze, IndexSettingsAnalyze._DESERIALIZER, "analyze", "index.analyze"); op.add( - Builder::routingPath, - JsonpDeserializer.arrayDeserializer(JsonpDeserializer.stringDeserializer()), - "routing_path", - "index.routing_path" + Builder::analyzeMaxTokenCount, + JsonpDeserializer.integerDeserializer(), + "analyze.max_token_count", + "index.analyze.max_token_count" ); - op.add(Builder::softDeletes, SoftDeletes._DESERIALIZER, "soft_deletes", "index.soft_deletes"); - op.add(Builder::sort, IndexSegmentSort._DESERIALIZER, "sort", "index.sort"); - op.add(Builder::numberOfShards, JsonpDeserializer.stringDeserializer(), "number_of_shards", "index.number_of_shards"); - op.add(Builder::numberOfReplicas, JsonpDeserializer.stringDeserializer(), "number_of_replicas", "index.number_of_replicas"); + op.add(Builder::autoExpandReplicas, JsonpDeserializer.stringDeserializer(), "auto_expand_replicas", "index.auto_expand_replicas"); + op.add(Builder::blocks, IndexSettingBlocks._DESERIALIZER, "blocks", "index.blocks"); + op.add(Builder::blocksMetadata, JsonpDeserializer.booleanDeserializer(), "blocks.metadata", "index.blocks.metadata"); + op.add(Builder::blocksRead, JsonpDeserializer.booleanDeserializer(), "blocks.read", "index.blocks.read"); + op.add(Builder::blocksReadOnly, JsonpDeserializer.booleanDeserializer(), "blocks.read_only", "index.blocks.read_only"); op.add( - Builder::numberOfRoutingShards, - JsonpDeserializer.integerDeserializer(), - "number_of_routing_shards", - "index.number_of_routing_shards" + Builder::blocksReadOnlyAllowDelete, + JsonpDeserializer.booleanDeserializer(), + "blocks.read_only_allow_delete", + "index.blocks.read_only_allow_delete" ); + op.add(Builder::blocksWrite, JsonpDeserializer.booleanDeserializer(), "blocks.write", "index.blocks.write"); op.add(Builder::checkOnStartup, IndexCheckOnStartup._DESERIALIZER, "check_on_startup", "index.check_on_startup"); op.add(Builder::codec, JsonpDeserializer.stringDeserializer(), "codec", "index.codec"); op.add( - Builder::routingPartitionSize, + Builder::compositeIndexStarTree, + IndexSettingsStarTree._DESERIALIZER, + "composite_index.star_tree", + "index.composite_index.star_tree" + ); + op.add(Builder::creationDate, JsonpDeserializer.longDeserializer(), "creation_date", "index.creation_date"); + op.add(Builder::creationDateString, JsonpDeserializer.stringDeserializer(), "creation_date_string", "index.creation_date_string"); + op.add(Builder::defaultPipeline, JsonpDeserializer.stringDeserializer(), "default_pipeline", "index.default_pipeline"); + op.add(Builder::finalPipeline, JsonpDeserializer.stringDeserializer(), "final_pipeline", "index.final_pipeline"); + op.add(Builder::format, JsonpDeserializer.stringDeserializer(), "format", "index.format"); + op.add(Builder::gcDeletes, Time._DESERIALIZER, "gc_deletes", "index.gc_deletes"); + op.add(Builder::hidden, JsonpDeserializer.booleanDeserializer(), "hidden", "index.hidden"); + op.add(Builder::highlight, IndexSettingsHighlight._DESERIALIZER, "highlight", "index.highlight"); + op.add( + Builder::highlightMaxAnalyzedOffset, JsonpDeserializer.integerDeserializer(), - "routing_partition_size", - "index.routing_partition_size" + "highlight.max_analyzed_offset", + "index.highlight.max_analyzed_offset" ); + op.add(Builder::index, IndexSettings._DESERIALIZER, "index"); + op.add(Builder::indexing, IndexSettingsIndexing._DESERIALIZER, "indexing"); + op.add(Builder::indexingPressure, IndexingPressure._DESERIALIZER, "indexing_pressure", "index.indexing_pressure"); + op.add(Builder::knn, JsonpDeserializer.booleanDeserializer(), "knn", "index.knn"); op.add( - Builder::softDeletesRetentionLeasePeriod, - Time._DESERIALIZER, - "soft_deletes.retention_lease.period", - "index.soft_deletes.retention_lease.period" + Builder::knnAlgoParamEfSearch, + JsonpDeserializer.integerDeserializer(), + "knn.algo_param.ef_search", + "index.knn.algo_param.ef_search" ); + op.add(Builder::lifecycle, IndexSettingsLifecycle._DESERIALIZER, "lifecycle", "index.lifecycle"); + op.add(Builder::lifecycleName, JsonpDeserializer.stringDeserializer(), "lifecycle.name", "index.lifecycle.name"); op.add( Builder::loadFixedBitsetFiltersEagerly, JsonpDeserializer.booleanDeserializer(), "load_fixed_bitset_filters_eagerly", "index.load_fixed_bitset_filters_eagerly" ); - op.add(Builder::hidden, JsonpDeserializer.booleanDeserializer(), "hidden", "index.hidden"); - op.add(Builder::autoExpandReplicas, JsonpDeserializer.stringDeserializer(), "auto_expand_replicas", "index.auto_expand_replicas"); + op.add(Builder::mapping, IndexSettingsMapping._DESERIALIZER, "mapping"); op.add( - Builder::mergeSchedulerMaxThreadCount, + Builder::maxDocvalueFieldsSearch, JsonpDeserializer.integerDeserializer(), - "merge.scheduler.max_thread_count", - "index.merge.scheduler.max_thread_count" + "max_docvalue_fields_search", + "index.max_docvalue_fields_search" ); - op.add(Builder::searchIdleAfter, Time._DESERIALIZER, "search.idle.after", "index.search.idle.after"); - op.add(Builder::refreshInterval, Time._DESERIALIZER, "refresh_interval", "index.refresh_interval"); - op.add(Builder::maxResultWindow, JsonpDeserializer.integerDeserializer(), "max_result_window", "index.max_result_window"); op.add( Builder::maxInnerResultWindow, JsonpDeserializer.integerDeserializer(), "max_inner_result_window", "index.max_inner_result_window" ); - op.add(Builder::maxRescoreWindow, JsonpDeserializer.integerDeserializer(), "max_rescore_window", "index.max_rescore_window"); + op.add(Builder::maxNgramDiff, JsonpDeserializer.integerDeserializer(), "max_ngram_diff", "index.max_ngram_diff"); op.add( - Builder::maxDocvalueFieldsSearch, + Builder::maxRefreshListeners, JsonpDeserializer.integerDeserializer(), - "max_docvalue_fields_search", - "index.max_docvalue_fields_search" + "max_refresh_listeners", + "index.max_refresh_listeners" ); + op.add(Builder::maxRegexLength, JsonpDeserializer.integerDeserializer(), "max_regex_length", "index.max_regex_length"); + op.add(Builder::maxRescoreWindow, JsonpDeserializer.integerDeserializer(), "max_rescore_window", "index.max_rescore_window"); + op.add(Builder::maxResultWindow, JsonpDeserializer.integerDeserializer(), "max_result_window", "index.max_result_window"); op.add(Builder::maxScriptFields, JsonpDeserializer.integerDeserializer(), "max_script_fields", "index.max_script_fields"); - op.add(Builder::maxNgramDiff, JsonpDeserializer.integerDeserializer(), "max_ngram_diff", "index.max_ngram_diff"); op.add(Builder::maxShingleDiff, JsonpDeserializer.integerDeserializer(), "max_shingle_diff", "index.max_shingle_diff"); - op.add(Builder::blocks, IndexSettingBlocks._DESERIALIZER, "blocks", "index.blocks"); - op.add(Builder::blocksReadOnly, JsonpDeserializer.booleanDeserializer(), "blocks.read_only", "index.blocks.read_only"); op.add( - Builder::blocksReadOnlyAllowDelete, - JsonpDeserializer.booleanDeserializer(), - "blocks.read_only_allow_delete", - "index.blocks.read_only_allow_delete" + Builder::maxSlicesPerScroll, + JsonpDeserializer.integerDeserializer(), + "max_slices_per_scroll", + "index.max_slices_per_scroll" ); - op.add(Builder::blocksRead, JsonpDeserializer.booleanDeserializer(), "blocks.read", "index.blocks.read"); - op.add(Builder::blocksWrite, JsonpDeserializer.booleanDeserializer(), "blocks.write", "index.blocks.write"); - op.add(Builder::blocksMetadata, JsonpDeserializer.booleanDeserializer(), "blocks.metadata", "index.blocks.metadata"); + op.add(Builder::maxTermsCount, JsonpDeserializer.integerDeserializer(), "max_terms_count", "index.max_terms_count"); + op.add(Builder::merge, IndexSettingsMerge._DESERIALIZER, "merge", "index.merge"); op.add( - Builder::maxRefreshListeners, + Builder::mergeSchedulerMaxThreadCount, JsonpDeserializer.integerDeserializer(), - "max_refresh_listeners", - "index.max_refresh_listeners" + "merge.scheduler.max_thread_count", + "index.merge.scheduler.max_thread_count" ); + op.add(Builder::mode, JsonpDeserializer.stringDeserializer(), "mode", "index.mode"); + op.add(Builder::numberOfReplicas, JsonpDeserializer.integerDeserializer(), "number_of_replicas", "index.number_of_replicas"); op.add( - Builder::analyzeMaxTokenCount, + Builder::numberOfRoutingShards, JsonpDeserializer.integerDeserializer(), - "analyze.max_token_count", - "index.analyze.max_token_count" + "number_of_routing_shards", + "index.number_of_routing_shards" ); + op.add(Builder::numberOfShards, JsonpDeserializer.integerDeserializer(), "number_of_shards", "index.number_of_shards"); + op.add(Builder::priority, JsonpDeserializer.stringDeserializer(), "priority", "index.priority"); + op.add(Builder::providedName, JsonpDeserializer.stringDeserializer(), "provided_name", "index.provided_name"); + op.add(Builder::queries, IndexSettingsQueries._DESERIALIZER, "queries", "index.queries"); + op.add(Builder::queryString, IndexSettingsQueryString._DESERIALIZER, "query_string", "index.query_string"); + op.add(Builder::queryStringLenient, JsonpDeserializer.booleanDeserializer(), "query_string.lenient", "index.query_string.lenient"); + op.add(Builder::refreshInterval, Time._DESERIALIZER, "refresh_interval", "index.refresh_interval"); + op.add(Builder::routing, IndexRouting._DESERIALIZER, "routing", "index.routing"); op.add( - Builder::highlightMaxAnalyzedOffset, + Builder::routingPartitionSize, JsonpDeserializer.integerDeserializer(), - "highlight.max_analyzed_offset", - "index.highlight.max_analyzed_offset" + "routing_partition_size", + "index.routing_partition_size" ); - op.add(Builder::maxTermsCount, JsonpDeserializer.integerDeserializer(), "max_terms_count", "index.max_terms_count"); - op.add(Builder::maxRegexLength, JsonpDeserializer.integerDeserializer(), "max_regex_length", "index.max_regex_length"); - op.add(Builder::routing, IndexRouting._DESERIALIZER, "routing", "index.routing"); - op.add(Builder::gcDeletes, Time._DESERIALIZER, "gc_deletes", "index.gc_deletes"); - op.add(Builder::defaultPipeline, JsonpDeserializer.stringDeserializer(), "default_pipeline", "index.default_pipeline"); - op.add(Builder::finalPipeline, JsonpDeserializer.stringDeserializer(), "final_pipeline", "index.final_pipeline"); - op.add(Builder::lifecycleName, JsonpDeserializer.stringDeserializer(), "lifecycle.name", "index.lifecycle.name"); - op.add(Builder::providedName, JsonpDeserializer.stringDeserializer(), "provided_name", "index.provided_name"); - op.add(Builder::creationDate, JsonpDeserializer.stringDeserializer(), "creation_date", "index.creation_date"); - op.add(Builder::uuid, JsonpDeserializer.stringDeserializer(), "uuid", "index.uuid"); - op.add(Builder::version, IndexVersioning._DESERIALIZER, "version", "index.version"); op.add( - Builder::verifiedBeforeClose, - JsonpDeserializer.booleanDeserializer(), - "verified_before_close", - "index.verified_before_close" + Builder::routingPath, + JsonpDeserializer.arrayDeserializer(JsonpDeserializer.stringDeserializer()), + "routing_path", + "index.routing_path" ); - op.add(Builder::format, JsonpDeserializer.stringDeserializer(), "format", "index.format"); + op.add(Builder::search, IndexSettingsSearch._DESERIALIZER, "search"); + op.add(Builder::searchIdleAfter, Time._DESERIALIZER, "search.idle.after", "index.search.idle.after"); + op.add(Builder::settings, IndexSettings._DESERIALIZER, "settings"); + op.add(Builder::similarity, IndexSettingsSimilarity._DESERIALIZER, "similarity", "index.similarity"); + op.add(Builder::softDeletes, SoftDeletes._DESERIALIZER, "soft_deletes", "index.soft_deletes"); op.add( - Builder::maxSlicesPerScroll, - JsonpDeserializer.integerDeserializer(), - "max_slices_per_scroll", - "index.max_slices_per_scroll" + Builder::softDeletesRetentionLeasePeriod, + Time._DESERIALIZER, + "soft_deletes.retention_lease.period", + "index.soft_deletes.retention_lease.period" ); + op.add(Builder::sort, IndexSegmentSort._DESERIALIZER, "sort", "index.sort"); + op.add(Builder::store, IndexSettingsStore._DESERIALIZER, "store", "index.store"); + op.add(Builder::topMetricsMaxSize, JsonpDeserializer.integerDeserializer(), "top_metrics_max_size"); op.add(Builder::translog, Translog._DESERIALIZER, "translog", "index.translog"); - op.add(Builder::translogDurability, JsonpDeserializer.stringDeserializer(), "translog.durability", "index.translog.durability"); + op.add(Builder::translogDurability, TranslogDurability._DESERIALIZER, "translog.durability", "index.translog.durability"); op.add( Builder::translogFlushThresholdSize, JsonpDeserializer.stringDeserializer(), "translog.flush_threshold_size", "index.translog.flush_threshold_size" ); - op.add(Builder::queryStringLenient, JsonpDeserializer.booleanDeserializer(), "query_string.lenient", "index.query_string.lenient"); - op.add(Builder::priority, JsonpDeserializer.stringDeserializer(), "priority", "index.priority"); - op.add(Builder::topMetricsMaxSize, JsonpDeserializer.integerDeserializer(), "top_metrics_max_size"); - op.add(Builder::analysis, IndexSettingsAnalysis._DESERIALIZER, "analysis", "index.analysis"); - op.add(Builder::settings, IndexSettings._DESERIALIZER, "settings"); - op.add(Builder::mapping, IndexSettingsMapping._DESERIALIZER, "mapping"); - op.add(Builder::indexing, IndexSettingsIndexing._DESERIALIZER, "indexing"); - op.add(Builder::search, IndexSettingsSearch._DESERIALIZER, "search"); - op.add(Builder::knn, JsonpDeserializer.booleanDeserializer(), "knn", "index.knn"); + op.add(Builder::uuid, JsonpDeserializer.stringDeserializer(), "uuid", "index.uuid"); op.add( - Builder::knnAlgoParamEfSearch, - JsonpDeserializer.integerDeserializer(), - "knn.algo_param.ef_search", - "index.knn.algo_param.ef_search" + Builder::verifiedBeforeClose, + JsonpDeserializer.booleanDeserializer(), + "verified_before_close", + "index.verified_before_close" ); - + op.add(Builder::version, IndexVersioning._DESERIALIZER, "version", "index.version"); + op.setUnknownFieldHandler((builder, name, parser, mapper) -> { + if (builder.customSettings == null) { + builder.customSettings = new HashMap<>(); + } + builder.customSettings.put(name, JsonData._DESERIALIZER.deserialize(parser, mapper)); + }); + } + + @Override + public int hashCode() { + int result = 17; + result = 31 * result + Objects.hashCode(this.analysis); + result = 31 * result + Objects.hashCode(this.analyze); + result = 31 * result + Objects.hashCode(this.analyzeMaxTokenCount); + result = 31 * result + Objects.hashCode(this.autoExpandReplicas); + result = 31 * result + Objects.hashCode(this.blocks); + result = 31 * result + Objects.hashCode(this.blocksMetadata); + result = 31 * result + Objects.hashCode(this.blocksRead); + result = 31 * result + Objects.hashCode(this.blocksReadOnly); + result = 31 * result + Objects.hashCode(this.blocksReadOnlyAllowDelete); + result = 31 * result + Objects.hashCode(this.blocksWrite); + result = 31 * result + Objects.hashCode(this.checkOnStartup); + result = 31 * result + Objects.hashCode(this.codec); + result = 31 * result + Objects.hashCode(this.compositeIndexStarTree); + result = 31 * result + Objects.hashCode(this.creationDate); + result = 31 * result + Objects.hashCode(this.creationDateString); + result = 31 * result + Objects.hashCode(this.defaultPipeline); + result = 31 * result + Objects.hashCode(this.finalPipeline); + result = 31 * result + Objects.hashCode(this.format); + result = 31 * result + Objects.hashCode(this.gcDeletes); + result = 31 * result + Objects.hashCode(this.hidden); + result = 31 * result + Objects.hashCode(this.highlight); + result = 31 * result + Objects.hashCode(this.highlightMaxAnalyzedOffset); + result = 31 * result + Objects.hashCode(this.index); + result = 31 * result + Objects.hashCode(this.indexing); + result = 31 * result + Objects.hashCode(this.indexingPressure); + result = 31 * result + Objects.hashCode(this.knn); + result = 31 * result + Objects.hashCode(this.knnAlgoParamEfSearch); + result = 31 * result + Objects.hashCode(this.lifecycle); + result = 31 * result + Objects.hashCode(this.lifecycleName); + result = 31 * result + Objects.hashCode(this.loadFixedBitsetFiltersEagerly); + result = 31 * result + Objects.hashCode(this.mapping); + result = 31 * result + Objects.hashCode(this.maxDocvalueFieldsSearch); + result = 31 * result + Objects.hashCode(this.maxInnerResultWindow); + result = 31 * result + Objects.hashCode(this.maxNgramDiff); + result = 31 * result + Objects.hashCode(this.maxRefreshListeners); + result = 31 * result + Objects.hashCode(this.maxRegexLength); + result = 31 * result + Objects.hashCode(this.maxRescoreWindow); + result = 31 * result + Objects.hashCode(this.maxResultWindow); + result = 31 * result + Objects.hashCode(this.maxScriptFields); + result = 31 * result + Objects.hashCode(this.maxShingleDiff); + result = 31 * result + Objects.hashCode(this.maxSlicesPerScroll); + result = 31 * result + Objects.hashCode(this.maxTermsCount); + result = 31 * result + Objects.hashCode(this.merge); + result = 31 * result + Objects.hashCode(this.mergeSchedulerMaxThreadCount); + result = 31 * result + Objects.hashCode(this.mode); + result = 31 * result + Objects.hashCode(this.numberOfReplicas); + result = 31 * result + Objects.hashCode(this.numberOfRoutingShards); + result = 31 * result + Objects.hashCode(this.numberOfShards); + result = 31 * result + Objects.hashCode(this.priority); + result = 31 * result + Objects.hashCode(this.providedName); + result = 31 * result + Objects.hashCode(this.queries); + result = 31 * result + Objects.hashCode(this.queryString); + result = 31 * result + Objects.hashCode(this.queryStringLenient); + result = 31 * result + Objects.hashCode(this.refreshInterval); + result = 31 * result + Objects.hashCode(this.routing); + result = 31 * result + Objects.hashCode(this.routingPartitionSize); + result = 31 * result + Objects.hashCode(this.routingPath); + result = 31 * result + Objects.hashCode(this.search); + result = 31 * result + Objects.hashCode(this.searchIdleAfter); + result = 31 * result + Objects.hashCode(this.settings); + result = 31 * result + Objects.hashCode(this.similarity); + result = 31 * result + Objects.hashCode(this.softDeletes); + result = 31 * result + Objects.hashCode(this.softDeletesRetentionLeasePeriod); + result = 31 * result + Objects.hashCode(this.sort); + result = 31 * result + Objects.hashCode(this.store); + result = 31 * result + Objects.hashCode(this.topMetricsMaxSize); + result = 31 * result + Objects.hashCode(this.translog); + result = 31 * result + Objects.hashCode(this.translogDurability); + result = 31 * result + Objects.hashCode(this.translogFlushThresholdSize); + result = 31 * result + Objects.hashCode(this.uuid); + result = 31 * result + Objects.hashCode(this.verifiedBeforeClose); + result = 31 * result + Objects.hashCode(this.version); + result = 31 * result + Objects.hashCode(this.customSettings); + return result; + } + + @Override + public boolean equals(Object o) { + if (this == o) return true; + if (o == null || this.getClass() != o.getClass()) return false; + IndexSettings other = (IndexSettings) o; + return Objects.equals(this.analysis, other.analysis) + && Objects.equals(this.analyze, other.analyze) + && Objects.equals(this.analyzeMaxTokenCount, other.analyzeMaxTokenCount) + && Objects.equals(this.autoExpandReplicas, other.autoExpandReplicas) + && Objects.equals(this.blocks, other.blocks) + && Objects.equals(this.blocksMetadata, other.blocksMetadata) + && Objects.equals(this.blocksRead, other.blocksRead) + && Objects.equals(this.blocksReadOnly, other.blocksReadOnly) + && Objects.equals(this.blocksReadOnlyAllowDelete, other.blocksReadOnlyAllowDelete) + && Objects.equals(this.blocksWrite, other.blocksWrite) + && Objects.equals(this.checkOnStartup, other.checkOnStartup) + && Objects.equals(this.codec, other.codec) + && Objects.equals(this.compositeIndexStarTree, other.compositeIndexStarTree) + && Objects.equals(this.creationDate, other.creationDate) + && Objects.equals(this.creationDateString, other.creationDateString) + && Objects.equals(this.defaultPipeline, other.defaultPipeline) + && Objects.equals(this.finalPipeline, other.finalPipeline) + && Objects.equals(this.format, other.format) + && Objects.equals(this.gcDeletes, other.gcDeletes) + && Objects.equals(this.hidden, other.hidden) + && Objects.equals(this.highlight, other.highlight) + && Objects.equals(this.highlightMaxAnalyzedOffset, other.highlightMaxAnalyzedOffset) + && Objects.equals(this.index, other.index) + && Objects.equals(this.indexing, other.indexing) + && Objects.equals(this.indexingPressure, other.indexingPressure) + && Objects.equals(this.knn, other.knn) + && Objects.equals(this.knnAlgoParamEfSearch, other.knnAlgoParamEfSearch) + && Objects.equals(this.lifecycle, other.lifecycle) + && Objects.equals(this.lifecycleName, other.lifecycleName) + && Objects.equals(this.loadFixedBitsetFiltersEagerly, other.loadFixedBitsetFiltersEagerly) + && Objects.equals(this.mapping, other.mapping) + && Objects.equals(this.maxDocvalueFieldsSearch, other.maxDocvalueFieldsSearch) + && Objects.equals(this.maxInnerResultWindow, other.maxInnerResultWindow) + && Objects.equals(this.maxNgramDiff, other.maxNgramDiff) + && Objects.equals(this.maxRefreshListeners, other.maxRefreshListeners) + && Objects.equals(this.maxRegexLength, other.maxRegexLength) + && Objects.equals(this.maxRescoreWindow, other.maxRescoreWindow) + && Objects.equals(this.maxResultWindow, other.maxResultWindow) + && Objects.equals(this.maxScriptFields, other.maxScriptFields) + && Objects.equals(this.maxShingleDiff, other.maxShingleDiff) + && Objects.equals(this.maxSlicesPerScroll, other.maxSlicesPerScroll) + && Objects.equals(this.maxTermsCount, other.maxTermsCount) + && Objects.equals(this.merge, other.merge) + && Objects.equals(this.mergeSchedulerMaxThreadCount, other.mergeSchedulerMaxThreadCount) + && Objects.equals(this.mode, other.mode) + && Objects.equals(this.numberOfReplicas, other.numberOfReplicas) + && Objects.equals(this.numberOfRoutingShards, other.numberOfRoutingShards) + && Objects.equals(this.numberOfShards, other.numberOfShards) + && Objects.equals(this.priority, other.priority) + && Objects.equals(this.providedName, other.providedName) + && Objects.equals(this.queries, other.queries) + && Objects.equals(this.queryString, other.queryString) + && Objects.equals(this.queryStringLenient, other.queryStringLenient) + && Objects.equals(this.refreshInterval, other.refreshInterval) + && Objects.equals(this.routing, other.routing) + && Objects.equals(this.routingPartitionSize, other.routingPartitionSize) + && Objects.equals(this.routingPath, other.routingPath) + && Objects.equals(this.search, other.search) + && Objects.equals(this.searchIdleAfter, other.searchIdleAfter) + && Objects.equals(this.settings, other.settings) + && Objects.equals(this.similarity, other.similarity) + && Objects.equals(this.softDeletes, other.softDeletes) + && Objects.equals(this.softDeletesRetentionLeasePeriod, other.softDeletesRetentionLeasePeriod) + && Objects.equals(this.sort, other.sort) + && Objects.equals(this.store, other.store) + && Objects.equals(this.topMetricsMaxSize, other.topMetricsMaxSize) + && Objects.equals(this.translog, other.translog) + && Objects.equals(this.translogDurability, other.translogDurability) + && Objects.equals(this.translogFlushThresholdSize, other.translogFlushThresholdSize) + && Objects.equals(this.uuid, other.uuid) + && Objects.equals(this.verifiedBeforeClose, other.verifiedBeforeClose) + && Objects.equals(this.version, other.version) + && Objects.equals(this.customSettings, other.customSettings); } - } diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/indices/IndexSettingsAnalyze.java b/java-client/src/generated/java/org/opensearch/client/opensearch/indices/IndexSettingsAnalyze.java new file mode 100644 index 0000000000..6b0395da7e --- /dev/null +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/indices/IndexSettingsAnalyze.java @@ -0,0 +1,187 @@ +/* + * SPDX-License-Identifier: Apache-2.0 + * + * The OpenSearch Contributors require contributions made to + * this file be licensed under the Apache-2.0 license or a + * compatible open source license. + */ + +/* + * 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. + */ + +/* + * Modifications Copyright OpenSearch Contributors. See + * GitHub history for details. + */ + +//---------------------------------------------------- +// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. +//---------------------------------------------------- + +package org.opensearch.client.opensearch.indices; + +import jakarta.json.stream.JsonGenerator; +import java.util.Objects; +import java.util.function.Function; +import javax.annotation.Generated; +import javax.annotation.Nonnull; +import javax.annotation.Nullable; +import org.opensearch.client.json.JsonpDeserializable; +import org.opensearch.client.json.JsonpDeserializer; +import org.opensearch.client.json.JsonpMapper; +import org.opensearch.client.json.ObjectBuilderDeserializer; +import org.opensearch.client.json.ObjectDeserializer; +import org.opensearch.client.json.PlainJsonSerializable; +import org.opensearch.client.util.CopyableBuilder; +import org.opensearch.client.util.ObjectBuilder; +import org.opensearch.client.util.ObjectBuilderBase; +import org.opensearch.client.util.ToCopyableBuilder; + +// typedef: indices.IndexSettingsAnalyze + +@JsonpDeserializable +@Generated("org.opensearch.client.codegen.CodeGenerator") +public class IndexSettingsAnalyze implements PlainJsonSerializable, ToCopyableBuilder { + + @Nullable + private final Integer maxTokenCount; + + // --------------------------------------------------------------------------------------------- + + private IndexSettingsAnalyze(Builder builder) { + this.maxTokenCount = builder.maxTokenCount; + } + + public static IndexSettingsAnalyze of(Function> fn) { + return fn.apply(new Builder()).build(); + } + + /** + * API name: {@code max_token_count} + */ + @Nullable + public final Integer maxTokenCount() { + return this.maxTokenCount; + } + + /** + * Serialize this object to JSON. + */ + @Override + public void serialize(JsonGenerator generator, JsonpMapper mapper) { + generator.writeStartObject(); + serializeInternal(generator, mapper); + generator.writeEnd(); + } + + protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { + if (this.maxTokenCount != null) { + generator.writeKey("max_token_count"); + generator.write(this.maxTokenCount); + } + } + + // --------------------------------------------------------------------------------------------- + + @Override + @Nonnull + public Builder toBuilder() { + return new Builder(this); + } + + @Nonnull + public static Builder builder() { + return new Builder(); + } + + /** + * Builder for {@link IndexSettingsAnalyze}. + */ + public static class Builder extends ObjectBuilderBase implements CopyableBuilder { + @Nullable + private Integer maxTokenCount; + + public Builder() {} + + private Builder(IndexSettingsAnalyze o) { + this.maxTokenCount = o.maxTokenCount; + } + + private Builder(Builder o) { + this.maxTokenCount = o.maxTokenCount; + } + + @Override + @Nonnull + public Builder copy() { + return new Builder(this); + } + + /** + * API name: {@code max_token_count} + */ + @Nonnull + public final Builder maxTokenCount(@Nullable Integer value) { + this.maxTokenCount = value; + return this; + } + + /** + * Builds a {@link IndexSettingsAnalyze}. + * + * @throws NullPointerException if some of the required fields are null. + */ + @Override + @Nonnull + public IndexSettingsAnalyze build() { + _checkSingleUse(); + + return new IndexSettingsAnalyze(this); + } + } + + // --------------------------------------------------------------------------------------------- + + /** + * Json deserializer for {@link IndexSettingsAnalyze} + */ + public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer.lazy( + Builder::new, + IndexSettingsAnalyze::setupIndexSettingsAnalyzeDeserializer + ); + + protected static void setupIndexSettingsAnalyzeDeserializer(ObjectDeserializer op) { + op.add(Builder::maxTokenCount, JsonpDeserializer.integerDeserializer(), "max_token_count"); + } + + @Override + public int hashCode() { + int result = 17; + result = 31 * result + Objects.hashCode(this.maxTokenCount); + return result; + } + + @Override + public boolean equals(Object o) { + if (this == o) return true; + if (o == null || this.getClass() != o.getClass()) return false; + IndexSettingsAnalyze other = (IndexSettingsAnalyze) o; + return Objects.equals(this.maxTokenCount, other.maxTokenCount); + } +} diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/indices/IndexSettingsHighlight.java b/java-client/src/generated/java/org/opensearch/client/opensearch/indices/IndexSettingsHighlight.java new file mode 100644 index 0000000000..d3d8e91c0c --- /dev/null +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/indices/IndexSettingsHighlight.java @@ -0,0 +1,190 @@ +/* + * SPDX-License-Identifier: Apache-2.0 + * + * The OpenSearch Contributors require contributions made to + * this file be licensed under the Apache-2.0 license or a + * compatible open source license. + */ + +/* + * 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. + */ + +/* + * Modifications Copyright OpenSearch Contributors. See + * GitHub history for details. + */ + +//---------------------------------------------------- +// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. +//---------------------------------------------------- + +package org.opensearch.client.opensearch.indices; + +import jakarta.json.stream.JsonGenerator; +import java.util.Objects; +import java.util.function.Function; +import javax.annotation.Generated; +import javax.annotation.Nonnull; +import javax.annotation.Nullable; +import org.opensearch.client.json.JsonpDeserializable; +import org.opensearch.client.json.JsonpDeserializer; +import org.opensearch.client.json.JsonpMapper; +import org.opensearch.client.json.ObjectBuilderDeserializer; +import org.opensearch.client.json.ObjectDeserializer; +import org.opensearch.client.json.PlainJsonSerializable; +import org.opensearch.client.util.CopyableBuilder; +import org.opensearch.client.util.ObjectBuilder; +import org.opensearch.client.util.ObjectBuilderBase; +import org.opensearch.client.util.ToCopyableBuilder; + +// typedef: indices.IndexSettingsHighlight + +@JsonpDeserializable +@Generated("org.opensearch.client.codegen.CodeGenerator") +public class IndexSettingsHighlight + implements + PlainJsonSerializable, + ToCopyableBuilder { + + @Nullable + private final Integer maxAnalyzedOffset; + + // --------------------------------------------------------------------------------------------- + + private IndexSettingsHighlight(Builder builder) { + this.maxAnalyzedOffset = builder.maxAnalyzedOffset; + } + + public static IndexSettingsHighlight of(Function> fn) { + return fn.apply(new Builder()).build(); + } + + /** + * API name: {@code max_analyzed_offset} + */ + @Nullable + public final Integer maxAnalyzedOffset() { + return this.maxAnalyzedOffset; + } + + /** + * Serialize this object to JSON. + */ + @Override + public void serialize(JsonGenerator generator, JsonpMapper mapper) { + generator.writeStartObject(); + serializeInternal(generator, mapper); + generator.writeEnd(); + } + + protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { + if (this.maxAnalyzedOffset != null) { + generator.writeKey("max_analyzed_offset"); + generator.write(this.maxAnalyzedOffset); + } + } + + // --------------------------------------------------------------------------------------------- + + @Override + @Nonnull + public Builder toBuilder() { + return new Builder(this); + } + + @Nonnull + public static Builder builder() { + return new Builder(); + } + + /** + * Builder for {@link IndexSettingsHighlight}. + */ + public static class Builder extends ObjectBuilderBase implements CopyableBuilder { + @Nullable + private Integer maxAnalyzedOffset; + + public Builder() {} + + private Builder(IndexSettingsHighlight o) { + this.maxAnalyzedOffset = o.maxAnalyzedOffset; + } + + private Builder(Builder o) { + this.maxAnalyzedOffset = o.maxAnalyzedOffset; + } + + @Override + @Nonnull + public Builder copy() { + return new Builder(this); + } + + /** + * API name: {@code max_analyzed_offset} + */ + @Nonnull + public final Builder maxAnalyzedOffset(@Nullable Integer value) { + this.maxAnalyzedOffset = value; + return this; + } + + /** + * Builds a {@link IndexSettingsHighlight}. + * + * @throws NullPointerException if some of the required fields are null. + */ + @Override + @Nonnull + public IndexSettingsHighlight build() { + _checkSingleUse(); + + return new IndexSettingsHighlight(this); + } + } + + // --------------------------------------------------------------------------------------------- + + /** + * Json deserializer for {@link IndexSettingsHighlight} + */ + public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer.lazy( + Builder::new, + IndexSettingsHighlight::setupIndexSettingsHighlightDeserializer + ); + + protected static void setupIndexSettingsHighlightDeserializer(ObjectDeserializer op) { + op.add(Builder::maxAnalyzedOffset, JsonpDeserializer.integerDeserializer(), "max_analyzed_offset"); + } + + @Override + public int hashCode() { + int result = 17; + result = 31 * result + Objects.hashCode(this.maxAnalyzedOffset); + return result; + } + + @Override + public boolean equals(Object o) { + if (this == o) return true; + if (o == null || this.getClass() != o.getClass()) return false; + IndexSettingsHighlight other = (IndexSettingsHighlight) o; + return Objects.equals(this.maxAnalyzedOffset, other.maxAnalyzedOffset); + } +} diff --git a/java-client/src/main/java/org/opensearch/client/opensearch/indices/IndexSettingsIndexing.java b/java-client/src/generated/java/org/opensearch/client/opensearch/indices/IndexSettingsIndexing.java similarity index 64% rename from java-client/src/main/java/org/opensearch/client/opensearch/indices/IndexSettingsIndexing.java rename to java-client/src/generated/java/org/opensearch/client/opensearch/indices/IndexSettingsIndexing.java index 19eeebb430..4c2b60990c 100644 --- a/java-client/src/main/java/org/opensearch/client/opensearch/indices/IndexSettingsIndexing.java +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/indices/IndexSettingsIndexing.java @@ -30,10 +30,17 @@ * GitHub history for details. */ +//---------------------------------------------------- +// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. +//---------------------------------------------------- + package org.opensearch.client.opensearch.indices; import jakarta.json.stream.JsonGenerator; +import java.util.Objects; import java.util.function.Function; +import javax.annotation.Generated; +import javax.annotation.Nonnull; import javax.annotation.Nullable; import org.opensearch.client.json.JsonpDeserializable; import org.opensearch.client.json.JsonpDeserializer; @@ -41,23 +48,30 @@ import org.opensearch.client.json.ObjectBuilderDeserializer; import org.opensearch.client.json.ObjectDeserializer; import org.opensearch.client.json.PlainJsonSerializable; +import org.opensearch.client.util.CopyableBuilder; import org.opensearch.client.util.ObjectBuilder; import org.opensearch.client.util.ObjectBuilderBase; +import org.opensearch.client.util.ToCopyableBuilder; + +// typedef: indices.IndexSettingsIndexing @JsonpDeserializable -public class IndexSettingsIndexing implements PlainJsonSerializable { +@Generated("org.opensearch.client.codegen.CodeGenerator") +public class IndexSettingsIndexing + implements + PlainJsonSerializable, + ToCopyableBuilder { + @Nullable private final IndexingSlowlog slowlog; // --------------------------------------------------------------------------------------------- private IndexSettingsIndexing(Builder builder) { - this.slowlog = builder.slowlog; - } - public static IndexSettingsIndexing of(Function> fn) { + public static IndexSettingsIndexing of(Function> fn) { return fn.apply(new Builder()).build(); } @@ -72,6 +86,7 @@ public final IndexingSlowlog slowlog() { /** * Serialize this object to JSON. */ + @Override public void serialize(JsonGenerator generator, JsonpMapper mapper) { generator.writeStartObject(); serializeInternal(generator, mapper); @@ -79,28 +94,52 @@ public void serialize(JsonGenerator generator, JsonpMapper mapper) { } protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { - if (this.slowlog != null) { generator.writeKey("slowlog"); this.slowlog.serialize(generator, mapper); - } - } // --------------------------------------------------------------------------------------------- + @Override + @Nonnull + public Builder toBuilder() { + return new Builder(this); + } + + @Nonnull + public static Builder builder() { + return new Builder(); + } + /** * Builder for {@link IndexSettingsIndexing}. */ - - public static class Builder extends ObjectBuilderBase implements ObjectBuilder { + public static class Builder extends ObjectBuilderBase implements CopyableBuilder { @Nullable private IndexingSlowlog slowlog; + public Builder() {} + + private Builder(IndexSettingsIndexing o) { + this.slowlog = o.slowlog; + } + + private Builder(Builder o) { + this.slowlog = o.slowlog; + } + + @Override + @Nonnull + public Builder copy() { + return new Builder(this); + } + /** * API name: {@code slowlog} */ + @Nonnull public final Builder slowlog(@Nullable IndexingSlowlog value) { this.slowlog = value; return this; @@ -109,16 +148,18 @@ public final Builder slowlog(@Nullable IndexingSlowlog value) { /** * API name: {@code slowlog} */ + @Nonnull public final Builder slowlog(Function> fn) { - return this.slowlog(fn.apply(new IndexingSlowlog.Builder()).build()); + return slowlog(fn.apply(new IndexingSlowlog.Builder()).build()); } /** * Builds a {@link IndexSettingsIndexing}. * - * @throws NullPointerException - * if some of the required fields are null. + * @throws NullPointerException if some of the required fields are null. */ + @Override + @Nonnull public IndexSettingsIndexing build() { _checkSingleUse(); @@ -133,13 +174,25 @@ public IndexSettingsIndexing build() { */ public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer.lazy( Builder::new, - IndexSettingsIndexing::setupSettingsSearchDeserializer + IndexSettingsIndexing::setupIndexSettingsIndexingDeserializer ); - protected static void setupSettingsSearchDeserializer(ObjectDeserializer op) { - + protected static void setupIndexSettingsIndexingDeserializer(ObjectDeserializer op) { op.add(Builder::slowlog, IndexingSlowlog._DESERIALIZER, "slowlog"); + } + @Override + public int hashCode() { + int result = 17; + result = 31 * result + Objects.hashCode(this.slowlog); + return result; } + @Override + public boolean equals(Object o) { + if (this == o) return true; + if (o == null || this.getClass() != o.getClass()) return false; + IndexSettingsIndexing other = (IndexSettingsIndexing) o; + return Objects.equals(this.slowlog, other.slowlog); + } } diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/indices/IndexSettingsLifecycle.java b/java-client/src/generated/java/org/opensearch/client/opensearch/indices/IndexSettingsLifecycle.java new file mode 100644 index 0000000000..57bc744256 --- /dev/null +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/indices/IndexSettingsLifecycle.java @@ -0,0 +1,395 @@ +/* + * SPDX-License-Identifier: Apache-2.0 + * + * The OpenSearch Contributors require contributions made to + * this file be licensed under the Apache-2.0 license or a + * compatible open source license. + */ + +/* + * 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. + */ + +/* + * Modifications Copyright OpenSearch Contributors. See + * GitHub history for details. + */ + +//---------------------------------------------------- +// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. +//---------------------------------------------------- + +package org.opensearch.client.opensearch.indices; + +import jakarta.json.stream.JsonGenerator; +import java.util.Objects; +import java.util.function.Function; +import javax.annotation.Generated; +import javax.annotation.Nonnull; +import javax.annotation.Nullable; +import org.opensearch.client.json.JsonpDeserializable; +import org.opensearch.client.json.JsonpDeserializer; +import org.opensearch.client.json.JsonpMapper; +import org.opensearch.client.json.ObjectBuilderDeserializer; +import org.opensearch.client.json.ObjectDeserializer; +import org.opensearch.client.json.PlainJsonSerializable; +import org.opensearch.client.util.ApiTypeHelper; +import org.opensearch.client.util.CopyableBuilder; +import org.opensearch.client.util.ObjectBuilder; +import org.opensearch.client.util.ObjectBuilderBase; +import org.opensearch.client.util.ToCopyableBuilder; + +// typedef: indices.IndexSettingsLifecycle + +@JsonpDeserializable +@Generated("org.opensearch.client.codegen.CodeGenerator") +public class IndexSettingsLifecycle + implements + PlainJsonSerializable, + ToCopyableBuilder { + + @Nullable + private final Boolean indexingComplete; + + @Nonnull + private final String name; + + @Nullable + private final Long originationDate; + + @Nullable + private final Boolean parseOriginationDate; + + @Nullable + private final String rolloverAlias; + + @Nullable + private final IndexSettingsLifecycleStep step; + + // --------------------------------------------------------------------------------------------- + + private IndexSettingsLifecycle(Builder builder) { + this.indexingComplete = builder.indexingComplete; + this.name = ApiTypeHelper.requireNonNull(builder.name, this, "name"); + this.originationDate = builder.originationDate; + this.parseOriginationDate = builder.parseOriginationDate; + this.rolloverAlias = builder.rolloverAlias; + this.step = builder.step; + } + + public static IndexSettingsLifecycle of(Function> fn) { + return fn.apply(new Builder()).build(); + } + + /** + * API name: {@code indexing_complete} + */ + @Nullable + public final Boolean indexingComplete() { + return this.indexingComplete; + } + + /** + * Required - API name: {@code name} + */ + @Nonnull + public final String name() { + return this.name; + } + + /** + * If specified, this is the timestamp used to calculate the index age for its phase transitions. Use this setting if you create a new + * index that contains old data and want to use the original creation date to calculate the index age. Specified as a Unix epoch value + * in milliseconds. + *

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

+ */ + @Nullable + public final Long originationDate() { + return this.originationDate; + } + + /** + * Set to true to parse the origination date from the index name. This origination date is used to calculate the index age + * for its phase transitions. The index name must match the pattern ^.*-{date_format}-\\d+, where the + * date_format is yyyy.MM.dd and the trailing digits are optional. An index that was rolled over would + * normally match the full format, for example logs-2016.10.31-000002). If the index name doesn't match the pattern, index + * creation fails. + *

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

+ */ + @Nullable + public final Boolean parseOriginationDate() { + return this.parseOriginationDate; + } + + /** + * The index alias to update when the index rolls over. Specify when using a policy that contains a rollover action. When the index + * rolls over, the alias is updated to reflect that the index is no longer the write index. For more information about rolling indexes, + * see Rollover. + *

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

+ */ + @Nullable + public final String rolloverAlias() { + return this.rolloverAlias; + } + + /** + * API name: {@code step} + */ + @Nullable + public final IndexSettingsLifecycleStep step() { + return this.step; + } + + /** + * Serialize this object to JSON. + */ + @Override + public void serialize(JsonGenerator generator, JsonpMapper mapper) { + generator.writeStartObject(); + serializeInternal(generator, mapper); + generator.writeEnd(); + } + + protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { + if (this.indexingComplete != null) { + generator.writeKey("indexing_complete"); + generator.write(this.indexingComplete); + } + + generator.writeKey("name"); + generator.write(this.name); + + if (this.originationDate != null) { + generator.writeKey("origination_date"); + generator.write(this.originationDate); + } + + if (this.parseOriginationDate != null) { + generator.writeKey("parse_origination_date"); + generator.write(this.parseOriginationDate); + } + + if (this.rolloverAlias != null) { + generator.writeKey("rollover_alias"); + generator.write(this.rolloverAlias); + } + + if (this.step != null) { + generator.writeKey("step"); + this.step.serialize(generator, mapper); + } + } + + // --------------------------------------------------------------------------------------------- + + @Override + @Nonnull + public Builder toBuilder() { + return new Builder(this); + } + + @Nonnull + public static Builder builder() { + return new Builder(); + } + + /** + * Builder for {@link IndexSettingsLifecycle}. + */ + public static class Builder extends ObjectBuilderBase implements CopyableBuilder { + @Nullable + private Boolean indexingComplete; + private String name; + @Nullable + private Long originationDate; + @Nullable + private Boolean parseOriginationDate; + @Nullable + private String rolloverAlias; + @Nullable + private IndexSettingsLifecycleStep step; + + public Builder() {} + + private Builder(IndexSettingsLifecycle o) { + this.indexingComplete = o.indexingComplete; + this.name = o.name; + this.originationDate = o.originationDate; + this.parseOriginationDate = o.parseOriginationDate; + this.rolloverAlias = o.rolloverAlias; + this.step = o.step; + } + + private Builder(Builder o) { + this.indexingComplete = o.indexingComplete; + this.name = o.name; + this.originationDate = o.originationDate; + this.parseOriginationDate = o.parseOriginationDate; + this.rolloverAlias = o.rolloverAlias; + this.step = o.step; + } + + @Override + @Nonnull + public Builder copy() { + return new Builder(this); + } + + /** + * API name: {@code indexing_complete} + */ + @Nonnull + public final Builder indexingComplete(@Nullable Boolean value) { + this.indexingComplete = value; + return this; + } + + /** + * Required - API name: {@code name} + */ + @Nonnull + public final Builder name(String value) { + this.name = value; + return this; + } + + /** + * If specified, this is the timestamp used to calculate the index age for its phase transitions. Use this setting if you create a + * new index that contains old data and want to use the original creation date to calculate the index age. Specified as a Unix epoch + * value in milliseconds. + *

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

+ */ + @Nonnull + public final Builder originationDate(@Nullable Long value) { + this.originationDate = value; + return this; + } + + /** + * Set to true to parse the origination date from the index name. This origination date is used to calculate the index + * age for its phase transitions. The index name must match the pattern ^.*-{date_format}-\\d+, where the + * date_format is yyyy.MM.dd and the trailing digits are optional. An index that was rolled over would + * normally match the full format, for example logs-2016.10.31-000002). If the index name doesn't match the pattern, + * index creation fails. + *

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

+ */ + @Nonnull + public final Builder parseOriginationDate(@Nullable Boolean value) { + this.parseOriginationDate = value; + return this; + } + + /** + * The index alias to update when the index rolls over. Specify when using a policy that contains a rollover action. When the index + * rolls over, the alias is updated to reflect that the index is no longer the write index. For more information about rolling + * indexes, see Rollover. + *

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

+ */ + @Nonnull + public final Builder rolloverAlias(@Nullable String value) { + this.rolloverAlias = value; + return this; + } + + /** + * API name: {@code step} + */ + @Nonnull + public final Builder step(@Nullable IndexSettingsLifecycleStep value) { + this.step = value; + return this; + } + + /** + * API name: {@code step} + */ + @Nonnull + public final Builder step(Function> fn) { + return step(fn.apply(new IndexSettingsLifecycleStep.Builder()).build()); + } + + /** + * Builds a {@link IndexSettingsLifecycle}. + * + * @throws NullPointerException if some of the required fields are null. + */ + @Override + @Nonnull + public IndexSettingsLifecycle build() { + _checkSingleUse(); + + return new IndexSettingsLifecycle(this); + } + } + + // --------------------------------------------------------------------------------------------- + + /** + * Json deserializer for {@link IndexSettingsLifecycle} + */ + public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer.lazy( + Builder::new, + IndexSettingsLifecycle::setupIndexSettingsLifecycleDeserializer + ); + + protected static void setupIndexSettingsLifecycleDeserializer(ObjectDeserializer op) { + op.add(Builder::indexingComplete, JsonpDeserializer.booleanDeserializer(), "indexing_complete"); + op.add(Builder::name, JsonpDeserializer.stringDeserializer(), "name"); + op.add(Builder::originationDate, JsonpDeserializer.longDeserializer(), "origination_date"); + op.add(Builder::parseOriginationDate, JsonpDeserializer.booleanDeserializer(), "parse_origination_date"); + op.add(Builder::rolloverAlias, JsonpDeserializer.stringDeserializer(), "rollover_alias"); + op.add(Builder::step, IndexSettingsLifecycleStep._DESERIALIZER, "step"); + } + + @Override + public int hashCode() { + int result = 17; + result = 31 * result + Objects.hashCode(this.indexingComplete); + result = 31 * result + this.name.hashCode(); + result = 31 * result + Objects.hashCode(this.originationDate); + result = 31 * result + Objects.hashCode(this.parseOriginationDate); + result = 31 * result + Objects.hashCode(this.rolloverAlias); + result = 31 * result + Objects.hashCode(this.step); + return result; + } + + @Override + public boolean equals(Object o) { + if (this == o) return true; + if (o == null || this.getClass() != o.getClass()) return false; + IndexSettingsLifecycle other = (IndexSettingsLifecycle) o; + return Objects.equals(this.indexingComplete, other.indexingComplete) + && this.name.equals(other.name) + && Objects.equals(this.originationDate, other.originationDate) + && Objects.equals(this.parseOriginationDate, other.parseOriginationDate) + && Objects.equals(this.rolloverAlias, other.rolloverAlias) + && Objects.equals(this.step, other.step); + } +} diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/indices/IndexSettingsLifecycleStep.java b/java-client/src/generated/java/org/opensearch/client/opensearch/indices/IndexSettingsLifecycleStep.java new file mode 100644 index 0000000000..a4ac86730c --- /dev/null +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/indices/IndexSettingsLifecycleStep.java @@ -0,0 +1,201 @@ +/* + * SPDX-License-Identifier: Apache-2.0 + * + * The OpenSearch Contributors require contributions made to + * this file be licensed under the Apache-2.0 license or a + * compatible open source license. + */ + +/* + * 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. + */ + +/* + * Modifications Copyright OpenSearch Contributors. See + * GitHub history for details. + */ + +//---------------------------------------------------- +// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. +//---------------------------------------------------- + +package org.opensearch.client.opensearch.indices; + +import jakarta.json.stream.JsonGenerator; +import java.util.Objects; +import java.util.function.Function; +import javax.annotation.Generated; +import javax.annotation.Nonnull; +import javax.annotation.Nullable; +import org.opensearch.client.json.JsonpDeserializable; +import org.opensearch.client.json.JsonpDeserializer; +import org.opensearch.client.json.JsonpMapper; +import org.opensearch.client.json.ObjectBuilderDeserializer; +import org.opensearch.client.json.ObjectDeserializer; +import org.opensearch.client.json.PlainJsonSerializable; +import org.opensearch.client.opensearch._types.Time; +import org.opensearch.client.util.CopyableBuilder; +import org.opensearch.client.util.ObjectBuilder; +import org.opensearch.client.util.ObjectBuilderBase; +import org.opensearch.client.util.ToCopyableBuilder; + +// typedef: indices.IndexSettingsLifecycleStep + +@JsonpDeserializable +@Generated("org.opensearch.client.codegen.CodeGenerator") +public class IndexSettingsLifecycleStep + implements + PlainJsonSerializable, + ToCopyableBuilder { + + @Nullable + private final Time waitTimeThreshold; + + // --------------------------------------------------------------------------------------------- + + private IndexSettingsLifecycleStep(Builder builder) { + this.waitTimeThreshold = builder.waitTimeThreshold; + } + + public static IndexSettingsLifecycleStep of( + Function> fn + ) { + return fn.apply(new Builder()).build(); + } + + /** + * API name: {@code wait_time_threshold} + */ + @Nullable + public final Time waitTimeThreshold() { + return this.waitTimeThreshold; + } + + /** + * Serialize this object to JSON. + */ + @Override + public void serialize(JsonGenerator generator, JsonpMapper mapper) { + generator.writeStartObject(); + serializeInternal(generator, mapper); + generator.writeEnd(); + } + + protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { + if (this.waitTimeThreshold != null) { + generator.writeKey("wait_time_threshold"); + this.waitTimeThreshold.serialize(generator, mapper); + } + } + + // --------------------------------------------------------------------------------------------- + + @Override + @Nonnull + public Builder toBuilder() { + return new Builder(this); + } + + @Nonnull + public static Builder builder() { + return new Builder(); + } + + /** + * Builder for {@link IndexSettingsLifecycleStep}. + */ + public static class Builder extends ObjectBuilderBase implements CopyableBuilder { + @Nullable + private Time waitTimeThreshold; + + public Builder() {} + + private Builder(IndexSettingsLifecycleStep o) { + this.waitTimeThreshold = o.waitTimeThreshold; + } + + private Builder(Builder o) { + this.waitTimeThreshold = o.waitTimeThreshold; + } + + @Override + @Nonnull + public Builder copy() { + return new Builder(this); + } + + /** + * API name: {@code wait_time_threshold} + */ + @Nonnull + public final Builder waitTimeThreshold(@Nullable Time value) { + this.waitTimeThreshold = value; + return this; + } + + /** + * API name: {@code wait_time_threshold} + */ + @Nonnull + public final Builder waitTimeThreshold(Function> fn) { + return waitTimeThreshold(fn.apply(new Time.Builder()).build()); + } + + /** + * Builds a {@link IndexSettingsLifecycleStep}. + * + * @throws NullPointerException if some of the required fields are null. + */ + @Override + @Nonnull + public IndexSettingsLifecycleStep build() { + _checkSingleUse(); + + return new IndexSettingsLifecycleStep(this); + } + } + + // --------------------------------------------------------------------------------------------- + + /** + * Json deserializer for {@link IndexSettingsLifecycleStep} + */ + public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer.lazy( + Builder::new, + IndexSettingsLifecycleStep::setupIndexSettingsLifecycleStepDeserializer + ); + + protected static void setupIndexSettingsLifecycleStepDeserializer(ObjectDeserializer op) { + op.add(Builder::waitTimeThreshold, Time._DESERIALIZER, "wait_time_threshold"); + } + + @Override + public int hashCode() { + int result = 17; + result = 31 * result + Objects.hashCode(this.waitTimeThreshold); + return result; + } + + @Override + public boolean equals(Object o) { + if (this == o) return true; + if (o == null || this.getClass() != o.getClass()) return false; + IndexSettingsLifecycleStep other = (IndexSettingsLifecycleStep) o; + return Objects.equals(this.waitTimeThreshold, other.waitTimeThreshold); + } +} diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/indices/IndexSettingsMapping.java b/java-client/src/generated/java/org/opensearch/client/opensearch/indices/IndexSettingsMapping.java new file mode 100644 index 0000000000..1964059ad0 --- /dev/null +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/indices/IndexSettingsMapping.java @@ -0,0 +1,476 @@ +/* + * SPDX-License-Identifier: Apache-2.0 + * + * The OpenSearch Contributors require contributions made to + * this file be licensed under the Apache-2.0 license or a + * compatible open source license. + */ + +/* + * 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. + */ + +/* + * Modifications Copyright OpenSearch Contributors. See + * GitHub history for details. + */ + +//---------------------------------------------------- +// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. +//---------------------------------------------------- + +package org.opensearch.client.opensearch.indices; + +import jakarta.json.stream.JsonGenerator; +import java.util.Objects; +import java.util.function.Function; +import javax.annotation.Generated; +import javax.annotation.Nonnull; +import javax.annotation.Nullable; +import org.opensearch.client.json.JsonpDeserializable; +import org.opensearch.client.json.JsonpDeserializer; +import org.opensearch.client.json.JsonpMapper; +import org.opensearch.client.json.ObjectBuilderDeserializer; +import org.opensearch.client.json.ObjectDeserializer; +import org.opensearch.client.json.PlainJsonSerializable; +import org.opensearch.client.util.CopyableBuilder; +import org.opensearch.client.util.ObjectBuilder; +import org.opensearch.client.util.ObjectBuilderBase; +import org.opensearch.client.util.ToCopyableBuilder; + +// typedef: indices.IndexSettingsMapping + +@JsonpDeserializable +@Generated("org.opensearch.client.codegen.CodeGenerator") +public class IndexSettingsMapping implements PlainJsonSerializable, ToCopyableBuilder { + + @Nullable + private final Boolean coerce; + + @Nullable + private final IndexSettingsMappingLimitDepth depth; + + @Nullable + private final IndexSettingsMappingLimitDimensionFields dimensionFields; + + @Nullable + private final IndexSettingsMappingLimitFieldNameLength fieldNameLength; + + @Nullable + private final Boolean ignoreMalformed; + + @Nullable + private final IndexSettingsMappingLimitNestedFields nestedFields; + + @Nullable + private final IndexSettingsMappingLimitNestedObjects nestedObjects; + + @Nullable + private final IndexSettingsMappingLimitTotalFields totalFields; + + // --------------------------------------------------------------------------------------------- + + private IndexSettingsMapping(Builder builder) { + this.coerce = builder.coerce; + this.depth = builder.depth; + this.dimensionFields = builder.dimensionFields; + this.fieldNameLength = builder.fieldNameLength; + this.ignoreMalformed = builder.ignoreMalformed; + this.nestedFields = builder.nestedFields; + this.nestedObjects = builder.nestedObjects; + this.totalFields = builder.totalFields; + } + + public static IndexSettingsMapping of(Function> fn) { + return fn.apply(new Builder()).build(); + } + + /** + * API name: {@code coerce} + */ + @Nullable + public final Boolean coerce() { + return this.coerce; + } + + /** + * API name: {@code depth} + */ + @Nullable + public final IndexSettingsMappingLimitDepth depth() { + return this.depth; + } + + /** + * API name: {@code dimension_fields} + */ + @Nullable + public final IndexSettingsMappingLimitDimensionFields dimensionFields() { + return this.dimensionFields; + } + + /** + * API name: {@code field_name_length} + */ + @Nullable + public final IndexSettingsMappingLimitFieldNameLength fieldNameLength() { + return this.fieldNameLength; + } + + /** + * API name: {@code ignore_malformed} + */ + @Nullable + public final Boolean ignoreMalformed() { + return this.ignoreMalformed; + } + + /** + * API name: {@code nested_fields} + */ + @Nullable + public final IndexSettingsMappingLimitNestedFields nestedFields() { + return this.nestedFields; + } + + /** + * API name: {@code nested_objects} + */ + @Nullable + public final IndexSettingsMappingLimitNestedObjects nestedObjects() { + return this.nestedObjects; + } + + /** + * API name: {@code total_fields} + */ + @Nullable + public final IndexSettingsMappingLimitTotalFields totalFields() { + return this.totalFields; + } + + /** + * Serialize this object to JSON. + */ + @Override + public void serialize(JsonGenerator generator, JsonpMapper mapper) { + generator.writeStartObject(); + serializeInternal(generator, mapper); + generator.writeEnd(); + } + + protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { + if (this.coerce != null) { + generator.writeKey("coerce"); + generator.write(this.coerce); + } + + if (this.depth != null) { + generator.writeKey("depth"); + this.depth.serialize(generator, mapper); + } + + if (this.dimensionFields != null) { + generator.writeKey("dimension_fields"); + this.dimensionFields.serialize(generator, mapper); + } + + if (this.fieldNameLength != null) { + generator.writeKey("field_name_length"); + this.fieldNameLength.serialize(generator, mapper); + } + + if (this.ignoreMalformed != null) { + generator.writeKey("ignore_malformed"); + generator.write(this.ignoreMalformed); + } + + if (this.nestedFields != null) { + generator.writeKey("nested_fields"); + this.nestedFields.serialize(generator, mapper); + } + + if (this.nestedObjects != null) { + generator.writeKey("nested_objects"); + this.nestedObjects.serialize(generator, mapper); + } + + if (this.totalFields != null) { + generator.writeKey("total_fields"); + this.totalFields.serialize(generator, mapper); + } + } + + // --------------------------------------------------------------------------------------------- + + @Override + @Nonnull + public Builder toBuilder() { + return new Builder(this); + } + + @Nonnull + public static Builder builder() { + return new Builder(); + } + + /** + * Builder for {@link IndexSettingsMapping}. + */ + public static class Builder extends ObjectBuilderBase implements CopyableBuilder { + @Nullable + private Boolean coerce; + @Nullable + private IndexSettingsMappingLimitDepth depth; + @Nullable + private IndexSettingsMappingLimitDimensionFields dimensionFields; + @Nullable + private IndexSettingsMappingLimitFieldNameLength fieldNameLength; + @Nullable + private Boolean ignoreMalformed; + @Nullable + private IndexSettingsMappingLimitNestedFields nestedFields; + @Nullable + private IndexSettingsMappingLimitNestedObjects nestedObjects; + @Nullable + private IndexSettingsMappingLimitTotalFields totalFields; + + public Builder() {} + + private Builder(IndexSettingsMapping o) { + this.coerce = o.coerce; + this.depth = o.depth; + this.dimensionFields = o.dimensionFields; + this.fieldNameLength = o.fieldNameLength; + this.ignoreMalformed = o.ignoreMalformed; + this.nestedFields = o.nestedFields; + this.nestedObjects = o.nestedObjects; + this.totalFields = o.totalFields; + } + + private Builder(Builder o) { + this.coerce = o.coerce; + this.depth = o.depth; + this.dimensionFields = o.dimensionFields; + this.fieldNameLength = o.fieldNameLength; + this.ignoreMalformed = o.ignoreMalformed; + this.nestedFields = o.nestedFields; + this.nestedObjects = o.nestedObjects; + this.totalFields = o.totalFields; + } + + @Override + @Nonnull + public Builder copy() { + return new Builder(this); + } + + /** + * API name: {@code coerce} + */ + @Nonnull + public final Builder coerce(@Nullable Boolean value) { + this.coerce = value; + return this; + } + + /** + * API name: {@code depth} + */ + @Nonnull + public final Builder depth(@Nullable IndexSettingsMappingLimitDepth value) { + this.depth = value; + return this; + } + + /** + * API name: {@code depth} + */ + @Nonnull + public final Builder depth(Function> fn) { + return depth(fn.apply(new IndexSettingsMappingLimitDepth.Builder()).build()); + } + + /** + * API name: {@code dimension_fields} + */ + @Nonnull + public final Builder dimensionFields(@Nullable IndexSettingsMappingLimitDimensionFields value) { + this.dimensionFields = value; + return this; + } + + /** + * API name: {@code dimension_fields} + */ + @Nonnull + public final Builder dimensionFields( + Function> fn + ) { + return dimensionFields(fn.apply(new IndexSettingsMappingLimitDimensionFields.Builder()).build()); + } + + /** + * API name: {@code field_name_length} + */ + @Nonnull + public final Builder fieldNameLength(@Nullable IndexSettingsMappingLimitFieldNameLength value) { + this.fieldNameLength = value; + return this; + } + + /** + * API name: {@code field_name_length} + */ + @Nonnull + public final Builder fieldNameLength( + Function> fn + ) { + return fieldNameLength(fn.apply(new IndexSettingsMappingLimitFieldNameLength.Builder()).build()); + } + + /** + * API name: {@code ignore_malformed} + */ + @Nonnull + public final Builder ignoreMalformed(@Nullable Boolean value) { + this.ignoreMalformed = value; + return this; + } + + /** + * API name: {@code nested_fields} + */ + @Nonnull + public final Builder nestedFields(@Nullable IndexSettingsMappingLimitNestedFields value) { + this.nestedFields = value; + return this; + } + + /** + * API name: {@code nested_fields} + */ + @Nonnull + public final Builder nestedFields( + Function> fn + ) { + return nestedFields(fn.apply(new IndexSettingsMappingLimitNestedFields.Builder()).build()); + } + + /** + * API name: {@code nested_objects} + */ + @Nonnull + public final Builder nestedObjects(@Nullable IndexSettingsMappingLimitNestedObjects value) { + this.nestedObjects = value; + return this; + } + + /** + * API name: {@code nested_objects} + */ + @Nonnull + public final Builder nestedObjects( + Function> fn + ) { + return nestedObjects(fn.apply(new IndexSettingsMappingLimitNestedObjects.Builder()).build()); + } + + /** + * API name: {@code total_fields} + */ + @Nonnull + public final Builder totalFields(@Nullable IndexSettingsMappingLimitTotalFields value) { + this.totalFields = value; + return this; + } + + /** + * API name: {@code total_fields} + */ + @Nonnull + public final Builder totalFields( + Function> fn + ) { + return totalFields(fn.apply(new IndexSettingsMappingLimitTotalFields.Builder()).build()); + } + + /** + * Builds a {@link IndexSettingsMapping}. + * + * @throws NullPointerException if some of the required fields are null. + */ + @Override + @Nonnull + public IndexSettingsMapping build() { + _checkSingleUse(); + + return new IndexSettingsMapping(this); + } + } + + // --------------------------------------------------------------------------------------------- + + /** + * Json deserializer for {@link IndexSettingsMapping} + */ + public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer.lazy( + Builder::new, + IndexSettingsMapping::setupIndexSettingsMappingDeserializer + ); + + protected static void setupIndexSettingsMappingDeserializer(ObjectDeserializer op) { + op.add(Builder::coerce, JsonpDeserializer.booleanDeserializer(), "coerce"); + op.add(Builder::depth, IndexSettingsMappingLimitDepth._DESERIALIZER, "depth"); + op.add(Builder::dimensionFields, IndexSettingsMappingLimitDimensionFields._DESERIALIZER, "dimension_fields"); + op.add(Builder::fieldNameLength, IndexSettingsMappingLimitFieldNameLength._DESERIALIZER, "field_name_length"); + op.add(Builder::ignoreMalformed, JsonpDeserializer.booleanDeserializer(), "ignore_malformed"); + op.add(Builder::nestedFields, IndexSettingsMappingLimitNestedFields._DESERIALIZER, "nested_fields"); + op.add(Builder::nestedObjects, IndexSettingsMappingLimitNestedObjects._DESERIALIZER, "nested_objects"); + op.add(Builder::totalFields, IndexSettingsMappingLimitTotalFields._DESERIALIZER, "total_fields"); + } + + @Override + public int hashCode() { + int result = 17; + result = 31 * result + Objects.hashCode(this.coerce); + result = 31 * result + Objects.hashCode(this.depth); + result = 31 * result + Objects.hashCode(this.dimensionFields); + result = 31 * result + Objects.hashCode(this.fieldNameLength); + result = 31 * result + Objects.hashCode(this.ignoreMalformed); + result = 31 * result + Objects.hashCode(this.nestedFields); + result = 31 * result + Objects.hashCode(this.nestedObjects); + result = 31 * result + Objects.hashCode(this.totalFields); + return result; + } + + @Override + public boolean equals(Object o) { + if (this == o) return true; + if (o == null || this.getClass() != o.getClass()) return false; + IndexSettingsMapping other = (IndexSettingsMapping) o; + return Objects.equals(this.coerce, other.coerce) + && Objects.equals(this.depth, other.depth) + && Objects.equals(this.dimensionFields, other.dimensionFields) + && Objects.equals(this.fieldNameLength, other.fieldNameLength) + && Objects.equals(this.ignoreMalformed, other.ignoreMalformed) + && Objects.equals(this.nestedFields, other.nestedFields) + && Objects.equals(this.nestedObjects, other.nestedObjects) + && Objects.equals(this.totalFields, other.totalFields); + } +} diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/indices/IndexSettingsMappingLimitDepth.java b/java-client/src/generated/java/org/opensearch/client/opensearch/indices/IndexSettingsMappingLimitDepth.java new file mode 100644 index 0000000000..ba57f66374 --- /dev/null +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/indices/IndexSettingsMappingLimitDepth.java @@ -0,0 +1,200 @@ +/* + * SPDX-License-Identifier: Apache-2.0 + * + * The OpenSearch Contributors require contributions made to + * this file be licensed under the Apache-2.0 license or a + * compatible open source license. + */ + +/* + * 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. + */ + +/* + * Modifications Copyright OpenSearch Contributors. See + * GitHub history for details. + */ + +//---------------------------------------------------- +// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. +//---------------------------------------------------- + +package org.opensearch.client.opensearch.indices; + +import jakarta.json.stream.JsonGenerator; +import java.util.Objects; +import java.util.function.Function; +import javax.annotation.Generated; +import javax.annotation.Nonnull; +import javax.annotation.Nullable; +import org.opensearch.client.json.JsonpDeserializable; +import org.opensearch.client.json.JsonpDeserializer; +import org.opensearch.client.json.JsonpMapper; +import org.opensearch.client.json.ObjectBuilderDeserializer; +import org.opensearch.client.json.ObjectDeserializer; +import org.opensearch.client.json.PlainJsonSerializable; +import org.opensearch.client.util.CopyableBuilder; +import org.opensearch.client.util.ObjectBuilder; +import org.opensearch.client.util.ObjectBuilderBase; +import org.opensearch.client.util.ToCopyableBuilder; + +// typedef: indices.IndexSettingsMappingLimitDepth + +@JsonpDeserializable +@Generated("org.opensearch.client.codegen.CodeGenerator") +public class IndexSettingsMappingLimitDepth + implements + PlainJsonSerializable, + ToCopyableBuilder { + + @Nullable + private final Long limit; + + // --------------------------------------------------------------------------------------------- + + private IndexSettingsMappingLimitDepth(Builder builder) { + this.limit = builder.limit; + } + + public static IndexSettingsMappingLimitDepth of( + Function> fn + ) { + return fn.apply(new Builder()).build(); + } + + /** + * The maximum depth for a field, which is measured as the number of inner objects. For instance, if all fields are defined at the root + * object level, then the depth is 1. If there is one object mapping, then the depth is 2. + *

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

+ */ + @Nullable + public final Long limit() { + return this.limit; + } + + /** + * Serialize this object to JSON. + */ + @Override + public void serialize(JsonGenerator generator, JsonpMapper mapper) { + generator.writeStartObject(); + serializeInternal(generator, mapper); + generator.writeEnd(); + } + + protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { + if (this.limit != null) { + generator.writeKey("limit"); + generator.write(this.limit); + } + } + + // --------------------------------------------------------------------------------------------- + + @Override + @Nonnull + public Builder toBuilder() { + return new Builder(this); + } + + @Nonnull + public static Builder builder() { + return new Builder(); + } + + /** + * Builder for {@link IndexSettingsMappingLimitDepth}. + */ + public static class Builder extends ObjectBuilderBase implements CopyableBuilder { + @Nullable + private Long limit; + + public Builder() {} + + private Builder(IndexSettingsMappingLimitDepth o) { + this.limit = o.limit; + } + + private Builder(Builder o) { + this.limit = o.limit; + } + + @Override + @Nonnull + public Builder copy() { + return new Builder(this); + } + + /** + * The maximum depth for a field, which is measured as the number of inner objects. For instance, if all fields are defined at the + * root object level, then the depth is 1. If there is one object mapping, then the depth is 2. + *

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

+ */ + @Nonnull + public final Builder limit(@Nullable Long value) { + this.limit = value; + return this; + } + + /** + * Builds a {@link IndexSettingsMappingLimitDepth}. + * + * @throws NullPointerException if some of the required fields are null. + */ + @Override + @Nonnull + public IndexSettingsMappingLimitDepth build() { + _checkSingleUse(); + + return new IndexSettingsMappingLimitDepth(this); + } + } + + // --------------------------------------------------------------------------------------------- + + /** + * Json deserializer for {@link IndexSettingsMappingLimitDepth} + */ + public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer.lazy( + Builder::new, + IndexSettingsMappingLimitDepth::setupIndexSettingsMappingLimitDepthDeserializer + ); + + protected static void setupIndexSettingsMappingLimitDepthDeserializer(ObjectDeserializer op) { + op.add(Builder::limit, JsonpDeserializer.longDeserializer(), "limit"); + } + + @Override + public int hashCode() { + int result = 17; + result = 31 * result + Objects.hashCode(this.limit); + return result; + } + + @Override + public boolean equals(Object o) { + if (this == o) return true; + if (o == null || this.getClass() != o.getClass()) return false; + IndexSettingsMappingLimitDepth other = (IndexSettingsMappingLimitDepth) o; + return Objects.equals(this.limit, other.limit); + } +} diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/indices/IndexSettingsMappingLimitDimensionFields.java b/java-client/src/generated/java/org/opensearch/client/opensearch/indices/IndexSettingsMappingLimitDimensionFields.java new file mode 100644 index 0000000000..6aae583925 --- /dev/null +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/indices/IndexSettingsMappingLimitDimensionFields.java @@ -0,0 +1,202 @@ +/* + * SPDX-License-Identifier: Apache-2.0 + * + * The OpenSearch Contributors require contributions made to + * this file be licensed under the Apache-2.0 license or a + * compatible open source license. + */ + +/* + * 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. + */ + +/* + * Modifications Copyright OpenSearch Contributors. See + * GitHub history for details. + */ + +//---------------------------------------------------- +// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. +//---------------------------------------------------- + +package org.opensearch.client.opensearch.indices; + +import jakarta.json.stream.JsonGenerator; +import java.util.Objects; +import java.util.function.Function; +import javax.annotation.Generated; +import javax.annotation.Nonnull; +import javax.annotation.Nullable; +import org.opensearch.client.json.JsonpDeserializable; +import org.opensearch.client.json.JsonpDeserializer; +import org.opensearch.client.json.JsonpMapper; +import org.opensearch.client.json.ObjectBuilderDeserializer; +import org.opensearch.client.json.ObjectDeserializer; +import org.opensearch.client.json.PlainJsonSerializable; +import org.opensearch.client.util.CopyableBuilder; +import org.opensearch.client.util.ObjectBuilder; +import org.opensearch.client.util.ObjectBuilderBase; +import org.opensearch.client.util.ToCopyableBuilder; + +// typedef: indices.IndexSettingsMappingLimitDimensionFields + +@JsonpDeserializable +@Generated("org.opensearch.client.codegen.CodeGenerator") +public class IndexSettingsMappingLimitDimensionFields + implements + PlainJsonSerializable, + ToCopyableBuilder { + + @Nullable + private final Long limit; + + // --------------------------------------------------------------------------------------------- + + private IndexSettingsMappingLimitDimensionFields(Builder builder) { + this.limit = builder.limit; + } + + public static IndexSettingsMappingLimitDimensionFields of( + Function> fn + ) { + return fn.apply(new Builder()).build(); + } + + /** + * [preview] This functionality is in technical preview and may be changed or removed in a future release. OpenSearch will work to fix + * any issues, but features in technical preview are not subject to the support SLA of official GA features. + *

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

+ */ + @Nullable + public final Long limit() { + return this.limit; + } + + /** + * Serialize this object to JSON. + */ + @Override + public void serialize(JsonGenerator generator, JsonpMapper mapper) { + generator.writeStartObject(); + serializeInternal(generator, mapper); + generator.writeEnd(); + } + + protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { + if (this.limit != null) { + generator.writeKey("limit"); + generator.write(this.limit); + } + } + + // --------------------------------------------------------------------------------------------- + + @Override + @Nonnull + public Builder toBuilder() { + return new Builder(this); + } + + @Nonnull + public static Builder builder() { + return new Builder(); + } + + /** + * Builder for {@link IndexSettingsMappingLimitDimensionFields}. + */ + public static class Builder extends ObjectBuilderBase implements CopyableBuilder { + @Nullable + private Long limit; + + public Builder() {} + + private Builder(IndexSettingsMappingLimitDimensionFields o) { + this.limit = o.limit; + } + + private Builder(Builder o) { + this.limit = o.limit; + } + + @Override + @Nonnull + public Builder copy() { + return new Builder(this); + } + + /** + * [preview] This functionality is in technical preview and may be changed or removed in a future release. OpenSearch will work to + * fix any issues, but features in technical preview are not subject to the support SLA of official GA features. + *

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

+ */ + @Nonnull + public final Builder limit(@Nullable Long value) { + this.limit = value; + return this; + } + + /** + * Builds a {@link IndexSettingsMappingLimitDimensionFields}. + * + * @throws NullPointerException if some of the required fields are null. + */ + @Override + @Nonnull + public IndexSettingsMappingLimitDimensionFields build() { + _checkSingleUse(); + + return new IndexSettingsMappingLimitDimensionFields(this); + } + } + + // --------------------------------------------------------------------------------------------- + + /** + * Json deserializer for {@link IndexSettingsMappingLimitDimensionFields} + */ + public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer.lazy( + Builder::new, + IndexSettingsMappingLimitDimensionFields::setupIndexSettingsMappingLimitDimensionFieldsDeserializer + ); + + protected static void setupIndexSettingsMappingLimitDimensionFieldsDeserializer( + ObjectDeserializer op + ) { + op.add(Builder::limit, JsonpDeserializer.longDeserializer(), "limit"); + } + + @Override + public int hashCode() { + int result = 17; + result = 31 * result + Objects.hashCode(this.limit); + return result; + } + + @Override + public boolean equals(Object o) { + if (this == o) return true; + if (o == null || this.getClass() != o.getClass()) return false; + IndexSettingsMappingLimitDimensionFields other = (IndexSettingsMappingLimitDimensionFields) o; + return Objects.equals(this.limit, other.limit); + } +} diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/indices/IndexSettingsMappingLimitFieldNameLength.java b/java-client/src/generated/java/org/opensearch/client/opensearch/indices/IndexSettingsMappingLimitFieldNameLength.java new file mode 100644 index 0000000000..7202fb2b09 --- /dev/null +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/indices/IndexSettingsMappingLimitFieldNameLength.java @@ -0,0 +1,204 @@ +/* + * SPDX-License-Identifier: Apache-2.0 + * + * The OpenSearch Contributors require contributions made to + * this file be licensed under the Apache-2.0 license or a + * compatible open source license. + */ + +/* + * 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. + */ + +/* + * Modifications Copyright OpenSearch Contributors. See + * GitHub history for details. + */ + +//---------------------------------------------------- +// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. +//---------------------------------------------------- + +package org.opensearch.client.opensearch.indices; + +import jakarta.json.stream.JsonGenerator; +import java.util.Objects; +import java.util.function.Function; +import javax.annotation.Generated; +import javax.annotation.Nonnull; +import javax.annotation.Nullable; +import org.opensearch.client.json.JsonpDeserializable; +import org.opensearch.client.json.JsonpDeserializer; +import org.opensearch.client.json.JsonpMapper; +import org.opensearch.client.json.ObjectBuilderDeserializer; +import org.opensearch.client.json.ObjectDeserializer; +import org.opensearch.client.json.PlainJsonSerializable; +import org.opensearch.client.util.CopyableBuilder; +import org.opensearch.client.util.ObjectBuilder; +import org.opensearch.client.util.ObjectBuilderBase; +import org.opensearch.client.util.ToCopyableBuilder; + +// typedef: indices.IndexSettingsMappingLimitFieldNameLength + +@JsonpDeserializable +@Generated("org.opensearch.client.codegen.CodeGenerator") +public class IndexSettingsMappingLimitFieldNameLength + implements + PlainJsonSerializable, + ToCopyableBuilder { + + @Nullable + private final Long limit; + + // --------------------------------------------------------------------------------------------- + + private IndexSettingsMappingLimitFieldNameLength(Builder builder) { + this.limit = builder.limit; + } + + public static IndexSettingsMappingLimitFieldNameLength of( + Function> fn + ) { + return fn.apply(new Builder()).build(); + } + + /** + * Setting for the maximum length of a field name. This setting isn't really something that addresses mappings explosion but might still + * be useful if you want to limit the field length. It usually shouldn't be necessary to set this setting. The default is okay unless a + * user starts to add a huge number of fields with really long names. Default is Long.MAX_VALUE (no limit). + *

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

+ */ + @Nullable + public final Long limit() { + return this.limit; + } + + /** + * Serialize this object to JSON. + */ + @Override + public void serialize(JsonGenerator generator, JsonpMapper mapper) { + generator.writeStartObject(); + serializeInternal(generator, mapper); + generator.writeEnd(); + } + + protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { + if (this.limit != null) { + generator.writeKey("limit"); + generator.write(this.limit); + } + } + + // --------------------------------------------------------------------------------------------- + + @Override + @Nonnull + public Builder toBuilder() { + return new Builder(this); + } + + @Nonnull + public static Builder builder() { + return new Builder(); + } + + /** + * Builder for {@link IndexSettingsMappingLimitFieldNameLength}. + */ + public static class Builder extends ObjectBuilderBase implements CopyableBuilder { + @Nullable + private Long limit; + + public Builder() {} + + private Builder(IndexSettingsMappingLimitFieldNameLength o) { + this.limit = o.limit; + } + + private Builder(Builder o) { + this.limit = o.limit; + } + + @Override + @Nonnull + public Builder copy() { + return new Builder(this); + } + + /** + * Setting for the maximum length of a field name. This setting isn't really something that addresses mappings explosion but might + * still be useful if you want to limit the field length. It usually shouldn't be necessary to set this setting. The default is okay + * unless a user starts to add a huge number of fields with really long names. Default is Long.MAX_VALUE (no limit). + *

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

+ */ + @Nonnull + public final Builder limit(@Nullable Long value) { + this.limit = value; + return this; + } + + /** + * Builds a {@link IndexSettingsMappingLimitFieldNameLength}. + * + * @throws NullPointerException if some of the required fields are null. + */ + @Override + @Nonnull + public IndexSettingsMappingLimitFieldNameLength build() { + _checkSingleUse(); + + return new IndexSettingsMappingLimitFieldNameLength(this); + } + } + + // --------------------------------------------------------------------------------------------- + + /** + * Json deserializer for {@link IndexSettingsMappingLimitFieldNameLength} + */ + public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer.lazy( + Builder::new, + IndexSettingsMappingLimitFieldNameLength::setupIndexSettingsMappingLimitFieldNameLengthDeserializer + ); + + protected static void setupIndexSettingsMappingLimitFieldNameLengthDeserializer( + ObjectDeserializer op + ) { + op.add(Builder::limit, JsonpDeserializer.longDeserializer(), "limit"); + } + + @Override + public int hashCode() { + int result = 17; + result = 31 * result + Objects.hashCode(this.limit); + return result; + } + + @Override + public boolean equals(Object o) { + if (this == o) return true; + if (o == null || this.getClass() != o.getClass()) return false; + IndexSettingsMappingLimitFieldNameLength other = (IndexSettingsMappingLimitFieldNameLength) o; + return Objects.equals(this.limit, other.limit); + } +} diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/indices/IndexSettingsMappingLimitNestedFields.java b/java-client/src/generated/java/org/opensearch/client/opensearch/indices/IndexSettingsMappingLimitNestedFields.java new file mode 100644 index 0000000000..f799ab870a --- /dev/null +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/indices/IndexSettingsMappingLimitNestedFields.java @@ -0,0 +1,204 @@ +/* + * SPDX-License-Identifier: Apache-2.0 + * + * The OpenSearch Contributors require contributions made to + * this file be licensed under the Apache-2.0 license or a + * compatible open source license. + */ + +/* + * 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. + */ + +/* + * Modifications Copyright OpenSearch Contributors. See + * GitHub history for details. + */ + +//---------------------------------------------------- +// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. +//---------------------------------------------------- + +package org.opensearch.client.opensearch.indices; + +import jakarta.json.stream.JsonGenerator; +import java.util.Objects; +import java.util.function.Function; +import javax.annotation.Generated; +import javax.annotation.Nonnull; +import javax.annotation.Nullable; +import org.opensearch.client.json.JsonpDeserializable; +import org.opensearch.client.json.JsonpDeserializer; +import org.opensearch.client.json.JsonpMapper; +import org.opensearch.client.json.ObjectBuilderDeserializer; +import org.opensearch.client.json.ObjectDeserializer; +import org.opensearch.client.json.PlainJsonSerializable; +import org.opensearch.client.util.CopyableBuilder; +import org.opensearch.client.util.ObjectBuilder; +import org.opensearch.client.util.ObjectBuilderBase; +import org.opensearch.client.util.ToCopyableBuilder; + +// typedef: indices.IndexSettingsMappingLimitNestedFields + +@JsonpDeserializable +@Generated("org.opensearch.client.codegen.CodeGenerator") +public class IndexSettingsMappingLimitNestedFields + implements + PlainJsonSerializable, + ToCopyableBuilder { + + @Nullable + private final Long limit; + + // --------------------------------------------------------------------------------------------- + + private IndexSettingsMappingLimitNestedFields(Builder builder) { + this.limit = builder.limit; + } + + public static IndexSettingsMappingLimitNestedFields of( + Function> fn + ) { + return fn.apply(new Builder()).build(); + } + + /** + * The maximum number of distinct nested mappings in an index. The nested type should only be used in special cases, when arrays of + * objects need to be queried independently of each other. To safeguard against poorly designed mappings, this setting limits the number + * of unique nested types per index. + *

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

+ */ + @Nullable + public final Long limit() { + return this.limit; + } + + /** + * Serialize this object to JSON. + */ + @Override + public void serialize(JsonGenerator generator, JsonpMapper mapper) { + generator.writeStartObject(); + serializeInternal(generator, mapper); + generator.writeEnd(); + } + + protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { + if (this.limit != null) { + generator.writeKey("limit"); + generator.write(this.limit); + } + } + + // --------------------------------------------------------------------------------------------- + + @Override + @Nonnull + public Builder toBuilder() { + return new Builder(this); + } + + @Nonnull + public static Builder builder() { + return new Builder(); + } + + /** + * Builder for {@link IndexSettingsMappingLimitNestedFields}. + */ + public static class Builder extends ObjectBuilderBase implements CopyableBuilder { + @Nullable + private Long limit; + + public Builder() {} + + private Builder(IndexSettingsMappingLimitNestedFields o) { + this.limit = o.limit; + } + + private Builder(Builder o) { + this.limit = o.limit; + } + + @Override + @Nonnull + public Builder copy() { + return new Builder(this); + } + + /** + * The maximum number of distinct nested mappings in an index. The nested type should only be used in special cases, when arrays of + * objects need to be queried independently of each other. To safeguard against poorly designed mappings, this setting limits the + * number of unique nested types per index. + *

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

+ */ + @Nonnull + public final Builder limit(@Nullable Long value) { + this.limit = value; + return this; + } + + /** + * Builds a {@link IndexSettingsMappingLimitNestedFields}. + * + * @throws NullPointerException if some of the required fields are null. + */ + @Override + @Nonnull + public IndexSettingsMappingLimitNestedFields build() { + _checkSingleUse(); + + return new IndexSettingsMappingLimitNestedFields(this); + } + } + + // --------------------------------------------------------------------------------------------- + + /** + * Json deserializer for {@link IndexSettingsMappingLimitNestedFields} + */ + public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer.lazy( + Builder::new, + IndexSettingsMappingLimitNestedFields::setupIndexSettingsMappingLimitNestedFieldsDeserializer + ); + + protected static void setupIndexSettingsMappingLimitNestedFieldsDeserializer( + ObjectDeserializer op + ) { + op.add(Builder::limit, JsonpDeserializer.longDeserializer(), "limit"); + } + + @Override + public int hashCode() { + int result = 17; + result = 31 * result + Objects.hashCode(this.limit); + return result; + } + + @Override + public boolean equals(Object o) { + if (this == o) return true; + if (o == null || this.getClass() != o.getClass()) return false; + IndexSettingsMappingLimitNestedFields other = (IndexSettingsMappingLimitNestedFields) o; + return Objects.equals(this.limit, other.limit); + } +} diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/indices/IndexSettingsMappingLimitNestedObjects.java b/java-client/src/generated/java/org/opensearch/client/opensearch/indices/IndexSettingsMappingLimitNestedObjects.java new file mode 100644 index 0000000000..48a15063de --- /dev/null +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/indices/IndexSettingsMappingLimitNestedObjects.java @@ -0,0 +1,202 @@ +/* + * SPDX-License-Identifier: Apache-2.0 + * + * The OpenSearch Contributors require contributions made to + * this file be licensed under the Apache-2.0 license or a + * compatible open source license. + */ + +/* + * 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. + */ + +/* + * Modifications Copyright OpenSearch Contributors. See + * GitHub history for details. + */ + +//---------------------------------------------------- +// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. +//---------------------------------------------------- + +package org.opensearch.client.opensearch.indices; + +import jakarta.json.stream.JsonGenerator; +import java.util.Objects; +import java.util.function.Function; +import javax.annotation.Generated; +import javax.annotation.Nonnull; +import javax.annotation.Nullable; +import org.opensearch.client.json.JsonpDeserializable; +import org.opensearch.client.json.JsonpDeserializer; +import org.opensearch.client.json.JsonpMapper; +import org.opensearch.client.json.ObjectBuilderDeserializer; +import org.opensearch.client.json.ObjectDeserializer; +import org.opensearch.client.json.PlainJsonSerializable; +import org.opensearch.client.util.CopyableBuilder; +import org.opensearch.client.util.ObjectBuilder; +import org.opensearch.client.util.ObjectBuilderBase; +import org.opensearch.client.util.ToCopyableBuilder; + +// typedef: indices.IndexSettingsMappingLimitNestedObjects + +@JsonpDeserializable +@Generated("org.opensearch.client.codegen.CodeGenerator") +public class IndexSettingsMappingLimitNestedObjects + implements + PlainJsonSerializable, + ToCopyableBuilder { + + @Nullable + private final Long limit; + + // --------------------------------------------------------------------------------------------- + + private IndexSettingsMappingLimitNestedObjects(Builder builder) { + this.limit = builder.limit; + } + + public static IndexSettingsMappingLimitNestedObjects of( + Function> fn + ) { + return fn.apply(new Builder()).build(); + } + + /** + * The maximum number of nested JSON objects that a single document can contain across all nested types. This limit helps to prevent out + * of memory errors when a document contains too many nested objects. + *

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

+ */ + @Nullable + public final Long limit() { + return this.limit; + } + + /** + * Serialize this object to JSON. + */ + @Override + public void serialize(JsonGenerator generator, JsonpMapper mapper) { + generator.writeStartObject(); + serializeInternal(generator, mapper); + generator.writeEnd(); + } + + protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { + if (this.limit != null) { + generator.writeKey("limit"); + generator.write(this.limit); + } + } + + // --------------------------------------------------------------------------------------------- + + @Override + @Nonnull + public Builder toBuilder() { + return new Builder(this); + } + + @Nonnull + public static Builder builder() { + return new Builder(); + } + + /** + * Builder for {@link IndexSettingsMappingLimitNestedObjects}. + */ + public static class Builder extends ObjectBuilderBase implements CopyableBuilder { + @Nullable + private Long limit; + + public Builder() {} + + private Builder(IndexSettingsMappingLimitNestedObjects o) { + this.limit = o.limit; + } + + private Builder(Builder o) { + this.limit = o.limit; + } + + @Override + @Nonnull + public Builder copy() { + return new Builder(this); + } + + /** + * The maximum number of nested JSON objects that a single document can contain across all nested types. This limit helps to prevent + * out of memory errors when a document contains too many nested objects. + *

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

+ */ + @Nonnull + public final Builder limit(@Nullable Long value) { + this.limit = value; + return this; + } + + /** + * Builds a {@link IndexSettingsMappingLimitNestedObjects}. + * + * @throws NullPointerException if some of the required fields are null. + */ + @Override + @Nonnull + public IndexSettingsMappingLimitNestedObjects build() { + _checkSingleUse(); + + return new IndexSettingsMappingLimitNestedObjects(this); + } + } + + // --------------------------------------------------------------------------------------------- + + /** + * Json deserializer for {@link IndexSettingsMappingLimitNestedObjects} + */ + public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer.lazy( + Builder::new, + IndexSettingsMappingLimitNestedObjects::setupIndexSettingsMappingLimitNestedObjectsDeserializer + ); + + protected static void setupIndexSettingsMappingLimitNestedObjectsDeserializer( + ObjectDeserializer op + ) { + op.add(Builder::limit, JsonpDeserializer.longDeserializer(), "limit"); + } + + @Override + public int hashCode() { + int result = 17; + result = 31 * result + Objects.hashCode(this.limit); + return result; + } + + @Override + public boolean equals(Object o) { + if (this == o) return true; + if (o == null || this.getClass() != o.getClass()) return false; + IndexSettingsMappingLimitNestedObjects other = (IndexSettingsMappingLimitNestedObjects) o; + return Objects.equals(this.limit, other.limit); + } +} diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/indices/IndexSettingsMappingLimitTotalFields.java b/java-client/src/generated/java/org/opensearch/client/opensearch/indices/IndexSettingsMappingLimitTotalFields.java new file mode 100644 index 0000000000..05c926fe1f --- /dev/null +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/indices/IndexSettingsMappingLimitTotalFields.java @@ -0,0 +1,204 @@ +/* + * SPDX-License-Identifier: Apache-2.0 + * + * The OpenSearch Contributors require contributions made to + * this file be licensed under the Apache-2.0 license or a + * compatible open source license. + */ + +/* + * 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. + */ + +/* + * Modifications Copyright OpenSearch Contributors. See + * GitHub history for details. + */ + +//---------------------------------------------------- +// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. +//---------------------------------------------------- + +package org.opensearch.client.opensearch.indices; + +import jakarta.json.stream.JsonGenerator; +import java.util.Objects; +import java.util.function.Function; +import javax.annotation.Generated; +import javax.annotation.Nonnull; +import javax.annotation.Nullable; +import org.opensearch.client.json.JsonpDeserializable; +import org.opensearch.client.json.JsonpDeserializer; +import org.opensearch.client.json.JsonpMapper; +import org.opensearch.client.json.ObjectBuilderDeserializer; +import org.opensearch.client.json.ObjectDeserializer; +import org.opensearch.client.json.PlainJsonSerializable; +import org.opensearch.client.util.CopyableBuilder; +import org.opensearch.client.util.ObjectBuilder; +import org.opensearch.client.util.ObjectBuilderBase; +import org.opensearch.client.util.ToCopyableBuilder; + +// typedef: indices.IndexSettingsMappingLimitTotalFields + +@JsonpDeserializable +@Generated("org.opensearch.client.codegen.CodeGenerator") +public class IndexSettingsMappingLimitTotalFields + implements + PlainJsonSerializable, + ToCopyableBuilder { + + @Nullable + private final Long limit; + + // --------------------------------------------------------------------------------------------- + + private IndexSettingsMappingLimitTotalFields(Builder builder) { + this.limit = builder.limit; + } + + public static IndexSettingsMappingLimitTotalFields of( + Function> fn + ) { + return fn.apply(new Builder()).build(); + } + + /** + * The maximum number of fields in an index. Field and object mappings, as well as field aliases count towards this limit. The limit is + * in place to prevent mappings and searches from becoming too large. Higher values can lead to performance degradations and memory + * issues, especially in clusters with a high load or few resources. + *

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

+ */ + @Nullable + public final Long limit() { + return this.limit; + } + + /** + * Serialize this object to JSON. + */ + @Override + public void serialize(JsonGenerator generator, JsonpMapper mapper) { + generator.writeStartObject(); + serializeInternal(generator, mapper); + generator.writeEnd(); + } + + protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { + if (this.limit != null) { + generator.writeKey("limit"); + generator.write(this.limit); + } + } + + // --------------------------------------------------------------------------------------------- + + @Override + @Nonnull + public Builder toBuilder() { + return new Builder(this); + } + + @Nonnull + public static Builder builder() { + return new Builder(); + } + + /** + * Builder for {@link IndexSettingsMappingLimitTotalFields}. + */ + public static class Builder extends ObjectBuilderBase implements CopyableBuilder { + @Nullable + private Long limit; + + public Builder() {} + + private Builder(IndexSettingsMappingLimitTotalFields o) { + this.limit = o.limit; + } + + private Builder(Builder o) { + this.limit = o.limit; + } + + @Override + @Nonnull + public Builder copy() { + return new Builder(this); + } + + /** + * The maximum number of fields in an index. Field and object mappings, as well as field aliases count towards this limit. The limit + * is in place to prevent mappings and searches from becoming too large. Higher values can lead to performance degradations and + * memory issues, especially in clusters with a high load or few resources. + *

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

+ */ + @Nonnull + public final Builder limit(@Nullable Long value) { + this.limit = value; + return this; + } + + /** + * Builds a {@link IndexSettingsMappingLimitTotalFields}. + * + * @throws NullPointerException if some of the required fields are null. + */ + @Override + @Nonnull + public IndexSettingsMappingLimitTotalFields build() { + _checkSingleUse(); + + return new IndexSettingsMappingLimitTotalFields(this); + } + } + + // --------------------------------------------------------------------------------------------- + + /** + * Json deserializer for {@link IndexSettingsMappingLimitTotalFields} + */ + public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer.lazy( + Builder::new, + IndexSettingsMappingLimitTotalFields::setupIndexSettingsMappingLimitTotalFieldsDeserializer + ); + + protected static void setupIndexSettingsMappingLimitTotalFieldsDeserializer( + ObjectDeserializer op + ) { + op.add(Builder::limit, JsonpDeserializer.longDeserializer(), "limit"); + } + + @Override + public int hashCode() { + int result = 17; + result = 31 * result + Objects.hashCode(this.limit); + return result; + } + + @Override + public boolean equals(Object o) { + if (this == o) return true; + if (o == null || this.getClass() != o.getClass()) return false; + IndexSettingsMappingLimitTotalFields other = (IndexSettingsMappingLimitTotalFields) o; + return Objects.equals(this.limit, other.limit); + } +} diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/indices/IndexSettingsMerge.java b/java-client/src/generated/java/org/opensearch/client/opensearch/indices/IndexSettingsMerge.java new file mode 100644 index 0000000000..16e340fd68 --- /dev/null +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/indices/IndexSettingsMerge.java @@ -0,0 +1,510 @@ +/* + * SPDX-License-Identifier: Apache-2.0 + * + * The OpenSearch Contributors require contributions made to + * this file be licensed under the Apache-2.0 license or a + * compatible open source license. + */ + +/* + * 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. + */ + +/* + * Modifications Copyright OpenSearch Contributors. See + * GitHub history for details. + */ + +//---------------------------------------------------- +// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. +//---------------------------------------------------- + +package org.opensearch.client.opensearch.indices; + +import jakarta.json.stream.JsonGenerator; +import java.util.Objects; +import java.util.function.Function; +import javax.annotation.Generated; +import javax.annotation.Nonnull; +import javax.annotation.Nullable; +import org.opensearch.client.json.JsonpDeserializable; +import org.opensearch.client.json.JsonpDeserializer; +import org.opensearch.client.json.JsonpMapper; +import org.opensearch.client.json.ObjectBuilderDeserializer; +import org.opensearch.client.json.ObjectDeserializer; +import org.opensearch.client.json.PlainJsonSerializable; +import org.opensearch.client.util.CopyableBuilder; +import org.opensearch.client.util.ObjectBuilder; +import org.opensearch.client.util.ObjectBuilderBase; +import org.opensearch.client.util.ToCopyableBuilder; + +// typedef: indices.IndexSettingsMerge + +@JsonpDeserializable +@Generated("org.opensearch.client.codegen.CodeGenerator") +public class IndexSettingsMerge implements PlainJsonSerializable, ToCopyableBuilder { + + @Nullable + private final IndexSettingsMergeLogByteSizePolicy logByteSizePolicy; + + @Nullable + private final IndexSettingsMergePolicy policy; + + @Nullable + private final Double policyDeletesPctAllowed; + + @Nullable + private final Double policyExpungeDeletesAllowed; + + @Nullable + private final String policyFloorSegment; + + @Nullable + private final Integer policyMaxMergeAtOnce; + + @Nullable + private final String policyMaxMergedSegment; + + @Nullable + private final Double policyReclaimDeletesWeight; + + @Nullable + private final Double policySegmentsPerTier; + + @Nullable + private final IndexSettingsMergeScheduler scheduler; + + // --------------------------------------------------------------------------------------------- + + private IndexSettingsMerge(Builder builder) { + this.logByteSizePolicy = builder.logByteSizePolicy; + this.policy = builder.policy; + this.policyDeletesPctAllowed = builder.policyDeletesPctAllowed; + this.policyExpungeDeletesAllowed = builder.policyExpungeDeletesAllowed; + this.policyFloorSegment = builder.policyFloorSegment; + this.policyMaxMergeAtOnce = builder.policyMaxMergeAtOnce; + this.policyMaxMergedSegment = builder.policyMaxMergedSegment; + this.policyReclaimDeletesWeight = builder.policyReclaimDeletesWeight; + this.policySegmentsPerTier = builder.policySegmentsPerTier; + this.scheduler = builder.scheduler; + } + + public static IndexSettingsMerge of(Function> fn) { + return fn.apply(new Builder()).build(); + } + + /** + * API name: {@code log_byte_size_policy} + */ + @Nullable + public final IndexSettingsMergeLogByteSizePolicy logByteSizePolicy() { + return this.logByteSizePolicy; + } + + /** + * API name: {@code policy} + */ + @Nullable + public final IndexSettingsMergePolicy policy() { + return this.policy; + } + + /** + * API name: {@code policy.deletes_pct_allowed} + */ + @Nullable + public final Double policyDeletesPctAllowed() { + return this.policyDeletesPctAllowed; + } + + /** + * API name: {@code policy.expunge_deletes_allowed} + */ + @Nullable + public final Double policyExpungeDeletesAllowed() { + return this.policyExpungeDeletesAllowed; + } + + /** + * API name: {@code policy.floor_segment} + */ + @Nullable + public final String policyFloorSegment() { + return this.policyFloorSegment; + } + + /** + * API name: {@code policy.max_merge_at_once} + */ + @Nullable + public final Integer policyMaxMergeAtOnce() { + return this.policyMaxMergeAtOnce; + } + + /** + * API name: {@code policy.max_merged_segment} + */ + @Nullable + public final String policyMaxMergedSegment() { + return this.policyMaxMergedSegment; + } + + /** + * API name: {@code policy.reclaim_deletes_weight} + */ + @Nullable + public final Double policyReclaimDeletesWeight() { + return this.policyReclaimDeletesWeight; + } + + /** + * API name: {@code policy.segments_per_tier} + */ + @Nullable + public final Double policySegmentsPerTier() { + return this.policySegmentsPerTier; + } + + /** + * API name: {@code scheduler} + */ + @Nullable + public final IndexSettingsMergeScheduler scheduler() { + return this.scheduler; + } + + /** + * Serialize this object to JSON. + */ + @Override + public void serialize(JsonGenerator generator, JsonpMapper mapper) { + generator.writeStartObject(); + serializeInternal(generator, mapper); + generator.writeEnd(); + } + + protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { + if (this.logByteSizePolicy != null) { + generator.writeKey("log_byte_size_policy"); + this.logByteSizePolicy.serialize(generator, mapper); + } + + if (this.policy != null) { + generator.writeKey("policy"); + this.policy.serialize(generator, mapper); + } + + if (this.policyDeletesPctAllowed != null) { + generator.writeKey("policy.deletes_pct_allowed"); + generator.write(this.policyDeletesPctAllowed); + } + + if (this.policyExpungeDeletesAllowed != null) { + generator.writeKey("policy.expunge_deletes_allowed"); + generator.write(this.policyExpungeDeletesAllowed); + } + + if (this.policyFloorSegment != null) { + generator.writeKey("policy.floor_segment"); + generator.write(this.policyFloorSegment); + } + + if (this.policyMaxMergeAtOnce != null) { + generator.writeKey("policy.max_merge_at_once"); + generator.write(this.policyMaxMergeAtOnce); + } + + if (this.policyMaxMergedSegment != null) { + generator.writeKey("policy.max_merged_segment"); + generator.write(this.policyMaxMergedSegment); + } + + if (this.policyReclaimDeletesWeight != null) { + generator.writeKey("policy.reclaim_deletes_weight"); + generator.write(this.policyReclaimDeletesWeight); + } + + if (this.policySegmentsPerTier != null) { + generator.writeKey("policy.segments_per_tier"); + generator.write(this.policySegmentsPerTier); + } + + if (this.scheduler != null) { + generator.writeKey("scheduler"); + this.scheduler.serialize(generator, mapper); + } + } + + // --------------------------------------------------------------------------------------------- + + @Override + @Nonnull + public Builder toBuilder() { + return new Builder(this); + } + + @Nonnull + public static Builder builder() { + return new Builder(); + } + + /** + * Builder for {@link IndexSettingsMerge}. + */ + public static class Builder extends ObjectBuilderBase implements CopyableBuilder { + @Nullable + private IndexSettingsMergeLogByteSizePolicy logByteSizePolicy; + @Nullable + private IndexSettingsMergePolicy policy; + @Nullable + private Double policyDeletesPctAllowed; + @Nullable + private Double policyExpungeDeletesAllowed; + @Nullable + private String policyFloorSegment; + @Nullable + private Integer policyMaxMergeAtOnce; + @Nullable + private String policyMaxMergedSegment; + @Nullable + private Double policyReclaimDeletesWeight; + @Nullable + private Double policySegmentsPerTier; + @Nullable + private IndexSettingsMergeScheduler scheduler; + + public Builder() {} + + private Builder(IndexSettingsMerge o) { + this.logByteSizePolicy = o.logByteSizePolicy; + this.policy = o.policy; + this.policyDeletesPctAllowed = o.policyDeletesPctAllowed; + this.policyExpungeDeletesAllowed = o.policyExpungeDeletesAllowed; + this.policyFloorSegment = o.policyFloorSegment; + this.policyMaxMergeAtOnce = o.policyMaxMergeAtOnce; + this.policyMaxMergedSegment = o.policyMaxMergedSegment; + this.policyReclaimDeletesWeight = o.policyReclaimDeletesWeight; + this.policySegmentsPerTier = o.policySegmentsPerTier; + this.scheduler = o.scheduler; + } + + private Builder(Builder o) { + this.logByteSizePolicy = o.logByteSizePolicy; + this.policy = o.policy; + this.policyDeletesPctAllowed = o.policyDeletesPctAllowed; + this.policyExpungeDeletesAllowed = o.policyExpungeDeletesAllowed; + this.policyFloorSegment = o.policyFloorSegment; + this.policyMaxMergeAtOnce = o.policyMaxMergeAtOnce; + this.policyMaxMergedSegment = o.policyMaxMergedSegment; + this.policyReclaimDeletesWeight = o.policyReclaimDeletesWeight; + this.policySegmentsPerTier = o.policySegmentsPerTier; + this.scheduler = o.scheduler; + } + + @Override + @Nonnull + public Builder copy() { + return new Builder(this); + } + + /** + * API name: {@code log_byte_size_policy} + */ + @Nonnull + public final Builder logByteSizePolicy(@Nullable IndexSettingsMergeLogByteSizePolicy value) { + this.logByteSizePolicy = value; + return this; + } + + /** + * API name: {@code log_byte_size_policy} + */ + @Nonnull + public final Builder logByteSizePolicy( + Function> fn + ) { + return logByteSizePolicy(fn.apply(new IndexSettingsMergeLogByteSizePolicy.Builder()).build()); + } + + /** + * API name: {@code policy} + */ + @Nonnull + public final Builder policy(@Nullable IndexSettingsMergePolicy value) { + this.policy = value; + return this; + } + + /** + * API name: {@code policy} + */ + @Nonnull + public final Builder policy(Function> fn) { + return policy(fn.apply(new IndexSettingsMergePolicy.Builder()).build()); + } + + /** + * API name: {@code policy.deletes_pct_allowed} + */ + @Nonnull + public final Builder policyDeletesPctAllowed(@Nullable Double value) { + this.policyDeletesPctAllowed = value; + return this; + } + + /** + * API name: {@code policy.expunge_deletes_allowed} + */ + @Nonnull + public final Builder policyExpungeDeletesAllowed(@Nullable Double value) { + this.policyExpungeDeletesAllowed = value; + return this; + } + + /** + * API name: {@code policy.floor_segment} + */ + @Nonnull + public final Builder policyFloorSegment(@Nullable String value) { + this.policyFloorSegment = value; + return this; + } + + /** + * API name: {@code policy.max_merge_at_once} + */ + @Nonnull + public final Builder policyMaxMergeAtOnce(@Nullable Integer value) { + this.policyMaxMergeAtOnce = value; + return this; + } + + /** + * API name: {@code policy.max_merged_segment} + */ + @Nonnull + public final Builder policyMaxMergedSegment(@Nullable String value) { + this.policyMaxMergedSegment = value; + return this; + } + + /** + * API name: {@code policy.reclaim_deletes_weight} + */ + @Nonnull + public final Builder policyReclaimDeletesWeight(@Nullable Double value) { + this.policyReclaimDeletesWeight = value; + return this; + } + + /** + * API name: {@code policy.segments_per_tier} + */ + @Nonnull + public final Builder policySegmentsPerTier(@Nullable Double value) { + this.policySegmentsPerTier = value; + return this; + } + + /** + * API name: {@code scheduler} + */ + @Nonnull + public final Builder scheduler(@Nullable IndexSettingsMergeScheduler value) { + this.scheduler = value; + return this; + } + + /** + * API name: {@code scheduler} + */ + @Nonnull + public final Builder scheduler(Function> fn) { + return scheduler(fn.apply(new IndexSettingsMergeScheduler.Builder()).build()); + } + + /** + * Builds a {@link IndexSettingsMerge}. + * + * @throws NullPointerException if some of the required fields are null. + */ + @Override + @Nonnull + public IndexSettingsMerge build() { + _checkSingleUse(); + + return new IndexSettingsMerge(this); + } + } + + // --------------------------------------------------------------------------------------------- + + /** + * Json deserializer for {@link IndexSettingsMerge} + */ + public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer.lazy( + Builder::new, + IndexSettingsMerge::setupIndexSettingsMergeDeserializer + ); + + protected static void setupIndexSettingsMergeDeserializer(ObjectDeserializer op) { + op.add(Builder::logByteSizePolicy, IndexSettingsMergeLogByteSizePolicy._DESERIALIZER, "log_byte_size_policy"); + op.add(Builder::policy, IndexSettingsMergePolicy._DESERIALIZER, "policy"); + op.add(Builder::policyDeletesPctAllowed, JsonpDeserializer.doubleDeserializer(), "policy.deletes_pct_allowed"); + op.add(Builder::policyExpungeDeletesAllowed, JsonpDeserializer.doubleDeserializer(), "policy.expunge_deletes_allowed"); + op.add(Builder::policyFloorSegment, JsonpDeserializer.stringDeserializer(), "policy.floor_segment"); + op.add(Builder::policyMaxMergeAtOnce, JsonpDeserializer.integerDeserializer(), "policy.max_merge_at_once"); + op.add(Builder::policyMaxMergedSegment, JsonpDeserializer.stringDeserializer(), "policy.max_merged_segment"); + op.add(Builder::policyReclaimDeletesWeight, JsonpDeserializer.doubleDeserializer(), "policy.reclaim_deletes_weight"); + op.add(Builder::policySegmentsPerTier, JsonpDeserializer.doubleDeserializer(), "policy.segments_per_tier"); + op.add(Builder::scheduler, IndexSettingsMergeScheduler._DESERIALIZER, "scheduler"); + } + + @Override + public int hashCode() { + int result = 17; + result = 31 * result + Objects.hashCode(this.logByteSizePolicy); + result = 31 * result + Objects.hashCode(this.policy); + result = 31 * result + Objects.hashCode(this.policyDeletesPctAllowed); + result = 31 * result + Objects.hashCode(this.policyExpungeDeletesAllowed); + result = 31 * result + Objects.hashCode(this.policyFloorSegment); + result = 31 * result + Objects.hashCode(this.policyMaxMergeAtOnce); + result = 31 * result + Objects.hashCode(this.policyMaxMergedSegment); + result = 31 * result + Objects.hashCode(this.policyReclaimDeletesWeight); + result = 31 * result + Objects.hashCode(this.policySegmentsPerTier); + result = 31 * result + Objects.hashCode(this.scheduler); + return result; + } + + @Override + public boolean equals(Object o) { + if (this == o) return true; + if (o == null || this.getClass() != o.getClass()) return false; + IndexSettingsMerge other = (IndexSettingsMerge) o; + return Objects.equals(this.logByteSizePolicy, other.logByteSizePolicy) + && Objects.equals(this.policy, other.policy) + && Objects.equals(this.policyDeletesPctAllowed, other.policyDeletesPctAllowed) + && Objects.equals(this.policyExpungeDeletesAllowed, other.policyExpungeDeletesAllowed) + && Objects.equals(this.policyFloorSegment, other.policyFloorSegment) + && Objects.equals(this.policyMaxMergeAtOnce, other.policyMaxMergeAtOnce) + && Objects.equals(this.policyMaxMergedSegment, other.policyMaxMergedSegment) + && Objects.equals(this.policyReclaimDeletesWeight, other.policyReclaimDeletesWeight) + && Objects.equals(this.policySegmentsPerTier, other.policySegmentsPerTier) + && Objects.equals(this.scheduler, other.scheduler); + } +} diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/indices/IndexSettingsMergeLogByteSizePolicy.java b/java-client/src/generated/java/org/opensearch/client/opensearch/indices/IndexSettingsMergeLogByteSizePolicy.java new file mode 100644 index 0000000000..09a9440f07 --- /dev/null +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/indices/IndexSettingsMergeLogByteSizePolicy.java @@ -0,0 +1,359 @@ +/* + * SPDX-License-Identifier: Apache-2.0 + * + * The OpenSearch Contributors require contributions made to + * this file be licensed under the Apache-2.0 license or a + * compatible open source license. + */ + +/* + * 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. + */ + +/* + * Modifications Copyright OpenSearch Contributors. See + * GitHub history for details. + */ + +//---------------------------------------------------- +// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. +//---------------------------------------------------- + +package org.opensearch.client.opensearch.indices; + +import jakarta.json.stream.JsonGenerator; +import java.util.Objects; +import java.util.function.Function; +import javax.annotation.Generated; +import javax.annotation.Nonnull; +import javax.annotation.Nullable; +import org.opensearch.client.json.JsonpDeserializable; +import org.opensearch.client.json.JsonpDeserializer; +import org.opensearch.client.json.JsonpMapper; +import org.opensearch.client.json.ObjectBuilderDeserializer; +import org.opensearch.client.json.ObjectDeserializer; +import org.opensearch.client.json.PlainJsonSerializable; +import org.opensearch.client.util.CopyableBuilder; +import org.opensearch.client.util.ObjectBuilder; +import org.opensearch.client.util.ObjectBuilderBase; +import org.opensearch.client.util.ToCopyableBuilder; + +// typedef: indices.IndexSettingsMergeLogByteSizePolicy + +@JsonpDeserializable +@Generated("org.opensearch.client.codegen.CodeGenerator") +public class IndexSettingsMergeLogByteSizePolicy + implements + PlainJsonSerializable, + ToCopyableBuilder { + + @Nullable + private final String maxMergeSegment; + + @Nullable + private final String maxMergeSegmentForcedMerge; + + @Nullable + private final Integer maxMergedDocs; + + @Nullable + private final Integer mergeFactor; + + @Nullable + private final String minMerge; + + @Nullable + private final Double noCfsRatio; + + // --------------------------------------------------------------------------------------------- + + private IndexSettingsMergeLogByteSizePolicy(Builder builder) { + this.maxMergeSegment = builder.maxMergeSegment; + this.maxMergeSegmentForcedMerge = builder.maxMergeSegmentForcedMerge; + this.maxMergedDocs = builder.maxMergedDocs; + this.mergeFactor = builder.mergeFactor; + this.minMerge = builder.minMerge; + this.noCfsRatio = builder.noCfsRatio; + } + + public static IndexSettingsMergeLogByteSizePolicy of( + Function> fn + ) { + return fn.apply(new Builder()).build(); + } + + /** + * API name: {@code max_merge_segment} + */ + @Nullable + public final String maxMergeSegment() { + return this.maxMergeSegment; + } + + /** + * API name: {@code max_merge_segment_forced_merge} + */ + @Nullable + public final String maxMergeSegmentForcedMerge() { + return this.maxMergeSegmentForcedMerge; + } + + /** + * API name: {@code max_merged_docs} + */ + @Nullable + public final Integer maxMergedDocs() { + return this.maxMergedDocs; + } + + /** + * API name: {@code merge_factor} + */ + @Nullable + public final Integer mergeFactor() { + return this.mergeFactor; + } + + /** + * API name: {@code min_merge} + */ + @Nullable + public final String minMerge() { + return this.minMerge; + } + + /** + * API name: {@code no_cfs_ratio} + */ + @Nullable + public final Double noCfsRatio() { + return this.noCfsRatio; + } + + /** + * Serialize this object to JSON. + */ + @Override + public void serialize(JsonGenerator generator, JsonpMapper mapper) { + generator.writeStartObject(); + serializeInternal(generator, mapper); + generator.writeEnd(); + } + + protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { + if (this.maxMergeSegment != null) { + generator.writeKey("max_merge_segment"); + generator.write(this.maxMergeSegment); + } + + if (this.maxMergeSegmentForcedMerge != null) { + generator.writeKey("max_merge_segment_forced_merge"); + generator.write(this.maxMergeSegmentForcedMerge); + } + + if (this.maxMergedDocs != null) { + generator.writeKey("max_merged_docs"); + generator.write(this.maxMergedDocs); + } + + if (this.mergeFactor != null) { + generator.writeKey("merge_factor"); + generator.write(this.mergeFactor); + } + + if (this.minMerge != null) { + generator.writeKey("min_merge"); + generator.write(this.minMerge); + } + + if (this.noCfsRatio != null) { + generator.writeKey("no_cfs_ratio"); + generator.write(this.noCfsRatio); + } + } + + // --------------------------------------------------------------------------------------------- + + @Override + @Nonnull + public Builder toBuilder() { + return new Builder(this); + } + + @Nonnull + public static Builder builder() { + return new Builder(); + } + + /** + * Builder for {@link IndexSettingsMergeLogByteSizePolicy}. + */ + public static class Builder extends ObjectBuilderBase implements CopyableBuilder { + @Nullable + private String maxMergeSegment; + @Nullable + private String maxMergeSegmentForcedMerge; + @Nullable + private Integer maxMergedDocs; + @Nullable + private Integer mergeFactor; + @Nullable + private String minMerge; + @Nullable + private Double noCfsRatio; + + public Builder() {} + + private Builder(IndexSettingsMergeLogByteSizePolicy o) { + this.maxMergeSegment = o.maxMergeSegment; + this.maxMergeSegmentForcedMerge = o.maxMergeSegmentForcedMerge; + this.maxMergedDocs = o.maxMergedDocs; + this.mergeFactor = o.mergeFactor; + this.minMerge = o.minMerge; + this.noCfsRatio = o.noCfsRatio; + } + + private Builder(Builder o) { + this.maxMergeSegment = o.maxMergeSegment; + this.maxMergeSegmentForcedMerge = o.maxMergeSegmentForcedMerge; + this.maxMergedDocs = o.maxMergedDocs; + this.mergeFactor = o.mergeFactor; + this.minMerge = o.minMerge; + this.noCfsRatio = o.noCfsRatio; + } + + @Override + @Nonnull + public Builder copy() { + return new Builder(this); + } + + /** + * API name: {@code max_merge_segment} + */ + @Nonnull + public final Builder maxMergeSegment(@Nullable String value) { + this.maxMergeSegment = value; + return this; + } + + /** + * API name: {@code max_merge_segment_forced_merge} + */ + @Nonnull + public final Builder maxMergeSegmentForcedMerge(@Nullable String value) { + this.maxMergeSegmentForcedMerge = value; + return this; + } + + /** + * API name: {@code max_merged_docs} + */ + @Nonnull + public final Builder maxMergedDocs(@Nullable Integer value) { + this.maxMergedDocs = value; + return this; + } + + /** + * API name: {@code merge_factor} + */ + @Nonnull + public final Builder mergeFactor(@Nullable Integer value) { + this.mergeFactor = value; + return this; + } + + /** + * API name: {@code min_merge} + */ + @Nonnull + public final Builder minMerge(@Nullable String value) { + this.minMerge = value; + return this; + } + + /** + * API name: {@code no_cfs_ratio} + */ + @Nonnull + public final Builder noCfsRatio(@Nullable Double value) { + this.noCfsRatio = value; + return this; + } + + /** + * Builds a {@link IndexSettingsMergeLogByteSizePolicy}. + * + * @throws NullPointerException if some of the required fields are null. + */ + @Override + @Nonnull + public IndexSettingsMergeLogByteSizePolicy build() { + _checkSingleUse(); + + return new IndexSettingsMergeLogByteSizePolicy(this); + } + } + + // --------------------------------------------------------------------------------------------- + + /** + * Json deserializer for {@link IndexSettingsMergeLogByteSizePolicy} + */ + public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer.lazy( + Builder::new, + IndexSettingsMergeLogByteSizePolicy::setupIndexSettingsMergeLogByteSizePolicyDeserializer + ); + + protected static void setupIndexSettingsMergeLogByteSizePolicyDeserializer( + ObjectDeserializer op + ) { + op.add(Builder::maxMergeSegment, JsonpDeserializer.stringDeserializer(), "max_merge_segment"); + op.add(Builder::maxMergeSegmentForcedMerge, JsonpDeserializer.stringDeserializer(), "max_merge_segment_forced_merge"); + op.add(Builder::maxMergedDocs, JsonpDeserializer.integerDeserializer(), "max_merged_docs"); + op.add(Builder::mergeFactor, JsonpDeserializer.integerDeserializer(), "merge_factor"); + op.add(Builder::minMerge, JsonpDeserializer.stringDeserializer(), "min_merge"); + op.add(Builder::noCfsRatio, JsonpDeserializer.doubleDeserializer(), "no_cfs_ratio"); + } + + @Override + public int hashCode() { + int result = 17; + result = 31 * result + Objects.hashCode(this.maxMergeSegment); + result = 31 * result + Objects.hashCode(this.maxMergeSegmentForcedMerge); + result = 31 * result + Objects.hashCode(this.maxMergedDocs); + result = 31 * result + Objects.hashCode(this.mergeFactor); + result = 31 * result + Objects.hashCode(this.minMerge); + result = 31 * result + Objects.hashCode(this.noCfsRatio); + return result; + } + + @Override + public boolean equals(Object o) { + if (this == o) return true; + if (o == null || this.getClass() != o.getClass()) return false; + IndexSettingsMergeLogByteSizePolicy other = (IndexSettingsMergeLogByteSizePolicy) o; + return Objects.equals(this.maxMergeSegment, other.maxMergeSegment) + && Objects.equals(this.maxMergeSegmentForcedMerge, other.maxMergeSegmentForcedMerge) + && Objects.equals(this.maxMergedDocs, other.maxMergedDocs) + && Objects.equals(this.mergeFactor, other.mergeFactor) + && Objects.equals(this.minMerge, other.minMerge) + && Objects.equals(this.noCfsRatio, other.noCfsRatio); + } +} diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/indices/IndexSettingsMergePolicy.java b/java-client/src/generated/java/org/opensearch/client/opensearch/indices/IndexSettingsMergePolicy.java new file mode 100644 index 0000000000..3f04f6b72d --- /dev/null +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/indices/IndexSettingsMergePolicy.java @@ -0,0 +1,189 @@ +/* + * SPDX-License-Identifier: Apache-2.0 + * + * The OpenSearch Contributors require contributions made to + * this file be licensed under the Apache-2.0 license or a + * compatible open source license. + */ + +/* + * 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. + */ + +/* + * Modifications Copyright OpenSearch Contributors. See + * GitHub history for details. + */ + +//---------------------------------------------------- +// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. +//---------------------------------------------------- + +package org.opensearch.client.opensearch.indices; + +import jakarta.json.stream.JsonGenerator; +import java.util.Objects; +import java.util.function.Function; +import javax.annotation.Generated; +import org.opensearch.client.json.JsonpDeserializable; +import org.opensearch.client.json.JsonpDeserializer; +import org.opensearch.client.json.JsonpMapper; +import org.opensearch.client.json.JsonpSerializable; +import org.opensearch.client.json.PlainJsonSerializable; +import org.opensearch.client.json.UnionDeserializer; +import org.opensearch.client.util.ApiTypeHelper; +import org.opensearch.client.util.ObjectBuilder; +import org.opensearch.client.util.ObjectBuilderBase; +import org.opensearch.client.util.TaggedUnion; +import org.opensearch.client.util.TaggedUnionUtils; + +// typedef: indices.IndexSettingsMergePolicy + +@JsonpDeserializable +@Generated("org.opensearch.client.codegen.CodeGenerator") +public class IndexSettingsMergePolicy implements TaggedUnion, PlainJsonSerializable { + /** + * {@link IndexSettingsMergePolicy} variant kinds. + */ + public enum Kind { + Name, + TieredPolicyConfig + } + + private final Kind _kind; + private final Object _value; + + @Override + public final Kind _kind() { + return _kind; + } + + @Override + public final Object _get() { + return _value; + } + + private IndexSettingsMergePolicy(Kind kind, Object value) { + this._kind = kind; + this._value = value; + } + + private IndexSettingsMergePolicy(Builder builder) { + this._kind = ApiTypeHelper.requireNonNull(builder._kind, builder, ""); + this._value = ApiTypeHelper.requireNonNull(builder._value, builder, ""); + } + + public static IndexSettingsMergePolicy of(Function> fn) { + return fn.apply(new Builder()).build(); + } + + /** + * Is this variant instance of kind {@code name}? + */ + public boolean isName() { + return _kind == Kind.Name; + } + + /** + * Get the {@code name} variant value. + * + * @throws IllegalStateException if the current variant is not the {@code name} kind. + */ + public IndexSettingsMergePolicyName name() { + return TaggedUnionUtils.get(this, Kind.Name); + } + + /** + * Is this variant instance of kind {@code tiered_policy_config}? + */ + public boolean isTieredPolicyConfig() { + return _kind == Kind.TieredPolicyConfig; + } + + /** + * Get the {@code tiered_policy_config} variant value. + * + * @throws IllegalStateException if the current variant is not the {@code tiered_policy_config} kind. + */ + public IndexSettingsMergeTieredPolicy tieredPolicyConfig() { + return TaggedUnionUtils.get(this, Kind.TieredPolicyConfig); + } + + @Override + public void serialize(JsonGenerator generator, JsonpMapper mapper) { + if (_value instanceof JsonpSerializable) { + ((JsonpSerializable) _value).serialize(generator, mapper); + } + } + + public static class Builder extends ObjectBuilderBase implements ObjectBuilder { + private Kind _kind; + private Object _value; + + public ObjectBuilder name(IndexSettingsMergePolicyName v) { + this._kind = Kind.Name; + this._value = v; + return this; + } + + public ObjectBuilder tieredPolicyConfig(IndexSettingsMergeTieredPolicy v) { + this._kind = Kind.TieredPolicyConfig; + this._value = v; + return this; + } + + public ObjectBuilder tieredPolicyConfig( + Function> fn + ) { + return this.tieredPolicyConfig(fn.apply(new IndexSettingsMergeTieredPolicy.Builder()).build()); + } + + @Override + public IndexSettingsMergePolicy build() { + _checkSingleUse(); + return new IndexSettingsMergePolicy(this); + } + } + + private static JsonpDeserializer buildIndexSettingsMergePolicyDeserializer() { + return new UnionDeserializer.Builder(IndexSettingsMergePolicy::new, false).addMember( + Kind.Name, + IndexSettingsMergePolicyName._DESERIALIZER + ).addMember(Kind.TieredPolicyConfig, IndexSettingsMergeTieredPolicy._DESERIALIZER).build(); + } + + public static final JsonpDeserializer _DESERIALIZER = JsonpDeserializer.lazy( + IndexSettingsMergePolicy::buildIndexSettingsMergePolicyDeserializer + ); + + @Override + public int hashCode() { + int result = 17; + result = 31 * result + Objects.hashCode(this._kind); + result = 31 * result + Objects.hashCode(this._value); + return result; + } + + @Override + public boolean equals(Object o) { + if (this == o) return true; + if (o == null || this.getClass() != o.getClass()) return false; + IndexSettingsMergePolicy other = (IndexSettingsMergePolicy) o; + return Objects.equals(this._kind, other._kind) && Objects.equals(this._value, other._value); + } +} diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/indices/IndexSettingsMergePolicyBuilders.java b/java-client/src/generated/java/org/opensearch/client/opensearch/indices/IndexSettingsMergePolicyBuilders.java new file mode 100644 index 0000000000..fe15c80b83 --- /dev/null +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/indices/IndexSettingsMergePolicyBuilders.java @@ -0,0 +1,54 @@ +/* + * SPDX-License-Identifier: Apache-2.0 + * + * The OpenSearch Contributors require contributions made to + * this file be licensed under the Apache-2.0 license or a + * compatible open source license. + */ + +/* + * 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. + */ + +/* + * Modifications Copyright OpenSearch Contributors. See + * GitHub history for details. + */ + +//---------------------------------------------------- +// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. +//---------------------------------------------------- + +package org.opensearch.client.opensearch.indices; + +import javax.annotation.Generated; + +/** + * Builders for {@link IndexSettingsMergePolicy} variants. + */ +@Generated("org.opensearch.client.codegen.CodeGenerator") +public class IndexSettingsMergePolicyBuilders { + private IndexSettingsMergePolicyBuilders() {} + + /** + * Creates a builder for the {@link IndexSettingsMergeTieredPolicy tiered_policy_config} {@code IndexSettingsMergePolicy} variant. + */ + public static IndexSettingsMergeTieredPolicy.Builder tieredPolicyConfig() { + return new IndexSettingsMergeTieredPolicy.Builder(); + } +} diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/indices/IndexSettingsMergePolicyName.java b/java-client/src/generated/java/org/opensearch/client/opensearch/indices/IndexSettingsMergePolicyName.java new file mode 100644 index 0000000000..951062fe3b --- /dev/null +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/indices/IndexSettingsMergePolicyName.java @@ -0,0 +1,67 @@ +/* + * SPDX-License-Identifier: Apache-2.0 + * + * The OpenSearch Contributors require contributions made to + * this file be licensed under the Apache-2.0 license or a + * compatible open source license. + */ + +/* + * 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. + */ + +/* + * Modifications Copyright OpenSearch Contributors. See + * GitHub history for details. + */ + +//---------------------------------------------------- +// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. +//---------------------------------------------------- + +package org.opensearch.client.opensearch.indices; + +import javax.annotation.Generated; +import org.opensearch.client.json.JsonEnum; +import org.opensearch.client.json.JsonpDeserializable; + +// typedef: indices.IndexSettingsMergePolicyName + +@JsonpDeserializable +@Generated("org.opensearch.client.codegen.CodeGenerator") +public enum IndexSettingsMergePolicyName implements JsonEnum { + Default("default"), + + LogByteSize("log_byte_size"), + + Tiered("tiered"); + + private final String jsonValue; + + IndexSettingsMergePolicyName(String jsonValue) { + this.jsonValue = jsonValue; + } + + public String jsonValue() { + return this.jsonValue; + } + + public static final JsonEnum.Deserializer _DESERIALIZER = new JsonEnum.Deserializer<>( + IndexSettingsMergePolicyName.values() + ); +} diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/indices/IndexSettingsMergeScheduler.java b/java-client/src/generated/java/org/opensearch/client/opensearch/indices/IndexSettingsMergeScheduler.java new file mode 100644 index 0000000000..fdb4615cb6 --- /dev/null +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/indices/IndexSettingsMergeScheduler.java @@ -0,0 +1,258 @@ +/* + * SPDX-License-Identifier: Apache-2.0 + * + * The OpenSearch Contributors require contributions made to + * this file be licensed under the Apache-2.0 license or a + * compatible open source license. + */ + +/* + * 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. + */ + +/* + * Modifications Copyright OpenSearch Contributors. See + * GitHub history for details. + */ + +//---------------------------------------------------- +// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. +//---------------------------------------------------- + +package org.opensearch.client.opensearch.indices; + +import jakarta.json.stream.JsonGenerator; +import java.util.Objects; +import java.util.function.Function; +import javax.annotation.Generated; +import javax.annotation.Nonnull; +import javax.annotation.Nullable; +import org.opensearch.client.json.JsonpDeserializable; +import org.opensearch.client.json.JsonpDeserializer; +import org.opensearch.client.json.JsonpMapper; +import org.opensearch.client.json.ObjectBuilderDeserializer; +import org.opensearch.client.json.ObjectDeserializer; +import org.opensearch.client.json.PlainJsonSerializable; +import org.opensearch.client.util.CopyableBuilder; +import org.opensearch.client.util.ObjectBuilder; +import org.opensearch.client.util.ObjectBuilderBase; +import org.opensearch.client.util.ToCopyableBuilder; + +// typedef: indices.IndexSettingsMergeScheduler + +@JsonpDeserializable +@Generated("org.opensearch.client.codegen.CodeGenerator") +public class IndexSettingsMergeScheduler + implements + PlainJsonSerializable, + ToCopyableBuilder { + + @Nullable + private final Boolean autoThrottle; + + @Nullable + private final Integer maxMergeCount; + + @Nullable + private final Integer maxThreadCount; + + // --------------------------------------------------------------------------------------------- + + private IndexSettingsMergeScheduler(Builder builder) { + this.autoThrottle = builder.autoThrottle; + this.maxMergeCount = builder.maxMergeCount; + this.maxThreadCount = builder.maxThreadCount; + } + + public static IndexSettingsMergeScheduler of( + Function> fn + ) { + return fn.apply(new Builder()).build(); + } + + /** + * API name: {@code auto_throttle} + */ + @Nullable + public final Boolean autoThrottle() { + return this.autoThrottle; + } + + /** + * API name: {@code max_merge_count} + */ + @Nullable + public final Integer maxMergeCount() { + return this.maxMergeCount; + } + + /** + * API name: {@code max_thread_count} + */ + @Nullable + public final Integer maxThreadCount() { + return this.maxThreadCount; + } + + /** + * Serialize this object to JSON. + */ + @Override + public void serialize(JsonGenerator generator, JsonpMapper mapper) { + generator.writeStartObject(); + serializeInternal(generator, mapper); + generator.writeEnd(); + } + + protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { + if (this.autoThrottle != null) { + generator.writeKey("auto_throttle"); + generator.write(this.autoThrottle); + } + + if (this.maxMergeCount != null) { + generator.writeKey("max_merge_count"); + generator.write(this.maxMergeCount); + } + + if (this.maxThreadCount != null) { + generator.writeKey("max_thread_count"); + generator.write(this.maxThreadCount); + } + } + + // --------------------------------------------------------------------------------------------- + + @Override + @Nonnull + public Builder toBuilder() { + return new Builder(this); + } + + @Nonnull + public static Builder builder() { + return new Builder(); + } + + /** + * Builder for {@link IndexSettingsMergeScheduler}. + */ + public static class Builder extends ObjectBuilderBase implements CopyableBuilder { + @Nullable + private Boolean autoThrottle; + @Nullable + private Integer maxMergeCount; + @Nullable + private Integer maxThreadCount; + + public Builder() {} + + private Builder(IndexSettingsMergeScheduler o) { + this.autoThrottle = o.autoThrottle; + this.maxMergeCount = o.maxMergeCount; + this.maxThreadCount = o.maxThreadCount; + } + + private Builder(Builder o) { + this.autoThrottle = o.autoThrottle; + this.maxMergeCount = o.maxMergeCount; + this.maxThreadCount = o.maxThreadCount; + } + + @Override + @Nonnull + public Builder copy() { + return new Builder(this); + } + + /** + * API name: {@code auto_throttle} + */ + @Nonnull + public final Builder autoThrottle(@Nullable Boolean value) { + this.autoThrottle = value; + return this; + } + + /** + * API name: {@code max_merge_count} + */ + @Nonnull + public final Builder maxMergeCount(@Nullable Integer value) { + this.maxMergeCount = value; + return this; + } + + /** + * API name: {@code max_thread_count} + */ + @Nonnull + public final Builder maxThreadCount(@Nullable Integer value) { + this.maxThreadCount = value; + return this; + } + + /** + * Builds a {@link IndexSettingsMergeScheduler}. + * + * @throws NullPointerException if some of the required fields are null. + */ + @Override + @Nonnull + public IndexSettingsMergeScheduler build() { + _checkSingleUse(); + + return new IndexSettingsMergeScheduler(this); + } + } + + // --------------------------------------------------------------------------------------------- + + /** + * Json deserializer for {@link IndexSettingsMergeScheduler} + */ + public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer.lazy( + Builder::new, + IndexSettingsMergeScheduler::setupIndexSettingsMergeSchedulerDeserializer + ); + + protected static void setupIndexSettingsMergeSchedulerDeserializer(ObjectDeserializer op) { + op.add(Builder::autoThrottle, JsonpDeserializer.booleanDeserializer(), "auto_throttle"); + op.add(Builder::maxMergeCount, JsonpDeserializer.integerDeserializer(), "max_merge_count"); + op.add(Builder::maxThreadCount, JsonpDeserializer.integerDeserializer(), "max_thread_count"); + } + + @Override + public int hashCode() { + int result = 17; + result = 31 * result + Objects.hashCode(this.autoThrottle); + result = 31 * result + Objects.hashCode(this.maxMergeCount); + result = 31 * result + Objects.hashCode(this.maxThreadCount); + return result; + } + + @Override + public boolean equals(Object o) { + if (this == o) return true; + if (o == null || this.getClass() != o.getClass()) return false; + IndexSettingsMergeScheduler other = (IndexSettingsMergeScheduler) o; + return Objects.equals(this.autoThrottle, other.autoThrottle) + && Objects.equals(this.maxMergeCount, other.maxMergeCount) + && Objects.equals(this.maxThreadCount, other.maxThreadCount); + } +} diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/indices/IndexSettingsMergeTieredPolicy.java b/java-client/src/generated/java/org/opensearch/client/opensearch/indices/IndexSettingsMergeTieredPolicy.java new file mode 100644 index 0000000000..c569f74de8 --- /dev/null +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/indices/IndexSettingsMergeTieredPolicy.java @@ -0,0 +1,390 @@ +/* + * SPDX-License-Identifier: Apache-2.0 + * + * The OpenSearch Contributors require contributions made to + * this file be licensed under the Apache-2.0 license or a + * compatible open source license. + */ + +/* + * 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. + */ + +/* + * Modifications Copyright OpenSearch Contributors. See + * GitHub history for details. + */ + +//---------------------------------------------------- +// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. +//---------------------------------------------------- + +package org.opensearch.client.opensearch.indices; + +import jakarta.json.stream.JsonGenerator; +import java.util.Objects; +import java.util.function.Function; +import javax.annotation.Generated; +import javax.annotation.Nonnull; +import javax.annotation.Nullable; +import org.opensearch.client.json.JsonpDeserializable; +import org.opensearch.client.json.JsonpDeserializer; +import org.opensearch.client.json.JsonpMapper; +import org.opensearch.client.json.ObjectBuilderDeserializer; +import org.opensearch.client.json.ObjectDeserializer; +import org.opensearch.client.json.PlainJsonSerializable; +import org.opensearch.client.util.CopyableBuilder; +import org.opensearch.client.util.ObjectBuilder; +import org.opensearch.client.util.ObjectBuilderBase; +import org.opensearch.client.util.ToCopyableBuilder; + +// typedef: indices.IndexSettingsMergeTieredPolicy + +@JsonpDeserializable +@Generated("org.opensearch.client.codegen.CodeGenerator") +public class IndexSettingsMergeTieredPolicy + implements + PlainJsonSerializable, + ToCopyableBuilder { + + @Nullable + private final Double deletesPctAllowed; + + @Nullable + private final Double expungeDeletesAllowed; + + @Nullable + private final String floorSegment; + + @Nullable + private final Integer maxMergeAtOnce; + + @Nullable + private final String maxMergedSegment; + + @Nullable + private final Double reclaimDeletesWeight; + + @Nullable + private final Double segmentsPerTier; + + // --------------------------------------------------------------------------------------------- + + private IndexSettingsMergeTieredPolicy(Builder builder) { + this.deletesPctAllowed = builder.deletesPctAllowed; + this.expungeDeletesAllowed = builder.expungeDeletesAllowed; + this.floorSegment = builder.floorSegment; + this.maxMergeAtOnce = builder.maxMergeAtOnce; + this.maxMergedSegment = builder.maxMergedSegment; + this.reclaimDeletesWeight = builder.reclaimDeletesWeight; + this.segmentsPerTier = builder.segmentsPerTier; + } + + public static IndexSettingsMergeTieredPolicy of( + Function> fn + ) { + return fn.apply(new Builder()).build(); + } + + /** + * API name: {@code deletes_pct_allowed} + */ + @Nullable + public final Double deletesPctAllowed() { + return this.deletesPctAllowed; + } + + /** + * API name: {@code expunge_deletes_allowed} + */ + @Nullable + public final Double expungeDeletesAllowed() { + return this.expungeDeletesAllowed; + } + + /** + * API name: {@code floor_segment} + */ + @Nullable + public final String floorSegment() { + return this.floorSegment; + } + + /** + * API name: {@code max_merge_at_once} + */ + @Nullable + public final Integer maxMergeAtOnce() { + return this.maxMergeAtOnce; + } + + /** + * API name: {@code max_merged_segment} + */ + @Nullable + public final String maxMergedSegment() { + return this.maxMergedSegment; + } + + /** + * API name: {@code reclaim_deletes_weight} + */ + @Nullable + public final Double reclaimDeletesWeight() { + return this.reclaimDeletesWeight; + } + + /** + * API name: {@code segments_per_tier} + */ + @Nullable + public final Double segmentsPerTier() { + return this.segmentsPerTier; + } + + /** + * Serialize this object to JSON. + */ + @Override + public void serialize(JsonGenerator generator, JsonpMapper mapper) { + generator.writeStartObject(); + serializeInternal(generator, mapper); + generator.writeEnd(); + } + + protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { + if (this.deletesPctAllowed != null) { + generator.writeKey("deletes_pct_allowed"); + generator.write(this.deletesPctAllowed); + } + + if (this.expungeDeletesAllowed != null) { + generator.writeKey("expunge_deletes_allowed"); + generator.write(this.expungeDeletesAllowed); + } + + if (this.floorSegment != null) { + generator.writeKey("floor_segment"); + generator.write(this.floorSegment); + } + + if (this.maxMergeAtOnce != null) { + generator.writeKey("max_merge_at_once"); + generator.write(this.maxMergeAtOnce); + } + + if (this.maxMergedSegment != null) { + generator.writeKey("max_merged_segment"); + generator.write(this.maxMergedSegment); + } + + if (this.reclaimDeletesWeight != null) { + generator.writeKey("reclaim_deletes_weight"); + generator.write(this.reclaimDeletesWeight); + } + + if (this.segmentsPerTier != null) { + generator.writeKey("segments_per_tier"); + generator.write(this.segmentsPerTier); + } + } + + // --------------------------------------------------------------------------------------------- + + @Override + @Nonnull + public Builder toBuilder() { + return new Builder(this); + } + + @Nonnull + public static Builder builder() { + return new Builder(); + } + + /** + * Builder for {@link IndexSettingsMergeTieredPolicy}. + */ + public static class Builder extends ObjectBuilderBase implements CopyableBuilder { + @Nullable + private Double deletesPctAllowed; + @Nullable + private Double expungeDeletesAllowed; + @Nullable + private String floorSegment; + @Nullable + private Integer maxMergeAtOnce; + @Nullable + private String maxMergedSegment; + @Nullable + private Double reclaimDeletesWeight; + @Nullable + private Double segmentsPerTier; + + public Builder() {} + + private Builder(IndexSettingsMergeTieredPolicy o) { + this.deletesPctAllowed = o.deletesPctAllowed; + this.expungeDeletesAllowed = o.expungeDeletesAllowed; + this.floorSegment = o.floorSegment; + this.maxMergeAtOnce = o.maxMergeAtOnce; + this.maxMergedSegment = o.maxMergedSegment; + this.reclaimDeletesWeight = o.reclaimDeletesWeight; + this.segmentsPerTier = o.segmentsPerTier; + } + + private Builder(Builder o) { + this.deletesPctAllowed = o.deletesPctAllowed; + this.expungeDeletesAllowed = o.expungeDeletesAllowed; + this.floorSegment = o.floorSegment; + this.maxMergeAtOnce = o.maxMergeAtOnce; + this.maxMergedSegment = o.maxMergedSegment; + this.reclaimDeletesWeight = o.reclaimDeletesWeight; + this.segmentsPerTier = o.segmentsPerTier; + } + + @Override + @Nonnull + public Builder copy() { + return new Builder(this); + } + + /** + * API name: {@code deletes_pct_allowed} + */ + @Nonnull + public final Builder deletesPctAllowed(@Nullable Double value) { + this.deletesPctAllowed = value; + return this; + } + + /** + * API name: {@code expunge_deletes_allowed} + */ + @Nonnull + public final Builder expungeDeletesAllowed(@Nullable Double value) { + this.expungeDeletesAllowed = value; + return this; + } + + /** + * API name: {@code floor_segment} + */ + @Nonnull + public final Builder floorSegment(@Nullable String value) { + this.floorSegment = value; + return this; + } + + /** + * API name: {@code max_merge_at_once} + */ + @Nonnull + public final Builder maxMergeAtOnce(@Nullable Integer value) { + this.maxMergeAtOnce = value; + return this; + } + + /** + * API name: {@code max_merged_segment} + */ + @Nonnull + public final Builder maxMergedSegment(@Nullable String value) { + this.maxMergedSegment = value; + return this; + } + + /** + * API name: {@code reclaim_deletes_weight} + */ + @Nonnull + public final Builder reclaimDeletesWeight(@Nullable Double value) { + this.reclaimDeletesWeight = value; + return this; + } + + /** + * API name: {@code segments_per_tier} + */ + @Nonnull + public final Builder segmentsPerTier(@Nullable Double value) { + this.segmentsPerTier = value; + return this; + } + + /** + * Builds a {@link IndexSettingsMergeTieredPolicy}. + * + * @throws NullPointerException if some of the required fields are null. + */ + @Override + @Nonnull + public IndexSettingsMergeTieredPolicy build() { + _checkSingleUse(); + + return new IndexSettingsMergeTieredPolicy(this); + } + } + + // --------------------------------------------------------------------------------------------- + + /** + * Json deserializer for {@link IndexSettingsMergeTieredPolicy} + */ + public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer.lazy( + Builder::new, + IndexSettingsMergeTieredPolicy::setupIndexSettingsMergeTieredPolicyDeserializer + ); + + protected static void setupIndexSettingsMergeTieredPolicyDeserializer(ObjectDeserializer op) { + op.add(Builder::deletesPctAllowed, JsonpDeserializer.doubleDeserializer(), "deletes_pct_allowed"); + op.add(Builder::expungeDeletesAllowed, JsonpDeserializer.doubleDeserializer(), "expunge_deletes_allowed"); + op.add(Builder::floorSegment, JsonpDeserializer.stringDeserializer(), "floor_segment"); + op.add(Builder::maxMergeAtOnce, JsonpDeserializer.integerDeserializer(), "max_merge_at_once"); + op.add(Builder::maxMergedSegment, JsonpDeserializer.stringDeserializer(), "max_merged_segment"); + op.add(Builder::reclaimDeletesWeight, JsonpDeserializer.doubleDeserializer(), "reclaim_deletes_weight"); + op.add(Builder::segmentsPerTier, JsonpDeserializer.doubleDeserializer(), "segments_per_tier"); + } + + @Override + public int hashCode() { + int result = 17; + result = 31 * result + Objects.hashCode(this.deletesPctAllowed); + result = 31 * result + Objects.hashCode(this.expungeDeletesAllowed); + result = 31 * result + Objects.hashCode(this.floorSegment); + result = 31 * result + Objects.hashCode(this.maxMergeAtOnce); + result = 31 * result + Objects.hashCode(this.maxMergedSegment); + result = 31 * result + Objects.hashCode(this.reclaimDeletesWeight); + result = 31 * result + Objects.hashCode(this.segmentsPerTier); + return result; + } + + @Override + public boolean equals(Object o) { + if (this == o) return true; + if (o == null || this.getClass() != o.getClass()) return false; + IndexSettingsMergeTieredPolicy other = (IndexSettingsMergeTieredPolicy) o; + return Objects.equals(this.deletesPctAllowed, other.deletesPctAllowed) + && Objects.equals(this.expungeDeletesAllowed, other.expungeDeletesAllowed) + && Objects.equals(this.floorSegment, other.floorSegment) + && Objects.equals(this.maxMergeAtOnce, other.maxMergeAtOnce) + && Objects.equals(this.maxMergedSegment, other.maxMergedSegment) + && Objects.equals(this.reclaimDeletesWeight, other.reclaimDeletesWeight) + && Objects.equals(this.segmentsPerTier, other.segmentsPerTier); + } +} diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/indices/IndexSettingsQueries.java b/java-client/src/generated/java/org/opensearch/client/opensearch/indices/IndexSettingsQueries.java new file mode 100644 index 0000000000..fbe49025c4 --- /dev/null +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/indices/IndexSettingsQueries.java @@ -0,0 +1,195 @@ +/* + * SPDX-License-Identifier: Apache-2.0 + * + * The OpenSearch Contributors require contributions made to + * this file be licensed under the Apache-2.0 license or a + * compatible open source license. + */ + +/* + * 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. + */ + +/* + * Modifications Copyright OpenSearch Contributors. See + * GitHub history for details. + */ + +//---------------------------------------------------- +// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. +//---------------------------------------------------- + +package org.opensearch.client.opensearch.indices; + +import jakarta.json.stream.JsonGenerator; +import java.util.Objects; +import java.util.function.Function; +import javax.annotation.Generated; +import javax.annotation.Nonnull; +import javax.annotation.Nullable; +import org.opensearch.client.json.JsonpDeserializable; +import org.opensearch.client.json.JsonpDeserializer; +import org.opensearch.client.json.JsonpMapper; +import org.opensearch.client.json.ObjectBuilderDeserializer; +import org.opensearch.client.json.ObjectDeserializer; +import org.opensearch.client.json.PlainJsonSerializable; +import org.opensearch.client.util.CopyableBuilder; +import org.opensearch.client.util.ObjectBuilder; +import org.opensearch.client.util.ObjectBuilderBase; +import org.opensearch.client.util.ToCopyableBuilder; + +// typedef: indices.IndexSettingsQueries + +@JsonpDeserializable +@Generated("org.opensearch.client.codegen.CodeGenerator") +public class IndexSettingsQueries implements PlainJsonSerializable, ToCopyableBuilder { + + @Nullable + private final IndexSettingsQueriesCache cache; + + // --------------------------------------------------------------------------------------------- + + private IndexSettingsQueries(Builder builder) { + this.cache = builder.cache; + } + + public static IndexSettingsQueries of(Function> fn) { + return fn.apply(new Builder()).build(); + } + + /** + * API name: {@code cache} + */ + @Nullable + public final IndexSettingsQueriesCache cache() { + return this.cache; + } + + /** + * Serialize this object to JSON. + */ + @Override + public void serialize(JsonGenerator generator, JsonpMapper mapper) { + generator.writeStartObject(); + serializeInternal(generator, mapper); + generator.writeEnd(); + } + + protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { + if (this.cache != null) { + generator.writeKey("cache"); + this.cache.serialize(generator, mapper); + } + } + + // --------------------------------------------------------------------------------------------- + + @Override + @Nonnull + public Builder toBuilder() { + return new Builder(this); + } + + @Nonnull + public static Builder builder() { + return new Builder(); + } + + /** + * Builder for {@link IndexSettingsQueries}. + */ + public static class Builder extends ObjectBuilderBase implements CopyableBuilder { + @Nullable + private IndexSettingsQueriesCache cache; + + public Builder() {} + + private Builder(IndexSettingsQueries o) { + this.cache = o.cache; + } + + private Builder(Builder o) { + this.cache = o.cache; + } + + @Override + @Nonnull + public Builder copy() { + return new Builder(this); + } + + /** + * API name: {@code cache} + */ + @Nonnull + public final Builder cache(@Nullable IndexSettingsQueriesCache value) { + this.cache = value; + return this; + } + + /** + * API name: {@code cache} + */ + @Nonnull + public final Builder cache(Function> fn) { + return cache(fn.apply(new IndexSettingsQueriesCache.Builder()).build()); + } + + /** + * Builds a {@link IndexSettingsQueries}. + * + * @throws NullPointerException if some of the required fields are null. + */ + @Override + @Nonnull + public IndexSettingsQueries build() { + _checkSingleUse(); + + return new IndexSettingsQueries(this); + } + } + + // --------------------------------------------------------------------------------------------- + + /** + * Json deserializer for {@link IndexSettingsQueries} + */ + public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer.lazy( + Builder::new, + IndexSettingsQueries::setupIndexSettingsQueriesDeserializer + ); + + protected static void setupIndexSettingsQueriesDeserializer(ObjectDeserializer op) { + op.add(Builder::cache, IndexSettingsQueriesCache._DESERIALIZER, "cache"); + } + + @Override + public int hashCode() { + int result = 17; + result = 31 * result + Objects.hashCode(this.cache); + return result; + } + + @Override + public boolean equals(Object o) { + if (this == o) return true; + if (o == null || this.getClass() != o.getClass()) return false; + IndexSettingsQueries other = (IndexSettingsQueries) o; + return Objects.equals(this.cache, other.cache); + } +} diff --git a/java-client/src/main/java/org/opensearch/client/opensearch/indices/SoftDeletes.java b/java-client/src/generated/java/org/opensearch/client/opensearch/indices/IndexSettingsQueriesCache.java similarity index 56% rename from java-client/src/main/java/org/opensearch/client/opensearch/indices/SoftDeletes.java rename to java-client/src/generated/java/org/opensearch/client/opensearch/indices/IndexSettingsQueriesCache.java index c0a7f9053c..cdd83c685d 100644 --- a/java-client/src/main/java/org/opensearch/client/opensearch/indices/SoftDeletes.java +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/indices/IndexSettingsQueriesCache.java @@ -30,10 +30,16 @@ * GitHub history for details. */ +//---------------------------------------------------- +// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. +//---------------------------------------------------- + package org.opensearch.client.opensearch.indices; import jakarta.json.stream.JsonGenerator; import java.util.function.Function; +import javax.annotation.Generated; +import javax.annotation.Nonnull; import org.opensearch.client.json.JsonpDeserializable; import org.opensearch.client.json.JsonpDeserializer; import org.opensearch.client.json.JsonpMapper; @@ -41,24 +47,29 @@ import org.opensearch.client.json.ObjectDeserializer; import org.opensearch.client.json.PlainJsonSerializable; import org.opensearch.client.util.ApiTypeHelper; +import org.opensearch.client.util.CopyableBuilder; import org.opensearch.client.util.ObjectBuilder; import org.opensearch.client.util.ObjectBuilderBase; +import org.opensearch.client.util.ToCopyableBuilder; -// typedef: indices._types.SoftDeletes +// typedef: indices.IndexSettingsQueriesCache @JsonpDeserializable -public class SoftDeletes implements PlainJsonSerializable { +@Generated("org.opensearch.client.codegen.CodeGenerator") +public class IndexSettingsQueriesCache + implements + PlainJsonSerializable, + ToCopyableBuilder { + private final boolean enabled; // --------------------------------------------------------------------------------------------- - private SoftDeletes(Builder builder) { - + private IndexSettingsQueriesCache(Builder builder) { this.enabled = ApiTypeHelper.requireNonNull(builder.enabled, this, "enabled"); - } - public static SoftDeletes of(Function> fn) { + public static IndexSettingsQueriesCache of(Function> fn) { return fn.apply(new Builder()).build(); } @@ -72,6 +83,7 @@ public final boolean enabled() { /** * Serialize this object to JSON. */ + @Override public void serialize(JsonGenerator generator, JsonpMapper mapper) { generator.writeStartObject(); serializeInternal(generator, mapper); @@ -79,56 +91,94 @@ public void serialize(JsonGenerator generator, JsonpMapper mapper) { } protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { - generator.writeKey("enabled"); generator.write(this.enabled); - } // --------------------------------------------------------------------------------------------- + @Override + @Nonnull + public Builder toBuilder() { + return new Builder(this); + } + + @Nonnull + public static Builder builder() { + return new Builder(); + } + /** - * Builder for {@link SoftDeletes}. + * Builder for {@link IndexSettingsQueriesCache}. */ - - public static class Builder extends ObjectBuilderBase implements ObjectBuilder { + public static class Builder extends ObjectBuilderBase implements CopyableBuilder { private Boolean enabled; + public Builder() {} + + private Builder(IndexSettingsQueriesCache o) { + this.enabled = o.enabled; + } + + private Builder(Builder o) { + this.enabled = o.enabled; + } + + @Override + @Nonnull + public Builder copy() { + return new Builder(this); + } + /** * Required - API name: {@code enabled} */ + @Nonnull public final Builder enabled(boolean value) { this.enabled = value; return this; } /** - * Builds a {@link SoftDeletes}. + * Builds a {@link IndexSettingsQueriesCache}. * - * @throws NullPointerException - * if some of the required fields are null. + * @throws NullPointerException if some of the required fields are null. */ - public SoftDeletes build() { + @Override + @Nonnull + public IndexSettingsQueriesCache build() { _checkSingleUse(); - return new SoftDeletes(this); + return new IndexSettingsQueriesCache(this); } } // --------------------------------------------------------------------------------------------- /** - * Json deserializer for {@link SoftDeletes} + * Json deserializer for {@link IndexSettingsQueriesCache} */ - public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer.lazy( + public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer.lazy( Builder::new, - SoftDeletes::setupSoftDeletesDeserializer + IndexSettingsQueriesCache::setupIndexSettingsQueriesCacheDeserializer ); - protected static void setupSoftDeletesDeserializer(ObjectDeserializer op) { - + protected static void setupIndexSettingsQueriesCacheDeserializer(ObjectDeserializer op) { op.add(Builder::enabled, JsonpDeserializer.booleanDeserializer(), "enabled"); + } + @Override + public int hashCode() { + int result = 17; + result = 31 * result + Boolean.hashCode(this.enabled); + return result; } + @Override + public boolean equals(Object o) { + if (this == o) return true; + if (o == null || this.getClass() != o.getClass()) return false; + IndexSettingsQueriesCache other = (IndexSettingsQueriesCache) o; + return this.enabled == other.enabled; + } } diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/indices/IndexSettingsQueryString.java b/java-client/src/generated/java/org/opensearch/client/opensearch/indices/IndexSettingsQueryString.java new file mode 100644 index 0000000000..8d129931e0 --- /dev/null +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/indices/IndexSettingsQueryString.java @@ -0,0 +1,190 @@ +/* + * SPDX-License-Identifier: Apache-2.0 + * + * The OpenSearch Contributors require contributions made to + * this file be licensed under the Apache-2.0 license or a + * compatible open source license. + */ + +/* + * 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. + */ + +/* + * Modifications Copyright OpenSearch Contributors. See + * GitHub history for details. + */ + +//---------------------------------------------------- +// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. +//---------------------------------------------------- + +package org.opensearch.client.opensearch.indices; + +import jakarta.json.stream.JsonGenerator; +import java.util.Objects; +import java.util.function.Function; +import javax.annotation.Generated; +import javax.annotation.Nonnull; +import javax.annotation.Nullable; +import org.opensearch.client.json.JsonpDeserializable; +import org.opensearch.client.json.JsonpDeserializer; +import org.opensearch.client.json.JsonpMapper; +import org.opensearch.client.json.ObjectBuilderDeserializer; +import org.opensearch.client.json.ObjectDeserializer; +import org.opensearch.client.json.PlainJsonSerializable; +import org.opensearch.client.util.CopyableBuilder; +import org.opensearch.client.util.ObjectBuilder; +import org.opensearch.client.util.ObjectBuilderBase; +import org.opensearch.client.util.ToCopyableBuilder; + +// typedef: indices.IndexSettingsQueryString + +@JsonpDeserializable +@Generated("org.opensearch.client.codegen.CodeGenerator") +public class IndexSettingsQueryString + implements + PlainJsonSerializable, + ToCopyableBuilder { + + @Nullable + private final Boolean lenient; + + // --------------------------------------------------------------------------------------------- + + private IndexSettingsQueryString(Builder builder) { + this.lenient = builder.lenient; + } + + public static IndexSettingsQueryString of(Function> fn) { + return fn.apply(new Builder()).build(); + } + + /** + * API name: {@code lenient} + */ + @Nullable + public final Boolean lenient() { + return this.lenient; + } + + /** + * Serialize this object to JSON. + */ + @Override + public void serialize(JsonGenerator generator, JsonpMapper mapper) { + generator.writeStartObject(); + serializeInternal(generator, mapper); + generator.writeEnd(); + } + + protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { + if (this.lenient != null) { + generator.writeKey("lenient"); + generator.write(this.lenient); + } + } + + // --------------------------------------------------------------------------------------------- + + @Override + @Nonnull + public Builder toBuilder() { + return new Builder(this); + } + + @Nonnull + public static Builder builder() { + return new Builder(); + } + + /** + * Builder for {@link IndexSettingsQueryString}. + */ + public static class Builder extends ObjectBuilderBase implements CopyableBuilder { + @Nullable + private Boolean lenient; + + public Builder() {} + + private Builder(IndexSettingsQueryString o) { + this.lenient = o.lenient; + } + + private Builder(Builder o) { + this.lenient = o.lenient; + } + + @Override + @Nonnull + public Builder copy() { + return new Builder(this); + } + + /** + * API name: {@code lenient} + */ + @Nonnull + public final Builder lenient(@Nullable Boolean value) { + this.lenient = value; + return this; + } + + /** + * Builds a {@link IndexSettingsQueryString}. + * + * @throws NullPointerException if some of the required fields are null. + */ + @Override + @Nonnull + public IndexSettingsQueryString build() { + _checkSingleUse(); + + return new IndexSettingsQueryString(this); + } + } + + // --------------------------------------------------------------------------------------------- + + /** + * Json deserializer for {@link IndexSettingsQueryString} + */ + public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer.lazy( + Builder::new, + IndexSettingsQueryString::setupIndexSettingsQueryStringDeserializer + ); + + protected static void setupIndexSettingsQueryStringDeserializer(ObjectDeserializer op) { + op.add(Builder::lenient, JsonpDeserializer.booleanDeserializer(), "lenient"); + } + + @Override + public int hashCode() { + int result = 17; + result = 31 * result + Objects.hashCode(this.lenient); + return result; + } + + @Override + public boolean equals(Object o) { + if (this == o) return true; + if (o == null || this.getClass() != o.getClass()) return false; + IndexSettingsQueryString other = (IndexSettingsQueryString) o; + return Objects.equals(this.lenient, other.lenient); + } +} diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/indices/IndexSettingsSearch.java b/java-client/src/generated/java/org/opensearch/client/opensearch/indices/IndexSettingsSearch.java new file mode 100644 index 0000000000..42cbed546b --- /dev/null +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/indices/IndexSettingsSearch.java @@ -0,0 +1,386 @@ +/* + * SPDX-License-Identifier: Apache-2.0 + * + * The OpenSearch Contributors require contributions made to + * this file be licensed under the Apache-2.0 license or a + * compatible open source license. + */ + +/* + * 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. + */ + +/* + * Modifications Copyright OpenSearch Contributors. See + * GitHub history for details. + */ + +//---------------------------------------------------- +// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. +//---------------------------------------------------- + +package org.opensearch.client.opensearch.indices; + +import jakarta.json.stream.JsonGenerator; +import java.util.Objects; +import java.util.function.Function; +import javax.annotation.Generated; +import javax.annotation.Nonnull; +import javax.annotation.Nullable; +import org.opensearch.client.json.JsonpDeserializable; +import org.opensearch.client.json.JsonpDeserializer; +import org.opensearch.client.json.JsonpMapper; +import org.opensearch.client.json.ObjectBuilderDeserializer; +import org.opensearch.client.json.ObjectDeserializer; +import org.opensearch.client.json.PlainJsonSerializable; +import org.opensearch.client.util.CopyableBuilder; +import org.opensearch.client.util.ObjectBuilder; +import org.opensearch.client.util.ObjectBuilderBase; +import org.opensearch.client.util.ToCopyableBuilder; + +// typedef: indices.IndexSettingsSearch + +@JsonpDeserializable +@Generated("org.opensearch.client.codegen.CodeGenerator") +public class IndexSettingsSearch implements PlainJsonSerializable, ToCopyableBuilder { + + @Nullable + private final IndexSettingsSearchConcurrent concurrent; + + @Nullable + private final IndexSettingsSearchConcurrentSegmentSearch concurrentSegmentSearch; + + @Nullable + private final String defaultPipeline; + + @Nullable + private final SearchIdle idle; + + @Nullable + private final SearchSlowlog slowlog; + + @Nullable + private final Boolean throttled; + + // --------------------------------------------------------------------------------------------- + + private IndexSettingsSearch(Builder builder) { + this.concurrent = builder.concurrent; + this.concurrentSegmentSearch = builder.concurrentSegmentSearch; + this.defaultPipeline = builder.defaultPipeline; + this.idle = builder.idle; + this.slowlog = builder.slowlog; + this.throttled = builder.throttled; + } + + public static IndexSettingsSearch of(Function> fn) { + return fn.apply(new Builder()).build(); + } + + /** + * API name: {@code concurrent} + */ + @Nullable + public final IndexSettingsSearchConcurrent concurrent() { + return this.concurrent; + } + + /** + * API name: {@code concurrent_segment_search} + */ + @Nullable + public final IndexSettingsSearchConcurrentSegmentSearch concurrentSegmentSearch() { + return this.concurrentSegmentSearch; + } + + /** + * API name: {@code default_pipeline} + */ + @Nullable + public final String defaultPipeline() { + return this.defaultPipeline; + } + + /** + * API name: {@code idle} + */ + @Nullable + public final SearchIdle idle() { + return this.idle; + } + + /** + * API name: {@code slowlog} + */ + @Nullable + public final SearchSlowlog slowlog() { + return this.slowlog; + } + + /** + * API name: {@code throttled} + */ + @Nullable + public final Boolean throttled() { + return this.throttled; + } + + /** + * Serialize this object to JSON. + */ + @Override + public void serialize(JsonGenerator generator, JsonpMapper mapper) { + generator.writeStartObject(); + serializeInternal(generator, mapper); + generator.writeEnd(); + } + + protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { + if (this.concurrent != null) { + generator.writeKey("concurrent"); + this.concurrent.serialize(generator, mapper); + } + + if (this.concurrentSegmentSearch != null) { + generator.writeKey("concurrent_segment_search"); + this.concurrentSegmentSearch.serialize(generator, mapper); + } + + if (this.defaultPipeline != null) { + generator.writeKey("default_pipeline"); + generator.write(this.defaultPipeline); + } + + if (this.idle != null) { + generator.writeKey("idle"); + this.idle.serialize(generator, mapper); + } + + if (this.slowlog != null) { + generator.writeKey("slowlog"); + this.slowlog.serialize(generator, mapper); + } + + if (this.throttled != null) { + generator.writeKey("throttled"); + generator.write(this.throttled); + } + } + + // --------------------------------------------------------------------------------------------- + + @Override + @Nonnull + public Builder toBuilder() { + return new Builder(this); + } + + @Nonnull + public static Builder builder() { + return new Builder(); + } + + /** + * Builder for {@link IndexSettingsSearch}. + */ + public static class Builder extends ObjectBuilderBase implements CopyableBuilder { + @Nullable + private IndexSettingsSearchConcurrent concurrent; + @Nullable + private IndexSettingsSearchConcurrentSegmentSearch concurrentSegmentSearch; + @Nullable + private String defaultPipeline; + @Nullable + private SearchIdle idle; + @Nullable + private SearchSlowlog slowlog; + @Nullable + private Boolean throttled; + + public Builder() {} + + private Builder(IndexSettingsSearch o) { + this.concurrent = o.concurrent; + this.concurrentSegmentSearch = o.concurrentSegmentSearch; + this.defaultPipeline = o.defaultPipeline; + this.idle = o.idle; + this.slowlog = o.slowlog; + this.throttled = o.throttled; + } + + private Builder(Builder o) { + this.concurrent = o.concurrent; + this.concurrentSegmentSearch = o.concurrentSegmentSearch; + this.defaultPipeline = o.defaultPipeline; + this.idle = o.idle; + this.slowlog = o.slowlog; + this.throttled = o.throttled; + } + + @Override + @Nonnull + public Builder copy() { + return new Builder(this); + } + + /** + * API name: {@code concurrent} + */ + @Nonnull + public final Builder concurrent(@Nullable IndexSettingsSearchConcurrent value) { + this.concurrent = value; + return this; + } + + /** + * API name: {@code concurrent} + */ + @Nonnull + public final Builder concurrent(Function> fn) { + return concurrent(fn.apply(new IndexSettingsSearchConcurrent.Builder()).build()); + } + + /** + * API name: {@code concurrent_segment_search} + */ + @Nonnull + public final Builder concurrentSegmentSearch(@Nullable IndexSettingsSearchConcurrentSegmentSearch value) { + this.concurrentSegmentSearch = value; + return this; + } + + /** + * API name: {@code concurrent_segment_search} + */ + @Nonnull + public final Builder concurrentSegmentSearch( + Function> fn + ) { + return concurrentSegmentSearch(fn.apply(new IndexSettingsSearchConcurrentSegmentSearch.Builder()).build()); + } + + /** + * API name: {@code default_pipeline} + */ + @Nonnull + public final Builder defaultPipeline(@Nullable String value) { + this.defaultPipeline = value; + return this; + } + + /** + * API name: {@code idle} + */ + @Nonnull + public final Builder idle(@Nullable SearchIdle value) { + this.idle = value; + return this; + } + + /** + * API name: {@code idle} + */ + @Nonnull + public final Builder idle(Function> fn) { + return idle(fn.apply(new SearchIdle.Builder()).build()); + } + + /** + * API name: {@code slowlog} + */ + @Nonnull + public final Builder slowlog(@Nullable SearchSlowlog value) { + this.slowlog = value; + return this; + } + + /** + * API name: {@code slowlog} + */ + @Nonnull + public final Builder slowlog(Function> fn) { + return slowlog(fn.apply(new SearchSlowlog.Builder()).build()); + } + + /** + * API name: {@code throttled} + */ + @Nonnull + public final Builder throttled(@Nullable Boolean value) { + this.throttled = value; + return this; + } + + /** + * Builds a {@link IndexSettingsSearch}. + * + * @throws NullPointerException if some of the required fields are null. + */ + @Override + @Nonnull + public IndexSettingsSearch build() { + _checkSingleUse(); + + return new IndexSettingsSearch(this); + } + } + + // --------------------------------------------------------------------------------------------- + + /** + * Json deserializer for {@link IndexSettingsSearch} + */ + public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer.lazy( + Builder::new, + IndexSettingsSearch::setupIndexSettingsSearchDeserializer + ); + + protected static void setupIndexSettingsSearchDeserializer(ObjectDeserializer op) { + op.add(Builder::concurrent, IndexSettingsSearchConcurrent._DESERIALIZER, "concurrent"); + op.add(Builder::concurrentSegmentSearch, IndexSettingsSearchConcurrentSegmentSearch._DESERIALIZER, "concurrent_segment_search"); + op.add(Builder::defaultPipeline, JsonpDeserializer.stringDeserializer(), "default_pipeline"); + op.add(Builder::idle, SearchIdle._DESERIALIZER, "idle"); + op.add(Builder::slowlog, SearchSlowlog._DESERIALIZER, "slowlog"); + op.add(Builder::throttled, JsonpDeserializer.booleanDeserializer(), "throttled"); + } + + @Override + public int hashCode() { + int result = 17; + result = 31 * result + Objects.hashCode(this.concurrent); + result = 31 * result + Objects.hashCode(this.concurrentSegmentSearch); + result = 31 * result + Objects.hashCode(this.defaultPipeline); + result = 31 * result + Objects.hashCode(this.idle); + result = 31 * result + Objects.hashCode(this.slowlog); + result = 31 * result + Objects.hashCode(this.throttled); + return result; + } + + @Override + public boolean equals(Object o) { + if (this == o) return true; + if (o == null || this.getClass() != o.getClass()) return false; + IndexSettingsSearch other = (IndexSettingsSearch) o; + return Objects.equals(this.concurrent, other.concurrent) + && Objects.equals(this.concurrentSegmentSearch, other.concurrentSegmentSearch) + && Objects.equals(this.defaultPipeline, other.defaultPipeline) + && Objects.equals(this.idle, other.idle) + && Objects.equals(this.slowlog, other.slowlog) + && Objects.equals(this.throttled, other.throttled); + } +} diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/indices/IndexSettingsSearchConcurrent.java b/java-client/src/generated/java/org/opensearch/client/opensearch/indices/IndexSettingsSearchConcurrent.java new file mode 100644 index 0000000000..6149390afc --- /dev/null +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/indices/IndexSettingsSearchConcurrent.java @@ -0,0 +1,192 @@ +/* + * SPDX-License-Identifier: Apache-2.0 + * + * The OpenSearch Contributors require contributions made to + * this file be licensed under the Apache-2.0 license or a + * compatible open source license. + */ + +/* + * 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. + */ + +/* + * Modifications Copyright OpenSearch Contributors. See + * GitHub history for details. + */ + +//---------------------------------------------------- +// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. +//---------------------------------------------------- + +package org.opensearch.client.opensearch.indices; + +import jakarta.json.stream.JsonGenerator; +import java.util.Objects; +import java.util.function.Function; +import javax.annotation.Generated; +import javax.annotation.Nonnull; +import javax.annotation.Nullable; +import org.opensearch.client.json.JsonpDeserializable; +import org.opensearch.client.json.JsonpDeserializer; +import org.opensearch.client.json.JsonpMapper; +import org.opensearch.client.json.ObjectBuilderDeserializer; +import org.opensearch.client.json.ObjectDeserializer; +import org.opensearch.client.json.PlainJsonSerializable; +import org.opensearch.client.util.CopyableBuilder; +import org.opensearch.client.util.ObjectBuilder; +import org.opensearch.client.util.ObjectBuilderBase; +import org.opensearch.client.util.ToCopyableBuilder; + +// typedef: indices.IndexSettingsSearchConcurrent + +@JsonpDeserializable +@Generated("org.opensearch.client.codegen.CodeGenerator") +public class IndexSettingsSearchConcurrent + implements + PlainJsonSerializable, + ToCopyableBuilder { + + @Nullable + private final Integer maxSliceCount; + + // --------------------------------------------------------------------------------------------- + + private IndexSettingsSearchConcurrent(Builder builder) { + this.maxSliceCount = builder.maxSliceCount; + } + + public static IndexSettingsSearchConcurrent of( + Function> fn + ) { + return fn.apply(new Builder()).build(); + } + + /** + * API name: {@code max_slice_count} + */ + @Nullable + public final Integer maxSliceCount() { + return this.maxSliceCount; + } + + /** + * Serialize this object to JSON. + */ + @Override + public void serialize(JsonGenerator generator, JsonpMapper mapper) { + generator.writeStartObject(); + serializeInternal(generator, mapper); + generator.writeEnd(); + } + + protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { + if (this.maxSliceCount != null) { + generator.writeKey("max_slice_count"); + generator.write(this.maxSliceCount); + } + } + + // --------------------------------------------------------------------------------------------- + + @Override + @Nonnull + public Builder toBuilder() { + return new Builder(this); + } + + @Nonnull + public static Builder builder() { + return new Builder(); + } + + /** + * Builder for {@link IndexSettingsSearchConcurrent}. + */ + public static class Builder extends ObjectBuilderBase implements CopyableBuilder { + @Nullable + private Integer maxSliceCount; + + public Builder() {} + + private Builder(IndexSettingsSearchConcurrent o) { + this.maxSliceCount = o.maxSliceCount; + } + + private Builder(Builder o) { + this.maxSliceCount = o.maxSliceCount; + } + + @Override + @Nonnull + public Builder copy() { + return new Builder(this); + } + + /** + * API name: {@code max_slice_count} + */ + @Nonnull + public final Builder maxSliceCount(@Nullable Integer value) { + this.maxSliceCount = value; + return this; + } + + /** + * Builds a {@link IndexSettingsSearchConcurrent}. + * + * @throws NullPointerException if some of the required fields are null. + */ + @Override + @Nonnull + public IndexSettingsSearchConcurrent build() { + _checkSingleUse(); + + return new IndexSettingsSearchConcurrent(this); + } + } + + // --------------------------------------------------------------------------------------------- + + /** + * Json deserializer for {@link IndexSettingsSearchConcurrent} + */ + public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer.lazy( + Builder::new, + IndexSettingsSearchConcurrent::setupIndexSettingsSearchConcurrentDeserializer + ); + + protected static void setupIndexSettingsSearchConcurrentDeserializer(ObjectDeserializer op) { + op.add(Builder::maxSliceCount, JsonpDeserializer.integerDeserializer(), "max_slice_count"); + } + + @Override + public int hashCode() { + int result = 17; + result = 31 * result + Objects.hashCode(this.maxSliceCount); + return result; + } + + @Override + public boolean equals(Object o) { + if (this == o) return true; + if (o == null || this.getClass() != o.getClass()) return false; + IndexSettingsSearchConcurrent other = (IndexSettingsSearchConcurrent) o; + return Objects.equals(this.maxSliceCount, other.maxSliceCount); + } +} diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/indices/IndexSettingsSearchConcurrentSegmentSearch.java b/java-client/src/generated/java/org/opensearch/client/opensearch/indices/IndexSettingsSearchConcurrentSegmentSearch.java new file mode 100644 index 0000000000..21fb81a02b --- /dev/null +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/indices/IndexSettingsSearchConcurrentSegmentSearch.java @@ -0,0 +1,226 @@ +/* + * SPDX-License-Identifier: Apache-2.0 + * + * The OpenSearch Contributors require contributions made to + * this file be licensed under the Apache-2.0 license or a + * compatible open source license. + */ + +/* + * 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. + */ + +/* + * Modifications Copyright OpenSearch Contributors. See + * GitHub history for details. + */ + +//---------------------------------------------------- +// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. +//---------------------------------------------------- + +package org.opensearch.client.opensearch.indices; + +import jakarta.json.stream.JsonGenerator; +import java.util.Objects; +import java.util.function.Function; +import javax.annotation.Generated; +import javax.annotation.Nonnull; +import javax.annotation.Nullable; +import org.opensearch.client.json.JsonpDeserializable; +import org.opensearch.client.json.JsonpDeserializer; +import org.opensearch.client.json.JsonpMapper; +import org.opensearch.client.json.ObjectBuilderDeserializer; +import org.opensearch.client.json.ObjectDeserializer; +import org.opensearch.client.json.PlainJsonSerializable; +import org.opensearch.client.util.CopyableBuilder; +import org.opensearch.client.util.ObjectBuilder; +import org.opensearch.client.util.ObjectBuilderBase; +import org.opensearch.client.util.ToCopyableBuilder; + +// typedef: indices.IndexSettingsSearchConcurrentSegmentSearch + +@JsonpDeserializable +@Generated("org.opensearch.client.codegen.CodeGenerator") +public class IndexSettingsSearchConcurrentSegmentSearch + implements + PlainJsonSerializable, + ToCopyableBuilder { + + @Nullable + private final Boolean enabled; + + @Nullable + private final String mode; + + // --------------------------------------------------------------------------------------------- + + private IndexSettingsSearchConcurrentSegmentSearch(Builder builder) { + this.enabled = builder.enabled; + this.mode = builder.mode; + } + + public static IndexSettingsSearchConcurrentSegmentSearch of( + Function> fn + ) { + return fn.apply(new Builder()).build(); + } + + /** + * API name: {@code enabled} + */ + @Nullable + public final Boolean enabled() { + return this.enabled; + } + + /** + * API name: {@code mode} + */ + @Nullable + public final String mode() { + return this.mode; + } + + /** + * Serialize this object to JSON. + */ + @Override + public void serialize(JsonGenerator generator, JsonpMapper mapper) { + generator.writeStartObject(); + serializeInternal(generator, mapper); + generator.writeEnd(); + } + + protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { + if (this.enabled != null) { + generator.writeKey("enabled"); + generator.write(this.enabled); + } + + if (this.mode != null) { + generator.writeKey("mode"); + generator.write(this.mode); + } + } + + // --------------------------------------------------------------------------------------------- + + @Override + @Nonnull + public Builder toBuilder() { + return new Builder(this); + } + + @Nonnull + public static Builder builder() { + return new Builder(); + } + + /** + * Builder for {@link IndexSettingsSearchConcurrentSegmentSearch}. + */ + public static class Builder extends ObjectBuilderBase implements CopyableBuilder { + @Nullable + private Boolean enabled; + @Nullable + private String mode; + + public Builder() {} + + private Builder(IndexSettingsSearchConcurrentSegmentSearch o) { + this.enabled = o.enabled; + this.mode = o.mode; + } + + private Builder(Builder o) { + this.enabled = o.enabled; + this.mode = o.mode; + } + + @Override + @Nonnull + public Builder copy() { + return new Builder(this); + } + + /** + * API name: {@code enabled} + */ + @Nonnull + public final Builder enabled(@Nullable Boolean value) { + this.enabled = value; + return this; + } + + /** + * API name: {@code mode} + */ + @Nonnull + public final Builder mode(@Nullable String value) { + this.mode = value; + return this; + } + + /** + * Builds a {@link IndexSettingsSearchConcurrentSegmentSearch}. + * + * @throws NullPointerException if some of the required fields are null. + */ + @Override + @Nonnull + public IndexSettingsSearchConcurrentSegmentSearch build() { + _checkSingleUse(); + + return new IndexSettingsSearchConcurrentSegmentSearch(this); + } + } + + // --------------------------------------------------------------------------------------------- + + /** + * Json deserializer for {@link IndexSettingsSearchConcurrentSegmentSearch} + */ + public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer.lazy( + Builder::new, + IndexSettingsSearchConcurrentSegmentSearch::setupIndexSettingsSearchConcurrentSegmentSearchDeserializer + ); + + protected static void setupIndexSettingsSearchConcurrentSegmentSearchDeserializer( + ObjectDeserializer op + ) { + op.add(Builder::enabled, JsonpDeserializer.booleanDeserializer(), "enabled"); + op.add(Builder::mode, JsonpDeserializer.stringDeserializer(), "mode"); + } + + @Override + public int hashCode() { + int result = 17; + result = 31 * result + Objects.hashCode(this.enabled); + result = 31 * result + Objects.hashCode(this.mode); + return result; + } + + @Override + public boolean equals(Object o) { + if (this == o) return true; + if (o == null || this.getClass() != o.getClass()) return false; + IndexSettingsSearchConcurrentSegmentSearch other = (IndexSettingsSearchConcurrentSegmentSearch) o; + return Objects.equals(this.enabled, other.enabled) && Objects.equals(this.mode, other.mode); + } +} diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/indices/IndexSettingsSimilarity.java b/java-client/src/generated/java/org/opensearch/client/opensearch/indices/IndexSettingsSimilarity.java new file mode 100644 index 0000000000..58e347c9b8 --- /dev/null +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/indices/IndexSettingsSimilarity.java @@ -0,0 +1,446 @@ +/* + * SPDX-License-Identifier: Apache-2.0 + * + * The OpenSearch Contributors require contributions made to + * this file be licensed under the Apache-2.0 license or a + * compatible open source license. + */ + +/* + * 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. + */ + +/* + * Modifications Copyright OpenSearch Contributors. See + * GitHub history for details. + */ + +//---------------------------------------------------- +// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. +//---------------------------------------------------- + +package org.opensearch.client.opensearch.indices; + +import jakarta.json.stream.JsonGenerator; +import java.util.Objects; +import java.util.function.Function; +import javax.annotation.Generated; +import javax.annotation.Nonnull; +import javax.annotation.Nullable; +import org.opensearch.client.json.JsonpDeserializable; +import org.opensearch.client.json.JsonpDeserializer; +import org.opensearch.client.json.JsonpMapper; +import org.opensearch.client.json.ObjectBuilderDeserializer; +import org.opensearch.client.json.ObjectDeserializer; +import org.opensearch.client.json.PlainJsonSerializable; +import org.opensearch.client.util.CopyableBuilder; +import org.opensearch.client.util.ObjectBuilder; +import org.opensearch.client.util.ObjectBuilderBase; +import org.opensearch.client.util.ToCopyableBuilder; + +// typedef: indices.IndexSettingsSimilarity + +@JsonpDeserializable +@Generated("org.opensearch.client.codegen.CodeGenerator") +public class IndexSettingsSimilarity + implements + PlainJsonSerializable, + ToCopyableBuilder { + + @Nullable + private final IndexSettingsSimilarityBm25 bm25; + + @Nullable + private final IndexSettingsSimilarityDfi dfi; + + @Nullable + private final IndexSettingsSimilarityDfr dfr; + + @Nullable + private final IndexSettingsSimilarityIb ib; + + @Nullable + private final IndexSettingsSimilarityLmd lmd; + + @Nullable + private final IndexSettingsSimilarityLmj lmj; + + @Nullable + private final IndexSettingsSimilarityScriptedTfidf scriptedTfidf; + + // --------------------------------------------------------------------------------------------- + + private IndexSettingsSimilarity(Builder builder) { + this.bm25 = builder.bm25; + this.dfi = builder.dfi; + this.dfr = builder.dfr; + this.ib = builder.ib; + this.lmd = builder.lmd; + this.lmj = builder.lmj; + this.scriptedTfidf = builder.scriptedTfidf; + } + + public static IndexSettingsSimilarity of(Function> fn) { + return fn.apply(new Builder()).build(); + } + + /** + * API name: {@code bm25} + */ + @Nullable + public final IndexSettingsSimilarityBm25 bm25() { + return this.bm25; + } + + /** + * API name: {@code dfi} + */ + @Nullable + public final IndexSettingsSimilarityDfi dfi() { + return this.dfi; + } + + /** + * API name: {@code dfr} + */ + @Nullable + public final IndexSettingsSimilarityDfr dfr() { + return this.dfr; + } + + /** + * API name: {@code ib} + */ + @Nullable + public final IndexSettingsSimilarityIb ib() { + return this.ib; + } + + /** + * API name: {@code lmd} + */ + @Nullable + public final IndexSettingsSimilarityLmd lmd() { + return this.lmd; + } + + /** + * API name: {@code lmj} + */ + @Nullable + public final IndexSettingsSimilarityLmj lmj() { + return this.lmj; + } + + /** + * API name: {@code scripted_tfidf} + */ + @Nullable + public final IndexSettingsSimilarityScriptedTfidf scriptedTfidf() { + return this.scriptedTfidf; + } + + /** + * Serialize this object to JSON. + */ + @Override + public void serialize(JsonGenerator generator, JsonpMapper mapper) { + generator.writeStartObject(); + serializeInternal(generator, mapper); + generator.writeEnd(); + } + + protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { + if (this.bm25 != null) { + generator.writeKey("bm25"); + this.bm25.serialize(generator, mapper); + } + + if (this.dfi != null) { + generator.writeKey("dfi"); + this.dfi.serialize(generator, mapper); + } + + if (this.dfr != null) { + generator.writeKey("dfr"); + this.dfr.serialize(generator, mapper); + } + + if (this.ib != null) { + generator.writeKey("ib"); + this.ib.serialize(generator, mapper); + } + + if (this.lmd != null) { + generator.writeKey("lmd"); + this.lmd.serialize(generator, mapper); + } + + if (this.lmj != null) { + generator.writeKey("lmj"); + this.lmj.serialize(generator, mapper); + } + + if (this.scriptedTfidf != null) { + generator.writeKey("scripted_tfidf"); + this.scriptedTfidf.serialize(generator, mapper); + } + } + + // --------------------------------------------------------------------------------------------- + + @Override + @Nonnull + public Builder toBuilder() { + return new Builder(this); + } + + @Nonnull + public static Builder builder() { + return new Builder(); + } + + /** + * Builder for {@link IndexSettingsSimilarity}. + */ + public static class Builder extends ObjectBuilderBase implements CopyableBuilder { + @Nullable + private IndexSettingsSimilarityBm25 bm25; + @Nullable + private IndexSettingsSimilarityDfi dfi; + @Nullable + private IndexSettingsSimilarityDfr dfr; + @Nullable + private IndexSettingsSimilarityIb ib; + @Nullable + private IndexSettingsSimilarityLmd lmd; + @Nullable + private IndexSettingsSimilarityLmj lmj; + @Nullable + private IndexSettingsSimilarityScriptedTfidf scriptedTfidf; + + public Builder() {} + + private Builder(IndexSettingsSimilarity o) { + this.bm25 = o.bm25; + this.dfi = o.dfi; + this.dfr = o.dfr; + this.ib = o.ib; + this.lmd = o.lmd; + this.lmj = o.lmj; + this.scriptedTfidf = o.scriptedTfidf; + } + + private Builder(Builder o) { + this.bm25 = o.bm25; + this.dfi = o.dfi; + this.dfr = o.dfr; + this.ib = o.ib; + this.lmd = o.lmd; + this.lmj = o.lmj; + this.scriptedTfidf = o.scriptedTfidf; + } + + @Override + @Nonnull + public Builder copy() { + return new Builder(this); + } + + /** + * API name: {@code bm25} + */ + @Nonnull + public final Builder bm25(@Nullable IndexSettingsSimilarityBm25 value) { + this.bm25 = value; + return this; + } + + /** + * API name: {@code bm25} + */ + @Nonnull + public final Builder bm25(Function> fn) { + return bm25(fn.apply(new IndexSettingsSimilarityBm25.Builder()).build()); + } + + /** + * API name: {@code dfi} + */ + @Nonnull + public final Builder dfi(@Nullable IndexSettingsSimilarityDfi value) { + this.dfi = value; + return this; + } + + /** + * API name: {@code dfi} + */ + @Nonnull + public final Builder dfi(Function> fn) { + return dfi(fn.apply(new IndexSettingsSimilarityDfi.Builder()).build()); + } + + /** + * API name: {@code dfr} + */ + @Nonnull + public final Builder dfr(@Nullable IndexSettingsSimilarityDfr value) { + this.dfr = value; + return this; + } + + /** + * API name: {@code dfr} + */ + @Nonnull + public final Builder dfr(Function> fn) { + return dfr(fn.apply(new IndexSettingsSimilarityDfr.Builder()).build()); + } + + /** + * API name: {@code ib} + */ + @Nonnull + public final Builder ib(@Nullable IndexSettingsSimilarityIb value) { + this.ib = value; + return this; + } + + /** + * API name: {@code ib} + */ + @Nonnull + public final Builder ib(Function> fn) { + return ib(fn.apply(new IndexSettingsSimilarityIb.Builder()).build()); + } + + /** + * API name: {@code lmd} + */ + @Nonnull + public final Builder lmd(@Nullable IndexSettingsSimilarityLmd value) { + this.lmd = value; + return this; + } + + /** + * API name: {@code lmd} + */ + @Nonnull + public final Builder lmd(Function> fn) { + return lmd(fn.apply(new IndexSettingsSimilarityLmd.Builder()).build()); + } + + /** + * API name: {@code lmj} + */ + @Nonnull + public final Builder lmj(@Nullable IndexSettingsSimilarityLmj value) { + this.lmj = value; + return this; + } + + /** + * API name: {@code lmj} + */ + @Nonnull + public final Builder lmj(Function> fn) { + return lmj(fn.apply(new IndexSettingsSimilarityLmj.Builder()).build()); + } + + /** + * API name: {@code scripted_tfidf} + */ + @Nonnull + public final Builder scriptedTfidf(@Nullable IndexSettingsSimilarityScriptedTfidf value) { + this.scriptedTfidf = value; + return this; + } + + /** + * API name: {@code scripted_tfidf} + */ + @Nonnull + public final Builder scriptedTfidf( + Function> fn + ) { + return scriptedTfidf(fn.apply(new IndexSettingsSimilarityScriptedTfidf.Builder()).build()); + } + + /** + * Builds a {@link IndexSettingsSimilarity}. + * + * @throws NullPointerException if some of the required fields are null. + */ + @Override + @Nonnull + public IndexSettingsSimilarity build() { + _checkSingleUse(); + + return new IndexSettingsSimilarity(this); + } + } + + // --------------------------------------------------------------------------------------------- + + /** + * Json deserializer for {@link IndexSettingsSimilarity} + */ + public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer.lazy( + Builder::new, + IndexSettingsSimilarity::setupIndexSettingsSimilarityDeserializer + ); + + protected static void setupIndexSettingsSimilarityDeserializer(ObjectDeserializer op) { + op.add(Builder::bm25, IndexSettingsSimilarityBm25._DESERIALIZER, "bm25"); + op.add(Builder::dfi, IndexSettingsSimilarityDfi._DESERIALIZER, "dfi"); + op.add(Builder::dfr, IndexSettingsSimilarityDfr._DESERIALIZER, "dfr"); + op.add(Builder::ib, IndexSettingsSimilarityIb._DESERIALIZER, "ib"); + op.add(Builder::lmd, IndexSettingsSimilarityLmd._DESERIALIZER, "lmd"); + op.add(Builder::lmj, IndexSettingsSimilarityLmj._DESERIALIZER, "lmj"); + op.add(Builder::scriptedTfidf, IndexSettingsSimilarityScriptedTfidf._DESERIALIZER, "scripted_tfidf"); + } + + @Override + public int hashCode() { + int result = 17; + result = 31 * result + Objects.hashCode(this.bm25); + result = 31 * result + Objects.hashCode(this.dfi); + result = 31 * result + Objects.hashCode(this.dfr); + result = 31 * result + Objects.hashCode(this.ib); + result = 31 * result + Objects.hashCode(this.lmd); + result = 31 * result + Objects.hashCode(this.lmj); + result = 31 * result + Objects.hashCode(this.scriptedTfidf); + return result; + } + + @Override + public boolean equals(Object o) { + if (this == o) return true; + if (o == null || this.getClass() != o.getClass()) return false; + IndexSettingsSimilarity other = (IndexSettingsSimilarity) o; + return Objects.equals(this.bm25, other.bm25) + && Objects.equals(this.dfi, other.dfi) + && Objects.equals(this.dfr, other.dfr) + && Objects.equals(this.ib, other.ib) + && Objects.equals(this.lmd, other.lmd) + && Objects.equals(this.lmj, other.lmj) + && Objects.equals(this.scriptedTfidf, other.scriptedTfidf); + } +} diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/indices/IndexSettingsSimilarityBm25.java b/java-client/src/generated/java/org/opensearch/client/opensearch/indices/IndexSettingsSimilarityBm25.java new file mode 100644 index 0000000000..5464c17daf --- /dev/null +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/indices/IndexSettingsSimilarityBm25.java @@ -0,0 +1,269 @@ +/* + * SPDX-License-Identifier: Apache-2.0 + * + * The OpenSearch Contributors require contributions made to + * this file be licensed under the Apache-2.0 license or a + * compatible open source license. + */ + +/* + * 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. + */ + +/* + * Modifications Copyright OpenSearch Contributors. See + * GitHub history for details. + */ + +//---------------------------------------------------- +// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. +//---------------------------------------------------- + +package org.opensearch.client.opensearch.indices; + +import jakarta.json.stream.JsonGenerator; +import java.util.function.Function; +import javax.annotation.Generated; +import javax.annotation.Nonnull; +import org.opensearch.client.json.JsonpDeserializable; +import org.opensearch.client.json.JsonpDeserializer; +import org.opensearch.client.json.JsonpMapper; +import org.opensearch.client.json.ObjectBuilderDeserializer; +import org.opensearch.client.json.ObjectDeserializer; +import org.opensearch.client.json.PlainJsonSerializable; +import org.opensearch.client.util.ApiTypeHelper; +import org.opensearch.client.util.CopyableBuilder; +import org.opensearch.client.util.ObjectBuilder; +import org.opensearch.client.util.ObjectBuilderBase; +import org.opensearch.client.util.ToCopyableBuilder; + +// typedef: indices.IndexSettingsSimilarityBm25 + +@JsonpDeserializable +@Generated("org.opensearch.client.codegen.CodeGenerator") +public class IndexSettingsSimilarityBm25 + implements + PlainJsonSerializable, + ToCopyableBuilder { + + private final float b; + + private final boolean discountOverlaps; + + private final float k1; + + @Nonnull + private final String type; + + // --------------------------------------------------------------------------------------------- + + private IndexSettingsSimilarityBm25(Builder builder) { + this.b = ApiTypeHelper.requireNonNull(builder.b, this, "b"); + this.discountOverlaps = ApiTypeHelper.requireNonNull(builder.discountOverlaps, this, "discountOverlaps"); + this.k1 = ApiTypeHelper.requireNonNull(builder.k1, this, "k1"); + this.type = ApiTypeHelper.requireNonNull(builder.type, this, "type"); + } + + public static IndexSettingsSimilarityBm25 of( + Function> fn + ) { + return fn.apply(new Builder()).build(); + } + + /** + * Required - API name: {@code b} + */ + public final float b() { + return this.b; + } + + /** + * Required - API name: {@code discount_overlaps} + */ + public final boolean discountOverlaps() { + return this.discountOverlaps; + } + + /** + * Required - API name: {@code k1} + */ + public final float k1() { + return this.k1; + } + + /** + * Required - API name: {@code type} + */ + @Nonnull + public final String type() { + return this.type; + } + + /** + * Serialize this object to JSON. + */ + @Override + public void serialize(JsonGenerator generator, JsonpMapper mapper) { + generator.writeStartObject(); + serializeInternal(generator, mapper); + generator.writeEnd(); + } + + protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { + generator.writeKey("b"); + generator.write(this.b); + + generator.writeKey("discount_overlaps"); + generator.write(this.discountOverlaps); + + generator.writeKey("k1"); + generator.write(this.k1); + + generator.writeKey("type"); + generator.write(this.type); + } + + // --------------------------------------------------------------------------------------------- + + @Override + @Nonnull + public Builder toBuilder() { + return new Builder(this); + } + + @Nonnull + public static Builder builder() { + return new Builder(); + } + + /** + * Builder for {@link IndexSettingsSimilarityBm25}. + */ + public static class Builder extends ObjectBuilderBase implements CopyableBuilder { + private Float b; + private Boolean discountOverlaps; + private Float k1; + private String type; + + public Builder() {} + + private Builder(IndexSettingsSimilarityBm25 o) { + this.b = o.b; + this.discountOverlaps = o.discountOverlaps; + this.k1 = o.k1; + this.type = o.type; + } + + private Builder(Builder o) { + this.b = o.b; + this.discountOverlaps = o.discountOverlaps; + this.k1 = o.k1; + this.type = o.type; + } + + @Override + @Nonnull + public Builder copy() { + return new Builder(this); + } + + /** + * Required - API name: {@code b} + */ + @Nonnull + public final Builder b(float value) { + this.b = value; + return this; + } + + /** + * Required - API name: {@code discount_overlaps} + */ + @Nonnull + public final Builder discountOverlaps(boolean value) { + this.discountOverlaps = value; + return this; + } + + /** + * Required - API name: {@code k1} + */ + @Nonnull + public final Builder k1(float value) { + this.k1 = value; + return this; + } + + /** + * Required - API name: {@code type} + */ + @Nonnull + public final Builder type(String value) { + this.type = value; + return this; + } + + /** + * Builds a {@link IndexSettingsSimilarityBm25}. + * + * @throws NullPointerException if some of the required fields are null. + */ + @Override + @Nonnull + public IndexSettingsSimilarityBm25 build() { + _checkSingleUse(); + + return new IndexSettingsSimilarityBm25(this); + } + } + + // --------------------------------------------------------------------------------------------- + + /** + * Json deserializer for {@link IndexSettingsSimilarityBm25} + */ + public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer.lazy( + Builder::new, + IndexSettingsSimilarityBm25::setupIndexSettingsSimilarityBm25Deserializer + ); + + protected static void setupIndexSettingsSimilarityBm25Deserializer(ObjectDeserializer op) { + op.add(Builder::b, JsonpDeserializer.floatDeserializer(), "b"); + op.add(Builder::discountOverlaps, JsonpDeserializer.booleanDeserializer(), "discount_overlaps"); + op.add(Builder::k1, JsonpDeserializer.floatDeserializer(), "k1"); + op.add(Builder::type, JsonpDeserializer.stringDeserializer(), "type"); + } + + @Override + public int hashCode() { + int result = 17; + result = 31 * result + Float.hashCode(this.b); + result = 31 * result + Boolean.hashCode(this.discountOverlaps); + result = 31 * result + Float.hashCode(this.k1); + result = 31 * result + this.type.hashCode(); + return result; + } + + @Override + public boolean equals(Object o) { + if (this == o) return true; + if (o == null || this.getClass() != o.getClass()) return false; + IndexSettingsSimilarityBm25 other = (IndexSettingsSimilarityBm25) o; + return this.b == other.b && this.discountOverlaps == other.discountOverlaps && this.k1 == other.k1 && this.type.equals(other.type); + } +} diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/indices/IndexSettingsSimilarityDfi.java b/java-client/src/generated/java/org/opensearch/client/opensearch/indices/IndexSettingsSimilarityDfi.java new file mode 100644 index 0000000000..d49f7fd18f --- /dev/null +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/indices/IndexSettingsSimilarityDfi.java @@ -0,0 +1,218 @@ +/* + * SPDX-License-Identifier: Apache-2.0 + * + * The OpenSearch Contributors require contributions made to + * this file be licensed under the Apache-2.0 license or a + * compatible open source license. + */ + +/* + * 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. + */ + +/* + * Modifications Copyright OpenSearch Contributors. See + * GitHub history for details. + */ + +//---------------------------------------------------- +// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. +//---------------------------------------------------- + +package org.opensearch.client.opensearch.indices; + +import jakarta.json.stream.JsonGenerator; +import java.util.function.Function; +import javax.annotation.Generated; +import javax.annotation.Nonnull; +import org.opensearch.client.json.JsonpDeserializable; +import org.opensearch.client.json.JsonpDeserializer; +import org.opensearch.client.json.JsonpMapper; +import org.opensearch.client.json.ObjectBuilderDeserializer; +import org.opensearch.client.json.ObjectDeserializer; +import org.opensearch.client.json.PlainJsonSerializable; +import org.opensearch.client.opensearch._types.DFIIndependenceMeasure; +import org.opensearch.client.util.ApiTypeHelper; +import org.opensearch.client.util.CopyableBuilder; +import org.opensearch.client.util.ObjectBuilder; +import org.opensearch.client.util.ObjectBuilderBase; +import org.opensearch.client.util.ToCopyableBuilder; + +// typedef: indices.IndexSettingsSimilarityDfi + +@JsonpDeserializable +@Generated("org.opensearch.client.codegen.CodeGenerator") +public class IndexSettingsSimilarityDfi + implements + PlainJsonSerializable, + ToCopyableBuilder { + + @Nonnull + private final DFIIndependenceMeasure independenceMeasure; + + @Nonnull + private final String type; + + // --------------------------------------------------------------------------------------------- + + private IndexSettingsSimilarityDfi(Builder builder) { + this.independenceMeasure = ApiTypeHelper.requireNonNull(builder.independenceMeasure, this, "independenceMeasure"); + this.type = ApiTypeHelper.requireNonNull(builder.type, this, "type"); + } + + public static IndexSettingsSimilarityDfi of( + Function> fn + ) { + return fn.apply(new Builder()).build(); + } + + /** + * Required - API name: {@code independence_measure} + */ + @Nonnull + public final DFIIndependenceMeasure independenceMeasure() { + return this.independenceMeasure; + } + + /** + * Required - API name: {@code type} + */ + @Nonnull + public final String type() { + return this.type; + } + + /** + * Serialize this object to JSON. + */ + @Override + public void serialize(JsonGenerator generator, JsonpMapper mapper) { + generator.writeStartObject(); + serializeInternal(generator, mapper); + generator.writeEnd(); + } + + protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { + generator.writeKey("independence_measure"); + this.independenceMeasure.serialize(generator, mapper); + + generator.writeKey("type"); + generator.write(this.type); + } + + // --------------------------------------------------------------------------------------------- + + @Override + @Nonnull + public Builder toBuilder() { + return new Builder(this); + } + + @Nonnull + public static Builder builder() { + return new Builder(); + } + + /** + * Builder for {@link IndexSettingsSimilarityDfi}. + */ + public static class Builder extends ObjectBuilderBase implements CopyableBuilder { + private DFIIndependenceMeasure independenceMeasure; + private String type; + + public Builder() {} + + private Builder(IndexSettingsSimilarityDfi o) { + this.independenceMeasure = o.independenceMeasure; + this.type = o.type; + } + + private Builder(Builder o) { + this.independenceMeasure = o.independenceMeasure; + this.type = o.type; + } + + @Override + @Nonnull + public Builder copy() { + return new Builder(this); + } + + /** + * Required - API name: {@code independence_measure} + */ + @Nonnull + public final Builder independenceMeasure(DFIIndependenceMeasure value) { + this.independenceMeasure = value; + return this; + } + + /** + * Required - API name: {@code type} + */ + @Nonnull + public final Builder type(String value) { + this.type = value; + return this; + } + + /** + * Builds a {@link IndexSettingsSimilarityDfi}. + * + * @throws NullPointerException if some of the required fields are null. + */ + @Override + @Nonnull + public IndexSettingsSimilarityDfi build() { + _checkSingleUse(); + + return new IndexSettingsSimilarityDfi(this); + } + } + + // --------------------------------------------------------------------------------------------- + + /** + * Json deserializer for {@link IndexSettingsSimilarityDfi} + */ + public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer.lazy( + Builder::new, + IndexSettingsSimilarityDfi::setupIndexSettingsSimilarityDfiDeserializer + ); + + protected static void setupIndexSettingsSimilarityDfiDeserializer(ObjectDeserializer op) { + op.add(Builder::independenceMeasure, DFIIndependenceMeasure._DESERIALIZER, "independence_measure"); + op.add(Builder::type, JsonpDeserializer.stringDeserializer(), "type"); + } + + @Override + public int hashCode() { + int result = 17; + result = 31 * result + this.independenceMeasure.hashCode(); + result = 31 * result + this.type.hashCode(); + return result; + } + + @Override + public boolean equals(Object o) { + if (this == o) return true; + if (o == null || this.getClass() != o.getClass()) return false; + IndexSettingsSimilarityDfi other = (IndexSettingsSimilarityDfi) o; + return this.independenceMeasure.equals(other.independenceMeasure) && this.type.equals(other.type); + } +} diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/indices/IndexSettingsSimilarityDfr.java b/java-client/src/generated/java/org/opensearch/client/opensearch/indices/IndexSettingsSimilarityDfr.java new file mode 100644 index 0000000000..211b486cde --- /dev/null +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/indices/IndexSettingsSimilarityDfr.java @@ -0,0 +1,281 @@ +/* + * SPDX-License-Identifier: Apache-2.0 + * + * The OpenSearch Contributors require contributions made to + * this file be licensed under the Apache-2.0 license or a + * compatible open source license. + */ + +/* + * 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. + */ + +/* + * Modifications Copyright OpenSearch Contributors. See + * GitHub history for details. + */ + +//---------------------------------------------------- +// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. +//---------------------------------------------------- + +package org.opensearch.client.opensearch.indices; + +import jakarta.json.stream.JsonGenerator; +import java.util.function.Function; +import javax.annotation.Generated; +import javax.annotation.Nonnull; +import org.opensearch.client.json.JsonpDeserializable; +import org.opensearch.client.json.JsonpDeserializer; +import org.opensearch.client.json.JsonpMapper; +import org.opensearch.client.json.ObjectBuilderDeserializer; +import org.opensearch.client.json.ObjectDeserializer; +import org.opensearch.client.json.PlainJsonSerializable; +import org.opensearch.client.opensearch._types.DFRAfterEffect; +import org.opensearch.client.opensearch._types.DFRBasicModel; +import org.opensearch.client.opensearch._types.TermFrequencyNormalization; +import org.opensearch.client.util.ApiTypeHelper; +import org.opensearch.client.util.CopyableBuilder; +import org.opensearch.client.util.ObjectBuilder; +import org.opensearch.client.util.ObjectBuilderBase; +import org.opensearch.client.util.ToCopyableBuilder; + +// typedef: indices.IndexSettingsSimilarityDfr + +@JsonpDeserializable +@Generated("org.opensearch.client.codegen.CodeGenerator") +public class IndexSettingsSimilarityDfr + implements + PlainJsonSerializable, + ToCopyableBuilder { + + @Nonnull + private final DFRAfterEffect afterEffect; + + @Nonnull + private final DFRBasicModel basicModel; + + @Nonnull + private final TermFrequencyNormalization normalization; + + @Nonnull + private final String type; + + // --------------------------------------------------------------------------------------------- + + private IndexSettingsSimilarityDfr(Builder builder) { + this.afterEffect = ApiTypeHelper.requireNonNull(builder.afterEffect, this, "afterEffect"); + this.basicModel = ApiTypeHelper.requireNonNull(builder.basicModel, this, "basicModel"); + this.normalization = ApiTypeHelper.requireNonNull(builder.normalization, this, "normalization"); + this.type = ApiTypeHelper.requireNonNull(builder.type, this, "type"); + } + + public static IndexSettingsSimilarityDfr of( + Function> fn + ) { + return fn.apply(new Builder()).build(); + } + + /** + * Required - API name: {@code after_effect} + */ + @Nonnull + public final DFRAfterEffect afterEffect() { + return this.afterEffect; + } + + /** + * Required - API name: {@code basic_model} + */ + @Nonnull + public final DFRBasicModel basicModel() { + return this.basicModel; + } + + /** + * Required - API name: {@code normalization} + */ + @Nonnull + public final TermFrequencyNormalization normalization() { + return this.normalization; + } + + /** + * Required - API name: {@code type} + */ + @Nonnull + public final String type() { + return this.type; + } + + /** + * Serialize this object to JSON. + */ + @Override + public void serialize(JsonGenerator generator, JsonpMapper mapper) { + generator.writeStartObject(); + serializeInternal(generator, mapper); + generator.writeEnd(); + } + + protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { + generator.writeKey("after_effect"); + this.afterEffect.serialize(generator, mapper); + + generator.writeKey("basic_model"); + this.basicModel.serialize(generator, mapper); + + generator.writeKey("normalization"); + this.normalization.serialize(generator, mapper); + + generator.writeKey("type"); + generator.write(this.type); + } + + // --------------------------------------------------------------------------------------------- + + @Override + @Nonnull + public Builder toBuilder() { + return new Builder(this); + } + + @Nonnull + public static Builder builder() { + return new Builder(); + } + + /** + * Builder for {@link IndexSettingsSimilarityDfr}. + */ + public static class Builder extends ObjectBuilderBase implements CopyableBuilder { + private DFRAfterEffect afterEffect; + private DFRBasicModel basicModel; + private TermFrequencyNormalization normalization; + private String type; + + public Builder() {} + + private Builder(IndexSettingsSimilarityDfr o) { + this.afterEffect = o.afterEffect; + this.basicModel = o.basicModel; + this.normalization = o.normalization; + this.type = o.type; + } + + private Builder(Builder o) { + this.afterEffect = o.afterEffect; + this.basicModel = o.basicModel; + this.normalization = o.normalization; + this.type = o.type; + } + + @Override + @Nonnull + public Builder copy() { + return new Builder(this); + } + + /** + * Required - API name: {@code after_effect} + */ + @Nonnull + public final Builder afterEffect(DFRAfterEffect value) { + this.afterEffect = value; + return this; + } + + /** + * Required - API name: {@code basic_model} + */ + @Nonnull + public final Builder basicModel(DFRBasicModel value) { + this.basicModel = value; + return this; + } + + /** + * Required - API name: {@code normalization} + */ + @Nonnull + public final Builder normalization(TermFrequencyNormalization value) { + this.normalization = value; + return this; + } + + /** + * Required - API name: {@code type} + */ + @Nonnull + public final Builder type(String value) { + this.type = value; + return this; + } + + /** + * Builds a {@link IndexSettingsSimilarityDfr}. + * + * @throws NullPointerException if some of the required fields are null. + */ + @Override + @Nonnull + public IndexSettingsSimilarityDfr build() { + _checkSingleUse(); + + return new IndexSettingsSimilarityDfr(this); + } + } + + // --------------------------------------------------------------------------------------------- + + /** + * Json deserializer for {@link IndexSettingsSimilarityDfr} + */ + public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer.lazy( + Builder::new, + IndexSettingsSimilarityDfr::setupIndexSettingsSimilarityDfrDeserializer + ); + + protected static void setupIndexSettingsSimilarityDfrDeserializer(ObjectDeserializer op) { + op.add(Builder::afterEffect, DFRAfterEffect._DESERIALIZER, "after_effect"); + op.add(Builder::basicModel, DFRBasicModel._DESERIALIZER, "basic_model"); + op.add(Builder::normalization, TermFrequencyNormalization._DESERIALIZER, "normalization"); + op.add(Builder::type, JsonpDeserializer.stringDeserializer(), "type"); + } + + @Override + public int hashCode() { + int result = 17; + result = 31 * result + this.afterEffect.hashCode(); + result = 31 * result + this.basicModel.hashCode(); + result = 31 * result + this.normalization.hashCode(); + result = 31 * result + this.type.hashCode(); + return result; + } + + @Override + public boolean equals(Object o) { + if (this == o) return true; + if (o == null || this.getClass() != o.getClass()) return false; + IndexSettingsSimilarityDfr other = (IndexSettingsSimilarityDfr) o; + return this.afterEffect.equals(other.afterEffect) + && this.basicModel.equals(other.basicModel) + && this.normalization.equals(other.normalization) + && this.type.equals(other.type); + } +} diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/indices/IndexSettingsSimilarityIb.java b/java-client/src/generated/java/org/opensearch/client/opensearch/indices/IndexSettingsSimilarityIb.java new file mode 100644 index 0000000000..d83380fa3f --- /dev/null +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/indices/IndexSettingsSimilarityIb.java @@ -0,0 +1,279 @@ +/* + * SPDX-License-Identifier: Apache-2.0 + * + * The OpenSearch Contributors require contributions made to + * this file be licensed under the Apache-2.0 license or a + * compatible open source license. + */ + +/* + * 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. + */ + +/* + * Modifications Copyright OpenSearch Contributors. See + * GitHub history for details. + */ + +//---------------------------------------------------- +// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. +//---------------------------------------------------- + +package org.opensearch.client.opensearch.indices; + +import jakarta.json.stream.JsonGenerator; +import java.util.function.Function; +import javax.annotation.Generated; +import javax.annotation.Nonnull; +import org.opensearch.client.json.JsonpDeserializable; +import org.opensearch.client.json.JsonpDeserializer; +import org.opensearch.client.json.JsonpMapper; +import org.opensearch.client.json.ObjectBuilderDeserializer; +import org.opensearch.client.json.ObjectDeserializer; +import org.opensearch.client.json.PlainJsonSerializable; +import org.opensearch.client.opensearch._types.IBDistribution; +import org.opensearch.client.opensearch._types.IBLambda; +import org.opensearch.client.opensearch._types.TermFrequencyNormalization; +import org.opensearch.client.util.ApiTypeHelper; +import org.opensearch.client.util.CopyableBuilder; +import org.opensearch.client.util.ObjectBuilder; +import org.opensearch.client.util.ObjectBuilderBase; +import org.opensearch.client.util.ToCopyableBuilder; + +// typedef: indices.IndexSettingsSimilarityIb + +@JsonpDeserializable +@Generated("org.opensearch.client.codegen.CodeGenerator") +public class IndexSettingsSimilarityIb + implements + PlainJsonSerializable, + ToCopyableBuilder { + + @Nonnull + private final IBDistribution distribution; + + @Nonnull + private final IBLambda lambda; + + @Nonnull + private final TermFrequencyNormalization normalization; + + @Nonnull + private final String type; + + // --------------------------------------------------------------------------------------------- + + private IndexSettingsSimilarityIb(Builder builder) { + this.distribution = ApiTypeHelper.requireNonNull(builder.distribution, this, "distribution"); + this.lambda = ApiTypeHelper.requireNonNull(builder.lambda, this, "lambda"); + this.normalization = ApiTypeHelper.requireNonNull(builder.normalization, this, "normalization"); + this.type = ApiTypeHelper.requireNonNull(builder.type, this, "type"); + } + + public static IndexSettingsSimilarityIb of(Function> fn) { + return fn.apply(new Builder()).build(); + } + + /** + * Required - API name: {@code distribution} + */ + @Nonnull + public final IBDistribution distribution() { + return this.distribution; + } + + /** + * Required - API name: {@code lambda} + */ + @Nonnull + public final IBLambda lambda() { + return this.lambda; + } + + /** + * Required - API name: {@code normalization} + */ + @Nonnull + public final TermFrequencyNormalization normalization() { + return this.normalization; + } + + /** + * Required - API name: {@code type} + */ + @Nonnull + public final String type() { + return this.type; + } + + /** + * Serialize this object to JSON. + */ + @Override + public void serialize(JsonGenerator generator, JsonpMapper mapper) { + generator.writeStartObject(); + serializeInternal(generator, mapper); + generator.writeEnd(); + } + + protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { + generator.writeKey("distribution"); + this.distribution.serialize(generator, mapper); + + generator.writeKey("lambda"); + this.lambda.serialize(generator, mapper); + + generator.writeKey("normalization"); + this.normalization.serialize(generator, mapper); + + generator.writeKey("type"); + generator.write(this.type); + } + + // --------------------------------------------------------------------------------------------- + + @Override + @Nonnull + public Builder toBuilder() { + return new Builder(this); + } + + @Nonnull + public static Builder builder() { + return new Builder(); + } + + /** + * Builder for {@link IndexSettingsSimilarityIb}. + */ + public static class Builder extends ObjectBuilderBase implements CopyableBuilder { + private IBDistribution distribution; + private IBLambda lambda; + private TermFrequencyNormalization normalization; + private String type; + + public Builder() {} + + private Builder(IndexSettingsSimilarityIb o) { + this.distribution = o.distribution; + this.lambda = o.lambda; + this.normalization = o.normalization; + this.type = o.type; + } + + private Builder(Builder o) { + this.distribution = o.distribution; + this.lambda = o.lambda; + this.normalization = o.normalization; + this.type = o.type; + } + + @Override + @Nonnull + public Builder copy() { + return new Builder(this); + } + + /** + * Required - API name: {@code distribution} + */ + @Nonnull + public final Builder distribution(IBDistribution value) { + this.distribution = value; + return this; + } + + /** + * Required - API name: {@code lambda} + */ + @Nonnull + public final Builder lambda(IBLambda value) { + this.lambda = value; + return this; + } + + /** + * Required - API name: {@code normalization} + */ + @Nonnull + public final Builder normalization(TermFrequencyNormalization value) { + this.normalization = value; + return this; + } + + /** + * Required - API name: {@code type} + */ + @Nonnull + public final Builder type(String value) { + this.type = value; + return this; + } + + /** + * Builds a {@link IndexSettingsSimilarityIb}. + * + * @throws NullPointerException if some of the required fields are null. + */ + @Override + @Nonnull + public IndexSettingsSimilarityIb build() { + _checkSingleUse(); + + return new IndexSettingsSimilarityIb(this); + } + } + + // --------------------------------------------------------------------------------------------- + + /** + * Json deserializer for {@link IndexSettingsSimilarityIb} + */ + public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer.lazy( + Builder::new, + IndexSettingsSimilarityIb::setupIndexSettingsSimilarityIbDeserializer + ); + + protected static void setupIndexSettingsSimilarityIbDeserializer(ObjectDeserializer op) { + op.add(Builder::distribution, IBDistribution._DESERIALIZER, "distribution"); + op.add(Builder::lambda, IBLambda._DESERIALIZER, "lambda"); + op.add(Builder::normalization, TermFrequencyNormalization._DESERIALIZER, "normalization"); + op.add(Builder::type, JsonpDeserializer.stringDeserializer(), "type"); + } + + @Override + public int hashCode() { + int result = 17; + result = 31 * result + this.distribution.hashCode(); + result = 31 * result + this.lambda.hashCode(); + result = 31 * result + this.normalization.hashCode(); + result = 31 * result + this.type.hashCode(); + return result; + } + + @Override + public boolean equals(Object o) { + if (this == o) return true; + if (o == null || this.getClass() != o.getClass()) return false; + IndexSettingsSimilarityIb other = (IndexSettingsSimilarityIb) o; + return this.distribution.equals(other.distribution) + && this.lambda.equals(other.lambda) + && this.normalization.equals(other.normalization) + && this.type.equals(other.type); + } +} diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/indices/IndexSettingsSimilarityLmd.java b/java-client/src/generated/java/org/opensearch/client/opensearch/indices/IndexSettingsSimilarityLmd.java new file mode 100644 index 0000000000..b44bb4efdf --- /dev/null +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/indices/IndexSettingsSimilarityLmd.java @@ -0,0 +1,215 @@ +/* + * SPDX-License-Identifier: Apache-2.0 + * + * The OpenSearch Contributors require contributions made to + * this file be licensed under the Apache-2.0 license or a + * compatible open source license. + */ + +/* + * 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. + */ + +/* + * Modifications Copyright OpenSearch Contributors. See + * GitHub history for details. + */ + +//---------------------------------------------------- +// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. +//---------------------------------------------------- + +package org.opensearch.client.opensearch.indices; + +import jakarta.json.stream.JsonGenerator; +import java.util.function.Function; +import javax.annotation.Generated; +import javax.annotation.Nonnull; +import org.opensearch.client.json.JsonpDeserializable; +import org.opensearch.client.json.JsonpDeserializer; +import org.opensearch.client.json.JsonpMapper; +import org.opensearch.client.json.ObjectBuilderDeserializer; +import org.opensearch.client.json.ObjectDeserializer; +import org.opensearch.client.json.PlainJsonSerializable; +import org.opensearch.client.util.ApiTypeHelper; +import org.opensearch.client.util.CopyableBuilder; +import org.opensearch.client.util.ObjectBuilder; +import org.opensearch.client.util.ObjectBuilderBase; +import org.opensearch.client.util.ToCopyableBuilder; + +// typedef: indices.IndexSettingsSimilarityLmd + +@JsonpDeserializable +@Generated("org.opensearch.client.codegen.CodeGenerator") +public class IndexSettingsSimilarityLmd + implements + PlainJsonSerializable, + ToCopyableBuilder { + + private final float mu; + + @Nonnull + private final String type; + + // --------------------------------------------------------------------------------------------- + + private IndexSettingsSimilarityLmd(Builder builder) { + this.mu = ApiTypeHelper.requireNonNull(builder.mu, this, "mu"); + this.type = ApiTypeHelper.requireNonNull(builder.type, this, "type"); + } + + public static IndexSettingsSimilarityLmd of( + Function> fn + ) { + return fn.apply(new Builder()).build(); + } + + /** + * Required - API name: {@code mu} + */ + public final float mu() { + return this.mu; + } + + /** + * Required - API name: {@code type} + */ + @Nonnull + public final String type() { + return this.type; + } + + /** + * Serialize this object to JSON. + */ + @Override + public void serialize(JsonGenerator generator, JsonpMapper mapper) { + generator.writeStartObject(); + serializeInternal(generator, mapper); + generator.writeEnd(); + } + + protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { + generator.writeKey("mu"); + generator.write(this.mu); + + generator.writeKey("type"); + generator.write(this.type); + } + + // --------------------------------------------------------------------------------------------- + + @Override + @Nonnull + public Builder toBuilder() { + return new Builder(this); + } + + @Nonnull + public static Builder builder() { + return new Builder(); + } + + /** + * Builder for {@link IndexSettingsSimilarityLmd}. + */ + public static class Builder extends ObjectBuilderBase implements CopyableBuilder { + private Float mu; + private String type; + + public Builder() {} + + private Builder(IndexSettingsSimilarityLmd o) { + this.mu = o.mu; + this.type = o.type; + } + + private Builder(Builder o) { + this.mu = o.mu; + this.type = o.type; + } + + @Override + @Nonnull + public Builder copy() { + return new Builder(this); + } + + /** + * Required - API name: {@code mu} + */ + @Nonnull + public final Builder mu(float value) { + this.mu = value; + return this; + } + + /** + * Required - API name: {@code type} + */ + @Nonnull + public final Builder type(String value) { + this.type = value; + return this; + } + + /** + * Builds a {@link IndexSettingsSimilarityLmd}. + * + * @throws NullPointerException if some of the required fields are null. + */ + @Override + @Nonnull + public IndexSettingsSimilarityLmd build() { + _checkSingleUse(); + + return new IndexSettingsSimilarityLmd(this); + } + } + + // --------------------------------------------------------------------------------------------- + + /** + * Json deserializer for {@link IndexSettingsSimilarityLmd} + */ + public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer.lazy( + Builder::new, + IndexSettingsSimilarityLmd::setupIndexSettingsSimilarityLmdDeserializer + ); + + protected static void setupIndexSettingsSimilarityLmdDeserializer(ObjectDeserializer op) { + op.add(Builder::mu, JsonpDeserializer.floatDeserializer(), "mu"); + op.add(Builder::type, JsonpDeserializer.stringDeserializer(), "type"); + } + + @Override + public int hashCode() { + int result = 17; + result = 31 * result + Float.hashCode(this.mu); + result = 31 * result + this.type.hashCode(); + return result; + } + + @Override + public boolean equals(Object o) { + if (this == o) return true; + if (o == null || this.getClass() != o.getClass()) return false; + IndexSettingsSimilarityLmd other = (IndexSettingsSimilarityLmd) o; + return this.mu == other.mu && this.type.equals(other.type); + } +} diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/indices/IndexSettingsSimilarityLmj.java b/java-client/src/generated/java/org/opensearch/client/opensearch/indices/IndexSettingsSimilarityLmj.java new file mode 100644 index 0000000000..d5e2ab549e --- /dev/null +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/indices/IndexSettingsSimilarityLmj.java @@ -0,0 +1,215 @@ +/* + * SPDX-License-Identifier: Apache-2.0 + * + * The OpenSearch Contributors require contributions made to + * this file be licensed under the Apache-2.0 license or a + * compatible open source license. + */ + +/* + * 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. + */ + +/* + * Modifications Copyright OpenSearch Contributors. See + * GitHub history for details. + */ + +//---------------------------------------------------- +// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. +//---------------------------------------------------- + +package org.opensearch.client.opensearch.indices; + +import jakarta.json.stream.JsonGenerator; +import java.util.function.Function; +import javax.annotation.Generated; +import javax.annotation.Nonnull; +import org.opensearch.client.json.JsonpDeserializable; +import org.opensearch.client.json.JsonpDeserializer; +import org.opensearch.client.json.JsonpMapper; +import org.opensearch.client.json.ObjectBuilderDeserializer; +import org.opensearch.client.json.ObjectDeserializer; +import org.opensearch.client.json.PlainJsonSerializable; +import org.opensearch.client.util.ApiTypeHelper; +import org.opensearch.client.util.CopyableBuilder; +import org.opensearch.client.util.ObjectBuilder; +import org.opensearch.client.util.ObjectBuilderBase; +import org.opensearch.client.util.ToCopyableBuilder; + +// typedef: indices.IndexSettingsSimilarityLmj + +@JsonpDeserializable +@Generated("org.opensearch.client.codegen.CodeGenerator") +public class IndexSettingsSimilarityLmj + implements + PlainJsonSerializable, + ToCopyableBuilder { + + private final float lambda; + + @Nonnull + private final String type; + + // --------------------------------------------------------------------------------------------- + + private IndexSettingsSimilarityLmj(Builder builder) { + this.lambda = ApiTypeHelper.requireNonNull(builder.lambda, this, "lambda"); + this.type = ApiTypeHelper.requireNonNull(builder.type, this, "type"); + } + + public static IndexSettingsSimilarityLmj of( + Function> fn + ) { + return fn.apply(new Builder()).build(); + } + + /** + * Required - API name: {@code lambda} + */ + public final float lambda() { + return this.lambda; + } + + /** + * Required - API name: {@code type} + */ + @Nonnull + public final String type() { + return this.type; + } + + /** + * Serialize this object to JSON. + */ + @Override + public void serialize(JsonGenerator generator, JsonpMapper mapper) { + generator.writeStartObject(); + serializeInternal(generator, mapper); + generator.writeEnd(); + } + + protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { + generator.writeKey("lambda"); + generator.write(this.lambda); + + generator.writeKey("type"); + generator.write(this.type); + } + + // --------------------------------------------------------------------------------------------- + + @Override + @Nonnull + public Builder toBuilder() { + return new Builder(this); + } + + @Nonnull + public static Builder builder() { + return new Builder(); + } + + /** + * Builder for {@link IndexSettingsSimilarityLmj}. + */ + public static class Builder extends ObjectBuilderBase implements CopyableBuilder { + private Float lambda; + private String type; + + public Builder() {} + + private Builder(IndexSettingsSimilarityLmj o) { + this.lambda = o.lambda; + this.type = o.type; + } + + private Builder(Builder o) { + this.lambda = o.lambda; + this.type = o.type; + } + + @Override + @Nonnull + public Builder copy() { + return new Builder(this); + } + + /** + * Required - API name: {@code lambda} + */ + @Nonnull + public final Builder lambda(float value) { + this.lambda = value; + return this; + } + + /** + * Required - API name: {@code type} + */ + @Nonnull + public final Builder type(String value) { + this.type = value; + return this; + } + + /** + * Builds a {@link IndexSettingsSimilarityLmj}. + * + * @throws NullPointerException if some of the required fields are null. + */ + @Override + @Nonnull + public IndexSettingsSimilarityLmj build() { + _checkSingleUse(); + + return new IndexSettingsSimilarityLmj(this); + } + } + + // --------------------------------------------------------------------------------------------- + + /** + * Json deserializer for {@link IndexSettingsSimilarityLmj} + */ + public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer.lazy( + Builder::new, + IndexSettingsSimilarityLmj::setupIndexSettingsSimilarityLmjDeserializer + ); + + protected static void setupIndexSettingsSimilarityLmjDeserializer(ObjectDeserializer op) { + op.add(Builder::lambda, JsonpDeserializer.floatDeserializer(), "lambda"); + op.add(Builder::type, JsonpDeserializer.stringDeserializer(), "type"); + } + + @Override + public int hashCode() { + int result = 17; + result = 31 * result + Float.hashCode(this.lambda); + result = 31 * result + this.type.hashCode(); + return result; + } + + @Override + public boolean equals(Object o) { + if (this == o) return true; + if (o == null || this.getClass() != o.getClass()) return false; + IndexSettingsSimilarityLmj other = (IndexSettingsSimilarityLmj) o; + return this.lambda == other.lambda && this.type.equals(other.type); + } +} diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/indices/IndexSettingsSimilarityScriptedTfidf.java b/java-client/src/generated/java/org/opensearch/client/opensearch/indices/IndexSettingsSimilarityScriptedTfidf.java new file mode 100644 index 0000000000..31184b4e62 --- /dev/null +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/indices/IndexSettingsSimilarityScriptedTfidf.java @@ -0,0 +1,228 @@ +/* + * SPDX-License-Identifier: Apache-2.0 + * + * The OpenSearch Contributors require contributions made to + * this file be licensed under the Apache-2.0 license or a + * compatible open source license. + */ + +/* + * 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. + */ + +/* + * Modifications Copyright OpenSearch Contributors. See + * GitHub history for details. + */ + +//---------------------------------------------------- +// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. +//---------------------------------------------------- + +package org.opensearch.client.opensearch.indices; + +import jakarta.json.stream.JsonGenerator; +import java.util.function.Function; +import javax.annotation.Generated; +import javax.annotation.Nonnull; +import org.opensearch.client.json.JsonpDeserializable; +import org.opensearch.client.json.JsonpDeserializer; +import org.opensearch.client.json.JsonpMapper; +import org.opensearch.client.json.ObjectBuilderDeserializer; +import org.opensearch.client.json.ObjectDeserializer; +import org.opensearch.client.json.PlainJsonSerializable; +import org.opensearch.client.opensearch._types.Script; +import org.opensearch.client.util.ApiTypeHelper; +import org.opensearch.client.util.CopyableBuilder; +import org.opensearch.client.util.ObjectBuilder; +import org.opensearch.client.util.ObjectBuilderBase; +import org.opensearch.client.util.ToCopyableBuilder; + +// typedef: indices.IndexSettingsSimilarityScriptedTfidf + +@JsonpDeserializable +@Generated("org.opensearch.client.codegen.CodeGenerator") +public class IndexSettingsSimilarityScriptedTfidf + implements + PlainJsonSerializable, + ToCopyableBuilder { + + @Nonnull + private final Script script; + + @Nonnull + private final String type; + + // --------------------------------------------------------------------------------------------- + + private IndexSettingsSimilarityScriptedTfidf(Builder builder) { + this.script = ApiTypeHelper.requireNonNull(builder.script, this, "script"); + this.type = ApiTypeHelper.requireNonNull(builder.type, this, "type"); + } + + public static IndexSettingsSimilarityScriptedTfidf of( + Function> fn + ) { + return fn.apply(new Builder()).build(); + } + + /** + * Required - API name: {@code script} + */ + @Nonnull + public final Script script() { + return this.script; + } + + /** + * Required - API name: {@code type} + */ + @Nonnull + public final String type() { + return this.type; + } + + /** + * Serialize this object to JSON. + */ + @Override + public void serialize(JsonGenerator generator, JsonpMapper mapper) { + generator.writeStartObject(); + serializeInternal(generator, mapper); + generator.writeEnd(); + } + + protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { + generator.writeKey("script"); + this.script.serialize(generator, mapper); + + generator.writeKey("type"); + generator.write(this.type); + } + + // --------------------------------------------------------------------------------------------- + + @Override + @Nonnull + public Builder toBuilder() { + return new Builder(this); + } + + @Nonnull + public static Builder builder() { + return new Builder(); + } + + /** + * Builder for {@link IndexSettingsSimilarityScriptedTfidf}. + */ + public static class Builder extends ObjectBuilderBase implements CopyableBuilder { + private Script script; + private String type; + + public Builder() {} + + private Builder(IndexSettingsSimilarityScriptedTfidf o) { + this.script = o.script; + this.type = o.type; + } + + private Builder(Builder o) { + this.script = o.script; + this.type = o.type; + } + + @Override + @Nonnull + public Builder copy() { + return new Builder(this); + } + + /** + * Required - API name: {@code script} + */ + @Nonnull + public final Builder script(Script value) { + this.script = value; + return this; + } + + /** + * Required - API name: {@code script} + */ + @Nonnull + public final Builder script(Function> fn) { + return script(fn.apply(new Script.Builder()).build()); + } + + /** + * Required - API name: {@code type} + */ + @Nonnull + public final Builder type(String value) { + this.type = value; + return this; + } + + /** + * Builds a {@link IndexSettingsSimilarityScriptedTfidf}. + * + * @throws NullPointerException if some of the required fields are null. + */ + @Override + @Nonnull + public IndexSettingsSimilarityScriptedTfidf build() { + _checkSingleUse(); + + return new IndexSettingsSimilarityScriptedTfidf(this); + } + } + + // --------------------------------------------------------------------------------------------- + + /** + * Json deserializer for {@link IndexSettingsSimilarityScriptedTfidf} + */ + public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer.lazy( + Builder::new, + IndexSettingsSimilarityScriptedTfidf::setupIndexSettingsSimilarityScriptedTfidfDeserializer + ); + + protected static void setupIndexSettingsSimilarityScriptedTfidfDeserializer( + ObjectDeserializer op + ) { + op.add(Builder::script, Script._DESERIALIZER, "script"); + op.add(Builder::type, JsonpDeserializer.stringDeserializer(), "type"); + } + + @Override + public int hashCode() { + int result = 17; + result = 31 * result + this.script.hashCode(); + result = 31 * result + this.type.hashCode(); + return result; + } + + @Override + public boolean equals(Object o) { + if (this == o) return true; + if (o == null || this.getClass() != o.getClass()) return false; + IndexSettingsSimilarityScriptedTfidf other = (IndexSettingsSimilarityScriptedTfidf) o; + return this.script.equals(other.script) && this.type.equals(other.type); + } +} diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/indices/IndexSettingsStarTree.java b/java-client/src/generated/java/org/opensearch/client/opensearch/indices/IndexSettingsStarTree.java new file mode 100644 index 0000000000..84d565143a --- /dev/null +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/indices/IndexSettingsStarTree.java @@ -0,0 +1,272 @@ +/* + * SPDX-License-Identifier: Apache-2.0 + * + * The OpenSearch Contributors require contributions made to + * this file be licensed under the Apache-2.0 license or a + * compatible open source license. + */ + +/* + * 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. + */ + +/* + * Modifications Copyright OpenSearch Contributors. See + * GitHub history for details. + */ + +//---------------------------------------------------- +// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. +//---------------------------------------------------- + +package org.opensearch.client.opensearch.indices; + +import jakarta.json.stream.JsonGenerator; +import java.util.Objects; +import java.util.function.Function; +import javax.annotation.Generated; +import javax.annotation.Nonnull; +import javax.annotation.Nullable; +import org.opensearch.client.json.JsonpDeserializable; +import org.opensearch.client.json.JsonpDeserializer; +import org.opensearch.client.json.JsonpMapper; +import org.opensearch.client.json.ObjectBuilderDeserializer; +import org.opensearch.client.json.ObjectDeserializer; +import org.opensearch.client.json.PlainJsonSerializable; +import org.opensearch.client.util.CopyableBuilder; +import org.opensearch.client.util.ObjectBuilder; +import org.opensearch.client.util.ObjectBuilderBase; +import org.opensearch.client.util.ToCopyableBuilder; + +// typedef: indices.IndexSettingsStarTree + +@JsonpDeserializable +@Generated("org.opensearch.client.codegen.CodeGenerator") +public class IndexSettingsStarTree + implements + PlainJsonSerializable, + ToCopyableBuilder { + + @Nullable + private final IndexSettingsStarTreeDefault default_; + + @Nullable + private final IndexSettingsStarTreeField field; + + @Nullable + private final Integer maxFields; + + // --------------------------------------------------------------------------------------------- + + private IndexSettingsStarTree(Builder builder) { + this.default_ = builder.default_; + this.field = builder.field; + this.maxFields = builder.maxFields; + } + + public static IndexSettingsStarTree of(Function> fn) { + return fn.apply(new Builder()).build(); + } + + /** + * API name: {@code default} + */ + @Nullable + public final IndexSettingsStarTreeDefault default_() { + return this.default_; + } + + /** + * API name: {@code field} + */ + @Nullable + public final IndexSettingsStarTreeField field() { + return this.field; + } + + /** + * API name: {@code max_fields} + */ + @Nullable + public final Integer maxFields() { + return this.maxFields; + } + + /** + * Serialize this object to JSON. + */ + @Override + public void serialize(JsonGenerator generator, JsonpMapper mapper) { + generator.writeStartObject(); + serializeInternal(generator, mapper); + generator.writeEnd(); + } + + protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { + if (this.default_ != null) { + generator.writeKey("default"); + this.default_.serialize(generator, mapper); + } + + if (this.field != null) { + generator.writeKey("field"); + this.field.serialize(generator, mapper); + } + + if (this.maxFields != null) { + generator.writeKey("max_fields"); + generator.write(this.maxFields); + } + } + + // --------------------------------------------------------------------------------------------- + + @Override + @Nonnull + public Builder toBuilder() { + return new Builder(this); + } + + @Nonnull + public static Builder builder() { + return new Builder(); + } + + /** + * Builder for {@link IndexSettingsStarTree}. + */ + public static class Builder extends ObjectBuilderBase implements CopyableBuilder { + @Nullable + private IndexSettingsStarTreeDefault default_; + @Nullable + private IndexSettingsStarTreeField field; + @Nullable + private Integer maxFields; + + public Builder() {} + + private Builder(IndexSettingsStarTree o) { + this.default_ = o.default_; + this.field = o.field; + this.maxFields = o.maxFields; + } + + private Builder(Builder o) { + this.default_ = o.default_; + this.field = o.field; + this.maxFields = o.maxFields; + } + + @Override + @Nonnull + public Builder copy() { + return new Builder(this); + } + + /** + * API name: {@code default} + */ + @Nonnull + public final Builder default_(@Nullable IndexSettingsStarTreeDefault value) { + this.default_ = value; + return this; + } + + /** + * API name: {@code default} + */ + @Nonnull + public final Builder default_(Function> fn) { + return default_(fn.apply(new IndexSettingsStarTreeDefault.Builder()).build()); + } + + /** + * API name: {@code field} + */ + @Nonnull + public final Builder field(@Nullable IndexSettingsStarTreeField value) { + this.field = value; + return this; + } + + /** + * API name: {@code field} + */ + @Nonnull + public final Builder field(Function> fn) { + return field(fn.apply(new IndexSettingsStarTreeField.Builder()).build()); + } + + /** + * API name: {@code max_fields} + */ + @Nonnull + public final Builder maxFields(@Nullable Integer value) { + this.maxFields = value; + return this; + } + + /** + * Builds a {@link IndexSettingsStarTree}. + * + * @throws NullPointerException if some of the required fields are null. + */ + @Override + @Nonnull + public IndexSettingsStarTree build() { + _checkSingleUse(); + + return new IndexSettingsStarTree(this); + } + } + + // --------------------------------------------------------------------------------------------- + + /** + * Json deserializer for {@link IndexSettingsStarTree} + */ + public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer.lazy( + Builder::new, + IndexSettingsStarTree::setupIndexSettingsStarTreeDeserializer + ); + + protected static void setupIndexSettingsStarTreeDeserializer(ObjectDeserializer op) { + op.add(Builder::default_, IndexSettingsStarTreeDefault._DESERIALIZER, "default"); + op.add(Builder::field, IndexSettingsStarTreeField._DESERIALIZER, "field"); + op.add(Builder::maxFields, JsonpDeserializer.integerDeserializer(), "max_fields"); + } + + @Override + public int hashCode() { + int result = 17; + result = 31 * result + Objects.hashCode(this.default_); + result = 31 * result + Objects.hashCode(this.field); + result = 31 * result + Objects.hashCode(this.maxFields); + return result; + } + + @Override + public boolean equals(Object o) { + if (this == o) return true; + if (o == null || this.getClass() != o.getClass()) return false; + IndexSettingsStarTree other = (IndexSettingsStarTree) o; + return Objects.equals(this.default_, other.default_) + && Objects.equals(this.field, other.field) + && Objects.equals(this.maxFields, other.maxFields); + } +} diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/indices/IndexSettingsStarTreeDefault.java b/java-client/src/generated/java/org/opensearch/client/opensearch/indices/IndexSettingsStarTreeDefault.java new file mode 100644 index 0000000000..1a5d516e16 --- /dev/null +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/indices/IndexSettingsStarTreeDefault.java @@ -0,0 +1,192 @@ +/* + * SPDX-License-Identifier: Apache-2.0 + * + * The OpenSearch Contributors require contributions made to + * this file be licensed under the Apache-2.0 license or a + * compatible open source license. + */ + +/* + * 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. + */ + +/* + * Modifications Copyright OpenSearch Contributors. See + * GitHub history for details. + */ + +//---------------------------------------------------- +// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. +//---------------------------------------------------- + +package org.opensearch.client.opensearch.indices; + +import jakarta.json.stream.JsonGenerator; +import java.util.Objects; +import java.util.function.Function; +import javax.annotation.Generated; +import javax.annotation.Nonnull; +import javax.annotation.Nullable; +import org.opensearch.client.json.JsonpDeserializable; +import org.opensearch.client.json.JsonpDeserializer; +import org.opensearch.client.json.JsonpMapper; +import org.opensearch.client.json.ObjectBuilderDeserializer; +import org.opensearch.client.json.ObjectDeserializer; +import org.opensearch.client.json.PlainJsonSerializable; +import org.opensearch.client.util.CopyableBuilder; +import org.opensearch.client.util.ObjectBuilder; +import org.opensearch.client.util.ObjectBuilderBase; +import org.opensearch.client.util.ToCopyableBuilder; + +// typedef: indices.IndexSettingsStarTreeDefault + +@JsonpDeserializable +@Generated("org.opensearch.client.codegen.CodeGenerator") +public class IndexSettingsStarTreeDefault + implements + PlainJsonSerializable, + ToCopyableBuilder { + + @Nullable + private final Integer maxLeafDocs; + + // --------------------------------------------------------------------------------------------- + + private IndexSettingsStarTreeDefault(Builder builder) { + this.maxLeafDocs = builder.maxLeafDocs; + } + + public static IndexSettingsStarTreeDefault of( + Function> fn + ) { + return fn.apply(new Builder()).build(); + } + + /** + * API name: {@code max_leaf_docs} + */ + @Nullable + public final Integer maxLeafDocs() { + return this.maxLeafDocs; + } + + /** + * Serialize this object to JSON. + */ + @Override + public void serialize(JsonGenerator generator, JsonpMapper mapper) { + generator.writeStartObject(); + serializeInternal(generator, mapper); + generator.writeEnd(); + } + + protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { + if (this.maxLeafDocs != null) { + generator.writeKey("max_leaf_docs"); + generator.write(this.maxLeafDocs); + } + } + + // --------------------------------------------------------------------------------------------- + + @Override + @Nonnull + public Builder toBuilder() { + return new Builder(this); + } + + @Nonnull + public static Builder builder() { + return new Builder(); + } + + /** + * Builder for {@link IndexSettingsStarTreeDefault}. + */ + public static class Builder extends ObjectBuilderBase implements CopyableBuilder { + @Nullable + private Integer maxLeafDocs; + + public Builder() {} + + private Builder(IndexSettingsStarTreeDefault o) { + this.maxLeafDocs = o.maxLeafDocs; + } + + private Builder(Builder o) { + this.maxLeafDocs = o.maxLeafDocs; + } + + @Override + @Nonnull + public Builder copy() { + return new Builder(this); + } + + /** + * API name: {@code max_leaf_docs} + */ + @Nonnull + public final Builder maxLeafDocs(@Nullable Integer value) { + this.maxLeafDocs = value; + return this; + } + + /** + * Builds a {@link IndexSettingsStarTreeDefault}. + * + * @throws NullPointerException if some of the required fields are null. + */ + @Override + @Nonnull + public IndexSettingsStarTreeDefault build() { + _checkSingleUse(); + + return new IndexSettingsStarTreeDefault(this); + } + } + + // --------------------------------------------------------------------------------------------- + + /** + * Json deserializer for {@link IndexSettingsStarTreeDefault} + */ + public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer.lazy( + Builder::new, + IndexSettingsStarTreeDefault::setupIndexSettingsStarTreeDefaultDeserializer + ); + + protected static void setupIndexSettingsStarTreeDefaultDeserializer(ObjectDeserializer op) { + op.add(Builder::maxLeafDocs, JsonpDeserializer.integerDeserializer(), "max_leaf_docs"); + } + + @Override + public int hashCode() { + int result = 17; + result = 31 * result + Objects.hashCode(this.maxLeafDocs); + return result; + } + + @Override + public boolean equals(Object o) { + if (this == o) return true; + if (o == null || this.getClass() != o.getClass()) return false; + IndexSettingsStarTreeDefault other = (IndexSettingsStarTreeDefault) o; + return Objects.equals(this.maxLeafDocs, other.maxLeafDocs); + } +} diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/indices/IndexSettingsStarTreeField.java b/java-client/src/generated/java/org/opensearch/client/opensearch/indices/IndexSettingsStarTreeField.java new file mode 100644 index 0000000000..9c788897e3 --- /dev/null +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/indices/IndexSettingsStarTreeField.java @@ -0,0 +1,301 @@ +/* + * SPDX-License-Identifier: Apache-2.0 + * + * The OpenSearch Contributors require contributions made to + * this file be licensed under the Apache-2.0 license or a + * compatible open source license. + */ + +/* + * 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. + */ + +/* + * Modifications Copyright OpenSearch Contributors. See + * GitHub history for details. + */ + +//---------------------------------------------------- +// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. +//---------------------------------------------------- + +package org.opensearch.client.opensearch.indices; + +import jakarta.json.stream.JsonGenerator; +import java.util.Objects; +import java.util.function.Function; +import javax.annotation.Generated; +import javax.annotation.Nonnull; +import javax.annotation.Nullable; +import org.opensearch.client.json.JsonpDeserializable; +import org.opensearch.client.json.JsonpDeserializer; +import org.opensearch.client.json.JsonpMapper; +import org.opensearch.client.json.ObjectBuilderDeserializer; +import org.opensearch.client.json.ObjectDeserializer; +import org.opensearch.client.json.PlainJsonSerializable; +import org.opensearch.client.util.CopyableBuilder; +import org.opensearch.client.util.ObjectBuilder; +import org.opensearch.client.util.ObjectBuilderBase; +import org.opensearch.client.util.ToCopyableBuilder; + +// typedef: indices.IndexSettingsStarTreeField + +@JsonpDeserializable +@Generated("org.opensearch.client.codegen.CodeGenerator") +public class IndexSettingsStarTreeField + implements + PlainJsonSerializable, + ToCopyableBuilder { + + @Nullable + private final IndexSettingsStarTreeFieldDefault default_; + + @Nullable + private final Integer maxBaseMetrics; + + @Nullable + private final Integer maxDateIntervals; + + @Nullable + private final Integer maxDimensions; + + // --------------------------------------------------------------------------------------------- + + private IndexSettingsStarTreeField(Builder builder) { + this.default_ = builder.default_; + this.maxBaseMetrics = builder.maxBaseMetrics; + this.maxDateIntervals = builder.maxDateIntervals; + this.maxDimensions = builder.maxDimensions; + } + + public static IndexSettingsStarTreeField of( + Function> fn + ) { + return fn.apply(new Builder()).build(); + } + + /** + * API name: {@code default} + */ + @Nullable + public final IndexSettingsStarTreeFieldDefault default_() { + return this.default_; + } + + /** + * API name: {@code max_base_metrics} + */ + @Nullable + public final Integer maxBaseMetrics() { + return this.maxBaseMetrics; + } + + /** + * API name: {@code max_date_intervals} + */ + @Nullable + public final Integer maxDateIntervals() { + return this.maxDateIntervals; + } + + /** + * API name: {@code max_dimensions} + */ + @Nullable + public final Integer maxDimensions() { + return this.maxDimensions; + } + + /** + * Serialize this object to JSON. + */ + @Override + public void serialize(JsonGenerator generator, JsonpMapper mapper) { + generator.writeStartObject(); + serializeInternal(generator, mapper); + generator.writeEnd(); + } + + protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { + if (this.default_ != null) { + generator.writeKey("default"); + this.default_.serialize(generator, mapper); + } + + if (this.maxBaseMetrics != null) { + generator.writeKey("max_base_metrics"); + generator.write(this.maxBaseMetrics); + } + + if (this.maxDateIntervals != null) { + generator.writeKey("max_date_intervals"); + generator.write(this.maxDateIntervals); + } + + if (this.maxDimensions != null) { + generator.writeKey("max_dimensions"); + generator.write(this.maxDimensions); + } + } + + // --------------------------------------------------------------------------------------------- + + @Override + @Nonnull + public Builder toBuilder() { + return new Builder(this); + } + + @Nonnull + public static Builder builder() { + return new Builder(); + } + + /** + * Builder for {@link IndexSettingsStarTreeField}. + */ + public static class Builder extends ObjectBuilderBase implements CopyableBuilder { + @Nullable + private IndexSettingsStarTreeFieldDefault default_; + @Nullable + private Integer maxBaseMetrics; + @Nullable + private Integer maxDateIntervals; + @Nullable + private Integer maxDimensions; + + public Builder() {} + + private Builder(IndexSettingsStarTreeField o) { + this.default_ = o.default_; + this.maxBaseMetrics = o.maxBaseMetrics; + this.maxDateIntervals = o.maxDateIntervals; + this.maxDimensions = o.maxDimensions; + } + + private Builder(Builder o) { + this.default_ = o.default_; + this.maxBaseMetrics = o.maxBaseMetrics; + this.maxDateIntervals = o.maxDateIntervals; + this.maxDimensions = o.maxDimensions; + } + + @Override + @Nonnull + public Builder copy() { + return new Builder(this); + } + + /** + * API name: {@code default} + */ + @Nonnull + public final Builder default_(@Nullable IndexSettingsStarTreeFieldDefault value) { + this.default_ = value; + return this; + } + + /** + * API name: {@code default} + */ + @Nonnull + public final Builder default_( + Function> fn + ) { + return default_(fn.apply(new IndexSettingsStarTreeFieldDefault.Builder()).build()); + } + + /** + * API name: {@code max_base_metrics} + */ + @Nonnull + public final Builder maxBaseMetrics(@Nullable Integer value) { + this.maxBaseMetrics = value; + return this; + } + + /** + * API name: {@code max_date_intervals} + */ + @Nonnull + public final Builder maxDateIntervals(@Nullable Integer value) { + this.maxDateIntervals = value; + return this; + } + + /** + * API name: {@code max_dimensions} + */ + @Nonnull + public final Builder maxDimensions(@Nullable Integer value) { + this.maxDimensions = value; + return this; + } + + /** + * Builds a {@link IndexSettingsStarTreeField}. + * + * @throws NullPointerException if some of the required fields are null. + */ + @Override + @Nonnull + public IndexSettingsStarTreeField build() { + _checkSingleUse(); + + return new IndexSettingsStarTreeField(this); + } + } + + // --------------------------------------------------------------------------------------------- + + /** + * Json deserializer for {@link IndexSettingsStarTreeField} + */ + public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer.lazy( + Builder::new, + IndexSettingsStarTreeField::setupIndexSettingsStarTreeFieldDeserializer + ); + + protected static void setupIndexSettingsStarTreeFieldDeserializer(ObjectDeserializer op) { + op.add(Builder::default_, IndexSettingsStarTreeFieldDefault._DESERIALIZER, "default"); + op.add(Builder::maxBaseMetrics, JsonpDeserializer.integerDeserializer(), "max_base_metrics"); + op.add(Builder::maxDateIntervals, JsonpDeserializer.integerDeserializer(), "max_date_intervals"); + op.add(Builder::maxDimensions, JsonpDeserializer.integerDeserializer(), "max_dimensions"); + } + + @Override + public int hashCode() { + int result = 17; + result = 31 * result + Objects.hashCode(this.default_); + result = 31 * result + Objects.hashCode(this.maxBaseMetrics); + result = 31 * result + Objects.hashCode(this.maxDateIntervals); + result = 31 * result + Objects.hashCode(this.maxDimensions); + return result; + } + + @Override + public boolean equals(Object o) { + if (this == o) return true; + if (o == null || this.getClass() != o.getClass()) return false; + IndexSettingsStarTreeField other = (IndexSettingsStarTreeField) o; + return Objects.equals(this.default_, other.default_) + && Objects.equals(this.maxBaseMetrics, other.maxBaseMetrics) + && Objects.equals(this.maxDateIntervals, other.maxDateIntervals) + && Objects.equals(this.maxDimensions, other.maxDimensions); + } +} diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/indices/IndexSettingsStarTreeFieldDefault.java b/java-client/src/generated/java/org/opensearch/client/opensearch/indices/IndexSettingsStarTreeFieldDefault.java new file mode 100644 index 0000000000..cb02179a59 --- /dev/null +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/indices/IndexSettingsStarTreeFieldDefault.java @@ -0,0 +1,270 @@ +/* + * SPDX-License-Identifier: Apache-2.0 + * + * The OpenSearch Contributors require contributions made to + * this file be licensed under the Apache-2.0 license or a + * compatible open source license. + */ + +/* + * 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. + */ + +/* + * Modifications Copyright OpenSearch Contributors. See + * GitHub history for details. + */ + +//---------------------------------------------------- +// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. +//---------------------------------------------------- + +package org.opensearch.client.opensearch.indices; + +import jakarta.json.stream.JsonGenerator; +import java.util.List; +import java.util.Objects; +import java.util.function.Function; +import javax.annotation.Generated; +import javax.annotation.Nonnull; +import javax.annotation.Nullable; +import org.opensearch.client.json.JsonpDeserializable; +import org.opensearch.client.json.JsonpDeserializer; +import org.opensearch.client.json.JsonpMapper; +import org.opensearch.client.json.ObjectBuilderDeserializer; +import org.opensearch.client.json.ObjectDeserializer; +import org.opensearch.client.json.PlainJsonSerializable; +import org.opensearch.client.util.ApiTypeHelper; +import org.opensearch.client.util.CopyableBuilder; +import org.opensearch.client.util.ObjectBuilder; +import org.opensearch.client.util.ObjectBuilderBase; +import org.opensearch.client.util.ToCopyableBuilder; + +// typedef: indices.IndexSettingsStarTreeFieldDefault + +@JsonpDeserializable +@Generated("org.opensearch.client.codegen.CodeGenerator") +public class IndexSettingsStarTreeFieldDefault + implements + PlainJsonSerializable, + ToCopyableBuilder { + + @Nonnull + private final List dateIntervals; + + @Nonnull + private final List metrics; + + // --------------------------------------------------------------------------------------------- + + private IndexSettingsStarTreeFieldDefault(Builder builder) { + this.dateIntervals = ApiTypeHelper.unmodifiable(builder.dateIntervals); + this.metrics = ApiTypeHelper.unmodifiable(builder.metrics); + } + + public static IndexSettingsStarTreeFieldDefault of( + Function> fn + ) { + return fn.apply(new Builder()).build(); + } + + /** + * API name: {@code date_intervals} + */ + @Nonnull + public final List dateIntervals() { + return this.dateIntervals; + } + + /** + * API name: {@code metrics} + */ + @Nonnull + public final List metrics() { + return this.metrics; + } + + /** + * Serialize this object to JSON. + */ + @Override + 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.dateIntervals)) { + generator.writeKey("date_intervals"); + generator.writeStartArray(); + for (String item0 : this.dateIntervals) { + generator.write(item0); + } + generator.writeEnd(); + } + + if (ApiTypeHelper.isDefined(this.metrics)) { + generator.writeKey("metrics"); + generator.writeStartArray(); + for (String item0 : this.metrics) { + generator.write(item0); + } + generator.writeEnd(); + } + } + + // --------------------------------------------------------------------------------------------- + + @Override + @Nonnull + public Builder toBuilder() { + return new Builder(this); + } + + @Nonnull + public static Builder builder() { + return new Builder(); + } + + /** + * Builder for {@link IndexSettingsStarTreeFieldDefault}. + */ + public static class Builder extends ObjectBuilderBase implements CopyableBuilder { + @Nullable + private List dateIntervals; + @Nullable + private List metrics; + + public Builder() {} + + private Builder(IndexSettingsStarTreeFieldDefault o) { + this.dateIntervals = _listCopy(o.dateIntervals); + this.metrics = _listCopy(o.metrics); + } + + private Builder(Builder o) { + this.dateIntervals = _listCopy(o.dateIntervals); + this.metrics = _listCopy(o.metrics); + } + + @Override + @Nonnull + public Builder copy() { + return new Builder(this); + } + + /** + * API name: {@code date_intervals} + * + *

+ * Adds all elements of list to dateIntervals. + *

+ */ + @Nonnull + public final Builder dateIntervals(List list) { + this.dateIntervals = _listAddAll(this.dateIntervals, list); + return this; + } + + /** + * API name: {@code date_intervals} + * + *

+ * Adds one or more values to dateIntervals. + *

+ */ + @Nonnull + public final Builder dateIntervals(String value, String... values) { + this.dateIntervals = _listAdd(this.dateIntervals, value, values); + return this; + } + + /** + * API name: {@code metrics} + * + *

+ * Adds all elements of list to metrics. + *

+ */ + @Nonnull + public final Builder metrics(List list) { + this.metrics = _listAddAll(this.metrics, list); + return this; + } + + /** + * API name: {@code metrics} + * + *

+ * Adds one or more values to metrics. + *

+ */ + @Nonnull + public final Builder metrics(String value, String... values) { + this.metrics = _listAdd(this.metrics, value, values); + return this; + } + + /** + * Builds a {@link IndexSettingsStarTreeFieldDefault}. + * + * @throws NullPointerException if some of the required fields are null. + */ + @Override + @Nonnull + public IndexSettingsStarTreeFieldDefault build() { + _checkSingleUse(); + + return new IndexSettingsStarTreeFieldDefault(this); + } + } + + // --------------------------------------------------------------------------------------------- + + /** + * Json deserializer for {@link IndexSettingsStarTreeFieldDefault} + */ + public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer.lazy( + Builder::new, + IndexSettingsStarTreeFieldDefault::setupIndexSettingsStarTreeFieldDefaultDeserializer + ); + + protected static void setupIndexSettingsStarTreeFieldDefaultDeserializer( + ObjectDeserializer op + ) { + op.add(Builder::dateIntervals, JsonpDeserializer.arrayDeserializer(JsonpDeserializer.stringDeserializer()), "date_intervals"); + op.add(Builder::metrics, JsonpDeserializer.arrayDeserializer(JsonpDeserializer.stringDeserializer()), "metrics"); + } + + @Override + public int hashCode() { + int result = 17; + result = 31 * result + Objects.hashCode(this.dateIntervals); + result = 31 * result + Objects.hashCode(this.metrics); + return result; + } + + @Override + public boolean equals(Object o) { + if (this == o) return true; + if (o == null || this.getClass() != o.getClass()) return false; + IndexSettingsStarTreeFieldDefault other = (IndexSettingsStarTreeFieldDefault) o; + return Objects.equals(this.dateIntervals, other.dateIntervals) && Objects.equals(this.metrics, other.metrics); + } +} diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/indices/IndexSettingsStore.java b/java-client/src/generated/java/org/opensearch/client/opensearch/indices/IndexSettingsStore.java new file mode 100644 index 0000000000..b76349676d --- /dev/null +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/indices/IndexSettingsStore.java @@ -0,0 +1,409 @@ +/* + * SPDX-License-Identifier: Apache-2.0 + * + * The OpenSearch Contributors require contributions made to + * this file be licensed under the Apache-2.0 license or a + * compatible open source license. + */ + +/* + * 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. + */ + +/* + * Modifications Copyright OpenSearch Contributors. See + * GitHub history for details. + */ + +//---------------------------------------------------- +// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. +//---------------------------------------------------- + +package org.opensearch.client.opensearch.indices; + +import jakarta.json.stream.JsonGenerator; +import java.util.List; +import java.util.Objects; +import java.util.function.Function; +import javax.annotation.Generated; +import javax.annotation.Nonnull; +import javax.annotation.Nullable; +import org.opensearch.client.json.JsonpDeserializable; +import org.opensearch.client.json.JsonpDeserializer; +import org.opensearch.client.json.JsonpMapper; +import org.opensearch.client.json.ObjectBuilderDeserializer; +import org.opensearch.client.json.ObjectDeserializer; +import org.opensearch.client.json.PlainJsonSerializable; +import org.opensearch.client.opensearch._types.Time; +import org.opensearch.client.util.ApiTypeHelper; +import org.opensearch.client.util.CopyableBuilder; +import org.opensearch.client.util.ObjectBuilder; +import org.opensearch.client.util.ObjectBuilderBase; +import org.opensearch.client.util.ToCopyableBuilder; + +// typedef: indices.IndexSettingsStore + +@JsonpDeserializable +@Generated("org.opensearch.client.codegen.CodeGenerator") +public class IndexSettingsStore implements PlainJsonSerializable, ToCopyableBuilder { + + @Nullable + private final Boolean allowMmap; + + @Nullable + private final IndexSettingsStoreFs fs; + + @Nullable + private final IndexSettingsStoreHybrid hybrid; + + @Nonnull + private final List preload; + + @Nullable + private final Time statsRefreshInterval; + + @Nonnull + private final String type; + + // --------------------------------------------------------------------------------------------- + + private IndexSettingsStore(Builder builder) { + this.allowMmap = builder.allowMmap; + this.fs = builder.fs; + this.hybrid = builder.hybrid; + this.preload = ApiTypeHelper.unmodifiable(builder.preload); + this.statsRefreshInterval = builder.statsRefreshInterval; + this.type = ApiTypeHelper.requireNonNull(builder.type, this, "type"); + } + + public static IndexSettingsStore of(Function> fn) { + return fn.apply(new Builder()).build(); + } + + /** + * You can restrict the use of the mmapfs and the related hybridfs store types with the setting + * node.store.allow_mmap. This is a Boolean setting indicating whether or not memory-mapping is allowed. The default is to + * allow it. This setting is useful, for example, if you are in an environment where you can not control the ability to create a lot of + * memory maps so you need disable the ability to use memory-mapping. + *

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

+ */ + @Nullable + public final Boolean allowMmap() { + return this.allowMmap; + } + + /** + * API name: {@code fs} + */ + @Nullable + public final IndexSettingsStoreFs fs() { + return this.fs; + } + + /** + * API name: {@code hybrid} + */ + @Nullable + public final IndexSettingsStoreHybrid hybrid() { + return this.hybrid; + } + + /** + * API name: {@code preload} + */ + @Nonnull + public final List preload() { + return this.preload; + } + + /** + * API name: {@code stats_refresh_interval} + */ + @Nullable + public final Time statsRefreshInterval() { + return this.statsRefreshInterval; + } + + /** + * Required - API name: {@code type} + */ + @Nonnull + public final String type() { + return this.type; + } + + /** + * Serialize this object to JSON. + */ + @Override + public void serialize(JsonGenerator generator, JsonpMapper mapper) { + generator.writeStartObject(); + serializeInternal(generator, mapper); + generator.writeEnd(); + } + + protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { + if (this.allowMmap != null) { + generator.writeKey("allow_mmap"); + generator.write(this.allowMmap); + } + + if (this.fs != null) { + generator.writeKey("fs"); + this.fs.serialize(generator, mapper); + } + + if (this.hybrid != null) { + generator.writeKey("hybrid"); + this.hybrid.serialize(generator, mapper); + } + + if (ApiTypeHelper.isDefined(this.preload)) { + generator.writeKey("preload"); + generator.writeStartArray(); + for (String item0 : this.preload) { + generator.write(item0); + } + generator.writeEnd(); + } + + if (this.statsRefreshInterval != null) { + generator.writeKey("stats_refresh_interval"); + this.statsRefreshInterval.serialize(generator, mapper); + } + + generator.writeKey("type"); + generator.write(this.type); + } + + // --------------------------------------------------------------------------------------------- + + @Override + @Nonnull + public Builder toBuilder() { + return new Builder(this); + } + + @Nonnull + public static Builder builder() { + return new Builder(); + } + + /** + * Builder for {@link IndexSettingsStore}. + */ + public static class Builder extends ObjectBuilderBase implements CopyableBuilder { + @Nullable + private Boolean allowMmap; + @Nullable + private IndexSettingsStoreFs fs; + @Nullable + private IndexSettingsStoreHybrid hybrid; + @Nullable + private List preload; + @Nullable + private Time statsRefreshInterval; + private String type; + + public Builder() {} + + private Builder(IndexSettingsStore o) { + this.allowMmap = o.allowMmap; + this.fs = o.fs; + this.hybrid = o.hybrid; + this.preload = _listCopy(o.preload); + this.statsRefreshInterval = o.statsRefreshInterval; + this.type = o.type; + } + + private Builder(Builder o) { + this.allowMmap = o.allowMmap; + this.fs = o.fs; + this.hybrid = o.hybrid; + this.preload = _listCopy(o.preload); + this.statsRefreshInterval = o.statsRefreshInterval; + this.type = o.type; + } + + @Override + @Nonnull + public Builder copy() { + return new Builder(this); + } + + /** + * You can restrict the use of the mmapfs and the related hybridfs store types with the setting + * node.store.allow_mmap. This is a Boolean setting indicating whether or not memory-mapping is allowed. The default is + * to allow it. This setting is useful, for example, if you are in an environment where you can not control the ability to create a + * lot of memory maps so you need disable the ability to use memory-mapping. + *

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

+ */ + @Nonnull + public final Builder allowMmap(@Nullable Boolean value) { + this.allowMmap = value; + return this; + } + + /** + * API name: {@code fs} + */ + @Nonnull + public final Builder fs(@Nullable IndexSettingsStoreFs value) { + this.fs = value; + return this; + } + + /** + * API name: {@code fs} + */ + @Nonnull + public final Builder fs(Function> fn) { + return fs(fn.apply(new IndexSettingsStoreFs.Builder()).build()); + } + + /** + * API name: {@code hybrid} + */ + @Nonnull + public final Builder hybrid(@Nullable IndexSettingsStoreHybrid value) { + this.hybrid = value; + return this; + } + + /** + * API name: {@code hybrid} + */ + @Nonnull + public final Builder hybrid(Function> fn) { + return hybrid(fn.apply(new IndexSettingsStoreHybrid.Builder()).build()); + } + + /** + * API name: {@code preload} + * + *

+ * Adds all elements of list to preload. + *

+ */ + @Nonnull + public final Builder preload(List list) { + this.preload = _listAddAll(this.preload, list); + return this; + } + + /** + * API name: {@code preload} + * + *

+ * Adds one or more values to preload. + *

+ */ + @Nonnull + public final Builder preload(String value, String... values) { + this.preload = _listAdd(this.preload, value, values); + return this; + } + + /** + * API name: {@code stats_refresh_interval} + */ + @Nonnull + public final Builder statsRefreshInterval(@Nullable Time value) { + this.statsRefreshInterval = value; + return this; + } + + /** + * API name: {@code stats_refresh_interval} + */ + @Nonnull + public final Builder statsRefreshInterval(Function> fn) { + return statsRefreshInterval(fn.apply(new Time.Builder()).build()); + } + + /** + * Required - API name: {@code type} + */ + @Nonnull + public final Builder type(String value) { + this.type = value; + return this; + } + + /** + * Builds a {@link IndexSettingsStore}. + * + * @throws NullPointerException if some of the required fields are null. + */ + @Override + @Nonnull + public IndexSettingsStore build() { + _checkSingleUse(); + + return new IndexSettingsStore(this); + } + } + + // --------------------------------------------------------------------------------------------- + + /** + * Json deserializer for {@link IndexSettingsStore} + */ + public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer.lazy( + Builder::new, + IndexSettingsStore::setupIndexSettingsStoreDeserializer + ); + + protected static void setupIndexSettingsStoreDeserializer(ObjectDeserializer op) { + op.add(Builder::allowMmap, JsonpDeserializer.booleanDeserializer(), "allow_mmap"); + op.add(Builder::fs, IndexSettingsStoreFs._DESERIALIZER, "fs"); + op.add(Builder::hybrid, IndexSettingsStoreHybrid._DESERIALIZER, "hybrid"); + op.add(Builder::preload, JsonpDeserializer.arrayDeserializer(JsonpDeserializer.stringDeserializer()), "preload"); + op.add(Builder::statsRefreshInterval, Time._DESERIALIZER, "stats_refresh_interval"); + op.add(Builder::type, JsonpDeserializer.stringDeserializer(), "type"); + } + + @Override + public int hashCode() { + int result = 17; + result = 31 * result + Objects.hashCode(this.allowMmap); + result = 31 * result + Objects.hashCode(this.fs); + result = 31 * result + Objects.hashCode(this.hybrid); + result = 31 * result + Objects.hashCode(this.preload); + result = 31 * result + Objects.hashCode(this.statsRefreshInterval); + result = 31 * result + this.type.hashCode(); + return result; + } + + @Override + public boolean equals(Object o) { + if (this == o) return true; + if (o == null || this.getClass() != o.getClass()) return false; + IndexSettingsStore other = (IndexSettingsStore) o; + return Objects.equals(this.allowMmap, other.allowMmap) + && Objects.equals(this.fs, other.fs) + && Objects.equals(this.hybrid, other.hybrid) + && Objects.equals(this.preload, other.preload) + && Objects.equals(this.statsRefreshInterval, other.statsRefreshInterval) + && this.type.equals(other.type); + } +} diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/indices/IndexSettingsStoreFs.java b/java-client/src/generated/java/org/opensearch/client/opensearch/indices/IndexSettingsStoreFs.java new file mode 100644 index 0000000000..82bf79be97 --- /dev/null +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/indices/IndexSettingsStoreFs.java @@ -0,0 +1,187 @@ +/* + * SPDX-License-Identifier: Apache-2.0 + * + * The OpenSearch Contributors require contributions made to + * this file be licensed under the Apache-2.0 license or a + * compatible open source license. + */ + +/* + * 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. + */ + +/* + * Modifications Copyright OpenSearch Contributors. See + * GitHub history for details. + */ + +//---------------------------------------------------- +// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. +//---------------------------------------------------- + +package org.opensearch.client.opensearch.indices; + +import jakarta.json.stream.JsonGenerator; +import java.util.Objects; +import java.util.function.Function; +import javax.annotation.Generated; +import javax.annotation.Nonnull; +import javax.annotation.Nullable; +import org.opensearch.client.json.JsonpDeserializable; +import org.opensearch.client.json.JsonpDeserializer; +import org.opensearch.client.json.JsonpMapper; +import org.opensearch.client.json.ObjectBuilderDeserializer; +import org.opensearch.client.json.ObjectDeserializer; +import org.opensearch.client.json.PlainJsonSerializable; +import org.opensearch.client.util.CopyableBuilder; +import org.opensearch.client.util.ObjectBuilder; +import org.opensearch.client.util.ObjectBuilderBase; +import org.opensearch.client.util.ToCopyableBuilder; + +// typedef: indices.IndexSettingsStoreFs + +@JsonpDeserializable +@Generated("org.opensearch.client.codegen.CodeGenerator") +public class IndexSettingsStoreFs implements PlainJsonSerializable, ToCopyableBuilder { + + @Nullable + private final IndexSettingsStoreFsLock fsLock; + + // --------------------------------------------------------------------------------------------- + + private IndexSettingsStoreFs(Builder builder) { + this.fsLock = builder.fsLock; + } + + public static IndexSettingsStoreFs of(Function> fn) { + return fn.apply(new Builder()).build(); + } + + /** + * API name: {@code fs_lock} + */ + @Nullable + public final IndexSettingsStoreFsLock fsLock() { + return this.fsLock; + } + + /** + * Serialize this object to JSON. + */ + @Override + public void serialize(JsonGenerator generator, JsonpMapper mapper) { + generator.writeStartObject(); + serializeInternal(generator, mapper); + generator.writeEnd(); + } + + protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { + if (this.fsLock != null) { + generator.writeKey("fs_lock"); + this.fsLock.serialize(generator, mapper); + } + } + + // --------------------------------------------------------------------------------------------- + + @Override + @Nonnull + public Builder toBuilder() { + return new Builder(this); + } + + @Nonnull + public static Builder builder() { + return new Builder(); + } + + /** + * Builder for {@link IndexSettingsStoreFs}. + */ + public static class Builder extends ObjectBuilderBase implements CopyableBuilder { + @Nullable + private IndexSettingsStoreFsLock fsLock; + + public Builder() {} + + private Builder(IndexSettingsStoreFs o) { + this.fsLock = o.fsLock; + } + + private Builder(Builder o) { + this.fsLock = o.fsLock; + } + + @Override + @Nonnull + public Builder copy() { + return new Builder(this); + } + + /** + * API name: {@code fs_lock} + */ + @Nonnull + public final Builder fsLock(@Nullable IndexSettingsStoreFsLock value) { + this.fsLock = value; + return this; + } + + /** + * Builds a {@link IndexSettingsStoreFs}. + * + * @throws NullPointerException if some of the required fields are null. + */ + @Override + @Nonnull + public IndexSettingsStoreFs build() { + _checkSingleUse(); + + return new IndexSettingsStoreFs(this); + } + } + + // --------------------------------------------------------------------------------------------- + + /** + * Json deserializer for {@link IndexSettingsStoreFs} + */ + public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer.lazy( + Builder::new, + IndexSettingsStoreFs::setupIndexSettingsStoreFsDeserializer + ); + + protected static void setupIndexSettingsStoreFsDeserializer(ObjectDeserializer op) { + op.add(Builder::fsLock, IndexSettingsStoreFsLock._DESERIALIZER, "fs_lock"); + } + + @Override + public int hashCode() { + int result = 17; + result = 31 * result + Objects.hashCode(this.fsLock); + return result; + } + + @Override + public boolean equals(Object o) { + if (this == o) return true; + if (o == null || this.getClass() != o.getClass()) return false; + IndexSettingsStoreFs other = (IndexSettingsStoreFs) o; + return Objects.equals(this.fsLock, other.fsLock); + } +} diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/indices/IndexSettingsStoreFsLock.java b/java-client/src/generated/java/org/opensearch/client/opensearch/indices/IndexSettingsStoreFsLock.java new file mode 100644 index 0000000000..6c53d162c2 --- /dev/null +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/indices/IndexSettingsStoreFsLock.java @@ -0,0 +1,65 @@ +/* + * SPDX-License-Identifier: Apache-2.0 + * + * The OpenSearch Contributors require contributions made to + * this file be licensed under the Apache-2.0 license or a + * compatible open source license. + */ + +/* + * 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. + */ + +/* + * Modifications Copyright OpenSearch Contributors. See + * GitHub history for details. + */ + +//---------------------------------------------------- +// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. +//---------------------------------------------------- + +package org.opensearch.client.opensearch.indices; + +import javax.annotation.Generated; +import org.opensearch.client.json.JsonEnum; +import org.opensearch.client.json.JsonpDeserializable; + +// typedef: indices.IndexSettingsStoreFsLock + +@JsonpDeserializable +@Generated("org.opensearch.client.codegen.CodeGenerator") +public enum IndexSettingsStoreFsLock implements JsonEnum { + Native("native"), + + Simple("simple"); + + private final String jsonValue; + + IndexSettingsStoreFsLock(String jsonValue) { + this.jsonValue = jsonValue; + } + + public String jsonValue() { + return this.jsonValue; + } + + public static final JsonEnum.Deserializer _DESERIALIZER = new JsonEnum.Deserializer<>( + IndexSettingsStoreFsLock.values() + ); +} diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/indices/IndexSettingsStoreHybrid.java b/java-client/src/generated/java/org/opensearch/client/opensearch/indices/IndexSettingsStoreHybrid.java new file mode 100644 index 0000000000..ede9733a52 --- /dev/null +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/indices/IndexSettingsStoreHybrid.java @@ -0,0 +1,238 @@ +/* + * SPDX-License-Identifier: Apache-2.0 + * + * The OpenSearch Contributors require contributions made to + * this file be licensed under the Apache-2.0 license or a + * compatible open source license. + */ + +/* + * 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. + */ + +/* + * Modifications Copyright OpenSearch Contributors. See + * GitHub history for details. + */ + +//---------------------------------------------------- +// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. +//---------------------------------------------------- + +package org.opensearch.client.opensearch.indices; + +import jakarta.json.stream.JsonGenerator; +import java.util.Objects; +import java.util.function.Function; +import javax.annotation.Generated; +import javax.annotation.Nonnull; +import javax.annotation.Nullable; +import org.opensearch.client.json.JsonpDeserializable; +import org.opensearch.client.json.JsonpDeserializer; +import org.opensearch.client.json.JsonpMapper; +import org.opensearch.client.json.ObjectBuilderDeserializer; +import org.opensearch.client.json.ObjectDeserializer; +import org.opensearch.client.json.PlainJsonSerializable; +import org.opensearch.client.util.CopyableBuilder; +import org.opensearch.client.util.ObjectBuilder; +import org.opensearch.client.util.ObjectBuilderBase; +import org.opensearch.client.util.ToCopyableBuilder; + +// typedef: indices.IndexSettingsStoreHybrid + +@JsonpDeserializable +@Generated("org.opensearch.client.codegen.CodeGenerator") +public class IndexSettingsStoreHybrid + implements + PlainJsonSerializable, + ToCopyableBuilder { + + @Nullable + private final IndexSettingsStoreHybridMmap mmap; + + @Nullable + private final IndexSettingsStoreHybridNio nio; + + // --------------------------------------------------------------------------------------------- + + private IndexSettingsStoreHybrid(Builder builder) { + this.mmap = builder.mmap; + this.nio = builder.nio; + } + + public static IndexSettingsStoreHybrid of(Function> fn) { + return fn.apply(new Builder()).build(); + } + + /** + * API name: {@code mmap} + */ + @Nullable + public final IndexSettingsStoreHybridMmap mmap() { + return this.mmap; + } + + /** + * API name: {@code nio} + */ + @Nullable + public final IndexSettingsStoreHybridNio nio() { + return this.nio; + } + + /** + * Serialize this object to JSON. + */ + @Override + public void serialize(JsonGenerator generator, JsonpMapper mapper) { + generator.writeStartObject(); + serializeInternal(generator, mapper); + generator.writeEnd(); + } + + protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { + if (this.mmap != null) { + generator.writeKey("mmap"); + this.mmap.serialize(generator, mapper); + } + + if (this.nio != null) { + generator.writeKey("nio"); + this.nio.serialize(generator, mapper); + } + } + + // --------------------------------------------------------------------------------------------- + + @Override + @Nonnull + public Builder toBuilder() { + return new Builder(this); + } + + @Nonnull + public static Builder builder() { + return new Builder(); + } + + /** + * Builder for {@link IndexSettingsStoreHybrid}. + */ + public static class Builder extends ObjectBuilderBase implements CopyableBuilder { + @Nullable + private IndexSettingsStoreHybridMmap mmap; + @Nullable + private IndexSettingsStoreHybridNio nio; + + public Builder() {} + + private Builder(IndexSettingsStoreHybrid o) { + this.mmap = o.mmap; + this.nio = o.nio; + } + + private Builder(Builder o) { + this.mmap = o.mmap; + this.nio = o.nio; + } + + @Override + @Nonnull + public Builder copy() { + return new Builder(this); + } + + /** + * API name: {@code mmap} + */ + @Nonnull + public final Builder mmap(@Nullable IndexSettingsStoreHybridMmap value) { + this.mmap = value; + return this; + } + + /** + * API name: {@code mmap} + */ + @Nonnull + public final Builder mmap(Function> fn) { + return mmap(fn.apply(new IndexSettingsStoreHybridMmap.Builder()).build()); + } + + /** + * API name: {@code nio} + */ + @Nonnull + public final Builder nio(@Nullable IndexSettingsStoreHybridNio value) { + this.nio = value; + return this; + } + + /** + * API name: {@code nio} + */ + @Nonnull + public final Builder nio(Function> fn) { + return nio(fn.apply(new IndexSettingsStoreHybridNio.Builder()).build()); + } + + /** + * Builds a {@link IndexSettingsStoreHybrid}. + * + * @throws NullPointerException if some of the required fields are null. + */ + @Override + @Nonnull + public IndexSettingsStoreHybrid build() { + _checkSingleUse(); + + return new IndexSettingsStoreHybrid(this); + } + } + + // --------------------------------------------------------------------------------------------- + + /** + * Json deserializer for {@link IndexSettingsStoreHybrid} + */ + public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer.lazy( + Builder::new, + IndexSettingsStoreHybrid::setupIndexSettingsStoreHybridDeserializer + ); + + protected static void setupIndexSettingsStoreHybridDeserializer(ObjectDeserializer op) { + op.add(Builder::mmap, IndexSettingsStoreHybridMmap._DESERIALIZER, "mmap"); + op.add(Builder::nio, IndexSettingsStoreHybridNio._DESERIALIZER, "nio"); + } + + @Override + public int hashCode() { + int result = 17; + result = 31 * result + Objects.hashCode(this.mmap); + result = 31 * result + Objects.hashCode(this.nio); + return result; + } + + @Override + public boolean equals(Object o) { + if (this == o) return true; + if (o == null || this.getClass() != o.getClass()) return false; + IndexSettingsStoreHybrid other = (IndexSettingsStoreHybrid) o; + return Objects.equals(this.mmap, other.mmap) && Objects.equals(this.nio, other.nio); + } +} diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/indices/IndexSettingsStoreHybridMmap.java b/java-client/src/generated/java/org/opensearch/client/opensearch/indices/IndexSettingsStoreHybridMmap.java new file mode 100644 index 0000000000..1a686fb72a --- /dev/null +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/indices/IndexSettingsStoreHybridMmap.java @@ -0,0 +1,215 @@ +/* + * SPDX-License-Identifier: Apache-2.0 + * + * The OpenSearch Contributors require contributions made to + * this file be licensed under the Apache-2.0 license or a + * compatible open source license. + */ + +/* + * 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. + */ + +/* + * Modifications Copyright OpenSearch Contributors. See + * GitHub history for details. + */ + +//---------------------------------------------------- +// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. +//---------------------------------------------------- + +package org.opensearch.client.opensearch.indices; + +import jakarta.json.stream.JsonGenerator; +import java.util.List; +import java.util.Objects; +import java.util.function.Function; +import javax.annotation.Generated; +import javax.annotation.Nonnull; +import javax.annotation.Nullable; +import org.opensearch.client.json.JsonpDeserializable; +import org.opensearch.client.json.JsonpDeserializer; +import org.opensearch.client.json.JsonpMapper; +import org.opensearch.client.json.ObjectBuilderDeserializer; +import org.opensearch.client.json.ObjectDeserializer; +import org.opensearch.client.json.PlainJsonSerializable; +import org.opensearch.client.util.ApiTypeHelper; +import org.opensearch.client.util.CopyableBuilder; +import org.opensearch.client.util.ObjectBuilder; +import org.opensearch.client.util.ObjectBuilderBase; +import org.opensearch.client.util.ToCopyableBuilder; + +// typedef: indices.IndexSettingsStoreHybridMmap + +@JsonpDeserializable +@Generated("org.opensearch.client.codegen.CodeGenerator") +public class IndexSettingsStoreHybridMmap + implements + PlainJsonSerializable, + ToCopyableBuilder { + + @Nonnull + private final List extensions; + + // --------------------------------------------------------------------------------------------- + + private IndexSettingsStoreHybridMmap(Builder builder) { + this.extensions = ApiTypeHelper.unmodifiable(builder.extensions); + } + + public static IndexSettingsStoreHybridMmap of( + Function> fn + ) { + return fn.apply(new Builder()).build(); + } + + /** + * API name: {@code extensions} + */ + @Nonnull + public final List extensions() { + return this.extensions; + } + + /** + * Serialize this object to JSON. + */ + @Override + 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.extensions)) { + generator.writeKey("extensions"); + generator.writeStartArray(); + for (String item0 : this.extensions) { + generator.write(item0); + } + generator.writeEnd(); + } + } + + // --------------------------------------------------------------------------------------------- + + @Override + @Nonnull + public Builder toBuilder() { + return new Builder(this); + } + + @Nonnull + public static Builder builder() { + return new Builder(); + } + + /** + * Builder for {@link IndexSettingsStoreHybridMmap}. + */ + public static class Builder extends ObjectBuilderBase implements CopyableBuilder { + @Nullable + private List extensions; + + public Builder() {} + + private Builder(IndexSettingsStoreHybridMmap o) { + this.extensions = _listCopy(o.extensions); + } + + private Builder(Builder o) { + this.extensions = _listCopy(o.extensions); + } + + @Override + @Nonnull + public Builder copy() { + return new Builder(this); + } + + /** + * API name: {@code extensions} + * + *

+ * Adds all elements of list to extensions. + *

+ */ + @Nonnull + public final Builder extensions(List list) { + this.extensions = _listAddAll(this.extensions, list); + return this; + } + + /** + * API name: {@code extensions} + * + *

+ * Adds one or more values to extensions. + *

+ */ + @Nonnull + public final Builder extensions(String value, String... values) { + this.extensions = _listAdd(this.extensions, value, values); + return this; + } + + /** + * Builds a {@link IndexSettingsStoreHybridMmap}. + * + * @throws NullPointerException if some of the required fields are null. + */ + @Override + @Nonnull + public IndexSettingsStoreHybridMmap build() { + _checkSingleUse(); + + return new IndexSettingsStoreHybridMmap(this); + } + } + + // --------------------------------------------------------------------------------------------- + + /** + * Json deserializer for {@link IndexSettingsStoreHybridMmap} + */ + public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer.lazy( + Builder::new, + IndexSettingsStoreHybridMmap::setupIndexSettingsStoreHybridMmapDeserializer + ); + + protected static void setupIndexSettingsStoreHybridMmapDeserializer(ObjectDeserializer op) { + op.add(Builder::extensions, JsonpDeserializer.arrayDeserializer(JsonpDeserializer.stringDeserializer()), "extensions"); + } + + @Override + public int hashCode() { + int result = 17; + result = 31 * result + Objects.hashCode(this.extensions); + return result; + } + + @Override + public boolean equals(Object o) { + if (this == o) return true; + if (o == null || this.getClass() != o.getClass()) return false; + IndexSettingsStoreHybridMmap other = (IndexSettingsStoreHybridMmap) o; + return Objects.equals(this.extensions, other.extensions); + } +} diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/indices/IndexSettingsStoreHybridNio.java b/java-client/src/generated/java/org/opensearch/client/opensearch/indices/IndexSettingsStoreHybridNio.java new file mode 100644 index 0000000000..3d34f986a3 --- /dev/null +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/indices/IndexSettingsStoreHybridNio.java @@ -0,0 +1,215 @@ +/* + * SPDX-License-Identifier: Apache-2.0 + * + * The OpenSearch Contributors require contributions made to + * this file be licensed under the Apache-2.0 license or a + * compatible open source license. + */ + +/* + * 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. + */ + +/* + * Modifications Copyright OpenSearch Contributors. See + * GitHub history for details. + */ + +//---------------------------------------------------- +// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. +//---------------------------------------------------- + +package org.opensearch.client.opensearch.indices; + +import jakarta.json.stream.JsonGenerator; +import java.util.List; +import java.util.Objects; +import java.util.function.Function; +import javax.annotation.Generated; +import javax.annotation.Nonnull; +import javax.annotation.Nullable; +import org.opensearch.client.json.JsonpDeserializable; +import org.opensearch.client.json.JsonpDeserializer; +import org.opensearch.client.json.JsonpMapper; +import org.opensearch.client.json.ObjectBuilderDeserializer; +import org.opensearch.client.json.ObjectDeserializer; +import org.opensearch.client.json.PlainJsonSerializable; +import org.opensearch.client.util.ApiTypeHelper; +import org.opensearch.client.util.CopyableBuilder; +import org.opensearch.client.util.ObjectBuilder; +import org.opensearch.client.util.ObjectBuilderBase; +import org.opensearch.client.util.ToCopyableBuilder; + +// typedef: indices.IndexSettingsStoreHybridNio + +@JsonpDeserializable +@Generated("org.opensearch.client.codegen.CodeGenerator") +public class IndexSettingsStoreHybridNio + implements + PlainJsonSerializable, + ToCopyableBuilder { + + @Nonnull + private final List extensions; + + // --------------------------------------------------------------------------------------------- + + private IndexSettingsStoreHybridNio(Builder builder) { + this.extensions = ApiTypeHelper.unmodifiable(builder.extensions); + } + + public static IndexSettingsStoreHybridNio of( + Function> fn + ) { + return fn.apply(new Builder()).build(); + } + + /** + * API name: {@code extensions} + */ + @Nonnull + public final List extensions() { + return this.extensions; + } + + /** + * Serialize this object to JSON. + */ + @Override + 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.extensions)) { + generator.writeKey("extensions"); + generator.writeStartArray(); + for (String item0 : this.extensions) { + generator.write(item0); + } + generator.writeEnd(); + } + } + + // --------------------------------------------------------------------------------------------- + + @Override + @Nonnull + public Builder toBuilder() { + return new Builder(this); + } + + @Nonnull + public static Builder builder() { + return new Builder(); + } + + /** + * Builder for {@link IndexSettingsStoreHybridNio}. + */ + public static class Builder extends ObjectBuilderBase implements CopyableBuilder { + @Nullable + private List extensions; + + public Builder() {} + + private Builder(IndexSettingsStoreHybridNio o) { + this.extensions = _listCopy(o.extensions); + } + + private Builder(Builder o) { + this.extensions = _listCopy(o.extensions); + } + + @Override + @Nonnull + public Builder copy() { + return new Builder(this); + } + + /** + * API name: {@code extensions} + * + *

+ * Adds all elements of list to extensions. + *

+ */ + @Nonnull + public final Builder extensions(List list) { + this.extensions = _listAddAll(this.extensions, list); + return this; + } + + /** + * API name: {@code extensions} + * + *

+ * Adds one or more values to extensions. + *

+ */ + @Nonnull + public final Builder extensions(String value, String... values) { + this.extensions = _listAdd(this.extensions, value, values); + return this; + } + + /** + * Builds a {@link IndexSettingsStoreHybridNio}. + * + * @throws NullPointerException if some of the required fields are null. + */ + @Override + @Nonnull + public IndexSettingsStoreHybridNio build() { + _checkSingleUse(); + + return new IndexSettingsStoreHybridNio(this); + } + } + + // --------------------------------------------------------------------------------------------- + + /** + * Json deserializer for {@link IndexSettingsStoreHybridNio} + */ + public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer.lazy( + Builder::new, + IndexSettingsStoreHybridNio::setupIndexSettingsStoreHybridNioDeserializer + ); + + protected static void setupIndexSettingsStoreHybridNioDeserializer(ObjectDeserializer op) { + op.add(Builder::extensions, JsonpDeserializer.arrayDeserializer(JsonpDeserializer.stringDeserializer()), "extensions"); + } + + @Override + public int hashCode() { + int result = 17; + result = 31 * result + Objects.hashCode(this.extensions); + return result; + } + + @Override + public boolean equals(Object o) { + if (this == o) return true; + if (o == null || this.getClass() != o.getClass()) return false; + IndexSettingsStoreHybridNio other = (IndexSettingsStoreHybridNio) o; + return Objects.equals(this.extensions, other.extensions); + } +} diff --git a/java-client/src/main/java/org/opensearch/client/opensearch/indices/IndexVersioning.java b/java-client/src/generated/java/org/opensearch/client/opensearch/indices/IndexVersioning.java similarity index 51% rename from java-client/src/main/java/org/opensearch/client/opensearch/indices/IndexVersioning.java rename to java-client/src/generated/java/org/opensearch/client/opensearch/indices/IndexVersioning.java index b6a6f9d315..3dbed624ed 100644 --- a/java-client/src/main/java/org/opensearch/client/opensearch/indices/IndexVersioning.java +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/indices/IndexVersioning.java @@ -30,48 +30,72 @@ * GitHub history for details. */ +//---------------------------------------------------- +// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. +//---------------------------------------------------- + package org.opensearch.client.opensearch.indices; import jakarta.json.stream.JsonGenerator; +import java.util.Objects; import java.util.function.Function; +import javax.annotation.Generated; +import javax.annotation.Nonnull; +import javax.annotation.Nullable; import org.opensearch.client.json.JsonpDeserializable; import org.opensearch.client.json.JsonpDeserializer; import org.opensearch.client.json.JsonpMapper; import org.opensearch.client.json.ObjectBuilderDeserializer; import org.opensearch.client.json.ObjectDeserializer; import org.opensearch.client.json.PlainJsonSerializable; -import org.opensearch.client.util.ApiTypeHelper; +import org.opensearch.client.util.CopyableBuilder; import org.opensearch.client.util.ObjectBuilder; import org.opensearch.client.util.ObjectBuilderBase; +import org.opensearch.client.util.ToCopyableBuilder; -// typedef: indices._types.IndexVersioning +// typedef: indices.IndexVersioning @JsonpDeserializable -public class IndexVersioning implements PlainJsonSerializable { +@Generated("org.opensearch.client.codegen.CodeGenerator") +public class IndexVersioning implements PlainJsonSerializable, ToCopyableBuilder { + + @Nullable private final String created; + @Nullable + private final String createdString; + // --------------------------------------------------------------------------------------------- private IndexVersioning(Builder builder) { - - this.created = ApiTypeHelper.requireNonNull(builder.created, this, "created"); - + this.created = builder.created; + this.createdString = builder.createdString; } - public static IndexVersioning of(Function> fn) { + public static IndexVersioning of(Function> fn) { return fn.apply(new Builder()).build(); } /** - * Required - API name: {@code created} + * API name: {@code created} */ + @Nullable public final String created() { return this.created; } + /** + * API name: {@code created_string} + */ + @Nullable + public final String createdString() { + return this.createdString; + } + /** * Serialize this object to JSON. */ + @Override public void serialize(JsonGenerator generator, JsonpMapper mapper) { generator.writeStartObject(); serializeInternal(generator, mapper); @@ -79,35 +103,82 @@ public void serialize(JsonGenerator generator, JsonpMapper mapper) { } protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { + if (this.created != null) { + generator.writeKey("created"); + generator.write(this.created); + } - generator.writeKey("created"); - generator.write(this.created); - + if (this.createdString != null) { + generator.writeKey("created_string"); + generator.write(this.createdString); + } } // --------------------------------------------------------------------------------------------- + @Override + @Nonnull + public Builder toBuilder() { + return new Builder(this); + } + + @Nonnull + public static Builder builder() { + return new Builder(); + } + /** * Builder for {@link IndexVersioning}. */ - - public static class Builder extends ObjectBuilderBase implements ObjectBuilder { + public static class Builder extends ObjectBuilderBase implements CopyableBuilder { + @Nullable private String created; + @Nullable + private String createdString; + + public Builder() {} + + private Builder(IndexVersioning o) { + this.created = o.created; + this.createdString = o.createdString; + } + + private Builder(Builder o) { + this.created = o.created; + this.createdString = o.createdString; + } + + @Override + @Nonnull + public Builder copy() { + return new Builder(this); + } /** - * Required - API name: {@code created} + * API name: {@code created} */ - public final Builder created(String value) { + @Nonnull + public final Builder created(@Nullable String value) { this.created = value; return this; } + /** + * API name: {@code created_string} + */ + @Nonnull + public final Builder createdString(@Nullable String value) { + this.createdString = value; + return this; + } + /** * Builds a {@link IndexVersioning}. * - * @throws NullPointerException - * if some of the required fields are null. + * @throws NullPointerException if some of the required fields are null. */ + @Override + @Nonnull public IndexVersioning build() { _checkSingleUse(); @@ -126,9 +197,23 @@ public IndexVersioning build() { ); protected static void setupIndexVersioningDeserializer(ObjectDeserializer op) { - op.add(Builder::created, JsonpDeserializer.stringDeserializer(), "created"); + op.add(Builder::createdString, JsonpDeserializer.stringDeserializer(), "created_string"); + } + @Override + public int hashCode() { + int result = 17; + result = 31 * result + Objects.hashCode(this.created); + result = 31 * result + Objects.hashCode(this.createdString); + return result; } + @Override + public boolean equals(Object o) { + if (this == o) return true; + if (o == null || this.getClass() != o.getClass()) return false; + IndexVersioning other = (IndexVersioning) o; + return Objects.equals(this.created, other.created) && Objects.equals(this.createdString, other.createdString); + } } diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/indices/IndexingPressure.java b/java-client/src/generated/java/org/opensearch/client/opensearch/indices/IndexingPressure.java new file mode 100644 index 0000000000..85148faca1 --- /dev/null +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/indices/IndexingPressure.java @@ -0,0 +1,191 @@ +/* + * SPDX-License-Identifier: Apache-2.0 + * + * The OpenSearch Contributors require contributions made to + * this file be licensed under the Apache-2.0 license or a + * compatible open source license. + */ + +/* + * 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. + */ + +/* + * Modifications Copyright OpenSearch Contributors. See + * GitHub history for details. + */ + +//---------------------------------------------------- +// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. +//---------------------------------------------------- + +package org.opensearch.client.opensearch.indices; + +import jakarta.json.stream.JsonGenerator; +import java.util.function.Function; +import javax.annotation.Generated; +import javax.annotation.Nonnull; +import org.opensearch.client.json.JsonpDeserializable; +import org.opensearch.client.json.JsonpDeserializer; +import org.opensearch.client.json.JsonpMapper; +import org.opensearch.client.json.ObjectBuilderDeserializer; +import org.opensearch.client.json.ObjectDeserializer; +import org.opensearch.client.json.PlainJsonSerializable; +import org.opensearch.client.util.ApiTypeHelper; +import org.opensearch.client.util.CopyableBuilder; +import org.opensearch.client.util.ObjectBuilder; +import org.opensearch.client.util.ObjectBuilderBase; +import org.opensearch.client.util.ToCopyableBuilder; + +// typedef: indices.IndexingPressure + +@JsonpDeserializable +@Generated("org.opensearch.client.codegen.CodeGenerator") +public class IndexingPressure implements PlainJsonSerializable, ToCopyableBuilder { + + @Nonnull + private final IndexingPressureMemory memory; + + // --------------------------------------------------------------------------------------------- + + private IndexingPressure(Builder builder) { + this.memory = ApiTypeHelper.requireNonNull(builder.memory, this, "memory"); + } + + public static IndexingPressure of(Function> fn) { + return fn.apply(new Builder()).build(); + } + + /** + * Required - API name: {@code memory} + */ + @Nonnull + public final IndexingPressureMemory memory() { + return this.memory; + } + + /** + * Serialize this object to JSON. + */ + @Override + public void serialize(JsonGenerator generator, JsonpMapper mapper) { + generator.writeStartObject(); + serializeInternal(generator, mapper); + generator.writeEnd(); + } + + protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { + generator.writeKey("memory"); + this.memory.serialize(generator, mapper); + } + + // --------------------------------------------------------------------------------------------- + + @Override + @Nonnull + public Builder toBuilder() { + return new Builder(this); + } + + @Nonnull + public static Builder builder() { + return new Builder(); + } + + /** + * Builder for {@link IndexingPressure}. + */ + public static class Builder extends ObjectBuilderBase implements CopyableBuilder { + private IndexingPressureMemory memory; + + public Builder() {} + + private Builder(IndexingPressure o) { + this.memory = o.memory; + } + + private Builder(Builder o) { + this.memory = o.memory; + } + + @Override + @Nonnull + public Builder copy() { + return new Builder(this); + } + + /** + * Required - API name: {@code memory} + */ + @Nonnull + public final Builder memory(IndexingPressureMemory value) { + this.memory = value; + return this; + } + + /** + * Required - API name: {@code memory} + */ + @Nonnull + public final Builder memory(Function> fn) { + return memory(fn.apply(new IndexingPressureMemory.Builder()).build()); + } + + /** + * Builds a {@link IndexingPressure}. + * + * @throws NullPointerException if some of the required fields are null. + */ + @Override + @Nonnull + public IndexingPressure build() { + _checkSingleUse(); + + return new IndexingPressure(this); + } + } + + // --------------------------------------------------------------------------------------------- + + /** + * Json deserializer for {@link IndexingPressure} + */ + public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer.lazy( + Builder::new, + IndexingPressure::setupIndexingPressureDeserializer + ); + + protected static void setupIndexingPressureDeserializer(ObjectDeserializer op) { + op.add(Builder::memory, IndexingPressureMemory._DESERIALIZER, "memory"); + } + + @Override + public int hashCode() { + int result = 17; + result = 31 * result + this.memory.hashCode(); + return result; + } + + @Override + public boolean equals(Object o) { + if (this == o) return true; + if (o == null || this.getClass() != o.getClass()) return false; + IndexingPressure other = (IndexingPressure) o; + return this.memory.equals(other.memory); + } +} diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/indices/IndexingPressureMemory.java b/java-client/src/generated/java/org/opensearch/client/opensearch/indices/IndexingPressureMemory.java new file mode 100644 index 0000000000..81e6ffaf08 --- /dev/null +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/indices/IndexingPressureMemory.java @@ -0,0 +1,200 @@ +/* + * SPDX-License-Identifier: Apache-2.0 + * + * The OpenSearch Contributors require contributions made to + * this file be licensed under the Apache-2.0 license or a + * compatible open source license. + */ + +/* + * 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. + */ + +/* + * Modifications Copyright OpenSearch Contributors. See + * GitHub history for details. + */ + +//---------------------------------------------------- +// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. +//---------------------------------------------------- + +package org.opensearch.client.opensearch.indices; + +import jakarta.json.stream.JsonGenerator; +import java.util.Objects; +import java.util.function.Function; +import javax.annotation.Generated; +import javax.annotation.Nonnull; +import javax.annotation.Nullable; +import org.opensearch.client.json.JsonpDeserializable; +import org.opensearch.client.json.JsonpDeserializer; +import org.opensearch.client.json.JsonpMapper; +import org.opensearch.client.json.ObjectBuilderDeserializer; +import org.opensearch.client.json.ObjectDeserializer; +import org.opensearch.client.json.PlainJsonSerializable; +import org.opensearch.client.util.CopyableBuilder; +import org.opensearch.client.util.ObjectBuilder; +import org.opensearch.client.util.ObjectBuilderBase; +import org.opensearch.client.util.ToCopyableBuilder; + +// typedef: indices.IndexingPressureMemory + +@JsonpDeserializable +@Generated("org.opensearch.client.codegen.CodeGenerator") +public class IndexingPressureMemory + implements + PlainJsonSerializable, + ToCopyableBuilder { + + @Nullable + private final String limit; + + // --------------------------------------------------------------------------------------------- + + private IndexingPressureMemory(Builder builder) { + this.limit = builder.limit; + } + + public static IndexingPressureMemory of(Function> fn) { + return fn.apply(new Builder()).build(); + } + + /** + * Number of outstanding bytes that may be consumed by indexing requests. When this limit is reached or exceeded, the node will reject + * new coordinating and primary operations. When replica operations consume 1.5x this limit, the node will reject new replica + * operations. Defaults to 10% of the heap. + *

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

+ */ + @Nullable + public final String limit() { + return this.limit; + } + + /** + * Serialize this object to JSON. + */ + @Override + public void serialize(JsonGenerator generator, JsonpMapper mapper) { + generator.writeStartObject(); + serializeInternal(generator, mapper); + generator.writeEnd(); + } + + protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { + if (this.limit != null) { + generator.writeKey("limit"); + generator.write(this.limit); + } + } + + // --------------------------------------------------------------------------------------------- + + @Override + @Nonnull + public Builder toBuilder() { + return new Builder(this); + } + + @Nonnull + public static Builder builder() { + return new Builder(); + } + + /** + * Builder for {@link IndexingPressureMemory}. + */ + public static class Builder extends ObjectBuilderBase implements CopyableBuilder { + @Nullable + private String limit; + + public Builder() {} + + private Builder(IndexingPressureMemory o) { + this.limit = o.limit; + } + + private Builder(Builder o) { + this.limit = o.limit; + } + + @Override + @Nonnull + public Builder copy() { + return new Builder(this); + } + + /** + * Number of outstanding bytes that may be consumed by indexing requests. When this limit is reached or exceeded, the node will + * reject new coordinating and primary operations. When replica operations consume 1.5x this limit, the node will reject new replica + * operations. Defaults to 10% of the heap. + *

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

+ */ + @Nonnull + public final Builder limit(@Nullable String value) { + this.limit = value; + return this; + } + + /** + * Builds a {@link IndexingPressureMemory}. + * + * @throws NullPointerException if some of the required fields are null. + */ + @Override + @Nonnull + public IndexingPressureMemory build() { + _checkSingleUse(); + + return new IndexingPressureMemory(this); + } + } + + // --------------------------------------------------------------------------------------------- + + /** + * Json deserializer for {@link IndexingPressureMemory} + */ + public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer.lazy( + Builder::new, + IndexingPressureMemory::setupIndexingPressureMemoryDeserializer + ); + + protected static void setupIndexingPressureMemoryDeserializer(ObjectDeserializer op) { + op.add(Builder::limit, JsonpDeserializer.stringDeserializer(), "limit"); + } + + @Override + public int hashCode() { + int result = 17; + result = 31 * result + Objects.hashCode(this.limit); + return result; + } + + @Override + public boolean equals(Object o) { + if (this == o) return true; + if (o == null || this.getClass() != o.getClass()) return false; + IndexingPressureMemory other = (IndexingPressureMemory) o; + return Objects.equals(this.limit, other.limit); + } +} diff --git a/java-client/src/main/java/org/opensearch/client/opensearch/indices/IndexingSlowlog.java b/java-client/src/generated/java/org/opensearch/client/opensearch/indices/IndexingSlowlog.java similarity index 68% rename from java-client/src/main/java/org/opensearch/client/opensearch/indices/IndexingSlowlog.java rename to java-client/src/generated/java/org/opensearch/client/opensearch/indices/IndexingSlowlog.java index 68ae5b3063..a329815231 100644 --- a/java-client/src/main/java/org/opensearch/client/opensearch/indices/IndexingSlowlog.java +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/indices/IndexingSlowlog.java @@ -30,10 +30,17 @@ * GitHub history for details. */ +//---------------------------------------------------- +// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. +//---------------------------------------------------- + package org.opensearch.client.opensearch.indices; import jakarta.json.stream.JsonGenerator; +import java.util.Objects; import java.util.function.Function; +import javax.annotation.Generated; +import javax.annotation.Nonnull; import javax.annotation.Nullable; import org.opensearch.client.json.JsonpDeserializable; import org.opensearch.client.json.JsonpDeserializer; @@ -41,19 +48,25 @@ import org.opensearch.client.json.ObjectBuilderDeserializer; import org.opensearch.client.json.ObjectDeserializer; import org.opensearch.client.json.PlainJsonSerializable; +import org.opensearch.client.util.CopyableBuilder; import org.opensearch.client.util.ObjectBuilder; import org.opensearch.client.util.ObjectBuilderBase; +import org.opensearch.client.util.ToCopyableBuilder; + +// typedef: indices.IndexingSlowlog @JsonpDeserializable -public class IndexingSlowlog implements PlainJsonSerializable { +@Generated("org.opensearch.client.codegen.CodeGenerator") +public class IndexingSlowlog implements PlainJsonSerializable, ToCopyableBuilder { + @Nullable private final String level; @Nullable - private final Integer source; + private final Boolean reformat; @Nullable - private final Boolean reformat; + private final Integer source; @Nullable private final IndexingSlowlogThresholds threshold; @@ -61,15 +74,13 @@ public class IndexingSlowlog implements PlainJsonSerializable { // --------------------------------------------------------------------------------------------- private IndexingSlowlog(Builder builder) { - this.level = builder.level; - this.source = builder.source; this.reformat = builder.reformat; + this.source = builder.source; this.threshold = builder.threshold; - } - public static IndexingSlowlog of(Function> fn) { + public static IndexingSlowlog of(Function> fn) { return fn.apply(new Builder()).build(); } @@ -82,19 +93,19 @@ public final String level() { } /** - * API name: {@code source} + * API name: {@code reformat} */ @Nullable - public final Integer source() { - return this.source; + public final Boolean reformat() { + return this.reformat; } /** - * API name: {@code reformat} + * API name: {@code source} */ @Nullable - public final Boolean reformat() { - return this.reformat; + public final Integer source() { + return this.source; } /** @@ -108,6 +119,7 @@ public final IndexingSlowlogThresholds threshold() { /** * Serialize this object to JSON. */ + @Override public void serialize(JsonGenerator generator, JsonpMapper mapper) { generator.writeStartObject(); serializeInternal(generator, mapper); @@ -115,76 +127,106 @@ public void serialize(JsonGenerator generator, JsonpMapper mapper) { } protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { - if (this.level != null) { generator.writeKey("level"); generator.write(this.level); - } - if (this.source != null) { - generator.writeKey("source"); - generator.write(this.source); - } if (this.reformat != null) { generator.writeKey("reformat"); generator.write(this.reformat); + } + if (this.source != null) { + generator.writeKey("source"); + generator.write(this.source); } + if (this.threshold != null) { generator.writeKey("threshold"); this.threshold.serialize(generator, mapper); - } - } // --------------------------------------------------------------------------------------------- + @Override + @Nonnull + public Builder toBuilder() { + return new Builder(this); + } + + @Nonnull + public static Builder builder() { + return new Builder(); + } + /** * Builder for {@link IndexingSlowlog}. */ - - public static class Builder extends ObjectBuilderBase implements ObjectBuilder { + public static class Builder extends ObjectBuilderBase implements CopyableBuilder { @Nullable private String level; - - @Nullable - private Integer source; - @Nullable private Boolean reformat; - + @Nullable + private Integer source; @Nullable private IndexingSlowlogThresholds threshold; + public Builder() {} + + private Builder(IndexingSlowlog o) { + this.level = o.level; + this.reformat = o.reformat; + this.source = o.source; + this.threshold = o.threshold; + } + + private Builder(Builder o) { + this.level = o.level; + this.reformat = o.reformat; + this.source = o.source; + this.threshold = o.threshold; + } + + @Override + @Nonnull + public Builder copy() { + return new Builder(this); + } + /** * API name: {@code level} */ + @Nonnull public final Builder level(@Nullable String value) { this.level = value; return this; } /** - * API name: {@code source} + * API name: {@code reformat} */ - public final Builder source(@Nullable Integer value) { - this.source = value; + @Nonnull + public final Builder reformat(@Nullable Boolean value) { + this.reformat = value; return this; } /** - * API name: {@code reformat} + * API name: {@code source} */ - public final Builder reformat(@Nullable Boolean value) { - this.reformat = value; + @Nonnull + public final Builder source(@Nullable Integer value) { + this.source = value; return this; } /** * API name: {@code threshold} */ + @Nonnull public final Builder threshold(@Nullable IndexingSlowlogThresholds value) { this.threshold = value; return this; @@ -193,16 +235,18 @@ public final Builder threshold(@Nullable IndexingSlowlogThresholds value) { /** * API name: {@code threshold} */ + @Nonnull public final Builder threshold(Function> fn) { - return this.threshold(fn.apply(new IndexingSlowlogThresholds.Builder()).build()); + return threshold(fn.apply(new IndexingSlowlogThresholds.Builder()).build()); } /** * Builds a {@link IndexingSlowlog}. * - * @throws NullPointerException - * if some of the required fields are null. + * @throws NullPointerException if some of the required fields are null. */ + @Override + @Nonnull public IndexingSlowlog build() { _checkSingleUse(); @@ -217,16 +261,34 @@ public IndexingSlowlog build() { */ public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer.lazy( Builder::new, - IndexingSlowlog::setupIndexingSlowlogSettingsDeserializer + IndexingSlowlog::setupIndexingSlowlogDeserializer ); - protected static void setupIndexingSlowlogSettingsDeserializer(ObjectDeserializer op) { - + protected static void setupIndexingSlowlogDeserializer(ObjectDeserializer op) { op.add(Builder::level, JsonpDeserializer.stringDeserializer(), "level"); - op.add(Builder::source, JsonpDeserializer.integerDeserializer(), "source"); op.add(Builder::reformat, JsonpDeserializer.booleanDeserializer(), "reformat"); + op.add(Builder::source, JsonpDeserializer.integerDeserializer(), "source"); op.add(Builder::threshold, IndexingSlowlogThresholds._DESERIALIZER, "threshold"); + } + @Override + public int hashCode() { + int result = 17; + result = 31 * result + Objects.hashCode(this.level); + result = 31 * result + Objects.hashCode(this.reformat); + result = 31 * result + Objects.hashCode(this.source); + result = 31 * result + Objects.hashCode(this.threshold); + return result; } + @Override + public boolean equals(Object o) { + if (this == o) return true; + if (o == null || this.getClass() != o.getClass()) return false; + IndexingSlowlog other = (IndexingSlowlog) o; + return Objects.equals(this.level, other.level) + && Objects.equals(this.reformat, other.reformat) + && Objects.equals(this.source, other.source) + && Objects.equals(this.threshold, other.threshold); + } } diff --git a/java-client/src/main/java/org/opensearch/client/opensearch/indices/IndexingSlowlogThresholds.java b/java-client/src/generated/java/org/opensearch/client/opensearch/indices/IndexingSlowlogThresholds.java similarity index 64% rename from java-client/src/main/java/org/opensearch/client/opensearch/indices/IndexingSlowlogThresholds.java rename to java-client/src/generated/java/org/opensearch/client/opensearch/indices/IndexingSlowlogThresholds.java index 5d3e3322be..c9e02c2736 100644 --- a/java-client/src/main/java/org/opensearch/client/opensearch/indices/IndexingSlowlogThresholds.java +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/indices/IndexingSlowlogThresholds.java @@ -30,10 +30,17 @@ * GitHub history for details. */ +//---------------------------------------------------- +// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. +//---------------------------------------------------- + package org.opensearch.client.opensearch.indices; import jakarta.json.stream.JsonGenerator; +import java.util.Objects; import java.util.function.Function; +import javax.annotation.Generated; +import javax.annotation.Nonnull; import javax.annotation.Nullable; import org.opensearch.client.json.JsonpDeserializable; import org.opensearch.client.json.JsonpDeserializer; @@ -41,31 +48,34 @@ import org.opensearch.client.json.ObjectBuilderDeserializer; import org.opensearch.client.json.ObjectDeserializer; import org.opensearch.client.json.PlainJsonSerializable; +import org.opensearch.client.util.CopyableBuilder; import org.opensearch.client.util.ObjectBuilder; import org.opensearch.client.util.ObjectBuilderBase; +import org.opensearch.client.util.ToCopyableBuilder; + +// typedef: indices.IndexingSlowlogThresholds @JsonpDeserializable -public class IndexingSlowlogThresholds implements PlainJsonSerializable { +@Generated("org.opensearch.client.codegen.CodeGenerator") +public class IndexingSlowlogThresholds + implements + PlainJsonSerializable, + ToCopyableBuilder { + @Nullable private final SlowlogThresholdLevels index; // --------------------------------------------------------------------------------------------- private IndexingSlowlogThresholds(Builder builder) { - this.index = builder.index; - } - public static IndexingSlowlogThresholds of(Function> fn) { + public static IndexingSlowlogThresholds of(Function> fn) { return fn.apply(new Builder()).build(); } /** - * The indexing slow log, similar in functionality to the search slow log. The - * log file name ends with _index_indexing_slowlog.json. Log and - * the thresholds are configured in the same way as the search slowlog. - *

* API name: {@code index} */ @Nullable @@ -76,6 +86,7 @@ public final SlowlogThresholdLevels index() { /** * Serialize this object to JSON. */ + @Override public void serialize(JsonGenerator generator, JsonpMapper mapper) { generator.writeStartObject(); serializeInternal(generator, mapper); @@ -83,54 +94,72 @@ public void serialize(JsonGenerator generator, JsonpMapper mapper) { } protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { - if (this.index != null) { generator.writeKey("index"); this.index.serialize(generator, mapper); - } - } // --------------------------------------------------------------------------------------------- + @Override + @Nonnull + public Builder toBuilder() { + return new Builder(this); + } + + @Nonnull + public static Builder builder() { + return new Builder(); + } + /** * Builder for {@link IndexingSlowlogThresholds}. */ - - public static class Builder extends ObjectBuilderBase implements ObjectBuilder { + public static class Builder extends ObjectBuilderBase implements CopyableBuilder { @Nullable private SlowlogThresholdLevels index; + public Builder() {} + + private Builder(IndexingSlowlogThresholds o) { + this.index = o.index; + } + + private Builder(Builder o) { + this.index = o.index; + } + + @Override + @Nonnull + public Builder copy() { + return new Builder(this); + } + /** - * The indexing slow log, similar in functionality to the search slow log. The - * log file name ends with _index_indexing_slowlog.json. Log and - * the thresholds are configured in the same way as the search slowlog. - *

* API name: {@code index} */ + @Nonnull public final Builder index(@Nullable SlowlogThresholdLevels value) { this.index = value; return this; } /** - * The indexing slow log, similar in functionality to the search slow log. The - * log file name ends with _index_indexing_slowlog.json. Log and - * the thresholds are configured in the same way as the search slowlog. - *

* API name: {@code index} */ + @Nonnull public final Builder index(Function> fn) { - return this.index(fn.apply(new SlowlogThresholdLevels.Builder()).build()); + return index(fn.apply(new SlowlogThresholdLevels.Builder()).build()); } /** * Builds a {@link IndexingSlowlogThresholds}. * - * @throws NullPointerException - * if some of the required fields are null. + * @throws NullPointerException if some of the required fields are null. */ + @Override + @Nonnull public IndexingSlowlogThresholds build() { _checkSingleUse(); @@ -145,13 +174,25 @@ public IndexingSlowlogThresholds build() { */ public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer.lazy( Builder::new, - IndexingSlowlogThresholds::setupIndexingSlowlogTresholdsDeserializer + IndexingSlowlogThresholds::setupIndexingSlowlogThresholdsDeserializer ); - protected static void setupIndexingSlowlogTresholdsDeserializer(ObjectDeserializer op) { - + protected static void setupIndexingSlowlogThresholdsDeserializer(ObjectDeserializer op) { op.add(Builder::index, SlowlogThresholdLevels._DESERIALIZER, "index"); + } + @Override + public int hashCode() { + int result = 17; + result = 31 * result + Objects.hashCode(this.index); + return result; } + @Override + public boolean equals(Object o) { + if (this == o) return true; + if (o == null || this.getClass() != o.getClass()) return false; + IndexingSlowlogThresholds other = (IndexingSlowlogThresholds) o; + return Objects.equals(this.index, other.index); + } } diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/indices/RetentionLease.java b/java-client/src/generated/java/org/opensearch/client/opensearch/indices/RetentionLease.java new file mode 100644 index 0000000000..59402f9d87 --- /dev/null +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/indices/RetentionLease.java @@ -0,0 +1,192 @@ +/* + * SPDX-License-Identifier: Apache-2.0 + * + * The OpenSearch Contributors require contributions made to + * this file be licensed under the Apache-2.0 license or a + * compatible open source license. + */ + +/* + * 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. + */ + +/* + * Modifications Copyright OpenSearch Contributors. See + * GitHub history for details. + */ + +//---------------------------------------------------- +// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. +//---------------------------------------------------- + +package org.opensearch.client.opensearch.indices; + +import jakarta.json.stream.JsonGenerator; +import java.util.function.Function; +import javax.annotation.Generated; +import javax.annotation.Nonnull; +import org.opensearch.client.json.JsonpDeserializable; +import org.opensearch.client.json.JsonpDeserializer; +import org.opensearch.client.json.JsonpMapper; +import org.opensearch.client.json.ObjectBuilderDeserializer; +import org.opensearch.client.json.ObjectDeserializer; +import org.opensearch.client.json.PlainJsonSerializable; +import org.opensearch.client.opensearch._types.Time; +import org.opensearch.client.util.ApiTypeHelper; +import org.opensearch.client.util.CopyableBuilder; +import org.opensearch.client.util.ObjectBuilder; +import org.opensearch.client.util.ObjectBuilderBase; +import org.opensearch.client.util.ToCopyableBuilder; + +// typedef: indices.RetentionLease + +@JsonpDeserializable +@Generated("org.opensearch.client.codegen.CodeGenerator") +public class RetentionLease implements PlainJsonSerializable, ToCopyableBuilder { + + @Nonnull + private final Time period; + + // --------------------------------------------------------------------------------------------- + + private RetentionLease(Builder builder) { + this.period = ApiTypeHelper.requireNonNull(builder.period, this, "period"); + } + + public static RetentionLease of(Function> fn) { + return fn.apply(new Builder()).build(); + } + + /** + * Required - API name: {@code period} + */ + @Nonnull + public final Time period() { + return this.period; + } + + /** + * Serialize this object to JSON. + */ + @Override + public void serialize(JsonGenerator generator, JsonpMapper mapper) { + generator.writeStartObject(); + serializeInternal(generator, mapper); + generator.writeEnd(); + } + + protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { + generator.writeKey("period"); + this.period.serialize(generator, mapper); + } + + // --------------------------------------------------------------------------------------------- + + @Override + @Nonnull + public Builder toBuilder() { + return new Builder(this); + } + + @Nonnull + public static Builder builder() { + return new Builder(); + } + + /** + * Builder for {@link RetentionLease}. + */ + public static class Builder extends ObjectBuilderBase implements CopyableBuilder { + private Time period; + + public Builder() {} + + private Builder(RetentionLease o) { + this.period = o.period; + } + + private Builder(Builder o) { + this.period = o.period; + } + + @Override + @Nonnull + public Builder copy() { + return new Builder(this); + } + + /** + * Required - API name: {@code period} + */ + @Nonnull + public final Builder period(Time value) { + this.period = value; + return this; + } + + /** + * Required - API name: {@code period} + */ + @Nonnull + public final Builder period(Function> fn) { + return period(fn.apply(new Time.Builder()).build()); + } + + /** + * Builds a {@link RetentionLease}. + * + * @throws NullPointerException if some of the required fields are null. + */ + @Override + @Nonnull + public RetentionLease build() { + _checkSingleUse(); + + return new RetentionLease(this); + } + } + + // --------------------------------------------------------------------------------------------- + + /** + * Json deserializer for {@link RetentionLease} + */ + public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer.lazy( + Builder::new, + RetentionLease::setupRetentionLeaseDeserializer + ); + + protected static void setupRetentionLeaseDeserializer(ObjectDeserializer op) { + op.add(Builder::period, Time._DESERIALIZER, "period"); + } + + @Override + public int hashCode() { + int result = 17; + result = 31 * result + this.period.hashCode(); + return result; + } + + @Override + public boolean equals(Object o) { + if (this == o) return true; + if (o == null || this.getClass() != o.getClass()) return false; + RetentionLease other = (RetentionLease) o; + return this.period.equals(other.period); + } +} diff --git a/java-client/src/main/java/org/opensearch/client/opensearch/indices/SearchIdle.java b/java-client/src/generated/java/org/opensearch/client/opensearch/indices/SearchIdle.java similarity index 67% rename from java-client/src/main/java/org/opensearch/client/opensearch/indices/SearchIdle.java rename to java-client/src/generated/java/org/opensearch/client/opensearch/indices/SearchIdle.java index 6ebc92ebfe..13db51a429 100644 --- a/java-client/src/main/java/org/opensearch/client/opensearch/indices/SearchIdle.java +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/indices/SearchIdle.java @@ -30,10 +30,17 @@ * GitHub history for details. */ +//---------------------------------------------------- +// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. +//---------------------------------------------------- + package org.opensearch.client.opensearch.indices; import jakarta.json.stream.JsonGenerator; +import java.util.Objects; import java.util.function.Function; +import javax.annotation.Generated; +import javax.annotation.Nonnull; import javax.annotation.Nullable; import org.opensearch.client.json.JsonpDeserializable; import org.opensearch.client.json.JsonpDeserializer; @@ -42,23 +49,27 @@ import org.opensearch.client.json.ObjectDeserializer; import org.opensearch.client.json.PlainJsonSerializable; import org.opensearch.client.opensearch._types.Time; +import org.opensearch.client.util.CopyableBuilder; import org.opensearch.client.util.ObjectBuilder; import org.opensearch.client.util.ObjectBuilderBase; +import org.opensearch.client.util.ToCopyableBuilder; + +// typedef: indices.SearchIdle @JsonpDeserializable -public class SearchIdle implements PlainJsonSerializable { +@Generated("org.opensearch.client.codegen.CodeGenerator") +public class SearchIdle implements PlainJsonSerializable, ToCopyableBuilder { + @Nullable private final Time after; // --------------------------------------------------------------------------------------------- private SearchIdle(Builder builder) { - this.after = builder.after; - } - public static SearchIdle of(Function> fn) { + public static SearchIdle of(Function> fn) { return fn.apply(new Builder()).build(); } @@ -73,6 +84,7 @@ public final Time after() { /** * Serialize this object to JSON. */ + @Override public void serialize(JsonGenerator generator, JsonpMapper mapper) { generator.writeStartObject(); serializeInternal(generator, mapper); @@ -80,28 +92,52 @@ public void serialize(JsonGenerator generator, JsonpMapper mapper) { } protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { - if (this.after != null) { generator.writeKey("after"); this.after.serialize(generator, mapper); - } - } // --------------------------------------------------------------------------------------------- + @Override + @Nonnull + public Builder toBuilder() { + return new Builder(this); + } + + @Nonnull + public static Builder builder() { + return new Builder(); + } + /** * Builder for {@link SearchIdle}. */ - - public static class Builder extends ObjectBuilderBase implements ObjectBuilder { + public static class Builder extends ObjectBuilderBase implements CopyableBuilder { @Nullable private Time after; + public Builder() {} + + private Builder(SearchIdle o) { + this.after = o.after; + } + + private Builder(Builder o) { + this.after = o.after; + } + + @Override + @Nonnull + public Builder copy() { + return new Builder(this); + } + /** * API name: {@code after} */ + @Nonnull public final Builder after(@Nullable Time value) { this.after = value; return this; @@ -110,16 +146,18 @@ public final Builder after(@Nullable Time value) { /** * API name: {@code after} */ + @Nonnull public final Builder after(Function> fn) { - return this.after(fn.apply(new Time.Builder()).build()); + return after(fn.apply(new Time.Builder()).build()); } /** * Builds a {@link SearchIdle}. * - * @throws NullPointerException - * if some of the required fields are null. + * @throws NullPointerException if some of the required fields are null. */ + @Override + @Nonnull public SearchIdle build() { _checkSingleUse(); @@ -137,10 +175,22 @@ public SearchIdle build() { SearchIdle::setupSearchIdleDeserializer ); - protected static void setupSearchIdleDeserializer(ObjectDeserializer op) { - + protected static void setupSearchIdleDeserializer(ObjectDeserializer op) { op.add(Builder::after, Time._DESERIALIZER, "after"); + } + @Override + public int hashCode() { + int result = 17; + result = 31 * result + Objects.hashCode(this.after); + return result; } + @Override + public boolean equals(Object o) { + if (this == o) return true; + if (o == null || this.getClass() != o.getClass()) return false; + SearchIdle other = (SearchIdle) o; + return Objects.equals(this.after, other.after); + } } diff --git a/java-client/src/main/java/org/opensearch/client/opensearch/indices/SearchSlowlog.java b/java-client/src/generated/java/org/opensearch/client/opensearch/indices/SearchSlowlog.java similarity index 59% rename from java-client/src/main/java/org/opensearch/client/opensearch/indices/SearchSlowlog.java rename to java-client/src/generated/java/org/opensearch/client/opensearch/indices/SearchSlowlog.java index 7cc720ace6..443cd6ef0c 100644 --- a/java-client/src/main/java/org/opensearch/client/opensearch/indices/SearchSlowlog.java +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/indices/SearchSlowlog.java @@ -30,10 +30,17 @@ * GitHub history for details. */ +//---------------------------------------------------- +// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. +//---------------------------------------------------- + package org.opensearch.client.opensearch.indices; import jakarta.json.stream.JsonGenerator; +import java.util.Objects; import java.util.function.Function; +import javax.annotation.Generated; +import javax.annotation.Nonnull; import javax.annotation.Nullable; import org.opensearch.client.json.JsonpDeserializable; import org.opensearch.client.json.JsonpDeserializer; @@ -41,27 +48,35 @@ import org.opensearch.client.json.ObjectBuilderDeserializer; import org.opensearch.client.json.ObjectDeserializer; import org.opensearch.client.json.PlainJsonSerializable; +import org.opensearch.client.util.CopyableBuilder; import org.opensearch.client.util.ObjectBuilder; import org.opensearch.client.util.ObjectBuilderBase; +import org.opensearch.client.util.ToCopyableBuilder; + +// typedef: indices.SearchSlowlog @JsonpDeserializable -public class SearchSlowlog implements PlainJsonSerializable { +@Generated("org.opensearch.client.codegen.CodeGenerator") +public class SearchSlowlog implements PlainJsonSerializable, ToCopyableBuilder { + @Nullable private final String level; + @Nullable + private final Boolean reformat; + @Nullable private final SearchSlowlogThresholds threshold; // --------------------------------------------------------------------------------------------- private SearchSlowlog(Builder builder) { - this.level = builder.level; + this.reformat = builder.reformat; this.threshold = builder.threshold; - } - public static SearchSlowlog of(Function> fn) { + public static SearchSlowlog of(Function> fn) { return fn.apply(new Builder()).build(); } @@ -73,6 +88,14 @@ public final String level() { return this.level; } + /** + * API name: {@code reformat} + */ + @Nullable + public final Boolean reformat() { + return this.reformat; + } + /** * API name: {@code threshold} */ @@ -84,6 +107,7 @@ public final SearchSlowlogThresholds threshold() { /** * Serialize this object to JSON. */ + @Override public void serialize(JsonGenerator generator, JsonpMapper mapper) { generator.writeStartObject(); serializeInternal(generator, mapper); @@ -91,45 +115,88 @@ public void serialize(JsonGenerator generator, JsonpMapper mapper) { } protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { - if (this.level != null) { generator.writeKey("level"); generator.write(this.level); + } + if (this.reformat != null) { + generator.writeKey("reformat"); + generator.write(this.reformat); } if (this.threshold != null) { generator.writeKey("threshold"); this.threshold.serialize(generator, mapper); - } - } // --------------------------------------------------------------------------------------------- + @Override + @Nonnull + public Builder toBuilder() { + return new Builder(this); + } + + @Nonnull + public static Builder builder() { + return new Builder(); + } + /** * Builder for {@link SearchSlowlog}. */ - - public static class Builder extends ObjectBuilderBase implements ObjectBuilder { + public static class Builder extends ObjectBuilderBase implements CopyableBuilder { @Nullable private String level; - + @Nullable + private Boolean reformat; @Nullable private SearchSlowlogThresholds threshold; + public Builder() {} + + private Builder(SearchSlowlog o) { + this.level = o.level; + this.reformat = o.reformat; + this.threshold = o.threshold; + } + + private Builder(Builder o) { + this.level = o.level; + this.reformat = o.reformat; + this.threshold = o.threshold; + } + + @Override + @Nonnull + public Builder copy() { + return new Builder(this); + } + /** * API name: {@code level} */ + @Nonnull public final Builder level(@Nullable String value) { this.level = value; return this; } + /** + * API name: {@code reformat} + */ + @Nonnull + public final Builder reformat(@Nullable Boolean value) { + this.reformat = value; + return this; + } + /** * API name: {@code threshold} */ + @Nonnull public final Builder threshold(@Nullable SearchSlowlogThresholds value) { this.threshold = value; return this; @@ -138,16 +205,18 @@ public final Builder threshold(@Nullable SearchSlowlogThresholds value) { /** * API name: {@code threshold} */ + @Nonnull public final Builder threshold(Function> fn) { - return this.threshold(fn.apply(new SearchSlowlogThresholds.Builder()).build()); + return threshold(fn.apply(new SearchSlowlogThresholds.Builder()).build()); } /** * Builds a {@link SearchSlowlog}. * - * @throws NullPointerException - * if some of the required fields are null. + * @throws NullPointerException if some of the required fields are null. */ + @Override + @Nonnull public SearchSlowlog build() { _checkSingleUse(); @@ -162,14 +231,31 @@ public SearchSlowlog build() { */ public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer.lazy( Builder::new, - SearchSlowlog::setupIndexingSlowlogSettingsDeserializer + SearchSlowlog::setupSearchSlowlogDeserializer ); - protected static void setupIndexingSlowlogSettingsDeserializer(ObjectDeserializer op) { - + protected static void setupSearchSlowlogDeserializer(ObjectDeserializer op) { op.add(Builder::level, JsonpDeserializer.stringDeserializer(), "level"); + op.add(Builder::reformat, JsonpDeserializer.booleanDeserializer(), "reformat"); op.add(Builder::threshold, SearchSlowlogThresholds._DESERIALIZER, "threshold"); + } + @Override + public int hashCode() { + int result = 17; + result = 31 * result + Objects.hashCode(this.level); + result = 31 * result + Objects.hashCode(this.reformat); + result = 31 * result + Objects.hashCode(this.threshold); + return result; } + @Override + public boolean equals(Object o) { + if (this == o) return true; + if (o == null || this.getClass() != o.getClass()) return false; + SearchSlowlog other = (SearchSlowlog) o; + return Objects.equals(this.level, other.level) + && Objects.equals(this.reformat, other.reformat) + && Objects.equals(this.threshold, other.threshold); + } } diff --git a/java-client/src/main/java/org/opensearch/client/opensearch/indices/SearchSlowlogThresholds.java b/java-client/src/generated/java/org/opensearch/client/opensearch/indices/SearchSlowlogThresholds.java similarity index 66% rename from java-client/src/main/java/org/opensearch/client/opensearch/indices/SearchSlowlogThresholds.java rename to java-client/src/generated/java/org/opensearch/client/opensearch/indices/SearchSlowlogThresholds.java index 2399ce4908..9ceb484d20 100644 --- a/java-client/src/main/java/org/opensearch/client/opensearch/indices/SearchSlowlogThresholds.java +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/indices/SearchSlowlogThresholds.java @@ -30,10 +30,17 @@ * GitHub history for details. */ +//---------------------------------------------------- +// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. +//---------------------------------------------------- + package org.opensearch.client.opensearch.indices; import jakarta.json.stream.JsonGenerator; +import java.util.Objects; import java.util.function.Function; +import javax.annotation.Generated; +import javax.annotation.Nonnull; import javax.annotation.Nullable; import org.opensearch.client.json.JsonpDeserializable; import org.opensearch.client.json.JsonpDeserializer; @@ -41,49 +48,57 @@ import org.opensearch.client.json.ObjectBuilderDeserializer; import org.opensearch.client.json.ObjectDeserializer; import org.opensearch.client.json.PlainJsonSerializable; +import org.opensearch.client.util.CopyableBuilder; import org.opensearch.client.util.ObjectBuilder; import org.opensearch.client.util.ObjectBuilderBase; +import org.opensearch.client.util.ToCopyableBuilder; + +// typedef: indices.SearchSlowlogThresholds @JsonpDeserializable -public class SearchSlowlogThresholds implements PlainJsonSerializable { - @Nullable - private final SlowlogThresholdLevels query; +@Generated("org.opensearch.client.codegen.CodeGenerator") +public class SearchSlowlogThresholds + implements + PlainJsonSerializable, + ToCopyableBuilder { @Nullable private final SlowlogThresholdLevels fetch; + @Nullable + private final SlowlogThresholdLevels query; + // --------------------------------------------------------------------------------------------- private SearchSlowlogThresholds(Builder builder) { - - this.query = builder.query; this.fetch = builder.fetch; - + this.query = builder.query; } - public static SearchSlowlogThresholds of(Function> fn) { + public static SearchSlowlogThresholds of(Function> fn) { return fn.apply(new Builder()).build(); } /** - * API name: {@code query} + * API name: {@code fetch} */ @Nullable - public final SlowlogThresholdLevels query() { - return this.query; + public final SlowlogThresholdLevels fetch() { + return this.fetch; } /** - * API name: {@code fetch} + * API name: {@code query} */ @Nullable - public final SlowlogThresholdLevels fetch() { - return this.fetch; + public final SlowlogThresholdLevels query() { + return this.query; } /** * Serialize this object to JSON. */ + @Override public void serialize(JsonGenerator generator, JsonpMapper mapper) { generator.writeStartObject(); serializeInternal(generator, mapper); @@ -91,51 +106,61 @@ public void serialize(JsonGenerator generator, JsonpMapper mapper) { } protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { + if (this.fetch != null) { + generator.writeKey("fetch"); + this.fetch.serialize(generator, mapper); + } if (this.query != null) { generator.writeKey("query"); this.query.serialize(generator, mapper); - } - if (this.fetch != null) { - generator.writeKey("fetch"); - this.fetch.serialize(generator, mapper); + } - } + // --------------------------------------------------------------------------------------------- + @Override + @Nonnull + public Builder toBuilder() { + return new Builder(this); } - // --------------------------------------------------------------------------------------------- + @Nonnull + public static Builder builder() { + return new Builder(); + } /** * Builder for {@link SearchSlowlogThresholds}. */ - - public static class Builder extends ObjectBuilderBase implements ObjectBuilder { + public static class Builder extends ObjectBuilderBase implements CopyableBuilder { + @Nullable + private SlowlogThresholdLevels fetch; @Nullable private SlowlogThresholdLevels query; - @Nullable - private SlowlogThresholdLevels fetch; + public Builder() {} - /** - * API name: {@code query} - */ - public final Builder query(@Nullable SlowlogThresholdLevels value) { - this.query = value; - return this; + private Builder(SearchSlowlogThresholds o) { + this.fetch = o.fetch; + this.query = o.query; } - /** - * API name: {@code query} - */ - public final Builder query(Function> fn) { - return this.query(fn.apply(new SlowlogThresholdLevels.Builder()).build()); + private Builder(Builder o) { + this.fetch = o.fetch; + this.query = o.query; + } + + @Override + @Nonnull + public Builder copy() { + return new Builder(this); } /** * API name: {@code fetch} */ + @Nonnull public final Builder fetch(@Nullable SlowlogThresholdLevels value) { this.fetch = value; return this; @@ -144,16 +169,35 @@ public final Builder fetch(@Nullable SlowlogThresholdLevels value) { /** * API name: {@code fetch} */ + @Nonnull public final Builder fetch(Function> fn) { - return this.fetch(fn.apply(new SlowlogThresholdLevels.Builder()).build()); + return fetch(fn.apply(new SlowlogThresholdLevels.Builder()).build()); + } + + /** + * API name: {@code query} + */ + @Nonnull + public final Builder query(@Nullable SlowlogThresholdLevels value) { + this.query = value; + return this; + } + + /** + * API name: {@code query} + */ + @Nonnull + public final Builder query(Function> fn) { + return query(fn.apply(new SlowlogThresholdLevels.Builder()).build()); } /** * Builds a {@link SearchSlowlogThresholds}. * - * @throws NullPointerException - * if some of the required fields are null. + * @throws NullPointerException if some of the required fields are null. */ + @Override + @Nonnull public SearchSlowlogThresholds build() { _checkSingleUse(); @@ -168,14 +212,27 @@ public SearchSlowlogThresholds build() { */ public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer.lazy( Builder::new, - SearchSlowlogThresholds::setupIndexingSlowlogTresholdsDeserializer + SearchSlowlogThresholds::setupSearchSlowlogThresholdsDeserializer ); - protected static void setupIndexingSlowlogTresholdsDeserializer(ObjectDeserializer op) { - - op.add(Builder::query, SlowlogThresholdLevels._DESERIALIZER, "query"); + protected static void setupSearchSlowlogThresholdsDeserializer(ObjectDeserializer op) { op.add(Builder::fetch, SlowlogThresholdLevels._DESERIALIZER, "fetch"); + op.add(Builder::query, SlowlogThresholdLevels._DESERIALIZER, "query"); + } + @Override + public int hashCode() { + int result = 17; + result = 31 * result + Objects.hashCode(this.fetch); + result = 31 * result + Objects.hashCode(this.query); + return result; } + @Override + public boolean equals(Object o) { + if (this == o) return true; + if (o == null || this.getClass() != o.getClass()) return false; + SearchSlowlogThresholds other = (SearchSlowlogThresholds) o; + return Objects.equals(this.fetch, other.fetch) && Objects.equals(this.query, other.query); + } } diff --git a/java-client/src/main/java/org/opensearch/client/opensearch/indices/SegmentSortMissing.java b/java-client/src/generated/java/org/opensearch/client/opensearch/indices/SegmentSortMissing.java similarity index 84% rename from java-client/src/main/java/org/opensearch/client/opensearch/indices/SegmentSortMissing.java rename to java-client/src/generated/java/org/opensearch/client/opensearch/indices/SegmentSortMissing.java index f429e2d273..2da985c6c3 100644 --- a/java-client/src/main/java/org/opensearch/client/opensearch/indices/SegmentSortMissing.java +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/indices/SegmentSortMissing.java @@ -30,18 +30,24 @@ * GitHub history for details. */ +//---------------------------------------------------- +// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. +//---------------------------------------------------- + package org.opensearch.client.opensearch.indices; +import javax.annotation.Generated; import org.opensearch.client.json.JsonEnum; import org.opensearch.client.json.JsonpDeserializable; +// typedef: indices.SegmentSortMissing + @JsonpDeserializable +@Generated("org.opensearch.client.codegen.CodeGenerator") public enum SegmentSortMissing implements JsonEnum { - Last("_last"), - First("_first"), - ; + Last("_last"); private final String jsonValue; diff --git a/java-client/src/main/java/org/opensearch/client/opensearch/indices/SegmentSortMode.java b/java-client/src/generated/java/org/opensearch/client/opensearch/indices/SegmentSortMode.java similarity index 84% rename from java-client/src/main/java/org/opensearch/client/opensearch/indices/SegmentSortMode.java rename to java-client/src/generated/java/org/opensearch/client/opensearch/indices/SegmentSortMode.java index 350de9369f..dd56a226ec 100644 --- a/java-client/src/main/java/org/opensearch/client/opensearch/indices/SegmentSortMode.java +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/indices/SegmentSortMode.java @@ -30,18 +30,24 @@ * GitHub history for details. */ +//---------------------------------------------------- +// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. +//---------------------------------------------------- + package org.opensearch.client.opensearch.indices; +import javax.annotation.Generated; import org.opensearch.client.json.JsonEnum; import org.opensearch.client.json.JsonpDeserializable; +// typedef: indices.SegmentSortMode + @JsonpDeserializable +@Generated("org.opensearch.client.codegen.CodeGenerator") public enum SegmentSortMode implements JsonEnum { - Min("min"), - Max("max"), - ; + Min("min"); private final String jsonValue; diff --git a/java-client/src/main/java/org/opensearch/client/opensearch/indices/SegmentSortOrder.java b/java-client/src/generated/java/org/opensearch/client/opensearch/indices/SegmentSortOrder.java similarity index 84% rename from java-client/src/main/java/org/opensearch/client/opensearch/indices/SegmentSortOrder.java rename to java-client/src/generated/java/org/opensearch/client/opensearch/indices/SegmentSortOrder.java index fc74f723a1..2a43db0e24 100644 --- a/java-client/src/main/java/org/opensearch/client/opensearch/indices/SegmentSortOrder.java +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/indices/SegmentSortOrder.java @@ -30,18 +30,24 @@ * GitHub history for details. */ +//---------------------------------------------------- +// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. +//---------------------------------------------------- + package org.opensearch.client.opensearch.indices; +import javax.annotation.Generated; import org.opensearch.client.json.JsonEnum; import org.opensearch.client.json.JsonpDeserializable; +// typedef: indices.SegmentSortOrder + @JsonpDeserializable +@Generated("org.opensearch.client.codegen.CodeGenerator") public enum SegmentSortOrder implements JsonEnum { Asc("asc"), - Desc("desc"), - - ; + Desc("desc"); private final String jsonValue; diff --git a/java-client/src/main/java/org/opensearch/client/opensearch/indices/SlowlogThresholdLevels.java b/java-client/src/generated/java/org/opensearch/client/opensearch/indices/SlowlogThresholdLevels.java similarity index 67% rename from java-client/src/main/java/org/opensearch/client/opensearch/indices/SlowlogThresholdLevels.java rename to java-client/src/generated/java/org/opensearch/client/opensearch/indices/SlowlogThresholdLevels.java index ec7d322f35..304f0e9180 100644 --- a/java-client/src/main/java/org/opensearch/client/opensearch/indices/SlowlogThresholdLevels.java +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/indices/SlowlogThresholdLevels.java @@ -30,10 +30,17 @@ * GitHub history for details. */ +//---------------------------------------------------- +// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. +//---------------------------------------------------- + package org.opensearch.client.opensearch.indices; import jakarta.json.stream.JsonGenerator; +import java.util.Objects; import java.util.function.Function; +import javax.annotation.Generated; +import javax.annotation.Nonnull; import javax.annotation.Nullable; import org.opensearch.client.json.JsonpDeserializable; import org.opensearch.client.json.JsonpDeserializer; @@ -42,46 +49,51 @@ import org.opensearch.client.json.ObjectDeserializer; import org.opensearch.client.json.PlainJsonSerializable; import org.opensearch.client.opensearch._types.Time; +import org.opensearch.client.util.CopyableBuilder; import org.opensearch.client.util.ObjectBuilder; import org.opensearch.client.util.ObjectBuilderBase; +import org.opensearch.client.util.ToCopyableBuilder; -// typedef: indices._types.SlowlogTresholdLevels +// typedef: indices.SlowlogThresholdLevels @JsonpDeserializable -public class SlowlogThresholdLevels implements PlainJsonSerializable { +@Generated("org.opensearch.client.codegen.CodeGenerator") +public class SlowlogThresholdLevels + implements + PlainJsonSerializable, + ToCopyableBuilder { + @Nullable - private final Time warn; + private final Time debug; @Nullable private final Time info; @Nullable - private final Time debug; + private final Time trace; @Nullable - private final Time trace; + private final Time warn; // --------------------------------------------------------------------------------------------- private SlowlogThresholdLevels(Builder builder) { - - this.warn = builder.warn; - this.info = builder.info; this.debug = builder.debug; + this.info = builder.info; this.trace = builder.trace; - + this.warn = builder.warn; } - public static SlowlogThresholdLevels of(Function> fn) { + public static SlowlogThresholdLevels of(Function> fn) { return fn.apply(new Builder()).build(); } /** - * API name: {@code warn} + * API name: {@code debug} */ @Nullable - public final Time warn() { - return this.warn; + public final Time debug() { + return this.debug; } /** @@ -93,24 +105,25 @@ public final Time info() { } /** - * API name: {@code debug} + * API name: {@code trace} */ @Nullable - public final Time debug() { - return this.debug; + public final Time trace() { + return this.trace; } /** - * API name: {@code trace} + * API name: {@code warn} */ @Nullable - public final Time trace() { - return this.trace; + public final Time warn() { + return this.warn; } /** * Serialize this object to JSON. */ + @Override public void serialize(JsonGenerator generator, JsonpMapper mapper) { generator.writeStartObject(); serializeInternal(generator, mapper); @@ -118,66 +131,96 @@ public void serialize(JsonGenerator generator, JsonpMapper mapper) { } protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { - - if (this.warn != null) { - generator.writeKey("warn"); - this.warn.serialize(generator, mapper); - + if (this.debug != null) { + generator.writeKey("debug"); + this.debug.serialize(generator, mapper); } + if (this.info != null) { generator.writeKey("info"); this.info.serialize(generator, mapper); - } - if (this.debug != null) { - generator.writeKey("debug"); - this.debug.serialize(generator, mapper); - } if (this.trace != null) { generator.writeKey("trace"); this.trace.serialize(generator, mapper); - } + if (this.warn != null) { + generator.writeKey("warn"); + this.warn.serialize(generator, mapper); + } } // --------------------------------------------------------------------------------------------- + @Override + @Nonnull + public Builder toBuilder() { + return new Builder(this); + } + + @Nonnull + public static Builder builder() { + return new Builder(); + } + /** * Builder for {@link SlowlogThresholdLevels}. */ - public static class Builder extends ObjectBuilderBase implements ObjectBuilder { + public static class Builder extends ObjectBuilderBase implements CopyableBuilder { @Nullable - private Time warn; - + private Time debug; @Nullable private Time info; - - @Nullable - private Time debug; - @Nullable private Time trace; + @Nullable + private Time warn; + + public Builder() {} + + private Builder(SlowlogThresholdLevels o) { + this.debug = o.debug; + this.info = o.info; + this.trace = o.trace; + this.warn = o.warn; + } + + private Builder(Builder o) { + this.debug = o.debug; + this.info = o.info; + this.trace = o.trace; + this.warn = o.warn; + } + + @Override + @Nonnull + public Builder copy() { + return new Builder(this); + } /** - * API name: {@code warn} + * API name: {@code debug} */ - public final Builder warn(@Nullable Time value) { - this.warn = value; + @Nonnull + public final Builder debug(@Nullable Time value) { + this.debug = value; return this; } /** - * API name: {@code warn} + * API name: {@code debug} */ - public final Builder warn(Function> fn) { - return this.warn(fn.apply(new Time.Builder()).build()); + @Nonnull + public final Builder debug(Function> fn) { + return debug(fn.apply(new Time.Builder()).build()); } /** * API name: {@code info} */ + @Nonnull public final Builder info(@Nullable Time value) { this.info = value; return this; @@ -186,46 +229,52 @@ public final Builder info(@Nullable Time value) { /** * API name: {@code info} */ + @Nonnull public final Builder info(Function> fn) { - return this.info(fn.apply(new Time.Builder()).build()); + return info(fn.apply(new Time.Builder()).build()); } /** - * API name: {@code debug} + * API name: {@code trace} */ - public final Builder debug(@Nullable Time value) { - this.debug = value; + @Nonnull + public final Builder trace(@Nullable Time value) { + this.trace = value; return this; } /** - * API name: {@code debug} + * API name: {@code trace} */ - public final Builder debug(Function> fn) { - return this.debug(fn.apply(new Time.Builder()).build()); + @Nonnull + public final Builder trace(Function> fn) { + return trace(fn.apply(new Time.Builder()).build()); } /** - * API name: {@code trace} + * API name: {@code warn} */ - public final Builder trace(@Nullable Time value) { - this.trace = value; + @Nonnull + public final Builder warn(@Nullable Time value) { + this.warn = value; return this; } /** - * API name: {@code trace} + * API name: {@code warn} */ - public final Builder trace(Function> fn) { - return this.trace(fn.apply(new Time.Builder()).build()); + @Nonnull + public final Builder warn(Function> fn) { + return warn(fn.apply(new Time.Builder()).build()); } /** * Builds a {@link SlowlogThresholdLevels}. * - * @throws NullPointerException - * if some of the required fields are null. + * @throws NullPointerException if some of the required fields are null. */ + @Override + @Nonnull public SlowlogThresholdLevels build() { _checkSingleUse(); @@ -240,16 +289,34 @@ public SlowlogThresholdLevels build() { */ public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer.lazy( Builder::new, - SlowlogThresholdLevels::setupSlowlogTresholdLevelsDeserializer + SlowlogThresholdLevels::setupSlowlogThresholdLevelsDeserializer ); - protected static void setupSlowlogTresholdLevelsDeserializer(ObjectDeserializer op) { - - op.add(Builder::warn, Time._DESERIALIZER, "warn"); - op.add(Builder::info, Time._DESERIALIZER, "info"); + protected static void setupSlowlogThresholdLevelsDeserializer(ObjectDeserializer op) { op.add(Builder::debug, Time._DESERIALIZER, "debug"); + op.add(Builder::info, Time._DESERIALIZER, "info"); op.add(Builder::trace, Time._DESERIALIZER, "trace"); + op.add(Builder::warn, Time._DESERIALIZER, "warn"); + } + @Override + public int hashCode() { + int result = 17; + result = 31 * result + Objects.hashCode(this.debug); + result = 31 * result + Objects.hashCode(this.info); + result = 31 * result + Objects.hashCode(this.trace); + result = 31 * result + Objects.hashCode(this.warn); + return result; } + @Override + public boolean equals(Object o) { + if (this == o) return true; + if (o == null || this.getClass() != o.getClass()) return false; + SlowlogThresholdLevels other = (SlowlogThresholdLevels) o; + return Objects.equals(this.debug, other.debug) + && Objects.equals(this.info, other.info) + && Objects.equals(this.trace, other.trace) + && Objects.equals(this.warn, other.warn); + } } diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/indices/SoftDeletes.java b/java-client/src/generated/java/org/opensearch/client/opensearch/indices/SoftDeletes.java new file mode 100644 index 0000000000..cfc93c0e1d --- /dev/null +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/indices/SoftDeletes.java @@ -0,0 +1,275 @@ +/* + * SPDX-License-Identifier: Apache-2.0 + * + * The OpenSearch Contributors require contributions made to + * this file be licensed under the Apache-2.0 license or a + * compatible open source license. + */ + +/* + * 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. + */ + +/* + * Modifications Copyright OpenSearch Contributors. See + * GitHub history for details. + */ + +//---------------------------------------------------- +// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. +//---------------------------------------------------- + +package org.opensearch.client.opensearch.indices; + +import jakarta.json.stream.JsonGenerator; +import java.util.Objects; +import java.util.function.Function; +import javax.annotation.Generated; +import javax.annotation.Nonnull; +import javax.annotation.Nullable; +import org.opensearch.client.json.JsonpDeserializable; +import org.opensearch.client.json.JsonpDeserializer; +import org.opensearch.client.json.JsonpMapper; +import org.opensearch.client.json.ObjectBuilderDeserializer; +import org.opensearch.client.json.ObjectDeserializer; +import org.opensearch.client.json.PlainJsonSerializable; +import org.opensearch.client.util.CopyableBuilder; +import org.opensearch.client.util.ObjectBuilder; +import org.opensearch.client.util.ObjectBuilderBase; +import org.opensearch.client.util.ToCopyableBuilder; + +// typedef: indices.SoftDeletes + +@JsonpDeserializable +@Generated("org.opensearch.client.codegen.CodeGenerator") +public class SoftDeletes implements PlainJsonSerializable, ToCopyableBuilder { + + @Nullable + private final Boolean enabled; + + @Nullable + private final SoftDeletesRetention retention; + + @Nullable + private final RetentionLease retentionLease; + + // --------------------------------------------------------------------------------------------- + + private SoftDeletes(Builder builder) { + this.enabled = builder.enabled; + this.retention = builder.retention; + this.retentionLease = builder.retentionLease; + } + + public static SoftDeletes of(Function> fn) { + return fn.apply(new Builder()).build(); + } + + /** + * Indicates whether soft deletes are enabled on the index. + *

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

+ */ + @Nullable + public final Boolean enabled() { + return this.enabled; + } + + /** + * API name: {@code retention} + */ + @Nullable + public final SoftDeletesRetention retention() { + return this.retention; + } + + /** + * API name: {@code retention_lease} + */ + @Nullable + public final RetentionLease retentionLease() { + return this.retentionLease; + } + + /** + * Serialize this object to JSON. + */ + @Override + public void serialize(JsonGenerator generator, JsonpMapper mapper) { + generator.writeStartObject(); + serializeInternal(generator, mapper); + generator.writeEnd(); + } + + protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { + if (this.enabled != null) { + generator.writeKey("enabled"); + generator.write(this.enabled); + } + + if (this.retention != null) { + generator.writeKey("retention"); + this.retention.serialize(generator, mapper); + } + + if (this.retentionLease != null) { + generator.writeKey("retention_lease"); + this.retentionLease.serialize(generator, mapper); + } + } + + // --------------------------------------------------------------------------------------------- + + @Override + @Nonnull + public Builder toBuilder() { + return new Builder(this); + } + + @Nonnull + public static Builder builder() { + return new Builder(); + } + + /** + * Builder for {@link SoftDeletes}. + */ + public static class Builder extends ObjectBuilderBase implements CopyableBuilder { + @Nullable + private Boolean enabled; + @Nullable + private SoftDeletesRetention retention; + @Nullable + private RetentionLease retentionLease; + + public Builder() {} + + private Builder(SoftDeletes o) { + this.enabled = o.enabled; + this.retention = o.retention; + this.retentionLease = o.retentionLease; + } + + private Builder(Builder o) { + this.enabled = o.enabled; + this.retention = o.retention; + this.retentionLease = o.retentionLease; + } + + @Override + @Nonnull + public Builder copy() { + return new Builder(this); + } + + /** + * Indicates whether soft deletes are enabled on the index. + *

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

+ */ + @Nonnull + public final Builder enabled(@Nullable Boolean value) { + this.enabled = value; + return this; + } + + /** + * API name: {@code retention} + */ + @Nonnull + public final Builder retention(@Nullable SoftDeletesRetention value) { + this.retention = value; + return this; + } + + /** + * API name: {@code retention} + */ + @Nonnull + public final Builder retention(Function> fn) { + return retention(fn.apply(new SoftDeletesRetention.Builder()).build()); + } + + /** + * API name: {@code retention_lease} + */ + @Nonnull + public final Builder retentionLease(@Nullable RetentionLease value) { + this.retentionLease = value; + return this; + } + + /** + * API name: {@code retention_lease} + */ + @Nonnull + public final Builder retentionLease(Function> fn) { + return retentionLease(fn.apply(new RetentionLease.Builder()).build()); + } + + /** + * Builds a {@link SoftDeletes}. + * + * @throws NullPointerException if some of the required fields are null. + */ + @Override + @Nonnull + public SoftDeletes build() { + _checkSingleUse(); + + return new SoftDeletes(this); + } + } + + // --------------------------------------------------------------------------------------------- + + /** + * Json deserializer for {@link SoftDeletes} + */ + public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer.lazy( + Builder::new, + SoftDeletes::setupSoftDeletesDeserializer + ); + + protected static void setupSoftDeletesDeserializer(ObjectDeserializer op) { + op.add(Builder::enabled, JsonpDeserializer.booleanDeserializer(), "enabled"); + op.add(Builder::retention, SoftDeletesRetention._DESERIALIZER, "retention"); + op.add(Builder::retentionLease, RetentionLease._DESERIALIZER, "retention_lease"); + } + + @Override + public int hashCode() { + int result = 17; + result = 31 * result + Objects.hashCode(this.enabled); + result = 31 * result + Objects.hashCode(this.retention); + result = 31 * result + Objects.hashCode(this.retentionLease); + return result; + } + + @Override + public boolean equals(Object o) { + if (this == o) return true; + if (o == null || this.getClass() != o.getClass()) return false; + SoftDeletes other = (SoftDeletes) o; + return Objects.equals(this.enabled, other.enabled) + && Objects.equals(this.retention, other.retention) + && Objects.equals(this.retentionLease, other.retentionLease); + } +} diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/indices/SoftDeletesRetention.java b/java-client/src/generated/java/org/opensearch/client/opensearch/indices/SoftDeletesRetention.java new file mode 100644 index 0000000000..12420b1ba5 --- /dev/null +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/indices/SoftDeletesRetention.java @@ -0,0 +1,187 @@ +/* + * SPDX-License-Identifier: Apache-2.0 + * + * The OpenSearch Contributors require contributions made to + * this file be licensed under the Apache-2.0 license or a + * compatible open source license. + */ + +/* + * 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. + */ + +/* + * Modifications Copyright OpenSearch Contributors. See + * GitHub history for details. + */ + +//---------------------------------------------------- +// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. +//---------------------------------------------------- + +package org.opensearch.client.opensearch.indices; + +import jakarta.json.stream.JsonGenerator; +import java.util.Objects; +import java.util.function.Function; +import javax.annotation.Generated; +import javax.annotation.Nonnull; +import javax.annotation.Nullable; +import org.opensearch.client.json.JsonpDeserializable; +import org.opensearch.client.json.JsonpDeserializer; +import org.opensearch.client.json.JsonpMapper; +import org.opensearch.client.json.ObjectBuilderDeserializer; +import org.opensearch.client.json.ObjectDeserializer; +import org.opensearch.client.json.PlainJsonSerializable; +import org.opensearch.client.util.CopyableBuilder; +import org.opensearch.client.util.ObjectBuilder; +import org.opensearch.client.util.ObjectBuilderBase; +import org.opensearch.client.util.ToCopyableBuilder; + +// typedef: indices.SoftDeletesRetention + +@JsonpDeserializable +@Generated("org.opensearch.client.codegen.CodeGenerator") +public class SoftDeletesRetention implements PlainJsonSerializable, ToCopyableBuilder { + + @Nullable + private final Long operations; + + // --------------------------------------------------------------------------------------------- + + private SoftDeletesRetention(Builder builder) { + this.operations = builder.operations; + } + + public static SoftDeletesRetention of(Function> fn) { + return fn.apply(new Builder()).build(); + } + + /** + * API name: {@code operations} + */ + @Nullable + public final Long operations() { + return this.operations; + } + + /** + * Serialize this object to JSON. + */ + @Override + public void serialize(JsonGenerator generator, JsonpMapper mapper) { + generator.writeStartObject(); + serializeInternal(generator, mapper); + generator.writeEnd(); + } + + protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { + if (this.operations != null) { + generator.writeKey("operations"); + generator.write(this.operations); + } + } + + // --------------------------------------------------------------------------------------------- + + @Override + @Nonnull + public Builder toBuilder() { + return new Builder(this); + } + + @Nonnull + public static Builder builder() { + return new Builder(); + } + + /** + * Builder for {@link SoftDeletesRetention}. + */ + public static class Builder extends ObjectBuilderBase implements CopyableBuilder { + @Nullable + private Long operations; + + public Builder() {} + + private Builder(SoftDeletesRetention o) { + this.operations = o.operations; + } + + private Builder(Builder o) { + this.operations = o.operations; + } + + @Override + @Nonnull + public Builder copy() { + return new Builder(this); + } + + /** + * API name: {@code operations} + */ + @Nonnull + public final Builder operations(@Nullable Long value) { + this.operations = value; + return this; + } + + /** + * Builds a {@link SoftDeletesRetention}. + * + * @throws NullPointerException if some of the required fields are null. + */ + @Override + @Nonnull + public SoftDeletesRetention build() { + _checkSingleUse(); + + return new SoftDeletesRetention(this); + } + } + + // --------------------------------------------------------------------------------------------- + + /** + * Json deserializer for {@link SoftDeletesRetention} + */ + public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer.lazy( + Builder::new, + SoftDeletesRetention::setupSoftDeletesRetentionDeserializer + ); + + protected static void setupSoftDeletesRetentionDeserializer(ObjectDeserializer op) { + op.add(Builder::operations, JsonpDeserializer.longDeserializer(), "operations"); + } + + @Override + public int hashCode() { + int result = 17; + result = 31 * result + Objects.hashCode(this.operations); + return result; + } + + @Override + public boolean equals(Object o) { + if (this == o) return true; + if (o == null || this.getClass() != o.getClass()) return false; + SoftDeletesRetention other = (SoftDeletesRetention) o; + return Objects.equals(this.operations, other.operations); + } +} diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/indices/Translog.java b/java-client/src/generated/java/org/opensearch/client/opensearch/indices/Translog.java new file mode 100644 index 0000000000..ffa43fc0c4 --- /dev/null +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/indices/Translog.java @@ -0,0 +1,336 @@ +/* + * SPDX-License-Identifier: Apache-2.0 + * + * The OpenSearch Contributors require contributions made to + * this file be licensed under the Apache-2.0 license or a + * compatible open source license. + */ + +/* + * 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. + */ + +/* + * Modifications Copyright OpenSearch Contributors. See + * GitHub history for details. + */ + +//---------------------------------------------------- +// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. +//---------------------------------------------------- + +package org.opensearch.client.opensearch.indices; + +import jakarta.json.stream.JsonGenerator; +import java.util.Objects; +import java.util.function.Function; +import javax.annotation.Generated; +import javax.annotation.Nonnull; +import javax.annotation.Nullable; +import org.opensearch.client.json.JsonpDeserializable; +import org.opensearch.client.json.JsonpDeserializer; +import org.opensearch.client.json.JsonpMapper; +import org.opensearch.client.json.ObjectBuilderDeserializer; +import org.opensearch.client.json.ObjectDeserializer; +import org.opensearch.client.json.PlainJsonSerializable; +import org.opensearch.client.opensearch._types.Time; +import org.opensearch.client.util.CopyableBuilder; +import org.opensearch.client.util.ObjectBuilder; +import org.opensearch.client.util.ObjectBuilderBase; +import org.opensearch.client.util.ToCopyableBuilder; + +// typedef: indices.Translog + +@JsonpDeserializable +@Generated("org.opensearch.client.codegen.CodeGenerator") +public class Translog implements PlainJsonSerializable, ToCopyableBuilder { + + @Nullable + private final TranslogDurability durability; + + @Nullable + private final String flushThresholdSize; + + @Nullable + private final String generationThresholdSize; + + @Nullable + private final TranslogRetention retention; + + @Nullable + private final Time syncInterval; + + // --------------------------------------------------------------------------------------------- + + private Translog(Builder builder) { + this.durability = builder.durability; + this.flushThresholdSize = builder.flushThresholdSize; + this.generationThresholdSize = builder.generationThresholdSize; + this.retention = builder.retention; + this.syncInterval = builder.syncInterval; + } + + public static Translog of(Function> fn) { + return fn.apply(new Builder()).build(); + } + + /** + * API name: {@code durability} + */ + @Nullable + public final TranslogDurability durability() { + return this.durability; + } + + /** + * API name: {@code flush_threshold_size} + */ + @Nullable + public final String flushThresholdSize() { + return this.flushThresholdSize; + } + + /** + * API name: {@code generation_threshold_size} + */ + @Nullable + public final String generationThresholdSize() { + return this.generationThresholdSize; + } + + /** + * API name: {@code retention} + */ + @Nullable + public final TranslogRetention retention() { + return this.retention; + } + + /** + * API name: {@code sync_interval} + */ + @Nullable + public final Time syncInterval() { + return this.syncInterval; + } + + /** + * Serialize this object to JSON. + */ + @Override + public void serialize(JsonGenerator generator, JsonpMapper mapper) { + generator.writeStartObject(); + serializeInternal(generator, mapper); + generator.writeEnd(); + } + + protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { + if (this.durability != null) { + generator.writeKey("durability"); + this.durability.serialize(generator, mapper); + } + + if (this.flushThresholdSize != null) { + generator.writeKey("flush_threshold_size"); + generator.write(this.flushThresholdSize); + } + + if (this.generationThresholdSize != null) { + generator.writeKey("generation_threshold_size"); + generator.write(this.generationThresholdSize); + } + + if (this.retention != null) { + generator.writeKey("retention"); + this.retention.serialize(generator, mapper); + } + + if (this.syncInterval != null) { + generator.writeKey("sync_interval"); + this.syncInterval.serialize(generator, mapper); + } + } + + // --------------------------------------------------------------------------------------------- + + @Override + @Nonnull + public Builder toBuilder() { + return new Builder(this); + } + + @Nonnull + public static Builder builder() { + return new Builder(); + } + + /** + * Builder for {@link Translog}. + */ + public static class Builder extends ObjectBuilderBase implements CopyableBuilder { + @Nullable + private TranslogDurability durability; + @Nullable + private String flushThresholdSize; + @Nullable + private String generationThresholdSize; + @Nullable + private TranslogRetention retention; + @Nullable + private Time syncInterval; + + public Builder() {} + + private Builder(Translog o) { + this.durability = o.durability; + this.flushThresholdSize = o.flushThresholdSize; + this.generationThresholdSize = o.generationThresholdSize; + this.retention = o.retention; + this.syncInterval = o.syncInterval; + } + + private Builder(Builder o) { + this.durability = o.durability; + this.flushThresholdSize = o.flushThresholdSize; + this.generationThresholdSize = o.generationThresholdSize; + this.retention = o.retention; + this.syncInterval = o.syncInterval; + } + + @Override + @Nonnull + public Builder copy() { + return new Builder(this); + } + + /** + * API name: {@code durability} + */ + @Nonnull + public final Builder durability(@Nullable TranslogDurability value) { + this.durability = value; + return this; + } + + /** + * API name: {@code flush_threshold_size} + */ + @Nonnull + public final Builder flushThresholdSize(@Nullable String value) { + this.flushThresholdSize = value; + return this; + } + + /** + * API name: {@code generation_threshold_size} + */ + @Nonnull + public final Builder generationThresholdSize(@Nullable String value) { + this.generationThresholdSize = value; + return this; + } + + /** + * API name: {@code retention} + */ + @Nonnull + public final Builder retention(@Nullable TranslogRetention value) { + this.retention = value; + return this; + } + + /** + * API name: {@code retention} + */ + @Nonnull + public final Builder retention(Function> fn) { + return retention(fn.apply(new TranslogRetention.Builder()).build()); + } + + /** + * API name: {@code sync_interval} + */ + @Nonnull + public final Builder syncInterval(@Nullable Time value) { + this.syncInterval = value; + return this; + } + + /** + * API name: {@code sync_interval} + */ + @Nonnull + public final Builder syncInterval(Function> fn) { + return syncInterval(fn.apply(new Time.Builder()).build()); + } + + /** + * Builds a {@link Translog}. + * + * @throws NullPointerException if some of the required fields are null. + */ + @Override + @Nonnull + public Translog build() { + _checkSingleUse(); + + return new Translog(this); + } + } + + // --------------------------------------------------------------------------------------------- + + /** + * Json deserializer for {@link Translog} + */ + public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer.lazy( + Builder::new, + Translog::setupTranslogDeserializer + ); + + protected static void setupTranslogDeserializer(ObjectDeserializer op) { + op.add(Builder::durability, TranslogDurability._DESERIALIZER, "durability"); + op.add(Builder::flushThresholdSize, JsonpDeserializer.stringDeserializer(), "flush_threshold_size"); + op.add(Builder::generationThresholdSize, JsonpDeserializer.stringDeserializer(), "generation_threshold_size"); + op.add(Builder::retention, TranslogRetention._DESERIALIZER, "retention"); + op.add(Builder::syncInterval, Time._DESERIALIZER, "sync_interval"); + } + + @Override + public int hashCode() { + int result = 17; + result = 31 * result + Objects.hashCode(this.durability); + result = 31 * result + Objects.hashCode(this.flushThresholdSize); + result = 31 * result + Objects.hashCode(this.generationThresholdSize); + result = 31 * result + Objects.hashCode(this.retention); + result = 31 * result + Objects.hashCode(this.syncInterval); + return result; + } + + @Override + public boolean equals(Object o) { + if (this == o) return true; + if (o == null || this.getClass() != o.getClass()) return false; + Translog other = (Translog) o; + return Objects.equals(this.durability, other.durability) + && Objects.equals(this.flushThresholdSize, other.flushThresholdSize) + && Objects.equals(this.generationThresholdSize, other.generationThresholdSize) + && Objects.equals(this.retention, other.retention) + && Objects.equals(this.syncInterval, other.syncInterval); + } +} diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/indices/TranslogDurability.java b/java-client/src/generated/java/org/opensearch/client/opensearch/indices/TranslogDurability.java new file mode 100644 index 0000000000..23ad8005ee --- /dev/null +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/indices/TranslogDurability.java @@ -0,0 +1,69 @@ +/* + * SPDX-License-Identifier: Apache-2.0 + * + * The OpenSearch Contributors require contributions made to + * this file be licensed under the Apache-2.0 license or a + * compatible open source license. + */ + +/* + * 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. + */ + +/* + * Modifications Copyright OpenSearch Contributors. See + * GitHub history for details. + */ + +//---------------------------------------------------- +// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. +//---------------------------------------------------- + +package org.opensearch.client.opensearch.indices; + +import javax.annotation.Generated; +import org.opensearch.client.json.JsonEnum; +import org.opensearch.client.json.JsonpDeserializable; + +// typedef: indices.TranslogDurability + +@JsonpDeserializable +@Generated("org.opensearch.client.codegen.CodeGenerator") +public enum TranslogDurability implements JsonEnum { + Async("ASYNC", "async"), + + Request("REQUEST", "request"); + + private final String jsonValue; + private final String[] aliases; + + TranslogDurability(String jsonValue, String... aliases) { + this.jsonValue = jsonValue; + this.aliases = aliases; + } + + public String jsonValue() { + return this.jsonValue; + } + + public String[] aliases() { + return this.aliases; + } + + public static final JsonEnum.Deserializer _DESERIALIZER = new JsonEnum.Deserializer<>(TranslogDurability.values()); +} diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/indices/TranslogRetention.java b/java-client/src/generated/java/org/opensearch/client/opensearch/indices/TranslogRetention.java new file mode 100644 index 0000000000..df7a72def9 --- /dev/null +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/indices/TranslogRetention.java @@ -0,0 +1,228 @@ +/* + * SPDX-License-Identifier: Apache-2.0 + * + * The OpenSearch Contributors require contributions made to + * this file be licensed under the Apache-2.0 license or a + * compatible open source license. + */ + +/* + * 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. + */ + +/* + * Modifications Copyright OpenSearch Contributors. See + * GitHub history for details. + */ + +//---------------------------------------------------- +// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. +//---------------------------------------------------- + +package org.opensearch.client.opensearch.indices; + +import jakarta.json.stream.JsonGenerator; +import java.util.Objects; +import java.util.function.Function; +import javax.annotation.Generated; +import javax.annotation.Nonnull; +import javax.annotation.Nullable; +import org.opensearch.client.json.JsonpDeserializable; +import org.opensearch.client.json.JsonpDeserializer; +import org.opensearch.client.json.JsonpMapper; +import org.opensearch.client.json.ObjectBuilderDeserializer; +import org.opensearch.client.json.ObjectDeserializer; +import org.opensearch.client.json.PlainJsonSerializable; +import org.opensearch.client.opensearch._types.Time; +import org.opensearch.client.util.CopyableBuilder; +import org.opensearch.client.util.ObjectBuilder; +import org.opensearch.client.util.ObjectBuilderBase; +import org.opensearch.client.util.ToCopyableBuilder; + +// typedef: indices.TranslogRetention + +@JsonpDeserializable +@Generated("org.opensearch.client.codegen.CodeGenerator") +public class TranslogRetention implements PlainJsonSerializable, ToCopyableBuilder { + + @Nullable + private final Time age; + + @Nullable + private final String size; + + // --------------------------------------------------------------------------------------------- + + private TranslogRetention(Builder builder) { + this.age = builder.age; + this.size = builder.size; + } + + public static TranslogRetention of(Function> fn) { + return fn.apply(new Builder()).build(); + } + + /** + * API name: {@code age} + */ + @Nullable + public final Time age() { + return this.age; + } + + /** + * API name: {@code size} + */ + @Nullable + public final String size() { + return this.size; + } + + /** + * Serialize this object to JSON. + */ + @Override + public void serialize(JsonGenerator generator, JsonpMapper mapper) { + generator.writeStartObject(); + serializeInternal(generator, mapper); + generator.writeEnd(); + } + + protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { + if (this.age != null) { + generator.writeKey("age"); + this.age.serialize(generator, mapper); + } + + if (this.size != null) { + generator.writeKey("size"); + generator.write(this.size); + } + } + + // --------------------------------------------------------------------------------------------- + + @Override + @Nonnull + public Builder toBuilder() { + return new Builder(this); + } + + @Nonnull + public static Builder builder() { + return new Builder(); + } + + /** + * Builder for {@link TranslogRetention}. + */ + public static class Builder extends ObjectBuilderBase implements CopyableBuilder { + @Nullable + private Time age; + @Nullable + private String size; + + public Builder() {} + + private Builder(TranslogRetention o) { + this.age = o.age; + this.size = o.size; + } + + private Builder(Builder o) { + this.age = o.age; + this.size = o.size; + } + + @Override + @Nonnull + public Builder copy() { + return new Builder(this); + } + + /** + * API name: {@code age} + */ + @Nonnull + public final Builder age(@Nullable Time value) { + this.age = value; + return this; + } + + /** + * API name: {@code age} + */ + @Nonnull + public final Builder age(Function> fn) { + return age(fn.apply(new Time.Builder()).build()); + } + + /** + * API name: {@code size} + */ + @Nonnull + public final Builder size(@Nullable String value) { + this.size = value; + return this; + } + + /** + * Builds a {@link TranslogRetention}. + * + * @throws NullPointerException if some of the required fields are null. + */ + @Override + @Nonnull + public TranslogRetention build() { + _checkSingleUse(); + + return new TranslogRetention(this); + } + } + + // --------------------------------------------------------------------------------------------- + + /** + * Json deserializer for {@link TranslogRetention} + */ + public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer.lazy( + Builder::new, + TranslogRetention::setupTranslogRetentionDeserializer + ); + + protected static void setupTranslogRetentionDeserializer(ObjectDeserializer op) { + op.add(Builder::age, Time._DESERIALIZER, "age"); + op.add(Builder::size, JsonpDeserializer.stringDeserializer(), "size"); + } + + @Override + public int hashCode() { + int result = 17; + result = 31 * result + Objects.hashCode(this.age); + result = 31 * result + Objects.hashCode(this.size); + return result; + } + + @Override + public boolean equals(Object o) { + if (this == o) return true; + if (o == null || this.getClass() != o.getClass()) return false; + TranslogRetention other = (TranslogRetention) o; + return Objects.equals(this.age, other.age) && Objects.equals(this.size, other.size); + } +} diff --git a/java-client/src/main/java/org/opensearch/client/opensearch/indices/IndexSettingsMapping.java b/java-client/src/main/java/org/opensearch/client/opensearch/indices/IndexSettingsMapping.java deleted file mode 100644 index 055d440d5e..0000000000 --- a/java-client/src/main/java/org/opensearch/client/opensearch/indices/IndexSettingsMapping.java +++ /dev/null @@ -1,260 +0,0 @@ -/* - * SPDX-License-Identifier: Apache-2.0 - * - * The OpenSearch Contributors require contributions made to - * this file be licensed under the Apache-2.0 license or a - * compatible open source license. - */ - -package org.opensearch.client.opensearch.indices; - -import jakarta.json.stream.JsonGenerator; -import java.util.function.Function; -import javax.annotation.Nullable; -import org.opensearch.client.json.JsonpDeserializable; -import org.opensearch.client.json.JsonpDeserializer; -import org.opensearch.client.json.JsonpMapper; -import org.opensearch.client.json.ObjectBuilderDeserializer; -import org.opensearch.client.json.ObjectDeserializer; -import org.opensearch.client.json.PlainJsonSerializable; -import org.opensearch.client.util.ObjectBuilder; -import org.opensearch.client.util.ObjectBuilderBase; - -@JsonpDeserializable -public class IndexSettingsMapping implements PlainJsonSerializable { - - @Nullable - private final IndexSettingsMappingLimit totalFields; - - @Nullable - private final IndexSettingsMappingLimit depth; - - @Nullable - private final IndexSettingsMappingLimit nestedFields; - - @Nullable - private final IndexSettingsMappingLimit nestedObjects; - - @Nullable - private final IndexSettingsMappingLimit fieldNameLength; - - private IndexSettingsMapping(Builder builder) { - - this.totalFields = builder.totalFields; - this.depth = builder.depth; - this.nestedFields = builder.nestedFields; - this.nestedObjects = builder.nestedObjects; - this.fieldNameLength = builder.fieldNameLength; - - } - - public static IndexSettingsMapping of(Function> fn) { - return fn.apply(new Builder()).build(); - } - - /** - * API name: {@code total_fields} - */ - @Nullable - public final IndexSettingsMappingLimit totalFields() { - return this.totalFields; - } - - /** - * API name: {@code depth} - */ - @Nullable - public final IndexSettingsMappingLimit depth() { - return this.depth; - } - - /** - * API name: {@code nested_fields} - */ - @Nullable - public final IndexSettingsMappingLimit nestedFields() { - return this.nestedFields; - } - - /** - * API name: {@code nested_objects} - */ - @Nullable - public final IndexSettingsMappingLimit nestedObjects() { - return this.nestedObjects; - } - - /** - * API name: {@code field_name_length} - */ - @Nullable - public final IndexSettingsMappingLimit fieldNameLength() { - return this.fieldNameLength; - } - - /** - * 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.totalFields != null) { - generator.writeKey("total_fields"); - this.totalFields.serialize(generator, mapper); - - } - if (this.depth != null) { - generator.writeKey("depth"); - this.depth.serialize(generator, mapper); - - } - if (this.nestedFields != null) { - generator.writeKey("nested_fields"); - this.nestedFields.serialize(generator, mapper); - - } - if (this.nestedObjects != null) { - generator.writeKey("nested_objects"); - this.nestedObjects.serialize(generator, mapper); - - } - if (this.fieldNameLength != null) { - generator.writeKey("field_name_length"); - this.fieldNameLength.serialize(generator, mapper); - - } - - } - - // --------------------------------------------------------------------------------------------- - - /** - * Builder for {@link IndexSettingsMapping}. - */ - public static class Builder extends ObjectBuilderBase implements ObjectBuilder { - @Nullable - private IndexSettingsMappingLimit totalFields; - - @Nullable - private IndexSettingsMappingLimit depth; - - @Nullable - private IndexSettingsMappingLimit nestedFields; - - @Nullable - private IndexSettingsMappingLimit nestedObjects; - - @Nullable - private IndexSettingsMappingLimit fieldNameLength; - - /** - * API name: {@code total_fields} - */ - public final Builder totalFields(@Nullable IndexSettingsMappingLimit value) { - this.totalFields = value; - return this; - } - - /** - * API name: {@code total_fields} - */ - public final Builder totalFields(Function> fn) { - return this.totalFields(fn.apply(new IndexSettingsMappingLimit.Builder()).build()); - } - - /** - * API name: {@code depth} - */ - public final Builder depth(@Nullable IndexSettingsMappingLimit value) { - this.depth = value; - return this; - } - - /** - * API name: {@code depth} - */ - public final Builder depth(Function> fn) { - return this.depth(fn.apply(new IndexSettingsMappingLimit.Builder()).build()); - } - - /** - * API name: {@code nested_fields} - */ - public final Builder nestedFields(@Nullable IndexSettingsMappingLimit value) { - this.nestedFields = value; - return this; - } - - /** - * API name: {@code nested_fields} - */ - public final Builder nestedFields(Function> fn) { - return this.nestedFields(fn.apply(new IndexSettingsMappingLimit.Builder()).build()); - } - - /** - * API name: {@code nested_objects} - */ - public final Builder nestedObjects(@Nullable IndexSettingsMappingLimit value) { - this.nestedObjects = value; - return this; - } - - /** - * API name: {@code nested_objects} - */ - public final Builder nestedObjects(Function> fn) { - return this.nestedObjects(fn.apply(new IndexSettingsMappingLimit.Builder()).build()); - } - - /** - * API name: {@code field_name_length} - */ - public final Builder fieldNameLength(@Nullable IndexSettingsMappingLimit value) { - this.fieldNameLength = value; - return this; - } - - /** - * API name: {@code field_name_length} - */ - public final Builder fieldNameLength(Function> fn) { - return this.fieldNameLength(fn.apply(new IndexSettingsMappingLimit.Builder()).build()); - } - - /** - * Builds a {@link IndexSettingsMapping}. - * - * @throws NullPointerException - * if some of the required fields are null. - */ - public IndexSettingsMapping build() { - _checkSingleUse(); - - return new IndexSettingsMapping(this); - } - } - - /** - * Json deserializer for {@link IndexSettingsMapping} - */ - public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer.lazy( - Builder::new, - IndexSettingsMapping::setupIndexSettingsDeserializer - ); - - protected static void setupIndexSettingsDeserializer(ObjectDeserializer op) { - - op.add(Builder::totalFields, IndexSettingsMappingLimit._DESERIALIZER, "total_fields"); - op.add(Builder::depth, IndexSettingsMappingLimit._DESERIALIZER, "depth"); - op.add(Builder::nestedFields, IndexSettingsMappingLimit._DESERIALIZER, "nested_fields"); - op.add(Builder::nestedObjects, IndexSettingsMappingLimit._DESERIALIZER, "nested_objects"); - op.add(Builder::fieldNameLength, IndexSettingsMappingLimit._DESERIALIZER, "field_name_length"); - - } - -} diff --git a/java-client/src/main/java/org/opensearch/client/opensearch/indices/IndexSettingsMappingLimit.java b/java-client/src/main/java/org/opensearch/client/opensearch/indices/IndexSettingsMappingLimit.java deleted file mode 100644 index ef45bf0aa3..0000000000 --- a/java-client/src/main/java/org/opensearch/client/opensearch/indices/IndexSettingsMappingLimit.java +++ /dev/null @@ -1,107 +0,0 @@ -/* - * SPDX-License-Identifier: Apache-2.0 - * - * The OpenSearch Contributors require contributions made to - * this file be licensed under the Apache-2.0 license or a - * compatible open source license. - */ - -package org.opensearch.client.opensearch.indices; - -import jakarta.json.stream.JsonGenerator; -import java.util.function.Function; -import javax.annotation.Nullable; -import org.opensearch.client.json.JsonpDeserializable; -import org.opensearch.client.json.JsonpDeserializer; -import org.opensearch.client.json.JsonpMapper; -import org.opensearch.client.json.ObjectBuilderDeserializer; -import org.opensearch.client.json.ObjectDeserializer; -import org.opensearch.client.json.PlainJsonSerializable; -import org.opensearch.client.util.ObjectBuilder; -import org.opensearch.client.util.ObjectBuilderBase; - -@JsonpDeserializable -public class IndexSettingsMappingLimit implements PlainJsonSerializable { - - @Nullable - private final Long limit; - - private IndexSettingsMappingLimit(Builder builder) { - - this.limit = builder.limit; - - } - - public static IndexSettingsMappingLimit of(Function> fn) { - return fn.apply(new Builder()).build(); - } - - /** - * API name: {@code limit} - */ - @Nullable - public final Long limit() { - return this.limit; - } - - /** - * Serialize this object to JSON. - */ - public void serialize(JsonGenerator generator, JsonpMapper mapper) { - generator.writeStartObject(); - serializeInternal(generator); - generator.writeEnd(); - } - - protected void serializeInternal(JsonGenerator generator) { - - if (this.limit != null) { - generator.writeKey("limit"); - generator.write(this.limit); - } - - } - - /** - * Builder for {@link IndexSettingsMappingLimit}. - */ - public static class Builder extends ObjectBuilderBase implements ObjectBuilder { - @Nullable - private Long limit; - - /** - * API name: {@code limit} - */ - public final Builder limit(@Nullable Long value) { - this.limit = value; - return this; - } - - /** - * Builds a {@link IndexSettingsMappingLimit}. - * - * @throws NullPointerException - * if some of the required fields are null. - */ - public IndexSettingsMappingLimit build() { - _checkSingleUse(); - - return new IndexSettingsMappingLimit(this); - } - } - - /** - * Json deserializer for {@link IndexSettingsMappingLimit} - */ - public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer.lazy( - Builder::new, - IndexSettingsMappingLimit::setupIndexSettingsMappingLimitDeserializer - ); - - protected static void setupIndexSettingsMappingLimitDeserializer(ObjectDeserializer op) { - - op.add(Builder::limit, JsonpDeserializer.longDeserializer(), "limit"); - - } - -} diff --git a/java-client/src/main/java/org/opensearch/client/opensearch/indices/IndexSettingsSearch.java b/java-client/src/main/java/org/opensearch/client/opensearch/indices/IndexSettingsSearch.java deleted file mode 100644 index 1bb735e921..0000000000 --- a/java-client/src/main/java/org/opensearch/client/opensearch/indices/IndexSettingsSearch.java +++ /dev/null @@ -1,181 +0,0 @@ -/* - * SPDX-License-Identifier: Apache-2.0 - * - * The OpenSearch Contributors require contributions made to - * this file be licensed under the Apache-2.0 license or a - * compatible open source license. - */ - -/* - * 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. - */ - -/* - * Modifications Copyright OpenSearch Contributors. See - * GitHub history for details. - */ - -package org.opensearch.client.opensearch.indices; - -import jakarta.json.stream.JsonGenerator; -import java.util.function.Function; -import javax.annotation.Nullable; -import org.opensearch.client.json.JsonpDeserializable; -import org.opensearch.client.json.JsonpDeserializer; -import org.opensearch.client.json.JsonpMapper; -import org.opensearch.client.json.ObjectBuilderDeserializer; -import org.opensearch.client.json.ObjectDeserializer; -import org.opensearch.client.json.PlainJsonSerializable; -import org.opensearch.client.util.ObjectBuilder; -import org.opensearch.client.util.ObjectBuilderBase; - -@JsonpDeserializable -public class IndexSettingsSearch implements PlainJsonSerializable { - @Nullable - private final SearchIdle idle; - - @Nullable - private final SearchSlowlog slowlog; - - // --------------------------------------------------------------------------------------------- - - private IndexSettingsSearch(Builder builder) { - - this.idle = builder.idle; - this.slowlog = builder.slowlog; - - } - - public static IndexSettingsSearch of(Function> fn) { - return fn.apply(new Builder()).build(); - } - - /** - * API name: {@code idle} - */ - @Nullable - public final SearchIdle idle() { - return this.idle; - } - - /** - * API name: {@code slowlog} - */ - @Nullable - public final SearchSlowlog slowlog() { - return this.slowlog; - } - - /** - * 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.idle != null) { - generator.writeKey("idle"); - this.idle.serialize(generator, mapper); - - } - if (this.slowlog != null) { - generator.writeKey("slowlog"); - this.slowlog.serialize(generator, mapper); - - } - - } - - // --------------------------------------------------------------------------------------------- - - /** - * Builder for {@link IndexSettingsSearch}. - */ - - public static class Builder extends ObjectBuilderBase implements ObjectBuilder { - @Nullable - private SearchIdle idle; - - @Nullable - private SearchSlowlog slowlog; - - /** - * API name: {@code idle} - */ - public final Builder idle(@Nullable SearchIdle value) { - this.idle = value; - return this; - } - - /** - * API name: {@code idle} - */ - public final Builder idle(Function> fn) { - return this.idle(fn.apply(new SearchIdle.Builder()).build()); - } - - /** - * API name: {@code slowlog} - */ - public final Builder slowlog(@Nullable SearchSlowlog value) { - this.slowlog = value; - return this; - } - - /** - * API name: {@code slowlog} - */ - public final Builder slowlog(Function> fn) { - return this.slowlog(fn.apply(new SearchSlowlog.Builder()).build()); - } - - /** - * Builds a {@link IndexSettingsSearch}. - * - * @throws NullPointerException - * if some of the required fields are null. - */ - public IndexSettingsSearch build() { - _checkSingleUse(); - - return new IndexSettingsSearch(this); - } - } - - // --------------------------------------------------------------------------------------------- - - /** - * Json deserializer for {@link IndexSettingsSearch} - */ - public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer.lazy( - Builder::new, - IndexSettingsSearch::setupSettingsSearchDeserializer - ); - - protected static void setupSettingsSearchDeserializer(ObjectDeserializer op) { - - op.add(Builder::idle, SearchIdle._DESERIALIZER, "idle"); - op.add(Builder::slowlog, SearchSlowlog._DESERIALIZER, "slowlog"); - - } - -} diff --git a/java-client/src/main/java/org/opensearch/client/opensearch/indices/Translog.java b/java-client/src/main/java/org/opensearch/client/opensearch/indices/Translog.java deleted file mode 100644 index 57467d2919..0000000000 --- a/java-client/src/main/java/org/opensearch/client/opensearch/indices/Translog.java +++ /dev/null @@ -1,170 +0,0 @@ -/* - * SPDX-License-Identifier: Apache-2.0 - * - * The OpenSearch Contributors require contributions made to - * this file be licensed under the Apache-2.0 license or a - * compatible open source license. - */ - -package org.opensearch.client.opensearch.indices; - -import jakarta.json.stream.JsonGenerator; -import java.util.function.Function; -import javax.annotation.Nullable; -import org.opensearch.client.json.JsonpDeserializable; -import org.opensearch.client.json.JsonpDeserializer; -import org.opensearch.client.json.JsonpMapper; -import org.opensearch.client.json.ObjectBuilderDeserializer; -import org.opensearch.client.json.ObjectDeserializer; -import org.opensearch.client.json.PlainJsonSerializable; -import org.opensearch.client.opensearch._types.Time; -import org.opensearch.client.util.ObjectBuilder; -import org.opensearch.client.util.ObjectBuilderBase; - -@JsonpDeserializable -public class Translog implements PlainJsonSerializable { - - @Nullable - private final String durability; - - @Nullable - private final String flushThresholdSize; - - @Nullable - private final Time syncInterval; - - private Translog(Builder builder) { - - this.durability = builder.durability; - this.flushThresholdSize = builder.flushThresholdSize; - this.syncInterval = builder.syncInterval; - - } - - public static Translog of(Function> fn) { - return fn.apply(new Builder()).build(); - } - - /** - * API name: {@code durability} - */ - @Nullable - public final String durability() { - return this.durability; - } - - /** - * API name: {@code flush_threshold_size} - */ - @Nullable - public final String flushThresholdSize() { - return this.flushThresholdSize; - } - - /** - * API name: {@code sync_interval} - */ - @Nullable - public final Time syncInterval() { - return this.syncInterval; - } - - /** - * 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.durability != null) { - generator.writeKey("durability"); - generator.write(this.durability); - - } - if (this.flushThresholdSize != null) { - generator.writeKey("flush_threshold_size"); - generator.write(this.flushThresholdSize); - - } - if (this.syncInterval != null) { - generator.writeKey("sync_interval"); - this.syncInterval.serialize(generator, mapper); - - } - - } - - // --------------------------------------------------------------------------------------------- - - /** - * Builder for {@link Translog}. - */ - public static class Builder extends ObjectBuilderBase implements ObjectBuilder { - - @Nullable - private String durability; - - @Nullable - private String flushThresholdSize; - - @Nullable - private Time syncInterval; - - /** - * API name: {@code durability} - */ - public final Translog.Builder durability(@Nullable String value) { - this.durability = value; - return this; - } - - /** - * API name: {@code flush_threshold_size} - */ - public final Translog.Builder flushThresholdSize(@Nullable String value) { - this.flushThresholdSize = value; - return this; - } - - /** - * API name: {@code sync_interval} - */ - public final Translog.Builder syncInterval(@Nullable Time value) { - this.syncInterval = value; - return this; - } - - /** - * Builds a {@link Translog}. - * - * @throws NullPointerException - * if some of the required fields are null. - */ - public Translog build() { - _checkSingleUse(); - - return new Translog(this); - } - } - - /** - * Json deserializer for {@link Translog} - */ - public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer.lazy( - Builder::new, - Translog::setupTranslogDeserializer - ); - - protected static void setupTranslogDeserializer(ObjectDeserializer op) { - - op.add(Translog.Builder::durability, JsonpDeserializer.stringDeserializer(), "durability"); - op.add(Translog.Builder::flushThresholdSize, JsonpDeserializer.stringDeserializer(), "flush_threshold_size"); - op.add(Translog.Builder::syncInterval, Time._DESERIALIZER, "sync_interval"); - - } - -} diff --git a/java-client/src/test/java/org/opensearch/client/opensearch/experiments/ParsingTests.java b/java-client/src/test/java/org/opensearch/client/opensearch/experiments/ParsingTests.java index 94120cd769..21c61b4a15 100644 --- a/java-client/src/test/java/org/opensearch/client/opensearch/experiments/ParsingTests.java +++ b/java-client/src/test/java/org/opensearch/client/opensearch/experiments/ParsingTests.java @@ -51,7 +51,7 @@ import org.opensearch.client.opensearch.indices.IndexSettingsIndexing; import org.opensearch.client.opensearch.indices.IndexSettingsMapping; import org.opensearch.client.opensearch.indices.IndexSettingsSearch; -import org.opensearch.client.opensearch.indices.Translog; +import org.opensearch.client.opensearch.indices.TranslogDurability; import org.opensearch.client.opensearch.indices.get_field_mapping.TypeFieldMappings; import org.opensearch.client.opensearch.model.ModelTestCase; @@ -78,12 +78,12 @@ public void testIndexSettingsTranslogOptionsParsing() { final IndexSettings indexSettings = IndexSettings.of( _1 -> _1.translog( - Translog.of(tr -> tr.syncInterval(Time.of(t -> t.time("10s"))).durability("async").flushThresholdSize("256mb")) + tr -> tr.syncInterval(Time.of(t -> t.time("10s"))).durability(TranslogDurability.Async).flushThresholdSize("256mb") ) ); final String str = toJson(indexSettings); - assertEquals("{\"translog\":{\"durability\":\"async\",\"flush_threshold_size\":\"256mb\"," + "\"sync_interval\":\"10s\"}}", str); + assertEquals("{\"translog\":{\"durability\":\"ASYNC\",\"flush_threshold_size\":\"256mb\",\"sync_interval\":\"10s\"}}", str); IndexSettings deserialized = fromJson(str, IndexSettings._DESERIALIZER); assertEquals(indexSettings.translog().syncInterval().time(), deserialized.translog().syncInterval().time()); @@ -94,8 +94,8 @@ public void testIndexSettingsTranslogOptionsParsing() { + ".flush_threshold_size\":\"256mb\"}"; IndexSettings deprecatedDeserialized = fromJson(deprecatedForm, IndexSettings._DESERIALIZER); assertEquals(indexSettings.translog().syncInterval().time(), deprecatedDeserialized.translog().syncInterval().time()); - assertEquals(indexSettings.translog().durability(), deprecatedDeserialized.translog().durability()); - assertEquals(indexSettings.translog().flushThresholdSize(), deprecatedDeserialized.translog().flushThresholdSize()); + assertEquals(indexSettings.translog().durability(), deprecatedDeserialized.translogDurability()); + assertEquals(indexSettings.translog().flushThresholdSize(), deprecatedDeserialized.translogFlushThresholdSize()); } @Test @@ -111,8 +111,7 @@ public void testIndexSettingsMappingParsing() { final String str = toJson(mapping); assertEquals( - "{\"total_fields\":{\"limit\":1},\"depth\":{\"limit\":2},\"nested_fields\":{\"limit\":3}," - + "\"nested_objects\":{\"limit\":4},\"field_name_length\":{\"limit\":5}}", + "{\"depth\":{\"limit\":2},\"field_name_length\":{\"limit\":5},\"nested_fields\":{\"limit\":3},\"nested_objects\":{\"limit\":4},\"total_fields\":{\"limit\":1}}", str ); @@ -297,8 +296,7 @@ public void testIndexSettingsIndexing() { final String str = toJson(indexing); assertEquals( - "{\"slowlog\":{\"level\":\"info\",\"source\":0,\"threshold\":{\"index\":{" - + "\"warn\":\"5000ms\",\"info\":\"1000ms\",\"debug\":\"500ms\",\"trace\":\"200ms\"}}}}", + "{\"slowlog\":{\"level\":\"info\",\"source\":0,\"threshold\":{\"index\":{\"debug\":\"500ms\",\"info\":\"1000ms\",\"trace\":\"200ms\",\"warn\":\"5000ms\"}}}}", str ); @@ -337,10 +335,7 @@ public void testIndexSettingsSearch() { final String str = toJson(search); assertEquals( - "{\"idle\":{\"after\":\"5s\"},\"slowlog\":{\"level\":\"info\"," - + "\"threshold\":{\"query\":{\"warn\":\"5000ms\",\"info\":\"1000ms\",\"debug\":\"500ms\"," - + "\"trace\":\"200ms\"},\"fetch\":{\"warn\":\"50ms\",\"info\":\"10ms\",\"debug\":\"5ms\"," - + "\"trace\":\"2ms\"}}}}", + "{\"idle\":{\"after\":\"5s\"},\"slowlog\":{\"level\":\"info\",\"threshold\":{\"fetch\":{\"debug\":\"5ms\",\"info\":\"10ms\",\"trace\":\"2ms\",\"warn\":\"50ms\"},\"query\":{\"debug\":\"500ms\",\"info\":\"1000ms\",\"trace\":\"200ms\",\"warn\":\"5000ms\"}}}}", str ); diff --git a/java-client/src/test/java/org/opensearch/client/opensearch/json/PlainDeserializableTest.java b/java-client/src/test/java/org/opensearch/client/opensearch/json/PlainDeserializableTest.java index d1f1faafc7..794b5704ce 100644 --- a/java-client/src/test/java/org/opensearch/client/opensearch/json/PlainDeserializableTest.java +++ b/java-client/src/test/java/org/opensearch/client/opensearch/json/PlainDeserializableTest.java @@ -24,7 +24,7 @@ public class PlainDeserializableTest { public void testWithJsonPutIndexTemplateRequest() { String stringTemplate = - "{\"mappings\":{\"properties\":{\"age\":{\"type\":\"integer\"}}},\"settings\":{\"number_of_shards\":\"2\",\"number_of_replicas\":\"1\"}}"; + "{\"mappings\":{\"properties\":{\"age\":{\"type\":\"integer\"}}},\"settings\":{\"number_of_replicas\":1,\"number_of_shards\":2}}"; InputStream inputStream = new ByteArrayInputStream(stringTemplate.getBytes(StandardCharsets.UTF_8)); PutIndexTemplateRequest indexTemplateRequest = new PutIndexTemplateRequest.Builder().name("My index") @@ -34,7 +34,7 @@ public void testWithJsonPutIndexTemplateRequest() { String expectedName = "My index"; List expectedIndexPatterns = Arrays.asList("index_pattern1"); - String expectedNumberOfShards = "2"; + Integer expectedNumberOfShards = 2; assertEquals(indexTemplateRequest.name(), expectedName); assertEquals(expectedIndexPatterns, indexTemplateRequest.indexPatterns()); diff --git a/java-client/src/test/java/org/opensearch/client/transport/aws/AwsSdk2TransportTests.java b/java-client/src/test/java/org/opensearch/client/transport/aws/AwsSdk2TransportTests.java index c5a6aca793..17bb6beac2 100644 --- a/java-client/src/test/java/org/opensearch/client/transport/aws/AwsSdk2TransportTests.java +++ b/java-client/src/test/java/org/opensearch/client/transport/aws/AwsSdk2TransportTests.java @@ -307,16 +307,16 @@ public void testSigV4PutIndex() throws Exception { b -> b.index("sample-index1") .aliases("sample-alias1", a -> a) .mappings(m -> m.properties("age", p -> p.integer(i -> i))) - .settings(s -> s.index(i -> i.numberOfReplicas("1").numberOfShards("2"))) + .settings(s -> s.index(i -> i.numberOfReplicas(1).numberOfShards(2))) ), "PUT", "/" + TEST_INDEX, - 156, - "381bb92a04d397cab611362eb3ac3e075db11ac08272d64763de2279e2b5604d", + 152, + "d74f84822e2dfce88bcfd16e5092a42989396019c82fde62fa0e9ac4e34d9350", selectExpectedSignature( - "29123ccbcbd9af71fce384a1ed6d64b8c70f660e55a16de05405cac5fbebf18b", - "ff12e7b3e5e0f96fa25f13b3e95606dd18e3f1314dea6b7d6a9159f0aa51c21c", - "dbddbed28a34c0c380cd31567491a240294ef58755f9370e237d66f10d20d2df" + "cee95989c4e6007d840ae598ccc0bccef238826dba068a84951041c8484aa704", + "7ad70d59f92bd59fbe1a977ee014f15a3f793488b4869f62aa64375a5755850b", + "bb6c080d9ff3f6f29ae86936afc465a2c519b3cc3bf73e8cba2bc4c54d4701ad" ) ); } diff --git a/java-client/src/test/java11/org/opensearch/client/opensearch/integTest/AbstractRequestIT.java b/java-client/src/test/java11/org/opensearch/client/opensearch/integTest/AbstractRequestIT.java index 39ecabd75b..dfb20e59a5 100644 --- a/java-client/src/test/java11/org/opensearch/client/opensearch/integTest/AbstractRequestIT.java +++ b/java-client/src/test/java11/org/opensearch/client/opensearch/integTest/AbstractRequestIT.java @@ -91,7 +91,6 @@ import org.opensearch.client.opensearch.indices.IndexSettings; import org.opensearch.client.opensearch.indices.IndexSettingsAnalysis; import org.opensearch.client.opensearch.indices.IndexState; -import org.opensearch.client.opensearch.indices.Translog; import org.opensearch.client.transport.endpoints.BooleanResponse; public abstract class AbstractRequestIT extends OpenSearchJavaClientTestCase { @@ -131,7 +130,7 @@ public void testIndexSettings() throws Exception { .create( r -> r.index("test-settings") .settings( - s -> s.translog(Translog.of(tl -> tl.syncInterval(Time.of(t -> t.time("10s"))))) + s -> s.translog(tl -> tl.syncInterval(t -> t.time("10s"))) .mapping( m -> m.fieldNameLength(f -> f.limit(300L)) .totalFields(f -> f.limit(30L)) @@ -146,10 +145,10 @@ public void testIndexSettings() throws Exception { .reformat(false) .threshold( th -> th.index( - in -> in.trace(Time.of(t -> t.time("5s"))) - .debug(Time.of(t -> t.time("10s"))) - .info(Time.of(t -> t.time("20s"))) - .warn(Time.of(t -> t.time("30s"))) + in -> in.trace(t -> t.time("5s")) + .debug(t -> t.time("10s")) + .info(t -> t.time("20s")) + .warn(t -> t.time("30s")) ) ) ) @@ -159,16 +158,16 @@ public void testIndexSettings() throws Exception { sl -> sl.level("info") .threshold( th -> th.query( - in -> in.trace(Time.of(t -> t.time("5s"))) - .debug(Time.of(t -> t.time("10s"))) - .info(Time.of(t -> t.time("20s"))) - .warn(Time.of(t -> t.time("30s"))) + in -> in.trace(t -> t.time("5s")) + .debug(t -> t.time("10s")) + .info(t -> t.time("20s")) + .warn(t -> t.time("30s")) ) .fetch( - in -> in.trace(Time.of(t -> t.time("5s"))) - .debug(Time.of(t -> t.time("10s"))) - .info(Time.of(t -> t.time("20s"))) - .warn(Time.of(t -> t.time("30s"))) + in -> in.trace(t -> t.time("5s")) + .debug(t -> t.time("10s")) + .info(t -> t.time("20s")) + .warn(t -> t.time("30s")) ) ) ).idle(id -> id.after(a -> a.time("120s"))) @@ -233,7 +232,7 @@ public void testIndexSettings() throws Exception { .putSettings( r -> r.index("test-settings") .settings( - s -> s.translog(Translog.of(tl -> tl.syncInterval(Time.of(t -> t.time("5s"))))) + s -> s.translog(tl -> tl.syncInterval(Time.of(t -> t.time("5s")))) .mapping( m -> m.fieldNameLength(f -> f.limit(400L)) .totalFields(f -> f.limit(130L)) diff --git a/java-codegen/src/main/java/org/opensearch/client/codegen/model/SpecTransformer.java b/java-codegen/src/main/java/org/opensearch/client/codegen/model/SpecTransformer.java index cd967b869e..bf06f51541 100644 --- a/java-codegen/src/main/java/org/opensearch/client/codegen/model/SpecTransformer.java +++ b/java-codegen/src/main/java/org/opensearch/client/codegen/model/SpecTransformer.java @@ -508,6 +508,11 @@ private Type mapTypeInner(OpenApiSchema schema) { return mapOneOf(oneOf.get()); } + var anyOf = schema.getAnyOf(); + if (anyOf.isPresent()) { + return mapAnyOf(anyOf.get()); + } + var allOf = schema.getAllOf(); if (allOf.isPresent()) { return mapAllOf(allOf.get()); @@ -555,6 +560,16 @@ private Type mapOneOf(List oneOf) { return Types.Client.Json.JsonData; } + private Type mapAnyOf(List anyOf) { + var types = OpenApiSchema.determineTypes(anyOf); + + if (types.size() == 1 && types.contains(OpenApiSchemaType.String)) { + return Types.Java.Lang.String; + } + + return Types.Client.Json.JsonData; + } + private Type mapAllOf(List allOf) { if (allOf.size() == 1) { return mapType(allOf.get(0)); diff --git a/java-codegen/src/main/java/org/opensearch/client/codegen/model/overrides/Overrides.java b/java-codegen/src/main/java/org/opensearch/client/codegen/model/overrides/Overrides.java index e83d8f1bc6..38a0475597 100644 --- a/java-codegen/src/main/java/org/opensearch/client/codegen/model/overrides/Overrides.java +++ b/java-codegen/src/main/java/org/opensearch/client/codegen/model/overrides/Overrides.java @@ -12,6 +12,7 @@ import java.util.Map; import java.util.Objects; import java.util.Optional; +import java.util.Set; import java.util.function.Function; import javax.annotation.Nonnull; import javax.annotation.Nullable; @@ -40,9 +41,19 @@ private static JsonPointer schema(String namespace, String name) { so -> so.withMappedType(t -> t.withPackage(Types.Client.OpenSearch._Types.PACKAGE + ".query_dsl").withName("Query")) ) - // TODO: Remove this to generate index settings types - .with(schema("indices._common", "IndexSettings"), so -> so.withShouldGenerate(ShouldGenerate.Never)) - .with(schema("indices._common", "IndexSettingsAnalysis"), so -> so.withShouldGenerate(ShouldGenerate.Always)) + .with(schema("indices._common", "IndexSettings"), so -> so.withAliasProvider(k -> { + switch (k) { + case "index": + case "indexing": + case "mapping": + case "search": + case "settings": + case "top_metrics_max_size": + return null; + default: + return Set.of("index." + k); + } + })) ).build(); @Nonnull diff --git a/samples/src/main/java/org/opensearch/client/samples/Bulk.java b/samples/src/main/java/org/opensearch/client/samples/Bulk.java index 21f6e88727..0c6cdb47de 100644 --- a/samples/src/main/java/org/opensearch/client/samples/Bulk.java +++ b/samples/src/main/java/org/opensearch/client/samples/Bulk.java @@ -45,7 +45,7 @@ public static void main(String[] args) { if (!client.indices().exists(r -> r.index(indexName)).value()) { LOGGER.info("Creating index {}", indexName); - IndexSettings settings = new IndexSettings.Builder().numberOfShards("2").numberOfReplicas("1").build(); + IndexSettings settings = new IndexSettings.Builder().numberOfShards(2).numberOfReplicas(1).build(); TypeMapping mapping = new TypeMapping.Builder().properties( "age", new Property.Builder().integer(new IntegerNumberProperty.Builder().build()).build() diff --git a/samples/src/main/java/org/opensearch/client/samples/IndexTemplates.java b/samples/src/main/java/org/opensearch/client/samples/IndexTemplates.java index 3f43a07048..c540d45063 100644 --- a/samples/src/main/java/org/opensearch/client/samples/IndexTemplates.java +++ b/samples/src/main/java/org/opensearch/client/samples/IndexTemplates.java @@ -47,8 +47,8 @@ public static void main(String[] args) { PutComponentTemplateRequest putComponentTemplateRequest = PutComponentTemplateRequest.of( c -> c.name(indexSettingsComponentTemplate) .settings( - s -> s.numberOfShards("2") - .numberOfReplicas("1") + s -> s.numberOfShards(2) + .numberOfReplicas(1) .indexing( i -> i.slowlog( sl -> sl.level("info") diff --git a/samples/src/main/java/org/opensearch/client/samples/IndexingBasics.java b/samples/src/main/java/org/opensearch/client/samples/IndexingBasics.java index db7bfdf3f6..e9850bb953 100644 --- a/samples/src/main/java/org/opensearch/client/samples/IndexingBasics.java +++ b/samples/src/main/java/org/opensearch/client/samples/IndexingBasics.java @@ -46,7 +46,7 @@ public static void main(String[] args) { if (!client.indices().exists(r -> r.index(indexName)).value()) { LOGGER.info("Creating index {}", indexName); - IndexSettings settings = new IndexSettings.Builder().numberOfShards("2").numberOfReplicas("1").build(); + IndexSettings settings = new IndexSettings.Builder().numberOfShards(2).numberOfReplicas(1).build(); TypeMapping mapping = new TypeMapping.Builder().properties( "age", new Property.Builder().integer(new IntegerNumberProperty.Builder().build()).build() diff --git a/samples/src/main/java/org/opensearch/client/samples/PointInTime.java b/samples/src/main/java/org/opensearch/client/samples/PointInTime.java index 53e29743c4..e5162ebf70 100644 --- a/samples/src/main/java/org/opensearch/client/samples/PointInTime.java +++ b/samples/src/main/java/org/opensearch/client/samples/PointInTime.java @@ -41,7 +41,7 @@ public static void main(String[] args) { if (!client.indices().exists(r -> r.index(indexName)).value()) { LOGGER.info("Creating index {}", indexName); - IndexSettings settings = new IndexSettings.Builder().numberOfShards("2").numberOfReplicas("1").build(); + IndexSettings settings = new IndexSettings.Builder().numberOfShards(2).numberOfReplicas(1).build(); TypeMapping mapping = new TypeMapping.Builder().properties( "age", new Property.Builder().integer(new IntegerNumberProperty.Builder().build()).build() diff --git a/samples/src/main/java/org/opensearch/client/samples/knn/KnnEfficientFilter.java b/samples/src/main/java/org/opensearch/client/samples/knn/KnnEfficientFilter.java index e24de64826..a0b653b011 100644 --- a/samples/src/main/java/org/opensearch/client/samples/knn/KnnEfficientFilter.java +++ b/samples/src/main/java/org/opensearch/client/samples/knn/KnnEfficientFilter.java @@ -37,7 +37,7 @@ public static void main(String[] args) { client.indices() .create( r -> r.index(indexName) - .settings(s -> s.knn(true).knnAlgoParamEfSearch(100).numberOfShards("1").numberOfReplicas("0")) + .settings(s -> s.knn(true).knnAlgoParamEfSearch(100).numberOfShards(1).numberOfReplicas(0)) .mappings( m -> m.properties( "location",