From fea413874badcdae78e9f962118464b377db5ae1 Mon Sep 17 00:00:00 2001 From: Thomas Farr Date: Fri, 22 Nov 2024 11:10:47 +1300 Subject: [PATCH] Generate toBuilder and Builder.copy methods (#1300) Signed-off-by: Thomas Farr --- CHANGELOG.md | 1 + .../_types/AcknowledgedResponseBase.java | 16 +- .../client/opensearch/_types/BaseNode.java | 32 +- .../_types/BulkByScrollFailure.java | 57 +- .../_types/BulkByScrollTaskStatus.java | 89 +- .../client/opensearch/_types/ErrorCause.java | 60 +- .../opensearch/_types/GeoHashLocation.java | 36 +- .../_types/IndicesResponseBase.java | 15 + .../opensearch/_types/InlineScript.java | 57 +- .../opensearch/_types/LatLonGeoLocation.java | 40 +- .../opensearch/_types/NodeStatistics.java | 47 +- .../_types/OpenSearchVersionInfo.java | 66 +- .../client/opensearch/_types/Retries.java | 40 +- .../client/opensearch/_types/ScriptBase.java | 16 +- .../opensearch/_types/ShardFailure.java | 49 +- .../opensearch/_types/ShardStatistics.java | 50 +- .../opensearch/_types/StoredScriptId.java | 49 +- .../client/opensearch/_types/TaskFailure.java | 46 +- .../opensearch/_types/WriteResponseBase.java | 37 +- .../_types/XyCartesianCoordinates.java | 43 +- .../analysis/AsciiFoldingTokenFilter.java | 55 +- .../_types/analysis/CharFilterBase.java | 16 +- .../_types/analysis/CharGroupTokenizer.java | 56 +- .../_types/analysis/CjkAnalyzer.java | 40 +- .../analysis/CommonGramsTokenFilter.java | 64 +- .../analysis/CompoundWordTokenFilterBase.java | 32 + .../_types/analysis/ConditionTokenFilter.java | 57 +- .../_types/analysis/CustomAnalyzer.java | 50 +- .../_types/analysis/CustomNormalizer.java | 45 +- .../analysis/DelimitedPayloadTokenFilter.java | 58 +- .../DictionaryDecompounderTokenFilter.java | 40 +- .../_types/analysis/DutchAnalyzer.java | 37 +- .../_types/analysis/EdgeNGramTokenFilter.java | 62 +- .../_types/analysis/EdgeNGramTokenizer.java | 62 +- .../_types/analysis/ElisionTokenFilter.java | 59 +- .../_types/analysis/FingerprintAnalyzer.java | 56 +- .../analysis/FingerprintTokenFilter.java | 58 +- .../_types/analysis/HtmlStripCharFilter.java | 40 +- .../_types/analysis/HunspellTokenFilter.java | 61 +- .../HyphenationDecompounderTokenFilter.java | 40 +- .../_types/analysis/IcuAnalyzer.java | 39 +- .../analysis/IcuCollationTokenFilter.java | 88 +- .../analysis/IcuFoldingTokenFilter.java | 54 +- .../analysis/IcuNormalizationCharFilter.java | 58 +- .../analysis/IcuNormalizationTokenFilter.java | 54 +- .../_types/analysis/IcuTokenizer.java | 53 +- .../analysis/IcuTransformTokenFilter.java | 57 +- .../_types/analysis/KStemTokenFilter.java | 40 +- .../_types/analysis/KeepTypesTokenFilter.java | 56 +- .../_types/analysis/KeepWordsTokenFilter.java | 59 +- .../_types/analysis/KeywordAnalyzer.java | 41 +- .../analysis/KeywordMarkerTokenFilter.java | 64 +- .../_types/analysis/KeywordTokenizer.java | 53 +- .../_types/analysis/KuromojiAnalyzer.java | 43 +- .../KuromojiIterationMarkCharFilter.java | 58 +- .../KuromojiPartOfSpeechTokenFilter.java | 55 +- .../KuromojiReadingFormTokenFilter.java | 55 +- .../analysis/KuromojiStemmerTokenFilter.java | 55 +- .../_types/analysis/KuromojiTokenizer.java | 71 +- .../_types/analysis/LanguageAnalyzer.java | 54 +- .../_types/analysis/LengthTokenFilter.java | 56 +- .../_types/analysis/LetterTokenizer.java | 40 +- .../analysis/LimitTokenCountTokenFilter.java | 58 +- .../_types/analysis/LowercaseNormalizer.java | 36 +- .../_types/analysis/LowercaseTokenFilter.java | 53 +- .../_types/analysis/LowercaseTokenizer.java | 40 +- .../_types/analysis/MappingCharFilter.java | 56 +- .../analysis/MultiplexerTokenFilter.java | 58 +- .../_types/analysis/NGramTokenFilter.java | 59 +- .../_types/analysis/NGramTokenizer.java | 62 +- .../_types/analysis/NoriAnalyzer.java | 46 +- .../analysis/NoriPartOfSpeechTokenFilter.java | 55 +- .../_types/analysis/NoriTokenizer.java | 62 +- .../analysis/PathHierarchyTokenizer.java | 64 +- .../_types/analysis/PatternAnalyzer.java | 53 +- .../analysis/PatternCaptureTokenFilter.java | 58 +- .../analysis/PatternReplaceCharFilter.java | 60 +- .../analysis/PatternReplaceTokenFilter.java | 63 +- .../_types/analysis/PatternTokenizer.java | 59 +- .../analysis/PersianStemTokenFilter.java | 42 +- .../_types/analysis/PhoneAnalyzer.java | 37 +- .../_types/analysis/PhoneticTokenFilter.java | 68 +- .../analysis/PorterStemTokenFilter.java | 42 +- .../_types/analysis/PredicateTokenFilter.java | 53 +- .../analysis/RemoveDuplicatesTokenFilter.java | 42 +- .../_types/analysis/ReverseTokenFilter.java | 40 +- .../_types/analysis/ShingleTokenFilter.java | 68 +- .../_types/analysis/SimpleAnalyzer.java | 37 +- .../_types/analysis/SmartcnAnalyzer.java | 36 +- .../analysis/SmartcnStopTokenFilter.java | 42 +- .../_types/analysis/SmartcnTokenizer.java | 40 +- .../_types/analysis/SnowballAnalyzer.java | 47 +- .../_types/analysis/SnowballTokenFilter.java | 52 +- .../_types/analysis/StandardAnalyzer.java | 44 +- .../_types/analysis/StandardTokenizer.java | 53 +- .../analysis/StemmerOverrideTokenFilter.java | 58 +- .../_types/analysis/StemmerTokenFilter.java | 53 +- .../_types/analysis/StopAnalyzer.java | 43 +- .../_types/analysis/StopTokenFilter.java | 62 +- .../analysis/SynonymGraphTokenFilter.java | 73 +- .../_types/analysis/SynonymTokenFilter.java | 71 +- .../_types/analysis/TokenFilterBase.java | 16 +- .../_types/analysis/TokenizerBase.java | 16 +- .../_types/analysis/TrimTokenFilter.java | 40 +- .../_types/analysis/TruncateTokenFilter.java | 53 +- .../_types/analysis/UaxEmailUrlTokenizer.java | 53 +- .../_types/analysis/UniqueTokenFilter.java | 53 +- .../_types/analysis/UppercaseTokenFilter.java | 40 +- .../_types/analysis/WhitespaceAnalyzer.java | 41 +- .../_types/analysis/WhitespaceTokenizer.java | 53 +- .../WordDelimiterGraphTokenFilter.java | 98 +- .../analysis/WordDelimiterTokenFilter.java | 92 +- .../AggregateMetricDoubleProperty.java | 58 +- .../opensearch/_types/mapping/AllField.java | 63 +- .../_types/mapping/BinaryProperty.java | 40 +- .../_types/mapping/BooleanProperty.java | 65 +- .../_types/mapping/ByteNumberProperty.java | 55 +- .../_types/mapping/CompletionProperty.java | 71 +- .../mapping/ConstantKeywordProperty.java | 53 +- .../_types/mapping/CorePropertyBase.java | 20 + .../_types/mapping/DataStreamTimestamp.java | 37 +- .../_types/mapping/DateNanosProperty.java | 70 +- .../_types/mapping/DateProperty.java | 72 +- .../_types/mapping/DateRangeProperty.java | 53 +- .../_types/mapping/DocValuesPropertyBase.java | 14 + .../_types/mapping/DoubleNumberProperty.java | 55 +- .../_types/mapping/DoubleRangeProperty.java | 42 +- .../_types/mapping/DynamicTemplate.java | 56 +- .../_types/mapping/FieldAliasProperty.java | 53 +- .../_types/mapping/FieldNamesField.java | 37 +- .../_types/mapping/FlatObjectProperty.java | 56 +- .../_types/mapping/FloatNumberProperty.java | 55 +- .../_types/mapping/FloatRangeProperty.java | 40 +- .../_types/mapping/GeoPointProperty.java | 62 +- .../_types/mapping/GeoShapeProperty.java | 70 +- .../mapping/HalfFloatNumberProperty.java | 55 +- .../_types/mapping/HistogramProperty.java | 53 +- .../mapping/IcuCollationKeywordProperty.java | 89 +- .../opensearch/_types/mapping/IndexField.java | 37 +- .../_types/mapping/IntegerNumberProperty.java | 55 +- .../_types/mapping/IntegerRangeProperty.java | 42 +- .../opensearch/_types/mapping/IpProperty.java | 59 +- .../_types/mapping/IpRangeProperty.java | 40 +- .../_types/mapping/JoinProperty.java | 53 +- .../_types/mapping/KeywordProperty.java | 76 +- .../_types/mapping/KnnVectorMethod.java | 46 +- .../_types/mapping/KnnVectorProperty.java | 74 +- .../_types/mapping/LongNumberProperty.java | 55 +- .../_types/mapping/LongRangeProperty.java | 40 +- .../_types/mapping/MatchOnlyTextProperty.java | 50 +- .../_types/mapping/Murmur3HashProperty.java | 42 +- .../_types/mapping/NestedProperty.java | 56 +- .../_types/mapping/NumberPropertyBase.java | 23 + .../_types/mapping/ObjectProperty.java | 50 +- .../_types/mapping/PercolatorProperty.java | 40 +- .../_types/mapping/PropertyBase.java | 32 +- .../_types/mapping/RangePropertyBase.java | 20 + .../_types/mapping/RankFeatureProperty.java | 53 +- .../_types/mapping/RankFeaturesProperty.java | 40 +- .../_types/mapping/RoutingField.java | 37 +- .../mapping/ScaledFloatNumberProperty.java | 58 +- .../mapping/SearchAsYouTypeProperty.java | 76 +- .../_types/mapping/ShortNumberProperty.java | 55 +- .../opensearch/_types/mapping/SizeField.java | 37 +- .../_types/mapping/SourceField.java | 61 +- .../_types/mapping/SuggestContext.java | 45 +- .../_types/mapping/TextIndexPrefixes.java | 40 +- .../_types/mapping/TextProperty.java | 91 +- .../_types/mapping/TokenCountProperty.java | 67 +- .../_types/mapping/TypeMapping.java | 101 +- .../mapping/UnsignedLongNumberProperty.java | 55 +- .../_types/mapping/VersionProperty.java | 42 +- .../_types/mapping/WildcardProperty.java | 55 +- .../_types/mapping/XyPointProperty.java | 62 +- .../_types/mapping/XyShapeProperty.java | 64 +- .../client/opensearch/core/InfoResponse.java | 49 +- .../DeleteDanglingIndexRequest.java | 73 +- .../DeleteDanglingIndexResponse.java | 39 +- .../ImportDanglingIndexRequest.java | 73 +- .../ImportDanglingIndexResponse.java | 39 +- .../ListDanglingIndicesResponse.java | 48 +- .../list_dangling_indices/DanglingIndex.java | 49 +- .../client/opensearch/indices/Alias.java | 53 +- .../indices/CreateIndexRequest.java | 80 +- .../indices/CreateIndexResponse.java | 42 +- .../indices/DataStreamTimestampField.java | 39 +- .../indices/DeleteIndexRequest.java | 71 +- .../indices/DeleteIndexResponse.java | 41 +- .../indices/DeleteIndexTemplateRequest.java | 62 +- .../indices/DeleteIndexTemplateResponse.java | 39 +- .../indices/ExistsIndexTemplateRequest.java | 64 +- .../opensearch/indices/ExistsRequest.java | 60 +- .../indices/FielddataFrequencyFilter.java | 46 +- .../opensearch/indices/GetIndexRequest.java | 114 +- .../opensearch/indices/GetIndexResponse.java | 2 + .../indices/GetIndexTemplateRequest.java | 77 +- .../indices/GetIndexTemplateResponse.java | 41 +- .../indices/IndexSettingsAnalysis.java | 61 +- .../client/opensearch/indices/IndexState.java | 53 +- .../opensearch/indices/IndexTemplate.java | 62 +- .../IndexTemplateDataStreamConfiguration.java | 55 +- .../indices/IndexTemplateSummary.java | 46 +- .../opensearch/indices/NumericFielddata.java | 36 +- .../indices/PutIndexTemplateRequest.java | 85 +- .../indices/PutIndexTemplateResponse.java | 39 +- .../indices/SimulateIndexTemplateRequest.java | 94 +- .../get_index_template/IndexTemplateItem.java | 40 +- .../IndexTemplateMapping.java | 60 +- .../client/opensearch/ml/Action.java | 56 +- .../client/opensearch/ml/ClientConfig.java | 55 +- .../opensearch/ml/CreateConnectorRequest.java | 65 +- .../ml/CreateConnectorResponse.java | 40 +- .../client/opensearch/ml/Credential.java | 46 +- .../opensearch/ml/DeleteAgentRequest.java | 36 +- .../opensearch/ml/DeleteAgentResponse.java | 39 +- .../opensearch/ml/DeleteConnectorRequest.java | 38 +- .../ml/DeleteConnectorResponse.java | 41 +- .../ml/DeleteModelGroupRequest.java | 38 +- .../ml/DeleteModelGroupResponse.java | 41 +- .../opensearch/ml/DeleteModelRequest.java | 36 +- .../opensearch/ml/DeleteModelResponse.java | 39 +- .../opensearch/ml/DeleteTaskRequest.java | 36 +- .../opensearch/ml/DeleteTaskResponse.java | 37 +- .../opensearch/ml/DeployModelRequest.java | 36 +- .../opensearch/ml/DeployModelResponse.java | 42 +- .../opensearch/ml/GetModelGroupRequest.java | 36 +- .../opensearch/ml/GetModelGroupResponse.java | 54 +- .../client/opensearch/ml/GetTaskRequest.java | 36 +- .../client/opensearch/ml/GetTaskResponse.java | 64 +- .../client/opensearch/ml/Headers.java | 40 +- .../opensearch/client/opensearch/ml/LLM.java | 40 +- .../client/opensearch/ml/Memory.java | 37 +- .../opensearch/ml/RegisterAgentsRequest.java | 65 +- .../opensearch/ml/RegisterAgentsResponse.java | 40 +- .../ml/RegisterModelGroupRequest.java | 52 +- .../ml/RegisterModelGroupResponse.java | 42 +- .../opensearch/ml/RegisterModelRequest.java | 51 +- .../opensearch/ml/RegisterModelResponse.java | 42 +- .../client/opensearch/ml/ToolItems.java | 47 +- .../opensearch/ml/UndeployModelNode.java | 37 +- .../opensearch/ml/UndeployModelRequest.java | 36 +- .../opensearch/ml/UndeployModelResponse.java | 2 + .../snapshot/CleanupRepositoryRequest.java | 56 +- .../snapshot/CleanupRepositoryResponse.java | 40 +- .../snapshot/CloneSnapshotRequest.java | 62 +- .../snapshot/CloneSnapshotResponse.java | 41 +- .../snapshot/VerifyRepositoryRequest.java | 56 +- .../snapshot/VerifyRepositoryResponse.java | 41 +- .../CleanupRepositoryResults.java | 43 +- .../verify_repository/CompactNodeInfo.java | 36 +- .../opensearch/tasks/CancelRequest.java | 50 +- .../opensearch/tasks/CancelResponse.java | 37 +- .../opensearch/tasks/GetTasksRequest.java | 43 +- .../opensearch/tasks/GetTasksResponse.java | 48 +- .../client/opensearch/tasks/ListRequest.java | 57 +- .../client/opensearch/tasks/ListResponse.java | 37 +- .../client/opensearch/tasks/Status.java | 96 +- .../opensearch/tasks/TaskExecutingNode.java | 51 +- .../client/opensearch/tasks/TaskGroup.java | 53 +- .../client/opensearch/tasks/TaskInfo.java | 447 +--- .../client/opensearch/tasks/TaskInfoBase.java | 546 +++++ .../tasks/TaskListResponseBase.java | 31 +- .../client/opensearch/tasks/TaskResponse.java | 97 +- .../client/util/CopyableBuilder.java | 27 + .../client/util/MutableBuilder.java | 28 + .../opensearch/client/util/ObjectBuilder.java | 3 + .../client/util/ObjectBuilderBase.java | 21 +- .../client/util/ToCopyableBuilder.java | 33 + java-codegen/opensearch-openapi.yaml | 2138 ++++++++++++----- .../client/codegen/model/ObjectShape.java | 4 + .../client/codegen/model/Types.java | 7 + .../codegen/model/overrides/Overrides.java | 6 +- .../codegen/templates/ObjectShape.mustache | 2 + .../templates/ObjectShape/Builder.mustache | 103 +- .../ObjectShape/Builder/BuildImpl.mustache | 2 + .../ObjectShape/Builder/CopyCtorImpl.mustache | 16 + .../ObjectShape/Builder/Fields.mustache | 66 - .../ObjectShape/Builder/SelfImpl.mustache | 1 + .../ObjectShape/Builder/Setters.mustache | 73 + .../templates/ObjectShape/ToBuilder.mustache | 7 + .../codegen/templates/RequestShape.mustache | 2 + 281 files changed, 14572 insertions(+), 2169 deletions(-) create mode 100644 java-client/src/generated/java/org/opensearch/client/opensearch/tasks/TaskInfoBase.java create mode 100644 java-client/src/main/java/org/opensearch/client/util/CopyableBuilder.java create mode 100644 java-client/src/main/java/org/opensearch/client/util/MutableBuilder.java create mode 100644 java-client/src/main/java/org/opensearch/client/util/ToCopyableBuilder.java create mode 100644 java-codegen/src/main/resources/org/opensearch/client/codegen/templates/ObjectShape/Builder/CopyCtorImpl.mustache create mode 100644 java-codegen/src/main/resources/org/opensearch/client/codegen/templates/ObjectShape/Builder/Setters.mustache create mode 100644 java-codegen/src/main/resources/org/opensearch/client/codegen/templates/ObjectShape/ToBuilder.mustache diff --git a/CHANGELOG.md b/CHANGELOG.md index 2c969bd9f8..48028906d1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -14,6 +14,7 @@ This section is for maintaining a changelog for all breaking changes for the cli ### Added - Document HTTP/2 support ([#330](https://github.com/opensearch-project/opensearch-java/pull/330)) +- Added `toBuilder()` and `Builder.copy()` methods to all generated classes ([#1300](https://github.com/opensearch-project/opensearch-java/pull/1300)) ### Dependencies diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/AcknowledgedResponseBase.java b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/AcknowledgedResponseBase.java index ceb941a151..a10d8d9293 100644 --- a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/AcknowledgedResponseBase.java +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/AcknowledgedResponseBase.java @@ -38,6 +38,7 @@ import jakarta.json.stream.JsonGenerator; import javax.annotation.Generated; +import javax.annotation.Nonnull; import org.opensearch.client.json.JsonpDeserializer; import org.opensearch.client.json.JsonpMapper; import org.opensearch.client.json.ObjectDeserializer; @@ -88,18 +89,31 @@ protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { protected abstract static class AbstractBuilder> extends ObjectBuilderBase { private Boolean acknowledged; + protected AbstractBuilder() {} + + protected AbstractBuilder(AcknowledgedResponseBase o) { + this.acknowledged = o.acknowledged; + } + + protected AbstractBuilder(AbstractBuilder o) { + this.acknowledged = o.acknowledged; + } + + @Nonnull + protected abstract BuilderT self(); + /** * Required - For a successful response, this value is always true. On failure, an exception is returned instead. *

* API name: {@code acknowledged} *

*/ + @Nonnull public final BuilderT acknowledged(boolean value) { this.acknowledged = value; return self(); } - protected abstract BuilderT self(); } // --------------------------------------------------------------------------------------------- diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/BaseNode.java b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/BaseNode.java index ef07e83910..7844ae7e27 100644 --- a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/BaseNode.java +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/BaseNode.java @@ -196,6 +196,29 @@ protected abstract static class AbstractBuilder o) { + this.attributes = _mapCopy(o.attributes); + this.host = o.host; + this.ip = o.ip; + this.name = o.name; + this.roles = _listCopy(o.roles); + this.transportAddress = o.transportAddress; + } + + @Nonnull + protected abstract BuilderT self(); + /** * API name: {@code attributes} * @@ -203,6 +226,7 @@ protected abstract static class AbstractBuildermap to attributes. *

*/ + @Nonnull public final BuilderT attributes(Map map) { this.attributes = _mapPutAll(this.attributes, map); return self(); @@ -215,6 +239,7 @@ public final BuilderT attributes(Map map) { * Adds an entry to attributes. *

*/ + @Nonnull public final BuilderT attributes(String key, String value) { this.attributes = _mapPut(this.attributes, key, value); return self(); @@ -223,6 +248,7 @@ public final BuilderT attributes(String key, String value) { /** * API name: {@code host} */ + @Nonnull public final BuilderT host(@Nullable String value) { this.host = value; return self(); @@ -231,6 +257,7 @@ public final BuilderT host(@Nullable String value) { /** * API name: {@code ip} */ + @Nonnull public final BuilderT ip(@Nullable String value) { this.ip = value; return self(); @@ -239,6 +266,7 @@ public final BuilderT ip(@Nullable String value) { /** * Required - API name: {@code name} */ + @Nonnull public final BuilderT name(String value) { this.name = value; return self(); @@ -251,6 +279,7 @@ public final BuilderT name(String value) { * Adds all elements of list to roles. *

*/ + @Nonnull public final BuilderT roles(List list) { this.roles = _listAddAll(this.roles, list); return self(); @@ -263,6 +292,7 @@ public final BuilderT roles(List list) { * Adds one or more values to roles. *

*/ + @Nonnull public final BuilderT roles(NodeRole value, NodeRole... values) { this.roles = _listAdd(this.roles, value, values); return self(); @@ -271,12 +301,12 @@ public final BuilderT roles(NodeRole value, NodeRole... values) { /** * API name: {@code transport_address} */ + @Nonnull public final BuilderT transportAddress(@Nullable String value) { this.transportAddress = value; return self(); } - protected abstract BuilderT self(); } // --------------------------------------------------------------------------------------------- diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/BulkByScrollFailure.java b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/BulkByScrollFailure.java index 66578fe695..c141f29b0b 100644 --- a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/BulkByScrollFailure.java +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/BulkByScrollFailure.java @@ -40,6 +40,7 @@ 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; @@ -48,14 +49,16 @@ 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: _types.BulkByScrollFailure @JsonpDeserializable @Generated("org.opensearch.client.codegen.CodeGenerator") -public class BulkByScrollFailure implements PlainJsonSerializable { +public class BulkByScrollFailure implements PlainJsonSerializable, ToCopyableBuilder { @Nullable private final ErrorCause cause; @@ -195,10 +198,21 @@ protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { // --------------------------------------------------------------------------------------------- + @Override + @Nonnull + public Builder toBuilder() { + return new Builder(this); + } + + @Nonnull + public static Builder builder() { + return new Builder(); + } + /** * Builder for {@link BulkByScrollFailure}. */ - public static class Builder extends ObjectBuilderBase implements ObjectBuilder { + public static class Builder extends ObjectBuilderBase implements CopyableBuilder { @Nullable private ErrorCause cause; @Nullable @@ -213,9 +227,38 @@ public static class Builder extends ObjectBuilderBase implements ObjectBuilder> fn) { return cause(fn.apply(new ErrorCause.Builder()).build()); } @@ -231,6 +275,7 @@ public final Builder cause(Function> fn) { return reason(fn.apply(new ErrorCause.Builder()).build()); } @@ -270,6 +319,7 @@ public final Builder reason(Function { private final int batches; @@ -348,10 +353,21 @@ protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { // --------------------------------------------------------------------------------------------- + @Override + @Nonnull + public Builder toBuilder() { + return new Builder(this); + } + + @Nonnull + public static Builder builder() { + return new Builder(); + } + /** * Builder for {@link BulkByScrollTaskStatus}. */ - public static class Builder extends ObjectBuilderBase implements ObjectBuilder { + public static class Builder extends ObjectBuilderBase implements CopyableBuilder { private Integer batches; @Nullable private String canceled; @@ -376,12 +392,59 @@ public static class Builder extends ObjectBuilderBase implements ObjectBuilder * API name: {@code batches} *

*/ + @Nonnull public final Builder batches(int value) { this.batches = value; return this; @@ -390,6 +453,7 @@ public final Builder batches(int value) { /** * API name: {@code canceled} */ + @Nonnull public final Builder canceled(@Nullable String value) { this.canceled = value; return this; @@ -401,6 +465,7 @@ public final Builder canceled(@Nullable String value) { * API name: {@code created} *

*/ + @Nonnull public final Builder created(@Nullable Long value) { this.created = value; return this; @@ -412,6 +477,7 @@ public final Builder created(@Nullable Long value) { * API name: {@code deleted} *

*/ + @Nonnull public final Builder deleted(long value) { this.deleted = value; return this; @@ -423,6 +489,7 @@ public final Builder deleted(long value) { * API name: {@code noops} *

*/ + @Nonnull public final Builder noops(long value) { this.noops = value; return this; @@ -434,6 +501,7 @@ public final Builder noops(long value) { * API name: {@code requests_per_second} *

*/ + @Nonnull public final Builder requestsPerSecond(float value) { this.requestsPerSecond = value; return this; @@ -442,6 +510,7 @@ public final Builder requestsPerSecond(float value) { /** * Required - API name: {@code retries} */ + @Nonnull public final Builder retries(Retries value) { this.retries = value; return this; @@ -450,6 +519,7 @@ public final Builder retries(Retries value) { /** * Required - API name: {@code retries} */ + @Nonnull public final Builder retries(Function> fn) { return retries(fn.apply(new Retries.Builder()).build()); } @@ -457,6 +527,7 @@ public final Builder retries(Function> f /** * API name: {@code slice_id} */ + @Nonnull public final Builder sliceId(@Nullable Integer value) { this.sliceId = value; return this; @@ -469,6 +540,7 @@ public final Builder sliceId(@Nullable Integer value) { * Adds all elements of list to slices. *

*/ + @Nonnull public final Builder slices(List list) { this.slices = _listAddAll(this.slices, list); return this; @@ -481,6 +553,7 @@ public final Builder slices(List list) { * Adds one or more values to slices. *

*/ + @Nonnull public final Builder slices(BulkByScrollTaskStatusOrException value, BulkByScrollTaskStatusOrException... values) { this.slices = _listAdd(this.slices, value, values); return this; @@ -493,6 +566,7 @@ public final Builder slices(BulkByScrollTaskStatusOrException value, BulkByScrol * Adds a value to slices using a builder lambda. *

*/ + @Nonnull public final Builder slices( Function> fn ) { @@ -502,6 +576,7 @@ public final Builder slices( /** * API name: {@code throttled} */ + @Nonnull public final Builder throttled(@Nullable Time value) { this.throttled = value; return this; @@ -510,6 +585,7 @@ public final Builder throttled(@Nullable Time value) { /** * API name: {@code throttled} */ + @Nonnull public final Builder throttled(Function> fn) { return throttled(fn.apply(new Time.Builder()).build()); } @@ -517,6 +593,7 @@ public final Builder throttled(Function> fn) { /** * Required - API name: {@code throttled_millis} */ + @Nonnull public final Builder throttledMillis(long value) { this.throttledMillis = value; return this; @@ -525,6 +602,7 @@ public final Builder throttledMillis(long value) { /** * API name: {@code throttled_until} */ + @Nonnull public final Builder throttledUntil(@Nullable Time value) { this.throttledUntil = value; return this; @@ -533,6 +611,7 @@ public final Builder throttledUntil(@Nullable Time value) { /** * API name: {@code throttled_until} */ + @Nonnull public final Builder throttledUntil(Function> fn) { return throttledUntil(fn.apply(new Time.Builder()).build()); } @@ -540,6 +619,7 @@ public final Builder throttledUntil(Function> /** * Required - API name: {@code throttled_until_millis} */ + @Nonnull public final Builder throttledUntilMillis(long value) { this.throttledUntilMillis = value; return this; @@ -551,6 +631,7 @@ public final Builder throttledUntilMillis(long value) { * API name: {@code total} *

*/ + @Nonnull public final Builder total(long value) { this.total = value; return this; @@ -562,6 +643,7 @@ public final Builder total(long value) { * API name: {@code updated} *

*/ + @Nonnull public final Builder updated(@Nullable Long value) { this.updated = value; return this; @@ -573,6 +655,7 @@ public final Builder updated(@Nullable Long value) { * API name: {@code version_conflicts} *

*/ + @Nonnull public final Builder versionConflicts(long value) { this.versionConflicts = value; return this; @@ -583,6 +666,8 @@ public final Builder versionConflicts(long value) { * * @throws NullPointerException if some of the required fields are null. */ + @Override + @Nonnull public BulkByScrollTaskStatus build() { _checkSingleUse(); diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/ErrorCause.java b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/ErrorCause.java index 912a69c5c9..cf7142a23d 100644 --- a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/ErrorCause.java +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/ErrorCause.java @@ -53,14 +53,16 @@ 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: _types.ErrorCause @JsonpDeserializable @Generated("org.opensearch.client.codegen.CodeGenerator") -public class ErrorCause implements PlainJsonSerializable { +public class ErrorCause implements PlainJsonSerializable, ToCopyableBuilder { @Nullable private final ErrorCause causedBy; @@ -218,10 +220,21 @@ protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { // --------------------------------------------------------------------------------------------- + @Override + @Nonnull + public Builder toBuilder() { + return new Builder(this); + } + + @Nonnull + public static Builder builder() { + return new Builder(); + } + /** * Builder for {@link ErrorCause}. */ - public static class Builder extends ObjectBuilderBase implements ObjectBuilder { + public static class Builder extends ObjectBuilderBase implements CopyableBuilder { @Nullable private ErrorCause causedBy; @Nullable @@ -236,9 +249,38 @@ public static class Builder extends ObjectBuilderBase implements ObjectBuilder metadata; + public Builder() {} + + private Builder(ErrorCause o) { + this.causedBy = o.causedBy; + this.reason = o.reason; + this.rootCause = _listCopy(o.rootCause); + this.stackTrace = o.stackTrace; + this.suppressed = _listCopy(o.suppressed); + this.type = o.type; + this.metadata = _mapCopy(o.metadata); + } + + private Builder(Builder o) { + this.causedBy = o.causedBy; + this.reason = o.reason; + this.rootCause = _listCopy(o.rootCause); + this.stackTrace = o.stackTrace; + this.suppressed = _listCopy(o.suppressed); + this.type = o.type; + this.metadata = _mapCopy(o.metadata); + } + + @Override + @Nonnull + public Builder copy() { + return new Builder(this); + } + /** * API name: {@code caused_by} */ + @Nonnull public final Builder causedBy(@Nullable ErrorCause value) { this.causedBy = value; return this; @@ -247,6 +289,7 @@ public final Builder causedBy(@Nullable ErrorCause value) { /** * API name: {@code caused_by} */ + @Nonnull public final Builder causedBy(Function> fn) { return causedBy(fn.apply(new ErrorCause.Builder()).build()); } @@ -257,6 +300,7 @@ public final Builder causedBy(Function */ + @Nonnull public final Builder reason(@Nullable String value) { this.reason = value; return this; @@ -269,6 +313,7 @@ public final Builder reason(@Nullable String value) { * Adds all elements of list to rootCause. *

*/ + @Nonnull public final Builder rootCause(List list) { this.rootCause = _listAddAll(this.rootCause, list); return this; @@ -281,6 +326,7 @@ public final Builder rootCause(List list) { * Adds one or more values to rootCause. *

*/ + @Nonnull public final Builder rootCause(ErrorCause value, ErrorCause... values) { this.rootCause = _listAdd(this.rootCause, value, values); return this; @@ -293,6 +339,7 @@ public final Builder rootCause(ErrorCause value, ErrorCause... values) { * Adds a value to rootCause using a builder lambda. *

*/ + @Nonnull public final Builder rootCause(Function> fn) { return rootCause(fn.apply(new ErrorCause.Builder()).build()); } @@ -303,6 +350,7 @@ public final Builder rootCause(Function */ + @Nonnull public final Builder stackTrace(@Nullable String value) { this.stackTrace = value; return this; @@ -315,6 +363,7 @@ public final Builder stackTrace(@Nullable String value) { * Adds all elements of list to suppressed. *

*/ + @Nonnull public final Builder suppressed(List list) { this.suppressed = _listAddAll(this.suppressed, list); return this; @@ -327,6 +376,7 @@ public final Builder suppressed(List list) { * Adds one or more values to suppressed. *

*/ + @Nonnull public final Builder suppressed(ErrorCause value, ErrorCause... values) { this.suppressed = _listAdd(this.suppressed, value, values); return this; @@ -339,6 +389,7 @@ public final Builder suppressed(ErrorCause value, ErrorCause... values) { * Adds a value to suppressed using a builder lambda. *

*/ + @Nonnull public final Builder suppressed(Function> fn) { return suppressed(fn.apply(new ErrorCause.Builder()).build()); } @@ -349,6 +400,7 @@ public final Builder suppressed(Function */ + @Nonnull public final Builder type(String value) { this.type = value; return this; @@ -361,6 +413,7 @@ public final Builder type(String value) { * Adds all elements of map to metadata. *

*/ + @Nonnull public final Builder metadata(Map map) { this.metadata = _mapPutAll(this.metadata, map); return this; @@ -373,6 +426,7 @@ public final Builder metadata(Map map) { * Adds an entry to metadata. *

*/ + @Nonnull public final Builder metadata(String key, JsonData value) { this.metadata = _mapPut(this.metadata, key, value); return this; @@ -383,6 +437,8 @@ public final Builder metadata(String key, JsonData value) { * * @throws NullPointerException if some of the required fields are null. */ + @Override + @Nonnull public ErrorCause build() { _checkSingleUse(); diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/GeoHashLocation.java b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/GeoHashLocation.java index f37286c733..1f22b2f1ee 100644 --- a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/GeoHashLocation.java +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/GeoHashLocation.java @@ -47,14 +47,16 @@ 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: _types.GeoHashLocation @JsonpDeserializable @Generated("org.opensearch.client.codegen.CodeGenerator") -public class GeoHashLocation implements PlainJsonSerializable { +public class GeoHashLocation implements PlainJsonSerializable, ToCopyableBuilder { @Nonnull private final String geohash; @@ -94,15 +96,43 @@ protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { // --------------------------------------------------------------------------------------------- + @Override + @Nonnull + public Builder toBuilder() { + return new Builder(this); + } + + @Nonnull + public static Builder builder() { + return new Builder(); + } + /** * Builder for {@link GeoHashLocation}. */ - public static class Builder extends ObjectBuilderBase implements ObjectBuilder { + public static class Builder extends ObjectBuilderBase implements CopyableBuilder { private String geohash; + public Builder() {} + + private Builder(GeoHashLocation o) { + this.geohash = o.geohash; + } + + private Builder(Builder o) { + this.geohash = o.geohash; + } + + @Override + @Nonnull + public Builder copy() { + return new Builder(this); + } + /** * Required - API name: {@code geohash} */ + @Nonnull public final Builder geohash(String value) { this.geohash = value; return this; @@ -113,6 +143,8 @@ public final Builder geohash(String value) { * * @throws NullPointerException if some of the required fields are null. */ + @Override + @Nonnull public GeoHashLocation build() { _checkSingleUse(); diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/IndicesResponseBase.java b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/IndicesResponseBase.java index 3308f0c8b5..4acf5c0423 100644 --- a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/IndicesResponseBase.java +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/IndicesResponseBase.java @@ -40,6 +40,7 @@ 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.JsonpMapper; import org.opensearch.client.json.ObjectDeserializer; @@ -83,9 +84,22 @@ protected abstract static class AbstractBuilder o) { + super(o); + this.shards = o.shards; + } + /** * API name: {@code _shards} */ + @Nonnull public final BuilderT shards(@Nullable ShardStatistics value) { this.shards = value; return self(); @@ -94,6 +108,7 @@ public final BuilderT shards(@Nullable ShardStatistics value) { /** * API name: {@code _shards} */ + @Nonnull public final BuilderT shards(Function> fn) { return shards(fn.apply(new ShardStatistics.Builder()).build()); } diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/InlineScript.java b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/InlineScript.java index fd2cde01a6..1ca9006ee2 100644 --- a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/InlineScript.java +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/InlineScript.java @@ -49,13 +49,15 @@ import org.opensearch.client.json.ObjectBuilderDeserializer; import org.opensearch.client.json.ObjectDeserializer; import org.opensearch.client.util.ApiTypeHelper; +import org.opensearch.client.util.CopyableBuilder; import org.opensearch.client.util.ObjectBuilder; +import org.opensearch.client.util.ToCopyableBuilder; // typedef: _types.InlineScript @JsonpDeserializable @Generated("org.opensearch.client.codegen.CodeGenerator") -public class InlineScript extends ScriptBase { +public class InlineScript extends ScriptBase implements ToCopyableBuilder { @Nullable private final ScriptLanguage lang; @@ -129,19 +131,59 @@ protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { // --------------------------------------------------------------------------------------------- + @Override + @Nonnull + public Builder toBuilder() { + return new Builder(this); + } + + @Nonnull + public static Builder builder() { + return new Builder(); + } + /** * Builder for {@link InlineScript}. */ - public static class Builder extends ScriptBase.AbstractBuilder implements ObjectBuilder { + public static class Builder extends ScriptBase.AbstractBuilder implements CopyableBuilder { @Nullable private ScriptLanguage lang; @Nullable private Map options; private String source; + public Builder() {} + + private Builder(InlineScript o) { + super(o); + this.lang = o.lang; + this.options = _mapCopy(o.options); + this.source = o.source; + } + + private Builder(Builder o) { + super(o); + this.lang = o.lang; + this.options = _mapCopy(o.options); + this.source = o.source; + } + + @Override + @Nonnull + public Builder copy() { + return new Builder(this); + } + + @Override + @Nonnull + protected Builder self() { + return this; + } + /** * API name: {@code lang} */ + @Nonnull public final Builder lang(@Nullable ScriptLanguage value) { this.lang = value; return this; @@ -150,6 +192,7 @@ public final Builder lang(@Nullable ScriptLanguage value) { /** * API name: {@code lang} */ + @Nonnull public final Builder lang(Function> fn) { return lang(fn.apply(new ScriptLanguage.Builder()).build()); } @@ -161,6 +204,7 @@ public final Builder lang(Functionmap to options. *

*/ + @Nonnull public final Builder options(Map map) { this.options = _mapPutAll(this.options, map); return this; @@ -173,6 +217,7 @@ public final Builder options(Map map) { * Adds an entry to options. *

*/ + @Nonnull public final Builder options(String key, String value) { this.options = _mapPut(this.options, key, value); return this; @@ -184,21 +229,19 @@ public final Builder options(String key, String value) { * API name: {@code source} *

*/ + @Nonnull public final Builder source(String value) { this.source = value; return this; } - @Override - protected Builder self() { - return this; - } - /** * Builds a {@link InlineScript}. * * @throws NullPointerException if some of the required fields are null. */ + @Override + @Nonnull public InlineScript build() { _checkSingleUse(); diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/LatLonGeoLocation.java b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/LatLonGeoLocation.java index bfbe518695..4c9a0fcebe 100644 --- a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/LatLonGeoLocation.java +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/LatLonGeoLocation.java @@ -39,6 +39,7 @@ 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; @@ -46,14 +47,16 @@ 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: _types.LatLonGeoLocation @JsonpDeserializable @Generated("org.opensearch.client.codegen.CodeGenerator") -public class LatLonGeoLocation implements PlainJsonSerializable { +public class LatLonGeoLocation implements PlainJsonSerializable, ToCopyableBuilder { private final double lat; @@ -110,19 +113,49 @@ protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { // --------------------------------------------------------------------------------------------- + @Override + @Nonnull + public Builder toBuilder() { + return new Builder(this); + } + + @Nonnull + public static Builder builder() { + return new Builder(); + } + /** * Builder for {@link LatLonGeoLocation}. */ - public static class Builder extends ObjectBuilderBase implements ObjectBuilder { + public static class Builder extends ObjectBuilderBase implements CopyableBuilder { private Double lat; private Double lon; + public Builder() {} + + private Builder(LatLonGeoLocation o) { + this.lat = o.lat; + this.lon = o.lon; + } + + private Builder(Builder o) { + this.lat = o.lat; + this.lon = o.lon; + } + + @Override + @Nonnull + public Builder copy() { + return new Builder(this); + } + /** * Required - Latitude *

* API name: {@code lat} *

*/ + @Nonnull public final Builder lat(double value) { this.lat = value; return this; @@ -134,6 +167,7 @@ public final Builder lat(double value) { * API name: {@code lon} *

*/ + @Nonnull public final Builder lon(double value) { this.lon = value; return this; @@ -144,6 +178,8 @@ public final Builder lon(double value) { * * @throws NullPointerException if some of the required fields are null. */ + @Override + @Nonnull public LatLonGeoLocation build() { _checkSingleUse(); diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/NodeStatistics.java b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/NodeStatistics.java index ae9635e172..6e19be6b1b 100644 --- a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/NodeStatistics.java +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/NodeStatistics.java @@ -50,14 +50,16 @@ 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: _types.NodeStatistics @JsonpDeserializable @Generated("org.opensearch.client.codegen.CodeGenerator") -public class NodeStatistics implements PlainJsonSerializable { +public class NodeStatistics implements PlainJsonSerializable, ToCopyableBuilder { private final int failed; @@ -152,16 +154,49 @@ protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { // --------------------------------------------------------------------------------------------- + @Override + @Nonnull + public Builder toBuilder() { + return new Builder(this); + } + + @Nonnull + public static Builder builder() { + return new Builder(); + } + /** * Builder for {@link NodeStatistics}. */ - public static class Builder extends ObjectBuilderBase implements ObjectBuilder { + public static class Builder extends ObjectBuilderBase implements CopyableBuilder { private Integer failed; @Nullable private List failures; private Integer successful; private Integer total; + public Builder() {} + + private Builder(NodeStatistics o) { + this.failed = o.failed; + this.failures = _listCopy(o.failures); + this.successful = o.successful; + this.total = o.total; + } + + private Builder(Builder o) { + this.failed = o.failed; + this.failures = _listCopy(o.failures); + this.successful = o.successful; + this.total = o.total; + } + + @Override + @Nonnull + public Builder copy() { + return new Builder(this); + } + /** * Required - The number of nodes that rejected the request or failed to respond. If this value is not 0, then a reason for the * rejection or failure is included in the response. @@ -169,6 +204,7 @@ public static class Builder extends ObjectBuilderBase implements ObjectBuilder */ + @Nonnull public final Builder failed(int value) { this.failed = value; return this; @@ -181,6 +217,7 @@ public final Builder failed(int value) { * Adds all elements of list to failures. *

*/ + @Nonnull public final Builder failures(List list) { this.failures = _listAddAll(this.failures, list); return this; @@ -193,6 +230,7 @@ public final Builder failures(List list) { * Adds one or more values to failures. *

*/ + @Nonnull public final Builder failures(ErrorCause value, ErrorCause... values) { this.failures = _listAdd(this.failures, value, values); return this; @@ -205,6 +243,7 @@ public final Builder failures(ErrorCause value, ErrorCause... values) { * Adds a value to failures using a builder lambda. *

*/ + @Nonnull public final Builder failures(Function> fn) { return failures(fn.apply(new ErrorCause.Builder()).build()); } @@ -215,6 +254,7 @@ public final Builder failures(Function */ + @Nonnull public final Builder successful(int value) { this.successful = value; return this; @@ -226,6 +266,7 @@ public final Builder successful(int value) { * API name: {@code total} *

*/ + @Nonnull public final Builder total(int value) { this.total = value; return this; @@ -236,6 +277,8 @@ public final Builder total(int value) { * * @throws NullPointerException if some of the required fields are null. */ + @Override + @Nonnull public NodeStatistics build() { _checkSingleUse(); diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/OpenSearchVersionInfo.java b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/OpenSearchVersionInfo.java index b6fcfb9eab..964254af0c 100644 --- a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/OpenSearchVersionInfo.java +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/OpenSearchVersionInfo.java @@ -49,14 +49,19 @@ 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: _types.OpenSearchVersionInfo @JsonpDeserializable @Generated("org.opensearch.client.codegen.CodeGenerator") -public class OpenSearchVersionInfo implements PlainJsonSerializable { +public class OpenSearchVersionInfo + implements + PlainJsonSerializable, + ToCopyableBuilder { @Nonnull private final String buildDate; @@ -239,10 +244,21 @@ protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { // --------------------------------------------------------------------------------------------- + @Override + @Nonnull + public Builder toBuilder() { + return new Builder(this); + } + + @Nonnull + public static Builder builder() { + return new Builder(); + } + /** * Builder for {@link OpenSearchVersionInfo}. */ - public static class Builder extends ObjectBuilderBase implements ObjectBuilder { + public static class Builder extends ObjectBuilderBase implements CopyableBuilder { private String buildDate; @Nullable private String buildFlavor; @@ -255,9 +271,44 @@ public static class Builder extends ObjectBuilderBase implements ObjectBuilder { private final long bulk; @@ -104,16 +107,46 @@ protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { // --------------------------------------------------------------------------------------------- + @Override + @Nonnull + public Builder toBuilder() { + return new Builder(this); + } + + @Nonnull + public static Builder builder() { + return new Builder(); + } + /** * Builder for {@link Retries}. */ - public static class Builder extends ObjectBuilderBase implements ObjectBuilder { + public static class Builder extends ObjectBuilderBase implements CopyableBuilder { private Long bulk; private Long search; + public Builder() {} + + private Builder(Retries o) { + this.bulk = o.bulk; + this.search = o.search; + } + + private Builder(Builder o) { + this.bulk = o.bulk; + this.search = o.search; + } + + @Override + @Nonnull + public Builder copy() { + return new Builder(this); + } + /** * Required - API name: {@code bulk} */ + @Nonnull public final Builder bulk(long value) { this.bulk = value; return this; @@ -122,6 +155,7 @@ public final Builder bulk(long value) { /** * Required - API name: {@code search} */ + @Nonnull public final Builder search(long value) { this.search = value; return this; @@ -132,6 +166,8 @@ public final Builder search(long value) { * * @throws NullPointerException if some of the required fields are null. */ + @Override + @Nonnull public Retries build() { _checkSingleUse(); diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/ScriptBase.java b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/ScriptBase.java index 787f086689..1178b7dc27 100644 --- a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/ScriptBase.java +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/ScriptBase.java @@ -104,6 +104,19 @@ protected abstract static class AbstractBuilder params; + protected AbstractBuilder() {} + + protected AbstractBuilder(ScriptBase o) { + this.params = _mapCopy(o.params); + } + + protected AbstractBuilder(AbstractBuilder o) { + this.params = _mapCopy(o.params); + } + + @Nonnull + protected abstract BuilderT self(); + /** * Specifies any named parameters that are passed into the script as variables. Use parameters instead of hard-coded values to * decrease compilation time. @@ -115,6 +128,7 @@ protected abstract static class AbstractBuildermap to params. *

*/ + @Nonnull public final BuilderT params(Map map) { this.params = _mapPutAll(this.params, map); return self(); @@ -131,12 +145,12 @@ public final BuilderT params(Map map) { * Adds an entry to params. *

*/ + @Nonnull public final BuilderT params(String key, JsonData value) { this.params = _mapPut(this.params, key, value); return self(); } - protected abstract BuilderT self(); } // --------------------------------------------------------------------------------------------- diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/ShardFailure.java b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/ShardFailure.java index eecec2fe8c..c8dd0863ec 100644 --- a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/ShardFailure.java +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/ShardFailure.java @@ -49,14 +49,16 @@ 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: _types.ShardFailure @JsonpDeserializable @Generated("org.opensearch.client.codegen.CodeGenerator") -public class ShardFailure implements PlainJsonSerializable { +public class ShardFailure implements PlainJsonSerializable, ToCopyableBuilder { @Nullable private final String index; @@ -160,10 +162,21 @@ protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { // --------------------------------------------------------------------------------------------- + @Override + @Nonnull + public Builder toBuilder() { + return new Builder(this); + } + + @Nonnull + public static Builder builder() { + return new Builder(); + } + /** * Builder for {@link ShardFailure}. */ - public static class Builder extends ObjectBuilderBase implements ObjectBuilder { + public static class Builder extends ObjectBuilderBase implements CopyableBuilder { @Nullable private String index; @Nullable @@ -173,9 +186,34 @@ public static class Builder extends ObjectBuilderBase implements ObjectBuilder> fn) { return reason(fn.apply(new ErrorCause.Builder()).build()); } @@ -207,6 +248,7 @@ public final Builder reason(Function { private final int failed; @@ -159,10 +161,21 @@ protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { // --------------------------------------------------------------------------------------------- + @Override + @Nonnull + public Builder toBuilder() { + return new Builder(this); + } + + @Nonnull + public static Builder builder() { + return new Builder(); + } + /** * Builder for {@link ShardStatistics}. */ - public static class Builder extends ObjectBuilderBase implements ObjectBuilder { + public static class Builder extends ObjectBuilderBase implements CopyableBuilder { private Integer failed; @Nullable private List failures; @@ -171,9 +184,34 @@ public static class Builder extends ObjectBuilderBase implements ObjectBuilderlist to failures. *

*/ + @Nonnull public final Builder failures(List list) { this.failures = _listAddAll(this.failures, list); return this; @@ -198,6 +237,7 @@ public final Builder failures(List list) { * Adds one or more values to failures. *

*/ + @Nonnull public final Builder failures(ShardFailure value, ShardFailure... values) { this.failures = _listAdd(this.failures, value, values); return this; @@ -210,6 +250,7 @@ public final Builder failures(ShardFailure value, ShardFailure... values) { * Adds a value to failures using a builder lambda. *

*/ + @Nonnull public final Builder failures(Function> fn) { return failures(fn.apply(new ShardFailure.Builder()).build()); } @@ -217,6 +258,7 @@ public final Builder failures(Function { @Nonnull private final String id; @@ -84,30 +86,63 @@ protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { // --------------------------------------------------------------------------------------------- + @Override + @Nonnull + public Builder toBuilder() { + return new Builder(this); + } + + @Nonnull + public static Builder builder() { + return new Builder(); + } + /** * Builder for {@link StoredScriptId}. */ - public static class Builder extends ScriptBase.AbstractBuilder implements ObjectBuilder { + public static class Builder extends ScriptBase.AbstractBuilder implements CopyableBuilder { private String id; + public Builder() {} + + private Builder(StoredScriptId o) { + super(o); + this.id = o.id; + } + + private Builder(Builder o) { + super(o); + this.id = o.id; + } + + @Override + @Nonnull + public Builder copy() { + return new Builder(this); + } + + @Override + @Nonnull + protected Builder self() { + return this; + } + /** * Required - API name: {@code id} */ + @Nonnull public final Builder id(String value) { this.id = value; return this; } - @Override - protected Builder self() { - return this; - } - /** * Builds a {@link StoredScriptId}. * * @throws NullPointerException if some of the required fields are null. */ + @Override + @Nonnull public StoredScriptId build() { _checkSingleUse(); diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/TaskFailure.java b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/TaskFailure.java index 73be11b4d2..558f1462b9 100644 --- a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/TaskFailure.java +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/TaskFailure.java @@ -47,14 +47,16 @@ 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: _types.TaskFailure @JsonpDeserializable @Generated("org.opensearch.client.codegen.CodeGenerator") -public class TaskFailure implements PlainJsonSerializable { +public class TaskFailure implements PlainJsonSerializable, ToCopyableBuilder { @Nonnull private final String nodeId; @@ -137,18 +139,52 @@ protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { // --------------------------------------------------------------------------------------------- + @Override + @Nonnull + public Builder toBuilder() { + return new Builder(this); + } + + @Nonnull + public static Builder builder() { + return new Builder(); + } + /** * Builder for {@link TaskFailure}. */ - public static class Builder extends ObjectBuilderBase implements ObjectBuilder { + public static class Builder extends ObjectBuilderBase implements CopyableBuilder { private String nodeId; private ErrorCause reason; private String status; private Integer taskId; + public Builder() {} + + private Builder(TaskFailure o) { + this.nodeId = o.nodeId; + this.reason = o.reason; + this.status = o.status; + this.taskId = o.taskId; + } + + private Builder(Builder o) { + this.nodeId = o.nodeId; + this.reason = o.reason; + this.status = o.status; + this.taskId = o.taskId; + } + + @Override + @Nonnull + public Builder copy() { + return new Builder(this); + } + /** * Required - API name: {@code node_id} */ + @Nonnull public final Builder nodeId(String value) { this.nodeId = value; return this; @@ -157,6 +193,7 @@ public final Builder nodeId(String value) { /** * Required - API name: {@code reason} */ + @Nonnull public final Builder reason(ErrorCause value) { this.reason = value; return this; @@ -165,6 +202,7 @@ public final Builder reason(ErrorCause value) { /** * Required - API name: {@code reason} */ + @Nonnull public final Builder reason(Function> fn) { return reason(fn.apply(new ErrorCause.Builder()).build()); } @@ -172,6 +210,7 @@ public final Builder reason(Function o) { + this.forcedRefresh = o.forcedRefresh; + this.id = o.id; + this.index = o.index; + this.primaryTerm = o.primaryTerm; + this.result = o.result; + this.seqNo = o.seqNo; + this.shards = o.shards; + this.version = o.version; + } + + @Nonnull + protected abstract BuilderT self(); + /** * API name: {@code forced_refresh} */ + @Nonnull public final BuilderT forcedRefresh(@Nullable Boolean value) { this.forcedRefresh = value; return self(); @@ -212,6 +240,7 @@ public final BuilderT forcedRefresh(@Nullable Boolean value) { /** * Required - API name: {@code _id} */ + @Nonnull public final BuilderT id(String value) { this.id = value; return self(); @@ -220,6 +249,7 @@ public final BuilderT id(String value) { /** * Required - API name: {@code _index} */ + @Nonnull public final BuilderT index(String value) { this.index = value; return self(); @@ -228,6 +258,7 @@ public final BuilderT index(String value) { /** * Required - API name: {@code _primary_term} */ + @Nonnull public final BuilderT primaryTerm(long value) { this.primaryTerm = value; return self(); @@ -236,6 +267,7 @@ public final BuilderT primaryTerm(long value) { /** * Required - API name: {@code result} */ + @Nonnull public final BuilderT result(Result value) { this.result = value; return self(); @@ -244,6 +276,7 @@ public final BuilderT result(Result value) { /** * Required - API name: {@code _seq_no} */ + @Nonnull public final BuilderT seqNo(long value) { this.seqNo = value; return self(); @@ -252,6 +285,7 @@ public final BuilderT seqNo(long value) { /** * Required - API name: {@code _shards} */ + @Nonnull public final BuilderT shards(ShardStatistics value) { this.shards = value; return self(); @@ -260,6 +294,7 @@ public final BuilderT shards(ShardStatistics value) { /** * Required - API name: {@code _shards} */ + @Nonnull public final BuilderT shards(Function> fn) { return shards(fn.apply(new ShardStatistics.Builder()).build()); } @@ -267,12 +302,12 @@ public final BuilderT shards(Function { private final double x; @@ -86,19 +92,49 @@ protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { // --------------------------------------------------------------------------------------------- + @Override + @Nonnull + public Builder toBuilder() { + return new Builder(this); + } + + @Nonnull + public static Builder builder() { + return new Builder(); + } + /** * Builder for {@link XyCartesianCoordinates}. */ - public static class Builder extends ObjectBuilderBase implements ObjectBuilder { + public static class Builder extends ObjectBuilderBase implements CopyableBuilder { private Double x; private Double y; + public Builder() {} + + private Builder(XyCartesianCoordinates o) { + this.x = o.x; + this.y = o.y; + } + + private Builder(Builder o) { + this.x = o.x; + this.y = o.y; + } + + @Override + @Nonnull + public Builder copy() { + return new Builder(this); + } + /** * Required - The x coordinate. *

* API name: {@code x} *

*/ + @Nonnull public final Builder x(double value) { this.x = value; return this; @@ -110,6 +146,7 @@ public final Builder x(double value) { * API name: {@code y} *

*/ + @Nonnull public final Builder y(double value) { this.y = value; return this; @@ -120,6 +157,8 @@ public final Builder y(double value) { * * @throws NullPointerException if some of the required fields are null. */ + @Override + @Nonnull public XyCartesianCoordinates build() { _checkSingleUse(); diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/analysis/AsciiFoldingTokenFilter.java b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/analysis/AsciiFoldingTokenFilter.java index 66e859ba78..66c9f8a4e6 100644 --- a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/analysis/AsciiFoldingTokenFilter.java +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/analysis/AsciiFoldingTokenFilter.java @@ -40,19 +40,25 @@ 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.util.CopyableBuilder; import org.opensearch.client.util.ObjectBuilder; +import org.opensearch.client.util.ToCopyableBuilder; // typedef: _types.analysis.AsciiFoldingTokenFilter @JsonpDeserializable @Generated("org.opensearch.client.codegen.CodeGenerator") -public class AsciiFoldingTokenFilter extends TokenFilterBase implements TokenFilterDefinitionVariant { +public class AsciiFoldingTokenFilter extends TokenFilterBase + implements + TokenFilterDefinitionVariant, + ToCopyableBuilder { @Nullable private final Boolean preserveOriginal; @@ -95,31 +101,66 @@ protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { // --------------------------------------------------------------------------------------------- + @Override + @Nonnull + public Builder toBuilder() { + return new Builder(this); + } + + @Nonnull + public static Builder builder() { + return new Builder(); + } + /** * Builder for {@link AsciiFoldingTokenFilter}. */ - public static class Builder extends TokenFilterBase.AbstractBuilder implements ObjectBuilder { + public static class Builder extends TokenFilterBase.AbstractBuilder + implements + CopyableBuilder { @Nullable private Boolean preserveOriginal; + public Builder() {} + + private Builder(AsciiFoldingTokenFilter o) { + super(o); + this.preserveOriginal = o.preserveOriginal; + } + + private Builder(Builder o) { + super(o); + this.preserveOriginal = o.preserveOriginal; + } + + @Override + @Nonnull + public Builder copy() { + return new Builder(this); + } + + @Override + @Nonnull + protected Builder self() { + return this; + } + /** * API name: {@code preserve_original} */ + @Nonnull public final Builder preserveOriginal(@Nullable Boolean value) { this.preserveOriginal = value; return this; } - @Override - protected Builder self() { - return this; - } - /** * Builds a {@link AsciiFoldingTokenFilter}. * * @throws NullPointerException if some of the required fields are null. */ + @Override + @Nonnull public AsciiFoldingTokenFilter build() { _checkSingleUse(); diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/analysis/CharFilterBase.java b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/analysis/CharFilterBase.java index 1bea5b8ef0..c95f2d51b8 100644 --- a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/analysis/CharFilterBase.java +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/analysis/CharFilterBase.java @@ -39,6 +39,7 @@ import jakarta.json.stream.JsonGenerator; import java.util.Objects; import javax.annotation.Generated; +import javax.annotation.Nonnull; import javax.annotation.Nullable; import org.opensearch.client.json.JsonpDeserializer; import org.opensearch.client.json.JsonpMapper; @@ -91,15 +92,28 @@ protected abstract static class AbstractBuilder o) { + this.version = o.version; + } + + @Nonnull + protected abstract BuilderT self(); + /** * API name: {@code version} */ + @Nonnull public final BuilderT version(@Nullable String value) { this.version = value; return self(); } - protected abstract BuilderT self(); } // --------------------------------------------------------------------------------------------- diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/analysis/CharGroupTokenizer.java b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/analysis/CharGroupTokenizer.java index 7395b6c383..b3436e47d3 100644 --- a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/analysis/CharGroupTokenizer.java +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/analysis/CharGroupTokenizer.java @@ -49,13 +49,18 @@ import org.opensearch.client.json.ObjectBuilderDeserializer; import org.opensearch.client.json.ObjectDeserializer; import org.opensearch.client.util.ApiTypeHelper; +import org.opensearch.client.util.CopyableBuilder; import org.opensearch.client.util.ObjectBuilder; +import org.opensearch.client.util.ToCopyableBuilder; // typedef: _types.analysis.CharGroupTokenizer @JsonpDeserializable @Generated("org.opensearch.client.codegen.CodeGenerator") -public class CharGroupTokenizer extends TokenizerBase implements TokenizerDefinitionVariant { +public class CharGroupTokenizer extends TokenizerBase + implements + TokenizerDefinitionVariant, + ToCopyableBuilder { @Nullable private final Integer maxTokenLength; @@ -117,17 +122,55 @@ protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { // --------------------------------------------------------------------------------------------- + @Override + @Nonnull + public Builder toBuilder() { + return new Builder(this); + } + + @Nonnull + public static Builder builder() { + return new Builder(); + } + /** * Builder for {@link CharGroupTokenizer}. */ - public static class Builder extends TokenizerBase.AbstractBuilder implements ObjectBuilder { + public static class Builder extends TokenizerBase.AbstractBuilder implements CopyableBuilder { @Nullable private Integer maxTokenLength; private List tokenizeOnChars; + public Builder() {} + + private Builder(CharGroupTokenizer o) { + super(o); + this.maxTokenLength = o.maxTokenLength; + this.tokenizeOnChars = _listCopy(o.tokenizeOnChars); + } + + private Builder(Builder o) { + super(o); + this.maxTokenLength = o.maxTokenLength; + this.tokenizeOnChars = _listCopy(o.tokenizeOnChars); + } + + @Override + @Nonnull + public Builder copy() { + return new Builder(this); + } + + @Override + @Nonnull + protected Builder self() { + return this; + } + /** * API name: {@code max_token_length} */ + @Nonnull public final Builder maxTokenLength(@Nullable Integer value) { this.maxTokenLength = value; return this; @@ -140,6 +183,7 @@ public final Builder maxTokenLength(@Nullable Integer value) { * Adds all elements of list to tokenizeOnChars. *

*/ + @Nonnull public final Builder tokenizeOnChars(List list) { this.tokenizeOnChars = _listAddAll(this.tokenizeOnChars, list); return this; @@ -152,21 +196,19 @@ public final Builder tokenizeOnChars(List list) { * Adds one or more values to tokenizeOnChars. *

*/ + @Nonnull public final Builder tokenizeOnChars(String value, String... values) { this.tokenizeOnChars = _listAdd(this.tokenizeOnChars, value, values); return this; } - @Override - protected Builder self() { - return this; - } - /** * Builds a {@link CharGroupTokenizer}. * * @throws NullPointerException if some of the required fields are null. */ + @Override + @Nonnull public CharGroupTokenizer build() { _checkSingleUse(); diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/analysis/CjkAnalyzer.java b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/analysis/CjkAnalyzer.java index 2f14edda25..bc930fd262 100644 --- a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/analysis/CjkAnalyzer.java +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/analysis/CjkAnalyzer.java @@ -26,14 +26,16 @@ 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: _types.analysis.CjkAnalyzer @JsonpDeserializable @Generated("org.opensearch.client.codegen.CodeGenerator") -public class CjkAnalyzer implements AnalyzerVariant, PlainJsonSerializable { +public class CjkAnalyzer implements AnalyzerVariant, PlainJsonSerializable, ToCopyableBuilder { @Nonnull private final List stopwords; @@ -105,15 +107,44 @@ protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { // --------------------------------------------------------------------------------------------- + @Override + @Nonnull + public Builder toBuilder() { + return new Builder(this); + } + + @Nonnull + public static Builder builder() { + return new Builder(); + } + /** * Builder for {@link CjkAnalyzer}. */ - public static class Builder extends ObjectBuilderBase implements ObjectBuilder { + public static class Builder extends ObjectBuilderBase implements CopyableBuilder { @Nullable private List stopwords; @Nullable private String stopwordsPath; + public Builder() {} + + private Builder(CjkAnalyzer o) { + this.stopwords = _listCopy(o.stopwords); + this.stopwordsPath = o.stopwordsPath; + } + + private Builder(Builder o) { + this.stopwords = _listCopy(o.stopwords); + this.stopwordsPath = o.stopwordsPath; + } + + @Override + @Nonnull + public Builder copy() { + return new Builder(this); + } + /** * API name: {@code stopwords} * @@ -121,6 +152,7 @@ public static class Builder extends ObjectBuilderBase implements ObjectBuilderlist to stopwords. *

*/ + @Nonnull public final Builder stopwords(List list) { this.stopwords = _listAddAll(this.stopwords, list); return this; @@ -133,6 +165,7 @@ public final Builder stopwords(List list) { * Adds one or more values to stopwords. *

*/ + @Nonnull public final Builder stopwords(String value, String... values) { this.stopwords = _listAdd(this.stopwords, value, values); return this; @@ -141,6 +174,7 @@ public final Builder stopwords(String value, String... values) { /** * API name: {@code stopwords_path} */ + @Nonnull public final Builder stopwordsPath(@Nullable String value) { this.stopwordsPath = value; return this; @@ -151,6 +185,8 @@ public final Builder stopwordsPath(@Nullable String value) { * * @throws NullPointerException if some of the required fields are null. */ + @Override + @Nonnull public CjkAnalyzer build() { _checkSingleUse(); diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/analysis/CommonGramsTokenFilter.java b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/analysis/CommonGramsTokenFilter.java index 959f5e873f..8b7302fe2e 100644 --- a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/analysis/CommonGramsTokenFilter.java +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/analysis/CommonGramsTokenFilter.java @@ -49,13 +49,18 @@ import org.opensearch.client.json.ObjectBuilderDeserializer; import org.opensearch.client.json.ObjectDeserializer; import org.opensearch.client.util.ApiTypeHelper; +import org.opensearch.client.util.CopyableBuilder; import org.opensearch.client.util.ObjectBuilder; +import org.opensearch.client.util.ToCopyableBuilder; // typedef: _types.analysis.CommonGramsTokenFilter @JsonpDeserializable @Generated("org.opensearch.client.codegen.CodeGenerator") -public class CommonGramsTokenFilter extends TokenFilterBase implements TokenFilterDefinitionVariant { +public class CommonGramsTokenFilter extends TokenFilterBase + implements + TokenFilterDefinitionVariant, + ToCopyableBuilder { @Nonnull private final List commonWords; @@ -153,10 +158,23 @@ protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { // --------------------------------------------------------------------------------------------- + @Override + @Nonnull + public Builder toBuilder() { + return new Builder(this); + } + + @Nonnull + public static Builder builder() { + return new Builder(); + } + /** * Builder for {@link CommonGramsTokenFilter}. */ - public static class Builder extends TokenFilterBase.AbstractBuilder implements ObjectBuilder { + public static class Builder extends TokenFilterBase.AbstractBuilder + implements + CopyableBuilder { @Nullable private List commonWords; @Nullable @@ -166,6 +184,36 @@ public static class Builder extends TokenFilterBase.AbstractBuilder imp @Nullable private Boolean queryMode; + public Builder() {} + + private Builder(CommonGramsTokenFilter o) { + super(o); + this.commonWords = _listCopy(o.commonWords); + this.commonWordsPath = o.commonWordsPath; + this.ignoreCase = o.ignoreCase; + this.queryMode = o.queryMode; + } + + private Builder(Builder o) { + super(o); + this.commonWords = _listCopy(o.commonWords); + this.commonWordsPath = o.commonWordsPath; + this.ignoreCase = o.ignoreCase; + this.queryMode = o.queryMode; + } + + @Override + @Nonnull + public Builder copy() { + return new Builder(this); + } + + @Override + @Nonnull + protected Builder self() { + return this; + } + /** * API name: {@code common_words} * @@ -173,6 +221,7 @@ public static class Builder extends TokenFilterBase.AbstractBuilder imp * Adds all elements of list to commonWords. *

*/ + @Nonnull public final Builder commonWords(List list) { this.commonWords = _listAddAll(this.commonWords, list); return this; @@ -185,6 +234,7 @@ public final Builder commonWords(List list) { * Adds one or more values to commonWords. *

*/ + @Nonnull public final Builder commonWords(String value, String... values) { this.commonWords = _listAdd(this.commonWords, value, values); return this; @@ -193,6 +243,7 @@ public final Builder commonWords(String value, String... values) { /** * API name: {@code common_words_path} */ + @Nonnull public final Builder commonWordsPath(@Nullable String value) { this.commonWordsPath = value; return this; @@ -201,6 +252,7 @@ public final Builder commonWordsPath(@Nullable String value) { /** * API name: {@code ignore_case} */ + @Nonnull public final Builder ignoreCase(@Nullable Boolean value) { this.ignoreCase = value; return this; @@ -209,21 +261,19 @@ public final Builder ignoreCase(@Nullable Boolean value) { /** * API name: {@code query_mode} */ + @Nonnull public final Builder queryMode(@Nullable Boolean value) { this.queryMode = value; return this; } - @Override - protected Builder self() { - return this; - } - /** * Builds a {@link CommonGramsTokenFilter}. * * @throws NullPointerException if some of the required fields are null. */ + @Override + @Nonnull public CommonGramsTokenFilter build() { _checkSingleUse(); diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/analysis/CompoundWordTokenFilterBase.java b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/analysis/CompoundWordTokenFilterBase.java index 1a93cfbb5c..a448247e56 100644 --- a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/analysis/CompoundWordTokenFilterBase.java +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/analysis/CompoundWordTokenFilterBase.java @@ -203,9 +203,34 @@ protected abstract static class AbstractBuilder o) { + super(o); + this.hyphenationPatternsPath = o.hyphenationPatternsPath; + this.maxSubwordSize = o.maxSubwordSize; + this.minSubwordSize = o.minSubwordSize; + this.minWordSize = o.minWordSize; + this.onlyLongestMatch = o.onlyLongestMatch; + this.wordList = _listCopy(o.wordList); + this.wordListPath = o.wordListPath; + } + /** * API name: {@code hyphenation_patterns_path} */ + @Nonnull public final BuilderT hyphenationPatternsPath(@Nullable String value) { this.hyphenationPatternsPath = value; return self(); @@ -214,6 +239,7 @@ public final BuilderT hyphenationPatternsPath(@Nullable String value) { /** * API name: {@code max_subword_size} */ + @Nonnull public final BuilderT maxSubwordSize(@Nullable Integer value) { this.maxSubwordSize = value; return self(); @@ -222,6 +248,7 @@ public final BuilderT maxSubwordSize(@Nullable Integer value) { /** * API name: {@code min_subword_size} */ + @Nonnull public final BuilderT minSubwordSize(@Nullable Integer value) { this.minSubwordSize = value; return self(); @@ -230,6 +257,7 @@ public final BuilderT minSubwordSize(@Nullable Integer value) { /** * API name: {@code min_word_size} */ + @Nonnull public final BuilderT minWordSize(@Nullable Integer value) { this.minWordSize = value; return self(); @@ -238,6 +266,7 @@ public final BuilderT minWordSize(@Nullable Integer value) { /** * API name: {@code only_longest_match} */ + @Nonnull public final BuilderT onlyLongestMatch(@Nullable Boolean value) { this.onlyLongestMatch = value; return self(); @@ -250,6 +279,7 @@ public final BuilderT onlyLongestMatch(@Nullable Boolean value) { * Adds all elements of list to wordList. *

*/ + @Nonnull public final BuilderT wordList(List list) { this.wordList = _listAddAll(this.wordList, list); return self(); @@ -262,6 +292,7 @@ public final BuilderT wordList(List list) { * Adds one or more values to wordList. *

*/ + @Nonnull public final BuilderT wordList(String value, String... values) { this.wordList = _listAdd(this.wordList, value, values); return self(); @@ -270,6 +301,7 @@ public final BuilderT wordList(String value, String... values) { /** * API name: {@code word_list_path} */ + @Nonnull public final BuilderT wordListPath(@Nullable String value) { this.wordListPath = value; return self(); diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/analysis/ConditionTokenFilter.java b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/analysis/ConditionTokenFilter.java index 32f27f48a3..4350c60b19 100644 --- a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/analysis/ConditionTokenFilter.java +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/analysis/ConditionTokenFilter.java @@ -48,13 +48,18 @@ import org.opensearch.client.json.ObjectDeserializer; 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.ToCopyableBuilder; // typedef: _types.analysis.ConditionTokenFilter @JsonpDeserializable @Generated("org.opensearch.client.codegen.CodeGenerator") -public class ConditionTokenFilter extends TokenFilterBase implements TokenFilterDefinitionVariant { +public class ConditionTokenFilter extends TokenFilterBase + implements + TokenFilterDefinitionVariant, + ToCopyableBuilder { @Nonnull private final List filter; @@ -114,13 +119,50 @@ protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { // --------------------------------------------------------------------------------------------- + @Override + @Nonnull + public Builder toBuilder() { + return new Builder(this); + } + + @Nonnull + public static Builder builder() { + return new Builder(); + } + /** * Builder for {@link ConditionTokenFilter}. */ - public static class Builder extends TokenFilterBase.AbstractBuilder implements ObjectBuilder { + public static class Builder extends TokenFilterBase.AbstractBuilder implements CopyableBuilder { private List filter; private Script script; + public Builder() {} + + private Builder(ConditionTokenFilter o) { + super(o); + this.filter = _listCopy(o.filter); + this.script = o.script; + } + + private Builder(Builder o) { + super(o); + this.filter = _listCopy(o.filter); + this.script = o.script; + } + + @Override + @Nonnull + public Builder copy() { + return new Builder(this); + } + + @Override + @Nonnull + protected Builder self() { + return this; + } + /** * Required - API name: {@code filter} * @@ -128,6 +170,7 @@ public static class Builder extends TokenFilterBase.AbstractBuilder imp * Adds all elements of list to filter. *

*/ + @Nonnull public final Builder filter(List list) { this.filter = _listAddAll(this.filter, list); return this; @@ -140,6 +183,7 @@ public final Builder filter(List list) { * Adds one or more values to filter. *

*/ + @Nonnull public final Builder filter(String value, String... values) { this.filter = _listAdd(this.filter, value, values); return this; @@ -148,6 +192,7 @@ public final Builder filter(String value, String... values) { /** * Required - API name: {@code script} */ + @Nonnull public final Builder script(Script value) { this.script = value; return this; @@ -156,20 +201,18 @@ public final Builder script(Script value) { /** * Required - API name: {@code script} */ + @Nonnull public final Builder script(Function> fn) { return script(fn.apply(new Script.Builder()).build()); } - @Override - protected Builder self() { - return this; - } - /** * Builds a {@link ConditionTokenFilter}. * * @throws NullPointerException if some of the required fields are null. */ + @Override + @Nonnull public ConditionTokenFilter build() { _checkSingleUse(); diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/analysis/CustomAnalyzer.java b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/analysis/CustomAnalyzer.java index be8b2dfc40..f8e2ab0ffc 100644 --- a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/analysis/CustomAnalyzer.java +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/analysis/CustomAnalyzer.java @@ -50,14 +50,16 @@ 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: _types.analysis.CustomAnalyzer @JsonpDeserializable @Generated("org.opensearch.client.codegen.CodeGenerator") -public class CustomAnalyzer implements AnalyzerVariant, PlainJsonSerializable { +public class CustomAnalyzer implements AnalyzerVariant, PlainJsonSerializable, ToCopyableBuilder { @Nonnull private final List charFilter; @@ -182,10 +184,21 @@ protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { // --------------------------------------------------------------------------------------------- + @Override + @Nonnull + public Builder toBuilder() { + return new Builder(this); + } + + @Nonnull + public static Builder builder() { + return new Builder(); + } + /** * Builder for {@link CustomAnalyzer}. */ - public static class Builder extends ObjectBuilderBase implements ObjectBuilder { + public static class Builder extends ObjectBuilderBase implements CopyableBuilder { @Nullable private List charFilter; @Nullable @@ -196,6 +209,30 @@ public static class Builder extends ObjectBuilderBase implements ObjectBuilderlist to charFilter. *

*/ + @Nonnull public final Builder charFilter(List list) { this.charFilter = _listAddAll(this.charFilter, list); return this; @@ -215,6 +253,7 @@ public final Builder charFilter(List list) { * Adds one or more values to charFilter. *

*/ + @Nonnull public final Builder charFilter(String value, String... values) { this.charFilter = _listAdd(this.charFilter, value, values); return this; @@ -227,6 +266,7 @@ public final Builder charFilter(String value, String... values) { * Adds all elements of list to filter. *

*/ + @Nonnull public final Builder filter(List list) { this.filter = _listAddAll(this.filter, list); return this; @@ -239,6 +279,7 @@ public final Builder filter(List list) { * Adds one or more values to filter. *

*/ + @Nonnull public final Builder filter(String value, String... values) { this.filter = _listAdd(this.filter, value, values); return this; @@ -247,6 +288,7 @@ public final Builder filter(String value, String... values) { /** * API name: {@code position_increment_gap} */ + @Nonnull public final Builder positionIncrementGap(@Nullable Integer value) { this.positionIncrementGap = value; return this; @@ -255,6 +297,7 @@ public final Builder positionIncrementGap(@Nullable Integer value) { /** * API name: {@code position_offset_gap} */ + @Nonnull public final Builder positionOffsetGap(@Nullable Integer value) { this.positionOffsetGap = value; return this; @@ -263,6 +306,7 @@ public final Builder positionOffsetGap(@Nullable Integer value) { /** * Required - API name: {@code tokenizer} */ + @Nonnull public final Builder tokenizer(String value) { this.tokenizer = value; return this; @@ -273,6 +317,8 @@ public final Builder tokenizer(String value) { * * @throws NullPointerException if some of the required fields are null. */ + @Override + @Nonnull public CustomAnalyzer build() { _checkSingleUse(); diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/analysis/CustomNormalizer.java b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/analysis/CustomNormalizer.java index 2c5f6eb35f..8dbab6bc34 100644 --- a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/analysis/CustomNormalizer.java +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/analysis/CustomNormalizer.java @@ -50,14 +50,20 @@ 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: _types.analysis.CustomNormalizer @JsonpDeserializable @Generated("org.opensearch.client.codegen.CodeGenerator") -public class CustomNormalizer implements NormalizerVariant, PlainJsonSerializable { +public class CustomNormalizer + implements + NormalizerVariant, + PlainJsonSerializable, + ToCopyableBuilder { @Nonnull private final List charFilter; @@ -133,15 +139,44 @@ protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { // --------------------------------------------------------------------------------------------- + @Override + @Nonnull + public Builder toBuilder() { + return new Builder(this); + } + + @Nonnull + public static Builder builder() { + return new Builder(); + } + /** * Builder for {@link CustomNormalizer}. */ - public static class Builder extends ObjectBuilderBase implements ObjectBuilder { + public static class Builder extends ObjectBuilderBase implements CopyableBuilder { @Nullable private List charFilter; @Nullable private List filter; + public Builder() {} + + private Builder(CustomNormalizer o) { + this.charFilter = _listCopy(o.charFilter); + this.filter = _listCopy(o.filter); + } + + private Builder(Builder o) { + this.charFilter = _listCopy(o.charFilter); + this.filter = _listCopy(o.filter); + } + + @Override + @Nonnull + public Builder copy() { + return new Builder(this); + } + /** * API name: {@code char_filter} * @@ -149,6 +184,7 @@ public static class Builder extends ObjectBuilderBase implements ObjectBuilderlist to charFilter. *

*/ + @Nonnull public final Builder charFilter(List list) { this.charFilter = _listAddAll(this.charFilter, list); return this; @@ -161,6 +197,7 @@ public final Builder charFilter(List list) { * Adds one or more values to charFilter. *

*/ + @Nonnull public final Builder charFilter(String value, String... values) { this.charFilter = _listAdd(this.charFilter, value, values); return this; @@ -173,6 +210,7 @@ public final Builder charFilter(String value, String... values) { * Adds all elements of list to filter. *

*/ + @Nonnull public final Builder filter(List list) { this.filter = _listAddAll(this.filter, list); return this; @@ -185,6 +223,7 @@ public final Builder filter(List list) { * Adds one or more values to filter. *

*/ + @Nonnull public final Builder filter(String value, String... values) { this.filter = _listAdd(this.filter, value, values); return this; @@ -195,6 +234,8 @@ public final Builder filter(String value, String... values) { * * @throws NullPointerException if some of the required fields are null. */ + @Override + @Nonnull public CustomNormalizer build() { _checkSingleUse(); diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/analysis/DelimitedPayloadTokenFilter.java b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/analysis/DelimitedPayloadTokenFilter.java index 6528fb0fbb..316f39f822 100644 --- a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/analysis/DelimitedPayloadTokenFilter.java +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/analysis/DelimitedPayloadTokenFilter.java @@ -40,19 +40,25 @@ 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.util.CopyableBuilder; import org.opensearch.client.util.ObjectBuilder; +import org.opensearch.client.util.ToCopyableBuilder; // typedef: _types.analysis.DelimitedPayloadTokenFilter @JsonpDeserializable @Generated("org.opensearch.client.codegen.CodeGenerator") -public class DelimitedPayloadTokenFilter extends TokenFilterBase implements TokenFilterDefinitionVariant { +public class DelimitedPayloadTokenFilter extends TokenFilterBase + implements + TokenFilterDefinitionVariant, + ToCopyableBuilder { @Nullable private final String delimiter; @@ -114,18 +120,58 @@ protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { // --------------------------------------------------------------------------------------------- + @Override + @Nonnull + public Builder toBuilder() { + return new Builder(this); + } + + @Nonnull + public static Builder builder() { + return new Builder(); + } + /** * Builder for {@link DelimitedPayloadTokenFilter}. */ - public static class Builder extends TokenFilterBase.AbstractBuilder implements ObjectBuilder { + public static class Builder extends TokenFilterBase.AbstractBuilder + implements + CopyableBuilder { @Nullable private String delimiter; @Nullable private DelimitedPayloadEncoding encoding; + public Builder() {} + + private Builder(DelimitedPayloadTokenFilter o) { + super(o); + this.delimiter = o.delimiter; + this.encoding = o.encoding; + } + + private Builder(Builder o) { + super(o); + this.delimiter = o.delimiter; + this.encoding = o.encoding; + } + + @Override + @Nonnull + public Builder copy() { + return new Builder(this); + } + + @Override + @Nonnull + protected Builder self() { + return this; + } + /** * API name: {@code delimiter} */ + @Nonnull public final Builder delimiter(@Nullable String value) { this.delimiter = value; return this; @@ -134,21 +180,19 @@ public final Builder delimiter(@Nullable String value) { /** * API name: {@code encoding} */ + @Nonnull public final Builder encoding(@Nullable DelimitedPayloadEncoding value) { this.encoding = value; return this; } - @Override - protected Builder self() { - return this; - } - /** * Builds a {@link DelimitedPayloadTokenFilter}. * * @throws NullPointerException if some of the required fields are null. */ + @Override + @Nonnull public DelimitedPayloadTokenFilter build() { _checkSingleUse(); diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/analysis/DictionaryDecompounderTokenFilter.java b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/analysis/DictionaryDecompounderTokenFilter.java index ac742a25d1..9e0d1ab7c5 100644 --- a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/analysis/DictionaryDecompounderTokenFilter.java +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/analysis/DictionaryDecompounderTokenFilter.java @@ -39,18 +39,24 @@ 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.util.CopyableBuilder; import org.opensearch.client.util.ObjectBuilder; +import org.opensearch.client.util.ToCopyableBuilder; // typedef: _types.analysis.DictionaryDecompounderTokenFilter @JsonpDeserializable @Generated("org.opensearch.client.codegen.CodeGenerator") -public class DictionaryDecompounderTokenFilter extends CompoundWordTokenFilterBase implements TokenFilterDefinitionVariant { +public class DictionaryDecompounderTokenFilter extends CompoundWordTokenFilterBase + implements + TokenFilterDefinitionVariant, + ToCopyableBuilder { // --------------------------------------------------------------------------------------------- @@ -79,14 +85,42 @@ protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { // --------------------------------------------------------------------------------------------- + @Override + @Nonnull + public Builder toBuilder() { + return new Builder(this); + } + + @Nonnull + public static Builder builder() { + return new Builder(); + } + /** * Builder for {@link DictionaryDecompounderTokenFilter}. */ public static class Builder extends CompoundWordTokenFilterBase.AbstractBuilder implements - ObjectBuilder { + CopyableBuilder { + + public Builder() {} + + private Builder(DictionaryDecompounderTokenFilter o) { + super(o); + } + + private Builder(Builder o) { + super(o); + } @Override + @Nonnull + public Builder copy() { + return new Builder(this); + } + + @Override + @Nonnull protected Builder self() { return this; } @@ -96,6 +130,8 @@ protected Builder self() { * * @throws NullPointerException if some of the required fields are null. */ + @Override + @Nonnull public DictionaryDecompounderTokenFilter build() { _checkSingleUse(); diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/analysis/DutchAnalyzer.java b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/analysis/DutchAnalyzer.java index acac1f2cab..f06908bac7 100644 --- a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/analysis/DutchAnalyzer.java +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/analysis/DutchAnalyzer.java @@ -50,14 +50,16 @@ 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: _types.analysis.DutchAnalyzer @JsonpDeserializable @Generated("org.opensearch.client.codegen.CodeGenerator") -public class DutchAnalyzer implements AnalyzerVariant, PlainJsonSerializable { +public class DutchAnalyzer implements AnalyzerVariant, PlainJsonSerializable, ToCopyableBuilder { @Nonnull private final List stopwords; @@ -112,13 +114,40 @@ protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { // --------------------------------------------------------------------------------------------- + @Override + @Nonnull + public Builder toBuilder() { + return new Builder(this); + } + + @Nonnull + public static Builder builder() { + return new Builder(); + } + /** * Builder for {@link DutchAnalyzer}. */ - public static class Builder extends ObjectBuilderBase implements ObjectBuilder { + public static class Builder extends ObjectBuilderBase implements CopyableBuilder { @Nullable private List stopwords; + public Builder() {} + + private Builder(DutchAnalyzer o) { + this.stopwords = _listCopy(o.stopwords); + } + + private Builder(Builder o) { + this.stopwords = _listCopy(o.stopwords); + } + + @Override + @Nonnull + public Builder copy() { + return new Builder(this); + } + /** * API name: {@code stopwords} * @@ -126,6 +155,7 @@ public static class Builder extends ObjectBuilderBase implements ObjectBuilderlist to stopwords. *

*/ + @Nonnull public final Builder stopwords(List list) { this.stopwords = _listAddAll(this.stopwords, list); return this; @@ -138,6 +168,7 @@ public final Builder stopwords(List list) { * Adds one or more values to stopwords. *

*/ + @Nonnull public final Builder stopwords(String value, String... values) { this.stopwords = _listAdd(this.stopwords, value, values); return this; @@ -148,6 +179,8 @@ public final Builder stopwords(String value, String... values) { * * @throws NullPointerException if some of the required fields are null. */ + @Override + @Nonnull public DutchAnalyzer build() { _checkSingleUse(); diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/analysis/EdgeNGramTokenFilter.java b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/analysis/EdgeNGramTokenFilter.java index 8d375f817a..a246cf8b07 100644 --- a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/analysis/EdgeNGramTokenFilter.java +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/analysis/EdgeNGramTokenFilter.java @@ -40,19 +40,25 @@ 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.util.CopyableBuilder; import org.opensearch.client.util.ObjectBuilder; +import org.opensearch.client.util.ToCopyableBuilder; // typedef: _types.analysis.EdgeNGramTokenFilter @JsonpDeserializable @Generated("org.opensearch.client.codegen.CodeGenerator") -public class EdgeNGramTokenFilter extends TokenFilterBase implements TokenFilterDefinitionVariant { +public class EdgeNGramTokenFilter extends TokenFilterBase + implements + TokenFilterDefinitionVariant, + ToCopyableBuilder { @Nullable private final Integer maxGram; @@ -146,10 +152,21 @@ protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { // --------------------------------------------------------------------------------------------- + @Override + @Nonnull + public Builder toBuilder() { + return new Builder(this); + } + + @Nonnull + public static Builder builder() { + return new Builder(); + } + /** * Builder for {@link EdgeNGramTokenFilter}. */ - public static class Builder extends TokenFilterBase.AbstractBuilder implements ObjectBuilder { + public static class Builder extends TokenFilterBase.AbstractBuilder implements CopyableBuilder { @Nullable private Integer maxGram; @Nullable @@ -159,9 +176,40 @@ public static class Builder extends TokenFilterBase.AbstractBuilder imp @Nullable private EdgeNGramSide side; + public Builder() {} + + private Builder(EdgeNGramTokenFilter o) { + super(o); + this.maxGram = o.maxGram; + this.minGram = o.minGram; + this.preserveOriginal = o.preserveOriginal; + this.side = o.side; + } + + private Builder(Builder o) { + super(o); + this.maxGram = o.maxGram; + this.minGram = o.minGram; + this.preserveOriginal = o.preserveOriginal; + this.side = o.side; + } + + @Override + @Nonnull + public Builder copy() { + return new Builder(this); + } + + @Override + @Nonnull + protected Builder self() { + return this; + } + /** * API name: {@code max_gram} */ + @Nonnull public final Builder maxGram(@Nullable Integer value) { this.maxGram = value; return this; @@ -170,6 +218,7 @@ public final Builder maxGram(@Nullable Integer value) { /** * API name: {@code min_gram} */ + @Nonnull public final Builder minGram(@Nullable Integer value) { this.minGram = value; return this; @@ -178,6 +227,7 @@ public final Builder minGram(@Nullable Integer value) { /** * API name: {@code preserve_original} */ + @Nonnull public final Builder preserveOriginal(@Nullable Boolean value) { this.preserveOriginal = value; return this; @@ -186,21 +236,19 @@ public final Builder preserveOriginal(@Nullable Boolean value) { /** * API name: {@code side} */ + @Nonnull public final Builder side(@Nullable EdgeNGramSide value) { this.side = value; return this; } - @Override - protected Builder self() { - return this; - } - /** * Builds a {@link EdgeNGramTokenFilter}. * * @throws NullPointerException if some of the required fields are null. */ + @Override + @Nonnull public EdgeNGramTokenFilter build() { _checkSingleUse(); diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/analysis/EdgeNGramTokenizer.java b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/analysis/EdgeNGramTokenizer.java index 5432d050ca..400e05f2a0 100644 --- a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/analysis/EdgeNGramTokenizer.java +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/analysis/EdgeNGramTokenizer.java @@ -49,13 +49,18 @@ import org.opensearch.client.json.ObjectBuilderDeserializer; import org.opensearch.client.json.ObjectDeserializer; import org.opensearch.client.util.ApiTypeHelper; +import org.opensearch.client.util.CopyableBuilder; import org.opensearch.client.util.ObjectBuilder; +import org.opensearch.client.util.ToCopyableBuilder; // typedef: _types.analysis.EdgeNGramTokenizer @JsonpDeserializable @Generated("org.opensearch.client.codegen.CodeGenerator") -public class EdgeNGramTokenizer extends TokenizerBase implements TokenizerDefinitionVariant { +public class EdgeNGramTokenizer extends TokenizerBase + implements + TokenizerDefinitionVariant, + ToCopyableBuilder { @Nullable private final String customTokenChars; @@ -143,19 +148,61 @@ protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { // --------------------------------------------------------------------------------------------- + @Override + @Nonnull + public Builder toBuilder() { + return new Builder(this); + } + + @Nonnull + public static Builder builder() { + return new Builder(); + } + /** * Builder for {@link EdgeNGramTokenizer}. */ - public static class Builder extends TokenizerBase.AbstractBuilder implements ObjectBuilder { + public static class Builder extends TokenizerBase.AbstractBuilder implements CopyableBuilder { @Nullable private String customTokenChars; private Integer maxGram; private Integer minGram; private List tokenChars; + public Builder() {} + + private Builder(EdgeNGramTokenizer o) { + super(o); + this.customTokenChars = o.customTokenChars; + this.maxGram = o.maxGram; + this.minGram = o.minGram; + this.tokenChars = _listCopy(o.tokenChars); + } + + private Builder(Builder o) { + super(o); + this.customTokenChars = o.customTokenChars; + this.maxGram = o.maxGram; + this.minGram = o.minGram; + this.tokenChars = _listCopy(o.tokenChars); + } + + @Override + @Nonnull + public Builder copy() { + return new Builder(this); + } + + @Override + @Nonnull + protected Builder self() { + return this; + } + /** * API name: {@code custom_token_chars} */ + @Nonnull public final Builder customTokenChars(@Nullable String value) { this.customTokenChars = value; return this; @@ -164,6 +211,7 @@ public final Builder customTokenChars(@Nullable String value) { /** * Required - API name: {@code max_gram} */ + @Nonnull public final Builder maxGram(int value) { this.maxGram = value; return this; @@ -172,6 +220,7 @@ public final Builder maxGram(int value) { /** * Required - API name: {@code min_gram} */ + @Nonnull public final Builder minGram(int value) { this.minGram = value; return this; @@ -184,6 +233,7 @@ public final Builder minGram(int value) { * Adds all elements of list to tokenChars. *

*/ + @Nonnull public final Builder tokenChars(List list) { this.tokenChars = _listAddAll(this.tokenChars, list); return this; @@ -196,21 +246,19 @@ public final Builder tokenChars(List list) { * Adds one or more values to tokenChars. *

*/ + @Nonnull public final Builder tokenChars(TokenChar value, TokenChar... values) { this.tokenChars = _listAdd(this.tokenChars, value, values); return this; } - @Override - protected Builder self() { - return this; - } - /** * Builds a {@link EdgeNGramTokenizer}. * * @throws NullPointerException if some of the required fields are null. */ + @Override + @Nonnull public EdgeNGramTokenizer build() { _checkSingleUse(); diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/analysis/ElisionTokenFilter.java b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/analysis/ElisionTokenFilter.java index 161210982e..66ec0635df 100644 --- a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/analysis/ElisionTokenFilter.java +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/analysis/ElisionTokenFilter.java @@ -49,13 +49,18 @@ import org.opensearch.client.json.ObjectBuilderDeserializer; import org.opensearch.client.json.ObjectDeserializer; import org.opensearch.client.util.ApiTypeHelper; +import org.opensearch.client.util.CopyableBuilder; import org.opensearch.client.util.ObjectBuilder; +import org.opensearch.client.util.ToCopyableBuilder; // typedef: _types.analysis.ElisionTokenFilter @JsonpDeserializable @Generated("org.opensearch.client.codegen.CodeGenerator") -public class ElisionTokenFilter extends TokenFilterBase implements TokenFilterDefinitionVariant { +public class ElisionTokenFilter extends TokenFilterBase + implements + TokenFilterDefinitionVariant, + ToCopyableBuilder { @Nonnull private final List articles; @@ -136,10 +141,21 @@ protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { // --------------------------------------------------------------------------------------------- + @Override + @Nonnull + public Builder toBuilder() { + return new Builder(this); + } + + @Nonnull + public static Builder builder() { + return new Builder(); + } + /** * Builder for {@link ElisionTokenFilter}. */ - public static class Builder extends TokenFilterBase.AbstractBuilder implements ObjectBuilder { + public static class Builder extends TokenFilterBase.AbstractBuilder implements CopyableBuilder { @Nullable private List articles; @Nullable @@ -147,6 +163,34 @@ public static class Builder extends TokenFilterBase.AbstractBuilder imp @Nullable private String articlesPath; + public Builder() {} + + private Builder(ElisionTokenFilter o) { + super(o); + this.articles = _listCopy(o.articles); + this.articlesCase = o.articlesCase; + this.articlesPath = o.articlesPath; + } + + private Builder(Builder o) { + super(o); + this.articles = _listCopy(o.articles); + this.articlesCase = o.articlesCase; + this.articlesPath = o.articlesPath; + } + + @Override + @Nonnull + public Builder copy() { + return new Builder(this); + } + + @Override + @Nonnull + protected Builder self() { + return this; + } + /** * API name: {@code articles} * @@ -154,6 +198,7 @@ public static class Builder extends TokenFilterBase.AbstractBuilder imp * Adds all elements of list to articles. *

*/ + @Nonnull public final Builder articles(List list) { this.articles = _listAddAll(this.articles, list); return this; @@ -166,6 +211,7 @@ public final Builder articles(List list) { * Adds one or more values to articles. *

*/ + @Nonnull public final Builder articles(String value, String... values) { this.articles = _listAdd(this.articles, value, values); return this; @@ -174,6 +220,7 @@ public final Builder articles(String value, String... values) { /** * API name: {@code articles_case} */ + @Nonnull public final Builder articlesCase(@Nullable Boolean value) { this.articlesCase = value; return this; @@ -182,21 +229,19 @@ public final Builder articlesCase(@Nullable Boolean value) { /** * API name: {@code articles_path} */ + @Nonnull public final Builder articlesPath(@Nullable String value) { this.articlesPath = value; return this; } - @Override - protected Builder self() { - return this; - } - /** * Builds a {@link ElisionTokenFilter}. * * @throws NullPointerException if some of the required fields are null. */ + @Override + @Nonnull public ElisionTokenFilter build() { _checkSingleUse(); diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/analysis/FingerprintAnalyzer.java b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/analysis/FingerprintAnalyzer.java index fb366da4be..55fd4c6ac6 100644 --- a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/analysis/FingerprintAnalyzer.java +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/analysis/FingerprintAnalyzer.java @@ -50,14 +50,20 @@ 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: _types.analysis.FingerprintAnalyzer @JsonpDeserializable @Generated("org.opensearch.client.codegen.CodeGenerator") -public class FingerprintAnalyzer implements AnalyzerVariant, PlainJsonSerializable { +public class FingerprintAnalyzer + implements + AnalyzerVariant, + PlainJsonSerializable, + ToCopyableBuilder { private final int maxOutputSize; @@ -187,10 +193,21 @@ protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { // --------------------------------------------------------------------------------------------- + @Override + @Nonnull + public Builder toBuilder() { + return new Builder(this); + } + + @Nonnull + public static Builder builder() { + return new Builder(); + } + /** * Builder for {@link FingerprintAnalyzer}. */ - public static class Builder extends ObjectBuilderBase implements ObjectBuilder { + public static class Builder extends ObjectBuilderBase implements CopyableBuilder { private Integer maxOutputSize; private Boolean preserveOriginal; private String separator; @@ -201,9 +218,36 @@ public static class Builder extends ObjectBuilderBase implements ObjectBuilderlist to stopwords. *

*/ + @Nonnull public final Builder stopwords(List list) { this.stopwords = _listAddAll(this.stopwords, list); return this; @@ -244,6 +291,7 @@ public final Builder stopwords(List list) { * Adds one or more values to stopwords. *

*/ + @Nonnull public final Builder stopwords(String value, String... values) { this.stopwords = _listAdd(this.stopwords, value, values); return this; @@ -252,6 +300,7 @@ public final Builder stopwords(String value, String... values) { /** * API name: {@code stopwords_path} */ + @Nonnull public final Builder stopwordsPath(@Nullable String value) { this.stopwordsPath = value; return this; @@ -260,6 +309,7 @@ public final Builder stopwordsPath(@Nullable String value) { /** * API name: {@code version} */ + @Nonnull public final Builder version(@Nullable String value) { this.version = value; return this; @@ -270,6 +320,8 @@ public final Builder version(@Nullable String value) { * * @throws NullPointerException if some of the required fields are null. */ + @Override + @Nonnull public FingerprintAnalyzer build() { _checkSingleUse(); diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/analysis/FingerprintTokenFilter.java b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/analysis/FingerprintTokenFilter.java index 47608314cb..3448028d88 100644 --- a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/analysis/FingerprintTokenFilter.java +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/analysis/FingerprintTokenFilter.java @@ -40,19 +40,25 @@ 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.util.CopyableBuilder; import org.opensearch.client.util.ObjectBuilder; +import org.opensearch.client.util.ToCopyableBuilder; // typedef: _types.analysis.FingerprintTokenFilter @JsonpDeserializable @Generated("org.opensearch.client.codegen.CodeGenerator") -public class FingerprintTokenFilter extends TokenFilterBase implements TokenFilterDefinitionVariant { +public class FingerprintTokenFilter extends TokenFilterBase + implements + TokenFilterDefinitionVariant, + ToCopyableBuilder { @Nullable private final Integer maxOutputSize; @@ -112,18 +118,58 @@ protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { // --------------------------------------------------------------------------------------------- + @Override + @Nonnull + public Builder toBuilder() { + return new Builder(this); + } + + @Nonnull + public static Builder builder() { + return new Builder(); + } + /** * Builder for {@link FingerprintTokenFilter}. */ - public static class Builder extends TokenFilterBase.AbstractBuilder implements ObjectBuilder { + public static class Builder extends TokenFilterBase.AbstractBuilder + implements + CopyableBuilder { @Nullable private Integer maxOutputSize; @Nullable private String separator; + public Builder() {} + + private Builder(FingerprintTokenFilter o) { + super(o); + this.maxOutputSize = o.maxOutputSize; + this.separator = o.separator; + } + + private Builder(Builder o) { + super(o); + this.maxOutputSize = o.maxOutputSize; + this.separator = o.separator; + } + + @Override + @Nonnull + public Builder copy() { + return new Builder(this); + } + + @Override + @Nonnull + protected Builder self() { + return this; + } + /** * API name: {@code max_output_size} */ + @Nonnull public final Builder maxOutputSize(@Nullable Integer value) { this.maxOutputSize = value; return this; @@ -132,21 +178,19 @@ public final Builder maxOutputSize(@Nullable Integer value) { /** * API name: {@code separator} */ + @Nonnull public final Builder separator(@Nullable String value) { this.separator = value; return this; } - @Override - protected Builder self() { - return this; - } - /** * Builds a {@link FingerprintTokenFilter}. * * @throws NullPointerException if some of the required fields are null. */ + @Override + @Nonnull public FingerprintTokenFilter build() { _checkSingleUse(); diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/analysis/HtmlStripCharFilter.java b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/analysis/HtmlStripCharFilter.java index b2563e5f43..57c2014839 100644 --- a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/analysis/HtmlStripCharFilter.java +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/analysis/HtmlStripCharFilter.java @@ -39,18 +39,24 @@ 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.util.CopyableBuilder; import org.opensearch.client.util.ObjectBuilder; +import org.opensearch.client.util.ToCopyableBuilder; // typedef: _types.analysis.HtmlStripCharFilter @JsonpDeserializable @Generated("org.opensearch.client.codegen.CodeGenerator") -public class HtmlStripCharFilter extends CharFilterBase implements CharFilterDefinitionVariant { +public class HtmlStripCharFilter extends CharFilterBase + implements + CharFilterDefinitionVariant, + ToCopyableBuilder { // --------------------------------------------------------------------------------------------- @@ -77,12 +83,40 @@ protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { // --------------------------------------------------------------------------------------------- + @Override + @Nonnull + public Builder toBuilder() { + return new Builder(this); + } + + @Nonnull + public static Builder builder() { + return new Builder(); + } + /** * Builder for {@link HtmlStripCharFilter}. */ - public static class Builder extends CharFilterBase.AbstractBuilder implements ObjectBuilder { + public static class Builder extends CharFilterBase.AbstractBuilder implements CopyableBuilder { + + public Builder() {} + + private Builder(HtmlStripCharFilter o) { + super(o); + } + + private Builder(Builder o) { + super(o); + } @Override + @Nonnull + public Builder copy() { + return new Builder(this); + } + + @Override + @Nonnull protected Builder self() { return this; } @@ -92,6 +126,8 @@ protected Builder self() { * * @throws NullPointerException if some of the required fields are null. */ + @Override + @Nonnull public HtmlStripCharFilter build() { _checkSingleUse(); diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/analysis/HunspellTokenFilter.java b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/analysis/HunspellTokenFilter.java index 8854583339..c24c872b58 100644 --- a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/analysis/HunspellTokenFilter.java +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/analysis/HunspellTokenFilter.java @@ -48,13 +48,18 @@ import org.opensearch.client.json.ObjectBuilderDeserializer; import org.opensearch.client.json.ObjectDeserializer; import org.opensearch.client.util.ApiTypeHelper; +import org.opensearch.client.util.CopyableBuilder; import org.opensearch.client.util.ObjectBuilder; +import org.opensearch.client.util.ToCopyableBuilder; // typedef: _types.analysis.HunspellTokenFilter @JsonpDeserializable @Generated("org.opensearch.client.codegen.CodeGenerator") -public class HunspellTokenFilter extends TokenFilterBase implements TokenFilterDefinitionVariant { +public class HunspellTokenFilter extends TokenFilterBase + implements + TokenFilterDefinitionVariant, + ToCopyableBuilder { @Nullable private final Boolean dedup; @@ -146,10 +151,21 @@ protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { // --------------------------------------------------------------------------------------------- + @Override + @Nonnull + public Builder toBuilder() { + return new Builder(this); + } + + @Nonnull + public static Builder builder() { + return new Builder(); + } + /** * Builder for {@link HunspellTokenFilter}. */ - public static class Builder extends TokenFilterBase.AbstractBuilder implements ObjectBuilder { + public static class Builder extends TokenFilterBase.AbstractBuilder implements CopyableBuilder { @Nullable private Boolean dedup; @Nullable @@ -158,9 +174,40 @@ public static class Builder extends TokenFilterBase.AbstractBuilder imp @Nullable private Boolean longestOnly; + public Builder() {} + + private Builder(HunspellTokenFilter o) { + super(o); + this.dedup = o.dedup; + this.dictionary = o.dictionary; + this.locale = o.locale; + this.longestOnly = o.longestOnly; + } + + private Builder(Builder o) { + super(o); + this.dedup = o.dedup; + this.dictionary = o.dictionary; + this.locale = o.locale; + this.longestOnly = o.longestOnly; + } + + @Override + @Nonnull + public Builder copy() { + return new Builder(this); + } + + @Override + @Nonnull + protected Builder self() { + return this; + } + /** * API name: {@code dedup} */ + @Nonnull public final Builder dedup(@Nullable Boolean value) { this.dedup = value; return this; @@ -169,6 +216,7 @@ public final Builder dedup(@Nullable Boolean value) { /** * API name: {@code dictionary} */ + @Nonnull public final Builder dictionary(@Nullable String value) { this.dictionary = value; return this; @@ -177,6 +225,7 @@ public final Builder dictionary(@Nullable String value) { /** * Required - API name: {@code locale} */ + @Nonnull public final Builder locale(String value) { this.locale = value; return this; @@ -185,21 +234,19 @@ public final Builder locale(String value) { /** * API name: {@code longest_only} */ + @Nonnull public final Builder longestOnly(@Nullable Boolean value) { this.longestOnly = value; return this; } - @Override - protected Builder self() { - return this; - } - /** * Builds a {@link HunspellTokenFilter}. * * @throws NullPointerException if some of the required fields are null. */ + @Override + @Nonnull public HunspellTokenFilter build() { _checkSingleUse(); diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/analysis/HyphenationDecompounderTokenFilter.java b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/analysis/HyphenationDecompounderTokenFilter.java index 5089977b5c..c6e359f9ad 100644 --- a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/analysis/HyphenationDecompounderTokenFilter.java +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/analysis/HyphenationDecompounderTokenFilter.java @@ -39,18 +39,24 @@ 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.util.CopyableBuilder; import org.opensearch.client.util.ObjectBuilder; +import org.opensearch.client.util.ToCopyableBuilder; // typedef: _types.analysis.HyphenationDecompounderTokenFilter @JsonpDeserializable @Generated("org.opensearch.client.codegen.CodeGenerator") -public class HyphenationDecompounderTokenFilter extends CompoundWordTokenFilterBase implements TokenFilterDefinitionVariant { +public class HyphenationDecompounderTokenFilter extends CompoundWordTokenFilterBase + implements + TokenFilterDefinitionVariant, + ToCopyableBuilder { // --------------------------------------------------------------------------------------------- @@ -79,14 +85,42 @@ protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { // --------------------------------------------------------------------------------------------- + @Override + @Nonnull + public Builder toBuilder() { + return new Builder(this); + } + + @Nonnull + public static Builder builder() { + return new Builder(); + } + /** * Builder for {@link HyphenationDecompounderTokenFilter}. */ public static class Builder extends CompoundWordTokenFilterBase.AbstractBuilder implements - ObjectBuilder { + CopyableBuilder { + + public Builder() {} + + private Builder(HyphenationDecompounderTokenFilter o) { + super(o); + } + + private Builder(Builder o) { + super(o); + } @Override + @Nonnull + public Builder copy() { + return new Builder(this); + } + + @Override + @Nonnull protected Builder self() { return this; } @@ -96,6 +130,8 @@ protected Builder self() { * * @throws NullPointerException if some of the required fields are null. */ + @Override + @Nonnull public HyphenationDecompounderTokenFilter build() { _checkSingleUse(); diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/analysis/IcuAnalyzer.java b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/analysis/IcuAnalyzer.java index 906df8ef2b..09b89b1812 100644 --- a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/analysis/IcuAnalyzer.java +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/analysis/IcuAnalyzer.java @@ -47,14 +47,16 @@ 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: _types.analysis.IcuAnalyzer @JsonpDeserializable @Generated("org.opensearch.client.codegen.CodeGenerator") -public class IcuAnalyzer implements AnalyzerVariant, PlainJsonSerializable { +public class IcuAnalyzer implements AnalyzerVariant, PlainJsonSerializable, ToCopyableBuilder { @Nonnull private final IcuNormalizationType method; @@ -118,16 +120,46 @@ protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { // --------------------------------------------------------------------------------------------- + @Override + @Nonnull + public Builder toBuilder() { + return new Builder(this); + } + + @Nonnull + public static Builder builder() { + return new Builder(); + } + /** * Builder for {@link IcuAnalyzer}. */ - public static class Builder extends ObjectBuilderBase implements ObjectBuilder { + public static class Builder extends ObjectBuilderBase implements CopyableBuilder { private IcuNormalizationType method; private IcuNormalizationMode mode; + public Builder() {} + + private Builder(IcuAnalyzer o) { + this.method = o.method; + this.mode = o.mode; + } + + private Builder(Builder o) { + this.method = o.method; + this.mode = o.mode; + } + + @Override + @Nonnull + public Builder copy() { + return new Builder(this); + } + /** * Required - API name: {@code method} */ + @Nonnull public final Builder method(IcuNormalizationType value) { this.method = value; return this; @@ -136,6 +168,7 @@ public final Builder method(IcuNormalizationType value) { /** * Required - API name: {@code mode} */ + @Nonnull public final Builder mode(IcuNormalizationMode value) { this.mode = value; return this; @@ -146,6 +179,8 @@ public final Builder mode(IcuNormalizationMode value) { * * @throws NullPointerException if some of the required fields are null. */ + @Override + @Nonnull public IcuAnalyzer build() { _checkSingleUse(); diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/analysis/IcuCollationTokenFilter.java b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/analysis/IcuCollationTokenFilter.java index f9a1668f35..492b699f62 100644 --- a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/analysis/IcuCollationTokenFilter.java +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/analysis/IcuCollationTokenFilter.java @@ -40,19 +40,25 @@ 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.util.CopyableBuilder; import org.opensearch.client.util.ObjectBuilder; +import org.opensearch.client.util.ToCopyableBuilder; // typedef: _types.analysis.IcuCollationTokenFilter @JsonpDeserializable @Generated("org.opensearch.client.codegen.CodeGenerator") -public class IcuCollationTokenFilter extends TokenFilterBase implements TokenFilterDefinitionVariant { +public class IcuCollationTokenFilter extends TokenFilterBase + implements + TokenFilterDefinitionVariant, + ToCopyableBuilder { @Nullable private final IcuCollationAlternate alternate; @@ -282,10 +288,23 @@ protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { // --------------------------------------------------------------------------------------------- + @Override + @Nonnull + public Builder toBuilder() { + return new Builder(this); + } + + @Nonnull + public static Builder builder() { + return new Builder(); + } + /** * Builder for {@link IcuCollationTokenFilter}. */ - public static class Builder extends TokenFilterBase.AbstractBuilder implements ObjectBuilder { + public static class Builder extends TokenFilterBase.AbstractBuilder + implements + CopyableBuilder { @Nullable private IcuCollationAlternate alternate; @Nullable @@ -311,9 +330,56 @@ public static class Builder extends TokenFilterBase.AbstractBuilder imp @Nullable private String variant; + public Builder() {} + + private Builder(IcuCollationTokenFilter o) { + super(o); + this.alternate = o.alternate; + this.caseFirst = o.caseFirst; + this.caseLevel = o.caseLevel; + this.country = o.country; + this.decomposition = o.decomposition; + this.hiraganaQuaternaryMode = o.hiraganaQuaternaryMode; + this.language = o.language; + this.numeric = o.numeric; + this.rules = o.rules; + this.strength = o.strength; + this.variableTop = o.variableTop; + this.variant = o.variant; + } + + private Builder(Builder o) { + super(o); + this.alternate = o.alternate; + this.caseFirst = o.caseFirst; + this.caseLevel = o.caseLevel; + this.country = o.country; + this.decomposition = o.decomposition; + this.hiraganaQuaternaryMode = o.hiraganaQuaternaryMode; + this.language = o.language; + this.numeric = o.numeric; + this.rules = o.rules; + this.strength = o.strength; + this.variableTop = o.variableTop; + this.variant = o.variant; + } + + @Override + @Nonnull + public Builder copy() { + return new Builder(this); + } + + @Override + @Nonnull + protected Builder self() { + return this; + } + /** * API name: {@code alternate} */ + @Nonnull public final Builder alternate(@Nullable IcuCollationAlternate value) { this.alternate = value; return this; @@ -322,6 +388,7 @@ public final Builder alternate(@Nullable IcuCollationAlternate value) { /** * API name: {@code caseFirst} */ + @Nonnull public final Builder caseFirst(@Nullable IcuCollationCaseFirst value) { this.caseFirst = value; return this; @@ -330,6 +397,7 @@ public final Builder caseFirst(@Nullable IcuCollationCaseFirst value) { /** * API name: {@code caseLevel} */ + @Nonnull public final Builder caseLevel(@Nullable Boolean value) { this.caseLevel = value; return this; @@ -338,6 +406,7 @@ public final Builder caseLevel(@Nullable Boolean value) { /** * API name: {@code country} */ + @Nonnull public final Builder country(@Nullable String value) { this.country = value; return this; @@ -346,6 +415,7 @@ public final Builder country(@Nullable String value) { /** * API name: {@code decomposition} */ + @Nonnull public final Builder decomposition(@Nullable IcuCollationDecomposition value) { this.decomposition = value; return this; @@ -354,6 +424,7 @@ public final Builder decomposition(@Nullable IcuCollationDecomposition value) { /** * API name: {@code hiraganaQuaternaryMode} */ + @Nonnull public final Builder hiraganaQuaternaryMode(@Nullable Boolean value) { this.hiraganaQuaternaryMode = value; return this; @@ -362,6 +433,7 @@ public final Builder hiraganaQuaternaryMode(@Nullable Boolean value) { /** * API name: {@code language} */ + @Nonnull public final Builder language(@Nullable String value) { this.language = value; return this; @@ -370,6 +442,7 @@ public final Builder language(@Nullable String value) { /** * API name: {@code numeric} */ + @Nonnull public final Builder numeric(@Nullable Boolean value) { this.numeric = value; return this; @@ -378,6 +451,7 @@ public final Builder numeric(@Nullable Boolean value) { /** * API name: {@code rules} */ + @Nonnull public final Builder rules(@Nullable String value) { this.rules = value; return this; @@ -386,6 +460,7 @@ public final Builder rules(@Nullable String value) { /** * API name: {@code strength} */ + @Nonnull public final Builder strength(@Nullable IcuCollationStrength value) { this.strength = value; return this; @@ -394,6 +469,7 @@ public final Builder strength(@Nullable IcuCollationStrength value) { /** * API name: {@code variableTop} */ + @Nonnull public final Builder variableTop(@Nullable String value) { this.variableTop = value; return this; @@ -402,21 +478,19 @@ public final Builder variableTop(@Nullable String value) { /** * API name: {@code variant} */ + @Nonnull public final Builder variant(@Nullable String value) { this.variant = value; return this; } - @Override - protected Builder self() { - return this; - } - /** * Builds a {@link IcuCollationTokenFilter}. * * @throws NullPointerException if some of the required fields are null. */ + @Override + @Nonnull public IcuCollationTokenFilter build() { _checkSingleUse(); diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/analysis/IcuFoldingTokenFilter.java b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/analysis/IcuFoldingTokenFilter.java index e68308484a..abe7a0d67f 100644 --- a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/analysis/IcuFoldingTokenFilter.java +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/analysis/IcuFoldingTokenFilter.java @@ -46,13 +46,18 @@ import org.opensearch.client.json.ObjectBuilderDeserializer; import org.opensearch.client.json.ObjectDeserializer; import org.opensearch.client.util.ApiTypeHelper; +import org.opensearch.client.util.CopyableBuilder; import org.opensearch.client.util.ObjectBuilder; +import org.opensearch.client.util.ToCopyableBuilder; // typedef: _types.analysis.IcuFoldingTokenFilter @JsonpDeserializable @Generated("org.opensearch.client.codegen.CodeGenerator") -public class IcuFoldingTokenFilter extends TokenFilterBase implements TokenFilterDefinitionVariant { +public class IcuFoldingTokenFilter extends TokenFilterBase + implements + TokenFilterDefinitionVariant, + ToCopyableBuilder { @Nonnull private final String unicodeSetFilter; @@ -93,30 +98,65 @@ protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { // --------------------------------------------------------------------------------------------- + @Override + @Nonnull + public Builder toBuilder() { + return new Builder(this); + } + + @Nonnull + public static Builder builder() { + return new Builder(); + } + /** * Builder for {@link IcuFoldingTokenFilter}. */ - public static class Builder extends TokenFilterBase.AbstractBuilder implements ObjectBuilder { + public static class Builder extends TokenFilterBase.AbstractBuilder + implements + CopyableBuilder { private String unicodeSetFilter; + public Builder() {} + + private Builder(IcuFoldingTokenFilter o) { + super(o); + this.unicodeSetFilter = o.unicodeSetFilter; + } + + private Builder(Builder o) { + super(o); + this.unicodeSetFilter = o.unicodeSetFilter; + } + + @Override + @Nonnull + public Builder copy() { + return new Builder(this); + } + + @Override + @Nonnull + protected Builder self() { + return this; + } + /** * Required - API name: {@code unicode_set_filter} */ + @Nonnull public final Builder unicodeSetFilter(String value) { this.unicodeSetFilter = value; return this; } - @Override - protected Builder self() { - return this; - } - /** * Builds a {@link IcuFoldingTokenFilter}. * * @throws NullPointerException if some of the required fields are null. */ + @Override + @Nonnull public IcuFoldingTokenFilter build() { _checkSingleUse(); diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/analysis/IcuNormalizationCharFilter.java b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/analysis/IcuNormalizationCharFilter.java index fe85c7f0b1..ab78c4b283 100644 --- a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/analysis/IcuNormalizationCharFilter.java +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/analysis/IcuNormalizationCharFilter.java @@ -40,19 +40,25 @@ 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.util.CopyableBuilder; import org.opensearch.client.util.ObjectBuilder; +import org.opensearch.client.util.ToCopyableBuilder; // typedef: _types.analysis.IcuNormalizationCharFilter @JsonpDeserializable @Generated("org.opensearch.client.codegen.CodeGenerator") -public class IcuNormalizationCharFilter extends CharFilterBase implements CharFilterDefinitionVariant { +public class IcuNormalizationCharFilter extends CharFilterBase + implements + CharFilterDefinitionVariant, + ToCopyableBuilder { @Nullable private final IcuNormalizationMode mode; @@ -114,18 +120,58 @@ protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { // --------------------------------------------------------------------------------------------- + @Override + @Nonnull + public Builder toBuilder() { + return new Builder(this); + } + + @Nonnull + public static Builder builder() { + return new Builder(); + } + /** * Builder for {@link IcuNormalizationCharFilter}. */ - public static class Builder extends CharFilterBase.AbstractBuilder implements ObjectBuilder { + public static class Builder extends CharFilterBase.AbstractBuilder + implements + CopyableBuilder { @Nullable private IcuNormalizationMode mode; @Nullable private IcuNormalizationType name; + public Builder() {} + + private Builder(IcuNormalizationCharFilter o) { + super(o); + this.mode = o.mode; + this.name = o.name; + } + + private Builder(Builder o) { + super(o); + this.mode = o.mode; + this.name = o.name; + } + + @Override + @Nonnull + public Builder copy() { + return new Builder(this); + } + + @Override + @Nonnull + protected Builder self() { + return this; + } + /** * API name: {@code mode} */ + @Nonnull public final Builder mode(@Nullable IcuNormalizationMode value) { this.mode = value; return this; @@ -134,21 +180,19 @@ public final Builder mode(@Nullable IcuNormalizationMode value) { /** * API name: {@code name} */ + @Nonnull public final Builder name(@Nullable IcuNormalizationType value) { this.name = value; return this; } - @Override - protected Builder self() { - return this; - } - /** * Builds a {@link IcuNormalizationCharFilter}. * * @throws NullPointerException if some of the required fields are null. */ + @Override + @Nonnull public IcuNormalizationCharFilter build() { _checkSingleUse(); diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/analysis/IcuNormalizationTokenFilter.java b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/analysis/IcuNormalizationTokenFilter.java index c9efd56902..dccf9ed028 100644 --- a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/analysis/IcuNormalizationTokenFilter.java +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/analysis/IcuNormalizationTokenFilter.java @@ -46,13 +46,18 @@ import org.opensearch.client.json.ObjectBuilderDeserializer; import org.opensearch.client.json.ObjectDeserializer; import org.opensearch.client.util.ApiTypeHelper; +import org.opensearch.client.util.CopyableBuilder; import org.opensearch.client.util.ObjectBuilder; +import org.opensearch.client.util.ToCopyableBuilder; // typedef: _types.analysis.IcuNormalizationTokenFilter @JsonpDeserializable @Generated("org.opensearch.client.codegen.CodeGenerator") -public class IcuNormalizationTokenFilter extends TokenFilterBase implements TokenFilterDefinitionVariant { +public class IcuNormalizationTokenFilter extends TokenFilterBase + implements + TokenFilterDefinitionVariant, + ToCopyableBuilder { @Nonnull private final IcuNormalizationType name; @@ -95,30 +100,65 @@ protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { // --------------------------------------------------------------------------------------------- + @Override + @Nonnull + public Builder toBuilder() { + return new Builder(this); + } + + @Nonnull + public static Builder builder() { + return new Builder(); + } + /** * Builder for {@link IcuNormalizationTokenFilter}. */ - public static class Builder extends TokenFilterBase.AbstractBuilder implements ObjectBuilder { + public static class Builder extends TokenFilterBase.AbstractBuilder + implements + CopyableBuilder { private IcuNormalizationType name; + public Builder() {} + + private Builder(IcuNormalizationTokenFilter o) { + super(o); + this.name = o.name; + } + + private Builder(Builder o) { + super(o); + this.name = o.name; + } + + @Override + @Nonnull + public Builder copy() { + return new Builder(this); + } + + @Override + @Nonnull + protected Builder self() { + return this; + } + /** * Required - API name: {@code name} */ + @Nonnull public final Builder name(IcuNormalizationType value) { this.name = value; return this; } - @Override - protected Builder self() { - return this; - } - /** * Builds a {@link IcuNormalizationTokenFilter}. * * @throws NullPointerException if some of the required fields are null. */ + @Override + @Nonnull public IcuNormalizationTokenFilter build() { _checkSingleUse(); diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/analysis/IcuTokenizer.java b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/analysis/IcuTokenizer.java index 898277aa83..bf97699e04 100644 --- a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/analysis/IcuTokenizer.java +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/analysis/IcuTokenizer.java @@ -46,13 +46,19 @@ import org.opensearch.client.json.ObjectBuilderDeserializer; import org.opensearch.client.json.ObjectDeserializer; import org.opensearch.client.util.ApiTypeHelper; +import org.opensearch.client.util.CopyableBuilder; import org.opensearch.client.util.ObjectBuilder; +import org.opensearch.client.util.ToCopyableBuilder; // typedef: _types.analysis.IcuTokenizer @JsonpDeserializable @Generated("org.opensearch.client.codegen.CodeGenerator") -public class IcuTokenizer extends TokenizerBase implements TokenFilterDefinitionVariant, TokenizerDefinitionVariant { +public class IcuTokenizer extends TokenizerBase + implements + TokenFilterDefinitionVariant, + TokenizerDefinitionVariant, + ToCopyableBuilder { @Nonnull private final String ruleFiles; @@ -101,30 +107,63 @@ protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { // --------------------------------------------------------------------------------------------- + @Override + @Nonnull + public Builder toBuilder() { + return new Builder(this); + } + + @Nonnull + public static Builder builder() { + return new Builder(); + } + /** * Builder for {@link IcuTokenizer}. */ - public static class Builder extends TokenizerBase.AbstractBuilder implements ObjectBuilder { + public static class Builder extends TokenizerBase.AbstractBuilder implements CopyableBuilder { private String ruleFiles; + public Builder() {} + + private Builder(IcuTokenizer o) { + super(o); + this.ruleFiles = o.ruleFiles; + } + + private Builder(Builder o) { + super(o); + this.ruleFiles = o.ruleFiles; + } + + @Override + @Nonnull + public Builder copy() { + return new Builder(this); + } + + @Override + @Nonnull + protected Builder self() { + return this; + } + /** * Required - API name: {@code rule_files} */ + @Nonnull public final Builder ruleFiles(String value) { this.ruleFiles = value; return this; } - @Override - protected Builder self() { - return this; - } - /** * Builds a {@link IcuTokenizer}. * * @throws NullPointerException if some of the required fields are null. */ + @Override + @Nonnull public IcuTokenizer build() { _checkSingleUse(); diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/analysis/IcuTransformTokenFilter.java b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/analysis/IcuTransformTokenFilter.java index 3c935972c7..43a693fe88 100644 --- a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/analysis/IcuTransformTokenFilter.java +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/analysis/IcuTransformTokenFilter.java @@ -48,13 +48,18 @@ import org.opensearch.client.json.ObjectBuilderDeserializer; import org.opensearch.client.json.ObjectDeserializer; import org.opensearch.client.util.ApiTypeHelper; +import org.opensearch.client.util.CopyableBuilder; import org.opensearch.client.util.ObjectBuilder; +import org.opensearch.client.util.ToCopyableBuilder; // typedef: _types.analysis.IcuTransformTokenFilter @JsonpDeserializable @Generated("org.opensearch.client.codegen.CodeGenerator") -public class IcuTransformTokenFilter extends TokenFilterBase implements TokenFilterDefinitionVariant { +public class IcuTransformTokenFilter extends TokenFilterBase + implements + TokenFilterDefinitionVariant, + ToCopyableBuilder { @Nullable private final IcuTransformDirection dir; @@ -112,17 +117,57 @@ protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { // --------------------------------------------------------------------------------------------- + @Override + @Nonnull + public Builder toBuilder() { + return new Builder(this); + } + + @Nonnull + public static Builder builder() { + return new Builder(); + } + /** * Builder for {@link IcuTransformTokenFilter}. */ - public static class Builder extends TokenFilterBase.AbstractBuilder implements ObjectBuilder { + public static class Builder extends TokenFilterBase.AbstractBuilder + implements + CopyableBuilder { @Nullable private IcuTransformDirection dir; private String id; + public Builder() {} + + private Builder(IcuTransformTokenFilter o) { + super(o); + this.dir = o.dir; + this.id = o.id; + } + + private Builder(Builder o) { + super(o); + this.dir = o.dir; + this.id = o.id; + } + + @Override + @Nonnull + public Builder copy() { + return new Builder(this); + } + + @Override + @Nonnull + protected Builder self() { + return this; + } + /** * API name: {@code dir} */ + @Nonnull public final Builder dir(@Nullable IcuTransformDirection value) { this.dir = value; return this; @@ -131,21 +176,19 @@ public final Builder dir(@Nullable IcuTransformDirection value) { /** * Required - API name: {@code id} */ + @Nonnull public final Builder id(String value) { this.id = value; return this; } - @Override - protected Builder self() { - return this; - } - /** * Builds a {@link IcuTransformTokenFilter}. * * @throws NullPointerException if some of the required fields are null. */ + @Override + @Nonnull public IcuTransformTokenFilter build() { _checkSingleUse(); diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/analysis/KStemTokenFilter.java b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/analysis/KStemTokenFilter.java index cd5c56a267..1628bf9c58 100644 --- a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/analysis/KStemTokenFilter.java +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/analysis/KStemTokenFilter.java @@ -39,18 +39,24 @@ 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.util.CopyableBuilder; import org.opensearch.client.util.ObjectBuilder; +import org.opensearch.client.util.ToCopyableBuilder; // typedef: _types.analysis.KStemTokenFilter @JsonpDeserializable @Generated("org.opensearch.client.codegen.CodeGenerator") -public class KStemTokenFilter extends TokenFilterBase implements TokenFilterDefinitionVariant { +public class KStemTokenFilter extends TokenFilterBase + implements + TokenFilterDefinitionVariant, + ToCopyableBuilder { // --------------------------------------------------------------------------------------------- @@ -77,12 +83,40 @@ protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { // --------------------------------------------------------------------------------------------- + @Override + @Nonnull + public Builder toBuilder() { + return new Builder(this); + } + + @Nonnull + public static Builder builder() { + return new Builder(); + } + /** * Builder for {@link KStemTokenFilter}. */ - public static class Builder extends TokenFilterBase.AbstractBuilder implements ObjectBuilder { + public static class Builder extends TokenFilterBase.AbstractBuilder implements CopyableBuilder { + + public Builder() {} + + private Builder(KStemTokenFilter o) { + super(o); + } + + private Builder(Builder o) { + super(o); + } @Override + @Nonnull + public Builder copy() { + return new Builder(this); + } + + @Override + @Nonnull protected Builder self() { return this; } @@ -92,6 +126,8 @@ protected Builder self() { * * @throws NullPointerException if some of the required fields are null. */ + @Override + @Nonnull public KStemTokenFilter build() { _checkSingleUse(); diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/analysis/KeepTypesTokenFilter.java b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/analysis/KeepTypesTokenFilter.java index eefb1202ac..e2e1887297 100644 --- a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/analysis/KeepTypesTokenFilter.java +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/analysis/KeepTypesTokenFilter.java @@ -49,13 +49,18 @@ import org.opensearch.client.json.ObjectBuilderDeserializer; import org.opensearch.client.json.ObjectDeserializer; import org.opensearch.client.util.ApiTypeHelper; +import org.opensearch.client.util.CopyableBuilder; import org.opensearch.client.util.ObjectBuilder; +import org.opensearch.client.util.ToCopyableBuilder; // typedef: _types.analysis.KeepTypesTokenFilter @JsonpDeserializable @Generated("org.opensearch.client.codegen.CodeGenerator") -public class KeepTypesTokenFilter extends TokenFilterBase implements TokenFilterDefinitionVariant { +public class KeepTypesTokenFilter extends TokenFilterBase + implements + TokenFilterDefinitionVariant, + ToCopyableBuilder { @Nullable private final KeepTypesMode mode; @@ -119,18 +124,56 @@ protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { // --------------------------------------------------------------------------------------------- + @Override + @Nonnull + public Builder toBuilder() { + return new Builder(this); + } + + @Nonnull + public static Builder builder() { + return new Builder(); + } + /** * Builder for {@link KeepTypesTokenFilter}. */ - public static class Builder extends TokenFilterBase.AbstractBuilder implements ObjectBuilder { + public static class Builder extends TokenFilterBase.AbstractBuilder implements CopyableBuilder { @Nullable private KeepTypesMode mode; @Nullable private List types; + public Builder() {} + + private Builder(KeepTypesTokenFilter o) { + super(o); + this.mode = o.mode; + this.types = _listCopy(o.types); + } + + private Builder(Builder o) { + super(o); + this.mode = o.mode; + this.types = _listCopy(o.types); + } + + @Override + @Nonnull + public Builder copy() { + return new Builder(this); + } + + @Override + @Nonnull + protected Builder self() { + return this; + } + /** * API name: {@code mode} */ + @Nonnull public final Builder mode(@Nullable KeepTypesMode value) { this.mode = value; return this; @@ -143,6 +186,7 @@ public final Builder mode(@Nullable KeepTypesMode value) { * Adds all elements of list to types. *

*/ + @Nonnull public final Builder types(List list) { this.types = _listAddAll(this.types, list); return this; @@ -155,21 +199,19 @@ public final Builder types(List list) { * Adds one or more values to types. *

*/ + @Nonnull public final Builder types(String value, String... values) { this.types = _listAdd(this.types, value, values); return this; } - @Override - protected Builder self() { - return this; - } - /** * Builds a {@link KeepTypesTokenFilter}. * * @throws NullPointerException if some of the required fields are null. */ + @Override + @Nonnull public KeepTypesTokenFilter build() { _checkSingleUse(); diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/analysis/KeepWordsTokenFilter.java b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/analysis/KeepWordsTokenFilter.java index 1afdc8719f..09898a575c 100644 --- a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/analysis/KeepWordsTokenFilter.java +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/analysis/KeepWordsTokenFilter.java @@ -49,13 +49,18 @@ import org.opensearch.client.json.ObjectBuilderDeserializer; import org.opensearch.client.json.ObjectDeserializer; import org.opensearch.client.util.ApiTypeHelper; +import org.opensearch.client.util.CopyableBuilder; import org.opensearch.client.util.ObjectBuilder; +import org.opensearch.client.util.ToCopyableBuilder; // typedef: _types.analysis.KeepWordsTokenFilter @JsonpDeserializable @Generated("org.opensearch.client.codegen.CodeGenerator") -public class KeepWordsTokenFilter extends TokenFilterBase implements TokenFilterDefinitionVariant { +public class KeepWordsTokenFilter extends TokenFilterBase + implements + TokenFilterDefinitionVariant, + ToCopyableBuilder { @Nonnull private final List keepWords; @@ -136,10 +141,21 @@ protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { // --------------------------------------------------------------------------------------------- + @Override + @Nonnull + public Builder toBuilder() { + return new Builder(this); + } + + @Nonnull + public static Builder builder() { + return new Builder(); + } + /** * Builder for {@link KeepWordsTokenFilter}. */ - public static class Builder extends TokenFilterBase.AbstractBuilder implements ObjectBuilder { + public static class Builder extends TokenFilterBase.AbstractBuilder implements CopyableBuilder { @Nullable private List keepWords; @Nullable @@ -147,6 +163,34 @@ public static class Builder extends TokenFilterBase.AbstractBuilder imp @Nullable private String keepWordsPath; + public Builder() {} + + private Builder(KeepWordsTokenFilter o) { + super(o); + this.keepWords = _listCopy(o.keepWords); + this.keepWordsCase = o.keepWordsCase; + this.keepWordsPath = o.keepWordsPath; + } + + private Builder(Builder o) { + super(o); + this.keepWords = _listCopy(o.keepWords); + this.keepWordsCase = o.keepWordsCase; + this.keepWordsPath = o.keepWordsPath; + } + + @Override + @Nonnull + public Builder copy() { + return new Builder(this); + } + + @Override + @Nonnull + protected Builder self() { + return this; + } + /** * API name: {@code keep_words} * @@ -154,6 +198,7 @@ public static class Builder extends TokenFilterBase.AbstractBuilder imp * Adds all elements of list to keepWords. *

*/ + @Nonnull public final Builder keepWords(List list) { this.keepWords = _listAddAll(this.keepWords, list); return this; @@ -166,6 +211,7 @@ public final Builder keepWords(List list) { * Adds one or more values to keepWords. *

*/ + @Nonnull public final Builder keepWords(String value, String... values) { this.keepWords = _listAdd(this.keepWords, value, values); return this; @@ -174,6 +220,7 @@ public final Builder keepWords(String value, String... values) { /** * API name: {@code keep_words_case} */ + @Nonnull public final Builder keepWordsCase(@Nullable Boolean value) { this.keepWordsCase = value; return this; @@ -182,21 +229,19 @@ public final Builder keepWordsCase(@Nullable Boolean value) { /** * API name: {@code keep_words_path} */ + @Nonnull public final Builder keepWordsPath(@Nullable String value) { this.keepWordsPath = value; return this; } - @Override - protected Builder self() { - return this; - } - /** * Builds a {@link KeepWordsTokenFilter}. * * @throws NullPointerException if some of the required fields are null. */ + @Override + @Nonnull public KeepWordsTokenFilter build() { _checkSingleUse(); diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/analysis/KeywordAnalyzer.java b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/analysis/KeywordAnalyzer.java index e07fcee2bb..4a157e8d72 100644 --- a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/analysis/KeywordAnalyzer.java +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/analysis/KeywordAnalyzer.java @@ -40,6 +40,7 @@ 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; @@ -47,14 +48,20 @@ 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: _types.analysis.KeywordAnalyzer @JsonpDeserializable @Generated("org.opensearch.client.codegen.CodeGenerator") -public class KeywordAnalyzer implements AnalyzerVariant, PlainJsonSerializable { +public class KeywordAnalyzer + implements + AnalyzerVariant, + PlainJsonSerializable, + ToCopyableBuilder { @Nullable private final String version; @@ -105,16 +112,44 @@ protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { // --------------------------------------------------------------------------------------------- + @Override + @Nonnull + public Builder toBuilder() { + return new Builder(this); + } + + @Nonnull + public static Builder builder() { + return new Builder(); + } + /** * Builder for {@link KeywordAnalyzer}. */ - public static class Builder extends ObjectBuilderBase implements ObjectBuilder { + public static class Builder extends ObjectBuilderBase implements CopyableBuilder { @Nullable private String version; + public Builder() {} + + private Builder(KeywordAnalyzer o) { + this.version = o.version; + } + + private Builder(Builder o) { + this.version = o.version; + } + + @Override + @Nonnull + public Builder copy() { + return new Builder(this); + } + /** * API name: {@code version} */ + @Nonnull public final Builder version(@Nullable String value) { this.version = value; return this; @@ -125,6 +160,8 @@ public final Builder version(@Nullable String value) { * * @throws NullPointerException if some of the required fields are null. */ + @Override + @Nonnull public KeywordAnalyzer build() { _checkSingleUse(); diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/analysis/KeywordMarkerTokenFilter.java b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/analysis/KeywordMarkerTokenFilter.java index 4fcffb2126..933ae27e37 100644 --- a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/analysis/KeywordMarkerTokenFilter.java +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/analysis/KeywordMarkerTokenFilter.java @@ -49,13 +49,18 @@ import org.opensearch.client.json.ObjectBuilderDeserializer; import org.opensearch.client.json.ObjectDeserializer; import org.opensearch.client.util.ApiTypeHelper; +import org.opensearch.client.util.CopyableBuilder; import org.opensearch.client.util.ObjectBuilder; +import org.opensearch.client.util.ToCopyableBuilder; // typedef: _types.analysis.KeywordMarkerTokenFilter @JsonpDeserializable @Generated("org.opensearch.client.codegen.CodeGenerator") -public class KeywordMarkerTokenFilter extends TokenFilterBase implements TokenFilterDefinitionVariant { +public class KeywordMarkerTokenFilter extends TokenFilterBase + implements + TokenFilterDefinitionVariant, + ToCopyableBuilder { @Nullable private final Boolean ignoreCase; @@ -153,10 +158,23 @@ protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { // --------------------------------------------------------------------------------------------- + @Override + @Nonnull + public Builder toBuilder() { + return new Builder(this); + } + + @Nonnull + public static Builder builder() { + return new Builder(); + } + /** * Builder for {@link KeywordMarkerTokenFilter}. */ - public static class Builder extends TokenFilterBase.AbstractBuilder implements ObjectBuilder { + public static class Builder extends TokenFilterBase.AbstractBuilder + implements + CopyableBuilder { @Nullable private Boolean ignoreCase; @Nullable @@ -166,9 +184,40 @@ public static class Builder extends TokenFilterBase.AbstractBuilder imp @Nullable private String keywordsPattern; + public Builder() {} + + private Builder(KeywordMarkerTokenFilter o) { + super(o); + this.ignoreCase = o.ignoreCase; + this.keywords = _listCopy(o.keywords); + this.keywordsPath = o.keywordsPath; + this.keywordsPattern = o.keywordsPattern; + } + + private Builder(Builder o) { + super(o); + this.ignoreCase = o.ignoreCase; + this.keywords = _listCopy(o.keywords); + this.keywordsPath = o.keywordsPath; + this.keywordsPattern = o.keywordsPattern; + } + + @Override + @Nonnull + public Builder copy() { + return new Builder(this); + } + + @Override + @Nonnull + protected Builder self() { + return this; + } + /** * API name: {@code ignore_case} */ + @Nonnull public final Builder ignoreCase(@Nullable Boolean value) { this.ignoreCase = value; return this; @@ -181,6 +230,7 @@ public final Builder ignoreCase(@Nullable Boolean value) { * Adds all elements of list to keywords. *

*/ + @Nonnull public final Builder keywords(List list) { this.keywords = _listAddAll(this.keywords, list); return this; @@ -193,6 +243,7 @@ public final Builder keywords(List list) { * Adds one or more values to keywords. *

*/ + @Nonnull public final Builder keywords(String value, String... values) { this.keywords = _listAdd(this.keywords, value, values); return this; @@ -201,6 +252,7 @@ public final Builder keywords(String value, String... values) { /** * API name: {@code keywords_path} */ + @Nonnull public final Builder keywordsPath(@Nullable String value) { this.keywordsPath = value; return this; @@ -209,21 +261,19 @@ public final Builder keywordsPath(@Nullable String value) { /** * API name: {@code keywords_pattern} */ + @Nonnull public final Builder keywordsPattern(@Nullable String value) { this.keywordsPattern = value; return this; } - @Override - protected Builder self() { - return this; - } - /** * Builds a {@link KeywordMarkerTokenFilter}. * * @throws NullPointerException if some of the required fields are null. */ + @Override + @Nonnull public KeywordMarkerTokenFilter build() { _checkSingleUse(); diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/analysis/KeywordTokenizer.java b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/analysis/KeywordTokenizer.java index 22e2c34351..dff142d1f8 100644 --- a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/analysis/KeywordTokenizer.java +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/analysis/KeywordTokenizer.java @@ -39,19 +39,25 @@ 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.util.ApiTypeHelper; +import org.opensearch.client.util.CopyableBuilder; import org.opensearch.client.util.ObjectBuilder; +import org.opensearch.client.util.ToCopyableBuilder; // typedef: _types.analysis.KeywordTokenizer @JsonpDeserializable @Generated("org.opensearch.client.codegen.CodeGenerator") -public class KeywordTokenizer extends TokenizerBase implements TokenizerDefinitionVariant { +public class KeywordTokenizer extends TokenizerBase + implements + TokenizerDefinitionVariant, + ToCopyableBuilder { private final int bufferSize; @@ -90,30 +96,63 @@ protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { // --------------------------------------------------------------------------------------------- + @Override + @Nonnull + public Builder toBuilder() { + return new Builder(this); + } + + @Nonnull + public static Builder builder() { + return new Builder(); + } + /** * Builder for {@link KeywordTokenizer}. */ - public static class Builder extends TokenizerBase.AbstractBuilder implements ObjectBuilder { + public static class Builder extends TokenizerBase.AbstractBuilder implements CopyableBuilder { private Integer bufferSize; + public Builder() {} + + private Builder(KeywordTokenizer o) { + super(o); + this.bufferSize = o.bufferSize; + } + + private Builder(Builder o) { + super(o); + this.bufferSize = o.bufferSize; + } + + @Override + @Nonnull + public Builder copy() { + return new Builder(this); + } + + @Override + @Nonnull + protected Builder self() { + return this; + } + /** * Required - API name: {@code buffer_size} */ + @Nonnull public final Builder bufferSize(int value) { this.bufferSize = value; return this; } - @Override - protected Builder self() { - return this; - } - /** * Builds a {@link KeywordTokenizer}. * * @throws NullPointerException if some of the required fields are null. */ + @Override + @Nonnull public KeywordTokenizer build() { _checkSingleUse(); diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/analysis/KuromojiAnalyzer.java b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/analysis/KuromojiAnalyzer.java index e11721df24..93c365ddd2 100644 --- a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/analysis/KuromojiAnalyzer.java +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/analysis/KuromojiAnalyzer.java @@ -49,14 +49,20 @@ 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: _types.analysis.KuromojiAnalyzer @JsonpDeserializable @Generated("org.opensearch.client.codegen.CodeGenerator") -public class KuromojiAnalyzer implements AnalyzerVariant, PlainJsonSerializable { +public class KuromojiAnalyzer + implements + AnalyzerVariant, + PlainJsonSerializable, + ToCopyableBuilder { @Nonnull private final KuromojiTokenizationMode mode; @@ -122,17 +128,47 @@ protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { // --------------------------------------------------------------------------------------------- + @Override + @Nonnull + public Builder toBuilder() { + return new Builder(this); + } + + @Nonnull + public static Builder builder() { + return new Builder(); + } + /** * Builder for {@link KuromojiAnalyzer}. */ - public static class Builder extends ObjectBuilderBase implements ObjectBuilder { + public static class Builder extends ObjectBuilderBase implements CopyableBuilder { private KuromojiTokenizationMode mode; @Nullable private String userDictionary; + public Builder() {} + + private Builder(KuromojiAnalyzer o) { + this.mode = o.mode; + this.userDictionary = o.userDictionary; + } + + private Builder(Builder o) { + this.mode = o.mode; + this.userDictionary = o.userDictionary; + } + + @Override + @Nonnull + public Builder copy() { + return new Builder(this); + } + /** * Required - API name: {@code mode} */ + @Nonnull public final Builder mode(KuromojiTokenizationMode value) { this.mode = value; return this; @@ -141,6 +177,7 @@ public final Builder mode(KuromojiTokenizationMode value) { /** * API name: {@code user_dictionary} */ + @Nonnull public final Builder userDictionary(@Nullable String value) { this.userDictionary = value; return this; @@ -151,6 +188,8 @@ public final Builder userDictionary(@Nullable String value) { * * @throws NullPointerException if some of the required fields are null. */ + @Override + @Nonnull public KuromojiAnalyzer build() { _checkSingleUse(); diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/analysis/KuromojiIterationMarkCharFilter.java b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/analysis/KuromojiIterationMarkCharFilter.java index 83b3f956dd..c2f093e5d8 100644 --- a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/analysis/KuromojiIterationMarkCharFilter.java +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/analysis/KuromojiIterationMarkCharFilter.java @@ -39,19 +39,25 @@ 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.util.ApiTypeHelper; +import org.opensearch.client.util.CopyableBuilder; import org.opensearch.client.util.ObjectBuilder; +import org.opensearch.client.util.ToCopyableBuilder; // typedef: _types.analysis.KuromojiIterationMarkCharFilter @JsonpDeserializable @Generated("org.opensearch.client.codegen.CodeGenerator") -public class KuromojiIterationMarkCharFilter extends CharFilterBase implements CharFilterDefinitionVariant { +public class KuromojiIterationMarkCharFilter extends CharFilterBase + implements + CharFilterDefinitionVariant, + ToCopyableBuilder { private final boolean normalizeKana; @@ -105,16 +111,56 @@ protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { // --------------------------------------------------------------------------------------------- + @Override + @Nonnull + public Builder toBuilder() { + return new Builder(this); + } + + @Nonnull + public static Builder builder() { + return new Builder(); + } + /** * Builder for {@link KuromojiIterationMarkCharFilter}. */ - public static class Builder extends CharFilterBase.AbstractBuilder implements ObjectBuilder { + public static class Builder extends CharFilterBase.AbstractBuilder + implements + CopyableBuilder { private Boolean normalizeKana; private Boolean normalizeKanji; + public Builder() {} + + private Builder(KuromojiIterationMarkCharFilter o) { + super(o); + this.normalizeKana = o.normalizeKana; + this.normalizeKanji = o.normalizeKanji; + } + + private Builder(Builder o) { + super(o); + this.normalizeKana = o.normalizeKana; + this.normalizeKanji = o.normalizeKanji; + } + + @Override + @Nonnull + public Builder copy() { + return new Builder(this); + } + + @Override + @Nonnull + protected Builder self() { + return this; + } + /** * Required - API name: {@code normalize_kana} */ + @Nonnull public final Builder normalizeKana(boolean value) { this.normalizeKana = value; return this; @@ -123,21 +169,19 @@ public final Builder normalizeKana(boolean value) { /** * Required - API name: {@code normalize_kanji} */ + @Nonnull public final Builder normalizeKanji(boolean value) { this.normalizeKanji = value; return this; } - @Override - protected Builder self() { - return this; - } - /** * Builds a {@link KuromojiIterationMarkCharFilter}. * * @throws NullPointerException if some of the required fields are null. */ + @Override + @Nonnull public KuromojiIterationMarkCharFilter build() { _checkSingleUse(); diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/analysis/KuromojiPartOfSpeechTokenFilter.java b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/analysis/KuromojiPartOfSpeechTokenFilter.java index 44422e4ae2..51f10f82e7 100644 --- a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/analysis/KuromojiPartOfSpeechTokenFilter.java +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/analysis/KuromojiPartOfSpeechTokenFilter.java @@ -47,13 +47,18 @@ import org.opensearch.client.json.ObjectBuilderDeserializer; import org.opensearch.client.json.ObjectDeserializer; import org.opensearch.client.util.ApiTypeHelper; +import org.opensearch.client.util.CopyableBuilder; import org.opensearch.client.util.ObjectBuilder; +import org.opensearch.client.util.ToCopyableBuilder; // typedef: _types.analysis.KuromojiPartOfSpeechTokenFilter @JsonpDeserializable @Generated("org.opensearch.client.codegen.CodeGenerator") -public class KuromojiPartOfSpeechTokenFilter extends TokenFilterBase implements TokenFilterDefinitionVariant { +public class KuromojiPartOfSpeechTokenFilter extends TokenFilterBase + implements + TokenFilterDefinitionVariant, + ToCopyableBuilder { @Nonnull private final List stoptags; @@ -100,12 +105,49 @@ protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { // --------------------------------------------------------------------------------------------- + @Override + @Nonnull + public Builder toBuilder() { + return new Builder(this); + } + + @Nonnull + public static Builder builder() { + return new Builder(); + } + /** * Builder for {@link KuromojiPartOfSpeechTokenFilter}. */ - public static class Builder extends TokenFilterBase.AbstractBuilder implements ObjectBuilder { + public static class Builder extends TokenFilterBase.AbstractBuilder + implements + CopyableBuilder { private List stoptags; + public Builder() {} + + private Builder(KuromojiPartOfSpeechTokenFilter o) { + super(o); + this.stoptags = _listCopy(o.stoptags); + } + + private Builder(Builder o) { + super(o); + this.stoptags = _listCopy(o.stoptags); + } + + @Override + @Nonnull + public Builder copy() { + return new Builder(this); + } + + @Override + @Nonnull + protected Builder self() { + return this; + } + /** * Required - API name: {@code stoptags} * @@ -113,6 +155,7 @@ public static class Builder extends TokenFilterBase.AbstractBuilder imp * Adds all elements of list to stoptags. *

*/ + @Nonnull public final Builder stoptags(List list) { this.stoptags = _listAddAll(this.stoptags, list); return this; @@ -125,21 +168,19 @@ public final Builder stoptags(List list) { * Adds one or more values to stoptags. *

*/ + @Nonnull public final Builder stoptags(String value, String... values) { this.stoptags = _listAdd(this.stoptags, value, values); return this; } - @Override - protected Builder self() { - return this; - } - /** * Builds a {@link KuromojiPartOfSpeechTokenFilter}. * * @throws NullPointerException if some of the required fields are null. */ + @Override + @Nonnull public KuromojiPartOfSpeechTokenFilter build() { _checkSingleUse(); diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/analysis/KuromojiReadingFormTokenFilter.java b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/analysis/KuromojiReadingFormTokenFilter.java index 1a9f994572..f7e4889c8a 100644 --- a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/analysis/KuromojiReadingFormTokenFilter.java +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/analysis/KuromojiReadingFormTokenFilter.java @@ -39,19 +39,25 @@ 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.util.ApiTypeHelper; +import org.opensearch.client.util.CopyableBuilder; import org.opensearch.client.util.ObjectBuilder; +import org.opensearch.client.util.ToCopyableBuilder; // typedef: _types.analysis.KuromojiReadingFormTokenFilter @JsonpDeserializable @Generated("org.opensearch.client.codegen.CodeGenerator") -public class KuromojiReadingFormTokenFilter extends TokenFilterBase implements TokenFilterDefinitionVariant { +public class KuromojiReadingFormTokenFilter extends TokenFilterBase + implements + TokenFilterDefinitionVariant, + ToCopyableBuilder { private final boolean useRomaji; @@ -92,30 +98,65 @@ protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { // --------------------------------------------------------------------------------------------- + @Override + @Nonnull + public Builder toBuilder() { + return new Builder(this); + } + + @Nonnull + public static Builder builder() { + return new Builder(); + } + /** * Builder for {@link KuromojiReadingFormTokenFilter}. */ - public static class Builder extends TokenFilterBase.AbstractBuilder implements ObjectBuilder { + public static class Builder extends TokenFilterBase.AbstractBuilder + implements + CopyableBuilder { private Boolean useRomaji; + public Builder() {} + + private Builder(KuromojiReadingFormTokenFilter o) { + super(o); + this.useRomaji = o.useRomaji; + } + + private Builder(Builder o) { + super(o); + this.useRomaji = o.useRomaji; + } + + @Override + @Nonnull + public Builder copy() { + return new Builder(this); + } + + @Override + @Nonnull + protected Builder self() { + return this; + } + /** * Required - API name: {@code use_romaji} */ + @Nonnull public final Builder useRomaji(boolean value) { this.useRomaji = value; return this; } - @Override - protected Builder self() { - return this; - } - /** * Builds a {@link KuromojiReadingFormTokenFilter}. * * @throws NullPointerException if some of the required fields are null. */ + @Override + @Nonnull public KuromojiReadingFormTokenFilter build() { _checkSingleUse(); diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/analysis/KuromojiStemmerTokenFilter.java b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/analysis/KuromojiStemmerTokenFilter.java index f81d218c35..2df7a5bd6e 100644 --- a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/analysis/KuromojiStemmerTokenFilter.java +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/analysis/KuromojiStemmerTokenFilter.java @@ -39,19 +39,25 @@ 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.util.ApiTypeHelper; +import org.opensearch.client.util.CopyableBuilder; import org.opensearch.client.util.ObjectBuilder; +import org.opensearch.client.util.ToCopyableBuilder; // typedef: _types.analysis.KuromojiStemmerTokenFilter @JsonpDeserializable @Generated("org.opensearch.client.codegen.CodeGenerator") -public class KuromojiStemmerTokenFilter extends TokenFilterBase implements TokenFilterDefinitionVariant { +public class KuromojiStemmerTokenFilter extends TokenFilterBase + implements + TokenFilterDefinitionVariant, + ToCopyableBuilder { private final int minimumLength; @@ -92,30 +98,65 @@ protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { // --------------------------------------------------------------------------------------------- + @Override + @Nonnull + public Builder toBuilder() { + return new Builder(this); + } + + @Nonnull + public static Builder builder() { + return new Builder(); + } + /** * Builder for {@link KuromojiStemmerTokenFilter}. */ - public static class Builder extends TokenFilterBase.AbstractBuilder implements ObjectBuilder { + public static class Builder extends TokenFilterBase.AbstractBuilder + implements + CopyableBuilder { private Integer minimumLength; + public Builder() {} + + private Builder(KuromojiStemmerTokenFilter o) { + super(o); + this.minimumLength = o.minimumLength; + } + + private Builder(Builder o) { + super(o); + this.minimumLength = o.minimumLength; + } + + @Override + @Nonnull + public Builder copy() { + return new Builder(this); + } + + @Override + @Nonnull + protected Builder self() { + return this; + } + /** * Required - API name: {@code minimum_length} */ + @Nonnull public final Builder minimumLength(int value) { this.minimumLength = value; return this; } - @Override - protected Builder self() { - return this; - } - /** * Builds a {@link KuromojiStemmerTokenFilter}. * * @throws NullPointerException if some of the required fields are null. */ + @Override + @Nonnull public KuromojiStemmerTokenFilter build() { _checkSingleUse(); diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/analysis/KuromojiTokenizer.java b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/analysis/KuromojiTokenizer.java index 014a25a373..54badca36b 100644 --- a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/analysis/KuromojiTokenizer.java +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/analysis/KuromojiTokenizer.java @@ -49,13 +49,18 @@ import org.opensearch.client.json.ObjectBuilderDeserializer; import org.opensearch.client.json.ObjectDeserializer; import org.opensearch.client.util.ApiTypeHelper; +import org.opensearch.client.util.CopyableBuilder; import org.opensearch.client.util.ObjectBuilder; +import org.opensearch.client.util.ToCopyableBuilder; // typedef: _types.analysis.KuromojiTokenizer @JsonpDeserializable @Generated("org.opensearch.client.codegen.CodeGenerator") -public class KuromojiTokenizer extends TokenizerBase implements TokenizerDefinitionVariant { +public class KuromojiTokenizer extends TokenizerBase + implements + TokenizerDefinitionVariant, + ToCopyableBuilder { @Nullable private final Boolean discardCompoundToken; @@ -202,10 +207,21 @@ protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { // --------------------------------------------------------------------------------------------- + @Override + @Nonnull + public Builder toBuilder() { + return new Builder(this); + } + + @Nonnull + public static Builder builder() { + return new Builder(); + } + /** * Builder for {@link KuromojiTokenizer}. */ - public static class Builder extends TokenizerBase.AbstractBuilder implements ObjectBuilder { + public static class Builder extends TokenizerBase.AbstractBuilder implements CopyableBuilder { @Nullable private Boolean discardCompoundToken; @Nullable @@ -220,9 +236,46 @@ public static class Builder extends TokenizerBase.AbstractBuilder imple @Nullable private List userDictionaryRules; + public Builder() {} + + private Builder(KuromojiTokenizer o) { + super(o); + this.discardCompoundToken = o.discardCompoundToken; + this.discardPunctuation = o.discardPunctuation; + this.mode = o.mode; + this.nbestCost = o.nbestCost; + this.nbestExamples = o.nbestExamples; + this.userDictionary = o.userDictionary; + this.userDictionaryRules = _listCopy(o.userDictionaryRules); + } + + private Builder(Builder o) { + super(o); + this.discardCompoundToken = o.discardCompoundToken; + this.discardPunctuation = o.discardPunctuation; + this.mode = o.mode; + this.nbestCost = o.nbestCost; + this.nbestExamples = o.nbestExamples; + this.userDictionary = o.userDictionary; + this.userDictionaryRules = _listCopy(o.userDictionaryRules); + } + + @Override + @Nonnull + public Builder copy() { + return new Builder(this); + } + + @Override + @Nonnull + protected Builder self() { + return this; + } + /** * API name: {@code discard_compound_token} */ + @Nonnull public final Builder discardCompoundToken(@Nullable Boolean value) { this.discardCompoundToken = value; return this; @@ -231,6 +284,7 @@ public final Builder discardCompoundToken(@Nullable Boolean value) { /** * API name: {@code discard_punctuation} */ + @Nonnull public final Builder discardPunctuation(@Nullable Boolean value) { this.discardPunctuation = value; return this; @@ -239,6 +293,7 @@ public final Builder discardPunctuation(@Nullable Boolean value) { /** * Required - API name: {@code mode} */ + @Nonnull public final Builder mode(KuromojiTokenizationMode value) { this.mode = value; return this; @@ -247,6 +302,7 @@ public final Builder mode(KuromojiTokenizationMode value) { /** * API name: {@code nbest_cost} */ + @Nonnull public final Builder nbestCost(@Nullable Integer value) { this.nbestCost = value; return this; @@ -255,6 +311,7 @@ public final Builder nbestCost(@Nullable Integer value) { /** * API name: {@code nbest_examples} */ + @Nonnull public final Builder nbestExamples(@Nullable String value) { this.nbestExamples = value; return this; @@ -263,6 +320,7 @@ public final Builder nbestExamples(@Nullable String value) { /** * API name: {@code user_dictionary} */ + @Nonnull public final Builder userDictionary(@Nullable String value) { this.userDictionary = value; return this; @@ -275,6 +333,7 @@ public final Builder userDictionary(@Nullable String value) { * Adds all elements of list to userDictionaryRules. *

*/ + @Nonnull public final Builder userDictionaryRules(List list) { this.userDictionaryRules = _listAddAll(this.userDictionaryRules, list); return this; @@ -287,21 +346,19 @@ public final Builder userDictionaryRules(List list) { * Adds one or more values to userDictionaryRules. *

*/ + @Nonnull public final Builder userDictionaryRules(String value, String... values) { this.userDictionaryRules = _listAdd(this.userDictionaryRules, value, values); return this; } - @Override - protected Builder self() { - return this; - } - /** * Builds a {@link KuromojiTokenizer}. * * @throws NullPointerException if some of the required fields are null. */ + @Override + @Nonnull public KuromojiTokenizer build() { _checkSingleUse(); diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/analysis/LanguageAnalyzer.java b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/analysis/LanguageAnalyzer.java index 0c187e6cb8..6627cc27b2 100644 --- a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/analysis/LanguageAnalyzer.java +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/analysis/LanguageAnalyzer.java @@ -50,14 +50,20 @@ 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: _types.analysis.LanguageAnalyzer @JsonpDeserializable @Generated("org.opensearch.client.codegen.CodeGenerator") -public class LanguageAnalyzer implements AnalyzerVariant, PlainJsonSerializable { +public class LanguageAnalyzer + implements + AnalyzerVariant, + PlainJsonSerializable, + ToCopyableBuilder { @Nonnull private final Language language; @@ -180,10 +186,21 @@ protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { // --------------------------------------------------------------------------------------------- + @Override + @Nonnull + public Builder toBuilder() { + return new Builder(this); + } + + @Nonnull + public static Builder builder() { + return new Builder(); + } + /** * Builder for {@link LanguageAnalyzer}. */ - public static class Builder extends ObjectBuilderBase implements ObjectBuilder { + public static class Builder extends ObjectBuilderBase implements CopyableBuilder { private Language language; private List stemExclusion; @Nullable @@ -193,9 +210,34 @@ public static class Builder extends ObjectBuilderBase implements ObjectBuilderlist to stemExclusion. *

*/ + @Nonnull public final Builder stemExclusion(List list) { this.stemExclusion = _listAddAll(this.stemExclusion, list); return this; @@ -220,6 +263,7 @@ public final Builder stemExclusion(List list) { * Adds one or more values to stemExclusion. *

*/ + @Nonnull public final Builder stemExclusion(String value, String... values) { this.stemExclusion = _listAdd(this.stemExclusion, value, values); return this; @@ -232,6 +276,7 @@ public final Builder stemExclusion(String value, String... values) { * Adds all elements of list to stopwords. *

*/ + @Nonnull public final Builder stopwords(List list) { this.stopwords = _listAddAll(this.stopwords, list); return this; @@ -244,6 +289,7 @@ public final Builder stopwords(List list) { * Adds one or more values to stopwords. *

*/ + @Nonnull public final Builder stopwords(String value, String... values) { this.stopwords = _listAdd(this.stopwords, value, values); return this; @@ -252,6 +298,7 @@ public final Builder stopwords(String value, String... values) { /** * API name: {@code stopwords_path} */ + @Nonnull public final Builder stopwordsPath(@Nullable String value) { this.stopwordsPath = value; return this; @@ -260,6 +307,7 @@ public final Builder stopwordsPath(@Nullable String value) { /** * API name: {@code version} */ + @Nonnull public final Builder version(@Nullable String value) { this.version = value; return this; @@ -270,6 +318,8 @@ public final Builder version(@Nullable String value) { * * @throws NullPointerException if some of the required fields are null. */ + @Override + @Nonnull public LanguageAnalyzer build() { _checkSingleUse(); diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/analysis/LengthTokenFilter.java b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/analysis/LengthTokenFilter.java index afe5457655..b1c74204b7 100644 --- a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/analysis/LengthTokenFilter.java +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/analysis/LengthTokenFilter.java @@ -40,19 +40,25 @@ 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.util.CopyableBuilder; import org.opensearch.client.util.ObjectBuilder; +import org.opensearch.client.util.ToCopyableBuilder; // typedef: _types.analysis.LengthTokenFilter @JsonpDeserializable @Generated("org.opensearch.client.codegen.CodeGenerator") -public class LengthTokenFilter extends TokenFilterBase implements TokenFilterDefinitionVariant { +public class LengthTokenFilter extends TokenFilterBase + implements + TokenFilterDefinitionVariant, + ToCopyableBuilder { @Nullable private final Integer max; @@ -112,18 +118,56 @@ protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { // --------------------------------------------------------------------------------------------- + @Override + @Nonnull + public Builder toBuilder() { + return new Builder(this); + } + + @Nonnull + public static Builder builder() { + return new Builder(); + } + /** * Builder for {@link LengthTokenFilter}. */ - public static class Builder extends TokenFilterBase.AbstractBuilder implements ObjectBuilder { + public static class Builder extends TokenFilterBase.AbstractBuilder implements CopyableBuilder { @Nullable private Integer max; @Nullable private Integer min; + public Builder() {} + + private Builder(LengthTokenFilter o) { + super(o); + this.max = o.max; + this.min = o.min; + } + + private Builder(Builder o) { + super(o); + this.max = o.max; + this.min = o.min; + } + + @Override + @Nonnull + public Builder copy() { + return new Builder(this); + } + + @Override + @Nonnull + protected Builder self() { + return this; + } + /** * API name: {@code max} */ + @Nonnull public final Builder max(@Nullable Integer value) { this.max = value; return this; @@ -132,21 +176,19 @@ public final Builder max(@Nullable Integer value) { /** * API name: {@code min} */ + @Nonnull public final Builder min(@Nullable Integer value) { this.min = value; return this; } - @Override - protected Builder self() { - return this; - } - /** * Builds a {@link LengthTokenFilter}. * * @throws NullPointerException if some of the required fields are null. */ + @Override + @Nonnull public LengthTokenFilter build() { _checkSingleUse(); diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/analysis/LetterTokenizer.java b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/analysis/LetterTokenizer.java index 2766d43eb4..491aeba5a1 100644 --- a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/analysis/LetterTokenizer.java +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/analysis/LetterTokenizer.java @@ -39,18 +39,24 @@ 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.util.CopyableBuilder; import org.opensearch.client.util.ObjectBuilder; +import org.opensearch.client.util.ToCopyableBuilder; // typedef: _types.analysis.LetterTokenizer @JsonpDeserializable @Generated("org.opensearch.client.codegen.CodeGenerator") -public class LetterTokenizer extends TokenizerBase implements TokenizerDefinitionVariant { +public class LetterTokenizer extends TokenizerBase + implements + TokenizerDefinitionVariant, + ToCopyableBuilder { // --------------------------------------------------------------------------------------------- @@ -77,12 +83,40 @@ protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { // --------------------------------------------------------------------------------------------- + @Override + @Nonnull + public Builder toBuilder() { + return new Builder(this); + } + + @Nonnull + public static Builder builder() { + return new Builder(); + } + /** * Builder for {@link LetterTokenizer}. */ - public static class Builder extends TokenizerBase.AbstractBuilder implements ObjectBuilder { + public static class Builder extends TokenizerBase.AbstractBuilder implements CopyableBuilder { + + public Builder() {} + + private Builder(LetterTokenizer o) { + super(o); + } + + private Builder(Builder o) { + super(o); + } @Override + @Nonnull + public Builder copy() { + return new Builder(this); + } + + @Override + @Nonnull protected Builder self() { return this; } @@ -92,6 +126,8 @@ protected Builder self() { * * @throws NullPointerException if some of the required fields are null. */ + @Override + @Nonnull public LetterTokenizer build() { _checkSingleUse(); diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/analysis/LimitTokenCountTokenFilter.java b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/analysis/LimitTokenCountTokenFilter.java index 5017b0f792..f745acd90c 100644 --- a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/analysis/LimitTokenCountTokenFilter.java +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/analysis/LimitTokenCountTokenFilter.java @@ -40,19 +40,25 @@ 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.util.CopyableBuilder; import org.opensearch.client.util.ObjectBuilder; +import org.opensearch.client.util.ToCopyableBuilder; // typedef: _types.analysis.LimitTokenCountTokenFilter @JsonpDeserializable @Generated("org.opensearch.client.codegen.CodeGenerator") -public class LimitTokenCountTokenFilter extends TokenFilterBase implements TokenFilterDefinitionVariant { +public class LimitTokenCountTokenFilter extends TokenFilterBase + implements + TokenFilterDefinitionVariant, + ToCopyableBuilder { @Nullable private final Boolean consumeAllTokens; @@ -114,18 +120,58 @@ protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { // --------------------------------------------------------------------------------------------- + @Override + @Nonnull + public Builder toBuilder() { + return new Builder(this); + } + + @Nonnull + public static Builder builder() { + return new Builder(); + } + /** * Builder for {@link LimitTokenCountTokenFilter}. */ - public static class Builder extends TokenFilterBase.AbstractBuilder implements ObjectBuilder { + public static class Builder extends TokenFilterBase.AbstractBuilder + implements + CopyableBuilder { @Nullable private Boolean consumeAllTokens; @Nullable private Integer maxTokenCount; + public Builder() {} + + private Builder(LimitTokenCountTokenFilter o) { + super(o); + this.consumeAllTokens = o.consumeAllTokens; + this.maxTokenCount = o.maxTokenCount; + } + + private Builder(Builder o) { + super(o); + this.consumeAllTokens = o.consumeAllTokens; + this.maxTokenCount = o.maxTokenCount; + } + + @Override + @Nonnull + public Builder copy() { + return new Builder(this); + } + + @Override + @Nonnull + protected Builder self() { + return this; + } + /** * API name: {@code consume_all_tokens} */ + @Nonnull public final Builder consumeAllTokens(@Nullable Boolean value) { this.consumeAllTokens = value; return this; @@ -134,21 +180,19 @@ public final Builder consumeAllTokens(@Nullable Boolean value) { /** * API name: {@code max_token_count} */ + @Nonnull public final Builder maxTokenCount(@Nullable Integer value) { this.maxTokenCount = value; return this; } - @Override - protected Builder self() { - return this; - } - /** * Builds a {@link LimitTokenCountTokenFilter}. * * @throws NullPointerException if some of the required fields are null. */ + @Override + @Nonnull public LimitTokenCountTokenFilter build() { _checkSingleUse(); diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/analysis/LowercaseNormalizer.java b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/analysis/LowercaseNormalizer.java index 90a93ec363..96b5a29980 100644 --- a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/analysis/LowercaseNormalizer.java +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/analysis/LowercaseNormalizer.java @@ -39,20 +39,27 @@ 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.CopyableBuilder; import org.opensearch.client.util.ObjectBuilder; import org.opensearch.client.util.ObjectBuilderBase; +import org.opensearch.client.util.ToCopyableBuilder; // typedef: _types.analysis.LowercaseNormalizer @JsonpDeserializable @Generated("org.opensearch.client.codegen.CodeGenerator") -public class LowercaseNormalizer implements NormalizerVariant, PlainJsonSerializable { +public class LowercaseNormalizer + implements + NormalizerVariant, + PlainJsonSerializable, + ToCopyableBuilder { // --------------------------------------------------------------------------------------------- @@ -86,16 +93,41 @@ protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { // --------------------------------------------------------------------------------------------- + @Override + @Nonnull + public Builder toBuilder() { + return new Builder(this); + } + + @Nonnull + public static Builder builder() { + return new Builder(); + } + /** * Builder for {@link LowercaseNormalizer}. */ - public static class Builder extends ObjectBuilderBase implements ObjectBuilder { + public static class Builder extends ObjectBuilderBase implements CopyableBuilder { + + public Builder() {} + + private Builder(LowercaseNormalizer o) {} + + private Builder(Builder o) {} + + @Override + @Nonnull + public Builder copy() { + return new Builder(this); + } /** * Builds a {@link LowercaseNormalizer}. * * @throws NullPointerException if some of the required fields are null. */ + @Override + @Nonnull public LowercaseNormalizer build() { _checkSingleUse(); diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/analysis/LowercaseTokenFilter.java b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/analysis/LowercaseTokenFilter.java index 325d4a5d4b..a2ba23d928 100644 --- a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/analysis/LowercaseTokenFilter.java +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/analysis/LowercaseTokenFilter.java @@ -40,19 +40,25 @@ 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.util.CopyableBuilder; import org.opensearch.client.util.ObjectBuilder; +import org.opensearch.client.util.ToCopyableBuilder; // typedef: _types.analysis.LowercaseTokenFilter @JsonpDeserializable @Generated("org.opensearch.client.codegen.CodeGenerator") -public class LowercaseTokenFilter extends TokenFilterBase implements TokenFilterDefinitionVariant { +public class LowercaseTokenFilter extends TokenFilterBase + implements + TokenFilterDefinitionVariant, + ToCopyableBuilder { @Nullable private final String language; @@ -95,31 +101,64 @@ protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { // --------------------------------------------------------------------------------------------- + @Override + @Nonnull + public Builder toBuilder() { + return new Builder(this); + } + + @Nonnull + public static Builder builder() { + return new Builder(); + } + /** * Builder for {@link LowercaseTokenFilter}. */ - public static class Builder extends TokenFilterBase.AbstractBuilder implements ObjectBuilder { + public static class Builder extends TokenFilterBase.AbstractBuilder implements CopyableBuilder { @Nullable private String language; + public Builder() {} + + private Builder(LowercaseTokenFilter o) { + super(o); + this.language = o.language; + } + + private Builder(Builder o) { + super(o); + this.language = o.language; + } + + @Override + @Nonnull + public Builder copy() { + return new Builder(this); + } + + @Override + @Nonnull + protected Builder self() { + return this; + } + /** * API name: {@code language} */ + @Nonnull public final Builder language(@Nullable String value) { this.language = value; return this; } - @Override - protected Builder self() { - return this; - } - /** * Builds a {@link LowercaseTokenFilter}. * * @throws NullPointerException if some of the required fields are null. */ + @Override + @Nonnull public LowercaseTokenFilter build() { _checkSingleUse(); diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/analysis/LowercaseTokenizer.java b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/analysis/LowercaseTokenizer.java index 03571a3b32..7235200232 100644 --- a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/analysis/LowercaseTokenizer.java +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/analysis/LowercaseTokenizer.java @@ -39,18 +39,24 @@ 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.util.CopyableBuilder; import org.opensearch.client.util.ObjectBuilder; +import org.opensearch.client.util.ToCopyableBuilder; // typedef: _types.analysis.LowercaseTokenizer @JsonpDeserializable @Generated("org.opensearch.client.codegen.CodeGenerator") -public class LowercaseTokenizer extends TokenizerBase implements TokenizerDefinitionVariant { +public class LowercaseTokenizer extends TokenizerBase + implements + TokenizerDefinitionVariant, + ToCopyableBuilder { // --------------------------------------------------------------------------------------------- @@ -77,12 +83,40 @@ protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { // --------------------------------------------------------------------------------------------- + @Override + @Nonnull + public Builder toBuilder() { + return new Builder(this); + } + + @Nonnull + public static Builder builder() { + return new Builder(); + } + /** * Builder for {@link LowercaseTokenizer}. */ - public static class Builder extends TokenizerBase.AbstractBuilder implements ObjectBuilder { + public static class Builder extends TokenizerBase.AbstractBuilder implements CopyableBuilder { + + public Builder() {} + + private Builder(LowercaseTokenizer o) { + super(o); + } + + private Builder(Builder o) { + super(o); + } @Override + @Nonnull + public Builder copy() { + return new Builder(this); + } + + @Override + @Nonnull protected Builder self() { return this; } @@ -92,6 +126,8 @@ protected Builder self() { * * @throws NullPointerException if some of the required fields are null. */ + @Override + @Nonnull public LowercaseTokenizer build() { _checkSingleUse(); diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/analysis/MappingCharFilter.java b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/analysis/MappingCharFilter.java index eae1f4f1d0..8596cfdaca 100644 --- a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/analysis/MappingCharFilter.java +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/analysis/MappingCharFilter.java @@ -49,13 +49,18 @@ import org.opensearch.client.json.ObjectBuilderDeserializer; import org.opensearch.client.json.ObjectDeserializer; import org.opensearch.client.util.ApiTypeHelper; +import org.opensearch.client.util.CopyableBuilder; import org.opensearch.client.util.ObjectBuilder; +import org.opensearch.client.util.ToCopyableBuilder; // typedef: _types.analysis.MappingCharFilter @JsonpDeserializable @Generated("org.opensearch.client.codegen.CodeGenerator") -public class MappingCharFilter extends CharFilterBase implements CharFilterDefinitionVariant { +public class MappingCharFilter extends CharFilterBase + implements + CharFilterDefinitionVariant, + ToCopyableBuilder { @Nonnull private final List mappings; @@ -119,15 +124,52 @@ protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { // --------------------------------------------------------------------------------------------- + @Override + @Nonnull + public Builder toBuilder() { + return new Builder(this); + } + + @Nonnull + public static Builder builder() { + return new Builder(); + } + /** * Builder for {@link MappingCharFilter}. */ - public static class Builder extends CharFilterBase.AbstractBuilder implements ObjectBuilder { + public static class Builder extends CharFilterBase.AbstractBuilder implements CopyableBuilder { @Nullable private List mappings; @Nullable private String mappingsPath; + public Builder() {} + + private Builder(MappingCharFilter o) { + super(o); + this.mappings = _listCopy(o.mappings); + this.mappingsPath = o.mappingsPath; + } + + private Builder(Builder o) { + super(o); + this.mappings = _listCopy(o.mappings); + this.mappingsPath = o.mappingsPath; + } + + @Override + @Nonnull + public Builder copy() { + return new Builder(this); + } + + @Override + @Nonnull + protected Builder self() { + return this; + } + /** * API name: {@code mappings} * @@ -135,6 +177,7 @@ public static class Builder extends CharFilterBase.AbstractBuilder impl * Adds all elements of list to mappings. *

*/ + @Nonnull public final Builder mappings(List list) { this.mappings = _listAddAll(this.mappings, list); return this; @@ -147,6 +190,7 @@ public final Builder mappings(List list) { * Adds one or more values to mappings. *

*/ + @Nonnull public final Builder mappings(String value, String... values) { this.mappings = _listAdd(this.mappings, value, values); return this; @@ -155,21 +199,19 @@ public final Builder mappings(String value, String... values) { /** * API name: {@code mappings_path} */ + @Nonnull public final Builder mappingsPath(@Nullable String value) { this.mappingsPath = value; return this; } - @Override - protected Builder self() { - return this; - } - /** * Builds a {@link MappingCharFilter}. * * @throws NullPointerException if some of the required fields are null. */ + @Override + @Nonnull public MappingCharFilter build() { _checkSingleUse(); diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/analysis/MultiplexerTokenFilter.java b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/analysis/MultiplexerTokenFilter.java index cbd921ee3e..8d15439b92 100644 --- a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/analysis/MultiplexerTokenFilter.java +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/analysis/MultiplexerTokenFilter.java @@ -49,13 +49,18 @@ import org.opensearch.client.json.ObjectBuilderDeserializer; import org.opensearch.client.json.ObjectDeserializer; import org.opensearch.client.util.ApiTypeHelper; +import org.opensearch.client.util.CopyableBuilder; import org.opensearch.client.util.ObjectBuilder; +import org.opensearch.client.util.ToCopyableBuilder; // typedef: _types.analysis.MultiplexerTokenFilter @JsonpDeserializable @Generated("org.opensearch.client.codegen.CodeGenerator") -public class MultiplexerTokenFilter extends TokenFilterBase implements TokenFilterDefinitionVariant { +public class MultiplexerTokenFilter extends TokenFilterBase + implements + TokenFilterDefinitionVariant, + ToCopyableBuilder { @Nonnull private final List filters; @@ -117,14 +122,53 @@ protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { // --------------------------------------------------------------------------------------------- + @Override + @Nonnull + public Builder toBuilder() { + return new Builder(this); + } + + @Nonnull + public static Builder builder() { + return new Builder(); + } + /** * Builder for {@link MultiplexerTokenFilter}. */ - public static class Builder extends TokenFilterBase.AbstractBuilder implements ObjectBuilder { + public static class Builder extends TokenFilterBase.AbstractBuilder + implements + CopyableBuilder { private List filters; @Nullable private Boolean preserveOriginal; + public Builder() {} + + private Builder(MultiplexerTokenFilter o) { + super(o); + this.filters = _listCopy(o.filters); + this.preserveOriginal = o.preserveOriginal; + } + + private Builder(Builder o) { + super(o); + this.filters = _listCopy(o.filters); + this.preserveOriginal = o.preserveOriginal; + } + + @Override + @Nonnull + public Builder copy() { + return new Builder(this); + } + + @Override + @Nonnull + protected Builder self() { + return this; + } + /** * Required - API name: {@code filters} * @@ -132,6 +176,7 @@ public static class Builder extends TokenFilterBase.AbstractBuilder imp * Adds all elements of list to filters. *

*/ + @Nonnull public final Builder filters(List list) { this.filters = _listAddAll(this.filters, list); return this; @@ -144,6 +189,7 @@ public final Builder filters(List list) { * Adds one or more values to filters. *

*/ + @Nonnull public final Builder filters(String value, String... values) { this.filters = _listAdd(this.filters, value, values); return this; @@ -152,21 +198,19 @@ public final Builder filters(String value, String... values) { /** * API name: {@code preserve_original} */ + @Nonnull public final Builder preserveOriginal(@Nullable Boolean value) { this.preserveOriginal = value; return this; } - @Override - protected Builder self() { - return this; - } - /** * Builds a {@link MultiplexerTokenFilter}. * * @throws NullPointerException if some of the required fields are null. */ + @Override + @Nonnull public MultiplexerTokenFilter build() { _checkSingleUse(); diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/analysis/NGramTokenFilter.java b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/analysis/NGramTokenFilter.java index 7fda3bcb2f..1d5f8d2cdd 100644 --- a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/analysis/NGramTokenFilter.java +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/analysis/NGramTokenFilter.java @@ -40,19 +40,25 @@ 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.util.CopyableBuilder; import org.opensearch.client.util.ObjectBuilder; +import org.opensearch.client.util.ToCopyableBuilder; // typedef: _types.analysis.NGramTokenFilter @JsonpDeserializable @Generated("org.opensearch.client.codegen.CodeGenerator") -public class NGramTokenFilter extends TokenFilterBase implements TokenFilterDefinitionVariant { +public class NGramTokenFilter extends TokenFilterBase + implements + TokenFilterDefinitionVariant, + ToCopyableBuilder { @Nullable private final Integer maxGram; @@ -129,10 +135,21 @@ protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { // --------------------------------------------------------------------------------------------- + @Override + @Nonnull + public Builder toBuilder() { + return new Builder(this); + } + + @Nonnull + public static Builder builder() { + return new Builder(); + } + /** * Builder for {@link NGramTokenFilter}. */ - public static class Builder extends TokenFilterBase.AbstractBuilder implements ObjectBuilder { + public static class Builder extends TokenFilterBase.AbstractBuilder implements CopyableBuilder { @Nullable private Integer maxGram; @Nullable @@ -140,9 +157,38 @@ public static class Builder extends TokenFilterBase.AbstractBuilder imp @Nullable private Boolean preserveOriginal; + public Builder() {} + + private Builder(NGramTokenFilter o) { + super(o); + this.maxGram = o.maxGram; + this.minGram = o.minGram; + this.preserveOriginal = o.preserveOriginal; + } + + private Builder(Builder o) { + super(o); + this.maxGram = o.maxGram; + this.minGram = o.minGram; + this.preserveOriginal = o.preserveOriginal; + } + + @Override + @Nonnull + public Builder copy() { + return new Builder(this); + } + + @Override + @Nonnull + protected Builder self() { + return this; + } + /** * API name: {@code max_gram} */ + @Nonnull public final Builder maxGram(@Nullable Integer value) { this.maxGram = value; return this; @@ -151,6 +197,7 @@ public final Builder maxGram(@Nullable Integer value) { /** * API name: {@code min_gram} */ + @Nonnull public final Builder minGram(@Nullable Integer value) { this.minGram = value; return this; @@ -159,21 +206,19 @@ public final Builder minGram(@Nullable Integer value) { /** * API name: {@code preserve_original} */ + @Nonnull public final Builder preserveOriginal(@Nullable Boolean value) { this.preserveOriginal = value; return this; } - @Override - protected Builder self() { - return this; - } - /** * Builds a {@link NGramTokenFilter}. * * @throws NullPointerException if some of the required fields are null. */ + @Override + @Nonnull public NGramTokenFilter build() { _checkSingleUse(); diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/analysis/NGramTokenizer.java b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/analysis/NGramTokenizer.java index 7cde148839..eb51526024 100644 --- a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/analysis/NGramTokenizer.java +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/analysis/NGramTokenizer.java @@ -49,13 +49,18 @@ import org.opensearch.client.json.ObjectBuilderDeserializer; import org.opensearch.client.json.ObjectDeserializer; import org.opensearch.client.util.ApiTypeHelper; +import org.opensearch.client.util.CopyableBuilder; import org.opensearch.client.util.ObjectBuilder; +import org.opensearch.client.util.ToCopyableBuilder; // typedef: _types.analysis.NGramTokenizer @JsonpDeserializable @Generated("org.opensearch.client.codegen.CodeGenerator") -public class NGramTokenizer extends TokenizerBase implements TokenizerDefinitionVariant { +public class NGramTokenizer extends TokenizerBase + implements + TokenizerDefinitionVariant, + ToCopyableBuilder { @Nullable private final String customTokenChars; @@ -143,19 +148,61 @@ protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { // --------------------------------------------------------------------------------------------- + @Override + @Nonnull + public Builder toBuilder() { + return new Builder(this); + } + + @Nonnull + public static Builder builder() { + return new Builder(); + } + /** * Builder for {@link NGramTokenizer}. */ - public static class Builder extends TokenizerBase.AbstractBuilder implements ObjectBuilder { + public static class Builder extends TokenizerBase.AbstractBuilder implements CopyableBuilder { @Nullable private String customTokenChars; private Integer maxGram; private Integer minGram; private List tokenChars; + public Builder() {} + + private Builder(NGramTokenizer o) { + super(o); + this.customTokenChars = o.customTokenChars; + this.maxGram = o.maxGram; + this.minGram = o.minGram; + this.tokenChars = _listCopy(o.tokenChars); + } + + private Builder(Builder o) { + super(o); + this.customTokenChars = o.customTokenChars; + this.maxGram = o.maxGram; + this.minGram = o.minGram; + this.tokenChars = _listCopy(o.tokenChars); + } + + @Override + @Nonnull + public Builder copy() { + return new Builder(this); + } + + @Override + @Nonnull + protected Builder self() { + return this; + } + /** * API name: {@code custom_token_chars} */ + @Nonnull public final Builder customTokenChars(@Nullable String value) { this.customTokenChars = value; return this; @@ -164,6 +211,7 @@ public final Builder customTokenChars(@Nullable String value) { /** * Required - API name: {@code max_gram} */ + @Nonnull public final Builder maxGram(int value) { this.maxGram = value; return this; @@ -172,6 +220,7 @@ public final Builder maxGram(int value) { /** * Required - API name: {@code min_gram} */ + @Nonnull public final Builder minGram(int value) { this.minGram = value; return this; @@ -184,6 +233,7 @@ public final Builder minGram(int value) { * Adds all elements of list to tokenChars. *

*/ + @Nonnull public final Builder tokenChars(List list) { this.tokenChars = _listAddAll(this.tokenChars, list); return this; @@ -196,21 +246,19 @@ public final Builder tokenChars(List list) { * Adds one or more values to tokenChars. *

*/ + @Nonnull public final Builder tokenChars(TokenChar value, TokenChar... values) { this.tokenChars = _listAdd(this.tokenChars, value, values); return this; } - @Override - protected Builder self() { - return this; - } - /** * Builds a {@link NGramTokenizer}. * * @throws NullPointerException if some of the required fields are null. */ + @Override + @Nonnull public NGramTokenizer build() { _checkSingleUse(); diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/analysis/NoriAnalyzer.java b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/analysis/NoriAnalyzer.java index 2984e679d9..9f80fac603 100644 --- a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/analysis/NoriAnalyzer.java +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/analysis/NoriAnalyzer.java @@ -50,14 +50,16 @@ 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: _types.analysis.NoriAnalyzer @JsonpDeserializable @Generated("org.opensearch.client.codegen.CodeGenerator") -public class NoriAnalyzer implements AnalyzerVariant, PlainJsonSerializable { +public class NoriAnalyzer implements AnalyzerVariant, PlainJsonSerializable, ToCopyableBuilder { @Nullable private final NoriDecompoundMode decompoundMode; @@ -163,10 +165,21 @@ protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { // --------------------------------------------------------------------------------------------- + @Override + @Nonnull + public Builder toBuilder() { + return new Builder(this); + } + + @Nonnull + public static Builder builder() { + return new Builder(); + } + /** * Builder for {@link NoriAnalyzer}. */ - public static class Builder extends ObjectBuilderBase implements ObjectBuilder { + public static class Builder extends ObjectBuilderBase implements CopyableBuilder { @Nullable private NoriDecompoundMode decompoundMode; @Nullable @@ -176,9 +189,32 @@ public static class Builder extends ObjectBuilderBase implements ObjectBuilderlist to stoptags. *

*/ + @Nonnull public final Builder stoptags(List list) { this.stoptags = _listAddAll(this.stoptags, list); return this; @@ -203,6 +240,7 @@ public final Builder stoptags(List list) { * Adds one or more values to stoptags. *

*/ + @Nonnull public final Builder stoptags(String value, String... values) { this.stoptags = _listAdd(this.stoptags, value, values); return this; @@ -211,6 +249,7 @@ public final Builder stoptags(String value, String... values) { /** * API name: {@code user_dictionary} */ + @Nonnull public final Builder userDictionary(@Nullable String value) { this.userDictionary = value; return this; @@ -219,6 +258,7 @@ public final Builder userDictionary(@Nullable String value) { /** * API name: {@code version} */ + @Nonnull public final Builder version(@Nullable String value) { this.version = value; return this; @@ -229,6 +269,8 @@ public final Builder version(@Nullable String value) { * * @throws NullPointerException if some of the required fields are null. */ + @Override + @Nonnull public NoriAnalyzer build() { _checkSingleUse(); diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/analysis/NoriPartOfSpeechTokenFilter.java b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/analysis/NoriPartOfSpeechTokenFilter.java index c131f932f1..c323788815 100644 --- a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/analysis/NoriPartOfSpeechTokenFilter.java +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/analysis/NoriPartOfSpeechTokenFilter.java @@ -49,13 +49,18 @@ import org.opensearch.client.json.ObjectBuilderDeserializer; import org.opensearch.client.json.ObjectDeserializer; import org.opensearch.client.util.ApiTypeHelper; +import org.opensearch.client.util.CopyableBuilder; import org.opensearch.client.util.ObjectBuilder; +import org.opensearch.client.util.ToCopyableBuilder; // typedef: _types.analysis.NoriPartOfSpeechTokenFilter @JsonpDeserializable @Generated("org.opensearch.client.codegen.CodeGenerator") -public class NoriPartOfSpeechTokenFilter extends TokenFilterBase implements TokenFilterDefinitionVariant { +public class NoriPartOfSpeechTokenFilter extends TokenFilterBase + implements + TokenFilterDefinitionVariant, + ToCopyableBuilder { @Nonnull private final List stoptags; @@ -104,13 +109,50 @@ protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { // --------------------------------------------------------------------------------------------- + @Override + @Nonnull + public Builder toBuilder() { + return new Builder(this); + } + + @Nonnull + public static Builder builder() { + return new Builder(); + } + /** * Builder for {@link NoriPartOfSpeechTokenFilter}. */ - public static class Builder extends TokenFilterBase.AbstractBuilder implements ObjectBuilder { + public static class Builder extends TokenFilterBase.AbstractBuilder + implements + CopyableBuilder { @Nullable private List stoptags; + public Builder() {} + + private Builder(NoriPartOfSpeechTokenFilter o) { + super(o); + this.stoptags = _listCopy(o.stoptags); + } + + private Builder(Builder o) { + super(o); + this.stoptags = _listCopy(o.stoptags); + } + + @Override + @Nonnull + public Builder copy() { + return new Builder(this); + } + + @Override + @Nonnull + protected Builder self() { + return this; + } + /** * API name: {@code stoptags} * @@ -118,6 +160,7 @@ public static class Builder extends TokenFilterBase.AbstractBuilder imp * Adds all elements of list to stoptags. *

*/ + @Nonnull public final Builder stoptags(List list) { this.stoptags = _listAddAll(this.stoptags, list); return this; @@ -130,21 +173,19 @@ public final Builder stoptags(List list) { * Adds one or more values to stoptags. *

*/ + @Nonnull public final Builder stoptags(String value, String... values) { this.stoptags = _listAdd(this.stoptags, value, values); return this; } - @Override - protected Builder self() { - return this; - } - /** * Builds a {@link NoriPartOfSpeechTokenFilter}. * * @throws NullPointerException if some of the required fields are null. */ + @Override + @Nonnull public NoriPartOfSpeechTokenFilter build() { _checkSingleUse(); diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/analysis/NoriTokenizer.java b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/analysis/NoriTokenizer.java index 2464594b7b..e1899f607d 100644 --- a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/analysis/NoriTokenizer.java +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/analysis/NoriTokenizer.java @@ -49,13 +49,18 @@ import org.opensearch.client.json.ObjectBuilderDeserializer; import org.opensearch.client.json.ObjectDeserializer; import org.opensearch.client.util.ApiTypeHelper; +import org.opensearch.client.util.CopyableBuilder; import org.opensearch.client.util.ObjectBuilder; +import org.opensearch.client.util.ToCopyableBuilder; // typedef: _types.analysis.NoriTokenizer @JsonpDeserializable @Generated("org.opensearch.client.codegen.CodeGenerator") -public class NoriTokenizer extends TokenizerBase implements TokenizerDefinitionVariant { +public class NoriTokenizer extends TokenizerBase + implements + TokenizerDefinitionVariant, + ToCopyableBuilder { @Nullable private final NoriDecompoundMode decompoundMode; @@ -153,10 +158,21 @@ protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { // --------------------------------------------------------------------------------------------- + @Override + @Nonnull + public Builder toBuilder() { + return new Builder(this); + } + + @Nonnull + public static Builder builder() { + return new Builder(); + } + /** * Builder for {@link NoriTokenizer}. */ - public static class Builder extends TokenizerBase.AbstractBuilder implements ObjectBuilder { + public static class Builder extends TokenizerBase.AbstractBuilder implements CopyableBuilder { @Nullable private NoriDecompoundMode decompoundMode; @Nullable @@ -166,9 +182,40 @@ public static class Builder extends TokenizerBase.AbstractBuilder imple @Nullable private List userDictionaryRules; + public Builder() {} + + private Builder(NoriTokenizer o) { + super(o); + this.decompoundMode = o.decompoundMode; + this.discardPunctuation = o.discardPunctuation; + this.userDictionary = o.userDictionary; + this.userDictionaryRules = _listCopy(o.userDictionaryRules); + } + + private Builder(Builder o) { + super(o); + this.decompoundMode = o.decompoundMode; + this.discardPunctuation = o.discardPunctuation; + this.userDictionary = o.userDictionary; + this.userDictionaryRules = _listCopy(o.userDictionaryRules); + } + + @Override + @Nonnull + public Builder copy() { + return new Builder(this); + } + + @Override + @Nonnull + protected Builder self() { + return this; + } + /** * API name: {@code decompound_mode} */ + @Nonnull public final Builder decompoundMode(@Nullable NoriDecompoundMode value) { this.decompoundMode = value; return this; @@ -177,6 +224,7 @@ public final Builder decompoundMode(@Nullable NoriDecompoundMode value) { /** * API name: {@code discard_punctuation} */ + @Nonnull public final Builder discardPunctuation(@Nullable Boolean value) { this.discardPunctuation = value; return this; @@ -185,6 +233,7 @@ public final Builder discardPunctuation(@Nullable Boolean value) { /** * API name: {@code user_dictionary} */ + @Nonnull public final Builder userDictionary(@Nullable String value) { this.userDictionary = value; return this; @@ -197,6 +246,7 @@ public final Builder userDictionary(@Nullable String value) { * Adds all elements of list to userDictionaryRules. *

*/ + @Nonnull public final Builder userDictionaryRules(List list) { this.userDictionaryRules = _listAddAll(this.userDictionaryRules, list); return this; @@ -209,21 +259,19 @@ public final Builder userDictionaryRules(List list) { * Adds one or more values to userDictionaryRules. *

*/ + @Nonnull public final Builder userDictionaryRules(String value, String... values) { this.userDictionaryRules = _listAdd(this.userDictionaryRules, value, values); return this; } - @Override - protected Builder self() { - return this; - } - /** * Builds a {@link NoriTokenizer}. * * @throws NullPointerException if some of the required fields are null. */ + @Override + @Nonnull public NoriTokenizer build() { _checkSingleUse(); diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/analysis/PathHierarchyTokenizer.java b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/analysis/PathHierarchyTokenizer.java index 2e04bd93d4..c6f3d02aba 100644 --- a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/analysis/PathHierarchyTokenizer.java +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/analysis/PathHierarchyTokenizer.java @@ -48,13 +48,18 @@ import org.opensearch.client.json.ObjectBuilderDeserializer; import org.opensearch.client.json.ObjectDeserializer; import org.opensearch.client.util.ApiTypeHelper; +import org.opensearch.client.util.CopyableBuilder; import org.opensearch.client.util.ObjectBuilder; +import org.opensearch.client.util.ToCopyableBuilder; // typedef: _types.analysis.PathHierarchyTokenizer @JsonpDeserializable @Generated("org.opensearch.client.codegen.CodeGenerator") -public class PathHierarchyTokenizer extends TokenizerBase implements TokenizerDefinitionVariant { +public class PathHierarchyTokenizer extends TokenizerBase + implements + TokenizerDefinitionVariant, + ToCopyableBuilder { private final int bufferSize; @@ -151,10 +156,21 @@ protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { // --------------------------------------------------------------------------------------------- + @Override + @Nonnull + public Builder toBuilder() { + return new Builder(this); + } + + @Nonnull + public static Builder builder() { + return new Builder(); + } + /** * Builder for {@link PathHierarchyTokenizer}. */ - public static class Builder extends TokenizerBase.AbstractBuilder implements ObjectBuilder { + public static class Builder extends TokenizerBase.AbstractBuilder implements CopyableBuilder { private Integer bufferSize; private String delimiter; @Nullable @@ -162,9 +178,42 @@ public static class Builder extends TokenizerBase.AbstractBuilder imple private Boolean reverse; private Integer skip; + public Builder() {} + + private Builder(PathHierarchyTokenizer o) { + super(o); + this.bufferSize = o.bufferSize; + this.delimiter = o.delimiter; + this.replacement = o.replacement; + this.reverse = o.reverse; + this.skip = o.skip; + } + + private Builder(Builder o) { + super(o); + this.bufferSize = o.bufferSize; + this.delimiter = o.delimiter; + this.replacement = o.replacement; + this.reverse = o.reverse; + this.skip = o.skip; + } + + @Override + @Nonnull + public Builder copy() { + return new Builder(this); + } + + @Override + @Nonnull + protected Builder self() { + return this; + } + /** * Required - API name: {@code buffer_size} */ + @Nonnull public final Builder bufferSize(int value) { this.bufferSize = value; return this; @@ -173,6 +222,7 @@ public final Builder bufferSize(int value) { /** * Required - API name: {@code delimiter} */ + @Nonnull public final Builder delimiter(String value) { this.delimiter = value; return this; @@ -181,6 +231,7 @@ public final Builder delimiter(String value) { /** * API name: {@code replacement} */ + @Nonnull public final Builder replacement(@Nullable String value) { this.replacement = value; return this; @@ -189,6 +240,7 @@ public final Builder replacement(@Nullable String value) { /** * Required - API name: {@code reverse} */ + @Nonnull public final Builder reverse(boolean value) { this.reverse = value; return this; @@ -197,21 +249,19 @@ public final Builder reverse(boolean value) { /** * Required - API name: {@code skip} */ + @Nonnull public final Builder skip(int value) { this.skip = value; return this; } - @Override - protected Builder self() { - return this; - } - /** * Builds a {@link PathHierarchyTokenizer}. * * @throws NullPointerException if some of the required fields are null. */ + @Override + @Nonnull public PathHierarchyTokenizer build() { _checkSingleUse(); diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/analysis/PatternAnalyzer.java b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/analysis/PatternAnalyzer.java index 618383c7f3..2fdec0ee8f 100644 --- a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/analysis/PatternAnalyzer.java +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/analysis/PatternAnalyzer.java @@ -50,14 +50,20 @@ 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: _types.analysis.PatternAnalyzer @JsonpDeserializable @Generated("org.opensearch.client.codegen.CodeGenerator") -public class PatternAnalyzer implements AnalyzerVariant, PlainJsonSerializable { +public class PatternAnalyzer + implements + AnalyzerVariant, + PlainJsonSerializable, + ToCopyableBuilder { @Nullable private final String flags; @@ -178,10 +184,21 @@ protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { // --------------------------------------------------------------------------------------------- + @Override + @Nonnull + public Builder toBuilder() { + return new Builder(this); + } + + @Nonnull + public static Builder builder() { + return new Builder(); + } + /** * Builder for {@link PatternAnalyzer}. */ - public static class Builder extends ObjectBuilderBase implements ObjectBuilder { + public static class Builder extends ObjectBuilderBase implements CopyableBuilder { @Nullable private String flags; @Nullable @@ -192,9 +209,34 @@ public static class Builder extends ObjectBuilderBase implements ObjectBuilder

list to stopwords. *

*/ + @Nonnull public final Builder stopwords(List list) { this.stopwords = _listAddAll(this.stopwords, list); return this; @@ -235,6 +280,7 @@ public final Builder stopwords(List list) { * Adds one or more values to stopwords. *

*/ + @Nonnull public final Builder stopwords(String value, String... values) { this.stopwords = _listAdd(this.stopwords, value, values); return this; @@ -243,6 +289,7 @@ public final Builder stopwords(String value, String... values) { /** * API name: {@code version} */ + @Nonnull public final Builder version(@Nullable String value) { this.version = value; return this; @@ -253,6 +300,8 @@ public final Builder version(@Nullable String value) { * * @throws NullPointerException if some of the required fields are null. */ + @Override + @Nonnull public PatternAnalyzer build() { _checkSingleUse(); diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/analysis/PatternCaptureTokenFilter.java b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/analysis/PatternCaptureTokenFilter.java index 69c3fc7166..382ac82f37 100644 --- a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/analysis/PatternCaptureTokenFilter.java +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/analysis/PatternCaptureTokenFilter.java @@ -49,13 +49,18 @@ import org.opensearch.client.json.ObjectBuilderDeserializer; import org.opensearch.client.json.ObjectDeserializer; import org.opensearch.client.util.ApiTypeHelper; +import org.opensearch.client.util.CopyableBuilder; import org.opensearch.client.util.ObjectBuilder; +import org.opensearch.client.util.ToCopyableBuilder; // typedef: _types.analysis.PatternCaptureTokenFilter @JsonpDeserializable @Generated("org.opensearch.client.codegen.CodeGenerator") -public class PatternCaptureTokenFilter extends TokenFilterBase implements TokenFilterDefinitionVariant { +public class PatternCaptureTokenFilter extends TokenFilterBase + implements + TokenFilterDefinitionVariant, + ToCopyableBuilder { @Nonnull private final List patterns; @@ -117,14 +122,53 @@ protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { // --------------------------------------------------------------------------------------------- + @Override + @Nonnull + public Builder toBuilder() { + return new Builder(this); + } + + @Nonnull + public static Builder builder() { + return new Builder(); + } + /** * Builder for {@link PatternCaptureTokenFilter}. */ - public static class Builder extends TokenFilterBase.AbstractBuilder implements ObjectBuilder { + public static class Builder extends TokenFilterBase.AbstractBuilder + implements + CopyableBuilder { private List patterns; @Nullable private Boolean preserveOriginal; + public Builder() {} + + private Builder(PatternCaptureTokenFilter o) { + super(o); + this.patterns = _listCopy(o.patterns); + this.preserveOriginal = o.preserveOriginal; + } + + private Builder(Builder o) { + super(o); + this.patterns = _listCopy(o.patterns); + this.preserveOriginal = o.preserveOriginal; + } + + @Override + @Nonnull + public Builder copy() { + return new Builder(this); + } + + @Override + @Nonnull + protected Builder self() { + return this; + } + /** * Required - API name: {@code patterns} * @@ -132,6 +176,7 @@ public static class Builder extends TokenFilterBase.AbstractBuilder imp * Adds all elements of list to patterns. *

*/ + @Nonnull public final Builder patterns(List list) { this.patterns = _listAddAll(this.patterns, list); return this; @@ -144,6 +189,7 @@ public final Builder patterns(List list) { * Adds one or more values to patterns. *

*/ + @Nonnull public final Builder patterns(String value, String... values) { this.patterns = _listAdd(this.patterns, value, values); return this; @@ -152,21 +198,19 @@ public final Builder patterns(String value, String... values) { /** * API name: {@code preserve_original} */ + @Nonnull public final Builder preserveOriginal(@Nullable Boolean value) { this.preserveOriginal = value; return this; } - @Override - protected Builder self() { - return this; - } - /** * Builds a {@link PatternCaptureTokenFilter}. * * @throws NullPointerException if some of the required fields are null. */ + @Override + @Nonnull public PatternCaptureTokenFilter build() { _checkSingleUse(); diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/analysis/PatternReplaceCharFilter.java b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/analysis/PatternReplaceCharFilter.java index a4604bf4f6..8ae4e3762f 100644 --- a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/analysis/PatternReplaceCharFilter.java +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/analysis/PatternReplaceCharFilter.java @@ -48,13 +48,18 @@ import org.opensearch.client.json.ObjectBuilderDeserializer; import org.opensearch.client.json.ObjectDeserializer; import org.opensearch.client.util.ApiTypeHelper; +import org.opensearch.client.util.CopyableBuilder; import org.opensearch.client.util.ObjectBuilder; +import org.opensearch.client.util.ToCopyableBuilder; // typedef: _types.analysis.PatternReplaceCharFilter @JsonpDeserializable @Generated("org.opensearch.client.codegen.CodeGenerator") -public class PatternReplaceCharFilter extends CharFilterBase implements CharFilterDefinitionVariant { +public class PatternReplaceCharFilter extends CharFilterBase + implements + CharFilterDefinitionVariant, + ToCopyableBuilder { @Nullable private final String flags; @@ -129,19 +134,61 @@ protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { // --------------------------------------------------------------------------------------------- + @Override + @Nonnull + public Builder toBuilder() { + return new Builder(this); + } + + @Nonnull + public static Builder builder() { + return new Builder(); + } + /** * Builder for {@link PatternReplaceCharFilter}. */ - public static class Builder extends CharFilterBase.AbstractBuilder implements ObjectBuilder { + public static class Builder extends CharFilterBase.AbstractBuilder + implements + CopyableBuilder { @Nullable private String flags; private String pattern; @Nullable private String replacement; + public Builder() {} + + private Builder(PatternReplaceCharFilter o) { + super(o); + this.flags = o.flags; + this.pattern = o.pattern; + this.replacement = o.replacement; + } + + private Builder(Builder o) { + super(o); + this.flags = o.flags; + this.pattern = o.pattern; + this.replacement = o.replacement; + } + + @Override + @Nonnull + public Builder copy() { + return new Builder(this); + } + + @Override + @Nonnull + protected Builder self() { + return this; + } + /** * API name: {@code flags} */ + @Nonnull public final Builder flags(@Nullable String value) { this.flags = value; return this; @@ -150,6 +197,7 @@ public final Builder flags(@Nullable String value) { /** * Required - API name: {@code pattern} */ + @Nonnull public final Builder pattern(String value) { this.pattern = value; return this; @@ -158,21 +206,19 @@ public final Builder pattern(String value) { /** * API name: {@code replacement} */ + @Nonnull public final Builder replacement(@Nullable String value) { this.replacement = value; return this; } - @Override - protected Builder self() { - return this; - } - /** * Builds a {@link PatternReplaceCharFilter}. * * @throws NullPointerException if some of the required fields are null. */ + @Override + @Nonnull public PatternReplaceCharFilter build() { _checkSingleUse(); diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/analysis/PatternReplaceTokenFilter.java b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/analysis/PatternReplaceTokenFilter.java index 0780ef2591..4a4ed1adcf 100644 --- a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/analysis/PatternReplaceTokenFilter.java +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/analysis/PatternReplaceTokenFilter.java @@ -48,13 +48,18 @@ import org.opensearch.client.json.ObjectBuilderDeserializer; import org.opensearch.client.json.ObjectDeserializer; import org.opensearch.client.util.ApiTypeHelper; +import org.opensearch.client.util.CopyableBuilder; import org.opensearch.client.util.ObjectBuilder; +import org.opensearch.client.util.ToCopyableBuilder; // typedef: _types.analysis.PatternReplaceTokenFilter @JsonpDeserializable @Generated("org.opensearch.client.codegen.CodeGenerator") -public class PatternReplaceTokenFilter extends TokenFilterBase implements TokenFilterDefinitionVariant { +public class PatternReplaceTokenFilter extends TokenFilterBase + implements + TokenFilterDefinitionVariant, + ToCopyableBuilder { @Nullable private final Boolean all; @@ -146,10 +151,23 @@ protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { // --------------------------------------------------------------------------------------------- + @Override + @Nonnull + public Builder toBuilder() { + return new Builder(this); + } + + @Nonnull + public static Builder builder() { + return new Builder(); + } + /** * Builder for {@link PatternReplaceTokenFilter}. */ - public static class Builder extends TokenFilterBase.AbstractBuilder implements ObjectBuilder { + public static class Builder extends TokenFilterBase.AbstractBuilder + implements + CopyableBuilder { @Nullable private Boolean all; @Nullable @@ -158,9 +176,40 @@ public static class Builder extends TokenFilterBase.AbstractBuilder imp @Nullable private String replacement; + public Builder() {} + + private Builder(PatternReplaceTokenFilter o) { + super(o); + this.all = o.all; + this.flags = o.flags; + this.pattern = o.pattern; + this.replacement = o.replacement; + } + + private Builder(Builder o) { + super(o); + this.all = o.all; + this.flags = o.flags; + this.pattern = o.pattern; + this.replacement = o.replacement; + } + + @Override + @Nonnull + public Builder copy() { + return new Builder(this); + } + + @Override + @Nonnull + protected Builder self() { + return this; + } + /** * API name: {@code all} */ + @Nonnull public final Builder all(@Nullable Boolean value) { this.all = value; return this; @@ -169,6 +218,7 @@ public final Builder all(@Nullable Boolean value) { /** * API name: {@code flags} */ + @Nonnull public final Builder flags(@Nullable String value) { this.flags = value; return this; @@ -177,6 +227,7 @@ public final Builder flags(@Nullable String value) { /** * Required - API name: {@code pattern} */ + @Nonnull public final Builder pattern(String value) { this.pattern = value; return this; @@ -185,21 +236,19 @@ public final Builder pattern(String value) { /** * API name: {@code replacement} */ + @Nonnull public final Builder replacement(@Nullable String value) { this.replacement = value; return this; } - @Override - protected Builder self() { - return this; - } - /** * Builds a {@link PatternReplaceTokenFilter}. * * @throws NullPointerException if some of the required fields are null. */ + @Override + @Nonnull public PatternReplaceTokenFilter build() { _checkSingleUse(); diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/analysis/PatternTokenizer.java b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/analysis/PatternTokenizer.java index e12da750d9..a4b3ec45e7 100644 --- a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/analysis/PatternTokenizer.java +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/analysis/PatternTokenizer.java @@ -40,19 +40,25 @@ 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.util.CopyableBuilder; import org.opensearch.client.util.ObjectBuilder; +import org.opensearch.client.util.ToCopyableBuilder; // typedef: _types.analysis.PatternTokenizer @JsonpDeserializable @Generated("org.opensearch.client.codegen.CodeGenerator") -public class PatternTokenizer extends TokenizerBase implements TokenizerDefinitionVariant { +public class PatternTokenizer extends TokenizerBase + implements + TokenizerDefinitionVariant, + ToCopyableBuilder { @Nullable private final String flags; @@ -129,10 +135,21 @@ protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { // --------------------------------------------------------------------------------------------- + @Override + @Nonnull + public Builder toBuilder() { + return new Builder(this); + } + + @Nonnull + public static Builder builder() { + return new Builder(); + } + /** * Builder for {@link PatternTokenizer}. */ - public static class Builder extends TokenizerBase.AbstractBuilder implements ObjectBuilder { + public static class Builder extends TokenizerBase.AbstractBuilder implements CopyableBuilder { @Nullable private String flags; @Nullable @@ -140,9 +157,38 @@ public static class Builder extends TokenizerBase.AbstractBuilder imple @Nullable private String pattern; + public Builder() {} + + private Builder(PatternTokenizer o) { + super(o); + this.flags = o.flags; + this.group = o.group; + this.pattern = o.pattern; + } + + private Builder(Builder o) { + super(o); + this.flags = o.flags; + this.group = o.group; + this.pattern = o.pattern; + } + + @Override + @Nonnull + public Builder copy() { + return new Builder(this); + } + + @Override + @Nonnull + protected Builder self() { + return this; + } + /** * API name: {@code flags} */ + @Nonnull public final Builder flags(@Nullable String value) { this.flags = value; return this; @@ -151,6 +197,7 @@ public final Builder flags(@Nullable String value) { /** * API name: {@code group} */ + @Nonnull public final Builder group(@Nullable Integer value) { this.group = value; return this; @@ -159,21 +206,19 @@ public final Builder group(@Nullable Integer value) { /** * API name: {@code pattern} */ + @Nonnull public final Builder pattern(@Nullable String value) { this.pattern = value; return this; } - @Override - protected Builder self() { - return this; - } - /** * Builds a {@link PatternTokenizer}. * * @throws NullPointerException if some of the required fields are null. */ + @Override + @Nonnull public PatternTokenizer build() { _checkSingleUse(); diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/analysis/PersianStemTokenFilter.java b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/analysis/PersianStemTokenFilter.java index f2f88716e2..9f67f5185a 100644 --- a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/analysis/PersianStemTokenFilter.java +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/analysis/PersianStemTokenFilter.java @@ -39,18 +39,24 @@ 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.util.CopyableBuilder; import org.opensearch.client.util.ObjectBuilder; +import org.opensearch.client.util.ToCopyableBuilder; // typedef: _types.analysis.PersianStemTokenFilter @JsonpDeserializable @Generated("org.opensearch.client.codegen.CodeGenerator") -public class PersianStemTokenFilter extends TokenFilterBase implements TokenFilterDefinitionVariant { +public class PersianStemTokenFilter extends TokenFilterBase + implements + TokenFilterDefinitionVariant, + ToCopyableBuilder { // --------------------------------------------------------------------------------------------- @@ -77,12 +83,42 @@ protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { // --------------------------------------------------------------------------------------------- + @Override + @Nonnull + public Builder toBuilder() { + return new Builder(this); + } + + @Nonnull + public static Builder builder() { + return new Builder(); + } + /** * Builder for {@link PersianStemTokenFilter}. */ - public static class Builder extends TokenFilterBase.AbstractBuilder implements ObjectBuilder { + public static class Builder extends TokenFilterBase.AbstractBuilder + implements + CopyableBuilder { + + public Builder() {} + + private Builder(PersianStemTokenFilter o) { + super(o); + } + + private Builder(Builder o) { + super(o); + } @Override + @Nonnull + public Builder copy() { + return new Builder(this); + } + + @Override + @Nonnull protected Builder self() { return this; } @@ -92,6 +128,8 @@ protected Builder self() { * * @throws NullPointerException if some of the required fields are null. */ + @Override + @Nonnull public PersianStemTokenFilter build() { _checkSingleUse(); diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/analysis/PhoneAnalyzer.java b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/analysis/PhoneAnalyzer.java index 1b3c721ab8..cf159825e7 100644 --- a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/analysis/PhoneAnalyzer.java +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/analysis/PhoneAnalyzer.java @@ -40,6 +40,7 @@ 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; @@ -47,14 +48,16 @@ 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: _types.analysis.PhoneAnalyzer @JsonpDeserializable @Generated("org.opensearch.client.codegen.CodeGenerator") -public class PhoneAnalyzer implements AnalyzerVariant, PlainJsonSerializable { +public class PhoneAnalyzer implements AnalyzerVariant, PlainJsonSerializable, ToCopyableBuilder { @Nullable private final String phoneRegion; @@ -108,19 +111,47 @@ protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { // --------------------------------------------------------------------------------------------- + @Override + @Nonnull + public Builder toBuilder() { + return new Builder(this); + } + + @Nonnull + public static Builder builder() { + return new Builder(); + } + /** * Builder for {@link PhoneAnalyzer}. */ - public static class Builder extends ObjectBuilderBase implements ObjectBuilder { + public static class Builder extends ObjectBuilderBase implements CopyableBuilder { @Nullable private String phoneRegion; + public Builder() {} + + private Builder(PhoneAnalyzer o) { + this.phoneRegion = o.phoneRegion; + } + + private Builder(Builder o) { + this.phoneRegion = o.phoneRegion; + } + + @Override + @Nonnull + public Builder copy() { + return new Builder(this); + } + /** * Optional ISO 3166 country code, defaults to "ZZ" (unknown region). *

* API name: {@code phone-region} *

*/ + @Nonnull public final Builder phoneRegion(@Nullable String value) { this.phoneRegion = value; return this; @@ -131,6 +162,8 @@ public final Builder phoneRegion(@Nullable String value) { * * @throws NullPointerException if some of the required fields are null. */ + @Override + @Nonnull public PhoneAnalyzer build() { _checkSingleUse(); diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/analysis/PhoneticTokenFilter.java b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/analysis/PhoneticTokenFilter.java index 519c699292..30d964a3f0 100644 --- a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/analysis/PhoneticTokenFilter.java +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/analysis/PhoneticTokenFilter.java @@ -49,13 +49,18 @@ import org.opensearch.client.json.ObjectBuilderDeserializer; import org.opensearch.client.json.ObjectDeserializer; import org.opensearch.client.util.ApiTypeHelper; +import org.opensearch.client.util.CopyableBuilder; import org.opensearch.client.util.ObjectBuilder; +import org.opensearch.client.util.ToCopyableBuilder; // typedef: _types.analysis.PhoneticTokenFilter @JsonpDeserializable @Generated("org.opensearch.client.codegen.CodeGenerator") -public class PhoneticTokenFilter extends TokenFilterBase implements TokenFilterDefinitionVariant { +public class PhoneticTokenFilter extends TokenFilterBase + implements + TokenFilterDefinitionVariant, + ToCopyableBuilder { @Nonnull private final PhoneticEncoder encoder; @@ -179,10 +184,21 @@ protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { // --------------------------------------------------------------------------------------------- + @Override + @Nonnull + public Builder toBuilder() { + return new Builder(this); + } + + @Nonnull + public static Builder builder() { + return new Builder(); + } + /** * Builder for {@link PhoneticTokenFilter}. */ - public static class Builder extends TokenFilterBase.AbstractBuilder implements ObjectBuilder { + public static class Builder extends TokenFilterBase.AbstractBuilder implements CopyableBuilder { private PhoneticEncoder encoder; private List languageset; @Nullable @@ -192,9 +208,44 @@ public static class Builder extends TokenFilterBase.AbstractBuilder imp private Boolean replace; private PhoneticRuleType ruleType; + public Builder() {} + + private Builder(PhoneticTokenFilter o) { + super(o); + this.encoder = o.encoder; + this.languageset = _listCopy(o.languageset); + this.maxCodeLen = o.maxCodeLen; + this.nameType = o.nameType; + this.replace = o.replace; + this.ruleType = o.ruleType; + } + + private Builder(Builder o) { + super(o); + this.encoder = o.encoder; + this.languageset = _listCopy(o.languageset); + this.maxCodeLen = o.maxCodeLen; + this.nameType = o.nameType; + this.replace = o.replace; + this.ruleType = o.ruleType; + } + + @Override + @Nonnull + public Builder copy() { + return new Builder(this); + } + + @Override + @Nonnull + protected Builder self() { + return this; + } + /** * Required - API name: {@code encoder} */ + @Nonnull public final Builder encoder(PhoneticEncoder value) { this.encoder = value; return this; @@ -207,6 +258,7 @@ public final Builder encoder(PhoneticEncoder value) { * Adds all elements of list to languageset. *

*/ + @Nonnull public final Builder languageset(List list) { this.languageset = _listAddAll(this.languageset, list); return this; @@ -219,6 +271,7 @@ public final Builder languageset(List list) { * Adds one or more values to languageset. *

*/ + @Nonnull public final Builder languageset(PhoneticLanguage value, PhoneticLanguage... values) { this.languageset = _listAdd(this.languageset, value, values); return this; @@ -227,6 +280,7 @@ public final Builder languageset(PhoneticLanguage value, PhoneticLanguage... val /** * API name: {@code max_code_len} */ + @Nonnull public final Builder maxCodeLen(@Nullable Integer value) { this.maxCodeLen = value; return this; @@ -235,6 +289,7 @@ public final Builder maxCodeLen(@Nullable Integer value) { /** * Required - API name: {@code name_type} */ + @Nonnull public final Builder nameType(PhoneticNameType value) { this.nameType = value; return this; @@ -243,6 +298,7 @@ public final Builder nameType(PhoneticNameType value) { /** * API name: {@code replace} */ + @Nonnull public final Builder replace(@Nullable Boolean value) { this.replace = value; return this; @@ -251,21 +307,19 @@ public final Builder replace(@Nullable Boolean value) { /** * Required - API name: {@code rule_type} */ + @Nonnull public final Builder ruleType(PhoneticRuleType value) { this.ruleType = value; return this; } - @Override - protected Builder self() { - return this; - } - /** * Builds a {@link PhoneticTokenFilter}. * * @throws NullPointerException if some of the required fields are null. */ + @Override + @Nonnull public PhoneticTokenFilter build() { _checkSingleUse(); diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/analysis/PorterStemTokenFilter.java b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/analysis/PorterStemTokenFilter.java index af15e3a9c1..343eac2a0b 100644 --- a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/analysis/PorterStemTokenFilter.java +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/analysis/PorterStemTokenFilter.java @@ -39,18 +39,24 @@ 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.util.CopyableBuilder; import org.opensearch.client.util.ObjectBuilder; +import org.opensearch.client.util.ToCopyableBuilder; // typedef: _types.analysis.PorterStemTokenFilter @JsonpDeserializable @Generated("org.opensearch.client.codegen.CodeGenerator") -public class PorterStemTokenFilter extends TokenFilterBase implements TokenFilterDefinitionVariant { +public class PorterStemTokenFilter extends TokenFilterBase + implements + TokenFilterDefinitionVariant, + ToCopyableBuilder { // --------------------------------------------------------------------------------------------- @@ -77,12 +83,42 @@ protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { // --------------------------------------------------------------------------------------------- + @Override + @Nonnull + public Builder toBuilder() { + return new Builder(this); + } + + @Nonnull + public static Builder builder() { + return new Builder(); + } + /** * Builder for {@link PorterStemTokenFilter}. */ - public static class Builder extends TokenFilterBase.AbstractBuilder implements ObjectBuilder { + public static class Builder extends TokenFilterBase.AbstractBuilder + implements + CopyableBuilder { + + public Builder() {} + + private Builder(PorterStemTokenFilter o) { + super(o); + } + + private Builder(Builder o) { + super(o); + } @Override + @Nonnull + public Builder copy() { + return new Builder(this); + } + + @Override + @Nonnull protected Builder self() { return this; } @@ -92,6 +128,8 @@ protected Builder self() { * * @throws NullPointerException if some of the required fields are null. */ + @Override + @Nonnull public PorterStemTokenFilter build() { _checkSingleUse(); diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/analysis/PredicateTokenFilter.java b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/analysis/PredicateTokenFilter.java index beee708ec0..f6da56813b 100644 --- a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/analysis/PredicateTokenFilter.java +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/analysis/PredicateTokenFilter.java @@ -47,13 +47,18 @@ import org.opensearch.client.json.ObjectDeserializer; 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.ToCopyableBuilder; // typedef: _types.analysis.PredicateTokenFilter @JsonpDeserializable @Generated("org.opensearch.client.codegen.CodeGenerator") -public class PredicateTokenFilter extends TokenFilterBase implements TokenFilterDefinitionVariant { +public class PredicateTokenFilter extends TokenFilterBase + implements + TokenFilterDefinitionVariant, + ToCopyableBuilder { @Nonnull private final Script script; @@ -94,15 +99,51 @@ protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { // --------------------------------------------------------------------------------------------- + @Override + @Nonnull + public Builder toBuilder() { + return new Builder(this); + } + + @Nonnull + public static Builder builder() { + return new Builder(); + } + /** * Builder for {@link PredicateTokenFilter}. */ - public static class Builder extends TokenFilterBase.AbstractBuilder implements ObjectBuilder { + public static class Builder extends TokenFilterBase.AbstractBuilder implements CopyableBuilder { private Script script; + public Builder() {} + + private Builder(PredicateTokenFilter o) { + super(o); + this.script = o.script; + } + + private Builder(Builder o) { + super(o); + this.script = o.script; + } + + @Override + @Nonnull + public Builder copy() { + return new Builder(this); + } + + @Override + @Nonnull + protected Builder self() { + return this; + } + /** * Required - API name: {@code script} */ + @Nonnull public final Builder script(Script value) { this.script = value; return this; @@ -111,20 +152,18 @@ public final Builder script(Script value) { /** * Required - API name: {@code script} */ + @Nonnull public final Builder script(Function> fn) { return script(fn.apply(new Script.Builder()).build()); } - @Override - protected Builder self() { - return this; - } - /** * Builds a {@link PredicateTokenFilter}. * * @throws NullPointerException if some of the required fields are null. */ + @Override + @Nonnull public PredicateTokenFilter build() { _checkSingleUse(); diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/analysis/RemoveDuplicatesTokenFilter.java b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/analysis/RemoveDuplicatesTokenFilter.java index 128d9eea89..d7b8107f4e 100644 --- a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/analysis/RemoveDuplicatesTokenFilter.java +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/analysis/RemoveDuplicatesTokenFilter.java @@ -39,18 +39,24 @@ 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.util.CopyableBuilder; import org.opensearch.client.util.ObjectBuilder; +import org.opensearch.client.util.ToCopyableBuilder; // typedef: _types.analysis.RemoveDuplicatesTokenFilter @JsonpDeserializable @Generated("org.opensearch.client.codegen.CodeGenerator") -public class RemoveDuplicatesTokenFilter extends TokenFilterBase implements TokenFilterDefinitionVariant { +public class RemoveDuplicatesTokenFilter extends TokenFilterBase + implements + TokenFilterDefinitionVariant, + ToCopyableBuilder { // --------------------------------------------------------------------------------------------- @@ -79,12 +85,42 @@ protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { // --------------------------------------------------------------------------------------------- + @Override + @Nonnull + public Builder toBuilder() { + return new Builder(this); + } + + @Nonnull + public static Builder builder() { + return new Builder(); + } + /** * Builder for {@link RemoveDuplicatesTokenFilter}. */ - public static class Builder extends TokenFilterBase.AbstractBuilder implements ObjectBuilder { + public static class Builder extends TokenFilterBase.AbstractBuilder + implements + CopyableBuilder { + + public Builder() {} + + private Builder(RemoveDuplicatesTokenFilter o) { + super(o); + } + + private Builder(Builder o) { + super(o); + } @Override + @Nonnull + public Builder copy() { + return new Builder(this); + } + + @Override + @Nonnull protected Builder self() { return this; } @@ -94,6 +130,8 @@ protected Builder self() { * * @throws NullPointerException if some of the required fields are null. */ + @Override + @Nonnull public RemoveDuplicatesTokenFilter build() { _checkSingleUse(); diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/analysis/ReverseTokenFilter.java b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/analysis/ReverseTokenFilter.java index da9f6fdbad..ec457d8cdb 100644 --- a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/analysis/ReverseTokenFilter.java +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/analysis/ReverseTokenFilter.java @@ -39,18 +39,24 @@ 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.util.CopyableBuilder; import org.opensearch.client.util.ObjectBuilder; +import org.opensearch.client.util.ToCopyableBuilder; // typedef: _types.analysis.ReverseTokenFilter @JsonpDeserializable @Generated("org.opensearch.client.codegen.CodeGenerator") -public class ReverseTokenFilter extends TokenFilterBase implements TokenFilterDefinitionVariant { +public class ReverseTokenFilter extends TokenFilterBase + implements + TokenFilterDefinitionVariant, + ToCopyableBuilder { // --------------------------------------------------------------------------------------------- @@ -77,12 +83,40 @@ protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { // --------------------------------------------------------------------------------------------- + @Override + @Nonnull + public Builder toBuilder() { + return new Builder(this); + } + + @Nonnull + public static Builder builder() { + return new Builder(); + } + /** * Builder for {@link ReverseTokenFilter}. */ - public static class Builder extends TokenFilterBase.AbstractBuilder implements ObjectBuilder { + public static class Builder extends TokenFilterBase.AbstractBuilder implements CopyableBuilder { + + public Builder() {} + + private Builder(ReverseTokenFilter o) { + super(o); + } + + private Builder(Builder o) { + super(o); + } @Override + @Nonnull + public Builder copy() { + return new Builder(this); + } + + @Override + @Nonnull protected Builder self() { return this; } @@ -92,6 +126,8 @@ protected Builder self() { * * @throws NullPointerException if some of the required fields are null. */ + @Override + @Nonnull public ReverseTokenFilter build() { _checkSingleUse(); diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/analysis/ShingleTokenFilter.java b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/analysis/ShingleTokenFilter.java index 9c06217e98..c33c670269 100644 --- a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/analysis/ShingleTokenFilter.java +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/analysis/ShingleTokenFilter.java @@ -40,19 +40,25 @@ 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.util.CopyableBuilder; import org.opensearch.client.util.ObjectBuilder; +import org.opensearch.client.util.ToCopyableBuilder; // typedef: _types.analysis.ShingleTokenFilter @JsonpDeserializable @Generated("org.opensearch.client.codegen.CodeGenerator") -public class ShingleTokenFilter extends TokenFilterBase implements TokenFilterDefinitionVariant { +public class ShingleTokenFilter extends TokenFilterBase + implements + TokenFilterDefinitionVariant, + ToCopyableBuilder { @Nullable private final String fillerToken; @@ -180,10 +186,21 @@ protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { // --------------------------------------------------------------------------------------------- + @Override + @Nonnull + public Builder toBuilder() { + return new Builder(this); + } + + @Nonnull + public static Builder builder() { + return new Builder(); + } + /** * Builder for {@link ShingleTokenFilter}. */ - public static class Builder extends TokenFilterBase.AbstractBuilder implements ObjectBuilder { + public static class Builder extends TokenFilterBase.AbstractBuilder implements CopyableBuilder { @Nullable private String fillerToken; @Nullable @@ -197,9 +214,44 @@ public static class Builder extends TokenFilterBase.AbstractBuilder imp @Nullable private String tokenSeparator; + public Builder() {} + + private Builder(ShingleTokenFilter o) { + super(o); + this.fillerToken = o.fillerToken; + this.maxShingleSize = o.maxShingleSize; + this.minShingleSize = o.minShingleSize; + this.outputUnigrams = o.outputUnigrams; + this.outputUnigramsIfNoShingles = o.outputUnigramsIfNoShingles; + this.tokenSeparator = o.tokenSeparator; + } + + private Builder(Builder o) { + super(o); + this.fillerToken = o.fillerToken; + this.maxShingleSize = o.maxShingleSize; + this.minShingleSize = o.minShingleSize; + this.outputUnigrams = o.outputUnigrams; + this.outputUnigramsIfNoShingles = o.outputUnigramsIfNoShingles; + this.tokenSeparator = o.tokenSeparator; + } + + @Override + @Nonnull + public Builder copy() { + return new Builder(this); + } + + @Override + @Nonnull + protected Builder self() { + return this; + } + /** * API name: {@code filler_token} */ + @Nonnull public final Builder fillerToken(@Nullable String value) { this.fillerToken = value; return this; @@ -208,6 +260,7 @@ public final Builder fillerToken(@Nullable String value) { /** * API name: {@code max_shingle_size} */ + @Nonnull public final Builder maxShingleSize(@Nullable String value) { this.maxShingleSize = value; return this; @@ -216,6 +269,7 @@ public final Builder maxShingleSize(@Nullable String value) { /** * API name: {@code min_shingle_size} */ + @Nonnull public final Builder minShingleSize(@Nullable String value) { this.minShingleSize = value; return this; @@ -224,6 +278,7 @@ public final Builder minShingleSize(@Nullable String value) { /** * API name: {@code output_unigrams} */ + @Nonnull public final Builder outputUnigrams(@Nullable Boolean value) { this.outputUnigrams = value; return this; @@ -232,6 +287,7 @@ public final Builder outputUnigrams(@Nullable Boolean value) { /** * API name: {@code output_unigrams_if_no_shingles} */ + @Nonnull public final Builder outputUnigramsIfNoShingles(@Nullable Boolean value) { this.outputUnigramsIfNoShingles = value; return this; @@ -240,21 +296,19 @@ public final Builder outputUnigramsIfNoShingles(@Nullable Boolean value) { /** * API name: {@code token_separator} */ + @Nonnull public final Builder tokenSeparator(@Nullable String value) { this.tokenSeparator = value; return this; } - @Override - protected Builder self() { - return this; - } - /** * Builds a {@link ShingleTokenFilter}. * * @throws NullPointerException if some of the required fields are null. */ + @Override + @Nonnull public ShingleTokenFilter build() { _checkSingleUse(); diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/analysis/SimpleAnalyzer.java b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/analysis/SimpleAnalyzer.java index 00a541d5d1..34064ce132 100644 --- a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/analysis/SimpleAnalyzer.java +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/analysis/SimpleAnalyzer.java @@ -40,6 +40,7 @@ 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; @@ -47,14 +48,16 @@ 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: _types.analysis.SimpleAnalyzer @JsonpDeserializable @Generated("org.opensearch.client.codegen.CodeGenerator") -public class SimpleAnalyzer implements AnalyzerVariant, PlainJsonSerializable { +public class SimpleAnalyzer implements AnalyzerVariant, PlainJsonSerializable, ToCopyableBuilder { @Nullable private final String version; @@ -105,16 +108,44 @@ protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { // --------------------------------------------------------------------------------------------- + @Override + @Nonnull + public Builder toBuilder() { + return new Builder(this); + } + + @Nonnull + public static Builder builder() { + return new Builder(); + } + /** * Builder for {@link SimpleAnalyzer}. */ - public static class Builder extends ObjectBuilderBase implements ObjectBuilder { + public static class Builder extends ObjectBuilderBase implements CopyableBuilder { @Nullable private String version; + public Builder() {} + + private Builder(SimpleAnalyzer o) { + this.version = o.version; + } + + private Builder(Builder o) { + this.version = o.version; + } + + @Override + @Nonnull + public Builder copy() { + return new Builder(this); + } + /** * API name: {@code version} */ + @Nonnull public final Builder version(@Nullable String value) { this.version = value; return this; @@ -125,6 +156,8 @@ public final Builder version(@Nullable String value) { * * @throws NullPointerException if some of the required fields are null. */ + @Override + @Nonnull public SimpleAnalyzer build() { _checkSingleUse(); diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/analysis/SmartcnAnalyzer.java b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/analysis/SmartcnAnalyzer.java index e94766c298..74999a56f5 100644 --- a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/analysis/SmartcnAnalyzer.java +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/analysis/SmartcnAnalyzer.java @@ -15,20 +15,27 @@ 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.CopyableBuilder; import org.opensearch.client.util.ObjectBuilder; import org.opensearch.client.util.ObjectBuilderBase; +import org.opensearch.client.util.ToCopyableBuilder; // typedef: _types.analysis.SmartcnAnalyzer @JsonpDeserializable @Generated("org.opensearch.client.codegen.CodeGenerator") -public class SmartcnAnalyzer implements AnalyzerVariant, PlainJsonSerializable { +public class SmartcnAnalyzer + implements + AnalyzerVariant, + PlainJsonSerializable, + ToCopyableBuilder { // --------------------------------------------------------------------------------------------- @@ -62,16 +69,41 @@ protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { // --------------------------------------------------------------------------------------------- + @Override + @Nonnull + public Builder toBuilder() { + return new Builder(this); + } + + @Nonnull + public static Builder builder() { + return new Builder(); + } + /** * Builder for {@link SmartcnAnalyzer}. */ - public static class Builder extends ObjectBuilderBase implements ObjectBuilder { + public static class Builder extends ObjectBuilderBase implements CopyableBuilder { + + public Builder() {} + + private Builder(SmartcnAnalyzer o) {} + + private Builder(Builder o) {} + + @Override + @Nonnull + public Builder copy() { + return new Builder(this); + } /** * Builds a {@link SmartcnAnalyzer}. * * @throws NullPointerException if some of the required fields are null. */ + @Override + @Nonnull public SmartcnAnalyzer build() { _checkSingleUse(); diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/analysis/SmartcnStopTokenFilter.java b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/analysis/SmartcnStopTokenFilter.java index 7cf0ea770d..9523a1169c 100644 --- a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/analysis/SmartcnStopTokenFilter.java +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/analysis/SmartcnStopTokenFilter.java @@ -15,18 +15,24 @@ 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.util.CopyableBuilder; import org.opensearch.client.util.ObjectBuilder; +import org.opensearch.client.util.ToCopyableBuilder; // typedef: _types.analysis.SmartcnStopTokenFilter @JsonpDeserializable @Generated("org.opensearch.client.codegen.CodeGenerator") -public class SmartcnStopTokenFilter extends TokenFilterBase implements TokenFilterDefinitionVariant { +public class SmartcnStopTokenFilter extends TokenFilterBase + implements + TokenFilterDefinitionVariant, + ToCopyableBuilder { // --------------------------------------------------------------------------------------------- @@ -53,12 +59,42 @@ protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { // --------------------------------------------------------------------------------------------- + @Override + @Nonnull + public Builder toBuilder() { + return new Builder(this); + } + + @Nonnull + public static Builder builder() { + return new Builder(); + } + /** * Builder for {@link SmartcnStopTokenFilter}. */ - public static class Builder extends TokenFilterBase.AbstractBuilder implements ObjectBuilder { + public static class Builder extends TokenFilterBase.AbstractBuilder + implements + CopyableBuilder { + + public Builder() {} + + private Builder(SmartcnStopTokenFilter o) { + super(o); + } + + private Builder(Builder o) { + super(o); + } @Override + @Nonnull + public Builder copy() { + return new Builder(this); + } + + @Override + @Nonnull protected Builder self() { return this; } @@ -68,6 +104,8 @@ protected Builder self() { * * @throws NullPointerException if some of the required fields are null. */ + @Override + @Nonnull public SmartcnStopTokenFilter build() { _checkSingleUse(); diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/analysis/SmartcnTokenizer.java b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/analysis/SmartcnTokenizer.java index 4e538f3368..9a4f58788e 100644 --- a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/analysis/SmartcnTokenizer.java +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/analysis/SmartcnTokenizer.java @@ -15,18 +15,24 @@ 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.util.CopyableBuilder; import org.opensearch.client.util.ObjectBuilder; +import org.opensearch.client.util.ToCopyableBuilder; // typedef: _types.analysis.SmartcnTokenizer @JsonpDeserializable @Generated("org.opensearch.client.codegen.CodeGenerator") -public class SmartcnTokenizer extends TokenizerBase implements TokenizerDefinitionVariant { +public class SmartcnTokenizer extends TokenizerBase + implements + TokenizerDefinitionVariant, + ToCopyableBuilder { // --------------------------------------------------------------------------------------------- @@ -53,12 +59,40 @@ protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { // --------------------------------------------------------------------------------------------- + @Override + @Nonnull + public Builder toBuilder() { + return new Builder(this); + } + + @Nonnull + public static Builder builder() { + return new Builder(); + } + /** * Builder for {@link SmartcnTokenizer}. */ - public static class Builder extends TokenizerBase.AbstractBuilder implements ObjectBuilder { + public static class Builder extends TokenizerBase.AbstractBuilder implements CopyableBuilder { + + public Builder() {} + + private Builder(SmartcnTokenizer o) { + super(o); + } + + private Builder(Builder o) { + super(o); + } @Override + @Nonnull + public Builder copy() { + return new Builder(this); + } + + @Override + @Nonnull protected Builder self() { return this; } @@ -68,6 +102,8 @@ protected Builder self() { * * @throws NullPointerException if some of the required fields are null. */ + @Override + @Nonnull public SmartcnTokenizer build() { _checkSingleUse(); diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/analysis/SnowballAnalyzer.java b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/analysis/SnowballAnalyzer.java index f5614ae206..9c2d36f2df 100644 --- a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/analysis/SnowballAnalyzer.java +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/analysis/SnowballAnalyzer.java @@ -50,14 +50,20 @@ 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: _types.analysis.SnowballAnalyzer @JsonpDeserializable @Generated("org.opensearch.client.codegen.CodeGenerator") -public class SnowballAnalyzer implements AnalyzerVariant, PlainJsonSerializable { +public class SnowballAnalyzer + implements + AnalyzerVariant, + PlainJsonSerializable, + ToCopyableBuilder { @Nonnull private final SnowballLanguage language; @@ -144,19 +150,51 @@ protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { // --------------------------------------------------------------------------------------------- + @Override + @Nonnull + public Builder toBuilder() { + return new Builder(this); + } + + @Nonnull + public static Builder builder() { + return new Builder(); + } + /** * Builder for {@link SnowballAnalyzer}. */ - public static class Builder extends ObjectBuilderBase implements ObjectBuilder { + public static class Builder extends ObjectBuilderBase implements CopyableBuilder { private SnowballLanguage language; @Nullable private List stopwords; @Nullable private String version; + public Builder() {} + + private Builder(SnowballAnalyzer o) { + this.language = o.language; + this.stopwords = _listCopy(o.stopwords); + this.version = o.version; + } + + private Builder(Builder o) { + this.language = o.language; + this.stopwords = _listCopy(o.stopwords); + this.version = o.version; + } + + @Override + @Nonnull + public Builder copy() { + return new Builder(this); + } + /** * Required - API name: {@code language} */ + @Nonnull public final Builder language(SnowballLanguage value) { this.language = value; return this; @@ -169,6 +207,7 @@ public final Builder language(SnowballLanguage value) { * Adds all elements of list to stopwords. *

*/ + @Nonnull public final Builder stopwords(List list) { this.stopwords = _listAddAll(this.stopwords, list); return this; @@ -181,6 +220,7 @@ public final Builder stopwords(List list) { * Adds one or more values to stopwords. *

*/ + @Nonnull public final Builder stopwords(String value, String... values) { this.stopwords = _listAdd(this.stopwords, value, values); return this; @@ -189,6 +229,7 @@ public final Builder stopwords(String value, String... values) { /** * API name: {@code version} */ + @Nonnull public final Builder version(@Nullable String value) { this.version = value; return this; @@ -199,6 +240,8 @@ public final Builder version(@Nullable String value) { * * @throws NullPointerException if some of the required fields are null. */ + @Override + @Nonnull public SnowballAnalyzer build() { _checkSingleUse(); diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/analysis/SnowballTokenFilter.java b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/analysis/SnowballTokenFilter.java index a542790fec..7c2cb8e4ee 100644 --- a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/analysis/SnowballTokenFilter.java +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/analysis/SnowballTokenFilter.java @@ -46,13 +46,18 @@ import org.opensearch.client.json.ObjectBuilderDeserializer; import org.opensearch.client.json.ObjectDeserializer; import org.opensearch.client.util.ApiTypeHelper; +import org.opensearch.client.util.CopyableBuilder; import org.opensearch.client.util.ObjectBuilder; +import org.opensearch.client.util.ToCopyableBuilder; // typedef: _types.analysis.SnowballTokenFilter @JsonpDeserializable @Generated("org.opensearch.client.codegen.CodeGenerator") -public class SnowballTokenFilter extends TokenFilterBase implements TokenFilterDefinitionVariant { +public class SnowballTokenFilter extends TokenFilterBase + implements + TokenFilterDefinitionVariant, + ToCopyableBuilder { @Nonnull private final SnowballLanguage language; @@ -93,30 +98,63 @@ protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { // --------------------------------------------------------------------------------------------- + @Override + @Nonnull + public Builder toBuilder() { + return new Builder(this); + } + + @Nonnull + public static Builder builder() { + return new Builder(); + } + /** * Builder for {@link SnowballTokenFilter}. */ - public static class Builder extends TokenFilterBase.AbstractBuilder implements ObjectBuilder { + public static class Builder extends TokenFilterBase.AbstractBuilder implements CopyableBuilder { private SnowballLanguage language; + public Builder() {} + + private Builder(SnowballTokenFilter o) { + super(o); + this.language = o.language; + } + + private Builder(Builder o) { + super(o); + this.language = o.language; + } + + @Override + @Nonnull + public Builder copy() { + return new Builder(this); + } + + @Override + @Nonnull + protected Builder self() { + return this; + } + /** * Required - API name: {@code language} */ + @Nonnull public final Builder language(SnowballLanguage value) { this.language = value; return this; } - @Override - protected Builder self() { - return this; - } - /** * Builds a {@link SnowballTokenFilter}. * * @throws NullPointerException if some of the required fields are null. */ + @Override + @Nonnull public SnowballTokenFilter build() { _checkSingleUse(); diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/analysis/StandardAnalyzer.java b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/analysis/StandardAnalyzer.java index 30e175ce09..a214ea05f0 100644 --- a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/analysis/StandardAnalyzer.java +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/analysis/StandardAnalyzer.java @@ -50,14 +50,20 @@ 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: _types.analysis.StandardAnalyzer @JsonpDeserializable @Generated("org.opensearch.client.codegen.CodeGenerator") -public class StandardAnalyzer implements AnalyzerVariant, PlainJsonSerializable { +public class StandardAnalyzer + implements + AnalyzerVariant, + PlainJsonSerializable, + ToCopyableBuilder { @Nullable private final Integer maxTokenLength; @@ -129,18 +135,48 @@ protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { // --------------------------------------------------------------------------------------------- + @Override + @Nonnull + public Builder toBuilder() { + return new Builder(this); + } + + @Nonnull + public static Builder builder() { + return new Builder(); + } + /** * Builder for {@link StandardAnalyzer}. */ - public static class Builder extends ObjectBuilderBase implements ObjectBuilder { + public static class Builder extends ObjectBuilderBase implements CopyableBuilder { @Nullable private Integer maxTokenLength; @Nullable private List stopwords; + public Builder() {} + + private Builder(StandardAnalyzer o) { + this.maxTokenLength = o.maxTokenLength; + this.stopwords = _listCopy(o.stopwords); + } + + private Builder(Builder o) { + this.maxTokenLength = o.maxTokenLength; + this.stopwords = _listCopy(o.stopwords); + } + + @Override + @Nonnull + public Builder copy() { + return new Builder(this); + } + /** * API name: {@code max_token_length} */ + @Nonnull public final Builder maxTokenLength(@Nullable Integer value) { this.maxTokenLength = value; return this; @@ -153,6 +189,7 @@ public final Builder maxTokenLength(@Nullable Integer value) { * Adds all elements of list to stopwords. *

*/ + @Nonnull public final Builder stopwords(List list) { this.stopwords = _listAddAll(this.stopwords, list); return this; @@ -165,6 +202,7 @@ public final Builder stopwords(List list) { * Adds one or more values to stopwords. *

*/ + @Nonnull public final Builder stopwords(String value, String... values) { this.stopwords = _listAdd(this.stopwords, value, values); return this; @@ -175,6 +213,8 @@ public final Builder stopwords(String value, String... values) { * * @throws NullPointerException if some of the required fields are null. */ + @Override + @Nonnull public StandardAnalyzer build() { _checkSingleUse(); diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/analysis/StandardTokenizer.java b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/analysis/StandardTokenizer.java index 435493a4ab..317997dfc3 100644 --- a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/analysis/StandardTokenizer.java +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/analysis/StandardTokenizer.java @@ -40,19 +40,25 @@ 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.util.CopyableBuilder; import org.opensearch.client.util.ObjectBuilder; +import org.opensearch.client.util.ToCopyableBuilder; // typedef: _types.analysis.StandardTokenizer @JsonpDeserializable @Generated("org.opensearch.client.codegen.CodeGenerator") -public class StandardTokenizer extends TokenizerBase implements TokenizerDefinitionVariant { +public class StandardTokenizer extends TokenizerBase + implements + TokenizerDefinitionVariant, + ToCopyableBuilder { @Nullable private final Integer maxTokenLength; @@ -95,31 +101,64 @@ protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { // --------------------------------------------------------------------------------------------- + @Override + @Nonnull + public Builder toBuilder() { + return new Builder(this); + } + + @Nonnull + public static Builder builder() { + return new Builder(); + } + /** * Builder for {@link StandardTokenizer}. */ - public static class Builder extends TokenizerBase.AbstractBuilder implements ObjectBuilder { + public static class Builder extends TokenizerBase.AbstractBuilder implements CopyableBuilder { @Nullable private Integer maxTokenLength; + public Builder() {} + + private Builder(StandardTokenizer o) { + super(o); + this.maxTokenLength = o.maxTokenLength; + } + + private Builder(Builder o) { + super(o); + this.maxTokenLength = o.maxTokenLength; + } + + @Override + @Nonnull + public Builder copy() { + return new Builder(this); + } + + @Override + @Nonnull + protected Builder self() { + return this; + } + /** * API name: {@code max_token_length} */ + @Nonnull public final Builder maxTokenLength(@Nullable Integer value) { this.maxTokenLength = value; return this; } - @Override - protected Builder self() { - return this; - } - /** * Builds a {@link StandardTokenizer}. * * @throws NullPointerException if some of the required fields are null. */ + @Override + @Nonnull public StandardTokenizer build() { _checkSingleUse(); diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/analysis/StemmerOverrideTokenFilter.java b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/analysis/StemmerOverrideTokenFilter.java index 9040f3d20c..d9da3184aa 100644 --- a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/analysis/StemmerOverrideTokenFilter.java +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/analysis/StemmerOverrideTokenFilter.java @@ -49,13 +49,18 @@ import org.opensearch.client.json.ObjectBuilderDeserializer; import org.opensearch.client.json.ObjectDeserializer; import org.opensearch.client.util.ApiTypeHelper; +import org.opensearch.client.util.CopyableBuilder; import org.opensearch.client.util.ObjectBuilder; +import org.opensearch.client.util.ToCopyableBuilder; // typedef: _types.analysis.StemmerOverrideTokenFilter @JsonpDeserializable @Generated("org.opensearch.client.codegen.CodeGenerator") -public class StemmerOverrideTokenFilter extends TokenFilterBase implements TokenFilterDefinitionVariant { +public class StemmerOverrideTokenFilter extends TokenFilterBase + implements + TokenFilterDefinitionVariant, + ToCopyableBuilder { @Nonnull private final List rules; @@ -121,15 +126,54 @@ protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { // --------------------------------------------------------------------------------------------- + @Override + @Nonnull + public Builder toBuilder() { + return new Builder(this); + } + + @Nonnull + public static Builder builder() { + return new Builder(); + } + /** * Builder for {@link StemmerOverrideTokenFilter}. */ - public static class Builder extends TokenFilterBase.AbstractBuilder implements ObjectBuilder { + public static class Builder extends TokenFilterBase.AbstractBuilder + implements + CopyableBuilder { @Nullable private List rules; @Nullable private String rulesPath; + public Builder() {} + + private Builder(StemmerOverrideTokenFilter o) { + super(o); + this.rules = _listCopy(o.rules); + this.rulesPath = o.rulesPath; + } + + private Builder(Builder o) { + super(o); + this.rules = _listCopy(o.rules); + this.rulesPath = o.rulesPath; + } + + @Override + @Nonnull + public Builder copy() { + return new Builder(this); + } + + @Override + @Nonnull + protected Builder self() { + return this; + } + /** * API name: {@code rules} * @@ -137,6 +181,7 @@ public static class Builder extends TokenFilterBase.AbstractBuilder imp * Adds all elements of list to rules. *

*/ + @Nonnull public final Builder rules(List list) { this.rules = _listAddAll(this.rules, list); return this; @@ -149,6 +194,7 @@ public final Builder rules(List list) { * Adds one or more values to rules. *

*/ + @Nonnull public final Builder rules(String value, String... values) { this.rules = _listAdd(this.rules, value, values); return this; @@ -157,21 +203,19 @@ public final Builder rules(String value, String... values) { /** * API name: {@code rules_path} */ + @Nonnull public final Builder rulesPath(@Nullable String value) { this.rulesPath = value; return this; } - @Override - protected Builder self() { - return this; - } - /** * Builds a {@link StemmerOverrideTokenFilter}. * * @throws NullPointerException if some of the required fields are null. */ + @Override + @Nonnull public StemmerOverrideTokenFilter build() { _checkSingleUse(); diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/analysis/StemmerTokenFilter.java b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/analysis/StemmerTokenFilter.java index 9a6ce6531b..1c44b787e9 100644 --- a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/analysis/StemmerTokenFilter.java +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/analysis/StemmerTokenFilter.java @@ -40,19 +40,25 @@ 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.util.CopyableBuilder; import org.opensearch.client.util.ObjectBuilder; +import org.opensearch.client.util.ToCopyableBuilder; // typedef: _types.analysis.StemmerTokenFilter @JsonpDeserializable @Generated("org.opensearch.client.codegen.CodeGenerator") -public class StemmerTokenFilter extends TokenFilterBase implements TokenFilterDefinitionVariant { +public class StemmerTokenFilter extends TokenFilterBase + implements + TokenFilterDefinitionVariant, + ToCopyableBuilder { @Nullable private final String language; @@ -95,31 +101,64 @@ protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { // --------------------------------------------------------------------------------------------- + @Override + @Nonnull + public Builder toBuilder() { + return new Builder(this); + } + + @Nonnull + public static Builder builder() { + return new Builder(); + } + /** * Builder for {@link StemmerTokenFilter}. */ - public static class Builder extends TokenFilterBase.AbstractBuilder implements ObjectBuilder { + public static class Builder extends TokenFilterBase.AbstractBuilder implements CopyableBuilder { @Nullable private String language; + public Builder() {} + + private Builder(StemmerTokenFilter o) { + super(o); + this.language = o.language; + } + + private Builder(Builder o) { + super(o); + this.language = o.language; + } + + @Override + @Nonnull + public Builder copy() { + return new Builder(this); + } + + @Override + @Nonnull + protected Builder self() { + return this; + } + /** * API name: {@code language} */ + @Nonnull public final Builder language(@Nullable String value) { this.language = value; return this; } - @Override - protected Builder self() { - return this; - } - /** * Builds a {@link StemmerTokenFilter}. * * @throws NullPointerException if some of the required fields are null. */ + @Override + @Nonnull public StemmerTokenFilter build() { _checkSingleUse(); diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/analysis/StopAnalyzer.java b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/analysis/StopAnalyzer.java index 8a6d37cae7..9cfc63d99e 100644 --- a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/analysis/StopAnalyzer.java +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/analysis/StopAnalyzer.java @@ -50,14 +50,16 @@ 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: _types.analysis.StopAnalyzer @JsonpDeserializable @Generated("org.opensearch.client.codegen.CodeGenerator") -public class StopAnalyzer implements AnalyzerVariant, PlainJsonSerializable { +public class StopAnalyzer implements AnalyzerVariant, PlainJsonSerializable, ToCopyableBuilder { @Nonnull private final List stopwords; @@ -146,10 +148,21 @@ protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { // --------------------------------------------------------------------------------------------- + @Override + @Nonnull + public Builder toBuilder() { + return new Builder(this); + } + + @Nonnull + public static Builder builder() { + return new Builder(); + } + /** * Builder for {@link StopAnalyzer}. */ - public static class Builder extends ObjectBuilderBase implements ObjectBuilder { + public static class Builder extends ObjectBuilderBase implements CopyableBuilder { @Nullable private List stopwords; @Nullable @@ -157,6 +170,26 @@ public static class Builder extends ObjectBuilderBase implements ObjectBuilderlist to stopwords. *

*/ + @Nonnull public final Builder stopwords(List list) { this.stopwords = _listAddAll(this.stopwords, list); return this; @@ -176,6 +210,7 @@ public final Builder stopwords(List list) { * Adds one or more values to stopwords. *

*/ + @Nonnull public final Builder stopwords(String value, String... values) { this.stopwords = _listAdd(this.stopwords, value, values); return this; @@ -184,6 +219,7 @@ public final Builder stopwords(String value, String... values) { /** * API name: {@code stopwords_path} */ + @Nonnull public final Builder stopwordsPath(@Nullable String value) { this.stopwordsPath = value; return this; @@ -192,6 +228,7 @@ public final Builder stopwordsPath(@Nullable String value) { /** * API name: {@code version} */ + @Nonnull public final Builder version(@Nullable String value) { this.version = value; return this; @@ -202,6 +239,8 @@ public final Builder version(@Nullable String value) { * * @throws NullPointerException if some of the required fields are null. */ + @Override + @Nonnull public StopAnalyzer build() { _checkSingleUse(); diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/analysis/StopTokenFilter.java b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/analysis/StopTokenFilter.java index 2d0bcaa35d..2a871a7da9 100644 --- a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/analysis/StopTokenFilter.java +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/analysis/StopTokenFilter.java @@ -49,13 +49,18 @@ import org.opensearch.client.json.ObjectBuilderDeserializer; import org.opensearch.client.json.ObjectDeserializer; import org.opensearch.client.util.ApiTypeHelper; +import org.opensearch.client.util.CopyableBuilder; import org.opensearch.client.util.ObjectBuilder; +import org.opensearch.client.util.ToCopyableBuilder; // typedef: _types.analysis.StopTokenFilter @JsonpDeserializable @Generated("org.opensearch.client.codegen.CodeGenerator") -public class StopTokenFilter extends TokenFilterBase implements TokenFilterDefinitionVariant { +public class StopTokenFilter extends TokenFilterBase + implements + TokenFilterDefinitionVariant, + ToCopyableBuilder { @Nullable private final Boolean ignoreCase; @@ -153,10 +158,21 @@ protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { // --------------------------------------------------------------------------------------------- + @Override + @Nonnull + public Builder toBuilder() { + return new Builder(this); + } + + @Nonnull + public static Builder builder() { + return new Builder(); + } + /** * Builder for {@link StopTokenFilter}. */ - public static class Builder extends TokenFilterBase.AbstractBuilder implements ObjectBuilder { + public static class Builder extends TokenFilterBase.AbstractBuilder implements CopyableBuilder { @Nullable private Boolean ignoreCase; @Nullable @@ -166,9 +182,40 @@ public static class Builder extends TokenFilterBase.AbstractBuilder imp @Nullable private String stopwordsPath; + public Builder() {} + + private Builder(StopTokenFilter o) { + super(o); + this.ignoreCase = o.ignoreCase; + this.removeTrailing = o.removeTrailing; + this.stopwords = _listCopy(o.stopwords); + this.stopwordsPath = o.stopwordsPath; + } + + private Builder(Builder o) { + super(o); + this.ignoreCase = o.ignoreCase; + this.removeTrailing = o.removeTrailing; + this.stopwords = _listCopy(o.stopwords); + this.stopwordsPath = o.stopwordsPath; + } + + @Override + @Nonnull + public Builder copy() { + return new Builder(this); + } + + @Override + @Nonnull + protected Builder self() { + return this; + } + /** * API name: {@code ignore_case} */ + @Nonnull public final Builder ignoreCase(@Nullable Boolean value) { this.ignoreCase = value; return this; @@ -177,6 +224,7 @@ public final Builder ignoreCase(@Nullable Boolean value) { /** * API name: {@code remove_trailing} */ + @Nonnull public final Builder removeTrailing(@Nullable Boolean value) { this.removeTrailing = value; return this; @@ -189,6 +237,7 @@ public final Builder removeTrailing(@Nullable Boolean value) { * Adds all elements of list to stopwords. *

*/ + @Nonnull public final Builder stopwords(List list) { this.stopwords = _listAddAll(this.stopwords, list); return this; @@ -201,6 +250,7 @@ public final Builder stopwords(List list) { * Adds one or more values to stopwords. *

*/ + @Nonnull public final Builder stopwords(String value, String... values) { this.stopwords = _listAdd(this.stopwords, value, values); return this; @@ -209,21 +259,19 @@ public final Builder stopwords(String value, String... values) { /** * API name: {@code stopwords_path} */ + @Nonnull public final Builder stopwordsPath(@Nullable String value) { this.stopwordsPath = value; return this; } - @Override - protected Builder self() { - return this; - } - /** * Builds a {@link StopTokenFilter}. * * @throws NullPointerException if some of the required fields are null. */ + @Override + @Nonnull public StopTokenFilter build() { _checkSingleUse(); diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/analysis/SynonymGraphTokenFilter.java b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/analysis/SynonymGraphTokenFilter.java index b4a9178828..a96d0b3dfe 100644 --- a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/analysis/SynonymGraphTokenFilter.java +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/analysis/SynonymGraphTokenFilter.java @@ -49,13 +49,18 @@ import org.opensearch.client.json.ObjectBuilderDeserializer; import org.opensearch.client.json.ObjectDeserializer; import org.opensearch.client.util.ApiTypeHelper; +import org.opensearch.client.util.CopyableBuilder; import org.opensearch.client.util.ObjectBuilder; +import org.opensearch.client.util.ToCopyableBuilder; // typedef: _types.analysis.SynonymGraphTokenFilter @JsonpDeserializable @Generated("org.opensearch.client.codegen.CodeGenerator") -public class SynonymGraphTokenFilter extends TokenFilterBase implements TokenFilterDefinitionVariant { +public class SynonymGraphTokenFilter extends TokenFilterBase + implements + TokenFilterDefinitionVariant, + ToCopyableBuilder { @Nullable private final Boolean expand; @@ -204,10 +209,23 @@ protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { // --------------------------------------------------------------------------------------------- + @Override + @Nonnull + public Builder toBuilder() { + return new Builder(this); + } + + @Nonnull + public static Builder builder() { + return new Builder(); + } + /** * Builder for {@link SynonymGraphTokenFilter}. */ - public static class Builder extends TokenFilterBase.AbstractBuilder implements ObjectBuilder { + public static class Builder extends TokenFilterBase.AbstractBuilder + implements + CopyableBuilder { @Nullable private Boolean expand; @Nullable @@ -223,9 +241,46 @@ public static class Builder extends TokenFilterBase.AbstractBuilder imp @Nullable private Boolean updateable; + public Builder() {} + + private Builder(SynonymGraphTokenFilter o) { + super(o); + this.expand = o.expand; + this.format = o.format; + this.lenient = o.lenient; + this.synonyms = _listCopy(o.synonyms); + this.synonymsPath = o.synonymsPath; + this.tokenizer = o.tokenizer; + this.updateable = o.updateable; + } + + private Builder(Builder o) { + super(o); + this.expand = o.expand; + this.format = o.format; + this.lenient = o.lenient; + this.synonyms = _listCopy(o.synonyms); + this.synonymsPath = o.synonymsPath; + this.tokenizer = o.tokenizer; + this.updateable = o.updateable; + } + + @Override + @Nonnull + public Builder copy() { + return new Builder(this); + } + + @Override + @Nonnull + protected Builder self() { + return this; + } + /** * API name: {@code expand} */ + @Nonnull public final Builder expand(@Nullable Boolean value) { this.expand = value; return this; @@ -234,6 +289,7 @@ public final Builder expand(@Nullable Boolean value) { /** * API name: {@code format} */ + @Nonnull public final Builder format(@Nullable SynonymFormat value) { this.format = value; return this; @@ -242,6 +298,7 @@ public final Builder format(@Nullable SynonymFormat value) { /** * API name: {@code lenient} */ + @Nonnull public final Builder lenient(@Nullable Boolean value) { this.lenient = value; return this; @@ -254,6 +311,7 @@ public final Builder lenient(@Nullable Boolean value) { * Adds all elements of list to synonyms. *

*/ + @Nonnull public final Builder synonyms(List list) { this.synonyms = _listAddAll(this.synonyms, list); return this; @@ -266,6 +324,7 @@ public final Builder synonyms(List list) { * Adds one or more values to synonyms. *

*/ + @Nonnull public final Builder synonyms(String value, String... values) { this.synonyms = _listAdd(this.synonyms, value, values); return this; @@ -274,6 +333,7 @@ public final Builder synonyms(String value, String... values) { /** * API name: {@code synonyms_path} */ + @Nonnull public final Builder synonymsPath(@Nullable String value) { this.synonymsPath = value; return this; @@ -282,6 +342,7 @@ public final Builder synonymsPath(@Nullable String value) { /** * API name: {@code tokenizer} */ + @Nonnull public final Builder tokenizer(@Nullable String value) { this.tokenizer = value; return this; @@ -290,21 +351,19 @@ public final Builder tokenizer(@Nullable String value) { /** * API name: {@code updateable} */ + @Nonnull public final Builder updateable(@Nullable Boolean value) { this.updateable = value; return this; } - @Override - protected Builder self() { - return this; - } - /** * Builds a {@link SynonymGraphTokenFilter}. * * @throws NullPointerException if some of the required fields are null. */ + @Override + @Nonnull public SynonymGraphTokenFilter build() { _checkSingleUse(); diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/analysis/SynonymTokenFilter.java b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/analysis/SynonymTokenFilter.java index 1780bb63ec..2135d63f71 100644 --- a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/analysis/SynonymTokenFilter.java +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/analysis/SynonymTokenFilter.java @@ -49,13 +49,18 @@ import org.opensearch.client.json.ObjectBuilderDeserializer; import org.opensearch.client.json.ObjectDeserializer; import org.opensearch.client.util.ApiTypeHelper; +import org.opensearch.client.util.CopyableBuilder; import org.opensearch.client.util.ObjectBuilder; +import org.opensearch.client.util.ToCopyableBuilder; // typedef: _types.analysis.SynonymTokenFilter @JsonpDeserializable @Generated("org.opensearch.client.codegen.CodeGenerator") -public class SynonymTokenFilter extends TokenFilterBase implements TokenFilterDefinitionVariant { +public class SynonymTokenFilter extends TokenFilterBase + implements + TokenFilterDefinitionVariant, + ToCopyableBuilder { @Nullable private final Boolean expand; @@ -204,10 +209,21 @@ protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { // --------------------------------------------------------------------------------------------- + @Override + @Nonnull + public Builder toBuilder() { + return new Builder(this); + } + + @Nonnull + public static Builder builder() { + return new Builder(); + } + /** * Builder for {@link SynonymTokenFilter}. */ - public static class Builder extends TokenFilterBase.AbstractBuilder implements ObjectBuilder { + public static class Builder extends TokenFilterBase.AbstractBuilder implements CopyableBuilder { @Nullable private Boolean expand; @Nullable @@ -223,9 +239,46 @@ public static class Builder extends TokenFilterBase.AbstractBuilder imp @Nullable private Boolean updateable; + public Builder() {} + + private Builder(SynonymTokenFilter o) { + super(o); + this.expand = o.expand; + this.format = o.format; + this.lenient = o.lenient; + this.synonyms = _listCopy(o.synonyms); + this.synonymsPath = o.synonymsPath; + this.tokenizer = o.tokenizer; + this.updateable = o.updateable; + } + + private Builder(Builder o) { + super(o); + this.expand = o.expand; + this.format = o.format; + this.lenient = o.lenient; + this.synonyms = _listCopy(o.synonyms); + this.synonymsPath = o.synonymsPath; + this.tokenizer = o.tokenizer; + this.updateable = o.updateable; + } + + @Override + @Nonnull + public Builder copy() { + return new Builder(this); + } + + @Override + @Nonnull + protected Builder self() { + return this; + } + /** * API name: {@code expand} */ + @Nonnull public final Builder expand(@Nullable Boolean value) { this.expand = value; return this; @@ -234,6 +287,7 @@ public final Builder expand(@Nullable Boolean value) { /** * API name: {@code format} */ + @Nonnull public final Builder format(@Nullable SynonymFormat value) { this.format = value; return this; @@ -242,6 +296,7 @@ public final Builder format(@Nullable SynonymFormat value) { /** * API name: {@code lenient} */ + @Nonnull public final Builder lenient(@Nullable Boolean value) { this.lenient = value; return this; @@ -254,6 +309,7 @@ public final Builder lenient(@Nullable Boolean value) { * Adds all elements of list to synonyms. *

*/ + @Nonnull public final Builder synonyms(List list) { this.synonyms = _listAddAll(this.synonyms, list); return this; @@ -266,6 +322,7 @@ public final Builder synonyms(List list) { * Adds one or more values to synonyms. *

*/ + @Nonnull public final Builder synonyms(String value, String... values) { this.synonyms = _listAdd(this.synonyms, value, values); return this; @@ -274,6 +331,7 @@ public final Builder synonyms(String value, String... values) { /** * API name: {@code synonyms_path} */ + @Nonnull public final Builder synonymsPath(@Nullable String value) { this.synonymsPath = value; return this; @@ -282,6 +340,7 @@ public final Builder synonymsPath(@Nullable String value) { /** * API name: {@code tokenizer} */ + @Nonnull public final Builder tokenizer(@Nullable String value) { this.tokenizer = value; return this; @@ -290,21 +349,19 @@ public final Builder tokenizer(@Nullable String value) { /** * API name: {@code updateable} */ + @Nonnull public final Builder updateable(@Nullable Boolean value) { this.updateable = value; return this; } - @Override - protected Builder self() { - return this; - } - /** * Builds a {@link SynonymTokenFilter}. * * @throws NullPointerException if some of the required fields are null. */ + @Override + @Nonnull public SynonymTokenFilter build() { _checkSingleUse(); diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/analysis/TokenFilterBase.java b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/analysis/TokenFilterBase.java index 28ae11023f..cd7384841c 100644 --- a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/analysis/TokenFilterBase.java +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/analysis/TokenFilterBase.java @@ -39,6 +39,7 @@ import jakarta.json.stream.JsonGenerator; import java.util.Objects; import javax.annotation.Generated; +import javax.annotation.Nonnull; import javax.annotation.Nullable; import org.opensearch.client.json.JsonpDeserializer; import org.opensearch.client.json.JsonpMapper; @@ -91,15 +92,28 @@ protected abstract static class AbstractBuilder o) { + this.version = o.version; + } + + @Nonnull + protected abstract BuilderT self(); + /** * API name: {@code version} */ + @Nonnull public final BuilderT version(@Nullable String value) { this.version = value; return self(); } - protected abstract BuilderT self(); } // --------------------------------------------------------------------------------------------- diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/analysis/TokenizerBase.java b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/analysis/TokenizerBase.java index 877d1e97f6..1d8ba0a3ac 100644 --- a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/analysis/TokenizerBase.java +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/analysis/TokenizerBase.java @@ -39,6 +39,7 @@ import jakarta.json.stream.JsonGenerator; import java.util.Objects; import javax.annotation.Generated; +import javax.annotation.Nonnull; import javax.annotation.Nullable; import org.opensearch.client.json.JsonpDeserializer; import org.opensearch.client.json.JsonpMapper; @@ -91,15 +92,28 @@ protected abstract static class AbstractBuilder o) { + this.version = o.version; + } + + @Nonnull + protected abstract BuilderT self(); + /** * API name: {@code version} */ + @Nonnull public final BuilderT version(@Nullable String value) { this.version = value; return self(); } - protected abstract BuilderT self(); } // --------------------------------------------------------------------------------------------- diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/analysis/TrimTokenFilter.java b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/analysis/TrimTokenFilter.java index f62324ca7c..884b89a725 100644 --- a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/analysis/TrimTokenFilter.java +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/analysis/TrimTokenFilter.java @@ -39,18 +39,24 @@ 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.util.CopyableBuilder; import org.opensearch.client.util.ObjectBuilder; +import org.opensearch.client.util.ToCopyableBuilder; // typedef: _types.analysis.TrimTokenFilter @JsonpDeserializable @Generated("org.opensearch.client.codegen.CodeGenerator") -public class TrimTokenFilter extends TokenFilterBase implements TokenFilterDefinitionVariant { +public class TrimTokenFilter extends TokenFilterBase + implements + TokenFilterDefinitionVariant, + ToCopyableBuilder { // --------------------------------------------------------------------------------------------- @@ -77,12 +83,40 @@ protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { // --------------------------------------------------------------------------------------------- + @Override + @Nonnull + public Builder toBuilder() { + return new Builder(this); + } + + @Nonnull + public static Builder builder() { + return new Builder(); + } + /** * Builder for {@link TrimTokenFilter}. */ - public static class Builder extends TokenFilterBase.AbstractBuilder implements ObjectBuilder { + public static class Builder extends TokenFilterBase.AbstractBuilder implements CopyableBuilder { + + public Builder() {} + + private Builder(TrimTokenFilter o) { + super(o); + } + + private Builder(Builder o) { + super(o); + } @Override + @Nonnull + public Builder copy() { + return new Builder(this); + } + + @Override + @Nonnull protected Builder self() { return this; } @@ -92,6 +126,8 @@ protected Builder self() { * * @throws NullPointerException if some of the required fields are null. */ + @Override + @Nonnull public TrimTokenFilter build() { _checkSingleUse(); diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/analysis/TruncateTokenFilter.java b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/analysis/TruncateTokenFilter.java index d38c255a31..27076ad3f5 100644 --- a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/analysis/TruncateTokenFilter.java +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/analysis/TruncateTokenFilter.java @@ -40,19 +40,25 @@ 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.util.CopyableBuilder; import org.opensearch.client.util.ObjectBuilder; +import org.opensearch.client.util.ToCopyableBuilder; // typedef: _types.analysis.TruncateTokenFilter @JsonpDeserializable @Generated("org.opensearch.client.codegen.CodeGenerator") -public class TruncateTokenFilter extends TokenFilterBase implements TokenFilterDefinitionVariant { +public class TruncateTokenFilter extends TokenFilterBase + implements + TokenFilterDefinitionVariant, + ToCopyableBuilder { @Nullable private final Integer length; @@ -95,31 +101,64 @@ protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { // --------------------------------------------------------------------------------------------- + @Override + @Nonnull + public Builder toBuilder() { + return new Builder(this); + } + + @Nonnull + public static Builder builder() { + return new Builder(); + } + /** * Builder for {@link TruncateTokenFilter}. */ - public static class Builder extends TokenFilterBase.AbstractBuilder implements ObjectBuilder { + public static class Builder extends TokenFilterBase.AbstractBuilder implements CopyableBuilder { @Nullable private Integer length; + public Builder() {} + + private Builder(TruncateTokenFilter o) { + super(o); + this.length = o.length; + } + + private Builder(Builder o) { + super(o); + this.length = o.length; + } + + @Override + @Nonnull + public Builder copy() { + return new Builder(this); + } + + @Override + @Nonnull + protected Builder self() { + return this; + } + /** * API name: {@code length} */ + @Nonnull public final Builder length(@Nullable Integer value) { this.length = value; return this; } - @Override - protected Builder self() { - return this; - } - /** * Builds a {@link TruncateTokenFilter}. * * @throws NullPointerException if some of the required fields are null. */ + @Override + @Nonnull public TruncateTokenFilter build() { _checkSingleUse(); diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/analysis/UaxEmailUrlTokenizer.java b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/analysis/UaxEmailUrlTokenizer.java index 04efd675fd..a7ad5d5c64 100644 --- a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/analysis/UaxEmailUrlTokenizer.java +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/analysis/UaxEmailUrlTokenizer.java @@ -40,19 +40,25 @@ 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.util.CopyableBuilder; import org.opensearch.client.util.ObjectBuilder; +import org.opensearch.client.util.ToCopyableBuilder; // typedef: _types.analysis.UaxEmailUrlTokenizer @JsonpDeserializable @Generated("org.opensearch.client.codegen.CodeGenerator") -public class UaxEmailUrlTokenizer extends TokenizerBase implements TokenizerDefinitionVariant { +public class UaxEmailUrlTokenizer extends TokenizerBase + implements + TokenizerDefinitionVariant, + ToCopyableBuilder { @Nullable private final Integer maxTokenLength; @@ -95,31 +101,64 @@ protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { // --------------------------------------------------------------------------------------------- + @Override + @Nonnull + public Builder toBuilder() { + return new Builder(this); + } + + @Nonnull + public static Builder builder() { + return new Builder(); + } + /** * Builder for {@link UaxEmailUrlTokenizer}. */ - public static class Builder extends TokenizerBase.AbstractBuilder implements ObjectBuilder { + public static class Builder extends TokenizerBase.AbstractBuilder implements CopyableBuilder { @Nullable private Integer maxTokenLength; + public Builder() {} + + private Builder(UaxEmailUrlTokenizer o) { + super(o); + this.maxTokenLength = o.maxTokenLength; + } + + private Builder(Builder o) { + super(o); + this.maxTokenLength = o.maxTokenLength; + } + + @Override + @Nonnull + public Builder copy() { + return new Builder(this); + } + + @Override + @Nonnull + protected Builder self() { + return this; + } + /** * API name: {@code max_token_length} */ + @Nonnull public final Builder maxTokenLength(@Nullable Integer value) { this.maxTokenLength = value; return this; } - @Override - protected Builder self() { - return this; - } - /** * Builds a {@link UaxEmailUrlTokenizer}. * * @throws NullPointerException if some of the required fields are null. */ + @Override + @Nonnull public UaxEmailUrlTokenizer build() { _checkSingleUse(); diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/analysis/UniqueTokenFilter.java b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/analysis/UniqueTokenFilter.java index 7b2a67fa0a..1cf020ba18 100644 --- a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/analysis/UniqueTokenFilter.java +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/analysis/UniqueTokenFilter.java @@ -40,19 +40,25 @@ 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.util.CopyableBuilder; import org.opensearch.client.util.ObjectBuilder; +import org.opensearch.client.util.ToCopyableBuilder; // typedef: _types.analysis.UniqueTokenFilter @JsonpDeserializable @Generated("org.opensearch.client.codegen.CodeGenerator") -public class UniqueTokenFilter extends TokenFilterBase implements TokenFilterDefinitionVariant { +public class UniqueTokenFilter extends TokenFilterBase + implements + TokenFilterDefinitionVariant, + ToCopyableBuilder { @Nullable private final Boolean onlyOnSamePosition; @@ -95,31 +101,64 @@ protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { // --------------------------------------------------------------------------------------------- + @Override + @Nonnull + public Builder toBuilder() { + return new Builder(this); + } + + @Nonnull + public static Builder builder() { + return new Builder(); + } + /** * Builder for {@link UniqueTokenFilter}. */ - public static class Builder extends TokenFilterBase.AbstractBuilder implements ObjectBuilder { + public static class Builder extends TokenFilterBase.AbstractBuilder implements CopyableBuilder { @Nullable private Boolean onlyOnSamePosition; + public Builder() {} + + private Builder(UniqueTokenFilter o) { + super(o); + this.onlyOnSamePosition = o.onlyOnSamePosition; + } + + private Builder(Builder o) { + super(o); + this.onlyOnSamePosition = o.onlyOnSamePosition; + } + + @Override + @Nonnull + public Builder copy() { + return new Builder(this); + } + + @Override + @Nonnull + protected Builder self() { + return this; + } + /** * API name: {@code only_on_same_position} */ + @Nonnull public final Builder onlyOnSamePosition(@Nullable Boolean value) { this.onlyOnSamePosition = value; return this; } - @Override - protected Builder self() { - return this; - } - /** * Builds a {@link UniqueTokenFilter}. * * @throws NullPointerException if some of the required fields are null. */ + @Override + @Nonnull public UniqueTokenFilter build() { _checkSingleUse(); diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/analysis/UppercaseTokenFilter.java b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/analysis/UppercaseTokenFilter.java index 1f309f3f5e..462ceee5d3 100644 --- a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/analysis/UppercaseTokenFilter.java +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/analysis/UppercaseTokenFilter.java @@ -39,18 +39,24 @@ 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.util.CopyableBuilder; import org.opensearch.client.util.ObjectBuilder; +import org.opensearch.client.util.ToCopyableBuilder; // typedef: _types.analysis.UppercaseTokenFilter @JsonpDeserializable @Generated("org.opensearch.client.codegen.CodeGenerator") -public class UppercaseTokenFilter extends TokenFilterBase implements TokenFilterDefinitionVariant { +public class UppercaseTokenFilter extends TokenFilterBase + implements + TokenFilterDefinitionVariant, + ToCopyableBuilder { // --------------------------------------------------------------------------------------------- @@ -77,12 +83,40 @@ protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { // --------------------------------------------------------------------------------------------- + @Override + @Nonnull + public Builder toBuilder() { + return new Builder(this); + } + + @Nonnull + public static Builder builder() { + return new Builder(); + } + /** * Builder for {@link UppercaseTokenFilter}. */ - public static class Builder extends TokenFilterBase.AbstractBuilder implements ObjectBuilder { + public static class Builder extends TokenFilterBase.AbstractBuilder implements CopyableBuilder { + + public Builder() {} + + private Builder(UppercaseTokenFilter o) { + super(o); + } + + private Builder(Builder o) { + super(o); + } @Override + @Nonnull + public Builder copy() { + return new Builder(this); + } + + @Override + @Nonnull protected Builder self() { return this; } @@ -92,6 +126,8 @@ protected Builder self() { * * @throws NullPointerException if some of the required fields are null. */ + @Override + @Nonnull public UppercaseTokenFilter build() { _checkSingleUse(); diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/analysis/WhitespaceAnalyzer.java b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/analysis/WhitespaceAnalyzer.java index abb883a0d0..4cf0961f75 100644 --- a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/analysis/WhitespaceAnalyzer.java +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/analysis/WhitespaceAnalyzer.java @@ -40,6 +40,7 @@ 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; @@ -47,14 +48,20 @@ 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: _types.analysis.WhitespaceAnalyzer @JsonpDeserializable @Generated("org.opensearch.client.codegen.CodeGenerator") -public class WhitespaceAnalyzer implements AnalyzerVariant, PlainJsonSerializable { +public class WhitespaceAnalyzer + implements + AnalyzerVariant, + PlainJsonSerializable, + ToCopyableBuilder { @Nullable private final String version; @@ -105,16 +112,44 @@ protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { // --------------------------------------------------------------------------------------------- + @Override + @Nonnull + public Builder toBuilder() { + return new Builder(this); + } + + @Nonnull + public static Builder builder() { + return new Builder(); + } + /** * Builder for {@link WhitespaceAnalyzer}. */ - public static class Builder extends ObjectBuilderBase implements ObjectBuilder { + public static class Builder extends ObjectBuilderBase implements CopyableBuilder { @Nullable private String version; + public Builder() {} + + private Builder(WhitespaceAnalyzer o) { + this.version = o.version; + } + + private Builder(Builder o) { + this.version = o.version; + } + + @Override + @Nonnull + public Builder copy() { + return new Builder(this); + } + /** * API name: {@code version} */ + @Nonnull public final Builder version(@Nullable String value) { this.version = value; return this; @@ -125,6 +160,8 @@ public final Builder version(@Nullable String value) { * * @throws NullPointerException if some of the required fields are null. */ + @Override + @Nonnull public WhitespaceAnalyzer build() { _checkSingleUse(); diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/analysis/WhitespaceTokenizer.java b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/analysis/WhitespaceTokenizer.java index ac860b62d5..bfa6d540c1 100644 --- a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/analysis/WhitespaceTokenizer.java +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/analysis/WhitespaceTokenizer.java @@ -40,19 +40,25 @@ 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.util.CopyableBuilder; import org.opensearch.client.util.ObjectBuilder; +import org.opensearch.client.util.ToCopyableBuilder; // typedef: _types.analysis.WhitespaceTokenizer @JsonpDeserializable @Generated("org.opensearch.client.codegen.CodeGenerator") -public class WhitespaceTokenizer extends TokenizerBase implements TokenizerDefinitionVariant { +public class WhitespaceTokenizer extends TokenizerBase + implements + TokenizerDefinitionVariant, + ToCopyableBuilder { @Nullable private final Integer maxTokenLength; @@ -95,31 +101,64 @@ protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { // --------------------------------------------------------------------------------------------- + @Override + @Nonnull + public Builder toBuilder() { + return new Builder(this); + } + + @Nonnull + public static Builder builder() { + return new Builder(); + } + /** * Builder for {@link WhitespaceTokenizer}. */ - public static class Builder extends TokenizerBase.AbstractBuilder implements ObjectBuilder { + public static class Builder extends TokenizerBase.AbstractBuilder implements CopyableBuilder { @Nullable private Integer maxTokenLength; + public Builder() {} + + private Builder(WhitespaceTokenizer o) { + super(o); + this.maxTokenLength = o.maxTokenLength; + } + + private Builder(Builder o) { + super(o); + this.maxTokenLength = o.maxTokenLength; + } + + @Override + @Nonnull + public Builder copy() { + return new Builder(this); + } + + @Override + @Nonnull + protected Builder self() { + return this; + } + /** * API name: {@code max_token_length} */ + @Nonnull public final Builder maxTokenLength(@Nullable Integer value) { this.maxTokenLength = value; return this; } - @Override - protected Builder self() { - return this; - } - /** * Builds a {@link WhitespaceTokenizer}. * * @throws NullPointerException if some of the required fields are null. */ + @Override + @Nonnull public WhitespaceTokenizer build() { _checkSingleUse(); diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/analysis/WordDelimiterGraphTokenFilter.java b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/analysis/WordDelimiterGraphTokenFilter.java index 3674d28072..3d0e4798df 100644 --- a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/analysis/WordDelimiterGraphTokenFilter.java +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/analysis/WordDelimiterGraphTokenFilter.java @@ -49,13 +49,18 @@ import org.opensearch.client.json.ObjectBuilderDeserializer; import org.opensearch.client.json.ObjectDeserializer; import org.opensearch.client.util.ApiTypeHelper; +import org.opensearch.client.util.CopyableBuilder; import org.opensearch.client.util.ObjectBuilder; +import org.opensearch.client.util.ToCopyableBuilder; // typedef: _types.analysis.WordDelimiterGraphTokenFilter @JsonpDeserializable @Generated("org.opensearch.client.codegen.CodeGenerator") -public class WordDelimiterGraphTokenFilter extends TokenFilterBase implements TokenFilterDefinitionVariant { +public class WordDelimiterGraphTokenFilter extends TokenFilterBase + implements + TokenFilterDefinitionVariant, + ToCopyableBuilder { @Nullable private final Boolean adjustOffsets; @@ -346,10 +351,23 @@ protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { // --------------------------------------------------------------------------------------------- + @Override + @Nonnull + public Builder toBuilder() { + return new Builder(this); + } + + @Nonnull + public static Builder builder() { + return new Builder(); + } + /** * Builder for {@link WordDelimiterGraphTokenFilter}. */ - public static class Builder extends TokenFilterBase.AbstractBuilder implements ObjectBuilder { + public static class Builder extends TokenFilterBase.AbstractBuilder + implements + CopyableBuilder { @Nullable private Boolean adjustOffsets; @Nullable @@ -381,9 +399,62 @@ public static class Builder extends TokenFilterBase.AbstractBuilder imp @Nullable private String typeTablePath; + public Builder() {} + + private Builder(WordDelimiterGraphTokenFilter o) { + super(o); + this.adjustOffsets = o.adjustOffsets; + this.catenateAll = o.catenateAll; + this.catenateNumbers = o.catenateNumbers; + this.catenateWords = o.catenateWords; + this.generateNumberParts = o.generateNumberParts; + this.generateWordParts = o.generateWordParts; + this.ignoreKeywords = o.ignoreKeywords; + this.preserveOriginal = o.preserveOriginal; + this.protectedWords = _listCopy(o.protectedWords); + this.protectedWordsPath = o.protectedWordsPath; + this.splitOnCaseChange = o.splitOnCaseChange; + this.splitOnNumerics = o.splitOnNumerics; + this.stemEnglishPossessive = o.stemEnglishPossessive; + this.typeTable = _listCopy(o.typeTable); + this.typeTablePath = o.typeTablePath; + } + + private Builder(Builder o) { + super(o); + this.adjustOffsets = o.adjustOffsets; + this.catenateAll = o.catenateAll; + this.catenateNumbers = o.catenateNumbers; + this.catenateWords = o.catenateWords; + this.generateNumberParts = o.generateNumberParts; + this.generateWordParts = o.generateWordParts; + this.ignoreKeywords = o.ignoreKeywords; + this.preserveOriginal = o.preserveOriginal; + this.protectedWords = _listCopy(o.protectedWords); + this.protectedWordsPath = o.protectedWordsPath; + this.splitOnCaseChange = o.splitOnCaseChange; + this.splitOnNumerics = o.splitOnNumerics; + this.stemEnglishPossessive = o.stemEnglishPossessive; + this.typeTable = _listCopy(o.typeTable); + this.typeTablePath = o.typeTablePath; + } + + @Override + @Nonnull + public Builder copy() { + return new Builder(this); + } + + @Override + @Nonnull + protected Builder self() { + return this; + } + /** * API name: {@code adjust_offsets} */ + @Nonnull public final Builder adjustOffsets(@Nullable Boolean value) { this.adjustOffsets = value; return this; @@ -392,6 +463,7 @@ public final Builder adjustOffsets(@Nullable Boolean value) { /** * API name: {@code catenate_all} */ + @Nonnull public final Builder catenateAll(@Nullable Boolean value) { this.catenateAll = value; return this; @@ -400,6 +472,7 @@ public final Builder catenateAll(@Nullable Boolean value) { /** * API name: {@code catenate_numbers} */ + @Nonnull public final Builder catenateNumbers(@Nullable Boolean value) { this.catenateNumbers = value; return this; @@ -408,6 +481,7 @@ public final Builder catenateNumbers(@Nullable Boolean value) { /** * API name: {@code catenate_words} */ + @Nonnull public final Builder catenateWords(@Nullable Boolean value) { this.catenateWords = value; return this; @@ -416,6 +490,7 @@ public final Builder catenateWords(@Nullable Boolean value) { /** * API name: {@code generate_number_parts} */ + @Nonnull public final Builder generateNumberParts(@Nullable Boolean value) { this.generateNumberParts = value; return this; @@ -424,6 +499,7 @@ public final Builder generateNumberParts(@Nullable Boolean value) { /** * API name: {@code generate_word_parts} */ + @Nonnull public final Builder generateWordParts(@Nullable Boolean value) { this.generateWordParts = value; return this; @@ -432,6 +508,7 @@ public final Builder generateWordParts(@Nullable Boolean value) { /** * API name: {@code ignore_keywords} */ + @Nonnull public final Builder ignoreKeywords(@Nullable Boolean value) { this.ignoreKeywords = value; return this; @@ -440,6 +517,7 @@ public final Builder ignoreKeywords(@Nullable Boolean value) { /** * API name: {@code preserve_original} */ + @Nonnull public final Builder preserveOriginal(@Nullable Boolean value) { this.preserveOriginal = value; return this; @@ -452,6 +530,7 @@ public final Builder preserveOriginal(@Nullable Boolean value) { * Adds all elements of list to protectedWords. *

*/ + @Nonnull public final Builder protectedWords(List list) { this.protectedWords = _listAddAll(this.protectedWords, list); return this; @@ -464,6 +543,7 @@ public final Builder protectedWords(List list) { * Adds one or more values to protectedWords. *

*/ + @Nonnull public final Builder protectedWords(String value, String... values) { this.protectedWords = _listAdd(this.protectedWords, value, values); return this; @@ -472,6 +552,7 @@ public final Builder protectedWords(String value, String... values) { /** * API name: {@code protected_words_path} */ + @Nonnull public final Builder protectedWordsPath(@Nullable String value) { this.protectedWordsPath = value; return this; @@ -480,6 +561,7 @@ public final Builder protectedWordsPath(@Nullable String value) { /** * API name: {@code split_on_case_change} */ + @Nonnull public final Builder splitOnCaseChange(@Nullable Boolean value) { this.splitOnCaseChange = value; return this; @@ -488,6 +570,7 @@ public final Builder splitOnCaseChange(@Nullable Boolean value) { /** * API name: {@code split_on_numerics} */ + @Nonnull public final Builder splitOnNumerics(@Nullable Boolean value) { this.splitOnNumerics = value; return this; @@ -496,6 +579,7 @@ public final Builder splitOnNumerics(@Nullable Boolean value) { /** * API name: {@code stem_english_possessive} */ + @Nonnull public final Builder stemEnglishPossessive(@Nullable Boolean value) { this.stemEnglishPossessive = value; return this; @@ -508,6 +592,7 @@ public final Builder stemEnglishPossessive(@Nullable Boolean value) { * Adds all elements of list to typeTable. *

*/ + @Nonnull public final Builder typeTable(List list) { this.typeTable = _listAddAll(this.typeTable, list); return this; @@ -520,6 +605,7 @@ public final Builder typeTable(List list) { * Adds one or more values to typeTable. *

*/ + @Nonnull public final Builder typeTable(String value, String... values) { this.typeTable = _listAdd(this.typeTable, value, values); return this; @@ -528,21 +614,19 @@ public final Builder typeTable(String value, String... values) { /** * API name: {@code type_table_path} */ + @Nonnull public final Builder typeTablePath(@Nullable String value) { this.typeTablePath = value; return this; } - @Override - protected Builder self() { - return this; - } - /** * Builds a {@link WordDelimiterGraphTokenFilter}. * * @throws NullPointerException if some of the required fields are null. */ + @Override + @Nonnull public WordDelimiterGraphTokenFilter build() { _checkSingleUse(); diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/analysis/WordDelimiterTokenFilter.java b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/analysis/WordDelimiterTokenFilter.java index 6a4432a19e..45aa80bf1b 100644 --- a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/analysis/WordDelimiterTokenFilter.java +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/analysis/WordDelimiterTokenFilter.java @@ -49,13 +49,18 @@ import org.opensearch.client.json.ObjectBuilderDeserializer; import org.opensearch.client.json.ObjectDeserializer; import org.opensearch.client.util.ApiTypeHelper; +import org.opensearch.client.util.CopyableBuilder; import org.opensearch.client.util.ObjectBuilder; +import org.opensearch.client.util.ToCopyableBuilder; // typedef: _types.analysis.WordDelimiterTokenFilter @JsonpDeserializable @Generated("org.opensearch.client.codegen.CodeGenerator") -public class WordDelimiterTokenFilter extends TokenFilterBase implements TokenFilterDefinitionVariant { +public class WordDelimiterTokenFilter extends TokenFilterBase + implements + TokenFilterDefinitionVariant, + ToCopyableBuilder { @Nullable private final Boolean catenateAll; @@ -310,10 +315,23 @@ protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { // --------------------------------------------------------------------------------------------- + @Override + @Nonnull + public Builder toBuilder() { + return new Builder(this); + } + + @Nonnull + public static Builder builder() { + return new Builder(); + } + /** * Builder for {@link WordDelimiterTokenFilter}. */ - public static class Builder extends TokenFilterBase.AbstractBuilder implements ObjectBuilder { + public static class Builder extends TokenFilterBase.AbstractBuilder + implements + CopyableBuilder { @Nullable private Boolean catenateAll; @Nullable @@ -341,9 +359,58 @@ public static class Builder extends TokenFilterBase.AbstractBuilder imp @Nullable private String typeTablePath; + public Builder() {} + + private Builder(WordDelimiterTokenFilter o) { + super(o); + this.catenateAll = o.catenateAll; + this.catenateNumbers = o.catenateNumbers; + this.catenateWords = o.catenateWords; + this.generateNumberParts = o.generateNumberParts; + this.generateWordParts = o.generateWordParts; + this.preserveOriginal = o.preserveOriginal; + this.protectedWords = _listCopy(o.protectedWords); + this.protectedWordsPath = o.protectedWordsPath; + this.splitOnCaseChange = o.splitOnCaseChange; + this.splitOnNumerics = o.splitOnNumerics; + this.stemEnglishPossessive = o.stemEnglishPossessive; + this.typeTable = _listCopy(o.typeTable); + this.typeTablePath = o.typeTablePath; + } + + private Builder(Builder o) { + super(o); + this.catenateAll = o.catenateAll; + this.catenateNumbers = o.catenateNumbers; + this.catenateWords = o.catenateWords; + this.generateNumberParts = o.generateNumberParts; + this.generateWordParts = o.generateWordParts; + this.preserveOriginal = o.preserveOriginal; + this.protectedWords = _listCopy(o.protectedWords); + this.protectedWordsPath = o.protectedWordsPath; + this.splitOnCaseChange = o.splitOnCaseChange; + this.splitOnNumerics = o.splitOnNumerics; + this.stemEnglishPossessive = o.stemEnglishPossessive; + this.typeTable = _listCopy(o.typeTable); + this.typeTablePath = o.typeTablePath; + } + + @Override + @Nonnull + public Builder copy() { + return new Builder(this); + } + + @Override + @Nonnull + protected Builder self() { + return this; + } + /** * API name: {@code catenate_all} */ + @Nonnull public final Builder catenateAll(@Nullable Boolean value) { this.catenateAll = value; return this; @@ -352,6 +419,7 @@ public final Builder catenateAll(@Nullable Boolean value) { /** * API name: {@code catenate_numbers} */ + @Nonnull public final Builder catenateNumbers(@Nullable Boolean value) { this.catenateNumbers = value; return this; @@ -360,6 +428,7 @@ public final Builder catenateNumbers(@Nullable Boolean value) { /** * API name: {@code catenate_words} */ + @Nonnull public final Builder catenateWords(@Nullable Boolean value) { this.catenateWords = value; return this; @@ -368,6 +437,7 @@ public final Builder catenateWords(@Nullable Boolean value) { /** * API name: {@code generate_number_parts} */ + @Nonnull public final Builder generateNumberParts(@Nullable Boolean value) { this.generateNumberParts = value; return this; @@ -376,6 +446,7 @@ public final Builder generateNumberParts(@Nullable Boolean value) { /** * API name: {@code generate_word_parts} */ + @Nonnull public final Builder generateWordParts(@Nullable Boolean value) { this.generateWordParts = value; return this; @@ -384,6 +455,7 @@ public final Builder generateWordParts(@Nullable Boolean value) { /** * API name: {@code preserve_original} */ + @Nonnull public final Builder preserveOriginal(@Nullable Boolean value) { this.preserveOriginal = value; return this; @@ -396,6 +468,7 @@ public final Builder preserveOriginal(@Nullable Boolean value) { * Adds all elements of list to protectedWords. *

*/ + @Nonnull public final Builder protectedWords(List list) { this.protectedWords = _listAddAll(this.protectedWords, list); return this; @@ -408,6 +481,7 @@ public final Builder protectedWords(List list) { * Adds one or more values to protectedWords. *

*/ + @Nonnull public final Builder protectedWords(String value, String... values) { this.protectedWords = _listAdd(this.protectedWords, value, values); return this; @@ -416,6 +490,7 @@ public final Builder protectedWords(String value, String... values) { /** * API name: {@code protected_words_path} */ + @Nonnull public final Builder protectedWordsPath(@Nullable String value) { this.protectedWordsPath = value; return this; @@ -424,6 +499,7 @@ public final Builder protectedWordsPath(@Nullable String value) { /** * API name: {@code split_on_case_change} */ + @Nonnull public final Builder splitOnCaseChange(@Nullable Boolean value) { this.splitOnCaseChange = value; return this; @@ -432,6 +508,7 @@ public final Builder splitOnCaseChange(@Nullable Boolean value) { /** * API name: {@code split_on_numerics} */ + @Nonnull public final Builder splitOnNumerics(@Nullable Boolean value) { this.splitOnNumerics = value; return this; @@ -440,6 +517,7 @@ public final Builder splitOnNumerics(@Nullable Boolean value) { /** * API name: {@code stem_english_possessive} */ + @Nonnull public final Builder stemEnglishPossessive(@Nullable Boolean value) { this.stemEnglishPossessive = value; return this; @@ -452,6 +530,7 @@ public final Builder stemEnglishPossessive(@Nullable Boolean value) { * Adds all elements of list to typeTable. *

*/ + @Nonnull public final Builder typeTable(List list) { this.typeTable = _listAddAll(this.typeTable, list); return this; @@ -464,6 +543,7 @@ public final Builder typeTable(List list) { * Adds one or more values to typeTable. *

*/ + @Nonnull public final Builder typeTable(String value, String... values) { this.typeTable = _listAdd(this.typeTable, value, values); return this; @@ -472,21 +552,19 @@ public final Builder typeTable(String value, String... values) { /** * API name: {@code type_table_path} */ + @Nonnull public final Builder typeTablePath(@Nullable String value) { this.typeTablePath = value; return this; } - @Override - protected Builder self() { - return this; - } - /** * Builds a {@link WordDelimiterTokenFilter}. * * @throws NullPointerException if some of the required fields are null. */ + @Override + @Nonnull public WordDelimiterTokenFilter build() { _checkSingleUse(); diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/mapping/AggregateMetricDoubleProperty.java b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/mapping/AggregateMetricDoubleProperty.java index 9c482357e1..9672bd7434 100644 --- a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/mapping/AggregateMetricDoubleProperty.java +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/mapping/AggregateMetricDoubleProperty.java @@ -47,13 +47,18 @@ import org.opensearch.client.json.ObjectBuilderDeserializer; import org.opensearch.client.json.ObjectDeserializer; import org.opensearch.client.util.ApiTypeHelper; +import org.opensearch.client.util.CopyableBuilder; import org.opensearch.client.util.ObjectBuilder; +import org.opensearch.client.util.ToCopyableBuilder; // typedef: _types.mapping.AggregateMetricDoubleProperty @JsonpDeserializable @Generated("org.opensearch.client.codegen.CodeGenerator") -public class AggregateMetricDoubleProperty extends PropertyBase implements PropertyVariant { +public class AggregateMetricDoubleProperty extends PropertyBase + implements + PropertyVariant, + ToCopyableBuilder { @Nonnull private final String defaultMetric; @@ -115,16 +120,56 @@ protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { // --------------------------------------------------------------------------------------------- + @Override + @Nonnull + public Builder toBuilder() { + return new Builder(this); + } + + @Nonnull + public static Builder builder() { + return new Builder(); + } + /** * Builder for {@link AggregateMetricDoubleProperty}. */ - public static class Builder extends PropertyBase.AbstractBuilder implements ObjectBuilder { + public static class Builder extends PropertyBase.AbstractBuilder + implements + CopyableBuilder { private String defaultMetric; private List metrics; + public Builder() {} + + private Builder(AggregateMetricDoubleProperty o) { + super(o); + this.defaultMetric = o.defaultMetric; + this.metrics = _listCopy(o.metrics); + } + + private Builder(Builder o) { + super(o); + this.defaultMetric = o.defaultMetric; + this.metrics = _listCopy(o.metrics); + } + + @Override + @Nonnull + public Builder copy() { + return new Builder(this); + } + + @Override + @Nonnull + protected Builder self() { + return this; + } + /** * Required - API name: {@code default_metric} */ + @Nonnull public final Builder defaultMetric(String value) { this.defaultMetric = value; return this; @@ -137,6 +182,7 @@ public final Builder defaultMetric(String value) { * Adds all elements of list to metrics. *

*/ + @Nonnull public final Builder metrics(List list) { this.metrics = _listAddAll(this.metrics, list); return this; @@ -149,21 +195,19 @@ public final Builder metrics(List list) { * 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; } - @Override - protected Builder self() { - return this; - } - /** * Builds a {@link AggregateMetricDoubleProperty}. * * @throws NullPointerException if some of the required fields are null. */ + @Override + @Nonnull public AggregateMetricDoubleProperty build() { _checkSingleUse(); diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/mapping/AllField.java b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/mapping/AllField.java index 223be35e58..e45aacb6fc 100644 --- a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/mapping/AllField.java +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/mapping/AllField.java @@ -47,14 +47,16 @@ 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: _types.mapping.AllField @JsonpDeserializable @Generated("org.opensearch.client.codegen.CodeGenerator") -public class AllField implements PlainJsonSerializable { +public class AllField implements PlainJsonSerializable, ToCopyableBuilder { @Nonnull private final String analyzer; @@ -215,10 +217,21 @@ protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { // --------------------------------------------------------------------------------------------- + @Override + @Nonnull + public Builder toBuilder() { + return new Builder(this); + } + + @Nonnull + public static Builder builder() { + return new Builder(); + } + /** * Builder for {@link AllField}. */ - public static class Builder extends ObjectBuilderBase implements ObjectBuilder { + public static class Builder extends ObjectBuilderBase implements CopyableBuilder { private String analyzer; private Boolean enabled; private Boolean omitNorms; @@ -230,9 +243,44 @@ public static class Builder extends ObjectBuilderBase implements ObjectBuilder { // --------------------------------------------------------------------------------------------- @@ -77,12 +83,40 @@ protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { // --------------------------------------------------------------------------------------------- + @Override + @Nonnull + public Builder toBuilder() { + return new Builder(this); + } + + @Nonnull + public static Builder builder() { + return new Builder(); + } + /** * Builder for {@link BinaryProperty}. */ - public static class Builder extends DocValuesPropertyBase.AbstractBuilder implements ObjectBuilder { + public static class Builder extends DocValuesPropertyBase.AbstractBuilder implements CopyableBuilder { + + public Builder() {} + + private Builder(BinaryProperty o) { + super(o); + } + + private Builder(Builder o) { + super(o); + } @Override + @Nonnull + public Builder copy() { + return new Builder(this); + } + + @Override + @Nonnull protected Builder self() { return this; } @@ -92,6 +126,8 @@ protected Builder self() { * * @throws NullPointerException if some of the required fields are null. */ + @Override + @Nonnull public BinaryProperty build() { _checkSingleUse(); diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/mapping/BooleanProperty.java b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/mapping/BooleanProperty.java index 2961927c90..cf7ce70fed 100644 --- a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/mapping/BooleanProperty.java +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/mapping/BooleanProperty.java @@ -40,6 +40,7 @@ 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; @@ -47,13 +48,18 @@ import org.opensearch.client.json.ObjectBuilderDeserializer; import org.opensearch.client.json.ObjectDeserializer; import org.opensearch.client.opensearch.indices.NumericFielddata; +import org.opensearch.client.util.CopyableBuilder; import org.opensearch.client.util.ObjectBuilder; +import org.opensearch.client.util.ToCopyableBuilder; // typedef: _types.mapping.BooleanProperty @JsonpDeserializable @Generated("org.opensearch.client.codegen.CodeGenerator") -public class BooleanProperty extends DocValuesPropertyBase implements PropertyVariant { +public class BooleanProperty extends DocValuesPropertyBase + implements + PropertyVariant, + ToCopyableBuilder { @Nullable private final Double boost; @@ -147,10 +153,23 @@ protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { // --------------------------------------------------------------------------------------------- + @Override + @Nonnull + public Builder toBuilder() { + return new Builder(this); + } + + @Nonnull + public static Builder builder() { + return new Builder(); + } + /** * Builder for {@link BooleanProperty}. */ - public static class Builder extends DocValuesPropertyBase.AbstractBuilder implements ObjectBuilder { + public static class Builder extends DocValuesPropertyBase.AbstractBuilder + implements + CopyableBuilder { @Nullable private Double boost; @Nullable @@ -160,9 +179,40 @@ public static class Builder extends DocValuesPropertyBase.AbstractBuilder> fn) { return fielddata(fn.apply(new NumericFielddata.Builder()).build()); } @@ -186,6 +238,7 @@ public final Builder fielddata(Function { @Nullable private final Number nullValue; @@ -95,31 +101,66 @@ protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { // --------------------------------------------------------------------------------------------- + @Override + @Nonnull + public Builder toBuilder() { + return new Builder(this); + } + + @Nonnull + public static Builder builder() { + return new Builder(); + } + /** * Builder for {@link ByteNumberProperty}. */ - public static class Builder extends NumberPropertyBase.AbstractBuilder implements ObjectBuilder { + public static class Builder extends NumberPropertyBase.AbstractBuilder + implements + CopyableBuilder { @Nullable private Number nullValue; + public Builder() {} + + private Builder(ByteNumberProperty o) { + super(o); + this.nullValue = o.nullValue; + } + + private Builder(Builder o) { + super(o); + this.nullValue = o.nullValue; + } + + @Override + @Nonnull + public Builder copy() { + return new Builder(this); + } + + @Override + @Nonnull + protected Builder self() { + return this; + } + /** * API name: {@code null_value} */ + @Nonnull public final Builder nullValue(@Nullable Number value) { this.nullValue = value; return this; } - @Override - protected Builder self() { - return this; - } - /** * Builds a {@link ByteNumberProperty}. * * @throws NullPointerException if some of the required fields are null. */ + @Override + @Nonnull public ByteNumberProperty build() { _checkSingleUse(); diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/mapping/CompletionProperty.java b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/mapping/CompletionProperty.java index 4416c2a8ec..f84f42c38b 100644 --- a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/mapping/CompletionProperty.java +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/mapping/CompletionProperty.java @@ -49,13 +49,18 @@ import org.opensearch.client.json.ObjectBuilderDeserializer; import org.opensearch.client.json.ObjectDeserializer; import org.opensearch.client.util.ApiTypeHelper; +import org.opensearch.client.util.CopyableBuilder; import org.opensearch.client.util.ObjectBuilder; +import org.opensearch.client.util.ToCopyableBuilder; // typedef: _types.mapping.CompletionProperty @JsonpDeserializable @Generated("org.opensearch.client.codegen.CodeGenerator") -public class CompletionProperty extends DocValuesPropertyBase implements PropertyVariant { +public class CompletionProperty extends DocValuesPropertyBase + implements + PropertyVariant, + ToCopyableBuilder { @Nullable private final String analyzer; @@ -187,10 +192,23 @@ protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { // --------------------------------------------------------------------------------------------- + @Override + @Nonnull + public Builder toBuilder() { + return new Builder(this); + } + + @Nonnull + public static Builder builder() { + return new Builder(); + } + /** * Builder for {@link CompletionProperty}. */ - public static class Builder extends DocValuesPropertyBase.AbstractBuilder implements ObjectBuilder { + public static class Builder extends DocValuesPropertyBase.AbstractBuilder + implements + CopyableBuilder { @Nullable private String analyzer; @Nullable @@ -204,9 +222,44 @@ public static class Builder extends DocValuesPropertyBase.AbstractBuilderlist to contexts. *

*/ + @Nonnull public final Builder contexts(List list) { this.contexts = _listAddAll(this.contexts, list); return this; @@ -231,6 +285,7 @@ public final Builder contexts(List list) { * Adds one or more values to contexts. *

*/ + @Nonnull public final Builder contexts(SuggestContext value, SuggestContext... values) { this.contexts = _listAdd(this.contexts, value, values); return this; @@ -243,6 +298,7 @@ public final Builder contexts(SuggestContext value, SuggestContext... values) { * Adds a value to contexts using a builder lambda. *

*/ + @Nonnull public final Builder contexts(Function> fn) { return contexts(fn.apply(new SuggestContext.Builder()).build()); } @@ -250,6 +306,7 @@ public final Builder contexts(Function { @Nullable private final JsonData value; @@ -96,31 +102,64 @@ protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { // --------------------------------------------------------------------------------------------- + @Override + @Nonnull + public Builder toBuilder() { + return new Builder(this); + } + + @Nonnull + public static Builder builder() { + return new Builder(); + } + /** * Builder for {@link ConstantKeywordProperty}. */ - public static class Builder extends PropertyBase.AbstractBuilder implements ObjectBuilder { + public static class Builder extends PropertyBase.AbstractBuilder implements CopyableBuilder { @Nullable private JsonData value; + public Builder() {} + + private Builder(ConstantKeywordProperty o) { + super(o); + this.value = o.value; + } + + private Builder(Builder o) { + super(o); + this.value = o.value; + } + + @Override + @Nonnull + public Builder copy() { + return new Builder(this); + } + + @Override + @Nonnull + protected Builder self() { + return this; + } + /** * API name: {@code value} */ + @Nonnull public final Builder value(@Nullable JsonData value) { this.value = value; return this; } - @Override - protected Builder self() { - return this; - } - /** * Builds a {@link ConstantKeywordProperty}. * * @throws NullPointerException if some of the required fields are null. */ + @Override + @Nonnull public ConstantKeywordProperty build() { _checkSingleUse(); diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/mapping/CorePropertyBase.java b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/mapping/CorePropertyBase.java index 062d2fb80a..7001cc8769 100644 --- a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/mapping/CorePropertyBase.java +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/mapping/CorePropertyBase.java @@ -127,6 +127,22 @@ protected abstract static class AbstractBuilder o) { + super(o); + this.copyTo = _listCopy(o.copyTo); + this.similarity = o.similarity; + this.store = o.store; + } + /** * API name: {@code copy_to} * @@ -134,6 +150,7 @@ protected abstract static class AbstractBuilderlist to copyTo. *

*/ + @Nonnull public final BuilderT copyTo(List list) { this.copyTo = _listAddAll(this.copyTo, list); return self(); @@ -146,6 +163,7 @@ public final BuilderT copyTo(List list) { * Adds one or more values to copyTo. *

*/ + @Nonnull public final BuilderT copyTo(String value, String... values) { this.copyTo = _listAdd(this.copyTo, value, values); return self(); @@ -154,6 +172,7 @@ public final BuilderT copyTo(String value, String... values) { /** * API name: {@code similarity} */ + @Nonnull public final BuilderT similarity(@Nullable String value) { this.similarity = value; return self(); @@ -162,6 +181,7 @@ public final BuilderT similarity(@Nullable String value) { /** * API name: {@code store} */ + @Nonnull public final BuilderT store(@Nullable Boolean value) { this.store = value; return self(); diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/mapping/DataStreamTimestamp.java b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/mapping/DataStreamTimestamp.java index 8779086d48..70be640168 100644 --- a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/mapping/DataStreamTimestamp.java +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/mapping/DataStreamTimestamp.java @@ -39,6 +39,7 @@ 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; @@ -46,14 +47,16 @@ 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: _types.mapping.DataStreamTimestamp @JsonpDeserializable @Generated("org.opensearch.client.codegen.CodeGenerator") -public class DataStreamTimestamp implements PlainJsonSerializable { +public class DataStreamTimestamp implements PlainJsonSerializable, ToCopyableBuilder { private final boolean enabled; @@ -91,15 +94,43 @@ protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { // --------------------------------------------------------------------------------------------- + @Override + @Nonnull + public Builder toBuilder() { + return new Builder(this); + } + + @Nonnull + public static Builder builder() { + return new Builder(); + } + /** * Builder for {@link DataStreamTimestamp}. */ - public static class Builder extends ObjectBuilderBase implements ObjectBuilder { + public static class Builder extends ObjectBuilderBase implements CopyableBuilder { private Boolean enabled; + public Builder() {} + + private Builder(DataStreamTimestamp 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; @@ -110,6 +141,8 @@ public final Builder enabled(boolean value) { * * @throws NullPointerException if some of the required fields are null. */ + @Override + @Nonnull public DataStreamTimestamp build() { _checkSingleUse(); diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/mapping/DateNanosProperty.java b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/mapping/DateNanosProperty.java index 7002552576..7f4150ff86 100644 --- a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/mapping/DateNanosProperty.java +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/mapping/DateNanosProperty.java @@ -40,19 +40,25 @@ 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.util.CopyableBuilder; import org.opensearch.client.util.ObjectBuilder; +import org.opensearch.client.util.ToCopyableBuilder; // typedef: _types.mapping.DateNanosProperty @JsonpDeserializable @Generated("org.opensearch.client.codegen.CodeGenerator") -public class DateNanosProperty extends DocValuesPropertyBase implements PropertyVariant { +public class DateNanosProperty extends DocValuesPropertyBase + implements + PropertyVariant, + ToCopyableBuilder { @Nullable private final Double boost; @@ -180,10 +186,23 @@ protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { // --------------------------------------------------------------------------------------------- + @Override + @Nonnull + public Builder toBuilder() { + return new Builder(this); + } + + @Nonnull + public static Builder builder() { + return new Builder(); + } + /** * Builder for {@link DateNanosProperty}. */ - public static class Builder extends DocValuesPropertyBase.AbstractBuilder implements ObjectBuilder { + public static class Builder extends DocValuesPropertyBase.AbstractBuilder + implements + CopyableBuilder { @Nullable private Double boost; @Nullable @@ -197,9 +216,44 @@ public static class Builder extends DocValuesPropertyBase.AbstractBuilder { @Nullable private final Double boost; @@ -215,10 +218,21 @@ protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { // --------------------------------------------------------------------------------------------- + @Override + @Nonnull + public Builder toBuilder() { + return new Builder(this); + } + + @Nonnull + public static Builder builder() { + return new Builder(); + } + /** * Builder for {@link DateProperty}. */ - public static class Builder extends DocValuesPropertyBase.AbstractBuilder implements ObjectBuilder { + public static class Builder extends DocValuesPropertyBase.AbstractBuilder implements CopyableBuilder { @Nullable private Double boost; @Nullable @@ -236,9 +250,48 @@ public static class Builder extends DocValuesPropertyBase.AbstractBuilder> fn) { return fielddata(fn.apply(new NumericFielddata.Builder()).build()); } @@ -262,6 +317,7 @@ public final Builder fielddata(Function { @Nullable private final String format; @@ -95,31 +101,64 @@ protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { // --------------------------------------------------------------------------------------------- + @Override + @Nonnull + public Builder toBuilder() { + return new Builder(this); + } + + @Nonnull + public static Builder builder() { + return new Builder(); + } + /** * Builder for {@link DateRangeProperty}. */ - public static class Builder extends RangePropertyBase.AbstractBuilder implements ObjectBuilder { + public static class Builder extends RangePropertyBase.AbstractBuilder implements CopyableBuilder { @Nullable private String format; + public Builder() {} + + private Builder(DateRangeProperty o) { + super(o); + this.format = o.format; + } + + private Builder(Builder o) { + super(o); + this.format = o.format; + } + + @Override + @Nonnull + public Builder copy() { + return new Builder(this); + } + + @Override + @Nonnull + protected Builder self() { + return this; + } + /** * API name: {@code format} */ + @Nonnull public final Builder format(@Nullable String value) { this.format = value; return this; } - @Override - protected Builder self() { - return this; - } - /** * Builds a {@link DateRangeProperty}. * * @throws NullPointerException if some of the required fields are null. */ + @Override + @Nonnull public DateRangeProperty build() { _checkSingleUse(); diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/mapping/DocValuesPropertyBase.java b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/mapping/DocValuesPropertyBase.java index a5b51d9677..54d5268c67 100644 --- a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/mapping/DocValuesPropertyBase.java +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/mapping/DocValuesPropertyBase.java @@ -39,6 +39,7 @@ import jakarta.json.stream.JsonGenerator; import java.util.Objects; import javax.annotation.Generated; +import javax.annotation.Nonnull; import javax.annotation.Nullable; import org.opensearch.client.json.JsonpDeserializer; import org.opensearch.client.json.JsonpMapper; @@ -82,9 +83,22 @@ protected abstract static class AbstractBuilder o) { + super(o); + this.docValues = o.docValues; + } + /** * API name: {@code doc_values} */ + @Nonnull public final BuilderT docValues(@Nullable Boolean value) { this.docValues = value; return self(); diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/mapping/DoubleNumberProperty.java b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/mapping/DoubleNumberProperty.java index 31e69e72c1..e57722ee90 100644 --- a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/mapping/DoubleNumberProperty.java +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/mapping/DoubleNumberProperty.java @@ -40,19 +40,25 @@ 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.util.CopyableBuilder; import org.opensearch.client.util.ObjectBuilder; +import org.opensearch.client.util.ToCopyableBuilder; // typedef: _types.mapping.DoubleNumberProperty @JsonpDeserializable @Generated("org.opensearch.client.codegen.CodeGenerator") -public class DoubleNumberProperty extends NumberPropertyBase implements PropertyVariant { +public class DoubleNumberProperty extends NumberPropertyBase + implements + PropertyVariant, + ToCopyableBuilder { @Nullable private final Double nullValue; @@ -95,31 +101,66 @@ protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { // --------------------------------------------------------------------------------------------- + @Override + @Nonnull + public Builder toBuilder() { + return new Builder(this); + } + + @Nonnull + public static Builder builder() { + return new Builder(); + } + /** * Builder for {@link DoubleNumberProperty}. */ - public static class Builder extends NumberPropertyBase.AbstractBuilder implements ObjectBuilder { + public static class Builder extends NumberPropertyBase.AbstractBuilder + implements + CopyableBuilder { @Nullable private Double nullValue; + public Builder() {} + + private Builder(DoubleNumberProperty o) { + super(o); + this.nullValue = o.nullValue; + } + + private Builder(Builder o) { + super(o); + this.nullValue = o.nullValue; + } + + @Override + @Nonnull + public Builder copy() { + return new Builder(this); + } + + @Override + @Nonnull + protected Builder self() { + return this; + } + /** * API name: {@code null_value} */ + @Nonnull public final Builder nullValue(@Nullable Double value) { this.nullValue = value; return this; } - @Override - protected Builder self() { - return this; - } - /** * Builds a {@link DoubleNumberProperty}. * * @throws NullPointerException if some of the required fields are null. */ + @Override + @Nonnull public DoubleNumberProperty build() { _checkSingleUse(); diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/mapping/DoubleRangeProperty.java b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/mapping/DoubleRangeProperty.java index 9658a0a127..acac7ed55e 100644 --- a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/mapping/DoubleRangeProperty.java +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/mapping/DoubleRangeProperty.java @@ -39,18 +39,24 @@ 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.util.CopyableBuilder; import org.opensearch.client.util.ObjectBuilder; +import org.opensearch.client.util.ToCopyableBuilder; // typedef: _types.mapping.DoubleRangeProperty @JsonpDeserializable @Generated("org.opensearch.client.codegen.CodeGenerator") -public class DoubleRangeProperty extends RangePropertyBase implements PropertyVariant { +public class DoubleRangeProperty extends RangePropertyBase + implements + PropertyVariant, + ToCopyableBuilder { // --------------------------------------------------------------------------------------------- @@ -77,12 +83,42 @@ protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { // --------------------------------------------------------------------------------------------- + @Override + @Nonnull + public Builder toBuilder() { + return new Builder(this); + } + + @Nonnull + public static Builder builder() { + return new Builder(); + } + /** * Builder for {@link DoubleRangeProperty}. */ - public static class Builder extends RangePropertyBase.AbstractBuilder implements ObjectBuilder { + public static class Builder extends RangePropertyBase.AbstractBuilder + implements + CopyableBuilder { + + public Builder() {} + + private Builder(DoubleRangeProperty o) { + super(o); + } + + private Builder(Builder o) { + super(o); + } @Override + @Nonnull + public Builder copy() { + return new Builder(this); + } + + @Override + @Nonnull protected Builder self() { return this; } @@ -92,6 +128,8 @@ protected Builder self() { * * @throws NullPointerException if some of the required fields are null. */ + @Override + @Nonnull public DoubleRangeProperty build() { _checkSingleUse(); diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/mapping/DynamicTemplate.java b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/mapping/DynamicTemplate.java index 1f9af30080..9c1441b76f 100644 --- a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/mapping/DynamicTemplate.java +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/mapping/DynamicTemplate.java @@ -40,6 +40,7 @@ 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; @@ -47,14 +48,16 @@ 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: _types.mapping.DynamicTemplate @JsonpDeserializable @Generated("org.opensearch.client.codegen.CodeGenerator") -public class DynamicTemplate implements PlainJsonSerializable { +public class DynamicTemplate implements PlainJsonSerializable, ToCopyableBuilder { @Nullable private final Property mapping; @@ -198,10 +201,21 @@ protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { // --------------------------------------------------------------------------------------------- + @Override + @Nonnull + public Builder toBuilder() { + return new Builder(this); + } + + @Nonnull + public static Builder builder() { + return new Builder(); + } + /** * Builder for {@link DynamicTemplate}. */ - public static class Builder extends ObjectBuilderBase implements ObjectBuilder { + public static class Builder extends ObjectBuilderBase implements CopyableBuilder { @Nullable private Property mapping; @Nullable @@ -217,9 +231,38 @@ public static class Builder extends ObjectBuilderBase implements ObjectBuilder> fn) { return mapping(fn.apply(new Property.Builder()).build()); } @@ -235,6 +279,7 @@ public final Builder mapping(Function> /** * API name: {@code match} */ + @Nonnull public final Builder match(@Nullable String value) { this.match = value; return this; @@ -243,6 +288,7 @@ public final Builder match(@Nullable String value) { /** * API name: {@code match_mapping_type} */ + @Nonnull public final Builder matchMappingType(@Nullable String value) { this.matchMappingType = value; return this; @@ -251,6 +297,7 @@ public final Builder matchMappingType(@Nullable String value) { /** * API name: {@code match_pattern} */ + @Nonnull public final Builder matchPattern(@Nullable MatchType value) { this.matchPattern = value; return this; @@ -259,6 +306,7 @@ public final Builder matchPattern(@Nullable MatchType value) { /** * API name: {@code path_match} */ + @Nonnull public final Builder pathMatch(@Nullable String value) { this.pathMatch = value; return this; @@ -267,6 +315,7 @@ public final Builder pathMatch(@Nullable String value) { /** * API name: {@code path_unmatch} */ + @Nonnull public final Builder pathUnmatch(@Nullable String value) { this.pathUnmatch = value; return this; @@ -275,6 +324,7 @@ public final Builder pathUnmatch(@Nullable String value) { /** * API name: {@code unmatch} */ + @Nonnull public final Builder unmatch(@Nullable String value) { this.unmatch = value; return this; @@ -285,6 +335,8 @@ public final Builder unmatch(@Nullable String value) { * * @throws NullPointerException if some of the required fields are null. */ + @Override + @Nonnull public DynamicTemplate build() { _checkSingleUse(); diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/mapping/FieldAliasProperty.java b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/mapping/FieldAliasProperty.java index f6bfbf014e..b4cf9f66b8 100644 --- a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/mapping/FieldAliasProperty.java +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/mapping/FieldAliasProperty.java @@ -40,19 +40,25 @@ 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.util.CopyableBuilder; import org.opensearch.client.util.ObjectBuilder; +import org.opensearch.client.util.ToCopyableBuilder; // typedef: _types.mapping.FieldAliasProperty @JsonpDeserializable @Generated("org.opensearch.client.codegen.CodeGenerator") -public class FieldAliasProperty extends PropertyBase implements PropertyVariant { +public class FieldAliasProperty extends PropertyBase + implements + PropertyVariant, + ToCopyableBuilder { @Nullable private final String path; @@ -95,31 +101,64 @@ protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { // --------------------------------------------------------------------------------------------- + @Override + @Nonnull + public Builder toBuilder() { + return new Builder(this); + } + + @Nonnull + public static Builder builder() { + return new Builder(); + } + /** * Builder for {@link FieldAliasProperty}. */ - public static class Builder extends PropertyBase.AbstractBuilder implements ObjectBuilder { + public static class Builder extends PropertyBase.AbstractBuilder implements CopyableBuilder { @Nullable private String path; + public Builder() {} + + private Builder(FieldAliasProperty o) { + super(o); + this.path = o.path; + } + + private Builder(Builder o) { + super(o); + this.path = o.path; + } + + @Override + @Nonnull + public Builder copy() { + return new Builder(this); + } + + @Override + @Nonnull + protected Builder self() { + return this; + } + /** * API name: {@code path} */ + @Nonnull public final Builder path(@Nullable String value) { this.path = value; return this; } - @Override - protected Builder self() { - return this; - } - /** * Builds a {@link FieldAliasProperty}. * * @throws NullPointerException if some of the required fields are null. */ + @Override + @Nonnull public FieldAliasProperty build() { _checkSingleUse(); diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/mapping/FieldNamesField.java b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/mapping/FieldNamesField.java index b7ca899b60..27b8127d3d 100644 --- a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/mapping/FieldNamesField.java +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/mapping/FieldNamesField.java @@ -39,6 +39,7 @@ 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; @@ -46,14 +47,16 @@ 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: _types.mapping.FieldNamesField @JsonpDeserializable @Generated("org.opensearch.client.codegen.CodeGenerator") -public class FieldNamesField implements PlainJsonSerializable { +public class FieldNamesField implements PlainJsonSerializable, ToCopyableBuilder { private final boolean enabled; @@ -91,15 +94,43 @@ protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { // --------------------------------------------------------------------------------------------- + @Override + @Nonnull + public Builder toBuilder() { + return new Builder(this); + } + + @Nonnull + public static Builder builder() { + return new Builder(); + } + /** * Builder for {@link FieldNamesField}. */ - public static class Builder extends ObjectBuilderBase implements ObjectBuilder { + public static class Builder extends ObjectBuilderBase implements CopyableBuilder { private Boolean enabled; + public Builder() {} + + private Builder(FieldNamesField 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; @@ -110,6 +141,8 @@ public final Builder enabled(boolean value) { * * @throws NullPointerException if some of the required fields are null. */ + @Override + @Nonnull public FieldNamesField build() { _checkSingleUse(); diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/mapping/FlatObjectProperty.java b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/mapping/FlatObjectProperty.java index 942d12a35d..1297a4adba 100644 --- a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/mapping/FlatObjectProperty.java +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/mapping/FlatObjectProperty.java @@ -40,19 +40,25 @@ 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.util.CopyableBuilder; import org.opensearch.client.util.ObjectBuilder; +import org.opensearch.client.util.ToCopyableBuilder; // typedef: _types.mapping.FlatObjectProperty @JsonpDeserializable @Generated("org.opensearch.client.codegen.CodeGenerator") -public class FlatObjectProperty extends PropertyBase implements PropertyVariant { +public class FlatObjectProperty extends PropertyBase + implements + PropertyVariant, + ToCopyableBuilder { @Nullable private final Boolean aggregatable; @@ -112,18 +118,56 @@ protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { // --------------------------------------------------------------------------------------------- + @Override + @Nonnull + public Builder toBuilder() { + return new Builder(this); + } + + @Nonnull + public static Builder builder() { + return new Builder(); + } + /** * Builder for {@link FlatObjectProperty}. */ - public static class Builder extends PropertyBase.AbstractBuilder implements ObjectBuilder { + public static class Builder extends PropertyBase.AbstractBuilder implements CopyableBuilder { @Nullable private Boolean aggregatable; @Nullable private Boolean searchable; + public Builder() {} + + private Builder(FlatObjectProperty o) { + super(o); + this.aggregatable = o.aggregatable; + this.searchable = o.searchable; + } + + private Builder(Builder o) { + super(o); + this.aggregatable = o.aggregatable; + this.searchable = o.searchable; + } + + @Override + @Nonnull + public Builder copy() { + return new Builder(this); + } + + @Override + @Nonnull + protected Builder self() { + return this; + } + /** * API name: {@code aggregatable} */ + @Nonnull public final Builder aggregatable(@Nullable Boolean value) { this.aggregatable = value; return this; @@ -132,21 +176,19 @@ public final Builder aggregatable(@Nullable Boolean value) { /** * API name: {@code searchable} */ + @Nonnull public final Builder searchable(@Nullable Boolean value) { this.searchable = value; return this; } - @Override - protected Builder self() { - return this; - } - /** * Builds a {@link FlatObjectProperty}. * * @throws NullPointerException if some of the required fields are null. */ + @Override + @Nonnull public FlatObjectProperty build() { _checkSingleUse(); diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/mapping/FloatNumberProperty.java b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/mapping/FloatNumberProperty.java index 47cfb180aa..7f632c9d10 100644 --- a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/mapping/FloatNumberProperty.java +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/mapping/FloatNumberProperty.java @@ -40,19 +40,25 @@ 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.util.CopyableBuilder; import org.opensearch.client.util.ObjectBuilder; +import org.opensearch.client.util.ToCopyableBuilder; // typedef: _types.mapping.FloatNumberProperty @JsonpDeserializable @Generated("org.opensearch.client.codegen.CodeGenerator") -public class FloatNumberProperty extends NumberPropertyBase implements PropertyVariant { +public class FloatNumberProperty extends NumberPropertyBase + implements + PropertyVariant, + ToCopyableBuilder { @Nullable private final Float nullValue; @@ -95,31 +101,66 @@ protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { // --------------------------------------------------------------------------------------------- + @Override + @Nonnull + public Builder toBuilder() { + return new Builder(this); + } + + @Nonnull + public static Builder builder() { + return new Builder(); + } + /** * Builder for {@link FloatNumberProperty}. */ - public static class Builder extends NumberPropertyBase.AbstractBuilder implements ObjectBuilder { + public static class Builder extends NumberPropertyBase.AbstractBuilder + implements + CopyableBuilder { @Nullable private Float nullValue; + public Builder() {} + + private Builder(FloatNumberProperty o) { + super(o); + this.nullValue = o.nullValue; + } + + private Builder(Builder o) { + super(o); + this.nullValue = o.nullValue; + } + + @Override + @Nonnull + public Builder copy() { + return new Builder(this); + } + + @Override + @Nonnull + protected Builder self() { + return this; + } + /** * API name: {@code null_value} */ + @Nonnull public final Builder nullValue(@Nullable Float value) { this.nullValue = value; return this; } - @Override - protected Builder self() { - return this; - } - /** * Builds a {@link FloatNumberProperty}. * * @throws NullPointerException if some of the required fields are null. */ + @Override + @Nonnull public FloatNumberProperty build() { _checkSingleUse(); diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/mapping/FloatRangeProperty.java b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/mapping/FloatRangeProperty.java index f94992ddb6..83aa363b72 100644 --- a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/mapping/FloatRangeProperty.java +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/mapping/FloatRangeProperty.java @@ -39,18 +39,24 @@ 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.util.CopyableBuilder; import org.opensearch.client.util.ObjectBuilder; +import org.opensearch.client.util.ToCopyableBuilder; // typedef: _types.mapping.FloatRangeProperty @JsonpDeserializable @Generated("org.opensearch.client.codegen.CodeGenerator") -public class FloatRangeProperty extends RangePropertyBase implements PropertyVariant { +public class FloatRangeProperty extends RangePropertyBase + implements + PropertyVariant, + ToCopyableBuilder { // --------------------------------------------------------------------------------------------- @@ -77,12 +83,40 @@ protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { // --------------------------------------------------------------------------------------------- + @Override + @Nonnull + public Builder toBuilder() { + return new Builder(this); + } + + @Nonnull + public static Builder builder() { + return new Builder(); + } + /** * Builder for {@link FloatRangeProperty}. */ - public static class Builder extends RangePropertyBase.AbstractBuilder implements ObjectBuilder { + public static class Builder extends RangePropertyBase.AbstractBuilder implements CopyableBuilder { + + public Builder() {} + + private Builder(FloatRangeProperty o) { + super(o); + } + + private Builder(Builder o) { + super(o); + } @Override + @Nonnull + public Builder copy() { + return new Builder(this); + } + + @Override + @Nonnull protected Builder self() { return this; } @@ -92,6 +126,8 @@ protected Builder self() { * * @throws NullPointerException if some of the required fields are null. */ + @Override + @Nonnull public FloatRangeProperty build() { _checkSingleUse(); diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/mapping/GeoPointProperty.java b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/mapping/GeoPointProperty.java index 120f4e043d..cb9dc0121f 100644 --- a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/mapping/GeoPointProperty.java +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/mapping/GeoPointProperty.java @@ -40,6 +40,7 @@ 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; @@ -47,13 +48,18 @@ import org.opensearch.client.json.ObjectBuilderDeserializer; import org.opensearch.client.json.ObjectDeserializer; import org.opensearch.client.opensearch._types.GeoLocation; +import org.opensearch.client.util.CopyableBuilder; import org.opensearch.client.util.ObjectBuilder; +import org.opensearch.client.util.ToCopyableBuilder; // typedef: _types.mapping.GeoPointProperty @JsonpDeserializable @Generated("org.opensearch.client.codegen.CodeGenerator") -public class GeoPointProperty extends DocValuesPropertyBase implements PropertyVariant { +public class GeoPointProperty extends DocValuesPropertyBase + implements + PropertyVariant, + ToCopyableBuilder { @Nullable private final Boolean ignoreMalformed; @@ -130,10 +136,23 @@ protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { // --------------------------------------------------------------------------------------------- + @Override + @Nonnull + public Builder toBuilder() { + return new Builder(this); + } + + @Nonnull + public static Builder builder() { + return new Builder(); + } + /** * Builder for {@link GeoPointProperty}. */ - public static class Builder extends DocValuesPropertyBase.AbstractBuilder implements ObjectBuilder { + public static class Builder extends DocValuesPropertyBase.AbstractBuilder + implements + CopyableBuilder { @Nullable private Boolean ignoreMalformed; @Nullable @@ -141,9 +160,38 @@ public static class Builder extends DocValuesPropertyBase.AbstractBuilder> fn) { return nullValue(fn.apply(new GeoLocation.Builder()).build()); } - @Override - protected Builder self() { - return this; - } - /** * Builds a {@link GeoPointProperty}. * * @throws NullPointerException if some of the required fields are null. */ + @Override + @Nonnull public GeoPointProperty build() { _checkSingleUse(); diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/mapping/GeoShapeProperty.java b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/mapping/GeoShapeProperty.java index 880d87545d..fc13ac47c7 100644 --- a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/mapping/GeoShapeProperty.java +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/mapping/GeoShapeProperty.java @@ -40,19 +40,25 @@ 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.util.CopyableBuilder; import org.opensearch.client.util.ObjectBuilder; +import org.opensearch.client.util.ToCopyableBuilder; // typedef: _types.mapping.GeoShapeProperty @JsonpDeserializable @Generated("org.opensearch.client.codegen.CodeGenerator") -public class GeoShapeProperty extends DocValuesPropertyBase implements PropertyVariant { +public class GeoShapeProperty extends DocValuesPropertyBase + implements + PropertyVariant, + ToCopyableBuilder { @Nullable private final Boolean coerce; @@ -180,10 +186,23 @@ protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { // --------------------------------------------------------------------------------------------- + @Override + @Nonnull + public Builder toBuilder() { + return new Builder(this); + } + + @Nonnull + public static Builder builder() { + return new Builder(); + } + /** * Builder for {@link GeoShapeProperty}. */ - public static class Builder extends DocValuesPropertyBase.AbstractBuilder implements ObjectBuilder { + public static class Builder extends DocValuesPropertyBase.AbstractBuilder + implements + CopyableBuilder { @Nullable private Boolean coerce; @Nullable @@ -197,9 +216,44 @@ public static class Builder extends DocValuesPropertyBase.AbstractBuilder { @Nullable private final Float nullValue; @@ -95,31 +101,66 @@ protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { // --------------------------------------------------------------------------------------------- + @Override + @Nonnull + public Builder toBuilder() { + return new Builder(this); + } + + @Nonnull + public static Builder builder() { + return new Builder(); + } + /** * Builder for {@link HalfFloatNumberProperty}. */ - public static class Builder extends NumberPropertyBase.AbstractBuilder implements ObjectBuilder { + public static class Builder extends NumberPropertyBase.AbstractBuilder + implements + CopyableBuilder { @Nullable private Float nullValue; + public Builder() {} + + private Builder(HalfFloatNumberProperty o) { + super(o); + this.nullValue = o.nullValue; + } + + private Builder(Builder o) { + super(o); + this.nullValue = o.nullValue; + } + + @Override + @Nonnull + public Builder copy() { + return new Builder(this); + } + + @Override + @Nonnull + protected Builder self() { + return this; + } + /** * API name: {@code null_value} */ + @Nonnull public final Builder nullValue(@Nullable Float value) { this.nullValue = value; return this; } - @Override - protected Builder self() { - return this; - } - /** * Builds a {@link HalfFloatNumberProperty}. * * @throws NullPointerException if some of the required fields are null. */ + @Override + @Nonnull public HalfFloatNumberProperty build() { _checkSingleUse(); diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/mapping/HistogramProperty.java b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/mapping/HistogramProperty.java index ba46ff5f93..efa53a8307 100644 --- a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/mapping/HistogramProperty.java +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/mapping/HistogramProperty.java @@ -40,19 +40,25 @@ 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.util.CopyableBuilder; import org.opensearch.client.util.ObjectBuilder; +import org.opensearch.client.util.ToCopyableBuilder; // typedef: _types.mapping.HistogramProperty @JsonpDeserializable @Generated("org.opensearch.client.codegen.CodeGenerator") -public class HistogramProperty extends PropertyBase implements PropertyVariant { +public class HistogramProperty extends PropertyBase + implements + PropertyVariant, + ToCopyableBuilder { @Nullable private final Boolean ignoreMalformed; @@ -95,31 +101,64 @@ protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { // --------------------------------------------------------------------------------------------- + @Override + @Nonnull + public Builder toBuilder() { + return new Builder(this); + } + + @Nonnull + public static Builder builder() { + return new Builder(); + } + /** * Builder for {@link HistogramProperty}. */ - public static class Builder extends PropertyBase.AbstractBuilder implements ObjectBuilder { + public static class Builder extends PropertyBase.AbstractBuilder implements CopyableBuilder { @Nullable private Boolean ignoreMalformed; + public Builder() {} + + private Builder(HistogramProperty o) { + super(o); + this.ignoreMalformed = o.ignoreMalformed; + } + + private Builder(Builder o) { + super(o); + this.ignoreMalformed = o.ignoreMalformed; + } + + @Override + @Nonnull + public Builder copy() { + return new Builder(this); + } + + @Override + @Nonnull + protected Builder self() { + return this; + } + /** * API name: {@code ignore_malformed} */ + @Nonnull public final Builder ignoreMalformed(@Nullable Boolean value) { this.ignoreMalformed = value; return this; } - @Override - protected Builder self() { - return this; - } - /** * Builds a {@link HistogramProperty}. * * @throws NullPointerException if some of the required fields are null. */ + @Override + @Nonnull public HistogramProperty build() { _checkSingleUse(); diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/mapping/IcuCollationKeywordProperty.java b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/mapping/IcuCollationKeywordProperty.java index 7a6715cc8b..185635b430 100644 --- a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/mapping/IcuCollationKeywordProperty.java +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/mapping/IcuCollationKeywordProperty.java @@ -40,6 +40,7 @@ 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; @@ -50,13 +51,18 @@ import org.opensearch.client.opensearch._types.analysis.IcuCollationCaseFirst; import org.opensearch.client.opensearch._types.analysis.IcuCollationDecomposition; import org.opensearch.client.opensearch._types.analysis.IcuCollationStrength; +import org.opensearch.client.util.CopyableBuilder; import org.opensearch.client.util.ObjectBuilder; +import org.opensearch.client.util.ToCopyableBuilder; // typedef: _types.mapping.IcuCollationKeywordProperty @JsonpDeserializable @Generated("org.opensearch.client.codegen.CodeGenerator") -public class IcuCollationKeywordProperty extends DocValuesPropertyBase implements PropertyVariant { +public class IcuCollationKeywordProperty extends DocValuesPropertyBase + implements + PropertyVariant, + ToCopyableBuilder { @Nullable private final IcuCollationAlternate alternate; @@ -305,12 +311,23 @@ protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { // --------------------------------------------------------------------------------------------- + @Override + @Nonnull + public Builder toBuilder() { + return new Builder(this); + } + + @Nonnull + public static Builder builder() { + return new Builder(); + } + /** * Builder for {@link IcuCollationKeywordProperty}. */ public static class Builder extends DocValuesPropertyBase.AbstractBuilder implements - ObjectBuilder { + CopyableBuilder { @Nullable private IcuCollationAlternate alternate; @Nullable @@ -338,9 +355,58 @@ public static class Builder extends DocValuesPropertyBase.AbstractBuilder { private final boolean enabled; @@ -91,15 +94,43 @@ protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { // --------------------------------------------------------------------------------------------- + @Override + @Nonnull + public Builder toBuilder() { + return new Builder(this); + } + + @Nonnull + public static Builder builder() { + return new Builder(); + } + /** * Builder for {@link IndexField}. */ - public static class Builder extends ObjectBuilderBase implements ObjectBuilder { + public static class Builder extends ObjectBuilderBase implements CopyableBuilder { private Boolean enabled; + public Builder() {} + + private Builder(IndexField 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; @@ -110,6 +141,8 @@ public final Builder enabled(boolean value) { * * @throws NullPointerException if some of the required fields are null. */ + @Override + @Nonnull public IndexField build() { _checkSingleUse(); diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/mapping/IntegerNumberProperty.java b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/mapping/IntegerNumberProperty.java index cbecb71abc..d1d9d587c0 100644 --- a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/mapping/IntegerNumberProperty.java +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/mapping/IntegerNumberProperty.java @@ -40,19 +40,25 @@ 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.util.CopyableBuilder; import org.opensearch.client.util.ObjectBuilder; +import org.opensearch.client.util.ToCopyableBuilder; // typedef: _types.mapping.IntegerNumberProperty @JsonpDeserializable @Generated("org.opensearch.client.codegen.CodeGenerator") -public class IntegerNumberProperty extends NumberPropertyBase implements PropertyVariant { +public class IntegerNumberProperty extends NumberPropertyBase + implements + PropertyVariant, + ToCopyableBuilder { @Nullable private final Integer nullValue; @@ -95,31 +101,66 @@ protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { // --------------------------------------------------------------------------------------------- + @Override + @Nonnull + public Builder toBuilder() { + return new Builder(this); + } + + @Nonnull + public static Builder builder() { + return new Builder(); + } + /** * Builder for {@link IntegerNumberProperty}. */ - public static class Builder extends NumberPropertyBase.AbstractBuilder implements ObjectBuilder { + public static class Builder extends NumberPropertyBase.AbstractBuilder + implements + CopyableBuilder { @Nullable private Integer nullValue; + public Builder() {} + + private Builder(IntegerNumberProperty o) { + super(o); + this.nullValue = o.nullValue; + } + + private Builder(Builder o) { + super(o); + this.nullValue = o.nullValue; + } + + @Override + @Nonnull + public Builder copy() { + return new Builder(this); + } + + @Override + @Nonnull + protected Builder self() { + return this; + } + /** * API name: {@code null_value} */ + @Nonnull public final Builder nullValue(@Nullable Integer value) { this.nullValue = value; return this; } - @Override - protected Builder self() { - return this; - } - /** * Builds a {@link IntegerNumberProperty}. * * @throws NullPointerException if some of the required fields are null. */ + @Override + @Nonnull public IntegerNumberProperty build() { _checkSingleUse(); diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/mapping/IntegerRangeProperty.java b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/mapping/IntegerRangeProperty.java index 20099ef5fb..3af5b17e60 100644 --- a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/mapping/IntegerRangeProperty.java +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/mapping/IntegerRangeProperty.java @@ -39,18 +39,24 @@ 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.util.CopyableBuilder; import org.opensearch.client.util.ObjectBuilder; +import org.opensearch.client.util.ToCopyableBuilder; // typedef: _types.mapping.IntegerRangeProperty @JsonpDeserializable @Generated("org.opensearch.client.codegen.CodeGenerator") -public class IntegerRangeProperty extends RangePropertyBase implements PropertyVariant { +public class IntegerRangeProperty extends RangePropertyBase + implements + PropertyVariant, + ToCopyableBuilder { // --------------------------------------------------------------------------------------------- @@ -77,12 +83,42 @@ protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { // --------------------------------------------------------------------------------------------- + @Override + @Nonnull + public Builder toBuilder() { + return new Builder(this); + } + + @Nonnull + public static Builder builder() { + return new Builder(); + } + /** * Builder for {@link IntegerRangeProperty}. */ - public static class Builder extends RangePropertyBase.AbstractBuilder implements ObjectBuilder { + public static class Builder extends RangePropertyBase.AbstractBuilder + implements + CopyableBuilder { + + public Builder() {} + + private Builder(IntegerRangeProperty o) { + super(o); + } + + private Builder(Builder o) { + super(o); + } @Override + @Nonnull + public Builder copy() { + return new Builder(this); + } + + @Override + @Nonnull protected Builder self() { return this; } @@ -92,6 +128,8 @@ protected Builder self() { * * @throws NullPointerException if some of the required fields are null. */ + @Override + @Nonnull public IntegerRangeProperty build() { _checkSingleUse(); diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/mapping/IpProperty.java b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/mapping/IpProperty.java index 02674513fc..3779d3ad22 100644 --- a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/mapping/IpProperty.java +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/mapping/IpProperty.java @@ -40,19 +40,22 @@ 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.util.CopyableBuilder; import org.opensearch.client.util.ObjectBuilder; +import org.opensearch.client.util.ToCopyableBuilder; // typedef: _types.mapping.IpProperty @JsonpDeserializable @Generated("org.opensearch.client.codegen.CodeGenerator") -public class IpProperty extends DocValuesPropertyBase implements PropertyVariant { +public class IpProperty extends DocValuesPropertyBase implements PropertyVariant, ToCopyableBuilder { @Nullable private final Double boost; @@ -146,10 +149,21 @@ protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { // --------------------------------------------------------------------------------------------- + @Override + @Nonnull + public Builder toBuilder() { + return new Builder(this); + } + + @Nonnull + public static Builder builder() { + return new Builder(); + } + /** * Builder for {@link IpProperty}. */ - public static class Builder extends DocValuesPropertyBase.AbstractBuilder implements ObjectBuilder { + public static class Builder extends DocValuesPropertyBase.AbstractBuilder implements CopyableBuilder { @Nullable private Double boost; @Nullable @@ -159,9 +173,40 @@ public static class Builder extends DocValuesPropertyBase.AbstractBuilder { // --------------------------------------------------------------------------------------------- @@ -77,12 +83,40 @@ protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { // --------------------------------------------------------------------------------------------- + @Override + @Nonnull + public Builder toBuilder() { + return new Builder(this); + } + + @Nonnull + public static Builder builder() { + return new Builder(); + } + /** * Builder for {@link IpRangeProperty}. */ - public static class Builder extends RangePropertyBase.AbstractBuilder implements ObjectBuilder { + public static class Builder extends RangePropertyBase.AbstractBuilder implements CopyableBuilder { + + public Builder() {} + + private Builder(IpRangeProperty o) { + super(o); + } + + private Builder(Builder o) { + super(o); + } @Override + @Nonnull + public Builder copy() { + return new Builder(this); + } + + @Override + @Nonnull protected Builder self() { return this; } @@ -92,6 +126,8 @@ protected Builder self() { * * @throws NullPointerException if some of the required fields are null. */ + @Override + @Nonnull public IpRangeProperty build() { _checkSingleUse(); diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/mapping/JoinProperty.java b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/mapping/JoinProperty.java index 2edbe74f64..fc08d7a8ec 100644 --- a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/mapping/JoinProperty.java +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/mapping/JoinProperty.java @@ -50,13 +50,15 @@ import org.opensearch.client.json.ObjectBuilderDeserializer; import org.opensearch.client.json.ObjectDeserializer; import org.opensearch.client.util.ApiTypeHelper; +import org.opensearch.client.util.CopyableBuilder; import org.opensearch.client.util.ObjectBuilder; +import org.opensearch.client.util.ToCopyableBuilder; // typedef: _types.mapping.JoinProperty @JsonpDeserializable @Generated("org.opensearch.client.codegen.CodeGenerator") -public class JoinProperty extends PropertyBase implements PropertyVariant { +public class JoinProperty extends PropertyBase implements PropertyVariant, ToCopyableBuilder { @Nullable private final Boolean eagerGlobalOrdinals; @@ -127,18 +129,56 @@ protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { // --------------------------------------------------------------------------------------------- + @Override + @Nonnull + public Builder toBuilder() { + return new Builder(this); + } + + @Nonnull + public static Builder builder() { + return new Builder(); + } + /** * Builder for {@link JoinProperty}. */ - public static class Builder extends PropertyBase.AbstractBuilder implements ObjectBuilder { + public static class Builder extends PropertyBase.AbstractBuilder implements CopyableBuilder { @Nullable private Boolean eagerGlobalOrdinals; @Nullable private Map> relations; + public Builder() {} + + private Builder(JoinProperty o) { + super(o); + this.eagerGlobalOrdinals = o.eagerGlobalOrdinals; + this.relations = _mapCopy(o.relations); + } + + private Builder(Builder o) { + super(o); + this.eagerGlobalOrdinals = o.eagerGlobalOrdinals; + this.relations = _mapCopy(o.relations); + } + + @Override + @Nonnull + public Builder copy() { + return new Builder(this); + } + + @Override + @Nonnull + protected Builder self() { + return this; + } + /** * API name: {@code eager_global_ordinals} */ + @Nonnull public final Builder eagerGlobalOrdinals(@Nullable Boolean value) { this.eagerGlobalOrdinals = value; return this; @@ -151,6 +191,7 @@ public final Builder eagerGlobalOrdinals(@Nullable Boolean value) { * Adds all elements of map to relations. *

*/ + @Nonnull public final Builder relations(Map> map) { this.relations = _mapPutAll(this.relations, map); return this; @@ -163,21 +204,19 @@ public final Builder relations(Map> map) { * Adds an entry to relations. *

*/ + @Nonnull public final Builder relations(String key, List value) { this.relations = _mapPut(this.relations, key, value); return this; } - @Override - protected Builder self() { - return this; - } - /** * Builds a {@link JoinProperty}. * * @throws NullPointerException if some of the required fields are null. */ + @Override + @Nonnull public JoinProperty build() { _checkSingleUse(); diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/mapping/KeywordProperty.java b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/mapping/KeywordProperty.java index c84271809c..a83479012f 100644 --- a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/mapping/KeywordProperty.java +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/mapping/KeywordProperty.java @@ -40,19 +40,25 @@ 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.util.CopyableBuilder; import org.opensearch.client.util.ObjectBuilder; +import org.opensearch.client.util.ToCopyableBuilder; // typedef: _types.mapping.KeywordProperty @JsonpDeserializable @Generated("org.opensearch.client.codegen.CodeGenerator") -public class KeywordProperty extends DocValuesPropertyBase implements PropertyVariant { +public class KeywordProperty extends DocValuesPropertyBase + implements + PropertyVariant, + ToCopyableBuilder { @Nullable private final Double boost; @@ -214,10 +220,23 @@ protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { // --------------------------------------------------------------------------------------------- + @Override + @Nonnull + public Builder toBuilder() { + return new Builder(this); + } + + @Nonnull + public static Builder builder() { + return new Builder(); + } + /** * Builder for {@link KeywordProperty}. */ - public static class Builder extends DocValuesPropertyBase.AbstractBuilder implements ObjectBuilder { + public static class Builder extends DocValuesPropertyBase.AbstractBuilder + implements + CopyableBuilder { @Nullable private Double boost; @Nullable @@ -235,9 +254,48 @@ public static class Builder extends DocValuesPropertyBase.AbstractBuilder { @Nullable private final String engine; @@ -154,10 +156,21 @@ protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { // --------------------------------------------------------------------------------------------- + @Override + @Nonnull + public Builder toBuilder() { + return new Builder(this); + } + + @Nonnull + public static Builder builder() { + return new Builder(); + } + /** * Builder for {@link KnnVectorMethod}. */ - public static class Builder extends ObjectBuilderBase implements ObjectBuilder { + public static class Builder extends ObjectBuilderBase implements CopyableBuilder { @Nullable private String engine; private String name; @@ -166,9 +179,32 @@ public static class Builder extends ObjectBuilderBase implements ObjectBuildermap to parameters. *

*/ + @Nonnull public final Builder parameters(Map map) { this.parameters = _mapPutAll(this.parameters, map); return this; @@ -201,6 +239,7 @@ public final Builder parameters(Map map) { * Adds an entry to parameters. *

*/ + @Nonnull public final Builder parameters(String key, JsonData value) { this.parameters = _mapPut(this.parameters, key, value); return this; @@ -209,6 +248,7 @@ public final Builder parameters(String key, JsonData value) { /** * API name: {@code space_type} */ + @Nonnull public final Builder spaceType(@Nullable String value) { this.spaceType = value; return this; @@ -219,6 +259,8 @@ public final Builder spaceType(@Nullable String value) { * * @throws NullPointerException if some of the required fields are null. */ + @Override + @Nonnull public KnnVectorMethod build() { _checkSingleUse(); diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/mapping/KnnVectorProperty.java b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/mapping/KnnVectorProperty.java index 54ed487dde..cf1634b3cd 100644 --- a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/mapping/KnnVectorProperty.java +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/mapping/KnnVectorProperty.java @@ -40,6 +40,7 @@ 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; @@ -47,13 +48,18 @@ import org.opensearch.client.json.ObjectBuilderDeserializer; import org.opensearch.client.json.ObjectDeserializer; import org.opensearch.client.util.ApiTypeHelper; +import org.opensearch.client.util.CopyableBuilder; import org.opensearch.client.util.ObjectBuilder; +import org.opensearch.client.util.ToCopyableBuilder; // typedef: _types.mapping.KnnVectorProperty @JsonpDeserializable @Generated("org.opensearch.client.codegen.CodeGenerator") -public class KnnVectorProperty extends DocValuesPropertyBase implements PropertyVariant { +public class KnnVectorProperty extends DocValuesPropertyBase + implements + PropertyVariant, + ToCopyableBuilder { @Nullable private final String compressionLevel; @@ -194,10 +200,23 @@ protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { // --------------------------------------------------------------------------------------------- + @Override + @Nonnull + public Builder toBuilder() { + return new Builder(this); + } + + @Nonnull + public static Builder builder() { + return new Builder(); + } + /** * Builder for {@link KnnVectorProperty}. */ - public static class Builder extends DocValuesPropertyBase.AbstractBuilder implements ObjectBuilder { + public static class Builder extends DocValuesPropertyBase.AbstractBuilder + implements + CopyableBuilder { @Nullable private String compressionLevel; @Nullable @@ -212,9 +231,46 @@ public static class Builder extends DocValuesPropertyBase.AbstractBuilder> fn) { return method(fn.apply(new KnnVectorMethod.Builder()).build()); } @@ -254,6 +314,7 @@ public final Builder method(Function { @Nullable private final Long nullValue; @@ -95,31 +101,66 @@ protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { // --------------------------------------------------------------------------------------------- + @Override + @Nonnull + public Builder toBuilder() { + return new Builder(this); + } + + @Nonnull + public static Builder builder() { + return new Builder(); + } + /** * Builder for {@link LongNumberProperty}. */ - public static class Builder extends NumberPropertyBase.AbstractBuilder implements ObjectBuilder { + public static class Builder extends NumberPropertyBase.AbstractBuilder + implements + CopyableBuilder { @Nullable private Long nullValue; + public Builder() {} + + private Builder(LongNumberProperty o) { + super(o); + this.nullValue = o.nullValue; + } + + private Builder(Builder o) { + super(o); + this.nullValue = o.nullValue; + } + + @Override + @Nonnull + public Builder copy() { + return new Builder(this); + } + + @Override + @Nonnull + protected Builder self() { + return this; + } + /** * API name: {@code null_value} */ + @Nonnull public final Builder nullValue(@Nullable Long value) { this.nullValue = value; return this; } - @Override - protected Builder self() { - return this; - } - /** * Builds a {@link LongNumberProperty}. * * @throws NullPointerException if some of the required fields are null. */ + @Override + @Nonnull public LongNumberProperty build() { _checkSingleUse(); diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/mapping/LongRangeProperty.java b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/mapping/LongRangeProperty.java index 8be8fc7005..75c02946ae 100644 --- a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/mapping/LongRangeProperty.java +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/mapping/LongRangeProperty.java @@ -39,18 +39,24 @@ 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.util.CopyableBuilder; import org.opensearch.client.util.ObjectBuilder; +import org.opensearch.client.util.ToCopyableBuilder; // typedef: _types.mapping.LongRangeProperty @JsonpDeserializable @Generated("org.opensearch.client.codegen.CodeGenerator") -public class LongRangeProperty extends RangePropertyBase implements PropertyVariant { +public class LongRangeProperty extends RangePropertyBase + implements + PropertyVariant, + ToCopyableBuilder { // --------------------------------------------------------------------------------------------- @@ -77,12 +83,40 @@ protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { // --------------------------------------------------------------------------------------------- + @Override + @Nonnull + public Builder toBuilder() { + return new Builder(this); + } + + @Nonnull + public static Builder builder() { + return new Builder(); + } + /** * Builder for {@link LongRangeProperty}. */ - public static class Builder extends RangePropertyBase.AbstractBuilder implements ObjectBuilder { + public static class Builder extends RangePropertyBase.AbstractBuilder implements CopyableBuilder { + + public Builder() {} + + private Builder(LongRangeProperty o) { + super(o); + } + + private Builder(Builder o) { + super(o); + } @Override + @Nonnull + public Builder copy() { + return new Builder(this); + } + + @Override + @Nonnull protected Builder self() { return this; } @@ -92,6 +126,8 @@ protected Builder self() { * * @throws NullPointerException if some of the required fields are null. */ + @Override + @Nonnull public LongRangeProperty build() { _checkSingleUse(); diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/mapping/MatchOnlyTextProperty.java b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/mapping/MatchOnlyTextProperty.java index 13316e28ed..cccd8a9f14 100644 --- a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/mapping/MatchOnlyTextProperty.java +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/mapping/MatchOnlyTextProperty.java @@ -51,14 +51,20 @@ 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: _types.mapping.MatchOnlyTextProperty @JsonpDeserializable @Generated("org.opensearch.client.codegen.CodeGenerator") -public class MatchOnlyTextProperty implements PropertyVariant, PlainJsonSerializable { +public class MatchOnlyTextProperty + implements + PropertyVariant, + PlainJsonSerializable, + ToCopyableBuilder { @Nonnull private final List copyTo; @@ -164,10 +170,21 @@ protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { // --------------------------------------------------------------------------------------------- + @Override + @Nonnull + public Builder toBuilder() { + return new Builder(this); + } + + @Nonnull + public static Builder builder() { + return new Builder(); + } + /** * Builder for {@link MatchOnlyTextProperty}. */ - public static class Builder extends ObjectBuilderBase implements ObjectBuilder { + public static class Builder extends ObjectBuilderBase implements CopyableBuilder { @Nullable private List copyTo; @Nullable @@ -175,6 +192,26 @@ public static class Builder extends ObjectBuilderBase implements ObjectBuilder meta; + public Builder() {} + + private Builder(MatchOnlyTextProperty o) { + this.copyTo = _listCopy(o.copyTo); + this.fields = _mapCopy(o.fields); + this.meta = _mapCopy(o.meta); + } + + private Builder(Builder o) { + this.copyTo = _listCopy(o.copyTo); + this.fields = _mapCopy(o.fields); + this.meta = _mapCopy(o.meta); + } + + @Override + @Nonnull + public Builder copy() { + return new Builder(this); + } + /** * API name: {@code copy_to} * @@ -182,6 +219,7 @@ public static class Builder extends ObjectBuilderBase implements ObjectBuilderlist to copyTo. *

*/ + @Nonnull public final Builder copyTo(List list) { this.copyTo = _listAddAll(this.copyTo, list); return this; @@ -194,6 +232,7 @@ public final Builder copyTo(List list) { * Adds one or more values to copyTo. *

*/ + @Nonnull public final Builder copyTo(String value, String... values) { this.copyTo = _listAdd(this.copyTo, value, values); return this; @@ -210,6 +249,7 @@ public final Builder copyTo(String value, String... values) { * Adds all elements of map to fields. *

*/ + @Nonnull public final Builder fields(Map map) { this.fields = _mapPutAll(this.fields, map); return this; @@ -226,6 +266,7 @@ public final Builder fields(Map map) { * Adds an entry to fields. *

*/ + @Nonnull public final Builder fields(String key, Property value) { this.fields = _mapPut(this.fields, key, value); return this; @@ -242,6 +283,7 @@ public final Builder fields(String key, Property value) { * Adds a value to fields using a builder lambda. *

*/ + @Nonnull public final Builder fields(String key, Function> fn) { return fields(key, fn.apply(new Property.Builder()).build()); } @@ -256,6 +298,7 @@ public final Builder fields(String key, Functionmap to meta. *

*/ + @Nonnull public final Builder meta(Map map) { this.meta = _mapPutAll(this.meta, map); return this; @@ -271,6 +314,7 @@ public final Builder meta(Map map) { * Adds an entry to meta. *

*/ + @Nonnull public final Builder meta(String key, String value) { this.meta = _mapPut(this.meta, key, value); return this; @@ -281,6 +325,8 @@ public final Builder meta(String key, String value) { * * @throws NullPointerException if some of the required fields are null. */ + @Override + @Nonnull public MatchOnlyTextProperty build() { _checkSingleUse(); diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/mapping/Murmur3HashProperty.java b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/mapping/Murmur3HashProperty.java index fb4a94d1f2..1ff14a0109 100644 --- a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/mapping/Murmur3HashProperty.java +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/mapping/Murmur3HashProperty.java @@ -39,18 +39,24 @@ 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.util.CopyableBuilder; import org.opensearch.client.util.ObjectBuilder; +import org.opensearch.client.util.ToCopyableBuilder; // typedef: _types.mapping.Murmur3HashProperty @JsonpDeserializable @Generated("org.opensearch.client.codegen.CodeGenerator") -public class Murmur3HashProperty extends DocValuesPropertyBase implements PropertyVariant { +public class Murmur3HashProperty extends DocValuesPropertyBase + implements + PropertyVariant, + ToCopyableBuilder { // --------------------------------------------------------------------------------------------- @@ -77,12 +83,42 @@ protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { // --------------------------------------------------------------------------------------------- + @Override + @Nonnull + public Builder toBuilder() { + return new Builder(this); + } + + @Nonnull + public static Builder builder() { + return new Builder(); + } + /** * Builder for {@link Murmur3HashProperty}. */ - public static class Builder extends DocValuesPropertyBase.AbstractBuilder implements ObjectBuilder { + public static class Builder extends DocValuesPropertyBase.AbstractBuilder + implements + CopyableBuilder { + + public Builder() {} + + private Builder(Murmur3HashProperty o) { + super(o); + } + + private Builder(Builder o) { + super(o); + } @Override + @Nonnull + public Builder copy() { + return new Builder(this); + } + + @Override + @Nonnull protected Builder self() { return this; } @@ -92,6 +128,8 @@ protected Builder self() { * * @throws NullPointerException if some of the required fields are null. */ + @Override + @Nonnull public Murmur3HashProperty build() { _checkSingleUse(); diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/mapping/NestedProperty.java b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/mapping/NestedProperty.java index 242ce6c7af..fb5b5ee29f 100644 --- a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/mapping/NestedProperty.java +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/mapping/NestedProperty.java @@ -40,19 +40,22 @@ 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.util.CopyableBuilder; import org.opensearch.client.util.ObjectBuilder; +import org.opensearch.client.util.ToCopyableBuilder; // typedef: _types.mapping.NestedProperty @JsonpDeserializable @Generated("org.opensearch.client.codegen.CodeGenerator") -public class NestedProperty extends CorePropertyBase implements PropertyVariant { +public class NestedProperty extends CorePropertyBase implements PropertyVariant, ToCopyableBuilder { @Nullable private final Boolean enabled; @@ -129,10 +132,21 @@ protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { // --------------------------------------------------------------------------------------------- + @Override + @Nonnull + public Builder toBuilder() { + return new Builder(this); + } + + @Nonnull + public static Builder builder() { + return new Builder(); + } + /** * Builder for {@link NestedProperty}. */ - public static class Builder extends CorePropertyBase.AbstractBuilder implements ObjectBuilder { + public static class Builder extends CorePropertyBase.AbstractBuilder implements CopyableBuilder { @Nullable private Boolean enabled; @Nullable @@ -140,9 +154,38 @@ public static class Builder extends CorePropertyBase.AbstractBuilder im @Nullable private Boolean includeInRoot; + public Builder() {} + + private Builder(NestedProperty o) { + super(o); + this.enabled = o.enabled; + this.includeInParent = o.includeInParent; + this.includeInRoot = o.includeInRoot; + } + + private Builder(Builder o) { + super(o); + this.enabled = o.enabled; + this.includeInParent = o.includeInParent; + this.includeInRoot = o.includeInRoot; + } + + @Override + @Nonnull + public Builder copy() { + return new Builder(this); + } + + @Override + @Nonnull + protected Builder self() { + return this; + } + /** * API name: {@code enabled} */ + @Nonnull public final Builder enabled(@Nullable Boolean value) { this.enabled = value; return this; @@ -151,6 +194,7 @@ public final Builder enabled(@Nullable Boolean value) { /** * API name: {@code include_in_parent} */ + @Nonnull public final Builder includeInParent(@Nullable Boolean value) { this.includeInParent = value; return this; @@ -159,21 +203,19 @@ public final Builder includeInParent(@Nullable Boolean value) { /** * API name: {@code include_in_root} */ + @Nonnull public final Builder includeInRoot(@Nullable Boolean value) { this.includeInRoot = value; return this; } - @Override - protected Builder self() { - return this; - } - /** * Builds a {@link NestedProperty}. * * @throws NullPointerException if some of the required fields are null. */ + @Override + @Nonnull public NestedProperty build() { _checkSingleUse(); diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/mapping/NumberPropertyBase.java b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/mapping/NumberPropertyBase.java index 4028d7ff99..90d38b653a 100644 --- a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/mapping/NumberPropertyBase.java +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/mapping/NumberPropertyBase.java @@ -39,6 +39,7 @@ import jakarta.json.stream.JsonGenerator; import java.util.Objects; import javax.annotation.Generated; +import javax.annotation.Nonnull; import javax.annotation.Nullable; import org.opensearch.client.json.JsonpDeserializer; import org.opensearch.client.json.JsonpMapper; @@ -139,9 +140,28 @@ protected abstract static class AbstractBuilder o) { + super(o); + this.boost = o.boost; + this.coerce = o.coerce; + this.ignoreMalformed = o.ignoreMalformed; + this.index = o.index; + } + /** * API name: {@code boost} */ + @Nonnull public final BuilderT boost(@Nullable Double value) { this.boost = value; return self(); @@ -150,6 +170,7 @@ public final BuilderT boost(@Nullable Double value) { /** * API name: {@code coerce} */ + @Nonnull public final BuilderT coerce(@Nullable Boolean value) { this.coerce = value; return self(); @@ -158,6 +179,7 @@ public final BuilderT coerce(@Nullable Boolean value) { /** * API name: {@code ignore_malformed} */ + @Nonnull public final BuilderT ignoreMalformed(@Nullable Boolean value) { this.ignoreMalformed = value; return self(); @@ -166,6 +188,7 @@ public final BuilderT ignoreMalformed(@Nullable Boolean value) { /** * API name: {@code index} */ + @Nonnull public final BuilderT index(@Nullable Boolean value) { this.index = value; return self(); diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/mapping/ObjectProperty.java b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/mapping/ObjectProperty.java index ddbe46e876..241b35d0ab 100644 --- a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/mapping/ObjectProperty.java +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/mapping/ObjectProperty.java @@ -40,19 +40,22 @@ 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.util.CopyableBuilder; import org.opensearch.client.util.ObjectBuilder; +import org.opensearch.client.util.ToCopyableBuilder; // typedef: _types.mapping.ObjectProperty @JsonpDeserializable @Generated("org.opensearch.client.codegen.CodeGenerator") -public class ObjectProperty extends CorePropertyBase implements PropertyVariant { +public class ObjectProperty extends CorePropertyBase implements PropertyVariant, ToCopyableBuilder { @Nullable private final Boolean enabled; @@ -95,31 +98,64 @@ protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { // --------------------------------------------------------------------------------------------- + @Override + @Nonnull + public Builder toBuilder() { + return new Builder(this); + } + + @Nonnull + public static Builder builder() { + return new Builder(); + } + /** * Builder for {@link ObjectProperty}. */ - public static class Builder extends CorePropertyBase.AbstractBuilder implements ObjectBuilder { + public static class Builder extends CorePropertyBase.AbstractBuilder implements CopyableBuilder { @Nullable private Boolean enabled; + public Builder() {} + + private Builder(ObjectProperty o) { + super(o); + this.enabled = o.enabled; + } + + private Builder(Builder o) { + super(o); + this.enabled = o.enabled; + } + + @Override + @Nonnull + public Builder copy() { + return new Builder(this); + } + + @Override + @Nonnull + protected Builder self() { + return this; + } + /** * API name: {@code enabled} */ + @Nonnull public final Builder enabled(@Nullable Boolean value) { this.enabled = value; return this; } - @Override - protected Builder self() { - return this; - } - /** * Builds a {@link ObjectProperty}. * * @throws NullPointerException if some of the required fields are null. */ + @Override + @Nonnull public ObjectProperty build() { _checkSingleUse(); diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/mapping/PercolatorProperty.java b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/mapping/PercolatorProperty.java index 8125e91979..d8c7a6301d 100644 --- a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/mapping/PercolatorProperty.java +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/mapping/PercolatorProperty.java @@ -39,18 +39,24 @@ 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.util.CopyableBuilder; import org.opensearch.client.util.ObjectBuilder; +import org.opensearch.client.util.ToCopyableBuilder; // typedef: _types.mapping.PercolatorProperty @JsonpDeserializable @Generated("org.opensearch.client.codegen.CodeGenerator") -public class PercolatorProperty extends PropertyBase implements PropertyVariant { +public class PercolatorProperty extends PropertyBase + implements + PropertyVariant, + ToCopyableBuilder { // --------------------------------------------------------------------------------------------- @@ -77,12 +83,40 @@ protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { // --------------------------------------------------------------------------------------------- + @Override + @Nonnull + public Builder toBuilder() { + return new Builder(this); + } + + @Nonnull + public static Builder builder() { + return new Builder(); + } + /** * Builder for {@link PercolatorProperty}. */ - public static class Builder extends PropertyBase.AbstractBuilder implements ObjectBuilder { + public static class Builder extends PropertyBase.AbstractBuilder implements CopyableBuilder { + + public Builder() {} + + private Builder(PercolatorProperty o) { + super(o); + } + + private Builder(Builder o) { + super(o); + } @Override + @Nonnull + public Builder copy() { + return new Builder(this); + } + + @Override + @Nonnull protected Builder self() { return this; } @@ -92,6 +126,8 @@ protected Builder self() { * * @throws NullPointerException if some of the required fields are null. */ + @Override + @Nonnull public PercolatorProperty build() { _checkSingleUse(); diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/mapping/PropertyBase.java b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/mapping/PropertyBase.java index 6408ccfb65..83074766eb 100644 --- a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/mapping/PropertyBase.java +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/mapping/PropertyBase.java @@ -190,9 +190,31 @@ protected abstract static class AbstractBuilder properties; + protected AbstractBuilder() {} + + protected AbstractBuilder(PropertyBase o) { + this.dynamic = o.dynamic; + this.fields = _mapCopy(o.fields); + this.ignoreAbove = o.ignoreAbove; + this.meta = _mapCopy(o.meta); + this.properties = _mapCopy(o.properties); + } + + protected AbstractBuilder(AbstractBuilder o) { + this.dynamic = o.dynamic; + this.fields = _mapCopy(o.fields); + this.ignoreAbove = o.ignoreAbove; + this.meta = _mapCopy(o.meta); + this.properties = _mapCopy(o.properties); + } + + @Nonnull + protected abstract BuilderT self(); + /** * API name: {@code dynamic} */ + @Nonnull public final BuilderT dynamic(@Nullable DynamicMapping value) { this.dynamic = value; return self(); @@ -205,6 +227,7 @@ public final BuilderT dynamic(@Nullable DynamicMapping value) { * Adds all elements of map to fields. *

*/ + @Nonnull public final BuilderT fields(Map map) { this.fields = _mapPutAll(this.fields, map); return self(); @@ -217,6 +240,7 @@ public final BuilderT fields(Map map) { * Adds an entry to fields. *

*/ + @Nonnull public final BuilderT fields(String key, Property value) { this.fields = _mapPut(this.fields, key, value); return self(); @@ -229,6 +253,7 @@ public final BuilderT fields(String key, Property value) { * Adds a value to fields using a builder lambda. *

*/ + @Nonnull public final BuilderT fields(String key, Function> fn) { return fields(key, fn.apply(new Property.Builder()).build()); } @@ -236,6 +261,7 @@ public final BuilderT fields(String key, Functionmap to meta. *

*/ + @Nonnull public final BuilderT meta(Map map) { this.meta = _mapPutAll(this.meta, map); return self(); @@ -266,6 +293,7 @@ public final BuilderT meta(Map map) { * Adds an entry to meta. *

*/ + @Nonnull public final BuilderT meta(String key, String value) { this.meta = _mapPut(this.meta, key, value); return self(); @@ -278,6 +306,7 @@ public final BuilderT meta(String key, String value) { * Adds all elements of map to properties. *

*/ + @Nonnull public final BuilderT properties(Map map) { this.properties = _mapPutAll(this.properties, map); return self(); @@ -290,6 +319,7 @@ public final BuilderT properties(Map map) { * Adds an entry to properties. *

*/ + @Nonnull public final BuilderT properties(String key, Property value) { this.properties = _mapPut(this.properties, key, value); return self(); @@ -302,11 +332,11 @@ public final BuilderT properties(String key, Property value) { * Adds a value to properties using a builder lambda. *

*/ + @Nonnull public final BuilderT properties(String key, Function> fn) { return properties(key, fn.apply(new Property.Builder()).build()); } - protected abstract BuilderT self(); } // --------------------------------------------------------------------------------------------- diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/mapping/RangePropertyBase.java b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/mapping/RangePropertyBase.java index 63f46fac1a..4fbe962329 100644 --- a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/mapping/RangePropertyBase.java +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/mapping/RangePropertyBase.java @@ -39,6 +39,7 @@ import jakarta.json.stream.JsonGenerator; import java.util.Objects; import javax.annotation.Generated; +import javax.annotation.Nonnull; import javax.annotation.Nullable; import org.opensearch.client.json.JsonpDeserializer; import org.opensearch.client.json.JsonpMapper; @@ -120,9 +121,26 @@ protected abstract static class AbstractBuilder o) { + super(o); + this.boost = o.boost; + this.coerce = o.coerce; + this.index = o.index; + } + /** * API name: {@code boost} */ + @Nonnull public final BuilderT boost(@Nullable Double value) { this.boost = value; return self(); @@ -131,6 +149,7 @@ public final BuilderT boost(@Nullable Double value) { /** * API name: {@code coerce} */ + @Nonnull public final BuilderT coerce(@Nullable Boolean value) { this.coerce = value; return self(); @@ -139,6 +158,7 @@ public final BuilderT coerce(@Nullable Boolean value) { /** * API name: {@code index} */ + @Nonnull public final BuilderT index(@Nullable Boolean value) { this.index = value; return self(); diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/mapping/RankFeatureProperty.java b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/mapping/RankFeatureProperty.java index 90da23afbb..be0e37f64e 100644 --- a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/mapping/RankFeatureProperty.java +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/mapping/RankFeatureProperty.java @@ -40,19 +40,25 @@ 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.util.CopyableBuilder; import org.opensearch.client.util.ObjectBuilder; +import org.opensearch.client.util.ToCopyableBuilder; // typedef: _types.mapping.RankFeatureProperty @JsonpDeserializable @Generated("org.opensearch.client.codegen.CodeGenerator") -public class RankFeatureProperty extends PropertyBase implements PropertyVariant { +public class RankFeatureProperty extends PropertyBase + implements + PropertyVariant, + ToCopyableBuilder { @Nullable private final Boolean positiveScoreImpact; @@ -95,31 +101,64 @@ protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { // --------------------------------------------------------------------------------------------- + @Override + @Nonnull + public Builder toBuilder() { + return new Builder(this); + } + + @Nonnull + public static Builder builder() { + return new Builder(); + } + /** * Builder for {@link RankFeatureProperty}. */ - public static class Builder extends PropertyBase.AbstractBuilder implements ObjectBuilder { + public static class Builder extends PropertyBase.AbstractBuilder implements CopyableBuilder { @Nullable private Boolean positiveScoreImpact; + public Builder() {} + + private Builder(RankFeatureProperty o) { + super(o); + this.positiveScoreImpact = o.positiveScoreImpact; + } + + private Builder(Builder o) { + super(o); + this.positiveScoreImpact = o.positiveScoreImpact; + } + + @Override + @Nonnull + public Builder copy() { + return new Builder(this); + } + + @Override + @Nonnull + protected Builder self() { + return this; + } + /** * API name: {@code positive_score_impact} */ + @Nonnull public final Builder positiveScoreImpact(@Nullable Boolean value) { this.positiveScoreImpact = value; return this; } - @Override - protected Builder self() { - return this; - } - /** * Builds a {@link RankFeatureProperty}. * * @throws NullPointerException if some of the required fields are null. */ + @Override + @Nonnull public RankFeatureProperty build() { _checkSingleUse(); diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/mapping/RankFeaturesProperty.java b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/mapping/RankFeaturesProperty.java index 6aea29a5b9..db79c786f2 100644 --- a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/mapping/RankFeaturesProperty.java +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/mapping/RankFeaturesProperty.java @@ -39,18 +39,24 @@ 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.util.CopyableBuilder; import org.opensearch.client.util.ObjectBuilder; +import org.opensearch.client.util.ToCopyableBuilder; // typedef: _types.mapping.RankFeaturesProperty @JsonpDeserializable @Generated("org.opensearch.client.codegen.CodeGenerator") -public class RankFeaturesProperty extends PropertyBase implements PropertyVariant { +public class RankFeaturesProperty extends PropertyBase + implements + PropertyVariant, + ToCopyableBuilder { // --------------------------------------------------------------------------------------------- @@ -77,12 +83,40 @@ protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { // --------------------------------------------------------------------------------------------- + @Override + @Nonnull + public Builder toBuilder() { + return new Builder(this); + } + + @Nonnull + public static Builder builder() { + return new Builder(); + } + /** * Builder for {@link RankFeaturesProperty}. */ - public static class Builder extends PropertyBase.AbstractBuilder implements ObjectBuilder { + public static class Builder extends PropertyBase.AbstractBuilder implements CopyableBuilder { + + public Builder() {} + + private Builder(RankFeaturesProperty o) { + super(o); + } + + private Builder(Builder o) { + super(o); + } @Override + @Nonnull + public Builder copy() { + return new Builder(this); + } + + @Override + @Nonnull protected Builder self() { return this; } @@ -92,6 +126,8 @@ protected Builder self() { * * @throws NullPointerException if some of the required fields are null. */ + @Override + @Nonnull public RankFeaturesProperty build() { _checkSingleUse(); diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/mapping/RoutingField.java b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/mapping/RoutingField.java index df5983d762..8d90a711e7 100644 --- a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/mapping/RoutingField.java +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/mapping/RoutingField.java @@ -39,6 +39,7 @@ 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; @@ -46,14 +47,16 @@ 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: _types.mapping.RoutingField @JsonpDeserializable @Generated("org.opensearch.client.codegen.CodeGenerator") -public class RoutingField implements PlainJsonSerializable { +public class RoutingField implements PlainJsonSerializable, ToCopyableBuilder { private final boolean required; @@ -91,15 +94,43 @@ protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { // --------------------------------------------------------------------------------------------- + @Override + @Nonnull + public Builder toBuilder() { + return new Builder(this); + } + + @Nonnull + public static Builder builder() { + return new Builder(); + } + /** * Builder for {@link RoutingField}. */ - public static class Builder extends ObjectBuilderBase implements ObjectBuilder { + public static class Builder extends ObjectBuilderBase implements CopyableBuilder { private Boolean required; + public Builder() {} + + private Builder(RoutingField o) { + this.required = o.required; + } + + private Builder(Builder o) { + this.required = o.required; + } + + @Override + @Nonnull + public Builder copy() { + return new Builder(this); + } + /** * Required - API name: {@code required} */ + @Nonnull public final Builder required(boolean value) { this.required = value; return this; @@ -110,6 +141,8 @@ public final Builder required(boolean value) { * * @throws NullPointerException if some of the required fields are null. */ + @Override + @Nonnull public RoutingField build() { _checkSingleUse(); diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/mapping/ScaledFloatNumberProperty.java b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/mapping/ScaledFloatNumberProperty.java index ea0db8fe34..a22dace32b 100644 --- a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/mapping/ScaledFloatNumberProperty.java +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/mapping/ScaledFloatNumberProperty.java @@ -40,19 +40,25 @@ 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.util.CopyableBuilder; import org.opensearch.client.util.ObjectBuilder; +import org.opensearch.client.util.ToCopyableBuilder; // typedef: _types.mapping.ScaledFloatNumberProperty @JsonpDeserializable @Generated("org.opensearch.client.codegen.CodeGenerator") -public class ScaledFloatNumberProperty extends NumberPropertyBase implements PropertyVariant { +public class ScaledFloatNumberProperty extends NumberPropertyBase + implements + PropertyVariant, + ToCopyableBuilder { @Nullable private final Double nullValue; @@ -112,18 +118,58 @@ protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { // --------------------------------------------------------------------------------------------- + @Override + @Nonnull + public Builder toBuilder() { + return new Builder(this); + } + + @Nonnull + public static Builder builder() { + return new Builder(); + } + /** * Builder for {@link ScaledFloatNumberProperty}. */ - public static class Builder extends NumberPropertyBase.AbstractBuilder implements ObjectBuilder { + public static class Builder extends NumberPropertyBase.AbstractBuilder + implements + CopyableBuilder { @Nullable private Double nullValue; @Nullable private Double scalingFactor; + public Builder() {} + + private Builder(ScaledFloatNumberProperty o) { + super(o); + this.nullValue = o.nullValue; + this.scalingFactor = o.scalingFactor; + } + + private Builder(Builder o) { + super(o); + this.nullValue = o.nullValue; + this.scalingFactor = o.scalingFactor; + } + + @Override + @Nonnull + public Builder copy() { + return new Builder(this); + } + + @Override + @Nonnull + protected Builder self() { + return this; + } + /** * API name: {@code null_value} */ + @Nonnull public final Builder nullValue(@Nullable Double value) { this.nullValue = value; return this; @@ -132,21 +178,19 @@ public final Builder nullValue(@Nullable Double value) { /** * API name: {@code scaling_factor} */ + @Nonnull public final Builder scalingFactor(@Nullable Double value) { this.scalingFactor = value; return this; } - @Override - protected Builder self() { - return this; - } - /** * Builds a {@link ScaledFloatNumberProperty}. * * @throws NullPointerException if some of the required fields are null. */ + @Override + @Nonnull public ScaledFloatNumberProperty build() { _checkSingleUse(); diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/mapping/SearchAsYouTypeProperty.java b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/mapping/SearchAsYouTypeProperty.java index 39c0f6bfce..cce67e4deb 100644 --- a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/mapping/SearchAsYouTypeProperty.java +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/mapping/SearchAsYouTypeProperty.java @@ -40,19 +40,25 @@ 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.util.CopyableBuilder; import org.opensearch.client.util.ObjectBuilder; +import org.opensearch.client.util.ToCopyableBuilder; // typedef: _types.mapping.SearchAsYouTypeProperty @JsonpDeserializable @Generated("org.opensearch.client.codegen.CodeGenerator") -public class SearchAsYouTypeProperty extends CorePropertyBase implements PropertyVariant { +public class SearchAsYouTypeProperty extends CorePropertyBase + implements + PropertyVariant, + ToCopyableBuilder { @Nullable private final String analyzer; @@ -214,10 +220,23 @@ protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { // --------------------------------------------------------------------------------------------- + @Override + @Nonnull + public Builder toBuilder() { + return new Builder(this); + } + + @Nonnull + public static Builder builder() { + return new Builder(); + } + /** * Builder for {@link SearchAsYouTypeProperty}. */ - public static class Builder extends CorePropertyBase.AbstractBuilder implements ObjectBuilder { + public static class Builder extends CorePropertyBase.AbstractBuilder + implements + CopyableBuilder { @Nullable private String analyzer; @Nullable @@ -235,9 +254,48 @@ public static class Builder extends CorePropertyBase.AbstractBuilder im @Nullable private TermVectorOption termVector; + public Builder() {} + + private Builder(SearchAsYouTypeProperty o) { + super(o); + this.analyzer = o.analyzer; + this.index = o.index; + this.indexOptions = o.indexOptions; + this.maxShingleSize = o.maxShingleSize; + this.norms = o.norms; + this.searchAnalyzer = o.searchAnalyzer; + this.searchQuoteAnalyzer = o.searchQuoteAnalyzer; + this.termVector = o.termVector; + } + + private Builder(Builder o) { + super(o); + this.analyzer = o.analyzer; + this.index = o.index; + this.indexOptions = o.indexOptions; + this.maxShingleSize = o.maxShingleSize; + this.norms = o.norms; + this.searchAnalyzer = o.searchAnalyzer; + this.searchQuoteAnalyzer = o.searchQuoteAnalyzer; + this.termVector = o.termVector; + } + + @Override + @Nonnull + public Builder copy() { + return new Builder(this); + } + + @Override + @Nonnull + protected Builder self() { + return this; + } + /** * API name: {@code analyzer} */ + @Nonnull public final Builder analyzer(@Nullable String value) { this.analyzer = value; return this; @@ -246,6 +304,7 @@ public final Builder analyzer(@Nullable String value) { /** * API name: {@code index} */ + @Nonnull public final Builder index(@Nullable Boolean value) { this.index = value; return this; @@ -254,6 +313,7 @@ public final Builder index(@Nullable Boolean value) { /** * API name: {@code index_options} */ + @Nonnull public final Builder indexOptions(@Nullable IndexOptions value) { this.indexOptions = value; return this; @@ -262,6 +322,7 @@ public final Builder indexOptions(@Nullable IndexOptions value) { /** * API name: {@code max_shingle_size} */ + @Nonnull public final Builder maxShingleSize(@Nullable Integer value) { this.maxShingleSize = value; return this; @@ -270,6 +331,7 @@ public final Builder maxShingleSize(@Nullable Integer value) { /** * API name: {@code norms} */ + @Nonnull public final Builder norms(@Nullable Boolean value) { this.norms = value; return this; @@ -278,6 +340,7 @@ public final Builder norms(@Nullable Boolean value) { /** * API name: {@code search_analyzer} */ + @Nonnull public final Builder searchAnalyzer(@Nullable String value) { this.searchAnalyzer = value; return this; @@ -286,6 +349,7 @@ public final Builder searchAnalyzer(@Nullable String value) { /** * API name: {@code search_quote_analyzer} */ + @Nonnull public final Builder searchQuoteAnalyzer(@Nullable String value) { this.searchQuoteAnalyzer = value; return this; @@ -294,21 +358,19 @@ public final Builder searchQuoteAnalyzer(@Nullable String value) { /** * API name: {@code term_vector} */ + @Nonnull public final Builder termVector(@Nullable TermVectorOption value) { this.termVector = value; return this; } - @Override - protected Builder self() { - return this; - } - /** * Builds a {@link SearchAsYouTypeProperty}. * * @throws NullPointerException if some of the required fields are null. */ + @Override + @Nonnull public SearchAsYouTypeProperty build() { _checkSingleUse(); diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/mapping/ShortNumberProperty.java b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/mapping/ShortNumberProperty.java index 28fd07e052..cd77902413 100644 --- a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/mapping/ShortNumberProperty.java +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/mapping/ShortNumberProperty.java @@ -40,19 +40,25 @@ 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.util.CopyableBuilder; import org.opensearch.client.util.ObjectBuilder; +import org.opensearch.client.util.ToCopyableBuilder; // typedef: _types.mapping.ShortNumberProperty @JsonpDeserializable @Generated("org.opensearch.client.codegen.CodeGenerator") -public class ShortNumberProperty extends NumberPropertyBase implements PropertyVariant { +public class ShortNumberProperty extends NumberPropertyBase + implements + PropertyVariant, + ToCopyableBuilder { @Nullable private final Number nullValue; @@ -95,31 +101,66 @@ protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { // --------------------------------------------------------------------------------------------- + @Override + @Nonnull + public Builder toBuilder() { + return new Builder(this); + } + + @Nonnull + public static Builder builder() { + return new Builder(); + } + /** * Builder for {@link ShortNumberProperty}. */ - public static class Builder extends NumberPropertyBase.AbstractBuilder implements ObjectBuilder { + public static class Builder extends NumberPropertyBase.AbstractBuilder + implements + CopyableBuilder { @Nullable private Number nullValue; + public Builder() {} + + private Builder(ShortNumberProperty o) { + super(o); + this.nullValue = o.nullValue; + } + + private Builder(Builder o) { + super(o); + this.nullValue = o.nullValue; + } + + @Override + @Nonnull + public Builder copy() { + return new Builder(this); + } + + @Override + @Nonnull + protected Builder self() { + return this; + } + /** * API name: {@code null_value} */ + @Nonnull public final Builder nullValue(@Nullable Number value) { this.nullValue = value; return this; } - @Override - protected Builder self() { - return this; - } - /** * Builds a {@link ShortNumberProperty}. * * @throws NullPointerException if some of the required fields are null. */ + @Override + @Nonnull public ShortNumberProperty build() { _checkSingleUse(); diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/mapping/SizeField.java b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/mapping/SizeField.java index a0cd45d19e..8114d25c94 100644 --- a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/mapping/SizeField.java +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/mapping/SizeField.java @@ -39,6 +39,7 @@ 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; @@ -46,14 +47,16 @@ 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: _types.mapping.SizeField @JsonpDeserializable @Generated("org.opensearch.client.codegen.CodeGenerator") -public class SizeField implements PlainJsonSerializable { +public class SizeField implements PlainJsonSerializable, ToCopyableBuilder { private final boolean enabled; @@ -91,15 +94,43 @@ protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { // --------------------------------------------------------------------------------------------- + @Override + @Nonnull + public Builder toBuilder() { + return new Builder(this); + } + + @Nonnull + public static Builder builder() { + return new Builder(); + } + /** * Builder for {@link SizeField}. */ - public static class Builder extends ObjectBuilderBase implements ObjectBuilder { + public static class Builder extends ObjectBuilderBase implements CopyableBuilder { private Boolean enabled; + public Builder() {} + + private Builder(SizeField 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; @@ -110,6 +141,8 @@ public final Builder enabled(boolean value) { * * @throws NullPointerException if some of the required fields are null. */ + @Override + @Nonnull public SizeField build() { _checkSingleUse(); diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/mapping/SourceField.java b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/mapping/SourceField.java index f14950a494..2cae0d944a 100644 --- a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/mapping/SourceField.java +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/mapping/SourceField.java @@ -51,14 +51,16 @@ import org.opensearch.client.json.PlainDeserializable; 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: _types.mapping.SourceField @JsonpDeserializable @Generated("org.opensearch.client.codegen.CodeGenerator") -public class SourceField implements PlainJsonSerializable { +public class SourceField implements PlainJsonSerializable, ToCopyableBuilder { @Nullable private final Boolean compress; @@ -176,15 +178,21 @@ protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { // --------------------------------------------------------------------------------------------- + @Override + @Nonnull + public Builder toBuilder() { + return new Builder(this); + } + + @Nonnull + public static Builder builder() { + return new Builder(); + } + /** * Builder for {@link SourceField}. */ - public static class Builder extends ObjectBuilderBase implements ObjectBuilder, PlainDeserializable { - @Override - public Builder self() { - return this; - } - + public static class Builder extends ObjectBuilderBase implements CopyableBuilder, PlainDeserializable { @Nullable private Boolean compress; @Nullable @@ -196,9 +204,40 @@ public Builder self() { @Nullable private List includes; + public Builder() {} + + private Builder(SourceField o) { + this.compress = o.compress; + this.compressThreshold = o.compressThreshold; + this.enabled = o.enabled; + this.excludes = _listCopy(o.excludes); + this.includes = _listCopy(o.includes); + } + + private Builder(Builder o) { + this.compress = o.compress; + this.compressThreshold = o.compressThreshold; + this.enabled = o.enabled; + this.excludes = _listCopy(o.excludes); + this.includes = _listCopy(o.includes); + } + + @Override + @Nonnull + public Builder copy() { + return new Builder(this); + } + + @Override + @Nonnull + public Builder self() { + return this; + } + /** * API name: {@code compress} */ + @Nonnull public final Builder compress(@Nullable Boolean value) { this.compress = value; return this; @@ -207,6 +246,7 @@ public final Builder compress(@Nullable Boolean value) { /** * API name: {@code compress_threshold} */ + @Nonnull public final Builder compressThreshold(@Nullable String value) { this.compressThreshold = value; return this; @@ -215,6 +255,7 @@ public final Builder compressThreshold(@Nullable String value) { /** * API name: {@code enabled} */ + @Nonnull public final Builder enabled(@Nullable Boolean value) { this.enabled = value; return this; @@ -227,6 +268,7 @@ public final Builder enabled(@Nullable Boolean value) { * Adds all elements of list to excludes. *

*/ + @Nonnull public final Builder excludes(List list) { this.excludes = _listAddAll(this.excludes, list); return this; @@ -239,6 +281,7 @@ public final Builder excludes(List list) { * Adds one or more values to excludes. *

*/ + @Nonnull public final Builder excludes(String value, String... values) { this.excludes = _listAdd(this.excludes, value, values); return this; @@ -251,6 +294,7 @@ public final Builder excludes(String value, String... values) { * Adds all elements of list to includes. *

*/ + @Nonnull public final Builder includes(List list) { this.includes = _listAddAll(this.includes, list); return this; @@ -263,6 +307,7 @@ public final Builder includes(List list) { * Adds one or more values to includes. *

*/ + @Nonnull public final Builder includes(String value, String... values) { this.includes = _listAdd(this.includes, value, values); return this; @@ -273,6 +318,8 @@ public final Builder includes(String value, String... values) { * * @throws NullPointerException if some of the required fields are null. */ + @Override + @Nonnull public SourceField build() { _checkSingleUse(); diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/mapping/SuggestContext.java b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/mapping/SuggestContext.java index 0bd7544f7d..77f7151ba0 100644 --- a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/mapping/SuggestContext.java +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/mapping/SuggestContext.java @@ -49,14 +49,16 @@ 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: _types.mapping.SuggestContext @JsonpDeserializable @Generated("org.opensearch.client.codegen.CodeGenerator") -public class SuggestContext implements PlainJsonSerializable { +public class SuggestContext implements PlainJsonSerializable, ToCopyableBuilder { @Nonnull private final String name; @@ -145,10 +147,21 @@ protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { // --------------------------------------------------------------------------------------------- + @Override + @Nonnull + public Builder toBuilder() { + return new Builder(this); + } + + @Nonnull + public static Builder builder() { + return new Builder(); + } + /** * Builder for {@link SuggestContext}. */ - public static class Builder extends ObjectBuilderBase implements ObjectBuilder { + public static class Builder extends ObjectBuilderBase implements CopyableBuilder { private String name; @Nullable private String path; @@ -156,9 +169,32 @@ public static class Builder extends ObjectBuilderBase implements ObjectBuilder { private final int maxChars; @@ -104,16 +107,46 @@ protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { // --------------------------------------------------------------------------------------------- + @Override + @Nonnull + public Builder toBuilder() { + return new Builder(this); + } + + @Nonnull + public static Builder builder() { + return new Builder(); + } + /** * Builder for {@link TextIndexPrefixes}. */ - public static class Builder extends ObjectBuilderBase implements ObjectBuilder { + public static class Builder extends ObjectBuilderBase implements CopyableBuilder { private Integer maxChars; private Integer minChars; + public Builder() {} + + private Builder(TextIndexPrefixes o) { + this.maxChars = o.maxChars; + this.minChars = o.minChars; + } + + private Builder(Builder o) { + this.maxChars = o.maxChars; + this.minChars = o.minChars; + } + + @Override + @Nonnull + public Builder copy() { + return new Builder(this); + } + /** * Required - API name: {@code max_chars} */ + @Nonnull public final Builder maxChars(int value) { this.maxChars = value; return this; @@ -122,6 +155,7 @@ public final Builder maxChars(int value) { /** * Required - API name: {@code min_chars} */ + @Nonnull public final Builder minChars(int value) { this.minChars = value; return this; @@ -132,6 +166,8 @@ public final Builder minChars(int value) { * * @throws NullPointerException if some of the required fields are null. */ + @Override + @Nonnull public TextIndexPrefixes build() { _checkSingleUse(); diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/mapping/TextProperty.java b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/mapping/TextProperty.java index 7d8676a4d4..b8cc53f8a1 100644 --- a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/mapping/TextProperty.java +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/mapping/TextProperty.java @@ -40,6 +40,7 @@ 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; @@ -47,13 +48,15 @@ import org.opensearch.client.json.ObjectBuilderDeserializer; import org.opensearch.client.json.ObjectDeserializer; import org.opensearch.client.opensearch.indices.FielddataFrequencyFilter; +import org.opensearch.client.util.CopyableBuilder; import org.opensearch.client.util.ObjectBuilder; +import org.opensearch.client.util.ToCopyableBuilder; // typedef: _types.mapping.TextProperty @JsonpDeserializable @Generated("org.opensearch.client.codegen.CodeGenerator") -public class TextProperty extends CorePropertyBase implements PropertyVariant { +public class TextProperty extends CorePropertyBase implements PropertyVariant, ToCopyableBuilder { @Nullable private final String analyzer; @@ -317,10 +320,21 @@ protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { // --------------------------------------------------------------------------------------------- + @Override + @Nonnull + public Builder toBuilder() { + return new Builder(this); + } + + @Nonnull + public static Builder builder() { + return new Builder(); + } + /** * Builder for {@link TextProperty}. */ - public static class Builder extends CorePropertyBase.AbstractBuilder implements ObjectBuilder { + public static class Builder extends CorePropertyBase.AbstractBuilder implements CopyableBuilder { @Nullable private String analyzer; @Nullable @@ -350,9 +364,60 @@ public static class Builder extends CorePropertyBase.AbstractBuilder im @Nullable private TermVectorOption termVector; + public Builder() {} + + private Builder(TextProperty o) { + super(o); + this.analyzer = o.analyzer; + this.boost = o.boost; + this.eagerGlobalOrdinals = o.eagerGlobalOrdinals; + this.fielddata = o.fielddata; + this.fielddataFrequencyFilter = o.fielddataFrequencyFilter; + this.index = o.index; + this.indexOptions = o.indexOptions; + this.indexPhrases = o.indexPhrases; + this.indexPrefixes = o.indexPrefixes; + this.norms = o.norms; + this.positionIncrementGap = o.positionIncrementGap; + this.searchAnalyzer = o.searchAnalyzer; + this.searchQuoteAnalyzer = o.searchQuoteAnalyzer; + this.termVector = o.termVector; + } + + private Builder(Builder o) { + super(o); + this.analyzer = o.analyzer; + this.boost = o.boost; + this.eagerGlobalOrdinals = o.eagerGlobalOrdinals; + this.fielddata = o.fielddata; + this.fielddataFrequencyFilter = o.fielddataFrequencyFilter; + this.index = o.index; + this.indexOptions = o.indexOptions; + this.indexPhrases = o.indexPhrases; + this.indexPrefixes = o.indexPrefixes; + this.norms = o.norms; + this.positionIncrementGap = o.positionIncrementGap; + this.searchAnalyzer = o.searchAnalyzer; + this.searchQuoteAnalyzer = o.searchQuoteAnalyzer; + this.termVector = o.termVector; + } + + @Override + @Nonnull + public Builder copy() { + return new Builder(this); + } + + @Override + @Nonnull + protected Builder self() { + return this; + } + /** * API name: {@code analyzer} */ + @Nonnull public final Builder analyzer(@Nullable String value) { this.analyzer = value; return this; @@ -361,6 +426,7 @@ public final Builder analyzer(@Nullable String value) { /** * API name: {@code boost} */ + @Nonnull public final Builder boost(@Nullable Double value) { this.boost = value; return this; @@ -369,6 +435,7 @@ public final Builder boost(@Nullable Double value) { /** * API name: {@code eager_global_ordinals} */ + @Nonnull public final Builder eagerGlobalOrdinals(@Nullable Boolean value) { this.eagerGlobalOrdinals = value; return this; @@ -377,6 +444,7 @@ public final Builder eagerGlobalOrdinals(@Nullable Boolean value) { /** * API name: {@code fielddata} */ + @Nonnull public final Builder fielddata(@Nullable Boolean value) { this.fielddata = value; return this; @@ -385,6 +453,7 @@ public final Builder fielddata(@Nullable Boolean value) { /** * API name: {@code fielddata_frequency_filter} */ + @Nonnull public final Builder fielddataFrequencyFilter(@Nullable FielddataFrequencyFilter value) { this.fielddataFrequencyFilter = value; return this; @@ -393,6 +462,7 @@ public final Builder fielddataFrequencyFilter(@Nullable FielddataFrequencyFilter /** * API name: {@code fielddata_frequency_filter} */ + @Nonnull public final Builder fielddataFrequencyFilter( Function> fn ) { @@ -402,6 +472,7 @@ public final Builder fielddataFrequencyFilter( /** * API name: {@code index} */ + @Nonnull public final Builder index(@Nullable Boolean value) { this.index = value; return this; @@ -410,6 +481,7 @@ public final Builder index(@Nullable Boolean value) { /** * API name: {@code index_options} */ + @Nonnull public final Builder indexOptions(@Nullable IndexOptions value) { this.indexOptions = value; return this; @@ -418,6 +490,7 @@ public final Builder indexOptions(@Nullable IndexOptions value) { /** * API name: {@code index_phrases} */ + @Nonnull public final Builder indexPhrases(@Nullable Boolean value) { this.indexPhrases = value; return this; @@ -426,6 +499,7 @@ public final Builder indexPhrases(@Nullable Boolean value) { /** * API name: {@code index_prefixes} */ + @Nonnull public final Builder indexPrefixes(@Nullable TextIndexPrefixes value) { this.indexPrefixes = value; return this; @@ -434,6 +508,7 @@ public final Builder indexPrefixes(@Nullable TextIndexPrefixes value) { /** * API name: {@code index_prefixes} */ + @Nonnull public final Builder indexPrefixes(Function> fn) { return indexPrefixes(fn.apply(new TextIndexPrefixes.Builder()).build()); } @@ -441,6 +516,7 @@ public final Builder indexPrefixes(Function { @Nullable private final String analyzer; @@ -163,10 +169,23 @@ protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { // --------------------------------------------------------------------------------------------- + @Override + @Nonnull + public Builder toBuilder() { + return new Builder(this); + } + + @Nonnull + public static Builder builder() { + return new Builder(); + } + /** * Builder for {@link TokenCountProperty}. */ - public static class Builder extends DocValuesPropertyBase.AbstractBuilder implements ObjectBuilder { + public static class Builder extends DocValuesPropertyBase.AbstractBuilder + implements + CopyableBuilder { @Nullable private String analyzer; @Nullable @@ -178,9 +197,42 @@ public static class Builder extends DocValuesPropertyBase.AbstractBuilder { @Nullable private final AllField allField; @@ -365,15 +367,21 @@ protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { // --------------------------------------------------------------------------------------------- + @Override + @Nonnull + public Builder toBuilder() { + return new Builder(this); + } + + @Nonnull + public static Builder builder() { + return new Builder(); + } + /** * Builder for {@link TypeMapping}. */ - public static class Builder extends ObjectBuilderBase implements ObjectBuilder, PlainDeserializable { - @Override - public Builder self() { - return this; - } - + public static class Builder extends ObjectBuilderBase implements CopyableBuilder, PlainDeserializable { @Nullable private AllField allField; @Nullable @@ -405,9 +413,60 @@ public Builder self() { @Nullable private SourceField source; + public Builder() {} + + private Builder(TypeMapping o) { + this.allField = o.allField; + this.dataStreamTimestamp = o.dataStreamTimestamp; + this.dateDetection = o.dateDetection; + this.dynamic = o.dynamic; + this.dynamicDateFormats = _listCopy(o.dynamicDateFormats); + this.dynamicTemplates = _listCopy(o.dynamicTemplates); + this.enabled = o.enabled; + this.fieldNames = o.fieldNames; + this.indexField = o.indexField; + this.meta = _mapCopy(o.meta); + this.numericDetection = o.numericDetection; + this.properties = _mapCopy(o.properties); + this.routing = o.routing; + this.size = o.size; + this.source = o.source; + } + + private Builder(Builder o) { + this.allField = o.allField; + this.dataStreamTimestamp = o.dataStreamTimestamp; + this.dateDetection = o.dateDetection; + this.dynamic = o.dynamic; + this.dynamicDateFormats = _listCopy(o.dynamicDateFormats); + this.dynamicTemplates = _listCopy(o.dynamicTemplates); + this.enabled = o.enabled; + this.fieldNames = o.fieldNames; + this.indexField = o.indexField; + this.meta = _mapCopy(o.meta); + this.numericDetection = o.numericDetection; + this.properties = _mapCopy(o.properties); + this.routing = o.routing; + this.size = o.size; + this.source = o.source; + } + + @Override + @Nonnull + public Builder copy() { + return new Builder(this); + } + + @Override + @Nonnull + public Builder self() { + return this; + } + /** * API name: {@code all_field} */ + @Nonnull public final Builder allField(@Nullable AllField value) { this.allField = value; return this; @@ -416,6 +475,7 @@ public final Builder allField(@Nullable AllField value) { /** * API name: {@code all_field} */ + @Nonnull public final Builder allField(Function> fn) { return allField(fn.apply(new AllField.Builder()).build()); } @@ -423,6 +483,7 @@ public final Builder allField(Function /** * API name: {@code _data_stream_timestamp} */ + @Nonnull public final Builder dataStreamTimestamp(@Nullable DataStreamTimestamp value) { this.dataStreamTimestamp = value; return this; @@ -431,6 +492,7 @@ public final Builder dataStreamTimestamp(@Nullable DataStreamTimestamp value) { /** * API name: {@code _data_stream_timestamp} */ + @Nonnull public final Builder dataStreamTimestamp(Function> fn) { return dataStreamTimestamp(fn.apply(new DataStreamTimestamp.Builder()).build()); } @@ -438,6 +500,7 @@ public final Builder dataStreamTimestamp(Functionlist to dynamicDateFormats. *

*/ + @Nonnull public final Builder dynamicDateFormats(List list) { this.dynamicDateFormats = _listAddAll(this.dynamicDateFormats, list); return this; @@ -470,6 +535,7 @@ public final Builder dynamicDateFormats(List list) { * Adds one or more values to dynamicDateFormats. *

*/ + @Nonnull public final Builder dynamicDateFormats(String value, String... values) { this.dynamicDateFormats = _listAdd(this.dynamicDateFormats, value, values); return this; @@ -482,6 +548,7 @@ public final Builder dynamicDateFormats(String value, String... values) { * Adds all elements of list to dynamicTemplates. *

*/ + @Nonnull public final Builder dynamicTemplates(List> list) { this.dynamicTemplates = _listAddAll(this.dynamicTemplates, list); return this; @@ -494,6 +561,7 @@ public final Builder dynamicTemplates(List> list) { * Adds one or more values to dynamicTemplates. *

*/ + @Nonnull public final Builder dynamicTemplates(Map value, Map... values) { this.dynamicTemplates = _listAdd(this.dynamicTemplates, value, values); return this; @@ -502,6 +570,7 @@ public final Builder dynamicTemplates(Map value, Map> fn) { return fieldNames(fn.apply(new FieldNamesField.Builder()).build()); } @@ -525,6 +596,7 @@ public final Builder fieldNames(Function> fn) { return indexField(fn.apply(new IndexField.Builder()).build()); } @@ -544,6 +617,7 @@ public final Builder indexField(Functionmap to meta. *

*/ + @Nonnull public final Builder meta(Map map) { this.meta = _mapPutAll(this.meta, map); return this; @@ -556,6 +630,7 @@ public final Builder meta(Map map) { * Adds an entry to meta. *

*/ + @Nonnull public final Builder meta(String key, JsonData value) { this.meta = _mapPut(this.meta, key, value); return this; @@ -564,6 +639,7 @@ public final Builder meta(String key, JsonData value) { /** * API name: {@code numeric_detection} */ + @Nonnull public final Builder numericDetection(@Nullable Boolean value) { this.numericDetection = value; return this; @@ -576,6 +652,7 @@ public final Builder numericDetection(@Nullable Boolean value) { * Adds all elements of map to properties. *

*/ + @Nonnull public final Builder properties(Map map) { this.properties = _mapPutAll(this.properties, map); return this; @@ -588,6 +665,7 @@ public final Builder properties(Map map) { * Adds an entry to properties. *

*/ + @Nonnull public final Builder properties(String key, Property value) { this.properties = _mapPut(this.properties, key, value); return this; @@ -600,6 +678,7 @@ public final Builder properties(String key, Property value) { * Adds a value to properties using a builder lambda. *

*/ + @Nonnull public final Builder properties(String key, Function> fn) { return properties(key, fn.apply(new Property.Builder()).build()); } @@ -607,6 +686,7 @@ public final Builder properties(String key, Function> fn) { return routing(fn.apply(new RoutingField.Builder()).build()); } @@ -622,6 +703,7 @@ public final Builder routing(Function> fn) { return size(fn.apply(new SizeField.Builder()).build()); } @@ -637,6 +720,7 @@ public final Builder size(Function> /** * API name: {@code _source} */ + @Nonnull public final Builder source(@Nullable SourceField value) { this.source = value; return this; @@ -645,6 +729,7 @@ public final Builder source(@Nullable SourceField value) { /** * API name: {@code _source} */ + @Nonnull public final Builder source(Function> fn) { return source(fn.apply(new SourceField.Builder()).build()); } @@ -654,6 +739,8 @@ public final Builder source(Function { @Nullable private final Number nullValue; @@ -97,31 +103,66 @@ protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { // --------------------------------------------------------------------------------------------- + @Override + @Nonnull + public Builder toBuilder() { + return new Builder(this); + } + + @Nonnull + public static Builder builder() { + return new Builder(); + } + /** * Builder for {@link UnsignedLongNumberProperty}. */ - public static class Builder extends NumberPropertyBase.AbstractBuilder implements ObjectBuilder { + public static class Builder extends NumberPropertyBase.AbstractBuilder + implements + CopyableBuilder { @Nullable private Number nullValue; + public Builder() {} + + private Builder(UnsignedLongNumberProperty o) { + super(o); + this.nullValue = o.nullValue; + } + + private Builder(Builder o) { + super(o); + this.nullValue = o.nullValue; + } + + @Override + @Nonnull + public Builder copy() { + return new Builder(this); + } + + @Override + @Nonnull + protected Builder self() { + return this; + } + /** * API name: {@code null_value} */ + @Nonnull public final Builder nullValue(@Nullable Number value) { this.nullValue = value; return this; } - @Override - protected Builder self() { - return this; - } - /** * Builds a {@link UnsignedLongNumberProperty}. * * @throws NullPointerException if some of the required fields are null. */ + @Override + @Nonnull public UnsignedLongNumberProperty build() { _checkSingleUse(); diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/mapping/VersionProperty.java b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/mapping/VersionProperty.java index 70acaf7713..1a7b0dda00 100644 --- a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/mapping/VersionProperty.java +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/mapping/VersionProperty.java @@ -39,18 +39,24 @@ 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.util.CopyableBuilder; import org.opensearch.client.util.ObjectBuilder; +import org.opensearch.client.util.ToCopyableBuilder; // typedef: _types.mapping.VersionProperty @JsonpDeserializable @Generated("org.opensearch.client.codegen.CodeGenerator") -public class VersionProperty extends DocValuesPropertyBase implements PropertyVariant { +public class VersionProperty extends DocValuesPropertyBase + implements + PropertyVariant, + ToCopyableBuilder { // --------------------------------------------------------------------------------------------- @@ -77,12 +83,42 @@ protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { // --------------------------------------------------------------------------------------------- + @Override + @Nonnull + public Builder toBuilder() { + return new Builder(this); + } + + @Nonnull + public static Builder builder() { + return new Builder(); + } + /** * Builder for {@link VersionProperty}. */ - public static class Builder extends DocValuesPropertyBase.AbstractBuilder implements ObjectBuilder { + public static class Builder extends DocValuesPropertyBase.AbstractBuilder + implements + CopyableBuilder { + + public Builder() {} + + private Builder(VersionProperty o) { + super(o); + } + + private Builder(Builder o) { + super(o); + } @Override + @Nonnull + public Builder copy() { + return new Builder(this); + } + + @Override + @Nonnull protected Builder self() { return this; } @@ -92,6 +128,8 @@ protected Builder self() { * * @throws NullPointerException if some of the required fields are null. */ + @Override + @Nonnull public VersionProperty build() { _checkSingleUse(); diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/mapping/WildcardProperty.java b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/mapping/WildcardProperty.java index 99c3adc293..4cd3458271 100644 --- a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/mapping/WildcardProperty.java +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/mapping/WildcardProperty.java @@ -40,19 +40,25 @@ 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.util.CopyableBuilder; import org.opensearch.client.util.ObjectBuilder; +import org.opensearch.client.util.ToCopyableBuilder; // typedef: _types.mapping.WildcardProperty @JsonpDeserializable @Generated("org.opensearch.client.codegen.CodeGenerator") -public class WildcardProperty extends DocValuesPropertyBase implements PropertyVariant { +public class WildcardProperty extends DocValuesPropertyBase + implements + PropertyVariant, + ToCopyableBuilder { @Nullable private final String nullValue; @@ -95,31 +101,66 @@ protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { // --------------------------------------------------------------------------------------------- + @Override + @Nonnull + public Builder toBuilder() { + return new Builder(this); + } + + @Nonnull + public static Builder builder() { + return new Builder(); + } + /** * Builder for {@link WildcardProperty}. */ - public static class Builder extends DocValuesPropertyBase.AbstractBuilder implements ObjectBuilder { + public static class Builder extends DocValuesPropertyBase.AbstractBuilder + implements + CopyableBuilder { @Nullable private String nullValue; + public Builder() {} + + private Builder(WildcardProperty o) { + super(o); + this.nullValue = o.nullValue; + } + + private Builder(Builder o) { + super(o); + this.nullValue = o.nullValue; + } + + @Override + @Nonnull + public Builder copy() { + return new Builder(this); + } + + @Override + @Nonnull + protected Builder self() { + return this; + } + /** * API name: {@code null_value} */ + @Nonnull public final Builder nullValue(@Nullable String value) { this.nullValue = value; return this; } - @Override - protected Builder self() { - return this; - } - /** * Builds a {@link WildcardProperty}. * * @throws NullPointerException if some of the required fields are null. */ + @Override + @Nonnull public WildcardProperty build() { _checkSingleUse(); diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/mapping/XyPointProperty.java b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/mapping/XyPointProperty.java index b670bd596e..1b317629fa 100644 --- a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/mapping/XyPointProperty.java +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/mapping/XyPointProperty.java @@ -16,6 +16,7 @@ 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; @@ -23,13 +24,18 @@ import org.opensearch.client.json.ObjectBuilderDeserializer; import org.opensearch.client.json.ObjectDeserializer; import org.opensearch.client.opensearch._types.XyLocation; +import org.opensearch.client.util.CopyableBuilder; import org.opensearch.client.util.ObjectBuilder; +import org.opensearch.client.util.ToCopyableBuilder; // typedef: _types.mapping.XyPointProperty @JsonpDeserializable @Generated("org.opensearch.client.codegen.CodeGenerator") -public class XyPointProperty extends DocValuesPropertyBase implements PropertyVariant { +public class XyPointProperty extends DocValuesPropertyBase + implements + PropertyVariant, + ToCopyableBuilder { @Nullable private final Boolean ignoreMalformed; @@ -106,10 +112,23 @@ protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { // --------------------------------------------------------------------------------------------- + @Override + @Nonnull + public Builder toBuilder() { + return new Builder(this); + } + + @Nonnull + public static Builder builder() { + return new Builder(); + } + /** * Builder for {@link XyPointProperty}. */ - public static class Builder extends DocValuesPropertyBase.AbstractBuilder implements ObjectBuilder { + public static class Builder extends DocValuesPropertyBase.AbstractBuilder + implements + CopyableBuilder { @Nullable private Boolean ignoreMalformed; @Nullable @@ -117,9 +136,38 @@ public static class Builder extends DocValuesPropertyBase.AbstractBuilder> fn) { return nullValue(fn.apply(new XyLocation.Builder()).build()); } - @Override - protected Builder self() { - return this; - } - /** * Builds a {@link XyPointProperty}. * * @throws NullPointerException if some of the required fields are null. */ + @Override + @Nonnull public XyPointProperty build() { _checkSingleUse(); diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/mapping/XyShapeProperty.java b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/mapping/XyShapeProperty.java index 4b23ad9f4b..d6cc025c63 100644 --- a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/mapping/XyShapeProperty.java +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/mapping/XyShapeProperty.java @@ -16,19 +16,25 @@ 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.util.CopyableBuilder; import org.opensearch.client.util.ObjectBuilder; +import org.opensearch.client.util.ToCopyableBuilder; // typedef: _types.mapping.XyShapeProperty @JsonpDeserializable @Generated("org.opensearch.client.codegen.CodeGenerator") -public class XyShapeProperty extends DocValuesPropertyBase implements PropertyVariant { +public class XyShapeProperty extends DocValuesPropertyBase + implements + PropertyVariant, + ToCopyableBuilder { @Nullable private final Boolean coerce; @@ -122,10 +128,23 @@ protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { // --------------------------------------------------------------------------------------------- + @Override + @Nonnull + public Builder toBuilder() { + return new Builder(this); + } + + @Nonnull + public static Builder builder() { + return new Builder(); + } + /** * Builder for {@link XyShapeProperty}. */ - public static class Builder extends DocValuesPropertyBase.AbstractBuilder implements ObjectBuilder { + public static class Builder extends DocValuesPropertyBase.AbstractBuilder + implements + CopyableBuilder { @Nullable private Boolean coerce; @Nullable @@ -135,9 +154,40 @@ public static class Builder extends DocValuesPropertyBase.AbstractBuilder { @Nonnull private final String clusterName; @@ -155,19 +157,55 @@ protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { // --------------------------------------------------------------------------------------------- + @Override + @Nonnull + public Builder toBuilder() { + return new Builder(this); + } + + @Nonnull + public static Builder builder() { + return new Builder(); + } + /** * Builder for {@link InfoResponse}. */ - public static class Builder extends ObjectBuilderBase implements ObjectBuilder { + public static class Builder extends ObjectBuilderBase implements CopyableBuilder { private String clusterName; private String clusterUuid; private String name; private String tagline; private OpenSearchVersionInfo version; + public Builder() {} + + private Builder(InfoResponse o) { + this.clusterName = o.clusterName; + this.clusterUuid = o.clusterUuid; + this.name = o.name; + this.tagline = o.tagline; + this.version = o.version; + } + + private Builder(Builder o) { + this.clusterName = o.clusterName; + this.clusterUuid = o.clusterUuid; + this.name = o.name; + this.tagline = o.tagline; + this.version = o.version; + } + + @Override + @Nonnull + public Builder copy() { + return new Builder(this); + } + /** * Required - API name: {@code cluster_name} */ + @Nonnull public final Builder clusterName(String value) { this.clusterName = value; return this; @@ -176,6 +214,7 @@ public final Builder clusterName(String value) { /** * Required - API name: {@code cluster_uuid} */ + @Nonnull public final Builder clusterUuid(String value) { this.clusterUuid = value; return this; @@ -184,6 +223,7 @@ public final Builder clusterUuid(String value) { /** * Required - API name: {@code name} */ + @Nonnull public final Builder name(String value) { this.name = value; return this; @@ -192,6 +232,7 @@ public final Builder name(String value) { /** * Required - API name: {@code tagline} */ + @Nonnull public final Builder tagline(String value) { this.tagline = value; return this; @@ -200,6 +241,7 @@ public final Builder tagline(String value) { /** * Required - API name: {@code version} */ + @Nonnull public final Builder version(OpenSearchVersionInfo value) { this.version = value; return this; @@ -208,6 +250,7 @@ public final Builder version(OpenSearchVersionInfo value) { /** * Required - API name: {@code version} */ + @Nonnull public final Builder version(Function> fn) { return version(fn.apply(new OpenSearchVersionInfo.Builder()).build()); } @@ -217,6 +260,8 @@ public final Builder version(Function { private final boolean acceptDataLoss; @@ -92,7 +96,7 @@ public static DeleteDanglingIndexRequest of( } /** - * Required - Must be set to true in order to delete the dangling index + * Required - Must be set to true in order to delete the dangling index. *

* API name: {@code accept_data_loss} *

@@ -113,7 +117,7 @@ public final Time clusterManagerTimeout() { } /** - * Required - The UUID of the dangling index + * Required - The UUID of the dangling index. *

* API name: {@code index_uuid} *

@@ -124,7 +128,7 @@ public final String indexUuid() { } /** - * Specify timeout for connection to master + * Specify timeout for connection to cluster manager. *

* API name: {@code master_timeout} *

@@ -136,7 +140,7 @@ public final Time masterTimeout() { } /** - * Explicit operation timeout + * Explicit operation timeout. *

* API name: {@code timeout} *

@@ -148,10 +152,21 @@ public final Time timeout() { // --------------------------------------------------------------------------------------------- + @Override + @Nonnull + public Builder toBuilder() { + return new Builder(this); + } + + @Nonnull + public static Builder builder() { + return new Builder(); + } + /** * Builder for {@link DeleteDanglingIndexRequest}. */ - public static class Builder extends ObjectBuilderBase implements ObjectBuilder { + public static class Builder extends ObjectBuilderBase implements CopyableBuilder { private Boolean acceptDataLoss; @Nullable private Time clusterManagerTimeout; @@ -161,12 +176,37 @@ public static class Builder extends ObjectBuilderBase implements ObjectBuilder * API name: {@code accept_data_loss} *

*/ + @Nonnull public final Builder acceptDataLoss(boolean value) { this.acceptDataLoss = value; return this; @@ -178,6 +218,7 @@ public final Builder acceptDataLoss(boolean value) { * API name: {@code cluster_manager_timeout} *

*/ + @Nonnull public final Builder clusterManagerTimeout(@Nullable Time value) { this.clusterManagerTimeout = value; return this; @@ -189,61 +230,67 @@ public final Builder clusterManagerTimeout(@Nullable Time value) { * API name: {@code cluster_manager_timeout} *

*/ + @Nonnull public final Builder clusterManagerTimeout(Function> fn) { return clusterManagerTimeout(fn.apply(new Time.Builder()).build()); } /** - * Required - The UUID of the dangling index + * Required - The UUID of the dangling index. *

* API name: {@code index_uuid} *

*/ + @Nonnull public final Builder indexUuid(String value) { this.indexUuid = value; return this; } /** - * Specify timeout for connection to master + * Specify timeout for connection to cluster manager. *

* API name: {@code master_timeout} *

*/ @Deprecated + @Nonnull public final Builder masterTimeout(@Nullable Time value) { this.masterTimeout = value; return this; } /** - * Specify timeout for connection to master + * Specify timeout for connection to cluster manager. *

* API name: {@code master_timeout} *

*/ @Deprecated + @Nonnull public final Builder masterTimeout(Function> fn) { return masterTimeout(fn.apply(new Time.Builder()).build()); } /** - * Explicit operation timeout + * Explicit operation timeout. *

* API name: {@code timeout} *

*/ + @Nonnull public final Builder timeout(@Nullable Time value) { this.timeout = value; return this; } /** - * Explicit operation timeout + * Explicit operation timeout. *

* API name: {@code timeout} *

*/ + @Nonnull public final Builder timeout(Function> fn) { return timeout(fn.apply(new Time.Builder()).build()); } @@ -253,6 +300,8 @@ public final Builder timeout(Function> fn) { * * @throws NullPointerException if some of the required fields are null. */ + @Override + @Nonnull public DeleteDanglingIndexRequest build() { _checkSingleUse(); diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/dangling_indices/DeleteDanglingIndexResponse.java b/java-client/src/generated/java/org/opensearch/client/opensearch/dangling_indices/DeleteDanglingIndexResponse.java index 3a946805d7..dbc7e10570 100644 --- a/java-client/src/generated/java/org/opensearch/client/opensearch/dangling_indices/DeleteDanglingIndexResponse.java +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/dangling_indices/DeleteDanglingIndexResponse.java @@ -38,18 +38,23 @@ 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.ObjectBuilderDeserializer; import org.opensearch.client.json.ObjectDeserializer; import org.opensearch.client.opensearch._types.AcknowledgedResponseBase; +import org.opensearch.client.util.CopyableBuilder; import org.opensearch.client.util.ObjectBuilder; +import org.opensearch.client.util.ToCopyableBuilder; // typedef: dangling_indices.delete_dangling_index.Response @JsonpDeserializable @Generated("org.opensearch.client.codegen.CodeGenerator") -public class DeleteDanglingIndexResponse extends AcknowledgedResponseBase { +public class DeleteDanglingIndexResponse extends AcknowledgedResponseBase + implements + ToCopyableBuilder { // --------------------------------------------------------------------------------------------- @@ -65,14 +70,42 @@ public static DeleteDanglingIndexResponse of( // --------------------------------------------------------------------------------------------- + @Override + @Nonnull + public Builder toBuilder() { + return new Builder(this); + } + + @Nonnull + public static Builder builder() { + return new Builder(); + } + /** * Builder for {@link DeleteDanglingIndexResponse}. */ public static class Builder extends AcknowledgedResponseBase.AbstractBuilder implements - ObjectBuilder { + CopyableBuilder { + + public Builder() {} + + private Builder(DeleteDanglingIndexResponse o) { + super(o); + } + + private Builder(Builder o) { + super(o); + } @Override + @Nonnull + public Builder copy() { + return new Builder(this); + } + + @Override + @Nonnull protected Builder self() { return this; } @@ -82,6 +115,8 @@ protected Builder self() { * * @throws NullPointerException if some of the required fields are null. */ + @Override + @Nonnull public DeleteDanglingIndexResponse build() { _checkSingleUse(); diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/dangling_indices/ImportDanglingIndexRequest.java b/java-client/src/generated/java/org/opensearch/client/opensearch/dangling_indices/ImportDanglingIndexRequest.java index bcdcf7e720..1193c30050 100644 --- a/java-client/src/generated/java/org/opensearch/client/opensearch/dangling_indices/ImportDanglingIndexRequest.java +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/dangling_indices/ImportDanglingIndexRequest.java @@ -49,8 +49,10 @@ import org.opensearch.client.transport.Endpoint; import org.opensearch.client.transport.endpoints.SimpleEndpoint; 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: dangling_indices.import_dangling_index.Request @@ -58,7 +60,9 @@ * Imports the specified dangling index. */ @Generated("org.opensearch.client.codegen.CodeGenerator") -public class ImportDanglingIndexRequest extends RequestBase { +public class ImportDanglingIndexRequest extends RequestBase + implements + ToCopyableBuilder { private final boolean acceptDataLoss; @@ -92,7 +96,7 @@ public static ImportDanglingIndexRequest of( } /** - * Required - Must be set to true in order to import the dangling index + * Required - Must be set to true in order to import the dangling index. *

* API name: {@code accept_data_loss} *

@@ -113,7 +117,7 @@ public final Time clusterManagerTimeout() { } /** - * Required - The UUID of the dangling index + * Required - The UUID of the dangling index. *

* API name: {@code index_uuid} *

@@ -124,7 +128,7 @@ public final String indexUuid() { } /** - * Specify timeout for connection to master + * Specify timeout for connection to cluster manager. *

* API name: {@code master_timeout} *

@@ -136,7 +140,7 @@ public final Time masterTimeout() { } /** - * Explicit operation timeout + * Explicit operation timeout. *

* API name: {@code timeout} *

@@ -148,10 +152,21 @@ public final Time timeout() { // --------------------------------------------------------------------------------------------- + @Override + @Nonnull + public Builder toBuilder() { + return new Builder(this); + } + + @Nonnull + public static Builder builder() { + return new Builder(); + } + /** * Builder for {@link ImportDanglingIndexRequest}. */ - public static class Builder extends ObjectBuilderBase implements ObjectBuilder { + public static class Builder extends ObjectBuilderBase implements CopyableBuilder { private Boolean acceptDataLoss; @Nullable private Time clusterManagerTimeout; @@ -161,12 +176,37 @@ public static class Builder extends ObjectBuilderBase implements ObjectBuilder * API name: {@code accept_data_loss} *

*/ + @Nonnull public final Builder acceptDataLoss(boolean value) { this.acceptDataLoss = value; return this; @@ -178,6 +218,7 @@ public final Builder acceptDataLoss(boolean value) { * API name: {@code cluster_manager_timeout} *

*/ + @Nonnull public final Builder clusterManagerTimeout(@Nullable Time value) { this.clusterManagerTimeout = value; return this; @@ -189,61 +230,67 @@ public final Builder clusterManagerTimeout(@Nullable Time value) { * API name: {@code cluster_manager_timeout} *

*/ + @Nonnull public final Builder clusterManagerTimeout(Function> fn) { return clusterManagerTimeout(fn.apply(new Time.Builder()).build()); } /** - * Required - The UUID of the dangling index + * Required - The UUID of the dangling index. *

* API name: {@code index_uuid} *

*/ + @Nonnull public final Builder indexUuid(String value) { this.indexUuid = value; return this; } /** - * Specify timeout for connection to master + * Specify timeout for connection to cluster manager. *

* API name: {@code master_timeout} *

*/ @Deprecated + @Nonnull public final Builder masterTimeout(@Nullable Time value) { this.masterTimeout = value; return this; } /** - * Specify timeout for connection to master + * Specify timeout for connection to cluster manager. *

* API name: {@code master_timeout} *

*/ @Deprecated + @Nonnull public final Builder masterTimeout(Function> fn) { return masterTimeout(fn.apply(new Time.Builder()).build()); } /** - * Explicit operation timeout + * Explicit operation timeout. *

* API name: {@code timeout} *

*/ + @Nonnull public final Builder timeout(@Nullable Time value) { this.timeout = value; return this; } /** - * Explicit operation timeout + * Explicit operation timeout. *

* API name: {@code timeout} *

*/ + @Nonnull public final Builder timeout(Function> fn) { return timeout(fn.apply(new Time.Builder()).build()); } @@ -253,6 +300,8 @@ public final Builder timeout(Function> fn) { * * @throws NullPointerException if some of the required fields are null. */ + @Override + @Nonnull public ImportDanglingIndexRequest build() { _checkSingleUse(); diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/dangling_indices/ImportDanglingIndexResponse.java b/java-client/src/generated/java/org/opensearch/client/opensearch/dangling_indices/ImportDanglingIndexResponse.java index d974191cda..d760471404 100644 --- a/java-client/src/generated/java/org/opensearch/client/opensearch/dangling_indices/ImportDanglingIndexResponse.java +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/dangling_indices/ImportDanglingIndexResponse.java @@ -38,18 +38,23 @@ 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.ObjectBuilderDeserializer; import org.opensearch.client.json.ObjectDeserializer; import org.opensearch.client.opensearch._types.AcknowledgedResponseBase; +import org.opensearch.client.util.CopyableBuilder; import org.opensearch.client.util.ObjectBuilder; +import org.opensearch.client.util.ToCopyableBuilder; // typedef: dangling_indices.import_dangling_index.Response @JsonpDeserializable @Generated("org.opensearch.client.codegen.CodeGenerator") -public class ImportDanglingIndexResponse extends AcknowledgedResponseBase { +public class ImportDanglingIndexResponse extends AcknowledgedResponseBase + implements + ToCopyableBuilder { // --------------------------------------------------------------------------------------------- @@ -65,14 +70,42 @@ public static ImportDanglingIndexResponse of( // --------------------------------------------------------------------------------------------- + @Override + @Nonnull + public Builder toBuilder() { + return new Builder(this); + } + + @Nonnull + public static Builder builder() { + return new Builder(); + } + /** * Builder for {@link ImportDanglingIndexResponse}. */ public static class Builder extends AcknowledgedResponseBase.AbstractBuilder implements - ObjectBuilder { + CopyableBuilder { + + public Builder() {} + + private Builder(ImportDanglingIndexResponse o) { + super(o); + } + + private Builder(Builder o) { + super(o); + } @Override + @Nonnull + public Builder copy() { + return new Builder(this); + } + + @Override + @Nonnull protected Builder self() { return this; } @@ -82,6 +115,8 @@ protected Builder self() { * * @throws NullPointerException if some of the required fields are null. */ + @Override + @Nonnull public ImportDanglingIndexResponse build() { _checkSingleUse(); diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/dangling_indices/ListDanglingIndicesResponse.java b/java-client/src/generated/java/org/opensearch/client/opensearch/dangling_indices/ListDanglingIndicesResponse.java index f3d6b0e9a2..8ab1dda908 100644 --- a/java-client/src/generated/java/org/opensearch/client/opensearch/dangling_indices/ListDanglingIndicesResponse.java +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/dangling_indices/ListDanglingIndicesResponse.java @@ -52,14 +52,19 @@ import org.opensearch.client.opensearch._types.NodeStatistics; import org.opensearch.client.opensearch.dangling_indices.list_dangling_indices.DanglingIndex; 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: dangling_indices.list_dangling_indices.Response @JsonpDeserializable @Generated("org.opensearch.client.codegen.CodeGenerator") -public class ListDanglingIndicesResponse implements PlainJsonSerializable { +public class ListDanglingIndicesResponse + implements + PlainJsonSerializable, + ToCopyableBuilder { @Nullable private final String clusterName; @@ -139,19 +144,51 @@ protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { // --------------------------------------------------------------------------------------------- + @Override + @Nonnull + public Builder toBuilder() { + return new Builder(this); + } + + @Nonnull + public static Builder builder() { + return new Builder(); + } + /** * Builder for {@link ListDanglingIndicesResponse}. */ - public static class Builder extends ObjectBuilderBase implements ObjectBuilder { + public static class Builder extends ObjectBuilderBase implements CopyableBuilder { @Nullable private String clusterName; private List danglingIndices; @Nullable private NodeStatistics nodes; + public Builder() {} + + private Builder(ListDanglingIndicesResponse o) { + this.clusterName = o.clusterName; + this.danglingIndices = _listCopy(o.danglingIndices); + this.nodes = o.nodes; + } + + private Builder(Builder o) { + this.clusterName = o.clusterName; + this.danglingIndices = _listCopy(o.danglingIndices); + this.nodes = o.nodes; + } + + @Override + @Nonnull + public Builder copy() { + return new Builder(this); + } + /** * API name: {@code cluster_name} */ + @Nonnull public final Builder clusterName(@Nullable String value) { this.clusterName = value; return this; @@ -164,6 +201,7 @@ public final Builder clusterName(@Nullable String value) { * Adds all elements of list to danglingIndices. *

*/ + @Nonnull public final Builder danglingIndices(List list) { this.danglingIndices = _listAddAll(this.danglingIndices, list); return this; @@ -176,6 +214,7 @@ public final Builder danglingIndices(List list) { * Adds one or more values to danglingIndices. *

*/ + @Nonnull public final Builder danglingIndices(DanglingIndex value, DanglingIndex... values) { this.danglingIndices = _listAdd(this.danglingIndices, value, values); return this; @@ -188,6 +227,7 @@ public final Builder danglingIndices(DanglingIndex value, DanglingIndex... value * Adds a value to danglingIndices using a builder lambda. *

*/ + @Nonnull public final Builder danglingIndices(Function> fn) { return danglingIndices(fn.apply(new DanglingIndex.Builder()).build()); } @@ -195,6 +235,7 @@ public final Builder danglingIndices(Function> fn) { return nodes(fn.apply(new NodeStatistics.Builder()).build()); } @@ -212,6 +254,8 @@ public final Builder nodes(Function { @Nullable private final String creationDate; @@ -161,10 +163,21 @@ protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { // --------------------------------------------------------------------------------------------- + @Override + @Nonnull + public Builder toBuilder() { + return new Builder(this); + } + + @Nonnull + public static Builder builder() { + return new Builder(); + } + /** * Builder for {@link DanglingIndex}. */ - public static class Builder extends ObjectBuilderBase implements ObjectBuilder { + public static class Builder extends ObjectBuilderBase implements CopyableBuilder { @Nullable private String creationDate; private Long creationDateMillis; @@ -172,9 +185,34 @@ public static class Builder extends ObjectBuilderBase implements ObjectBuilder nodeIds; + public Builder() {} + + private Builder(DanglingIndex o) { + this.creationDate = o.creationDate; + this.creationDateMillis = o.creationDateMillis; + this.indexName = o.indexName; + this.indexUuid = o.indexUuid; + this.nodeIds = _listCopy(o.nodeIds); + } + + private Builder(Builder o) { + this.creationDate = o.creationDate; + this.creationDateMillis = o.creationDateMillis; + this.indexName = o.indexName; + this.indexUuid = o.indexUuid; + this.nodeIds = _listCopy(o.nodeIds); + } + + @Override + @Nonnull + public Builder copy() { + return new Builder(this); + } + /** * API name: {@code creation_date} */ + @Nonnull public final Builder creationDate(@Nullable String value) { this.creationDate = value; return this; @@ -183,6 +221,7 @@ public final Builder creationDate(@Nullable String value) { /** * Required - API name: {@code creation_date_millis} */ + @Nonnull public final Builder creationDateMillis(long value) { this.creationDateMillis = value; return this; @@ -191,6 +230,7 @@ public final Builder creationDateMillis(long value) { /** * Required - API name: {@code index_name} */ + @Nonnull public final Builder indexName(String value) { this.indexName = value; return this; @@ -199,6 +239,7 @@ public final Builder indexName(String value) { /** * Required - API name: {@code index_uuid} */ + @Nonnull public final Builder indexUuid(String value) { this.indexUuid = value; return this; @@ -211,6 +252,7 @@ public final Builder indexUuid(String value) { * Adds all elements of list to nodeIds. *

*/ + @Nonnull public final Builder nodeIds(List list) { this.nodeIds = _listAddAll(this.nodeIds, list); return this; @@ -223,6 +265,7 @@ public final Builder nodeIds(List list) { * Adds one or more values to nodeIds. *

*/ + @Nonnull public final Builder nodeIds(String value, String... values) { this.nodeIds = _listAdd(this.nodeIds, value, values); return this; @@ -233,6 +276,8 @@ public final Builder nodeIds(String value, String... values) { * * @throws NullPointerException if some of the required fields are null. */ + @Override + @Nonnull public DanglingIndex build() { _checkSingleUse(); diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/indices/Alias.java b/java-client/src/generated/java/org/opensearch/client/opensearch/indices/Alias.java index c3eb6daf64..802f01e16f 100644 --- a/java-client/src/generated/java/org/opensearch/client/opensearch/indices/Alias.java +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/indices/Alias.java @@ -40,6 +40,7 @@ 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; @@ -48,14 +49,16 @@ import org.opensearch.client.json.ObjectDeserializer; import org.opensearch.client.json.PlainJsonSerializable; import org.opensearch.client.opensearch._types.query_dsl.Query; +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.Alias @JsonpDeserializable @Generated("org.opensearch.client.codegen.CodeGenerator") -public class Alias implements PlainJsonSerializable { +public class Alias implements PlainJsonSerializable, ToCopyableBuilder { @Nullable private final Query filter; @@ -188,10 +191,21 @@ protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { // --------------------------------------------------------------------------------------------- + @Override + @Nonnull + public Builder toBuilder() { + return new Builder(this); + } + + @Nonnull + public static Builder builder() { + return new Builder(); + } + /** * Builder for {@link Alias}. */ - public static class Builder extends ObjectBuilderBase implements ObjectBuilder { + public static class Builder extends ObjectBuilderBase implements CopyableBuilder { @Nullable private Query filter; @Nullable @@ -205,9 +219,36 @@ public static class Builder extends ObjectBuilderBase implements ObjectBuilder
> fn) { return filter(fn.apply(new Query.Builder()).build()); } @@ -223,6 +265,7 @@ public final Builder filter(Function> fn) { /** * API name: {@code index_routing} */ + @Nonnull public final Builder indexRouting(@Nullable String value) { this.indexRouting = value; return this; @@ -234,6 +277,7 @@ public final Builder indexRouting(@Nullable String value) { * API name: {@code is_hidden} *

*/ + @Nonnull public final Builder isHidden(@Nullable Boolean value) { this.isHidden = value; return this; @@ -245,6 +289,7 @@ public final Builder isHidden(@Nullable Boolean value) { * API name: {@code is_write_index} *

*/ + @Nonnull public final Builder isWriteIndex(@Nullable Boolean value) { this.isWriteIndex = value; return this; @@ -253,6 +298,7 @@ public final Builder isWriteIndex(@Nullable Boolean value) { /** * API name: {@code routing} */ + @Nonnull public final Builder routing(@Nullable String value) { this.routing = value; return this; @@ -261,6 +307,7 @@ public final Builder routing(@Nullable String value) { /** * API name: {@code search_routing} */ + @Nonnull public final Builder searchRouting(@Nullable String value) { this.searchRouting = value; return this; @@ -271,6 +318,8 @@ public final Builder searchRouting(@Nullable String value) { * * @throws NullPointerException if some of the required fields are null. */ + @Override + @Nonnull public Alias build() { _checkSingleUse(); diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/indices/CreateIndexRequest.java b/java-client/src/generated/java/org/opensearch/client/opensearch/indices/CreateIndexRequest.java index f6676b3bf2..16c944e238 100644 --- a/java-client/src/generated/java/org/opensearch/client/opensearch/indices/CreateIndexRequest.java +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/indices/CreateIndexRequest.java @@ -58,8 +58,10 @@ import org.opensearch.client.transport.Endpoint; import org.opensearch.client.transport.endpoints.SimpleEndpoint; 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.create.Request @@ -68,7 +70,10 @@ */ @JsonpDeserializable @Generated("org.opensearch.client.codegen.CodeGenerator") -public class CreateIndexRequest extends RequestBase implements PlainJsonSerializable { +public class CreateIndexRequest extends RequestBase + implements + PlainJsonSerializable, + ToCopyableBuilder { @Nonnull private final Map aliases; @@ -154,8 +159,8 @@ public final TypeMapping mappings() { } /** - * Period to wait for a connection to the master node. If no response is received before the timeout expires, the request fails and - * returns an error. + * Period to wait for a connection to the cluster-manager node. If no response is received before the timeout expires, the request fails + * and returns an error. *

* API name: {@code master_timeout} *

@@ -230,10 +235,21 @@ protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { } // --------------------------------------------------------------------------------------------- + @Override + @Nonnull + public Builder toBuilder() { + return new Builder(this); + } + + @Nonnull + public static Builder builder() { + return new Builder(); + } + /** * Builder for {@link CreateIndexRequest}. */ - public static class Builder extends ObjectBuilderBase implements ObjectBuilder { + public static class Builder extends ObjectBuilderBase implements CopyableBuilder { @Nullable private Map aliases; @Nullable @@ -250,6 +266,36 @@ public static class Builder extends ObjectBuilderBase implements ObjectBuilder @@ -260,6 +306,7 @@ public static class Builder extends ObjectBuilderBase implements ObjectBuildermap to aliases. *

*/ + @Nonnull public final Builder aliases(Map map) { this.aliases = _mapPutAll(this.aliases, map); return this; @@ -275,6 +322,7 @@ public final Builder aliases(Map map) { * Adds an entry to aliases. *

*/ + @Nonnull public final Builder aliases(String key, Alias value) { this.aliases = _mapPut(this.aliases, key, value); return this; @@ -290,6 +338,7 @@ public final Builder aliases(String key, Alias value) { * Adds a value to aliases using a builder lambda. *

*/ + @Nonnull public final Builder aliases(String key, Function> fn) { return aliases(key, fn.apply(new Alias.Builder()).build()); } @@ -300,6 +349,7 @@ public final Builder aliases(String key, Function */ + @Nonnull public final Builder clusterManagerTimeout(@Nullable Time value) { this.clusterManagerTimeout = value; return this; @@ -311,6 +361,7 @@ public final Builder clusterManagerTimeout(@Nullable Time value) { * API name: {@code cluster_manager_timeout} *

*/ + @Nonnull public final Builder clusterManagerTimeout(Function> fn) { return clusterManagerTimeout(fn.apply(new Time.Builder()).build()); } @@ -321,6 +372,7 @@ public final Builder clusterManagerTimeout(Function */ + @Nonnull public final Builder index(String value) { this.index = value; return this; @@ -329,6 +381,7 @@ public final Builder index(String value) { /** * API name: {@code mappings} */ + @Nonnull public final Builder mappings(@Nullable TypeMapping value) { this.mappings = value; return this; @@ -337,31 +390,34 @@ public final Builder mappings(@Nullable TypeMapping value) { /** * API name: {@code mappings} */ + @Nonnull public final Builder mappings(Function> fn) { return mappings(fn.apply(new TypeMapping.Builder()).build()); } /** - * Period to wait for a connection to the master node. If no response is received before the timeout expires, the request fails and - * returns an error. + * Period to wait for a connection to the cluster-manager node. If no response is received before the timeout expires, the request + * fails and returns an error. *

* API name: {@code master_timeout} *

*/ @Deprecated + @Nonnull public final Builder masterTimeout(@Nullable Time value) { this.masterTimeout = value; return this; } /** - * Period to wait for a connection to the master node. If no response is received before the timeout expires, the request fails and - * returns an error. + * Period to wait for a connection to the cluster-manager node. If no response is received before the timeout expires, the request + * fails and returns an error. *

* API name: {@code master_timeout} *

*/ @Deprecated + @Nonnull public final Builder masterTimeout(Function> fn) { return masterTimeout(fn.apply(new Time.Builder()).build()); } @@ -369,6 +425,7 @@ public final Builder masterTimeout(Function> f /** * API name: {@code settings} */ + @Nonnull public final Builder settings(@Nullable IndexSettings value) { this.settings = value; return this; @@ -377,6 +434,7 @@ public final Builder settings(@Nullable IndexSettings value) { /** * API name: {@code settings} */ + @Nonnull public final Builder settings(Function> fn) { return settings(fn.apply(new IndexSettings.Builder()).build()); } @@ -387,6 +445,7 @@ public final Builder settings(Function */ + @Nonnull public final Builder timeout(@Nullable Time value) { this.timeout = value; return this; @@ -398,6 +457,7 @@ public final Builder timeout(@Nullable Time value) { * API name: {@code timeout} *

*/ + @Nonnull public final Builder timeout(Function> fn) { return timeout(fn.apply(new Time.Builder()).build()); } @@ -409,6 +469,7 @@ public final Builder timeout(Function> fn) { * API name: {@code wait_for_active_shards} *

*/ + @Nonnull public final Builder waitForActiveShards(@Nullable WaitForActiveShards value) { this.waitForActiveShards = value; return this; @@ -421,6 +482,7 @@ public final Builder waitForActiveShards(@Nullable WaitForActiveShards value) { * API name: {@code wait_for_active_shards} *

*/ + @Nonnull public final Builder waitForActiveShards(Function> fn) { return waitForActiveShards(fn.apply(new WaitForActiveShards.Builder()).build()); } @@ -430,6 +492,8 @@ public final Builder waitForActiveShards(Function { private final boolean acknowledged; @@ -120,17 +122,49 @@ protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { // --------------------------------------------------------------------------------------------- + @Override + @Nonnull + public Builder toBuilder() { + return new Builder(this); + } + + @Nonnull + public static Builder builder() { + return new Builder(); + } + /** * Builder for {@link CreateIndexResponse}. */ - public static class Builder extends ObjectBuilderBase implements ObjectBuilder { + public static class Builder extends ObjectBuilderBase implements CopyableBuilder { private Boolean acknowledged; private String index; private Boolean shardsAcknowledged; + public Builder() {} + + private Builder(CreateIndexResponse o) { + this.acknowledged = o.acknowledged; + this.index = o.index; + this.shardsAcknowledged = o.shardsAcknowledged; + } + + private Builder(Builder o) { + this.acknowledged = o.acknowledged; + this.index = o.index; + this.shardsAcknowledged = o.shardsAcknowledged; + } + + @Override + @Nonnull + public Builder copy() { + return new Builder(this); + } + /** * Required - API name: {@code acknowledged} */ + @Nonnull public final Builder acknowledged(boolean value) { this.acknowledged = value; return this; @@ -139,6 +173,7 @@ public final Builder acknowledged(boolean value) { /** * Required - API name: {@code index} */ + @Nonnull public final Builder index(String value) { this.index = value; return this; @@ -147,6 +182,7 @@ public final Builder index(String value) { /** * Required - API name: {@code shards_acknowledged} */ + @Nonnull public final Builder shardsAcknowledged(boolean value) { this.shardsAcknowledged = value; return this; @@ -157,6 +193,8 @@ public final Builder shardsAcknowledged(boolean value) { * * @throws NullPointerException if some of the required fields are null. */ + @Override + @Nonnull public CreateIndexResponse build() { _checkSingleUse(); diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/indices/DataStreamTimestampField.java b/java-client/src/generated/java/org/opensearch/client/opensearch/indices/DataStreamTimestampField.java index 091eb86049..45edd35b56 100644 --- a/java-client/src/generated/java/org/opensearch/client/opensearch/indices/DataStreamTimestampField.java +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/indices/DataStreamTimestampField.java @@ -47,14 +47,19 @@ 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.DataStreamTimestampField @JsonpDeserializable @Generated("org.opensearch.client.codegen.CodeGenerator") -public class DataStreamTimestampField implements PlainJsonSerializable { +public class DataStreamTimestampField + implements + PlainJsonSerializable, + ToCopyableBuilder { @Nonnull private final String name; @@ -94,15 +99,43 @@ protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { // --------------------------------------------------------------------------------------------- + @Override + @Nonnull + public Builder toBuilder() { + return new Builder(this); + } + + @Nonnull + public static Builder builder() { + return new Builder(); + } + /** * Builder for {@link DataStreamTimestampField}. */ - public static class Builder extends ObjectBuilderBase implements ObjectBuilder { + public static class Builder extends ObjectBuilderBase implements CopyableBuilder { private String name; + public Builder() {} + + private Builder(DataStreamTimestampField o) { + this.name = o.name; + } + + private Builder(Builder o) { + this.name = o.name; + } + + @Override + @Nonnull + public Builder copy() { + return new Builder(this); + } + /** * Required - API name: {@code name} */ + @Nonnull public final Builder name(String value) { this.name = value; return this; @@ -113,6 +146,8 @@ public final Builder name(String value) { * * @throws NullPointerException if some of the required fields are null. */ + @Override + @Nonnull public DataStreamTimestampField build() { _checkSingleUse(); diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/indices/DeleteIndexRequest.java b/java-client/src/generated/java/org/opensearch/client/opensearch/indices/DeleteIndexRequest.java index eeeb6067b8..fa19cfbdda 100644 --- a/java-client/src/generated/java/org/opensearch/client/opensearch/indices/DeleteIndexRequest.java +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/indices/DeleteIndexRequest.java @@ -52,8 +52,10 @@ import org.opensearch.client.transport.Endpoint; import org.opensearch.client.transport.endpoints.SimpleEndpoint; 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.delete.Request @@ -61,7 +63,7 @@ * Deletes an index. */ @Generated("org.opensearch.client.codegen.CodeGenerator") -public class DeleteIndexRequest extends RequestBase { +public class DeleteIndexRequest extends RequestBase implements ToCopyableBuilder { @Nullable private final Boolean allowNoIndices; @@ -162,8 +164,8 @@ public final List index() { } /** - * Period to wait for a connection to the master node. If no response is received before the timeout expires, the request fails and - * returns an error. + * Period to wait for a connection to the cluster-manager node. If no response is received before the timeout expires, the request fails + * and returns an error. *

* API name: {@code master_timeout} *

@@ -187,10 +189,21 @@ public final Time timeout() { // --------------------------------------------------------------------------------------------- + @Override + @Nonnull + public Builder toBuilder() { + return new Builder(this); + } + + @Nonnull + public static Builder builder() { + return new Builder(); + } + /** * Builder for {@link DeleteIndexRequest}. */ - public static class Builder extends ObjectBuilderBase implements ObjectBuilder { + public static class Builder extends ObjectBuilderBase implements CopyableBuilder { @Nullable private Boolean allowNoIndices; @Nullable @@ -205,6 +218,34 @@ public static class Builder extends ObjectBuilderBase implements ObjectBuilderfalse, the request returns an error if any wildcard expression, index alias, or _all value targets * only missing or closed indexes. This behavior applies even if the request targets other open indexes. @@ -212,6 +253,7 @@ public static class Builder extends ObjectBuilderBase implements ObjectBuilder */ + @Nonnull public final Builder allowNoIndices(@Nullable Boolean value) { this.allowNoIndices = value; return this; @@ -223,6 +265,7 @@ public final Builder allowNoIndices(@Nullable Boolean value) { * API name: {@code cluster_manager_timeout} *

*/ + @Nonnull public final Builder clusterManagerTimeout(@Nullable Time value) { this.clusterManagerTimeout = value; return this; @@ -234,6 +277,7 @@ public final Builder clusterManagerTimeout(@Nullable Time value) { * API name: {@code cluster_manager_timeout} *

*/ + @Nonnull public final Builder clusterManagerTimeout(Function> fn) { return clusterManagerTimeout(fn.apply(new Time.Builder()).build()); } @@ -250,6 +294,7 @@ public final Builder clusterManagerTimeout(Functionlist to expandWildcards. *

*/ + @Nonnull public final Builder expandWildcards(List list) { this.expandWildcards = _listAddAll(this.expandWildcards, list); return this; @@ -267,6 +312,7 @@ public final Builder expandWildcards(List list) { * Adds one or more values to expandWildcards. *

*/ + @Nonnull public final Builder expandWildcards(ExpandWildcard value, ExpandWildcard... values) { this.expandWildcards = _listAdd(this.expandWildcards, value, values); return this; @@ -278,6 +324,7 @@ public final Builder expandWildcards(ExpandWildcard value, ExpandWildcard... val * API name: {@code ignore_unavailable} *

*/ + @Nonnull public final Builder ignoreUnavailable(@Nullable Boolean value) { this.ignoreUnavailable = value; return this; @@ -295,6 +342,7 @@ public final Builder ignoreUnavailable(@Nullable Boolean value) { * Adds all elements of list to index. *

*/ + @Nonnull public final Builder index(List list) { this.index = _listAddAll(this.index, list); return this; @@ -312,32 +360,35 @@ public final Builder index(List list) { * Adds one or more values to index. *

*/ + @Nonnull public final Builder index(String value, String... values) { this.index = _listAdd(this.index, value, values); return this; } /** - * Period to wait for a connection to the master node. If no response is received before the timeout expires, the request fails and - * returns an error. + * Period to wait for a connection to the cluster-manager node. If no response is received before the timeout expires, the request + * fails and returns an error. *

* API name: {@code master_timeout} *

*/ @Deprecated + @Nonnull public final Builder masterTimeout(@Nullable Time value) { this.masterTimeout = value; return this; } /** - * Period to wait for a connection to the master node. If no response is received before the timeout expires, the request fails and - * returns an error. + * Period to wait for a connection to the cluster-manager node. If no response is received before the timeout expires, the request + * fails and returns an error. *

* API name: {@code master_timeout} *

*/ @Deprecated + @Nonnull public final Builder masterTimeout(Function> fn) { return masterTimeout(fn.apply(new Time.Builder()).build()); } @@ -348,6 +399,7 @@ public final Builder masterTimeout(Function> f * API name: {@code timeout} *

*/ + @Nonnull public final Builder timeout(@Nullable Time value) { this.timeout = value; return this; @@ -359,6 +411,7 @@ public final Builder timeout(@Nullable Time value) { * API name: {@code timeout} *

*/ + @Nonnull public final Builder timeout(Function> fn) { return timeout(fn.apply(new Time.Builder()).build()); } @@ -368,6 +421,8 @@ public final Builder timeout(Function> fn) { * * @throws NullPointerException if some of the required fields are null. */ + @Override + @Nonnull public DeleteIndexRequest build() { _checkSingleUse(); diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/indices/DeleteIndexResponse.java b/java-client/src/generated/java/org/opensearch/client/opensearch/indices/DeleteIndexResponse.java index 1ddf2f9b6b..d09878e198 100644 --- a/java-client/src/generated/java/org/opensearch/client/opensearch/indices/DeleteIndexResponse.java +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/indices/DeleteIndexResponse.java @@ -38,18 +38,23 @@ 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.ObjectBuilderDeserializer; import org.opensearch.client.json.ObjectDeserializer; import org.opensearch.client.opensearch._types.IndicesResponseBase; +import org.opensearch.client.util.CopyableBuilder; import org.opensearch.client.util.ObjectBuilder; +import org.opensearch.client.util.ToCopyableBuilder; // typedef: indices.delete.Response @JsonpDeserializable @Generated("org.opensearch.client.codegen.CodeGenerator") -public class DeleteIndexResponse extends IndicesResponseBase { +public class DeleteIndexResponse extends IndicesResponseBase + implements + ToCopyableBuilder { // --------------------------------------------------------------------------------------------- @@ -63,12 +68,42 @@ public static DeleteIndexResponse of(Function implements ObjectBuilder { + public static class Builder extends IndicesResponseBase.AbstractBuilder + implements + CopyableBuilder { + + public Builder() {} + + private Builder(DeleteIndexResponse o) { + super(o); + } + + private Builder(Builder o) { + super(o); + } @Override + @Nonnull + public Builder copy() { + return new Builder(this); + } + + @Override + @Nonnull protected Builder self() { return this; } @@ -78,6 +113,8 @@ protected Builder self() { * * @throws NullPointerException if some of the required fields are null. */ + @Override + @Nonnull public DeleteIndexResponse build() { _checkSingleUse(); diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/indices/DeleteIndexTemplateRequest.java b/java-client/src/generated/java/org/opensearch/client/opensearch/indices/DeleteIndexTemplateRequest.java index 06356ca6b3..bca2da317d 100644 --- a/java-client/src/generated/java/org/opensearch/client/opensearch/indices/DeleteIndexTemplateRequest.java +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/indices/DeleteIndexTemplateRequest.java @@ -49,8 +49,10 @@ import org.opensearch.client.transport.Endpoint; import org.opensearch.client.transport.endpoints.SimpleEndpoint; 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.delete_index_template.Request @@ -58,7 +60,9 @@ * Deletes an index template. */ @Generated("org.opensearch.client.codegen.CodeGenerator") -public class DeleteIndexTemplateRequest extends RequestBase { +public class DeleteIndexTemplateRequest extends RequestBase + implements + ToCopyableBuilder { @Nullable private final Time clusterManagerTimeout; @@ -100,8 +104,8 @@ public final Time clusterManagerTimeout() { } /** - * Period to wait for a connection to the master node. If no response is received before the timeout expires, the request fails and - * returns an error. + * Period to wait for a connection to the cluster-manager node. If no response is received before the timeout expires, the request fails + * and returns an error. *

* API name: {@code master_timeout} *

@@ -136,10 +140,21 @@ public final Time timeout() { // --------------------------------------------------------------------------------------------- + @Override + @Nonnull + public Builder toBuilder() { + return new Builder(this); + } + + @Nonnull + public static Builder builder() { + return new Builder(); + } + /** * Builder for {@link DeleteIndexTemplateRequest}. */ - public static class Builder extends ObjectBuilderBase implements ObjectBuilder { + public static class Builder extends ObjectBuilderBase implements CopyableBuilder { @Nullable private Time clusterManagerTimeout; @Nullable @@ -148,12 +163,35 @@ public static class Builder extends ObjectBuilderBase implements ObjectBuilder * API name: {@code cluster_manager_timeout} *

*/ + @Nonnull public final Builder clusterManagerTimeout(@Nullable Time value) { this.clusterManagerTimeout = value; return this; @@ -165,31 +203,34 @@ public final Builder clusterManagerTimeout(@Nullable Time value) { * API name: {@code cluster_manager_timeout} *

*/ + @Nonnull public final Builder clusterManagerTimeout(Function> fn) { return clusterManagerTimeout(fn.apply(new Time.Builder()).build()); } /** - * Period to wait for a connection to the master node. If no response is received before the timeout expires, the request fails and - * returns an error. + * Period to wait for a connection to the cluster-manager node. If no response is received before the timeout expires, the request + * fails and returns an error. *

* API name: {@code master_timeout} *

*/ @Deprecated + @Nonnull public final Builder masterTimeout(@Nullable Time value) { this.masterTimeout = value; return this; } /** - * Period to wait for a connection to the master node. If no response is received before the timeout expires, the request fails and - * returns an error. + * Period to wait for a connection to the cluster-manager node. If no response is received before the timeout expires, the request + * fails and returns an error. *

* API name: {@code master_timeout} *

*/ @Deprecated + @Nonnull public final Builder masterTimeout(Function> fn) { return masterTimeout(fn.apply(new Time.Builder()).build()); } @@ -200,6 +241,7 @@ public final Builder masterTimeout(Function> f * API name: {@code name} *

*/ + @Nonnull public final Builder name(String value) { this.name = value; return this; @@ -211,6 +253,7 @@ public final Builder name(String value) { * API name: {@code timeout} *

*/ + @Nonnull public final Builder timeout(@Nullable Time value) { this.timeout = value; return this; @@ -222,6 +265,7 @@ public final Builder timeout(@Nullable Time value) { * API name: {@code timeout} *

*/ + @Nonnull public final Builder timeout(Function> fn) { return timeout(fn.apply(new Time.Builder()).build()); } @@ -231,6 +275,8 @@ public final Builder timeout(Function> fn) { * * @throws NullPointerException if some of the required fields are null. */ + @Override + @Nonnull public DeleteIndexTemplateRequest build() { _checkSingleUse(); diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/indices/DeleteIndexTemplateResponse.java b/java-client/src/generated/java/org/opensearch/client/opensearch/indices/DeleteIndexTemplateResponse.java index 0cc82ca5b8..92699daa62 100644 --- a/java-client/src/generated/java/org/opensearch/client/opensearch/indices/DeleteIndexTemplateResponse.java +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/indices/DeleteIndexTemplateResponse.java @@ -38,18 +38,23 @@ 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.ObjectBuilderDeserializer; import org.opensearch.client.json.ObjectDeserializer; import org.opensearch.client.opensearch._types.AcknowledgedResponseBase; +import org.opensearch.client.util.CopyableBuilder; import org.opensearch.client.util.ObjectBuilder; +import org.opensearch.client.util.ToCopyableBuilder; // typedef: indices.delete_index_template.Response @JsonpDeserializable @Generated("org.opensearch.client.codegen.CodeGenerator") -public class DeleteIndexTemplateResponse extends AcknowledgedResponseBase { +public class DeleteIndexTemplateResponse extends AcknowledgedResponseBase + implements + ToCopyableBuilder { // --------------------------------------------------------------------------------------------- @@ -65,14 +70,42 @@ public static DeleteIndexTemplateResponse of( // --------------------------------------------------------------------------------------------- + @Override + @Nonnull + public Builder toBuilder() { + return new Builder(this); + } + + @Nonnull + public static Builder builder() { + return new Builder(); + } + /** * Builder for {@link DeleteIndexTemplateResponse}. */ public static class Builder extends AcknowledgedResponseBase.AbstractBuilder implements - ObjectBuilder { + CopyableBuilder { + + public Builder() {} + + private Builder(DeleteIndexTemplateResponse o) { + super(o); + } + + private Builder(Builder o) { + super(o); + } @Override + @Nonnull + public Builder copy() { + return new Builder(this); + } + + @Override + @Nonnull protected Builder self() { return this; } @@ -82,6 +115,8 @@ protected Builder self() { * * @throws NullPointerException if some of the required fields are null. */ + @Override + @Nonnull public DeleteIndexTemplateResponse build() { _checkSingleUse(); diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/indices/ExistsIndexTemplateRequest.java b/java-client/src/generated/java/org/opensearch/client/opensearch/indices/ExistsIndexTemplateRequest.java index 8ea5da93d6..214c8333e3 100644 --- a/java-client/src/generated/java/org/opensearch/client/opensearch/indices/ExistsIndexTemplateRequest.java +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/indices/ExistsIndexTemplateRequest.java @@ -51,8 +51,10 @@ import org.opensearch.client.transport.endpoints.BooleanResponse; import org.opensearch.client.transport.endpoints.SimpleEndpoint; 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.exists_index_template.Request @@ -60,7 +62,9 @@ * Returns information about whether a particular index template exists. */ @Generated("org.opensearch.client.codegen.CodeGenerator") -public class ExistsIndexTemplateRequest extends RequestBase { +public class ExistsIndexTemplateRequest extends RequestBase + implements + ToCopyableBuilder { @Nullable private final Time clusterManagerTimeout; @@ -128,8 +132,8 @@ public final Boolean local() { } /** - * Period to wait for a connection to the master node. If no response is received before the timeout expires, the request fails and - * returns an error. + * Period to wait for a connection to the cluster-manager node. If no response is received before the timeout expires, the request fails + * and returns an error. *

* API name: {@code master_timeout} *

@@ -153,10 +157,21 @@ public final String name() { // --------------------------------------------------------------------------------------------- + @Override + @Nonnull + public Builder toBuilder() { + return new Builder(this); + } + + @Nonnull + public static Builder builder() { + return new Builder(); + } + /** * Builder for {@link ExistsIndexTemplateRequest}. */ - public static class Builder extends ObjectBuilderBase implements ObjectBuilder { + public static class Builder extends ObjectBuilderBase implements CopyableBuilder { @Nullable private Time clusterManagerTimeout; @Nullable @@ -167,12 +182,37 @@ public static class Builder extends ObjectBuilderBase implements ObjectBuilder * API name: {@code cluster_manager_timeout} *

*/ + @Nonnull public final Builder clusterManagerTimeout(@Nullable Time value) { this.clusterManagerTimeout = value; return this; @@ -184,6 +224,7 @@ public final Builder clusterManagerTimeout(@Nullable Time value) { * API name: {@code cluster_manager_timeout} *

*/ + @Nonnull public final Builder clusterManagerTimeout(Function> fn) { return clusterManagerTimeout(fn.apply(new Time.Builder()).build()); } @@ -194,6 +235,7 @@ public final Builder clusterManagerTimeout(Function */ + @Nonnull public final Builder flatSettings(@Nullable Boolean value) { this.flatSettings = value; return this; @@ -205,32 +247,35 @@ public final Builder flatSettings(@Nullable Boolean value) { * API name: {@code local} *

*/ + @Nonnull public final Builder local(@Nullable Boolean value) { this.local = value; return this; } /** - * Period to wait for a connection to the master node. If no response is received before the timeout expires, the request fails and - * returns an error. + * Period to wait for a connection to the cluster-manager node. If no response is received before the timeout expires, the request + * fails and returns an error. *

* API name: {@code master_timeout} *

*/ @Deprecated + @Nonnull public final Builder masterTimeout(@Nullable Time value) { this.masterTimeout = value; return this; } /** - * Period to wait for a connection to the master node. If no response is received before the timeout expires, the request fails and - * returns an error. + * Period to wait for a connection to the cluster-manager node. If no response is received before the timeout expires, the request + * fails and returns an error. *

* API name: {@code master_timeout} *

*/ @Deprecated + @Nonnull public final Builder masterTimeout(Function> fn) { return masterTimeout(fn.apply(new Time.Builder()).build()); } @@ -241,6 +286,7 @@ public final Builder masterTimeout(Function> f * API name: {@code name} *

*/ + @Nonnull public final Builder name(String value) { this.name = value; return this; @@ -251,6 +297,8 @@ public final Builder name(String value) { * * @throws NullPointerException if some of the required fields are null. */ + @Override + @Nonnull public ExistsIndexTemplateRequest build() { _checkSingleUse(); diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/indices/ExistsRequest.java b/java-client/src/generated/java/org/opensearch/client/opensearch/indices/ExistsRequest.java index ce9daf4543..c84d766469 100644 --- a/java-client/src/generated/java/org/opensearch/client/opensearch/indices/ExistsRequest.java +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/indices/ExistsRequest.java @@ -54,8 +54,10 @@ import org.opensearch.client.transport.endpoints.BooleanResponse; import org.opensearch.client.transport.endpoints.SimpleEndpoint; 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.exists.Request @@ -63,7 +65,7 @@ * Returns information about whether a particular index exists. */ @Generated("org.opensearch.client.codegen.CodeGenerator") -public class ExistsRequest extends RequestBase { +public class ExistsRequest extends RequestBase implements ToCopyableBuilder { @Nullable private final Boolean allowNoIndices; @@ -199,10 +201,21 @@ public final Boolean local() { // --------------------------------------------------------------------------------------------- + @Override + @Nonnull + public Builder toBuilder() { + return new Builder(this); + } + + @Nonnull + public static Builder builder() { + return new Builder(); + } + /** * Builder for {@link ExistsRequest}. */ - public static class Builder extends ObjectBuilderBase implements ObjectBuilder { + public static class Builder extends ObjectBuilderBase implements CopyableBuilder { @Nullable private Boolean allowNoIndices; @Nullable @@ -219,6 +232,36 @@ public static class Builder extends ObjectBuilderBase implements ObjectBuilderfalse, the request returns an error if any wildcard expression, index alias, or _all value targets * only missing or closed indexes. This behavior applies even if the request targets other open indexes. @@ -226,6 +269,7 @@ public static class Builder extends ObjectBuilderBase implements ObjectBuilder */ + @Nonnull public final Builder allowNoIndices(@Nullable Boolean value) { this.allowNoIndices = value; return this; @@ -237,6 +281,7 @@ public final Builder allowNoIndices(@Nullable Boolean value) { * API name: {@code cluster_manager_timeout} *

*/ + @Nonnull public final Builder clusterManagerTimeout(@Nullable Time value) { this.clusterManagerTimeout = value; return this; @@ -248,6 +293,7 @@ public final Builder clusterManagerTimeout(@Nullable Time value) { * API name: {@code cluster_manager_timeout} *

*/ + @Nonnull public final Builder clusterManagerTimeout(Function> fn) { return clusterManagerTimeout(fn.apply(new Time.Builder()).build()); } @@ -264,6 +310,7 @@ public final Builder clusterManagerTimeout(Functionlist to expandWildcards. *

*/ + @Nonnull public final Builder expandWildcards(List list) { this.expandWildcards = _listAddAll(this.expandWildcards, list); return this; @@ -281,6 +328,7 @@ public final Builder expandWildcards(List list) { * Adds one or more values to expandWildcards. *

*/ + @Nonnull public final Builder expandWildcards(ExpandWildcard value, ExpandWildcard... values) { this.expandWildcards = _listAdd(this.expandWildcards, value, values); return this; @@ -292,6 +340,7 @@ public final Builder expandWildcards(ExpandWildcard value, ExpandWildcard... val * API name: {@code flat_settings} *

*/ + @Nonnull public final Builder flatSettings(@Nullable Boolean value) { this.flatSettings = value; return this; @@ -303,6 +352,7 @@ public final Builder flatSettings(@Nullable Boolean value) { * API name: {@code ignore_unavailable} *

*/ + @Nonnull public final Builder ignoreUnavailable(@Nullable Boolean value) { this.ignoreUnavailable = value; return this; @@ -314,6 +364,7 @@ public final Builder ignoreUnavailable(@Nullable Boolean value) { * API name: {@code include_defaults} *

*/ + @Nonnull public final Builder includeDefaults(@Nullable Boolean value) { this.includeDefaults = value; return this; @@ -329,6 +380,7 @@ public final Builder includeDefaults(@Nullable Boolean value) { * Adds all elements of list to index. *

*/ + @Nonnull public final Builder index(List list) { this.index = _listAddAll(this.index, list); return this; @@ -344,6 +396,7 @@ public final Builder index(List list) { * Adds one or more values to index. *

*/ + @Nonnull public final Builder index(String value, String... values) { this.index = _listAdd(this.index, value, values); return this; @@ -355,6 +408,7 @@ public final Builder index(String value, String... values) { * API name: {@code local} *

*/ + @Nonnull public final Builder local(@Nullable Boolean value) { this.local = value; return this; @@ -365,6 +419,8 @@ public final Builder local(@Nullable Boolean value) { * * @throws NullPointerException if some of the required fields are null. */ + @Override + @Nonnull public ExistsRequest build() { _checkSingleUse(); diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/indices/FielddataFrequencyFilter.java b/java-client/src/generated/java/org/opensearch/client/opensearch/indices/FielddataFrequencyFilter.java index 167a6a0b9a..551f8c3c3f 100644 --- a/java-client/src/generated/java/org/opensearch/client/opensearch/indices/FielddataFrequencyFilter.java +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/indices/FielddataFrequencyFilter.java @@ -39,6 +39,7 @@ 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; @@ -46,14 +47,19 @@ 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.FielddataFrequencyFilter @JsonpDeserializable @Generated("org.opensearch.client.codegen.CodeGenerator") -public class FielddataFrequencyFilter implements PlainJsonSerializable { +public class FielddataFrequencyFilter + implements + PlainJsonSerializable, + ToCopyableBuilder { private final double max; @@ -117,17 +123,49 @@ protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { // --------------------------------------------------------------------------------------------- + @Override + @Nonnull + public Builder toBuilder() { + return new Builder(this); + } + + @Nonnull + public static Builder builder() { + return new Builder(); + } + /** * Builder for {@link FielddataFrequencyFilter}. */ - public static class Builder extends ObjectBuilderBase implements ObjectBuilder { + public static class Builder extends ObjectBuilderBase implements CopyableBuilder { private Double max; private Double min; private Integer minSegmentSize; + public Builder() {} + + private Builder(FielddataFrequencyFilter o) { + this.max = o.max; + this.min = o.min; + this.minSegmentSize = o.minSegmentSize; + } + + private Builder(Builder o) { + this.max = o.max; + this.min = o.min; + this.minSegmentSize = o.minSegmentSize; + } + + @Override + @Nonnull + public Builder copy() { + return new Builder(this); + } + /** * Required - API name: {@code max} */ + @Nonnull public final Builder max(double value) { this.max = value; return this; @@ -136,6 +174,7 @@ public final Builder max(double value) { /** * Required - API name: {@code min} */ + @Nonnull public final Builder min(double value) { this.min = value; return this; @@ -144,6 +183,7 @@ public final Builder min(double value) { /** * Required - API name: {@code min_segment_size} */ + @Nonnull public final Builder minSegmentSize(int value) { this.minSegmentSize = value; return this; @@ -154,6 +194,8 @@ public final Builder minSegmentSize(int value) { * * @throws NullPointerException if some of the required fields are null. */ + @Override + @Nonnull public FielddataFrequencyFilter build() { _checkSingleUse(); diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/indices/GetIndexRequest.java b/java-client/src/generated/java/org/opensearch/client/opensearch/indices/GetIndexRequest.java index 82b7f11a55..1145cc3a79 100644 --- a/java-client/src/generated/java/org/opensearch/client/opensearch/indices/GetIndexRequest.java +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/indices/GetIndexRequest.java @@ -52,8 +52,10 @@ import org.opensearch.client.transport.Endpoint; import org.opensearch.client.transport.endpoints.SimpleEndpoint; 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.get.Request @@ -61,7 +63,7 @@ * Returns information about one or more indexes. */ @Generated("org.opensearch.client.codegen.CodeGenerator") -public class GetIndexRequest extends RequestBase { +public class GetIndexRequest extends RequestBase implements ToCopyableBuilder { @Nullable private final Boolean allowNoIndices; @@ -110,9 +112,9 @@ public static GetIndexRequest of(Functionfalse, the request returns an error if any wildcard expression, index alias, or _all value targets only + * missing or closed indexes. This behavior applies even if the request targets other open indexes. For example, a request targeting + * foo*,bar* returns an error if an index starts with foo but no index starts with bar. *

* API name: {@code allow_no_indices} *

@@ -135,7 +137,7 @@ public final Time clusterManagerTimeout() { /** * Type of index that wildcard expressions can match. If the request can target data streams, this argument determines whether wildcard - * expressions match hidden data streams. Supports comma-separated values, such as open,hidden. + * expressions match hidden data streams. Supports comma-separated values, such as open,hidden. *

* API name: {@code expand_wildcards} *

@@ -146,7 +148,7 @@ public final List expandWildcards() { } /** - * If true, returns settings in flat format. + * If true, returns settings in flat format. *

* API name: {@code flat_settings} *

@@ -157,7 +159,7 @@ public final Boolean flatSettings() { } /** - * If false, requests that target a missing index return an error. + * If false, requests that target a missing index return an error. *

* API name: {@code ignore_unavailable} *

@@ -168,7 +170,7 @@ public final Boolean ignoreUnavailable() { } /** - * If true, return all default settings in the response. + * If true, return all default settings in the response. *

* API name: {@code include_defaults} *

@@ -191,8 +193,8 @@ public final List index() { } /** - * If true, the request retrieves information from the local node only. Defaults to false, which means information is retrieved from the - * master node. + * If true, the request retrieves information from the local node only. Defaults to false, which means information is + * retrieved from the cluster-manager node. *

* API name: {@code local} *

@@ -203,8 +205,8 @@ public final Boolean local() { } /** - * Period to wait for a connection to the master node. If no response is received before the timeout expires, the request fails and - * returns an error. + * Period to wait for a connection to the cluster-manager node. If no response is received before the timeout expires, the request fails + * and returns an error. *

* API name: {@code master_timeout} *

@@ -217,10 +219,21 @@ public final Time masterTimeout() { // --------------------------------------------------------------------------------------------- + @Override + @Nonnull + public Builder toBuilder() { + return new Builder(this); + } + + @Nonnull + public static Builder builder() { + return new Builder(); + } + /** * Builder for {@link GetIndexRequest}. */ - public static class Builder extends ObjectBuilderBase implements ObjectBuilder { + public static class Builder extends ObjectBuilderBase implements CopyableBuilder { @Nullable private Boolean allowNoIndices; @Nullable @@ -239,14 +252,47 @@ public static class Builder extends ObjectBuilderBase implements ObjectBuilderfalse, the request returns an error if any wildcard expression, index alias, or _all value targets + * only missing or closed indexes. This behavior applies even if the request targets other open indexes. For example, a request + * targeting foo*,bar* returns an error if an index starts with foo but no index starts with bar. *

* API name: {@code allow_no_indices} *

*/ + @Nonnull public final Builder allowNoIndices(@Nullable Boolean value) { this.allowNoIndices = value; return this; @@ -258,6 +304,7 @@ public final Builder allowNoIndices(@Nullable Boolean value) { * API name: {@code cluster_manager_timeout} *

*/ + @Nonnull public final Builder clusterManagerTimeout(@Nullable Time value) { this.clusterManagerTimeout = value; return this; @@ -269,13 +316,14 @@ public final Builder clusterManagerTimeout(@Nullable Time value) { * API name: {@code cluster_manager_timeout} *

*/ + @Nonnull public final Builder clusterManagerTimeout(Function> fn) { return clusterManagerTimeout(fn.apply(new Time.Builder()).build()); } /** * Type of index that wildcard expressions can match. If the request can target data streams, this argument determines whether - * wildcard expressions match hidden data streams. Supports comma-separated values, such as open,hidden. + * wildcard expressions match hidden data streams. Supports comma-separated values, such as open,hidden. *

* API name: {@code expand_wildcards} *

@@ -284,6 +332,7 @@ public final Builder clusterManagerTimeout(Functionlist to expandWildcards. *

*/ + @Nonnull public final Builder expandWildcards(List list) { this.expandWildcards = _listAddAll(this.expandWildcards, list); return this; @@ -291,7 +340,7 @@ public final Builder expandWildcards(List list) { /** * Type of index that wildcard expressions can match. If the request can target data streams, this argument determines whether - * wildcard expressions match hidden data streams. Supports comma-separated values, such as open,hidden. + * wildcard expressions match hidden data streams. Supports comma-separated values, such as open,hidden. *

* API name: {@code expand_wildcards} *

@@ -300,39 +349,43 @@ public final Builder expandWildcards(List list) { * Adds one or more values to expandWildcards. *

*/ + @Nonnull public final Builder expandWildcards(ExpandWildcard value, ExpandWildcard... values) { this.expandWildcards = _listAdd(this.expandWildcards, value, values); return this; } /** - * If true, returns settings in flat format. + * If true, returns settings in flat format. *

* API name: {@code flat_settings} *

*/ + @Nonnull public final Builder flatSettings(@Nullable Boolean value) { this.flatSettings = value; return this; } /** - * If false, requests that target a missing index return an error. + * If false, requests that target a missing index return an error. *

* API name: {@code ignore_unavailable} *

*/ + @Nonnull public final Builder ignoreUnavailable(@Nullable Boolean value) { this.ignoreUnavailable = value; return this; } /** - * If true, return all default settings in the response. + * If true, return all default settings in the response. *

* API name: {@code include_defaults} *

*/ + @Nonnull public final Builder includeDefaults(@Nullable Boolean value) { this.includeDefaults = value; return this; @@ -349,6 +402,7 @@ public final Builder includeDefaults(@Nullable Boolean value) { * Adds all elements of list to index. *

*/ + @Nonnull public final Builder index(List list) { this.index = _listAddAll(this.index, list); return this; @@ -365,44 +419,48 @@ public final Builder index(List list) { * Adds one or more values to index. *

*/ + @Nonnull public final Builder index(String value, String... values) { this.index = _listAdd(this.index, value, values); return this; } /** - * If true, the request retrieves information from the local node only. Defaults to false, which means information is retrieved from - * the master node. + * If true, the request retrieves information from the local node only. Defaults to false, which means information is + * retrieved from the cluster-manager node. *

* API name: {@code local} *

*/ + @Nonnull public final Builder local(@Nullable Boolean value) { this.local = value; return this; } /** - * Period to wait for a connection to the master node. If no response is received before the timeout expires, the request fails and - * returns an error. + * Period to wait for a connection to the cluster-manager node. If no response is received before the timeout expires, the request + * fails and returns an error. *

* API name: {@code master_timeout} *

*/ @Deprecated + @Nonnull public final Builder masterTimeout(@Nullable Time value) { this.masterTimeout = value; return this; } /** - * Period to wait for a connection to the master node. If no response is received before the timeout expires, the request fails and - * returns an error. + * Period to wait for a connection to the cluster-manager node. If no response is received before the timeout expires, the request + * fails and returns an error. *

* API name: {@code master_timeout} *

*/ @Deprecated + @Nonnull public final Builder masterTimeout(Function> fn) { return masterTimeout(fn.apply(new Time.Builder()).build()); } @@ -412,6 +470,8 @@ public final Builder masterTimeout(Function> f * * @throws NullPointerException if some of the required fields are null. */ + @Override + @Nonnull public GetIndexRequest build() { _checkSingleUse(); diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/indices/GetIndexResponse.java b/java-client/src/generated/java/org/opensearch/client/opensearch/indices/GetIndexResponse.java index cc79d9cbda..0cb02c6c34 100644 --- a/java-client/src/generated/java/org/opensearch/client/opensearch/indices/GetIndexResponse.java +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/indices/GetIndexResponse.java @@ -38,6 +38,7 @@ 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.ObjectBuilderDeserializer; @@ -69,6 +70,7 @@ public static class Builder extends DictionaryResponse.AbstractBuilder { @Override + @Nonnull protected Builder self() { return this; } diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/indices/GetIndexTemplateRequest.java b/java-client/src/generated/java/org/opensearch/client/opensearch/indices/GetIndexTemplateRequest.java index 0f08fc8624..b20b9c1b36 100644 --- a/java-client/src/generated/java/org/opensearch/client/opensearch/indices/GetIndexTemplateRequest.java +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/indices/GetIndexTemplateRequest.java @@ -41,14 +41,17 @@ 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.opensearch._types.ErrorResponse; import org.opensearch.client.opensearch._types.RequestBase; import org.opensearch.client.opensearch._types.Time; import org.opensearch.client.transport.Endpoint; import org.opensearch.client.transport.endpoints.SimpleEndpoint; +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.get_index_template.Request @@ -56,7 +59,9 @@ * Returns an index template. */ @Generated("org.opensearch.client.codegen.CodeGenerator") -public class GetIndexTemplateRequest extends RequestBase { +public class GetIndexTemplateRequest extends RequestBase + implements + ToCopyableBuilder { @Nullable private final Time clusterManagerTimeout; @@ -100,7 +105,7 @@ public final Time clusterManagerTimeout() { } /** - * If true, returns settings in flat format. + * If true, returns settings in flat format. *

* API name: {@code flat_settings} *

@@ -111,8 +116,8 @@ public final Boolean flatSettings() { } /** - * If true, the request retrieves information from the local node only. Defaults to false, which means information is retrieved from the - * master node. + * If true, the request retrieves information from the local node only. Defaults to false, which means information is + * retrieved from the cluster-manager node. *

* API name: {@code local} *

@@ -123,8 +128,8 @@ public final Boolean local() { } /** - * Period to wait for a connection to the master node. If no response is received before the timeout expires, the request fails and - * returns an error. + * Period to wait for a connection to the cluster-manager node. If no response is received before the timeout expires, the request fails + * and returns an error. *

* API name: {@code master_timeout} *

@@ -148,10 +153,21 @@ public final String name() { // --------------------------------------------------------------------------------------------- + @Override + @Nonnull + public Builder toBuilder() { + return new Builder(this); + } + + @Nonnull + public static Builder builder() { + return new Builder(); + } + /** * Builder for {@link GetIndexTemplateRequest}. */ - public static class Builder extends ObjectBuilderBase implements ObjectBuilder { + public static class Builder extends ObjectBuilderBase implements CopyableBuilder { @Nullable private Time clusterManagerTimeout; @Nullable @@ -163,12 +179,37 @@ public static class Builder extends ObjectBuilderBase implements ObjectBuilder * API name: {@code cluster_manager_timeout} *

*/ + @Nonnull public final Builder clusterManagerTimeout(@Nullable Time value) { this.clusterManagerTimeout = value; return this; @@ -180,54 +221,59 @@ public final Builder clusterManagerTimeout(@Nullable Time value) { * API name: {@code cluster_manager_timeout} *

*/ + @Nonnull public final Builder clusterManagerTimeout(Function> fn) { return clusterManagerTimeout(fn.apply(new Time.Builder()).build()); } /** - * If true, returns settings in flat format. + * If true, returns settings in flat format. *

* API name: {@code flat_settings} *

*/ + @Nonnull public final Builder flatSettings(@Nullable Boolean value) { this.flatSettings = value; return this; } /** - * If true, the request retrieves information from the local node only. Defaults to false, which means information is retrieved from - * the master node. + * If true, the request retrieves information from the local node only. Defaults to false, which means information is + * retrieved from the cluster-manager node. *

* API name: {@code local} *

*/ + @Nonnull public final Builder local(@Nullable Boolean value) { this.local = value; return this; } /** - * Period to wait for a connection to the master node. If no response is received before the timeout expires, the request fails and - * returns an error. + * Period to wait for a connection to the cluster-manager node. If no response is received before the timeout expires, the request + * fails and returns an error. *

* API name: {@code master_timeout} *

*/ @Deprecated + @Nonnull public final Builder masterTimeout(@Nullable Time value) { this.masterTimeout = value; return this; } /** - * Period to wait for a connection to the master node. If no response is received before the timeout expires, the request fails and - * returns an error. + * Period to wait for a connection to the cluster-manager node. If no response is received before the timeout expires, the request + * fails and returns an error. *

* API name: {@code master_timeout} *

*/ @Deprecated + @Nonnull public final Builder masterTimeout(Function> fn) { return masterTimeout(fn.apply(new Time.Builder()).build()); } @@ -238,6 +284,7 @@ public final Builder masterTimeout(Function> f * API name: {@code name} *

*/ + @Nonnull public final Builder name(@Nullable String value) { this.name = value; return this; @@ -248,6 +295,8 @@ public final Builder name(@Nullable String value) { * * @throws NullPointerException if some of the required fields are null. */ + @Override + @Nonnull public GetIndexTemplateRequest build() { _checkSingleUse(); diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/indices/GetIndexTemplateResponse.java b/java-client/src/generated/java/org/opensearch/client/opensearch/indices/GetIndexTemplateResponse.java index 85f4742874..b4e90d507e 100644 --- a/java-client/src/generated/java/org/opensearch/client/opensearch/indices/GetIndexTemplateResponse.java +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/indices/GetIndexTemplateResponse.java @@ -49,14 +49,19 @@ import org.opensearch.client.json.PlainJsonSerializable; import org.opensearch.client.opensearch.indices.get_index_template.IndexTemplateItem; 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.get_index_template.Response @JsonpDeserializable @Generated("org.opensearch.client.codegen.CodeGenerator") -public class GetIndexTemplateResponse implements PlainJsonSerializable { +public class GetIndexTemplateResponse + implements + PlainJsonSerializable, + ToCopyableBuilder { @Nonnull private final List indexTemplates; @@ -100,12 +105,39 @@ protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { // --------------------------------------------------------------------------------------------- + @Override + @Nonnull + public Builder toBuilder() { + return new Builder(this); + } + + @Nonnull + public static Builder builder() { + return new Builder(); + } + /** * Builder for {@link GetIndexTemplateResponse}. */ - public static class Builder extends ObjectBuilderBase implements ObjectBuilder { + public static class Builder extends ObjectBuilderBase implements CopyableBuilder { private List indexTemplates; + public Builder() {} + + private Builder(GetIndexTemplateResponse o) { + this.indexTemplates = _listCopy(o.indexTemplates); + } + + private Builder(Builder o) { + this.indexTemplates = _listCopy(o.indexTemplates); + } + + @Override + @Nonnull + public Builder copy() { + return new Builder(this); + } + /** * Required - API name: {@code index_templates} * @@ -113,6 +145,7 @@ public static class Builder extends ObjectBuilderBase implements ObjectBuilderlist to indexTemplates. *

*/ + @Nonnull public final Builder indexTemplates(List list) { this.indexTemplates = _listAddAll(this.indexTemplates, list); return this; @@ -125,6 +158,7 @@ public final Builder indexTemplates(List list) { * Adds one or more values to indexTemplates. *

*/ + @Nonnull public final Builder indexTemplates(IndexTemplateItem value, IndexTemplateItem... values) { this.indexTemplates = _listAdd(this.indexTemplates, value, values); return this; @@ -137,6 +171,7 @@ public final Builder indexTemplates(IndexTemplateItem value, IndexTemplateItem.. * Adds a value to indexTemplates using a builder lambda. *

*/ + @Nonnull public final Builder indexTemplates(Function> fn) { return indexTemplates(fn.apply(new IndexTemplateItem.Builder()).build()); } @@ -146,6 +181,8 @@ public final Builder indexTemplates(Function { @Nonnull private final Map analyzer; @@ -197,10 +202,21 @@ protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { // --------------------------------------------------------------------------------------------- + @Override + @Nonnull + public Builder toBuilder() { + return new Builder(this); + } + + @Nonnull + public static Builder builder() { + return new Builder(); + } + /** * Builder for {@link IndexSettingsAnalysis}. */ - public static class Builder extends ObjectBuilderBase implements ObjectBuilder { + public static class Builder extends ObjectBuilderBase implements CopyableBuilder { @Nullable private Map analyzer; @Nullable @@ -212,6 +228,30 @@ public static class Builder extends ObjectBuilderBase implements ObjectBuilder tokenizer; + public Builder() {} + + private Builder(IndexSettingsAnalysis o) { + this.analyzer = _mapCopy(o.analyzer); + this.charFilter = _mapCopy(o.charFilter); + this.filter = _mapCopy(o.filter); + this.normalizer = _mapCopy(o.normalizer); + this.tokenizer = _mapCopy(o.tokenizer); + } + + private Builder(Builder o) { + this.analyzer = _mapCopy(o.analyzer); + this.charFilter = _mapCopy(o.charFilter); + this.filter = _mapCopy(o.filter); + this.normalizer = _mapCopy(o.normalizer); + this.tokenizer = _mapCopy(o.tokenizer); + } + + @Override + @Nonnull + public Builder copy() { + return new Builder(this); + } + /** * API name: {@code analyzer} * @@ -219,6 +259,7 @@ public static class Builder extends ObjectBuilderBase implements ObjectBuildermap to analyzer. *

*/ + @Nonnull public final Builder analyzer(Map map) { this.analyzer = _mapPutAll(this.analyzer, map); return this; @@ -231,6 +272,7 @@ public final Builder analyzer(Map map) { * Adds an entry to analyzer. *

*/ + @Nonnull public final Builder analyzer(String key, Analyzer value) { this.analyzer = _mapPut(this.analyzer, key, value); return this; @@ -243,6 +285,7 @@ public final Builder analyzer(String key, Analyzer value) { * Adds a value to analyzer using a builder lambda. *

*/ + @Nonnull public final Builder analyzer(String key, Function> fn) { return analyzer(key, fn.apply(new Analyzer.Builder()).build()); } @@ -254,6 +297,7 @@ public final Builder analyzer(String key, Functionmap to charFilter. *

*/ + @Nonnull public final Builder charFilter(Map map) { this.charFilter = _mapPutAll(this.charFilter, map); return this; @@ -266,6 +310,7 @@ public final Builder charFilter(Map map) { * Adds an entry to charFilter. *

*/ + @Nonnull public final Builder charFilter(String key, CharFilter value) { this.charFilter = _mapPut(this.charFilter, key, value); return this; @@ -278,6 +323,7 @@ public final Builder charFilter(String key, CharFilter value) { * Adds a value to charFilter using a builder lambda. *

*/ + @Nonnull public final Builder charFilter(String key, Function> fn) { return charFilter(key, fn.apply(new CharFilter.Builder()).build()); } @@ -289,6 +335,7 @@ public final Builder charFilter(String key, Functionmap to filter. *

*/ + @Nonnull public final Builder filter(Map map) { this.filter = _mapPutAll(this.filter, map); return this; @@ -301,6 +348,7 @@ public final Builder filter(Map map) { * Adds an entry to filter. *

*/ + @Nonnull public final Builder filter(String key, TokenFilter value) { this.filter = _mapPut(this.filter, key, value); return this; @@ -313,6 +361,7 @@ public final Builder filter(String key, TokenFilter value) { * Adds a value to filter using a builder lambda. *

*/ + @Nonnull public final Builder filter(String key, Function> fn) { return filter(key, fn.apply(new TokenFilter.Builder()).build()); } @@ -324,6 +373,7 @@ public final Builder filter(String key, Functionmap to normalizer. *

*/ + @Nonnull public final Builder normalizer(Map map) { this.normalizer = _mapPutAll(this.normalizer, map); return this; @@ -336,6 +386,7 @@ public final Builder normalizer(Map map) { * Adds an entry to normalizer. *

*/ + @Nonnull public final Builder normalizer(String key, Normalizer value) { this.normalizer = _mapPut(this.normalizer, key, value); return this; @@ -348,6 +399,7 @@ public final Builder normalizer(String key, Normalizer value) { * Adds a value to normalizer using a builder lambda. *

*/ + @Nonnull public final Builder normalizer(String key, Function> fn) { return normalizer(key, fn.apply(new Normalizer.Builder()).build()); } @@ -359,6 +411,7 @@ public final Builder normalizer(String key, Functionmap to tokenizer. *

*/ + @Nonnull public final Builder tokenizer(Map map) { this.tokenizer = _mapPutAll(this.tokenizer, map); return this; @@ -371,6 +424,7 @@ public final Builder tokenizer(Map map) { * Adds an entry to tokenizer. *

*/ + @Nonnull public final Builder tokenizer(String key, Tokenizer value) { this.tokenizer = _mapPut(this.tokenizer, key, value); return this; @@ -383,6 +437,7 @@ public final Builder tokenizer(String key, Tokenizer value) { * Adds a value to tokenizer using a builder lambda. *

*/ + @Nonnull public final Builder tokenizer(String key, Function> fn) { return tokenizer(key, fn.apply(new Tokenizer.Builder()).build()); } @@ -392,6 +447,8 @@ public final Builder tokenizer(String key, Function { @Nonnull private final Map aliases; @@ -173,10 +175,21 @@ protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { // --------------------------------------------------------------------------------------------- + @Override + @Nonnull + public Builder toBuilder() { + return new Builder(this); + } + + @Nonnull + public static Builder builder() { + return new Builder(); + } + /** * Builder for {@link IndexState}. */ - public static class Builder extends ObjectBuilderBase implements ObjectBuilder { + public static class Builder extends ObjectBuilderBase implements CopyableBuilder { @Nullable private Map aliases; @Nullable @@ -188,6 +201,30 @@ public static class Builder extends ObjectBuilderBase implements ObjectBuildermap to aliases. *

*/ + @Nonnull public final Builder aliases(Map map) { this.aliases = _mapPutAll(this.aliases, map); return this; @@ -207,6 +245,7 @@ public final Builder aliases(Map map) { * Adds an entry to aliases. *

*/ + @Nonnull public final Builder aliases(String key, Alias value) { this.aliases = _mapPut(this.aliases, key, value); return this; @@ -219,6 +258,7 @@ public final Builder aliases(String key, Alias value) { * Adds a value to aliases using a builder lambda. *

*/ + @Nonnull public final Builder aliases(String key, Function> fn) { return aliases(key, fn.apply(new Alias.Builder()).build()); } @@ -226,6 +266,7 @@ public final Builder aliases(String key, Function> fn) { return defaults(fn.apply(new IndexSettings.Builder()).build()); } @@ -249,6 +292,7 @@ public final Builder defaults(Function> fn) { return mappings(fn.apply(new TypeMapping.Builder()).build()); } @@ -264,6 +309,7 @@ public final Builder mappings(Function> fn) { return settings(fn.apply(new IndexSettings.Builder()).build()); } @@ -281,6 +328,8 @@ public final Builder settings(Function { @Nullable private final Boolean allowAutoCreate; @@ -243,10 +245,21 @@ protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { // --------------------------------------------------------------------------------------------- + @Override + @Nonnull + public Builder toBuilder() { + return new Builder(this); + } + + @Nonnull + public static Builder builder() { + return new Builder(); + } + /** * Builder for {@link IndexTemplate}. */ - public static class Builder extends ObjectBuilderBase implements ObjectBuilder { + public static class Builder extends ObjectBuilderBase implements CopyableBuilder { @Nullable private Boolean allowAutoCreate; @Nullable @@ -263,9 +276,40 @@ public static class Builder extends ObjectBuilderBase implements ObjectBuilderlist to composedOf. *

*/ + @Nonnull public final Builder composedOf(List list) { this.composedOf = _listAddAll(this.composedOf, list); return this; @@ -298,6 +343,7 @@ public final Builder composedOf(List list) { * Adds one or more values to composedOf. *

*/ + @Nonnull public final Builder composedOf(String value, String... values) { this.composedOf = _listAdd(this.composedOf, value, values); return this; @@ -306,6 +352,7 @@ public final Builder composedOf(String value, String... values) { /** * API name: {@code data_stream} */ + @Nonnull public final Builder dataStream(@Nullable IndexTemplateDataStreamConfiguration value) { this.dataStream = value; return this; @@ -314,6 +361,7 @@ public final Builder dataStream(@Nullable IndexTemplateDataStreamConfiguration v /** * API name: {@code data_stream} */ + @Nonnull public final Builder dataStream( Function> fn ) { @@ -327,6 +375,7 @@ public final Builder dataStream( * Adds all elements of list to indexPatterns. *

*/ + @Nonnull public final Builder indexPatterns(List list) { this.indexPatterns = _listAddAll(this.indexPatterns, list); return this; @@ -339,6 +388,7 @@ public final Builder indexPatterns(List list) { * Adds one or more values to indexPatterns. *

*/ + @Nonnull public final Builder indexPatterns(String value, String... values) { this.indexPatterns = _listAdd(this.indexPatterns, value, values); return this; @@ -351,6 +401,7 @@ public final Builder indexPatterns(String value, String... values) { * Adds all elements of map to meta. *

*/ + @Nonnull public final Builder meta(Map map) { this.meta = _mapPutAll(this.meta, map); return this; @@ -363,6 +414,7 @@ public final Builder meta(Map map) { * Adds an entry to meta. *

*/ + @Nonnull public final Builder meta(String key, JsonData value) { this.meta = _mapPut(this.meta, key, value); return this; @@ -376,6 +428,7 @@ public final Builder meta(String key, JsonData value) { * API name: {@code priority} *

*/ + @Nonnull public final Builder priority(@Nullable Long value) { this.priority = value; return this; @@ -384,6 +437,7 @@ public final Builder priority(@Nullable Long value) { /** * API name: {@code template} */ + @Nonnull public final Builder template(@Nullable IndexTemplateSummary value) { this.template = value; return this; @@ -392,6 +446,7 @@ public final Builder template(@Nullable IndexTemplateSummary value) { /** * API name: {@code template} */ + @Nonnull public final Builder template(Function> fn) { return template(fn.apply(new IndexTemplateSummary.Builder()).build()); } @@ -399,6 +454,7 @@ public final Builder template(Function { @Nullable private final Boolean allowCustomRouting; @@ -80,7 +86,7 @@ public static IndexTemplateDataStreamConfiguration of( } /** - * If true, the data stream supports custom routing. + * If true, the data stream supports custom routing. *

* API name: {@code allow_custom_routing} *

@@ -91,7 +97,7 @@ public final Boolean allowCustomRouting() { } /** - * If true, the data stream is hidden. + * If true, the data stream is hidden. *

* API name: {@code hidden} *

@@ -138,10 +144,21 @@ protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { // --------------------------------------------------------------------------------------------- + @Override + @Nonnull + public Builder toBuilder() { + return new Builder(this); + } + + @Nonnull + public static Builder builder() { + return new Builder(); + } + /** * Builder for {@link IndexTemplateDataStreamConfiguration}. */ - public static class Builder extends ObjectBuilderBase implements ObjectBuilder { + public static class Builder extends ObjectBuilderBase implements CopyableBuilder { @Nullable private Boolean allowCustomRouting; @Nullable @@ -149,23 +166,45 @@ public static class Builder extends ObjectBuilderBase implements ObjectBuildertrue, the data stream supports custom routing. *

* API name: {@code allow_custom_routing} *

*/ + @Nonnull public final Builder allowCustomRouting(@Nullable Boolean value) { this.allowCustomRouting = value; return this; } /** - * If true, the data stream is hidden. + * If true, the data stream is hidden. *

* API name: {@code hidden} *

*/ + @Nonnull public final Builder hidden(@Nullable Boolean value) { this.hidden = value; return this; @@ -174,6 +213,7 @@ public final Builder hidden(@Nullable Boolean value) { /** * API name: {@code timestamp_field} */ + @Nonnull public final Builder timestampField(@Nullable DataStreamTimestampField value) { this.timestampField = value; return this; @@ -182,6 +222,7 @@ public final Builder timestampField(@Nullable DataStreamTimestampField value) { /** * API name: {@code timestamp_field} */ + @Nonnull public final Builder timestampField(Function> fn) { return timestampField(fn.apply(new DataStreamTimestampField.Builder()).build()); } @@ -191,6 +232,8 @@ public final Builder timestampField(Function { @Nonnull private final Map aliases; @@ -144,10 +146,21 @@ protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { // --------------------------------------------------------------------------------------------- + @Override + @Nonnull + public Builder toBuilder() { + return new Builder(this); + } + + @Nonnull + public static Builder builder() { + return new Builder(); + } + /** * Builder for {@link IndexTemplateSummary}. */ - public static class Builder extends ObjectBuilderBase implements ObjectBuilder { + public static class Builder extends ObjectBuilderBase implements CopyableBuilder { @Nullable private Map aliases; @Nullable @@ -155,6 +168,26 @@ public static class Builder extends ObjectBuilderBase implements ObjectBuilderdata_stream object, these are data stream aliases. Otherwise, these * are index aliases. Data stream aliases ignore the index_routing, routing, and @@ -167,6 +200,7 @@ public static class Builder extends ObjectBuilderBase implements ObjectBuildermap to aliases. *

*/ + @Nonnull public final Builder aliases(Map map) { this.aliases = _mapPutAll(this.aliases, map); return this; @@ -184,6 +218,7 @@ public final Builder aliases(Map map) { * Adds an entry to aliases. *

*/ + @Nonnull public final Builder aliases(String key, Alias value) { this.aliases = _mapPut(this.aliases, key, value); return this; @@ -201,6 +236,7 @@ public final Builder aliases(String key, Alias value) { * Adds a value to aliases using a builder lambda. *

*/ + @Nonnull public final Builder aliases(String key, Function> fn) { return aliases(key, fn.apply(new Alias.Builder()).build()); } @@ -208,6 +244,7 @@ public final Builder aliases(String key, Function> fn) { return mappings(fn.apply(new TypeMapping.Builder()).build()); } @@ -223,6 +261,7 @@ public final Builder mappings(Function> fn) { return settings(fn.apply(new IndexSettings.Builder()).build()); } @@ -240,6 +280,8 @@ public final Builder settings(Function { @Nonnull private final NumericFielddataFormat format; @@ -94,15 +96,43 @@ protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { // --------------------------------------------------------------------------------------------- + @Override + @Nonnull + public Builder toBuilder() { + return new Builder(this); + } + + @Nonnull + public static Builder builder() { + return new Builder(); + } + /** * Builder for {@link NumericFielddata}. */ - public static class Builder extends ObjectBuilderBase implements ObjectBuilder { + public static class Builder extends ObjectBuilderBase implements CopyableBuilder { private NumericFielddataFormat format; + public Builder() {} + + private Builder(NumericFielddata o) { + this.format = o.format; + } + + private Builder(Builder o) { + this.format = o.format; + } + + @Override + @Nonnull + public Builder copy() { + return new Builder(this); + } + /** * Required - API name: {@code format} */ + @Nonnull public final Builder format(NumericFielddataFormat value) { this.format = value; return this; @@ -113,6 +143,8 @@ public final Builder format(NumericFielddataFormat value) { * * @throws NullPointerException if some of the required fields are null. */ + @Override + @Nonnull public NumericFielddata build() { _checkSingleUse(); diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/indices/PutIndexTemplateRequest.java b/java-client/src/generated/java/org/opensearch/client/opensearch/indices/PutIndexTemplateRequest.java index a407a4ab5a..5a96e67614 100644 --- a/java-client/src/generated/java/org/opensearch/client/opensearch/indices/PutIndexTemplateRequest.java +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/indices/PutIndexTemplateRequest.java @@ -59,8 +59,10 @@ import org.opensearch.client.transport.Endpoint; import org.opensearch.client.transport.endpoints.SimpleEndpoint; 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.put_index_template.Request @@ -69,7 +71,10 @@ */ @JsonpDeserializable @Generated("org.opensearch.client.codegen.CodeGenerator") -public class PutIndexTemplateRequest extends RequestBase implements PlainJsonSerializable { +public class PutIndexTemplateRequest extends RequestBase + implements + PlainJsonSerializable, + ToCopyableBuilder { @Nullable private final String cause; @@ -191,7 +196,7 @@ public final List indexPatterns() { } /** - * Operation timeout for connection to master node. + * Operation timeout for connection to cluster-manager node. *

* API name: {@code master_timeout} *

@@ -311,10 +316,21 @@ protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { } // --------------------------------------------------------------------------------------------- + @Override + @Nonnull + public Builder toBuilder() { + return new Builder(this); + } + + @Nonnull + public static Builder builder() { + return new Builder(); + } + /** * Builder for {@link PutIndexTemplateRequest}. */ - public static class Builder extends ObjectBuilderBase implements ObjectBuilder { + public static class Builder extends ObjectBuilderBase implements CopyableBuilder { @Nullable private String cause; @Nullable @@ -339,12 +355,51 @@ public static class Builder extends ObjectBuilderBase implements ObjectBuilder

* API name: {@code cause} *

*/ + @Nonnull public final Builder cause(@Nullable String value) { this.cause = value; return this; @@ -356,6 +411,7 @@ public final Builder cause(@Nullable String value) { * API name: {@code cluster_manager_timeout} *

*/ + @Nonnull public final Builder clusterManagerTimeout(@Nullable Time value) { this.clusterManagerTimeout = value; return this; @@ -367,6 +423,7 @@ public final Builder clusterManagerTimeout(@Nullable Time value) { * API name: {@code cluster_manager_timeout} *

*/ + @Nonnull public final Builder clusterManagerTimeout(Function> fn) { return clusterManagerTimeout(fn.apply(new Time.Builder()).build()); } @@ -382,6 +439,7 @@ public final Builder clusterManagerTimeout(Functionlist to composedOf. *

*/ + @Nonnull public final Builder composedOf(List list) { this.composedOf = _listAddAll(this.composedOf, list); return this; @@ -398,6 +456,7 @@ public final Builder composedOf(List list) { * Adds one or more values to composedOf. *

*/ + @Nonnull public final Builder composedOf(String value, String... values) { this.composedOf = _listAdd(this.composedOf, value, values); return this; @@ -409,6 +468,7 @@ public final Builder composedOf(String value, String... values) { * API name: {@code create} *

*/ + @Nonnull public final Builder create(@Nullable Boolean value) { this.create = value; return this; @@ -417,6 +477,7 @@ public final Builder create(@Nullable Boolean value) { /** * API name: {@code data_stream} */ + @Nonnull public final Builder dataStream(@Nullable IndexTemplateDataStreamConfiguration value) { this.dataStream = value; return this; @@ -425,6 +486,7 @@ public final Builder dataStream(@Nullable IndexTemplateDataStreamConfiguration v /** * API name: {@code data_stream} */ + @Nonnull public final Builder dataStream( Function> fn ) { @@ -438,6 +500,7 @@ public final Builder dataStream( * Adds all elements of list to indexPatterns. *

*/ + @Nonnull public final Builder indexPatterns(List list) { this.indexPatterns = _listAddAll(this.indexPatterns, list); return this; @@ -450,30 +513,33 @@ public final Builder indexPatterns(List list) { * Adds one or more values to indexPatterns. *

*/ + @Nonnull public final Builder indexPatterns(String value, String... values) { this.indexPatterns = _listAdd(this.indexPatterns, value, values); return this; } /** - * Operation timeout for connection to master node. + * Operation timeout for connection to cluster-manager node. *

* API name: {@code master_timeout} *

*/ @Deprecated + @Nonnull public final Builder masterTimeout(@Nullable Time value) { this.masterTimeout = value; return this; } /** - * Operation timeout for connection to master node. + * Operation timeout for connection to cluster-manager node. *

* API name: {@code master_timeout} *

*/ @Deprecated + @Nonnull public final Builder masterTimeout(Function> fn) { return masterTimeout(fn.apply(new Time.Builder()).build()); } @@ -485,6 +551,7 @@ public final Builder masterTimeout(Function> f * Adds all elements of map to meta. *

*/ + @Nonnull public final Builder meta(Map map) { this.meta = _mapPutAll(this.meta, map); return this; @@ -497,6 +564,7 @@ public final Builder meta(Map map) { * Adds an entry to meta. *

*/ + @Nonnull public final Builder meta(String key, JsonData value) { this.meta = _mapPut(this.meta, key, value); return this; @@ -508,6 +576,7 @@ public final Builder meta(String key, JsonData value) { * API name: {@code name} *

*/ + @Nonnull public final Builder name(String value) { this.name = value; return this; @@ -521,6 +590,7 @@ public final Builder name(String value) { * API name: {@code priority} *

*/ + @Nonnull public final Builder priority(@Nullable Integer value) { this.priority = value; return this; @@ -529,6 +599,7 @@ public final Builder priority(@Nullable Integer value) { /** * API name: {@code template} */ + @Nonnull public final Builder template(@Nullable IndexTemplateMapping value) { this.template = value; return this; @@ -537,6 +608,7 @@ public final Builder template(@Nullable IndexTemplateMapping value) { /** * API name: {@code template} */ + @Nonnull public final Builder template(Function> fn) { return template(fn.apply(new IndexTemplateMapping.Builder()).build()); } @@ -544,6 +616,7 @@ public final Builder template(Function { // --------------------------------------------------------------------------------------------- @@ -63,14 +68,42 @@ public static PutIndexTemplateResponse of(Function implements - ObjectBuilder { + CopyableBuilder { + + public Builder() {} + + private Builder(PutIndexTemplateResponse o) { + super(o); + } + + private Builder(Builder o) { + super(o); + } @Override + @Nonnull + public Builder copy() { + return new Builder(this); + } + + @Override + @Nonnull protected Builder self() { return this; } @@ -80,6 +113,8 @@ protected Builder self() { * * @throws NullPointerException if some of the required fields are null. */ + @Override + @Nonnull public PutIndexTemplateResponse build() { _checkSingleUse(); diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/indices/SimulateIndexTemplateRequest.java b/java-client/src/generated/java/org/opensearch/client/opensearch/indices/SimulateIndexTemplateRequest.java index 3ba47a129d..230ff6892d 100644 --- a/java-client/src/generated/java/org/opensearch/client/opensearch/indices/SimulateIndexTemplateRequest.java +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/indices/SimulateIndexTemplateRequest.java @@ -59,8 +59,10 @@ import org.opensearch.client.transport.Endpoint; import org.opensearch.client.transport.endpoints.SimpleEndpoint; 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.simulate_index_template.Request @@ -69,7 +71,10 @@ */ @JsonpDeserializable @Generated("org.opensearch.client.codegen.CodeGenerator") -public class SimulateIndexTemplateRequest extends RequestBase implements PlainJsonSerializable { +public class SimulateIndexTemplateRequest extends RequestBase + implements + PlainJsonSerializable, + ToCopyableBuilder { @Nullable private final Boolean allowAutoCreate; @@ -213,8 +218,8 @@ public final List indexPatterns() { } /** - * Period to wait for a connection to the master node. If no response is received before the timeout expires, the request fails and - * returns an error. + * Period to wait for a connection to the cluster-manager node. If no response is received before the timeout expires, the request fails + * and returns an error. *

* API name: {@code master_timeout} *

@@ -339,10 +344,21 @@ protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { } // --------------------------------------------------------------------------------------------- + @Override + @Nonnull + public Builder toBuilder() { + return new Builder(this); + } + + @Nonnull + public static Builder builder() { + return new Builder(); + } + /** * Builder for {@link SimulateIndexTemplateRequest}. */ - public static class Builder extends ObjectBuilderBase implements ObjectBuilder { + public static class Builder extends ObjectBuilderBase implements CopyableBuilder { @Nullable private Boolean allowAutoCreate; @Nullable @@ -369,6 +385,46 @@ public static class Builder extends ObjectBuilderBase implements ObjectBuilderaction.auto_create_index cluster setting. If set to true in a * template, then indexes can be automatically created using that template even if auto-creation of indexes is disabled using @@ -378,6 +434,7 @@ public static class Builder extends ObjectBuilderBase implements ObjectBuilder */ + @Nonnull public final Builder allowAutoCreate(@Nullable Boolean value) { this.allowAutoCreate = value; return this; @@ -389,6 +446,7 @@ public final Builder allowAutoCreate(@Nullable Boolean value) { * API name: {@code cause} *

*/ + @Nonnull public final Builder cause(@Nullable String value) { this.cause = value; return this; @@ -400,6 +458,7 @@ public final Builder cause(@Nullable String value) { * API name: {@code cluster_manager_timeout} *

*/ + @Nonnull public final Builder clusterManagerTimeout(@Nullable Time value) { this.clusterManagerTimeout = value; return this; @@ -411,6 +470,7 @@ public final Builder clusterManagerTimeout(@Nullable Time value) { * API name: {@code cluster_manager_timeout} *

*/ + @Nonnull public final Builder clusterManagerTimeout(Function> fn) { return clusterManagerTimeout(fn.apply(new Time.Builder()).build()); } @@ -426,6 +486,7 @@ public final Builder clusterManagerTimeout(Functionlist to composedOf. *

*/ + @Nonnull public final Builder composedOf(List list) { this.composedOf = _listAddAll(this.composedOf, list); return this; @@ -442,6 +503,7 @@ public final Builder composedOf(List list) { * Adds one or more values to composedOf. *

*/ + @Nonnull public final Builder composedOf(String value, String... values) { this.composedOf = _listAdd(this.composedOf, value, values); return this; @@ -455,6 +517,7 @@ public final Builder composedOf(String value, String... values) { * API name: {@code create} *

*/ + @Nonnull public final Builder create(@Nullable Boolean value) { this.create = value; return this; @@ -463,6 +526,7 @@ public final Builder create(@Nullable Boolean value) { /** * API name: {@code data_stream} */ + @Nonnull public final Builder dataStream(@Nullable IndexTemplateDataStreamConfiguration value) { this.dataStream = value; return this; @@ -471,6 +535,7 @@ public final Builder dataStream(@Nullable IndexTemplateDataStreamConfiguration v /** * API name: {@code data_stream} */ + @Nonnull public final Builder dataStream( Function> fn ) { @@ -484,6 +549,7 @@ public final Builder dataStream( * Adds all elements of list to indexPatterns. *

*/ + @Nonnull public final Builder indexPatterns(List list) { this.indexPatterns = _listAddAll(this.indexPatterns, list); return this; @@ -496,32 +562,35 @@ public final Builder indexPatterns(List list) { * Adds one or more values to indexPatterns. *

*/ + @Nonnull public final Builder indexPatterns(String value, String... values) { this.indexPatterns = _listAdd(this.indexPatterns, value, values); return this; } /** - * Period to wait for a connection to the master node. If no response is received before the timeout expires, the request fails and - * returns an error. + * Period to wait for a connection to the cluster-manager node. If no response is received before the timeout expires, the request + * fails and returns an error. *

* API name: {@code master_timeout} *

*/ @Deprecated + @Nonnull public final Builder masterTimeout(@Nullable Time value) { this.masterTimeout = value; return this; } /** - * Period to wait for a connection to the master node. If no response is received before the timeout expires, the request fails and - * returns an error. + * Period to wait for a connection to the cluster-manager node. If no response is received before the timeout expires, the request + * fails and returns an error. *

* API name: {@code master_timeout} *

*/ @Deprecated + @Nonnull public final Builder masterTimeout(Function> fn) { return masterTimeout(fn.apply(new Time.Builder()).build()); } @@ -533,6 +602,7 @@ public final Builder masterTimeout(Function> f * Adds all elements of map to meta. *

*/ + @Nonnull public final Builder meta(Map map) { this.meta = _mapPutAll(this.meta, map); return this; @@ -545,6 +615,7 @@ public final Builder meta(Map map) { * Adds an entry to meta. *

*/ + @Nonnull public final Builder meta(String key, JsonData value) { this.meta = _mapPut(this.meta, key, value); return this; @@ -556,6 +627,7 @@ public final Builder meta(String key, JsonData value) { * API name: {@code name} *

*/ + @Nonnull public final Builder name(String value) { this.name = value; return this; @@ -569,6 +641,7 @@ public final Builder name(String value) { * API name: {@code priority} *

*/ + @Nonnull public final Builder priority(@Nullable Integer value) { this.priority = value; return this; @@ -577,6 +650,7 @@ public final Builder priority(@Nullable Integer value) { /** * API name: {@code template} */ + @Nonnull public final Builder template(@Nullable IndexTemplateMapping value) { this.template = value; return this; @@ -585,6 +659,7 @@ public final Builder template(@Nullable IndexTemplateMapping value) { /** * API name: {@code template} */ + @Nonnull public final Builder template(Function> fn) { return template(fn.apply(new IndexTemplateMapping.Builder()).build()); } @@ -592,6 +667,7 @@ public final Builder template(Function { @Nonnull private final IndexTemplate indexTemplate; @@ -110,16 +112,46 @@ protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { // --------------------------------------------------------------------------------------------- + @Override + @Nonnull + public Builder toBuilder() { + return new Builder(this); + } + + @Nonnull + public static Builder builder() { + return new Builder(); + } + /** * Builder for {@link IndexTemplateItem}. */ - public static class Builder extends ObjectBuilderBase implements ObjectBuilder { + public static class Builder extends ObjectBuilderBase implements CopyableBuilder { private IndexTemplate indexTemplate; private String name; + public Builder() {} + + private Builder(IndexTemplateItem o) { + this.indexTemplate = o.indexTemplate; + this.name = o.name; + } + + private Builder(Builder o) { + this.indexTemplate = o.indexTemplate; + this.name = o.name; + } + + @Override + @Nonnull + public Builder copy() { + return new Builder(this); + } + /** * Required - API name: {@code index_template} */ + @Nonnull public final Builder indexTemplate(IndexTemplate value) { this.indexTemplate = value; return this; @@ -128,6 +160,7 @@ public final Builder indexTemplate(IndexTemplate value) { /** * Required - API name: {@code index_template} */ + @Nonnull public final Builder indexTemplate(Function> fn) { return indexTemplate(fn.apply(new IndexTemplate.Builder()).build()); } @@ -135,6 +168,7 @@ public final Builder indexTemplate(Function { @Nonnull private final Map aliases; @@ -147,15 +149,24 @@ protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { // --------------------------------------------------------------------------------------------- + @Override + @Nonnull + public Builder toBuilder() { + return new Builder(this); + } + + @Nonnull + public static Builder builder() { + return new Builder(); + } + /** * Builder for {@link IndexTemplateMapping}. */ - public static class Builder extends ObjectBuilderBase implements ObjectBuilder, PlainDeserializable { - @Override - public Builder self() { - return this; - } - + public static class Builder extends ObjectBuilderBase + implements + CopyableBuilder, + PlainDeserializable { @Nullable private Map aliases; @Nullable @@ -163,6 +174,32 @@ public Builder self() { @Nullable private IndexSettings settings; + public Builder() {} + + private Builder(IndexTemplateMapping o) { + this.aliases = _mapCopy(o.aliases); + this.mappings = o.mappings; + this.settings = o.settings; + } + + private Builder(Builder o) { + this.aliases = _mapCopy(o.aliases); + this.mappings = o.mappings; + this.settings = o.settings; + } + + @Override + @Nonnull + public Builder copy() { + return new Builder(this); + } + + @Override + @Nonnull + public Builder self() { + return this; + } + /** * Aliases to add. If the index template includes a data_stream object, these are data stream aliases. Otherwise, these * are index aliases. Data stream aliases ignore the index_routing, routing, and @@ -175,6 +212,7 @@ public Builder self() { * Adds all elements of map to aliases. *

*/ + @Nonnull public final Builder aliases(Map map) { this.aliases = _mapPutAll(this.aliases, map); return this; @@ -192,6 +230,7 @@ public final Builder aliases(Map map) { * Adds an entry to aliases. *

*/ + @Nonnull public final Builder aliases(String key, Alias value) { this.aliases = _mapPut(this.aliases, key, value); return this; @@ -209,6 +248,7 @@ public final Builder aliases(String key, Alias value) { * Adds a value to aliases using a builder lambda. *

*/ + @Nonnull public final Builder aliases(String key, Function> fn) { return aliases(key, fn.apply(new Alias.Builder()).build()); } @@ -216,6 +256,7 @@ public final Builder aliases(String key, Function> fn) { return mappings(fn.apply(new TypeMapping.Builder()).build()); } @@ -231,6 +273,7 @@ public final Builder mappings(Function> fn) { return settings(fn.apply(new IndexSettings.Builder()).build()); } @@ -248,6 +292,8 @@ public final Builder settings(Function { @Nullable private final String actionType; @@ -174,10 +177,21 @@ protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { // --------------------------------------------------------------------------------------------- + @Override + @Nonnull + public Builder toBuilder() { + return new Builder(this); + } + + @Nonnull + public static Builder builder() { + return new Builder(); + } + /** * Builder for {@link Action}. */ - public static class Builder extends ObjectBuilderBase implements ObjectBuilder { + public static class Builder extends ObjectBuilderBase implements CopyableBuilder { @Nullable private String actionType; @Nullable @@ -193,9 +207,38 @@ public static class Builder extends ObjectBuilderBase implements ObjectBuilder
> fn) { return headers(fn.apply(new Headers.Builder()).build()); } @@ -219,6 +264,7 @@ public final Builder headers(Function> f /** * API name: {@code method} */ + @Nonnull public final Builder method(@Nullable String value) { this.method = value; return this; @@ -227,6 +273,7 @@ public final Builder method(@Nullable String value) { /** * API name: {@code post_process_function} */ + @Nonnull public final Builder postProcessFunction(@Nullable String value) { this.postProcessFunction = value; return this; @@ -235,6 +282,7 @@ public final Builder postProcessFunction(@Nullable String value) { /** * API name: {@code pre_process_function} */ + @Nonnull public final Builder preProcessFunction(@Nullable String value) { this.preProcessFunction = value; return this; @@ -243,6 +291,7 @@ public final Builder preProcessFunction(@Nullable String value) { /** * API name: {@code request_body} */ + @Nonnull public final Builder requestBody(@Nullable String value) { this.requestBody = value; return this; @@ -251,6 +300,7 @@ public final Builder requestBody(@Nullable String value) { /** * API name: {@code url} */ + @Nonnull public final Builder url(@Nullable String value) { this.url = value; return this; @@ -261,6 +311,8 @@ public final Builder url(@Nullable String value) { * * @throws NullPointerException if some of the required fields are null. */ + @Override + @Nonnull public Action build() { _checkSingleUse(); diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/ml/ClientConfig.java b/java-client/src/generated/java/org/opensearch/client/opensearch/ml/ClientConfig.java index 9e1be3d3c8..deb319b363 100644 --- a/java-client/src/generated/java/org/opensearch/client/opensearch/ml/ClientConfig.java +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/ml/ClientConfig.java @@ -16,6 +16,7 @@ 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; @@ -23,14 +24,16 @@ 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: ml.ClientConfig @JsonpDeserializable @Generated("org.opensearch.client.codegen.CodeGenerator") -public class ClientConfig implements PlainJsonSerializable { +public class ClientConfig implements PlainJsonSerializable, ToCopyableBuilder { @Nullable private final Integer connectionTimeout; @@ -174,10 +177,21 @@ protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { // --------------------------------------------------------------------------------------------- + @Override + @Nonnull + public Builder toBuilder() { + return new Builder(this); + } + + @Nonnull + public static Builder builder() { + return new Builder(); + } + /** * Builder for {@link ClientConfig}. */ - public static class Builder extends ObjectBuilderBase implements ObjectBuilder { + public static class Builder extends ObjectBuilderBase implements CopyableBuilder { @Nullable private Integer connectionTimeout; @Nullable @@ -193,9 +207,38 @@ public static class Builder extends ObjectBuilderBase implements ObjectBuilder { @Nonnull private final List actions; @@ -195,10 +200,21 @@ protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { } // --------------------------------------------------------------------------------------------- + @Override + @Nonnull + public Builder toBuilder() { + return new Builder(this); + } + + @Nonnull + public static Builder builder() { + return new Builder(); + } + /** * Builder for {@link CreateConnectorRequest}. */ - public static class Builder extends ObjectBuilderBase implements ObjectBuilder { + public static class Builder extends ObjectBuilderBase implements CopyableBuilder { private List actions; @Nullable private ClientConfig clientConfig; @@ -209,6 +225,36 @@ public static class Builder extends ObjectBuilderBase implements ObjectBuilderlist to actions. *

*/ + @Nonnull public final Builder actions(List list) { this.actions = _listAddAll(this.actions, list); return this; @@ -228,6 +275,7 @@ public final Builder actions(List list) { * Adds one or more values to actions. *

*/ + @Nonnull public final Builder actions(Action value, Action... values) { this.actions = _listAdd(this.actions, value, values); return this; @@ -240,6 +288,7 @@ public final Builder actions(Action value, Action... values) { * Adds a value to actions using a builder lambda. *

*/ + @Nonnull public final Builder actions(Function> fn) { return actions(fn.apply(new Action.Builder()).build()); } @@ -247,6 +296,7 @@ public final Builder actions(Function> fn) /** * API name: {@code client_config} */ + @Nonnull public final Builder clientConfig(@Nullable ClientConfig value) { this.clientConfig = value; return this; @@ -255,6 +305,7 @@ public final Builder clientConfig(@Nullable ClientConfig value) { /** * API name: {@code client_config} */ + @Nonnull public final Builder clientConfig(Function> fn) { return clientConfig(fn.apply(new ClientConfig.Builder()).build()); } @@ -262,6 +313,7 @@ public final Builder clientConfig(Function> fn) { return credential(fn.apply(new Credential.Builder()).build()); } @@ -277,6 +330,7 @@ public final Builder credential(Functionmap to parameters. *

*/ + @Nonnull public final Builder parameters(Map map) { this.parameters = _mapPutAll(this.parameters, map); return this; @@ -309,6 +365,7 @@ public final Builder parameters(Map map) { * Adds an entry to parameters. *

*/ + @Nonnull public final Builder parameters(String key, JsonData value) { this.parameters = _mapPut(this.parameters, key, value); return this; @@ -317,6 +374,7 @@ public final Builder parameters(String key, JsonData value) { /** * Required - API name: {@code protocol} */ + @Nonnull public final Builder protocol(String value) { this.protocol = value; return this; @@ -325,6 +383,7 @@ public final Builder protocol(String value) { /** * Required - API name: {@code version} */ + @Nonnull public final Builder version(int value) { this.version = value; return this; @@ -335,6 +394,8 @@ public final Builder version(int value) { * * @throws NullPointerException if some of the required fields are null. */ + @Override + @Nonnull public CreateConnectorRequest build() { _checkSingleUse(); diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/ml/CreateConnectorResponse.java b/java-client/src/generated/java/org/opensearch/client/opensearch/ml/CreateConnectorResponse.java index 80f3a28064..de1e7a0d89 100644 --- a/java-client/src/generated/java/org/opensearch/client/opensearch/ml/CreateConnectorResponse.java +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/ml/CreateConnectorResponse.java @@ -16,6 +16,7 @@ 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; @@ -23,14 +24,19 @@ 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: ml.create_connector.Response @JsonpDeserializable @Generated("org.opensearch.client.codegen.CodeGenerator") -public class CreateConnectorResponse implements PlainJsonSerializable { +public class CreateConnectorResponse + implements + PlainJsonSerializable, + ToCopyableBuilder { @Nullable private final String connectorId; @@ -72,16 +78,44 @@ protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { // --------------------------------------------------------------------------------------------- + @Override + @Nonnull + public Builder toBuilder() { + return new Builder(this); + } + + @Nonnull + public static Builder builder() { + return new Builder(); + } + /** * Builder for {@link CreateConnectorResponse}. */ - public static class Builder extends ObjectBuilderBase implements ObjectBuilder { + public static class Builder extends ObjectBuilderBase implements CopyableBuilder { @Nullable private String connectorId; + public Builder() {} + + private Builder(CreateConnectorResponse o) { + this.connectorId = o.connectorId; + } + + private Builder(Builder o) { + this.connectorId = o.connectorId; + } + + @Override + @Nonnull + public Builder copy() { + return new Builder(this); + } + /** * API name: {@code connector_id} */ + @Nonnull public final Builder connectorId(@Nullable String value) { this.connectorId = value; return this; @@ -92,6 +126,8 @@ public final Builder connectorId(@Nullable String value) { * * @throws NullPointerException if some of the required fields are null. */ + @Override + @Nonnull public CreateConnectorResponse build() { _checkSingleUse(); diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/ml/Credential.java b/java-client/src/generated/java/org/opensearch/client/opensearch/ml/Credential.java index 4a6ed07f78..25d827b821 100644 --- a/java-client/src/generated/java/org/opensearch/client/opensearch/ml/Credential.java +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/ml/Credential.java @@ -28,14 +28,16 @@ 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: ml.Credential @JsonpDeserializable @Generated("org.opensearch.client.codegen.CodeGenerator") -public class Credential implements PlainJsonSerializable { +public class Credential implements PlainJsonSerializable, ToCopyableBuilder { @Nullable private final String accessKey; @@ -126,10 +128,21 @@ protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { // --------------------------------------------------------------------------------------------- + @Override + @Nonnull + public Builder toBuilder() { + return new Builder(this); + } + + @Nonnull + public static Builder builder() { + return new Builder(); + } + /** * Builder for {@link Credential}. */ - public static class Builder extends ObjectBuilderBase implements ObjectBuilder { + public static class Builder extends ObjectBuilderBase implements CopyableBuilder { @Nullable private String accessKey; @Nullable @@ -139,9 +152,32 @@ public static class Builder extends ObjectBuilderBase implements ObjectBuilder metadata; + public Builder() {} + + private Builder(Credential o) { + this.accessKey = o.accessKey; + this.secretKey = o.secretKey; + this.sessionToken = o.sessionToken; + this.metadata = _mapCopy(o.metadata); + } + + private Builder(Builder o) { + this.accessKey = o.accessKey; + this.secretKey = o.secretKey; + this.sessionToken = o.sessionToken; + this.metadata = _mapCopy(o.metadata); + } + + @Override + @Nonnull + public Builder copy() { + return new Builder(this); + } + /** * API name: {@code access_key} */ + @Nonnull public final Builder accessKey(@Nullable String value) { this.accessKey = value; return this; @@ -150,6 +186,7 @@ public final Builder accessKey(@Nullable String value) { /** * API name: {@code secret_key} */ + @Nonnull public final Builder secretKey(@Nullable String value) { this.secretKey = value; return this; @@ -158,6 +195,7 @@ public final Builder secretKey(@Nullable String value) { /** * API name: {@code session_token} */ + @Nonnull public final Builder sessionToken(@Nullable String value) { this.sessionToken = value; return this; @@ -169,6 +207,7 @@ public final Builder sessionToken(@Nullable String value) { * Adds all elements of map to metadata. *

*/ + @Nonnull public final Builder metadata(Map map) { this.metadata = _mapPutAll(this.metadata, map); return this; @@ -180,6 +219,7 @@ public final Builder metadata(Map map) { * Adds an entry to metadata. *

*/ + @Nonnull public final Builder metadata(String key, JsonData value) { this.metadata = _mapPut(this.metadata, key, value); return this; @@ -190,6 +230,8 @@ public final Builder metadata(String key, JsonData value) { * * @throws NullPointerException if some of the required fields are null. */ + @Override + @Nonnull public Credential build() { _checkSingleUse(); diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/ml/DeleteAgentRequest.java b/java-client/src/generated/java/org/opensearch/client/opensearch/ml/DeleteAgentRequest.java index 4d155c9252..f2a3437e27 100644 --- a/java-client/src/generated/java/org/opensearch/client/opensearch/ml/DeleteAgentRequest.java +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/ml/DeleteAgentRequest.java @@ -20,8 +20,10 @@ import org.opensearch.client.transport.Endpoint; import org.opensearch.client.transport.endpoints.SimpleEndpoint; 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: ml.delete_agent.Request @@ -29,7 +31,7 @@ * Delete an agent. */ @Generated("org.opensearch.client.codegen.CodeGenerator") -public class DeleteAgentRequest extends RequestBase { +public class DeleteAgentRequest extends RequestBase implements ToCopyableBuilder { @Nonnull private final String agentId; @@ -54,15 +56,43 @@ public final String agentId() { // --------------------------------------------------------------------------------------------- + @Override + @Nonnull + public Builder toBuilder() { + return new Builder(this); + } + + @Nonnull + public static Builder builder() { + return new Builder(); + } + /** * Builder for {@link DeleteAgentRequest}. */ - public static class Builder extends ObjectBuilderBase implements ObjectBuilder { + public static class Builder extends ObjectBuilderBase implements CopyableBuilder { private String agentId; + public Builder() {} + + private Builder(DeleteAgentRequest o) { + this.agentId = o.agentId; + } + + private Builder(Builder o) { + this.agentId = o.agentId; + } + + @Override + @Nonnull + public Builder copy() { + return new Builder(this); + } + /** * Required - API name: {@code agent_id} */ + @Nonnull public final Builder agentId(String value) { this.agentId = value; return this; @@ -73,6 +103,8 @@ public final Builder agentId(String value) { * * @throws NullPointerException if some of the required fields are null. */ + @Override + @Nonnull public DeleteAgentRequest build() { _checkSingleUse(); diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/ml/DeleteAgentResponse.java b/java-client/src/generated/java/org/opensearch/client/opensearch/ml/DeleteAgentResponse.java index 9d28e7ac7c..1dcf09e849 100644 --- a/java-client/src/generated/java/org/opensearch/client/opensearch/ml/DeleteAgentResponse.java +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/ml/DeleteAgentResponse.java @@ -14,18 +14,21 @@ 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.ObjectBuilderDeserializer; import org.opensearch.client.json.ObjectDeserializer; import org.opensearch.client.opensearch._types.WriteResponseBase; +import org.opensearch.client.util.CopyableBuilder; import org.opensearch.client.util.ObjectBuilder; +import org.opensearch.client.util.ToCopyableBuilder; // typedef: ml.delete_agent.Response @JsonpDeserializable @Generated("org.opensearch.client.codegen.CodeGenerator") -public class DeleteAgentResponse extends WriteResponseBase { +public class DeleteAgentResponse extends WriteResponseBase implements ToCopyableBuilder { // --------------------------------------------------------------------------------------------- @@ -39,12 +42,42 @@ public static DeleteAgentResponse of(Function implements ObjectBuilder { + public static class Builder extends WriteResponseBase.AbstractBuilder + implements + CopyableBuilder { + + public Builder() {} + + private Builder(DeleteAgentResponse o) { + super(o); + } + + private Builder(Builder o) { + super(o); + } @Override + @Nonnull + public Builder copy() { + return new Builder(this); + } + + @Override + @Nonnull protected Builder self() { return this; } @@ -54,6 +87,8 @@ protected Builder self() { * * @throws NullPointerException if some of the required fields are null. */ + @Override + @Nonnull public DeleteAgentResponse build() { _checkSingleUse(); diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/ml/DeleteConnectorRequest.java b/java-client/src/generated/java/org/opensearch/client/opensearch/ml/DeleteConnectorRequest.java index 67dc24abbf..2c47cdabb7 100644 --- a/java-client/src/generated/java/org/opensearch/client/opensearch/ml/DeleteConnectorRequest.java +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/ml/DeleteConnectorRequest.java @@ -20,8 +20,10 @@ import org.opensearch.client.transport.Endpoint; import org.opensearch.client.transport.endpoints.SimpleEndpoint; 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: ml.delete_connector.Request @@ -29,7 +31,9 @@ * Deletes a standalone connector. */ @Generated("org.opensearch.client.codegen.CodeGenerator") -public class DeleteConnectorRequest extends RequestBase { +public class DeleteConnectorRequest extends RequestBase + implements + ToCopyableBuilder { @Nonnull private final String connectorId; @@ -54,15 +58,43 @@ public final String connectorId() { // --------------------------------------------------------------------------------------------- + @Override + @Nonnull + public Builder toBuilder() { + return new Builder(this); + } + + @Nonnull + public static Builder builder() { + return new Builder(); + } + /** * Builder for {@link DeleteConnectorRequest}. */ - public static class Builder extends ObjectBuilderBase implements ObjectBuilder { + public static class Builder extends ObjectBuilderBase implements CopyableBuilder { private String connectorId; + public Builder() {} + + private Builder(DeleteConnectorRequest o) { + this.connectorId = o.connectorId; + } + + private Builder(Builder o) { + this.connectorId = o.connectorId; + } + + @Override + @Nonnull + public Builder copy() { + return new Builder(this); + } + /** * Required - API name: {@code connector_id} */ + @Nonnull public final Builder connectorId(String value) { this.connectorId = value; return this; @@ -73,6 +105,8 @@ public final Builder connectorId(String value) { * * @throws NullPointerException if some of the required fields are null. */ + @Override + @Nonnull public DeleteConnectorRequest build() { _checkSingleUse(); diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/ml/DeleteConnectorResponse.java b/java-client/src/generated/java/org/opensearch/client/opensearch/ml/DeleteConnectorResponse.java index 6b5b4505c1..87c913c9c7 100644 --- a/java-client/src/generated/java/org/opensearch/client/opensearch/ml/DeleteConnectorResponse.java +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/ml/DeleteConnectorResponse.java @@ -14,18 +14,23 @@ 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.ObjectBuilderDeserializer; import org.opensearch.client.json.ObjectDeserializer; import org.opensearch.client.opensearch._types.WriteResponseBase; +import org.opensearch.client.util.CopyableBuilder; import org.opensearch.client.util.ObjectBuilder; +import org.opensearch.client.util.ToCopyableBuilder; // typedef: ml.delete_connector.Response @JsonpDeserializable @Generated("org.opensearch.client.codegen.CodeGenerator") -public class DeleteConnectorResponse extends WriteResponseBase { +public class DeleteConnectorResponse extends WriteResponseBase + implements + ToCopyableBuilder { // --------------------------------------------------------------------------------------------- @@ -39,12 +44,42 @@ public static DeleteConnectorResponse of(Function implements ObjectBuilder { + public static class Builder extends WriteResponseBase.AbstractBuilder + implements + CopyableBuilder { + + public Builder() {} + + private Builder(DeleteConnectorResponse o) { + super(o); + } + + private Builder(Builder o) { + super(o); + } @Override + @Nonnull + public Builder copy() { + return new Builder(this); + } + + @Override + @Nonnull protected Builder self() { return this; } @@ -54,6 +89,8 @@ protected Builder self() { * * @throws NullPointerException if some of the required fields are null. */ + @Override + @Nonnull public DeleteConnectorResponse build() { _checkSingleUse(); diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/ml/DeleteModelGroupRequest.java b/java-client/src/generated/java/org/opensearch/client/opensearch/ml/DeleteModelGroupRequest.java index 4d4bf9975e..4c0388273a 100644 --- a/java-client/src/generated/java/org/opensearch/client/opensearch/ml/DeleteModelGroupRequest.java +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/ml/DeleteModelGroupRequest.java @@ -20,8 +20,10 @@ import org.opensearch.client.transport.Endpoint; import org.opensearch.client.transport.endpoints.SimpleEndpoint; 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: ml.delete_model_group.Request @@ -29,7 +31,9 @@ * Deletes a model group. */ @Generated("org.opensearch.client.codegen.CodeGenerator") -public class DeleteModelGroupRequest extends RequestBase { +public class DeleteModelGroupRequest extends RequestBase + implements + ToCopyableBuilder { @Nonnull private final String modelGroupId; @@ -54,15 +58,43 @@ public final String modelGroupId() { // --------------------------------------------------------------------------------------------- + @Override + @Nonnull + public Builder toBuilder() { + return new Builder(this); + } + + @Nonnull + public static Builder builder() { + return new Builder(); + } + /** * Builder for {@link DeleteModelGroupRequest}. */ - public static class Builder extends ObjectBuilderBase implements ObjectBuilder { + public static class Builder extends ObjectBuilderBase implements CopyableBuilder { private String modelGroupId; + public Builder() {} + + private Builder(DeleteModelGroupRequest o) { + this.modelGroupId = o.modelGroupId; + } + + private Builder(Builder o) { + this.modelGroupId = o.modelGroupId; + } + + @Override + @Nonnull + public Builder copy() { + return new Builder(this); + } + /** * Required - API name: {@code model_group_id} */ + @Nonnull public final Builder modelGroupId(String value) { this.modelGroupId = value; return this; @@ -73,6 +105,8 @@ public final Builder modelGroupId(String value) { * * @throws NullPointerException if some of the required fields are null. */ + @Override + @Nonnull public DeleteModelGroupRequest build() { _checkSingleUse(); diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/ml/DeleteModelGroupResponse.java b/java-client/src/generated/java/org/opensearch/client/opensearch/ml/DeleteModelGroupResponse.java index 668e866e41..eca7e69021 100644 --- a/java-client/src/generated/java/org/opensearch/client/opensearch/ml/DeleteModelGroupResponse.java +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/ml/DeleteModelGroupResponse.java @@ -14,18 +14,23 @@ 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.ObjectBuilderDeserializer; import org.opensearch.client.json.ObjectDeserializer; import org.opensearch.client.opensearch._types.WriteResponseBase; +import org.opensearch.client.util.CopyableBuilder; import org.opensearch.client.util.ObjectBuilder; +import org.opensearch.client.util.ToCopyableBuilder; // typedef: ml.delete_model_group.Response @JsonpDeserializable @Generated("org.opensearch.client.codegen.CodeGenerator") -public class DeleteModelGroupResponse extends WriteResponseBase { +public class DeleteModelGroupResponse extends WriteResponseBase + implements + ToCopyableBuilder { // --------------------------------------------------------------------------------------------- @@ -39,12 +44,42 @@ public static DeleteModelGroupResponse of(Function implements ObjectBuilder { + public static class Builder extends WriteResponseBase.AbstractBuilder + implements + CopyableBuilder { + + public Builder() {} + + private Builder(DeleteModelGroupResponse o) { + super(o); + } + + private Builder(Builder o) { + super(o); + } @Override + @Nonnull + public Builder copy() { + return new Builder(this); + } + + @Override + @Nonnull protected Builder self() { return this; } @@ -54,6 +89,8 @@ protected Builder self() { * * @throws NullPointerException if some of the required fields are null. */ + @Override + @Nonnull public DeleteModelGroupResponse build() { _checkSingleUse(); diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/ml/DeleteModelRequest.java b/java-client/src/generated/java/org/opensearch/client/opensearch/ml/DeleteModelRequest.java index 21c8977ae0..afe161a6af 100644 --- a/java-client/src/generated/java/org/opensearch/client/opensearch/ml/DeleteModelRequest.java +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/ml/DeleteModelRequest.java @@ -20,8 +20,10 @@ import org.opensearch.client.transport.Endpoint; import org.opensearch.client.transport.endpoints.SimpleEndpoint; 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: ml.delete_model.Request @@ -29,7 +31,7 @@ * Deletes a model. */ @Generated("org.opensearch.client.codegen.CodeGenerator") -public class DeleteModelRequest extends RequestBase { +public class DeleteModelRequest extends RequestBase implements ToCopyableBuilder { @Nonnull private final String modelId; @@ -54,15 +56,43 @@ public final String modelId() { // --------------------------------------------------------------------------------------------- + @Override + @Nonnull + public Builder toBuilder() { + return new Builder(this); + } + + @Nonnull + public static Builder builder() { + return new Builder(); + } + /** * Builder for {@link DeleteModelRequest}. */ - public static class Builder extends ObjectBuilderBase implements ObjectBuilder { + public static class Builder extends ObjectBuilderBase implements CopyableBuilder { private String modelId; + public Builder() {} + + private Builder(DeleteModelRequest o) { + this.modelId = o.modelId; + } + + private Builder(Builder o) { + this.modelId = o.modelId; + } + + @Override + @Nonnull + public Builder copy() { + return new Builder(this); + } + /** * Required - API name: {@code model_id} */ + @Nonnull public final Builder modelId(String value) { this.modelId = value; return this; @@ -73,6 +103,8 @@ public final Builder modelId(String value) { * * @throws NullPointerException if some of the required fields are null. */ + @Override + @Nonnull public DeleteModelRequest build() { _checkSingleUse(); diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/ml/DeleteModelResponse.java b/java-client/src/generated/java/org/opensearch/client/opensearch/ml/DeleteModelResponse.java index b287fe2481..acba219eba 100644 --- a/java-client/src/generated/java/org/opensearch/client/opensearch/ml/DeleteModelResponse.java +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/ml/DeleteModelResponse.java @@ -14,18 +14,21 @@ 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.ObjectBuilderDeserializer; import org.opensearch.client.json.ObjectDeserializer; import org.opensearch.client.opensearch._types.WriteResponseBase; +import org.opensearch.client.util.CopyableBuilder; import org.opensearch.client.util.ObjectBuilder; +import org.opensearch.client.util.ToCopyableBuilder; // typedef: ml.delete_model.Response @JsonpDeserializable @Generated("org.opensearch.client.codegen.CodeGenerator") -public class DeleteModelResponse extends WriteResponseBase { +public class DeleteModelResponse extends WriteResponseBase implements ToCopyableBuilder { // --------------------------------------------------------------------------------------------- @@ -39,12 +42,42 @@ public static DeleteModelResponse of(Function implements ObjectBuilder { + public static class Builder extends WriteResponseBase.AbstractBuilder + implements + CopyableBuilder { + + public Builder() {} + + private Builder(DeleteModelResponse o) { + super(o); + } + + private Builder(Builder o) { + super(o); + } @Override + @Nonnull + public Builder copy() { + return new Builder(this); + } + + @Override + @Nonnull protected Builder self() { return this; } @@ -54,6 +87,8 @@ protected Builder self() { * * @throws NullPointerException if some of the required fields are null. */ + @Override + @Nonnull public DeleteModelResponse build() { _checkSingleUse(); diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/ml/DeleteTaskRequest.java b/java-client/src/generated/java/org/opensearch/client/opensearch/ml/DeleteTaskRequest.java index 7ff50996a8..2d2f956fb7 100644 --- a/java-client/src/generated/java/org/opensearch/client/opensearch/ml/DeleteTaskRequest.java +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/ml/DeleteTaskRequest.java @@ -20,8 +20,10 @@ import org.opensearch.client.transport.Endpoint; import org.opensearch.client.transport.endpoints.SimpleEndpoint; 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: ml.delete_task.Request @@ -29,7 +31,7 @@ * Deletes a task. */ @Generated("org.opensearch.client.codegen.CodeGenerator") -public class DeleteTaskRequest extends RequestBase { +public class DeleteTaskRequest extends RequestBase implements ToCopyableBuilder { @Nonnull private final String taskId; @@ -54,15 +56,43 @@ public final String taskId() { // --------------------------------------------------------------------------------------------- + @Override + @Nonnull + public Builder toBuilder() { + return new Builder(this); + } + + @Nonnull + public static Builder builder() { + return new Builder(); + } + /** * Builder for {@link DeleteTaskRequest}. */ - public static class Builder extends ObjectBuilderBase implements ObjectBuilder { + public static class Builder extends ObjectBuilderBase implements CopyableBuilder { private String taskId; + public Builder() {} + + private Builder(DeleteTaskRequest o) { + this.taskId = o.taskId; + } + + private Builder(Builder o) { + this.taskId = o.taskId; + } + + @Override + @Nonnull + public Builder copy() { + return new Builder(this); + } + /** * Required - API name: {@code task_id} */ + @Nonnull public final Builder taskId(String value) { this.taskId = value; return this; @@ -73,6 +103,8 @@ public final Builder taskId(String value) { * * @throws NullPointerException if some of the required fields are null. */ + @Override + @Nonnull public DeleteTaskRequest build() { _checkSingleUse(); diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/ml/DeleteTaskResponse.java b/java-client/src/generated/java/org/opensearch/client/opensearch/ml/DeleteTaskResponse.java index 36cd9a2740..01b446399b 100644 --- a/java-client/src/generated/java/org/opensearch/client/opensearch/ml/DeleteTaskResponse.java +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/ml/DeleteTaskResponse.java @@ -14,18 +14,21 @@ 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.ObjectBuilderDeserializer; import org.opensearch.client.json.ObjectDeserializer; import org.opensearch.client.opensearch._types.WriteResponseBase; +import org.opensearch.client.util.CopyableBuilder; import org.opensearch.client.util.ObjectBuilder; +import org.opensearch.client.util.ToCopyableBuilder; // typedef: ml.delete_task.Response @JsonpDeserializable @Generated("org.opensearch.client.codegen.CodeGenerator") -public class DeleteTaskResponse extends WriteResponseBase { +public class DeleteTaskResponse extends WriteResponseBase implements ToCopyableBuilder { // --------------------------------------------------------------------------------------------- @@ -39,12 +42,40 @@ public static DeleteTaskResponse of(Function implements ObjectBuilder { + public static class Builder extends WriteResponseBase.AbstractBuilder implements CopyableBuilder { + + public Builder() {} + + private Builder(DeleteTaskResponse o) { + super(o); + } + + private Builder(Builder o) { + super(o); + } @Override + @Nonnull + public Builder copy() { + return new Builder(this); + } + + @Override + @Nonnull protected Builder self() { return this; } @@ -54,6 +85,8 @@ protected Builder self() { * * @throws NullPointerException if some of the required fields are null. */ + @Override + @Nonnull public DeleteTaskResponse build() { _checkSingleUse(); diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/ml/DeployModelRequest.java b/java-client/src/generated/java/org/opensearch/client/opensearch/ml/DeployModelRequest.java index 0b41a42145..f8b0f487ef 100644 --- a/java-client/src/generated/java/org/opensearch/client/opensearch/ml/DeployModelRequest.java +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/ml/DeployModelRequest.java @@ -20,8 +20,10 @@ import org.opensearch.client.transport.Endpoint; import org.opensearch.client.transport.endpoints.SimpleEndpoint; 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: ml.deploy_model.Request @@ -29,7 +31,7 @@ * Deploys a model. */ @Generated("org.opensearch.client.codegen.CodeGenerator") -public class DeployModelRequest extends RequestBase { +public class DeployModelRequest extends RequestBase implements ToCopyableBuilder { @Nonnull private final String modelId; @@ -54,15 +56,43 @@ public final String modelId() { // --------------------------------------------------------------------------------------------- + @Override + @Nonnull + public Builder toBuilder() { + return new Builder(this); + } + + @Nonnull + public static Builder builder() { + return new Builder(); + } + /** * Builder for {@link DeployModelRequest}. */ - public static class Builder extends ObjectBuilderBase implements ObjectBuilder { + public static class Builder extends ObjectBuilderBase implements CopyableBuilder { private String modelId; + public Builder() {} + + private Builder(DeployModelRequest o) { + this.modelId = o.modelId; + } + + private Builder(Builder o) { + this.modelId = o.modelId; + } + + @Override + @Nonnull + public Builder copy() { + return new Builder(this); + } + /** * Required - API name: {@code model_id} */ + @Nonnull public final Builder modelId(String value) { this.modelId = value; return this; @@ -73,6 +103,8 @@ public final Builder modelId(String value) { * * @throws NullPointerException if some of the required fields are null. */ + @Override + @Nonnull public DeployModelRequest build() { _checkSingleUse(); diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/ml/DeployModelResponse.java b/java-client/src/generated/java/org/opensearch/client/opensearch/ml/DeployModelResponse.java index b9d2053907..08ef8f00e6 100644 --- a/java-client/src/generated/java/org/opensearch/client/opensearch/ml/DeployModelResponse.java +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/ml/DeployModelResponse.java @@ -25,14 +25,16 @@ 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: ml.deploy_model.Response @JsonpDeserializable @Generated("org.opensearch.client.codegen.CodeGenerator") -public class DeployModelResponse implements PlainJsonSerializable { +public class DeployModelResponse implements PlainJsonSerializable, ToCopyableBuilder { @Nonnull private final String status; @@ -104,18 +106,50 @@ protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { // --------------------------------------------------------------------------------------------- + @Override + @Nonnull + public Builder toBuilder() { + return new Builder(this); + } + + @Nonnull + public static Builder builder() { + return new Builder(); + } + /** * Builder for {@link DeployModelResponse}. */ - public static class Builder extends ObjectBuilderBase implements ObjectBuilder { + public static class Builder extends ObjectBuilderBase implements CopyableBuilder { private String status; private String taskId; @Nullable private String taskType; + public Builder() {} + + private Builder(DeployModelResponse o) { + this.status = o.status; + this.taskId = o.taskId; + this.taskType = o.taskType; + } + + private Builder(Builder o) { + this.status = o.status; + this.taskId = o.taskId; + this.taskType = o.taskType; + } + + @Override + @Nonnull + public Builder copy() { + return new Builder(this); + } + /** * Required - API name: {@code status} */ + @Nonnull public final Builder status(String value) { this.status = value; return this; @@ -124,6 +158,7 @@ public final Builder status(String value) { /** * Required - API name: {@code task_id} */ + @Nonnull public final Builder taskId(String value) { this.taskId = value; return this; @@ -132,6 +167,7 @@ public final Builder taskId(String value) { /** * API name: {@code task_type} */ + @Nonnull public final Builder taskType(@Nullable String value) { this.taskType = value; return this; @@ -142,6 +178,8 @@ public final Builder taskType(@Nullable String value) { * * @throws NullPointerException if some of the required fields are null. */ + @Override + @Nonnull public DeployModelResponse build() { _checkSingleUse(); diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/ml/GetModelGroupRequest.java b/java-client/src/generated/java/org/opensearch/client/opensearch/ml/GetModelGroupRequest.java index 77c4664e4d..f593849918 100644 --- a/java-client/src/generated/java/org/opensearch/client/opensearch/ml/GetModelGroupRequest.java +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/ml/GetModelGroupRequest.java @@ -20,8 +20,10 @@ import org.opensearch.client.transport.Endpoint; import org.opensearch.client.transport.endpoints.SimpleEndpoint; 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: ml.get_model_group.Request @@ -29,7 +31,7 @@ * Retrieves a model group. */ @Generated("org.opensearch.client.codegen.CodeGenerator") -public class GetModelGroupRequest extends RequestBase { +public class GetModelGroupRequest extends RequestBase implements ToCopyableBuilder { @Nonnull private final String modelGroupId; @@ -54,15 +56,43 @@ public final String modelGroupId() { // --------------------------------------------------------------------------------------------- + @Override + @Nonnull + public Builder toBuilder() { + return new Builder(this); + } + + @Nonnull + public static Builder builder() { + return new Builder(); + } + /** * Builder for {@link GetModelGroupRequest}. */ - public static class Builder extends ObjectBuilderBase implements ObjectBuilder { + public static class Builder extends ObjectBuilderBase implements CopyableBuilder { private String modelGroupId; + public Builder() {} + + private Builder(GetModelGroupRequest o) { + this.modelGroupId = o.modelGroupId; + } + + private Builder(Builder o) { + this.modelGroupId = o.modelGroupId; + } + + @Override + @Nonnull + public Builder copy() { + return new Builder(this); + } + /** * Required - API name: {@code model_group_id} */ + @Nonnull public final Builder modelGroupId(String value) { this.modelGroupId = value; return this; @@ -73,6 +103,8 @@ public final Builder modelGroupId(String value) { * * @throws NullPointerException if some of the required fields are null. */ + @Override + @Nonnull public GetModelGroupRequest build() { _checkSingleUse(); diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/ml/GetModelGroupResponse.java b/java-client/src/generated/java/org/opensearch/client/opensearch/ml/GetModelGroupResponse.java index 500f9ea5a2..143e1227f1 100644 --- a/java-client/src/generated/java/org/opensearch/client/opensearch/ml/GetModelGroupResponse.java +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/ml/GetModelGroupResponse.java @@ -25,14 +25,19 @@ 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: ml.get_model_group.Response @JsonpDeserializable @Generated("org.opensearch.client.codegen.CodeGenerator") -public class GetModelGroupResponse implements PlainJsonSerializable { +public class GetModelGroupResponse + implements + PlainJsonSerializable, + ToCopyableBuilder { @Nonnull private final String access; @@ -161,10 +166,21 @@ protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { // --------------------------------------------------------------------------------------------- + @Override + @Nonnull + public Builder toBuilder() { + return new Builder(this); + } + + @Nonnull + public static Builder builder() { + return new Builder(); + } + /** * Builder for {@link GetModelGroupResponse}. */ - public static class Builder extends ObjectBuilderBase implements ObjectBuilder { + public static class Builder extends ObjectBuilderBase implements CopyableBuilder { private String access; @Nullable private Long createdTime; @@ -174,12 +190,39 @@ public static class Builder extends ObjectBuilderBase implements ObjectBuilder * API name: {@code access} *

*/ + @Nonnull public final Builder access(String value) { this.access = value; return this; @@ -188,6 +231,7 @@ public final Builder access(String value) { /** * API name: {@code created_time} */ + @Nonnull public final Builder createdTime(@Nullable Long value) { this.createdTime = value; return this; @@ -199,6 +243,7 @@ public final Builder createdTime(@Nullable Long value) { * API name: {@code description} *

*/ + @Nonnull public final Builder description(String value) { this.description = value; return this; @@ -207,6 +252,7 @@ public final Builder description(String value) { /** * API name: {@code last_updated_time} */ + @Nonnull public final Builder lastUpdatedTime(@Nullable Long value) { this.lastUpdatedTime = value; return this; @@ -218,6 +264,7 @@ public final Builder lastUpdatedTime(@Nullable Long value) { * API name: {@code latest_version} *

*/ + @Nonnull public final Builder latestVersion(int value) { this.latestVersion = value; return this; @@ -229,6 +276,7 @@ public final Builder latestVersion(int value) { * API name: {@code name} *

*/ + @Nonnull public final Builder name(String value) { this.name = value; return this; @@ -239,6 +287,8 @@ public final Builder name(String value) { * * @throws NullPointerException if some of the required fields are null. */ + @Override + @Nonnull public GetModelGroupResponse build() { _checkSingleUse(); diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/ml/GetTaskRequest.java b/java-client/src/generated/java/org/opensearch/client/opensearch/ml/GetTaskRequest.java index 00f6cfa67e..4803211923 100644 --- a/java-client/src/generated/java/org/opensearch/client/opensearch/ml/GetTaskRequest.java +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/ml/GetTaskRequest.java @@ -20,8 +20,10 @@ import org.opensearch.client.transport.Endpoint; import org.opensearch.client.transport.endpoints.SimpleEndpoint; 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: ml.get_task.Request @@ -29,7 +31,7 @@ * Retrieves a task. */ @Generated("org.opensearch.client.codegen.CodeGenerator") -public class GetTaskRequest extends RequestBase { +public class GetTaskRequest extends RequestBase implements ToCopyableBuilder { @Nonnull private final String taskId; @@ -54,15 +56,43 @@ public final String taskId() { // --------------------------------------------------------------------------------------------- + @Override + @Nonnull + public Builder toBuilder() { + return new Builder(this); + } + + @Nonnull + public static Builder builder() { + return new Builder(); + } + /** * Builder for {@link GetTaskRequest}. */ - public static class Builder extends ObjectBuilderBase implements ObjectBuilder { + public static class Builder extends ObjectBuilderBase implements CopyableBuilder { private String taskId; + public Builder() {} + + private Builder(GetTaskRequest o) { + this.taskId = o.taskId; + } + + private Builder(Builder o) { + this.taskId = o.taskId; + } + + @Override + @Nonnull + public Builder copy() { + return new Builder(this); + } + /** * Required - API name: {@code task_id} */ + @Nonnull public final Builder taskId(String value) { this.taskId = value; return this; @@ -73,6 +103,8 @@ public final Builder taskId(String value) { * * @throws NullPointerException if some of the required fields are null. */ + @Override + @Nonnull public GetTaskRequest build() { _checkSingleUse(); diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/ml/GetTaskResponse.java b/java-client/src/generated/java/org/opensearch/client/opensearch/ml/GetTaskResponse.java index bc7cb0c1c5..244b8196e7 100644 --- a/java-client/src/generated/java/org/opensearch/client/opensearch/ml/GetTaskResponse.java +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/ml/GetTaskResponse.java @@ -26,14 +26,16 @@ 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: ml.get_task.Response @JsonpDeserializable @Generated("org.opensearch.client.codegen.CodeGenerator") -public class GetTaskResponse implements PlainJsonSerializable { +public class GetTaskResponse implements PlainJsonSerializable, ToCopyableBuilder { @Nullable private final Long createTime; @@ -237,10 +239,21 @@ protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { // --------------------------------------------------------------------------------------------- + @Override + @Nonnull + public Builder toBuilder() { + return new Builder(this); + } + + @Nonnull + public static Builder builder() { + return new Builder(); + } + /** * Builder for {@link GetTaskResponse}. */ - public static class Builder extends ObjectBuilderBase implements ObjectBuilder { + public static class Builder extends ObjectBuilderBase implements CopyableBuilder { @Nullable private Long createTime; @Nullable @@ -261,9 +274,44 @@ public static class Builder extends ObjectBuilderBase implements ObjectBuilder> workerNode; + public Builder() {} + + private Builder(GetTaskResponse o) { + this.createTime = o.createTime; + this.error = o.error; + this.functionName = o.functionName; + this.isAsync = o.isAsync; + this.lastUpdateTime = o.lastUpdateTime; + this.modelId = o.modelId; + this.state = o.state; + this.taskId = o.taskId; + this.taskType = o.taskType; + this.workerNode = _listCopy(o.workerNode); + } + + private Builder(Builder o) { + this.createTime = o.createTime; + this.error = o.error; + this.functionName = o.functionName; + this.isAsync = o.isAsync; + this.lastUpdateTime = o.lastUpdateTime; + this.modelId = o.modelId; + this.state = o.state; + this.taskId = o.taskId; + this.taskType = o.taskType; + this.workerNode = _listCopy(o.workerNode); + } + + @Override + @Nonnull + public Builder copy() { + return new Builder(this); + } + /** * API name: {@code create_time} */ + @Nonnull public final Builder createTime(@Nullable Long value) { this.createTime = value; return this; @@ -272,6 +320,7 @@ public final Builder createTime(@Nullable Long value) { /** * API name: {@code error} */ + @Nonnull public final Builder error(@Nullable String value) { this.error = value; return this; @@ -280,6 +329,7 @@ public final Builder error(@Nullable String value) { /** * API name: {@code function_name} */ + @Nonnull public final Builder functionName(@Nullable String value) { this.functionName = value; return this; @@ -288,6 +338,7 @@ public final Builder functionName(@Nullable String value) { /** * API name: {@code is_async} */ + @Nonnull public final Builder isAsync(@Nullable Boolean value) { this.isAsync = value; return this; @@ -296,6 +347,7 @@ public final Builder isAsync(@Nullable Boolean value) { /** * API name: {@code last_update_time} */ + @Nonnull public final Builder lastUpdateTime(@Nullable Long value) { this.lastUpdateTime = value; return this; @@ -304,6 +356,7 @@ public final Builder lastUpdateTime(@Nullable Long value) { /** * API name: {@code model_id} */ + @Nonnull public final Builder modelId(@Nullable String value) { this.modelId = value; return this; @@ -312,6 +365,7 @@ public final Builder modelId(@Nullable String value) { /** * Required - API name: {@code state} */ + @Nonnull public final Builder state(String value) { this.state = value; return this; @@ -320,6 +374,7 @@ public final Builder state(String value) { /** * API name: {@code task_id} */ + @Nonnull public final Builder taskId(@Nullable String value) { this.taskId = value; return this; @@ -331,6 +386,7 @@ public final Builder taskId(@Nullable String value) { * API name: {@code task_type} *

*/ + @Nonnull public final Builder taskType(@Nullable String value) { this.taskType = value; return this; @@ -343,6 +399,7 @@ public final Builder taskType(@Nullable String value) { * Adds all elements of list to workerNode. *

*/ + @Nonnull public final Builder workerNode(List> list) { this.workerNode = _listAddAll(this.workerNode, list); return this; @@ -355,6 +412,7 @@ public final Builder workerNode(List> list) { * Adds one or more values to workerNode. *

*/ + @Nonnull public final Builder workerNode(List value, List... values) { this.workerNode = _listAdd(this.workerNode, value, values); return this; @@ -365,6 +423,8 @@ public final Builder workerNode(List value, List... values) { * * @throws NullPointerException if some of the required fields are null. */ + @Override + @Nonnull public GetTaskResponse build() { _checkSingleUse(); diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/ml/Headers.java b/java-client/src/generated/java/org/opensearch/client/opensearch/ml/Headers.java index fb81c44c4d..e42941a922 100644 --- a/java-client/src/generated/java/org/opensearch/client/opensearch/ml/Headers.java +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/ml/Headers.java @@ -28,14 +28,16 @@ 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: ml.Headers @JsonpDeserializable @Generated("org.opensearch.client.codegen.CodeGenerator") -public class Headers implements PlainJsonSerializable { +public class Headers implements PlainJsonSerializable, ToCopyableBuilder { @Nullable private final String contentType; @@ -92,18 +94,48 @@ protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { // --------------------------------------------------------------------------------------------- + @Override + @Nonnull + public Builder toBuilder() { + return new Builder(this); + } + + @Nonnull + public static Builder builder() { + return new Builder(); + } + /** * Builder for {@link Headers}. */ - public static class Builder extends ObjectBuilderBase implements ObjectBuilder { + public static class Builder extends ObjectBuilderBase implements CopyableBuilder { @Nullable private String contentType; @Nullable private Map metadata; + public Builder() {} + + private Builder(Headers o) { + this.contentType = o.contentType; + this.metadata = _mapCopy(o.metadata); + } + + private Builder(Builder o) { + this.contentType = o.contentType; + this.metadata = _mapCopy(o.metadata); + } + + @Override + @Nonnull + public Builder copy() { + return new Builder(this); + } + /** * API name: {@code content_type} */ + @Nonnull public final Builder contentType(@Nullable String value) { this.contentType = value; return this; @@ -115,6 +147,7 @@ public final Builder contentType(@Nullable String value) { * Adds all elements of map to metadata. *

*/ + @Nonnull public final Builder metadata(Map map) { this.metadata = _mapPutAll(this.metadata, map); return this; @@ -126,6 +159,7 @@ public final Builder metadata(Map map) { * Adds an entry to metadata. *

*/ + @Nonnull public final Builder metadata(String key, JsonData value) { this.metadata = _mapPut(this.metadata, key, value); return this; @@ -136,6 +170,8 @@ public final Builder metadata(String key, JsonData value) { * * @throws NullPointerException if some of the required fields are null. */ + @Override + @Nonnull public Headers build() { _checkSingleUse(); diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/ml/LLM.java b/java-client/src/generated/java/org/opensearch/client/opensearch/ml/LLM.java index 1032514032..48397f2685 100644 --- a/java-client/src/generated/java/org/opensearch/client/opensearch/ml/LLM.java +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/ml/LLM.java @@ -27,14 +27,16 @@ 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: ml.LLM @JsonpDeserializable @Generated("org.opensearch.client.codegen.CodeGenerator") -public class LLM implements PlainJsonSerializable { +public class LLM implements PlainJsonSerializable, ToCopyableBuilder { @Nullable private final String modelId; @@ -98,18 +100,48 @@ protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { // --------------------------------------------------------------------------------------------- + @Override + @Nonnull + public Builder toBuilder() { + return new Builder(this); + } + + @Nonnull + public static Builder builder() { + return new Builder(); + } + /** * Builder for {@link LLM}. */ - public static class Builder extends ObjectBuilderBase implements ObjectBuilder { + public static class Builder extends ObjectBuilderBase implements CopyableBuilder { @Nullable private String modelId; @Nullable private Map parameters; + public Builder() {} + + private Builder(LLM o) { + this.modelId = o.modelId; + this.parameters = _mapCopy(o.parameters); + } + + private Builder(Builder o) { + this.modelId = o.modelId; + this.parameters = _mapCopy(o.parameters); + } + + @Override + @Nonnull + public Builder copy() { + return new Builder(this); + } + /** * API name: {@code model_id} */ + @Nonnull public final Builder modelId(@Nullable String value) { this.modelId = value; return this; @@ -122,6 +154,7 @@ public final Builder modelId(@Nullable String value) { * Adds all elements of map to parameters. *

*/ + @Nonnull public final Builder parameters(Map map) { this.parameters = _mapPutAll(this.parameters, map); return this; @@ -134,6 +167,7 @@ public final Builder parameters(Map map) { * Adds an entry to parameters. *

*/ + @Nonnull public final Builder parameters(String key, JsonData value) { this.parameters = _mapPut(this.parameters, key, value); return this; @@ -144,6 +178,8 @@ public final Builder parameters(String key, JsonData value) { * * @throws NullPointerException if some of the required fields are null. */ + @Override + @Nonnull public LLM build() { _checkSingleUse(); diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/ml/Memory.java b/java-client/src/generated/java/org/opensearch/client/opensearch/ml/Memory.java index 83bda00de2..84491e00e0 100644 --- a/java-client/src/generated/java/org/opensearch/client/opensearch/ml/Memory.java +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/ml/Memory.java @@ -16,6 +16,7 @@ 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; @@ -23,14 +24,16 @@ 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: ml.Memory @JsonpDeserializable @Generated("org.opensearch.client.codegen.CodeGenerator") -public class Memory implements PlainJsonSerializable { +public class Memory implements PlainJsonSerializable, ToCopyableBuilder { @Nullable private final String type; @@ -72,16 +75,44 @@ protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { // --------------------------------------------------------------------------------------------- + @Override + @Nonnull + public Builder toBuilder() { + return new Builder(this); + } + + @Nonnull + public static Builder builder() { + return new Builder(); + } + /** * Builder for {@link Memory}. */ - public static class Builder extends ObjectBuilderBase implements ObjectBuilder { + public static class Builder extends ObjectBuilderBase implements CopyableBuilder { @Nullable private String type; + public Builder() {} + + private Builder(Memory o) { + this.type = o.type; + } + + private Builder(Builder o) { + this.type = o.type; + } + + @Override + @Nonnull + public Builder copy() { + return new Builder(this); + } + /** * API name: {@code type} */ + @Nonnull public final Builder type(@Nullable String value) { this.type = value; return this; @@ -92,6 +123,8 @@ public final Builder type(@Nullable String value) { * * @throws NullPointerException if some of the required fields are null. */ + @Override + @Nonnull public Memory build() { _checkSingleUse(); diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/ml/RegisterAgentsRequest.java b/java-client/src/generated/java/org/opensearch/client/opensearch/ml/RegisterAgentsRequest.java index 4e5c31c555..4b19877fa6 100644 --- a/java-client/src/generated/java/org/opensearch/client/opensearch/ml/RegisterAgentsRequest.java +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/ml/RegisterAgentsRequest.java @@ -32,8 +32,10 @@ import org.opensearch.client.transport.Endpoint; import org.opensearch.client.transport.endpoints.SimpleEndpoint; 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: ml.register_agents.Request @@ -42,7 +44,10 @@ */ @JsonpDeserializable @Generated("org.opensearch.client.codegen.CodeGenerator") -public class RegisterAgentsRequest extends RequestBase implements PlainJsonSerializable { +public class RegisterAgentsRequest extends RequestBase + implements + PlainJsonSerializable, + ToCopyableBuilder { @Nullable private final String appType; @@ -207,10 +212,21 @@ protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { } // --------------------------------------------------------------------------------------------- + @Override + @Nonnull + public Builder toBuilder() { + return new Builder(this); + } + + @Nonnull + public static Builder builder() { + return new Builder(); + } + /** * Builder for {@link RegisterAgentsRequest}. */ - public static class Builder extends ObjectBuilderBase implements ObjectBuilder { + public static class Builder extends ObjectBuilderBase implements CopyableBuilder { @Nullable private String appType; @Nullable @@ -226,9 +242,40 @@ public static class Builder extends ObjectBuilderBase implements ObjectBuilder tools; private String type; + public Builder() {} + + private Builder(RegisterAgentsRequest o) { + this.appType = o.appType; + this.description = o.description; + this.llm = o.llm; + this.memory = o.memory; + this.name = o.name; + this.parameters = _mapCopy(o.parameters); + this.tools = _listCopy(o.tools); + this.type = o.type; + } + + private Builder(Builder o) { + this.appType = o.appType; + this.description = o.description; + this.llm = o.llm; + this.memory = o.memory; + this.name = o.name; + this.parameters = _mapCopy(o.parameters); + this.tools = _listCopy(o.tools); + this.type = o.type; + } + + @Override + @Nonnull + public Builder copy() { + return new Builder(this); + } + /** * API name: {@code app_type} */ + @Nonnull public final Builder appType(@Nullable String value) { this.appType = value; return this; @@ -237,6 +284,7 @@ public final Builder appType(@Nullable String value) { /** * API name: {@code description} */ + @Nonnull public final Builder description(@Nullable String value) { this.description = value; return this; @@ -245,6 +293,7 @@ public final Builder description(@Nullable String value) { /** * API name: {@code llm} */ + @Nonnull public final Builder llm(@Nullable LLM value) { this.llm = value; return this; @@ -253,6 +302,7 @@ public final Builder llm(@Nullable LLM value) { /** * API name: {@code llm} */ + @Nonnull public final Builder llm(Function> fn) { return llm(fn.apply(new LLM.Builder()).build()); } @@ -260,6 +310,7 @@ public final Builder llm(Function> fn) { /** * API name: {@code memory} */ + @Nonnull public final Builder memory(@Nullable Memory value) { this.memory = value; return this; @@ -268,6 +319,7 @@ public final Builder memory(@Nullable Memory value) { /** * API name: {@code memory} */ + @Nonnull public final Builder memory(Function> fn) { return memory(fn.apply(new Memory.Builder()).build()); } @@ -275,6 +327,7 @@ public final Builder memory(Function> fn) /** * Required - API name: {@code name} */ + @Nonnull public final Builder name(String value) { this.name = value; return this; @@ -287,6 +340,7 @@ public final Builder name(String value) { * Adds all elements of map to parameters. *

*/ + @Nonnull public final Builder parameters(Map map) { this.parameters = _mapPutAll(this.parameters, map); return this; @@ -299,6 +353,7 @@ public final Builder parameters(Map map) { * Adds an entry to parameters. *

*/ + @Nonnull public final Builder parameters(String key, JsonData value) { this.parameters = _mapPut(this.parameters, key, value); return this; @@ -311,6 +366,7 @@ public final Builder parameters(String key, JsonData value) { * Adds all elements of list to tools. *

*/ + @Nonnull public final Builder tools(List list) { this.tools = _listAddAll(this.tools, list); return this; @@ -323,6 +379,7 @@ public final Builder tools(List list) { * Adds one or more values to tools. *

*/ + @Nonnull public final Builder tools(ToolItems value, ToolItems... values) { this.tools = _listAdd(this.tools, value, values); return this; @@ -335,6 +392,7 @@ public final Builder tools(ToolItems value, ToolItems... values) { * Adds a value to tools using a builder lambda. *

*/ + @Nonnull public final Builder tools(Function> fn) { return tools(fn.apply(new ToolItems.Builder()).build()); } @@ -342,6 +400,7 @@ public final Builder tools(Function> /** * Required - API name: {@code type} */ + @Nonnull public final Builder type(String value) { this.type = value; return this; @@ -352,6 +411,8 @@ public final Builder type(String value) { * * @throws NullPointerException if some of the required fields are null. */ + @Override + @Nonnull public RegisterAgentsRequest build() { _checkSingleUse(); diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/ml/RegisterAgentsResponse.java b/java-client/src/generated/java/org/opensearch/client/opensearch/ml/RegisterAgentsResponse.java index 816fe2cf91..c8e5cbf007 100644 --- a/java-client/src/generated/java/org/opensearch/client/opensearch/ml/RegisterAgentsResponse.java +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/ml/RegisterAgentsResponse.java @@ -16,6 +16,7 @@ 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; @@ -23,14 +24,19 @@ 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: ml.register_agents.Response @JsonpDeserializable @Generated("org.opensearch.client.codegen.CodeGenerator") -public class RegisterAgentsResponse implements PlainJsonSerializable { +public class RegisterAgentsResponse + implements + PlainJsonSerializable, + ToCopyableBuilder { @Nullable private final String agentId; @@ -72,16 +78,44 @@ protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { // --------------------------------------------------------------------------------------------- + @Override + @Nonnull + public Builder toBuilder() { + return new Builder(this); + } + + @Nonnull + public static Builder builder() { + return new Builder(); + } + /** * Builder for {@link RegisterAgentsResponse}. */ - public static class Builder extends ObjectBuilderBase implements ObjectBuilder { + public static class Builder extends ObjectBuilderBase implements CopyableBuilder { @Nullable private String agentId; + public Builder() {} + + private Builder(RegisterAgentsResponse o) { + this.agentId = o.agentId; + } + + private Builder(Builder o) { + this.agentId = o.agentId; + } + + @Override + @Nonnull + public Builder copy() { + return new Builder(this); + } + /** * API name: {@code agent_id} */ + @Nonnull public final Builder agentId(@Nullable String value) { this.agentId = value; return this; @@ -92,6 +126,8 @@ public final Builder agentId(@Nullable String value) { * * @throws NullPointerException if some of the required fields are null. */ + @Override + @Nonnull public RegisterAgentsResponse build() { _checkSingleUse(); diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/ml/RegisterModelGroupRequest.java b/java-client/src/generated/java/org/opensearch/client/opensearch/ml/RegisterModelGroupRequest.java index fc1b736361..72a8620dc3 100644 --- a/java-client/src/generated/java/org/opensearch/client/opensearch/ml/RegisterModelGroupRequest.java +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/ml/RegisterModelGroupRequest.java @@ -30,8 +30,10 @@ import org.opensearch.client.transport.Endpoint; import org.opensearch.client.transport.endpoints.SimpleEndpoint; 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: ml.register_model_group.Request @@ -40,7 +42,10 @@ */ @JsonpDeserializable @Generated("org.opensearch.client.codegen.CodeGenerator") -public class RegisterModelGroupRequest extends RequestBase implements PlainJsonSerializable { +public class RegisterModelGroupRequest extends RequestBase + implements + PlainJsonSerializable, + ToCopyableBuilder { @Nullable private final String accessMode; @@ -166,10 +171,21 @@ protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { } // --------------------------------------------------------------------------------------------- + @Override + @Nonnull + public Builder toBuilder() { + return new Builder(this); + } + + @Nonnull + public static Builder builder() { + return new Builder(); + } + /** * Builder for {@link RegisterModelGroupRequest}. */ - public static class Builder extends ObjectBuilderBase implements ObjectBuilder { + public static class Builder extends ObjectBuilderBase implements CopyableBuilder { @Nullable private String accessMode; @Nullable @@ -180,12 +196,37 @@ public static class Builder extends ObjectBuilderBase implements ObjectBuilder * API name: {@code access_mode} *

*/ + @Nonnull public final Builder accessMode(@Nullable String value) { this.accessMode = value; return this; @@ -197,6 +238,7 @@ public final Builder accessMode(@Nullable String value) { * API name: {@code add_all_backend_roles} *

*/ + @Nonnull public final Builder addAllBackendRoles(@Nullable Boolean value) { this.addAllBackendRoles = value; return this; @@ -212,6 +254,7 @@ public final Builder addAllBackendRoles(@Nullable Boolean value) { * Adds all elements of list to backendRoles. *

*/ + @Nonnull public final Builder backendRoles(List list) { this.backendRoles = _listAddAll(this.backendRoles, list); return this; @@ -227,6 +270,7 @@ public final Builder backendRoles(List list) { * Adds one or more values to backendRoles. *

*/ + @Nonnull public final Builder backendRoles(String value, String... values) { this.backendRoles = _listAdd(this.backendRoles, value, values); return this; @@ -238,6 +282,7 @@ public final Builder backendRoles(String value, String... values) { * API name: {@code description} *

*/ + @Nonnull public final Builder description(@Nullable String value) { this.description = value; return this; @@ -249,6 +294,7 @@ public final Builder description(@Nullable String value) { * API name: {@code name} *

*/ + @Nonnull public final Builder name(String value) { this.name = value; return this; @@ -259,6 +305,8 @@ public final Builder name(String value) { * * @throws NullPointerException if some of the required fields are null. */ + @Override + @Nonnull public RegisterModelGroupRequest build() { _checkSingleUse(); diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/ml/RegisterModelGroupResponse.java b/java-client/src/generated/java/org/opensearch/client/opensearch/ml/RegisterModelGroupResponse.java index 3b0faba22c..77ae5919dd 100644 --- a/java-client/src/generated/java/org/opensearch/client/opensearch/ml/RegisterModelGroupResponse.java +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/ml/RegisterModelGroupResponse.java @@ -23,14 +23,19 @@ 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: ml.register_model_group.Response @JsonpDeserializable @Generated("org.opensearch.client.codegen.CodeGenerator") -public class RegisterModelGroupResponse implements PlainJsonSerializable { +public class RegisterModelGroupResponse + implements + PlainJsonSerializable, + ToCopyableBuilder { @Nonnull private final String modelGroupId; @@ -93,19 +98,49 @@ protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { // --------------------------------------------------------------------------------------------- + @Override + @Nonnull + public Builder toBuilder() { + return new Builder(this); + } + + @Nonnull + public static Builder builder() { + return new Builder(); + } + /** * Builder for {@link RegisterModelGroupResponse}. */ - public static class Builder extends ObjectBuilderBase implements ObjectBuilder { + public static class Builder extends ObjectBuilderBase implements CopyableBuilder { private String modelGroupId; private String status; + public Builder() {} + + private Builder(RegisterModelGroupResponse o) { + this.modelGroupId = o.modelGroupId; + this.status = o.status; + } + + private Builder(Builder o) { + this.modelGroupId = o.modelGroupId; + this.status = o.status; + } + + @Override + @Nonnull + public Builder copy() { + return new Builder(this); + } + /** * Required - The model group ID. *

* API name: {@code model_group_id} *

*/ + @Nonnull public final Builder modelGroupId(String value) { this.modelGroupId = value; return this; @@ -117,6 +152,7 @@ public final Builder modelGroupId(String value) { * API name: {@code status} *

*/ + @Nonnull public final Builder status(String value) { this.status = value; return this; @@ -127,6 +163,8 @@ public final Builder status(String value) { * * @throws NullPointerException if some of the required fields are null. */ + @Override + @Nonnull public RegisterModelGroupResponse build() { _checkSingleUse(); diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/ml/RegisterModelRequest.java b/java-client/src/generated/java/org/opensearch/client/opensearch/ml/RegisterModelRequest.java index ac004ddd21..f04bb7275c 100644 --- a/java-client/src/generated/java/org/opensearch/client/opensearch/ml/RegisterModelRequest.java +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/ml/RegisterModelRequest.java @@ -29,8 +29,10 @@ import org.opensearch.client.transport.Endpoint; import org.opensearch.client.transport.endpoints.SimpleEndpoint; 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: ml.register_model.Request @@ -39,7 +41,10 @@ */ @JsonpDeserializable @Generated("org.opensearch.client.codegen.CodeGenerator") -public class RegisterModelRequest extends RequestBase implements PlainJsonSerializable { +public class RegisterModelRequest extends RequestBase + implements + PlainJsonSerializable, + ToCopyableBuilder { @Nullable private final String description; @@ -157,10 +162,21 @@ protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { } // --------------------------------------------------------------------------------------------- + @Override + @Nonnull + public Builder toBuilder() { + return new Builder(this); + } + + @Nonnull + public static Builder builder() { + return new Builder(); + } + /** * Builder for {@link RegisterModelRequest}. */ - public static class Builder extends ObjectBuilderBase implements ObjectBuilder { + public static class Builder extends ObjectBuilderBase implements CopyableBuilder { @Nullable private String description; private String modelFormat; @@ -169,12 +185,37 @@ public static class Builder extends ObjectBuilderBase implements ObjectBuilder * API name: {@code description} *

*/ + @Nonnull public final Builder description(@Nullable String value) { this.description = value; return this; @@ -186,6 +227,7 @@ public final Builder description(@Nullable String value) { * API name: {@code model_format} *

*/ + @Nonnull public final Builder modelFormat(String value) { this.modelFormat = value; return this; @@ -197,6 +239,7 @@ public final Builder modelFormat(String value) { * API name: {@code model_group_id} *

*/ + @Nonnull public final Builder modelGroupId(@Nullable String value) { this.modelGroupId = value; return this; @@ -208,6 +251,7 @@ public final Builder modelGroupId(@Nullable String value) { * API name: {@code name} *

*/ + @Nonnull public final Builder name(String value) { this.name = value; return this; @@ -219,6 +263,7 @@ public final Builder name(String value) { * API name: {@code version} *

*/ + @Nonnull public final Builder version(String value) { this.version = value; return this; @@ -229,6 +274,8 @@ public final Builder version(String value) { * * @throws NullPointerException if some of the required fields are null. */ + @Override + @Nonnull public RegisterModelRequest build() { _checkSingleUse(); diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/ml/RegisterModelResponse.java b/java-client/src/generated/java/org/opensearch/client/opensearch/ml/RegisterModelResponse.java index 5528867fa2..c4f69e3cb8 100644 --- a/java-client/src/generated/java/org/opensearch/client/opensearch/ml/RegisterModelResponse.java +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/ml/RegisterModelResponse.java @@ -23,14 +23,19 @@ 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: ml.register_model.Response @JsonpDeserializable @Generated("org.opensearch.client.codegen.CodeGenerator") -public class RegisterModelResponse implements PlainJsonSerializable { +public class RegisterModelResponse + implements + PlainJsonSerializable, + ToCopyableBuilder { @Nonnull private final String status; @@ -85,16 +90,46 @@ protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { // --------------------------------------------------------------------------------------------- + @Override + @Nonnull + public Builder toBuilder() { + return new Builder(this); + } + + @Nonnull + public static Builder builder() { + return new Builder(); + } + /** * Builder for {@link RegisterModelResponse}. */ - public static class Builder extends ObjectBuilderBase implements ObjectBuilder { + public static class Builder extends ObjectBuilderBase implements CopyableBuilder { private String status; private String taskId; + public Builder() {} + + private Builder(RegisterModelResponse o) { + this.status = o.status; + this.taskId = o.taskId; + } + + private Builder(Builder o) { + this.status = o.status; + this.taskId = o.taskId; + } + + @Override + @Nonnull + public Builder copy() { + return new Builder(this); + } + /** * Required - API name: {@code status} */ + @Nonnull public final Builder status(String value) { this.status = value; return this; @@ -103,6 +138,7 @@ public final Builder status(String value) { /** * Required - API name: {@code task_id} */ + @Nonnull public final Builder taskId(String value) { this.taskId = value; return this; @@ -113,6 +149,8 @@ public final Builder taskId(String value) { * * @throws NullPointerException if some of the required fields are null. */ + @Override + @Nonnull public RegisterModelResponse build() { _checkSingleUse(); diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/ml/ToolItems.java b/java-client/src/generated/java/org/opensearch/client/opensearch/ml/ToolItems.java index c44de71fbd..89fdd70eba 100644 --- a/java-client/src/generated/java/org/opensearch/client/opensearch/ml/ToolItems.java +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/ml/ToolItems.java @@ -28,14 +28,16 @@ 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: ml.ToolItems @JsonpDeserializable @Generated("org.opensearch.client.codegen.CodeGenerator") -public class ToolItems implements PlainJsonSerializable { +public class ToolItems implements PlainJsonSerializable, ToCopyableBuilder { @Nullable private final String name; @@ -131,10 +133,21 @@ protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { // --------------------------------------------------------------------------------------------- + @Override + @Nonnull + public Builder toBuilder() { + return new Builder(this); + } + + @Nonnull + public static Builder builder() { + return new Builder(); + } + /** * Builder for {@link ToolItems}. */ - public static class Builder extends ObjectBuilderBase implements ObjectBuilder { + public static class Builder extends ObjectBuilderBase implements CopyableBuilder { @Nullable private String name; @Nullable @@ -144,9 +157,32 @@ public static class Builder extends ObjectBuilderBase implements ObjectBuilder metadata; + public Builder() {} + + private Builder(ToolItems o) { + this.name = o.name; + this.parameters = _mapCopy(o.parameters); + this.type = o.type; + this.metadata = _mapCopy(o.metadata); + } + + private Builder(Builder o) { + this.name = o.name; + this.parameters = _mapCopy(o.parameters); + this.type = o.type; + this.metadata = _mapCopy(o.metadata); + } + + @Override + @Nonnull + public Builder copy() { + return new Builder(this); + } + /** * API name: {@code name} */ + @Nonnull public final Builder name(@Nullable String value) { this.name = value; return this; @@ -159,6 +195,7 @@ public final Builder name(@Nullable String value) { * Adds all elements of map to parameters. *

*/ + @Nonnull public final Builder parameters(Map map) { this.parameters = _mapPutAll(this.parameters, map); return this; @@ -171,6 +208,7 @@ public final Builder parameters(Map map) { * Adds an entry to parameters. *

*/ + @Nonnull public final Builder parameters(String key, JsonData value) { this.parameters = _mapPut(this.parameters, key, value); return this; @@ -179,6 +217,7 @@ public final Builder parameters(String key, JsonData value) { /** * API name: {@code type} */ + @Nonnull public final Builder type(@Nullable String value) { this.type = value; return this; @@ -190,6 +229,7 @@ public final Builder type(@Nullable String value) { * Adds all elements of map to metadata. *

*/ + @Nonnull public final Builder metadata(Map map) { this.metadata = _mapPutAll(this.metadata, map); return this; @@ -201,6 +241,7 @@ public final Builder metadata(Map map) { * Adds an entry to metadata. *

*/ + @Nonnull public final Builder metadata(String key, JsonData value) { this.metadata = _mapPut(this.metadata, key, value); return this; @@ -211,6 +252,8 @@ public final Builder metadata(String key, JsonData value) { * * @throws NullPointerException if some of the required fields are null. */ + @Override + @Nonnull public ToolItems build() { _checkSingleUse(); diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/ml/UndeployModelNode.java b/java-client/src/generated/java/org/opensearch/client/opensearch/ml/UndeployModelNode.java index af4161d44b..4f4d467753 100644 --- a/java-client/src/generated/java/org/opensearch/client/opensearch/ml/UndeployModelNode.java +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/ml/UndeployModelNode.java @@ -27,14 +27,16 @@ 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: ml.UndeployModelNode @JsonpDeserializable @Generated("org.opensearch.client.codegen.CodeGenerator") -public class UndeployModelNode implements PlainJsonSerializable { +public class UndeployModelNode implements PlainJsonSerializable, ToCopyableBuilder { @Nonnull private final Map stats; @@ -81,13 +83,40 @@ protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { // --------------------------------------------------------------------------------------------- + @Override + @Nonnull + public Builder toBuilder() { + return new Builder(this); + } + + @Nonnull + public static Builder builder() { + return new Builder(); + } + /** * Builder for {@link UndeployModelNode}. */ - public static class Builder extends ObjectBuilderBase implements ObjectBuilder { + public static class Builder extends ObjectBuilderBase implements CopyableBuilder { @Nullable private Map stats; + public Builder() {} + + private Builder(UndeployModelNode o) { + this.stats = _mapCopy(o.stats); + } + + private Builder(Builder o) { + this.stats = _mapCopy(o.stats); + } + + @Override + @Nonnull + public Builder copy() { + return new Builder(this); + } + /** * API name: {@code stats} * @@ -95,6 +124,7 @@ public static class Builder extends ObjectBuilderBase implements ObjectBuildermap to stats. *

*/ + @Nonnull public final Builder stats(Map map) { this.stats = _mapPutAll(this.stats, map); return this; @@ -107,6 +137,7 @@ public final Builder stats(Map map) { * Adds an entry to stats. *

*/ + @Nonnull public final Builder stats(String key, JsonData value) { this.stats = _mapPut(this.stats, key, value); return this; @@ -117,6 +148,8 @@ public final Builder stats(String key, JsonData value) { * * @throws NullPointerException if some of the required fields are null. */ + @Override + @Nonnull public UndeployModelNode build() { _checkSingleUse(); diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/ml/UndeployModelRequest.java b/java-client/src/generated/java/org/opensearch/client/opensearch/ml/UndeployModelRequest.java index f8b8538fcb..f01a11023f 100644 --- a/java-client/src/generated/java/org/opensearch/client/opensearch/ml/UndeployModelRequest.java +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/ml/UndeployModelRequest.java @@ -20,8 +20,10 @@ import org.opensearch.client.transport.Endpoint; import org.opensearch.client.transport.endpoints.SimpleEndpoint; 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: ml.undeploy_model.Request @@ -29,7 +31,7 @@ * Undeploys a model. */ @Generated("org.opensearch.client.codegen.CodeGenerator") -public class UndeployModelRequest extends RequestBase { +public class UndeployModelRequest extends RequestBase implements ToCopyableBuilder { @Nonnull private final String modelId; @@ -54,15 +56,43 @@ public final String modelId() { // --------------------------------------------------------------------------------------------- + @Override + @Nonnull + public Builder toBuilder() { + return new Builder(this); + } + + @Nonnull + public static Builder builder() { + return new Builder(); + } + /** * Builder for {@link UndeployModelRequest}. */ - public static class Builder extends ObjectBuilderBase implements ObjectBuilder { + public static class Builder extends ObjectBuilderBase implements CopyableBuilder { private String modelId; + public Builder() {} + + private Builder(UndeployModelRequest o) { + this.modelId = o.modelId; + } + + private Builder(Builder o) { + this.modelId = o.modelId; + } + + @Override + @Nonnull + public Builder copy() { + return new Builder(this); + } + /** * Required - API name: {@code model_id} */ + @Nonnull public final Builder modelId(String value) { this.modelId = value; return this; @@ -73,6 +103,8 @@ public final Builder modelId(String value) { * * @throws NullPointerException if some of the required fields are null. */ + @Override + @Nonnull public UndeployModelRequest build() { _checkSingleUse(); diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/ml/UndeployModelResponse.java b/java-client/src/generated/java/org/opensearch/client/opensearch/ml/UndeployModelResponse.java index a8d51b146e..f002590ba5 100644 --- a/java-client/src/generated/java/org/opensearch/client/opensearch/ml/UndeployModelResponse.java +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/ml/UndeployModelResponse.java @@ -14,6 +14,7 @@ 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.ObjectBuilderDeserializer; @@ -45,6 +46,7 @@ public static class Builder extends DictionaryResponse.AbstractBuilder { @Override + @Nonnull protected Builder self() { return this; } diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/snapshot/CleanupRepositoryRequest.java b/java-client/src/generated/java/org/opensearch/client/opensearch/snapshot/CleanupRepositoryRequest.java index 743999ab03..8cca465b44 100644 --- a/java-client/src/generated/java/org/opensearch/client/opensearch/snapshot/CleanupRepositoryRequest.java +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/snapshot/CleanupRepositoryRequest.java @@ -49,8 +49,10 @@ import org.opensearch.client.transport.Endpoint; import org.opensearch.client.transport.endpoints.SimpleEndpoint; 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: snapshot.cleanup_repository.Request @@ -58,7 +60,9 @@ * Removes stale data from repository. */ @Generated("org.opensearch.client.codegen.CodeGenerator") -public class CleanupRepositoryRequest extends RequestBase { +public class CleanupRepositoryRequest extends RequestBase + implements + ToCopyableBuilder { @Nullable private final Time clusterManagerTimeout; @@ -98,7 +102,7 @@ public final Time clusterManagerTimeout() { } /** - * Period to wait for a connection to the master node. + * Period to wait for a connection to the cluster-manager node. *

* API name: {@code master_timeout} *

@@ -133,10 +137,21 @@ public final Time timeout() { // --------------------------------------------------------------------------------------------- + @Override + @Nonnull + public Builder toBuilder() { + return new Builder(this); + } + + @Nonnull + public static Builder builder() { + return new Builder(); + } + /** * Builder for {@link CleanupRepositoryRequest}. */ - public static class Builder extends ObjectBuilderBase implements ObjectBuilder { + public static class Builder extends ObjectBuilderBase implements CopyableBuilder { @Nullable private Time clusterManagerTimeout; @Nullable @@ -145,12 +160,35 @@ public static class Builder extends ObjectBuilderBase implements ObjectBuilder * API name: {@code cluster_manager_timeout} *

*/ + @Nonnull public final Builder clusterManagerTimeout(@Nullable Time value) { this.clusterManagerTimeout = value; return this; @@ -162,29 +200,32 @@ public final Builder clusterManagerTimeout(@Nullable Time value) { * API name: {@code cluster_manager_timeout} *

*/ + @Nonnull public final Builder clusterManagerTimeout(Function> fn) { return clusterManagerTimeout(fn.apply(new Time.Builder()).build()); } /** - * Period to wait for a connection to the master node. + * Period to wait for a connection to the cluster-manager node. *

* API name: {@code master_timeout} *

*/ @Deprecated + @Nonnull public final Builder masterTimeout(@Nullable Time value) { this.masterTimeout = value; return this; } /** - * Period to wait for a connection to the master node. + * Period to wait for a connection to the cluster-manager node. *

* API name: {@code master_timeout} *

*/ @Deprecated + @Nonnull public final Builder masterTimeout(Function> fn) { return masterTimeout(fn.apply(new Time.Builder()).build()); } @@ -195,6 +236,7 @@ public final Builder masterTimeout(Function> f * API name: {@code repository} *

*/ + @Nonnull public final Builder repository(String value) { this.repository = value; return this; @@ -206,6 +248,7 @@ public final Builder repository(String value) { * API name: {@code timeout} *

*/ + @Nonnull public final Builder timeout(@Nullable Time value) { this.timeout = value; return this; @@ -217,6 +260,7 @@ public final Builder timeout(@Nullable Time value) { * API name: {@code timeout} *

*/ + @Nonnull public final Builder timeout(Function> fn) { return timeout(fn.apply(new Time.Builder()).build()); } @@ -226,6 +270,8 @@ public final Builder timeout(Function> fn) { * * @throws NullPointerException if some of the required fields are null. */ + @Override + @Nonnull public CleanupRepositoryRequest build() { _checkSingleUse(); diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/snapshot/CleanupRepositoryResponse.java b/java-client/src/generated/java/org/opensearch/client/opensearch/snapshot/CleanupRepositoryResponse.java index 5f82b2882a..b3b0bf91a8 100644 --- a/java-client/src/generated/java/org/opensearch/client/opensearch/snapshot/CleanupRepositoryResponse.java +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/snapshot/CleanupRepositoryResponse.java @@ -48,14 +48,19 @@ import org.opensearch.client.json.PlainJsonSerializable; import org.opensearch.client.opensearch.snapshot.cleanup_repository.CleanupRepositoryResults; 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: snapshot.cleanup_repository.Response @JsonpDeserializable @Generated("org.opensearch.client.codegen.CodeGenerator") -public class CleanupRepositoryResponse implements PlainJsonSerializable { +public class CleanupRepositoryResponse + implements + PlainJsonSerializable, + ToCopyableBuilder { @Nonnull private final CleanupRepositoryResults results; @@ -95,15 +100,43 @@ protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { // --------------------------------------------------------------------------------------------- + @Override + @Nonnull + public Builder toBuilder() { + return new Builder(this); + } + + @Nonnull + public static Builder builder() { + return new Builder(); + } + /** * Builder for {@link CleanupRepositoryResponse}. */ - public static class Builder extends ObjectBuilderBase implements ObjectBuilder { + public static class Builder extends ObjectBuilderBase implements CopyableBuilder { private CleanupRepositoryResults results; + public Builder() {} + + private Builder(CleanupRepositoryResponse o) { + this.results = o.results; + } + + private Builder(Builder o) { + this.results = o.results; + } + + @Override + @Nonnull + public Builder copy() { + return new Builder(this); + } + /** * Required - API name: {@code results} */ + @Nonnull public final Builder results(CleanupRepositoryResults value) { this.results = value; return this; @@ -112,6 +145,7 @@ public final Builder results(CleanupRepositoryResults value) { /** * Required - API name: {@code results} */ + @Nonnull public final Builder results(Function> fn) { return results(fn.apply(new CleanupRepositoryResults.Builder()).build()); } @@ -121,6 +155,8 @@ public final Builder results(Function { @Nullable private final Time clusterManagerTimeout; @@ -122,7 +127,7 @@ public final String indices() { } /** - * Explicit operation timeout for connection to master node + * Explicit operation timeout for connection to cluster-manager node *

* API name: {@code master_timeout} *

@@ -182,10 +187,21 @@ protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { } // --------------------------------------------------------------------------------------------- + @Override + @Nonnull + public Builder toBuilder() { + return new Builder(this); + } + + @Nonnull + public static Builder builder() { + return new Builder(); + } + /** * Builder for {@link CloneSnapshotRequest}. */ - public static class Builder extends ObjectBuilderBase implements ObjectBuilder { + public static class Builder extends ObjectBuilderBase implements CopyableBuilder { @Nullable private Time clusterManagerTimeout; private String indices; @@ -195,12 +211,39 @@ public static class Builder extends ObjectBuilderBase implements ObjectBuilder * API name: {@code cluster_manager_timeout} *

*/ + @Nonnull public final Builder clusterManagerTimeout(@Nullable Time value) { this.clusterManagerTimeout = value; return this; @@ -212,6 +255,7 @@ public final Builder clusterManagerTimeout(@Nullable Time value) { * API name: {@code cluster_manager_timeout} *

*/ + @Nonnull public final Builder clusterManagerTimeout(Function> fn) { return clusterManagerTimeout(fn.apply(new Time.Builder()).build()); } @@ -219,30 +263,33 @@ public final Builder clusterManagerTimeout(Function * API name: {@code master_timeout} *

*/ @Deprecated + @Nonnull public final Builder masterTimeout(@Nullable Time value) { this.masterTimeout = value; return this; } /** - * Explicit operation timeout for connection to master node + * Explicit operation timeout for connection to cluster-manager node *

* API name: {@code master_timeout} *

*/ @Deprecated + @Nonnull public final Builder masterTimeout(Function> fn) { return masterTimeout(fn.apply(new Time.Builder()).build()); } @@ -253,6 +300,7 @@ public final Builder masterTimeout(Function> f * API name: {@code repository} *

*/ + @Nonnull public final Builder repository(String value) { this.repository = value; return this; @@ -264,6 +312,7 @@ public final Builder repository(String value) { * API name: {@code snapshot} *

*/ + @Nonnull public final Builder snapshot(String value) { this.snapshot = value; return this; @@ -275,6 +324,7 @@ public final Builder snapshot(String value) { * API name: {@code target_snapshot} *

*/ + @Nonnull public final Builder targetSnapshot(String value) { this.targetSnapshot = value; return this; @@ -285,6 +335,8 @@ public final Builder targetSnapshot(String value) { * * @throws NullPointerException if some of the required fields are null. */ + @Override + @Nonnull public CloneSnapshotRequest build() { _checkSingleUse(); diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/snapshot/CloneSnapshotResponse.java b/java-client/src/generated/java/org/opensearch/client/opensearch/snapshot/CloneSnapshotResponse.java index ad74900da4..64398442a4 100644 --- a/java-client/src/generated/java/org/opensearch/client/opensearch/snapshot/CloneSnapshotResponse.java +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/snapshot/CloneSnapshotResponse.java @@ -38,18 +38,23 @@ 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.ObjectBuilderDeserializer; import org.opensearch.client.json.ObjectDeserializer; import org.opensearch.client.opensearch._types.AcknowledgedResponseBase; +import org.opensearch.client.util.CopyableBuilder; import org.opensearch.client.util.ObjectBuilder; +import org.opensearch.client.util.ToCopyableBuilder; // typedef: snapshot.clone.Response @JsonpDeserializable @Generated("org.opensearch.client.codegen.CodeGenerator") -public class CloneSnapshotResponse extends AcknowledgedResponseBase { +public class CloneSnapshotResponse extends AcknowledgedResponseBase + implements + ToCopyableBuilder { // --------------------------------------------------------------------------------------------- @@ -63,12 +68,42 @@ public static CloneSnapshotResponse of(Function implements ObjectBuilder { + public static class Builder extends AcknowledgedResponseBase.AbstractBuilder + implements + CopyableBuilder { + + public Builder() {} + + private Builder(CloneSnapshotResponse o) { + super(o); + } + + private Builder(Builder o) { + super(o); + } @Override + @Nonnull + public Builder copy() { + return new Builder(this); + } + + @Override + @Nonnull protected Builder self() { return this; } @@ -78,6 +113,8 @@ protected Builder self() { * * @throws NullPointerException if some of the required fields are null. */ + @Override + @Nonnull public CloneSnapshotResponse build() { _checkSingleUse(); diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/snapshot/VerifyRepositoryRequest.java b/java-client/src/generated/java/org/opensearch/client/opensearch/snapshot/VerifyRepositoryRequest.java index 627b7ea5ca..338bb0e98a 100644 --- a/java-client/src/generated/java/org/opensearch/client/opensearch/snapshot/VerifyRepositoryRequest.java +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/snapshot/VerifyRepositoryRequest.java @@ -49,8 +49,10 @@ import org.opensearch.client.transport.Endpoint; import org.opensearch.client.transport.endpoints.SimpleEndpoint; 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: snapshot.verify_repository.Request @@ -58,7 +60,9 @@ * Verifies a repository. */ @Generated("org.opensearch.client.codegen.CodeGenerator") -public class VerifyRepositoryRequest extends RequestBase { +public class VerifyRepositoryRequest extends RequestBase + implements + ToCopyableBuilder { @Nullable private final Time clusterManagerTimeout; @@ -98,7 +102,7 @@ public final Time clusterManagerTimeout() { } /** - * Explicit operation timeout for connection to master node + * Explicit operation timeout for connection to cluster-manager node *

* API name: {@code master_timeout} *

@@ -133,10 +137,21 @@ public final Time timeout() { // --------------------------------------------------------------------------------------------- + @Override + @Nonnull + public Builder toBuilder() { + return new Builder(this); + } + + @Nonnull + public static Builder builder() { + return new Builder(); + } + /** * Builder for {@link VerifyRepositoryRequest}. */ - public static class Builder extends ObjectBuilderBase implements ObjectBuilder { + public static class Builder extends ObjectBuilderBase implements CopyableBuilder { @Nullable private Time clusterManagerTimeout; @Nullable @@ -145,12 +160,35 @@ public static class Builder extends ObjectBuilderBase implements ObjectBuilder * API name: {@code cluster_manager_timeout} *

*/ + @Nonnull public final Builder clusterManagerTimeout(@Nullable Time value) { this.clusterManagerTimeout = value; return this; @@ -162,29 +200,32 @@ public final Builder clusterManagerTimeout(@Nullable Time value) { * API name: {@code cluster_manager_timeout} *

*/ + @Nonnull public final Builder clusterManagerTimeout(Function> fn) { return clusterManagerTimeout(fn.apply(new Time.Builder()).build()); } /** - * Explicit operation timeout for connection to master node + * Explicit operation timeout for connection to cluster-manager node *

* API name: {@code master_timeout} *

*/ @Deprecated + @Nonnull public final Builder masterTimeout(@Nullable Time value) { this.masterTimeout = value; return this; } /** - * Explicit operation timeout for connection to master node + * Explicit operation timeout for connection to cluster-manager node *

* API name: {@code master_timeout} *

*/ @Deprecated + @Nonnull public final Builder masterTimeout(Function> fn) { return masterTimeout(fn.apply(new Time.Builder()).build()); } @@ -195,6 +236,7 @@ public final Builder masterTimeout(Function> f * API name: {@code repository} *

*/ + @Nonnull public final Builder repository(String value) { this.repository = value; return this; @@ -206,6 +248,7 @@ public final Builder repository(String value) { * API name: {@code timeout} *

*/ + @Nonnull public final Builder timeout(@Nullable Time value) { this.timeout = value; return this; @@ -217,6 +260,7 @@ public final Builder timeout(@Nullable Time value) { * API name: {@code timeout} *

*/ + @Nonnull public final Builder timeout(Function> fn) { return timeout(fn.apply(new Time.Builder()).build()); } @@ -226,6 +270,8 @@ public final Builder timeout(Function> fn) { * * @throws NullPointerException if some of the required fields are null. */ + @Override + @Nonnull public VerifyRepositoryRequest build() { _checkSingleUse(); diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/snapshot/VerifyRepositoryResponse.java b/java-client/src/generated/java/org/opensearch/client/opensearch/snapshot/VerifyRepositoryResponse.java index 1db36a6507..0a9b2692bd 100644 --- a/java-client/src/generated/java/org/opensearch/client/opensearch/snapshot/VerifyRepositoryResponse.java +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/snapshot/VerifyRepositoryResponse.java @@ -49,14 +49,19 @@ import org.opensearch.client.json.PlainJsonSerializable; import org.opensearch.client.opensearch.snapshot.verify_repository.CompactNodeInfo; 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: snapshot.verify_repository.Response @JsonpDeserializable @Generated("org.opensearch.client.codegen.CodeGenerator") -public class VerifyRepositoryResponse implements PlainJsonSerializable { +public class VerifyRepositoryResponse + implements + PlainJsonSerializable, + ToCopyableBuilder { @Nonnull private final Map nodes; @@ -101,12 +106,39 @@ protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { // --------------------------------------------------------------------------------------------- + @Override + @Nonnull + public Builder toBuilder() { + return new Builder(this); + } + + @Nonnull + public static Builder builder() { + return new Builder(); + } + /** * Builder for {@link VerifyRepositoryResponse}. */ - public static class Builder extends ObjectBuilderBase implements ObjectBuilder { + public static class Builder extends ObjectBuilderBase implements CopyableBuilder { private Map nodes; + public Builder() {} + + private Builder(VerifyRepositoryResponse o) { + this.nodes = _mapCopy(o.nodes); + } + + private Builder(Builder o) { + this.nodes = _mapCopy(o.nodes); + } + + @Override + @Nonnull + public Builder copy() { + return new Builder(this); + } + /** * Required - API name: {@code nodes} * @@ -114,6 +146,7 @@ public static class Builder extends ObjectBuilderBase implements ObjectBuildermap to nodes. *

*/ + @Nonnull public final Builder nodes(Map map) { this.nodes = _mapPutAll(this.nodes, map); return this; @@ -126,6 +159,7 @@ public final Builder nodes(Map map) { * Adds an entry to nodes. *

*/ + @Nonnull public final Builder nodes(String key, CompactNodeInfo value) { this.nodes = _mapPut(this.nodes, key, value); return this; @@ -138,6 +172,7 @@ public final Builder nodes(String key, CompactNodeInfo value) { * Adds a value to nodes using a builder lambda. *

*/ + @Nonnull public final Builder nodes(String key, Function> fn) { return nodes(key, fn.apply(new CompactNodeInfo.Builder()).build()); } @@ -147,6 +182,8 @@ public final Builder nodes(String key, Function { private final long deletedBlobs; @@ -110,19 +116,49 @@ protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { // --------------------------------------------------------------------------------------------- + @Override + @Nonnull + public Builder toBuilder() { + return new Builder(this); + } + + @Nonnull + public static Builder builder() { + return new Builder(); + } + /** * Builder for {@link CleanupRepositoryResults}. */ - public static class Builder extends ObjectBuilderBase implements ObjectBuilder { + public static class Builder extends ObjectBuilderBase implements CopyableBuilder { private Long deletedBlobs; private Long deletedBytes; + public Builder() {} + + private Builder(CleanupRepositoryResults o) { + this.deletedBlobs = o.deletedBlobs; + this.deletedBytes = o.deletedBytes; + } + + private Builder(Builder o) { + this.deletedBlobs = o.deletedBlobs; + this.deletedBytes = o.deletedBytes; + } + + @Override + @Nonnull + public Builder copy() { + return new Builder(this); + } + /** * Required - Number of binary large objects (blobs) removed during cleanup. *

* API name: {@code deleted_blobs} *

*/ + @Nonnull public final Builder deletedBlobs(long value) { this.deletedBlobs = value; return this; @@ -134,6 +170,7 @@ public final Builder deletedBlobs(long value) { * API name: {@code deleted_bytes} *

*/ + @Nonnull public final Builder deletedBytes(long value) { this.deletedBytes = value; return this; @@ -144,6 +181,8 @@ public final Builder deletedBytes(long value) { * * @throws NullPointerException if some of the required fields are null. */ + @Override + @Nonnull public CleanupRepositoryResults build() { _checkSingleUse(); diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/snapshot/verify_repository/CompactNodeInfo.java b/java-client/src/generated/java/org/opensearch/client/opensearch/snapshot/verify_repository/CompactNodeInfo.java index b492890a10..f0005ac2b6 100644 --- a/java-client/src/generated/java/org/opensearch/client/opensearch/snapshot/verify_repository/CompactNodeInfo.java +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/snapshot/verify_repository/CompactNodeInfo.java @@ -47,14 +47,16 @@ 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: snapshot.verify_repository.CompactNodeInfo @JsonpDeserializable @Generated("org.opensearch.client.codegen.CodeGenerator") -public class CompactNodeInfo implements PlainJsonSerializable { +public class CompactNodeInfo implements PlainJsonSerializable, ToCopyableBuilder { @Nonnull private final String name; @@ -94,15 +96,43 @@ protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { // --------------------------------------------------------------------------------------------- + @Override + @Nonnull + public Builder toBuilder() { + return new Builder(this); + } + + @Nonnull + public static Builder builder() { + return new Builder(); + } + /** * Builder for {@link CompactNodeInfo}. */ - public static class Builder extends ObjectBuilderBase implements ObjectBuilder { + public static class Builder extends ObjectBuilderBase implements CopyableBuilder { private String name; + public Builder() {} + + private Builder(CompactNodeInfo o) { + this.name = o.name; + } + + private Builder(Builder o) { + this.name = o.name; + } + + @Override + @Nonnull + public Builder copy() { + return new Builder(this); + } + /** * Required - API name: {@code name} */ + @Nonnull public final Builder name(String value) { this.name = value; return this; @@ -113,6 +143,8 @@ public final Builder name(String value) { * * @throws NullPointerException if some of the required fields are null. */ + @Override + @Nonnull public CompactNodeInfo build() { _checkSingleUse(); diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/tasks/CancelRequest.java b/java-client/src/generated/java/org/opensearch/client/opensearch/tasks/CancelRequest.java index edfe92929d..2a84cc1377 100644 --- a/java-client/src/generated/java/org/opensearch/client/opensearch/tasks/CancelRequest.java +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/tasks/CancelRequest.java @@ -49,8 +49,10 @@ import org.opensearch.client.transport.Endpoint; import org.opensearch.client.transport.endpoints.SimpleEndpoint; 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: tasks.cancel.Request @@ -58,7 +60,7 @@ * Cancels a task, if it can be cancelled through an API. */ @Generated("org.opensearch.client.codegen.CodeGenerator") -public class CancelRequest extends RequestBase { +public class CancelRequest extends RequestBase implements ToCopyableBuilder { @Nonnull private final List actions; @@ -146,10 +148,21 @@ public final Boolean waitForCompletion() { // --------------------------------------------------------------------------------------------- + @Override + @Nonnull + public Builder toBuilder() { + return new Builder(this); + } + + @Nonnull + public static Builder builder() { + return new Builder(); + } + /** * Builder for {@link CancelRequest}. */ - public static class Builder extends ObjectBuilderBase implements ObjectBuilder { + public static class Builder extends ObjectBuilderBase implements CopyableBuilder { @Nullable private List actions; @Nullable @@ -161,6 +174,30 @@ public static class Builder extends ObjectBuilderBase implements ObjectBuilder @@ -171,6 +208,7 @@ public static class Builder extends ObjectBuilderBase implements ObjectBuilderlist to actions. *

*/ + @Nonnull public final Builder actions(List list) { this.actions = _listAddAll(this.actions, list); return this; @@ -186,6 +224,7 @@ public final Builder actions(List list) { * Adds one or more values to actions. *

*/ + @Nonnull public final Builder actions(String value, String... values) { this.actions = _listAdd(this.actions, value, values); return this; @@ -201,6 +240,7 @@ public final Builder actions(String value, String... values) { * Adds all elements of list to nodes. *

*/ + @Nonnull public final Builder nodes(List list) { this.nodes = _listAddAll(this.nodes, list); return this; @@ -216,6 +256,7 @@ public final Builder nodes(List list) { * Adds one or more values to nodes. *

*/ + @Nonnull public final Builder nodes(String value, String... values) { this.nodes = _listAdd(this.nodes, value, values); return this; @@ -227,6 +268,7 @@ public final Builder nodes(String value, String... values) { * API name: {@code parent_task_id} *

*/ + @Nonnull public final Builder parentTaskId(@Nullable String value) { this.parentTaskId = value; return this; @@ -238,6 +280,7 @@ public final Builder parentTaskId(@Nullable String value) { * API name: {@code task_id} *

*/ + @Nonnull public final Builder taskId(@Nullable String value) { this.taskId = value; return this; @@ -249,6 +292,7 @@ public final Builder taskId(@Nullable String value) { * API name: {@code wait_for_completion} *

*/ + @Nonnull public final Builder waitForCompletion(@Nullable Boolean value) { this.waitForCompletion = value; return this; @@ -259,6 +303,8 @@ public final Builder waitForCompletion(@Nullable Boolean value) { * * @throws NullPointerException if some of the required fields are null. */ + @Override + @Nonnull public CancelRequest build() { _checkSingleUse(); diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/tasks/CancelResponse.java b/java-client/src/generated/java/org/opensearch/client/opensearch/tasks/CancelResponse.java index 0b276ca9cd..4b5bb94790 100644 --- a/java-client/src/generated/java/org/opensearch/client/opensearch/tasks/CancelResponse.java +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/tasks/CancelResponse.java @@ -38,17 +38,20 @@ 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.ObjectBuilderDeserializer; import org.opensearch.client.json.ObjectDeserializer; +import org.opensearch.client.util.CopyableBuilder; import org.opensearch.client.util.ObjectBuilder; +import org.opensearch.client.util.ToCopyableBuilder; // typedef: tasks.cancel.Response @JsonpDeserializable @Generated("org.opensearch.client.codegen.CodeGenerator") -public class CancelResponse extends TaskListResponseBase { +public class CancelResponse extends TaskListResponseBase implements ToCopyableBuilder { // --------------------------------------------------------------------------------------------- @@ -62,12 +65,40 @@ public static CancelResponse of(Function implements ObjectBuilder { + public static class Builder extends TaskListResponseBase.AbstractBuilder implements CopyableBuilder { + + public Builder() {} + + private Builder(CancelResponse o) { + super(o); + } + + private Builder(Builder o) { + super(o); + } @Override + @Nonnull + public Builder copy() { + return new Builder(this); + } + + @Override + @Nonnull protected Builder self() { return this; } @@ -77,6 +108,8 @@ protected Builder self() { * * @throws NullPointerException if some of the required fields are null. */ + @Override + @Nonnull public CancelResponse build() { _checkSingleUse(); diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/tasks/GetTasksRequest.java b/java-client/src/generated/java/org/opensearch/client/opensearch/tasks/GetTasksRequest.java index 750b3bc244..d90fc8582f 100644 --- a/java-client/src/generated/java/org/opensearch/client/opensearch/tasks/GetTasksRequest.java +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/tasks/GetTasksRequest.java @@ -49,8 +49,10 @@ import org.opensearch.client.transport.Endpoint; import org.opensearch.client.transport.endpoints.SimpleEndpoint; 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: tasks.get.Request @@ -58,7 +60,7 @@ * Returns information about a task. */ @Generated("org.opensearch.client.codegen.CodeGenerator") -public class GetTasksRequest extends RequestBase { +public class GetTasksRequest extends RequestBase implements ToCopyableBuilder { @Nonnull private final String taskId; @@ -116,22 +118,54 @@ public final Boolean waitForCompletion() { // --------------------------------------------------------------------------------------------- + @Override + @Nonnull + public Builder toBuilder() { + return new Builder(this); + } + + @Nonnull + public static Builder builder() { + return new Builder(); + } + /** * Builder for {@link GetTasksRequest}. */ - public static class Builder extends ObjectBuilderBase implements ObjectBuilder { + public static class Builder extends ObjectBuilderBase implements CopyableBuilder { private String taskId; @Nullable private Time timeout; @Nullable private Boolean waitForCompletion; + public Builder() {} + + private Builder(GetTasksRequest o) { + this.taskId = o.taskId; + this.timeout = o.timeout; + this.waitForCompletion = o.waitForCompletion; + } + + private Builder(Builder o) { + this.taskId = o.taskId; + this.timeout = o.timeout; + this.waitForCompletion = o.waitForCompletion; + } + + @Override + @Nonnull + public Builder copy() { + return new Builder(this); + } + /** * Required - ID of the task. *

* API name: {@code task_id} *

*/ + @Nonnull public final Builder taskId(String value) { this.taskId = value; return this; @@ -143,6 +177,7 @@ public final Builder taskId(String value) { * API name: {@code timeout} *

*/ + @Nonnull public final Builder timeout(@Nullable Time value) { this.timeout = value; return this; @@ -154,6 +189,7 @@ public final Builder timeout(@Nullable Time value) { * API name: {@code timeout} *

*/ + @Nonnull public final Builder timeout(Function> fn) { return timeout(fn.apply(new Time.Builder()).build()); } @@ -164,6 +200,7 @@ public final Builder timeout(Function> fn) { * API name: {@code wait_for_completion} *

*/ + @Nonnull public final Builder waitForCompletion(@Nullable Boolean value) { this.waitForCompletion = value; return this; @@ -174,6 +211,8 @@ public final Builder waitForCompletion(@Nullable Boolean value) { * * @throws NullPointerException if some of the required fields are null. */ + @Override + @Nonnull public GetTasksRequest build() { _checkSingleUse(); diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/tasks/GetTasksResponse.java b/java-client/src/generated/java/org/opensearch/client/opensearch/tasks/GetTasksResponse.java index e51ed5d5d0..1df0c43977 100644 --- a/java-client/src/generated/java/org/opensearch/client/opensearch/tasks/GetTasksResponse.java +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/tasks/GetTasksResponse.java @@ -50,14 +50,16 @@ import org.opensearch.client.json.PlainJsonSerializable; import org.opensearch.client.opensearch._types.ErrorCause; 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: tasks.get.Response @JsonpDeserializable @Generated("org.opensearch.client.codegen.CodeGenerator") -public class GetTasksResponse implements PlainJsonSerializable { +public class GetTasksResponse implements PlainJsonSerializable, ToCopyableBuilder { private final boolean completed; @@ -144,10 +146,21 @@ protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { // --------------------------------------------------------------------------------------------- + @Override + @Nonnull + public Builder toBuilder() { + return new Builder(this); + } + + @Nonnull + public static Builder builder() { + return new Builder(); + } + /** * Builder for {@link GetTasksResponse}. */ - public static class Builder extends ObjectBuilderBase implements ObjectBuilder { + public static class Builder extends ObjectBuilderBase implements CopyableBuilder { private Boolean completed; @Nullable private ErrorCause error; @@ -155,9 +168,32 @@ public static class Builder extends ObjectBuilderBase implements ObjectBuilder> fn) { return error(fn.apply(new ErrorCause.Builder()).build()); } @@ -181,6 +219,7 @@ public final Builder error(Function> fn) { return response(fn.apply(new TaskResponse.Builder()).build()); } @@ -196,6 +236,7 @@ public final Builder response(Function> fn) { return task(fn.apply(new TaskInfo.Builder()).build()); } @@ -213,6 +255,8 @@ public final Builder task(Function> fn * * @throws NullPointerException if some of the required fields are null. */ + @Override + @Nonnull public GetTasksResponse build() { _checkSingleUse(); diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/tasks/ListRequest.java b/java-client/src/generated/java/org/opensearch/client/opensearch/tasks/ListRequest.java index 8128298f25..8da89ebe71 100644 --- a/java-client/src/generated/java/org/opensearch/client/opensearch/tasks/ListRequest.java +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/tasks/ListRequest.java @@ -50,8 +50,10 @@ import org.opensearch.client.transport.Endpoint; import org.opensearch.client.transport.endpoints.SimpleEndpoint; 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: tasks.list.Request @@ -59,7 +61,7 @@ * Returns a list of tasks. */ @Generated("org.opensearch.client.codegen.CodeGenerator") -public class ListRequest extends RequestBase { +public class ListRequest extends RequestBase implements ToCopyableBuilder { @Nonnull private final List actions; @@ -178,10 +180,21 @@ public final Boolean waitForCompletion() { // --------------------------------------------------------------------------------------------- + @Override + @Nonnull + public Builder toBuilder() { + return new Builder(this); + } + + @Nonnull + public static Builder builder() { + return new Builder(); + } + /** * Builder for {@link ListRequest}. */ - public static class Builder extends ObjectBuilderBase implements ObjectBuilder { + public static class Builder extends ObjectBuilderBase implements CopyableBuilder { @Nullable private List actions; @Nullable @@ -197,6 +210,34 @@ public static class Builder extends ObjectBuilderBase implements ObjectBuilder @@ -207,6 +248,7 @@ public static class Builder extends ObjectBuilderBase implements ObjectBuilderlist to actions. *

*/ + @Nonnull public final Builder actions(List list) { this.actions = _listAddAll(this.actions, list); return this; @@ -222,6 +264,7 @@ public final Builder actions(List list) { * Adds one or more values to actions. *

*/ + @Nonnull public final Builder actions(String value, String... values) { this.actions = _listAdd(this.actions, value, values); return this; @@ -233,6 +276,7 @@ public final Builder actions(String value, String... values) { * API name: {@code detailed} *

*/ + @Nonnull public final Builder detailed(@Nullable Boolean value) { this.detailed = value; return this; @@ -244,6 +288,7 @@ public final Builder detailed(@Nullable Boolean value) { * API name: {@code group_by} *

*/ + @Nonnull public final Builder groupBy(@Nullable GroupBy value) { this.groupBy = value; return this; @@ -260,6 +305,7 @@ public final Builder groupBy(@Nullable GroupBy value) { * Adds all elements of list to nodes. *

*/ + @Nonnull public final Builder nodes(List list) { this.nodes = _listAddAll(this.nodes, list); return this; @@ -276,6 +322,7 @@ public final Builder nodes(List list) { * Adds one or more values to nodes. *

*/ + @Nonnull public final Builder nodes(String value, String... values) { this.nodes = _listAdd(this.nodes, value, values); return this; @@ -287,6 +334,7 @@ public final Builder nodes(String value, String... values) { * API name: {@code parent_task_id} *

*/ + @Nonnull public final Builder parentTaskId(@Nullable String value) { this.parentTaskId = value; return this; @@ -298,6 +346,7 @@ public final Builder parentTaskId(@Nullable String value) { * API name: {@code timeout} *

*/ + @Nonnull public final Builder timeout(@Nullable Time value) { this.timeout = value; return this; @@ -309,6 +358,7 @@ public final Builder timeout(@Nullable Time value) { * API name: {@code timeout} *

*/ + @Nonnull public final Builder timeout(Function> fn) { return timeout(fn.apply(new Time.Builder()).build()); } @@ -319,6 +369,7 @@ public final Builder timeout(Function> fn) { * API name: {@code wait_for_completion} *

*/ + @Nonnull public final Builder waitForCompletion(@Nullable Boolean value) { this.waitForCompletion = value; return this; @@ -329,6 +380,8 @@ public final Builder waitForCompletion(@Nullable Boolean value) { * * @throws NullPointerException if some of the required fields are null. */ + @Override + @Nonnull public ListRequest build() { _checkSingleUse(); diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/tasks/ListResponse.java b/java-client/src/generated/java/org/opensearch/client/opensearch/tasks/ListResponse.java index 4b0ee56d6e..23206de38c 100644 --- a/java-client/src/generated/java/org/opensearch/client/opensearch/tasks/ListResponse.java +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/tasks/ListResponse.java @@ -38,17 +38,20 @@ 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.ObjectBuilderDeserializer; import org.opensearch.client.json.ObjectDeserializer; +import org.opensearch.client.util.CopyableBuilder; import org.opensearch.client.util.ObjectBuilder; +import org.opensearch.client.util.ToCopyableBuilder; // typedef: tasks.list.Response @JsonpDeserializable @Generated("org.opensearch.client.codegen.CodeGenerator") -public class ListResponse extends TaskListResponseBase { +public class ListResponse extends TaskListResponseBase implements ToCopyableBuilder { // --------------------------------------------------------------------------------------------- @@ -62,12 +65,40 @@ public static ListResponse of(Function implements ObjectBuilder { + public static class Builder extends TaskListResponseBase.AbstractBuilder implements CopyableBuilder { + + public Builder() {} + + private Builder(ListResponse o) { + super(o); + } + + private Builder(Builder o) { + super(o); + } @Override + @Nonnull + public Builder copy() { + return new Builder(this); + } + + @Override + @Nonnull protected Builder self() { return this; } @@ -77,6 +108,8 @@ protected Builder self() { * * @throws NullPointerException if some of the required fields are null. */ + @Override + @Nonnull public ListResponse build() { _checkSingleUse(); diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/tasks/Status.java b/java-client/src/generated/java/org/opensearch/client/opensearch/tasks/Status.java index f6f6aa46e2..b8c36f336d 100644 --- a/java-client/src/generated/java/org/opensearch/client/opensearch/tasks/Status.java +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/tasks/Status.java @@ -56,8 +56,10 @@ import org.opensearch.client.opensearch._types.Retries; 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: tasks.Status @@ -66,7 +68,7 @@ */ @JsonpDeserializable @Generated("org.opensearch.client.codegen.CodeGenerator") -public class Status implements PlainJsonSerializable { +public class Status implements PlainJsonSerializable, ToCopyableBuilder { @Nullable private final Integer batches; @@ -440,10 +442,21 @@ protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { // --------------------------------------------------------------------------------------------- + @Override + @Nonnull + public Builder toBuilder() { + return new Builder(this); + } + + @Nonnull + public static Builder builder() { + return new Builder(); + } + /** * Builder for {@link Status}. */ - public static class Builder extends ObjectBuilderBase implements ObjectBuilder { + public static class Builder extends ObjectBuilderBase implements CopyableBuilder { @Nullable private Integer batches; @Nullable @@ -483,12 +496,65 @@ public static class Builder extends ObjectBuilderBase implements ObjectBuilder metadata; + public Builder() {} + + private Builder(Status o) { + this.batches = o.batches; + this.canceled = o.canceled; + this.created = o.created; + this.deleted = o.deleted; + this.noops = o.noops; + this.phase = o.phase; + this.requestsPerSecond = o.requestsPerSecond; + this.retries = o.retries; + this.sliceId = o.sliceId; + this.slices = _listCopy(o.slices); + this.state = o.state; + this.throttled = o.throttled; + this.throttledMillis = o.throttledMillis; + this.throttledUntil = o.throttledUntil; + this.throttledUntilMillis = o.throttledUntilMillis; + this.total = o.total; + this.updated = o.updated; + this.versionConflicts = o.versionConflicts; + this.metadata = _mapCopy(o.metadata); + } + + private Builder(Builder o) { + this.batches = o.batches; + this.canceled = o.canceled; + this.created = o.created; + this.deleted = o.deleted; + this.noops = o.noops; + this.phase = o.phase; + this.requestsPerSecond = o.requestsPerSecond; + this.retries = o.retries; + this.sliceId = o.sliceId; + this.slices = _listCopy(o.slices); + this.state = o.state; + this.throttled = o.throttled; + this.throttledMillis = o.throttledMillis; + this.throttledUntil = o.throttledUntil; + this.throttledUntilMillis = o.throttledUntilMillis; + this.total = o.total; + this.updated = o.updated; + this.versionConflicts = o.versionConflicts; + this.metadata = _mapCopy(o.metadata); + } + + @Override + @Nonnull + public Builder copy() { + return new Builder(this); + } + /** * The number of scroll responses pulled back by the reindex operation. *

* API name: {@code batches} *

*/ + @Nonnull public final Builder batches(@Nullable Integer value) { this.batches = value; return this; @@ -497,6 +563,7 @@ public final Builder batches(@Nullable Integer value) { /** * API name: {@code canceled} */ + @Nonnull public final Builder canceled(@Nullable String value) { this.canceled = value; return this; @@ -508,6 +575,7 @@ public final Builder canceled(@Nullable String value) { * API name: {@code created} *

*/ + @Nonnull public final Builder created(@Nullable Long value) { this.created = value; return this; @@ -519,6 +587,7 @@ public final Builder created(@Nullable Long value) { * API name: {@code deleted} *

*/ + @Nonnull public final Builder deleted(@Nullable Long value) { this.deleted = value; return this; @@ -530,6 +599,7 @@ public final Builder deleted(@Nullable Long value) { * API name: {@code noops} *

*/ + @Nonnull public final Builder noops(@Nullable Long value) { this.noops = value; return this; @@ -538,6 +608,7 @@ public final Builder noops(@Nullable Long value) { /** * API name: {@code phase} */ + @Nonnull public final Builder phase(@Nullable String value) { this.phase = value; return this; @@ -549,6 +620,7 @@ public final Builder phase(@Nullable String value) { * API name: {@code requests_per_second} *

*/ + @Nonnull public final Builder requestsPerSecond(@Nullable Float value) { this.requestsPerSecond = value; return this; @@ -557,6 +629,7 @@ public final Builder requestsPerSecond(@Nullable Float value) { /** * API name: {@code retries} */ + @Nonnull public final Builder retries(@Nullable Retries value) { this.retries = value; return this; @@ -565,6 +638,7 @@ public final Builder retries(@Nullable Retries value) { /** * API name: {@code retries} */ + @Nonnull public final Builder retries(Function> fn) { return retries(fn.apply(new Retries.Builder()).build()); } @@ -572,6 +646,7 @@ public final Builder retries(Function> f /** * API name: {@code slice_id} */ + @Nonnull public final Builder sliceId(@Nullable Integer value) { this.sliceId = value; return this; @@ -584,6 +659,7 @@ public final Builder sliceId(@Nullable Integer value) { * Adds all elements of list to slices. *

*/ + @Nonnull public final Builder slices(List list) { this.slices = _listAddAll(this.slices, list); return this; @@ -596,6 +672,7 @@ public final Builder slices(List list) { * Adds one or more values to slices. *

*/ + @Nonnull public final Builder slices(BulkByScrollTaskStatusOrException value, BulkByScrollTaskStatusOrException... values) { this.slices = _listAdd(this.slices, value, values); return this; @@ -608,6 +685,7 @@ public final Builder slices(BulkByScrollTaskStatusOrException value, BulkByScrol * Adds a value to slices using a builder lambda. *

*/ + @Nonnull public final Builder slices( Function> fn ) { @@ -617,6 +695,7 @@ public final Builder slices( /** * API name: {@code state} */ + @Nonnull public final Builder state(@Nullable String value) { this.state = value; return this; @@ -625,6 +704,7 @@ public final Builder state(@Nullable String value) { /** * API name: {@code throttled} */ + @Nonnull public final Builder throttled(@Nullable Time value) { this.throttled = value; return this; @@ -633,6 +713,7 @@ public final Builder throttled(@Nullable Time value) { /** * API name: {@code throttled} */ + @Nonnull public final Builder throttled(Function> fn) { return throttled(fn.apply(new Time.Builder()).build()); } @@ -640,6 +721,7 @@ public final Builder throttled(Function> fn) { /** * API name: {@code throttled_millis} */ + @Nonnull public final Builder throttledMillis(@Nullable Long value) { this.throttledMillis = value; return this; @@ -648,6 +730,7 @@ public final Builder throttledMillis(@Nullable Long value) { /** * API name: {@code throttled_until} */ + @Nonnull public final Builder throttledUntil(@Nullable Time value) { this.throttledUntil = value; return this; @@ -656,6 +739,7 @@ public final Builder throttledUntil(@Nullable Time value) { /** * API name: {@code throttled_until} */ + @Nonnull public final Builder throttledUntil(Function> fn) { return throttledUntil(fn.apply(new Time.Builder()).build()); } @@ -663,6 +747,7 @@ public final Builder throttledUntil(Function> /** * API name: {@code throttled_until_millis} */ + @Nonnull public final Builder throttledUntilMillis(@Nullable Long value) { this.throttledUntilMillis = value; return this; @@ -674,6 +759,7 @@ public final Builder throttledUntilMillis(@Nullable Long value) { * API name: {@code total} *

*/ + @Nonnull public final Builder total(@Nullable Long value) { this.total = value; return this; @@ -685,6 +771,7 @@ public final Builder total(@Nullable Long value) { * API name: {@code updated} *

*/ + @Nonnull public final Builder updated(@Nullable Long value) { this.updated = value; return this; @@ -696,6 +783,7 @@ public final Builder updated(@Nullable Long value) { * API name: {@code version_conflicts} *

*/ + @Nonnull public final Builder versionConflicts(@Nullable Long value) { this.versionConflicts = value; return this; @@ -707,6 +795,7 @@ public final Builder versionConflicts(@Nullable Long value) { * Adds all elements of map to metadata. *

*/ + @Nonnull public final Builder metadata(Map map) { this.metadata = _mapPutAll(this.metadata, map); return this; @@ -718,6 +807,7 @@ public final Builder metadata(Map map) { * Adds an entry to metadata. *

*/ + @Nonnull public final Builder metadata(String key, JsonData value) { this.metadata = _mapPut(this.metadata, key, value); return this; @@ -728,6 +818,8 @@ public final Builder metadata(String key, JsonData value) { * * @throws NullPointerException if some of the required fields are null. */ + @Override + @Nonnull public Status build() { _checkSingleUse(); diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/tasks/TaskExecutingNode.java b/java-client/src/generated/java/org/opensearch/client/opensearch/tasks/TaskExecutingNode.java index 9a8ed67e25..a34c417fe4 100644 --- a/java-client/src/generated/java/org/opensearch/client/opensearch/tasks/TaskExecutingNode.java +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/tasks/TaskExecutingNode.java @@ -48,13 +48,15 @@ import org.opensearch.client.json.ObjectDeserializer; import org.opensearch.client.opensearch._types.BaseNode; import org.opensearch.client.util.ApiTypeHelper; +import org.opensearch.client.util.CopyableBuilder; import org.opensearch.client.util.ObjectBuilder; +import org.opensearch.client.util.ToCopyableBuilder; // typedef: tasks.TaskExecutingNode @JsonpDeserializable @Generated("org.opensearch.client.codegen.CodeGenerator") -public class TaskExecutingNode extends BaseNode { +public class TaskExecutingNode extends BaseNode implements ToCopyableBuilder { @Nonnull private final Map tasks; @@ -91,12 +93,47 @@ protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { // --------------------------------------------------------------------------------------------- + @Override + @Nonnull + public Builder toBuilder() { + return new Builder(this); + } + + @Nonnull + public static Builder builder() { + return new Builder(); + } + /** * Builder for {@link TaskExecutingNode}. */ - public static class Builder extends BaseNode.AbstractBuilder implements ObjectBuilder { + public static class Builder extends BaseNode.AbstractBuilder implements CopyableBuilder { private Map tasks; + public Builder() {} + + private Builder(TaskExecutingNode o) { + super(o); + this.tasks = _mapCopy(o.tasks); + } + + private Builder(Builder o) { + super(o); + this.tasks = _mapCopy(o.tasks); + } + + @Override + @Nonnull + public Builder copy() { + return new Builder(this); + } + + @Override + @Nonnull + protected Builder self() { + return this; + } + /** * Required - API name: {@code tasks} * @@ -104,6 +141,7 @@ public static class Builder extends BaseNode.AbstractBuilder implements * Adds all elements of map to tasks. *

*/ + @Nonnull public final Builder tasks(Map map) { this.tasks = _mapPutAll(this.tasks, map); return this; @@ -116,6 +154,7 @@ public final Builder tasks(Map map) { * Adds an entry to tasks. *

*/ + @Nonnull public final Builder tasks(String key, TaskInfo value) { this.tasks = _mapPut(this.tasks, key, value); return this; @@ -128,20 +167,18 @@ public final Builder tasks(String key, TaskInfo value) { * Adds a value to tasks using a builder lambda. *

*/ + @Nonnull public final Builder tasks(String key, Function> fn) { return tasks(key, fn.apply(new TaskInfo.Builder()).build()); } - @Override - protected Builder self() { - return this; - } - /** * Builds a {@link TaskExecutingNode}. * * @throws NullPointerException if some of the required fields are null. */ + @Override + @Nonnull public TaskExecutingNode build() { _checkSingleUse(); diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/tasks/TaskGroup.java b/java-client/src/generated/java/org/opensearch/client/opensearch/tasks/TaskGroup.java index 823cb1598f..b59a2c0399 100644 --- a/java-client/src/generated/java/org/opensearch/client/opensearch/tasks/TaskGroup.java +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/tasks/TaskGroup.java @@ -49,13 +49,15 @@ import org.opensearch.client.json.ObjectBuilderDeserializer; import org.opensearch.client.json.ObjectDeserializer; import org.opensearch.client.util.ApiTypeHelper; +import org.opensearch.client.util.CopyableBuilder; import org.opensearch.client.util.ObjectBuilder; +import org.opensearch.client.util.ToCopyableBuilder; // typedef: tasks.TaskGroup @JsonpDeserializable @Generated("org.opensearch.client.codegen.CodeGenerator") -public class TaskGroup extends TaskInfo { +public class TaskGroup extends TaskInfoBase implements ToCopyableBuilder { @Nonnull private final List children; @@ -93,13 +95,48 @@ protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { // --------------------------------------------------------------------------------------------- + @Override + @Nonnull + public Builder toBuilder() { + return new Builder(this); + } + + @Nonnull + public static Builder builder() { + return new Builder(); + } + /** * Builder for {@link TaskGroup}. */ - public static class Builder extends TaskInfo.AbstractBuilder implements ObjectBuilder { + public static class Builder extends TaskInfoBase.AbstractBuilder implements CopyableBuilder { @Nullable private List children; + public Builder() {} + + private Builder(TaskGroup o) { + super(o); + this.children = _listCopy(o.children); + } + + private Builder(Builder o) { + super(o); + this.children = _listCopy(o.children); + } + + @Override + @Nonnull + public Builder copy() { + return new Builder(this); + } + + @Override + @Nonnull + protected Builder self() { + return this; + } + /** * API name: {@code children} * @@ -107,6 +144,7 @@ public static class Builder extends TaskInfo.AbstractBuilder implements * Adds all elements of list to children. *

*/ + @Nonnull public final Builder children(List list) { this.children = _listAddAll(this.children, list); return this; @@ -119,6 +157,7 @@ public final Builder children(List list) { * Adds one or more values to children. *

*/ + @Nonnull public final Builder children(TaskGroup value, TaskGroup... values) { this.children = _listAdd(this.children, value, values); return this; @@ -131,20 +170,18 @@ public final Builder children(TaskGroup value, TaskGroup... values) { * Adds a value to children using a builder lambda. *

*/ + @Nonnull public final Builder children(Function> fn) { return children(fn.apply(new TaskGroup.Builder()).build()); } - @Override - protected Builder self() { - return this; - } - /** * Builds a {@link TaskGroup}. * * @throws NullPointerException if some of the required fields are null. */ + @Override + @Nonnull public TaskGroup build() { _checkSingleUse(); @@ -163,7 +200,7 @@ public TaskGroup build() { ); protected static void setupTaskGroupDeserializer(ObjectDeserializer op) { - setupTaskInfoDeserializer(op); + setupTaskInfoBaseDeserializer(op); op.add(Builder::children, JsonpDeserializer.arrayDeserializer(TaskGroup._DESERIALIZER), "children"); } diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/tasks/TaskInfo.java b/java-client/src/generated/java/org/opensearch/client/opensearch/tasks/TaskInfo.java index 83a6fb707c..7d3f39cc7f 100644 --- a/java-client/src/generated/java/org/opensearch/client/opensearch/tasks/TaskInfo.java +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/tasks/TaskInfo.java @@ -36,260 +36,69 @@ package org.opensearch.client.opensearch.tasks; -import jakarta.json.stream.JsonGenerator; -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.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: tasks.TaskInfo @JsonpDeserializable @Generated("org.opensearch.client.codegen.CodeGenerator") -public class TaskInfo implements PlainJsonSerializable { - - @Nonnull - private final String action; - - private final boolean cancellable; - - @Nullable - private final Boolean cancelled; - - @Nullable - private final String description; - - @Nonnull - private final Map headers; - - private final long id; - - @Nonnull - private final String node; - - @Nullable - private final String parentTaskId; - - @Nullable - private final Time runningTime; - - private final long runningTimeInNanos; - - private final long startTimeInMillis; - - @Nullable - private final Status status; - - @Nonnull - private final String type; +public class TaskInfo extends TaskInfoBase implements ToCopyableBuilder { // --------------------------------------------------------------------------------------------- - protected TaskInfo(AbstractBuilder builder) { - this.action = ApiTypeHelper.requireNonNull(builder.action, this, "action"); - this.cancellable = ApiTypeHelper.requireNonNull(builder.cancellable, this, "cancellable"); - this.cancelled = builder.cancelled; - this.description = builder.description; - this.headers = ApiTypeHelper.unmodifiableRequired(builder.headers, this, "headers"); - this.id = ApiTypeHelper.requireNonNull(builder.id, this, "id"); - this.node = ApiTypeHelper.requireNonNull(builder.node, this, "node"); - this.parentTaskId = builder.parentTaskId; - this.runningTime = builder.runningTime; - this.runningTimeInNanos = ApiTypeHelper.requireNonNull(builder.runningTimeInNanos, this, "runningTimeInNanos"); - this.startTimeInMillis = ApiTypeHelper.requireNonNull(builder.startTimeInMillis, this, "startTimeInMillis"); - this.status = builder.status; - this.type = ApiTypeHelper.requireNonNull(builder.type, this, "type"); + private TaskInfo(Builder builder) { + super(builder); } - public static TaskInfo taskInfoOf(Function> fn) { + public static TaskInfo of(Function> fn) { return fn.apply(new Builder()).build(); } - /** - * Required - API name: {@code action} - */ - @Nonnull - public final String action() { - return this.action; - } - - /** - * Required - API name: {@code cancellable} - */ - public final boolean cancellable() { - return this.cancellable; - } - - /** - * API name: {@code cancelled} - */ - @Nullable - public final Boolean cancelled() { - return this.cancelled; - } - - /** - * API name: {@code description} - */ - @Nullable - public final String description() { - return this.description; - } - - /** - * Required - API name: {@code headers} - */ - @Nonnull - public final Map headers() { - return this.headers; - } - - /** - * Required - API name: {@code id} - */ - public final long id() { - return this.id; - } + // --------------------------------------------------------------------------------------------- - /** - * Required - API name: {@code node} - */ + @Override @Nonnull - public final String node() { - return this.node; - } - - /** - * API name: {@code parent_task_id} - */ - @Nullable - public final String parentTaskId() { - return this.parentTaskId; - } - - /** - * API name: {@code running_time} - */ - @Nullable - public final Time runningTime() { - return this.runningTime; - } - - /** - * Required - API name: {@code running_time_in_nanos} - */ - public final long runningTimeInNanos() { - return this.runningTimeInNanos; - } - - /** - * Required - API name: {@code start_time_in_millis} - */ - public final long startTimeInMillis() { - return this.startTimeInMillis; - } - - /** - * API name: {@code status} - */ - @Nullable - public final Status status() { - return this.status; + public Builder toBuilder() { + return new Builder(this); } - /** - * Required - API name: {@code type} - */ @Nonnull - public final String type() { - return this.type; + public static Builder builder() { + return new Builder(); } /** - * Serialize this object to JSON. + * Builder for {@link TaskInfo}. */ - @Override - public void serialize(JsonGenerator generator, JsonpMapper mapper) { - generator.writeStartObject(); - serializeInternal(generator, mapper); - generator.writeEnd(); - } + public static class Builder extends TaskInfoBase.AbstractBuilder implements CopyableBuilder { - protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { - generator.writeKey("action"); - generator.write(this.action); + public Builder() {} - generator.writeKey("cancellable"); - generator.write(this.cancellable); - - if (this.cancelled != null) { - generator.writeKey("cancelled"); - generator.write(this.cancelled); - } - - if (this.description != null) { - generator.writeKey("description"); - generator.write(this.description); - } - - generator.writeKey("headers"); - generator.writeStartObject(); - for (Map.Entry item0 : this.headers.entrySet()) { - generator.writeKey(item0.getKey()); - generator.write(item0.getValue()); + private Builder(TaskInfo o) { + super(o); } - generator.writeEnd(); - generator.writeKey("id"); - generator.write(this.id); - - generator.writeKey("node"); - generator.write(this.node); - - if (this.parentTaskId != null) { - generator.writeKey("parent_task_id"); - generator.write(this.parentTaskId); + private Builder(Builder o) { + super(o); } - if (this.runningTime != null) { - generator.writeKey("running_time"); - this.runningTime.serialize(generator, mapper); - } - - generator.writeKey("running_time_in_nanos"); - generator.write(this.runningTimeInNanos); - - generator.writeKey("start_time_in_millis"); - generator.write(this.startTimeInMillis); - - if (this.status != null) { - generator.writeKey("status"); - this.status.serialize(generator, mapper); + @Override + @Nonnull + public Builder copy() { + return new Builder(this); } - generator.writeKey("type"); - generator.write(this.type); - } - - // --------------------------------------------------------------------------------------------- - - /** - * Builder for {@link TaskInfo}. - */ - public static class Builder extends TaskInfo.AbstractBuilder implements ObjectBuilder { @Override + @Nonnull protected Builder self() { return this; } @@ -299,6 +108,8 @@ protected Builder self() { * * @throws NullPointerException if some of the required fields are null. */ + @Override + @Nonnull public TaskInfo build() { _checkSingleUse(); @@ -306,163 +117,6 @@ public TaskInfo build() { } } - protected abstract static class AbstractBuilder> extends ObjectBuilderBase { - private String action; - private Boolean cancellable; - @Nullable - private Boolean cancelled; - @Nullable - private String description; - private Map headers; - private Long id; - private String node; - @Nullable - private String parentTaskId; - @Nullable - private Time runningTime; - private Long runningTimeInNanos; - private Long startTimeInMillis; - @Nullable - private Status status; - private String type; - - /** - * Required - API name: {@code action} - */ - public final BuilderT action(String value) { - this.action = value; - return self(); - } - - /** - * Required - API name: {@code cancellable} - */ - public final BuilderT cancellable(boolean value) { - this.cancellable = value; - return self(); - } - - /** - * API name: {@code cancelled} - */ - public final BuilderT cancelled(@Nullable Boolean value) { - this.cancelled = value; - return self(); - } - - /** - * API name: {@code description} - */ - public final BuilderT description(@Nullable String value) { - this.description = value; - return self(); - } - - /** - * Required - API name: {@code headers} - * - *

- * Adds all elements of map to headers. - *

- */ - public final BuilderT headers(Map map) { - this.headers = _mapPutAll(this.headers, map); - return self(); - } - - /** - * Required - API name: {@code headers} - * - *

- * Adds an entry to headers. - *

- */ - public final BuilderT headers(String key, String value) { - this.headers = _mapPut(this.headers, key, value); - return self(); - } - - /** - * Required - API name: {@code id} - */ - public final BuilderT id(long value) { - this.id = value; - return self(); - } - - /** - * Required - API name: {@code node} - */ - public final BuilderT node(String value) { - this.node = value; - return self(); - } - - /** - * API name: {@code parent_task_id} - */ - public final BuilderT parentTaskId(@Nullable String value) { - this.parentTaskId = value; - return self(); - } - - /** - * API name: {@code running_time} - */ - public final BuilderT runningTime(@Nullable Time value) { - this.runningTime = value; - return self(); - } - - /** - * API name: {@code running_time} - */ - public final BuilderT runningTime(Function> fn) { - return runningTime(fn.apply(new Time.Builder()).build()); - } - - /** - * Required - API name: {@code running_time_in_nanos} - */ - public final BuilderT runningTimeInNanos(long value) { - this.runningTimeInNanos = value; - return self(); - } - - /** - * Required - API name: {@code start_time_in_millis} - */ - public final BuilderT startTimeInMillis(long value) { - this.startTimeInMillis = value; - return self(); - } - - /** - * API name: {@code status} - */ - public final BuilderT status(@Nullable Status value) { - this.status = value; - return self(); - } - - /** - * API name: {@code status} - */ - public final BuilderT status(Function> fn) { - return status(fn.apply(new Status.Builder()).build()); - } - - /** - * Required - API name: {@code type} - */ - public final BuilderT type(String value) { - this.type = value; - return self(); - } - - protected abstract BuilderT self(); - } - // --------------------------------------------------------------------------------------------- /** @@ -473,58 +127,23 @@ public final BuilderT type(String value) { TaskInfo::setupTaskInfoDeserializer ); - protected static > void setupTaskInfoDeserializer(ObjectDeserializer op) { - op.add(AbstractBuilder::action, JsonpDeserializer.stringDeserializer(), "action"); - op.add(AbstractBuilder::cancellable, JsonpDeserializer.booleanDeserializer(), "cancellable"); - op.add(AbstractBuilder::cancelled, JsonpDeserializer.booleanDeserializer(), "cancelled"); - op.add(AbstractBuilder::description, JsonpDeserializer.stringDeserializer(), "description"); - op.add(AbstractBuilder::headers, JsonpDeserializer.stringMapDeserializer(JsonpDeserializer.stringDeserializer()), "headers"); - op.add(AbstractBuilder::id, JsonpDeserializer.longDeserializer(), "id"); - op.add(AbstractBuilder::node, JsonpDeserializer.stringDeserializer(), "node"); - op.add(AbstractBuilder::parentTaskId, JsonpDeserializer.stringDeserializer(), "parent_task_id"); - op.add(AbstractBuilder::runningTime, Time._DESERIALIZER, "running_time"); - op.add(AbstractBuilder::runningTimeInNanos, JsonpDeserializer.longDeserializer(), "running_time_in_nanos"); - op.add(AbstractBuilder::startTimeInMillis, JsonpDeserializer.longDeserializer(), "start_time_in_millis"); - op.add(AbstractBuilder::status, Status._DESERIALIZER, "status"); - op.add(AbstractBuilder::type, JsonpDeserializer.stringDeserializer(), "type"); + protected static void setupTaskInfoDeserializer(ObjectDeserializer op) { + setupTaskInfoBaseDeserializer(op); } @Override public int hashCode() { - int result = 17; - result = 31 * result + this.action.hashCode(); - result = 31 * result + Boolean.hashCode(this.cancellable); - result = 31 * result + Objects.hashCode(this.cancelled); - result = 31 * result + Objects.hashCode(this.description); - result = 31 * result + this.headers.hashCode(); - result = 31 * result + Long.hashCode(this.id); - result = 31 * result + this.node.hashCode(); - result = 31 * result + Objects.hashCode(this.parentTaskId); - result = 31 * result + Objects.hashCode(this.runningTime); - result = 31 * result + Long.hashCode(this.runningTimeInNanos); - result = 31 * result + Long.hashCode(this.startTimeInMillis); - result = 31 * result + Objects.hashCode(this.status); - result = 31 * result + this.type.hashCode(); + int result = super.hashCode(); return result; } @Override public boolean equals(Object o) { + if (!super.equals(o)) { + return false; + } if (this == o) return true; if (o == null || this.getClass() != o.getClass()) return false; - TaskInfo other = (TaskInfo) o; - return this.action.equals(other.action) - && this.cancellable == other.cancellable - && Objects.equals(this.cancelled, other.cancelled) - && Objects.equals(this.description, other.description) - && this.headers.equals(other.headers) - && this.id == other.id - && this.node.equals(other.node) - && Objects.equals(this.parentTaskId, other.parentTaskId) - && Objects.equals(this.runningTime, other.runningTime) - && this.runningTimeInNanos == other.runningTimeInNanos - && this.startTimeInMillis == other.startTimeInMillis - && Objects.equals(this.status, other.status) - && this.type.equals(other.type); + return true; } } diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/tasks/TaskInfoBase.java b/java-client/src/generated/java/org/opensearch/client/opensearch/tasks/TaskInfoBase.java new file mode 100644 index 0000000000..7024e7434b --- /dev/null +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/tasks/TaskInfoBase.java @@ -0,0 +1,546 @@ +/* + * 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.tasks; + +import jakarta.json.stream.JsonGenerator; +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.JsonpDeserializer; +import org.opensearch.client.json.JsonpMapper; +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.ObjectBuilder; +import org.opensearch.client.util.ObjectBuilderBase; + +// typedef: tasks.TaskInfoBase + +@Generated("org.opensearch.client.codegen.CodeGenerator") +public abstract class TaskInfoBase implements PlainJsonSerializable { + + @Nonnull + private final String action; + + private final boolean cancellable; + + @Nullable + private final Boolean cancelled; + + @Nullable + private final String description; + + @Nonnull + private final Map headers; + + private final long id; + + @Nonnull + private final String node; + + @Nullable + private final String parentTaskId; + + @Nullable + private final Time runningTime; + + private final long runningTimeInNanos; + + private final long startTimeInMillis; + + @Nullable + private final Status status; + + @Nonnull + private final String type; + + // --------------------------------------------------------------------------------------------- + + protected TaskInfoBase(AbstractBuilder builder) { + this.action = ApiTypeHelper.requireNonNull(builder.action, this, "action"); + this.cancellable = ApiTypeHelper.requireNonNull(builder.cancellable, this, "cancellable"); + this.cancelled = builder.cancelled; + this.description = builder.description; + this.headers = ApiTypeHelper.unmodifiableRequired(builder.headers, this, "headers"); + this.id = ApiTypeHelper.requireNonNull(builder.id, this, "id"); + this.node = ApiTypeHelper.requireNonNull(builder.node, this, "node"); + this.parentTaskId = builder.parentTaskId; + this.runningTime = builder.runningTime; + this.runningTimeInNanos = ApiTypeHelper.requireNonNull(builder.runningTimeInNanos, this, "runningTimeInNanos"); + this.startTimeInMillis = ApiTypeHelper.requireNonNull(builder.startTimeInMillis, this, "startTimeInMillis"); + this.status = builder.status; + this.type = ApiTypeHelper.requireNonNull(builder.type, this, "type"); + } + + /** + * Required - API name: {@code action} + */ + @Nonnull + public final String action() { + return this.action; + } + + /** + * Required - API name: {@code cancellable} + */ + public final boolean cancellable() { + return this.cancellable; + } + + /** + * API name: {@code cancelled} + */ + @Nullable + public final Boolean cancelled() { + return this.cancelled; + } + + /** + * API name: {@code description} + */ + @Nullable + public final String description() { + return this.description; + } + + /** + * Required - API name: {@code headers} + */ + @Nonnull + public final Map headers() { + return this.headers; + } + + /** + * Required - API name: {@code id} + */ + public final long id() { + return this.id; + } + + /** + * Required - API name: {@code node} + */ + @Nonnull + public final String node() { + return this.node; + } + + /** + * API name: {@code parent_task_id} + */ + @Nullable + public final String parentTaskId() { + return this.parentTaskId; + } + + /** + * API name: {@code running_time} + */ + @Nullable + public final Time runningTime() { + return this.runningTime; + } + + /** + * Required - API name: {@code running_time_in_nanos} + */ + public final long runningTimeInNanos() { + return this.runningTimeInNanos; + } + + /** + * Required - API name: {@code start_time_in_millis} + */ + public final long startTimeInMillis() { + return this.startTimeInMillis; + } + + /** + * API name: {@code status} + */ + @Nullable + public final Status status() { + return this.status; + } + + /** + * 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("action"); + generator.write(this.action); + + generator.writeKey("cancellable"); + generator.write(this.cancellable); + + if (this.cancelled != null) { + generator.writeKey("cancelled"); + generator.write(this.cancelled); + } + + if (this.description != null) { + generator.writeKey("description"); + generator.write(this.description); + } + + generator.writeKey("headers"); + generator.writeStartObject(); + for (Map.Entry item0 : this.headers.entrySet()) { + generator.writeKey(item0.getKey()); + generator.write(item0.getValue()); + } + generator.writeEnd(); + + generator.writeKey("id"); + generator.write(this.id); + + generator.writeKey("node"); + generator.write(this.node); + + if (this.parentTaskId != null) { + generator.writeKey("parent_task_id"); + generator.write(this.parentTaskId); + } + + if (this.runningTime != null) { + generator.writeKey("running_time"); + this.runningTime.serialize(generator, mapper); + } + + generator.writeKey("running_time_in_nanos"); + generator.write(this.runningTimeInNanos); + + generator.writeKey("start_time_in_millis"); + generator.write(this.startTimeInMillis); + + if (this.status != null) { + generator.writeKey("status"); + this.status.serialize(generator, mapper); + } + + generator.writeKey("type"); + generator.write(this.type); + } + + // --------------------------------------------------------------------------------------------- + + protected abstract static class AbstractBuilder> extends ObjectBuilderBase { + private String action; + private Boolean cancellable; + @Nullable + private Boolean cancelled; + @Nullable + private String description; + private Map headers; + private Long id; + private String node; + @Nullable + private String parentTaskId; + @Nullable + private Time runningTime; + private Long runningTimeInNanos; + private Long startTimeInMillis; + @Nullable + private Status status; + private String type; + + protected AbstractBuilder() {} + + protected AbstractBuilder(TaskInfoBase o) { + this.action = o.action; + this.cancellable = o.cancellable; + this.cancelled = o.cancelled; + this.description = o.description; + this.headers = _mapCopy(o.headers); + this.id = o.id; + this.node = o.node; + this.parentTaskId = o.parentTaskId; + this.runningTime = o.runningTime; + this.runningTimeInNanos = o.runningTimeInNanos; + this.startTimeInMillis = o.startTimeInMillis; + this.status = o.status; + this.type = o.type; + } + + protected AbstractBuilder(AbstractBuilder o) { + this.action = o.action; + this.cancellable = o.cancellable; + this.cancelled = o.cancelled; + this.description = o.description; + this.headers = _mapCopy(o.headers); + this.id = o.id; + this.node = o.node; + this.parentTaskId = o.parentTaskId; + this.runningTime = o.runningTime; + this.runningTimeInNanos = o.runningTimeInNanos; + this.startTimeInMillis = o.startTimeInMillis; + this.status = o.status; + this.type = o.type; + } + + @Nonnull + protected abstract BuilderT self(); + + /** + * Required - API name: {@code action} + */ + @Nonnull + public final BuilderT action(String value) { + this.action = value; + return self(); + } + + /** + * Required - API name: {@code cancellable} + */ + @Nonnull + public final BuilderT cancellable(boolean value) { + this.cancellable = value; + return self(); + } + + /** + * API name: {@code cancelled} + */ + @Nonnull + public final BuilderT cancelled(@Nullable Boolean value) { + this.cancelled = value; + return self(); + } + + /** + * API name: {@code description} + */ + @Nonnull + public final BuilderT description(@Nullable String value) { + this.description = value; + return self(); + } + + /** + * Required - API name: {@code headers} + * + *

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

+ */ + @Nonnull + public final BuilderT headers(Map map) { + this.headers = _mapPutAll(this.headers, map); + return self(); + } + + /** + * Required - API name: {@code headers} + * + *

+ * Adds an entry to headers. + *

+ */ + @Nonnull + public final BuilderT headers(String key, String value) { + this.headers = _mapPut(this.headers, key, value); + return self(); + } + + /** + * Required - API name: {@code id} + */ + @Nonnull + public final BuilderT id(long value) { + this.id = value; + return self(); + } + + /** + * Required - API name: {@code node} + */ + @Nonnull + public final BuilderT node(String value) { + this.node = value; + return self(); + } + + /** + * API name: {@code parent_task_id} + */ + @Nonnull + public final BuilderT parentTaskId(@Nullable String value) { + this.parentTaskId = value; + return self(); + } + + /** + * API name: {@code running_time} + */ + @Nonnull + public final BuilderT runningTime(@Nullable Time value) { + this.runningTime = value; + return self(); + } + + /** + * API name: {@code running_time} + */ + @Nonnull + public final BuilderT runningTime(Function> fn) { + return runningTime(fn.apply(new Time.Builder()).build()); + } + + /** + * Required - API name: {@code running_time_in_nanos} + */ + @Nonnull + public final BuilderT runningTimeInNanos(long value) { + this.runningTimeInNanos = value; + return self(); + } + + /** + * Required - API name: {@code start_time_in_millis} + */ + @Nonnull + public final BuilderT startTimeInMillis(long value) { + this.startTimeInMillis = value; + return self(); + } + + /** + * API name: {@code status} + */ + @Nonnull + public final BuilderT status(@Nullable Status value) { + this.status = value; + return self(); + } + + /** + * API name: {@code status} + */ + @Nonnull + public final BuilderT status(Function> fn) { + return status(fn.apply(new Status.Builder()).build()); + } + + /** + * Required - API name: {@code type} + */ + @Nonnull + public final BuilderT type(String value) { + this.type = value; + return self(); + } + + } + + // --------------------------------------------------------------------------------------------- + + protected static > void setupTaskInfoBaseDeserializer(ObjectDeserializer op) { + op.add(AbstractBuilder::action, JsonpDeserializer.stringDeserializer(), "action"); + op.add(AbstractBuilder::cancellable, JsonpDeserializer.booleanDeserializer(), "cancellable"); + op.add(AbstractBuilder::cancelled, JsonpDeserializer.booleanDeserializer(), "cancelled"); + op.add(AbstractBuilder::description, JsonpDeserializer.stringDeserializer(), "description"); + op.add(AbstractBuilder::headers, JsonpDeserializer.stringMapDeserializer(JsonpDeserializer.stringDeserializer()), "headers"); + op.add(AbstractBuilder::id, JsonpDeserializer.longDeserializer(), "id"); + op.add(AbstractBuilder::node, JsonpDeserializer.stringDeserializer(), "node"); + op.add(AbstractBuilder::parentTaskId, JsonpDeserializer.stringDeserializer(), "parent_task_id"); + op.add(AbstractBuilder::runningTime, Time._DESERIALIZER, "running_time"); + op.add(AbstractBuilder::runningTimeInNanos, JsonpDeserializer.longDeserializer(), "running_time_in_nanos"); + op.add(AbstractBuilder::startTimeInMillis, JsonpDeserializer.longDeserializer(), "start_time_in_millis"); + op.add(AbstractBuilder::status, Status._DESERIALIZER, "status"); + op.add(AbstractBuilder::type, JsonpDeserializer.stringDeserializer(), "type"); + } + + @Override + public int hashCode() { + int result = 17; + result = 31 * result + this.action.hashCode(); + result = 31 * result + Boolean.hashCode(this.cancellable); + result = 31 * result + Objects.hashCode(this.cancelled); + result = 31 * result + Objects.hashCode(this.description); + result = 31 * result + this.headers.hashCode(); + result = 31 * result + Long.hashCode(this.id); + result = 31 * result + this.node.hashCode(); + result = 31 * result + Objects.hashCode(this.parentTaskId); + result = 31 * result + Objects.hashCode(this.runningTime); + result = 31 * result + Long.hashCode(this.runningTimeInNanos); + result = 31 * result + Long.hashCode(this.startTimeInMillis); + result = 31 * result + Objects.hashCode(this.status); + 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; + TaskInfoBase other = (TaskInfoBase) o; + return this.action.equals(other.action) + && this.cancellable == other.cancellable + && Objects.equals(this.cancelled, other.cancelled) + && Objects.equals(this.description, other.description) + && this.headers.equals(other.headers) + && this.id == other.id + && this.node.equals(other.node) + && Objects.equals(this.parentTaskId, other.parentTaskId) + && Objects.equals(this.runningTime, other.runningTime) + && this.runningTimeInNanos == other.runningTimeInNanos + && this.startTimeInMillis == other.startTimeInMillis + && Objects.equals(this.status, other.status) + && this.type.equals(other.type); + } +} diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/tasks/TaskListResponseBase.java b/java-client/src/generated/java/org/opensearch/client/opensearch/tasks/TaskListResponseBase.java index aab6b1618f..89b41c15d9 100644 --- a/java-client/src/generated/java/org/opensearch/client/opensearch/tasks/TaskListResponseBase.java +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/tasks/TaskListResponseBase.java @@ -172,6 +172,25 @@ protected abstract static class AbstractBuilder o) { + this.nodeFailures = _listCopy(o.nodeFailures); + this.nodes = _mapCopy(o.nodes); + this.taskFailures = _listCopy(o.taskFailures); + this.tasks = o.tasks; + } + + @Nonnull + protected abstract BuilderT self(); + /** * API name: {@code node_failures} * @@ -179,6 +198,7 @@ protected abstract static class AbstractBuilderlist to nodeFailures. *

*/ + @Nonnull public final BuilderT nodeFailures(List list) { this.nodeFailures = _listAddAll(this.nodeFailures, list); return self(); @@ -191,6 +211,7 @@ public final BuilderT nodeFailures(List list) { * Adds one or more values to nodeFailures. *

*/ + @Nonnull public final BuilderT nodeFailures(ErrorCause value, ErrorCause... values) { this.nodeFailures = _listAdd(this.nodeFailures, value, values); return self(); @@ -203,6 +224,7 @@ public final BuilderT nodeFailures(ErrorCause value, ErrorCause... values) { * Adds a value to nodeFailures using a builder lambda. *

*/ + @Nonnull public final BuilderT nodeFailures(Function> fn) { return nodeFailures(fn.apply(new ErrorCause.Builder()).build()); } @@ -217,6 +239,7 @@ public final BuilderT nodeFailures(Functionmap to nodes. *

*/ + @Nonnull public final BuilderT nodes(Map map) { this.nodes = _mapPutAll(this.nodes, map); return self(); @@ -232,6 +255,7 @@ public final BuilderT nodes(Map map) { * Adds an entry to nodes. *

*/ + @Nonnull public final BuilderT nodes(String key, TaskExecutingNode value) { this.nodes = _mapPut(this.nodes, key, value); return self(); @@ -247,6 +271,7 @@ public final BuilderT nodes(String key, TaskExecutingNode value) { * Adds a value to nodes using a builder lambda. *

*/ + @Nonnull public final BuilderT nodes(String key, Function> fn) { return nodes(key, fn.apply(new TaskExecutingNode.Builder()).build()); } @@ -258,6 +283,7 @@ public final BuilderT nodes(String key, Functionlist to taskFailures. *

*/ + @Nonnull public final BuilderT taskFailures(List list) { this.taskFailures = _listAddAll(this.taskFailures, list); return self(); @@ -270,6 +296,7 @@ public final BuilderT taskFailures(List list) { * Adds one or more values to taskFailures. *

*/ + @Nonnull public final BuilderT taskFailures(TaskFailure value, TaskFailure... values) { this.taskFailures = _listAdd(this.taskFailures, value, values); return self(); @@ -282,6 +309,7 @@ public final BuilderT taskFailures(TaskFailure value, TaskFailure... values) { * Adds a value to taskFailures using a builder lambda. *

*/ + @Nonnull public final BuilderT taskFailures(Function> fn) { return taskFailures(fn.apply(new TaskFailure.Builder()).build()); } @@ -289,6 +317,7 @@ public final BuilderT taskFailures(Function> fn) { return tasks(fn.apply(new TaskInfos.Builder()).build()); } - protected abstract BuilderT self(); } // --------------------------------------------------------------------------------------------- diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/tasks/TaskResponse.java b/java-client/src/generated/java/org/opensearch/client/opensearch/tasks/TaskResponse.java index fecdd4e742..3d35d3b593 100644 --- a/java-client/src/generated/java/org/opensearch/client/opensearch/tasks/TaskResponse.java +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/tasks/TaskResponse.java @@ -54,14 +54,16 @@ import org.opensearch.client.opensearch._types.Retries; 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: tasks.TaskResponse @JsonpDeserializable @Generated("org.opensearch.client.codegen.CodeGenerator") -public class TaskResponse implements PlainJsonSerializable { +public class TaskResponse implements PlainJsonSerializable, ToCopyableBuilder { private final int batches; @@ -397,10 +399,21 @@ protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { // --------------------------------------------------------------------------------------------- + @Override + @Nonnull + public Builder toBuilder() { + return new Builder(this); + } + + @Nonnull + public static Builder builder() { + return new Builder(); + } + /** * Builder for {@link TaskResponse}. */ - public static class Builder extends ObjectBuilderBase implements ObjectBuilder { + public static class Builder extends ObjectBuilderBase implements CopyableBuilder { private Integer batches; @Nullable private String canceled; @@ -428,12 +441,65 @@ public static class Builder extends ObjectBuilderBase implements ObjectBuilder * API name: {@code batches} *

*/ + @Nonnull public final Builder batches(int value) { this.batches = value; return this; @@ -442,6 +508,7 @@ public final Builder batches(int value) { /** * API name: {@code canceled} */ + @Nonnull public final Builder canceled(@Nullable String value) { this.canceled = value; return this; @@ -453,6 +520,7 @@ public final Builder canceled(@Nullable String value) { * API name: {@code created} *

*/ + @Nonnull public final Builder created(@Nullable Long value) { this.created = value; return this; @@ -464,6 +532,7 @@ public final Builder created(@Nullable Long value) { * API name: {@code deleted} *

*/ + @Nonnull public final Builder deleted(long value) { this.deleted = value; return this; @@ -476,6 +545,7 @@ public final Builder deleted(long value) { * Adds all elements of list to failures. *

*/ + @Nonnull public final Builder failures(List list) { this.failures = _listAddAll(this.failures, list); return this; @@ -488,6 +558,7 @@ public final Builder failures(List list) { * Adds one or more values to failures. *

*/ + @Nonnull public final Builder failures(BulkByScrollFailure value, BulkByScrollFailure... values) { this.failures = _listAdd(this.failures, value, values); return this; @@ -500,6 +571,7 @@ public final Builder failures(BulkByScrollFailure value, BulkByScrollFailure... * Adds a value to failures using a builder lambda. *

*/ + @Nonnull public final Builder failures(Function> fn) { return failures(fn.apply(new BulkByScrollFailure.Builder()).build()); } @@ -510,6 +582,7 @@ public final Builder failures(Function */ + @Nonnull public final Builder noops(long value) { this.noops = value; return this; @@ -521,6 +594,7 @@ public final Builder noops(long value) { * API name: {@code requests_per_second} *

*/ + @Nonnull public final Builder requestsPerSecond(float value) { this.requestsPerSecond = value; return this; @@ -529,6 +603,7 @@ public final Builder requestsPerSecond(float value) { /** * Required - API name: {@code retries} */ + @Nonnull public final Builder retries(Retries value) { this.retries = value; return this; @@ -537,6 +612,7 @@ public final Builder retries(Retries value) { /** * Required - API name: {@code retries} */ + @Nonnull public final Builder retries(Function> fn) { return retries(fn.apply(new Retries.Builder()).build()); } @@ -544,6 +620,7 @@ public final Builder retries(Function> f /** * API name: {@code slice_id} */ + @Nonnull public final Builder sliceId(@Nullable Integer value) { this.sliceId = value; return this; @@ -556,6 +633,7 @@ public final Builder sliceId(@Nullable Integer value) { * Adds all elements of list to slices. *

*/ + @Nonnull public final Builder slices(List list) { this.slices = _listAddAll(this.slices, list); return this; @@ -568,6 +646,7 @@ public final Builder slices(List list) { * Adds one or more values to slices. *

*/ + @Nonnull public final Builder slices(BulkByScrollTaskStatusOrException value, BulkByScrollTaskStatusOrException... values) { this.slices = _listAdd(this.slices, value, values); return this; @@ -580,6 +659,7 @@ public final Builder slices(BulkByScrollTaskStatusOrException value, BulkByScrol * Adds a value to slices using a builder lambda. *

*/ + @Nonnull public final Builder slices( Function> fn ) { @@ -589,6 +669,7 @@ public final Builder slices( /** * API name: {@code throttled} */ + @Nonnull public final Builder throttled(@Nullable Time value) { this.throttled = value; return this; @@ -597,6 +678,7 @@ public final Builder throttled(@Nullable Time value) { /** * API name: {@code throttled} */ + @Nonnull public final Builder throttled(Function> fn) { return throttled(fn.apply(new Time.Builder()).build()); } @@ -604,6 +686,7 @@ public final Builder throttled(Function> fn) { /** * Required - API name: {@code throttled_millis} */ + @Nonnull public final Builder throttledMillis(long value) { this.throttledMillis = value; return this; @@ -612,6 +695,7 @@ public final Builder throttledMillis(long value) { /** * API name: {@code throttled_until} */ + @Nonnull public final Builder throttledUntil(@Nullable Time value) { this.throttledUntil = value; return this; @@ -620,6 +704,7 @@ public final Builder throttledUntil(@Nullable Time value) { /** * API name: {@code throttled_until} */ + @Nonnull public final Builder throttledUntil(Function> fn) { return throttledUntil(fn.apply(new Time.Builder()).build()); } @@ -627,6 +712,7 @@ public final Builder throttledUntil(Function> /** * Required - API name: {@code throttled_until_millis} */ + @Nonnull public final Builder throttledUntilMillis(long value) { this.throttledUntilMillis = value; return this; @@ -635,6 +721,7 @@ public final Builder throttledUntilMillis(long value) { /** * Required - API name: {@code timed_out} */ + @Nonnull public final Builder timedOut(boolean value) { this.timedOut = value; return this; @@ -643,6 +730,7 @@ public final Builder timedOut(boolean value) { /** * Required - API name: {@code took} */ + @Nonnull public final Builder took(long value) { this.took = value; return this; @@ -654,6 +742,7 @@ public final Builder took(long value) { * API name: {@code total} *

*/ + @Nonnull public final Builder total(long value) { this.total = value; return this; @@ -665,6 +754,7 @@ public final Builder total(long value) { * API name: {@code updated} *

*/ + @Nonnull public final Builder updated(@Nullable Long value) { this.updated = value; return this; @@ -676,6 +766,7 @@ public final Builder updated(@Nullable Long value) { * API name: {@code version_conflicts} *

*/ + @Nonnull public final Builder versionConflicts(long value) { this.versionConflicts = value; return this; @@ -686,6 +777,8 @@ public final Builder versionConflicts(long value) { * * @throws NullPointerException if some of the required fields are null. */ + @Override + @Nonnull public TaskResponse build() { _checkSingleUse(); diff --git a/java-client/src/main/java/org/opensearch/client/util/CopyableBuilder.java b/java-client/src/main/java/org/opensearch/client/util/CopyableBuilder.java new file mode 100644 index 0000000000..fd3b6ccc7d --- /dev/null +++ b/java-client/src/main/java/org/opensearch/client/util/CopyableBuilder.java @@ -0,0 +1,27 @@ +/* + * 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.util; + +import javax.annotation.Nonnull; + +public interface CopyableBuilder, T extends ToCopyableBuilder> extends MutableBuilder { + /** + * Create a new builder {@link B} that is a copy of this one. + * + * @return a new builder instance. + * + * @implNote The default implementation of this method calls {@link #build()} and then {@link T#toBuilder()}. + * Implementations can override this method to provide a more efficient implementation or to handle copying + * partial state. + */ + @Nonnull + default B copy() { + return build().toBuilder(); + } +} diff --git a/java-client/src/main/java/org/opensearch/client/util/MutableBuilder.java b/java-client/src/main/java/org/opensearch/client/util/MutableBuilder.java new file mode 100644 index 0000000000..9c47e5f833 --- /dev/null +++ b/java-client/src/main/java/org/opensearch/client/util/MutableBuilder.java @@ -0,0 +1,28 @@ +/* + * 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.util; + +import java.util.Objects; +import java.util.function.Consumer; +import javax.annotation.Nonnull; + +public interface MutableBuilder, T> extends ObjectBuilder { + /** + * Apply a mutation to this object. + * + * @param mutator the mutation to apply + * @return this object + */ + @SuppressWarnings("unchecked") + @Nonnull + default B applyMutation(@Nonnull Consumer mutator) { + Objects.requireNonNull(mutator, "mutator must not be null").accept((B) this); + return (B) this; + } +} diff --git a/java-client/src/main/java/org/opensearch/client/util/ObjectBuilder.java b/java-client/src/main/java/org/opensearch/client/util/ObjectBuilder.java index c2d3a6399f..e794fd0120 100644 --- a/java-client/src/main/java/org/opensearch/client/util/ObjectBuilder.java +++ b/java-client/src/main/java/org/opensearch/client/util/ObjectBuilder.java @@ -32,11 +32,14 @@ package org.opensearch.client.util; +import javax.annotation.Nonnull; + /** * Base interface for all object builders. * * @param the type that will be built. */ public interface ObjectBuilder { + @Nonnull T build(); } diff --git a/java-client/src/main/java/org/opensearch/client/util/ObjectBuilderBase.java b/java-client/src/main/java/org/opensearch/client/util/ObjectBuilderBase.java index 788078c9dd..9d5084618b 100644 --- a/java-client/src/main/java/org/opensearch/client/util/ObjectBuilderBase.java +++ b/java-client/src/main/java/org/opensearch/client/util/ObjectBuilderBase.java @@ -39,6 +39,7 @@ import java.util.List; import java.util.Map; import java.util.Objects; +import javax.annotation.Nullable; public class ObjectBuilderBase { private boolean _used = false; @@ -69,10 +70,18 @@ private static List _mutableList(List list) { return list; } else { // Adding to a list we don't own: make a defensive copy, also ensuring it is mutable. - return new InternalList<>(list); + return _listCopy(list); } } + /** + * Make a mutable copy of a list if it is not {@code null}. + */ + @Nullable + protected static List _listCopy(@Nullable List list) { + return list == null ? null : new InternalList<>(list); + } + /** Add a value to a (possibly {@code null}) list */ @SafeVarargs protected static List _listAdd(List list, T value, T... values) { @@ -116,10 +125,18 @@ private static Map _mutableMap(Map map) { return map; } else { // Adding to a map we don't own: make a defensive copy, also ensuring it is mutable. - return new InternalMap<>(map); + return _mapCopy(map); } } + /** + * Make a mutable copy of a map if it is not {@code null}. + */ + @Nullable + protected static Map _mapCopy(@Nullable Map map) { + return map == null ? null : new InternalMap<>(map); + } + /** Add a value to a (possibly {@code null}) map */ protected static Map _mapPut(Map map, K key, V value) { map = _mutableMap(map); diff --git a/java-client/src/main/java/org/opensearch/client/util/ToCopyableBuilder.java b/java-client/src/main/java/org/opensearch/client/util/ToCopyableBuilder.java new file mode 100644 index 0000000000..5c3b540368 --- /dev/null +++ b/java-client/src/main/java/org/opensearch/client/util/ToCopyableBuilder.java @@ -0,0 +1,33 @@ +/* + * 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.util; + +import java.util.function.Consumer; +import javax.annotation.Nonnull; + +public interface ToCopyableBuilder, T extends ToCopyableBuilder> { + /** + * Create a new builder {@link B} that is initialised with the current state of this object. + * + * @return a new builder instance. + */ + @Nonnull + B toBuilder(); + + /** + * A convenience method for calling {@link #toBuilder()}, updating the returned builder and then calling {@link B#build()}. + * + * @param modifier A function that mutates this immutable object using the provided builder. + * @return A new copy of this object with the requested modifications. + */ + @Nonnull + default T copy(@Nonnull Consumer modifier) { + return toBuilder().applyMutation(modifier).build(); + } +} diff --git a/java-codegen/opensearch-openapi.yaml b/java-codegen/opensearch-openapi.yaml index 0732189ae0..6c460b0195 100644 --- a/java-codegen/opensearch-openapi.yaml +++ b/java-codegen/opensearch-openapi.yaml @@ -621,7 +621,7 @@ paths: operationId: cat.fielddata.0 x-operation-group: cat.fielddata x-version-added: '1.0' - description: Shows how much heap memory is currently being used by fielddata on every data node in the cluster. + description: Shows how much heap memory is currently being used by field data on every data node in the cluster. externalDocs: url: https://opensearch.org/docs/latest/api-reference/cat/cat-field-data/ parameters: @@ -645,7 +645,7 @@ paths: operationId: cat.fielddata.1 x-operation-group: cat.fielddata x-version-added: '1.0' - description: Shows how much heap memory is currently being used by fielddata on every data node in the cluster. + description: Shows how much heap memory is currently being used by field data on every data node in the cluster. externalDocs: url: https://opensearch.org/docs/latest/api-reference/cat/cat-field-data/ parameters: @@ -757,7 +757,7 @@ paths: operationId: cat.master.0 x-operation-group: cat.master deprecated: true - x-deprecation-message: To promote inclusive language, please use '/_cat/cluster_manager' instead. + x-deprecation-message: To promote inclusive language, use '/_cat/cluster_manager' instead. x-version-added: '1.0' x-version-deprecated: '2.0' description: Returns information about the cluster-manager node. @@ -3874,7 +3874,7 @@ paths: responses: '201': $ref: '#/components/responses/flow_framework.update___201' - description: It returns the workflow_id + description: It returns the `workflow_id`. '400': $ref: '#/components/responses/flow_framework.update___400' '404': @@ -4086,7 +4086,7 @@ paths: get: operationId: ism.explain_policy.0 x-operation-group: ism.explain_policy - description: Gets the currently applied policy on indices. + description: Gets the currently applied policy on indexes. externalDocs: url: https://opensearch.org/docs/latest/im-plugin/ism/api/#explain-index requestBody: @@ -4103,7 +4103,7 @@ paths: post: operationId: ism.explain_policy.1 x-operation-group: ism.explain_policy - description: Gets the currently applied policy on indices. + description: Gets the currently applied policy on indexes. externalDocs: url: https://opensearch.org/docs/latest/im-plugin/ism/api/#explain-index requestBody: @@ -4121,7 +4121,7 @@ paths: get: operationId: ism.explain_policy.3 x-operation-group: ism.explain_policy - description: Gets the currently applied policy on indices. + description: Gets the currently applied policy on indexes. externalDocs: url: https://opensearch.org/docs/latest/im-plugin/ism/api/#explain-index parameters: @@ -4139,7 +4139,7 @@ paths: post: operationId: ism.explain_policy.4 x-operation-group: ism.explain_policy - description: Gets the currently applied policy on indices. + description: Gets the currently applied policy on indexes. externalDocs: url: https://opensearch.org/docs/latest/im-plugin/ism/api/#explain-index parameters: @@ -5380,6 +5380,212 @@ paths: responses: '200': $ref: '#/components/responses/ism.refresh_search_analyzers___200' + /_plugins/_replication/_autofollow: + delete: + operationId: replication.delete_replication_rule.0 + x-operation-group: replication.delete_replication_rule + x-version-added: '1.1' + description: Deletes the specified replication rule. + externalDocs: + url: https://opensearch.org/docs/latest/tuning-your-cluster/replication-plugin/api/#delete-replication-rule + requestBody: + $ref: '#/components/requestBodies/replication.delete_replication_rule' + responses: + '200': + $ref: '#/components/responses/replication.delete_replication_rule___200' + parameters: + - $ref: '#/components/parameters/_global___query.pretty' + - $ref: '#/components/parameters/_global___query.human' + - $ref: '#/components/parameters/_global___query.error_trace' + - $ref: '#/components/parameters/_global___query.source' + - $ref: '#/components/parameters/_global___query.filter_path' + post: + operationId: replication.create_replication_rule.0 + x-operation-group: replication.create_replication_rule + x-version-added: '1.1' + description: Automatically starts replication on indexes matching a specified pattern. + externalDocs: + url: https://opensearch.org/docs/latest/tuning-your-cluster/replication-plugin/api/#create-replication-rule + requestBody: + $ref: '#/components/requestBodies/replication.create_replication_rule' + responses: + '200': + $ref: '#/components/responses/replication.create_replication_rule___200' + parameters: + - $ref: '#/components/parameters/_global___query.pretty' + - $ref: '#/components/parameters/_global___query.human' + - $ref: '#/components/parameters/_global___query.error_trace' + - $ref: '#/components/parameters/_global___query.source' + - $ref: '#/components/parameters/_global___query.filter_path' + /_plugins/_replication/{index}/_pause: + post: + operationId: replication.pause.0 + x-operation-group: replication.pause + x-version-added: '1.1' + description: Pauses replication of the leader index. + externalDocs: + url: https://opensearch.org/docs/latest/tuning-your-cluster/replication-plugin/api/#pause-replication + parameters: + - $ref: '#/components/parameters/replication.pause___path.index' + - $ref: '#/components/parameters/_global___query.pretty' + - $ref: '#/components/parameters/_global___query.human' + - $ref: '#/components/parameters/_global___query.error_trace' + - $ref: '#/components/parameters/_global___query.source' + - $ref: '#/components/parameters/_global___query.filter_path' + requestBody: + $ref: '#/components/requestBodies/replication.pause' + responses: + '200': + $ref: '#/components/responses/replication.pause___200' + /_plugins/_replication/{index}/_resume: + post: + operationId: replication.resume.0 + x-operation-group: replication.resume + x-version-added: '1.1' + description: Resumes replication of the leader index. + externalDocs: + url: https://opensearch.org/docs/latest/tuning-your-cluster/replication-plugin/api/#resume-replication + parameters: + - $ref: '#/components/parameters/replication.resume___path.index' + - $ref: '#/components/parameters/_global___query.pretty' + - $ref: '#/components/parameters/_global___query.human' + - $ref: '#/components/parameters/_global___query.error_trace' + - $ref: '#/components/parameters/_global___query.source' + - $ref: '#/components/parameters/_global___query.filter_path' + requestBody: + $ref: '#/components/requestBodies/replication.resume' + responses: + '200': + $ref: '#/components/responses/replication.resume___200' + /_plugins/_replication/{index}/_start: + put: + operationId: replication.start.0 + x-operation-group: replication.start + x-version-added: '1.1' + description: Initiate replication of an index from the leader cluster to the follower cluster. + externalDocs: + url: https://opensearch.org/docs/latest/tuning-your-cluster/replication-plugin/api/#start-replication + parameters: + - $ref: '#/components/parameters/replication.start___path.index' + - $ref: '#/components/parameters/_global___query.pretty' + - $ref: '#/components/parameters/_global___query.human' + - $ref: '#/components/parameters/_global___query.error_trace' + - $ref: '#/components/parameters/_global___query.source' + - $ref: '#/components/parameters/_global___query.filter_path' + requestBody: + $ref: '#/components/requestBodies/replication.start' + responses: + '200': + $ref: '#/components/responses/replication.start___200' + /_plugins/_replication/{index}/_status: + get: + operationId: replication.status.0 + x-operation-group: replication.status + x-version-added: '1.1' + description: Gets the status of index replication. + externalDocs: + url: https://opensearch.org/docs/latest/tuning-your-cluster/replication-plugin/api/#get-replication-status + parameters: + - $ref: '#/components/parameters/replication.status___path.index' + - $ref: '#/components/parameters/_global___query.pretty' + - $ref: '#/components/parameters/_global___query.human' + - $ref: '#/components/parameters/_global___query.error_trace' + - $ref: '#/components/parameters/_global___query.source' + - $ref: '#/components/parameters/_global___query.filter_path' + responses: + '200': + $ref: '#/components/responses/replication.status___200' + /_plugins/_replication/{index}/_stop: + post: + operationId: replication.stop.0 + x-operation-group: replication.stop + x-version-added: '1.1' + description: Terminates replication and converts the follower index to a standard index. + externalDocs: + url: https://opensearch.org/docs/latest/tuning-your-cluster/replication-plugin/api/#stop-replication + parameters: + - $ref: '#/components/parameters/replication.stop___path.index' + - $ref: '#/components/parameters/_global___query.pretty' + - $ref: '#/components/parameters/_global___query.human' + - $ref: '#/components/parameters/_global___query.error_trace' + - $ref: '#/components/parameters/_global___query.source' + - $ref: '#/components/parameters/_global___query.filter_path' + requestBody: + $ref: '#/components/requestBodies/replication.stop' + responses: + '200': + $ref: '#/components/responses/replication.stop___200' + /_plugins/_replication/{index}/_update: + put: + operationId: replication.update_settings.0 + x-operation-group: replication.update_settings + x-version-added: '1.1' + description: Updates settings on the follower index. + externalDocs: + url: https://opensearch.org/docs/latest/tuning-your-cluster/replication-plugin/api/#update-settings + parameters: + - $ref: '#/components/parameters/replication.update_settings___path.index' + - $ref: '#/components/parameters/_global___query.pretty' + - $ref: '#/components/parameters/_global___query.human' + - $ref: '#/components/parameters/_global___query.error_trace' + - $ref: '#/components/parameters/_global___query.source' + - $ref: '#/components/parameters/_global___query.filter_path' + requestBody: + $ref: '#/components/requestBodies/replication.update_settings' + responses: + '200': + $ref: '#/components/responses/replication.update_settings___200' + /_plugins/_replication/autofollow_stats: + get: + operationId: replication.autofollow_stats.0 + x-operation-group: replication.autofollow_stats + x-version-added: '1.1' + description: Gets information about auto-follow activity and any replication rules configured on the specified cluster. + externalDocs: + url: https://opensearch.org/docs/latest/tuning-your-cluster/replication-plugin/api/#get-auto-follow-stats + responses: + '200': + $ref: '#/components/responses/replication.autofollow_stats___200' + parameters: + - $ref: '#/components/parameters/_global___query.pretty' + - $ref: '#/components/parameters/_global___query.human' + - $ref: '#/components/parameters/_global___query.error_trace' + - $ref: '#/components/parameters/_global___query.source' + - $ref: '#/components/parameters/_global___query.filter_path' + /_plugins/_replication/follower_stats: + get: + operationId: replication.follower_stats.0 + x-operation-group: replication.follower_stats + x-version-added: '1.1' + description: Gets information about follower (syncing) indexes on a specified cluster. + externalDocs: + url: https://opensearch.org/docs/latest/tuning-your-cluster/replication-plugin/api/#get-follower-cluster-stats + responses: + '200': + $ref: '#/components/responses/replication.follower_stats___200' + parameters: + - $ref: '#/components/parameters/_global___query.pretty' + - $ref: '#/components/parameters/_global___query.human' + - $ref: '#/components/parameters/_global___query.error_trace' + - $ref: '#/components/parameters/_global___query.source' + - $ref: '#/components/parameters/_global___query.filter_path' + /_plugins/_replication/leader_stats: + get: + operationId: replication.leader_stats.0 + x-operation-group: replication.leader_stats + x-version-added: '1.1' + description: Gets information about replicated leader indexes on a specified cluster. + externalDocs: + url: https://opensearch.org/docs/latest/tuning-your-cluster/replication-plugin/api/#get-leader-cluster-stats + responses: + '200': + $ref: '#/components/responses/replication.leader_stats___200' + parameters: + - $ref: '#/components/parameters/_global___query.pretty' + - $ref: '#/components/parameters/_global___query.human' + - $ref: '#/components/parameters/_global___query.error_trace' + - $ref: '#/components/parameters/_global___query.source' + - $ref: '#/components/parameters/_global___query.filter_path' /_plugins/_rollup/jobs/{id}: delete: operationId: rollups.delete.0 @@ -6629,7 +6835,7 @@ paths: x-distributions-excluded: - amazon-managed - amazon-serverless - description: A PATCH call is used to update the existing configuration using the REST API. Only accessible by admins and users with rest api access and only when put or patch is enabled. + description: A `PATCH` call is used to update the existing configuration using the REST API. Only accessible by admins and users with REST API access and only when put or patch is enabled. externalDocs: url: https://opensearch.org/docs/latest/security/access-control/api/#patch-configuration requestBody: @@ -6653,7 +6859,7 @@ paths: x-distributions-excluded: - amazon-managed - amazon-serverless - description: Adds or updates the existing configuration using the REST API. Only accessible by admins and users with rest api access and only when put or patch is enabled. + description: Adds or updates the existing configuration using the REST API. Only accessible by admins and users with REST API access and only when put or patch is enabled. externalDocs: url: https://opensearch.org/docs/latest/security/access-control/api/#update-configuration requestBody: @@ -7009,7 +7215,7 @@ paths: x-distributions-excluded: - amazon-managed - amazon-serverless - description: Generates authorization token for the given user. Legacy API. Not Implemented. + description: Generates authorization token for the given user. Legacy API. Not Implemented. parameters: - $ref: '#/components/parameters/security.generate_user_token_legacy___path.username' - $ref: '#/components/parameters/_global___query.pretty' @@ -7448,7 +7654,7 @@ paths: operationId: transforms.put.0 x-operation-group: transforms.put x-version-added: '1.0' - description: Create an index transform, or update a transform if if_seq_no and if_primary_term are provided. + description: Create an index transform, or update a transform if `if_seq_no` and `if_primary_term` are provided. externalDocs: url: https://opensearch.org/docs/latest/im-plugin/index-transforms/transforms-apis/#create-a-transform-job parameters: @@ -9280,7 +9486,7 @@ paths: operationId: indices.get_upgrade.0 x-operation-group: indices.get_upgrade x-version-added: '1.0' - description: The _upgrade API is no longer useful and will be removed. + description: The `_upgrade` API is no longer useful and will be removed. externalDocs: url: https://opensearch.org/docs/latest parameters: @@ -9299,7 +9505,7 @@ paths: operationId: indices.upgrade.0 x-operation-group: indices.upgrade x-version-added: '1.0' - description: The _upgrade API is no longer useful and will be removed. + description: The `_upgrade` API is no longer useful and will be removed. externalDocs: url: https://opensearch.org/docs/latest parameters: @@ -11651,6 +11857,8 @@ paths: responses: '200': $ref: '#/components/responses/get_source___200' + '404': + $ref: '#/components/responses/get_source___404' head: operationId: exists_source.0 x-operation-group: exists_source @@ -11678,6 +11886,8 @@ paths: responses: '200': $ref: '#/components/responses/exists_source___200' + '404': + $ref: '#/components/responses/exists_source___404' /{index}/_split/{target}: post: operationId: indices.split.0 @@ -12006,7 +12216,7 @@ paths: operationId: indices.get_upgrade.1 x-operation-group: indices.get_upgrade x-version-added: '1.0' - description: The _upgrade API is no longer useful and will be removed. + description: The `_upgrade` API is no longer useful and will be removed. externalDocs: url: https://opensearch.org/docs/latest parameters: @@ -12026,7 +12236,7 @@ paths: operationId: indices.upgrade.1 x-operation-group: indices.upgrade x-version-added: '1.0' - description: The _upgrade API is no longer useful and will be removed. + description: The `_upgrade` API is no longer useful and will be removed. externalDocs: url: https://opensearch.org/docs/latest parameters: @@ -12280,7 +12490,7 @@ paths: get: operationId: ism.explain_policy.0_superseded x-operation-group: ism.explain_policy - description: Gets the currently applied policy on indices. + description: Gets the currently applied policy on indexes. externalDocs: url: https://opensearch.org/docs/latest/im-plugin/ism/api/#explain-index requestBody: @@ -12299,7 +12509,7 @@ paths: post: operationId: ism.explain_policy.1_superseded x-operation-group: ism.explain_policy - description: Gets the currently applied policy on indices. + description: Gets the currently applied policy on indexes. externalDocs: url: https://opensearch.org/docs/latest/im-plugin/ism/api/#explain-index requestBody: @@ -12319,7 +12529,7 @@ paths: get: operationId: ism.explain_policy.3_superseded x-operation-group: ism.explain_policy - description: Gets the currently applied policy on indices. + description: Gets the currently applied policy on indexes. externalDocs: url: https://opensearch.org/docs/latest/im-plugin/ism/api/#explain-index parameters: @@ -12339,7 +12549,7 @@ paths: post: operationId: ism.explain_policy.4_superseded x-operation-group: ism.explain_policy - description: Gets the currently applied policy on indices. + description: Gets the currently applied policy on indexes. externalDocs: url: https://opensearch.org/docs/latest/im-plugin/ism/api/#explain-index parameters: @@ -13500,7 +13710,7 @@ paths: x-distributions-excluded: - amazon-managed - amazon-serverless - description: A PATCH call is used to update the existing configuration using the REST API. Only accessible by admins and users with rest api access and only when put or patch is enabled. + description: A `PATCH` call is used to update the existing configuration using the REST API. Only accessible by admins and users with REST API access and only when put or patch is enabled. externalDocs: url: https://opensearch.org/docs/latest/security/access-control/api/#patch-configuration requestBody: @@ -13526,7 +13736,7 @@ paths: x-distributions-excluded: - amazon-managed - amazon-serverless - description: Adds or updates the existing configuration using the REST API. Only accessible by admins and users with rest api access and only when put or patch is enabled. + description: Adds or updates the existing configuration using the REST API. Only accessible by admins and users with REST API access and only when put or patch is enabled. externalDocs: url: https://opensearch.org/docs/latest/security/access-control/api/#update-configuration requestBody: @@ -14022,7 +14232,7 @@ paths: x-distributions-excluded: - amazon-managed - amazon-serverless - description: Generates authorization token for the given user. Legacy API. Not Implemented. + description: Generates authorization token for the given user. Legacy API. Not Implemented. parameters: - $ref: '#/components/parameters/security.generate_user_token_legacy___path.username' - $ref: '#/components/parameters/_global___query.pretty' @@ -14841,10 +15051,10 @@ components: cat.aliases___query.format: name: format in: query - description: A short version of the Accept header, e.g. json, yaml. + description: A short version of the Accept header (for example, `json`, `yaml`). schema: type: string - description: A short version of the Accept header, e.g. json, yaml. + description: A short version of the Accept header (for example, `json`, `yaml`). cat.aliases___query.h: name: h in: query @@ -14900,10 +15110,10 @@ components: cat.all_pit_segments___query.format: name: format in: query - description: A short version of the Accept header, e.g. json, yaml. + description: A short version of the Accept header (for example, `json`, `yaml`). schema: type: string - description: A short version of the Accept header, e.g. json, yaml. + description: A short version of the Accept header (for example, `json`, `yaml`). cat.all_pit_segments___query.h: name: h in: query @@ -14967,10 +15177,10 @@ components: cat.allocation___query.format: name: format in: query - description: A short version of the Accept header, e.g. json, yaml. + description: A short version of the Accept header (for example, `json`, `yaml`). schema: type: string - description: A short version of the Accept header, e.g. json, yaml. + description: A short version of the Accept header (for example, `json`, `yaml`). cat.allocation___query.h: name: h in: query @@ -15001,11 +15211,11 @@ components: cat.allocation___query.master_timeout: name: master_timeout in: query - description: Operation timeout for connection to master node. + description: Operation timeout for connection to cluster-manager node. schema: $ref: '#/components/schemas/_common___Duration' x-version-deprecated: '2.0' - x-deprecation-message: To promote inclusive language, use 'cluster_manager_timeout' instead. + x-deprecation-message: To promote inclusive language, use `cluster_manager_timeout` instead. deprecated: true cat.allocation___query.s: name: s @@ -15036,10 +15246,10 @@ components: cat.cluster_manager___query.format: name: format in: query - description: A short version of the Accept header, e.g. json, yaml. + description: A short version of the Accept header (for example, `json`, `yaml`). schema: type: string - description: A short version of the Accept header, e.g. json, yaml. + description: A short version of the Accept header (for example, `json`, `yaml`). cat.cluster_manager___query.h: name: h in: query @@ -15070,11 +15280,11 @@ components: cat.cluster_manager___query.master_timeout: name: master_timeout in: query - description: Operation timeout for connection to master node. + description: Operation timeout for connection to cluster-manager node. schema: $ref: '#/components/schemas/_common___Duration' x-version-deprecated: '2.0' - x-deprecation-message: To promote inclusive language, use 'cluster_manager_timeout' instead. + x-deprecation-message: To promote inclusive language, use `cluster_manager_timeout` instead. deprecated: true cat.cluster_manager___query.s: name: s @@ -15108,10 +15318,10 @@ components: cat.count___query.format: name: format in: query - description: A short version of the Accept header, e.g. json, yaml. + description: A short version of the Accept header (for example, `json`, `yaml`). schema: type: string - description: A short version of the Accept header, e.g. json, yaml. + description: A short version of the Accept header (for example, `json`, `yaml`). cat.count___query.h: name: h in: query @@ -15177,10 +15387,10 @@ components: cat.fielddata___query.format: name: format in: query - description: A short version of the Accept header, e.g. json, yaml. + description: A short version of the Accept header (for example, `json`, `yaml`). schema: type: string - description: A short version of the Accept header, e.g. json, yaml. + description: A short version of the Accept header (for example, `json`, `yaml`). cat.fielddata___query.h: name: h in: query @@ -15222,10 +15432,10 @@ components: cat.health___query.format: name: format in: query - description: A short version of the Accept header, e.g. json, yaml. + description: A short version of the Accept header (for example, `json`, `yaml`). schema: type: string - description: A short version of the Accept header, e.g. json, yaml. + description: A short version of the Accept header (for example, `json`, `yaml`). cat.health___query.h: name: h in: query @@ -15266,7 +15476,7 @@ components: cat.health___query.ts: in: query name: ts - description: If true, returns `HH:MM:SS` and Unix epoch timestamps. + description: If `true`, returns `HH:MM:SS` and Unix epoch timestamps. schema: type: boolean default: true @@ -15313,10 +15523,10 @@ components: cat.indices___query.format: name: format in: query - description: A short version of the Accept header, e.g. json, yaml. + description: A short version of the Accept header (for example, `json`, `yaml`). schema: type: string - description: A short version of the Accept header, e.g. json, yaml. + description: A short version of the Accept header (for example, `json`, `yaml`). cat.indices___query.h: name: h in: query @@ -15346,7 +15556,7 @@ components: cat.indices___query.include_unloaded_segments: in: query name: include_unloaded_segments - description: If true, the response includes information from segments that are not loaded into memory. + description: If `true`, the response includes information from segments that are not loaded into memory. schema: type: boolean default: false @@ -15362,16 +15572,16 @@ components: cat.indices___query.master_timeout: name: master_timeout in: query - description: Operation timeout for connection to master node. + description: Operation timeout for connection to cluster-manager node. schema: $ref: '#/components/schemas/_common___Duration' x-version-deprecated: '2.0' - x-deprecation-message: To promote inclusive language, use 'cluster_manager_timeout' instead. + x-deprecation-message: To promote inclusive language, use `cluster_manager_timeout` instead. deprecated: true cat.indices___query.pri: in: query name: pri - description: If true, the response only includes information from primary shards. + description: If `true`, the response only includes information from primary shards. schema: type: boolean default: false @@ -15412,10 +15622,10 @@ components: cat.master___query.format: name: format in: query - description: A short version of the Accept header, e.g. json, yaml. + description: A short version of the Accept header (for example, `json`, `yaml`). schema: type: string - description: A short version of the Accept header, e.g. json, yaml. + description: A short version of the Accept header (for example, `json`, `yaml`). cat.master___query.h: name: h in: query @@ -15446,11 +15656,11 @@ components: cat.master___query.master_timeout: name: master_timeout in: query - description: Operation timeout for connection to master node. + description: Operation timeout for connection to cluster-manager node. schema: $ref: '#/components/schemas/_common___Duration' x-version-deprecated: '2.0' - x-deprecation-message: To promote inclusive language, use 'cluster_manager_timeout' instead. + x-deprecation-message: To promote inclusive language, use `cluster_manager_timeout` instead. deprecated: true cat.master___query.s: name: s @@ -15481,10 +15691,10 @@ components: cat.nodeattrs___query.format: name: format in: query - description: A short version of the Accept header, e.g. json, yaml. + description: A short version of the Accept header (for example, `json`, `yaml`). schema: type: string - description: A short version of the Accept header, e.g. json, yaml. + description: A short version of the Accept header (for example, `json`, `yaml`). cat.nodeattrs___query.h: name: h in: query @@ -15515,11 +15725,11 @@ components: cat.nodeattrs___query.master_timeout: name: master_timeout in: query - description: Operation timeout for connection to master node. + description: Operation timeout for connection to cluster-manager node. schema: $ref: '#/components/schemas/_common___Duration' x-version-deprecated: '2.0' - x-deprecation-message: To promote inclusive language, use 'cluster_manager_timeout' instead. + x-deprecation-message: To promote inclusive language, use `cluster_manager_timeout` instead. deprecated: true cat.nodeattrs___query.s: name: s @@ -15557,10 +15767,10 @@ components: cat.nodes___query.format: name: format in: query - description: A short version of the Accept header, e.g. json, yaml. + description: A short version of the Accept header (for example, `json`, `yaml`). schema: type: string - description: A short version of the Accept header, e.g. json, yaml. + description: A short version of the Accept header (for example, `json`, `yaml`). cat.nodes___query.full_id: in: query name: full_id @@ -15604,11 +15814,11 @@ components: cat.nodes___query.master_timeout: name: master_timeout in: query - description: Operation timeout for connection to master node. + description: Operation timeout for connection to cluster-manager node. schema: $ref: '#/components/schemas/_common___Duration' x-version-deprecated: '2.0' - x-deprecation-message: To promote inclusive language, use 'cluster_manager_timeout' instead. + x-deprecation-message: To promote inclusive language, use `cluster_manager_timeout` instead. deprecated: true cat.nodes___query.s: name: s @@ -15645,10 +15855,10 @@ components: cat.pending_tasks___query.format: name: format in: query - description: A short version of the Accept header, e.g. json, yaml. + description: A short version of the Accept header (for example, `json`, `yaml`). schema: type: string - description: A short version of the Accept header, e.g. json, yaml. + description: A short version of the Accept header (for example, `json`, `yaml`). cat.pending_tasks___query.h: name: h in: query @@ -15679,11 +15889,11 @@ components: cat.pending_tasks___query.master_timeout: name: master_timeout in: query - description: Operation timeout for connection to master node. + description: Operation timeout for connection to cluster-manager node. schema: $ref: '#/components/schemas/_common___Duration' x-version-deprecated: '2.0' - x-deprecation-message: To promote inclusive language, use 'cluster_manager_timeout' instead. + x-deprecation-message: To promote inclusive language, use `cluster_manager_timeout` instead. deprecated: true cat.pending_tasks___query.s: name: s @@ -15719,10 +15929,10 @@ components: cat.pit_segments___query.format: name: format in: query - description: A short version of the Accept header, e.g. json, yaml. + description: A short version of the Accept header (for example, `json`, `yaml`). schema: type: string - description: A short version of the Accept header, e.g. json, yaml. + description: A short version of the Accept header (for example, `json`, `yaml`). cat.pit_segments___query.h: name: h in: query @@ -15771,10 +15981,10 @@ components: cat.plugins___query.format: name: format in: query - description: A short version of the Accept header, e.g. json, yaml. + description: A short version of the Accept header (for example, `json`, `yaml`). schema: type: string - description: A short version of the Accept header, e.g. json, yaml. + description: A short version of the Accept header (for example, `json`, `yaml`). cat.plugins___query.h: name: h in: query @@ -15805,11 +16015,11 @@ components: cat.plugins___query.master_timeout: name: master_timeout in: query - description: Operation timeout for connection to master node. + description: Operation timeout for connection to cluster-manager node. schema: $ref: '#/components/schemas/_common___Duration' x-version-deprecated: '2.0' - x-deprecation-message: To promote inclusive language, use 'cluster_manager_timeout' instead. + x-deprecation-message: To promote inclusive language, use `cluster_manager_timeout` instead. deprecated: true cat.plugins___query.s: name: s @@ -15866,10 +16076,10 @@ components: cat.recovery___query.format: name: format in: query - description: A short version of the Accept header, e.g. json, yaml. + description: A short version of the Accept header (for example, `json`, `yaml`). schema: type: string - description: A short version of the Accept header, e.g. json, yaml. + description: A short version of the Accept header (for example, `json`, `yaml`). cat.recovery___query.h: name: h in: query @@ -15935,10 +16145,10 @@ components: cat.repositories___query.format: name: format in: query - description: A short version of the Accept header, e.g. json, yaml. + description: A short version of the Accept header (for example, `json`, `yaml`). schema: type: string - description: A short version of the Accept header, e.g. json, yaml. + description: A short version of the Accept header (for example, `json`, `yaml`). cat.repositories___query.h: name: h in: query @@ -15969,11 +16179,11 @@ components: cat.repositories___query.master_timeout: name: master_timeout in: query - description: Operation timeout for connection to master node. + description: Operation timeout for connection to cluster-manager node. schema: $ref: '#/components/schemas/_common___Duration' x-version-deprecated: '2.0' - x-deprecation-message: To promote inclusive language, use 'cluster_manager_timeout' instead. + x-deprecation-message: To promote inclusive language, use `cluster_manager_timeout` instead. deprecated: true cat.repositories___query.s: name: s @@ -16050,10 +16260,10 @@ components: cat.segment_replication___query.format: name: format in: query - description: A short version of the Accept header, e.g. json, yaml. + description: A short version of the Accept header (for example, `json`, `yaml`). schema: type: string - description: A short version of the Accept header, e.g. json, yaml. + description: A short version of the Accept header (for example, `json`, `yaml`). cat.segment_replication___query.h: name: h in: query @@ -16168,10 +16378,10 @@ components: cat.segments___query.format: name: format in: query - description: A short version of the Accept header, e.g. json, yaml. + description: A short version of the Accept header (for example, `json`, `yaml`). schema: type: string - description: A short version of the Accept header, e.g. json, yaml. + description: A short version of the Accept header (for example, `json`, `yaml`). cat.segments___query.h: name: h in: query @@ -16194,11 +16404,11 @@ components: cat.segments___query.master_timeout: name: master_timeout in: query - description: Operation timeout for connection to master node. + description: Operation timeout for connection to cluster-manager node. schema: $ref: '#/components/schemas/_common___Duration' x-version-deprecated: '2.0' - x-deprecation-message: To promote inclusive language, use 'cluster_manager_timeout' instead. + x-deprecation-message: To promote inclusive language, use `cluster_manager_timeout` instead. deprecated: true cat.segments___query.s: name: s @@ -16247,10 +16457,10 @@ components: cat.shards___query.format: name: format in: query - description: A short version of the Accept header, e.g. json, yaml. + description: A short version of the Accept header (for example, `json`, `yaml`). schema: type: string - description: A short version of the Accept header, e.g. json, yaml. + description: A short version of the Accept header (for example, `json`, `yaml`). cat.shards___query.h: name: h in: query @@ -16281,11 +16491,11 @@ components: cat.shards___query.master_timeout: name: master_timeout in: query - description: Operation timeout for connection to master node. + description: Operation timeout for connection to cluster-manager node. schema: $ref: '#/components/schemas/_common___Duration' x-version-deprecated: '2.0' - x-deprecation-message: To promote inclusive language, use 'cluster_manager_timeout' instead. + x-deprecation-message: To promote inclusive language, use `cluster_manager_timeout` instead. deprecated: true cat.shards___query.s: name: s @@ -16334,10 +16544,10 @@ components: cat.snapshots___query.format: name: format in: query - description: A short version of the Accept header, e.g. json, yaml. + description: A short version of the Accept header (for example, `json`, `yaml`). schema: type: string - description: A short version of the Accept header, e.g. json, yaml. + description: A short version of the Accept header (for example, `json`, `yaml`). cat.snapshots___query.h: name: h in: query @@ -16368,11 +16578,11 @@ components: cat.snapshots___query.master_timeout: name: master_timeout in: query - description: Operation timeout for connection to master node. + description: Operation timeout for connection to cluster-manager node. schema: $ref: '#/components/schemas/_common___Duration' x-version-deprecated: '2.0' - x-deprecation-message: To promote inclusive language, use 'cluster_manager_timeout' instead. + x-deprecation-message: To promote inclusive language, use `cluster_manager_timeout` instead. deprecated: true cat.snapshots___query.s: name: s @@ -16419,10 +16629,10 @@ components: cat.tasks___query.format: name: format in: query - description: A short version of the Accept header, e.g. json, yaml. + description: A short version of the Accept header (for example, `json`, `yaml`). schema: type: string - description: A short version of the Accept header, e.g. json, yaml. + description: A short version of the Accept header (for example, `json`, `yaml`). cat.tasks___query.h: name: h in: query @@ -16505,10 +16715,10 @@ components: cat.templates___query.format: name: format in: query - description: A short version of the Accept header, e.g. json, yaml. + description: A short version of the Accept header (for example, `json`, `yaml`). schema: type: string - description: A short version of the Accept header, e.g. json, yaml. + description: A short version of the Accept header (for example, `json`, `yaml`). cat.templates___query.h: name: h in: query @@ -16539,11 +16749,11 @@ components: cat.templates___query.master_timeout: name: master_timeout in: query - description: Operation timeout for connection to master node. + description: Operation timeout for connection to cluster-manager node. schema: $ref: '#/components/schemas/_common___Duration' x-version-deprecated: '2.0' - x-deprecation-message: To promote inclusive language, use 'cluster_manager_timeout' instead. + x-deprecation-message: To promote inclusive language, use `cluster_manager_timeout` instead. deprecated: true cat.templates___query.s: name: s @@ -16584,10 +16794,10 @@ components: cat.thread_pool___query.format: name: format in: query - description: A short version of the Accept header, e.g. json, yaml. + description: A short version of the Accept header (for example, `json`, `yaml`). schema: type: string - description: A short version of the Accept header, e.g. json, yaml. + description: A short version of the Accept header (for example, `json`, `yaml`). cat.thread_pool___query.h: name: h in: query @@ -16618,11 +16828,11 @@ components: cat.thread_pool___query.master_timeout: name: master_timeout in: query - description: Operation timeout for connection to master node. + description: Operation timeout for connection to cluster-manager node. schema: $ref: '#/components/schemas/_common___Duration' x-version-deprecated: '2.0' - x-deprecation-message: To promote inclusive language, use 'cluster_manager_timeout' instead. + x-deprecation-message: To promote inclusive language, use `cluster_manager_timeout` instead. deprecated: true cat.thread_pool___query.s: name: s @@ -16665,7 +16875,7 @@ components: cluster.allocation_explain___query.include_disk_info: in: query name: include_disk_info - description: If true, returns information about disk usage and shard sizes. + description: If `true`, returns information about disk usage and shard sizes. schema: type: boolean default: false @@ -16673,7 +16883,7 @@ components: cluster.allocation_explain___query.include_yes_decisions: in: query name: include_yes_decisions - description: If true, returns YES decisions in explanation. + description: If `true`, returns YES decisions in explanation. schema: type: boolean default: false @@ -16699,14 +16909,14 @@ components: in: query name: master_timeout description: |- - Period to wait for a connection to the master node. + Period to wait for a connection to the cluster-manager node. If no response is received before the timeout expires, the request fails and returns an error. deprecated: true schema: $ref: '#/components/schemas/_common___Duration' style: form x-version-deprecated: '2.0' - x-deprecation-message: To promote inclusive language, use 'cluster_manager_timeout' instead. + x-deprecation-message: To promote inclusive language, use `cluster_manager_timeout` instead. cluster.delete_component_template___query.timeout: in: query name: timeout @@ -16723,7 +16933,7 @@ components: Specifies whether to wait for all excluded nodes to be removed from the cluster before clearing the voting configuration exclusions list. Defaults to true, meaning that all excluded nodes must be removed from - the cluster before this API takes any action. If set to false then the + the cluster before this API takes any action. If set to `false` then the voting configuration exclusions list is cleared even if some excluded nodes are still in the cluster. schema: @@ -16751,8 +16961,8 @@ components: in: query name: local description: |- - If true, the request retrieves information from the local node only. - Defaults to false, which means information is retrieved from the master node. + If `true`, the request retrieves information from the local node only. + Defaults to false, which means information is retrieved from the cluster-manager node. schema: type: boolean default: false @@ -16761,7 +16971,7 @@ components: in: query name: master_timeout description: |- - Period to wait for a connection to the master node. If no response is + Period to wait for a connection to the cluster-manager node. If no response is received before the timeout expires, the request fails and returns an error. deprecated: true @@ -16769,7 +16979,7 @@ components: $ref: '#/components/schemas/_common___Duration' style: form x-version-deprecated: '2.0' - x-deprecation-message: To promote inclusive language, use 'cluster_manager_timeout' instead. + x-deprecation-message: To promote inclusive language, use `cluster_manager_timeout` instead. cluster.get_component_template___path.name: in: path name: name @@ -16792,7 +17002,7 @@ components: name: local description: |- If `true`, the request retrieves information from the local node only. - If `false`, information is retrieved from the master node. + If `false`, information is retrieved from the cluster-manager node. schema: type: boolean default: false @@ -16801,14 +17011,14 @@ components: in: query name: master_timeout description: |- - Period to wait for a connection to the master node. + Period to wait for a connection to the cluster-manager node. If no response is received before the timeout expires, the request fails and returns an error. deprecated: true schema: $ref: '#/components/schemas/_common___Duration' style: form x-version-deprecated: '2.0' - x-deprecation-message: To promote inclusive language, use 'cluster_manager_timeout' instead. + x-deprecation-message: To promote inclusive language, use `cluster_manager_timeout` instead. cluster.get_decommission_awareness___path.awareness_attribute_name: name: awareness_attribute_name in: path @@ -16844,14 +17054,14 @@ components: in: query name: master_timeout description: |- - Period to wait for a connection to the master node. + Period to wait for a connection to the cluster-manager node. If no response is received before the timeout expires, the request fails and returns an error. deprecated: true schema: $ref: '#/components/schemas/_common___Duration' style: form x-version-deprecated: '2.0' - x-deprecation-message: To promote inclusive language, use 'cluster_manager_timeout' instead. + x-deprecation-message: To promote inclusive language, use `cluster_manager_timeout` instead. cluster.get_settings___query.timeout: in: query name: timeout @@ -16908,7 +17118,7 @@ components: cluster.health___query.local: in: query name: local - description: If true, the request retrieves information from the local node only. Defaults to false, which means information is retrieved from the master node. + description: If `true`, the request retrieves information from the local node only. Defaults to false, which means information is retrieved from the cluster-manager node. schema: type: boolean default: false @@ -16916,13 +17126,13 @@ components: cluster.health___query.master_timeout: in: query name: master_timeout - description: Period to wait for a connection to the master node. If no response is received before the timeout expires, the request fails and returns an error. + description: Period to wait for a connection to the cluster-manager node. If no response is received before the timeout expires, the request fails and returns an error. deprecated: true schema: $ref: '#/components/schemas/_common___Duration' style: form x-version-deprecated: '2.0' - x-deprecation-message: To promote inclusive language, use 'cluster_manager_timeout' instead. + x-deprecation-message: To promote inclusive language, use `cluster_manager_timeout` instead. cluster.health___query.timeout: in: query name: timeout @@ -16947,14 +17157,14 @@ components: cluster.health___query.wait_for_no_initializing_shards: in: query name: wait_for_no_initializing_shards - description: A boolean value which controls whether to wait (until the timeout provided) for the cluster to have no shard initializations. Defaults to false, which means it will not wait for initializing shards. + description: A Boolean value which controls whether to wait (until the timeout provided) for the cluster to have no shard initializations. Defaults to false, which means it will not wait for initializing shards. schema: type: boolean style: form cluster.health___query.wait_for_no_relocating_shards: in: query name: wait_for_no_relocating_shards - description: A boolean value which controls whether to wait (until the timeout provided) for the cluster to have no shard relocations. Defaults to false, which means it will not wait for relocating shards. + description: A Boolean value which controls whether to wait (until the timeout provided) for the cluster to have no shard relocations. Defaults to false, which means it will not wait for relocating shards. schema: type: boolean style: form @@ -16986,7 +17196,7 @@ components: name: local description: |- If `true`, the request retrieves information from the local node only. - If `false`, information is retrieved from the master node. + If `false`, information is retrieved from the cluster-manager node. schema: type: boolean default: false @@ -16995,20 +17205,20 @@ components: in: query name: master_timeout description: |- - Period to wait for a connection to the master node. + Period to wait for a connection to the cluster-manager node. If no response is received before the timeout expires, the request fails and returns an error. deprecated: true schema: $ref: '#/components/schemas/_common___Duration' style: form x-version-deprecated: '2.0' - x-deprecation-message: To promote inclusive language, use 'cluster_manager_timeout' instead. + x-deprecation-message: To promote inclusive language, use `cluster_manager_timeout` instead. cluster.post_voting_config_exclusions___query.node_ids: in: query name: node_ids description: |- A comma-separated list of the persistent ids of the nodes to exclude - from the voting configuration. If specified, you may not also specify node_names. + from the voting configuration. If specified, you may not also specify `node_names`. schema: $ref: '#/components/schemas/_common___Ids' style: form @@ -17017,7 +17227,7 @@ components: name: node_names description: |- A comma-separated list of the names of the nodes to exclude from the - voting configuration. If specified, you may not also specify node_ids. + voting configuration. If specified, you may not also specify `node_ids`. schema: $ref: '#/components/schemas/_common___Names' style: form @@ -17064,14 +17274,14 @@ components: in: query name: master_timeout description: |- - Period to wait for a connection to the master node. + Period to wait for a connection to the cluster-manager node. If no response is received before the timeout expires, the request fails and returns an error. deprecated: true schema: $ref: '#/components/schemas/_common___Duration' style: form x-version-deprecated: '2.0' - x-deprecation-message: To promote inclusive language, use 'cluster_manager_timeout' instead. + x-deprecation-message: To promote inclusive language, use `cluster_manager_timeout` instead. cluster.put_component_template___query.timeout: name: timeout in: query @@ -17112,13 +17322,13 @@ components: cluster.put_settings___query.master_timeout: in: query name: master_timeout - description: Explicit operation timeout for connection to master node + description: Explicit operation timeout for connection to cluster-manager node deprecated: true schema: $ref: '#/components/schemas/_common___Duration' style: form x-version-deprecated: '2.0' - x-deprecation-message: To promote inclusive language, use 'cluster_manager_timeout' instead. + x-deprecation-message: To promote inclusive language, use `cluster_manager_timeout` instead. cluster.put_settings___query.timeout: in: query name: timeout @@ -17144,27 +17354,27 @@ components: cluster.reroute___query.dry_run: in: query name: dry_run - description: If true, then the request simulates the operation only and returns the resulting state. + description: If `true`, then the request simulates the operation only and returns the resulting state. schema: type: boolean style: form cluster.reroute___query.explain: in: query name: explain - description: If true, then the response contains an explanation of why the commands can or cannot be executed. + description: If `true`, then the response contains an explanation of why the commands can or cannot be executed. schema: type: boolean style: form cluster.reroute___query.master_timeout: in: query name: master_timeout - description: Period to wait for a connection to the master node. If no response is received before the timeout expires, the request fails and returns an error. + description: Period to wait for a connection to the cluster-manager node. If no response is received before the timeout expires, the request fails and returns an error. deprecated: true schema: $ref: '#/components/schemas/_common___Duration' style: form x-version-deprecated: '2.0' - x-deprecation-message: To promote inclusive language, use 'cluster_manager_timeout' instead. + x-deprecation-message: To promote inclusive language, use `cluster_manager_timeout` instead. cluster.reroute___query.metric: in: query name: metric @@ -17179,7 +17389,7 @@ components: cluster.reroute___query.retry_failed: in: query name: retry_failed - description: If true, then retries allocation of shards that are blocked due to too many subsequent allocation failures. + description: If `true`, then retries allocation of shards that are blocked due to too many subsequent allocation failures. schema: type: boolean style: form @@ -17255,24 +17465,24 @@ components: cluster.state___query.master_timeout: in: query name: master_timeout - description: Specify timeout for connection to master + description: Specify timeout for connection to cluster manager. deprecated: true schema: $ref: '#/components/schemas/_common___Duration' style: form x-version-deprecated: '2.0' - x-deprecation-message: To promote inclusive language, use 'cluster_manager_timeout' instead. + x-deprecation-message: To promote inclusive language, use `cluster_manager_timeout` instead. cluster.state___query.wait_for_metadata_version: in: query name: wait_for_metadata_version - description: Wait for the metadata version to be equal or greater than the specified metadata version + description: Wait for the metadata version to be equal or greater than the specified metadata version. schema: $ref: '#/components/schemas/_common___VersionNumber' style: form cluster.state___query.wait_for_timeout: in: query name: wait_for_timeout - description: The maximum time to wait for wait_for_metadata_version before timing out + description: The maximum time to wait for `wait_for_metadata_version` before timing out. schema: $ref: '#/components/schemas/_common___Duration' style: form @@ -17289,7 +17499,7 @@ components: cluster.stats___path.metric: in: path name: metric - description: Limit the information returned to the specified metrics + description: Limit the information returned to the specified metrics. required: true schema: type: array @@ -17579,7 +17789,7 @@ components: dangling_indices.delete_dangling_index___path.index_uuid: in: path name: index_uuid - description: The UUID of the dangling index + description: The UUID of the dangling index. required: true schema: $ref: '#/components/schemas/_common___Uuid' @@ -17587,7 +17797,7 @@ components: dangling_indices.delete_dangling_index___query.accept_data_loss: in: query name: accept_data_loss - description: Must be set to true in order to delete the dangling index + description: Must be set to true in order to delete the dangling index. required: true schema: type: boolean @@ -17602,24 +17812,24 @@ components: dangling_indices.delete_dangling_index___query.master_timeout: in: query name: master_timeout - description: Specify timeout for connection to master + description: Specify timeout for connection to cluster manager. deprecated: true schema: $ref: '#/components/schemas/_common___Duration' style: form x-version-deprecated: '2.0' - x-deprecation-message: To promote inclusive language, use 'cluster_manager_timeout' instead. + x-deprecation-message: To promote inclusive language, use `cluster_manager_timeout` instead. dangling_indices.delete_dangling_index___query.timeout: in: query name: timeout - description: Explicit operation timeout + description: Explicit operation timeout. schema: $ref: '#/components/schemas/_common___Duration' style: form dangling_indices.import_dangling_index___path.index_uuid: in: path name: index_uuid - description: The UUID of the dangling index + description: The UUID of the dangling index. required: true schema: $ref: '#/components/schemas/_common___Uuid' @@ -17627,7 +17837,7 @@ components: dangling_indices.import_dangling_index___query.accept_data_loss: in: query name: accept_data_loss - description: Must be set to true in order to import the dangling index + description: Must be set to true in order to import the dangling index. required: true schema: type: boolean @@ -17642,17 +17852,17 @@ components: dangling_indices.import_dangling_index___query.master_timeout: in: query name: master_timeout - description: Specify timeout for connection to master + description: Specify timeout for connection to cluster manager. deprecated: true schema: $ref: '#/components/schemas/_common___Duration' style: form x-version-deprecated: '2.0' - x-deprecation-message: To promote inclusive language, use 'cluster_manager_timeout' instead. + x-deprecation-message: To promote inclusive language, use `cluster_manager_timeout` instead. dangling_indices.import_dangling_index___query.timeout: in: query name: timeout - description: Explicit operation timeout + description: Explicit operation timeout. schema: $ref: '#/components/schemas/_common___Duration' style: form @@ -17686,35 +17896,35 @@ components: delete_by_query___query._source: name: _source in: query - description: True or false to return the _source field or not, or a list of fields to return. + description: Set to `true` or `false` to return the `_source` field or not, or a list of fields to return. style: form schema: type: array items: type: string - description: True or false to return the _source field or not, or a list of fields to return. + description: Set to `true` or `false` to return the `_source` field or not, or a list of fields to return. explode: true delete_by_query___query._source_excludes: name: _source_excludes in: query - description: List of fields to exclude from the returned _source field. + description: List of fields to exclude from the returned `_source` field. style: form schema: type: array items: type: string - description: List of fields to exclude from the returned _source field. + description: List of fields to exclude from the returned `_source` field. explode: true delete_by_query___query._source_includes: name: _source_includes in: query - description: List of fields to extract and return from the _source field. + description: List of fields to extract and return from the `_source` field. style: form schema: type: array items: type: string - description: List of fields to extract and return from the _source field. + description: List of fields to extract and return from the `_source` field. explode: true delete_by_query___query.allow_no_indices: in: query @@ -17827,7 +18037,7 @@ components: name: refresh description: If `true`, OpenSearch refreshes all shards involved in the delete by query after the request completes. schema: - type: boolean + $ref: '#/components/schemas/_common___Refresh' style: form delete_by_query___query.request_cache: in: query @@ -17891,10 +18101,10 @@ components: delete_by_query___query.size: name: size in: query - description: Deprecated, please use `max_docs` instead. + description: Deprecated, use `max_docs` instead. schema: type: integer - description: Deprecated, please use `max_docs` instead. + description: Deprecated, use `max_docs` instead. format: int32 delete_by_query___query.slices: in: query @@ -17989,14 +18199,14 @@ components: in: query name: master_timeout description: |- - Period to wait for a connection to the master node. + Period to wait for a connection to the cluster-manager node. If no response is received before the timeout expires, the request fails and returns an error. deprecated: true schema: $ref: '#/components/schemas/_common___Duration' style: form x-version-deprecated: '2.0' - x-deprecation-message: To promote inclusive language, use 'cluster_manager_timeout' instead. + x-deprecation-message: To promote inclusive language, use `cluster_manager_timeout` instead. delete_script___query.timeout: in: query name: timeout @@ -18138,7 +18348,7 @@ components: exists_source___query.realtime: in: query name: realtime - description: If true, the request is real-time as opposed to near-real-time. + description: If `true`, the request is real-time as opposed to near-real-time. schema: type: boolean style: form @@ -18147,7 +18357,7 @@ components: name: refresh description: If `true`, OpenSearch refreshes all shards involved in the delete by query after the request completes. schema: - type: boolean + $ref: '#/components/schemas/_common___Refresh' style: form exists_source___query.routing: in: query @@ -18233,7 +18443,7 @@ components: name: refresh description: If `true`, OpenSearch refreshes all shards involved in the delete by query after the request completes. schema: - type: boolean + $ref: '#/components/schemas/_common___Refresh' style: form exists___query.routing: in: query @@ -18289,7 +18499,7 @@ components: explain___query._source: in: query name: _source - description: True or false to return the `_source` field or not, or a list of fields to return. + description: Set to `true` or `false` to return the `_source` field or not, or a list of fields to return. schema: $ref: '#/components/schemas/_core.search___SourceConfigParam' style: form @@ -18380,7 +18590,7 @@ components: field_caps___path.index: in: path name: index - description: Comma-separated list of data streams, indexes, and aliases used to limit the request. Supports wildcards (*). To target all data streams and indexes, omit this parameter or use * or _all. + description: Comma-separated list of data streams, indexes, and aliases used to limit the request. Supports wildcards (*). To target all data streams and indexes, omit this parameter or use * or `_all`. required: true schema: $ref: '#/components/schemas/_common___Indices' @@ -18389,7 +18599,7 @@ components: in: query name: allow_no_indices description: |- - If false, the request returns an error if any wildcard expression, index alias, + If `false`, the request returns an error if any wildcard expression, index alias, or `_all` value targets only missing or closed indexes. This behavior applies even if the request targets other open indexes. For example, a request targeting `foo*,bar*` returns an error if an index starts with foo but no index starts with bar. schema: @@ -18419,7 +18629,7 @@ components: field_caps___query.include_unmapped: in: query name: include_unmapped - description: If true, unmapped fields are included in the response. + description: If `true`, unmapped fields are included in the response. schema: type: boolean default: false @@ -18441,7 +18651,7 @@ components: schema: $ref: '#/components/schemas/flow_framework.common___UpdateFields' flow_framework.create___query.use_case: - description: To use a workflow template, specify it in the use_case query parameter when creating a workflow. + description: To use a workflow template, specify it in the `use_case` query parameter when creating a workflow. in: query name: use_case schema: @@ -18492,6 +18702,7 @@ components: name: workflow_step required: false schema: + description: The name of the step to retrieve. $ref: '#/components/schemas/flow_framework.common___WorkflowStepName' flow_framework.get___path.workflow_id: name: workflow_id @@ -18528,7 +18739,7 @@ components: schema: $ref: '#/components/schemas/flow_framework.common___UpdateFields' flow_framework.update___query.use_case: - description: To use a workflow template, specify it in the use_case query parameter when creating a workflow. + description: To use a workflow template, specify it in the `use_case` query parameter when creating a workflow. in: query name: use_case schema: @@ -18562,7 +18773,7 @@ components: $ref: '#/components/schemas/_common___Duration' style: form x-version-deprecated: '2.0' - x-deprecation-message: To promote inclusive language, use 'cluster_manager_timeout' instead. + x-deprecation-message: To promote inclusive language, use `cluster_manager_timeout` instead. get_source___path.id: in: path name: id @@ -18582,7 +18793,7 @@ components: get_source___query._source: in: query name: _source - description: True or false to return the _source field or not, or a list of fields to return. + description: Set to `true` or `false` to return the `_source` field or not, or a list of fields to return. schema: $ref: '#/components/schemas/_core.search___SourceConfigParam' style: form @@ -18611,16 +18822,16 @@ components: get_source___query.realtime: in: query name: realtime - description: Boolean) If true, the request is real-time as opposed to near-real-time. + description: Boolean) If `true`, the request is real-time as opposed to near-real-time. schema: type: boolean style: form get_source___query.refresh: in: query name: refresh - description: If true, OpenSearch refreshes the affected shards to make this operation visible to search. If false, do nothing with refreshes. + description: If `true`, OpenSearch refreshes the affected shards to make this operation visible to search. If `false`, do nothing with refreshes. schema: - type: boolean + $ref: '#/components/schemas/_common___Refresh' style: form get_source___query.routing: in: query @@ -18639,7 +18850,7 @@ components: get_source___query.version_type: in: query name: version_type - description: 'Specific version type: internal, external, external_gte.' + description: Specific version type. One of `internal`, `external`, `external_gte`. schema: $ref: '#/components/schemas/_common___VersionType' style: form @@ -18662,7 +18873,7 @@ components: get___query._source: in: query name: _source - description: True or false to return the _source field or not, or a list of fields to return. + description: Set to `true` or `false` to return the `_source` field or not, or a list of fields to return. schema: $ref: '#/components/schemas/_core.search___SourceConfigParam' style: form @@ -18698,9 +18909,9 @@ components: get___query.refresh: in: query name: refresh - description: If true, OpenSearch refreshes the affected shards to make this operation visible to search. If false, do nothing with refreshes. + description: If `true`, OpenSearch refreshes the affected shards to make this operation visible to search. If `false`, do nothing with refreshes. schema: - type: boolean + $ref: '#/components/schemas/_common___Refresh' style: form get___query.routing: in: query @@ -18729,7 +18940,7 @@ components: get___query.version_type: in: query name: version_type - description: 'Specific version type: internal, external, external_gte.' + description: 'Specific version type: `internal`, `external`, `external_gte`.' schema: $ref: '#/components/schemas/_common___VersionType' style: form @@ -18847,7 +19058,7 @@ components: indices.add_block___path.block: in: path name: block - description: The block to add (one of read, write, read_only or metadata) + description: The block to add (one of `read`, `write`, `read_only` or `metadata`). required: true schema: $ref: '#/components/schemas/indices.add_block___IndicesBlockOptions' @@ -18855,7 +19066,7 @@ components: indices.add_block___path.index: in: path name: index - description: A comma separated list of indexes to add a block to + description: A comma separated list of indexes to add a block to. required: true schema: $ref: '#/components/schemas/_common___Indices' @@ -18863,7 +19074,7 @@ components: indices.add_block___query.allow_no_indices: in: query name: allow_no_indices - description: Whether to ignore if a wildcard indexes expression resolves into no concrete indexes. (This includes `_all` string or when no indexes have been specified) + description: Whether to ignore if a wildcard indexes expression resolves into no concrete indexes. (This includes `_all` string or when no indexes have been specified). schema: type: boolean style: form @@ -18884,20 +19095,20 @@ components: indices.add_block___query.ignore_unavailable: in: query name: ignore_unavailable - description: Whether specified concrete indexes should be ignored when unavailable (missing or closed) + description: Whether specified concrete indexes should be ignored when unavailable (missing or closed). schema: type: boolean style: form indices.add_block___query.master_timeout: in: query name: master_timeout - description: Specify timeout for connection to master + description: Specify timeout for connection to cluster manager. deprecated: true schema: $ref: '#/components/schemas/_common___Duration' style: form x-version-deprecated: '2.0' - x-deprecation-message: To promote inclusive language, use 'cluster_manager_timeout' instead. + x-deprecation-message: To promote inclusive language, use `cluster_manager_timeout` instead. indices.add_block___query.timeout: in: query name: timeout @@ -18974,7 +19185,7 @@ components: x-version-added: '2.8' in: query name: file - description: If true, clears the unused entries from the file cache on nodes with the Search role. + description: If `true`, clears the unused entries from the file cache on nodes with the Search role. schema: type: boolean default: false @@ -19038,18 +19249,18 @@ components: in: query name: master_timeout description: |- - Period to wait for a connection to the master node. + Period to wait for a connection to the cluster-manager node. If no response is received before the timeout expires, the request fails and returns an error. deprecated: true schema: $ref: '#/components/schemas/_common___Duration' style: form x-version-deprecated: '2.0' - x-deprecation-message: To promote inclusive language, use 'cluster_manager_timeout' instead. + x-deprecation-message: To promote inclusive language, use `cluster_manager_timeout` instead. indices.clone___query.task_execution_timeout: name: task_execution_timeout in: query - description: Explicit task execution timeout, only useful when wait_for_completion is false, defaults to 1h. + description: Explicit task execution timeout, only useful when `wait_for_completion` is false, defaults to `1h`. schema: $ref: '#/components/schemas/_common___Duration' indices.clone___query.timeout: @@ -19125,14 +19336,14 @@ components: in: query name: master_timeout description: |- - Period to wait for a connection to the master node. + Period to wait for a connection to the cluster-manager node. If no response is received before the timeout expires, the request fails and returns an error. deprecated: true schema: $ref: '#/components/schemas/_common___Duration' style: form x-version-deprecated: '2.0' - x-deprecation-message: To promote inclusive language, use 'cluster_manager_timeout' instead. + x-deprecation-message: To promote inclusive language, use `cluster_manager_timeout` instead. indices.close___query.timeout: in: query name: timeout @@ -19184,14 +19395,14 @@ components: in: query name: master_timeout description: |- - Period to wait for a connection to the master node. + Period to wait for a connection to the cluster-manager node. If no response is received before the timeout expires, the request fails and returns an error. deprecated: true schema: $ref: '#/components/schemas/_common___Duration' style: form x-version-deprecated: '2.0' - x-deprecation-message: To promote inclusive language, use 'cluster_manager_timeout' instead. + x-deprecation-message: To promote inclusive language, use `cluster_manager_timeout` instead. indices.create___query.timeout: in: query name: timeout @@ -19252,14 +19463,14 @@ components: in: query name: master_timeout description: |- - Period to wait for a connection to the master node. + Period to wait for a connection to the cluster-manager node. If no response is received before the timeout expires, the request fails and returns an error. deprecated: true schema: $ref: '#/components/schemas/_common___Duration' style: form x-version-deprecated: '2.0' - x-deprecation-message: To promote inclusive language, use 'cluster_manager_timeout' instead. + x-deprecation-message: To promote inclusive language, use `cluster_manager_timeout` instead. indices.delete_alias___query.timeout: in: query name: timeout @@ -19295,13 +19506,13 @@ components: indices.delete_index_template___query.master_timeout: in: query name: master_timeout - description: Period to wait for a connection to the master node. If no response is received before the timeout expires, the request fails and returns an error. + description: Period to wait for a connection to the cluster-manager node. If no response is received before the timeout expires, the request fails and returns an error. deprecated: true schema: $ref: '#/components/schemas/_common___Duration' style: form x-version-deprecated: '2.0' - x-deprecation-message: To promote inclusive language, use 'cluster_manager_timeout' instead. + x-deprecation-message: To promote inclusive language, use `cluster_manager_timeout` instead. indices.delete_index_template___query.timeout: in: query name: timeout @@ -19330,14 +19541,14 @@ components: in: query name: master_timeout description: |- - Period to wait for a connection to the master node. + Period to wait for a connection to the cluster-manager node. If no response is received before the timeout expires, the request fails and returns an error. deprecated: true schema: $ref: '#/components/schemas/_common___Duration' style: form x-version-deprecated: '2.0' - x-deprecation-message: To promote inclusive language, use 'cluster_manager_timeout' instead. + x-deprecation-message: To promote inclusive language, use `cluster_manager_timeout` instead. indices.delete_template___query.timeout: in: query name: timeout @@ -19399,14 +19610,14 @@ components: in: query name: master_timeout description: |- - Period to wait for a connection to the master node. + Period to wait for a connection to the cluster-manager node. If no response is received before the timeout expires, the request fails and returns an error. deprecated: true schema: $ref: '#/components/schemas/_common___Duration' style: form x-version-deprecated: '2.0' - x-deprecation-message: To promote inclusive language, use 'cluster_manager_timeout' instead. + x-deprecation-message: To promote inclusive language, use `cluster_manager_timeout` instead. indices.delete___query.timeout: in: query name: timeout @@ -19503,13 +19714,13 @@ components: indices.exists_index_template___query.master_timeout: in: query name: master_timeout - description: Period to wait for a connection to the master node. If no response is received before the timeout expires, the request fails and returns an error. + description: Period to wait for a connection to the cluster-manager node. If no response is received before the timeout expires, the request fails and returns an error. deprecated: true schema: $ref: '#/components/schemas/_common___Duration' style: form x-version-deprecated: '2.0' - x-deprecation-message: To promote inclusive language, use 'cluster_manager_timeout' instead. + x-deprecation-message: To promote inclusive language, use `cluster_manager_timeout` instead. indices.exists_template___path.name: in: path name: name @@ -19544,13 +19755,13 @@ components: indices.exists_template___query.master_timeout: in: query name: master_timeout - description: Explicit operation timeout for connection to master node + description: Explicit operation timeout for connection to cluster-manager node deprecated: true schema: $ref: '#/components/schemas/_common___Duration' style: form x-version-deprecated: '2.0' - x-deprecation-message: To promote inclusive language, use 'cluster_manager_timeout' instead. + x-deprecation-message: To promote inclusive language, use `cluster_manager_timeout` instead. indices.exists___path.index: in: path name: index @@ -19892,7 +20103,7 @@ components: indices.get_index_template___query.flat_settings: in: query name: flat_settings - description: If true, returns settings in flat format. + description: If `true`, returns settings in flat format. schema: type: boolean default: false @@ -19900,7 +20111,7 @@ components: indices.get_index_template___query.local: in: query name: local - description: If true, the request retrieves information from the local node only. Defaults to false, which means information is retrieved from the master node. + description: If `true`, the request retrieves information from the local node only. Defaults to false, which means information is retrieved from the cluster-manager node. schema: type: boolean default: false @@ -19908,13 +20119,13 @@ components: indices.get_index_template___query.master_timeout: in: query name: master_timeout - description: Period to wait for a connection to the master node. If no response is received before the timeout expires, the request fails and returns an error. + description: Period to wait for a connection to the cluster-manager node. If no response is received before the timeout expires, the request fails and returns an error. deprecated: true schema: $ref: '#/components/schemas/_common___Duration' style: form x-version-deprecated: '2.0' - x-deprecation-message: To promote inclusive language, use 'cluster_manager_timeout' instead. + x-deprecation-message: To promote inclusive language, use `cluster_manager_timeout` instead. indices.get_mapping___path.index: in: path name: index @@ -19982,14 +20193,14 @@ components: in: query name: master_timeout description: |- - Period to wait for a connection to the master node. + Period to wait for a connection to the cluster-manager node. If no response is received before the timeout expires, the request fails and returns an error. deprecated: true schema: $ref: '#/components/schemas/_common___Duration' style: form x-version-deprecated: '2.0' - x-deprecation-message: To promote inclusive language, use 'cluster_manager_timeout' instead. + x-deprecation-message: To promote inclusive language, use `cluster_manager_timeout` instead. indices.get_settings___path.index: in: path name: index @@ -20066,7 +20277,7 @@ components: name: local description: |- If `true`, the request retrieves information from the local node only. If - `false`, information is retrieved from the master node. + `false`, information is retrieved from the cluster-manager node. schema: type: boolean default: false @@ -20075,7 +20286,7 @@ components: in: query name: master_timeout description: |- - Period to wait for a connection to the master node. If no response is + Period to wait for a connection to the cluster-manager node. If no response is received before the timeout expires, the request fails and returns an error. deprecated: true @@ -20083,7 +20294,7 @@ components: $ref: '#/components/schemas/_common___Duration' style: form x-version-deprecated: '2.0' - x-deprecation-message: To promote inclusive language, use 'cluster_manager_timeout' instead. + x-deprecation-message: To promote inclusive language, use `cluster_manager_timeout` instead. indices.get_template___path.name: in: path name: name @@ -20122,14 +20333,14 @@ components: in: query name: master_timeout description: |- - Period to wait for a connection to the master node. + Period to wait for a connection to the cluster-manager node. If no response is received before the timeout expires, the request fails and returns an error. deprecated: true schema: $ref: '#/components/schemas/_common___Duration' style: form x-version-deprecated: '2.0' - x-deprecation-message: To promote inclusive language, use 'cluster_manager_timeout' instead. + x-deprecation-message: To promote inclusive language, use `cluster_manager_timeout` instead. indices.get_upgrade___path.index: name: index in: path @@ -20174,7 +20385,7 @@ components: in: query name: allow_no_indices description: |- - If false, the request returns an error if any wildcard expression, index alias, or _all value targets only + If `false`, the request returns an error if any wildcard expression, index alias, or `_all` value targets only missing or closed indexes. This behavior applies even if the request targets other open indexes. For example, a request targeting foo*,bar* returns an error if an index starts with foo but no index starts with bar. schema: @@ -20194,14 +20405,14 @@ components: description: |- Type of index that wildcard expressions can match. If the request can target data streams, this argument determines whether wildcard expressions match hidden data streams. Supports comma-separated values, - such as open,hidden. + such as `open,hidden`. schema: $ref: '#/components/schemas/_common___ExpandWildcards' style: form indices.get___query.flat_settings: in: query name: flat_settings - description: If true, returns settings in flat format. + description: If `true`, returns settings in flat format. schema: type: boolean default: false @@ -20209,7 +20420,7 @@ components: indices.get___query.ignore_unavailable: in: query name: ignore_unavailable - description: If false, requests that target a missing index return an error. + description: If `false`, requests that target a missing index return an error. schema: type: boolean default: false @@ -20217,7 +20428,7 @@ components: indices.get___query.include_defaults: in: query name: include_defaults - description: If true, return all default settings in the response. + description: If `true`, return all default settings in the response. schema: type: boolean default: false @@ -20225,7 +20436,7 @@ components: indices.get___query.local: in: query name: local - description: If true, the request retrieves information from the local node only. Defaults to false, which means information is retrieved from the master node. + description: If `true`, the request retrieves information from the local node only. Defaults to false, which means information is retrieved from the cluster-manager node. schema: type: boolean default: false @@ -20233,13 +20444,13 @@ components: indices.get___query.master_timeout: in: query name: master_timeout - description: Period to wait for a connection to the master node. If no response is received before the timeout expires, the request fails and returns an error. + description: Period to wait for a connection to the cluster-manager node. If no response is received before the timeout expires, the request fails and returns an error. deprecated: true schema: $ref: '#/components/schemas/_common___Duration' style: form x-version-deprecated: '2.0' - x-deprecation-message: To promote inclusive language, use 'cluster_manager_timeout' instead. + x-deprecation-message: To promote inclusive language, use `cluster_manager_timeout` instead. indices.open___path.index: in: path name: index @@ -20291,18 +20502,18 @@ components: in: query name: master_timeout description: |- - Period to wait for a connection to the master node. + Period to wait for a connection to the cluster-manager node. If no response is received before the timeout expires, the request fails and returns an error. deprecated: true schema: $ref: '#/components/schemas/_common___Duration' style: form x-version-deprecated: '2.0' - x-deprecation-message: To promote inclusive language, use 'cluster_manager_timeout' instead. + x-deprecation-message: To promote inclusive language, use `cluster_manager_timeout` instead. indices.open___query.task_execution_timeout: name: task_execution_timeout in: query - description: Explicit task execution timeout, only useful when wait_for_completion is false, defaults to 1h. + description: Explicit task execution timeout, only useful when `wait_for_completion` is false, defaults to `1h`. schema: $ref: '#/components/schemas/_common___Duration' indices.open___query.timeout: @@ -20365,14 +20576,14 @@ components: in: query name: master_timeout description: |- - Period to wait for a connection to the master node. + Period to wait for a connection to the cluster-manager node. If no response is received before the timeout expires, the request fails and returns an error. deprecated: true schema: $ref: '#/components/schemas/_common___Duration' style: form x-version-deprecated: '2.0' - x-deprecation-message: To promote inclusive language, use 'cluster_manager_timeout' instead. + x-deprecation-message: To promote inclusive language, use `cluster_manager_timeout` instead. indices.put_alias___query.timeout: in: query name: timeout @@ -20416,11 +20627,11 @@ components: indices.put_index_template___query.master_timeout: name: master_timeout in: query - description: Operation timeout for connection to master node. + description: Operation timeout for connection to cluster-manager node. schema: $ref: '#/components/schemas/_common___Duration' x-version-deprecated: '2.0' - x-deprecation-message: To promote inclusive language, use 'cluster_manager_timeout' instead. + x-deprecation-message: To promote inclusive language, use `cluster_manager_timeout` instead. deprecated: true indices.put_mapping___path.index: in: path @@ -20468,14 +20679,14 @@ components: in: query name: master_timeout description: |- - Period to wait for a connection to the master node. + Period to wait for a connection to the cluster-manager node. If no response is received before the timeout expires, the request fails and returns an error. deprecated: true schema: $ref: '#/components/schemas/_common___Duration' style: form x-version-deprecated: '2.0' - x-deprecation-message: To promote inclusive language, use 'cluster_manager_timeout' instead. + x-deprecation-message: To promote inclusive language, use `cluster_manager_timeout` instead. indices.put_mapping___query.timeout: in: query name: timeout @@ -20553,7 +20764,7 @@ components: in: query name: master_timeout description: |- - Period to wait for a connection to the master node. If no response is + Period to wait for a connection to the cluster-manager node. If no response is received before the timeout expires, the request fails and returns an error. deprecated: true @@ -20561,7 +20772,7 @@ components: $ref: '#/components/schemas/_common___Duration' style: form x-version-deprecated: '2.0' - x-deprecation-message: To promote inclusive language, use 'cluster_manager_timeout' instead. + x-deprecation-message: To promote inclusive language, use `cluster_manager_timeout` instead. indices.put_settings___query.preserve_existing: in: query name: preserve_existing @@ -20597,7 +20808,7 @@ components: indices.put_template___query.create: in: query name: create - description: If true, this request cannot replace or update existing index templates. + description: If `true`, this request cannot replace or update existing index templates. schema: type: boolean default: false @@ -20606,14 +20817,14 @@ components: in: query name: master_timeout description: |- - Period to wait for a connection to the master node. If no response is + Period to wait for a connection to the cluster-manager node. If no response is received before the timeout expires, the request fails and returns an error. deprecated: true schema: $ref: '#/components/schemas/_common___Duration' style: form x-version-deprecated: '2.0' - x-deprecation-message: To promote inclusive language, use 'cluster_manager_timeout' instead. + x-deprecation-message: To promote inclusive language, use `cluster_manager_timeout` instead. indices.put_template___query.order: in: query name: order @@ -20750,14 +20961,14 @@ components: in: query name: master_timeout description: |- - Period to wait for a connection to the master node. + Period to wait for a connection to the cluster-manager node. If no response is received before the timeout expires, the request fails and returns an error. deprecated: true schema: $ref: '#/components/schemas/_common___Duration' style: form x-version-deprecated: '2.0' - x-deprecation-message: To promote inclusive language, use 'cluster_manager_timeout' instead. + x-deprecation-message: To promote inclusive language, use `cluster_manager_timeout` instead. indices.rollover___query.timeout: in: query name: timeout @@ -20834,7 +21045,7 @@ components: in: query name: allow_no_indices description: |- - If false, the request returns an error if any wildcard expression, index alias, or _all + If `false`, the request returns an error if any wildcard expression, index alias, or `_all` value targets only missing or closed indexes. This behavior applies even if the request targets other open indexes. schema: @@ -20852,7 +21063,7 @@ components: indices.shard_stores___query.ignore_unavailable: in: query name: ignore_unavailable - description: If true, missing or closed indexes are not included in the response. + description: If `true`, missing or closed indexes are not included in the response. schema: type: boolean style: form @@ -20902,18 +21113,18 @@ components: in: query name: master_timeout description: |- - Period to wait for a connection to the master node. + Period to wait for a connection to the cluster-manager node. If no response is received before the timeout expires, the request fails and returns an error. deprecated: true schema: $ref: '#/components/schemas/_common___Duration' style: form x-version-deprecated: '2.0' - x-deprecation-message: To promote inclusive language, use 'cluster_manager_timeout' instead. + x-deprecation-message: To promote inclusive language, use `cluster_manager_timeout` instead. indices.shrink___query.task_execution_timeout: name: task_execution_timeout in: query - description: Explicit task execution timeout, only useful when wait_for_completion is false, defaults to 1h. + description: Explicit task execution timeout, only useful when `wait_for_completion` is false, defaults to `1h`. schema: $ref: '#/components/schemas/_common___Duration' indices.shrink___query.timeout: @@ -20983,14 +21194,14 @@ components: in: query name: master_timeout description: |- - Period to wait for a connection to the master node. If no response is received + Period to wait for a connection to the cluster-manager node. If no response is received before the timeout expires, the request fails and returns an error. deprecated: true schema: $ref: '#/components/schemas/_common___Duration' style: form x-version-deprecated: '2.0' - x-deprecation-message: To promote inclusive language, use 'cluster_manager_timeout' instead. + x-deprecation-message: To promote inclusive language, use `cluster_manager_timeout` instead. indices.simulate_template___path.name: in: path name: name @@ -21019,7 +21230,7 @@ components: indices.simulate_template___query.create: in: query name: create - description: If true, the template passed in the body is only used if no existing templates match the same index patterns. If false, the simulation uses the template with the highest priority. Note that the template is not permanently added or updated in either case; it is only used for the simulation. + description: If `true`, the template passed in the body is only used if no existing templates match the same index patterns. If `false`, the simulation uses the template with the highest priority. Note that the template is not permanently added or updated in either case; it is only used for the simulation. schema: type: boolean default: false @@ -21027,13 +21238,13 @@ components: indices.simulate_template___query.master_timeout: in: query name: master_timeout - description: Period to wait for a connection to the master node. If no response is received before the timeout expires, the request fails and returns an error. + description: Period to wait for a connection to the cluster-manager node. If no response is received before the timeout expires, the request fails and returns an error. deprecated: true schema: $ref: '#/components/schemas/_common___Duration' style: form x-version-deprecated: '2.0' - x-deprecation-message: To promote inclusive language, use 'cluster_manager_timeout' instead. + x-deprecation-message: To promote inclusive language, use `cluster_manager_timeout` instead. indices.split___path.index: in: path name: index @@ -21069,18 +21280,18 @@ components: in: query name: master_timeout description: |- - Period to wait for a connection to the master node. + Period to wait for a connection to the cluster-manager node. If no response is received before the timeout expires, the request fails and returns an error. deprecated: true schema: $ref: '#/components/schemas/_common___Duration' style: form x-version-deprecated: '2.0' - x-deprecation-message: To promote inclusive language, use 'cluster_manager_timeout' instead. + x-deprecation-message: To promote inclusive language, use `cluster_manager_timeout` instead. indices.split___query.task_execution_timeout: name: task_execution_timeout in: query - description: Explicit task execution timeout, only useful when wait_for_completion is false, defaults to 1h. + description: Explicit task execution timeout, only useful when `wait_for_completion` is false, defaults to `1h`. schema: $ref: '#/components/schemas/_common___Duration' indices.split___query.timeout: @@ -21133,7 +21344,7 @@ components: indices.stats___query.completion_fields: in: query name: completion_fields - description: Comma-separated list or wildcard expressions of fields to include in fielddata and suggest statistics. + description: Comma-separated list or wildcard expressions of fields to include in field data and suggest statistics. schema: $ref: '#/components/schemas/_common___Fields' style: form @@ -21150,7 +21361,7 @@ components: indices.stats___query.fielddata_fields: in: query name: fielddata_fields - description: Comma-separated list or wildcard expressions of fields to include in fielddata statistics. + description: Comma-separated list or wildcard expressions of fields to include in field data statistics. schema: $ref: '#/components/schemas/_common___Fields' style: form @@ -21164,7 +21375,7 @@ components: indices.stats___query.forbid_closed_indices: in: query name: forbid_closed_indices - description: If true, statistics are not collected from closed indexes. + description: If `true`, statistics are not collected from closed indexes. schema: type: boolean default: true @@ -21183,7 +21394,7 @@ components: indices.stats___query.include_segment_file_sizes: in: query name: include_segment_file_sizes - description: If true, the call reports the aggregated disk usage of each one of the Lucene index files (only applies if segment stats are requested). + description: If `true`, the call reports the aggregated disk usage of each one of the Lucene index files (only applies if segment stats are requested). schema: type: boolean default: false @@ -21191,7 +21402,7 @@ components: indices.stats___query.include_unloaded_segments: in: query name: include_unloaded_segments - description: If true, the response includes information from segments that are not loaded into memory. + description: If `true`, the response includes information from segments that are not loaded into memory. schema: type: boolean default: false @@ -21214,14 +21425,14 @@ components: in: query name: master_timeout description: |- - Period to wait for a connection to the master node. + Period to wait for a connection to the cluster-manager node. If no response is received before the timeout expires, the request fails and returns an error. deprecated: true schema: $ref: '#/components/schemas/_common___Duration' style: form x-version-deprecated: '2.0' - x-deprecation-message: To promote inclusive language, use 'cluster_manager_timeout' instead. + x-deprecation-message: To promote inclusive language, use `cluster_manager_timeout` instead. indices.update_aliases___query.timeout: in: query name: timeout @@ -21264,10 +21475,10 @@ components: indices.upgrade___query.only_ancient_segments: name: only_ancient_segments in: query - description: If true, only ancient (an older Lucene major release) segments will be upgraded. + description: If `true`, only ancient (an older Lucene major release) segments will be upgraded. schema: type: boolean - description: If true, only ancient (an older Lucene major release) segments will be upgraded. + description: If `true`, only ancient (an older Lucene major release) segments will be upgraded. indices.upgrade___query.wait_for_completion: x-version-added: '2.7' name: wait_for_completion @@ -21404,14 +21615,14 @@ components: in: query name: master_timeout description: |- - Period to wait for a connection to the master node. + Period to wait for a connection to the cluster-manager node. If no response is received before the timeout expires, the request fails and returns an error. deprecated: true schema: $ref: '#/components/schemas/_common___Duration' style: form x-version-deprecated: '2.0' - x-deprecation-message: To promote inclusive language, use 'cluster_manager_timeout' instead. + x-deprecation-message: To promote inclusive language, use `cluster_manager_timeout` instead. ingest.delete_pipeline___query.timeout: in: query name: timeout @@ -21443,14 +21654,14 @@ components: in: query name: master_timeout description: |- - Period to wait for a connection to the master node. + Period to wait for a connection to the cluster-manager node. If no response is received before the timeout expires, the request fails and returns an error. deprecated: true schema: $ref: '#/components/schemas/_common___Duration' style: form x-version-deprecated: '2.0' - x-deprecation-message: To promote inclusive language, use 'cluster_manager_timeout' instead. + x-deprecation-message: To promote inclusive language, use `cluster_manager_timeout` instead. ingest.put_pipeline___path.id: in: path name: id @@ -21469,13 +21680,13 @@ components: ingest.put_pipeline___query.master_timeout: in: query name: master_timeout - description: Period to wait for a connection to the master node. If no response is received before the timeout expires, the request fails and returns an error. + description: Period to wait for a connection to the cluster-manager node. If no response is received before the timeout expires, the request fails and returns an error. deprecated: true schema: $ref: '#/components/schemas/_common___Duration' style: form x-version-deprecated: '2.0' - x-deprecation-message: To promote inclusive language, use 'cluster_manager_timeout' instead. + x-deprecation-message: To promote inclusive language, use `cluster_manager_timeout` instead. ingest.put_pipeline___query.timeout: in: query name: timeout @@ -21686,35 +21897,35 @@ components: knn.search_models___query._source: name: _source in: query - description: True or false to return the _source field or not, or a list of fields to return. + description: Set to `true` or `false` to return the `_source` field or not, or a list of fields to return. style: form schema: type: array items: type: string - description: True or false to return the _source field or not, or a list of fields to return. + description: Set to `true` or `false` to return the `_source` field or not, or a list of fields to return. explode: true knn.search_models___query._source_excludes: name: _source_excludes in: query - description: List of fields to exclude from the returned _source field. + description: List of fields to exclude from the returned `_source` field. style: form schema: type: array items: type: string - description: List of fields to exclude from the returned _source field. + description: List of fields to exclude from the returned `_source` field. explode: true knn.search_models___query._source_includes: name: _source_includes in: query - description: List of fields to extract and return from the _source field. + description: List of fields to extract and return from the `_source` field. style: form schema: type: array items: type: string - description: List of fields to extract and return from the _source field. + description: List of fields to extract and return from the `_source` field. explode: true knn.search_models___query.allow_no_indices: name: allow_no_indices @@ -21842,10 +22053,10 @@ components: knn.search_models___query.pre_filter_shard_size: name: pre_filter_shard_size in: query - description: Threshold that enforces a pre-filter round-trip to prefilter search shards based on query rewriting if the number of shards the search request expands to exceeds the threshold. This filter round-trip can limit the number of shards significantly if for instance a shard can not match any documents based on its rewrite method ie. if date filters are mandatory to match but the shard bounds and the query are disjoint. + description: Threshold that enforces a pre-filter round-trip to prefilter search shards based on query rewriting if the number of shards the search request expands to exceeds the threshold. This filter round-trip can limit the number of shards significantly if for instance a shard can not match any documents based on its rewrite method, that is if date filters are mandatory to match but the shard bounds and the query are disjoint. schema: type: integer - description: Threshold that enforces a pre-filter round-trip to prefilter search shards based on query rewriting if the number of shards the search request expands to exceeds the threshold. This filter round-trip can limit the number of shards significantly if for instance a shard can not match any documents based on its rewrite method ie. if date filters are mandatory to match but the shard bounds and the query are disjoint. + description: Threshold that enforces a pre-filter round-trip to prefilter search shards based on query rewriting if the number of shards the search request expands to exceeds the threshold. This filter round-trip can limit the number of shards significantly if for instance a shard can not match any documents based on its rewrite method, that is if date filters are mandatory to match but the shard bounds and the query are disjoint. format: int32 knn.search_models___query.preference: name: preference @@ -21872,11 +22083,11 @@ components: knn.search_models___query.rest_total_hits_as_int: name: rest_total_hits_as_int in: query - description: Indicates whether hits.total should be rendered as an integer or an object in the rest search response. + description: Indicates whether `hits.total` should be rendered as an integer or an object in the rest search response. schema: type: boolean default: false - description: Indicates whether hits.total should be rendered as an integer or an object in the rest search response. + description: Indicates whether `hits.total` should be rendered as an integer or an object in the rest search response. knn.search_models___query.routing: name: routing in: query @@ -22163,7 +22374,7 @@ components: list.indices___query.include_unloaded_segments: in: query name: include_unloaded_segments - description: If true, the response includes information from segments that are not loaded into memory. + description: If `true`, the response includes information from segments that are not loaded into memory. schema: type: boolean default: false @@ -22179,7 +22390,7 @@ components: list.indices___query.master_timeout: name: master_timeout in: query - description: Operation timeout for connection to cluster manager node. + description: Operation timeout for connection to cluster-manager node. schema: $ref: '#/components/schemas/_common___Duration' x-version-deprecated: '2.0' @@ -22197,7 +22408,7 @@ components: list.indices___query.pri: in: query name: pri - description: If true, the response only includes information from primary shards. + description: If `true`, the response only includes information from primary shards. schema: type: boolean default: false @@ -22306,11 +22517,11 @@ components: list.shards___query.master_timeout: name: master_timeout in: query - description: Operation timeout for connection to cluster manager node. + description: Operation timeout for connection to cluster-manager node. schema: $ref: '#/components/schemas/_common___Duration' x-version-deprecated: '2.0' - x-deprecation-message: To promote inclusive language, use 'cluster_manager_timeout' instead. + x-deprecation-message: To promote inclusive language, use `cluster_manager_timeout` instead. deprecated: true list.shards___query.next_token: name: next_token @@ -22373,7 +22584,7 @@ components: mget___query._source: in: query name: _source - description: True or false to return the `_source` field or not, or a list of fields to return. + description: Set to `true` or `false` to return the `_source` field or not, or a list of fields to return. schema: $ref: '#/components/schemas/_core.search___SourceConfigParam' style: form @@ -22416,7 +22627,7 @@ components: name: refresh description: If `true`, the request refreshes relevant shards before retrieving documents. schema: - type: boolean + $ref: '#/components/schemas/_common___Refresh' style: form mget___query.routing: in: query @@ -22550,7 +22761,7 @@ components: msearch___query.ccs_minimize_roundtrips: in: query name: ccs_minimize_roundtrips - description: If true, network roundtrips between the coordinating node and remote clusters are minimized for cross-cluster search requests. + description: If `true`, network round-trips between the coordinating node and remote clusters are minimized for cross-cluster search requests. schema: type: boolean default: true @@ -22583,7 +22794,7 @@ components: msearch___query.rest_total_hits_as_int: in: query name: rest_total_hits_as_int - description: If true, hits.total are returned as an integer in the response. Defaults to false, which returns an object. + description: If `true`, `hits.total` are returned as an integer in the response. Defaults to false, which returns an object. schema: type: boolean default: false @@ -22673,7 +22884,7 @@ components: mtermvectors___query.realtime: in: query name: realtime - description: If true, the request is real-time as opposed to near-real-time. + description: If `true`, the request is real-time as opposed to near-real-time. schema: type: boolean default: true @@ -22688,7 +22899,7 @@ components: mtermvectors___query.term_statistics: in: query name: term_statistics - description: If true, the response includes term frequency and document frequency. + description: If `true`, the response includes term frequency and document frequency. schema: type: boolean default: false @@ -22734,11 +22945,11 @@ components: nodes.hot_threads___query.snapshots: name: snapshots in: query - description: Number of samples of thread stacktrace. + description: Number of samples of thread stack trace. schema: type: integer default: 10 - description: Number of samples of thread stacktrace. + description: Number of samples of thread stack trace. format: int32 nodes.hot_threads___query.threads: name: threads @@ -22764,7 +22975,7 @@ components: nodes.info___path.metric: in: path name: metric - description: Limits the information returned to the specific metrics. Supports a comma-separated list, such as http,ingest. + description: Limits the information returned to the specific metrics. Supports a comma-separated list, such as `http,ingest`. required: true schema: type: array @@ -22784,7 +22995,7 @@ components: name: node_id_or_metric description: | Limits the information returned to a list of node IDs or specific metrics. - Supports a comma-separated list, such as node1,node2 or http,ingest. + Supports a comma-separated list, such as `node1,node2` or `http,ingest`. required: true schema: anyOf: @@ -22798,7 +23009,7 @@ components: nodes.info___query.flat_settings: in: query name: flat_settings - description: If true, returns settings in flat format. + description: If `true`, returns settings in flat format. schema: type: boolean default: false @@ -22858,14 +23069,14 @@ components: nodes.stats___query.completion_fields: in: query name: completion_fields - description: Comma-separated list or wildcard expressions of fields to include in fielddata and suggest statistics. + description: Comma-separated list or wildcard expressions of fields to include in field data and suggest statistics. schema: $ref: '#/components/schemas/_common___Fields' style: form nodes.stats___query.fielddata_fields: in: query name: fielddata_fields - description: Comma-separated list or wildcard expressions of fields to include in fielddata statistics. + description: Comma-separated list or wildcard expressions of fields to include in field data statistics. schema: $ref: '#/components/schemas/_common___Fields' style: form @@ -22888,7 +23099,7 @@ components: nodes.stats___query.include_segment_file_sizes: in: query name: include_segment_file_sizes - description: If true, the call reports the aggregated disk usage of each one of the Lucene index files (only applies if segment stats are requested). + description: If `true`, the call reports the aggregated disk usage of each one of the Lucene index files (only applies if segment stats are requested). schema: type: boolean default: false @@ -23233,7 +23444,7 @@ components: ppl.explain___query.format: name: format in: query - description: A short version of the Accept header, e.g. json, yaml. + description: A short version of the Accept header (for example, `json`, `yaml`). schema: type: string ppl.explain___query.sanitize: @@ -23246,7 +23457,7 @@ components: ppl.get_stats___query.format: name: format in: query - description: A short version of the Accept header, e.g. json, yaml. + description: A short version of the Accept header (for example, `json`, `yaml`). schema: type: string ppl.get_stats___query.sanitize: @@ -23259,7 +23470,7 @@ components: ppl.post_stats___query.format: name: format in: query - description: A short version of the Accept header, e.g. json, yaml. + description: A short version of the Accept header (for example, `json`, `yaml`). schema: type: string ppl.post_stats___query.sanitize: @@ -23272,7 +23483,7 @@ components: ppl.query___query.format: name: format in: query - description: A short version of the Accept header, e.g. json, yaml. + description: A short version of the Accept header (for example, `json`, `yaml`). schema: type: string ppl.query___query.sanitize: @@ -23321,14 +23532,14 @@ components: in: query name: master_timeout description: |- - Period to wait for a connection to the master node. + Period to wait for a connection to the cluster-manager node. If no response is received before the timeout expires, the request fails and returns an error. deprecated: true schema: $ref: '#/components/schemas/_common___Duration' style: form x-version-deprecated: '2.0' - x-deprecation-message: To promote inclusive language, use 'cluster_manager_timeout' instead. + x-deprecation-message: To promote inclusive language, use `cluster_manager_timeout` instead. put_script___query.timeout: in: query name: timeout @@ -23419,7 +23630,7 @@ components: name: refresh description: If `true`, the request refreshes affected shards to make this operation visible to search. schema: - type: boolean + $ref: '#/components/schemas/_common___Refresh' style: form reindex___query.requests_per_second: in: query @@ -23500,6 +23711,54 @@ components: schema: $ref: '#/components/schemas/_common___Id' style: simple + replication.pause___path.index: + in: path + name: index + description: Name of the data stream, index, or index alias to perform bulk actions on. + required: true + schema: + $ref: '#/components/schemas/_common___IndexName' + style: simple + replication.resume___path.index: + in: path + name: index + description: Name of the data stream, index, or index alias to perform bulk actions on. + required: true + schema: + $ref: '#/components/schemas/_common___IndexName' + style: simple + replication.start___path.index: + in: path + name: index + description: Name of the data stream, index, or index alias to perform bulk actions on. + required: true + schema: + $ref: '#/components/schemas/_common___IndexName' + style: simple + replication.status___path.index: + in: path + name: index + description: Name of the data stream, index, or index alias to perform bulk actions on. + required: true + schema: + $ref: '#/components/schemas/_common___IndexName' + style: simple + replication.stop___path.index: + in: path + name: index + description: Name of the data stream, index, or index alias to perform bulk actions on. + required: true + schema: + $ref: '#/components/schemas/_common___IndexName' + style: simple + replication.update_settings___path.index: + in: path + name: index + description: Name of the data stream, index, or index alias to perform bulk actions on. + required: true + schema: + $ref: '#/components/schemas/_common___IndexName' + style: simple rollups.delete___path.id: name: id in: path @@ -23574,7 +23833,7 @@ components: scroll___query.rest_total_hits_as_int: in: query name: rest_total_hits_as_int - description: If true, the API response's hit.total property is returned as an integer. If false, the API response's hit.total property is returned as an object. + description: If `true`, the API response's `hit.total` property is returned as an integer. If `false`, the API response's `hit.total` property is returned as an object. schema: type: boolean default: false @@ -23789,7 +24048,7 @@ components: search_template___query.rest_total_hits_as_int: in: query name: rest_total_hits_as_int - description: If true, hits.total are rendered as an integer in the response. + description: If `true`, `hits.total` are rendered as an integer in the response. schema: type: boolean default: false @@ -23882,7 +24141,7 @@ components: search___query.allow_partial_search_results: in: query name: allow_partial_search_results - description: If true, returns partial results if there are shard request timeouts or shard failures. If false, returns an error with no partial results. + description: If `true`, returns partial results if there are shard request timeouts or shard failures. If `false`, returns an error with no partial results. schema: type: boolean default: true @@ -23891,7 +24150,7 @@ components: in: query name: analyze_wildcard description: |- - If true, wildcard and prefix queries are analyzed. + If `true`, wildcard and prefix queries are analyzed. This parameter can only be used when the q query string parameter is specified. schema: type: boolean @@ -23929,7 +24188,7 @@ components: search___query.ccs_minimize_roundtrips: in: query name: ccs_minimize_roundtrips - description: If true, network round-trips between the coordinating node and the remote clusters are minimized when executing cross-cluster search (CCS) requests. + description: If `true`, network round-trips between the coordinating node and the remote clusters are minimized when executing cross-cluster search (CCS) requests. schema: type: boolean default: true @@ -24006,11 +24265,11 @@ components: search___query.include_named_queries_score: name: include_named_queries_score in: query - description: Indicates whether hit.matched_queries should be rendered as a map that includes the name of the matched query associated with its score (true) or as an array containing the name of the matched queries (false) + description: Indicates whether `hit.matched_queries` should be rendered as a map that includes the name of the matched query associated with its score (true) or as an array containing the name of the matched queries (false) schema: type: boolean default: false - description: Indicates whether hit.matched_queries should be rendered as a map that includes the name of the matched query associated with its score (true) or as an array containing the name of the matched queries (false) + description: Indicates whether `hit.matched_queries` should be rendered as a map that includes the name of the matched query associated with its score (true) or as an array containing the name of the matched queries (false) search___query.lenient: in: query name: lenient @@ -24417,14 +24676,14 @@ components: security.get_distinguished_name___query.show_all: name: show_all in: query - description: A boolean flag to include/exclude static nodes DN from final result. + description: A Boolean flag to include/exclude static nodes DN from final result. schema: type: boolean required: false security.get_distinguished_names___query.show_all: name: show_all in: query - description: A boolean flag to include/exclude static nodes DN from final result. + description: A Boolean flag to include/exclude static nodes DN from final result. schema: type: boolean required: false @@ -24464,7 +24723,7 @@ components: security.get_sslinfo___query.show_dn: name: show_dn in: query - description: A boolean flag to indicate whether all domain names should be returned. + description: A Boolean flag to indicate whether all domain names should be returned. schema: type: - boolean @@ -24494,7 +24753,7 @@ components: security.health___query.mode: name: mode in: query - description: A flag to indicate whether service should consider security-plugin's status before returning health response. `strict` mode indicates service should check security plugin status. + description: A flag to indicate whether service should consider security-plugin's status before returning health response. `strict` mode indicates service should check Security plugin status. schema: type: string required: false @@ -24508,7 +24767,7 @@ components: security.patch_distinguished_name___path.cluster_name: name: cluster_name in: path - description: The cluster-name to update nodesDn value. + description: The cluster name to update `nodesDn` value. schema: type: string required: true @@ -24543,14 +24802,14 @@ components: security.update_distinguished_name___path.cluster_name: name: cluster_name in: path - description: The cluster-name to create/update nodesDn value for. + description: The cluster-name to create/update `nodesDn` value for. schema: type: string required: true security.validate___query.accept_invalid: name: accept_invalid in: query - description: A boolean flag to indicate whether invalid v6 configuration should be allowed. + description: A Boolean flag to indicate whether invalid v6 configuration should be allowed. schema: type: boolean required: false @@ -24572,13 +24831,13 @@ components: snapshot.cleanup_repository___query.master_timeout: in: query name: master_timeout - description: Period to wait for a connection to the master node. + description: Period to wait for a connection to the cluster-manager node. deprecated: true schema: $ref: '#/components/schemas/_common___Duration' style: form x-version-deprecated: '2.0' - x-deprecation-message: To promote inclusive language, use 'cluster_manager_timeout' instead. + x-deprecation-message: To promote inclusive language, use `cluster_manager_timeout` instead. snapshot.cleanup_repository___query.timeout: in: query name: timeout @@ -24620,13 +24879,13 @@ components: snapshot.clone___query.master_timeout: in: query name: master_timeout - description: Explicit operation timeout for connection to master node + description: Explicit operation timeout for connection to cluster-manager node deprecated: true schema: $ref: '#/components/schemas/_common___Duration' style: form x-version-deprecated: '2.0' - x-deprecation-message: To promote inclusive language, use 'cluster_manager_timeout' instead. + x-deprecation-message: To promote inclusive language, use `cluster_manager_timeout` instead. snapshot.create_repository___path.repository: in: path name: repository @@ -24645,13 +24904,13 @@ components: snapshot.create_repository___query.master_timeout: in: query name: master_timeout - description: Explicit operation timeout for connection to master node + description: Explicit operation timeout for connection to cluster-manager node deprecated: true schema: $ref: '#/components/schemas/_common___Duration' style: form x-version-deprecated: '2.0' - x-deprecation-message: To promote inclusive language, use 'cluster_manager_timeout' instead. + x-deprecation-message: To promote inclusive language, use `cluster_manager_timeout` instead. snapshot.create_repository___query.timeout: in: query name: timeout @@ -24692,13 +24951,13 @@ components: snapshot.create___query.master_timeout: in: query name: master_timeout - description: Period to wait for a connection to the master node. If no response is received before the timeout expires, the request fails and returns an error. + description: Period to wait for a connection to the cluster-manager node. If no response is received before the timeout expires, the request fails and returns an error. deprecated: true schema: $ref: '#/components/schemas/_common___Duration' style: form x-version-deprecated: '2.0' - x-deprecation-message: To promote inclusive language, use 'cluster_manager_timeout' instead. + x-deprecation-message: To promote inclusive language, use `cluster_manager_timeout` instead. snapshot.create___query.wait_for_completion: in: query name: wait_for_completion @@ -24725,13 +24984,13 @@ components: snapshot.delete_repository___query.master_timeout: in: query name: master_timeout - description: Explicit operation timeout for connection to master node + description: Explicit operation timeout for connection to cluster-manager node deprecated: true schema: $ref: '#/components/schemas/_common___Duration' style: form x-version-deprecated: '2.0' - x-deprecation-message: To promote inclusive language, use 'cluster_manager_timeout' instead. + x-deprecation-message: To promote inclusive language, use `cluster_manager_timeout` instead. snapshot.delete_repository___query.timeout: in: query name: timeout @@ -24765,13 +25024,13 @@ components: snapshot.delete___query.master_timeout: in: query name: master_timeout - description: Explicit operation timeout for connection to master node + description: Explicit operation timeout for connection to cluster-manager node deprecated: true schema: $ref: '#/components/schemas/_common___Duration' style: form x-version-deprecated: '2.0' - x-deprecation-message: To promote inclusive language, use 'cluster_manager_timeout' instead. + x-deprecation-message: To promote inclusive language, use `cluster_manager_timeout` instead. snapshot.get_repository___path.repository: in: path name: repository @@ -24798,13 +25057,13 @@ components: snapshot.get_repository___query.master_timeout: in: query name: master_timeout - description: Explicit operation timeout for connection to master node + description: Explicit operation timeout for connection to cluster-manager node deprecated: true schema: $ref: '#/components/schemas/_common___Duration' style: form x-version-deprecated: '2.0' - x-deprecation-message: To promote inclusive language, use 'cluster_manager_timeout' instead. + x-deprecation-message: To promote inclusive language, use `cluster_manager_timeout` instead. snapshot.get___path.repository: in: path name: repository @@ -24817,9 +25076,9 @@ components: in: path name: snapshot description: |- - Comma-separated list of snapshot names to retrieve. Also accepts wildcards (*). - - To get information about all snapshots in a registered repository, use a wildcard (*) or _all. - - To get information about any snapshots that are currently running, use _current. + Comma-separated list of snapshot names to retrieve. Also accepts wildcards (`*`). + - To get information about all snapshots in a registered repository, use a wildcard (`*`) or `_all`. + - To get information about any snapshots that are currently running, use `_current`. required: true schema: $ref: '#/components/schemas/_common___Names' @@ -24834,7 +25093,7 @@ components: snapshot.get___query.ignore_unavailable: in: query name: ignore_unavailable - description: If false, the request returns an error for any snapshots that are unavailable. + description: If `false`, the request returns an error for any snapshots that are unavailable. schema: type: boolean default: false @@ -24842,17 +25101,17 @@ components: snapshot.get___query.master_timeout: in: query name: master_timeout - description: Period to wait for a connection to the master node. If no response is received before the timeout expires, the request fails and returns an error. + description: Period to wait for a connection to the cluster-manager node. If no response is received before the timeout expires, the request fails and returns an error. deprecated: true schema: $ref: '#/components/schemas/_common___Duration' style: form x-version-deprecated: '2.0' - x-deprecation-message: To promote inclusive language, use 'cluster_manager_timeout' instead. + x-deprecation-message: To promote inclusive language, use `cluster_manager_timeout` instead. snapshot.get___query.verbose: in: query name: verbose - description: If true, returns additional information about each snapshot such as the version of OpenSearch which took the snapshot, the start and end times of the snapshot, and the number of shards snapshotted. + description: If `true`, returns additional information about each snapshot such as the version of OpenSearch which took the snapshot, the start and end times of the snapshot, and the number of shards snapshotted. schema: type: boolean style: form @@ -24882,13 +25141,13 @@ components: snapshot.restore___query.master_timeout: in: query name: master_timeout - description: Explicit operation timeout for connection to master node + description: Explicit operation timeout for connection to cluster-manager node deprecated: true schema: $ref: '#/components/schemas/_common___Duration' style: form x-version-deprecated: '2.0' - x-deprecation-message: To promote inclusive language, use 'cluster_manager_timeout' instead. + x-deprecation-message: To promote inclusive language, use `cluster_manager_timeout` instead. snapshot.restore___query.wait_for_completion: in: query name: wait_for_completion @@ -24923,7 +25182,7 @@ components: snapshot.status___query.ignore_unavailable: in: query name: ignore_unavailable - description: Whether to ignore unavailable snapshots, defaults to false which means a SnapshotMissingException is thrown + description: Whether to ignore unavailable snapshots, defaults to `false` which means a SnapshotMissingException is thrown schema: type: boolean default: false @@ -24931,13 +25190,13 @@ components: snapshot.status___query.master_timeout: in: query name: master_timeout - description: Explicit operation timeout for connection to master node + description: Explicit operation timeout for connection to cluster-manager node deprecated: true schema: $ref: '#/components/schemas/_common___Duration' style: form x-version-deprecated: '2.0' - x-deprecation-message: To promote inclusive language, use 'cluster_manager_timeout' instead. + x-deprecation-message: To promote inclusive language, use `cluster_manager_timeout` instead. snapshot.verify_repository___path.repository: in: path name: repository @@ -24956,13 +25215,13 @@ components: snapshot.verify_repository___query.master_timeout: in: query name: master_timeout - description: Explicit operation timeout for connection to master node + description: Explicit operation timeout for connection to cluster-manager node deprecated: true schema: $ref: '#/components/schemas/_common___Duration' style: form x-version-deprecated: '2.0' - x-deprecation-message: To promote inclusive language, use 'cluster_manager_timeout' instead. + x-deprecation-message: To promote inclusive language, use `cluster_manager_timeout` instead. snapshot.verify_repository___query.timeout: in: query name: timeout @@ -24973,7 +25232,7 @@ components: sql.close___query.format: name: format in: query - description: A short version of the Accept header, e.g. json, yaml. + description: A short version of the Accept header (for example, `json`, `yaml`). schema: type: string sql.close___query.sanitize: @@ -24986,7 +25245,7 @@ components: sql.explain___query.format: name: format in: query - description: A short version of the Accept header, e.g. json, yaml. + description: A short version of the Accept header (for example, `json`, `yaml`). schema: type: string sql.explain___query.sanitize: @@ -24999,7 +25258,7 @@ components: sql.get_stats___query.format: name: format in: query - description: A short version of the Accept header, e.g. json, yaml. + description: A short version of the Accept header (for example, `json`, `yaml`). schema: type: string sql.get_stats___query.sanitize: @@ -25012,7 +25271,7 @@ components: sql.post_stats___query.format: name: format in: query - description: A short version of the Accept header, e.g. json, yaml. + description: A short version of the Accept header (for example, `json`, `yaml`). schema: type: string sql.post_stats___query.sanitize: @@ -25025,7 +25284,7 @@ components: sql.query___query.format: name: format in: query - description: A short version of the Accept header, e.g. json, yaml. + description: A short version of the Accept header (for example, `json`, `yaml`). schema: type: string sql.query___query.sanitize: @@ -25038,7 +25297,7 @@ components: sql.settings___query.format: name: format in: query - description: A short version of the Accept header, e.g. json, yaml. + description: A short version of the Accept header (for example, `json`, `yaml`). schema: type: string tasks.cancel___path.task_id: @@ -25238,7 +25497,7 @@ components: termvectors___query.realtime: in: query name: realtime - description: If true, the request is real-time as opposed to near-real-time. + description: If `true`, the request is real-time as opposed to near-real-time. schema: type: boolean default: true @@ -25406,35 +25665,35 @@ components: update_by_query___query._source: name: _source in: query - description: True or false to return the _source field or not, or a list of fields to return. + description: Set to `true` or `false` to return the `_source` field or not, or a list of fields to return. style: form schema: type: array items: type: string - description: True or false to return the _source field or not, or a list of fields to return. + description: Set to `true` or `false` to return the `_source` field or not, or a list of fields to return. explode: true update_by_query___query._source_excludes: name: _source_excludes in: query - description: List of fields to exclude from the returned _source field. + description: List of fields to exclude from the returned `_source` field. style: form schema: type: array items: type: string - description: List of fields to exclude from the returned _source field. + description: List of fields to exclude from the returned `_source` field. explode: true update_by_query___query._source_includes: name: _source_includes in: query - description: List of fields to extract and return from the _source field. + description: List of fields to extract and return from the `_source` field. style: form schema: type: array items: type: string - description: List of fields to extract and return from the _source field. + description: List of fields to extract and return from the `_source` field. explode: true update_by_query___query.allow_no_indices: in: query @@ -25558,7 +25817,7 @@ components: name: refresh description: If `true`, OpenSearch refreshes affected shards to make the operation visible to search. schema: - type: boolean + $ref: '#/components/schemas/_common___Refresh' style: form update_by_query___query.request_cache: in: query @@ -25616,10 +25875,10 @@ components: update_by_query___query.size: name: size in: query - description: Deprecated, please use `max_docs` instead. + description: Deprecated, use `max_docs` instead. schema: type: integer - description: Deprecated, please use `max_docs` instead. + description: Deprecated, use `max_docs` instead. format: int32 update_by_query___query.slices: in: query @@ -25715,7 +25974,7 @@ components: in: query name: _source description: |- - Set to false to disable source retrieval. You can also specify a comma-separated + Set to `false` to disable source retrieval. You can also specify a comma-separated list of the fields you want to retrieve. schema: $ref: '#/components/schemas/_core.search___SourceConfigParam' @@ -25762,15 +26021,15 @@ components: name: refresh description: |- If 'true', OpenSearch refreshes the affected shards to make this operation - visible to search, if 'wait_for' then wait for a refresh to make this operation - visible to search, if 'false' do nothing with refreshes. + visible to search, if `wait_for` then wait for a refresh to make this operation + visible to search, if `false` do nothing with refreshes. schema: $ref: '#/components/schemas/_common___Refresh' style: form update___query.require_alias: in: query name: require_alias - description: If true, the destination must be an index alias. + description: If `true`, the destination must be an index alias. schema: type: boolean default: false @@ -25896,7 +26155,7 @@ components: index: $ref: '#/components/schemas/_common___IndexName' primary: - description: If true, returns explanation for the primary shard for the given shard ID. + description: If `true`, returns explanation for the primary shard for the given shard ID. type: boolean shard: description: Specifies the ID of the shard that you would like an explanation for. @@ -26216,7 +26475,7 @@ components: dynamic_date_formats: description: |- If date detection is enabled then new string fields are checked - against 'dynamic_date_formats' and if the value matches then + against `dynamic_date_formats` and if the value matches then a new date field is added instead of string. type: array items: @@ -26662,7 +26921,7 @@ components: properties: secure_settings_password: $ref: '#/components/schemas/_common___Password' - description: An object containing the password for the opensearch keystore + description: An object containing the password for the OpenSearch keystore. notifications.create_config: content: application/json: @@ -26827,11 +27086,53 @@ components: source: description: |- An inline search template. - Supports the same parameters as the search API's request body. + Supports the same parameters as the search API request body. These parameters also support Mustache variables. If no `id` or `` is specified, this parameter is required. type: string - description: The search definition template and its params + description: The search definition template and its parameters. + replication.create_replication_rule: + content: + application/json: + schema: + $ref: '#/components/schemas/replication._common___CreateReplicationRule' + required: true + replication.delete_replication_rule: + content: + application/json: + schema: + $ref: '#/components/schemas/replication._common___DeleteReplicationRule' + required: true + replication.pause: + content: + application/json: + schema: + type: object + required: true + replication.resume: + content: + application/json: + schema: + type: object + required: true + replication.start: + content: + application/json: + schema: + $ref: '#/components/schemas/replication._common___Replication' + required: true + replication.stop: + content: + application/json: + schema: + type: object + required: true + replication.update_settings: + content: + application/json: + schema: + $ref: '#/components/schemas/replication._common___UpdateSettings' + required: true rollups.put: content: application/json: @@ -26878,7 +27179,7 @@ components: collapse: $ref: '#/components/schemas/_core.search___FieldCollapse' explain: - description: If true, returns detailed information about score computation as part of a hit. + description: If `true`, returns detailed information about score computation as part of a hit. type: boolean ext: description: Configuration of search extensions defined by OpenSearch plugins. @@ -26984,10 +27285,10 @@ components: Defaults to no timeout. type: string track_scores: - description: If true, calculate and return document scores, even if the scores are not used for sorting. + description: If `true`, calculate and return document scores, even if the scores are not used for sorting. type: boolean version: - description: If true, returns document version as part of a hit. + description: If `true`, returns document version as part of a hit. type: boolean seq_no_primary_term: description: If `true`, returns sequence number and primary term of the last modification of each hit. @@ -27035,11 +27336,11 @@ components: type: boolean source: description: |- - An inline search template. Supports the same parameters as the search API's + An inline search template. Supports the same parameters as the search API request body. Also supports Mustache variables. If no id is specified, this parameter is required. type: string - description: The search definition template and its params + description: The search definition template and its parameters. required: true security.change_password: content: @@ -27392,19 +27693,19 @@ components: properties: detect_noop: description: |- - Set to false to disable setting 'result' in the response - to 'noop' if no change to the document occurred. + Set to `false` to disable setting `result` in the response + to `noop` if no change to the document occurred. type: boolean doc: description: A partial update to an existing document. type: object doc_as_upsert: - description: Set to true to use the contents of 'doc' as the value of 'upsert' + description: Set to `true` to use the contents of 'doc' as the value of 'upsert' type: boolean script: $ref: '#/components/schemas/_common___Script' scripted_upsert: - description: Set to true to execute the script whether or not the document exists. + description: Set to `true` to execute the script whether or not the document exists. type: boolean _source: $ref: '#/components/schemas/_core.search___SourceConfig' @@ -28198,6 +28499,10 @@ components: content: application/json: {} description: '' + exists_source___404: + content: + application/json: {} + description: '' exists___200: content: application/json: {} @@ -28212,6 +28517,8 @@ components: schema: type: object properties: + _type: + $ref: '#/components/schemas/_common___Type' _index: $ref: '#/components/schemas/_common___IndexName' _id: @@ -28540,6 +28847,12 @@ components: schema: type: object description: '' + get_source___404: + content: + application/json: + schema: + $ref: '#/components/schemas/query._common___ErrorResponse' + description: '' get___200: content: application/json: @@ -28683,6 +28996,7 @@ components: total_store_sizes: $ref: '#/components/schemas/_common___HumanReadableByteCount' total_store_size_bytes: + description: Total size, in bytes, of all shards for the selected data streams. $ref: '#/components/schemas/_common___ByteCount' required: - _shards @@ -28767,8 +29081,8 @@ components: properties: task: description: |- - task contains a task id returned when wait_for_completion=false, - you can use the task_id to get the status of the task at _tasks/ + Task contains a task id returned when `wait_for_completion=false`, + you can use the `task_id` to get the status of the task at _tasks/. type: string description: '' indices.get_alias___200: @@ -29904,6 +30218,72 @@ components: required: - template_output description: '' + replication.autofollow_stats___200: + content: + application/json: + schema: + $ref: '#/components/schemas/replication._common___AutoFollowStatus' + description: '' + replication.create_replication_rule___200: + content: + application/json: + schema: + $ref: '#/components/schemas/_common___AcknowledgedResponseBase' + description: '' + replication.delete_replication_rule___200: + content: + application/json: + schema: + $ref: '#/components/schemas/_common___AcknowledgedResponseBase' + description: '' + replication.follower_stats___200: + content: + application/json: + schema: + $ref: '#/components/schemas/replication._common___FollowerStatus' + description: '' + replication.leader_stats___200: + content: + application/json: + schema: + $ref: '#/components/schemas/replication._common___LeaderStatus' + description: '' + replication.pause___200: + content: + application/json: + schema: + $ref: '#/components/schemas/_common___AcknowledgedResponseBase' + description: '' + replication.resume___200: + content: + application/json: + schema: + $ref: '#/components/schemas/_common___AcknowledgedResponseBase' + description: '' + replication.start___200: + content: + application/json: + schema: + $ref: '#/components/schemas/_common___AcknowledgedResponseBase' + description: '' + replication.status___200: + content: + application/json: + schema: + $ref: '#/components/schemas/replication._common___Status' + description: '' + replication.stop___200: + content: + application/json: + schema: + $ref: '#/components/schemas/_common___AcknowledgedResponseBase' + description: '' + replication.update_settings___200: + content: + application/json: + schema: + $ref: '#/components/schemas/_common___AcknowledgedResponseBase' + description: '' rollups.delete___200: description: '' rollups.explain___200: @@ -30403,7 +30783,7 @@ components: $ref: '#/components/schemas/security._common___InternalServerError' description: '' security.get_distinguished_name___200: - description: Show nodesDn setting for given cluster. + description: Show `nodesDn` setting for given cluster. content: application/json: schema: @@ -30427,7 +30807,7 @@ components: $ref: '#/components/schemas/security._common___DistinguishedNamesMap' description: '' security.get_distinguished_names___400: - description: Show nodesDn setting for given cluster. + description: Show `nodesDn` setting for given cluster. content: application/json: schema: @@ -31422,6 +31802,7 @@ components: type: object properties: size_in_bytes: + description: The total amount, in bytes, of memory used for completion across all shards assigned to the selected nodes. $ref: '#/components/schemas/_common___ByteCount' size: $ref: '#/components/schemas/_common___HumanReadableByteCount' @@ -31551,7 +31932,7 @@ components: description: |- A duration. Units can be `nanos`, `micros`, `ms` (milliseconds), `s` (seconds), `m` (minutes), `h` (hours) and `d` (days). Also accepts "0" without a unit and "-1" to indicate an unspecified value. - pattern: ^([0-9\.]+)(?:d|h|m|s|ms|micros|nanos)$ + pattern: ^(?:(-1)|([0-9\.]+)(?:d|h|m|s|ms|micros|nanos))$ type: string _common___DurationLarge: description: 'A date histogram interval, similar to `Duration`, with support for additional units: `w` (week), `M` (month), `q` (quarter), and `y` (year).' @@ -31877,7 +32258,7 @@ components: type: string _common___HumanReadableByteCount: type: string - pattern: \d+(\.\d+)?(b|kb|k|mb|m|gb|g|tb|t|pb|p) + pattern: (?:(-1)|(0)|\d+(\.\d+)?(b|kb|k|mb|m|gb|g|tb|t|pb|p)) _common___IBDistribution: type: string enum: @@ -32230,7 +32611,7 @@ components: - master deprecated: true x-version-deprecated: '2.0' - x-deprecation-message: Use 'cluster_manager' instead. + x-deprecation-message: Use `cluster_manager` instead. - type: string enum: - cluster_manager @@ -32430,6 +32811,7 @@ components: memory_size: $ref: '#/components/schemas/_common___HumanReadableByteCount' memory_size_in_bytes: + description: The total amount, in bytes, of memory used for the query cache across all shards assigned to the selected nodes. $ref: '#/components/schemas/_common___ByteCount' miss_count: description: The total number of query cache misses across all shards assigned to the selected nodes. @@ -32475,11 +32857,13 @@ components: - current_as_target - throttle_time_in_millis _common___Refresh: - type: string - enum: - - 'false' - - 'true' - - wait_for + oneOf: + - type: boolean + - type: string + enum: + - 'false' + - 'true' + - wait_for _common___RefreshStats: type: object properties: @@ -32517,10 +32901,13 @@ components: description: Statistics related to downloads to the remote segment store. properties: total_download_size: + description: The total amount of data downloaded from the remote segment store. $ref: '#/components/schemas/_common___RemoteStoreUploadDownloadStats' total_time_spent: + description: The total amount of time spent on downloads from the remote segment store. $ref: '#/components/schemas/_common___Duration' total_time_spent_in_millis: + description: The total duration, in milliseconds, spent on downloads from the remote segment store. $ref: '#/components/schemas/_common___DurationValueUnitMillis' required: - total_download_size @@ -32559,16 +32946,22 @@ components: description: The total amount of data uploaded to the remote translog store. properties: failed: + description: The number of bytes that failed to upload to the remote translog store. $ref: '#/components/schemas/_common___HumanReadableByteCount' failed_bytes: + description: The number of bytes that failed to upload to the remote translog store. $ref: '#/components/schemas/_common___ByteCount' started: + description: The number of bytes successfully uploaded to the remote translog store. $ref: '#/components/schemas/_common___HumanReadableByteCount' started_bytes: + description: The number of bytes successfully uploaded to the remote translog store. $ref: '#/components/schemas/_common___ByteCount' succeeded: + description: The number of bytes successfully uploaded to the remote translog store. $ref: '#/components/schemas/_common___HumanReadableByteCount' succeeded_bytes: + description: The number of bytes successfully uploaded to the remote translog store. $ref: '#/components/schemas/_common___ByteCount' required: - failed_bytes @@ -32596,16 +32989,22 @@ components: description: The amount of data, in bytes, uploaded or downloaded to/from the remote segment store. properties: failed: + description: The number of bytes that failed to upload to/from the remote segment store. $ref: '#/components/schemas/_common___HumanReadableByteCount' failed_bytes: + description: The number of bytes that failed to upload to/from the remote segment store. $ref: '#/components/schemas/_common___ByteCount' started: + description: The number of bytes to upload/download to/from the remote segment store after the upload/download has started. $ref: '#/components/schemas/_common___HumanReadableByteCount' started_bytes: + description: The number of bytes to upload/download to/from the remote segment store after the upload/download has started. $ref: '#/components/schemas/_common___ByteCount' succeeded: + description: The number of bytes successfully uploaded/downloaded to/from the remote segment store. $ref: '#/components/schemas/_common___HumanReadableByteCount' succeeded_bytes: + description: The number of bytes successfully uploaded/downloaded to/from the remote segment store. $ref: '#/components/schemas/_common___ByteCount' required: - failed_bytes @@ -32625,12 +33024,16 @@ components: description: The amount of lag during upload between the remote segment store and the local store. properties: max: + description: The maximum amount of lag, in bytes, during the upload refresh between the remote segment store and the local store. $ref: '#/components/schemas/_common___HumanReadableByteCount' max_bytes: + description: The maximum amount of lag, in bytes, during the upload refresh between the remote segment store and the local store. $ref: '#/components/schemas/_common___ByteCount' total: + description: The total number of bytes that lagged during the upload refresh between the remote segment store and the local store. $ref: '#/components/schemas/_common___HumanReadableByteCount' total_bytes: + description: The total number of bytes that lagged during the upload refresh between the remote segment store and the local store. $ref: '#/components/schemas/_common___ByteCount' required: - max_bytes @@ -32640,16 +33043,20 @@ components: description: Statistics related to uploads to the remote segment store. properties: max_refresh_time_lag: + description: The maximum duration that the remote refresh is behind the local refresh. $ref: '#/components/schemas/_common___Duration' max_refresh_time_lag_in_millis: + description: The maximum duration, in milliseconds, that the remote refresh is behind the local refresh. $ref: '#/components/schemas/_common___DurationValueUnitMillis' pressure: $ref: '#/components/schemas/_common___RemoteStoreUploadPressureStats' refresh_size_lag: $ref: '#/components/schemas/_common___RemoteStoreUploadRefreshSizeLagStats' total_time_spent: + description: The total amount of time spent on uploads to the remote segment store. $ref: '#/components/schemas/_common___Duration' total_time_spent_in_millis: + description: The total amount of time, in milliseconds, spent on uploads to the remote segment store. $ref: '#/components/schemas/_common___DurationValueUnitMillis' total_upload_size: $ref: '#/components/schemas/_common___RemoteStoreUploadDownloadStats' @@ -32828,8 +33235,10 @@ components: description: The number of currently running shard query operations. type: number query_time: + description: The total amount of time taken to complete all shard query operations. $ref: '#/components/schemas/_common___Duration' query_time_in_millis: + description: The total amount of time taken to complete all shard query operations, in milliseconds. $ref: '#/components/schemas/_common___DurationValueUnitMillis' query_total: description: The total number of shard query operations. @@ -32840,6 +33249,7 @@ components: concurrent_query_time: $ref: '#/components/schemas/_common___Duration' concurrent_query_time_in_millis: + description: The total amount of time taken by all query operations using concurrent segment search, in milliseconds. $ref: '#/components/schemas/_common___DurationValueUnitMillis' concurrent_query_current: description: The number of currently running query operations using concurrent segment search. @@ -32851,8 +33261,10 @@ components: description: The number of currently running shard fetch operations. type: number fetch_time: + description: The total amount of time taken to complete all shard fetch operations. $ref: '#/components/schemas/_common___Duration' fetch_time_in_millis: + description: The total amount of time taken to complete all shard fetch operations, in milliseconds. $ref: '#/components/schemas/_common___DurationValueUnitMillis' fetch_total: description: The total number of shard fetch operations. @@ -32861,8 +33273,10 @@ components: description: The number of shard scroll operations that are currently running. type: number scroll_time: + description: The total amount of time taken to complete all shard scroll operations. $ref: '#/components/schemas/_common___Duration' scroll_time_in_millis: + description: The total amount of time taken to complete all shard scroll operations, in milliseconds. $ref: '#/components/schemas/_common___DurationValueUnitMillis' scroll_total: description: The total number of shard scroll operations. @@ -32873,6 +33287,7 @@ components: point_in_time_time: $ref: '#/components/schemas/_common___Duration' point_in_time_time_in_millis: + description: The amount of time that shard PIT contexts have been held open since the node last restarted, in milliseconds. $ref: '#/components/schemas/_common___DurationValueUnitMillis' point_in_time_current: description: The number of currently open shard PIT contexts. @@ -32881,8 +33296,10 @@ components: description: The number of currently running shard suggest operations. type: number suggest_time: + description: The total amount of time take to complete all shard suggest operations. $ref: '#/components/schemas/_common___Duration' suggest_time_in_millis: + description: The total amount of time taken to complete all shard suggest operations, in milliseconds. $ref: '#/components/schemas/_common___DurationValueUnitMillis' suggest_total: description: The total number of shard suggest operations. @@ -32938,6 +33355,7 @@ components: doc_values_memory: $ref: '#/components/schemas/_common___HumanReadableByteCount' doc_values_memory_in_bytes: + description: The total amount, in bytes, of memory used for document values across all shards assigned to the selected nodes. $ref: '#/components/schemas/_common___ByteCount' file_sizes: description: |- @@ -32949,43 +33367,59 @@ components: fixed_bit_set: $ref: '#/components/schemas/_common___HumanReadableByteCount' fixed_bit_set_memory_in_bytes: + description: The total amount of memory, in bytes, used by fixed bit sets across all shards assigned to the selected nodes. $ref: '#/components/schemas/_common___ByteCount' index_writer_memory: $ref: '#/components/schemas/_common___HumanReadableByteCount' index_writer_max_memory_in_bytes: $ref: '#/components/schemas/_common___ByteCount' index_writer_memory_in_bytes: + description: The total amount, in bytes, of memory used by all index writers across all shards assigned to the selected nodes. $ref: '#/components/schemas/_common___ByteCount' max_unsafe_auto_id_timestamp: description: The Unix timestamp, in milliseconds, of the most recently retried indexing request. type: number memory: + description: The total amount of memory used for segments across all shards assigned to the selected nodes. $ref: '#/components/schemas/_common___HumanReadableByteCount' memory_in_bytes: + description: The total amount, in bytes, of memory used for segments across all shards assigned to the selected nodes. $ref: '#/components/schemas/_common___ByteCount' norms_memory: + description: The total amount of memory used for normalization factors across all shards assigned to the selected nodes. $ref: '#/components/schemas/_common___HumanReadableByteCount' norms_memory_in_bytes: + description: The total amount, in bytes, of memory used for normalization factors across all shards assigned to the selected nodes. $ref: '#/components/schemas/_common___ByteCount' points_memory: + description: The total amount of memory used for points across all shards assigned to the selected nodes. $ref: '#/components/schemas/_common___HumanReadableByteCount' points_memory_in_bytes: + description: The total amount, in bytes, of memory used for points across all shards assigned to the selected nodes. $ref: '#/components/schemas/_common___ByteCount' stored_fields_memory: + description: The total amount of memory used for stored fields across all shards assigned to the selected nodes. $ref: '#/components/schemas/_common___HumanReadableByteCount' stored_fields_memory_in_bytes: + description: The total amount, in bytes, of memory used for stored fields across all shards assigned to the selected nodes. $ref: '#/components/schemas/_common___ByteCount' terms_memory: + description: The total amount of memory used for terms across all shards assigned to the selected nodes. $ref: '#/components/schemas/_common___HumanReadableByteCount' terms_memory_in_bytes: + description: The total amount, in bytes, of memory used for terms across all shards assigned to the selected nodes. $ref: '#/components/schemas/_common___ByteCount' term_vectors_memory: + description: The total amount of memory used for term vectors across all shards assigned to the selected nodes. $ref: '#/components/schemas/_common___HumanReadableByteCount' term_vectors_memory_in_bytes: + description: The total amount, in bytes, of memory used for term vectors across all shards assigned to the selected nodes. $ref: '#/components/schemas/_common___ByteCount' version_map_memory: + description: The total amount of memory used by all version maps across all shards assigned to the selected nodes. $ref: '#/components/schemas/_common___HumanReadableByteCount' version_map_memory_in_bytes: + description: The total amount, in bytes, of memory used by all version maps across all shards assigned to the selected nodes. $ref: '#/components/schemas/_common___ByteCount' remote_store: $ref: '#/components/schemas/_common___RemoteStoreStats' @@ -33150,15 +33584,17 @@ components: size: $ref: '#/components/schemas/_common___HumanReadableByteCount' size_in_bytes: + description: The total size, in bytes, of all shards assigned to the selected nodes. $ref: '#/components/schemas/_common___ByteCount' reserved: $ref: '#/components/schemas/_common___HumanReadableByteCount' reserved_in_bytes: + description: A prediction, in bytes, of how much larger the shard stores will eventually grow due to ongoing peer recoveries, restoring snapshots, and similar activities. $ref: '#/components/schemas/_common___ByteCount' required: - reserved_in_bytes - size_in_bytes - _common___Stringifiedboolean: + _common___StringifiedBoolean: description: |- Certain APIs may return values, including numbers such as epoch timestamps, as strings. This setting captures this behavior while keeping the semantics of the field type. @@ -33168,6 +33604,11 @@ components: oneOf: - type: boolean - type: string + _common___StringifiedDouble: + oneOf: + - type: number + format: double + - type: string _common___StringifiedEpochTimeUnitMillis: description: |- Certain APIs may return values, including numbers such as epoch timestamps, as strings. This setting captures @@ -33188,7 +33629,7 @@ components: oneOf: - $ref: '#/components/schemas/_common___EpochTimeUnitSeconds' - type: string - _common___Stringifiedinteger: + _common___StringifiedInteger: description: |- Certain APIs may return values, including numbers such as epoch timestamps, as strings. This setting captures this behavior while keeping the semantics of the field type. @@ -33198,6 +33639,11 @@ components: oneOf: - type: integer - type: string + _common___StringifiedLong: + oneOf: + - type: integer + format: int64 + - type: string _common___StringifiedVersionNumber: description: |- Certain APIs may return values, including numbers such as epoch timestamps, as strings. This setting captures @@ -33909,7 +34355,7 @@ components: doc_count: description: |- The total number of documents that initially created the expectations. It's required to be greater - than or equal to the sum of all values in the buckets_path as this is the originating superset of data + than or equal to the sum of all values in the `buckets_path` as this is the originating superset of data to which the term values are correlated. type: number expectations: @@ -33922,7 +34368,7 @@ components: fractions: description: |- An array of fractions to use when averaging and calculating variance. This should be used if - the pre-calculated data and the buckets_path have known gaps. The length of fractions, if provided, + the pre-calculated data and the `buckets_path` have known gaps. The length of fractions, if provided, must equal expectations. type: array items: @@ -34177,7 +34623,7 @@ components: _common.aggregations___BucketsPath: description: |- Buckets path can be expressed in different ways, and an aggregation may accept some or all of these - forms depending on its type. Please refer to each aggregation's documentation to know what buckets + forms depending on its type. Refer to each aggregation's documentation to know what buckets path forms they accept. oneOf: - type: string @@ -34326,7 +34772,7 @@ components: $ref: '#/components/schemas/_common___Field' max_unique_tokens: description: |- - The maximum number of unique tokens at any position up to max_matched_tokens. Must be larger than 1. + The maximum number of unique tokens at any position up to `max_matched_tokensg`. Must be larger than 1. Smaller values use less memory and create fewer categories. Larger values will use more memory and create narrower categories. Max allowed value is 100. type: number @@ -34346,10 +34792,10 @@ components: This property expects an array of regular expressions. The expressions are used to filter out matching sequences from the categorization field values. You can use this functionality to fine tune the categorization by excluding sequences from consideration when categories are defined. For example, you can exclude SQL - statements that appear in your log files. This property cannot be used at the same time as categorization_analyzer. + statements that appear in your log files. This property cannot be used at the same time as `categorization_analyzer`. If you only want to define simple regular expression filters that are applied prior to tokenization, setting this property is the easiest method. If you also want to customize the tokenizer or post-tokenization filtering, - use the categorization_analyzer property instead and include the filters as pattern_replace character filters. + use the `categorization_analyzer` property instead and include the filters as `pattern_replace` character filters. type: array items: type: string @@ -34406,13 +34852,13 @@ components: description: Specifies the maximum number of feature importance values per document. type: number prediction_field_type: - description: 'Specifies the type of the predicted field to write. Acceptable values are: string, number, boolean. When boolean is provided 1.0 is transformed to true and 0.0 to false.' + description: 'Specifies the type of the predicted field to write. Acceptable values are: string, number, Boolean. When Boolean is provided 1.0 is transformed to true and 0.0 to false.' type: string results_field: - description: The field that is added to incoming documents to contain the inference prediction. Defaults to predicted_value. + description: The field that is added to incoming documents to contain the inference prediction. Defaults to `predicted_value`. type: string top_classes_results_field: - description: Specifies the field to which the top classes are written. Defaults to top_classes. + description: Specifies the field to which the top classes are written. Defaults to `top_classes`. type: string _common.aggregations___CompositeAggregate: allOf: @@ -35023,7 +35469,7 @@ components: precision: description: |- Integer zoom of the key used to defined cells or buckets - in the results. Value should be between 0-15. + in the results. Value should be between 0 and 15. type: number bounds: $ref: '#/components/schemas/_common___GeoBounds' @@ -36117,7 +36563,7 @@ components: to_as_string: type: string key: - description: The bucket key. Present if the aggregation is _not_ keyed + description: The bucket key. Present if the aggregation is not keyed. type: string _common.aggregations___RareTermsAggregation: allOf: @@ -36395,7 +36841,7 @@ components: $ref: '#/components/schemas/_common.aggregations___ScriptedHeuristic' shard_min_doc_count: description: |- - Regulates the certainty a shard has if the values should actually be added to the candidate list or not with respect to the min_doc_count. + Regulates the certainty a shard has if the values should actually be added to the candidate list or not with respect to the `min_doc_count`. Values will only be considered if their local shard frequency within the set is higher than the `shard_min_doc_count`. type: number shard_size: @@ -37081,7 +37527,7 @@ components: enum: - asciifolding preserve_original: - $ref: '#/components/schemas/_common___Stringifiedboolean' + $ref: '#/components/schemas/_common___StringifiedBoolean' required: - type _common.analysis___CharFilter: @@ -37300,7 +37746,7 @@ components: side: $ref: '#/components/schemas/_common.analysis___EdgeNGramSide' preserve_original: - $ref: '#/components/schemas/_common___Stringifiedboolean' + $ref: '#/components/schemas/_common___StringifiedBoolean' required: - type _common.analysis___EdgeNGramTokenizer: @@ -37343,7 +37789,7 @@ components: articles_path: type: string articles_case: - $ref: '#/components/schemas/_common___Stringifiedboolean' + $ref: '#/components/schemas/_common___StringifiedBoolean' required: - type _common.analysis___FingerprintAnalyzer: @@ -37894,7 +38340,7 @@ components: consume_all_tokens: type: boolean max_token_count: - $ref: '#/components/schemas/_common___Stringifiedinteger' + $ref: '#/components/schemas/_common___StringifiedInteger' required: - type _common.analysis___LowercaseNormalizer: @@ -37961,7 +38407,7 @@ components: items: type: string preserve_original: - $ref: '#/components/schemas/_common___Stringifiedboolean' + $ref: '#/components/schemas/_common___StringifiedBoolean' required: - filters - type @@ -37979,7 +38425,7 @@ components: min_gram: type: integer preserve_original: - $ref: '#/components/schemas/_common___Stringifiedboolean' + $ref: '#/components/schemas/_common___StringifiedBoolean' required: - type _common.analysis___NGramTokenizer: @@ -38084,15 +38530,15 @@ components: enum: - path_hierarchy buffer_size: - $ref: '#/components/schemas/_common___Stringifiedinteger' + $ref: '#/components/schemas/_common___StringifiedInteger' delimiter: type: string replacement: type: string reverse: - $ref: '#/components/schemas/_common___Stringifiedboolean' + $ref: '#/components/schemas/_common___StringifiedBoolean' skip: - $ref: '#/components/schemas/_common___Stringifiedinteger' + $ref: '#/components/schemas/_common___StringifiedInteger' required: - buffer_size - delimiter @@ -38133,7 +38579,7 @@ components: items: type: string preserve_original: - $ref: '#/components/schemas/_common___Stringifiedboolean' + $ref: '#/components/schemas/_common___StringifiedBoolean' required: - patterns - type @@ -38545,7 +38991,7 @@ components: - type _common.analysis___StopWords: description: |- - Language value, such as _arabic_ or _thai_. Defaults to _english_. + Language value, such as `arabic` or `thai`. Defaults to `english`. Each language value corresponds to a predefined list of stop words in Lucene. See Stop words by language for supported language values and their stop words. Also accepts an array of stop words. oneOf: @@ -38827,7 +39273,7 @@ components: ignore_keywords: type: boolean preserve_original: - $ref: '#/components/schemas/_common___Stringifiedboolean' + $ref: '#/components/schemas/_common___StringifiedBoolean' protected_words: type: array items: @@ -38868,7 +39314,7 @@ components: generate_word_parts: type: boolean preserve_original: - $ref: '#/components/schemas/_common___Stringifiedboolean' + $ref: '#/components/schemas/_common___StringifiedBoolean' protected_words: type: array items: @@ -40091,8 +40537,8 @@ components: $ref: '#/components/schemas/_common.query_dsl___QueryContainer' adjust_pure_negative: description: |- - Ensures correct behavior when a query contains only must_not clauses. - By default set to true, OpenSearch adds a match-all clause to ensure results are returned from Lucene, with the must_not conditions applied as filters. + Ensures correct behavior when a query contains only `must_not` clauses. + By default set to true, OpenSearch adds a match-all clause to ensure results are returned from Lucene, with the `must_not` conditions applied as filters. If set to false, the query may return no results, as Lucene typically requires at least one positive condition. type: boolean default: true @@ -40142,7 +40588,7 @@ components: The `combined_fields` query analyzes the provided text before performing a search. type: string auto_generate_synonyms_phrase_query: - description: If true, match phrase queries are automatically created for multi-term synonyms. + description: If `true`, match phrase queries are automatically created for multi-term synonyms. type: boolean operator: $ref: '#/components/schemas/_common.query_dsl___CombinedFieldsOperator' @@ -40419,7 +40865,7 @@ components: rewrite: $ref: '#/components/schemas/_common___MultiTermQueryRewrite' transpositions: - description: Indicates whether edits include transpositions of two adjacent characters (for example `ab` to `ba`). + description: Indicates whether edits include transpositions of two adjacent characters (for example, `ab` to `ba`). type: boolean fuzziness: $ref: '#/components/schemas/_common___Fuzziness' @@ -40524,6 +40970,7 @@ components: properties: ignore_unmapped: $ref: '#/components/schemas/_common.query_dsl___IgnoreUnmapped' + description: Indicates whether to ignore an unmapped `type` and not return any documents instead of an error. inner_hits: $ref: '#/components/schemas/_core.search___InnerHits' max_children: @@ -40554,6 +41001,9 @@ components: properties: ignore_unmapped: $ref: '#/components/schemas/_common.query_dsl___IgnoreUnmapped' + description: |- + Indicates whether to ignore an unmapped `parent_type` and not return any documents instead of an error. + You can use this parameter to query multiple indexes that may not contain the `parent_type`. inner_hits: $ref: '#/components/schemas/_core.search___InnerHits' parent_type: @@ -40906,7 +41356,7 @@ components: type: integer format: int32 query: - description: Text, number, boolean value or date you wish to find in the provided field. + description: Text, number, Boolean value or date you wish to find in the provided field. oneOf: - type: string - type: number @@ -41044,7 +41494,7 @@ components: type: integer format: int32 query: - description: Text, number, boolean value or date you wish to find in the provided field. + description: Text, number, Boolean value or date you wish to find in the provided field. type: string slop: description: Maximum number of positions allowed between matching tokens. @@ -41074,6 +41524,7 @@ components: properties: ignore_unmapped: $ref: '#/components/schemas/_common.query_dsl___IgnoreUnmapped' + description: Indicates whether to ignore an unmapped path and not return any documents instead of an error. inner_hits: $ref: '#/components/schemas/_core.search___InnerHits' path: @@ -41156,6 +41607,7 @@ components: $ref: '#/components/schemas/_common___Id' ignore_unmapped: $ref: '#/components/schemas/_common.query_dsl___IgnoreUnmapped' + description: Indicates whether to ignore an unmapped `type` and not return any documents instead of an error. type: $ref: '#/components/schemas/_common___RelationName' _common.query_dsl___PercolateQuery: @@ -41315,7 +41767,7 @@ components: $ref: '#/components/schemas/_common.query_dsl___KnnQuery' match: description: |- - Returns documents that match a provided text, number, date or boolean value. + Returns documents that match a provided text, number, date or Boolean value. The provided text is analyzed before matching. type: object additionalProperties: @@ -41427,7 +41879,7 @@ components: term: description: |- Returns documents that contain an exact term in a provided field. - To return a document, the query term must exactly match the queried field's value, including whitespace and capitalization. + To return a document, the query term must exactly match the queried field's value, including white space and capitalization. type: object additionalProperties: anyOf: @@ -41436,11 +41888,12 @@ components: minProperties: 1 maxProperties: 1 terms: + description: Returns documents that contain one or more exact terms in a provided field. $ref: '#/components/schemas/_common.query_dsl___TermsQueryField' terms_set: description: |- Returns documents that contain a minimum number of exact terms in a provided field. - To return a document, a required number of terms must exactly match the field values, including whitespace and capitalization. + To return a document, a required number of terms must exactly match the field values, including white space and capitalization. type: object additionalProperties: $ref: '#/components/schemas/_common.query_dsl___TermsSetQuery' @@ -41456,7 +41909,7 @@ components: type: $ref: '#/components/schemas/_common.query_dsl___TypeQuery' weighted_tokens: - description: Supports returning text_expansion query results by sending in precomputed tokens with the query. + description: Supports returning `text_expansion` query results by sending in precomputed tokens with the query. type: object additionalProperties: $ref: '#/components/schemas/_common.query_dsl___WeightedTokensQuery' @@ -41733,7 +42186,7 @@ components: - SLOP - WHITESPACE _common.query_dsl___SimpleQueryStringFlags: - description: Query flags can be either a single flag or a combination of flags, e.g. `OR|AND|PREFIX`. + description: Query flags can be either a single flag or a combination of flags (e.g. `OR|AND|PREFIX`). allOf: - $ref: '#/components/schemas/_common___PipeSeparatedFlagsSimpleQueryStringFlag' _common.query_dsl___SimpleQueryStringQuery: @@ -41748,7 +42201,7 @@ components: description: If `true`, the query attempts to analyze wildcard terms in the query string. type: boolean auto_generate_synonyms_phrase_query: - description: If `true`, the parser creates a match_phrase query for each multi-position token. + description: If `true`, the parser creates a `match_phrase` query for each multi-position token. type: boolean default_operator: $ref: '#/components/schemas/_common.query_dsl___Operator' @@ -41826,7 +42279,7 @@ components: - end - match _common.query_dsl___SpanGapQuery: - description: Can only be used as a clause in a span_near query. + description: Can only be used as a clause in a `span_near` query. type: object additionalProperties: type: integer @@ -42251,14 +42704,14 @@ components: properties: detect_noop: description: |- - When `false` disables the setting 'result' in the response - to 'noop' if no change to the document occurred. + When `false` disables the setting `result` in the response + to `noop` if no change to the document occurred. type: boolean doc: description: A partial update to an existing document. type: object doc_as_upsert: - description: When `true`, uses the contents of 'doc' as the value of 'upsert'. + description: When `true`, uses the contents of `doc` as the value of `upsert`. type: boolean script: $ref: '#/components/schemas/_common___Script' @@ -42269,8 +42722,8 @@ components: $ref: '#/components/schemas/_core.search___SourceConfig' upsert: description: |- - If the document does not already exist, the contents of 'upsert' are inserted as a - new document. If the document exists, the 'script' is executed. + If the document does not already exist, the contents of `upsert` are inserted as a + new document. If the document exists, the `script` is executed. type: object _core.bulk___UpdateOperation: allOf: @@ -42338,7 +42791,7 @@ components: items: $ref: '#/components/schemas/_core.explain___ExplanationDetail' value: - oneOf: + anyOf: - type: integer format: int32 - type: integer @@ -42515,7 +42968,7 @@ components: type: boolean source: description: |- - An inline search template that supports the same parameters as the Search API's + An inline search template that supports the same parameters as the Search API request body and Mustache variables. If no `id` is specified, this parameter is required. type: string @@ -42548,7 +43001,7 @@ components: items: $ref: '#/components/schemas/_common.query_dsl___FieldAndFormat' knn: - description: Defines the approximate kNN search to run. + description: Defines the approximate k-NN search to run. oneOf: - $ref: '#/components/schemas/_common.query_dsl___KnnQuery' - type: array @@ -44114,7 +44567,8 @@ components: type: number max_word_length: description: |- - The maximum word length above which words will be ignored. + The maximum word length. + Words longer than this value will be ignored. Default is `unbounded`. type: number min_doc_freq: @@ -44124,7 +44578,10 @@ components: description: Ignore words with less than this frequency in the source doc. type: number min_word_length: - description: The minimum word length below which words will be ignored. + description: |- + The minimum word length. + Words shorter than this value will be ignored. + Default is 0. type: number _core.termvectors___Term: type: object @@ -44238,7 +44695,7 @@ components: collapse: $ref: '#/components/schemas/_core.search___FieldCollapse' explain: - description: If true, returns detailed information about score computation as part of a hit. + description: If `true`, returns detailed information about score computation as part of a hit. type: boolean ext: description: Configuration of search extensions defined by OpenSearch plugins. @@ -44333,10 +44790,10 @@ components: Defaults to no timeout. type: string track_scores: - description: If true, calculate and return document scores, even if the scores are not used for sorting. + description: If `true`, calculate and return document scores, even if the scores are not used for sorting. type: boolean version: - description: If true, returns document version as part of a hit. + description: If `true`, returns document version as part of a hit. type: boolean seq_no_primary_term: description: If `true`, returns sequence number and primary term of the last modification of each hit. @@ -44529,10 +44986,10 @@ components: description: node id type: string host: - description: host name + description: hostname type: string ip: - description: ip address + description: IP address type: string node: description: node name @@ -44554,10 +45011,10 @@ components: description: node id type: string host: - description: host name + description: hostname type: string ip: - description: ip address + description: IP address type: string node: description: node name @@ -44609,6 +45066,7 @@ components: description: wait time of longest task pending type: string active_shards_percent: + description: active number of shards in percent $ref: '#/components/schemas/_common___PercentageString' discovered_cluster_manager: description: cluster manager is discovered or not @@ -44630,7 +45088,7 @@ components: description: index name type: string uuid: - description: index uuid + description: index UUID type: string pri: description: number of primary shards @@ -44655,7 +45113,7 @@ components: description: index creation date (as string) type: string store.size: - description: store size of primaries & replicas + description: store size of primaries and replicas type: - 'null' - string @@ -44675,22 +45133,22 @@ components: - 'null' - string fielddata.memory_size: - description: used fielddata cache + description: used field data cache type: - 'null' - string pri.fielddata.memory_size: - description: used fielddata cache + description: used field data cache type: - 'null' - string fielddata.evictions: - description: fielddata evictions + description: field data evictions type: - 'null' - string pri.fielddata.evictions: - description: fielddata evictions + description: field data evictions type: - 'null' - string @@ -45231,12 +45689,12 @@ components: - 'null' - string segments.fixed_bitset_memory: - description: memory used by fixed bit sets for nested object field types and export type filters for types referred in _parent fields + description: memory used by fixed bit sets for nested object field types and export type filters for types referred in `_parent` fields type: - 'null' - string pri.segments.fixed_bitset_memory: - description: memory used by fixed bit sets for nested object field types and export type filters for types referred in _parent fields + description: memory used by fixed bit sets for nested object field types and export type filters for types referred in `_parent` fields type: - 'null' - string @@ -45316,10 +45774,10 @@ components: description: node id type: string host: - description: host name + description: hostname type: string ip: - description: ip address + description: IP address type: string node: description: node name @@ -45337,7 +45795,7 @@ components: description: The process identifier. type: string host: - description: The host name. + description: The hostname. type: string ip: description: The IP address. @@ -45446,21 +45904,21 @@ components: type: string master: description: |- - Indicates whether the node is the elected master node. - Returned values include `*`(elected master) and `-`(not elected master). + Indicates whether the node is the elected cluster-manager node. + Returned values include `*`(elected cluster manager) and `-`(not elected cluster manager). type: string x-version-deprecated: '2.0' - x-deprecation-message: To promote inclusive language, use 'cluster_manager' instead. + x-deprecation-message: To promote inclusive language, use `cluster_manager` instead. name: $ref: '#/components/schemas/_common___Name' completion.size: description: The size of completion. type: string fielddata.memory_size: - description: The used fielddata cache. + description: The used field data cache. type: string fielddata.evictions: - description: The fielddata evictions. + description: The field data evictions. type: string query_cache.memory_size: description: The used query cache. @@ -45636,7 +46094,7 @@ components: description: The memory used by the version map. type: string segments.fixed_bitset_memory: - description: The memory used by fixed bit sets for nested object field types and export type filters for types referred in _parent fields. + description: The memory used by fixed bit sets for nested object field types and export type filters for types referred in `_parent` fields. type: string suggest.current: description: The number of current suggest operations. @@ -45939,12 +46397,12 @@ components: - 'null' - string fielddata.memory_size: - description: The used fielddata cache memory. + description: The used field data cache memory. type: - 'null' - string fielddata.evictions: - description: The fielddata cache evictions. + description: The field data cache evictions. type: - 'null' - string @@ -46399,7 +46857,7 @@ components: description: The process identifier. type: string host: - description: The host name for the current node. + description: The hostname for the current node. type: string ip: description: The IP address for the current node. @@ -46781,11 +47239,11 @@ components: description: The number of shards whose allocation has been delayed by the timeout settings. type: number discovered_master: - description: True if the master node has been discovered. + description: True if the cluster-manager node has been discovered. type: boolean x-version-deprecated: '2.0' discovered_cluster_manager: - description: True if the cluster manager node has been discovered. + description: True if the cluster-manager node has been discovered. type: boolean x-version-added: '2.0' indices: @@ -46817,7 +47275,7 @@ components: task_max_waiting_in_queue_millis: $ref: '#/components/schemas/_common___DurationValueUnitMillis' timed_out: - description: If false the response returned within the period of time that is specified by the timeout parameter (30s by default). + description: If `false` the response returned within the period of time that is specified by the timeout parameter (`30s` by default). type: boolean unassigned_shards: description: The number of shards that are not allocated. @@ -47015,7 +47473,7 @@ components: node: type: string accept_data_loss: - description: If a node which has a copy of the data rejoins the cluster later on, that data will be deleted. To ensure that these implications are well-understood, this command requires the flag accept_data_loss to be explicitly set to true + description: If a node which has a copy of the data rejoins the cluster later on, that data will be deleted. To ensure that these implications are well-understood, this command requires the flag `accept_data_loss` to be explicitly set to `true`. type: boolean required: - accept_data_loss @@ -47196,21 +47654,35 @@ components: type: object properties: available: + description: |- + Total number of bytes available to JVM in file stores across all selected nodes. + Depending on operating system or process-level restrictions, this number may be less than `nodes.fs.free_in_byes`. + This is the actual amount of free disk space the selected OpenSearch nodes can use. $ref: '#/components/schemas/_common___HumanReadableByteCount' available_in_bytes: + description: |- + Total number of bytes available to JVM in file stores across all selected nodes. + Depending on operating system or process-level restrictions, this number may be less than `nodes.fs.free_in_byes`. + This is the actual amount of free disk space the selected OpenSearch nodes can use. $ref: '#/components/schemas/_common___ByteCount' free: + description: Total number of unallocated bytes in file stores across all selected nodes. $ref: '#/components/schemas/_common___HumanReadableByteCount' free_in_bytes: + description: Total number of unallocated bytes in file stores across all selected nodes. $ref: '#/components/schemas/_common___ByteCount' total: + description: Total size, of all file stores across all selected nodes. $ref: '#/components/schemas/_common___HumanReadableByteCount' total_in_bytes: + description: Total size, in bytes, of all file stores across all selected nodes. $ref: '#/components/schemas/_common___ByteCount' cache_reserved: + description: Total size, of all cache reserved across all selected nodes. $ref: '#/components/schemas/_common___HumanReadableByteCount' x-version-added: '2.7' cache_reserved_in_bytes: + description: Total size, in bytes, of all cache reserved across all selected nodes. $ref: '#/components/schemas/_common___ByteCount' x-version-added: '2.7' required: @@ -47311,12 +47783,16 @@ components: type: object properties: heap_max: + description: Maximum amount of memory available for use by the heap across all selected nodes. $ref: '#/components/schemas/_common___HumanReadableByteCount' heap_max_in_bytes: + description: Maximum amount of memory, in bytes, available for use by the heap across all selected nodes. $ref: '#/components/schemas/_common___ByteCount' heap_used: + description: Memory currently in use by the heap across all selected nodes. $ref: '#/components/schemas/_common___HumanReadableByteCount' heap_used_in_bytes: + description: Memory, in bytes, currently in use by the heap across all selected nodes. $ref: '#/components/schemas/_common___ByteCount' required: - heap_max_in_bytes @@ -47535,6 +48011,9 @@ components: type: object properties: percent: + description: |- + Percentage of CPU used across all selected nodes. + Returns `-1` if not supported. $ref: '#/components/schemas/_common___PercentageNumber' required: - percent @@ -47606,13 +48085,13 @@ components: description: The number of indexes containing the field type in selected nodes. type: number indexed_vector_count: - description: For dense_vector field types, number of indexed vector types in selected nodes. + description: For `dense_vector` field types, number of indexed vector types in selected nodes. type: number indexed_vector_dim_max: - description: For dense_vector field types, the maximum dimension of all indexed vector types in selected nodes. + description: For `dense_vector` field types, the maximum dimension of all indexed vector types in selected nodes. type: number indexed_vector_dim_min: - description: For dense_vector field types, the minimum dimension of all indexed vector types in selected nodes. + description: For `dense_vector` field types, the minimum dimension of all indexed vector types in selected nodes. type: number script_count: description: The number of fields that declare a script. @@ -47630,7 +48109,7 @@ components: items: $ref: '#/components/schemas/cluster.stats___FieldTypes' total_field_count: - description: Total number of fields in all non-system indices. + description: Total number of fields in all non-system indexes. type: number total_deduplicated_field_count: description: Total number of fields in all non-system indexes, accounting for mapping deduplication. @@ -47638,6 +48117,7 @@ components: total_deduplicated_mapping_size: $ref: '#/components/schemas/_common___HumanReadableByteCount' total_deduplicated_mapping_size_in_bytes: + description: Total size of all mappings, in bytes, after deduplication and compression. $ref: '#/components/schemas/_common___ByteCount' required: - field_types @@ -47748,22 +48228,31 @@ components: type: object properties: adjusted_total_in_bytes: + description: Total amount, in bytes, of memory across all selected nodes, but using the value specified using the `es.total_memory_bytes` system property instead of measured total memory for those nodes where that system property was set. $ref: '#/components/schemas/_common___ByteCount' free: + description: Amount, in bytes, of free physical memory across all selected nodes. $ref: '#/components/schemas/_common___HumanReadableByteCount' free_in_bytes: + description: Amount, in bytes, of free physical memory across all selected nodes. $ref: '#/components/schemas/_common___ByteCount' free_percent: + description: Percentage of free physical memory across all selected nodes. $ref: '#/components/schemas/_common___PercentageNumber' total: + description: Total amount of physical memory across all selected nodes. $ref: '#/components/schemas/_common___HumanReadableByteCount' total_in_bytes: + description: Total amount, in bytes, of physical memory across all selected nodes. $ref: '#/components/schemas/_common___ByteCount' used: + description: Amount of physical memory in use across all selected nodes. $ref: '#/components/schemas/_common___HumanReadableByteCount' used_in_bytes: + description: Amount, in bytes, of physical memory in use across all selected nodes. $ref: '#/components/schemas/_common___ByteCount' used_percent: + description: Percentage of physical memory in use across all selected nodes. $ref: '#/components/schemas/_common___PercentageNumber' required: - free_in_bytes @@ -47854,7 +48343,7 @@ components: $ref: '#/components/schemas/flow_framework.common___version' workflows: type: object - description: A map of workflows. Presently, only the provision key is supported. The value for the workflow key is a key-value map that includes fields for user_params and lists of nodes and edges. + description: A map of workflows. Presently, only the provision key is supported. The value for the workflow key is a key-value map that includes fields for `user_params` and lists of nodes and edges. required: - name flow_framework.common___FlowFrameworkDeleteResponse: @@ -48250,7 +48739,7 @@ components: properties: error: type: string - description: Describes the resources that require the allow_delete parameter for deprovisioning + description: Describes the resources that require the `allow_delete` parameter for deprovisioning required: - error flow_framework.errors___DuplicateKeyError: @@ -48573,9 +49062,9 @@ components: level: type: string source: - type: integer + $ref: '#/components/schemas/_common___StringifiedInteger' reformat: - type: boolean + $ref: '#/components/schemas/_common___StringifiedBoolean' threshold: $ref: '#/components/schemas/indices._common___IndexingSlowlogThresholds' indices._common___IndexingSlowlogThresholds: @@ -48601,11 +49090,13 @@ components: $ref: '#/components/schemas/indices._common___IndexRoutingAllocationInitialRecovery' disk: $ref: '#/components/schemas/indices._common___IndexRoutingAllocationDisk' + total_shards_per_node: + $ref: '#/components/schemas/_common___StringifiedInteger' indices._common___IndexRoutingAllocationDisk: type: object properties: threshold_enabled: - $ref: '#/components/schemas/_common___Stringifiedboolean' + $ref: '#/components/schemas/_common___StringifiedBoolean' indices._common___IndexRoutingAllocationInclude: type: object properties: @@ -48666,15 +49157,15 @@ components: type: object properties: read_only: - $ref: '#/components/schemas/_common___Stringifiedboolean' + $ref: '#/components/schemas/_common___StringifiedBoolean' read_only_allow_delete: - $ref: '#/components/schemas/_common___Stringifiedboolean' + $ref: '#/components/schemas/_common___StringifiedBoolean' read: - $ref: '#/components/schemas/_common___Stringifiedboolean' + $ref: '#/components/schemas/_common___StringifiedBoolean' write: - $ref: '#/components/schemas/_common___Stringifiedboolean' + $ref: '#/components/schemas/_common___StringifiedBoolean' metadata: - $ref: '#/components/schemas/_common___Stringifiedboolean' + $ref: '#/components/schemas/_common___StringifiedBoolean' indices._common___IndexSettings: type: object description: The index settings to be updated. @@ -48696,31 +49187,27 @@ components: sort: $ref: '#/components/schemas/indices._common___IndexSegmentSort' number_of_shards: - oneOf: - - type: integer - - type: string + $ref: '#/components/schemas/_common___StringifiedInteger' number_of_replicas: - oneOf: - - type: integer - - type: string + $ref: '#/components/schemas/_common___StringifiedInteger' number_of_routing_shards: - type: integer + $ref: '#/components/schemas/_common___StringifiedInteger' check_on_startup: $ref: '#/components/schemas/indices._common___IndexCheckOnStartup' codec: type: string routing_partition_size: - $ref: '#/components/schemas/_common___Stringifiedinteger' + $ref: '#/components/schemas/_common___StringifiedInteger' load_fixed_bitset_filters_eagerly: - type: boolean + $ref: '#/components/schemas/_common___StringifiedBoolean' hidden: - $ref: '#/components/schemas/_common___Stringifiedboolean' + $ref: '#/components/schemas/_common___StringifiedBoolean' auto_expand_replicas: type: string merge: $ref: '#/components/schemas/indices._common___IndexSettingsMerge' merge.scheduler.max_thread_count: - $ref: '#/components/schemas/_common___Stringifiedinteger' + $ref: '#/components/schemas/_common___StringifiedInteger' search: $ref: '#/components/schemas/indices._common___IndexSettingsSearch' search.idle.after: @@ -48728,45 +49215,45 @@ components: refresh_interval: $ref: '#/components/schemas/_common___Duration' max_result_window: - type: integer + $ref: '#/components/schemas/_common___StringifiedInteger' max_inner_result_window: - type: integer + $ref: '#/components/schemas/_common___StringifiedInteger' max_rescore_window: - type: integer + $ref: '#/components/schemas/_common___StringifiedInteger' max_docvalue_fields_search: - type: integer + $ref: '#/components/schemas/_common___StringifiedInteger' max_script_fields: - type: integer + $ref: '#/components/schemas/_common___StringifiedInteger' max_ngram_diff: - type: integer + $ref: '#/components/schemas/_common___StringifiedInteger' max_shingle_diff: - type: integer + $ref: '#/components/schemas/_common___StringifiedInteger' blocks: $ref: '#/components/schemas/indices._common___IndexSettingBlocks' blocks.read_only: - $ref: '#/components/schemas/_common___Stringifiedboolean' + $ref: '#/components/schemas/_common___StringifiedBoolean' blocks.read_only_allow_delete: - $ref: '#/components/schemas/_common___Stringifiedboolean' + $ref: '#/components/schemas/_common___StringifiedBoolean' blocks.read: - $ref: '#/components/schemas/_common___Stringifiedboolean' + $ref: '#/components/schemas/_common___StringifiedBoolean' blocks.write: - $ref: '#/components/schemas/_common___Stringifiedboolean' + $ref: '#/components/schemas/_common___StringifiedBoolean' blocks.metadata: - $ref: '#/components/schemas/_common___Stringifiedboolean' + $ref: '#/components/schemas/_common___StringifiedBoolean' max_refresh_listeners: - type: integer + $ref: '#/components/schemas/_common___StringifiedInteger' analyze: $ref: '#/components/schemas/indices._common___IndexSettingsAnalyze' analyze.max_token_count: - $ref: '#/components/schemas/_common___Stringifiedinteger' + $ref: '#/components/schemas/_common___StringifiedInteger' highlight: $ref: '#/components/schemas/indices._common___IndexSettingsHighlight' highlight.max_analyzed_offset: - type: integer + $ref: '#/components/schemas/_common___StringifiedInteger' max_terms_count: - type: integer + $ref: '#/components/schemas/_common___StringifiedInteger' max_regex_length: - type: integer + $ref: '#/components/schemas/_common___StringifiedInteger' routing: $ref: '#/components/schemas/indices._common___IndexRouting' gc_deletes: @@ -48790,13 +49277,13 @@ components: version: $ref: '#/components/schemas/indices._common___IndexVersioning' verified_before_close: - $ref: '#/components/schemas/_common___Stringifiedboolean' + $ref: '#/components/schemas/_common___StringifiedBoolean' format: oneOf: - type: string - type: number max_slices_per_scroll: - type: integer + $ref: '#/components/schemas/_common___StringifiedInteger' translog: $ref: '#/components/schemas/indices._common___Translog' translog.durability: @@ -48806,13 +49293,13 @@ components: query_string: $ref: '#/components/schemas/indices._common___IndexSettingsQueryString' query_string.lenient: - $ref: '#/components/schemas/_common___Stringifiedboolean' + $ref: '#/components/schemas/_common___StringifiedBoolean' priority: oneOf: - type: number - type: string top_metrics_max_size: - type: integer + $ref: '#/components/schemas/_common___StringifiedInteger' analysis: $ref: '#/components/schemas/indices._common___IndexSettingsAnalysis' settings: @@ -48830,9 +49317,11 @@ components: store: $ref: '#/components/schemas/indices._common___IndexSettingsStore' knn: - type: boolean + $ref: '#/components/schemas/_common___StringifiedBoolean' knn.algo_param.ef_search: - type: integer + $ref: '#/components/schemas/_common___StringifiedInteger' + composite_index.star_tree: + $ref: '#/components/schemas/indices._common___IndexSettingsStarTree' additionalProperties: title: custom_settings indices._common___IndexSettingsAnalysis: @@ -48862,12 +49351,12 @@ components: type: object properties: max_token_count: - $ref: '#/components/schemas/_common___Stringifiedinteger' + $ref: '#/components/schemas/_common___StringifiedInteger' indices._common___IndexSettingsHighlight: type: object properties: max_analyzed_offset: - type: integer + $ref: '#/components/schemas/_common___StringifiedInteger' indices._common___IndexSettingsIndexing: type: object properties: @@ -48879,15 +49368,19 @@ components: name: $ref: '#/components/schemas/_common___Name' indexing_complete: - $ref: '#/components/schemas/_common___Stringifiedboolean' + $ref: '#/components/schemas/_common___StringifiedBoolean' origination_date: + description: |- + 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. $ref: '#/components/schemas/_common___StringifiedEpochTimeUnitMillis' parse_origination_date: description: |- - 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. + 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. type: boolean step: $ref: '#/components/schemas/indices._common___IndexSettingsLifecycleStep' @@ -48908,7 +49401,7 @@ components: type: object properties: coerce: - type: boolean + $ref: '#/components/schemas/_common___StringifiedBoolean' total_fields: $ref: '#/components/schemas/indices._common___IndexSettingsMappingLimitTotalFields' depth: @@ -48922,16 +49415,15 @@ components: dimension_fields: $ref: '#/components/schemas/indices._common___IndexSettingsMappingLimitDimensionFields' ignore_malformed: - type: boolean + $ref: '#/components/schemas/_common___StringifiedBoolean' indices._common___IndexSettingsMappingLimitDepth: type: object properties: limit: description: |- 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, etc. - type: integer - format: int64 + at the root object level, then the depth is `1`. If there is one object mapping, then the depth is `2`. + $ref: '#/components/schemas/_common___StringifiedLong' indices._common___IndexSettingsMappingLimitDimensionFields: type: object properties: @@ -48939,8 +49431,7 @@ components: description: |- [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. - type: integer - format: int64 + $ref: '#/components/schemas/_common___StringifiedLong' indices._common___IndexSettingsMappingLimitFieldNameLength: type: object properties: @@ -48949,8 +49440,7 @@ components: 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). - type: integer - format: int64 + $ref: '#/components/schemas/_common___StringifiedLong' indices._common___IndexSettingsMappingLimitNestedFields: type: object properties: @@ -48959,8 +49449,7 @@ components: 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. - type: integer - format: int64 + $ref: '#/components/schemas/_common___StringifiedLong' indices._common___IndexSettingsMappingLimitNestedObjects: type: object properties: @@ -48968,8 +49457,7 @@ components: description: |- 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. - type: integer - format: int64 + $ref: '#/components/schemas/_common___StringifiedLong' indices._common___IndexSettingsMappingLimitTotalFields: type: object properties: @@ -48978,20 +49466,86 @@ components: 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. - type: integer - format: int64 + $ref: '#/components/schemas/_common___StringifiedLong' indices._common___IndexSettingsMerge: type: object properties: + log_byte_size_policy: + $ref: '#/components/schemas/indices._common___IndexSettingsMergeLogByteSizePolicy' + policy: + $ref: '#/components/schemas/indices._common___IndexSettingsMergePolicy' + policy.deletes_pct_allowed: + $ref: '#/components/schemas/_common___StringifiedDouble' + policy.expunge_deletes_allowed: + $ref: '#/components/schemas/_common___StringifiedDouble' + policy.floor_segment: + $ref: '#/components/schemas/_common___HumanReadableByteCount' + policy.max_merge_at_once: + $ref: '#/components/schemas/_common___StringifiedInteger' + policy.max_merged_segment: + $ref: '#/components/schemas/_common___HumanReadableByteCount' + policy.reclaim_deletes_weight: + $ref: '#/components/schemas/_common___StringifiedDouble' + policy.segments_per_tier: + $ref: '#/components/schemas/_common___StringifiedDouble' scheduler: $ref: '#/components/schemas/indices._common___IndexSettingsMergeScheduler' + indices._common___IndexSettingsMergeLogByteSizePolicy: + type: object + properties: + max_merge_segment: + $ref: '#/components/schemas/_common___HumanReadableByteCount' + max_merge_segment_forced_merge: + $ref: '#/components/schemas/_common___HumanReadableByteCount' + max_merged_docs: + $ref: '#/components/schemas/_common___StringifiedInteger' + merge_factor: + $ref: '#/components/schemas/_common___StringifiedInteger' + min_merge: + $ref: '#/components/schemas/_common___HumanReadableByteCount' + no_cfs_ratio: + $ref: '#/components/schemas/_common___StringifiedDouble' + indices._common___IndexSettingsMergePolicy: + oneOf: + - title: name + $ref: '#/components/schemas/indices._common___IndexSettingsMergePolicyName' + - title: tiered_policy_config + $ref: '#/components/schemas/indices._common___IndexSettingsMergeTieredPolicy' + indices._common___IndexSettingsMergePolicyName: + type: string + enum: + - default + - log_byte_size + - tiered indices._common___IndexSettingsMergeScheduler: type: object properties: + auto_throttle: + $ref: '#/components/schemas/_common___StringifiedBoolean' max_thread_count: - $ref: '#/components/schemas/_common___Stringifiedinteger' + $ref: '#/components/schemas/_common___StringifiedInteger' max_merge_count: - $ref: '#/components/schemas/_common___Stringifiedinteger' + $ref: '#/components/schemas/_common___StringifiedInteger' + indices._common___IndexSettingsMergeTieredPolicy: + type: object + properties: + deletes_pct_allowed: + $ref: '#/components/schemas/_common___StringifiedDouble' + expunge_deletes_allowed: + $ref: '#/components/schemas/_common___StringifiedDouble' + floor_segment: + $ref: '#/components/schemas/_common___HumanReadableByteCount' + max_merge_at_once: + $ref: '#/components/schemas/_common___StringifiedInteger' + max_merge_at_once_explicit: + $ref: '#/components/schemas/_common___StringifiedInteger' + x-version-removed: '2.0' + max_merged_segment: + $ref: '#/components/schemas/_common___HumanReadableByteCount' + reclaim_deletes_weight: + $ref: '#/components/schemas/_common___StringifiedDouble' + segments_per_tier: + $ref: '#/components/schemas/_common___StringifiedDouble' indices._common___IndexSettingsQueries: type: object properties: @@ -49001,21 +49555,41 @@ components: type: object properties: enabled: - type: boolean + $ref: '#/components/schemas/_common___StringifiedBoolean' required: - enabled indices._common___IndexSettingsQueryString: type: object properties: lenient: - $ref: '#/components/schemas/_common___Stringifiedboolean' + $ref: '#/components/schemas/_common___StringifiedBoolean' indices._common___IndexSettingsSearch: type: object properties: + concurrent: + $ref: '#/components/schemas/indices._common___IndexSettingsSearchConcurrent' + concurrent_segment_search: + $ref: '#/components/schemas/indices._common___IndexSettingsSearchConcurrentSegmentSearch' + default_pipeline: + type: string idle: $ref: '#/components/schemas/indices._common___SearchIdle' slowlog: $ref: '#/components/schemas/indices._common___SearchSlowlog' + throttled: + $ref: '#/components/schemas/_common___StringifiedBoolean' + indices._common___IndexSettingsSearchConcurrent: + type: object + properties: + max_slice_count: + $ref: '#/components/schemas/_common___StringifiedInteger' + indices._common___IndexSettingsSearchConcurrentSegmentSearch: + type: object + properties: + mode: + type: string + enabled: + $ref: '#/components/schemas/_common___StringifiedBoolean' indices._common___IndexSettingsSimilarity: type: object properties: @@ -49139,6 +49713,42 @@ components: required: - script - type + indices._common___IndexSettingsStarTree: + type: object + properties: + default: + $ref: '#/components/schemas/indices._common___IndexSettingsStarTreeDefault' + field: + $ref: '#/components/schemas/indices._common___IndexSettingsStarTreeField' + max_fields: + $ref: '#/components/schemas/_common___StringifiedInteger' + indices._common___IndexSettingsStarTreeDefault: + type: object + properties: + max_leaf_docs: + $ref: '#/components/schemas/_common___StringifiedInteger' + indices._common___IndexSettingsStarTreeField: + type: object + properties: + default: + $ref: '#/components/schemas/indices._common___IndexSettingsStarTreeFieldDefault' + max_base_metrics: + $ref: '#/components/schemas/_common___StringifiedInteger' + max_date_intervals: + $ref: '#/components/schemas/_common___StringifiedInteger' + max_dimensions: + $ref: '#/components/schemas/_common___StringifiedInteger' + indices._common___IndexSettingsStarTreeFieldDefault: + type: object + properties: + date_intervals: + type: array + items: + type: string + metrics: + type: array + items: + type: string indices._common___IndexSettingsStore: type: object properties: @@ -49147,12 +49757,53 @@ components: allow_mmap: description: |- 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 + 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. - type: boolean + $ref: '#/components/schemas/_common___StringifiedBoolean' + fs: + $ref: '#/components/schemas/indices._common___IndexSettingsStoreFs' + hybrid: + $ref: '#/components/schemas/indices._common___IndexSettingsStoreHybrid' + preload: + type: array + items: + type: string + stats_refresh_interval: + $ref: '#/components/schemas/_common___Duration' required: - type + indices._common___IndexSettingsStoreFs: + type: object + properties: + fs_lock: + $ref: '#/components/schemas/indices._common___IndexSettingsStoreFsLock' + indices._common___IndexSettingsStoreFsLock: + type: string + enum: + - native + - simple + indices._common___IndexSettingsStoreHybrid: + type: object + properties: + mmap: + $ref: '#/components/schemas/indices._common___IndexSettingsStoreHybridMmap' + nio: + $ref: '#/components/schemas/indices._common___IndexSettingsStoreHybridNio' + indices._common___IndexSettingsStoreHybridMmap: + type: object + properties: + extensions: + type: array + items: + type: string + indices._common___IndexSettingsStoreHybridNio: + type: object + properties: + extensions: + type: array + items: + type: string indices._common___IndexState: type: object properties: @@ -49205,10 +49856,10 @@ components: type: object properties: hidden: - description: If true, the data stream is hidden. + description: If `true`, the data stream is hidden. type: boolean allow_custom_routing: - description: If true, the data stream supports custom routing. + description: If `true`, the data stream supports custom routing. type: boolean timestamp_field: $ref: '#/components/schemas/indices._common___DataStreamTimestampField' @@ -49312,16 +49963,25 @@ components: properties: enabled: description: Indicates whether soft deletes are enabled on the index. - type: boolean + $ref: '#/components/schemas/_common___StringifiedBoolean' + retention: + $ref: '#/components/schemas/indices._common___SoftDeletesRetention' retention_lease: $ref: '#/components/schemas/indices._common___RetentionLease' + indices._common___SoftDeletesRetention: + type: object + properties: + operations: + $ref: '#/components/schemas/_common___StringifiedLong' indices._common___StorageType: - type: string - enum: - - fs - - hybridfs - - mmapfs - - niofs + anyOf: + - type: string + enum: + - fs + - hybridfs + - mmapfs + - niofs + - type: string indices._common___TemplateMapping: type: object properties: @@ -49358,6 +50018,8 @@ components: $ref: '#/components/schemas/indices._common___TranslogDurability' flush_threshold_size: $ref: '#/components/schemas/_common___HumanReadableByteCount' + generation_threshold_size: + $ref: '#/components/schemas/_common___HumanReadableByteCount' retention: $ref: '#/components/schemas/indices._common___TranslogRetention' indices._common___TranslogDurability: @@ -49536,6 +50198,7 @@ components: store_size: $ref: '#/components/schemas/_common___HumanReadableByteCount' store_size_bytes: + description: Total size, in bytes, of all shards for the data stream's backing indexes. $ref: '#/components/schemas/_common___ByteCount' required: - backing_indices @@ -50513,7 +51176,7 @@ components: target_fields: $ref: '#/components/schemas/_common___Fields' trim: - description: Trim whitespaces in unquoted fields. + description: Trim white spaces in unquoted fields. type: boolean required: - field @@ -50525,8 +51188,8 @@ components: properties: date_formats: description: |- - An array of the expected date formats for parsing dates / timestamps in the document being preprocessed. - Can be a java time pattern or one of the following formats: ISO8601, UNIX, UNIX_MS, or TAI64N. + An array of the expected date formats for parsing dates/timestamps in the document being preprocessed. + Can be a java time pattern or one of the following formats: `ISO8601`, `UNIX`, `UNIX_MS`, or `TAI64N`. type: array items: type: string @@ -50553,7 +51216,7 @@ components: description: The locale to use when parsing the date from the document being preprocessed, relevant when parsing month names or week days. type: string timezone: - description: The timezone to use when parsing the date and when date math index supports resolves expressions into concrete index names. + description: The time zone to use when parsing the date and when date math index supports resolves expressions into concrete index names. type: string required: - date_formats @@ -50582,7 +51245,7 @@ components: $ref: '#/components/schemas/_common___Field' timezone: description: |- - The timezone to use when parsing the date. + The time zone to use when parsing the date. Supports template snippets. type: string required: @@ -50638,7 +51301,7 @@ components: max_matches: description: |- The maximum number of matched documents to include under the configured target field. - The `target_field` will be turned into a json array if `max_matches` is higher than 1, otherwise `target_field` will become a json object. + The `target_field` will be turned into a JSON array if `max_matches` is higher than 1, otherwise `target_field` will become a JSON object. In order to avoid documents getting too large, the maximum allowed value is 128. type: number override: @@ -50690,7 +51353,7 @@ components: - type: object properties: database_file: - description: The database filename referring to a database the module ships with (GeoLite2-City.mmdb, GeoLite2-Country.mmdb, or GeoLite2-ASN.mmdb) or a custom database in the ingest-geoip config directory. + description: The database filename referring to a database the module ships with (`GeoLite2-City.mmdb`, `GeoLite2-Country.mmdb`, or `GeoLite2-ASN.mmdb`) or a custom database in the `ingest-geoip` config directory. type: string field: $ref: '#/components/schemas/_common___Field' @@ -51349,7 +52012,7 @@ components: collapse: $ref: '#/components/schemas/_core.search___FieldCollapse' explain: - description: If true, returns detailed information about score computation as part of a hit. + description: If `true`, returns detailed information about score computation as part of a hit. type: boolean ext: description: Configuration of search extensions defined by OpenSearch plugins. @@ -51442,10 +52105,10 @@ components: Defaults to no timeout. type: string track_scores: - description: If true, calculate and return document scores, even if the scores are not used for sorting. + description: If `true`, calculate and return document scores, even if the scores are not used for sorting. type: boolean version: - description: If true, returns document version as part of a hit. + description: If `true`, returns document version as part of a hit. type: boolean seq_no_primary_term: description: If `true`, returns sequence number and primary term of the last modification of each hit. @@ -51521,7 +52184,7 @@ components: description: Additional labels for the query. search_type: type: string - description: The search query type (e.g., query_then_fetch). + description: The search query type (for example, `query_then_fetch`). source: type: object $ref: '#/components/schemas/insights._common___Source' @@ -52409,12 +53072,16 @@ components: type: object properties: estimated_size: + description: Estimated memory used for the operation. $ref: '#/components/schemas/_common___HumanReadableByteCount' estimated_size_in_bytes: + description: Estimated memory used, in bytes, for the operation. $ref: '#/components/schemas/_common___ByteCount' limit_size: + description: Memory limit for the circuit breaker. $ref: '#/components/schemas/_common___HumanReadableByteCount' limit_size_in_bytes: + description: Memory limit, in bytes, for the circuit breaker. $ref: '#/components/schemas/_common___ByteCount' overhead: description: A constant that all estimates for the circuit breaker are multiplied with to calculate a final estimate. @@ -52506,6 +53173,7 @@ components: description: Number of requests from this client. type: number request_size_bytes: + description: Cumulative size in bytes of all requests from this client. $ref: '#/components/schemas/_common___ByteCount' x_opaque_id: description: |- @@ -52625,14 +53293,18 @@ components: type: object properties: available: + description: Total amount of disk space available to this Java virtual machine on this file store. $ref: '#/components/schemas/_common___HumanReadableByteCount' available_in_bytes: + description: Total number of bytes available to this Java virtual machine on this file store. $ref: '#/components/schemas/_common___ByteCount' cache_reserved: x-version-added: '2.7' + description: Total number of cache bytes reserved available to this Java virtual machine on this file store. $ref: '#/components/schemas/_common___HumanReadableByteCount' cache_reserved_in_bytes: x-version-added: '2.7' + description: Total number of cache bytes reserved available to this Java virtual machine on this file store. $ref: '#/components/schemas/_common___ByteCount' disk_queue: type: string @@ -52649,8 +53321,10 @@ components: disk_write_size_in_bytes: $ref: '#/components/schemas/_common___ByteCount' free: + description: Total amount of unallocated disk space in the file store. $ref: '#/components/schemas/_common___HumanReadableByteCount' free_in_bytes: + description: Total number of unallocated bytes in the file store. $ref: '#/components/schemas/_common___ByteCount' mount: description: 'Mount point of the file store (for example: `/dev/sda2`).' @@ -52659,8 +53333,10 @@ components: description: Path to the file store. type: string total: + description: Total size of the file store. $ref: '#/components/schemas/_common___HumanReadableByteCount' total_in_bytes: + description: Total size of the file store in bytes. $ref: '#/components/schemas/_common___ByteCount' type: description: 'Type of the file store (ex: ext4).' @@ -52676,8 +53352,8 @@ components: $ref: '#/components/schemas/nodes._common___PublishedClusterStates' cluster_state_update: description: |- - Contains low-level statistics about how long various activities took during cluster state updates while the node was the elected master. - Omitted if the node is not master-eligible. + Contains low-level statistics about how long various activities took during cluster state updates while the node was the elected cluster manager. + Omitted if the node is not cluster-manager-eligible. Every field whose name ends in `_time` within this object is also represented as a raw number of milliseconds in a field whose name ends in `_time_millis`. The human-readable fields with a `_time` suffix are only returned if requested with the `?human=true` query parameter. type: object @@ -52693,8 +53369,10 @@ components: - type: object properties: free_percent: + description: Percentage of free memory. $ref: '#/components/schemas/_common___PercentageNumber' used_percent: + description: Percentage of used memory. $ref: '#/components/schemas/_common___PercentageNumber' nodes._common___FileSystem: type: object @@ -52717,22 +53395,36 @@ components: type: object properties: available: + description: |- + Total disk space available to this Java virtual machine on all file stores. + Depending on OS or process level restrictions, this might appear less than `free`. + This is the actual amount of free disk space the OpenSearch node can utilize. $ref: '#/components/schemas/_common___HumanReadableByteCount' available_in_bytes: + description: |- + Total number of bytes available to this Java virtual machine on all file stores. + Depending on OS or process level restrictions, this might appear less than `free_in_bytes`. + This is the actual amount of free disk space the OpenSearch node can utilize. $ref: '#/components/schemas/_common___ByteCount' free: + description: Total unallocated disk space in all file stores. $ref: '#/components/schemas/_common___HumanReadableByteCount' free_in_bytes: + description: Total number of unallocated bytes in all file stores. $ref: '#/components/schemas/_common___ByteCount' total: + description: Total size of all file stores. $ref: '#/components/schemas/_common___HumanReadableByteCount' total_in_bytes: + description: Total size of all file stores in bytes. $ref: '#/components/schemas/_common___ByteCount' cache_reserved: x-version-added: '2.7' + description: Total size of cache bytes reserved in all file stores. $ref: '#/components/schemas/_common___HumanReadableByteCount' cache_reserved_in_bytes: x-version-added: '2.7' + description: Total size of cache bytes reserved in all file stores. $ref: '#/components/schemas/_common___ByteCount' nodes._common___GarbageCollector: type: object @@ -52781,6 +53473,9 @@ components: limit: $ref: '#/components/schemas/_common___HumanReadableByteCount' limit_in_bytes: + description: |- + Configured memory limit, in bytes, for the indexing requests. + Replica requests have an automatic limit that is 1.5x this value. $ref: '#/components/schemas/_common___ByteCount' current: $ref: '#/components/schemas/nodes._common___PressureMemory' @@ -52903,26 +53598,37 @@ components: type: object properties: heap_used: + description: Memory currently in use by the heap. $ref: '#/components/schemas/_common___HumanReadableByteCount' heap_used_in_bytes: + description: Memory, in bytes, currently in use by the heap. $ref: '#/components/schemas/_common___ByteCount' heap_used_percent: + description: Percentage of memory currently in use by the heap. $ref: '#/components/schemas/_common___PercentageNumber' heap_committed: + description: Amount of memory available for use by the heap. $ref: '#/components/schemas/_common___HumanReadableByteCount' heap_committed_in_bytes: + description: Amount of memory, in bytes, available for use by the heap. $ref: '#/components/schemas/_common___ByteCount' heap_max: + description: Maximum amount of memory available for use by the heap. $ref: '#/components/schemas/_common___HumanReadableByteCount' heap_max_in_bytes: + description: Maximum amount of memory, in bytes, available for use by the heap. $ref: '#/components/schemas/_common___ByteCount' non_heap_used: + description: Non-heap memory used. $ref: '#/components/schemas/_common___HumanReadableByteCount' non_heap_used_in_bytes: + description: Non-heap memory used, in bytes. $ref: '#/components/schemas/_common___ByteCount' non_heap_committed: + description: Amount of non-heap memory available. $ref: '#/components/schemas/_common___HumanReadableByteCount' non_heap_committed_in_bytes: + description: Amount of non-heap memory available, in bytes. $ref: '#/components/schemas/_common___ByteCount' pools: description: Contains statistics about heap memory usage for the node. @@ -52962,6 +53668,9 @@ components: type: object properties: adjusted_total_in_bytes: + description: |- + If the amount of physical memory has been overridden using the `es`.`total_memory_bytes` system property then this reports the overridden value in bytes. + Otherwise it reports the same value as `total_in_bytes`. $ref: '#/components/schemas/_common___ByteCount' resident: $ref: '#/components/schemas/_common___HumanReadableByteCount' @@ -52976,16 +53685,22 @@ components: total_virtual_in_bytes: $ref: '#/components/schemas/_common___ByteCount' total: + description: Total amount of physical memory. $ref: '#/components/schemas/_common___HumanReadableByteCount' total_in_bytes: + description: Total amount of physical memory in bytes. $ref: '#/components/schemas/_common___ByteCount' free: + description: Amount of free physical memory. $ref: '#/components/schemas/_common___HumanReadableByteCount' free_in_bytes: + description: Amount of free physical memory in bytes. $ref: '#/components/schemas/_common___ByteCount' used: + description: Amount of used physical memory. $ref: '#/components/schemas/_common___HumanReadableByteCount' used_in_bytes: + description: Amount of used physical memory in bytes. $ref: '#/components/schemas/_common___ByteCount' nodes._common___NodeBufferPool: type: object @@ -52994,12 +53709,16 @@ components: description: Number of buffer pools. type: number total_capacity: + description: Total capacity of buffer pools. $ref: '#/components/schemas/_common___HumanReadableByteCount' total_capacity_in_bytes: + description: Total capacity of buffer pools in bytes. $ref: '#/components/schemas/_common___ByteCount' used: + description: Size of buffer pools. $ref: '#/components/schemas/_common___HumanReadableByteCount' used_in_bytes: + description: Size of buffer pools in bytes. $ref: '#/components/schemas/_common___ByteCount' nodes._common___NodeReloadError: type: object @@ -53036,22 +53755,31 @@ components: type: object properties: used: + description: Memory used by the heap. $ref: '#/components/schemas/_common___HumanReadableByteCount' used_in_bytes: + description: Memory, in bytes, used by the heap. $ref: '#/components/schemas/_common___ByteCount' max: + description: Maximum amount of memory available for use by the heap. $ref: '#/components/schemas/_common___HumanReadableByteCount' max_in_bytes: + description: Maximum amount of memory, in bytes, available for use by the heap. $ref: '#/components/schemas/_common___ByteCount' peak_used: + description: Largest amount of memory historically used by the heap. $ref: '#/components/schemas/_common___HumanReadableByteCount' peak_used_in_bytes: + description: Largest amount of memory, in bytes, historically used by the heap. $ref: '#/components/schemas/_common___ByteCount' peak_max: + description: Largest amount of memory historically used by the heap. $ref: '#/components/schemas/_common___HumanReadableByteCount' peak_max_in_bytes: + description: Largest amount of memory, in bytes, historically used by the heap. $ref: '#/components/schemas/_common___ByteCount' last_gc_stats: + description: Most recent GC cycle stats for a particular memory pool. $ref: '#/components/schemas/nodes._common___LastGcStats' nodes._common___PressureMemory: type: object @@ -53059,22 +53787,29 @@ components: all: $ref: '#/components/schemas/_common___HumanReadableByteCount' all_in_bytes: + description: Memory consumed, in bytes, by indexing requests in the coordinating, primary, or replica stage. $ref: '#/components/schemas/_common___ByteCount' combined_coordinating_and_primary: $ref: '#/components/schemas/_common___HumanReadableByteCount' combined_coordinating_and_primary_in_bytes: + description: |- + Memory consumed, in bytes, by indexing requests in the coordinating or primary stage. + This value is not the sum of coordinating and primary as a node can reuse the coordinating memory if the primary stage is executed locally. $ref: '#/components/schemas/_common___ByteCount' coordinating: $ref: '#/components/schemas/_common___HumanReadableByteCount' coordinating_in_bytes: + description: Memory consumed, in bytes, by indexing requests in the coordinating stage. $ref: '#/components/schemas/_common___ByteCount' primary: $ref: '#/components/schemas/_common___HumanReadableByteCount' primary_in_bytes: + description: Memory consumed, in bytes, by indexing requests in the primary stage. $ref: '#/components/schemas/_common___ByteCount' replica: $ref: '#/components/schemas/_common___HumanReadableByteCount' replica_in_bytes: + description: Memory consumed, in bytes, by indexing requests in the replica stage. $ref: '#/components/schemas/_common___ByteCount' coordinating_rejections: description: Number of indexing requests rejected in the coordinating stage. @@ -53146,6 +53881,7 @@ components: type: object properties: last_successful_fetch_of_pinned_timestamps: + description: Timestamp for the last successful fetch of pinned timestamps. $ref: '#/components/schemas/_common___StringifiedEpochTimeUnitSeconds' nodes._common___SampleType: type: string @@ -53537,6 +54273,9 @@ components: description: Number of threads in the thread pool. type: number total_wait_time: + description: | + The total amount of time that tasks spend waiting in the thread pool queue. + Currently, only `search`, `search_throttled`, and `index_searcher` thread pools support this metric. $ref: '#/components/schemas/_common___Duration' total_wait_time_in_nanos: description: | @@ -53569,8 +54308,10 @@ components: description: Total number of RX (receive) packets received by the node during internal cluster communication. type: number rx_size: + description: Size of RX packets received by the node during internal cluster communication. $ref: '#/components/schemas/_common___HumanReadableByteCount' rx_size_in_bytes: + description: Size, in bytes, of RX packets received by the node during internal cluster communication. $ref: '#/components/schemas/_common___ByteCount' server_open: description: Current number of inbound TCP connections used for internal communication between nodes. @@ -53579,8 +54320,10 @@ components: description: Total number of TX (transmit) packets sent by the node during internal cluster communication. type: number tx_size: + description: Size of TX packets sent by the node during internal cluster communication. $ref: '#/components/schemas/_common___HumanReadableByteCount' tx_size_in_bytes: + description: Size, in bytes, of TX packets sent by the node during internal cluster communication. $ref: '#/components/schemas/_common___ByteCount' total_outbound_connections: description: |- @@ -54238,7 +54981,7 @@ components: description: Number of processors available to the Java virtual machine type: number allocated_processors: - description: The number of processors actually used to calculate thread pool size. This number can be set with the node.processors setting of a node and defaults to the number of processors reported by the OS. + description: The number of processors actually used to calculate thread pool size. This number can be set with the `node.processors` setting of a node and defaults to the number of processors reported by the OS. type: number name: $ref: '#/components/schemas/_common___Name' @@ -55081,6 +55824,228 @@ components: successful: type: integer format: int32 + replication._common___AutoFollowStats: + type: object + properties: + name: + type: string + pattern: + type: string + num_success_start_replication: + type: number + num_failed_start_replication: + type: number + num_failed_leader_calls: + type: number + failed_indices: + type: array + items: + type: string + last_execution_time: + type: number + replication._common___AutoFollowStatus: + type: object + properties: + num_success_start_replication: + type: number + num_failed_start_replication: + type: number + num_failed_leader_calls: + type: number + failed_indices: + type: array + items: + type: string + autofollow_stats: + type: array + items: + $ref: '#/components/schemas/replication._common___AutoFollowStats' + replication._common___CreateReplicationRule: + type: object + properties: + leader_alias: + $ref: '#/components/schemas/_common___IndexAlias' + name: + type: string + pattern: + type: string + use_roles: + $ref: '#/components/schemas/replication._common___UseRoles' + replication._common___DeleteReplicationRule: + type: object + properties: + leader_alias: + $ref: '#/components/schemas/_common___IndexAlias' + name: + type: string + replication._common___FollowerStatus: + type: object + properties: + num_syncing_indices: + type: number + num_bootstrapping_indices: + type: number + num_paused_indices: + type: number + num_failed_indices: + type: number + num_shard_tasks: + type: number + num_index_tasks: + type: number + operations_written: + type: number + operations_read: + type: number + failed_read_requests: + type: number + throttled_read_requests: + type: number + failed_write_requests: + type: number + throttled_write_requests: + type: number + follower_checkpoint: + type: number + leader_checkpoint: + type: number + total_write_time_millis: + $ref: '#/components/schemas/_common___StringifiedEpochTimeUnitMillis' + index_stats: + type: object + additionalProperties: + $ref: '#/components/schemas/replication._common___IndexFollowerStatus' + replication._common___IndexFollowerStatus: + type: object + properties: + operations_written: + type: number + operations_read: + type: number + failed_read_requests: + type: number + throttled_read_requests: + type: number + failed_write_requests: + type: number + throttled_write_requests: + type: number + follower_checkpoint: + type: number + leader_checkpoint: + type: number + total_write_time_millis: + $ref: '#/components/schemas/_common___StringifiedEpochTimeUnitMillis' + replication._common___IndexSchema: + type: object + properties: + number_of_shards: + type: integer + number_of_replicas: + type: integer + replication._common___IndexStatus: + type: object + properties: + operations_read: + type: number + translog_size_bytes: + $ref: '#/components/schemas/_common___ByteCount' + operations_read_lucene: + type: number + operations_read_translog: + type: number + total_read_time_lucene_millis: + $ref: '#/components/schemas/_common___StringifiedEpochTimeUnitMillis' + total_read_time_translog_millis: + $ref: '#/components/schemas/_common___StringifiedEpochTimeUnitMillis' + bytes_read: + $ref: '#/components/schemas/_common___ByteCount' + replication._common___LeaderStatus: + type: object + properties: + num_replicated_indices: + type: number + operations_read: + type: number + translog_size_bytes: + $ref: '#/components/schemas/_common___ByteCount' + operations_read_lucene: + type: number + operations_read_translog: + type: number + total_read_time_lucene_millis: + $ref: '#/components/schemas/_common___StringifiedEpochTimeUnitMillis' + total_read_time_translog_millis: + $ref: '#/components/schemas/_common___StringifiedEpochTimeUnitMillis' + bytes_read: + $ref: '#/components/schemas/_common___ByteCount' + index_stats: + type: object + additionalProperties: + $ref: '#/components/schemas/replication._common___IndexStatus' + replication._common___Replication: + type: object + properties: + leader_alias: + $ref: '#/components/schemas/_common___IndexAlias' + leader_index: + $ref: '#/components/schemas/_common___IndexName' + use_roles: + $ref: '#/components/schemas/replication._common___UseRoles' + replication._common___SettingsBody: + type: object + properties: + index: + $ref: '#/components/schemas/replication._common___IndexSchema' + replication._common___Status: + type: object + properties: + status: + type: string + enum: + - BOOTSTRAPPING + - PAUSED + - REPLICATION NOT IN PROGRESS + - RUNNING + - SYNCING + reason: + type: string + leader_alias: + $ref: '#/components/schemas/_common___IndexAlias' + leader_index: + $ref: '#/components/schemas/_common___IndexName' + follower_index: + $ref: '#/components/schemas/_common___IndexName' + syncing_details: + $ref: '#/components/schemas/replication._common___SyncingDetails' + replication._common___SyncingDetails: + type: object + properties: + leader_checkpoint: + type: integer + follower_checkpoint: + type: integer + seq_no: + $ref: '#/components/schemas/_common___SequenceNumber' + replication._common___UpdateSettings: + type: object + properties: + settings: + allOf: + - type: object + properties: + index.number_of_shards: + type: integer + index.number_of_replicas: + type: integer + - $ref: '#/components/schemas/replication._common___SettingsBody' + replication._common___UseRoles: + type: object + properties: + leader_cluster_role: + type: string + follower_cluster_role: + type: string rollups._common___Continuous: type: object properties: @@ -55766,7 +56731,7 @@ components: type: boolean requests: type: object - description: An object with APIs as key and array of http methods as values. + description: An object with APIs as key and array of HTTP methods as values. security._common___AuditConfig: type: object properties: @@ -55829,7 +56794,7 @@ components: properties: user: type: string - description: Stringified User object. + description: A User object as a string. user_name: type: string description: User's name. @@ -55875,7 +56840,7 @@ components: type: - 'null' - string - description: Logout url. + description: Logout URL. size_of_user: type: string description: Size of user in memory. @@ -56111,7 +57076,7 @@ components: description: The generated OBO token. durationSeconds: type: string - description: The duration of the token, defaulted to 300s. + description: The duration of the token. Default is `300s`. security._common___GetCertificates: type: object properties: @@ -56237,7 +57202,7 @@ components: type: boolean disabled_endpoints: type: object - description: An object with disabled APIs as key and array of http methods as values. + description: An object with disabled APIs as key and array of HTTP methods as values. security._common___Role: type: object properties: @@ -56328,30 +57293,30 @@ components: type: - 'null' - string - description: Protocol for this ssl setup. + description: Protocol for this SSL setup. ssl_cipher: type: - 'null' - string - description: Cipher for this ssl setup. + description: Cipher for this SSL setup. ssl_openssl_available: type: boolean - description: A boolean to indicate if OpenSSL is available. + description: A Boolean to indicate if OpenSSL is available. ssl_openssl_version: type: - number - string - description: Version of openssl. + description: Version of OpenSSL. ssl_openssl_version_string: type: - 'null' - string - description: Full version string for openssl version. + description: Full version string for OpenSSL version. ssl_openssl_non_available_cause: type: - 'null' - string - description: Reason for openssl unavailability. + description: Reason for OpenSSL unavailability. ssl_openssl_supports_key_manager_factory: type: boolean description: Indicates where KMF is supported. @@ -56362,7 +57327,7 @@ components: type: - 'null' - string - description: Returns http provider's name. + description: Returns HTTP provider's name. ssl_provider_transport_server: type: string description: Returns transport server's name. @@ -56969,7 +57934,7 @@ components: - tasks tasks._common___TaskGroup: allOf: - - $ref: '#/components/schemas/tasks._common___TaskInfo' + - $ref: '#/components/schemas/tasks._common___TaskInfoBase' - type: object properties: children: @@ -56977,6 +57942,11 @@ components: items: $ref: '#/components/schemas/tasks._common___TaskGroup' tasks._common___TaskInfo: + allOf: + - $ref: '#/components/schemas/tasks._common___TaskInfoBase' + - type: object + properties: {} + tasks._common___TaskInfoBase: type: object properties: action: diff --git a/java-codegen/src/main/java/org/opensearch/client/codegen/model/ObjectShape.java b/java-codegen/src/main/java/org/opensearch/client/codegen/model/ObjectShape.java index 12fab62b95..702797179c 100644 --- a/java-codegen/src/main/java/org/opensearch/client/codegen/model/ObjectShape.java +++ b/java-codegen/src/main/java/org/opensearch/client/codegen/model/ObjectShape.java @@ -119,6 +119,10 @@ public Collection getImplementsTypes() { types.add(Types.Client.Json.PlainJsonSerializable); } + if (!isAbstract() && !canBeSingleton()) { + types.add(Types.Client.Util.ToCopyableBuilder(getType().getBuilderType(), getType())); + } + return types; } diff --git a/java-codegen/src/main/java/org/opensearch/client/codegen/model/Types.java b/java-codegen/src/main/java/org/opensearch/client/codegen/model/Types.java index d41a1655ce..c870e2706a 100644 --- a/java-codegen/src/main/java/org/opensearch/client/codegen/model/Types.java +++ b/java-codegen/src/main/java/org/opensearch/client/codegen/model/Types.java @@ -207,6 +207,7 @@ public static Type DictionaryResponse(Type keyType, Type valueType) { public static final class Util { public static final String PACKAGE = Client.PACKAGE + ".util"; public static final Type ApiTypeHelper = type(PACKAGE, "ApiTypeHelper"); + public static final Type CopyableBuilder = type(PACKAGE, "CopyableBuilder"); public static Type ObjectBuilder(Type type) { return ObjectBuilder.withTypeParameters(type); @@ -221,6 +222,12 @@ public static Type TaggedUnion(Type tagType, Type baseType) { public static final Type TaggedUnion = type(PACKAGE, "TaggedUnion"); public static final Type TaggedUnionUtils = type(PACKAGE, "TaggedUnionUtils"); + + public static Type ToCopyableBuilder(Type builder, Type type) { + return ToCopyableBuilder.withTypeParameters(builder, type); + } + + public static final Type ToCopyableBuilder = type(PACKAGE, "ToCopyableBuilder"); } } 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 f637c64995..e83d8f1bc6 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 @@ -28,8 +28,10 @@ private static JsonPointer schema(String namespace, String name) { public static final Overrides OVERRIDES = builder().withSchemas( s -> s.with(schema("_common", "Duration"), so -> so.withMappedType(Types.Client.OpenSearch._Types.Time)) - .with(schema("_common", "Stringifiedinteger"), so -> so.withMappedType(Types.Primitive.Int)) - .with(schema("_common", "Stringifiedboolean"), so -> so.withMappedType(Types.Primitive.Boolean)) + .with(schema("_common", "StringifiedBoolean"), so -> so.withMappedType(Types.Primitive.Boolean)) + .with(schema("_common", "StringifiedDouble"), so -> so.withMappedType(Types.Primitive.Double)) + .with(schema("_common", "StringifiedInteger"), so -> so.withMappedType(Types.Primitive.Int)) + .with(schema("_common", "StringifiedLong"), so -> so.withMappedType(Types.Primitive.Long)) .with(schema("_common", "StringifiedEpochTimeUnitMillis"), so -> so.withMappedType(Types.Primitive.Long)) // TODO: Remove this to generate query types diff --git a/java-codegen/src/main/resources/org/opensearch/client/codegen/templates/ObjectShape.mustache b/java-codegen/src/main/resources/org/opensearch/client/codegen/templates/ObjectShape.mustache index c5955b768c..e2ca6f14db 100644 --- a/java-codegen/src/main/resources/org/opensearch/client/codegen/templates/ObjectShape.mustache +++ b/java-codegen/src/main/resources/org/opensearch/client/codegen/templates/ObjectShape.mustache @@ -34,6 +34,8 @@ // --------------------------------------------------------------------------------------------- + {{>ObjectShape/ToBuilder}} + {{>ObjectShape/Builder}} // --------------------------------------------------------------------------------------------- diff --git a/java-codegen/src/main/resources/org/opensearch/client/codegen/templates/ObjectShape/Builder.mustache b/java-codegen/src/main/resources/org/opensearch/client/codegen/templates/ObjectShape/Builder.mustache index f715bd75d5..b3c781fe99 100644 --- a/java-codegen/src/main/resources/org/opensearch/client/codegen/templates/ObjectShape/Builder.mustache +++ b/java-codegen/src/main/resources/org/opensearch/client/codegen/templates/ObjectShape/Builder.mustache @@ -1,49 +1,118 @@ {{^abstract}} + @{{TYPES.Javax.Annotation.Nonnull}} + public static Builder {{#extendedByOtherShape}}{{#camelCase}}{{className}}{{/camelCase}}B{{/extendedByOtherShape}}{{^extendedByOtherShape}}b{{/extendedByOtherShape}}uilder() { + return new Builder(); + } + /** * Builder for {@link {{className}}}. */ - {{#extendsOtherShape}} - public static class Builder extends {{extendsType}}.AbstractBuilder - implements {{TYPES.Client.Util.ObjectBuilder}}<{{className}}> {{#shouldImplementPlainDeserializable}}, {{TYPES.Client.Json.PlainDeserializable}}{{/shouldImplementPlainDeserializable}} { - {{>ObjectShape/Builder/Fields}} + {{#extendedByOtherShape}} + public static class Builder extends {{type}}.AbstractBuilder + implements {{TYPES.Client.Util.CopyableBuilder}}{{#shouldImplementPlainDeserializable}}, {{TYPES.Client.Json.PlainDeserializable}}{{/shouldImplementPlainDeserializable}}{ + public Builder() {} + + private Builder({{className}} o) { + super(o); + } + + private Builder(Builder o) { + super(o); + } + + @Override + @{{TYPES.Javax.Annotation.Nonnull}} + public Builder copy() { + return new Builder(this); + } {{>ObjectShape/Builder/SelfImpl}} {{>ObjectShape/Builder/BuildImpl}} } - {{/extendsOtherShape}} - {{^extendsOtherShape}} - {{#extendedByOtherShape}} - public static class Builder extends {{type}}.AbstractBuilder - implements {{TYPES.Client.Util.ObjectBuilder}}<{{className}}>{{#shouldImplementPlainDeserializable}}, {{TYPES.Client.Json.PlainDeserializable}}{{/shouldImplementPlainDeserializable}} - { + {{/extendedByOtherShape}} + {{^extendedByOtherShape}} + {{#extendsOtherShape}} + public static class Builder extends {{extendsType}}.AbstractBuilder + implements {{TYPES.Client.Util.CopyableBuilder}} {{#shouldImplementPlainDeserializable}}, {{TYPES.Client.Json.PlainDeserializable}}{{/shouldImplementPlainDeserializable}} { + {{>ObjectShape/Builder/Fields}} + + public Builder() {} + + private Builder({{className}} o) { + {{>ObjectShape/Builder/CopyCtorImpl}} + } + + private Builder(Builder o) { + {{>ObjectShape/Builder/CopyCtorImpl}} + } + + @Override + @{{TYPES.Javax.Annotation.Nonnull}} + public Builder copy() { + return new Builder(this); + } + {{>ObjectShape/Builder/SelfImpl}} + {{>ObjectShape/Builder/Setters}} + {{>ObjectShape/Builder/BuildImpl}} } - {{/extendedByOtherShape}} - {{^extendedByOtherShape}} + {{/extendsOtherShape}} + {{^extendsOtherShape}} public static class Builder extends {{TYPES.Client.Util.ObjectBuilderBase}} - implements {{TYPES.Client.Util.ObjectBuilder}}<{{className}}>{{#shouldImplementPlainDeserializable}}, {{TYPES.Client.Json.PlainDeserializable}}{{/shouldImplementPlainDeserializable}} - { + implements {{TYPES.Client.Util.CopyableBuilder}}{{#shouldImplementPlainDeserializable}}, {{TYPES.Client.Json.PlainDeserializable}}{{/shouldImplementPlainDeserializable}} { + {{>ObjectShape/Builder/Fields}} + + public Builder() {} + + private Builder({{className}} o) { + {{>ObjectShape/Builder/CopyCtorImpl}} + } + + private Builder(Builder o) { + {{>ObjectShape/Builder/CopyCtorImpl}} + } + + @Override + @{{TYPES.Javax.Annotation.Nonnull}} + public Builder copy() { + return new Builder(this); + } + {{#shouldImplementPlainDeserializable}} {{>ObjectShape/Builder/SelfImpl}} {{/shouldImplementPlainDeserializable}} - {{>ObjectShape/Builder/Fields}} + + {{>ObjectShape/Builder/Setters}} {{>ObjectShape/Builder/BuildImpl}} } - {{/extendedByOtherShape}} - {{/extendsOtherShape}} + {{/extendsOtherShape}} + {{/extendedByOtherShape}} {{/abstract}} {{#extendedByOtherShape}} protected abstract static class AbstractBuilder> extends {{#extendsOtherShape}}{{extendsType}}.AbstractBuilder{{/extendsOtherShape}}{{^extendsOtherShape}}{{TYPES.Client.Util.ObjectBuilderBase}}{{/extendsOtherShape}} { {{>ObjectShape/Builder/Fields}} + + protected AbstractBuilder() {} + + protected AbstractBuilder({{className}} o) { + {{>ObjectShape/Builder/CopyCtorImpl}} + } + + protected AbstractBuilder(AbstractBuilder o) { + {{>ObjectShape/Builder/CopyCtorImpl}} + } {{^extendsOtherShape}} + @{{TYPES.Javax.Annotation.Nonnull}} protected abstract BuilderT self(); {{/extendsOtherShape}} + + {{>ObjectShape/Builder/Setters}} } {{/extendedByOtherShape}} \ No newline at end of file diff --git a/java-codegen/src/main/resources/org/opensearch/client/codegen/templates/ObjectShape/Builder/BuildImpl.mustache b/java-codegen/src/main/resources/org/opensearch/client/codegen/templates/ObjectShape/Builder/BuildImpl.mustache index 882fad9d21..ee449f5bfb 100644 --- a/java-codegen/src/main/resources/org/opensearch/client/codegen/templates/ObjectShape/Builder/BuildImpl.mustache +++ b/java-codegen/src/main/resources/org/opensearch/client/codegen/templates/ObjectShape/Builder/BuildImpl.mustache @@ -3,6 +3,8 @@ * * @throws NullPointerException if some of the required fields are null. */ +@Override +@{{TYPES.Javax.Annotation.Nonnull}} public {{className}} build() { _checkSingleUse(); diff --git a/java-codegen/src/main/resources/org/opensearch/client/codegen/templates/ObjectShape/Builder/CopyCtorImpl.mustache b/java-codegen/src/main/resources/org/opensearch/client/codegen/templates/ObjectShape/Builder/CopyCtorImpl.mustache new file mode 100644 index 0000000000..61fe211db7 --- /dev/null +++ b/java-codegen/src/main/resources/org/opensearch/client/codegen/templates/ObjectShape/Builder/CopyCtorImpl.mustache @@ -0,0 +1,16 @@ +{{#extendsOtherShape}} + super(o); +{{/extendsOtherShape}} +{{#fields}} + {{#type.isList}} + this.{{name}} = _listCopy(o.{{name}}); + {{/type.isList}} + {{^type.isList}} + {{#type.isMap}} + this.{{name}} = _mapCopy(o.{{name}}); + {{/type.isMap}} + {{^type.isMap}} + this.{{name}} = o.{{name}}; + {{/type.isMap}} + {{/type.isList}} +{{/fields}} \ No newline at end of file diff --git a/java-codegen/src/main/resources/org/opensearch/client/codegen/templates/ObjectShape/Builder/Fields.mustache b/java-codegen/src/main/resources/org/opensearch/client/codegen/templates/ObjectShape/Builder/Fields.mustache index 88184a506f..3a14bfc8c3 100644 --- a/java-codegen/src/main/resources/org/opensearch/client/codegen/templates/ObjectShape/Builder/Fields.mustache +++ b/java-codegen/src/main/resources/org/opensearch/client/codegen/templates/ObjectShape/Builder/Fields.mustache @@ -1,69 +1,3 @@ {{#fields}} {{^required}}@{{TYPES.Javax.Annotation.Nullable}} {{/required}}private {{type.boxed}} {{name}}; -{{/fields}} - -{{#fields}} - {{#type.isMap}} - {{>ObjectShape/FieldDoc/MapAddAll}} - {{#deprecation}}@Deprecated{{/deprecation}} - public final Builder{{#extendedByOtherShape}}T{{/extendedByOtherShape}} {{name}}({{type}} map) { - this.{{name}} = _mapPutAll(this.{{name}}, map); - return {{^extendedByOtherShape}}this{{/extendedByOtherShape}}{{#extendedByOtherShape}}self(){{/extendedByOtherShape}}; - } - - {{>ObjectShape/FieldDoc/MapAdd}} - {{#deprecation}}@Deprecated{{/deprecation}} - public final Builder{{#extendedByOtherShape}}T{{/extendedByOtherShape}} {{name}}({{type.mapKeyType}} key, {{type.mapValueType}} value) { - this.{{name}} = _mapPut(this.{{name}}, key, value); - return {{^extendedByOtherShape}}this{{/extendedByOtherShape}}{{#extendedByOtherShape}}self(){{/extendedByOtherShape}}; - } - {{#type.mapValueType.hasBuilder}} - - {{>ObjectShape/FieldDoc/MapAddBuilderFn}} - {{#deprecation}}@Deprecated{{/deprecation}} - public final Builder{{#extendedByOtherShape}}T{{/extendedByOtherShape}} {{name}}(String key, {{type.mapValueType.builderFnType}} fn) { - return {{name}}(key, fn.apply(new {{type.mapValueType.builderType}}()).build()); - } - {{/type.mapValueType.hasBuilder}} - {{/type.isMap}} - {{#type.isList}} - {{>ObjectShape/FieldDoc/ListAddAll}} - {{#deprecation}}@Deprecated{{/deprecation}} - public final Builder{{#extendedByOtherShape}}T{{/extendedByOtherShape}} {{name}}({{type}} list) { - this.{{name}} = _listAddAll(this.{{name}}, list); - return {{^extendedByOtherShape}}this{{/extendedByOtherShape}}{{#extendedByOtherShape}}self(){{/extendedByOtherShape}}; - } - - {{>ObjectShape/FieldDoc/ListAdd}} - {{#deprecation}}@Deprecated{{/deprecation}} - public final Builder{{#extendedByOtherShape}}T{{/extendedByOtherShape}} {{name}}({{type.listValueType}} value, {{type.listValueType}}... values) { - this.{{name}} = _listAdd(this.{{name}}, value, values); - return {{^extendedByOtherShape}}this{{/extendedByOtherShape}}{{#extendedByOtherShape}}self(){{/extendedByOtherShape}}; - } - {{#type.listValueType.hasBuilder}} - - {{>ObjectShape/FieldDoc/ListAddBuilderFn}} - {{#deprecation}}@Deprecated{{/deprecation}} - public final Builder{{#extendedByOtherShape}}T{{/extendedByOtherShape}} {{name}}({{type.listValueType.builderFnType}} fn) { - return {{name}}(fn.apply(new {{type.listValueType.builderType}}()).build()); - } - {{/type.listValueType.hasBuilder}} - {{/type.isList}} - {{^type.isListOrMap}} - {{>ObjectShape/FieldDoc/Basic}} - {{#deprecation}}@Deprecated{{/deprecation}} - public final Builder{{#extendedByOtherShape}}T{{/extendedByOtherShape}} {{name}}({{^required}}@{{TYPES.Javax.Annotation.Nullable}} {{/required}}{{type}} value) { - this.{{name}} = value; - return {{^extendedByOtherShape}}this{{/extendedByOtherShape}}{{#extendedByOtherShape}}self(){{/extendedByOtherShape}}; - } - {{#type.hasBuilder}} - - {{>ObjectShape/FieldDoc/Basic}} - {{#deprecation}}@Deprecated{{/deprecation}} - public final Builder{{#extendedByOtherShape}}T{{/extendedByOtherShape}} {{name}}({{type.builderFnType}} fn) { - return {{name}}(fn.apply(new {{type.builderType}}()).build()); - } - {{/type.hasBuilder}} - {{/type.isListOrMap}} - {{/fields}} \ No newline at end of file diff --git a/java-codegen/src/main/resources/org/opensearch/client/codegen/templates/ObjectShape/Builder/SelfImpl.mustache b/java-codegen/src/main/resources/org/opensearch/client/codegen/templates/ObjectShape/Builder/SelfImpl.mustache index ce3c4f49ed..cb5366c207 100644 --- a/java-codegen/src/main/resources/org/opensearch/client/codegen/templates/ObjectShape/Builder/SelfImpl.mustache +++ b/java-codegen/src/main/resources/org/opensearch/client/codegen/templates/ObjectShape/Builder/SelfImpl.mustache @@ -1,4 +1,5 @@ @Override +@{{TYPES.Javax.Annotation.Nonnull}} {{#shouldImplementPlainDeserializable}}public{{/shouldImplementPlainDeserializable}}{{^shouldImplementPlainDeserializable}}protected{{/shouldImplementPlainDeserializable}} Builder self() { return this; } \ No newline at end of file diff --git a/java-codegen/src/main/resources/org/opensearch/client/codegen/templates/ObjectShape/Builder/Setters.mustache b/java-codegen/src/main/resources/org/opensearch/client/codegen/templates/ObjectShape/Builder/Setters.mustache new file mode 100644 index 0000000000..026edf2b60 --- /dev/null +++ b/java-codegen/src/main/resources/org/opensearch/client/codegen/templates/ObjectShape/Builder/Setters.mustache @@ -0,0 +1,73 @@ +{{#fields}} + {{#type.isMap}} + {{>ObjectShape/FieldDoc/MapAddAll}} + {{#deprecation}}@Deprecated{{/deprecation}} + @{{TYPES.Javax.Annotation.Nonnull}} + public final Builder{{#extendedByOtherShape}}T{{/extendedByOtherShape}} {{name}}({{type}} map) { + this.{{name}} = _mapPutAll(this.{{name}}, map); + return {{^extendedByOtherShape}}this{{/extendedByOtherShape}}{{#extendedByOtherShape}}self(){{/extendedByOtherShape}}; + } + + {{>ObjectShape/FieldDoc/MapAdd}} + {{#deprecation}}@Deprecated{{/deprecation}} + @{{TYPES.Javax.Annotation.Nonnull}} + public final Builder{{#extendedByOtherShape}}T{{/extendedByOtherShape}} {{name}}({{type.mapKeyType}} key, {{type.mapValueType}} value) { + this.{{name}} = _mapPut(this.{{name}}, key, value); + return {{^extendedByOtherShape}}this{{/extendedByOtherShape}}{{#extendedByOtherShape}}self(){{/extendedByOtherShape}}; + } + {{#type.mapValueType.hasBuilder}} + + {{>ObjectShape/FieldDoc/MapAddBuilderFn}} + {{#deprecation}}@Deprecated{{/deprecation}} + @{{TYPES.Javax.Annotation.Nonnull}} + public final Builder{{#extendedByOtherShape}}T{{/extendedByOtherShape}} {{name}}(String key, {{type.mapValueType.builderFnType}} fn) { + return {{name}}(key, fn.apply(new {{type.mapValueType.builderType}}()).build()); + } + {{/type.mapValueType.hasBuilder}} + {{/type.isMap}} + {{#type.isList}} + {{>ObjectShape/FieldDoc/ListAddAll}} + {{#deprecation}}@Deprecated{{/deprecation}} + @{{TYPES.Javax.Annotation.Nonnull}} + public final Builder{{#extendedByOtherShape}}T{{/extendedByOtherShape}} {{name}}({{type}} list) { + this.{{name}} = _listAddAll(this.{{name}}, list); + return {{^extendedByOtherShape}}this{{/extendedByOtherShape}}{{#extendedByOtherShape}}self(){{/extendedByOtherShape}}; + } + + {{>ObjectShape/FieldDoc/ListAdd}} + {{#deprecation}}@Deprecated{{/deprecation}} + @{{TYPES.Javax.Annotation.Nonnull}} + public final Builder{{#extendedByOtherShape}}T{{/extendedByOtherShape}} {{name}}({{type.listValueType}} value, {{type.listValueType}}... values) { + this.{{name}} = _listAdd(this.{{name}}, value, values); + return {{^extendedByOtherShape}}this{{/extendedByOtherShape}}{{#extendedByOtherShape}}self(){{/extendedByOtherShape}}; + } + {{#type.listValueType.hasBuilder}} + + {{>ObjectShape/FieldDoc/ListAddBuilderFn}} + {{#deprecation}}@Deprecated{{/deprecation}} + @{{TYPES.Javax.Annotation.Nonnull}} + public final Builder{{#extendedByOtherShape}}T{{/extendedByOtherShape}} {{name}}({{type.listValueType.builderFnType}} fn) { + return {{name}}(fn.apply(new {{type.listValueType.builderType}}()).build()); + } + {{/type.listValueType.hasBuilder}} + {{/type.isList}} + {{^type.isListOrMap}} + {{>ObjectShape/FieldDoc/Basic}} + {{#deprecation}}@Deprecated{{/deprecation}} + @{{TYPES.Javax.Annotation.Nonnull}} + public final Builder{{#extendedByOtherShape}}T{{/extendedByOtherShape}} {{name}}({{^required}}@{{TYPES.Javax.Annotation.Nullable}} {{/required}}{{type}} value) { + this.{{name}} = value; + return {{^extendedByOtherShape}}this{{/extendedByOtherShape}}{{#extendedByOtherShape}}self(){{/extendedByOtherShape}}; + } + {{#type.hasBuilder}} + + {{>ObjectShape/FieldDoc/Basic}} + {{#deprecation}}@Deprecated{{/deprecation}} + @{{TYPES.Javax.Annotation.Nonnull}} + public final Builder{{#extendedByOtherShape}}T{{/extendedByOtherShape}} {{name}}({{type.builderFnType}} fn) { + return {{name}}(fn.apply(new {{type.builderType}}()).build()); + } + {{/type.hasBuilder}} + {{/type.isListOrMap}} + +{{/fields}} \ No newline at end of file diff --git a/java-codegen/src/main/resources/org/opensearch/client/codegen/templates/ObjectShape/ToBuilder.mustache b/java-codegen/src/main/resources/org/opensearch/client/codegen/templates/ObjectShape/ToBuilder.mustache new file mode 100644 index 0000000000..bbd79599f7 --- /dev/null +++ b/java-codegen/src/main/resources/org/opensearch/client/codegen/templates/ObjectShape/ToBuilder.mustache @@ -0,0 +1,7 @@ +{{^abstract}} + @Override + @{{TYPES.Javax.Annotation.Nonnull}} + public Builder toBuilder() { + return new Builder(this); + } +{{/abstract}} \ No newline at end of file diff --git a/java-codegen/src/main/resources/org/opensearch/client/codegen/templates/RequestShape.mustache b/java-codegen/src/main/resources/org/opensearch/client/codegen/templates/RequestShape.mustache index 4acc648e79..149bb52a96 100644 --- a/java-codegen/src/main/resources/org/opensearch/client/codegen/templates/RequestShape.mustache +++ b/java-codegen/src/main/resources/org/opensearch/client/codegen/templates/RequestShape.mustache @@ -22,6 +22,8 @@ // --------------------------------------------------------------------------------------------- + {{>ObjectShape/ToBuilder}} + {{>ObjectShape/Builder}} {{#hasRequestBody}}