/*
* OCPP.Core - https://github.com/dallmann-consulting/OCPP.Core
* Copyright (C) 2020-2021 dallmann consulting GmbH.
* All Rights Reserved.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see .
*/
using System;
using System.Threading.Tasks;
using Newtonsoft.Json;
namespace OCPP.Core.Server
{
///
/// Warpper object for OCPP Message
///
public class OCPPMessage
{
///
/// Message type
///
public string MessageType { get; set; }
///
/// Message ID
///
public string UniqueId { get; set; }
///
/// Action
///
public string Action { get; set; }
///
/// JSON-Payload
///
public string JsonPayload { get; set; }
///
/// Error-Code
///
public string ErrorCode { get; set; }
///
/// Error-Description
///
public string ErrorDescription { get; set; }
///
/// TaskCompletionSource for asynchronous API result
///
[JsonIgnore]
public TaskCompletionSource TaskCompletionSource { get; set; }
///
/// Empty constructor
///
public OCPPMessage()
{
}
///
/// Constructor
///
public OCPPMessage(string messageType, string uniqueId, string action, string jsonPayload)
{
MessageType = messageType;
UniqueId = uniqueId;
Action = action;
JsonPayload = jsonPayload;
}
}
}