Skip to content

Commit c60cc3b

Browse files
authored
Remove generated [Obsolete] parameters (#3659)
This commit removes the generated obsolete parameters through code generation. Relates: elastic/elasticsearch#41098
1 parent d1e1627 commit c60cc3b

File tree

38 files changed

+22
-431
lines changed

38 files changed

+22
-431
lines changed

src/CodeGeneration/ApiGenerator/Overrides/GlobalOverrides.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,8 @@ public class GlobalOverrides : EndpointOverridesBase
4949

5050
public override IEnumerable<string> SkipQueryStringParams { get; } = new[]
5151
{
52+
"parent", //can be removed once https://github.com/elastic/elasticsearch/pull/41098 is in
53+
"copy_settings", //this still needs a PR?
5254
"source", // allows the body to be specified as a request param, we do not want to advertise this with a strongly typed method
5355
"ttl",
5456
"timestamp",

src/Elasticsearch.Net/Domain/RequestParameters/RequestParameters.Generated.cs

Lines changed: 0 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -609,9 +609,6 @@ public class CreateRequestParameters : RequestParameters<CreateRequestParameters
609609
/// shard (number of replicas + 1)
610610
///</summary>
611611
public string WaitForActiveShards { get => Q<string>("wait_for_active_shards"); set => Q("wait_for_active_shards", value); }
612-
///<summary>ID of the parent document</summary>
613-
[Obsolete("Scheduled to be removed in 7.0, the parent parameter has been deprecated from elasticsearch, please use routing instead directly.")]
614-
public string Parent { get => Q<string>("parent"); set => Q("parent", value); }
615612
///<summary>
616613
/// If `true` then refresh the affected shards to make this operation visible to search, if `wait_for` then wait for a refresh to make this
617614
/// operation visible to search, if `false` (the default) then do nothing with refreshes.
@@ -638,9 +635,6 @@ public class DeleteRequestParameters : RequestParameters<DeleteRequestParameters
638635
/// shard (number of replicas + 1)
639636
///</summary>
640637
public string WaitForActiveShards { get => Q<string>("wait_for_active_shards"); set => Q("wait_for_active_shards", value); }
641-
///<summary>ID of parent document</summary>
642-
[Obsolete("Scheduled to be removed in 7.0, the parent parameter has been deprecated from elasticsearch, please use routing instead directly.")]
643-
public string Parent { get => Q<string>("parent"); set => Q("parent", value); }
644638
///<summary>
645639
/// If `true` then refresh the effected shards to make this operation visible to search, if `wait_for` then wait for a refresh to make this
646640
/// operation visible to search, if `false` (the default) then do nothing with refreshes.
@@ -757,9 +751,6 @@ public class DocumentExistsRequestParameters : RequestParameters<DocumentExistsR
757751
public override HttpMethod DefaultHttpMethod => HttpMethod.HEAD;
758752
///<summary>A comma-separated list of stored fields to return in the response</summary>
759753
public string[] StoredFields { get => Q<string[]>("stored_fields"); set => Q("stored_fields", value); }
760-
///<summary>The ID of the parent document</summary>
761-
[Obsolete("Scheduled to be removed in 7.0, the parent parameter has been deprecated from elasticsearch, please use routing instead directly.")]
762-
public string Parent { get => Q<string>("parent"); set => Q("parent", value); }
763754
///<summary>Specify the node or shard the operation should be performed on (default: random)</summary>
764755
public string Preference { get => Q<string>("preference"); set => Q("preference", value); }
765756
///<summary>Specify whether to perform the operation in realtime or search mode</summary>
@@ -783,9 +774,6 @@ public class DocumentExistsRequestParameters : RequestParameters<DocumentExistsR
783774
public class SourceExistsRequestParameters : RequestParameters<SourceExistsRequestParameters>
784775
{
785776
public override HttpMethod DefaultHttpMethod => HttpMethod.HEAD;
786-
///<summary>The ID of the parent document</summary>
787-
[Obsolete("Scheduled to be removed in 7.0, the parent parameter has been deprecated from elasticsearch, please use routing instead directly.")]
788-
public string Parent { get => Q<string>("parent"); set => Q("parent", value); }
789777
///<summary>Specify the node or shard the operation should be performed on (default: random)</summary>
790778
public string Preference { get => Q<string>("preference"); set => Q("preference", value); }
791779
///<summary>Specify whether to perform the operation in realtime or search mode</summary>
@@ -821,9 +809,6 @@ public class ExplainRequestParameters : RequestParameters<ExplainRequestParamete
821809
public string[] StoredFields { get => Q<string[]>("stored_fields"); set => Q("stored_fields", value); }
822810
///<summary>Specify whether format-based query failures (such as providing text to a numeric field) should be ignored</summary>
823811
public bool? Lenient { get => Q<bool?>("lenient"); set => Q("lenient", value); }
824-
///<summary>The ID of the parent document</summary>
825-
[Obsolete("Scheduled to be removed in 7.0, the parent parameter has been deprecated from elasticsearch, please use routing instead directly.")]
826-
public string Parent { get => Q<string>("parent"); set => Q("parent", value); }
827812
///<summary>Specify the node or shard the operation should be performed on (default: random)</summary>
828813
public string Preference { get => Q<string>("preference"); set => Q("preference", value); }
829814
///<summary>Query in the Lucene query string syntax</summary>
@@ -859,9 +844,6 @@ public class GetRequestParameters : RequestParameters<GetRequestParameters>
859844
public override HttpMethod DefaultHttpMethod => HttpMethod.GET;
860845
///<summary>A comma-separated list of stored fields to return in the response</summary>
861846
public string[] StoredFields { get => Q<string[]>("stored_fields"); set => Q("stored_fields", value); }
862-
///<summary>The ID of the parent document</summary>
863-
[Obsolete("Scheduled to be removed in 7.0, the parent parameter has been deprecated from elasticsearch, please use routing instead directly.")]
864-
public string Parent { get => Q<string>("parent"); set => Q("parent", value); }
865847
///<summary>Specify the node or shard the operation should be performed on (default: random)</summary>
866848
public string Preference { get => Q<string>("preference"); set => Q("preference", value); }
867849
///<summary>Specify whether to perform the operation in realtime or search mode</summary>
@@ -892,9 +874,6 @@ public class GetScriptRequestParameters : RequestParameters<GetScriptRequestPara
892874
public class SourceRequestParameters : RequestParameters<SourceRequestParameters>
893875
{
894876
public override HttpMethod DefaultHttpMethod => HttpMethod.GET;
895-
///<summary>The ID of the parent document</summary>
896-
[Obsolete("Scheduled to be removed in 7.0, the parent parameter has been deprecated from elasticsearch, please use routing instead directly.")]
897-
public string Parent { get => Q<string>("parent"); set => Q("parent", value); }
898877
///<summary>Specify the node or shard the operation should be performed on (default: random)</summary>
899878
public string Preference { get => Q<string>("preference"); set => Q("preference", value); }
900879
///<summary>Specify whether to perform the operation in realtime or search mode</summary>
@@ -926,9 +905,6 @@ public class IndexRequestParameters : RequestParameters<IndexRequestParameters>
926905
public string WaitForActiveShards { get => Q<string>("wait_for_active_shards"); set => Q("wait_for_active_shards", value); }
927906
///<summary>Explicit operation type</summary>
928907
public OpType? OpType { get => Q<OpType?>("op_type"); set => Q("op_type", value); }
929-
///<summary>ID of the parent document</summary>
930-
[Obsolete("Scheduled to be removed in 7.0, the parent parameter has been deprecated from elasticsearch, please use routing instead directly.")]
931-
public string Parent { get => Q<string>("parent"); set => Q("parent", value); }
932908
///<summary>
933909
/// If `true` then refresh the affected shards to make this operation visible to search, if `wait_for` then wait for a refresh to make this
934910
/// operation visible to search, if `false` (the default) then do nothing with refreshes.
@@ -1448,9 +1424,6 @@ public class IndicesShardStoresRequestParameters : RequestParameters<IndicesShar
14481424
public class ShrinkIndexRequestParameters : RequestParameters<ShrinkIndexRequestParameters>
14491425
{
14501426
public override HttpMethod DefaultHttpMethod => HttpMethod.PUT;
1451-
///<summary>whether or not to copy settings from the source index (defaults to false)</summary>
1452-
[Obsolete("Scheduled to be removed in 7.0, Elasticsearch 6.4 will throw an exception if this is turned off see elastic/elasticsearch#30404")]
1453-
public bool? CopySettings { get => Q<bool?>("copy_settings"); set => Q("copy_settings", value); }
14541427
///<summary>Explicit operation timeout</summary>
14551428
public TimeSpan Timeout { get => Q<TimeSpan>("timeout"); set => Q("timeout", value); }
14561429
///<summary>Specify timeout for connection to master</summary>
@@ -1462,9 +1435,6 @@ public class ShrinkIndexRequestParameters : RequestParameters<ShrinkIndexRequest
14621435
public class SplitIndexRequestParameters : RequestParameters<SplitIndexRequestParameters>
14631436
{
14641437
public override HttpMethod DefaultHttpMethod => HttpMethod.PUT;
1465-
///<summary>whether or not to copy settings from the source index (defaults to false)</summary>
1466-
[Obsolete("Scheduled to be removed in 7.0, Elasticsearch 6.4 will throw an exception if this is turned off see elastic/elasticsearch#30404")]
1467-
public bool? CopySettings { get => Q<bool?>("copy_settings"); set => Q("copy_settings", value); }
14681438
///<summary>Explicit operation timeout</summary>
14691439
public TimeSpan Timeout { get => Q<TimeSpan>("timeout"); set => Q("timeout", value); }
14701440
///<summary>Specify timeout for connection to master</summary>
@@ -1682,9 +1652,6 @@ public class MultiTermVectorsRequestParameters : RequestParameters<MultiTermVect
16821652
public string Preference { get => Q<string>("preference"); set => Q("preference", value); }
16831653
///<summary>Specific routing value. Applies to all returned documents unless otherwise specified in body "params" or "docs".</summary>
16841654
public string Routing { get => Q<string>("routing"); set => Q("routing", value); }
1685-
///<summary>Parent id of documents. Applies to all returned documents unless otherwise specified in body "params" or "docs".</summary>
1686-
[Obsolete("Scheduled to be removed in 7.0, the parent parameter has been deprecated from elasticsearch, please use routing instead directly.")]
1687-
public string Parent { get => Q<string>("parent"); set => Q("parent", value); }
16881655
///<summary>Specifies if requests are real-time as opposed to near-real-time (default: true).</summary>
16891656
public bool? Realtime { get => Q<bool?>("realtime"); set => Q("realtime", value); }
16901657
///<summary>Explicit version number for concurrency control</summary>
@@ -2097,9 +2064,6 @@ public class TermVectorsRequestParameters : RequestParameters<TermVectorsRequest
20972064
public string Preference { get => Q<string>("preference"); set => Q("preference", value); }
20982065
///<summary>Specific routing value.</summary>
20992066
public string Routing { get => Q<string>("routing"); set => Q("routing", value); }
2100-
///<summary>Parent id of documents.</summary>
2101-
[Obsolete("Scheduled to be removed in 7.0, the parent parameter has been deprecated from elasticsearch, please use routing instead directly.")]
2102-
public string Parent { get => Q<string>("parent"); set => Q("parent", value); }
21032067
///<summary>Specifies if request is real-time as opposed to near-real-time (default: true).</summary>
21042068
public bool? Realtime { get => Q<bool?>("realtime"); set => Q("realtime", value); }
21052069
///<summary>Explicit version number for concurrency control</summary>
@@ -2121,9 +2085,6 @@ public class UpdateRequestParameters : RequestParameters<UpdateRequestParameters
21212085
public bool? SourceEnabled { get => Q<bool?>("_source"); set => Q("_source", value); }
21222086
///<summary>The script language (default: painless)</summary>
21232087
public string Lang { get => Q<string>("lang"); set => Q("lang", value); }
2124-
///<summary>ID of the parent document. Is is only used for routing and when for the upsert request</summary>
2125-
[Obsolete("Scheduled to be removed in 7.0, the parent parameter has been deprecated from elasticsearch, please use routing instead directly.")]
2126-
public string Parent { get => Q<string>("parent"); set => Q("parent", value); }
21272088
///<summary>
21282089
/// If `true` then refresh the effected shards to make this operation visible to search, if `wait_for` then wait for a refresh to make this
21292090
/// operation visible to search, if `false` (the default) then do nothing with refreshes.

src/Elasticsearch.Net/Extensions/Fluent.cs

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,6 @@ namespace Elasticsearch.Net
44
{
55
internal static class Fluent
66
{
7-
[Obsolete("Use the overload that accepts TValue")]
8-
internal static TDescriptor Assign<TDescriptor, TInterface>(TDescriptor self, Action<TInterface> assign)
9-
where TDescriptor : class, TInterface
10-
{
11-
assign(self);
12-
return self;
13-
}
14-
157
internal static TDescriptor Assign<TDescriptor, TInterface, TValue>(TDescriptor self, TValue value, Action<TInterface, TValue> assign)
168
where TDescriptor : class, TInterface
179
{

src/Nest/Aggregations/Bucket/BucketAggregation.cs

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,10 +31,6 @@ public abstract class BucketAggregationDescriptorBase<TBucketAggregation, TBucke
3131

3232
string IAggregation.Name { get; set; }
3333

34-
[Obsolete("Use the overload that accepts TValue")]
35-
protected TBucketAggregation Assign(Action<TBucketAggregationInterface> assigner) =>
36-
Fluent.Assign((TBucketAggregation)this, assigner);
37-
3834
protected TBucketAggregation Assign<TValue>(TValue value, Action<TBucketAggregationInterface, TValue> assigner) =>
3935
Fluent.Assign((TBucketAggregation)this, value, assigner);
4036

src/Nest/Aggregations/Bucket/Terms/TermsOrder.cs

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,5 @@ public class TermsOrder : ISortOrder
1414
public static TermsOrder KeyAscending => new TermsOrder { Key = "_key", Order = SortOrder.Ascending };
1515
public static TermsOrder KeyDescending => new TermsOrder { Key = "_key", Order = SortOrder.Descending };
1616
public SortOrder Order { get; set; }
17-
18-
[Obsolete("Deprecated in Elasticsearch 6.0. Use KeyAscending")]
19-
public static TermsOrder TermAscending => new TermsOrder { Key = "_key", Order = SortOrder.Ascending };
20-
21-
[Obsolete("Deprecated in Elasticsearch 6.0. Use KeyDescending")]
22-
public static TermsOrder TermDescending => new TermsOrder { Key = "_key", Order = SortOrder.Descending };
2317
}
2418
}

src/Nest/Analysis/TokenFilters/Synonym/SynonymGraphTokenFilter.cs

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,6 @@ public interface ISynonymGraphTokenFilter : ITokenFilter
1818
[DataMember(Name ="format")]
1919
SynonymFormat? Format { get; set; }
2020

21-
[DataMember(Name ="ignore_case")]
22-
[Obsolete("Will be removed in Elasticsearch 7.x, if you need to ignore case add a lowercase filter before this synonym filter")]
23-
[JsonFormatter(typeof(NullableStringBooleanFormatter))]
24-
bool? IgnoreCase { get; set; }
25-
2621
/// <inheritdoc cref="ISynonymTokenFilter.Lenient" />
2722
[DataMember(Name ="lenient")]
2823
[JsonFormatter(typeof(NullableStringBooleanFormatter))]
@@ -52,10 +47,6 @@ public SynonymGraphTokenFilter() : base("synonym_graph") { }
5247
/// <inheritdoc />
5348
public SynonymFormat? Format { get; set; }
5449

55-
/// <inheritdoc />
56-
[Obsolete("Will be removed in Elasticsearch 7.x, if you need to ignore case add a lowercase filter before this synonym filter")]
57-
public bool? IgnoreCase { get; set; }
58-
5950
/// <inheritdoc cref="ISynonymTokenFilter.Lenient" />
6051
public bool? Lenient { get; set; }
6152

@@ -77,17 +68,12 @@ public class SynonymGraphTokenFilterDescriptor
7768
bool? ISynonymGraphTokenFilter.Expand { get; set; }
7869
SynonymFormat? ISynonymGraphTokenFilter.Format { get; set; }
7970

80-
bool? ISynonymGraphTokenFilter.IgnoreCase { get; set; }
8171
bool? ISynonymGraphTokenFilter.Lenient { get; set; }
8272

8373
IEnumerable<string> ISynonymGraphTokenFilter.Synonyms { get; set; }
8474
string ISynonymGraphTokenFilter.SynonymsPath { get; set; }
8575
string ISynonymGraphTokenFilter.Tokenizer { get; set; }
8676

87-
/// <inheritdoc />
88-
[Obsolete("Will be removed in Elasticsearch 7.x, if you need to ignore case add a lowercase filter before this synonym filter")]
89-
public SynonymGraphTokenFilterDescriptor IgnoreCase(bool? ignoreCase = true) => Assign(ignoreCase, (a, v) => a.IgnoreCase = v);
90-
9177
/// <inheritdoc />
9278
public SynonymGraphTokenFilterDescriptor Expand(bool? expand = true) => Assign(expand, (a, v) => a.Expand = v);
9379

src/Nest/Analysis/TokenFilters/Synonym/SynonymTokenFilter.cs

Lines changed: 1 addition & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -17,14 +17,9 @@ public interface ISynonymTokenFilter : ITokenFilter
1717
[DataMember(Name ="format")]
1818
SynonymFormat? Format { get; set; }
1919

20-
[DataMember(Name ="ignore_case")]
21-
[Obsolete("Will be removed in Elasticsearch 7.x, if you need to ignore case add a lowercase filter before this synonym filter")]
22-
[JsonFormatter(typeof(NullableStringBooleanFormatter))]
23-
bool? IgnoreCase { get; set; }
24-
2520
/// <summary>
2621
/// If `true` ignores exceptions while parsing the synonym configuration. It is important
27-
// to note that only those synonym rules which cannot get parsed are ignored.
22+
/// to note that only those synonym rules which cannot get parsed are ignored.
2823
/// </summary>
2924
[DataMember(Name ="lenient")]
3025
[JsonFormatter(typeof(NullableStringBooleanFormatter))]
@@ -54,10 +49,6 @@ public SynonymTokenFilter() : base("synonym") { }
5449
/// <inheritdoc />
5550
public SynonymFormat? Format { get; set; }
5651

57-
/// <inheritdoc />
58-
[Obsolete("Will be removed in Elasticsearch 7.x, if you need to ignore case add a lowercase filter before this synonym filter")]
59-
public bool? IgnoreCase { get; set; }
60-
6152
/// <inheritdoc cref="ISynonymTokenFilter.Lenient" />
6253
public bool? Lenient { get; set; }
6354

@@ -78,17 +69,11 @@ public class SynonymTokenFilterDescriptor
7869
protected override string Type => "synonym";
7970
bool? ISynonymTokenFilter.Expand { get; set; }
8071
SynonymFormat? ISynonymTokenFilter.Format { get; set; }
81-
82-
bool? ISynonymTokenFilter.IgnoreCase { get; set; }
8372
bool? ISynonymTokenFilter.Lenient { get; set; }
8473
IEnumerable<string> ISynonymTokenFilter.Synonyms { get; set; }
8574
string ISynonymTokenFilter.SynonymsPath { get; set; }
8675
string ISynonymTokenFilter.Tokenizer { get; set; }
8776

88-
/// <inheritdoc />
89-
[Obsolete("Will be removed in Elasticsearch 7.x, if you need to ignore case add a lowercase filter before this synonym filter")]
90-
public SynonymTokenFilterDescriptor IgnoreCase(bool? ignoreCase = true) => Assign(ignoreCase, (a, v) => a.IgnoreCase = v);
91-
9277
/// <inheritdoc />
9378
public SynonymTokenFilterDescriptor Expand(bool? expand = true) => Assign(expand, (a, v) => a.Expand = v);
9479

src/Nest/CommonAbstractions/ConnectionSettings/ConnectionSettingsBase.cs

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -244,12 +244,6 @@ private void ApplyPropertyMappings<TDocument>(IList<IClrPropertyMapping<TDocumen
244244
/// The mapping can infer the index, type, id and relation name for a given CLR type, as well as control
245245
/// serialization behaviour for CLR properties.
246246
/// </summary>
247-
[Obsolete("Please use " + nameof(DefaultMappingFor))]
248-
public TConnectionSettings InferMappingFor<TDocument>(Func<ClrTypeMappingDescriptor<TDocument>, IClrTypeMapping<TDocument>> selector)
249-
where TDocument : class =>
250-
DefaultMappingFor<TDocument>(selector);
251-
252-
/// <inheritdoc cref="InferMappingFor{TDocument}"/>
253247
public TConnectionSettings DefaultMappingFor<TDocument>(Func<ClrTypeMappingDescriptor<TDocument>, IClrTypeMapping<TDocument>> selector)
254248
where TDocument : class
255249
{

src/Nest/CommonAbstractions/Fluent/DescriptorBase.cs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,6 @@ public abstract class DescriptorBase<TDescriptor, TInterface> : IDescriptor
1818
[IgnoreDataMember]
1919
protected TInterface Self => _self;
2020

21-
[Obsolete("Use the overload that accepts TValue")]
22-
protected TDescriptor Assign(Action<TInterface> assigner) => Fluent.Assign(_self, assigner);
23-
2421
[MethodImpl(MethodImplOptions.AggressiveInlining)]
2522
protected TDescriptor Assign<TValue>(TValue value, Action<TInterface, TValue> assigner) => Fluent.Assign(_self, value, assigner);
2623

src/Nest/CommonAbstractions/Fluent/Fluent.cs

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,6 @@ namespace Nest
55
{
66
internal static class Fluent
77
{
8-
[Obsolete("Use the overload that accepts TValue")]
9-
internal static TDescriptor Assign<TDescriptor, TInterface>(TDescriptor self, Action<TInterface> assign)
10-
where TDescriptor : class, TInterface
11-
{
12-
assign(self);
13-
return self;
14-
}
15-
168
[MethodImpl(MethodImplOptions.AggressiveInlining)]
179
internal static TDescriptor Assign<TDescriptor, TInterface, TValue>(TDescriptor self, TValue value, Action<TInterface, TValue> assign)
1810
where TDescriptor : class, TInterface

0 commit comments

Comments
 (0)