/// <summary>
        /// Return the HashCode of this object.
        /// </summary>
        /// <returns>The HashCode of this object.</returns>
        public override Int32 GetHashCode()
        {
            unchecked
            {
                return(CDRNature.GetHashCode() * 41 ^
                       ServiceSessionId.GetHashCode() * 37 ^
                       RequestedServiceId.GetHashCode() * 31 ^
                       EVSEId.GetHashCode() * 27 ^
                       UserContractIdAlias.GetHashCode() * 23 ^
                       UserId.GetHashCode() * 21 ^
                       StartTime.GetHashCode() * 19 ^
                       EndTime.GetHashCode() * 17 ^
                       MeterReports.GetHashCode() * 13 ^

                       (ExecPartnerSessionId.HasValue
                            ? ExecPartnerSessionId.GetHashCode() * 11
                            : 0) ^

                       (ExecPartnerOperatorId.HasValue
                            ? ExecPartnerOperatorId.GetHashCode() * 7
                            : 0) ^

                       (SalesPartnerSessionId.HasValue
                            ? SalesPartnerSessionId.GetHashCode() * 5
                            : 0) ^

                       (SalesPartnerOperatorId.HasValue
                            ? SalesPartnerOperatorId.GetHashCode() * 3
                            : 0) ^

                       (PartnerProductId.HasValue
                            ? PartnerProductId.GetHashCode()
                            : 0));
            }
        }
        /// <summary>
        /// Return a JSON representation of this object.
        /// </summary>
        /// <param name="CustomChargingErrorNotificationRequestSerializer">A delegate to serialize custom time period JSON objects.</param>
        /// <param name="CustomIdentificationSerializer">A delegate to serialize custom Identification JSON elements.</param>
        public JObject ToJSON(CustomJObjectSerializerDelegate <ChargingErrorNotificationRequest> CustomChargingErrorNotificationRequestSerializer = null,
                              CustomJObjectSerializerDelegate <Identification> CustomIdentificationSerializer = null)
        {
            var JSON = JSONObject.Create(
                new JProperty("Type", Type.AsString()),
                new JProperty("SessionID", SessionId.ToString()),
                new JProperty("EvseID", EVSEId.ToString()),
                new JProperty("Identification", Identification.ToJSON(CustomIdentificationSerializer: CustomIdentificationSerializer)),
                new JProperty("ErrorType", ErrorType.AsString()),

                CPOPartnerSessionId.HasValue
                               ? new JProperty("CPOPartnerSessionID", CPOPartnerSessionId.Value.ToString())
                               : null,

                EMPPartnerSessionId.HasValue
                               ? new JProperty("EMPPartnerSessionID", EMPPartnerSessionId.Value.ToString())
                               : null,

                ErrorAdditionalInfo.IsNotNullOrEmpty()
                               ? new JProperty("ErrorAdditionalInfo", ErrorAdditionalInfo)
                               : null,

                CustomData != null
                               ? new JProperty("CustomData", CustomData)
                               : null

                );

            return(CustomChargingErrorNotificationRequestSerializer != null
                       ? CustomChargingErrorNotificationRequestSerializer(this, JSON)
                       : JSON);
        }
        /// <summary>
        /// Compares two charge detail recordes for equality.
        /// </summary>
        /// <param name="ChargeDetailRecord">An charge detail record to compare with.</param>
        /// <returns>True if both match; False otherwise.</returns>
        public Boolean Equals(ChargeDetailRecord ChargeDetailRecord)
        {
            if ((Object)ChargeDetailRecord == null)
            {
                return(false);
            }

            return(CDRNature.Equals(ChargeDetailRecord.CDRNature) &&
                   ServiceSessionId.Equals(ChargeDetailRecord.ServiceSessionId) &&
                   RequestedServiceId.Equals(ChargeDetailRecord.RequestedServiceId) &&
                   EVSEId.Equals(ChargeDetailRecord.EVSEId) &&
                   UserContractIdAlias.Equals(ChargeDetailRecord.UserContractIdAlias) &&
                   UserId.Equals(ChargeDetailRecord.UserId) &&
                   StartTime.Equals(ChargeDetailRecord.StartTime) &&
                   EndTime.Equals(ChargeDetailRecord.EndTime) &&
                   MeterReports.Equals(ChargeDetailRecord.MeterReports) &&

                   ((!ExecPartnerSessionId.HasValue && !ChargeDetailRecord.ExecPartnerSessionId.HasValue) ||
                    (ExecPartnerSessionId.HasValue && ChargeDetailRecord.ExecPartnerSessionId.HasValue && ExecPartnerSessionId.Value.Equals(ChargeDetailRecord.ExecPartnerSessionId.Value))) &&

                   ((!ExecPartnerOperatorId.HasValue && !ChargeDetailRecord.ExecPartnerOperatorId.HasValue) ||
                    (ExecPartnerOperatorId.HasValue && ChargeDetailRecord.ExecPartnerOperatorId.HasValue && ExecPartnerOperatorId.Value.Equals(ChargeDetailRecord.ExecPartnerOperatorId.Value))) &&

                   ((!SalesPartnerSessionId.HasValue && !ChargeDetailRecord.SalesPartnerSessionId.HasValue) ||
                    (SalesPartnerSessionId.HasValue && ChargeDetailRecord.SalesPartnerSessionId.HasValue && SalesPartnerSessionId.Value.Equals(ChargeDetailRecord.SalesPartnerSessionId.Value))) &&

                   ((!SalesPartnerOperatorId.HasValue && !ChargeDetailRecord.SalesPartnerOperatorId.HasValue) ||
                    (SalesPartnerOperatorId.HasValue && ChargeDetailRecord.SalesPartnerOperatorId.HasValue && SalesPartnerOperatorId.Value.Equals(ChargeDetailRecord.SalesPartnerOperatorId.Value))) &&

                   ((!PartnerProductId.HasValue && !ChargeDetailRecord.PartnerProductId.HasValue) ||
                    (PartnerProductId.HasValue && ChargeDetailRecord.PartnerProductId.HasValue && PartnerProductId.Value.Equals(ChargeDetailRecord.PartnerProductId.Value))));
        }
