/// <summary>
        /// Try to parse the given text representation of a GetServiceAuthorisation response.
        /// </summary>
        /// <param name="Request">The GetServiceAuthorisation request leading to this response.</param>
        /// <param name="GetServiceAuthorisationResponseText">The text to parse.</param>
        /// <param name="GetServiceAuthorisationResponse">The parsed GetServiceAuthorisation response.</param>
        /// <param name="CustomSendGetServiceAuthorisationResponseParser">An optional delegate to parse custom GetServiceAuthorisationResponse XML elements.</param>
        /// <param name="CustomMeterReportParser">An optional delegate to parse custom MeterReport XML elements.</param>
        /// <param name="HTTPResponse">The correlated HTTP response of this eMIP response.</param>
        /// <param name="OnException">An optional delegate called whenever an exception occured.</param>
        public static Boolean TryParse(GetServiceAuthorisationRequest Request,
                                       String GetServiceAuthorisationResponseText,
                                       out GetServiceAuthorisationResponse GetServiceAuthorisationResponse,
                                       CustomXMLParserDelegate <GetServiceAuthorisationResponse> CustomSendGetServiceAuthorisationResponseParser = null,
                                       CustomXMLParserDelegate <MeterReport> CustomMeterReportParser = null,
                                       HTTPResponse HTTPResponse       = null,
                                       OnExceptionDelegate OnException = null)
        {
            try
            {
                if (TryParse(Request,
                             XDocument.Parse(GetServiceAuthorisationResponseText).Root,
                             out GetServiceAuthorisationResponse,
                             CustomSendGetServiceAuthorisationResponseParser,
                             CustomMeterReportParser,
                             HTTPResponse,
                             OnException))
                {
                    return(true);
                }
            }
            catch (Exception e)
            {
                OnException?.Invoke(DateTime.UtcNow, GetServiceAuthorisationResponseText, e);
            }

            GetServiceAuthorisationResponse = null;
            return(false);
        }
Example #2
0
        /// <summary>
        /// Try to parse the given XML representation of an eMIP SessionAction object.
        /// </summary>
        /// <param name="SessionActionXML">The XML to parse.</param>
        /// <param name="CustomSessionActionParser">An optional delegate to parse custom SessionAction XML elements.</param>
        /// <param name="SessionAction">The parsed SessionAction object.</param>
        /// <param name="OnException">An optional delegate called whenever an exception occured.</param>
        public static Boolean TryParse(XElement SessionActionXML,
                                       CustomXMLParserDelegate <SessionAction> CustomSessionActionParser,
                                       out SessionAction SessionAction,
                                       OnExceptionDelegate OnException = null)
        {
            try
            {
                SessionAction = new SessionAction(SessionActionXML.MapValueOrFail("sessionActionNature", SessionActionNatures.Parse),
                                                  SessionActionXML.MapValueOrFail("sessionActionDateTime", DateTime.Parse),

                                                  SessionActionXML.MapValueOrNullable("sessionActionId", SessionAction_Id.Parse),
                                                  SessionActionXML.ElementValueOrDefault("sessionActionParameter"),
                                                  SessionActionXML.MapValueOrNullable("relatedSessionEventId", SessionEvent_Id.Parse));


                if (CustomSessionActionParser != null)
                {
                    SessionAction = CustomSessionActionParser(SessionActionXML,
                                                              SessionAction);
                }

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

                SessionAction = null;
                return(false);
            }
        }
        /// <summary>
        /// Try to parse the given text-representation of an OICP mobile remote stop request.
        /// </summary>
        /// <param name="MobileRemoteStopText">The text to parse.</param>
        /// <param name="MobileRemoteStop">The parsed mobile remote stop request.</param>
        /// <param name="CustomMobileRemoteStopRequestParser">A delegate to parse custom MobileRemoteStop 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(String MobileRemoteStopText,
                                       out MobileRemoteStopRequest MobileRemoteStop,
                                       CustomXMLParserDelegate <MobileRemoteStopRequest> CustomMobileRemoteStopRequestParser = null,
                                       OnExceptionDelegate OnException = null,

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

        {
            try
            {
                if (TryParse(XDocument.Parse(MobileRemoteStopText).Root,
                             out MobileRemoteStop,
                             CustomMobileRemoteStopRequestParser,
                             OnException,

                             Timestamp,
                             CancellationToken,
                             EventTrackingId,
                             RequestTimeout))
                {
                    return(true);
                }
            }
            catch (Exception e)
            {
                OnException?.Invoke(DateTime.UtcNow, MobileRemoteStopText, e);
            }

            MobileRemoteStop = null;
            return(false);
        }
        /// <summary>
        /// Parse the given text representation of an eMIP heartbeat request.
        /// </summary>
        /// <param name="SetServiceAuthorisationRequestText">The text to parse.</param>
        /// <param name="CustomSendSetServiceAuthorisationRequestParser">An optional delegate to parse custom SetServiceAuthorisationRequest XML elements.</param>
        /// <param name="CustomMeterReportParser">An optional delegate to parse custom MeterReport XML elements.</param>
        /// <param name="OnException">An optional delegate called whenever an exception occured.</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 static SetServiceAuthorisationRequest Parse(String                                                   SetServiceAuthorisationRequestText,
                                                           CustomXMLParserDelegate<SetServiceAuthorisationRequest>  CustomSendSetServiceAuthorisationRequestParser,
                                                           CustomXMLParserDelegate<MeterReport>                     CustomMeterReportParser,
                                                           OnExceptionDelegate                                      OnException         = null,

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

            if (TryParse(SetServiceAuthorisationRequestText,
                         CustomSendSetServiceAuthorisationRequestParser,
                         CustomMeterReportParser,
                         out SetServiceAuthorisationRequest _SetServiceAuthorisationRequest,
                         OnException,

                         HTTPRequest,
                         Timestamp,
                         CancellationToken,
                         EventTrackingId,
                         RequestTimeout))
            {
                return _SetServiceAuthorisationRequest;
            }

            return null;

        }
