RemoteStartTransactionRequest.cs 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. using Newtonsoft.Json;
  2. using EVCB_OCPP.Packet.Utilities;
  3. using EVCB_OCPP.Packet.Messages.SubTypes;
  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. using EVCB_OCPP.Packet.Features;
  11. namespace EVCB_OCPP.Packet.Messages.Core
  12. {
  13. public class RemoteStartTransactionRequest : IRequest
  14. {
  15. public RemoteStartTransactionRequest()
  16. {
  17. Action = Actions.RemoteStartTransaction.ToString();
  18. }
  19. [JsonIgnore]
  20. public string Action { set; get; }
  21. /// <summary>
  22. /// 充電槍號(開始為1)
  23. /// </summary>
  24. public int? connectorId { set; get; }
  25. /// <summary>
  26. /// Authorization Id
  27. /// </summary>
  28. [Required(AllowEmptyStrings = true)]
  29. public string idTag { set; get; }
  30. /// <summary>
  31. /// Charging Profile to be used by the Charge Point for the
  32. /// requested transaction. ChargingProfilePurpose MUST be set to TxProfile
  33. /// </summary>
  34. public csChargingProfiles chargingProfile { set; get; }
  35. public bool TransactionRelated()
  36. {
  37. return false;
  38. }
  39. public bool Validate()
  40. {
  41. return Validator.TryValidateObject(this, new ValidationContext(this), null, true);
  42. }
  43. }
  44. }