/src/Nest/RawDispatch.generated.cs
C# | 3643 lines | 2539 code | 620 blank | 484 comment | 842 complexity | 8ece696372742123f0c1e92a91653e73 MD5 | raw file
Possible License(s): Apache-2.0, LGPL-2.0
Large files files are truncated, but you can click here to view the full file
- using System;
- using System.Collections.Generic;
- using System.Collections.Specialized;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- using Elasticsearch.Net;
- ///Generated File Please Do Not Edit Manually
- namespace Nest
- {
- ///<summary>
- ///Raw operations with elasticsearch
- ///</summary>
- internal partial class RawDispatch
- {
-
-
- internal ElasticsearchResponse<T> BulkDispatch<T>(ElasticsearchPathInfo<BulkRequestParameters> pathInfo , object body)
- {
- switch(pathInfo.HttpMethod)
- {
- case PathInfoHttpMethod.POST:
- //POST /{index}/{type}/_bulk
- if (!pathInfo.Index.IsNullOrEmpty() && !pathInfo.Type.IsNullOrEmpty() && body != null)
- return this.Raw.Bulk<T>(pathInfo.Index,pathInfo.Type,body,u => pathInfo.RequestParameters);
- //POST /{index}/_bulk
- if (!pathInfo.Index.IsNullOrEmpty() && body != null)
- return this.Raw.Bulk<T>(pathInfo.Index,body,u => pathInfo.RequestParameters);
- //POST /_bulk
- if (body != null)
- return this.Raw.Bulk<T>(body,u => pathInfo.RequestParameters);
- break;
- case PathInfoHttpMethod.PUT:
- //PUT /{index}/{type}/_bulk
- if (!pathInfo.Index.IsNullOrEmpty() && !pathInfo.Type.IsNullOrEmpty() && body != null)
- return this.Raw.BulkPut<T>(pathInfo.Index,pathInfo.Type,body,u => pathInfo.RequestParameters);
- //PUT /{index}/_bulk
- if (!pathInfo.Index.IsNullOrEmpty() && body != null)
- return this.Raw.BulkPut<T>(pathInfo.Index,body,u => pathInfo.RequestParameters);
- //PUT /_bulk
- if (body != null)
- return this.Raw.BulkPut<T>(body,u => pathInfo.RequestParameters);
- break;
- }
- throw new DispatchException("Could not dispatch IElasticClient.Bulk() into any of the following paths: \r\n - /_bulk\r\n - /{index}/_bulk\r\n - /{index}/{type}/_bulk");
- }
-
-
- internal Task<ElasticsearchResponse<T>> BulkDispatchAsync<T>(ElasticsearchPathInfo<BulkRequestParameters> pathInfo , object body)
- {
- switch(pathInfo.HttpMethod)
- {
- case PathInfoHttpMethod.POST:
- //POST /{index}/{type}/_bulk
- if (!pathInfo.Index.IsNullOrEmpty() && !pathInfo.Type.IsNullOrEmpty() && body != null)
- return this.Raw.BulkAsync<T>(pathInfo.Index,pathInfo.Type,body,u => pathInfo.RequestParameters);
- //POST /{index}/_bulk
- if (!pathInfo.Index.IsNullOrEmpty() && body != null)
- return this.Raw.BulkAsync<T>(pathInfo.Index,body,u => pathInfo.RequestParameters);
- //POST /_bulk
- if (body != null)
- return this.Raw.BulkAsync<T>(body,u => pathInfo.RequestParameters);
- break;
- case PathInfoHttpMethod.PUT:
- //PUT /{index}/{type}/_bulk
- if (!pathInfo.Index.IsNullOrEmpty() && !pathInfo.Type.IsNullOrEmpty() && body != null)
- return this.Raw.BulkPutAsync<T>(pathInfo.Index,pathInfo.Type,body,u => pathInfo.RequestParameters);
- //PUT /{index}/_bulk
- if (!pathInfo.Index.IsNullOrEmpty() && body != null)
- return this.Raw.BulkPutAsync<T>(pathInfo.Index,body,u => pathInfo.RequestParameters);
- //PUT /_bulk
- if (body != null)
- return this.Raw.BulkPutAsync<T>(body,u => pathInfo.RequestParameters);
- break;
- }
- throw new DispatchException("Could not dispatch IElasticClient.Bulk() into any of the following paths: \r\n - /_bulk\r\n - /{index}/_bulk\r\n - /{index}/{type}/_bulk");
- }
-
-
- internal ElasticsearchResponse<T> CatAliasesDispatch<T>(ElasticsearchPathInfo<CatAliasesRequestParameters> pathInfo )
- {
- switch(pathInfo.HttpMethod)
- {
- case PathInfoHttpMethod.GET:
- //GET /_cat/aliases/{name}
- if (!pathInfo.Name.IsNullOrEmpty())
- return this.Raw.CatAliases<T>(pathInfo.Name,u => pathInfo.RequestParameters);
- //GET /_cat/aliases
- return this.Raw.CatAliases<T>(u => pathInfo.RequestParameters);
- }
- throw new DispatchException("Could not dispatch IElasticClient.CatAliases() into any of the following paths: \r\n - /_cat/aliases\r\n - /_cat/aliases/{name}");
- }
-
-
- internal Task<ElasticsearchResponse<T>> CatAliasesDispatchAsync<T>(ElasticsearchPathInfo<CatAliasesRequestParameters> pathInfo )
- {
- switch(pathInfo.HttpMethod)
- {
- case PathInfoHttpMethod.GET:
- //GET /_cat/aliases/{name}
- if (!pathInfo.Name.IsNullOrEmpty())
- return this.Raw.CatAliasesAsync<T>(pathInfo.Name,u => pathInfo.RequestParameters);
- //GET /_cat/aliases
- return this.Raw.CatAliasesAsync<T>(u => pathInfo.RequestParameters);
- }
- throw new DispatchException("Could not dispatch IElasticClient.CatAliases() into any of the following paths: \r\n - /_cat/aliases\r\n - /_cat/aliases/{name}");
- }
-
-
- internal ElasticsearchResponse<T> CatAllocationDispatch<T>(ElasticsearchPathInfo<CatAllocationRequestParameters> pathInfo )
- {
- switch(pathInfo.HttpMethod)
- {
- case PathInfoHttpMethod.GET:
- //GET /_cat/allocation/{node_id}
- if (!pathInfo.NodeId.IsNullOrEmpty())
- return this.Raw.CatAllocation<T>(pathInfo.NodeId,u => pathInfo.RequestParameters);
- //GET /_cat/allocation
- return this.Raw.CatAllocation<T>(u => pathInfo.RequestParameters);
- }
- throw new DispatchException("Could not dispatch IElasticClient.CatAllocation() into any of the following paths: \r\n - /_cat/allocation\r\n - /_cat/allocation/{node_id}");
- }
-
-
- internal Task<ElasticsearchResponse<T>> CatAllocationDispatchAsync<T>(ElasticsearchPathInfo<CatAllocationRequestParameters> pathInfo )
- {
- switch(pathInfo.HttpMethod)
- {
- case PathInfoHttpMethod.GET:
- //GET /_cat/allocation/{node_id}
- if (!pathInfo.NodeId.IsNullOrEmpty())
- return this.Raw.CatAllocationAsync<T>(pathInfo.NodeId,u => pathInfo.RequestParameters);
- //GET /_cat/allocation
- return this.Raw.CatAllocationAsync<T>(u => pathInfo.RequestParameters);
- }
- throw new DispatchException("Could not dispatch IElasticClient.CatAllocation() into any of the following paths: \r\n - /_cat/allocation\r\n - /_cat/allocation/{node_id}");
- }
-
-
- internal ElasticsearchResponse<T> CatCountDispatch<T>(ElasticsearchPathInfo<CatCountRequestParameters> pathInfo )
- {
- switch(pathInfo.HttpMethod)
- {
- case PathInfoHttpMethod.GET:
- //GET /_cat/count/{index}
- if (!pathInfo.Index.IsNullOrEmpty())
- return this.Raw.CatCount<T>(pathInfo.Index,u => pathInfo.RequestParameters);
- //GET /_cat/count
- return this.Raw.CatCount<T>(u => pathInfo.RequestParameters);
- }
- throw new DispatchException("Could not dispatch IElasticClient.CatCount() into any of the following paths: \r\n - /_cat/count\r\n - /_cat/count/{index}");
- }
-
-
- internal Task<ElasticsearchResponse<T>> CatCountDispatchAsync<T>(ElasticsearchPathInfo<CatCountRequestParameters> pathInfo )
- {
- switch(pathInfo.HttpMethod)
- {
- case PathInfoHttpMethod.GET:
- //GET /_cat/count/{index}
- if (!pathInfo.Index.IsNullOrEmpty())
- return this.Raw.CatCountAsync<T>(pathInfo.Index,u => pathInfo.RequestParameters);
- //GET /_cat/count
- return this.Raw.CatCountAsync<T>(u => pathInfo.RequestParameters);
- }
- throw new DispatchException("Could not dispatch IElasticClient.CatCount() into any of the following paths: \r\n - /_cat/count\r\n - /_cat/count/{index}");
- }
-
-
- internal ElasticsearchResponse<T> CatHealthDispatch<T>(ElasticsearchPathInfo<CatHealthRequestParameters> pathInfo )
- {
- switch(pathInfo.HttpMethod)
- {
- case PathInfoHttpMethod.GET:
- //GET /_cat/health
- return this.Raw.CatHealth<T>(u => pathInfo.RequestParameters);
- }
- throw new DispatchException("Could not dispatch IElasticClient.CatHealth() into any of the following paths: \r\n - /_cat/health");
- }
-
-
- internal Task<ElasticsearchResponse<T>> CatHealthDispatchAsync<T>(ElasticsearchPathInfo<CatHealthRequestParameters> pathInfo )
- {
- switch(pathInfo.HttpMethod)
- {
- case PathInfoHttpMethod.GET:
- //GET /_cat/health
- return this.Raw.CatHealthAsync<T>(u => pathInfo.RequestParameters);
- }
- throw new DispatchException("Could not dispatch IElasticClient.CatHealth() into any of the following paths: \r\n - /_cat/health");
- }
-
-
- internal ElasticsearchResponse<T> CatHelpDispatch<T>(ElasticsearchPathInfo<CatHelpRequestParameters> pathInfo )
- {
- switch(pathInfo.HttpMethod)
- {
- case PathInfoHttpMethod.GET:
- //GET /_cat
- return this.Raw.CatHelp<T>(u => pathInfo.RequestParameters);
- }
- throw new DispatchException("Could not dispatch IElasticClient.CatHelp() into any of the following paths: \r\n - /_cat");
- }
-
-
- internal Task<ElasticsearchResponse<T>> CatHelpDispatchAsync<T>(ElasticsearchPathInfo<CatHelpRequestParameters> pathInfo )
- {
- switch(pathInfo.HttpMethod)
- {
- case PathInfoHttpMethod.GET:
- //GET /_cat
- return this.Raw.CatHelpAsync<T>(u => pathInfo.RequestParameters);
- }
- throw new DispatchException("Could not dispatch IElasticClient.CatHelp() into any of the following paths: \r\n - /_cat");
- }
-
-
- internal ElasticsearchResponse<T> CatIndicesDispatch<T>(ElasticsearchPathInfo<CatIndicesRequestParameters> pathInfo )
- {
- switch(pathInfo.HttpMethod)
- {
- case PathInfoHttpMethod.GET:
- //GET /_cat/indices/{index}
- if (!pathInfo.Index.IsNullOrEmpty())
- return this.Raw.CatIndices<T>(pathInfo.Index,u => pathInfo.RequestParameters);
- //GET /_cat/indices
- return this.Raw.CatIndices<T>(u => pathInfo.RequestParameters);
- }
- throw new DispatchException("Could not dispatch IElasticClient.CatIndices() into any of the following paths: \r\n - /_cat/indices\r\n - /_cat/indices/{index}");
- }
-
-
- internal Task<ElasticsearchResponse<T>> CatIndicesDispatchAsync<T>(ElasticsearchPathInfo<CatIndicesRequestParameters> pathInfo )
- {
- switch(pathInfo.HttpMethod)
- {
- case PathInfoHttpMethod.GET:
- //GET /_cat/indices/{index}
- if (!pathInfo.Index.IsNullOrEmpty())
- return this.Raw.CatIndicesAsync<T>(pathInfo.Index,u => pathInfo.RequestParameters);
- //GET /_cat/indices
- return this.Raw.CatIndicesAsync<T>(u => pathInfo.RequestParameters);
- }
- throw new DispatchException("Could not dispatch IElasticClient.CatIndices() into any of the following paths: \r\n - /_cat/indices\r\n - /_cat/indices/{index}");
- }
-
-
- internal ElasticsearchResponse<T> CatMasterDispatch<T>(ElasticsearchPathInfo<CatMasterRequestParameters> pathInfo )
- {
- switch(pathInfo.HttpMethod)
- {
- case PathInfoHttpMethod.GET:
- //GET /_cat/master
- return this.Raw.CatMaster<T>(u => pathInfo.RequestParameters);
- }
- throw new DispatchException("Could not dispatch IElasticClient.CatMaster() into any of the following paths: \r\n - /_cat/master");
- }
-
-
- internal Task<ElasticsearchResponse<T>> CatMasterDispatchAsync<T>(ElasticsearchPathInfo<CatMasterRequestParameters> pathInfo )
- {
- switch(pathInfo.HttpMethod)
- {
- case PathInfoHttpMethod.GET:
- //GET /_cat/master
- return this.Raw.CatMasterAsync<T>(u => pathInfo.RequestParameters);
- }
- throw new DispatchException("Could not dispatch IElasticClient.CatMaster() into any of the following paths: \r\n - /_cat/master");
- }
-
-
- internal ElasticsearchResponse<T> CatNodesDispatch<T>(ElasticsearchPathInfo<CatNodesRequestParameters> pathInfo )
- {
- switch(pathInfo.HttpMethod)
- {
- case PathInfoHttpMethod.GET:
- //GET /_cat/nodes
- return this.Raw.CatNodes<T>(u => pathInfo.RequestParameters);
- }
- throw new DispatchException("Could not dispatch IElasticClient.CatNodes() into any of the following paths: \r\n - /_cat/nodes");
- }
-
-
- internal Task<ElasticsearchResponse<T>> CatNodesDispatchAsync<T>(ElasticsearchPathInfo<CatNodesRequestParameters> pathInfo )
- {
- switch(pathInfo.HttpMethod)
- {
- case PathInfoHttpMethod.GET:
- //GET /_cat/nodes
- return this.Raw.CatNodesAsync<T>(u => pathInfo.RequestParameters);
- }
- throw new DispatchException("Could not dispatch IElasticClient.CatNodes() into any of the following paths: \r\n - /_cat/nodes");
- }
-
-
- internal ElasticsearchResponse<T> CatPendingTasksDispatch<T>(ElasticsearchPathInfo<CatPendingTasksRequestParameters> pathInfo )
- {
- switch(pathInfo.HttpMethod)
- {
- case PathInfoHttpMethod.GET:
- //GET /_cat/pending_tasks
- return this.Raw.CatPendingTasks<T>(u => pathInfo.RequestParameters);
- }
- throw new DispatchException("Could not dispatch IElasticClient.CatPendingTasks() into any of the following paths: \r\n - /_cat/pending_tasks");
- }
-
-
- internal Task<ElasticsearchResponse<T>> CatPendingTasksDispatchAsync<T>(ElasticsearchPathInfo<CatPendingTasksRequestParameters> pathInfo )
- {
- switch(pathInfo.HttpMethod)
- {
- case PathInfoHttpMethod.GET:
- //GET /_cat/pending_tasks
- return this.Raw.CatPendingTasksAsync<T>(u => pathInfo.RequestParameters);
- }
- throw new DispatchException("Could not dispatch IElasticClient.CatPendingTasks() into any of the following paths: \r\n - /_cat/pending_tasks");
- }
-
-
- internal ElasticsearchResponse<T> CatPluginsDispatch<T>(ElasticsearchPathInfo<CatPluginsRequestParameters> pathInfo )
- {
- switch(pathInfo.HttpMethod)
- {
- case PathInfoHttpMethod.GET:
- //GET /_cat/plugins
- return this.Raw.CatPlugins<T>(u => pathInfo.RequestParameters);
- }
- throw new DispatchException("Could not dispatch IElasticClient.CatPlugins() into any of the following paths: \r\n - /_cat/plugins");
- }
-
-
- internal Task<ElasticsearchResponse<T>> CatPluginsDispatchAsync<T>(ElasticsearchPathInfo<CatPluginsRequestParameters> pathInfo )
- {
- switch(pathInfo.HttpMethod)
- {
- case PathInfoHttpMethod.GET:
- //GET /_cat/plugins
- return this.Raw.CatPluginsAsync<T>(u => pathInfo.RequestParameters);
- }
- throw new DispatchException("Could not dispatch IElasticClient.CatPlugins() into any of the following paths: \r\n - /_cat/plugins");
- }
-
-
- internal ElasticsearchResponse<T> CatRecoveryDispatch<T>(ElasticsearchPathInfo<CatRecoveryRequestParameters> pathInfo )
- {
- switch(pathInfo.HttpMethod)
- {
- case PathInfoHttpMethod.GET:
- //GET /_cat/recovery/{index}
- if (!pathInfo.Index.IsNullOrEmpty())
- return this.Raw.CatRecovery<T>(pathInfo.Index,u => pathInfo.RequestParameters);
- //GET /_cat/recovery
- return this.Raw.CatRecovery<T>(u => pathInfo.RequestParameters);
- }
- throw new DispatchException("Could not dispatch IElasticClient.CatRecovery() into any of the following paths: \r\n - /_cat/recovery\r\n - /_cat/recovery/{index}");
- }
-
-
- internal Task<ElasticsearchResponse<T>> CatRecoveryDispatchAsync<T>(ElasticsearchPathInfo<CatRecoveryRequestParameters> pathInfo )
- {
- switch(pathInfo.HttpMethod)
- {
- case PathInfoHttpMethod.GET:
- //GET /_cat/recovery/{index}
- if (!pathInfo.Index.IsNullOrEmpty())
- return this.Raw.CatRecoveryAsync<T>(pathInfo.Index,u => pathInfo.RequestParameters);
- //GET /_cat/recovery
- return this.Raw.CatRecoveryAsync<T>(u => pathInfo.RequestParameters);
- }
- throw new DispatchException("Could not dispatch IElasticClient.CatRecovery() into any of the following paths: \r\n - /_cat/recovery\r\n - /_cat/recovery/{index}");
- }
-
-
- internal ElasticsearchResponse<T> CatShardsDispatch<T>(ElasticsearchPathInfo<CatShardsRequestParameters> pathInfo )
- {
- switch(pathInfo.HttpMethod)
- {
- case PathInfoHttpMethod.GET:
- //GET /_cat/shards/{index}
- if (!pathInfo.Index.IsNullOrEmpty())
- return this.Raw.CatShards<T>(pathInfo.Index,u => pathInfo.RequestParameters);
- //GET /_cat/shards
- return this.Raw.CatShards<T>(u => pathInfo.RequestParameters);
- }
- throw new DispatchException("Could not dispatch IElasticClient.CatShards() into any of the following paths: \r\n - /_cat/shards\r\n - /_cat/shards/{index}");
- }
-
-
- internal Task<ElasticsearchResponse<T>> CatShardsDispatchAsync<T>(ElasticsearchPathInfo<CatShardsRequestParameters> pathInfo )
- {
- switch(pathInfo.HttpMethod)
- {
- case PathInfoHttpMethod.GET:
- //GET /_cat/shards/{index}
- if (!pathInfo.Index.IsNullOrEmpty())
- return this.Raw.CatShardsAsync<T>(pathInfo.Index,u => pathInfo.RequestParameters);
- //GET /_cat/shards
- return this.Raw.CatShardsAsync<T>(u => pathInfo.RequestParameters);
- }
- throw new DispatchException("Could not dispatch IElasticClient.CatShards() into any of the following paths: \r\n - /_cat/shards\r\n - /_cat/shards/{index}");
- }
-
-
- internal ElasticsearchResponse<T> CatThreadPoolDispatch<T>(ElasticsearchPathInfo<CatThreadPoolRequestParameters> pathInfo )
- {
- switch(pathInfo.HttpMethod)
- {
- case PathInfoHttpMethod.GET:
- //GET /_cat/thread_pool
- return this.Raw.CatThreadPool<T>(u => pathInfo.RequestParameters);
- }
- throw new DispatchException("Could not dispatch IElasticClient.CatThreadPool() into any of the following paths: \r\n - /_cat/thread_pool");
- }
-
-
- internal Task<ElasticsearchResponse<T>> CatThreadPoolDispatchAsync<T>(ElasticsearchPathInfo<CatThreadPoolRequestParameters> pathInfo )
- {
- switch(pathInfo.HttpMethod)
- {
- case PathInfoHttpMethod.GET:
- //GET /_cat/thread_pool
- return this.Raw.CatThreadPoolAsync<T>(u => pathInfo.RequestParameters);
- }
- throw new DispatchException("Could not dispatch IElasticClient.CatThreadPool() into any of the following paths: \r\n - /_cat/thread_pool");
- }
-
-
- internal ElasticsearchResponse<T> ClearScrollDispatch<T>(ElasticsearchPathInfo<ClearScrollRequestParameters> pathInfo )
- {
- switch(pathInfo.HttpMethod)
- {
- case PathInfoHttpMethod.DELETE:
- //DELETE /_search/scroll/{scroll_id}
- if (!pathInfo.ScrollId.IsNullOrEmpty())
- return this.Raw.ClearScroll<T>(pathInfo.ScrollId,u => pathInfo.RequestParameters);
- break;
- }
- throw new DispatchException("Could not dispatch IElasticClient.ClearScroll() into any of the following paths: \r\n - /_search/scroll/{scroll_id}");
- }
-
-
- internal Task<ElasticsearchResponse<T>> ClearScrollDispatchAsync<T>(ElasticsearchPathInfo<ClearScrollRequestParameters> pathInfo )
- {
- switch(pathInfo.HttpMethod)
- {
- case PathInfoHttpMethod.DELETE:
- //DELETE /_search/scroll/{scroll_id}
- if (!pathInfo.ScrollId.IsNullOrEmpty())
- return this.Raw.ClearScrollAsync<T>(pathInfo.ScrollId,u => pathInfo.RequestParameters);
- break;
- }
- throw new DispatchException("Could not dispatch IElasticClient.ClearScroll() into any of the following paths: \r\n - /_search/scroll/{scroll_id}");
- }
-
-
- internal ElasticsearchResponse<T> ClusterGetSettingsDispatch<T>(ElasticsearchPathInfo<ClusterGetSettingsRequestParameters> pathInfo )
- {
- switch(pathInfo.HttpMethod)
- {
- case PathInfoHttpMethod.GET:
- //GET /_cluster/settings
- return this.Raw.ClusterGetSettings<T>(u => pathInfo.RequestParameters);
- }
- throw new DispatchException("Could not dispatch IElasticClient.ClusterGetSettings() into any of the following paths: \r\n - /_cluster/settings");
- }
-
-
- internal Task<ElasticsearchResponse<T>> ClusterGetSettingsDispatchAsync<T>(ElasticsearchPathInfo<ClusterGetSettingsRequestParameters> pathInfo )
- {
- switch(pathInfo.HttpMethod)
- {
- case PathInfoHttpMethod.GET:
- //GET /_cluster/settings
- return this.Raw.ClusterGetSettingsAsync<T>(u => pathInfo.RequestParameters);
- }
- throw new DispatchException("Could not dispatch IElasticClient.ClusterGetSettings() into any of the following paths: \r\n - /_cluster/settings");
- }
-
-
- internal ElasticsearchResponse<T> ClusterHealthDispatch<T>(ElasticsearchPathInfo<ClusterHealthRequestParameters> pathInfo )
- {
- switch(pathInfo.HttpMethod)
- {
- case PathInfoHttpMethod.GET:
- //GET /_cluster/health/{index}
- if (!pathInfo.Index.IsNullOrEmpty())
- return this.Raw.ClusterHealth<T>(pathInfo.Index,u => pathInfo.RequestParameters);
- //GET /_cluster/health
- return this.Raw.ClusterHealth<T>(u => pathInfo.RequestParameters);
- }
- throw new DispatchException("Could not dispatch IElasticClient.ClusterHealth() into any of the following paths: \r\n - /_cluster/health\r\n - /_cluster/health/{index}");
- }
-
-
- internal Task<ElasticsearchResponse<T>> ClusterHealthDispatchAsync<T>(ElasticsearchPathInfo<ClusterHealthRequestParameters> pathInfo )
- {
- switch(pathInfo.HttpMethod)
- {
- case PathInfoHttpMethod.GET:
- //GET /_cluster/health/{index}
- if (!pathInfo.Index.IsNullOrEmpty())
- return this.Raw.ClusterHealthAsync<T>(pathInfo.Index,u => pathInfo.RequestParameters);
- //GET /_cluster/health
- return this.Raw.ClusterHealthAsync<T>(u => pathInfo.RequestParameters);
- }
- throw new DispatchException("Could not dispatch IElasticClient.ClusterHealth() into any of the following paths: \r\n - /_cluster/health\r\n - /_cluster/health/{index}");
- }
-
-
- internal ElasticsearchResponse<T> ClusterPendingTasksDispatch<T>(ElasticsearchPathInfo<ClusterPendingTasksRequestParameters> pathInfo )
- {
- switch(pathInfo.HttpMethod)
- {
- case PathInfoHttpMethod.GET:
- //GET /_cluster/pending_tasks
- return this.Raw.ClusterPendingTasks<T>(u => pathInfo.RequestParameters);
- }
- throw new DispatchException("Could not dispatch IElasticClient.ClusterPendingTasks() into any of the following paths: \r\n - /_cluster/pending_tasks");
- }
-
-
- internal Task<ElasticsearchResponse<T>> ClusterPendingTasksDispatchAsync<T>(ElasticsearchPathInfo<ClusterPendingTasksRequestParameters> pathInfo )
- {
- switch(pathInfo.HttpMethod)
- {
- case PathInfoHttpMethod.GET:
- //GET /_cluster/pending_tasks
- return this.Raw.ClusterPendingTasksAsync<T>(u => pathInfo.RequestParameters);
- }
- throw new DispatchException("Could not dispatch IElasticClient.ClusterPendingTasks() into any of the following paths: \r\n - /_cluster/pending_tasks");
- }
-
-
- internal ElasticsearchResponse<T> ClusterPutSettingsDispatch<T>(ElasticsearchPathInfo<ClusterPutSettingsRequestParameters> pathInfo , object body)
- {
- switch(pathInfo.HttpMethod)
- {
- case PathInfoHttpMethod.PUT:
- //PUT /_cluster/settings
- if (body != null)
- return this.Raw.ClusterPutSettings<T>(body,u => pathInfo.RequestParameters);
- break;
- }
- throw new DispatchException("Could not dispatch IElasticClient.ClusterPutSettings() into any of the following paths: \r\n - /_cluster/settings");
- }
-
-
- internal Task<ElasticsearchResponse<T>> ClusterPutSettingsDispatchAsync<T>(ElasticsearchPathInfo<ClusterPutSettingsRequestParameters> pathInfo , object body)
- {
- switch(pathInfo.HttpMethod)
- {
- case PathInfoHttpMethod.PUT:
- //PUT /_cluster/settings
- if (body != null)
- return this.Raw.ClusterPutSettingsAsync<T>(body,u => pathInfo.RequestParameters);
- break;
- }
- throw new DispatchException("Could not dispatch IElasticClient.ClusterPutSettings() into any of the following paths: \r\n - /_cluster/settings");
- }
-
-
- internal ElasticsearchResponse<T> ClusterRerouteDispatch<T>(ElasticsearchPathInfo<ClusterRerouteRequestParameters> pathInfo , object body)
- {
- switch(pathInfo.HttpMethod)
- {
- case PathInfoHttpMethod.POST:
- //POST /_cluster/reroute
- if (body != null)
- return this.Raw.ClusterReroute<T>(body,u => pathInfo.RequestParameters);
- break;
- }
- throw new DispatchException("Could not dispatch IElasticClient.ClusterReroute() into any of the following paths: \r\n - /_cluster/reroute");
- }
-
-
- internal Task<ElasticsearchResponse<T>> ClusterRerouteDispatchAsync<T>(ElasticsearchPathInfo<ClusterRerouteRequestParameters> pathInfo , object body)
- {
- switch(pathInfo.HttpMethod)
- {
- case PathInfoHttpMethod.POST:
- //POST /_cluster/reroute
- if (body != null)
- return this.Raw.ClusterRerouteAsync<T>(body,u => pathInfo.RequestParameters);
- break;
- }
- throw new DispatchException("Could not dispatch IElasticClient.ClusterReroute() into any of the following paths: \r\n - /_cluster/reroute");
- }
-
-
- internal ElasticsearchResponse<T> ClusterStateDispatch<T>(ElasticsearchPathInfo<ClusterStateRequestParameters> pathInfo )
- {
- switch(pathInfo.HttpMethod)
- {
- case PathInfoHttpMethod.GET:
- //GET /_cluster/state/{metric}/{index}
- if (!pathInfo.Metric.IsNullOrEmpty() && !pathInfo.Index.IsNullOrEmpty())
- return this.Raw.ClusterState<T>(pathInfo.Metric,pathInfo.Index,u => pathInfo.RequestParameters);
- //GET /_cluster/state/{metric}
- if (!pathInfo.Metric.IsNullOrEmpty())
- return this.Raw.ClusterState<T>(pathInfo.Metric,u => pathInfo.RequestParameters);
- //GET /_cluster/state
- return this.Raw.ClusterState<T>(u => pathInfo.RequestParameters);
- }
- throw new DispatchException("Could not dispatch IElasticClient.ClusterState() into any of the following paths: \r\n - /_cluster/state\r\n - /_cluster/state/{metric}\r\n - /_cluster/state/{metric}/{index}");
- }
-
-
- internal Task<ElasticsearchResponse<T>> ClusterStateDispatchAsync<T>(ElasticsearchPathInfo<ClusterStateRequestParameters> pathInfo )
- {
- switch(pathInfo.HttpMethod)
- {
- case PathInfoHttpMethod.GET:
- //GET /_cluster/state/{metric}/{index}
- if (!pathInfo.Metric.IsNullOrEmpty() && !pathInfo.Index.IsNullOrEmpty())
- return this.Raw.ClusterStateAsync<T>(pathInfo.Metric,pathInfo.Index,u => pathInfo.RequestParameters);
- //GET /_cluster/state/{metric}
- if (!pathInfo.Metric.IsNullOrEmpty())
- return this.Raw.ClusterStateAsync<T>(pathInfo.Metric,u => pathInfo.RequestParameters);
- //GET /_cluster/state
- return this.Raw.ClusterStateAsync<T>(u => pathInfo.RequestParameters);
- }
- throw new DispatchException("Could not dispatch IElasticClient.ClusterState() into any of the following paths: \r\n - /_cluster/state\r\n - /_cluster/state/{metric}\r\n - /_cluster/state/{metric}/{index}");
- }
-
-
- internal ElasticsearchResponse<T> ClusterStatsDispatch<T>(ElasticsearchPathInfo<ClusterStatsRequestParameters> pathInfo )
- {
- switch(pathInfo.HttpMethod)
- {
- case PathInfoHttpMethod.GET:
- //GET /_cluster/stats/nodes/{node_id}
- if (!pathInfo.NodeId.IsNullOrEmpty())
- return this.Raw.ClusterStats<T>(pathInfo.NodeId,u => pathInfo.RequestParameters);
- //GET /_cluster/stats
- return this.Raw.ClusterStats<T>(u => pathInfo.RequestParameters);
- }
- throw new DispatchException("Could not dispatch IElasticClient.ClusterStats() into any of the following paths: \r\n - /_cluster/stats\r\n - /_cluster/stats/nodes/{node_id}");
- }
-
-
- internal Task<ElasticsearchResponse<T>> ClusterStatsDispatchAsync<T>(ElasticsearchPathInfo<ClusterStatsRequestParameters> pathInfo )
- {
- switch(pathInfo.HttpMethod)
- {
- case PathInfoHttpMethod.GET:
- //GET /_cluster/stats/nodes/{node_id}
- if (!pathInfo.NodeId.IsNullOrEmpty())
- return this.Raw.ClusterStatsAsync<T>(pathInfo.NodeId,u => pathInfo.RequestParameters);
- //GET /_cluster/stats
- return this.Raw.ClusterStatsAsync<T>(u => pathInfo.RequestParameters);
- }
- throw new DispatchException("Could not dispatch IElasticClient.ClusterStats() into any of the following paths: \r\n - /_cluster/stats\r\n - /_cluster/stats/nodes/{node_id}");
- }
-
-
- internal ElasticsearchResponse<T> CountDispatch<T>(ElasticsearchPathInfo<CountRequestParameters> pathInfo , object body)
- {
- switch(pathInfo.HttpMethod)
- {
- case PathInfoHttpMethod.POST:
- //POST /{index}/{type}/_count
- if (!pathInfo.Index.IsNullOrEmpty() && !pathInfo.Type.IsNullOrEmpty() && body != null)
- return this.Raw.Count<T>(pathInfo.Index,pathInfo.Type,body,u => pathInfo.RequestParameters);
- //POST /{index}/_count
- if (!pathInfo.Index.IsNullOrEmpty() && body != null)
- return this.Raw.Count<T>(pathInfo.Index,body,u => pathInfo.RequestParameters);
- //POST /_count
- if (body != null)
- return this.Raw.Count<T>(body,u => pathInfo.RequestParameters);
- break;
- case PathInfoHttpMethod.GET:
- //GET /{index}/{type}/_count
- if (!pathInfo.Index.IsNullOrEmpty() && !pathInfo.Type.IsNullOrEmpty())
- return this.Raw.CountGet<T>(pathInfo.Index,pathInfo.Type,u => pathInfo.RequestParameters);
- //GET /{index}/_count
- if (!pathInfo.Index.IsNullOrEmpty())
- return this.Raw.CountGet<T>(pathInfo.Index,u => pathInfo.RequestParameters);
- //GET /_count
- return this.Raw.CountGet<T>(u => pathInfo.RequestParameters);
- }
- throw new DispatchException("Could not dispatch IElasticClient.Count() into any of the following paths: \r\n - /_count\r\n - /{index}/_count\r\n - /{index}/{type}/_count");
- }
-
-
- internal Task<ElasticsearchResponse<T>> CountDispatchAsync<T>(ElasticsearchPathInfo<CountRequestParameters> pathInfo , object body)
- {
- switch(pathInfo.HttpMethod)
- {
- case PathInfoHttpMethod.POST:
- //POST /{index}/{type}/_count
- if (!pathInfo.Index.IsNullOrEmpty() && !pathInfo.Type.IsNullOrEmpty() && body != null)
- return this.Raw.CountAsync<T>(pathInfo.Index,pathInfo.Type,body,u => pathInfo.RequestParameters);
- //POST /{index}/_count
- if (!pathInfo.Index.IsNullOrEmpty() && body != null)
- return this.Raw.CountAsync<T>(pathInfo.Index,body,u => pathInfo.RequestParameters);
- //POST /_count
- if (body != null)
- return this.Raw.CountAsync<T>(body,u => pathInfo.RequestParameters);
- break;
- case PathInfoHttpMethod.GET:
- //GET /{index}/{type}/_count
- if (!pathInfo.Index.IsNullOrEmpty() && !pathInfo.Type.IsNullOrEmpty())
- return this.Raw.CountGetAsync<T>(pathInfo.Index,pathInfo.Type,u => pathInfo.RequestParameters);
- //GET /{index}/_count
- if (!pathInfo.Index.IsNullOrEmpty())
- return this.Raw.CountGetAsync<T>(pathInfo.Index,u => pathInfo.RequestParameters);
- //GET /_count
- return this.Raw.CountGetAsync<T>(u => pathInfo.RequestParameters);
- }
- throw new DispatchException("Could not dispatch IElasticClient.Count() into any of the following paths: \r\n - /_count\r\n - /{index}/_count\r\n - /{index}/{type}/_count");
- }
-
-
- internal ElasticsearchResponse<T> CountPercolateDispatch<T>(ElasticsearchPathInfo<PercolateCountRequestParameters> pathInfo , object body)
- {
- switch(pathInfo.HttpMethod)
- {
- case PathInfoHttpMethod.GET:
- //GET /{index}/{type}/{id}/_percolate/count
- if (!pathInfo.Index.IsNullOrEmpty() && !pathInfo.Type.IsNullOrEmpty() && !pathInfo.Id.IsNullOrEmpty())
- return this.Raw.CountPercolateGet<T>(pathInfo.Index,pathInfo.Type,pathInfo.Id,u => pathInfo.RequestParameters);
- //GET /{index}/{type}/_percolate/count
- if (!pathInfo.Index.IsNullOrEmpty() && !pathInfo.Type.IsNullOrEmpty())
- return this.Raw.CountPercolateGet<T>(pathInfo.Index,pathInfo.Type,u => pathInfo.RequestParameters);
- break;
- case PathInfoHttpMethod.POST:
- //POST /{index}/{type}/{id}/_percolate/count
- if (!pathInfo.Index.IsNullOrEmpty() && !pathInfo.Type.IsNullOrEmpty() && !pathInfo.Id.IsNullOrEmpty() && body != null)
- return this.Raw.CountPercolate<T>(pathInfo.Index,pathInfo.Type,pathInfo.Id,body,u => pathInfo.RequestParameters);
- //POST /{index}/{type}/_percolate/count
- if (!pathInfo.Index.IsNullOrEmpty() && !pathInfo.Type.IsNullOrEmpty() && body != null)
- return this.Raw.CountPercolate<T>(pathInfo.Index,pathInfo.Type,body,u => pathInfo.RequestParameters);
- break;
- }
- throw new DispatchException("Could not dispatch IElasticClient.CountPercolate() into any of the following paths: \r\n - /{index}/{type}/_percolate/count\r\n - /{index}/{type}/{id}/_percolate/count");
- }
-
-
- internal Task<ElasticsearchResponse<T>> CountPercolateDispatchAsync<T>(ElasticsearchPathInfo<PercolateCountRequestParameters> pathInfo , object body)
- {
- switch(pathInfo.HttpMethod)
- {
- case PathInfoHttpMethod.GET:
- //GET /{index}/{type}/{id}/_percolate/count
- if (!pathInfo.Index.IsNullOrEmpty() && !pathInfo.Type.IsNullOrEmpty() && !pathInfo.Id.IsNullOrEmpty())
- return this.Raw.CountPercolateGetAsync<T>(pathInfo.Index,pathInfo.Type,pathInfo.Id,u => pathInfo.RequestParameters);
- //GET /{index}/{type}/_percolate/count
- if (!pathInfo.Index.IsNullOrEmpty() && !pathInfo.Type.IsNullOrEmpty())
- return this.Raw.CountPercolateGetAsync<T>(pathInfo.Index,pathInfo.Type,u => pathInfo.RequestParameters);
- break;
- case PathInfoHttpMethod.POST:
- //POST /{index}/{type}/{id}/_percolate/count
- if (!pathInfo.Index.IsNullOrEmpty() && !pathInfo.Type.IsNullOrEmpty() && !pathInfo.Id.IsNullOrEmpty() && body != null)
- return this.Raw.CountPercolateAsync<T>(pathInfo.Index,pathInfo.Type,pathInfo.Id,body,u => pathInfo.RequestParameters);
- //POST /{index}/{type}/_percolate/count
- if (!pathInfo.Index.IsNullOrEmpty() && !pathInfo.Type.IsNullOrEmpty() && body != null)
- return this.Raw.CountPercolateAsync<T>(pathInfo.Index,pathInfo.Type,body,u => pathInfo.RequestParameters);
- break;
- }
- throw new DispatchException("Could not dispatch IElasticClient.CountPercolate() into any of the following paths: \r\n - /{index}/{type}/_percolate/count\r\n - /{index}/{type}/{id}/_percolate/count");
- }
-
-
- internal ElasticsearchResponse<T> DeleteDispatch<T>(ElasticsearchPathInfo<DeleteRequestParameters> pathInfo )
- {
- switch(pathInfo.HttpMethod)
- {
- case PathInfoHttpMethod.DELETE:
- //DELETE /{index}/{type}/{id}
- if (!pathInfo.Index.IsNullOrEmpty() && !pathInfo.Type.IsNullOrEmpty() && !pathInfo.Id.IsNullOrEmpty())
- return this.Raw.Delete<T>(pathInfo.Index,pathInfo.Type,pathInfo.Id,u => pathInfo.RequestParameters);
- break;
- }
- throw new DispatchException("Could not dispatch IElasticClient.Delete() into any of the following paths: \r\n - /{index}/{type}/{id}");
- }
-
-
- internal Task<ElasticsearchResponse<T>> DeleteDispatchAsync<T>(ElasticsearchPathInfo<DeleteRequestParameters> pathInfo )
- {
- switch(pathInfo.HttpMethod)
- {
- case PathInfoHttpMethod.DELETE:
- //DELETE /{index}/{type}/{id}
- if (!pathInfo.Index.IsNullOrEmpty() && !pathInfo.Type.IsNullOrEmpty() && !pathInfo.Id.IsNullOrEmpty())
- return this.Raw.DeleteAsync<T>(pathInfo.Index,pathInfo.Type,pathInfo.Id,u => pathInfo.RequestParameters);
- break;
- }
- throw new DispatchException("Could not dispatch IElasticClient.Delete() into any of the following paths: \r\n - /{index}/{type}/{id}");
- }
-
-
- internal ElasticsearchResponse<T> DeleteByQueryDispatch<T>(ElasticsearchPathInfo<DeleteByQueryRequestParameters> pathInfo , object body)
- {
- switch(pathInfo.HttpMethod)
- {
- case PathInfoHttpMethod.DELETE:
- //DELETE /{index}/{type}/_query
- if (!pathInfo.Index.IsNullOrEmpty() && !pathInfo.Type.IsNullOrEmpty() && body != null)
- return this.Raw.DeleteByQuery<T>(pathInfo.Index,pathInfo.Type,body,u => pathInfo.RequestParameters);
- //DELETE /{index}/_query
- if (!pathInfo.Index.IsNullOrEmpty() && body != null)
- return this.Raw.DeleteByQuery<T>(pathInfo.Index,body,u => pathInfo.RequestParameters);
- break;
- }
- throw new DispatchException("Could not dispatch IElasticClient.DeleteByQuery() into any of the following paths: \r\n - /{index}/_query\r\n - /{index}/{type}/_query");
- }
-
-
- internal Task<ElasticsearchResponse<T>> DeleteByQueryDispatchAsync<T>(ElasticsearchPathInfo<DeleteByQueryRequestParameters> pathInfo , object body)
- {
- switch(pathInfo.HttpMethod)
- {
- case PathInfoHttpMethod.DELETE:
- //DELETE /{index}/{type}/_query
- if (!pathInfo.Index.IsNullOrEmpty() && !pathInfo.Type.IsNullOrEmpty() && body != null)
- return this.Raw.DeleteByQueryAsync<T>(pathInfo.Index,pathInfo.Type,body,u => pathInfo.RequestParameters);
- //DELETE /{index}/_query
- if (!pathInfo.Index.IsNullOrEmpty() && body != null)
- return this.Raw.DeleteByQueryAsync<T>(pathInfo.Index,body,u => pathInfo.RequestParameters);
- break;
- }
- throw new DispatchException("Could not dispatch IElasticClient.DeleteByQuery() into any of the following paths: \r\n - /{index}/_query\r\n - /{index}/{type}/_query");
- }
-
-
- internal ElasticsearchResponse<T> ExistsDispatch<T>(ElasticsearchPathInfo<DocumentExistsRequestParameters> pathInfo )
- {
- switch(pathInfo.HttpMethod)
- {
- case PathInfoHttpMethod.HEAD:
- //HEAD /{index}/{type}/{id}
- if (!pathInfo.Index.IsNullOrEmpty() && !pathInfo.Type.IsNullOrEmpty() && !pathInfo.Id.IsNullOrEmpty())
- return this.Raw.Exists<T>(pathInfo.Index,pathInfo.Type,pathInfo.Id,u => pathInfo.RequestParameters);
- break;
- }
- throw new DispatchException("Could not dispatch IElasticClient.Exists() into any of the following paths: \r\n - /{index}/{type}/{id}");
- }
-
-
- internal Task<ElasticsearchResponse<T>> ExistsDispatchAsync<T>(ElasticsearchPathInfo<DocumentExistsRequestParameters> pathInfo )
- {
- switch(pathInfo.HttpMethod)
- {
- case PathInfoHttpMethod.HEAD:
- //HEAD /{index}/{type}/{id}
- if (!pathInfo.Index.IsNullOrEmpty() && !pathInfo.Type.IsNullOrEmpty() && !pathInfo.Id.IsNullOrEmpty())
- return this.Raw.ExistsAsync<T>(pathInfo.Index,pathInfo.Type,pathInfo.Id,u => pathInfo.RequestParameters);
- break;
- }
- throw new DispatchException("Could not dispatch IElasticClient.Exists() into any of the following paths: \r\n - /{index}/{type}/{id}");
- }
-
-
- internal ElasticsearchResponse<T> ExplainDispatch<T>(ElasticsearchPathInfo<ExplainRequestParameters> pathInfo , object body)
- {
- switch(pathInfo.HttpMethod)
- {
- case PathInfoHttpMethod.GET:
- //GET /{index}/{type}/{id}/_explain
- if (!pathInfo.Index.IsNullOrEmpty() && !pathInfo.Type.IsNullOrEmpty() && !pathInfo.Id.IsNullOrEmpty())
- return this.Raw.ExplainGet<T>(pathInfo.Index,pathInfo.Type,pathInfo.Id,u => pathInfo.RequestParameters);
- break;
- case PathInfoHttpMethod.POST:
- //POST /{index}/{type}/{id}/_explain
- if (!pathInfo.Index.IsNullOrEmpty() && !pathInfo.Type.IsNullOrEmpty() && !pathInfo.Id.IsNullOrEmpty() && body != null)
- return this.Raw.Explain<T>(pathInfo.Index,pathInfo.Type,pathInfo.Id,body,u => pathInfo.RequestParameters);
- break;
- }
- throw new DispatchException("Could not dispatch IElasticClient.Explain() into any of the following paths: \r\n - /{index}/{type}/{id}/_explain");
- }
-
-
- internal Task<ElasticsearchResponse<T>> ExplainDispatchAsync<T>(ElasticsearchPathInfo<ExplainRequestParameters> pathInfo , object body)
- {
- switch(pathInfo.HttpMethod)
- {
- case PathInfoHttpMethod.GET:
- //GET /{index}/{type}/{id}/_explain
- if (!pathInfo.Index.IsNullOrEmpty() && !pathInfo.Type.IsNullOrEmpty() && !pathInfo.Id.IsNullOrEmpty())
- return this.Raw.ExplainGetAsync<T>(pathInfo.Index,pathInfo.Type,pathInfo.Id,u => pathInfo.RequestParameters);
- break;
- case PathInfoHttpMethod.POST:
- //POST /{index}/{type}/{id}/_explain
- if (!pathInfo.Index.IsNullOrEmpty() && !pathInfo.Type.IsNullOrEmpty() && !pathInfo.Id.IsNullOrEmpty() && body != null)
- return this.Raw.ExplainAsync<T>(pathInfo.Index,pathInfo.Type,pathInfo.Id,body,u => pathInfo.RequestParameters);
- break;
- }
- throw new DispatchException("Could not dispatch IElasticClient.Explain() into any of the following paths: \r\n - /{index}/{type}/{id}/_explain");
- }
-
-
- internal ElasticsearchResponse<T> GetDispatch<T>(ElasticsearchPathInfo<GetRequestParameters> pathInfo )
- {
- switch(pathInfo.HttpMethod)
- {
- case PathInfoHttpMethod.GET:
- //GET /{index}/{type}/{id}
- if (!pathInfo.Index.IsNullOrEmpty() && !pathInfo.Type.IsNullOrEmpty() && !pathInfo.Id.IsNullOrEmpty())
- return this.Raw.Get<T>(pathInfo.Index,pathInfo.Type,pathInfo.Id,u => pathInfo.RequestParameters);
- break;
- }
- throw new DispatchException("Could not dispatch IElasticClient.Get() into any of the following paths: \r\n - /{index}/{type}/{id}");
- }
-
-
- internal Task<ElasticsearchResponse<T>> GetDispatchAsync<T>(ElasticsearchPathInfo<GetRequestParameters> pathInfo )
- {
- switch(pathInfo.HttpMethod)
- {
- case PathInfoHttpMethod.GET:
- //GET /{index}/{type}/{id}
- if (!pathInfo.Index.IsNullOrEmpty() && !pathInfo.Type.IsNullOrEmpty() && !pathInfo.Id.IsNullOrEmpty())
- return this.Raw.GetAsync<T>(pathInfo.Index,pathInfo.Type,pathInfo.Id,u => pathInfo.RequestParameters);
- break;
- }
- throw new DispatchException("Could not dispatch IElasticClient.Get() into any of the following paths: \r\n - /{index}/{type}/{id}");
- }
-
-
- internal ElasticsearchResponse<T> GetSourceDispatch<T>(ElasticsearchPathInfo<SourceRequestParameters> pathInfo )
- {
- switch(pathInfo.HttpMethod)
- {
- case PathInfoHttpMethod.GET:
- //GET /{index}/{type}/{id}/_source
- if (!pathInfo.Index.IsNullOrEmpty() && !pathInfo.Type.IsNullOrEmpty() && !pathInfo.Id.IsNullOrEmpty())
- return this.Raw.GetSource<T>(pathInfo.Index,pathInfo.Type,pathInfo.Id,u => pathInfo.RequestParameters);
- break;
- }
- throw new DispatchException("Could not dispatch IElasticClient.GetSource() into any of the following paths: \r\n - /{index}/{type}/{id}/_source");
- }
-
-
- internal Task<ElasticsearchResponse<T>> GetSourceDispatchAsync<T>(ElasticsearchPathInfo<SourceRequestParameters> pathInfo )
- {
- switch(pathInfo.HttpMethod)
- {
- case PathInfoHttpMethod.GET:
- //GET /{index}/{type}/{id}/_source
- if (!pathInfo.Index.IsNullOrEmpty() && !pathInfo.Type.IsNullOrEmpty() && !pathInfo.Id.IsNullOrEmpty())
- return this.Raw.GetSourceAsync<T>(pathInfo.Index,pathInfo.Type,pathInfo.Id,u => pathInfo.RequestParameters);
- break;
- }
- throw new DispatchException("Could not dispatch IElasticClient.GetSource() into any of the following paths: \r\n - /{index}/{type}/{id}/_source");
- }
-
-
- internal ElasticsearchResponse<T> IndexDispatch<T>(ElasticsearchPathInfo<IndexRequestParameters> pathInfo , object body)
- {
- switch(pathInfo.HttpMethod)
- {
- case PathInfoHttpMethod.POST:
- //POST /{index}/{type}/{id}
- if (!pathInfo.Index.IsNullOrEmpty() && !pathInfo.Type.IsNullOrEmpty() && !pathInfo.Id.IsNullOrEmpty() && body != null)
- return this.Raw.Index<T>(pathInfo.Index,pathInfo.Type,pathInfo.Id,body,u => pathInfo.RequestParameters);
- //POST /{index}/{type}
- if (!pathInfo.Index.IsNullOrEmpty() && !pathInfo.Type.IsNullOrEmpty() && body != null)
- return this.Raw.Index<T>(pathInfo.Index,pathInfo.Type,body,u => pathInfo.RequestParameters);
- break;
- case PathInfoHttpMethod.PUT:
- //PUT /{index}/{type}/{id}
- if (!pathInfo.Index.IsNullOrEmpty() && !pathInfo.Type.IsNullOrEmpty() && !pathInfo.Id.IsNullOrEmpty() && body != null)
- return this.Raw.IndexPut<T>(pathInfo.Index,pathInfo.Type,pathInfo.Id,body,u => pathInfo.RequestParameters);
- //PUT /{index}/{type}
- if (!pathInfo.Index.IsNullOrEmpty() && !pathInfo.Type.IsNullOrEmpty() && body != null)
- return this.Raw.IndexPut<T>(pathInfo.Index,pathInfo.Type,body,u => pathInfo.RequestParameters);
- break;
- }
- throw new DispatchException("Could not dispatch IElasticClient.Index() into any of the following paths: \r\n - /{index}/{type}\r\n - /{index}/{type}/{id}");
- }
-
-
- internal Task<ElasticsearchResponse<T>> IndexDispatchAsync<T>(ElasticsearchPathInfo<IndexRequestParameters> pathInfo , object body)
- {
- switch(pathInfo.HttpMethod)
- {
- case PathInfoHttpMethod.POST:
- //POST /{index}/{type}/{id}
- if (!pathInfo.Index.IsNullOrEmpty() && !pathInfo.Type.IsNullOrEmpty() && !pathInfo.Id.IsNullOrEmpty() && body != null)
- return this.Raw.IndexAsync<T>(pathInfo.Index,pathInfo.Type,pathInfo.Id,body,u => pathInfo.RequestParameters);
- //POST /{index}/{type}
- if (!pathInfo.Index.IsNullOrEmpty() && !pathInfo.Type.IsNullOrEmpty() && body != null)
- return this.Raw.IndexAsync<T>(pathInfo.Index,pathInfo.Type,body,u => pathInfo.RequestParameters);
- break;
- case PathInfoHttpMethod.PUT:
- //PUT /{index}/{type}/{id}
- if (!pathInfo.Index.IsNullOrEmpty() && !pathInfo.Type.IsNullOrEmpty() && !pathInfo.Id.IsNullOrEmpty() && body != null)
- return this.Raw.IndexPutAsync<T>(pathInfo.Index,pathInfo.Type,pathInfo.Id,body,u => pathInfo.RequestParameters);
- //PUT /{index}/{type}
- if (!pathInfo.Index.IsNullOrEmpty() && !pathInfo.Type.IsNullOrEmpty() && body != null)
- return this.Raw.IndexPutAsync<T>(pathInfo.Index,pathInfo.Type,body,u => pathInfo.RequestParameters);
- break;
- }
- throw new DispatchException("Could not dispatch IElasticClient.Index() into any of the following paths: \r\n - /{index}/{type}\r\n - /{index}/{type}/{id}");
- }
-
-
- internal ElasticsearchResponse<T> IndicesAnalyzeDispatch<T>(ElasticsearchPathInfo<AnalyzeRequestParameters> pathInfo , object body)
- {
- switch(pathInfo.HttpMethod)
- {
- case PathInfoHttpMethod.GET:
- //GET /{index}/_analyze
- if (!pathInfo.Index.IsNullOrEmpty())
- return this.Raw.IndicesAnalyzeGet<T>(pathInfo.Index,u => pathInfo.RequestParameters);
- //GET /_analyze
- return this.Raw.IndicesAnalyzeGetForAll<T>(u => pathInfo.RequestParameters);
- case PathInfoHttpMethod.POST:
- //POST /{index}/_analyze
- if (!pathInfo.Index.IsNullOrEmpty() && body != null)
- return this.Raw.IndicesAnalyze<T>(pathInfo.Index,body,u => pathInfo.RequestParameters);
- //POST /_analyze
- if (body != null)
- return this.Raw.IndicesAnalyzeForAll<T>(body,u => pathInfo.RequestParameters);
- break;
- }
- throw new DispatchException("Could not dispatch IElasticClient.IndicesAnalyze() into any of the following paths: \r\n - /_analyze\r\n - /{index}/_analyze");
- }
-
-
- internal Task<ElasticsearchResponse<T>> IndicesAnalyzeDispatchAsync<T>(ElasticsearchPathInfo<AnalyzeRequestParameters> pathInfo , object body)
- {
- switch(pathInfo.HttpMethod)
- {
- case PathInfoHttpMethod.GET:
- //GET /{index}/_analyze
- if (!pathInfo.Index.IsNullOrEmpty())
- return this.Raw.IndicesAnalyzeGetAsync<T>(pathInfo.Index,u => pathInfo.RequestParameters);
- //GET /_analyze
- return this.Raw.IndicesAnalyzeGetForAllAsync<T>(u => pathInfo.RequestParameters);
- case PathInfoHttpMethod.POST:
- //POST /{index}/_analyze
- if (!pathInfo.Index.IsNullOrEmpty() && body != null)
- return this.Raw.IndicesAnalyzeAsync<T>(pathInfo.Index,body,u => pathInfo.RequestParameters);
- //POST /_analyze
- if (body != null)
- return this.Raw.IndicesAnalyzeForAllAsync<T>(body,u => pathInfo.RequestParameters);
- break;
- }
- throw new DispatchException("Could not dispatch IElasticClient.IndicesAnalyze() into any of the following paths: \r\n - /_analyze\r\n - /{index}/_analyze");
- }
-
-
- internal ElasticsearchResponse<T> IndicesClearCacheDispatch<T>(ElasticsearchPathInfo<ClearCacheRequestParameters> pathInfo )
- {
- switch(pathInfo.HttpMethod)
- {
- case PathInfoHttpMethod.POST:
- //POST /{index}/_cache/clear
- if (!pathInfo.Index.IsNullOrEmpty())
- return this.Raw.IndicesClearCache<T>(pathInfo.Index,u => pathInfo.RequestParameters);
- //POST /_cache/clear
- return this.Raw.IndicesClearCacheForAll<T>(u => pathInfo.RequestParameters);
- case PathInfoHttpMethod.GET:
- //GET /{index}/_cache/clear
- if (!pathInfo.Index.IsNullOrEmpty())
- return this.Raw.IndicesClearCacheGet<T>(pathInfo.Index,u => pathInfo.RequestParameters);
- //GET /_cache/clear
- return this.Raw.IndicesClearCacheGetForAll<T>(u => pathInfo.RequestParameters);
- }
- throw new DispatchException("Could not dispatch IElasticClient.IndicesClearCache() into any of the following paths: \r\n - /_cache/clear\r\n - /{index}/_cache/clear");
- }
-
-
- internal Task<ElasticsearchResponse<T>> IndicesClearCacheDispatchAsync<T>(ElasticsearchPathInfo<ClearCacheRequestParameters> pathInfo )
- {
- switch(pathInfo.HttpMethod)
- {
- case PathInfoHttpMethod.POST:
- //POST /{index}/_cache/clear
- if (!pathInfo.Index.IsNullOrEmpty())
- return this.Raw.IndicesClearCacheAsync<T>(pathInfo.Index,u => pathInfo.RequestParameters);
- //POST /_cache/clear
- return this.Raw.IndicesClearCacheForAllAsync<T>(u => pathInfo.RequestParameters);
- case PathInfoHttpMethod.GET:
- //GET /{index}/_cache/clear
- if (!pathInfo.Index.IsNullOrEmpty())
- return this.Raw.IndicesClearCacheGetAsync<T>(pathInfo.Index,u => pathInfo.RequestParameters);
- //GET /_cache/clear
- return this.Raw.IndicesClearCacheGetForAllAsync<T>(u => pathInfo.RequestParameters);
- }
- throw new DispatchException("Could not dispatch IElasticClient.IndicesClearCache() into any of the following paths: \r\n - /_cache/clear\r\n - /{index}/_cache/clear");
- }
-
-
- internal ElasticsearchResponse<T> IndicesCloseDispatch<T>(ElasticsearchPathInfo<CloseIndexRequestParameters> pathInfo )
- {
- switch(pathInfo.HttpMethod)
- {
- case PathInfoHttpMethod.POST:
- //POST /{index}/_close
- if (!pathInfo.Index.IsNullOrEmpty())
- return this.Raw.IndicesClose<T>(pathInfo.Index,u => pathInfo.RequestParameters);
- break;
- }
- throw new DispatchException("Could not dispatch IElasticClient.IndicesClose() into any of the following paths: \r\n - /{index}/_close");
- }
-
-
- internal Task<ElasticsearchResponse<T>> IndicesCloseDispatchAsync<T>(ElasticsearchPathInfo<CloseIndexRequestParameters> pathInfo )
- {
- switch(pathInfo.HttpMethod)
- {
- case PathInfoHttpMethod.POST:
- //POST /{index}/_close
- if (!pathInfo.Index.IsNullOrEmpty())
- return this.Raw.IndicesCloseAsync<T>(pathInfo.Index,u => pathInfo.RequestParameters);
- break;
- }
- throw new DispatchException("Could not dispatch IElasticClient.IndicesClose() into any of the following paths: \r\n - /{index}/_close");
- }
-
-
- internal ElasticsearchResponse<T> IndicesCreateDispatch<T>(ElasticsearchPathInfo<CreateIndexRequestParameters> pathInfo , object body)
- {
- switch(pathInfo.HttpMethod)
- {
- case PathInfoHttpMethod.PUT:
- //PUT /{index}
- if (!pathInfo.Index.IsNullOrEmpty() && body != null)
- return this.Raw.IndicesCreate<T>(pathInfo.Index,body,u => pathInfo.RequestParameters);
- break;
- case PathInfoHttpMethod.POST:
- //POST /{index}
- if (!pathInfo.Index.IsNullOrEmpty() && body != null)
- return this.Raw.IndicesCreatePost<T>(pathInfo.Index,body,u => pathInfo.Reques…
Large files files are truncated, but you can click here to view the full file