Example #5
0
        /// <summary>
        /// Parse the given text-representation of an OICP pull EVSE data request.
        /// </summary>
        /// <param name="PullEVSEDataText">The text to parse.</param>
        /// <param name="CustomPullEVSEDataRequestParser">A delegate to parse custom PullEVSEData 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 PullEVSEDataRequest Parse(String PullEVSEDataText,
                                                CustomXMLParserDelegate <PullEVSEDataRequest> CustomPullEVSEDataRequestParser = null,
                                                OnExceptionDelegate OnException = null,

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

        {
            if (TryParse(PullEVSEDataText,
                         out PullEVSEDataRequest _PullEVSEData,
                         CustomPullEVSEDataRequestParser,
                         OnException,

                         Timestamp,
                         CancellationToken,
                         EventTrackingId,
                         RequestTimeout))
            {
                return(_PullEVSEData);
            }

            return(null);
        }
Example #6
0
        /// <summary>
        /// Try to parse the given text-representation of an OICP pull authentication data request.
        /// </summary>
        /// <param name="PullAuthenticationDataText">The text to parse.</param>
        /// <param name="PullAuthenticationData">The parsed pull authentication data request.</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(String PullAuthenticationDataText,
                                       out PullAuthenticationDataRequest PullAuthenticationData,
                                       CustomXMLParserDelegate <PullAuthenticationDataRequest> CustomPullAuthenticationDataRequestParser = null,
                                       OnExceptionDelegate OnException = null,

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

        {
            try
            {
                if (TryParse(XDocument.Parse(PullAuthenticationDataText).Root,
                             out PullAuthenticationData,
                             CustomPullAuthenticationDataRequestParser,
                             OnException,

                             Timestamp,
                             CancellationToken,
                             EventTrackingId,
                             RequestTimeout))
                {
                    return(true);
                }
            }
            catch (Exception e)
            {
                OnException?.Invoke(DateTime.UtcNow, PullAuthenticationDataText, e);
            }

            PullAuthenticationData = null;
            return(false);
        }
        Parse(XElement AuthorizeRemoteReservationStartXML,
              CustomXMLParserDelegate <AuthorizeRemoteReservationStartRequest> CustomAuthorizeRemoteReservationStartRequestParser = null,
              CustomXMLParserDelegate <Identification> CustomIdentificationParser         = null,
              CustomXMLParserDelegate <RFIDIdentification> CustomRFIDIdentificationParser = null,
              OnExceptionDelegate OnException = null,

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

        {
            if (TryParse(AuthorizeRemoteReservationStartXML,
                         out AuthorizeRemoteReservationStartRequest _AuthorizeRemoteReservationStart,
                         CustomAuthorizeRemoteReservationStartRequestParser,
                         CustomIdentificationParser,
                         CustomRFIDIdentificationParser,
                         OnException,

                         Timestamp,
                         CancellationToken,
                         EventTrackingId,
                         RequestTimeout))
            {
                return(_AuthorizeRemoteReservationStart);
            }

            return(null);
        }
Example #8
0
        /// <summary>
        /// Try to parse the given text-representation of an OICP operator EVSE data request.
        /// </summary>
        /// <param name="OperatorEVSEDataText">The text to parse.</param>
        /// <param name="OperatorEVSEData">The parsed operator 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="CustomAddressParser">A delegate to parse custom Address XML elements.</param>
        /// <param name="CustomChargingFacilityParser">A delegate to parse custom ChargingFacility XML elements.</param>
        /// <param name="OnException">An optional delegate called whenever an exception occured.</param>
        public static Boolean TryParse(String OperatorEVSEDataText,
                                       out OperatorEVSEData OperatorEVSEData,
                                       CustomXMLParserDelegate <OperatorEVSEData> CustomOperatorEVSEDataParser = null,
                                       CustomXMLParserDelegate <EVSEDataRecord> CustomEVSEDataRecordParser     = null,
                                       CustomXMLParserDelegate <Address> CustomAddressParser = null,
                                       CustomXMLParserDelegate <ChargingFacility> CustomChargingFacilityParser = null,
                                       OnExceptionDelegate OnException = null)
        {
            try
            {
                if (TryParse(XDocument.Parse(OperatorEVSEDataText).Root,
                             out OperatorEVSEData,
                             CustomOperatorEVSEDataParser,
                             CustomEVSEDataRecordParser,
                             CustomAddressParser,
                             CustomChargingFacilityParser,
                             OnException))
                {
                    return(true);
                }
            }
            catch (Exception e)
            {
                OnException?.Invoke(DateTime.UtcNow, OperatorEVSEDataText, e);
            }

            OperatorEVSEData = null;
            return(false);
        }
Example #9
0
        Parse(PullEVSEDataRequest Request,
              String PullEVSEDataResponseText,
              CustomXMLParserDelegate <PullEVSEDataResponse> CustomPullEVSEDataResponseParser = null,
              CustomXMLParserDelegate <EVSEData> CustomEVSEDataParser = null,
              CustomXMLParserDelegate <OperatorEVSEData> CustomOperatorEVSEDataParser = null,
              CustomXMLParserDelegate <EVSEDataRecord> CustomEVSEDataRecordParser     = null,
              CustomXMLParserDelegate <Address> CustomAddressParser = null,
              CustomXMLParserDelegate <ChargingFacility> CustomChargingFacilityParser = null,
              CustomXMLParserDelegate <StatusCode> CustomStatusCodeParser             = null,
              OnExceptionDelegate OnException = null)

        {
            if (TryParse(Request,
                         PullEVSEDataResponseText,
                         out PullEVSEDataResponse _PullEVSEDataResponse,
                         CustomPullEVSEDataResponseParser,
                         CustomEVSEDataParser,
                         CustomOperatorEVSEDataParser,
                         CustomEVSEDataRecordParser,
                         CustomAddressParser,
                         CustomChargingFacilityParser,
                         CustomStatusCodeParser,
                         OnException))
            {
                return(_PullEVSEDataResponse);
            }

            return(null);
        }
Example #10
0
        /// <summary>
        /// Try to parse the given XML representation of a ChargingFacility object.
        /// </summary>
        /// <param name="ChargingFacilityXML">The XML to parse.</param>
        /// <param name="CustomChargingFacilityParser">An optional delegate to parse custom ChargingFacility XML elements.</param>
        /// <param name="ChargingFacility">The parsed ChargingFacility object.</param>
        /// <param name="OnException">An optional delegate called whenever an exception occured.</param>
        public static Boolean TryParse(XElement ChargingFacilityXML,
                                       CustomXMLParserDelegate <ChargingFacility> CustomChargingFacilityParser,
                                       out ChargingFacility ChargingFacility,
                                       OnExceptionDelegate OnException = null)
        {
            try
            {
                ChargingFacility = new ChargingFacility(ChargingFacilityXML.MapValueOrNullable("PowerType", ConversionMethods.AsPowerType),
                                                        ChargingFacilityXML.MapValueOrNullable("Voltage", UInt32.Parse),
                                                        ChargingFacilityXML.MapValueOrNullable("Amperage", UInt32.Parse),
                                                        ChargingFacilityXML.MapValueOrNullable("Power", Decimal.Parse));


                if (CustomChargingFacilityParser != null)
                {
                    ChargingFacility = CustomChargingFacilityParser(ChargingFacilityXML,
                                                                    ChargingFacility);
                }

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

                ChargingFacility = null;
                return(false);
            }
        }
        // <soapenv:Envelope xmlns:soapenv    = "http://schemas.xmlsoap.org/soap/envelope/"
        //                   xmlns:EVSEStatus = "http://www.hubject.com/b2b/services/evsestatus/v2.1">
        //
        //    <soapenv:Header/>
        //    <soapenv:Body>
        //       <EVSEStatus:eRoamingPullEvseStatusByOperatorID>
        //
        //          <EVSEStatus:ProviderID>?</EVSEStatus:ProviderID>
        //
        //          <!--1 to 100 repetitions:-->
        //          <EVSEStatus:OperatorID>?</EVSEStatus:OperatorID>
        //
        //       </EVSEStatus:eRoamingPullEvseStatusByOperatorId>
        //    </soapenv:Body>
        // </soapenv:Envelope>

        #endregion

        #region (static) Parse(PullEVSEStatusByOperatorIdXML,  ..., OnException = null, ...)

        /// <summary>
        /// Parse the given XML representation of an OICP pull EVSE status by id request.
        /// </summary>
        /// <param name="PullEVSEStatusByOperatorIdXML">The XML to parse.</param>
        /// <param name="CustomPullEVSEStatusByOperatorIdRequestParser">A delegate to parse custom PullEVSEStatusByOperatorId 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 PullEVSEStatusByOperatorIdRequest Parse(XElement PullEVSEStatusByOperatorIdXML,
                                                              CustomXMLParserDelegate <PullEVSEStatusByOperatorIdRequest> CustomPullEVSEStatusByOperatorIdRequestParser = null,
                                                              OnExceptionDelegate OnException = null,

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

        {
            if (TryParse(PullEVSEStatusByOperatorIdXML,
                         out PullEVSEStatusByOperatorIdRequest pullEVSEStatusByOperatorId,
                         CustomPullEVSEStatusByOperatorIdRequestParser,
                         OnException,

                         Timestamp,
                         CancellationToken,
                         EventTrackingId,
                         RequestTimeout))
            {
                return(pullEVSEStatusByOperatorId);
            }

            return(null);
        }
        /// <summary>
        /// Try to parse the given XML representation of an eMIP heartbeat request.
        /// </summary>
        /// <param name="SetSessionEventReportRequestXML">The XML to parse.</param>
        /// <param name="CustomSendSetSessionEventReportRequestParser">An optional delegate to parse custom SetSessionEventReportRequest XML elements.</param>
        /// <param name="CustomSessionEventParser">An optional delegate to parse custom SessionEvent XML elements.</param>
        /// <param name="SetSessionEventReportRequest">The parsed heartbeat request.</param>
        /// <param name="OnException">An optional delegate called whenever an exception occured.</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 static Boolean TryParse(XElement SetSessionEventReportRequestXML,
                                       CustomXMLParserDelegate <SetSessionEventReportRequest> CustomSendSetSessionEventReportRequestParser,
                                       CustomXMLParserDelegate <SessionEvent> CustomSessionEventParser,
                                       out SetSessionEventReportRequest SetSessionEventReportRequest,
                                       OnExceptionDelegate OnException = null,

                                       HTTPRequest HTTPRequest             = null,
                                       DateTime?Timestamp                  = null,
                                       CancellationToken?CancellationToken = null,
                                       EventTracking_Id EventTrackingId    = null,
                                       TimeSpan?RequestTimeout             = null)
        {
            try
            {
                var SessionEventXML = SetSessionEventReportRequestXML.ElementOrFail("sessionAction");


                SetSessionEventReportRequest = new SetSessionEventReportRequest(

                    //ToDo: What to do with: <partnerIdType>eMI3</partnerIdType>?
                    SetSessionEventReportRequestXML.MapValueOrFail("partnerId", Partner_Id.Parse),
                    SetSessionEventReportRequestXML.MapValueOrFail("operatorId", Operator_Id.Parse),

                    SetSessionEventReportRequestXML.MapValueOrFail("serviceSessionId", ServiceSession_Id.Parse),

                    SessionEventXML.MapElementOrFail("sessionEvent",
                                                     (s, e) => SessionEvent.Parse(s,
                                                                                  CustomSessionEventParser,
                                                                                  e),
                                                     OnException),


                    SetSessionEventReportRequestXML.MapValueOrNullable("transactionId", Transaction_Id.Parse),
                    SetSessionEventReportRequestXML.MapValueOrFail("salePartnerSessionId", PartnerServiceSession_Id.Parse),

                    HTTPRequest,
                    Timestamp,
                    CancellationToken,
                    EventTrackingId,
                    RequestTimeout

                    );


                if (CustomSendSetSessionEventReportRequestParser != null)
                {
                    SetSessionEventReportRequest = CustomSendSetSessionEventReportRequestParser(SetSessionEventReportRequestXML,
                                                                                                SetSessionEventReportRequest);
                }

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

                SetSessionEventReportRequest = null;
                return(false);
            }
        }
        // <soap:Envelope xmlns:soap = "http://www.w3.org/2003/05/soap-envelope"
        //                xmlns:aut  = "https://api-iop.gireve.com/schemas/AuthorisationV1/">
        //
        //    <soap:Header/>
        //    <soap:Body>
        //       <aut:eMIP_ToIOP_SetSessionEventReportRequestRequest>
        //
        //          <!--Optional:-->
        //          <transactionId>?</transactionId>
        //
        //          <partnerIdType>eMI3</partnerIdType>
        //          <partnerId>FR*PAR</partnerId>
        //
        //          <operatorIdType>eMI3</operatorIdType>
        //          <operatorId>FR*CPO</operatorId>
        //
        //          <serviceSessionId>?</serviceSessionId>
        //
        //          <!--Optional:-->
        //          <execPartnerSessionId>CPOxxx2</execPartnerSessionId>
        //
        //          <sessionEvent>
        //
        //             <sessionEventNature>1</sessionEventNature>
        //
        //             <!--Optional:-->
        //             <sessionEventId>Event-Id-2015-11-19T11:14:17.123Z</sessionEventId>
        //
        //             <sessionEventDateTime>2015-11-19T11:14:17.123Z</sessionEventDateTime>
        //
        //             <!--Optional:-->
        //             <sessionEventParameter>Param1</sessionEventParameter>
        //
        //             <!--Optional:-->
        //             <relatedSessionActionId>?</relatedSessionActionId>
        //
        //          </sessionEvent>
        //
        //       </aut:eMIP_ToIOP_SetSessionEventReportRequestRequest>
        //    </soap:Body>
        // </soap:Envelope>

        #endregion

        #region (static) Parse   (SetSessionEventReportRequestXML,  ..., OnException = null)

        /// <summary>
        /// Parse the given XML representation of an eMIP heartbeat request.
        /// </summary>
        /// <param name="SetSessionEventReportRequestXML">The XML to parse.</param>
        /// <param name="CustomSendSetSessionEventReportRequestParser">An optional delegate to parse custom SetSessionEventReportRequest XML elements.</param>
        /// <param name="CustomSessionEventParser">An optional delegate to parse custom SessionEvent XML elements.</param>
        /// <param name="OnException">An optional delegate called whenever an exception occured.</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 static SetSessionEventReportRequest Parse(XElement SetSessionEventReportRequestXML,
                                                         CustomXMLParserDelegate <SetSessionEventReportRequest> CustomSendSetSessionEventReportRequestParser,
                                                         CustomXMLParserDelegate <SessionEvent> CustomSessionEventParser,
                                                         OnExceptionDelegate OnException = null,

                                                         HTTPRequest HTTPRequest             = null,
                                                         DateTime?Timestamp                  = null,
                                                         CancellationToken?CancellationToken = null,
                                                         EventTracking_Id EventTrackingId    = null,
                                                         TimeSpan?RequestTimeout             = null)
        {
            if (TryParse(SetSessionEventReportRequestXML,
                         CustomSendSetSessionEventReportRequestParser,
                         CustomSessionEventParser,
                         out SetSessionEventReportRequest _SetSessionEventReportRequest,
                         OnException,

                         HTTPRequest,
                         Timestamp,
                         CancellationToken,
                         EventTrackingId,
                         RequestTimeout))
            {
                return(_SetSessionEventReportRequest);
            }

            return(null);
        }
