using System.Collections.Generic;
using System.Linq;
using System;
// ReSharper disable AutoPropertyCanBeMadeGetOnly.Local
// ReSharper disable UnusedMember.Local
namespace EdjCase.JsonRpc.Core
{
///
/// Model representing a Rpc request
///
public class RpcRequest
{
/// Request id
/// Target method name
/// Json parameters for the target method
public RpcRequest(RpcId id, string method, RpcParameters parameters = default)
{
this.Id = id;
this.Method = method;
this.Parameters = parameters;
}
/// Target method name
/// Json parameters for the target method
public RpcRequest(string method, RpcParameters parameters = default)
{
this.Id = null;
this.Method = method;
this.Parameters = parameters;
}
///
/// Request Id (Optional)
///
public RpcId Id { get; private set; }
///
/// Name of the target method (Required)
///
public string Method { get; private set; }
///
/// Parameters to invoke the method with (Optional)
///
public RpcParameters Parameters { get; private set; }
public static RpcRequest WithNoParameters(string method, RpcId id = default)
{
return RpcRequest.WithParameters(method, default, id);
}
public static RpcRequest WithParameterList(string method, IList