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 NetworkConnectionProfileType
    {
        /// <summary>
        /// Defines the OCPP version used for this
        ///  communication function.
        /// </summary>
        [Required]
        [JsonConverter(typeof(StringEnumConverter))]
        public OCPPVersionEnumType OcppVersion { set; get; }

        /// <summary>
        /// Defines the transport protocol (e.g. SOAP or
        ///JSON). Note: SOAP is not supported in OCPP 2.0, but is
        ///supported by other versions of OCPP.
        /// </summary>
        [Required]
        [JsonConverter(typeof(StringEnumConverter))]
        public OCPPTransportEnumType OcppTransport { set; get; }


        /// <summary>
        /// URL of the CSMS(s) that this Charging Station
        ///  communicates with.
        /// </summary>
        [StringLength(512, MinimumLength = 0)]
        public string OcppCsmsUrl { set; get; }

        /// <summary>
        /// Duration in seconds before a message send by
        ///the Charging Station via this network connection timesout.
        /// The best setting depends on the underlying network
        ///and response times of the CSMS.If you are looking for a
        ///some guideline: use 30 seconds as a starting point.
        /// </summary>
        [Required]
        public int MessageTimeout { set; get; }

        /// <summary>
        /// Applicable Network Interface
        /// </summary>
        [Required]
        [JsonConverter(typeof(StringEnumConverter))]
        public OCPPInterfaceEnumType OcppInterface { set; get; }

        /// <summary>
        /// Settings to be used to set up the VPN
        ///connection
        /// </summary>
        public VPNType Vpn { set; get; }

        /// <summary>
        /// Collection of configuration data needed to
        ///make a data-connection over a cellular network.
        /// </summary>
        public APNType Apn { set; get; }
    }
}
