Example #1
0
        /// <summary>
        /// Create new 'reserve now' command command.
        /// </summary>
        /// <param name="Token">Token for how to reserve this charge point (and specific EVSE).</param>
        /// <param name="ExpiryDate">The timestamp when this reservation ends.</param>
        /// <param name="ReservationId">Reservation identification. If the receiver (typically a charge point operator) already has a reservation that matches this reservation identification for that location it will replace the reservation.</param>
        /// <param name="LocationId">Location identification of the location (belonging to the CPO this request is send to) for which to reserve an EVSE.</param>
        /// <param name="ResponseURL">URL that the CommandResult POST should be sent to. This URL might contain an unique identification to be able to distinguish between 'reserve now' command requests.</param>
        ///
        /// <param name="EVSEUId">Optional EVSE identification of the EVSE of this location if a specific EVSE has to be reserved.</param>
        /// <param name="AuthorizationReference">Optional reference to the authorization given by the eMSP, when given, this reference will be provided in the relevant session and/or CDR.</param>
        ///
        /// <param name="RequestId">An optional request identification.</param>
        /// <param name="CorrelationId">An optional request correlation identification.</param>
        public ReserveNowCommand(Token Token,
                                 DateTime ExpiryDate,
                                 Reservation_Id ReservationId,
                                 Location_Id LocationId,
                                 URL ResponseURL,

                                 EVSE_UId?EVSEUId = null,
                                 AuthorizationReference?AuthorizationReference = null,

                                 Request_Id?RequestId         = null,
                                 Correlation_Id?CorrelationId = null)

            : base(ResponseURL,
                   RequestId,
                   CorrelationId)

        {
            this.Token         = Token;
            this.ExpiryDate    = ExpiryDate;
            this.ReservationId = ReservationId;
            this.LocationId    = LocationId;

            this.EVSEUId = EVSEUId;
            this.AuthorizationReference = AuthorizationReference;
        }
Example #2
0
        /// <summary>
        /// Create a new charging session.
        /// </summary>
        public Session(CountryCode CountryCode,
                       Party_Id PartyId,
                       Session_Id Id,
                       DateTime Start,
                       Decimal kWh,
                       CDRToken CDRToken,
                       AuthMethods AuthMethod,
                       Location_Id LocationId,
                       EVSE_UId EVSEUId,
                       Connector_Id ConnectorId,
                       Currency Currency,
                       SessionStatusTypes Status,

                       DateTime?End = null,
                       AuthorizationReference?AuthorizationReference = null,
                       Meter_Id?MeterId        = null,
                       EnergyMeter EnergyMeter = null,
                       IEnumerable <TransparencySoftware> TransparencySoftwares = null,
                       IEnumerable <ChargingPeriod> ChargingPeriods             = null,
                       Price?TotalCosts = null,

                       DateTime?LastUpdated = null)

        {
            this.CountryCode = CountryCode;
            this.PartyId     = PartyId;
            this.Id          = Id;
            this.Start       = Start;
            this.kWh         = kWh;
            this.CDRToken    = CDRToken;
            this.AuthMethod  = AuthMethod;
            this.LocationId  = LocationId;
            this.EVSEUId     = EVSEUId;
            this.ConnectorId = ConnectorId;
            this.Currency    = Currency;
            this.Status      = Status;

            this.End = End;
            this.AuthorizationReference = AuthorizationReference;
            this.MeterId               = MeterId;
            this.EnergyMeter           = EnergyMeter;
            this.TransparencySoftwares = TransparencySoftwares;
            this.ChargingPeriods       = ChargingPeriods;
            this.TotalCosts            = TotalCosts;

            this.LastUpdated = LastUpdated ?? DateTime.Now;

            CalcSHA256Hash();
        }
        /// <summary>
        /// Create new 'unlock connector' command command.
        /// </summary>
        /// <param name="LocationId">Location identification of the location (belonging to the CPO this request is send to) of which it is requested to unlock the connector.</param>
        /// <param name="EVSEUId">EVSE identification of the EVSE of this location of which it is requested to unlock the connector.</param>
        /// <param name="ConnectorId">Connector identification of the connector of this location of which it is requested to unlock.</param>
        /// <param name="ResponseURL">URL that the CommandResult POST should be sent to. This URL might contain an unique identification to be able to distinguish between 'unlock connector' command requests.</param>
        ///
        /// <param name="RequestId">An optional request identification.</param>
        /// <param name="CorrelationId">An optional request correlation identification.</param>
        public UnlockConnectorCommand(Location_Id LocationId,
                                      EVSE_UId EVSEUId,
                                      Connector_Id ConnectorId,
                                      URL ResponseURL,

                                      Request_Id?RequestId         = null,
                                      Correlation_Id?CorrelationId = null)

            : base(ResponseURL,
                   RequestId,
                   CorrelationId)

        {
            this.LocationId  = LocationId;
            this.EVSEUId     = EVSEUId;
            this.ConnectorId = ConnectorId;
        }
        /// <summary>
        /// Create new 'start session' command command.
        /// </summary>
        /// <param name="Token">The token the charge point has to use to start a new session. The Token provided in this request is authorized by the eMSP.</param>
        /// <param name="LocationId">Location identification of the location (belonging to the CPO this request is send to) on which a session is to be started.</param>
        /// <param name="ResponseURL">URL that the CommandResult POST should be sent to. This URL might contain an unique identification to be able to distinguish between 'start session' command requests.</param>
        /// <param name="EVSEUId">Optional EVSE identification of the EVSE of this location if a specific EVSE has to be reserved.</param>
        /// <param name="AuthorizationReference">Optional reference to the authorization given by the eMSP, when given, this reference will be provided in the relevant session and/or CDR.</param>
        ///
        /// <param name="RequestId">An optional request identification.</param>
        /// <param name="CorrelationId">An optional request correlation identification.</param>
        public StartSessionCommand(Token Token,
                                   Location_Id LocationId,
                                   URL ResponseURL,
                                   EVSE_UId?EVSEUId = null,
                                   AuthorizationReference?AuthorizationReference = null,

                                   Request_Id?RequestId         = null,
                                   Correlation_Id?CorrelationId = null)

            : base(ResponseURL,
                   RequestId,
                   CorrelationId)

        {
            this.Token                  = Token;
            this.LocationId             = LocationId;
            this.EVSEUId                = EVSEUId;
            this.AuthorizationReference = AuthorizationReference;
        }
 /// <summary>
 /// Create a new references to location details.
 /// </summary>
 /// <param name="LocationId">Unique identifier for the location..</param>
 /// <param name="EVSEUIds">Optional enumeration of EVSE identifiers within the CPO’s platform.</param>
 public LocationReference(Location_Id LocationId,
                          IEnumerable <EVSE_UId> EVSEUIds = null)
 {
     this.LocationId = LocationId;
     this.EVSEUIds   = EVSEUIds?.Distinct().OrderBy(evseUId => evseUId).ToArray() ?? new EVSE_UId[0];
 }