1 /* 2 // Copyright (c) 2018 Intel Corporation 3 // 4 // Licensed under the Apache License, Version 2.0 (the "License"); 5 // you may not use this file except in compliance with the License. 6 // You may obtain a copy of the License at 7 // 8 // http://www.apache.org/licenses/LICENSE-2.0 9 // 10 // Unless required by applicable law or agreed to in writing, software 11 // distributed under the License is distributed on an "AS IS" BASIS, 12 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 // See the License for the specific language governing permissions and 14 // limitations under the License. 15 */ 16 /**************************************************************** 17 * This is an auto-generated header which contains definitions 18 * to use Redfish DMTF defined messages. 19 * 20 * This header contains preprocessor defines which wrap 21 * preparation functions for message with given id. The message 22 * ids can be retrieved from Base.__ver__.json file. 23 ***************************************************************/ 24 #pragma once 25 #include "http_response.h" 26 27 #include <nlohmann/json.hpp> 28 29 namespace redfish 30 { 31 32 namespace messages 33 { 34 35 constexpr const char* messageVersionPrefix = "Base.1.2.0."; 36 constexpr const char* messageAnnotation = "@Message.ExtendedInfo"; 37 38 /** 39 * @brief Formats ResourceInUse message into JSON 40 * Message body: "The change to the requested resource failed because the 41 * resource is in use or in transition." 42 * 43 * 44 * @returns Message ResourceInUse formatted to JSON */ 45 nlohmann::json resourceInUse(void); 46 47 void resourceInUse(crow::Response& res); 48 49 /** 50 * @brief Formats MalformedJSON message into JSON 51 * Message body: "The request body submitted was malformed JSON and could not be 52 * parsed by the receiving service." 53 * 54 * 55 * @returns Message MalformedJSON formatted to JSON */ 56 nlohmann::json malformedJSON(void); 57 58 void malformedJSON(crow::Response& res); 59 60 /** 61 * @brief Formats ResourceMissingAtURI message into JSON 62 * Message body: "The resource at the URI <arg1> was not found." 63 * 64 * @param[in] arg1 Parameter of message that will replace %1 in its body. 65 * 66 * @returns Message ResourceMissingAtURI formatted to JSON */ 67 nlohmann::json resourceMissingAtURI(const std::string& arg1); 68 69 void resourceMissingAtURI(crow::Response& res, const std::string& arg1); 70 71 /** 72 * @brief Formats ActionParameterValueFormatError message into JSON 73 * Message body: "The value <arg1> for the parameter <arg2> in the action <arg3> 74 * is of a different format than the parameter can accept." 75 * 76 * @param[in] arg1 Parameter of message that will replace %1 in its body. 77 * @param[in] arg2 Parameter of message that will replace %2 in its body. 78 * @param[in] arg3 Parameter of message that will replace %3 in its body. 79 * 80 * @returns Message ActionParameterValueFormatError formatted to JSON */ 81 nlohmann::json actionParameterValueFormatError(const std::string& arg1, 82 const std::string& arg2, 83 const std::string& arg3); 84 85 void actionParameterValueFormatError(crow::Response& res, 86 const std::string& arg1, 87 const std::string& arg2, 88 const std::string& arg3); 89 90 /** 91 * @brief Formats InternalError message into JSON 92 * Message body: "The request failed due to an internal service error. The 93 * service is still operational." 94 * 95 * 96 * @returns Message InternalError formatted to JSON */ 97 nlohmann::json internalError(void); 98 99 void internalError(crow::Response& res); 100 101 /** 102 * @brief Formats UnrecognizedRequestBody message into JSON 103 * Message body: "The service detected a malformed request body that it was 104 * unable to interpret." 105 * 106 * 107 * @returns Message UnrecognizedRequestBody formatted to JSON */ 108 nlohmann::json unrecognizedRequestBody(void); 109 110 void unrecognizedRequestBody(crow::Response& res); 111 112 /** 113 * @brief Formats ResourceAtUriUnauthorized message into JSON 114 * Message body: "While accessing the resource at <arg1>, the service received 115 * an authorization error <arg2>." 116 * 117 * @param[in] arg1 Parameter of message that will replace %1 in its body. 118 * @param[in] arg2 Parameter of message that will replace %2 in its body. 119 * 120 * @returns Message ResourceAtUriUnauthorized formatted to JSON */ 121 nlohmann::json resourceAtUriUnauthorized(const std::string& arg1, 122 const std::string& arg2); 123 124 void resourceAtUriUnauthorized(crow::Response& res, const std::string& arg1, 125 const std::string& arg2); 126 127 /** 128 * @brief Formats ActionParameterUnknown message into JSON 129 * Message body: "The action <arg1> was submitted with the invalid parameter 130 * <arg2>." 131 * 132 * @param[in] arg1 Parameter of message that will replace %1 in its body. 133 * @param[in] arg2 Parameter of message that will replace %2 in its body. 134 * 135 * @returns Message ActionParameterUnknown formatted to JSON */ 136 nlohmann::json actionParameterUnknown(const std::string& arg1, 137 const std::string& arg2); 138 139 void actionParameterUnknown(crow::Response& res, const std::string& arg1, 140 const std::string& arg2); 141 142 /** 143 * @brief Formats ResourceCannotBeDeleted message into JSON 144 * Message body: "The delete request failed because the resource requested 145 * cannot be deleted." 146 * 147 * 148 * @returns Message ResourceCannotBeDeleted formatted to JSON */ 149 nlohmann::json resourceCannotBeDeleted(void); 150 151 void resourceCannotBeDeleted(crow::Response& res); 152 153 /** 154 * @brief Formats PropertyDuplicate message into JSON 155 * Message body: "The property <arg1> was duplicated in the request." 156 * 157 * @param[in] arg1 Parameter of message that will replace %1 in its body. 158 * 159 * @returns Message PropertyDuplicate formatted to JSON */ 160 nlohmann::json propertyDuplicate(const std::string& arg1); 161 162 void propertyDuplicate(crow::Response& res, const std::string& arg1); 163 164 /** 165 * @brief Formats ServiceTemporarilyUnavailable message into JSON 166 * Message body: "The service is temporarily unavailable. Retry in <arg1> 167 * seconds." 168 * 169 * @param[in] arg1 Parameter of message that will replace %1 in its body. 170 * 171 * @returns Message ServiceTemporarilyUnavailable formatted to JSON */ 172 nlohmann::json serviceTemporarilyUnavailable(const std::string& arg1); 173 174 void serviceTemporarilyUnavailable(crow::Response& res, 175 const std::string& arg1); 176 177 /** 178 * @brief Formats ResourceAlreadyExists message into JSON 179 * Message body: "The requested resource of type <arg1> with the property <arg2> 180 * with the value <arg3> already exists." 181 * 182 * @param[in] arg1 Parameter of message that will replace %1 in its body. 183 * @param[in] arg2 Parameter of message that will replace %2 in its body. 184 * @param[in] arg3 Parameter of message that will replace %3 in its body. 185 * 186 * @returns Message ResourceAlreadyExists formatted to JSON */ 187 nlohmann::json resourceAlreadyExists(const std::string& arg1, 188 const std::string& arg2, 189 const std::string& arg3); 190 191 void resourceAlreadyExists(crow::Response& res, const std::string& arg1, 192 const std::string& arg2, const std::string& arg3); 193 194 /** 195 * @brief Formats AccountForSessionNoLongerExists message into JSON 196 * Message body: "The account for the current session has been removed, thus the 197 * current session has been removed as well." 198 * 199 * 200 * @returns Message AccountForSessionNoLongerExists formatted to JSON */ 201 nlohmann::json accountForSessionNoLongerExists(void); 202 203 void accountForSessionNoLongerExists(crow::Response& res); 204 205 /** 206 * @brief Formats CreateFailedMissingReqProperties message into JSON 207 * Message body: "The create operation failed because the required property 208 * <arg1> was missing from the request." 209 * 210 * @param[in] arg1 Parameter of message that will replace %1 in its body. 211 * 212 * @returns Message CreateFailedMissingReqProperties formatted to JSON */ 213 nlohmann::json createFailedMissingReqProperties(const std::string& arg1); 214 215 void createFailedMissingReqProperties(crow::Response& res, 216 const std::string& arg1); 217 218 /** 219 * @brief Formats PropertyValueFormatError message into JSON 220 * Message body: "The value <arg1> for the property <arg2> is of a different 221 * format than the property can accept." 222 * 223 * @param[in] arg1 Parameter of message that will replace %1 in its body. 224 * @param[in] arg2 Parameter of message that will replace %2 in its body. 225 * 226 * @returns Message PropertyValueFormatError formatted to JSON */ 227 nlohmann::json propertyValueFormatError(const std::string& arg1, 228 const std::string& arg2); 229 230 void propertyValueFormatError(crow::Response& res, const std::string& arg1, 231 const std::string& arg2); 232 233 /** 234 * @brief Formats PropertyValueNotInList message into JSON 235 * Message body: "The value <arg1> for the property <arg2> is not in the list of 236 * acceptable values." 237 * 238 * @param[in] arg1 Parameter of message that will replace %1 in its body. 239 * @param[in] arg2 Parameter of message that will replace %2 in its body. 240 * 241 * @returns Message PropertyValueNotInList formatted to JSON */ 242 nlohmann::json propertyValueNotInList(const std::string& arg1, 243 const std::string& arg2); 244 245 void propertyValueNotInList(crow::Response& res, const std::string& arg1, 246 const std::string& arg2); 247 248 /** 249 * @brief Formats ResourceAtUriInUnknownFormat message into JSON 250 * Message body: "The resource at <arg1> is in a format not recognized by the 251 * service." 252 * 253 * @param[in] arg1 Parameter of message that will replace %1 in its body. 254 * 255 * @returns Message ResourceAtUriInUnknownFormat formatted to JSON */ 256 nlohmann::json resourceAtUriInUnknownFormat(const std::string& arg1); 257 258 void resourceAtUriInUnknownFormat(crow::Response& res, const std::string& arg1); 259 260 /** 261 * @brief Formats ServiceInUnknownState message into JSON 262 * Message body: "The operation failed because the service is in an unknown 263 * state and can no longer take incoming requests." 264 * 265 * 266 * @returns Message ServiceInUnknownState formatted to JSON */ 267 nlohmann::json serviceInUnknownState(void); 268 269 void serviceInUnknownState(crow::Response& res); 270 271 /** 272 * @brief Formats EventSubscriptionLimitExceeded message into JSON 273 * Message body: "The event subscription failed due to the number of 274 * simultaneous subscriptions exceeding the limit of the implementation." 275 * 276 * 277 * @returns Message EventSubscriptionLimitExceeded formatted to JSON */ 278 nlohmann::json eventSubscriptionLimitExceeded(void); 279 280 void eventSubscriptionLimitExceeded(crow::Response& res); 281 282 /** 283 * @brief Formats ActionParameterMissing message into JSON 284 * Message body: "The action <arg1> requires the parameter <arg2> to be present 285 * in the request body." 286 * 287 * @param[in] arg1 Parameter of message that will replace %1 in its body. 288 * @param[in] arg2 Parameter of message that will replace %2 in its body. 289 * 290 * @returns Message ActionParameterMissing formatted to JSON */ 291 nlohmann::json actionParameterMissing(const std::string& arg1, 292 const std::string& arg2); 293 294 void actionParameterMissing(crow::Response& res, const std::string& arg1, 295 const std::string& arg2); 296 297 /** 298 * @brief Formats StringValueTooLong message into JSON 299 * Message body: "The string <arg1> exceeds the length limit <arg2>." 300 * 301 * @param[in] arg1 Parameter of message that will replace %1 in its body. 302 * @param[in] arg2 Parameter of message that will replace %2 in its body. 303 * 304 * @returns Message StringValueTooLong formatted to JSON */ 305 nlohmann::json stringValueTooLong(const std::string& arg1, const int& arg2); 306 307 void stringValueTooLong(crow::Response& res, const std::string& arg1, 308 const int& arg2); 309 310 /** 311 * @brief Formats SessionTerminated message into JSON 312 * Message body: "The session was successfully terminated." 313 * 314 * 315 * @returns Message SessionTerminated formatted to JSON */ 316 nlohmann::json sessionTerminated(void); 317 318 void sessionTerminated(crow::Response& res); 319 320 /** 321 * @brief Formats ResourceTypeIncompatible message into JSON 322 * Message body: "The @odata.type of the request body <arg1> is incompatible 323 * with the @odata.type of the resource which is <arg2>." 324 * 325 * @param[in] arg1 Parameter of message that will replace %1 in its body. 326 * @param[in] arg2 Parameter of message that will replace %2 in its body. 327 * 328 * @returns Message ResourceTypeIncompatible formatted to JSON */ 329 nlohmann::json resourceTypeIncompatible(const std::string& arg1, 330 const std::string& arg2); 331 332 void resourceTypeIncompatible(crow::Response& res, const std::string& arg1, 333 const std::string& arg2); 334 335 /** 336 * @brief Formats PropertyValueTypeError message into JSON 337 * Message body: "The value <arg1> for the property <arg2> is of a different 338 * type than the property can accept." 339 * 340 * @param[in] arg1 Parameter of message that will replace %1 in its body. 341 * @param[in] arg2 Parameter of message that will replace %2 in its body. 342 * 343 * @returns Message PropertyValueTypeError formatted to JSON */ 344 nlohmann::json propertyValueTypeError(const std::string& arg1, 345 const std::string& arg2); 346 347 void propertyValueTypeError(crow::Response& res, const std::string& arg1, 348 const std::string& arg2); 349 350 /** 351 * @brief Formats ResourceNotFound message into JSON 352 * Message body: "The requested resource of type <arg1> named <arg2> was not 353 * found." 354 * 355 * @param[in] arg1 Parameter of message that will replace %1 in its body. 356 * @param[in] arg2 Parameter of message that will replace %2 in its body. 357 * 358 * @returns Message ResourceNotFound formatted to JSON */ 359 nlohmann::json resourceNotFound(const std::string& arg1, 360 const std::string& arg2); 361 362 void resourceNotFound(crow::Response& res, const std::string& arg1, 363 const std::string& arg2); 364 365 /** 366 * @brief Formats CouldNotEstablishConnection message into JSON 367 * Message body: "The service failed to establish a Connection with the URI 368 * <arg1>." 369 * 370 * @param[in] arg1 Parameter of message that will replace %1 in its body. 371 * 372 * @returns Message CouldNotEstablishConnection formatted to JSON */ 373 nlohmann::json couldNotEstablishConnection(const std::string& arg1); 374 375 void couldNotEstablishConnection(crow::Response& res, const std::string& arg1); 376 377 /** 378 * @brief Formats PropertyNotWritable message into JSON 379 * Message body: "The property <arg1> is a read only property and cannot be 380 * assigned a value." 381 * 382 * @param[in] arg1 Parameter of message that will replace %1 in its body. 383 * 384 * @returns Message PropertyNotWritable formatted to JSON */ 385 nlohmann::json propertyNotWritable(const std::string& arg1); 386 387 void propertyNotWritable(crow::Response& res, const std::string& arg1); 388 389 /** 390 * @brief Formats QueryParameterValueTypeError message into JSON 391 * Message body: "The value <arg1> for the query parameter <arg2> is of a 392 * different type than the parameter can accept." 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 QueryParameterValueTypeError formatted to JSON */ 398 nlohmann::json queryParameterValueTypeError(const std::string& arg1, 399 const std::string& arg2); 400 401 void queryParameterValueTypeError(crow::Response& res, const std::string& arg1, 402 const std::string& arg2); 403 404 /** 405 * @brief Formats ServiceShuttingDown message into JSON 406 * Message body: "The operation failed because the service is shutting down and 407 * can no longer take incoming requests." 408 * 409 * 410 * @returns Message ServiceShuttingDown formatted to JSON */ 411 nlohmann::json serviceShuttingDown(void); 412 413 void serviceShuttingDown(crow::Response& res); 414 415 /** 416 * @brief Formats ActionParameterDuplicate message into JSON 417 * Message body: "The action <arg1> was submitted with more than one value for 418 * the parameter <arg2>." 419 * 420 * @param[in] arg1 Parameter of message that will replace %1 in its body. 421 * @param[in] arg2 Parameter of message that will replace %2 in its body. 422 * 423 * @returns Message ActionParameterDuplicate formatted to JSON */ 424 nlohmann::json actionParameterDuplicate(const std::string& arg1, 425 const std::string& arg2); 426 427 void actionParameterDuplicate(crow::Response& res, const std::string& arg1, 428 const std::string& arg2); 429 430 /** 431 * @brief Formats ActionParameterNotSupported message into JSON 432 * Message body: "The parameter <arg1> for the action <arg2> is not supported on 433 * the target resource." 434 * 435 * @param[in] arg1 Parameter of message that will replace %1 in its body. 436 * @param[in] arg2 Parameter of message that will replace %2 in its body. 437 * 438 * @returns Message ActionParameterNotSupported formatted to JSON */ 439 nlohmann::json actionParameterNotSupported(const std::string& arg1, 440 const std::string& arg2); 441 442 void actionParameterNotSupported(crow::Response& res, const std::string& arg1, 443 const std::string& arg2); 444 445 /** 446 * @brief Formats SourceDoesNotSupportProtocol message into JSON 447 * Message body: "The other end of the Connection at <arg1> does not support the 448 * specified protocol <arg2>." 449 * 450 * @param[in] arg1 Parameter of message that will replace %1 in its body. 451 * @param[in] arg2 Parameter of message that will replace %2 in its body. 452 * 453 * @returns Message SourceDoesNotSupportProtocol formatted to JSON */ 454 nlohmann::json sourceDoesNotSupportProtocol(const std::string& arg1, 455 const std::string& arg2); 456 457 void sourceDoesNotSupportProtocol(crow::Response& res, const std::string& arg1, 458 const std::string& arg2); 459 460 /** 461 * @brief Formats AccountRemoved message into JSON 462 * Message body: "The account was successfully removed." 463 * 464 * 465 * @returns Message AccountRemoved formatted to JSON */ 466 nlohmann::json accountRemoved(void); 467 468 void accountRemoved(crow::Response& res); 469 470 /** 471 * @brief Formats AccessDenied message into JSON 472 * Message body: "While attempting to establish a Connection to <arg1>, the 473 * service denied access." 474 * 475 * @param[in] arg1 Parameter of message that will replace %1 in its body. 476 * 477 * @returns Message AccessDenied formatted to JSON */ 478 nlohmann::json accessDenied(const std::string& arg1); 479 480 void accessDenied(crow::Response& res, const std::string& arg1); 481 482 /** 483 * @brief Formats QueryNotSupported message into JSON 484 * Message body: "Querying is not supported by the implementation." 485 * 486 * 487 * @returns Message QueryNotSupported formatted to JSON */ 488 nlohmann::json queryNotSupported(void); 489 490 void queryNotSupported(crow::Response& res); 491 492 /** 493 * @brief Formats CreateLimitReachedForResource message into JSON 494 * Message body: "The create operation failed because the resource has reached 495 * the limit of possible resources." 496 * 497 * 498 * @returns Message CreateLimitReachedForResource formatted to JSON */ 499 nlohmann::json createLimitReachedForResource(void); 500 501 void createLimitReachedForResource(crow::Response& res); 502 503 /** 504 * @brief Formats GeneralError message into JSON 505 * Message body: "A general error has occurred. See ExtendedInfo for more 506 * information." 507 * 508 * 509 * @returns Message GeneralError formatted to JSON */ 510 nlohmann::json generalError(void); 511 512 void generalError(crow::Response& res); 513 514 /** 515 * @brief Formats Success message into JSON 516 * Message body: "Successfully Completed Request" 517 * 518 * 519 * @returns Message Success formatted to JSON */ 520 nlohmann::json success(void); 521 522 void success(crow::Response& res); 523 524 /** 525 * @brief Formats Created message into JSON 526 * Message body: "The resource has been created successfully" 527 * 528 * 529 * @returns Message Created formatted to JSON */ 530 nlohmann::json created(void); 531 532 void created(crow::Response& res); 533 534 /** 535 * @brief Formats NoOperation message into JSON 536 * Message body: "The request body submitted contain no data to act upon and 537 * no changes to the resource took place." 538 * 539 * 540 * @returns Message NoOperation formatted to JSON */ 541 nlohmann::json noOperation(void); 542 543 void noOperation(crow::Response& res); 544 545 /** 546 * @brief Formats PropertyUnknown message into JSON 547 * Message body: "The property <arg1> is not in the list of valid properties for 548 * the resource." 549 * 550 * @param[in] arg1 Parameter of message that will replace %1 in its body. 551 * 552 * @returns Message PropertyUnknown formatted to JSON */ 553 nlohmann::json propertyUnknown(const std::string& arg1); 554 555 void propertyUnknown(crow::Response& res, const std::string& arg1); 556 557 /** 558 * @brief Formats NoValidSession message into JSON 559 * Message body: "There is no valid session established with the 560 * implementation." 561 * 562 * 563 * @returns Message NoValidSession formatted to JSON */ 564 nlohmann::json noValidSession(void); 565 566 void noValidSession(crow::Response& res); 567 568 /** 569 * @brief Formats InvalidObject message into JSON 570 * Message body: "The object at <arg1> is invalid." 571 * 572 * @param[in] arg1 Parameter of message that will replace %1 in its body. 573 * 574 * @returns Message InvalidObject formatted to JSON */ 575 nlohmann::json invalidObject(const std::string& arg1); 576 577 void invalidObject(crow::Response& res, const std::string& arg1); 578 579 /** 580 * @brief Formats ResourceInStandby message into JSON 581 * Message body: "The request could not be performed because the resource is in 582 * standby." 583 * 584 * 585 * @returns Message ResourceInStandby formatted to JSON */ 586 nlohmann::json resourceInStandby(void); 587 588 void resourceInStandby(crow::Response& res); 589 590 /** 591 * @brief Formats ActionParameterValueTypeError message into JSON 592 * Message body: "The value <arg1> for the parameter <arg2> in the action <arg3> 593 * is of a different type than the parameter can accept." 594 * 595 * @param[in] arg1 Parameter of message that will replace %1 in its body. 596 * @param[in] arg2 Parameter of message that will replace %2 in its body. 597 * @param[in] arg3 Parameter of message that will replace %3 in its body. 598 * 599 * @returns Message ActionParameterValueTypeError formatted to JSON */ 600 nlohmann::json actionParameterValueTypeError(const std::string& arg1, 601 const std::string& arg2, 602 const std::string& arg3); 603 604 void actionParameterValueTypeError(crow::Response& res, const std::string& arg1, 605 const std::string& arg2, 606 const std::string& arg3); 607 608 /** 609 * @brief Formats SessionLimitExceeded message into JSON 610 * Message body: "The session establishment failed due to the number of 611 * simultaneous sessions exceeding the limit of the implementation." 612 * 613 * 614 * @returns Message SessionLimitExceeded formatted to JSON */ 615 nlohmann::json sessionLimitExceeded(void); 616 617 void sessionLimitExceeded(crow::Response& res); 618 619 /** 620 * @brief Formats ActionNotSupported message into JSON 621 * Message body: "The action <arg1> is not supported by the resource." 622 * 623 * @param[in] arg1 Parameter of message that will replace %1 in its body. 624 * 625 * @returns Message ActionNotSupported formatted to JSON */ 626 nlohmann::json actionNotSupported(const std::string& arg1); 627 628 void actionNotSupported(crow::Response& res, const std::string& arg1); 629 630 /** 631 * @brief Formats InvalidIndex message into JSON 632 * Message body: "The index <arg1> is not a valid offset into the array." 633 * 634 * @param[in] arg1 Parameter of message that will replace %1 in its body. 635 * 636 * @returns Message InvalidIndex formatted to JSON */ 637 nlohmann::json invalidIndex(const int& arg1); 638 639 void invalidIndex(crow::Response& res, const int& arg1); 640 641 /** 642 * @brief Formats EmptyJSON message into JSON 643 * Message body: "The request body submitted contained an empty JSON object and 644 * the service is unable to process it." 645 * 646 * 647 * @returns Message EmptyJSON formatted to JSON */ 648 nlohmann::json emptyJSON(void); 649 650 void emptyJSON(crow::Response& res); 651 652 /** 653 * @brief Formats QueryNotSupportedOnResource message into JSON 654 * Message body: "Querying is not supported on the requested resource." 655 * 656 * 657 * @returns Message QueryNotSupportedOnResource formatted to JSON */ 658 nlohmann::json queryNotSupportedOnResource(void); 659 660 void queryNotSupportedOnResource(crow::Response& res); 661 662 /** 663 * @brief Formats InsufficientPrivilege message into JSON 664 * Message body: "There are insufficient privileges for the account or 665 * credentials associated with the current session to perform the requested 666 * operation." 667 * 668 * 669 * @returns Message InsufficientPrivilege formatted to JSON */ 670 nlohmann::json insufficientPrivilege(void); 671 672 void insufficientPrivilege(crow::Response& res); 673 674 /** 675 * @brief Formats PropertyValueModified message into JSON 676 * Message body: "The property <arg1> was assigned the value <arg2> due to 677 * modification by the service." 678 * 679 * @param[in] arg1 Parameter of message that will replace %1 in its body. 680 * @param[in] arg2 Parameter of message that will replace %2 in its body. 681 * 682 * @returns Message PropertyValueModified formatted to JSON */ 683 nlohmann::json propertyValueModified(const std::string& arg1, 684 const std::string& arg2); 685 686 void propertyValueModified(crow::Response& res, const std::string& arg1, 687 const std::string& arg2); 688 689 /** 690 * @brief Formats AccountNotModified message into JSON 691 * Message body: "The account modification request failed." 692 * 693 * 694 * @returns Message AccountNotModified formatted to JSON */ 695 nlohmann::json accountNotModified(void); 696 697 void accountNotModified(crow::Response& res); 698 699 /** 700 * @brief Formats QueryParameterValueFormatError message into JSON 701 * Message body: "The value <arg1> for the parameter <arg2> is of a different 702 * format than the parameter can accept." 703 * 704 * @param[in] arg1 Parameter of message that will replace %1 in its body. 705 * @param[in] arg2 Parameter of message that will replace %2 in its body. 706 * 707 * @returns Message QueryParameterValueFormatError formatted to JSON */ 708 709 nlohmann::json queryParameterValueFormatError(const std::string& arg1, 710 const std::string& arg2); 711 712 void queryParameterValueFormatError(crow::Response& res, 713 const std::string& arg1, 714 const std::string& arg2); 715 716 /** 717 * @brief Formats PropertyMissing message into JSON 718 * Message body: "The property <arg1> is a required property and must be 719 * included in the request." 720 * 721 * @param[in] arg1 Parameter of message that will replace %1 in its body. 722 * 723 * @returns Message PropertyMissing formatted to JSON */ 724 nlohmann::json propertyMissing(const std::string& arg1); 725 726 void propertyMissing(crow::Response& res, const std::string& arg1); 727 728 /** 729 * @brief Formats ResourceExhaustion message into JSON 730 * Message body: "The resource <arg1> was unable to satisfy the request due to 731 * unavailability of resources." 732 * 733 * @param[in] arg1 Parameter of message that will replace %1 in its body. 734 * 735 * @returns Message ResourceExhaustion formatted to JSON */ 736 nlohmann::json resourceExhaustion(const std::string& arg1); 737 738 void resourceExhaustion(crow::Response& res, const std::string& arg1); 739 740 /** 741 * @brief Formats AccountModified message into JSON 742 * Message body: "The account was successfully modified." 743 * 744 * 745 * @returns Message AccountModified formatted to JSON */ 746 nlohmann::json accountModified(void); 747 748 void accountModified(crow::Response& res); 749 750 /** 751 * @brief Formats QueryParameterOutOfRange message into JSON 752 * Message body: "The value <arg1> for the query parameter <arg2> is out of 753 * range <arg3>." 754 * 755 * @param[in] arg1 Parameter of message that will replace %1 in its body. 756 * @param[in] arg2 Parameter of message that will replace %2 in its body. 757 * @param[in] arg3 Parameter of message that will replace %3 in its body. 758 * 759 * @returns Message QueryParameterOutOfRange formatted to JSON */ 760 nlohmann::json queryParameterOutOfRange(const std::string& arg1, 761 const std::string& arg2, 762 const std::string& arg3); 763 764 void queryParameterOutOfRange(crow::Response& res, const std::string& arg1, 765 const std::string& arg2, const std::string& arg3); 766 767 /** 768 * @brief Formats PasswordChangeRequired message into JSON 769 * Message body: The password provided for this account must be changed 770 * before access is granted. PATCH the 'Password' property for this 771 * account located at the target URI '%1' to complete this process. 772 * 773 * @param[in] arg1 Parameter of message that will replace %1 in its body. 774 * 775 * @returns Message PasswordChangeRequired formatted to JSON */ 776 void passwordChangeRequired(crow::Response& res, const std::string& arg1); 777 778 /** 779 * @brief Formats InvalidUpload message into JSON 780 * Message body: Invalid file uploaded to %1: %2.* 781 * @param[in] arg1 Parameter of message that will replace %1 in its body. 782 * @param[in] arg2 Parameter of message that will replace %2 in its body. 783 * 784 * @returns Message InvalidUpload formatted to JSON */ 785 nlohmann::json invalidUpload(const std::string& arg1, const std::string& arg2); 786 787 void invalidUpload(crow::Response& res, const std::string& arg1, 788 const std::string& arg2); 789 790 /** 791 * @brief Formats MutualExclusiveProperties message into JSON 792 * Message body: "The properties <arg1> and <arg2> are mutually exclusive." 793 * 794 * @param[in] arg1 Parameter of message that will replace %1 in its body. 795 * @param[in] arg2 Parameter of message that will replace %2 in its body. 796 * 797 * @returns Message MutualExclusiveProperties formatted to JSON */ 798 nlohmann::json mutualExclusiveProperties(const std::string& arg1, 799 const std::string& arg2); 800 801 void mutualExclusiveProperties(crow::Response& res, const std::string& arg1, 802 const std::string& arg2); 803 804 } // namespace messages 805 806 } // namespace redfish 807