diff --git a/src/Elasticsearch.Net/Domain/Response/ElasticsearchResponse.cs b/src/Elasticsearch.Net/Domain/Response/ElasticsearchResponse.cs index 22a6e90eedf..6491b5a3574 100644 --- a/src/Elasticsearch.Net/Domain/Response/ElasticsearchResponse.cs +++ b/src/Elasticsearch.Net/Domain/Response/ElasticsearchResponse.cs @@ -19,11 +19,10 @@ namespace Elasticsearch.Net { - //TODO document and possibly rename some of the properties - + // TODO: Make this class internal in 2.0 public static class ElasticsearchResponse { - public static ElasticsearchResponse CloneFrom(IElasticsearchResponse from, TTo to) + internal static ElasticsearchResponse CloneFrom(IElasticsearchResponse from, TTo to) { var response = new ElasticsearchResponse(from.Settings) { @@ -46,7 +45,6 @@ public static ElasticsearchResponse CloneFrom(IElasticsearchResponse f } } - public class ElasticsearchResponse : IElasticsearchResponse { private static readonly string _printFormat; diff --git a/src/Nest/Domain/ICustomJson.cs b/src/Nest/Domain/ICustomJson.cs index 8087ee00dd9..a6e201fa5bd 100644 --- a/src/Nest/Domain/ICustomJson.cs +++ b/src/Nest/Domain/ICustomJson.cs @@ -2,14 +2,17 @@ namespace Nest { - //If an object implements this then it can handle its own json representation + /// + /// If an object implements this then it can handle its own json representation + /// public interface ICustomJson { object GetCustomJson(); } - public interface IDomainObject - { - - } + /// + /// Any object that implements this interface will automatically have all + /// JsonProperties of all of its implementing interfaces discovered. + /// + public interface INestSerializable { } } \ No newline at end of file diff --git a/src/Nest/ElasticClient-AliasExists.cs b/src/Nest/ElasticClient-AliasExists.cs index 9eb468cfba7..15709e73788 100644 --- a/src/Nest/ElasticClient-AliasExists.cs +++ b/src/Nest/ElasticClient-AliasExists.cs @@ -14,7 +14,7 @@ public partial class ElasticClient /// public IExistsResponse AliasExists(Func selector) { - return this.Dispatch( + return this.Dispatcher.Dispatch( selector, (p, d) => this.RawDispatch.IndicesExistsAliasDispatch( p.DeserializationState(new AliasExistConverter(DeserializeExistsResponse)) @@ -25,7 +25,7 @@ public IExistsResponse AliasExists(Func public IExistsResponse AliasExists(IAliasExistsRequest AliasRequest) { - return this.Dispatch( + return this.Dispatcher.Dispatch( AliasRequest, (p, d) => this.RawDispatch.IndicesExistsAliasDispatch( p.DeserializationState(new AliasExistConverter(DeserializeExistsResponse)) @@ -36,7 +36,7 @@ public IExistsResponse AliasExists(IAliasExistsRequest AliasRequest) /// public Task AliasExistsAsync(Func selector) { - return this.DispatchAsync( + return this.Dispatcher.DispatchAsync( selector, (p, d) => this.RawDispatch.IndicesExistsAliasDispatchAsync( p.DeserializationState(new AliasExistConverter(DeserializeExistsResponse)) @@ -47,7 +47,7 @@ public Task AliasExistsAsync(Func public Task AliasExistsAsync(IAliasExistsRequest AliasRequest) { - return this.DispatchAsync( + return this.Dispatcher.DispatchAsync( AliasRequest, (p, d) => this.RawDispatch.IndicesExistsAliasDispatchAsync( p.DeserializationState(new AliasExistConverter(DeserializeExistsResponse)) diff --git a/src/Nest/ElasticClient-Aliases.cs b/src/Nest/ElasticClient-Aliases.cs index 9ae8af7ecbd..8a83a664022 100644 --- a/src/Nest/ElasticClient-Aliases.cs +++ b/src/Nest/ElasticClient-Aliases.cs @@ -15,7 +15,7 @@ public partial class ElasticClient /// public IIndicesOperationResponse Alias(IAliasRequest aliasRequest) { - return this.Dispatch( + return this.Dispatcher.Dispatch( aliasRequest, (p, d) => this.RawDispatch.IndicesUpdateAliasesDispatch(p, d) ); @@ -24,7 +24,7 @@ public IIndicesOperationResponse Alias(IAliasRequest aliasRequest) /// public IIndicesOperationResponse Alias(Func aliasSelector) { - return this.Dispatch( + return this.Dispatcher.Dispatch( aliasSelector, (p, d) => this.RawDispatch.IndicesUpdateAliasesDispatch(p, d) ); @@ -33,7 +33,7 @@ public IIndicesOperationResponse Alias(Func al /// public Task AliasAsync(IAliasRequest aliasRequest) { - return this.DispatchAsync( + return this.Dispatcher.DispatchAsync( aliasRequest, (p, d) => this.RawDispatch.IndicesUpdateAliasesDispatchAsync(p, d) ); @@ -42,7 +42,7 @@ public Task AliasAsync(IAliasRequest aliasRequest) /// public Task AliasAsync(Func aliasSelector) { - return this.DispatchAsync( + return this.Dispatcher.DispatchAsync( aliasSelector, (p, d) => this.RawDispatch.IndicesUpdateAliasesDispatchAsync(p, d) ); @@ -51,7 +51,7 @@ public Task AliasAsync(Func public IGetAliasesResponse GetAlias(Func GetAliasDescriptor) { - return this.Dispatch( + return this.Dispatcher.Dispatch( GetAliasDescriptor, (p, d) => this.RawDispatch.IndicesGetAliasDispatch( p.DeserializationState(new GetAliasesConverter(DeserializeGetAliasesResponse)) @@ -62,7 +62,7 @@ public IGetAliasesResponse GetAlias(Func /// public IGetAliasesResponse GetAlias(IGetAliasRequest GetAliasRequest) { - return this.Dispatch( + return this.Dispatcher.Dispatch( GetAliasRequest, (p, d) => this.RawDispatch.IndicesGetAliasDispatch( p.DeserializationState(new GetAliasesConverter(DeserializeGetAliasesResponse)) @@ -73,7 +73,7 @@ public IGetAliasesResponse GetAlias(IGetAliasRequest GetAliasRequest) /// public Task GetAliasAsync(Func GetAliasDescriptor) { - return this.DispatchAsync( + return this.Dispatcher.DispatchAsync( GetAliasDescriptor, (p, d) => this.RawDispatch.IndicesGetAliasDispatchAsync( p.DeserializationState(new GetAliasesConverter(DeserializeGetAliasesResponse)) @@ -84,7 +84,7 @@ public Task GetAliasAsync(Func public Task GetAliasAsync(IGetAliasRequest GetAliasRequest) { - return this.DispatchAsync( + return this.Dispatcher.DispatchAsync( GetAliasRequest, (p, d) => this.RawDispatch.IndicesGetAliasDispatchAsync( p.DeserializationState(new GetAliasesConverter(DeserializeGetAliasesResponse)) @@ -96,7 +96,7 @@ public Task GetAliasAsync(IGetAliasRequest GetAliasRequest) /// public IGetAliasesResponse GetAliases(Func getAliasesDescriptor) { - return this.Dispatch( + return this.Dispatcher.Dispatch( getAliasesDescriptor, (p, d) => this.RawDispatch.IndicesGetAliasesDispatch( p.DeserializationState(new GetAliasesConverter(DeserializeGetAliasesResponse)) @@ -107,7 +107,7 @@ public IGetAliasesResponse GetAliases(Func public IGetAliasesResponse GetAliases(IGetAliasesRequest getAliasesRequest) { - return this.Dispatch( + return this.Dispatcher.Dispatch( getAliasesRequest, (p, d) => this.RawDispatch.IndicesGetAliasesDispatch( p.DeserializationState(new GetAliasesConverter(DeserializeGetAliasesResponse)) @@ -118,7 +118,7 @@ public IGetAliasesResponse GetAliases(IGetAliasesRequest getAliasesRequest) /// public Task GetAliasesAsync(Func getAliasesDescriptor) { - return this.DispatchAsync( + return this.Dispatcher.DispatchAsync( getAliasesDescriptor, (p, d) => this.RawDispatch.IndicesGetAliasesDispatchAsync( p.DeserializationState(new GetAliasesConverter(DeserializeGetAliasesResponse)) @@ -129,7 +129,7 @@ public Task GetAliasesAsync(Func public Task GetAliasesAsync(IGetAliasesRequest getAliasesRequest) { - return this.DispatchAsync( + return this.Dispatcher.DispatchAsync( getAliasesRequest, (p, d) => this.RawDispatch.IndicesGetAliasesDispatchAsync( p.DeserializationState(new GetAliasesConverter(DeserializeGetAliasesResponse)) @@ -140,7 +140,7 @@ public Task GetAliasesAsync(IGetAliasesRequest getAliasesRe /// public IPutAliasResponse PutAlias(IPutAliasRequest putAliasRequest) { - return this.Dispatch( + return this.Dispatcher.Dispatch( putAliasRequest, (p, d) => this.RawDispatch.IndicesPutAliasDispatch(p, d) ); @@ -149,7 +149,7 @@ public IPutAliasResponse PutAlias(IPutAliasRequest putAliasRequest) /// public Task PutAliasAsync(IPutAliasRequest putAliasRequest) { - return this.DispatchAsync( + return this.Dispatcher.DispatchAsync( putAliasRequest, (p, d) => this.RawDispatch.IndicesPutAliasDispatchAsync(p, d) ); @@ -158,7 +158,7 @@ public Task PutAliasAsync(IPutAliasRequest putAliasRequest) /// public IPutAliasResponse PutAlias(Func putAliasDescriptor) { - return this.Dispatch( + return this.Dispatcher.Dispatch( putAliasDescriptor, (p, d) => this.RawDispatch.IndicesPutAliasDispatch(p, d) ); @@ -167,7 +167,7 @@ public IPutAliasResponse PutAlias(Func p /// public Task PutAliasAsync(Func putAliasDescriptor) { - return this.DispatchAsync( + return this.Dispatcher.DispatchAsync( putAliasDescriptor, (p, d) => this.RawDispatch.IndicesPutAliasDispatchAsync(p, d) ); @@ -176,7 +176,7 @@ public Task PutAliasAsync(Func public IDeleteAliasResponse DeleteAlias(IDeleteAliasRequest deleteAliasRequest) { - return this.Dispatch( + return this.Dispatcher.Dispatch( deleteAliasRequest, (p, d) => this.RawDispatch.IndicesDeleteAliasDispatch(p) ); @@ -185,7 +185,7 @@ public IDeleteAliasResponse DeleteAlias(IDeleteAliasRequest deleteAliasRequest) /// public Task DeleteAliasAsync(IDeleteAliasRequest deleteAliasRequest) { - return this.DispatchAsync( + return this.Dispatcher.DispatchAsync( deleteAliasRequest, (p, d) => this.RawDispatch.IndicesDeleteAliasDispatchAsync(p) ); @@ -195,7 +195,7 @@ public Task DeleteAliasAsync(IDeleteAliasRequest deleteAli public IDeleteAliasResponse DeleteAlias(Func, DeleteAliasDescriptor> deleteAliasDescriptor) where T : class { - return this.Dispatch, DeleteAliasRequestParameters, DeleteAliasResponse>( + return this.Dispatcher.Dispatch, DeleteAliasRequestParameters, DeleteAliasResponse>( deleteAliasDescriptor, (p, d) => this.RawDispatch.IndicesDeleteAliasDispatch(p) ); @@ -205,7 +205,7 @@ public IDeleteAliasResponse DeleteAlias(Func, Delete public Task DeleteAliasAsync(Func, DeleteAliasDescriptor> deleteAliasDescriptor) where T : class { - return this.DispatchAsync, DeleteAliasRequestParameters, DeleteAliasResponse, IDeleteAliasResponse>( + return this.Dispatcher.DispatchAsync, DeleteAliasRequestParameters, DeleteAliasResponse, IDeleteAliasResponse>( deleteAliasDescriptor, (p, d) => this.RawDispatch.IndicesDeleteAliasDispatchAsync(p) ); diff --git a/src/Nest/ElasticClient-Analyze.cs b/src/Nest/ElasticClient-Analyze.cs index a7b06e141bf..f4bc6d16ecd 100644 --- a/src/Nest/ElasticClient-Analyze.cs +++ b/src/Nest/ElasticClient-Analyze.cs @@ -9,7 +9,7 @@ public partial class ElasticClient /// public IAnalyzeResponse Analyze(Func analyzeSelector) { - return this.Dispatch( + return this.Dispatcher.Dispatch( analyzeSelector, (p, d) => { @@ -24,7 +24,7 @@ public IAnalyzeResponse Analyze(Func analy /// public IAnalyzeResponse Analyze(IAnalyzeRequest analyzeRequest) { - return this.Dispatch( + return this.Dispatcher.Dispatch( analyzeRequest, (p, d) => { @@ -39,7 +39,7 @@ public IAnalyzeResponse Analyze(IAnalyzeRequest analyzeRequest) /// public Task AnalyzeAsync(Func analyzeSelector) { - return this.DispatchAsync( + return this.Dispatcher.DispatchAsync( analyzeSelector, (p, d) => { @@ -54,7 +54,7 @@ public Task AnalyzeAsync(Func public Task AnalyzeAsync(IAnalyzeRequest analyzeRequest) { - return this.DispatchAsync( + return this.Dispatcher.DispatchAsync( analyzeRequest, (p, d) => { diff --git a/src/Nest/ElasticClient-Bulk.cs b/src/Nest/ElasticClient-Bulk.cs index d6ed4b6c919..05a2318bc07 100644 --- a/src/Nest/ElasticClient-Bulk.cs +++ b/src/Nest/ElasticClient-Bulk.cs @@ -11,7 +11,7 @@ public partial class ElasticClient /// public IBulkResponse Bulk(IBulkRequest bulkRequest) { - return this.Dispatch( + return this.Dispatcher.Dispatch( bulkRequest, (p, d) => { @@ -24,7 +24,7 @@ public IBulkResponse Bulk(IBulkRequest bulkRequest) /// public IBulkResponse Bulk(Func bulkSelector) { - return this.Dispatch( + return this.Dispatcher.Dispatch( bulkSelector, (p, d) => { @@ -37,7 +37,7 @@ public IBulkResponse Bulk(Func bulkSelector) /// public Task BulkAsync(IBulkRequest bulkRequest) { - return this.DispatchAsync( + return this.Dispatcher.DispatchAsync( bulkRequest, (p, d) => { @@ -50,7 +50,7 @@ public Task BulkAsync(IBulkRequest bulkRequest) /// public Task BulkAsync(Func bulkSelector) { - return this.DispatchAsync( + return this.Dispatcher.DispatchAsync( bulkSelector, (p, d) => { diff --git a/src/Nest/ElasticClient-Cat.cs b/src/Nest/ElasticClient-Cat.cs index bafe118c386..b4addff3b7f 100644 --- a/src/Nest/ElasticClient-Cat.cs +++ b/src/Nest/ElasticClient-Cat.cs @@ -320,7 +320,7 @@ Func, Task, new() where TRequest : class, IRequest, new() { - return this.DispatchAsync, ICatResponse>( + return this.Dispatcher.DispatchAsync, ICatResponse>( this.ForceConfiguration(selector, c => c.ContentType = "application/json"), (p, d) => dispatch(p.DeserializationState( new Func>(this.DeserializeCatResponse)) @@ -336,7 +336,7 @@ Func, Task, new() where TRequest : IRequest { - return this.DispatchAsync, ICatResponse>( + return this.Dispatcher.DispatchAsync, ICatResponse>( this.ForceConfiguration(request, c => c.ContentType = "application/json"), (p, d) => dispatch(p.DeserializationState( new Func>(this.DeserializeCatResponse)) @@ -352,7 +352,7 @@ Func, ElasticsearchResponse, new() where TRequest : class, IRequest, new() { - return this.Dispatch>( + return this.Dispatcher.Dispatch>( this.ForceConfiguration(selector, c => c.ContentType = "application/json"), (p, d) => dispatch(p.DeserializationState( new Func>(this.DeserializeCatResponse)) @@ -368,7 +368,7 @@ Func, ElasticsearchResponse, new() where TRequest : IRequest { - return this.Dispatch>( + return this.Dispatcher.Dispatch>( this.ForceConfiguration(request, c => c.ContentType = "application/json"), (p, d) => dispatch(p.DeserializationState( new Func>(this.DeserializeCatResponse)) diff --git a/src/Nest/ElasticClient-ClearCache.cs b/src/Nest/ElasticClient-ClearCache.cs index b933252c98e..cc100f45844 100644 --- a/src/Nest/ElasticClient-ClearCache.cs +++ b/src/Nest/ElasticClient-ClearCache.cs @@ -12,7 +12,7 @@ public partial class ElasticClient public IShardsOperationResponse ClearCache(Func selector = null) { selector = selector ?? (s => s); - return this.Dispatch( + return this.Dispatcher.Dispatch( selector, (p, d) => this.RawDispatch.IndicesClearCacheDispatch(p) ); @@ -21,7 +21,7 @@ public IShardsOperationResponse ClearCache(Func public IShardsOperationResponse ClearCache(IClearCacheRequest clearCacheRequest) { - return this.Dispatch( + return this.Dispatcher.Dispatch( clearCacheRequest, (p, d) => this.RawDispatch.IndicesClearCacheDispatch(p) ); @@ -31,7 +31,7 @@ public IShardsOperationResponse ClearCache(IClearCacheRequest clearCacheRequest) public Task ClearCacheAsync(Func selector = null) { selector = selector ?? (s => s); - return this.DispatchAsync( + return this.Dispatcher.DispatchAsync( selector, (p, d) => this.RawDispatch.IndicesClearCacheDispatchAsync(p) ); @@ -40,7 +40,7 @@ public Task ClearCacheAsync(Func public Task ClearCacheAsync(IClearCacheRequest clearCacheRequest) { - return this.DispatchAsync( + return this.Dispatcher.DispatchAsync( clearCacheRequest, (p, d) => this.RawDispatch.IndicesClearCacheDispatchAsync(p) ); diff --git a/src/Nest/ElasticClient-ClusterHealth.cs b/src/Nest/ElasticClient-ClusterHealth.cs index 79a0b2453ed..9f69254a0d7 100644 --- a/src/Nest/ElasticClient-ClusterHealth.cs +++ b/src/Nest/ElasticClient-ClusterHealth.cs @@ -11,7 +11,7 @@ public partial class ElasticClient public IHealthResponse ClusterHealth(Func clusterHealthSelector = null) { clusterHealthSelector = clusterHealthSelector ?? (s => s); - return this.Dispatch( + return this.Dispatcher.Dispatch( clusterHealthSelector, (p, d) => this.RawDispatch.ClusterHealthDispatch(p) ); @@ -20,7 +20,7 @@ public IHealthResponse ClusterHealth(Func public IHealthResponse ClusterHealth(IClusterHealthRequest clusterHealthRequest) { - return this.Dispatch( + return this.Dispatcher.Dispatch( clusterHealthRequest, (p, d) => this.RawDispatch.ClusterHealthDispatch(p) ); @@ -30,7 +30,7 @@ public IHealthResponse ClusterHealth(IClusterHealthRequest clusterHealthRequest) public Task ClusterHealthAsync(Func clusterHealthSelector = null) { clusterHealthSelector = clusterHealthSelector ?? (s => s); - return this.DispatchAsync( + return this.Dispatcher.DispatchAsync( clusterHealthSelector, (p, d) => this.RawDispatch.ClusterHealthDispatchAsync(p) ); @@ -39,7 +39,7 @@ public Task ClusterHealthAsync(Func public Task ClusterHealthAsync(IClusterHealthRequest clusterHealthRequest) { - return this.DispatchAsync( + return this.Dispatcher.DispatchAsync( clusterHealthRequest, (p, d) => this.RawDispatch.ClusterHealthDispatchAsync(p) ); diff --git a/src/Nest/ElasticClient-ClusterPendingTasks.cs b/src/Nest/ElasticClient-ClusterPendingTasks.cs index 17a3f0c461d..7927f395802 100644 --- a/src/Nest/ElasticClient-ClusterPendingTasks.cs +++ b/src/Nest/ElasticClient-ClusterPendingTasks.cs @@ -13,7 +13,7 @@ public partial class ElasticClient public IClusterPendingTasksResponse ClusterPendingTasks(Func pendingTasksSelector = null) { pendingTasksSelector = pendingTasksSelector ?? (s => s); - return this.Dispatch( + return this.Dispatcher.Dispatch( pendingTasksSelector, (p, d) => this.RawDispatch.ClusterPendingTasksDispatch(p) ); @@ -23,7 +23,7 @@ public IClusterPendingTasksResponse ClusterPendingTasks(Func ClusterPendingTasksAsync(Func pendingTasksSelector = null) { pendingTasksSelector = pendingTasksSelector ?? (s => s); - return this.DispatchAsync( + return this.Dispatcher.DispatchAsync( pendingTasksSelector, (p, d) => this.RawDispatch.ClusterPendingTasksDispatchAsync(p) ); @@ -32,7 +32,7 @@ public Task ClusterPendingTasksAsync(Func public IClusterPendingTasksResponse ClusterPendingTasks(IClusterPendingTasksRequest pendingTasksRequest) { - return this.Dispatch( + return this.Dispatcher.Dispatch( pendingTasksRequest, (p, d) => this.RawDispatch.ClusterPendingTasksDispatch(p) ); @@ -41,7 +41,7 @@ public IClusterPendingTasksResponse ClusterPendingTasks(IClusterPendingTasksRequ /// public Task ClusterPendingTasksAsync(IClusterPendingTasksRequest pendingTasksRequest) { - return this.DispatchAsync( + return this.Dispatcher.DispatchAsync( pendingTasksRequest, (p, d) => this.RawDispatch.ClusterPendingTasksDispatchAsync(p) ); diff --git a/src/Nest/ElasticClient-ClusterReroute.cs b/src/Nest/ElasticClient-ClusterReroute.cs index 09c657877a5..575055b8532 100644 --- a/src/Nest/ElasticClient-ClusterReroute.cs +++ b/src/Nest/ElasticClient-ClusterReroute.cs @@ -13,7 +13,7 @@ public partial class ElasticClient public IClusterRerouteResponse ClusterReroute(Func clusterRerouteSelector) { clusterRerouteSelector = clusterRerouteSelector ?? (s => s); - return this.Dispatch( + return this.Dispatcher.Dispatch( clusterRerouteSelector, (p, d) => this.RawDispatch.ClusterRerouteDispatch(p, d) ); @@ -23,7 +23,7 @@ public IClusterRerouteResponse ClusterReroute(Func ClusterRerouteAsync(Func clusterRerouteSelector) { clusterRerouteSelector = clusterRerouteSelector ?? (s => s); - return this.DispatchAsync( + return this.Dispatcher.DispatchAsync( clusterRerouteSelector, (p, d) => this.RawDispatch.ClusterRerouteDispatchAsync(p, d) ); @@ -32,7 +32,7 @@ public Task ClusterRerouteAsync(Func public IClusterRerouteResponse ClusterReroute(IClusterRerouteRequest clusterRerouteRequest) { - return this.Dispatch( + return this.Dispatcher.Dispatch( clusterRerouteRequest, (p, d) => this.RawDispatch.ClusterRerouteDispatch(p, d) ); @@ -41,7 +41,7 @@ public IClusterRerouteResponse ClusterReroute(IClusterRerouteRequest clusterRero /// public Task ClusterRerouteAsync(IClusterRerouteRequest clusterRerouteRequest) { - return this.DispatchAsync( + return this.Dispatcher.DispatchAsync( clusterRerouteRequest, (p, d) => this.RawDispatch.ClusterRerouteDispatchAsync(p, d) ); diff --git a/src/Nest/ElasticClient-ClusterSettings.cs b/src/Nest/ElasticClient-ClusterSettings.cs index d561c25c047..c0c3e8debab 100644 --- a/src/Nest/ElasticClient-ClusterSettings.cs +++ b/src/Nest/ElasticClient-ClusterSettings.cs @@ -11,7 +11,7 @@ public partial class ElasticClient public IClusterPutSettingsResponse ClusterSettings(Func selector) { selector = selector ?? (s => s); - return this.Dispatch( + return this.Dispatcher.Dispatch( selector, (p, d) => this.RawDispatch.ClusterPutSettingsDispatch(p, d) ); @@ -21,7 +21,7 @@ public IClusterPutSettingsResponse ClusterSettings(Func ClusterSettingsAsync(Func selector) { selector = selector ?? (s => s); - return this.DispatchAsync( + return this.Dispatcher.DispatchAsync( selector, (p, d) => this.RawDispatch.ClusterPutSettingsDispatchAsync(p, d) ); @@ -30,7 +30,7 @@ public Task ClusterSettingsAsync(Func public IClusterPutSettingsResponse ClusterSettings(IClusterSettingsRequest clusterSettingsRequest) { - return this.Dispatch( + return this.Dispatcher.Dispatch( clusterSettingsRequest, (p, d) => this.RawDispatch.ClusterPutSettingsDispatch(p, d) ); @@ -39,7 +39,7 @@ public IClusterPutSettingsResponse ClusterSettings(IClusterSettingsRequest clust /// public Task ClusterSettingsAsync(IClusterSettingsRequest clusterSettingsRequest) { - return this.DispatchAsync( + return this.Dispatcher.DispatchAsync( clusterSettingsRequest, (p, d) => this.RawDispatch.ClusterPutSettingsDispatchAsync(p, d) ); @@ -49,7 +49,7 @@ public Task ClusterSettingsAsync(IClusterSettingsRe public IClusterGetSettingsResponse ClusterGetSettings(Func selector = null) { selector = selector ?? (s => s); - return this.Dispatch( + return this.Dispatcher.Dispatch( selector, (p, d) => this.RawDispatch.ClusterGetSettingsDispatch(p) ); @@ -59,7 +59,7 @@ public IClusterGetSettingsResponse ClusterGetSettings(Func ClusterGetSettingsAsync(Func selector) { selector = selector ?? (s => s); - return this.DispatchAsync( + return this.Dispatcher.DispatchAsync( selector, (p, d) => this.RawDispatch.ClusterGetSettingsDispatchAsync(p) ); @@ -68,7 +68,7 @@ public Task ClusterGetSettingsAsync(Func public IClusterGetSettingsResponse ClusterGetSettings(IClusterGetSettingsRequest clusterSettingsRequest) { - return this.Dispatch( + return this.Dispatcher.Dispatch( clusterSettingsRequest ?? new ClusterGetSettingsRequest(), (p, d) => this.RawDispatch.ClusterGetSettingsDispatch(p) ); @@ -77,7 +77,7 @@ public IClusterGetSettingsResponse ClusterGetSettings(IClusterGetSettingsRequest /// public Task ClusterGetSettingsAsync(IClusterGetSettingsRequest clusterSettingsRequest = null) { - return this.DispatchAsync( + return this.Dispatcher.DispatchAsync( clusterSettingsRequest ?? new ClusterGetSettingsRequest(), (p, d) => this.RawDispatch.ClusterGetSettingsDispatchAsync(p) ); diff --git a/src/Nest/ElasticClient-ClusterState.cs b/src/Nest/ElasticClient-ClusterState.cs index 99b03f921a3..6a9ce5ea30c 100644 --- a/src/Nest/ElasticClient-ClusterState.cs +++ b/src/Nest/ElasticClient-ClusterState.cs @@ -11,7 +11,7 @@ public partial class ElasticClient public IClusterStateResponse ClusterState(Func clusterStateSelector = null) { clusterStateSelector = clusterStateSelector ?? (s => s); - return this.Dispatch( + return this.Dispatcher.Dispatch( clusterStateSelector, (p, d) => this.RawDispatch.ClusterStateDispatch(p) ); @@ -20,7 +20,7 @@ public IClusterStateResponse ClusterState(Func public IClusterStateResponse ClusterState(IClusterStateRequest clusterStateRequest) { - return this.Dispatch( + return this.Dispatcher.Dispatch( clusterStateRequest, (p, d) => this.RawDispatch.ClusterStateDispatch(p) ); @@ -30,7 +30,7 @@ public IClusterStateResponse ClusterState(IClusterStateRequest clusterStateReque public Task ClusterStateAsync(Func clusterStateSelector = null) { clusterStateSelector = clusterStateSelector ?? (s => s); - return this.DispatchAsync( + return this.Dispatcher.DispatchAsync( clusterStateSelector, (p, d) => this.RawDispatch.ClusterStateDispatchAsync(p) ); @@ -39,7 +39,7 @@ public Task ClusterStateAsync(Func public Task ClusterStateAsync(IClusterStateRequest clusterStateRequest) { - return this.DispatchAsync( + return this.Dispatcher.DispatchAsync( clusterStateRequest, (p, d) => this.RawDispatch.ClusterStateDispatchAsync(p) ); diff --git a/src/Nest/ElasticClient-ClusterStats.cs b/src/Nest/ElasticClient-ClusterStats.cs index a5cfa2df62f..a4ff0a5014d 100644 --- a/src/Nest/ElasticClient-ClusterStats.cs +++ b/src/Nest/ElasticClient-ClusterStats.cs @@ -13,7 +13,7 @@ public partial class ElasticClient public IClusterStatsResponse ClusterStats(Func clusterStatsSelector = null) { clusterStatsSelector = clusterStatsSelector ?? (s => s); - return this.Dispatch( + return this.Dispatcher.Dispatch( clusterStatsSelector, (p, d) => this.RawDispatch.ClusterStatsDispatch(p) ); @@ -23,7 +23,7 @@ public IClusterStatsResponse ClusterStats(Func ClusterStatsAsync(Func clusterStatsSelector = null) { clusterStatsSelector = clusterStatsSelector ?? (s => s); - return this.DispatchAsync( + return this.Dispatcher.DispatchAsync( clusterStatsSelector, (p, d) => this.RawDispatch.ClusterStatsDispatchAsync(p) ); @@ -32,7 +32,7 @@ public Task ClusterStatsAsync(Func public IClusterStatsResponse ClusterStats(IClusterStatsRequest clusterStatsRequest) { - return this.Dispatch( + return this.Dispatcher.Dispatch( clusterStatsRequest, (p, d) => this.RawDispatch.ClusterStatsDispatch(p) ); @@ -41,7 +41,7 @@ public IClusterStatsResponse ClusterStats(IClusterStatsRequest clusterStatsReque /// public Task ClusterStatsAsync(IClusterStatsRequest clusterStatsRequest) { - return this.DispatchAsync( + return this.Dispatcher.DispatchAsync( clusterStatsRequest, (p, d) => this.RawDispatch.ClusterStatsDispatchAsync(p) ); diff --git a/src/Nest/ElasticClient-Count.cs b/src/Nest/ElasticClient-Count.cs index e0f8d83e5d0..10748d33678 100644 --- a/src/Nest/ElasticClient-Count.cs +++ b/src/Nest/ElasticClient-Count.cs @@ -12,7 +12,7 @@ public ICountResponse Count(Func, CountDescriptor> coun where T : class { countSelector = countSelector ?? (s => s); - return this.Dispatch, CountRequestParameters, CountResponse>( + return this.Dispatcher.Dispatch, CountRequestParameters, CountResponse>( countSelector, (p, d) => this.RawDispatch.CountDispatch(p, d) ); @@ -22,7 +22,7 @@ public ICountResponse Count(Func, CountDescriptor> coun public ICountResponse Count(ICountRequest countRequest) where T : class { - return this.Dispatch( + return this.Dispatcher.Dispatch( countRequest, (p, d) => this.RawDispatch.CountDispatch(p, d) ); @@ -33,7 +33,7 @@ public Task CountAsync(Func, CountDescript where T : class { countSelector = countSelector ?? (s => s); - return this.DispatchAsync, CountRequestParameters, CountResponse, ICountResponse>( + return this.Dispatcher.DispatchAsync, CountRequestParameters, CountResponse, ICountResponse>( countSelector, (p, d) => this.RawDispatch.CountDispatchAsync(p, d) ); @@ -43,7 +43,7 @@ public Task CountAsync(Func, CountDescript public Task CountAsync(ICountRequest countRequest) where T : class { - return this.DispatchAsync( + return this.Dispatcher.DispatchAsync( countRequest, (p, d) => this.RawDispatch.CountDispatchAsync(p, d) ); diff --git a/src/Nest/ElasticClient-CreateIndex.cs b/src/Nest/ElasticClient-CreateIndex.cs index 533da9de805..da3defb8cf7 100644 --- a/src/Nest/ElasticClient-CreateIndex.cs +++ b/src/Nest/ElasticClient-CreateIndex.cs @@ -11,7 +11,7 @@ public partial class ElasticClient public IIndicesOperationResponse CreateIndex(Func createIndexSelector) { var descriptor = createIndexSelector(new CreateIndexDescriptor(this._connectionSettings)); - return this.Dispatch( + return this.Dispatcher.Dispatch( descriptor, (p, d) => this.RawDispatch.IndicesCreateDispatch(p, d.IndexSettings) ); @@ -20,7 +20,7 @@ public IIndicesOperationResponse CreateIndex(Func public IIndicesOperationResponse CreateIndex(ICreateIndexRequest createIndexRequest) { - return this.Dispatch( + return this.Dispatcher.Dispatch( createIndexRequest, (p, d) => this.RawDispatch.IndicesCreateDispatch(p, d.IndexSettings) ); @@ -30,7 +30,7 @@ public IIndicesOperationResponse CreateIndex(ICreateIndexRequest createIndexRequ public Task CreateIndexAsync(Func createIndexSelector) { var descriptor = createIndexSelector(new CreateIndexDescriptor(this._connectionSettings)); - return this.DispatchAsync( + return this.Dispatcher.DispatchAsync( descriptor, (p, d) => this.RawDispatch.IndicesCreateDispatchAsync(p, d.IndexSettings) ); @@ -39,7 +39,7 @@ public Task CreateIndexAsync(Func public Task CreateIndexAsync(ICreateIndexRequest createIndexRequest) { - return this.DispatchAsync( + return this.Dispatcher.DispatchAsync( createIndexRequest, (p, d) => this.RawDispatch.IndicesCreateDispatchAsync(p, d.IndexSettings) ); diff --git a/src/Nest/ElasticClient-Delete.cs b/src/Nest/ElasticClient-Delete.cs index 63c0e6dbf18..b0727fc81cf 100644 --- a/src/Nest/ElasticClient-Delete.cs +++ b/src/Nest/ElasticClient-Delete.cs @@ -11,7 +11,7 @@ public partial class ElasticClient public IDeleteResponse Delete(Func, DeleteDescriptor> deleteSelector) where T : class { - return this.Dispatch, DeleteRequestParameters, DeleteResponse>( + return this.Dispatcher.Dispatch, DeleteRequestParameters, DeleteResponse>( deleteSelector, (p, d) => this.RawDispatch.DeleteDispatch(p) ); @@ -20,7 +20,7 @@ public IDeleteResponse Delete(Func, DeleteDescriptor> /// public IDeleteResponse Delete(IDeleteRequest deleteRequest) { - return this.Dispatch( + return this.Dispatcher.Dispatch( deleteRequest, (p, d) => this.RawDispatch.DeleteDispatch(p) ); @@ -30,7 +30,7 @@ public IDeleteResponse Delete(IDeleteRequest deleteRequest) public Task DeleteAsync(Func, DeleteDescriptor> deleteSelector) where T : class { - return this.DispatchAsync, DeleteRequestParameters, DeleteResponse, IDeleteResponse>( + return this.Dispatcher.DispatchAsync, DeleteRequestParameters, DeleteResponse, IDeleteResponse>( deleteSelector, (p, d) => this.RawDispatch.DeleteDispatchAsync(p) ); @@ -39,7 +39,7 @@ public Task DeleteAsync(Func, DeleteDesc /// public Task DeleteAsync(IDeleteRequest deleteRequest) { - return this.DispatchAsync( + return this.Dispatcher.DispatchAsync( deleteRequest, (p, d) => this.RawDispatch.DeleteDispatchAsync(p) ); diff --git a/src/Nest/ElasticClient-DeleteByQuery.cs b/src/Nest/ElasticClient-DeleteByQuery.cs index 5f5fdcc8f93..61edee1b723 100644 --- a/src/Nest/ElasticClient-DeleteByQuery.cs +++ b/src/Nest/ElasticClient-DeleteByQuery.cs @@ -10,7 +10,7 @@ public partial class ElasticClient /// public IDeleteResponse DeleteByQuery(Func, DeleteByQueryDescriptor> deleteByQuerySelector) where T : class { - return this.Dispatch, DeleteByQueryRequestParameters, DeleteResponse>( + return this.Dispatcher.Dispatch, DeleteByQueryRequestParameters, DeleteResponse>( deleteByQuerySelector, (p, d) => this.RawDispatch.DeleteByQueryDispatch(p, d) ); @@ -19,7 +19,7 @@ public IDeleteResponse DeleteByQuery(Func, DeleteB /// public IDeleteResponse DeleteByQuery(IDeleteByQueryRequest deleteByQueryRequest) { - return this.Dispatch( + return this.Dispatcher.Dispatch( deleteByQueryRequest, (p, d) => this.RawDispatch.DeleteByQueryDispatch(p, d) ); @@ -28,7 +28,7 @@ public IDeleteResponse DeleteByQuery(IDeleteByQueryRequest deleteByQueryRequest) /// public Task DeleteByQueryAsync(Func, DeleteByQueryDescriptor> deleteByQuerySelector) where T : class { - return this.DispatchAsync, DeleteByQueryRequestParameters, DeleteResponse, IDeleteResponse>( + return this.Dispatcher.DispatchAsync, DeleteByQueryRequestParameters, DeleteResponse, IDeleteResponse>( deleteByQuerySelector, (p, d) => this.RawDispatch.DeleteByQueryDispatchAsync(p, d) ); @@ -37,7 +37,7 @@ public Task DeleteByQueryAsync(Func public Task DeleteByQueryAsync(IDeleteByQueryRequest deleteByQueryRequest) { - return this.DispatchAsync( + return this.Dispatcher.DispatchAsync( deleteByQueryRequest, (p, d) => this.RawDispatch.DeleteByQueryDispatchAsync(p, d) ); diff --git a/src/Nest/ElasticClient-DeleteIndex.cs b/src/Nest/ElasticClient-DeleteIndex.cs index 9d806a95bef..be2364242a9 100644 --- a/src/Nest/ElasticClient-DeleteIndex.cs +++ b/src/Nest/ElasticClient-DeleteIndex.cs @@ -11,7 +11,7 @@ public partial class ElasticClient /// public IIndicesResponse DeleteIndex(Func selector) { - return this.Dispatch( + return this.Dispatcher.Dispatch( selector, (p, d) => this.RawDispatch.IndicesDeleteDispatch(p) ); @@ -20,7 +20,7 @@ public IIndicesResponse DeleteIndex(Func public IIndicesResponse DeleteIndex(IDeleteIndexRequest deleteIndexRequest) { - return this.Dispatch( + return this.Dispatcher.Dispatch( deleteIndexRequest, (p, d) => this.RawDispatch.IndicesDeleteDispatch(p) ); @@ -29,7 +29,7 @@ public IIndicesResponse DeleteIndex(IDeleteIndexRequest deleteIndexRequest) /// public Task DeleteIndexAsync(Func selector) { - return this.DispatchAsync( + return this.Dispatcher.DispatchAsync( selector, (p, d) => this.RawDispatch.IndicesDeleteDispatchAsync(p) ); @@ -38,7 +38,7 @@ public Task DeleteIndexAsync(Func public Task DeleteIndexAsync(IDeleteIndexRequest deleteIndexRequest) { - return this.DispatchAsync( + return this.Dispatcher.DispatchAsync( deleteIndexRequest, (p, d) => this.RawDispatch.IndicesDeleteDispatchAsync(p) ); diff --git a/src/Nest/ElasticClient-Exists.cs b/src/Nest/ElasticClient-Exists.cs index 7c8bac63f66..be9f2d4049a 100644 --- a/src/Nest/ElasticClient-Exists.cs +++ b/src/Nest/ElasticClient-Exists.cs @@ -14,7 +14,7 @@ public partial class ElasticClient public IExistsResponse DocumentExists(Func, DocumentExistsDescriptor> existsSelector) where T : class { - return this.Dispatch, DocumentExistsRequestParameters, ExistsResponse>( + return this.Dispatcher.Dispatch, DocumentExistsRequestParameters, ExistsResponse>( d => existsSelector(d.RequestConfiguration(r=>r.AllowedStatusCodes(404))), (p, d) => this.RawDispatch.ExistsDispatch(p .DeserializationState(new ExistConverter(this.DeserializeExistsResponse)) @@ -25,7 +25,7 @@ public IExistsResponse DocumentExists(Func, Docum /// public IExistsResponse DocumentExists(IDocumentExistsRequest documentExistsRequest) { - return this.Dispatch( + return this.Dispatcher.Dispatch( documentExistsRequest, (p, d) => this.RawDispatch.ExistsDispatch(p .DeserializationState(new ExistConverter(this.DeserializeExistsResponse)) @@ -37,7 +37,7 @@ public IExistsResponse DocumentExists(IDocumentExistsRequest documentExistsReque public Task DocumentExistsAsync(Func, DocumentExistsDescriptor> existsSelector) where T : class { - return this.DispatchAsync, DocumentExistsRequestParameters, ExistsResponse, IExistsResponse>( + return this.Dispatcher.DispatchAsync, DocumentExistsRequestParameters, ExistsResponse, IExistsResponse>( d => existsSelector(d.RequestConfiguration(r=>r.AllowedStatusCodes(404))), (p, d) => this.RawDispatch.ExistsDispatchAsync(p .DeserializationState(new ExistConverter(this.DeserializeExistsResponse)) @@ -48,7 +48,7 @@ public Task DocumentExistsAsync(Func public Task DocumentExistsAsync(IDocumentExistsRequest documentExistsRequest) { - return this.DispatchAsync( + return this.Dispatcher.DispatchAsync( documentExistsRequest, (p, d) => this.RawDispatch.ExistsDispatchAsync(p .DeserializationState(new ExistConverter(this.DeserializeExistsResponse)) diff --git a/src/Nest/ElasticClient-Explain.cs b/src/Nest/ElasticClient-Explain.cs index 9cde8bc3596..5905cc2cc5c 100644 --- a/src/Nest/ElasticClient-Explain.cs +++ b/src/Nest/ElasticClient-Explain.cs @@ -11,7 +11,7 @@ public partial class ElasticClient public IExplainResponse Explain(Func, ExplainDescriptor> querySelector) where T : class { - return this.Dispatch, ExplainRequestParameters, ExplainResponse>( + return this.Dispatcher.Dispatch, ExplainRequestParameters, ExplainResponse>( querySelector, (p, d) => this.RawDispatch.ExplainDispatch>(p, d) ); @@ -21,7 +21,7 @@ public IExplainResponse Explain(Func, ExplainDescript public IExplainResponse Explain(IExplainRequest explainRequest) where T : class { - return this.Dispatch>( + return this.Dispatcher.Dispatch>( explainRequest, (p, d) => this.RawDispatch.ExplainDispatch>(p, d) ); @@ -31,7 +31,7 @@ public IExplainResponse Explain(IExplainRequest explainRequest) public Task> ExplainAsync(Func, ExplainDescriptor> querySelector) where T : class { - return this.DispatchAsync, ExplainRequestParameters, ExplainResponse, IExplainResponse>( + return this.Dispatcher.DispatchAsync, ExplainRequestParameters, ExplainResponse, IExplainResponse>( querySelector, (p, d) => this.RawDispatch.ExplainDispatchAsync>(p, d) ); @@ -41,7 +41,7 @@ public Task> ExplainAsync(Func, Expl public Task> ExplainAsync(IExplainRequest explainRequest) where T : class { - return this.DispatchAsync, IExplainResponse>( + return this.Dispatcher.DispatchAsync, IExplainResponse>( explainRequest, (p, d) => this.RawDispatch.ExplainDispatchAsync>(p, d) ); diff --git a/src/Nest/ElasticClient-Flush.cs b/src/Nest/ElasticClient-Flush.cs index 71726a5f508..f8dbfdb1c90 100644 --- a/src/Nest/ElasticClient-Flush.cs +++ b/src/Nest/ElasticClient-Flush.cs @@ -10,7 +10,7 @@ public partial class ElasticClient /// public IShardsOperationResponse Flush(Func selector) { - return this.Dispatch( + return this.Dispatcher.Dispatch( selector, (p, d) => this.RawDispatch.IndicesFlushDispatch(p) ); @@ -19,7 +19,7 @@ public IShardsOperationResponse Flush(Func sel /// public IShardsOperationResponse Flush(IFlushRequest flushRequest) { - return this.Dispatch( + return this.Dispatcher.Dispatch( flushRequest, (p, d) => this.RawDispatch.IndicesFlushDispatch(p) ); @@ -28,7 +28,7 @@ public IShardsOperationResponse Flush(IFlushRequest flushRequest) /// public Task FlushAsync(Func selector) { - return this.DispatchAsync( + return this.Dispatcher.DispatchAsync( selector, (p, d) => this.RawDispatch.IndicesFlushDispatchAsync(p) ); @@ -37,7 +37,7 @@ public Task FlushAsync(Func public Task FlushAsync(IFlushRequest flushRequest) { - return this.DispatchAsync( + return this.Dispatcher.DispatchAsync( flushRequest, (p, d) => this.RawDispatch.IndicesFlushDispatchAsync(p) ); diff --git a/src/Nest/ElasticClient-Get.cs b/src/Nest/ElasticClient-Get.cs index ea09ae93430..d170d5e4885 100644 --- a/src/Nest/ElasticClient-Get.cs +++ b/src/Nest/ElasticClient-Get.cs @@ -11,7 +11,7 @@ public partial class ElasticClient /// public IGetResponse Get(Func, GetDescriptor> getSelector) where T : class { - return this.Dispatch, GetRequestParameters, GetResponse>( + return this.Dispatcher.Dispatch, GetRequestParameters, GetResponse>( getSelector, (p, d) => this.RawDispatch.GetDispatch>(p) ); @@ -20,7 +20,7 @@ public IGetResponse Get(Func, GetDescriptor> getSelect /// public IGetResponse Get(IGetRequest getRequest) where T : class { - return this.Dispatch>( + return this.Dispatcher.Dispatch>( getRequest, (p, d) => this.RawDispatch.GetDispatch>(p) ); @@ -29,7 +29,7 @@ public IGetResponse Get(IGetRequest getRequest) where T : class /// public Task> GetAsync(Func, GetDescriptor> getSelector) where T : class { - return this.DispatchAsync, GetRequestParameters, GetResponse, IGetResponse>( + return this.Dispatcher.DispatchAsync, GetRequestParameters, GetResponse, IGetResponse>( getSelector, (p, d) => this.RawDispatch.GetDispatchAsync>(p) ); @@ -38,7 +38,7 @@ public Task> GetAsync(Func, GetDescriptor /// public Task> GetAsync(IGetRequest getRequest) where T : class { - return this.DispatchAsync, IGetResponse>( + return this.Dispatcher.DispatchAsync, IGetResponse>( getRequest, (p, d) => this.RawDispatch.GetDispatchAsync>(p) ); diff --git a/src/Nest/ElasticClient-GetIndex.cs b/src/Nest/ElasticClient-GetIndex.cs index 9fa4741bc4a..fb2be647be4 100644 --- a/src/Nest/ElasticClient-GetIndex.cs +++ b/src/Nest/ElasticClient-GetIndex.cs @@ -14,7 +14,7 @@ public partial class ElasticClient /// public IGetIndexResponse GetIndex(Func getIndexSelector) { - return this.Dispatch( + return this.Dispatcher.Dispatch( getIndexSelector, (p, d) => this.RawDispatch.IndicesGetDispatch( p.DeserializationState(new GetIndexResponseConverter(this.DeserializeGetIndexResponse)) @@ -25,7 +25,7 @@ public IGetIndexResponse GetIndex(Func g /// public IGetIndexResponse GetIndex(IGetIndexRequest createIndexRequest) { - return this.Dispatch( + return this.Dispatcher.Dispatch( createIndexRequest, (p, d) => this.RawDispatch.IndicesGetDispatch( p.DeserializationState(new GetIndexResponseConverter(this.DeserializeGetIndexResponse)) @@ -36,7 +36,7 @@ public IGetIndexResponse GetIndex(IGetIndexRequest createIndexRequest) /// public Task GetIndexAsync(Func getIndexSelector) { - return this.DispatchAsync( + return this.Dispatcher.DispatchAsync( getIndexSelector, (p, d) => this.RawDispatch.IndicesGetDispatchAsync( p.DeserializationState(new GetIndexResponseConverter(this.DeserializeGetIndexResponse)) @@ -47,7 +47,7 @@ public Task GetIndexAsync(Func public Task GetIndexAsync(IGetIndexRequest createIndexRequest) { - return this.DispatchAsync( + return this.Dispatcher.DispatchAsync( createIndexRequest, (p, d) => this.RawDispatch.IndicesGetDispatchAsync( p.DeserializationState(new GetIndexResponseConverter(this.DeserializeGetIndexResponse)) diff --git a/src/Nest/ElasticClient-Index.cs b/src/Nest/ElasticClient-Index.cs index 7ea409af173..a183434ab59 100644 --- a/src/Nest/ElasticClient-Index.cs +++ b/src/Nest/ElasticClient-Index.cs @@ -14,7 +14,7 @@ public IIndexResponse Index(T @object, Func, IndexDescript @object.ThrowIfNull("object"); indexSelector = indexSelector ?? (s => s); var descriptor = indexSelector(new IndexDescriptor().IdFrom(@object)); - return this.Dispatch, IndexRequestParameters, IndexResponse>( + return this.Dispatcher.Dispatch, IndexRequestParameters, IndexResponse>( descriptor, (p, d) => this.RawDispatch.IndexDispatch(p, @object)); } @@ -23,7 +23,7 @@ public IIndexResponse Index(T @object, Func, IndexDescript public IIndexResponse Index(IIndexRequest indexRequest) where T : class { - return this.Dispatch, IndexRequestParameters, IndexResponse>( + return this.Dispatcher.Dispatch, IndexRequestParameters, IndexResponse>( indexRequest, (p, d) => this.RawDispatch.IndexDispatch(p, indexRequest.Document)); } @@ -35,7 +35,7 @@ public Task IndexAsync(T @object, Func, In @object.ThrowIfNull("object"); indexSelector = indexSelector ?? (s => s); var descriptor = indexSelector(new IndexDescriptor().IdFrom(@object)); - return this.DispatchAsync, IndexRequestParameters, IndexResponse, IIndexResponse>( + return this.Dispatcher.DispatchAsync, IndexRequestParameters, IndexResponse, IIndexResponse>( descriptor, (p, d) => this.RawDispatch.IndexDispatchAsync(p, @object)); } @@ -44,7 +44,7 @@ public Task IndexAsync(T @object, Func, In public Task IndexAsync(IIndexRequest indexRequest) where T : class { - return this.DispatchAsync, IndexRequestParameters, IndexResponse, IIndexResponse>( + return this.Dispatcher.DispatchAsync, IndexRequestParameters, IndexResponse, IIndexResponse>( indexRequest, (p, d) => this.RawDispatch.IndexDispatchAsync(p, indexRequest.Document)); } diff --git a/src/Nest/ElasticClient-IndexExists.cs b/src/Nest/ElasticClient-IndexExists.cs index 361768c3616..872d648eb29 100644 --- a/src/Nest/ElasticClient-IndexExists.cs +++ b/src/Nest/ElasticClient-IndexExists.cs @@ -13,7 +13,7 @@ public partial class ElasticClient /// public IExistsResponse IndexExists(Func selector) { - return this.Dispatch( + return this.Dispatcher.Dispatch( selector, (p, d) => this.RawDispatch.IndicesExistsDispatch( p.DeserializationState(new IndexExistConverter(DeserializeExistsResponse)) @@ -24,7 +24,7 @@ public IExistsResponse IndexExists(Func public IExistsResponse IndexExists(IIndexExistsRequest indexRequest) { - return this.Dispatch( + return this.Dispatcher.Dispatch( indexRequest, (p, d) => this.RawDispatch.IndicesExistsDispatch( p.DeserializationState(new IndexExistConverter(DeserializeExistsResponse)) @@ -35,7 +35,7 @@ public IExistsResponse IndexExists(IIndexExistsRequest indexRequest) /// public Task IndexExistsAsync(Func selector) { - return this.DispatchAsync( + return this.Dispatcher.DispatchAsync( selector, (p, d) => this.RawDispatch.IndicesExistsDispatchAsync( p.DeserializationState(new IndexExistConverter(DeserializeExistsResponse)) @@ -46,7 +46,7 @@ public Task IndexExistsAsync(Func public Task IndexExistsAsync(IIndexExistsRequest indexRequest) { - return this.DispatchAsync( + return this.Dispatcher.DispatchAsync( indexRequest, (p, d) => this.RawDispatch.IndicesExistsDispatchAsync( p.DeserializationState(new IndexExistConverter(DeserializeExistsResponse)) diff --git a/src/Nest/ElasticClient-IndexSettings.cs b/src/Nest/ElasticClient-IndexSettings.cs index 2b6e31ce56a..c418e1a8eeb 100644 --- a/src/Nest/ElasticClient-IndexSettings.cs +++ b/src/Nest/ElasticClient-IndexSettings.cs @@ -10,7 +10,7 @@ public partial class ElasticClient /// public IIndexSettingsResponse GetIndexSettings(Func selector) { - return this.Dispatch( + return this.Dispatcher.Dispatch( selector, (p, d) => this.RawDispatch.IndicesGetSettingsDispatch(p) ); @@ -19,7 +19,7 @@ public IIndexSettingsResponse GetIndexSettings(Func public IIndexSettingsResponse GetIndexSettings(IGetIndexSettingsRequest getIndexSettingsRequest) { - return this.Dispatch( + return this.Dispatcher.Dispatch( getIndexSettingsRequest, (p, d) => this.RawDispatch.IndicesGetSettingsDispatch(p) ); @@ -28,7 +28,7 @@ public IIndexSettingsResponse GetIndexSettings(IGetIndexSettingsRequest getIndex /// public Task GetIndexSettingsAsync(Func selector) { - return this.DispatchAsync + return this.Dispatcher.DispatchAsync ( selector, (p, d) => this.RawDispatch.IndicesGetSettingsDispatchAsync(p) @@ -38,7 +38,7 @@ public Task GetIndexSettingsAsync(Func public Task GetIndexSettingsAsync(IGetIndexSettingsRequest getIndexSettingsRequest) { - return this.DispatchAsync( + return this.Dispatcher.DispatchAsync( getIndexSettingsRequest, (p, d) => this.RawDispatch.IndicesGetSettingsDispatchAsync(p) ); diff --git a/src/Nest/ElasticClient-IndicesStats.cs b/src/Nest/ElasticClient-IndicesStats.cs index a5285641395..73c60fac6b9 100644 --- a/src/Nest/ElasticClient-IndicesStats.cs +++ b/src/Nest/ElasticClient-IndicesStats.cs @@ -12,7 +12,7 @@ public partial class ElasticClient public IGlobalStatsResponse IndicesStats(Func selector = null) { selector = selector ?? (s => s); - return this.Dispatch( + return this.Dispatcher.Dispatch( selector, (p, d) => this.RawDispatch.IndicesStatsDispatch(p) ); @@ -21,7 +21,7 @@ public IGlobalStatsResponse IndicesStats(Func public IGlobalStatsResponse IndicesStats(IIndicesStatsRequest statsRequest) { - return this.Dispatch( + return this.Dispatcher.Dispatch( statsRequest, (p, d) => this.RawDispatch.IndicesStatsDispatch(p) ); @@ -31,7 +31,7 @@ public IGlobalStatsResponse IndicesStats(IIndicesStatsRequest statsRequest) public Task IndicesStatsAsync(Func selector = null) { selector = selector ?? (s => s); - return this.DispatchAsync( + return this.Dispatcher.DispatchAsync( selector, (p, d) => this.RawDispatch.IndicesStatsDispatchAsync(p) ); @@ -40,7 +40,7 @@ public Task IndicesStatsAsync(Func public Task IndicesStatsAsync(IIndicesStatsRequest statsRequest) { - return this.DispatchAsync( + return this.Dispatcher.DispatchAsync( statsRequest, (p, d) => this.RawDispatch.IndicesStatsDispatchAsync(p) ); diff --git a/src/Nest/ElasticClient-MappingDelete.cs b/src/Nest/ElasticClient-MappingDelete.cs index 2efd1408223..cbba188bb6e 100644 --- a/src/Nest/ElasticClient-MappingDelete.cs +++ b/src/Nest/ElasticClient-MappingDelete.cs @@ -13,7 +13,7 @@ public IIndicesResponse DeleteMapping(Func, Delete where T : class { selector = selector ?? (s => s); - return this.Dispatch, DeleteMappingRequestParameters, IndicesResponse>( + return this.Dispatcher.Dispatch, DeleteMappingRequestParameters, IndicesResponse>( selector, (p, d) => this.RawDispatch.IndicesDeleteMappingDispatch(p) ); @@ -22,7 +22,7 @@ public IIndicesResponse DeleteMapping(Func, Delete /// public IIndicesResponse DeleteMapping(IDeleteMappingRequest deleteMappingRequest) { - return this.Dispatch( + return this.Dispatcher.Dispatch( deleteMappingRequest, (p, d) => this.RawDispatch.IndicesDeleteMappingDispatch(p) ); @@ -33,7 +33,7 @@ public Task DeleteMappingAsync(Func s); - return this.DispatchAsync, DeleteMappingRequestParameters, IndicesResponse, IIndicesResponse>( + return this.Dispatcher.DispatchAsync, DeleteMappingRequestParameters, IndicesResponse, IIndicesResponse>( selector, (p, d) => this.RawDispatch.IndicesDeleteMappingDispatchAsync(p) ); @@ -42,7 +42,7 @@ public Task DeleteMappingAsync(Func public Task DeleteMappingAsync(IDeleteMappingRequest deleteMappingRequest) { - return this.DispatchAsync( + return this.Dispatcher.DispatchAsync( deleteMappingRequest, (p, d) => this.RawDispatch.IndicesDeleteMappingDispatchAsync(p) ); diff --git a/src/Nest/ElasticClient-MappingGet.cs b/src/Nest/ElasticClient-MappingGet.cs index f92529ec74c..ff9c8273124 100644 --- a/src/Nest/ElasticClient-MappingGet.cs +++ b/src/Nest/ElasticClient-MappingGet.cs @@ -16,7 +16,7 @@ public IGetMappingResponse GetMapping(Func, GetMappin where T : class { selector = selector ?? (s => s); - return this.Dispatch, GetMappingRequestParameters, GetMappingResponse>( + return this.Dispatcher.Dispatch, GetMappingRequestParameters, GetMappingResponse>( selector, (p, d) => this.RawDispatch.IndicesGetMappingDispatch( p.DeserializationState(new GetMappingConverter((r, s) => DeserializeGetMappingResponse(r, d, s))) @@ -27,7 +27,7 @@ public IGetMappingResponse GetMapping(Func, GetMappin /// public IGetMappingResponse GetMapping(IGetMappingRequest getMappingRequest) { - return this.Dispatch( + return this.Dispatcher.Dispatch( getMappingRequest, (p, d) => this.RawDispatch.IndicesGetMappingDispatch( p.DeserializationState(new GetMappingConverter((r, s) => DeserializeGetMappingResponse(r, d, s))) @@ -40,7 +40,7 @@ public Task GetMappingAsync(Func where T : class { selector = selector ?? (s => s); - return this.DispatchAsync, GetMappingRequestParameters, GetMappingResponse, IGetMappingResponse>( + return this.Dispatcher.DispatchAsync, GetMappingRequestParameters, GetMappingResponse, IGetMappingResponse>( selector, (p, d) => this.RawDispatch.IndicesGetMappingDispatchAsync( p.DeserializationState(new GetMappingConverter((r, s) => DeserializeGetMappingResponse(r, d, s))) @@ -51,7 +51,7 @@ public Task GetMappingAsync(Func /// public Task GetMappingAsync(IGetMappingRequest getMappingRequest) { - return this.DispatchAsync( + return this.Dispatcher.DispatchAsync( getMappingRequest, (p, d) => this.RawDispatch.IndicesGetMappingDispatchAsync( p.DeserializationState(new GetMappingConverter((r, s) => DeserializeGetMappingResponse(r, d, s))) diff --git a/src/Nest/ElasticClient-MappingGetField.cs b/src/Nest/ElasticClient-MappingGetField.cs index a4a82c50b3f..7e1038efeb1 100644 --- a/src/Nest/ElasticClient-MappingGetField.cs +++ b/src/Nest/ElasticClient-MappingGetField.cs @@ -16,7 +16,7 @@ public IGetFieldMappingResponse GetFieldMapping(Func s); - return this.Dispatch, GetFieldMappingRequestParameters, GetFieldMappingResponse>( + return this.Dispatcher.Dispatch, GetFieldMappingRequestParameters, GetFieldMappingResponse>( selector, (p, d) => this.RawDispatch.IndicesGetFieldMappingDispatch( p.DeserializationState(new GetFieldMappingConverter((r, s) => DeserializeGetFieldMappingResponse(r, d, s))) @@ -27,7 +27,7 @@ public IGetFieldMappingResponse GetFieldMapping(Func public IGetFieldMappingResponse GetFieldMapping(IGetFieldMappingRequest getFieldMappingRequest) { - return this.Dispatch( + return this.Dispatcher.Dispatch( getFieldMappingRequest, (p, d) => this.RawDispatch.IndicesGetFieldMappingDispatch( p.DeserializationState(new GetFieldMappingConverter((r, s) => DeserializeGetFieldMappingResponse(r, d, s))) @@ -40,7 +40,7 @@ public Task GetFieldMappingAsync(Func s); - return this.DispatchAsync, GetFieldMappingRequestParameters, GetFieldMappingResponse, IGetFieldMappingResponse>( + return this.Dispatcher.DispatchAsync, GetFieldMappingRequestParameters, GetFieldMappingResponse, IGetFieldMappingResponse>( selector, (p, d) => this.RawDispatch.IndicesGetFieldMappingDispatchAsync( p.DeserializationState(new GetFieldMappingConverter((r, s) => DeserializeGetFieldMappingResponse(r, d, s))) @@ -51,7 +51,7 @@ public Task GetFieldMappingAsync(Func public Task GetFieldMappingAsync(IGetFieldMappingRequest getFieldMappingRequest) { - return this.DispatchAsync( + return this.Dispatcher.DispatchAsync( getFieldMappingRequest, (p, d) => this.RawDispatch.IndicesGetFieldMappingDispatchAsync( p.DeserializationState(new GetFieldMappingConverter((r, s) => DeserializeGetFieldMappingResponse(r, d, s))) diff --git a/src/Nest/ElasticClient-MappingType.cs b/src/Nest/ElasticClient-MappingType.cs index 6412f2ae90c..8cba31af79d 100644 --- a/src/Nest/ElasticClient-MappingType.cs +++ b/src/Nest/ElasticClient-MappingType.cs @@ -20,7 +20,7 @@ public IIndicesResponse Map(Func, PutMappingDescripto /// public IIndicesResponse Map(IPutMappingRequest putMappingRequest) { - return this.Dispatch( + return this.Dispatcher.Dispatch( putMappingRequest, (p, d) => { @@ -45,7 +45,7 @@ public Task MapAsync(Func, PutMappi /// public Task MapAsync(IPutMappingRequest putMappingRequest) { - return this.DispatchAsync( + return this.Dispatcher.DispatchAsync( putMappingRequest, (p, d) => { diff --git a/src/Nest/ElasticClient-MoreLikeThis.cs b/src/Nest/ElasticClient-MoreLikeThis.cs index 27d544690c2..ccfc2750ae9 100644 --- a/src/Nest/ElasticClient-MoreLikeThis.cs +++ b/src/Nest/ElasticClient-MoreLikeThis.cs @@ -11,7 +11,7 @@ public partial class ElasticClient public ISearchResponse MoreLikeThis(Func, MoreLikeThisDescriptor> mltSelector) where T : class { - return this.Dispatch, MoreLikeThisRequestParameters, SearchResponse>( + return this.Dispatcher.Dispatch, MoreLikeThisRequestParameters, SearchResponse>( mltSelector, (p, d) => { @@ -26,7 +26,7 @@ public ISearchResponse MoreLikeThis(Func, MoreLi public ISearchResponse MoreLikeThis(IMoreLikeThisRequest moreLikeThisRequest) where T : class { - return this.Dispatch>( + return this.Dispatcher.Dispatch>( moreLikeThisRequest, (p, d) => { @@ -40,7 +40,7 @@ public ISearchResponse MoreLikeThis(IMoreLikeThisRequest moreLikeThisReque public Task> MoreLikeThisAsync(Func, MoreLikeThisDescriptor> mltSelector) where T : class { - return this.DispatchAsync, MoreLikeThisRequestParameters, SearchResponse, ISearchResponse>( + return this.Dispatcher.DispatchAsync, MoreLikeThisRequestParameters, SearchResponse, ISearchResponse>( mltSelector, (p, d) => { @@ -55,7 +55,7 @@ public Task> MoreLikeThisAsync(Func> MoreLikeThisAsync(IMoreLikeThisRequest moreLikeThisRequest) where T : class { - return this.DispatchAsync, ISearchResponse>( + return this.Dispatcher.DispatchAsync, ISearchResponse>( moreLikeThisRequest, (p, d) => { diff --git a/src/Nest/ElasticClient-MultiGet.cs b/src/Nest/ElasticClient-MultiGet.cs index 8a9b810ff32..73f5ccaad55 100644 --- a/src/Nest/ElasticClient-MultiGet.cs +++ b/src/Nest/ElasticClient-MultiGet.cs @@ -20,7 +20,7 @@ public IMultiGetResponse MultiGet(Func m var descriptor = multiGetSelector(new MultiGetDescriptor()); var converter = CreateCovariantMultiGetConverter(descriptor); var customCreator = new MultiGetConverter((r, s) => this.DeserializeMultiGetResponse(r, s, converter)); - return this.Dispatch( + return this.Dispatcher.Dispatch( descriptor, (p, d) => this.RawDispatch.MgetDispatch(p.DeserializationState(customCreator), d) ); @@ -31,7 +31,7 @@ public IMultiGetResponse MultiGet(IMultiGetRequest multiRequest) { var converter = CreateCovariantMultiGetConverter(multiRequest); var customCreator = new MultiGetConverter((r, s) => this.DeserializeMultiGetResponse(r, s, converter)); - return this.Dispatch( + return this.Dispatcher.Dispatch( multiRequest, (p, d) => this.RawDispatch.MgetDispatch(p.DeserializationState(customCreator), d) ); @@ -44,7 +44,7 @@ public Task MultiGetAsync(Func this.DeserializeMultiGetResponse(r, s, converter)); - return this.DispatchAsync( + return this.Dispatcher.DispatchAsync( descriptor, (p, d) => this.RawDispatch.MgetDispatchAsync(p.DeserializationState(customCreator), d) ); @@ -55,7 +55,7 @@ public Task MultiGetAsync(IMultiGetRequest multiGetRequest) { var converter = CreateCovariantMultiGetConverter(multiGetRequest); var customCreator = new MultiGetConverter((r, s) => this.DeserializeMultiGetResponse(r, s, converter)); - return this.DispatchAsync( + return this.Dispatcher.DispatchAsync( multiGetRequest, (p, d) => this.RawDispatch.MgetDispatchAsync(p.DeserializationState(customCreator), d) ); diff --git a/src/Nest/ElasticClient-MultiPercolate.cs b/src/Nest/ElasticClient-MultiPercolate.cs index 0053be617a6..86ed179021b 100644 --- a/src/Nest/ElasticClient-MultiPercolate.cs +++ b/src/Nest/ElasticClient-MultiPercolate.cs @@ -16,7 +16,7 @@ public IMultiPercolateResponse MultiPercolate(Func( + return this.Dispatcher.Dispatch( descriptor, (p, d) => { @@ -29,7 +29,7 @@ public IMultiPercolateResponse MultiPercolate(Func public IMultiPercolateResponse MultiPercolate(IMultiPercolateRequest multiRequest) { - return this.Dispatch( + return this.Dispatcher.Dispatch( multiRequest, (p, d) => { @@ -44,7 +44,7 @@ public Task MultiPercolateAsync(Func( + return this.Dispatcher.DispatchAsync( descriptor, (p, d) => { @@ -57,7 +57,7 @@ public Task MultiPercolateAsync(Func public Task MultiPercolateAsync(IMultiPercolateRequest multiPercolateRequest) { - return this.DispatchAsync( + return this.Dispatcher.DispatchAsync( multiPercolateRequest, (p, d) => { diff --git a/src/Nest/ElasticClient-MultiSearch.cs b/src/Nest/ElasticClient-MultiSearch.cs index e74319b1624..971b7b4ea22 100644 --- a/src/Nest/ElasticClient-MultiSearch.cs +++ b/src/Nest/ElasticClient-MultiSearch.cs @@ -16,7 +16,7 @@ public partial class ElasticClient /// public IMultiSearchResponse MultiSearch(Func multiSearchSelector) { - return this.Dispatch( + return this.Dispatcher.Dispatch( multiSearchSelector(new MultiSearchDescriptor()), (p, d) => { @@ -31,7 +31,7 @@ public IMultiSearchResponse MultiSearch(Func public IMultiSearchResponse MultiSearch(IMultiSearchRequest multiSearchRequest) { - return this.Dispatch( + return this.Dispatcher.Dispatch( multiSearchRequest, (p, d) => { @@ -45,7 +45,7 @@ public IMultiSearchResponse MultiSearch(IMultiSearchRequest multiSearchRequest) /// public Task MultiSearchAsync(Func multiSearchSelector) { - return this.DispatchAsync( + return this.Dispatcher.DispatchAsync( multiSearchSelector(new MultiSearchDescriptor()), (p, d) => { @@ -60,7 +60,7 @@ public Task MultiSearchAsync(Func public Task MultiSearchAsync(IMultiSearchRequest multiSearchRequest) { - return this.DispatchAsync( + return this.Dispatcher.DispatchAsync( multiSearchRequest, (p, d) => { diff --git a/src/Nest/ElasticClient-MultiTermVectors.cs b/src/Nest/ElasticClient-MultiTermVectors.cs index 6909d282213..622f87cf29b 100644 --- a/src/Nest/ElasticClient-MultiTermVectors.cs +++ b/src/Nest/ElasticClient-MultiTermVectors.cs @@ -13,7 +13,7 @@ public partial class ElasticClient public IMultiTermVectorResponse MultiTermVectors(Func, MultiTermVectorsDescriptor> multiTermVectorsSelector) where T : class { - return this.Dispatch, MultiTermVectorsRequestParameters, MultiTermVectorResponse>( + return this.Dispatcher.Dispatch, MultiTermVectorsRequestParameters, MultiTermVectorResponse>( multiTermVectorsSelector, (p, d) => this.RawDispatch.MtermvectorsDispatch(p, d) ); @@ -22,7 +22,7 @@ public IMultiTermVectorResponse MultiTermVectors(Func public IMultiTermVectorResponse MultiTermVectors(IMultiTermVectorsRequest multiTermVectorsRequest) { - return this.Dispatch( + return this.Dispatcher.Dispatch( multiTermVectorsRequest, (p, d) => this.RawDispatch.MtermvectorsDispatch(p, d) ); @@ -32,7 +32,7 @@ public IMultiTermVectorResponse MultiTermVectors(IMultiTermVectorsRequest multiT public Task MultiTermVectorsAsync(Func, MultiTermVectorsDescriptor> multiTermVectorsSelector) where T : class { - return this.DispatchAsync, MultiTermVectorsRequestParameters, MultiTermVectorResponse, IMultiTermVectorResponse>( + return this.Dispatcher.DispatchAsync, MultiTermVectorsRequestParameters, MultiTermVectorResponse, IMultiTermVectorResponse>( multiTermVectorsSelector, (p, d) => this.RawDispatch.MtermvectorsDispatchAsync(p, d) ); @@ -41,7 +41,7 @@ public Task MultiTermVectorsAsync(Func public Task MultiTermVectorsAsync(IMultiTermVectorsRequest multiTermVectorsRequest) { - return this.DispatchAsync( + return this.Dispatcher.DispatchAsync( multiTermVectorsRequest, (p, d) => this.RawDispatch.MtermvectorsDispatchAsync(p, d) ); diff --git a/src/Nest/ElasticClient-Nodes.cs b/src/Nest/ElasticClient-Nodes.cs index b30fe2ce7e2..d99828e7e41 100644 --- a/src/Nest/ElasticClient-Nodes.cs +++ b/src/Nest/ElasticClient-Nodes.cs @@ -17,7 +17,7 @@ public partial class ElasticClient public INodeInfoResponse NodesInfo(Func selector = null) { selector = selector ?? (s => s); - return this.Dispatch( + return this.Dispatcher.Dispatch( selector, (p, d) => this.RawDispatch.NodesInfoDispatch(p) ); @@ -26,7 +26,7 @@ public INodeInfoResponse NodesInfo(Func public INodeInfoResponse NodesInfo(INodesInfoRequest nodesInfoRequest) { - return this.Dispatch( + return this.Dispatcher.Dispatch( nodesInfoRequest, (p, d) => this.RawDispatch.NodesInfoDispatch(p) ); @@ -36,7 +36,7 @@ public INodeInfoResponse NodesInfo(INodesInfoRequest nodesInfoRequest) public Task NodesInfoAsync(Func selector = null) { selector = selector ?? (s => s); - return this.DispatchAsync( + return this.Dispatcher.DispatchAsync( selector, (p, d) => this.RawDispatch.NodesInfoDispatchAsync(p) ); @@ -45,7 +45,7 @@ public Task NodesInfoAsync(Func public Task NodesInfoAsync(INodesInfoRequest nodesInfoRequest) { - return this.DispatchAsync( + return this.Dispatcher.DispatchAsync( nodesInfoRequest, (p, d) => this.RawDispatch.NodesInfoDispatchAsync(p) ); @@ -58,7 +58,7 @@ public Task NodesInfoAsync(INodesInfoRequest nodesInfoRequest public INodeStatsResponse NodesStats(Func selector = null) { selector = selector ?? (s => s); - return this.Dispatch( + return this.Dispatcher.Dispatch( selector, (p, d) => this.RawDispatch.NodesStatsDispatch(p) ); @@ -67,7 +67,7 @@ public INodeStatsResponse NodesStats(Func public INodeStatsResponse NodesStats(INodesStatsRequest nodesStatsRequest) { - return this.Dispatch( + return this.Dispatcher.Dispatch( nodesStatsRequest, (p, d) => this.RawDispatch.NodesStatsDispatch(p) ); @@ -77,7 +77,7 @@ public INodeStatsResponse NodesStats(INodesStatsRequest nodesStatsRequest) public Task NodesStatsAsync(Func selector = null) { selector = selector ?? (s => s); - return this.DispatchAsync( + return this.Dispatcher.DispatchAsync( selector, (p, d) => this.RawDispatch.NodesStatsDispatchAsync(p) ); @@ -86,7 +86,7 @@ public Task NodesStatsAsync(Func public Task NodesStatsAsync(INodesStatsRequest nodesStatsRequest) { - return this.DispatchAsync( + return this.Dispatcher.DispatchAsync( nodesStatsRequest, (p, d) => this.RawDispatch.NodesStatsDispatchAsync(p) ); @@ -96,7 +96,7 @@ public Task NodesStatsAsync(INodesStatsRequest nodesStatsReq public INodesHotThreadsResponse NodesHotThreads(Func selector = null) { selector = selector ?? (s => s); - return this.Dispatch( + return this.Dispatcher.Dispatch( selector, (p, d) => this.RawDispatch.NodesHotThreadsDispatch( p.DeserializationState(new NodesHotThreadConverter(DeserializeNodesHotThreadResponse))) @@ -106,7 +106,7 @@ public INodesHotThreadsResponse NodesHotThreads(Func public INodesHotThreadsResponse NodesHotThreads(INodesHotThreadsRequest nodesHotThreadsRequest) { - return this.Dispatch( + return this.Dispatcher.Dispatch( nodesHotThreadsRequest, (p, d) => this.RawDispatch.NodesHotThreadsDispatch( p.DeserializationState(new NodesHotThreadConverter(DeserializeNodesHotThreadResponse))) @@ -117,7 +117,7 @@ public INodesHotThreadsResponse NodesHotThreads(INodesHotThreadsRequest nodesHot public Task NodesHotThreadsAsync(Func selector = null) { selector = selector ?? (s => s); - return this.DispatchAsync( + return this.Dispatcher.DispatchAsync( selector, (p, d) => this.RawDispatch.NodesHotThreadsDispatchAsync( p.DeserializationState(new NodesHotThreadConverter(DeserializeNodesHotThreadResponse))) @@ -127,7 +127,7 @@ public Task NodesHotThreadsAsync(Func public Task NodesHotThreadsAsync(INodesHotThreadsRequest nodesHotThreadsRequest) { - return this.DispatchAsync( + return this.Dispatcher.DispatchAsync( nodesHotThreadsRequest, (p, d) => this.RawDispatch.NodesHotThreadsDispatchAsync( p.DeserializationState(new NodesHotThreadConverter(DeserializeNodesHotThreadResponse))) @@ -138,7 +138,7 @@ public Task NodesHotThreadsAsync(INodesHotThreadsReque public INodesShutdownResponse NodesShutdown(Func nodesShutdownSelector = null) { nodesShutdownSelector = nodesShutdownSelector ?? (s => s); - return this.Dispatch( + return this.Dispatcher.Dispatch( nodesShutdownSelector, (p, d) => this.RawDispatch.NodesShutdownDispatch(p) ); @@ -148,7 +148,7 @@ public INodesShutdownResponse NodesShutdown(Func NodesShutdownAsync(Func nodesShutdownSelector = null) { nodesShutdownSelector = nodesShutdownSelector ?? (s => s); - return this.DispatchAsync( + return this.Dispatcher.DispatchAsync( nodesShutdownSelector, (p, d) => this.RawDispatch.NodesShutdownDispatchAsync(p) ); @@ -157,7 +157,7 @@ public Task NodesShutdownAsync(Func public INodesShutdownResponse NodesShutdown(INodesShutdownRequest nodesShutdownRequest) { - return this.Dispatch( + return this.Dispatcher.Dispatch( nodesShutdownRequest, (p, d) => this.RawDispatch.NodesShutdownDispatch(p) ); @@ -166,7 +166,7 @@ public INodesShutdownResponse NodesShutdown(INodesShutdownRequest nodesShutdownR /// public Task NodesShutdownAsync(INodesShutdownRequest nodesShutdownRequest) { - return this.DispatchAsync( + return this.Dispatcher.DispatchAsync( nodesShutdownRequest, (p, d) => this.RawDispatch.NodesShutdownDispatchAsync(p) ); diff --git a/src/Nest/ElasticClient-OpenClose.cs b/src/Nest/ElasticClient-OpenClose.cs index 002b987c650..cc703350aa5 100644 --- a/src/Nest/ElasticClient-OpenClose.cs +++ b/src/Nest/ElasticClient-OpenClose.cs @@ -9,7 +9,7 @@ public partial class ElasticClient /// public IIndicesOperationResponse OpenIndex(Func openIndexSelector) { - return this.Dispatch( + return this.Dispatcher.Dispatch( openIndexSelector, (p, d) => this.RawDispatch.IndicesOpenDispatch(p) ); @@ -18,7 +18,7 @@ public IIndicesOperationResponse OpenIndex(Func public IIndicesOperationResponse OpenIndex(IOpenIndexRequest openIndexRequest) { - return this.Dispatch( + return this.Dispatcher.Dispatch( openIndexRequest, (p, d) => this.RawDispatch.IndicesOpenDispatch(p) ); @@ -27,7 +27,7 @@ public IIndicesOperationResponse OpenIndex(IOpenIndexRequest openIndexRequest) /// public Task OpenIndexAsync(Func openIndexSelector) { - return this.DispatchAsync( + return this.Dispatcher.DispatchAsync( openIndexSelector, (p, d) => this.RawDispatch.IndicesOpenDispatchAsync(p) ); @@ -36,7 +36,7 @@ public Task OpenIndexAsync(Func public Task OpenIndexAsync(IOpenIndexRequest openIndexRequest) { - return this.DispatchAsync( + return this.Dispatcher.DispatchAsync( openIndexRequest, (p, d) => this.RawDispatch.IndicesOpenDispatchAsync(p) ); @@ -48,7 +48,7 @@ public Task OpenIndexAsync(IOpenIndexRequest openInde /// public IIndicesOperationResponse CloseIndex(Func closeIndexSelector) { - return this.Dispatch( + return this.Dispatcher.Dispatch( closeIndexSelector, (p, d) => this.RawDispatch.IndicesCloseDispatch(p) ); @@ -57,7 +57,7 @@ public IIndicesOperationResponse CloseIndex(Func public IIndicesOperationResponse CloseIndex(ICloseIndexRequest closeIndexRequest) { - return this.Dispatch( + return this.Dispatcher.Dispatch( closeIndexRequest, (p, d) => this.RawDispatch.IndicesCloseDispatch(p) ); @@ -66,7 +66,7 @@ public IIndicesOperationResponse CloseIndex(ICloseIndexRequest closeIndexRequest /// public Task CloseIndexAsync(Func closeIndexSelector) { - return this.DispatchAsync + return this.Dispatcher.DispatchAsync ( closeIndexSelector, (p, d) => this.RawDispatch.IndicesCloseDispatchAsync(p) @@ -76,7 +76,7 @@ public Task CloseIndexAsync(Func public Task CloseIndexAsync(ICloseIndexRequest closeIndexRequest) { - return this.DispatchAsync( + return this.Dispatcher.DispatchAsync( closeIndexRequest, (p, d) => this.RawDispatch.IndicesCloseDispatchAsync(p) ); diff --git a/src/Nest/ElasticClient-Optimize.cs b/src/Nest/ElasticClient-Optimize.cs index 794736c7df9..13014ee5199 100644 --- a/src/Nest/ElasticClient-Optimize.cs +++ b/src/Nest/ElasticClient-Optimize.cs @@ -11,7 +11,7 @@ public partial class ElasticClient public IShardsOperationResponse Optimize(Func optimizeSelector = null) { optimizeSelector = optimizeSelector ?? (s => s); - return this.Dispatch( + return this.Dispatcher.Dispatch( optimizeSelector, (p, d) => this.RawDispatch.IndicesOptimizeDispatch(p) ); @@ -20,7 +20,7 @@ public IShardsOperationResponse Optimize(Func public IShardsOperationResponse Optimize(IOptimizeRequest optimizeRequest) { - return this.Dispatch( + return this.Dispatcher.Dispatch( optimizeRequest, (p, d) => this.RawDispatch.IndicesOptimizeDispatch(p) ); @@ -30,7 +30,7 @@ public IShardsOperationResponse Optimize(IOptimizeRequest optimizeRequest) public Task OptimizeAsync(Func optimizeSelector = null) { optimizeSelector = optimizeSelector ?? (s => s); - return this.DispatchAsync( + return this.Dispatcher.DispatchAsync( optimizeSelector, (p, d) => this.RawDispatch.IndicesOptimizeDispatchAsync(p) ); @@ -39,7 +39,7 @@ public Task OptimizeAsync(Func public Task OptimizeAsync(IOptimizeRequest optimizeRequest) { - return this.DispatchAsync( + return this.Dispatcher.DispatchAsync( optimizeRequest, (p, d) => this.RawDispatch.IndicesOptimizeDispatchAsync(p) ); diff --git a/src/Nest/ElasticClient-Percolate.cs b/src/Nest/ElasticClient-Percolate.cs index a56b73c5646..1c6cd438363 100644 --- a/src/Nest/ElasticClient-Percolate.cs +++ b/src/Nest/ElasticClient-Percolate.cs @@ -13,7 +13,7 @@ public IUnregisterPercolateResponse UnregisterPercolator(string name, Func s); - return this.Dispatch, DeleteRequestParameters, UnregisterPercolateResponse>( + return this.Dispatcher.Dispatch, DeleteRequestParameters, UnregisterPercolateResponse>( s => selector(s.Name(name)), (p, d) => this.RawDispatch.DeleteDispatch(p) ); @@ -22,7 +22,7 @@ public IUnregisterPercolateResponse UnregisterPercolator(string name, Func public IUnregisterPercolateResponse UnregisterPercolator(IUnregisterPercolatorRequest unregisterPercolatorRequest) { - return this.Dispatch( + return this.Dispatcher.Dispatch( unregisterPercolatorRequest, (p, d) => this.RawDispatch.DeleteDispatch(p) ); @@ -33,7 +33,7 @@ public Task UnregisterPercolatorAsync(string na where T : class { selector = selector ?? (s => s); - return this.DispatchAsync, DeleteRequestParameters, UnregisterPercolateResponse, IUnregisterPercolateResponse>( + return this.Dispatcher.DispatchAsync, DeleteRequestParameters, UnregisterPercolateResponse, IUnregisterPercolateResponse>( s => selector(s.Name(name)), (p, d) => this.RawDispatch.DeleteDispatchAsync(p) ); @@ -42,7 +42,7 @@ public Task UnregisterPercolatorAsync(string na /// public Task UnregisterPercolatorAsync(IUnregisterPercolatorRequest unregisterPercolatorRequest) { - return this.DispatchAsync( + return this.Dispatcher.DispatchAsync( unregisterPercolatorRequest, (p, d) => this.RawDispatch.DeleteDispatchAsync(p) ); @@ -55,7 +55,7 @@ public IRegisterPercolateResponse RegisterPercolator(string name, Func, IndexRequestParameters, RegisterPercolateResponse>( + return this.Dispatcher.Dispatch, IndexRequestParameters, RegisterPercolateResponse>( s => percolatorSelector(s.Name(name)), (p, d) => this.RawDispatch.IndexDispatch(p, d) ); @@ -64,7 +64,7 @@ public IRegisterPercolateResponse RegisterPercolator(string name, Func public IRegisterPercolateResponse RegisterPercolator(IRegisterPercolatorRequest registerPercolatorRequest) { - return this.Dispatch( + return this.Dispatcher.Dispatch( registerPercolatorRequest, (p, d) => this.RawDispatch.IndexDispatch(p, d) ); @@ -75,7 +75,7 @@ public Task RegisterPercolatorAsync(string name, where T : class { percolatorSelector.ThrowIfNull("percolatorSelector"); - return this.DispatchAsync + return this.Dispatcher.DispatchAsync , IndexRequestParameters, RegisterPercolateResponse, IRegisterPercolateResponse>( s => percolatorSelector(s.Name(name)), (p, d) => this.RawDispatch.IndexDispatchAsync(p, d) @@ -85,7 +85,7 @@ public Task RegisterPercolatorAsync(string name, /// public Task RegisterPercolatorAsync(IRegisterPercolatorRequest registerPercolatorRequest) { - return this.DispatchAsync( + return this.Dispatcher.DispatchAsync( registerPercolatorRequest, (p, d) => this.RawDispatch.IndexDispatchAsync(p, d) ); @@ -97,7 +97,7 @@ public IPercolateResponse Percolate(Func, PercolateDes where T : class { percolateSelector = percolateSelector ?? (s => s); - return this.Dispatch, PercolateRequestParameters, PercolateResponse>( + return this.Dispatcher.Dispatch, PercolateRequestParameters, PercolateResponse>( percolateSelector, (p, d) => this.RawDispatch.PercolateDispatch(p, d) ); @@ -107,7 +107,7 @@ public IPercolateResponse Percolate(Func, PercolateDes public IPercolateResponse Percolate(IPercolateRequest percolateRequest) where T : class { - return this.Dispatch, PercolateRequestParameters, PercolateResponse>( + return this.Dispatcher.Dispatch, PercolateRequestParameters, PercolateResponse>( percolateRequest, (p, d) => this.RawDispatch.PercolateDispatch(p, d) ); @@ -118,7 +118,7 @@ public Task PercolateAsync(Func, P where T : class { percolateSelector = percolateSelector ?? (s => s); - return this.DispatchAsync, PercolateRequestParameters, PercolateResponse, IPercolateResponse>( + return this.Dispatcher.DispatchAsync, PercolateRequestParameters, PercolateResponse, IPercolateResponse>( percolateSelector, (p, d) => this.RawDispatch.PercolateDispatchAsync(p, d) ); @@ -128,7 +128,7 @@ public Task PercolateAsync(Func, P public Task PercolateAsync(IPercolateRequest percolateRequest) where T : class { - return this.DispatchAsync, PercolateRequestParameters, PercolateResponse, IPercolateResponse>( + return this.Dispatcher.DispatchAsync, PercolateRequestParameters, PercolateResponse, IPercolateResponse>( percolateRequest, (p, d) => this.RawDispatch.PercolateDispatchAsync(p, d) ); @@ -140,7 +140,7 @@ public Task PercolateAsync(IPercolateRequest percolate public IPercolateCountResponse PercolateCount(Func, PercolateCountDescriptor> percolateSelector) where T : class { - return this.Dispatch, PercolateCountRequestParameters, PercolateCountResponse>( + return this.Dispatcher.Dispatch, PercolateCountRequestParameters, PercolateCountResponse>( percolateSelector, (p, d) => this.RawDispatch.CountPercolateDispatch(p, d) ); @@ -151,7 +151,7 @@ public IPercolateCountResponse PercolateCount(T @object, Func s); - return this.Dispatch, PercolateCountRequestParameters, PercolateCountResponse>( + return this.Dispatcher.Dispatch, PercolateCountRequestParameters, PercolateCountResponse>( s => percolateSelector(s.Object(@object)), (p, d) => this.RawDispatch.CountPercolateDispatch(p, d) ); @@ -161,7 +161,7 @@ public IPercolateCountResponse PercolateCount(T @object, Func(IPercolateCountRequest percolateCountRequest) where T : class { - return this.Dispatch, PercolateCountRequestParameters, PercolateCountResponse>( + return this.Dispatcher.Dispatch, PercolateCountRequestParameters, PercolateCountResponse>( percolateCountRequest, (p, d) => this.RawDispatch.CountPercolateDispatch(p, d) ); @@ -171,7 +171,7 @@ public IPercolateCountResponse PercolateCount(IPercolateCountRequest perco public Task PercolateCountAsync(Func, PercolateCountDescriptor> percolateSelector) where T : class { - return this.DispatchAsync, PercolateCountRequestParameters, PercolateCountResponse, IPercolateCountResponse>( + return this.Dispatcher.DispatchAsync, PercolateCountRequestParameters, PercolateCountResponse, IPercolateCountResponse>( percolateSelector, (p, d) => this.RawDispatch.CountPercolateDispatchAsync(p, d) ); @@ -182,7 +182,7 @@ public Task PercolateCountAsync(T @object, Func s); - return this.DispatchAsync, PercolateCountRequestParameters, PercolateCountResponse, IPercolateCountResponse>( + return this.Dispatcher.DispatchAsync, PercolateCountRequestParameters, PercolateCountResponse, IPercolateCountResponse>( s => percolateSelector(s.Object(@object)), (p, d) => this.RawDispatch.CountPercolateDispatchAsync(p, d) ); @@ -192,7 +192,7 @@ public Task PercolateCountAsync(T @object, Func PercolateCountAsync(IPercolateCountRequest percolateCountRequest) where T : class { - return this.DispatchAsync, PercolateCountRequestParameters, PercolateCountResponse, IPercolateCountResponse>( + return this.Dispatcher.DispatchAsync, PercolateCountRequestParameters, PercolateCountResponse, IPercolateCountResponse>( percolateCountRequest, (p, d) => this.RawDispatch.CountPercolateDispatchAsync(p, d) ); diff --git a/src/Nest/ElasticClient-Ping.cs b/src/Nest/ElasticClient-Ping.cs index a882651d6ca..c25908d643c 100644 --- a/src/Nest/ElasticClient-Ping.cs +++ b/src/Nest/ElasticClient-Ping.cs @@ -16,7 +16,7 @@ public partial class ElasticClient public IPingResponse Ping(Func pingSelector = null) { pingSelector = pingSelector ?? (s => s); - return this.Dispatch( + return this.Dispatcher.Dispatch( pingSelector, (p, d) => { @@ -33,7 +33,7 @@ public IPingResponse Ping(Func pingSelector = nu public Task PingAsync(Func pingSelector = null) { pingSelector = pingSelector ?? (s => s); - return this.DispatchAsync( + return this.Dispatcher.DispatchAsync( pingSelector, (p, d) => { @@ -48,7 +48,7 @@ public Task PingAsync(Func pingSe /// public IPingResponse Ping(IPingRequest pingRequest) { - return this.Dispatch( + return this.Dispatcher.Dispatch( pingRequest, (p, d) => { @@ -63,7 +63,7 @@ public IPingResponse Ping(IPingRequest pingRequest) /// public Task PingAsync(IPingRequest pingRequest) { - return this.DispatchAsync( + return this.Dispatcher.DispatchAsync( pingRequest, (p, d) => { diff --git a/src/Nest/ElasticClient-RecoveryStatus.cs b/src/Nest/ElasticClient-RecoveryStatus.cs index 08e7b666561..99d96e5e1f8 100644 --- a/src/Nest/ElasticClient-RecoveryStatus.cs +++ b/src/Nest/ElasticClient-RecoveryStatus.cs @@ -15,7 +15,7 @@ public partial class ElasticClient public IRecoveryStatusResponse RecoveryStatus(Func selector = null) { selector = selector ?? (s => s); - return this.Dispatch( + return this.Dispatcher.Dispatch( selector, (p, d) => this.RawDispatch.IndicesRecoveryDispatch( p.DeserializationState(new RecoveryStatusConverter(DeserializeRecoveryStatusResponse)) @@ -26,7 +26,7 @@ public IRecoveryStatusResponse RecoveryStatus(Func public IRecoveryStatusResponse RecoveryStatus(IRecoveryStatusRequest statusRequest) { - return this.Dispatch( + return this.Dispatcher.Dispatch( statusRequest, (p, d) => this.RawDispatch.IndicesRecoveryDispatch( p.DeserializationState(new RecoveryStatusConverter(DeserializeRecoveryStatusResponse)) @@ -38,7 +38,7 @@ public IRecoveryStatusResponse RecoveryStatus(IRecoveryStatusRequest statusReque public Task RecoveryStatusAsync(Func selector = null) { selector = selector ?? (s => s); - return this.DispatchAsync( + return this.Dispatcher.DispatchAsync( selector, (p, d) => this.RawDispatch.IndicesRecoveryDispatchAsync( p.DeserializationState(new RecoveryStatusConverter(DeserializeRecoveryStatusResponse)) @@ -49,7 +49,7 @@ public Task RecoveryStatusAsync(Func public Task RecoveryStatusAsync(IRecoveryStatusRequest statusRequest) { - return this.DispatchAsync( + return this.Dispatcher.DispatchAsync( statusRequest, (p, d) => this.RawDispatch.IndicesRecoveryDispatchAsync( p.DeserializationState(new RecoveryStatusConverter(DeserializeRecoveryStatusResponse)) diff --git a/src/Nest/ElasticClient-Refresh.cs b/src/Nest/ElasticClient-Refresh.cs index 1d23353950d..99b20595c43 100644 --- a/src/Nest/ElasticClient-Refresh.cs +++ b/src/Nest/ElasticClient-Refresh.cs @@ -11,7 +11,7 @@ public partial class ElasticClient public IShardsOperationResponse Refresh(Func refreshSelector = null) { refreshSelector = refreshSelector ?? (s => s); - return this.Dispatch( + return this.Dispatcher.Dispatch( refreshSelector, (p, d) => this.RawDispatch.IndicesRefreshDispatch(p) ); @@ -20,7 +20,7 @@ public IShardsOperationResponse Refresh(Func public IShardsOperationResponse Refresh(IRefreshRequest refreshRequest) { - return this.Dispatch( + return this.Dispatcher.Dispatch( refreshRequest, (p, d) => this.RawDispatch.IndicesRefreshDispatch(p) ); @@ -30,7 +30,7 @@ public IShardsOperationResponse Refresh(IRefreshRequest refreshRequest) public Task RefreshAsync(Func refreshSelector = null) { refreshSelector = refreshSelector ?? (s => s); - return this.DispatchAsync( + return this.Dispatcher.DispatchAsync( refreshSelector, (p, d) => this.RawDispatch.IndicesRefreshDispatchAsync(p) ); @@ -39,7 +39,7 @@ public Task RefreshAsync(Func public Task RefreshAsync(IRefreshRequest refreshRequest) { - return this.DispatchAsync( + return this.Dispatcher.DispatchAsync( refreshRequest, (p, d) => this.RawDispatch.IndicesRefreshDispatchAsync(p) ); diff --git a/src/Nest/ElasticClient-Repository.cs b/src/Nest/ElasticClient-Repository.cs index a4e9a2ec949..e8f7c6ca825 100644 --- a/src/Nest/ElasticClient-Repository.cs +++ b/src/Nest/ElasticClient-Repository.cs @@ -13,7 +13,7 @@ public partial class ElasticClient public IAcknowledgedResponse CreateRepository(string name, Func selector) { name.ThrowIfNullOrEmpty("name"); - return this.Dispatch( + return this.Dispatcher.Dispatch( s => selector(s.Repository(name)), (p, d) => this.RawDispatch.SnapshotCreateRepositoryDispatch(p, ((ICreateRepositoryRequest)d).Repository) ); @@ -22,7 +22,7 @@ public IAcknowledgedResponse CreateRepository(string name, Func public IAcknowledgedResponse CreateRepository(ICreateRepositoryRequest request) { - return this.Dispatch( + return this.Dispatcher.Dispatch( request, (p, d) => this.RawDispatch.SnapshotCreateRepositoryDispatch(p, ((ICreateRepositoryRequest)d).Repository) ); @@ -32,7 +32,7 @@ public IAcknowledgedResponse CreateRepository(ICreateRepositoryRequest request) public Task CreateRepositoryAsync(string name, Func selector) { name.ThrowIfNullOrEmpty("name"); - return this.DispatchAsync( + return this.Dispatcher.DispatchAsync( s => selector(s.Repository(name)), (p, d) => this.RawDispatch.SnapshotCreateRepositoryDispatchAsync(p, ((ICreateRepositoryRequest)d).Repository) ); @@ -41,7 +41,7 @@ public Task CreateRepositoryAsync(string name, Func public Task CreateRepositoryAsync(ICreateRepositoryRequest request) { - return this.DispatchAsync( + return this.Dispatcher.DispatchAsync( request, (p, d) => this.RawDispatch.SnapshotCreateRepositoryDispatchAsync(p, ((ICreateRepositoryRequest)d).Repository) ); @@ -50,7 +50,7 @@ public Task CreateRepositoryAsync(ICreateRepositoryReques /// public IGetRepositoryResponse GetRepository(Func selector) { - return this.Dispatch( + return this.Dispatcher.Dispatch( selector, (p, d) => this.RawDispatch.SnapshotGetRepositoryDispatch(p) ); @@ -59,7 +59,7 @@ public IGetRepositoryResponse GetRepository(Func public IGetRepositoryResponse GetRepository(IGetRepositoryRequest request) { - return this.Dispatch( + return this.Dispatcher.Dispatch( request, (p, d) => this.RawDispatch.SnapshotGetRepositoryDispatch(p) ); @@ -68,7 +68,7 @@ public IGetRepositoryResponse GetRepository(IGetRepositoryRequest request) /// public Task GetRepositoryAsync(Func selector) { - return this.DispatchAsync( + return this.Dispatcher.DispatchAsync( selector, (p, d) => this.RawDispatch.SnapshotGetRepositoryDispatchAsync(p) ); @@ -77,7 +77,7 @@ public Task GetRepositoryAsync(Func public Task GetRepositoryAsync(IGetRepositoryRequest request) { - return this.DispatchAsync( + return this.Dispatcher.DispatchAsync( request, (p, d) => this.RawDispatch.SnapshotGetRepositoryDispatchAsync(p) ); @@ -88,7 +88,7 @@ public IAcknowledgedResponse DeleteRepository(string name, Func s); - return this.Dispatch( + return this.Dispatcher.Dispatch( s => selector(s.Repository(name)), (p, d) => this.RawDispatch.SnapshotDeleteRepositoryDispatch(p) ); @@ -97,7 +97,7 @@ public IAcknowledgedResponse DeleteRepository(string name, Func public IAcknowledgedResponse DeleteRepository(IDeleteRepositoryRequest deleteRepositoryRequest) { - return this.Dispatch( + return this.Dispatcher.Dispatch( deleteRepositoryRequest, (p, d) => this.RawDispatch.SnapshotDeleteRepositoryDispatch(p) ); @@ -108,7 +108,7 @@ public Task DeleteRepositoryAsync(string name, Func s); - return this.DispatchAsync( + return this.Dispatcher.DispatchAsync( s => selector(s.Repository(name)), (p, d) => this.RawDispatch.SnapshotDeleteRepositoryDispatchAsync(p) ); @@ -117,7 +117,7 @@ public Task DeleteRepositoryAsync(string name, Func public Task DeleteRepositoryAsync(IDeleteRepositoryRequest deleteRepositoryRequest) { - return this.DispatchAsync( + return this.Dispatcher.DispatchAsync( deleteRepositoryRequest, (p, d) => this.RawDispatch.SnapshotDeleteRepositoryDispatchAsync(p) ); @@ -128,7 +128,7 @@ public IVerifyRepositoryResponse VerifyRepository(string name, Func s); - return this.Dispatch( + return this.Dispatcher.Dispatch( s => selector(s.Repository(name)), (p, d) => this.RawDispatch.SnapshotVerifyRepositoryDispatch(p) ); @@ -137,7 +137,7 @@ public IVerifyRepositoryResponse VerifyRepository(string name, Func public IVerifyRepositoryResponse VerifyRepository(IVerifyRepositoryRequest verifyRepositoryRequest) { - return this.Dispatch( + return this.Dispatcher.Dispatch( verifyRepositoryRequest, (p, d) => this.RawDispatch.SnapshotVerifyRepositoryDispatch(p) ); @@ -148,7 +148,7 @@ public Task VerifyRepositoryAsync(string name, Func s); - return this.DispatchAsync( + return this.Dispatcher.DispatchAsync( s => selector(s.Repository(name)), (p, d) => this.RawDispatch.SnapshotVerifyRepositoryDispatchAsync(p) ); @@ -157,7 +157,7 @@ public Task VerifyRepositoryAsync(string name, Func public Task VerifyRepositoryAsync(IVerifyRepositoryRequest verifyRepositoryRequest) { - return this.DispatchAsync( + return this.Dispatcher.DispatchAsync( verifyRepositoryRequest, (p, d) => this.RawDispatch.SnapshotVerifyRepositoryDispatchAsync(p) ); diff --git a/src/Nest/ElasticClient-Restore.cs b/src/Nest/ElasticClient-Restore.cs index aae1da00440..744f9699a3d 100644 --- a/src/Nest/ElasticClient-Restore.cs +++ b/src/Nest/ElasticClient-Restore.cs @@ -9,7 +9,7 @@ public partial class ElasticClient /// public IRestoreResponse Restore(IRestoreRequest restoreRequest) { - return this.Dispatch( + return this.Dispatcher.Dispatch( restoreRequest, (p, d) => this.RawDispatch.SnapshotRestoreDispatch(p, d) ); @@ -21,7 +21,7 @@ public IRestoreResponse Restore(string repository, string snapshotName, Func s); - return this.Dispatch( + return this.Dispatcher.Dispatch( s => selector(s.Snapshot(snapshotName).Repository(repository)), (p, d) => this.RawDispatch.SnapshotRestoreDispatch(p, d) ); @@ -30,7 +30,7 @@ public IRestoreResponse Restore(string repository, string snapshotName, Func public Task RestoreAsync(IRestoreRequest restoreRequest) { - return this.DispatchAsync( + return this.Dispatcher.DispatchAsync( restoreRequest, (p, d) => this.RawDispatch.SnapshotRestoreDispatchAsync(p, d) ); @@ -42,7 +42,7 @@ public Task RestoreAsync(string repository, string snapshotNam snapshotName.ThrowIfNullOrEmpty("name"); repository.ThrowIfNullOrEmpty("repository"); selector = selector ?? (s => s); - return this.DispatchAsync( + return this.Dispatcher.DispatchAsync( s => selector(s.Snapshot(snapshotName).Repository(repository)), (p, d) => this.RawDispatch.SnapshotRestoreDispatchAsync(p, d) ); diff --git a/src/Nest/ElasticClient-RootNodeInfo.cs b/src/Nest/ElasticClient-RootNodeInfo.cs index eac18fdbcee..fcdbd23fe59 100644 --- a/src/Nest/ElasticClient-RootNodeInfo.cs +++ b/src/Nest/ElasticClient-RootNodeInfo.cs @@ -11,7 +11,7 @@ public partial class ElasticClient public IRootInfoResponse RootNodeInfo(Func selector = null) { selector = selector ?? (i => i); - return this.Dispatch( + return this.Dispatcher.Dispatch( selector, (p, d) => this.RawDispatch.InfoDispatch(p) ); @@ -20,7 +20,7 @@ public IRootInfoResponse RootNodeInfo(Func selec /// public IRootInfoResponse RootNodeInfo(IInfoRequest infoRequest) { - return this.Dispatch( + return this.Dispatcher.Dispatch( infoRequest, (p, d) => this.RawDispatch.InfoDispatch(p) ); @@ -30,7 +30,7 @@ public IRootInfoResponse RootNodeInfo(IInfoRequest infoRequest) public Task RootNodeInfoAsync(Func selector = null) { selector = selector ?? (i => i); - return this.DispatchAsync( + return this.Dispatcher.DispatchAsync( selector, (p, d) => this.RawDispatch.InfoDispatchAsync(p) ); @@ -39,7 +39,7 @@ public Task RootNodeInfoAsync(Func public Task RootNodeInfoAsync(IInfoRequest inforRequest) { - return this.DispatchAsync( + return this.Dispatcher.DispatchAsync( inforRequest, (p, d) => this.RawDispatch.InfoDispatchAsync(p) ); diff --git a/src/Nest/ElasticClient-Scripts.cs b/src/Nest/ElasticClient-Scripts.cs index 953be87439b..e553754cefb 100644 --- a/src/Nest/ElasticClient-Scripts.cs +++ b/src/Nest/ElasticClient-Scripts.cs @@ -8,7 +8,7 @@ public partial class ElasticClient { public IPutScriptResponse PutScript(Func putScriptDescriptor) { - return this.Dispatch( + return this.Dispatcher.Dispatch( putScriptDescriptor, (p, d) => this.RawDispatch.PutScriptDispatch(p, d) ); @@ -16,7 +16,7 @@ public IPutScriptResponse PutScript(Func PutScriptAsync(Func putScriptDescriptor) { - return this.DispatchAsync( + return this.Dispatcher.DispatchAsync( putScriptDescriptor, (p, d) => this.RawDispatch.PutScriptDispatchAsync(p, d) ); @@ -24,7 +24,7 @@ public Task PutScriptAsync(Func getScriptDescriptor) { - return this.Dispatch( + return this.Dispatcher.Dispatch( getScriptDescriptor, (p, d) => this.RawDispatch.GetScriptDispatch(p) ); @@ -32,7 +32,7 @@ public IGetScriptResponse GetScript(Func GetScriptAsync(Func getScriptDescriptor) { - return this.DispatchAsync( + return this.Dispatcher.DispatchAsync( getScriptDescriptor, (p, d) => this.RawDispatch.GetScriptDispatchAsync(p) ); @@ -40,7 +40,7 @@ public Task GetScriptAsync(Func deleteScriptDescriptor) { - return this.Dispatch( + return this.Dispatcher.Dispatch( deleteScriptDescriptor, (p, d) => this.RawDispatch.DeleteScriptDispatch(p) ); @@ -48,7 +48,7 @@ public IDeleteScriptResponse DeleteScript(Func DeleteScriptAsync(Func deleteScriptDescriptor) { - return this.DispatchAsync( + return this.Dispatcher.DispatchAsync( deleteScriptDescriptor, (p, d) => this.RawDispatch.DeleteScriptDispatchAsync(p) ); diff --git a/src/Nest/ElasticClient-Scroll.cs b/src/Nest/ElasticClient-Scroll.cs index 878cbf9b829..731344f51a0 100644 --- a/src/Nest/ElasticClient-Scroll.cs +++ b/src/Nest/ElasticClient-Scroll.cs @@ -9,7 +9,7 @@ public partial class ElasticClient /// public ISearchResponse Scroll(IScrollRequest request) where T : class { - return this.Dispatch>( + return this.Dispatcher.Dispatch>( request, (p, d) => { @@ -22,7 +22,7 @@ public ISearchResponse Scroll(IScrollRequest request) where T : class /// public ISearchResponse Scroll(Func, ScrollDescriptor> scrollSelector) where T : class { - return this.Dispatch, ScrollRequestParameters, SearchResponse>( + return this.Dispatcher.Dispatch, ScrollRequestParameters, SearchResponse>( scrollSelector, (p, d) => { @@ -36,7 +36,7 @@ public ISearchResponse Scroll(Func, ScrollDescriptor public Task> ScrollAsync(IScrollRequest request) where T : class { - return this.DispatchAsync, ISearchResponse>( + return this.Dispatcher.DispatchAsync, ISearchResponse>( request, (p, d) => { @@ -50,7 +50,7 @@ public Task> ScrollAsync(IScrollRequest request) where T : /// public Task> ScrollAsync(Func, ScrollDescriptor> scrollSelector) where T : class { - return this.DispatchAsync, ScrollRequestParameters, SearchResponse, ISearchResponse>( + return this.Dispatcher.DispatchAsync, ScrollRequestParameters, SearchResponse, ISearchResponse>( scrollSelector, (p, d) => { @@ -66,7 +66,7 @@ public Task> ScrollAsync(Func, ScrollD /// public IEmptyResponse ClearScroll(Func clearScrollSelector) { - return this.Dispatch( + return this.Dispatcher.Dispatch( clearScrollSelector, (p, d) => { @@ -79,7 +79,7 @@ public IEmptyResponse ClearScroll(Func public IEmptyResponse ClearScroll(IClearScrollRequest clearScrollRequest) { - return this.Dispatch( + return this.Dispatcher.Dispatch( clearScrollRequest, (p, d) => { @@ -92,7 +92,7 @@ public IEmptyResponse ClearScroll(IClearScrollRequest clearScrollRequest) /// public Task ClearScrollAsync(Func clearScrollSelector) { - return this.DispatchAsync( + return this.Dispatcher.DispatchAsync( clearScrollSelector, (p, d) => { @@ -105,7 +105,7 @@ public Task ClearScrollAsync(Func public Task ClearScrollAsync(IClearScrollRequest clearScrollRequest) { - return this.DispatchAsync( + return this.Dispatcher.DispatchAsync( clearScrollRequest, (p, d) => { diff --git a/src/Nest/ElasticClient-SearchExists.cs b/src/Nest/ElasticClient-SearchExists.cs index d7be83ef57d..94a92973534 100644 --- a/src/Nest/ElasticClient-SearchExists.cs +++ b/src/Nest/ElasticClient-SearchExists.cs @@ -13,7 +13,7 @@ public partial class ElasticClient public IExistsResponse SearchExists(Func, SearchExistsDescriptor> selector) where T : class { - return this.Dispatch, SearchExistsRequestParameters, ExistsResponse>( + return this.Dispatcher.Dispatch, SearchExistsRequestParameters, ExistsResponse>( selector, (p, d) => this.RawDispatch.SearchExistsDispatch( p.DeserializationState(new SearchExistConverter(DeserializeExistsResponse)) @@ -25,7 +25,7 @@ public IExistsResponse SearchExists(Func, SearchExi /// public IExistsResponse SearchExists(ISearchExistsRequest indexRequest) { - return this.Dispatch( + return this.Dispatcher.Dispatch( indexRequest, (p, d) => this.RawDispatch.SearchExistsDispatch( p.DeserializationState(new SearchExistConverter(DeserializeExistsResponse)) @@ -38,7 +38,7 @@ public IExistsResponse SearchExists(ISearchExistsRequest indexRequest) public Task SearchExistsAsync(Func, SearchExistsDescriptor> selector) where T : class { - return this.DispatchAsync, SearchExistsRequestParameters, ExistsResponse, IExistsResponse>( + return this.Dispatcher.DispatchAsync, SearchExistsRequestParameters, ExistsResponse, IExistsResponse>( selector, (p, d) => this.RawDispatch.SearchExistsDispatchAsync( p.DeserializationState(new SearchExistConverter(DeserializeExistsResponse)) @@ -50,7 +50,7 @@ public Task SearchExistsAsync(Func /// public Task SearchExistsAsync(ISearchExistsRequest indexRequest) { - return this.DispatchAsync( + return this.Dispatcher.DispatchAsync( indexRequest, (p, d) => this.RawDispatch.SearchExistsDispatchAsync( p.DeserializationState(new SearchExistConverter(DeserializeExistsResponse)) diff --git a/src/Nest/ElasticClient-SearchShards.cs b/src/Nest/ElasticClient-SearchShards.cs index 62cb75c0d39..c6fac2b27bd 100644 --- a/src/Nest/ElasticClient-SearchShards.cs +++ b/src/Nest/ElasticClient-SearchShards.cs @@ -13,7 +13,7 @@ public partial class ElasticClient /// public ISearchShardsResponse SearchShards(Func, SearchShardsDescriptor> searchSelector) where T : class { - return this.Dispatch, SearchShardsRequestParameters, SearchShardsResponse>( + return this.Dispatcher.Dispatch, SearchShardsRequestParameters, SearchShardsResponse>( searchSelector, (p, d) => this.RawDispatch.SearchShardsDispatch(p) ); @@ -22,7 +22,7 @@ public ISearchShardsResponse SearchShards(Func, Sea /// public ISearchShardsResponse SearchShards(ISearchShardsRequest request) { - return this.Dispatch( + return this.Dispatcher.Dispatch( request, (p, d) => this.RawDispatch.SearchShardsDispatch(p) ); @@ -32,7 +32,7 @@ public ISearchShardsResponse SearchShards(ISearchShardsRequest request) public Task SearchShardsAsync(Func, SearchShardsDescriptor> searchSelector) where T : class { - return this.DispatchAsync, SearchShardsRequestParameters, SearchShardsResponse, ISearchShardsResponse>( + return this.Dispatcher.DispatchAsync, SearchShardsRequestParameters, SearchShardsResponse, ISearchShardsResponse>( searchSelector, (p, d) => this.RawDispatch.SearchShardsDispatchAsync(p) ); @@ -41,7 +41,7 @@ public Task SearchShardsAsync(Func public Task SearchShardsAsync(ISearchShardsRequest request) { - return this.DispatchAsync( + return this.Dispatcher.DispatchAsync( request, (p, d) => this.RawDispatch.SearchShardsDispatchAsync(p) ); diff --git a/src/Nest/ElasticClient-SearchTemplate.cs b/src/Nest/ElasticClient-SearchTemplate.cs index bd391020c43..c92601087c8 100644 --- a/src/Nest/ElasticClient-SearchTemplate.cs +++ b/src/Nest/ElasticClient-SearchTemplate.cs @@ -112,7 +112,7 @@ public Task> SearchTemplateAsync(ISearchTem public IGetSearchTemplateResponse GetSearchTemplate(string name, Func selector = null) { selector = selector ?? (s => s); - return this.Dispatch( + return this.Dispatcher.Dispatch( d => selector(d.Name(name)), (p, d) => this.RawDispatch.GetTemplateDispatch(p) ); @@ -120,7 +120,7 @@ public IGetSearchTemplateResponse GetSearchTemplate(string name, Func( + return this.Dispatcher.Dispatch( request, (p, d) => this.RawDispatch.GetTemplateDispatch(p) ); @@ -129,7 +129,7 @@ public IGetSearchTemplateResponse GetSearchTemplate(IGetSearchTemplateRequest re public Task GetSearchTemplateAsync(string name, Func selector = null) { selector = selector ?? (s => s); - return this.DispatchAsync( + return this.Dispatcher.DispatchAsync( d => selector(d.Name(name)), (p, d) => this.RawDispatch.GetTemplateDispatchAsync(p) ); @@ -137,7 +137,7 @@ public Task GetSearchTemplateAsync(string name, Func public Task GetSearchTemplateAsync(IGetSearchTemplateRequest request) { - return this.DispatchAsync( + return this.Dispatcher.DispatchAsync( request, (p, d) => this.RawDispatch.GetTemplateDispatchAsync(p) ); @@ -146,7 +146,7 @@ public Task GetSearchTemplateAsync(IGetSearchTemplat public IPutSearchTemplateResponse PutSearchTemplate(string name, Func selector = null) { selector = selector ?? (s => s); - return this.Dispatch( + return this.Dispatcher.Dispatch( d => selector(d.Name(name)), (p, d) => this.RawDispatch.PutTemplateDispatch(p, d) ); @@ -154,7 +154,7 @@ public IPutSearchTemplateResponse PutSearchTemplate(string name, Func( + return this.Dispatcher.Dispatch( request, (p, d) => this.RawDispatch.PutTemplateDispatch(p, d) ); @@ -163,7 +163,7 @@ public IPutSearchTemplateResponse PutSearchTemplate(IPutSearchTemplateRequest re public Task PutSearchTemplateAsync(string name, Func selector = null) { selector = selector ?? (s => s); - return this.DispatchAsync( + return this.Dispatcher.DispatchAsync( d => selector(d.Name(name)), (p, d) => this.RawDispatch.PutTemplateDispatchAsync(p, d) ); @@ -171,7 +171,7 @@ public Task PutSearchTemplateAsync(string name, Func public Task PutSearchTemplateAsync(IPutSearchTemplateRequest request) { - return this.DispatchAsync( + return this.Dispatcher.DispatchAsync( request, (p, d) => this.RawDispatch.PutTemplateDispatchAsync(p, d) ); @@ -180,7 +180,7 @@ public Task PutSearchTemplateAsync(IPutSearchTemplat public IDeleteSearchTemplateResponse DeleteSearchTemplate(string name, Func selector = null) { selector = selector ?? (s => s); - return this.Dispatch( + return this.Dispatcher.Dispatch( d => selector(d.Name(name)), (p, d) => this.RawDispatch.DeleteTemplateDispatch(p) ); @@ -188,7 +188,7 @@ public IDeleteSearchTemplateResponse DeleteSearchTemplate(string name, Func( + return this.Dispatcher.Dispatch( request, (p, d) => this.RawDispatch.DeleteTemplateDispatch(p) ); @@ -197,7 +197,7 @@ public IDeleteSearchTemplateResponse DeleteSearchTemplate(IDeleteSearchTemplateR public Task DeleteSearchTemplateAsync(string name, Func selector = null) { selector = selector ?? (s => s); - return this.DispatchAsync( + return this.Dispatcher.DispatchAsync( d => selector(d.Name(name)), (p, d) => this.RawDispatch.DeleteTemplateDispatchAsync(p) ); @@ -205,7 +205,7 @@ public Task DeleteSearchTemplateAsync(string name public Task DeleteSearchTemplateAsync(IDeleteSearchTemplateRequest request) { - return this.DispatchAsync( + return this.Dispatcher.DispatchAsync( request, (p, d) => this.RawDispatch.DeleteTemplateDispatchAsync(p) ); diff --git a/src/Nest/ElasticClient-Segments.cs b/src/Nest/ElasticClient-Segments.cs index 9b6bb6b778e..147d0ba296d 100644 --- a/src/Nest/ElasticClient-Segments.cs +++ b/src/Nest/ElasticClient-Segments.cs @@ -11,7 +11,7 @@ public partial class ElasticClient public ISegmentsResponse Segments(Func segmentsSelector = null) { segmentsSelector = segmentsSelector ?? (s => s); - return this.Dispatch( + return this.Dispatcher.Dispatch( segmentsSelector, (p, d) => this.RawDispatch.IndicesSegmentsDispatch(p) ); @@ -20,7 +20,7 @@ public ISegmentsResponse Segments(Func s /// public ISegmentsResponse Segments(ISegmentsRequest segmentsRequest) { - return this.Dispatch( + return this.Dispatcher.Dispatch( segmentsRequest, (p, d) => this.RawDispatch.IndicesSegmentsDispatch(p) ); @@ -30,7 +30,7 @@ public ISegmentsResponse Segments(ISegmentsRequest segmentsRequest) public Task SegmentsAsync(Func segmentsSelector = null) { segmentsSelector = segmentsSelector ?? (s => s); - return this.DispatchAsync( + return this.Dispatcher.DispatchAsync( segmentsSelector, (p, d) => this.RawDispatch.IndicesSegmentsDispatchAsync(p) ); @@ -39,7 +39,7 @@ public Task SegmentsAsync(Func public Task SegmentsAsync(ISegmentsRequest segmentsRequest) { - return this.DispatchAsync( + return this.Dispatcher.DispatchAsync( segmentsRequest, (p, d) => this.RawDispatch.IndicesSegmentsDispatchAsync(p) ); diff --git a/src/Nest/ElasticClient-Snapshot.cs b/src/Nest/ElasticClient-Snapshot.cs index f80934d3cd5..7e07e594456 100644 --- a/src/Nest/ElasticClient-Snapshot.cs +++ b/src/Nest/ElasticClient-Snapshot.cs @@ -12,7 +12,7 @@ public ISnapshotResponse Snapshot(string repository, string snapshotName, Func s); - return this.Dispatch( + return this.Dispatcher.Dispatch( s => selector(s.Snapshot(snapshotName).Repository(repository)), (p, d) => this.RawDispatch.SnapshotCreateDispatch(p, d) ); @@ -21,7 +21,7 @@ public ISnapshotResponse Snapshot(string repository, string snapshotName, Func public ISnapshotResponse Snapshot(ISnapshotRequest snapshotRequest) { - return this.Dispatch( + return this.Dispatcher.Dispatch( snapshotRequest, (p, d) => this.RawDispatch.SnapshotCreateDispatch(p, d) ); @@ -33,7 +33,7 @@ public Task SnapshotAsync(string repository, string snapshotN snapshotName.ThrowIfNullOrEmpty("name"); repository.ThrowIfNullOrEmpty("repository"); selector = selector ?? (s => s); - return this.DispatchAsync( + return this.Dispatcher.DispatchAsync( s => selector(s.Snapshot(snapshotName).Repository(repository)), (p, d) => this.RawDispatch.SnapshotCreateDispatchAsync(p, d) ); @@ -42,7 +42,7 @@ public Task SnapshotAsync(string repository, string snapshotN /// public Task SnapshotAsync(ISnapshotRequest snapshotRequest) { - return this.DispatchAsync( + return this.Dispatcher.DispatchAsync( snapshotRequest, (p, d) => this.RawDispatch.SnapshotCreateDispatchAsync(p, d) ); @@ -73,7 +73,7 @@ public IGetSnapshotResponse GetSnapshot(string repository, string snapshotName, snapshotName.ThrowIfNullOrEmpty("name"); repository.ThrowIfNullOrEmpty("repository"); selector = selector ?? (s => s); - return this.Dispatch( + return this.Dispatcher.Dispatch( s => selector(s.Snapshot(snapshotName).Repository(repository)), (p, d) => this.RawDispatch.SnapshotGetDispatch(p) ); @@ -82,7 +82,7 @@ public IGetSnapshotResponse GetSnapshot(string repository, string snapshotName, /// public IGetSnapshotResponse GetSnapshot(IGetSnapshotRequest getSnapshotRequest) { - return this.Dispatch( + return this.Dispatcher.Dispatch( getSnapshotRequest, (p, d) => this.RawDispatch.SnapshotGetDispatch(p) ); @@ -94,7 +94,7 @@ public Task GetSnapshotAsync(string repository, string sna snapshotName.ThrowIfNullOrEmpty("name"); repository.ThrowIfNullOrEmpty("repository"); selector = selector ?? (s => s); - return this.DispatchAsync( + return this.Dispatcher.DispatchAsync( s => selector(s.Snapshot(snapshotName).Repository(repository)), (p, d) => this.RawDispatch.SnapshotGetDispatchAsync(p) ); @@ -103,7 +103,7 @@ public Task GetSnapshotAsync(string repository, string sna /// public Task GetSnapshotAsync(IGetSnapshotRequest getSnapshotRequest) { - return this.DispatchAsync( + return this.Dispatcher.DispatchAsync( getSnapshotRequest, (p, d) => this.RawDispatch.SnapshotGetDispatchAsync(p) ); @@ -113,7 +113,7 @@ public Task GetSnapshotAsync(IGetSnapshotRequest getSnapsh /// public ISnapshotStatusResponse SnapshotStatus(Func selector = null) { - return this.Dispatch( + return this.Dispatcher.Dispatch( selector, (p, d) => this.RawDispatch.SnapshotStatusDispatch(p) ); @@ -122,7 +122,7 @@ public ISnapshotStatusResponse SnapshotStatus(Func public ISnapshotStatusResponse SnapshotStatus(ISnapshotStatusRequest getSnapshotRequest) { - return this.Dispatch( + return this.Dispatcher.Dispatch( getSnapshotRequest, (p, d) => this.RawDispatch.SnapshotStatusDispatch(p) ); @@ -131,7 +131,7 @@ public ISnapshotStatusResponse SnapshotStatus(ISnapshotStatusRequest getSnapshot /// public Task SnapshotStatusAsync(Func selector = null) { - return this.DispatchAsync( + return this.Dispatcher.DispatchAsync( selector, (p, d) => this.RawDispatch.SnapshotStatusDispatchAsync(p) ); @@ -140,7 +140,7 @@ public Task SnapshotStatusAsync(Func public Task SnapshotStatusAsync(ISnapshotStatusRequest getSnapshotRequest) { - return this.DispatchAsync( + return this.Dispatcher.DispatchAsync( getSnapshotRequest, (p, d) => this.RawDispatch.SnapshotStatusDispatchAsync(p) ); @@ -152,7 +152,7 @@ public IAcknowledgedResponse DeleteSnapshot(string repository, string snapshotNa snapshotName.ThrowIfNullOrEmpty("name"); repository.ThrowIfNullOrEmpty("repository"); selector = selector ?? (s => s); - return this.Dispatch( + return this.Dispatcher.Dispatch( s => selector(s.Snapshot(snapshotName).Repository(repository)), (p, d) => this.RawDispatch.SnapshotDeleteDispatch(p) ); @@ -161,7 +161,7 @@ public IAcknowledgedResponse DeleteSnapshot(string repository, string snapshotNa /// public IAcknowledgedResponse DeleteSnapshot(IDeleteSnapshotRequest deleteSnapshotRequest) { - return this.Dispatch( + return this.Dispatcher.Dispatch( deleteSnapshotRequest, (p, d) => this.RawDispatch.SnapshotDeleteDispatch(p) ); @@ -173,7 +173,7 @@ public Task DeleteSnapshotAsync(string repository, string snapshotName.ThrowIfNullOrEmpty("name"); repository.ThrowIfNullOrEmpty("repository"); selector = selector ?? (s => s); - return this.DispatchAsync( + return this.Dispatcher.DispatchAsync( s => selector(s.Snapshot(snapshotName).Repository(repository)), (p, d) => this.RawDispatch.SnapshotDeleteDispatchAsync(p) ); @@ -182,7 +182,7 @@ public Task DeleteSnapshotAsync(string repository, string /// public Task DeleteSnapshotAsync(IDeleteSnapshotRequest deleteSnapshotRequest) { - return this.DispatchAsync( + return this.Dispatcher.DispatchAsync( deleteSnapshotRequest, (p, d) => this.RawDispatch.SnapshotDeleteDispatchAsync(p) ); diff --git a/src/Nest/ElasticClient-Status.cs b/src/Nest/ElasticClient-Status.cs index 31a112e7fb1..2104be7010e 100644 --- a/src/Nest/ElasticClient-Status.cs +++ b/src/Nest/ElasticClient-Status.cs @@ -12,7 +12,7 @@ public partial class ElasticClient public IStatusResponse Status(Func selector = null) { selector = selector ?? (s => s); - return this.Dispatch( + return this.Dispatcher.Dispatch( selector, (p, d) => this.RawDispatch.IndicesStatusDispatch(p) ); @@ -21,7 +21,7 @@ public IStatusResponse Status(Func public IStatusResponse Status(IIndicesStatusRequest statusRequest) { - return this.Dispatch( + return this.Dispatcher.Dispatch( statusRequest, (p, d) => this.RawDispatch.IndicesStatusDispatch(p) ); @@ -31,7 +31,7 @@ public IStatusResponse Status(IIndicesStatusRequest statusRequest) public Task StatusAsync(Func selector = null) { selector = selector ?? (s => s); - return this.DispatchAsync( + return this.Dispatcher.DispatchAsync( selector, (p, d) => this.RawDispatch.IndicesStatusDispatchAsync(p) ); @@ -40,7 +40,7 @@ public Task StatusAsync(Func public Task StatusAsync(IIndicesStatusRequest statusRequest) { - return this.DispatchAsync( + return this.Dispatcher.DispatchAsync( statusRequest, (p, d) => this.RawDispatch.IndicesStatusDispatchAsync(p) ); diff --git a/src/Nest/ElasticClient-Suggest.cs b/src/Nest/ElasticClient-Suggest.cs index 0591cb1d5a3..b14b7e0bce0 100644 --- a/src/Nest/ElasticClient-Suggest.cs +++ b/src/Nest/ElasticClient-Suggest.cs @@ -12,7 +12,7 @@ public partial class ElasticClient public ISuggestResponse Suggest(Func, SuggestDescriptor> selector) where T : class { - return this.Dispatch, SuggestRequestParameters, SuggestResponse>( + return this.Dispatcher.Dispatch, SuggestRequestParameters, SuggestResponse>( selector, (p, d) => this.RawDispatch.SuggestDispatch(p, d) ); @@ -21,7 +21,7 @@ public ISuggestResponse Suggest(Func, SuggestDescriptor< /// public ISuggestResponse Suggest(ISuggestRequest suggestRequest) { - return this.Dispatch( + return this.Dispatcher.Dispatch( suggestRequest, (p, d) => this.RawDispatch.SuggestDispatch(p, d) ); @@ -31,7 +31,7 @@ public ISuggestResponse Suggest(ISuggestRequest suggestRequest) public Task SuggestAsync(Func, SuggestDescriptor> selector) where T : class { - return this.DispatchAsync, SuggestRequestParameters, SuggestResponse, ISuggestResponse>( + return this.Dispatcher.DispatchAsync, SuggestRequestParameters, SuggestResponse, ISuggestResponse>( selector, (p, d) => this.RawDispatch.SuggestDispatchAsync(p, d) ); @@ -40,7 +40,7 @@ public Task SuggestAsync(Func, Suggest /// public Task SuggestAsync(ISuggestRequest suggestRequest) { - return this.DispatchAsync( + return this.Dispatcher.DispatchAsync( suggestRequest, (p, d) => this.RawDispatch.SuggestDispatchAsync(p, d) ); diff --git a/src/Nest/ElasticClient-Template.cs b/src/Nest/ElasticClient-Template.cs index 516e5c073fb..b47dac9492a 100644 --- a/src/Nest/ElasticClient-Template.cs +++ b/src/Nest/ElasticClient-Template.cs @@ -15,7 +15,7 @@ public partial class ElasticClient public ITemplateResponse GetTemplate(string name, Func getTemplateSelector = null) { getTemplateSelector = getTemplateSelector ?? (s => s); - return this.Dispatch( + return this.Dispatcher.Dispatch( d => getTemplateSelector(d.Name(name)), (p, d) => RawDispatch.IndicesGetTemplateDispatch( p.DeserializationState((GetTemplateConverter) DeserializeTemplateResponse) @@ -26,7 +26,7 @@ public ITemplateResponse GetTemplate(string name, Func public ITemplateResponse GetTemplate(IGetTemplateRequest getTemplateRequest) { - return this.Dispatch( + return this.Dispatcher.Dispatch( getTemplateRequest, (p, d) => RawDispatch.IndicesGetTemplateDispatch( p.DeserializationState((GetTemplateConverter) DeserializeTemplateResponse) @@ -38,7 +38,7 @@ public ITemplateResponse GetTemplate(IGetTemplateRequest getTemplateRequest) public Task GetTemplateAsync(string name, Func getTemplateSelector = null) { getTemplateSelector = getTemplateSelector ?? (s => s); - return this.DispatchAsync( + return this.Dispatcher.DispatchAsync( d => getTemplateSelector(d.Name(name)), (p, d) => this.RawDispatch.IndicesGetTemplateDispatchAsync( p.DeserializationState((GetTemplateConverter) DeserializeTemplateResponse) @@ -49,7 +49,7 @@ public Task GetTemplateAsync(string name, Func public Task GetTemplateAsync(IGetTemplateRequest getTemplateRequest) { - return this.DispatchAsync( + return this.Dispatcher.DispatchAsync( getTemplateRequest, (p, d) => this.RawDispatch.IndicesGetTemplateDispatchAsync( p.DeserializationState((GetTemplateConverter) DeserializeTemplateResponse) @@ -64,7 +64,7 @@ public IIndicesOperationResponse PutTemplate(string name, Func( + return this.Dispatcher.Dispatch( descriptor, (p, d) => this.RawDispatch.IndicesPutTemplateDispatch(p, d.TemplateMapping) ); @@ -73,7 +73,7 @@ public IIndicesOperationResponse PutTemplate(string name, Func public IIndicesOperationResponse PutTemplate(IPutTemplateRequest putTemplateRequest) { - return this.Dispatch( + return this.Dispatcher.Dispatch( putTemplateRequest, (p, d) => this.RawDispatch.IndicesPutTemplateDispatch(p, d.TemplateMapping) ); @@ -84,7 +84,7 @@ public Task PutTemplateAsync(string name, Func( + return this.Dispatcher.DispatchAsync( descriptor, (p, d) => this.RawDispatch.IndicesPutTemplateDispatchAsync(p, d.TemplateMapping) ); @@ -93,7 +93,7 @@ public Task PutTemplateAsync(string name, Func public Task PutTemplateAsync(IPutTemplateRequest putTemplateRequest) { - return this.DispatchAsync( + return this.Dispatcher.DispatchAsync( putTemplateRequest, (p, d) => this.RawDispatch.IndicesPutTemplateDispatchAsync(p, d.TemplateMapping) ); @@ -105,7 +105,7 @@ public Task PutTemplateAsync(IPutTemplateRequest putT public IIndicesOperationResponse DeleteTemplate(string name, Func deleteTemplateSelector = null) { deleteTemplateSelector = deleteTemplateSelector ?? (s => s); - return this.Dispatch( + return this.Dispatcher.Dispatch( d => deleteTemplateSelector(d.Name(name)), (p, d) => this.RawDispatch.IndicesDeleteTemplateDispatch(p) ); @@ -114,7 +114,7 @@ public IIndicesOperationResponse DeleteTemplate(string name, Func public IIndicesOperationResponse DeleteTemplate(IDeleteTemplateRequest deleteTemplateRequest) { - return this.Dispatch( + return this.Dispatcher.Dispatch( deleteTemplateRequest, (p, d) => this.RawDispatch.IndicesDeleteTemplateDispatch(p) ); @@ -131,7 +131,7 @@ public Task DeleteTemplateAync(string name, Func DeleteTemplateAsync(string name, Func deleteTemplateSelector = null) { deleteTemplateSelector = deleteTemplateSelector ?? (s => s); - return this.DispatchAsync + return this.Dispatcher.DispatchAsync ( d => deleteTemplateSelector(d.Name(name)), (p, d) => this.RawDispatch.IndicesDeleteTemplateDispatchAsync(p) @@ -148,7 +148,7 @@ public Task DeleteTemplateAync(IDeleteTemplateRequest /// public Task DeleteTemplateAsync(IDeleteTemplateRequest deleteTemplateRequest) { - return this.DispatchAsync( + return this.Dispatcher.DispatchAsync( deleteTemplateRequest, (p, d) => this.RawDispatch.IndicesDeleteTemplateDispatchAsync(p) ); diff --git a/src/Nest/ElasticClient-TemplateExists.cs b/src/Nest/ElasticClient-TemplateExists.cs index 7921665fe9e..a6a1b3f6951 100644 --- a/src/Nest/ElasticClient-TemplateExists.cs +++ b/src/Nest/ElasticClient-TemplateExists.cs @@ -14,7 +14,7 @@ public partial class ElasticClient /// public IExistsResponse TemplateExists(Func selector) { - return this.Dispatch( + return this.Dispatcher.Dispatch( selector, (p, d) => this.RawDispatch.IndicesExistsTemplateDispatch( p.DeserializationState(new TemplateExistConverter(DeserializeExistsResponse)) @@ -25,7 +25,7 @@ public IExistsResponse TemplateExists(Func public IExistsResponse TemplateExists(ITemplateExistsRequest templateRequest) { - return this.Dispatch( + return this.Dispatcher.Dispatch( templateRequest, (p, d) => this.RawDispatch.IndicesExistsTemplateDispatch( p.DeserializationState(new TemplateExistConverter(DeserializeExistsResponse)) @@ -36,7 +36,7 @@ public IExistsResponse TemplateExists(ITemplateExistsRequest templateRequest) /// public Task TemplateExistsAsync(Func selector) { - return this.DispatchAsync( + return this.Dispatcher.DispatchAsync( selector, (p, d) => this.RawDispatch.IndicesExistsTemplateDispatchAsync( p.DeserializationState(new TemplateExistConverter(DeserializeExistsResponse)) @@ -47,7 +47,7 @@ public Task TemplateExistsAsync(Func public Task TemplateExistsAsync(ITemplateExistsRequest templateRequest) { - return this.DispatchAsync( + return this.Dispatcher.DispatchAsync( templateRequest, (p, d) => this.RawDispatch.IndicesExistsTemplateDispatchAsync( p.DeserializationState(new TemplateExistConverter(DeserializeExistsResponse)) diff --git a/src/Nest/ElasticClient-TermVector.cs b/src/Nest/ElasticClient-TermVector.cs index 0199a8b2da6..08a05a64495 100644 --- a/src/Nest/ElasticClient-TermVector.cs +++ b/src/Nest/ElasticClient-TermVector.cs @@ -12,7 +12,7 @@ public partial class ElasticClient public ITermVectorResponse TermVector(Func, TermvectorDescriptor> termVectorSelector) where T : class { - return this.Dispatch, TermvectorRequestParameters, TermVectorResponse>( + return this.Dispatcher.Dispatch, TermvectorRequestParameters, TermVectorResponse>( termVectorSelector, (p, d) => this.RawDispatch.TermvectorDispatch(p, d) ); @@ -21,7 +21,7 @@ public ITermVectorResponse TermVector(Func, Termvecto /// public ITermVectorResponse TermVector(ITermvectorRequest termvectorRequest) { - return this.Dispatch( + return this.Dispatcher.Dispatch( termvectorRequest, (p, d) => this.RawDispatch.TermvectorDispatch(p, d) ); @@ -31,7 +31,7 @@ public ITermVectorResponse TermVector(ITermvectorRequest termvectorRequest) public Task TermVectorAsync(Func, TermvectorDescriptor> termVectorSelector) where T : class { - return this.DispatchAsync, TermvectorRequestParameters, TermVectorResponse, ITermVectorResponse>( + return this.Dispatcher.DispatchAsync, TermvectorRequestParameters, TermVectorResponse, ITermVectorResponse>( termVectorSelector, (p, d) => this.RawDispatch.TermvectorDispatchAsync(p, d) ); @@ -40,7 +40,7 @@ public Task TermVectorAsync(Func /// public Task TermVectorAsync(ITermvectorRequest termvectorRequest) { - return this.DispatchAsync( + return this.Dispatcher.DispatchAsync( termvectorRequest, (p, d) => this.RawDispatch.TermvectorDispatchAsync(p, d) ); diff --git a/src/Nest/ElasticClient-TypeExists.cs b/src/Nest/ElasticClient-TypeExists.cs index 6b2421a1998..691e5dfe081 100644 --- a/src/Nest/ElasticClient-TypeExists.cs +++ b/src/Nest/ElasticClient-TypeExists.cs @@ -13,7 +13,7 @@ public partial class ElasticClient /// public IExistsResponse TypeExists(Func selector) { - return this.Dispatch( + return this.Dispatcher.Dispatch( selector, (p, d) => this.RawDispatch.IndicesExistsTypeDispatch( p.DeserializationState(new TypeExistConverter(DeserializeExistsResponse)) @@ -24,7 +24,7 @@ public IExistsResponse TypeExists(Func public IExistsResponse TypeExists(ITypeExistsRequest TypeRequest) { - return this.Dispatch( + return this.Dispatcher.Dispatch( TypeRequest, (p, d) => this.RawDispatch.IndicesExistsTypeDispatch( p.DeserializationState(new TypeExistConverter(DeserializeExistsResponse)) @@ -35,7 +35,7 @@ public IExistsResponse TypeExists(ITypeExistsRequest TypeRequest) /// public Task TypeExistsAsync(Func selector) { - return this.DispatchAsync( + return this.Dispatcher.DispatchAsync( selector, (p, d) => this.RawDispatch.IndicesExistsTypeDispatchAsync( p.DeserializationState(new TypeExistConverter(DeserializeExistsResponse)) @@ -46,7 +46,7 @@ public Task TypeExistsAsync(Func public Task TypeExistsAsync(ITypeExistsRequest TypeRequest) { - return this.DispatchAsync( + return this.Dispatcher.DispatchAsync( TypeRequest, (p, d) => this.RawDispatch.IndicesExistsTypeDispatchAsync( p.DeserializationState(new TypeExistConverter(DeserializeExistsResponse)) diff --git a/src/Nest/ElasticClient-Update.cs b/src/Nest/ElasticClient-Update.cs index 9ca715d580c..55d72bb43cf 100644 --- a/src/Nest/ElasticClient-Update.cs +++ b/src/Nest/ElasticClient-Update.cs @@ -24,7 +24,7 @@ public IUpdateResponse Update(Func, UpdateDescripto where T : class where K : class { - return this.Dispatch, UpdateRequestParameters, UpdateResponse>( + return this.Dispatcher.Dispatch, UpdateRequestParameters, UpdateResponse>( updateSelector, (p, d) => this.RawDispatch.UpdateDispatch(p, d) ); @@ -34,7 +34,7 @@ public IUpdateResponse Update(IUpdateRequest updateSelector) where T : class where K : class { - return this.Dispatch, UpdateRequestParameters, UpdateResponse>( + return this.Dispatcher.Dispatch, UpdateRequestParameters, UpdateResponse>( updateSelector, (p, d) => this.RawDispatch.UpdateDispatch(p, d) ); @@ -59,7 +59,7 @@ public Task UpdateAsync(Func, Upda where T : class where K : class { - return this.DispatchAsync, UpdateRequestParameters, UpdateResponse, IUpdateResponse>( + return this.Dispatcher.DispatchAsync, UpdateRequestParameters, UpdateResponse, IUpdateResponse>( updateSelector, (p, d) => this.RawDispatch.UpdateDispatchAsync(p, d) ); @@ -70,7 +70,7 @@ public Task UpdateAsync(IUpdateRequest updateReques where T : class where K : class { - return this.DispatchAsync, UpdateRequestParameters, UpdateResponse, IUpdateResponse>( + return this.Dispatcher.DispatchAsync, UpdateRequestParameters, UpdateResponse, IUpdateResponse>( updateRequest, (p, d) => this.RawDispatch.UpdateDispatchAsync(p, d) ); diff --git a/src/Nest/ElasticClient-UpdateSettings.cs b/src/Nest/ElasticClient-UpdateSettings.cs index ddb4206bc33..e68d9c83e38 100644 --- a/src/Nest/ElasticClient-UpdateSettings.cs +++ b/src/Nest/ElasticClient-UpdateSettings.cs @@ -10,7 +10,7 @@ public partial class ElasticClient /// public IAcknowledgedResponse UpdateSettings(Func updateSettingsSelector) { - return this.Dispatch( + return this.Dispatcher.Dispatch( updateSettingsSelector, (p, d) => this.RawDispatch.IndicesPutSettingsDispatch(p, d) ); @@ -19,7 +19,7 @@ public IAcknowledgedResponse UpdateSettings(Func public IAcknowledgedResponse UpdateSettings(IUpdateSettingsRequest updateSettingsRequest) { - return this.Dispatch( + return this.Dispatcher.Dispatch( updateSettingsRequest, (p, d) => this.RawDispatch.IndicesPutSettingsDispatch(p, d) ); @@ -28,7 +28,7 @@ public IAcknowledgedResponse UpdateSettings(IUpdateSettingsRequest updateSetting /// public Task UpdateSettingsAsync(Func updateSettingsSelector) { - return this.DispatchAsync( + return this.Dispatcher.DispatchAsync( updateSettingsSelector, (p, d) => this.RawDispatch.IndicesPutSettingsDispatchAsync(p, d) ); @@ -37,7 +37,7 @@ public Task UpdateSettingsAsync(Func public Task UpdateSettingsAsync(IUpdateSettingsRequest updateSettingsRequest) { - return this.DispatchAsync( + return this.Dispatcher.DispatchAsync( updateSettingsRequest, (p, d) => this.RawDispatch.IndicesPutSettingsDispatchAsync(p, d) ); diff --git a/src/Nest/ElasticClient-Upgrade.cs b/src/Nest/ElasticClient-Upgrade.cs index c24bbac285a..954cc9c6ba2 100644 --- a/src/Nest/ElasticClient-Upgrade.cs +++ b/src/Nest/ElasticClient-Upgrade.cs @@ -14,7 +14,7 @@ public partial class ElasticClient { public IUpgradeResponse Upgrade(IUpgradeRequest upgradeRequest) { - return this.Dispatch( + return this.Dispatcher.Dispatch( upgradeRequest, (p, d) => this.RawDispatch.IndicesUpgradeDispatch(p) ); @@ -23,7 +23,7 @@ public IUpgradeResponse Upgrade(IUpgradeRequest upgradeRequest) public IUpgradeResponse Upgrade(Func upgradeDescriptor = null) { upgradeDescriptor = upgradeDescriptor ?? (s => s); - return this.Dispatch( + return this.Dispatcher.Dispatch( upgradeDescriptor, (p, d) => this.RawDispatch.IndicesUpgradeDispatch(p) ); @@ -31,7 +31,7 @@ public IUpgradeResponse Upgrade(Func upgra public Task UpgradeAsync(IUpgradeRequest upgradeRequest) { - return this.DispatchAsync( + return this.Dispatcher.DispatchAsync( upgradeRequest, (p, d) => this.RawDispatch.IndicesUpgradeDispatchAsync(p) ); @@ -40,7 +40,7 @@ public Task UpgradeAsync(IUpgradeRequest upgradeRequest) public Task UpgradeAsync(Func upgradeDescriptor = null) { upgradeDescriptor = upgradeDescriptor ?? (s => s); - return this.DispatchAsync( + return this.Dispatcher.DispatchAsync( upgradeDescriptor, (p, d) => this.RawDispatch.IndicesUpgradeDispatchAsync(p) ); @@ -48,7 +48,7 @@ public Task UpgradeAsync(Func( + return this.Dispatcher.Dispatch( upgradeStatusRequest, (p, d) => this.RawDispatch.IndicesGetUpgradeDispatch( p.DeserializationState(new UpgradeStatusResponseConverter((r, s) => DeserializeUpgradeStatusResponse(r, s))) @@ -59,7 +59,7 @@ public IUpgradeStatusResponse UpgradeStatus(IUpgradeStatusRequest upgradeStatusR public IUpgradeStatusResponse UpgradeStatus(Func upgradeStatusDescriptor = null) { upgradeStatusDescriptor = upgradeStatusDescriptor ?? (s => s); - return this.Dispatch( + return this.Dispatcher.Dispatch( upgradeStatusDescriptor, (p, d) => this.RawDispatch.IndicesGetUpgradeDispatch( p.DeserializationState(new UpgradeStatusResponseConverter((r, s) => DeserializeUpgradeStatusResponse(r, s))) @@ -69,7 +69,7 @@ public IUpgradeStatusResponse UpgradeStatus(Func UpgradeStatusAsync(IUpgradeStatusRequest upgradeStatusRequest) { - return this.DispatchAsync( + return this.Dispatcher.DispatchAsync( upgradeStatusRequest, (p, d) => this.RawDispatch.IndicesGetUpgradeDispatchAsync( p.DeserializationState(new UpgradeStatusResponseConverter((r, s) => DeserializeUpgradeStatusResponse(r, s))) @@ -80,7 +80,7 @@ public Task UpgradeStatusAsync(IUpgradeStatusRequest upg public Task UpgradeStatusAsync(Func upgradeStatusDescriptor = null) { upgradeStatusDescriptor = upgradeStatusDescriptor ?? (s => s); - return this.DispatchAsync( + return this.Dispatcher.DispatchAsync( upgradeStatusDescriptor, (p, d) => this.RawDispatch.IndicesGetUpgradeDispatchAsync( p.DeserializationState(new UpgradeStatusResponseConverter((r, s) => DeserializeUpgradeStatusResponse(r, s))) diff --git a/src/Nest/ElasticClient-Validate.cs b/src/Nest/ElasticClient-Validate.cs index be3e1d8b9c0..ee15a7add33 100644 --- a/src/Nest/ElasticClient-Validate.cs +++ b/src/Nest/ElasticClient-Validate.cs @@ -11,7 +11,7 @@ public partial class ElasticClient public IValidateResponse Validate(Func, ValidateQueryDescriptor> querySelector) where T : class { - return this.Dispatch, ValidateQueryRequestParameters, ValidateResponse>( + return this.Dispatcher.Dispatch, ValidateQueryRequestParameters, ValidateResponse>( querySelector, (p, d) => this.RawDispatch.IndicesValidateQueryDispatch(p, d) ); @@ -20,7 +20,7 @@ public IValidateResponse Validate(Func, ValidateQu /// public IValidateResponse Validate(IValidateQueryRequest validateQueryRequest) { - return this.Dispatch( + return this.Dispatcher.Dispatch( validateQueryRequest, (p, d) => this.RawDispatch.IndicesValidateQueryDispatch(p, d) ); @@ -30,7 +30,7 @@ public IValidateResponse Validate(IValidateQueryRequest validateQueryRequest) public Task ValidateAsync(Func, ValidateQueryDescriptor> querySelector) where T : class { - return this.DispatchAsync, ValidateQueryRequestParameters, ValidateResponse, IValidateResponse>( + return this.Dispatcher.DispatchAsync, ValidateQueryRequestParameters, ValidateResponse, IValidateResponse>( querySelector, (p, d) => this.RawDispatch.IndicesValidateQueryDispatchAsync(p, d) ); @@ -39,7 +39,7 @@ public Task ValidateAsync(Func, /// public Task ValidateAsync(IValidateQueryRequest validateQueryRequest) { - return this.DispatchAsync( + return this.Dispatcher.DispatchAsync( validateQueryRequest, (p, d) => this.RawDispatch.IndicesValidateQueryDispatchAsync(p, d) ); diff --git a/src/Nest/ElasticClient-Warmers.cs b/src/Nest/ElasticClient-Warmers.cs index 337d10ceae0..01189eac5e2 100644 --- a/src/Nest/ElasticClient-Warmers.cs +++ b/src/Nest/ElasticClient-Warmers.cs @@ -16,7 +16,7 @@ public partial class ElasticClient public IIndicesOperationResponse PutWarmer(string name, Func selector) { selector.ThrowIfNull("selector"); - return this.Dispatch( + return this.Dispatcher.Dispatch( d => selector(d.Name(name).AllIndices()), (p, d) => this.RawDispatch.IndicesPutWarmerDispatch(p, d) ); @@ -25,7 +25,7 @@ public IIndicesOperationResponse PutWarmer(string name, Func public IIndicesOperationResponse PutWarmer(IPutWarmerRequest putWarmerRequest) { - return this.Dispatch( + return this.Dispatcher.Dispatch( putWarmerRequest, (p, d) => this.RawDispatch.IndicesPutWarmerDispatch(p, d) ); @@ -35,7 +35,7 @@ public IIndicesOperationResponse PutWarmer(IPutWarmerRequest putWarmerRequest) public Task PutWarmerAsync(string name, Func selector) { selector.ThrowIfNull("selector"); - return this.DispatchAsync( + return this.Dispatcher.DispatchAsync( d => selector(d.Name(name).AllIndices()), (p, d) => this.RawDispatch.IndicesPutWarmerDispatchAsync(p, d) ); @@ -44,7 +44,7 @@ public Task PutWarmerAsync(string name, Func public Task PutWarmerAsync(IPutWarmerRequest putWarmerRequest) { - return this.DispatchAsync( + return this.Dispatcher.DispatchAsync( putWarmerRequest, (p, d) => this.RawDispatch.IndicesPutWarmerDispatchAsync(p, d) ); @@ -56,7 +56,7 @@ public Task PutWarmerAsync(IPutWarmerRequest putWarme public IWarmerResponse GetWarmer(string name, Func selector = null) { selector = selector ?? (s => s); - return this.Dispatch( + return this.Dispatcher.Dispatch( d => selector(d.Name(name).AllIndices()), (p, d) => this.RawDispatch.IndicesGetWarmerDispatch( p.DeserializationState(new GetWarmerConverter(DeserializeWarmerResponse)) @@ -67,7 +67,7 @@ public IWarmerResponse GetWarmer(string name, Func public IWarmerResponse GetWarmer(IGetWarmerRequest getWarmerRequest) { - return this.Dispatch( + return this.Dispatcher.Dispatch( getWarmerRequest, (p, d) => this.RawDispatch.IndicesGetWarmerDispatch( p.DeserializationState(new GetWarmerConverter(DeserializeWarmerResponse)) @@ -79,7 +79,7 @@ public IWarmerResponse GetWarmer(IGetWarmerRequest getWarmerRequest) public Task GetWarmerAsync(string name, Func selector = null) { selector = selector ?? (s => s); - return this.DispatchAsync( + return this.Dispatcher.DispatchAsync( d => selector(d.Name(name).AllIndices()), (p, d) => this.RawDispatch.IndicesGetWarmerDispatchAsync( p.DeserializationState(new GetWarmerConverter(DeserializeWarmerResponse)) @@ -90,7 +90,7 @@ public Task GetWarmerAsync(string name, Func public Task GetWarmerAsync(IGetWarmerRequest getWarmerRequest) { - return this.DispatchAsync( + return this.Dispatcher.DispatchAsync( getWarmerRequest, (p, d) => this.RawDispatch.IndicesGetWarmerDispatchAsync( p.DeserializationState(new GetWarmerConverter(DeserializeWarmerResponse)) @@ -104,7 +104,7 @@ public Task GetWarmerAsync(IGetWarmerRequest getWarmerRequest) public IIndicesOperationResponse DeleteWarmer(string name, Func selector = null) { selector = selector ?? (s => s); - return this.Dispatch( + return this.Dispatcher.Dispatch( d => selector(d.Name(name).AllIndices()), (p, d) => this.RawDispatch.IndicesDeleteWarmerDispatch(p) ); @@ -113,7 +113,7 @@ public IIndicesOperationResponse DeleteWarmer(string name, Func public IIndicesOperationResponse DeleteWarmer(IDeleteWarmerRequest deleteWarmerRequest) { - return this.Dispatch( + return this.Dispatcher.Dispatch( deleteWarmerRequest, (p, d) => this.RawDispatch.IndicesDeleteWarmerDispatch(p) ); @@ -123,7 +123,7 @@ public IIndicesOperationResponse DeleteWarmer(IDeleteWarmerRequest deleteWarmerR public Task DeleteWarmerAsync(string name, Func selector = null) { selector = selector ?? (s => s); - return this.DispatchAsync + return this.Dispatcher.DispatchAsync ( d => selector(d.Name(name).AllIndices()), (p, d) => this.RawDispatch.IndicesDeleteWarmerDispatchAsync(p) @@ -133,7 +133,7 @@ public Task DeleteWarmerAsync(string name, Func public Task DeleteWarmerAsync(IDeleteWarmerRequest deleteWarmerRequest) { - return this.DispatchAsync( + return this.Dispatcher.DispatchAsync( deleteWarmerRequest, (p, d) => this.RawDispatch.IndicesDeleteWarmerDispatchAsync(p) ); diff --git a/src/Nest/ElasticClient.cs b/src/Nest/ElasticClient.cs index a67fd6736f6..7f40df596c8 100644 --- a/src/Nest/ElasticClient.cs +++ b/src/Nest/ElasticClient.cs @@ -17,8 +17,9 @@ public partial class ElasticClient : IElasticClient, IHighLevelToLowLevelDispatc { private readonly IConnectionSettingsValues _connectionSettings; + internal IHighLevelToLowLevelDispatcher Dispatcher { get { return this; } } internal RawDispatch RawDispatch { get; set; } - + public IConnection Connection { get; protected set; } public INestSerializer Serializer { get; protected set; } public IElasticsearchClient Raw { get; protected set; } @@ -56,31 +57,58 @@ public ElasticClient( } + public static void Warmup() + { + var client = new ElasticClient(connection: new InMemoryConnection()); + var stream = new MemoryStream("{}".Utf8Bytes()); + client.Serializer.Serialize(new SearchDescriptor()); + client.Serializer.Deserialize>(stream); + var connection = new HttpConnection(new ConnectionSettings()); + client.RootNodeInfo(); + client.Search(s => s.MatchAll().Index("someindex")); + } - public R Dispatch( - Func selector - , Func, D, ElasticsearchResponse> dispatch - ) - where Q : FluentRequestParameters, new() - where D : IRequest, new() - where R : BaseResponse + R IHighLevelToLowLevelDispatcher.Dispatch(D descriptor, Func, D, ElasticsearchResponse> dispatch) + { + var pathInfo = descriptor.ToPathInfo(this._connectionSettings); + var response = dispatch(pathInfo, descriptor); + return ResultsSelector(response, descriptor); + } + + R IHighLevelToLowLevelDispatcher.Dispatch(Func selector, Func, D, ElasticsearchResponse> dispatch) { selector.ThrowIfNull("selector"); var descriptor = selector(new D()); - return this.Dispatch(descriptor, dispatch); + return this.Dispatcher.Dispatch(descriptor, dispatch); } - public R Dispatch( - D descriptor - , Func, D, ElasticsearchResponse> dispatch - ) - where Q : FluentRequestParameters, new() - where D : IRequest - where R : BaseResponse + Task IHighLevelToLowLevelDispatcher.DispatchAsync(D descriptor, Func, D, Task>> dispatch) { var pathInfo = descriptor.ToPathInfo(this._connectionSettings); - var response = dispatch(pathInfo, descriptor); - return ResultsSelector(response, descriptor); + return dispatch(pathInfo, descriptor) + .ContinueWith(r => + { + if (r.IsFaulted && r.Exception != null) + { + var mr = r.Exception.InnerException as MaxRetryException; + if (mr != null) + mr.RethrowKeepingStackTrace(); + + var ae = r.Exception.Flatten(); + if (ae.InnerException != null) + ae.InnerException.RethrowKeepingStackTrace(); + + ae.RethrowKeepingStackTrace(); + } + return ResultsSelector(r.Result, descriptor); + }); + } + + Task IHighLevelToLowLevelDispatcher.DispatchAsync(Func selector, Func, D, Task>> dispatch) + { + selector.ThrowIfNull("selector"); + var descriptor = selector(new D()); + return this.Dispatcher.DispatchAsync(descriptor, dispatch); } private static R ResultsSelector( @@ -111,49 +139,6 @@ private static R CreateInvalidInstance(IElasticsearchResponse response) where return r; } - public Task DispatchAsync( - Func selector - , Func, D, Task>> dispatch - ) - where Q : FluentRequestParameters, new() - where D : IRequest, new() - where R : BaseResponse, I - where I : IResponse - { - selector.ThrowIfNull("selector"); - var descriptor = selector(new D()); - return this.DispatchAsync(descriptor, dispatch); - } - - public Task DispatchAsync( - D descriptor - , Func, D, Task>> dispatch - ) - where Q : FluentRequestParameters, new() - where D : IRequest - where R : BaseResponse, I - where I : IResponse - { - var pathInfo = descriptor.ToPathInfo(this._connectionSettings); - return dispatch(pathInfo, descriptor) - .ContinueWith(r => - { - if (r.IsFaulted && r.Exception != null) - { - var mr = r.Exception.InnerException as MaxRetryException; - if (mr != null) - mr.RethrowKeepingStackTrace(); - - var ae = r.Exception.Flatten(); - if (ae.InnerException != null) - ae.InnerException.RethrowKeepingStackTrace(); - - ae.RethrowKeepingStackTrace(); - } - return ResultsSelector(r.Result, descriptor); - }); - } - private TRequest ForceConfiguration( Func selector, Action setter ) @@ -172,17 +157,5 @@ private TRequest ForceConfiguration(TRequest request, Action()); - client.Serializer.Deserialize>(stream); - var connection = new HttpConnection(new ConnectionSettings()); - client.RootNodeInfo(); - client.Search(s => s.MatchAll().Index("someindex")); - } - } } diff --git a/src/Nest/Resolvers/ElasticContractResolver.cs b/src/Nest/Resolvers/ElasticContractResolver.cs index 709d4ee74a1..a5706c89db3 100644 --- a/src/Nest/Resolvers/ElasticContractResolver.cs +++ b/src/Nest/Resolvers/ElasticContractResolver.cs @@ -122,7 +122,7 @@ protected override IList CreateProperties(Type type, MemberSeriali defaultProperties = PropertiesOf(type, memberSerialization, defaultProperties, lookup); //defaultProperties = PropertiesOf(type, memberSerialization, defaultProperties, lookup); defaultProperties = PropertiesOf(type, memberSerialization, defaultProperties, lookup); - defaultProperties = PropertiesOf(type, memberSerialization, defaultProperties, lookup); + defaultProperties = PropertiesOf(type, memberSerialization, defaultProperties, lookup); return defaultProperties; }