Example #14
0
        /// <summary>
        /// Try to parse the given text-representation of an OICP EVSEStatusById request.
        /// </summary>
        /// <param name="Request">A EVSEStatusById request.</param>
        /// <param name="EVSEStatusByIdText">The text to parse.</param>
        /// <param name="EVSEStatusById">The parsed EVSEStatusById request.</param>
        /// <param name="CustomEVSEStatusByIdParser">A delegate to parse custom EVSEStatusById respones.</param>
        /// <param name="CustomEVSEStatusRecordParser">A delegate to parse custom EVSEStatusRecord XML elements.</param>
        /// <param name="CustomStatusCodeParser">A delegate to parse custom StatusCode XML elements.</param>
        /// <param name="OnException">An optional delegate called whenever an exception occured.</param>
        public static Boolean TryParse(PullEVSEStatusByIdRequest Request,
                                       String EVSEStatusByIdText,
                                       out EVSEStatusById EVSEStatusById,
                                       CustomXMLParserDelegate <EVSEStatusById> CustomEVSEStatusByIdParser     = null,
                                       CustomXMLParserDelegate <EVSEStatusRecord> CustomEVSEStatusRecordParser = null,
                                       CustomXMLParserDelegate <StatusCode> CustomStatusCodeParser             = null,
                                       OnExceptionDelegate OnException = null)
        {
            try
            {
                if (TryParse(Request,
                             XDocument.Parse(EVSEStatusByIdText).Root,
                             out EVSEStatusById,
                             CustomEVSEStatusByIdParser,
                             CustomEVSEStatusRecordParser,
                             CustomStatusCodeParser,
                             OnException))
                {
                    return(true);
                }
            }
            catch (Exception e)
            {
                OnException?.Invoke(DateTime.UtcNow, EVSEStatusByIdText, e);
            }

            EVSEStatusById = null;
            return(false);
        }
