ExtendedTriggerMessageRequest.cs 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  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 ExtendedTriggerMessageRequest:IRequest
  14. {
  15. public ExtendedTriggerMessageRequest()
  16. {
  17. Action = Actions.ExtendedTriggerMessage.ToString();
  18. }
  19. /// <summary>
  20. /// Required. Type of the message to be triggered
  21. /// </summary>
  22. [Required]
  23. [JsonConverter(typeof(StringEnumConverter))]
  24. public MessageTriggerEnumType requestedMessage { set; get; }
  25. /// <summary>
  26. /// Only filled in when request applies to a specific connector.
  27. /// </summary>
  28. public int connectorId { set; get; }
  29. [JsonIgnore]
  30. public string Action { set; get; }
  31. public bool TransactionRelated()
  32. {
  33. return false;
  34. }
  35. public bool Validate()
  36. {
  37. return Validator.TryValidateObject(this, new ValidationContext(this), null, true);
  38. }
  39. }
  40. }