Skip to content

Commit f681b63

Browse files
committed
BWC changes for DELETE alias
1 parent a67dfb8 commit f681b63

File tree

2 files changed

+47
-0
lines changed

2 files changed

+47
-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\IndicesDeleteAlias.cs" />
7071
<Compile Include="Obsolete\IndicesPutAlias.cs" />
7172
<Compile Include="Obsolete\IndicesRecoveryStatus.cs" />
7273
<Compile Include="Obsolete\IndicesTemplateExists.cs" />
Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
using System;
2+
using System.Collections.Generic;
3+
using System.Linq;
4+
using System.Text;
5+
6+
namespace Elasticsearch.Net
7+
{
8+
#pragma warning disable 0618
9+
using System.Threading.Tasks;
10+
using IndicesDeleteAliasSelector = Func<IndicesDeleteAliasRequestParameters, IndicesDeleteAliasRequestParameters>;
11+
#pragma warning restore 0618
12+
13+
[Obsolete("Scheduled to be removed in 2.0, renamed to DeleteAliasRequestParameters")]
14+
public class IndicesDeleteAliasRequestParameters : DeleteAliasRequestParameters { }
15+
16+
public static class IndicesDeleteAliasClientExtensions
17+
{
18+
[Obsolete("Scheduled to be removed in 2.0, use the method that takes a Func of DeleteAliasRequestParameters")]
19+
public static ElasticsearchResponse<T> IndicesDeleteAlias<T>(this IElasticsearchClient client, string index, string name, Func<IndicesDeleteAliasRequestParameters, IndicesDeleteAliasRequestParameters> requestParameters = null)
20+
{
21+
var selector = Obsolete.UpCastSelector<IndicesDeleteAliasRequestParameters, DeleteAliasRequestParameters>(requestParameters);
22+
return client.IndicesDeleteAlias<T>(index, name, selector);
23+
}
24+
25+
[Obsolete("Scheduled to be removed in 2.0, use the method that takes a Func of DeleteAliasRequestParameters")]
26+
public static Task<ElasticsearchResponse<T>> IndicesDeleteAliasAsync<T>(this IElasticsearchClient client, string index, string name, Func<IndicesDeleteAliasRequestParameters, IndicesDeleteAliasRequestParameters> requestParameters = null)
27+
{
28+
var selector = Obsolete.UpCastSelector<IndicesDeleteAliasRequestParameters, DeleteAliasRequestParameters>(requestParameters);
29+
return client.IndicesDeleteAliasAsync<T>(index, name, selector);
30+
}
31+
32+
[Obsolete("Scheduled to be removed in 2.0, use the method that takes a Func of DeleteAliasRequestParameters")]
33+
public static ElasticsearchResponse<DynamicDictionary> IndicesDeleteAlias(this IElasticsearchClient client, string index, string name, Func<IndicesDeleteAliasRequestParameters, IndicesDeleteAliasRequestParameters> requestParameters = null)
34+
{
35+
var selector = Obsolete.UpCastSelector<IndicesDeleteAliasRequestParameters, DeleteAliasRequestParameters>(requestParameters);
36+
return client.IndicesDeleteAlias(index, name, selector);
37+
}
38+
39+
[Obsolete("Scheduled to be removed in 2.0, use the method that takes a Func of DeleteAliasRequestParameters")]
40+
public static Task<ElasticsearchResponse<DynamicDictionary>> IndicesDeleteAliasAsync(this IElasticsearchClient client, string index, string name, Func<IndicesDeleteAliasRequestParameters, IndicesDeleteAliasRequestParameters> requestParameters = null)
41+
{
42+
var selector = Obsolete.UpCastSelector<IndicesDeleteAliasRequestParameters, DeleteAliasRequestParameters>(requestParameters);
43+
return client.IndicesDeleteAliasAsync(index, name, selector);
44+
}
45+
}
46+
}

0 commit comments

Comments
 (0)