Example #15
0
        /// <summary>
        /// Try to parse the given text representation of an eMIP heartbeat request.
        /// </summary>
        /// <param name="GetServiceAuthorisationRequestText">The text to parse.</param>
        /// <param name="CustomSendGetServiceAuthorisationRequestParser">An optional delegate to parse custom GetServiceAuthorisationRequest XML elements.</param>
        /// <param name="GetServiceAuthorisationRequest">The parsed heartbeat request.</param>
        /// <param name="OnException">An optional delegate called whenever an exception occured.</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 static Boolean TryParse(String GetServiceAuthorisationRequestText,
                                       CustomXMLParserDelegate <GetServiceAuthorisationRequest> CustomSendGetServiceAuthorisationRequestParser,
                                       out GetServiceAuthorisationRequest GetServiceAuthorisationRequest,
                                       OnExceptionDelegate OnException = null,

                                       HTTPRequest HTTPRequest             = null,
                                       DateTime?Timestamp                  = null,
                                       CancellationToken?CancellationToken = null,
                                       EventTracking_Id EventTrackingId    = null,
                                       TimeSpan?RequestTimeout             = null)
        {
            try
            {
                if (TryParse(XDocument.Parse(GetServiceAuthorisationRequestText).Root,
                             CustomSendGetServiceAuthorisationRequestParser,
                             out GetServiceAuthorisationRequest,
                             OnException,

                             HTTPRequest,
                             Timestamp,
                             CancellationToken,
                             EventTrackingId,
                             RequestTimeout))
                {
                    return(true);
                }
            }
            catch (Exception e)
            {
                OnException?.Invoke(DateTime.UtcNow, GetServiceAuthorisationRequestText, e);
            }

            GetServiceAuthorisationRequest = null;
            return(false);
        }
