|
| 1 | +using Elasticsearch.Net; |
| 2 | +using System; |
| 3 | +using System.Collections.Generic; |
| 4 | +using System.Linq; |
| 5 | +using System.Text; |
| 6 | +using System.Threading.Tasks; |
| 7 | + |
| 8 | +namespace Nest |
| 9 | +{ |
| 10 | + public partial class ElasticClient |
| 11 | + { |
| 12 | + /// <inheritdoc /> |
| 13 | + public IPingResponse Ping(Func<PingDescriptor, PingDescriptor> pingSelector = null) |
| 14 | + { |
| 15 | + pingSelector = pingSelector ?? (s => s); |
| 16 | + return this.Dispatch<PingDescriptor, PingRequestParameters, PingResponse>( |
| 17 | + pingSelector, |
| 18 | + (p, d) => this.RawDispatch.PingDispatch<PingResponse>(p) |
| 19 | + ); |
| 20 | + } |
| 21 | + |
| 22 | + /// <inheritdoc /> |
| 23 | + public Task<IPingResponse> PingAsync(Func<PingDescriptor, PingDescriptor> pingSelector = null) |
| 24 | + { |
| 25 | + pingSelector = pingSelector ?? (s => s); |
| 26 | + return this.DispatchAsync<PingDescriptor, PingRequestParameters, PingResponse, IPingResponse>( |
| 27 | + pingSelector, |
| 28 | + (p, d) => this.RawDispatch.PingDispatchAsync<PingResponse>(p) |
| 29 | + ); |
| 30 | + } |
| 31 | + |
| 32 | + /// <inheritdoc /> |
| 33 | + public IPingResponse Ping(IPingRequest pingRequest) |
| 34 | + { |
| 35 | + return this.Dispatch<IPingRequest, PingRequestParameters, PingResponse>( |
| 36 | + pingRequest, |
| 37 | + (p, d) => this.RawDispatch.PingDispatch<PingResponse>(p) |
| 38 | + ); |
| 39 | + } |
| 40 | + |
| 41 | + /// <inheritdoc /> |
| 42 | + public Task<IPingResponse> PingAsync(IPingRequest pingRequest) |
| 43 | + { |
| 44 | + return this.DispatchAsync<IPingRequest, PingRequestParameters, PingResponse, IPingResponse>( |
| 45 | + pingRequest, |
| 46 | + (p, d) => this.RawDispatch.PingDispatchAsync<PingResponse>(p) |
| 47 | + ); |
| 48 | + } |
| 49 | + } |
| 50 | +} |
0 commit comments