diff --git a/src/Elastic.Clients.Elasticsearch/Common/Aggregations/Aggregation.cs b/src/Elastic.Clients.Elasticsearch/Core/Aggregations/Aggregation.cs
similarity index 100%
rename from src/Elastic.Clients.Elasticsearch/Common/Aggregations/Aggregation.cs
rename to src/Elastic.Clients.Elasticsearch/Core/Aggregations/Aggregation.cs
diff --git a/src/Elastic.Clients.Elasticsearch/Common/Aggregations/AggregationCombinator.cs b/src/Elastic.Clients.Elasticsearch/Core/Aggregations/AggregationCombinator.cs
similarity index 100%
rename from src/Elastic.Clients.Elasticsearch/Common/Aggregations/AggregationCombinator.cs
rename to src/Elastic.Clients.Elasticsearch/Core/Aggregations/AggregationCombinator.cs
diff --git a/src/Elastic.Clients.Elasticsearch/Common/Aggregations/AggregationDictionary.cs b/src/Elastic.Clients.Elasticsearch/Core/Aggregations/AggregationDictionary.cs
similarity index 100%
rename from src/Elastic.Clients.Elasticsearch/Common/Aggregations/AggregationDictionary.cs
rename to src/Elastic.Clients.Elasticsearch/Core/Aggregations/AggregationDictionary.cs
diff --git a/src/Elastic.Clients.Elasticsearch/Common/Aggregations/IAggregate.cs b/src/Elastic.Clients.Elasticsearch/Core/Aggregations/IAggregate.cs
similarity index 100%
rename from src/Elastic.Clients.Elasticsearch/Common/Aggregations/IAggregate.cs
rename to src/Elastic.Clients.Elasticsearch/Core/Aggregations/IAggregate.cs
diff --git a/src/Elastic.Clients.Elasticsearch/Common/Configuration/ClrTypeDefaults.cs b/src/Elastic.Clients.Elasticsearch/Core/Configuration/ClrTypeDefaults.cs
similarity index 100%
rename from src/Elastic.Clients.Elasticsearch/Common/Configuration/ClrTypeDefaults.cs
rename to src/Elastic.Clients.Elasticsearch/Core/Configuration/ClrTypeDefaults.cs
diff --git a/src/Elastic.Clients.Elasticsearch/Common/Configuration/ElasticsearchClientSettings.cs b/src/Elastic.Clients.Elasticsearch/Core/Configuration/ElasticsearchClientSettings.cs
similarity index 100%
rename from src/Elastic.Clients.Elasticsearch/Common/Configuration/ElasticsearchClientSettings.cs
rename to src/Elastic.Clients.Elasticsearch/Core/Configuration/ElasticsearchClientSettings.cs
diff --git a/src/Elastic.Clients.Elasticsearch/Common/Configuration/IElasticsearchClientSettings.cs b/src/Elastic.Clients.Elasticsearch/Core/Configuration/IElasticsearchClientSettings.cs
similarity index 100%
rename from src/Elastic.Clients.Elasticsearch/Common/Configuration/IElasticsearchClientSettings.cs
rename to src/Elastic.Clients.Elasticsearch/Core/Configuration/IElasticsearchClientSettings.cs
diff --git a/src/Elastic.Clients.Elasticsearch/Common/Configuration/MemberInfoResolver.cs b/src/Elastic.Clients.Elasticsearch/Core/Configuration/MemberInfoResolver.cs
similarity index 100%
rename from src/Elastic.Clients.Elasticsearch/Common/Configuration/MemberInfoResolver.cs
rename to src/Elastic.Clients.Elasticsearch/Core/Configuration/MemberInfoResolver.cs
diff --git a/src/Elastic.Clients.Elasticsearch/Common/DateTime/DateMath/DateMath.cs b/src/Elastic.Clients.Elasticsearch/Core/DateTime/DateMath/DateMath.cs
similarity index 100%
rename from src/Elastic.Clients.Elasticsearch/Common/DateTime/DateMath/DateMath.cs
rename to src/Elastic.Clients.Elasticsearch/Core/DateTime/DateMath/DateMath.cs
diff --git a/src/Elastic.Clients.Elasticsearch/Common/DateTime/DateMath/DateMathExpression.cs b/src/Elastic.Clients.Elasticsearch/Core/DateTime/DateMath/DateMathExpression.cs
similarity index 100%
rename from src/Elastic.Clients.Elasticsearch/Common/DateTime/DateMath/DateMathExpression.cs
rename to src/Elastic.Clients.Elasticsearch/Core/DateTime/DateMath/DateMathExpression.cs
diff --git a/src/Elastic.Clients.Elasticsearch/Common/DateTime/DateMath/DateMathOperation.cs b/src/Elastic.Clients.Elasticsearch/Core/DateTime/DateMath/DateMathOperation.cs
similarity index 100%
rename from src/Elastic.Clients.Elasticsearch/Common/DateTime/DateMath/DateMathOperation.cs
rename to src/Elastic.Clients.Elasticsearch/Core/DateTime/DateMath/DateMathOperation.cs
diff --git a/src/Elastic.Clients.Elasticsearch/Common/DateTime/DateMath/DateMathTime.cs b/src/Elastic.Clients.Elasticsearch/Core/DateTime/DateMath/DateMathTime.cs
similarity index 100%
rename from src/Elastic.Clients.Elasticsearch/Common/DateTime/DateMath/DateMathTime.cs
rename to src/Elastic.Clients.Elasticsearch/Core/DateTime/DateMath/DateMathTime.cs
diff --git a/src/Elastic.Clients.Elasticsearch/Common/DateTime/DateMath/DateMathTimeUnit.cs b/src/Elastic.Clients.Elasticsearch/Core/DateTime/DateMath/DateMathTimeUnit.cs
similarity index 100%
rename from src/Elastic.Clients.Elasticsearch/Common/DateTime/DateMath/DateMathTimeUnit.cs
rename to src/Elastic.Clients.Elasticsearch/Core/DateTime/DateMath/DateMathTimeUnit.cs
diff --git a/src/Elastic.Clients.Elasticsearch/Common/DateTime/Duration.cs b/src/Elastic.Clients.Elasticsearch/Core/DateTime/Duration.cs
similarity index 100%
rename from src/Elastic.Clients.Elasticsearch/Common/DateTime/Duration.cs
rename to src/Elastic.Clients.Elasticsearch/Core/DateTime/Duration.cs
diff --git a/src/Elastic.Clients.Elasticsearch/Common/DateTime/TimeUnit.cs b/src/Elastic.Clients.Elasticsearch/Core/DateTime/TimeUnit.cs
similarity index 100%
rename from src/Elastic.Clients.Elasticsearch/Common/DateTime/TimeUnit.cs
rename to src/Elastic.Clients.Elasticsearch/Core/DateTime/TimeUnit.cs
diff --git a/src/Elastic.Clients.Elasticsearch/Common/ElasticsearchClientProductRegistration.cs b/src/Elastic.Clients.Elasticsearch/Core/ElasticsearchClientProductRegistration.cs
similarity index 100%
rename from src/Elastic.Clients.Elasticsearch/Common/ElasticsearchClientProductRegistration.cs
rename to src/Elastic.Clients.Elasticsearch/Core/ElasticsearchClientProductRegistration.cs
diff --git a/src/Elastic.Clients.Elasticsearch/Common/EmptyReadOnly.cs b/src/Elastic.Clients.Elasticsearch/Core/EmptyReadOnly.cs
similarity index 100%
rename from src/Elastic.Clients.Elasticsearch/Common/EmptyReadOnly.cs
rename to src/Elastic.Clients.Elasticsearch/Core/EmptyReadOnly.cs
diff --git a/src/Elastic.Clients.Elasticsearch/Common/EmptyReadOnlyExtensions.cs b/src/Elastic.Clients.Elasticsearch/Core/EmptyReadOnlyExtensions.cs
similarity index 100%
rename from src/Elastic.Clients.Elasticsearch/Common/EmptyReadOnlyExtensions.cs
rename to src/Elastic.Clients.Elasticsearch/Core/EmptyReadOnlyExtensions.cs
diff --git a/src/Elastic.Clients.Elasticsearch/Common/Extensions/ExceptionExtensions.cs b/src/Elastic.Clients.Elasticsearch/Core/Extensions/ExceptionExtensions.cs
similarity index 100%
rename from src/Elastic.Clients.Elasticsearch/Common/Extensions/ExceptionExtensions.cs
rename to src/Elastic.Clients.Elasticsearch/Core/Extensions/ExceptionExtensions.cs
diff --git a/src/Elastic.Clients.Elasticsearch/Common/Extensions/ExpressionExtensions.cs b/src/Elastic.Clients.Elasticsearch/Core/Extensions/ExpressionExtensions.cs
similarity index 100%
rename from src/Elastic.Clients.Elasticsearch/Common/Extensions/ExpressionExtensions.cs
rename to src/Elastic.Clients.Elasticsearch/Core/Extensions/ExpressionExtensions.cs
diff --git a/src/Elastic.Clients.Elasticsearch/Common/Extensions/Extensions.cs b/src/Elastic.Clients.Elasticsearch/Core/Extensions/Extensions.cs
similarity index 100%
rename from src/Elastic.Clients.Elasticsearch/Common/Extensions/Extensions.cs
rename to src/Elastic.Clients.Elasticsearch/Core/Extensions/Extensions.cs
diff --git a/src/Elastic.Clients.Elasticsearch/Common/Extensions/StringExtensions.cs b/src/Elastic.Clients.Elasticsearch/Core/Extensions/StringExtensions.cs
similarity index 100%
rename from src/Elastic.Clients.Elasticsearch/Common/Extensions/StringExtensions.cs
rename to src/Elastic.Clients.Elasticsearch/Core/Extensions/StringExtensions.cs
diff --git a/src/Elastic.Clients.Elasticsearch/Common/Extensions/SuffixExtensions.cs b/src/Elastic.Clients.Elasticsearch/Core/Extensions/SuffixExtensions.cs
similarity index 100%
rename from src/Elastic.Clients.Elasticsearch/Common/Extensions/SuffixExtensions.cs
rename to src/Elastic.Clients.Elasticsearch/Core/Extensions/SuffixExtensions.cs
diff --git a/src/Elastic.Clients.Elasticsearch/Common/Extensions/TypeExtensions.cs b/src/Elastic.Clients.Elasticsearch/Core/Extensions/TypeExtensions.cs
similarity index 100%
rename from src/Elastic.Clients.Elasticsearch/Common/Extensions/TypeExtensions.cs
rename to src/Elastic.Clients.Elasticsearch/Core/Extensions/TypeExtensions.cs
diff --git a/src/Elastic.Clients.Elasticsearch/Common/Fields/FieldValue.cs b/src/Elastic.Clients.Elasticsearch/Core/Fields/FieldValue.cs
similarity index 100%
rename from src/Elastic.Clients.Elasticsearch/Common/Fields/FieldValue.cs
rename to src/Elastic.Clients.Elasticsearch/Core/Fields/FieldValue.cs
diff --git a/src/Elastic.Clients.Elasticsearch/Common/Fields/FieldValues.cs b/src/Elastic.Clients.Elasticsearch/Core/Fields/FieldValues.cs
similarity index 100%
rename from src/Elastic.Clients.Elasticsearch/Common/Fields/FieldValues.cs
rename to src/Elastic.Clients.Elasticsearch/Core/Fields/FieldValues.cs
diff --git a/src/Elastic.Clients.Elasticsearch/Common/Fluent/Descriptor.cs b/src/Elastic.Clients.Elasticsearch/Core/Fluent/Descriptor.cs
similarity index 100%
rename from src/Elastic.Clients.Elasticsearch/Common/Fluent/Descriptor.cs
rename to src/Elastic.Clients.Elasticsearch/Core/Fluent/Descriptor.cs
diff --git a/src/Elastic.Clients.Elasticsearch/Common/Fluent/Fluent.cs b/src/Elastic.Clients.Elasticsearch/Core/Fluent/Fluent.cs
similarity index 100%
rename from src/Elastic.Clients.Elasticsearch/Common/Fluent/Fluent.cs
rename to src/Elastic.Clients.Elasticsearch/Core/Fluent/Fluent.cs
diff --git a/src/Elastic.Clients.Elasticsearch/Common/Fluent/FluentDictionary.cs b/src/Elastic.Clients.Elasticsearch/Core/Fluent/FluentDictionary.cs
similarity index 100%
rename from src/Elastic.Clients.Elasticsearch/Common/Fluent/FluentDictionary.cs
rename to src/Elastic.Clients.Elasticsearch/Core/Fluent/FluentDictionary.cs
diff --git a/src/Elastic.Clients.Elasticsearch/Common/Fluent/IBuildableDescriptor.cs b/src/Elastic.Clients.Elasticsearch/Core/Fluent/IBuildableDescriptor.cs
similarity index 100%
rename from src/Elastic.Clients.Elasticsearch/Common/Fluent/IBuildableDescriptor.cs
rename to src/Elastic.Clients.Elasticsearch/Core/Fluent/IBuildableDescriptor.cs
diff --git a/src/Elastic.Clients.Elasticsearch/Common/Fluent/Promise/IPromise.cs b/src/Elastic.Clients.Elasticsearch/Core/Fluent/Promise/IPromise.cs
similarity index 100%
rename from src/Elastic.Clients.Elasticsearch/Common/Fluent/Promise/IPromise.cs
rename to src/Elastic.Clients.Elasticsearch/Core/Fluent/Promise/IPromise.cs
diff --git a/src/Elastic.Clients.Elasticsearch/Common/Fluent/Promise/IsADictionaryDescriptor.cs b/src/Elastic.Clients.Elasticsearch/Core/Fluent/Promise/IsADictionaryDescriptor.cs
similarity index 100%
rename from src/Elastic.Clients.Elasticsearch/Common/Fluent/Promise/IsADictionaryDescriptor.cs
rename to src/Elastic.Clients.Elasticsearch/Core/Fluent/Promise/IsADictionaryDescriptor.cs
diff --git a/src/Elastic.Clients.Elasticsearch/Common/Fluent/Promise/PromiseDescriptor.cs b/src/Elastic.Clients.Elasticsearch/Core/Fluent/Promise/PromiseDescriptor.cs
similarity index 100%
rename from src/Elastic.Clients.Elasticsearch/Common/Fluent/Promise/PromiseDescriptor.cs
rename to src/Elastic.Clients.Elasticsearch/Core/Fluent/Promise/PromiseDescriptor.cs
diff --git a/src/Elastic.Clients.Elasticsearch/Common/Infer/DefaultPropertyMappingProvider.cs b/src/Elastic.Clients.Elasticsearch/Core/Infer/DefaultPropertyMappingProvider.cs
similarity index 100%
rename from src/Elastic.Clients.Elasticsearch/Common/Infer/DefaultPropertyMappingProvider.cs
rename to src/Elastic.Clients.Elasticsearch/Core/Infer/DefaultPropertyMappingProvider.cs
diff --git a/src/Elastic.Clients.Elasticsearch/Common/Infer/DocumentPath/DocumentPath.cs b/src/Elastic.Clients.Elasticsearch/Core/Infer/DocumentPath/DocumentPath.cs
similarity index 100%
rename from src/Elastic.Clients.Elasticsearch/Common/Infer/DocumentPath/DocumentPath.cs
rename to src/Elastic.Clients.Elasticsearch/Core/Infer/DocumentPath/DocumentPath.cs
diff --git a/src/Elastic.Clients.Elasticsearch/Common/Infer/Field/Field.cs b/src/Elastic.Clients.Elasticsearch/Core/Infer/Field/Field.cs
similarity index 100%
rename from src/Elastic.Clients.Elasticsearch/Common/Infer/Field/Field.cs
rename to src/Elastic.Clients.Elasticsearch/Core/Infer/Field/Field.cs
diff --git a/src/Elastic.Clients.Elasticsearch/Common/Infer/Field/FieldConverter.cs b/src/Elastic.Clients.Elasticsearch/Core/Infer/Field/FieldConverter.cs
similarity index 100%
rename from src/Elastic.Clients.Elasticsearch/Common/Infer/Field/FieldConverter.cs
rename to src/Elastic.Clients.Elasticsearch/Core/Infer/Field/FieldConverter.cs
diff --git a/src/Elastic.Clients.Elasticsearch/Common/Infer/Field/FieldExpressionVisitor.cs b/src/Elastic.Clients.Elasticsearch/Core/Infer/Field/FieldExpressionVisitor.cs
similarity index 100%
rename from src/Elastic.Clients.Elasticsearch/Common/Infer/Field/FieldExpressionVisitor.cs
rename to src/Elastic.Clients.Elasticsearch/Core/Infer/Field/FieldExpressionVisitor.cs
diff --git a/src/Elastic.Clients.Elasticsearch/Common/Infer/Field/FieldExtensions.cs b/src/Elastic.Clients.Elasticsearch/Core/Infer/Field/FieldExtensions.cs
similarity index 100%
rename from src/Elastic.Clients.Elasticsearch/Common/Infer/Field/FieldExtensions.cs
rename to src/Elastic.Clients.Elasticsearch/Core/Infer/Field/FieldExtensions.cs
diff --git a/src/Elastic.Clients.Elasticsearch/Common/Infer/Field/FieldResolver.cs b/src/Elastic.Clients.Elasticsearch/Core/Infer/Field/FieldResolver.cs
similarity index 100%
rename from src/Elastic.Clients.Elasticsearch/Common/Infer/Field/FieldResolver.cs
rename to src/Elastic.Clients.Elasticsearch/Core/Infer/Field/FieldResolver.cs
diff --git a/src/Elastic.Clients.Elasticsearch/Common/Infer/Field/ToStringExpressionVisitor.cs b/src/Elastic.Clients.Elasticsearch/Core/Infer/Field/ToStringExpressionVisitor.cs
similarity index 100%
rename from src/Elastic.Clients.Elasticsearch/Common/Infer/Field/ToStringExpressionVisitor.cs
rename to src/Elastic.Clients.Elasticsearch/Core/Infer/Field/ToStringExpressionVisitor.cs
diff --git a/src/Elastic.Clients.Elasticsearch/Common/Infer/Fields/Fields.cs b/src/Elastic.Clients.Elasticsearch/Core/Infer/Fields/Fields.cs
similarity index 100%
rename from src/Elastic.Clients.Elasticsearch/Common/Infer/Fields/Fields.cs
rename to src/Elastic.Clients.Elasticsearch/Core/Infer/Fields/Fields.cs
diff --git a/src/Elastic.Clients.Elasticsearch/Common/Infer/Fields/FieldsConverter.cs b/src/Elastic.Clients.Elasticsearch/Core/Infer/Fields/FieldsConverter.cs
similarity index 100%
rename from src/Elastic.Clients.Elasticsearch/Common/Infer/Fields/FieldsConverter.cs
rename to src/Elastic.Clients.Elasticsearch/Core/Infer/Fields/FieldsConverter.cs
diff --git a/src/Elastic.Clients.Elasticsearch/Common/Infer/Fields/FieldsDescriptor.cs b/src/Elastic.Clients.Elasticsearch/Core/Infer/Fields/FieldsDescriptor.cs
similarity index 100%
rename from src/Elastic.Clients.Elasticsearch/Common/Infer/Fields/FieldsDescriptor.cs
rename to src/Elastic.Clients.Elasticsearch/Core/Infer/Fields/FieldsDescriptor.cs
diff --git a/src/Elastic.Clients.Elasticsearch/Common/Infer/IPropertyMappingProvider.cs b/src/Elastic.Clients.Elasticsearch/Core/Infer/IPropertyMappingProvider.cs
similarity index 100%
rename from src/Elastic.Clients.Elasticsearch/Common/Infer/IPropertyMappingProvider.cs
rename to src/Elastic.Clients.Elasticsearch/Core/Infer/IPropertyMappingProvider.cs
diff --git a/src/Elastic.Clients.Elasticsearch/Common/Infer/Id/Id.cs b/src/Elastic.Clients.Elasticsearch/Core/Infer/Id/Id.cs
similarity index 100%
rename from src/Elastic.Clients.Elasticsearch/Common/Infer/Id/Id.cs
rename to src/Elastic.Clients.Elasticsearch/Core/Infer/Id/Id.cs
diff --git a/src/Elastic.Clients.Elasticsearch/Common/Infer/Id/IdConverter.cs b/src/Elastic.Clients.Elasticsearch/Core/Infer/Id/IdConverter.cs
similarity index 100%
rename from src/Elastic.Clients.Elasticsearch/Common/Infer/Id/IdConverter.cs
rename to src/Elastic.Clients.Elasticsearch/Core/Infer/Id/IdConverter.cs
diff --git a/src/Elastic.Clients.Elasticsearch/Common/Infer/Id/IdExtensions.cs b/src/Elastic.Clients.Elasticsearch/Core/Infer/Id/IdExtensions.cs
similarity index 100%
rename from src/Elastic.Clients.Elasticsearch/Common/Infer/Id/IdExtensions.cs
rename to src/Elastic.Clients.Elasticsearch/Core/Infer/Id/IdExtensions.cs
diff --git a/src/Elastic.Clients.Elasticsearch/Common/Infer/Id/IdResolver.cs b/src/Elastic.Clients.Elasticsearch/Core/Infer/Id/IdResolver.cs
similarity index 100%
rename from src/Elastic.Clients.Elasticsearch/Common/Infer/Id/IdResolver.cs
rename to src/Elastic.Clients.Elasticsearch/Core/Infer/Id/IdResolver.cs
diff --git a/src/Elastic.Clients.Elasticsearch/Common/Infer/Id/Ids.cs b/src/Elastic.Clients.Elasticsearch/Core/Infer/Id/Ids.cs
similarity index 100%
rename from src/Elastic.Clients.Elasticsearch/Common/Infer/Id/Ids.cs
rename to src/Elastic.Clients.Elasticsearch/Core/Infer/Id/Ids.cs
diff --git a/src/Elastic.Clients.Elasticsearch/Common/Infer/IndexName/IndexName.cs b/src/Elastic.Clients.Elasticsearch/Core/Infer/IndexName/IndexName.cs
similarity index 100%
rename from src/Elastic.Clients.Elasticsearch/Common/Infer/IndexName/IndexName.cs
rename to src/Elastic.Clients.Elasticsearch/Core/Infer/IndexName/IndexName.cs
diff --git a/src/Elastic.Clients.Elasticsearch/Common/Infer/IndexName/IndexNameConverter.cs b/src/Elastic.Clients.Elasticsearch/Core/Infer/IndexName/IndexNameConverter.cs
similarity index 100%
rename from src/Elastic.Clients.Elasticsearch/Common/Infer/IndexName/IndexNameConverter.cs
rename to src/Elastic.Clients.Elasticsearch/Core/Infer/IndexName/IndexNameConverter.cs
diff --git a/src/Elastic.Clients.Elasticsearch/Common/Infer/IndexName/IndexNameExtensions.cs b/src/Elastic.Clients.Elasticsearch/Core/Infer/IndexName/IndexNameExtensions.cs
similarity index 100%
rename from src/Elastic.Clients.Elasticsearch/Common/Infer/IndexName/IndexNameExtensions.cs
rename to src/Elastic.Clients.Elasticsearch/Core/Infer/IndexName/IndexNameExtensions.cs
diff --git a/src/Elastic.Clients.Elasticsearch/Common/Infer/IndexName/IndexNameResolver.cs b/src/Elastic.Clients.Elasticsearch/Core/Infer/IndexName/IndexNameResolver.cs
similarity index 100%
rename from src/Elastic.Clients.Elasticsearch/Common/Infer/IndexName/IndexNameResolver.cs
rename to src/Elastic.Clients.Elasticsearch/Core/Infer/IndexName/IndexNameResolver.cs
diff --git a/src/Elastic.Clients.Elasticsearch/Common/Infer/Indices/Indices.cs b/src/Elastic.Clients.Elasticsearch/Core/Infer/Indices/Indices.cs
similarity index 100%
rename from src/Elastic.Clients.Elasticsearch/Common/Infer/Indices/Indices.cs
rename to src/Elastic.Clients.Elasticsearch/Core/Infer/Indices/Indices.cs
diff --git a/src/Elastic.Clients.Elasticsearch/Common/Infer/Inferrer.cs b/src/Elastic.Clients.Elasticsearch/Core/Infer/Inferrer.cs
similarity index 100%
rename from src/Elastic.Clients.Elasticsearch/Common/Infer/Inferrer.cs
rename to src/Elastic.Clients.Elasticsearch/Core/Infer/Inferrer.cs
diff --git a/src/Elastic.Clients.Elasticsearch/Common/Infer/JoinField.cs b/src/Elastic.Clients.Elasticsearch/Core/Infer/JoinField.cs
similarity index 100%
rename from src/Elastic.Clients.Elasticsearch/Common/Infer/JoinField.cs
rename to src/Elastic.Clients.Elasticsearch/Core/Infer/JoinField.cs
diff --git a/src/Elastic.Clients.Elasticsearch/Common/Infer/JoinFieldConverter.cs b/src/Elastic.Clients.Elasticsearch/Core/Infer/JoinFieldConverter.cs
similarity index 100%
rename from src/Elastic.Clients.Elasticsearch/Common/Infer/JoinFieldConverter.cs
rename to src/Elastic.Clients.Elasticsearch/Core/Infer/JoinFieldConverter.cs
diff --git a/src/Elastic.Clients.Elasticsearch/Common/Infer/JoinFieldRouting/Routing.cs b/src/Elastic.Clients.Elasticsearch/Core/Infer/JoinFieldRouting/Routing.cs
similarity index 100%
rename from src/Elastic.Clients.Elasticsearch/Common/Infer/JoinFieldRouting/Routing.cs
rename to src/Elastic.Clients.Elasticsearch/Core/Infer/JoinFieldRouting/Routing.cs
diff --git a/src/Elastic.Clients.Elasticsearch/Common/Infer/JoinFieldRouting/RoutingConverter.cs b/src/Elastic.Clients.Elasticsearch/Core/Infer/JoinFieldRouting/RoutingConverter.cs
similarity index 100%
rename from src/Elastic.Clients.Elasticsearch/Common/Infer/JoinFieldRouting/RoutingConverter.cs
rename to src/Elastic.Clients.Elasticsearch/Core/Infer/JoinFieldRouting/RoutingConverter.cs
diff --git a/src/Elastic.Clients.Elasticsearch/Common/Infer/Metric/Metrics.cs b/src/Elastic.Clients.Elasticsearch/Core/Infer/Metric/Metrics.cs
similarity index 100%
rename from src/Elastic.Clients.Elasticsearch/Common/Infer/Metric/Metrics.cs
rename to src/Elastic.Clients.Elasticsearch/Core/Infer/Metric/Metrics.cs
diff --git a/src/Elastic.Clients.Elasticsearch/Common/Infer/PropertyMapping.cs b/src/Elastic.Clients.Elasticsearch/Core/Infer/PropertyMapping.cs
similarity index 100%
rename from src/Elastic.Clients.Elasticsearch/Common/Infer/PropertyMapping.cs
rename to src/Elastic.Clients.Elasticsearch/Core/Infer/PropertyMapping.cs
diff --git a/src/Elastic.Clients.Elasticsearch/Common/Infer/PropertyName/PropertyName.cs b/src/Elastic.Clients.Elasticsearch/Core/Infer/PropertyName/PropertyName.cs
similarity index 100%
rename from src/Elastic.Clients.Elasticsearch/Common/Infer/PropertyName/PropertyName.cs
rename to src/Elastic.Clients.Elasticsearch/Core/Infer/PropertyName/PropertyName.cs
diff --git a/src/Elastic.Clients.Elasticsearch/Common/Infer/PropertyName/PropertyNameExtensions.cs b/src/Elastic.Clients.Elasticsearch/Core/Infer/PropertyName/PropertyNameExtensions.cs
similarity index 100%
rename from src/Elastic.Clients.Elasticsearch/Common/Infer/PropertyName/PropertyNameExtensions.cs
rename to src/Elastic.Clients.Elasticsearch/Core/Infer/PropertyName/PropertyNameExtensions.cs
diff --git a/src/Elastic.Clients.Elasticsearch/Common/Infer/RelationName/RelationName.cs b/src/Elastic.Clients.Elasticsearch/Core/Infer/RelationName/RelationName.cs
similarity index 100%
rename from src/Elastic.Clients.Elasticsearch/Common/Infer/RelationName/RelationName.cs
rename to src/Elastic.Clients.Elasticsearch/Core/Infer/RelationName/RelationName.cs
diff --git a/src/Elastic.Clients.Elasticsearch/Common/Infer/RelationName/RelationNameResolver.cs b/src/Elastic.Clients.Elasticsearch/Core/Infer/RelationName/RelationNameResolver.cs
similarity index 100%
rename from src/Elastic.Clients.Elasticsearch/Common/Infer/RelationName/RelationNameResolver.cs
rename to src/Elastic.Clients.Elasticsearch/Core/Infer/RelationName/RelationNameResolver.cs
diff --git a/src/Elastic.Clients.Elasticsearch/Common/Infer/RoutingResolver.cs b/src/Elastic.Clients.Elasticsearch/Core/Infer/RoutingResolver.cs
similarity index 100%
rename from src/Elastic.Clients.Elasticsearch/Common/Infer/RoutingResolver.cs
rename to src/Elastic.Clients.Elasticsearch/Core/Infer/RoutingResolver.cs
diff --git a/src/Elastic.Clients.Elasticsearch/Common/Infer/Timestamp/Timestamp.cs b/src/Elastic.Clients.Elasticsearch/Core/Infer/Timestamp/Timestamp.cs
similarity index 100%
rename from src/Elastic.Clients.Elasticsearch/Common/Infer/Timestamp/Timestamp.cs
rename to src/Elastic.Clients.Elasticsearch/Core/Infer/Timestamp/Timestamp.cs
diff --git a/src/Elastic.Clients.Elasticsearch/Common/IsADictionary.cs b/src/Elastic.Clients.Elasticsearch/Core/IsADictionary.cs
similarity index 100%
rename from src/Elastic.Clients.Elasticsearch/Common/IsADictionary.cs
rename to src/Elastic.Clients.Elasticsearch/Core/IsADictionary.cs
diff --git a/src/Elastic.Clients.Elasticsearch/Common/IsAReadOnlyDictionary.cs b/src/Elastic.Clients.Elasticsearch/Core/IsAReadOnlyDictionary.cs
similarity index 100%
rename from src/Elastic.Clients.Elasticsearch/Common/IsAReadOnlyDictionary.cs
rename to src/Elastic.Clients.Elasticsearch/Core/IsAReadOnlyDictionary.cs
diff --git a/src/Elastic.Clients.Elasticsearch/Common/LazyJson.cs b/src/Elastic.Clients.Elasticsearch/Core/LazyJson.cs
similarity index 100%
rename from src/Elastic.Clients.Elasticsearch/Common/LazyJson.cs
rename to src/Elastic.Clients.Elasticsearch/Core/LazyJson.cs
diff --git a/src/Elastic.Clients.Elasticsearch/Common/MinimumShouldMatch.cs b/src/Elastic.Clients.Elasticsearch/Core/MinimumShouldMatch.cs
similarity index 100%
rename from src/Elastic.Clients.Elasticsearch/Common/MinimumShouldMatch.cs
rename to src/Elastic.Clients.Elasticsearch/Core/MinimumShouldMatch.cs
diff --git a/src/Elastic.Clients.Elasticsearch/Common/Query/Query.cs b/src/Elastic.Clients.Elasticsearch/Core/Query/Query.cs
similarity index 100%
rename from src/Elastic.Clients.Elasticsearch/Common/Query/Query.cs
rename to src/Elastic.Clients.Elasticsearch/Core/Query/Query.cs
diff --git a/src/Elastic.Clients.Elasticsearch/Common/RawJsonString.cs b/src/Elastic.Clients.Elasticsearch/Core/RawJsonString.cs
similarity index 100%
rename from src/Elastic.Clients.Elasticsearch/Common/RawJsonString.cs
rename to src/Elastic.Clients.Elasticsearch/Core/RawJsonString.cs
diff --git a/src/Elastic.Clients.Elasticsearch/Common/ReadOnlyIndexNameDictionary.cs b/src/Elastic.Clients.Elasticsearch/Core/ReadOnlyIndexNameDictionary.cs
similarity index 100%
rename from src/Elastic.Clients.Elasticsearch/Common/ReadOnlyIndexNameDictionary.cs
rename to src/Elastic.Clients.Elasticsearch/Core/ReadOnlyIndexNameDictionary.cs
diff --git a/src/Elastic.Clients.Elasticsearch/Common/Request/ApiUrls.cs b/src/Elastic.Clients.Elasticsearch/Core/Request/ApiUrls.cs
similarity index 100%
rename from src/Elastic.Clients.Elasticsearch/Common/Request/ApiUrls.cs
rename to src/Elastic.Clients.Elasticsearch/Core/Request/ApiUrls.cs
diff --git a/src/Elastic.Clients.Elasticsearch/Common/Request/IRequest.cs b/src/Elastic.Clients.Elasticsearch/Core/Request/IRequest.cs
similarity index 100%
rename from src/Elastic.Clients.Elasticsearch/Common/Request/IRequest.cs
rename to src/Elastic.Clients.Elasticsearch/Core/Request/IRequest.cs
diff --git a/src/Elastic.Clients.Elasticsearch/Common/Request/PlainRequest.cs b/src/Elastic.Clients.Elasticsearch/Core/Request/PlainRequest.cs
similarity index 100%
rename from src/Elastic.Clients.Elasticsearch/Common/Request/PlainRequest.cs
rename to src/Elastic.Clients.Elasticsearch/Core/Request/PlainRequest.cs
diff --git a/src/Elastic.Clients.Elasticsearch/Common/Request/Request.cs b/src/Elastic.Clients.Elasticsearch/Core/Request/Request.cs
similarity index 100%
rename from src/Elastic.Clients.Elasticsearch/Common/Request/Request.cs
rename to src/Elastic.Clients.Elasticsearch/Core/Request/Request.cs
diff --git a/src/Elastic.Clients.Elasticsearch/Common/Request/RequestDescriptor.cs b/src/Elastic.Clients.Elasticsearch/Core/Request/RequestDescriptor.cs
similarity index 100%
rename from src/Elastic.Clients.Elasticsearch/Common/Request/RequestDescriptor.cs
rename to src/Elastic.Clients.Elasticsearch/Core/Request/RequestDescriptor.cs
diff --git a/src/Elastic.Clients.Elasticsearch/Common/Request/RouteValues.cs b/src/Elastic.Clients.Elasticsearch/Core/Request/RouteValues.cs
similarity index 100%
rename from src/Elastic.Clients.Elasticsearch/Common/Request/RouteValues.cs
rename to src/Elastic.Clients.Elasticsearch/Core/Request/RouteValues.cs
diff --git a/src/Elastic.Clients.Elasticsearch/Common/Request/UrlLookup.cs b/src/Elastic.Clients.Elasticsearch/Core/Request/UrlLookup.cs
similarity index 100%
rename from src/Elastic.Clients.Elasticsearch/Common/Request/UrlLookup.cs
rename to src/Elastic.Clients.Elasticsearch/Core/Request/UrlLookup.cs
diff --git a/src/Elastic.Clients.Elasticsearch/Common/Response/ExistsResponseBase.cs b/src/Elastic.Clients.Elasticsearch/Core/Response/ExistsResponseBase.cs
similarity index 100%
rename from src/Elastic.Clients.Elasticsearch/Common/Response/ExistsResponseBase.cs
rename to src/Elastic.Clients.Elasticsearch/Core/Response/ExistsResponseBase.cs
diff --git a/src/Elastic.Clients.Elasticsearch/Common/Static/Infer.cs b/src/Elastic.Clients.Elasticsearch/Core/Static/Infer.cs
similarity index 100%
rename from src/Elastic.Clients.Elasticsearch/Common/Static/Infer.cs
rename to src/Elastic.Clients.Elasticsearch/Core/Static/Infer.cs
diff --git a/src/Elastic.Clients.Elasticsearch/Common/Union/Union.cs b/src/Elastic.Clients.Elasticsearch/Core/Union/Union.cs
similarity index 100%
rename from src/Elastic.Clients.Elasticsearch/Common/Union/Union.cs
rename to src/Elastic.Clients.Elasticsearch/Core/Union/Union.cs
diff --git a/src/Elastic.Clients.Elasticsearch/Common/UrlParameters/DataStreamNames/DataStreamName.cs b/src/Elastic.Clients.Elasticsearch/Core/UrlParameters/DataStreamNames/DataStreamName.cs
similarity index 100%
rename from src/Elastic.Clients.Elasticsearch/Common/UrlParameters/DataStreamNames/DataStreamName.cs
rename to src/Elastic.Clients.Elasticsearch/Core/UrlParameters/DataStreamNames/DataStreamName.cs
diff --git a/src/Elastic.Clients.Elasticsearch/Common/UrlParameters/DataStreamNames/DataStreamNames.cs b/src/Elastic.Clients.Elasticsearch/Core/UrlParameters/DataStreamNames/DataStreamNames.cs
similarity index 100%
rename from src/Elastic.Clients.Elasticsearch/Common/UrlParameters/DataStreamNames/DataStreamNames.cs
rename to src/Elastic.Clients.Elasticsearch/Core/UrlParameters/DataStreamNames/DataStreamNames.cs
diff --git a/src/Elastic.Clients.Elasticsearch/Common/UrlParameters/IndexAlias/IndexAlias.cs b/src/Elastic.Clients.Elasticsearch/Core/UrlParameters/IndexAlias/IndexAlias.cs
similarity index 100%
rename from src/Elastic.Clients.Elasticsearch/Common/UrlParameters/IndexAlias/IndexAlias.cs
rename to src/Elastic.Clients.Elasticsearch/Core/UrlParameters/IndexAlias/IndexAlias.cs
diff --git a/src/Elastic.Clients.Elasticsearch/Common/UrlParameters/IndexUuid/IndexUuid.cs b/src/Elastic.Clients.Elasticsearch/Core/UrlParameters/IndexUuid/IndexUuid.cs
similarity index 100%
rename from src/Elastic.Clients.Elasticsearch/Common/UrlParameters/IndexUuid/IndexUuid.cs
rename to src/Elastic.Clients.Elasticsearch/Core/UrlParameters/IndexUuid/IndexUuid.cs
diff --git a/src/Elastic.Clients.Elasticsearch/Common/UrlParameters/Name/Name.cs b/src/Elastic.Clients.Elasticsearch/Core/UrlParameters/Name/Name.cs
similarity index 100%
rename from src/Elastic.Clients.Elasticsearch/Common/UrlParameters/Name/Name.cs
rename to src/Elastic.Clients.Elasticsearch/Core/UrlParameters/Name/Name.cs
diff --git a/src/Elastic.Clients.Elasticsearch/Common/UrlParameters/Name/Names.cs b/src/Elastic.Clients.Elasticsearch/Core/UrlParameters/Name/Names.cs
similarity index 100%
rename from src/Elastic.Clients.Elasticsearch/Common/UrlParameters/Name/Names.cs
rename to src/Elastic.Clients.Elasticsearch/Core/UrlParameters/Name/Names.cs
diff --git a/src/Elastic.Clients.Elasticsearch/Common/UrlParameters/NodeIds/NodeIds.cs b/src/Elastic.Clients.Elasticsearch/Core/UrlParameters/NodeIds/NodeIds.cs
similarity index 100%
rename from src/Elastic.Clients.Elasticsearch/Common/UrlParameters/NodeIds/NodeIds.cs
rename to src/Elastic.Clients.Elasticsearch/Core/UrlParameters/NodeIds/NodeIds.cs
diff --git a/src/Elastic.Clients.Elasticsearch/Common/UrlParameters/ScrollIds/ScrollId.cs b/src/Elastic.Clients.Elasticsearch/Core/UrlParameters/ScrollIds/ScrollId.cs
similarity index 100%
rename from src/Elastic.Clients.Elasticsearch/Common/UrlParameters/ScrollIds/ScrollId.cs
rename to src/Elastic.Clients.Elasticsearch/Core/UrlParameters/ScrollIds/ScrollId.cs
diff --git a/src/Elastic.Clients.Elasticsearch/Common/UrlParameters/ScrollIds/ScrollIds.cs b/src/Elastic.Clients.Elasticsearch/Core/UrlParameters/ScrollIds/ScrollIds.cs
similarity index 100%
rename from src/Elastic.Clients.Elasticsearch/Common/UrlParameters/ScrollIds/ScrollIds.cs
rename to src/Elastic.Clients.Elasticsearch/Core/UrlParameters/ScrollIds/ScrollIds.cs
diff --git a/src/Elastic.Clients.Elasticsearch/Common/UrlParameters/TaskId/TaskId.cs b/src/Elastic.Clients.Elasticsearch/Core/UrlParameters/TaskId/TaskId.cs
similarity index 100%
rename from src/Elastic.Clients.Elasticsearch/Common/UrlParameters/TaskId/TaskId.cs
rename to src/Elastic.Clients.Elasticsearch/Core/UrlParameters/TaskId/TaskId.cs
diff --git a/src/Elastic.Clients.Elasticsearch/Common/UrlParameters/Username/Username.cs b/src/Elastic.Clients.Elasticsearch/Core/UrlParameters/Username/Username.cs
similarity index 100%
rename from src/Elastic.Clients.Elasticsearch/Common/UrlParameters/Username/Username.cs
rename to src/Elastic.Clients.Elasticsearch/Core/UrlParameters/Username/Username.cs
diff --git a/src/Elastic.Clients.Elasticsearch/Types/Aggregations/TermsExclude.cs b/src/Elastic.Clients.Elasticsearch/Types/Aggregations/TermsExclude.cs
new file mode 100644
index 00000000000..cc23cd076cc
--- /dev/null
+++ b/src/Elastic.Clients.Elasticsearch/Types/Aggregations/TermsExclude.cs
@@ -0,0 +1,88 @@
+// Licensed to Elasticsearch B.V under one or more agreements.
+// Elasticsearch B.V licenses this file to you under the Apache 2.0 License.
+// See the LICENSE file in the project root for more information.
+
+using System;
+using System.Collections.Generic;
+using System.Text.Json;
+using System.Text.Json.Serialization;
+
+namespace Elastic.Clients.Elasticsearch.Types.Aggregations;
+
+///
+/// Filters which terms to exclude from the response.
+///
+[JsonConverter(typeof(TermsExcludeConverter))]
+public sealed class TermsExclude
+{
+ ///
+ /// Creates an instance of that uses a regular expression pattern
+ /// to determine the terms to exclude from the response.
+ ///
+ /// The regular expression pattern.
+ public TermsExclude(string regexPattern) => RegexPattern = regexPattern;
+
+ ///
+ /// Creates an instance of that uses a collection of terms
+ /// to exclude from the response.
+ ///
+ /// The exact terms to exclude.
+ public TermsExclude(ICollection values) => Values = values;
+
+ ///
+ /// The regular expression pattern to determine terms to exclude from the response.
+ ///
+ public string? RegexPattern { get; }
+
+ ///
+ /// Collection of terms to exclude from the response.
+ ///
+ public ICollection? Values { get; }
+}
+
+internal sealed class TermsExcludeConverter : JsonConverter
+{
+ public override TermsExclude? Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)
+ {
+ if (reader.TokenType == JsonTokenType.Null)
+ {
+ reader.Read();
+ return null;
+ }
+
+ TermsExclude termsExclude;
+
+ switch (reader.TokenType)
+ {
+ case JsonTokenType.StartArray:
+ var terms = JsonSerializer.Deserialize>(ref reader, options);
+ termsExclude = new TermsExclude(terms);
+ break;
+ case JsonTokenType.String:
+ var regex = reader.GetString();
+ termsExclude = new TermsExclude(regex);
+ break;
+ default:
+ throw new JsonException($"Unexpected token {reader.TokenType} when deserializing {nameof(TermsExclude)}");
+ }
+
+ return termsExclude;
+ }
+
+ public override void Write(Utf8JsonWriter writer, TermsExclude value, JsonSerializerOptions options)
+ {
+ if (value is null)
+ {
+ writer.WriteNullValue();
+ return;
+ }
+
+ if (value.Values is not null)
+ {
+ JsonSerializer.Serialize>(writer, value.Values, options);
+ return;
+ }
+
+ writer.WriteStringValue(value.RegexPattern);
+ }
+}
diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/TermsAggregation.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/TermsAggregation.g.cs
index 9b29c320a4a..31ef4200af7 100644
--- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/TermsAggregation.g.cs
+++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/TermsAggregation.g.cs
@@ -55,7 +55,7 @@ public override TermsAggregation Read(ref Utf8JsonReader reader, Type typeToConv
if (reader.ValueTextEquals("exclude"))
{
reader.Read();
- var value = SingleOrManySerializationHelper.Deserialize(ref reader, options);
+ var value = JsonSerializer.Deserialize(ref reader, options);
if (value is not null)
{
agg.Exclude = value;
@@ -267,7 +267,7 @@ public override void Write(Utf8JsonWriter writer, TermsAggregation value, JsonSe
if (value.Exclude is not null)
{
writer.WritePropertyName("exclude");
- SingleOrManySerializationHelper.Serialize(value.Exclude, writer, options);
+ JsonSerializer.Serialize(writer, value.Exclude, options);
}
if (value.ExecutionHint is not null)
@@ -377,8 +377,7 @@ internal TermsAggregation()
public Elastic.Clients.Elasticsearch.Aggregations.TermsAggregationCollectMode? CollectMode { get; set; }
- [JsonConverter(typeof(TermsExcludeConverter))]
- public IList? Exclude { get; set; }
+ public Elastic.Clients.Elasticsearch.Aggregations.TermsExclude? Exclude { get; set; }
public Elastic.Clients.Elasticsearch.Aggregations.TermsAggregationExecutionHint? ExecutionHint { get; set; }
@@ -427,7 +426,7 @@ public TermsAggregationDescriptor() : base()
private Elastic.Clients.Elasticsearch.Aggregations.TermsAggregationCollectMode? CollectModeValue { get; set; }
- private IList? ExcludeValue { get; set; }
+ private Elastic.Clients.Elasticsearch.Aggregations.TermsExclude? ExcludeValue { get; set; }
private Elastic.Clients.Elasticsearch.Aggregations.TermsAggregationExecutionHint? ExecutionHintValue { get; set; }
@@ -487,7 +486,7 @@ public TermsAggregationDescriptor CollectMode(Elastic.Clients.Elastic
return Self;
}
- public TermsAggregationDescriptor Exclude(IList? exclude)
+ public TermsAggregationDescriptor Exclude(Elastic.Clients.Elasticsearch.Aggregations.TermsExclude? exclude)
{
ExcludeValue = exclude;
return Self;
@@ -597,7 +596,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o
if (ExcludeValue is not null)
{
writer.WritePropertyName("exclude");
- SingleOrManySerializationHelper.Serialize(ExcludeValue, writer, options);
+ JsonSerializer.Serialize(writer, ExcludeValue, options);
}
if (ExecutionHintValue is not null)
@@ -720,7 +719,7 @@ public TermsAggregationDescriptor() : base()
private Elastic.Clients.Elasticsearch.Aggregations.TermsAggregationCollectMode? CollectModeValue { get; set; }
- private IList? ExcludeValue { get; set; }
+ private Elastic.Clients.Elasticsearch.Aggregations.TermsExclude? ExcludeValue { get; set; }
private Elastic.Clients.Elasticsearch.Aggregations.TermsAggregationExecutionHint? ExecutionHintValue { get; set; }
@@ -780,7 +779,7 @@ public TermsAggregationDescriptor CollectMode(Elastic.Clients.Elasticsearch.Aggr
return Self;
}
- public TermsAggregationDescriptor Exclude(IList? exclude)
+ public TermsAggregationDescriptor Exclude(Elastic.Clients.Elasticsearch.Aggregations.TermsExclude? exclude)
{
ExcludeValue = exclude;
return Self;
@@ -896,7 +895,7 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o
if (ExcludeValue is not null)
{
writer.WritePropertyName("exclude");
- SingleOrManySerializationHelper.Serialize(ExcludeValue, writer, options);
+ JsonSerializer.Serialize(writer, ExcludeValue, options);
}
if (ExecutionHintValue is not null)
diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/TermsExcludeConverter.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/TermsExclude.g.cs
similarity index 83%
rename from src/Elastic.Clients.Elasticsearch/_Generated/Types/TermsExcludeConverter.g.cs
rename to src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/TermsExclude.g.cs
index 1a32417000b..ca4e1ee2267 100644
--- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/TermsExcludeConverter.g.cs
+++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/TermsExclude.g.cs
@@ -25,7 +25,14 @@
using System.Text.Json.Serialization;
#nullable restore
-namespace Elastic.Clients.Elasticsearch;
-internal sealed class TermsExcludeConverter : IEnumerableSingleOrManyConverter
+namespace Elastic.Clients.Elasticsearch.Aggregations;
+public partial class TermsExclude : Union>
{
+ public TermsExclude(string termsExclude) : base(termsExclude)
+ {
+ }
+
+ public TermsExclude(IReadOnlyCollection termsExclude) : base(termsExclude)
+ {
+ }
}
\ No newline at end of file
diff --git a/tests/Tests/Types/TermsExcludeSerializationTests.cs b/tests/Tests/Types/TermsExcludeSerializationTests.cs
new file mode 100644
index 00000000000..3d3b2d77da5
--- /dev/null
+++ b/tests/Tests/Types/TermsExcludeSerializationTests.cs
@@ -0,0 +1,51 @@
+// Licensed to Elasticsearch B.V under one or more agreements.
+// Elasticsearch B.V licenses this file to you under the Apache 2.0 License.
+// See the LICENSE file in the project root for more information.
+
+using System.Threading.Tasks;
+using Elastic.Clients.Elasticsearch.Types.Aggregations;
+using Tests.Serialization;
+using VerifyXunit;
+
+namespace Tests.Types;
+
+[UsesVerify]
+public class TermsExcludeSerializationTests : SerializerTestBase
+{
+ [U]
+ public async Task RoundTripSerialize_TermsExlucdeWithRegexPattern()
+ {
+ const string pattern = "water_.*";
+
+ var target = new TestClass
+ {
+ Exclude = new TermsExclude(pattern)
+ };
+
+ var result = await RoundTripAndVerifyJsonAsync(target);
+
+ result.Exclude.RegexPattern.Should().Be(pattern);
+ result.Exclude.Values.Should().BeNull();
+ }
+
+ [U]
+ public async Task RoundTripSerialize_TermsExlucdeWithValues()
+ {
+ var values = new[] { "term_a", "term_b" };
+
+ var target = new TestClass
+ {
+ Exclude = new TermsExclude(values)
+ };
+
+ var result = await RoundTripAndVerifyJsonAsync(target);
+
+ result.Exclude.RegexPattern.Should().BeNull();
+ result.Exclude.Values.Should().Contain(values);
+ }
+
+ private class TestClass
+ {
+ public TermsExclude Exclude { get; set; }
+ }
+}
diff --git a/tests/Tests/_VerifySnapshots/TermsExcludeSerializationTests.RoundTripSerialize_TermsExlucdeWithRegexPattern.verified.txt b/tests/Tests/_VerifySnapshots/TermsExcludeSerializationTests.RoundTripSerialize_TermsExlucdeWithRegexPattern.verified.txt
new file mode 100644
index 00000000000..9660e07af8a
--- /dev/null
+++ b/tests/Tests/_VerifySnapshots/TermsExcludeSerializationTests.RoundTripSerialize_TermsExlucdeWithRegexPattern.verified.txt
@@ -0,0 +1,3 @@
+{
+ exclude: water_.*
+}
\ No newline at end of file
diff --git a/tests/Tests/_VerifySnapshots/TermsExcludeSerializationTests.RoundTripSerialize_TermsExlucdeWithValues.verified.txt b/tests/Tests/_VerifySnapshots/TermsExcludeSerializationTests.RoundTripSerialize_TermsExlucdeWithValues.verified.txt
new file mode 100644
index 00000000000..66e3eedb6df
--- /dev/null
+++ b/tests/Tests/_VerifySnapshots/TermsExcludeSerializationTests.RoundTripSerialize_TermsExlucdeWithValues.verified.txt
@@ -0,0 +1,6 @@
+{
+ exclude: [
+ term_a,
+ term_b
+ ]
+}
\ No newline at end of file