xref: /openbmc/bmcweb/features/redfish/include/error_messages.hpp (revision 1668ce6d0d427088b7bb8ab7c2927763fb57c8c3)
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 
19ace85d60SEd Tanous #include <boost/url/urls.hpp>
201214b7e7SGunnar Mills #include <nlohmann/json.hpp>
21df5415fcSEd Tanous #include <source_location.hpp>
221214b7e7SGunnar Mills 
239ea15c35SEd Tanous #include <string>
249ea15c35SEd Tanous 
251abe55efSEd Tanous namespace redfish
261abe55efSEd Tanous {
27f4c4dcf4SKowalski, Kamil 
281abe55efSEd Tanous namespace messages
291abe55efSEd Tanous {
30f4c4dcf4SKowalski, Kamil 
3181856681SAsmitha Karunanithi constexpr const char* messageVersionPrefix = "Base.1.11.0.";
3255c7b7a2SEd Tanous constexpr const char* messageAnnotation = "@Message.ExtendedInfo";
33f4c4dcf4SKowalski, Kamil 
34f4c4dcf4SKowalski, Kamil /**
35f4c4dcf4SKowalski, Kamil  * @brief Formats ResourceInUse message into JSON
36f4c4dcf4SKowalski, Kamil  * Message body: "The change to the requested resource failed because the
37f4c4dcf4SKowalski, Kamil  * resource is in use or in transition."
38f4c4dcf4SKowalski, Kamil  *
39f4c4dcf4SKowalski, Kamil  *
40f4c4dcf4SKowalski, Kamil  * @returns Message ResourceInUse formatted to JSON */
4165176d39SEd Tanous nlohmann::json resourceInUse();
42b5c07418SJames Feist 
43f12894f8SJason M. Bills void resourceInUse(crow::Response& res);
44f4c4dcf4SKowalski, Kamil 
45f4c4dcf4SKowalski, Kamil /**
46f4c4dcf4SKowalski, Kamil  * @brief Formats MalformedJSON message into JSON
47f4c4dcf4SKowalski, Kamil  * Message body: "The request body submitted was malformed JSON and could not be
48f4c4dcf4SKowalski, Kamil  * parsed by the receiving service."
49f4c4dcf4SKowalski, Kamil  *
50f4c4dcf4SKowalski, Kamil  *
51f4c4dcf4SKowalski, Kamil  * @returns Message MalformedJSON formatted to JSON */
5265176d39SEd Tanous nlohmann::json malformedJSON();
53b5c07418SJames Feist 
54f12894f8SJason M. Bills void malformedJSON(crow::Response& res);
55f4c4dcf4SKowalski, Kamil 
56f4c4dcf4SKowalski, Kamil /**
57f4c4dcf4SKowalski, Kamil  * @brief Formats ResourceMissingAtURI message into JSON
5866ac2b8cSJason M. Bills  * Message body: "The resource at the URI <arg1> was not found."
59f4c4dcf4SKowalski, Kamil  *
60f4c4dcf4SKowalski, Kamil  * @param[in] arg1 Parameter of message that will replace %1 in its body.
61f4c4dcf4SKowalski, Kamil  *
62f4c4dcf4SKowalski, Kamil  * @returns Message ResourceMissingAtURI formatted to JSON */
63ace85d60SEd Tanous nlohmann::json resourceMissingAtURI(const boost::urls::url_view& arg1);
64b5c07418SJames Feist 
65ace85d60SEd Tanous void resourceMissingAtURI(crow::Response& res,
66ace85d60SEd Tanous                           const boost::urls::url_view& arg1);
67f4c4dcf4SKowalski, Kamil 
68f4c4dcf4SKowalski, Kamil /**
69f4c4dcf4SKowalski, Kamil  * @brief Formats ActionParameterValueFormatError message into JSON
7066ac2b8cSJason M. Bills  * Message body: "The value <arg1> for the parameter <arg2> in the action <arg3>
71f4c4dcf4SKowalski, Kamil  * is of a different format than the parameter can accept."
72f4c4dcf4SKowalski, Kamil  *
73f4c4dcf4SKowalski, Kamil  * @param[in] arg1 Parameter of message that will replace %1 in its body.
74f4c4dcf4SKowalski, Kamil  * @param[in] arg2 Parameter of message that will replace %2 in its body.
75f4c4dcf4SKowalski, Kamil  * @param[in] arg3 Parameter of message that will replace %3 in its body.
76f4c4dcf4SKowalski, Kamil  *
77f4c4dcf4SKowalski, Kamil  * @returns Message ActionParameterValueFormatError formatted to JSON */
78*1668ce6dSEd Tanous nlohmann::json actionParameterValueFormatError(std::string_view arg1,
79*1668ce6dSEd Tanous                                                std::string_view arg2,
80*1668ce6dSEd Tanous                                                std::string_view arg3);
81b5c07418SJames Feist 
82*1668ce6dSEd Tanous void actionParameterValueFormatError(crow::Response& res, std::string_view arg1,
83*1668ce6dSEd Tanous                                      std::string_view arg2,
84*1668ce6dSEd Tanous                                      std::string_view arg3);
85f4c4dcf4SKowalski, Kamil 
86f4c4dcf4SKowalski, Kamil /**
87f4c4dcf4SKowalski, Kamil  * @brief Formats InternalError message into JSON
88f4c4dcf4SKowalski, Kamil  * Message body: "The request failed due to an internal service error.  The
89f4c4dcf4SKowalski, Kamil  * service is still operational."
90f4c4dcf4SKowalski, Kamil  *
91f4c4dcf4SKowalski, Kamil  *
92f4c4dcf4SKowalski, Kamil  * @returns Message InternalError formatted to JSON */
9365176d39SEd Tanous nlohmann::json internalError();
94b5c07418SJames Feist 
959eb808c1SEd Tanous void internalError(crow::Response& res, bmcweb::source_location location =
96df5415fcSEd Tanous                                             bmcweb::source_location::current());
97f12894f8SJason M. Bills 
98f12894f8SJason M. Bills /**
99f4c4dcf4SKowalski, Kamil  * @brief Formats UnrecognizedRequestBody message into JSON
100f4c4dcf4SKowalski, Kamil  * Message body: "The service detected a malformed request body that it was
101f4c4dcf4SKowalski, Kamil  * unable to interpret."
102f4c4dcf4SKowalski, Kamil  *
103f4c4dcf4SKowalski, Kamil  *
104f4c4dcf4SKowalski, Kamil  * @returns Message UnrecognizedRequestBody formatted to JSON */
10565176d39SEd Tanous nlohmann::json unrecognizedRequestBody();
106b5c07418SJames Feist 
107f12894f8SJason M. Bills void unrecognizedRequestBody(crow::Response& res);
108f4c4dcf4SKowalski, Kamil 
109f4c4dcf4SKowalski, Kamil /**
110f4c4dcf4SKowalski, Kamil  * @brief Formats ResourceAtUriUnauthorized message into JSON
11166ac2b8cSJason M. Bills  * Message body: "While accessing the resource at <arg1>, the service received
11266ac2b8cSJason M. Bills  * an authorization error <arg2>."
113f4c4dcf4SKowalski, Kamil  *
114f4c4dcf4SKowalski, Kamil  * @param[in] arg1 Parameter of message that will replace %1 in its body.
115f4c4dcf4SKowalski, Kamil  * @param[in] arg2 Parameter of message that will replace %2 in its body.
116f4c4dcf4SKowalski, Kamil  *
117f4c4dcf4SKowalski, Kamil  * @returns Message ResourceAtUriUnauthorized formatted to JSON */
118ace85d60SEd Tanous nlohmann::json resourceAtUriUnauthorized(const boost::urls::url_view& arg1,
119*1668ce6dSEd Tanous                                          std::string_view arg2);
120b5c07418SJames Feist 
121ace85d60SEd Tanous void resourceAtUriUnauthorized(crow::Response& res,
122ace85d60SEd Tanous                                const boost::urls::url_view& arg1,
123*1668ce6dSEd Tanous                                std::string_view arg2);
124f4c4dcf4SKowalski, Kamil 
125f4c4dcf4SKowalski, Kamil /**
126f4c4dcf4SKowalski, Kamil  * @brief Formats ActionParameterUnknown message into JSON
12766ac2b8cSJason M. Bills  * Message body: "The action <arg1> was submitted with the invalid parameter
12866ac2b8cSJason M. Bills  * <arg2>."
129f4c4dcf4SKowalski, Kamil  *
130f4c4dcf4SKowalski, Kamil  * @param[in] arg1 Parameter of message that will replace %1 in its body.
131f4c4dcf4SKowalski, Kamil  * @param[in] arg2 Parameter of message that will replace %2 in its body.
132f4c4dcf4SKowalski, Kamil  *
133f4c4dcf4SKowalski, Kamil  * @returns Message ActionParameterUnknown formatted to JSON */
134*1668ce6dSEd Tanous nlohmann::json actionParameterUnknown(std::string_view arg1,
135*1668ce6dSEd Tanous                                       std::string_view arg2);
136b5c07418SJames Feist 
137*1668ce6dSEd Tanous void actionParameterUnknown(crow::Response& res, std::string_view arg1,
138*1668ce6dSEd Tanous                             std::string_view arg2);
139f4c4dcf4SKowalski, Kamil 
140f4c4dcf4SKowalski, Kamil /**
141f4c4dcf4SKowalski, Kamil  * @brief Formats ResourceCannotBeDeleted message into JSON
142f4c4dcf4SKowalski, Kamil  * Message body: "The delete request failed because the resource requested
143f4c4dcf4SKowalski, Kamil  * cannot be deleted."
144f4c4dcf4SKowalski, Kamil  *
145f4c4dcf4SKowalski, Kamil  *
146f4c4dcf4SKowalski, Kamil  * @returns Message ResourceCannotBeDeleted formatted to JSON */
14765176d39SEd Tanous nlohmann::json resourceCannotBeDeleted();
148b5c07418SJames Feist 
149f12894f8SJason M. Bills void resourceCannotBeDeleted(crow::Response& res);
150f4c4dcf4SKowalski, Kamil 
151f4c4dcf4SKowalski, Kamil /**
152f4c4dcf4SKowalski, Kamil  * @brief Formats PropertyDuplicate message into JSON
15366ac2b8cSJason M. Bills  * Message body: "The property <arg1> was duplicated in the request."
154f4c4dcf4SKowalski, Kamil  *
155f4c4dcf4SKowalski, Kamil  * @param[in] arg1 Parameter of message that will replace %1 in its body.
156f4c4dcf4SKowalski, Kamil  *
157f4c4dcf4SKowalski, Kamil  * @returns Message PropertyDuplicate formatted to JSON */
158*1668ce6dSEd Tanous nlohmann::json propertyDuplicate(std::string_view arg1);
159b5c07418SJames Feist 
160*1668ce6dSEd Tanous void propertyDuplicate(crow::Response& res, std::string_view arg1);
161f4c4dcf4SKowalski, Kamil 
162f4c4dcf4SKowalski, Kamil /**
163f4c4dcf4SKowalski, Kamil  * @brief Formats ServiceTemporarilyUnavailable message into JSON
16466ac2b8cSJason M. Bills  * Message body: "The service is temporarily unavailable.  Retry in <arg1>
165f4c4dcf4SKowalski, Kamil  * seconds."
166f4c4dcf4SKowalski, Kamil  *
167f4c4dcf4SKowalski, Kamil  * @param[in] arg1 Parameter of message that will replace %1 in its body.
168f4c4dcf4SKowalski, Kamil  *
169f4c4dcf4SKowalski, Kamil  * @returns Message ServiceTemporarilyUnavailable formatted to JSON */
170*1668ce6dSEd Tanous nlohmann::json serviceTemporarilyUnavailable(std::string_view arg1);
171b5c07418SJames Feist 
172*1668ce6dSEd Tanous void serviceTemporarilyUnavailable(crow::Response& res, std::string_view arg1);
173f4c4dcf4SKowalski, Kamil 
174f4c4dcf4SKowalski, Kamil /**
175f4c4dcf4SKowalski, Kamil  * @brief Formats ResourceAlreadyExists message into JSON
17666ac2b8cSJason M. Bills  * Message body: "The requested resource of type <arg1> with the property <arg2>
17766ac2b8cSJason M. Bills  * with the value <arg3> already exists."
178f4c4dcf4SKowalski, Kamil  *
179f4c4dcf4SKowalski, Kamil  * @param[in] arg1 Parameter of message that will replace %1 in its body.
180f4c4dcf4SKowalski, Kamil  * @param[in] arg2 Parameter of message that will replace %2 in its body.
181f4c4dcf4SKowalski, Kamil  * @param[in] arg3 Parameter of message that will replace %3 in its body.
182f4c4dcf4SKowalski, Kamil  *
183f4c4dcf4SKowalski, Kamil  * @returns Message ResourceAlreadyExists formatted to JSON */
184*1668ce6dSEd Tanous nlohmann::json resourceAlreadyExists(std::string_view arg1,
185*1668ce6dSEd Tanous                                      std::string_view arg2,
186*1668ce6dSEd Tanous                                      std::string_view arg3);
187b5c07418SJames Feist 
188*1668ce6dSEd Tanous void resourceAlreadyExists(crow::Response& res, std::string_view arg1,
189*1668ce6dSEd Tanous                            std::string_view arg2, std::string_view arg3);
190f4c4dcf4SKowalski, Kamil 
191f4c4dcf4SKowalski, Kamil /**
192f4c4dcf4SKowalski, Kamil  * @brief Formats AccountForSessionNoLongerExists message into JSON
193f4c4dcf4SKowalski, Kamil  * Message body: "The account for the current session has been removed, thus the
194f4c4dcf4SKowalski, Kamil  * current session has been removed as well."
195f4c4dcf4SKowalski, Kamil  *
196f4c4dcf4SKowalski, Kamil  *
197f4c4dcf4SKowalski, Kamil  * @returns Message AccountForSessionNoLongerExists formatted to JSON */
19865176d39SEd Tanous nlohmann::json accountForSessionNoLongerExists();
199b5c07418SJames Feist 
200f12894f8SJason M. Bills void accountForSessionNoLongerExists(crow::Response& res);
201f4c4dcf4SKowalski, Kamil 
202f4c4dcf4SKowalski, Kamil /**
203f4c4dcf4SKowalski, Kamil  * @brief Formats CreateFailedMissingReqProperties message into JSON
204f4c4dcf4SKowalski, Kamil  * Message body: "The create operation failed because the required property
20566ac2b8cSJason M. Bills  * <arg1> was missing from the request."
206f4c4dcf4SKowalski, Kamil  *
207f4c4dcf4SKowalski, Kamil  * @param[in] arg1 Parameter of message that will replace %1 in its body.
208f4c4dcf4SKowalski, Kamil  *
209f4c4dcf4SKowalski, Kamil  * @returns Message CreateFailedMissingReqProperties formatted to JSON */
210*1668ce6dSEd Tanous nlohmann::json createFailedMissingReqProperties(std::string_view arg1);
211b5c07418SJames Feist 
212f12894f8SJason M. Bills void createFailedMissingReqProperties(crow::Response& res,
213*1668ce6dSEd Tanous                                       std::string_view arg1);
214f4c4dcf4SKowalski, Kamil 
215f4c4dcf4SKowalski, Kamil /**
216f4c4dcf4SKowalski, Kamil  * @brief Formats PropertyValueFormatError message into JSON
21766ac2b8cSJason M. Bills  * Message body: "The value <arg1> for the property <arg2> is of a different
218f4c4dcf4SKowalski, Kamil  * format than the property can accept."
219f4c4dcf4SKowalski, Kamil  *
220f4c4dcf4SKowalski, Kamil  * @param[in] arg1 Parameter of message that will replace %1 in its body.
221f4c4dcf4SKowalski, Kamil  * @param[in] arg2 Parameter of message that will replace %2 in its body.
222f4c4dcf4SKowalski, Kamil  *
223f4c4dcf4SKowalski, Kamil  * @returns Message PropertyValueFormatError formatted to JSON */
224*1668ce6dSEd Tanous nlohmann::json propertyValueFormatError(std::string_view arg1,
225*1668ce6dSEd Tanous                                         std::string_view arg2);
226b5c07418SJames Feist 
227*1668ce6dSEd Tanous void propertyValueFormatError(crow::Response& res, std::string_view arg1,
228*1668ce6dSEd Tanous                               std::string_view arg2);
229f4c4dcf4SKowalski, Kamil 
230f4c4dcf4SKowalski, Kamil /**
231f4c4dcf4SKowalski, Kamil  * @brief Formats PropertyValueNotInList message into JSON
23266ac2b8cSJason M. Bills  * Message body: "The value <arg1> for the property <arg2> is not in the list of
233f4c4dcf4SKowalski, Kamil  * acceptable values."
234f4c4dcf4SKowalski, Kamil  *
235f4c4dcf4SKowalski, Kamil  * @param[in] arg1 Parameter of message that will replace %1 in its body.
236f4c4dcf4SKowalski, Kamil  * @param[in] arg2 Parameter of message that will replace %2 in its body.
237f4c4dcf4SKowalski, Kamil  *
238f4c4dcf4SKowalski, Kamil  * @returns Message PropertyValueNotInList formatted to JSON */
239*1668ce6dSEd Tanous nlohmann::json propertyValueNotInList(std::string_view arg1,
240*1668ce6dSEd Tanous                                       std::string_view arg2);
241b5c07418SJames Feist 
242*1668ce6dSEd Tanous void propertyValueNotInList(crow::Response& res, std::string_view arg1,
243*1668ce6dSEd Tanous                             std::string_view arg2);
244f4c4dcf4SKowalski, Kamil 
245f4c4dcf4SKowalski, Kamil /**
246f4c4dcf4SKowalski, Kamil  * @brief Formats ResourceAtUriInUnknownFormat message into JSON
24766ac2b8cSJason M. Bills  * Message body: "The resource at <arg1> is in a format not recognized by the
248f4c4dcf4SKowalski, Kamil  * service."
249f4c4dcf4SKowalski, Kamil  *
250f4c4dcf4SKowalski, Kamil  * @param[in] arg1 Parameter of message that will replace %1 in its body.
251f4c4dcf4SKowalski, Kamil  *
252f4c4dcf4SKowalski, Kamil  * @returns Message ResourceAtUriInUnknownFormat formatted to JSON */
253ace85d60SEd Tanous nlohmann::json resourceAtUriInUnknownFormat(const boost::urls::url_view& arg1);
254b5c07418SJames Feist 
255ace85d60SEd Tanous void resourceAtUriInUnknownFormat(crow::Response& res,
256ace85d60SEd Tanous                                   const boost::urls::url_view& arg1);
257f4c4dcf4SKowalski, Kamil 
258f4c4dcf4SKowalski, Kamil /**
25981856681SAsmitha Karunanithi  * @brief Formats ServiceDisabled message into JSON
26081856681SAsmitha Karunanithi  * Message body: "The operation failed because the service at <arg1> is disabled
26181856681SAsmitha Karunanithi  * and " cannot accept requests."
26281856681SAsmitha Karunanithi  *
26381856681SAsmitha Karunanithi  * @param[in] arg1 Parameter of message that will replace %1 in its body.
26481856681SAsmitha Karunanithi  *
26581856681SAsmitha Karunanithi  * @returns Message ServiceDisabled formatted to JSON */
266*1668ce6dSEd Tanous nlohmann::json serviceDisabled(std::string_view arg1);
26781856681SAsmitha Karunanithi 
268*1668ce6dSEd Tanous void serviceDisabled(crow::Response& res, std::string_view arg1);
26981856681SAsmitha Karunanithi 
27081856681SAsmitha Karunanithi /**
271f4c4dcf4SKowalski, Kamil  * @brief Formats ServiceInUnknownState message into JSON
272f4c4dcf4SKowalski, Kamil  * Message body: "The operation failed because the service is in an unknown
273f4c4dcf4SKowalski, Kamil  * state and can no longer take incoming requests."
274f4c4dcf4SKowalski, Kamil  *
275f4c4dcf4SKowalski, Kamil  *
276f4c4dcf4SKowalski, Kamil  * @returns Message ServiceInUnknownState formatted to JSON */
27765176d39SEd Tanous nlohmann::json serviceInUnknownState();
278b5c07418SJames Feist 
279f12894f8SJason M. Bills void serviceInUnknownState(crow::Response& res);
280f4c4dcf4SKowalski, Kamil 
281f4c4dcf4SKowalski, Kamil /**
282f4c4dcf4SKowalski, Kamil  * @brief Formats EventSubscriptionLimitExceeded message into JSON
283f4c4dcf4SKowalski, Kamil  * Message body: "The event subscription failed due to the number of
284f4c4dcf4SKowalski, Kamil  * simultaneous subscriptions exceeding the limit of the implementation."
285f4c4dcf4SKowalski, Kamil  *
286f4c4dcf4SKowalski, Kamil  *
287f4c4dcf4SKowalski, Kamil  * @returns Message EventSubscriptionLimitExceeded formatted to JSON */
28865176d39SEd Tanous nlohmann::json eventSubscriptionLimitExceeded();
289b5c07418SJames Feist 
290f12894f8SJason M. Bills void eventSubscriptionLimitExceeded(crow::Response& res);
291f4c4dcf4SKowalski, Kamil 
292f4c4dcf4SKowalski, Kamil /**
293f4c4dcf4SKowalski, Kamil  * @brief Formats ActionParameterMissing message into JSON
29466ac2b8cSJason M. Bills  * Message body: "The action <arg1> requires the parameter <arg2> to be present
295f4c4dcf4SKowalski, Kamil  * in the request body."
296f4c4dcf4SKowalski, Kamil  *
297f4c4dcf4SKowalski, Kamil  * @param[in] arg1 Parameter of message that will replace %1 in its body.
298f4c4dcf4SKowalski, Kamil  * @param[in] arg2 Parameter of message that will replace %2 in its body.
299f4c4dcf4SKowalski, Kamil  *
300f4c4dcf4SKowalski, Kamil  * @returns Message ActionParameterMissing formatted to JSON */
301*1668ce6dSEd Tanous nlohmann::json actionParameterMissing(std::string_view arg1,
302*1668ce6dSEd Tanous                                       std::string_view arg2);
303b5c07418SJames Feist 
304*1668ce6dSEd Tanous void actionParameterMissing(crow::Response& res, std::string_view arg1,
305*1668ce6dSEd Tanous                             std::string_view arg2);
306f4c4dcf4SKowalski, Kamil 
307f4c4dcf4SKowalski, Kamil /**
308f4c4dcf4SKowalski, Kamil  * @brief Formats StringValueTooLong message into JSON
30966ac2b8cSJason M. Bills  * Message body: "The string <arg1> exceeds the length limit <arg2>."
310f4c4dcf4SKowalski, Kamil  *
311f4c4dcf4SKowalski, Kamil  * @param[in] arg1 Parameter of message that will replace %1 in its body.
312f4c4dcf4SKowalski, Kamil  * @param[in] arg2 Parameter of message that will replace %2 in its body.
313f4c4dcf4SKowalski, Kamil  *
314f4c4dcf4SKowalski, Kamil  * @returns Message StringValueTooLong formatted to JSON */
315*1668ce6dSEd Tanous nlohmann::json stringValueTooLong(std::string_view arg1, int arg2);
316b5c07418SJames Feist 
317*1668ce6dSEd Tanous void stringValueTooLong(crow::Response& res, std::string_view arg1, int arg2);
318f4c4dcf4SKowalski, Kamil 
319f4c4dcf4SKowalski, Kamil /**
320cc9139ecSJason M. Bills  * @brief Formats SessionTerminated message into JSON
321cc9139ecSJason M. Bills  * Message body: "The session was successfully terminated."
322cc9139ecSJason M. Bills  *
323cc9139ecSJason M. Bills  *
324cc9139ecSJason M. Bills  * @returns Message SessionTerminated formatted to JSON */
32565176d39SEd Tanous nlohmann::json sessionTerminated();
326b5c07418SJames Feist 
327cc9139ecSJason M. Bills void sessionTerminated(crow::Response& res);
328cc9139ecSJason M. Bills 
329cc9139ecSJason M. Bills /**
330684bb4b8SJason M. Bills  * @brief Formats SubscriptionTerminated message into JSON
331684bb4b8SJason M. Bills  * Message body: "The event subscription has been terminated."
332684bb4b8SJason M. Bills  *
333684bb4b8SJason M. Bills  *
334684bb4b8SJason M. Bills  * @returns Message SubscriptionTerminated formatted to JSON */
33565176d39SEd Tanous nlohmann::json subscriptionTerminated();
336684bb4b8SJason M. Bills 
337684bb4b8SJason M. Bills void subscriptionTerminated(crow::Response& res);
338684bb4b8SJason M. Bills 
339684bb4b8SJason M. Bills /**
340cc9139ecSJason M. Bills  * @brief Formats ResourceTypeIncompatible message into JSON
341cc9139ecSJason M. Bills  * Message body: "The @odata.type of the request body <arg1> is incompatible
342cc9139ecSJason M. Bills  * with the @odata.type of the resource which is <arg2>."
343cc9139ecSJason M. Bills  *
344cc9139ecSJason M. Bills  * @param[in] arg1 Parameter of message that will replace %1 in its body.
345cc9139ecSJason M. Bills  * @param[in] arg2 Parameter of message that will replace %2 in its body.
346cc9139ecSJason M. Bills  *
347cc9139ecSJason M. Bills  * @returns Message ResourceTypeIncompatible formatted to JSON */
348*1668ce6dSEd Tanous nlohmann::json resourceTypeIncompatible(std::string_view arg1,
349*1668ce6dSEd Tanous                                         std::string_view arg2);
350b5c07418SJames Feist 
351*1668ce6dSEd Tanous void resourceTypeIncompatible(crow::Response& res, std::string_view arg1,
352*1668ce6dSEd Tanous                               std::string_view arg2);
353cc9139ecSJason M. Bills 
354cc9139ecSJason M. Bills /**
355684bb4b8SJason M. Bills  * @brief Formats ResetRequired message into JSON
356684bb4b8SJason M. Bills  * Message body: "In order to complete the operation, a component reset is
357684bb4b8SJason M. Bills  * required with the Reset action URI '<arg1>' and ResetType '<arg2>'."
358684bb4b8SJason M. Bills  *
359684bb4b8SJason M. Bills  * @param[in] arg1 Parameter of message that will replace %1 in its body.
360684bb4b8SJason M. Bills  * @param[in] arg2 Parameter of message that will replace %2 in its body.
361684bb4b8SJason M. Bills  *
362684bb4b8SJason M. Bills  * @returns Message ResetRequired formatted to JSON */
363ace85d60SEd Tanous nlohmann::json resetRequired(const boost::urls::url_view& arg1,
364*1668ce6dSEd Tanous                              std::string_view arg2);
365684bb4b8SJason M. Bills 
366ace85d60SEd Tanous void resetRequired(crow::Response& res, const boost::urls::url_view& arg1,
367*1668ce6dSEd Tanous                    std::string_view arg2);
368684bb4b8SJason M. Bills 
369684bb4b8SJason M. Bills /**
370684bb4b8SJason M. Bills  * @brief Formats ChassisPowerStateOnRequired message into JSON
371684bb4b8SJason M. Bills  * Message body: "The Chassis with Id '<arg1>' requires to be powered on to
372684bb4b8SJason M. Bills  * perform this request."
373684bb4b8SJason M. Bills  *
374684bb4b8SJason M. Bills  * @param[in] arg1 Parameter of message that will replace %1 in its body.
375684bb4b8SJason M. Bills  *
376684bb4b8SJason M. Bills  * @returns Message ChassisPowerStateOnRequired formatted to JSON */
377*1668ce6dSEd Tanous nlohmann::json chassisPowerStateOnRequired(std::string_view arg1);
378684bb4b8SJason M. Bills 
379*1668ce6dSEd Tanous void chassisPowerStateOnRequired(crow::Response& res, std::string_view arg1);
380684bb4b8SJason M. Bills 
381684bb4b8SJason M. Bills /**
382684bb4b8SJason M. Bills  * @brief Formats ChassisPowerStateOffRequired message into JSON
383684bb4b8SJason M. Bills  * Message body: "The Chassis with Id '<arg1>' requires to be powered off to
384684bb4b8SJason M. Bills  * perform this request."
385684bb4b8SJason M. Bills  *
386684bb4b8SJason M. Bills  * @param[in] arg1 Parameter of message that will replace %1 in its body.
387684bb4b8SJason M. Bills  *
388684bb4b8SJason M. Bills  * @returns Message ChassisPowerStateOffRequired formatted to JSON */
389*1668ce6dSEd Tanous nlohmann::json chassisPowerStateOffRequired(std::string_view arg1);
390684bb4b8SJason M. Bills 
391*1668ce6dSEd Tanous void chassisPowerStateOffRequired(crow::Response& res, std::string_view arg1);
392684bb4b8SJason M. Bills 
393684bb4b8SJason M. Bills /**
394684bb4b8SJason M. Bills  * @brief Formats PropertyValueConflict message into JSON
395684bb4b8SJason M. Bills  * Message body: "The property '<arg1>' could not be written because its value
396684bb4b8SJason M. Bills  * would conflict with the value of the '<arg2>' property."
397684bb4b8SJason M. Bills  *
398684bb4b8SJason M. Bills  * @param[in] arg1 Parameter of message that will replace %1 in its body.
399684bb4b8SJason M. Bills  * @param[in] arg2 Parameter of message that will replace %2 in its body.
400684bb4b8SJason M. Bills  *
401684bb4b8SJason M. Bills  * @returns Message PropertyValueConflict formatted to JSON */
402*1668ce6dSEd Tanous nlohmann::json propertyValueConflict(std::string_view arg1,
403*1668ce6dSEd Tanous                                      std::string_view arg2);
404684bb4b8SJason M. Bills 
405*1668ce6dSEd Tanous void propertyValueConflict(crow::Response& res, std::string_view arg1,
406*1668ce6dSEd Tanous                            std::string_view arg2);
407684bb4b8SJason M. Bills 
408684bb4b8SJason M. Bills /**
409684bb4b8SJason M. Bills  * @brief Formats PropertyValueIncorrect message into JSON
410684bb4b8SJason M. Bills  * Message body: "The property '<arg1>' with the requested value of '<arg2>'
411684bb4b8SJason M. Bills  * could not be written because the value does not meet the constraints of the
412684bb4b8SJason M. Bills  * implementation."
413684bb4b8SJason M. Bills  *
414684bb4b8SJason M. Bills  * @param[in] arg1 Parameter of message that will replace %1 in its body.
415684bb4b8SJason M. Bills  * @param[in] arg2 Parameter of message that will replace %2 in its body.
416684bb4b8SJason M. Bills  *
417684bb4b8SJason M. Bills  * @returns Message PropertyValueIncorrect formatted to JSON */
418*1668ce6dSEd Tanous nlohmann::json propertyValueIncorrect(std::string_view arg1,
419*1668ce6dSEd Tanous                                       std::string_view arg2);
420684bb4b8SJason M. Bills 
421*1668ce6dSEd Tanous void propertyValueIncorrect(crow::Response& res, std::string_view arg1,
422*1668ce6dSEd Tanous                             std::string_view arg2);
423684bb4b8SJason M. Bills 
424684bb4b8SJason M. Bills /**
425684bb4b8SJason M. Bills  * @brief Formats ResourceCreationConflict message into JSON
426684bb4b8SJason M. Bills  * Message body: "The resource could not be created.  The service has a resource
427684bb4b8SJason M. Bills  * at URI '<arg1>' that conflicts with the creation request."
428684bb4b8SJason M. Bills  *
429684bb4b8SJason M. Bills  * @param[in] arg1 Parameter of message that will replace %1 in its body.
430684bb4b8SJason M. Bills  *
431684bb4b8SJason M. Bills  * @returns Message ResourceCreationConflict formatted to JSON */
432*1668ce6dSEd Tanous nlohmann::json resourceCreationConflict(std::string_view arg1);
433684bb4b8SJason M. Bills 
434*1668ce6dSEd Tanous void resourceCreationConflict(crow::Response& res, std::string_view arg1);
435684bb4b8SJason M. Bills 
436684bb4b8SJason M. Bills /**
437684bb4b8SJason M. Bills  * @brief Formats MaximumErrorsExceeded message into JSON
438684bb4b8SJason M. Bills  * Message body: "Too many errors have occurred to report them all."
439684bb4b8SJason M. Bills  *
440684bb4b8SJason M. Bills  *
441684bb4b8SJason M. Bills  * @returns Message MaximumErrorsExceeded formatted to JSON */
44265176d39SEd Tanous nlohmann::json maximumErrorsExceeded();
443684bb4b8SJason M. Bills 
444684bb4b8SJason M. Bills void maximumErrorsExceeded(crow::Response& res);
445684bb4b8SJason M. Bills 
446684bb4b8SJason M. Bills /**
447684bb4b8SJason M. Bills  * @brief Formats PreconditionFailed message into JSON
448684bb4b8SJason M. Bills  * Message body: "The ETag supplied did not match the ETag required to change
449684bb4b8SJason M. Bills  * this resource."
450684bb4b8SJason M. Bills  *
451684bb4b8SJason M. Bills  *
452684bb4b8SJason M. Bills  * @returns Message PreconditionFailed formatted to JSON */
45365176d39SEd Tanous nlohmann::json preconditionFailed();
454684bb4b8SJason M. Bills 
455684bb4b8SJason M. Bills void preconditionFailed(crow::Response& res);
456684bb4b8SJason M. Bills 
457684bb4b8SJason M. Bills /**
458684bb4b8SJason M. Bills  * @brief Formats PreconditionRequired message into JSON
459684bb4b8SJason M. Bills  * Message body: "A precondition header or annotation is required to change this
460684bb4b8SJason M. Bills  * resource."
461684bb4b8SJason M. Bills  *
462684bb4b8SJason M. Bills  *
463684bb4b8SJason M. Bills  * @returns Message PreconditionRequired formatted to JSON */
46465176d39SEd Tanous nlohmann::json preconditionRequired();
465684bb4b8SJason M. Bills 
466684bb4b8SJason M. Bills void preconditionRequired(crow::Response& res);
467684bb4b8SJason M. Bills 
468684bb4b8SJason M. Bills /**
469684bb4b8SJason M. Bills  * @brief Formats OperationFailed message into JSON
470684bb4b8SJason M. Bills  * Message body: "An error occurred internal to the service as part of the
471684bb4b8SJason M. Bills  * overall request.  Partial results may have been returned."
472684bb4b8SJason M. Bills  *
473684bb4b8SJason M. Bills  *
474684bb4b8SJason M. Bills  * @returns Message OperationFailed formatted to JSON */
47565176d39SEd Tanous nlohmann::json operationFailed();
476684bb4b8SJason M. Bills 
477684bb4b8SJason M. Bills void operationFailed(crow::Response& res);
478684bb4b8SJason M. Bills 
479684bb4b8SJason M. Bills /**
480684bb4b8SJason M. Bills  * @brief Formats OperationTimeout message into JSON
481684bb4b8SJason M. Bills  * Message body: "A timeout internal to the service occured as part of the
482684bb4b8SJason M. Bills  * request.  Partial results may have been returned."
483684bb4b8SJason M. Bills  *
484684bb4b8SJason M. Bills  *
485684bb4b8SJason M. Bills  * @returns Message OperationTimeout formatted to JSON */
48665176d39SEd Tanous nlohmann::json operationTimeout();
487684bb4b8SJason M. Bills 
488684bb4b8SJason M. Bills void operationTimeout(crow::Response& res);
489684bb4b8SJason M. Bills 
490684bb4b8SJason M. Bills /**
491f4c4dcf4SKowalski, Kamil  * @brief Formats PropertyValueTypeError message into JSON
49266ac2b8cSJason M. Bills  * Message body: "The value <arg1> for the property <arg2> is of a different
493f4c4dcf4SKowalski, Kamil  * type than the property can accept."
494f4c4dcf4SKowalski, Kamil  *
495f4c4dcf4SKowalski, Kamil  * @param[in] arg1 Parameter of message that will replace %1 in its body.
496f4c4dcf4SKowalski, Kamil  * @param[in] arg2 Parameter of message that will replace %2 in its body.
497f4c4dcf4SKowalski, Kamil  *
498f4c4dcf4SKowalski, Kamil  * @returns Message PropertyValueTypeError formatted to JSON */
499*1668ce6dSEd Tanous nlohmann::json propertyValueTypeError(std::string_view arg1,
500*1668ce6dSEd Tanous                                       std::string_view arg2);
501b5c07418SJames Feist 
502*1668ce6dSEd Tanous void propertyValueTypeError(crow::Response& res, std::string_view arg1,
503*1668ce6dSEd Tanous                             std::string_view arg2);
504f4c4dcf4SKowalski, Kamil 
505f4c4dcf4SKowalski, Kamil /**
506f4c4dcf4SKowalski, Kamil  * @brief Formats ResourceNotFound message into JSON
50766ac2b8cSJason M. Bills  * Message body: "The requested resource of type <arg1> named <arg2> was not
508f4c4dcf4SKowalski, Kamil  * found."
509f4c4dcf4SKowalski, Kamil  *
510f4c4dcf4SKowalski, Kamil  * @param[in] arg1 Parameter of message that will replace %1 in its body.
511f4c4dcf4SKowalski, Kamil  * @param[in] arg2 Parameter of message that will replace %2 in its body.
512f4c4dcf4SKowalski, Kamil  *
513f4c4dcf4SKowalski, Kamil  * @returns Message ResourceNotFound formatted to JSON */
514*1668ce6dSEd Tanous nlohmann::json resourceNotFound(std::string_view arg1, std::string_view arg2);
515b5c07418SJames Feist 
516*1668ce6dSEd Tanous void resourceNotFound(crow::Response& res, std::string_view arg1,
517*1668ce6dSEd Tanous                       std::string_view arg2);
518f4c4dcf4SKowalski, Kamil 
519f4c4dcf4SKowalski, Kamil /**
520f4c4dcf4SKowalski, Kamil  * @brief Formats CouldNotEstablishConnection message into JSON
52155c7b7a2SEd Tanous  * Message body: "The service failed to establish a Connection with the URI
52266ac2b8cSJason M. Bills  * <arg1>."
523f4c4dcf4SKowalski, Kamil  *
524f4c4dcf4SKowalski, Kamil  * @param[in] arg1 Parameter of message that will replace %1 in its body.
525f4c4dcf4SKowalski, Kamil  *
526f4c4dcf4SKowalski, Kamil  * @returns Message CouldNotEstablishConnection formatted to JSON */
527ace85d60SEd Tanous nlohmann::json couldNotEstablishConnection(const boost::urls::url_view& arg1);
528b5c07418SJames Feist 
529ace85d60SEd Tanous void couldNotEstablishConnection(crow::Response& res,
530ace85d60SEd Tanous                                  const boost::urls::url_view& arg1);
531f4c4dcf4SKowalski, Kamil 
532f4c4dcf4SKowalski, Kamil /**
533f4c4dcf4SKowalski, Kamil  * @brief Formats PropertyNotWritable message into JSON
53466ac2b8cSJason M. Bills  * Message body: "The property <arg1> is a read only property and cannot be
535f4c4dcf4SKowalski, Kamil  * assigned a value."
536f4c4dcf4SKowalski, Kamil  *
537f4c4dcf4SKowalski, Kamil  * @param[in] arg1 Parameter of message that will replace %1 in its body.
538f4c4dcf4SKowalski, Kamil  *
539f4c4dcf4SKowalski, Kamil  * @returns Message PropertyNotWritable formatted to JSON */
540*1668ce6dSEd Tanous nlohmann::json propertyNotWritable(std::string_view arg1);
541b5c07418SJames Feist 
542*1668ce6dSEd Tanous void propertyNotWritable(crow::Response& res, std::string_view arg1);
543f12894f8SJason M. Bills 
544f12894f8SJason M. Bills /**
545f4c4dcf4SKowalski, Kamil  * @brief Formats QueryParameterValueTypeError message into JSON
54666ac2b8cSJason M. Bills  * Message body: "The value <arg1> for the query parameter <arg2> is of a
547f4c4dcf4SKowalski, Kamil  * different type than the parameter can accept."
548f4c4dcf4SKowalski, Kamil  *
549f4c4dcf4SKowalski, Kamil  * @param[in] arg1 Parameter of message that will replace %1 in its body.
550f4c4dcf4SKowalski, Kamil  * @param[in] arg2 Parameter of message that will replace %2 in its body.
551f4c4dcf4SKowalski, Kamil  *
552f4c4dcf4SKowalski, Kamil  * @returns Message QueryParameterValueTypeError formatted to JSON */
553*1668ce6dSEd Tanous nlohmann::json queryParameterValueTypeError(std::string_view arg1,
554*1668ce6dSEd Tanous                                             std::string_view arg2);
555b5c07418SJames Feist 
556*1668ce6dSEd Tanous void queryParameterValueTypeError(crow::Response& res, std::string_view arg1,
557*1668ce6dSEd Tanous                                   std::string_view arg2);
558f4c4dcf4SKowalski, Kamil 
559f4c4dcf4SKowalski, Kamil /**
560f4c4dcf4SKowalski, Kamil  * @brief Formats ServiceShuttingDown message into JSON
561f4c4dcf4SKowalski, Kamil  * Message body: "The operation failed because the service is shutting down and
562f4c4dcf4SKowalski, Kamil  * can no longer take incoming requests."
563f4c4dcf4SKowalski, Kamil  *
564f4c4dcf4SKowalski, Kamil  *
565f4c4dcf4SKowalski, Kamil  * @returns Message ServiceShuttingDown formatted to JSON */
56665176d39SEd Tanous nlohmann::json serviceShuttingDown();
567b5c07418SJames Feist 
568f12894f8SJason M. Bills void serviceShuttingDown(crow::Response& res);
569f4c4dcf4SKowalski, Kamil 
570f4c4dcf4SKowalski, Kamil /**
571f4c4dcf4SKowalski, Kamil  * @brief Formats ActionParameterDuplicate message into JSON
57266ac2b8cSJason M. Bills  * Message body: "The action <arg1> was submitted with more than one value for
57366ac2b8cSJason M. Bills  * the parameter <arg2>."
574f4c4dcf4SKowalski, Kamil  *
575f4c4dcf4SKowalski, Kamil  * @param[in] arg1 Parameter of message that will replace %1 in its body.
576f4c4dcf4SKowalski, Kamil  * @param[in] arg2 Parameter of message that will replace %2 in its body.
577f4c4dcf4SKowalski, Kamil  *
578f4c4dcf4SKowalski, Kamil  * @returns Message ActionParameterDuplicate formatted to JSON */
579*1668ce6dSEd Tanous nlohmann::json actionParameterDuplicate(std::string_view arg1,
580*1668ce6dSEd Tanous                                         std::string_view arg2);
581b5c07418SJames Feist 
582*1668ce6dSEd Tanous void actionParameterDuplicate(crow::Response& res, std::string_view arg1,
583*1668ce6dSEd Tanous                               std::string_view arg2);
584f4c4dcf4SKowalski, Kamil 
585f4c4dcf4SKowalski, Kamil /**
586f4c4dcf4SKowalski, Kamil  * @brief Formats ActionParameterNotSupported message into JSON
58766ac2b8cSJason M. Bills  * Message body: "The parameter <arg1> for the action <arg2> is not supported on
588f4c4dcf4SKowalski, Kamil  * the target resource."
589f4c4dcf4SKowalski, Kamil  *
590f4c4dcf4SKowalski, Kamil  * @param[in] arg1 Parameter of message that will replace %1 in its body.
591f4c4dcf4SKowalski, Kamil  * @param[in] arg2 Parameter of message that will replace %2 in its body.
592f4c4dcf4SKowalski, Kamil  *
593f4c4dcf4SKowalski, Kamil  * @returns Message ActionParameterNotSupported formatted to JSON */
594*1668ce6dSEd Tanous nlohmann::json actionParameterNotSupported(std::string_view arg1,
595*1668ce6dSEd Tanous                                            std::string_view arg2);
596b5c07418SJames Feist 
597*1668ce6dSEd Tanous void actionParameterNotSupported(crow::Response& res, std::string_view arg1,
598*1668ce6dSEd Tanous                                  std::string_view arg2);
599f4c4dcf4SKowalski, Kamil 
600f4c4dcf4SKowalski, Kamil /**
601f4c4dcf4SKowalski, Kamil  * @brief Formats SourceDoesNotSupportProtocol message into JSON
60266ac2b8cSJason M. Bills  * Message body: "The other end of the Connection at <arg1> does not support the
60366ac2b8cSJason M. Bills  * specified protocol <arg2>."
604f4c4dcf4SKowalski, Kamil  *
605f4c4dcf4SKowalski, Kamil  * @param[in] arg1 Parameter of message that will replace %1 in its body.
606f4c4dcf4SKowalski, Kamil  * @param[in] arg2 Parameter of message that will replace %2 in its body.
607f4c4dcf4SKowalski, Kamil  *
608f4c4dcf4SKowalski, Kamil  * @returns Message SourceDoesNotSupportProtocol formatted to JSON */
609ace85d60SEd Tanous nlohmann::json sourceDoesNotSupportProtocol(const boost::urls::url_view& arg1,
610*1668ce6dSEd Tanous                                             std::string_view arg2);
611b5c07418SJames Feist 
612ace85d60SEd Tanous void sourceDoesNotSupportProtocol(crow::Response& res,
613ace85d60SEd Tanous                                   const boost::urls::url_view& arg1,
614*1668ce6dSEd Tanous                                   std::string_view arg2);
615f4c4dcf4SKowalski, Kamil 
616f4c4dcf4SKowalski, Kamil /**
617f4c4dcf4SKowalski, Kamil  * @brief Formats AccountRemoved message into JSON
618f4c4dcf4SKowalski, Kamil  * Message body: "The account was successfully removed."
619f4c4dcf4SKowalski, Kamil  *
620f4c4dcf4SKowalski, Kamil  *
621f4c4dcf4SKowalski, Kamil  * @returns Message AccountRemoved formatted to JSON */
62265176d39SEd Tanous nlohmann::json accountRemoved();
623b5c07418SJames Feist 
624f12894f8SJason M. Bills void accountRemoved(crow::Response& res);
625f4c4dcf4SKowalski, Kamil 
626f4c4dcf4SKowalski, Kamil /**
627f4c4dcf4SKowalski, Kamil  * @brief Formats AccessDenied message into JSON
62866ac2b8cSJason M. Bills  * Message body: "While attempting to establish a Connection to <arg1>, the
629f4c4dcf4SKowalski, Kamil  * service denied access."
630f4c4dcf4SKowalski, Kamil  *
631f4c4dcf4SKowalski, Kamil  * @param[in] arg1 Parameter of message that will replace %1 in its body.
632f4c4dcf4SKowalski, Kamil  *
633f4c4dcf4SKowalski, Kamil  * @returns Message AccessDenied formatted to JSON */
634*1668ce6dSEd Tanous nlohmann::json accessDenied(std::string_view arg1);
635b5c07418SJames Feist 
636*1668ce6dSEd Tanous void accessDenied(crow::Response& res, std::string_view arg1);
637f4c4dcf4SKowalski, Kamil 
638f4c4dcf4SKowalski, Kamil /**
639f4c4dcf4SKowalski, Kamil  * @brief Formats QueryNotSupported message into JSON
640f4c4dcf4SKowalski, Kamil  * Message body: "Querying is not supported by the implementation."
641f4c4dcf4SKowalski, Kamil  *
642f4c4dcf4SKowalski, Kamil  *
643f4c4dcf4SKowalski, Kamil  * @returns Message QueryNotSupported formatted to JSON */
64465176d39SEd Tanous nlohmann::json queryNotSupported();
645b5c07418SJames Feist 
646f12894f8SJason M. Bills void queryNotSupported(crow::Response& res);
647f4c4dcf4SKowalski, Kamil 
648f4c4dcf4SKowalski, Kamil /**
649f4c4dcf4SKowalski, Kamil  * @brief Formats CreateLimitReachedForResource message into JSON
650f4c4dcf4SKowalski, Kamil  * Message body: "The create operation failed because the resource has reached
651f4c4dcf4SKowalski, Kamil  * the limit of possible resources."
652f4c4dcf4SKowalski, Kamil  *
653f4c4dcf4SKowalski, Kamil  *
654f4c4dcf4SKowalski, Kamil  * @returns Message CreateLimitReachedForResource formatted to JSON */
65565176d39SEd Tanous nlohmann::json createLimitReachedForResource();
656b5c07418SJames Feist 
657f12894f8SJason M. Bills void createLimitReachedForResource(crow::Response& res);
658f4c4dcf4SKowalski, Kamil 
659f4c4dcf4SKowalski, Kamil /**
660f4c4dcf4SKowalski, Kamil  * @brief Formats GeneralError message into JSON
661f4c4dcf4SKowalski, Kamil  * Message body: "A general error has occurred. See ExtendedInfo for more
662f4c4dcf4SKowalski, Kamil  * information."
663f4c4dcf4SKowalski, Kamil  *
664f4c4dcf4SKowalski, Kamil  *
665f4c4dcf4SKowalski, Kamil  * @returns Message GeneralError formatted to JSON */
66665176d39SEd Tanous nlohmann::json generalError();
667b5c07418SJames Feist 
668f12894f8SJason M. Bills void generalError(crow::Response& res);
669f4c4dcf4SKowalski, Kamil 
670f4c4dcf4SKowalski, Kamil /**
671f4c4dcf4SKowalski, Kamil  * @brief Formats Success message into JSON
672f4c4dcf4SKowalski, Kamil  * Message body: "Successfully Completed Request"
673f4c4dcf4SKowalski, Kamil  *
674f4c4dcf4SKowalski, Kamil  *
675f4c4dcf4SKowalski, Kamil  * @returns Message Success formatted to JSON */
67665176d39SEd Tanous nlohmann::json success();
677b5c07418SJames Feist 
678f12894f8SJason M. Bills void success(crow::Response& res);
679f12894f8SJason M. Bills 
680f12894f8SJason M. Bills /**
681f4c4dcf4SKowalski, Kamil  * @brief Formats Created message into JSON
682f4c4dcf4SKowalski, Kamil  * Message body: "The resource has been created successfully"
683f4c4dcf4SKowalski, Kamil  *
684f4c4dcf4SKowalski, Kamil  *
685f4c4dcf4SKowalski, Kamil  * @returns Message Created formatted to JSON */
68665176d39SEd Tanous nlohmann::json created();
687b5c07418SJames Feist 
688f12894f8SJason M. Bills void created(crow::Response& res);
689f4c4dcf4SKowalski, Kamil 
690f4c4dcf4SKowalski, Kamil /**
691cc9139ecSJason M. Bills  * @brief Formats NoOperation message into JSON
692cc9139ecSJason M. Bills  * Message body: "The request body submitted contain no data to act upon and
693cc9139ecSJason M. Bills  * no changes to the resource took place."
694cc9139ecSJason M. Bills  *
695cc9139ecSJason M. Bills  *
696cc9139ecSJason M. Bills  * @returns Message NoOperation formatted to JSON */
69765176d39SEd Tanous nlohmann::json noOperation();
698b5c07418SJames Feist 
699cc9139ecSJason M. Bills void noOperation(crow::Response& res);
700cc9139ecSJason M. Bills 
701cc9139ecSJason M. Bills /**
702f4c4dcf4SKowalski, Kamil  * @brief Formats PropertyUnknown message into JSON
70366ac2b8cSJason M. Bills  * Message body: "The property <arg1> is not in the list of valid properties for
704f4c4dcf4SKowalski, Kamil  * the resource."
705f4c4dcf4SKowalski, Kamil  *
706f4c4dcf4SKowalski, Kamil  * @param[in] arg1 Parameter of message that will replace %1 in its body.
707f4c4dcf4SKowalski, Kamil  *
708f4c4dcf4SKowalski, Kamil  * @returns Message PropertyUnknown formatted to JSON */
709*1668ce6dSEd Tanous nlohmann::json propertyUnknown(std::string_view arg1);
710b5c07418SJames Feist 
711*1668ce6dSEd Tanous void propertyUnknown(crow::Response& res, std::string_view arg1);
712f12894f8SJason M. Bills 
713f12894f8SJason M. Bills /**
714f4c4dcf4SKowalski, Kamil  * @brief Formats NoValidSession message into JSON
715f4c4dcf4SKowalski, Kamil  * Message body: "There is no valid session established with the
716f4c4dcf4SKowalski, Kamil  * implementation."
717f4c4dcf4SKowalski, Kamil  *
718f4c4dcf4SKowalski, Kamil  *
719f4c4dcf4SKowalski, Kamil  * @returns Message NoValidSession formatted to JSON */
72065176d39SEd Tanous nlohmann::json noValidSession();
721b5c07418SJames Feist 
722f12894f8SJason M. Bills void noValidSession(crow::Response& res);
723f4c4dcf4SKowalski, Kamil 
724f4c4dcf4SKowalski, Kamil /**
725f4c4dcf4SKowalski, Kamil  * @brief Formats InvalidObject message into JSON
72666ac2b8cSJason M. Bills  * Message body: "The object at <arg1> is invalid."
727f4c4dcf4SKowalski, Kamil  *
728f4c4dcf4SKowalski, Kamil  * @param[in] arg1 Parameter of message that will replace %1 in its body.
729f4c4dcf4SKowalski, Kamil  *
730f4c4dcf4SKowalski, Kamil  * @returns Message InvalidObject formatted to JSON */
731ace85d60SEd Tanous nlohmann::json invalidObject(const boost::urls::url_view& arg1);
732b5c07418SJames Feist 
733ace85d60SEd Tanous void invalidObject(crow::Response& res, const boost::urls::url_view& arg1);
734f4c4dcf4SKowalski, Kamil 
735f4c4dcf4SKowalski, Kamil /**
736f4c4dcf4SKowalski, Kamil  * @brief Formats ResourceInStandby message into JSON
737f4c4dcf4SKowalski, Kamil  * Message body: "The request could not be performed because the resource is in
738f4c4dcf4SKowalski, Kamil  * standby."
739f4c4dcf4SKowalski, Kamil  *
740f4c4dcf4SKowalski, Kamil  *
741f4c4dcf4SKowalski, Kamil  * @returns Message ResourceInStandby formatted to JSON */
74265176d39SEd Tanous nlohmann::json resourceInStandby();
743b5c07418SJames Feist 
744f12894f8SJason M. Bills void resourceInStandby(crow::Response& res);
745f4c4dcf4SKowalski, Kamil 
746f4c4dcf4SKowalski, Kamil /**
747f4c4dcf4SKowalski, Kamil  * @brief Formats ActionParameterValueTypeError message into JSON
74866ac2b8cSJason M. Bills  * Message body: "The value <arg1> for the parameter <arg2> in the action <arg3>
749f4c4dcf4SKowalski, Kamil  * is of a different type than the parameter can accept."
750f4c4dcf4SKowalski, Kamil  *
751f4c4dcf4SKowalski, Kamil  * @param[in] arg1 Parameter of message that will replace %1 in its body.
752f4c4dcf4SKowalski, Kamil  * @param[in] arg2 Parameter of message that will replace %2 in its body.
753f4c4dcf4SKowalski, Kamil  * @param[in] arg3 Parameter of message that will replace %3 in its body.
754f4c4dcf4SKowalski, Kamil  *
755f4c4dcf4SKowalski, Kamil  * @returns Message ActionParameterValueTypeError formatted to JSON */
756*1668ce6dSEd Tanous nlohmann::json actionParameterValueTypeError(std::string_view arg1,
757*1668ce6dSEd Tanous                                              std::string_view arg2,
758*1668ce6dSEd Tanous                                              std::string_view arg3);
759b5c07418SJames Feist 
760*1668ce6dSEd Tanous void actionParameterValueTypeError(crow::Response& res, std::string_view arg1,
761*1668ce6dSEd Tanous                                    std::string_view arg2,
762*1668ce6dSEd Tanous                                    std::string_view arg3);
763f4c4dcf4SKowalski, Kamil 
764f4c4dcf4SKowalski, Kamil /**
765f4c4dcf4SKowalski, Kamil  * @brief Formats SessionLimitExceeded message into JSON
766f4c4dcf4SKowalski, Kamil  * Message body: "The session establishment failed due to the number of
767f4c4dcf4SKowalski, Kamil  * simultaneous sessions exceeding the limit of the implementation."
768f4c4dcf4SKowalski, Kamil  *
769f4c4dcf4SKowalski, Kamil  *
770f4c4dcf4SKowalski, Kamil  * @returns Message SessionLimitExceeded formatted to JSON */
77165176d39SEd Tanous nlohmann::json sessionLimitExceeded();
772b5c07418SJames Feist 
773f12894f8SJason M. Bills void sessionLimitExceeded(crow::Response& res);
774f4c4dcf4SKowalski, Kamil 
775f4c4dcf4SKowalski, Kamil /**
776f4c4dcf4SKowalski, Kamil  * @brief Formats ActionNotSupported message into JSON
77766ac2b8cSJason M. Bills  * Message body: "The action <arg1> is not supported by the resource."
778f4c4dcf4SKowalski, Kamil  *
779f4c4dcf4SKowalski, Kamil  * @param[in] arg1 Parameter of message that will replace %1 in its body.
780f4c4dcf4SKowalski, Kamil  *
781f4c4dcf4SKowalski, Kamil  * @returns Message ActionNotSupported formatted to JSON */
782*1668ce6dSEd Tanous nlohmann::json actionNotSupported(std::string_view arg1);
783b5c07418SJames Feist 
784*1668ce6dSEd Tanous void actionNotSupported(crow::Response& res, std::string_view arg1);
785f4c4dcf4SKowalski, Kamil 
786f4c4dcf4SKowalski, Kamil /**
787f4c4dcf4SKowalski, Kamil  * @brief Formats InvalidIndex message into JSON
78866ac2b8cSJason M. Bills  * Message body: "The index <arg1> is not a valid offset into the array."
789f4c4dcf4SKowalski, Kamil  *
790f4c4dcf4SKowalski, Kamil  * @param[in] arg1 Parameter of message that will replace %1 in its body.
791f4c4dcf4SKowalski, Kamil  *
792f4c4dcf4SKowalski, Kamil  * @returns Message InvalidIndex formatted to JSON */
7935187e09bSJosh Lehan nlohmann::json invalidIndex(int64_t arg1);
794b5c07418SJames Feist 
7955187e09bSJosh Lehan void invalidIndex(crow::Response& res, int64_t arg1);
796f4c4dcf4SKowalski, Kamil 
797f4c4dcf4SKowalski, Kamil /**
798f4c4dcf4SKowalski, Kamil  * @brief Formats EmptyJSON message into JSON
799f4c4dcf4SKowalski, Kamil  * Message body: "The request body submitted contained an empty JSON object and
800f4c4dcf4SKowalski, Kamil  * the service is unable to process it."
801f4c4dcf4SKowalski, Kamil  *
802f4c4dcf4SKowalski, Kamil  *
803f4c4dcf4SKowalski, Kamil  * @returns Message EmptyJSON formatted to JSON */
80465176d39SEd Tanous nlohmann::json emptyJSON();
805b5c07418SJames Feist 
806f12894f8SJason M. Bills void emptyJSON(crow::Response& res);
807f4c4dcf4SKowalski, Kamil 
808f4c4dcf4SKowalski, Kamil /**
809f4c4dcf4SKowalski, Kamil  * @brief Formats QueryNotSupportedOnResource message into JSON
810f4c4dcf4SKowalski, Kamil  * Message body: "Querying is not supported on the requested resource."
811f4c4dcf4SKowalski, Kamil  *
812f4c4dcf4SKowalski, Kamil  *
813f4c4dcf4SKowalski, Kamil  * @returns Message QueryNotSupportedOnResource formatted to JSON */
81465176d39SEd Tanous nlohmann::json queryNotSupportedOnResource();
815b5c07418SJames Feist 
816f12894f8SJason M. Bills void queryNotSupportedOnResource(crow::Response& res);
817f4c4dcf4SKowalski, Kamil 
818f4c4dcf4SKowalski, Kamil /**
819684bb4b8SJason M. Bills  * @brief Formats QueryNotSupportedOnOperation message into JSON
820684bb4b8SJason M. Bills  * Message body: "Querying is not supported with the requested operation."
821684bb4b8SJason M. Bills  *
822684bb4b8SJason M. Bills  *
823684bb4b8SJason M. Bills  * @returns Message QueryNotSupportedOnOperation formatted to JSON */
82465176d39SEd Tanous nlohmann::json queryNotSupportedOnOperation();
825684bb4b8SJason M. Bills 
826684bb4b8SJason M. Bills void queryNotSupportedOnOperation(crow::Response& res);
827684bb4b8SJason M. Bills 
828684bb4b8SJason M. Bills /**
829684bb4b8SJason M. Bills  * @brief Formats QueryCombinationInvalid message into JSON
830684bb4b8SJason M. Bills  * Message body: "Two or more query parameters in the request cannot be used
831684bb4b8SJason M. Bills  * together."
832684bb4b8SJason M. Bills  *
833684bb4b8SJason M. Bills  *
834684bb4b8SJason M. Bills  * @returns Message QueryCombinationInvalid formatted to JSON */
83565176d39SEd Tanous nlohmann::json queryCombinationInvalid();
836684bb4b8SJason M. Bills 
837684bb4b8SJason M. Bills void queryCombinationInvalid(crow::Response& res);
838684bb4b8SJason M. Bills 
839684bb4b8SJason M. Bills /**
840f4c4dcf4SKowalski, Kamil  * @brief Formats InsufficientPrivilege message into JSON
841f4c4dcf4SKowalski, Kamil  * Message body: "There are insufficient privileges for the account or
842f4c4dcf4SKowalski, Kamil  * credentials associated with the current session to perform the requested
843f4c4dcf4SKowalski, Kamil  * operation."
844f4c4dcf4SKowalski, Kamil  *
845f4c4dcf4SKowalski, Kamil  *
846f4c4dcf4SKowalski, Kamil  * @returns Message InsufficientPrivilege formatted to JSON */
84765176d39SEd Tanous nlohmann::json insufficientPrivilege();
848b5c07418SJames Feist 
849f12894f8SJason M. Bills void insufficientPrivilege(crow::Response& res);
850f4c4dcf4SKowalski, Kamil 
851f4c4dcf4SKowalski, Kamil /**
852f4c4dcf4SKowalski, Kamil  * @brief Formats PropertyValueModified message into JSON
85366ac2b8cSJason M. Bills  * Message body: "The property <arg1> was assigned the value <arg2> due to
854f4c4dcf4SKowalski, Kamil  * modification by the service."
855f4c4dcf4SKowalski, Kamil  *
856f4c4dcf4SKowalski, Kamil  * @param[in] arg1 Parameter of message that will replace %1 in its body.
857f4c4dcf4SKowalski, Kamil  * @param[in] arg2 Parameter of message that will replace %2 in its body.
858f4c4dcf4SKowalski, Kamil  *
859f4c4dcf4SKowalski, Kamil  * @returns Message PropertyValueModified formatted to JSON */
860*1668ce6dSEd Tanous nlohmann::json propertyValueModified(std::string_view arg1,
861*1668ce6dSEd Tanous                                      std::string_view arg2);
862b5c07418SJames Feist 
863*1668ce6dSEd Tanous void propertyValueModified(crow::Response& res, std::string_view arg1,
864*1668ce6dSEd Tanous                            std::string_view arg2);
865f4c4dcf4SKowalski, Kamil 
866f4c4dcf4SKowalski, Kamil /**
867f4c4dcf4SKowalski, Kamil  * @brief Formats AccountNotModified message into JSON
868f4c4dcf4SKowalski, Kamil  * Message body: "The account modification request failed."
869f4c4dcf4SKowalski, Kamil  *
870f4c4dcf4SKowalski, Kamil  *
871f4c4dcf4SKowalski, Kamil  * @returns Message AccountNotModified formatted to JSON */
87265176d39SEd Tanous nlohmann::json accountNotModified();
873b5c07418SJames Feist 
874f12894f8SJason M. Bills void accountNotModified(crow::Response& res);
875f4c4dcf4SKowalski, Kamil 
876f4c4dcf4SKowalski, Kamil /**
877f4c4dcf4SKowalski, Kamil  * @brief Formats QueryParameterValueFormatError message into JSON
87866ac2b8cSJason M. Bills  * Message body: "The value <arg1> for the parameter <arg2> is of a different
879f4c4dcf4SKowalski, Kamil  * format than the parameter can accept."
880f4c4dcf4SKowalski, Kamil  *
881f4c4dcf4SKowalski, Kamil  * @param[in] arg1 Parameter of message that will replace %1 in its body.
882f4c4dcf4SKowalski, Kamil  * @param[in] arg2 Parameter of message that will replace %2 in its body.
883f4c4dcf4SKowalski, Kamil  *
884f4c4dcf4SKowalski, Kamil  * @returns Message QueryParameterValueFormatError formatted to JSON */
885b5c07418SJames Feist 
886*1668ce6dSEd Tanous nlohmann::json queryParameterValueFormatError(std::string_view arg1,
887*1668ce6dSEd Tanous                                               std::string_view arg2);
888b5c07418SJames Feist 
889*1668ce6dSEd Tanous void queryParameterValueFormatError(crow::Response& res, std::string_view arg1,
890*1668ce6dSEd Tanous                                     std::string_view arg2);
891f4c4dcf4SKowalski, Kamil 
892f4c4dcf4SKowalski, Kamil /**
893f4c4dcf4SKowalski, Kamil  * @brief Formats PropertyMissing message into JSON
89466ac2b8cSJason M. Bills  * Message body: "The property <arg1> is a required property and must be
895f4c4dcf4SKowalski, Kamil  * included in the request."
896f4c4dcf4SKowalski, Kamil  *
897f4c4dcf4SKowalski, Kamil  * @param[in] arg1 Parameter of message that will replace %1 in its body.
898f4c4dcf4SKowalski, Kamil  *
899f4c4dcf4SKowalski, Kamil  * @returns Message PropertyMissing formatted to JSON */
900*1668ce6dSEd Tanous nlohmann::json propertyMissing(std::string_view arg1);
901b5c07418SJames Feist 
902*1668ce6dSEd Tanous void propertyMissing(crow::Response& res, std::string_view arg1);
903f12894f8SJason M. Bills 
904f12894f8SJason M. Bills /**
905f4c4dcf4SKowalski, Kamil  * @brief Formats ResourceExhaustion message into JSON
90666ac2b8cSJason M. Bills  * Message body: "The resource <arg1> was unable to satisfy the request due to
907f4c4dcf4SKowalski, Kamil  * unavailability of resources."
908f4c4dcf4SKowalski, Kamil  *
909f4c4dcf4SKowalski, Kamil  * @param[in] arg1 Parameter of message that will replace %1 in its body.
910f4c4dcf4SKowalski, Kamil  *
911f4c4dcf4SKowalski, Kamil  * @returns Message ResourceExhaustion formatted to JSON */
912*1668ce6dSEd Tanous nlohmann::json resourceExhaustion(std::string_view arg1);
913b5c07418SJames Feist 
914*1668ce6dSEd Tanous void resourceExhaustion(crow::Response& res, std::string_view arg1);
915f4c4dcf4SKowalski, Kamil 
916f4c4dcf4SKowalski, Kamil /**
917f4c4dcf4SKowalski, Kamil  * @brief Formats AccountModified message into JSON
918f4c4dcf4SKowalski, Kamil  * Message body: "The account was successfully modified."
919f4c4dcf4SKowalski, Kamil  *
920f4c4dcf4SKowalski, Kamil  *
921f4c4dcf4SKowalski, Kamil  * @returns Message AccountModified formatted to JSON */
92265176d39SEd Tanous nlohmann::json accountModified();
923b5c07418SJames Feist 
924a08b46ccSJason M. Bills void accountModified(crow::Response& res);
925f4c4dcf4SKowalski, Kamil 
926f4c4dcf4SKowalski, Kamil /**
927f4c4dcf4SKowalski, Kamil  * @brief Formats QueryParameterOutOfRange message into JSON
92866ac2b8cSJason M. Bills  * Message body: "The value <arg1> for the query parameter <arg2> is out of
92966ac2b8cSJason M. Bills  * range <arg3>."
930f4c4dcf4SKowalski, Kamil  *
931f4c4dcf4SKowalski, Kamil  * @param[in] arg1 Parameter of message that will replace %1 in its body.
932f4c4dcf4SKowalski, Kamil  * @param[in] arg2 Parameter of message that will replace %2 in its body.
933f4c4dcf4SKowalski, Kamil  * @param[in] arg3 Parameter of message that will replace %3 in its body.
934f4c4dcf4SKowalski, Kamil  *
935f4c4dcf4SKowalski, Kamil  * @returns Message QueryParameterOutOfRange formatted to JSON */
936*1668ce6dSEd Tanous nlohmann::json queryParameterOutOfRange(std::string_view arg1,
937*1668ce6dSEd Tanous                                         std::string_view arg2,
938*1668ce6dSEd Tanous                                         std::string_view arg3);
939b5c07418SJames Feist 
940*1668ce6dSEd Tanous void queryParameterOutOfRange(crow::Response& res, std::string_view arg1,
941*1668ce6dSEd Tanous                               std::string_view arg2, std::string_view arg3);
942f4c4dcf4SKowalski, Kamil 
9433bf4e632SJoseph Reynolds /**
9443bf4e632SJoseph Reynolds  * @brief Formats PasswordChangeRequired message into JSON
9453bf4e632SJoseph Reynolds  * Message body: The password provided for this account must be changed
9463bf4e632SJoseph Reynolds  * before access is granted.  PATCH the 'Password' property for this
9473bf4e632SJoseph Reynolds  * account located at the target URI '%1' to complete this process.
9483bf4e632SJoseph Reynolds  *
9493bf4e632SJoseph Reynolds  * @param[in] arg1 Parameter of message that will replace %1 in its body.
9503bf4e632SJoseph Reynolds  *
9513bf4e632SJoseph Reynolds  * @returns Message PasswordChangeRequired formatted to JSON */
952ace85d60SEd Tanous 
953ace85d60SEd Tanous nlohmann::json passwordChangeRequired(const boost::urls::url_view& arg1);
954ace85d60SEd Tanous 
955ace85d60SEd Tanous void passwordChangeRequired(crow::Response& res,
956ace85d60SEd Tanous                             const boost::urls::url_view& arg1);
9573bf4e632SJoseph Reynolds 
9584cde5d90SJames Feist /**
9594cde5d90SJames Feist  * @brief Formats InvalidUpload message into JSON
9604cde5d90SJames Feist  * Message body: Invalid file uploaded to %1: %2.*
9614cde5d90SJames Feist  * @param[in] arg1 Parameter of message that will replace %1 in its body.
9624cde5d90SJames Feist  * @param[in] arg2 Parameter of message that will replace %2 in its body.
9634cde5d90SJames Feist  *
9644cde5d90SJames Feist  * @returns Message InvalidUpload formatted to JSON */
965*1668ce6dSEd Tanous nlohmann::json invalidUpload(std::string_view arg1, std::string_view arg2);
9664cde5d90SJames Feist 
967*1668ce6dSEd Tanous void invalidUpload(crow::Response& res, std::string_view arg1,
968*1668ce6dSEd Tanous                    std::string_view arg2);
9694cde5d90SJames Feist 
970f4c4dcf4SKowalski, Kamil } // namespace messages
971f4c4dcf4SKowalski, Kamil 
972f4c4dcf4SKowalski, Kamil } // namespace redfish
973