Esempio n. 4
0
        /// <summary>
        /// Return a XML representation of this object.
        /// </summary>
        /// <param name="CustomGetServiceAuthorisationRequestSerializer">A delegate to serialize custom set EVSE busy status request XML elements.</param>
        public XElement ToXML(CustomXMLSerializerDelegate <GetServiceAuthorisationRequest> CustomGetServiceAuthorisationRequestSerializer = null)
        {
            var XML = new XElement(eMIPNS.Authorisation + "eMIP_ToIOP_GetServiceAuthorisationRequest",

                                   TransactionId.HasValue
                              ? new XElement("transactionId", TransactionId.ToString())
                              : null,

                                   new XElement("partnerIdType", PartnerId.Format.AsText()),
                                   new XElement("partnerId", PartnerId.ToString()),

                                   new XElement("operatorIdType", OperatorId.Format.AsText()),
                                   new XElement("operatorId", OperatorId.ToString()),

                                   new XElement("EVSEIdType", EVSEId.Format.AsText()),
                                   new XElement("EVSEId", EVSEId.ToString()),

                                   new XElement("userIdType", UserId.Format.AsText()),
                                   new XElement("userId", UserId.ToString()),

                                   new XElement("requestedServiceId", RequestedServiceId.ToString()),

                                   PartnerServiceSessionId.HasValue
                              ? new XElement("partnerServiceSessionId", PartnerServiceSessionId.Value.ToString())
                              : null

                                   );


            return(CustomGetServiceAuthorisationRequestSerializer != null
                       ? CustomGetServiceAuthorisationRequestSerializer(this, XML)
                       : XML);
        }
