LogStatusNotificationRequest.cs 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. using EVCB_OCPP.Packet.Features;
  2. using EVCB_OCPP.Packet.Messages.SubTypes;
  3. using Newtonsoft.Json;
  4. using Newtonsoft.Json.Converters;
  5. using System;
  6. using System.Collections.Generic;
  7. using System.ComponentModel.DataAnnotations;
  8. using System.Linq;
  9. using System.Text;
  10. using System.Threading.Tasks;
  11. namespace EVCB_OCPP.Packet.Messages.Security
  12. {
  13. public class LogStatusNotificationRequest
  14. {
  15. public LogStatusNotificationRequest()
  16. {
  17. Action = Actions.LogStatusNotification.ToString();
  18. }
  19. /// <summary>
  20. /// This contains the status of the log upload
  21. /// </summary>
  22. [Required]
  23. [JsonConverter(typeof(StringEnumConverter))]
  24. public UploadLogStatusEnumType status { set; get; }
  25. /// <summary>
  26. /// The request id that was provided in the GetLog.req that started this log
  27. ///upload.
  28. /// </summary>
  29. public int requestId { set; get; }
  30. [JsonIgnore]
  31. public string Action { set; get; }
  32. public bool TransactionRelated()
  33. {
  34. return false;
  35. }
  36. public bool Validate()
  37. {
  38. return Validator.TryValidateObject(this, new ValidationContext(this), null, true);
  39. }
  40. }
  41. }