GetDiagnosticsRequest.cs 1.1 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 GetDiagnosticsRequest : IRequest
  13. {
  14. public GetDiagnosticsRequest()
  15. {
  16. Action = Actions.GetDiagnostics.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. public int? retryInterval { set; get; }
  24. [JsonConverter(typeof(UTCDateTimeConverter))]
  25. public DateTime? startTime { set; get; }
  26. [JsonConverter(typeof(UTCDateTimeConverter))]
  27. public DateTime? stopTime { set; get; }
  28. public bool TransactionRelated()
  29. {
  30. return false;
  31. }
  32. public bool Validate()
  33. {
  34. return Validator.TryValidateObject(this, new ValidationContext(this), null, true);
  35. }
  36. }
  37. }