The results of a REST call wrapped in a convenient struct. More...
#include "restresults.h"
Public Member Functions | |
confirmation_callback_t ()=default | |
Construct a new confirmation callback t object. More... | |
confirmation_callback_t (cluster *creator) | |
Construct a new confirmation callback t object. More... | |
confirmation_callback_t (cluster *creator, const confirmable_t &_value, const http_request_completion_t &_http) | |
Construct a new confirmation callback object. More... | |
confirmation_callback_t (const http_request_completion_t &_http) | |
Construct a new confirmation callback object. More... | |
template<typename T > | |
T | get () const |
Get the stored value via std::get. More... | |
error_info | get_error () const |
Get the error_info object. More... | |
bool | is_error () const |
Returns true if the call resulted in an error rather than a legitimate value in the confirmation_callback_t::value member. More... | |
Public Attributes | |
const class cluster * | bot |
Owner/creator of the callback object. More... | |
http_request_completion_t | http_info |
Information about the HTTP call used to make the request. More... | |
confirmable_t | value |
Value returned, wrapped in variant. More... | |
The results of a REST call wrapped in a convenient struct.
|
default |
Construct a new confirmation callback t object.
dpp::confirmation_callback_t::confirmation_callback_t | ( | cluster * | creator | ) |
Construct a new confirmation callback t object.
creator | owning cluster object |
dpp::confirmation_callback_t::confirmation_callback_t | ( | const http_request_completion_t & | _http | ) |
Construct a new confirmation callback object.
_http | The HTTP metadata from the REST call |
References dpp::http_request_completion_t::body, and http_info.
dpp::confirmation_callback_t::confirmation_callback_t | ( | cluster * | creator, |
const confirmable_t & | _value, | ||
const http_request_completion_t & | _http | ||
) |
Construct a new confirmation callback object.
creator | owning cluster object |
_value | The value to encapsulate in the confirmable_t |
_http | The HTTP metadata from the REST call |
References http_info, and dpp::http_request_completion_t::status.
|
inline |
Get the stored value via std::get.
T | type to get |
error_info dpp::confirmation_callback_t::get_error | ( | ) | const |
Get the error_info object.
The error_info object contains the details of any REST error, if there is an error (to find out if there is an error check confirmation_callback_t::is_error())
Referenced by main().
bool dpp::confirmation_callback_t::is_error | ( | ) | const |
Returns true if the call resulted in an error rather than a legitimate value in the confirmation_callback_t::value member.
Referenced by event_handler_test().
const class cluster* dpp::confirmation_callback_t::bot |
Owner/creator of the callback object.
http_request_completion_t dpp::confirmation_callback_t::http_info |
Information about the HTTP call used to make the request.
Referenced by confirmation_callback_t(), and main().
confirmable_t dpp::confirmation_callback_t::value |
Value returned, wrapped in variant.
Referenced by event_handler_test().