using EVCB_OCPP.Packet.Features;
using EVCB_OCPP.Packet.Messages.SubTypes;
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.Packet.Messages.Security
{
public class GetLogRequest:IRequest
{
public GetLogRequest()
{
Action = Actions.GetLog.ToString();
}
///
/// This contains the type of log file that the Charge Point should send.
///
[Required]
[JsonConverter(typeof(StringEnumConverter))]
public LogEnumType logType { set; get; }
///
/// The Id of this request
///
[Required]
public int requestId { set; get; }
///
/// This specifies how many times the Charge Point must try to upload the
/// log before giving up.If this field is not present, it is left to Charge Point to decide
/// how many times it wants to retry
///
public int retries { set; get; }
///
/// The interval in seconds after which a retry may be attempted. If this
///field is not present, it is left to Charge Point to decide how long to wait between
///attempts.
///
public int retryInterval { set; get; }
///
/// This field specifies the requested log and the location to which the log
///should be sent.
///
[Required]
public LogParametersType log { 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);
}
}
}