Esempio n. 5
0
        /// <summary>
        /// Return the HashCode of this object.
        /// </summary>
        /// <returns>The HashCode of this object.</returns>
        public override Int32 GetHashCode()
        {
            unchecked
            {
                return(OperatorId.GetHashCode() * 13 ^
                       Identification.GetHashCode() * 11 ^

                       (EVSEId != null
                            ? EVSEId.GetHashCode() * 9
                            : 0) ^

                       (PartnerProductId != null
                            ? PartnerProductId.GetHashCode() * 7
                            : 0) ^

                       (SessionId != null
                            ? SessionId.GetHashCode() * 5
                            : 0) ^

                       (CPOPartnerSessionId != null
                            ? CPOPartnerSessionId.GetHashCode() * 3
                            : 0) ^

                       (EMPPartnerSessionId != null
                            ? EMPPartnerSessionId.GetHashCode()
                            : 0));
            }
        }
        /// <summary>
        /// Return a XML representation of this object.
        /// </summary>
        /// <param name="CustomSetEVSEBusyStatusRequestSerializer">A delegate to serialize custom set EVSE busy status request XML elements.</param>
        public XElement ToXML(CustomXMLSerializerDelegate <SetEVSEBusyStatusRequest> CustomSetEVSEBusyStatusRequestSerializer = null)
        {
            var XML = new XElement(eMIPNS.EVCIDynamic + "eMIP_ToIOP_SetEVSEBusyStatusRequest",

                                   TransactionId.HasValue
                              ? new XElement("transactionId", TransactionId.ToString())
                              : null,

                                   new XElement("partnerIdType", PartnerId.Format.AsText()),
                                   new XElement("partnerId", PartnerId.ToString()),

                                   new XElement("operatorIdType", OperatorId.Format.AsText()),
                                   new XElement("operatorId", OperatorId.ToString()),

                                   new XElement("EVSEIdType", EVSEId.Format.AsText()),
                                   new XElement("EVSEId", EVSEId.ToString()),

                                   new XElement("statusEventDate", StatusEventDate.ToIso8601(false).Replace("Z", "")),
                                   new XElement("busyStatus", BusyStatus.AsNumber()),

                                   BusyStatusUntil.HasValue
                              ? new XElement("busyStatusUntil", BusyStatusUntil.Value.ToIso8601(false).Replace("Z", ""))
                              : null,

                                   BusyStatusComment.IsNeitherNullNorEmpty()
                              ? new XElement("busyStatusComment", BusyStatusComment)
                              : null

                                   );


            return(CustomSetEVSEBusyStatusRequestSerializer != null
                       ? CustomSetEVSEBusyStatusRequestSerializer(this, XML)
                       : XML);
        }
        /// <summary>
        /// Compares two authorize remote reservation start requests for equality.
        /// </summary>
        /// <param name="AuthorizeRemoteReservationStartRequest">An authorize remote reservation start request to compare with.</param>
        /// <returns>True if both match; False otherwise.</returns>
        public override Boolean Equals(AuthorizeRemoteReservationStartRequest AuthorizeRemoteReservationStartRequest)
        {
            if (AuthorizeRemoteReservationStartRequest is null)
            {
                return(false);
            }

            return(ProviderId.Equals(AuthorizeRemoteReservationStartRequest.ProviderId) &&
                   EVSEId.Equals(AuthorizeRemoteReservationStartRequest.EVSEId) &&
                   Identification.Equals(AuthorizeRemoteReservationStartRequest.Identification) &&

                   ((!SessionId.HasValue && !AuthorizeRemoteReservationStartRequest.SessionId.HasValue) ||
                    (SessionId.HasValue && AuthorizeRemoteReservationStartRequest.SessionId.HasValue && SessionId.Value.Equals(AuthorizeRemoteReservationStartRequest.SessionId.Value))) &&

                   ((!CPOPartnerSessionId.HasValue && !AuthorizeRemoteReservationStartRequest.CPOPartnerSessionId.HasValue) ||
                    (CPOPartnerSessionId.HasValue && AuthorizeRemoteReservationStartRequest.CPOPartnerSessionId.HasValue && CPOPartnerSessionId.Value.Equals(AuthorizeRemoteReservationStartRequest.CPOPartnerSessionId.Value))) &&

                   ((!EMPPartnerSessionId.HasValue && !AuthorizeRemoteReservationStartRequest.EMPPartnerSessionId.HasValue) ||
                    (EMPPartnerSessionId.HasValue && AuthorizeRemoteReservationStartRequest.EMPPartnerSessionId.HasValue && EMPPartnerSessionId.Value.Equals(AuthorizeRemoteReservationStartRequest.EMPPartnerSessionId.Value))) &&

                   ((!PartnerProductId.HasValue && !AuthorizeRemoteReservationStartRequest.PartnerProductId.HasValue) ||
                    (PartnerProductId.HasValue && AuthorizeRemoteReservationStartRequest.PartnerProductId.HasValue && PartnerProductId.Value.Equals(AuthorizeRemoteReservationStartRequest.PartnerProductId.Value))) &&

                   ((!Duration.HasValue && !AuthorizeRemoteReservationStartRequest.Duration.HasValue) ||
                    (Duration.HasValue && AuthorizeRemoteReservationStartRequest.Duration.HasValue && Duration.Value.Equals(AuthorizeRemoteReservationStartRequest.Duration.Value))));
        }
        /// <summary>
        /// Return the HashCode of this object.
        /// </summary>
        /// <returns>The HashCode of this object.</returns>
        public override Int32 GetHashCode()
        {
            unchecked
            {
                return(ProviderId.GetHashCode() * 17 ^
                       EVSEId.GetHashCode() * 13 ^
                       Identification.GetHashCode() * 11 ^

                       (SessionId.HasValue
                            ? SessionId.GetHashCode() * 9
                            : 0) ^

                       (CPOPartnerSessionId.HasValue
                            ? CPOPartnerSessionId.GetHashCode() * 7
                            : 0) ^

                       (EMPPartnerSessionId.HasValue
                            ? EMPPartnerSessionId.GetHashCode() * 5
                            : 0) ^

                       (PartnerProductId.HasValue
                            ? PartnerProductId.GetHashCode() * 3
                            : 0) ^

                       (Duration.HasValue
                            ? Duration.GetHashCode()
                            : 0));
            }
        }
