7#include <nlohmann/json.hpp>
29 std::string method, std::optional<nlohmann::json> params,
30 bool is_notification,
const std::function<
int()> &id_generator);
36 [[nodiscard]]
auto GetKey()
const -> int;
39 [[nodiscard]]
auto Dump()
const -> std::string;
43 std::optional<nlohmann::json> params_;
44 bool is_notification_;
Represents a JSON-RPC request.
auto Dump() const -> std::string
Serializes the request to a JSON string.
auto GetKey() const -> int
Returns the unique key (ID) for the request.
auto RequiresResponse() const -> bool
Checks if the request requires a response.
Request(std::string method, std::optional< nlohmann::json > params, bool is_notification, const std::function< int()> &id_generator)
Constructs a new Request object.