ResetRequest.cs 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. using Newtonsoft.Json;
  2. using Newtonsoft.Json.Converters;
  3. using EVCB_OCPP.Packet.Utilities;
  4. using EVCB_OCPP.Packet.Messages.SubTypes;
  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. using EVCB_OCPP.Packet.Features;
  12. namespace EVCB_OCPP.Packet.Messages.Core
  13. {
  14. public class ResetRequest : IRequest
  15. {
  16. public ResetRequest()
  17. {
  18. Action = Actions.Reset.ToString();
  19. }
  20. [JsonIgnore]
  21. public string Action { set; get; }
  22. /// <summary>
  23. /// This contains the type of reset that the
  24. /// Charge Point should perform.
  25. /// </summary>
  26. [Required]
  27. [JsonConverter(typeof(StringEnumConverter))]
  28. public ResetType type { set; get; }
  29. public bool TransactionRelated()
  30. {
  31. return false;
  32. }
  33. public bool Validate()
  34. {
  35. return Validator.TryValidateObject(this, new ValidationContext(this), null, true);
  36. }
  37. }
  38. }