Esempio n. 9
0
        /// <summary>
        /// Return a XML representation of this object.
        /// </summary>
        /// <param name="CustomAuthorizeRemoteStartRequestSerializer">A delegate to customize the serialization of AuthorizeRemoteStart requests.</param>
        /// <param name="CustomIdentificationSerializer">A delegate to serialize custom Identification XML elements.</param>
        public XElement ToXML(CustomXMLSerializerDelegate <AuthorizeRemoteStartRequest> CustomAuthorizeRemoteStartRequestSerializer = null,
                              CustomXMLSerializerDelegate <Identification> CustomIdentificationSerializer = null)
        {
            var XML = new XElement(OICPNS.Authorization + "eRoamingAuthorizeRemoteStart",

                                   SessionId.HasValue
                                           ? new XElement(OICPNS.Authorization + "SessionID", SessionId.ToString())
                                           : null,

                                   CPOPartnerSessionId.HasValue
                                           ? new XElement(OICPNS.Authorization + "CPOPartnerSessionID", CPOPartnerSessionId.ToString())
                                           : null,

                                   EMPPartnerSessionId.HasValue
                                           ? new XElement(OICPNS.Authorization + "EMPPartnerSessionID", EMPPartnerSessionId.ToString())
                                           : null,

                                   new XElement(OICPNS.Authorization + "ProviderID", ProviderId.ToString()),
                                   new XElement(OICPNS.Authorization + "EvseID", EVSEId.ToString()),

                                   Identification.ToXML(CustomIdentificationSerializer: CustomIdentificationSerializer),

                                   PartnerProductId.HasValue
                                           ? new XElement(OICPNS.Authorization + "PartnerProductID", PartnerProductId.ToString())
                                           : null

                                   );

            return(CustomAuthorizeRemoteStartRequestSerializer != null
                       ? CustomAuthorizeRemoteStartRequestSerializer(this, XML)
                       : XML);
        }
        /// <summary>
        /// Return a JSON-representation of this object.
        /// </summary>
        /// <param name="CustomAuthorizeRemoteReservationStopRequestSerializer">A delegate to customize the serialization of AuthorizeRemoteReservationStopRequest responses.</param>
        public JObject ToJSON(CustomJObjectSerializerDelegate <AuthorizeRemoteReservationStopRequest> CustomAuthorizeRemoteReservationStopRequestSerializer = null)
        {
            var JSON = JSONObject.Create(

                new JProperty("ProviderID", ProviderId.ToString()),
                new JProperty("EvseID", EVSEId.ToString()),
                new JProperty("SessionID", SessionId.ToString()),

                CPOPartnerSessionId.HasValue
                               ? new JProperty("CPOPartnerSessionID", CPOPartnerSessionId.Value.ToString())
                               : null,

                EMPPartnerSessionId.HasValue
                               ? new JProperty("EMPPartnerSessionID", EMPPartnerSessionId.Value.ToString())
                               : null,

                CustomData != null
                               ? new JProperty("CustomData", CustomData)
                               : null

                );

            return(CustomAuthorizeRemoteReservationStopRequestSerializer != null
                       ? CustomAuthorizeRemoteReservationStopRequestSerializer(this, JSON)
                       : JSON);
        }
Esempio n. 11
0
        /// <summary>
        /// Return a XML representation of this object.
        /// </summary>
        /// <param name="CustomSetServiceAuthorisationRequestSerializer">A delegate to serialize custom set EVSE busy status request XML elements.</param>
        /// <param name="CustomMeterReportSerializer">A delegate to serialize custom MeterReport XML elements.</param>
        public XElement ToXML(CustomXMLSerializerDelegate <SetServiceAuthorisationRequest> CustomSetServiceAuthorisationRequestSerializer = null,
                              CustomXMLSerializerDelegate <MeterReport> CustomMeterReportSerializer = null)
        {
            var XML = new XElement(eMIPNS.Authorisation + "eMIP_ToIOP_SetServiceAuthorisationRequest",

                                   TransactionId.HasValue
                              ? new XElement("transactionId", TransactionId.ToString())
                              : null,

                                   new XElement("partnerIdType", PartnerId.Format.AsText()),
                                   new XElement("partnerId", PartnerId.ToString()),

                                   new XElement("operatorIdType", OperatorId.Format.AsText()),
                                   new XElement("operatorId", OperatorId.ToString()),

                                   new XElement("EVSEIdType", EVSEId.Format.AsText()),
                                   new XElement("EVSEId", EVSEId.ToString()),

                                   new XElement("userIdType", UserId.Format.AsText()),
                                   new XElement("userId", UserId.ToString()),

                                   new XElement("requestedServiceId", RequestedServiceId.ToString()),
                                   new XElement("authorisationValue", AuthorisationValue.ToString()),
                                   new XElement("intermediateCDRRequested", IntermediateCDRRequested ? "1" : "0"),

                                   PartnerServiceSessionId.HasValue
                              ? new XElement("serviceSessionId", PartnerServiceSessionId.ToString())
                              : null,

                                   UserContractIdAlias.HasValue
                              ? new XElement("userContractIdAlias", UserContractIdAlias.ToString())
                              : null,

                                   MeterLimits.SafeAny()
                              ? new XElement("meterLimitList", MeterLimits.Select(meterreport => meterreport.ToXML(CustomMeterReportSerializer: CustomMeterReportSerializer)))
                              : null,

                                   Parameter.IsNotNullOrEmpty()
                              ? new XElement("parameter", Parameter)
                              : null,

                                   BookingId.HasValue
                              ? new XElement("bookingId", BookingId.ToString())
                              : null,

                                   SalePartnerBookingId.HasValue
                              ? new XElement("salePartnerBookingId", SalePartnerBookingId.ToString())
                              : null

                                   );


            return(CustomSetServiceAuthorisationRequestSerializer != null
                       ? CustomSetServiceAuthorisationRequestSerializer(this, XML)
                       : XML);
        }
