PageRenderTime 54ms CodeModel.GetById 19ms RepoModel.GetById 0ms app.codeStats 1ms

/src/Nest/RawDispatch.generated.cs

https://github.com/cloudreader/elasticsearch-net
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

  1. using System;
  2. using System.Collections.Generic;
  3. using System.Collections.Specialized;
  4. using System.Linq;
  5. using System.Text;
  6. using System.Threading.Tasks;
  7. using Elasticsearch.Net;
  8. ///Generated File Please Do Not Edit Manually
  9. namespace Nest
  10. {
  11. ///<summary>
  12. ///Raw operations with elasticsearch
  13. ///</summary>
  14. internal partial class RawDispatch
  15. {
  16. internal ElasticsearchResponse<T> BulkDispatch<T>(ElasticsearchPathInfo<BulkRequestParameters> pathInfo , object body)
  17. {
  18. switch(pathInfo.HttpMethod)
  19. {
  20. case PathInfoHttpMethod.POST:
  21. //POST /{index}/{type}/_bulk
  22. if (!pathInfo.Index.IsNullOrEmpty() && !pathInfo.Type.IsNullOrEmpty() && body != null)
  23. return this.Raw.Bulk<T>(pathInfo.Index,pathInfo.Type,body,u => pathInfo.RequestParameters);
  24. //POST /{index}/_bulk
  25. if (!pathInfo.Index.IsNullOrEmpty() && body != null)
  26. return this.Raw.Bulk<T>(pathInfo.Index,body,u => pathInfo.RequestParameters);
  27. //POST /_bulk
  28. if (body != null)
  29. return this.Raw.Bulk<T>(body,u => pathInfo.RequestParameters);
  30. break;
  31. case PathInfoHttpMethod.PUT:
  32. //PUT /{index}/{type}/_bulk
  33. if (!pathInfo.Index.IsNullOrEmpty() && !pathInfo.Type.IsNullOrEmpty() && body != null)
  34. return this.Raw.BulkPut<T>(pathInfo.Index,pathInfo.Type,body,u => pathInfo.RequestParameters);
  35. //PUT /{index}/_bulk
  36. if (!pathInfo.Index.IsNullOrEmpty() && body != null)
  37. return this.Raw.BulkPut<T>(pathInfo.Index,body,u => pathInfo.RequestParameters);
  38. //PUT /_bulk
  39. if (body != null)
  40. return this.Raw.BulkPut<T>(body,u => pathInfo.RequestParameters);
  41. break;
  42. }
  43. 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");
  44. }
  45. internal Task<ElasticsearchResponse<T>> BulkDispatchAsync<T>(ElasticsearchPathInfo<BulkRequestParameters> pathInfo , object body)
  46. {
  47. switch(pathInfo.HttpMethod)
  48. {
  49. case PathInfoHttpMethod.POST:
  50. //POST /{index}/{type}/_bulk
  51. if (!pathInfo.Index.IsNullOrEmpty() && !pathInfo.Type.IsNullOrEmpty() && body != null)
  52. return this.Raw.BulkAsync<T>(pathInfo.Index,pathInfo.Type,body,u => pathInfo.RequestParameters);
  53. //POST /{index}/_bulk
  54. if (!pathInfo.Index.IsNullOrEmpty() && body != null)
  55. return this.Raw.BulkAsync<T>(pathInfo.Index,body,u => pathInfo.RequestParameters);
  56. //POST /_bulk
  57. if (body != null)
  58. return this.Raw.BulkAsync<T>(body,u => pathInfo.RequestParameters);
  59. break;
  60. case PathInfoHttpMethod.PUT:
  61. //PUT /{index}/{type}/_bulk
  62. if (!pathInfo.Index.IsNullOrEmpty() && !pathInfo.Type.IsNullOrEmpty() && body != null)
  63. return this.Raw.BulkPutAsync<T>(pathInfo.Index,pathInfo.Type,body,u => pathInfo.RequestParameters);
  64. //PUT /{index}/_bulk
  65. if (!pathInfo.Index.IsNullOrEmpty() && body != null)
  66. return this.Raw.BulkPutAsync<T>(pathInfo.Index,body,u => pathInfo.RequestParameters);
  67. //PUT /_bulk
  68. if (body != null)
  69. return this.Raw.BulkPutAsync<T>(body,u => pathInfo.RequestParameters);
  70. break;
  71. }
  72. 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");
  73. }
  74. internal ElasticsearchResponse<T> CatAliasesDispatch<T>(ElasticsearchPathInfo<CatAliasesRequestParameters> pathInfo )
  75. {
  76. switch(pathInfo.HttpMethod)
  77. {
  78. case PathInfoHttpMethod.GET:
  79. //GET /_cat/aliases/{name}
  80. if (!pathInfo.Name.IsNullOrEmpty())
  81. return this.Raw.CatAliases<T>(pathInfo.Name,u => pathInfo.RequestParameters);
  82. //GET /_cat/aliases
  83. return this.Raw.CatAliases<T>(u => pathInfo.RequestParameters);
  84. }
  85. throw new DispatchException("Could not dispatch IElasticClient.CatAliases() into any of the following paths: \r\n - /_cat/aliases\r\n - /_cat/aliases/{name}");
  86. }
  87. internal Task<ElasticsearchResponse<T>> CatAliasesDispatchAsync<T>(ElasticsearchPathInfo<CatAliasesRequestParameters> pathInfo )
  88. {
  89. switch(pathInfo.HttpMethod)
  90. {
  91. case PathInfoHttpMethod.GET:
  92. //GET /_cat/aliases/{name}
  93. if (!pathInfo.Name.IsNullOrEmpty())
  94. return this.Raw.CatAliasesAsync<T>(pathInfo.Name,u => pathInfo.RequestParameters);
  95. //GET /_cat/aliases
  96. return this.Raw.CatAliasesAsync<T>(u => pathInfo.RequestParameters);
  97. }
  98. throw new DispatchException("Could not dispatch IElasticClient.CatAliases() into any of the following paths: \r\n - /_cat/aliases\r\n - /_cat/aliases/{name}");
  99. }
  100. internal ElasticsearchResponse<T> CatAllocationDispatch<T>(ElasticsearchPathInfo<CatAllocationRequestParameters> pathInfo )
  101. {
  102. switch(pathInfo.HttpMethod)
  103. {
  104. case PathInfoHttpMethod.GET:
  105. //GET /_cat/allocation/{node_id}
  106. if (!pathInfo.NodeId.IsNullOrEmpty())
  107. return this.Raw.CatAllocation<T>(pathInfo.NodeId,u => pathInfo.RequestParameters);
  108. //GET /_cat/allocation
  109. return this.Raw.CatAllocation<T>(u => pathInfo.RequestParameters);
  110. }
  111. throw new DispatchException("Could not dispatch IElasticClient.CatAllocation() into any of the following paths: \r\n - /_cat/allocation\r\n - /_cat/allocation/{node_id}");
  112. }
  113. internal Task<ElasticsearchResponse<T>> CatAllocationDispatchAsync<T>(ElasticsearchPathInfo<CatAllocationRequestParameters> pathInfo )
  114. {
  115. switch(pathInfo.HttpMethod)
  116. {
  117. case PathInfoHttpMethod.GET:
  118. //GET /_cat/allocation/{node_id}
  119. if (!pathInfo.NodeId.IsNullOrEmpty())
  120. return this.Raw.CatAllocationAsync<T>(pathInfo.NodeId,u => pathInfo.RequestParameters);
  121. //GET /_cat/allocation
  122. return this.Raw.CatAllocationAsync<T>(u => pathInfo.RequestParameters);
  123. }
  124. throw new DispatchException("Could not dispatch IElasticClient.CatAllocation() into any of the following paths: \r\n - /_cat/allocation\r\n - /_cat/allocation/{node_id}");
  125. }
  126. internal ElasticsearchResponse<T> CatCountDispatch<T>(ElasticsearchPathInfo<CatCountRequestParameters> pathInfo )
  127. {
  128. switch(pathInfo.HttpMethod)
  129. {
  130. case PathInfoHttpMethod.GET:
  131. //GET /_cat/count/{index}
  132. if (!pathInfo.Index.IsNullOrEmpty())
  133. return this.Raw.CatCount<T>(pathInfo.Index,u => pathInfo.RequestParameters);
  134. //GET /_cat/count
  135. return this.Raw.CatCount<T>(u => pathInfo.RequestParameters);
  136. }
  137. throw new DispatchException("Could not dispatch IElasticClient.CatCount() into any of the following paths: \r\n - /_cat/count\r\n - /_cat/count/{index}");
  138. }
  139. internal Task<ElasticsearchResponse<T>> CatCountDispatchAsync<T>(ElasticsearchPathInfo<CatCountRequestParameters> pathInfo )
  140. {
  141. switch(pathInfo.HttpMethod)
  142. {
  143. case PathInfoHttpMethod.GET:
  144. //GET /_cat/count/{index}
  145. if (!pathInfo.Index.IsNullOrEmpty())
  146. return this.Raw.CatCountAsync<T>(pathInfo.Index,u => pathInfo.RequestParameters);
  147. //GET /_cat/count
  148. return this.Raw.CatCountAsync<T>(u => pathInfo.RequestParameters);
  149. }
  150. throw new DispatchException("Could not dispatch IElasticClient.CatCount() into any of the following paths: \r\n - /_cat/count\r\n - /_cat/count/{index}");
  151. }
  152. internal ElasticsearchResponse<T> CatHealthDispatch<T>(ElasticsearchPathInfo<CatHealthRequestParameters> pathInfo )
  153. {
  154. switch(pathInfo.HttpMethod)
  155. {
  156. case PathInfoHttpMethod.GET:
  157. //GET /_cat/health
  158. return this.Raw.CatHealth<T>(u => pathInfo.RequestParameters);
  159. }
  160. throw new DispatchException("Could not dispatch IElasticClient.CatHealth() into any of the following paths: \r\n - /_cat/health");
  161. }
  162. internal Task<ElasticsearchResponse<T>> CatHealthDispatchAsync<T>(ElasticsearchPathInfo<CatHealthRequestParameters> pathInfo )
  163. {
  164. switch(pathInfo.HttpMethod)
  165. {
  166. case PathInfoHttpMethod.GET:
  167. //GET /_cat/health
  168. return this.Raw.CatHealthAsync<T>(u => pathInfo.RequestParameters);
  169. }
  170. throw new DispatchException("Could not dispatch IElasticClient.CatHealth() into any of the following paths: \r\n - /_cat/health");
  171. }
  172. internal ElasticsearchResponse<T> CatHelpDispatch<T>(ElasticsearchPathInfo<CatHelpRequestParameters> pathInfo )
  173. {
  174. switch(pathInfo.HttpMethod)
  175. {
  176. case PathInfoHttpMethod.GET:
  177. //GET /_cat
  178. return this.Raw.CatHelp<T>(u => pathInfo.RequestParameters);
  179. }
  180. throw new DispatchException("Could not dispatch IElasticClient.CatHelp() into any of the following paths: \r\n - /_cat");
  181. }
  182. internal Task<ElasticsearchResponse<T>> CatHelpDispatchAsync<T>(ElasticsearchPathInfo<CatHelpRequestParameters> pathInfo )
  183. {
  184. switch(pathInfo.HttpMethod)
  185. {
  186. case PathInfoHttpMethod.GET:
  187. //GET /_cat
  188. return this.Raw.CatHelpAsync<T>(u => pathInfo.RequestParameters);
  189. }
  190. throw new DispatchException("Could not dispatch IElasticClient.CatHelp() into any of the following paths: \r\n - /_cat");
  191. }
  192. internal ElasticsearchResponse<T> CatIndicesDispatch<T>(ElasticsearchPathInfo<CatIndicesRequestParameters> pathInfo )
  193. {
  194. switch(pathInfo.HttpMethod)
  195. {
  196. case PathInfoHttpMethod.GET:
  197. //GET /_cat/indices/{index}
  198. if (!pathInfo.Index.IsNullOrEmpty())
  199. return this.Raw.CatIndices<T>(pathInfo.Index,u => pathInfo.RequestParameters);
  200. //GET /_cat/indices
  201. return this.Raw.CatIndices<T>(u => pathInfo.RequestParameters);
  202. }
  203. throw new DispatchException("Could not dispatch IElasticClient.CatIndices() into any of the following paths: \r\n - /_cat/indices\r\n - /_cat/indices/{index}");
  204. }
  205. internal Task<ElasticsearchResponse<T>> CatIndicesDispatchAsync<T>(ElasticsearchPathInfo<CatIndicesRequestParameters> pathInfo )
  206. {
  207. switch(pathInfo.HttpMethod)
  208. {
  209. case PathInfoHttpMethod.GET:
  210. //GET /_cat/indices/{index}
  211. if (!pathInfo.Index.IsNullOrEmpty())
  212. return this.Raw.CatIndicesAsync<T>(pathInfo.Index,u => pathInfo.RequestParameters);
  213. //GET /_cat/indices
  214. return this.Raw.CatIndicesAsync<T>(u => pathInfo.RequestParameters);
  215. }
  216. throw new DispatchException("Could not dispatch IElasticClient.CatIndices() into any of the following paths: \r\n - /_cat/indices\r\n - /_cat/indices/{index}");
  217. }
  218. internal ElasticsearchResponse<T> CatMasterDispatch<T>(ElasticsearchPathInfo<CatMasterRequestParameters> pathInfo )
  219. {
  220. switch(pathInfo.HttpMethod)
  221. {
  222. case PathInfoHttpMethod.GET:
  223. //GET /_cat/master
  224. return this.Raw.CatMaster<T>(u => pathInfo.RequestParameters);
  225. }
  226. throw new DispatchException("Could not dispatch IElasticClient.CatMaster() into any of the following paths: \r\n - /_cat/master");
  227. }
  228. internal Task<ElasticsearchResponse<T>> CatMasterDispatchAsync<T>(ElasticsearchPathInfo<CatMasterRequestParameters> pathInfo )
  229. {
  230. switch(pathInfo.HttpMethod)
  231. {
  232. case PathInfoHttpMethod.GET:
  233. //GET /_cat/master
  234. return this.Raw.CatMasterAsync<T>(u => pathInfo.RequestParameters);
  235. }
  236. throw new DispatchException("Could not dispatch IElasticClient.CatMaster() into any of the following paths: \r\n - /_cat/master");
  237. }
  238. internal ElasticsearchResponse<T> CatNodesDispatch<T>(ElasticsearchPathInfo<CatNodesRequestParameters> pathInfo )
  239. {
  240. switch(pathInfo.HttpMethod)
  241. {
  242. case PathInfoHttpMethod.GET:
  243. //GET /_cat/nodes
  244. return this.Raw.CatNodes<T>(u => pathInfo.RequestParameters);
  245. }
  246. throw new DispatchException("Could not dispatch IElasticClient.CatNodes() into any of the following paths: \r\n - /_cat/nodes");
  247. }
  248. internal Task<ElasticsearchResponse<T>> CatNodesDispatchAsync<T>(ElasticsearchPathInfo<CatNodesRequestParameters> pathInfo )
  249. {
  250. switch(pathInfo.HttpMethod)
  251. {
  252. case PathInfoHttpMethod.GET:
  253. //GET /_cat/nodes
  254. return this.Raw.CatNodesAsync<T>(u => pathInfo.RequestParameters);
  255. }
  256. throw new DispatchException("Could not dispatch IElasticClient.CatNodes() into any of the following paths: \r\n - /_cat/nodes");
  257. }
  258. internal ElasticsearchResponse<T> CatPendingTasksDispatch<T>(ElasticsearchPathInfo<CatPendingTasksRequestParameters> pathInfo )
  259. {
  260. switch(pathInfo.HttpMethod)
  261. {
  262. case PathInfoHttpMethod.GET:
  263. //GET /_cat/pending_tasks
  264. return this.Raw.CatPendingTasks<T>(u => pathInfo.RequestParameters);
  265. }
  266. throw new DispatchException("Could not dispatch IElasticClient.CatPendingTasks() into any of the following paths: \r\n - /_cat/pending_tasks");
  267. }
  268. internal Task<ElasticsearchResponse<T>> CatPendingTasksDispatchAsync<T>(ElasticsearchPathInfo<CatPendingTasksRequestParameters> pathInfo )
  269. {
  270. switch(pathInfo.HttpMethod)
  271. {
  272. case PathInfoHttpMethod.GET:
  273. //GET /_cat/pending_tasks
  274. return this.Raw.CatPendingTasksAsync<T>(u => pathInfo.RequestParameters);
  275. }
  276. throw new DispatchException("Could not dispatch IElasticClient.CatPendingTasks() into any of the following paths: \r\n - /_cat/pending_tasks");
  277. }
  278. internal ElasticsearchResponse<T> CatPluginsDispatch<T>(ElasticsearchPathInfo<CatPluginsRequestParameters> pathInfo )
  279. {
  280. switch(pathInfo.HttpMethod)
  281. {
  282. case PathInfoHttpMethod.GET:
  283. //GET /_cat/plugins
  284. return this.Raw.CatPlugins<T>(u => pathInfo.RequestParameters);
  285. }
  286. throw new DispatchException("Could not dispatch IElasticClient.CatPlugins() into any of the following paths: \r\n - /_cat/plugins");
  287. }
  288. internal Task<ElasticsearchResponse<T>> CatPluginsDispatchAsync<T>(ElasticsearchPathInfo<CatPluginsRequestParameters> pathInfo )
  289. {
  290. switch(pathInfo.HttpMethod)
  291. {
  292. case PathInfoHttpMethod.GET:
  293. //GET /_cat/plugins
  294. return this.Raw.CatPluginsAsync<T>(u => pathInfo.RequestParameters);
  295. }
  296. throw new DispatchException("Could not dispatch IElasticClient.CatPlugins() into any of the following paths: \r\n - /_cat/plugins");
  297. }
  298. internal ElasticsearchResponse<T> CatRecoveryDispatch<T>(ElasticsearchPathInfo<CatRecoveryRequestParameters> pathInfo )
  299. {
  300. switch(pathInfo.HttpMethod)
  301. {
  302. case PathInfoHttpMethod.GET:
  303. //GET /_cat/recovery/{index}
  304. if (!pathInfo.Index.IsNullOrEmpty())
  305. return this.Raw.CatRecovery<T>(pathInfo.Index,u => pathInfo.RequestParameters);
  306. //GET /_cat/recovery
  307. return this.Raw.CatRecovery<T>(u => pathInfo.RequestParameters);
  308. }
  309. throw new DispatchException("Could not dispatch IElasticClient.CatRecovery() into any of the following paths: \r\n - /_cat/recovery\r\n - /_cat/recovery/{index}");
  310. }
  311. internal Task<ElasticsearchResponse<T>> CatRecoveryDispatchAsync<T>(ElasticsearchPathInfo<CatRecoveryRequestParameters> pathInfo )
  312. {
  313. switch(pathInfo.HttpMethod)
  314. {
  315. case PathInfoHttpMethod.GET:
  316. //GET /_cat/recovery/{index}
  317. if (!pathInfo.Index.IsNullOrEmpty())
  318. return this.Raw.CatRecoveryAsync<T>(pathInfo.Index,u => pathInfo.RequestParameters);
  319. //GET /_cat/recovery
  320. return this.Raw.CatRecoveryAsync<T>(u => pathInfo.RequestParameters);
  321. }
  322. throw new DispatchException("Could not dispatch IElasticClient.CatRecovery() into any of the following paths: \r\n - /_cat/recovery\r\n - /_cat/recovery/{index}");
  323. }
  324. internal ElasticsearchResponse<T> CatShardsDispatch<T>(ElasticsearchPathInfo<CatShardsRequestParameters> pathInfo )
  325. {
  326. switch(pathInfo.HttpMethod)
  327. {
  328. case PathInfoHttpMethod.GET:
  329. //GET /_cat/shards/{index}
  330. if (!pathInfo.Index.IsNullOrEmpty())
  331. return this.Raw.CatShards<T>(pathInfo.Index,u => pathInfo.RequestParameters);
  332. //GET /_cat/shards
  333. return this.Raw.CatShards<T>(u => pathInfo.RequestParameters);
  334. }
  335. throw new DispatchException("Could not dispatch IElasticClient.CatShards() into any of the following paths: \r\n - /_cat/shards\r\n - /_cat/shards/{index}");
  336. }
  337. internal Task<ElasticsearchResponse<T>> CatShardsDispatchAsync<T>(ElasticsearchPathInfo<CatShardsRequestParameters> pathInfo )
  338. {
  339. switch(pathInfo.HttpMethod)
  340. {
  341. case PathInfoHttpMethod.GET:
  342. //GET /_cat/shards/{index}
  343. if (!pathInfo.Index.IsNullOrEmpty())
  344. return this.Raw.CatShardsAsync<T>(pathInfo.Index,u => pathInfo.RequestParameters);
  345. //GET /_cat/shards
  346. return this.Raw.CatShardsAsync<T>(u => pathInfo.RequestParameters);
  347. }
  348. throw new DispatchException("Could not dispatch IElasticClient.CatShards() into any of the following paths: \r\n - /_cat/shards\r\n - /_cat/shards/{index}");
  349. }
  350. internal ElasticsearchResponse<T> CatThreadPoolDispatch<T>(ElasticsearchPathInfo<CatThreadPoolRequestParameters> pathInfo )
  351. {
  352. switch(pathInfo.HttpMethod)
  353. {
  354. case PathInfoHttpMethod.GET:
  355. //GET /_cat/thread_pool
  356. return this.Raw.CatThreadPool<T>(u => pathInfo.RequestParameters);
  357. }
  358. throw new DispatchException("Could not dispatch IElasticClient.CatThreadPool() into any of the following paths: \r\n - /_cat/thread_pool");
  359. }
  360. internal Task<ElasticsearchResponse<T>> CatThreadPoolDispatchAsync<T>(ElasticsearchPathInfo<CatThreadPoolRequestParameters> pathInfo )
  361. {
  362. switch(pathInfo.HttpMethod)
  363. {
  364. case PathInfoHttpMethod.GET:
  365. //GET /_cat/thread_pool
  366. return this.Raw.CatThreadPoolAsync<T>(u => pathInfo.RequestParameters);
  367. }
  368. throw new DispatchException("Could not dispatch IElasticClient.CatThreadPool() into any of the following paths: \r\n - /_cat/thread_pool");
  369. }
  370. internal ElasticsearchResponse<T> ClearScrollDispatch<T>(ElasticsearchPathInfo<ClearScrollRequestParameters> pathInfo )
  371. {
  372. switch(pathInfo.HttpMethod)
  373. {
  374. case PathInfoHttpMethod.DELETE:
  375. //DELETE /_search/scroll/{scroll_id}
  376. if (!pathInfo.ScrollId.IsNullOrEmpty())
  377. return this.Raw.ClearScroll<T>(pathInfo.ScrollId,u => pathInfo.RequestParameters);
  378. break;
  379. }
  380. throw new DispatchException("Could not dispatch IElasticClient.ClearScroll() into any of the following paths: \r\n - /_search/scroll/{scroll_id}");
  381. }
  382. internal Task<ElasticsearchResponse<T>> ClearScrollDispatchAsync<T>(ElasticsearchPathInfo<ClearScrollRequestParameters> pathInfo )
  383. {
  384. switch(pathInfo.HttpMethod)
  385. {
  386. case PathInfoHttpMethod.DELETE:
  387. //DELETE /_search/scroll/{scroll_id}
  388. if (!pathInfo.ScrollId.IsNullOrEmpty())
  389. return this.Raw.ClearScrollAsync<T>(pathInfo.ScrollId,u => pathInfo.RequestParameters);
  390. break;
  391. }
  392. throw new DispatchException("Could not dispatch IElasticClient.ClearScroll() into any of the following paths: \r\n - /_search/scroll/{scroll_id}");
  393. }
  394. internal ElasticsearchResponse<T> ClusterGetSettingsDispatch<T>(ElasticsearchPathInfo<ClusterGetSettingsRequestParameters> pathInfo )
  395. {
  396. switch(pathInfo.HttpMethod)
  397. {
  398. case PathInfoHttpMethod.GET:
  399. //GET /_cluster/settings
  400. return this.Raw.ClusterGetSettings<T>(u => pathInfo.RequestParameters);
  401. }
  402. throw new DispatchException("Could not dispatch IElasticClient.ClusterGetSettings() into any of the following paths: \r\n - /_cluster/settings");
  403. }
  404. internal Task<ElasticsearchResponse<T>> ClusterGetSettingsDispatchAsync<T>(ElasticsearchPathInfo<ClusterGetSettingsRequestParameters> pathInfo )
  405. {
  406. switch(pathInfo.HttpMethod)
  407. {
  408. case PathInfoHttpMethod.GET:
  409. //GET /_cluster/settings
  410. return this.Raw.ClusterGetSettingsAsync<T>(u => pathInfo.RequestParameters);
  411. }
  412. throw new DispatchException("Could not dispatch IElasticClient.ClusterGetSettings() into any of the following paths: \r\n - /_cluster/settings");
  413. }
  414. internal ElasticsearchResponse<T> ClusterHealthDispatch<T>(ElasticsearchPathInfo<ClusterHealthRequestParameters> pathInfo )
  415. {
  416. switch(pathInfo.HttpMethod)
  417. {
  418. case PathInfoHttpMethod.GET:
  419. //GET /_cluster/health/{index}
  420. if (!pathInfo.Index.IsNullOrEmpty())
  421. return this.Raw.ClusterHealth<T>(pathInfo.Index,u => pathInfo.RequestParameters);
  422. //GET /_cluster/health
  423. return this.Raw.ClusterHealth<T>(u => pathInfo.RequestParameters);
  424. }
  425. throw new DispatchException("Could not dispatch IElasticClient.ClusterHealth() into any of the following paths: \r\n - /_cluster/health\r\n - /_cluster/health/{index}");
  426. }
  427. internal Task<ElasticsearchResponse<T>> ClusterHealthDispatchAsync<T>(ElasticsearchPathInfo<ClusterHealthRequestParameters> pathInfo )
  428. {
  429. switch(pathInfo.HttpMethod)
  430. {
  431. case PathInfoHttpMethod.GET:
  432. //GET /_cluster/health/{index}
  433. if (!pathInfo.Index.IsNullOrEmpty())
  434. return this.Raw.ClusterHealthAsync<T>(pathInfo.Index,u => pathInfo.RequestParameters);
  435. //GET /_cluster/health
  436. return this.Raw.ClusterHealthAsync<T>(u => pathInfo.RequestParameters);
  437. }
  438. throw new DispatchException("Could not dispatch IElasticClient.ClusterHealth() into any of the following paths: \r\n - /_cluster/health\r\n - /_cluster/health/{index}");
  439. }
  440. internal ElasticsearchResponse<T> ClusterPendingTasksDispatch<T>(ElasticsearchPathInfo<ClusterPendingTasksRequestParameters> pathInfo )
  441. {
  442. switch(pathInfo.HttpMethod)
  443. {
  444. case PathInfoHttpMethod.GET:
  445. //GET /_cluster/pending_tasks
  446. return this.Raw.ClusterPendingTasks<T>(u => pathInfo.RequestParameters);
  447. }
  448. throw new DispatchException("Could not dispatch IElasticClient.ClusterPendingTasks() into any of the following paths: \r\n - /_cluster/pending_tasks");
  449. }
  450. internal Task<ElasticsearchResponse<T>> ClusterPendingTasksDispatchAsync<T>(ElasticsearchPathInfo<ClusterPendingTasksRequestParameters> pathInfo )
  451. {
  452. switch(pathInfo.HttpMethod)
  453. {
  454. case PathInfoHttpMethod.GET:
  455. //GET /_cluster/pending_tasks
  456. return this.Raw.ClusterPendingTasksAsync<T>(u => pathInfo.RequestParameters);
  457. }
  458. throw new DispatchException("Could not dispatch IElasticClient.ClusterPendingTasks() into any of the following paths: \r\n - /_cluster/pending_tasks");
  459. }
  460. internal ElasticsearchResponse<T> ClusterPutSettingsDispatch<T>(ElasticsearchPathInfo<ClusterPutSettingsRequestParameters> pathInfo , object body)
  461. {
  462. switch(pathInfo.HttpMethod)
  463. {
  464. case PathInfoHttpMethod.PUT:
  465. //PUT /_cluster/settings
  466. if (body != null)
  467. return this.Raw.ClusterPutSettings<T>(body,u => pathInfo.RequestParameters);
  468. break;
  469. }
  470. throw new DispatchException("Could not dispatch IElasticClient.ClusterPutSettings() into any of the following paths: \r\n - /_cluster/settings");
  471. }
  472. internal Task<ElasticsearchResponse<T>> ClusterPutSettingsDispatchAsync<T>(ElasticsearchPathInfo<ClusterPutSettingsRequestParameters> pathInfo , object body)
  473. {
  474. switch(pathInfo.HttpMethod)
  475. {
  476. case PathInfoHttpMethod.PUT:
  477. //PUT /_cluster/settings
  478. if (body != null)
  479. return this.Raw.ClusterPutSettingsAsync<T>(body,u => pathInfo.RequestParameters);
  480. break;
  481. }
  482. throw new DispatchException("Could not dispatch IElasticClient.ClusterPutSettings() into any of the following paths: \r\n - /_cluster/settings");
  483. }
  484. internal ElasticsearchResponse<T> ClusterRerouteDispatch<T>(ElasticsearchPathInfo<ClusterRerouteRequestParameters> pathInfo , object body)
  485. {
  486. switch(pathInfo.HttpMethod)
  487. {
  488. case PathInfoHttpMethod.POST:
  489. //POST /_cluster/reroute
  490. if (body != null)
  491. return this.Raw.ClusterReroute<T>(body,u => pathInfo.RequestParameters);
  492. break;
  493. }
  494. throw new DispatchException("Could not dispatch IElasticClient.ClusterReroute() into any of the following paths: \r\n - /_cluster/reroute");
  495. }
  496. internal Task<ElasticsearchResponse<T>> ClusterRerouteDispatchAsync<T>(ElasticsearchPathInfo<ClusterRerouteRequestParameters> pathInfo , object body)
  497. {
  498. switch(pathInfo.HttpMethod)
  499. {
  500. case PathInfoHttpMethod.POST:
  501. //POST /_cluster/reroute
  502. if (body != null)
  503. return this.Raw.ClusterRerouteAsync<T>(body,u => pathInfo.RequestParameters);
  504. break;
  505. }
  506. throw new DispatchException("Could not dispatch IElasticClient.ClusterReroute() into any of the following paths: \r\n - /_cluster/reroute");
  507. }
  508. internal ElasticsearchResponse<T> ClusterStateDispatch<T>(ElasticsearchPathInfo<ClusterStateRequestParameters> pathInfo )
  509. {
  510. switch(pathInfo.HttpMethod)
  511. {
  512. case PathInfoHttpMethod.GET:
  513. //GET /_cluster/state/{metric}/{index}
  514. if (!pathInfo.Metric.IsNullOrEmpty() && !pathInfo.Index.IsNullOrEmpty())
  515. return this.Raw.ClusterState<T>(pathInfo.Metric,pathInfo.Index,u => pathInfo.RequestParameters);
  516. //GET /_cluster/state/{metric}
  517. if (!pathInfo.Metric.IsNullOrEmpty())
  518. return this.Raw.ClusterState<T>(pathInfo.Metric,u => pathInfo.RequestParameters);
  519. //GET /_cluster/state
  520. return this.Raw.ClusterState<T>(u => pathInfo.RequestParameters);
  521. }
  522. 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}");
  523. }
  524. internal Task<ElasticsearchResponse<T>> ClusterStateDispatchAsync<T>(ElasticsearchPathInfo<ClusterStateRequestParameters> pathInfo )
  525. {
  526. switch(pathInfo.HttpMethod)
  527. {
  528. case PathInfoHttpMethod.GET:
  529. //GET /_cluster/state/{metric}/{index}
  530. if (!pathInfo.Metric.IsNullOrEmpty() && !pathInfo.Index.IsNullOrEmpty())
  531. return this.Raw.ClusterStateAsync<T>(pathInfo.Metric,pathInfo.Index,u => pathInfo.RequestParameters);
  532. //GET /_cluster/state/{metric}
  533. if (!pathInfo.Metric.IsNullOrEmpty())
  534. return this.Raw.ClusterStateAsync<T>(pathInfo.Metric,u => pathInfo.RequestParameters);
  535. //GET /_cluster/state
  536. return this.Raw.ClusterStateAsync<T>(u => pathInfo.RequestParameters);
  537. }
  538. 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}");
  539. }
  540. internal ElasticsearchResponse<T> ClusterStatsDispatch<T>(ElasticsearchPathInfo<ClusterStatsRequestParameters> pathInfo )
  541. {
  542. switch(pathInfo.HttpMethod)
  543. {
  544. case PathInfoHttpMethod.GET:
  545. //GET /_cluster/stats/nodes/{node_id}
  546. if (!pathInfo.NodeId.IsNullOrEmpty())
  547. return this.Raw.ClusterStats<T>(pathInfo.NodeId,u => pathInfo.RequestParameters);
  548. //GET /_cluster/stats
  549. return this.Raw.ClusterStats<T>(u => pathInfo.RequestParameters);
  550. }
  551. 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}");
  552. }
  553. internal Task<ElasticsearchResponse<T>> ClusterStatsDispatchAsync<T>(ElasticsearchPathInfo<ClusterStatsRequestParameters> pathInfo )
  554. {
  555. switch(pathInfo.HttpMethod)
  556. {
  557. case PathInfoHttpMethod.GET:
  558. //GET /_cluster/stats/nodes/{node_id}
  559. if (!pathInfo.NodeId.IsNullOrEmpty())
  560. return this.Raw.ClusterStatsAsync<T>(pathInfo.NodeId,u => pathInfo.RequestParameters);
  561. //GET /_cluster/stats
  562. return this.Raw.ClusterStatsAsync<T>(u => pathInfo.RequestParameters);
  563. }
  564. 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}");
  565. }
  566. internal ElasticsearchResponse<T> CountDispatch<T>(ElasticsearchPathInfo<CountRequestParameters> pathInfo , object body)
  567. {
  568. switch(pathInfo.HttpMethod)
  569. {
  570. case PathInfoHttpMethod.POST:
  571. //POST /{index}/{type}/_count
  572. if (!pathInfo.Index.IsNullOrEmpty() && !pathInfo.Type.IsNullOrEmpty() && body != null)
  573. return this.Raw.Count<T>(pathInfo.Index,pathInfo.Type,body,u => pathInfo.RequestParameters);
  574. //POST /{index}/_count
  575. if (!pathInfo.Index.IsNullOrEmpty() && body != null)
  576. return this.Raw.Count<T>(pathInfo.Index,body,u => pathInfo.RequestParameters);
  577. //POST /_count
  578. if (body != null)
  579. return this.Raw.Count<T>(body,u => pathInfo.RequestParameters);
  580. break;
  581. case PathInfoHttpMethod.GET:
  582. //GET /{index}/{type}/_count
  583. if (!pathInfo.Index.IsNullOrEmpty() && !pathInfo.Type.IsNullOrEmpty())
  584. return this.Raw.CountGet<T>(pathInfo.Index,pathInfo.Type,u => pathInfo.RequestParameters);
  585. //GET /{index}/_count
  586. if (!pathInfo.Index.IsNullOrEmpty())
  587. return this.Raw.CountGet<T>(pathInfo.Index,u => pathInfo.RequestParameters);
  588. //GET /_count
  589. return this.Raw.CountGet<T>(u => pathInfo.RequestParameters);
  590. }
  591. 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");
  592. }
  593. internal Task<ElasticsearchResponse<T>> CountDispatchAsync<T>(ElasticsearchPathInfo<CountRequestParameters> pathInfo , object body)
  594. {
  595. switch(pathInfo.HttpMethod)
  596. {
  597. case PathInfoHttpMethod.POST:
  598. //POST /{index}/{type}/_count
  599. if (!pathInfo.Index.IsNullOrEmpty() && !pathInfo.Type.IsNullOrEmpty() && body != null)
  600. return this.Raw.CountAsync<T>(pathInfo.Index,pathInfo.Type,body,u => pathInfo.RequestParameters);
  601. //POST /{index}/_count
  602. if (!pathInfo.Index.IsNullOrEmpty() && body != null)
  603. return this.Raw.CountAsync<T>(pathInfo.Index,body,u => pathInfo.RequestParameters);
  604. //POST /_count
  605. if (body != null)
  606. return this.Raw.CountAsync<T>(body,u => pathInfo.RequestParameters);
  607. break;
  608. case PathInfoHttpMethod.GET:
  609. //GET /{index}/{type}/_count
  610. if (!pathInfo.Index.IsNullOrEmpty() && !pathInfo.Type.IsNullOrEmpty())
  611. return this.Raw.CountGetAsync<T>(pathInfo.Index,pathInfo.Type,u => pathInfo.RequestParameters);
  612. //GET /{index}/_count
  613. if (!pathInfo.Index.IsNullOrEmpty())
  614. return this.Raw.CountGetAsync<T>(pathInfo.Index,u => pathInfo.RequestParameters);
  615. //GET /_count
  616. return this.Raw.CountGetAsync<T>(u => pathInfo.RequestParameters);
  617. }
  618. 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");
  619. }
  620. internal ElasticsearchResponse<T> CountPercolateDispatch<T>(ElasticsearchPathInfo<PercolateCountRequestParameters> pathInfo , object body)
  621. {
  622. switch(pathInfo.HttpMethod)
  623. {
  624. case PathInfoHttpMethod.GET:
  625. //GET /{index}/{type}/{id}/_percolate/count
  626. if (!pathInfo.Index.IsNullOrEmpty() && !pathInfo.Type.IsNullOrEmpty() && !pathInfo.Id.IsNullOrEmpty())
  627. return this.Raw.CountPercolateGet<T>(pathInfo.Index,pathInfo.Type,pathInfo.Id,u => pathInfo.RequestParameters);
  628. //GET /{index}/{type}/_percolate/count
  629. if (!pathInfo.Index.IsNullOrEmpty() && !pathInfo.Type.IsNullOrEmpty())
  630. return this.Raw.CountPercolateGet<T>(pathInfo.Index,pathInfo.Type,u => pathInfo.RequestParameters);
  631. break;
  632. case PathInfoHttpMethod.POST:
  633. //POST /{index}/{type}/{id}/_percolate/count
  634. if (!pathInfo.Index.IsNullOrEmpty() && !pathInfo.Type.IsNullOrEmpty() && !pathInfo.Id.IsNullOrEmpty() && body != null)
  635. return this.Raw.CountPercolate<T>(pathInfo.Index,pathInfo.Type,pathInfo.Id,body,u => pathInfo.RequestParameters);
  636. //POST /{index}/{type}/_percolate/count
  637. if (!pathInfo.Index.IsNullOrEmpty() && !pathInfo.Type.IsNullOrEmpty() && body != null)
  638. return this.Raw.CountPercolate<T>(pathInfo.Index,pathInfo.Type,body,u => pathInfo.RequestParameters);
  639. break;
  640. }
  641. 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");
  642. }
  643. internal Task<ElasticsearchResponse<T>> CountPercolateDispatchAsync<T>(ElasticsearchPathInfo<PercolateCountRequestParameters> pathInfo , object body)
  644. {
  645. switch(pathInfo.HttpMethod)
  646. {
  647. case PathInfoHttpMethod.GET:
  648. //GET /{index}/{type}/{id}/_percolate/count
  649. if (!pathInfo.Index.IsNullOrEmpty() && !pathInfo.Type.IsNullOrEmpty() && !pathInfo.Id.IsNullOrEmpty())
  650. return this.Raw.CountPercolateGetAsync<T>(pathInfo.Index,pathInfo.Type,pathInfo.Id,u => pathInfo.RequestParameters);
  651. //GET /{index}/{type}/_percolate/count
  652. if (!pathInfo.Index.IsNullOrEmpty() && !pathInfo.Type.IsNullOrEmpty())
  653. return this.Raw.CountPercolateGetAsync<T>(pathInfo.Index,pathInfo.Type,u => pathInfo.RequestParameters);
  654. break;
  655. case PathInfoHttpMethod.POST:
  656. //POST /{index}/{type}/{id}/_percolate/count
  657. if (!pathInfo.Index.IsNullOrEmpty() && !pathInfo.Type.IsNullOrEmpty() && !pathInfo.Id.IsNullOrEmpty() && body != null)
  658. return this.Raw.CountPercolateAsync<T>(pathInfo.Index,pathInfo.Type,pathInfo.Id,body,u => pathInfo.RequestParameters);
  659. //POST /{index}/{type}/_percolate/count
  660. if (!pathInfo.Index.IsNullOrEmpty() && !pathInfo.Type.IsNullOrEmpty() && body != null)
  661. return this.Raw.CountPercolateAsync<T>(pathInfo.Index,pathInfo.Type,body,u => pathInfo.RequestParameters);
  662. break;
  663. }
  664. 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");
  665. }
  666. internal ElasticsearchResponse<T> DeleteDispatch<T>(ElasticsearchPathInfo<DeleteRequestParameters> pathInfo )
  667. {
  668. switch(pathInfo.HttpMethod)
  669. {
  670. case PathInfoHttpMethod.DELETE:
  671. //DELETE /{index}/{type}/{id}
  672. if (!pathInfo.Index.IsNullOrEmpty() && !pathInfo.Type.IsNullOrEmpty() && !pathInfo.Id.IsNullOrEmpty())
  673. return this.Raw.Delete<T>(pathInfo.Index,pathInfo.Type,pathInfo.Id,u => pathInfo.RequestParameters);
  674. break;
  675. }
  676. throw new DispatchException("Could not dispatch IElasticClient.Delete() into any of the following paths: \r\n - /{index}/{type}/{id}");
  677. }
  678. internal Task<ElasticsearchResponse<T>> DeleteDispatchAsync<T>(ElasticsearchPathInfo<DeleteRequestParameters> pathInfo )
  679. {
  680. switch(pathInfo.HttpMethod)
  681. {
  682. case PathInfoHttpMethod.DELETE:
  683. //DELETE /{index}/{type}/{id}
  684. if (!pathInfo.Index.IsNullOrEmpty() && !pathInfo.Type.IsNullOrEmpty() && !pathInfo.Id.IsNullOrEmpty())
  685. return this.Raw.DeleteAsync<T>(pathInfo.Index,pathInfo.Type,pathInfo.Id,u => pathInfo.RequestParameters);
  686. break;
  687. }
  688. throw new DispatchException("Could not dispatch IElasticClient.Delete() into any of the following paths: \r\n - /{index}/{type}/{id}");
  689. }
  690. internal ElasticsearchResponse<T> DeleteByQueryDispatch<T>(ElasticsearchPathInfo<DeleteByQueryRequestParameters> pathInfo , object body)
  691. {
  692. switch(pathInfo.HttpMethod)
  693. {
  694. case PathInfoHttpMethod.DELETE:
  695. //DELETE /{index}/{type}/_query
  696. if (!pathInfo.Index.IsNullOrEmpty() && !pathInfo.Type.IsNullOrEmpty() && body != null)
  697. return this.Raw.DeleteByQuery<T>(pathInfo.Index,pathInfo.Type,body,u => pathInfo.RequestParameters);
  698. //DELETE /{index}/_query
  699. if (!pathInfo.Index.IsNullOrEmpty() && body != null)
  700. return this.Raw.DeleteByQuery<T>(pathInfo.Index,body,u => pathInfo.RequestParameters);
  701. break;
  702. }
  703. throw new DispatchException("Could not dispatch IElasticClient.DeleteByQuery() into any of the following paths: \r\n - /{index}/_query\r\n - /{index}/{type}/_query");
  704. }
  705. internal Task<ElasticsearchResponse<T>> DeleteByQueryDispatchAsync<T>(ElasticsearchPathInfo<DeleteByQueryRequestParameters> pathInfo , object body)
  706. {
  707. switch(pathInfo.HttpMethod)
  708. {
  709. case PathInfoHttpMethod.DELETE:
  710. //DELETE /{index}/{type}/_query
  711. if (!pathInfo.Index.IsNullOrEmpty() && !pathInfo.Type.IsNullOrEmpty() && body != null)
  712. return this.Raw.DeleteByQueryAsync<T>(pathInfo.Index,pathInfo.Type,body,u => pathInfo.RequestParameters);
  713. //DELETE /{index}/_query
  714. if (!pathInfo.Index.IsNullOrEmpty() && body != null)
  715. return this.Raw.DeleteByQueryAsync<T>(pathInfo.Index,body,u => pathInfo.RequestParameters);
  716. break;
  717. }
  718. throw new DispatchException("Could not dispatch IElasticClient.DeleteByQuery() into any of the following paths: \r\n - /{index}/_query\r\n - /{index}/{type}/_query");
  719. }
  720. internal ElasticsearchResponse<T> ExistsDispatch<T>(ElasticsearchPathInfo<DocumentExistsRequestParameters> pathInfo )
  721. {
  722. switch(pathInfo.HttpMethod)
  723. {
  724. case PathInfoHttpMethod.HEAD:
  725. //HEAD /{index}/{type}/{id}
  726. if (!pathInfo.Index.IsNullOrEmpty() && !pathInfo.Type.IsNullOrEmpty() && !pathInfo.Id.IsNullOrEmpty())
  727. return this.Raw.Exists<T>(pathInfo.Index,pathInfo.Type,pathInfo.Id,u => pathInfo.RequestParameters);
  728. break;
  729. }
  730. throw new DispatchException("Could not dispatch IElasticClient.Exists() into any of the following paths: \r\n - /{index}/{type}/{id}");
  731. }
  732. internal Task<ElasticsearchResponse<T>> ExistsDispatchAsync<T>(ElasticsearchPathInfo<DocumentExistsRequestParameters> pathInfo )
  733. {
  734. switch(pathInfo.HttpMethod)
  735. {
  736. case PathInfoHttpMethod.HEAD:
  737. //HEAD /{index}/{type}/{id}
  738. if (!pathInfo.Index.IsNullOrEmpty() && !pathInfo.Type.IsNullOrEmpty() && !pathInfo.Id.IsNullOrEmpty())
  739. return this.Raw.ExistsAsync<T>(pathInfo.Index,pathInfo.Type,pathInfo.Id,u => pathInfo.RequestParameters);
  740. break;
  741. }
  742. throw new DispatchException("Could not dispatch IElasticClient.Exists() into any of the following paths: \r\n - /{index}/{type}/{id}");
  743. }
  744. internal ElasticsearchResponse<T> ExplainDispatch<T>(ElasticsearchPathInfo<ExplainRequestParameters> pathInfo , object body)
  745. {
  746. switch(pathInfo.HttpMethod)
  747. {
  748. case PathInfoHttpMethod.GET:
  749. //GET /{index}/{type}/{id}/_explain
  750. if (!pathInfo.Index.IsNullOrEmpty() && !pathInfo.Type.IsNullOrEmpty() && !pathInfo.Id.IsNullOrEmpty())
  751. return this.Raw.ExplainGet<T>(pathInfo.Index,pathInfo.Type,pathInfo.Id,u => pathInfo.RequestParameters);
  752. break;
  753. case PathInfoHttpMethod.POST:
  754. //POST /{index}/{type}/{id}/_explain
  755. if (!pathInfo.Index.IsNullOrEmpty() && !pathInfo.Type.IsNullOrEmpty() && !pathInfo.Id.IsNullOrEmpty() && body != null)
  756. return this.Raw.Explain<T>(pathInfo.Index,pathInfo.Type,pathInfo.Id,body,u => pathInfo.RequestParameters);
  757. break;
  758. }
  759. throw new DispatchException("Could not dispatch IElasticClient.Explain() into any of the following paths: \r\n - /{index}/{type}/{id}/_explain");
  760. }
  761. internal Task<ElasticsearchResponse<T>> ExplainDispatchAsync<T>(ElasticsearchPathInfo<ExplainRequestParameters> pathInfo , object body)
  762. {
  763. switch(pathInfo.HttpMethod)
  764. {
  765. case PathInfoHttpMethod.GET:
  766. //GET /{index}/{type}/{id}/_explain
  767. if (!pathInfo.Index.IsNullOrEmpty() && !pathInfo.Type.IsNullOrEmpty() && !pathInfo.Id.IsNullOrEmpty())
  768. return this.Raw.ExplainGetAsync<T>(pathInfo.Index,pathInfo.Type,pathInfo.Id,u => pathInfo.RequestParameters);
  769. break;
  770. case PathInfoHttpMethod.POST:
  771. //POST /{index}/{type}/{id}/_explain
  772. if (!pathInfo.Index.IsNullOrEmpty() && !pathInfo.Type.IsNullOrEmpty() && !pathInfo.Id.IsNullOrEmpty() && body != null)
  773. return this.Raw.ExplainAsync<T>(pathInfo.Index,pathInfo.Type,pathInfo.Id,body,u => pathInfo.RequestParameters);
  774. break;
  775. }
  776. throw new DispatchException("Could not dispatch IElasticClient.Explain() into any of the following paths: \r\n - /{index}/{type}/{id}/_explain");
  777. }
  778. internal ElasticsearchResponse<T> GetDispatch<T>(ElasticsearchPathInfo<GetRequestParameters> pathInfo )
  779. {
  780. switch(pathInfo.HttpMethod)
  781. {
  782. case PathInfoHttpMethod.GET:
  783. //GET /{index}/{type}/{id}
  784. if (!pathInfo.Index.IsNullOrEmpty() && !pathInfo.Type.IsNullOrEmpty() && !pathInfo.Id.IsNullOrEmpty())
  785. return this.Raw.Get<T>(pathInfo.Index,pathInfo.Type,pathInfo.Id,u => pathInfo.RequestParameters);
  786. break;
  787. }
  788. throw new DispatchException("Could not dispatch IElasticClient.Get() into any of the following paths: \r\n - /{index}/{type}/{id}");
  789. }
  790. internal Task<ElasticsearchResponse<T>> GetDispatchAsync<T>(ElasticsearchPathInfo<GetRequestParameters> pathInfo )
  791. {
  792. switch(pathInfo.HttpMethod)
  793. {
  794. case PathInfoHttpMethod.GET:
  795. //GET /{index}/{type}/{id}
  796. if (!pathInfo.Index.IsNullOrEmpty() && !pathInfo.Type.IsNullOrEmpty() && !pathInfo.Id.IsNullOrEmpty())
  797. return this.Raw.GetAsync<T>(pathInfo.Index,pathInfo.Type,pathInfo.Id,u => pathInfo.RequestParameters);
  798. break;
  799. }
  800. throw new DispatchException("Could not dispatch IElasticClient.Get() into any of the following paths: \r\n - /{index}/{type}/{id}");
  801. }
  802. internal ElasticsearchResponse<T> GetSourceDispatch<T>(ElasticsearchPathInfo<SourceRequestParameters> pathInfo )
  803. {
  804. switch(pathInfo.HttpMethod)
  805. {
  806. case PathInfoHttpMethod.GET:
  807. //GET /{index}/{type}/{id}/_source
  808. if (!pathInfo.Index.IsNullOrEmpty() && !pathInfo.Type.IsNullOrEmpty() && !pathInfo.Id.IsNullOrEmpty())
  809. return this.Raw.GetSource<T>(pathInfo.Index,pathInfo.Type,pathInfo.Id,u => pathInfo.RequestParameters);
  810. break;
  811. }
  812. throw new DispatchException("Could not dispatch IElasticClient.GetSource() into any of the following paths: \r\n - /{index}/{type}/{id}/_source");
  813. }
  814. internal Task<ElasticsearchResponse<T>> GetSourceDispatchAsync<T>(ElasticsearchPathInfo<SourceRequestParameters> pathInfo )
  815. {
  816. switch(pathInfo.HttpMethod)
  817. {
  818. case PathInfoHttpMethod.GET:
  819. //GET /{index}/{type}/{id}/_source
  820. if (!pathInfo.Index.IsNullOrEmpty() && !pathInfo.Type.IsNullOrEmpty() && !pathInfo.Id.IsNullOrEmpty())
  821. return this.Raw.GetSourceAsync<T>(pathInfo.Index,pathInfo.Type,pathInfo.Id,u => pathInfo.RequestParameters);
  822. break;
  823. }
  824. throw new DispatchException("Could not dispatch IElasticClient.GetSource() into any of the following paths: \r\n - /{index}/{type}/{id}/_source");
  825. }
  826. internal ElasticsearchResponse<T> IndexDispatch<T>(ElasticsearchPathInfo<IndexRequestParameters> pathInfo , object body)
  827. {
  828. switch(pathInfo.HttpMethod)
  829. {
  830. case PathInfoHttpMethod.POST:
  831. //POST /{index}/{type}/{id}
  832. if (!pathInfo.Index.IsNullOrEmpty() && !pathInfo.Type.IsNullOrEmpty() && !pathInfo.Id.IsNullOrEmpty() && body != null)
  833. return this.Raw.Index<T>(pathInfo.Index,pathInfo.Type,pathInfo.Id,body,u => pathInfo.RequestParameters);
  834. //POST /{index}/{type}
  835. if (!pathInfo.Index.IsNullOrEmpty() && !pathInfo.Type.IsNullOrEmpty() && body != null)
  836. return this.Raw.Index<T>(pathInfo.Index,pathInfo.Type,body,u => pathInfo.RequestParameters);
  837. break;
  838. case PathInfoHttpMethod.PUT:
  839. //PUT /{index}/{type}/{id}
  840. if (!pathInfo.Index.IsNullOrEmpty() && !pathInfo.Type.IsNullOrEmpty() && !pathInfo.Id.IsNullOrEmpty() && body != null)
  841. return this.Raw.IndexPut<T>(pathInfo.Index,pathInfo.Type,pathInfo.Id,body,u => pathInfo.RequestParameters);
  842. //PUT /{index}/{type}
  843. if (!pathInfo.Index.IsNullOrEmpty() && !pathInfo.Type.IsNullOrEmpty() && body != null)
  844. return this.Raw.IndexPut<T>(pathInfo.Index,pathInfo.Type,body,u => pathInfo.RequestParameters);
  845. break;
  846. }
  847. throw new DispatchException("Could not dispatch IElasticClient.Index() into any of the following paths: \r\n - /{index}/{type}\r\n - /{index}/{type}/{id}");
  848. }
  849. internal Task<ElasticsearchResponse<T>> IndexDispatchAsync<T>(ElasticsearchPathInfo<IndexRequestParameters> pathInfo , object body)
  850. {
  851. switch(pathInfo.HttpMethod)
  852. {
  853. case PathInfoHttpMethod.POST:
  854. //POST /{index}/{type}/{id}
  855. if (!pathInfo.Index.IsNullOrEmpty() && !pathInfo.Type.IsNullOrEmpty() && !pathInfo.Id.IsNullOrEmpty() && body != null)
  856. return this.Raw.IndexAsync<T>(pathInfo.Index,pathInfo.Type,pathInfo.Id,body,u => pathInfo.RequestParameters);
  857. //POST /{index}/{type}
  858. if (!pathInfo.Index.IsNullOrEmpty() && !pathInfo.Type.IsNullOrEmpty() && body != null)
  859. return this.Raw.IndexAsync<T>(pathInfo.Index,pathInfo.Type,body,u => pathInfo.RequestParameters);
  860. break;
  861. case PathInfoHttpMethod.PUT:
  862. //PUT /{index}/{type}/{id}
  863. if (!pathInfo.Index.IsNullOrEmpty() && !pathInfo.Type.IsNullOrEmpty() && !pathInfo.Id.IsNullOrEmpty() && body != null)
  864. return this.Raw.IndexPutAsync<T>(pathInfo.Index,pathInfo.Type,pathInfo.Id,body,u => pathInfo.RequestParameters);
  865. //PUT /{index}/{type}
  866. if (!pathInfo.Index.IsNullOrEmpty() && !pathInfo.Type.IsNullOrEmpty() && body != null)
  867. return this.Raw.IndexPutAsync<T>(pathInfo.Index,pathInfo.Type,body,u => pathInfo.RequestParameters);
  868. break;
  869. }
  870. throw new DispatchException("Could not dispatch IElasticClient.Index() into any of the following paths: \r\n - /{index}/{type}\r\n - /{index}/{type}/{id}");
  871. }
  872. internal ElasticsearchResponse<T> IndicesAnalyzeDispatch<T>(ElasticsearchPathInfo<AnalyzeRequestParameters> pathInfo , object body)
  873. {
  874. switch(pathInfo.HttpMethod)
  875. {
  876. case PathInfoHttpMethod.GET:
  877. //GET /{index}/_analyze
  878. if (!pathInfo.Index.IsNullOrEmpty())
  879. return this.Raw.IndicesAnalyzeGet<T>(pathInfo.Index,u => pathInfo.RequestParameters);
  880. //GET /_analyze
  881. return this.Raw.IndicesAnalyzeGetForAll<T>(u => pathInfo.RequestParameters);
  882. case PathInfoHttpMethod.POST:
  883. //POST /{index}/_analyze
  884. if (!pathInfo.Index.IsNullOrEmpty() && body != null)
  885. return this.Raw.IndicesAnalyze<T>(pathInfo.Index,body,u => pathInfo.RequestParameters);
  886. //POST /_analyze
  887. if (body != null)
  888. return this.Raw.IndicesAnalyzeForAll<T>(body,u => pathInfo.RequestParameters);
  889. break;
  890. }
  891. throw new DispatchException("Could not dispatch IElasticClient.IndicesAnalyze() into any of the following paths: \r\n - /_analyze\r\n - /{index}/_analyze");
  892. }
  893. internal Task<ElasticsearchResponse<T>> IndicesAnalyzeDispatchAsync<T>(ElasticsearchPathInfo<AnalyzeRequestParameters> pathInfo , object body)
  894. {
  895. switch(pathInfo.HttpMethod)
  896. {
  897. case PathInfoHttpMethod.GET:
  898. //GET /{index}/_analyze
  899. if (!pathInfo.Index.IsNullOrEmpty())
  900. return this.Raw.IndicesAnalyzeGetAsync<T>(pathInfo.Index,u => pathInfo.RequestParameters);
  901. //GET /_analyze
  902. return this.Raw.IndicesAnalyzeGetForAllAsync<T>(u => pathInfo.RequestParameters);
  903. case PathInfoHttpMethod.POST:
  904. //POST /{index}/_analyze
  905. if (!pathInfo.Index.IsNullOrEmpty() && body != null)
  906. return this.Raw.IndicesAnalyzeAsync<T>(pathInfo.Index,body,u => pathInfo.RequestParameters);
  907. //POST /_analyze
  908. if (body != null)
  909. return this.Raw.IndicesAnalyzeForAllAsync<T>(body,u => pathInfo.RequestParameters);
  910. break;
  911. }
  912. throw new DispatchException("Could not dispatch IElasticClient.IndicesAnalyze() into any of the following paths: \r\n - /_analyze\r\n - /{index}/_analyze");
  913. }
  914. internal ElasticsearchResponse<T> IndicesClearCacheDispatch<T>(ElasticsearchPathInfo<ClearCacheRequestParameters> pathInfo )
  915. {
  916. switch(pathInfo.HttpMethod)
  917. {
  918. case PathInfoHttpMethod.POST:
  919. //POST /{index}/_cache/clear
  920. if (!pathInfo.Index.IsNullOrEmpty())
  921. return this.Raw.IndicesClearCache<T>(pathInfo.Index,u => pathInfo.RequestParameters);
  922. //POST /_cache/clear
  923. return this.Raw.IndicesClearCacheForAll<T>(u => pathInfo.RequestParameters);
  924. case PathInfoHttpMethod.GET:
  925. //GET /{index}/_cache/clear
  926. if (!pathInfo.Index.IsNullOrEmpty())
  927. return this.Raw.IndicesClearCacheGet<T>(pathInfo.Index,u => pathInfo.RequestParameters);
  928. //GET /_cache/clear
  929. return this.Raw.IndicesClearCacheGetForAll<T>(u => pathInfo.RequestParameters);
  930. }
  931. throw new DispatchException("Could not dispatch IElasticClient.IndicesClearCache() into any of the following paths: \r\n - /_cache/clear\r\n - /{index}/_cache/clear");
  932. }
  933. internal Task<ElasticsearchResponse<T>> IndicesClearCacheDispatchAsync<T>(ElasticsearchPathInfo<ClearCacheRequestParameters> pathInfo )
  934. {
  935. switch(pathInfo.HttpMethod)
  936. {
  937. case PathInfoHttpMethod.POST:
  938. //POST /{index}/_cache/clear
  939. if (!pathInfo.Index.IsNullOrEmpty())
  940. return this.Raw.IndicesClearCacheAsync<T>(pathInfo.Index,u => pathInfo.RequestParameters);
  941. //POST /_cache/clear
  942. return this.Raw.IndicesClearCacheForAllAsync<T>(u => pathInfo.RequestParameters);
  943. case PathInfoHttpMethod.GET:
  944. //GET /{index}/_cache/clear
  945. if (!pathInfo.Index.IsNullOrEmpty())
  946. return this.Raw.IndicesClearCacheGetAsync<T>(pathInfo.Index,u => pathInfo.RequestParameters);
  947. //GET /_cache/clear
  948. return this.Raw.IndicesClearCacheGetForAllAsync<T>(u => pathInfo.RequestParameters);
  949. }
  950. throw new DispatchException("Could not dispatch IElasticClient.IndicesClearCache() into any of the following paths: \r\n - /_cache/clear\r\n - /{index}/_cache/clear");
  951. }
  952. internal ElasticsearchResponse<T> IndicesCloseDispatch<T>(ElasticsearchPathInfo<CloseIndexRequestParameters> pathInfo )
  953. {
  954. switch(pathInfo.HttpMethod)
  955. {
  956. case PathInfoHttpMethod.POST:
  957. //POST /{index}/_close
  958. if (!pathInfo.Index.IsNullOrEmpty())
  959. return this.Raw.IndicesClose<T>(pathInfo.Index,u => pathInfo.RequestParameters);
  960. break;
  961. }
  962. throw new DispatchException("Could not dispatch IElasticClient.IndicesClose() into any of the following paths: \r\n - /{index}/_close");
  963. }
  964. internal Task<ElasticsearchResponse<T>> IndicesCloseDispatchAsync<T>(ElasticsearchPathInfo<CloseIndexRequestParameters> pathInfo )
  965. {
  966. switch(pathInfo.HttpMethod)
  967. {
  968. case PathInfoHttpMethod.POST:
  969. //POST /{index}/_close
  970. if (!pathInfo.Index.IsNullOrEmpty())
  971. return this.Raw.IndicesCloseAsync<T>(pathInfo.Index,u => pathInfo.RequestParameters);
  972. break;
  973. }
  974. throw new DispatchException("Could not dispatch IElasticClient.IndicesClose() into any of the following paths: \r\n - /{index}/_close");
  975. }
  976. internal ElasticsearchResponse<T> IndicesCreateDispatch<T>(ElasticsearchPathInfo<CreateIndexRequestParameters> pathInfo , object body)
  977. {
  978. switch(pathInfo.HttpMethod)
  979. {
  980. case PathInfoHttpMethod.PUT:
  981. //PUT /{index}
  982. if (!pathInfo.Index.IsNullOrEmpty() && body != null)
  983. return this.Raw.IndicesCreate<T>(pathInfo.Index,body,u => pathInfo.RequestParameters);
  984. break;
  985. case PathInfoHttpMethod.POST:
  986. //POST /{index}
  987. if (!pathInfo.Index.IsNullOrEmpty() && body != null)
  988. 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