using JsonRPC4.Common; using System; using System.Collections.Generic; using System.Linq; using System.Threading.Tasks; namespace JsonRPC4.Router { internal class RpcRequestParseResult { public RpcId Id { get; } public string Method { get; } public RpcParameters Parameters { get; } public RpcError Error { get; } private RpcRequestParseResult(RpcId id, string method, RpcParameters parameters, RpcError error) { Id = id; Method = method; Parameters = parameters; Error = error; } public static RpcRequestParseResult Success(RpcId id, string method, RpcParameters parameters) { return new RpcRequestParseResult(id, method, parameters, null); } public static RpcRequestParseResult Fail(RpcId id, RpcError error) { return new RpcRequestParseResult(id, null, null, error); } } }