SignedFirmwareStatusNotificationRequest.cs 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  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 SignedFirmwareStatusNotificationRequest: IRequest
  14. {
  15. public SignedFirmwareStatusNotificationRequest()
  16. {
  17. Action = Actions.SignedFirmwareStatusNotification.ToString();
  18. }
  19. /// <summary>
  20. /// This contains the progress status of the firmware installation.
  21. /// </summary>
  22. [Required]
  23. [JsonConverter(typeof(StringEnumConverter))]
  24. public FirmwareStatusEnumType status { set; get; }
  25. /// <summary>
  26. /// The request id that was provided in the SignedUpdateFirmware.req
  27. /// that started this firmware update.This field is mandatory, unless the message
  28. /// was triggered by a TriggerMessage.req or the ExtendedTriggerMessage.req AND
  29. ///there is no firmware update ongoing
  30. /// </summary>
  31. public int requestId { set; get; }
  32. [JsonIgnore]
  33. public string Action { set; get; }
  34. public bool TransactionRelated()
  35. {
  36. return false;
  37. }
  38. public bool Validate()
  39. {
  40. return Validator.TryValidateObject(this, new ValidationContext(this), null, true);
  41. }
  42. }
  43. }