/// <summary> /// A communication error occured. /// </summary> /// <param name="SessionId">The unique charging session identification.</param> /// <param name="Message">An optional (error)message.</param> public static RemoteStopEVSEResult CommunicationError(ChargingSession_Id SessionId, String Message = "") { return(new RemoteStopEVSEResult(SessionId, RemoteStopEVSEResultType.CommunicationError, Message)); }
/// <summary> /// The remote stop led to an error. /// </summary> /// <param name="SessionId">The unique charging session identification.</param> /// <param name="Message">An optional (error) message.</param> public static RemoteStopEVSEResult Error(ChargingSession_Id SessionId, String Message = null) { return(new RemoteStopEVSEResult(SessionId, RemoteStopEVSEResultType.Error, Message)); }
/// <summary> /// The remote stop led to an error. /// </summary> /// <param name="SessionId">The unique charging session identification.</param> /// <param name="Message">An optional error message.</param> /// <param name="AdditionalInfo">An optional additional information on this error, e.g. the HTTP error response.</param> public static RemoteStopResult Error(ChargingSession_Id SessionId, String Message = null, Object AdditionalInfo = null) => new RemoteStopResult(SessionId, RemoteStopResultType.Error, Message, AdditionalInfo);
/// <summary> /// The remote stop was successful. /// </summary> /// <param name="SessionId">The unique charging session identification.</param> /// <param name="ReservationId">The optional charging reservation identification of the charging session.</param> /// <param name="ReservationHandling">The handling of the charging reservation after the charging session stopped.</param> public static RemoteStopResult Success(ChargingSession_Id SessionId, ChargingReservation_Id?ReservationId = null, ReservationHandling?ReservationHandling = null) => new RemoteStopResult(SessionId, RemoteStopResultType.Success, ReservationId, ReservationHandling);
/// <summary> /// The remote stop was successful. /// </summary> /// <param name="SessionId">The unique charging session identification.</param> /// <param name="ReservationId">The optional charging reservation identification of the charging session.</param> /// <param name="ReservationHandling">The handling of the charging reservation after the charging session stopped.</param> public static RemoteStopEVSEResult Success(ChargingSession_Id SessionId, ChargingReservation_Id ReservationId = null, ReservationHandling ReservationHandling = null) { return(new RemoteStopEVSEResult(SessionId, RemoteStopEVSEResultType.Success, ReservationId, ReservationHandling)); }
/// <summary> /// Create a charge detail record for the given charging session (identification). /// </summary> /// <param name="SessionId">The unique charging session identification.</param> /// <param name="ChargingReservation">An optional charging reservation used for charging.</param> /// /// <param name="EVSE">The EVSE of the EVSE used for charging.</param> /// <param name="ChargingStation">The charging station of the charging station used for charging.</param> /// <param name="ChargingPool">The charging pool of the charging pool used for charging.</param> /// <param name="EVSEOperator">The EVSE operator used for charging.</param> /// <param name="ChargingProductId">An unqiue identification for the consumed charging product.</param> /// /// <param name="ReservationTime">Optional timestamps when the reservation started and ended.</param> /// <param name="ParkingTime">Optional timestamps when the parking started and ended.</param> /// <param name="SessionTime">Optional timestamps when the charging session started and ended.</param> /// /// <param name="EnergyMeterId">An optional unique identification of the energy meter.</param> /// <param name="EnergyMeteringValues">An optional enumeration of intermediate energy metering values.</param> /// <param name="MeteringSignature">An optional signature for the metering values.</param> /// /// <param name="IdentificationStart">The identification for the start of the charging process.</param> /// <param name="IdentificationStop">The identification for the stop of the charging process.</param> public ChargeDetailRecord(ChargingSession_Id SessionId, ChargingReservation Reservation = null, ChargingReservation_Id ReservationId = null, EVSEOperator EVSEOperator = null, ChargingPool ChargingPool = null, ChargingStation ChargingStation = null, EVSE EVSE = null, EVSE_Id EVSEId = null, ChargingProduct_Id ChargingProductId = null, EVSP_Id ProviderId = null, StartEndDateTime?ReservationTime = null, StartEndDateTime?ParkingTime = null, StartEndDateTime?SessionTime = null, EnergyMeter_Id EnergyMeterId = null, IEnumerable <Timestamped <Double> > EnergyMeteringValues = null, String MeteringSignature = null, AuthInfo IdentificationStart = null, AuthInfo IdentificationStop = null) { #region Initial checks if (SessionId == null) { throw new ArgumentNullException("Id", "The charging session identification must not be null!"); } #endregion this._SessionId = SessionId; this._Reservation = Reservation; this._ReservationId = ReservationId != null ? ReservationId : Reservation != null ? Reservation.Id : null; this._ReservationTime = ReservationTime; this._EVSE = EVSE; this._EVSEId = EVSE != null ? EVSE.Id : EVSEId; this._ChargingStation = ChargingStation; this._ChargingPool = ChargingPool; this._EVSEOperator = EVSEOperator; this._ChargingProductId = ChargingProductId; this._ParkingTime = ParkingTime; this._SessionTime = SessionTime; this._EnergyMeterId = EnergyMeterId; this._EnergyMeteringValues = EnergyMeteringValues != null ? EnergyMeteringValues : new Timestamped <Double> [0]; this._IdentificationStart = IdentificationStart; this._IdentificationStop = IdentificationStop; }
/// <summary> /// Create a new remote stop result. /// </summary> /// <param name="SessionId">The unique charging session identification.</param> /// <param name="Result">The result of the remote stop request.</param> /// <param name="ErrorMessage">A optional error message.</param> /// <param name="AdditionalInfo">An optional additional information on this error, e.g. the HTTP error response.</param> private RemoteStopResult(ChargingSession_Id SessionId, RemoteStopResultType Result, String ErrorMessage = null, Object AdditionalInfo = null) { this.SessionId = SessionId; this.Result = Result; this.Message = ErrorMessage; this.AdditionalInfo = AdditionalInfo; }
/// <summary> /// Create a new remote stop result. /// </summary> /// <param name="SessionId">The unique charging session identification.</param> /// <param name="Result">The result of the remote stop request.</param> /// <param name="ReservationId">The optional charging reservation identification of the charging session.</param> /// <param name="ReservationHandling">The handling of the charging reservation after the charging session stopped.</param> private RemoteStopResult(ChargingSession_Id SessionId, RemoteStopResultType Result, ChargingReservation_Id?ReservationId, ReservationHandling?ReservationHandling) { this.SessionId = SessionId; this.Result = Result; this.ReservationId = ReservationId; this.ReservationHandling = ReservationHandling ?? WWCP.ReservationHandling.Close; }
/// <summary> /// The authorize start was successful. /// </summary> /// <param name="AuthorizatorId">An authorizator identification.</param> /// <param name="SessionId">The charging session identification for the authorize start operation.</param> /// <param name="ProviderId">The unique identification of the ev service provider.</param> /// <param name="Description">An optional description of the auth start result.</param> /// <param name="AdditionalInfo">An optional additional message.</param> /// <param name="ListOfAuthStopTokens">An optional enumeration of authorize stop tokens.</param> /// <param name="ListOfAuthStopPINs">An optional enumeration of authorize stop PINs.</param> public static AuthStartChargingStationResult Authorized(Authorizator_Id AuthorizatorId, ChargingSession_Id SessionId, EVSP_Id ProviderId, String Description = null, String AdditionalInfo = null, IEnumerable <Auth_Token> ListOfAuthStopTokens = null, IEnumerable <UInt32> ListOfAuthStopPINs = null) { return(new AuthStartChargingStationResult(AuthorizatorId, SessionId, ProviderId, Description, AdditionalInfo, ListOfAuthStopTokens, ListOfAuthStopPINs)); }
/// <summary> /// Create a new remote stop result. /// </summary> /// <param name="SessionId">The unique charging session identification.</param> /// <param name="Result">The result of the remote stop request.</param> /// <param name="ErrorMessage">A optional error message.</param> private RemoteStopEVSEResult(ChargingSession_Id SessionId, RemoteStopEVSEResultType Result, String ErrorMessage = null) { #region Initial checks if (SessionId == null) { throw new ArgumentNullException(nameof(SessionId), "The given charging session identification must not be null!"); } #endregion this._SessionId = SessionId; this._Result = Result; this._Message = ErrorMessage; }
/// <summary> /// Create a new remote stop result. /// </summary> /// <param name="SessionId">The unique charging session identification.</param> /// <param name="Result">The result of the remote stop request.</param> /// <param name="ReservationId">The optional charging reservation identification of the charging session.</param> /// <param name="ReservationHandling">The handling of the charging reservation after the charging session stopped.</param> private RemoteStopEVSEResult(ChargingSession_Id SessionId, RemoteStopEVSEResultType Result, ChargingReservation_Id ReservationId, ReservationHandling ReservationHandling) { #region Initial checks if (SessionId == null) { throw new ArgumentNullException(nameof(SessionId), "The given charging session identification must not be null!"); } #endregion this._SessionId = SessionId; this._Result = Result; this._ReservationId = ReservationId; this._ReservationHandling = ReservationHandling != null ? ReservationHandling : ReservationHandling.Close; }
/// <summary> /// Create a new remote stop result. /// </summary> /// <param name="ChargeDetailRecord">The charge detail record for a successfully stopped charging process.</param> /// <param name="Result">The result of the remote stop request.</param> /// <param name="ReservationId">The optional charging reservation identification of the charging session.</param> /// <param name="ReservationHandling">The handling of the charging reservation after the charging session stopped.</param> private RemoteStopEVSEResult(ChargeDetailRecord ChargeDetailRecord, RemoteStopEVSEResultType Result, ChargingReservation_Id ReservationId, ReservationHandling ReservationHandling) { #region Initial checks if (ChargeDetailRecord == null) { throw new ArgumentNullException(nameof(ChargeDetailRecord), "The given charge detail record must not be null!"); } #endregion this._ChargeDetailRecord = ChargeDetailRecord; this._SessionId = ChargeDetailRecord.SessionId; this._Result = Result; this._ReservationId = ReservationId; this._ReservationHandling = ReservationHandling != null ? ReservationHandling : ReservationHandling.Close; }
/// <summary> /// Create a new successful authorize start result. /// </summary> /// <param name="AuthorizatorId">The identification of the authorizing entity.</param> /// <param name="SessionId">The charging session identification for the authorize start operation.</param> /// <param name="ProviderId">The unique identification of the ev service provider.</param> /// <param name="Description">An optional description of the auth start result.</param> /// <param name="AdditionalInfo">An optional additional message.</param> /// <param name="ListOfAuthStopTokens">An optional enumeration of authorize stop tokens.</param> /// <param name="ListOfAuthStopPINs">An optional enumeration of authorize stop PINs.</param> private AuthStartChargingStationResult(Authorizator_Id AuthorizatorId, ChargingSession_Id SessionId, EVSP_Id ProviderId, String Description = null, String AdditionalInfo = null, IEnumerable <Auth_Token> ListOfAuthStopTokens = null, IEnumerable <UInt32> ListOfAuthStopPINs = null) { #region Initial checks if (AuthorizatorId == null) { throw new ArgumentNullException("AuthorizatorId", "The given parameter must not be null!"); } if (SessionId == null) { throw new ArgumentNullException(nameof(SessionId), "The given parameter must not be null!"); } if (ProviderId == null) { throw new ArgumentNullException("ProviderId", "The given parameter must not be null!"); } #endregion this._Result = AuthStartChargingStationResultType.Authorized; this._AuthorizatorId = AuthorizatorId; this._SessionId = SessionId; this._ProviderId = ProviderId; this._Description = Description != null ? Description : String.Empty; this._AdditionalInfo = AdditionalInfo != null ? AdditionalInfo : String.Empty; this._ListOfAuthStopTokens = ListOfAuthStopTokens != null ? ListOfAuthStopTokens : new Auth_Token[0]; this._ListOfAuthStopPINs = ListOfAuthStopPINs != null ? ListOfAuthStopPINs : new UInt32[0]; }
/// <summary> /// The remote stop led to a communication error. /// </summary> /// <param name="SessionId">The unique charging session identification.</param> /// <param name="Message">An optional error message.</param> public static RemoteStopResult CommunicationError(ChargingSession_Id SessionId, String Message = null) => new RemoteStopResult(SessionId, RemoteStopResultType.CommunicationError, Message);
/// <summary> /// The remote stop ran into a timeout. /// </summary> /// <param name="SessionId">The unique charging session identification.</param> public static RemoteStopEVSEResult Timeout(ChargingSession_Id SessionId) { return(new RemoteStopEVSEResult(SessionId, RemoteStopEVSEResultType.Timeout)); }
/// <summary> /// The EVSE is offline. /// </summary> /// <param name="SessionId">The unique charging session identification.</param> public static RemoteStopEVSEResult Offline(ChargingSession_Id SessionId) { return(new RemoteStopEVSEResult(SessionId, RemoteStopEVSEResultType.Offline, "The EVSE is offline!")); }
/// <summary> /// The charging station is offline. /// </summary> /// <param name="SessionId">The unique charging session identification.</param> public static RemoteStopChargingStationResult Offline(ChargingSession_Id SessionId) { return(new RemoteStopChargingStationResult(SessionId, RemoteStopChargingStationResultType.Offline, "The charging station is offline!")); }
/// <summary> /// Create a charge detail record for the given charging session (identification). /// </summary> /// <param name="SessionId">The unique charging session identification.</param> /// <param name="SessionTime">The timestamps when the charging session started and ended.</param> /// <param name="Duration">The duration of the charging session, whenever it is more than the time span between its start- and endtime, e.g. caused by a tariff granularity of 15 minutes.</param> /// /// <param name="EVSE">The EVSE used for charging.</param> /// <param name="EVSEId">The identification of the EVSE used for charging.</param> /// <param name="ChargingStation">The charging station of the charging station used for charging.</param> /// <param name="ChargingStationId">The identification of the charging station used for charging.</param> /// <param name="ChargingPool">The charging pool of the charging pool used for charging.</param> /// <param name="ChargingPoolId">The identification of the charging pool used for charging.</param> /// <param name="ChargingStationOperator">The charging station operator used for charging.</param> /// <param name="ChargingStationOperatorId">The identification of the charging station operator used for charging.</param> /// <param name="ChargingProduct">The consumed charging product.</param> /// <param name="ChargingPrice">The charging price.</param> /// /// <param name="AuthenticationStart">The authentication used for starting this charging process.</param> /// <param name="AuthenticationStop">The authentication used for stopping this charging process.</param> /// <param name="ProviderIdStart">The identification of the e-mobility provider used for starting this charging process.</param> /// <param name="ProviderIdStop">The identification of the e-mobility provider used for stopping this charging process.</param> /// /// <param name="Reservation">The optional charging reservation used before charging.</param> /// <param name="ReservationId">The optional charging reservation identification used before charging.</param> /// <param name="ReservationTime">Optional timestamps when the reservation started and ended.</param> /// /// <param name="ParkingSpaceId">The optional identification of the parkging space.</param> /// <param name="ParkingTime">Optional timestamps when the parking started and ended.</param> /// <param name="ParkingFee">The optional fee for parking.</param> /// /// <param name="EnergyMeterId">An optional unique identification of the energy meter.</param> /// <param name="EnergyMeteringValues">An optional enumeration of intermediate energy metering values.</param> /// /// <param name="CustomData">An optional dictionary of customer-specific data.</param> public ChargeDetailRecord(ChargingSession_Id SessionId, StartEndDateTime?SessionTime, TimeSpan?Duration = null, EVSE EVSE = null, EVSE_Id?EVSEId = null, ChargingStation ChargingStation = null, ChargingStation_Id?ChargingStationId = null, ChargingPool ChargingPool = null, ChargingPool_Id?ChargingPoolId = null, ChargingStationOperator ChargingStationOperator = null, ChargingStationOperator_Id?ChargingStationOperatorId = null, ChargingProduct ChargingProduct = null, Decimal?ChargingPrice = null, AAuthentication AuthenticationStart = null, AAuthentication AuthenticationStop = null, eMobilityProvider_Id?ProviderIdStart = null, eMobilityProvider_Id?ProviderIdStop = null, ChargingReservation Reservation = null, ChargingReservation_Id?ReservationId = null, StartEndDateTime?ReservationTime = null, ParkingSpace_Id?ParkingSpaceId = null, StartEndDateTime?ParkingTime = null, Decimal?ParkingFee = null, EnergyMeter_Id?EnergyMeterId = null, IEnumerable <Timestamped <Single> > EnergyMeteringValues = null, IEnumerable <SignedMeteringValue> SignedMeteringValues = null, IEnumerable <String> Signatures = null, IReadOnlyDictionary <String, Object> CustomData = null) : base(CustomData) { this.SessionId = SessionId; this.SessionTime = SessionTime; this.Duration = Duration; this.EVSE = EVSE; this.EVSEId = EVSEId ?? EVSE?.Id; this.ChargingStation = ChargingStation; this.ChargingStationId = ChargingStationId ?? ChargingStation?.Id; this.ChargingPool = ChargingPool; this.ChargingPoolId = ChargingPoolId ?? ChargingPool?.Id; this.ChargingStationOperator = ChargingStationOperator; this.ChargingStationOperatorId = ChargingStationOperatorId ?? ChargingStationOperator?.Id; this.ChargingProduct = ChargingProduct; this.ChargingPrice = ChargingPrice; this.IdentificationStart = AuthenticationStart; this.IdentificationStop = AuthenticationStop; this.ProviderIdStart = ProviderIdStart; this.ProviderIdStop = ProviderIdStop; this.Reservation = Reservation; this.ReservationId = ReservationId ?? Reservation?.Id; this.ReservationTime = ReservationTime; this.ParkingSpaceId = ParkingSpaceId; this.ParkingTime = ParkingTime; this.ParkingFee = ParkingFee; this.EnergyMeterId = EnergyMeterId; this.EnergyMeteringValues = EnergyMeteringValues ?? new Timestamped <Single> [0]; this.SignedMeteringValues = SignedMeteringValues ?? new SignedMeteringValue[0]; this._Signatures = Signatures.SafeAny() ? new HashSet <String>(Signatures) : new HashSet <String>(); if (SignedMeteringValues.SafeAny() && !EnergyMeteringValues.SafeAny()) { this.EnergyMeteringValues = SignedMeteringValues.Select(svalue => new Timestamped <Single>(svalue.Timestamp, (Single)svalue.MeterValue)); } }
public ChargeDetailRecordCollection(ChargingSession_Id ChargingSessionId, ChargeDetailRecord ChargeDetailRecord) : this(ChargingSessionId) { Add(ChargeDetailRecord); }
/// <summary> /// The charging session identification is unknown or invalid. /// </summary> /// <param name="SessionId">The unique charging session identification.</param> public static RemoteStopEVSEResult InvalidSessionId(ChargingSession_Id SessionId) { return(new RemoteStopEVSEResult(SessionId, RemoteStopEVSEResultType.InvalidSessionId, "The session identification is invalid!")); }
/// <summary> /// The EVSE operator is unknown. /// </summary> /// <param name="SessionId">The unique charging session identification.</param> public static RemoteStopEVSEResult UnknownOperator(ChargingSession_Id SessionId) { return(new RemoteStopEVSEResult(SessionId, RemoteStopEVSEResultType.UnknownOperator, "The EVSE operator is unknown!")); }
/// <summary> /// The result is unknown and/or should be ignored. /// </summary> /// <param name="SessionId">The unique charging session identification.</param> public static RemoteStopEVSEResult Unspecified(ChargingSession_Id SessionId) { return(new RemoteStopEVSEResult(SessionId, RemoteStopEVSEResultType.Unspecified)); }
/// <summary> /// The remote stop ran into a timeout. /// </summary> /// <param name="SessionId">The unique charging session identification.</param> public static RemoteStopResult Timeout(ChargingSession_Id SessionId) => new RemoteStopResult(SessionId, RemoteStopResultType.Timeout);
/// <summary> /// Unauthorized remote stop or invalid credentials. /// </summary> /// <param name="SessionId">The unique charging session identification.</param> public static RemoteStopEVSEResult InvalidCredentials(ChargingSession_Id SessionId) { return(new RemoteStopEVSEResult(SessionId, RemoteStopEVSEResultType.InvalidCredentials, "Unauthorized remote stop or invalid credentials!")); }
public ChargeDetailRecordCollection(ChargingSession_Id ChargingSessionId) { this.ChargingSessionId = ChargingSessionId; this._ChargeDetailRecords = new List <ChargeDetailRecord>(); }
/// <summary> /// The EVSE is reserved for internal use. /// </summary> /// <param name="SessionId">The unique charging session identification.</param> public static RemoteStopEVSEResult InternalUse(ChargingSession_Id SessionId) { return(new RemoteStopEVSEResult(SessionId, RemoteStopEVSEResultType.InternalUse, "The EVSE is reserved for internal use!")); }
public ChargeDetailRecordCollection(ChargingSession_Id ChargingSessionId, IEnumerable <ChargeDetailRecord> ChargeDetailRecords) : this(ChargingSessionId) { Add(ChargeDetailRecords); }
/// <summary> /// The EVSE is out of service. /// </summary> /// <param name="SessionId">The unique charging session identification.</param> public static RemoteStopEVSEResult OutOfService(ChargingSession_Id SessionId) { return(new RemoteStopEVSEResult(SessionId, RemoteStopEVSEResultType.OutOfService, "The EVSE is out of service!")); }
/// <summary> /// The EVSE is unknown. /// </summary> /// <param name="SessionId">The unique charging session identification.</param> public static RemoteStopEVSEResult UnknownEVSE(ChargingSession_Id SessionId) { return(new RemoteStopEVSEResult(SessionId, RemoteStopEVSEResultType.UnknownEVSE, "The EVSE is unknown!")); }
/// <summary> /// The charging station is unknown. /// </summary> /// <param name="SessionId">The unique charging session identification.</param> public static RemoteStopChargingStationResult UnknownChargingStation(ChargingSession_Id SessionId) { return(new RemoteStopChargingStationResult(SessionId, RemoteStopChargingStationResultType.UnknownChargingStation, "The charging station is unknown!")); }