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

namespace EVCB_OCPP.Packet20.DataTypes
{
    public class SetVariableDataType
    {

        /// <summary>
        /// Type of attribute: Actual, Target, MinSet,
        /// MaxSet.Default is Actual when omitted.
        /// </summary>
        [JsonConverter(typeof(StringEnumConverter))]
        public AttributeEnumType? AttributeType { set; get; }

        /// <summary>
        /// Value to be assigned to attribute of variable.
        ///The Configuration Variable ConfigurationValueSize can
       /// be used to limit SetVariableData.attributeValue and
        ///VariableCharacteristics.valueList.The max size of these
       /// values will always remain equal
        /// </summary>
        [Required]
        [StringLength(1000,MinimumLength =0)]
        public string AttributeValue { set; get; }

        /// <summary>
        /// Component for which monitor is set.
        ///variable VariableType
        /// </summary>
        [Required]
        public ComponentType Component { set; get; }

        /// <summary>
        /// Variable for which monitor is set.
        /// </summary>
        [Required]
        public VariableType Variable { set; get; }
    }
}
