xref: /openbmc/bmcweb/features/redfish/include/error_messages.hpp (revision 81856681e1feabe267c0d1998182c9226106aa6d)
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>
201214b7e7SGunnar Mills 
211abe55efSEd Tanous namespace redfish
221abe55efSEd Tanous {
23f4c4dcf4SKowalski, Kamil 
241abe55efSEd Tanous namespace messages
251abe55efSEd Tanous {
26f4c4dcf4SKowalski, Kamil 
27*81856681SAsmitha Karunanithi constexpr const char* messageVersionPrefix = "Base.1.11.0.";
2855c7b7a2SEd Tanous constexpr const char* messageAnnotation = "@Message.ExtendedInfo";
29f4c4dcf4SKowalski, Kamil 
30f4c4dcf4SKowalski, Kamil /**
31f4c4dcf4SKowalski, Kamil  * @brief Formats ResourceInUse message into JSON
32f4c4dcf4SKowalski, Kamil  * Message body: "The change to the requested resource failed because the
33f4c4dcf4SKowalski, Kamil  * resource is in use or in transition."
34f4c4dcf4SKowalski, Kamil  *
35f4c4dcf4SKowalski, Kamil  *
36f4c4dcf4SKowalski, Kamil  * @returns Message ResourceInUse formatted to JSON */
3765176d39SEd Tanous nlohmann::json resourceInUse();
38b5c07418SJames Feist 
39f12894f8SJason M. Bills void resourceInUse(crow::Response& res);
40f4c4dcf4SKowalski, Kamil 
41f4c4dcf4SKowalski, Kamil /**
42f4c4dcf4SKowalski, Kamil  * @brief Formats MalformedJSON message into JSON
43f4c4dcf4SKowalski, Kamil  * Message body: "The request body submitted was malformed JSON and could not be
44f4c4dcf4SKowalski, Kamil  * parsed by the receiving service."
45f4c4dcf4SKowalski, Kamil  *
46f4c4dcf4SKowalski, Kamil  *
47f4c4dcf4SKowalski, Kamil  * @returns Message MalformedJSON formatted to JSON */
4865176d39SEd Tanous nlohmann::json malformedJSON();
49b5c07418SJames Feist 
50f12894f8SJason M. Bills void malformedJSON(crow::Response& res);
51f4c4dcf4SKowalski, Kamil 
52f4c4dcf4SKowalski, Kamil /**
53f4c4dcf4SKowalski, Kamil  * @brief Formats ResourceMissingAtURI message into JSON
5466ac2b8cSJason M. Bills  * Message body: "The resource at the URI <arg1> was not found."
55f4c4dcf4SKowalski, Kamil  *
56f4c4dcf4SKowalski, Kamil  * @param[in] arg1 Parameter of message that will replace %1 in its body.
57f4c4dcf4SKowalski, Kamil  *
58f4c4dcf4SKowalski, Kamil  * @returns Message ResourceMissingAtURI formatted to JSON */
59b5c07418SJames Feist nlohmann::json resourceMissingAtURI(const std::string& arg1);
60b5c07418SJames Feist 
61f12894f8SJason M. Bills void resourceMissingAtURI(crow::Response& res, const std::string& arg1);
62f4c4dcf4SKowalski, Kamil 
63f4c4dcf4SKowalski, Kamil /**
64f4c4dcf4SKowalski, Kamil  * @brief Formats ActionParameterValueFormatError message into JSON
6566ac2b8cSJason M. Bills  * Message body: "The value <arg1> for the parameter <arg2> in the action <arg3>
66f4c4dcf4SKowalski, Kamil  * is of a different format than the parameter can accept."
67f4c4dcf4SKowalski, Kamil  *
68f4c4dcf4SKowalski, Kamil  * @param[in] arg1 Parameter of message that will replace %1 in its body.
69f4c4dcf4SKowalski, Kamil  * @param[in] arg2 Parameter of message that will replace %2 in its body.
70f4c4dcf4SKowalski, Kamil  * @param[in] arg3 Parameter of message that will replace %3 in its body.
71f4c4dcf4SKowalski, Kamil  *
72f4c4dcf4SKowalski, Kamil  * @returns Message ActionParameterValueFormatError formatted to JSON */
73b5c07418SJames Feist nlohmann::json actionParameterValueFormatError(const std::string& arg1,
74b5c07418SJames Feist                                                const std::string& arg2,
75b5c07418SJames Feist                                                const std::string& arg3);
76b5c07418SJames Feist 
77f12894f8SJason M. Bills void actionParameterValueFormatError(crow::Response& res,
78f12894f8SJason M. Bills                                      const std::string& arg1,
79f4c4dcf4SKowalski, Kamil                                      const std::string& arg2,
80f4c4dcf4SKowalski, Kamil                                      const std::string& arg3);
81f4c4dcf4SKowalski, Kamil 
82f4c4dcf4SKowalski, Kamil /**
83f4c4dcf4SKowalski, Kamil  * @brief Formats InternalError message into JSON
84f4c4dcf4SKowalski, Kamil  * Message body: "The request failed due to an internal service error.  The
85f4c4dcf4SKowalski, Kamil  * service is still operational."
86f4c4dcf4SKowalski, Kamil  *
87f4c4dcf4SKowalski, Kamil  *
88f4c4dcf4SKowalski, Kamil  * @returns Message InternalError formatted to JSON */
8965176d39SEd Tanous nlohmann::json internalError();
90b5c07418SJames Feist 
91f12894f8SJason M. Bills void internalError(crow::Response& res);
92f12894f8SJason M. Bills 
93f12894f8SJason M. Bills /**
94f4c4dcf4SKowalski, Kamil  * @brief Formats UnrecognizedRequestBody message into JSON
95f4c4dcf4SKowalski, Kamil  * Message body: "The service detected a malformed request body that it was
96f4c4dcf4SKowalski, Kamil  * unable to interpret."
97f4c4dcf4SKowalski, Kamil  *
98f4c4dcf4SKowalski, Kamil  *
99f4c4dcf4SKowalski, Kamil  * @returns Message UnrecognizedRequestBody formatted to JSON */
10065176d39SEd Tanous nlohmann::json unrecognizedRequestBody();
101b5c07418SJames Feist 
102f12894f8SJason M. Bills void unrecognizedRequestBody(crow::Response& res);
103f4c4dcf4SKowalski, Kamil 
104f4c4dcf4SKowalski, Kamil /**
105f4c4dcf4SKowalski, Kamil  * @brief Formats ResourceAtUriUnauthorized message into JSON
10666ac2b8cSJason M. Bills  * Message body: "While accessing the resource at <arg1>, the service received
10766ac2b8cSJason M. Bills  * an authorization error <arg2>."
108f4c4dcf4SKowalski, Kamil  *
109f4c4dcf4SKowalski, Kamil  * @param[in] arg1 Parameter of message that will replace %1 in its body.
110f4c4dcf4SKowalski, Kamil  * @param[in] arg2 Parameter of message that will replace %2 in its body.
111f4c4dcf4SKowalski, Kamil  *
112f4c4dcf4SKowalski, Kamil  * @returns Message ResourceAtUriUnauthorized formatted to JSON */
113b5c07418SJames Feist nlohmann::json resourceAtUriUnauthorized(const std::string& arg1,
114b5c07418SJames Feist                                          const std::string& arg2);
115b5c07418SJames Feist 
116f12894f8SJason M. Bills void resourceAtUriUnauthorized(crow::Response& res, const std::string& arg1,
117f4c4dcf4SKowalski, Kamil                                const std::string& arg2);
118f4c4dcf4SKowalski, Kamil 
119f4c4dcf4SKowalski, Kamil /**
120f4c4dcf4SKowalski, Kamil  * @brief Formats ActionParameterUnknown message into JSON
12166ac2b8cSJason M. Bills  * Message body: "The action <arg1> was submitted with the invalid parameter
12266ac2b8cSJason M. Bills  * <arg2>."
123f4c4dcf4SKowalski, Kamil  *
124f4c4dcf4SKowalski, Kamil  * @param[in] arg1 Parameter of message that will replace %1 in its body.
125f4c4dcf4SKowalski, Kamil  * @param[in] arg2 Parameter of message that will replace %2 in its body.
126f4c4dcf4SKowalski, Kamil  *
127f4c4dcf4SKowalski, Kamil  * @returns Message ActionParameterUnknown formatted to JSON */
128b5c07418SJames Feist nlohmann::json actionParameterUnknown(const std::string& arg1,
129b5c07418SJames Feist                                       const std::string& arg2);
130b5c07418SJames Feist 
131f12894f8SJason M. Bills void actionParameterUnknown(crow::Response& res, const std::string& arg1,
132f4c4dcf4SKowalski, Kamil                             const std::string& arg2);
133f4c4dcf4SKowalski, Kamil 
134f4c4dcf4SKowalski, Kamil /**
135f4c4dcf4SKowalski, Kamil  * @brief Formats ResourceCannotBeDeleted message into JSON
136f4c4dcf4SKowalski, Kamil  * Message body: "The delete request failed because the resource requested
137f4c4dcf4SKowalski, Kamil  * cannot be deleted."
138f4c4dcf4SKowalski, Kamil  *
139f4c4dcf4SKowalski, Kamil  *
140f4c4dcf4SKowalski, Kamil  * @returns Message ResourceCannotBeDeleted formatted to JSON */
14165176d39SEd Tanous nlohmann::json resourceCannotBeDeleted();
142b5c07418SJames Feist 
143f12894f8SJason M. Bills void resourceCannotBeDeleted(crow::Response& res);
144f4c4dcf4SKowalski, Kamil 
145f4c4dcf4SKowalski, Kamil /**
146f4c4dcf4SKowalski, Kamil  * @brief Formats PropertyDuplicate message into JSON
14766ac2b8cSJason M. Bills  * Message body: "The property <arg1> was duplicated in the request."
148f4c4dcf4SKowalski, Kamil  *
149f4c4dcf4SKowalski, Kamil  * @param[in] arg1 Parameter of message that will replace %1 in its body.
150f4c4dcf4SKowalski, Kamil  *
151f4c4dcf4SKowalski, Kamil  * @returns Message PropertyDuplicate formatted to JSON */
152b5c07418SJames Feist nlohmann::json propertyDuplicate(const std::string& arg1);
153b5c07418SJames Feist 
154f12894f8SJason M. Bills void propertyDuplicate(crow::Response& res, const std::string& arg1);
155f4c4dcf4SKowalski, Kamil 
156f4c4dcf4SKowalski, Kamil /**
157f4c4dcf4SKowalski, Kamil  * @brief Formats ServiceTemporarilyUnavailable message into JSON
15866ac2b8cSJason M. Bills  * Message body: "The service is temporarily unavailable.  Retry in <arg1>
159f4c4dcf4SKowalski, Kamil  * seconds."
160f4c4dcf4SKowalski, Kamil  *
161f4c4dcf4SKowalski, Kamil  * @param[in] arg1 Parameter of message that will replace %1 in its body.
162f4c4dcf4SKowalski, Kamil  *
163f4c4dcf4SKowalski, Kamil  * @returns Message ServiceTemporarilyUnavailable formatted to JSON */
164b5c07418SJames Feist nlohmann::json serviceTemporarilyUnavailable(const std::string& arg1);
165b5c07418SJames Feist 
166f12894f8SJason M. Bills void serviceTemporarilyUnavailable(crow::Response& res,
167f12894f8SJason M. Bills                                    const std::string& arg1);
168f4c4dcf4SKowalski, Kamil 
169f4c4dcf4SKowalski, Kamil /**
170f4c4dcf4SKowalski, Kamil  * @brief Formats ResourceAlreadyExists message into JSON
17166ac2b8cSJason M. Bills  * Message body: "The requested resource of type <arg1> with the property <arg2>
17266ac2b8cSJason M. Bills  * with the value <arg3> already exists."
173f4c4dcf4SKowalski, Kamil  *
174f4c4dcf4SKowalski, Kamil  * @param[in] arg1 Parameter of message that will replace %1 in its body.
175f4c4dcf4SKowalski, Kamil  * @param[in] arg2 Parameter of message that will replace %2 in its body.
176f4c4dcf4SKowalski, Kamil  * @param[in] arg3 Parameter of message that will replace %3 in its body.
177f4c4dcf4SKowalski, Kamil  *
178f4c4dcf4SKowalski, Kamil  * @returns Message ResourceAlreadyExists formatted to JSON */
179b5c07418SJames Feist nlohmann::json resourceAlreadyExists(const std::string& arg1,
180b5c07418SJames Feist                                      const std::string& arg2,
181b5c07418SJames Feist                                      const std::string& arg3);
182b5c07418SJames Feist 
183f12894f8SJason M. Bills void resourceAlreadyExists(crow::Response& res, const std::string& arg1,
184f12894f8SJason M. Bills                            const std::string& arg2, const std::string& arg3);
185f4c4dcf4SKowalski, Kamil 
186f4c4dcf4SKowalski, Kamil /**
187f4c4dcf4SKowalski, Kamil  * @brief Formats AccountForSessionNoLongerExists message into JSON
188f4c4dcf4SKowalski, Kamil  * Message body: "The account for the current session has been removed, thus the
189f4c4dcf4SKowalski, Kamil  * current session has been removed as well."
190f4c4dcf4SKowalski, Kamil  *
191f4c4dcf4SKowalski, Kamil  *
192f4c4dcf4SKowalski, Kamil  * @returns Message AccountForSessionNoLongerExists formatted to JSON */
19365176d39SEd Tanous nlohmann::json accountForSessionNoLongerExists();
194b5c07418SJames Feist 
195f12894f8SJason M. Bills void accountForSessionNoLongerExists(crow::Response& res);
196f4c4dcf4SKowalski, Kamil 
197f4c4dcf4SKowalski, Kamil /**
198f4c4dcf4SKowalski, Kamil  * @brief Formats CreateFailedMissingReqProperties message into JSON
199f4c4dcf4SKowalski, Kamil  * Message body: "The create operation failed because the required property
20066ac2b8cSJason M. Bills  * <arg1> was missing from the request."
201f4c4dcf4SKowalski, Kamil  *
202f4c4dcf4SKowalski, Kamil  * @param[in] arg1 Parameter of message that will replace %1 in its body.
203f4c4dcf4SKowalski, Kamil  *
204f4c4dcf4SKowalski, Kamil  * @returns Message CreateFailedMissingReqProperties formatted to JSON */
205b5c07418SJames Feist nlohmann::json createFailedMissingReqProperties(const std::string& arg1);
206b5c07418SJames Feist 
207f12894f8SJason M. Bills void createFailedMissingReqProperties(crow::Response& res,
208f12894f8SJason M. Bills                                       const std::string& arg1);
209f4c4dcf4SKowalski, Kamil 
210f4c4dcf4SKowalski, Kamil /**
211f4c4dcf4SKowalski, Kamil  * @brief Formats PropertyValueFormatError message into JSON
21266ac2b8cSJason M. Bills  * Message body: "The value <arg1> for the property <arg2> is of a different
213f4c4dcf4SKowalski, Kamil  * format than the property can accept."
214f4c4dcf4SKowalski, Kamil  *
215f4c4dcf4SKowalski, Kamil  * @param[in] arg1 Parameter of message that will replace %1 in its body.
216f4c4dcf4SKowalski, Kamil  * @param[in] arg2 Parameter of message that will replace %2 in its body.
217f4c4dcf4SKowalski, Kamil  *
218f4c4dcf4SKowalski, Kamil  * @returns Message PropertyValueFormatError formatted to JSON */
219b5c07418SJames Feist nlohmann::json propertyValueFormatError(const std::string& arg1,
220b5c07418SJames Feist                                         const std::string& arg2);
221b5c07418SJames Feist 
222f12894f8SJason M. Bills void propertyValueFormatError(crow::Response& res, const std::string& arg1,
223f4c4dcf4SKowalski, Kamil                               const std::string& arg2);
224f4c4dcf4SKowalski, Kamil 
225f4c4dcf4SKowalski, Kamil /**
226f4c4dcf4SKowalski, Kamil  * @brief Formats PropertyValueNotInList message into JSON
22766ac2b8cSJason M. Bills  * Message body: "The value <arg1> for the property <arg2> is not in the list of
228f4c4dcf4SKowalski, Kamil  * acceptable values."
229f4c4dcf4SKowalski, Kamil  *
230f4c4dcf4SKowalski, Kamil  * @param[in] arg1 Parameter of message that will replace %1 in its body.
231f4c4dcf4SKowalski, Kamil  * @param[in] arg2 Parameter of message that will replace %2 in its body.
232f4c4dcf4SKowalski, Kamil  *
233f4c4dcf4SKowalski, Kamil  * @returns Message PropertyValueNotInList formatted to JSON */
234b5c07418SJames Feist nlohmann::json propertyValueNotInList(const std::string& arg1,
235b5c07418SJames Feist                                       const std::string& arg2);
236b5c07418SJames Feist 
237f12894f8SJason M. Bills void propertyValueNotInList(crow::Response& res, const std::string& arg1,
238f4c4dcf4SKowalski, Kamil                             const std::string& arg2);
239f4c4dcf4SKowalski, Kamil 
240f4c4dcf4SKowalski, Kamil /**
241f4c4dcf4SKowalski, Kamil  * @brief Formats ResourceAtUriInUnknownFormat message into JSON
24266ac2b8cSJason M. Bills  * Message body: "The resource at <arg1> is in a format not recognized by the
243f4c4dcf4SKowalski, Kamil  * service."
244f4c4dcf4SKowalski, Kamil  *
245f4c4dcf4SKowalski, Kamil  * @param[in] arg1 Parameter of message that will replace %1 in its body.
246f4c4dcf4SKowalski, Kamil  *
247f4c4dcf4SKowalski, Kamil  * @returns Message ResourceAtUriInUnknownFormat formatted to JSON */
248b5c07418SJames Feist nlohmann::json resourceAtUriInUnknownFormat(const std::string& arg1);
249b5c07418SJames Feist 
250f12894f8SJason M. Bills void resourceAtUriInUnknownFormat(crow::Response& res, const std::string& arg1);
251f4c4dcf4SKowalski, Kamil 
252f4c4dcf4SKowalski, Kamil /**
253*81856681SAsmitha Karunanithi  * @brief Formats ServiceDisabled message into JSON
254*81856681SAsmitha Karunanithi  * Message body: "The operation failed because the service at <arg1> is disabled
255*81856681SAsmitha Karunanithi  * and " cannot accept requests."
256*81856681SAsmitha Karunanithi  *
257*81856681SAsmitha Karunanithi  * @param[in] arg1 Parameter of message that will replace %1 in its body.
258*81856681SAsmitha Karunanithi  *
259*81856681SAsmitha Karunanithi  * @returns Message ServiceDisabled formatted to JSON */
260*81856681SAsmitha Karunanithi nlohmann::json serviceDisabled(const std::string& arg1);
261*81856681SAsmitha Karunanithi 
262*81856681SAsmitha Karunanithi void serviceDisabled(crow::Response& res, const std::string& arg1);
263*81856681SAsmitha Karunanithi 
264*81856681SAsmitha Karunanithi /**
265f4c4dcf4SKowalski, Kamil  * @brief Formats ServiceInUnknownState message into JSON
266f4c4dcf4SKowalski, Kamil  * Message body: "The operation failed because the service is in an unknown
267f4c4dcf4SKowalski, Kamil  * state and can no longer take incoming requests."
268f4c4dcf4SKowalski, Kamil  *
269f4c4dcf4SKowalski, Kamil  *
270f4c4dcf4SKowalski, Kamil  * @returns Message ServiceInUnknownState formatted to JSON */
27165176d39SEd Tanous nlohmann::json serviceInUnknownState();
272b5c07418SJames Feist 
273f12894f8SJason M. Bills void serviceInUnknownState(crow::Response& res);
274f4c4dcf4SKowalski, Kamil 
275f4c4dcf4SKowalski, Kamil /**
276f4c4dcf4SKowalski, Kamil  * @brief Formats EventSubscriptionLimitExceeded message into JSON
277f4c4dcf4SKowalski, Kamil  * Message body: "The event subscription failed due to the number of
278f4c4dcf4SKowalski, Kamil  * simultaneous subscriptions exceeding the limit of the implementation."
279f4c4dcf4SKowalski, Kamil  *
280f4c4dcf4SKowalski, Kamil  *
281f4c4dcf4SKowalski, Kamil  * @returns Message EventSubscriptionLimitExceeded formatted to JSON */
28265176d39SEd Tanous nlohmann::json eventSubscriptionLimitExceeded();
283b5c07418SJames Feist 
284f12894f8SJason M. Bills void eventSubscriptionLimitExceeded(crow::Response& res);
285f4c4dcf4SKowalski, Kamil 
286f4c4dcf4SKowalski, Kamil /**
287f4c4dcf4SKowalski, Kamil  * @brief Formats ActionParameterMissing message into JSON
28866ac2b8cSJason M. Bills  * Message body: "The action <arg1> requires the parameter <arg2> to be present
289f4c4dcf4SKowalski, Kamil  * in the request body."
290f4c4dcf4SKowalski, Kamil  *
291f4c4dcf4SKowalski, Kamil  * @param[in] arg1 Parameter of message that will replace %1 in its body.
292f4c4dcf4SKowalski, Kamil  * @param[in] arg2 Parameter of message that will replace %2 in its body.
293f4c4dcf4SKowalski, Kamil  *
294f4c4dcf4SKowalski, Kamil  * @returns Message ActionParameterMissing formatted to JSON */
295b5c07418SJames Feist nlohmann::json actionParameterMissing(const std::string& arg1,
296b5c07418SJames Feist                                       const std::string& arg2);
297b5c07418SJames Feist 
298f12894f8SJason M. Bills void actionParameterMissing(crow::Response& res, const std::string& arg1,
299f4c4dcf4SKowalski, Kamil                             const std::string& arg2);
300f4c4dcf4SKowalski, Kamil 
301f4c4dcf4SKowalski, Kamil /**
302f4c4dcf4SKowalski, Kamil  * @brief Formats StringValueTooLong message into JSON
30366ac2b8cSJason M. Bills  * Message body: "The string <arg1> exceeds the length limit <arg2>."
304f4c4dcf4SKowalski, Kamil  *
305f4c4dcf4SKowalski, Kamil  * @param[in] arg1 Parameter of message that will replace %1 in its body.
306f4c4dcf4SKowalski, Kamil  * @param[in] arg2 Parameter of message that will replace %2 in its body.
307f4c4dcf4SKowalski, Kamil  *
308f4c4dcf4SKowalski, Kamil  * @returns Message StringValueTooLong formatted to JSON */
309b5c07418SJames Feist nlohmann::json stringValueTooLong(const std::string& arg1, const int& arg2);
310b5c07418SJames Feist 
311f12894f8SJason M. Bills void stringValueTooLong(crow::Response& res, const std::string& arg1,
312f12894f8SJason M. Bills                         const int& arg2);
313f4c4dcf4SKowalski, Kamil 
314f4c4dcf4SKowalski, Kamil /**
315cc9139ecSJason M. Bills  * @brief Formats SessionTerminated message into JSON
316cc9139ecSJason M. Bills  * Message body: "The session was successfully terminated."
317cc9139ecSJason M. Bills  *
318cc9139ecSJason M. Bills  *
319cc9139ecSJason M. Bills  * @returns Message SessionTerminated formatted to JSON */
32065176d39SEd Tanous nlohmann::json sessionTerminated();
321b5c07418SJames Feist 
322cc9139ecSJason M. Bills void sessionTerminated(crow::Response& res);
323cc9139ecSJason M. Bills 
324cc9139ecSJason M. Bills /**
325684bb4b8SJason M. Bills  * @brief Formats SubscriptionTerminated message into JSON
326684bb4b8SJason M. Bills  * Message body: "The event subscription has been terminated."
327684bb4b8SJason M. Bills  *
328684bb4b8SJason M. Bills  *
329684bb4b8SJason M. Bills  * @returns Message SubscriptionTerminated formatted to JSON */
33065176d39SEd Tanous nlohmann::json subscriptionTerminated();
331684bb4b8SJason M. Bills 
332684bb4b8SJason M. Bills void subscriptionTerminated(crow::Response& res);
333684bb4b8SJason M. Bills 
334684bb4b8SJason M. Bills /**
335cc9139ecSJason M. Bills  * @brief Formats ResourceTypeIncompatible message into JSON
336cc9139ecSJason M. Bills  * Message body: "The @odata.type of the request body <arg1> is incompatible
337cc9139ecSJason M. Bills  * with the @odata.type of the resource which is <arg2>."
338cc9139ecSJason M. Bills  *
339cc9139ecSJason M. Bills  * @param[in] arg1 Parameter of message that will replace %1 in its body.
340cc9139ecSJason M. Bills  * @param[in] arg2 Parameter of message that will replace %2 in its body.
341cc9139ecSJason M. Bills  *
342cc9139ecSJason M. Bills  * @returns Message ResourceTypeIncompatible formatted to JSON */
343b5c07418SJames Feist nlohmann::json resourceTypeIncompatible(const std::string& arg1,
344b5c07418SJames Feist                                         const std::string& arg2);
345b5c07418SJames Feist 
346cc9139ecSJason M. Bills void resourceTypeIncompatible(crow::Response& res, const std::string& arg1,
347cc9139ecSJason M. Bills                               const std::string& arg2);
348cc9139ecSJason M. Bills 
349cc9139ecSJason M. Bills /**
350684bb4b8SJason M. Bills  * @brief Formats ResetRequired message into JSON
351684bb4b8SJason M. Bills  * Message body: "In order to complete the operation, a component reset is
352684bb4b8SJason M. Bills  * required with the Reset action URI '<arg1>' and ResetType '<arg2>'."
353684bb4b8SJason M. Bills  *
354684bb4b8SJason M. Bills  * @param[in] arg1 Parameter of message that will replace %1 in its body.
355684bb4b8SJason M. Bills  * @param[in] arg2 Parameter of message that will replace %2 in its body.
356684bb4b8SJason M. Bills  *
357684bb4b8SJason M. Bills  * @returns Message ResetRequired formatted to JSON */
358684bb4b8SJason M. Bills nlohmann::json resetRequired(const std::string& arg1, const std::string& arg2);
359684bb4b8SJason M. Bills 
360684bb4b8SJason M. Bills void resetRequired(crow::Response& res, const std::string& arg1,
361684bb4b8SJason M. Bills                    const std::string& arg2);
362684bb4b8SJason M. Bills 
363684bb4b8SJason M. Bills /**
364684bb4b8SJason M. Bills  * @brief Formats ChassisPowerStateOnRequired message into JSON
365684bb4b8SJason M. Bills  * Message body: "The Chassis with Id '<arg1>' requires to be powered on to
366684bb4b8SJason M. Bills  * perform this request."
367684bb4b8SJason M. Bills  *
368684bb4b8SJason M. Bills  * @param[in] arg1 Parameter of message that will replace %1 in its body.
369684bb4b8SJason M. Bills  *
370684bb4b8SJason M. Bills  * @returns Message ChassisPowerStateOnRequired formatted to JSON */
371684bb4b8SJason M. Bills nlohmann::json chassisPowerStateOnRequired(const std::string& arg1);
372684bb4b8SJason M. Bills 
373684bb4b8SJason M. Bills void chassisPowerStateOnRequired(crow::Response& res, const std::string& arg1);
374684bb4b8SJason M. Bills 
375684bb4b8SJason M. Bills /**
376684bb4b8SJason M. Bills  * @brief Formats ChassisPowerStateOffRequired message into JSON
377684bb4b8SJason M. Bills  * Message body: "The Chassis with Id '<arg1>' requires to be powered off to
378684bb4b8SJason M. Bills  * perform this request."
379684bb4b8SJason M. Bills  *
380684bb4b8SJason M. Bills  * @param[in] arg1 Parameter of message that will replace %1 in its body.
381684bb4b8SJason M. Bills  *
382684bb4b8SJason M. Bills  * @returns Message ChassisPowerStateOffRequired formatted to JSON */
383684bb4b8SJason M. Bills nlohmann::json chassisPowerStateOffRequired(const std::string& arg1);
384684bb4b8SJason M. Bills 
385684bb4b8SJason M. Bills void chassisPowerStateOffRequired(crow::Response& res, const std::string& arg1);
386684bb4b8SJason M. Bills 
387684bb4b8SJason M. Bills /**
388684bb4b8SJason M. Bills  * @brief Formats PropertyValueConflict message into JSON
389684bb4b8SJason M. Bills  * Message body: "The property '<arg1>' could not be written because its value
390684bb4b8SJason M. Bills  * would conflict with the value of the '<arg2>' property."
391684bb4b8SJason M. Bills  *
392684bb4b8SJason M. Bills  * @param[in] arg1 Parameter of message that will replace %1 in its body.
393684bb4b8SJason M. Bills  * @param[in] arg2 Parameter of message that will replace %2 in its body.
394684bb4b8SJason M. Bills  *
395684bb4b8SJason M. Bills  * @returns Message PropertyValueConflict formatted to JSON */
396684bb4b8SJason M. Bills nlohmann::json propertyValueConflict(const std::string& arg1,
397684bb4b8SJason M. Bills                                      const std::string& arg2);
398684bb4b8SJason M. Bills 
399684bb4b8SJason M. Bills void propertyValueConflict(crow::Response& res, const std::string& arg1,
400684bb4b8SJason M. Bills                            const std::string& arg2);
401684bb4b8SJason M. Bills 
402684bb4b8SJason M. Bills /**
403684bb4b8SJason M. Bills  * @brief Formats PropertyValueIncorrect message into JSON
404684bb4b8SJason M. Bills  * Message body: "The property '<arg1>' with the requested value of '<arg2>'
405684bb4b8SJason M. Bills  * could not be written because the value does not meet the constraints of the
406684bb4b8SJason M. Bills  * implementation."
407684bb4b8SJason M. Bills  *
408684bb4b8SJason M. Bills  * @param[in] arg1 Parameter of message that will replace %1 in its body.
409684bb4b8SJason M. Bills  * @param[in] arg2 Parameter of message that will replace %2 in its body.
410684bb4b8SJason M. Bills  *
411684bb4b8SJason M. Bills  * @returns Message PropertyValueIncorrect formatted to JSON */
412684bb4b8SJason M. Bills nlohmann::json propertyValueIncorrect(const std::string& arg1,
413684bb4b8SJason M. Bills                                       const std::string& arg2);
414684bb4b8SJason M. Bills 
415684bb4b8SJason M. Bills void propertyValueIncorrect(crow::Response& res, const std::string& arg1,
416684bb4b8SJason M. Bills                             const std::string& arg2);
417684bb4b8SJason M. Bills 
418684bb4b8SJason M. Bills /**
419684bb4b8SJason M. Bills  * @brief Formats ResourceCreationConflict message into JSON
420684bb4b8SJason M. Bills  * Message body: "The resource could not be created.  The service has a resource
421684bb4b8SJason M. Bills  * at URI '<arg1>' that conflicts with the creation request."
422684bb4b8SJason M. Bills  *
423684bb4b8SJason M. Bills  * @param[in] arg1 Parameter of message that will replace %1 in its body.
424684bb4b8SJason M. Bills  *
425684bb4b8SJason M. Bills  * @returns Message ResourceCreationConflict formatted to JSON */
426684bb4b8SJason M. Bills nlohmann::json resourceCreationConflict(const std::string& arg1);
427684bb4b8SJason M. Bills 
428684bb4b8SJason M. Bills void resourceCreationConflict(crow::Response& res, const std::string& arg1);
429684bb4b8SJason M. Bills 
430684bb4b8SJason M. Bills /**
431684bb4b8SJason M. Bills  * @brief Formats MaximumErrorsExceeded message into JSON
432684bb4b8SJason M. Bills  * Message body: "Too many errors have occurred to report them all."
433684bb4b8SJason M. Bills  *
434684bb4b8SJason M. Bills  *
435684bb4b8SJason M. Bills  * @returns Message MaximumErrorsExceeded formatted to JSON */
43665176d39SEd Tanous nlohmann::json maximumErrorsExceeded();
437684bb4b8SJason M. Bills 
438684bb4b8SJason M. Bills void maximumErrorsExceeded(crow::Response& res);
439684bb4b8SJason M. Bills 
440684bb4b8SJason M. Bills /**
441684bb4b8SJason M. Bills  * @brief Formats PreconditionFailed message into JSON
442684bb4b8SJason M. Bills  * Message body: "The ETag supplied did not match the ETag required to change
443684bb4b8SJason M. Bills  * this resource."
444684bb4b8SJason M. Bills  *
445684bb4b8SJason M. Bills  *
446684bb4b8SJason M. Bills  * @returns Message PreconditionFailed formatted to JSON */
44765176d39SEd Tanous nlohmann::json preconditionFailed();
448684bb4b8SJason M. Bills 
449684bb4b8SJason M. Bills void preconditionFailed(crow::Response& res);
450684bb4b8SJason M. Bills 
451684bb4b8SJason M. Bills /**
452684bb4b8SJason M. Bills  * @brief Formats PreconditionRequired message into JSON
453684bb4b8SJason M. Bills  * Message body: "A precondition header or annotation is required to change this
454684bb4b8SJason M. Bills  * resource."
455684bb4b8SJason M. Bills  *
456684bb4b8SJason M. Bills  *
457684bb4b8SJason M. Bills  * @returns Message PreconditionRequired formatted to JSON */
45865176d39SEd Tanous nlohmann::json preconditionRequired();
459684bb4b8SJason M. Bills 
460684bb4b8SJason M. Bills void preconditionRequired(crow::Response& res);
461684bb4b8SJason M. Bills 
462684bb4b8SJason M. Bills /**
463684bb4b8SJason M. Bills  * @brief Formats OperationFailed message into JSON
464684bb4b8SJason M. Bills  * Message body: "An error occurred internal to the service as part of the
465684bb4b8SJason M. Bills  * overall request.  Partial results may have been returned."
466684bb4b8SJason M. Bills  *
467684bb4b8SJason M. Bills  *
468684bb4b8SJason M. Bills  * @returns Message OperationFailed formatted to JSON */
46965176d39SEd Tanous nlohmann::json operationFailed();
470684bb4b8SJason M. Bills 
471684bb4b8SJason M. Bills void operationFailed(crow::Response& res);
472684bb4b8SJason M. Bills 
473684bb4b8SJason M. Bills /**
474684bb4b8SJason M. Bills  * @brief Formats OperationTimeout message into JSON
475684bb4b8SJason M. Bills  * Message body: "A timeout internal to the service occured as part of the
476684bb4b8SJason M. Bills  * request.  Partial results may have been returned."
477684bb4b8SJason M. Bills  *
478684bb4b8SJason M. Bills  *
479684bb4b8SJason M. Bills  * @returns Message OperationTimeout formatted to JSON */
48065176d39SEd Tanous nlohmann::json operationTimeout();
481684bb4b8SJason M. Bills 
482684bb4b8SJason M. Bills void operationTimeout(crow::Response& res);
483684bb4b8SJason M. Bills 
484684bb4b8SJason M. Bills /**
485f4c4dcf4SKowalski, Kamil  * @brief Formats PropertyValueTypeError message into JSON
48666ac2b8cSJason M. Bills  * Message body: "The value <arg1> for the property <arg2> is of a different
487f4c4dcf4SKowalski, Kamil  * type than the property can accept."
488f4c4dcf4SKowalski, Kamil  *
489f4c4dcf4SKowalski, Kamil  * @param[in] arg1 Parameter of message that will replace %1 in its body.
490f4c4dcf4SKowalski, Kamil  * @param[in] arg2 Parameter of message that will replace %2 in its body.
491f4c4dcf4SKowalski, Kamil  *
492f4c4dcf4SKowalski, Kamil  * @returns Message PropertyValueTypeError formatted to JSON */
493b5c07418SJames Feist nlohmann::json propertyValueTypeError(const std::string& arg1,
494b5c07418SJames Feist                                       const std::string& arg2);
495b5c07418SJames Feist 
496f12894f8SJason M. Bills void propertyValueTypeError(crow::Response& res, const std::string& arg1,
497f4c4dcf4SKowalski, Kamil                             const std::string& arg2);
498f4c4dcf4SKowalski, Kamil 
499f4c4dcf4SKowalski, Kamil /**
500f4c4dcf4SKowalski, Kamil  * @brief Formats ResourceNotFound message into JSON
50166ac2b8cSJason M. Bills  * Message body: "The requested resource of type <arg1> named <arg2> was not
502f4c4dcf4SKowalski, Kamil  * found."
503f4c4dcf4SKowalski, Kamil  *
504f4c4dcf4SKowalski, Kamil  * @param[in] arg1 Parameter of message that will replace %1 in its body.
505f4c4dcf4SKowalski, Kamil  * @param[in] arg2 Parameter of message that will replace %2 in its body.
506f4c4dcf4SKowalski, Kamil  *
507f4c4dcf4SKowalski, Kamil  * @returns Message ResourceNotFound formatted to JSON */
508b5c07418SJames Feist nlohmann::json resourceNotFound(const std::string& arg1,
509b5c07418SJames Feist                                 const std::string& arg2);
510b5c07418SJames Feist 
511f12894f8SJason M. Bills void resourceNotFound(crow::Response& res, const std::string& arg1,
512f4c4dcf4SKowalski, Kamil                       const std::string& arg2);
513f4c4dcf4SKowalski, Kamil 
514f4c4dcf4SKowalski, Kamil /**
515f4c4dcf4SKowalski, Kamil  * @brief Formats CouldNotEstablishConnection message into JSON
51655c7b7a2SEd Tanous  * Message body: "The service failed to establish a Connection with the URI
51766ac2b8cSJason M. Bills  * <arg1>."
518f4c4dcf4SKowalski, Kamil  *
519f4c4dcf4SKowalski, Kamil  * @param[in] arg1 Parameter of message that will replace %1 in its body.
520f4c4dcf4SKowalski, Kamil  *
521f4c4dcf4SKowalski, Kamil  * @returns Message CouldNotEstablishConnection formatted to JSON */
522b5c07418SJames Feist nlohmann::json couldNotEstablishConnection(const std::string& arg1);
523b5c07418SJames Feist 
524f12894f8SJason M. Bills void couldNotEstablishConnection(crow::Response& res, const std::string& arg1);
525f4c4dcf4SKowalski, Kamil 
526f4c4dcf4SKowalski, Kamil /**
527f4c4dcf4SKowalski, Kamil  * @brief Formats PropertyNotWritable message into JSON
52866ac2b8cSJason M. Bills  * Message body: "The property <arg1> is a read only property and cannot be
529f4c4dcf4SKowalski, Kamil  * assigned a value."
530f4c4dcf4SKowalski, Kamil  *
531f4c4dcf4SKowalski, Kamil  * @param[in] arg1 Parameter of message that will replace %1 in its body.
532f4c4dcf4SKowalski, Kamil  *
533f4c4dcf4SKowalski, Kamil  * @returns Message PropertyNotWritable formatted to JSON */
534b5c07418SJames Feist nlohmann::json propertyNotWritable(const std::string& arg1);
535b5c07418SJames Feist 
536f12894f8SJason M. Bills void propertyNotWritable(crow::Response& res, const std::string& arg1);
537f12894f8SJason M. Bills 
538f12894f8SJason M. Bills /**
539f4c4dcf4SKowalski, Kamil  * @brief Formats QueryParameterValueTypeError message into JSON
54066ac2b8cSJason M. Bills  * Message body: "The value <arg1> for the query parameter <arg2> is of a
541f4c4dcf4SKowalski, Kamil  * different type than the parameter can accept."
542f4c4dcf4SKowalski, Kamil  *
543f4c4dcf4SKowalski, Kamil  * @param[in] arg1 Parameter of message that will replace %1 in its body.
544f4c4dcf4SKowalski, Kamil  * @param[in] arg2 Parameter of message that will replace %2 in its body.
545f4c4dcf4SKowalski, Kamil  *
546f4c4dcf4SKowalski, Kamil  * @returns Message QueryParameterValueTypeError formatted to JSON */
547b5c07418SJames Feist nlohmann::json queryParameterValueTypeError(const std::string& arg1,
548b5c07418SJames Feist                                             const std::string& arg2);
549b5c07418SJames Feist 
550f12894f8SJason M. Bills void queryParameterValueTypeError(crow::Response& res, const std::string& arg1,
551f4c4dcf4SKowalski, Kamil                                   const std::string& arg2);
552f4c4dcf4SKowalski, Kamil 
553f4c4dcf4SKowalski, Kamil /**
554f4c4dcf4SKowalski, Kamil  * @brief Formats ServiceShuttingDown message into JSON
555f4c4dcf4SKowalski, Kamil  * Message body: "The operation failed because the service is shutting down and
556f4c4dcf4SKowalski, Kamil  * can no longer take incoming requests."
557f4c4dcf4SKowalski, Kamil  *
558f4c4dcf4SKowalski, Kamil  *
559f4c4dcf4SKowalski, Kamil  * @returns Message ServiceShuttingDown formatted to JSON */
56065176d39SEd Tanous nlohmann::json serviceShuttingDown();
561b5c07418SJames Feist 
562f12894f8SJason M. Bills void serviceShuttingDown(crow::Response& res);
563f4c4dcf4SKowalski, Kamil 
564f4c4dcf4SKowalski, Kamil /**
565f4c4dcf4SKowalski, Kamil  * @brief Formats ActionParameterDuplicate message into JSON
56666ac2b8cSJason M. Bills  * Message body: "The action <arg1> was submitted with more than one value for
56766ac2b8cSJason M. Bills  * the parameter <arg2>."
568f4c4dcf4SKowalski, Kamil  *
569f4c4dcf4SKowalski, Kamil  * @param[in] arg1 Parameter of message that will replace %1 in its body.
570f4c4dcf4SKowalski, Kamil  * @param[in] arg2 Parameter of message that will replace %2 in its body.
571f4c4dcf4SKowalski, Kamil  *
572f4c4dcf4SKowalski, Kamil  * @returns Message ActionParameterDuplicate formatted to JSON */
573b5c07418SJames Feist nlohmann::json actionParameterDuplicate(const std::string& arg1,
574b5c07418SJames Feist                                         const std::string& arg2);
575b5c07418SJames Feist 
576f12894f8SJason M. Bills void actionParameterDuplicate(crow::Response& res, const std::string& arg1,
577f4c4dcf4SKowalski, Kamil                               const std::string& arg2);
578f4c4dcf4SKowalski, Kamil 
579f4c4dcf4SKowalski, Kamil /**
580f4c4dcf4SKowalski, Kamil  * @brief Formats ActionParameterNotSupported message into JSON
58166ac2b8cSJason M. Bills  * Message body: "The parameter <arg1> for the action <arg2> is not supported on
582f4c4dcf4SKowalski, Kamil  * the target resource."
583f4c4dcf4SKowalski, Kamil  *
584f4c4dcf4SKowalski, Kamil  * @param[in] arg1 Parameter of message that will replace %1 in its body.
585f4c4dcf4SKowalski, Kamil  * @param[in] arg2 Parameter of message that will replace %2 in its body.
586f4c4dcf4SKowalski, Kamil  *
587f4c4dcf4SKowalski, Kamil  * @returns Message ActionParameterNotSupported formatted to JSON */
588b5c07418SJames Feist nlohmann::json actionParameterNotSupported(const std::string& arg1,
589b5c07418SJames Feist                                            const std::string& arg2);
590b5c07418SJames Feist 
591f12894f8SJason M. Bills void actionParameterNotSupported(crow::Response& res, const std::string& arg1,
592f4c4dcf4SKowalski, Kamil                                  const std::string& arg2);
593f4c4dcf4SKowalski, Kamil 
594f4c4dcf4SKowalski, Kamil /**
595f4c4dcf4SKowalski, Kamil  * @brief Formats SourceDoesNotSupportProtocol message into JSON
59666ac2b8cSJason M. Bills  * Message body: "The other end of the Connection at <arg1> does not support the
59766ac2b8cSJason M. Bills  * specified protocol <arg2>."
598f4c4dcf4SKowalski, Kamil  *
599f4c4dcf4SKowalski, Kamil  * @param[in] arg1 Parameter of message that will replace %1 in its body.
600f4c4dcf4SKowalski, Kamil  * @param[in] arg2 Parameter of message that will replace %2 in its body.
601f4c4dcf4SKowalski, Kamil  *
602f4c4dcf4SKowalski, Kamil  * @returns Message SourceDoesNotSupportProtocol formatted to JSON */
603b5c07418SJames Feist nlohmann::json sourceDoesNotSupportProtocol(const std::string& arg1,
604b5c07418SJames Feist                                             const std::string& arg2);
605b5c07418SJames Feist 
606f12894f8SJason M. Bills void sourceDoesNotSupportProtocol(crow::Response& res, const std::string& arg1,
607f4c4dcf4SKowalski, Kamil                                   const std::string& arg2);
608f4c4dcf4SKowalski, Kamil 
609f4c4dcf4SKowalski, Kamil /**
610f4c4dcf4SKowalski, Kamil  * @brief Formats AccountRemoved message into JSON
611f4c4dcf4SKowalski, Kamil  * Message body: "The account was successfully removed."
612f4c4dcf4SKowalski, Kamil  *
613f4c4dcf4SKowalski, Kamil  *
614f4c4dcf4SKowalski, Kamil  * @returns Message AccountRemoved formatted to JSON */
61565176d39SEd Tanous nlohmann::json accountRemoved();
616b5c07418SJames Feist 
617f12894f8SJason M. Bills void accountRemoved(crow::Response& res);
618f4c4dcf4SKowalski, Kamil 
619f4c4dcf4SKowalski, Kamil /**
620f4c4dcf4SKowalski, Kamil  * @brief Formats AccessDenied message into JSON
62166ac2b8cSJason M. Bills  * Message body: "While attempting to establish a Connection to <arg1>, the
622f4c4dcf4SKowalski, Kamil  * service denied access."
623f4c4dcf4SKowalski, Kamil  *
624f4c4dcf4SKowalski, Kamil  * @param[in] arg1 Parameter of message that will replace %1 in its body.
625f4c4dcf4SKowalski, Kamil  *
626f4c4dcf4SKowalski, Kamil  * @returns Message AccessDenied formatted to JSON */
627b5c07418SJames Feist nlohmann::json accessDenied(const std::string& arg1);
628b5c07418SJames Feist 
629f12894f8SJason M. Bills void accessDenied(crow::Response& res, const std::string& arg1);
630f4c4dcf4SKowalski, Kamil 
631f4c4dcf4SKowalski, Kamil /**
632f4c4dcf4SKowalski, Kamil  * @brief Formats QueryNotSupported message into JSON
633f4c4dcf4SKowalski, Kamil  * Message body: "Querying is not supported by the implementation."
634f4c4dcf4SKowalski, Kamil  *
635f4c4dcf4SKowalski, Kamil  *
636f4c4dcf4SKowalski, Kamil  * @returns Message QueryNotSupported formatted to JSON */
63765176d39SEd Tanous nlohmann::json queryNotSupported();
638b5c07418SJames Feist 
639f12894f8SJason M. Bills void queryNotSupported(crow::Response& res);
640f4c4dcf4SKowalski, Kamil 
641f4c4dcf4SKowalski, Kamil /**
642f4c4dcf4SKowalski, Kamil  * @brief Formats CreateLimitReachedForResource message into JSON
643f4c4dcf4SKowalski, Kamil  * Message body: "The create operation failed because the resource has reached
644f4c4dcf4SKowalski, Kamil  * the limit of possible resources."
645f4c4dcf4SKowalski, Kamil  *
646f4c4dcf4SKowalski, Kamil  *
647f4c4dcf4SKowalski, Kamil  * @returns Message CreateLimitReachedForResource formatted to JSON */
64865176d39SEd Tanous nlohmann::json createLimitReachedForResource();
649b5c07418SJames Feist 
650f12894f8SJason M. Bills void createLimitReachedForResource(crow::Response& res);
651f4c4dcf4SKowalski, Kamil 
652f4c4dcf4SKowalski, Kamil /**
653f4c4dcf4SKowalski, Kamil  * @brief Formats GeneralError message into JSON
654f4c4dcf4SKowalski, Kamil  * Message body: "A general error has occurred. See ExtendedInfo for more
655f4c4dcf4SKowalski, Kamil  * information."
656f4c4dcf4SKowalski, Kamil  *
657f4c4dcf4SKowalski, Kamil  *
658f4c4dcf4SKowalski, Kamil  * @returns Message GeneralError formatted to JSON */
65965176d39SEd Tanous nlohmann::json generalError();
660b5c07418SJames Feist 
661f12894f8SJason M. Bills void generalError(crow::Response& res);
662f4c4dcf4SKowalski, Kamil 
663f4c4dcf4SKowalski, Kamil /**
664f4c4dcf4SKowalski, Kamil  * @brief Formats Success message into JSON
665f4c4dcf4SKowalski, Kamil  * Message body: "Successfully Completed Request"
666f4c4dcf4SKowalski, Kamil  *
667f4c4dcf4SKowalski, Kamil  *
668f4c4dcf4SKowalski, Kamil  * @returns Message Success formatted to JSON */
66965176d39SEd Tanous nlohmann::json success();
670b5c07418SJames Feist 
671f12894f8SJason M. Bills void success(crow::Response& res);
672f12894f8SJason M. Bills 
673f12894f8SJason M. Bills /**
674f4c4dcf4SKowalski, Kamil  * @brief Formats Created message into JSON
675f4c4dcf4SKowalski, Kamil  * Message body: "The resource has been created successfully"
676f4c4dcf4SKowalski, Kamil  *
677f4c4dcf4SKowalski, Kamil  *
678f4c4dcf4SKowalski, Kamil  * @returns Message Created formatted to JSON */
67965176d39SEd Tanous nlohmann::json created();
680b5c07418SJames Feist 
681f12894f8SJason M. Bills void created(crow::Response& res);
682f4c4dcf4SKowalski, Kamil 
683f4c4dcf4SKowalski, Kamil /**
684cc9139ecSJason M. Bills  * @brief Formats NoOperation message into JSON
685cc9139ecSJason M. Bills  * Message body: "The request body submitted contain no data to act upon and
686cc9139ecSJason M. Bills  * no changes to the resource took place."
687cc9139ecSJason M. Bills  *
688cc9139ecSJason M. Bills  *
689cc9139ecSJason M. Bills  * @returns Message NoOperation formatted to JSON */
69065176d39SEd Tanous nlohmann::json noOperation();
691b5c07418SJames Feist 
692cc9139ecSJason M. Bills void noOperation(crow::Response& res);
693cc9139ecSJason M. Bills 
694cc9139ecSJason M. Bills /**
695f4c4dcf4SKowalski, Kamil  * @brief Formats PropertyUnknown message into JSON
69666ac2b8cSJason M. Bills  * Message body: "The property <arg1> is not in the list of valid properties for
697f4c4dcf4SKowalski, Kamil  * the resource."
698f4c4dcf4SKowalski, Kamil  *
699f4c4dcf4SKowalski, Kamil  * @param[in] arg1 Parameter of message that will replace %1 in its body.
700f4c4dcf4SKowalski, Kamil  *
701f4c4dcf4SKowalski, Kamil  * @returns Message PropertyUnknown formatted to JSON */
702b5c07418SJames Feist nlohmann::json propertyUnknown(const std::string& arg1);
703b5c07418SJames Feist 
704f12894f8SJason M. Bills void propertyUnknown(crow::Response& res, const std::string& arg1);
705f12894f8SJason M. Bills 
706f12894f8SJason M. Bills /**
707f4c4dcf4SKowalski, Kamil  * @brief Formats NoValidSession message into JSON
708f4c4dcf4SKowalski, Kamil  * Message body: "There is no valid session established with the
709f4c4dcf4SKowalski, Kamil  * implementation."
710f4c4dcf4SKowalski, Kamil  *
711f4c4dcf4SKowalski, Kamil  *
712f4c4dcf4SKowalski, Kamil  * @returns Message NoValidSession formatted to JSON */
71365176d39SEd Tanous nlohmann::json noValidSession();
714b5c07418SJames Feist 
715f12894f8SJason M. Bills void noValidSession(crow::Response& res);
716f4c4dcf4SKowalski, Kamil 
717f4c4dcf4SKowalski, Kamil /**
718f4c4dcf4SKowalski, Kamil  * @brief Formats InvalidObject message into JSON
71966ac2b8cSJason M. Bills  * Message body: "The object at <arg1> is invalid."
720f4c4dcf4SKowalski, Kamil  *
721f4c4dcf4SKowalski, Kamil  * @param[in] arg1 Parameter of message that will replace %1 in its body.
722f4c4dcf4SKowalski, Kamil  *
723f4c4dcf4SKowalski, Kamil  * @returns Message InvalidObject formatted to JSON */
724b5c07418SJames Feist nlohmann::json invalidObject(const std::string& arg1);
725b5c07418SJames Feist 
726f12894f8SJason M. Bills void invalidObject(crow::Response& res, const std::string& arg1);
727f4c4dcf4SKowalski, Kamil 
728f4c4dcf4SKowalski, Kamil /**
729f4c4dcf4SKowalski, Kamil  * @brief Formats ResourceInStandby message into JSON
730f4c4dcf4SKowalski, Kamil  * Message body: "The request could not be performed because the resource is in
731f4c4dcf4SKowalski, Kamil  * standby."
732f4c4dcf4SKowalski, Kamil  *
733f4c4dcf4SKowalski, Kamil  *
734f4c4dcf4SKowalski, Kamil  * @returns Message ResourceInStandby formatted to JSON */
73565176d39SEd Tanous nlohmann::json resourceInStandby();
736b5c07418SJames Feist 
737f12894f8SJason M. Bills void resourceInStandby(crow::Response& res);
738f4c4dcf4SKowalski, Kamil 
739f4c4dcf4SKowalski, Kamil /**
740f4c4dcf4SKowalski, Kamil  * @brief Formats ActionParameterValueTypeError message into JSON
74166ac2b8cSJason M. Bills  * Message body: "The value <arg1> for the parameter <arg2> in the action <arg3>
742f4c4dcf4SKowalski, Kamil  * is of a different type than the parameter can accept."
743f4c4dcf4SKowalski, Kamil  *
744f4c4dcf4SKowalski, Kamil  * @param[in] arg1 Parameter of message that will replace %1 in its body.
745f4c4dcf4SKowalski, Kamil  * @param[in] arg2 Parameter of message that will replace %2 in its body.
746f4c4dcf4SKowalski, Kamil  * @param[in] arg3 Parameter of message that will replace %3 in its body.
747f4c4dcf4SKowalski, Kamil  *
748f4c4dcf4SKowalski, Kamil  * @returns Message ActionParameterValueTypeError formatted to JSON */
749b5c07418SJames Feist nlohmann::json actionParameterValueTypeError(const std::string& arg1,
750b5c07418SJames Feist                                              const std::string& arg2,
751b5c07418SJames Feist                                              const std::string& arg3);
752b5c07418SJames Feist 
753f12894f8SJason M. Bills void actionParameterValueTypeError(crow::Response& res, const std::string& arg1,
754f4c4dcf4SKowalski, Kamil                                    const std::string& arg2,
755f4c4dcf4SKowalski, Kamil                                    const std::string& arg3);
756f4c4dcf4SKowalski, Kamil 
757f4c4dcf4SKowalski, Kamil /**
758f4c4dcf4SKowalski, Kamil  * @brief Formats SessionLimitExceeded message into JSON
759f4c4dcf4SKowalski, Kamil  * Message body: "The session establishment failed due to the number of
760f4c4dcf4SKowalski, Kamil  * simultaneous sessions exceeding the limit of the implementation."
761f4c4dcf4SKowalski, Kamil  *
762f4c4dcf4SKowalski, Kamil  *
763f4c4dcf4SKowalski, Kamil  * @returns Message SessionLimitExceeded formatted to JSON */
76465176d39SEd Tanous nlohmann::json sessionLimitExceeded();
765b5c07418SJames Feist 
766f12894f8SJason M. Bills void sessionLimitExceeded(crow::Response& res);
767f4c4dcf4SKowalski, Kamil 
768f4c4dcf4SKowalski, Kamil /**
769f4c4dcf4SKowalski, Kamil  * @brief Formats ActionNotSupported message into JSON
77066ac2b8cSJason M. Bills  * Message body: "The action <arg1> is not supported by the resource."
771f4c4dcf4SKowalski, Kamil  *
772f4c4dcf4SKowalski, Kamil  * @param[in] arg1 Parameter of message that will replace %1 in its body.
773f4c4dcf4SKowalski, Kamil  *
774f4c4dcf4SKowalski, Kamil  * @returns Message ActionNotSupported formatted to JSON */
775b5c07418SJames Feist nlohmann::json actionNotSupported(const std::string& arg1);
776b5c07418SJames Feist 
777f12894f8SJason M. Bills void actionNotSupported(crow::Response& res, const std::string& arg1);
778f4c4dcf4SKowalski, Kamil 
779f4c4dcf4SKowalski, Kamil /**
780f4c4dcf4SKowalski, Kamil  * @brief Formats InvalidIndex message into JSON
78166ac2b8cSJason M. Bills  * Message body: "The index <arg1> is not a valid offset into the array."
782f4c4dcf4SKowalski, Kamil  *
783f4c4dcf4SKowalski, Kamil  * @param[in] arg1 Parameter of message that will replace %1 in its body.
784f4c4dcf4SKowalski, Kamil  *
785f4c4dcf4SKowalski, Kamil  * @returns Message InvalidIndex formatted to JSON */
786b5c07418SJames Feist nlohmann::json invalidIndex(const int& arg1);
787b5c07418SJames Feist 
788f12894f8SJason M. Bills void invalidIndex(crow::Response& res, const int& arg1);
789f4c4dcf4SKowalski, Kamil 
790f4c4dcf4SKowalski, Kamil /**
791f4c4dcf4SKowalski, Kamil  * @brief Formats EmptyJSON message into JSON
792f4c4dcf4SKowalski, Kamil  * Message body: "The request body submitted contained an empty JSON object and
793f4c4dcf4SKowalski, Kamil  * the service is unable to process it."
794f4c4dcf4SKowalski, Kamil  *
795f4c4dcf4SKowalski, Kamil  *
796f4c4dcf4SKowalski, Kamil  * @returns Message EmptyJSON formatted to JSON */
79765176d39SEd Tanous nlohmann::json emptyJSON();
798b5c07418SJames Feist 
799f12894f8SJason M. Bills void emptyJSON(crow::Response& res);
800f4c4dcf4SKowalski, Kamil 
801f4c4dcf4SKowalski, Kamil /**
802f4c4dcf4SKowalski, Kamil  * @brief Formats QueryNotSupportedOnResource message into JSON
803f4c4dcf4SKowalski, Kamil  * Message body: "Querying is not supported on the requested resource."
804f4c4dcf4SKowalski, Kamil  *
805f4c4dcf4SKowalski, Kamil  *
806f4c4dcf4SKowalski, Kamil  * @returns Message QueryNotSupportedOnResource formatted to JSON */
80765176d39SEd Tanous nlohmann::json queryNotSupportedOnResource();
808b5c07418SJames Feist 
809f12894f8SJason M. Bills void queryNotSupportedOnResource(crow::Response& res);
810f4c4dcf4SKowalski, Kamil 
811f4c4dcf4SKowalski, Kamil /**
812684bb4b8SJason M. Bills  * @brief Formats QueryNotSupportedOnOperation message into JSON
813684bb4b8SJason M. Bills  * Message body: "Querying is not supported with the requested operation."
814684bb4b8SJason M. Bills  *
815684bb4b8SJason M. Bills  *
816684bb4b8SJason M. Bills  * @returns Message QueryNotSupportedOnOperation formatted to JSON */
81765176d39SEd Tanous nlohmann::json queryNotSupportedOnOperation();
818684bb4b8SJason M. Bills 
819684bb4b8SJason M. Bills void queryNotSupportedOnOperation(crow::Response& res);
820684bb4b8SJason M. Bills 
821684bb4b8SJason M. Bills /**
822684bb4b8SJason M. Bills  * @brief Formats QueryCombinationInvalid message into JSON
823684bb4b8SJason M. Bills  * Message body: "Two or more query parameters in the request cannot be used
824684bb4b8SJason M. Bills  * together."
825684bb4b8SJason M. Bills  *
826684bb4b8SJason M. Bills  *
827684bb4b8SJason M. Bills  * @returns Message QueryCombinationInvalid formatted to JSON */
82865176d39SEd Tanous nlohmann::json queryCombinationInvalid();
829684bb4b8SJason M. Bills 
830684bb4b8SJason M. Bills void queryCombinationInvalid(crow::Response& res);
831684bb4b8SJason M. Bills 
832684bb4b8SJason M. Bills /**
833f4c4dcf4SKowalski, Kamil  * @brief Formats InsufficientPrivilege message into JSON
834f4c4dcf4SKowalski, Kamil  * Message body: "There are insufficient privileges for the account or
835f4c4dcf4SKowalski, Kamil  * credentials associated with the current session to perform the requested
836f4c4dcf4SKowalski, Kamil  * operation."
837f4c4dcf4SKowalski, Kamil  *
838f4c4dcf4SKowalski, Kamil  *
839f4c4dcf4SKowalski, Kamil  * @returns Message InsufficientPrivilege formatted to JSON */
84065176d39SEd Tanous nlohmann::json insufficientPrivilege();
841b5c07418SJames Feist 
842f12894f8SJason M. Bills void insufficientPrivilege(crow::Response& res);
843f4c4dcf4SKowalski, Kamil 
844f4c4dcf4SKowalski, Kamil /**
845f4c4dcf4SKowalski, Kamil  * @brief Formats PropertyValueModified message into JSON
84666ac2b8cSJason M. Bills  * Message body: "The property <arg1> was assigned the value <arg2> due to
847f4c4dcf4SKowalski, Kamil  * modification by the service."
848f4c4dcf4SKowalski, Kamil  *
849f4c4dcf4SKowalski, Kamil  * @param[in] arg1 Parameter of message that will replace %1 in its body.
850f4c4dcf4SKowalski, Kamil  * @param[in] arg2 Parameter of message that will replace %2 in its body.
851f4c4dcf4SKowalski, Kamil  *
852f4c4dcf4SKowalski, Kamil  * @returns Message PropertyValueModified formatted to JSON */
853b5c07418SJames Feist nlohmann::json propertyValueModified(const std::string& arg1,
854b5c07418SJames Feist                                      const std::string& arg2);
855b5c07418SJames Feist 
856f12894f8SJason M. Bills void propertyValueModified(crow::Response& res, const std::string& arg1,
857f4c4dcf4SKowalski, Kamil                            const std::string& arg2);
858f4c4dcf4SKowalski, Kamil 
859f4c4dcf4SKowalski, Kamil /**
860f4c4dcf4SKowalski, Kamil  * @brief Formats AccountNotModified message into JSON
861f4c4dcf4SKowalski, Kamil  * Message body: "The account modification request failed."
862f4c4dcf4SKowalski, Kamil  *
863f4c4dcf4SKowalski, Kamil  *
864f4c4dcf4SKowalski, Kamil  * @returns Message AccountNotModified formatted to JSON */
86565176d39SEd Tanous nlohmann::json accountNotModified();
866b5c07418SJames Feist 
867f12894f8SJason M. Bills void accountNotModified(crow::Response& res);
868f4c4dcf4SKowalski, Kamil 
869f4c4dcf4SKowalski, Kamil /**
870f4c4dcf4SKowalski, Kamil  * @brief Formats QueryParameterValueFormatError message into JSON
87166ac2b8cSJason M. Bills  * Message body: "The value <arg1> for the parameter <arg2> is of a different
872f4c4dcf4SKowalski, Kamil  * format than the parameter can accept."
873f4c4dcf4SKowalski, Kamil  *
874f4c4dcf4SKowalski, Kamil  * @param[in] arg1 Parameter of message that will replace %1 in its body.
875f4c4dcf4SKowalski, Kamil  * @param[in] arg2 Parameter of message that will replace %2 in its body.
876f4c4dcf4SKowalski, Kamil  *
877f4c4dcf4SKowalski, Kamil  * @returns Message QueryParameterValueFormatError formatted to JSON */
878b5c07418SJames Feist 
879b5c07418SJames Feist nlohmann::json queryParameterValueFormatError(const std::string& arg1,
880b5c07418SJames Feist                                               const std::string& arg2);
881b5c07418SJames Feist 
882f12894f8SJason M. Bills void queryParameterValueFormatError(crow::Response& res,
883f12894f8SJason M. Bills                                     const std::string& arg1,
884f4c4dcf4SKowalski, Kamil                                     const std::string& arg2);
885f4c4dcf4SKowalski, Kamil 
886f4c4dcf4SKowalski, Kamil /**
887f4c4dcf4SKowalski, Kamil  * @brief Formats PropertyMissing message into JSON
88866ac2b8cSJason M. Bills  * Message body: "The property <arg1> is a required property and must be
889f4c4dcf4SKowalski, Kamil  * included in the request."
890f4c4dcf4SKowalski, Kamil  *
891f4c4dcf4SKowalski, Kamil  * @param[in] arg1 Parameter of message that will replace %1 in its body.
892f4c4dcf4SKowalski, Kamil  *
893f4c4dcf4SKowalski, Kamil  * @returns Message PropertyMissing formatted to JSON */
894b5c07418SJames Feist nlohmann::json propertyMissing(const std::string& arg1);
895b5c07418SJames Feist 
896f12894f8SJason M. Bills void propertyMissing(crow::Response& res, const std::string& arg1);
897f12894f8SJason M. Bills 
898f12894f8SJason M. Bills /**
899f4c4dcf4SKowalski, Kamil  * @brief Formats ResourceExhaustion message into JSON
90066ac2b8cSJason M. Bills  * Message body: "The resource <arg1> was unable to satisfy the request due to
901f4c4dcf4SKowalski, Kamil  * unavailability of resources."
902f4c4dcf4SKowalski, Kamil  *
903f4c4dcf4SKowalski, Kamil  * @param[in] arg1 Parameter of message that will replace %1 in its body.
904f4c4dcf4SKowalski, Kamil  *
905f4c4dcf4SKowalski, Kamil  * @returns Message ResourceExhaustion formatted to JSON */
906b5c07418SJames Feist nlohmann::json resourceExhaustion(const std::string& arg1);
907b5c07418SJames Feist 
908f12894f8SJason M. Bills void resourceExhaustion(crow::Response& res, const std::string& arg1);
909f4c4dcf4SKowalski, Kamil 
910f4c4dcf4SKowalski, Kamil /**
911f4c4dcf4SKowalski, Kamil  * @brief Formats AccountModified message into JSON
912f4c4dcf4SKowalski, Kamil  * Message body: "The account was successfully modified."
913f4c4dcf4SKowalski, Kamil  *
914f4c4dcf4SKowalski, Kamil  *
915f4c4dcf4SKowalski, Kamil  * @returns Message AccountModified formatted to JSON */
91665176d39SEd Tanous nlohmann::json accountModified();
917b5c07418SJames Feist 
918a08b46ccSJason M. Bills void accountModified(crow::Response& res);
919f4c4dcf4SKowalski, Kamil 
920f4c4dcf4SKowalski, Kamil /**
921f4c4dcf4SKowalski, Kamil  * @brief Formats QueryParameterOutOfRange message into JSON
92266ac2b8cSJason M. Bills  * Message body: "The value <arg1> for the query parameter <arg2> is out of
92366ac2b8cSJason M. Bills  * range <arg3>."
924f4c4dcf4SKowalski, Kamil  *
925f4c4dcf4SKowalski, Kamil  * @param[in] arg1 Parameter of message that will replace %1 in its body.
926f4c4dcf4SKowalski, Kamil  * @param[in] arg2 Parameter of message that will replace %2 in its body.
927f4c4dcf4SKowalski, Kamil  * @param[in] arg3 Parameter of message that will replace %3 in its body.
928f4c4dcf4SKowalski, Kamil  *
929f4c4dcf4SKowalski, Kamil  * @returns Message QueryParameterOutOfRange formatted to JSON */
930b5c07418SJames Feist nlohmann::json queryParameterOutOfRange(const std::string& arg1,
931b5c07418SJames Feist                                         const std::string& arg2,
932b5c07418SJames Feist                                         const std::string& arg3);
933b5c07418SJames Feist 
934f12894f8SJason M. Bills void queryParameterOutOfRange(crow::Response& res, const std::string& arg1,
935f12894f8SJason M. Bills                               const std::string& arg2, const std::string& arg3);
936f4c4dcf4SKowalski, Kamil 
9373bf4e632SJoseph Reynolds /**
9383bf4e632SJoseph Reynolds  * @brief Formats PasswordChangeRequired message into JSON
9393bf4e632SJoseph Reynolds  * Message body: The password provided for this account must be changed
9403bf4e632SJoseph Reynolds  * before access is granted.  PATCH the 'Password' property for this
9413bf4e632SJoseph Reynolds  * account located at the target URI '%1' to complete this process.
9423bf4e632SJoseph Reynolds  *
9433bf4e632SJoseph Reynolds  * @param[in] arg1 Parameter of message that will replace %1 in its body.
9443bf4e632SJoseph Reynolds  *
9453bf4e632SJoseph Reynolds  * @returns Message PasswordChangeRequired formatted to JSON */
9463bf4e632SJoseph Reynolds void passwordChangeRequired(crow::Response& res, const std::string& arg1);
9473bf4e632SJoseph Reynolds 
9484cde5d90SJames Feist /**
9494cde5d90SJames Feist  * @brief Formats InvalidUpload message into JSON
9504cde5d90SJames Feist  * Message body: Invalid file uploaded to %1: %2.*
9514cde5d90SJames Feist  * @param[in] arg1 Parameter of message that will replace %1 in its body.
9524cde5d90SJames Feist  * @param[in] arg2 Parameter of message that will replace %2 in its body.
9534cde5d90SJames Feist  *
9544cde5d90SJames Feist  * @returns Message InvalidUpload formatted to JSON */
9554cde5d90SJames Feist nlohmann::json invalidUpload(const std::string& arg1, const std::string& arg2);
9564cde5d90SJames Feist 
9574cde5d90SJames Feist void invalidUpload(crow::Response& res, const std::string& arg1,
9584cde5d90SJames Feist                    const std::string& arg2);
9594cde5d90SJames Feist 
960dd28ba82SAppaRao Puli /**
961dd28ba82SAppaRao Puli  * @brief Formats MutualExclusiveProperties message into JSON
962dd28ba82SAppaRao Puli  * Message body: "The properties <arg1> and <arg2> are mutually exclusive."
963dd28ba82SAppaRao Puli  *
964dd28ba82SAppaRao Puli  * @param[in] arg1 Parameter of message that will replace %1 in its body.
965dd28ba82SAppaRao Puli  * @param[in] arg2 Parameter of message that will replace %2 in its body.
966dd28ba82SAppaRao Puli  *
967dd28ba82SAppaRao Puli  * @returns Message MutualExclusiveProperties formatted to JSON */
968dd28ba82SAppaRao Puli nlohmann::json mutualExclusiveProperties(const std::string& arg1,
969dd28ba82SAppaRao Puli                                          const std::string& arg2);
970dd28ba82SAppaRao Puli 
971dd28ba82SAppaRao Puli void mutualExclusiveProperties(crow::Response& res, const std::string& arg1,
972dd28ba82SAppaRao Puli                                const std::string& arg2);
973dd28ba82SAppaRao Puli 
974f4c4dcf4SKowalski, Kamil } // namespace messages
975f4c4dcf4SKowalski, Kamil 
976f4c4dcf4SKowalski, Kamil } // namespace redfish
977