1 #pragma once 2 /**************************************************************** 3 * READ THIS WARNING FIRST 4 * This is an auto-generated header which contains definitions 5 * for Redfish DMTF defined messages. 6 * DO NOT modify this registry outside of running the 7 * parse_registries.py script. The definitions contained within 8 * this file are owned by DMTF. Any modifications to these files 9 * should be first pushed to the relevant registry in the DMTF 10 * github organization. 11 ***************************************************************/ 12 13 #include "http_response.hpp" 14 15 #include <boost/url/url_view_base.hpp> 16 #include <nlohmann/json.hpp> 17 18 #include <cstdint> 19 #include <source_location> 20 #include <string> 21 #include <string_view> 22 23 // IWYU pragma: no_forward_declare crow::Response 24 25 namespace redfish 26 { 27 28 namespace messages 29 { 30 31 constexpr const char* messageVersionPrefix = "Base.1.11.0."; 32 constexpr const char* messageAnnotation = "@Message.ExtendedInfo"; 33 34 /** 35 * @brief Moves all error messages from the |source| JSON to |target| 36 */ 37 void moveErrorsToErrorJson(nlohmann::json& target, nlohmann::json& source); 38 39 /** 40 * @brief Formats ResourceInUse message into JSON 41 * Message body: "The change to the requested resource failed because the 42 * resource is in use or in transition." 43 * 44 * 45 * @returns Message ResourceInUse formatted to JSON */ 46 nlohmann::json resourceInUse(); 47 48 void resourceInUse(crow::Response& res); 49 50 /** 51 * @brief Formats MalformedJSON message into JSON 52 * Message body: "The request body submitted was malformed JSON and could not be 53 * parsed by the receiving service." 54 * 55 * 56 * @returns Message MalformedJSON formatted to JSON */ 57 nlohmann::json malformedJSON(); 58 59 void malformedJSON(crow::Response& res); 60 61 /** 62 * @brief Formats ResourceMissingAtURI message into JSON 63 * Message body: "The resource at the URI <arg1> was not found." 64 * 65 * @param[in] arg1 Parameter of message that will replace %1 in its body. 66 * 67 * @returns Message ResourceMissingAtURI formatted to JSON */ 68 nlohmann::json resourceMissingAtURI(const boost::urls::url_view_base& arg1); 69 70 void resourceMissingAtURI(crow::Response& res, 71 const boost::urls::url_view_base& arg1); 72 73 /** 74 * @brief Formats ActionParameterValueFormatError message into JSON 75 * Message body: "The value <arg1> for the parameter <arg2> in the action <arg3> 76 * is not a format that the parameter can accept." 77 * 78 * @param[in] arg1 Parameter of message that will replace %1 in its body. 79 * @param[in] arg2 Parameter of message that will replace %2 in its body. 80 * @param[in] arg3 Parameter of message that will replace %3 in its body. 81 * 82 * @returns Message ActionParameterValueFormatError formatted to JSON */ 83 nlohmann::json actionParameterValueFormatError( 84 const nlohmann::json& arg1, std::string_view arg2, std::string_view arg3); 85 86 void actionParameterValueFormatError( 87 crow::Response& res, const nlohmann::json& arg1, std::string_view arg2, 88 std::string_view arg3); 89 90 /** 91 * @brief Formats ActionParameterValueNotInList message into JSON 92 * Message body: "The value <arg1> for the parameter <arg2> in the action <arg3> 93 * is not in the list of acceptable values." 94 * 95 * @param[in] arg1 Parameter of message that will replace %1 in its body. 96 * @param[in] arg2 Parameter of message that will replace %2 in its body. 97 * @param[in] arg3 Parameter of message that will replace %3 in its body. 98 * 99 * @returns Message ActionParameterValueNotInList formatted to JSON */ 100 nlohmann::json actionParameterValueNotInList( 101 std::string_view arg1, std::string_view arg2, std::string_view arg3); 102 103 void actionParameterValueNotInList(crow::Response& res, std::string_view arg1, 104 std::string_view arg2, 105 std::string_view arg3); 106 107 /** 108 * @brief Formats InternalError message into JSON 109 * Message body: "The request failed due to an internal service error. The 110 * service is still operational." 111 * 112 * 113 * @returns Message InternalError formatted to JSON */ 114 nlohmann::json internalError(); 115 116 void internalError(crow::Response& res, std::source_location location = 117 std::source_location::current()); 118 119 /** 120 * @brief Formats UnrecognizedRequestBody message into JSON 121 * Message body: "The service detected a malformed request body that it was 122 * unable to interpret." 123 * 124 * 125 * @returns Message UnrecognizedRequestBody formatted to JSON */ 126 nlohmann::json unrecognizedRequestBody(); 127 128 void unrecognizedRequestBody(crow::Response& res); 129 130 /** 131 * @brief Formats ResourceAtUriUnauthorized message into JSON 132 * Message body: "While accessing the resource at <arg1>, the service received 133 * an authorization error <arg2>." 134 * 135 * @param[in] arg1 Parameter of message that will replace %1 in its body. 136 * @param[in] arg2 Parameter of message that will replace %2 in its body. 137 * 138 * @returns Message ResourceAtUriUnauthorized formatted to JSON */ 139 nlohmann::json resourceAtUriUnauthorized(const boost::urls::url_view_base& arg1, 140 std::string_view arg2); 141 142 void resourceAtUriUnauthorized(crow::Response& res, 143 const boost::urls::url_view_base& arg1, 144 std::string_view arg2); 145 146 /** 147 * @brief Formats ActionParameterUnknown message into JSON 148 * Message body: "The action <arg1> was submitted with the invalid parameter 149 * <arg2>." 150 * 151 * @param[in] arg1 Parameter of message that will replace %1 in its body. 152 * @param[in] arg2 Parameter of message that will replace %2 in its body. 153 * 154 * @returns Message ActionParameterUnknown formatted to JSON */ 155 nlohmann::json actionParameterUnknown(std::string_view arg1, 156 std::string_view arg2); 157 158 void actionParameterUnknown(crow::Response& res, std::string_view arg1, 159 std::string_view arg2); 160 161 /** 162 * @brief Formats ResourceCannotBeDeleted message into JSON 163 * Message body: "The delete request failed because the resource requested 164 * cannot be deleted." 165 * 166 * 167 * @returns Message ResourceCannotBeDeleted formatted to JSON */ 168 nlohmann::json resourceCannotBeDeleted(); 169 170 void resourceCannotBeDeleted(crow::Response& res); 171 172 /** 173 * @brief Formats PropertyDuplicate message into JSON 174 * Message body: "The property <arg1> was duplicated in the request." 175 * 176 * @param[in] arg1 Parameter of message that will replace %1 in its body. 177 * 178 * @returns Message PropertyDuplicate formatted to JSON */ 179 nlohmann::json propertyDuplicate(std::string_view arg1); 180 181 void propertyDuplicate(crow::Response& res, std::string_view arg1); 182 183 /** 184 * @brief Formats ServiceTemporarilyUnavailable message into JSON 185 * Message body: "The service is temporarily unavailable. Retry in <arg1> 186 * seconds." 187 * 188 * @param[in] arg1 Parameter of message that will replace %1 in its body. 189 * 190 * @returns Message ServiceTemporarilyUnavailable formatted to JSON */ 191 nlohmann::json serviceTemporarilyUnavailable(std::string_view arg1); 192 193 void serviceTemporarilyUnavailable(crow::Response& res, std::string_view arg1); 194 195 /** 196 * @brief Formats ResourceAlreadyExists message into JSON 197 * Message body: "The requested resource of type <arg1> with the property <arg2> 198 * with the value <arg3> already exists." 199 * 200 * @param[in] arg1 Parameter of message that will replace %1 in its body. 201 * @param[in] arg2 Parameter of message that will replace %2 in its body. 202 * @param[in] arg3 Parameter of message that will replace %3 in its body. 203 * 204 * @returns Message ResourceAlreadyExists formatted to JSON */ 205 nlohmann::json resourceAlreadyExists( 206 std::string_view arg1, std::string_view arg2, std::string_view arg3); 207 208 void resourceAlreadyExists(crow::Response& res, std::string_view arg1, 209 std::string_view arg2, std::string_view arg3); 210 211 /** 212 * @brief Formats AccountForSessionNoLongerExists message into JSON 213 * Message body: "The account for the current session was removed, and so the 214 * current session was removed as well." 215 * 216 * 217 * @returns Message AccountForSessionNoLongerExists formatted to JSON */ 218 nlohmann::json accountForSessionNoLongerExists(); 219 220 void accountForSessionNoLongerExists(crow::Response& res); 221 222 /** 223 * @brief Formats CreateFailedMissingReqProperties message into JSON 224 * Message body: "The create operation failed because the required property 225 * <arg1> was missing from the request." 226 * 227 * @param[in] arg1 Parameter of message that will replace %1 in its body. 228 * 229 * @returns Message CreateFailedMissingReqProperties formatted to JSON */ 230 nlohmann::json createFailedMissingReqProperties(std::string_view arg1); 231 232 void createFailedMissingReqProperties(crow::Response& res, 233 std::string_view arg1); 234 235 /** 236 * @brief Formats PropertyValueFormatError message into JSON 237 * Message body: "The value <arg1> for the property <arg2> is not a format that 238 * the property can accept." 239 * 240 * @param[in] arg1 Parameter of message that will replace %1 in its body. 241 * @param[in] arg2 Parameter of message that will replace %2 in its body. 242 * 243 * @returns Message PropertyValueFormatError formatted to JSON */ 244 nlohmann::json propertyValueFormatError(const nlohmann::json& arg1, 245 std::string_view arg2); 246 247 void propertyValueFormatError(crow::Response& res, const nlohmann::json& arg1, 248 std::string_view arg2); 249 250 /** 251 * @brief Formats PropertyValueNotInList message into JSON 252 * Message body: "The value <arg1> for the property <arg2> is not in the list of 253 * acceptable values." 254 * 255 * @param[in] arg1 Parameter of message that will replace %1 in its body. 256 * @param[in] arg2 Parameter of message that will replace %2 in its body. 257 * 258 * @returns Message PropertyValueNotInList formatted to JSON */ 259 nlohmann::json propertyValueNotInList(const nlohmann::json& arg1, 260 std::string_view arg2); 261 262 void propertyValueNotInList(crow::Response& res, const nlohmann::json& arg1, 263 std::string_view arg2); 264 265 /** 266 * @brief Formats PropertyValueOutOfRange message into JSON 267 * Message body: "The value <arg1> for the property <arg2> is not in the 268 * supported range of acceptable values." 269 * 270 * @param[in] arg1 Parameter of message that will replace %1 in its body. 271 * @param[in] arg2 Parameter of message that will replace %2 in its body. 272 * 273 * @returns Message PropertyValueOutOfRange formatted to JSON */ 274 nlohmann::json propertyValueOutOfRange(const nlohmann::json& arg1, 275 std::string_view arg2); 276 277 void propertyValueOutOfRange(crow::Response& res, const nlohmann::json& arg1, 278 std::string_view arg2); 279 280 /** 281 * @brief Formats ResourceAtUriInUnknownFormat message into JSON 282 * Message body: "The resource at <arg1> is in a format not recognized by the 283 * service." 284 * 285 * @param[in] arg1 Parameter of message that will replace %1 in its body. 286 * 287 * @returns Message ResourceAtUriInUnknownFormat formatted to JSON */ 288 nlohmann::json 289 resourceAtUriInUnknownFormat(const boost::urls::url_view_base& arg1); 290 291 void resourceAtUriInUnknownFormat(crow::Response& res, 292 const boost::urls::url_view_base& arg1); 293 294 /** 295 * @brief Formats ServiceDisabled message into JSON 296 * Message body: "The operation failed because the service at <arg1> is disabled 297 * and cannot accept requests." 298 * 299 * @param[in] arg1 Parameter of message that will replace %1 in its body. 300 * 301 * @returns Message ServiceDisabled formatted to JSON */ 302 nlohmann::json serviceDisabled(std::string_view arg1); 303 304 void serviceDisabled(crow::Response& res, std::string_view arg1); 305 306 /** 307 * @brief Formats ServiceInUnknownState message into JSON 308 * Message body: "The operation failed because the service is in an unknown 309 * state and can no longer take incoming requests." 310 * 311 * 312 * @returns Message ServiceInUnknownState formatted to JSON */ 313 nlohmann::json serviceInUnknownState(); 314 315 void serviceInUnknownState(crow::Response& res); 316 317 /** 318 * @brief Formats EventSubscriptionLimitExceeded message into JSON 319 * Message body: "The event subscription failed due to the number of 320 * simultaneous subscriptions exceeding the limit of the implementation." 321 * 322 * 323 * @returns Message EventSubscriptionLimitExceeded formatted to JSON */ 324 nlohmann::json eventSubscriptionLimitExceeded(); 325 326 void eventSubscriptionLimitExceeded(crow::Response& res); 327 328 /** 329 * @brief Formats ActionParameterMissing message into JSON 330 * Message body: "The action <arg1> requires the parameter <arg2> to be present 331 * in the request body." 332 * 333 * @param[in] arg1 Parameter of message that will replace %1 in its body. 334 * @param[in] arg2 Parameter of message that will replace %2 in its body. 335 * 336 * @returns Message ActionParameterMissing formatted to JSON */ 337 nlohmann::json actionParameterMissing(std::string_view arg1, 338 std::string_view arg2); 339 340 void actionParameterMissing(crow::Response& res, std::string_view arg1, 341 std::string_view arg2); 342 343 /** 344 * @brief Formats StringValueTooLong message into JSON 345 * Message body: "The string <arg1> exceeds the length limit <arg2>." 346 * 347 * @param[in] arg1 Parameter of message that will replace %1 in its body. 348 * @param[in] arg2 Parameter of message that will replace %2 in its body. 349 * 350 * @returns Message StringValueTooLong formatted to JSON */ 351 nlohmann::json stringValueTooLong(std::string_view arg1, int arg2); 352 353 void stringValueTooLong(crow::Response& res, std::string_view arg1, int arg2); 354 355 /** 356 * @brief Formats SessionTerminated message into JSON 357 * Message body: "The session was successfully terminated." 358 * 359 * 360 * @returns Message SessionTerminated formatted to JSON */ 361 nlohmann::json sessionTerminated(); 362 363 void sessionTerminated(crow::Response& res); 364 365 /** 366 * @brief Formats SubscriptionTerminated message into JSON 367 * Message body: "The event subscription was terminated." 368 * 369 * 370 * @returns Message SubscriptionTerminated formatted to JSON */ 371 nlohmann::json subscriptionTerminated(); 372 373 void subscriptionTerminated(crow::Response& res); 374 375 /** 376 * @brief Formats ResourceTypeIncompatible message into JSON 377 * Message body: "The @odata.type of the request body <arg1> is incompatible 378 * with the @odata.type of the resource, which is <arg2>." 379 * 380 * @param[in] arg1 Parameter of message that will replace %1 in its body. 381 * @param[in] arg2 Parameter of message that will replace %2 in its body. 382 * 383 * @returns Message ResourceTypeIncompatible formatted to JSON */ 384 nlohmann::json resourceTypeIncompatible(std::string_view arg1, 385 std::string_view arg2); 386 387 void resourceTypeIncompatible(crow::Response& res, std::string_view arg1, 388 std::string_view arg2); 389 390 /** 391 * @brief Formats ResetRequired message into JSON 392 * Message body: "In order to apply changes, recover from errors, or complete 393 * the operation, a component reset is required with the Reset action URI <arg1> 394 * and ResetType <arg2>." 395 * 396 * @param[in] arg1 Parameter of message that will replace %1 in its body. 397 * @param[in] arg2 Parameter of message that will replace %2 in its body. 398 * 399 * @returns Message ResetRequired formatted to JSON */ 400 nlohmann::json resetRequired(const boost::urls::url_view_base& arg1, 401 std::string_view arg2); 402 403 void resetRequired(crow::Response& res, const boost::urls::url_view_base& arg1, 404 std::string_view arg2); 405 406 /** 407 * @brief Formats ChassisPowerStateOnRequired message into JSON 408 * Message body: "The chassis with Id <arg1> is required to be powered on to 409 * perform this request." 410 * 411 * @param[in] arg1 Parameter of message that will replace %1 in its body. 412 * 413 * @returns Message ChassisPowerStateOnRequired formatted to JSON */ 414 nlohmann::json chassisPowerStateOnRequired(std::string_view arg1); 415 416 void chassisPowerStateOnRequired(crow::Response& res, std::string_view arg1); 417 418 /** 419 * @brief Formats ChassisPowerStateOffRequired message into JSON 420 * Message body: "The chassis with Id <arg1> is required to be powered off to 421 * perform this request." 422 * 423 * @param[in] arg1 Parameter of message that will replace %1 in its body. 424 * 425 * @returns Message ChassisPowerStateOffRequired formatted to JSON */ 426 nlohmann::json chassisPowerStateOffRequired(std::string_view arg1); 427 428 void chassisPowerStateOffRequired(crow::Response& res, std::string_view arg1); 429 430 /** 431 * @brief Formats PropertyValueConflict message into JSON 432 * Message body: "The property <arg1> could not be written because its value 433 * would conflict with the value of the <arg2> property." 434 * 435 * @param[in] arg1 Parameter of message that will replace %1 in its body. 436 * @param[in] arg2 Parameter of message that will replace %2 in its body. 437 * 438 * @returns Message PropertyValueConflict formatted to JSON */ 439 nlohmann::json propertyValueConflict(std::string_view arg1, 440 std::string_view arg2); 441 442 void propertyValueConflict(crow::Response& res, std::string_view arg1, 443 std::string_view arg2); 444 445 /** 446 * @brief Formats PropertyValueResourceConflict message into JSON 447 * Message body: "The property <arg1> with the requested value of <arg2> could 448 * not be written because the value conflicts with the state or configuration of 449 * the resource at <arg3>." 450 * 451 * @param[in] arg1 Parameter of message that will replace %1 in its body. 452 * @param[in] arg2 Parameter of message that will replace %2 in its body. 453 * @param[in] arg3 Parameter of message that will replace %3 in its body. 454 * 455 * @returns Message PropertyValueResourceConflict formatted to JSON */ 456 nlohmann::json propertyValueResourceConflict( 457 std::string_view arg1, const nlohmann::json& arg2, 458 const boost::urls::url_view_base& arg3); 459 460 void propertyValueResourceConflict(crow::Response& res, std::string_view arg1, 461 const nlohmann::json& arg2, 462 const boost::urls::url_view_base& arg3); 463 464 /** 465 * @brief Formats PropertyValueExternalConflict message into JSON 466 * Message body: "The property <arg1> with the requested value of <arg2> could 467 * not be written because the value is not available due to a configuration 468 * conflict." 469 * 470 * @param[in] arg1 Parameter of message that will replace %1 in its body. 471 * @param[in] arg2 Parameter of message that will replace %2 in its body. 472 * 473 * @returns Message PropertyValueExternalConflict formatted to JSON */ 474 nlohmann::json propertyValueExternalConflict(std::string_view arg1, 475 const nlohmann::json& arg2); 476 477 void propertyValueExternalConflict(crow::Response& res, std::string_view arg1, 478 const nlohmann::json& arg2); 479 480 /** 481 * @brief Formats PropertyValueIncorrect message into JSON 482 * Message body: "The property <arg1> with the requested value of <arg2> could 483 * not be written because the value does not meet the constraints of the 484 * implementation." 485 * 486 * @param[in] arg1 Parameter of message that will replace %1 in its body. 487 * @param[in] arg2 Parameter of message that will replace %2 in its body. 488 * 489 * @returns Message PropertyValueIncorrect formatted to JSON */ 490 nlohmann::json propertyValueIncorrect(std::string_view arg1, 491 const nlohmann::json& arg2); 492 493 void propertyValueIncorrect(crow::Response& res, std::string_view arg1, 494 const nlohmann::json& arg2); 495 496 /** 497 * @brief Formats ResourceCreationConflict message into JSON 498 * Message body: "The resource could not be created. The service has a resource 499 * at URI <arg1> that conflicts with the creation request." 500 * 501 * @param[in] arg1 Parameter of message that will replace %1 in its body. 502 * 503 * @returns Message ResourceCreationConflict formatted to JSON */ 504 nlohmann::json resourceCreationConflict(const boost::urls::url_view_base& arg1); 505 506 void resourceCreationConflict(crow::Response& res, 507 const boost::urls::url_view_base& arg1); 508 509 /** 510 * @brief Formats MaximumErrorsExceeded message into JSON 511 * Message body: "Too many errors have occurred to report them all." 512 * 513 * 514 * @returns Message MaximumErrorsExceeded formatted to JSON */ 515 nlohmann::json maximumErrorsExceeded(); 516 517 void maximumErrorsExceeded(crow::Response& res); 518 519 /** 520 * @brief Formats PreconditionFailed message into JSON 521 * Message body: "The ETag supplied did not match the ETag required to change 522 * this resource." 523 * 524 * 525 * @returns Message PreconditionFailed formatted to JSON */ 526 nlohmann::json preconditionFailed(); 527 528 void preconditionFailed(crow::Response& res); 529 530 /** 531 * @brief Formats PreconditionRequired message into JSON 532 * Message body: "A precondition header or annotation is required to change this 533 * resource." 534 * 535 * 536 * @returns Message PreconditionRequired formatted to JSON */ 537 nlohmann::json preconditionRequired(); 538 539 void preconditionRequired(crow::Response& res); 540 541 /** 542 * @brief Formats OperationFailed message into JSON 543 * Message body: "An error occurred internal to the service as part of the 544 * overall request. Partial results may have been returned." 545 * 546 * 547 * @returns Message OperationFailed formatted to JSON */ 548 nlohmann::json operationFailed(); 549 550 void operationFailed(crow::Response& res); 551 552 /** 553 * @brief Formats OperationTimeout message into JSON 554 * Message body: "A timeout internal to the service occurred as part of the 555 * request. Partial results may have been returned." 556 * 557 * 558 * @returns Message OperationTimeout formatted to JSON */ 559 nlohmann::json operationTimeout(); 560 561 void operationTimeout(crow::Response& res); 562 563 /** 564 * @brief Formats PropertyValueTypeError message into JSON 565 * Message body: "The value <arg1> for the property <arg2> is not a type that 566 * the property can accept." 567 * 568 * @param[in] arg1 Parameter of message that will replace %1 in its body. 569 * @param[in] arg2 Parameter of message that will replace %2 in its body. 570 * 571 * @returns Message PropertyValueTypeError formatted to JSON */ 572 nlohmann::json propertyValueTypeError(const nlohmann::json& arg1, 573 std::string_view arg2); 574 575 void propertyValueTypeError(crow::Response& res, const nlohmann::json& arg1, 576 std::string_view arg2); 577 578 /** 579 * @brief Formats PropertyValueError message into JSON 580 * Message body: "The value provided for the property <arg1> is not valid." 581 * 582 * @param[in] arg1 Parameter of message that will replace %1 in its body. 583 * 584 * @returns Message PropertyValueError formatted to JSON */ 585 nlohmann::json propertyValueError(std::string_view arg1); 586 587 void propertyValueError(crow::Response& res, std::string_view arg1); 588 589 /** 590 * @brief Formats ResourceNotFound message into JSON 591 * Message body: "The requested resource of type <arg1> named <arg2> was not 592 * found." 593 * 594 * @param[in] arg1 Parameter of message that will replace %1 in its body. 595 * @param[in] arg2 Parameter of message that will replace %2 in its body. 596 * 597 * @returns Message ResourceNotFound formatted to JSON */ 598 nlohmann::json resourceNotFound(std::string_view arg1, std::string_view arg2); 599 600 void resourceNotFound(crow::Response& res, std::string_view arg1, 601 std::string_view arg2); 602 603 /** 604 * @brief Formats CouldNotEstablishConnection message into JSON 605 * Message body: "The service failed to establish a connection with the URI 606 * <arg1>." 607 * 608 * @param[in] arg1 Parameter of message that will replace %1 in its body. 609 * 610 * @returns Message CouldNotEstablishConnection formatted to JSON */ 611 nlohmann::json 612 couldNotEstablishConnection(const boost::urls::url_view_base& arg1); 613 614 void couldNotEstablishConnection(crow::Response& res, 615 const boost::urls::url_view_base& arg1); 616 617 /** 618 * @brief Formats PropertyNotWritable message into JSON 619 * Message body: "The property <arg1> is a read-only property and cannot be 620 * assigned a value." 621 * 622 * @param[in] arg1 Parameter of message that will replace %1 in its body. 623 * 624 * @returns Message PropertyNotWritable formatted to JSON */ 625 nlohmann::json propertyNotWritable(std::string_view arg1); 626 627 void propertyNotWritable(crow::Response& res, std::string_view arg1); 628 629 /** 630 * @brief Formats QueryParameterValueTypeError message into JSON 631 * Message body: "The value <arg1> for the query parameter <arg2> is not a type 632 * that the parameter can accept." 633 * 634 * @param[in] arg1 Parameter of message that will replace %1 in its body. 635 * @param[in] arg2 Parameter of message that will replace %2 in its body. 636 * 637 * @returns Message QueryParameterValueTypeError formatted to JSON */ 638 nlohmann::json queryParameterValueTypeError(const nlohmann::json& arg1, 639 std::string_view arg2); 640 641 void queryParameterValueTypeError( 642 crow::Response& res, const nlohmann::json& arg1, std::string_view arg2); 643 644 /** 645 * @brief Formats ServiceShuttingDown message into JSON 646 * Message body: "The operation failed because the service is shutting down and 647 * can no longer take incoming requests." 648 * 649 * 650 * @returns Message ServiceShuttingDown formatted to JSON */ 651 nlohmann::json serviceShuttingDown(); 652 653 void serviceShuttingDown(crow::Response& res); 654 655 /** 656 * @brief Formats ActionParameterDuplicate message into JSON 657 * Message body: "The action <arg1> was submitted with more than one value for 658 * the parameter <arg2>." 659 * 660 * @param[in] arg1 Parameter of message that will replace %1 in its body. 661 * @param[in] arg2 Parameter of message that will replace %2 in its body. 662 * 663 * @returns Message ActionParameterDuplicate formatted to JSON */ 664 nlohmann::json actionParameterDuplicate(std::string_view arg1, 665 std::string_view arg2); 666 667 void actionParameterDuplicate(crow::Response& res, std::string_view arg1, 668 std::string_view arg2); 669 670 /** 671 * @brief Formats ActionParameterNotSupported message into JSON 672 * Message body: "The parameter <arg1> for the action <arg2> is not supported on 673 * the target resource." 674 * 675 * @param[in] arg1 Parameter of message that will replace %1 in its body. 676 * @param[in] arg2 Parameter of message that will replace %2 in its body. 677 * 678 * @returns Message ActionParameterNotSupported formatted to JSON */ 679 nlohmann::json actionParameterNotSupported(std::string_view arg1, 680 std::string_view arg2); 681 682 void actionParameterNotSupported(crow::Response& res, std::string_view arg1, 683 std::string_view arg2); 684 685 /** 686 * @brief Formats SourceDoesNotSupportProtocol message into JSON 687 * Message body: "The other end of the connection at <arg1> does not support the 688 * specified protocol <arg2>." 689 * 690 * @param[in] arg1 Parameter of message that will replace %1 in its body. 691 * @param[in] arg2 Parameter of message that will replace %2 in its body. 692 * 693 * @returns Message SourceDoesNotSupportProtocol formatted to JSON */ 694 nlohmann::json sourceDoesNotSupportProtocol( 695 const boost::urls::url_view_base& arg1, std::string_view arg2); 696 697 void sourceDoesNotSupportProtocol(crow::Response& res, 698 const boost::urls::url_view_base& arg1, 699 std::string_view arg2); 700 701 /** 702 * @brief Formats StrictAccountTypes message into JSON 703 * Message body: "The request could not be fulfilled with the account types 704 * included in property <arg1> because the property StrictAccountTypes is set to 705 * true." 706 * 707 * @param[in] arg1 Parameter of message that will replace %1 in its body. 708 * 709 * @returns Message StrictAccountTypes formatted to JSON */ 710 nlohmann::json strictAccountTypes(std::string_view arg1); 711 712 void strictAccountTypes(crow::Response& res, std::string_view arg1); 713 714 /** 715 * @brief Formats AccountRemoved message into JSON 716 * Message body: "The account was successfully removed." 717 * 718 * 719 * @returns Message AccountRemoved formatted to JSON */ 720 nlohmann::json accountRemoved(); 721 722 void accountRemoved(crow::Response& res); 723 724 /** 725 * @brief Formats AccessDenied message into JSON 726 * Message body: "While attempting to establish a connection to <arg1>, the 727 * service denied access." 728 * 729 * @param[in] arg1 Parameter of message that will replace %1 in its body. 730 * 731 * @returns Message AccessDenied formatted to JSON */ 732 nlohmann::json accessDenied(const boost::urls::url_view_base& arg1); 733 734 void accessDenied(crow::Response& res, const boost::urls::url_view_base& arg1); 735 736 /** 737 * @brief Formats QueryNotSupported message into JSON 738 * Message body: "Querying is not supported by the implementation." 739 * 740 * 741 * @returns Message QueryNotSupported formatted to JSON */ 742 nlohmann::json queryNotSupported(); 743 744 void queryNotSupported(crow::Response& res); 745 746 /** 747 * @brief Formats CreateLimitReachedForResource message into JSON 748 * Message body: "The create operation failed because the resource has reached 749 * the limit of possible resources." 750 * 751 * 752 * @returns Message CreateLimitReachedForResource formatted to JSON */ 753 nlohmann::json createLimitReachedForResource(); 754 755 void createLimitReachedForResource(crow::Response& res); 756 757 /** 758 * @brief Formats GeneralError message into JSON 759 * Message body: "A general error has occurred. See Resolution for information 760 * on how to resolve the error, or @Message.ExtendedInfo if Resolution is not 761 * provided." 762 * 763 * 764 * @returns Message GeneralError formatted to JSON */ 765 nlohmann::json generalError(); 766 767 void generalError(crow::Response& res); 768 769 /** 770 * @brief Formats Success message into JSON 771 * Message body: "The request completed successfully." 772 * 773 * 774 * @returns Message Success formatted to JSON */ 775 nlohmann::json success(); 776 777 void success(crow::Response& res); 778 779 /** 780 * @brief Formats Created message into JSON 781 * Message body: "The resource was created successfully." 782 * 783 * 784 * @returns Message Created formatted to JSON */ 785 nlohmann::json created(); 786 787 void created(crow::Response& res); 788 789 /** 790 * @brief Formats NoOperation message into JSON 791 * Message body: "The request body submitted contain no data to act upon and no 792 * changes to the resource took place." 793 * 794 * 795 * @returns Message NoOperation formatted to JSON */ 796 nlohmann::json noOperation(); 797 798 void noOperation(crow::Response& res); 799 800 /** 801 * @brief Formats PropertyUnknown message into JSON 802 * Message body: "The property <arg1> is not in the list of valid properties for 803 * the resource." 804 * 805 * @param[in] arg1 Parameter of message that will replace %1 in its body. 806 * 807 * @returns Message PropertyUnknown formatted to JSON */ 808 nlohmann::json propertyUnknown(std::string_view arg1); 809 810 void propertyUnknown(crow::Response& res, std::string_view arg1); 811 812 /** 813 * @brief Formats NoValidSession message into JSON 814 * Message body: "There is no valid session established with the 815 * implementation." 816 * 817 * 818 * @returns Message NoValidSession formatted to JSON */ 819 nlohmann::json noValidSession(); 820 821 void noValidSession(crow::Response& res); 822 823 /** 824 * @brief Formats InvalidObject message into JSON 825 * Message body: "The object at <arg1> is invalid." 826 * 827 * @param[in] arg1 Parameter of message that will replace %1 in its body. 828 * 829 * @returns Message InvalidObject formatted to JSON */ 830 nlohmann::json invalidObject(const boost::urls::url_view_base& arg1); 831 832 void invalidObject(crow::Response& res, const boost::urls::url_view_base& arg1); 833 834 /** 835 * @brief Formats ResourceInStandby message into JSON 836 * Message body: "The request could not be performed because the resource is in 837 * standby." 838 * 839 * 840 * @returns Message ResourceInStandby formatted to JSON */ 841 nlohmann::json resourceInStandby(); 842 843 void resourceInStandby(crow::Response& res); 844 845 /** 846 * @brief Formats ActionParameterValueTypeError message into JSON 847 * Message body: "The value <arg1> for the parameter <arg2> in the action <arg3> 848 * is not a type that the parameter can accept." 849 * 850 * @param[in] arg1 Parameter of message that will replace %1 in its body. 851 * @param[in] arg2 Parameter of message that will replace %2 in its body. 852 * @param[in] arg3 Parameter of message that will replace %3 in its body. 853 * 854 * @returns Message ActionParameterValueTypeError formatted to JSON */ 855 nlohmann::json actionParameterValueTypeError( 856 const nlohmann::json& arg1, std::string_view arg2, std::string_view arg3); 857 858 void actionParameterValueTypeError( 859 crow::Response& res, const nlohmann::json& arg1, std::string_view arg2, 860 std::string_view arg3); 861 862 /** 863 * @brief Formats ActionParameterValueError message into JSON 864 * Message body: "The value for the parameter <arg1> in the action <arg2> is 865 * invalid." 866 * 867 * @param[in] arg1 Parameter of message that will replace %1 in its body. 868 * @param[in] arg2 Parameter of message that will replace %2 in its body. 869 * 870 * @returns Message ActionParameterValueError formatted to JSON */ 871 nlohmann::json actionParameterValueError(const nlohmann::json& arg1, 872 std::string_view arg2); 873 874 void actionParameterValueError(crow::Response& res, const nlohmann::json& arg1, 875 std::string_view arg2); 876 877 /** 878 * @brief Formats SessionLimitExceeded message into JSON 879 * Message body: "The session establishment failed due to the number of 880 * simultaneous sessions exceeding the limit of the implementation." 881 * 882 * 883 * @returns Message SessionLimitExceeded formatted to JSON */ 884 nlohmann::json sessionLimitExceeded(); 885 886 void sessionLimitExceeded(crow::Response& res); 887 888 /** 889 * @brief Formats ActionNotSupported message into JSON 890 * Message body: "The action <arg1> is not supported by the resource." 891 * 892 * @param[in] arg1 Parameter of message that will replace %1 in its body. 893 * 894 * @returns Message ActionNotSupported formatted to JSON */ 895 nlohmann::json actionNotSupported(std::string_view arg1); 896 897 void actionNotSupported(crow::Response& res, std::string_view arg1); 898 899 /** 900 * @brief Formats InvalidIndex message into JSON 901 * Message body: "The index <arg1> is not a valid offset into the array." 902 * 903 * @param[in] arg1 Parameter of message that will replace %1 in its body. 904 * 905 * @returns Message InvalidIndex formatted to JSON */ 906 nlohmann::json invalidIndex(int64_t arg1); 907 908 void invalidIndex(crow::Response& res, int64_t arg1); 909 910 /** 911 * @brief Formats EmptyJSON message into JSON 912 * Message body: "The request body submitted contained an empty JSON object and 913 * the service is unable to process it." 914 * 915 * 916 * @returns Message EmptyJSON formatted to JSON */ 917 nlohmann::json emptyJSON(); 918 919 void emptyJSON(crow::Response& res); 920 921 /** 922 * @brief Formats QueryNotSupportedOnResource message into JSON 923 * Message body: "Querying is not supported on the requested resource." 924 * 925 * 926 * @returns Message QueryNotSupportedOnResource formatted to JSON */ 927 nlohmann::json queryNotSupportedOnResource(); 928 929 void queryNotSupportedOnResource(crow::Response& res); 930 931 /** 932 * @brief Formats QueryNotSupportedOnOperation message into JSON 933 * Message body: "Querying is not supported with the requested operation." 934 * 935 * 936 * @returns Message QueryNotSupportedOnOperation formatted to JSON */ 937 nlohmann::json queryNotSupportedOnOperation(); 938 939 void queryNotSupportedOnOperation(crow::Response& res); 940 941 /** 942 * @brief Formats QueryCombinationInvalid message into JSON 943 * Message body: "Two or more query parameters in the request cannot be used 944 * together." 945 * 946 * 947 * @returns Message QueryCombinationInvalid formatted to JSON */ 948 nlohmann::json queryCombinationInvalid(); 949 950 void queryCombinationInvalid(crow::Response& res); 951 952 /** 953 * @brief Formats EventBufferExceeded message into JSON 954 * Message body: "Undelivered events may have been lost due to exceeding the 955 * event buffer." 956 * 957 * 958 * @returns Message EventBufferExceeded formatted to JSON */ 959 nlohmann::json eventBufferExceeded(); 960 961 void eventBufferExceeded(crow::Response& res); 962 963 /** 964 * @brief Formats InsufficientPrivilege message into JSON 965 * Message body: "There are insufficient privileges for the account or 966 * credentials associated with the current session to perform the requested 967 * operation." 968 * 969 * 970 * @returns Message InsufficientPrivilege formatted to JSON */ 971 nlohmann::json insufficientPrivilege(); 972 973 void insufficientPrivilege(crow::Response& res); 974 975 /** 976 * @brief Formats PropertyValueModified message into JSON 977 * Message body: "The property <arg1> was assigned the value <arg2> due to 978 * modification by the service." 979 * 980 * @param[in] arg1 Parameter of message that will replace %1 in its body. 981 * @param[in] arg2 Parameter of message that will replace %2 in its body. 982 * 983 * @returns Message PropertyValueModified formatted to JSON */ 984 nlohmann::json propertyValueModified(std::string_view arg1, 985 const nlohmann::json& arg2); 986 987 void propertyValueModified(crow::Response& res, std::string_view arg1, 988 const nlohmann::json& arg2); 989 990 /** 991 * @brief Formats AccountNotModified message into JSON 992 * Message body: "The account modification request failed." 993 * 994 * 995 * @returns Message AccountNotModified formatted to JSON */ 996 nlohmann::json accountNotModified(); 997 998 void accountNotModified(crow::Response& res); 999 1000 /** 1001 * @brief Formats QueryParameterValueFormatError message into JSON 1002 * Message body: "The value <arg1> for the parameter <arg2> is not a format that 1003 * the parameter can accept." 1004 * 1005 * @param[in] arg1 Parameter of message that will replace %1 in its body. 1006 * @param[in] arg2 Parameter of message that will replace %2 in its body. 1007 * 1008 * @returns Message QueryParameterValueFormatError formatted to JSON */ 1009 nlohmann::json queryParameterValueFormatError(const nlohmann::json& arg1, 1010 std::string_view arg2); 1011 1012 void queryParameterValueFormatError( 1013 crow::Response& res, const nlohmann::json& arg1, std::string_view arg2); 1014 1015 /** 1016 * @brief Formats PropertyMissing message into JSON 1017 * Message body: "The property <arg1> is a required property and must be 1018 * included in the request." 1019 * 1020 * @param[in] arg1 Parameter of message that will replace %1 in its body. 1021 * 1022 * @returns Message PropertyMissing formatted to JSON */ 1023 nlohmann::json propertyMissing(std::string_view arg1); 1024 1025 void propertyMissing(crow::Response& res, std::string_view arg1); 1026 1027 /** 1028 * @brief Formats ResourceExhaustion message into JSON 1029 * Message body: "The resource <arg1> was unable to satisfy the request due to 1030 * unavailability of resources." 1031 * 1032 * @param[in] arg1 Parameter of message that will replace %1 in its body. 1033 * 1034 * @returns Message ResourceExhaustion formatted to JSON */ 1035 nlohmann::json resourceExhaustion(std::string_view arg1); 1036 1037 void resourceExhaustion(crow::Response& res, std::string_view arg1); 1038 1039 /** 1040 * @brief Formats AccountModified message into JSON 1041 * Message body: "The account was successfully modified." 1042 * 1043 * 1044 * @returns Message AccountModified formatted to JSON */ 1045 nlohmann::json accountModified(); 1046 1047 void accountModified(crow::Response& res); 1048 1049 /** 1050 * @brief Formats QueryParameterOutOfRange message into JSON 1051 * Message body: "The value <arg1> for the query parameter <arg2> is out of 1052 * range <arg3>." 1053 * 1054 * @param[in] arg1 Parameter of message that will replace %1 in its body. 1055 * @param[in] arg2 Parameter of message that will replace %2 in its body. 1056 * @param[in] arg3 Parameter of message that will replace %3 in its body. 1057 * 1058 * @returns Message QueryParameterOutOfRange formatted to JSON */ 1059 nlohmann::json queryParameterOutOfRange( 1060 std::string_view arg1, std::string_view arg2, std::string_view arg3); 1061 1062 void queryParameterOutOfRange(crow::Response& res, std::string_view arg1, 1063 std::string_view arg2, std::string_view arg3); 1064 1065 /** 1066 * @brief Formats PasswordChangeRequired message into JSON 1067 * Message body: "The password provided for this account must be changed before 1068 * access is granted. PATCH the Password property for this account located at 1069 * the target URI <arg1> to complete this process." 1070 * 1071 * @param[in] arg1 Parameter of message that will replace %1 in its body. 1072 * 1073 * @returns Message PasswordChangeRequired formatted to JSON */ 1074 nlohmann::json passwordChangeRequired(const boost::urls::url_view_base& arg1); 1075 1076 void passwordChangeRequired(crow::Response& res, 1077 const boost::urls::url_view_base& arg1); 1078 1079 /** 1080 * @brief Formats InvalidUpload message into JSON 1081 * Message body: "Invalid file uploaded to <arg1>: <arg2>.*" 1082 * 1083 * @param[in] arg1 Parameter of message that will replace %1 in its body. 1084 * @param[in] arg2 Parameter of message that will replace %2 in its body. 1085 * 1086 * @returns Message InvalidUpload formatted to JSON */ 1087 nlohmann::json invalidUpload(std::string_view arg1, std::string_view arg2); 1088 1089 void invalidUpload(crow::Response& res, std::string_view arg1, 1090 std::string_view arg2); 1091 1092 /** 1093 * @brief Formats InsufficientStorage message into JSON 1094 * Message body: "Insufficient storage or memory available to complete the 1095 * request." 1096 * 1097 * 1098 * @returns Message InsufficientStorage formatted to JSON */ 1099 nlohmann::json insufficientStorage(); 1100 1101 void insufficientStorage(crow::Response& res); 1102 1103 /** 1104 * @brief Formats OperationNotAllowed message into JSON 1105 * Message body: "The HTTP method is not allowed on this resource." 1106 * 1107 * 1108 * @returns Message OperationNotAllowed formatted to JSON */ 1109 nlohmann::json operationNotAllowed(); 1110 1111 void operationNotAllowed(crow::Response& res); 1112 1113 /** 1114 * @brief Formats ArraySizeTooLong message into JSON 1115 * Message body: "The array provided for property <arg1> exceeds the size limit 1116 * <arg2>." 1117 * 1118 * @param[in] arg1 Parameter of message that will replace %1 in its body. 1119 * @param[in] arg2 Parameter of message that will replace %2 in its body. 1120 * 1121 * @returns Message ArraySizeTooLong formatted to JSON */ 1122 nlohmann::json arraySizeTooLong(std::string_view arg1, uint64_t arg2); 1123 1124 void arraySizeTooLong(crow::Response& res, std::string_view arg1, 1125 uint64_t arg2); 1126 1127 /** 1128 * @brief Formats GenerateSecretKeyRequired message into JSON 1129 * Message body: "The Time-based One-Time Password (TOTP) secret key for this 1130 * account must be generated before access is granted. Perform the 1131 * GenerateSecretKey action at URI <arg1> and retain the secret key from the 1132 * response." 1133 * 1134 * @param[in] arg1 Parameter of message that will replace %1 in its body. 1135 * 1136 * @returns Message GenerateSecretKeyRequired formatted to JSON */ 1137 nlohmann::json 1138 generateSecretKeyRequired(const boost::urls::url_view_base& arg1); 1139 1140 void generateSecretKeyRequired(crow::Response& res, 1141 const boost::urls::url_view_base& arg1); 1142 1143 /** 1144 * @brief Formats PropertyNotUpdated message into JSON 1145 * Message body: "The property <arg1> was not updated due to an internal service 1146 * error. The service is still operational." 1147 * 1148 * @param[in] arg1 Parameter of message that will replace %1 in its body. 1149 * 1150 * @returns Message PropertyNotUpdated formatted to JSON */ 1151 nlohmann::json propertyNotUpdated(std::string_view arg1); 1152 1153 void propertyNotUpdated(crow::Response& res, std::string_view arg1); 1154 1155 /** 1156 * @brief Formats InvalidJSON message into JSON 1157 * Message body: "The request body submitted is invalid JSON starting at line 1158 * <arg1> and could not be parsed by the receiving service." 1159 * 1160 * @param[in] arg1 Parameter of message that will replace %1 in its body. 1161 * 1162 * @returns Message InvalidJSON formatted to JSON */ 1163 nlohmann::json invalidJSON(std::string_view arg1); 1164 1165 void invalidJSON(crow::Response& res, std::string_view arg1); 1166 1167 /** 1168 * @brief Formats ActionParameterValueOutOfRange message into JSON 1169 * Message body: "The value <arg1> for the parameter <arg2> in the action <arg3> 1170 * is not in the supported range of acceptable values." 1171 * 1172 * @param[in] arg1 Parameter of message that will replace %1 in its body. 1173 * @param[in] arg2 Parameter of message that will replace %2 in its body. 1174 * @param[in] arg3 Parameter of message that will replace %3 in its body. 1175 * 1176 * @returns Message ActionParameterValueOutOfRange formatted to JSON */ 1177 nlohmann::json actionParameterValueOutOfRange( 1178 std::string_view arg1, std::string_view arg2, std::string_view arg3); 1179 1180 void actionParameterValueOutOfRange(crow::Response& res, std::string_view arg1, 1181 std::string_view arg2, 1182 std::string_view arg3); 1183 1184 /** 1185 * @brief Formats ArraySizeTooShort message into JSON 1186 * Message body: "The array provided for property <arg1> is under the minimum 1187 * size limit <arg2>." 1188 * 1189 * @param[in] arg1 Parameter of message that will replace %1 in its body. 1190 * @param[in] arg2 Parameter of message that will replace %2 in its body. 1191 * 1192 * @returns Message ArraySizeTooShort formatted to JSON */ 1193 nlohmann::json arraySizeTooShort(std::string_view arg1, std::string_view arg2); 1194 1195 void arraySizeTooShort(crow::Response& res, std::string_view arg1, 1196 std::string_view arg2); 1197 1198 /** 1199 * @brief Formats QueryParameterValueError message into JSON 1200 * Message body: "The value for the parameter <arg1> is invalid." 1201 * 1202 * @param[in] arg1 Parameter of message that will replace %1 in its body. 1203 * 1204 * @returns Message QueryParameterValueError formatted to JSON */ 1205 nlohmann::json queryParameterValueError(std::string_view arg1); 1206 1207 void queryParameterValueError(crow::Response& res, std::string_view arg1); 1208 1209 /** 1210 * @brief Formats QueryParameterUnsupported message into JSON 1211 * Message body: "Query parameter <arg1> is not supported." 1212 * 1213 * @param[in] arg1 Parameter of message that will replace %1 in its body. 1214 * 1215 * @returns Message QueryParameterUnsupported formatted to JSON */ 1216 nlohmann::json queryParameterUnsupported(std::string_view arg1); 1217 1218 void queryParameterUnsupported(crow::Response& res, std::string_view arg1); 1219 1220 /** 1221 * @brief Formats PayloadTooLarge message into JSON 1222 * Message body: "The supplied payload exceeds the maximum size supported by the 1223 * service." 1224 * 1225 * 1226 * @returns Message PayloadTooLarge formatted to JSON */ 1227 nlohmann::json payloadTooLarge(); 1228 1229 void payloadTooLarge(crow::Response& res); 1230 1231 /** 1232 * @brief Formats MissingOrMalformedPart message into JSON 1233 * Message body: "The multipart request contains malformed parts or is missing 1234 * required parts." 1235 * 1236 * 1237 * @returns Message MissingOrMalformedPart formatted to JSON */ 1238 nlohmann::json missingOrMalformedPart(); 1239 1240 void missingOrMalformedPart(crow::Response& res); 1241 1242 /** 1243 * @brief Formats InvalidURI message into JSON 1244 * Message body: "The URI <arg1> was not found." 1245 * 1246 * @param[in] arg1 Parameter of message that will replace %1 in its body. 1247 * 1248 * @returns Message InvalidURI formatted to JSON */ 1249 nlohmann::json invalidURI(std::string_view arg1); 1250 1251 void invalidURI(crow::Response& res, std::string_view arg1); 1252 1253 /** 1254 * @brief Formats StringValueTooShort message into JSON 1255 * Message body: "The string <arg1> was under the minimum required length 1256 * <arg2>." 1257 * 1258 * @param[in] arg1 Parameter of message that will replace %1 in its body. 1259 * @param[in] arg2 Parameter of message that will replace %2 in its body. 1260 * 1261 * @returns Message StringValueTooShort formatted to JSON */ 1262 nlohmann::json stringValueTooShort(std::string_view arg1, 1263 std::string_view arg2); 1264 1265 void stringValueTooShort(crow::Response& res, std::string_view arg1, 1266 std::string_view arg2); 1267 1268 /** 1269 * @brief Formats ResetRecommended message into JSON 1270 * Message body: "In order to recover from errors, a component reset is 1271 * recommended with the Reset action URI <arg1> and ResetType <arg2>." 1272 * 1273 * @param[in] arg1 Parameter of message that will replace %1 in its body. 1274 * @param[in] arg2 Parameter of message that will replace %2 in its body. 1275 * 1276 * @returns Message ResetRecommended formatted to JSON */ 1277 nlohmann::json resetRecommended(std::string_view arg1, std::string_view arg2); 1278 1279 void resetRecommended(crow::Response& res, std::string_view arg1, 1280 std::string_view arg2); 1281 1282 /** 1283 * @brief Formats ActionParameterValueConflict message into JSON 1284 * Message body: "The parameter <arg1> with the requested value of <arg2> does 1285 * not meet the constraints of the implementation." 1286 * 1287 * @param[in] arg1 Parameter of message that will replace %1 in its body. 1288 * @param[in] arg2 Parameter of message that will replace %2 in its body. 1289 * 1290 * @returns Message ActionParameterValueConflict formatted to JSON */ 1291 nlohmann::json 1292 actionParameterValueConflict(std::string_view arg1, std::string_view arg2); 1293 1294 void actionParameterValueConflict(crow::Response& res, std::string_view arg1, 1295 std::string_view arg2); 1296 1297 /** 1298 * @brief Formats HeaderMissing message into JSON 1299 * Message body: "Required header <arg1> is missing in the request." 1300 * 1301 * @param[in] arg1 Parameter of message that will replace %1 in its body. 1302 * 1303 * @returns Message HeaderMissing formatted to JSON */ 1304 nlohmann::json headerMissing(std::string_view arg1); 1305 1306 void headerMissing(crow::Response& res, std::string_view arg1); 1307 1308 /** 1309 * @brief Formats HeaderInvalid message into JSON 1310 * Message body: "Header <arg1> is invalid." 1311 * 1312 * @param[in] arg1 Parameter of message that will replace %1 in its body. 1313 * 1314 * @returns Message HeaderInvalid formatted to JSON */ 1315 nlohmann::json headerInvalid(std::string_view arg1); 1316 1317 void headerInvalid(crow::Response& res, std::string_view arg1); 1318 1319 /** 1320 * @brief Formats UndeterminedFault message into JSON 1321 * Message body: "An undetermined fault condition was reported by <arg1>." 1322 * 1323 * @param[in] arg1 Parameter of message that will replace %1 in its body. 1324 * 1325 * @returns Message UndeterminedFault formatted to JSON */ 1326 nlohmann::json undeterminedFault(std::string_view arg1); 1327 1328 void undeterminedFault(crow::Response& res, std::string_view arg1); 1329 1330 /** 1331 * @brief Formats ConditionInRelatedResource message into JSON 1332 * Message body: "One or more conditions exist in a related resource. See the 1333 * OriginOfCondition property." 1334 * 1335 * 1336 * @returns Message ConditionInRelatedResource formatted to JSON */ 1337 nlohmann::json conditionInRelatedResource(); 1338 1339 void conditionInRelatedResource(crow::Response& res); 1340 1341 /** 1342 * @brief Formats RestrictedRole message into JSON 1343 * Message body: "The operation was not successful because the role <arg1> is 1344 * restricted." 1345 * 1346 * @param[in] arg1 Parameter of message that will replace %1 in its body. 1347 * 1348 * @returns Message RestrictedRole formatted to JSON */ 1349 nlohmann::json restrictedRole(std::string_view arg1); 1350 1351 void restrictedRole(crow::Response& res, std::string_view arg1); 1352 1353 /** 1354 * @brief Formats RestrictedPrivilege message into JSON 1355 * Message body: "The operation was not successful because the privilege <arg1> 1356 * is restricted." 1357 * 1358 * @param[in] arg1 Parameter of message that will replace %1 in its body. 1359 * 1360 * @returns Message RestrictedPrivilege formatted to JSON */ 1361 nlohmann::json restrictedPrivilege(std::string_view arg1); 1362 1363 void restrictedPrivilege(crow::Response& res, std::string_view arg1); 1364 1365 /** 1366 * @brief Formats PropertyDeprecated message into JSON 1367 * Message body: "The deprecated property <arg1> was included in the request 1368 * body." 1369 * 1370 * @param[in] arg1 Parameter of message that will replace %1 in its body. 1371 * 1372 * @returns Message PropertyDeprecated formatted to JSON */ 1373 nlohmann::json propertyDeprecated(std::string_view arg1); 1374 1375 void propertyDeprecated(crow::Response& res, std::string_view arg1); 1376 1377 /** 1378 * @brief Formats ResourceDeprecated message into JSON 1379 * Message body: "The operation was performed on a deprecated resource <arg1>." 1380 * 1381 * @param[in] arg1 Parameter of message that will replace %1 in its body. 1382 * 1383 * @returns Message ResourceDeprecated formatted to JSON */ 1384 nlohmann::json resourceDeprecated(std::string_view arg1); 1385 1386 void resourceDeprecated(crow::Response& res, std::string_view arg1); 1387 1388 /** 1389 * @brief Formats PropertyValueDeprecated message into JSON 1390 * Message body: "The value <arg1> for the property <arg2> is deprecated." 1391 * 1392 * @param[in] arg1 Parameter of message that will replace %1 in its body. 1393 * @param[in] arg2 Parameter of message that will replace %2 in its body. 1394 * 1395 * @returns Message PropertyValueDeprecated formatted to JSON */ 1396 nlohmann::json propertyValueDeprecated(std::string_view arg1, 1397 std::string_view arg2); 1398 1399 void propertyValueDeprecated(crow::Response& res, std::string_view arg1, 1400 std::string_view arg2); 1401 1402 /** 1403 * @brief Formats ActionDeprecated message into JSON 1404 * Message body: "The action <arg1> is deprecated." 1405 * 1406 * @param[in] arg1 Parameter of message that will replace %1 in its body. 1407 * 1408 * @returns Message ActionDeprecated formatted to JSON */ 1409 nlohmann::json actionDeprecated(std::string_view arg1); 1410 1411 void actionDeprecated(crow::Response& res, std::string_view arg1); 1412 1413 /** 1414 * @brief Formats NetworkNameResolutionNotConfigured message into JSON 1415 * Message body: "Network name resolution is not configured on this service." 1416 * 1417 * 1418 * @returns Message NetworkNameResolutionNotConfigured formatted to JSON */ 1419 nlohmann::json networkNameResolutionNotConfigured(); 1420 1421 void networkNameResolutionNotConfigured(crow::Response& res); 1422 1423 /** 1424 * @brief Formats NetworkNameResolutionNotSupported message into JSON 1425 * Message body: "Resolution of network-based names is not supported by this 1426 * service." 1427 * 1428 * 1429 * @returns Message NetworkNameResolutionNotSupported formatted to JSON */ 1430 nlohmann::json networkNameResolutionNotSupported(); 1431 1432 void networkNameResolutionNotSupported(crow::Response& res); 1433 1434 /** 1435 * @brief Formats AuthenticationTokenRequired message into JSON 1436 * Message body: "The request could not be performed because an authentication 1437 * token was not provided." 1438 * 1439 * 1440 * @returns Message AuthenticationTokenRequired formatted to JSON */ 1441 nlohmann::json authenticationTokenRequired(); 1442 1443 void authenticationTokenRequired(crow::Response& res); 1444 1445 /** 1446 * @brief Formats OneTimePasscodeSent message into JSON 1447 * Message body: "A one-time passcode was sent to: <arg1>. Supply the passcode 1448 * as the `Token` property in the request to create a session." 1449 * 1450 * @param[in] arg1 Parameter of message that will replace %1 in its body. 1451 * 1452 * @returns Message OneTimePasscodeSent formatted to JSON */ 1453 nlohmann::json oneTimePasscodeSent(std::string_view arg1); 1454 1455 void oneTimePasscodeSent(crow::Response& res, std::string_view arg1); 1456 1457 /** 1458 * @brief Formats LicenseRequired message into JSON 1459 * Message body: "A license is required for this operation: <arg1>." 1460 * 1461 * @param[in] arg1 Parameter of message that will replace %1 in its body. 1462 * 1463 * @returns Message LicenseRequired formatted to JSON */ 1464 nlohmann::json licenseRequired(std::string_view arg1); 1465 1466 void licenseRequired(crow::Response& res, std::string_view arg1); 1467 1468 /** 1469 * @brief Formats PropertyModified message into JSON 1470 * Message body: "One or more properties were successfully modified." 1471 * 1472 * 1473 * @returns Message PropertyModified formatted to JSON */ 1474 nlohmann::json propertyModified(); 1475 1476 void propertyModified(crow::Response& res); 1477 1478 } // namespace messages 1479 } // namespace redfish 1480