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.SubTypes
{
    public class FirmwareType
    {
        /// <summary>
        /// URI defining the origin of the firmware.
        /// </summary>
        [StringLength(512, MinimumLength = 0)]
        [Required]
        public string location { set; get; }

        /// <summary>
        /// Date and time at which the firmware shall be retrieved.
        /// </summary>
        [Required]
        [JsonConverter(typeof(UTCDateTimeConverter))]
        public DateTime retrieveDateTime { set; get; }

        /// <summary>
        /// Date and time at which the firmware shall be installed
        /// </summary>      
        [JsonConverter(typeof(UTCDateTimeConverter))]
        public DateTime installDateTime { set; get; }

        /// <summary>
        ///Certificate with which the firmware was signed. PEM encoded X.509
        ///  certificate.
        /// </summary>
        [StringLength(5500, MinimumLength = 0)]
        [Required]
        public string signingCertificate { set; get; }

        /// <summary>
        // Base64 encoded firmware signature.
        /// </summary>
        [StringLength(800, MinimumLength = 0)]
        [Required]
        public string signature { set; get; }



    }
}