Esempio n. 12
0
        public JObject ToJSON()

        => JSONObject.Create(
            new JProperty("timestamp", Timestamp.ToIso8601()),
            new JProperty("meterValue", MeterValue),
            new JProperty("meterId", MeterId.ToString()),
            new JProperty("evseId", EVSEId.ToString()),
            new JProperty("userId", UserId),
            new JProperty("publicKey", PublicKey.Fingerprint.ToHexString()),
            new JProperty("lastSignature", lastSignature),
            new JProperty("signature", Signature)
            );
        /// <summary>
        /// Return the HashCode of this object.
        /// </summary>
        /// <returns>The HashCode of this object.</returns>
        public override Int32 GetHashCode()
        {
            unchecked
            {
                return(ProviderId.GetHashCode() * 17 ^
                       EVSEId.GetHashCode() * 7 ^
                       SessionId.GetHashCode() * 5 ^

                       (CPOPartnerSessionId?.GetHashCode() ?? 0) * 3 ^
                       (EMPPartnerSessionId?.GetHashCode() ?? 0));
            }
        }
        /// <summary>
        /// Return the HashCode of this object.
        /// </summary>
        /// <returns>The HashCode of this object.</returns>
        public override Int32 GetHashCode()
        {
            unchecked
            {
                return(OperatorId.GetHashCode() * 13 ^
                       SessionId.GetHashCode() * 11 ^
                       Identification.GetHashCode() * 7 ^

                       (EVSEId?.GetHashCode() ?? 0) * 5 ^
                       (CPOPartnerSessionId?.GetHashCode() ?? 0) * 3 ^
                       (EMPPartnerSessionId?.GetHashCode() ?? 0));
            }
        }
Esempio n. 15
0
        /// <summary>
        /// Return the HashCode of this object.
        /// </summary>
        /// <returns>The HashCode of this object.</returns>
        public override Int32 GetHashCode()
        {
            unchecked
            {
                return(Timestamp.GetHashCode() * 11 ^
                       ConnectorStatus.GetHashCode() * 7 ^
                       EVSEId.GetHashCode() * 5 ^
                       ConnectorId.GetHashCode() * 3 ^

                       (CustomData != null
                            ? CustomData.GetHashCode()
                            : 0));
            }
        }
        /// <summary>
        /// Return the HashCode of this object.
        /// </summary>
        /// <returns>The HashCode of this object.</returns>
        public override Int32 GetHashCode()
        {
            unchecked
            {
                return(ProviderId.GetHashCode() * 17 ^
                       EVSEId.GetHashCode() * 13 ^
                       Identification.GetHashCode() * 11 ^

                       (SessionId?.GetHashCode() ?? 0) * 7 ^
                       (CPOPartnerSessionId?.GetHashCode() ?? 0) * 5 ^
                       (EMPPartnerSessionId?.GetHashCode() ?? 0) * 3 ^
                       (PartnerProductId?.GetHashCode() ?? 0));
            }
        }
Esempio n. 17
0
        /// <summary>
        /// Compares two status notification requests for equality.
        /// </summary>
        /// <param name="StatusNotificationRequest">A status notification request to compare with.</param>
        /// <returns>True if both match; False otherwise.</returns>
        public override Boolean Equals(StatusNotificationRequest StatusNotificationRequest)
        {
            if (StatusNotificationRequest is null)
            {
                return(false);
            }

            return(Timestamp.Equals(StatusNotificationRequest.Timestamp) &&
                   ConnectorStatus.Equals(StatusNotificationRequest.ConnectorStatus) &&
                   EVSEId.Equals(StatusNotificationRequest.EVSEId) &&
                   ConnectorId.Equals(StatusNotificationRequest.ConnectorId) &&

                   ((CustomData == null && StatusNotificationRequest.CustomData == null) ||
                    (CustomData != null && StatusNotificationRequest.CustomData != null && CustomData.Equals(StatusNotificationRequest.CustomData))));
        }
Esempio n. 18
0
        /// <summary>
        /// Return the HashCode of this object.
        /// </summary>
        /// <returns>The HashCode of this object.</returns>
        public override Int32 GetHashCode()
        {
            unchecked
            {
                return(EVSEId.GetHashCode() * 7 ^
                       QRCodeIdentification.GetHashCode() * 5 ^

                       (PartnerProductId.HasValue
                            ? PartnerProductId.GetHashCode() * 3
                            : 0) ^

                       (!GetNewSession.HasValue
                            ? GetNewSession.GetHashCode()
                            : 0));
            }
        }
