using EVCB_OCPP.Packet20.Features;
using Newtonsoft.Json;
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace EVCB_OCPP.Packet20.Messages
{
    public class HeartbeatRequest:IRequest
    {
        public HeartbeatRequest()
        {
            Action = Actions.Heartbeat.ToString();
        }

        private IRequest _request = null;

        [JsonIgnore]
        public string Action { set; get; }

        public IRequest GetRequest()
        {
            return _request;
        }

        public void SetRequest(IRequest request)
        {
            _request = request;
        }

        public bool TransactionRelated()
        {
            return false;
        }

        public bool Validate()
        {
            return Validator.TryValidateObject(this, new ValidationContext(this), null, true);
        }
    }
}
