/// <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); }