Esempio n. 19
0
        /// <summary>
        /// Compares two mobile authorize start requests for equality.
        /// </summary>
        /// <param name="MobileAuthorizeStartRequest">A mobile authorize start request to compare with.</param>
        /// <returns>True if both match; False otherwise.</returns>
        public override Boolean Equals(MobileAuthorizeStartRequest MobileAuthorizeStartRequest)
        {
            if ((Object)MobileAuthorizeStartRequest == null)
            {
                return(false);
            }

            return(EVSEId.Equals(MobileAuthorizeStartRequest.EVSEId) &&
                   QRCodeIdentification.Equals(MobileAuthorizeStartRequest.QRCodeIdentification) &&

                   ((!PartnerProductId.HasValue && !MobileAuthorizeStartRequest.PartnerProductId.HasValue) ||
                    (PartnerProductId.HasValue && MobileAuthorizeStartRequest.PartnerProductId.HasValue && PartnerProductId.Value.Equals(MobileAuthorizeStartRequest.PartnerProductId.Value))) &&

                   ((!GetNewSession.HasValue && !MobileAuthorizeStartRequest.GetNewSession.HasValue) ||
                    (GetNewSession.HasValue && MobileAuthorizeStartRequest.GetNewSession.HasValue && GetNewSession.Value.Equals(MobileAuthorizeStartRequest.GetNewSession.Value))));
        }
        /// <summary>
        /// Return the HashCode of this object.
        /// </summary>
        /// <returns>The HashCode of this object.</returns>
        public override Int32 GetHashCode()
        {
            unchecked
            {
                return((TransactionId.HasValue
                            ? TransactionId.GetHashCode() * 31
                            : 0) ^

                       PartnerId.GetHashCode() * 29 ^
                       OperatorId.GetHashCode() * 23 ^
                       EVSEId.GetHashCode() * 21 ^


                       (AvailabilityStatusEventDate.HasValue
                            ? AvailabilityStatusEventDate.GetHashCode() * 19
                            : 0) ^

                       (AvailabilityStatus.HasValue
                            ? AvailabilityStatus.GetHashCode() * 17
                            : 0) ^

                       (AvailabilityStatusUntil.HasValue
                            ? AvailabilityStatusUntil.GetHashCode() * 13
                            : 0) ^

                       (AvailabilityStatusComment.IsNeitherNullNorEmpty()
                            ? AvailabilityStatusComment.GetHashCode() * 11
                            : 0) ^


                       (BusyStatusEventDate.HasValue
                            ? BusyStatusEventDate.GetHashCode() * 7
                            : 0) ^

                       (BusyStatus.HasValue
                            ? BusyStatus.GetHashCode() * 3
                            : 0) ^

                       (BusyStatusUntil.HasValue
                            ? BusyStatusUntil.GetHashCode() * 3
                            : 0) ^

                       (BusyStatusComment.IsNeitherNullNorEmpty()
                            ? BusyStatusComment.GetHashCode()
                            : 0));
            }
        }
Esempio n. 21
0
        /// <summary>
        /// Return the HashCode of this object.
        /// </summary>
        /// <returns>The HashCode of this object.</returns>
        public override Int32 GetHashCode()
        {
            unchecked
            {
                return(EVSEId.GetHashCode() * 11 ^
                       StatusEventDate.GetHashCode() * 7 ^
                       BusyStatus.GetHashCode() * 5 ^

                       (BusyStatusUntil.HasValue
                            ? BusyStatusUntil.GetHashCode() * 3
                            : 0) ^

                       (BusyStatusComment.IsNeitherNullNorEmpty()
                            ? BusyStatusComment.GetHashCode()
                            : 0));
            }
        }
Esempio n. 22
0
        /// <summary>
        /// Compares two EVSEBusyStatus for equality.
        /// </summary>
        /// <param name="EVSEBusyStatus">An EVSEBusyStatus to compare with.</param>
        /// <returns>True if both match; False otherwise.</returns>
        public Boolean Equals(EVSEBusyStatus EVSEBusyStatus)
        {
            if ((Object)EVSEBusyStatus == null)
            {
                return(false);
            }

            return(EVSEId.Equals(EVSEBusyStatus.EVSEId) &&
                   StatusEventDate.Equals(EVSEBusyStatus.StatusEventDate) &&
                   BusyStatus.Equals(EVSEBusyStatus.BusyStatus) &&

                   ((!BusyStatusUntil.HasValue && !EVSEBusyStatus.BusyStatusUntil.HasValue) ||
                    (BusyStatusUntil.HasValue && EVSEBusyStatus.BusyStatusUntil.HasValue && BusyStatusUntil.Value.Equals(EVSEBusyStatus.BusyStatusUntil.Value))) &&

                   ((!BusyStatusComment.IsNeitherNullNorEmpty() && !EVSEBusyStatus.BusyStatusComment.IsNeitherNullNorEmpty()) ||
                    (BusyStatusComment.IsNeitherNullNorEmpty() && EVSEBusyStatus.BusyStatusComment.IsNeitherNullNorEmpty() && BusyStatusComment.Equals(EVSEBusyStatus.BusyStatusComment))));
        }
        /// <summary>
        /// Compares two authorize remote stop requests for equality.
        /// </summary>
        /// <param name="AuthorizeRemoteStopRequest">An authorize remote stop request to compare with.</param>
        /// <returns>True if both match; False otherwise.</returns>
        public override Boolean Equals(AuthorizeRemoteStopRequest AuthorizeRemoteStopRequest)
        {
            if (AuthorizeRemoteStopRequest is null)
            {
                return(false);
            }

            return(SessionId.Equals(AuthorizeRemoteStopRequest.SessionId) &&
                   ProviderId.Equals(AuthorizeRemoteStopRequest.ProviderId) &&
                   EVSEId.Equals(AuthorizeRemoteStopRequest.EVSEId) &&

                   ((!CPOPartnerSessionId.HasValue && !AuthorizeRemoteStopRequest.CPOPartnerSessionId.HasValue) ||
                    (CPOPartnerSessionId.HasValue && AuthorizeRemoteStopRequest.CPOPartnerSessionId.HasValue && CPOPartnerSessionId.Value.Equals(AuthorizeRemoteStopRequest.CPOPartnerSessionId.Value))) &&

                   ((!EMPPartnerSessionId.HasValue && !AuthorizeRemoteStopRequest.EMPPartnerSessionId.HasValue) ||
                    (EMPPartnerSessionId.HasValue && AuthorizeRemoteStopRequest.EMPPartnerSessionId.HasValue && EMPPartnerSessionId.Value.Equals(AuthorizeRemoteStopRequest.EMPPartnerSessionId.Value))));
        }
