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