/// <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);
        }
Exemple #2
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));
            }
        }
Exemple #3
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 SetEVSEBusyStatus requests for equality.
        /// </summary>
        /// <param name="SetEVSEBusyStatusRequest">A SetEVSEBusyStatus request to compare with.</param>
        /// <returns>True if both match; False otherwise.</returns>
        public override Boolean Equals(SetEVSEBusyStatusRequest SetEVSEBusyStatusRequest)
        {
            if ((Object)SetEVSEBusyStatusRequest == null)
            {
                return(false);
            }

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

                   PartnerId.Equals(SetEVSEBusyStatusRequest.PartnerId) &&
                   OperatorId.Equals(SetEVSEBusyStatusRequest.OperatorId) &&
                   EVSEId.Equals(SetEVSEBusyStatusRequest.EVSEId) &&
                   StatusEventDate.Equals(SetEVSEBusyStatusRequest.StatusEventDate) &&
                   BusyStatus.Equals(SetEVSEBusyStatusRequest.BusyStatus) &&

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

                   ((!BusyStatusComment.IsNeitherNullNorEmpty() && !SetEVSEBusyStatusRequest.BusyStatusComment.IsNeitherNullNorEmpty()) ||
                    (BusyStatusComment.IsNeitherNullNorEmpty() && SetEVSEBusyStatusRequest.BusyStatusComment.IsNeitherNullNorEmpty() && BusyStatusComment.Equals(SetEVSEBusyStatusRequest.BusyStatusComment))));
        }
        /// <summary>
        /// Compares two heartbeat requests for equality.
        /// </summary>
        /// <param name="SetChargingStationAvailabilityStatusRequest">A heartbeat request to compare with.</param>
        /// <returns>True if both match; False otherwise.</returns>
        public override Boolean Equals(SetChargingStationAvailabilityStatusRequest SetChargingStationAvailabilityStatusRequest)
        {
            if ((Object)SetChargingStationAvailabilityStatusRequest == null)
            {
                return(false);
            }

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

                   PartnerId.Equals(SetChargingStationAvailabilityStatusRequest.PartnerId) &&
                   OperatorId.Equals(SetChargingStationAvailabilityStatusRequest.OperatorId) &&
                   ChargingStationId.Equals(SetChargingStationAvailabilityStatusRequest.ChargingStationId) &&
                   StatusEventDate.Equals(SetChargingStationAvailabilityStatusRequest.StatusEventDate) &&
                   AvailabilityStatus.Equals(SetChargingStationAvailabilityStatusRequest.AvailabilityStatus) &&

                   ((!AvailabilityStatusUntil.HasValue && !SetChargingStationAvailabilityStatusRequest.AvailabilityStatusUntil.HasValue) ||
                    (AvailabilityStatusUntil.HasValue && SetChargingStationAvailabilityStatusRequest.AvailabilityStatusUntil.HasValue && AvailabilityStatusUntil.Value.Equals(SetChargingStationAvailabilityStatusRequest.AvailabilityStatusUntil.Value))) &&

                   ((!AvailabilityStatusComment.IsNeitherNullNorEmpty() && !SetChargingStationAvailabilityStatusRequest.AvailabilityStatusComment.IsNeitherNullNorEmpty()) ||
                    (AvailabilityStatusComment.IsNeitherNullNorEmpty() && SetChargingStationAvailabilityStatusRequest.AvailabilityStatusComment.IsNeitherNullNorEmpty() && AvailabilityStatusComment.Equals(SetChargingStationAvailabilityStatusRequest.AvailabilityStatusComment))));
        }
        /// <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() * 23
                            : 0) ^

                       PartnerId.GetHashCode() * 21 ^
                       OperatorId.GetHashCode() * 17 ^
                       EVSEId.GetHashCode() * 13 ^
                       StatusEventDate.GetHashCode() * 11 ^
                       BusyStatus.GetHashCode() * 7 ^

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

                       (BusyStatusComment.IsNeitherNullNorEmpty()
                            ? BusyStatusComment.GetHashCode() * 3
                            : 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 ^
                       ChargingStationId.GetHashCode() * 11 ^
                       StatusEventDate.GetHashCode() * 7 ^
                       AvailabilityStatus.GetHashCode() * 5 ^

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

                       (AvailabilityStatusComment.IsNeitherNullNorEmpty()
                            ? AvailabilityStatusComment.GetHashCode()
                            : 0));
            }
        }
        /// <summary>
        /// Return a XML representation of this object.
        /// </summary>
        /// <param name="CustomSetChargingStationAvailabilityStatusRequestSerializer">A delegate to serialize custom set ChargingStation availability status request XML elements.</param>
        public XElement ToXML(CustomXMLSerializerDelegate <SetChargingStationAvailabilityStatusRequest> CustomSetChargingStationAvailabilityStatusRequestSerializer = null)
        {
            var XML = new XElement(eMIPNS.EVCIDynamic + "eMIP_ToIOP_SetChargingStationAvailabilityStatusRequest",

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

                                   new XElement(eMIPNS.EVCIDynamic + "partnerIdType", PartnerId.Format.ToString()),
                                   new XElement(eMIPNS.EVCIDynamic + "partnerId", PartnerId.ToString()),

                                   new XElement(eMIPNS.EVCIDynamic + "operatorIdType", OperatorId.Format.ToString()),
                                   new XElement(eMIPNS.EVCIDynamic + "operatorId", OperatorId.ToString()),

                                   new XElement(eMIPNS.EVCIDynamic + "ChargingStationIdType", ChargingStationId.Format.ToString()),
                                   new XElement(eMIPNS.EVCIDynamic + "ChargingStationId", ChargingStationId.ToString()),

                                   new XElement(eMIPNS.EVCIDynamic + "statusEventDate", StatusEventDate.ToIso8601(false)),
                                   new XElement(eMIPNS.EVCIDynamic + "availabilityStatus", AvailabilityStatus.AsNumber()),

                                   AvailabilityStatusUntil.HasValue
                              ? new XElement(eMIPNS.EVCIDynamic + "availabilityStatusUntil", AvailabilityStatusUntil.Value.ToIso8601(false))
                              : null,

                                   AvailabilityStatusComment.IsNeitherNullNorEmpty()
                              ? new XElement(eMIPNS.EVCIDynamic + "availabilityStatusComment", AvailabilityStatusComment)
                              : null

                                   );


            return(CustomSetChargingStationAvailabilityStatusRequestSerializer != null
                       ? CustomSetChargingStationAvailabilityStatusRequestSerializer(this, XML)
                       : XML);
        }