From 81bf65616aab4bc387aeb74af4b5b1d4508a0d43 Mon Sep 17 00:00:00 2001 From: Stuart Cam Date: Mon, 27 May 2019 13:26:17 +1000 Subject: [PATCH] Set obsolete warning on GeoShape properties. Addresses: https://github.com/elastic/elasticsearch/pull/35320 --- .../Types/Geo/GeoShape/GeoShapeProperty.cs | 27 +++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/src/Nest/Mapping/Types/Geo/GeoShape/GeoShapeProperty.cs b/src/Nest/Mapping/Types/Geo/GeoShape/GeoShapeProperty.cs index 9170ce6dbb3..192d31757e9 100644 --- a/src/Nest/Mapping/Types/Geo/GeoShape/GeoShapeProperty.cs +++ b/src/Nest/Mapping/Types/Geo/GeoShape/GeoShapeProperty.cs @@ -1,3 +1,4 @@ +using System; using System.Diagnostics; using Newtonsoft.Json; @@ -23,6 +24,7 @@ public interface IGeoShapeProperty : IDocValuesProperty /// noting that large shapes will have greater false positives. /// [JsonProperty("distance_error_pct")] + [Obsolete("Removed in Elasticsearch 6.6")] double? DistanceErrorPercentage { get; set; } /// @@ -63,6 +65,7 @@ public interface IGeoShapeProperty : IDocValuesProperty /// so that geo_shape queries are optimal on a point only field. /// [JsonProperty("points_only")] + [Obsolete("Removed in Elasticsearch 6.6")] bool? PointsOnly { get; set; } /// @@ -71,6 +74,7 @@ public interface IGeoShapeProperty : IDocValuesProperty /// the best tree_levels value to honor this precision. /// [JsonProperty("precision")] + [Obsolete("Removed in Elasticsearch 6.6")] Distance Precision { get; set; } /// @@ -85,6 +89,7 @@ public interface IGeoShapeProperty : IDocValuesProperty /// Name of the PrefixTree implementation to be used. /// Defaults to /// + [Obsolete("Removed in Elasticsearch 6.6")] [JsonProperty("tree")] GeoTree? Tree { get; set; } @@ -96,6 +101,7 @@ public interface IGeoShapeProperty : IDocValuesProperty /// parameter instead. /// [JsonProperty("tree_levels")] + [Obsolete("Removed in Elasticsearch 6.6")] int? TreeLevels { get; set; } /// @@ -112,6 +118,7 @@ public class GeoShapeProperty : DocValuesPropertyBase, IGeoShapeProperty public GeoShapeProperty() : base(FieldType.GeoShape) { } /// + [Obsolete("Removed in Elasticsearch 6.6")] public double? DistanceErrorPercentage { get; set; } /// @@ -124,18 +131,22 @@ public GeoShapeProperty() : base(FieldType.GeoShape) { } public GeoOrientation? Orientation { get; set; } /// + [Obsolete("Removed in Elasticsearch 6.6")] public bool? PointsOnly { get; set; } /// + [Obsolete("Removed in Elasticsearch 6.6")] public Distance Precision { get; set; } /// public GeoStrategy? Strategy { get; set; } /// + [Obsolete("Removed in Elasticsearch 6.6")] public GeoTree? Tree { get; set; } /// + [Obsolete("Removed in Elasticsearch 6.6")] public int? TreeLevels { get; set; } /// @@ -150,28 +161,42 @@ public class GeoShapePropertyDescriptor { public GeoShapePropertyDescriptor() : base(FieldType.GeoShape) { } + + [Obsolete("Removed in Elasticsearch 6.6")] double? IGeoShapeProperty.DistanceErrorPercentage { get; set; } bool? IGeoShapeProperty.IgnoreMalformed { get; set; } bool? IGeoShapeProperty.IgnoreZValue { get; set; } GeoOrientation? IGeoShapeProperty.Orientation { get; set; } + + [Obsolete("Removed in Elasticsearch 6.6")] bool? IGeoShapeProperty.PointsOnly { get; set; } + + [Obsolete("Removed in Elasticsearch 6.6")] Distance IGeoShapeProperty.Precision { get; set; } GeoStrategy? IGeoShapeProperty.Strategy { get; set; } + + [Obsolete("Removed in Elasticsearch 6.6")] GeoTree? IGeoShapeProperty.Tree { get; set; } + + [Obsolete("Removed in Elasticsearch 6.6")] int? IGeoShapeProperty.TreeLevels { get; set; } bool? IGeoShapeProperty.Coerce { get; set; } /// + + [Obsolete("Removed in Elasticsearch 6.6")] public GeoShapePropertyDescriptor Tree(GeoTree? tree) => Assign(tree, (a, v) => a.Tree = v); /// + [Obsolete("Removed in Elasticsearch 6.6")] public GeoShapePropertyDescriptor TreeLevels(int? treeLevels) => Assign(treeLevels, (a, v) => a.TreeLevels = v); /// public GeoShapePropertyDescriptor Strategy(GeoStrategy? strategy) => Assign(strategy, (a, v) => a.Strategy = v); /// + [Obsolete("Removed in Elasticsearch 6.6")] public GeoShapePropertyDescriptor Precision(double precision, DistanceUnit unit) => Assign(new Distance(precision, unit), (a, v) => a.Precision = v); @@ -179,10 +204,12 @@ public GeoShapePropertyDescriptor Precision(double precision, DistanceUnit un public GeoShapePropertyDescriptor Orientation(GeoOrientation? orientation) => Assign(orientation, (a, v) => a.Orientation = v); /// + [Obsolete("Removed in Elasticsearch 6.6")] public GeoShapePropertyDescriptor DistanceErrorPercentage(double? distanceErrorPercentage) => Assign(distanceErrorPercentage, (a, v) => a.DistanceErrorPercentage = v); /// + [Obsolete("Removed in Elasticsearch 6.6")] public GeoShapePropertyDescriptor PointsOnly(bool? pointsOnly = true) => Assign(pointsOnly, (a, v) => a.PointsOnly = v); ///