Skip to content

Commit 026dea4

Browse files
committed
Maintain BWC for XPackDeprecationInfo
This commit adds back XpackDeprecationInfo* methods to the low level client to maintain backwards binary compatibility, and deprecates them through Obsolete attribute to point users to the new method name. The new X-Pack REST API specs moved the deprecation info API specs from https://github.com/elastic/elasticsearch-net/blob/6.0.2/src/CodeGeneration/ApiGenerator/RestSpecification/XPack/Info/xpack.deprecation.info.json to https://github.com/elastic/elasticsearch-net/blob/6.x/src/CodeGeneration/ApiGenerator/RestSpecification/XPack/Migration/xpack.migration.deprecations.json and renamed from "xpack.deprecation.info" to "xpack.migration.deprecations".
1 parent 0afcfaa commit 026dea4

File tree

2 files changed

+67
-0
lines changed

2 files changed

+67
-0
lines changed
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
using System;
2+
using System.Threading;
3+
using System.Threading.Tasks;
4+
using static Elasticsearch.Net.HttpMethod;
5+
6+
namespace Elasticsearch.Net
7+
{
8+
public partial class ElasticLowLevelClient
9+
{
10+
///<summary>GET on /_xpack/migration/deprecations <para>http://www.elastic.co/guide/en/migration/current/migration-api-deprecation.html</para></summary>
11+
///<param name="requestParameters">A func that allows you to describe the querystring parameters &amp; request specific connection settings.</param>
12+
[Obsolete("Use XpackMigrationDeprecations")]
13+
public TResponse XpackDeprecationInfo<TResponse>(DeprecationInfoRequestParameters requestParameters = null)
14+
where TResponse : class, IElasticsearchResponse, new() => this.DoRequest<TResponse>(GET, Url($"_xpack/migration/deprecations"), null, _params(requestParameters));
15+
16+
///<summary>GET on /_xpack/migration/deprecations <para>http://www.elastic.co/guide/en/migration/current/migration-api-deprecation.html</para></summary>
17+
///<param name="requestParameters">A func that allows you to describe the querystring parameters &amp; request specific connection settings.</param>
18+
[Obsolete("Use XpackMigrationDeprecationsAsync")]
19+
public Task<TResponse> XpackDeprecationInfoAsync<TResponse>(DeprecationInfoRequestParameters requestParameters = null, CancellationToken ctx = default(CancellationToken))
20+
where TResponse : class, IElasticsearchResponse, new() => this.DoRequestAsync<TResponse>(GET, Url($"_xpack/migration/deprecations"), ctx, null, _params(requestParameters));
21+
22+
///<summary>GET on /{index}/_xpack/migration/deprecations <para>http://www.elastic.co/guide/en/migration/current/migration-api-deprecation.html</para></summary>
23+
///<param name="index">Index pattern</param>
24+
///<param name="requestParameters">A func that allows you to describe the querystring parameters &amp; request specific connection settings.</param>
25+
[Obsolete("Use XpackMigrationDeprecations")]
26+
public TResponse XpackDeprecationInfo<TResponse>(string index, DeprecationInfoRequestParameters requestParameters = null)
27+
where TResponse : class, IElasticsearchResponse, new() => this.DoRequest<TResponse>(GET, Url($"{index.NotNull("index")}/_xpack/migration/deprecations"), null, _params(requestParameters));
28+
29+
///<summary>GET on /{index}/_xpack/migration/deprecations <para>http://www.elastic.co/guide/en/migration/current/migration-api-deprecation.html</para></summary>
30+
///<param name="index">Index pattern</param>
31+
///<param name="requestParameters">A func that allows you to describe the querystring parameters &amp; request specific connection settings.</param>
32+
[Obsolete("Use XpackMigrationDeprecationsAsync")]
33+
public Task<TResponse> XpackDeprecationInfoAsync<TResponse>(string index, DeprecationInfoRequestParameters requestParameters = null, CancellationToken ctx = default(CancellationToken))
34+
where TResponse : class, IElasticsearchResponse, new() => this.DoRequestAsync<TResponse>(GET, Url($"{index.NotNull("index")}/_xpack/migration/deprecations"), ctx, null, _params(requestParameters));
35+
}
36+
}
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
using System;
2+
using System.Threading;
3+
using System.Threading.Tasks;
4+
5+
namespace Elasticsearch.Net
6+
{
7+
public partial interface IElasticLowLevelClient
8+
{
9+
///<summary>GET on /_xpack/migration/deprecations <para>http://www.elastic.co/guide/en/migration/current/migration-api-deprecation.html</para></summary>
10+
///<param name="requestParameters">A func that allows you to describe the querystring parameters &amp; request specific connection settings.</param>
11+
[Obsolete("Use XpackMigrationDeprecations")]
12+
TResponse XpackDeprecationInfo<TResponse>(DeprecationInfoRequestParameters requestParameters = null) where TResponse : class, IElasticsearchResponse, new();
13+
14+
///<summary>GET on /_xpack/migration/deprecations <para>http://www.elastic.co/guide/en/migration/current/migration-api-deprecation.html</para></summary>
15+
///<param name="requestParameters">A func that allows you to describe the querystring parameters &amp; request specific connection settings.</param>
16+
[Obsolete("Use XpackMigrationDeprecationsAsync")]
17+
Task<TResponse> XpackDeprecationInfoAsync<TResponse>(DeprecationInfoRequestParameters requestParameters = null, CancellationToken ctx = default(CancellationToken)) where TResponse : class, IElasticsearchResponse, new();
18+
19+
///<summary>GET on /{index}/_xpack/migration/deprecations <para>http://www.elastic.co/guide/en/migration/current/migration-api-deprecation.html</para></summary>
20+
///<param name="index">Index pattern</param>
21+
///<param name="requestParameters">A func that allows you to describe the querystring parameters &amp; request specific connection settings.</param>
22+
[Obsolete("Use XpackMigrationDeprecations")]
23+
TResponse XpackDeprecationInfo<TResponse>(string index, DeprecationInfoRequestParameters requestParameters = null) where TResponse : class, IElasticsearchResponse, new();
24+
25+
///<summary>GET on /{index}/_xpack/migration/deprecations <para>http://www.elastic.co/guide/en/migration/current/migration-api-deprecation.html</para></summary>
26+
///<param name="index">Index pattern</param>
27+
///<param name="requestParameters">A func that allows you to describe the querystring parameters &amp; request specific connection settings.</param>
28+
[Obsolete("Use XpackMigrationDeprecationsAsync")]
29+
Task<TResponse> XpackDeprecationInfoAsync<TResponse>(string index, DeprecationInfoRequestParameters requestParameters = null, CancellationToken ctx = default(CancellationToken)) where TResponse : class, IElasticsearchResponse, new();
30+
}
31+
}

0 commit comments

Comments
 (0)