BootNotificationRequest.cs 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. using EVCB_OCPP.Packet20.DataTypes;
  2. using EVCB_OCPP.Packet20.DataTypes.EnumTypes;
  3. using EVCB_OCPP.Packet20.Features;
  4. using Newtonsoft.Json;
  5. using Newtonsoft.Json.Converters;
  6. using System;
  7. using System.Collections.Generic;
  8. using System.ComponentModel.DataAnnotations;
  9. using System.Linq;
  10. using System.Text;
  11. using System.Threading.Tasks;
  12. namespace EVCB_OCPP.Packet20.Messages
  13. {
  14. public class BootNotificationRequest : IRequest
  15. {
  16. [Required]
  17. [JsonConverter(typeof(StringEnumConverter))]
  18. public BootReasonEnumType Reason { set; get; }
  19. /// <summary>
  20. /// Identifies the Charging Station
  21. /// </summary>
  22. [Required]
  23. public ChargingStationType ChargingStation { set; get; }
  24. [JsonIgnore]
  25. public string Action { set; get; }
  26. public BootNotificationRequest()
  27. {
  28. Action = Actions.BootNotification.ToString();
  29. }
  30. public bool TransactionRelated()
  31. {
  32. return false;
  33. }
  34. public bool Validate()
  35. {
  36. return Validator.TryValidateObject(this, new ValidationContext(this), null, true);
  37. }
  38. }
  39. }