/// <summary>
 /// The remote stop was successful.
 /// </summary>
 /// <param name="ChargeDetailRecord">The charge detail record for a successfully stopped charging process.</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(ChargeDetailRecord ChargeDetailRecord,
                                            ChargingReservation_Id ReservationId    = null,
                                            ReservationHandling ReservationHandling = null)
 {
     return(new RemoteStopEVSEResult(ChargeDetailRecord,
                                     RemoteStopEVSEResultType.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 RemoteStopChargingStationResult Success(ChargingSession_Id SessionId,
                                                       ChargingReservation_Id ReservationId    = null,
                                                       ReservationHandling ReservationHandling = null)
 {
     return(new RemoteStopChargingStationResult(SessionId,
                                                RemoteStopChargingStationResultType.Success,
                                                ReservationId,
                                                ReservationHandling));
 }
        /// <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;
        }