2 * Samsung Ukraine R&D Center (SRK under a contract between)
3 * LLC "Samsung Electronics Co", Ltd (Seoul, Republic of Korea)
4 * Copyright (C) 2018 Samsung Electronics Co., Ltd. All rights reserved.
6 * Licensed under the Apache License, Version 2.0 (the "License");
7 * you may not use this file except in compliance with the License.
8 * You may obtain a copy of the License at
10 * http://www.apache.org/licenses/LICENSE-2.0
12 * Unless required by applicable law or agreed to in writing, software
13 * distributed under the License is distributed on an "AS IS" BASIS,
14 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 * See the License for the specific language governing permissions and
16 * limitations under the License
20 * @brief Communication level event class
21 * @date Created Feb 15, 2018
22 * @author Mail to: <A HREF="mailto:d.lomtev@samsung.com">Dmytro Lomtev, d.lomtev@samsung.com</A>
29 #include <jsoncpp/json/value.h>
30 #include "connection.h"
32 namespace communication
36 * @brief The Event class represents communication event
41 Event(const Json::Value& value, Connection& conn);
44 * @brief isValid validates event
45 * @return true if event is valid and false otherwise
49 return !type.empty() && !uri.empty();
53 * @brief getContent return content of the event
54 * @return event content as string or empty string upon failure
56 const std::string& getContent();
59 * @brief confirm Confirms that event processed correctly
60 * @param response optional confirmation response body
62 void confirm(const std::string& response = std::string{});
65 * @brief getType returns event type
68 const std::string& getType() const
74 * @brief getDescription returns event description
75 * @return event description text
77 const std::string& getDescription() const
83 Connection& connection;
86 std::string confirmUri;
93 } // namespace communication