Skip to content

Commit cb73fdd

Browse files
committed
added bwc for IndicesRecovery()
1 parent e6adf01 commit cb73fdd

File tree

3 files changed

+83
-0
lines changed

3 files changed

+83
-0
lines changed

src/Elasticsearch.Net/Elasticsearch.Net.csproj

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,7 @@
6767
<Compile Include="Domain\Response\VoidResponse.cs" />
6868
<Compile Include="Domain\Response\ElasticsearchServerError.cs" />
6969
<Compile Include="Exceptions\OneToOneServerException.cs" />
70+
<Compile Include="Obsolete\IndicesRecoveryStatus.cs" />
7071
<Compile Include="Obsolete\IndicesTemplateExists.cs" />
7172
<Compile Include="Obsolete\IndicesGetFieldMapping.cs" />
7273
<Compile Include="Obsolete\Mpercolate.cs" />
Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
using System;
2+
using System.Threading.Tasks;
3+
using System.Collections.Generic;
4+
using System.Linq;
5+
using System.Text;
6+
7+
namespace Elasticsearch.Net
8+
{
9+
#pragma warning disable 0618
10+
using IndicesRecoveryStatusSelector = Func<IndicesRecoveryRequestParameters, IndicesRecoveryRequestParameters>;
11+
#pragma warning restore 0618
12+
13+
[Obsolete("Scheduled to be removed in 2.0, renamed to TypeExistsRequestParameters")]
14+
public class IndicesRecoveryRequestParameters : RecoveryStatusRequestParameters { }
15+
16+
public static class IndicesRecoveryStatusClientExtensions
17+
{
18+
[Obsolete("Scheduled to be removed in 2.0, use the method that takes a Func of RecoveryStatusRequestParameters")]
19+
public static ElasticsearchResponse<T> IndicesRecoveryForAll<T>(this IElasticsearchClient client, IndicesRecoveryStatusSelector requestParameters = null)
20+
{
21+
var selector = Obsolete.UpCastSelector<IndicesRecoveryRequestParameters, RecoveryStatusRequestParameters>(requestParameters);
22+
return client.IndicesRecoveryForAll<T>(selector);
23+
}
24+
25+
[Obsolete("Scheduled to be removed in 2.0, use the method that takes a Func of RecoveryStatusRequestParameters")]
26+
public static Task<ElasticsearchResponse<T>> IndicesRecoveryForAllAsync<T>(this IElasticsearchClient client, IndicesRecoveryStatusSelector requestParameters = null)
27+
{
28+
var selector = Obsolete.UpCastSelector<IndicesRecoveryRequestParameters, RecoveryStatusRequestParameters>(requestParameters);
29+
return client.IndicesRecoveryForAllAsync<T>(selector);
30+
31+
}
32+
33+
[Obsolete("Scheduled to be removed in 2.0, use the method that takes a Func of RecoveryStatusRequestParameters")]
34+
public static ElasticsearchResponse<DynamicDictionary> IndicesRecoveryForAll(this IElasticsearchClient client, IndicesRecoveryStatusSelector requestParameters = null)
35+
{
36+
var selector = Obsolete.UpCastSelector<IndicesRecoveryRequestParameters, RecoveryStatusRequestParameters>(requestParameters);
37+
return client.IndicesRecoveryForAll(selector);
38+
39+
}
40+
41+
[Obsolete("Scheduled to be removed in 2.0, use the method that takes a Func of RecoveryStatusRequestParameters")]
42+
public static Task<ElasticsearchResponse<DynamicDictionary>> IndicesRecoveryForAllAsync(this IElasticsearchClient client, IndicesRecoveryStatusSelector requestParameters = null)
43+
{
44+
var selector = Obsolete.UpCastSelector<IndicesRecoveryRequestParameters, RecoveryStatusRequestParameters>(requestParameters);
45+
return client.IndicesRecoveryForAllAsync(selector);
46+
}
47+
48+
[Obsolete("Scheduled to be removed in 2.0, use the method that takes a Func of RecoveryStatusRequestParameters")]
49+
public static ElasticsearchResponse<T> IndicesRecovery<T>(this IElasticsearchClient client, string index, IndicesRecoveryStatusSelector requestParameters = null)
50+
{
51+
var selector = Obsolete.UpCastSelector<IndicesRecoveryRequestParameters, RecoveryStatusRequestParameters>(requestParameters);
52+
return client.IndicesRecovery<T>(index, selector);
53+
}
54+
55+
[Obsolete("Scheduled to be removed in 2.0, use the method that takes a Func of RecoveryStatusRequestParameters")]
56+
public static Task<ElasticsearchResponse<T>> IndicesRecoveryAsync<T>(this IElasticsearchClient client, string index, IndicesRecoveryStatusSelector requestParameters = null)
57+
{
58+
var selector = Obsolete.UpCastSelector<IndicesRecoveryRequestParameters, RecoveryStatusRequestParameters>(requestParameters);
59+
return client.IndicesRecoveryAsync<T>(index, selector);
60+
}
61+
62+
[Obsolete("Scheduled to be removed in 2.0, use the method that takes a Func of RecoveryStatusRequestParameters")]
63+
public static ElasticsearchResponse<DynamicDictionary> IndicesRecovery(this IElasticsearchClient client, string index, IndicesRecoveryStatusSelector requestParameters = null)
64+
{
65+
var selector = Obsolete.UpCastSelector<IndicesRecoveryRequestParameters, RecoveryStatusRequestParameters>(requestParameters);
66+
return client.IndicesRecovery(index, selector);
67+
}
68+
69+
[Obsolete("Scheduled to be removed in 2.0, use the method that takes a Func of RecoveryStatusRequestParameters")]
70+
public static Task<ElasticsearchResponse<DynamicDictionary>> IndicesRecoveryAsync(this IElasticsearchClient client, string index, IndicesRecoveryStatusSelector requestParameters = null)
71+
{
72+
var selector = Obsolete.UpCastSelector<IndicesRecoveryRequestParameters, RecoveryStatusRequestParameters>(requestParameters);
73+
return client.IndicesRecoveryAsync(index, selector);
74+
}
75+
}
76+
}

src/Nest/Obsolete/Obsolete.cs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,4 +53,10 @@ public class MpercolateDescriptor : MultiPercolateDescriptor { }
5353

5454
[Obsolete("Scheduled to be removed in 2.0, use MultiPercolateRequest instead")]
5555
public class MpercolateRequest : MultiPercolateRequest {}
56+
57+
[Obsolete("Scheduled to be removed in 2.0, use RecoveryStatusDescriptor instead")]
58+
public class IndicesRecoveryDescriptor : RecoveryStatusDescriptor { }
59+
60+
[Obsolete("Scheduled to be removed in 2.0, use RecoveryStatusRequest instead")]
61+
public class IndicesRecoveryRequest : RecoveryStatusRequest {}
5662
}

0 commit comments

Comments
 (0)