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 GetVariableResultType
    {
        /// <summary>
        /// Result status of getting the variable.
        /// </summary>
        [Required]
        [JsonConverter(typeof(StringEnumConverter))]
        public GetVariableStatusEnumType AttributeStatus { set; get; }

        /// <summary>
        /// Attribute type for which value is requested.
        /// When absent, default Actual is assumed
        /// </summary>
        [JsonConverter(typeof(StringEnumConverter))]
        public AttributeEnumType? AttributeType { set; get; }

        /// <summary>
        /// Value of requested attribute type of componentvariable.
        /// This field can only be empty when the given
        ///status is NOT accepted.
        ///The Configuration Variable ReportingValueSize can be
        ///used to limit GetVariableResult.attributeValue,
        ///VariableAttribute.value and EventData.actualValue.The
        ///max size of these values will always remain equal.
        /// </summary>
        [StringLength(2500, MinimumLength = 0)]
        public string AttributeValue { set; get; }

        /// <summary>
        /// Component for which the Variable is requested
        /// </summary>
        [Required]
        public ComponentType Component { set; get; }

        /// <summary>
        /// Variable for which the attribute value is
        ///requested.
        /// </summary>
        [Required]
        public VariableType Variable { set; get; }

    }
}
