private void CreateMultiSearchTemplateDeserializer(IMultiSearchTemplateRequest request) { var formatter = new MultiSearchResponseFormatter(request); var serializer = ConnectionSettings.CreateStateful(formatter); var creator = new MultiSearchTemplateCreator((r, s) => serializer.Deserialize <MultiSearchResponse>(s)); request.RequestParameters.DeserializationOverride = creator; }
private JsonConverter CreateMultiSearchTemplateDeserializer(IMultiSearchTemplateRequest request) { if (request.Operations != null) { foreach (var operation in request.Operations.Values) { CovariantSearch.CloseOverAutomagicCovariantResultSelector(this.Infer, operation); } } return(new MultiSearchResponseJsonConverter(this.ConnectionSettings, request)); }
/// <inheritdoc /> public IMultiSearchResponse MultiSearchTemplate(IMultiSearchTemplateRequest request) => Dispatcher.Dispatch <IMultiSearchTemplateRequest, MultiSearchTemplateRequestParameters, MultiSearchResponse>( request, (p, d) => { var converter = CreateMultiSearchTemplateDeserializer(p); var serializer = ConnectionSettings.CreateStateful(converter); var creator = new MultiSearchTemplateCreator((r, s) => serializer.Deserialize <MultiSearchResponse>(s)); request.RequestParameters.DeserializationOverride = creator; return(LowLevelDispatch.MsearchTemplateDispatch <MultiSearchResponse>(p, new SerializableData <IMultiSearchTemplateRequest>(p))); } );
/// <inheritdoc /> public IMultiSearchResponse MultiSearchTemplate(IMultiSearchTemplateRequest request) { return(this.Dispatcher.Dispatch <IMultiSearchTemplateRequest, MultiSearchTemplateRequestParameters, MultiSearchResponse>( request, (p, d) => { var converter = CreateMultiSearchTemplateDeserializer(p); var serializer = this.ConnectionSettings.StatefulSerializer(converter); var creator = new MultiSearchTemplateCreator((r, s) => serializer.Deserialize <MultiSearchResponse>(s)); request.RequestParameters.DeserializationOverride(creator); return this.LowLevelDispatch.MsearchTemplateDispatch <MultiSearchResponse>(p, (object)p); } )); }
/// <inheritdoc /> public Task <IMultiSearchResponse> MultiSearchTemplateAsync(IMultiSearchTemplateRequest request, CancellationToken cancellationToken = default(CancellationToken) ) => Dispatcher.DispatchAsync <IMultiSearchTemplateRequest, MultiSearchTemplateRequestParameters, MultiSearchResponse, IMultiSearchResponse>( request, cancellationToken, (p, d, c) => { var converter = CreateMultiSearchTemplateDeserializer(p); var serializer = ConnectionSettings.CreateStateful(converter); var creator = new MultiSearchTemplateCreator((r, s) => serializer.Deserialize <MultiSearchResponse>(s)); request.RequestParameters.DeserializationOverride = creator; return(LowLevelDispatch.MsearchTemplateDispatchAsync <MultiSearchResponse>(p, new SerializableData <IMultiSearchTemplateRequest>(p), c)); } );
/// <inheritdoc /> public Task <IMultiSearchResponse> MultiSearchTemplateAsync(IMultiSearchTemplateRequest request, CancellationToken cancellationToken = default(CancellationToken)) { return(this.Dispatcher.DispatchAsync <IMultiSearchTemplateRequest, MultiSearchTemplateRequestParameters, MultiSearchResponse, IMultiSearchResponse>( request, cancellationToken, (p, d, c) => { var converter = CreateMultiSearchTemplateDeserializer(p); var serializer = this.ConnectionSettings.StatefulSerializer(converter); var creator = new MultiSearchTemplateCreator((r, s) => serializer.Deserialize <MultiSearchResponse>(s)); request.RequestParameters.DeserializationOverride(creator); return this.LowLevelDispatch.MsearchTemplateDispatchAsync <MultiSearchResponse>(p, (object)p, c); } )); }
public Task <MultiSearchResponse> MultiSearchTemplateAsync(IMultiSearchTemplateRequest request, CancellationToken ct = new CancellationToken()) { throw new NotImplementedException(); }
public MultiSearchResponse MultiSearchTemplate(IMultiSearchTemplateRequest request) { throw new NotImplementedException(); }
private JsonConverter CreateMultiSearchTemplateDeserializer(IMultiSearchTemplateRequest request) => new MultiSearchResponseJsonConverter(ConnectionSettings, request);
private JsonConverter CreateMultiSearchTemplateDeserializer(IMultiSearchTemplateRequest request) { return(new MultiSearchResponseJsonConverter(this.ConnectionSettings, request)); }
/// <inheritdoc /> public Task <MultiSearchResponse> MultiSearchTemplateAsync(IMultiSearchTemplateRequest request, CancellationToken ct = default) { CreateMultiSearchTemplateDeserializer(request); return(DoRequestAsync <IMultiSearchTemplateRequest, MultiSearchResponse>(request, request.RequestParameters, ct)); }
/// <inheritdoc /> public MultiSearchResponse MultiSearchTemplate(IMultiSearchTemplateRequest request) { CreateMultiSearchTemplateDeserializer(request); return(DoRequest <IMultiSearchTemplateRequest, MultiSearchResponse>(request, request.RequestParameters)); }