Example #16
0
        /// <summary>
        /// Try to parse the given XML representation of a SetEVSEBusyStatus response.
        /// </summary>
        /// <param name="Request">The SetEVSEBusyStatus request leading to this response.</param>
        /// <param name="SetEVSEBusyStatusResponseXML">The XML to parse.</param>
        /// <param name="SetEVSEBusyStatusResponse">The parsed SetEVSEBusyStatus response.</param>
        /// <param name="CustomSendSetEVSEBusyStatusResponseParser">An optional delegate to parse custom SetEVSEBusyStatusResponse XML elements.</param>
        /// <param name="HTTPResponse">The correlated HTTP response of this eMIP response.</param>
        /// <param name="OnException">An optional delegate called whenever an exception occured.</param>
        public static Boolean TryParse(SetEVSEBusyStatusRequest Request,
                                       XElement SetEVSEBusyStatusResponseXML,
                                       out SetEVSEBusyStatusResponse SetEVSEBusyStatusResponse,
                                       CustomXMLParserDelegate <SetEVSEBusyStatusResponse> CustomSendSetEVSEBusyStatusResponseParser = null,
                                       HTTPResponse HTTPResponse       = null,
                                       OnExceptionDelegate OnException = null)
        {
            try
            {
                SetEVSEBusyStatusResponse = new SetEVSEBusyStatusResponse(
                    Request,
                    SetEVSEBusyStatusResponseXML.MapValueOrFail("transactionId", Transaction_Id.Parse),
                    SetEVSEBusyStatusResponseXML.MapValueOrFail("requestStatus", RequestStatus.Parse),
                    HTTPResponse
                    );


                if (CustomSendSetEVSEBusyStatusResponseParser != null)
                {
                    SetEVSEBusyStatusResponse = CustomSendSetEVSEBusyStatusResponseParser(SetEVSEBusyStatusResponseXML,
                                                                                          SetEVSEBusyStatusResponse);
                }

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

                SetEVSEBusyStatusResponse = null;
                return(false);
            }
        }
