/// <summary>
        /// Parse the given text representation of an UnlockConnector request.
        /// </summary>
        /// <param name="Text">The text to be parsed.</param>
        /// <param name="RequestId">The request identification.</param>
        /// <param name="ChargeBoxId">The charge box identification.</param>
        /// <param name="OnException">An optional delegate called whenever an exception occured.</param>
        public static UnlockConnectorRequest Parse(String Text,
                                                   Request_Id RequestId,
                                                   ChargeBox_Id ChargeBoxId,
                                                   OnExceptionDelegate OnException = null)
        {
            if (TryParse(Text,
                         RequestId,
                         ChargeBoxId,
                         out UnlockConnectorRequest unlockConnectorRequest,
                         OnException))
            {
                return(unlockConnectorRequest);
            }

            throw new ArgumentException("The given text representation of an UnlockConnector request is invalid!", nameof(Text));
        }
        /// <summary>
        /// Create a new UnlockConnector request.
        /// </summary>
        /// <param name="ChargeBoxId">The charge box identification.</param>
        /// <param name="ConnectorId">The identifier of the connector to be unlocked.</param>
        ///
        /// <param name="RequestId">An optional request identification.</param>
        /// <param name="RequestTimestamp">An optional request timestamp.</param>
        public UnlockConnectorRequest(ChargeBox_Id ChargeBoxId,
                                      Connector_Id ConnectorId,

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

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

        {
            this.ConnectorId = ConnectorId;
        }
예제 #3
0
        /// <summary>
        /// Parse the given text representation of a BootNotification request.
        /// </summary>
        /// <param name="Text">The text to be parsed.</param>
        /// <param name="RequestId">The request identification.</param>
        /// <param name="ChargeBoxId">The charge box identification.</param>
        /// <param name="OnException">An optional delegate called whenever an exception occured.</param>
        public static BootNotificationRequest Parse(String Text,
                                                    Request_Id RequestId,
                                                    ChargeBox_Id ChargeBoxId,
                                                    OnExceptionDelegate OnException = null)
        {
            if (TryParse(Text,
                         RequestId,
                         ChargeBoxId,
                         out BootNotificationRequest bootNotificationRequest,
                         OnException))
            {
                return(bootNotificationRequest);
            }

            throw new ArgumentException("The given text representation of a BootNotification request is invalid!", nameof(Text));
        }
예제 #4
0
        /// <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)

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

        {
            this.ConnectorId  = ConnectorId;
            this.Availability = Availability;
        }
        /// <summary>
        /// Parse the given text representation of a ReserveNow request.
        /// </summary>
        /// <param name="Text">The text to be parsed.</param>
        /// <param name="RequestId">The request identification.</param>
        /// <param name="ChargeBoxId">The charge box identification.</param>
        /// <param name="OnException">An optional delegate called whenever an exception occured.</param>
        public static ReserveNowRequest Parse(String Text,
                                              Request_Id RequestId,
                                              ChargeBox_Id ChargeBoxId,
                                              OnExceptionDelegate OnException = null)
        {
            if (TryParse(Text,
                         RequestId,
                         ChargeBoxId,
                         out ReserveNowRequest reserveNowRequest,
                         OnException))
            {
                return(reserveNowRequest);
            }

            throw new ArgumentException("The given text representation of a ReserveNow request is invalid!", nameof(Text));
        }
예제 #6
0
        /// <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)

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

        {
            this.RequestedMessage = RequestedMessage;
            this.ConnectorId      = ConnectorId;
        }
예제 #7
0
        /// <summary>
        /// Parse the given text representation of a UpdateFirmware request.
        /// </summary>
        /// <param name="Text">The text to be parsed.</param>
        /// <param name="RequestId">The request identification.</param>
        /// <param name="ChargeBoxId">The charge box identification.</param>
        /// <param name="OnException">An optional delegate called whenever an exception occured.</param>
        public static UpdateFirmwareRequest Parse(String Text,
                                                  Request_Id RequestId,
                                                  ChargeBox_Id ChargeBoxId,
                                                  OnExceptionDelegate OnException = null)
        {
            if (TryParse(Text,
                         RequestId,
                         ChargeBoxId,
                         out UpdateFirmwareRequest updateFirmwareRequest,
                         OnException))
            {
                return(updateFirmwareRequest);
            }

            throw new ArgumentException("The given text representation of a UpdateFirmware request is invalid!", nameof(Text));
        }
        /// <summary>
        /// Parse the given text representation of a ClearChargingProfile request.
        /// </summary>
        /// <param name="Text">The text to be parsed.</param>
        /// <param name="RequestId">The request identification.</param>
        /// <param name="ChargeBoxId">The charge box identification.</param>
        /// <param name="OnException">An optional delegate called whenever an exception occured.</param>
        public static ClearChargingProfileRequest Parse(String Text,
                                                        Request_Id RequestId,
                                                        ChargeBox_Id ChargeBoxId,
                                                        OnExceptionDelegate OnException = null)
        {
            if (TryParse(Text,
                         RequestId,
                         ChargeBoxId,
                         out ClearChargingProfileRequest clearChargingProfileRequest,
                         OnException))
            {
                return(clearChargingProfileRequest);
            }

            throw new ArgumentException("The given text representation of a ClearChargingProfile request is invalid!", nameof(Text));
        }
예제 #9
0
        // <soap:Envelope xmlns:soap = "http://www.w3.org/2003/05/soap-envelope"
        //                xmlns:wsa  = "http://www.w3.org/2005/08/addressing"
        //                xmlns:ns   = "urn://Ocpp/Cp/2015/10/">
        //
        //    <soap:Header>
        //       ...
        //    </soap:Header>
        //
        //    <soap:Body>
        //       <ns:sendLocalListRequest>
        //
        //          <ns:listVersion>?</ns:listVersion>
        //
        //          <!--Zero or more repetitions:-->
        //          <ns:localAuthorizationList>
        //
        //             <ns:idTag>?</ns:idTag>
        //
        //             <!--Optional:-->
        //             <ns:idTagInfo>
        //
        //                <ns:status>?</ns:status>
        //
        //                <!--Optional:-->
        //                <ns:expiryDate>?</ns:expiryDate>
        //
        //                <!--Optional:-->
        //                <ns:parentIdTag>?</ns:parentIdTag>
        //
        //             </ns:idTagInfo>
        //
        //          </ns:localAuthorizationList>
        //
        //          <ns:updateType>?</ns:updateType>
        //
        //       </ns:sendLocalListRequest>
        //    </soap:Body>
        //
        // </soap:Envelope>

        // {
        //     "$schema": "http://json-schema.org/draft-04/schema#",
        //     "id":      "urn:OCPP:1.6:2019:12:SendLocalListRequest",
        //     "title":   "SendLocalListRequest",
        //     "type":    "object",
        //     "properties": {
        //         "listVersion": {
        //             "type": "integer"
        //         },
        //         "localAuthorizationList": {
        //             "type": "array",
        //             "items": {
        //                 "type": "object",
        //                 "properties": {
        //                     "idTag": {
        //                         "type": "string",
        //                         "maxLength": 20
        //                     },
        //                     "idTagInfo": {
        //                         "type": "object",
        //                         "properties": {
        //                             "expiryDate": {
        //                                 "type": "string",
        //                                 "format": "date-time"
        //                             },
        //                             "parentIdTag": {
        //                                 "type": "string",
        //                                 "maxLength": 20
        //                             },
        //                             "status": {
        //                                 "type": "string",
        //                                 "additionalProperties": false,
        //                                 "enum": [
        //                                     "Accepted",
        //                                     "Blocked",
        //                                     "Expired",
        //                                     "Invalid",
        //                                     "ConcurrentTx"
        //                                 ]
        //                             }
        //                         },
        //                         "additionalProperties": false,
        //                         "required": [
        //                             "status"
        //                         ]
        //                     }
        //                 },
        //                 "additionalProperties": false,
        //                 "required": [
        //                     "idTag"
        //                 ]
        //             }
        //         },
        //         "updateType": {
        //             "type": "string",
        //             "additionalProperties": false,
        //             "enum": [
        //                 "Differential",
        //                 "Full"
        //             ]
        //         }
        //     },
        //     "additionalProperties": false,
        //     "required": [
        //         "listVersion",
        //         "updateType"
        //     ]
        // }

        #endregion

        #region (static) Parse   (XML,  RequestId, ChargeBoxId, OnException = null)

        /// <summary>
        /// Parse the given XML representation of a SendLocalList request.
        /// </summary>
        /// <param name="XML">The XML to be parsed.</param>
        /// <param name="RequestId">The request identification.</param>
        /// <param name="ChargeBoxId">The charge box identification.</param>
        /// <param name="OnException">An optional delegate called whenever an exception occured.</param>
        public static SendLocalListRequest Parse(XElement XML,
                                                 Request_Id RequestId,
                                                 ChargeBox_Id ChargeBoxId,
                                                 OnExceptionDelegate OnException = null)
        {
            if (TryParse(XML,
                         RequestId,
                         ChargeBoxId,
                         out SendLocalListRequest sendLocalListRequest,
                         OnException))
            {
                return(sendLocalListRequest);
            }

            throw new ArgumentException("The given XML representation of a SendLocalList request is invalid!", nameof(XML));
        }
예제 #10
0
        /// <summary>
        /// Parse the given text representation of a SendLocalList request.
        /// </summary>
        /// <param name="Text">The text to be parsed.</param>
        /// <param name="RequestId">The request identification.</param>
        /// <param name="ChargeBoxId">The charge box identification.</param>
        /// <param name="OnException">An optional delegate called whenever an exception occured.</param>
        public static SendLocalListRequest Parse(String Text,
                                                 Request_Id RequestId,
                                                 ChargeBox_Id ChargeBoxId,
                                                 OnExceptionDelegate OnException = null)
        {
            if (TryParse(Text,
                         RequestId,
                         ChargeBoxId,
                         out SendLocalListRequest sendLocalListRequest,
                         OnException))
            {
                return(sendLocalListRequest);
            }

            return(null);
        }
        // <soap:Envelope xmlns:soap = "http://www.w3.org/2003/05/soap-envelope"
        //                xmlns:wsa  = "http://www.w3.org/2005/08/addressing"
        //                xmlns:ns   = "urn://Ocpp/Cp/2015/10/">
        //
        //    <soap:Header>
        //       ...
        //    </soap:Header>
        //
        //    <soap:Body>
        //       <ns:remoteStartTransactionRequest>
        //
        //          <!--Optional:-->
        //          <ns:connectorId>?</ns:connectorId>
        //
        //          <ns:idTag>?</ns:idTag>
        //
        //          <!--Optional:-->
        //          <ns:chargingProfile>
        //
        //             <ns:chargingProfileId>?</ns:chargingProfileId>
        //
        //             <!--Optional:-->
        //             <ns:transactionId>?</ns:transactionId>
        //
        //             <ns:stackLevel>?</ns:stackLevel>
        //             <ns:chargingProfilePurpose>?</ns:chargingProfilePurpose>
        //             <ns:chargingProfileKind>?</ns:chargingProfileKind>
        //
        //             <!--Optional:-->
        //             <ns:recurrencyKind>?</ns:recurrencyKind>
        //
        //             <!--Optional:-->
        //             <ns:validFrom>?</ns:validFrom>
        //
        //             <!--Optional:-->
        //             <ns:validTo>?</ns:validTo>
        //
        //             <ns:chargingSchedule>
        //
        //                <!--Optional:-->
        //                <ns:duration>?</ns:duration>
        //
        //                <!--Optional:-->
        //                <ns:startSchedule>?</ns:startSchedule>
        //                <ns:chargingRateUnit>?</ns:chargingRateUnit>
        //
        //                <!--1 or more repetitions:-->
        //                <ns:chargingSchedulePeriod>
        //
        //                   <ns:startPeriod>?</ns:startPeriod>
        //                   <ns:limit>?</ns:limit>
        //
        //                   <!--Optional:-->
        //                   <ns:numberPhases>?</ns:numberPhases>
        //
        //                </ns:chargingSchedulePeriod>
        //
        //                <!--Optional:-->
        //                <ns:minChargingRate>?</ns:minChargingRate>
        //
        //             </ns:chargingSchedule>
        //          </ns:chargingProfile>
        //
        //       </ns:remoteStartTransactionRequest>
        //    </soap:Body>
        //
        // </soap:Envelope>

        // {
        //     "$schema": "http://json-schema.org/draft-04/schema#",
        //     "id":      "urn:OCPP:1.6:2019:12:RemoteStartTransactionRequest",
        //     "title":   "RemoteStartTransactionRequest",
        //     "type":    "object",
        //     "properties": {
        //         "connectorId": {
        //             "type": "integer"
        //         },
        //         "idTag": {
        //             "type": "string",
        //             "maxLength": 20
        //         },
        //         "chargingProfile": {
        //             "type": "object",
        //             "properties": {
        //                 "chargingProfileId": {
        //                     "type": "integer"
        //                 },
        //                 "transactionId": {
        //                     "type": "integer"
        //                 },
        //                 "stackLevel": {
        //                     "type": "integer"
        //                 },
        //                 "chargingProfilePurpose": {
        //                     "type": "string",
        //                     "additionalProperties": false,
        //                     "enum": [
        //                         "ChargePointMaxProfile",
        //                         "TxDefaultProfile",
        //                         "TxProfile"
        //                     ]
        //                 },
        //                 "chargingProfileKind": {
        //                     "type": "string",
        //                     "additionalProperties": false,
        //                     "enum": [
        //                         "Absolute",
        //                         "Recurring",
        //                         "Relative"
        //                     ]
        //                 },
        //                 "recurrencyKind": {
        //                     "type": "string",
        //                     "additionalProperties": false,
        //                     "enum": [
        //                         "Daily",
        //                         "Weekly"
        //                     ]
        //                 },
        //                 "validFrom": {
        //                     "type": "string",
        //                     "format": "date-time"
        //                 },
        //                 "validTo": {
        //                     "type": "string",
        //                     "format": "date-time"
        //                 },
        //                 "chargingSchedule": {
        //                     "type": "object",
        //                     "properties": {
        //                         "duration": {
        //                             "type": "integer"
        //                         },
        //                         "startSchedule": {
        //                             "type": "string",
        //                             "format": "date-time"
        //                         },
        //                         "chargingRateUnit": {
        //                             "type": "string",
        //                             "additionalProperties": false,
        //                             "enum": [
        //                                 "A",
        //                                 "W"
        //                             ]
        //                         },
        //                         "chargingSchedulePeriod": {
        //                             "type": "array",
        //                             "items": {
        //                                 "type": "object",
        //                                 "properties": {
        //                                     "startPeriod": {
        //                                         "type": "integer"
        //                                     },
        //                                     "limit": {
        //                                         "type": "number",
        //                                         "multipleOf" : 0.1
        //                                     },
        //                                     "numberPhases": {
        //                                         "type": "integer"
        //                                     }
        //                                 },
        //                                 "additionalProperties": false,
        //                                 "required": [
        //                                     "startPeriod",
        //                                     "limit"
        //                                 ]
        //                             }
        //                         },
        //                         "minChargingRate": {
        //                             "type": "number",
        //                             "multipleOf" : 0.1
        //                         }
        //                     },
        //                     "additionalProperties": false,
        //                     "required": [
        //                         "chargingRateUnit",
        //                         "chargingSchedulePeriod"
        //                     ]
        //                 }
        //             },
        //             "additionalProperties": false,
        //             "required": [
        //                 "chargingProfileId",
        //                 "stackLevel",
        //                 "chargingProfilePurpose",
        //                 "chargingProfileKind",
        //                 "chargingSchedule"
        //             ]
        //         }
        //     },
        //     "additionalProperties": false,
        //     "required": [
        //         "idTag"
        //     ]
        // }

        #endregion

        #region (static) Parse   (XML,  RequestId, ChargeBoxId, OnException = null)

        /// <summary>
        /// Parse the given XML representation of a RemoteStartTransaction request.
        /// </summary>
        /// <param name="XML">The XML to be parsed.</param>
        /// <param name="RequestId">The request identification.</param>
        /// <param name="ChargeBoxId">The charge box identification.</param>
        /// <param name="OnException">An optional delegate called whenever an exception occured.</param>
        public static RemoteStartTransactionRequest Parse(XElement XML,
                                                          Request_Id RequestId,
                                                          ChargeBox_Id ChargeBoxId,
                                                          OnExceptionDelegate OnException = null)
        {
            if (TryParse(XML,
                         RequestId,
                         ChargeBoxId,
                         out RemoteStartTransactionRequest remoteStartTransactionRequest,
                         OnException))
            {
                return(remoteStartTransactionRequest);
            }

            throw new ArgumentException("The given XML representation of a RemoteStartTransaction request is invalid!", nameof(XML));
        }
예제 #12
0
        /// <summary>
        /// Create a new RemoteStopTransaction request.
        /// </summary>
        /// <param name="ChargeBoxId">The charge box identification.</param>
        /// <param name="TransactionId">The identification of the transaction which the charge point is requested to stop.</param>
        ///
        /// <param name="RequestId">An optional request identification.</param>
        /// <param name="RequestTimestamp">An optional request timestamp.</param>
        public RemoteStopTransactionRequest(ChargeBox_Id ChargeBoxId,
                                            Transaction_Id TransactionId,

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

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

        {
            this.TransactionId = TransactionId;
        }
        /// <summary>
        /// Create a CancelReservation request.
        /// </summary>
        /// <param name="ChargeBoxId">The charge box identification.</param>
        /// <param name="ReservationId">The unique identification of this reservation.</param>
        ///
        /// <param name="RequestId">An optional request identification.</param>
        /// <param name="RequestTimestamp">An optional request timestamp.</param>
        public CancelReservationRequest(ChargeBox_Id ChargeBoxId,
                                        Reservation_Id ReservationId,

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

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

        {
            this.ReservationId = ReservationId;
        }
        // <soap:Envelope xmlns:soap = "http://www.w3.org/2003/05/soap-envelope"
        //                xmlns:wsa  = "http://www.w3.org/2005/08/addressing"
        //                xmlns:ns   = "urn://Ocpp/Cp/2015/10/">
        //
        //    <soap:Header>
        //       ...
        //    </soap:Header>
        //
        //    <soap:Body>
        //       <ns:cancelReservationRequest>
        //
        //          <ns:reservationId>?</ns:reservationId>
        //
        //       </ns:cancelReservationRequest>
        //    </soap:Body>
        //
        // </soap:Envelope>

        // {
        //     "$schema": "http://json-schema.org/draft-04/schema#",
        //     "id":      "urn:OCPP:1.6:2019:12:CancelReservationRequest",
        //     "title":   "CancelReservationRequest",
        //     "type":    "object",
        //     "properties": {
        //         "reservationId": {
        //             "type": "integer"
        //         }
        //     },
        //     "additionalProperties": false,
        //     "required": [
        //         "reservationId"
        //     ]
        // }

        #endregion

        #region (static) Parse   (XML,  RequestId, ChargeBoxId, OnException = null)

        /// <summary>
        /// Parse the given XML representation of a CancelReservation request.
        /// </summary>
        /// <param name="XML">The XML to be parsed.</param>
        /// <param name="RequestId">The request identification.</param>
        /// <param name="ChargeBoxId">The charge box identification.</param>
        /// <param name="OnException">An optional delegate called whenever an exception occured.</param>
        public static CancelReservationRequest Parse(XElement XML,
                                                     Request_Id RequestId,
                                                     ChargeBox_Id ChargeBoxId,
                                                     OnExceptionDelegate OnException = null)
        {
            if (TryParse(XML,
                         RequestId,
                         ChargeBoxId,
                         out CancelReservationRequest cancelReservationRequest,
                         OnException))
            {
                return(cancelReservationRequest);
            }

            throw new ArgumentException("The given XML representation of a CancelReservation request is invalid!", nameof(XML));
        }
예제 #15
0
        /// <summary>
        /// Parse the given text representation of a GetCompositeSchedule request.
        /// </summary>
        /// <param name="Text">The text to be parsed.</param>
        /// <param name="RequestId">The request identification.</param>
        /// <param name="ChargeBoxId">The charge box identification.</param>
        /// <param name="OnException">An optional delegate called whenever an exception occured.</param>
        public static GetCompositeScheduleRequest Parse(String Text,
                                                        Request_Id RequestId,
                                                        ChargeBox_Id ChargeBoxId,
                                                        OnExceptionDelegate OnException = null)
        {
            if (TryParse(Text,
                         RequestId,
                         ChargeBoxId,
                         out GetCompositeScheduleRequest getCompositeScheduleRequest,
                         OnException))
            {
                return(getCompositeScheduleRequest);
            }

            throw new ArgumentException("The given text representation of a GetCompositeSchedule request is invalid!", nameof(Text));
        }
        // <soap:Envelope xmlns:soap = "http://www.w3.org/2003/05/soap-envelope"
        //                xmlns:wsa  = "http://www.w3.org/2005/08/addressing"
        //                xmlns:ns   = "urn://Ocpp/Cp/2015/10/">
        //
        //    <soap:Header>
        //       ...
        //    </soap:Header>
        //
        //    <soap:Body>
        //       <ns:changeAvailabilityRequest>
        //
        //          <ns:connectorId>?</ns:connectorId>
        //          <ns:type>?</ns:type>
        //
        //       </ns:changeAvailabilityRequest>
        //    </soap:Body>
        //
        // </soap:Envelope>

        // {
        //     "$schema": "http://json-schema.org/draft-04/schema#",
        //     "id":      "urn:OCPP:1.6:2019:12:ChangeAvailabilityRequest",
        //     "title":   "ChangeAvailabilityRequest",
        //     "type":    "object",
        //     "properties": {
        //         "connectorId": {
        //             "type": "integer"
        //         },
        //         "type": {
        //             "type": "string",
        //             "additionalProperties": false,
        //             "enum": [
        //                 "Inoperative",
        //                 "Operative"
        //             ]
        //         }
        //     },
        //     "additionalProperties": false,
        //     "required": [
        //         "connectorId",
        //         "type"
        //     ]
        // }

        #endregion

        #region (static) Parse   (XML,  RequestId, ChargeBoxId, OnException = null)

        /// <summary>
        /// Parse the given XML representation of a ChangeAvailability request.
        /// </summary>
        /// <param name="XML">The XML to be parsed.</param>
        /// <param name="RequestId">The request identification.</param>
        /// <param name="ChargeBoxId">The charge box identification.</param>
        /// <param name="OnException">An optional delegate called whenever an exception occured.</param>
        public static ChangeAvailabilityRequest Parse(XElement XML,
                                                      Request_Id RequestId,
                                                      ChargeBox_Id ChargeBoxId,
                                                      OnExceptionDelegate OnException = null)
        {
            if (TryParse(XML,
                         RequestId,
                         ChargeBoxId,
                         out ChangeAvailabilityRequest changeAvailabilityRequest,
                         OnException))
            {
                return(changeAvailabilityRequest);
            }

            throw new ArgumentException("The given XML representation of a ChangeAvailability request is invalid!", nameof(XML));
        }
예제 #17
0
        /// <summary>
        /// Parse the given text representation of a TriggerMessage request.
        /// </summary>
        /// <param name="Text">The text to be parsed.</param>
        /// <param name="RequestId">The request identification.</param>
        /// <param name="ChargeBoxId">The charge box identification.</param>
        /// <param name="OnException">An optional delegate called whenever an exception occured.</param>
        public static TriggerMessageRequest Parse(String Text,
                                                  Request_Id RequestId,
                                                  ChargeBox_Id ChargeBoxId,
                                                  OnExceptionDelegate OnException = null)
        {
            if (TryParse(Text,
                         RequestId,
                         ChargeBoxId,
                         out TriggerMessageRequest triggerMessageRequest,
                         OnException))
            {
                return(triggerMessageRequest);
            }

            throw new ArgumentException("The given text representation of a TriggerMessage request is invalid!", nameof(Text));
        }
예제 #18
0
        // <soap:Envelope xmlns:soap = "http://www.w3.org/2003/05/soap-envelope"
        //                xmlns:wsa  = "http://www.w3.org/2005/08/addressing"
        //                xmlns:ns   = "urn://Ocpp/Cp/2015/10/">
        //
        //    <soap:Header>
        //       ...
        //    </soap:Header>
        //
        //    <soap:Body>
        //       <ns:getDiagnosticsRequest>
        //
        //          <ns:location>?</ns:location>
        //
        //          <!--Optional:-->
        //          <ns:startTime>?</ns:startTime>
        //
        //          <!--Optional:-->
        //          <ns:stopTime>?</ns:stopTime>
        //
        //          <!--Optional:-->
        //          <ns:retries>?</ns:retries>
        //
        //          <!--Optional:-->
        //          <ns:retryInterval>?</ns:retryInterval>
        //
        //       </ns:getDiagnosticsRequest>
        //    </soap:Body>
        //
        // </soap:Envelope>

        // {
        //     "$schema": "http://json-schema.org/draft-04/schema#",
        //     "id":      "urn:OCPP:1.6:2019:12:GetDiagnosticsRequest",
        //     "title":   "GetDiagnosticsRequest",
        //     "type":    "object",
        //     "properties": {
        //         "location": {
        //             "type": "string",
        //             "format": "uri"
        //         },
        //         "retries": {
        //             "type": "integer"
        //         },
        //         "retryInterval": {
        //             "type": "integer"
        //         },
        //         "startTime": {
        //             "type": "string",
        //             "format": "date-time"
        //         },
        //         "stopTime": {
        //             "type": "string",
        //             "format": "date-time"
        //         }
        //     },
        //     "additionalProperties": false,
        //     "required": [
        //         "location"
        //     ]
        // }

        #endregion

        #region (static) Parse   (XML,  RequestId, ChargeBoxId, OnException = null)

        /// <summary>
        /// Parse the given XML representation of a GetDiagnostics request.
        /// </summary>
        /// <param name="XML">The XML to be parsed.</param>
        /// <param name="RequestId">The request identification.</param>
        /// <param name="ChargeBoxId">The charge box identification.</param>
        /// <param name="OnException">An optional delegate called whenever an exception occured.</param>
        public static GetDiagnosticsRequest Parse(XElement XML,
                                                  Request_Id RequestId,
                                                  ChargeBox_Id ChargeBoxId,
                                                  OnExceptionDelegate OnException = null)
        {
            if (TryParse(XML,
                         RequestId,
                         ChargeBoxId,
                         out GetDiagnosticsRequest getDiagnosticsRequest,
                         OnException))
            {
                return(getDiagnosticsRequest);
            }

            throw new ArgumentException("The given XML representation of a GetDiagnostics request is invalid!", nameof(XML));
        }
        /// <summary>
        /// Parse the given text representation of a DataTransfer request.
        /// </summary>
        /// <param name="Text">The text to be parsed.</param>
        /// <param name="RequestId">The request identification.</param>
        /// <param name="ChargeBoxId">The charge box identification.</param>
        /// <param name="OnException">An optional delegate called whenever an exception occured.</param>
        public static DataTransferRequest Parse(String Text,
                                                Request_Id RequestId,
                                                ChargeBox_Id ChargeBoxId,
                                                OnExceptionDelegate OnException = null)
        {
            if (TryParse(Text,
                         RequestId,
                         ChargeBoxId,
                         out DataTransferRequest dataTransferRequest,
                         OnException))
            {
                return(dataTransferRequest);
            }

            throw new ArgumentException("The given text representation of a DataTransfer request is invalid!", nameof(Text));
        }
        // <soap:Envelope xmlns:soap = "http://www.w3.org/2003/05/soap-envelope"
        //                xmlns:wsa  = "http://www.w3.org/2005/08/addressing"
        //                xmlns:ns   = "urn://Ocpp/Cs/2015/10/">
        //
        //    <soap:Header>
        //       ...
        //    </soap:Header>
        //
        //    <soap:Body>
        //       <ns:authorizeRequest>
        //
        //          <ns:idTag>?</ns:idTag>
        //
        //       </ns:authorizeRequest>
        //    </soap:Body>
        //
        // </soap:Envelope>

        // {
        //     "$schema":  "http://json-schema.org/draft-04/schema#",
        //     "id":       "urn:OCPP:1.6:2019:12:AuthorizeRequest",
        //     "title":    "AuthorizeRequest",
        //     "type":     "object",
        //     "properties": {
        //         "idTag": {
        //             "type":      "string",
        //             "maxLength":  20
        //         }
        //     },
        //     "additionalProperties": false,
        //     "required": [
        //         "idTag"
        //     ]
        // }

        #endregion

        #region (static) Parse   (XML,  RequestId, ChargeBoxId, OnException = null)

        /// <summary>
        /// Parse the given XML representation of an Authorize request.
        /// </summary>
        /// <param name="XML">The XML to be parsed.</param>
        /// <param name="RequestId">The request identification.</param>
        /// <param name="ChargeBoxId">The charge box identification.</param>
        /// <param name="OnException">An optional delegate called whenever an exception occured.</param>
        public static AuthorizeRequest Parse(XElement XML,
                                             Request_Id RequestId,
                                             ChargeBox_Id ChargeBoxId,
                                             OnExceptionDelegate OnException = null)
        {
            if (TryParse(XML,
                         RequestId,
                         ChargeBoxId,
                         out AuthorizeRequest authorizeRequest,
                         OnException))
            {
                return(authorizeRequest);
            }

            throw new ArgumentException("The given XML representation of an Authorize request is invalid!", nameof(XML));
        }
예제 #21
0
        /// <summary>
        /// Parse the given text representation of a FirmwareStatusNotification request.
        /// </summary>
        /// <param name="Text">The text to be parsed.</param>
        /// <param name="RequestId">The request identification.</param>
        /// <param name="ChargeBoxId">The charge box identification.</param>
        /// <param name="OnException">An optional delegate called whenever an exception occured.</param>
        public static FirmwareStatusNotificationRequest Parse(String Text,
                                                              Request_Id RequestId,
                                                              ChargeBox_Id ChargeBoxId,
                                                              OnExceptionDelegate OnException = null)
        {
            if (TryParse(Text,
                         RequestId,
                         ChargeBoxId,
                         out FirmwareStatusNotificationRequest diagnosticsStatusNotificationRequest,
                         OnException))
            {
                return(diagnosticsStatusNotificationRequest);
            }

            throw new ArgumentException("The given text representation of an AuthorizeRequest request is invalid!", nameof(Text));
        }
예제 #22
0
        // <soap:Envelope xmlns:soap = "http://www.w3.org/2003/05/soap-envelope"
        //                xmlns:wsa  = "http://www.w3.org/2005/08/addressing"
        //                xmlns:ns   = "urn://Ocpp/Cs/2015/10/">
        //
        //    <soap:Header>
        //       ...
        //    </soap:Header>
        //
        //    <soap:Body>
        //       <ns:firmwareStatusNotificationRequest>
        //
        //          <ns:status>?</ns:status>
        //
        //       </ns:firmwareStatusNotificationRequest>
        //    </soap:Body>
        //
        // </soap:Envelope>

        // {
        //     "$schema": "http://json-schema.org/draft-04/schema#",
        //     "id":      "urn:OCPP:1.6:2019:12:FirmwareStatusStatusNotificationRequest",
        //     "title":   "FirmwareStatusStatusNotificationRequest",
        //     "type":    "object",
        //     "properties": {
        //         "status": {
        //             "type": "string",
        //             "additionalProperties": false,
        //             "enum": [
        //                 "Downloaded",
        //                 "DownloadFailed",
        //                 "Downloading",
        //                 "Idle",
        //                 "InstallationFailed",
        //                 "Installing",
        //                 "Installed"
        //             ]
        //     }
        // },
        //     "additionalProperties": false,
        //     "required": [
        //         "status"
        //     ]
        // }


        #endregion

        #region (static) Parse   (XML,  RequestId, ChargeBoxId, OnException = null)

        /// <summary>
        /// Parse the given XML representation of a FirmwareStatusNotification request.
        /// </summary>
        /// <param name="XML">The XML to be parsed.</param>
        /// <param name="RequestId">The request identification.</param>
        /// <param name="ChargeBoxId">The charge box identification.</param>
        /// <param name="OnException">An optional delegate called whenever an exception occured.</param>
        public static FirmwareStatusNotificationRequest Parse(XElement XML,
                                                              Request_Id RequestId,
                                                              ChargeBox_Id ChargeBoxId,
                                                              OnExceptionDelegate OnException = null)
        {
            if (TryParse(XML,
                         RequestId,
                         ChargeBoxId,
                         out FirmwareStatusNotificationRequest diagnosticsStatusNotificationRequest,
                         OnException))
            {
                return(diagnosticsStatusNotificationRequest);
            }

            throw new ArgumentException("The given XML representation of a FirmwareStatusNotification request is invalid!", nameof(XML));
        }
        /// <summary>
        /// Parse the given text representation of a ChangeConfiguration request.
        /// </summary>
        /// <param name="Text">The text to be parsed.</param>
        /// <param name="RequestId">The request identification.</param>
        /// <param name="ChargeBoxId">The charge box identification.</param>
        /// <param name="OnException">An optional delegate called whenever an exception occured.</param>
        public static ChangeConfigurationRequest Parse(String Text,
                                                       Request_Id RequestId,
                                                       ChargeBox_Id ChargeBoxId,
                                                       OnExceptionDelegate OnException = null)
        {
            if (TryParse(Text,
                         RequestId,
                         ChargeBoxId,
                         out ChangeConfigurationRequest changeConfigurationRequest,
                         OnException))
            {
                return(changeConfigurationRequest);
            }

            throw new ArgumentException("The given text representation of a ChangeConfiguration request is invalid!", nameof(Text));
        }
예제 #24
0
        /// <summary>
        /// Parse the given JSON representation of a GetLocalListVersion request.
        /// </summary>
        /// <param name="JSON">The JSON to be parsed.</param>
        /// <param name="RequestId">The request identification.</param>
        /// <param name="ChargeBoxId">The charge box identification.</param>
        /// <param name="CustomGetLocalListVersionRequestParser">A delegate to parse custom GetLocalListVersion requests.</param>
        public static GetLocalListVersionRequest Parse(JObject JSON,
                                                       Request_Id RequestId,
                                                       ChargeBox_Id ChargeBoxId,
                                                       CustomJObjectParserDelegate <GetLocalListVersionRequest> CustomGetLocalListVersionRequestParser = null)
        {
            if (TryParse(JSON,
                         RequestId,
                         ChargeBoxId,
                         out GetLocalListVersionRequest getLocalListVersionRequest,
                         out String ErrorResponse,
                         CustomGetLocalListVersionRequestParser))
            {
                return(getLocalListVersionRequest);
            }

            throw new ArgumentException("The given JSON representation of a GetLocalListVersion request is invalid: " + ErrorResponse, nameof(JSON));
        }
        /// <summary>
        /// Parse the given JSON representation of a TriggerMessage request.
        /// </summary>
        /// <param name="JSON">The JSON to be parsed.</param>
        /// <param name="RequestId">The request identification.</param>
        /// <param name="ChargeBoxId">The charge box identification.</param>
        /// <param name="CustomTriggerMessageRequestParser">A delegate to parse custom TriggerMessage requests.</param>
        public static TriggerMessageRequest Parse(JObject JSON,
                                                  Request_Id RequestId,
                                                  ChargeBox_Id ChargeBoxId,
                                                  CustomJObjectParserDelegate <TriggerMessageRequest> CustomTriggerMessageRequestParser = null)
        {
            if (TryParse(JSON,
                         RequestId,
                         ChargeBoxId,
                         out TriggerMessageRequest triggerMessageRequest,
                         out String ErrorResponse,
                         CustomTriggerMessageRequestParser))
            {
                return(triggerMessageRequest);
            }

            throw new ArgumentException("The given JSON representation of a TriggerMessage request is invalid: " + ErrorResponse, nameof(JSON));
        }
예제 #26
0
        /// <summary>
        /// Parse the given JSON representation of a RemoteStartTransaction request.
        /// </summary>
        /// <param name="JSON">The JSON to be parsed.</param>
        /// <param name="RequestId">The request identification.</param>
        /// <param name="ChargeBoxId">The charge box identification.</param>
        /// <param name="CustomRemoteStartTransactionRequestParser">A delegate to parse custom RemoteStartTransaction requests.</param>
        public static RemoteStartTransactionRequest Parse(JObject JSON,
                                                          Request_Id RequestId,
                                                          ChargeBox_Id ChargeBoxId,
                                                          CustomJObjectParserDelegate <RemoteStartTransactionRequest> CustomRemoteStartTransactionRequestParser = null)
        {
            if (TryParse(JSON,
                         RequestId,
                         ChargeBoxId,
                         out RemoteStartTransactionRequest remoteStartTransactionRequest,
                         out String ErrorResponse,
                         CustomRemoteStartTransactionRequestParser))
            {
                return(remoteStartTransactionRequest);
            }

            throw new ArgumentException("The given JSON representation of a RemoteStartTransaction request is invalid: " + ErrorResponse, nameof(JSON));
        }
예제 #27
0
        /// <summary>
        /// Parse the given JSON representation of an UnlockConnector request.
        /// </summary>
        /// <param name="JSON">The JSON to be parsed.</param>
        /// <param name="RequestId">The request identification.</param>
        /// <param name="ChargeBoxId">The charge box identification.</param>
        /// <param name="CustomUnlockConnectorRequestParser">A delegate to parse custom UnlockConnector requests.</param>
        public static UnlockConnectorRequest Parse(JObject JSON,
                                                   Request_Id RequestId,
                                                   ChargeBox_Id ChargeBoxId,
                                                   CustomJObjectParserDelegate <UnlockConnectorRequest> CustomUnlockConnectorRequestParser = null)
        {
            if (TryParse(JSON,
                         RequestId,
                         ChargeBoxId,
                         out UnlockConnectorRequest unlockConnectorRequest,
                         out String ErrorResponse,
                         CustomUnlockConnectorRequestParser))
            {
                return(unlockConnectorRequest);
            }

            throw new ArgumentException("The given JSON representation of an UnlockConnector request is invalid: " + ErrorResponse, nameof(JSON));
        }
        /// <summary>
        /// Parse the given JSON representation of a DiagnosticsStatusNotification request.
        /// </summary>
        /// <param name="JSON">The JSON to be parsed.</param>
        /// <param name="RequestId">The request identification.</param>
        /// <param name="ChargeBoxId">The charge box identification.</param>
        /// <param name="CustomDiagnosticsStatusNotificationRequestParser">A delegate to parse custom DiagnosticsStatusNotification requests.</param>
        public static DiagnosticsStatusNotificationRequest Parse(JObject JSON,
                                                                 Request_Id RequestId,
                                                                 ChargeBox_Id ChargeBoxId,
                                                                 CustomJObjectParserDelegate <DiagnosticsStatusNotificationRequest> CustomDiagnosticsStatusNotificationRequestParser = null)
        {
            if (TryParse(JSON,
                         RequestId,
                         ChargeBoxId,
                         out DiagnosticsStatusNotificationRequest diagnosticsStatusNotificationRequest,
                         out String ErrorResponse,
                         CustomDiagnosticsStatusNotificationRequestParser))
            {
                return(diagnosticsStatusNotificationRequest);
            }

            throw new ArgumentException("The given JSON representation of a DiagnosticsStatusNotification request is invalid: " + ErrorResponse, nameof(JSON));
        }
예제 #29
0
        /// <summary>
        /// Parse the given JSON representation of a SetChargingProfile request.
        /// </summary>
        /// <param name="JSON">The JSON to be parsed.</param>
        /// <param name="RequestId">The request identification.</param>
        /// <param name="ChargeBoxId">The charge box identification.</param>
        /// <param name="CustomSetChargingProfileRequestParser">A delegate to parse custom SetChargingProfile requests.</param>
        public static SetChargingProfileRequest Parse(JObject JSON,
                                                      Request_Id RequestId,
                                                      ChargeBox_Id ChargeBoxId,
                                                      CustomJObjectParserDelegate <SetChargingProfileRequest> CustomSetChargingProfileRequestParser = null)
        {
            if (TryParse(JSON,
                         RequestId,
                         ChargeBoxId,
                         out SetChargingProfileRequest setChargingProfileRequest,
                         out String ErrorResponse,
                         CustomSetChargingProfileRequestParser))
            {
                return(setChargingProfileRequest);
            }

            throw new ArgumentException("The given JSON representation of a SetChargingProfile request is invalid: " + ErrorResponse, nameof(JSON));
        }
        /// <summary>
        /// Parse the given JSON representation of a ChangeConfiguration request.
        /// </summary>
        /// <param name="JSON">The JSON to be parsed.</param>
        /// <param name="RequestId">The request identification.</param>
        /// <param name="ChargeBoxId">The charge box identification.</param>
        /// <param name="CustomChangeConfigurationRequestParser">A delegate to parse custom ChangeConfiguration requests.</param>
        public static ChangeConfigurationRequest Parse(JObject JSON,
                                                       Request_Id RequestId,
                                                       ChargeBox_Id ChargeBoxId,
                                                       CustomJObjectParserDelegate <ChangeConfigurationRequest> CustomChangeConfigurationRequestParser = null)
        {
            if (TryParse(JSON,
                         RequestId,
                         ChargeBoxId,
                         out ChangeConfigurationRequest changeConfigurationRequest,
                         out String ErrorResponse,
                         CustomChangeConfigurationRequestParser))
            {
                return(changeConfigurationRequest);
            }

            throw new ArgumentException("The given JSON representation of a ChangeConfiguration request is invalid: " + ErrorResponse, nameof(JSON));
        }