using DiscordRPC.Converters;
using Newtonsoft.Json;
namespace DiscordRPC.RPC.Payload
{
///
/// Base Payload that is received by both client and server
///
internal abstract class IPayload
{
///
/// The type of payload
///
[JsonProperty("cmd"), JsonConverter(typeof(EnumSnakeCaseConverter))]
public Command Command { get; set; }
///
/// A incremental value to help identify payloads
///
[JsonProperty("nonce")]
public string Nonce { get; set; }
protected IPayload() { }
protected IPayload(long nonce)
{
Nonce = nonce.ToString();
}
public override string ToString()
{
return "Payload || Command: " + Command.ToString() + ", Nonce: " + (Nonce != null ? Nonce.ToString() : "NULL");
}
}
}