#ifndef DResponse_H
#define DResponse_H

#include "MySerializable.h"

#include <string>

#include "DValue.h"
#include "DResult.h"
#include "DError.h"
#include "DResponseParameter.h"

namespace ProtoGenWrapper
{
	class DResponse : public MySerializable
	{
	public:
		enum ResponseState { Failed, Invalid, Negative, Positive, Unknown };

		DResponse(const DResult& result, const std::string& name, ResponseState responseState);
		DResponse(const std::string& data);

		void SetResult(const DResult& result);
		DResult GetResult() const;
		void SetName(const std::string& name);
		std::string GetName() const;
		void SetResponseState(ResponseState state);
		ResponseState GetResponseState() const;

		void SetLongName(const std::string& longName);
		std::string GetLongName() const;
		void SetError(const DError& error);
		const DError& GetError() const;
		void SetResponseMessage(const DValue& value);
		const DValue& GetResponseMessage() const;
		void SetResponseType(int responseType);
		int GetResponseType() const;
		void SetResponseParameters(std::list<DResponseParameter>& parameters);
		const std::list<DResponseParameter>& GetResponseParameters() const;
		void SetComChannelIdentifier(const std::string& comChannelIdentifier);
		std::string GetComChannelIdentifier() const;
		
		void Serialize(std::string* output) const override;
		void Deserialize(const std::string& data) override;

	protected:
		DResult _result;
		std::string _name;
		ResponseState _responseState;
		std::string _longName;
		DError _error;
		DValue _responseMessage;
		int _responseType;
		std::list<DResponseParameter> _parameters;
		std::string _comChannelIdentifier;
	};
}
#endif // DResponse_H
