using EVCB_OCPP.Packet20.DataTypes.EnumTypes;
using Newtonsoft.Json;
using Newtonsoft.Json.Converters;
using System.ComponentModel.DataAnnotations;

namespace EVCB_OCPP.Packet20.DataTypes
{
    public class IdTokenType
    {
        /// <summary>
        /// Required. IdToken is case insensitive. Might hold the
        /// hidden id of an RFID tag, but can for example also
        ///contain a UUID.
        /// </summary>
        [Required]
        [StringLength(36, MinimumLength = 0)]       
        public string IdToken { set; get; }

        /// <summary>
        /// Required. Enumeration of possible idToken types.
        /// </summary>
        [Required]
        [StringLength(36, MinimumLength = 0)]
        [JsonConverter(typeof(StringEnumConverter))]
        public IdTokenEnumType Type { set; get; }

        /// <summary>
        /// Optional. AdditionalInfo can be used to send extra
        ///information which can be validated by the CSMS in
        ///addition to the regular authorization with IdToken.
        ///AdditionalInfo contains one or more custom types, which
        ///need to be agreed upon by all parties involved.When
        ///AdditionalInfo is NOT implemented or a not supported
        ///AdditionalInfo.type is used, the CSMS/Charging Station
        ///MAY ignore the AdditionalInfo.
        /// </summary>          
        public AdditionalInfoType AdditionalInfo { set; get; }
    }
}
