BootNotificationRequest.cs 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. using EVCB_OCPP.Packet.Features;
  2. using Newtonsoft.Json;
  3. using System;
  4. using System.Collections.Generic;
  5. using System.ComponentModel.DataAnnotations;
  6. using System.Linq;
  7. using System.Text;
  8. using System.Threading.Tasks;
  9. namespace EVCB_OCPP.Packet.Messages.Core
  10. {
  11. public class BootNotificationRequest : IRequest
  12. {
  13. public BootNotificationRequest()
  14. {
  15. Action = Actions.BootNotification.ToString();
  16. }
  17. [JsonIgnore]
  18. public string Action { set; get; }
  19. [MaxLength(25)]
  20. public string chargeBoxSerialNumber { set; get; }
  21. [Required]
  22. [MaxLength(20)]
  23. public string chargePointModel { set; get; }
  24. [MaxLength(25)]
  25. public string chargePointSerialNumber { set; get; }
  26. // [Required(AllowEmptyStrings=true)]
  27. [MaxLength(20)]
  28. public string chargePointVendor { set; get; }
  29. [MaxLength(50)]
  30. public string firmwareVersion { set; get; }
  31. [MaxLength(20)]
  32. public string iccid { set; get; }
  33. [MaxLength(20)]
  34. public string imsi { set; get; }
  35. [MaxLength(25)]
  36. public string meterSerialNumber { set; get; }
  37. [MaxLength(25)]
  38. public string meterType { set; get; }
  39. public bool TransactionRelated()
  40. {
  41. return false;
  42. }
  43. public bool Validate()
  44. {
  45. return Validator.TryValidateObject(this, new ValidationContext(this), null, true);
  46. }
  47. }
  48. }