internal void SendReservationCanceled(DateTime Timestamp,
                                       Object Sender,
                                       ChargingReservation Reservation,
                                       ChargingReservationCancellationReason Reason)
 {
     OnReservationCanceled?.Invoke(Timestamp, Sender, Reservation, Reason);
 }
        /// <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);
        /// <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);
        CancelReservation(ChargingReservation_Id ReservationId,
                          ChargingReservationCancellationReason Reason,

                          DateTime?Timestamp = null,
                          CancellationToken?CancellationToken = null,
                          EventTracking_Id EventTrackingId    = null,
                          TimeSpan?RequestTimeout             = null)

        {
            return(Task.FromResult(CancelReservationResult.OutOfService(ReservationId,
                                                                        ChargingReservationCancellationReason.Aborted)));
        }
        /// <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);
 /// <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 #7
0
        CancelReservation(ChargingReservation_Id ReservationId,
                          ChargingReservationCancellationReason Reason,

                          DateTime?Timestamp = null,
                          CancellationToken?CancellationToken = null,
                          EventTracking_Id EventTrackingId    = null,
                          TimeSpan?RequestTimeout             = null)

        {
            if (_ANetworkChargingStation == null)
            {
                return(CancelReservationResult.OutOfService(ReservationId,
                                                            Reason));
            }

            return(await _ANetworkChargingStation.
                   CancelReservation(ReservationId,
                                     Reason,

                                     Timestamp,
                                     CancellationToken,
                                     EventTrackingId,
                                     RequestTimeout));
        }
Example #8
0
 public Task <CancelReservationResult> CancelReservation(ChargingReservation_Id ReservationId, ChargingReservationCancellationReason Reason, DateTime?Timestamp = null, CancellationToken?CancellationToken = null, EventTracking_Id EventTrackingId = null, TimeSpan?RequestTimeout = null)
 {
     throw new NotImplementedException();
 }