/// <summary>
        /// Return a XML representation of this object.
        /// </summary>
        /// <param name="CustomSetEVSESyntheticStatusRequestSerializer">A delegate to serialize custom set EVSE busy status request XML elements.</param>
        public XElement ToXML(CustomXMLSerializerDelegate <SetEVSESyntheticStatusRequest> CustomSetEVSESyntheticStatusRequestSerializer = null)
        {
            var XML = new XElement(eMIPNS.EVCIDynamic + "eMIP_ToIOP_SetEVSESyntheticStatusRequest",

                                   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 + "EVSEIdType", EVSEId.Format.ToString()),
                                   new XElement(eMIPNS.EVCIDynamic + "EVSEId", EVSEId.ToString()),


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

                                   AvailabilityStatus.HasValue
                              ? new XElement(eMIPNS.EVCIDynamic + "availabilityStatus", AvailabilityStatus.Value.AsNumber())
                              : null,

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

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


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

                                   BusyStatus.HasValue
                              ? new XElement(eMIPNS.EVCIDynamic + "busyStatus", BusyStatus.Value.AsNumber())
                              : null,

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

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

                                   );


            return(CustomSetEVSESyntheticStatusRequestSerializer != null
                       ? CustomSetEVSESyntheticStatusRequestSerializer(this, XML)
                       : XML);
        }
        /// <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));
            }
        }
        /// <summary>
        /// Compares two heartbeat requests for equality.
        /// </summary>
        /// <param name="SetEVSESyntheticStatusRequest">A heartbeat request to compare with.</param>
        /// <returns>True if both match; False otherwise.</returns>
        public override Boolean Equals(SetEVSESyntheticStatusRequest SetEVSESyntheticStatusRequest)
        {
            if ((Object)SetEVSESyntheticStatusRequest == null)
            {
                return(false);
            }

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

                   PartnerId.Equals(SetEVSESyntheticStatusRequest.PartnerId) &&
                   OperatorId.Equals(SetEVSESyntheticStatusRequest.OperatorId) &&
                   EVSEId.Equals(SetEVSESyntheticStatusRequest.EVSEId) &&

                   ((!AvailabilityStatusEventDate.HasValue && !SetEVSESyntheticStatusRequest.AvailabilityStatusEventDate.HasValue) ||
                    (AvailabilityStatusEventDate.HasValue && SetEVSESyntheticStatusRequest.AvailabilityStatusEventDate.HasValue && AvailabilityStatusEventDate.Value.Equals(SetEVSESyntheticStatusRequest.AvailabilityStatusEventDate.Value))) &&

                   ((!AvailabilityStatus.HasValue && !SetEVSESyntheticStatusRequest.AvailabilityStatus.HasValue) ||
                    (AvailabilityStatus.HasValue && SetEVSESyntheticStatusRequest.AvailabilityStatus.HasValue && AvailabilityStatus.Value.Equals(SetEVSESyntheticStatusRequest.AvailabilityStatus.Value))) &&

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

                   ((!AvailabilityStatusComment.IsNeitherNullNorEmpty() && !SetEVSESyntheticStatusRequest.AvailabilityStatusComment.IsNeitherNullNorEmpty()) ||
                    (AvailabilityStatusComment.IsNeitherNullNorEmpty() && SetEVSESyntheticStatusRequest.AvailabilityStatusComment.IsNeitherNullNorEmpty() && AvailabilityStatusComment.Equals(SetEVSESyntheticStatusRequest.AvailabilityStatusComment)) &&


                    ((!BusyStatusEventDate.HasValue && !SetEVSESyntheticStatusRequest.BusyStatusEventDate.HasValue) ||
                     (BusyStatusEventDate.HasValue && SetEVSESyntheticStatusRequest.BusyStatusEventDate.HasValue && BusyStatusEventDate.Value.Equals(SetEVSESyntheticStatusRequest.BusyStatusEventDate.Value))) &&

                    ((!BusyStatus.HasValue && !SetEVSESyntheticStatusRequest.BusyStatus.HasValue) ||
                     (BusyStatus.HasValue && SetEVSESyntheticStatusRequest.BusyStatus.HasValue && BusyStatus.Value.Equals(SetEVSESyntheticStatusRequest.BusyStatus.Value))) &&

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

                    ((!BusyStatusComment.IsNeitherNullNorEmpty() && !SetEVSESyntheticStatusRequest.BusyStatusComment.IsNeitherNullNorEmpty()) ||
                     (BusyStatusComment.IsNeitherNullNorEmpty() && SetEVSESyntheticStatusRequest.BusyStatusComment.IsNeitherNullNorEmpty() && BusyStatusComment.Equals(SetEVSESyntheticStatusRequest.BusyStatusComment)))));
        }