Esempio n. 24
0
        public JObject ToJSON()

        => JSONObject.Create(

            new JProperty("@id", Id.ToString()),
            new JProperty("timestamp", Timestamp.ToIso8601()),
            new JProperty("startTime", StartTime.ToIso8601()),
            new JProperty("duration", Duration.TotalMinutes),
            new JProperty("endTime", EndTime.ToIso8601()),

            new JProperty("consumedReservationTime", ConsumedReservationTime.TotalMinutes),
            new JProperty("reservationLevel", ReservationLevel.ToString()),

            ProviderId.HasValue
                       ? new JProperty("providerId", ProviderId.ToString())
                       : null,

            StartAuthentication != null
                       ? new JProperty("authentication", EndTime.ToIso8601())
                       : null,

            RoamingNetworkId.HasValue
                       ? new JProperty("roamingNetworkId", RoamingNetworkId.ToString())
                       : null,

            ChargingPoolId.HasValue
                       ? new JProperty("chargingPoolId", ChargingPoolId.ToString())
                       : null,

            ChargingStationId.HasValue
                       ? new JProperty("chargingStationId", ChargingStationId.ToString())
                       : null,

            EVSEId.HasValue
                       ? new JProperty("EVSEId", EVSEId.ToString())
                       : null,

            ChargingProduct != null
                       ? new JProperty("chargingProduct", ChargingProduct.ToJSON())
                       : null,

            ChargingSession != null
                       ? new JProperty("chargingSessionId", ChargingSession.Id.ToString())
                       : null

            );
        /// <summary>
        /// Return the HashCode of this object.
        /// </summary>
        /// <returns>The HashCode of this object.</returns>
        public override Int32 GetHashCode()
        {
            unchecked
            {
                return(SessionId.GetHashCode() * 11 ^
                       ProviderId.GetHashCode() * 7 ^
                       EVSEId.GetHashCode() * 5 ^

                       (CPOPartnerSessionId.HasValue
                            ? CPOPartnerSessionId.GetHashCode() * 3
                            : 0) ^

                       (EMPPartnerSessionId.HasValue
                            ? EMPPartnerSessionId.GetHashCode()
                            : 0));
            }
        }
Esempio n. 26
0
        public JObject ToJSON()

        => JSONObject.Create(

            new JProperty("@id", SessionId.ToString()),
            new JProperty("@context", ""),

            SessionTime.HasValue
                               ? new JProperty("sessionTime", JSONObject.Create(
                                                   new JProperty("start", SessionTime.Value.StartTime.ToIso8601()),
                                                   SessionTime.Value.EndTime.HasValue
                                         ? new JProperty("end", SessionTime.Value.EndTime.Value.ToIso8601())
                                         : null
                                                   ))
                               : null,

            Duration.HasValue
                               ? new JProperty("duration", Duration.Value.TotalSeconds)
                               : null,

            ChargingStationOperatorId.HasValue
                               ? new JProperty("chargingStationOperatorId", ChargingStationOperatorId.ToString())
                               : null,
            ChargingPoolId.HasValue
                               ? new JProperty("chargingPoolId", ChargingPoolId.ToString())
                               : null,
            ChargingStationId.HasValue
                               ? new JProperty("chargingStationId", ChargingStationId.ToString())
                               : null,
            EVSEId.HasValue
                               ? new JProperty("evseId", EVSEId.ToString())
                               : null,


            ChargingProduct != null
                               ? new JProperty("chargingProduct", ChargingProduct.ToJSON())
                               : null

            //new JProperty("meterValue",     MeterValue),
            //new JProperty("meterId",        MeterId.ToString()),

            //new JProperty("userId",         UserId),
            //new JProperty("publicKey",      PublicKey.KeyId),
            //new JProperty("lastSignature",  lastSignature),
            //new JProperty("signature",      Signature)
            );
Esempio n. 27
0
        /// <summary>
        /// Return a JSON representation of this object.
        /// </summary>
        /// <param name="CustomStatusNotificationRequestSerializer">A delegate to serialize custom StatusNotification requests.</param>
        /// <param name="CustomCustomDataResponseSerializer">A delegate to serialize CustomData objects.</param>
        public JObject ToJSON(CustomJObjectSerializerDelegate <StatusNotificationRequest> CustomStatusNotificationRequestSerializer = null,
                              CustomJObjectSerializerDelegate <CustomData> CustomCustomDataResponseSerializer = null)
        {
            var JSON = JSONObject.Create(

                new JProperty("timestamp", Timestamp.ToIso8601()),
                new JProperty("connectorStatus", ConnectorStatus.AsText()),
                new JProperty("evseId", EVSEId.ToString()),
                new JProperty("connectorId", ConnectorId.ToString()),

                CustomData != null
                               ? new JProperty("customData", CustomData.ToJSON(CustomCustomDataResponseSerializer))
                               : null);

            return(CustomStatusNotificationRequestSerializer != null
                       ? CustomStatusNotificationRequestSerializer(this, JSON)
                       : JSON);
        }
