using System;
using InABox.Core;

namespace InABox.Rpc
{
    // ReSharper disable once InconsistentNaming
    public class RpcCheck2FAParameters : IRpcCommandParameters
    {
        public string Code { get; set; }
        
        public Guid SessionId { get; set; }
        
        public RpcCheck2FAParameters()
        {
            Code = "";
        }

        public void SerializeBinary(CoreBinaryWriter writer)
        {
            writer.Write(Code);
            writer.Write(SessionId);
        }

        public void DeserializeBinary(CoreBinaryReader reader)
        {
            Code = reader.ReadString();
            SessionId = reader.ReadGuid();
        }

        public string? FullDescription() => $"Check2FA({Code}, {SessionId})";

        public string? ShortDescription() => FullDescription();
    }
}