UpdateFirmwareRequest.cs 1.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. using EVCB_OCPP.Packet.Features;
  2. using EVCB_OCPP.Packet.Utilities;
  3. using Newtonsoft.Json;
  4. using System;
  5. using System.Collections.Generic;
  6. using System.ComponentModel.DataAnnotations;
  7. using System.Linq;
  8. using System.Text;
  9. using System.Threading.Tasks;
  10. namespace EVCB_OCPP.Packet.Messages.FirmwareManagement
  11. {
  12. public class UpdateFirmwareRequest : IRequest
  13. {
  14. public UpdateFirmwareRequest()
  15. {
  16. Action = Actions.UpdateFirmware.ToString();
  17. }
  18. [JsonIgnore]
  19. public string Action { set; get; }
  20. [Required]
  21. public Uri location { set; get; }
  22. public int? retries { set; get; }
  23. [Required]
  24. [JsonConverter(typeof(UTCDateTimeConverter))]
  25. public DateTime retrieveDate { set; get; }
  26. public int? retryInterval { set; get; }
  27. public bool TransactionRelated()
  28. {
  29. return false;
  30. }
  31. public bool Validate()
  32. {
  33. return Validator.TryValidateObject(this, new ValidationContext(this), null, true);
  34. }
  35. }
  36. }