StatusNotificationRequest.cs 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. using EVCB_OCPP.Packet20.DataTypes.EnumTypes;
  2. using EVCB_OCPP.Packet20.Utilites;
  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.Packet20.Messages
  12. {
  13. public class StatusNotificationRequest:IRequest
  14. {
  15. /// <summary>
  16. /// The time for which the status is reported. If
  17. ///absent time of receipt of the message will be assumed.
  18. /// </summary>
  19. [Required]
  20. [JsonConverter(typeof(UTCDateTimeConverter))]
  21. public DateTime Timestamp { set; get; }
  22. /// <summary>
  23. /// This contains the current status of the
  24. /// Connector.
  25. /// </summary>
  26. [Required]
  27. [JsonConverter(typeof(StringEnumConverter))]
  28. public ConnectorStatusEnumType ConnectorStatus { set; get; }
  29. /// <summary>
  30. /// The id of the EVSE to which the connector
  31. /// belongs for which the the status is reported.
  32. /// </summary>
  33. [Required]
  34. public int EvseId { set; get; }
  35. /// <summary>
  36. /// The id of the connector within the EVSE for
  37. /// which the status is reported.
  38. /// </summary>
  39. [Required]
  40. public int ConnectorId { set; get; }
  41. public string Action { get => throw new NotImplementedException(); set => throw new NotImplementedException(); }
  42. public bool TransactionRelated()
  43. {
  44. return false;
  45. }
  46. public bool Validate()
  47. {
  48. return Validator.TryValidateObject(this, new ValidationContext(this), null, true);
  49. }
  50. }
  51. }