using EVCB_OCPP.Packet.Features;
using EVCB_OCPP.Packet.Utilities;
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.Packet.Messages.FirmwareManagement
{
    public class GetDiagnosticsRequest : IRequest
    {
        public GetDiagnosticsRequest()
        {
            Action = Actions.GetDiagnostics.ToString();
        }

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

        [Required]
        public Uri location { set; get; }

        public int? retries { set; get; }

        public int? retryInterval { set; get; }

        [JsonConverter(typeof(UTCDateTimeConverter))]
        public DateTime? startTime { set; get; }

        [JsonConverter(typeof(UTCDateTimeConverter))]
        public DateTime? stopTime { set; get; }

        public bool TransactionRelated()
        {
            return false;
        }

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