15#include <nlohmann/json.hpp>
64 nlohmann::json
const &
json() const noexcept {
return _json; }
67 nlohmann::json
result() const noexcept;
Macro-based enum <-> string utilities for dfx.
#define DECLARE_ENUM_STRING_FUNCTIONS(E)
Declare the enum string API (and std::formatter) for enum type E.
Definition EnumString.hpp:327
Type
High-level message category.
Definition Message.hpp:42
@ Success
Message represents a successful response.
Definition Message.hpp:43
@ Error
Message represents a failure response.
Definition Message.hpp:44
Type type() const noexcept
Return the message type determined at construction.
Definition Message.hpp:61
nlohmann::json result() const noexcept
Extract the "result" portion (if any) of the message.
std::vector< std::string > errors() const
Extract the error list from the message.
nlohmann::json const & json() const noexcept
Access the underlying JSON payload (read-only).
Definition Message.hpp:64
bool isError() const noexcept
True if this message represents an error response.
Definition Message.hpp:59
bool isOk() const noexcept
True if this message represents a successful response.
Definition Message.hpp:57
Message(nlohmann::json json)
Construct a message wrapper from a JSON payload.
Definition Message.hpp:21
Definition Message.hpp:21