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