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