xref: /openbmc/bmcweb/features/redfish/include/error_messages.hpp (revision 9eb808c1a84a76e92b0e01fa95d3f160f38d7c3f)
1f4c4dcf4SKowalski, Kamil /*
2f4c4dcf4SKowalski, Kamil // Copyright (c) 2018 Intel Corporation
3f4c4dcf4SKowalski, Kamil //
4f4c4dcf4SKowalski, Kamil // Licensed under the Apache License, Version 2.0 (the "License");
5f4c4dcf4SKowalski, Kamil // you may not use this file except in compliance with the License.
6f4c4dcf4SKowalski, Kamil // You may obtain a copy of the License at
7f4c4dcf4SKowalski, Kamil //
8f4c4dcf4SKowalski, Kamil //      http://www.apache.org/licenses/LICENSE-2.0
9f4c4dcf4SKowalski, Kamil //
10f4c4dcf4SKowalski, Kamil // Unless required by applicable law or agreed to in writing, software
11f4c4dcf4SKowalski, Kamil // distributed under the License is distributed on an "AS IS" BASIS,
12f4c4dcf4SKowalski, Kamil // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13f4c4dcf4SKowalski, Kamil // See the License for the specific language governing permissions and
14f4c4dcf4SKowalski, Kamil // limitations under the License.
15f4c4dcf4SKowalski, Kamil */
16f4c4dcf4SKowalski, Kamil #pragma once
1704e438cbSEd Tanous #include "http_response.hpp"
18f12894f8SJason M. Bills 
191214b7e7SGunnar Mills #include <nlohmann/json.hpp>
20df5415fcSEd Tanous #include <source_location.hpp>
211214b7e7SGunnar Mills 
229ea15c35SEd Tanous #include <string>
239ea15c35SEd Tanous 
241abe55efSEd Tanous namespace redfish
251abe55efSEd Tanous {
26f4c4dcf4SKowalski, Kamil 
271abe55efSEd Tanous namespace messages
281abe55efSEd Tanous {
29f4c4dcf4SKowalski, Kamil 
3081856681SAsmitha Karunanithi constexpr const char* messageVersionPrefix = "Base.1.11.0.";
3155c7b7a2SEd Tanous constexpr const char* messageAnnotation = "@Message.ExtendedInfo";
32f4c4dcf4SKowalski, Kamil 
33f4c4dcf4SKowalski, Kamil /**
34f4c4dcf4SKowalski, Kamil  * @brief Formats ResourceInUse message into JSON
35f4c4dcf4SKowalski, Kamil  * Message body: "The change to the requested resource failed because the
36f4c4dcf4SKowalski, Kamil  * resource is in use or in transition."
37f4c4dcf4SKowalski, Kamil  *
38f4c4dcf4SKowalski, Kamil  *
39f4c4dcf4SKowalski, Kamil  * @returns Message ResourceInUse formatted to JSON */
4065176d39SEd Tanous nlohmann::json resourceInUse();
41b5c07418SJames Feist 
42f12894f8SJason M. Bills void resourceInUse(crow::Response& res);
43f4c4dcf4SKowalski, Kamil 
44f4c4dcf4SKowalski, Kamil /**
45f4c4dcf4SKowalski, Kamil  * @brief Formats MalformedJSON message into JSON
46f4c4dcf4SKowalski, Kamil  * Message body: "The request body submitted was malformed JSON and could not be
47f4c4dcf4SKowalski, Kamil  * parsed by the receiving service."
48f4c4dcf4SKowalski, Kamil  *
49f4c4dcf4SKowalski, Kamil  *
50f4c4dcf4SKowalski, Kamil  * @returns Message MalformedJSON formatted to JSON */
5165176d39SEd Tanous nlohmann::json malformedJSON();
52b5c07418SJames Feist 
53f12894f8SJason M. Bills void malformedJSON(crow::Response& res);
54f4c4dcf4SKowalski, Kamil 
55f4c4dcf4SKowalski, Kamil /**
56f4c4dcf4SKowalski, Kamil  * @brief Formats ResourceMissingAtURI message into JSON
5766ac2b8cSJason M. Bills  * Message body: "The resource at the URI <arg1> was not found."
58f4c4dcf4SKowalski, Kamil  *
59f4c4dcf4SKowalski, Kamil  * @param[in] arg1 Parameter of message that will replace %1 in its body.
60f4c4dcf4SKowalski, Kamil  *
61f4c4dcf4SKowalski, Kamil  * @returns Message ResourceMissingAtURI formatted to JSON */
62b5c07418SJames Feist nlohmann::json resourceMissingAtURI(const std::string& arg1);
63b5c07418SJames Feist 
64f12894f8SJason M. Bills void resourceMissingAtURI(crow::Response& res, const std::string& arg1);
65f4c4dcf4SKowalski, Kamil 
66f4c4dcf4SKowalski, Kamil /**
67f4c4dcf4SKowalski, Kamil  * @brief Formats ActionParameterValueFormatError message into JSON
6866ac2b8cSJason M. Bills  * Message body: "The value <arg1> for the parameter <arg2> in the action <arg3>
69f4c4dcf4SKowalski, Kamil  * is of a different format than the parameter can accept."
70f4c4dcf4SKowalski, Kamil  *
71f4c4dcf4SKowalski, Kamil  * @param[in] arg1 Parameter of message that will replace %1 in its body.
72f4c4dcf4SKowalski, Kamil  * @param[in] arg2 Parameter of message that will replace %2 in its body.
73f4c4dcf4SKowalski, Kamil  * @param[in] arg3 Parameter of message that will replace %3 in its body.
74f4c4dcf4SKowalski, Kamil  *
75f4c4dcf4SKowalski, Kamil  * @returns Message ActionParameterValueFormatError formatted to JSON */
76b5c07418SJames Feist nlohmann::json actionParameterValueFormatError(const std::string& arg1,
77b5c07418SJames Feist                                                const std::string& arg2,
78b5c07418SJames Feist                                                const std::string& arg3);
79b5c07418SJames Feist 
80f12894f8SJason M. Bills void actionParameterValueFormatError(crow::Response& res,
81f12894f8SJason M. Bills                                      const std::string& arg1,
82f4c4dcf4SKowalski, Kamil                                      const std::string& arg2,
83f4c4dcf4SKowalski, Kamil                                      const std::string& arg3);
84f4c4dcf4SKowalski, Kamil 
85f4c4dcf4SKowalski, Kamil /**
86f4c4dcf4SKowalski, Kamil  * @brief Formats InternalError message into JSON
87f4c4dcf4SKowalski, Kamil  * Message body: "The request failed due to an internal service error.  The
88f4c4dcf4SKowalski, Kamil  * service is still operational."
89f4c4dcf4SKowalski, Kamil  *
90f4c4dcf4SKowalski, Kamil  *
91f4c4dcf4SKowalski, Kamil  * @returns Message InternalError formatted to JSON */
9265176d39SEd Tanous nlohmann::json internalError();
93b5c07418SJames Feist 
94*9eb808c1SEd Tanous void internalError(crow::Response& res, bmcweb::source_location location =
95df5415fcSEd Tanous                                             bmcweb::source_location::current());
96f12894f8SJason M. Bills 
97f12894f8SJason M. Bills /**
98f4c4dcf4SKowalski, Kamil  * @brief Formats UnrecognizedRequestBody message into JSON
99f4c4dcf4SKowalski, Kamil  * Message body: "The service detected a malformed request body that it was
100f4c4dcf4SKowalski, Kamil  * unable to interpret."
101f4c4dcf4SKowalski, Kamil  *
102f4c4dcf4SKowalski, Kamil  *
103f4c4dcf4SKowalski, Kamil  * @returns Message UnrecognizedRequestBody formatted to JSON */
10465176d39SEd Tanous nlohmann::json unrecognizedRequestBody();
105b5c07418SJames Feist 
106f12894f8SJason M. Bills void unrecognizedRequestBody(crow::Response& res);
107f4c4dcf4SKowalski, Kamil 
108f4c4dcf4SKowalski, Kamil /**
109f4c4dcf4SKowalski, Kamil  * @brief Formats ResourceAtUriUnauthorized message into JSON
11066ac2b8cSJason M. Bills  * Message body: "While accessing the resource at <arg1>, the service received
11166ac2b8cSJason M. Bills  * an authorization error <arg2>."
112f4c4dcf4SKowalski, Kamil  *
113f4c4dcf4SKowalski, Kamil  * @param[in] arg1 Parameter of message that will replace %1 in its body.
114f4c4dcf4SKowalski, Kamil  * @param[in] arg2 Parameter of message that will replace %2 in its body.
115f4c4dcf4SKowalski, Kamil  *
116f4c4dcf4SKowalski, Kamil  * @returns Message ResourceAtUriUnauthorized formatted to JSON */
117b5c07418SJames Feist nlohmann::json resourceAtUriUnauthorized(const std::string& arg1,
118b5c07418SJames Feist                                          const std::string& arg2);
119b5c07418SJames Feist 
120f12894f8SJason M. Bills void resourceAtUriUnauthorized(crow::Response& res, const std::string& arg1,
121f4c4dcf4SKowalski, Kamil                                const std::string& arg2);
122f4c4dcf4SKowalski, Kamil 
123f4c4dcf4SKowalski, Kamil /**
124f4c4dcf4SKowalski, Kamil  * @brief Formats ActionParameterUnknown message into JSON
12566ac2b8cSJason M. Bills  * Message body: "The action <arg1> was submitted with the invalid parameter
12666ac2b8cSJason M. Bills  * <arg2>."
127f4c4dcf4SKowalski, Kamil  *
128f4c4dcf4SKowalski, Kamil  * @param[in] arg1 Parameter of message that will replace %1 in its body.
129f4c4dcf4SKowalski, Kamil  * @param[in] arg2 Parameter of message that will replace %2 in its body.
130f4c4dcf4SKowalski, Kamil  *
131f4c4dcf4SKowalski, Kamil  * @returns Message ActionParameterUnknown formatted to JSON */
132b5c07418SJames Feist nlohmann::json actionParameterUnknown(const std::string& arg1,
133b5c07418SJames Feist                                       const std::string& arg2);
134b5c07418SJames Feist 
135f12894f8SJason M. Bills void actionParameterUnknown(crow::Response& res, const std::string& arg1,
136f4c4dcf4SKowalski, Kamil                             const std::string& arg2);
137f4c4dcf4SKowalski, Kamil 
138f4c4dcf4SKowalski, Kamil /**
139f4c4dcf4SKowalski, Kamil  * @brief Formats ResourceCannotBeDeleted message into JSON
140f4c4dcf4SKowalski, Kamil  * Message body: "The delete request failed because the resource requested
141f4c4dcf4SKowalski, Kamil  * cannot be deleted."
142f4c4dcf4SKowalski, Kamil  *
143f4c4dcf4SKowalski, Kamil  *
144f4c4dcf4SKowalski, Kamil  * @returns Message ResourceCannotBeDeleted formatted to JSON */
14565176d39SEd Tanous nlohmann::json resourceCannotBeDeleted();
146b5c07418SJames Feist 
147f12894f8SJason M. Bills void resourceCannotBeDeleted(crow::Response& res);
148f4c4dcf4SKowalski, Kamil 
149f4c4dcf4SKowalski, Kamil /**
150f4c4dcf4SKowalski, Kamil  * @brief Formats PropertyDuplicate message into JSON
15166ac2b8cSJason M. Bills  * Message body: "The property <arg1> was duplicated in the request."
152f4c4dcf4SKowalski, Kamil  *
153f4c4dcf4SKowalski, Kamil  * @param[in] arg1 Parameter of message that will replace %1 in its body.
154f4c4dcf4SKowalski, Kamil  *
155f4c4dcf4SKowalski, Kamil  * @returns Message PropertyDuplicate formatted to JSON */
156b5c07418SJames Feist nlohmann::json propertyDuplicate(const std::string& arg1);
157b5c07418SJames Feist 
158f12894f8SJason M. Bills void propertyDuplicate(crow::Response& res, const std::string& arg1);
159f4c4dcf4SKowalski, Kamil 
160f4c4dcf4SKowalski, Kamil /**
161f4c4dcf4SKowalski, Kamil  * @brief Formats ServiceTemporarilyUnavailable message into JSON
16266ac2b8cSJason M. Bills  * Message body: "The service is temporarily unavailable.  Retry in <arg1>
163f4c4dcf4SKowalski, Kamil  * seconds."
164f4c4dcf4SKowalski, Kamil  *
165f4c4dcf4SKowalski, Kamil  * @param[in] arg1 Parameter of message that will replace %1 in its body.
166f4c4dcf4SKowalski, Kamil  *
167f4c4dcf4SKowalski, Kamil  * @returns Message ServiceTemporarilyUnavailable formatted to JSON */
168b5c07418SJames Feist nlohmann::json serviceTemporarilyUnavailable(const std::string& arg1);
169b5c07418SJames Feist 
170f12894f8SJason M. Bills void serviceTemporarilyUnavailable(crow::Response& res,
171f12894f8SJason M. Bills                                    const std::string& arg1);
172f4c4dcf4SKowalski, Kamil 
173f4c4dcf4SKowalski, Kamil /**
174f4c4dcf4SKowalski, Kamil  * @brief Formats ResourceAlreadyExists message into JSON
17566ac2b8cSJason M. Bills  * Message body: "The requested resource of type <arg1> with the property <arg2>
17666ac2b8cSJason M. Bills  * with the value <arg3> already exists."
177f4c4dcf4SKowalski, Kamil  *
178f4c4dcf4SKowalski, Kamil  * @param[in] arg1 Parameter of message that will replace %1 in its body.
179f4c4dcf4SKowalski, Kamil  * @param[in] arg2 Parameter of message that will replace %2 in its body.
180f4c4dcf4SKowalski, Kamil  * @param[in] arg3 Parameter of message that will replace %3 in its body.
181f4c4dcf4SKowalski, Kamil  *
182f4c4dcf4SKowalski, Kamil  * @returns Message ResourceAlreadyExists formatted to JSON */
183b5c07418SJames Feist nlohmann::json resourceAlreadyExists(const std::string& arg1,
184b5c07418SJames Feist                                      const std::string& arg2,
185b5c07418SJames Feist                                      const std::string& arg3);
186b5c07418SJames Feist 
187f12894f8SJason M. Bills void resourceAlreadyExists(crow::Response& res, const std::string& arg1,
188f12894f8SJason M. Bills                            const std::string& arg2, const std::string& arg3);
189f4c4dcf4SKowalski, Kamil 
190f4c4dcf4SKowalski, Kamil /**
191f4c4dcf4SKowalski, Kamil  * @brief Formats AccountForSessionNoLongerExists message into JSON
192f4c4dcf4SKowalski, Kamil  * Message body: "The account for the current session has been removed, thus the
193f4c4dcf4SKowalski, Kamil  * current session has been removed as well."
194f4c4dcf4SKowalski, Kamil  *
195f4c4dcf4SKowalski, Kamil  *
196f4c4dcf4SKowalski, Kamil  * @returns Message AccountForSessionNoLongerExists formatted to JSON */
19765176d39SEd Tanous nlohmann::json accountForSessionNoLongerExists();
198b5c07418SJames Feist 
199f12894f8SJason M. Bills void accountForSessionNoLongerExists(crow::Response& res);
200f4c4dcf4SKowalski, Kamil 
201f4c4dcf4SKowalski, Kamil /**
202f4c4dcf4SKowalski, Kamil  * @brief Formats CreateFailedMissingReqProperties message into JSON
203f4c4dcf4SKowalski, Kamil  * Message body: "The create operation failed because the required property
20466ac2b8cSJason M. Bills  * <arg1> was missing from the request."
205f4c4dcf4SKowalski, Kamil  *
206f4c4dcf4SKowalski, Kamil  * @param[in] arg1 Parameter of message that will replace %1 in its body.
207f4c4dcf4SKowalski, Kamil  *
208f4c4dcf4SKowalski, Kamil  * @returns Message CreateFailedMissingReqProperties formatted to JSON */
209b5c07418SJames Feist nlohmann::json createFailedMissingReqProperties(const std::string& arg1);
210b5c07418SJames Feist 
211f12894f8SJason M. Bills void createFailedMissingReqProperties(crow::Response& res,
212f12894f8SJason M. Bills                                       const std::string& arg1);
213f4c4dcf4SKowalski, Kamil 
214f4c4dcf4SKowalski, Kamil /**
215f4c4dcf4SKowalski, Kamil  * @brief Formats PropertyValueFormatError message into JSON
21666ac2b8cSJason M. Bills  * Message body: "The value <arg1> for the property <arg2> is of a different
217f4c4dcf4SKowalski, Kamil  * format than the property can accept."
218f4c4dcf4SKowalski, Kamil  *
219f4c4dcf4SKowalski, Kamil  * @param[in] arg1 Parameter of message that will replace %1 in its body.
220f4c4dcf4SKowalski, Kamil  * @param[in] arg2 Parameter of message that will replace %2 in its body.
221f4c4dcf4SKowalski, Kamil  *
222f4c4dcf4SKowalski, Kamil  * @returns Message PropertyValueFormatError formatted to JSON */
223b5c07418SJames Feist nlohmann::json propertyValueFormatError(const std::string& arg1,
224b5c07418SJames Feist                                         const std::string& arg2);
225b5c07418SJames Feist 
226f12894f8SJason M. Bills void propertyValueFormatError(crow::Response& res, const std::string& arg1,
227f4c4dcf4SKowalski, Kamil                               const std::string& arg2);
228f4c4dcf4SKowalski, Kamil 
229f4c4dcf4SKowalski, Kamil /**
230f4c4dcf4SKowalski, Kamil  * @brief Formats PropertyValueNotInList message into JSON
23166ac2b8cSJason M. Bills  * Message body: "The value <arg1> for the property <arg2> is not in the list of
232f4c4dcf4SKowalski, Kamil  * acceptable values."
233f4c4dcf4SKowalski, Kamil  *
234f4c4dcf4SKowalski, Kamil  * @param[in] arg1 Parameter of message that will replace %1 in its body.
235f4c4dcf4SKowalski, Kamil  * @param[in] arg2 Parameter of message that will replace %2 in its body.
236f4c4dcf4SKowalski, Kamil  *
237f4c4dcf4SKowalski, Kamil  * @returns Message PropertyValueNotInList formatted to JSON */
238b5c07418SJames Feist nlohmann::json propertyValueNotInList(const std::string& arg1,
239b5c07418SJames Feist                                       const std::string& arg2);
240b5c07418SJames Feist 
241f12894f8SJason M. Bills void propertyValueNotInList(crow::Response& res, const std::string& arg1,
242f4c4dcf4SKowalski, Kamil                             const std::string& arg2);
243f4c4dcf4SKowalski, Kamil 
244f4c4dcf4SKowalski, Kamil /**
245f4c4dcf4SKowalski, Kamil  * @brief Formats ResourceAtUriInUnknownFormat message into JSON
24666ac2b8cSJason M. Bills  * Message body: "The resource at <arg1> is in a format not recognized by the
247f4c4dcf4SKowalski, Kamil  * service."
248f4c4dcf4SKowalski, Kamil  *
249f4c4dcf4SKowalski, Kamil  * @param[in] arg1 Parameter of message that will replace %1 in its body.
250f4c4dcf4SKowalski, Kamil  *
251f4c4dcf4SKowalski, Kamil  * @returns Message ResourceAtUriInUnknownFormat formatted to JSON */
252b5c07418SJames Feist nlohmann::json resourceAtUriInUnknownFormat(const std::string& arg1);
253b5c07418SJames Feist 
254f12894f8SJason M. Bills void resourceAtUriInUnknownFormat(crow::Response& res, const std::string& arg1);
255f4c4dcf4SKowalski, Kamil 
256f4c4dcf4SKowalski, Kamil /**
25781856681SAsmitha Karunanithi  * @brief Formats ServiceDisabled message into JSON
25881856681SAsmitha Karunanithi  * Message body: "The operation failed because the service at <arg1> is disabled
25981856681SAsmitha Karunanithi  * and " cannot accept requests."
26081856681SAsmitha Karunanithi  *
26181856681SAsmitha Karunanithi  * @param[in] arg1 Parameter of message that will replace %1 in its body.
26281856681SAsmitha Karunanithi  *
26381856681SAsmitha Karunanithi  * @returns Message ServiceDisabled formatted to JSON */
26481856681SAsmitha Karunanithi nlohmann::json serviceDisabled(const std::string& arg1);
26581856681SAsmitha Karunanithi 
26681856681SAsmitha Karunanithi void serviceDisabled(crow::Response& res, const std::string& arg1);
26781856681SAsmitha Karunanithi 
26881856681SAsmitha Karunanithi /**
269f4c4dcf4SKowalski, Kamil  * @brief Formats ServiceInUnknownState message into JSON
270f4c4dcf4SKowalski, Kamil  * Message body: "The operation failed because the service is in an unknown
271f4c4dcf4SKowalski, Kamil  * state and can no longer take incoming requests."
272f4c4dcf4SKowalski, Kamil  *
273f4c4dcf4SKowalski, Kamil  *
274f4c4dcf4SKowalski, Kamil  * @returns Message ServiceInUnknownState formatted to JSON */
27565176d39SEd Tanous nlohmann::json serviceInUnknownState();
276b5c07418SJames Feist 
277f12894f8SJason M. Bills void serviceInUnknownState(crow::Response& res);
278f4c4dcf4SKowalski, Kamil 
279f4c4dcf4SKowalski, Kamil /**
280f4c4dcf4SKowalski, Kamil  * @brief Formats EventSubscriptionLimitExceeded message into JSON
281f4c4dcf4SKowalski, Kamil  * Message body: "The event subscription failed due to the number of
282f4c4dcf4SKowalski, Kamil  * simultaneous subscriptions exceeding the limit of the implementation."
283f4c4dcf4SKowalski, Kamil  *
284f4c4dcf4SKowalski, Kamil  *
285f4c4dcf4SKowalski, Kamil  * @returns Message EventSubscriptionLimitExceeded formatted to JSON */
28665176d39SEd Tanous nlohmann::json eventSubscriptionLimitExceeded();
287b5c07418SJames Feist 
288f12894f8SJason M. Bills void eventSubscriptionLimitExceeded(crow::Response& res);
289f4c4dcf4SKowalski, Kamil 
290f4c4dcf4SKowalski, Kamil /**
291f4c4dcf4SKowalski, Kamil  * @brief Formats ActionParameterMissing message into JSON
29266ac2b8cSJason M. Bills  * Message body: "The action <arg1> requires the parameter <arg2> to be present
293f4c4dcf4SKowalski, Kamil  * in the request body."
294f4c4dcf4SKowalski, Kamil  *
295f4c4dcf4SKowalski, Kamil  * @param[in] arg1 Parameter of message that will replace %1 in its body.
296f4c4dcf4SKowalski, Kamil  * @param[in] arg2 Parameter of message that will replace %2 in its body.
297f4c4dcf4SKowalski, Kamil  *
298f4c4dcf4SKowalski, Kamil  * @returns Message ActionParameterMissing formatted to JSON */
299b5c07418SJames Feist nlohmann::json actionParameterMissing(const std::string& arg1,
300b5c07418SJames Feist                                       const std::string& arg2);
301b5c07418SJames Feist 
302f12894f8SJason M. Bills void actionParameterMissing(crow::Response& res, const std::string& arg1,
303f4c4dcf4SKowalski, Kamil                             const std::string& arg2);
304f4c4dcf4SKowalski, Kamil 
305f4c4dcf4SKowalski, Kamil /**
306f4c4dcf4SKowalski, Kamil  * @brief Formats StringValueTooLong message into JSON
30766ac2b8cSJason M. Bills  * Message body: "The string <arg1> exceeds the length limit <arg2>."
308f4c4dcf4SKowalski, Kamil  *
309f4c4dcf4SKowalski, Kamil  * @param[in] arg1 Parameter of message that will replace %1 in its body.
310f4c4dcf4SKowalski, Kamil  * @param[in] arg2 Parameter of message that will replace %2 in its body.
311f4c4dcf4SKowalski, Kamil  *
312f4c4dcf4SKowalski, Kamil  * @returns Message StringValueTooLong formatted to JSON */
313331b2017SEd Tanous nlohmann::json stringValueTooLong(const std::string& arg1, int arg2);
314b5c07418SJames Feist 
315331b2017SEd Tanous void stringValueTooLong(crow::Response& res, const std::string& arg1, int arg2);
316f4c4dcf4SKowalski, Kamil 
317f4c4dcf4SKowalski, Kamil /**
318cc9139ecSJason M. Bills  * @brief Formats SessionTerminated message into JSON
319cc9139ecSJason M. Bills  * Message body: "The session was successfully terminated."
320cc9139ecSJason M. Bills  *
321cc9139ecSJason M. Bills  *
322cc9139ecSJason M. Bills  * @returns Message SessionTerminated formatted to JSON */
32365176d39SEd Tanous nlohmann::json sessionTerminated();
324b5c07418SJames Feist 
325cc9139ecSJason M. Bills void sessionTerminated(crow::Response& res);
326cc9139ecSJason M. Bills 
327cc9139ecSJason M. Bills /**
328684bb4b8SJason M. Bills  * @brief Formats SubscriptionTerminated message into JSON
329684bb4b8SJason M. Bills  * Message body: "The event subscription has been terminated."
330684bb4b8SJason M. Bills  *
331684bb4b8SJason M. Bills  *
332684bb4b8SJason M. Bills  * @returns Message SubscriptionTerminated formatted to JSON */
33365176d39SEd Tanous nlohmann::json subscriptionTerminated();
334684bb4b8SJason M. Bills 
335684bb4b8SJason M. Bills void subscriptionTerminated(crow::Response& res);
336684bb4b8SJason M. Bills 
337684bb4b8SJason M. Bills /**
338cc9139ecSJason M. Bills  * @brief Formats ResourceTypeIncompatible message into JSON
339cc9139ecSJason M. Bills  * Message body: "The @odata.type of the request body <arg1> is incompatible
340cc9139ecSJason M. Bills  * with the @odata.type of the resource which is <arg2>."
341cc9139ecSJason M. Bills  *
342cc9139ecSJason M. Bills  * @param[in] arg1 Parameter of message that will replace %1 in its body.
343cc9139ecSJason M. Bills  * @param[in] arg2 Parameter of message that will replace %2 in its body.
344cc9139ecSJason M. Bills  *
345cc9139ecSJason M. Bills  * @returns Message ResourceTypeIncompatible formatted to JSON */
346b5c07418SJames Feist nlohmann::json resourceTypeIncompatible(const std::string& arg1,
347b5c07418SJames Feist                                         const std::string& arg2);
348b5c07418SJames Feist 
349cc9139ecSJason M. Bills void resourceTypeIncompatible(crow::Response& res, const std::string& arg1,
350cc9139ecSJason M. Bills                               const std::string& arg2);
351cc9139ecSJason M. Bills 
352cc9139ecSJason M. Bills /**
353684bb4b8SJason M. Bills  * @brief Formats ResetRequired message into JSON
354684bb4b8SJason M. Bills  * Message body: "In order to complete the operation, a component reset is
355684bb4b8SJason M. Bills  * required with the Reset action URI '<arg1>' and ResetType '<arg2>'."
356684bb4b8SJason M. Bills  *
357684bb4b8SJason M. Bills  * @param[in] arg1 Parameter of message that will replace %1 in its body.
358684bb4b8SJason M. Bills  * @param[in] arg2 Parameter of message that will replace %2 in its body.
359684bb4b8SJason M. Bills  *
360684bb4b8SJason M. Bills  * @returns Message ResetRequired formatted to JSON */
361684bb4b8SJason M. Bills nlohmann::json resetRequired(const std::string& arg1, const std::string& arg2);
362684bb4b8SJason M. Bills 
363684bb4b8SJason M. Bills void resetRequired(crow::Response& res, const std::string& arg1,
364684bb4b8SJason M. Bills                    const std::string& arg2);
365684bb4b8SJason M. Bills 
366684bb4b8SJason M. Bills /**
367684bb4b8SJason M. Bills  * @brief Formats ChassisPowerStateOnRequired message into JSON
368684bb4b8SJason M. Bills  * Message body: "The Chassis with Id '<arg1>' requires to be powered on to
369684bb4b8SJason M. Bills  * perform this request."
370684bb4b8SJason M. Bills  *
371684bb4b8SJason M. Bills  * @param[in] arg1 Parameter of message that will replace %1 in its body.
372684bb4b8SJason M. Bills  *
373684bb4b8SJason M. Bills  * @returns Message ChassisPowerStateOnRequired formatted to JSON */
374684bb4b8SJason M. Bills nlohmann::json chassisPowerStateOnRequired(const std::string& arg1);
375684bb4b8SJason M. Bills 
376684bb4b8SJason M. Bills void chassisPowerStateOnRequired(crow::Response& res, const std::string& arg1);
377684bb4b8SJason M. Bills 
378684bb4b8SJason M. Bills /**
379684bb4b8SJason M. Bills  * @brief Formats ChassisPowerStateOffRequired message into JSON
380684bb4b8SJason M. Bills  * Message body: "The Chassis with Id '<arg1>' requires to be powered off to
381684bb4b8SJason M. Bills  * perform this request."
382684bb4b8SJason M. Bills  *
383684bb4b8SJason M. Bills  * @param[in] arg1 Parameter of message that will replace %1 in its body.
384684bb4b8SJason M. Bills  *
385684bb4b8SJason M. Bills  * @returns Message ChassisPowerStateOffRequired formatted to JSON */
386684bb4b8SJason M. Bills nlohmann::json chassisPowerStateOffRequired(const std::string& arg1);
387684bb4b8SJason M. Bills 
388684bb4b8SJason M. Bills void chassisPowerStateOffRequired(crow::Response& res, const std::string& arg1);
389684bb4b8SJason M. Bills 
390684bb4b8SJason M. Bills /**
391684bb4b8SJason M. Bills  * @brief Formats PropertyValueConflict message into JSON
392684bb4b8SJason M. Bills  * Message body: "The property '<arg1>' could not be written because its value
393684bb4b8SJason M. Bills  * would conflict with the value of the '<arg2>' property."
394684bb4b8SJason M. Bills  *
395684bb4b8SJason M. Bills  * @param[in] arg1 Parameter of message that will replace %1 in its body.
396684bb4b8SJason M. Bills  * @param[in] arg2 Parameter of message that will replace %2 in its body.
397684bb4b8SJason M. Bills  *
398684bb4b8SJason M. Bills  * @returns Message PropertyValueConflict formatted to JSON */
399684bb4b8SJason M. Bills nlohmann::json propertyValueConflict(const std::string& arg1,
400684bb4b8SJason M. Bills                                      const std::string& arg2);
401684bb4b8SJason M. Bills 
402684bb4b8SJason M. Bills void propertyValueConflict(crow::Response& res, const std::string& arg1,
403684bb4b8SJason M. Bills                            const std::string& arg2);
404684bb4b8SJason M. Bills 
405684bb4b8SJason M. Bills /**
406684bb4b8SJason M. Bills  * @brief Formats PropertyValueIncorrect message into JSON
407684bb4b8SJason M. Bills  * Message body: "The property '<arg1>' with the requested value of '<arg2>'
408684bb4b8SJason M. Bills  * could not be written because the value does not meet the constraints of the
409684bb4b8SJason M. Bills  * implementation."
410684bb4b8SJason M. Bills  *
411684bb4b8SJason M. Bills  * @param[in] arg1 Parameter of message that will replace %1 in its body.
412684bb4b8SJason M. Bills  * @param[in] arg2 Parameter of message that will replace %2 in its body.
413684bb4b8SJason M. Bills  *
414684bb4b8SJason M. Bills  * @returns Message PropertyValueIncorrect formatted to JSON */
415684bb4b8SJason M. Bills nlohmann::json propertyValueIncorrect(const std::string& arg1,
416684bb4b8SJason M. Bills                                       const std::string& arg2);
417684bb4b8SJason M. Bills 
418684bb4b8SJason M. Bills void propertyValueIncorrect(crow::Response& res, const std::string& arg1,
419684bb4b8SJason M. Bills                             const std::string& arg2);
420684bb4b8SJason M. Bills 
421684bb4b8SJason M. Bills /**
422684bb4b8SJason M. Bills  * @brief Formats ResourceCreationConflict message into JSON
423684bb4b8SJason M. Bills  * Message body: "The resource could not be created.  The service has a resource
424684bb4b8SJason M. Bills  * at URI '<arg1>' that conflicts with the creation request."
425684bb4b8SJason M. Bills  *
426684bb4b8SJason M. Bills  * @param[in] arg1 Parameter of message that will replace %1 in its body.
427684bb4b8SJason M. Bills  *
428684bb4b8SJason M. Bills  * @returns Message ResourceCreationConflict formatted to JSON */
429684bb4b8SJason M. Bills nlohmann::json resourceCreationConflict(const std::string& arg1);
430684bb4b8SJason M. Bills 
431684bb4b8SJason M. Bills void resourceCreationConflict(crow::Response& res, const std::string& arg1);
432684bb4b8SJason M. Bills 
433684bb4b8SJason M. Bills /**
434684bb4b8SJason M. Bills  * @brief Formats MaximumErrorsExceeded message into JSON
435684bb4b8SJason M. Bills  * Message body: "Too many errors have occurred to report them all."
436684bb4b8SJason M. Bills  *
437684bb4b8SJason M. Bills  *
438684bb4b8SJason M. Bills  * @returns Message MaximumErrorsExceeded formatted to JSON */
43965176d39SEd Tanous nlohmann::json maximumErrorsExceeded();
440684bb4b8SJason M. Bills 
441684bb4b8SJason M. Bills void maximumErrorsExceeded(crow::Response& res);
442684bb4b8SJason M. Bills 
443684bb4b8SJason M. Bills /**
444684bb4b8SJason M. Bills  * @brief Formats PreconditionFailed message into JSON
445684bb4b8SJason M. Bills  * Message body: "The ETag supplied did not match the ETag required to change
446684bb4b8SJason M. Bills  * this resource."
447684bb4b8SJason M. Bills  *
448684bb4b8SJason M. Bills  *
449684bb4b8SJason M. Bills  * @returns Message PreconditionFailed formatted to JSON */
45065176d39SEd Tanous nlohmann::json preconditionFailed();
451684bb4b8SJason M. Bills 
452684bb4b8SJason M. Bills void preconditionFailed(crow::Response& res);
453684bb4b8SJason M. Bills 
454684bb4b8SJason M. Bills /**
455684bb4b8SJason M. Bills  * @brief Formats PreconditionRequired message into JSON
456684bb4b8SJason M. Bills  * Message body: "A precondition header or annotation is required to change this
457684bb4b8SJason M. Bills  * resource."
458684bb4b8SJason M. Bills  *
459684bb4b8SJason M. Bills  *
460684bb4b8SJason M. Bills  * @returns Message PreconditionRequired formatted to JSON */
46165176d39SEd Tanous nlohmann::json preconditionRequired();
462684bb4b8SJason M. Bills 
463684bb4b8SJason M. Bills void preconditionRequired(crow::Response& res);
464684bb4b8SJason M. Bills 
465684bb4b8SJason M. Bills /**
466684bb4b8SJason M. Bills  * @brief Formats OperationFailed message into JSON
467684bb4b8SJason M. Bills  * Message body: "An error occurred internal to the service as part of the
468684bb4b8SJason M. Bills  * overall request.  Partial results may have been returned."
469684bb4b8SJason M. Bills  *
470684bb4b8SJason M. Bills  *
471684bb4b8SJason M. Bills  * @returns Message OperationFailed formatted to JSON */
47265176d39SEd Tanous nlohmann::json operationFailed();
473684bb4b8SJason M. Bills 
474684bb4b8SJason M. Bills void operationFailed(crow::Response& res);
475684bb4b8SJason M. Bills 
476684bb4b8SJason M. Bills /**
477684bb4b8SJason M. Bills  * @brief Formats OperationTimeout message into JSON
478684bb4b8SJason M. Bills  * Message body: "A timeout internal to the service occured as part of the
479684bb4b8SJason M. Bills  * request.  Partial results may have been returned."
480684bb4b8SJason M. Bills  *
481684bb4b8SJason M. Bills  *
482684bb4b8SJason M. Bills  * @returns Message OperationTimeout formatted to JSON */
48365176d39SEd Tanous nlohmann::json operationTimeout();
484684bb4b8SJason M. Bills 
485684bb4b8SJason M. Bills void operationTimeout(crow::Response& res);
486684bb4b8SJason M. Bills 
487684bb4b8SJason M. Bills /**
488f4c4dcf4SKowalski, Kamil  * @brief Formats PropertyValueTypeError message into JSON
48966ac2b8cSJason M. Bills  * Message body: "The value <arg1> for the property <arg2> is of a different
490f4c4dcf4SKowalski, Kamil  * type than the property can accept."
491f4c4dcf4SKowalski, Kamil  *
492f4c4dcf4SKowalski, Kamil  * @param[in] arg1 Parameter of message that will replace %1 in its body.
493f4c4dcf4SKowalski, Kamil  * @param[in] arg2 Parameter of message that will replace %2 in its body.
494f4c4dcf4SKowalski, Kamil  *
495f4c4dcf4SKowalski, Kamil  * @returns Message PropertyValueTypeError formatted to JSON */
496b5c07418SJames Feist nlohmann::json propertyValueTypeError(const std::string& arg1,
497b5c07418SJames Feist                                       const std::string& arg2);
498b5c07418SJames Feist 
499f12894f8SJason M. Bills void propertyValueTypeError(crow::Response& res, const std::string& arg1,
500f4c4dcf4SKowalski, Kamil                             const std::string& arg2);
501f4c4dcf4SKowalski, Kamil 
502f4c4dcf4SKowalski, Kamil /**
503f4c4dcf4SKowalski, Kamil  * @brief Formats ResourceNotFound message into JSON
50466ac2b8cSJason M. Bills  * Message body: "The requested resource of type <arg1> named <arg2> was not
505f4c4dcf4SKowalski, Kamil  * found."
506f4c4dcf4SKowalski, Kamil  *
507f4c4dcf4SKowalski, Kamil  * @param[in] arg1 Parameter of message that will replace %1 in its body.
508f4c4dcf4SKowalski, Kamil  * @param[in] arg2 Parameter of message that will replace %2 in its body.
509f4c4dcf4SKowalski, Kamil  *
510f4c4dcf4SKowalski, Kamil  * @returns Message ResourceNotFound formatted to JSON */
511b5c07418SJames Feist nlohmann::json resourceNotFound(const std::string& arg1,
512b5c07418SJames Feist                                 const std::string& arg2);
513b5c07418SJames Feist 
514f12894f8SJason M. Bills void resourceNotFound(crow::Response& res, const std::string& arg1,
515f4c4dcf4SKowalski, Kamil                       const std::string& arg2);
516f4c4dcf4SKowalski, Kamil 
517f4c4dcf4SKowalski, Kamil /**
518f4c4dcf4SKowalski, Kamil  * @brief Formats CouldNotEstablishConnection message into JSON
51955c7b7a2SEd Tanous  * Message body: "The service failed to establish a Connection with the URI
52066ac2b8cSJason M. Bills  * <arg1>."
521f4c4dcf4SKowalski, Kamil  *
522f4c4dcf4SKowalski, Kamil  * @param[in] arg1 Parameter of message that will replace %1 in its body.
523f4c4dcf4SKowalski, Kamil  *
524f4c4dcf4SKowalski, Kamil  * @returns Message CouldNotEstablishConnection formatted to JSON */
525b5c07418SJames Feist nlohmann::json couldNotEstablishConnection(const std::string& arg1);
526b5c07418SJames Feist 
527f12894f8SJason M. Bills void couldNotEstablishConnection(crow::Response& res, const std::string& arg1);
528f4c4dcf4SKowalski, Kamil 
529f4c4dcf4SKowalski, Kamil /**
530f4c4dcf4SKowalski, Kamil  * @brief Formats PropertyNotWritable message into JSON
53166ac2b8cSJason M. Bills  * Message body: "The property <arg1> is a read only property and cannot be
532f4c4dcf4SKowalski, Kamil  * assigned a value."
533f4c4dcf4SKowalski, Kamil  *
534f4c4dcf4SKowalski, Kamil  * @param[in] arg1 Parameter of message that will replace %1 in its body.
535f4c4dcf4SKowalski, Kamil  *
536f4c4dcf4SKowalski, Kamil  * @returns Message PropertyNotWritable formatted to JSON */
537b5c07418SJames Feist nlohmann::json propertyNotWritable(const std::string& arg1);
538b5c07418SJames Feist 
539f12894f8SJason M. Bills void propertyNotWritable(crow::Response& res, const std::string& arg1);
540f12894f8SJason M. Bills 
541f12894f8SJason M. Bills /**
542f4c4dcf4SKowalski, Kamil  * @brief Formats QueryParameterValueTypeError message into JSON
54366ac2b8cSJason M. Bills  * Message body: "The value <arg1> for the query parameter <arg2> is of a
544f4c4dcf4SKowalski, Kamil  * different type than the parameter can accept."
545f4c4dcf4SKowalski, Kamil  *
546f4c4dcf4SKowalski, Kamil  * @param[in] arg1 Parameter of message that will replace %1 in its body.
547f4c4dcf4SKowalski, Kamil  * @param[in] arg2 Parameter of message that will replace %2 in its body.
548f4c4dcf4SKowalski, Kamil  *
549f4c4dcf4SKowalski, Kamil  * @returns Message QueryParameterValueTypeError formatted to JSON */
550b5c07418SJames Feist nlohmann::json queryParameterValueTypeError(const std::string& arg1,
551b5c07418SJames Feist                                             const std::string& arg2);
552b5c07418SJames Feist 
553f12894f8SJason M. Bills void queryParameterValueTypeError(crow::Response& res, const std::string& arg1,
554f4c4dcf4SKowalski, Kamil                                   const std::string& arg2);
555f4c4dcf4SKowalski, Kamil 
556f4c4dcf4SKowalski, Kamil /**
557f4c4dcf4SKowalski, Kamil  * @brief Formats ServiceShuttingDown message into JSON
558f4c4dcf4SKowalski, Kamil  * Message body: "The operation failed because the service is shutting down and
559f4c4dcf4SKowalski, Kamil  * can no longer take incoming requests."
560f4c4dcf4SKowalski, Kamil  *
561f4c4dcf4SKowalski, Kamil  *
562f4c4dcf4SKowalski, Kamil  * @returns Message ServiceShuttingDown formatted to JSON */
56365176d39SEd Tanous nlohmann::json serviceShuttingDown();
564b5c07418SJames Feist 
565f12894f8SJason M. Bills void serviceShuttingDown(crow::Response& res);
566f4c4dcf4SKowalski, Kamil 
567f4c4dcf4SKowalski, Kamil /**
568f4c4dcf4SKowalski, Kamil  * @brief Formats ActionParameterDuplicate message into JSON
56966ac2b8cSJason M. Bills  * Message body: "The action <arg1> was submitted with more than one value for
57066ac2b8cSJason M. Bills  * the parameter <arg2>."
571f4c4dcf4SKowalski, Kamil  *
572f4c4dcf4SKowalski, Kamil  * @param[in] arg1 Parameter of message that will replace %1 in its body.
573f4c4dcf4SKowalski, Kamil  * @param[in] arg2 Parameter of message that will replace %2 in its body.
574f4c4dcf4SKowalski, Kamil  *
575f4c4dcf4SKowalski, Kamil  * @returns Message ActionParameterDuplicate formatted to JSON */
576b5c07418SJames Feist nlohmann::json actionParameterDuplicate(const std::string& arg1,
577b5c07418SJames Feist                                         const std::string& arg2);
578b5c07418SJames Feist 
579f12894f8SJason M. Bills void actionParameterDuplicate(crow::Response& res, const std::string& arg1,
580f4c4dcf4SKowalski, Kamil                               const std::string& arg2);
581f4c4dcf4SKowalski, Kamil 
582f4c4dcf4SKowalski, Kamil /**
583f4c4dcf4SKowalski, Kamil  * @brief Formats ActionParameterNotSupported message into JSON
58466ac2b8cSJason M. Bills  * Message body: "The parameter <arg1> for the action <arg2> is not supported on
585f4c4dcf4SKowalski, Kamil  * the target resource."
586f4c4dcf4SKowalski, Kamil  *
587f4c4dcf4SKowalski, Kamil  * @param[in] arg1 Parameter of message that will replace %1 in its body.
588f4c4dcf4SKowalski, Kamil  * @param[in] arg2 Parameter of message that will replace %2 in its body.
589f4c4dcf4SKowalski, Kamil  *
590f4c4dcf4SKowalski, Kamil  * @returns Message ActionParameterNotSupported formatted to JSON */
591b5c07418SJames Feist nlohmann::json actionParameterNotSupported(const std::string& arg1,
592b5c07418SJames Feist                                            const std::string& arg2);
593b5c07418SJames Feist 
594f12894f8SJason M. Bills void actionParameterNotSupported(crow::Response& res, const std::string& arg1,
595f4c4dcf4SKowalski, Kamil                                  const std::string& arg2);
596f4c4dcf4SKowalski, Kamil 
597f4c4dcf4SKowalski, Kamil /**
598f4c4dcf4SKowalski, Kamil  * @brief Formats SourceDoesNotSupportProtocol message into JSON
59966ac2b8cSJason M. Bills  * Message body: "The other end of the Connection at <arg1> does not support the
60066ac2b8cSJason M. Bills  * specified protocol <arg2>."
601f4c4dcf4SKowalski, Kamil  *
602f4c4dcf4SKowalski, Kamil  * @param[in] arg1 Parameter of message that will replace %1 in its body.
603f4c4dcf4SKowalski, Kamil  * @param[in] arg2 Parameter of message that will replace %2 in its body.
604f4c4dcf4SKowalski, Kamil  *
605f4c4dcf4SKowalski, Kamil  * @returns Message SourceDoesNotSupportProtocol formatted to JSON */
606b5c07418SJames Feist nlohmann::json sourceDoesNotSupportProtocol(const std::string& arg1,
607b5c07418SJames Feist                                             const std::string& arg2);
608b5c07418SJames Feist 
609f12894f8SJason M. Bills void sourceDoesNotSupportProtocol(crow::Response& res, const std::string& arg1,
610f4c4dcf4SKowalski, Kamil                                   const std::string& arg2);
611f4c4dcf4SKowalski, Kamil 
612f4c4dcf4SKowalski, Kamil /**
613f4c4dcf4SKowalski, Kamil  * @brief Formats AccountRemoved message into JSON
614f4c4dcf4SKowalski, Kamil  * Message body: "The account was successfully removed."
615f4c4dcf4SKowalski, Kamil  *
616f4c4dcf4SKowalski, Kamil  *
617f4c4dcf4SKowalski, Kamil  * @returns Message AccountRemoved formatted to JSON */
61865176d39SEd Tanous nlohmann::json accountRemoved();
619b5c07418SJames Feist 
620f12894f8SJason M. Bills void accountRemoved(crow::Response& res);
621f4c4dcf4SKowalski, Kamil 
622f4c4dcf4SKowalski, Kamil /**
623f4c4dcf4SKowalski, Kamil  * @brief Formats AccessDenied message into JSON
62466ac2b8cSJason M. Bills  * Message body: "While attempting to establish a Connection to <arg1>, the
625f4c4dcf4SKowalski, Kamil  * service denied access."
626f4c4dcf4SKowalski, Kamil  *
627f4c4dcf4SKowalski, Kamil  * @param[in] arg1 Parameter of message that will replace %1 in its body.
628f4c4dcf4SKowalski, Kamil  *
629f4c4dcf4SKowalski, Kamil  * @returns Message AccessDenied formatted to JSON */
630b5c07418SJames Feist nlohmann::json accessDenied(const std::string& arg1);
631b5c07418SJames Feist 
632f12894f8SJason M. Bills void accessDenied(crow::Response& res, const std::string& arg1);
633f4c4dcf4SKowalski, Kamil 
634f4c4dcf4SKowalski, Kamil /**
635f4c4dcf4SKowalski, Kamil  * @brief Formats QueryNotSupported message into JSON
636f4c4dcf4SKowalski, Kamil  * Message body: "Querying is not supported by the implementation."
637f4c4dcf4SKowalski, Kamil  *
638f4c4dcf4SKowalski, Kamil  *
639f4c4dcf4SKowalski, Kamil  * @returns Message QueryNotSupported formatted to JSON */
64065176d39SEd Tanous nlohmann::json queryNotSupported();
641b5c07418SJames Feist 
642f12894f8SJason M. Bills void queryNotSupported(crow::Response& res);
643f4c4dcf4SKowalski, Kamil 
644f4c4dcf4SKowalski, Kamil /**
645f4c4dcf4SKowalski, Kamil  * @brief Formats CreateLimitReachedForResource message into JSON
646f4c4dcf4SKowalski, Kamil  * Message body: "The create operation failed because the resource has reached
647f4c4dcf4SKowalski, Kamil  * the limit of possible resources."
648f4c4dcf4SKowalski, Kamil  *
649f4c4dcf4SKowalski, Kamil  *
650f4c4dcf4SKowalski, Kamil  * @returns Message CreateLimitReachedForResource formatted to JSON */
65165176d39SEd Tanous nlohmann::json createLimitReachedForResource();
652b5c07418SJames Feist 
653f12894f8SJason M. Bills void createLimitReachedForResource(crow::Response& res);
654f4c4dcf4SKowalski, Kamil 
655f4c4dcf4SKowalski, Kamil /**
656f4c4dcf4SKowalski, Kamil  * @brief Formats GeneralError message into JSON
657f4c4dcf4SKowalski, Kamil  * Message body: "A general error has occurred. See ExtendedInfo for more
658f4c4dcf4SKowalski, Kamil  * information."
659f4c4dcf4SKowalski, Kamil  *
660f4c4dcf4SKowalski, Kamil  *
661f4c4dcf4SKowalski, Kamil  * @returns Message GeneralError formatted to JSON */
66265176d39SEd Tanous nlohmann::json generalError();
663b5c07418SJames Feist 
664f12894f8SJason M. Bills void generalError(crow::Response& res);
665f4c4dcf4SKowalski, Kamil 
666f4c4dcf4SKowalski, Kamil /**
667f4c4dcf4SKowalski, Kamil  * @brief Formats Success message into JSON
668f4c4dcf4SKowalski, Kamil  * Message body: "Successfully Completed Request"
669f4c4dcf4SKowalski, Kamil  *
670f4c4dcf4SKowalski, Kamil  *
671f4c4dcf4SKowalski, Kamil  * @returns Message Success formatted to JSON */
67265176d39SEd Tanous nlohmann::json success();
673b5c07418SJames Feist 
674f12894f8SJason M. Bills void success(crow::Response& res);
675f12894f8SJason M. Bills 
676f12894f8SJason M. Bills /**
677f4c4dcf4SKowalski, Kamil  * @brief Formats Created message into JSON
678f4c4dcf4SKowalski, Kamil  * Message body: "The resource has been created successfully"
679f4c4dcf4SKowalski, Kamil  *
680f4c4dcf4SKowalski, Kamil  *
681f4c4dcf4SKowalski, Kamil  * @returns Message Created formatted to JSON */
68265176d39SEd Tanous nlohmann::json created();
683b5c07418SJames Feist 
684f12894f8SJason M. Bills void created(crow::Response& res);
685f4c4dcf4SKowalski, Kamil 
686f4c4dcf4SKowalski, Kamil /**
687cc9139ecSJason M. Bills  * @brief Formats NoOperation message into JSON
688cc9139ecSJason M. Bills  * Message body: "The request body submitted contain no data to act upon and
689cc9139ecSJason M. Bills  * no changes to the resource took place."
690cc9139ecSJason M. Bills  *
691cc9139ecSJason M. Bills  *
692cc9139ecSJason M. Bills  * @returns Message NoOperation formatted to JSON */
69365176d39SEd Tanous nlohmann::json noOperation();
694b5c07418SJames Feist 
695cc9139ecSJason M. Bills void noOperation(crow::Response& res);
696cc9139ecSJason M. Bills 
697cc9139ecSJason M. Bills /**
698f4c4dcf4SKowalski, Kamil  * @brief Formats PropertyUnknown message into JSON
69966ac2b8cSJason M. Bills  * Message body: "The property <arg1> is not in the list of valid properties for
700f4c4dcf4SKowalski, Kamil  * the resource."
701f4c4dcf4SKowalski, Kamil  *
702f4c4dcf4SKowalski, Kamil  * @param[in] arg1 Parameter of message that will replace %1 in its body.
703f4c4dcf4SKowalski, Kamil  *
704f4c4dcf4SKowalski, Kamil  * @returns Message PropertyUnknown formatted to JSON */
705b5c07418SJames Feist nlohmann::json propertyUnknown(const std::string& arg1);
706b5c07418SJames Feist 
707f12894f8SJason M. Bills void propertyUnknown(crow::Response& res, const std::string& arg1);
708f12894f8SJason M. Bills 
709f12894f8SJason M. Bills /**
710f4c4dcf4SKowalski, Kamil  * @brief Formats NoValidSession message into JSON
711f4c4dcf4SKowalski, Kamil  * Message body: "There is no valid session established with the
712f4c4dcf4SKowalski, Kamil  * implementation."
713f4c4dcf4SKowalski, Kamil  *
714f4c4dcf4SKowalski, Kamil  *
715f4c4dcf4SKowalski, Kamil  * @returns Message NoValidSession formatted to JSON */
71665176d39SEd Tanous nlohmann::json noValidSession();
717b5c07418SJames Feist 
718f12894f8SJason M. Bills void noValidSession(crow::Response& res);
719f4c4dcf4SKowalski, Kamil 
720f4c4dcf4SKowalski, Kamil /**
721f4c4dcf4SKowalski, Kamil  * @brief Formats InvalidObject message into JSON
72266ac2b8cSJason M. Bills  * Message body: "The object at <arg1> is invalid."
723f4c4dcf4SKowalski, Kamil  *
724f4c4dcf4SKowalski, Kamil  * @param[in] arg1 Parameter of message that will replace %1 in its body.
725f4c4dcf4SKowalski, Kamil  *
726f4c4dcf4SKowalski, Kamil  * @returns Message InvalidObject formatted to JSON */
727b5c07418SJames Feist nlohmann::json invalidObject(const std::string& arg1);
728b5c07418SJames Feist 
729f12894f8SJason M. Bills void invalidObject(crow::Response& res, const std::string& arg1);
730f4c4dcf4SKowalski, Kamil 
731f4c4dcf4SKowalski, Kamil /**
732f4c4dcf4SKowalski, Kamil  * @brief Formats ResourceInStandby message into JSON
733f4c4dcf4SKowalski, Kamil  * Message body: "The request could not be performed because the resource is in
734f4c4dcf4SKowalski, Kamil  * standby."
735f4c4dcf4SKowalski, Kamil  *
736f4c4dcf4SKowalski, Kamil  *
737f4c4dcf4SKowalski, Kamil  * @returns Message ResourceInStandby formatted to JSON */
73865176d39SEd Tanous nlohmann::json resourceInStandby();
739b5c07418SJames Feist 
740f12894f8SJason M. Bills void resourceInStandby(crow::Response& res);
741f4c4dcf4SKowalski, Kamil 
742f4c4dcf4SKowalski, Kamil /**
743f4c4dcf4SKowalski, Kamil  * @brief Formats ActionParameterValueTypeError message into JSON
74466ac2b8cSJason M. Bills  * Message body: "The value <arg1> for the parameter <arg2> in the action <arg3>
745f4c4dcf4SKowalski, Kamil  * is of a different type than the parameter can accept."
746f4c4dcf4SKowalski, Kamil  *
747f4c4dcf4SKowalski, Kamil  * @param[in] arg1 Parameter of message that will replace %1 in its body.
748f4c4dcf4SKowalski, Kamil  * @param[in] arg2 Parameter of message that will replace %2 in its body.
749f4c4dcf4SKowalski, Kamil  * @param[in] arg3 Parameter of message that will replace %3 in its body.
750f4c4dcf4SKowalski, Kamil  *
751f4c4dcf4SKowalski, Kamil  * @returns Message ActionParameterValueTypeError formatted to JSON */
752b5c07418SJames Feist nlohmann::json actionParameterValueTypeError(const std::string& arg1,
753b5c07418SJames Feist                                              const std::string& arg2,
754b5c07418SJames Feist                                              const std::string& arg3);
755b5c07418SJames Feist 
756f12894f8SJason M. Bills void actionParameterValueTypeError(crow::Response& res, const std::string& arg1,
757f4c4dcf4SKowalski, Kamil                                    const std::string& arg2,
758f4c4dcf4SKowalski, Kamil                                    const std::string& arg3);
759f4c4dcf4SKowalski, Kamil 
760f4c4dcf4SKowalski, Kamil /**
761f4c4dcf4SKowalski, Kamil  * @brief Formats SessionLimitExceeded message into JSON
762f4c4dcf4SKowalski, Kamil  * Message body: "The session establishment failed due to the number of
763f4c4dcf4SKowalski, Kamil  * simultaneous sessions exceeding the limit of the implementation."
764f4c4dcf4SKowalski, Kamil  *
765f4c4dcf4SKowalski, Kamil  *
766f4c4dcf4SKowalski, Kamil  * @returns Message SessionLimitExceeded formatted to JSON */
76765176d39SEd Tanous nlohmann::json sessionLimitExceeded();
768b5c07418SJames Feist 
769f12894f8SJason M. Bills void sessionLimitExceeded(crow::Response& res);
770f4c4dcf4SKowalski, Kamil 
771f4c4dcf4SKowalski, Kamil /**
772f4c4dcf4SKowalski, Kamil  * @brief Formats ActionNotSupported message into JSON
77366ac2b8cSJason M. Bills  * Message body: "The action <arg1> is not supported by the resource."
774f4c4dcf4SKowalski, Kamil  *
775f4c4dcf4SKowalski, Kamil  * @param[in] arg1 Parameter of message that will replace %1 in its body.
776f4c4dcf4SKowalski, Kamil  *
777f4c4dcf4SKowalski, Kamil  * @returns Message ActionNotSupported formatted to JSON */
778b5c07418SJames Feist nlohmann::json actionNotSupported(const std::string& arg1);
779b5c07418SJames Feist 
780f12894f8SJason M. Bills void actionNotSupported(crow::Response& res, const std::string& arg1);
781f4c4dcf4SKowalski, Kamil 
782f4c4dcf4SKowalski, Kamil /**
783f4c4dcf4SKowalski, Kamil  * @brief Formats InvalidIndex message into JSON
78466ac2b8cSJason M. Bills  * Message body: "The index <arg1> is not a valid offset into the array."
785f4c4dcf4SKowalski, Kamil  *
786f4c4dcf4SKowalski, Kamil  * @param[in] arg1 Parameter of message that will replace %1 in its body.
787f4c4dcf4SKowalski, Kamil  *
788f4c4dcf4SKowalski, Kamil  * @returns Message InvalidIndex formatted to JSON */
7895187e09bSJosh Lehan nlohmann::json invalidIndex(int64_t arg1);
790b5c07418SJames Feist 
7915187e09bSJosh Lehan void invalidIndex(crow::Response& res, int64_t arg1);
792f4c4dcf4SKowalski, Kamil 
793f4c4dcf4SKowalski, Kamil /**
794f4c4dcf4SKowalski, Kamil  * @brief Formats EmptyJSON message into JSON
795f4c4dcf4SKowalski, Kamil  * Message body: "The request body submitted contained an empty JSON object and
796f4c4dcf4SKowalski, Kamil  * the service is unable to process it."
797f4c4dcf4SKowalski, Kamil  *
798f4c4dcf4SKowalski, Kamil  *
799f4c4dcf4SKowalski, Kamil  * @returns Message EmptyJSON formatted to JSON */
80065176d39SEd Tanous nlohmann::json emptyJSON();
801b5c07418SJames Feist 
802f12894f8SJason M. Bills void emptyJSON(crow::Response& res);
803f4c4dcf4SKowalski, Kamil 
804f4c4dcf4SKowalski, Kamil /**
805f4c4dcf4SKowalski, Kamil  * @brief Formats QueryNotSupportedOnResource message into JSON
806f4c4dcf4SKowalski, Kamil  * Message body: "Querying is not supported on the requested resource."
807f4c4dcf4SKowalski, Kamil  *
808f4c4dcf4SKowalski, Kamil  *
809f4c4dcf4SKowalski, Kamil  * @returns Message QueryNotSupportedOnResource formatted to JSON */
81065176d39SEd Tanous nlohmann::json queryNotSupportedOnResource();
811b5c07418SJames Feist 
812f12894f8SJason M. Bills void queryNotSupportedOnResource(crow::Response& res);
813f4c4dcf4SKowalski, Kamil 
814f4c4dcf4SKowalski, Kamil /**
815684bb4b8SJason M. Bills  * @brief Formats QueryNotSupportedOnOperation message into JSON
816684bb4b8SJason M. Bills  * Message body: "Querying is not supported with the requested operation."
817684bb4b8SJason M. Bills  *
818684bb4b8SJason M. Bills  *
819684bb4b8SJason M. Bills  * @returns Message QueryNotSupportedOnOperation formatted to JSON */
82065176d39SEd Tanous nlohmann::json queryNotSupportedOnOperation();
821684bb4b8SJason M. Bills 
822684bb4b8SJason M. Bills void queryNotSupportedOnOperation(crow::Response& res);
823684bb4b8SJason M. Bills 
824684bb4b8SJason M. Bills /**
825684bb4b8SJason M. Bills  * @brief Formats QueryCombinationInvalid message into JSON
826684bb4b8SJason M. Bills  * Message body: "Two or more query parameters in the request cannot be used
827684bb4b8SJason M. Bills  * together."
828684bb4b8SJason M. Bills  *
829684bb4b8SJason M. Bills  *
830684bb4b8SJason M. Bills  * @returns Message QueryCombinationInvalid formatted to JSON */
83165176d39SEd Tanous nlohmann::json queryCombinationInvalid();
832684bb4b8SJason M. Bills 
833684bb4b8SJason M. Bills void queryCombinationInvalid(crow::Response& res);
834684bb4b8SJason M. Bills 
835684bb4b8SJason M. Bills /**
836f4c4dcf4SKowalski, Kamil  * @brief Formats InsufficientPrivilege message into JSON
837f4c4dcf4SKowalski, Kamil  * Message body: "There are insufficient privileges for the account or
838f4c4dcf4SKowalski, Kamil  * credentials associated with the current session to perform the requested
839f4c4dcf4SKowalski, Kamil  * operation."
840f4c4dcf4SKowalski, Kamil  *
841f4c4dcf4SKowalski, Kamil  *
842f4c4dcf4SKowalski, Kamil  * @returns Message InsufficientPrivilege formatted to JSON */
84365176d39SEd Tanous nlohmann::json insufficientPrivilege();
844b5c07418SJames Feist 
845f12894f8SJason M. Bills void insufficientPrivilege(crow::Response& res);
846f4c4dcf4SKowalski, Kamil 
847f4c4dcf4SKowalski, Kamil /**
848f4c4dcf4SKowalski, Kamil  * @brief Formats PropertyValueModified message into JSON
84966ac2b8cSJason M. Bills  * Message body: "The property <arg1> was assigned the value <arg2> due to
850f4c4dcf4SKowalski, Kamil  * modification by the service."
851f4c4dcf4SKowalski, Kamil  *
852f4c4dcf4SKowalski, Kamil  * @param[in] arg1 Parameter of message that will replace %1 in its body.
853f4c4dcf4SKowalski, Kamil  * @param[in] arg2 Parameter of message that will replace %2 in its body.
854f4c4dcf4SKowalski, Kamil  *
855f4c4dcf4SKowalski, Kamil  * @returns Message PropertyValueModified formatted to JSON */
856b5c07418SJames Feist nlohmann::json propertyValueModified(const std::string& arg1,
857b5c07418SJames Feist                                      const std::string& arg2);
858b5c07418SJames Feist 
859f12894f8SJason M. Bills void propertyValueModified(crow::Response& res, const std::string& arg1,
860f4c4dcf4SKowalski, Kamil                            const std::string& arg2);
861f4c4dcf4SKowalski, Kamil 
862f4c4dcf4SKowalski, Kamil /**
863f4c4dcf4SKowalski, Kamil  * @brief Formats AccountNotModified message into JSON
864f4c4dcf4SKowalski, Kamil  * Message body: "The account modification request failed."
865f4c4dcf4SKowalski, Kamil  *
866f4c4dcf4SKowalski, Kamil  *
867f4c4dcf4SKowalski, Kamil  * @returns Message AccountNotModified formatted to JSON */
86865176d39SEd Tanous nlohmann::json accountNotModified();
869b5c07418SJames Feist 
870f12894f8SJason M. Bills void accountNotModified(crow::Response& res);
871f4c4dcf4SKowalski, Kamil 
872f4c4dcf4SKowalski, Kamil /**
873f4c4dcf4SKowalski, Kamil  * @brief Formats QueryParameterValueFormatError message into JSON
87466ac2b8cSJason M. Bills  * Message body: "The value <arg1> for the parameter <arg2> is of a different
875f4c4dcf4SKowalski, Kamil  * format than the parameter can accept."
876f4c4dcf4SKowalski, Kamil  *
877f4c4dcf4SKowalski, Kamil  * @param[in] arg1 Parameter of message that will replace %1 in its body.
878f4c4dcf4SKowalski, Kamil  * @param[in] arg2 Parameter of message that will replace %2 in its body.
879f4c4dcf4SKowalski, Kamil  *
880f4c4dcf4SKowalski, Kamil  * @returns Message QueryParameterValueFormatError formatted to JSON */
881b5c07418SJames Feist 
882b5c07418SJames Feist nlohmann::json queryParameterValueFormatError(const std::string& arg1,
883b5c07418SJames Feist                                               const std::string& arg2);
884b5c07418SJames Feist 
885f12894f8SJason M. Bills void queryParameterValueFormatError(crow::Response& res,
886f12894f8SJason M. Bills                                     const std::string& arg1,
887f4c4dcf4SKowalski, Kamil                                     const std::string& arg2);
888f4c4dcf4SKowalski, Kamil 
889f4c4dcf4SKowalski, Kamil /**
890f4c4dcf4SKowalski, Kamil  * @brief Formats PropertyMissing message into JSON
89166ac2b8cSJason M. Bills  * Message body: "The property <arg1> is a required property and must be
892f4c4dcf4SKowalski, Kamil  * included in the request."
893f4c4dcf4SKowalski, Kamil  *
894f4c4dcf4SKowalski, Kamil  * @param[in] arg1 Parameter of message that will replace %1 in its body.
895f4c4dcf4SKowalski, Kamil  *
896f4c4dcf4SKowalski, Kamil  * @returns Message PropertyMissing formatted to JSON */
897b5c07418SJames Feist nlohmann::json propertyMissing(const std::string& arg1);
898b5c07418SJames Feist 
899f12894f8SJason M. Bills void propertyMissing(crow::Response& res, const std::string& arg1);
900f12894f8SJason M. Bills 
901f12894f8SJason M. Bills /**
902f4c4dcf4SKowalski, Kamil  * @brief Formats ResourceExhaustion message into JSON
90366ac2b8cSJason M. Bills  * Message body: "The resource <arg1> was unable to satisfy the request due to
904f4c4dcf4SKowalski, Kamil  * unavailability of resources."
905f4c4dcf4SKowalski, Kamil  *
906f4c4dcf4SKowalski, Kamil  * @param[in] arg1 Parameter of message that will replace %1 in its body.
907f4c4dcf4SKowalski, Kamil  *
908f4c4dcf4SKowalski, Kamil  * @returns Message ResourceExhaustion formatted to JSON */
909b5c07418SJames Feist nlohmann::json resourceExhaustion(const std::string& arg1);
910b5c07418SJames Feist 
911f12894f8SJason M. Bills void resourceExhaustion(crow::Response& res, const std::string& arg1);
912f4c4dcf4SKowalski, Kamil 
913f4c4dcf4SKowalski, Kamil /**
914f4c4dcf4SKowalski, Kamil  * @brief Formats AccountModified message into JSON
915f4c4dcf4SKowalski, Kamil  * Message body: "The account was successfully modified."
916f4c4dcf4SKowalski, Kamil  *
917f4c4dcf4SKowalski, Kamil  *
918f4c4dcf4SKowalski, Kamil  * @returns Message AccountModified formatted to JSON */
91965176d39SEd Tanous nlohmann::json accountModified();
920b5c07418SJames Feist 
921a08b46ccSJason M. Bills void accountModified(crow::Response& res);
922f4c4dcf4SKowalski, Kamil 
923f4c4dcf4SKowalski, Kamil /**
924f4c4dcf4SKowalski, Kamil  * @brief Formats QueryParameterOutOfRange message into JSON
92566ac2b8cSJason M. Bills  * Message body: "The value <arg1> for the query parameter <arg2> is out of
92666ac2b8cSJason M. Bills  * range <arg3>."
927f4c4dcf4SKowalski, Kamil  *
928f4c4dcf4SKowalski, Kamil  * @param[in] arg1 Parameter of message that will replace %1 in its body.
929f4c4dcf4SKowalski, Kamil  * @param[in] arg2 Parameter of message that will replace %2 in its body.
930f4c4dcf4SKowalski, Kamil  * @param[in] arg3 Parameter of message that will replace %3 in its body.
931f4c4dcf4SKowalski, Kamil  *
932f4c4dcf4SKowalski, Kamil  * @returns Message QueryParameterOutOfRange formatted to JSON */
933b5c07418SJames Feist nlohmann::json queryParameterOutOfRange(const std::string& arg1,
934b5c07418SJames Feist                                         const std::string& arg2,
935b5c07418SJames Feist                                         const std::string& arg3);
936b5c07418SJames Feist 
937f12894f8SJason M. Bills void queryParameterOutOfRange(crow::Response& res, const std::string& arg1,
938f12894f8SJason M. Bills                               const std::string& arg2, const std::string& arg3);
939f4c4dcf4SKowalski, Kamil 
9403bf4e632SJoseph Reynolds /**
9413bf4e632SJoseph Reynolds  * @brief Formats PasswordChangeRequired message into JSON
9423bf4e632SJoseph Reynolds  * Message body: The password provided for this account must be changed
9433bf4e632SJoseph Reynolds  * before access is granted.  PATCH the 'Password' property for this
9443bf4e632SJoseph Reynolds  * account located at the target URI '%1' to complete this process.
9453bf4e632SJoseph Reynolds  *
9463bf4e632SJoseph Reynolds  * @param[in] arg1 Parameter of message that will replace %1 in its body.
9473bf4e632SJoseph Reynolds  *
9483bf4e632SJoseph Reynolds  * @returns Message PasswordChangeRequired formatted to JSON */
9493bf4e632SJoseph Reynolds void passwordChangeRequired(crow::Response& res, const std::string& arg1);
9503bf4e632SJoseph Reynolds 
9514cde5d90SJames Feist /**
9524cde5d90SJames Feist  * @brief Formats InvalidUpload message into JSON
9534cde5d90SJames Feist  * Message body: Invalid file uploaded to %1: %2.*
9544cde5d90SJames Feist  * @param[in] arg1 Parameter of message that will replace %1 in its body.
9554cde5d90SJames Feist  * @param[in] arg2 Parameter of message that will replace %2 in its body.
9564cde5d90SJames Feist  *
9574cde5d90SJames Feist  * @returns Message InvalidUpload formatted to JSON */
9584cde5d90SJames Feist nlohmann::json invalidUpload(const std::string& arg1, const std::string& arg2);
9594cde5d90SJames Feist 
9604cde5d90SJames Feist void invalidUpload(crow::Response& res, const std::string& arg1,
9614cde5d90SJames Feist                    const std::string& arg2);
9624cde5d90SJames Feist 
963dd28ba82SAppaRao Puli /**
964dd28ba82SAppaRao Puli  * @brief Formats MutualExclusiveProperties message into JSON
965dd28ba82SAppaRao Puli  * Message body: "The properties <arg1> and <arg2> are mutually exclusive."
966dd28ba82SAppaRao Puli  *
967dd28ba82SAppaRao Puli  * @param[in] arg1 Parameter of message that will replace %1 in its body.
968dd28ba82SAppaRao Puli  * @param[in] arg2 Parameter of message that will replace %2 in its body.
969dd28ba82SAppaRao Puli  *
970dd28ba82SAppaRao Puli  * @returns Message MutualExclusiveProperties formatted to JSON */
971dd28ba82SAppaRao Puli nlohmann::json mutualExclusiveProperties(const std::string& arg1,
972dd28ba82SAppaRao Puli                                          const std::string& arg2);
973dd28ba82SAppaRao Puli 
974dd28ba82SAppaRao Puli void mutualExclusiveProperties(crow::Response& res, const std::string& arg1,
975dd28ba82SAppaRao Puli                                const std::string& arg2);
976dd28ba82SAppaRao Puli 
977f4c4dcf4SKowalski, Kamil } // namespace messages
978f4c4dcf4SKowalski, Kamil 
979f4c4dcf4SKowalski, Kamil } // namespace redfish
980