PageRenderTime 78ms CodeModel.GetById 28ms RepoModel.GetById 1ms 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
  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.RequestParameters);
  989. break;
  990. }
  991. throw new DispatchException("Could not dispatch IElasticClient.IndicesCreate() into any of the following paths: \r\n - /{index}");
  992. }
  993. internal Task<ElasticsearchResponse<T>> IndicesCreateDispatchAsync<T>(ElasticsearchPathInfo<CreateIndexRequestParameters> pathInfo , object body)
  994. {
  995. switch(pathInfo.HttpMethod)
  996. {
  997. case PathInfoHttpMethod.PUT:
  998. //PUT /{index}
  999. if (!pathInfo.Index.IsNullOrEmpty() && body != null)
  1000. return this.Raw.IndicesCreateAsync<T>(pathInfo.Index,body,u => pathInfo.RequestParameters);
  1001. break;
  1002. case PathInfoHttpMethod.POST:
  1003. //POST /{index}
  1004. if (!pathInfo.Index.IsNullOrEmpty() && body != null)
  1005. return this.Raw.IndicesCreatePostAsync<T>(pathInfo.Index,body,u => pathInfo.RequestParameters);
  1006. break;
  1007. }
  1008. throw new DispatchException("Could not dispatch IElasticClient.IndicesCreate() into any of the following paths: \r\n - /{index}");
  1009. }
  1010. internal ElasticsearchResponse<T> IndicesDeleteDispatch<T>(ElasticsearchPathInfo<DeleteIndexRequestParameters> pathInfo )
  1011. {
  1012. switch(pathInfo.HttpMethod)
  1013. {
  1014. case PathInfoHttpMethod.DELETE:
  1015. //DELETE /{index}
  1016. if (!pathInfo.Index.IsNullOrEmpty())
  1017. return this.Raw.IndicesDelete<T>(pathInfo.Index,u => pathInfo.RequestParameters);
  1018. break;
  1019. }
  1020. throw new DispatchException("Could not dispatch IElasticClient.IndicesDelete() into any of the following paths: \r\n - /{index}");
  1021. }
  1022. internal Task<ElasticsearchResponse<T>> IndicesDeleteDispatchAsync<T>(ElasticsearchPathInfo<DeleteIndexRequestParameters> pathInfo )
  1023. {
  1024. switch(pathInfo.HttpMethod)
  1025. {
  1026. case PathInfoHttpMethod.DELETE:
  1027. //DELETE /{index}
  1028. if (!pathInfo.Index.IsNullOrEmpty())
  1029. return this.Raw.IndicesDeleteAsync<T>(pathInfo.Index,u => pathInfo.RequestParameters);
  1030. break;
  1031. }
  1032. throw new DispatchException("Could not dispatch IElasticClient.IndicesDelete() into any of the following paths: \r\n - /{index}");
  1033. }
  1034. internal ElasticsearchResponse<T> IndicesDeleteAliasDispatch<T>(ElasticsearchPathInfo<IndicesDeleteAliasRequestParameters> pathInfo )
  1035. {
  1036. switch(pathInfo.HttpMethod)
  1037. {
  1038. case PathInfoHttpMethod.DELETE:
  1039. //DELETE /{index}/_alias/{name}
  1040. if (!pathInfo.Index.IsNullOrEmpty() && !pathInfo.Name.IsNullOrEmpty())
  1041. return this.Raw.IndicesDeleteAlias<T>(pathInfo.Index,pathInfo.Name,u => pathInfo.RequestParameters);
  1042. break;
  1043. }
  1044. throw new DispatchException("Could not dispatch IElasticClient.IndicesDeleteAlias() into any of the following paths: \r\n - /{index}/_alias/{name}\r\n - /{index}/_aliases/{name}");
  1045. }
  1046. internal Task<ElasticsearchResponse<T>> IndicesDeleteAliasDispatchAsync<T>(ElasticsearchPathInfo<IndicesDeleteAliasRequestParameters> pathInfo )
  1047. {
  1048. switch(pathInfo.HttpMethod)
  1049. {
  1050. case PathInfoHttpMethod.DELETE:
  1051. //DELETE /{index}/_alias/{name}
  1052. if (!pathInfo.Index.IsNullOrEmpty() && !pathInfo.Name.IsNullOrEmpty())
  1053. return this.Raw.IndicesDeleteAliasAsync<T>(pathInfo.Index,pathInfo.Name,u => pathInfo.RequestParameters);
  1054. break;
  1055. }
  1056. throw new DispatchException("Could not dispatch IElasticClient.IndicesDeleteAlias() into any of the following paths: \r\n - /{index}/_alias/{name}\r\n - /{index}/_aliases/{name}");
  1057. }
  1058. internal ElasticsearchResponse<T> IndicesDeleteMappingDispatch<T>(ElasticsearchPathInfo<DeleteMappingRequestParameters> pathInfo )
  1059. {
  1060. switch(pathInfo.HttpMethod)
  1061. {
  1062. case PathInfoHttpMethod.DELETE:
  1063. //DELETE /{index}/{type}/_mapping
  1064. if (!pathInfo.Index.IsNullOrEmpty() && !pathInfo.Type.IsNullOrEmpty())
  1065. return this.Raw.IndicesDeleteMapping<T>(pathInfo.Index,pathInfo.Type,u => pathInfo.RequestParameters);
  1066. break;
  1067. }
  1068. throw new DispatchException("Could not dispatch IElasticClient.IndicesDeleteMapping() into any of the following paths: \r\n - /{index}/{type}/_mapping\r\n - /{index}/{type}\r\n - /{index}/_mapping/{type}\r\n - /{index}/{type}/_mappings\r\n - /{index}/_mappings/{type}");
  1069. }
  1070. internal Task<ElasticsearchResponse<T>> IndicesDeleteMappingDispatchAsync<T>(ElasticsearchPathInfo<DeleteMappingRequestParameters> pathInfo )
  1071. {
  1072. switch(pathInfo.HttpMethod)
  1073. {
  1074. case PathInfoHttpMethod.DELETE:
  1075. //DELETE /{index}/{type}/_mapping
  1076. if (!pathInfo.Index.IsNullOrEmpty() && !pathInfo.Type.IsNullOrEmpty())
  1077. return this.Raw.IndicesDeleteMappingAsync<T>(pathInfo.Index,pathInfo.Type,u => pathInfo.RequestParameters);
  1078. break;
  1079. }
  1080. throw new DispatchException("Could not dispatch IElasticClient.IndicesDeleteMapping() into any of the following paths: \r\n - /{index}/{type}/_mapping\r\n - /{index}/{type}\r\n - /{index}/_mapping/{type}\r\n - /{index}/{type}/_mappings\r\n - /{index}/_mappings/{type}");
  1081. }
  1082. internal ElasticsearchResponse<T> IndicesDeleteTemplateDispatch<T>(ElasticsearchPathInfo<DeleteTemplateRequestParameters> pathInfo )
  1083. {
  1084. switch(pathInfo.HttpMethod)
  1085. {
  1086. case PathInfoHttpMethod.DELETE:
  1087. //DELETE /_template/{name}
  1088. if (!pathInfo.Name.IsNullOrEmpty())
  1089. return this.Raw.IndicesDeleteTemplateForAll<T>(pathInfo.Name,u => pathInfo.RequestParameters);
  1090. break;
  1091. }
  1092. throw new DispatchException("Could not dispatch IElasticClient.IndicesDeleteTemplate() into any of the following paths: \r\n - /_template/{name}");
  1093. }
  1094. internal Task<ElasticsearchResponse<T>> IndicesDeleteTemplateDispatchAsync<T>(ElasticsearchPathInfo<DeleteTemplateRequestParameters> pathInfo )
  1095. {
  1096. switch(pathInfo.HttpMethod)
  1097. {
  1098. case PathInfoHttpMethod.DELETE:
  1099. //DELETE /_template/{name}
  1100. if (!pathInfo.Name.IsNullOrEmpty())
  1101. return this.Raw.IndicesDeleteTemplateForAllAsync<T>(pathInfo.Name,u => pathInfo.RequestParameters);
  1102. break;
  1103. }
  1104. throw new DispatchException("Could not dispatch IElasticClient.IndicesDeleteTemplate() into any of the following paths: \r\n - /_template/{name}");
  1105. }
  1106. internal ElasticsearchResponse<T> IndicesDeleteWarmerDispatch<T>(ElasticsearchPathInfo<DeleteWarmerRequestParameters> pathInfo )
  1107. {
  1108. switch(pathInfo.HttpMethod)
  1109. {
  1110. case PathInfoHttpMethod.DELETE:
  1111. //DELETE /{index}/_warmer/{name}
  1112. if (!pathInfo.Index.IsNullOrEmpty() && !pathInfo.Name.IsNullOrEmpty())
  1113. return this.Raw.IndicesDeleteWarmer<T>(pathInfo.Index,pathInfo.Name,u => pathInfo.RequestParameters);
  1114. break;
  1115. }
  1116. throw new DispatchException("Could not dispatch IElasticClient.IndicesDeleteWarmer() into any of the following paths: \r\n - /{index}/_warmer/{name}\r\n - /{index}/_warmers/{name}");
  1117. }
  1118. internal Task<ElasticsearchResponse<T>> IndicesDeleteWarmerDispatchAsync<T>(ElasticsearchPathInfo<DeleteWarmerRequestParameters> pathInfo )
  1119. {
  1120. switch(pathInfo.HttpMethod)
  1121. {
  1122. case PathInfoHttpMethod.DELETE:
  1123. //DELETE /{index}/_warmer/{name}
  1124. if (!pathInfo.Index.IsNullOrEmpty() && !pathInfo.Name.IsNullOrEmpty())
  1125. return this.Raw.IndicesDeleteWarmerAsync<T>(pathInfo.Index,pathInfo.Name,u => pathInfo.RequestParameters);
  1126. break;
  1127. }
  1128. throw new DispatchException("Could not dispatch IElasticClient.IndicesDeleteWarmer() into any of the following paths: \r\n - /{index}/_warmer/{name}\r\n - /{index}/_warmers/{name}");
  1129. }
  1130. internal ElasticsearchResponse<T> IndicesExistsDispatch<T>(ElasticsearchPathInfo<IndexExistsRequestParameters> pathInfo )
  1131. {
  1132. switch(pathInfo.HttpMethod)
  1133. {
  1134. case PathInfoHttpMethod.HEAD:
  1135. //HEAD /{index}
  1136. if (!pathInfo.Index.IsNullOrEmpty())
  1137. return this.Raw.IndicesExists<T>(pathInfo.Index,u => pathInfo.RequestParameters);
  1138. break;
  1139. }
  1140. throw new DispatchException("Could not dispatch IElasticClient.IndicesExists() into any of the following paths: \r\n - /{index}");
  1141. }
  1142. internal Task<ElasticsearchResponse<T>> IndicesExistsDispatchAsync<T>(ElasticsearchPathInfo<IndexExistsRequestParameters> pathInfo )
  1143. {
  1144. switch(pathInfo.HttpMethod)
  1145. {
  1146. case PathInfoHttpMethod.HEAD:
  1147. //HEAD /{index}
  1148. if (!pathInfo.Index.IsNullOrEmpty())
  1149. return this.Raw.IndicesExistsAsync<T>(pathInfo.Index,u => pathInfo.RequestParameters);
  1150. break;
  1151. }
  1152. throw new DispatchException("Could not dispatch IElasticClient.IndicesExists() into any of the following paths: \r\n - /{index}");
  1153. }
  1154. internal ElasticsearchResponse<T> IndicesExistsAliasDispatch<T>(ElasticsearchPathInfo<IndicesExistsAliasRequestParameters> pathInfo )
  1155. {
  1156. switch(pathInfo.HttpMethod)
  1157. {
  1158. case PathInfoHttpMethod.HEAD:
  1159. //HEAD /{index}/_alias/{name}
  1160. if (!pathInfo.Index.IsNullOrEmpty() && !pathInfo.Name.IsNullOrEmpty())
  1161. return this.Raw.IndicesExistsAlias<T>(pathInfo.Index,pathInfo.Name,u => pathInfo.RequestParameters);
  1162. //HEAD /_alias/{name}
  1163. if (!pathInfo.Name.IsNullOrEmpty())
  1164. return this.Raw.IndicesExistsAliasForAll<T>(pathInfo.Name,u => pathInfo.RequestParameters);
  1165. //HEAD /{index}/_alias
  1166. if (!pathInfo.Index.IsNullOrEmpty())
  1167. return this.Raw.IndicesExistsAlias<T>(pathInfo.Index,u => pathInfo.RequestParameters);
  1168. break;
  1169. }
  1170. throw new DispatchException("Could not dispatch IElasticClient.IndicesExistsAlias() into any of the following paths: \r\n - /_alias/{name}\r\n - /{index}/_alias/{name}\r\n - /{index}/_alias");
  1171. }
  1172. internal Task<ElasticsearchResponse<T>> IndicesExistsAliasDispatchAsync<T>(ElasticsearchPathInfo<IndicesExistsAliasRequestParameters> pathInfo )
  1173. {
  1174. switch(pathInfo.HttpMethod)
  1175. {
  1176. case PathInfoHttpMethod.HEAD:
  1177. //HEAD /{index}/_alias/{name}
  1178. if (!pathInfo.Index.IsNullOrEmpty() && !pathInfo.Name.IsNullOrEmpty())
  1179. return this.Raw.IndicesExistsAliasAsync<T>(pathInfo.Index,pathInfo.Name,u => pathInfo.RequestParameters);
  1180. //HEAD /_alias/{name}
  1181. if (!pathInfo.Name.IsNullOrEmpty())
  1182. return this.Raw.IndicesExistsAliasForAllAsync<T>(pathInfo.Name,u => pathInfo.RequestParameters);
  1183. //HEAD /{index}/_alias
  1184. if (!pathInfo.Index.IsNullOrEmpty())
  1185. return this.Raw.IndicesExistsAliasAsync<T>(pathInfo.Index,u => pathInfo.RequestParameters);
  1186. break;
  1187. }
  1188. throw new DispatchException("Could not dispatch IElasticClient.IndicesExistsAlias() into any of the following paths: \r\n - /_alias/{name}\r\n - /{index}/_alias/{name}\r\n - /{index}/_alias");
  1189. }
  1190. internal ElasticsearchResponse<T> IndicesExistsTemplateDispatch<T>(ElasticsearchPathInfo<IndicesExistsTemplateRequestParameters> pathInfo )
  1191. {
  1192. switch(pathInfo.HttpMethod)
  1193. {
  1194. case PathInfoHttpMethod.HEAD:
  1195. //HEAD /_template/{name}
  1196. if (!pathInfo.Name.IsNullOrEmpty())
  1197. return this.Raw.IndicesExistsTemplateForAll<T>(pathInfo.Name,u => pathInfo.RequestParameters);
  1198. break;
  1199. }
  1200. throw new DispatchException("Could not dispatch IElasticClient.IndicesExistsTemplate() into any of the following paths: \r\n - /_template/{name}");
  1201. }
  1202. internal Task<ElasticsearchResponse<T>> IndicesExistsTemplateDispatchAsync<T>(ElasticsearchPathInfo<IndicesExistsTemplateRequestParameters> pathInfo )
  1203. {
  1204. switch(pathInfo.HttpMethod)
  1205. {
  1206. case PathInfoHttpMethod.HEAD:
  1207. //HEAD /_template/{name}
  1208. if (!pathInfo.Name.IsNullOrEmpty())
  1209. return this.Raw.IndicesExistsTemplateForAllAsync<T>(pathInfo.Name,u => pathInfo.RequestParameters);
  1210. break;
  1211. }
  1212. throw new DispatchException("Could not dispatch IElasticClient.IndicesExistsTemplate() into any of the following paths: \r\n - /_template/{name}");
  1213. }
  1214. internal ElasticsearchResponse<T> IndicesExistsTypeDispatch<T>(ElasticsearchPathInfo<IndicesExistsTypeRequestParameters> pathInfo )
  1215. {
  1216. switch(pathInfo.HttpMethod)
  1217. {
  1218. case PathInfoHttpMethod.HEAD:
  1219. //HEAD /{index}/{type}
  1220. if (!pathInfo.Index.IsNullOrEmpty() && !pathInfo.Type.IsNullOrEmpty())
  1221. return this.Raw.IndicesExistsType<T>(pathInfo.Index,pathInfo.Type,u => pathInfo.RequestParameters);
  1222. break;
  1223. }
  1224. throw new DispatchException("Could not dispatch IElasticClient.IndicesExistsType() into any of the following paths: \r\n - /{index}/{type}");
  1225. }
  1226. internal Task<ElasticsearchResponse<T>> IndicesExistsTypeDispatchAsync<T>(ElasticsearchPathInfo<IndicesExistsTypeRequestParameters> pathInfo )
  1227. {
  1228. switch(pathInfo.HttpMethod)
  1229. {
  1230. case PathInfoHttpMethod.HEAD:
  1231. //HEAD /{index}/{type}
  1232. if (!pathInfo.Index.IsNullOrEmpty() && !pathInfo.Type.IsNullOrEmpty())
  1233. return this.Raw.IndicesExistsTypeAsync<T>(pathInfo.Index,pathInfo.Type,u => pathInfo.RequestParameters);
  1234. break;
  1235. }
  1236. throw new DispatchException("Could not dispatch IElasticClient.IndicesExistsType() into any of the following paths: \r\n - /{index}/{type}");
  1237. }
  1238. internal ElasticsearchResponse<T> IndicesFlushDispatch<T>(ElasticsearchPathInfo<FlushRequestParameters> pathInfo )
  1239. {
  1240. switch(pathInfo.HttpMethod)
  1241. {
  1242. case PathInfoHttpMethod.POST:
  1243. //POST /{index}/_flush
  1244. if (!pathInfo.Index.IsNullOrEmpty())
  1245. return this.Raw.IndicesFlush<T>(pathInfo.Index,u => pathInfo.RequestParameters);
  1246. //POST /_flush
  1247. return this.Raw.IndicesFlushForAll<T>(u => pathInfo.RequestParameters);
  1248. case PathInfoHttpMethod.GET:
  1249. //GET /{index}/_flush
  1250. if (!pathInfo.Index.IsNullOrEmpty())
  1251. return this.Raw.IndicesFlushGet<T>(pathInfo.Index,u => pathInfo.RequestParameters);
  1252. //GET /_flush
  1253. return this.Raw.IndicesFlushGetForAll<T>(u => pathInfo.RequestParameters);
  1254. }
  1255. throw new DispatchException("Could not dispatch IElasticClient.IndicesFlush() into any of the following paths: \r\n - /_flush\r\n - /{index}/_flush");
  1256. }
  1257. internal Task<ElasticsearchResponse<T>> IndicesFlushDispatchAsync<T>(ElasticsearchPathInfo<FlushRequestParameters> pathInfo )
  1258. {
  1259. switch(pathInfo.HttpMethod)
  1260. {
  1261. case PathInfoHttpMethod.POST:
  1262. //POST /{index}/_flush
  1263. if (!pathInfo.Index.IsNullOrEmpty())
  1264. return this.Raw.IndicesFlushAsync<T>(pathInfo.Index,u => pathInfo.RequestParameters);
  1265. //POST /_flush
  1266. return this.Raw.IndicesFlushForAllAsync<T>(u => pathInfo.RequestParameters);
  1267. case PathInfoHttpMethod.GET:
  1268. //GET /{index}/_flush
  1269. if (!pathInfo.Index.IsNullOrEmpty())
  1270. return this.Raw.IndicesFlushGetAsync<T>(pathInfo.Index,u => pathInfo.RequestParameters);
  1271. //GET /_flush
  1272. return this.Raw.IndicesFlushGetForAllAsync<T>(u => pathInfo.RequestParameters);
  1273. }
  1274. throw new DispatchException("Could not dispatch IElasticClient.IndicesFlush() into any of the following paths: \r\n - /_flush\r\n - /{index}/_flush");
  1275. }
  1276. internal ElasticsearchResponse<T> IndicesGetAliasDispatch<T>(ElasticsearchPathInfo<GetAliasesRequestParameters> pathInfo )
  1277. {
  1278. switch(pathInfo.HttpMethod)
  1279. {
  1280. case PathInfoHttpMethod.GET:
  1281. //GET /{index}/_alias/{name}
  1282. if (!pathInfo.Index.IsNullOrEmpty() && !pathInfo.Name.IsNullOrEmpty())
  1283. return this.Raw.IndicesGetAlias<T>(pathInfo.Index,pathInfo.Name,u => pathInfo.RequestParameters);
  1284. //GET /_alias/{name}
  1285. if (!pathInfo.Name.IsNullOrEmpty())
  1286. return this.Raw.IndicesGetAliasForAll<T>(pathInfo.Name,u => pathInfo.RequestParameters);
  1287. //GET /{index}/_alias
  1288. if (!pathInfo.Index.IsNullOrEmpty())
  1289. return this.Raw.IndicesGetAlias<T>(pathInfo.Index,u => pathInfo.RequestParameters);
  1290. //GET /_alias
  1291. return this.Raw.IndicesGetAliasForAll<T>(u => pathInfo.RequestParameters);
  1292. }
  1293. throw new DispatchException("Could not dispatch IElasticClient.IndicesGetAlias() into any of the following paths: \r\n - /_alias\r\n - /_alias/{name}\r\n - /{index}/_alias/{name}\r\n - /{index}/_alias");
  1294. }
  1295. internal Task<ElasticsearchResponse<T>> IndicesGetAliasDispatchAsync<T>(ElasticsearchPathInfo<GetAliasesRequestParameters> pathInfo )
  1296. {
  1297. switch(pathInfo.HttpMethod)
  1298. {
  1299. case PathInfoHttpMethod.GET:
  1300. //GET /{index}/_alias/{name}
  1301. if (!pathInfo.Index.IsNullOrEmpty() && !pathInfo.Name.IsNullOrEmpty())
  1302. return this.Raw.IndicesGetAliasAsync<T>(pathInfo.Index,pathInfo.Name,u => pathInfo.RequestParameters);
  1303. //GET /_alias/{name}
  1304. if (!pathInfo.Name.IsNullOrEmpty())
  1305. return this.Raw.IndicesGetAliasForAllAsync<T>(pathInfo.Name,u => pathInfo.RequestParameters);
  1306. //GET /{index}/_alias
  1307. if (!pathInfo.Index.IsNullOrEmpty())
  1308. return this.Raw.IndicesGetAliasAsync<T>(pathInfo.Index,u => pathInfo.RequestParameters);
  1309. //GET /_alias
  1310. return this.Raw.IndicesGetAliasForAllAsync<T>(u => pathInfo.RequestParameters);
  1311. }
  1312. throw new DispatchException("Could not dispatch IElasticClient.IndicesGetAlias() into any of the following paths: \r\n - /_alias\r\n - /_alias/{name}\r\n - /{index}/_alias/{name}\r\n - /{index}/_alias");
  1313. }
  1314. internal ElasticsearchResponse<T> IndicesGetAliasesDispatch<T>(ElasticsearchPathInfo<IndicesGetAliasesRequestParameters> pathInfo )
  1315. {
  1316. switch(pathInfo.HttpMethod)
  1317. {
  1318. case PathInfoHttpMethod.GET:
  1319. //GET /{index}/_aliases/{name}
  1320. if (!pathInfo.Index.IsNullOrEmpty() && !pathInfo.Name.IsNullOrEmpty())
  1321. return this.Raw.IndicesGetAliases<T>(pathInfo.Index,pathInfo.Name,u => pathInfo.RequestParameters);
  1322. //GET /{index}/_aliases
  1323. if (!pathInfo.Index.IsNullOrEmpty())
  1324. return this.Raw.IndicesGetAliases<T>(pathInfo.Index,u => pathInfo.RequestParameters);
  1325. //GET /_aliases/{name}
  1326. if (!pathInfo.Name.IsNullOrEmpty())
  1327. return this.Raw.IndicesGetAliasesForAll<T>(pathInfo.Name,u => pathInfo.RequestParameters);
  1328. //GET /_aliases
  1329. return this.Raw.IndicesGetAliasesForAll<T>(u => pathInfo.RequestParameters);
  1330. }
  1331. throw new DispatchException("Could not dispatch IElasticClient.IndicesGetAliases() into any of the following paths: \r\n - /_aliases\r\n - /{index}/_aliases\r\n - /{index}/_aliases/{name}\r\n - /_aliases/{name}");
  1332. }
  1333. internal Task<ElasticsearchResponse<T>> IndicesGetAliasesDispatchAsync<T>(ElasticsearchPathInfo<IndicesGetAliasesRequestParameters> pathInfo )
  1334. {
  1335. switch(pathInfo.HttpMethod)
  1336. {
  1337. case PathInfoHttpMethod.GET:
  1338. //GET /{index}/_aliases/{name}
  1339. if (!pathInfo.Index.IsNullOrEmpty() && !pathInfo.Name.IsNullOrEmpty())
  1340. return this.Raw.IndicesGetAliasesAsync<T>(pathInfo.Index,pathInfo.Name,u => pathInfo.RequestParameters);
  1341. //GET /{index}/_aliases
  1342. if (!pathInfo.Index.IsNullOrEmpty())
  1343. return this.Raw.IndicesGetAliasesAsync<T>(pathInfo.Index,u => pathInfo.RequestParameters);
  1344. //GET /_aliases/{name}
  1345. if (!pathInfo.Name.IsNullOrEmpty())
  1346. return this.Raw.IndicesGetAliasesForAllAsync<T>(pathInfo.Name,u => pathInfo.RequestParameters);
  1347. //GET /_aliases
  1348. return this.Raw.IndicesGetAliasesForAllAsync<T>(u => pathInfo.RequestParameters);
  1349. }
  1350. throw new DispatchException("Could not dispatch IElasticClient.IndicesGetAliases() into any of the following paths: \r\n - /_aliases\r\n - /{index}/_aliases\r\n - /{index}/_aliases/{name}\r\n - /_aliases/{name}");
  1351. }
  1352. internal ElasticsearchResponse<T> IndicesGetFieldMappingDispatch<T>(ElasticsearchPathInfo<IndicesGetFieldMappingRequestParameters> pathInfo )
  1353. {
  1354. switch(pathInfo.HttpMethod)
  1355. {
  1356. case PathInfoHttpMethod.GET:
  1357. //GET /{index}/_mapping/{type}/field/{field}
  1358. if (!pathInfo.Index.IsNullOrEmpty() && !pathInfo.Type.IsNullOrEmpty() && !pathInfo.Field.IsNullOrEmpty())
  1359. return this.Raw.IndicesGetFieldMapping<T>(pathInfo.Index,pathInfo.Type,pathInfo.Field,u => pathInfo.RequestParameters);
  1360. //GET /{index}/_mapping/field/{field}
  1361. if (!pathInfo.Index.IsNullOrEmpty() && !pathInfo.Field.IsNullOrEmpty())
  1362. return this.Raw.IndicesGetFieldMapping<T>(pathInfo.Index,pathInfo.Field,u => pathInfo.RequestParameters);
  1363. //GET /_mapping/{type}/field/{field}
  1364. if (!pathInfo.Type.IsNullOrEmpty() && !pathInfo.Field.IsNullOrEmpty())
  1365. return this.Raw.IndicesGetFieldMappingForAll<T>(pathInfo.Type,pathInfo.Field,u => pathInfo.RequestParameters);
  1366. //GET /_mapping/field/{field}
  1367. if (!pathInfo.Field.IsNullOrEmpty())
  1368. return this.Raw.IndicesGetFieldMappingForAll<T>(pathInfo.Field,u => pathInfo.RequestParameters);
  1369. break;
  1370. }
  1371. throw new DispatchException("Could not dispatch IElasticClient.IndicesGetFieldMapping() into any of the following paths: \r\n - /_mapping/field/{field}\r\n - /{index}/_mapping/field/{field}\r\n - /_mapping/{type}/field/{field}\r\n - /{index}/_mapping/{type}/field/{field}");
  1372. }
  1373. internal Task<ElasticsearchResponse<T>> IndicesGetFieldMappingDispatchAsync<T>(ElasticsearchPathInfo<IndicesGetFieldMappingRequestParameters> pathInfo )
  1374. {
  1375. switch(pathInfo.HttpMethod)
  1376. {
  1377. case PathInfoHttpMethod.GET:
  1378. //GET /{index}/_mapping/{type}/field/{field}
  1379. if (!pathInfo.Index.IsNullOrEmpty() && !pathInfo.Type.IsNullOrEmpty() && !pathInfo.Field.IsNullOrEmpty())
  1380. return this.Raw.IndicesGetFieldMappingAsync<T>(pathInfo.Index,pathInfo.Type,pathInfo.Field,u => pathInfo.RequestParameters);
  1381. //GET /{index}/_mapping/field/{field}
  1382. if (!pathInfo.Index.IsNullOrEmpty() && !pathInfo.Field.IsNullOrEmpty())
  1383. return this.Raw.IndicesGetFieldMappingAsync<T>(pathInfo.Index,pathInfo.Field,u => pathInfo.RequestParameters);
  1384. //GET /_mapping/{type}/field/{field}
  1385. if (!pathInfo.Type.IsNullOrEmpty() && !pathInfo.Field.IsNullOrEmpty())
  1386. return this.Raw.IndicesGetFieldMappingForAllAsync<T>(pathInfo.Type,pathInfo.Field,u => pathInfo.RequestParameters);
  1387. //GET /_mapping/field/{field}
  1388. if (!pathInfo.Field.IsNullOrEmpty())
  1389. return this.Raw.IndicesGetFieldMappingForAllAsync<T>(pathInfo.Field,u => pathInfo.RequestParameters);
  1390. break;
  1391. }
  1392. throw new DispatchException("Could not dispatch IElasticClient.IndicesGetFieldMapping() into any of the following paths: \r\n - /_mapping/field/{field}\r\n - /{index}/_mapping/field/{field}\r\n - /_mapping/{type}/field/{field}\r\n - /{index}/_mapping/{type}/field/{field}");
  1393. }
  1394. internal ElasticsearchResponse<T> IndicesGetMappingDispatch<T>(ElasticsearchPathInfo<GetMappingRequestParameters> pathInfo )
  1395. {
  1396. switch(pathInfo.HttpMethod)
  1397. {
  1398. case PathInfoHttpMethod.GET:
  1399. //GET /{index}/_mapping/{type}
  1400. if (!pathInfo.Index.IsNullOrEmpty() && !pathInfo.Type.IsNullOrEmpty())
  1401. return this.Raw.IndicesGetMapping<T>(pathInfo.Index,pathInfo.Type,u => pathInfo.RequestParameters);
  1402. //GET /{index}/_mapping
  1403. if (!pathInfo.Index.IsNullOrEmpty())
  1404. return this.Raw.IndicesGetMapping<T>(pathInfo.Index,u => pathInfo.RequestParameters);
  1405. //GET /_mapping/{type}
  1406. if (!pathInfo.Type.IsNullOrEmpty())
  1407. return this.Raw.IndicesGetMappingForAll<T>(pathInfo.Type,u => pathInfo.RequestParameters);
  1408. //GET /_mapping
  1409. return this.Raw.IndicesGetMappingForAll<T>(u => pathInfo.RequestParameters);
  1410. }
  1411. throw new DispatchException("Could not dispatch IElasticClient.IndicesGetMapping() into any of the following paths: \r\n - /_mapping\r\n - /{index}/_mapping\r\n - /_mapping/{type}\r\n - /{index}/_mapping/{type}");
  1412. }
  1413. internal Task<ElasticsearchResponse<T>> IndicesGetMappingDispatchAsync<T>(ElasticsearchPathInfo<GetMappingRequestParameters> pathInfo )
  1414. {
  1415. switch(pathInfo.HttpMethod)
  1416. {
  1417. case PathInfoHttpMethod.GET:
  1418. //GET /{index}/_mapping/{type}
  1419. if (!pathInfo.Index.IsNullOrEmpty() && !pathInfo.Type.IsNullOrEmpty())
  1420. return this.Raw.IndicesGetMappingAsync<T>(pathInfo.Index,pathInfo.Type,u => pathInfo.RequestParameters);
  1421. //GET /{index}/_mapping
  1422. if (!pathInfo.Index.IsNullOrEmpty())
  1423. return this.Raw.IndicesGetMappingAsync<T>(pathInfo.Index,u => pathInfo.RequestParameters);
  1424. //GET /_mapping/{type}
  1425. if (!pathInfo.Type.IsNullOrEmpty())
  1426. return this.Raw.IndicesGetMappingForAllAsync<T>(pathInfo.Type,u => pathInfo.RequestParameters);
  1427. //GET /_mapping
  1428. return this.Raw.IndicesGetMappingForAllAsync<T>(u => pathInfo.RequestParameters);
  1429. }
  1430. throw new DispatchException("Could not dispatch IElasticClient.IndicesGetMapping() into any of the following paths: \r\n - /_mapping\r\n - /{index}/_mapping\r\n - /_mapping/{type}\r\n - /{index}/_mapping/{type}");
  1431. }
  1432. internal ElasticsearchResponse<T> IndicesGetSettingsDispatch<T>(ElasticsearchPathInfo<GetIndexSettingsRequestParameters> pathInfo )
  1433. {
  1434. switch(pathInfo.HttpMethod)
  1435. {
  1436. case PathInfoHttpMethod.GET:
  1437. //GET /{index}/_settings/{name}
  1438. if (!pathInfo.Index.IsNullOrEmpty() && !pathInfo.Name.IsNullOrEmpty())
  1439. return this.Raw.IndicesGetSettings<T>(pathInfo.Index,pathInfo.Name,u => pathInfo.RequestParameters);
  1440. //GET /{index}/_settings
  1441. if (!pathInfo.Index.IsNullOrEmpty())
  1442. return this.Raw.IndicesGetSettings<T>(pathInfo.Index,u => pathInfo.RequestParameters);
  1443. //GET /_settings/{name}
  1444. if (!pathInfo.Name.IsNullOrEmpty())
  1445. return this.Raw.IndicesGetSettingsForAll<T>(pathInfo.Name,u => pathInfo.RequestParameters);
  1446. //GET /_settings
  1447. return this.Raw.IndicesGetSettingsForAll<T>(u => pathInfo.RequestParameters);
  1448. }
  1449. throw new DispatchException("Could not dispatch IElasticClient.IndicesGetSettings() into any of the following paths: \r\n - /_settings\r\n - /{index}/_settings\r\n - /{index}/_settings/{name}\r\n - /_settings/{name}");
  1450. }
  1451. internal Task<ElasticsearchResponse<T>> IndicesGetSettingsDispatchAsync<T>(ElasticsearchPathInfo<GetIndexSettingsRequestParameters> pathInfo )
  1452. {
  1453. switch(pathInfo.HttpMethod)
  1454. {
  1455. case PathInfoHttpMethod.GET:
  1456. //GET /{index}/_settings/{name}
  1457. if (!pathInfo.Index.IsNullOrEmpty() && !pathInfo.Name.IsNullOrEmpty())
  1458. return this.Raw.IndicesGetSettingsAsync<T>(pathInfo.Index,pathInfo.Name,u => pathInfo.RequestParameters);
  1459. //GET /{index}/_settings
  1460. if (!pathInfo.Index.IsNullOrEmpty())
  1461. return this.Raw.IndicesGetSettingsAsync<T>(pathInfo.Index,u => pathInfo.RequestParameters);
  1462. //GET /_settings/{name}
  1463. if (!pathInfo.Name.IsNullOrEmpty())
  1464. return this.Raw.IndicesGetSettingsForAllAsync<T>(pathInfo.Name,u => pathInfo.RequestParameters);
  1465. //GET /_settings
  1466. return this.Raw.IndicesGetSettingsForAllAsync<T>(u => pathInfo.RequestParameters);
  1467. }
  1468. throw new DispatchException("Could not dispatch IElasticClient.IndicesGetSettings() into any of the following paths: \r\n - /_settings\r\n - /{index}/_settings\r\n - /{index}/_settings/{name}\r\n - /_settings/{name}");
  1469. }
  1470. internal ElasticsearchResponse<T> IndicesGetTemplateDispatch<T>(ElasticsearchPathInfo<GetTemplateRequestParameters> pathInfo )
  1471. {
  1472. switch(pathInfo.HttpMethod)
  1473. {
  1474. case PathInfoHttpMethod.GET:
  1475. //GET /_template/{name}
  1476. if (!pathInfo.Name.IsNullOrEmpty())
  1477. return this.Raw.IndicesGetTemplateForAll<T>(pathInfo.Name,u => pathInfo.RequestParameters);
  1478. //GET /_template
  1479. return this.Raw.IndicesGetTemplateForAll<T>(u => pathInfo.RequestParameters);
  1480. }
  1481. throw new DispatchException("Could not dispatch IElasticClient.IndicesGetTemplate() into any of the following paths: \r\n - /_template\r\n - /_template/{name}");
  1482. }
  1483. internal Task<ElasticsearchResponse<T>> IndicesGetTemplateDispatchAsync<T>(ElasticsearchPathInfo<GetTemplateRequestParameters> pathInfo )
  1484. {
  1485. switch(pathInfo.HttpMethod)
  1486. {
  1487. case PathInfoHttpMethod.GET:
  1488. //GET /_template/{name}
  1489. if (!pathInfo.Name.IsNullOrEmpty())
  1490. return this.Raw.IndicesGetTemplateForAllAsync<T>(pathInfo.Name,u => pathInfo.RequestParameters);
  1491. //GET /_template
  1492. return this.Raw.IndicesGetTemplateForAllAsync<T>(u => pathInfo.RequestParameters);
  1493. }
  1494. throw new DispatchException("Could not dispatch IElasticClient.IndicesGetTemplate() into any of the following paths: \r\n - /_template\r\n - /_template/{name}");
  1495. }
  1496. internal ElasticsearchResponse<T> IndicesGetWarmerDispatch<T>(ElasticsearchPathInfo<GetWarmerRequestParameters> pathInfo )
  1497. {
  1498. switch(pathInfo.HttpMethod)
  1499. {
  1500. case PathInfoHttpMethod.GET:
  1501. //GET /{index}/{type}/_warmer/{name}
  1502. if (!pathInfo.Index.IsNullOrEmpty() && !pathInfo.Type.IsNullOrEmpty() && !pathInfo.Name.IsNullOrEmpty())
  1503. return this.Raw.IndicesGetWarmer<T>(pathInfo.Index,pathInfo.Type,pathInfo.Name,u => pathInfo.RequestParameters);
  1504. //GET /{index}/_warmer/{name}
  1505. if (!pathInfo.Index.IsNullOrEmpty() && !pathInfo.Name.IsNullOrEmpty())
  1506. return this.Raw.IndicesGetWarmer<T>(pathInfo.Index,pathInfo.Name,u => pathInfo.RequestParameters);
  1507. //GET /{index}/_warmer
  1508. if (!pathInfo.Index.IsNullOrEmpty())
  1509. return this.Raw.IndicesGetWarmer<T>(pathInfo.Index,u => pathInfo.RequestParameters);
  1510. //GET /_warmer/{name}
  1511. if (!pathInfo.Name.IsNullOrEmpty())
  1512. return this.Raw.IndicesGetWarmerForAll<T>(pathInfo.Name,u => pathInfo.RequestParameters);
  1513. //GET /_warmer
  1514. return this.Raw.IndicesGetWarmerForAll<T>(u => pathInfo.RequestParameters);
  1515. }
  1516. throw new DispatchException("Could not dispatch IElasticClient.IndicesGetWarmer() into any of the following paths: \r\n - /_warmer\r\n - /{index}/_warmer\r\n - /{index}/_warmer/{name}\r\n - /_warmer/{name}\r\n - /{index}/{type}/_warmer/{name}");
  1517. }
  1518. internal Task<ElasticsearchResponse<T>> IndicesGetWarmerDispatchAsync<T>(ElasticsearchPathInfo<GetWarmerRequestParameters> pathInfo )
  1519. {
  1520. switch(pathInfo.HttpMethod)
  1521. {
  1522. case PathInfoHttpMethod.GET:
  1523. //GET /{index}/{type}/_warmer/{name}
  1524. if (!pathInfo.Index.IsNullOrEmpty() && !pathInfo.Type.IsNullOrEmpty() && !pathInfo.Name.IsNullOrEmpty())
  1525. return this.Raw.IndicesGetWarmerAsync<T>(pathInfo.Index,pathInfo.Type,pathInfo.Name,u => pathInfo.RequestParameters);
  1526. //GET /{index}/_warmer/{name}
  1527. if (!pathInfo.Index.IsNullOrEmpty() && !pathInfo.Name.IsNullOrEmpty())
  1528. return this.Raw.IndicesGetWarmerAsync<T>(pathInfo.Index,pathInfo.Name,u => pathInfo.RequestParameters);
  1529. //GET /{index}/_warmer
  1530. if (!pathInfo.Index.IsNullOrEmpty())
  1531. return this.Raw.IndicesGetWarmerAsync<T>(pathInfo.Index,u => pathInfo.RequestParameters);
  1532. //GET /_warmer/{name}
  1533. if (!pathInfo.Name.IsNullOrEmpty())
  1534. return this.Raw.IndicesGetWarmerForAllAsync<T>(pathInfo.Name,u => pathInfo.RequestParameters);
  1535. //GET /_warmer
  1536. return this.Raw.IndicesGetWarmerForAllAsync<T>(u => pathInfo.RequestParameters);
  1537. }
  1538. throw new DispatchException("Could not dispatch IElasticClient.IndicesGetWarmer() into any of the following paths: \r\n - /_warmer\r\n - /{index}/_warmer\r\n - /{index}/_warmer/{name}\r\n - /_warmer/{name}\r\n - /{index}/{type}/_warmer/{name}");
  1539. }
  1540. internal ElasticsearchResponse<T> IndicesOpenDispatch<T>(ElasticsearchPathInfo<OpenIndexRequestParameters> pathInfo )
  1541. {
  1542. switch(pathInfo.HttpMethod)
  1543. {
  1544. case PathInfoHttpMethod.POST:
  1545. //POST /{index}/_open
  1546. if (!pathInfo.Index.IsNullOrEmpty())
  1547. return this.Raw.IndicesOpen<T>(pathInfo.Index,u => pathInfo.RequestParameters);
  1548. break;
  1549. }
  1550. throw new DispatchException("Could not dispatch IElasticClient.IndicesOpen() into any of the following paths: \r\n - /{index}/_open");
  1551. }
  1552. internal Task<ElasticsearchResponse<T>> IndicesOpenDispatchAsync<T>(ElasticsearchPathInfo<OpenIndexRequestParameters> pathInfo )
  1553. {
  1554. switch(pathInfo.HttpMethod)
  1555. {
  1556. case PathInfoHttpMethod.POST:
  1557. //POST /{index}/_open
  1558. if (!pathInfo.Index.IsNullOrEmpty())
  1559. return this.Raw.IndicesOpenAsync<T>(pathInfo.Index,u => pathInfo.RequestParameters);
  1560. break;
  1561. }
  1562. throw new DispatchException("Could not dispatch IElasticClient.IndicesOpen() into any of the following paths: \r\n - /{index}/_open");
  1563. }
  1564. internal ElasticsearchResponse<T> IndicesOptimizeDispatch<T>(ElasticsearchPathInfo<OptimizeRequestParameters> pathInfo )
  1565. {
  1566. switch(pathInfo.HttpMethod)
  1567. {
  1568. case PathInfoHttpMethod.POST:
  1569. //POST /{index}/_optimize
  1570. if (!pathInfo.Index.IsNullOrEmpty())
  1571. return this.Raw.IndicesOptimize<T>(pathInfo.Index,u => pathInfo.RequestParameters);
  1572. //POST /_optimize
  1573. return this.Raw.IndicesOptimizeForAll<T>(u => pathInfo.RequestParameters);
  1574. case PathInfoHttpMethod.GET:
  1575. //GET /{index}/_optimize
  1576. if (!pathInfo.Index.IsNullOrEmpty())
  1577. return this.Raw.IndicesOptimizeGet<T>(pathInfo.Index,u => pathInfo.RequestParameters);
  1578. //GET /_optimize
  1579. return this.Raw.IndicesOptimizeGetForAll<T>(u => pathInfo.RequestParameters);
  1580. }
  1581. throw new DispatchException("Could not dispatch IElasticClient.IndicesOptimize() into any of the following paths: \r\n - /_optimize\r\n - /{index}/_optimize");
  1582. }
  1583. internal Task<ElasticsearchResponse<T>> IndicesOptimizeDispatchAsync<T>(ElasticsearchPathInfo<OptimizeRequestParameters> pathInfo )
  1584. {
  1585. switch(pathInfo.HttpMethod)
  1586. {
  1587. case PathInfoHttpMethod.POST:
  1588. //POST /{index}/_optimize
  1589. if (!pathInfo.Index.IsNullOrEmpty())
  1590. return this.Raw.IndicesOptimizeAsync<T>(pathInfo.Index,u => pathInfo.RequestParameters);
  1591. //POST /_optimize
  1592. return this.Raw.IndicesOptimizeForAllAsync<T>(u => pathInfo.RequestParameters);
  1593. case PathInfoHttpMethod.GET:
  1594. //GET /{index}/_optimize
  1595. if (!pathInfo.Index.IsNullOrEmpty())
  1596. return this.Raw.IndicesOptimizeGetAsync<T>(pathInfo.Index,u => pathInfo.RequestParameters);
  1597. //GET /_optimize
  1598. return this.Raw.IndicesOptimizeGetForAllAsync<T>(u => pathInfo.RequestParameters);
  1599. }
  1600. throw new DispatchException("Could not dispatch IElasticClient.IndicesOptimize() into any of the following paths: \r\n - /_optimize\r\n - /{index}/_optimize");
  1601. }
  1602. internal ElasticsearchResponse<T> IndicesPutAliasDispatch<T>(ElasticsearchPathInfo<IndicesPutAliasRequestParameters> pathInfo , object body)
  1603. {
  1604. switch(pathInfo.HttpMethod)
  1605. {
  1606. case PathInfoHttpMethod.PUT:
  1607. //PUT /{index}/_alias/{name}
  1608. if (!pathInfo.Index.IsNullOrEmpty() && !pathInfo.Name.IsNullOrEmpty() && body != null)
  1609. return this.Raw.IndicesPutAlias<T>(pathInfo.Index,pathInfo.Name,body,u => pathInfo.RequestParameters);
  1610. //PUT /_alias/{name}
  1611. if (!pathInfo.Name.IsNullOrEmpty() && body != null)
  1612. return this.Raw.IndicesPutAliasForAll<T>(pathInfo.Name,body,u => pathInfo.RequestParameters);
  1613. break;
  1614. case PathInfoHttpMethod.POST:
  1615. //POST /{index}/_alias/{name}
  1616. if (!pathInfo.Index.IsNullOrEmpty() && !pathInfo.Name.IsNullOrEmpty() && body != null)
  1617. return this.Raw.IndicesPutAliasPost<T>(pathInfo.Index,pathInfo.Name,body,u => pathInfo.RequestParameters);
  1618. //POST /_alias/{name}
  1619. if (!pathInfo.Name.IsNullOrEmpty() && body != null)
  1620. return this.Raw.IndicesPutAliasPostForAll<T>(pathInfo.Name,body,u => pathInfo.RequestParameters);
  1621. break;
  1622. }
  1623. throw new DispatchException("Could not dispatch IElasticClient.IndicesPutAlias() into any of the following paths: \r\n - /{index}/_alias/{name}\r\n - /_alias/{name}\r\n - /{index}/_aliases/{name}\r\n - /_aliases/{name}");
  1624. }
  1625. internal Task<ElasticsearchResponse<T>> IndicesPutAliasDispatchAsync<T>(ElasticsearchPathInfo<IndicesPutAliasRequestParameters> pathInfo , object body)
  1626. {
  1627. switch(pathInfo.HttpMethod)
  1628. {
  1629. case PathInfoHttpMethod.PUT:
  1630. //PUT /{index}/_alias/{name}
  1631. if (!pathInfo.Index.IsNullOrEmpty() && !pathInfo.Name.IsNullOrEmpty() && body != null)
  1632. return this.Raw.IndicesPutAliasAsync<T>(pathInfo.Index,pathInfo.Name,body,u => pathInfo.RequestParameters);
  1633. //PUT /_alias/{name}
  1634. if (!pathInfo.Name.IsNullOrEmpty() && body != null)
  1635. return this.Raw.IndicesPutAliasForAllAsync<T>(pathInfo.Name,body,u => pathInfo.RequestParameters);
  1636. break;
  1637. case PathInfoHttpMethod.POST:
  1638. //POST /{index}/_alias/{name}
  1639. if (!pathInfo.Index.IsNullOrEmpty() && !pathInfo.Name.IsNullOrEmpty() && body != null)
  1640. return this.Raw.IndicesPutAliasPostAsync<T>(pathInfo.Index,pathInfo.Name,body,u => pathInfo.RequestParameters);
  1641. //POST /_alias/{name}
  1642. if (!pathInfo.Name.IsNullOrEmpty() && body != null)
  1643. return this.Raw.IndicesPutAliasPostForAllAsync<T>(pathInfo.Name,body,u => pathInfo.RequestParameters);
  1644. break;
  1645. }
  1646. throw new DispatchException("Could not dispatch IElasticClient.IndicesPutAlias() into any of the following paths: \r\n - /{index}/_alias/{name}\r\n - /_alias/{name}\r\n - /{index}/_aliases/{name}\r\n - /_aliases/{name}");
  1647. }
  1648. internal ElasticsearchResponse<T> IndicesPutMappingDispatch<T>(ElasticsearchPathInfo<PutMappingRequestParameters> pathInfo , object body)
  1649. {
  1650. switch(pathInfo.HttpMethod)
  1651. {
  1652. case PathInfoHttpMethod.PUT:
  1653. //PUT /{index}/{type}/_mapping
  1654. if (!pathInfo.Index.IsNullOrEmpty() && !pathInfo.Type.IsNullOrEmpty() && body != null)
  1655. return this.Raw.IndicesPutMapping<T>(pathInfo.Index,pathInfo.Type,body,u => pathInfo.RequestParameters);
  1656. //PUT /_mapping/{type}
  1657. if (!pathInfo.Type.IsNullOrEmpty() && body != null)
  1658. return this.Raw.IndicesPutMappingForAll<T>(pathInfo.Type,body,u => pathInfo.RequestParameters);
  1659. break;
  1660. case PathInfoHttpMethod.POST:
  1661. //POST /{index}/{type}/_mapping
  1662. if (!pathInfo.Index.IsNullOrEmpty() && !pathInfo.Type.IsNullOrEmpty() && body != null)
  1663. return this.Raw.IndicesPutMappingPost<T>(pathInfo.Index,pathInfo.Type,body,u => pathInfo.RequestParameters);
  1664. //POST /_mapping/{type}
  1665. if (!pathInfo.Type.IsNullOrEmpty() && body != null)
  1666. return this.Raw.IndicesPutMappingPostForAll<T>(pathInfo.Type,body,u => pathInfo.RequestParameters);
  1667. break;
  1668. }
  1669. throw new DispatchException("Could not dispatch IElasticClient.IndicesPutMapping() into any of the following paths: \r\n - /{index}/{type}/_mapping\r\n - /{index}/_mapping/{type}\r\n - /_mapping/{type}\r\n - /{index}/{type}/_mappings\r\n - /{index}/_mappings/{type}\r\n - /_mappings/{type}");
  1670. }
  1671. internal Task<ElasticsearchResponse<T>> IndicesPutMappingDispatchAsync<T>(ElasticsearchPathInfo<PutMappingRequestParameters> pathInfo , object body)
  1672. {
  1673. switch(pathInfo.HttpMethod)
  1674. {
  1675. case PathInfoHttpMethod.PUT:
  1676. //PUT /{index}/{type}/_mapping
  1677. if (!pathInfo.Index.IsNullOrEmpty() && !pathInfo.Type.IsNullOrEmpty() && body != null)
  1678. return this.Raw.IndicesPutMappingAsync<T>(pathInfo.Index,pathInfo.Type,body,u => pathInfo.RequestParameters);
  1679. //PUT /_mapping/{type}
  1680. if (!pathInfo.Type.IsNullOrEmpty() && body != null)
  1681. return this.Raw.IndicesPutMappingForAllAsync<T>(pathInfo.Type,body,u => pathInfo.RequestParameters);
  1682. break;
  1683. case PathInfoHttpMethod.POST:
  1684. //POST /{index}/{type}/_mapping
  1685. if (!pathInfo.Index.IsNullOrEmpty() && !pathInfo.Type.IsNullOrEmpty() && body != null)
  1686. return this.Raw.IndicesPutMappingPostAsync<T>(pathInfo.Index,pathInfo.Type,body,u => pathInfo.RequestParameters);
  1687. //POST /_mapping/{type}
  1688. if (!pathInfo.Type.IsNullOrEmpty() && body != null)
  1689. return this.Raw.IndicesPutMappingPostForAllAsync<T>(pathInfo.Type,body,u => pathInfo.RequestParameters);
  1690. break;
  1691. }
  1692. throw new DispatchException("Could not dispatch IElasticClient.IndicesPutMapping() into any of the following paths: \r\n - /{index}/{type}/_mapping\r\n - /{index}/_mapping/{type}\r\n - /_mapping/{type}\r\n - /{index}/{type}/_mappings\r\n - /{index}/_mappings/{type}\r\n - /_mappings/{type}");
  1693. }
  1694. internal ElasticsearchResponse<T> IndicesPutSettingsDispatch<T>(ElasticsearchPathInfo<UpdateSettingsRequestParameters> pathInfo , object body)
  1695. {
  1696. switch(pathInfo.HttpMethod)
  1697. {
  1698. case PathInfoHttpMethod.PUT:
  1699. //PUT /{index}/_settings
  1700. if (!pathInfo.Index.IsNullOrEmpty() && body != null)
  1701. return this.Raw.IndicesPutSettings<T>(pathInfo.Index,body,u => pathInfo.RequestParameters);
  1702. //PUT /_settings
  1703. if (body != null)
  1704. return this.Raw.IndicesPutSettingsForAll<T>(body,u => pathInfo.RequestParameters);
  1705. break;
  1706. }
  1707. throw new DispatchException("Could not dispatch IElasticClient.IndicesPutSettings() into any of the following paths: \r\n - /_settings\r\n - /{index}/_settings");
  1708. }
  1709. internal Task<ElasticsearchResponse<T>> IndicesPutSettingsDispatchAsync<T>(ElasticsearchPathInfo<UpdateSettingsRequestParameters> pathInfo , object body)
  1710. {
  1711. switch(pathInfo.HttpMethod)
  1712. {
  1713. case PathInfoHttpMethod.PUT:
  1714. //PUT /{index}/_settings
  1715. if (!pathInfo.Index.IsNullOrEmpty() && body != null)
  1716. return this.Raw.IndicesPutSettingsAsync<T>(pathInfo.Index,body,u => pathInfo.RequestParameters);
  1717. //PUT /_settings
  1718. if (body != null)
  1719. return this.Raw.IndicesPutSettingsForAllAsync<T>(body,u => pathInfo.RequestParameters);
  1720. break;
  1721. }
  1722. throw new DispatchException("Could not dispatch IElasticClient.IndicesPutSettings() into any of the following paths: \r\n - /_settings\r\n - /{index}/_settings");
  1723. }
  1724. internal ElasticsearchResponse<T> IndicesPutTemplateDispatch<T>(ElasticsearchPathInfo<PutTemplateRequestParameters> pathInfo , object body)
  1725. {
  1726. switch(pathInfo.HttpMethod)
  1727. {
  1728. case PathInfoHttpMethod.PUT:
  1729. //PUT /_template/{name}
  1730. if (!pathInfo.Name.IsNullOrEmpty() && body != null)
  1731. return this.Raw.IndicesPutTemplateForAll<T>(pathInfo.Name,body,u => pathInfo.RequestParameters);
  1732. break;
  1733. case PathInfoHttpMethod.POST:
  1734. //POST /_template/{name}
  1735. if (!pathInfo.Name.IsNullOrEmpty() && body != null)
  1736. return this.Raw.IndicesPutTemplatePostForAll<T>(pathInfo.Name,body,u => pathInfo.RequestParameters);
  1737. break;
  1738. }
  1739. throw new DispatchException("Could not dispatch IElasticClient.IndicesPutTemplate() into any of the following paths: \r\n - /_template/{name}");
  1740. }
  1741. internal Task<ElasticsearchResponse<T>> IndicesPutTemplateDispatchAsync<T>(ElasticsearchPathInfo<PutTemplateRequestParameters> pathInfo , object body)
  1742. {
  1743. switch(pathInfo.HttpMethod)
  1744. {
  1745. case PathInfoHttpMethod.PUT:
  1746. //PUT /_template/{name}
  1747. if (!pathInfo.Name.IsNullOrEmpty() && body != null)
  1748. return this.Raw.IndicesPutTemplateForAllAsync<T>(pathInfo.Name,body,u => pathInfo.RequestParameters);
  1749. break;
  1750. case PathInfoHttpMethod.POST:
  1751. //POST /_template/{name}
  1752. if (!pathInfo.Name.IsNullOrEmpty() && body != null)
  1753. return this.Raw.IndicesPutTemplatePostForAllAsync<T>(pathInfo.Name,body,u => pathInfo.RequestParameters);
  1754. break;
  1755. }
  1756. throw new DispatchException("Could not dispatch IElasticClient.IndicesPutTemplate() into any of the following paths: \r\n - /_template/{name}");
  1757. }
  1758. internal ElasticsearchResponse<T> IndicesPutWarmerDispatch<T>(ElasticsearchPathInfo<PutWarmerRequestParameters> pathInfo , object body)
  1759. {
  1760. switch(pathInfo.HttpMethod)
  1761. {
  1762. case PathInfoHttpMethod.PUT:
  1763. //PUT /{index}/{type}/_warmer/{name}
  1764. if (!pathInfo.Index.IsNullOrEmpty() && !pathInfo.Type.IsNullOrEmpty() && !pathInfo.Name.IsNullOrEmpty() && body != null)
  1765. return this.Raw.IndicesPutWarmer<T>(pathInfo.Index,pathInfo.Type,pathInfo.Name,body,u => pathInfo.RequestParameters);
  1766. //PUT /{index}/_warmer/{name}
  1767. if (!pathInfo.Index.IsNullOrEmpty() && !pathInfo.Name.IsNullOrEmpty() && body != null)
  1768. return this.Raw.IndicesPutWarmer<T>(pathInfo.Index,pathInfo.Name,body,u => pathInfo.RequestParameters);
  1769. //PUT /_warmer/{name}
  1770. if (!pathInfo.Name.IsNullOrEmpty() && body != null)
  1771. return this.Raw.IndicesPutWarmerForAll<T>(pathInfo.Name,body,u => pathInfo.RequestParameters);
  1772. break;
  1773. case PathInfoHttpMethod.POST:
  1774. //POST /{index}/{type}/_warmer/{name}
  1775. if (!pathInfo.Index.IsNullOrEmpty() && !pathInfo.Type.IsNullOrEmpty() && !pathInfo.Name.IsNullOrEmpty() && body != null)
  1776. return this.Raw.IndicesPutWarmerPost<T>(pathInfo.Index,pathInfo.Type,pathInfo.Name,body,u => pathInfo.RequestParameters);
  1777. //POST /{index}/_warmer/{name}
  1778. if (!pathInfo.Index.IsNullOrEmpty() && !pathInfo.Name.IsNullOrEmpty() && body != null)
  1779. return this.Raw.IndicesPutWarmerPost<T>(pathInfo.Index,pathInfo.Name,body,u => pathInfo.RequestParameters);
  1780. //POST /_warmer/{name}
  1781. if (!pathInfo.Name.IsNullOrEmpty() && body != null)
  1782. return this.Raw.IndicesPutWarmerPostForAll<T>(pathInfo.Name,body,u => pathInfo.RequestParameters);
  1783. break;
  1784. }
  1785. throw new DispatchException("Could not dispatch IElasticClient.IndicesPutWarmer() into any of the following paths: \r\n - /_warmer/{name}\r\n - /{index}/_warmer/{name}\r\n - /{index}/{type}/_warmer/{name}\r\n - /_warmers/{name}\r\n - /{index}/_warmers/{name}\r\n - /{index}/{type}/_warmers/{name}");
  1786. }
  1787. internal Task<ElasticsearchResponse<T>> IndicesPutWarmerDispatchAsync<T>(ElasticsearchPathInfo<PutWarmerRequestParameters> pathInfo , object body)
  1788. {
  1789. switch(pathInfo.HttpMethod)
  1790. {
  1791. case PathInfoHttpMethod.PUT:
  1792. //PUT /{index}/{type}/_warmer/{name}
  1793. if (!pathInfo.Index.IsNullOrEmpty() && !pathInfo.Type.IsNullOrEmpty() && !pathInfo.Name.IsNullOrEmpty() && body != null)
  1794. return this.Raw.IndicesPutWarmerAsync<T>(pathInfo.Index,pathInfo.Type,pathInfo.Name,body,u => pathInfo.RequestParameters);
  1795. //PUT /{index}/_warmer/{name}
  1796. if (!pathInfo.Index.IsNullOrEmpty() && !pathInfo.Name.IsNullOrEmpty() && body != null)
  1797. return this.Raw.IndicesPutWarmerAsync<T>(pathInfo.Index,pathInfo.Name,body,u => pathInfo.RequestParameters);
  1798. //PUT /_warmer/{name}
  1799. if (!pathInfo.Name.IsNullOrEmpty() && body != null)
  1800. return this.Raw.IndicesPutWarmerForAllAsync<T>(pathInfo.Name,body,u => pathInfo.RequestParameters);
  1801. break;
  1802. case PathInfoHttpMethod.POST:
  1803. //POST /{index}/{type}/_warmer/{name}
  1804. if (!pathInfo.Index.IsNullOrEmpty() && !pathInfo.Type.IsNullOrEmpty() && !pathInfo.Name.IsNullOrEmpty() && body != null)
  1805. return this.Raw.IndicesPutWarmerPostAsync<T>(pathInfo.Index,pathInfo.Type,pathInfo.Name,body,u => pathInfo.RequestParameters);
  1806. //POST /{index}/_warmer/{name}
  1807. if (!pathInfo.Index.IsNullOrEmpty() && !pathInfo.Name.IsNullOrEmpty() && body != null)
  1808. return this.Raw.IndicesPutWarmerPostAsync<T>(pathInfo.Index,pathInfo.Name,body,u => pathInfo.RequestParameters);
  1809. //POST /_warmer/{name}
  1810. if (!pathInfo.Name.IsNullOrEmpty() && body != null)
  1811. return this.Raw.IndicesPutWarmerPostForAllAsync<T>(pathInfo.Name,body,u => pathInfo.RequestParameters);
  1812. break;
  1813. }
  1814. throw new DispatchException("Could not dispatch IElasticClient.IndicesPutWarmer() into any of the following paths: \r\n - /_warmer/{name}\r\n - /{index}/_warmer/{name}\r\n - /{index}/{type}/_warmer/{name}\r\n - /_warmers/{name}\r\n - /{index}/_warmers/{name}\r\n - /{index}/{type}/_warmers/{name}");
  1815. }
  1816. internal ElasticsearchResponse<T> IndicesRecoveryDispatch<T>(ElasticsearchPathInfo<IndicesRecoveryRequestParameters> pathInfo )
  1817. {
  1818. switch(pathInfo.HttpMethod)
  1819. {
  1820. case PathInfoHttpMethod.GET:
  1821. //GET /{index}/_recovery
  1822. if (!pathInfo.Index.IsNullOrEmpty())
  1823. return this.Raw.IndicesRecovery<T>(pathInfo.Index,u => pathInfo.RequestParameters);
  1824. //GET /_recovery
  1825. return this.Raw.IndicesRecoveryForAll<T>(u => pathInfo.RequestParameters);
  1826. }
  1827. throw new DispatchException("Could not dispatch IElasticClient.IndicesRecovery() into any of the following paths: \r\n - /_recovery\r\n - /{index}/_recovery");
  1828. }
  1829. internal Task<ElasticsearchResponse<T>> IndicesRecoveryDispatchAsync<T>(ElasticsearchPathInfo<IndicesRecoveryRequestParameters> pathInfo )
  1830. {
  1831. switch(pathInfo.HttpMethod)
  1832. {
  1833. case PathInfoHttpMethod.GET:
  1834. //GET /{index}/_recovery
  1835. if (!pathInfo.Index.IsNullOrEmpty())
  1836. return this.Raw.IndicesRecoveryAsync<T>(pathInfo.Index,u => pathInfo.RequestParameters);
  1837. //GET /_recovery
  1838. return this.Raw.IndicesRecoveryForAllAsync<T>(u => pathInfo.RequestParameters);
  1839. }
  1840. throw new DispatchException("Could not dispatch IElasticClient.IndicesRecovery() into any of the following paths: \r\n - /_recovery\r\n - /{index}/_recovery");
  1841. }
  1842. internal ElasticsearchResponse<T> IndicesRefreshDispatch<T>(ElasticsearchPathInfo<RefreshRequestParameters> pathInfo )
  1843. {
  1844. switch(pathInfo.HttpMethod)
  1845. {
  1846. case PathInfoHttpMethod.POST:
  1847. //POST /{index}/_refresh
  1848. if (!pathInfo.Index.IsNullOrEmpty())
  1849. return this.Raw.IndicesRefresh<T>(pathInfo.Index,u => pathInfo.RequestParameters);
  1850. //POST /_refresh
  1851. return this.Raw.IndicesRefreshForAll<T>(u => pathInfo.RequestParameters);
  1852. case PathInfoHttpMethod.GET:
  1853. //GET /{index}/_refresh
  1854. if (!pathInfo.Index.IsNullOrEmpty())
  1855. return this.Raw.IndicesRefreshGet<T>(pathInfo.Index,u => pathInfo.RequestParameters);
  1856. //GET /_refresh
  1857. return this.Raw.IndicesRefreshGetForAll<T>(u => pathInfo.RequestParameters);
  1858. }
  1859. throw new DispatchException("Could not dispatch IElasticClient.IndicesRefresh() into any of the following paths: \r\n - /_refresh\r\n - /{index}/_refresh");
  1860. }
  1861. internal Task<ElasticsearchResponse<T>> IndicesRefreshDispatchAsync<T>(ElasticsearchPathInfo<RefreshRequestParameters> pathInfo )
  1862. {
  1863. switch(pathInfo.HttpMethod)
  1864. {
  1865. case PathInfoHttpMethod.POST:
  1866. //POST /{index}/_refresh
  1867. if (!pathInfo.Index.IsNullOrEmpty())
  1868. return this.Raw.IndicesRefreshAsync<T>(pathInfo.Index,u => pathInfo.RequestParameters);
  1869. //POST /_refresh
  1870. return this.Raw.IndicesRefreshForAllAsync<T>(u => pathInfo.RequestParameters);
  1871. case PathInfoHttpMethod.GET:
  1872. //GET /{index}/_refresh
  1873. if (!pathInfo.Index.IsNullOrEmpty())
  1874. return this.Raw.IndicesRefreshGetAsync<T>(pathInfo.Index,u => pathInfo.RequestParameters);
  1875. //GET /_refresh
  1876. return this.Raw.IndicesRefreshGetForAllAsync<T>(u => pathInfo.RequestParameters);
  1877. }
  1878. throw new DispatchException("Could not dispatch IElasticClient.IndicesRefresh() into any of the following paths: \r\n - /_refresh\r\n - /{index}/_refresh");
  1879. }
  1880. internal ElasticsearchResponse<T> IndicesSegmentsDispatch<T>(ElasticsearchPathInfo<SegmentsRequestParameters> pathInfo )
  1881. {
  1882. switch(pathInfo.HttpMethod)
  1883. {
  1884. case PathInfoHttpMethod.GET:
  1885. //GET /{index}/_segments
  1886. if (!pathInfo.Index.IsNullOrEmpty())
  1887. return this.Raw.IndicesSegments<T>(pathInfo.Index,u => pathInfo.RequestParameters);
  1888. //GET /_segments
  1889. return this.Raw.IndicesSegmentsForAll<T>(u => pathInfo.RequestParameters);
  1890. }
  1891. throw new DispatchException("Could not dispatch IElasticClient.IndicesSegments() into any of the following paths: \r\n - /_segments\r\n - /{index}/_segments");
  1892. }
  1893. internal Task<ElasticsearchResponse<T>> IndicesSegmentsDispatchAsync<T>(ElasticsearchPathInfo<SegmentsRequestParameters> pathInfo )
  1894. {
  1895. switch(pathInfo.HttpMethod)
  1896. {
  1897. case PathInfoHttpMethod.GET:
  1898. //GET /{index}/_segments
  1899. if (!pathInfo.Index.IsNullOrEmpty())
  1900. return this.Raw.IndicesSegmentsAsync<T>(pathInfo.Index,u => pathInfo.RequestParameters);
  1901. //GET /_segments
  1902. return this.Raw.IndicesSegmentsForAllAsync<T>(u => pathInfo.RequestParameters);
  1903. }
  1904. throw new DispatchException("Could not dispatch IElasticClient.IndicesSegments() into any of the following paths: \r\n - /_segments\r\n - /{index}/_segments");
  1905. }
  1906. internal ElasticsearchResponse<T> IndicesSnapshotIndexDispatch<T>(ElasticsearchPathInfo<GatewaySnapshotRequestParameters> pathInfo )
  1907. {
  1908. switch(pathInfo.HttpMethod)
  1909. {
  1910. case PathInfoHttpMethod.POST:
  1911. //POST /{index}/_gateway/snapshot
  1912. if (!pathInfo.Index.IsNullOrEmpty())
  1913. return this.Raw.IndicesSnapshotIndex<T>(pathInfo.Index,u => pathInfo.RequestParameters);
  1914. //POST /_gateway/snapshot
  1915. return this.Raw.IndicesSnapshotIndexForAll<T>(u => pathInfo.RequestParameters);
  1916. }
  1917. throw new DispatchException("Could not dispatch IElasticClient.IndicesSnapshotIndex() into any of the following paths: \r\n - /_gateway/snapshot\r\n - /{index}/_gateway/snapshot");
  1918. }
  1919. internal Task<ElasticsearchResponse<T>> IndicesSnapshotIndexDispatchAsync<T>(ElasticsearchPathInfo<GatewaySnapshotRequestParameters> pathInfo )
  1920. {
  1921. switch(pathInfo.HttpMethod)
  1922. {
  1923. case PathInfoHttpMethod.POST:
  1924. //POST /{index}/_gateway/snapshot
  1925. if (!pathInfo.Index.IsNullOrEmpty())
  1926. return this.Raw.IndicesSnapshotIndexAsync<T>(pathInfo.Index,u => pathInfo.RequestParameters);
  1927. //POST /_gateway/snapshot
  1928. return this.Raw.IndicesSnapshotIndexForAllAsync<T>(u => pathInfo.RequestParameters);
  1929. }
  1930. throw new DispatchException("Could not dispatch IElasticClient.IndicesSnapshotIndex() into any of the following paths: \r\n - /_gateway/snapshot\r\n - /{index}/_gateway/snapshot");
  1931. }
  1932. internal ElasticsearchResponse<T> IndicesStatsDispatch<T>(ElasticsearchPathInfo<IndicesStatsRequestParameters> pathInfo )
  1933. {
  1934. switch(pathInfo.HttpMethod)
  1935. {
  1936. case PathInfoHttpMethod.GET:
  1937. //GET /{index}/_stats/{metric}
  1938. if (!pathInfo.Index.IsNullOrEmpty() && !pathInfo.Metric.IsNullOrEmpty())
  1939. return this.Raw.IndicesStats<T>(pathInfo.Index,pathInfo.Metric,u => pathInfo.RequestParameters);
  1940. //GET /_stats/{metric}
  1941. if (!pathInfo.Metric.IsNullOrEmpty())
  1942. return this.Raw.IndicesStatsForAll<T>(pathInfo.Metric,u => pathInfo.RequestParameters);
  1943. //GET /{index}/_stats
  1944. if (!pathInfo.Index.IsNullOrEmpty())
  1945. return this.Raw.IndicesStats<T>(pathInfo.Index,u => pathInfo.RequestParameters);
  1946. //GET /_stats
  1947. return this.Raw.IndicesStatsForAll<T>(u => pathInfo.RequestParameters);
  1948. }
  1949. throw new DispatchException("Could not dispatch IElasticClient.IndicesStats() into any of the following paths: \r\n - /_stats\r\n - /_stats/{metric}\r\n - /{index}/_stats\r\n - /{index}/_stats/{metric}");
  1950. }
  1951. internal Task<ElasticsearchResponse<T>> IndicesStatsDispatchAsync<T>(ElasticsearchPathInfo<IndicesStatsRequestParameters> pathInfo )
  1952. {
  1953. switch(pathInfo.HttpMethod)
  1954. {
  1955. case PathInfoHttpMethod.GET:
  1956. //GET /{index}/_stats/{metric}
  1957. if (!pathInfo.Index.IsNullOrEmpty() && !pathInfo.Metric.IsNullOrEmpty())
  1958. return this.Raw.IndicesStatsAsync<T>(pathInfo.Index,pathInfo.Metric,u => pathInfo.RequestParameters);
  1959. //GET /_stats/{metric}
  1960. if (!pathInfo.Metric.IsNullOrEmpty())
  1961. return this.Raw.IndicesStatsForAllAsync<T>(pathInfo.Metric,u => pathInfo.RequestParameters);
  1962. //GET /{index}/_stats
  1963. if (!pathInfo.Index.IsNullOrEmpty())
  1964. return this.Raw.IndicesStatsAsync<T>(pathInfo.Index,u => pathInfo.RequestParameters);
  1965. //GET /_stats
  1966. return this.Raw.IndicesStatsForAllAsync<T>(u => pathInfo.RequestParameters);
  1967. }
  1968. throw new DispatchException("Could not dispatch IElasticClient.IndicesStats() into any of the following paths: \r\n - /_stats\r\n - /_stats/{metric}\r\n - /{index}/_stats\r\n - /{index}/_stats/{metric}");
  1969. }
  1970. internal ElasticsearchResponse<T> IndicesStatusDispatch<T>(ElasticsearchPathInfo<IndicesStatusRequestParameters> pathInfo )
  1971. {
  1972. switch(pathInfo.HttpMethod)
  1973. {
  1974. case PathInfoHttpMethod.GET:
  1975. //GET /{index}/_status
  1976. if (!pathInfo.Index.IsNullOrEmpty())
  1977. return this.Raw.IndicesStatus<T>(pathInfo.Index,u => pathInfo.RequestParameters);
  1978. //GET /_status
  1979. return this.Raw.IndicesStatusForAll<T>(u => pathInfo.RequestParameters);
  1980. }
  1981. throw new DispatchException("Could not dispatch IElasticClient.IndicesStatus() into any of the following paths: \r\n - /_status\r\n - /{index}/_status");
  1982. }
  1983. internal Task<ElasticsearchResponse<T>> IndicesStatusDispatchAsync<T>(ElasticsearchPathInfo<IndicesStatusRequestParameters> pathInfo )
  1984. {
  1985. switch(pathInfo.HttpMethod)
  1986. {
  1987. case PathInfoHttpMethod.GET:
  1988. //GET /{index}/_status
  1989. if (!pathInfo.Index.IsNullOrEmpty())
  1990. return this.Raw.IndicesStatusAsync<T>(pathInfo.Index,u => pathInfo.RequestParameters);
  1991. //GET /_status
  1992. return this.Raw.IndicesStatusForAllAsync<T>(u => pathInfo.RequestParameters);
  1993. }
  1994. throw new DispatchException("Could not dispatch IElasticClient.IndicesStatus() into any of the following paths: \r\n - /_status\r\n - /{index}/_status");
  1995. }
  1996. internal ElasticsearchResponse<T> IndicesUpdateAliasesDispatch<T>(ElasticsearchPathInfo<AliasRequestParameters> pathInfo , object body)
  1997. {
  1998. switch(pathInfo.HttpMethod)
  1999. {
  2000. case PathInfoHttpMethod.POST:
  2001. //POST /_aliases
  2002. if (body != null)
  2003. return this.Raw.IndicesUpdateAliasesForAll<T>(body,u => pathInfo.RequestParameters);
  2004. break;
  2005. }
  2006. throw new DispatchException("Could not dispatch IElasticClient.IndicesUpdateAliases() into any of the following paths: \r\n - /_aliases");
  2007. }
  2008. internal Task<ElasticsearchResponse<T>> IndicesUpdateAliasesDispatchAsync<T>(ElasticsearchPathInfo<AliasRequestParameters> pathInfo , object body)
  2009. {
  2010. switch(pathInfo.HttpMethod)
  2011. {
  2012. case PathInfoHttpMethod.POST:
  2013. //POST /_aliases
  2014. if (body != null)
  2015. return this.Raw.IndicesUpdateAliasesForAllAsync<T>(body,u => pathInfo.RequestParameters);
  2016. break;
  2017. }
  2018. throw new DispatchException("Could not dispatch IElasticClient.IndicesUpdateAliases() into any of the following paths: \r\n - /_aliases");
  2019. }
  2020. internal ElasticsearchResponse<T> IndicesValidateQueryDispatch<T>(ElasticsearchPathInfo<ValidateQueryRequestParameters> pathInfo , object body)
  2021. {
  2022. switch(pathInfo.HttpMethod)
  2023. {
  2024. case PathInfoHttpMethod.GET:
  2025. //GET /{index}/{type}/_validate/query
  2026. if (!pathInfo.Index.IsNullOrEmpty() && !pathInfo.Type.IsNullOrEmpty())
  2027. return this.Raw.IndicesValidateQueryGet<T>(pathInfo.Index,pathInfo.Type,u => pathInfo.RequestParameters);
  2028. //GET /{index}/_validate/query
  2029. if (!pathInfo.Index.IsNullOrEmpty())
  2030. return this.Raw.IndicesValidateQueryGet<T>(pathInfo.Index,u => pathInfo.RequestParameters);
  2031. //GET /_validate/query
  2032. return this.Raw.IndicesValidateQueryGetForAll<T>(u => pathInfo.RequestParameters);
  2033. case PathInfoHttpMethod.POST:
  2034. //POST /{index}/{type}/_validate/query
  2035. if (!pathInfo.Index.IsNullOrEmpty() && !pathInfo.Type.IsNullOrEmpty() && body != null)
  2036. return this.Raw.IndicesValidateQuery<T>(pathInfo.Index,pathInfo.Type,body,u => pathInfo.RequestParameters);
  2037. //POST /{index}/_validate/query
  2038. if (!pathInfo.Index.IsNullOrEmpty() && body != null)
  2039. return this.Raw.IndicesValidateQuery<T>(pathInfo.Index,body,u => pathInfo.RequestParameters);
  2040. //POST /_validate/query
  2041. if (body != null)
  2042. return this.Raw.IndicesValidateQueryForAll<T>(body,u => pathInfo.RequestParameters);
  2043. break;
  2044. }
  2045. throw new DispatchException("Could not dispatch IElasticClient.IndicesValidateQuery() into any of the following paths: \r\n - /_validate/query\r\n - /{index}/_validate/query\r\n - /{index}/{type}/_validate/query");
  2046. }
  2047. internal Task<ElasticsearchResponse<T>> IndicesValidateQueryDispatchAsync<T>(ElasticsearchPathInfo<ValidateQueryRequestParameters> pathInfo , object body)
  2048. {
  2049. switch(pathInfo.HttpMethod)
  2050. {
  2051. case PathInfoHttpMethod.GET:
  2052. //GET /{index}/{type}/_validate/query
  2053. if (!pathInfo.Index.IsNullOrEmpty() && !pathInfo.Type.IsNullOrEmpty())
  2054. return this.Raw.IndicesValidateQueryGetAsync<T>(pathInfo.Index,pathInfo.Type,u => pathInfo.RequestParameters);
  2055. //GET /{index}/_validate/query
  2056. if (!pathInfo.Index.IsNullOrEmpty())
  2057. return this.Raw.IndicesValidateQueryGetAsync<T>(pathInfo.Index,u => pathInfo.RequestParameters);
  2058. //GET /_validate/query
  2059. return this.Raw.IndicesValidateQueryGetForAllAsync<T>(u => pathInfo.RequestParameters);
  2060. case PathInfoHttpMethod.POST:
  2061. //POST /{index}/{type}/_validate/query
  2062. if (!pathInfo.Index.IsNullOrEmpty() && !pathInfo.Type.IsNullOrEmpty() && body != null)
  2063. return this.Raw.IndicesValidateQueryAsync<T>(pathInfo.Index,pathInfo.Type,body,u => pathInfo.RequestParameters);
  2064. //POST /{index}/_validate/query
  2065. if (!pathInfo.Index.IsNullOrEmpty() && body != null)
  2066. return this.Raw.IndicesValidateQueryAsync<T>(pathInfo.Index,body,u => pathInfo.RequestParameters);
  2067. //POST /_validate/query
  2068. if (body != null)
  2069. return this.Raw.IndicesValidateQueryForAllAsync<T>(body,u => pathInfo.RequestParameters);
  2070. break;
  2071. }
  2072. throw new DispatchException("Could not dispatch IElasticClient.IndicesValidateQuery() into any of the following paths: \r\n - /_validate/query\r\n - /{index}/_validate/query\r\n - /{index}/{type}/_validate/query");
  2073. }
  2074. internal ElasticsearchResponse<T> InfoDispatch<T>(ElasticsearchPathInfo<InfoRequestParameters> pathInfo )
  2075. {
  2076. switch(pathInfo.HttpMethod)
  2077. {
  2078. case PathInfoHttpMethod.GET:
  2079. //GET /
  2080. return this.Raw.Info<T>(u => pathInfo.RequestParameters);
  2081. }
  2082. throw new DispatchException("Could not dispatch IElasticClient.Info() into any of the following paths: \r\n - /");
  2083. }
  2084. internal Task<ElasticsearchResponse<T>> InfoDispatchAsync<T>(ElasticsearchPathInfo<InfoRequestParameters> pathInfo )
  2085. {
  2086. switch(pathInfo.HttpMethod)
  2087. {
  2088. case PathInfoHttpMethod.GET:
  2089. //GET /
  2090. return this.Raw.InfoAsync<T>(u => pathInfo.RequestParameters);
  2091. }
  2092. throw new DispatchException("Could not dispatch IElasticClient.Info() into any of the following paths: \r\n - /");
  2093. }
  2094. internal ElasticsearchResponse<T> MgetDispatch<T>(ElasticsearchPathInfo<MultiGetRequestParameters> pathInfo , object body)
  2095. {
  2096. switch(pathInfo.HttpMethod)
  2097. {
  2098. case PathInfoHttpMethod.GET:
  2099. //GET /{index}/{type}/_mget
  2100. if (!pathInfo.Index.IsNullOrEmpty() && !pathInfo.Type.IsNullOrEmpty())
  2101. return this.Raw.MgetGet<T>(pathInfo.Index,pathInfo.Type,u => pathInfo.RequestParameters);
  2102. //GET /{index}/_mget
  2103. if (!pathInfo.Index.IsNullOrEmpty())
  2104. return this.Raw.MgetGet<T>(pathInfo.Index,u => pathInfo.RequestParameters);
  2105. //GET /_mget
  2106. return this.Raw.MgetGet<T>(u => pathInfo.RequestParameters);
  2107. case PathInfoHttpMethod.POST:
  2108. //POST /{index}/{type}/_mget
  2109. if (!pathInfo.Index.IsNullOrEmpty() && !pathInfo.Type.IsNullOrEmpty() && body != null)
  2110. return this.Raw.Mget<T>(pathInfo.Index,pathInfo.Type,body,u => pathInfo.RequestParameters);
  2111. //POST /{index}/_mget
  2112. if (!pathInfo.Index.IsNullOrEmpty() && body != null)
  2113. return this.Raw.Mget<T>(pathInfo.Index,body,u => pathInfo.RequestParameters);
  2114. //POST /_mget
  2115. if (body != null)
  2116. return this.Raw.Mget<T>(body,u => pathInfo.RequestParameters);
  2117. break;
  2118. }
  2119. throw new DispatchException("Could not dispatch IElasticClient.Mget() into any of the following paths: \r\n - /_mget\r\n - /{index}/_mget\r\n - /{index}/{type}/_mget");
  2120. }
  2121. internal Task<ElasticsearchResponse<T>> MgetDispatchAsync<T>(ElasticsearchPathInfo<MultiGetRequestParameters> pathInfo , object body)
  2122. {
  2123. switch(pathInfo.HttpMethod)
  2124. {
  2125. case PathInfoHttpMethod.GET:
  2126. //GET /{index}/{type}/_mget
  2127. if (!pathInfo.Index.IsNullOrEmpty() && !pathInfo.Type.IsNullOrEmpty())
  2128. return this.Raw.MgetGetAsync<T>(pathInfo.Index,pathInfo.Type,u => pathInfo.RequestParameters);
  2129. //GET /{index}/_mget
  2130. if (!pathInfo.Index.IsNullOrEmpty())
  2131. return this.Raw.MgetGetAsync<T>(pathInfo.Index,u => pathInfo.RequestParameters);
  2132. //GET /_mget
  2133. return this.Raw.MgetGetAsync<T>(u => pathInfo.RequestParameters);
  2134. case PathInfoHttpMethod.POST:
  2135. //POST /{index}/{type}/_mget
  2136. if (!pathInfo.Index.IsNullOrEmpty() && !pathInfo.Type.IsNullOrEmpty() && body != null)
  2137. return this.Raw.MgetAsync<T>(pathInfo.Index,pathInfo.Type,body,u => pathInfo.RequestParameters);
  2138. //POST /{index}/_mget
  2139. if (!pathInfo.Index.IsNullOrEmpty() && body != null)
  2140. return this.Raw.MgetAsync<T>(pathInfo.Index,body,u => pathInfo.RequestParameters);
  2141. //POST /_mget
  2142. if (body != null)
  2143. return this.Raw.MgetAsync<T>(body,u => pathInfo.RequestParameters);
  2144. break;
  2145. }
  2146. throw new DispatchException("Could not dispatch IElasticClient.Mget() into any of the following paths: \r\n - /_mget\r\n - /{index}/_mget\r\n - /{index}/{type}/_mget");
  2147. }
  2148. internal ElasticsearchResponse<T> MltDispatch<T>(ElasticsearchPathInfo<MoreLikeThisRequestParameters> pathInfo , object body)
  2149. {
  2150. switch(pathInfo.HttpMethod)
  2151. {
  2152. case PathInfoHttpMethod.GET:
  2153. //GET /{index}/{type}/{id}/_mlt
  2154. if (!pathInfo.Index.IsNullOrEmpty() && !pathInfo.Type.IsNullOrEmpty() && !pathInfo.Id.IsNullOrEmpty())
  2155. return this.Raw.MltGet<T>(pathInfo.Index,pathInfo.Type,pathInfo.Id,u => pathInfo.RequestParameters);
  2156. break;
  2157. case PathInfoHttpMethod.POST:
  2158. //POST /{index}/{type}/{id}/_mlt
  2159. if (!pathInfo.Index.IsNullOrEmpty() && !pathInfo.Type.IsNullOrEmpty() && !pathInfo.Id.IsNullOrEmpty() && body != null)
  2160. return this.Raw.Mlt<T>(pathInfo.Index,pathInfo.Type,pathInfo.Id,body,u => pathInfo.RequestParameters);
  2161. break;
  2162. }
  2163. throw new DispatchException("Could not dispatch IElasticClient.Mlt() into any of the following paths: \r\n - /{index}/{type}/{id}/_mlt");
  2164. }
  2165. internal Task<ElasticsearchResponse<T>> MltDispatchAsync<T>(ElasticsearchPathInfo<MoreLikeThisRequestParameters> pathInfo , object body)
  2166. {
  2167. switch(pathInfo.HttpMethod)
  2168. {
  2169. case PathInfoHttpMethod.GET:
  2170. //GET /{index}/{type}/{id}/_mlt
  2171. if (!pathInfo.Index.IsNullOrEmpty() && !pathInfo.Type.IsNullOrEmpty() && !pathInfo.Id.IsNullOrEmpty())
  2172. return this.Raw.MltGetAsync<T>(pathInfo.Index,pathInfo.Type,pathInfo.Id,u => pathInfo.RequestParameters);
  2173. break;
  2174. case PathInfoHttpMethod.POST:
  2175. //POST /{index}/{type}/{id}/_mlt
  2176. if (!pathInfo.Index.IsNullOrEmpty() && !pathInfo.Type.IsNullOrEmpty() && !pathInfo.Id.IsNullOrEmpty() && body != null)
  2177. return this.Raw.MltAsync<T>(pathInfo.Index,pathInfo.Type,pathInfo.Id,body,u => pathInfo.RequestParameters);
  2178. break;
  2179. }
  2180. throw new DispatchException("Could not dispatch IElasticClient.Mlt() into any of the following paths: \r\n - /{index}/{type}/{id}/_mlt");
  2181. }
  2182. internal ElasticsearchResponse<T> MpercolateDispatch<T>(ElasticsearchPathInfo<MpercolateRequestParameters> pathInfo , object body)
  2183. {
  2184. switch(pathInfo.HttpMethod)
  2185. {
  2186. case PathInfoHttpMethod.GET:
  2187. //GET /{index}/{type}/_mpercolate
  2188. if (!pathInfo.Index.IsNullOrEmpty() && !pathInfo.Type.IsNullOrEmpty())
  2189. return this.Raw.MpercolateGet<T>(pathInfo.Index,pathInfo.Type,u => pathInfo.RequestParameters);
  2190. //GET /{index}/_mpercolate
  2191. if (!pathInfo.Index.IsNullOrEmpty())
  2192. return this.Raw.MpercolateGet<T>(pathInfo.Index,u => pathInfo.RequestParameters);
  2193. //GET /_mpercolate
  2194. return this.Raw.MpercolateGet<T>(u => pathInfo.RequestParameters);
  2195. case PathInfoHttpMethod.POST:
  2196. //POST /{index}/{type}/_mpercolate
  2197. if (!pathInfo.Index.IsNullOrEmpty() && !pathInfo.Type.IsNullOrEmpty() && body != null)
  2198. return this.Raw.Mpercolate<T>(pathInfo.Index,pathInfo.Type,body,u => pathInfo.RequestParameters);
  2199. //POST /{index}/_mpercolate
  2200. if (!pathInfo.Index.IsNullOrEmpty() && body != null)
  2201. return this.Raw.Mpercolate<T>(pathInfo.Index,body,u => pathInfo.RequestParameters);
  2202. //POST /_mpercolate
  2203. if (body != null)
  2204. return this.Raw.Mpercolate<T>(body,u => pathInfo.RequestParameters);
  2205. break;
  2206. }
  2207. throw new DispatchException("Could not dispatch IElasticClient.Mpercolate() into any of the following paths: \r\n - /_mpercolate\r\n - /{index}/_mpercolate\r\n - /{index}/{type}/_mpercolate");
  2208. }
  2209. internal Task<ElasticsearchResponse<T>> MpercolateDispatchAsync<T>(ElasticsearchPathInfo<MpercolateRequestParameters> pathInfo , object body)
  2210. {
  2211. switch(pathInfo.HttpMethod)
  2212. {
  2213. case PathInfoHttpMethod.GET:
  2214. //GET /{index}/{type}/_mpercolate
  2215. if (!pathInfo.Index.IsNullOrEmpty() && !pathInfo.Type.IsNullOrEmpty())
  2216. return this.Raw.MpercolateGetAsync<T>(pathInfo.Index,pathInfo.Type,u => pathInfo.RequestParameters);
  2217. //GET /{index}/_mpercolate
  2218. if (!pathInfo.Index.IsNullOrEmpty())
  2219. return this.Raw.MpercolateGetAsync<T>(pathInfo.Index,u => pathInfo.RequestParameters);
  2220. //GET /_mpercolate
  2221. return this.Raw.MpercolateGetAsync<T>(u => pathInfo.RequestParameters);
  2222. case PathInfoHttpMethod.POST:
  2223. //POST /{index}/{type}/_mpercolate
  2224. if (!pathInfo.Index.IsNullOrEmpty() && !pathInfo.Type.IsNullOrEmpty() && body != null)
  2225. return this.Raw.MpercolateAsync<T>(pathInfo.Index,pathInfo.Type,body,u => pathInfo.RequestParameters);
  2226. //POST /{index}/_mpercolate
  2227. if (!pathInfo.Index.IsNullOrEmpty() && body != null)
  2228. return this.Raw.MpercolateAsync<T>(pathInfo.Index,body,u => pathInfo.RequestParameters);
  2229. //POST /_mpercolate
  2230. if (body != null)
  2231. return this.Raw.MpercolateAsync<T>(body,u => pathInfo.RequestParameters);
  2232. break;
  2233. }
  2234. throw new DispatchException("Could not dispatch IElasticClient.Mpercolate() into any of the following paths: \r\n - /_mpercolate\r\n - /{index}/_mpercolate\r\n - /{index}/{type}/_mpercolate");
  2235. }
  2236. internal ElasticsearchResponse<T> MsearchDispatch<T>(ElasticsearchPathInfo<MultiSearchRequestParameters> pathInfo , object body)
  2237. {
  2238. switch(pathInfo.HttpMethod)
  2239. {
  2240. case PathInfoHttpMethod.GET:
  2241. //GET /{index}/{type}/_msearch
  2242. if (!pathInfo.Index.IsNullOrEmpty() && !pathInfo.Type.IsNullOrEmpty())
  2243. return this.Raw.MsearchGet<T>(pathInfo.Index,pathInfo.Type,u => pathInfo.RequestParameters);
  2244. //GET /{index}/_msearch
  2245. if (!pathInfo.Index.IsNullOrEmpty())
  2246. return this.Raw.MsearchGet<T>(pathInfo.Index,u => pathInfo.RequestParameters);
  2247. //GET /_msearch
  2248. return this.Raw.MsearchGet<T>(u => pathInfo.RequestParameters);
  2249. case PathInfoHttpMethod.POST:
  2250. //POST /{index}/{type}/_msearch
  2251. if (!pathInfo.Index.IsNullOrEmpty() && !pathInfo.Type.IsNullOrEmpty() && body != null)
  2252. return this.Raw.Msearch<T>(pathInfo.Index,pathInfo.Type,body,u => pathInfo.RequestParameters);
  2253. //POST /{index}/_msearch
  2254. if (!pathInfo.Index.IsNullOrEmpty() && body != null)
  2255. return this.Raw.Msearch<T>(pathInfo.Index,body,u => pathInfo.RequestParameters);
  2256. //POST /_msearch
  2257. if (body != null)
  2258. return this.Raw.Msearch<T>(body,u => pathInfo.RequestParameters);
  2259. break;
  2260. }
  2261. throw new DispatchException("Could not dispatch IElasticClient.Msearch() into any of the following paths: \r\n - /_msearch\r\n - /{index}/_msearch\r\n - /{index}/{type}/_msearch");
  2262. }
  2263. internal Task<ElasticsearchResponse<T>> MsearchDispatchAsync<T>(ElasticsearchPathInfo<MultiSearchRequestParameters> pathInfo , object body)
  2264. {
  2265. switch(pathInfo.HttpMethod)
  2266. {
  2267. case PathInfoHttpMethod.GET:
  2268. //GET /{index}/{type}/_msearch
  2269. if (!pathInfo.Index.IsNullOrEmpty() && !pathInfo.Type.IsNullOrEmpty())
  2270. return this.Raw.MsearchGetAsync<T>(pathInfo.Index,pathInfo.Type,u => pathInfo.RequestParameters);
  2271. //GET /{index}/_msearch
  2272. if (!pathInfo.Index.IsNullOrEmpty())
  2273. return this.Raw.MsearchGetAsync<T>(pathInfo.Index,u => pathInfo.RequestParameters);
  2274. //GET /_msearch
  2275. return this.Raw.MsearchGetAsync<T>(u => pathInfo.RequestParameters);
  2276. case PathInfoHttpMethod.POST:
  2277. //POST /{index}/{type}/_msearch
  2278. if (!pathInfo.Index.IsNullOrEmpty() && !pathInfo.Type.IsNullOrEmpty() && body != null)
  2279. return this.Raw.MsearchAsync<T>(pathInfo.Index,pathInfo.Type,body,u => pathInfo.RequestParameters);
  2280. //POST /{index}/_msearch
  2281. if (!pathInfo.Index.IsNullOrEmpty() && body != null)
  2282. return this.Raw.MsearchAsync<T>(pathInfo.Index,body,u => pathInfo.RequestParameters);
  2283. //POST /_msearch
  2284. if (body != null)
  2285. return this.Raw.MsearchAsync<T>(body,u => pathInfo.RequestParameters);
  2286. break;
  2287. }
  2288. throw new DispatchException("Could not dispatch IElasticClient.Msearch() into any of the following paths: \r\n - /_msearch\r\n - /{index}/_msearch\r\n - /{index}/{type}/_msearch");
  2289. }
  2290. internal ElasticsearchResponse<T> MtermvectorsDispatch<T>(ElasticsearchPathInfo<MultiTermVectorsRequestParameters> pathInfo , object body)
  2291. {
  2292. switch(pathInfo.HttpMethod)
  2293. {
  2294. case PathInfoHttpMethod.GET:
  2295. //GET /{index}/{type}/_mtermvectors
  2296. if (!pathInfo.Index.IsNullOrEmpty() && !pathInfo.Type.IsNullOrEmpty())
  2297. return this.Raw.MtermvectorsGet<T>(pathInfo.Index,pathInfo.Type,u => pathInfo.RequestParameters);
  2298. //GET /{index}/_mtermvectors
  2299. if (!pathInfo.Index.IsNullOrEmpty())
  2300. return this.Raw.MtermvectorsGet<T>(pathInfo.Index,u => pathInfo.RequestParameters);
  2301. //GET /_mtermvectors
  2302. return this.Raw.MtermvectorsGet<T>(u => pathInfo.RequestParameters);
  2303. case PathInfoHttpMethod.POST:
  2304. //POST /{index}/{type}/_mtermvectors
  2305. if (!pathInfo.Index.IsNullOrEmpty() && !pathInfo.Type.IsNullOrEmpty() && body != null)
  2306. return this.Raw.Mtermvectors<T>(pathInfo.Index,pathInfo.Type,body,u => pathInfo.RequestParameters);
  2307. //POST /{index}/_mtermvectors
  2308. if (!pathInfo.Index.IsNullOrEmpty() && body != null)
  2309. return this.Raw.Mtermvectors<T>(pathInfo.Index,body,u => pathInfo.RequestParameters);
  2310. //POST /_mtermvectors
  2311. if (body != null)
  2312. return this.Raw.Mtermvectors<T>(body,u => pathInfo.RequestParameters);
  2313. break;
  2314. }
  2315. throw new DispatchException("Could not dispatch IElasticClient.Mtermvectors() into any of the following paths: \r\n - /_mtermvectors\r\n - /{index}/_mtermvectors\r\n - /{index}/{type}/_mtermvectors");
  2316. }
  2317. internal Task<ElasticsearchResponse<T>> MtermvectorsDispatchAsync<T>(ElasticsearchPathInfo<MultiTermVectorsRequestParameters> pathInfo , object body)
  2318. {
  2319. switch(pathInfo.HttpMethod)
  2320. {
  2321. case PathInfoHttpMethod.GET:
  2322. //GET /{index}/{type}/_mtermvectors
  2323. if (!pathInfo.Index.IsNullOrEmpty() && !pathInfo.Type.IsNullOrEmpty())
  2324. return this.Raw.MtermvectorsGetAsync<T>(pathInfo.Index,pathInfo.Type,u => pathInfo.RequestParameters);
  2325. //GET /{index}/_mtermvectors
  2326. if (!pathInfo.Index.IsNullOrEmpty())
  2327. return this.Raw.MtermvectorsGetAsync<T>(pathInfo.Index,u => pathInfo.RequestParameters);
  2328. //GET /_mtermvectors
  2329. return this.Raw.MtermvectorsGetAsync<T>(u => pathInfo.RequestParameters);
  2330. case PathInfoHttpMethod.POST:
  2331. //POST /{index}/{type}/_mtermvectors
  2332. if (!pathInfo.Index.IsNullOrEmpty() && !pathInfo.Type.IsNullOrEmpty() && body != null)
  2333. return this.Raw.MtermvectorsAsync<T>(pathInfo.Index,pathInfo.Type,body,u => pathInfo.RequestParameters);
  2334. //POST /{index}/_mtermvectors
  2335. if (!pathInfo.Index.IsNullOrEmpty() && body != null)
  2336. return this.Raw.MtermvectorsAsync<T>(pathInfo.Index,body,u => pathInfo.RequestParameters);
  2337. //POST /_mtermvectors
  2338. if (body != null)
  2339. return this.Raw.MtermvectorsAsync<T>(body,u => pathInfo.RequestParameters);
  2340. break;
  2341. }
  2342. throw new DispatchException("Could not dispatch IElasticClient.Mtermvectors() into any of the following paths: \r\n - /_mtermvectors\r\n - /{index}/_mtermvectors\r\n - /{index}/{type}/_mtermvectors");
  2343. }
  2344. internal ElasticsearchResponse<T> NodesHotThreadsDispatch<T>(ElasticsearchPathInfo<NodesHotThreadsRequestParameters> pathInfo )
  2345. {
  2346. switch(pathInfo.HttpMethod)
  2347. {
  2348. case PathInfoHttpMethod.GET:
  2349. //GET /_cluster/nodes/{node_id}/hotthreads
  2350. if (!pathInfo.NodeId.IsNullOrEmpty())
  2351. return this.Raw.NodesHotThreads<T>(pathInfo.NodeId,u => pathInfo.RequestParameters);
  2352. //GET /_cluster/nodes/hotthreads
  2353. return this.Raw.NodesHotThreadsForAll<T>(u => pathInfo.RequestParameters);
  2354. }
  2355. throw new DispatchException("Could not dispatch IElasticClient.NodesHotThreads() into any of the following paths: \r\n - /_cluster/nodes/hotthreads\r\n - /_cluster/nodes/hot_threads\r\n - /_cluster/nodes/{node_id}/hotthreads\r\n - /_cluster/nodes/{node_id}/hot_threads\r\n - /_nodes/hotthreads\r\n - /_nodes/hot_threads\r\n - /_nodes/{node_id}/hotthreads\r\n - /_nodes/{node_id}/hot_threads");
  2356. }
  2357. internal Task<ElasticsearchResponse<T>> NodesHotThreadsDispatchAsync<T>(ElasticsearchPathInfo<NodesHotThreadsRequestParameters> pathInfo )
  2358. {
  2359. switch(pathInfo.HttpMethod)
  2360. {
  2361. case PathInfoHttpMethod.GET:
  2362. //GET /_cluster/nodes/{node_id}/hotthreads
  2363. if (!pathInfo.NodeId.IsNullOrEmpty())
  2364. return this.Raw.NodesHotThreadsAsync<T>(pathInfo.NodeId,u => pathInfo.RequestParameters);
  2365. //GET /_cluster/nodes/hotthreads
  2366. return this.Raw.NodesHotThreadsForAllAsync<T>(u => pathInfo.RequestParameters);
  2367. }
  2368. throw new DispatchException("Could not dispatch IElasticClient.NodesHotThreads() into any of the following paths: \r\n - /_cluster/nodes/hotthreads\r\n - /_cluster/nodes/hot_threads\r\n - /_cluster/nodes/{node_id}/hotthreads\r\n - /_cluster/nodes/{node_id}/hot_threads\r\n - /_nodes/hotthreads\r\n - /_nodes/hot_threads\r\n - /_nodes/{node_id}/hotthreads\r\n - /_nodes/{node_id}/hot_threads");
  2369. }
  2370. internal ElasticsearchResponse<T> NodesInfoDispatch<T>(ElasticsearchPathInfo<NodesInfoRequestParameters> pathInfo )
  2371. {
  2372. switch(pathInfo.HttpMethod)
  2373. {
  2374. case PathInfoHttpMethod.GET:
  2375. //GET /_nodes/{node_id}/{metric}
  2376. if (!pathInfo.NodeId.IsNullOrEmpty() && !pathInfo.Metric.IsNullOrEmpty())
  2377. return this.Raw.NodesInfo<T>(pathInfo.NodeId,pathInfo.Metric,u => pathInfo.RequestParameters);
  2378. //GET /_nodes/{node_id}
  2379. if (!pathInfo.NodeId.IsNullOrEmpty())
  2380. return this.Raw.NodesInfo<T>(pathInfo.NodeId,u => pathInfo.RequestParameters);
  2381. //GET /_nodes/{metric}
  2382. if (!pathInfo.Metric.IsNullOrEmpty())
  2383. return this.Raw.NodesInfoForAll<T>(pathInfo.Metric,u => pathInfo.RequestParameters);
  2384. //GET /_nodes
  2385. return this.Raw.NodesInfoForAll<T>(u => pathInfo.RequestParameters);
  2386. }
  2387. throw new DispatchException("Could not dispatch IElasticClient.NodesInfo() into any of the following paths: \r\n - /_nodes\r\n - /_nodes/{node_id}\r\n - /_nodes/{metric}\r\n - /_nodes/{node_id}/{metric}");
  2388. }
  2389. internal Task<ElasticsearchResponse<T>> NodesInfoDispatchAsync<T>(ElasticsearchPathInfo<NodesInfoRequestParameters> pathInfo )
  2390. {
  2391. switch(pathInfo.HttpMethod)
  2392. {
  2393. case PathInfoHttpMethod.GET:
  2394. //GET /_nodes/{node_id}/{metric}
  2395. if (!pathInfo.NodeId.IsNullOrEmpty() && !pathInfo.Metric.IsNullOrEmpty())
  2396. return this.Raw.NodesInfoAsync<T>(pathInfo.NodeId,pathInfo.Metric,u => pathInfo.RequestParameters);
  2397. //GET /_nodes/{node_id}
  2398. if (!pathInfo.NodeId.IsNullOrEmpty())
  2399. return this.Raw.NodesInfoAsync<T>(pathInfo.NodeId,u => pathInfo.RequestParameters);
  2400. //GET /_nodes/{metric}
  2401. if (!pathInfo.Metric.IsNullOrEmpty())
  2402. return this.Raw.NodesInfoForAllAsync<T>(pathInfo.Metric,u => pathInfo.RequestParameters);
  2403. //GET /_nodes
  2404. return this.Raw.NodesInfoForAllAsync<T>(u => pathInfo.RequestParameters);
  2405. }
  2406. throw new DispatchException("Could not dispatch IElasticClient.NodesInfo() into any of the following paths: \r\n - /_nodes\r\n - /_nodes/{node_id}\r\n - /_nodes/{metric}\r\n - /_nodes/{node_id}/{metric}");
  2407. }
  2408. internal ElasticsearchResponse<T> NodesShutdownDispatch<T>(ElasticsearchPathInfo<NodesShutdownRequestParameters> pathInfo )
  2409. {
  2410. switch(pathInfo.HttpMethod)
  2411. {
  2412. case PathInfoHttpMethod.POST:
  2413. //POST /_cluster/nodes/{node_id}/_shutdown
  2414. if (!pathInfo.NodeId.IsNullOrEmpty())
  2415. return this.Raw.NodesShutdown<T>(pathInfo.NodeId,u => pathInfo.RequestParameters);
  2416. //POST /_shutdown
  2417. return this.Raw.NodesShutdownForAll<T>(u => pathInfo.RequestParameters);
  2418. }
  2419. throw new DispatchException("Could not dispatch IElasticClient.NodesShutdown() into any of the following paths: \r\n - /_shutdown\r\n - /_cluster/nodes/_shutdown\r\n - /_cluster/nodes/{node_id}/_shutdown");
  2420. }
  2421. internal Task<ElasticsearchResponse<T>> NodesShutdownDispatchAsync<T>(ElasticsearchPathInfo<NodesShutdownRequestParameters> pathInfo )
  2422. {
  2423. switch(pathInfo.HttpMethod)
  2424. {
  2425. case PathInfoHttpMethod.POST:
  2426. //POST /_cluster/nodes/{node_id}/_shutdown
  2427. if (!pathInfo.NodeId.IsNullOrEmpty())
  2428. return this.Raw.NodesShutdownAsync<T>(pathInfo.NodeId,u => pathInfo.RequestParameters);
  2429. //POST /_shutdown
  2430. return this.Raw.NodesShutdownForAllAsync<T>(u => pathInfo.RequestParameters);
  2431. }
  2432. throw new DispatchException("Could not dispatch IElasticClient.NodesShutdown() into any of the following paths: \r\n - /_shutdown\r\n - /_cluster/nodes/_shutdown\r\n - /_cluster/nodes/{node_id}/_shutdown");
  2433. }
  2434. internal ElasticsearchResponse<T> NodesStatsDispatch<T>(ElasticsearchPathInfo<NodesStatsRequestParameters> pathInfo )
  2435. {
  2436. switch(pathInfo.HttpMethod)
  2437. {
  2438. case PathInfoHttpMethod.GET:
  2439. //GET /_nodes/{node_id}/stats/{metric}/{index_metric}
  2440. if (!pathInfo.NodeId.IsNullOrEmpty() && !pathInfo.Metric.IsNullOrEmpty() && !pathInfo.IndexMetric.IsNullOrEmpty())
  2441. return this.Raw.NodesStats<T>(pathInfo.NodeId,pathInfo.Metric,pathInfo.IndexMetric,u => pathInfo.RequestParameters);
  2442. //GET /_nodes/{node_id}/stats/{metric}
  2443. if (!pathInfo.NodeId.IsNullOrEmpty() && !pathInfo.Metric.IsNullOrEmpty())
  2444. return this.Raw.NodesStats<T>(pathInfo.NodeId,pathInfo.Metric,u => pathInfo.RequestParameters);
  2445. //GET /_nodes/stats/{metric}/{index_metric}
  2446. if (!pathInfo.Metric.IsNullOrEmpty() && !pathInfo.IndexMetric.IsNullOrEmpty())
  2447. return this.Raw.NodesStatsForAll<T>(pathInfo.Metric,pathInfo.IndexMetric,u => pathInfo.RequestParameters);
  2448. //GET /_nodes/{node_id}/stats
  2449. if (!pathInfo.NodeId.IsNullOrEmpty())
  2450. return this.Raw.NodesStats<T>(pathInfo.NodeId,u => pathInfo.RequestParameters);
  2451. //GET /_nodes/stats/{metric}
  2452. if (!pathInfo.Metric.IsNullOrEmpty())
  2453. return this.Raw.NodesStatsForAll<T>(pathInfo.Metric,u => pathInfo.RequestParameters);
  2454. //GET /_nodes/stats
  2455. return this.Raw.NodesStatsForAll<T>(u => pathInfo.RequestParameters);
  2456. }
  2457. throw new DispatchException("Could not dispatch IElasticClient.NodesStats() into any of the following paths: \r\n - /_nodes/stats\r\n - /_nodes/{node_id}/stats\r\n - /_nodes/stats/{metric}\r\n - /_nodes/{node_id}/stats/{metric}\r\n - /_nodes/stats/{metric}/{index_metric}\r\n - /_nodes/{node_id}/stats/{metric}/{index_metric}");
  2458. }
  2459. internal Task<ElasticsearchResponse<T>> NodesStatsDispatchAsync<T>(ElasticsearchPathInfo<NodesStatsRequestParameters> pathInfo )
  2460. {
  2461. switch(pathInfo.HttpMethod)
  2462. {
  2463. case PathInfoHttpMethod.GET:
  2464. //GET /_nodes/{node_id}/stats/{metric}/{index_metric}
  2465. if (!pathInfo.NodeId.IsNullOrEmpty() && !pathInfo.Metric.IsNullOrEmpty() && !pathInfo.IndexMetric.IsNullOrEmpty())
  2466. return this.Raw.NodesStatsAsync<T>(pathInfo.NodeId,pathInfo.Metric,pathInfo.IndexMetric,u => pathInfo.RequestParameters);
  2467. //GET /_nodes/{node_id}/stats/{metric}
  2468. if (!pathInfo.NodeId.IsNullOrEmpty() && !pathInfo.Metric.IsNullOrEmpty())
  2469. return this.Raw.NodesStatsAsync<T>(pathInfo.NodeId,pathInfo.Metric,u => pathInfo.RequestParameters);
  2470. //GET /_nodes/stats/{metric}/{index_metric}
  2471. if (!pathInfo.Metric.IsNullOrEmpty() && !pathInfo.IndexMetric.IsNullOrEmpty())
  2472. return this.Raw.NodesStatsForAllAsync<T>(pathInfo.Metric,pathInfo.IndexMetric,u => pathInfo.RequestParameters);
  2473. //GET /_nodes/{node_id}/stats
  2474. if (!pathInfo.NodeId.IsNullOrEmpty())
  2475. return this.Raw.NodesStatsAsync<T>(pathInfo.NodeId,u => pathInfo.RequestParameters);
  2476. //GET /_nodes/stats/{metric}
  2477. if (!pathInfo.Metric.IsNullOrEmpty())
  2478. return this.Raw.NodesStatsForAllAsync<T>(pathInfo.Metric,u => pathInfo.RequestParameters);
  2479. //GET /_nodes/stats
  2480. return this.Raw.NodesStatsForAllAsync<T>(u => pathInfo.RequestParameters);
  2481. }
  2482. throw new DispatchException("Could not dispatch IElasticClient.NodesStats() into any of the following paths: \r\n - /_nodes/stats\r\n - /_nodes/{node_id}/stats\r\n - /_nodes/stats/{metric}\r\n - /_nodes/{node_id}/stats/{metric}\r\n - /_nodes/stats/{metric}/{index_metric}\r\n - /_nodes/{node_id}/stats/{metric}/{index_metric}");
  2483. }
  2484. internal ElasticsearchResponse<T> PercolateDispatch<T>(ElasticsearchPathInfo<PercolateRequestParameters> pathInfo , object body)
  2485. {
  2486. switch(pathInfo.HttpMethod)
  2487. {
  2488. case PathInfoHttpMethod.GET:
  2489. //GET /{index}/{type}/{id}/_percolate
  2490. if (!pathInfo.Index.IsNullOrEmpty() && !pathInfo.Type.IsNullOrEmpty() && !pathInfo.Id.IsNullOrEmpty())
  2491. return this.Raw.PercolateGet<T>(pathInfo.Index,pathInfo.Type,pathInfo.Id,u => pathInfo.RequestParameters);
  2492. //GET /{index}/{type}/_percolate
  2493. if (!pathInfo.Index.IsNullOrEmpty() && !pathInfo.Type.IsNullOrEmpty())
  2494. return this.Raw.PercolateGet<T>(pathInfo.Index,pathInfo.Type,u => pathInfo.RequestParameters);
  2495. break;
  2496. case PathInfoHttpMethod.POST:
  2497. //POST /{index}/{type}/{id}/_percolate
  2498. if (!pathInfo.Index.IsNullOrEmpty() && !pathInfo.Type.IsNullOrEmpty() && !pathInfo.Id.IsNullOrEmpty() && body != null)
  2499. return this.Raw.Percolate<T>(pathInfo.Index,pathInfo.Type,pathInfo.Id,body,u => pathInfo.RequestParameters);
  2500. //POST /{index}/{type}/_percolate
  2501. if (!pathInfo.Index.IsNullOrEmpty() && !pathInfo.Type.IsNullOrEmpty() && body != null)
  2502. return this.Raw.Percolate<T>(pathInfo.Index,pathInfo.Type,body,u => pathInfo.RequestParameters);
  2503. break;
  2504. }
  2505. throw new DispatchException("Could not dispatch IElasticClient.Percolate() into any of the following paths: \r\n - /{index}/{type}/_percolate\r\n - /{index}/{type}/{id}/_percolate");
  2506. }
  2507. internal Task<ElasticsearchResponse<T>> PercolateDispatchAsync<T>(ElasticsearchPathInfo<PercolateRequestParameters> pathInfo , object body)
  2508. {
  2509. switch(pathInfo.HttpMethod)
  2510. {
  2511. case PathInfoHttpMethod.GET:
  2512. //GET /{index}/{type}/{id}/_percolate
  2513. if (!pathInfo.Index.IsNullOrEmpty() && !pathInfo.Type.IsNullOrEmpty() && !pathInfo.Id.IsNullOrEmpty())
  2514. return this.Raw.PercolateGetAsync<T>(pathInfo.Index,pathInfo.Type,pathInfo.Id,u => pathInfo.RequestParameters);
  2515. //GET /{index}/{type}/_percolate
  2516. if (!pathInfo.Index.IsNullOrEmpty() && !pathInfo.Type.IsNullOrEmpty())
  2517. return this.Raw.PercolateGetAsync<T>(pathInfo.Index,pathInfo.Type,u => pathInfo.RequestParameters);
  2518. break;
  2519. case PathInfoHttpMethod.POST:
  2520. //POST /{index}/{type}/{id}/_percolate
  2521. if (!pathInfo.Index.IsNullOrEmpty() && !pathInfo.Type.IsNullOrEmpty() && !pathInfo.Id.IsNullOrEmpty() && body != null)
  2522. return this.Raw.PercolateAsync<T>(pathInfo.Index,pathInfo.Type,pathInfo.Id,body,u => pathInfo.RequestParameters);
  2523. //POST /{index}/{type}/_percolate
  2524. if (!pathInfo.Index.IsNullOrEmpty() && !pathInfo.Type.IsNullOrEmpty() && body != null)
  2525. return this.Raw.PercolateAsync<T>(pathInfo.Index,pathInfo.Type,body,u => pathInfo.RequestParameters);
  2526. break;
  2527. }
  2528. throw new DispatchException("Could not dispatch IElasticClient.Percolate() into any of the following paths: \r\n - /{index}/{type}/_percolate\r\n - /{index}/{type}/{id}/_percolate");
  2529. }
  2530. internal ElasticsearchResponse<T> PingDispatch<T>(ElasticsearchPathInfo<PingRequestParameters> pathInfo )
  2531. {
  2532. switch(pathInfo.HttpMethod)
  2533. {
  2534. case PathInfoHttpMethod.HEAD:
  2535. //HEAD /
  2536. return this.Raw.Ping<T>(u => pathInfo.RequestParameters);
  2537. }
  2538. throw new DispatchException("Could not dispatch IElasticClient.Ping() into any of the following paths: \r\n - /");
  2539. }
  2540. internal Task<ElasticsearchResponse<T>> PingDispatchAsync<T>(ElasticsearchPathInfo<PingRequestParameters> pathInfo )
  2541. {
  2542. switch(pathInfo.HttpMethod)
  2543. {
  2544. case PathInfoHttpMethod.HEAD:
  2545. //HEAD /
  2546. return this.Raw.PingAsync<T>(u => pathInfo.RequestParameters);
  2547. }
  2548. throw new DispatchException("Could not dispatch IElasticClient.Ping() into any of the following paths: \r\n - /");
  2549. }
  2550. internal ElasticsearchResponse<T> ScrollDispatch<T>(ElasticsearchPathInfo<ScrollRequestParameters> pathInfo , object body)
  2551. {
  2552. switch(pathInfo.HttpMethod)
  2553. {
  2554. case PathInfoHttpMethod.GET:
  2555. //GET /_search/scroll/{scroll_id}
  2556. if (!pathInfo.ScrollId.IsNullOrEmpty())
  2557. return this.Raw.ScrollGet<T>(pathInfo.ScrollId,u => pathInfo.RequestParameters);
  2558. //GET /_search/scroll
  2559. return this.Raw.ScrollGet<T>(u => pathInfo.RequestParameters);
  2560. case PathInfoHttpMethod.POST:
  2561. //POST /_search/scroll/{scroll_id}
  2562. if (!pathInfo.ScrollId.IsNullOrEmpty() && body != null)
  2563. return this.Raw.Scroll<T>(pathInfo.ScrollId,body,u => pathInfo.RequestParameters);
  2564. //POST /_search/scroll
  2565. if (body != null)
  2566. return this.Raw.Scroll<T>(body,u => pathInfo.RequestParameters);
  2567. break;
  2568. }
  2569. throw new DispatchException("Could not dispatch IElasticClient.Scroll() into any of the following paths: \r\n - /_search/scroll\r\n - /_search/scroll/{scroll_id}");
  2570. }
  2571. internal Task<ElasticsearchResponse<T>> ScrollDispatchAsync<T>(ElasticsearchPathInfo<ScrollRequestParameters> pathInfo , object body)
  2572. {
  2573. switch(pathInfo.HttpMethod)
  2574. {
  2575. case PathInfoHttpMethod.GET:
  2576. //GET /_search/scroll/{scroll_id}
  2577. if (!pathInfo.ScrollId.IsNullOrEmpty())
  2578. return this.Raw.ScrollGetAsync<T>(pathInfo.ScrollId,u => pathInfo.RequestParameters);
  2579. //GET /_search/scroll
  2580. return this.Raw.ScrollGetAsync<T>(u => pathInfo.RequestParameters);
  2581. case PathInfoHttpMethod.POST:
  2582. //POST /_search/scroll/{scroll_id}
  2583. if (!pathInfo.ScrollId.IsNullOrEmpty() && body != null)
  2584. return this.Raw.ScrollAsync<T>(pathInfo.ScrollId,body,u => pathInfo.RequestParameters);
  2585. //POST /_search/scroll
  2586. if (body != null)
  2587. return this.Raw.ScrollAsync<T>(body,u => pathInfo.RequestParameters);
  2588. break;
  2589. }
  2590. throw new DispatchException("Could not dispatch IElasticClient.Scroll() into any of the following paths: \r\n - /_search/scroll\r\n - /_search/scroll/{scroll_id}");
  2591. }
  2592. internal ElasticsearchResponse<T> SearchDispatch<T>(ElasticsearchPathInfo<SearchRequestParameters> pathInfo , object body)
  2593. {
  2594. switch(pathInfo.HttpMethod)
  2595. {
  2596. case PathInfoHttpMethod.GET:
  2597. //GET /{index}/{type}/_search
  2598. if (!pathInfo.Index.IsNullOrEmpty() && !pathInfo.Type.IsNullOrEmpty())
  2599. return this.Raw.SearchGet<T>(pathInfo.Index,pathInfo.Type,u => pathInfo.RequestParameters);
  2600. //GET /{index}/_search
  2601. if (!pathInfo.Index.IsNullOrEmpty())
  2602. return this.Raw.SearchGet<T>(pathInfo.Index,u => pathInfo.RequestParameters);
  2603. //GET /_search
  2604. return this.Raw.SearchGet<T>(u => pathInfo.RequestParameters);
  2605. case PathInfoHttpMethod.POST:
  2606. //POST /{index}/{type}/_search
  2607. if (!pathInfo.Index.IsNullOrEmpty() && !pathInfo.Type.IsNullOrEmpty() && body != null)
  2608. return this.Raw.Search<T>(pathInfo.Index,pathInfo.Type,body,u => pathInfo.RequestParameters);
  2609. //POST /{index}/_search
  2610. if (!pathInfo.Index.IsNullOrEmpty() && body != null)
  2611. return this.Raw.Search<T>(pathInfo.Index,body,u => pathInfo.RequestParameters);
  2612. //POST /_search
  2613. if (body != null)
  2614. return this.Raw.Search<T>(body,u => pathInfo.RequestParameters);
  2615. break;
  2616. }
  2617. throw new DispatchException("Could not dispatch IElasticClient.Search() into any of the following paths: \r\n - /_search\r\n - /{index}/_search\r\n - /{index}/{type}/_search");
  2618. }
  2619. internal Task<ElasticsearchResponse<T>> SearchDispatchAsync<T>(ElasticsearchPathInfo<SearchRequestParameters> pathInfo , object body)
  2620. {
  2621. switch(pathInfo.HttpMethod)
  2622. {
  2623. case PathInfoHttpMethod.GET:
  2624. //GET /{index}/{type}/_search
  2625. if (!pathInfo.Index.IsNullOrEmpty() && !pathInfo.Type.IsNullOrEmpty())
  2626. return this.Raw.SearchGetAsync<T>(pathInfo.Index,pathInfo.Type,u => pathInfo.RequestParameters);
  2627. //GET /{index}/_search
  2628. if (!pathInfo.Index.IsNullOrEmpty())
  2629. return this.Raw.SearchGetAsync<T>(pathInfo.Index,u => pathInfo.RequestParameters);
  2630. //GET /_search
  2631. return this.Raw.SearchGetAsync<T>(u => pathInfo.RequestParameters);
  2632. case PathInfoHttpMethod.POST:
  2633. //POST /{index}/{type}/_search
  2634. if (!pathInfo.Index.IsNullOrEmpty() && !pathInfo.Type.IsNullOrEmpty() && body != null)
  2635. return this.Raw.SearchAsync<T>(pathInfo.Index,pathInfo.Type,body,u => pathInfo.RequestParameters);
  2636. //POST /{index}/_search
  2637. if (!pathInfo.Index.IsNullOrEmpty() && body != null)
  2638. return this.Raw.SearchAsync<T>(pathInfo.Index,body,u => pathInfo.RequestParameters);
  2639. //POST /_search
  2640. if (body != null)
  2641. return this.Raw.SearchAsync<T>(body,u => pathInfo.RequestParameters);
  2642. break;
  2643. }
  2644. throw new DispatchException("Could not dispatch IElasticClient.Search() into any of the following paths: \r\n - /_search\r\n - /{index}/_search\r\n - /{index}/{type}/_search");
  2645. }
  2646. internal ElasticsearchResponse<T> SearchTemplateDispatch<T>(ElasticsearchPathInfo<SearchTemplateRequestParameters> pathInfo , object body)
  2647. {
  2648. switch(pathInfo.HttpMethod)
  2649. {
  2650. case PathInfoHttpMethod.GET:
  2651. //GET /{index}/{type}/_search/template
  2652. if (!pathInfo.Index.IsNullOrEmpty() && !pathInfo.Type.IsNullOrEmpty())
  2653. return this.Raw.SearchTemplateGet<T>(pathInfo.Index,pathInfo.Type,u => pathInfo.RequestParameters);
  2654. //GET /{index}/_search/template
  2655. if (!pathInfo.Index.IsNullOrEmpty())
  2656. return this.Raw.SearchTemplateGet<T>(pathInfo.Index,u => pathInfo.RequestParameters);
  2657. //GET /_search/template
  2658. return this.Raw.SearchTemplateGet<T>(u => pathInfo.RequestParameters);
  2659. case PathInfoHttpMethod.POST:
  2660. //POST /{index}/{type}/_search/template
  2661. if (!pathInfo.Index.IsNullOrEmpty() && !pathInfo.Type.IsNullOrEmpty() && body != null)
  2662. return this.Raw.SearchTemplate<T>(pathInfo.Index,pathInfo.Type,body,u => pathInfo.RequestParameters);
  2663. //POST /{index}/_search/template
  2664. if (!pathInfo.Index.IsNullOrEmpty() && body != null)
  2665. return this.Raw.SearchTemplate<T>(pathInfo.Index,body,u => pathInfo.RequestParameters);
  2666. //POST /_search/template
  2667. if (body != null)
  2668. return this.Raw.SearchTemplate<T>(body,u => pathInfo.RequestParameters);
  2669. break;
  2670. }
  2671. throw new DispatchException("Could not dispatch IElasticClient.SearchTemplate() into any of the following paths: \r\n - /_search/template\r\n - /{index}/_search/template\r\n - /{index}/{type}/_search/template");
  2672. }
  2673. internal Task<ElasticsearchResponse<T>> SearchTemplateDispatchAsync<T>(ElasticsearchPathInfo<SearchTemplateRequestParameters> pathInfo , object body)
  2674. {
  2675. switch(pathInfo.HttpMethod)
  2676. {
  2677. case PathInfoHttpMethod.GET:
  2678. //GET /{index}/{type}/_search/template
  2679. if (!pathInfo.Index.IsNullOrEmpty() && !pathInfo.Type.IsNullOrEmpty())
  2680. return this.Raw.SearchTemplateGetAsync<T>(pathInfo.Index,pathInfo.Type,u => pathInfo.RequestParameters);
  2681. //GET /{index}/_search/template
  2682. if (!pathInfo.Index.IsNullOrEmpty())
  2683. return this.Raw.SearchTemplateGetAsync<T>(pathInfo.Index,u => pathInfo.RequestParameters);
  2684. //GET /_search/template
  2685. return this.Raw.SearchTemplateGetAsync<T>(u => pathInfo.RequestParameters);
  2686. case PathInfoHttpMethod.POST:
  2687. //POST /{index}/{type}/_search/template
  2688. if (!pathInfo.Index.IsNullOrEmpty() && !pathInfo.Type.IsNullOrEmpty() && body != null)
  2689. return this.Raw.SearchTemplateAsync<T>(pathInfo.Index,pathInfo.Type,body,u => pathInfo.RequestParameters);
  2690. //POST /{index}/_search/template
  2691. if (!pathInfo.Index.IsNullOrEmpty() && body != null)
  2692. return this.Raw.SearchTemplateAsync<T>(pathInfo.Index,body,u => pathInfo.RequestParameters);
  2693. //POST /_search/template
  2694. if (body != null)
  2695. return this.Raw.SearchTemplateAsync<T>(body,u => pathInfo.RequestParameters);
  2696. break;
  2697. }
  2698. throw new DispatchException("Could not dispatch IElasticClient.SearchTemplate() into any of the following paths: \r\n - /_search/template\r\n - /{index}/_search/template\r\n - /{index}/{type}/_search/template");
  2699. }
  2700. internal ElasticsearchResponse<T> SnapshotCreateDispatch<T>(ElasticsearchPathInfo<SnapshotRequestParameters> pathInfo , object body)
  2701. {
  2702. switch(pathInfo.HttpMethod)
  2703. {
  2704. case PathInfoHttpMethod.PUT:
  2705. //PUT /_snapshot/{repository}/{snapshot}
  2706. if (!pathInfo.Repository.IsNullOrEmpty() && !pathInfo.Snapshot.IsNullOrEmpty() && body != null)
  2707. return this.Raw.SnapshotCreate<T>(pathInfo.Repository,pathInfo.Snapshot,body,u => pathInfo.RequestParameters);
  2708. break;
  2709. case PathInfoHttpMethod.POST:
  2710. //POST /_snapshot/{repository}/{snapshot}
  2711. if (!pathInfo.Repository.IsNullOrEmpty() && !pathInfo.Snapshot.IsNullOrEmpty() && body != null)
  2712. return this.Raw.SnapshotCreatePost<T>(pathInfo.Repository,pathInfo.Snapshot,body,u => pathInfo.RequestParameters);
  2713. break;
  2714. }
  2715. throw new DispatchException("Could not dispatch IElasticClient.SnapshotCreate() into any of the following paths: \r\n - /_snapshot/{repository}/{snapshot}\r\n - /_snapshot/{repository}/{snapshot}/_create");
  2716. }
  2717. internal Task<ElasticsearchResponse<T>> SnapshotCreateDispatchAsync<T>(ElasticsearchPathInfo<SnapshotRequestParameters> pathInfo , object body)
  2718. {
  2719. switch(pathInfo.HttpMethod)
  2720. {
  2721. case PathInfoHttpMethod.PUT:
  2722. //PUT /_snapshot/{repository}/{snapshot}
  2723. if (!pathInfo.Repository.IsNullOrEmpty() && !pathInfo.Snapshot.IsNullOrEmpty() && body != null)
  2724. return this.Raw.SnapshotCreateAsync<T>(pathInfo.Repository,pathInfo.Snapshot,body,u => pathInfo.RequestParameters);
  2725. break;
  2726. case PathInfoHttpMethod.POST:
  2727. //POST /_snapshot/{repository}/{snapshot}
  2728. if (!pathInfo.Repository.IsNullOrEmpty() && !pathInfo.Snapshot.IsNullOrEmpty() && body != null)
  2729. return this.Raw.SnapshotCreatePostAsync<T>(pathInfo.Repository,pathInfo.Snapshot,body,u => pathInfo.RequestParameters);
  2730. break;
  2731. }
  2732. throw new DispatchException("Could not dispatch IElasticClient.SnapshotCreate() into any of the following paths: \r\n - /_snapshot/{repository}/{snapshot}\r\n - /_snapshot/{repository}/{snapshot}/_create");
  2733. }
  2734. internal ElasticsearchResponse<T> SnapshotCreateRepositoryDispatch<T>(ElasticsearchPathInfo<CreateRepositoryRequestParameters> pathInfo , object body)
  2735. {
  2736. switch(pathInfo.HttpMethod)
  2737. {
  2738. case PathInfoHttpMethod.PUT:
  2739. //PUT /_snapshot/{repository}
  2740. if (!pathInfo.Repository.IsNullOrEmpty() && body != null)
  2741. return this.Raw.SnapshotCreateRepository<T>(pathInfo.Repository,body,u => pathInfo.RequestParameters);
  2742. break;
  2743. case PathInfoHttpMethod.POST:
  2744. //POST /_snapshot/{repository}
  2745. if (!pathInfo.Repository.IsNullOrEmpty() && body != null)
  2746. return this.Raw.SnapshotCreateRepositoryPost<T>(pathInfo.Repository,body,u => pathInfo.RequestParameters);
  2747. break;
  2748. }
  2749. throw new DispatchException("Could not dispatch IElasticClient.SnapshotCreateRepository() into any of the following paths: \r\n - /_snapshot/{repository}");
  2750. }
  2751. internal Task<ElasticsearchResponse<T>> SnapshotCreateRepositoryDispatchAsync<T>(ElasticsearchPathInfo<CreateRepositoryRequestParameters> pathInfo , object body)
  2752. {
  2753. switch(pathInfo.HttpMethod)
  2754. {
  2755. case PathInfoHttpMethod.PUT:
  2756. //PUT /_snapshot/{repository}
  2757. if (!pathInfo.Repository.IsNullOrEmpty() && body != null)
  2758. return this.Raw.SnapshotCreateRepositoryAsync<T>(pathInfo.Repository,body,u => pathInfo.RequestParameters);
  2759. break;
  2760. case PathInfoHttpMethod.POST:
  2761. //POST /_snapshot/{repository}
  2762. if (!pathInfo.Repository.IsNullOrEmpty() && body != null)
  2763. return this.Raw.SnapshotCreateRepositoryPostAsync<T>(pathInfo.Repository,body,u => pathInfo.RequestParameters);
  2764. break;
  2765. }
  2766. throw new DispatchException("Could not dispatch IElasticClient.SnapshotCreateRepository() into any of the following paths: \r\n - /_snapshot/{repository}");
  2767. }
  2768. internal ElasticsearchResponse<T> SnapshotDeleteDispatch<T>(ElasticsearchPathInfo<DeleteSnapshotRequestParameters> pathInfo )
  2769. {
  2770. switch(pathInfo.HttpMethod)
  2771. {
  2772. case PathInfoHttpMethod.DELETE:
  2773. //DELETE /_snapshot/{repository}/{snapshot}
  2774. if (!pathInfo.Repository.IsNullOrEmpty() && !pathInfo.Snapshot.IsNullOrEmpty())
  2775. return this.Raw.SnapshotDelete<T>(pathInfo.Repository,pathInfo.Snapshot,u => pathInfo.RequestParameters);
  2776. break;
  2777. }
  2778. throw new DispatchException("Could not dispatch IElasticClient.SnapshotDelete() into any of the following paths: \r\n - /_snapshot/{repository}/{snapshot}");
  2779. }
  2780. internal Task<ElasticsearchResponse<T>> SnapshotDeleteDispatchAsync<T>(ElasticsearchPathInfo<DeleteSnapshotRequestParameters> pathInfo )
  2781. {
  2782. switch(pathInfo.HttpMethod)
  2783. {
  2784. case PathInfoHttpMethod.DELETE:
  2785. //DELETE /_snapshot/{repository}/{snapshot}
  2786. if (!pathInfo.Repository.IsNullOrEmpty() && !pathInfo.Snapshot.IsNullOrEmpty())
  2787. return this.Raw.SnapshotDeleteAsync<T>(pathInfo.Repository,pathInfo.Snapshot,u => pathInfo.RequestParameters);
  2788. break;
  2789. }
  2790. throw new DispatchException("Could not dispatch IElasticClient.SnapshotDelete() into any of the following paths: \r\n - /_snapshot/{repository}/{snapshot}");
  2791. }
  2792. internal ElasticsearchResponse<T> SnapshotDeleteRepositoryDispatch<T>(ElasticsearchPathInfo<DeleteRepositoryRequestParameters> pathInfo )
  2793. {
  2794. switch(pathInfo.HttpMethod)
  2795. {
  2796. case PathInfoHttpMethod.DELETE:
  2797. //DELETE /_snapshot/{repository}
  2798. if (!pathInfo.Repository.IsNullOrEmpty())
  2799. return this.Raw.SnapshotDeleteRepository<T>(pathInfo.Repository,u => pathInfo.RequestParameters);
  2800. break;
  2801. }
  2802. throw new DispatchException("Could not dispatch IElasticClient.SnapshotDeleteRepository() into any of the following paths: \r\n - /_snapshot/{repository}");
  2803. }
  2804. internal Task<ElasticsearchResponse<T>> SnapshotDeleteRepositoryDispatchAsync<T>(ElasticsearchPathInfo<DeleteRepositoryRequestParameters> pathInfo )
  2805. {
  2806. switch(pathInfo.HttpMethod)
  2807. {
  2808. case PathInfoHttpMethod.DELETE:
  2809. //DELETE /_snapshot/{repository}
  2810. if (!pathInfo.Repository.IsNullOrEmpty())
  2811. return this.Raw.SnapshotDeleteRepositoryAsync<T>(pathInfo.Repository,u => pathInfo.RequestParameters);
  2812. break;
  2813. }
  2814. throw new DispatchException("Could not dispatch IElasticClient.SnapshotDeleteRepository() into any of the following paths: \r\n - /_snapshot/{repository}");
  2815. }
  2816. internal ElasticsearchResponse<T> SnapshotGetDispatch<T>(ElasticsearchPathInfo<GetSnapshotRequestParameters> pathInfo )
  2817. {
  2818. switch(pathInfo.HttpMethod)
  2819. {
  2820. case PathInfoHttpMethod.GET:
  2821. //GET /_snapshot/{repository}/{snapshot}
  2822. if (!pathInfo.Repository.IsNullOrEmpty() && !pathInfo.Snapshot.IsNullOrEmpty())
  2823. return this.Raw.SnapshotGet<T>(pathInfo.Repository,pathInfo.Snapshot,u => pathInfo.RequestParameters);
  2824. break;
  2825. }
  2826. throw new DispatchException("Could not dispatch IElasticClient.SnapshotGet() into any of the following paths: \r\n - /_snapshot/{repository}/{snapshot}");
  2827. }
  2828. internal Task<ElasticsearchResponse<T>> SnapshotGetDispatchAsync<T>(ElasticsearchPathInfo<GetSnapshotRequestParameters> pathInfo )
  2829. {
  2830. switch(pathInfo.HttpMethod)
  2831. {
  2832. case PathInfoHttpMethod.GET:
  2833. //GET /_snapshot/{repository}/{snapshot}
  2834. if (!pathInfo.Repository.IsNullOrEmpty() && !pathInfo.Snapshot.IsNullOrEmpty())
  2835. return this.Raw.SnapshotGetAsync<T>(pathInfo.Repository,pathInfo.Snapshot,u => pathInfo.RequestParameters);
  2836. break;
  2837. }
  2838. throw new DispatchException("Could not dispatch IElasticClient.SnapshotGet() into any of the following paths: \r\n - /_snapshot/{repository}/{snapshot}");
  2839. }
  2840. internal ElasticsearchResponse<T> SnapshotGetRepositoryDispatch<T>(ElasticsearchPathInfo<SnapshotGetRepositoryRequestParameters> pathInfo )
  2841. {
  2842. switch(pathInfo.HttpMethod)
  2843. {
  2844. case PathInfoHttpMethod.GET:
  2845. //GET /_snapshot/{repository}
  2846. if (!pathInfo.Repository.IsNullOrEmpty())
  2847. return this.Raw.SnapshotGetRepository<T>(pathInfo.Repository,u => pathInfo.RequestParameters);
  2848. //GET /_snapshot
  2849. return this.Raw.SnapshotGetRepository<T>(u => pathInfo.RequestParameters);
  2850. }
  2851. throw new DispatchException("Could not dispatch IElasticClient.SnapshotGetRepository() into any of the following paths: \r\n - /_snapshot\r\n - /_snapshot/{repository}");
  2852. }
  2853. internal Task<ElasticsearchResponse<T>> SnapshotGetRepositoryDispatchAsync<T>(ElasticsearchPathInfo<SnapshotGetRepositoryRequestParameters> pathInfo )
  2854. {
  2855. switch(pathInfo.HttpMethod)
  2856. {
  2857. case PathInfoHttpMethod.GET:
  2858. //GET /_snapshot/{repository}
  2859. if (!pathInfo.Repository.IsNullOrEmpty())
  2860. return this.Raw.SnapshotGetRepositoryAsync<T>(pathInfo.Repository,u => pathInfo.RequestParameters);
  2861. //GET /_snapshot
  2862. return this.Raw.SnapshotGetRepositoryAsync<T>(u => pathInfo.RequestParameters);
  2863. }
  2864. throw new DispatchException("Could not dispatch IElasticClient.SnapshotGetRepository() into any of the following paths: \r\n - /_snapshot\r\n - /_snapshot/{repository}");
  2865. }
  2866. internal ElasticsearchResponse<T> SnapshotRestoreDispatch<T>(ElasticsearchPathInfo<RestoreRequestParameters> pathInfo , object body)
  2867. {
  2868. switch(pathInfo.HttpMethod)
  2869. {
  2870. case PathInfoHttpMethod.POST:
  2871. //POST /_snapshot/{repository}/{snapshot}/_restore
  2872. if (!pathInfo.Repository.IsNullOrEmpty() && !pathInfo.Snapshot.IsNullOrEmpty() && body != null)
  2873. return this.Raw.SnapshotRestore<T>(pathInfo.Repository,pathInfo.Snapshot,body,u => pathInfo.RequestParameters);
  2874. break;
  2875. }
  2876. throw new DispatchException("Could not dispatch IElasticClient.SnapshotRestore() into any of the following paths: \r\n - /_snapshot/{repository}/{snapshot}/_restore");
  2877. }
  2878. internal Task<ElasticsearchResponse<T>> SnapshotRestoreDispatchAsync<T>(ElasticsearchPathInfo<RestoreRequestParameters> pathInfo , object body)
  2879. {
  2880. switch(pathInfo.HttpMethod)
  2881. {
  2882. case PathInfoHttpMethod.POST:
  2883. //POST /_snapshot/{repository}/{snapshot}/_restore
  2884. if (!pathInfo.Repository.IsNullOrEmpty() && !pathInfo.Snapshot.IsNullOrEmpty() && body != null)
  2885. return this.Raw.SnapshotRestoreAsync<T>(pathInfo.Repository,pathInfo.Snapshot,body,u => pathInfo.RequestParameters);
  2886. break;
  2887. }
  2888. throw new DispatchException("Could not dispatch IElasticClient.SnapshotRestore() into any of the following paths: \r\n - /_snapshot/{repository}/{snapshot}/_restore");
  2889. }
  2890. internal ElasticsearchResponse<T> SnapshotStatusDispatch<T>(ElasticsearchPathInfo<SnapshotStatusRequestParameters> pathInfo )
  2891. {
  2892. switch(pathInfo.HttpMethod)
  2893. {
  2894. case PathInfoHttpMethod.GET:
  2895. //GET /_snapshot/{repository}/{snapshot}/_status
  2896. if (!pathInfo.Repository.IsNullOrEmpty() && !pathInfo.Snapshot.IsNullOrEmpty())
  2897. return this.Raw.SnapshotStatus<T>(pathInfo.Repository,pathInfo.Snapshot,u => pathInfo.RequestParameters);
  2898. //GET /_snapshot/{repository}/_status
  2899. if (!pathInfo.Repository.IsNullOrEmpty())
  2900. return this.Raw.SnapshotStatus<T>(pathInfo.Repository,u => pathInfo.RequestParameters);
  2901. //GET /_snapshot/_status
  2902. return this.Raw.SnapshotStatus<T>(u => pathInfo.RequestParameters);
  2903. }
  2904. throw new DispatchException("Could not dispatch IElasticClient.SnapshotStatus() into any of the following paths: \r\n - /_snapshot/_status\r\n - /_snapshot/{repository}/_status\r\n - /_snapshot/{repository}/{snapshot}/_status");
  2905. }
  2906. internal Task<ElasticsearchResponse<T>> SnapshotStatusDispatchAsync<T>(ElasticsearchPathInfo<SnapshotStatusRequestParameters> pathInfo )
  2907. {
  2908. switch(pathInfo.HttpMethod)
  2909. {
  2910. case PathInfoHttpMethod.GET:
  2911. //GET /_snapshot/{repository}/{snapshot}/_status
  2912. if (!pathInfo.Repository.IsNullOrEmpty() && !pathInfo.Snapshot.IsNullOrEmpty())
  2913. return this.Raw.SnapshotStatusAsync<T>(pathInfo.Repository,pathInfo.Snapshot,u => pathInfo.RequestParameters);
  2914. //GET /_snapshot/{repository}/_status
  2915. if (!pathInfo.Repository.IsNullOrEmpty())
  2916. return this.Raw.SnapshotStatusAsync<T>(pathInfo.Repository,u => pathInfo.RequestParameters);
  2917. //GET /_snapshot/_status
  2918. return this.Raw.SnapshotStatusAsync<T>(u => pathInfo.RequestParameters);
  2919. }
  2920. throw new DispatchException("Could not dispatch IElasticClient.SnapshotStatus() into any of the following paths: \r\n - /_snapshot/_status\r\n - /_snapshot/{repository}/_status\r\n - /_snapshot/{repository}/{snapshot}/_status");
  2921. }
  2922. internal ElasticsearchResponse<T> SuggestDispatch<T>(ElasticsearchPathInfo<SuggestRequestParameters> pathInfo , object body)
  2923. {
  2924. switch(pathInfo.HttpMethod)
  2925. {
  2926. case PathInfoHttpMethod.POST:
  2927. //POST /{index}/_suggest
  2928. if (!pathInfo.Index.IsNullOrEmpty() && body != null)
  2929. return this.Raw.Suggest<T>(pathInfo.Index,body,u => pathInfo.RequestParameters);
  2930. //POST /_suggest
  2931. if (body != null)
  2932. return this.Raw.Suggest<T>(body,u => pathInfo.RequestParameters);
  2933. break;
  2934. case PathInfoHttpMethod.GET:
  2935. //GET /{index}/_suggest
  2936. if (!pathInfo.Index.IsNullOrEmpty())
  2937. return this.Raw.SuggestGet<T>(pathInfo.Index,u => pathInfo.RequestParameters);
  2938. //GET /_suggest
  2939. return this.Raw.SuggestGet<T>(u => pathInfo.RequestParameters);
  2940. }
  2941. throw new DispatchException("Could not dispatch IElasticClient.Suggest() into any of the following paths: \r\n - /_suggest\r\n - /{index}/_suggest");
  2942. }
  2943. internal Task<ElasticsearchResponse<T>> SuggestDispatchAsync<T>(ElasticsearchPathInfo<SuggestRequestParameters> pathInfo , object body)
  2944. {
  2945. switch(pathInfo.HttpMethod)
  2946. {
  2947. case PathInfoHttpMethod.POST:
  2948. //POST /{index}/_suggest
  2949. if (!pathInfo.Index.IsNullOrEmpty() && body != null)
  2950. return this.Raw.SuggestAsync<T>(pathInfo.Index,body,u => pathInfo.RequestParameters);
  2951. //POST /_suggest
  2952. if (body != null)
  2953. return this.Raw.SuggestAsync<T>(body,u => pathInfo.RequestParameters);
  2954. break;
  2955. case PathInfoHttpMethod.GET:
  2956. //GET /{index}/_suggest
  2957. if (!pathInfo.Index.IsNullOrEmpty())
  2958. return this.Raw.SuggestGetAsync<T>(pathInfo.Index,u => pathInfo.RequestParameters);
  2959. //GET /_suggest
  2960. return this.Raw.SuggestGetAsync<T>(u => pathInfo.RequestParameters);
  2961. }
  2962. throw new DispatchException("Could not dispatch IElasticClient.Suggest() into any of the following paths: \r\n - /_suggest\r\n - /{index}/_suggest");
  2963. }
  2964. internal ElasticsearchResponse<T> TermvectorDispatch<T>(ElasticsearchPathInfo<TermvectorRequestParameters> pathInfo , object body)
  2965. {
  2966. switch(pathInfo.HttpMethod)
  2967. {
  2968. case PathInfoHttpMethod.GET:
  2969. //GET /{index}/{type}/{id}/_termvector
  2970. if (!pathInfo.Index.IsNullOrEmpty() && !pathInfo.Type.IsNullOrEmpty() && !pathInfo.Id.IsNullOrEmpty())
  2971. return this.Raw.TermvectorGet<T>(pathInfo.Index,pathInfo.Type,pathInfo.Id,u => pathInfo.RequestParameters);
  2972. break;
  2973. case PathInfoHttpMethod.POST:
  2974. //POST /{index}/{type}/{id}/_termvector
  2975. if (!pathInfo.Index.IsNullOrEmpty() && !pathInfo.Type.IsNullOrEmpty() && !pathInfo.Id.IsNullOrEmpty() && body != null)
  2976. return this.Raw.Termvector<T>(pathInfo.Index,pathInfo.Type,pathInfo.Id,body,u => pathInfo.RequestParameters);
  2977. break;
  2978. }
  2979. throw new DispatchException("Could not dispatch IElasticClient.Termvector() into any of the following paths: \r\n - /{index}/{type}/{id}/_termvector");
  2980. }
  2981. internal Task<ElasticsearchResponse<T>> TermvectorDispatchAsync<T>(ElasticsearchPathInfo<TermvectorRequestParameters> pathInfo , object body)
  2982. {
  2983. switch(pathInfo.HttpMethod)
  2984. {
  2985. case PathInfoHttpMethod.GET:
  2986. //GET /{index}/{type}/{id}/_termvector
  2987. if (!pathInfo.Index.IsNullOrEmpty() && !pathInfo.Type.IsNullOrEmpty() && !pathInfo.Id.IsNullOrEmpty())
  2988. return this.Raw.TermvectorGetAsync<T>(pathInfo.Index,pathInfo.Type,pathInfo.Id,u => pathInfo.RequestParameters);
  2989. break;
  2990. case PathInfoHttpMethod.POST:
  2991. //POST /{index}/{type}/{id}/_termvector
  2992. if (!pathInfo.Index.IsNullOrEmpty() && !pathInfo.Type.IsNullOrEmpty() && !pathInfo.Id.IsNullOrEmpty() && body != null)
  2993. return this.Raw.TermvectorAsync<T>(pathInfo.Index,pathInfo.Type,pathInfo.Id,body,u => pathInfo.RequestParameters);
  2994. break;
  2995. }
  2996. throw new DispatchException("Could not dispatch IElasticClient.Termvector() into any of the following paths: \r\n - /{index}/{type}/{id}/_termvector");
  2997. }
  2998. internal ElasticsearchResponse<T> UpdateDispatch<T>(ElasticsearchPathInfo<UpdateRequestParameters> pathInfo , object body)
  2999. {
  3000. switch(pathInfo.HttpMethod)
  3001. {
  3002. case PathInfoHttpMethod.POST:
  3003. //POST /{index}/{type}/{id}/_update
  3004. if (!pathInfo.Index.IsNullOrEmpty() && !pathInfo.Type.IsNullOrEmpty() && !pathInfo.Id.IsNullOrEmpty() && body != null)
  3005. return this.Raw.Update<T>(pathInfo.Index,pathInfo.Type,pathInfo.Id,body,u => pathInfo.RequestParameters);
  3006. break;
  3007. }
  3008. throw new DispatchException("Could not dispatch IElasticClient.Update() into any of the following paths: \r\n - /{index}/{type}/{id}/_update");
  3009. }
  3010. internal Task<ElasticsearchResponse<T>> UpdateDispatchAsync<T>(ElasticsearchPathInfo<UpdateRequestParameters> pathInfo , object body)
  3011. {
  3012. switch(pathInfo.HttpMethod)
  3013. {
  3014. case PathInfoHttpMethod.POST:
  3015. //POST /{index}/{type}/{id}/_update
  3016. if (!pathInfo.Index.IsNullOrEmpty() && !pathInfo.Type.IsNullOrEmpty() && !pathInfo.Id.IsNullOrEmpty() && body != null)
  3017. return this.Raw.UpdateAsync<T>(pathInfo.Index,pathInfo.Type,pathInfo.Id,body,u => pathInfo.RequestParameters);
  3018. break;
  3019. }
  3020. throw new DispatchException("Could not dispatch IElasticClient.Update() into any of the following paths: \r\n - /{index}/{type}/{id}/_update");
  3021. }
  3022. }
  3023. }