forked from elastic/elasticsearch-net
-
Notifications
You must be signed in to change notification settings - Fork 0
/
IElasticsearchClient.cs
35 lines (32 loc) · 1.9 KB
/
IElasticsearchClient.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Elasticsearch.Net
{
public partial interface IElasticsearchClient
{
/// <summary>
/// Perform any request you want over the configured IConnection synchronously while taking advantage of the cluster failover.
/// </summary>
/// <typeparam name="T">The type representing the response JSON</typeparam>
/// <param name="method">the HTTP Method to use</param>
/// <param name="path">The path of the the url that you would like to hit</param>
/// <param name="data">The body of the request, string and byte[] are posted as is other types will be serialized to JSON</param>
/// <param name="requestParameters">Optionally configure request specific timeouts, headers</param>
/// <returns>An ElasticsearchResponse of T where T represents the JSON response body</returns>
ElasticsearchResponse<T> DoRequest<T>(string method, string path, object data = null, IRequestParameters requestParameters = null);
/// <summary>
/// Perform any request you want over the configured IConnection asynchronously while taking advantage of the cluster failover.
/// </summary>
/// <typeparam name="T">The type representing the response JSON</typeparam>
/// <param name="method">the HTTP Method to use</param>
/// <param name="path">The path of the the url that you would like to hit</param>
/// <param name="data">The body of the request, string and byte[] are posted as is other types will be serialized to JSON</param>
/// <param name="requestParameters">Optionally configure request specific timeouts, headers</param>
/// <returns>A task of ElasticsearchResponse of T where T represents the JSON response body</returns>
Task<ElasticsearchResponse<T>> DoRequestAsync<T>(string method, string path, object data = null, IRequestParameters requestParameters = null);
string Encoded(object o);
}
}