Adding JsonSchema parser implementation for simulator and Updating Raml Parser.
[platform/upstream/iotivity.git] / service / simulator / ramlparser / raml / model / Response.h
1 /******************************************************************\r
2  *\r
3  * Copyright 2015 Samsung Electronics All Rights Reserved.\r
4  *\r
5  *\r
6  *\r
7  * Licensed under the Apache License, Version 2.0 (the "License");\r
8  * you may not use this file except in compliance with the License.\r
9  * You may obtain a copy of the License at\r
10  *\r
11  *      http://www.apache.org/licenses/LICENSE-2.0\r
12  *\r
13  * Unless required by applicable law or agreed to in writing, software\r
14  * distributed under the License is distributed on an "AS IS" BASIS,\r
15  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
16  * See the License for the specific language governing permissions and\r
17  * limitations under the License.\r
18  *\r
19  ******************************************************************/\r
20 \r
21 #ifndef RESPONSE_H\r
22 #define RESPONSE_H\r
23 \r
24 #include <map>\r
25 #include <list>\r
26 #include <string>\r
27 #include "RequestResponseBody.h"\r
28 #include "Header.h"\r
29 #include "Utils.h"\r
30 #include "IncludeResolver.h"\r
31 \r
32 namespace RAML\r
33 {\r
34     class Response\r
35     {\r
36         public:\r
37             virtual std::map<std::string, HeaderPtr> const &getHeaders() const;\r
38             virtual void setHeader(const std::string &headerName, const HeaderPtr &header);\r
39             virtual std::string getDescription() const;\r
40             virtual void setDescription(const std::string &description);\r
41             virtual void setResponseBody(const std::string &typeName);\r
42             virtual void setResponseBody(const std::string &type, const RequestResponseBodyPtr &body) ;\r
43             virtual std::map<std::string, RequestResponseBodyPtr> const &getResponseBody() const;\r
44             virtual RequestResponseBodyPtr getResponseBody(const std::string &bodyType);\r
45 \r
46 \r
47             Response() : m_includeResolver(NULL) {}\r
48             Response(const YAML::Node &yamlNode,\r
49                      const IncludeResolverPtr &includeResolver): m_includeResolver(includeResolver)  { readResponse(yamlNode);}\r
50         private:\r
51             void readResponse(const YAML::Node &yamlNode) ;\r
52         private:\r
53             std::string m_description;\r
54             std::map<std::string, RequestResponseBodyPtr> m_responseBody;\r
55             std::map<std::string, HeaderPtr> m_headers;\r
56             IncludeResolverPtr m_includeResolver;\r
57     };\r
58     typedef std::shared_ptr<Response> ResponsePtr;\r
59 }\r
60 #endif\r