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

namespace EVCB_OCPP.Packet20.DataTypes
{
    public class IdTokenInfoType
    {
        /// <summary>
        /// Current status of the ID Token.
        /// </summary>
        [JsonConverter(typeof(StringEnumConverter))]
        public AuthorizationStatusEnumType? Status { set; get; }

        /// <summary>
        /// Date and Time after which the token must be
        ///considered invalid.
        /// </summary>
        public DateTime? CacheExpiryDateTime { set; get; }

        /// <summary>
        /// Priority from a business point of view. Default
        /// priority is 0, The range is from -9 to 9. Higher values
        ///indicate a higher priority.The chargingPriority in
        ///TransactionEventResponse has a higher priority than this
        ///one
        /// </summary>
        public int? ChargingPriority { set; get; }

        /// <summary>
        /// Preferred user interface language of identifier
        /// user.Contains a language code as defined in [RFC5646].
        /// </summary>
        [StringLength(8, MinimumLength = 0)]
        public string Language1 { set; get; }


        /// <summary>
        /// Only used when the IdToken is only valid for
        ///one or more specific EVSEs, not for the entire Charging
        /// Station.
        /// </summary>
        public int? EvseId { set; get; }
    }
}
