Example #1
0
 /// <summary>
 /// Create a new cancel reservation result.
 /// </summary>
 /// <param name="Result">The result of the cancel reservation operation.</param>
 /// <param name="Message">An optional message.</param>
 private CancelReservationResult(CancelReservationResultType Result,
                                 String Message = null)
 {
     this._Result        = Result;
     this._ReservationId = null;
     this._Message       = Message;
 }
        /// <summary>
        /// The EVSE is unknown.
        /// </summary>
        /// <param name="ReservationId">A reservation identification.</param>
        /// <param name="Reason">A reason for the charging reservation cancellation.</param>
        /// <param name="Runtime">The optional runtime of the reequest.</param>
        public static CancelReservationResult UnknownEVSE(ChargingReservation_Id ReservationId,
                                                          ChargingReservationCancellationReason Reason,
                                                          TimeSpan?Runtime = null)

        => new CancelReservationResult(CancelReservationResultTypes.UnknownEVSE,
                                       ReservationId,
                                       Reason,
                                       Runtime: Runtime);
Example #3
0
 /// <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));
 }
Example #5
0
        /// <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>
        /// The cancel reservation request was successful.
        /// </summary>
        /// <param name="ReservationId">A reservation identification.</param>
        /// <param name="Reason">A reason for the charging reservation cancellation.</param>
        /// <param name="Reservation">A charging reservation.</param>
        /// <param name="Runtime">The optional runtime of the reequest.</param>
        public static CancelReservationResult Success(ChargingReservation_Id ReservationId,
                                                      ChargingReservationCancellationReason Reason,
                                                      ChargingReservation Reservation = null,
                                                      TimeSpan?Runtime = null)

        => new CancelReservationResult(CancelReservationResultTypes.Success,
                                       ReservationId,
                                       Reason,
                                       Reservation,
                                       Runtime: Runtime);
        /// <summary>
        /// The remote stop request led to an error.
        /// </summary>
        /// <param name="ReservationId">A reservation identification.</param>
        /// <param name="Reason">A reason for the charging reservation cancellation.</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>
        /// <param name="Runtime">The optional runtime of the reequest.</param>
        public static CancelReservationResult Error(ChargingReservation_Id ReservationId,
                                                    ChargingReservationCancellationReason Reason,
                                                    String Message        = null,
                                                    String AdditionalInfo = null,
                                                    TimeSpan?Runtime      = null)

        => new CancelReservationResult(CancelReservationResultTypes.Error,
                                       ReservationId,
                                       Reason,
                                       Message:         Message,
                                       AdditionalInfo:  AdditionalInfo,
                                       Runtime:         Runtime);
Example #8
0
        /// <summary>
        /// Create a charging reservation.
        /// </summary>
        public ChargingReservation(ChargingReservation_Id ReservationId,
                                   DateTime Timestamp,
                                   DateTime StartTime,
                                   TimeSpan Duration,
                                   DateTime EndTime,
                                   TimeSpan ConsumedReservationTime,
                                   ChargingReservationLevel ReservationLevel,

                                   EVSP_Id ProviderId = null,
                                   eMA_Id eMAId       = null,

                                   RoamingNetwork RoamingNetwork        = null,
                                   ChargingPool_Id ChargingPoolId       = null,
                                   ChargingStation_Id ChargingStationId = null,
                                   EVSE_Id EVSEId = null,
                                   ChargingProduct_Id ChargingProductId = null,

                                   IEnumerable <Auth_Token> AuthTokens = null,
                                   IEnumerable <eMA_Id> eMAIds         = null,
                                   IEnumerable <UInt32> PINs           = null)

        {
            #region Initial checks

            if (ReservationId == null)
            {
                throw new ArgumentNullException(nameof(ReservationId), "The given charging reservation identification must not be null!");
            }

            #endregion

            this._ReservationId           = ReservationId;
            this._Timestamp               = Timestamp.ToUniversalTime();
            this._StartTime               = StartTime.ToUniversalTime();
            this._Duration                = Duration;
            this._EndTime                 = StartTime.ToUniversalTime() + Duration;
            this._ConsumedReservationTime = ConsumedReservationTime;
            this._ReservationLevel        = ReservationLevel;

            this._ProviderId = ProviderId;
            this._eMAId      = eMAId;

            this._RoamingNetwork    = RoamingNetwork;
            this._ChargingPoolId    = ChargingPoolId;
            this._ChargingStationId = ChargingStationId;
            this._EVSEId            = EVSEId;
            this._ChargingProductId = ChargingProductId;

            this._AuthTokens = AuthTokens != null ? new HashSet <Auth_Token>(AuthTokens) : new HashSet <Auth_Token>();
            this._eMAIds     = eMAIds != null ? new HashSet <eMA_Id>    (eMAIds)     : new HashSet <eMA_Id>();
            this._PINs       = PINs != null ? new HashSet <UInt32>    (PINs)       : new HashSet <UInt32>();
        }
