GetLogRequest.cs 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. using EVCB_OCPP.Packet.Features;
  2. using EVCB_OCPP.Packet.Messages.SubTypes;
  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.Packet.Messages.Security
  12. {
  13. public class GetLogRequest:IRequest
  14. {
  15. public GetLogRequest()
  16. {
  17. Action = Actions.GetLog.ToString();
  18. }
  19. /// <summary>
  20. /// This contains the type of log file that the Charge Point should send.
  21. /// </summary>
  22. [Required]
  23. [JsonConverter(typeof(StringEnumConverter))]
  24. public LogEnumType logType { set; get; }
  25. /// <summary>
  26. /// The Id of this request
  27. /// </summary>
  28. [Required]
  29. public int requestId { set; get; }
  30. /// <summary>
  31. /// This specifies how many times the Charge Point must try to upload the
  32. /// log before giving up.If this field is not present, it is left to Charge Point to decide
  33. /// how many times it wants to retry
  34. /// </summary>
  35. public int retries { set; get; }
  36. /// <summary>
  37. /// The interval in seconds after which a retry may be attempted. If this
  38. ///field is not present, it is left to Charge Point to decide how long to wait between
  39. ///attempts.
  40. /// </summary>
  41. public int retryInterval { set; get; }
  42. /// <summary>
  43. /// This field specifies the requested log and the location to which the log
  44. ///should be sent.
  45. /// </summary>
  46. [Required]
  47. public LogParametersType log { set; get; }
  48. [JsonIgnore]
  49. public string Action { set; get; }
  50. public bool TransactionRelated()
  51. {
  52. return false;
  53. }
  54. public bool Validate()
  55. {
  56. return Validator.TryValidateObject(this, new ValidationContext(this), null, true);
  57. }
  58. }
  59. }