/// <summary>
        /// Create an OICP PushEVSEStatus XML/SOAP request.
        /// </summary>
        /// <param name="OperatorEVSEStatus">An operator EVSE status.</param>
        /// <param name="Action">The server-side data management operation.</param>
        ///
        /// <param name="Timestamp">The optional timestamp of the request.</param>
        /// <param name="CancellationToken">An optional token to cancel this request.</param>
        /// <param name="EventTrackingId">An optional event tracking identification for correlating this request with other events.</param>
        /// <param name="RequestTimeout">An optional timeout for this request.</param>
        public PushEVSEStatusRequest(OperatorEVSEStatus OperatorEVSEStatus,
                                     ActionTypes Action = ActionTypes.update,

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

            : base(Timestamp,
                   CancellationToken,
                   EventTrackingId,
                   RequestTimeout)

        {
            this.OperatorEVSEStatus = OperatorEVSEStatus ?? throw new ArgumentNullException(nameof(OperatorEVSEStatus), "The given OperatorEVSEStatus must not be null!");
            this.Action             = Action;
        }
        PushEVSEStatus(this ICPOClient ICPOClient,
                       OperatorEVSEStatus OperatorEVSEStatus,
                       ActionTypes Action = ActionTypes.update,

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


        => ICPOClient.PushEVSEStatus(new PushEVSEStatusRequest(OperatorEVSEStatus,
                                                               Action,

                                                               Timestamp,
                                                               CancellationToken,
                                                               EventTrackingId,
                                                               RequestTimeout ?? ICPOClient.RequestTimeout));
Ejemplo n.º 3
0
        /// <summary>
        /// Create a new information object for resetting user passwords.
        /// </summary>
        /// <param name="Timestamp">The creation timestamp of the password-reset-information.</param>
        /// <param name="Users">An enumeration of valid users.</param>
        /// <param name="SecurityToken1">A security token to authorize the password reset.</param>
        /// <param name="SecurityToken2">An optional second security token to authorize the password reset.</param>
        /// <param name="EventTrackingId">An optional unique event tracking identification for correlating this request with other events.</param>
        public PasswordReset(DateTime Timestamp,
                             IEnumerable <User> Users,
                             SecurityToken_Id SecurityToken1,
                             SecurityToken_Id?SecurityToken2  = null,
                             EventTracking_Id EventTrackingId = null)
        {
            if (Users is null || !Users.Any())
            {
                throw new ArgumentNullException(nameof(Users), "The given enumeration of users must not be null or empty!");
            }

            this.Timestamp       = Timestamp;
            this.Users           = new HashSet <User>(Users);
            this.SecurityToken1  = SecurityToken1;
            this.SecurityToken2  = SecurityToken2;
            this.EventTrackingId = EventTrackingId ?? EventTracking_Id.New;
        }
Ejemplo n.º 4
0
        /// <summary>
        /// Try to parse the given XML representation of an OICP mobile authorize start request.
        /// </summary>
        /// <param name="MobileRemoteStartXML">The XML to parse.</param>
        /// <param name="MobileRemoteStart">The parsed mobile authorize start request.</param>
        /// <param name="CustomMobileRemoteStartRequestParser">A delegate to parse custom MobileRemoteStart requests.</param>
        /// <param name="OnException">An optional delegate called whenever an exception occured.</param>
        ///
        /// <param name="Timestamp">The optional timestamp of the request.</param>
        /// <param name="CancellationToken">An optional token to cancel this request.</param>
        /// <param name="EventTrackingId">An optional event tracking identification for correlating this request with other events.</param>
        /// <param name="RequestTimeout">An optional timeout for this request.</param>
        public static Boolean TryParse(XElement MobileRemoteStartXML,
                                       out MobileRemoteStartRequest MobileRemoteStart,
                                       CustomXMLParserDelegate <MobileRemoteStartRequest> CustomMobileRemoteStartRequestParser = null,
                                       OnExceptionDelegate OnException = null,

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

        {
            try
            {
                if (MobileRemoteStartXML.Name != OICPNS.MobileAuthorization + "eRoamingMobileRemoteStart")
                {
                    MobileRemoteStart = null;
                    return(false);
                }

                MobileRemoteStart = new MobileRemoteStartRequest(

                    MobileRemoteStartXML.MapValueOrFail(OICPNS.MobileAuthorization + "SessionID",
                                                        Session_Id.Parse),

                    Timestamp,
                    CancellationToken,
                    EventTrackingId,
                    RequestTimeout);


                if (CustomMobileRemoteStartRequestParser != null)
                {
                    MobileRemoteStart = CustomMobileRemoteStartRequestParser(MobileRemoteStartXML,
                                                                             MobileRemoteStart);
                }

                return(true);
            }
            catch (Exception e)
            {
                OnException?.Invoke(DateTime.UtcNow, MobileRemoteStartXML, e);

                MobileRemoteStart = null;
                return(false);
            }
        }
Ejemplo n.º 5
0
        PullEVSEStatusById(this IEMPClient IEMPClient,
                           IEnumerable <EVSE_Id> EVSEIds,
                           Provider_Id?ProviderId = null,

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


        => IEMPClient.PullEVSEStatusById(new PullEVSEStatusByIdRequest(ProviderId ?? IEMPClient.DefaultProviderId.Value,
                                                                       EVSEIds,

                                                                       Timestamp,
                                                                       CancellationToken,
                                                                       EventTrackingId,
                                                                       RequestTimeout ?? IEMPClient.RequestTimeout));
Ejemplo n.º 6
0
        PushAuthenticationData(this IEMPClient IEMPClient,
                               ProviderAuthenticationData ProviderAuthenticationData,
                               ActionTypes Action = ActionTypes.fullLoad,

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


        => IEMPClient.PushAuthenticationData(new PushAuthenticationDataRequest(ProviderAuthenticationData,
                                                                               Action,

                                                                               Timestamp,
                                                                               CancellationToken,
                                                                               EventTrackingId,
                                                                               RequestTimeout ?? IEMPClient.RequestTimeout));
Ejemplo n.º 7
0
        /// <summary>
        /// Try to parse the given XML representation of an OICP get charge detail records request.
        /// </summary>
        /// <param name="GetChargeDetailRecordsRequestXML">The XML to parse.</param>
        /// <param name="GetChargeDetailRecordsRequest">The parsed get charge detail records request.</param>
        /// <param name="CustomGetChargeDetailRecordsRequestParser">A delegate to parse custom GetChargeDetailRecords requests.</param>
        /// <param name="OnException">An optional delegate called whenever an exception occured.</param>
        ///
        /// <param name="Timestamp">The optional timestamp of the request.</param>
        /// <param name="CancellationToken">An optional token to cancel this request.</param>
        /// <param name="EventTrackingId">An optional event tracking identification for correlating this request with other events.</param>
        /// <param name="RequestTimeout">An optional timeout for this request.</param>
        public static Boolean TryParse(XElement GetChargeDetailRecordsRequestXML,
                                       out GetChargeDetailRecordsRequest GetChargeDetailRecordsRequest,
                                       CustomXMLParserDelegate <GetChargeDetailRecordsRequest> CustomGetChargeDetailRecordsRequestParser = null,
                                       OnExceptionDelegate OnException = null,

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

        {
            try
            {
                GetChargeDetailRecordsRequest = new GetChargeDetailRecordsRequest(

                    GetChargeDetailRecordsRequestXML.MapValueOrFail(OICPNS.Authorization + "ProviderID",
                                                                    Provider_Id.Parse),

                    GetChargeDetailRecordsRequestXML.MapValueOrFail(OICPNS.Authorization + "From",
                                                                    DateTime.Parse),

                    GetChargeDetailRecordsRequestXML.MapValueOrFail(OICPNS.Authorization + "To",
                                                                    DateTime.Parse),

                    Timestamp,
                    CancellationToken,
                    EventTrackingId,
                    RequestTimeout);


                if (CustomGetChargeDetailRecordsRequestParser != null)
                {
                    GetChargeDetailRecordsRequest = CustomGetChargeDetailRecordsRequestParser(GetChargeDetailRecordsRequestXML,
                                                                                              GetChargeDetailRecordsRequest);
                }

                return(true);
            }
            catch (Exception e)
            {
                OnException?.Invoke(DateTime.UtcNow, GetChargeDetailRecordsRequestXML, e);

                GetChargeDetailRecordsRequest = null;
                return(false);
            }
        }
        PushEVSEData(this ICPOClient ICPOClient,
                     OperatorEVSEData OperatorEVSEData,
                     ActionTypes Action = ActionTypes.fullLoad,

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


        => ICPOClient.PushEVSEData(new PushEVSEDataRequest(OperatorEVSEData,
                                                           Action,

                                                           Timestamp,
                                                           CancellationToken,
                                                           EventTrackingId,
                                                           RequestTimeout ?? ICPOClient.RequestTimeout));
Ejemplo n.º 9
0
        /// <summary>
        /// Update an EVSE admin status.
        /// </summary>
        /// <param name="Timestamp">The timestamp when this change was detected.</param>
        /// <param name="EventTrackingId">An event tracking identification for correlating this request with other events.</param>
        /// <param name="EVSE">The updated EVSE.</param>
        /// <param name="OldStatus">The old EVSE status.</param>
        /// <param name="NewStatus">The new EVSE status.</param>
        internal async Task UpdateEVSEAdminStatus(DateTime Timestamp,
                                                  EventTracking_Id EventTrackingId,
                                                  EVSE EVSE,
                                                  Timestamped <EVSEAdminStatusTypes> OldStatus,
                                                  Timestamped <EVSEAdminStatusTypes> NewStatus)
        {
            var OnEVSEAdminStatusChangedLocal = OnEVSEAdminStatusChanged;

            if (OnEVSEAdminStatusChangedLocal != null)
            {
                await OnEVSEAdminStatusChangedLocal(Timestamp,
                                                    EventTrackingId,
                                                    EVSE,
                                                    OldStatus,
                                                    NewStatus);
            }
        }
Ejemplo n.º 10
0
        /// <summary>
        /// Create a SetServiceAuthorisationRequest XML/SOAP request.
        /// </summary>
        /// <param name="PartnerId">The partner identification.</param>
        /// <param name="OperatorId">The operator identification.</param>
        /// <param name="EVSEId">The EVSE identification.</param>
        /// <param name="UserId">The user identification.</param>
        /// <param name="RequestedServiceId">The service identification for which an authorisation is requested.</param>
        /// <param name="PartnerServiceSessionId">The partner service session identification.</param>
        /// <param name="AuthorisationValue">Whether to start or stop the charging process.</param>
        /// <param name="IntermediateCDRRequested">Whether the eMSP wishes to receive intermediate charging session records.</param>
        ///
        /// <param name="TransactionId">An optional transaction identification.</param>
        /// <param name="UserContractIdAlias">Anonymized alias of the contract id between the end-user and the eMSP.</param>
        /// <param name="MeterLimits">Meter limits for this authorisation: The eMSP can authorise the charge but for less than x Wh or y minutes, or z euros.</param>
        /// <param name="Parameter">eMSP parameter string (reserved for future use).</param>
        /// <param name="BookingId"></param>
        /// <param name="SalePartnerBookingId"></param>
        ///
        /// <param name="HTTPRequest">The correlated HTTP request of this eMIP request.</param>
        /// <param name="Timestamp">The optional timestamp of the request.</param>
        /// <param name="CancellationToken">An optional token to cancel this request.</param>
        /// <param name="EventTrackingId">An optional event tracking identification for correlating this request with other events.</param>
        /// <param name="RequestTimeout">An optional timeout for this request.</param>
        public SetServiceAuthorisationRequest(Partner_Id PartnerId,
                                              Operator_Id OperatorId,
                                              EVSE_Id EVSEId,
                                              User_Id UserId,
                                              Service_Id RequestedServiceId,
                                              RemoteStartStopValues AuthorisationValue,
                                              Boolean IntermediateCDRRequested,

                                              Transaction_Id?TransactionId = null,
                                              PartnerServiceSession_Id?PartnerServiceSessionId = null,
                                              Contract_Id?UserContractIdAlias       = null,
                                              IEnumerable <MeterReport> MeterLimits = null,
                                              String Parameter                = null,
                                              Booking_Id?BookingId            = null,
                                              Booking_Id?SalePartnerBookingId = null,

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

            : base(HTTPRequest,
                   PartnerId,
                   TransactionId,
                   Timestamp,
                   CancellationToken,
                   EventTrackingId,
                   RequestTimeout)

        {
            this.OperatorId               = OperatorId;
            this.EVSEId                   = EVSEId;
            this.UserId                   = UserId;
            this.RequestedServiceId       = RequestedServiceId;
            this.AuthorisationValue       = AuthorisationValue;
            this.IntermediateCDRRequested = IntermediateCDRRequested;

            this.PartnerServiceSessionId = PartnerServiceSessionId;
            this.UserContractIdAlias     = UserContractIdAlias;
            this.MeterLimits             = MeterLimits;
            this.Parameter            = Parameter;
            this.BookingId            = BookingId;
            this.SalePartnerBookingId = SalePartnerBookingId;
        }
        /// <summary>
        /// Try to parse the given XML representation of an OICP push EVSE data request.
        /// </summary>
        /// <param name="PushEVSEDataXML">The XML to parse.</param>
        /// <param name="PushEVSEData">The parsed push EVSE data request.</param>
        /// <param name="CustomOperatorEVSEDataParser">A delegate to parse custom OperatorEVSEData XML elements.</param>
        /// <param name="CustomEVSEDataRecordParser">A delegate to parse custom EVSEDataRecord XML elements.</param>
        /// <param name="OnException">An optional delegate called whenever an exception occured.</param>
        ///
        /// <param name="Timestamp">The optional timestamp of the request.</param>
        /// <param name="CancellationToken">An optional token to cancel this request.</param>
        /// <param name="EventTrackingId">An optional event tracking identification for correlating this request with other events.</param>
        /// <param name="RequestTimeout">An optional timeout for this request.</param>
        public static Boolean TryParse(XElement PushEVSEDataXML,
                                       out PushEVSEDataRequest PushEVSEData,
                                       CustomXMLParserDelegate <OperatorEVSEData> CustomOperatorEVSEDataParser = null,
                                       CustomXMLParserDelegate <EVSEDataRecord> CustomEVSEDataRecordParser     = null,
                                       OnExceptionDelegate OnException = null,

                                       DateTime?Timestamp = null,
                                       CancellationToken?CancellationToken = null,
                                       EventTracking_Id EventTrackingId    = null,
                                       TimeSpan?RequestTimeout             = null)
        {
            try
            {
                if (PushEVSEDataXML.Name != OICPNS.EVSEData + "eRoamingPushEvseData")
                {
                    PushEVSEData = null;
                    return(false);
                }

                PushEVSEData = new PushEVSEDataRequest(

                    OperatorEVSEData.Parse(PushEVSEDataXML.ElementOrFail(OICPNS.EVSEData + "OperatorEvseData"),
                                           CustomOperatorEVSEDataParser,
                                           CustomEVSEDataRecordParser),

                    PushEVSEDataXML.MapValueOrFail(OICPNS.EVSEData + "ActionType",
                                                   ActionTypesExtentions.Parse),

                    Timestamp,
                    CancellationToken,
                    EventTrackingId,
                    RequestTimeout

                    );

                return(true);
            }
            catch (Exception e)
            {
                OnException?.Invoke(DateTime.UtcNow, PushEVSEDataXML, e);

                PushEVSEData = null;
                return(false);
            }
        }
Ejemplo n.º 12
0
        SetServiceAuthorisation(this IEMPClient EMPClient,
                                Partner_Id PartnerId,
                                Operator_Id OperatorId,
                                EVSE_Id EVSEId,
                                User_Id UserId,
                                Service_Id RequestedServiceId,
                                RemoteStartStopValues AuthorisationValue,
                                Boolean IntermediateCDRRequested,

                                Transaction_Id?TransactionId = null,
                                PartnerServiceSession_Id?PartnerServiceSessionId = null,
                                Contract_Id?UserContractIdAlias       = null,
                                IEnumerable <MeterReport> MeterLimits = null,
                                String Parameter                = null,
                                Booking_Id?BookingId            = null,
                                Booking_Id?SalePartnerBookingId = null,

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


        => EMPClient.SetServiceAuthorisation(new SetServiceAuthorisationRequest(PartnerId,
                                                                                OperatorId,
                                                                                EVSEId,
                                                                                UserId,
                                                                                RequestedServiceId,
                                                                                AuthorisationValue,
                                                                                IntermediateCDRRequested,

                                                                                TransactionId,
                                                                                PartnerServiceSessionId,
                                                                                UserContractIdAlias,
                                                                                MeterLimits,
                                                                                Parameter,
                                                                                BookingId,
                                                                                SalePartnerBookingId,

                                                                                HTTPRequest,
                                                                                Timestamp,
                                                                                CancellationToken,
                                                                                EventTrackingId,
                                                                                RequestTimeout ?? EMPClient.RequestTimeout));
        /// <summary>
        /// Create a new ChangeAvailability request.
        /// </summary>
        /// <param name="ChargeBoxId">The charge box identification.</param>
        /// <param name="ConnectorId">The identification of the connector for which its availability should be changed. Id '0' (zero) is used if the availability of the entire charge point and all its connectors should be changed.</param>
        /// <param name="Availability">The new availability of the charge point or charge point connector.</param>
        ///
        /// <param name="RequestId">An optional request identification.</param>
        /// <param name="RequestTimestamp">An optional request timestamp.</param>
        public ChangeAvailabilityRequest(ChargeBox_Id ChargeBoxId,
                                         Connector_Id ConnectorId,
                                         Availabilities Availability,

                                         Request_Id?RequestId             = null,
                                         DateTime?RequestTimestamp        = null,
                                         EventTracking_Id EventTrackingId = null)

            : base(ChargeBoxId,
                   "ChangeAvailability",
                   RequestId,
                   EventTrackingId,
                   RequestTimestamp)

        {
            this.ConnectorId  = ConnectorId;
            this.Availability = Availability;
        }
Ejemplo n.º 14
0
        public AddOrUpdateChargeBoxResult(ChargeBox ChargeBox,
                                          EventTracking_Id EventTrackingId,
                                          Boolean IsSuccess,
                                          String Argument               = null,
                                          I18NString ErrorDescription   = null,
                                          ChargeBox ParentChargeBox     = null,
                                          AddedOrUpdated?AddedOrUpdated = null)

            : base(ChargeBox,
                   EventTrackingId,
                   IsSuccess,
                   Argument,
                   ErrorDescription)

        {
            this.ParentChargeBox = ParentChargeBox;
            this.AddedOrUpdated  = AddedOrUpdated;
        }
Ejemplo n.º 15
0
        /// <summary>
        /// Create a new PushEVSEData request.
        /// </summary>
        /// <param name="OperatorEVSEData">The operator EVSE data record.</param>
        /// <param name="Action">The server-side data management operation.</param>
        ///
        /// <param name="Timestamp">The optional timestamp of the request.</param>
        /// <param name="CancellationToken">An optional token to cancel this request.</param>
        /// <param name="EventTrackingId">An optional event tracking identification for correlating this request with other events.</param>
        /// <param name="RequestTimeout">The timeout for this request.</param>
        public PushEVSEDataRequest(OperatorEVSEData OperatorEVSEData,
                                   ActionTypes Action = ActionTypes.FullLoad,

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

            : base(null,
                   Timestamp,
                   CancellationToken,
                   EventTrackingId,
                   RequestTimeout)

        {
            this.OperatorEVSEData = OperatorEVSEData ?? throw new ArgumentNullException(nameof(OperatorEVSEData), "The given operator EVSE data must not be null!");
            this.Action           = Action;
        }
Ejemplo n.º 16
0
        public AddUserToUserGroupResult(User User,
                                        User2UserGroupEdgeLabel EdgeLabel,
                                        UserGroup UserGroup,
                                        EventTracking_Id EventTrackingId,
                                        Boolean IsSuccess,
                                        String Argument             = null,
                                        I18NString ErrorDescription = null)

            : base(User,
                   UserGroup,
                   EventTrackingId,
                   IsSuccess,
                   Argument,
                   ErrorDescription)

        {
            this.EdgeLabel = EdgeLabel;
        }
Ejemplo n.º 17
0
        public UnlinkOrganizationsResult(Organization OrganizationOut,
                                         Organization2OrganizationEdgeLabel EdgeLabel,
                                         Organization OrganizationIn,
                                         EventTracking_Id EventTrackingId,
                                         Boolean IsSuccess,
                                         String Argument             = null,
                                         I18NString ErrorDescription = null)

            : base(OrganizationOut,
                   OrganizationIn,
                   EventTrackingId,
                   IsSuccess,
                   Argument,
                   ErrorDescription)

        {
            this.EdgeLabel = EdgeLabel;
        }
        public AddOrUpdateUserGroupResult(UserGroup UserGroup,
                                          EventTracking_Id EventTrackingId,
                                          Boolean IsSuccess,
                                          String Argument               = null,
                                          I18NString ErrorDescription   = null,
                                          Organization Organization     = null,
                                          AddedOrUpdated?AddedOrUpdated = null)

            : base(UserGroup,
                   EventTrackingId,
                   IsSuccess,
                   Argument,
                   ErrorDescription)

        {
            this.Organization   = Organization;
            this.AddedOrUpdated = AddedOrUpdated;
        }
        public AddUserToOrganizationResult(User User,
                                           User2OrganizationEdgeLabel EdgeLabel,
                                           Organization Organization,
                                           EventTracking_Id EventTrackingId,
                                           Boolean IsSuccess,
                                           String Argument             = null,
                                           I18NString ErrorDescription = null)

            : base(User,
                   Organization,
                   EventTrackingId,
                   IsSuccess,
                   Argument,
                   ErrorDescription)

        {
            this.EdgeLabel = EdgeLabel;
        }
Ejemplo n.º 20
0
        public static Task AddTelegramNotification(this UsersAPI UsersAPI,
                                                   User User,
                                                   IEnumerable <NotificationMessageType> NotificationMessageTypes,
                                                   String Username,
                                                   Int32?ChatId        = null,
                                                   String SharedSecret = null,
                                                   String TextTemplate = null,
                                                   EventTracking_Id EventTrackingId = null,
                                                   User_Id?CurrentUserId            = null)

        => UsersAPI.AddNotification(User,
                                    new TelegramNotification(Username,
                                                             ChatId,
                                                             SharedSecret,
                                                             TextTemplate),
                                    NotificationMessageTypes,
                                    EventTrackingId,
                                    CurrentUserId);
        public LinkChargeBoxsResult(ChargeBox ChargeBoxOut,
                                    ChargeBox2ChargeBoxEdgeLabel EdgeLabel,
                                    ChargeBox ChargeBoxIn,
                                    EventTracking_Id EventTrackingId,
                                    Boolean IsSuccess,
                                    String Argument             = null,
                                    I18NString ErrorDescription = null)

            : base(ChargeBoxOut,
                   ChargeBoxIn,
                   EventTrackingId,
                   IsSuccess,
                   Argument,
                   ErrorDescription)

        {
            this.EdgeLabel = EdgeLabel;
        }
        /// <summary>
        /// Create a new TriggerMessage request.
        /// </summary>
        /// <param name="ChargeBoxId">The charge box identification.</param>
        /// <param name="RequestedMessage">The message to trigger.</param>
        /// <param name="ConnectorId">Optional connector identification whenever the message applies to a specific connector.</param>
        ///
        /// <param name="RequestId">An optional request identification.</param>
        /// <param name="RequestTimestamp">An optional request timestamp.</param>
        public TriggerMessageRequest(ChargeBox_Id ChargeBoxId,
                                     MessageTriggers RequestedMessage,
                                     Connector_Id?ConnectorId = null,

                                     Request_Id?RequestId             = null,
                                     DateTime?RequestTimestamp        = null,
                                     EventTracking_Id EventTrackingId = null)

            : base(ChargeBoxId,
                   "TriggerMessage",
                   RequestId,
                   EventTrackingId,
                   RequestTimestamp)

        {
            this.RequestedMessage = RequestedMessage;
            this.ConnectorId      = ConnectorId;
        }
Ejemplo n.º 23
0
        /// <summary>
        /// Create a new SetChargingProfile request.
        /// </summary>
        /// <param name="ChargeBoxId">The charge box identification.</param>
        /// <param name="ConnectorId">The connector to which the charging profile applies. If connectorId = 0, the message contains an overall limit for the charge point.</param>
        /// <param name="ChargingProfile">The charging profile to be set.</param>
        ///
        /// <param name="RequestId">An optional request identification.</param>
        /// <param name="RequestTimestamp">An optional request timestamp.</param>
        public SetChargingProfileRequest(ChargeBox_Id ChargeBoxId,
                                         Connector_Id ConnectorId,
                                         ChargingProfile ChargingProfile,

                                         Request_Id?RequestId             = null,
                                         DateTime?RequestTimestamp        = null,
                                         EventTracking_Id EventTrackingId = null)

            : base(ChargeBoxId,
                   "SetChargingProfile",
                   RequestId,
                   EventTrackingId,
                   RequestTimestamp)

        {
            this.ConnectorId     = ConnectorId;
            this.ChargingProfile = ChargingProfile ?? throw new ArgumentNullException(nameof(ChargingProfile), "The given charging profile must not be null!");
        }
        public AddOrganizationIfNotExistsResult(Organization Organization,
                                                EventTracking_Id EventTrackingId,
                                                Boolean IsSuccess,
                                                String Argument                 = null,
                                                I18NString ErrorDescription     = null,
                                                Organization ParentOrganization = null,
                                                AddedOrIgnored?AddedOrIgnored   = null)

            : base(Organization,
                   EventTrackingId,
                   IsSuccess,
                   Argument,
                   ErrorDescription)

        {
            this.ParentOrganization = ParentOrganization;
            this.AddedOrIgnored     = AddedOrIgnored;
        }
Ejemplo n.º 25
0
        /// <summary>
        /// Create a GetConfigurationn request.
        /// </summary>
        /// <param name="ChargeBoxId">The charge box identification.</param>
        /// <param name="Keys">An optional enumeration of keys for which the configuration is requested. Return all keys if empty.</param>
        ///
        /// <param name="RequestId">An optional request identification.</param>
        /// <param name="RequestTimestamp">An optional request timestamp.</param>
        public GetConfigurationRequest(ChargeBox_Id ChargeBoxId,
                                       IEnumerable <String> Keys = null,

                                       Request_Id?RequestId             = null,
                                       DateTime?RequestTimestamp        = null,
                                       EventTracking_Id EventTrackingId = null)

            : base(ChargeBoxId,
                   "GetConfiguration",
                   RequestId,
                   EventTrackingId,
                   RequestTimestamp)

        {
            this.Keys = (Keys ?? new String[0]).
                        SafeSelect(key => key?.Trim()?.SubstringMax(50)).
                        SafeWhere(key => key.IsNotNullOrEmpty());
        }
Ejemplo n.º 26
0
        /// <summary>
        /// Update the static data.
        /// </summary>
        /// <param name="Timestamp">The timestamp when this change was detected.</param>
        /// <param name="EventTrackingId">An optional event tracking identification for correlating this request with other events.</param>
        /// <param name="Sender">The changed e-mobility station.</param>
        /// <param name="PropertyName">The name of the changed property.</param>
        /// <param name="OldValue">The old value of the changed property.</param>
        /// <param name="NewValue">The new value of the changed property.</param>
        internal async Task UpdateData(DateTime Timestamp,
                                       EventTracking_Id EventTrackingId,
                                       Object Sender,
                                       String PropertyName,
                                       Object OldValue,
                                       Object NewValue)
        {
            var OnDataChangedLocal = OnDataChanged;

            if (OnDataChangedLocal != null)
            {
                await OnDataChangedLocal(Timestamp,
                                         EventTrackingId,
                                         Sender as eMobilityStation,
                                         PropertyName,
                                         OldValue,
                                         NewValue);
            }
        }
Ejemplo n.º 27
0
        /// <summary>
        /// Update the data of an eVehicle.
        /// </summary>
        /// <param name="Timestamp">The timestamp when this change was detected.</param>
        /// <param name="EventTrackingId">An optional event tracking identification for correlating this request with other events.</param>
        /// <param name="eVehicle">The changed eVehicle.</param>
        /// <param name="PropertyName">The name of the changed property.</param>
        /// <param name="OldValue">The old value of the changed property.</param>
        /// <param name="NewValue">The new value of the changed property.</param>
        internal async Task UpdateEVehicleData(DateTime Timestamp,
                                               EventTracking_Id EventTrackingId,
                                               eVehicle eVehicle,
                                               String PropertyName,
                                               Object OldValue,
                                               Object NewValue)
        {
            var OnEVehicleDataChangedLocal = OnEVehicleDataChanged;

            if (OnEVehicleDataChangedLocal != null)
            {
                await OnEVehicleDataChangedLocal(Timestamp,
                                                 EventTrackingId,
                                                 eVehicle,
                                                 PropertyName,
                                                 OldValue,
                                                 NewValue);
            }
        }
Ejemplo n.º 28
0
        /// <summary>
        /// Create a new generic eMIP request message.
        /// </summary>
        /// <param name="PartnerId">The partner identification.</param>
        /// <param name="TransactionId">An optional eMIP transaction identification.</param>
        ///
        /// <param name="HTTPRequest">The correlated HTTP request of this eMIP request.</param>
        /// <param name="Timestamp">The optional timestamp of the request.</param>
        /// <param name="CancellationToken">An optional token to cancel this request.</param>
        /// <param name="EventTrackingId">An optional event tracking identification for correlating this request with other events.</param>
        /// <param name="RequestTimeout">An optional timeout for this request.</param>
        public ARequest(HTTPRequest HTTPRequest,
                        Partner_Id PartnerId,
                        Transaction_Id?TransactionId = null,

                        DateTime?Timestamp = null,
                        CancellationToken?CancellationToken = null,
                        EventTracking_Id EventTrackingId    = null,
                        TimeSpan?RequestTimeout             = null)
        {
            this.HTTPRequest   = HTTPRequest;
            this.PartnerId     = PartnerId;
            this.TransactionId = TransactionId;

            this.Timestamp = Timestamp ?? DateTime.UtcNow;
            this.CancellationTokenSource = CancellationToken == null  ? new CancellationTokenSource() : null;
            this.CancellationToken       = CancellationToken ?? CancellationTokenSource.Token;
            this.EventTrackingId         = EventTrackingId ?? EventTracking_Id.New;
            this.RequestTimeout          = RequestTimeout ?? DefaultRequestTimeout;
        }
Ejemplo n.º 29
0
        /// <summary>
        /// Parse the given text representation of a charging notification progress request.
        /// </summary>
        /// <param name="Text">The text to parse.</param>
        /// <param name="RequestTimeout">The timeout for this request.</param>
        /// <param name="Timestamp">The optional timestamp of the request.</param>
        /// <param name="EventTrackingId">An optional event tracking identification for correlating this request with other events.</param>
        /// <param name="CustomChargingProgressNotificationRequestParser">A delegate to parse custom charging notification progress request JSON objects.</param>
        public static ChargingProgressNotificationRequest Parse(String Text,
                                                                TimeSpan RequestTimeout,
                                                                DateTime?Timestamp = null,
                                                                EventTracking_Id EventTrackingId = null,
                                                                CustomJObjectParserDelegate <ChargingProgressNotificationRequest> CustomChargingProgressNotificationRequestParser = null)
        {
            if (TryParse(Text,
                         RequestTimeout,
                         out ChargingProgressNotificationRequest chargingProgressNotificationRequest,
                         out String ErrorResponse,
                         Timestamp,
                         EventTrackingId,
                         CustomChargingProgressNotificationRequestParser))
            {
                return(chargingProgressNotificationRequest);
            }

            throw new ArgumentException("The given text representation of a charging notification progress request is invalid: " + ErrorResponse, nameof(Text));
        }
Ejemplo n.º 30
0
        /// <summary>
        /// Update the data of a charging station.
        /// </summary>
        /// <param name="Timestamp">The timestamp when this change was detected.</param>
        /// <param name="EventTrackingId">An optional event tracking identification for correlating this request with other events.</param>
        /// <param name="ChargingStation">The changed charging station.</param>
        /// <param name="PropertyName">The name of the changed property.</param>
        /// <param name="OldValue">The old value of the changed property.</param>
        /// <param name="NewValue">The new value of the changed property.</param>
        internal void UpdateChargingStationData(DateTime Timestamp,
                                                EventTracking_Id EventTrackingId,
                                                ChargingStation ChargingStation,
                                                String PropertyName,
                                                Object OldValue,
                                                Object NewValue)
        {
            var OnChargingStationDataChangedLocal = OnChargingStationDataChanged;

            if (OnChargingStationDataChangedLocal != null)
            {
                OnChargingStationDataChangedLocal(Timestamp,
                                                  EventTrackingId,
                                                  ChargingStation,
                                                  PropertyName,
                                                  OldValue,
                                                  NewValue);
            }
        }