示例#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;
        }
示例#2
0
        public OCPIResponse(OCPIRequest Request,

                            Int32 StatusCode,
                            String StatusMessage,
                            String AdditionalInformation = null,
                            DateTime?Timestamp           = null,

                            HTTPResponse HTTPResponse    = null,
                            Request_Id?RequestId         = null,
                            Correlation_Id?CorrelationId = null,
                            Party_Id?FromPartyId         = null,
                            CountryCode?FromCountryCode  = null,
                            Party_Id?ToPartyId           = null,
                            CountryCode?ToCountryCode    = null)

        {
            this.Request = Request;

            this.StatusCode            = StatusCode;
            this.StatusMessage         = StatusMessage;
            this.AdditionalInformation = AdditionalInformation;
            this.Timestamp             = Timestamp ?? DateTime.UtcNow;

            this.HTTPResponse    = HTTPResponse;
            this.RequestId       = RequestId;
            this.CorrelationId   = CorrelationId;
            this.FromPartyId     = FromPartyId;
            this.FromCountryCode = FromCountryCode;
            this.ToPartyId       = ToPartyId;
            this.ToCountryCode   = ToCountryCode;
        }
示例#3
0
 /// <summary>
 /// Create a new abstract OCPI command.
 /// </summary>
 /// <param name="ResponseURL">The response URL.</param>
 /// <param name="RequestId">An optional request identification.</param>
 /// <param name="CorrelationId">An optional request correlation identification.</param>
 public AOCPICommand(URL ResponseURL,
                     Request_Id?RequestId         = null,
                     Correlation_Id?CorrelationId = null)
 {
     this.ResponseURL   = ResponseURL;
     this.RequestId     = RequestId ?? Request_Id.Random();
     this.CorrelationId = CorrelationId ?? Correlation_Id.Random();
 }
        /// <summary>
        /// Create new 'cancel reservation' command command.
        /// </summary>
        /// <param name="ReservationId">Reservation identification unique for this reservation.</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 'cancel reservation' command requests.</param>
        ///
        /// <param name="RequestId">An optional request identification.</param>
        /// <param name="CorrelationId">An optional request correlation identification.</param>
        public CancelReservationCommand(Reservation_Id ReservationId,
                                        URL ResponseURL,

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

            : base(ResponseURL,
                   RequestId,
                   CorrelationId)

        {
            this.ReservationId = ReservationId;
        }
示例#5
0
        /// <summary>
        /// Create new 'stop session' command command.
        /// </summary>
        /// <param name="SessionId">Session identification of the charging session that is requested to be stopped.</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 'stop session' command requests.</param>
        ///
        /// <param name="RequestId">An optional request identification.</param>
        /// <param name="CorrelationId">An optional request correlation identification.</param>
        public StopSessionCommand(Session_Id SessionId,
                                  URL ResponseURL,

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

            : base(ResponseURL,
                   RequestId,
                   CorrelationId)

        {
            this.SessionId = SessionId;
        }
        /// <summary>
        /// Create new 'set charging profile' command command.
        /// </summary>
        /// <param name="ChargingProfile">Session identification of the charging session that is requested to be stopped.</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 'set charging profile' command requests.</param>
        ///
        /// <param name="RequestId">An optional request identification.</param>
        /// <param name="CorrelationId">An optional request correlation identification.</param>
        public SetChargingProfileCommand(ChargingProfile ChargingProfile,
                                         URL ResponseURL,

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

            : base(ResponseURL,
                   RequestId,
                   CorrelationId)

        {
            this.ChargingProfile = ChargingProfile;
        }
        /// <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;
        }
示例#8
0
            public Builder(OCPIRequest Request,
                           Int32?StatusCode             = null,
                           String StatusMessage         = null,
                           String AdditionalInformation = null,
                           DateTime?Timestamp           = null,

                           Request_Id?RequestId         = null,
                           Correlation_Id?CorrelationId = null)
            {
                this.Request               = Request;
                this.StatusCode            = StatusCode;
                this.StatusMessage         = StatusMessage;
                this.AdditionalInformation = AdditionalInformation;
                this.Timestamp             = Timestamp;

                this.RequestId     = RequestId;
                this.CorrelationId = CorrelationId;
            }
示例#9
0
        /// <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;
        }