Example #17
0
        Parse(XElement PullAuthenticationDataXML,
              CustomXMLParserDelegate <PullAuthenticationDataRequest> CustomPullAuthenticationDataRequestParser = null,
              OnExceptionDelegate OnException = null,

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

        {
            if (TryParse(PullAuthenticationDataXML,
                         out PullAuthenticationDataRequest _PullAuthenticationData,
                         CustomPullAuthenticationDataRequestParser,
                         OnException,

                         Timestamp,
                         CancellationToken,
                         EventTrackingId,
                         RequestTimeout))
            {
                return(_PullAuthenticationData);
            }

            return(null);
        }
        Parse(String AuthorizeRemoteStopRequestText,
              CustomXMLParserDelegate <AuthorizeRemoteStopRequest> CustomAuthorizeRemoteStopRequestParser = null,
              OnExceptionDelegate OnException = null,

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

        {
            if (TryParse(AuthorizeRemoteStopRequestText,
                         out AuthorizeRemoteStopRequest _AuthorizeRemoteStopRequest,
                         CustomAuthorizeRemoteStopRequestParser,
                         OnException,

                         Timestamp,
                         CancellationToken,
                         EventTrackingId,
                         RequestTimeout))
            {
                return(_AuthorizeRemoteStopRequest);
            }

            return(null);
        }
        /// <summary>
        /// Try to parse the given text-representation of an OICP operator EVSE status request.
        /// </summary>
        /// <param name="OperatorEVSEStatusText">The text to parse.</param>
        /// <param name="OperatorEVSEStatus">The parsed operator EVSE status request.</param>
        /// <param name="CustomOperatorEVSEStatusParser">A delegate to parse custom OperatorEVSEStatus XML elements.</param>
        /// <param name="CustomEVSEStatusRecordParser">A delegate to parse custom EVSEStatusRecord XML elements.</param>
        /// <param name="OnException">An optional delegate called whenever an exception occured.</param>
        public static Boolean TryParse(String OperatorEVSEStatusText,
                                       out OperatorEVSEStatus OperatorEVSEStatus,
                                       CustomXMLParserDelegate <OperatorEVSEStatus> CustomOperatorEVSEStatusParser = null,
                                       CustomXMLParserDelegate <EVSEStatusRecord> CustomEVSEStatusRecordParser     = null,
                                       OnExceptionDelegate OnException = null)
        {
            try
            {
                if (TryParse(XDocument.Parse(OperatorEVSEStatusText).Root,
                             out OperatorEVSEStatus,
                             CustomOperatorEVSEStatusParser,
                             CustomEVSEStatusRecordParser,
                             OnException))
                {
                    return(true);
                }
            }
            catch (Exception e)
            {
                OnException?.Invoke(DateTime.UtcNow, OperatorEVSEStatusText, e);
            }

            OperatorEVSEStatus = null;
            return(false);
        }
        /// <summary>
        /// Try to parse the given text representation of an eMIP heartbeat request.
        /// </summary>
        /// <param name="SetChargingStationAvailabilityStatusRequestText">The text to parse.</param>
        /// <param name="CustomSendSetChargingStationAvailabilityStatusRequestParser">An optional delegate to parse custom SetChargingStationAvailabilityStatusRequest XML elements.</param>
        /// <param name="SetChargingStationAvailabilityStatusRequest">The parsed heartbeat request.</param>
        /// <param name="OnException">An optional delegate called whenever an exception occured.</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 static Boolean TryParse(String SetChargingStationAvailabilityStatusRequestText,
                                       CustomXMLParserDelegate <SetChargingStationAvailabilityStatusRequest> CustomSendSetChargingStationAvailabilityStatusRequestParser,
                                       out SetChargingStationAvailabilityStatusRequest SetChargingStationAvailabilityStatusRequest,
                                       OnExceptionDelegate OnException = null,

                                       HTTPRequest HTTPRequest             = null,
                                       DateTime?Timestamp                  = null,
                                       CancellationToken?CancellationToken = null,
                                       EventTracking_Id EventTrackingId    = null,
                                       TimeSpan?RequestTimeout             = null)
        {
            try
            {
                if (TryParse(XDocument.Parse(SetChargingStationAvailabilityStatusRequestText).Root,
                             CustomSendSetChargingStationAvailabilityStatusRequestParser,
                             out SetChargingStationAvailabilityStatusRequest,
                             OnException,

                             HTTPRequest,
                             Timestamp,
                             CancellationToken,
                             EventTrackingId,
                             RequestTimeout))
                {
                    return(true);
                }
            }
            catch (Exception e)
            {
                OnException?.Invoke(DateTime.UtcNow, SetChargingStationAvailabilityStatusRequestText, e);
            }

            SetChargingStationAvailabilityStatusRequest = null;
            return(false);
        }
        /// <summary>
        /// Try to parse the given text-representation of an OICP mobile authorization startes request.
        /// </summary>
        /// <param name="Request">An PullMobileAuthorizationStart request.</param>
        /// <param name="MobileAuthorizationStartText">The text to parse.</param>
        /// <param name="MobileAuthorizationStart">The parsed mobile authorization startes request.</param>
        /// <param name="CustomMobileAuthorizationStartParser">A delegate to customize the deserialization of MobileAuthorizationStart responses.</param>
        /// <param name="CustomAddressParser">A delegate to parse custom Address XML elements.</param>
        /// <param name="CustomStatusCodeParser">A delegate to parse custom StatusCode XML elements.</param>
        /// <param name="OnException">An optional delegate called whenever an exception occured.</param>
        public static Boolean TryParse(MobileAuthorizeStartRequest Request,
                                       String MobileAuthorizationStartText,
                                       out MobileAuthorizationStart MobileAuthorizationStart,
                                       CustomXMLParserDelegate <MobileAuthorizationStart> CustomMobileAuthorizationStartParser = null,
                                       CustomXMLParserDelegate <Address> CustomAddressParser       = null,
                                       CustomXMLParserDelegate <StatusCode> CustomStatusCodeParser = null,
                                       OnExceptionDelegate OnException = null)
        {
            try
            {
                if (TryParse(Request,
                             XDocument.Parse(MobileAuthorizationStartText).Root,
                             out MobileAuthorizationStart,
                             CustomMobileAuthorizationStartParser,
                             CustomAddressParser,
                             CustomStatusCodeParser,
                             OnException))
                {
                    return(true);
                }
            }
            catch (Exception e)
            {
                OnException?.Invoke(DateTime.UtcNow, MobileAuthorizationStartText, e);
            }

            MobileAuthorizationStart = null;
            return(false);
        }
        /// <summary>
        /// Parse the given text-representation of an OICP push EVSE status request.
        /// </summary>
        /// <param name="PushEVSEStatusText">The text to parse.</param>
        /// <param name="CustomOperatorEVSEStatusParser">A delegate to parse custom OperatorEVSEStatus XML elements.</param>
        /// <param name="CustomEVSEStatusRecordParser">A delegate to parse custom EVSEStatusRecord 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 PushEVSEStatusRequest Parse(String PushEVSEStatusText,
                                                  CustomXMLParserDelegate <OperatorEVSEStatus> CustomOperatorEVSEStatusParser = null,
                                                  CustomXMLParserDelegate <EVSEStatusRecord> CustomEVSEStatusRecordParser     = null,
                                                  OnExceptionDelegate OnException = null,

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

        {
            if (TryParse(PushEVSEStatusText,
                         out PushEVSEStatusRequest pushEVSEStatus,
                         CustomOperatorEVSEStatusParser,
                         CustomEVSEStatusRecordParser,
                         OnException,

                         Timestamp,
                         CancellationToken,
                         EventTrackingId,
                         RequestTimeout))
            {
                return(pushEVSEStatus);
            }

            return(null);
        }
        /// <summary>
        /// Try to parse the given text representation of a Heartbeat response.
        /// </summary>
        /// <param name="Request">The Heartbeat request leading to this response.</param>
        /// <param name="HeartbeatResponseText">The text to parse.</param>
        /// <param name="HeartbeatResponse">The parsed Heartbeat response.</param>
        /// <param name="CustomSendHeartbeatResponseParser">An optional delegate to parse custom HeartbeatResponse XML elements.</param>
        /// <param name="HTTPResponse">The correlated HTTP response of this eMIP response.</param>
        /// <param name="OnException">An optional delegate called whenever an exception occured.</param>
        public static Boolean TryParse(HeartbeatRequest Request,
                                       String HeartbeatResponseText,
                                       out HeartbeatResponse HeartbeatResponse,
                                       CustomXMLParserDelegate <HeartbeatResponse> CustomSendHeartbeatResponseParser = null,
                                       HTTPResponse HTTPResponse       = null,
                                       OnExceptionDelegate OnException = null)
        {
            try
            {
                if (TryParse(Request,
                             XDocument.Parse(HeartbeatResponseText).Root,
                             out HeartbeatResponse,
                             CustomSendHeartbeatResponseParser,
                             HTTPResponse,
                             OnException))
                {
                    return(true);
                }
            }
            catch (Exception e)
            {
                OnException?.Invoke(DateTime.UtcNow, HeartbeatResponseText, e);
            }

            HeartbeatResponse = null;
            return(false);
        }
        /// <summary>
        /// Parse the given text representation of an eMIP SetEVSEBusyStatus request.
        /// </summary>
        /// <param name="SetEVSEBusyStatusRequestText">The text to parse.</param>
        /// <param name="CustomSendSetEVSEBusyStatusRequestParser">An optional delegate to parse custom SetEVSEBusyStatusRequest XML elements.</param>
        /// <param name="OnException">An optional delegate called whenever an exception occured.</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 static SetEVSEBusyStatusRequest Parse(String SetEVSEBusyStatusRequestText,
                                                     CustomXMLParserDelegate <SetEVSEBusyStatusRequest> CustomSendSetEVSEBusyStatusRequestParser,
                                                     OnExceptionDelegate OnException = null,

                                                     HTTPRequest HTTPRequest             = null,
                                                     DateTime?Timestamp                  = null,
                                                     CancellationToken?CancellationToken = null,
                                                     EventTracking_Id EventTrackingId    = null,
                                                     TimeSpan?RequestTimeout             = null)
        {
            if (TryParse(SetEVSEBusyStatusRequestText,
                         CustomSendSetEVSEBusyStatusRequestParser,
                         out SetEVSEBusyStatusRequest _SetEVSEBusyStatusRequest,
                         OnException,

                         HTTPRequest,
                         Timestamp,
                         CancellationToken,
                         EventTrackingId,
                         RequestTimeout))
            {
                return(_SetEVSEBusyStatusRequest);
            }

            return(null);
        }
        /// <summary>
        /// Try to parse the given text representation of a SetChargingConnectorAvailabilityStatus response.
        /// </summary>
        /// <param name="Request">The SetChargingConnectorAvailabilityStatus request leading to this response.</param>
        /// <param name="SetChargingConnectorAvailabilityStatusResponseText">The text to parse.</param>
        /// <param name="SetChargingConnectorAvailabilityStatusResponse">The parsed SetChargingConnectorAvailabilityStatus response.</param>
        /// <param name="CustomSendSetChargingConnectorAvailabilityStatusResponseParser">An optional delegate to parse custom SetChargingConnectorAvailabilityStatusResponse XML elements.</param>
        /// <param name="HTTPResponse">The correlated HTTP response of this eMIP response.</param>
        /// <param name="OnException">An optional delegate called whenever an exception occured.</param>
        public static Boolean TryParse(SetChargingConnectorAvailabilityStatusRequest Request,
                                       String SetChargingConnectorAvailabilityStatusResponseText,
                                       out SetChargingConnectorAvailabilityStatusResponse SetChargingConnectorAvailabilityStatusResponse,
                                       CustomXMLParserDelegate <SetChargingConnectorAvailabilityStatusResponse> CustomSendSetChargingConnectorAvailabilityStatusResponseParser = null,
                                       HTTPResponse HTTPResponse       = null,
                                       OnExceptionDelegate OnException = null)
        {
            try
            {
                if (TryParse(Request,
                             XDocument.Parse(SetChargingConnectorAvailabilityStatusResponseText).Root,
                             out SetChargingConnectorAvailabilityStatusResponse,
                             CustomSendSetChargingConnectorAvailabilityStatusResponseParser,
                             HTTPResponse,
                             OnException))
                {
                    return(true);
                }
            }
            catch (Exception e)
            {
                OnException?.Invoke(DateTime.UtcNow, SetChargingConnectorAvailabilityStatusResponseText, e);
            }

            SetChargingConnectorAvailabilityStatusResponse = null;
            return(false);
        }
