| D++ (DPP) C++ Discord API Bot Library

Search
Loading...
Searching...
No Matches
dpp::confirmation_callback_t Struct Reference

The results of a REST call wrapped in a convenient struct. More...

`#include <restresults.h>`

Collaboration diagram for dpp::confirmation_callback_t:
[legend]

## Public Member Functions

| confirmation_callback_t ()=default
| Construct a new confirmation callback t object.
| confirmation_callback_t (cluster *creator)
| Construct a new confirmation callback t object.
| confirmation_callback_t (cluster *creator, const confirmable_t &_value, const http_request_completion_t &_http)
| Construct a new confirmation callback object.
| confirmation_callback_t (const http_request_completion_t &_http)
| Construct a new confirmation callback object.
template<typename T>
T | get () const
| Get the stored value via std::get.
error_info | 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()).
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.

## Public Attributes

const class cluster * | bot
| Owner/creator of the callback object.
http_request_completion_t | http_info
| Information about the HTTP call used to make the request.
confirmable_t | value
| Value returned, wrapped in variant.

## Detailed Description

The results of a REST call wrapped in a convenient struct.

## Constructor & Destructor Documentation

## ◆ confirmation_callback_t() [1/4]

dpp::confirmation_callback_t::confirmation_callback_t | ( |  | ) |

default

Construct a new confirmation callback t object.

## ◆ confirmation_callback_t() [2/4]

dpp::confirmation_callback_t::confirmation_callback_t | ( | cluster * | creator | ) |

Construct a new confirmation callback t object.

Parameters

  creator | owning cluster object

## ◆ confirmation_callback_t() [3/4]

dpp::confirmation_callback_t::confirmation_callback_t | ( | const http_request_completion_t & | _http | ) |

Construct a new confirmation callback object.

Parameters

  _http | The HTTP metadata from the REST call

## ◆ confirmation_callback_t() [4/4]

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.

Parameters

  creator | owning cluster object
  _value | The value to encapsulate in the confirmable_t
  _http | The HTTP metadata from the REST call

## Member Function Documentation

## ◆ get()

template<typename T>

T dpp::confirmation_callback_t::get | ( |  | ) | const

inline

Get the stored value via std::get.

Template Parameters

  T | type to get

Returns
  stored value as type T

## ◆ get_error()

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()).

Returns
  error_info The details of the error message

## ◆ is_error()

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.

Returns
  true There was an error who's details can be obtained by get_error()
  false There was no error

## Member Data Documentation

## ◆ bot

const class cluster* dpp::confirmation_callback_t::bot

Owner/creator of the callback object.

## ◆ http_info

http_request_completion_t dpp::confirmation_callback_t::http_info

Information about the HTTP call used to make the request.

## ◆ value

confirmable_t dpp::confirmation_callback_t::value

Value returned, wrapped in variant.

D++ Library version 9.0.13 D++ Library version 9.0.12 D++ Library version 9.0.11 D++ Library version 9.0.10 D++ Library version 9.0.9 D++ Library version 9.0.8 D++ Library version 9.0.7 D++ Library version 9.0.6 D++ Library version 9.0.5 D++ Library version 9.0.4 D++ Library version 9.0.3 D++ Library version 9.0.2 D++ Library version 9.0.1 D++ Library version 9.0.0 D++ Library version 1.0.2 D++ Library version 1.0.1 D++ Library version 1.0.0