Example #9
0
        /// <summary>
        /// Create a charging reservation.
        /// </summary>
        public ChargingReservation(ChargingReservation_Id Id,
                                   DateTime Timestamp,
                                   DateTime StartTime,
                                   TimeSpan Duration,
                                   DateTime EndTime,
                                   TimeSpan ConsumedReservationTime,
                                   ChargingReservationLevel ReservationLevel,

                                   eMobilityProvider_Id?ProviderId          = null,
                                   RemoteAuthentication StartAuthentication = null,

                                   RoamingNetwork_Id?RoamingNetworkId = null,
                                   ChargingStationOperator_Id?ChargingStationOperatorId = null,
                                   ChargingPool_Id?ChargingPoolId       = null,
                                   ChargingStation_Id?ChargingStationId = null,
                                   EVSE_Id?EVSEId = null,
                                   ChargingProduct ChargingProduct = null,

                                   IEnumerable <Auth_Token> AuthTokens      = null,
                                   IEnumerable <eMobilityAccount_Id> eMAIds = null,
                                   IEnumerable <UInt32> PINs = null,

                                   IEnumerable <ChargingReservation> SubReservations = null)

        {
            this.Id        = Id;
            this.Timestamp = Timestamp.ToUniversalTime();
            this.StartTime = StartTime.ToUniversalTime();
            this.Duration  = Duration;
            this.EndTime   = StartTime.ToUniversalTime() + Duration;
            this.ConsumedReservationTime = ConsumedReservationTime;
            this.ReservationLevel        = ReservationLevel;

            this.ProviderId          = ProviderId;
            this.StartAuthentication = StartAuthentication;

            this.RoamingNetworkId          = RoamingNetworkId;
            this.ChargingStationOperatorId = ChargingStationOperatorId;
            this.ChargingPoolId            = ChargingPoolId;
            this.ChargingStationId         = ChargingStationId;
            this.EVSEId          = EVSEId;
            this.ChargingProduct = ChargingProduct;

            this._AuthTokens = AuthTokens != null ? new HashSet <Auth_Token>         (AuthTokens)      : new HashSet <Auth_Token>();
            this._eMAIds     = eMAIds != null ? new HashSet <eMobilityAccount_Id>(eMAIds)          : new HashSet <eMobilityAccount_Id>();
            this._PINs       = PINs != null ? new HashSet <UInt32>             (PINs)            : new HashSet <UInt32>();

            this._SubReservations = SubReservations != null ? new HashSet <ChargingReservation>(SubReservations) : new HashSet <ChargingReservation>();
        }
 /// <summary>
 /// Create a new cancel reservation result.
 /// </summary>
 /// <param name="Result">The result of a cancel reservation operation.</param>
 /// <param name="ReservationId">The charging reservation identification.</param>
 /// <param name="Reservation">The optional charging reservation.</param>
 /// <param name="Reason">A reason for the charging reservation cancellation.</param>
 /// <param name="Message">An optional message.</param>
 /// <param name="AdditionalInfo">An optional additional information on this error, e.g. the HTTP error response.</param>
 /// <param name="Runtime">The optional runtime of this request.</param>
 private CancelReservationResult(CancelReservationResultTypes Result,
                                 ChargingReservation_Id ReservationId,
                                 ChargingReservationCancellationReason Reason,
                                 ChargingReservation Reservation = null,
                                 String Message        = null,
                                 Object AdditionalInfo = null,
                                 TimeSpan?Runtime      = null)
 {
     this.Result         = Result;
     this.ReservationId  = ReservationId;
     this.Reason         = Reason;
     this.Reservation    = Reservation;
     this.Message        = Message;
     this.AdditionalInfo = AdditionalInfo;
     this.Runtime        = Runtime;
 }
Example #11
0
        /// <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;
        }
Example #12
0
        /// <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;
        }
 public ChargingReservationCollection(ChargingReservation_Id Id,
                                      IEnumerable <ChargingReservation> Reservations)
     : this(Id)
 {
     Add(Reservations);
 }
 public ChargingReservationCollection(ChargingReservation_Id Id,
                                      ChargingReservation Reservation)
     : this(Id)
 {
     Add(Reservation);
 }
 public ChargingReservationCollection(ChargingReservation_Id Id)
 {
     this.Id            = Id;
     this._Reservations = new List <ChargingReservation>();
 }
Example #16
0
 /// <summary>
 /// Create a new cancel reservation result.
 /// </summary>
 /// <param name="Result">The result of a cancel reservation operation.</param>
 /// <param name="ReservationId">The charging reservation identification.</param>
 private CancelReservationResult(CancelReservationResultType Result,
                                 ChargingReservation_Id ReservationId)
 {
     this._Result        = Result;
     this._ReservationId = ReservationId;
 }
Example #17
0
 public static CancelReservationResult UnknownReservationId(ChargingReservation_Id ReservationId)
 {
     return(new CancelReservationResult(CancelReservationResultType.UnknownReservationId,
                                        ReservationId));
 }
Example #18
0
 public static CancelReservationResult Success(ChargingReservation_Id ReservationId)
 {
     return(new CancelReservationResult(CancelReservationResultType.Success,
                                        ReservationId));
 }