using EVCB_OCPP.Packet.Features;
using EVCB_OCPP.Packet.Utilities;
using Newtonsoft.Json;
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace EVCB_OCPP.Packet.Messages.Security
{
public class SecurityEventNotificationRequest:IRequest
{
public SecurityEventNotificationRequest()
{
Action = Actions.SecurityEventNotification.ToString();
}
///
/// Type of the security event (See list of currently known security events)
///
[Required]
[StringLength(50,MinimumLength =0)]
public string type { set; get; }
///
/// Date and time at which the event occurred.
///
[Required]
[JsonConverter(typeof(UTCDateTimeConverter))]
public DateTime timestamp { set; get; }
///
/// Additional information about the occurred security event.
///
[Required]
[StringLength(255, MinimumLength = 0)]
public string techInfo { set; get; }
[JsonIgnore]
public string Action { set; get; }
public bool TransactionRelated()
{
return false;
}
public bool Validate()
{
return Validator.TryValidateObject(this, new ValidationContext(this), null, true);
}
}
}