Skip to content

Commit c5e8510

Browse files
committed
removed Wrap() from low level client and ElasticsearchResponse, removed unecessary clonefroms in NEST but could not delete the ones in the low level client, used to short circuit auth failures or void responses
1 parent 9aeffb9 commit c5e8510

File tree

10 files changed

+1074
-1048
lines changed

10 files changed

+1074
-1048
lines changed

src/CodeGeneration/CodeGeneration.LowLevelClient/Domain/ApiEndpoint.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -213,8 +213,8 @@ public IEnumerable<CsharpMethod> CsharpMethods
213213
QueryStringParamName = queryStringParamName,
214214
ReturnType = string.Format("ElasticsearchResponse<{0}>", defaultBoundGeneric),
215215
ReturnTypeGeneric = null,
216-
CallTypeGeneric = defaultBoundGeneric == "DynamicDictionary"
217-
? "Dictionary<string, object>" : defaultBoundGeneric,
216+
//CallTypeGeneric = defaultBoundGeneric == "DynamicDictionary" ? "Dictionary<string, object>" : defaultBoundGeneric,
217+
CallTypeGeneric = defaultBoundGeneric,
218218
ReturnDescription =
219219
"ElasticsearchResponse&lt;T&gt; holding the response body deserialized as DynamicDictionary"
220220
+ explanationOfDynamic,
@@ -234,8 +234,8 @@ public IEnumerable<CsharpMethod> CsharpMethods
234234
QueryStringParamName = queryStringParamName,
235235
ReturnType = string.Format("Task<ElasticsearchResponse<{0}>>", defaultBoundGeneric),
236236
ReturnTypeGeneric = null,
237-
CallTypeGeneric = defaultBoundGeneric == "DynamicDictionary"
238-
? "Dictionary<string, object>" : defaultBoundGeneric,
237+
//CallTypeGeneric = defaultBoundGeneric == "DynamicDictionary" ? "Dictionary<string, object>" : defaultBoundGeneric,
238+
CallTypeGeneric = defaultBoundGeneric,
239239
ReturnDescription =
240240
"Task that'll return an ElasticsearchResponse&lt;T$gt; holding the response body deserialized as DynamicDictionary"
241241
+ explanationOfDynamic,

src/Elasticsearch.Net/Domain/Response/ElasticsearchResponse.cs

Lines changed: 0 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -23,25 +23,6 @@ namespace Elasticsearch.Net
2323

2424
public static class ElasticsearchResponse
2525
{
26-
public static Task<ElasticsearchResponse<DynamicDictionary>> WrapAsync(Task<ElasticsearchResponse<Dictionary<string, object>>> responseTask)
27-
{
28-
return responseTask
29-
.ContinueWith(t =>
30-
{
31-
if (t.IsFaulted && t.Exception != null)
32-
{
33-
t.Exception.Flatten().InnerException.RethrowKeepingStackTrace();
34-
return null; //won't be hit
35-
}
36-
return ToDynamicResponse(t.Result);
37-
});
38-
}
39-
40-
public static ElasticsearchResponse<DynamicDictionary> Wrap(ElasticsearchResponse<Dictionary<string, object>> response)
41-
{
42-
return ToDynamicResponse(response);
43-
}
44-
4526
public static ElasticsearchResponse<TTo> CloneFrom<TTo>(IElasticsearchResponse from, TTo to)
4627
{
4728
var response = new ElasticsearchResponse<TTo>(from.Settings)
@@ -63,11 +44,6 @@ public static ElasticsearchResponse<TTo> CloneFrom<TTo>(IElasticsearchResponse f
6344
tt.RequestInformation = response;
6445
return response;
6546
}
66-
67-
public static ElasticsearchResponse<DynamicDictionary> ToDynamicResponse(ElasticsearchResponse<Dictionary<string, object>> response)
68-
{
69-
return CloneFrom(response, response.Response != null ? DynamicDictionary.Create(response.Response) : null);
70-
}
7147
}
7248

7349

0 commit comments

Comments
 (0)