ReserveNowRequest.cs 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  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.Reservation
  11. {
  12. public class ReserveNowRequest : IRequest
  13. {
  14. public ReserveNowRequest()
  15. {
  16. Action = Actions.ReserveNow.ToString();
  17. }
  18. [JsonIgnore]
  19. public string Action { set; get; }
  20. [Required]
  21. public int connectorId { set; get; }
  22. [Required]
  23. [JsonConverter(typeof(UTCDateTimeConverter))]
  24. public DateTime expiryDate { set; get; }
  25. [Required(AllowEmptyStrings = true)]
  26. public string idTag { set; get; }
  27. public string parentIdTag { set; get; }
  28. [Required]
  29. public int reservationId { set; get; }
  30. public bool TransactionRelated()
  31. {
  32. return false;
  33. }
  34. public bool Validate()
  35. {
  36. return Validator.TryValidateObject(this, new ValidationContext(this), null, true);
  37. }
  38. }
  39. }