Esempio n. 28
0
        /// <summary>
        /// Return a JSON representation of this object.
        /// </summary>
        /// <param name="CustomChargingStartNotificationRequestSerializer">A delegate to serialize custom time period JSON objects.</param>
        /// <param name="CustomIdentificationSerializer">A delegate to serialize custom Identification JSON elements.</param>
        public JObject ToJSON(CustomJObjectSerializerDelegate <ChargingStartNotificationRequest> CustomChargingStartNotificationRequestSerializer = null,
                              CustomJObjectSerializerDelegate <Identification> CustomIdentificationSerializer = null)
        {
            var JSON = JSONObject.Create(
                new JProperty("Type", Type.AsString()),
                new JProperty("SessionID", SessionId.ToString()),
                new JProperty("EvseID", EVSEId.ToString()),
                new JProperty("Identification", Identification.ToJSON(CustomIdentificationSerializer: CustomIdentificationSerializer)),
                new JProperty("ChargingStart", ChargingStart.ToIso8601()),

                CPOPartnerSessionId.HasValue
                               ? new JProperty("CPOPartnerSessionID", CPOPartnerSessionId.Value.ToString())
                               : null,

                EMPPartnerSessionId.HasValue
                               ? new JProperty("EMPPartnerSessionID", EMPPartnerSessionId.Value.ToString())
                               : null,

                SessionStart.HasValue
                               ? new JProperty("SessionStart", SessionStart.Value.ToIso8601())
                               : null,

                MeterValueStart.HasValue
                               ? new JProperty("MeterValueStart", String.Format("{0:0.###}", MeterValueStart.Value).Replace(",", "."))
                               : null,

                OperatorId.HasValue
                               ? new JProperty("OperatorID", OperatorId.Value.ToString())
                               : null,

                PartnerProductId.HasValue
                               ? new JProperty("PartnerProductID", PartnerProductId.Value.ToString())
                               : null,

                CustomData != null
                               ? new JProperty("CustomData", CustomData)
                               : null

                );

            return(CustomChargingStartNotificationRequestSerializer != null
                       ? CustomChargingStartNotificationRequestSerializer(this, JSON)
                       : JSON);
        }
        /// <summary>
        /// Compares two heartbeat requests for equality.
        /// </summary>
        /// <param name="SetServiceAuthorisationRequest">A heartbeat request to compare with.</param>
        /// <returns>True if both match; False otherwise.</returns>
        public override Boolean Equals(SetServiceAuthorisationRequest SetServiceAuthorisationRequest)
        {

            if ((Object) SetServiceAuthorisationRequest == null)
                return false;

            return ((!TransactionId.HasValue && !SetServiceAuthorisationRequest.TransactionId.HasValue) ||
                     (TransactionId.HasValue && SetServiceAuthorisationRequest.TransactionId.HasValue && TransactionId.Value.Equals(SetServiceAuthorisationRequest.TransactionId.Value))) &&

                   PartnerId.         Equals(SetServiceAuthorisationRequest.PartnerId)          &&
                   OperatorId.        Equals(SetServiceAuthorisationRequest.OperatorId)         &&
                   EVSEId.            Equals(SetServiceAuthorisationRequest.EVSEId)             &&
                   UserId.            Equals(SetServiceAuthorisationRequest.UserId)             &&
                   RequestedServiceId.Equals(SetServiceAuthorisationRequest.RequestedServiceId);

                   //((!PartnerServiceSessionId.HasValue && !SetServiceAuthorisationRequest.PartnerServiceSessionId.HasValue) ||
                   //  (PartnerServiceSessionId.HasValue &&  SetServiceAuthorisationRequest.PartnerServiceSessionId.HasValue && PartnerServiceSessionId.Value.Equals(SetServiceAuthorisationRequest.PartnerServiceSessionId.Value)));

        }
Esempio n. 30
0
        /// <summary>
        /// Return the HashCode of this object.
        /// </summary>
        /// <returns>The HashCode of this object.</returns>
        public override Int32 GetHashCode()
        {
            unchecked
            {
                return((TransactionId.HasValue
                            ? TransactionId.GetHashCode() * 19
                            : 0) ^

                       PartnerId.GetHashCode() * 17 ^
                       OperatorId.GetHashCode() * 13 ^
                       EVSEId.GetHashCode() * 11 ^
                       UserId.GetHashCode() * 7 ^
                       RequestedServiceId.GetHashCode() * 3);

                //(PartnerServiceSessionId.HasValue
                //     ? PartnerServiceSessionId.GetHashCode()
                //     : 0);
            }
        }