GetLogConfirmation.cs 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. using EVCB_OCPP.Packet.Messages.SubTypes;
  2. using Newtonsoft.Json;
  3. using Newtonsoft.Json.Converters;
  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.Security
  11. {
  12. public class GetLogConfirmation:IConfirmation
  13. {
  14. /// <summary>
  15. /// This field indicates whether the Charge Point was able to accept the
  16. ///request.
  17. /// </summary>
  18. [Required]
  19. [JsonConverter(typeof(StringEnumConverter))]
  20. public LogStatusEnumType status { set; get; }
  21. /// <summary>
  22. /// This contains the name of the log file that will be uploaded. This field is
  23. ///not present when no logging information is available
  24. /// </summary>
  25. [StringLength(255, MinimumLength = 0)]
  26. public string filename { set; get; }
  27. private IRequest _request = null;
  28. public IRequest GetRequest()
  29. {
  30. return _request;
  31. }
  32. public void SetRequest(IRequest request)
  33. {
  34. _request = request;
  35. }
  36. public bool Validate()
  37. {
  38. return Validator.TryValidateObject(this, new ValidationContext(this), null, true);
  39. }
  40. }
  41. }