Exemple #1
0
        /// <summary>
        /// Return a XML representation of this object.
        /// </summary>
        /// <param name="CustomSetSessionActionRequestSerializer">A delegate to serialize custom set EVSE busy status request XML elements.</param>
        public XElement ToXML(CustomXMLSerializerDelegate <SetSessionActionRequestRequest> CustomSetSessionActionRequestSerializer = null)
        {
            var XML = new XElement(eMIPNS.Authorisation + "eMIP_FromIOP_SetSessionActionRequest",

                                   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("targetOperatorIdType", TargetOperatorId.Format.AsText()),
                                   new XElement("targetOperatorId", TargetOperatorId.ToString()),

                                   new XElement("serviceSessionId", ServiceSessionId.ToString()),

                                   ExecPartnerSessionId.HasValue
                              ? new XElement("execPartnerSessionId", ExecPartnerSessionId.ToString())
                              : null,

                                   SessionAction.ToXML()

                                   );


            return(CustomSetSessionActionRequestSerializer != null
                       ? CustomSetSessionActionRequestSerializer(this, XML)
                       : XML);
        }
        /// <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_FromIOP_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("targetOperatorIdType",           TargetOperatorId.Format.      AsText()),
                          new XElement("targetOperatorId",               TargetOperatorId.             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("serviceSessionId",               ServiceSessionId.             ToString()),
                          new XElement("authorisationValue",             AuthorisationValue.           ToString()),
                          new XElement("intermediateCDRRequested",       IntermediateCDRRequested ? "1" : "0"),

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

                          MeterLimits.Any()
                              ? 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

                      );


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

        }
Exemple #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() * 17
                            : 0) ^

                       PartnerId.GetHashCode() * 13 ^
                       OperatorId.GetHashCode() * 11 ^
                       TargetOperatorId.GetHashCode() * 7 ^
                       ServiceSessionId.GetHashCode() * 5 ^
                       SessionAction.GetHashCode() * 3 ^

                       (ExecPartnerSessionId.HasValue
                            ? ExecPartnerSessionId.GetHashCode()
                            : 0));
            }
        }
Exemple #4
0
        /// <summary>
        /// Compares two SetSessionAction requests for equality.
        /// </summary>
        /// <param name="SetSessionActionRequest">A SetSessionAction request to compare with.</param>
        /// <returns>True if both match; False otherwise.</returns>
        public override Boolean Equals(SetSessionActionRequestRequest SetSessionActionRequest)
        {
            if (SetSessionActionRequest is null)
            {
                return(false);
            }

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

                   PartnerId.Equals(SetSessionActionRequest.PartnerId) &&
                   OperatorId.Equals(SetSessionActionRequest.OperatorId) &&
                   TargetOperatorId.Equals(SetSessionActionRequest.TargetOperatorId) &&
                   ServiceSessionId.Equals(SetSessionActionRequest.ServiceSessionId) &&
                   SessionAction.Equals(SetSessionActionRequest.SessionAction) &&

                   ((!ExecPartnerSessionId.HasValue && !SetSessionActionRequest.ExecPartnerSessionId.HasValue) ||
                    (ExecPartnerSessionId.HasValue && SetSessionActionRequest.ExecPartnerSessionId.HasValue && ExecPartnerSessionId.Equals(SetSessionActionRequest.ExecPartnerSessionId))));
        }
Exemple #5
0
        /// <summary>
        /// Compares two heartbeat requests for equality.
        /// </summary>
        /// <param name="SetSessionEventReportRequest">A heartbeat request to compare with.</param>
        /// <returns>True if both match; False otherwise.</returns>
        public override Boolean Equals(SetSessionEventReportRequest SetSessionEventReportRequest)
        {
            if (SetSessionEventReportRequest is null)
            {
                return(false);
            }

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

                   PartnerId.Equals(SetSessionEventReportRequest.PartnerId) &&
                   OperatorId.Equals(SetSessionEventReportRequest.OperatorId) &&
                   TargetOperatorId.Equals(SetSessionEventReportRequest.TargetOperatorId) &&
                   ServiceSessionId.Equals(SetSessionEventReportRequest.ServiceSessionId) &&
                   SessionEvent.Equals(SetSessionEventReportRequest.SessionEvent) &&

                   ((!SalePartnerSessionId.HasValue && !SetSessionEventReportRequest.SalePartnerSessionId.HasValue) ||
                    (SalePartnerSessionId.HasValue && SetSessionEventReportRequest.SalePartnerSessionId.HasValue && SalePartnerSessionId.Equals(SetSessionEventReportRequest.SalePartnerSessionId))));
        }
Exemple #6
0
        /// <summary>
        /// Return the HashCode of this object.
        /// </summary>
        /// <returns>The HashCode of this object.</returns>
        public override Int32 GetHashCode()
        {
            unchecked
            {
                return(TransactionId.GetHashCode() * 21 ^
                       PartnerId.GetHashCode() * 19 ^
                       OperatorId.GetHashCode() * 17 ^
                       TargetOperatorId.GetHashCode() * 13 ^
                       EVSEId.GetHashCode() * 11 ^
                       UserId.GetHashCode() * 7 ^
                       RequestedServiceId.GetHashCode() * 5 ^

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

                       (BookingId.HasValue
                            ? BookingId.GetHashCode()
                            : 0));
            }
        }
Exemple #7
0
        /// <summary>
        /// Compares two heartbeat requests for equality.
        /// </summary>
        /// <param name="GetServiceAuthorisationRequest">A heartbeat request to compare with.</param>
        /// <returns>True if both match; False otherwise.</returns>
        public override Boolean Equals(GetServiceAuthorisationRequest GetServiceAuthorisationRequest)
        {
            if (GetServiceAuthorisationRequest is null)
            {
                return(false);
            }

            return(TransactionId.Equals(GetServiceAuthorisationRequest.TransactionId) &&
                   PartnerId.Equals(GetServiceAuthorisationRequest.PartnerId) &&
                   OperatorId.Equals(GetServiceAuthorisationRequest.OperatorId) &&
                   TargetOperatorId.Equals(GetServiceAuthorisationRequest.TargetOperatorId) &&
                   EVSEId.Equals(GetServiceAuthorisationRequest.EVSEId) &&
                   UserId.Equals(GetServiceAuthorisationRequest.UserId) &&
                   RequestedServiceId.Equals(GetServiceAuthorisationRequest.RequestedServiceId) &&

                   ((!ServiceSessionId.HasValue && !GetServiceAuthorisationRequest.ServiceSessionId.HasValue) ||
                    (ServiceSessionId.HasValue && GetServiceAuthorisationRequest.ServiceSessionId.HasValue && ServiceSessionId.Value.Equals(GetServiceAuthorisationRequest.ServiceSessionId.Value))) &&

                   ((!BookingId.HasValue && !GetServiceAuthorisationRequest.BookingId.HasValue) ||
                    (BookingId.HasValue && GetServiceAuthorisationRequest.BookingId.HasValue && BookingId.Value.Equals(GetServiceAuthorisationRequest.BookingId.Value))));
        }
Exemple #8
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_FromIOP_GetServiceAuthorisationRequest",

                                   new XElement("transactionId", TransactionId.ToString()),

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

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

                                   new XElement("targetOperatorIdType", TargetOperatorId.Format.AsText()),
                                   new XElement("targetOperatorId", TargetOperatorId.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()),

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

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

                                   );


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