Example #26
0
        /// <summary>
        /// Parse the given text representation of an eMIP heartbeat request.
        /// </summary>
        /// <param name="SetChargeDetailRecordRequestText">The text to parse.</param>
        /// <param name="CustomSendSetChargeDetailRecordRequestParser">An optional delegate to parse custom SetChargeDetailRecordRequest XML elements.</param>
        /// <param name="CustomChargeDetailRecordParser">An optional delegate to parse custom ChargeDetailRecord XML elements.</param>
        /// <param name="CustomMeterReportParser">An optional delegate to parse custom MeterReport XML elements.</param>
        /// <param name="OnException">An optional delegate called whenever an exception occured.</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 static SetChargeDetailRecordRequest Parse(String SetChargeDetailRecordRequestText,
                                                         CustomXMLParserDelegate <SetChargeDetailRecordRequest> CustomSendSetChargeDetailRecordRequestParser = null,
                                                         CustomXMLParserDelegate <ChargeDetailRecord> CustomChargeDetailRecordParser = null,
                                                         CustomXMLParserDelegate <MeterReport> CustomMeterReportParser = null,
                                                         OnExceptionDelegate OnException = null,

                                                         HTTPRequest HTTPRequest             = null,
                                                         DateTime?Timestamp                  = null,
                                                         CancellationToken?CancellationToken = null,
                                                         EventTracking_Id EventTrackingId    = null,
                                                         TimeSpan?RequestTimeout             = null)
        {
            if (TryParse(SetChargeDetailRecordRequestText,
                         out SetChargeDetailRecordRequest _SetChargeDetailRecordRequest,
                         CustomSendSetChargeDetailRecordRequestParser,
                         CustomChargeDetailRecordParser,
                         CustomMeterReportParser,
                         OnException,

                         HTTPRequest,
                         Timestamp,
                         CancellationToken,
                         EventTrackingId,
                         RequestTimeout))
            {
                return(_SetChargeDetailRecordRequest);
            }

            return(null);
        }
        Parse(String MobileRemoteStopText,
              CustomXMLParserDelegate <MobileRemoteStopRequest> CustomMobileRemoteStopRequestParser = null,
              OnExceptionDelegate OnException = null,

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

        {
            if (TryParse(MobileRemoteStopText,
                         out MobileRemoteStopRequest _MobileRemoteStop,
                         CustomMobileRemoteStopRequestParser,
                         OnException,

                         Timestamp,
                         CancellationToken,
                         EventTrackingId,
                         RequestTimeout))
            {
                return(_MobileRemoteStop);
            }

            return(null);
        }
Example #28
0
        /// <summary>
        /// Parse the given text representation of an eMIP heartbeat request.
        /// </summary>
        /// <param name="GetServiceAuthorisationRequestText">The text to parse.</param>
        /// <param name="CustomSendGetServiceAuthorisationRequestParser">An optional delegate to parse custom GetServiceAuthorisationRequest XML elements.</param>
        /// <param name="OnException">An optional delegate called whenever an exception occured.</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 static GetServiceAuthorisationRequest Parse(String GetServiceAuthorisationRequestText,
                                                           CustomXMLParserDelegate <GetServiceAuthorisationRequest> CustomSendGetServiceAuthorisationRequestParser,
                                                           OnExceptionDelegate OnException = null,

                                                           HTTPRequest HTTPRequest             = null,
                                                           DateTime?Timestamp                  = null,
                                                           CancellationToken?CancellationToken = null,
                                                           EventTracking_Id EventTrackingId    = null,
                                                           TimeSpan?RequestTimeout             = null)
        {
            if (TryParse(GetServiceAuthorisationRequestText,
                         CustomSendGetServiceAuthorisationRequestParser,
                         out GetServiceAuthorisationRequest _GetServiceAuthorisationRequest,
                         OnException,

                         HTTPRequest,
                         Timestamp,
                         CancellationToken,
                         EventTrackingId,
                         RequestTimeout))
            {
                return(_GetServiceAuthorisationRequest);
            }

            return(null);
        }
        /// <summary>
        /// Parse the given text-representation of an OICP authorize stop request.
        /// </summary>
        /// <param name="AuthorizeStopText">The text to parse.</param>
        /// <param name="CustomAuthorizeStopRequestParser">A delegate to customize the deserialization of AuthorizeStop requests.</param>
        /// <param name="CustomIdentificationParser">A delegate to parse custom Identification XML elements.</param>
        /// <param name="CustomRFIDIdentificationParser">A delegate to parse custom RFID identification 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 AuthorizeStopRequest Parse(String AuthorizeStopText,
                                                 CustomXMLParserDelegate <AuthorizeStopRequest> CustomAuthorizeStopRequestParser = null,
                                                 CustomXMLParserDelegate <Identification> CustomIdentificationParser             = null,
                                                 CustomXMLParserDelegate <RFIDIdentification> CustomRFIDIdentificationParser     = null,
                                                 OnExceptionDelegate OnException = null,

                                                 DateTime?Timestamp = null,
                                                 CancellationToken?CancellationToken = null,
                                                 EventTracking_Id EventTrackingId    = null,
                                                 TimeSpan?RequestTimeout             = null)
        {
            if (TryParse(AuthorizeStopText,
                         out AuthorizeStopRequest _AuthorizeStop,
                         CustomAuthorizeStopRequestParser,
                         CustomIdentificationParser,
                         CustomRFIDIdentificationParser,
                         OnException,

                         Timestamp,
                         CancellationToken,
                         EventTrackingId,
                         RequestTimeout))
            {
                return(_AuthorizeStop);
            }

            return(null);
        }
