From 815ead9dfca5cbfe553ee9033b9222706e96b559 Mon Sep 17 00:00:00 2001 From: Steve Gordon Date: Wed, 19 Oct 2022 14:29:59 +0100 Subject: [PATCH] Remove geo-dependant types until code-gen is implemented (#6816) --- .../_Generated/Api/SearchResponse.g.cs | 4 +- .../Types/Enums/Enums.NoNamespace.g.cs | 42 -- .../Types/Enums/Enums.QueryDsl.g.cs | 49 --- .../_Generated/Types/GeoDistanceSort.g.cs | 298 ------------- .../Types/QueryDsl/GeoBoundingBoxQuery.g.cs | 256 ----------- .../Types/QueryDsl/GeoDistanceQuery.g.cs | 298 ------------- .../Types/QueryDsl/GeoPolygonPoints.g.cs | 42 -- .../Types/QueryDsl/GeoPolygonQuery.g.cs | 398 ------------------ .../Types/QueryDsl/GeoShapeFieldQuery.g.cs | 217 ---------- .../Types/QueryDsl/GeoShapeQuery.g.cs | 356 ---------------- .../Types/QueryDsl/QueryContainer.g.cs | 64 --- .../_Generated/Types/SortOptions.g.cs | 16 - .../GeoBoundsAggregateDeserializationTests.cs | 23 - 13 files changed, 2 insertions(+), 2061 deletions(-) delete mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Types/GeoDistanceSort.g.cs delete mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/GeoBoundingBoxQuery.g.cs delete mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/GeoDistanceQuery.g.cs delete mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/GeoPolygonPoints.g.cs delete mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/GeoPolygonQuery.g.cs delete mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/GeoShapeFieldQuery.g.cs delete mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/GeoShapeQuery.g.cs delete mode 100644 tests/Tests/Serialization/Aggregations/GeoBoundsAggregateDeserializationTests.cs diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/SearchResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/SearchResponse.g.cs index 5f5fc2a11f2..98e1ee7eb5a 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/SearchResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/SearchResponse.g.cs @@ -23,7 +23,7 @@ #nullable restore namespace Elastic.Clients.Elasticsearch; -public partial class SearchResponse : ElasticsearchResponseBase +public sealed partial class SearchResponse : ElasticsearchResponseBase { [JsonInclude] [JsonPropertyName("aggregations")] @@ -76,4 +76,4 @@ public partial class SearchResponse : ElasticsearchResponseBase [JsonInclude] [JsonPropertyName("took")] public long Took { get; init; } -} +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Enums/Enums.NoNamespace.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Enums/Enums.NoNamespace.g.cs index aa171aa6a71..c99a25ec40e 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Enums/Enums.NoNamespace.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Enums/Enums.NoNamespace.g.cs @@ -451,48 +451,6 @@ public override void Write(Utf8JsonWriter writer, FieldSortNumericType value, Js } } -[JsonConverter(typeof(GeoDistanceTypeConverter))] -public enum GeoDistanceType -{ - [EnumMember(Value = "plane")] - Plane, - [EnumMember(Value = "arc")] - Arc -} - -internal sealed class GeoDistanceTypeConverter : JsonConverter -{ - public override GeoDistanceType Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) - { - var enumString = reader.GetString(); - switch (enumString) - { - case "plane": - return GeoDistanceType.Plane; - case "arc": - return GeoDistanceType.Arc; - } - - ThrowHelper.ThrowJsonException(); - return default; - } - - public override void Write(Utf8JsonWriter writer, GeoDistanceType value, JsonSerializerOptions options) - { - switch (value) - { - case GeoDistanceType.Plane: - writer.WriteStringValue("plane"); - return; - case GeoDistanceType.Arc: - writer.WriteStringValue("arc"); - return; - } - - writer.WriteNullValue(); - } -} - [JsonConverter(typeof(GeoShapeRelationConverter))] public enum GeoShapeRelation { diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Enums/Enums.QueryDsl.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Enums/Enums.QueryDsl.g.cs index 8242b259432..765f0bc59de 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Enums/Enums.QueryDsl.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Enums/Enums.QueryDsl.g.cs @@ -409,55 +409,6 @@ public override void Write(Utf8JsonWriter writer, FunctionScoreMode value, JsonS } } -[JsonConverter(typeof(GeoValidationMethodConverter))] -public enum GeoValidationMethod -{ - [EnumMember(Value = "strict")] - Strict, - [EnumMember(Value = "ignore_malformed")] - IgnoreMalformed, - [EnumMember(Value = "coerce")] - Coerce -} - -internal sealed class GeoValidationMethodConverter : JsonConverter -{ - public override GeoValidationMethod Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) - { - var enumString = reader.GetString(); - switch (enumString) - { - case "strict": - return GeoValidationMethod.Strict; - case "ignore_malformed": - return GeoValidationMethod.IgnoreMalformed; - case "coerce": - return GeoValidationMethod.Coerce; - } - - ThrowHelper.ThrowJsonException(); - return default; - } - - public override void Write(Utf8JsonWriter writer, GeoValidationMethod value, JsonSerializerOptions options) - { - switch (value) - { - case GeoValidationMethod.Strict: - writer.WriteStringValue("strict"); - return; - case GeoValidationMethod.IgnoreMalformed: - writer.WriteStringValue("ignore_malformed"); - return; - case GeoValidationMethod.Coerce: - writer.WriteStringValue("coerce"); - return; - } - - writer.WriteNullValue(); - } -} - [JsonConverter(typeof(OperatorConverter))] public enum Operator { diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/GeoDistanceSort.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/GeoDistanceSort.g.cs deleted file mode 100644 index 4f2a1e6aad6..00000000000 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/GeoDistanceSort.g.cs +++ /dev/null @@ -1,298 +0,0 @@ -// 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. -// -// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ -// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ -// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ -// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ -// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ -// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ -// ------------------------------------------------ -// -// This file is automatically generated. -// Please do not edit these files manually. -// -// ------------------------------------------------ - -using Elastic.Clients.Elasticsearch.Fluent; -using Elastic.Clients.Elasticsearch.Serialization; -using System; -using System.Collections.Generic; -using System.Linq.Expressions; -using System.Text.Json; -using System.Text.Json.Serialization; - -#nullable restore -namespace Elastic.Clients.Elasticsearch; -internal sealed class GeoDistanceSortConverter : JsonConverter -{ - public override GeoDistanceSort Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) - { - if (reader.TokenType != JsonTokenType.StartObject) - throw new JsonException("Unexpected JSON detected."); - var variant = new GeoDistanceSort(); - while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) - { - if (reader.TokenType == JsonTokenType.PropertyName) - { - var property = reader.GetString(); - if (property == "distance_type") - { - variant.DistanceType = JsonSerializer.Deserialize(ref reader, options); - continue; - } - - if (property == "ignore_unmapped") - { - variant.IgnoreUnmapped = JsonSerializer.Deserialize(ref reader, options); - continue; - } - - if (property == "mode") - { - variant.Mode = JsonSerializer.Deserialize(ref reader, options); - continue; - } - - if (property == "order") - { - variant.Order = JsonSerializer.Deserialize(ref reader, options); - continue; - } - - if (property == "unit") - { - variant.Unit = JsonSerializer.Deserialize(ref reader, options); - continue; - } - } - } - - return variant; - } - - public override void Write(Utf8JsonWriter writer, GeoDistanceSort value, JsonSerializerOptions options) - { - writer.WriteStartObject(); - if (value.DistanceType is not null) - { - writer.WritePropertyName("distance_type"); - JsonSerializer.Serialize(writer, value.DistanceType, options); - } - - if (value.IgnoreUnmapped.HasValue) - { - writer.WritePropertyName("ignore_unmapped"); - writer.WriteBooleanValue(value.IgnoreUnmapped.Value); - } - - if (value.Mode is not null) - { - writer.WritePropertyName("mode"); - JsonSerializer.Serialize(writer, value.Mode, options); - } - - if (value.Order is not null) - { - writer.WritePropertyName("order"); - JsonSerializer.Serialize(writer, value.Order, options); - } - - if (value.Unit is not null) - { - writer.WritePropertyName("unit"); - JsonSerializer.Serialize(writer, value.Unit, options); - } - - writer.WriteEndObject(); - } -} - -[JsonConverter(typeof(GeoDistanceSortConverter))] -public sealed partial class GeoDistanceSort -{ - public Elastic.Clients.Elasticsearch.GeoDistanceType? DistanceType { get; set; } - - public Elastic.Clients.Elasticsearch.Field Field { get; set; } - - public bool? IgnoreUnmapped { get; set; } - - public Elastic.Clients.Elasticsearch.SortMode? Mode { get; set; } - - public Elastic.Clients.Elasticsearch.SortOrder? Order { get; set; } - - public Elastic.Clients.Elasticsearch.DistanceUnit? Unit { get; set; } -} - -public sealed partial class GeoDistanceSortDescriptor : SerializableDescriptor> -{ - internal GeoDistanceSortDescriptor(Action> configure) => configure.Invoke(this); - public GeoDistanceSortDescriptor() : base() - { - } - - private Elastic.Clients.Elasticsearch.GeoDistanceType? DistanceTypeValue { get; set; } - - private bool? IgnoreUnmappedValue { get; set; } - - private Elastic.Clients.Elasticsearch.SortMode? ModeValue { get; set; } - - private Elastic.Clients.Elasticsearch.SortOrder? OrderValue { get; set; } - - private Elastic.Clients.Elasticsearch.DistanceUnit? UnitValue { get; set; } - - private Elastic.Clients.Elasticsearch.Field FieldValue { get; set; } - - public GeoDistanceSortDescriptor DistanceType(Elastic.Clients.Elasticsearch.GeoDistanceType? distanceType) - { - DistanceTypeValue = distanceType; - return Self; - } - - public GeoDistanceSortDescriptor IgnoreUnmapped(bool? ignoreUnmapped = true) - { - IgnoreUnmappedValue = ignoreUnmapped; - return Self; - } - - public GeoDistanceSortDescriptor Mode(Elastic.Clients.Elasticsearch.SortMode? mode) - { - ModeValue = mode; - return Self; - } - - public GeoDistanceSortDescriptor Order(Elastic.Clients.Elasticsearch.SortOrder? order) - { - OrderValue = order; - return Self; - } - - public GeoDistanceSortDescriptor Unit(Elastic.Clients.Elasticsearch.DistanceUnit? unit) - { - UnitValue = unit; - return Self; - } - - protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) - { - writer.WriteStartObject(); - if (DistanceTypeValue is not null) - { - writer.WritePropertyName("distance_type"); - JsonSerializer.Serialize(writer, DistanceTypeValue, options); - } - - if (IgnoreUnmappedValue.HasValue) - { - writer.WritePropertyName("ignore_unmapped"); - writer.WriteBooleanValue(IgnoreUnmappedValue.Value); - } - - if (ModeValue is not null) - { - writer.WritePropertyName("mode"); - JsonSerializer.Serialize(writer, ModeValue, options); - } - - if (OrderValue is not null) - { - writer.WritePropertyName("order"); - JsonSerializer.Serialize(writer, OrderValue, options); - } - - if (UnitValue is not null) - { - writer.WritePropertyName("unit"); - JsonSerializer.Serialize(writer, UnitValue, options); - } - - writer.WriteEndObject(); - } -} - -public sealed partial class GeoDistanceSortDescriptor : SerializableDescriptor -{ - internal GeoDistanceSortDescriptor(Action configure) => configure.Invoke(this); - public GeoDistanceSortDescriptor() : base() - { - } - - private Elastic.Clients.Elasticsearch.GeoDistanceType? DistanceTypeValue { get; set; } - - private bool? IgnoreUnmappedValue { get; set; } - - private Elastic.Clients.Elasticsearch.SortMode? ModeValue { get; set; } - - private Elastic.Clients.Elasticsearch.SortOrder? OrderValue { get; set; } - - private Elastic.Clients.Elasticsearch.DistanceUnit? UnitValue { get; set; } - - private Elastic.Clients.Elasticsearch.Field FieldValue { get; set; } - - public GeoDistanceSortDescriptor DistanceType(Elastic.Clients.Elasticsearch.GeoDistanceType? distanceType) - { - DistanceTypeValue = distanceType; - return Self; - } - - public GeoDistanceSortDescriptor IgnoreUnmapped(bool? ignoreUnmapped = true) - { - IgnoreUnmappedValue = ignoreUnmapped; - return Self; - } - - public GeoDistanceSortDescriptor Mode(Elastic.Clients.Elasticsearch.SortMode? mode) - { - ModeValue = mode; - return Self; - } - - public GeoDistanceSortDescriptor Order(Elastic.Clients.Elasticsearch.SortOrder? order) - { - OrderValue = order; - return Self; - } - - public GeoDistanceSortDescriptor Unit(Elastic.Clients.Elasticsearch.DistanceUnit? unit) - { - UnitValue = unit; - return Self; - } - - protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) - { - writer.WriteStartObject(); - if (DistanceTypeValue is not null) - { - writer.WritePropertyName("distance_type"); - JsonSerializer.Serialize(writer, DistanceTypeValue, options); - } - - if (IgnoreUnmappedValue.HasValue) - { - writer.WritePropertyName("ignore_unmapped"); - writer.WriteBooleanValue(IgnoreUnmappedValue.Value); - } - - if (ModeValue is not null) - { - writer.WritePropertyName("mode"); - JsonSerializer.Serialize(writer, ModeValue, options); - } - - if (OrderValue is not null) - { - writer.WritePropertyName("order"); - JsonSerializer.Serialize(writer, OrderValue, options); - } - - if (UnitValue is not null) - { - writer.WritePropertyName("unit"); - JsonSerializer.Serialize(writer, UnitValue, options); - } - - writer.WriteEndObject(); - } -} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/GeoBoundingBoxQuery.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/GeoBoundingBoxQuery.g.cs deleted file mode 100644 index ab426984fa4..00000000000 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/GeoBoundingBoxQuery.g.cs +++ /dev/null @@ -1,256 +0,0 @@ -// 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. -// -// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ -// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ -// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ -// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ -// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ -// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ -// ------------------------------------------------ -// -// This file is automatically generated. -// Please do not edit these files manually. -// -// ------------------------------------------------ - -using Elastic.Clients.Elasticsearch.Fluent; -using Elastic.Clients.Elasticsearch.Serialization; -using System; -using System.Collections.Generic; -using System.Linq.Expressions; -using System.Text.Json; -using System.Text.Json.Serialization; - -#nullable restore -namespace Elastic.Clients.Elasticsearch.QueryDsl; -internal sealed class GeoBoundingBoxQueryConverter : JsonConverter -{ - public override GeoBoundingBoxQuery Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) - { - if (reader.TokenType != JsonTokenType.StartObject) - throw new JsonException("Unexpected JSON detected."); - var variant = new GeoBoundingBoxQuery(); - while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) - { - if (reader.TokenType == JsonTokenType.PropertyName) - { - var property = reader.GetString(); - if (property == "_name") - { - variant.QueryName = JsonSerializer.Deserialize(ref reader, options); - continue; - } - - if (property == "boost") - { - variant.Boost = JsonSerializer.Deserialize(ref reader, options); - continue; - } - - if (property == "ignore_unmapped") - { - variant.IgnoreUnmapped = JsonSerializer.Deserialize(ref reader, options); - continue; - } - - if (property == "validation_method") - { - variant.ValidationMethod = JsonSerializer.Deserialize(ref reader, options); - continue; - } - } - } - - return variant; - } - - public override void Write(Utf8JsonWriter writer, GeoBoundingBoxQuery value, JsonSerializerOptions options) - { - writer.WriteStartObject(); - if (!string.IsNullOrEmpty(value.QueryName)) - { - writer.WritePropertyName("_name"); - writer.WriteStringValue(value.QueryName); - } - - if (value.Boost.HasValue) - { - writer.WritePropertyName("boost"); - writer.WriteNumberValue(value.Boost.Value); - } - - if (value.IgnoreUnmapped.HasValue) - { - writer.WritePropertyName("ignore_unmapped"); - writer.WriteBooleanValue(value.IgnoreUnmapped.Value); - } - - if (value.ValidationMethod is not null) - { - writer.WritePropertyName("validation_method"); - JsonSerializer.Serialize(writer, value.ValidationMethod, options); - } - - writer.WriteEndObject(); - } -} - -[JsonConverter(typeof(GeoBoundingBoxQueryConverter))] -public sealed partial class GeoBoundingBoxQuery : Query -{ - public string? QueryName { get; set; } - - public float? Boost { get; set; } - - public Elastic.Clients.Elasticsearch.Field Field { get; set; } - - public bool? IgnoreUnmapped { get; set; } - - public Elastic.Clients.Elasticsearch.QueryDsl.GeoValidationMethod? ValidationMethod { get; set; } -} - -public sealed partial class GeoBoundingBoxQueryDescriptor : SerializableDescriptor> -{ - internal GeoBoundingBoxQueryDescriptor(Action> configure) => configure.Invoke(this); - public GeoBoundingBoxQueryDescriptor() : base() - { - } - - private string? QueryNameValue { get; set; } - - private float? BoostValue { get; set; } - - private bool? IgnoreUnmappedValue { get; set; } - - private Elastic.Clients.Elasticsearch.QueryDsl.GeoValidationMethod? ValidationMethodValue { get; set; } - - private Elastic.Clients.Elasticsearch.Field FieldValue { get; set; } - - public GeoBoundingBoxQueryDescriptor QueryName(string? queryName) - { - QueryNameValue = queryName; - return Self; - } - - public GeoBoundingBoxQueryDescriptor Boost(float? boost) - { - BoostValue = boost; - return Self; - } - - public GeoBoundingBoxQueryDescriptor IgnoreUnmapped(bool? ignoreUnmapped = true) - { - IgnoreUnmappedValue = ignoreUnmapped; - return Self; - } - - public GeoBoundingBoxQueryDescriptor ValidationMethod(Elastic.Clients.Elasticsearch.QueryDsl.GeoValidationMethod? validationMethod) - { - ValidationMethodValue = validationMethod; - return Self; - } - - protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) - { - writer.WriteStartObject(); - if (!string.IsNullOrEmpty(QueryNameValue)) - { - writer.WritePropertyName("_name"); - writer.WriteStringValue(QueryNameValue); - } - - if (BoostValue.HasValue) - { - writer.WritePropertyName("boost"); - writer.WriteNumberValue(BoostValue.Value); - } - - if (IgnoreUnmappedValue.HasValue) - { - writer.WritePropertyName("ignore_unmapped"); - writer.WriteBooleanValue(IgnoreUnmappedValue.Value); - } - - if (ValidationMethodValue is not null) - { - writer.WritePropertyName("validation_method"); - JsonSerializer.Serialize(writer, ValidationMethodValue, options); - } - - writer.WriteEndObject(); - } -} - -public sealed partial class GeoBoundingBoxQueryDescriptor : SerializableDescriptor -{ - internal GeoBoundingBoxQueryDescriptor(Action configure) => configure.Invoke(this); - public GeoBoundingBoxQueryDescriptor() : base() - { - } - - private string? QueryNameValue { get; set; } - - private float? BoostValue { get; set; } - - private bool? IgnoreUnmappedValue { get; set; } - - private Elastic.Clients.Elasticsearch.QueryDsl.GeoValidationMethod? ValidationMethodValue { get; set; } - - private Elastic.Clients.Elasticsearch.Field FieldValue { get; set; } - - public GeoBoundingBoxQueryDescriptor QueryName(string? queryName) - { - QueryNameValue = queryName; - return Self; - } - - public GeoBoundingBoxQueryDescriptor Boost(float? boost) - { - BoostValue = boost; - return Self; - } - - public GeoBoundingBoxQueryDescriptor IgnoreUnmapped(bool? ignoreUnmapped = true) - { - IgnoreUnmappedValue = ignoreUnmapped; - return Self; - } - - public GeoBoundingBoxQueryDescriptor ValidationMethod(Elastic.Clients.Elasticsearch.QueryDsl.GeoValidationMethod? validationMethod) - { - ValidationMethodValue = validationMethod; - return Self; - } - - protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) - { - writer.WriteStartObject(); - if (!string.IsNullOrEmpty(QueryNameValue)) - { - writer.WritePropertyName("_name"); - writer.WriteStringValue(QueryNameValue); - } - - if (BoostValue.HasValue) - { - writer.WritePropertyName("boost"); - writer.WriteNumberValue(BoostValue.Value); - } - - if (IgnoreUnmappedValue.HasValue) - { - writer.WritePropertyName("ignore_unmapped"); - writer.WriteBooleanValue(IgnoreUnmappedValue.Value); - } - - if (ValidationMethodValue is not null) - { - writer.WritePropertyName("validation_method"); - JsonSerializer.Serialize(writer, ValidationMethodValue, options); - } - - writer.WriteEndObject(); - } -} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/GeoDistanceQuery.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/GeoDistanceQuery.g.cs deleted file mode 100644 index 3c26d5d80d3..00000000000 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/GeoDistanceQuery.g.cs +++ /dev/null @@ -1,298 +0,0 @@ -// 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. -// -// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ -// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ -// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ -// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ -// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ -// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ -// ------------------------------------------------ -// -// This file is automatically generated. -// Please do not edit these files manually. -// -// ------------------------------------------------ - -using Elastic.Clients.Elasticsearch.Fluent; -using Elastic.Clients.Elasticsearch.Serialization; -using System; -using System.Collections.Generic; -using System.Linq.Expressions; -using System.Text.Json; -using System.Text.Json.Serialization; - -#nullable restore -namespace Elastic.Clients.Elasticsearch.QueryDsl; -internal sealed class GeoDistanceQueryConverter : JsonConverter -{ - public override GeoDistanceQuery Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) - { - if (reader.TokenType != JsonTokenType.StartObject) - throw new JsonException("Unexpected JSON detected."); - var variant = new GeoDistanceQuery(); - while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) - { - if (reader.TokenType == JsonTokenType.PropertyName) - { - var property = reader.GetString(); - if (property == "_name") - { - variant.QueryName = JsonSerializer.Deserialize(ref reader, options); - continue; - } - - if (property == "boost") - { - variant.Boost = JsonSerializer.Deserialize(ref reader, options); - continue; - } - - if (property == "distance") - { - variant.Distance = JsonSerializer.Deserialize(ref reader, options); - continue; - } - - if (property == "distance_type") - { - variant.DistanceType = JsonSerializer.Deserialize(ref reader, options); - continue; - } - - if (property == "validation_method") - { - variant.ValidationMethod = JsonSerializer.Deserialize(ref reader, options); - continue; - } - } - } - - return variant; - } - - public override void Write(Utf8JsonWriter writer, GeoDistanceQuery value, JsonSerializerOptions options) - { - writer.WriteStartObject(); - if (!string.IsNullOrEmpty(value.QueryName)) - { - writer.WritePropertyName("_name"); - writer.WriteStringValue(value.QueryName); - } - - if (value.Boost.HasValue) - { - writer.WritePropertyName("boost"); - writer.WriteNumberValue(value.Boost.Value); - } - - if (value.Distance is not null) - { - writer.WritePropertyName("distance"); - JsonSerializer.Serialize(writer, value.Distance, options); - } - - if (value.DistanceType is not null) - { - writer.WritePropertyName("distance_type"); - JsonSerializer.Serialize(writer, value.DistanceType, options); - } - - if (value.ValidationMethod is not null) - { - writer.WritePropertyName("validation_method"); - JsonSerializer.Serialize(writer, value.ValidationMethod, options); - } - - writer.WriteEndObject(); - } -} - -[JsonConverter(typeof(GeoDistanceQueryConverter))] -public sealed partial class GeoDistanceQuery : Query -{ - public string? QueryName { get; set; } - - public float? Boost { get; set; } - - public string? Distance { get; set; } - - public Elastic.Clients.Elasticsearch.GeoDistanceType? DistanceType { get; set; } - - public Elastic.Clients.Elasticsearch.Field Field { get; set; } - - public Elastic.Clients.Elasticsearch.QueryDsl.GeoValidationMethod? ValidationMethod { get; set; } -} - -public sealed partial class GeoDistanceQueryDescriptor : SerializableDescriptor> -{ - internal GeoDistanceQueryDescriptor(Action> configure) => configure.Invoke(this); - public GeoDistanceQueryDescriptor() : base() - { - } - - private string? QueryNameValue { get; set; } - - private float? BoostValue { get; set; } - - private string? DistanceValue { get; set; } - - private Elastic.Clients.Elasticsearch.GeoDistanceType? DistanceTypeValue { get; set; } - - private Elastic.Clients.Elasticsearch.QueryDsl.GeoValidationMethod? ValidationMethodValue { get; set; } - - private Elastic.Clients.Elasticsearch.Field FieldValue { get; set; } - - public GeoDistanceQueryDescriptor QueryName(string? queryName) - { - QueryNameValue = queryName; - return Self; - } - - public GeoDistanceQueryDescriptor Boost(float? boost) - { - BoostValue = boost; - return Self; - } - - public GeoDistanceQueryDescriptor Distance(string? distance) - { - DistanceValue = distance; - return Self; - } - - public GeoDistanceQueryDescriptor DistanceType(Elastic.Clients.Elasticsearch.GeoDistanceType? distanceType) - { - DistanceTypeValue = distanceType; - return Self; - } - - public GeoDistanceQueryDescriptor ValidationMethod(Elastic.Clients.Elasticsearch.QueryDsl.GeoValidationMethod? validationMethod) - { - ValidationMethodValue = validationMethod; - return Self; - } - - protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) - { - writer.WriteStartObject(); - if (!string.IsNullOrEmpty(QueryNameValue)) - { - writer.WritePropertyName("_name"); - writer.WriteStringValue(QueryNameValue); - } - - if (BoostValue.HasValue) - { - writer.WritePropertyName("boost"); - writer.WriteNumberValue(BoostValue.Value); - } - - if (DistanceValue is not null) - { - writer.WritePropertyName("distance"); - JsonSerializer.Serialize(writer, DistanceValue, options); - } - - if (DistanceTypeValue is not null) - { - writer.WritePropertyName("distance_type"); - JsonSerializer.Serialize(writer, DistanceTypeValue, options); - } - - if (ValidationMethodValue is not null) - { - writer.WritePropertyName("validation_method"); - JsonSerializer.Serialize(writer, ValidationMethodValue, options); - } - - writer.WriteEndObject(); - } -} - -public sealed partial class GeoDistanceQueryDescriptor : SerializableDescriptor -{ - internal GeoDistanceQueryDescriptor(Action configure) => configure.Invoke(this); - public GeoDistanceQueryDescriptor() : base() - { - } - - private string? QueryNameValue { get; set; } - - private float? BoostValue { get; set; } - - private string? DistanceValue { get; set; } - - private Elastic.Clients.Elasticsearch.GeoDistanceType? DistanceTypeValue { get; set; } - - private Elastic.Clients.Elasticsearch.QueryDsl.GeoValidationMethod? ValidationMethodValue { get; set; } - - private Elastic.Clients.Elasticsearch.Field FieldValue { get; set; } - - public GeoDistanceQueryDescriptor QueryName(string? queryName) - { - QueryNameValue = queryName; - return Self; - } - - public GeoDistanceQueryDescriptor Boost(float? boost) - { - BoostValue = boost; - return Self; - } - - public GeoDistanceQueryDescriptor Distance(string? distance) - { - DistanceValue = distance; - return Self; - } - - public GeoDistanceQueryDescriptor DistanceType(Elastic.Clients.Elasticsearch.GeoDistanceType? distanceType) - { - DistanceTypeValue = distanceType; - return Self; - } - - public GeoDistanceQueryDescriptor ValidationMethod(Elastic.Clients.Elasticsearch.QueryDsl.GeoValidationMethod? validationMethod) - { - ValidationMethodValue = validationMethod; - return Self; - } - - protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) - { - writer.WriteStartObject(); - if (!string.IsNullOrEmpty(QueryNameValue)) - { - writer.WritePropertyName("_name"); - writer.WriteStringValue(QueryNameValue); - } - - if (BoostValue.HasValue) - { - writer.WritePropertyName("boost"); - writer.WriteNumberValue(BoostValue.Value); - } - - if (DistanceValue is not null) - { - writer.WritePropertyName("distance"); - JsonSerializer.Serialize(writer, DistanceValue, options); - } - - if (DistanceTypeValue is not null) - { - writer.WritePropertyName("distance_type"); - JsonSerializer.Serialize(writer, DistanceTypeValue, options); - } - - if (ValidationMethodValue is not null) - { - writer.WritePropertyName("validation_method"); - JsonSerializer.Serialize(writer, ValidationMethodValue, options); - } - - writer.WriteEndObject(); - } -} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/GeoPolygonPoints.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/GeoPolygonPoints.g.cs deleted file mode 100644 index ca53fcbdd50..00000000000 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/GeoPolygonPoints.g.cs +++ /dev/null @@ -1,42 +0,0 @@ -// 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. -// -// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ -// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ -// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ -// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ -// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ -// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ -// ------------------------------------------------ -// -// This file is automatically generated. -// Please do not edit these files manually. -// -// ------------------------------------------------ - -using Elastic.Clients.Elasticsearch.Fluent; -using Elastic.Clients.Elasticsearch.Serialization; -using System; -using System.Collections.Generic; -using System.Linq.Expressions; -using System.Text.Json; -using System.Text.Json.Serialization; - -#nullable restore -namespace Elastic.Clients.Elasticsearch.QueryDsl; -public sealed partial class GeoPolygonPoints -{ -} - -public sealed partial class GeoPolygonPointsDescriptor : SerializableDescriptor -{ - internal GeoPolygonPointsDescriptor(Action configure) => configure.Invoke(this); - public GeoPolygonPointsDescriptor() : base() - { - } - - protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) - { - } -} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/GeoPolygonQuery.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/GeoPolygonQuery.g.cs deleted file mode 100644 index d4117fe3b57..00000000000 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/GeoPolygonQuery.g.cs +++ /dev/null @@ -1,398 +0,0 @@ -// 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. -// -// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ -// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ -// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ -// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ -// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ -// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ -// ------------------------------------------------ -// -// This file is automatically generated. -// Please do not edit these files manually. -// -// ------------------------------------------------ - -using Elastic.Clients.Elasticsearch.Fluent; -using Elastic.Clients.Elasticsearch.Serialization; -using System; -using System.Collections.Generic; -using System.Linq.Expressions; -using System.Text.Json; -using System.Text.Json.Serialization; - -#nullable restore -namespace Elastic.Clients.Elasticsearch.QueryDsl; -internal sealed class GeoPolygonQueryConverter : JsonConverter -{ - public override GeoPolygonQuery Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) - { - if (reader.TokenType != JsonTokenType.StartObject) - throw new JsonException("Unexpected JSON detected."); - var variant = new GeoPolygonQuery(); - while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) - { - if (reader.TokenType == JsonTokenType.PropertyName) - { - var property = reader.GetString(); - if (property == "_name") - { - variant.QueryName = JsonSerializer.Deserialize(ref reader, options); - continue; - } - - if (property == "boost") - { - variant.Boost = JsonSerializer.Deserialize(ref reader, options); - continue; - } - - if (property == "ignore_unmapped") - { - variant.IgnoreUnmapped = JsonSerializer.Deserialize(ref reader, options); - continue; - } - - if (property == "validation_method") - { - variant.ValidationMethod = JsonSerializer.Deserialize(ref reader, options); - continue; - } - - variant.Field = property; - reader.Read(); - variant.Polygon = JsonSerializer.Deserialize(ref reader, options); - } - } - - return variant; - } - - public override void Write(Utf8JsonWriter writer, GeoPolygonQuery value, JsonSerializerOptions options) - { - writer.WriteStartObject(); - if (value.Field is not null && value.Polygon is not null) - { - if (!options.TryGetClientSettings(out var settings)) - { - throw new JsonException("Unable to retrive client settings for JsonSerializerOptions."); - } - - var propertyName = settings.Inferrer.Field(value.Field); - writer.WritePropertyName(propertyName); - JsonSerializer.Serialize(writer, value.Polygon, options); - } - - if (!string.IsNullOrEmpty(value.QueryName)) - { - writer.WritePropertyName("_name"); - writer.WriteStringValue(value.QueryName); - } - - if (value.Boost.HasValue) - { - writer.WritePropertyName("boost"); - writer.WriteNumberValue(value.Boost.Value); - } - - if (value.IgnoreUnmapped.HasValue) - { - writer.WritePropertyName("ignore_unmapped"); - writer.WriteBooleanValue(value.IgnoreUnmapped.Value); - } - - if (value.ValidationMethod is not null) - { - writer.WritePropertyName("validation_method"); - JsonSerializer.Serialize(writer, value.ValidationMethod, options); - } - - writer.WriteEndObject(); - } -} - -[JsonConverter(typeof(GeoPolygonQueryConverter))] -public sealed partial class GeoPolygonQuery : Query -{ - public string? QueryName { get; set; } - - public float? Boost { get; set; } - - public Elastic.Clients.Elasticsearch.Field Field { get; set; } - - public bool? IgnoreUnmapped { get; set; } - - public Elastic.Clients.Elasticsearch.QueryDsl.GeoPolygonPoints Polygon { get; set; } - - public Elastic.Clients.Elasticsearch.QueryDsl.GeoValidationMethod? ValidationMethod { get; set; } -} - -public sealed partial class GeoPolygonQueryDescriptor : SerializableDescriptor> -{ - internal GeoPolygonQueryDescriptor(Action> configure) => configure.Invoke(this); - public GeoPolygonQueryDescriptor() : base() - { - } - - private string? QueryNameValue { get; set; } - - private float? BoostValue { get; set; } - - private bool? IgnoreUnmappedValue { get; set; } - - private Elastic.Clients.Elasticsearch.QueryDsl.GeoValidationMethod? ValidationMethodValue { get; set; } - - private Elastic.Clients.Elasticsearch.Field FieldValue { get; set; } - - private Elastic.Clients.Elasticsearch.QueryDsl.GeoPolygonPoints PolygonValue { get; set; } - - private GeoPolygonPointsDescriptor PolygonDescriptor { get; set; } - - private Action PolygonDescriptorAction { get; set; } - - public GeoPolygonQueryDescriptor QueryName(string? queryName) - { - QueryNameValue = queryName; - return Self; - } - - public GeoPolygonQueryDescriptor Boost(float? boost) - { - BoostValue = boost; - return Self; - } - - public GeoPolygonQueryDescriptor IgnoreUnmapped(bool? ignoreUnmapped = true) - { - IgnoreUnmappedValue = ignoreUnmapped; - return Self; - } - - public GeoPolygonQueryDescriptor ValidationMethod(Elastic.Clients.Elasticsearch.QueryDsl.GeoValidationMethod? validationMethod) - { - ValidationMethodValue = validationMethod; - return Self; - } - - public GeoPolygonQueryDescriptor Polygon(Elastic.Clients.Elasticsearch.QueryDsl.GeoPolygonPoints polygon) - { - PolygonValue = polygon; - return Self; - } - - public GeoPolygonQueryDescriptor Field(Elastic.Clients.Elasticsearch.Field field) - { - FieldValue = field; - return Self; - } - - public GeoPolygonQueryDescriptor Polygon(GeoPolygonPointsDescriptor descriptor) - { - PolygonValue = null; - PolygonDescriptorAction = null; - PolygonDescriptor = descriptor; - return Self; - } - - public GeoPolygonQueryDescriptor Polygon(Action configure) - { - PolygonValue = null; - PolygonDescriptor = null; - PolygonDescriptorAction = configure; - return Self; - } - - public GeoPolygonQueryDescriptor Field(Expression> field) - { - FieldValue = field; - return Self; - } - - protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) - { - writer.WriteStartObject(); - if (FieldValue is not null && (PolygonValue is not null || PolygonDescriptor is not null || PolygonDescriptorAction is not null)) - { - var propertyName = settings.Inferrer.Field(FieldValue); - writer.WritePropertyName(propertyName); - if (PolygonValue is not null) - { - JsonSerializer.Serialize(writer, PolygonValue, options); - } - else if (PolygonDescriptor is not null) - { - JsonSerializer.Serialize(writer, PolygonDescriptor, options); - } - else if (PolygonDescriptorAction is not null) - { - var descriptor = new GeoPolygonPointsDescriptor(PolygonDescriptorAction); - JsonSerializer.Serialize(writer, descriptor, options); - } - } - - if (!string.IsNullOrEmpty(QueryNameValue)) - { - writer.WritePropertyName("_name"); - writer.WriteStringValue(QueryNameValue); - } - - if (BoostValue.HasValue) - { - writer.WritePropertyName("boost"); - writer.WriteNumberValue(BoostValue.Value); - } - - if (IgnoreUnmappedValue.HasValue) - { - writer.WritePropertyName("ignore_unmapped"); - writer.WriteBooleanValue(IgnoreUnmappedValue.Value); - } - - if (ValidationMethodValue is not null) - { - writer.WritePropertyName("validation_method"); - JsonSerializer.Serialize(writer, ValidationMethodValue, options); - } - - writer.WriteEndObject(); - } -} - -public sealed partial class GeoPolygonQueryDescriptor : SerializableDescriptor -{ - internal GeoPolygonQueryDescriptor(Action configure) => configure.Invoke(this); - public GeoPolygonQueryDescriptor() : base() - { - } - - private string? QueryNameValue { get; set; } - - private float? BoostValue { get; set; } - - private bool? IgnoreUnmappedValue { get; set; } - - private Elastic.Clients.Elasticsearch.QueryDsl.GeoValidationMethod? ValidationMethodValue { get; set; } - - private Elastic.Clients.Elasticsearch.Field FieldValue { get; set; } - - private Elastic.Clients.Elasticsearch.QueryDsl.GeoPolygonPoints PolygonValue { get; set; } - - private GeoPolygonPointsDescriptor PolygonDescriptor { get; set; } - - private Action PolygonDescriptorAction { get; set; } - - public GeoPolygonQueryDescriptor QueryName(string? queryName) - { - QueryNameValue = queryName; - return Self; - } - - public GeoPolygonQueryDescriptor Boost(float? boost) - { - BoostValue = boost; - return Self; - } - - public GeoPolygonQueryDescriptor IgnoreUnmapped(bool? ignoreUnmapped = true) - { - IgnoreUnmappedValue = ignoreUnmapped; - return Self; - } - - public GeoPolygonQueryDescriptor ValidationMethod(Elastic.Clients.Elasticsearch.QueryDsl.GeoValidationMethod? validationMethod) - { - ValidationMethodValue = validationMethod; - return Self; - } - - public GeoPolygonQueryDescriptor Polygon(Elastic.Clients.Elasticsearch.QueryDsl.GeoPolygonPoints polygon) - { - PolygonValue = polygon; - return Self; - } - - public GeoPolygonQueryDescriptor Field(Elastic.Clients.Elasticsearch.Field field) - { - FieldValue = field; - return Self; - } - - public GeoPolygonQueryDescriptor Polygon(GeoPolygonPointsDescriptor descriptor) - { - PolygonValue = null; - PolygonDescriptorAction = null; - PolygonDescriptor = descriptor; - return Self; - } - - public GeoPolygonQueryDescriptor Polygon(Action configure) - { - PolygonValue = null; - PolygonDescriptor = null; - PolygonDescriptorAction = configure; - return Self; - } - - public GeoPolygonQueryDescriptor Field(Expression> field) - { - FieldValue = field; - return Self; - } - - public GeoPolygonQueryDescriptor Field(Expression> field) - { - FieldValue = field; - return Self; - } - - protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) - { - writer.WriteStartObject(); - if (FieldValue is not null && (PolygonValue is not null || PolygonDescriptor is not null || PolygonDescriptorAction is not null)) - { - var propertyName = settings.Inferrer.Field(FieldValue); - writer.WritePropertyName(propertyName); - if (PolygonValue is not null) - { - JsonSerializer.Serialize(writer, PolygonValue, options); - } - else if (PolygonDescriptor is not null) - { - JsonSerializer.Serialize(writer, PolygonDescriptor, options); - } - else if (PolygonDescriptorAction is not null) - { - var descriptor = new GeoPolygonPointsDescriptor(PolygonDescriptorAction); - JsonSerializer.Serialize(writer, descriptor, options); - } - } - - if (!string.IsNullOrEmpty(QueryNameValue)) - { - writer.WritePropertyName("_name"); - writer.WriteStringValue(QueryNameValue); - } - - if (BoostValue.HasValue) - { - writer.WritePropertyName("boost"); - writer.WriteNumberValue(BoostValue.Value); - } - - if (IgnoreUnmappedValue.HasValue) - { - writer.WritePropertyName("ignore_unmapped"); - writer.WriteBooleanValue(IgnoreUnmappedValue.Value); - } - - if (ValidationMethodValue is not null) - { - writer.WritePropertyName("validation_method"); - JsonSerializer.Serialize(writer, ValidationMethodValue, options); - } - - writer.WriteEndObject(); - } -} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/GeoShapeFieldQuery.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/GeoShapeFieldQuery.g.cs deleted file mode 100644 index 3f6d73adcef..00000000000 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/GeoShapeFieldQuery.g.cs +++ /dev/null @@ -1,217 +0,0 @@ -// 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. -// -// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ -// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ -// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ -// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ -// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ -// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ -// ------------------------------------------------ -// -// This file is automatically generated. -// Please do not edit these files manually. -// -// ------------------------------------------------ - -using Elastic.Clients.Elasticsearch.Fluent; -using Elastic.Clients.Elasticsearch.Serialization; -using System; -using System.Collections.Generic; -using System.Linq.Expressions; -using System.Text.Json; -using System.Text.Json.Serialization; - -#nullable restore -namespace Elastic.Clients.Elasticsearch.QueryDsl; -public sealed partial class GeoShapeFieldQuery : Query -{ - [JsonInclude] - [JsonPropertyName("indexed_shape")] - public Elastic.Clients.Elasticsearch.QueryDsl.FieldLookup? IndexedShape { get; set; } - - [JsonInclude] - [JsonPropertyName("relation")] - public Elastic.Clients.Elasticsearch.GeoShapeRelation? Relation { get; set; } - - [JsonInclude] - [JsonPropertyName("shape")] - public object? Shape { get; set; } -} - -public sealed partial class GeoShapeFieldQueryDescriptor : SerializableDescriptor> -{ - internal GeoShapeFieldQueryDescriptor(Action> configure) => configure.Invoke(this); - public GeoShapeFieldQueryDescriptor() : base() - { - } - - private Elastic.Clients.Elasticsearch.QueryDsl.FieldLookup? IndexedShapeValue { get; set; } - - private FieldLookupDescriptor IndexedShapeDescriptor { get; set; } - - private Action> IndexedShapeDescriptorAction { get; set; } - - private Elastic.Clients.Elasticsearch.GeoShapeRelation? RelationValue { get; set; } - - private object? ShapeValue { get; set; } - - public GeoShapeFieldQueryDescriptor IndexedShape(Elastic.Clients.Elasticsearch.QueryDsl.FieldLookup? indexedShape) - { - IndexedShapeDescriptor = null; - IndexedShapeDescriptorAction = null; - IndexedShapeValue = indexedShape; - return Self; - } - - public GeoShapeFieldQueryDescriptor IndexedShape(FieldLookupDescriptor descriptor) - { - IndexedShapeValue = null; - IndexedShapeDescriptorAction = null; - IndexedShapeDescriptor = descriptor; - return Self; - } - - public GeoShapeFieldQueryDescriptor IndexedShape(Action> configure) - { - IndexedShapeValue = null; - IndexedShapeDescriptor = null; - IndexedShapeDescriptorAction = configure; - return Self; - } - - public GeoShapeFieldQueryDescriptor Relation(Elastic.Clients.Elasticsearch.GeoShapeRelation? relation) - { - RelationValue = relation; - return Self; - } - - public GeoShapeFieldQueryDescriptor Shape(object? shape) - { - ShapeValue = shape; - return Self; - } - - protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) - { - writer.WriteStartObject(); - if (IndexedShapeDescriptor is not null) - { - writer.WritePropertyName("indexed_shape"); - JsonSerializer.Serialize(writer, IndexedShapeDescriptor, options); - } - else if (IndexedShapeDescriptorAction is not null) - { - writer.WritePropertyName("indexed_shape"); - JsonSerializer.Serialize(writer, new FieldLookupDescriptor(IndexedShapeDescriptorAction), options); - } - else if (IndexedShapeValue is not null) - { - writer.WritePropertyName("indexed_shape"); - JsonSerializer.Serialize(writer, IndexedShapeValue, options); - } - - if (RelationValue is not null) - { - writer.WritePropertyName("relation"); - JsonSerializer.Serialize(writer, RelationValue, options); - } - - if (ShapeValue is not null) - { - writer.WritePropertyName("shape"); - JsonSerializer.Serialize(writer, ShapeValue, options); - } - - writer.WriteEndObject(); - } -} - -public sealed partial class GeoShapeFieldQueryDescriptor : SerializableDescriptor -{ - internal GeoShapeFieldQueryDescriptor(Action configure) => configure.Invoke(this); - public GeoShapeFieldQueryDescriptor() : base() - { - } - - private Elastic.Clients.Elasticsearch.QueryDsl.FieldLookup? IndexedShapeValue { get; set; } - - private FieldLookupDescriptor IndexedShapeDescriptor { get; set; } - - private Action IndexedShapeDescriptorAction { get; set; } - - private Elastic.Clients.Elasticsearch.GeoShapeRelation? RelationValue { get; set; } - - private object? ShapeValue { get; set; } - - public GeoShapeFieldQueryDescriptor IndexedShape(Elastic.Clients.Elasticsearch.QueryDsl.FieldLookup? indexedShape) - { - IndexedShapeDescriptor = null; - IndexedShapeDescriptorAction = null; - IndexedShapeValue = indexedShape; - return Self; - } - - public GeoShapeFieldQueryDescriptor IndexedShape(FieldLookupDescriptor descriptor) - { - IndexedShapeValue = null; - IndexedShapeDescriptorAction = null; - IndexedShapeDescriptor = descriptor; - return Self; - } - - public GeoShapeFieldQueryDescriptor IndexedShape(Action configure) - { - IndexedShapeValue = null; - IndexedShapeDescriptor = null; - IndexedShapeDescriptorAction = configure; - return Self; - } - - public GeoShapeFieldQueryDescriptor Relation(Elastic.Clients.Elasticsearch.GeoShapeRelation? relation) - { - RelationValue = relation; - return Self; - } - - public GeoShapeFieldQueryDescriptor Shape(object? shape) - { - ShapeValue = shape; - return Self; - } - - protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) - { - writer.WriteStartObject(); - if (IndexedShapeDescriptor is not null) - { - writer.WritePropertyName("indexed_shape"); - JsonSerializer.Serialize(writer, IndexedShapeDescriptor, options); - } - else if (IndexedShapeDescriptorAction is not null) - { - writer.WritePropertyName("indexed_shape"); - JsonSerializer.Serialize(writer, new FieldLookupDescriptor(IndexedShapeDescriptorAction), options); - } - else if (IndexedShapeValue is not null) - { - writer.WritePropertyName("indexed_shape"); - JsonSerializer.Serialize(writer, IndexedShapeValue, options); - } - - if (RelationValue is not null) - { - writer.WritePropertyName("relation"); - JsonSerializer.Serialize(writer, RelationValue, options); - } - - if (ShapeValue is not null) - { - writer.WritePropertyName("shape"); - JsonSerializer.Serialize(writer, ShapeValue, options); - } - - writer.WriteEndObject(); - } -} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/GeoShapeQuery.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/GeoShapeQuery.g.cs deleted file mode 100644 index acbe3b29f2b..00000000000 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/GeoShapeQuery.g.cs +++ /dev/null @@ -1,356 +0,0 @@ -// 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. -// -// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ -// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ -// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ -// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ -// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ -// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ -// ------------------------------------------------ -// -// This file is automatically generated. -// Please do not edit these files manually. -// -// ------------------------------------------------ - -using Elastic.Clients.Elasticsearch.Fluent; -using Elastic.Clients.Elasticsearch.Serialization; -using System; -using System.Collections.Generic; -using System.Linq.Expressions; -using System.Text.Json; -using System.Text.Json.Serialization; - -#nullable restore -namespace Elastic.Clients.Elasticsearch.QueryDsl; -internal sealed class GeoShapeQueryConverter : JsonConverter -{ - public override GeoShapeQuery Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) - { - if (reader.TokenType != JsonTokenType.StartObject) - throw new JsonException("Unexpected JSON detected."); - var variant = new GeoShapeQuery(); - while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) - { - if (reader.TokenType == JsonTokenType.PropertyName) - { - var property = reader.GetString(); - if (property == "_name") - { - variant.QueryName = JsonSerializer.Deserialize(ref reader, options); - continue; - } - - if (property == "boost") - { - variant.Boost = JsonSerializer.Deserialize(ref reader, options); - continue; - } - - if (property == "ignore_unmapped") - { - variant.IgnoreUnmapped = JsonSerializer.Deserialize(ref reader, options); - continue; - } - - variant.Field = property; - reader.Read(); - variant.Shape = JsonSerializer.Deserialize(ref reader, options); - } - } - - return variant; - } - - public override void Write(Utf8JsonWriter writer, GeoShapeQuery value, JsonSerializerOptions options) - { - writer.WriteStartObject(); - if (value.Field is not null && value.Shape is not null) - { - if (!options.TryGetClientSettings(out var settings)) - { - throw new JsonException("Unable to retrive client settings for JsonSerializerOptions."); - } - - var propertyName = settings.Inferrer.Field(value.Field); - writer.WritePropertyName(propertyName); - JsonSerializer.Serialize(writer, value.Shape, options); - } - - if (!string.IsNullOrEmpty(value.QueryName)) - { - writer.WritePropertyName("_name"); - writer.WriteStringValue(value.QueryName); - } - - if (value.Boost.HasValue) - { - writer.WritePropertyName("boost"); - writer.WriteNumberValue(value.Boost.Value); - } - - if (value.IgnoreUnmapped.HasValue) - { - writer.WritePropertyName("ignore_unmapped"); - writer.WriteBooleanValue(value.IgnoreUnmapped.Value); - } - - writer.WriteEndObject(); - } -} - -[JsonConverter(typeof(GeoShapeQueryConverter))] -public sealed partial class GeoShapeQuery : Query -{ - public string? QueryName { get; set; } - - public float? Boost { get; set; } - - public Elastic.Clients.Elasticsearch.Field Field { get; set; } - - public bool? IgnoreUnmapped { get; set; } - - public Elastic.Clients.Elasticsearch.QueryDsl.GeoShapeFieldQuery Shape { get; set; } -} - -public sealed partial class GeoShapeQueryDescriptor : SerializableDescriptor> -{ - internal GeoShapeQueryDescriptor(Action> configure) => configure.Invoke(this); - public GeoShapeQueryDescriptor() : base() - { - } - - private string? QueryNameValue { get; set; } - - private float? BoostValue { get; set; } - - private bool? IgnoreUnmappedValue { get; set; } - - private Elastic.Clients.Elasticsearch.Field FieldValue { get; set; } - - private Elastic.Clients.Elasticsearch.QueryDsl.GeoShapeFieldQuery ShapeValue { get; set; } - - private GeoShapeFieldQueryDescriptor ShapeDescriptor { get; set; } - - private Action> ShapeDescriptorAction { get; set; } - - public GeoShapeQueryDescriptor QueryName(string? queryName) - { - QueryNameValue = queryName; - return Self; - } - - public GeoShapeQueryDescriptor Boost(float? boost) - { - BoostValue = boost; - return Self; - } - - public GeoShapeQueryDescriptor IgnoreUnmapped(bool? ignoreUnmapped = true) - { - IgnoreUnmappedValue = ignoreUnmapped; - return Self; - } - - public GeoShapeQueryDescriptor Shape(Elastic.Clients.Elasticsearch.QueryDsl.GeoShapeFieldQuery shape) - { - ShapeValue = shape; - return Self; - } - - public GeoShapeQueryDescriptor Field(Elastic.Clients.Elasticsearch.Field field) - { - FieldValue = field; - return Self; - } - - public GeoShapeQueryDescriptor Shape(GeoShapeFieldQueryDescriptor descriptor) - { - ShapeValue = null; - ShapeDescriptorAction = null; - ShapeDescriptor = descriptor; - return Self; - } - - public GeoShapeQueryDescriptor Shape(Action> configure) - { - ShapeValue = null; - ShapeDescriptor = null; - ShapeDescriptorAction = configure; - return Self; - } - - public GeoShapeQueryDescriptor Field(Expression> field) - { - FieldValue = field; - return Self; - } - - protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) - { - writer.WriteStartObject(); - if (FieldValue is not null && (ShapeValue is not null || ShapeDescriptor is not null || ShapeDescriptorAction is not null)) - { - var propertyName = settings.Inferrer.Field(FieldValue); - writer.WritePropertyName(propertyName); - if (ShapeValue is not null) - { - JsonSerializer.Serialize(writer, ShapeValue, options); - } - else if (ShapeDescriptor is not null) - { - JsonSerializer.Serialize(writer, ShapeDescriptor, options); - } - else if (ShapeDescriptorAction is not null) - { - var descriptor = new GeoShapeFieldQueryDescriptor(ShapeDescriptorAction); - JsonSerializer.Serialize(writer, descriptor, options); - } - } - - if (!string.IsNullOrEmpty(QueryNameValue)) - { - writer.WritePropertyName("_name"); - writer.WriteStringValue(QueryNameValue); - } - - if (BoostValue.HasValue) - { - writer.WritePropertyName("boost"); - writer.WriteNumberValue(BoostValue.Value); - } - - if (IgnoreUnmappedValue.HasValue) - { - writer.WritePropertyName("ignore_unmapped"); - writer.WriteBooleanValue(IgnoreUnmappedValue.Value); - } - - writer.WriteEndObject(); - } -} - -public sealed partial class GeoShapeQueryDescriptor : SerializableDescriptor -{ - internal GeoShapeQueryDescriptor(Action configure) => configure.Invoke(this); - public GeoShapeQueryDescriptor() : base() - { - } - - private string? QueryNameValue { get; set; } - - private float? BoostValue { get; set; } - - private bool? IgnoreUnmappedValue { get; set; } - - private Elastic.Clients.Elasticsearch.Field FieldValue { get; set; } - - private Elastic.Clients.Elasticsearch.QueryDsl.GeoShapeFieldQuery ShapeValue { get; set; } - - private GeoShapeFieldQueryDescriptor ShapeDescriptor { get; set; } - - private Action ShapeDescriptorAction { get; set; } - - public GeoShapeQueryDescriptor QueryName(string? queryName) - { - QueryNameValue = queryName; - return Self; - } - - public GeoShapeQueryDescriptor Boost(float? boost) - { - BoostValue = boost; - return Self; - } - - public GeoShapeQueryDescriptor IgnoreUnmapped(bool? ignoreUnmapped = true) - { - IgnoreUnmappedValue = ignoreUnmapped; - return Self; - } - - public GeoShapeQueryDescriptor Shape(Elastic.Clients.Elasticsearch.QueryDsl.GeoShapeFieldQuery shape) - { - ShapeValue = shape; - return Self; - } - - public GeoShapeQueryDescriptor Field(Elastic.Clients.Elasticsearch.Field field) - { - FieldValue = field; - return Self; - } - - public GeoShapeQueryDescriptor Shape(GeoShapeFieldQueryDescriptor descriptor) - { - ShapeValue = null; - ShapeDescriptorAction = null; - ShapeDescriptor = descriptor; - return Self; - } - - public GeoShapeQueryDescriptor Shape(Action configure) - { - ShapeValue = null; - ShapeDescriptor = null; - ShapeDescriptorAction = configure; - return Self; - } - - public GeoShapeQueryDescriptor Field(Expression> field) - { - FieldValue = field; - return Self; - } - - public GeoShapeQueryDescriptor Field(Expression> field) - { - FieldValue = field; - return Self; - } - - protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) - { - writer.WriteStartObject(); - if (FieldValue is not null && (ShapeValue is not null || ShapeDescriptor is not null || ShapeDescriptorAction is not null)) - { - var propertyName = settings.Inferrer.Field(FieldValue); - writer.WritePropertyName(propertyName); - if (ShapeValue is not null) - { - JsonSerializer.Serialize(writer, ShapeValue, options); - } - else if (ShapeDescriptor is not null) - { - JsonSerializer.Serialize(writer, ShapeDescriptor, options); - } - else if (ShapeDescriptorAction is not null) - { - var descriptor = new GeoShapeFieldQueryDescriptor(ShapeDescriptorAction); - JsonSerializer.Serialize(writer, descriptor, options); - } - } - - if (!string.IsNullOrEmpty(QueryNameValue)) - { - writer.WritePropertyName("_name"); - writer.WriteStringValue(QueryNameValue); - } - - if (BoostValue.HasValue) - { - writer.WritePropertyName("boost"); - writer.WriteNumberValue(BoostValue.Value); - } - - if (IgnoreUnmappedValue.HasValue) - { - writer.WritePropertyName("ignore_unmapped"); - writer.WriteBooleanValue(IgnoreUnmappedValue.Value); - } - - writer.WriteEndObject(); - } -} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/QueryContainer.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/QueryContainer.g.cs index a74fa629486..1b955b97cf8 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/QueryContainer.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/QueryDsl/QueryContainer.g.cs @@ -53,10 +53,6 @@ internal QueryContainer(string variantName, object variant) public static QueryContainer FieldMaskingSpan(Elastic.Clients.Elasticsearch.QueryDsl.SpanFieldMaskingQuery spanFieldMaskingQuery) => new QueryContainer("field_masking_span", spanFieldMaskingQuery); public static QueryContainer FunctionScore(Elastic.Clients.Elasticsearch.QueryDsl.FunctionScoreQuery functionScoreQuery) => new QueryContainer("function_score", functionScoreQuery); public static QueryContainer Fuzzy(Elastic.Clients.Elasticsearch.QueryDsl.FuzzyQuery fuzzyQuery) => new QueryContainer("fuzzy", fuzzyQuery); - public static QueryContainer GeoBoundingBox(Elastic.Clients.Elasticsearch.QueryDsl.GeoBoundingBoxQuery geoBoundingBoxQuery) => new QueryContainer("geo_bounding_box", geoBoundingBoxQuery); - public static QueryContainer GeoDistance(Elastic.Clients.Elasticsearch.QueryDsl.GeoDistanceQuery geoDistanceQuery) => new QueryContainer("geo_distance", geoDistanceQuery); - public static QueryContainer GeoPolygon(Elastic.Clients.Elasticsearch.QueryDsl.GeoPolygonQuery geoPolygonQuery) => new QueryContainer("geo_polygon", geoPolygonQuery); - public static QueryContainer GeoShape(Elastic.Clients.Elasticsearch.QueryDsl.GeoShapeQuery geoShapeQuery) => new QueryContainer("geo_shape", geoShapeQuery); public static QueryContainer HasChild(Elastic.Clients.Elasticsearch.QueryDsl.HasChildQuery hasChildQuery) => new QueryContainer("has_child", hasChildQuery); public static QueryContainer HasParent(Elastic.Clients.Elasticsearch.QueryDsl.HasParentQuery hasParentQuery) => new QueryContainer("has_parent", hasParentQuery); public static QueryContainer Ids(Elastic.Clients.Elasticsearch.QueryDsl.IdsQuery idsQuery) => new QueryContainer("ids", idsQuery); @@ -176,34 +172,6 @@ public override QueryContainer Read(ref Utf8JsonReader reader, Type typeToConver return new QueryContainer(propertyName, variant); } - if (propertyName == "geo_bounding_box") - { - var variant = JsonSerializer.Deserialize(ref reader, options); - reader.Read(); - return new QueryContainer(propertyName, variant); - } - - if (propertyName == "geo_distance") - { - var variant = JsonSerializer.Deserialize(ref reader, options); - reader.Read(); - return new QueryContainer(propertyName, variant); - } - - if (propertyName == "geo_polygon") - { - var variant = JsonSerializer.Deserialize(ref reader, options); - reader.Read(); - return new QueryContainer(propertyName, variant); - } - - if (propertyName == "geo_shape") - { - var variant = JsonSerializer.Deserialize(ref reader, options); - reader.Read(); - return new QueryContainer(propertyName, variant); - } - if (propertyName == "has_child") { var variant = JsonSerializer.Deserialize(ref reader, options); @@ -499,18 +467,6 @@ public override void Write(Utf8JsonWriter writer, QueryContainer value, JsonSeri case "fuzzy": JsonSerializer.Serialize(writer, (Elastic.Clients.Elasticsearch.QueryDsl.FuzzyQuery)value.Variant, options); break; - case "geo_bounding_box": - JsonSerializer.Serialize(writer, (Elastic.Clients.Elasticsearch.QueryDsl.GeoBoundingBoxQuery)value.Variant, options); - break; - case "geo_distance": - JsonSerializer.Serialize(writer, (Elastic.Clients.Elasticsearch.QueryDsl.GeoDistanceQuery)value.Variant, options); - break; - case "geo_polygon": - JsonSerializer.Serialize(writer, (Elastic.Clients.Elasticsearch.QueryDsl.GeoPolygonQuery)value.Variant, options); - break; - case "geo_shape": - JsonSerializer.Serialize(writer, (Elastic.Clients.Elasticsearch.QueryDsl.GeoShapeQuery)value.Variant, options); - break; case "has_child": JsonSerializer.Serialize(writer, (Elastic.Clients.Elasticsearch.QueryDsl.HasChildQuery)value.Variant, options); break; @@ -680,14 +636,6 @@ private QueryContainerDescriptor Set(object variant, string variantNa public QueryContainerDescriptor FunctionScore(Action> configure) => Set(configure, "function_score"); public QueryContainerDescriptor Fuzzy(FuzzyQuery query) => Set(query, "fuzzy"); public QueryContainerDescriptor Fuzzy(Action> configure) => Set(configure, "fuzzy"); - public QueryContainerDescriptor GeoBoundingBox(GeoBoundingBoxQuery query) => Set(query, "geo_bounding_box"); - public QueryContainerDescriptor GeoBoundingBox(Action> configure) => Set(configure, "geo_bounding_box"); - public QueryContainerDescriptor GeoDistance(GeoDistanceQuery query) => Set(query, "geo_distance"); - public QueryContainerDescriptor GeoDistance(Action> configure) => Set(configure, "geo_distance"); - public QueryContainerDescriptor GeoPolygon(GeoPolygonQuery query) => Set(query, "geo_polygon"); - public QueryContainerDescriptor GeoPolygon(Action> configure) => Set(configure, "geo_polygon"); - public QueryContainerDescriptor GeoShape(GeoShapeQuery query) => Set(query, "geo_shape"); - public QueryContainerDescriptor GeoShape(Action> configure) => Set(configure, "geo_shape"); public QueryContainerDescriptor HasChild(HasChildQuery query) => Set(query, "has_child"); public QueryContainerDescriptor HasChild(Action> configure) => Set(configure, "has_child"); public QueryContainerDescriptor HasParent(HasParentQuery query) => Set(query, "has_parent"); @@ -845,18 +793,6 @@ private QueryContainerDescriptor Set(object variant, string variantName) public QueryContainerDescriptor Fuzzy(FuzzyQuery query) => Set(query, "fuzzy"); public QueryContainerDescriptor Fuzzy(Action configure) => Set(configure, "fuzzy"); public QueryContainerDescriptor Fuzzy(Action> configure) => Set(configure, "fuzzy"); - public QueryContainerDescriptor GeoBoundingBox(GeoBoundingBoxQuery query) => Set(query, "geo_bounding_box"); - public QueryContainerDescriptor GeoBoundingBox(Action configure) => Set(configure, "geo_bounding_box"); - public QueryContainerDescriptor GeoBoundingBox(Action> configure) => Set(configure, "geo_bounding_box"); - public QueryContainerDescriptor GeoDistance(GeoDistanceQuery query) => Set(query, "geo_distance"); - public QueryContainerDescriptor GeoDistance(Action configure) => Set(configure, "geo_distance"); - public QueryContainerDescriptor GeoDistance(Action> configure) => Set(configure, "geo_distance"); - public QueryContainerDescriptor GeoPolygon(GeoPolygonQuery query) => Set(query, "geo_polygon"); - public QueryContainerDescriptor GeoPolygon(Action configure) => Set(configure, "geo_polygon"); - public QueryContainerDescriptor GeoPolygon(Action> configure) => Set(configure, "geo_polygon"); - public QueryContainerDescriptor GeoShape(GeoShapeQuery query) => Set(query, "geo_shape"); - public QueryContainerDescriptor GeoShape(Action configure) => Set(configure, "geo_shape"); - public QueryContainerDescriptor GeoShape(Action> configure) => Set(configure, "geo_shape"); public QueryContainerDescriptor HasChild(HasChildQuery query) => Set(query, "has_child"); public QueryContainerDescriptor HasChild(Action configure) => Set(configure, "has_child"); public QueryContainerDescriptor HasChild(Action> configure) => Set(configure, "has_child"); diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/SortOptions.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/SortOptions.g.cs index aa0ba0fcf04..9b29dbbf91e 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/SortOptions.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/SortOptions.g.cs @@ -58,7 +58,6 @@ internal SortOptions(Elastic.Clients.Elasticsearch.Field field, object variant) internal Elastic.Clients.Elasticsearch.Field? AdditionalPropertyName { get; } public static SortOptions Doc(Elastic.Clients.Elasticsearch.ScoreSort scoreSort) => new SortOptions("_doc", scoreSort); - public static SortOptions GeoDistance(Elastic.Clients.Elasticsearch.GeoDistanceSort geoDistanceSort) => new SortOptions("_geo_distance", geoDistanceSort); public static SortOptions Score(Elastic.Clients.Elasticsearch.ScoreSort scoreSort) => new SortOptions("_score", scoreSort); public static SortOptions Script(Elastic.Clients.Elasticsearch.ScriptSort scriptSort) => new SortOptions("_script", scriptSort); public static SortOptions Field(Elastic.Clients.Elasticsearch.Field field, Elastic.Clients.Elasticsearch.FieldSort fieldSort) => new SortOptions(field, fieldSort); @@ -88,13 +87,6 @@ public override SortOptions Read(ref Utf8JsonReader reader, Type typeToConvert, return new SortOptions(propertyName, variant); } - if (propertyName == "_geo_distance") - { - var variant = JsonSerializer.Deserialize(ref reader, options); - reader.Read(); - return new SortOptions(propertyName, variant); - } - if (propertyName == "_score") { var variant = JsonSerializer.Deserialize(ref reader, options); @@ -137,9 +129,6 @@ public override void Write(Utf8JsonWriter writer, SortOptions value, JsonSeriali case "_doc": JsonSerializer.Serialize(writer, (Elastic.Clients.Elasticsearch.ScoreSort)value.Variant, options); break; - case "_geo_distance": - JsonSerializer.Serialize(writer, (Elastic.Clients.Elasticsearch.GeoDistanceSort)value.Variant, options); - break; case "_score": JsonSerializer.Serialize(writer, (Elastic.Clients.Elasticsearch.ScoreSort)value.Variant, options); break; @@ -191,8 +180,6 @@ private SortOptionsDescriptor Set(object variant, string variantName) public SortOptionsDescriptor Doc(ScoreSort variant) => Set(variant, "_doc"); public SortOptionsDescriptor Doc(Action configure) => Set(configure, "_doc"); - public SortOptionsDescriptor GeoDistance(GeoDistanceSort variant) => Set(variant, "_geo_distance"); - public SortOptionsDescriptor GeoDistance(Action> configure) => Set(configure, "_geo_distance"); public SortOptionsDescriptor Score(ScoreSort variant) => Set(variant, "_score"); public SortOptionsDescriptor Score(Action configure) => Set(configure, "_score"); public SortOptionsDescriptor Script(ScriptSort variant) => Set(variant, "_script"); @@ -256,9 +243,6 @@ private SortOptionsDescriptor Set(object variant, string variantName) public SortOptionsDescriptor Doc(ScoreSort variant) => Set(variant, "_doc"); public SortOptionsDescriptor Doc(Action configure) => Set(configure, "_doc"); - public SortOptionsDescriptor GeoDistance(GeoDistanceSort variant) => Set(variant, "_geo_distance"); - public SortOptionsDescriptor GeoDistance(Action configure) => Set(configure, "_geo_distance"); - public SortOptionsDescriptor GeoDistance(Action> configure) => Set(configure, "_geo_distance"); public SortOptionsDescriptor Score(ScoreSort variant) => Set(variant, "_score"); public SortOptionsDescriptor Score(Action configure) => Set(configure, "_score"); public SortOptionsDescriptor Script(ScriptSort variant) => Set(variant, "_script"); diff --git a/tests/Tests/Serialization/Aggregations/GeoBoundsAggregateDeserializationTests.cs b/tests/Tests/Serialization/Aggregations/GeoBoundsAggregateDeserializationTests.cs deleted file mode 100644 index 30ba66e69fe..00000000000 --- a/tests/Tests/Serialization/Aggregations/GeoBoundsAggregateDeserializationTests.cs +++ /dev/null @@ -1,23 +0,0 @@ -// 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. - -namespace Tests.Serialization; - -public class GeoBoundsAggregateDeserializationTests : SerializerTestBase -{ - //[U] - //public void CanDeserializeAggregate() - //{ - // var json = @"{""aggregations"":{""geo_bounds#my-agg-name"":{""bounds"":{""top_left"":{""lat"":48.86111099738628,""lon"":2.3269999679178},""bottom_right"":{""lat"":48.85999997612089,""lon"":2.3363889567553997}}}}}"; - - // var stream = WrapInStream(json); - - // var search = _requestResponseSerializer.Deserialize(stream); - - // search.Aggregations.Should().HaveCount(1); - - // var agg = search.Aggregations.GeoBounds("my-agg-name"); - // // TODO - //} -}