xref: /openbmc/bmcweb/features/redfish/include/error_messages.hpp (revision 65176d3908b27393d81b72284dbebc47055e517c)
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
17c94ad49bSEd Tanous #include "http_response.h"
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 
27684bb4b8SJason M. Bills constexpr const char* messageVersionPrefix = "Base.1.8.1.";
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 */
37*65176d39SEd 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 */
48*65176d39SEd 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 */
89*65176d39SEd 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 */
100*65176d39SEd 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 */
141*65176d39SEd 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 */
193*65176d39SEd 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 /**
253f4c4dcf4SKowalski, Kamil  * @brief Formats ServiceInUnknownState message into JSON
254f4c4dcf4SKowalski, Kamil  * Message body: "The operation failed because the service is in an unknown
255f4c4dcf4SKowalski, Kamil  * state and can no longer take incoming requests."
256f4c4dcf4SKowalski, Kamil  *
257f4c4dcf4SKowalski, Kamil  *
258f4c4dcf4SKowalski, Kamil  * @returns Message ServiceInUnknownState formatted to JSON */
259*65176d39SEd Tanous nlohmann::json serviceInUnknownState();
260b5c07418SJames Feist 
261f12894f8SJason M. Bills void serviceInUnknownState(crow::Response& res);
262f4c4dcf4SKowalski, Kamil 
263f4c4dcf4SKowalski, Kamil /**
264f4c4dcf4SKowalski, Kamil  * @brief Formats EventSubscriptionLimitExceeded message into JSON
265f4c4dcf4SKowalski, Kamil  * Message body: "The event subscription failed due to the number of
266f4c4dcf4SKowalski, Kamil  * simultaneous subscriptions exceeding the limit of the implementation."
267f4c4dcf4SKowalski, Kamil  *
268f4c4dcf4SKowalski, Kamil  *
269f4c4dcf4SKowalski, Kamil  * @returns Message EventSubscriptionLimitExceeded formatted to JSON */
270*65176d39SEd Tanous nlohmann::json eventSubscriptionLimitExceeded();
271b5c07418SJames Feist 
272f12894f8SJason M. Bills void eventSubscriptionLimitExceeded(crow::Response& res);
273f4c4dcf4SKowalski, Kamil 
274f4c4dcf4SKowalski, Kamil /**
275f4c4dcf4SKowalski, Kamil  * @brief Formats ActionParameterMissing message into JSON
27666ac2b8cSJason M. Bills  * Message body: "The action <arg1> requires the parameter <arg2> to be present
277f4c4dcf4SKowalski, Kamil  * in the request body."
278f4c4dcf4SKowalski, Kamil  *
279f4c4dcf4SKowalski, Kamil  * @param[in] arg1 Parameter of message that will replace %1 in its body.
280f4c4dcf4SKowalski, Kamil  * @param[in] arg2 Parameter of message that will replace %2 in its body.
281f4c4dcf4SKowalski, Kamil  *
282f4c4dcf4SKowalski, Kamil  * @returns Message ActionParameterMissing formatted to JSON */
283b5c07418SJames Feist nlohmann::json actionParameterMissing(const std::string& arg1,
284b5c07418SJames Feist                                       const std::string& arg2);
285b5c07418SJames Feist 
286f12894f8SJason M. Bills void actionParameterMissing(crow::Response& res, const std::string& arg1,
287f4c4dcf4SKowalski, Kamil                             const std::string& arg2);
288f4c4dcf4SKowalski, Kamil 
289f4c4dcf4SKowalski, Kamil /**
290f4c4dcf4SKowalski, Kamil  * @brief Formats StringValueTooLong message into JSON
29166ac2b8cSJason M. Bills  * Message body: "The string <arg1> exceeds the length limit <arg2>."
292f4c4dcf4SKowalski, Kamil  *
293f4c4dcf4SKowalski, Kamil  * @param[in] arg1 Parameter of message that will replace %1 in its body.
294f4c4dcf4SKowalski, Kamil  * @param[in] arg2 Parameter of message that will replace %2 in its body.
295f4c4dcf4SKowalski, Kamil  *
296f4c4dcf4SKowalski, Kamil  * @returns Message StringValueTooLong formatted to JSON */
297b5c07418SJames Feist nlohmann::json stringValueTooLong(const std::string& arg1, const int& arg2);
298b5c07418SJames Feist 
299f12894f8SJason M. Bills void stringValueTooLong(crow::Response& res, const std::string& arg1,
300f12894f8SJason M. Bills                         const int& arg2);
301f4c4dcf4SKowalski, Kamil 
302f4c4dcf4SKowalski, Kamil /**
303cc9139ecSJason M. Bills  * @brief Formats SessionTerminated message into JSON
304cc9139ecSJason M. Bills  * Message body: "The session was successfully terminated."
305cc9139ecSJason M. Bills  *
306cc9139ecSJason M. Bills  *
307cc9139ecSJason M. Bills  * @returns Message SessionTerminated formatted to JSON */
308*65176d39SEd Tanous nlohmann::json sessionTerminated();
309b5c07418SJames Feist 
310cc9139ecSJason M. Bills void sessionTerminated(crow::Response& res);
311cc9139ecSJason M. Bills 
312cc9139ecSJason M. Bills /**
313684bb4b8SJason M. Bills  * @brief Formats SubscriptionTerminated message into JSON
314684bb4b8SJason M. Bills  * Message body: "The event subscription has been terminated."
315684bb4b8SJason M. Bills  *
316684bb4b8SJason M. Bills  *
317684bb4b8SJason M. Bills  * @returns Message SubscriptionTerminated formatted to JSON */
318*65176d39SEd Tanous nlohmann::json subscriptionTerminated();
319684bb4b8SJason M. Bills 
320684bb4b8SJason M. Bills void subscriptionTerminated(crow::Response& res);
321684bb4b8SJason M. Bills 
322684bb4b8SJason M. Bills /**
323cc9139ecSJason M. Bills  * @brief Formats ResourceTypeIncompatible message into JSON
324cc9139ecSJason M. Bills  * Message body: "The @odata.type of the request body <arg1> is incompatible
325cc9139ecSJason M. Bills  * with the @odata.type of the resource which is <arg2>."
326cc9139ecSJason M. Bills  *
327cc9139ecSJason M. Bills  * @param[in] arg1 Parameter of message that will replace %1 in its body.
328cc9139ecSJason M. Bills  * @param[in] arg2 Parameter of message that will replace %2 in its body.
329cc9139ecSJason M. Bills  *
330cc9139ecSJason M. Bills  * @returns Message ResourceTypeIncompatible formatted to JSON */
331b5c07418SJames Feist nlohmann::json resourceTypeIncompatible(const std::string& arg1,
332b5c07418SJames Feist                                         const std::string& arg2);
333b5c07418SJames Feist 
334cc9139ecSJason M. Bills void resourceTypeIncompatible(crow::Response& res, const std::string& arg1,
335cc9139ecSJason M. Bills                               const std::string& arg2);
336cc9139ecSJason M. Bills 
337cc9139ecSJason M. Bills /**
338684bb4b8SJason M. Bills  * @brief Formats ResetRequired message into JSON
339684bb4b8SJason M. Bills  * Message body: "In order to complete the operation, a component reset is
340684bb4b8SJason M. Bills  * required with the Reset action URI '<arg1>' and ResetType '<arg2>'."
341684bb4b8SJason M. Bills  *
342684bb4b8SJason M. Bills  * @param[in] arg1 Parameter of message that will replace %1 in its body.
343684bb4b8SJason M. Bills  * @param[in] arg2 Parameter of message that will replace %2 in its body.
344684bb4b8SJason M. Bills  *
345684bb4b8SJason M. Bills  * @returns Message ResetRequired formatted to JSON */
346684bb4b8SJason M. Bills nlohmann::json resetRequired(const std::string& arg1, const std::string& arg2);
347684bb4b8SJason M. Bills 
348684bb4b8SJason M. Bills void resetRequired(crow::Response& res, const std::string& arg1,
349684bb4b8SJason M. Bills                    const std::string& arg2);
350684bb4b8SJason M. Bills 
351684bb4b8SJason M. Bills /**
352684bb4b8SJason M. Bills  * @brief Formats ChassisPowerStateOnRequired message into JSON
353684bb4b8SJason M. Bills  * Message body: "The Chassis with Id '<arg1>' requires to be powered on to
354684bb4b8SJason M. Bills  * perform this request."
355684bb4b8SJason M. Bills  *
356684bb4b8SJason M. Bills  * @param[in] arg1 Parameter of message that will replace %1 in its body.
357684bb4b8SJason M. Bills  *
358684bb4b8SJason M. Bills  * @returns Message ChassisPowerStateOnRequired formatted to JSON */
359684bb4b8SJason M. Bills nlohmann::json chassisPowerStateOnRequired(const std::string& arg1);
360684bb4b8SJason M. Bills 
361684bb4b8SJason M. Bills void chassisPowerStateOnRequired(crow::Response& res, const std::string& arg1);
362684bb4b8SJason M. Bills 
363684bb4b8SJason M. Bills /**
364684bb4b8SJason M. Bills  * @brief Formats ChassisPowerStateOffRequired message into JSON
365684bb4b8SJason M. Bills  * Message body: "The Chassis with Id '<arg1>' requires to be powered off 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 ChassisPowerStateOffRequired formatted to JSON */
371684bb4b8SJason M. Bills nlohmann::json chassisPowerStateOffRequired(const std::string& arg1);
372684bb4b8SJason M. Bills 
373684bb4b8SJason M. Bills void chassisPowerStateOffRequired(crow::Response& res, const std::string& arg1);
374684bb4b8SJason M. Bills 
375684bb4b8SJason M. Bills /**
376684bb4b8SJason M. Bills  * @brief Formats PropertyValueConflict message into JSON
377684bb4b8SJason M. Bills  * Message body: "The property '<arg1>' could not be written because its value
378684bb4b8SJason M. Bills  * would conflict with the value of the '<arg2>' property."
379684bb4b8SJason M. Bills  *
380684bb4b8SJason M. Bills  * @param[in] arg1 Parameter of message that will replace %1 in its body.
381684bb4b8SJason M. Bills  * @param[in] arg2 Parameter of message that will replace %2 in its body.
382684bb4b8SJason M. Bills  *
383684bb4b8SJason M. Bills  * @returns Message PropertyValueConflict formatted to JSON */
384684bb4b8SJason M. Bills nlohmann::json propertyValueConflict(const std::string& arg1,
385684bb4b8SJason M. Bills                                      const std::string& arg2);
386684bb4b8SJason M. Bills 
387684bb4b8SJason M. Bills void propertyValueConflict(crow::Response& res, const std::string& arg1,
388684bb4b8SJason M. Bills                            const std::string& arg2);
389684bb4b8SJason M. Bills 
390684bb4b8SJason M. Bills /**
391684bb4b8SJason M. Bills  * @brief Formats PropertyValueIncorrect message into JSON
392684bb4b8SJason M. Bills  * Message body: "The property '<arg1>' with the requested value of '<arg2>'
393684bb4b8SJason M. Bills  * could not be written because the value does not meet the constraints of the
394684bb4b8SJason M. Bills  * implementation."
395684bb4b8SJason M. Bills  *
396684bb4b8SJason M. Bills  * @param[in] arg1 Parameter of message that will replace %1 in its body.
397684bb4b8SJason M. Bills  * @param[in] arg2 Parameter of message that will replace %2 in its body.
398684bb4b8SJason M. Bills  *
399684bb4b8SJason M. Bills  * @returns Message PropertyValueIncorrect formatted to JSON */
400684bb4b8SJason M. Bills nlohmann::json propertyValueIncorrect(const std::string& arg1,
401684bb4b8SJason M. Bills                                       const std::string& arg2);
402684bb4b8SJason M. Bills 
403684bb4b8SJason M. Bills void propertyValueIncorrect(crow::Response& res, const std::string& arg1,
404684bb4b8SJason M. Bills                             const std::string& arg2);
405684bb4b8SJason M. Bills 
406684bb4b8SJason M. Bills /**
407684bb4b8SJason M. Bills  * @brief Formats ResourceCreationConflict message into JSON
408684bb4b8SJason M. Bills  * Message body: "The resource could not be created.  The service has a resource
409684bb4b8SJason M. Bills  * at URI '<arg1>' that conflicts with the creation request."
410684bb4b8SJason M. Bills  *
411684bb4b8SJason M. Bills  * @param[in] arg1 Parameter of message that will replace %1 in its body.
412684bb4b8SJason M. Bills  *
413684bb4b8SJason M. Bills  * @returns Message ResourceCreationConflict formatted to JSON */
414684bb4b8SJason M. Bills nlohmann::json resourceCreationConflict(const std::string& arg1);
415684bb4b8SJason M. Bills 
416684bb4b8SJason M. Bills void resourceCreationConflict(crow::Response& res, const std::string& arg1);
417684bb4b8SJason M. Bills 
418684bb4b8SJason M. Bills /**
419684bb4b8SJason M. Bills  * @brief Formats MaximumErrorsExceeded message into JSON
420684bb4b8SJason M. Bills  * Message body: "Too many errors have occurred to report them all."
421684bb4b8SJason M. Bills  *
422684bb4b8SJason M. Bills  *
423684bb4b8SJason M. Bills  * @returns Message MaximumErrorsExceeded formatted to JSON */
424*65176d39SEd Tanous nlohmann::json maximumErrorsExceeded();
425684bb4b8SJason M. Bills 
426684bb4b8SJason M. Bills void maximumErrorsExceeded(crow::Response& res);
427684bb4b8SJason M. Bills 
428684bb4b8SJason M. Bills /**
429684bb4b8SJason M. Bills  * @brief Formats PreconditionFailed message into JSON
430684bb4b8SJason M. Bills  * Message body: "The ETag supplied did not match the ETag required to change
431684bb4b8SJason M. Bills  * this resource."
432684bb4b8SJason M. Bills  *
433684bb4b8SJason M. Bills  *
434684bb4b8SJason M. Bills  * @returns Message PreconditionFailed formatted to JSON */
435*65176d39SEd Tanous nlohmann::json preconditionFailed();
436684bb4b8SJason M. Bills 
437684bb4b8SJason M. Bills void preconditionFailed(crow::Response& res);
438684bb4b8SJason M. Bills 
439684bb4b8SJason M. Bills /**
440684bb4b8SJason M. Bills  * @brief Formats PreconditionRequired message into JSON
441684bb4b8SJason M. Bills  * Message body: "A precondition header or annotation is required to change this
442684bb4b8SJason M. Bills  * resource."
443684bb4b8SJason M. Bills  *
444684bb4b8SJason M. Bills  *
445684bb4b8SJason M. Bills  * @returns Message PreconditionRequired formatted to JSON */
446*65176d39SEd Tanous nlohmann::json preconditionRequired();
447684bb4b8SJason M. Bills 
448684bb4b8SJason M. Bills void preconditionRequired(crow::Response& res);
449684bb4b8SJason M. Bills 
450684bb4b8SJason M. Bills /**
451684bb4b8SJason M. Bills  * @brief Formats OperationFailed message into JSON
452684bb4b8SJason M. Bills  * Message body: "An error occurred internal to the service as part of the
453684bb4b8SJason M. Bills  * overall request.  Partial results may have been returned."
454684bb4b8SJason M. Bills  *
455684bb4b8SJason M. Bills  *
456684bb4b8SJason M. Bills  * @returns Message OperationFailed formatted to JSON */
457*65176d39SEd Tanous nlohmann::json operationFailed();
458684bb4b8SJason M. Bills 
459684bb4b8SJason M. Bills void operationFailed(crow::Response& res);
460684bb4b8SJason M. Bills 
461684bb4b8SJason M. Bills /**
462684bb4b8SJason M. Bills  * @brief Formats OperationTimeout message into JSON
463684bb4b8SJason M. Bills  * Message body: "A timeout internal to the service occured as part of the
464684bb4b8SJason M. Bills  * request.  Partial results may have been returned."
465684bb4b8SJason M. Bills  *
466684bb4b8SJason M. Bills  *
467684bb4b8SJason M. Bills  * @returns Message OperationTimeout formatted to JSON */
468*65176d39SEd Tanous nlohmann::json operationTimeout();
469684bb4b8SJason M. Bills 
470684bb4b8SJason M. Bills void operationTimeout(crow::Response& res);
471684bb4b8SJason M. Bills 
472684bb4b8SJason M. Bills /**
473f4c4dcf4SKowalski, Kamil  * @brief Formats PropertyValueTypeError message into JSON
47466ac2b8cSJason M. Bills  * Message body: "The value <arg1> for the property <arg2> is of a different
475f4c4dcf4SKowalski, Kamil  * type than the property can accept."
476f4c4dcf4SKowalski, Kamil  *
477f4c4dcf4SKowalski, Kamil  * @param[in] arg1 Parameter of message that will replace %1 in its body.
478f4c4dcf4SKowalski, Kamil  * @param[in] arg2 Parameter of message that will replace %2 in its body.
479f4c4dcf4SKowalski, Kamil  *
480f4c4dcf4SKowalski, Kamil  * @returns Message PropertyValueTypeError formatted to JSON */
481b5c07418SJames Feist nlohmann::json propertyValueTypeError(const std::string& arg1,
482b5c07418SJames Feist                                       const std::string& arg2);
483b5c07418SJames Feist 
484f12894f8SJason M. Bills void propertyValueTypeError(crow::Response& res, const std::string& arg1,
485f4c4dcf4SKowalski, Kamil                             const std::string& arg2);
486f4c4dcf4SKowalski, Kamil 
487f4c4dcf4SKowalski, Kamil /**
488f4c4dcf4SKowalski, Kamil  * @brief Formats ResourceNotFound message into JSON
48966ac2b8cSJason M. Bills  * Message body: "The requested resource of type <arg1> named <arg2> was not
490f4c4dcf4SKowalski, Kamil  * found."
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 ResourceNotFound formatted to JSON */
496b5c07418SJames Feist nlohmann::json resourceNotFound(const std::string& arg1,
497b5c07418SJames Feist                                 const std::string& arg2);
498b5c07418SJames Feist 
499f12894f8SJason M. Bills void resourceNotFound(crow::Response& res, const std::string& arg1,
500f4c4dcf4SKowalski, Kamil                       const std::string& arg2);
501f4c4dcf4SKowalski, Kamil 
502f4c4dcf4SKowalski, Kamil /**
503f4c4dcf4SKowalski, Kamil  * @brief Formats CouldNotEstablishConnection message into JSON
50455c7b7a2SEd Tanous  * Message body: "The service failed to establish a Connection with the URI
50566ac2b8cSJason M. Bills  * <arg1>."
506f4c4dcf4SKowalski, Kamil  *
507f4c4dcf4SKowalski, Kamil  * @param[in] arg1 Parameter of message that will replace %1 in its body.
508f4c4dcf4SKowalski, Kamil  *
509f4c4dcf4SKowalski, Kamil  * @returns Message CouldNotEstablishConnection formatted to JSON */
510b5c07418SJames Feist nlohmann::json couldNotEstablishConnection(const std::string& arg1);
511b5c07418SJames Feist 
512f12894f8SJason M. Bills void couldNotEstablishConnection(crow::Response& res, const std::string& arg1);
513f4c4dcf4SKowalski, Kamil 
514f4c4dcf4SKowalski, Kamil /**
515f4c4dcf4SKowalski, Kamil  * @brief Formats PropertyNotWritable message into JSON
51666ac2b8cSJason M. Bills  * Message body: "The property <arg1> is a read only property and cannot be
517f4c4dcf4SKowalski, Kamil  * assigned a value."
518f4c4dcf4SKowalski, Kamil  *
519f4c4dcf4SKowalski, Kamil  * @param[in] arg1 Parameter of message that will replace %1 in its body.
520f4c4dcf4SKowalski, Kamil  *
521f4c4dcf4SKowalski, Kamil  * @returns Message PropertyNotWritable formatted to JSON */
522b5c07418SJames Feist nlohmann::json propertyNotWritable(const std::string& arg1);
523b5c07418SJames Feist 
524f12894f8SJason M. Bills void propertyNotWritable(crow::Response& res, const std::string& arg1);
525f12894f8SJason M. Bills 
526f12894f8SJason M. Bills /**
527f4c4dcf4SKowalski, Kamil  * @brief Formats QueryParameterValueTypeError message into JSON
52866ac2b8cSJason M. Bills  * Message body: "The value <arg1> for the query parameter <arg2> is of a
529f4c4dcf4SKowalski, Kamil  * different type than the parameter can accept."
530f4c4dcf4SKowalski, Kamil  *
531f4c4dcf4SKowalski, Kamil  * @param[in] arg1 Parameter of message that will replace %1 in its body.
532f4c4dcf4SKowalski, Kamil  * @param[in] arg2 Parameter of message that will replace %2 in its body.
533f4c4dcf4SKowalski, Kamil  *
534f4c4dcf4SKowalski, Kamil  * @returns Message QueryParameterValueTypeError formatted to JSON */
535b5c07418SJames Feist nlohmann::json queryParameterValueTypeError(const std::string& arg1,
536b5c07418SJames Feist                                             const std::string& arg2);
537b5c07418SJames Feist 
538f12894f8SJason M. Bills void queryParameterValueTypeError(crow::Response& res, const std::string& arg1,
539f4c4dcf4SKowalski, Kamil                                   const std::string& arg2);
540f4c4dcf4SKowalski, Kamil 
541f4c4dcf4SKowalski, Kamil /**
542f4c4dcf4SKowalski, Kamil  * @brief Formats ServiceShuttingDown message into JSON
543f4c4dcf4SKowalski, Kamil  * Message body: "The operation failed because the service is shutting down and
544f4c4dcf4SKowalski, Kamil  * can no longer take incoming requests."
545f4c4dcf4SKowalski, Kamil  *
546f4c4dcf4SKowalski, Kamil  *
547f4c4dcf4SKowalski, Kamil  * @returns Message ServiceShuttingDown formatted to JSON */
548*65176d39SEd Tanous nlohmann::json serviceShuttingDown();
549b5c07418SJames Feist 
550f12894f8SJason M. Bills void serviceShuttingDown(crow::Response& res);
551f4c4dcf4SKowalski, Kamil 
552f4c4dcf4SKowalski, Kamil /**
553f4c4dcf4SKowalski, Kamil  * @brief Formats ActionParameterDuplicate message into JSON
55466ac2b8cSJason M. Bills  * Message body: "The action <arg1> was submitted with more than one value for
55566ac2b8cSJason M. Bills  * the parameter <arg2>."
556f4c4dcf4SKowalski, Kamil  *
557f4c4dcf4SKowalski, Kamil  * @param[in] arg1 Parameter of message that will replace %1 in its body.
558f4c4dcf4SKowalski, Kamil  * @param[in] arg2 Parameter of message that will replace %2 in its body.
559f4c4dcf4SKowalski, Kamil  *
560f4c4dcf4SKowalski, Kamil  * @returns Message ActionParameterDuplicate formatted to JSON */
561b5c07418SJames Feist nlohmann::json actionParameterDuplicate(const std::string& arg1,
562b5c07418SJames Feist                                         const std::string& arg2);
563b5c07418SJames Feist 
564f12894f8SJason M. Bills void actionParameterDuplicate(crow::Response& res, const std::string& arg1,
565f4c4dcf4SKowalski, Kamil                               const std::string& arg2);
566f4c4dcf4SKowalski, Kamil 
567f4c4dcf4SKowalski, Kamil /**
568f4c4dcf4SKowalski, Kamil  * @brief Formats ActionParameterNotSupported message into JSON
56966ac2b8cSJason M. Bills  * Message body: "The parameter <arg1> for the action <arg2> is not supported on
570f4c4dcf4SKowalski, Kamil  * the target resource."
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 ActionParameterNotSupported formatted to JSON */
576b5c07418SJames Feist nlohmann::json actionParameterNotSupported(const std::string& arg1,
577b5c07418SJames Feist                                            const std::string& arg2);
578b5c07418SJames Feist 
579f12894f8SJason M. Bills void actionParameterNotSupported(crow::Response& res, const std::string& arg1,
580f4c4dcf4SKowalski, Kamil                                  const std::string& arg2);
581f4c4dcf4SKowalski, Kamil 
582f4c4dcf4SKowalski, Kamil /**
583f4c4dcf4SKowalski, Kamil  * @brief Formats SourceDoesNotSupportProtocol message into JSON
58466ac2b8cSJason M. Bills  * Message body: "The other end of the Connection at <arg1> does not support the
58566ac2b8cSJason M. Bills  * specified protocol <arg2>."
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 SourceDoesNotSupportProtocol formatted to JSON */
591b5c07418SJames Feist nlohmann::json sourceDoesNotSupportProtocol(const std::string& arg1,
592b5c07418SJames Feist                                             const std::string& arg2);
593b5c07418SJames Feist 
594f12894f8SJason M. Bills void sourceDoesNotSupportProtocol(crow::Response& res, const std::string& arg1,
595f4c4dcf4SKowalski, Kamil                                   const std::string& arg2);
596f4c4dcf4SKowalski, Kamil 
597f4c4dcf4SKowalski, Kamil /**
598f4c4dcf4SKowalski, Kamil  * @brief Formats AccountRemoved message into JSON
599f4c4dcf4SKowalski, Kamil  * Message body: "The account was successfully removed."
600f4c4dcf4SKowalski, Kamil  *
601f4c4dcf4SKowalski, Kamil  *
602f4c4dcf4SKowalski, Kamil  * @returns Message AccountRemoved formatted to JSON */
603*65176d39SEd Tanous nlohmann::json accountRemoved();
604b5c07418SJames Feist 
605f12894f8SJason M. Bills void accountRemoved(crow::Response& res);
606f4c4dcf4SKowalski, Kamil 
607f4c4dcf4SKowalski, Kamil /**
608f4c4dcf4SKowalski, Kamil  * @brief Formats AccessDenied message into JSON
60966ac2b8cSJason M. Bills  * Message body: "While attempting to establish a Connection to <arg1>, the
610f4c4dcf4SKowalski, Kamil  * service denied access."
611f4c4dcf4SKowalski, Kamil  *
612f4c4dcf4SKowalski, Kamil  * @param[in] arg1 Parameter of message that will replace %1 in its body.
613f4c4dcf4SKowalski, Kamil  *
614f4c4dcf4SKowalski, Kamil  * @returns Message AccessDenied formatted to JSON */
615b5c07418SJames Feist nlohmann::json accessDenied(const std::string& arg1);
616b5c07418SJames Feist 
617f12894f8SJason M. Bills void accessDenied(crow::Response& res, const std::string& arg1);
618f4c4dcf4SKowalski, Kamil 
619f4c4dcf4SKowalski, Kamil /**
620f4c4dcf4SKowalski, Kamil  * @brief Formats QueryNotSupported message into JSON
621f4c4dcf4SKowalski, Kamil  * Message body: "Querying is not supported by the implementation."
622f4c4dcf4SKowalski, Kamil  *
623f4c4dcf4SKowalski, Kamil  *
624f4c4dcf4SKowalski, Kamil  * @returns Message QueryNotSupported formatted to JSON */
625*65176d39SEd Tanous nlohmann::json queryNotSupported();
626b5c07418SJames Feist 
627f12894f8SJason M. Bills void queryNotSupported(crow::Response& res);
628f4c4dcf4SKowalski, Kamil 
629f4c4dcf4SKowalski, Kamil /**
630f4c4dcf4SKowalski, Kamil  * @brief Formats CreateLimitReachedForResource message into JSON
631f4c4dcf4SKowalski, Kamil  * Message body: "The create operation failed because the resource has reached
632f4c4dcf4SKowalski, Kamil  * the limit of possible resources."
633f4c4dcf4SKowalski, Kamil  *
634f4c4dcf4SKowalski, Kamil  *
635f4c4dcf4SKowalski, Kamil  * @returns Message CreateLimitReachedForResource formatted to JSON */
636*65176d39SEd Tanous nlohmann::json createLimitReachedForResource();
637b5c07418SJames Feist 
638f12894f8SJason M. Bills void createLimitReachedForResource(crow::Response& res);
639f4c4dcf4SKowalski, Kamil 
640f4c4dcf4SKowalski, Kamil /**
641f4c4dcf4SKowalski, Kamil  * @brief Formats GeneralError message into JSON
642f4c4dcf4SKowalski, Kamil  * Message body: "A general error has occurred. See ExtendedInfo for more
643f4c4dcf4SKowalski, Kamil  * information."
644f4c4dcf4SKowalski, Kamil  *
645f4c4dcf4SKowalski, Kamil  *
646f4c4dcf4SKowalski, Kamil  * @returns Message GeneralError formatted to JSON */
647*65176d39SEd Tanous nlohmann::json generalError();
648b5c07418SJames Feist 
649f12894f8SJason M. Bills void generalError(crow::Response& res);
650f4c4dcf4SKowalski, Kamil 
651f4c4dcf4SKowalski, Kamil /**
652f4c4dcf4SKowalski, Kamil  * @brief Formats Success message into JSON
653f4c4dcf4SKowalski, Kamil  * Message body: "Successfully Completed Request"
654f4c4dcf4SKowalski, Kamil  *
655f4c4dcf4SKowalski, Kamil  *
656f4c4dcf4SKowalski, Kamil  * @returns Message Success formatted to JSON */
657*65176d39SEd Tanous nlohmann::json success();
658b5c07418SJames Feist 
659f12894f8SJason M. Bills void success(crow::Response& res);
660f12894f8SJason M. Bills 
661f12894f8SJason M. Bills /**
662f4c4dcf4SKowalski, Kamil  * @brief Formats Created message into JSON
663f4c4dcf4SKowalski, Kamil  * Message body: "The resource has been created successfully"
664f4c4dcf4SKowalski, Kamil  *
665f4c4dcf4SKowalski, Kamil  *
666f4c4dcf4SKowalski, Kamil  * @returns Message Created formatted to JSON */
667*65176d39SEd Tanous nlohmann::json created();
668b5c07418SJames Feist 
669f12894f8SJason M. Bills void created(crow::Response& res);
670f4c4dcf4SKowalski, Kamil 
671f4c4dcf4SKowalski, Kamil /**
672cc9139ecSJason M. Bills  * @brief Formats NoOperation message into JSON
673cc9139ecSJason M. Bills  * Message body: "The request body submitted contain no data to act upon and
674cc9139ecSJason M. Bills  * no changes to the resource took place."
675cc9139ecSJason M. Bills  *
676cc9139ecSJason M. Bills  *
677cc9139ecSJason M. Bills  * @returns Message NoOperation formatted to JSON */
678*65176d39SEd Tanous nlohmann::json noOperation();
679b5c07418SJames Feist 
680cc9139ecSJason M. Bills void noOperation(crow::Response& res);
681cc9139ecSJason M. Bills 
682cc9139ecSJason M. Bills /**
683f4c4dcf4SKowalski, Kamil  * @brief Formats PropertyUnknown message into JSON
68466ac2b8cSJason M. Bills  * Message body: "The property <arg1> is not in the list of valid properties for
685f4c4dcf4SKowalski, Kamil  * the resource."
686f4c4dcf4SKowalski, Kamil  *
687f4c4dcf4SKowalski, Kamil  * @param[in] arg1 Parameter of message that will replace %1 in its body.
688f4c4dcf4SKowalski, Kamil  *
689f4c4dcf4SKowalski, Kamil  * @returns Message PropertyUnknown formatted to JSON */
690b5c07418SJames Feist nlohmann::json propertyUnknown(const std::string& arg1);
691b5c07418SJames Feist 
692f12894f8SJason M. Bills void propertyUnknown(crow::Response& res, const std::string& arg1);
693f12894f8SJason M. Bills 
694f12894f8SJason M. Bills /**
695f4c4dcf4SKowalski, Kamil  * @brief Formats NoValidSession message into JSON
696f4c4dcf4SKowalski, Kamil  * Message body: "There is no valid session established with the
697f4c4dcf4SKowalski, Kamil  * implementation."
698f4c4dcf4SKowalski, Kamil  *
699f4c4dcf4SKowalski, Kamil  *
700f4c4dcf4SKowalski, Kamil  * @returns Message NoValidSession formatted to JSON */
701*65176d39SEd Tanous nlohmann::json noValidSession();
702b5c07418SJames Feist 
703f12894f8SJason M. Bills void noValidSession(crow::Response& res);
704f4c4dcf4SKowalski, Kamil 
705f4c4dcf4SKowalski, Kamil /**
706f4c4dcf4SKowalski, Kamil  * @brief Formats InvalidObject message into JSON
70766ac2b8cSJason M. Bills  * Message body: "The object at <arg1> is invalid."
708f4c4dcf4SKowalski, Kamil  *
709f4c4dcf4SKowalski, Kamil  * @param[in] arg1 Parameter of message that will replace %1 in its body.
710f4c4dcf4SKowalski, Kamil  *
711f4c4dcf4SKowalski, Kamil  * @returns Message InvalidObject formatted to JSON */
712b5c07418SJames Feist nlohmann::json invalidObject(const std::string& arg1);
713b5c07418SJames Feist 
714f12894f8SJason M. Bills void invalidObject(crow::Response& res, const std::string& arg1);
715f4c4dcf4SKowalski, Kamil 
716f4c4dcf4SKowalski, Kamil /**
717f4c4dcf4SKowalski, Kamil  * @brief Formats ResourceInStandby message into JSON
718f4c4dcf4SKowalski, Kamil  * Message body: "The request could not be performed because the resource is in
719f4c4dcf4SKowalski, Kamil  * standby."
720f4c4dcf4SKowalski, Kamil  *
721f4c4dcf4SKowalski, Kamil  *
722f4c4dcf4SKowalski, Kamil  * @returns Message ResourceInStandby formatted to JSON */
723*65176d39SEd Tanous nlohmann::json resourceInStandby();
724b5c07418SJames Feist 
725f12894f8SJason M. Bills void resourceInStandby(crow::Response& res);
726f4c4dcf4SKowalski, Kamil 
727f4c4dcf4SKowalski, Kamil /**
728f4c4dcf4SKowalski, Kamil  * @brief Formats ActionParameterValueTypeError message into JSON
72966ac2b8cSJason M. Bills  * Message body: "The value <arg1> for the parameter <arg2> in the action <arg3>
730f4c4dcf4SKowalski, Kamil  * is of a different type than the parameter can accept."
731f4c4dcf4SKowalski, Kamil  *
732f4c4dcf4SKowalski, Kamil  * @param[in] arg1 Parameter of message that will replace %1 in its body.
733f4c4dcf4SKowalski, Kamil  * @param[in] arg2 Parameter of message that will replace %2 in its body.
734f4c4dcf4SKowalski, Kamil  * @param[in] arg3 Parameter of message that will replace %3 in its body.
735f4c4dcf4SKowalski, Kamil  *
736f4c4dcf4SKowalski, Kamil  * @returns Message ActionParameterValueTypeError formatted to JSON */
737b5c07418SJames Feist nlohmann::json actionParameterValueTypeError(const std::string& arg1,
738b5c07418SJames Feist                                              const std::string& arg2,
739b5c07418SJames Feist                                              const std::string& arg3);
740b5c07418SJames Feist 
741f12894f8SJason M. Bills void actionParameterValueTypeError(crow::Response& res, const std::string& arg1,
742f4c4dcf4SKowalski, Kamil                                    const std::string& arg2,
743f4c4dcf4SKowalski, Kamil                                    const std::string& arg3);
744f4c4dcf4SKowalski, Kamil 
745f4c4dcf4SKowalski, Kamil /**
746f4c4dcf4SKowalski, Kamil  * @brief Formats SessionLimitExceeded message into JSON
747f4c4dcf4SKowalski, Kamil  * Message body: "The session establishment failed due to the number of
748f4c4dcf4SKowalski, Kamil  * simultaneous sessions exceeding the limit of the implementation."
749f4c4dcf4SKowalski, Kamil  *
750f4c4dcf4SKowalski, Kamil  *
751f4c4dcf4SKowalski, Kamil  * @returns Message SessionLimitExceeded formatted to JSON */
752*65176d39SEd Tanous nlohmann::json sessionLimitExceeded();
753b5c07418SJames Feist 
754f12894f8SJason M. Bills void sessionLimitExceeded(crow::Response& res);
755f4c4dcf4SKowalski, Kamil 
756f4c4dcf4SKowalski, Kamil /**
757f4c4dcf4SKowalski, Kamil  * @brief Formats ActionNotSupported message into JSON
75866ac2b8cSJason M. Bills  * Message body: "The action <arg1> is not supported by the resource."
759f4c4dcf4SKowalski, Kamil  *
760f4c4dcf4SKowalski, Kamil  * @param[in] arg1 Parameter of message that will replace %1 in its body.
761f4c4dcf4SKowalski, Kamil  *
762f4c4dcf4SKowalski, Kamil  * @returns Message ActionNotSupported formatted to JSON */
763b5c07418SJames Feist nlohmann::json actionNotSupported(const std::string& arg1);
764b5c07418SJames Feist 
765f12894f8SJason M. Bills void actionNotSupported(crow::Response& res, const std::string& arg1);
766f4c4dcf4SKowalski, Kamil 
767f4c4dcf4SKowalski, Kamil /**
768f4c4dcf4SKowalski, Kamil  * @brief Formats InvalidIndex message into JSON
76966ac2b8cSJason M. Bills  * Message body: "The index <arg1> is not a valid offset into the array."
770f4c4dcf4SKowalski, Kamil  *
771f4c4dcf4SKowalski, Kamil  * @param[in] arg1 Parameter of message that will replace %1 in its body.
772f4c4dcf4SKowalski, Kamil  *
773f4c4dcf4SKowalski, Kamil  * @returns Message InvalidIndex formatted to JSON */
774b5c07418SJames Feist nlohmann::json invalidIndex(const int& arg1);
775b5c07418SJames Feist 
776f12894f8SJason M. Bills void invalidIndex(crow::Response& res, const int& arg1);
777f4c4dcf4SKowalski, Kamil 
778f4c4dcf4SKowalski, Kamil /**
779f4c4dcf4SKowalski, Kamil  * @brief Formats EmptyJSON message into JSON
780f4c4dcf4SKowalski, Kamil  * Message body: "The request body submitted contained an empty JSON object and
781f4c4dcf4SKowalski, Kamil  * the service is unable to process it."
782f4c4dcf4SKowalski, Kamil  *
783f4c4dcf4SKowalski, Kamil  *
784f4c4dcf4SKowalski, Kamil  * @returns Message EmptyJSON formatted to JSON */
785*65176d39SEd Tanous nlohmann::json emptyJSON();
786b5c07418SJames Feist 
787f12894f8SJason M. Bills void emptyJSON(crow::Response& res);
788f4c4dcf4SKowalski, Kamil 
789f4c4dcf4SKowalski, Kamil /**
790f4c4dcf4SKowalski, Kamil  * @brief Formats QueryNotSupportedOnResource message into JSON
791f4c4dcf4SKowalski, Kamil  * Message body: "Querying is not supported on the requested resource."
792f4c4dcf4SKowalski, Kamil  *
793f4c4dcf4SKowalski, Kamil  *
794f4c4dcf4SKowalski, Kamil  * @returns Message QueryNotSupportedOnResource formatted to JSON */
795*65176d39SEd Tanous nlohmann::json queryNotSupportedOnResource();
796b5c07418SJames Feist 
797f12894f8SJason M. Bills void queryNotSupportedOnResource(crow::Response& res);
798f4c4dcf4SKowalski, Kamil 
799f4c4dcf4SKowalski, Kamil /**
800684bb4b8SJason M. Bills  * @brief Formats QueryNotSupportedOnOperation message into JSON
801684bb4b8SJason M. Bills  * Message body: "Querying is not supported with the requested operation."
802684bb4b8SJason M. Bills  *
803684bb4b8SJason M. Bills  *
804684bb4b8SJason M. Bills  * @returns Message QueryNotSupportedOnOperation formatted to JSON */
805*65176d39SEd Tanous nlohmann::json queryNotSupportedOnOperation();
806684bb4b8SJason M. Bills 
807684bb4b8SJason M. Bills void queryNotSupportedOnOperation(crow::Response& res);
808684bb4b8SJason M. Bills 
809684bb4b8SJason M. Bills /**
810684bb4b8SJason M. Bills  * @brief Formats QueryCombinationInvalid message into JSON
811684bb4b8SJason M. Bills  * Message body: "Two or more query parameters in the request cannot be used
812684bb4b8SJason M. Bills  * together."
813684bb4b8SJason M. Bills  *
814684bb4b8SJason M. Bills  *
815684bb4b8SJason M. Bills  * @returns Message QueryCombinationInvalid formatted to JSON */
816*65176d39SEd Tanous nlohmann::json queryCombinationInvalid();
817684bb4b8SJason M. Bills 
818684bb4b8SJason M. Bills void queryCombinationInvalid(crow::Response& res);
819684bb4b8SJason M. Bills 
820684bb4b8SJason M. Bills /**
821f4c4dcf4SKowalski, Kamil  * @brief Formats InsufficientPrivilege message into JSON
822f4c4dcf4SKowalski, Kamil  * Message body: "There are insufficient privileges for the account or
823f4c4dcf4SKowalski, Kamil  * credentials associated with the current session to perform the requested
824f4c4dcf4SKowalski, Kamil  * operation."
825f4c4dcf4SKowalski, Kamil  *
826f4c4dcf4SKowalski, Kamil  *
827f4c4dcf4SKowalski, Kamil  * @returns Message InsufficientPrivilege formatted to JSON */
828*65176d39SEd Tanous nlohmann::json insufficientPrivilege();
829b5c07418SJames Feist 
830f12894f8SJason M. Bills void insufficientPrivilege(crow::Response& res);
831f4c4dcf4SKowalski, Kamil 
832f4c4dcf4SKowalski, Kamil /**
833f4c4dcf4SKowalski, Kamil  * @brief Formats PropertyValueModified message into JSON
83466ac2b8cSJason M. Bills  * Message body: "The property <arg1> was assigned the value <arg2> due to
835f4c4dcf4SKowalski, Kamil  * modification by the service."
836f4c4dcf4SKowalski, Kamil  *
837f4c4dcf4SKowalski, Kamil  * @param[in] arg1 Parameter of message that will replace %1 in its body.
838f4c4dcf4SKowalski, Kamil  * @param[in] arg2 Parameter of message that will replace %2 in its body.
839f4c4dcf4SKowalski, Kamil  *
840f4c4dcf4SKowalski, Kamil  * @returns Message PropertyValueModified formatted to JSON */
841b5c07418SJames Feist nlohmann::json propertyValueModified(const std::string& arg1,
842b5c07418SJames Feist                                      const std::string& arg2);
843b5c07418SJames Feist 
844f12894f8SJason M. Bills void propertyValueModified(crow::Response& res, const std::string& arg1,
845f4c4dcf4SKowalski, Kamil                            const std::string& arg2);
846f4c4dcf4SKowalski, Kamil 
847f4c4dcf4SKowalski, Kamil /**
848f4c4dcf4SKowalski, Kamil  * @brief Formats AccountNotModified message into JSON
849f4c4dcf4SKowalski, Kamil  * Message body: "The account modification request failed."
850f4c4dcf4SKowalski, Kamil  *
851f4c4dcf4SKowalski, Kamil  *
852f4c4dcf4SKowalski, Kamil  * @returns Message AccountNotModified formatted to JSON */
853*65176d39SEd Tanous nlohmann::json accountNotModified();
854b5c07418SJames Feist 
855f12894f8SJason M. Bills void accountNotModified(crow::Response& res);
856f4c4dcf4SKowalski, Kamil 
857f4c4dcf4SKowalski, Kamil /**
858f4c4dcf4SKowalski, Kamil  * @brief Formats QueryParameterValueFormatError message into JSON
85966ac2b8cSJason M. Bills  * Message body: "The value <arg1> for the parameter <arg2> is of a different
860f4c4dcf4SKowalski, Kamil  * format than the parameter can accept."
861f4c4dcf4SKowalski, Kamil  *
862f4c4dcf4SKowalski, Kamil  * @param[in] arg1 Parameter of message that will replace %1 in its body.
863f4c4dcf4SKowalski, Kamil  * @param[in] arg2 Parameter of message that will replace %2 in its body.
864f4c4dcf4SKowalski, Kamil  *
865f4c4dcf4SKowalski, Kamil  * @returns Message QueryParameterValueFormatError formatted to JSON */
866b5c07418SJames Feist 
867b5c07418SJames Feist nlohmann::json queryParameterValueFormatError(const std::string& arg1,
868b5c07418SJames Feist                                               const std::string& arg2);
869b5c07418SJames Feist 
870f12894f8SJason M. Bills void queryParameterValueFormatError(crow::Response& res,
871f12894f8SJason M. Bills                                     const std::string& arg1,
872f4c4dcf4SKowalski, Kamil                                     const std::string& arg2);
873f4c4dcf4SKowalski, Kamil 
874f4c4dcf4SKowalski, Kamil /**
875f4c4dcf4SKowalski, Kamil  * @brief Formats PropertyMissing message into JSON
87666ac2b8cSJason M. Bills  * Message body: "The property <arg1> is a required property and must be
877f4c4dcf4SKowalski, Kamil  * included in the request."
878f4c4dcf4SKowalski, Kamil  *
879f4c4dcf4SKowalski, Kamil  * @param[in] arg1 Parameter of message that will replace %1 in its body.
880f4c4dcf4SKowalski, Kamil  *
881f4c4dcf4SKowalski, Kamil  * @returns Message PropertyMissing formatted to JSON */
882b5c07418SJames Feist nlohmann::json propertyMissing(const std::string& arg1);
883b5c07418SJames Feist 
884f12894f8SJason M. Bills void propertyMissing(crow::Response& res, const std::string& arg1);
885f12894f8SJason M. Bills 
886f12894f8SJason M. Bills /**
887f4c4dcf4SKowalski, Kamil  * @brief Formats ResourceExhaustion message into JSON
88866ac2b8cSJason M. Bills  * Message body: "The resource <arg1> was unable to satisfy the request due to
889f4c4dcf4SKowalski, Kamil  * unavailability of resources."
890f4c4dcf4SKowalski, Kamil  *
891f4c4dcf4SKowalski, Kamil  * @param[in] arg1 Parameter of message that will replace %1 in its body.
892f4c4dcf4SKowalski, Kamil  *
893f4c4dcf4SKowalski, Kamil  * @returns Message ResourceExhaustion formatted to JSON */
894b5c07418SJames Feist nlohmann::json resourceExhaustion(const std::string& arg1);
895b5c07418SJames Feist 
896f12894f8SJason M. Bills void resourceExhaustion(crow::Response& res, const std::string& arg1);
897f4c4dcf4SKowalski, Kamil 
898f4c4dcf4SKowalski, Kamil /**
899f4c4dcf4SKowalski, Kamil  * @brief Formats AccountModified message into JSON
900f4c4dcf4SKowalski, Kamil  * Message body: "The account was successfully modified."
901f4c4dcf4SKowalski, Kamil  *
902f4c4dcf4SKowalski, Kamil  *
903f4c4dcf4SKowalski, Kamil  * @returns Message AccountModified formatted to JSON */
904*65176d39SEd Tanous nlohmann::json accountModified();
905b5c07418SJames Feist 
906a08b46ccSJason M. Bills void accountModified(crow::Response& res);
907f4c4dcf4SKowalski, Kamil 
908f4c4dcf4SKowalski, Kamil /**
909f4c4dcf4SKowalski, Kamil  * @brief Formats QueryParameterOutOfRange message into JSON
91066ac2b8cSJason M. Bills  * Message body: "The value <arg1> for the query parameter <arg2> is out of
91166ac2b8cSJason M. Bills  * range <arg3>."
912f4c4dcf4SKowalski, Kamil  *
913f4c4dcf4SKowalski, Kamil  * @param[in] arg1 Parameter of message that will replace %1 in its body.
914f4c4dcf4SKowalski, Kamil  * @param[in] arg2 Parameter of message that will replace %2 in its body.
915f4c4dcf4SKowalski, Kamil  * @param[in] arg3 Parameter of message that will replace %3 in its body.
916f4c4dcf4SKowalski, Kamil  *
917f4c4dcf4SKowalski, Kamil  * @returns Message QueryParameterOutOfRange formatted to JSON */
918b5c07418SJames Feist nlohmann::json queryParameterOutOfRange(const std::string& arg1,
919b5c07418SJames Feist                                         const std::string& arg2,
920b5c07418SJames Feist                                         const std::string& arg3);
921b5c07418SJames Feist 
922f12894f8SJason M. Bills void queryParameterOutOfRange(crow::Response& res, const std::string& arg1,
923f12894f8SJason M. Bills                               const std::string& arg2, const std::string& arg3);
924f4c4dcf4SKowalski, Kamil 
9253bf4e632SJoseph Reynolds /**
9263bf4e632SJoseph Reynolds  * @brief Formats PasswordChangeRequired message into JSON
9273bf4e632SJoseph Reynolds  * Message body: The password provided for this account must be changed
9283bf4e632SJoseph Reynolds  * before access is granted.  PATCH the 'Password' property for this
9293bf4e632SJoseph Reynolds  * account located at the target URI '%1' to complete this process.
9303bf4e632SJoseph Reynolds  *
9313bf4e632SJoseph Reynolds  * @param[in] arg1 Parameter of message that will replace %1 in its body.
9323bf4e632SJoseph Reynolds  *
9333bf4e632SJoseph Reynolds  * @returns Message PasswordChangeRequired formatted to JSON */
9343bf4e632SJoseph Reynolds void passwordChangeRequired(crow::Response& res, const std::string& arg1);
9353bf4e632SJoseph Reynolds 
9364cde5d90SJames Feist /**
9374cde5d90SJames Feist  * @brief Formats InvalidUpload message into JSON
9384cde5d90SJames Feist  * Message body: Invalid file uploaded to %1: %2.*
9394cde5d90SJames Feist  * @param[in] arg1 Parameter of message that will replace %1 in its body.
9404cde5d90SJames Feist  * @param[in] arg2 Parameter of message that will replace %2 in its body.
9414cde5d90SJames Feist  *
9424cde5d90SJames Feist  * @returns Message InvalidUpload formatted to JSON */
9434cde5d90SJames Feist nlohmann::json invalidUpload(const std::string& arg1, const std::string& arg2);
9444cde5d90SJames Feist 
9454cde5d90SJames Feist void invalidUpload(crow::Response& res, const std::string& arg1,
9464cde5d90SJames Feist                    const std::string& arg2);
9474cde5d90SJames Feist 
948dd28ba82SAppaRao Puli /**
949dd28ba82SAppaRao Puli  * @brief Formats MutualExclusiveProperties message into JSON
950dd28ba82SAppaRao Puli  * Message body: "The properties <arg1> and <arg2> are mutually exclusive."
951dd28ba82SAppaRao Puli  *
952dd28ba82SAppaRao Puli  * @param[in] arg1 Parameter of message that will replace %1 in its body.
953dd28ba82SAppaRao Puli  * @param[in] arg2 Parameter of message that will replace %2 in its body.
954dd28ba82SAppaRao Puli  *
955dd28ba82SAppaRao Puli  * @returns Message MutualExclusiveProperties formatted to JSON */
956dd28ba82SAppaRao Puli nlohmann::json mutualExclusiveProperties(const std::string& arg1,
957dd28ba82SAppaRao Puli                                          const std::string& arg2);
958dd28ba82SAppaRao Puli 
959dd28ba82SAppaRao Puli void mutualExclusiveProperties(crow::Response& res, const std::string& arg1,
960dd28ba82SAppaRao Puli                                const std::string& arg2);
961dd28ba82SAppaRao Puli 
962f4c4dcf4SKowalski, Kamil } // namespace messages
963f4c4dcf4SKowalski, Kamil 
964f4c4dcf4SKowalski, Kamil } // namespace redfish
965