Example #30
0
        /// <summary>
        /// Parse the given text-representation of an OICP send charge detail record request.
        /// </summary>
        /// <param name="SendChargeDetailRecordText">The text to parse.</param>
        /// <param name="CustomChargeDetailRecordParser">A delegate to parse custom CustomChargeDetailRecord XML elements.</param>
        /// <param name="CustomIdentificationParser">A delegate to parse custom Identification XML elements.</param>
        /// <param name="CustomRFIDIdentificationParser">A delegate to parse custom RFID identification 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 SendChargeDetailRecordRequest Parse(String SendChargeDetailRecordText,
                                                          CustomXMLParserDelegate <ChargeDetailRecord> CustomChargeDetailRecordParser = null,
                                                          CustomXMLParserDelegate <Identification> CustomIdentificationParser         = null,
                                                          CustomXMLParserDelegate <RFIDIdentification> CustomRFIDIdentificationParser = null,
                                                          OnExceptionDelegate OnException = null,

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

        {
            if (TryParse(SendChargeDetailRecordText,
                         out SendChargeDetailRecordRequest _SendChargeDetailRecord,
                         CustomChargeDetailRecordParser,
                         CustomIdentificationParser,
                         CustomRFIDIdentificationParser,
                         OnException,

                         Timestamp,
                         CancellationToken,
                         EventTrackingId,
                         RequestTimeout))
            {
                return(_SendChargeDetailRecord);
            }

            return(null);
        }